dal-code 1.0.44 → 1.0.46

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 (780) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/NOTICE +66 -1
  3. package/PRIVACY.md +159 -102
  4. package/dal-docs/README.md +1 -1
  5. package/dal-docs/keybindings.md +1 -0
  6. package/dal-docs/settings.md +5 -0
  7. package/dist/bun/register-bedrock.js +1 -0
  8. package/dist/cli/args.js +2 -2
  9. package/dist/cli/auth-check.js +1 -1
  10. package/dist/cli/auth-command.js +6 -5
  11. package/dist/cli/credential-print.js +1 -1
  12. package/dist/cli/experimental/auth.js +1 -0
  13. package/dist/cli/experimental/cli.js +1 -0
  14. package/dist/cli/experimental/command-options.js +1 -0
  15. package/dist/cli/experimental/command.js +1 -0
  16. package/dist/cli/experimental/commands/client.js +1 -0
  17. package/dist/cli/experimental/commands/pi.js +1 -0
  18. package/dist/cli/experimental/commands/server.js +1 -0
  19. package/dist/cli/experimental/transport-address.js +1 -0
  20. package/dist/cli/list-models.js +2 -2
  21. package/dist/cli/piped-stdin.js +2 -0
  22. package/dist/cli/startup-diagnostics.js +1 -0
  23. package/dist/client/index.js +1 -0
  24. package/dist/client/remote-session.js +1 -0
  25. package/dist/client/transcript.js +1 -0
  26. package/dist/config.d.ts +1 -0
  27. package/dist/config.js +1 -1
  28. package/dist/core/agent-log.d.ts +6 -0
  29. package/dist/core/agent-log.js +3 -0
  30. package/dist/core/agent-session-runtime.js +1 -1
  31. package/dist/core/agent-session-services.d.ts +0 -1
  32. package/dist/core/agent-session-services.js +1 -1
  33. package/dist/core/agent-session.d.ts +20 -3
  34. package/dist/core/agent-session.js +8 -8
  35. package/dist/core/auth-storage.js +1 -1
  36. package/dist/core/background-processes.js +7 -7
  37. package/dist/core/client-identity.js +1 -0
  38. package/dist/core/compaction/branch-summarization.js +3 -3
  39. package/dist/core/compaction/compaction.d.ts +2 -2
  40. package/dist/core/compaction/compaction.js +11 -9
  41. package/dist/core/compaction-backoff.js +1 -0
  42. package/dist/core/dal-session-headers.js +1 -0
  43. package/dist/core/export-html/index.js +2 -2
  44. package/dist/core/export-html/template.html +1 -0
  45. package/dist/core/export-html/template.js +35 -35
  46. package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
  47. package/dist/core/export-html/vendor/marked.min.js +30 -29
  48. package/dist/core/extensions/loader.js +1 -1
  49. package/dist/core/extensions/runner.d.ts +6 -0
  50. package/dist/core/extensions/runner.js +1 -1
  51. package/dist/core/extensions/types.d.ts +6 -1
  52. package/dist/core/extensions/virtual-modules.js +1 -1
  53. package/dist/core/http-dispatcher.js +1 -1
  54. package/dist/core/key-id-schema.js +1 -0
  55. package/dist/core/keybindings-schema.js +1 -0
  56. package/dist/core/keybindings.d.ts +5 -0
  57. package/dist/core/keybindings.js +1 -1
  58. package/dist/core/model-config.d.ts +1805 -102
  59. package/dist/core/model-config.js +4 -4
  60. package/dist/core/model-identity.js +2 -0
  61. package/dist/core/model-resolver.d.ts +30 -10
  62. package/dist/core/model-resolver.js +1 -1
  63. package/dist/core/model-runtime.d.ts +3 -0
  64. package/dist/core/model-runtime.js +2 -2
  65. package/dist/core/package-manager.d.ts +7 -0
  66. package/dist/core/package-manager.js +2 -2
  67. package/dist/core/permissions/shell-words.d.ts +26 -0
  68. package/dist/core/project-trust.js +2 -2
  69. package/dist/core/prompt-templates.js +2 -2
  70. package/dist/core/provider-attribution.js +1 -1
  71. package/dist/core/provider-composer.d.ts +2 -1
  72. package/dist/core/provider-composer.js +1 -1
  73. package/dist/core/remote-catalog-provider.js +1 -1
  74. package/dist/core/resource-loader.js +1 -1
  75. package/dist/core/sandbox/bwrap-placeholders.js +1 -1
  76. package/dist/core/sandbox/index.d.ts +1 -1
  77. package/dist/core/sandbox/index.js +1 -1
  78. package/dist/core/sandbox/libreoffice.js +1 -0
  79. package/dist/core/sandbox/policy.d.ts +4 -0
  80. package/dist/core/sandbox/policy.js +1 -1
  81. package/dist/core/sandbox/runtime.d.ts +3 -0
  82. package/dist/core/sandbox/runtime.js +1 -1
  83. package/dist/core/sandbox/shell-sandbox.d.ts +2 -0
  84. package/dist/core/sandbox/shell-sandbox.js +6 -6
  85. package/dist/core/sandbox/windows.js +4 -4
  86. package/dist/core/sdk.js +1 -1
  87. package/dist/core/session-manager.d.ts +1 -0
  88. package/dist/core/session-manager.js +12 -12
  89. package/dist/core/session-stall-monitor.d.ts +41 -0
  90. package/dist/core/session-stall-monitor.js +2 -0
  91. package/dist/core/settings-defaults.js +1 -0
  92. package/dist/core/settings-manager.d.ts +9 -0
  93. package/dist/core/settings-manager.js +1 -1
  94. package/dist/core/settings-schema.d.ts +231 -0
  95. package/dist/core/settings-schema.js +1 -0
  96. package/dist/core/stall-watchdog.d.ts +55 -0
  97. package/dist/core/stall-watchdog.js +1 -0
  98. package/dist/core/system-prompt.js +10 -10
  99. package/dist/core/tools/bash-read-only.d.ts +1 -0
  100. package/dist/core/tools/bash.d.ts +1 -0
  101. package/dist/core/tools/bash.js +14 -14
  102. package/dist/core/tools/edit.d.ts +1 -1
  103. package/dist/core/tools/edit.js +3 -3
  104. package/dist/core/tools/grep.js +1 -1
  105. package/dist/core/tools/path-utils.d.ts +1 -0
  106. package/dist/core/tools/path-utils.js +1 -1
  107. package/dist/core/tools/read.js +12 -12
  108. package/dist/core/tools/render-utils.d.ts +40 -0
  109. package/dist/core/tools/render-utils.js +7 -7
  110. package/dist/core/tools/renderers/read.js +8 -8
  111. package/dist/core/trust-manager.js +1 -1
  112. package/dist/core/workspace-lock.d.ts +6 -2
  113. package/dist/core/workspace-lock.js +3 -3
  114. package/dist/dal/builtins.js +2 -2
  115. package/dist/dal/extension-compat.js +4 -4
  116. package/dist/dal/hooks/config.d.ts +5 -1
  117. package/dist/dal/hooks/config.js +1 -1
  118. package/dist/dal/hooks/extension.js +3 -3
  119. package/dist/dal/hooks/index.d.ts +1 -1
  120. package/dist/dal/hooks/index.js +1 -1
  121. package/dist/dal/i18n.js +1 -1
  122. package/dist/dal/manifest.d.ts +1 -0
  123. package/dist/dal/manifest.js +1 -1
  124. package/dist/dal/safety-net.js +3 -1
  125. package/dist/extensions/codemode/execute.js +22 -15
  126. package/dist/extensions/codemode/index.js +1 -1
  127. package/dist/extensions/codemode/renderer.js +6 -6
  128. package/dist/extensions/codemode/tool.d.ts +2 -3
  129. package/dist/extensions/codemode/tool.js +9 -12
  130. package/dist/extensions/mcp/cli.js +4 -4
  131. package/dist/extensions/mcp/config.js +2 -2
  132. package/dist/extensions/mcp/index.js +12 -12
  133. package/dist/extensions/mcp/oauth.js +2 -2
  134. package/dist/extensions/mcp/resources.d.ts +0 -5
  135. package/dist/extensions/mcp/resources.js +1 -1
  136. package/dist/extensions/mcp/runtime.d.ts +1 -4
  137. package/dist/extensions/mcp/runtime.js +3 -3
  138. package/dist/extensions/mcp/tools.js +7 -7
  139. package/dist/extensions/tool-search/tool.js +3 -3
  140. package/dist/index.d.ts +7 -3
  141. package/dist/index.js +1 -1
  142. package/dist/main.js +4 -4
  143. package/dist/migrations.js +3 -5
  144. package/dist/modes/interactive/components/daxnuts.js +1 -0
  145. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  146. package/dist/modes/interactive/components/settings-selector.js +1 -1
  147. package/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  148. package/dist/modes/interactive/components/status-indicator.js +1 -1
  149. package/dist/modes/interactive/components/tree-selector.js +1 -1
  150. package/dist/modes/interactive/external-editor.js +1 -1
  151. package/dist/modes/interactive/interactive-mode.d.ts +7 -7
  152. package/dist/modes/interactive/interactive-mode.js +26 -26
  153. package/dist/modes/interactive/session-share.js +2 -2
  154. package/dist/modes/interactive/theme/dark.json +1 -1
  155. package/dist/modes/interactive/theme/light.json +1 -1
  156. package/dist/modes/interactive/theme/theme-json.js +4 -4
  157. package/dist/modes/interactive/theme/theme-schema.d.ts +18 -0
  158. package/dist/modes/interactive/theme/theme-schema.js +12 -0
  159. package/dist/modes/interactive/theme/theme-schema.json +2 -7
  160. package/dist/modes/interactive/theme/theme-tokens.d.ts +255 -0
  161. package/dist/modes/interactive/theme/theme-tokens.js +1 -0
  162. package/dist/modes/interactive/theme/theme.d.ts +7 -10
  163. package/dist/modes/interactive/theme/theme.js +5 -5
  164. package/dist/modes/print-mode.d.ts +1 -0
  165. package/dist/modes/print-mode.js +8 -7
  166. package/dist/modes/rpc/rpc-client.d.ts +5 -1
  167. package/dist/modes/rpc/rpc-client.js +3 -3
  168. package/dist/modes/rpc/rpc-mode.js +1 -1
  169. package/dist/modes/rpc/rpc-types.d.ts +20 -0
  170. package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
  171. package/dist/node_modules/@dalcode/dal-advisor/src/index.js +8 -8
  172. package/dist/node_modules/@dalcode/dal-awake/package.json +2 -2
  173. package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
  174. package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
  175. package/dist/node_modules/@dalcode/dal-capabilities/src/catalogue.js +1 -1
  176. package/dist/node_modules/@dalcode/dal-capabilities/src/index.js +9 -9
  177. package/dist/node_modules/@dalcode/dal-capabilities/src/match.js +1 -1
  178. package/dist/node_modules/@dalcode/dal-capabilities/src/state.js +3 -3
  179. package/dist/node_modules/@dalcode/dal-codeindex/package.json +34 -0
  180. package/dist/node_modules/@dalcode/dal-codeindex/src/extract.js +3 -0
  181. package/dist/node_modules/@dalcode/dal-codeindex/src/format.js +11 -0
  182. package/dist/node_modules/@dalcode/dal-codeindex/src/index.js +4 -0
  183. package/dist/node_modules/@dalcode/dal-codeindex/src/indexer.js +1 -0
  184. package/dist/node_modules/@dalcode/dal-codeindex/src/languages.js +176 -0
  185. package/dist/node_modules/@dalcode/dal-codeindex/src/project.js +1 -0
  186. package/dist/node_modules/@dalcode/dal-codeindex/src/query.js +2 -0
  187. package/dist/node_modules/@dalcode/dal-codeindex/src/runtime.js +1 -0
  188. package/dist/node_modules/@dalcode/dal-codeindex/src/scan.js +1 -0
  189. package/dist/node_modules/@dalcode/dal-codeindex/src/semantic.js +2 -0
  190. package/dist/node_modules/@dalcode/dal-codeindex/src/sqlite.js +1 -0
  191. package/dist/node_modules/@dalcode/dal-codeindex/src/store.js +33 -0
  192. package/dist/node_modules/@dalcode/dal-codeindex/src/worker.js +1 -0
  193. package/dist/node_modules/@dalcode/dal-compat/package.json +2 -2
  194. package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
  195. package/dist/node_modules/@dalcode/dal-dap/src/install.js +2 -2
  196. package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
  197. package/dist/node_modules/@dalcode/dal-goal/package.json +3 -3
  198. package/dist/node_modules/@dalcode/dal-guard/package.json +5 -4
  199. package/dist/node_modules/@dalcode/dal-guard/src/credentials.js +7 -1
  200. package/dist/node_modules/@dalcode/dal-guard/src/edit-anchor-core.js +25 -23
  201. package/dist/node_modules/@dalcode/dal-guard/src/edit-anchor.js +4 -4
  202. package/dist/node_modules/@dalcode/dal-guard/src/index.js +4 -2
  203. package/dist/node_modules/@dalcode/dal-guard/src/mode.js +2 -2
  204. package/dist/node_modules/@dalcode/dal-guard/src/policy.js +1 -0
  205. package/dist/node_modules/@dalcode/dal-guard/src/session-files.js +1 -0
  206. package/dist/node_modules/@dalcode/dal-guard/src/suspicion.js +1 -0
  207. package/dist/node_modules/@dalcode/dal-guard/src/workspace.js +2 -2
  208. package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
  209. package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
  210. package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
  211. package/dist/node_modules/@dalcode/dal-learn/package.json +4 -2
  212. package/dist/node_modules/@dalcode/dal-learn/src/engine.js +4 -4
  213. package/dist/node_modules/@dalcode/dal-learn/src/index.js +15 -14
  214. package/dist/node_modules/@dalcode/dal-learn/src/revisions.js +3 -0
  215. package/dist/node_modules/@dalcode/dal-learn/src/safety.js +1 -1
  216. package/dist/node_modules/@dalcode/dal-learn/src/skill-evolution.js +14 -14
  217. package/dist/node_modules/@dalcode/dal-lsp/package.json +5 -3
  218. package/dist/node_modules/@dalcode/dal-lsp/src/config.js +1 -1
  219. package/dist/node_modules/@dalcode/dal-lsp/src/index.js +14 -11
  220. package/dist/node_modules/@dalcode/dal-lsp/src/managed.js +1 -0
  221. package/dist/node_modules/@dalcode/dal-mcp/package.json +8 -5
  222. package/dist/node_modules/@dalcode/dal-mcp/src/child-env.js +3 -0
  223. package/dist/node_modules/@dalcode/dal-mcp/src/http-client.d.ts +9 -27
  224. package/dist/node_modules/@dalcode/dal-mcp/src/http-client.js +1 -2
  225. package/dist/node_modules/@dalcode/dal-mcp/src/index.js +17 -17
  226. package/dist/node_modules/@dalcode/dal-mcp/src/protocol-client.d.ts +38 -0
  227. package/dist/node_modules/@dalcode/dal-mcp/src/protocol-client.js +1 -0
  228. package/dist/node_modules/@dalcode/dal-mcp/src/proxy.js +6 -6
  229. package/dist/node_modules/@dalcode/dal-mcp/src/resources.js +1 -0
  230. package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.d.ts +10 -18
  231. package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.js +4 -5
  232. package/dist/node_modules/@dalcode/dal-mcp/src/types.d.ts +50 -5
  233. package/dist/node_modules/@dalcode/dal-mcp/src/types.js +1 -1
  234. package/dist/node_modules/@dalcode/dal-office/package.json +3 -2
  235. package/dist/node_modules/@dalcode/dal-office/src/extract/cell.js +1 -0
  236. package/dist/node_modules/@dalcode/dal-office/src/extract/index.js +2 -2
  237. package/dist/node_modules/@dalcode/dal-office/src/extract/ooxml.js +4 -4
  238. package/dist/node_modules/@dalcode/dal-office/src/extract/pdf.js +4 -4
  239. package/dist/node_modules/@dalcode/dal-office/src/facts.d.ts +15 -0
  240. package/dist/node_modules/@dalcode/dal-office/src/facts.js +4 -0
  241. package/dist/node_modules/@dalcode/dal-office/src/index.js +1 -1
  242. package/dist/node_modules/@dalcode/dal-office/src/lazy.js +1 -0
  243. package/dist/node_modules/@dalcode/dal-office/src/{index.d.ts → office.d.ts} +4 -5
  244. package/dist/node_modules/@dalcode/dal-office/src/office.js +1 -0
  245. package/dist/node_modules/@dalcode/dal-office/src/render/capture.d.ts +21 -0
  246. package/dist/node_modules/@dalcode/dal-office/src/render/capture.js +13 -0
  247. package/dist/node_modules/@dalcode/dal-office/src/render/chart.d.ts +15 -0
  248. package/dist/node_modules/@dalcode/dal-office/src/render/chart.js +3 -3
  249. package/dist/node_modules/@dalcode/dal-office/src/render/docx.d.ts +4 -0
  250. package/dist/node_modules/@dalcode/dal-office/src/render/docx.js +1 -1
  251. package/dist/node_modules/@dalcode/dal-office/src/render/pptx.d.ts +10 -0
  252. package/dist/node_modules/@dalcode/dal-office/src/render/pptx.js +4 -3
  253. package/dist/node_modules/@dalcode/dal-office/src/render/table-layout.js +1 -0
  254. package/dist/node_modules/@dalcode/dal-office/src/render/xlsx-chart.d.ts +24 -0
  255. package/dist/node_modules/@dalcode/dal-office/src/render/xlsx-chart.js +1 -0
  256. package/dist/node_modules/@dalcode/dal-office/src/render/xlsx.d.ts +9 -0
  257. package/dist/node_modules/@dalcode/dal-office/src/render/xlsx.js +1 -1
  258. package/dist/node_modules/@dalcode/dal-office/src/scratchpad.d.ts +2 -0
  259. package/dist/node_modules/@dalcode/dal-office/src/scratchpad.js +1 -1
  260. package/dist/node_modules/@dalcode/dal-office/src/table-stats.js +2 -0
  261. package/dist/node_modules/@dalcode/dal-office/src/themes.d.ts +2 -0
  262. package/dist/node_modules/@dalcode/dal-office/src/themes.js +1 -1
  263. package/dist/node_modules/@dalcode/dal-office/src/tools/chart-generate.js +4 -3
  264. package/dist/node_modules/@dalcode/dal-office/src/tools/doc-generate.js +2 -3
  265. package/dist/node_modules/@dalcode/dal-office/src/tools/docx-edit.js +5 -5
  266. package/dist/node_modules/@dalcode/dal-office/src/tools/drawio-generate.js +2 -3
  267. package/dist/node_modules/@dalcode/dal-office/src/tools/md-generate.js +2 -3
  268. package/dist/node_modules/@dalcode/dal-office/src/tools/ppt-generate.js +5 -2
  269. package/dist/node_modules/@dalcode/dal-office/src/tools/ppt-plan.js +4 -2
  270. package/dist/node_modules/@dalcode/dal-office/src/tools/pptx-edit.js +5 -5
  271. package/dist/node_modules/@dalcode/dal-office/src/tools/read-file.js +4 -3
  272. package/dist/node_modules/@dalcode/dal-office/src/tools/render-page.js +4 -0
  273. package/dist/node_modules/@dalcode/dal-office/src/tools/sheet-generate.js +3 -3
  274. package/dist/node_modules/@dalcode/dal-office/src/tools/xlsx-edit.js +3 -3
  275. package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +19 -13
  276. package/dist/node_modules/@dalcode/dal-pi-kit/dist/index.js +1 -1
  277. package/dist/node_modules/@dalcode/dal-pi-kit/dist/project-size.js +1 -0
  278. package/dist/node_modules/@dalcode/dal-pi-kit/dist/session-scope.js +1 -0
  279. package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
  280. package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +19 -13
  281. package/dist/node_modules/@dalcode/dal-pi-kit/src/index.js +1 -1
  282. package/dist/node_modules/@dalcode/dal-pi-kit/src/project-size.js +1 -0
  283. package/dist/node_modules/@dalcode/dal-pi-kit/src/session-scope.js +1 -0
  284. package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -5
  285. package/dist/node_modules/@dalcode/dal-plugins/src/brand.js +1 -1
  286. package/dist/node_modules/@dalcode/dal-plugins/src/index.js +10 -10
  287. package/dist/node_modules/@dalcode/dal-plugins/src/manage.js +7 -7
  288. package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
  289. package/dist/node_modules/@dalcode/dal-recall/src/index.js +1 -1
  290. package/dist/node_modules/@dalcode/dal-remote/package.json +2 -2
  291. package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
  292. package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
  293. package/dist/node_modules/@dalcode/dal-rewind/src/commands.js +1 -1
  294. package/dist/node_modules/@dalcode/dal-rewind/src/core.d.ts +2 -1
  295. package/dist/node_modules/@dalcode/dal-rewind/src/core.js +8 -8
  296. package/dist/node_modules/@dalcode/dal-rewind/src/index.js +1 -1
  297. package/dist/node_modules/@dalcode/dal-rewind/src/state.js +1 -1
  298. package/dist/node_modules/@dalcode/dal-router/package.json +13 -10
  299. package/dist/node_modules/@dalcode/dal-router/src/advisor.js +1 -1
  300. package/dist/node_modules/@dalcode/dal-router/src/commands.js +8 -8
  301. package/dist/node_modules/@dalcode/dal-router/src/config.d.ts +12 -34
  302. package/dist/node_modules/@dalcode/dal-router/src/config.js +2 -2
  303. package/dist/node_modules/@dalcode/dal-router/src/index.js +2 -4
  304. package/dist/node_modules/@dalcode/dal-router/src/notice.js +1 -0
  305. package/dist/node_modules/@dalcode/dal-router/src/roles/changes.js +5 -0
  306. package/dist/node_modules/@dalcode/dal-router/src/roles/deliverables.js +4 -0
  307. package/dist/node_modules/@dalcode/dal-router/src/roles/index.js +15 -0
  308. package/dist/node_modules/@dalcode/dal-router/src/roles/models.d.ts +50 -0
  309. package/dist/node_modules/@dalcode/dal-router/src/roles/models.js +1 -0
  310. package/dist/node_modules/@dalcode/dal-router/src/roles/planner.js +4 -0
  311. package/dist/node_modules/@dalcode/dal-router/src/roles/prompts.js +42 -0
  312. package/dist/node_modules/@dalcode/dal-router/src/roles/signals.js +2 -0
  313. package/dist/node_modules/@dalcode/dal-router/src/runtime.d.ts +3 -13
  314. package/dist/node_modules/@dalcode/dal-router/src/runtime.js +1 -1
  315. package/dist/node_modules/@dalcode/dal-router/src/subagent.js +1 -1
  316. package/dist/node_modules/@dalcode/dal-router/src/task-shape.d.ts +8 -0
  317. package/dist/node_modules/@dalcode/dal-router/src/task-shape.js +1 -0
  318. package/dist/node_modules/@dalcode/dal-rtk/package.json +2 -2
  319. package/dist/node_modules/@dalcode/dal-skills/package.json +4 -3
  320. package/dist/node_modules/@dalcode/dal-skills/src/bundled/chart-design/SKILL.md +35 -0
  321. package/dist/node_modules/@dalcode/dal-skills/src/bundled/dal-slides/SKILL.md +82 -0
  322. package/dist/node_modules/@dalcode/dal-skills/src/bundled/diagram-design/SKILL.md +7 -5
  323. package/dist/node_modules/@dalcode/dal-skills/src/bundled/poster-design/SKILL.md +8 -6
  324. package/dist/node_modules/@dalcode/dal-skills/src/bundled/print-design/SKILL.md +21 -8
  325. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/diagram.html +1 -1
  326. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/mindmap.html +1 -1
  327. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/event-poster.html +1 -1
  328. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/poster.css +1 -1
  329. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/square-card.html +1 -1
  330. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/wechat-cover.html +1 -1
  331. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/xhs-card.html +1 -1
  332. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/xhs-cover.html +8 -5
  333. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/letter.html +1 -1
  334. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/report.html +1 -1
  335. package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/resume.html +7 -3
  336. package/dist/node_modules/@dalcode/dal-skills/src/bundled/web-design/SKILL.md +4 -4
  337. package/dist/node_modules/@dalcode/dal-skills/src/bundled.js +1 -1
  338. package/dist/node_modules/@dalcode/dal-skills/src/catalog.js +3 -2
  339. package/dist/node_modules/@dalcode/dal-skills/src/client.js +1 -1
  340. package/dist/node_modules/@dalcode/dal-skills/src/hint.js +1 -0
  341. package/dist/node_modules/@dalcode/dal-skills/src/index.js +13 -14
  342. package/dist/node_modules/@dalcode/dal-skills/src/packages.js +3 -3
  343. package/dist/node_modules/@dalcode/dal-skills/src/search.js +1 -1
  344. package/dist/node_modules/@dalcode/dal-statusline/package.json +2 -2
  345. package/dist/node_modules/@dalcode/dal-structured/package.json +2 -2
  346. package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
  347. package/dist/node_modules/@dalcode/dal-subagent/src/background.js +10 -10
  348. package/dist/node_modules/@dalcode/dal-subagent/src/index.js +18 -20
  349. package/dist/node_modules/@dalcode/dal-telemetry/package.json +3 -3
  350. package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
  351. package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
  352. package/dist/node_modules/@dalcode/dal-tool-catalog/src/groups.js +1 -1
  353. package/dist/node_modules/@dalcode/dal-tool-catalog/src/index.js +4 -4
  354. package/dist/node_modules/@dalcode/dal-usage/package.json +2 -2
  355. package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
  356. package/dist/node_modules/@dalcode/dal-workflow/LICENSE +27 -0
  357. package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
  358. package/dist/node_modules/@dalcode/dal-workflow/src/announce-check.js +3 -1
  359. package/dist/node_modules/@dalcode/dal-workflow/src/deliverable-scope.js +1 -0
  360. package/dist/node_modules/@dalcode/dal-workflow/src/index.js +4 -4
  361. package/dist/node_modules/@dalcode/dal-workflow/src/plan-mode.js +13 -13
  362. package/dist/node_modules/@dalcode/dal-workflow/src/test-proof-note.js +3 -0
  363. package/dist/node_modules/@dalcode/dal-workflow/src/todo-snapshot.js +2 -0
  364. package/dist/node_modules/@dalcode/dal-workflow/src/todo.js +3 -3
  365. package/dist/node_modules/@dalcode/dal-workflow/src/truncation-check.js +1 -0
  366. package/dist/node_modules/@dalcode/dal-workflow/src/working-contract.js +1 -1
  367. package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
  368. package/dist/node_modules/@dalcode/deepailab/src/index.js +3 -3
  369. package/dist/node_modules/@earendil-works/pi-agent-core/README.md +5 -0
  370. package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +2 -1
  371. package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +1 -1
  372. package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +3 -1
  373. package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent.js +1 -1
  374. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +1 -0
  375. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +37 -0
  376. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +104 -0
  377. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js +16 -0
  378. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js +1 -0
  379. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js +1 -0
  380. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +10 -0
  381. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +1 -0
  382. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js +1 -0
  383. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js +1 -0
  384. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js +1 -0
  385. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js +1 -0
  386. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +17 -0
  387. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/bash.js +1 -0
  388. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/bounded.js +1 -0
  389. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/chord.js +1 -0
  390. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/context.js +1 -0
  391. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/harness.js +1 -0
  392. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/hooks.js +1 -0
  393. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/index.js +1 -0
  394. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/jsonl.js +4 -0
  395. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/collapse.js +3 -0
  396. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/entries.js +1 -0
  397. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/frames.js +1 -0
  398. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/generation.js +1 -0
  399. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/job.js +1 -0
  400. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/plugin.js +1 -0
  401. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/post-tools.js +1 -0
  402. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/task-api.js +1 -0
  403. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/tool.js +3 -0
  404. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/membrane.js +1 -0
  405. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/memory.js +1 -0
  406. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/scheduler.js +1 -0
  407. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/session.js +1 -0
  408. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/system.js +8 -0
  409. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/types.js +1 -0
  410. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/view.js +1 -0
  411. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +5 -0
  412. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +1 -0
  413. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js +1 -0
  414. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js +1 -0
  415. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js +1 -0
  416. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js +1 -0
  417. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js +1 -0
  418. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js +1 -0
  419. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js +1 -0
  420. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js +1 -0
  421. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js +1 -0
  422. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js +1 -0
  423. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js +1 -0
  424. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js +1 -0
  425. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js +1 -0
  426. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js +1 -0
  427. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js +1 -0
  428. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js +1 -0
  429. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js +1 -0
  430. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js +1 -0
  431. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js +1 -0
  432. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js +1 -0
  433. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js +1 -0
  434. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js +1 -0
  435. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js +1 -0
  436. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js +1 -0
  437. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js +1 -0
  438. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +1 -0
  439. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js +1 -0
  440. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js +1 -0
  441. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js +1 -0
  442. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +1 -0
  443. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js +1 -0
  444. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js +1 -0
  445. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js +3 -0
  446. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js +1 -0
  447. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js +1 -0
  448. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js +8 -0
  449. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js +1 -0
  450. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +1 -0
  451. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +5 -0
  452. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +1 -0
  453. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +1 -0
  454. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +1 -0
  455. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js +1 -0
  456. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js +1 -0
  457. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +1 -0
  458. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +1 -0
  459. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +1 -0
  460. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js +1 -0
  461. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js +1 -0
  462. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js +1 -0
  463. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js +1 -0
  464. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js +1 -0
  465. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +1 -0
  466. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js +1 -0
  467. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js +1 -0
  468. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js +1 -0
  469. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js +1 -0
  470. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js +1 -0
  471. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js +1 -0
  472. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +10 -0
  473. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js +2 -0
  474. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js +1 -0
  475. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +12 -0
  476. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit-diff.js +16 -0
  477. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +1 -0
  478. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +1 -0
  479. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/image.js +1 -0
  480. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/index.js +1 -0
  481. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +1 -0
  482. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +14 -0
  483. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +1 -0
  484. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +1 -0
  485. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js +1 -0
  486. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js +5 -0
  487. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +1 -0
  488. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +5 -0
  489. package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js +1 -0
  490. package/dist/node_modules/@earendil-works/pi-agent-core/dist/node.js +1 -0
  491. package/dist/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +1 -0
  492. package/dist/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +2 -0
  493. package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  494. package/dist/node_modules/@earendil-works/pi-ai/README.md +83 -37
  495. package/dist/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +5 -5
  496. package/dist/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +1 -1
  497. package/dist/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +1 -1
  498. package/dist/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js +1 -1
  499. package/dist/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +1 -0
  500. package/dist/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js +1 -1
  501. package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +1 -1
  502. package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +2 -2
  503. package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +1 -1
  504. package/dist/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts +6 -2
  505. package/dist/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +1 -1
  506. package/dist/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +5 -5
  507. package/dist/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +4 -4
  508. package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +6 -6
  509. package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +5 -5
  510. package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +11 -6
  511. package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +3 -2
  512. package/dist/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +1 -1
  513. package/dist/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +4 -4
  514. package/dist/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -1
  515. package/dist/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js +1 -1
  516. package/dist/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +1 -1
  517. package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/oauth-page.js +74 -0
  518. package/dist/node_modules/@earendil-works/pi-ai/dist/cli.js +0 -0
  519. package/dist/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +1 -0
  520. package/dist/node_modules/@earendil-works/pi-ai/dist/images-models.js +1 -0
  521. package/dist/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -1
  522. package/dist/node_modules/@earendil-works/pi-ai/dist/index.js +1 -1
  523. package/dist/node_modules/@earendil-works/pi-ai/dist/models.d.ts +5 -0
  524. package/dist/node_modules/@earendil-works/pi-ai/dist/models.js +1 -1
  525. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -0
  526. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +1 -0
  527. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +539 -0
  528. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +1 -0
  529. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  530. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  531. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  532. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -1
  533. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  534. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -1
  535. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  536. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
  537. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  538. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  539. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  540. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/groq.json +1 -1
  541. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  542. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/kimi-coding.json +1 -1
  543. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
  544. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
  545. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
  546. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai-cn.json +1 -1
  547. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  548. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  549. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  550. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  551. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  552. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  553. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  554. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  555. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
  556. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
  557. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/typesafe.json +1 -1
  558. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  559. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
  560. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
  561. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
  562. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
  563. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
  564. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +1 -1
  565. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts +90 -0
  566. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +1 -0
  567. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js +1 -0
  568. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-images.js +1 -0
  569. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +1 -1
  570. package/dist/node_modules/@earendil-works/pi-ai/dist/telemetry.d.ts +286 -0
  571. package/dist/node_modules/@earendil-works/pi-ai/dist/telemetry.js +1 -0
  572. package/dist/node_modules/@earendil-works/pi-ai/dist/types.d.ts +23 -148
  573. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.js +1 -0
  574. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +4 -0
  575. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +1 -1
  576. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/identity.d.ts +27 -0
  577. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/identity.js +1 -0
  578. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +1 -1
  579. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +1 -1
  580. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
  581. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/transcript.d.ts +3 -2
  582. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/transcript.js +2 -2
  583. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.d.ts +1 -0
  584. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.js +1 -0
  585. package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
  586. package/dist/node_modules/@earendil-works/pi-codemode/README.md +195 -11
  587. package/dist/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js +1 -0
  588. package/dist/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts +0 -2
  589. package/dist/node_modules/@earendil-works/pi-codemode/dist/declarations.js +9 -84
  590. package/dist/node_modules/@earendil-works/pi-codemode/dist/index.d.ts +5 -2
  591. package/dist/node_modules/@earendil-works/pi-codemode/dist/index.js +1 -1
  592. package/dist/node_modules/@earendil-works/pi-codemode/dist/portable.js +1 -0
  593. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts +29 -0
  594. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js +1 -0
  595. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts +3 -16
  596. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +1 -1
  597. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts +13 -0
  598. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js +1 -0
  599. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +14 -6
  600. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts +72 -0
  601. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js +1 -1
  602. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts +32 -0
  603. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js +1 -0
  604. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js +3 -0
  605. package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js +1 -3
  606. package/dist/node_modules/@earendil-works/pi-codemode/dist/source.js +4 -3
  607. package/dist/node_modules/@earendil-works/pi-codemode/dist/types.d.ts +51 -1
  608. package/dist/node_modules/@earendil-works/pi-codemode/package.json +14 -2
  609. package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
  610. package/dist/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +15 -0
  611. package/dist/node_modules/@earendil-works/pi-mcp/dist/client.js +1 -1
  612. package/dist/node_modules/@earendil-works/pi-mcp/dist/index.d.ts +1 -1
  613. package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts +2 -2
  614. package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js +1 -1
  615. package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js +1 -1
  616. package/dist/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts +1 -1
  617. package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts +2 -2
  618. package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js +4 -4
  619. package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts +4 -1
  620. package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
  621. package/dist/node_modules/@earendil-works/pi-telemetry/README.md +167 -21
  622. package/dist/node_modules/@earendil-works/pi-telemetry/dist/index.d.ts +77 -2
  623. package/dist/node_modules/@earendil-works/pi-telemetry/dist/index.js +1 -1
  624. package/dist/node_modules/@earendil-works/pi-telemetry/dist/memory.d.ts +35 -2
  625. package/dist/node_modules/@earendil-works/pi-telemetry/dist/memory.js +1 -1
  626. package/dist/node_modules/@earendil-works/pi-telemetry/dist/metrics.d.ts +70 -0
  627. package/dist/node_modules/@earendil-works/pi-telemetry/dist/metrics.js +1 -0
  628. package/dist/node_modules/@earendil-works/pi-telemetry/dist/noop.d.ts +5 -2
  629. package/dist/node_modules/@earendil-works/pi-telemetry/dist/noop.js +1 -1
  630. package/dist/node_modules/@earendil-works/pi-telemetry/dist/render.js +2 -0
  631. package/dist/node_modules/@earendil-works/pi-telemetry/dist/testing/conformance.js +1 -1
  632. package/dist/node_modules/@earendil-works/pi-telemetry/package.json +6 -1
  633. package/dist/node_modules/@earendil-works/pi-tui/README.md +5 -3
  634. package/dist/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +2 -2
  635. package/dist/node_modules/@earendil-works/pi-tui/dist/components/editor.js +6 -6
  636. package/dist/node_modules/@earendil-works/pi-tui/dist/components/input.js +2 -2
  637. package/dist/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +8 -7
  638. package/dist/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
  639. package/dist/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
  640. package/dist/node_modules/@earendil-works/pi-tui/dist/keys.js +5 -5
  641. package/dist/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +3 -0
  642. package/dist/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +1 -1
  643. package/dist/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +1 -1
  644. package/dist/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +3 -0
  645. package/dist/node_modules/@earendil-works/pi-tui/dist/terminal.js +1 -1
  646. package/dist/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +2 -0
  647. package/dist/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +4 -4
  648. package/dist/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +1 -1
  649. package/dist/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +7 -0
  650. package/dist/node_modules/@earendil-works/pi-tui/dist/tui.js +2 -2
  651. package/dist/node_modules/@earendil-works/pi-tui/dist/utils.js +1 -1
  652. package/dist/node_modules/@earendil-works/pi-tui/package.json +3 -2
  653. package/dist/package-manager-cli.js +9 -9
  654. package/dist/sdk/index.d.ts +3 -3
  655. package/dist/sdk/index.js +1 -1
  656. package/dist/sdk/office.d.ts +1 -1
  657. package/dist/sdk/office.js +1 -1
  658. package/dist/sdk/rewind.d.ts +1 -1
  659. package/dist/sdk/rewind.js +1 -1
  660. package/dist/sdk/router.d.ts +4 -4
  661. package/dist/sdk/router.js +1 -1
  662. package/dist/server/create-harness.js +1 -0
  663. package/dist/utils/clipboard-command.js +1 -1
  664. package/dist/utils/clipboard-native.js +1 -0
  665. package/dist/utils/clipboard.js +1 -1
  666. package/dist/utils/output-files.js +1 -1
  667. package/dist/utils/pi-user-agent.js +1 -1
  668. package/dist/utils/shell.js +2 -2
  669. package/dist/utils/temp-files.js +1 -0
  670. package/dist/utils/tools-manager.js +1 -1
  671. package/docs/security.md +24 -7
  672. package/examples/README.md +0 -3
  673. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  674. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  675. package/examples/extensions/gondolin/package-lock.json +2 -2
  676. package/examples/extensions/gondolin/package.json +1 -1
  677. package/examples/extensions/minimal-mode.ts +4 -5
  678. package/examples/extensions/overlay-test.ts +2 -2
  679. package/examples/extensions/sandbox/package-lock.json +2 -2
  680. package/examples/extensions/sandbox/package.json +1 -1
  681. package/examples/extensions/subagent/index.ts +4 -6
  682. package/examples/extensions/with-deps/package-lock.json +2 -2
  683. package/examples/extensions/with-deps/package.json +1 -1
  684. package/npm-shrinkwrap.json +22 -460
  685. package/package.json +7 -12
  686. package/dist/modes/interactive/theme/theme-json.d.ts +0 -75
  687. package/dist/node_modules/@dalcode/dal-guard/src/review.js +0 -3
  688. package/dist/node_modules/@dalcode/dal-office/src/scenes.js +0 -1
  689. package/dist/node_modules/@dalcode/dal-plugins/src/rank.js +0 -4
  690. package/dist/node_modules/@dalcode/dal-router/src/assist.js +0 -4
  691. package/dist/node_modules/@dalcode/dal-router/src/compact-defer.js +0 -3
  692. package/dist/node_modules/@dalcode/dal-router/src/jev.d.ts +0 -52
  693. package/dist/node_modules/@dalcode/dal-router/src/jev.js +0 -5
  694. package/dist/node_modules/@dalcode/dal-router/src/router.d.ts +0 -32
  695. package/dist/node_modules/@dalcode/dal-router/src/router.js +0 -1
  696. package/dist/node_modules/@dalcode/dal-router/src/services.js +0 -1
  697. package/dist/node_modules/@dalcode/dal-subagent/src/role-pick.js +0 -2
  698. package/dist/node_modules/@earendil-works/chord/README.md +0 -264
  699. package/dist/node_modules/@earendil-works/chord/dist/api.js +0 -1
  700. package/dist/node_modules/@earendil-works/chord/dist/bundler.js +0 -1
  701. package/dist/node_modules/@earendil-works/chord/dist/context/index.js +0 -1
  702. package/dist/node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js +0 -1
  703. package/dist/node_modules/@earendil-works/chord/dist/delta/diff.js +0 -1
  704. package/dist/node_modules/@earendil-works/chord/dist/delta/index.js +0 -1
  705. package/dist/node_modules/@earendil-works/chord/dist/delta/revision-validator.js +0 -1
  706. package/dist/node_modules/@earendil-works/chord/dist/delta/tracker.js +0 -1
  707. package/dist/node_modules/@earendil-works/chord/dist/facets/host.js +0 -1
  708. package/dist/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -1
  709. package/dist/node_modules/@earendil-works/chord/dist/index.js +0 -1
  710. package/dist/node_modules/@earendil-works/chord/dist/json.js +0 -1
  711. package/dist/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -2
  712. package/dist/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -4
  713. package/dist/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -1
  714. package/dist/node_modules/@earendil-works/chord/dist/node/package.js +0 -1
  715. package/dist/node_modules/@earendil-works/chord/dist/node.js +0 -1
  716. package/dist/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -1
  717. package/dist/node_modules/@earendil-works/chord/dist/services/errors.js +0 -1
  718. package/dist/node_modules/@earendil-works/chord/dist/services/handle.js +0 -1
  719. package/dist/node_modules/@earendil-works/chord/dist/services/instances.js +0 -1
  720. package/dist/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -1
  721. package/dist/node_modules/@earendil-works/chord/dist/services/provider.js +0 -1
  722. package/dist/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -1
  723. package/dist/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -1
  724. package/dist/node_modules/@earendil-works/chord/dist/services/state.js +0 -1
  725. package/dist/node_modules/@earendil-works/chord/dist/services/wire.js +0 -1
  726. package/dist/node_modules/@earendil-works/chord/package.json +0 -62
  727. package/dist/node_modules/@earendil-works/chord/src/delta/README.md +0 -191
  728. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts +0 -63
  729. package/dist/node_modules/@earendil-works/pi-client/CHANGELOG.md +0 -45
  730. package/dist/node_modules/@earendil-works/pi-client/LICENSE +0 -21
  731. package/dist/node_modules/@earendil-works/pi-client/README.md +0 -72
  732. package/dist/node_modules/@earendil-works/pi-client/dist/client.js +0 -1
  733. package/dist/node_modules/@earendil-works/pi-client/dist/connection.js +0 -1
  734. package/dist/node_modules/@earendil-works/pi-client/dist/errors.js +0 -1
  735. package/dist/node_modules/@earendil-works/pi-client/dist/index.js +0 -1
  736. package/dist/node_modules/@earendil-works/pi-client/dist/promise.js +0 -1
  737. package/dist/node_modules/@earendil-works/pi-client/dist/types.js +0 -0
  738. package/dist/node_modules/@earendil-works/pi-client/dist/unix.js +0 -1
  739. package/dist/node_modules/@earendil-works/pi-client/package.json +0 -46
  740. package/dist/node_modules/@earendil-works/pi-protocol/LICENSE +0 -21
  741. package/dist/node_modules/@earendil-works/pi-protocol/README.md +0 -41
  742. package/dist/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js +0 -1
  743. package/dist/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js +0 -1
  744. package/dist/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js +0 -1
  745. package/dist/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js +0 -1
  746. package/dist/node_modules/@earendil-works/pi-protocol/dist/codec.js +0 -1
  747. package/dist/node_modules/@earendil-works/pi-protocol/dist/framing.js +0 -1
  748. package/dist/node_modules/@earendil-works/pi-protocol/dist/index.js +0 -1
  749. package/dist/node_modules/@earendil-works/pi-protocol/dist/protocol.js +0 -1
  750. package/dist/node_modules/@earendil-works/pi-protocol/dist/schemas.js +0 -1
  751. package/dist/node_modules/@earendil-works/pi-protocol/package.json +0 -39
  752. package/dist/node_modules/@earendil-works/pi-server/CHANGELOG.md +0 -81
  753. package/dist/node_modules/@earendil-works/pi-server/LICENSE +0 -21
  754. package/dist/node_modules/@earendil-works/pi-server/README.md +0 -63
  755. package/dist/node_modules/@earendil-works/pi-server/dist/connection.js +0 -1
  756. package/dist/node_modules/@earendil-works/pi-server/dist/errors.js +0 -1
  757. package/dist/node_modules/@earendil-works/pi-server/dist/index.js +0 -1
  758. package/dist/node_modules/@earendil-works/pi-server/dist/listener.js +0 -0
  759. package/dist/node_modules/@earendil-works/pi-server/dist/server.js +0 -1
  760. package/dist/node_modules/@earendil-works/pi-server/dist/session-router.js +0 -1
  761. package/dist/node_modules/@earendil-works/pi-server/dist/testing/client.js +0 -1
  762. package/dist/node_modules/@earendil-works/pi-server/dist/testing/host.js +0 -1
  763. package/dist/node_modules/@earendil-works/pi-server/dist/testing/index.js +0 -1
  764. package/dist/node_modules/@earendil-works/pi-server/dist/testing/server.js +0 -1
  765. package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/address.js +0 -1
  766. package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/index.js +0 -1
  767. package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/listener.js +0 -1
  768. package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/preset.js +0 -1
  769. package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/types.js +0 -0
  770. package/dist/node_modules/@earendil-works/pi-server/dist/types.js +0 -0
  771. package/dist/node_modules/@earendil-works/pi-server/package.json +0 -45
  772. package/examples/plugins/pi-example-plugin/README.md +0 -38
  773. package/examples/plugins/pi-example-plugin/package.json +0 -10
  774. package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  775. package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
  776. package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
  777. /package/dist/node_modules/{@earendil-works/chord → @dalcode/dal-codeindex}/LICENSE +0 -0
  778. /package/dist/node_modules/@earendil-works/{chord/dist → pi-agent-core/dist/harness/session/testing}/types.js +0 -0
  779. /package/dist/node_modules/@earendil-works/{chord/dist/delta/draft.js → pi-agent-core/dist/harness/tools/tool-context.js} +0 -0
  780. /package/dist/node_modules/@earendil-works/{pi-client/dist/transport.js → pi-agent-core/dist/search/index.js} +0 -0
@@ -1,63 +0,0 @@
1
- import type { AssistantMessage, AssistantMessageEvent, TextContent, ThinkingContent, ToolCall } from "../types.ts";
2
- export type AssistantMessageFrame = {
3
- type: "start";
4
- partial: AssistantMessage;
5
- } | {
6
- type: "text_start";
7
- contentIndex: number;
8
- content: TextContent;
9
- } | {
10
- type: "text_delta";
11
- contentIndex: number;
12
- delta: string;
13
- } | {
14
- type: "text_end";
15
- contentIndex: number;
16
- content: string;
17
- textSignature?: string;
18
- } | {
19
- type: "thinking_start";
20
- contentIndex: number;
21
- content: ThinkingContent;
22
- } | {
23
- type: "thinking_delta";
24
- contentIndex: number;
25
- delta: string;
26
- } | {
27
- type: "thinking_end";
28
- contentIndex: number;
29
- content: string;
30
- thinkingSignature?: string;
31
- redacted?: boolean;
32
- } | {
33
- type: "toolcall_start";
34
- contentIndex: number;
35
- toolCall: ToolCall;
36
- } | {
37
- type: "toolcall_checkpoint";
38
- contentIndex: number;
39
- json: string;
40
- } | {
41
- type: "toolcall_delta";
42
- contentIndex: number;
43
- delta: string;
44
- } | {
45
- type: "toolcall_end";
46
- contentIndex: number;
47
- id: string;
48
- name: string;
49
- arguments: ToolCall["arguments"];
50
- thoughtSignature?: string;
51
- namespace?: string;
52
- };
53
- export declare class AssistantMessageFrameEncoder {
54
- private started;
55
- private terminal;
56
- private readonly blocks;
57
- encode(event: AssistantMessageEvent): AssistantMessageFrame | undefined;
58
- private startBlock;
59
- private block;
60
- private endBlock;
61
- private encodeTextDelta;
62
- }
63
- export declare function reduceAssistantMessageFrames(frames: Iterable<AssistantMessageFrame>): AssistantMessage | undefined;
@@ -1,45 +0,0 @@
1
- # Changelog
2
-
3
- `0.84.x` headings are inherited Pi history. DAL Code product version is `0.1.0`.
4
-
5
- ## [1.1.0] - 2026-10-07
6
-
7
- ## [1.0.4] - 2026-10-05
8
-
9
- ## [1.0.3] - 2026-10-05
10
-
11
- ## [1.0.2] - 2026-10-04
12
-
13
- ## [1.0.1] - 2026-10-03
14
-
15
- ## [1.0.0] - 2026-10-01
16
-
17
- ## [0.99.2] - 2026-09-30
18
-
19
- ## [0.99.1] - 2026-09-29
20
-
21
- ## [0.99.0] - 2026-09-29
22
-
23
- ## [0.87.1] - 2026-09-22
24
-
25
- ## [Unreleased]
26
-
27
- ### Added
28
-
29
- - `PiSessionHandle.subscribeExtensionUi()` and `answerExtensionUi()`. `onEvent` now routes `extension_ui` events to the session.
30
-
31
- ## [0.84.3] - 2026-08-24
32
-
33
- ## [0.84.2] - 2026-08-14
34
-
35
- ## [0.84.1] - 2026-08-07
36
-
37
- ## [0.84.0] - 2026-08-06
38
-
39
- ### Breaking Changes
40
-
41
- - Replaced `SessionSummary` with durable `SessionMetadata` for `PiClient.listSessions()` and server snapshots; runtime state is available only from acquired session snapshots ([#7708](https://github.com/earendil-works/pi/pull/7708)).
42
-
43
- ### Added
44
-
45
- - Added the experimental transport-neutral `PiClient` and multi-session `PiSessionHandle` APIs with structured `PiServerError` responses.
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Mario Zechner
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,72 +0,0 @@
1
- # @earendil-works/pi-client
2
-
3
- Transport-neutral client for the experimental Pi service protocol.
4
-
5
- ```ts
6
- import { Client, type ByteTransportFactory } from "@earendil-works/pi-client";
7
-
8
- const transportFactory: ByteTransportFactory = async (handlers) => {
9
- // Connect using WebSocket, Unix socket, or another ordered byte transport.
10
- return {
11
- async send(chunk) {
12
- // Deliver bytes in invocation order and honor backpressure.
13
- },
14
- close() {},
15
- };
16
- };
17
-
18
- const client = await Client.connect({
19
- serverId: "01234567-89ab-4def-8123-456789abcdef",
20
- transportFactory,
21
- });
22
- const result = await client.request(
23
- { serverId: client.hello.serverId },
24
- { serviceId: "example.service", member: "read", args: [] },
25
- );
26
- ```
27
-
28
- The client verifies that the physical endpoint reports the expected logical `serverId`. Server-wide requests carry that ID, and every Session request carries the full live target `{ serverId, sessionId, attachmentId }`. The combined durable address prevents cross-server or cross-session misrouting; the server-generated attachment ID rejects delayed frames after switching or reattaching.
29
-
30
- Typed server and Session APIs are provided by Chord service bindings owned by the application. `createClientServiceTransport()` adapts a lazily resolved server or Session route to a Chord transport; `request()` and `subscribeService()` remain its low-level primitives. The client uses Chord's service-control parsers and per-subscription state decoder; `pi-protocol` only validates the routed envelope and strict-JSON boundary. A service subscription returns a complete provider snapshot; the binding installs it and then calls `start()` to release updates buffered during hydration. `Client` applies ordered out-of-band attachment changes but deliberately does not construct typed service proxies or interpret application contracts.
31
-
32
- Application observation APIs such as the coding agent's `Transcript` are ordinary Chord services. The client does not interpret their snapshots or updates.
33
-
34
- On disconnect or disposal, pending requests reject locally, but accepted work may still complete remotely before the attachment is released. The client clears its live attachment route. It never reconnects or replays requests automatically. After disconnection, call `reconnect()`, attach through the application's management service again, and explicitly repeat only operations known to be safe.
35
-
36
- The experimental local coordinator only provides a stable endpoint and relays traffic. Replaceable server processes own Session and worker lifecycle outside the public client protocol.
37
-
38
- Call transport handlers as follows:
39
-
40
- - `handlers.onData(chunk)` for inbound bytes;
41
- - `handlers.onClose()` for an orderly terminal close;
42
- - `handlers.onError(error)` for transport failures.
43
-
44
- A transport factory creates a fresh authenticated connection for each attempt. Requests are correlated by ID, and server failures are exposed as `ServerError`.
45
-
46
- ## Unix-domain sockets
47
-
48
- Node.js and Bun consumers can use the separate Unix transport:
49
-
50
- ```ts
51
- import { Client } from "@earendil-works/pi-client";
52
- import { createUnixTransportFactory } from "@earendil-works/pi-client/unix";
53
-
54
- const client = new Client({
55
- serverId: "01234567-89ab-4def-8123-456789abcdef",
56
- transportFactory: createUnixTransportFactory({ path: "/tmp/pi.sock" }),
57
- });
58
- await client.connect();
59
- ```
60
-
61
- Unix discovery scans an explicit physical-route directory, derives each expected server ID from its filename, and verifies it through the existing handshake:
62
-
63
- ```ts
64
- import { discoverUnixServers } from "@earendil-works/pi-client/unix";
65
-
66
- const routes = await discoverUnixServers({ directory: "/run/user/1000/pi" });
67
- // [{ serverId: "...", path: "/run/user/1000/pi/<serverId>.sock" }]
68
- ```
69
-
70
- Malformed entries, non-sockets, stale or unresponsive endpoints, and server-ID mismatches are ignored. Discovery is read-only and probes at most 16 sockets concurrently. Unexpected filesystem and socket errors reject discovery. Pass `timeoutMs` to override the default probe timeout.
71
-
72
- `ClientOptions.maxFrameLength` bounds protocol payloads. `maxPendingBytes` bounds queued Unix transport output. Configure matching limits on both peers.
@@ -1 +0,0 @@
1
- var L=Object.defineProperty;var i=(h,e)=>L(h,"name",{value:e,configurable:!0});import{createServiceCatalogueCall as P,createServiceStateDecoder as U,createServiceSubscribeCall as j,createServiceUnsubscribeCall as x,parseServiceCall as T,parseServiceCatalogue as D,parseWireServiceProviderUpdate as q,parseWireServiceSubscriptionSnapshot as F}from"@earendil-works/chord";import{BACKGROUND_CONTEXT as R}from"@earendil-works/chord/context";import{encodeClientMessage as C,isServerId as A,ProtocolValidationError as p}from"@earendil-works/pi-protocol";import{Connection as M}from"./connection.js";import{ClientDisposedError as m,DisconnectedError as w,ServerError as W,toError as y}from"./errors.js";import{createPromiseResolvers as k}from"./promise.js";class g{static{i(this,"Client")}#s;#e;#n=new Map;#o=new Set;#c=new Set;#t=new Map;#w=0;#y=0;#r;#a;#i=!1;#d;constructor(e){if(!A(e.serverId))throw new TypeError("serverId must be a canonical lowercase UUIDv4");this.#s=e,this.#e=new M({transportFactory:e.transportFactory,serverId:e.serverId,maxFrameLength:e.maxFrameLength,onHandshake:i(t=>{this.#r=t},"onHandshake"),onMessage:i(t=>this.#S(t),"onMessage"),onStateChange:i(t=>this.#I(t),"onStateChange")})}get disposed(){return this.#i}get connectionState(){return this.#e.state}get connected(){return this.#e.state==="connected"}get serverId(){return this.#s.serverId}get hello(){return this.#r}get attachment(){return this.#a}static async connect(e){const t=new g(e);try{return await t.connect(),t}catch(r){throw await t.dispose(),r}}connect(){return this.#i?Promise.reject(new m):(this.#r=void 0,this.#e.connect())}reconnect(){return this.connect()}disconnect(e="Client disconnected"){this.#e.disconnect(e)}onConnectionStateChange(e){return this.#m(),this.#o.add(e),()=>this.#o.delete(e)}onAttachmentChange(e){return this.#m(),this.#c.add(e),()=>this.#c.delete(e)}request(e,t,r){return this.#h(e,t,r)}async serviceCatalogue(e,t){const r=await this.#h(e,P(),t);try{return D(r)}catch(n){const o=new p(n instanceof Error?n.message:"Invalid service catalogue");throw this.#e.fail(o),o}}async subscribeService(e,t,r,n,o){const c=`service-${++this.#y}`,s={target:e,listener:n,decoder:U(),queuedWireUpdates:[],queued:[],deliveryTail:Promise.resolve(),hydrated:!1,ready:!1};this.#t.set(c,s);let d;try{d=await this.#h(e,j(c,t,r),o,a=>{const l=s.decoder.decodeSnapshot(F(a));s.hydrated=!0;for(const v of s.queuedWireUpdates.splice(0))s.queued.push(s.decoder.decodeUpdate(q(v)));return l})}catch(a){throw this.#t.get(c)===s&&this.#t.delete(c),a}if(this.#t.get(c)!==s)throw new w;let u=!1;return{id:c,target:e,snapshot:d,start:i(()=>{if(!(u||s.ready)){s.ready=!0;for(const a of s.queued.splice(0))this.#v(s,a)}},"start"),dispose:i(async()=>{if(!u){u=!0,this.#t.get(c)===s&&this.#t.delete(c);try{this.connected&&this.#b(e)&&await this.#h(e,x(c)),await s.deliveryTail}finally{s.queuedWireUpdates.length=0,s.queued.length=0}}},"dispose")}}#h(e,t,r,n){if(this.#i)return Promise.reject(new m);if(!this.connected)return Promise.reject(new w);if(r?.aborted)return Promise.reject(E(r));const o=`request-${++this.#w}`,{promise:c,resolve:s,reject:d}=k();let u=!1,a=!1,l;const v=i(()=>{if(!(!u||!this.connected))try{this.#e.send(C({type:"cancel",id:o,target:e},{maxFrameLength:this.#e.maxFrameLength}))}catch(f){this.#e.fail(y(f))}},"sendCancel");r!==void 0&&(l=i(()=>{a||(a=!0,d(E(r)),v())},"onAbort"),r.addEventListener("abort",l,{once:!0})),this.#n.set(o,{resolve:i(f=>{try{s(n===void 0?f:n(f))}catch(I){const b=new p(I instanceof Error?I.message:"Invalid service operation stream");this.#e.fail(b),d(b)}},"resolve"),reject:d,cleanup:i(()=>{r!==void 0&&l!==void 0&&r.removeEventListener("abort",l)},"cleanup")});let S;try{S=C({type:"request",id:o,target:e,call:T(t)},{maxFrameLength:this.#e.maxFrameLength})}catch(f){return this.#f(o)?.reject(y(f)),c}return this.#e.send(S),u=!0,a&&v(),c}#S(e){if(e.type==="attachment"){if(e.attachment!==null&&e.attachment.serverId!==this.#s.serverId){this.#e.fail(new p("Attachment update belongs to another server"));return}this.#u(e.attachment??void 0);return}if(e.type==="service_update"){const r=this.#t.get(e.subscriptionId);if(r===void 0)return;if(!r.hydrated){r.queuedWireUpdates.push(e.update);return}let n;try{n=r.decoder.decodeUpdate(q(e.update))}catch(o){this.#e.fail(new p(o instanceof Error?o.message:"Invalid service operation stream"));return}r.ready?this.#v(r,n):r.queued.push(n);return}const t=this.#f(e.id);if(!t){this.#e.fail(new p("Response has no matching request"));return}if(!e.ok){t.reject(new W(e.error));return}t.resolve(e.result)}#I(e){e.state==="disconnected"&&(this.#r=void 0,this.#u(void 0),this.#p(e.error??new w),this.#t.clear());for(const t of this.#o)try{t(e)}catch(r){this.#l(r)}}#f(e){const t=this.#n.get(e);return t&&(this.#n.delete(e),t.cleanup()),t}#p(e){const t=[...this.#n.values()];this.#n.clear();for(const r of t)r.cleanup(),r.reject(e)}dispose(){if(this.#d)return this.#d;this.#i=!0,this.#d=Promise.resolve();const e=new m;return this.#p(e),this.#e.disconnect(e),this.#r=void 0,this.#u(void 0),this.#o.clear(),this.#c.clear(),this.#t.clear(),this.#d}[Symbol.asyncDispose](){return this.dispose()}#u(e){const t=this.#a;if(!(t?.serverId===e?.serverId&&t?.sessionId===e?.sessionId&&t?.attachmentId===e?.attachmentId)){this.#a=e;for(const r of this.#c)try{r(e)}catch(n){this.#l(n)}}}#v(e,t){e.deliveryTail=e.deliveryTail.then(()=>e.listener(t)).catch(r=>this.#l(r))}#b(e){if(!("sessionId"in e))return this.#r?.serverId===e.serverId;const t=this.#a;return t?.serverId===e.serverId&&t.sessionId===e.sessionId&&t.attachmentId===e.attachmentId}#m(){if(this.#i)throw new m}#l(e){if(this.#s.onListenerError)try{this.#s.onListenerError(y(e))}catch{}}}function V(h,e){const t=i(()=>{const r=e();if(r===void 0)throw new Error("Remote service target is unavailable");return r},"target");return{invoke:i(async(r,n)=>h.request(t(),r,n.abortSignal),"invoke"),async subscribe(r,n,o,c){const s=await h.subscribeService(t(),r,n,d=>o(d,R),c.abortSignal);return{snapshot:s.snapshot,activate:i(()=>s.start(),"activate"),close:i(()=>s.dispose(),"close")}}}}i(V,"createClientServiceTransport");function E(h){const e=h.reason;return e instanceof Error?e:new DOMException("The operation was aborted","AbortError")}i(E,"abortError");export{g as Client,V as createClientServiceTransport};
@@ -1 +0,0 @@
1
- var f=Object.defineProperty;var i=(d,e)=>f(d,"name",{value:e,configurable:!0});import{DEFAULT_MAX_FRAME_LENGTH as u,encodeClientMessage as p,PROTOCOL_VERSION as y,ProtocolValidationError as o,ServerMessageDecoder as g}from"@earendil-works/pi-protocol";import{DisconnectedError as h,ServerError as m,toDisconnectedError as c,toError as a}from"./errors.js";import{createPromiseResolvers as w}from"./promise.js";const l=4294967295;class F{static{i(this,"Connection")}#r;#n;#e={state:"disconnected"};#o=0;constructor(e){if(this.#r=e,this.#n=e.maxFrameLength??u,!Number.isSafeInteger(this.#n)||this.#n<=0||this.#n>l)throw new TypeError(`Client maxFrameLength must be an integer between 1 and ${l}`)}get state(){return this.#e.state}get maxFrameLength(){return this.#n}connect(){if(this.#e.state!=="disconnected")return Promise.reject(new h(`Client is already ${this.#e.state}`));const e=++this.#o,t=w();this.#e={state:"connecting",id:e,decoder:new g({maxFrameLength:this.#n}),handshake:t},this.#r.onStateChange({state:"connecting"});const r={onData:i(n=>this.#h(e,n),"onData"),onClose:i(()=>{this.#s(e)&&this.#d()},"onClose"),onError:i(n=>{this.#s(e)&&this.#t(c(n))},"onError")};return this.#c(e,r),t.promise}disconnect(e="Client disconnected"){this.#e.state!=="disconnected"&&this.#t(typeof e=="string"?new h(e):e)}fail(e){this.#t(e)}send(e){const t=this.#e;if(t.state!=="connected")throw new h;let r;try{r=t.transport.send(e)}catch(n){this.#t(c(n));return}r.catch(n=>{const s=this.#e;s.state!=="disconnected"&&s.transport===t.transport&&this.#t(c(n))})}async#c(e,t){let r;try{r=await this.#r.transportFactory(t)}catch(s){this.#s(e)&&this.#i(c(s));return}const n=this.#e;if(n.state!=="connecting"||n.id!==e){r.close();return}this.#e={...n,transport:r};try{await r.send(p({type:"hello",version:y},{maxFrameLength:this.#n}))}catch(s){this.#s(e)&&this.#t(c(s))}}#h(e,t){const r=this.#e;if(r.state==="disconnected"||r.id!==e)return;if(r.state==="connecting"&&!r.transport){this.#t(new o("Received server data before the client hello was sent"));return}let n;try{n=r.decoder.push(t)}catch(s){this.#t(a(s));return}for(const s of n){if(this.#e.state==="disconnected")return;this.#a(s)}}#a(e){const t=this.#e;if(t.state==="connecting"){if(e.type==="hello_error"){this.#t(new m(e.error));return}if(e.type!=="hello"){this.#t(new o("Expected server hello as first message"));return}if(e.serverId!==this.#r.serverId){this.#t(new o(`Connected server ${JSON.stringify(e.serverId)} does not match ${JSON.stringify(this.#r.serverId)}`));return}if(!t.transport){this.#t(new o("Received server hello before the client hello was sent"));return}const r={state:"connected",id:t.id,decoder:t.decoder,transport:t.transport,handshake:t.handshake};this.#e=r;try{this.#r.onHandshake(e)}catch(n){this.#e===r&&this.#t(a(n));return}if(this.#e!==r||(this.#r.onStateChange({state:"connected"}),this.#e!==r))return;this.#e={...r,handshake:void 0},t.handshake.resolve(e);return}if(t.state==="connected"){if(e.type==="hello"||e.type==="hello_error"){this.#t(new o("Unexpected handshake message"));return}this.#r.onMessage(e)}}#d(){const e=this.#e;if(e.state==="disconnected")return;let t=new h("Byte transport closed");try{e.decoder.end()}catch(r){t=a(r)}this.#i(t)}#t(e){const t=this.#e,r=t.state==="disconnected"?void 0:t.transport;this.#i(e),r?.close()}#i(e){const t=this.#e;t.state!=="disconnected"&&(this.#e={state:"disconnected"},t.handshake?.reject(e),this.#r.onStateChange({state:"disconnected",error:e}))}#s(e){return this.#e.state!=="disconnected"&&this.#e.id===e}}export{F as Connection};
@@ -1 +0,0 @@
1
- var t=Object.defineProperty;var n=(e,r)=>t(e,"name",{value:r,configurable:!0});class d extends Error{static{n(this,"ServerError")}code;constructor(r){super(r.message),this.name="ServerError",this.code=r.code}}class s extends Error{static{n(this,"DisconnectedError")}constructor(r="Client is disconnected",o){super(r,o===void 0?void 0:{cause:o}),this.name="DisconnectedError"}}class E extends Error{static{n(this,"ClientDisposedError")}constructor(){super("Client is disposed"),this.name="ClientDisposedError"}}function c(e){return e instanceof Error?e:new Error(String(e))}n(c,"toError");function u(e){const r=c(e);return r instanceof s?r:new s(r.message,r)}n(u,"toDisconnectedError");export{E as ClientDisposedError,s as DisconnectedError,d as ServerError,u as toDisconnectedError,c as toError};
@@ -1 +0,0 @@
1
- import{Client as o,createClientServiceTransport as t}from"./client.js";import{ClientDisposedError as n,DisconnectedError as c,ServerError as p}from"./errors.js";export{o as Client,n as ClientDisposedError,c as DisconnectedError,p as ServerError,t as createClientServiceTransport};
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var o=(e,r)=>i(e,"name",{value:r,configurable:!0});function l(){let e,r;return{promise:new Promise((s,t)=>{e=s,r=t}),resolve:e,reject:r}}o(l,"createPromiseResolvers");export{l as createPromiseResolvers};
@@ -1 +0,0 @@
1
- var g=Object.defineProperty;var a=(n,r)=>g(n,"name",{value:r,configurable:!0});import{lstat as P,readdir as S}from"node:fs/promises";import{createConnection as b}from"node:net";import{join as _}from"node:path";import{DEFAULT_MAX_FRAME_LENGTH as v,isServerId as C,ProtocolValidationError as I}from"@earendil-works/pi-protocol";import{Client as N}from"./client.js";import{DisconnectedError as M,ServerError as O}from"./errors.js";const D=1e3,E=2147483647,y=".sock",A=16;async function Y(n){if(process.platform==="win32")throw new Error("Unix transport is not supported on Windows");const r=n.directory,t=n.timeoutMs??D;if(!Number.isSafeInteger(t)||t<=0||t>E)throw new TypeError(`Unix discovery timeoutMs must be an integer between 1 and ${E}`);let c;try{c=await S(r)}catch(s){if(u(s,"ENOENT"))return[];throw s}const f=c.flatMap(s=>{if(!s.endsWith(y))return[];const o=s.slice(0,-y.length);return C(o)?[{serverId:o,path:_(r,s)}]:[]}),l=[];let e=0,i;const d=Math.min(A,f.length);if(await Promise.all(Array.from({length:d},async()=>{for(;!i;){const s=f[e++];if(!s)return;try{try{if(!(await P(s.path)).isSocket())continue}catch(h){if(u(h,"ENOENT"))continue;throw h}const o=await L(s,t);o&&l.push(o)}catch(o){i??={error:o}}}})),i)throw i.error;return l.sort((s,o)=>s.serverId.localeCompare(o.serverId))}a(Y,"discoverUnixServers");function q(n){const r=x(n);return t=>U(n.path,r,t)}a(q,"createUnixTransportFactory");function x(n){if(n.path.length===0)throw new TypeError("Unix transport path must not be empty");const r=n.maxPendingBytes??v*4;if(!Number.isSafeInteger(r)||r<=0)throw new TypeError("Unix transport maxPendingBytes must be a positive safe integer");if(process.platform==="win32")throw new Error("Unix transport is not supported on Windows");return r}a(x,"validateUnixTransportOptions");function U(n,r,t,c){return new Promise((f,l)=>{const e=b(n);c?.(e);let i=!1,d=!1;const s=a(()=>{d||(d=!0,e.destroy(),i?t.onClose():l(new Error("Unix transport closed before connecting")))},"close");e.once("connect",()=>{d||(i=!0,f(new B(e,r,()=>{d=!0})))}),e.on("data",o=>{d||t.onData(new Uint8Array(o.buffer,o.byteOffset,o.byteLength))}),e.once("end",s),e.once("close",s),e.once("error",o=>{d||(d=!0,e.destroy(),i?t.onError(o):l(o))})})}a(U,"connectUnixSocket");class B{static{a(this,"UnixByteTransport")}#e;#n;#o;#t=!1;#r=0;#i=Promise.resolve();constructor(r,t,c){this.#e=r,this.#n=t,this.#o=c}send(r){if(!(r instanceof Uint8Array))return Promise.reject(new TypeError("Unix transport chunks must be Uint8Array"));if(this.#t)return Promise.reject(new Error("Unix transport is closed"));if(this.#r+r.byteLength>this.#n)return Promise.reject(new Error("Unix transport exceeded its pending byte limit"));this.#r+=r.byteLength;const t=r.slice(),f=this.#i.then(()=>this.#s(t)).finally(()=>{this.#r-=t.byteLength});return this.#i=f.catch(()=>{}),f}close(){this.#t||(this.#t=!0,this.#o(),this.#e.destroy())}#s(r){return this.#t||!this.#e.writable?Promise.reject(new Error("Unix transport is closed")):new Promise((t,c)=>{let f=!1,l=!1,e,i=!1;const d=a(()=>{l=!0,h()},"onDrain"),s=a(()=>{this.#e.off("drain",d),this.#e.off("close",m)},"cleanup"),o=a(p=>{i||(i=!0,s(),c(p))},"fail"),h=a(()=>{i||!f||e===void 0||e&&!l||(i=!0,s(),t())},"finish"),m=a(()=>o(new Error("Unix transport closed during write")),"onClose");try{this.#e.once("close",m),e=!this.#e.write(r,w=>{if(w){o(w);return}f=!0,h()}),e&&this.#e.once("drain",d),h()}catch(p){o(p instanceof Error?p:new Error(String(p)))}})}}async function L(n,r){const t=x({path:n.path});let c;const f=new N({serverId:n.serverId,transportFactory:a(e=>U(n.path,t,e,i=>{c=i}),"transportFactory")});let l;try{return await Promise.race([f.connect(),new Promise((e,i)=>{l=setTimeout(()=>{c?.destroy(),i(new T)},r),l.unref()})]),n}catch(e){if(e instanceof T||e instanceof I||e instanceof M&&e.cause===void 0||e instanceof O&&e.code==="version"||u(e,"ENOENT")||u(e,"ECONNREFUSED")||u(e,"ECONNRESET")||u(e,"EPIPE")||u(e,"ETIMEDOUT"))return;throw e}finally{l&&clearTimeout(l),await f.dispose();const e=c;e&&!e.destroyed&&e.destroy(),e&&!e.closed&&await new Promise(i=>e.once("close",i))}}a(L,"probeUnixServer");class T extends Error{static{a(this,"UnixDiscoveryTimeoutError")}}function u(n,r){let t=n;const c=new Set;for(;t instanceof Error&&!c.has(t);){if(c.add(t),"code"in t&&t.code===r)return!0;t=t.cause}return!1}a(u,"isErrorCode");export{q as createUnixTransportFactory,Y as discoverUnixServers};
@@ -1,46 +0,0 @@
1
- {
2
- "name": "@earendil-works/pi-client",
3
- "version": "1.0.44",
4
- "description": "Transport-neutral client for remote pi sessions over framed CBOR bytes",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
12
- },
13
- "./unix": {
14
- "types": "./dist/unix.d.ts",
15
- "import": "./dist/unix.js"
16
- },
17
- "./package.json": "./package.json"
18
- },
19
- "sideEffects": false,
20
- "files": [
21
- "dist",
22
- "README.md",
23
- "CHANGELOG.md"
24
- ],
25
- "keywords": [
26
- "pi",
27
- "client",
28
- "protocol",
29
- "cbor",
30
- "binary"
31
- ],
32
- "author": "Earendil Works",
33
- "license": "MIT",
34
- "repository": {
35
- "type": "git",
36
- "url": "git+https://github.com/earendil-works/pi.git",
37
- "directory": "packages/client"
38
- },
39
- "engines": {
40
- "node": ">=22.19.0"
41
- },
42
- "dependencies": {
43
- "@earendil-works/chord": "^1.0.44",
44
- "@earendil-works/pi-protocol": "^1.0.44"
45
- }
46
- }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Mario Zechner
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,41 +0,0 @@
1
- # @earendil-works/pi-protocol
2
-
3
- Runtime-neutral routed envelopes, CBOR encoding, and byte-stream framing for the experimental Pi protocol.
4
-
5
- Protocol version `8` defines:
6
-
7
- - a version handshake that identifies the logical `serverId`;
8
- - explicit server and Session request targets;
9
- - correlated requests and responses with opaque strict-JSON payloads;
10
- - request cancellation, opaque subscription updates, and out-of-band attachment changes;
11
- - non-empty opaque error codes and bounded transport messages.
12
-
13
- A server target contains `{ serverId }`; a Session target contains `{ serverId, sessionId, attachmentId }`. The combined route fences calls to one logical server, durable Session, and live presentation attachment. Management `attach()` and `detach()` return no routing identifiers; the server publishes the selected live route in an out-of-band `attachment` message. Disconnecting releases only that presentation's attachment after admitted calls settle.
14
-
15
- Chord owns the payload semantics carried inside these envelopes: `{ serviceId, instance?, member, args }` calls, the `$chord.service` control vocabulary, service catalogues, subscription snapshots and updates, service error codes, and the independent Delta path codecs for replicated states. `pi-protocol` validates that each opaque payload is strict JSON but does not validate or export its Chord grammar. Clients and servers parse those values through `@earendil-works/chord` at the service adapter boundary.
16
-
17
- Session-directory state, management results, transcripts, models, plugins, and all other application values remain opaque service data. The durable Session and its Harness remain local to the Session worker process. Server and Session calls route opaquely to their owning providers, where Chord and the application validate and invoke them.
18
-
19
- Server and worker lifecycle is intentionally outside this public protocol. The experimental local coordinator is only an opaque message router; each replaceable server process owns the private lifecycle protocol.
20
-
21
- Each wire frame consists of a four-byte unsigned big-endian payload length followed by one definite-length CBOR item. `encodeClientMessage()` and `encodeServerMessage()` validate and encode complete frames. `ClientMessageDecoder` and `ServerMessageDecoder` accept arbitrary stream fragmentation and coalescing.
22
-
23
- ```ts
24
- import {
25
- PROTOCOL_VERSION,
26
- encodeClientMessage,
27
- ServerMessageDecoder,
28
- type ClientHello,
29
- } from "@earendil-works/pi-protocol";
30
-
31
- const hello: ClientHello = { type: "hello", version: PROTOCOL_VERSION };
32
- transport.send(encodeClientMessage(hello));
33
-
34
- const decoder = new ServerMessageDecoder({ maxFrameLength: 1024 * 1024 });
35
- for (const message of decoder.push(incomingChunk)) handleServerMessage(message);
36
- decoder.end();
37
- ```
38
-
39
- All envelope schemas reject unknown object properties, and codecs recursively reject non-JSON opaque payloads, including non-finite numbers, byte arrays, `undefined`, prototypes, and cycles. Envelope violations, malformed CBOR, and invalid framing throw `ProtocolValidationError`. Payload-specific adapters must perform their own semantic validation after decoding. Transports must preserve byte order. Peer authentication and authenticated service contexts are not implemented by the experimental transport.
40
-
41
- Default limits are 16 MiB per CBOR payload/frame, 1,000,000 array elements or map entries, and 64 nested item levels. The protocol is experimental and has no compatibility guarantees.
@@ -1 +0,0 @@
1
- var f=Object.defineProperty;var c=(a,t)=>f(a,"name",{value:t,configurable:!0});import{CborError as r,resolveOptions as g,textDecoder as w,UINT32_BASE as l}from"./options.js";class y{static{c(this,"CborReader")}bytes;offset=0;options;constructor(t,e){this.bytes=t,this.options=e}decode(){const t=this.readItem(0);if(this.offset!==this.bytes.byteLength)throw new r("CBOR payload contains trailing data");return t}readItem(t){if(t>this.options.maxDepth)throw new r(`CBOR nesting depth exceeds configured limit of ${this.options.maxDepth}`);const e=this.readByte(),s=e>>>5,n=e&31;switch(s){case 0:return this.readArgument(n);case 1:{const i=-1-this.readArgument(n);if(!Number.isSafeInteger(i))throw new r("Decoded CBOR integer is outside the safe range");return i}case 2:{const i=this.readLength(n,"byte string",this.options.maxByteLength);return new Uint8Array(this.readBytes(i))}case 3:{const i=this.readLength(n,"text string",this.options.maxByteLength),o=this.readBytes(i);try{return w.decode(o)}catch{throw new r("CBOR text string contains invalid UTF-8")}}case 4:{const i=this.readLength(n,"array",this.options.maxContainerLength),o=[];for(let h=0;h<i;h++)o.push(this.readItem(t+1));return o}case 5:{const i=this.readLength(n,"map",this.options.maxContainerLength),o={},h=new Set;for(let u=0;u<i;u++){const d=this.readItem(t+1);if(typeof d!="string")throw new r("CBOR map keys must be strings");if(h.has(d))throw new r("CBOR map contains a duplicate key");h.add(d),Object.defineProperty(o,d,{configurable:!0,enumerable:!0,value:this.readItem(t+1),writable:!0})}return o}case 6:throw new r("CBOR tags are not supported");case 7:return this.readSimple(n);default:throw new r("Malformed CBOR major type")}}readSimple(t){switch(t){case 20:return!1;case 21:return!0;case 22:return null;case 27:{const e=this.readBytes(8),s=new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(0,!1);if(!Number.isFinite(s))throw new r("Decoded CBOR number must be finite");if(Number.isInteger(s)&&!Number.isSafeInteger(s))throw new r("Decoded CBOR integer is outside the safe range");return s}case 31:throw new r("CBOR break marker is not supported");default:throw new r("Unsupported CBOR simple value or floating-point width")}}readLength(t,e,s){if(t===31)throw new r(`Indefinite-length CBOR ${e}s are not supported`);const n=this.readArgument(t);if(n>s)throw new r(`CBOR ${e} length exceeds configured limit of ${s}`);return n}readArgument(t){if(t<24)return t;switch(t){case 24:return this.readByte();case 25:{const e=this.readBytes(2);return e[0]*256+e[1]}case 26:{const e=this.readBytes(4);return e[0]*16777216+e[1]*65536+e[2]*256+e[3]}case 27:{const e=this.readArgument(26),s=this.readArgument(26);if(e>2097151)throw new r("Decoded CBOR integer or length is outside the safe range");return e*l+s}case 31:throw new r("Indefinite-length CBOR items are not supported");default:throw new r("Malformed CBOR additional information")}}readByte(){if(this.offset>=this.bytes.byteLength)throw new r("Truncated CBOR payload");const t=this.bytes[this.offset];return this.offset++,t}readBytes(t){if(t>this.bytes.byteLength-this.offset)throw new r("Truncated CBOR payload");const e=this.bytes.subarray(this.offset,this.offset+t);return this.offset+=t,e}}function b(a,t){if(!(a instanceof Uint8Array))throw new TypeError("CBOR input must be a Uint8Array");const e=g(t);if(a.byteLength>e.maxByteLength)throw new r(`CBOR byte length exceeds configured limit of ${e.maxByteLength}`);return new y(a,e).decode()}c(b,"decodeCbor");export{b as decodeCbor};
@@ -1 +0,0 @@
1
- var w=Object.defineProperty;var h=(n,t)=>w(n,"name",{value:t,configurable:!0});import{CborError as f,MAX_UINT32 as d,resolveOptions as x,textDecoder as B,textEncoder as a,UINT32_BASE as g}from"./options.js";class u{static{h(this,"CborWriter")}buffer;offset=0;maxByteLength;constructor(t){this.maxByteLength=t,this.buffer=new Uint8Array(Math.min(256,t))}writeByte(t){this.ensureCapacity(1),this.buffer[this.offset]=t,this.offset++}writeBytes(t){this.ensureCapacity(t.byteLength),this.buffer.set(t,this.offset),this.offset+=t.byteLength}writeUint16(t){this.ensureCapacity(2),this.buffer[this.offset]=t>>>8,this.buffer[this.offset+1]=t,this.offset+=2}writeUint32(t){this.ensureCapacity(4),this.buffer[this.offset]=t>>>24,this.buffer[this.offset+1]=t>>>16,this.buffer[this.offset+2]=t>>>8,this.buffer[this.offset+3]=t,this.offset+=4}writeUint64(t){const e=Math.floor(t/g),i=t-e*g;this.writeUint32(e),this.writeUint32(i)}writeFloat64(t){this.ensureCapacity(9),this.buffer[this.offset]=251,new DataView(this.buffer.buffer).setFloat64(this.offset+1,t,!1),this.offset+=9}finish(){return this.buffer.slice(0,this.offset)}ensureCapacity(t){const e=this.offset+t;if(e>this.maxByteLength)throw new f(`CBOR byte length exceeds configured limit of ${this.maxByteLength}`);if(e<=this.buffer.byteLength)return;let i=Math.max(1,this.buffer.byteLength);for(;i<e;)i=Math.min(this.maxByteLength,Math.max(e,i*2));const s=new Uint8Array(i);s.set(this.buffer),this.buffer=s}}function y(n,t,e){const i=t<<5;e<24?n.writeByte(i|e):e<=255?(n.writeByte(i|24),n.writeByte(e)):e<=65535?(n.writeByte(i|25),n.writeUint16(e)):e<=d?(n.writeByte(i|26),n.writeUint32(e)):(n.writeByte(i|27),n.writeUint64(e))}h(y,"writeArgument");function C(n){if(typeof n!="object"||n===null)return!1;const t=Object.getPrototypeOf(n);return t===Object.prototype||t===null}h(C,"isPlainObject");function m(n,t,e){const i=a.encode(t);if(i.byteLength>e.maxByteLength)throw new f(`CBOR text string length exceeds configured limit of ${e.maxByteLength}`);if(B.decode(i)!==t)throw new f("CBOR text strings must contain valid Unicode scalar values");y(n,3,i.byteLength),n.writeBytes(i)}h(m,"encodeText");function b(n,t,e,i,s){if(i>e.maxDepth)throw new f(`CBOR nesting depth exceeds configured limit of ${e.maxDepth}`);if(t===null){n.writeByte(246);return}if(typeof t=="boolean"){n.writeByte(t?245:244);return}if(typeof t=="number"){if(!Number.isFinite(t))throw new f("CBOR numbers must be finite");if(Number.isInteger(t)&&!Object.is(t,-0)){if(!Number.isSafeInteger(t))throw new f("CBOR integers must be safe JavaScript integers");t>=0?y(n,0,t):y(n,1,-1-t)}else n.writeFloat64(t);return}if(typeof t=="string"){m(n,t,e);return}if(t instanceof Uint8Array){if(t.byteLength>e.maxByteLength)throw new f(`CBOR byte string length exceeds configured limit of ${e.maxByteLength}`);y(n,2,t.byteLength),n.writeBytes(t);return}if(Array.isArray(t)){if(s.has(t))throw new f("CBOR values must not contain cycles");if(t.length>e.maxContainerLength)throw new f(`CBOR array length exceeds configured limit of ${e.maxContainerLength}`);s.add(t);try{y(n,4,t.length);for(let r=0;r<t.length;r++){if(!Object.hasOwn(t,r)||t[r]===void 0)throw new f("CBOR arrays must not contain holes or undefined values");b(n,t[r],e,i+1,s)}}finally{s.delete(t)}return}if(C(t)){if(s.has(t))throw new f("CBOR values must not contain cycles");for(const o of Object.getOwnPropertySymbols(t))if(Object.prototype.propertyIsEnumerable.call(t,o))throw new f("CBOR map keys must be strings");const r=[];for(const o of Object.keys(t)){const c=t[o];c!==void 0&&r.push([o,c])}if(r.length>e.maxContainerLength)throw new f(`CBOR map length exceeds configured limit of ${e.maxContainerLength}`);s.add(t);try{y(n,5,r.length);for(const[o,c]of r)m(n,o,e),b(n,c,e,i+1,s)}finally{s.delete(t)}return}throw new f(`Unsupported CBOR value type: ${typeof t}`)}h(b,"encodeValue");function L(n,t){const e=x(t),i=new u(e.maxByteLength);return b(i,n,e,0,new Set),i.finish()}h(L,"encodeCbor");export{L as encodeCbor};
@@ -1 +0,0 @@
1
- import{decodeCbor as _}from"./decoder.js";import{encodeCbor as T}from"./encoder.js";import{CborError as A,DEFAULT_MAX_CBOR_BYTE_LENGTH as C,DEFAULT_MAX_CBOR_CONTAINER_LENGTH as L,DEFAULT_MAX_CBOR_DEPTH as B}from"./options.js";export{A as CborError,C as DEFAULT_MAX_CBOR_BYTE_LENGTH,L as DEFAULT_MAX_CBOR_CONTAINER_LENGTH,B as DEFAULT_MAX_CBOR_DEPTH,_ as decodeCbor,T as encodeCbor};
@@ -1 +0,0 @@
1
- var _=Object.defineProperty;var r=(e,t)=>_(e,"name",{value:t,configurable:!0});const x=4294967296,T=4294967295,A=512,c=16777216,s=1e6,D=64;class L extends Error{static{r(this,"CborError")}constructor(t){super(t),this.name="CborError"}}const a=new TextEncoder,C=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function n(e,t,o){if(!Number.isSafeInteger(t)||t<0||t>o)throw new RangeError(`${e} must be an integer between 0 and ${o}`);return t}r(n,"resolveLimit");function N(e){return{maxByteLength:n("maxByteLength",e?.maxByteLength??16777216,4294967295),maxContainerLength:n("maxContainerLength",e?.maxContainerLength??1e6,4294967295),maxDepth:n("maxDepth",e?.maxDepth??64,512)}}r(N,"resolveOptions");export{L as CborError,c as DEFAULT_MAX_CBOR_BYTE_LENGTH,s as DEFAULT_MAX_CBOR_CONTAINER_LENGTH,D as DEFAULT_MAX_CBOR_DEPTH,T as MAX_UINT32,x as UINT32_BASE,N as resolveOptions,C as textDecoder,a as textEncoder};
@@ -1 +0,0 @@
1
- var g=Object.defineProperty;var t=(e,r)=>g(e,"name",{value:r,configurable:!0});import{isJsonValue as c}from"@earendil-works/chord";import{Check as d}from"typebox/value";import{decodeCbor as w,encodeCbor as x}from"./cbor/index.js";import{DEFAULT_MAX_FRAME_LENGTH as h,encodeFrame as M,FrameDecoder as L}from"./framing.js";import{ClientMessageSchema as F,PROTOCOL_VERSION as E,ServerMessageSchema as $}from"./protocol.js";class s extends Error{static{t(this,"ProtocolValidationError")}constructor(r){super(r),this.name="ProtocolValidationError"}}function m(e){if(!d(F,e)||!c(e))throw new s("Invalid client protocol message");return e}t(m,"parseClientMessage");function f(e){if(!d($,e)||!c(e))throw new s("Invalid server protocol message");return e}t(f,"parseServerMessage");function i(e){return e instanceof Error?e.message.length<=500?e.message:`${e.message.slice(0,497)}...`:"Unknown codec error"}t(i,"boundedErrorMessage");function l(e,r,o,n){const u=r(e);try{const a=n?.maxFrameLength??h;return M(x(u,{maxByteLength:a}))}catch(a){throw a instanceof s?a:new s(`Unable to encode ${o} protocol message: ${i(a)}`)}}t(l,"encodeProtocolMessage");function b(e,r){return l(e,m,"client",r)}t(b,"encodeClientMessage");function y(e,r){return l(e,f,"server",r)}t(y,"encodeServerMessage");class p{static{t(this,"ValidatedMessageDecoder")}failed=!1;frames;kind;maxFrameLength;parse;constructor(r,o,n){this.frames=new L(n),this.kind=r,this.maxFrameLength=n?.maxFrameLength??h,this.parse=o}push(r){if(this.failed)throw new s(`${this.kind} message decoder has failed`);try{const o=[];for(const n of this.frames.push(r))o.push(this.parse(w(n,{maxByteLength:this.maxFrameLength})));return o}catch(o){throw this.failed=!0,o instanceof s?o:new s(`Invalid ${this.kind} protocol frame: ${i(o)}`)}}end(){if(this.failed)throw new s(`${this.kind} message decoder has failed`);try{this.frames.end()}catch(r){throw this.failed=!0,new s(`Invalid ${this.kind} protocol framing: ${i(r)}`)}}}class D{static{t(this,"ClientMessageDecoder")}decoder;constructor(r){this.decoder=new p("client",m,r)}push(r){return this.decoder.push(r)}end(){this.decoder.end()}}class P{static{t(this,"ServerMessageDecoder")}decoder;constructor(r){this.decoder=new p("server",f,r)}push(r){return this.decoder.push(r)}end(){this.decoder.end()}}function O(e){return Number.isInteger(e)&&e===E}t(O,"isSupportedProtocolVersion");export{D as ClientMessageDecoder,s as ProtocolValidationError,P as ServerMessageDecoder,b as encodeClientMessage,y as encodeServerMessage,O as isSupportedProtocolVersion,m as parseClientMessage,f as parseServerMessage};
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var o=(n,e)=>l(n,"name",{value:e,configurable:!0});const L=4,g=4294967295,f=65536,u=16777216;class i extends Error{static{o(this,"FrameError")}constructor(e){super(e),this.name="FrameError"}}function c(n){const e=n?.maxFrameLength??16777216;if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw new RangeError(`maxFrameLength must be an integer between 0 and ${4294967295}`);return e}o(c,"resolveMaxFrameLength");function m(n){if(!(n instanceof Uint8Array))throw new TypeError("Frame payload must be a Uint8Array");if(n.byteLength>4294967295)throw new RangeError("Frame payload exceeds the unsigned 32-bit length limit");const e=new Uint8Array(4+n.byteLength),h=n.byteLength;return e[0]=h>>>24,e[1]=h>>>16,e[2]=h>>>8,e[3]=h,e.set(n,4),e}o(m,"encodeFrame");class E{static{o(this,"FrameDecoder")}header=new Uint8Array(4);headerLength=0;maxFrameLength;payloadBlocks=[];currentPayloadBlock;currentPayloadBlockLength=0;expectedPayloadLength;payloadLength=0;state="open";constructor(e){this.maxFrameLength=c(e)}push(e){if(this.state==="ended")throw new i("Frame decoder has ended");if(this.state==="failed")throw new i("Frame decoder has failed");if(!(e instanceof Uint8Array))throw new TypeError("Frame chunk must be a Uint8Array");const h=[];let r=0;for(;r<e.byteLength;){if(this.expectedPayloadLength===void 0){const t=Math.min(4-this.headerLength,e.byteLength-r);if(this.header.set(e.subarray(r,r+t),this.headerLength),this.headerLength+=t,r+=t,this.headerLength<4)continue;const a=this.header[0]*16777216+this.header[1]*65536+this.header[2]*256+this.header[3];if(this.headerLength=0,a>this.maxFrameLength&&this.fail(`Frame length ${a} exceeds configured limit of ${this.maxFrameLength}`),a===0){h.push(new Uint8Array);continue}this.expectedPayloadLength=a,this.payloadBlocks=[],this.currentPayloadBlock=void 0,this.currentPayloadBlockLength=0,this.payloadLength=0}const s=this.expectedPayloadLength;if(s!==void 0){for(;r<e.byteLength&&this.payloadLength<s;){let t=this.currentPayloadBlock;(!t||this.currentPayloadBlockLength===t.byteLength)&&(t=new Uint8Array(Math.min(65536,s-this.payloadLength)),this.payloadBlocks.push(t),this.currentPayloadBlock=t,this.currentPayloadBlockLength=0);const a=Math.min(t.byteLength-this.currentPayloadBlockLength,e.byteLength-r);t.set(e.subarray(r,r+a),this.currentPayloadBlockLength),this.currentPayloadBlockLength+=a,this.payloadLength+=a,r+=a}if(this.payloadLength===s){if(this.payloadBlocks.length===1)h.push(this.payloadBlocks[0]);else{const t=new Uint8Array(s);let a=0;for(const d of this.payloadBlocks)t.set(d,a),a+=d.byteLength;h.push(t)}this.payloadBlocks=[],this.currentPayloadBlock=void 0,this.currentPayloadBlockLength=0,this.expectedPayloadLength=void 0,this.payloadLength=0}}}return h}end(){if(this.state==="ended")throw new i("Frame decoder has ended");if(this.state==="failed")throw new i("Frame decoder has failed");(this.headerLength!==0||this.expectedPayloadLength!==void 0)&&this.fail("Truncated frame at end of stream"),this.state="ended"}fail(e){throw this.state="failed",this.headerLength=0,this.payloadBlocks=[],this.currentPayloadBlock=void 0,this.currentPayloadBlockLength=0,this.expectedPayloadLength=void 0,this.payloadLength=0,new i(e)}}export{u as DEFAULT_MAX_FRAME_LENGTH,E as FrameDecoder,i as FrameError,m as encodeFrame};
@@ -1 +0,0 @@
1
- export*from"./cbor/index.js";export*from"./codec.js";export*from"./framing.js";import{isServerId as p,PROTOCOL_VERSION as t}from"./protocol.js";export{t as PROTOCOL_VERSION,p as isServerId};
@@ -1 +0,0 @@
1
- var m=Object.defineProperty;var a=(n,p)=>m(n,"name",{value:p,configurable:!0});import e from"typebox";import{Check as S}from"typebox/value";const h=8,r=e.String({minLength:1}),c=e.Unsafe(e.Unknown()),t=a(n=>e.Object(n,{additionalProperties:!1}),"StrictObject"),o=e.String({pattern:"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"});function R(n){return S(o,n)}a(R,"isServerId");const s=t({code:r,message:e.String()}),v=t({type:e.Literal("hello"),version:e.Integer({minimum:0})}),d=t({serverId:o}),i=t({serverId:o,sessionId:r,attachmentId:r}),l=e.Union([d,i]),L=t({type:e.Literal("request"),id:r,target:l,call:c}),g=t({type:e.Literal("cancel"),id:r,target:l}),T=e.Union([v,L,g]),u=t({type:e.Literal("hello"),version:e.Literal(h),serverId:o}),f=t({type:e.Literal("hello_error"),error:s}),I=e.Union([t({type:e.Literal("response"),id:r,ok:e.Literal(!0),result:e.Optional(c)}),t({type:e.Literal("response"),id:r,ok:e.Literal(!1),error:s})]),y=t({type:e.Literal("service_update"),subscriptionId:r,update:c}),E=t({type:e.Literal("attachment"),attachment:e.Union([i,e.Null()])}),b=e.Union([u,f,I,y,E]);export{T as ClientMessageSchema,h as PROTOCOL_VERSION,b as ServerMessageSchema,R as isServerId};
@@ -1 +0,0 @@
1
- var k=Object.defineProperty;var d=(l,R)=>k(l,"name",{value:R,configurable:!0});import e from"typebox";const h=1,n=e.String({minLength:1}),i=e.Integer({minimum:0}),t=d(l=>e.Object(l,{additionalProperties:!1}),"StrictObject"),E=e.Cyclic({JsonValue:e.Union([e.Null(),e.Boolean(),e.Number(),e.String(),e.Array(e.Ref("JsonValue")),e.Record(e.String(),e.Ref("JsonValue"))])},"JsonValue"),r=e.Unsafe(E),a=e.Union([e.Literal("off"),e.Literal("minimal"),e.Literal("low"),e.Literal("medium"),e.Literal("high"),e.Literal("xhigh"),e.Literal("max")]),P=e.Union([e.Literal("idle"),e.Literal("turn"),e.Literal("compaction"),e.Literal("branch_summary"),e.Literal("retry")]),s=t({provider:n,id:n}),f=t({input:e.Number({minimum:0}),output:e.Number({minimum:0}),cacheRead:e.Number({minimum:0}),cacheWrite:e.Number({minimum:0})}),N=t({provider:n,id:n,name:e.String({minLength:1}),api:n,reasoning:e.Boolean(),input:e.Array(e.Union([e.Literal("text"),e.Literal("image")])),contextWindow:e.Integer({minimum:1}),maxTokens:e.Integer({minimum:1}),cost:f,supportedThinkingLevels:e.Array(a,{minItems:1}),authenticated:e.Boolean()}),c=t({type:e.Literal("text"),text:e.String()}),w=t({type:e.Literal("thinking"),thinking:e.String(),redacted:e.Optional(e.Boolean())}),S=t({type:e.Literal("image"),data:e.String(),mimeType:e.String({minLength:1})}),M=t({type:e.Literal("toolCall"),toolCallId:n,toolName:n,input:r}),q=e.Union([c,S]),V=e.Union([c,w,M]),B=e.Union([c,S]),u=t({input:e.Integer({minimum:0}),output:e.Integer({minimum:0}),cacheRead:e.Integer({minimum:0}),cacheWrite:e.Integer({minimum:0}),reasoning:e.Optional(e.Integer({minimum:0})),totalTokens:e.Integer({minimum:0}),cost:t({input:e.Number({minimum:0}),output:e.Number({minimum:0}),cacheRead:e.Number({minimum:0}),cacheWrite:e.Number({minimum:0}),total:e.Number({minimum:0})})}),L=t({id:n,role:e.Literal("user"),content:e.Array(q),timestamp:i}),m={id:n,role:e.Literal("assistant"),content:e.Array(V),model:s,responseModel:e.Optional(e.String({minLength:1})),usage:e.Optional(u),timestamp:i},J=t({...m,status:e.Literal("streaming")}),x=t({...m,status:e.Literal("complete"),stopReason:e.Union([e.Literal("stop"),e.Literal("length"),e.Literal("toolUse")])}),g=t({...m,status:e.Literal("error"),stopReason:e.Literal("error"),errorMessage:e.Optional(e.String({minLength:1}))}),I=t({...m,status:e.Literal("aborted"),stopReason:e.Literal("aborted"),errorMessage:e.Optional(e.String())}),y=e.Union([J,x,g,I]),p={id:n,role:e.Literal("tool"),toolCallId:n,toolName:n,input:r,content:e.Array(B),details:e.Optional(r),usage:e.Optional(u),timestamp:i},W=t({...p,status:e.Literal("running"),isError:e.Literal(!1)}),U=t({...p,status:e.Literal("complete"),isError:e.Literal(!1)}),C=t({...p,status:e.Literal("error"),isError:e.Literal(!0)}),v=e.Union([W,U,C]),T=e.Union([L,y,v]),H=e.Union([t({type:e.Literal("item_started"),item:T}),t({type:e.Literal("assistant_delta"),messageId:n,contentIndex:e.Integer({minimum:0}),kind:e.Union([e.Literal("text"),e.Literal("thinking"),e.Literal("toolCall")]),delta:e.String()}),t({type:e.Literal("item_updated"),item:e.Union([y,v])}),t({type:e.Literal("item_finished"),item:e.Union([x,g,I,U,C])})]),A=t({id:n,createdAt:i,updatedAt:e.Optional(i),parentSessionId:e.Optional(n),sessionName:e.Optional(e.String()),cwd:e.Optional(e.String({minLength:1}))}),o=t({id:n,name:e.Optional(e.String()),cwd:e.String({minLength:1}),createdAt:i,updatedAt:i,phase:P,model:s,thinkingLevel:a,attached:e.Boolean(),locked:e.Boolean(),revision:e.Integer({minimum:0}),transcript:e.Array(T),queuedSteer:e.Array(L),queuedSteerCount:e.Integer({minimum:0})}),O=t({serverId:n,protocolVersion:e.Literal(h),revision:e.Integer({minimum:0}),sessions:e.Array(A),models:e.Array(N)}),j=e.Union([e.Literal("version"),e.Literal("busy"),e.Literal("session_locked"),e.Literal("not_found"),e.Literal("invalid_request"),e.Literal("not_implemented"),e.Literal("internal_error")]),b=t({code:j,message:e.String(),details:e.Optional(r)}),_={sessionId:n,text:e.String()},D=t({command:e.Literal("list")}),z=t({command:e.Literal("create"),cwd:e.Optional(e.String({minLength:1})),name:e.Optional(e.String()),model:e.Optional(s),thinkingLevel:e.Optional(a)}),F=t({command:e.Literal("attach"),sessionId:n}),G=t({command:e.Literal("detach"),sessionId:n}),K=t({command:e.Literal("prompt"),..._}),Q=t({command:e.Literal("steer"),..._}),X=t({command:e.Literal("abort"),sessionId:n}),Y=t({command:e.Literal("set_model"),sessionId:n,model:s}),Z=t({command:e.Literal("set_thinking"),sessionId:n,thinkingLevel:a}),$=e.Union([e.Literal("info"),e.Literal("warning"),e.Literal("error")]),ee=e.Union([e.Literal("aux"),e.Literal("status")]),te=t({title:e.Optional(e.String()),lines:e.Optional(e.Array(e.String())),placement:e.Optional(ee)}),ne=t({id:n,label:e.String(),description:e.Optional(e.String())}),oe=e.Union([t({kind:e.Literal("input"),title:e.String(),placeholder:e.Optional(e.String())}),t({kind:e.Literal("choice"),title:e.String(),items:e.Array(ne,{minItems:1})})]),ie=e.Union([t({kind:e.Literal("panel"),id:n,panel:e.Optional(te)}),t({kind:e.Literal("status"),key:n,text:e.Optional(e.String())}),t({kind:e.Literal("notify"),level:$,message:e.String()}),t({kind:e.Literal("request"),requestId:n,request:oe})]),re=e.Union([t({type:e.Literal("value"),value:e.String()}),t({type:e.Literal("cancelled")})]),ae=t({command:e.Literal("subscribe_extension_ui"),sessionId:n}),se=t({command:e.Literal("extension_ui_answer"),sessionId:n,requestId:n,answer:re}),me=e.Union([D,z,F,G,K,Q,X,Y,Z,ae,se]),le=t({command:e.Literal("create"),session:o}),ce=t({command:e.Literal("attach"),session:o}),pe=t({command:e.Literal("prompt"),session:o}),de=t({command:e.Literal("steer"),session:o}),he=t({command:e.Literal("abort"),session:o}),Se=t({command:e.Literal("set_model"),session:o}),ue=t({command:e.Literal("set_thinking"),session:o}),Le=t({command:e.Literal("subscribe_extension_ui"),sessionId:n}),xe=t({command:e.Literal("extension_ui_answer"),sessionId:n,requestId:n}),ge=t({command:e.Literal("list"),sessions:e.Array(A)}),Ie=t({command:e.Literal("detach"),sessionId:n}),ye=e.Union([ge,le,ce,Ie,pe,de,he,Se,ue,Le,xe]),Ue=t({type:e.Literal("hello"),version:e.Integer({minimum:0})}),Ce=t({type:e.Literal("request"),id:n,request:me}),ke=e.Union([Ue,Ce]),ve=e.Union([t({type:e.Literal("server_snapshot"),snapshot:O}),t({type:e.Literal("session_snapshot"),snapshot:o}),t({type:e.Literal("session_progress"),sessionId:n,progress:H}),t({type:e.Literal("session_removed"),sessionId:n}),t({type:e.Literal("extension_ui"),sessionId:n,payload:ie})]),Te=t({type:e.Literal("hello"),version:e.Literal(h),connectionId:n,snapshot:O}),Ae=t({type:e.Literal("hello_error"),error:b}),Oe=e.Union([t({type:e.Literal("response"),id:n,ok:e.Literal(!0),result:ye}),t({type:e.Literal("response"),id:n,ok:e.Literal(!1),error:b})]),be=t({type:e.Literal("event"),event:ve}),Ee=e.Union([Te,Ae,Oe,be]);export{X as AbortCommandSchema,he as AbortResultSchema,V as AssistantContentSchema,y as AssistantTranscriptItemSchema,F as AttachCommandSchema,ce as AttachResultSchema,Ue as ClientHelloSchema,ke as ClientMessageSchema,ye as CommandResultSchema,me as CommandSchema,z as CreateCommandSchema,le as CreateResultSchema,G as DetachCommandSchema,Ie as DetachResultSchema,be as EventEnvelopeSchema,se as ExtensionUiAnswerCommandSchema,xe as ExtensionUiAnswerResultSchema,re as ExtensionUiAnswerSchema,ne as ExtensionUiChoiceItemSchema,$ as ExtensionUiLevelSchema,te as ExtensionUiPanelSchema,ie as ExtensionUiPayloadSchema,ee as ExtensionUiPlacementSchema,oe as ExtensionUiPromptSchema,S as ImageContentSchema,r as JsonValueSchema,D as ListCommandSchema,ge as ListResultSchema,f as ModelCostSchema,N as ModelMetadataSchema,s as ModelRefSchema,h as PROTOCOL_VERSION,K as PromptCommandSchema,pe as PromptResultSchema,j as ProtocolErrorCodeSchema,b as ProtocolErrorSchema,Ce as RequestEnvelopeSchema,Oe as ResponseEnvelopeSchema,ve as ServerEventSchema,Ae as ServerHelloErrorSchema,Te as ServerHelloSchema,Ee as ServerMessageSchema,O as ServerSnapshotSchema,A as SessionMetadataSchema,P as SessionPhaseSchema,o as SessionSnapshotSchema,Y as SetModelCommandSchema,Se as SetModelResultSchema,Z as SetThinkingCommandSchema,ue as SetThinkingResultSchema,Q as SteerCommandSchema,de as SteerResultSchema,ae as SubscribeExtensionUiCommandSchema,Le as SubscribeExtensionUiResultSchema,c as TextContentSchema,w as ThinkingContentSchema,a as ThinkingLevelSchema,M as ToolCallContentSchema,B as ToolContentSchema,v as ToolTranscriptItemSchema,T as TranscriptItemSchema,H as TranscriptProgressSchema,u as UsageSchema,q as UserContentSchema,L as UserTranscriptItemSchema};
@@ -1,39 +0,0 @@
1
- {
2
- "name": "@earendil-works/pi-protocol",
3
- "version": "1.0.44",
4
- "description": "Transport-neutral CBOR protocol for remote pi sessions",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
12
- }
13
- },
14
- "files": [
15
- "dist",
16
- "README.md"
17
- ],
18
- "keywords": [
19
- "pi",
20
- "protocol",
21
- "cbor",
22
- "binary",
23
- "framing"
24
- ],
25
- "author": "Earendil Works",
26
- "license": "MIT",
27
- "repository": {
28
- "type": "git",
29
- "url": "git+https://github.com/earendil-works/pi.git",
30
- "directory": "packages/protocol"
31
- },
32
- "engines": {
33
- "node": ">=22.19.0"
34
- },
35
- "dependencies": {
36
- "@earendil-works/chord": "^1.0.44",
37
- "typebox": "1.3.27"
38
- }
39
- }
@@ -1,81 +0,0 @@
1
- # Changelog
2
-
3
- `0.84.x` headings are inherited Pi history. DAL Code product version is `0.1.0`.
4
-
5
- ## [1.1.0] - 2026-10-07
6
-
7
- ## [1.0.4] - 2026-10-05
8
-
9
- ## [1.0.3] - 2026-10-05
10
-
11
- ## [1.0.2] - 2026-10-04
12
-
13
- ## [1.0.1] - 2026-10-03
14
-
15
- ## [1.0.0] - 2026-10-01
16
-
17
- ### Breaking Changes
18
-
19
- - `SessionMetadata` is now exported by `@earendil-works/pi-server` and requires only `id`; the package no longer depends on `@earendil-works/pi-agent-core`. The testing `TestServerHost` keeps an in-memory session map instead of a `MemorySessionRepo`, and `TestHarness` exposes `metadata` instead of `session`.
20
-
21
- ## [0.99.2] - 2026-09-30
22
-
23
- ## [0.99.1] - 2026-09-29
24
-
25
- ## [0.99.0] - 2026-09-29
26
-
27
- ## [0.87.1] - 2026-09-22
28
-
29
- ## [Unreleased]
30
-
31
- ### Added
32
-
33
- - Forwards `extension_ui` runtime events only to connections that called `subscribe_extension_ui`. `extension_ui_answer` is delivered to `PiSessionRuntime.answerExtensionUi`.
34
-
35
- ## [0.84.3] - 2026-08-24
36
-
37
- ## [0.84.2] - 2026-08-14
38
-
39
- ## [0.84.1] - 2026-08-07
40
-
41
- ## [0.84.0] - 2026-08-06
42
-
43
- ### Breaking Changes
44
-
45
- - Changed `toProtocolToolResultMessage()` to require the original `ToolCall` and verify tool result association.
46
- - Changed `PiServerService.listSessions()` to return durable `SessionMetadata` instead of runtime `SessionSummary` values ([#7708](https://github.com/earendil-works/pi/pull/7708)).
47
-
48
- ### Fixed
49
-
50
- - Hardened protocol adapters against contradictory lifecycle states, invalid identifiers and timestamps, sparse execution arrays, and additive `pi-ai` contract drift.
51
- - Sanitized service and runtime failures into stable `not_implemented` and `internal_error` responses without exposing private error details ([#7644](https://github.com/earendil-works/pi/pull/7644)).
52
-
53
- ## [0.83.0] - 2026-07-29
54
-
55
- ## [0.82.1] - 2026-07-25
56
-
57
- ## [0.82.0] - 2026-07-24
58
-
59
- ## [0.81.1] - 2026-07-21
60
-
61
- ## [0.81.0] - 2026-07-21
62
-
63
- ### Changed
64
-
65
- - Renamed the orchestrator workspace package and internal server references to server ([#6898](https://github.com/earendil-works/pi/pull/6898) by [@cristinaponcela](https://github.com/cristinaponcela)).
66
-
67
- ## [0.80.10] - 2026-07-16
68
-
69
- ## [0.80.9] - 2026-07-16
70
-
71
- ## [0.80.8] - 2026-07-16
72
-
73
- ## [0.80.7] - 2026-07-14
74
-
75
- ## [0.80.6] - 2026-07-09
76
-
77
- ## [0.80.5] - 2026-07-09
78
-
79
- ## [0.80.4] - 2026-07-09
80
-
81
- ## [0.80.3] - 2026-06-30
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Mario Zechner
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.