@greppleai/grip 0.0.0-stage → 0.1.3

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 (1119) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/README.md +731 -2
  3. package/dist/bun/cli.d.ts +3 -0
  4. package/dist/bun/cli.d.ts.map +1 -0
  5. package/dist/bun/cli.js +13 -0
  6. package/dist/bun/cli.js.map +1 -0
  7. package/dist/bun/embedded-assets.d.ts +3 -0
  8. package/dist/bun/embedded-assets.d.ts.map +1 -0
  9. package/dist/bun/embedded-assets.js +52 -0
  10. package/dist/bun/embedded-assets.js.map +1 -0
  11. package/dist/bun/register-bedrock.d.ts +2 -0
  12. package/dist/bun/register-bedrock.d.ts.map +1 -0
  13. package/dist/bun/register-bedrock.js +4 -0
  14. package/dist/bun/register-bedrock.js.map +1 -0
  15. package/dist/bun/restore-sandbox-env.d.ts +13 -0
  16. package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
  17. package/dist/bun/restore-sandbox-env.js +32 -0
  18. package/dist/bun/restore-sandbox-env.js.map +1 -0
  19. package/dist/cli/args.d.ts +70 -0
  20. package/dist/cli/args.d.ts.map +1 -0
  21. package/dist/cli/args.js +442 -0
  22. package/dist/cli/args.js.map +1 -0
  23. package/dist/cli/config-selector.d.ts +14 -0
  24. package/dist/cli/config-selector.d.ts.map +1 -0
  25. package/dist/cli/config-selector.js +31 -0
  26. package/dist/cli/config-selector.js.map +1 -0
  27. package/dist/cli/file-processor.d.ts +15 -0
  28. package/dist/cli/file-processor.d.ts.map +1 -0
  29. package/dist/cli/file-processor.js +60 -0
  30. package/dist/cli/file-processor.js.map +1 -0
  31. package/dist/cli/initial-message.d.ts +18 -0
  32. package/dist/cli/initial-message.d.ts.map +1 -0
  33. package/dist/cli/initial-message.js +22 -0
  34. package/dist/cli/initial-message.js.map +1 -0
  35. package/dist/cli/list-models.d.ts +9 -0
  36. package/dist/cli/list-models.d.ts.map +1 -0
  37. package/dist/cli/list-models.js +98 -0
  38. package/dist/cli/list-models.js.map +1 -0
  39. package/dist/cli/session-picker.d.ts +9 -0
  40. package/dist/cli/session-picker.d.ts.map +1 -0
  41. package/dist/cli/session-picker.js +35 -0
  42. package/dist/cli/session-picker.js.map +1 -0
  43. package/dist/cli.d.ts +3 -0
  44. package/dist/cli.d.ts.map +1 -0
  45. package/dist/cli.js +14 -0
  46. package/dist/cli.js.map +1 -0
  47. package/dist/config.d.ts +82 -0
  48. package/dist/config.d.ts.map +1 -0
  49. package/dist/config.js +406 -0
  50. package/dist/config.js.map +1 -0
  51. package/dist/core/agent-session.d.ts +970 -0
  52. package/dist/core/agent-session.d.ts.map +1 -0
  53. package/dist/core/agent-session.js +5191 -0
  54. package/dist/core/agent-session.js.map +1 -0
  55. package/dist/core/auth-guidance.d.ts +5 -0
  56. package/dist/core/auth-guidance.d.ts.map +1 -0
  57. package/dist/core/auth-guidance.js +21 -0
  58. package/dist/core/auth-guidance.js.map +1 -0
  59. package/dist/core/auth-storage.d.ts +150 -0
  60. package/dist/core/auth-storage.d.ts.map +1 -0
  61. package/dist/core/auth-storage.js +557 -0
  62. package/dist/core/auth-storage.js.map +1 -0
  63. package/dist/core/bash-executor.d.ts +26 -0
  64. package/dist/core/bash-executor.d.ts.map +1 -0
  65. package/dist/core/bash-executor.js +99 -0
  66. package/dist/core/bash-executor.js.map +1 -0
  67. package/dist/core/compaction/branch-summarization.d.ts +83 -0
  68. package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  69. package/dist/core/compaction/branch-summarization.js +220 -0
  70. package/dist/core/compaction/branch-summarization.js.map +1 -0
  71. package/dist/core/compaction/compaction.d.ts +65 -0
  72. package/dist/core/compaction/compaction.d.ts.map +1 -0
  73. package/dist/core/compaction/compaction.js +550 -0
  74. package/dist/core/compaction/compaction.js.map +1 -0
  75. package/dist/core/compaction/compression-detection-ledger.d.ts +34 -0
  76. package/dist/core/compaction/compression-detection-ledger.d.ts.map +1 -0
  77. package/dist/core/compaction/compression-detection-ledger.js +52 -0
  78. package/dist/core/compaction/compression-detection-ledger.js.map +1 -0
  79. package/dist/core/compaction/compression-detector.d.ts +71 -0
  80. package/dist/core/compaction/compression-detector.d.ts.map +1 -0
  81. package/dist/core/compaction/compression-detector.js +407 -0
  82. package/dist/core/compaction/compression-detector.js.map +1 -0
  83. package/dist/core/compaction/compression-economics.d.ts +55 -0
  84. package/dist/core/compaction/compression-economics.d.ts.map +1 -0
  85. package/dist/core/compaction/compression-economics.js +151 -0
  86. package/dist/core/compaction/compression-economics.js.map +1 -0
  87. package/dist/core/compaction/utils.d.ts +28 -0
  88. package/dist/core/compaction/utils.d.ts.map +1 -0
  89. package/dist/core/compaction/utils.js +165 -0
  90. package/dist/core/compaction/utils.js.map +1 -0
  91. package/dist/core/defaults.d.ts +3 -0
  92. package/dist/core/defaults.d.ts.map +1 -0
  93. package/dist/core/defaults.js +2 -0
  94. package/dist/core/defaults.js.map +1 -0
  95. package/dist/core/diagnostics.d.ts +18 -0
  96. package/dist/core/diagnostics.d.ts.map +1 -0
  97. package/dist/core/diagnostics.js +2 -0
  98. package/dist/core/diagnostics.js.map +1 -0
  99. package/dist/core/event-bus.d.ts +9 -0
  100. package/dist/core/event-bus.d.ts.map +1 -0
  101. package/dist/core/event-bus.js +25 -0
  102. package/dist/core/event-bus.js.map +1 -0
  103. package/dist/core/exec.d.ts +29 -0
  104. package/dist/core/exec.d.ts.map +1 -0
  105. package/dist/core/exec.js +75 -0
  106. package/dist/core/exec.js.map +1 -0
  107. package/dist/core/export-html/ansi-to-html.d.ts +22 -0
  108. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  109. package/dist/core/export-html/ansi-to-html.js +245 -0
  110. package/dist/core/export-html/ansi-to-html.js.map +1 -0
  111. package/dist/core/export-html/index.d.ts +21 -0
  112. package/dist/core/export-html/index.d.ts.map +1 -0
  113. package/dist/core/export-html/index.js +230 -0
  114. package/dist/core/export-html/index.js.map +1 -0
  115. package/dist/core/export-html/template.css +1066 -0
  116. package/dist/core/export-html/template.html +55 -0
  117. package/dist/core/export-html/template.js +1864 -0
  118. package/dist/core/export-html/tool-renderer.d.ts +32 -0
  119. package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  120. package/dist/core/export-html/tool-renderer.js +108 -0
  121. package/dist/core/export-html/tool-renderer.js.map +1 -0
  122. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  123. package/dist/core/export-html/vendor/marked.min.js +78 -0
  124. package/dist/core/extensions/loader.d.ts +24 -0
  125. package/dist/core/extensions/loader.d.ts.map +1 -0
  126. package/dist/core/extensions/loader.js +613 -0
  127. package/dist/core/extensions/loader.js.map +1 -0
  128. package/dist/core/extensions/runner.d.ts +160 -0
  129. package/dist/core/extensions/runner.d.ts.map +1 -0
  130. package/dist/core/extensions/runner.js +962 -0
  131. package/dist/core/extensions/runner.js.map +1 -0
  132. package/dist/core/extensions/types.d.ts +1311 -0
  133. package/dist/core/extensions/types.d.ts.map +1 -0
  134. package/dist/core/extensions/types.js +51 -0
  135. package/dist/core/extensions/types.js.map +1 -0
  136. package/dist/core/extensions/wrapper.d.ts +20 -0
  137. package/dist/core/extensions/wrapper.d.ts.map +1 -0
  138. package/dist/core/extensions/wrapper.js +22 -0
  139. package/dist/core/extensions/wrapper.js.map +1 -0
  140. package/dist/core/footer-data-provider.d.ts +52 -0
  141. package/dist/core/footer-data-provider.d.ts.map +1 -0
  142. package/dist/core/footer-data-provider.js +318 -0
  143. package/dist/core/footer-data-provider.js.map +1 -0
  144. package/dist/core/grip-agent.d.ts +240 -0
  145. package/dist/core/grip-agent.d.ts.map +1 -0
  146. package/dist/core/grip-agent.js +1243 -0
  147. package/dist/core/grip-agent.js.map +1 -0
  148. package/dist/core/grip-manifest.d.ts +9 -0
  149. package/dist/core/grip-manifest.d.ts.map +1 -0
  150. package/dist/core/grip-manifest.js +25 -0
  151. package/dist/core/grip-manifest.js.map +1 -0
  152. package/dist/core/hooks/aggregate.d.ts +5 -0
  153. package/dist/core/hooks/aggregate.d.ts.map +1 -0
  154. package/dist/core/hooks/aggregate.js +226 -0
  155. package/dist/core/hooks/aggregate.js.map +1 -0
  156. package/dist/core/hooks/config.d.ts +14 -0
  157. package/dist/core/hooks/config.d.ts.map +1 -0
  158. package/dist/core/hooks/config.js +372 -0
  159. package/dist/core/hooks/config.js.map +1 -0
  160. package/dist/core/hooks/executor.d.ts +12 -0
  161. package/dist/core/hooks/executor.d.ts.map +1 -0
  162. package/dist/core/hooks/executor.js +708 -0
  163. package/dist/core/hooks/executor.js.map +1 -0
  164. package/dist/core/hooks/index.d.ts +9 -0
  165. package/dist/core/hooks/index.d.ts.map +1 -0
  166. package/dist/core/hooks/index.js +14 -0
  167. package/dist/core/hooks/index.js.map +1 -0
  168. package/dist/core/hooks/matcher.d.ts +10 -0
  169. package/dist/core/hooks/matcher.d.ts.map +1 -0
  170. package/dist/core/hooks/matcher.js +70 -0
  171. package/dist/core/hooks/matcher.js.map +1 -0
  172. package/dist/core/hooks/trust-store.d.ts +38 -0
  173. package/dist/core/hooks/trust-store.d.ts.map +1 -0
  174. package/dist/core/hooks/trust-store.js +167 -0
  175. package/dist/core/hooks/trust-store.js.map +1 -0
  176. package/dist/core/hooks/types.d.ts +234 -0
  177. package/dist/core/hooks/types.d.ts.map +1 -0
  178. package/dist/core/hooks/types.js +52 -0
  179. package/dist/core/hooks/types.js.map +1 -0
  180. package/dist/core/http-dispatcher.d.ts +21 -0
  181. package/dist/core/http-dispatcher.d.ts.map +1 -0
  182. package/dist/core/http-dispatcher.js +82 -0
  183. package/dist/core/http-dispatcher.js.map +1 -0
  184. package/dist/core/instruction-resource-loader.d.ts +81 -0
  185. package/dist/core/instruction-resource-loader.d.ts.map +1 -0
  186. package/dist/core/instruction-resource-loader.js +574 -0
  187. package/dist/core/instruction-resource-loader.js.map +1 -0
  188. package/dist/core/keybindings.d.ts +399 -0
  189. package/dist/core/keybindings.d.ts.map +1 -0
  190. package/dist/core/keybindings.js +299 -0
  191. package/dist/core/keybindings.js.map +1 -0
  192. package/dist/core/lsp/abort.d.ts +3 -0
  193. package/dist/core/lsp/abort.d.ts.map +1 -0
  194. package/dist/core/lsp/abort.js +28 -0
  195. package/dist/core/lsp/abort.js.map +1 -0
  196. package/dist/core/lsp/client.d.ts +108 -0
  197. package/dist/core/lsp/client.d.ts.map +1 -0
  198. package/dist/core/lsp/client.js +586 -0
  199. package/dist/core/lsp/client.js.map +1 -0
  200. package/dist/core/lsp/config-loader.d.ts +44 -0
  201. package/dist/core/lsp/config-loader.d.ts.map +1 -0
  202. package/dist/core/lsp/config-loader.js +223 -0
  203. package/dist/core/lsp/config-loader.js.map +1 -0
  204. package/dist/core/lsp/config.d.ts +134 -0
  205. package/dist/core/lsp/config.d.ts.map +1 -0
  206. package/dist/core/lsp/config.js +682 -0
  207. package/dist/core/lsp/config.js.map +1 -0
  208. package/dist/core/lsp/diagnostics.d.ts +18 -0
  209. package/dist/core/lsp/diagnostics.d.ts.map +1 -0
  210. package/dist/core/lsp/diagnostics.js +311 -0
  211. package/dist/core/lsp/diagnostics.js.map +1 -0
  212. package/dist/core/lsp/file-sync.d.ts +58 -0
  213. package/dist/core/lsp/file-sync.d.ts.map +1 -0
  214. package/dist/core/lsp/file-sync.js +432 -0
  215. package/dist/core/lsp/file-sync.js.map +1 -0
  216. package/dist/core/lsp/integration.d.ts +62 -0
  217. package/dist/core/lsp/integration.d.ts.map +1 -0
  218. package/dist/core/lsp/integration.js +145 -0
  219. package/dist/core/lsp/integration.js.map +1 -0
  220. package/dist/core/lsp/language-map.d.ts +54 -0
  221. package/dist/core/lsp/language-map.d.ts.map +1 -0
  222. package/dist/core/lsp/language-map.js +300 -0
  223. package/dist/core/lsp/language-map.js.map +1 -0
  224. package/dist/core/lsp/manager.d.ts +120 -0
  225. package/dist/core/lsp/manager.d.ts.map +1 -0
  226. package/dist/core/lsp/manager.js +636 -0
  227. package/dist/core/lsp/manager.js.map +1 -0
  228. package/dist/core/lsp/navigation.d.ts +32 -0
  229. package/dist/core/lsp/navigation.d.ts.map +1 -0
  230. package/dist/core/lsp/navigation.js +327 -0
  231. package/dist/core/lsp/navigation.js.map +1 -0
  232. package/dist/core/lsp/portable-path.d.ts +18 -0
  233. package/dist/core/lsp/portable-path.d.ts.map +1 -0
  234. package/dist/core/lsp/portable-path.js +83 -0
  235. package/dist/core/lsp/portable-path.js.map +1 -0
  236. package/dist/core/lsp/refactor.d.ts +32 -0
  237. package/dist/core/lsp/refactor.d.ts.map +1 -0
  238. package/dist/core/lsp/refactor.js +519 -0
  239. package/dist/core/lsp/refactor.js.map +1 -0
  240. package/dist/core/lsp/transport.d.ts +39 -0
  241. package/dist/core/lsp/transport.d.ts.map +1 -0
  242. package/dist/core/lsp/transport.js +261 -0
  243. package/dist/core/lsp/transport.js.map +1 -0
  244. package/dist/core/messages.d.ts +34 -0
  245. package/dist/core/messages.d.ts.map +1 -0
  246. package/dist/core/messages.js +140 -0
  247. package/dist/core/messages.js.map +1 -0
  248. package/dist/core/model-registry.d.ts +148 -0
  249. package/dist/core/model-registry.d.ts.map +1 -0
  250. package/dist/core/model-registry.js +812 -0
  251. package/dist/core/model-registry.js.map +1 -0
  252. package/dist/core/model-resolver.d.ts +115 -0
  253. package/dist/core/model-resolver.d.ts.map +1 -0
  254. package/dist/core/model-resolver.js +498 -0
  255. package/dist/core/model-resolver.js.map +1 -0
  256. package/dist/core/output-guard.d.ts +7 -0
  257. package/dist/core/output-guard.d.ts.map +1 -0
  258. package/dist/core/output-guard.js +89 -0
  259. package/dist/core/output-guard.js.map +1 -0
  260. package/dist/core/package-manager.d.ts +209 -0
  261. package/dist/core/package-manager.d.ts.map +1 -0
  262. package/dist/core/package-manager.js +2341 -0
  263. package/dist/core/package-manager.js.map +1 -0
  264. package/dist/core/prompt-templates.d.ts +57 -0
  265. package/dist/core/prompt-templates.d.ts.map +1 -0
  266. package/dist/core/prompt-templates.js +353 -0
  267. package/dist/core/prompt-templates.js.map +1 -0
  268. package/dist/core/provider-display-names.d.ts +2 -0
  269. package/dist/core/provider-display-names.d.ts.map +1 -0
  270. package/dist/core/provider-display-names.js +33 -0
  271. package/dist/core/provider-display-names.js.map +1 -0
  272. package/dist/core/remote-workspace-protocol/contract.d.ts +465 -0
  273. package/dist/core/remote-workspace-protocol/contract.d.ts.map +1 -0
  274. package/dist/core/remote-workspace-protocol/contract.js +825 -0
  275. package/dist/core/remote-workspace-protocol/contract.js.map +1 -0
  276. package/dist/core/remote-workspace-protocol/guest-shared-client.d.ts +16 -0
  277. package/dist/core/remote-workspace-protocol/guest-shared-client.d.ts.map +1 -0
  278. package/dist/core/remote-workspace-protocol/guest-shared-client.js +54 -0
  279. package/dist/core/remote-workspace-protocol/guest-shared-client.js.map +1 -0
  280. package/dist/core/remote-workspace-protocol/guest-shared-outbound-scheduler.d.ts +23 -0
  281. package/dist/core/remote-workspace-protocol/guest-shared-outbound-scheduler.d.ts.map +1 -0
  282. package/dist/core/remote-workspace-protocol/guest-shared-outbound-scheduler.js +112 -0
  283. package/dist/core/remote-workspace-protocol/guest-shared-outbound-scheduler.js.map +1 -0
  284. package/dist/core/remote-workspace-protocol/guest-shared-uplink.d.ts +30 -0
  285. package/dist/core/remote-workspace-protocol/guest-shared-uplink.d.ts.map +1 -0
  286. package/dist/core/remote-workspace-protocol/guest-shared-uplink.js +243 -0
  287. package/dist/core/remote-workspace-protocol/guest-shared-uplink.js.map +1 -0
  288. package/dist/core/remote-workspace-protocol/lima-owner-directory.d.ts +3 -0
  289. package/dist/core/remote-workspace-protocol/lima-owner-directory.d.ts.map +1 -0
  290. package/dist/core/remote-workspace-protocol/lima-owner-directory.js +31 -0
  291. package/dist/core/remote-workspace-protocol/lima-owner-directory.js.map +1 -0
  292. package/dist/core/remote-workspace-protocol/lima-owner-lock.d.ts +9 -0
  293. package/dist/core/remote-workspace-protocol/lima-owner-lock.d.ts.map +1 -0
  294. package/dist/core/remote-workspace-protocol/lima-owner-lock.js +89 -0
  295. package/dist/core/remote-workspace-protocol/lima-owner-lock.js.map +1 -0
  296. package/dist/core/remote-workspace-protocol/session.d.ts +249 -0
  297. package/dist/core/remote-workspace-protocol/session.d.ts.map +1 -0
  298. package/dist/core/remote-workspace-protocol/session.js +1842 -0
  299. package/dist/core/remote-workspace-protocol/session.js.map +1 -0
  300. package/dist/core/remote-workspace-protocol/shared-transport.d.ts +71 -0
  301. package/dist/core/remote-workspace-protocol/shared-transport.d.ts.map +1 -0
  302. package/dist/core/remote-workspace-protocol/shared-transport.js +68 -0
  303. package/dist/core/remote-workspace-protocol/shared-transport.js.map +1 -0
  304. package/dist/core/resolve-config-value.d.ts +32 -0
  305. package/dist/core/resolve-config-value.d.ts.map +1 -0
  306. package/dist/core/resolve-config-value.js +257 -0
  307. package/dist/core/resolve-config-value.js.map +1 -0
  308. package/dist/core/resource-loader.d.ts +200 -0
  309. package/dist/core/resource-loader.d.ts.map +1 -0
  310. package/dist/core/resource-loader.js +1209 -0
  311. package/dist/core/resource-loader.js.map +1 -0
  312. package/dist/core/rules.d.ts +40 -0
  313. package/dist/core/rules.d.ts.map +1 -0
  314. package/dist/core/rules.js +57 -0
  315. package/dist/core/rules.js.map +1 -0
  316. package/dist/core/sandbox/command.d.ts +25 -0
  317. package/dist/core/sandbox/command.d.ts.map +1 -0
  318. package/dist/core/sandbox/command.js +102 -0
  319. package/dist/core/sandbox/command.js.map +1 -0
  320. package/dist/core/sandbox/config.d.ts +91 -0
  321. package/dist/core/sandbox/config.d.ts.map +1 -0
  322. package/dist/core/sandbox/config.js +88 -0
  323. package/dist/core/sandbox/config.js.map +1 -0
  324. package/dist/core/sandbox/lima-guest-binary.d.ts +11 -0
  325. package/dist/core/sandbox/lima-guest-binary.d.ts.map +1 -0
  326. package/dist/core/sandbox/lima-guest-binary.js +140 -0
  327. package/dist/core/sandbox/lima-guest-binary.js.map +1 -0
  328. package/dist/core/sandbox/lima.d.ts +57 -0
  329. package/dist/core/sandbox/lima.d.ts.map +1 -0
  330. package/dist/core/sandbox/lima.js +716 -0
  331. package/dist/core/sandbox/lima.js.map +1 -0
  332. package/dist/core/sandbox/shared-lima-roots.d.ts +11 -0
  333. package/dist/core/sandbox/shared-lima-roots.d.ts.map +1 -0
  334. package/dist/core/sandbox/shared-lima-roots.js +25 -0
  335. package/dist/core/sandbox/shared-lima-roots.js.map +1 -0
  336. package/dist/core/sandbox/update-shared-guest-binary.d.ts +8 -0
  337. package/dist/core/sandbox/update-shared-guest-binary.d.ts.map +1 -0
  338. package/dist/core/sandbox/update-shared-guest-binary.js +100 -0
  339. package/dist/core/sandbox/update-shared-guest-binary.js.map +1 -0
  340. package/dist/core/session/constants.d.ts +2 -0
  341. package/dist/core/session/constants.d.ts.map +1 -0
  342. package/dist/core/session/constants.js +2 -0
  343. package/dist/core/session/constants.js.map +1 -0
  344. package/dist/core/session/context-metadata.d.ts +5 -0
  345. package/dist/core/session/context-metadata.d.ts.map +1 -0
  346. package/dist/core/session/context-metadata.js +55 -0
  347. package/dist/core/session/context-metadata.js.map +1 -0
  348. package/dist/core/session/context.d.ts +14 -0
  349. package/dist/core/session/context.d.ts.map +1 -0
  350. package/dist/core/session/context.js +117 -0
  351. package/dist/core/session/context.js.map +1 -0
  352. package/dist/core/session/ids.d.ts +9 -0
  353. package/dist/core/session/ids.d.ts.map +1 -0
  354. package/dist/core/session/ids.js +21 -0
  355. package/dist/core/session/ids.js.map +1 -0
  356. package/dist/core/session/in-memory-session-manager.d.ts +17 -0
  357. package/dist/core/session/in-memory-session-manager.d.ts.map +1 -0
  358. package/dist/core/session/in-memory-session-manager.js +40 -0
  359. package/dist/core/session/in-memory-session-manager.js.map +1 -0
  360. package/dist/core/session/in-memory-session.d.ts +7 -0
  361. package/dist/core/session/in-memory-session.d.ts.map +1 -0
  362. package/dist/core/session/in-memory-session.js +11 -0
  363. package/dist/core/session/in-memory-session.js.map +1 -0
  364. package/dist/core/session/jsonl-errors.d.ts +36 -0
  365. package/dist/core/session/jsonl-errors.d.ts.map +1 -0
  366. package/dist/core/session/jsonl-errors.js +49 -0
  367. package/dist/core/session/jsonl-errors.js.map +1 -0
  368. package/dist/core/session/jsonl-helpers.d.ts +20 -0
  369. package/dist/core/session/jsonl-helpers.d.ts.map +1 -0
  370. package/dist/core/session/jsonl-helpers.js +21 -0
  371. package/dist/core/session/jsonl-helpers.js.map +1 -0
  372. package/dist/core/session/local-session-manager.d.ts +30 -0
  373. package/dist/core/session/local-session-manager.d.ts.map +1 -0
  374. package/dist/core/session/local-session-manager.js +205 -0
  375. package/dist/core/session/local-session-manager.js.map +1 -0
  376. package/dist/core/session/local-session.d.ts +9 -0
  377. package/dist/core/session/local-session.d.ts.map +1 -0
  378. package/dist/core/session/local-session.js +15 -0
  379. package/dist/core/session/local-session.js.map +1 -0
  380. package/dist/core/session/migrations.d.ts +11 -0
  381. package/dist/core/session/migrations.d.ts.map +1 -0
  382. package/dist/core/session/migrations.js +78 -0
  383. package/dist/core/session/migrations.js.map +1 -0
  384. package/dist/core/session/remote-session-client.d.ts +83 -0
  385. package/dist/core/session/remote-session-client.d.ts.map +1 -0
  386. package/dist/core/session/remote-session-client.js +224 -0
  387. package/dist/core/session/remote-session-client.js.map +1 -0
  388. package/dist/core/session/remote-session-manager.d.ts +32 -0
  389. package/dist/core/session/remote-session-manager.d.ts.map +1 -0
  390. package/dist/core/session/remote-session-manager.js +124 -0
  391. package/dist/core/session/remote-session-manager.js.map +1 -0
  392. package/dist/core/session/remote-session.d.ts +20 -0
  393. package/dist/core/session/remote-session.d.ts.map +1 -0
  394. package/dist/core/session/remote-session.js +33 -0
  395. package/dist/core/session/remote-session.js.map +1 -0
  396. package/dist/core/session/session-manager.d.ts +18 -0
  397. package/dist/core/session/session-manager.d.ts.map +1 -0
  398. package/dist/core/session/session-manager.js +2 -0
  399. package/dist/core/session/session-manager.js.map +1 -0
  400. package/dist/core/session/session.d.ts +140 -0
  401. package/dist/core/session/session.d.ts.map +1 -0
  402. package/dist/core/session/session.js +461 -0
  403. package/dist/core/session/session.js.map +1 -0
  404. package/dist/core/session/stores/in-memory-session-store.d.ts +39 -0
  405. package/dist/core/session/stores/in-memory-session-store.d.ts.map +1 -0
  406. package/dist/core/session/stores/in-memory-session-store.js +168 -0
  407. package/dist/core/session/stores/in-memory-session-store.js.map +1 -0
  408. package/dist/core/session/stores/jsonl-session-store.d.ts +97 -0
  409. package/dist/core/session/stores/jsonl-session-store.d.ts.map +1 -0
  410. package/dist/core/session/stores/jsonl-session-store.js +1140 -0
  411. package/dist/core/session/stores/jsonl-session-store.js.map +1 -0
  412. package/dist/core/session/stores/remote-session-store.d.ts +44 -0
  413. package/dist/core/session/stores/remote-session-store.d.ts.map +1 -0
  414. package/dist/core/session/stores/remote-session-store.js +159 -0
  415. package/dist/core/session/stores/remote-session-store.js.map +1 -0
  416. package/dist/core/session/stores/session-store.d.ts +42 -0
  417. package/dist/core/session/stores/session-store.d.ts.map +1 -0
  418. package/dist/core/session/stores/session-store.js +2 -0
  419. package/dist/core/session/stores/session-store.js.map +1 -0
  420. package/dist/core/session/types.d.ts +141 -0
  421. package/dist/core/session/types.d.ts.map +1 -0
  422. package/dist/core/session/types.js +2 -0
  423. package/dist/core/session/types.js.map +1 -0
  424. package/dist/core/session/usage-ledger.d.ts +18 -0
  425. package/dist/core/session/usage-ledger.d.ts.map +1 -0
  426. package/dist/core/session/usage-ledger.js +68 -0
  427. package/dist/core/session/usage-ledger.js.map +1 -0
  428. package/dist/core/session-cwd.d.ts +19 -0
  429. package/dist/core/session-cwd.d.ts.map +1 -0
  430. package/dist/core/session-cwd.js +38 -0
  431. package/dist/core/session-cwd.js.map +1 -0
  432. package/dist/core/settings-manager.d.ts +314 -0
  433. package/dist/core/settings-manager.d.ts.map +1 -0
  434. package/dist/core/settings-manager.js +991 -0
  435. package/dist/core/settings-manager.js.map +1 -0
  436. package/dist/core/skills.d.ts +40 -0
  437. package/dist/core/skills.d.ts.map +1 -0
  438. package/dist/core/skills.js +57 -0
  439. package/dist/core/skills.js.map +1 -0
  440. package/dist/core/slash-commands.d.ts +15 -0
  441. package/dist/core/slash-commands.d.ts.map +1 -0
  442. package/dist/core/slash-commands.js +36 -0
  443. package/dist/core/slash-commands.js.map +1 -0
  444. package/dist/core/source-info.d.ts +26 -0
  445. package/dist/core/source-info.d.ts.map +1 -0
  446. package/dist/core/source-info.js +27 -0
  447. package/dist/core/source-info.js.map +1 -0
  448. package/dist/core/system-prompt.d.ts +32 -0
  449. package/dist/core/system-prompt.d.ts.map +1 -0
  450. package/dist/core/system-prompt.js +131 -0
  451. package/dist/core/system-prompt.js.map +1 -0
  452. package/dist/core/telemetry.d.ts +3 -0
  453. package/dist/core/telemetry.d.ts.map +1 -0
  454. package/dist/core/telemetry.js +9 -0
  455. package/dist/core/telemetry.js.map +1 -0
  456. package/dist/core/timings.d.ts +10 -0
  457. package/dist/core/timings.d.ts.map +1 -0
  458. package/dist/core/timings.js +41 -0
  459. package/dist/core/timings.js.map +1 -0
  460. package/dist/core/tools/bash.d.ts +51 -0
  461. package/dist/core/tools/bash.d.ts.map +1 -0
  462. package/dist/core/tools/bash.js +321 -0
  463. package/dist/core/tools/bash.js.map +1 -0
  464. package/dist/core/tools/compress-context.d.ts +27 -0
  465. package/dist/core/tools/compress-context.d.ts.map +1 -0
  466. package/dist/core/tools/compress-context.js +142 -0
  467. package/dist/core/tools/compress-context.js.map +1 -0
  468. package/dist/core/tools/edit-diff.d.ts +82 -0
  469. package/dist/core/tools/edit-diff.d.ts.map +1 -0
  470. package/dist/core/tools/edit-diff.js +327 -0
  471. package/dist/core/tools/edit-diff.js.map +1 -0
  472. package/dist/core/tools/edit.d.ts +50 -0
  473. package/dist/core/tools/edit.d.ts.map +1 -0
  474. package/dist/core/tools/edit.js +324 -0
  475. package/dist/core/tools/edit.js.map +1 -0
  476. package/dist/core/tools/file-mutation-queue.d.ts +8 -0
  477. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  478. package/dist/core/tools/file-mutation-queue.js +69 -0
  479. package/dist/core/tools/file-mutation-queue.js.map +1 -0
  480. package/dist/core/tools/find.d.ts +22 -0
  481. package/dist/core/tools/find.d.ts.map +1 -0
  482. package/dist/core/tools/find.js +268 -0
  483. package/dist/core/tools/find.js.map +1 -0
  484. package/dist/core/tools/grep.d.ts +27 -0
  485. package/dist/core/tools/grep.d.ts.map +1 -0
  486. package/dist/core/tools/grep.js +332 -0
  487. package/dist/core/tools/grep.js.map +1 -0
  488. package/dist/core/tools/hash-store.d.ts +12 -0
  489. package/dist/core/tools/hash-store.d.ts.map +1 -0
  490. package/dist/core/tools/hash-store.js +48 -0
  491. package/dist/core/tools/hash-store.js.map +1 -0
  492. package/dist/core/tools/hashline/apply.d.ts +40 -0
  493. package/dist/core/tools/hashline/apply.d.ts.map +1 -0
  494. package/dist/core/tools/hashline/apply.js +261 -0
  495. package/dist/core/tools/hashline/apply.js.map +1 -0
  496. package/dist/core/tools/hashline/hash.d.ts +56 -0
  497. package/dist/core/tools/hashline/hash.d.ts.map +1 -0
  498. package/dist/core/tools/hashline/hash.js +196 -0
  499. package/dist/core/tools/hashline/hash.js.map +1 -0
  500. package/dist/core/tools/hashline/parse.d.ts +8 -0
  501. package/dist/core/tools/hashline/parse.d.ts.map +1 -0
  502. package/dist/core/tools/hashline/parse.js +41 -0
  503. package/dist/core/tools/hashline/parse.js.map +1 -0
  504. package/dist/core/tools/hashline/resolve.d.ts +51 -0
  505. package/dist/core/tools/hashline/resolve.d.ts.map +1 -0
  506. package/dist/core/tools/hashline/resolve.js +187 -0
  507. package/dist/core/tools/hashline/resolve.js.map +1 -0
  508. package/dist/core/tools/hashline-utils.d.ts +6 -0
  509. package/dist/core/tools/hashline-utils.d.ts.map +1 -0
  510. package/dist/core/tools/hashline-utils.js +23 -0
  511. package/dist/core/tools/hashline-utils.js.map +1 -0
  512. package/dist/core/tools/index.d.ts +36 -0
  513. package/dist/core/tools/index.d.ts.map +1 -0
  514. package/dist/core/tools/index.js +141 -0
  515. package/dist/core/tools/index.js.map +1 -0
  516. package/dist/core/tools/ls.d.ts +21 -0
  517. package/dist/core/tools/ls.d.ts.map +1 -0
  518. package/dist/core/tools/ls.js +156 -0
  519. package/dist/core/tools/ls.js.map +1 -0
  520. package/dist/core/tools/operations.d.ts +212 -0
  521. package/dist/core/tools/operations.d.ts.map +1 -0
  522. package/dist/core/tools/operations.js +793 -0
  523. package/dist/core/tools/operations.js.map +1 -0
  524. package/dist/core/tools/output-accumulator.d.ts +54 -0
  525. package/dist/core/tools/output-accumulator.d.ts.map +1 -0
  526. package/dist/core/tools/output-accumulator.js +184 -0
  527. package/dist/core/tools/output-accumulator.js.map +1 -0
  528. package/dist/core/tools/path-utils.d.ts +9 -0
  529. package/dist/core/tools/path-utils.d.ts.map +1 -0
  530. package/dist/core/tools/path-utils.js +99 -0
  531. package/dist/core/tools/path-utils.js.map +1 -0
  532. package/dist/core/tools/read.d.ts +32 -0
  533. package/dist/core/tools/read.d.ts.map +1 -0
  534. package/dist/core/tools/read.js +318 -0
  535. package/dist/core/tools/read.js.map +1 -0
  536. package/dist/core/tools/render-utils.d.ts +33 -0
  537. package/dist/core/tools/render-utils.d.ts.map +1 -0
  538. package/dist/core/tools/render-utils.js +61 -0
  539. package/dist/core/tools/render-utils.js.map +1 -0
  540. package/dist/core/tools/replace-diff.d.ts +16 -0
  541. package/dist/core/tools/replace-diff.d.ts.map +1 -0
  542. package/dist/core/tools/replace-diff.js +117 -0
  543. package/dist/core/tools/replace-diff.js.map +1 -0
  544. package/dist/core/tools/replace-normalize.d.ts +2 -0
  545. package/dist/core/tools/replace-normalize.d.ts.map +1 -0
  546. package/dist/core/tools/replace-normalize.js +73 -0
  547. package/dist/core/tools/replace-normalize.js.map +1 -0
  548. package/dist/core/tools/replace-render.d.ts +51 -0
  549. package/dist/core/tools/replace-render.d.ts.map +1 -0
  550. package/dist/core/tools/replace-render.js +162 -0
  551. package/dist/core/tools/replace-render.js.map +1 -0
  552. package/dist/core/tools/runtime.d.ts +2 -0
  553. package/dist/core/tools/runtime.d.ts.map +1 -0
  554. package/dist/core/tools/runtime.js +6 -0
  555. package/dist/core/tools/runtime.js.map +1 -0
  556. package/dist/core/tools/session-history.d.ts +55 -0
  557. package/dist/core/tools/session-history.d.ts.map +1 -0
  558. package/dist/core/tools/session-history.js +649 -0
  559. package/dist/core/tools/session-history.js.map +1 -0
  560. package/dist/core/tools/subagent-agents.d.ts +29 -0
  561. package/dist/core/tools/subagent-agents.d.ts.map +1 -0
  562. package/dist/core/tools/subagent-agents.js +223 -0
  563. package/dist/core/tools/subagent-agents.js.map +1 -0
  564. package/dist/core/tools/subagent.d.ts +185 -0
  565. package/dist/core/tools/subagent.d.ts.map +1 -0
  566. package/dist/core/tools/subagent.js +1309 -0
  567. package/dist/core/tools/subagent.js.map +1 -0
  568. package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
  569. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  570. package/dist/core/tools/tool-definition-wrapper.js +34 -0
  571. package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  572. package/dist/core/tools/truncate.d.ts +39 -0
  573. package/dist/core/tools/truncate.d.ts.map +1 -0
  574. package/dist/core/tools/truncate.js +215 -0
  575. package/dist/core/tools/truncate.js.map +1 -0
  576. package/dist/core/tools/websearch.d.ts +33 -0
  577. package/dist/core/tools/websearch.d.ts.map +1 -0
  578. package/dist/core/tools/websearch.js +341 -0
  579. package/dist/core/tools/websearch.js.map +1 -0
  580. package/dist/core/tools/workspace-tool-host.d.ts +102 -0
  581. package/dist/core/tools/workspace-tool-host.d.ts.map +1 -0
  582. package/dist/core/tools/workspace-tool-host.js +348 -0
  583. package/dist/core/tools/workspace-tool-host.js.map +1 -0
  584. package/dist/core/tools/write.d.ts +16 -0
  585. package/dist/core/tools/write.d.ts.map +1 -0
  586. package/dist/core/tools/write.js +204 -0
  587. package/dist/core/tools/write.js.map +1 -0
  588. package/dist/core/workspace-identity.d.ts +7 -0
  589. package/dist/core/workspace-identity.d.ts.map +1 -0
  590. package/dist/core/workspace-identity.js +2 -0
  591. package/dist/core/workspace-identity.js.map +1 -0
  592. package/dist/daemon/activity-budget.d.ts +10 -0
  593. package/dist/daemon/activity-budget.d.ts.map +1 -0
  594. package/dist/daemon/activity-budget.js +34 -0
  595. package/dist/daemon/activity-budget.js.map +1 -0
  596. package/dist/daemon/command.d.ts +6 -0
  597. package/dist/daemon/command.d.ts.map +1 -0
  598. package/dist/daemon/command.js +58 -0
  599. package/dist/daemon/command.js.map +1 -0
  600. package/dist/daemon/config.d.ts +45 -0
  601. package/dist/daemon/config.d.ts.map +1 -0
  602. package/dist/daemon/config.js +319 -0
  603. package/dist/daemon/config.js.map +1 -0
  604. package/dist/daemon/help.d.ts +2 -0
  605. package/dist/daemon/help.d.ts.map +1 -0
  606. package/dist/daemon/help.js +42 -0
  607. package/dist/daemon/help.js.map +1 -0
  608. package/dist/daemon/lsp-config.d.ts +4 -0
  609. package/dist/daemon/lsp-config.d.ts.map +1 -0
  610. package/dist/daemon/lsp-config.js +155 -0
  611. package/dist/daemon/lsp-config.js.map +1 -0
  612. package/dist/daemon/outbound-budget.d.ts +10 -0
  613. package/dist/daemon/outbound-budget.d.ts.map +1 -0
  614. package/dist/daemon/outbound-budget.js +30 -0
  615. package/dist/daemon/outbound-budget.js.map +1 -0
  616. package/dist/daemon/security.d.ts +19 -0
  617. package/dist/daemon/security.d.ts.map +1 -0
  618. package/dist/daemon/security.js +177 -0
  619. package/dist/daemon/security.js.map +1 -0
  620. package/dist/daemon/server.d.ts +20 -0
  621. package/dist/daemon/server.d.ts.map +1 -0
  622. package/dist/daemon/server.js +480 -0
  623. package/dist/daemon/server.js.map +1 -0
  624. package/dist/daemon/shared-connection.d.ts +33 -0
  625. package/dist/daemon/shared-connection.d.ts.map +1 -0
  626. package/dist/daemon/shared-connection.js +271 -0
  627. package/dist/daemon/shared-connection.js.map +1 -0
  628. package/dist/daemon/shared-revision.d.ts +5 -0
  629. package/dist/daemon/shared-revision.d.ts.map +1 -0
  630. package/dist/daemon/shared-revision.js +61 -0
  631. package/dist/daemon/shared-revision.js.map +1 -0
  632. package/dist/daemon/shared-roots.d.ts +9 -0
  633. package/dist/daemon/shared-roots.d.ts.map +1 -0
  634. package/dist/daemon/shared-roots.js +33 -0
  635. package/dist/daemon/shared-roots.js.map +1 -0
  636. package/dist/daemon/workspace-runtime.d.ts +46 -0
  637. package/dist/daemon/workspace-runtime.d.ts.map +1 -0
  638. package/dist/daemon/workspace-runtime.js +705 -0
  639. package/dist/daemon/workspace-runtime.js.map +1 -0
  640. package/dist/index.d.ts +109 -0
  641. package/dist/index.d.ts.map +1 -0
  642. package/dist/index.js +107 -0
  643. package/dist/index.js.map +1 -0
  644. package/dist/main.d.ts +39 -0
  645. package/dist/main.d.ts.map +1 -0
  646. package/dist/main.js +765 -0
  647. package/dist/main.js.map +1 -0
  648. package/dist/migrations.d.ts +35 -0
  649. package/dist/migrations.d.ts.map +1 -0
  650. package/dist/migrations.js +412 -0
  651. package/dist/migrations.js.map +1 -0
  652. package/dist/modes/interactive/components/assistant-message.d.ts +30 -0
  653. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  654. package/dist/modes/interactive/components/assistant-message.js +159 -0
  655. package/dist/modes/interactive/components/assistant-message.js.map +1 -0
  656. package/dist/modes/interactive/components/bash-execution.d.ts +36 -0
  657. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  658. package/dist/modes/interactive/components/bash-execution.js +173 -0
  659. package/dist/modes/interactive/components/bash-execution.js.map +1 -0
  660. package/dist/modes/interactive/components/bordered-loader.d.ts +18 -0
  661. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  662. package/dist/modes/interactive/components/bordered-loader.js +54 -0
  663. package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  664. package/dist/modes/interactive/components/branch-summary-message.d.ts +17 -0
  665. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  666. package/dist/modes/interactive/components/branch-summary-message.js +45 -0
  667. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  668. package/dist/modes/interactive/components/compaction-summary-message.d.ts +17 -0
  669. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  670. package/dist/modes/interactive/components/compaction-summary-message.js +46 -0
  671. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  672. package/dist/modes/interactive/components/config-selector.d.ts +74 -0
  673. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  674. package/dist/modes/interactive/components/config-selector.js +514 -0
  675. package/dist/modes/interactive/components/config-selector.js.map +1 -0
  676. package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  677. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  678. package/dist/modes/interactive/components/countdown-timer.js +33 -0
  679. package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  680. package/dist/modes/interactive/components/custom-editor.d.ts +25 -0
  681. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  682. package/dist/modes/interactive/components/custom-editor.js +85 -0
  683. package/dist/modes/interactive/components/custom-editor.js.map +1 -0
  684. package/dist/modes/interactive/components/custom-message.d.ts +20 -0
  685. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  686. package/dist/modes/interactive/components/custom-message.js +81 -0
  687. package/dist/modes/interactive/components/custom-message.js.map +1 -0
  688. package/dist/modes/interactive/components/diff.d.ts +12 -0
  689. package/dist/modes/interactive/components/diff.d.ts.map +1 -0
  690. package/dist/modes/interactive/components/diff.js +118 -0
  691. package/dist/modes/interactive/components/diff.js.map +1 -0
  692. package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  693. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  694. package/dist/modes/interactive/components/dynamic-border.js +21 -0
  695. package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  696. package/dist/modes/interactive/components/extension-editor.d.ts +22 -0
  697. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  698. package/dist/modes/interactive/components/extension-editor.js +128 -0
  699. package/dist/modes/interactive/components/extension-editor.js.map +1 -0
  700. package/dist/modes/interactive/components/extension-input.d.ts +23 -0
  701. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  702. package/dist/modes/interactive/components/extension-input.js +61 -0
  703. package/dist/modes/interactive/components/extension-input.js.map +1 -0
  704. package/dist/modes/interactive/components/extension-selector.d.ts +26 -0
  705. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  706. package/dist/modes/interactive/components/extension-selector.js +83 -0
  707. package/dist/modes/interactive/components/extension-selector.js.map +1 -0
  708. package/dist/modes/interactive/components/footer.d.ts +36 -0
  709. package/dist/modes/interactive/components/footer.d.ts.map +1 -0
  710. package/dist/modes/interactive/components/footer.js +227 -0
  711. package/dist/modes/interactive/components/footer.js.map +1 -0
  712. package/dist/modes/interactive/components/hook-execution.d.ts +19 -0
  713. package/dist/modes/interactive/components/hook-execution.d.ts.map +1 -0
  714. package/dist/modes/interactive/components/hook-execution.js +185 -0
  715. package/dist/modes/interactive/components/hook-execution.js.map +1 -0
  716. package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
  717. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  718. package/dist/modes/interactive/components/keybinding-hints.js +36 -0
  719. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  720. package/dist/modes/interactive/components/login-dialog.d.ts +55 -0
  721. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  722. package/dist/modes/interactive/components/login-dialog.js +176 -0
  723. package/dist/modes/interactive/components/login-dialog.js.map +1 -0
  724. package/dist/modes/interactive/components/markdown-transform.d.ts +4 -0
  725. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
  726. package/dist/modes/interactive/components/markdown-transform.js +19 -0
  727. package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
  728. package/dist/modes/interactive/components/mermaid.d.ts +14 -0
  729. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
  730. package/dist/modes/interactive/components/mermaid.js +228 -0
  731. package/dist/modes/interactive/components/mermaid.js.map +1 -0
  732. package/dist/modes/interactive/components/message-card.d.ts +9 -0
  733. package/dist/modes/interactive/components/message-card.d.ts.map +1 -0
  734. package/dist/modes/interactive/components/message-card.js +24 -0
  735. package/dist/modes/interactive/components/message-card.js.map +1 -0
  736. package/dist/modes/interactive/components/model-selector.d.ts +52 -0
  737. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  738. package/dist/modes/interactive/components/model-selector.js +296 -0
  739. package/dist/modes/interactive/components/model-selector.js.map +1 -0
  740. package/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
  741. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  742. package/dist/modes/interactive/components/oauth-selector.js +165 -0
  743. package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  744. package/dist/modes/interactive/components/scoped-models-selector.d.ts +50 -0
  745. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  746. package/dist/modes/interactive/components/scoped-models-selector.js +300 -0
  747. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  748. package/dist/modes/interactive/components/session-selector-search.d.ts +22 -0
  749. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  750. package/dist/modes/interactive/components/session-selector-search.js +144 -0
  751. package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  752. package/dist/modes/interactive/components/session-selector.d.ts +108 -0
  753. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  754. package/dist/modes/interactive/components/session-selector.js +835 -0
  755. package/dist/modes/interactive/components/session-selector.js.map +1 -0
  756. package/dist/modes/interactive/components/settings-selector.d.ts +81 -0
  757. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  758. package/dist/modes/interactive/components/settings-selector.js +455 -0
  759. package/dist/modes/interactive/components/settings-selector.js.map +1 -0
  760. package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  761. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  762. package/dist/modes/interactive/components/show-images-selector.js +39 -0
  763. package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  764. package/dist/modes/interactive/components/skill-invocation-message.d.ts +18 -0
  765. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  766. package/dist/modes/interactive/components/skill-invocation-message.js +48 -0
  767. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  768. package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  769. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  770. package/dist/modes/interactive/components/theme-selector.js +50 -0
  771. package/dist/modes/interactive/components/theme-selector.js.map +1 -0
  772. package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  773. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  774. package/dist/modes/interactive/components/thinking-selector.js +51 -0
  775. package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  776. package/dist/modes/interactive/components/tool-execution.d.ts +67 -0
  777. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  778. package/dist/modes/interactive/components/tool-execution.js +312 -0
  779. package/dist/modes/interactive/components/tool-execution.js.map +1 -0
  780. package/dist/modes/interactive/components/tree-selector.d.ts +127 -0
  781. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  782. package/dist/modes/interactive/components/tree-selector.js +1098 -0
  783. package/dist/modes/interactive/components/tree-selector.js.map +1 -0
  784. package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  785. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  786. package/dist/modes/interactive/components/user-message-selector.js +114 -0
  787. package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  788. package/dist/modes/interactive/components/user-message.d.ts +16 -0
  789. package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  790. package/dist/modes/interactive/components/user-message.js +50 -0
  791. package/dist/modes/interactive/components/user-message.js.map +1 -0
  792. package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  793. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  794. package/dist/modes/interactive/components/visual-truncate.js +33 -0
  795. package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  796. package/dist/modes/interactive/interactive-mode.d.ts +554 -0
  797. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  798. package/dist/modes/interactive/interactive-mode.js +5870 -0
  799. package/dist/modes/interactive/interactive-mode.js.map +1 -0
  800. package/dist/modes/interactive/theme/dark.json +86 -0
  801. package/dist/modes/interactive/theme/light.json +85 -0
  802. package/dist/modes/interactive/theme/theme-schema.json +335 -0
  803. package/dist/modes/interactive/theme/theme.d.ts +109 -0
  804. package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  805. package/dist/modes/interactive/theme/theme.js +1040 -0
  806. package/dist/modes/interactive/theme/theme.js.map +1 -0
  807. package/dist/modes/json-event.d.ts +28 -0
  808. package/dist/modes/json-event.d.ts.map +1 -0
  809. package/dist/modes/json-event.js +12 -0
  810. package/dist/modes/json-event.js.map +1 -0
  811. package/dist/modes/print-mode.d.ts +29 -0
  812. package/dist/modes/print-mode.d.ts.map +1 -0
  813. package/dist/modes/print-mode.js +142 -0
  814. package/dist/modes/print-mode.js.map +1 -0
  815. package/dist/modes/rpc/jsonl.d.ts +17 -0
  816. package/dist/modes/rpc/jsonl.d.ts.map +1 -0
  817. package/dist/modes/rpc/jsonl.js +49 -0
  818. package/dist/modes/rpc/jsonl.js.map +1 -0
  819. package/dist/modes/rpc/rpc-client.d.ts +321 -0
  820. package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  821. package/dist/modes/rpc/rpc-client.js +755 -0
  822. package/dist/modes/rpc/rpc-client.js.map +1 -0
  823. package/dist/modes/rpc/rpc-mode.d.ts +20 -0
  824. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  825. package/dist/modes/rpc/rpc-mode.js +963 -0
  826. package/dist/modes/rpc/rpc-mode.js.map +1 -0
  827. package/dist/modes/rpc/rpc-types.d.ts +652 -0
  828. package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  829. package/dist/modes/rpc/rpc-types.js +8 -0
  830. package/dist/modes/rpc/rpc-types.js.map +1 -0
  831. package/dist/package-manager-cli.d.ts +4 -0
  832. package/dist/package-manager-cli.d.ts.map +1 -0
  833. package/dist/package-manager-cli.js +488 -0
  834. package/dist/package-manager-cli.js.map +1 -0
  835. package/dist/utils/ansi.d.ts +2 -0
  836. package/dist/utils/ansi.d.ts.map +1 -0
  837. package/dist/utils/ansi.js +25 -0
  838. package/dist/utils/ansi.js.map +1 -0
  839. package/dist/utils/changelog.d.ts +23 -0
  840. package/dist/utils/changelog.d.ts.map +1 -0
  841. package/dist/utils/changelog.js +74 -0
  842. package/dist/utils/changelog.js.map +1 -0
  843. package/dist/utils/child-process.d.ts +15 -0
  844. package/dist/utils/child-process.d.ts.map +1 -0
  845. package/dist/utils/child-process.js +88 -0
  846. package/dist/utils/child-process.js.map +1 -0
  847. package/dist/utils/clipboard-image.d.ts +13 -0
  848. package/dist/utils/clipboard-image.d.ts.map +1 -0
  849. package/dist/utils/clipboard-image.js +248 -0
  850. package/dist/utils/clipboard-image.js.map +1 -0
  851. package/dist/utils/clipboard-native.d.ts +11 -0
  852. package/dist/utils/clipboard-native.d.ts.map +1 -0
  853. package/dist/utils/clipboard-native.js +20 -0
  854. package/dist/utils/clipboard-native.js.map +1 -0
  855. package/dist/utils/clipboard.d.ts +4 -0
  856. package/dist/utils/clipboard.d.ts.map +1 -0
  857. package/dist/utils/clipboard.js +171 -0
  858. package/dist/utils/clipboard.js.map +1 -0
  859. package/dist/utils/deprecation.d.ts +4 -0
  860. package/dist/utils/deprecation.d.ts.map +1 -0
  861. package/dist/utils/deprecation.js +13 -0
  862. package/dist/utils/deprecation.js.map +1 -0
  863. package/dist/utils/directory-completions.d.ts +5 -0
  864. package/dist/utils/directory-completions.d.ts.map +1 -0
  865. package/dist/utils/directory-completions.js +64 -0
  866. package/dist/utils/directory-completions.js.map +1 -0
  867. package/dist/utils/exif-orientation.d.ts +6 -0
  868. package/dist/utils/exif-orientation.d.ts.map +1 -0
  869. package/dist/utils/exif-orientation.js +166 -0
  870. package/dist/utils/exif-orientation.js.map +1 -0
  871. package/dist/utils/frontmatter.d.ts +8 -0
  872. package/dist/utils/frontmatter.d.ts.map +1 -0
  873. package/dist/utils/frontmatter.js +26 -0
  874. package/dist/utils/frontmatter.js.map +1 -0
  875. package/dist/utils/fs-watch.d.ts +5 -0
  876. package/dist/utils/fs-watch.d.ts.map +1 -0
  877. package/dist/utils/fs-watch.js +25 -0
  878. package/dist/utils/fs-watch.js.map +1 -0
  879. package/dist/utils/git.d.ts +27 -0
  880. package/dist/utils/git.d.ts.map +1 -0
  881. package/dist/utils/git.js +237 -0
  882. package/dist/utils/git.js.map +1 -0
  883. package/dist/utils/grip-user-agent.d.ts +2 -0
  884. package/dist/utils/grip-user-agent.d.ts.map +1 -0
  885. package/dist/utils/grip-user-agent.js +5 -0
  886. package/dist/utils/grip-user-agent.js.map +1 -0
  887. package/dist/utils/html.d.ts +7 -0
  888. package/dist/utils/html.d.ts.map +1 -0
  889. package/dist/utils/html.js +40 -0
  890. package/dist/utils/html.js.map +1 -0
  891. package/dist/utils/image-convert.d.ts +12 -0
  892. package/dist/utils/image-convert.d.ts.map +1 -0
  893. package/dist/utils/image-convert.js +43 -0
  894. package/dist/utils/image-convert.js.map +1 -0
  895. package/dist/utils/image-process.d.ts +18 -0
  896. package/dist/utils/image-process.d.ts.map +1 -0
  897. package/dist/utils/image-process.js +83 -0
  898. package/dist/utils/image-process.js.map +1 -0
  899. package/dist/utils/image-resize-core.d.ts +30 -0
  900. package/dist/utils/image-resize-core.d.ts.map +1 -0
  901. package/dist/utils/image-resize-core.js +133 -0
  902. package/dist/utils/image-resize-core.js.map +1 -0
  903. package/dist/utils/image-resize-worker.d.ts +2 -0
  904. package/dist/utils/image-resize-worker.d.ts.map +1 -0
  905. package/dist/utils/image-resize-worker.js +31 -0
  906. package/dist/utils/image-resize-worker.js.map +1 -0
  907. package/dist/utils/image-resize.d.ts +19 -0
  908. package/dist/utils/image-resize.d.ts.map +1 -0
  909. package/dist/utils/image-resize.js +86 -0
  910. package/dist/utils/image-resize.js.map +1 -0
  911. package/dist/utils/json.d.ts +3 -0
  912. package/dist/utils/json.d.ts.map +1 -0
  913. package/dist/utils/json.js +7 -0
  914. package/dist/utils/json.js.map +1 -0
  915. package/dist/utils/mime.d.ts +3 -0
  916. package/dist/utils/mime.d.ts.map +1 -0
  917. package/dist/utils/mime.js +110 -0
  918. package/dist/utils/mime.js.map +1 -0
  919. package/dist/utils/open-browser.d.ts +9 -0
  920. package/dist/utils/open-browser.d.ts.map +1 -0
  921. package/dist/utils/open-browser.js +22 -0
  922. package/dist/utils/open-browser.js.map +1 -0
  923. package/dist/utils/paths.d.ts +31 -0
  924. package/dist/utils/paths.d.ts.map +1 -0
  925. package/dist/utils/paths.js +87 -0
  926. package/dist/utils/paths.js.map +1 -0
  927. package/dist/utils/photon.d.ts +22 -0
  928. package/dist/utils/photon.d.ts.map +1 -0
  929. package/dist/utils/photon.js +126 -0
  930. package/dist/utils/photon.js.map +1 -0
  931. package/dist/utils/shell.d.ts +28 -0
  932. package/dist/utils/shell.d.ts.map +1 -0
  933. package/dist/utils/shell.js +188 -0
  934. package/dist/utils/shell.js.map +1 -0
  935. package/dist/utils/sleep.d.ts +5 -0
  936. package/dist/utils/sleep.d.ts.map +1 -0
  937. package/dist/utils/sleep.js +17 -0
  938. package/dist/utils/sleep.js.map +1 -0
  939. package/dist/utils/syntax-highlight.d.ts +12 -0
  940. package/dist/utils/syntax-highlight.d.ts.map +1 -0
  941. package/dist/utils/syntax-highlight.js +125 -0
  942. package/dist/utils/syntax-highlight.js.map +1 -0
  943. package/dist/utils/tools-manager.d.ts +5 -0
  944. package/dist/utils/tools-manager.d.ts.map +1 -0
  945. package/dist/utils/tools-manager.js +329 -0
  946. package/dist/utils/tools-manager.js.map +1 -0
  947. package/dist/utils/version-check.d.ts +14 -0
  948. package/dist/utils/version-check.d.ts.map +1 -0
  949. package/dist/utils/version-check.js +91 -0
  950. package/dist/utils/version-check.js.map +1 -0
  951. package/dist/utils/windows-self-update.d.ts +3 -0
  952. package/dist/utils/windows-self-update.d.ts.map +1 -0
  953. package/dist/utils/windows-self-update.js +77 -0
  954. package/dist/utils/windows-self-update.js.map +1 -0
  955. package/docs/compaction.md +408 -0
  956. package/docs/custom-provider.md +714 -0
  957. package/docs/daemon-architecture.md +399 -0
  958. package/docs/daemon.md +112 -0
  959. package/docs/development.md +72 -0
  960. package/docs/docs.json +164 -0
  961. package/docs/extensions.md +2745 -0
  962. package/docs/hooks.md +85 -0
  963. package/docs/images/doom-extension.png +0 -0
  964. package/docs/images/exy.png +0 -0
  965. package/docs/images/interactive-mode.png +0 -0
  966. package/docs/images/tree-view.png +0 -0
  967. package/docs/index.md +77 -0
  968. package/docs/json.md +89 -0
  969. package/docs/keybindings.md +230 -0
  970. package/docs/lsp.md +499 -0
  971. package/docs/migrating-to-grip.md +18 -0
  972. package/docs/models.md +496 -0
  973. package/docs/packages.md +228 -0
  974. package/docs/prompt-templates.md +88 -0
  975. package/docs/providers.md +251 -0
  976. package/docs/quickstart.md +159 -0
  977. package/docs/rpc.md +1492 -0
  978. package/docs/rules.md +117 -0
  979. package/docs/sandbox.md +104 -0
  980. package/docs/sdk.md +360 -0
  981. package/docs/session-format.md +414 -0
  982. package/docs/sessions.md +137 -0
  983. package/docs/settings.md +372 -0
  984. package/docs/shell-aliases.md +13 -0
  985. package/docs/skills.md +246 -0
  986. package/docs/terminal-setup.md +112 -0
  987. package/docs/termux.md +112 -0
  988. package/docs/themes.md +295 -0
  989. package/docs/tmux.md +61 -0
  990. package/docs/tui.md +918 -0
  991. package/docs/usage.md +304 -0
  992. package/docs/windows.md +17 -0
  993. package/examples/README.md +29 -0
  994. package/examples/daemon-docker/Dockerfile +43 -0
  995. package/examples/daemon-docker/README.md +45 -0
  996. package/examples/extensions/README.md +208 -0
  997. package/examples/extensions/auto-commit-on-exit.ts +46 -0
  998. package/examples/extensions/bash-spawn-hook.ts +30 -0
  999. package/examples/extensions/bookmark.ts +50 -0
  1000. package/examples/extensions/border-status-editor.ts +145 -0
  1001. package/examples/extensions/built-in-tool-renderer.ts +259 -0
  1002. package/examples/extensions/claude-rules.ts +86 -0
  1003. package/examples/extensions/commands.ts +82 -0
  1004. package/examples/extensions/confirm-destructive.ts +59 -0
  1005. package/examples/extensions/custom-compaction.ts +131 -0
  1006. package/examples/extensions/custom-footer.ts +79 -0
  1007. package/examples/extensions/custom-header.ts +73 -0
  1008. package/examples/extensions/custom-provider-anthropic/index.ts +707 -0
  1009. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  1010. package/examples/extensions/custom-provider-anthropic/package.json +19 -0
  1011. package/examples/extensions/custom-provider-gitlab-duo/index.ts +402 -0
  1012. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  1013. package/examples/extensions/custom-provider-gitlab-duo/test.ts +104 -0
  1014. package/examples/extensions/dirty-repo-guard.ts +59 -0
  1015. package/examples/extensions/doom-overlay/README.md +46 -0
  1016. package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
  1017. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  1018. package/examples/extensions/doom-overlay/doom/build.sh +152 -0
  1019. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  1020. package/examples/extensions/doom-overlay/doom-component.ts +133 -0
  1021. package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  1022. package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
  1023. package/examples/extensions/doom-overlay/index.ts +74 -0
  1024. package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
  1025. package/examples/extensions/dynamic-resources/RULES.md +8 -0
  1026. package/examples/extensions/dynamic-resources/SKILL.md +8 -0
  1027. package/examples/extensions/dynamic-resources/dynamic.json +79 -0
  1028. package/examples/extensions/dynamic-resources/dynamic.md +5 -0
  1029. package/examples/extensions/dynamic-resources/index.ts +16 -0
  1030. package/examples/extensions/dynamic-tools.ts +74 -0
  1031. package/examples/extensions/event-bus.ts +43 -0
  1032. package/examples/extensions/file-trigger.ts +41 -0
  1033. package/examples/extensions/git-checkpoint.ts +53 -0
  1034. package/examples/extensions/git-merge-and-resolve.ts +125 -0
  1035. package/examples/extensions/github-issue-autocomplete.ts +191 -0
  1036. package/examples/extensions/handoff.ts +191 -0
  1037. package/examples/extensions/hello.ts +26 -0
  1038. package/examples/extensions/hidden-thinking-label.ts +53 -0
  1039. package/examples/extensions/inline-bash.ts +104 -0
  1040. package/examples/extensions/input-transform.ts +43 -0
  1041. package/examples/extensions/interactive-shell.ts +194 -0
  1042. package/examples/extensions/mac-system-theme.ts +47 -0
  1043. package/examples/extensions/message-renderer.ts +59 -0
  1044. package/examples/extensions/minimal-mode.ts +428 -0
  1045. package/examples/extensions/modal-editor.ts +86 -0
  1046. package/examples/extensions/model-status.ts +31 -0
  1047. package/examples/extensions/notify.ts +55 -0
  1048. package/examples/extensions/overlay-qa-tests.ts +1374 -0
  1049. package/examples/extensions/overlay-test.ts +171 -0
  1050. package/examples/extensions/permission-gate.ts +34 -0
  1051. package/examples/extensions/pirate.ts +47 -0
  1052. package/examples/extensions/plan-mode/README.md +65 -0
  1053. package/examples/extensions/plan-mode/index.ts +346 -0
  1054. package/examples/extensions/plan-mode/utils.ts +172 -0
  1055. package/examples/extensions/preset.ts +426 -0
  1056. package/examples/extensions/prompt-customizer.ts +97 -0
  1057. package/examples/extensions/protected-paths.ts +29 -0
  1058. package/examples/extensions/provider-payload.ts +18 -0
  1059. package/examples/extensions/qna.ts +125 -0
  1060. package/examples/extensions/question.ts +294 -0
  1061. package/examples/extensions/questionnaire.ts +459 -0
  1062. package/examples/extensions/rainbow-editor.ts +88 -0
  1063. package/examples/extensions/reload-runtime.ts +37 -0
  1064. package/examples/extensions/rpc-demo.ts +118 -0
  1065. package/examples/extensions/sandbox/index.ts +320 -0
  1066. package/examples/extensions/sandbox/package-lock.json +92 -0
  1067. package/examples/extensions/sandbox/package.json +19 -0
  1068. package/examples/extensions/send-user-message.ts +97 -0
  1069. package/examples/extensions/session-name.ts +27 -0
  1070. package/examples/extensions/shutdown-command.ts +63 -0
  1071. package/examples/extensions/snake.ts +381 -0
  1072. package/examples/extensions/space-invaders.ts +597 -0
  1073. package/examples/extensions/status-line.ts +32 -0
  1074. package/examples/extensions/structured-output.ts +65 -0
  1075. package/examples/extensions/subagent/README.md +175 -0
  1076. package/examples/extensions/subagent/agents/planner.md +37 -0
  1077. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  1078. package/examples/extensions/subagent/agents/scout.md +50 -0
  1079. package/examples/extensions/subagent/agents/worker.md +24 -0
  1080. package/examples/extensions/subagent/agents.ts +126 -0
  1081. package/examples/extensions/subagent/index.ts +1083 -0
  1082. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  1083. package/examples/extensions/subagent/prompts/implement.md +10 -0
  1084. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  1085. package/examples/extensions/summarize.ts +186 -0
  1086. package/examples/extensions/system-prompt-header.ts +17 -0
  1087. package/examples/extensions/tic-tac-toe.ts +1091 -0
  1088. package/examples/extensions/timed-confirm.ts +70 -0
  1089. package/examples/extensions/titlebar-spinner.ts +58 -0
  1090. package/examples/extensions/todo.ts +306 -0
  1091. package/examples/extensions/tool-override.ts +144 -0
  1092. package/examples/extensions/tools.ts +141 -0
  1093. package/examples/extensions/trigger-compact.ts +50 -0
  1094. package/examples/extensions/truncated-tool.ts +200 -0
  1095. package/examples/extensions/widget-placement.ts +9 -0
  1096. package/examples/extensions/with-deps/index.ts +32 -0
  1097. package/examples/extensions/with-deps/package-lock.json +31 -0
  1098. package/examples/extensions/with-deps/package.json +22 -0
  1099. package/examples/extensions/working-indicator.ts +123 -0
  1100. package/examples/extensions/working-message-test.ts +25 -0
  1101. package/examples/remote-session-server/README.md +71 -0
  1102. package/examples/remote-session-server/server.ts +353 -0
  1103. package/examples/rpc-extension-ui.ts +642 -0
  1104. package/examples/sdk/01-minimal.ts +27 -0
  1105. package/examples/sdk/02-custom-model.ts +54 -0
  1106. package/examples/sdk/03-custom-prompt.ts +76 -0
  1107. package/examples/sdk/04-skills.ts +60 -0
  1108. package/examples/sdk/05-tools.ts +55 -0
  1109. package/examples/sdk/06-extensions.ts +94 -0
  1110. package/examples/sdk/07-context-files.ts +47 -0
  1111. package/examples/sdk/08-prompt-templates.ts +56 -0
  1112. package/examples/sdk/09-api-keys-and-oauth.ts +50 -0
  1113. package/examples/sdk/10-settings.ts +58 -0
  1114. package/examples/sdk/11-sessions.ts +54 -0
  1115. package/examples/sdk/12-full-control.ts +79 -0
  1116. package/examples/sdk/13-session-runtime.ts +49 -0
  1117. package/examples/sdk/README.md +94 -0
  1118. package/npm-shrinkwrap.json +1878 -0
  1119. package/package.json +101 -5
@@ -0,0 +1,399 @@
1
+ # ADR: Integrated remote workspace daemon
2
+
3
+ - Status: Historical design record (implemented in Grip; current usage is documented in [daemon.md](daemon.md))
4
+ - Date: 2026-07-20
5
+ - Original scope: the former coding-agent and daemon packages and their remote workspace protocol
6
+
7
+ > This records the pre-Grip architecture and migration decision. References below to upstream names, commands, package identifiers, and `PiAgent` describe that historical design; use `grip --daemon`, `@greppleai/grip`, and `GripAgent` for current integrations.
8
+
9
+ ## Context
10
+
11
+ Pi currently has two independently shaped remote-runtime halves:
12
+
13
+ - the normal `pi` process owns the agent loop and creates canonical built-in tool definitions around `ToolOperations`;
14
+ - the retired standalone Pi daemon package is a side-effect executable with a separate WebSocket parser and separate implementations of shell, filesystem, search, MIME, and file-transfer primitives.
15
+
16
+ This split keeps provider credentials and the LLM loop local, but it duplicates behavior and prevents the remote runtime from executing canonical Pi tools. The current daemon also advertises a working directory without confining filesystem paths or shell commands to it.
17
+
18
+ The current implementation is an explicitly rejected security baseline, not an acceptable transitional deployment: it can expose unauthenticated shell execution on non-loopback binds, accepts arbitrary host paths, inherits the full process environment, allows query tokens, performs destructive partial uploads, and has no graceful process shutdown. The existing unauthenticated `0.0.0.0` Docker example must not be used once work begins; the replacement Docker target cannot ship until it satisfies this ADR.
19
+
20
+ The separate package will be replaced by an early-dispatched `pi --daemon` command. This is an execution topology change, not a new agent presentation mode.
21
+
22
+ ## Decision
23
+
24
+ A normal Pi process is the **orchestrator**. A `pi --daemon` process is a **workspace runtime**. They communicate through one validated, versioned remote-workspace protocol.
25
+
26
+ The workspace runtime hosts a reusable canonical `WorkspaceToolHost`. The same host is composed into local `AgentSession` instances. The daemon does not construct `PiAgent`, `AgentSession`, an `Agent`, a model registry, auth storage, a session store, compaction state, or a user interface.
27
+
28
+ `pi --daemon` is dispatched before migrations and before normal CLI/runtime initialization. It is not added to `PiAgentAppMode`, `Mode`, or `PiAgent.runMode()`.
29
+
30
+ ### Process topology
31
+
32
+ ```text
33
+ user / RPC host
34
+ |
35
+ v
36
+ normal pi (orchestrator)
37
+ provider auth and calls
38
+ LLM/agent loop
39
+ conversation and session persistence
40
+ prompt/resource assembly
41
+ local policy extensions and tool lifecycle events
42
+ |
43
+ | authenticated, versioned remote-workspace protocol
44
+ v
45
+ pi --daemon (one workspace runtime)
46
+ canonical workspace tool host
47
+ workspace filesystem and subprocesses
48
+ transfer endpoints
49
+ remote project resource I/O
50
+ colocated LSP runtime
51
+ ```
52
+
53
+ ## Responsibility matrix
54
+
55
+ | Concern | Orchestrating Pi | Remote `pi --daemon` | Wire boundary |
56
+ |---|---|---|---|
57
+ | Provider authentication and OAuth | Sole owner | Forbidden; provider stores are never opened | None |
58
+ | Provider/LLM requests | Sole owner | Forbidden | None |
59
+ | Agent loop and tool-call scheduling | Sole owner | Executes one requested tool invocation; never schedules an LLM turn | Invocation, update, result, cancellation |
60
+ | Conversation messages | Sole owner | Forbidden except opaque tool arguments/results needed for one invocation | Tool arguments/results only |
61
+ | Session creation, lookup, persistence, branching, and labels | Sole owner | Forbidden | None |
62
+ | Compaction, retry, steering, and follow-ups | Sole owner | Forbidden | None |
63
+ | System-prompt assembly | Sole owner | Forbidden | Resource catalog/content returned to orchestrator |
64
+ | User and package instructions, skills, rules, and prompts | Loads locally | Never discovers or executes them | None |
65
+ | Project context files, skills, rules, prompts, and subagent presets | Owns remote traversal/parsing, trust, precedence, collision handling, diagnostics, and prompt/preset inclusion through a remote operations adapter | Owns confined stat/list/read I/O only; it does not parse or cache prompt resources | Validated primitive workspace operations with workspace provenance |
66
+ | User/package/project Pi extensions | Loads locally under existing trust rules | Not loaded in the initial daemon surface | Local extension tools may call the active remote operations adapter |
67
+ | Local extension `tool_call`/`tool_result` policy | Sole owner; wraps the remote invocation exactly once | Does not replay AgentSession lifecycle hooks | Invocation/result only |
68
+ | Built-in `read`, `bash`, `edit`, `write`, `grep`, `find`, and `ls` | Owns active-tool policy, model-facing local definitions after catalog hash verification, argument preparation, and local rendering | Validates normalized arguments and executes the canonical shared definitions through `WorkspaceToolHost` | Catalog, invocation, updates, canonical result |
69
+ | Primitive `ToolOperations` for resources and backend-aware extensions | Exposes the existing interface to local loaders/extensions; mutation calls use the same daemon-global file queue | Provides confined access/read/write/mkdir/stat/readdir/glob/grep and optional exec/transfer capabilities without exposing them as model tools | Validated operation requests/results/cancellation |
70
+ | `load_tool` and `unload_tool` | Sole owner because they mutate orchestrator context | Forbidden | None |
71
+ | `subagent` | Sole owner; child LLM sessions and project-preset trust remain local and borrow the PiAgent-owned remote client | Forbidden; no daemon-side model calls | Child tool invocations use the same workspace protocol |
72
+ | Custom SDK/extension tools | Execute locally unless their implementation uses `ctx.toolOperations` or `ctx.execToolBackend` | Not auto-loaded or advertised | Backend-aware calls use primitive workspace capabilities and global mutation serialization |
73
+ | LSP configuration and trust | For a remote backend, suppresses the local manager and consumes the daemon catalog/status; it cannot reconfigure daemon LSP | Operator-owned daemon-global configuration and trust; starts/attaches servers, synchronizes documents, executes `lsp_*`, reports status, and shuts down owned servers | Catalog, LSP tool invocation, status; no client trust grant |
74
+ | LSP for local workspaces | Owns the existing AgentSession runtime | None | None |
75
+ | File upload/download | Selects local source/destination and authorizes the operation | Streams only confined remote paths and performs atomic destination publication | Bounded chunks, SHA-256/length, cancellation, terminal result |
76
+ | Interactive, JSON, print, and RPC UI | Sole owner | Forbidden | None |
77
+ | User-facing tool lifecycle events | Sole owner and emits one coherent lifecycle | Emits protocol progress only | Progress is translated into local events |
78
+ | Remote client lifecycle | `PiAgent` owns one client/deferred holder; AgentSessions and subagents borrow it and never dispose it | Owns each accepted connection and its per-connection work | Handshake, catalog refresh, close |
79
+ | Workspace tool-host lifecycle | Holds a negotiated immutable catalog view | Owns daemon-global host/LSP generations and daemon-side resources | Handshake, generation change, shutdown |
80
+ | Process signals and server readiness | PiAgent/CLI closes its owned client on final disposal | Owns listener, connections, subprocess trees, managed LSP, and readiness log | Connection close and structured shutdown errors |
81
+ | Telemetry and update checks | Normal Pi policy | Disabled in daemon mode | None |
82
+
83
+ ## Workspace and process security
84
+
85
+ ### Threat model
86
+
87
+ The daemon is an authenticated remote-code-execution service. A valid daemon credential grants the ability to use every advertised workspace capability. The application-level path policy reduces accidental and protocol-level filesystem escape, but it is not an operating-system sandbox.
88
+
89
+ If process execution is enabled, a shell command can read or modify anything accessible to the daemon OS user regardless of Pi path checks. Strong isolation therefore requires a dedicated unprivileged user, container, VM, or equivalent platform sandbox. Documentation must not describe the workspace root as a complete sandbox.
90
+
91
+ Malicious unauthenticated network clients, malformed protocol input, slow readers, disconnected clients, and an untrusted remote repository are in scope. A malicious process already running as the daemon OS user and filesystem time-of-check/time-of-use races caused by such a process are outside the application-layer confinement guarantee.
92
+
93
+ ### Workspace root
94
+
95
+ One daemon process serves exactly one configured workspace root. The root is resolved to an absolute canonical path before listening. Startup fails if it does not exist or is not a directory.
96
+
97
+ All filesystem, resource, transfer, temporary-output, LSP document, marker-discovery, and subprocess-working-directory paths are interpreted in the daemon path flavor and checked against that root:
98
+
99
+ 1. relative paths resolve against the workspace root;
100
+ 2. absolute paths are accepted only when they remain inside the root;
101
+ 3. lexical `..` escape is rejected;
102
+ 4. existing path components are resolved through `realpath`; a symlink target outside the root is rejected;
103
+ 5. for a new destination, the nearest existing ancestor is resolved and must remain inside the root;
104
+ 6. mutation operations recheck the resolved parent immediately before publication;
105
+ 7. transfer destinations use a same-directory temporary file and atomic rename; cancellation and failure remove the temporary file;
106
+ 8. no initial `--allow-host-paths` bypass is provided.
107
+
108
+ Path comparisons are path-flavor aware. Windows roots compare case-insensitively while preserving spelling; POSIX roots compare case-sensitively. UNC authority/share roots are treated as Windows roots. Prefix matching must use path components, not raw string prefixes.
109
+
110
+ ### Arbitrary process execution
111
+
112
+ `bash` (the canonical shell tool despite its name on non-Bash platforms) is a distinct unsafe capability.
113
+
114
+ - Remote process execution requires explicit daemon startup opt-in (`--daemon-allow-process-exec` or its dedicated environment equivalent).
115
+ - Without opt-in, `bash` is absent from the negotiated tool catalog and raw process execution is unavailable.
116
+ - The requested process cwd must pass workspace confinement, but commands themselves are not parsed or sandboxed.
117
+ - Children run as the daemon OS user. The daemon does not elevate privileges or implement setuid.
118
+ - Startup as root is refused unless an explicit `--daemon-allow-root` override is supplied.
119
+ - Child environments are deny-by-default. The base contains only `PATH`, `HOME`, `USER`, `LOGNAME`, `SHELL`, `TMPDIR`, `TEMP`, `TMP`, `LANG`, `LC_*`, `TERM`, `COLORTERM`, `NO_COLOR`, and, on Windows, `SystemRoot`, `ComSpec`, and `PATHEXT`. Names are matched case-insensitively on Windows.
120
+ - Operators may copy additional startup variables by repeated `--daemon-env <NAME>` or a validated dedicated environment list. Invocation-supplied environment overrides are rejected in the initial protocol. After base, operator, and LSP environments are merged, a final non-bypassable filter removes names case-insensitively if they are `GRIP_DAEMON_TOKEN`, `GRIP_REMOTE_TOKEN`, a configured TLS private-key/passphrase variable, begin with `GRIP_DAEMON_TLS_`, or end in `_API_KEY`, `_TOKEN`, `_SECRET`, `_PASSWORD`, `_PRIVATE_KEY`, or `_CREDENTIALS`. Thus a base-looking name such as `LC_API_KEY` is still removed. LSP-specific values come only from trusted daemon LSP configuration and pass the same final filter.
121
+ - Every child is placed in an owned process tree/group where supported. Cancellation, connection loss, deadline, daemon host reload, and shutdown terminate the complete owned tree with a bounded graceful-then-force sequence.
122
+
123
+ A deployment needing arbitrary host access must choose that through OS privileges and process-exec opt-in; the protocol does not add an unrestricted path mode.
124
+
125
+ ### External command dependencies
126
+
127
+ Daemon startup does not require `fd`, `rg`, or `file`. Canonical tools use the same dependency discovery/fallback behavior as local Pi. A missing optional executable makes only the affected tool unavailable or produces its canonical actionable error; it does not crash the server. Availability is reflected in the negotiated catalog. Shell availability is checked when process execution is enabled.
128
+
129
+ ### WorkspaceToolHost configuration and invocation
130
+
131
+ `WorkspaceToolHost` has an explicit immutable construction contract: canonical workspace root/cwd, a confined `ToolOperations`, tool availability, image handling, shell executable, optional LSP runtime, optional local-only read-operation resolver, artifact store, and bounded disposal. It does not read `SettingsManager` itself.
132
+
133
+ For a local AgentSession, Pi maps local settings into host options and may provide the existing read resolver for user/package resources. For a daemon, the operator chooses the shell executable and LSP settings; the read resolver is absent so the host cannot reach orchestrator resources. Presentation metadata, active-tool selection, renderers, and prompt snippets remain local.
134
+
135
+ Connection-scoped execution options that already affect canonical behavior, currently image auto-resize and shell command prefix, are carried in the invocation envelope, not global daemon state. The local proxy applies `prepareArguments` exactly once before its normal schema validation and sends `argumentsPrepared: true`. The daemon verifies the exact catalog/schema hash, requires `argumentsPrepared: true`, validates the normalized arguments again against the same schema, and invokes a host path that does not rerun `prepareArguments`. The daemon applies the invocation envelope exactly once. Non-agent protocol clients must use the shared proxy library rather than constructing raw prepared requests.
136
+
137
+ The daemon catalog is authoritative for availability. It contains stable tool name, execution mode, canonical parameter schema, schema hash, and feature flags. The orchestrator exposes only tools for which it has the same compiled canonical definition and exact schema hash; it uses that local definition for the model schema and renderer. Capability changes remove or add whole tools (`bash`, `lsp_*`) but do not mutate their schemas. The initial protocol does not synthesize model tools from arbitrary remote schemas.
138
+
139
+ ## Network, authentication, and credential policy
140
+
141
+ ### Bind and TLS
142
+
143
+ - Default bind: `127.0.0.1` on the configured port.
144
+ - Loopback may run without a token for local development, but browser-originated upgrades are still rejected by default.
145
+ - A non-loopback bind requires authentication.
146
+ - A non-loopback bind also requires native TLS configuration unless the operator supplies an explicit `--daemon-allow-insecure-transport` acknowledgement for a trusted private network or an explicitly documented reverse-proxy deployment.
147
+ - Forwarded headers are not trusted by default and do not silently satisfy the TLS requirement.
148
+ - Native TLS key material is read only by daemon startup and is never included in child environments, logs, protocol messages, backend status, or diagnostics.
149
+
150
+ The WebSocket upgrade endpoint is exactly `/pi/workspace` with no URL user information or query parameters. Other HTTP requests and upgrade targets are rejected. Upgrade, Connection, WebSocket version, subprotocol, and key headers are validated.
151
+
152
+ ### Authentication and Origin
153
+
154
+ - New clients authenticate with `Authorization: Bearer <token>`.
155
+ - Query-string tokens and URL user information are rejected. They are not retained for compatibility because URLs are rendered in diagnostics, RPC state, shell history, and proxy logs.
156
+ - A configured token must encode 32–1024 UTF-8 bytes, contain at least one non-whitespace byte, and pass startup validation. Authentication hashes both presented and configured token bytes with SHA-256, compares the fixed-size digests with `timingSafeEqual`, and separately requires the original byte lengths to match; no truncation, prefix, or normalized-length acceptance is allowed.
157
+ - Missing `Origin` is accepted for non-browser clients.
158
+ - Any present `Origin` is rejected unless it exactly matches an explicit daemon origin allowlist. Wildcard origins are not supported.
159
+ - Authentication is performed before allocating a full connection runtime.
160
+ - Authentication failures use generic responses and never reveal whether a token prefix was correct.
161
+
162
+ Server and client credentials are separate inputs. `GRIP_DAEMON_TOKEN` configures the server's expected token. `GRIP_REMOTE_TOKEN` supplies the orchestrator client's default token and is never forwarded into daemon child environments. The shared client constructor changes to `createRemoteToolOperations({ url, token })`; string-only construction is removed. Direct `--remote`, interactive `/sandbox --attach`, and the default RPC/SDK paths resolve `GRIP_REMOTE_TOKEN` unless their typed API supplies a token explicitly. RPC `set_remote_sandbox` gains an optional write-only `token` field; SDK/deferred configuration gains an optional `token`; neither value is returned by status APIs. Interactive commands do not accept a token argument, avoiding editor/session history leakage. A missing token against an authenticated daemon fails with an actionable message naming `GRIP_REMOTE_TOKEN` or the typed host API, never the token value.
163
+
164
+ Tokens and URLs containing user information or sensitive query keys are redacted in all logs, thrown errors, diagnostics, interactive status, RPC state, and snapshots. The client API stores credentials separately from the display URL. Protocol tracing is off by default and redacts authorization material when enabled.
165
+
166
+ ## Multi-client isolation
167
+
168
+ A daemon process is a single-workspace, single-trust-domain service, not a multi-tenant service.
169
+
170
+ - All authenticated clients can observe and mutate the same workspace.
171
+ - Deployments requiring tenant isolation must run separate daemon processes under separate OS identities/workspace roots/tokens.
172
+ - Request IDs and cancellation ownership are per connection. One client cannot cancel or complete another client's request.
173
+ - Tool-host mutation queues are daemon-global and keyed by confined canonical path so concurrent clients cannot bypass edit/write serialization.
174
+ - Active-call, transfer, byte, output, and outbound-queue limits apply both per connection and globally.
175
+ - No conversation, active-tool selection, project-resource trust decision, LSP trust decision, or session state is accepted from or stored on behalf of a connection.
176
+ - Core tool-host and LSP configuration generations are daemon-global and operator-controlled. Every authenticated client sees the same catalog. Connection close never changes the global configuration.
177
+ - A catalog/reload generation is immutable. Stateless filesystem tool calls already acquired from a retired generation may finish; service/process-backed calls are cancelled before their old dependencies are disposed. A retired generation is disposed after its drain/cancel rule or the shutdown deadline.
178
+
179
+ ## Daemon-safe tool and extension surface
180
+
181
+ The initial daemon tool surface is deliberately narrower than `AgentSession`:
182
+
183
+ - canonical workspace tools: `read`, `edit`, `write`, `grep`, `find`, and `ls`;
184
+ - canonical `bash` only when process execution is explicitly enabled;
185
+ - `lsp_*` tools only when the daemon owns an enabled validated LSP runtime;
186
+ - resource discovery/read and file transfer as non-model protocol capabilities.
187
+
188
+ The daemon does not initially load arbitrary Pi extensions. In particular it does not expose or fake:
189
+
190
+ - `AgentSession`, `Session`, conversation messages, session entries, or compaction;
191
+ - models, providers, auth storage, provider request hooks, or model selection;
192
+ - `ctx.ui`, commands, shortcuts, themes, editor state, or user-facing notifications;
193
+ - `sendMessage`, `sendUserMessage`, steering/follow-ups, shutdown of the orchestrator, or session replacement;
194
+ - user/package extension discovery;
195
+ - `load_tool`, `unload_tool`, or `subagent`.
196
+
197
+ A future daemon extension API, if implemented, must be a separately named opt-in workspace-tool contract containing only catalog registration, confined workspace operations, logging, cancellation, and bounded host lifecycle. It must not reuse `ExtensionContext` with unavailable fields. Project-origin executable extensions require an explicit trust grant from the authenticated orchestrator and an explicit daemon enablement flag. Absence of this future API is the accepted initial behavior.
198
+
199
+ Local extensions continue to run in the orchestrator. Their tool-call and tool-result hooks wrap remote calls once. Extension tools that directly use local Node APIs remain local by definition. Backend-aware tools keep the complete operation surface through a remote primitive adapter: access/read/write/mkdir/stat/readdir/glob/grep, `detectImageMimeType`, optional process exec, transfer, cancellation, backend info, and owner-only awaited disposal. `ToolOperations` evolves so every asynchronous method accepts an optional trailing operation-options object containing `signal`; canonical tools, resource loaders, and extensions propagate it.
200
+
201
+ Borrowers never receive the owning object's `dispose`. `ctx.toolOperations`, resource loaders, AgentSessions, and subagents use a typed `BorrowedToolOperations = Omit<ToolOperations, "dispose">` facade. Only `PiAgent` or a standalone SDK caller holds the owning `ToolOperations` and may dispose it. The adapter is confined and validated server-side. Primitive writes and canonical edit/write calls enter the same daemon-global canonical-path mutation queue, so extensions cannot bypass cross-client serialization.
202
+
203
+ ## Project resources and prompt trust
204
+
205
+ The daemon exposes a confined primitive operations adapter, not a pre-parsed resource catalog. The orchestrator runs the existing resource loaders through that adapter and remains responsible for traversal, ignore-file reads, parsing/frontmatter validation, precedence, collisions, project trust, diagnostics, and prompt/preset inclusion. Stat, directory listing, and file reads are individually bounded and preserve daemon-native spelling; each response includes the immutable workspace identity used for provenance.
206
+
207
+ Remote ancestor discovery stops at the daemon workspace root. It never walks to the daemon filesystem root. Explicit remote resource paths outside the root fail with a source-attributed confinement diagnostic. Within the root, existing traversal order, `.gitignore`/resource ignore behavior, and `.pi`/`.agents` precedence are preserved. This intentional ancestor boundary is included in migration guidance.
208
+
209
+ Remote project resources and project-local subagent presets keep project/remote provenance and never masquerade as user resources. Project subagent preset parsing and trust confirmation remain in the orchestrator. The authenticated workspace identity, path flavor, and canonical root are included in provenance diagnostics without credentials. Resource content is treated as untrusted instructions under the same project trust policy as a local checkout.
210
+
211
+ `/reload`, session replacement, and deferred backend changes are initiated by the orchestrator. Ordinary `/reload` explicitly fetches the current catalog and reruns resource traversal; it does not reconfigure the daemon. An operator triggers daemon reload with SIGHUP or the importable server's `reload()` handle. The daemon validates a complete replacement host/LSP generation, publishes it atomically, then sends an ordered `catalog_changed` event containing the new generation and catalog hash to every handshaken connection.
212
+
213
+ Every catalog-dependent invocation carries the client's expected generation. After `catalog_changed`, the client pauses new catalog-dependent calls, fetches/verifies the new catalog, atomically swaps proxy definitions, and resumes. A request carrying an old generation is rejected before admission as `stale_generation`/`not_started`; the client may refresh and retry that request once, including a mutation, because the server proves it never began. Acquired stateless filesystem calls may finish on the old generation; `bash` and `lsp_*` calls tied to retired process/service state are cancelled with `generation_retired` using the execution-state rules below before dependencies are disposed. Failed replacement retains the last published generation and emits no change event.
214
+
215
+ The daemon never sends unsolicited prompt text or mutates the orchestrator session. Files remain a mutable workspace, so multi-call resource traversal has the same possible concurrent-change behavior as local traversal; each operation is internally consistent and bounded, but the protocol does not promise a filesystem snapshot.
216
+
217
+ ## LSP ownership
218
+
219
+ For a remote workspace, LSP processes/endpoints and document synchronization are colocated with and owned by the daemon. The orchestrator suppresses its local `LspManager` for remote files and consumes only the daemon's negotiated `lsp_*` catalog and status.
220
+
221
+ LSP configuration and trust are daemon-global operator policy, never connection-scoped. Sources are limited to an explicit daemon CLI configuration (`--daemon-lsp-config`) and an optional project layer under the confined workspace enabled by `--daemon-trust-project-lsp`. The daemon does not load orchestrator global settings or accept per-client LSP reconfiguration. Project configuration cannot grant trust to itself. All relative paths and attached endpoints are interpreted in the daemon filesystem/network namespace. Host-provided orchestrator `connection` factories are unsupported; an equivalent endpoint/factory must be configured in the daemon process. Ordinary colocated servers need no agent/daemon path mapping; explicit mappings remain available only for an attached server in a different daemon-side namespace.
222
+
223
+ Any managed/spawn LSP transport additionally requires `--daemon-allow-process-exec`; `--daemon-trust-project-lsp` is not an implicit process-execution grant. Attached transports require project-LSP trust because they receive document content but do not require process-exec. Managed LSP children use the same final environment filter, owned process-tree tracking, startup/request deadlines, output bounds, reload cancellation, and graceful/forced shutdown policy as other daemon children.
224
+
225
+ Every authenticated client observes the same daemon-global LSP tools/status. A client disconnect does not start, stop, grant, or revoke LSP. Managed children stop on operator reload or daemon shutdown. Attached transports receive protocol/disconnect shutdown according to configured ownership and never receive OS signals. On reload, in-flight old-generation `lsp_*` requests are cancelled with `generation_retired` before the old manager is disposed. LSP status, diagnostics, tool availability, cancellation, and errors cross the protocol as workspace data; prompt and session effects remain local.
226
+
227
+ ## File transfer
228
+
229
+ File transfer is a protocol capability rather than a model tool.
230
+
231
+ - Remote source/destination paths use the confinement policy. An upload acquires the daemon-global canonical-path mutation queue at upload start and holds it through verification, atomic publication, or cleanup, serializing against canonical edit/write and primitive write/mkdir operations.
232
+ - Chunks, total bytes, concurrent transfers, duration, idle time, and transfer-ID tombstones are bounded.
233
+ - Upload start declares exact byte length, mandatory SHA-256 digest encoded as 64 lowercase hexadecimal characters, and explicit `overwrite` (default `false`). Reusing an active or tombstoned transfer ID is rejected.
234
+ - The daemon writes a random same-directory temporary file with mode `0o600`, verifies length and digest, then atomically publishes it. A new destination receives mode `0o666 & ~umask`; overwriting preserves the existing regular file's mode. Directory/symlink/device destinations and unsupported ownership/time metadata are rejected.
235
+ - Downloads return declared length and SHA-256 before chunks and repeat verified length/digest in the terminal result. The client verifies both before publishing its local destination.
236
+ - Cancellation, disconnect, checksum failure, duplicate ID, or shutdown removes partial files and closes streams.
237
+ - Backpressure is awaited through the connection's single outbound queue.
238
+ - Local destination publication/cleanup is symmetric and remains the orchestrator client's responsibility.
239
+
240
+ ### Full-output artifacts
241
+
242
+ Large canonical tool outputs are stored in a bounded daemon artifact store, not returned as host temporary paths. Remote results use `fullOutputPath: "pi-artifact://<workspace-id>/<artifact-id>"`. The remote `read` proxy and download capability recognize that URI, verify the authenticated workspace ID, and stream the artifact; filesystem tools and shell cwd do not treat it as a real path. Artifact IDs are random and connection-independent within the same single trust domain. Artifacts have configured per-file/global byte limits and TTL, are mode `0o600`, are removed on expiry or daemon shutdown, and never participate in project resource discovery. Local WorkspaceToolHost execution retains its existing local temporary-file behavior; the shared result contract permits either a local path or a `pi-artifact` URI.
243
+
244
+ ## Protocol contract and rollout
245
+
246
+ The remote-workspace protocol is private and versioned independently from provider/RPC protocols. It has one authoritative TypeScript schema/validator module used by client and server.
247
+
248
+ The first message is a handshake containing protocol major/minor range and client capabilities. The server returns the selected version, immutable workspace identity/root/path flavor, catalog generation, feature limits, tool catalog/schema hashes, and authentication-safe backend metadata. No tool/resource/transfer request is accepted before a successful handshake.
249
+
250
+ Compatibility and schema-authority rules:
251
+
252
+ - major versions must match;
253
+ - a minor version is selected only from the intersection advertised by both peers;
254
+ - optional behavior is used only after explicit capability negotiation;
255
+ - the daemon catalog is authoritative for availability, while exact schema hashes prove the client's compiled canonical definitions are identical;
256
+ - unknown required capabilities, missing versions, schema-hash mismatch, or an empty version intersection fail closed before execution;
257
+ - invocation IDs are unique per connection and cannot be reused while active or during a bounded tombstone period;
258
+ - cancellation, timeout, disconnect, and late results have explicit terminal states and never trigger automatic replay of a mutating tool;
259
+ - reconnect creates a new connection and generation negotiation; in-flight mutating calls are reported `indeterminate` rather than retried.
260
+
261
+ Wire text is decoded with a fatal UTF-8 decoder. Framing violations close with WebSocket protocol error; invalid UTF-8 closes with invalid-payload status; frame/message/structural-limit violations close with message-too-large or policy status. After JSON parsing, validators enforce maximum nesting depth, object-key count, array length, string length, and total decoded size. Request schemas reject unknown fields. A syntactically valid request with an identifiable unused ID but invalid fields receives one structured `invalid_request` terminal error; three such strikes close the connection. Unknown methods receive `method_not_supported` without consuming an execution slot. Messages without a usable ID, duplicate/tombstoned IDs, and pre-handshake requests fail and close.
262
+
263
+ Every terminal error includes `executionState: "not_started" | "completed" | "indeterminate"` and a stable code. The state describes externally visible side effects, not whether CPU work began. Validation, authorization, catalog, queue-admission, and stale-generation failures are `not_started`. All file-content mutations, including primitive write, canonical edit/write, and upload, use temporary-file plus atomic-publication semantics: failure before publication is `not_started`, and confirmed publication is `completed`. A non-recursive mkdir failure is `not_started` only when the daemon confirms no directory was created; success is `completed`. Recursive mkdir and any future non-atomic mutation become `indeterminate` after the first externally visible change if they later fail, cancel, time out, reload, disconnect, or shut down. After a shell or managed LSP child is spawned, those terminal paths are likewise `indeterminate` because child side effects cannot be rolled back. A transport loss during any potentially side-effecting operation is `indeterminate` unless the server has a confirmed pre-effect failure or committed result.
264
+
265
+ If a mutating operation completed but its result exceeds an absolute wire bound, the server sends a bounded `result_too_large` with `completed` and an artifact reference when possible; the client must not retry it. During graceful shutdown/reload the server queues terminal cancellation errors before close and drains them within the outbound deadline. If delivery cannot be confirmed, the client maps every admitted side-effecting request without a terminal message to `indeterminate`; read-only requests may fail without retry unless the caller explicitly starts a new request.
266
+
267
+ The current unversioned primitive pi-daemon protocol is not supported by `pi --daemon`, and the new client does not fall back to it. There is no rolling mixed-version guarantee for the initial migration.
268
+
269
+ ### Preserved user flows
270
+
271
+ The following orchestrator entry points remain supported, but use the new protocol:
272
+
273
+ - `grip --remote <url>`, with an optional client token from `GRIP_REMOTE_TOKEN` or the typed SDK host option;
274
+ - `grip --remote-deferred --remote-cwd <path>` followed by `/sandbox --attach ...`, using `GRIP_REMOTE_TOKEN` unless configured through the SDK;
275
+ - RPC `set_remote_sandbox` (including its write-only optional token), `upload_file`, and `download_file`;
276
+ - session replacement and subagents borrowing the PiAgent-owned remote workspace client.
277
+
278
+ The direct connection uses the canonical root returned by the handshake. In deferred mode, `--remote-cwd` is a required expected workspace root used before connection for stable provenance; configuration succeeds only if it equals the handshake root under daemon path-flavor comparison. It is never silently overwritten or treated as an arbitrary in-root cwd.
279
+
280
+ `PiAgent` is the concrete owner of a connected remote client or `DeferredRemoteToolOperations` holder. AgentSessions, replacement sessions, resource loaders, and subagent sessions borrow it and never call `dispose`. Session replacement preserves the owner and connection. A deferred holder owns whichever configured connection is current, awaits disposal before replacement/clear, and disposes a failed candidate. `PiAgent.dispose()` first stops and awaits borrowed sessions/subagents, then awaits final client disposal; CLI startup wraps ownership in `try/finally`.
281
+
282
+ Canonical tool output may change where the old daemon differed from local Pi; the target behavior is equivalence with local canonical tools, not compatibility with daemon bugs.
283
+
284
+ ### Intentionally breaking migration
285
+
286
+ - remove the standalone daemon workspace/package/export;
287
+ - remove the `pi-daemon` executable with no forwarding shim;
288
+ - replace launch commands with `pi --daemon`;
289
+ - reject the unversioned primitive wire protocol;
290
+ - reject query-string tokens;
291
+ - remove generic `HOST`/`PORT` aliases;
292
+ - remove unrestricted filesystem path behavior;
293
+ - require explicit process-execution opt-in;
294
+ - refuse root and insecure non-loopback operation without explicit overrides.
295
+
296
+ `GRIP_DAEMON_HOST`, `GRIP_DAEMON_PORT`, `GRIP_DAEMON_CWD`, `GRIP_DAEMON_TOKEN`, and the existing `GRIP_DAEMON_MAX_*` names are integrated server-command inputs with strict validation and the safer semantics in this ADR. `GRIP_REMOTE_TOKEN` is the distinct client default. Dedicated boolean/config inputs are added for process execution, root, insecure transport, origins, TLS files, environment allowlisting, and daemon LSP. Generic `HOST`/`PORT` aliases are removed.
297
+
298
+ ## Lifecycle, bounds, and shutdown
299
+
300
+ Configuration values are finite validated integers within documented ranges. The server bounds:
301
+
302
+ - pre-authentication sockets and handshake time;
303
+ - total/per-connection clients, active calls, uploads, and downloads;
304
+ - inbound frame/message size, fatal UTF-8 decoding, JSON nesting/key/array/string limits, and parser buffering;
305
+ - one per-connection outbound queue by messages and bytes;
306
+ - ordinary results, streaming updates, subprocess output, resource content, artifacts, and file-transfer chunks/total bytes;
307
+ - heartbeat/idle time, invocation time, transfer time, reload drain, and shutdown drain.
308
+
309
+ All writes, including ordinary results and errors, use the same per-connection outbound queue. Producers pause at a low-water threshold and their operation fails at a hard byte/message bound. Slow-client failure marks unfinished mutations `indeterminate`, cancels that client's active work, closes that connection, and cannot block other connections. Limit and parser errors follow the stable execution-state/error rules above; accounting slots and queued bytes are released exactly once.
310
+
311
+ On SIGINT/SIGTERM or explicit close:
312
+
313
+ 1. stop accepting HTTP upgrades;
314
+ 2. mark connections draining and reject new requests;
315
+ 3. cancel active tool/resource/transfer work;
316
+ 4. close upload/download streams and remove partial uploads;
317
+ 5. perform bounded graceful shutdown for managed workspace services and process trees;
318
+ 6. disconnect attached services without OS signals;
319
+ 7. force-kill remaining owned process trees after the grace period;
320
+ 8. close sockets and listener;
321
+ 9. resolve the close handle only after accounting and owned-resource cleanup complete.
322
+
323
+ A second termination signal may force the bounded cleanup deadline but still must not expose secrets in diagnostics.
324
+
325
+ ## Executable test plan
326
+
327
+ All tests use temporary directories, ephemeral loopback ports, faux tool definitions/connections, and fixture child processes. They must not require an installed language server, external endpoint, API key, provider call, or paid token.
328
+
329
+ | Decision | Planned focused coverage | Required assertions |
330
+ |---|---|---|
331
+ | Early command dispatch and startup isolation | `test/daemon-cli.test.ts` | `main(["--daemon", ...])` reaches daemon before migrations/settings/auth/PiAgent/session/UI, telemetry, update checks, or piped input; conflicting flags fail; imports have no side effects |
332
+ | Configuration, readiness, and optional dependencies | `test/daemon-cli.test.ts`, `test/workspace-tool-host.test.ts` | finite/range-checked env/CLI inputs; removed HOST/PORT aliases; redacted readiness emitted exactly once; missing fd/rg/file does not fail startup; affected catalog/error is actionable; enabled shell is preflighted |
333
+ | Responsibility boundary | `test/daemon-cli.test.ts`, `test/daemon-integration.test.ts` | no provider/model/session constructors; local agent loop emits one lifecycle; daemon receives only negotiated workspace requests |
334
+ | Host options and preparation | `test/workspace-tool-host.test.ts` | explicit host options; settings mapped only by owning process; `prepareArguments` runs locally once; daemon validates normalized arguments without rerunning preparation; prefix/image options apply once |
335
+ | Shared canonical host | `test/workspace-tool-host.test.ts` | local AgentSession and direct host catalogs/schemas/results match; truncation, mutation queues, cancellation, artifacts, and disposal match |
336
+ | Catalog/schema authority | `test/remote-workspace-protocol.test.ts` | daemon availability is authoritative; exact local schema hashes required; capability variants add/remove whole tools; unknown remote tools are not synthesized |
337
+ | Versioned and malformed-input validation | `test/remote-workspace-protocol.test.ts` | exact handshake; fatal UTF-8; depth/key/array/string/byte bounds; unknown fields; strike/close policy; version/schema/capability mismatch; duplicate/tombstoned IDs; late responses |
338
+ | Canonical remote tools | `test/daemon-integration.test.ts` | read/bash/edit/write/grep/find/ls updates and results match local fixtures; mutating calls are not replayed on disconnect |
339
+ | Primitive operations adapter | `test/daemon-integration.test.ts`, `test/extensions-runner.test.ts` | access/read/write/mkdir/stat/readdir/glob/grep/detectImageMimeType/optional exec/transfer; optional signal on every async call; non-owning borrower facade has no dispose; owner disposal awaited; validation/confinement; all mutations share one path queue |
340
+ | Path confinement | `test/daemon-security.test.ts` | relative/absolute in-root success; dot-dot, sibling-prefix, POSIX/Windows/UNC, existing symlink, new-path ancestor, transfer, artifact, LSP, and cwd escape rejection |
341
+ | Process-exec boundary and environment | `test/daemon-security.test.ts` | absent without opt-in; root refusal; confined cwd; exact cross-platform base/allowlist; final non-bypassable secret filtering including LC_API_KEY; invocation env rejection; timeout/abort/disconnect/reload/shutdown kill fixture process trees |
342
+ | Bind/auth/TLS/Origin | `test/daemon-security.test.ts` | loopback defaults; non-loopback auth/TLS requirement; explicit insecure override; fixed path/no query/header/version checks; token 32–1024-byte validation and digest+original-length comparison; bearer success; query/userinfo token and unlisted Origin rejection |
343
+ | Client credential flow | `test/main-remote.test.ts`, RPC and SDK focused tests | PI_DAEMON_TOKEN and PI_REMOTE_TOKEN remain distinct; typed token inputs work; interactive history/status/RPC never echoes token; missing-token diagnostic is actionable and redacted |
344
+ | Token redaction | `test/daemon-security.test.ts`, `test/main-remote.test.ts`, RPC focused test | no secret in readiness, URL display, diagnostics, errors, backend state, RPC responses, child env, or trace output |
345
+ | Multi-client isolation | `test/daemon-integration.test.ts` | per-connection IDs/cancellation; global file queue and operator catalog/LSP generation; per/global limits; no connection-scoped trust/state leakage; failure isolation |
346
+ | Outbound backpressure and execution-state errors | `test/daemon-transport.test.ts` | one bounded queue; low/hard water behavior; slow reader isolation; bounded completed/indeterminate errors; ordinary/stream results bounded; accounting released once |
347
+ | File transfer | `test/daemon-transfer.test.ts`, RPC focused test | mandatory lowercase SHA-256 and length; overwrite/mode policy; ID tombstones; upload holds global path queue against edit/write/mkdir; atomic publication; chunk/total/deadline bounds; cancellation/disconnect cleanup; symmetric local publication |
348
+ | Full-output artifacts | `test/workspace-tool-host.test.ts`, `test/daemon-integration.test.ts` | pi-artifact URI workspace authorization; read/download routing; byte/TTL bounds; no shell/resource traversal; expiry and shutdown cleanup |
349
+ | Project resources | `test/daemon-resources.test.ts` | primitive traversal preserves order/ignore/precedence inside root; ancestor stop and out-of-root diagnostics; provenance, collisions, malformed resources, trust, reload, backend change, no unsolicited prompt mutation |
350
+ | Extension boundary | `test/daemon-resources.test.ts`, `test/extensions-runner.test.ts` | local extensions/hooks run once; backend-aware full operations work remotely; user/package extensions never load remotely; unsupported daemon context APIs do not exist; direct Node APIs stay local |
351
+ | Colocated LSP | `test/daemon-lsp.test.ts` | operator-global CLI/project sources; project trust distinct from required process-exec grant; final env filter/process-tree/deadline/output rules; daemon path/network semantics; host-factory rejection; mapping migration; same catalog for clients; faux managed/attached lifecycle; no local duplicate |
352
+ | Subagent presets and runtime | `test/suite/agent-session-runtime.test.ts`, `test/daemon-resources.test.ts`, `test/daemon-integration.test.ts` | remote project presets traverse through primitive operations and are trusted locally; subagent LLM loop stays local; child sessions borrow the PiAgent client |
353
+ | Client ownership and remote cwd | `test/main-remote.test.ts`, `test/suite/agent-session-runtime.test.ts` | PiAgent owner versus BorrowedToolOperations facade; owner awaits disposal; sessions/subagents cannot dispose; candidate failure disposes; replacement preserves; deferred expected root equals handshake root |
354
+ | Reload generations | `test/daemon-integration.test.ts`, `test/daemon-lsp.test.ts` | SIGHUP/server.reload validates before publish; ordered catalog_changed; clients pause/fetch/hash/swap; expected generation on calls; stale_generation not_started permits one retry; stateless calls drain; process/LSP receive generation_retired before disposal; failure retains prior generation |
355
+ | Graceful shutdown and mutation state | `test/daemon-lifecycle.test.ts` | not_started/completed/indeterminate classification for atomic mutations, child spawn, cancel, timeout, reload, disconnect, and shutdown; terminal delivery attempted before close; managed versus attached cleanup; process-tree force deadline; close resolves after exact accounting |
356
+ | Packaging/removal | local-release focused smoke and tracked-reference scan | Node/Bun `pi --daemon` works; authenticated Docker uses packaged command; old unsafe Docker target is gone; no active package/bin/release/build/shim references remain |
357
+
358
+ During implementation, each listed file is run from `packages/coding-agent` with:
359
+
360
+ ```bash
361
+ node ../../node_modules/vitest/dist/cli.js --run test/<focused-file>.test.ts
362
+ ```
363
+
364
+ After every code-changing step:
365
+
366
+ ```bash
367
+ npm run check
368
+ git diff --check
369
+ ```
370
+
371
+ The final validation runs every modified focused test at least twice after formatting, checks Node and Bun local-release artifacts, exercises the packaged Docker command when Docker is available, performs tracked-reference/package/export scans, and obtains independent architecture and security reviews with no high- or medium-severity findings.
372
+
373
+ ## Consequences
374
+
375
+ ### Positive
376
+
377
+ - Pi has one distributed executable and one canonical tool behavior.
378
+ - Provider credentials, sessions, and prompt state remain outside the workspace daemon.
379
+ - Remote tool execution can grow through explicit capabilities without duplicating each tool in a primitive server.
380
+ - Colocated services and full-output artifacts live with the workspace that owns them.
381
+ - Security and compatibility behavior become explicit and testable.
382
+
383
+ ### Costs
384
+
385
+ - Extracting `WorkspaceToolHost` is a substantial internal refactor.
386
+ - The new protocol intentionally breaks old daemons and deployment scripts.
387
+ - A daemon with process execution remains an RCE endpoint requiring OS isolation.
388
+ - Remote LSP generations and repeated project-resource traversal add lifecycle coordination.
389
+ - Dynamic daemon-side arbitrary Pi extensions are deferred until a safe context exists.
390
+
391
+ ## Non-goals
392
+
393
+ - Running provider calls or an LLM loop in the daemon.
394
+ - Sharing conversation/session state with the daemon.
395
+ - Turning daemon mode into RPC mode or an interactive Pi mode.
396
+ - Making application path checks an OS sandbox.
397
+ - Supporting multiple mutually untrusted tenants in one daemon process.
398
+ - Preserving the old package, executable, unversioned protocol, query-token transport, or unrestricted paths.
399
+ - Inventing fake AgentSession, model, or UI APIs for daemon tools.
package/docs/daemon.md ADDED
@@ -0,0 +1,112 @@
1
+ # Remote Workspace Daemon
2
+
3
+ `grip --daemon` starts Grip as a remote workspace runtime. A normal local Grip process remains the orchestrator: it owns provider credentials, model calls, prompts, sessions, compaction, extensions, subagents, RPC, and UI. The daemon owns one configured workspace and executes canonical workspace tools, primitive project-resource operations, streamed file transfers, optional process execution, and optional colocated LSP.
4
+
5
+ Grip includes the daemon in the single-file executable; install a published, checksummed binary using [Quickstart](quickstart.md#install) or use a locally built executable. The daemon needs no npm installation on its host.
6
+
7
+ ## Start a daemon
8
+
9
+ ```bash
10
+ # Install the verified Grip binary first (see Quickstart).
11
+ GRIP_DAEMON_TOKEN='long-random-token' \
12
+ grip --daemon --daemon-cwd /workspace --daemon-host 127.0.0.1 --daemon-port 8787
13
+ ```
14
+
15
+ Connect from another Grip process:
16
+
17
+ ```bash
18
+ GRIP_REMOTE_TOKEN='long-random-token' grip --remote ws://127.0.0.1:8787/grip/workspace
19
+ ```
20
+
21
+ Attach an interactive Grip session when the daemon is running in a sandbox whose workspace root is `/workspace`:
22
+
23
+ ```bash
24
+ GRIP_REMOTE_TOKEN='long-random-token' grip
25
+ /sandbox --attach ws://127.0.0.1:8787/grip/workspace
26
+ ```
27
+
28
+ For a deferred daemon backend, use `grip --remote-deferred --remote-cwd /workspace` followed by `/sandbox --attach <ws://url>`. `/sandbox` is the only interactive backend-management command.
29
+
30
+ Use `GRIP_REMOTE_TOKEN` on the client. Do not put tokens in query strings or URLs.
31
+
32
+ ## Topology and trust boundary
33
+
34
+ In ordinary v1 mode, each daemon connection exposes a single workspace root; all clients of a daemon still share its OS-user trust domain. The daemon is an authenticated remote-code-execution service: anyone with the bearer token can use every advertised daemon capability. The separately negotiated v2 shared-Lima mode binds a workspace root per channel, but does **not** provide hostile-client isolation.
35
+
36
+ Application-layer confinement prevents protocol paths and symlinks from escaping the configured workspace and optional temporary root for file tools, resource reads, file transfers, temporary outputs, subprocess working directories, and LSP paths. `GRIP_DAEMON_TEMP_ROOT` is opt-in and should point only to disposable storage inside an OS sandbox; it is unset by default. This is not an operating-system sandbox. If process execution is enabled, commands can access anything the daemon OS user can access. Run the daemon as a dedicated unprivileged user, in a container, VM, or equivalent sandbox for hostile repositories.
37
+
38
+ The daemon refuses root and insecure non-loopback deployment by default. Non-loopback HTTP requires explicit override and should only be used behind a trusted TLS terminator. Prefer TLS for direct non-local use.
39
+
40
+
41
+ The shared Lima workflow uses a **separately negotiated v2** protocol, not a reinterpretation of the v1 single-root handshake. Each local TUI opens its own authenticated WebSocket and binds a workspace channel under the guest daemon's fixed parent mount. The daemon starts with `--daemon-shared-parent`; ordinary `--remote` still creates a v1 connection. Shared transfers are not advertised (ordinary v1 transfers remain available), and guest process execution is enabled for trusted clients only. See [sandbox.md](sandbox.md#direct-shared-lima-attachment) for attachment and stop policy.
42
+
43
+ ## Configuration
44
+
45
+ Common options:
46
+
47
+ | Option | Environment | Description |
48
+ | --- | --- | --- |
49
+ | `--daemon-host <ip>` | `GRIP_DAEMON_HOST` | Bind address. Defaults to `127.0.0.1`. |
50
+ | `--daemon-port <port>` | `GRIP_DAEMON_PORT` | Bind port. Defaults to `8787`. |
51
+ | `--daemon-cwd <dir>` | `GRIP_DAEMON_CWD` | Canonical confined workspace root. Defaults to current directory. |
52
+ | environment only | `GRIP_DAEMON_TEMP_ROOT` | Optional additional confined temporary root. Intended for container/VM scratch storage such as `/tmp`. |
53
+ | environment only | `GRIP_DAEMON_TOKEN` | Server bearer token required by clients. |
54
+ | environment only | `GRIP_DAEMON_ORIGINS` | Optional comma-separated exact WebSocket Origin allowlist. |
55
+ | `--daemon-tls-cert <file>` / `--daemon-tls-key <file>` | `GRIP_DAEMON_TLS_CERT` / `GRIP_DAEMON_TLS_KEY` | Direct TLS listener material. |
56
+ | `--daemon-allow-process-exec` | `GRIP_DAEMON_ALLOW_PROCESS_EXEC` | Enable shell/tool subprocess execution and managed LSP spawns. |
57
+ | `--daemon-lsp-config <file>` | `GRIP_DAEMON_LSP_CONFIG` | Operator-reviewed LSP configuration layer. |
58
+ | `--daemon-trust-project-lsp` | `GRIP_DAEMON_TRUST_PROJECT_LSP` | Include workspace `.grip/settings.json` LSP config. |
59
+
60
+ Run `grip --daemon --help` for the complete limit and deployment option list.
61
+
62
+ ## Resources, extensions, and LSP
63
+
64
+ Project instructions, skills, rules, and prompt templates are read through the daemon's confined primitive operations and parsed by the local orchestrating Grip with remote provenance. User and package resources remain local.
65
+
66
+ Extensions always run in the orchestrating Grip process. `grip --daemon` does not discover or execute user, package, or project extensions and does not provide a fake `ExtensionContext`. Local extension hooks still wrap remote tool calls once, and backend-aware extensions may use the borrowed daemon `ToolOperations` facade.
67
+
68
+ Daemon LSP is operator-owned and daemon-global. Configure it with `--daemon-lsp-config`; optionally include trusted project LSP settings with `--daemon-trust-project-lsp`. Managed spawned servers require `--daemon-allow-process-exec`. The orchestrator suppresses its local LSP manager for remote files and consumes the daemon's negotiated `lsp_*` tools and sanitized status.
69
+
70
+ ## Operations and file transfer
71
+
72
+ The daemon publishes a negotiated catalog of canonical Grip workspace tools. Local Grip prepares tool arguments once; the daemon validates again before execution. Catalog generation changes pause and refresh the local proxy. Stale, not-started calls may be retried once; calls that may have started side effects are not replayed.
73
+
74
+ File uploads/downloads and artifact reads use bounded streamed transfer messages. Whole responses, updates, transfer chunks, inbound frames, outbound queues, active calls, subprocess output, request duration, connections, and shutdown are bounded. Partial upload/write state is cleaned up on abort, timeout, disconnect, or shutdown.
75
+
76
+ ## Docker examples
77
+
78
+ A local daemon smoke-test image lives at `packages/coding-agent/examples/daemon-docker` and starts the packaged `grip --daemon` command inside the container.
79
+
80
+
81
+ ```bash
82
+ docker build -f packages/coding-agent/examples/daemon-docker/Dockerfile -t grip-remote-daemon-test .
83
+ docker run --rm -p 8787:8787 --name grip-remote-daemon-test grip-remote-daemon-test
84
+ GRIP_REMOTE_TOKEN=dev-token-dev-token-dev-token-dev-token ./grip-test.sh --remote ws://127.0.0.1:8787/grip/workspace
85
+ ```
86
+
87
+ ## Troubleshooting
88
+
89
+ - `401`/`403`: check `GRIP_DAEMON_TOKEN` on the server and `GRIP_REMOTE_TOKEN` on the client. Tokens are header-only.
90
+ - `404`: connect to `/grip/workspace`.
91
+ - Non-loopback bind rejected: use loopback, enable TLS, or explicitly accept insecure transport only behind a trusted boundary.
92
+ - `bash` unavailable: start the daemon with `--daemon-allow-process-exec` and isolate the OS user/container.
93
+ - LSP unavailable: verify `--daemon-lsp-config`, process-exec grants for managed spawns, confined paths, and daemon status.
94
+ - Resource reload mismatch: reconnect or run `/reload` after changing remote project resources.
95
+
96
+ ## Migration from `pi-daemon`
97
+
98
+ First list global packages with `npm ls -g --depth=0`. If the retired standalone daemon package is installed, uninstall it by its exact name from that list with `npm uninstall -g PACKAGE_NAME` (replace `PACKAGE_NAME` before running). Then install Grip:
99
+
100
+ ```bash
101
+ npm install -g --ignore-scripts @greppleai/grip
102
+ grip --daemon --daemon-cwd /workspace --daemon-port 8787
103
+ ```
104
+
105
+ Breaking changes from the retired daemon:
106
+
107
+ - no separate daemon package, `pi-daemon` binary, compatibility shim, or old unversioned protocol;
108
+ - no query-string or userinfo tokens; use `Authorization: Bearer` via `GRIP_REMOTE_TOKEN`;
109
+ - no `HOST`/`PORT` aliases; use `GRIP_DAEMON_HOST`/`GRIP_DAEMON_PORT` or CLI flags;
110
+ - workspace paths, symlinks, transfers, subprocess cwd, temporary outputs, resources, and LSP paths are confined;
111
+ - process execution is disabled unless explicitly granted;
112
+ - non-loopback and root deployments are refused unless explicitly overridden.
@@ -0,0 +1,72 @@
1
+ # Development
2
+
3
+ See [AGENTS.md](../../../AGENTS.md) for additional guidelines.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ cd /path/to/checkout
9
+ npm install --ignore-scripts
10
+ npm run build
11
+ ```
12
+
13
+ Use a trusted Grip checkout. The package metadata names the project repository, but verify the source and remote before running installation scripts.
14
+
15
+ Run from source:
16
+
17
+ ```bash
18
+ /path/to/checkout/grip-test.sh
19
+ ```
20
+
21
+ The script can be run from any directory. Grip keeps the caller's current working directory.
22
+
23
+ ## Forking / Rebranding
24
+
25
+ Configure via `package.json`:
26
+
27
+ ```json
28
+ {
29
+ "gripConfig": {
30
+ "name": "grip",
31
+ "configDir": ".grip"
32
+ }
33
+ }
34
+ ```
35
+
36
+ Change `name`, `configDir`, and `bin` field for your fork. Affects CLI banner, config paths, and environment variable names.
37
+
38
+ ## Path Resolution
39
+
40
+ Three execution modes: npm install, standalone binary, tsx from source.
41
+
42
+ **Always use `src/config.ts`** for package assets:
43
+
44
+ ```typescript
45
+ import { getPackageDir, getThemeDir } from "./config.js";
46
+ ```
47
+
48
+ Never use `__dirname` directly for package assets.
49
+
50
+ ## Debug Command
51
+
52
+ `/debug` (hidden) writes to `~/.grip/agent/grip-debug.log`:
53
+ - Rendered TUI lines with ANSI codes
54
+ - Last messages sent to the LLM
55
+
56
+ ## Testing
57
+
58
+ ```bash
59
+ ./test.sh # Run non-LLM tests (no API keys needed)
60
+ npm test # Run all tests
61
+ npm test -- test/specific.test.ts # Run specific test
62
+ ```
63
+
64
+ ## Project Structure
65
+
66
+ ```
67
+ packages/
68
+ ai/ # LLM provider abstraction
69
+ agent/ # Agent loop and message types
70
+ tui/ # Terminal UI components
71
+ coding-agent/ # CLI and interactive mode
72
+ ```