indusagi-coding-agent 0.1.42 → 0.1.44

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 (288) hide show
  1. package/CHANGELOG.md +23 -3
  2. package/README.md +3 -0
  3. package/dist/command-line/args.js +1 -1
  4. package/dist/command-line/args.js.map +1 -1
  5. package/dist/command-line/list-models.js +1 -1
  6. package/dist/command-line/list-models.js.map +1 -1
  7. package/dist/command-line/login-handler.d.ts.map +1 -1
  8. package/dist/command-line/login-handler.js +39 -0
  9. package/dist/command-line/login-handler.js.map +1 -1
  10. package/dist/dev/observe-deep.d.ts +2 -0
  11. package/dist/dev/observe-deep.d.ts.map +1 -0
  12. package/dist/dev/observe-deep.js +333 -0
  13. package/dist/dev/observe-deep.js.map +1 -0
  14. package/dist/dev/observe-smoke.d.ts +2 -0
  15. package/dist/dev/observe-smoke.d.ts.map +1 -0
  16. package/dist/dev/observe-smoke.js +264 -0
  17. package/dist/dev/observe-smoke.js.map +1 -0
  18. package/dist/index.d.ts +4 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +3 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/interfaces/induscode-ui-delegate.d.ts +3 -0
  23. package/dist/interfaces/induscode-ui-delegate.d.ts.map +1 -0
  24. package/dist/interfaces/induscode-ui-delegate.js +148 -0
  25. package/dist/interfaces/induscode-ui-delegate.js.map +1 -0
  26. package/dist/interfaces/terminal-ui/components/footer.d.ts.map +1 -1
  27. package/dist/interfaces/terminal-ui/components/footer.js +9 -15
  28. package/dist/interfaces/terminal-ui/components/footer.js.map +1 -1
  29. package/dist/interfaces/terminal-ui/components/model-selector.d.ts.map +1 -1
  30. package/dist/interfaces/terminal-ui/components/model-selector.js +1 -1
  31. package/dist/interfaces/terminal-ui/components/model-selector.js.map +1 -1
  32. package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts.map +1 -1
  33. package/dist/interfaces/terminal-ui/components/oauth-selector.js +1 -0
  34. package/dist/interfaces/terminal-ui/components/oauth-selector.js.map +1 -1
  35. package/dist/main.d.ts.map +1 -1
  36. package/dist/main.js +42 -18
  37. package/dist/main.js.map +1 -1
  38. package/dist/observe.d.ts +2 -0
  39. package/dist/observe.d.ts.map +1 -0
  40. package/dist/observe.js +2 -0
  41. package/dist/observe.js.map +1 -0
  42. package/dist/runtime/agent-session.d.ts +15 -0
  43. package/dist/runtime/agent-session.d.ts.map +1 -1
  44. package/dist/runtime/agent-session.js +444 -223
  45. package/dist/runtime/agent-session.js.map +1 -1
  46. package/dist/runtime/index.d.ts +5 -0
  47. package/dist/runtime/index.d.ts.map +1 -1
  48. package/dist/runtime/index.js +5 -0
  49. package/dist/runtime/index.js.map +1 -1
  50. package/dist/runtime/model-registry.d.ts +6 -0
  51. package/dist/runtime/model-registry.d.ts.map +1 -1
  52. package/dist/runtime/model-registry.js +71 -14
  53. package/dist/runtime/model-registry.js.map +1 -1
  54. package/dist/runtime/model-resolver.d.ts.map +1 -1
  55. package/dist/runtime/model-resolver.js +6 -3
  56. package/dist/runtime/model-resolver.js.map +1 -1
  57. package/dist/runtime/observe.d.ts +50 -0
  58. package/dist/runtime/observe.d.ts.map +1 -0
  59. package/dist/runtime/observe.js +233 -0
  60. package/dist/runtime/observe.js.map +1 -0
  61. package/dist/runtime/plugins/types.d.ts +3 -0
  62. package/dist/runtime/plugins/types.d.ts.map +1 -1
  63. package/dist/runtime/plugins/types.js.map +1 -1
  64. package/dist/runtime/providers/adapters/claude-cli-adapter.d.ts +19 -0
  65. package/dist/runtime/providers/adapters/claude-cli-adapter.d.ts.map +1 -0
  66. package/dist/runtime/providers/adapters/claude-cli-adapter.js +242 -0
  67. package/dist/runtime/providers/adapters/claude-cli-adapter.js.map +1 -0
  68. package/dist/runtime/providers/adapters/codex-cli-adapter.d.ts +18 -0
  69. package/dist/runtime/providers/adapters/codex-cli-adapter.d.ts.map +1 -0
  70. package/dist/runtime/providers/adapters/codex-cli-adapter.js +177 -0
  71. package/dist/runtime/providers/adapters/codex-cli-adapter.js.map +1 -0
  72. package/dist/runtime/providers/adapters/indusagi-cli-adapter.d.ts +21 -0
  73. package/dist/runtime/providers/adapters/indusagi-cli-adapter.d.ts.map +1 -0
  74. package/dist/runtime/providers/adapters/indusagi-cli-adapter.js +162 -0
  75. package/dist/runtime/providers/adapters/indusagi-cli-adapter.js.map +1 -0
  76. package/dist/runtime/providers/adapters/utils.d.ts +12 -0
  77. package/dist/runtime/providers/adapters/utils.d.ts.map +1 -0
  78. package/dist/runtime/providers/adapters/utils.js +122 -0
  79. package/dist/runtime/providers/adapters/utils.js.map +1 -0
  80. package/dist/runtime/providers/builtins.d.ts +3 -0
  81. package/dist/runtime/providers/builtins.d.ts.map +1 -0
  82. package/dist/runtime/providers/builtins.js +99 -0
  83. package/dist/runtime/providers/builtins.js.map +1 -0
  84. package/dist/runtime/providers/provider-adapter-registry.d.ts +11 -0
  85. package/dist/runtime/providers/provider-adapter-registry.d.ts.map +1 -0
  86. package/dist/runtime/providers/provider-adapter-registry.js +36 -0
  87. package/dist/runtime/providers/provider-adapter-registry.js.map +1 -0
  88. package/dist/runtime/providers/provider-adapter.d.ts +33 -0
  89. package/dist/runtime/providers/provider-adapter.d.ts.map +1 -0
  90. package/dist/runtime/providers/provider-adapter.js +2 -0
  91. package/dist/runtime/providers/provider-adapter.js.map +1 -0
  92. package/dist/runtime/providers/provider-service.d.ts +33 -0
  93. package/dist/runtime/providers/provider-service.d.ts.map +1 -0
  94. package/dist/runtime/providers/provider-service.js +157 -0
  95. package/dist/runtime/providers/provider-service.js.map +1 -0
  96. package/dist/runtime/providers/types.d.ts +29 -0
  97. package/dist/runtime/providers/types.d.ts.map +1 -0
  98. package/dist/runtime/providers/types.js +9 -0
  99. package/dist/runtime/providers/types.js.map +1 -0
  100. package/dist/runtime/sdk.d.ts +6 -0
  101. package/dist/runtime/sdk.d.ts.map +1 -1
  102. package/dist/runtime/sdk.js +55 -8
  103. package/dist/runtime/sdk.js.map +1 -1
  104. package/dist/telemetry/core/types.d.ts +1 -1
  105. package/dist/telemetry/core/types.js +1 -1
  106. package/dist/vendor/observe/adapters/agent-event-adapter.d.ts +28 -0
  107. package/dist/vendor/observe/adapters/agent-event-adapter.d.ts.map +1 -0
  108. package/dist/vendor/observe/adapters/agent-event-adapter.js +136 -0
  109. package/dist/vendor/observe/adapters/agent-event-adapter.js.map +1 -0
  110. package/dist/vendor/observe/adapters/ai-stream-adapter.d.ts +24 -0
  111. package/dist/vendor/observe/adapters/ai-stream-adapter.d.ts.map +1 -0
  112. package/dist/vendor/observe/adapters/ai-stream-adapter.js +118 -0
  113. package/dist/vendor/observe/adapters/ai-stream-adapter.js.map +1 -0
  114. package/dist/vendor/observe/artifacts/content-store.d.ts +12 -0
  115. package/dist/vendor/observe/artifacts/content-store.d.ts.map +1 -0
  116. package/dist/vendor/observe/artifacts/content-store.js +2 -0
  117. package/dist/vendor/observe/artifacts/content-store.js.map +1 -0
  118. package/dist/vendor/observe/artifacts/file-content-store.d.ts +16 -0
  119. package/dist/vendor/observe/artifacts/file-content-store.d.ts.map +1 -0
  120. package/dist/vendor/observe/artifacts/file-content-store.js +43 -0
  121. package/dist/vendor/observe/artifacts/file-content-store.js.map +1 -0
  122. package/dist/vendor/observe/batcher.d.ts +27 -0
  123. package/dist/vendor/observe/batcher.d.ts.map +1 -0
  124. package/dist/vendor/observe/batcher.js +66 -0
  125. package/dist/vendor/observe/batcher.js.map +1 -0
  126. package/dist/vendor/observe/client/artifacts-manager.d.ts +29 -0
  127. package/dist/vendor/observe/client/artifacts-manager.d.ts.map +1 -0
  128. package/dist/vendor/observe/client/artifacts-manager.js +120 -0
  129. package/dist/vendor/observe/client/artifacts-manager.js.map +1 -0
  130. package/dist/vendor/observe/client/datasets-manager.d.ts +16 -0
  131. package/dist/vendor/observe/client/datasets-manager.d.ts.map +1 -0
  132. package/dist/vendor/observe/client/datasets-manager.js +27 -0
  133. package/dist/vendor/observe/client/datasets-manager.js.map +1 -0
  134. package/dist/vendor/observe/client/experiments-manager.d.ts +61 -0
  135. package/dist/vendor/observe/client/experiments-manager.d.ts.map +1 -0
  136. package/dist/vendor/observe/client/experiments-manager.js +132 -0
  137. package/dist/vendor/observe/client/experiments-manager.js.map +1 -0
  138. package/dist/vendor/observe/client/index.d.ts +9 -0
  139. package/dist/vendor/observe/client/index.d.ts.map +1 -0
  140. package/dist/vendor/observe/client/index.js +9 -0
  141. package/dist/vendor/observe/client/index.js.map +1 -0
  142. package/dist/vendor/observe/client/observe-client.d.ts +30 -0
  143. package/dist/vendor/observe/client/observe-client.d.ts.map +1 -0
  144. package/dist/vendor/observe/client/observe-client.js +22 -0
  145. package/dist/vendor/observe/client/observe-client.js.map +1 -0
  146. package/dist/vendor/observe/client/prompts-manager.d.ts +17 -0
  147. package/dist/vendor/observe/client/prompts-manager.d.ts.map +1 -0
  148. package/dist/vendor/observe/client/prompts-manager.js +38 -0
  149. package/dist/vendor/observe/client/prompts-manager.js.map +1 -0
  150. package/dist/vendor/observe/client/scores-manager.d.ts +10 -0
  151. package/dist/vendor/observe/client/scores-manager.d.ts.map +1 -0
  152. package/dist/vendor/observe/client/scores-manager.js +15 -0
  153. package/dist/vendor/observe/client/scores-manager.js.map +1 -0
  154. package/dist/vendor/observe/client/sessions-manager.d.ts +15 -0
  155. package/dist/vendor/observe/client/sessions-manager.d.ts.map +1 -0
  156. package/dist/vendor/observe/client/sessions-manager.js +24 -0
  157. package/dist/vendor/observe/client/sessions-manager.js.map +1 -0
  158. package/dist/vendor/observe/client/traces-manager.d.ts +23 -0
  159. package/dist/vendor/observe/client/traces-manager.d.ts.map +1 -0
  160. package/dist/vendor/observe/client/traces-manager.js +39 -0
  161. package/dist/vendor/observe/client/traces-manager.js.map +1 -0
  162. package/dist/vendor/observe/console-exporter.d.ts +11 -0
  163. package/dist/vendor/observe/console-exporter.d.ts.map +1 -0
  164. package/dist/vendor/observe/console-exporter.js +18 -0
  165. package/dist/vendor/observe/console-exporter.js.map +1 -0
  166. package/dist/vendor/observe/context.d.ts +4 -0
  167. package/dist/vendor/observe/context.d.ts.map +1 -0
  168. package/dist/vendor/observe/context.js +9 -0
  169. package/dist/vendor/observe/context.js.map +1 -0
  170. package/dist/vendor/observe/entities/artifacts.d.ts +46 -0
  171. package/dist/vendor/observe/entities/artifacts.d.ts.map +1 -0
  172. package/dist/vendor/observe/entities/artifacts.js +2 -0
  173. package/dist/vendor/observe/entities/artifacts.js.map +1 -0
  174. package/dist/vendor/observe/entities/datasets.d.ts +37 -0
  175. package/dist/vendor/observe/entities/datasets.d.ts.map +1 -0
  176. package/dist/vendor/observe/entities/datasets.js +2 -0
  177. package/dist/vendor/observe/entities/datasets.js.map +1 -0
  178. package/dist/vendor/observe/entities/experiments.d.ts +66 -0
  179. package/dist/vendor/observe/entities/experiments.d.ts.map +1 -0
  180. package/dist/vendor/observe/entities/experiments.js +2 -0
  181. package/dist/vendor/observe/entities/experiments.js.map +1 -0
  182. package/dist/vendor/observe/entities/index.d.ts +9 -0
  183. package/dist/vendor/observe/entities/index.d.ts.map +1 -0
  184. package/dist/vendor/observe/entities/index.js +9 -0
  185. package/dist/vendor/observe/entities/index.js.map +1 -0
  186. package/dist/vendor/observe/entities/prompts.d.ts +25 -0
  187. package/dist/vendor/observe/entities/prompts.d.ts.map +1 -0
  188. package/dist/vendor/observe/entities/prompts.js +2 -0
  189. package/dist/vendor/observe/entities/prompts.js.map +1 -0
  190. package/dist/vendor/observe/entities/scores.d.ts +28 -0
  191. package/dist/vendor/observe/entities/scores.d.ts.map +1 -0
  192. package/dist/vendor/observe/entities/scores.js +2 -0
  193. package/dist/vendor/observe/entities/scores.js.map +1 -0
  194. package/dist/vendor/observe/entities/sessions.d.ts +36 -0
  195. package/dist/vendor/observe/entities/sessions.d.ts.map +1 -0
  196. package/dist/vendor/observe/entities/sessions.js +2 -0
  197. package/dist/vendor/observe/entities/sessions.js.map +1 -0
  198. package/dist/vendor/observe/entities/shared.d.ts +26 -0
  199. package/dist/vendor/observe/entities/shared.d.ts.map +1 -0
  200. package/dist/vendor/observe/entities/shared.js +2 -0
  201. package/dist/vendor/observe/entities/shared.js.map +1 -0
  202. package/dist/vendor/observe/entities/traces.d.ts +59 -0
  203. package/dist/vendor/observe/entities/traces.d.ts.map +1 -0
  204. package/dist/vendor/observe/entities/traces.js +2 -0
  205. package/dist/vendor/observe/entities/traces.js.map +1 -0
  206. package/dist/vendor/observe/exporter.d.ts +2 -0
  207. package/dist/vendor/observe/exporter.d.ts.map +1 -0
  208. package/dist/vendor/observe/exporter.js +2 -0
  209. package/dist/vendor/observe/exporter.js.map +1 -0
  210. package/dist/vendor/observe/file-exporter.d.ts +16 -0
  211. package/dist/vendor/observe/file-exporter.d.ts.map +1 -0
  212. package/dist/vendor/observe/file-exporter.js +39 -0
  213. package/dist/vendor/observe/file-exporter.js.map +1 -0
  214. package/dist/vendor/observe/global.d.ts +6 -0
  215. package/dist/vendor/observe/global.d.ts.map +1 -0
  216. package/dist/vendor/observe/global.js +17 -0
  217. package/dist/vendor/observe/global.js.map +1 -0
  218. package/dist/vendor/observe/index.d.ts +24 -0
  219. package/dist/vendor/observe/index.d.ts.map +1 -0
  220. package/dist/vendor/observe/index.js +24 -0
  221. package/dist/vendor/observe/index.js.map +1 -0
  222. package/dist/vendor/observe/noop.d.ts +17 -0
  223. package/dist/vendor/observe/noop.d.ts.map +1 -0
  224. package/dist/vendor/observe/noop.js +80 -0
  225. package/dist/vendor/observe/noop.js.map +1 -0
  226. package/dist/vendor/observe/privacy.d.ts +18 -0
  227. package/dist/vendor/observe/privacy.d.ts.map +1 -0
  228. package/dist/vendor/observe/privacy.js +160 -0
  229. package/dist/vendor/observe/privacy.js.map +1 -0
  230. package/dist/vendor/observe/query/simple-query-client.d.ts +11 -0
  231. package/dist/vendor/observe/query/simple-query-client.d.ts.map +1 -0
  232. package/dist/vendor/observe/query/simple-query-client.js +31 -0
  233. package/dist/vendor/observe/query/simple-query-client.js.map +1 -0
  234. package/dist/vendor/observe/replay/session-replay.d.ts +20 -0
  235. package/dist/vendor/observe/replay/session-replay.d.ts.map +1 -0
  236. package/dist/vendor/observe/replay/session-replay.js +180 -0
  237. package/dist/vendor/observe/replay/session-replay.js.map +1 -0
  238. package/dist/vendor/observe/runtime.d.ts +27 -0
  239. package/dist/vendor/observe/runtime.d.ts.map +1 -0
  240. package/dist/vendor/observe/runtime.js +177 -0
  241. package/dist/vendor/observe/runtime.js.map +1 -0
  242. package/dist/vendor/observe/server/dashboard-html.d.ts +6 -0
  243. package/dist/vendor/observe/server/dashboard-html.d.ts.map +1 -0
  244. package/dist/vendor/observe/server/dashboard-html.js +305 -0
  245. package/dist/vendor/observe/server/dashboard-html.js.map +1 -0
  246. package/dist/vendor/observe/server/http-observe-server.d.ts +62 -0
  247. package/dist/vendor/observe/server/http-observe-server.d.ts.map +1 -0
  248. package/dist/vendor/observe/server/http-observe-server.js +418 -0
  249. package/dist/vendor/observe/server/http-observe-server.js.map +1 -0
  250. package/dist/vendor/observe/server/in-memory-observe-server.d.ts +20 -0
  251. package/dist/vendor/observe/server/in-memory-observe-server.d.ts.map +1 -0
  252. package/dist/vendor/observe/server/in-memory-observe-server.js +76 -0
  253. package/dist/vendor/observe/server/in-memory-observe-server.js.map +1 -0
  254. package/dist/vendor/observe/span.d.ts +45 -0
  255. package/dist/vendor/observe/span.d.ts.map +1 -0
  256. package/dist/vendor/observe/span.js +110 -0
  257. package/dist/vendor/observe/span.js.map +1 -0
  258. package/dist/vendor/observe/store/contracts.d.ts +59 -0
  259. package/dist/vendor/observe/store/contracts.d.ts.map +1 -0
  260. package/dist/vendor/observe/store/contracts.js +2 -0
  261. package/dist/vendor/observe/store/contracts.js.map +1 -0
  262. package/dist/vendor/observe/store/file-control-plane-store.d.ts +33 -0
  263. package/dist/vendor/observe/store/file-control-plane-store.d.ts.map +1 -0
  264. package/dist/vendor/observe/store/file-control-plane-store.js +146 -0
  265. package/dist/vendor/observe/store/file-control-plane-store.js.map +1 -0
  266. package/dist/vendor/observe/store/in-memory-control-plane-store.d.ts +84 -0
  267. package/dist/vendor/observe/store/in-memory-control-plane-store.d.ts.map +1 -0
  268. package/dist/vendor/observe/store/in-memory-control-plane-store.js +447 -0
  269. package/dist/vendor/observe/store/in-memory-control-plane-store.js.map +1 -0
  270. package/dist/vendor/observe/store/index.d.ts +4 -0
  271. package/dist/vendor/observe/store/index.d.ts.map +1 -0
  272. package/dist/vendor/observe/store/index.js +4 -0
  273. package/dist/vendor/observe/store/index.js.map +1 -0
  274. package/dist/vendor/observe/types.d.ts +246 -0
  275. package/dist/vendor/observe/types.d.ts.map +1 -0
  276. package/dist/vendor/observe/types.js +152 -0
  277. package/dist/vendor/observe/types.js.map +1 -0
  278. package/dist/vendor/observe/worker/in-memory-observe-worker.d.ts +25 -0
  279. package/dist/vendor/observe/worker/in-memory-observe-worker.d.ts.map +1 -0
  280. package/dist/vendor/observe/worker/in-memory-observe-worker.js +82 -0
  281. package/dist/vendor/observe/worker/in-memory-observe-worker.js.map +1 -0
  282. package/guides/CLAUDE_CODEX_CLI_INTEGRATION_PLAN.md +321 -0
  283. package/guides/{PI_MONO_MIT_REMOVAL_GUIDE.md → INDUSAGI_MONO_MIT_REMOVAL_GUIDE.md} +29 -29
  284. package/guides/INDUSVX_OBSERVE_FULL_INTEGRATION_REPORT.md +543 -0
  285. package/guides/OBSERVE_DEEP_VALIDATION.md +252 -0
  286. package/guides/OBSERVE_LOCAL_TESTING.md +183 -0
  287. package/guides/OPTION3_PROVIDER_ADAPTER_RUNTIME_PLAN.md +370 -0
  288. package/package.json +11 -4
@@ -0,0 +1,321 @@
1
+ # Claude CLI / Codex CLI / Indusagi CLI Integration Plan for `indusagi-screth`
2
+
3
+ ## Goal
4
+
5
+ Add support for CLI-backed providers in `indusagi-screth`, including:
6
+
7
+ - Claude CLI / Claude Agent runtime
8
+ - Codex CLI / Codex app-server runtime
9
+ - **indusagi-coding-agent CLI** as another provider runtime
10
+
11
+ so they can be integrated similarly to how `t3code` wires provider adapters.
12
+
13
+ ---
14
+
15
+ ## Short Answer
16
+
17
+ You have 3 practical paths:
18
+
19
+ 1. **Fast path**: custom providers via `registerProvider(..., { streamSimple })` and shell out to CLI.
20
+ 2. **Better path**: still custom provider, but run `indusagi` in `--mode rpc` for persistent subprocess + streaming events.
21
+ 3. **Full t3-style path**: build a provider adapter subsystem (session lifecycle + canonical runtime events).
22
+
23
+ If you want parity with `t3code`, use **Path 3**.
24
+
25
+ ---
26
+
27
+ ## Important Architecture Reality (Current Code)
28
+
29
+ `indusagi-screth` is currently **model-centric**:
30
+
31
+ - provider/model registration:
32
+ - `app/runtime/model-registry.ts`
33
+ - extension provider registrations are queued and applied through:
34
+ - `app/runtime/plugins/loader.ts`
35
+ - `app/main.ts`
36
+ - `app/runtime/plugins/runner.ts`
37
+ - runtime calls route through `indusagi/ai` provider API (`streamSimple`):
38
+ - `app/runtime/sdk.ts`
39
+
40
+ ### Why this matters
41
+
42
+ Claude/Codex/Indusagi CLIs are **agent runtimes**, not plain model endpoints.
43
+
44
+ Current architecture expects model providers to look like API adapters that produce assistant/tool-call events. So a CLI integration can work quickly, but full parity needs provider session orchestration.
45
+
46
+ ---
47
+
48
+ ## Current Capability You Already Have
49
+
50
+ You already support custom providers via extension/runtime registration:
51
+
52
+ - `registerProvider(name, config)` API in extensions:
53
+ - `app/runtime/plugins/types.ts`
54
+ - runtime queue + application:
55
+ - `app/runtime/plugins/loader.ts`
56
+ - `app/main.ts`
57
+ - `app/runtime/plugins/runner.ts`
58
+ - custom stream handler support:
59
+ - `streamSimple` in `ProviderConfigInput` (`app/runtime/model-registry.ts`)
60
+
61
+ This is enough for a strong PoC.
62
+
63
+ ---
64
+
65
+ ## Path 1 — Fast Integration (Spawn CLI per turn)
66
+
67
+ ## Best for
68
+
69
+ - quickest implementation
70
+ - proving provider UX
71
+ - validating prompt/output quality
72
+
73
+ ## Provider IDs to use
74
+
75
+ - `claude-cli`
76
+ - `codex-cli`
77
+ - `indusagi-cli`
78
+
79
+ ## Implementation
80
+
81
+ ### 1) Add extension registration file
82
+
83
+ Create:
84
+
85
+ - `.indusagi/extensions/cli-providers.ts`
86
+
87
+ Register 3 providers with model list + `streamSimple`.
88
+
89
+ ### 2) Implement stream handlers by spawning CLI
90
+
91
+ Use `createAssistantMessageEventStream()` + `createAssistantMessageOutput()` from `indusagi/ai` and map process stdout into text deltas.
92
+
93
+ Minimal skeleton:
94
+
95
+ ```ts
96
+ import {
97
+ createAssistantMessageEventStream,
98
+ createAssistantMessageOutput,
99
+ type Model,
100
+ type Context,
101
+ type SimpleStreamOptions,
102
+ } from "indusagi/ai";
103
+ import { spawn } from "node:child_process";
104
+
105
+ function streamSimpleCli(
106
+ bin: string,
107
+ args: string[],
108
+ model: Model<any>,
109
+ context: Context,
110
+ options?: SimpleStreamOptions,
111
+ ) {
112
+ const stream = createAssistantMessageEventStream();
113
+ const output = createAssistantMessageOutput(model);
114
+
115
+ stream.pushStart(output);
116
+ stream.pushTextStart(0, output);
117
+
118
+ const prompt = "...convert context.messages to prompt...";
119
+ const child = spawn(bin, [...args, prompt], {
120
+ stdio: ["ignore", "pipe", "pipe"],
121
+ env: process.env,
122
+ });
123
+
124
+ child.stdout.on("data", (buf) => {
125
+ const delta = String(buf);
126
+ const prev = (output.content[0] as any)?.text ?? "";
127
+ output.content[0] = { type: "text", text: prev + delta };
128
+ stream.pushTextDelta(0, delta, output);
129
+ });
130
+
131
+ child.on("close", (code) => {
132
+ const text = (output.content[0] as any)?.text ?? "";
133
+ stream.pushTextEnd(0, text, output);
134
+ stream.pushDone(code === 0 ? "stop" : "length", output);
135
+ });
136
+
137
+ child.on("error", (err) => {
138
+ output.stopReason = "error";
139
+ output.errorMessage = err instanceof Error ? err.message : String(err);
140
+ stream.pushError("error", output);
141
+ });
142
+
143
+ return stream;
144
+ }
145
+ ```
146
+
147
+ ### 3) CLI command strategy
148
+
149
+ - Claude: `claude -p`
150
+ - Codex: start with a non-session command path for PoC (if available in your environment)
151
+ - indusagi: `indusagi --mode text -p` (or `--mode json` and parse)
152
+
153
+ ### 4) Register model metadata
154
+
155
+ Use placeholder model metadata in provider config (`contextWindow`, `maxTokens`, `cost`) until you have exact values.
156
+
157
+ ### 5) Auth gating note
158
+
159
+ Current validation in `model-registry` requires `apiKey` or `oauth` when `models` are provided.
160
+
161
+ - quick workaround: provide dummy `apiKey` in config and ignore it
162
+ - cleaner fix: in `app/runtime/model-registry.ts`, relax rule when `streamSimple` is present
163
+
164
+ Suggested rule:
165
+
166
+ - if `models` exists AND `streamSimple` exists => allow without `apiKey/oauth`.
167
+
168
+ ## Limitations
169
+
170
+ - no persistent provider session lifecycle
171
+ - no native provider thread IDs/recovery
172
+ - approvals/tool events from external agent are hard to map cleanly
173
+
174
+ ---
175
+
176
+ ## Path 2 — Better Integration for `indusagi-cli` (RPC mode subprocess)
177
+
178
+ ## Best for
179
+
180
+ - integrating **indusagi-coding-agent as a provider** with persistent process state
181
+ - better streaming/event mapping than one-shot print mode
182
+
183
+ `indusagi-screth` already has RPC client support:
184
+
185
+ - `app/interfaces/service-api/rpc-client.ts`
186
+
187
+ You can run subprocess:
188
+
189
+ - `indusagi --mode rpc`
190
+
191
+ and bridge RPC events into `AssistantMessageEventStream`.
192
+
193
+ ### Why this is useful
194
+
195
+ Compared to one-shot `--mode text/-p`:
196
+
197
+ - persistent subprocess
198
+ - better event visibility
199
+ - easier to add interrupt + model switching hooks
200
+
201
+ ### Suggested mapping
202
+
203
+ - `message` events (assistant) -> `text_delta` / `text_end`
204
+ - error event -> `pushError(...)`
205
+ - completed/idle -> `pushDone(...)`
206
+
207
+ ---
208
+
209
+ ## Path 3 — Full `t3code`-Style Provider Runtime (Recommended)
210
+
211
+ ## Best for
212
+
213
+ - production-quality CLI providers
214
+ - parity with Codex/Claude adapter design from `t3code`
215
+ - extensibility to more runtimes
216
+
217
+ ## High-level design
218
+
219
+ Add a provider subsystem inside `indusagi-screth`, e.g.:
220
+
221
+ - `app/runtime/providers/Services/ProviderAdapter.ts`
222
+ - `app/runtime/providers/Services/ProviderService.ts`
223
+ - `app/runtime/providers/Layers/ProviderAdapterRegistry.ts`
224
+ - `app/runtime/providers/Layers/ClaudeCliAdapter.ts`
225
+ - `app/runtime/providers/Layers/CodexCliAdapter.ts`
226
+ - `app/runtime/providers/Layers/IndusagiCliAdapter.ts`
227
+
228
+ ### Core responsibilities
229
+
230
+ 1. **ProviderAdapter**
231
+ - `startSession(threadId, config)`
232
+ - `sendTurn(threadId, input)`
233
+ - `interrupt/stop/listSessions`
234
+ - `streamEvents`
235
+
236
+ 2. **Adapter registry**
237
+ - provider key -> adapter
238
+
239
+ 3. **Provider service**
240
+ - route calls to adapter
241
+ - persist resume/binding state
242
+
243
+ 4. **Event normalization**
244
+ - provider raw events -> canonical runtime/session events
245
+
246
+ 5. **Session integration**
247
+ - in `AgentSession`, route selected providers (`claude-cli`, `codex-cli`, `indusagi-cli`) through provider service instead of direct `streamSimple`.
248
+
249
+ ---
250
+
251
+ ## Concrete File-Level Plan (Updated)
252
+
253
+ ## Phase 1: Fast PoC
254
+
255
+ 1. Create extension file:
256
+ - `.indusagi/extensions/cli-providers.ts`
257
+ 2. Register 3 providers:
258
+ - `claude-cli`
259
+ - `codex-cli`
260
+ - `indusagi-cli`
261
+ 3. Implement `streamSimple` wrappers for all 3
262
+ 4. Validate:
263
+ - `indusagi --extension .indusagi/extensions/cli-providers.ts --list-models`
264
+
265
+ ## Phase 2: Validation + UX Cleanup
266
+
267
+ 1. Relax `model-registry` auth validation for `streamSimple` providers
268
+ 2. Add CLI binary existence checks (e.g. `--version`) and friendly startup errors
269
+ 3. Add tests for provider registration and selection
270
+
271
+ ## Phase 3: Full Adapter Runtime
272
+
273
+ 1. Build provider adapter/service layers
274
+ 2. Implement adapters:
275
+ - `ClaudeCliAdapter`
276
+ - `CodexCliAdapter`
277
+ - `IndusagiCliAdapter`
278
+ 3. Route session engine by provider type
279
+ 4. Add event mapping + resume semantics + interrupt handling
280
+
281
+ ---
282
+
283
+ ## Test Checklist (Updated)
284
+
285
+ - Provider registration
286
+ - all 3 providers visible in model list
287
+ - Selection
288
+ - `/model` can switch to `claude-cli` / `codex-cli` / `indusagi-cli`
289
+ - Streaming
290
+ - deltas arrive incrementally
291
+ - Interrupt
292
+ - cancellation works consistently
293
+ - Error handling
294
+ - missing CLI binary gives clear message
295
+ - Session
296
+ - resume behavior predictable
297
+ - RPC bridge (if Path 2)
298
+ - subprocess startup/shutdown stable
299
+ - events mapped correctly
300
+
301
+ ---
302
+
303
+ ## Recommendation
304
+
305
+ - **Immediate**: implement Path 1 for all three providers.
306
+ - **Next**: move `indusagi-cli` to Path 2 (RPC) for better process/session behavior.
307
+ - **Production**: adopt Path 3 provider runtime (t3-style adapters).
308
+
309
+ ---
310
+
311
+ ## Optional Next Step
312
+
313
+ If you want, next I can generate this file directly:
314
+
315
+ - `.indusagi/extensions/cli-providers.ts`
316
+
317
+ with starter registrations + scaffolding for:
318
+
319
+ - `claude-cli`
320
+ - `codex-cli`
321
+ - `indusagi-cli`
@@ -1,8 +1,8 @@
1
- # PI Mono MIT Removal Guide for `indusagi-screth`
1
+ # Indusagi Mono MIT Removal Guide for `indusagi-screth`
2
2
 
3
3
 
4
4
 
5
- > **Important:** This is a technical provenance-cleanup guide, **not legal advice**. If you want to make a strong public claim like _"`indusagi-screth` contains no PI Mono derived code"_, you should still do a final legal/provenance review.
5
+ > **Important:** This is a technical provenance-cleanup guide, **not legal advice**. If you want to make a strong public claim like _"`indusagi-screth` contains no Indusagi Mono derived code"_, you should still do a final legal/provenance review.
6
6
 
7
7
 
8
8
 
@@ -10,21 +10,21 @@
10
10
 
11
11
 
12
12
 
13
- If the goal is to make `indusagi-screth` **PI Mono MIT-free**, the safe standard is:ß
13
+ If the goal is to make `indusagi-screth` **Indusagi Mono MIT-free**, the safe standard is:ß
14
14
 
15
15
 
16
16
 
17
- 1. No copied PI Mono source files remain.
17
+ 1. No copied Indusagi Mono source files remain.
18
18
 
19
- 2. No adapted/derived PI Mono files remain unless you are willing to keep MIT attribution.
19
+ 2. No adapted/derived Indusagi Mono files remain unless you are willing to keep MIT attribution.
20
20
 
21
21
  3. Third-party vendor assets are either:
22
22
 
23
23
  - replaced by direct upstream package installation/build steps, or
24
24
 
25
- - kept with their own proper attribution, independent of PI Mono.
25
+ - kept with their own proper attribution, independent of Indusagi Mono.
26
26
 
27
- 4. Documentation, package metadata, and marketing text do not imply PI Mono-derived implementation if that is no longer true.
27
+ 4. Documentation, package metadata, and marketing text do not imply Indusagi Mono-derived implementation if that is no longer true.
28
28
 
29
29
 
30
30
 
@@ -34,7 +34,7 @@ If the goal is to make `indusagi-screth` **PI Mono MIT-free**, the safe standard
34
34
 
35
35
  Compared repos:
36
36
 
37
- - `@pi-mono/packages/coding-agent/`
37
+ - `@indusagi-mono/packages/coding-agent/`
38
38
 
39
39
  - `@indusagi-screth/`
40
40
 
@@ -50,7 +50,7 @@ Current overlap snapshot:
50
50
 
51
51
 
52
52
 
53
- That means `indusagi-screth` is **not** currently in a position where it is safe to say _"PI Mono copyright does not apply"_. There is still enough exact and likely-derived overlap that a cleanup pass is required.
53
+ That means `indusagi-screth` is **not** currently in a position where it is safe to say _"Indusagi Mono copyright does not apply"_. There is still enough exact and likely-derived overlap that a cleanup pass is required.
54
54
 
55
55
 
56
56
 
@@ -70,7 +70,7 @@ Before rewriting anything, follow these rules:
70
70
 
71
71
 
72
72
 
73
- - Do **not** use PI Mono files as copy-paste sources during the rewrite.
73
+ - Do **not** use Indusagi Mono files as copy-paste sources during the rewrite.
74
74
 
75
75
  - Rewrite from behavior/specification, not from line-by-line adaptation.
76
76
 
@@ -82,7 +82,7 @@ Before rewriting anything, follow these rules:
82
82
 
83
83
  - `kept and MIT attribution retained`
84
84
 
85
- - If a file is still PI Mono-derived after cleanup, keep MIT attribution for that file/subtree.
85
+ - If a file is still Indusagi Mono-derived after cleanup, keep MIT attribution for that file/subtree.
86
86
 
87
87
 
88
88
 
@@ -94,7 +94,7 @@ Before rewriting anything, follow these rules:
94
94
 
95
95
 
96
96
 
97
- These are the highest-risk files because they currently match PI Mono exactly.
97
+ These are the highest-risk files because they currently match Indusagi Mono exactly.
98
98
 
99
99
 
100
100
 
@@ -118,7 +118,7 @@ These are the highest-risk files because they currently match PI Mono exactly.
118
118
 
119
119
  ### P1-B. Exact vendor / asset files to replace properly
120
120
 
121
- These should not stay as copied repo assets if the goal is "PI Mono MIT-free provenance".
121
+ These should not stay as copied repo assets if the goal is "Indusagi Mono MIT-free provenance".
122
122
 
123
123
 
124
124
 
@@ -136,7 +136,7 @@ For each file above, do one of:
136
136
 
137
137
  - full independent rewrite, or
138
138
 
139
- - replace from original upstream package/source with proper direct attribution, not via PI Mono copy.
139
+ - replace from original upstream package/source with proper direct attribution, not via Indusagi Mono copy.
140
140
 
141
141
  ### P1 status update
142
142
 
@@ -308,7 +308,7 @@ These should **not** be hand-edited.
308
308
  - new control-flow shape
309
309
  - new intermediate data model
310
310
  - same behavior implemented through a different code path
311
- - vendor assets replaced from direct upstream instead of PI Mono copies
311
+ - vendor assets replaced from direct upstream instead of Indusagi Mono copies
312
312
 
313
313
 
314
314
 
@@ -410,7 +410,7 @@ These files are not byte-identical, but they share the same path and likely shar
410
410
 
411
411
  ### Why P2 is critical
412
412
 
413
- If these remain structurally PI Mono-derived, then even rewriting surface docs or utilities will not materially change provenance risk.
413
+ If these remain structurally Indusagi Mono-derived, then even rewriting surface docs or utilities will not materially change provenance risk.
414
414
 
415
415
  ### Focused P2 plan for the currently requested files
416
416
 
@@ -418,7 +418,7 @@ If these remain structurally PI Mono-derived, then even rewriting surface docs o
418
418
 
419
419
  ### Focused P2 post-rewrite recheck (approximate)
420
420
 
421
- **Method note:** the percentages below are an approximate **post-P2** recheck against `@pi-mono/packages/coding-agent/`, using a `git diff --no-index --word-diff=porcelain` unchanged-text ratio. These numbers are meant for provenance prioritization, not as a legal or plagiarism determination.
421
+ **Method note:** the percentages below are an approximate **post-P2** recheck against `@indusagi-mono/packages/coding-agent/`, using a `git diff --no-index --word-diff=porcelain` unchanged-text ratio. These numbers are meant for provenance prioritization, not as a legal or plagiarism determination.
422
422
 
423
423
  | File | Post-P2 similarity | Post-P2 difference |
424
424
  |---|---:|---:|
@@ -440,7 +440,7 @@ If these remain structurally PI Mono-derived, then even rewriting surface docs o
440
440
 
441
441
  ### Focused P2 post-rewrite takeaway
442
442
 
443
- This recheck suggests the biggest previously high-similarity P2 files have moved materially away from PI Mono structure in this batch. In particular:
443
+ This recheck suggests the biggest previously high-similarity P2 files have moved materially away from Indusagi Mono structure in this batch. In particular:
444
444
 
445
445
  - `src/core/prompt-templates.ts` moved from the earlier near-match risk zone to `30.9%` similarity / `69.1%` difference.
446
446
  - `src/core/session-manager.ts` moved from the earlier near-match risk zone to `15.2%` similarity / `84.8%` difference.
@@ -495,7 +495,7 @@ The files you called out are spread across bootstrap, CLI parsing, runtime orche
495
495
 
496
496
  **Minimal but meaningful rewrite:**
497
497
  - move MCP log suppression into named helper(s)
498
- - avoid top-level anonymous patch structure copied from PI Mono style
498
+ - avoid top-level anonymous patch structure copied from Indusagi Mono style
499
499
  - introduce a `bootstrapCli()` wrapper that owns process-title + logger patch + main invocation
500
500
 
501
501
  **Suggested rewrite shape:**
@@ -526,7 +526,7 @@ The files you called out are spread across bootstrap, CLI parsing, runtime orche
526
526
  - separate package-root detection from exported path helpers
527
527
  - centralize env var resolution and tilde expansion
528
528
  - group asset path helpers vs user config path helpers vs metadata exports
529
- - reduce structural resemblance to current PI Mono layout even if behavior stays the same
529
+ - reduce structural resemblance to current Indusagi Mono layout even if behavior stays the same
530
530
 
531
531
  **Suggested rewrite shape:**
532
532
  - `resolvePackageRoot()`
@@ -1050,7 +1050,7 @@ Validation after the P3 rewrite pass:
1050
1050
 
1051
1051
  ### Focused P3 post-rewrite recheck (approximate)
1052
1052
 
1053
- **Method note:** the percentages below are an approximate **post-P3** recheck against `@pi-mono/packages/coding-agent/`, using a `git diff --no-index --word-diff=porcelain` unchanged-text ratio. These numbers are meant for provenance prioritization, not as a legal or plagiarism determination.
1053
+ **Method note:** the percentages below are an approximate **post-P3** recheck against `@indusagi-mono/packages/coding-agent/`, using a `git diff --no-index --word-diff=porcelain` unchanged-text ratio. These numbers are meant for provenance prioritization, not as a legal or plagiarism determination.
1054
1054
 
1055
1055
  | File | Post-P3 similarity | Post-P3 difference |
1056
1056
  |---|---:|---:|
@@ -1097,7 +1097,7 @@ So unlike the focused P2 batch, the focused P3 batch is **not yet all below `40%
1097
1097
 
1098
1098
 
1099
1099
 
1100
- These files are many, but they are important because the TUI layer is highly expressive and likely to preserve PI Mono structure even after edits. Rewrite after P2/P3.
1100
+ These files are many, but they are important because the TUI layer is highly expressive and likely to preserve Indusagi Mono structure even after edits. Rewrite after P2/P3.
1101
1101
 
1102
1102
 
1103
1103
 
@@ -1680,7 +1680,7 @@ That materially changes the repository-wide overlap picture: there are no longer
1680
1680
 
1681
1681
 
1682
1682
 
1683
- These files exist in `indusagi-screth` but not in PI Mono, so they are **not immediate PI Mono overlap evidence** based on path comparison alone:
1683
+ These files exist in `indusagi-screth` but not in Indusagi Mono, so they are **not immediate Indusagi Mono overlap evidence** based on path comparison alone:
1684
1684
 
1685
1685
 
1686
1686
 
@@ -1716,7 +1716,7 @@ These files exist in `indusagi-screth` but not in PI Mono, so they are **not imm
1716
1716
 
1717
1717
 
1718
1718
 
1719
- These still deserve provenance review, but they are **not first priority** for PI Mono separation.
1719
+ These still deserve provenance review, but they are **not first priority** for Indusagi Mono separation.
1720
1720
 
1721
1721
 
1722
1722
 
@@ -1756,7 +1756,7 @@ These still deserve provenance review, but they are **not first priority** for P
1756
1756
 
1757
1757
  ## Phase 4 — Final cleanup
1758
1758
 
1759
- 8. Re-run repo comparison against PI Mono.
1759
+ 8. Re-run repo comparison against Indusagi Mono.
1760
1760
 
1761
1761
  9. Confirm there are no exact-match code files left.
1762
1762
 
@@ -1774,13 +1774,13 @@ These still deserve provenance review, but they are **not first priority** for P
1774
1774
 
1775
1775
 
1776
1776
 
1777
- You can make a much stronger statement like _"`indusagi-screth` is no longer PI Mono-derived"_ only when all of the following are true:
1777
+ You can make a much stronger statement like _"`indusagi-screth` is no longer Indusagi Mono-derived"_ only when all of the following are true:
1778
1778
 
1779
1779
 
1780
1780
 
1781
- - [ ] No exact identical PI Mono code files remain.
1781
+ - [ ] No exact identical Indusagi Mono code files remain.
1782
1782
 
1783
- - [ ] No copied PI Mono vendor assets remain unless separately sourced and attributed.
1783
+ - [ ] No copied Indusagi Mono vendor assets remain unless separately sourced and attributed.
1784
1784
 
1785
1785
  - [ ] High-risk core files have been independently rewritten.
1786
1786
 
@@ -1858,7 +1858,7 @@ These percentages are **approximate line-based estimates**, not legal determinat
1858
1858
 
1859
1859
  Method used:
1860
1860
 
1861
- - compare the PI Mono file and the `indusagi-screth` file at the same relative path
1861
+ - compare the Indusagi Mono file and the `indusagi-screth` file at the same relative path
1862
1862
 
1863
1863
  - use line counts plus `git diff --no-index --numstat` style added/deleted line counts
1864
1864