@wrenai/genbi 0.0.4 → 0.0.5

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 (230) hide show
  1. package/README.md +64 -2
  2. package/dist/assets/{echarts-LTFC-ysd.js → echarts-DYM4hjvk.js} +2 -2
  3. package/dist/assets/index-A_Wrq7Ey.css +1 -0
  4. package/dist/assets/{index-Bo--QMUN.js → index-DsH129tV.js} +18 -17
  5. package/dist/index.html +2 -2
  6. package/dist-server/harness/bundle/schema.d.ts +38 -0
  7. package/dist-server/harness/bundle/schema.js +18 -10
  8. package/dist-server/harness/bundle/version.js +1 -1
  9. package/dist-server/harness/cli-args.d.ts +10 -2
  10. package/dist-server/harness/cli-args.js +24 -8
  11. package/dist-server/harness/cli.js +75 -9
  12. package/dist-server/harness/compile/cache.js +4 -4
  13. package/dist-server/harness/compile/compose-profile.d.ts +51 -14
  14. package/dist-server/harness/compile/compose-profile.js +85 -19
  15. package/dist-server/harness/compile/context-loader.d.ts +56 -0
  16. package/dist-server/harness/compile/context-loader.js +237 -0
  17. package/dist-server/harness/compile/errors.d.ts +19 -0
  18. package/dist-server/harness/compile/errors.js +35 -0
  19. package/dist-server/harness/compile/index.d.ts +4 -3
  20. package/dist-server/harness/compile/index.js +4 -3
  21. package/dist-server/harness/compile/pipeline.d.ts +15 -7
  22. package/dist-server/harness/compile/pipeline.js +62 -14
  23. package/dist-server/harness/compile/resolve-binary.d.ts +2 -2
  24. package/dist-server/harness/compile/resolve-binary.js +3 -3
  25. package/dist-server/harness/compile/types.d.ts +29 -0
  26. package/dist-server/harness/compile/warble-identity.d.ts +11 -0
  27. package/dist-server/harness/compile/warble-identity.js +13 -0
  28. package/dist-server/harness/components/ai-step.d.ts +4 -0
  29. package/dist-server/harness/components/ai-step.js +40 -0
  30. package/dist-server/harness/components/broker.d.ts +60 -0
  31. package/dist-server/harness/components/broker.js +117 -0
  32. package/dist-server/harness/components/capability-card.d.ts +98 -0
  33. package/dist-server/harness/components/capability-card.js +169 -0
  34. package/dist-server/harness/components/context.d.ts +2 -0
  35. package/dist-server/harness/components/context.js +30 -0
  36. package/dist-server/harness/components/display.d.ts +6 -0
  37. package/dist-server/harness/components/display.js +29 -0
  38. package/dist-server/harness/components/egress-judge.d.ts +12 -0
  39. package/dist-server/harness/components/egress-judge.js +27 -0
  40. package/dist-server/harness/components/egress.d.ts +142 -0
  41. package/dist-server/harness/components/egress.js +469 -0
  42. package/dist-server/harness/components/in-process.d.ts +7 -0
  43. package/dist-server/harness/components/in-process.js +245 -0
  44. package/dist-server/harness/components/normalize.d.ts +35 -0
  45. package/dist-server/harness/components/normalize.js +245 -0
  46. package/dist-server/harness/components/plan.d.ts +31 -0
  47. package/dist-server/harness/components/plan.js +184 -0
  48. package/dist-server/harness/components/report.d.ts +207 -0
  49. package/dist-server/harness/components/report.js +309 -0
  50. package/dist-server/harness/components/runner.d.ts +193 -0
  51. package/dist-server/harness/components/runner.js +492 -0
  52. package/dist-server/harness/components/semantic-guards.d.ts +20 -0
  53. package/dist-server/harness/components/semantic-guards.js +42 -0
  54. package/dist-server/harness/components/terminal-json.d.ts +18 -0
  55. package/dist-server/harness/components/terminal-json.js +82 -0
  56. package/dist-server/harness/components/usage.d.ts +14 -0
  57. package/dist-server/harness/components/usage.js +19 -0
  58. package/dist-server/harness/components/wren-access.d.ts +29 -0
  59. package/dist-server/harness/components/wren-access.js +233 -0
  60. package/dist-server/harness/components/zone-dry-run.d.ts +43 -0
  61. package/dist-server/harness/components/zone-dry-run.js +107 -0
  62. package/dist-server/harness/components/zone-gate.d.ts +76 -0
  63. package/dist-server/harness/components/zone-gate.js +144 -0
  64. package/dist-server/harness/events/index.d.ts +1 -1
  65. package/dist-server/harness/events/types.d.ts +52 -0
  66. package/dist-server/harness/index.d.ts +9 -2
  67. package/dist-server/harness/index.js +5 -1
  68. package/dist-server/harness/loop/executor.d.ts +1 -0
  69. package/dist-server/harness/loop/executor.js +37 -15
  70. package/dist-server/harness/npm-package-resolve.d.ts +2 -0
  71. package/dist-server/harness/npm-package-resolve.js +16 -4
  72. package/dist-server/harness/providers/adapters/openai-compatible.d.ts +13 -0
  73. package/dist-server/harness/providers/adapters/openai-compatible.js +17 -0
  74. package/dist-server/harness/providers/adapters/openai.d.ts +7 -0
  75. package/dist-server/harness/providers/adapters/openai.js +6 -0
  76. package/dist-server/harness/providers/adapters/pi-ai.d.ts +48 -0
  77. package/dist-server/harness/providers/adapters/pi-ai.js +518 -0
  78. package/dist-server/harness/providers/binding.d.ts +45 -4
  79. package/dist-server/harness/providers/binding.js +44 -8
  80. package/dist-server/harness/providers/index.d.ts +9 -3
  81. package/dist-server/harness/providers/index.js +10 -3
  82. package/dist-server/harness/providers/zone.d.ts +96 -0
  83. package/dist-server/harness/providers/zone.js +112 -0
  84. package/dist-server/harness/render/answering-query.d.ts +29 -0
  85. package/dist-server/harness/render/answering-query.js +62 -0
  86. package/dist-server/harness/render/envelope.d.ts +6 -0
  87. package/dist-server/harness/render/envelope.js +10 -3
  88. package/dist-server/harness/route/adapter-spec.d.ts +8 -9
  89. package/dist-server/harness/route/adapter-spec.js +13 -14
  90. package/dist-server/harness/route/codex-ask-events.js +2 -1
  91. package/dist-server/harness/route/codex-ask.d.ts +4 -0
  92. package/dist-server/harness/route/codex-ask.js +69 -30
  93. package/dist-server/harness/route/codex-host-query.d.ts +52 -0
  94. package/dist-server/harness/route/codex-host-query.js +191 -0
  95. package/dist-server/harness/route/codex-local-manifest.d.ts +9 -1
  96. package/dist-server/harness/route/codex-local-manifest.js +96 -15
  97. package/dist-server/harness/route/codex-wren-proxy.d.ts +33 -0
  98. package/dist-server/harness/route/codex-wren-proxy.js +227 -0
  99. package/dist-server/harness/route/describe.js +45 -6
  100. package/dist-server/harness/route/in-process.d.ts +22 -1
  101. package/dist-server/harness/route/in-process.js +54 -4
  102. package/dist-server/harness/route/route.js +5 -2
  103. package/dist-server/harness/route/types.d.ts +30 -1
  104. package/dist-server/harness/session/run.js +30 -10
  105. package/dist-server/harness/setup/runner.d.ts +2 -0
  106. package/dist-server/harness/setup/runner.js +38 -17
  107. package/dist-server/harness/setup/yaml-scalar.d.ts +23 -0
  108. package/dist-server/harness/setup/yaml-scalar.js +62 -0
  109. package/dist-server/server/adopt.js +1 -17
  110. package/dist-server/server/app.d.ts +1 -0
  111. package/dist-server/server/app.js +163 -14
  112. package/dist-server/server/auth-choice.d.ts +13 -1
  113. package/dist-server/server/auth-choice.js +66 -1
  114. package/dist-server/server/bin.js +177 -25
  115. package/dist-server/server/codex-local-grounding.d.ts +18 -0
  116. package/dist-server/server/codex-local-grounding.js +92 -0
  117. package/dist-server/server/codex-native-session.d.ts +25 -0
  118. package/dist-server/server/codex-native-session.js +1 -0
  119. package/dist-server/server/codex-runtime-composition.d.ts +34 -0
  120. package/dist-server/server/codex-runtime-composition.js +250 -0
  121. package/dist-server/server/codex-structured-ask.d.ts +23 -0
  122. package/dist-server/server/codex-structured-ask.js +102 -0
  123. package/dist-server/server/conn-config.js +4 -16
  124. package/dist-server/server/conversation-socket.d.ts +16 -0
  125. package/dist-server/server/conversation-socket.js +65 -0
  126. package/dist-server/server/db.d.ts +46 -0
  127. package/dist-server/server/db.js +88 -9
  128. package/dist-server/server/env-detect.d.ts +6 -0
  129. package/dist-server/server/env-detect.js +7 -0
  130. package/dist-server/server/fold.d.ts +22 -4
  131. package/dist-server/server/fold.js +37 -5
  132. package/dist-server/server/harness.d.ts +2 -2
  133. package/dist-server/server/harness.js +33 -7
  134. package/dist-server/server/interactive-terminal.d.ts +10 -6
  135. package/dist-server/server/interactive-terminal.js +33 -8
  136. package/dist-server/server/managed-wren-runtime.d.ts +116 -0
  137. package/dist-server/server/managed-wren-runtime.js +670 -0
  138. package/dist-server/server/native-artifacts.d.ts +23 -7
  139. package/dist-server/server/native-artifacts.js +43 -12
  140. package/dist-server/server/native-component-context.d.ts +19 -0
  141. package/dist-server/server/native-component-context.js +76 -0
  142. package/dist-server/server/native-component-preparation.d.ts +20 -0
  143. package/dist-server/server/native-component-preparation.js +129 -0
  144. package/dist-server/server/native-component-runtime.d.ts +36 -0
  145. package/dist-server/server/native-component-runtime.js +92 -0
  146. package/dist-server/server/native-components.d.ts +84 -0
  147. package/dist-server/server/native-components.js +160 -0
  148. package/dist-server/server/native-dispatch-process.d.ts +8 -0
  149. package/dist-server/server/native-dispatch-process.js +65 -0
  150. package/dist-server/server/native-runtime-spec.d.ts +89 -0
  151. package/dist-server/server/native-runtime-spec.js +169 -0
  152. package/dist-server/server/native-sessions.d.ts +172 -19
  153. package/dist-server/server/native-sessions.js +839 -244
  154. package/dist-server/server/native-shutdown.d.ts +6 -0
  155. package/dist-server/server/native-shutdown.js +28 -0
  156. package/dist-server/server/native-wren-home.d.ts +18 -0
  157. package/dist-server/server/native-wren-home.js +262 -0
  158. package/dist-server/server/node-pty-host.d.ts +2 -1
  159. package/dist-server/server/node-pty-host.js +3 -2
  160. package/dist-server/server/profile-registry.d.ts +139 -0
  161. package/dist-server/server/profile-registry.js +620 -0
  162. package/dist-server/server/runtime-binding.d.ts +4 -1
  163. package/dist-server/server/runtime-binding.js +50 -2
  164. package/dist-server/server/runtime-host/claude-component-step.d.ts +25 -0
  165. package/dist-server/server/runtime-host/claude-component-step.js +186 -0
  166. package/dist-server/server/runtime-host/codex-app-server.d.ts +75 -0
  167. package/dist-server/server/runtime-host/codex-app-server.js +239 -0
  168. package/dist-server/server/runtime-host/codex-compatibility.d.ts +110 -0
  169. package/dist-server/server/runtime-host/codex-compatibility.js +162 -0
  170. package/dist-server/server/runtime-host/codex-component-step.d.ts +19 -0
  171. package/dist-server/server/runtime-host/codex-component-step.js +308 -0
  172. package/dist-server/server/runtime-host/codex-conversation.d.ts +109 -0
  173. package/dist-server/server/runtime-host/codex-conversation.js +295 -0
  174. package/dist-server/server/runtime-host/codex-direct-tools.d.ts +23 -0
  175. package/dist-server/server/runtime-host/codex-direct-tools.js +59 -0
  176. package/dist-server/server/runtime-host/codex-events.d.ts +647 -0
  177. package/dist-server/server/runtime-host/codex-events.js +66 -0
  178. package/dist-server/server/runtime-host/codex-policy.d.ts +16 -0
  179. package/dist-server/server/runtime-host/codex-policy.js +151 -0
  180. package/dist-server/server/runtime-host/codex-process.d.ts +8 -0
  181. package/dist-server/server/runtime-host/codex-process.js +96 -0
  182. package/dist-server/server/runtime-host/codex-rpc.d.ts +47 -0
  183. package/dist-server/server/runtime-host/codex-rpc.js +182 -0
  184. package/dist-server/server/runtime-host/codex-session.d.ts +74 -0
  185. package/dist-server/server/runtime-host/codex-session.js +492 -0
  186. package/dist-server/server/runtime-host/codex-terminal-protocol.d.ts +35 -0
  187. package/dist-server/server/runtime-host/codex-terminal-protocol.js +243 -0
  188. package/dist-server/server/runtime-host/codex-terminal.d.ts +16 -0
  189. package/dist-server/server/runtime-host/codex-terminal.js +120 -0
  190. package/dist-server/server/runtime-host/index.d.ts +5 -0
  191. package/dist-server/server/runtime-host/index.js +3 -0
  192. package/dist-server/server/runtime-host/local.d.ts +29 -0
  193. package/dist-server/server/runtime-host/local.js +90 -0
  194. package/dist-server/server/runtime-host/policy.d.ts +8 -0
  195. package/dist-server/server/runtime-host/policy.js +78 -0
  196. package/dist-server/server/runtime-host/types.d.ts +52 -0
  197. package/dist-server/server/runtime-host/types.js +62 -0
  198. package/dist-server/server/structured-query-evidence.d.ts +7 -0
  199. package/dist-server/server/structured-query-evidence.js +47 -0
  200. package/dist-server/server/structured-runtime.d.ts +52 -0
  201. package/dist-server/server/structured-runtime.js +130 -0
  202. package/dist-server/server/structured-scope.d.ts +4 -0
  203. package/dist-server/server/structured-scope.js +12 -0
  204. package/dist-server/server/turn.d.ts +6 -1
  205. package/dist-server/server/turn.js +82 -25
  206. package/dist-server/server/wire-types.d.ts +67 -3
  207. package/dist-server/server/wren-profiles.js +1 -1
  208. package/managed-wren/README.md +60 -0
  209. package/managed-wren/dependency-wheels.json +282 -0
  210. package/managed-wren/manifest.json +373 -0
  211. package/managed-wren/release-inputs.json +45 -0
  212. package/managed-wren/runtime-tree.cjs +115 -0
  213. package/managed-wren/source-inputs.json +40 -0
  214. package/package.json +15 -6
  215. package/profiles/genbi-default/context/binding.yml +17 -7
  216. package/profiles/genbi-default/context/context.json +146 -0
  217. package/profiles/genbi-default/ir.golden.json +39 -43
  218. package/profiles/genbi-default/profile.yml +31 -0
  219. package/profiles/genbi-enrich-context/context/binding.yml +14 -3
  220. package/profiles/genbi-enrich-context/context/context.json +146 -0
  221. package/profiles/genbi-enrich-context/ir.golden.json +4 -5
  222. package/profiles/genbi-monitor/context/binding.yml +13 -5
  223. package/profiles/genbi-monitor/context/context.json +146 -0
  224. package/profiles/genbi-monitor/ir.golden.json +13 -7
  225. package/profiles/genbi-report/context/binding.yml +19 -0
  226. package/profiles/genbi-report/context/context.json +223 -0
  227. package/profiles/genbi-report/ir.golden.json +328 -0
  228. package/profiles/genbi-report/profile.yml +38 -0
  229. package/profiles/genbi-setup/ir.golden.json +3 -1
  230. package/dist/assets/index-Xs4q7pNo.css +0 -1
@@ -1,3 +1,6 @@
1
+ import type { DirectCodexProvisioner } from "./codex-native-session.js";
2
+ import { type CodexConversationAttachment, type ConversationFrame, type ConversationReplay } from "./runtime-host/codex-conversation.js";
3
+ import { type NativeComponentPreparation, type NativeComponentReceipt } from "./native-components.js";
1
4
  import type { EnrichmentBinding } from "./enrichment.js";
2
5
  import { InteractiveTerminalManager } from "./interactive-terminal.js";
3
6
  import type { InteractiveLaunchSpec, InteractiveTarget, InteractiveTerminalSession } from "./interactive-terminal.js";
@@ -7,6 +10,10 @@ import { NATIVE_PURPOSES } from "./native-dispatch-registry.js";
7
10
  import type { NativePurpose, NativeRuntimeBinding, NativeVendor } from "./native-dispatch-registry.js";
8
11
  import type { NativeSessionStateBase } from "./native-session-workspace.js";
9
12
  import type { NativeWrenRuntime } from "./native-wren-runtime.js";
13
+ import type { NativeChildEnvironment, NativeExecutableIdentity } from "./native-runtime-spec.js";
14
+ import type { CodexWrenHome } from "./native-wren-home.js";
15
+ import { RuntimeHost } from "./runtime-host/local.js";
16
+ import type { RuntimeReadiness } from "./runtime-host/types.js";
10
17
  export declare const NATIVE_VENDORS: readonly ["claude", "codex"];
11
18
  export { NATIVE_PURPOSES };
12
19
  export type { NativePurpose, NativeVendor };
@@ -31,10 +38,6 @@ export declare const NATIVE_SESSION_POST_CLAIM_DETACH_GRACE_MS: number;
31
38
  * profile so WREN_PROJECT_HOME can resolve through the exact server-owned binding.
32
39
  */
33
40
  export declare function grantCodexBoundProjectRead(cwd: string, projectPath: string, dataRoots?: readonly string[]): void;
34
- interface CodexWrenHome {
35
- readonly home: string;
36
- readonly dataRoots: readonly string[];
37
- }
38
41
  export interface NativeSetupRecoveryReport {
39
42
  readonly version: "1";
40
43
  readonly sequence: number;
@@ -120,11 +123,65 @@ export interface NativePurposeReadiness {
120
123
  }
121
124
  export type NativeSessionReadiness = {
122
125
  readonly runtime: NativeRuntimeBinding;
126
+ /** Read-only RuntimeHost projection. Diagnostics remain in the host process. */
127
+ readonly runtimeHost?: RuntimeReadiness;
123
128
  readonly purposes: Record<NativePurpose, NativePurposeReadiness>;
129
+ /** Per conversation profile, when a registry is wired: analysis readiness narrowed by the profile's own verdict. */
130
+ readonly profiles?: Readonly<Record<string, NativeProfileReadiness>>;
124
131
  /** Health of the host-owned GenBI MCP endpoint; never includes a credential. */
125
132
  readonly mcp: NativeMcpHealth;
126
133
  } & Record<NativePurpose, NativePurposeReadiness>;
134
+ /** User-selected analysis entry is a single pin; it never widens Claude scope. */
135
+ export declare function selectedNativeEntry(purpose: NativePurpose, vendor: NativeVendor, entryVerb?: string | null): string | undefined;
136
+ /**
137
+ * The conversation profile an analysis session starts inside.
138
+ *
139
+ * The default is the registry's fixed analysis profile and keeps every existing entry rule
140
+ * (`claudeScopeEntry`, `agentFor`, the Codex entry verbs). Any other id is a profile the
141
+ * server-held registry (`profile-registry.ts`) has admitted; its entry form was decided at
142
+ * admission and is carried here, never inferred at launch. A browser only ever names the id.
143
+ */
144
+ export interface NativeProfileSelection {
145
+ readonly id: string;
146
+ /** Directory the session's IR is compiled from; absent means the boot-time analysis source. */
147
+ readonly sourceDir?: string;
148
+ readonly entry: {
149
+ readonly kind: "scope";
150
+ } | {
151
+ readonly kind: "agent";
152
+ readonly verb: string;
153
+ };
154
+ }
155
+ /** One conversation profile as readiness reports it; `selectable` is the registry's verdict. */
156
+ export interface NativeConversationProfileSummary {
157
+ readonly id: string;
158
+ readonly selectable: boolean;
159
+ readonly reason?: string;
160
+ readonly entryKind?: "scope" | "agent";
161
+ readonly entryVerb?: string;
162
+ }
163
+ export interface NativeProfileReadiness {
164
+ readonly id: string;
165
+ readonly scopeKind: "bound_project";
166
+ readonly profile: string;
167
+ readonly target?: InteractiveTarget;
168
+ readonly targetLabel?: string;
169
+ readonly available: boolean;
170
+ readonly reason?: string;
171
+ readonly entryKind?: "scope" | "agent";
172
+ readonly entryVerb?: string;
173
+ }
174
+ export declare const DEFAULT_CONVERSATION_PROFILE: string;
175
+ /** The one shape every launch entry point accepts; `profile` is only meaningful for analysis. */
176
+ export interface NativeLaunchInput {
177
+ readonly purpose: NativePurpose;
178
+ readonly vendor?: NativeVendor;
179
+ readonly entryVerb?: string | undefined;
180
+ readonly profile?: string | undefined;
181
+ }
127
182
  export interface NativeSessionServiceOptions {
183
+ /** Certified server composition only; absence keeps direct execution closed. */
184
+ readonly directCodex?: DirectCodexProvisioner;
128
185
  readonly store: Store;
129
186
  readonly terminalManager: () => Promise<InteractiveTerminalManager>;
130
187
  readonly getBinding: () => EnrichmentBinding | undefined;
@@ -146,12 +203,42 @@ export interface NativeSessionServiceOptions {
146
203
  * this Warble can dispatch these profile shapes at all and has no user
147
204
  * project in view. They are wrong the moment a session has a binding.
148
205
  */
149
- readonly resolveDispatchIr?: (purpose: NativePurpose, binding: EnrichmentBinding | undefined) => Promise<string>;
206
+ readonly resolveDispatchIr?: (purpose: NativePurpose, binding: EnrichmentBinding | undefined, profileSource?: string) => Promise<string>;
207
+ /**
208
+ * Resolves a non-default conversation profile id to the directory and entry form the registry
209
+ * admitted it with. Rejects (with the stored reason) for an unknown, system or unavailable id.
210
+ * Absent means only the default profile can be selected.
211
+ */
212
+ readonly resolveConversationProfile?: (id: string) => Promise<NativeProfileSelection>;
213
+ /** Every conversation profile the registry lists, for per-profile readiness. */
214
+ readonly listConversationProfiles?: () => Promise<readonly NativeConversationProfileSummary[]>;
150
215
  readonly warbleBin: string;
151
216
  /** Absolute server-configured Wren shim for native Codex sessions; never a request input. */
152
217
  readonly wrenShim?: string;
218
+ /**
219
+ * Server-only managed-runtime record resolver. Phase 2A intentionally has
220
+ * no production implementation: absence is the fail-closed launch fence.
221
+ * A later provisioner must revalidate its immutable record in this callback;
222
+ * the editable `wrenShim` resolver is never a launch fallback.
223
+ */
224
+ readonly resolveManagedCodexWrenRuntime?: () => NativeWrenRuntime;
225
+ /** Fixed native child HOME captured by BFF composition, never request input. */
226
+ readonly nativeHome?: string;
227
+ /** Decision-17 profile source selected by server setup mode. */
228
+ readonly sourceWrenHome?: () => string;
229
+ /** Optional dedicated authenticated Codex home captured at BFF boot. */
230
+ readonly codexHome?: string;
231
+ /** Canonical vendor identities captured once by server composition. */
232
+ readonly vendorExecutables?: Readonly<Partial<Record<NativeVendor, NativeExecutableIdentity>>>;
233
+ /** Canonical Node identity used by env-shebang tools and the PTY probe. */
234
+ readonly nodeExecutable?: NativeExecutableIdentity;
235
+ readonly childToolDirectories?: readonly string[];
236
+ /** Fixed discovery PATH captured at BFF boot; never consulted after construction. */
237
+ readonly pathValue?: string;
153
238
  /** Read-only probe used by readiness; creation remains the final authority. */
154
239
  readonly terminalHostAvailable?: () => Promise<boolean>;
240
+ /** Phase-1 readiness boundary; no runtime host can be selected by browser input. */
241
+ readonly runtimeHost?: RuntimeHost;
155
242
  /** Test seam for the local executable probe. */
156
243
  readonly executableAvailable?: (vendor: NativeVendor) => boolean;
157
244
  /** Test seam for the configured local Warble producer probe. */
@@ -161,6 +248,9 @@ export interface NativeSessionServiceOptions {
161
248
  readonly runtime: NativeWrenRuntime;
162
249
  readonly projectPath: string;
163
250
  readonly cwd: string;
251
+ readonly sourceWrenHome: string;
252
+ readonly home: string;
253
+ readonly toolDirectories: readonly string[];
164
254
  }) => CodexWrenHome;
165
255
  /** When configured, bound native sessions use the accepted v4 MCP+welcome descriptor; v2 remains compatible for callers without it. */
166
256
  readonly artifactService?: NativeArtifactService;
@@ -174,11 +264,26 @@ export interface NativeSessionServiceOptions {
174
264
  readonly startSeparateReplayLimit?: number;
175
265
  /** Test seam for the fixed, server-owned Warble dispatch only. */
176
266
  readonly dispatch?: (input: NativeDispatchInput) => Promise<void>;
267
+ /** File-only producer probe. Supplied together with a certified component provisioner. */
268
+ readonly prepareComponentProbe?: NativeComponentProbe;
269
+ /** No production default: a separately certified same-account step runtime is required. */
270
+ readonly prepareComponents?: (input: {
271
+ readonly session: NativeSessionRow;
272
+ readonly binding: EnrichmentBinding;
273
+ readonly irDocument: string;
274
+ readonly scope: Readonly<Record<string, unknown>>;
275
+ }) => Promise<NativeComponentPreparation | undefined>;
177
276
  }
277
+ export type NativeComponentProbe = (input: {
278
+ readonly vendor: NativeVendor;
279
+ readonly purpose: NativePurpose;
280
+ readonly irDocument: string;
281
+ readonly scope: Readonly<Record<string, unknown>>;
282
+ }) => NativeComponentPreparation | undefined;
178
283
  export interface NativeDispatchInput {
179
284
  readonly warbleBin: string;
180
285
  /** Server-owned resolved producer identity captured by the compatibility preflight. */
181
- readonly producer?: NativeProducerIdentity;
286
+ readonly producer: NativeProducerIdentity;
182
287
  readonly irPath: string;
183
288
  readonly target: InteractiveTarget;
184
289
  readonly cwd: string;
@@ -187,6 +292,9 @@ export interface NativeDispatchInput {
187
292
  readonly scope: Record<string, unknown>;
188
293
  /** Exact v4 MCP descriptor, transported separately through --native-mcp. */
189
294
  readonly mcp?: NativeMcpDescriptor;
295
+ readonly env: NativeChildEnvironment;
296
+ readonly componentHost?: Readonly<Record<string, unknown>>;
297
+ readonly signal?: AbortSignal;
190
298
  }
191
299
  type NativeProviderLaunch = {
192
300
  readonly kind: "initial";
@@ -231,6 +339,8 @@ export interface NativeProducerPreflightResult {
231
339
  * let that failure take Claude down with it.
232
340
  */
233
341
  readonly vendors: Readonly<Record<NativeVendor, NativeProducerVendorProbe>>;
342
+ /** Purpose-specific results; a composed analysis failure cannot veto setup or enrichment. */
343
+ readonly purposes?: Readonly<Record<NativePurpose, Readonly<Record<NativeVendor, NativeProducerVendorProbe>>>>;
234
344
  }
235
345
  /**
236
346
  * Exercises the exact, file-only native dispatch boundary against the
@@ -239,16 +349,23 @@ export interface NativeProducerPreflightResult {
239
349
  * validator used just before a PTY starts.
240
350
  */
241
351
  export declare function probeNativeSessionProducer(input: {
352
+ readonly prepareComponents?: NativeComponentProbe;
242
353
  readonly warbleBin: string;
243
354
  readonly irPaths: Readonly<Record<NativePurpose, string | undefined>>;
244
355
  readonly wrenShim?: string;
356
+ /** Production Codex probes receive the same immutable-record resolver used at launch. */
357
+ readonly resolveManagedCodexWrenRuntime?: () => NativeWrenRuntime;
358
+ readonly nativeHome?: string;
359
+ readonly nodeExecutable?: NativeExecutableIdentity;
360
+ readonly childToolDirectories?: readonly string[];
361
+ readonly pathValue?: string;
245
362
  }): Promise<NativeProducerPreflightResult>;
246
363
  /**
247
364
  * Strict parser for the public v2/v4 producer contracts. V4 deliberately
248
365
  * omits the host-issued scope; Setup exposes only its separately authorized
249
366
  * bootstrap root, which is revalidated against the durable host configuration.
250
367
  */
251
- export declare function readNativeLaunchSpec(cwd: string, purpose: NativePurpose, vendor: NativeVendor, scopeId: string, binding?: EnrichmentBinding, mcp?: NativeMcpDescriptor, materializationState?: NativeSessionStateBase, authorizedWorkspace?: string, providerLaunch?: NativeProviderLaunch): InteractiveLaunchSpec;
368
+ export declare function readNativeLaunchSpec(cwd: string, purpose: NativePurpose, vendor: NativeVendor, scopeId: string, binding?: EnrichmentBinding, mcp?: NativeMcpDescriptor, materializationState?: NativeSessionStateBase, authorizedWorkspace?: string, providerLaunch?: NativeProviderLaunch, componentReceipt?: NativeComponentReceipt, selection?: NativeProfileSelection): InteractiveLaunchSpec;
252
369
  /**
253
370
  * Materializes only host-owned, short-lived producer inputs. The scope and
254
371
  * MCP descriptor deliberately stay in separate exclusive files because the
@@ -258,7 +375,28 @@ export declare function readNativeLaunchSpec(cwd: string, purpose: NativePurpose
258
375
  export declare function dispatchNativeArtifacts(input: NativeDispatchInput): Promise<void>;
259
376
  export declare class NativeSessionService {
260
377
  private readonly options;
378
+ private readonly runtimeHost;
379
+ private readonly nativeHome;
380
+ private readonly wrenShim;
381
+ private readonly sourceWrenHome;
382
+ private readonly nodeExecutable;
383
+ private readonly producerExecutable;
384
+ private readonly vendorExecutables;
385
+ private readonly childToolDirectories;
386
+ private readonly conversations;
261
387
  private readonly sessions;
388
+ private readonly componentAdmissions;
389
+ private readonly componentCleanups;
390
+ private componentCleanupFailed;
391
+ private runtimeCleanupFailed;
392
+ private readonly pendingTerminalCleanup;
393
+ private readonly pendingHomeCleanup;
394
+ private shuttingDown;
395
+ private readonly shutdownController;
396
+ private shutdownPromise?;
397
+ private readonly pendingCreates;
398
+ private readonly runtimeSpecs;
399
+ private readonly codexWrenHomes;
262
400
  private readonly leaseTimers;
263
401
  /** Open/reconnect coalescing only lasts while a matching launch is in flight. */
264
402
  private readonly launches;
@@ -288,6 +426,7 @@ export declare class NativeSessionService {
288
426
  * content-addressed diagnostic; the browser never receives it.
289
427
  */
290
428
  private productionProducerPreflight;
429
+ private assertSelectedRuntimeReady;
291
430
  /**
292
431
  * SQLite is the durable source of truth, but a native PTY and its attach
293
432
  * capability are deliberately process-local. A BFF restart (or a lease
@@ -308,10 +447,7 @@ export declare class NativeSessionService {
308
447
  * particular, a setup session never inherits the active project binding,
309
448
  * while a bound-purpose session cannot cross a generation or revision.
310
449
  */
311
- openOrCreate(input: {
312
- purpose: NativePurpose;
313
- vendor?: NativeVendor;
314
- }): Promise<NativeSessionLaunch>;
450
+ openOrCreate(input: NativeLaunchInput): Promise<NativeSessionLaunch>;
315
451
  /** Opens the exact row selected by the browser after revalidating its scope. */
316
452
  openExisting(input: {
317
453
  purpose: NativePurpose;
@@ -324,10 +460,8 @@ export declare class NativeSessionService {
324
460
  * click coalesce, while a later intentional launch receives new durable and
325
461
  * browser-scoped authority.
326
462
  */
327
- startSeparate(input: {
328
- purpose: NativePurpose;
329
- idempotencyKey: string;
330
- vendor?: NativeVendor;
463
+ startSeparate(input: NativeLaunchInput & {
464
+ readonly idempotencyKey: string;
331
465
  }): Promise<NativeSessionLaunch>;
332
466
  /**
333
467
  * Continues only a sealed Claude conversation. This creates a new durable
@@ -364,14 +498,24 @@ export declare class NativeSessionService {
364
498
  private trimStartSeparateReplays;
365
499
  private clearStartSeparateReplaysForSession;
366
500
  private singleFlight;
501
+ /**
502
+ * Resolves the profile a launch runs inside. The default needs no registry; any other id is
503
+ * Claude-only (the Codex entry is a purpose skill with no scope form), accepts no entry verb
504
+ * (its entry form was decided at admission), and must still be admitted right now.
505
+ */
506
+ private selectProfile;
507
+ /** Analysis readiness, narrowed per conversation profile by the registry's verdict and the vendor. */
508
+ private conversationProfileReadiness;
367
509
  readiness(): Promise<NativeSessionReadiness>;
368
- create(input: {
369
- purpose: NativePurpose;
370
- vendor?: NativeVendor;
371
- }, binding?: EnrichmentBinding | undefined, capturedRuntime?: NativeRuntimeBinding, resumed?: {
510
+ create(input: NativeLaunchInput, binding?: EnrichmentBinding | undefined, capturedRuntime?: NativeRuntimeBinding, resumed?: {
372
511
  readonly row: NativeSessionRow;
373
512
  readonly handle: string;
374
513
  }): Promise<NativeSessionLaunch>;
514
+ private createCaptured;
515
+ private liveCapability;
516
+ private createDirectCodex;
517
+ attachConversation(id: string, capability: string, listener: (frame: ConversationFrame | ConversationReplay) => void, afterSequence?: number): CodexConversationAttachment | undefined;
518
+ stopAndWait(id: string, capability: string): Promise<boolean>;
375
519
  attach(id: string, capability: string): InteractiveTerminalSession | undefined;
376
520
  detach(id: string): void;
377
521
  stop(id: string, capability: string): boolean;
@@ -380,6 +524,15 @@ export declare class NativeSessionService {
380
524
  revokeRuntimeCapabilities(ids: readonly string[]): void;
381
525
  /** Called after the store advances the bound-project generation. */
382
526
  revokeBindingCapabilities(ids: readonly string[]): void;
527
+ componentTools(id: string): readonly {
528
+ name: string;
529
+ description: string;
530
+ inputSchema: typeof import("./native-components.js").NATIVE_COMPONENT_REQUEST_SCHEMA;
531
+ }[];
532
+ callComponent(id: string, tool: string, input: unknown, requestId: string | number, signal: AbortSignal): Promise<import("@warble/claude-agent-sdk").ComponentInvocationResult>;
533
+ drainComponentCleanup(): Promise<void>;
534
+ shutdown(): Promise<void>;
535
+ private cleanupRuntime;
383
536
  /**
384
537
  * Records only the producer's closed redacted report. Completion remains a
385
538
  * host decision supplied by the canonical-artifact validator at the route.