@jmanuelcorral/openteam 0.2.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/.opencode/command/openteam.md +2 -1
  2. package/.opencode/openteam.example.json +27 -8
  3. package/AGENTS.md +5 -2
  4. package/README.es.md +155 -59
  5. package/README.md +418 -62
  6. package/dist/capabilities/types.d.ts +3 -3
  7. package/dist/capabilities/types.d.ts.map +1 -1
  8. package/dist/classifier/localClassifier.d.ts +0 -2
  9. package/dist/classifier/localClassifier.d.ts.map +1 -1
  10. package/dist/cli/consoleServe.d.ts +21 -1
  11. package/dist/cli/consoleServe.d.ts.map +1 -1
  12. package/dist/cli/graphOperator.d.ts +22 -0
  13. package/dist/cli/graphOperator.d.ts.map +1 -0
  14. package/dist/cli/graphStatusSnapshot.d.ts +16 -0
  15. package/dist/cli/graphStatusSnapshot.d.ts.map +1 -0
  16. package/dist/cli/migrateAdapter.d.ts +12 -0
  17. package/dist/cli/migrateAdapter.d.ts.map +1 -0
  18. package/dist/cli/purgeAdapter.d.ts +10 -0
  19. package/dist/cli/purgeAdapter.d.ts.map +1 -0
  20. package/dist/cli/setupAdapters.d.ts.map +1 -1
  21. package/dist/cli.js +13394 -6121
  22. package/dist/commands/agents.d.ts +102 -2
  23. package/dist/commands/agents.d.ts.map +1 -1
  24. package/dist/commands/baseline.d.ts.map +1 -1
  25. package/dist/commands/clearCache.d.ts +23 -0
  26. package/dist/commands/clearCache.d.ts.map +1 -0
  27. package/dist/commands/dispatch.d.ts +196 -4
  28. package/dist/commands/dispatch.d.ts.map +1 -1
  29. package/dist/commands/doctor.d.ts +40 -0
  30. package/dist/commands/doctor.d.ts.map +1 -1
  31. package/dist/commands/frontierCatalog.d.ts +8 -14
  32. package/dist/commands/frontierCatalog.d.ts.map +1 -1
  33. package/dist/commands/graph.d.ts +0 -27
  34. package/dist/commands/graph.d.ts.map +1 -1
  35. package/dist/commands/local.d.ts.map +1 -1
  36. package/dist/commands/migrate.d.ts +11 -0
  37. package/dist/commands/migrate.d.ts.map +1 -0
  38. package/dist/commands/purge.d.ts +132 -0
  39. package/dist/commands/purge.d.ts.map +1 -0
  40. package/dist/commands/report.d.ts +1 -0
  41. package/dist/commands/report.d.ts.map +1 -1
  42. package/dist/commands/setup.d.ts +62 -5
  43. package/dist/commands/setup.d.ts.map +1 -1
  44. package/dist/config/errors.d.ts +10 -0
  45. package/dist/config/errors.d.ts.map +1 -0
  46. package/dist/config/legacyMigration.d.ts +82 -0
  47. package/dist/config/legacyMigration.d.ts.map +1 -0
  48. package/dist/config/legacyPaths.d.ts +105 -0
  49. package/dist/config/legacyPaths.d.ts.map +1 -0
  50. package/dist/config/load.d.ts.map +1 -1
  51. package/dist/config/opencode.d.ts +63 -0
  52. package/dist/config/opencode.d.ts.map +1 -0
  53. package/dist/config/persist.d.ts +8 -0
  54. package/dist/config/persist.d.ts.map +1 -1
  55. package/dist/config/resolve.d.ts +1 -1
  56. package/dist/config/resolve.d.ts.map +1 -1
  57. package/dist/config/runtime.d.ts +62 -0
  58. package/dist/config/runtime.d.ts.map +1 -0
  59. package/dist/config/schema.d.ts +142 -79
  60. package/dist/config/schema.d.ts.map +1 -1
  61. package/dist/console/assets.d.ts +2 -2
  62. package/dist/console/assets.d.ts.map +1 -1
  63. package/dist/console/configView.d.ts +74 -0
  64. package/dist/console/configView.d.ts.map +1 -0
  65. package/dist/console/opencodeClient.d.ts +8 -6
  66. package/dist/console/opencodeClient.d.ts.map +1 -1
  67. package/dist/console/protocol.d.ts +30 -6
  68. package/dist/console/protocol.d.ts.map +1 -1
  69. package/dist/console/render.d.ts +30 -1
  70. package/dist/console/render.d.ts.map +1 -1
  71. package/dist/console/types.d.ts +1 -1
  72. package/dist/console/types.d.ts.map +1 -1
  73. package/dist/context/redaction.d.ts +19 -19
  74. package/dist/context/redaction.d.ts.map +1 -1
  75. package/dist/context/schema.d.ts +26 -26
  76. package/dist/context/schema.d.ts.map +1 -1
  77. package/dist/context/types.d.ts +3 -3
  78. package/dist/contract/opencode.d.ts +39 -23
  79. package/dist/contract/opencode.d.ts.map +1 -1
  80. package/dist/graph/certificate.d.ts +37 -16
  81. package/dist/graph/certificate.d.ts.map +1 -1
  82. package/dist/graph/langgraph/adapter.d.ts +56 -0
  83. package/dist/graph/langgraph/adapter.d.ts.map +1 -0
  84. package/dist/graph/langgraph/certification.d.ts +64 -0
  85. package/dist/graph/langgraph/certification.d.ts.map +1 -0
  86. package/dist/graph/langgraph/checkpointReplay.d.ts +49 -0
  87. package/dist/graph/langgraph/checkpointReplay.d.ts.map +1 -0
  88. package/dist/graph/langgraph/checkpointer.d.ts +49 -0
  89. package/dist/graph/langgraph/checkpointer.d.ts.map +1 -0
  90. package/dist/graph/langgraph/engine.d.ts +34 -0
  91. package/dist/graph/langgraph/engine.d.ts.map +1 -0
  92. package/dist/graph/langgraph/graphModel.d.ts +37 -0
  93. package/dist/graph/langgraph/graphModel.d.ts.map +1 -0
  94. package/dist/graph/langgraph/reducer.d.ts +18 -0
  95. package/dist/graph/langgraph/reducer.d.ts.map +1 -0
  96. package/dist/graph/langgraph/retirement.d.ts +59 -0
  97. package/dist/graph/langgraph/retirement.d.ts.map +1 -0
  98. package/dist/graph/langgraph/types.d.ts +65 -0
  99. package/dist/graph/langgraph/types.d.ts.map +1 -0
  100. package/dist/graph/privacyPolicy.d.ts +7 -0
  101. package/dist/graph/privacyPolicy.d.ts.map +1 -1
  102. package/dist/graph/soakLedger.d.ts.map +1 -1
  103. package/dist/graph/types.d.ts +0 -2
  104. package/dist/graph/types.d.ts.map +1 -1
  105. package/dist/index.d.ts +46 -15
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +11083 -5009
  108. package/dist/local/cacheAdapter.d.ts +7 -0
  109. package/dist/local/cacheAdapter.d.ts.map +1 -0
  110. package/dist/local/concurrency.d.ts +52 -0
  111. package/dist/local/concurrency.d.ts.map +1 -0
  112. package/dist/local/embeddings.d.ts +10 -10
  113. package/dist/local/embeddings.d.ts.map +1 -1
  114. package/dist/local/extractClient.d.ts +13 -10
  115. package/dist/local/extractClient.d.ts.map +1 -1
  116. package/dist/local/lemonade.d.ts +4 -0
  117. package/dist/local/lemonade.d.ts.map +1 -0
  118. package/dist/local/registry.d.ts +16 -0
  119. package/dist/local/registry.d.ts.map +1 -1
  120. package/dist/local/types.d.ts +1 -1
  121. package/dist/local/types.d.ts.map +1 -1
  122. package/dist/mcp/semanticRecall.d.ts +18 -1
  123. package/dist/mcp/semanticRecall.d.ts.map +1 -1
  124. package/dist/mcp/server.d.ts +41 -1
  125. package/dist/mcp/server.d.ts.map +1 -1
  126. package/dist/memory/embedText.d.ts +4 -0
  127. package/dist/memory/embedText.d.ts.map +1 -0
  128. package/dist/memory/extract.d.ts +33 -18
  129. package/dist/memory/extract.d.ts.map +1 -1
  130. package/dist/memory/fold.d.ts +3 -2
  131. package/dist/memory/fold.d.ts.map +1 -1
  132. package/dist/memory/index.d.ts +1 -0
  133. package/dist/memory/index.d.ts.map +1 -1
  134. package/dist/memory/inject.d.ts.map +1 -1
  135. package/dist/memory/log.d.ts +15 -4
  136. package/dist/memory/log.d.ts.map +1 -1
  137. package/dist/memory/merge.d.ts +18 -1
  138. package/dist/memory/merge.d.ts.map +1 -1
  139. package/dist/memory/traverse.d.ts +80 -0
  140. package/dist/memory/traverse.d.ts.map +1 -0
  141. package/dist/memory/types.d.ts +53 -7
  142. package/dist/memory/types.d.ts.map +1 -1
  143. package/dist/messages/commands.d.ts +84 -0
  144. package/dist/messages/commands.d.ts.map +1 -0
  145. package/dist/messages/index.d.ts +46 -0
  146. package/dist/messages/index.d.ts.map +1 -0
  147. package/dist/opencodeArtifacts/index.d.ts +33 -0
  148. package/dist/opencodeArtifacts/index.d.ts.map +1 -0
  149. package/dist/opencodeArtifacts/orchestratorAgent.d.ts +29 -0
  150. package/dist/opencodeArtifacts/orchestratorAgent.d.ts.map +1 -0
  151. package/dist/opencodeArtifacts/slashCommand.d.ts +31 -0
  152. package/dist/opencodeArtifacts/slashCommand.d.ts.map +1 -0
  153. package/dist/orchestrator/coordinator.d.ts +152 -1
  154. package/dist/orchestrator/coordinator.d.ts.map +1 -1
  155. package/dist/orchestrator/graphCancellation.d.ts +40 -37
  156. package/dist/orchestrator/graphCancellation.d.ts.map +1 -1
  157. package/dist/orchestrator/graphEffects.d.ts +24 -24
  158. package/dist/orchestrator/graphEffects.d.ts.map +1 -1
  159. package/dist/orchestrator/graphFacade.d.ts +16 -16
  160. package/dist/orchestrator/graphFacade.d.ts.map +1 -1
  161. package/dist/orchestrator/graphIngress.d.ts +49 -45
  162. package/dist/orchestrator/graphIngress.d.ts.map +1 -1
  163. package/dist/orchestrator/graphReview.d.ts +24 -23
  164. package/dist/orchestrator/graphReview.d.ts.map +1 -1
  165. package/dist/orchestrator/graphRuntime.d.ts +27 -26
  166. package/dist/orchestrator/graphRuntime.d.ts.map +1 -1
  167. package/dist/orchestrator/graphShadow.d.ts +70 -69
  168. package/dist/orchestrator/graphShadow.d.ts.map +1 -1
  169. package/dist/orchestrator/opencodeSessionAdapter.d.ts +25 -25
  170. package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -1
  171. package/dist/orchestrator/permissions.d.ts.map +1 -1
  172. package/dist/orchestrator/ralphLoop.d.ts +57 -0
  173. package/dist/orchestrator/ralphLoop.d.ts.map +1 -0
  174. package/dist/orchestrator/roles.d.ts +50 -8
  175. package/dist/orchestrator/roles.d.ts.map +1 -1
  176. package/dist/orchestrator/roster.d.ts +103 -0
  177. package/dist/orchestrator/roster.d.ts.map +1 -0
  178. package/dist/orchestrator/rosterPersistence.d.ts +22 -0
  179. package/dist/orchestrator/rosterPersistence.d.ts.map +1 -0
  180. package/dist/orchestrator/runtimeSelection.d.ts +46 -0
  181. package/dist/orchestrator/runtimeSelection.d.ts.map +1 -0
  182. package/dist/orchestrator/sddCompiler.d.ts +34 -34
  183. package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
  184. package/dist/orchestrator/sessionReconciler.d.ts +31 -29
  185. package/dist/orchestrator/sessionReconciler.d.ts.map +1 -1
  186. package/dist/orchestrator/shadowComparator.d.ts +23 -23
  187. package/dist/orchestrator/shadowComparator.d.ts.map +1 -1
  188. package/dist/orchestrator/subsessions.d.ts.map +1 -1
  189. package/dist/orchestrator/worktreeAdapter.d.ts +12 -12
  190. package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -1
  191. package/dist/orchestrator/worktreeDispatch.d.ts +34 -34
  192. package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -1
  193. package/dist/orchestrator/worktreeReconciler.d.ts +37 -36
  194. package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -1
  195. package/dist/plugin/availability.d.ts.map +1 -1
  196. package/dist/plugin/capture.d.ts +12 -12
  197. package/dist/plugin/capture.d.ts.map +1 -1
  198. package/dist/plugin/commandTool.d.ts +1 -1
  199. package/dist/plugin/commandTool.d.ts.map +1 -1
  200. package/dist/plugin/graphShadowIngress.d.ts +50 -48
  201. package/dist/plugin/graphShadowIngress.d.ts.map +1 -1
  202. package/dist/plugin/graphTool.d.ts +25 -23
  203. package/dist/plugin/graphTool.d.ts.map +1 -1
  204. package/dist/plugin/hooks.d.ts +10 -10
  205. package/dist/plugin/hooks.d.ts.map +1 -1
  206. package/dist/plugin/legacyRunProducer.d.ts +22 -22
  207. package/dist/plugin/legacyRunProducer.d.ts.map +1 -1
  208. package/dist/plugin/memoryInject.d.ts +6 -6
  209. package/dist/plugin/memoryInject.d.ts.map +1 -1
  210. package/dist/plugin/memoryTool.d.ts +36 -0
  211. package/dist/plugin/memoryTool.d.ts.map +1 -0
  212. package/dist/plugin/orchestrateTool.d.ts +35 -2
  213. package/dist/plugin/orchestrateTool.d.ts.map +1 -1
  214. package/dist/plugin/reportRunSchema.d.ts +8 -8
  215. package/dist/plugin/reportRunSchema.d.ts.map +1 -1
  216. package/dist/plugin/sessionTracker.d.ts +15 -15
  217. package/dist/plugin/sessionTracker.d.ts.map +1 -1
  218. package/dist/plugin/shadowPipeline.d.ts +2 -1
  219. package/dist/plugin/shadowPipeline.d.ts.map +1 -1
  220. package/dist/plugin/soakObserver.d.ts +18 -11
  221. package/dist/plugin/soakObserver.d.ts.map +1 -1
  222. package/dist/plugin/toolcalls.d.ts +3 -3
  223. package/dist/router/chooseModel.d.ts.map +1 -1
  224. package/dist/router/frontierBaseline.d.ts +3 -3
  225. package/dist/router/modelSelection.d.ts +12 -4
  226. package/dist/router/modelSelection.d.ts.map +1 -1
  227. package/dist/router/types.d.ts +6 -1
  228. package/dist/router/types.d.ts.map +1 -1
  229. package/dist/storage/graph/snapshot.d.ts.map +1 -1
  230. package/dist/storage/graph/soakRecorder.d.ts +14 -1
  231. package/dist/storage/graph/soakRecorder.d.ts.map +1 -1
  232. package/dist/storage/graph/workspaceLease.d.ts +1 -1
  233. package/dist/storage/graph/workspaceLease.d.ts.map +1 -1
  234. package/dist/storage/graph/worktreeRegistry.d.ts +1 -1
  235. package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -1
  236. package/dist/storage/httpStorageProvider.d.ts +2 -2
  237. package/dist/storage/index/bunSqlite.d.ts +1 -0
  238. package/dist/storage/index/bunSqlite.d.ts.map +1 -1
  239. package/dist/storage/index/memoryConsolidate.d.ts +2 -0
  240. package/dist/storage/index/memoryConsolidate.d.ts.map +1 -1
  241. package/dist/storage/index/memoryEmbeddings.d.ts +51 -0
  242. package/dist/storage/index/memoryEmbeddings.d.ts.map +1 -0
  243. package/dist/storage/index/memoryIndex.d.ts +36 -4
  244. package/dist/storage/index/memoryIndex.d.ts.map +1 -1
  245. package/dist/storage/index/memoryRecall.d.ts +1 -1
  246. package/dist/storage/index/memoryRecall.d.ts.map +1 -1
  247. package/dist/storage/index/memoryRuntime.d.ts +2 -0
  248. package/dist/storage/index/memoryRuntime.d.ts.map +1 -1
  249. package/dist/storage/index/sqliteIndex.d.ts +18 -1
  250. package/dist/storage/index/sqliteIndex.d.ts.map +1 -1
  251. package/dist/storage/path.d.ts.map +1 -1
  252. package/dist/telemetry/aggregate.d.ts +12 -12
  253. package/dist/telemetry/aggregate.d.ts.map +1 -1
  254. package/dist/telemetry/cost.d.ts.map +1 -1
  255. package/dist/telemetry/decisions.d.ts +11 -11
  256. package/dist/telemetry/decisions.d.ts.map +1 -1
  257. package/dist/telemetry/eventLog.d.ts +41 -25
  258. package/dist/telemetry/eventLog.d.ts.map +1 -1
  259. package/dist/telemetry/events.d.ts +44 -36
  260. package/dist/telemetry/events.d.ts.map +1 -1
  261. package/dist/telemetry/fanout.d.ts +18 -0
  262. package/dist/telemetry/fanout.d.ts.map +1 -0
  263. package/dist/telemetry/graphProjection.d.ts +12 -12
  264. package/dist/telemetry/graphProjection.d.ts.map +1 -1
  265. package/dist/telemetry/graphRuntimeHealth.d.ts +26 -26
  266. package/dist/telemetry/graphRuntimeHealth.d.ts.map +1 -1
  267. package/dist/telemetry/graphView.d.ts +20 -20
  268. package/dist/telemetry/graphView.d.ts.map +1 -1
  269. package/dist/telemetry/otel.d.ts +86 -0
  270. package/dist/telemetry/otel.d.ts.map +1 -0
  271. package/dist/telemetry/otelConfig.d.ts +128 -0
  272. package/dist/telemetry/otelConfig.d.ts.map +1 -0
  273. package/dist/telemetry/otelExporter.d.ts +7 -0
  274. package/dist/telemetry/otelExporter.d.ts.map +1 -0
  275. package/dist/telemetry/read.d.ts +18 -4
  276. package/dist/telemetry/read.d.ts.map +1 -1
  277. package/dist/telemetry/types.d.ts +3 -2
  278. package/dist/telemetry/types.d.ts.map +1 -1
  279. package/dist/web/configApi.d.ts +154 -0
  280. package/dist/web/configApi.d.ts.map +1 -0
  281. package/dist/web/configRoute.d.ts +57 -0
  282. package/dist/web/configRoute.d.ts.map +1 -0
  283. package/dist/web/console.d.ts +8 -0
  284. package/dist/web/console.d.ts.map +1 -1
  285. package/dist/web/paths.d.ts +4 -3
  286. package/dist/web/paths.d.ts.map +1 -1
  287. package/dist/web/server.d.ts +30 -1
  288. package/dist/web/server.d.ts.map +1 -1
  289. package/dist/web/start.d.ts +15 -0
  290. package/dist/web/start.d.ts.map +1 -1
  291. package/dist/web/storageRoute.d.ts +2 -2
  292. package/package.json +13 -7
  293. package/dist/cli/tunnel.d.ts +0 -89
  294. package/dist/cli/tunnel.d.ts.map +0 -1
  295. package/dist/commands/orchestratorAgent.d.ts +0 -30
  296. package/dist/commands/orchestratorAgent.d.ts.map +0 -1
  297. package/dist/commands/slashCommand.d.ts +0 -39
  298. package/dist/commands/slashCommand.d.ts.map +0 -1
  299. package/dist/orchestrator/ledger.d.ts +0 -28
  300. package/dist/orchestrator/ledger.d.ts.map +0 -1
  301. package/dist/storage/graph/importLegacy.d.ts +0 -62
  302. package/dist/storage/graph/importLegacy.d.ts.map +0 -1
  303. package/dist/storage/graph/migration.d.ts +0 -91
  304. package/dist/storage/graph/migration.d.ts.map +0 -1
  305. package/dist/storage/graph/projections.d.ts +0 -31
  306. package/dist/storage/graph/projections.d.ts.map +0 -1
@@ -0,0 +1,154 @@
1
+ import { type OpenTeamConfig } from "../config/schema";
2
+ import type { StorageProvider } from "../storage/provider";
3
+ /**
4
+ * Machine-specific key paths. Edits to these are routed to the ignored local
5
+ * overlay instead of the committed base, so saving in the console never pushes a
6
+ * value that would be wrong on a teammate's machine (P16, #197). `local.runtimes`
7
+ * is listed as the whole array because arrays replace wholesale on merge — the
8
+ * documented caveat is that overriding one runtime's `baseURL` restates the
9
+ * entire array.
10
+ */
11
+ export declare const MACHINE_SPECIFIC_KEYS: readonly ["local.runtimes", "console.host", "console.port"];
12
+ /**
13
+ * Keys the console process can serve fresh through a config getter WITHOUT a
14
+ * restart (P14 hybrid, hot half). Deliberately conservative: only
15
+ * `console.refreshMs` is read per-request by the renderer, so it is the one key
16
+ * the console genuinely applies live. Every other key is consumed by the
17
+ * opencode plugin session, which froze config at load and therefore needs a
18
+ * restart — reporting them as live would be the exact silent no-op the P14
19
+ * decision forbids.
20
+ */
21
+ export declare const HOT_RELOADABLE_KEYS: readonly ["console.refreshMs"];
22
+ /**
23
+ * Env-sourced secret descriptors (P8b). The value is NEVER read into any
24
+ * response — only its presence is reported, marked "set via environment".
25
+ */
26
+ export declare const KNOWN_ENV_SECRETS: readonly [{
27
+ readonly key: "telemetry.connectionString";
28
+ readonly envVar: "APPLICATIONINSIGHTS_CONNECTION_STRING";
29
+ readonly label: "Application Insights connection string";
30
+ }];
31
+ export declare const SET_VIA_ENVIRONMENT: "set via environment";
32
+ export declare function isMachineSpecificPath(path: string): boolean;
33
+ export declare function isHotReloadablePath(path: string): boolean;
34
+ /**
35
+ * Collect changed leaf paths comparing `next` against `prev`. Objects recurse;
36
+ * arrays and scalars are compared as a whole (the path stops at the array key),
37
+ * matching the merge semantics where arrays replace wholesale.
38
+ */
39
+ export declare function diffConfigLeaves(prev: unknown, next: unknown, base?: string): string[];
40
+ /** One audited config-write entry: the path plus a content-free descriptor. */
41
+ export type ConfigAuditEntry = {
42
+ readonly path: string;
43
+ readonly valueHash?: string;
44
+ readonly chars?: number;
45
+ readonly value?: number | boolean | null;
46
+ };
47
+ export type ConfigAuditRecord = {
48
+ readonly ts: string;
49
+ readonly kind: "config.write";
50
+ readonly changed: readonly string[];
51
+ readonly entries: readonly ConfigAuditEntry[];
52
+ readonly wroteBase: boolean;
53
+ readonly wroteOverlay: boolean;
54
+ };
55
+ /**
56
+ * Describe a changed value for the audit trail WITHOUT leaking its content.
57
+ * Strings and structured values are stored as a hash plus character count;
58
+ * only non-string scalars (numbers, booleans, null) are recorded verbatim,
59
+ * because they can never carry a prompt body. This mirrors telemetry's stance:
60
+ * hash, never raw.
61
+ */
62
+ export declare function auditValue(value: unknown): Omit<ConfigAuditEntry, "path">;
63
+ /**
64
+ * Defensive scrub: replace any string that carries a known env-secret value with
65
+ * a redaction marker. The committed schema is already secret-free, so this never
66
+ * fires on a real config; it is belt-and-suspenders that guarantees a secret can
67
+ * never round-trip through the read endpoint even if one ever leaked into config.
68
+ */
69
+ export declare function scrubSecretStrings(value: unknown, secrets: readonly string[]): unknown;
70
+ export type ConfigSecretDescriptor = {
71
+ readonly key: string;
72
+ readonly source: typeof SET_VIA_ENVIRONMENT;
73
+ readonly set: boolean;
74
+ };
75
+ export type ConfigReadResult = {
76
+ readonly config: OpenTeamConfig;
77
+ readonly reload: {
78
+ readonly hotReloadable: readonly string[];
79
+ readonly restartRequired: readonly string[];
80
+ };
81
+ readonly overlay: {
82
+ readonly active: boolean;
83
+ readonly machineSpecificKeys: readonly string[];
84
+ };
85
+ readonly secrets: readonly ConfigSecretDescriptor[];
86
+ };
87
+ export type ConfigWriteResult = {
88
+ readonly status: 200;
89
+ readonly body: {
90
+ readonly ok: true;
91
+ readonly changed: readonly string[];
92
+ readonly applied: readonly string[];
93
+ readonly pendingRestart: readonly string[];
94
+ readonly wroteBase: boolean;
95
+ readonly wroteOverlay: boolean;
96
+ };
97
+ } | {
98
+ readonly status: 400;
99
+ readonly body: {
100
+ readonly ok: false;
101
+ readonly error: string;
102
+ };
103
+ };
104
+ export type ConfigEditorPorts = {
105
+ storage: StorageProvider;
106
+ basePath?: string;
107
+ overlayPath?: string;
108
+ /** Reads an environment variable; injected so the read side is deterministic. */
109
+ env?: (name: string) => string | undefined;
110
+ /** Audit sink; every persisted write appends one content-free record. */
111
+ audit?: (record: ConfigAuditRecord) => void | Promise<void>;
112
+ /** Clock for the audit timestamp; injected for determinism. */
113
+ now?: () => string;
114
+ /**
115
+ * Fires after a write persists at least one change, so the composition root
116
+ * can reload the live config getter (P14 hybrid). Optional.
117
+ */
118
+ onPersisted?: () => void | Promise<void>;
119
+ };
120
+ /**
121
+ * Default machine-local audit log for console config writes. Content-free
122
+ * (paths + hashes, never a raw value) and git-ignored, so it never leaves the
123
+ * developer's machine and never lands in committed history.
124
+ */
125
+ export declare const DEFAULT_CONFIG_AUDIT_PATH = ".opencode/openteam-local/config-audit.jsonl";
126
+ /**
127
+ * The editor's editable surface (W7-S16 / #200). The console edits the openteam
128
+ * config object only. "System prompt" is the body of an agent Markdown file
129
+ * under `.opencode/agent/*.md`, not a config field; "harness" and "skills" have
130
+ * no openteam representation. The editor therefore mounts NO systemPrompt /
131
+ * harness / skills sub-tab, so it never claims to edit a field that does not
132
+ * exist.
133
+ */
134
+ export type EditableArtifact = {
135
+ readonly id: string;
136
+ readonly kind: "openteam-config" | "agent-markdown";
137
+ readonly validated: boolean;
138
+ readonly mvp: boolean;
139
+ };
140
+ export declare function editableSurface(): readonly EditableArtifact[];
141
+ export declare function createConfigEditor(ports: ConfigEditorPorts): {
142
+ editableSurface: typeof editableSurface;
143
+ read(): Promise<ConfigReadResult>;
144
+ write(submittedRaw: unknown): Promise<ConfigWriteResult>;
145
+ };
146
+ export type ConfigEditor = ReturnType<typeof createConfigEditor>;
147
+ /**
148
+ * Restart-required top-level keys surfaced by the read endpoint. Behaviourally
149
+ * significant keys consumed by the opencode plugin session, which reads config
150
+ * once at load. Kept beside `HOT_RELOADABLE_KEYS` as the single classification
151
+ * source of truth (#193).
152
+ */
153
+ export declare const RESTART_REQUIRED_KEYS: readonly ["baseline", "router", "local", "privacyMode", "graph", "orchestrator", "memory", "console.host", "console.port"];
154
+ //# sourceMappingURL=configApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configApi.d.ts","sourceRoot":"","sources":["../../src/web/configApi.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA6B3D;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YAChC,gBAAgB,EAChB,cAAc,EACd,cAAc,CACN,CAAC;AAEX;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,YAAI,mBAAmB,CAAU,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,iBAAiB;aAE1B,GAAG,EAAE,4BAA4B;aACjC,MAAM,EAAE,uCAAuC;aAC/C,KAAK,EAAE,wCAAwC;EAEzC,CAAC;AAEX,eA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/**
4
+ * HTTP routes for the console config editor: `GET /api/config` (read, redacted)
5
+ * and `POST /api/config` (write, validated). Both require the per-launch
6
+ * ephemeral token — config is more sensitive than the read-only dashboard, so it
7
+ * is token-gated even on pure loopback (a strict hardening, never a relaxation).
8
+ *
9
+ * Mutations are additionally CSRF-safe (W7-S06 / #190): the token is accepted
10
+ * ONLY in the `Authorization: Bearer` header (never `?token=`), cross-origin
11
+ * requests are rejected by `Origin`/`Sec-Fetch-Site`, and no ambient cookie auth
12
+ * exists. The surface is loopback-only (W7-S07 / #191): `console.host` cannot
13
+ * widen past `ConsoleHostSchema`, enforced by the write validator.
14
+ */
15
+ export type ConfigRouteDeps = {
16
+ token: string;
17
+ editor: Pick<ConfigEditor, "read" | "write">;
18
+ };
19
+ /**
20
+ * A mutation is CSRF-safe only when it is same-origin. Any `Origin` whose host
21
+ * is not loopback is cross-origin and rejected. A missing `Origin`
22
+ * (same-origin navigations, non-browser clients) is allowed, but the bearer
23
+ * token is still required separately.
24
+ */
25
+ export declare function isCrossOriginMutation(request: IncomingMessage): boolean;
26
+ /**
27
+ * Routes `/api/config`. Returns `true` when it handled (and answered) the
28
+ * request, `false` so the server continues with its other routes.
29
+ */
30
+ export declare function handleConfigRoute(request: IncomingMessage, response: ServerResponse, url: URL, deps: ConfigRouteDeps): Promise<boolean>;
31
+ /** A synthetic or real opencode watcher event, narrowed to the fields we read. */
32
+ export type ConfigChangeEvent = {
33
+ readonly type?: string;
34
+ readonly properties?: {
35
+ readonly event?: string;
36
+ readonly file?: string;
37
+ };
38
+ };
39
+ /**
40
+ * P14 hybrid reload (hot half). Holds a mutable config reference behind a getter
41
+ * and re-runs `load` when a `file.watcher.updated` `change` event names the
42
+ * config path. The console renderer consults `current()` per request, so a
43
+ * hot-reloadable key (`console.refreshMs`) is served fresh WITHOUT a restart; the
44
+ * `file.watcher.updated` firing for an external write is verified at integration
45
+ * time (it needs a live opencode process), with `watchSources` on the config
46
+ * path as the deterministic fallback.
47
+ */
48
+ export declare function createConfigReloader<T>(deps: {
49
+ initial: T;
50
+ load: () => Promise<T>;
51
+ configPath: string;
52
+ }): {
53
+ current: () => T;
54
+ reload: () => Promise<T>;
55
+ handleEvent: (event: ConfigChangeEvent) => Promise<boolean>;
56
+ };
57
+ //# sourceMappingURL=configRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configRoute.d.ts","sourceRoot":"","sources":["../../src/web/configRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAOjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;CAC9C,CAAC;AA0CF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAcvE;AAiCD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,OAAO,CAAC,CAmElB;AAED,kFAAkF;AAClF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE;QACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,IAAI,EAAE;IAC5C,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG;IACF,OAAO,EAAE,MAAM,CAAC,CAAC;IACjB,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACzB,WAAW,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7D,CAwBA"}
@@ -18,6 +18,14 @@ export type ConsoleRouteDeps = {
18
18
  drilldownEnabled?: boolean;
19
19
  /** Habilita la vista "Terminal" (PTY real, Fase 5). Opt-in. */
20
20
  ptyEnabled?: boolean;
21
+ /**
22
+ * Habilita el **modo diagnóstico local** (P11b): opt-in del operador para que
23
+ * las rutas de lectura (`stream`, `messages`) puedan servir texto verbatim en
24
+ * lugar de la referencia redactada por defecto. Requiere además `?diagnostic=1`
25
+ * en la petición. Off por defecto: sin esta bandera el contenido va redactado
26
+ * aunque la petición pida diagnóstico. Nunca debilita el token ni el loopback.
27
+ */
28
+ diagnosticEnabled?: boolean;
21
29
  /** Resuelve el origen del servidor opencode de una sesión (o `undefined`). */
22
30
  resolveEndpoint: (sessionID: string) => Promise<string | undefined>;
23
31
  /** Crea un cliente opencode para un endpoint (inyectable en tests). */
@@ -1 +1 @@
1
- {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/web/console.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC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S,CAAC;CACnD,CAAC;AAiPF;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,OAAO,CAAC,CA4DlB"}
@@ -1,4 +1,5 @@
1
- /** Rutas por defecto de las fuentes que alimentan el console. */
2
- export declare const DEFAULT_BACKLOG_PATH = ".opencode/openteam-backlog.md";
3
- export declare const DEFAULT_DECISIONS_PATH = ".opencode/openteam-decisions.md";
1
+ /** Rutas por defecto de las fuentes que alimentan el console.
2
+ * Portable team-state (P15b): committed under `.opencode/openteam/`. */
3
+ export declare const DEFAULT_BACKLOG_PATH = ".opencode/openteam/backlog.md";
4
+ export declare const DEFAULT_DECISIONS_PATH = ".opencode/openteam/decisions.md";
4
5
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/web/paths.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;AACpE,eAAO,MAAM,sBAAsB,oCAAoC,CAAC"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/web/paths.ts"],"names":[],"mappings":"AAAA;wEACwE;AACxE,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;AACpE,eAAO,MAAM,sBAAsB,oCAAoC,CAAC"}
@@ -4,11 +4,24 @@ import type { ConsoleClient } from "../console/opencodeClient";
4
4
  import type { PtyClient } from "../console/pty";
5
5
  import type { ConsoleInputs } from "../console/state";
6
6
  import type { GraphViewProjectionV1 } from "../telemetry/graphView";
7
+ import { type ConfigRouteDeps } from "./configRoute";
7
8
  import { type StorageRouteDeps } from "./storageRoute";
8
9
  export type ConsoleServerDeps = {
9
10
  /** Relee las fuentes y produce los inputs crudos del console. */
10
11
  readSnapshot: () => Promise<ConsoleInputs>;
11
12
  config: ConsoleConfig;
13
+ /**
14
+ * Live console-config getter (P14 hybrid, hot half). When provided, the
15
+ * renderer reads hot-reloadable presentation keys (`console.refreshMs`) from
16
+ * this getter instead of the frozen `config`, so a reloaded value is served
17
+ * fresh without a restart. Absent → behaviour is identical to today.
18
+ */
19
+ getConsoleConfig?: () => ConsoleConfig;
20
+ /**
21
+ * Config editor surface (`/api/config`, read + write). Opt-in: without it the
22
+ * console exposes no config endpoint. Token-gated even on loopback.
23
+ */
24
+ configApi?: ConfigRouteDeps;
12
25
  /** Inyectable para tests; por defecto el `createServer` de `node:http`. */
13
26
  createServer?: typeof createHttpServer;
14
27
  /** Logger (por defecto `console`). */
@@ -26,12 +39,18 @@ export type ConsoleServerDeps = {
26
39
  drilldownEnabled?: boolean;
27
40
  /** Habilita la vista "Terminal" (PTY real, Fase 5). Opt-in. */
28
41
  ptyEnabled?: boolean;
42
+ /**
43
+ * Habilita el **modo diagnóstico local** (P11b): opt-in del operador para que
44
+ * el drill-down sirva texto verbatim en vez de la referencia redactada por
45
+ * defecto (requiere además `?diagnostic=1` en la petición). Off por defecto.
46
+ */
47
+ diagnosticEnabled?: boolean;
29
48
  createClient: (endpoint: string) => ConsoleClient;
30
49
  createPtyClient?: (endpoint: string) => PtyClient;
31
50
  };
32
51
  /**
33
52
  * Endpoint remoto de storage (`/storage/*`). Opcional y opt-in: expone el
34
- * estado del equipo autenticado con token para una Console remota vía tunnel.
53
+ * estado del equipo autenticado con token para una Console remota.
35
54
  */
36
55
  storageApi?: StorageRouteDeps;
37
56
  /**
@@ -43,6 +62,16 @@ export type ConsoleServerDeps = {
43
62
  graphApi?: {
44
63
  readView: () => Promise<GraphViewProjectionV1 | null>;
45
64
  };
65
+ /**
66
+ * `true` when the operator enabled the console agent-tree view
67
+ * (`console.graphView.enabled`) but the graph engine is off (`graph.mode` ==
68
+ * "off"), so no `graphApi` provider is wired. The shell still mounts the
69
+ * agent-tree tab and renders the `graph.mode` remediation hint instead of a
70
+ * bare-missing tab (PRD W7 acceptance #9). `/api/graph` and the SSE `graph`
71
+ * frame stay absent because they follow `graphApi`. Absent/`false` → behaviour
72
+ * is identical to today.
73
+ */
74
+ graphDisabled?: boolean;
46
75
  };
47
76
  export type ConsoleServer = {
48
77
  url: string;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,gBAAgB,EAIjC,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAOpE,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAW3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,iEAAiE;IACjE,YAAY,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3C,MAAM,EAAE,aAAa,CAAC;IACtB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,gBAAgB,CAAC;IACvC,sCAAsC;IACtC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,8EAA8E;IAC9E,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,eAAe,EAAE,OAAO,CAAC;QACzB;;;;;WAKG;QACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,+DAA+D;QAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,aAAa,CAAC;QAClD,eAAe,CAAC,EAAE,CAAC,QAAQ,E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ionV1 } from "../telemetry/graphView";
9
9
  import type { StorageRouteDeps } from "./storageRoute";
10
10
  export type ConsoleRuntimeDeps = {
11
11
  config: ConsoleConfig;
12
+ /**
13
+ * Live console-config getter (P14 hybrid). Passed through to the server so the
14
+ * renderer serves hot-reloadable keys fresh. Optional.
15
+ */
16
+ getConsoleConfig?: () => ConsoleConfig;
17
+ /**
18
+ * Config editor surface (`/api/config`). Optional and opt-in.
19
+ */
20
+ configApi?: import("./configRoute").ConfigRouteDeps;
21
+ /**
22
+ * Path of the tracked config file. When provided it is added to the watched
23
+ * set so an external edit triggers a debounced console refresh (P14 hybrid,
24
+ * cross-process fallback). Optional.
25
+ */
26
+ configPath?: string;
12
27
  /** Directorio de logs de sesión (`sessions/*.jsonl`). */
13
28
  sessionsDir: string;
14
29
  agentDir: string;
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/web/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAIpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EA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AI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,cAAc,CAAC,CAEzB"}
@@ -2,8 +2,8 @@ import type { IncomingMessage, ServerResponse } from "node:http";
2
2
  import type { StorageProvider } from "../storage/provider";
3
3
  /**
4
4
  * Endpoint HTTP que expone un `StorageProvider` sobre la red (§ Fase 4). Permite
5
- * que una Console/sesión remota lea el estado del equipo a través del tunnel ya
6
- * existente, reutilizando el token efímero de la Console.
5
+ * que una Console/sesión remota lea el estado del equipo por HTTP,
6
+ * reutilizando el token efímero de la Console.
7
7
  *
8
8
  * Seguridad:
9
9
  * - Exige el token (bearer `Authorization` o `?token=`), como el resto de la
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmanuelcorral/openteam",
3
- "version": "0.2.2",
3
+ "version": "0.9.0",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
6
6
  "license": "MIT",
@@ -60,14 +60,14 @@
60
60
  "scripts": {
61
61
  "prebuild": "bun run clean",
62
62
  "build": "bun run build:js && bun run build:cli && bun run build:types",
63
- "build:js": "bun build ./src/index.ts --target=node --format=esm --outfile=dist/index.js --external @opencode-ai/plugin --external @opencode-ai/sdk --external zod",
64
- "build:cli": "bun build ./src/cli.ts --target=node --format=esm --outfile=dist/cli.js --banner \"#!/usr/bin/env node\" --external @opencode-ai/plugin --external @opencode-ai/sdk --external zod --external @clack/prompts",
63
+ "build:js": "bun build ./src/index.ts --target=node --format=esm --outfile=dist/index.js --external @opencode-ai/plugin --external @opencode-ai/sdk --external zod --external @opentelemetry/api --external @opentelemetry/sdk-trace-base --external @opentelemetry/exporter-trace-otlp-http --external @opentelemetry/resources --external @langchain/langgraph",
64
+ "build:cli": "bun build ./src/cli.ts --target=node --format=esm --outfile=dist/cli.js --banner \"#!/usr/bin/env node\" --external @opencode-ai/plugin --external @opencode-ai/sdk --external zod --external @clack/prompts --external @opentelemetry/api --external @opentelemetry/sdk-trace-base --external @opentelemetry/exporter-trace-otlp-http --external @opentelemetry/resources --external @langchain/langgraph",
65
65
  "build:types": "tsc -p tsconfig.build.json",
66
66
  "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
67
67
  "test": "bun test",
68
68
  "test:cov": "bun test --coverage",
69
- "certify:shadow": "bun test tests/certification/graph-shadow.test.ts",
70
- "certify:release": "bun test tests/certification/graph-release.test.ts",
69
+ "certify:shadow": "bun run scripts/certify-artifact.ts shadow",
70
+ "certify:release": "bun run scripts/certify-artifact.ts release",
71
71
  "coverage:check": "node scripts/check-coverage.mjs",
72
72
  "typecheck": "tsc --noEmit",
73
73
  "lint": "biome check .",
@@ -82,8 +82,14 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@clack/prompts": "1.7.0",
85
- "@opencode-ai/plugin": "1.18.18",
86
- "@opencode-ai/sdk": "1.18.18",
85
+ "@langchain/core": "1.2.9",
86
+ "@langchain/langgraph": "1.4.12",
87
+ "@opencode-ai/plugin": "1.18.19",
88
+ "@opencode-ai/sdk": "1.18.19",
89
+ "@opentelemetry/api": "1.9.1",
90
+ "@opentelemetry/exporter-trace-otlp-http": "0.221.0",
91
+ "@opentelemetry/resources": "2.10.0",
92
+ "@opentelemetry/sdk-trace-base": "2.10.0",
87
93
  "zod": "4.4.3"
88
94
  },
89
95
  "devDependencies": {
@@ -1,89 +0,0 @@
1
- import type { EventEmitter } from "node:events";
2
- /**
3
- * Comando `openteam tunnel`: expone la Console (y, opcionalmente, el servidor
4
- * opencode para terminal remota) vía Microsoft Dev Tunnels. El **núcleo es puro**
5
- * (parseo de flags, parseo de stdout de devtunnel, plan de seguridad §7); el
6
- * runner solo orquesta el proceso y espera la señal de parada. Sin secretos en
7
- * logs: passwords y tokens nunca se imprimen.
8
- */
9
- export type TunnelOptions = {
10
- /** Expone también el puerto de opencode (terminal remota). Requiere password. */
11
- terminal: boolean;
12
- /** Túnel anónimo (sin auth). Requiere `--yes` (doble confirmación). */
13
- allowAnonymous: boolean;
14
- /** Confirmación explícita para operaciones peligrosas (túnel anónimo). */
15
- yes: boolean;
16
- /** Override del puerto de la Console. */
17
- consolePort?: number;
18
- /** Override del puerto de opencode. */
19
- opencodePort?: number;
20
- };
21
- /** Parsea los flags de `openteam tunnel`. Determinista. Pure. */
22
- export declare function parseTunnelArgs(rest: readonly string[]): TunnelOptions;
23
- export type TunnelUrl = {
24
- port: number;
25
- url: string;
26
- };
27
- /**
28
- * Extrae las URLs públicas del stdout de `devtunnel host` (no tiene `--json`).
29
- * Reconoce la línea `Hosting port <p> at <url>`. Determinista. Pure.
30
- */
31
- export declare function parseDevtunnelUrls(stdout: string): TunnelUrl[];
32
- export type TunnelPlan = {
33
- /** Puertos a hospedar (siempre incluye la Console). */
34
- ports: number[];
35
- /** `true` si el puerto de opencode se expone (terminal remota disponible). */
36
- exposeTerminal: boolean;
37
- /** `true` si el túnel es anónimo (sin auth). */
38
- allowAnonymous: boolean;
39
- /** Avisos no bloqueantes a mostrar al usuario. */
40
- warnings: string[];
41
- /** Errores bloqueantes; si hay alguno, `ok` es `false`. */
42
- errors: string[];
43
- ok: boolean;
44
- };
45
- export type TunnelPlanInput = {
46
- options: TunnelOptions;
47
- consolePort: number;
48
- opencodePort: number;
49
- hasServerPassword: boolean;
50
- };
51
- /**
52
- * Decide el plan del túnel aplicando el gating de seguridad §7 del PRD:
53
- * loopback→túnel autenticado por defecto, password obligatoria para terminal
54
- * remota, doble confirmación para túnel anónimo. Determinista. Pure.
55
- */
56
- export declare function planTunnel(input: TunnelPlanInput): TunnelPlan;
57
- /** Construye los argumentos de `devtunnel host` para el plan dado. Pure. */
58
- export declare function buildDevtunnelArgs(plan: TunnelPlan): string[];
59
- /** Proceso hijo mínimo que necesita el runner (subconjunto de `ChildProcess`). */
60
- export type TunnelChild = {
61
- stdout: EventEmitter | null;
62
- stderr: EventEmitter | null;
63
- on: (event: "exit", cb: (code: number | null) => void) => void;
64
- kill: () => void;
65
- };
66
- export type TunnelRunDeps = {
67
- /** `true` si el CLI `devtunnel` está instalado. */
68
- isInstalled: () => Promise<boolean>;
69
- /** `true` si hay sesión iniciada en Dev Tunnels. */
70
- isLoggedIn: () => Promise<boolean>;
71
- /** Lanza `devtunnel` con los args dados. */
72
- spawn: (command: string, args: string[]) => TunnelChild;
73
- consolePort: number;
74
- opencodePort: number;
75
- hasServerPassword: boolean;
76
- /** Espera hasta que el usuario para el proceso (Ctrl+C). */
77
- waitForSignal: () => Promise<void>;
78
- log: (message: string) => void;
79
- };
80
- export type TunnelRunResult = {
81
- exitCode: number;
82
- };
83
- /**
84
- * `openteam tunnel`: comprueba `devtunnel` (instalado + login), aplica el plan de
85
- * seguridad, hospeda los puertos y muestra las URLs públicas hasta Ctrl+C. Solo
86
- * imprime URLs y avisos redactados; nunca password ni tokens.
87
- */
88
- export declare function runTunnel(deps: TunnelRunDeps, options: TunnelOptions): Promise<TunnelRunResult>;
89
- //# sourceMappingURL=tunnel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../src/cli/tunnel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;GAMG;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,cAAc,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,GAAG,EAAE,OAAO,CAAC;IACb,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAUF,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MA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AE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,oDAAoD;IACpD,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,4CAA4C;IAC5C,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,WAAW,CAAC;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,4DAA4D;IAC5D,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD;;;;GAIG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,eAAe,CAAC,CAkD1B"}
@@ -1,30 +0,0 @@
1
- import type { FrontierChoice } from "./setup";
2
- /**
3
- * Ruta relativa (al cwd) del agente primario que `openteam setup` genera. El
4
- * nombre del fichero (`openteam`) es el nombre del agente en opencode.
5
- */
6
- export declare const ORCHESTRATOR_AGENT_PATH = ".opencode/agent/openteam.md";
7
- /**
8
- * Ruta del registro de casting (universo + tabla nombre→rol→modelo). Vive
9
- * **fuera** de `.opencode/agent/` a propósito: opencode carga como agente cada
10
- * `.md` de esa carpeta, así que un `roster.md` dentro aparecería como un agente
11
- * fantasma en el Tab-switcher. Lo guardamos junto al log de decisiones del
12
- * `scribe`, como fichero de datos del proyecto.
13
- */
14
- export declare const OPENTEAM_ROSTER_PATH = ".opencode/openteam-roster.md";
15
- /**
16
- * Construye el Markdown del agente primario `openteam` (orquestador multiagente):
17
- * un
18
- * orquestador que aparece en el Tab-switcher, elige un universo temático y
19
- * castea al equipo, y crea los subagentes a demanda (incluidos los roles
20
- * estándar scribe, ralph y guardian). Pure: no I/O.
21
- *
22
- * `frontier` fija el `model` del orquestador (baseline cheapest-capable), un
23
- * `provider/model` real y resoluble; el plugin de openteam sigue enrutando por
24
- * mensaje, así que los subagentes que cree pueden heredar el default y ser
25
- * enrutados local-first.
26
- */
27
- export declare function buildOrchestratorAgent(frontier: FrontierChoice, options?: {
28
- yolo?: boolean;
29
- }): string;
30
- //# sourceMappingURL=orchestratorAgent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestratorAgent.d.ts","sourceRoot":"","sources":["../../src/commands/orchestratorAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAiOR"}
@@ -1,39 +0,0 @@
1
- /**
2
- * Directorio (relativo al cwd) donde opencode descubre los slash commands del
3
- * proyecto. opencode escanea `{command,commands}/**\/*.md` (singular y plural) en
4
- * cada `.opencode/` del árbol y en `~/.config/opencode/`; el nombre del fichero
5
- * es el nombre del comando (verificado en el source de opencode v1.17.8:
6
- * `packages/opencode/src/config/command.ts`).
7
- */
8
- export declare const OPENTEAM_COMMAND_DIR = ".opencode/command";
9
- /**
10
- * Ruta del slash command principal `/openteam` (catch-all). Se mantiene como
11
- * constante estable para compatibilidad; el resto de comandos derivan de
12
- * {@link OPENTEAM_COMMAND_DIR}.
13
- */
14
- export declare const OPENTEAM_COMMAND_PATH = ".opencode/command/openteam.md";
15
- /** Un slash command listo para escribir en disco. */
16
- export type SlashCommandFile = {
17
- /** Nombre del comando (fichero `<name>.md`), invocable como `/<name>`. */
18
- name: string;
19
- /** Ruta relativa al cwd del fichero markdown. */
20
- path: string;
21
- /** Contenido markdown (frontmatter + template). */
22
- contents: string;
23
- };
24
- /**
25
- * Construye el Markdown del slash command `/openteam` (catch-all). Enseña al
26
- * agente a mapear los argumentos del usuario a una única llamada de la
27
- * herramienta `openteam`. Debe mantenerse alineado con las acciones de
28
- * `commandArgv` en `src/plugin/commandTool.ts`. Pure/determinista: sin I/O.
29
- */
30
- export declare function buildOpenteamCommand(): string;
31
- /**
32
- * Todos los slash commands que `openteam setup` escribe en
33
- * `.opencode/command/`. Además del catch-all `/openteam`, genera un comando
34
- * plano por acción (`/openteam-doctor`, `/openteam-agents`, …) para que todos
35
- * aparezcan y se autocompleten en la paleta de opencode al teclear `/openteam`.
36
- * Pure/determinista: sin I/O.
37
- */
38
- export declare function buildOpenteamCommands(): SlashCommandFile[];
39
- //# sourceMappingURL=slashCommand.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slashCommand.d.ts","sourceRoot":"","sources":["../../src/commands/slashCommand.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,kCAAwC,CAAC;AAE3E,qDAAqD;AACrD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAkBF;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAmB7C;AAqBD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,gBAAgB,EAAE,CAuC1D"}
@@ -1,28 +0,0 @@
1
- /**
2
- * Tipos y reducción del ledger de progreso legacy.
3
- *
4
- * El ledger legacy (`progress.md`) registra, una línea por tarea, el desenlace
5
- * terminal de las tareas ya procesadas. Su **autoridad** fue retirada (R7): ya
6
- * no se lee ni se escribe como fuente de verdad. Lo que sobrevive es el modelo
7
- * de datos (`LedgerEntry` / `LedgerStatus`) y la reducción pura `latestStatuses`,
8
- * que la **importación terminal** a la autoridad de Graph
9
- * (`storage/graph/importLegacy.ts`) usa para colapsar entradas repetidas al
10
- * último estado por `taskID`. El parseo del texto legacy vive ahora inline en el
11
- * importador/migración, no aquí.
12
- *
13
- * Es **privacy-safe**: solo `taskID`, estado y un `detail` ya redactado; nunca
14
- * prompts ni datos sensibles.
15
- */
16
- export type LedgerStatus = "complete" | "failed";
17
- export type LedgerEntry = {
18
- taskID: string;
19
- status: LedgerStatus;
20
- /** Metadatos redactados (modelo, tier, resultado de review). Nunca prompts. */
21
- detail?: string;
22
- };
23
- /**
24
- * Estado más reciente por `taskID` (las líneas posteriores sobrescriben a las
25
- * anteriores: un `failed` seguido de `complete` cuenta como `complete`). Puro.
26
- */
27
- export declare function latestStatuses(entries: readonly LedgerEntry[]): Map<string, LedgerStatus>;
28
- //# sourceMappingURL=ledger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/orchestrator/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;IACrB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,WAAW,EAAE,GAC9B,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAM3B"}