ftown 0.21.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/attention-events.d.ts +1 -1
  2. package/dist/attention-store.d.ts +3 -0
  3. package/dist/attention-store.js +25 -1
  4. package/dist/attention-store.js.map +1 -1
  5. package/dist/centrifugo-client.d.ts +14 -1
  6. package/dist/centrifugo-client.js +38 -4
  7. package/dist/centrifugo-client.js.map +1 -1
  8. package/dist/command-rpc.d.ts +2 -0
  9. package/dist/command-rpc.js +55 -9
  10. package/dist/command-rpc.js.map +1 -1
  11. package/dist/direct-transport/loopback-server.d.ts +10 -3
  12. package/dist/direct-transport/loopback-server.js +20 -4
  13. package/dist/direct-transport/loopback-server.js.map +1 -1
  14. package/dist/direct-transport/peer-manager.d.ts +8 -3
  15. package/dist/direct-transport/peer-manager.js +20 -5
  16. package/dist/direct-transport/peer-manager.js.map +1 -1
  17. package/dist/file-stamp.d.ts +33 -0
  18. package/dist/file-stamp.js +35 -0
  19. package/dist/file-stamp.js.map +1 -0
  20. package/dist/identity-reset.d.ts +3 -1
  21. package/dist/identity-reset.js +27 -5
  22. package/dist/identity-reset.js.map +1 -1
  23. package/dist/index.js +31 -37
  24. package/dist/index.js.map +1 -1
  25. package/dist/ledger-pairing-client.d.ts +1 -1
  26. package/dist/ledger-pairing-client.js +5 -3
  27. package/dist/ledger-pairing-client.js.map +1 -1
  28. package/dist/ledger-relay.d.ts +42 -7
  29. package/dist/ledger-relay.js +175 -33
  30. package/dist/ledger-relay.js.map +1 -1
  31. package/dist/ledger-reoffer.d.ts +56 -0
  32. package/dist/ledger-reoffer.js +210 -0
  33. package/dist/ledger-reoffer.js.map +1 -0
  34. package/dist/ledger-startup.d.ts +30 -5
  35. package/dist/ledger-startup.js +40 -10
  36. package/dist/ledger-startup.js.map +1 -1
  37. package/dist/local-api-server.d.ts +3 -0
  38. package/dist/local-api-server.js +68 -6
  39. package/dist/local-api-server.js.map +1 -1
  40. package/dist/mail-delivery.d.ts +26 -3
  41. package/dist/mail-delivery.js +65 -7
  42. package/dist/mail-delivery.js.map +1 -1
  43. package/dist/mail-store.d.ts +15 -1
  44. package/dist/mail-store.js +78 -16
  45. package/dist/mail-store.js.map +1 -1
  46. package/dist/outbound-pipeline-types.d.ts +5 -2
  47. package/dist/outbound-pipeline-types.js.map +1 -1
  48. package/dist/preview-protocol.d.ts +19 -3
  49. package/dist/preview-protocol.js +14 -0
  50. package/dist/preview-protocol.js.map +1 -1
  51. package/dist/relay-token.d.ts +6 -0
  52. package/dist/relay-token.js +9 -1
  53. package/dist/relay-token.js.map +1 -1
  54. package/dist/security/bridge/ledger-rpc.d.ts +34 -0
  55. package/dist/security/bridge/ledger-rpc.js +58 -0
  56. package/dist/security/bridge/ledger-rpc.js.map +1 -0
  57. package/dist/security/bridge/ledger-store.d.ts +82 -13
  58. package/dist/security/bridge/ledger-store.js +394 -54
  59. package/dist/security/bridge/ledger-store.js.map +1 -1
  60. package/dist/security/bridge/permissions.js +2 -1
  61. package/dist/security/bridge/permissions.js.map +1 -1
  62. package/dist/security/bridge/policy.d.ts +5 -1
  63. package/dist/security/bridge/policy.js +17 -0
  64. package/dist/security/bridge/policy.js.map +1 -1
  65. package/dist/security/bridge/security.d.ts +148 -10
  66. package/dist/security/bridge/security.js +270 -65
  67. package/dist/security/bridge/security.js.map +1 -1
  68. package/dist/security/crypto.d.ts +2 -0
  69. package/dist/security/crypto.js +43 -4
  70. package/dist/security/crypto.js.map +1 -1
  71. package/dist/security/ledger/announce.d.ts +32 -0
  72. package/dist/security/ledger/announce.js +101 -0
  73. package/dist/security/ledger/announce.js.map +1 -0
  74. package/dist/security/ledger/ledger.d.ts +107 -14
  75. package/dist/security/ledger/ledger.js +364 -83
  76. package/dist/security/ledger/ledger.js.map +1 -1
  77. package/dist/security/ledger/proof.d.ts +12 -0
  78. package/dist/security/ledger/proof.js +40 -8
  79. package/dist/security/ledger/proof.js.map +1 -1
  80. package/dist/security/ledger/protocol.d.ts +14 -1
  81. package/dist/security/ledger/protocol.js.map +1 -1
  82. package/dist/session-controller.d.ts +9 -3
  83. package/dist/session-controller.js +120 -20
  84. package/dist/session-controller.js.map +1 -1
  85. package/dist/session-inbox-protocol.d.ts +2 -0
  86. package/dist/session-preview.d.ts +20 -5
  87. package/dist/session-preview.js +185 -37
  88. package/dist/session-preview.js.map +1 -1
  89. package/dist/session-store.d.ts +22 -0
  90. package/dist/session-store.js +180 -13
  91. package/dist/session-store.js.map +1 -1
  92. package/dist/sessions-commands.js +41 -7
  93. package/dist/sessions-commands.js.map +1 -1
  94. package/dist/terminal-manager.d.ts +8 -0
  95. package/dist/terminal-manager.js +23 -1
  96. package/dist/terminal-manager.js.map +1 -1
  97. package/dist/terminal-output.d.ts +34 -0
  98. package/dist/terminal-output.js +68 -0
  99. package/dist/terminal-output.js.map +1 -0
  100. package/dist/terminal-pump.d.ts +48 -5
  101. package/dist/terminal-pump.js +143 -20
  102. package/dist/terminal-pump.js.map +1 -1
  103. package/dist/types.d.ts +1 -1
  104. package/opencode-plugin/ftown.js +15 -2
  105. package/package.json +2 -2
  106. package/skills/ftown/SKILL.md +18 -7
  107. package/skills/ftown/references/sessions.md +35 -10
@@ -51,21 +51,44 @@ ftown sessions archive
51
51
  ftown sessions revive <session-id>
52
52
  ```
53
53
 
54
- ## Preview session HTML
54
+ ## Preview session files
55
55
 
56
56
  ```bash
57
- ftown sessions preview ./preview.html
58
- ftown sessions preview --session-id <id> ./preview.html
57
+ ftown sessions preview ./preview.html ./notes.md
58
+ ftown sessions preview --add ./extra.html
59
+ ftown sessions preview --remove notes.md
59
60
  ftown sessions preview --clear
61
+ ftown sessions preview --session-id <id> ./preview.html ./notes.md
60
62
  ```
61
63
 
62
- The target defaults to `FTOWN_SESSION_ID`. The file must be a UTF-8 `.html` or
63
- `.htm` file of at most 1 MiB inside that session's working directory. Relative
64
- paths resolve from the CLI's current directory. Use a self-contained document:
65
- inline CSS and JavaScript and data images are supported; sibling files and
66
- network access are not. Write a temporary file and rename it over the registered
67
- file to publish a complete update. Closing the dashboard preview does not clear
68
- the registration; `--clear` removes the registration without deleting the file.
64
+ The target defaults to `FTOWN_SESSION_ID`. A session holds up to 12 files, in
65
+ registration order. Kind is by extension (case-insensitive): `.html`/`.htm` →
66
+ HTML, `.md`/`.markdown` → Markdown; anything else is rejected. Each file must
67
+ be UTF-8, at most 1 MiB, and inside that session's working directory; relative
68
+ paths resolve from the CLI's current directory. Two registered files may not
69
+ share a basename (the selector and links are by basename): a duplicate basename
70
+ is rejected with a clear error. Registration is all-or-nothing — if any path
71
+ fails validation or the set would exceed 12 files, nothing changes.
72
+
73
+ The four forms: `preview <path...>` replaces the whole set with these files;
74
+ `--add <path...>` appends to the current set; `--remove <name...>` removes by
75
+ basename (removing the last file clears the preview); `--clear` removes the
76
+ whole registration without deleting files. `--add`, `--remove`, and `--clear`
77
+ are mutually exclusive; no paths and no flag is a usage error. Use
78
+ `--session-id <id>` for an explicit target session.
79
+
80
+ HTML previews use a self-contained document: inline CSS and JavaScript and
81
+ data images are supported; sibling files and network access are not. Markdown
82
+ is rendered as a readable document with GFM (tables, task lists, strikethrough,
83
+ fenced code) inside the same sandbox iframe — no network, only `data:` images
84
+ — and raw HTML inside the markdown is isolated the same way as an HTML preview.
85
+ With two or more registered files, the dashboard shows a file selector in the
86
+ preview toolbar; a relative link between registered files (matching a
87
+ basename, ignoring `./`, query and `#fragment`) switches the selector instead
88
+ of opening the default behavior. Write a temporary file and rename it over the
89
+ registered file to publish a complete update; a reload resets the preview's own
90
+ interactive state. Closing the dashboard preview does not clear the
91
+ registration; `--clear` removes the registration without deleting the file.
69
92
 
70
93
  Preview conversation input arrives through the session's existing ftown mail.
71
94
  Post a tool-authored reply with:
@@ -298,6 +321,8 @@ The CLI wraps the loopback API. Raw access if needed:
298
321
  | POST | `/api/sessions/:id/inbox` | Send mail (`{ body, from?, fromName?, type?, threadId? }`) |
299
322
  | GET | `/api/sessions/:id/inbox` | Read mail (`?wait=&peek=&limit=&all=`) |
300
323
  | POST | `/api/sessions/:id/message` | Inject a message line as keystrokes (`{ text, from? }`) |
324
+ | PUT | `/api/sessions/:id/preview` | Replace or add preview files, local CLI only (`{ paths: string[], mode: 'replace' \| 'add' }`) |
325
+ | DELETE | `/api/sessions/:id/preview` | Remove preview files by name or clear the preview, local CLI only (`{ names?: string[] }`; absent names clears all) |
301
326
  | DELETE | `/api/sessions/:id` | Remove (tombstone-archived) |
302
327
  | GET | `/api/archive` | List removed-session tombstones |
303
328
  | POST | `/api/sessions/:id/revive` | Recreate a removed session (new id) |