You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Audit date: 2026-05-21 Purpose: What each file under js/ does, whether it loads in the KaiOS app shell (index.html), and how it relates to node_modules/.
RecordTemplateService, template-creator.js, Management My Templates tab
Wizard field bundles — personal (created) or imported (adopted external)
Presentation template
TemplateRegistry.js, NoteCodec, #t/ / #te/
HTML/CSS packs for notes / 1pb — not My Templates
My Templates lifecycle
State
Fields
UI
Personal
no receivedAt
My Templates → Personal; list picker → Personal
Awaiting import
receivedAt, no importedAt
Imported tab subline → pending list; CSK Import
Imported
importedAt set
My Templates → Imported; deliberate adoption
receiveExternal() stores awaiting-import copies; importTemplate(id) sets importedAt. Pinned list keys may be rtpl_* ids (My Templates) or standard type values.
Not the same:template-creator.js → RecordTemplateService, not TemplateRegistry.
node_modules/ (development only)
Item
What it is
Not shipped on device
KaiOS loads index.html + scripts under js/ only. npm run pack zips index.html, css/, js/, img/, manifest — notnode_modules/.
Single dependency
@workpads/codec → file:../workpads-codec (see root package.json).
Used for
npm test → test/flow.test.js exercises the npm package (CLI-interop path). test/codec-pads-v1.test.js reads js/lib/codec.js directly and does not need the package at runtime.
Not used in browser
The phone app uses inlined js/lib/codec.js (window.WPCodec), not require('@workpads/codec').
After npm install, node_modules/@workpads/codec is a symlink/copy of ../workpads-codec. Deleting node_modules does not affect the packaged KaiOS app; it only breaks npm test / flow.test.js.
Load model
flowchart LR
subgraph device [KaiOS device]
HTML[index.html script tags]
INLINE[js/lib/codec.js WPCodec]
end
subgraph dev [Developer machine]
NM[node_modules/@workpads/codec]
TEST[test/flow.test.js]
end
HTML --> INLINE
NM --> TEST
Loading
2026-05-21: Protocol libs in shell: anon.js, trig.js, ctrig.js, markers.js, agreements.js, roles.js (after codec.js). Off shell:formula.js, template-registry.js. Shared UI: ui-fields.js. RecordService session list cache + listByChainRef. Pack excludes demo.js / browser-dev.js. See IMPLEMENTATION-REPORT.md.