@exaudeus/workrail 3.35.1 → 3.36.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.
@@ -43,6 +43,7 @@ exports.runStartupRecovery = runStartupRecovery;
43
43
  exports.makeContinueWorkflowTool = makeContinueWorkflowTool;
44
44
  exports.makeCompleteStepTool = makeCompleteStepTool;
45
45
  exports.makeBashTool = makeBashTool;
46
+ exports.makeSpawnAgentTool = makeSpawnAgentTool;
46
47
  exports.makeReportIssueTool = makeReportIssueTool;
47
48
  exports.buildSessionRecap = buildSessionRecap;
48
49
  exports.buildSystemPrompt = buildSystemPrompt;
@@ -375,6 +376,30 @@ function getSchemas() {
375
376
  },
376
377
  required: ['filePath', 'content'],
377
378
  },
379
+ SpawnAgentParams: {
380
+ type: 'object',
381
+ properties: {
382
+ workflowId: {
383
+ type: 'string',
384
+ description: 'ID of the workflow to run in the child session (e.g. "wr.discovery").',
385
+ },
386
+ goal: {
387
+ type: 'string',
388
+ description: 'One-sentence description of what the child session should accomplish.',
389
+ },
390
+ workspacePath: {
391
+ type: 'string',
392
+ description: 'Absolute path to the workspace directory for the child session.',
393
+ },
394
+ context: {
395
+ type: 'object',
396
+ additionalProperties: true,
397
+ description: 'Optional initial context variables to pass to the child workflow.',
398
+ },
399
+ },
400
+ required: ['workflowId', 'goal', 'workspacePath'],
401
+ additionalProperties: false,
402
+ },
378
403
  };
379
404
  return _schemas;
380
405
  }
@@ -657,6 +682,110 @@ function makeWriteTool(schemas, sessionId, emitter, workrailSessionId) {
657
682
  },
658
683
  };
659
684
  }
685
+ function makeSpawnAgentTool(sessionId, ctx, apiKey, thisWorkrailSessionId, currentDepth, maxDepth, runWorkflowFn, schemas, emitter) {
686
+ return {
687
+ name: 'spawn_agent',
688
+ description: 'Spawn a child WorkRail session to handle a delegated sub-task. ' +
689
+ 'Blocks until the child session completes, then returns the child\'s outcome and notes. ' +
690
+ 'Use this when a step requires delegating a well-defined sub-task to a separate workflow. ' +
691
+ 'IMPORTANT: The parent session\'s time limit (maxSessionMinutes) keeps ticking while the child runs. ' +
692
+ 'Configure the parent with enough time to cover both its own work and the child\'s work. ' +
693
+ 'Returns: { childSessionId, outcome: "success"|"error"|"timeout", notes: string }. ' +
694
+ 'Check outcome before using notes -- on error/timeout, notes contains the error message.',
695
+ inputSchema: schemas['SpawnAgentParams'],
696
+ label: 'Spawn Agent',
697
+ execute: async (_toolCallId, params) => {
698
+ console.log(`[WorkflowRunner] Tool: spawn_agent sessionId=${sessionId} workflowId=${String(params.workflowId)} depth=${currentDepth}/${maxDepth}`);
699
+ emitter?.emit({ kind: 'tool_called', sessionId, toolName: 'spawn_agent', summary: `${String(params.workflowId)} depth=${currentDepth}`, ...withWorkrailSession(thisWorkrailSessionId) });
700
+ if (currentDepth >= maxDepth) {
701
+ const limitResult = {
702
+ childSessionId: null,
703
+ outcome: 'error',
704
+ notes: `Max spawn depth exceeded (currentDepth=${currentDepth}, maxDepth=${maxDepth}). ` +
705
+ `Cannot spawn a child session from this depth. ` +
706
+ `Increase agentConfig.maxSubagentDepth if deeper delegation is intentional.`,
707
+ };
708
+ return {
709
+ content: [{ type: 'text', text: JSON.stringify(limitResult) }],
710
+ details: limitResult,
711
+ };
712
+ }
713
+ const startInput = {
714
+ workflowId: String(params.workflowId),
715
+ workspacePath: String(params.workspacePath),
716
+ goal: String(params.goal),
717
+ };
718
+ const startResult = await (0, start_js_1.executeStartWorkflow)(startInput, ctx, { is_autonomous: 'true', workspacePath: String(params.workspacePath), parentSessionId: thisWorkrailSessionId });
719
+ if (startResult.isErr()) {
720
+ const errResult = {
721
+ childSessionId: null,
722
+ outcome: 'error',
723
+ notes: `Failed to start child workflow: ${startResult.error.kind} -- ${JSON.stringify(startResult.error)}`,
724
+ };
725
+ return {
726
+ content: [{ type: 'text', text: JSON.stringify(errResult) }],
727
+ details: errResult,
728
+ };
729
+ }
730
+ let childSessionId = null;
731
+ const childContinueToken = startResult.value.response.continueToken ?? '';
732
+ if (childContinueToken) {
733
+ const decoded = await (0, v2_token_ops_js_1.parseContinueTokenOrFail)(childContinueToken, ctx.v2.tokenCodecPorts, ctx.v2.tokenAliasStore);
734
+ if (decoded.isOk()) {
735
+ childSessionId = decoded.value.sessionId;
736
+ }
737
+ else {
738
+ console.warn(`[WorkflowRunner] spawn_agent: could not decode childSessionId from continueToken -- ` +
739
+ `childSessionId will be null in result. Reason: ${decoded.error.message}`);
740
+ }
741
+ }
742
+ const childResult = await runWorkflowFn({
743
+ workflowId: String(params.workflowId),
744
+ goal: String(params.goal),
745
+ workspacePath: String(params.workspacePath),
746
+ context: params.context,
747
+ spawnDepth: currentDepth + 1,
748
+ parentSessionId: thisWorkrailSessionId,
749
+ _preAllocatedStartResponse: startResult.value.response,
750
+ }, ctx, apiKey, undefined, emitter);
751
+ let resultObj;
752
+ if (childResult._tag === 'success') {
753
+ resultObj = {
754
+ childSessionId,
755
+ outcome: 'success',
756
+ notes: childResult.lastStepNotes ?? '(no notes from child session)',
757
+ };
758
+ }
759
+ else if (childResult._tag === 'error') {
760
+ resultObj = {
761
+ childSessionId,
762
+ outcome: 'error',
763
+ notes: childResult.message,
764
+ };
765
+ }
766
+ else if (childResult._tag === 'timeout') {
767
+ resultObj = {
768
+ childSessionId,
769
+ outcome: 'timeout',
770
+ notes: childResult.message,
771
+ };
772
+ }
773
+ else {
774
+ resultObj = {
775
+ childSessionId,
776
+ outcome: 'success',
777
+ notes: `Child workflow completed, but result delivery failed: ${childResult.deliveryError}`,
778
+ };
779
+ }
780
+ console.log(`[WorkflowRunner] spawn_agent completed: sessionId=${sessionId} childSessionId=${childSessionId ?? 'null'} outcome=${resultObj.outcome}`);
781
+ emitter?.emit({ kind: 'tool_called', sessionId, toolName: 'spawn_agent_complete', summary: `outcome=${resultObj.outcome} child=${childSessionId ?? 'null'}`, ...withWorkrailSession(thisWorkrailSessionId) });
782
+ return {
783
+ content: [{ type: 'text', text: JSON.stringify(resultObj) }],
784
+ details: resultObj,
785
+ };
786
+ },
787
+ };
788
+ }
660
789
  async function appendIssueAsync(issuesDir, sessionId, record) {
661
790
  await fs.mkdir(issuesDir, { recursive: true });
662
791
  const filePath = path.join(issuesDir, `${sessionId}.jsonl`);
@@ -773,6 +902,7 @@ Good pattern: "Question: Should I check the middleware? Answer: The workflow ste
773
902
  - \`Read\`: Read files.
774
903
  - \`Write\`: Write files.
775
904
  - \`report_issue\`: Record a structured issue, error, or unexpected behavior. Call this AND complete_step (unless fatal). Does not stop the session -- it creates a record for the auto-fix coordinator.
905
+ - \`spawn_agent\`: Delegate a sub-task to a child WorkRail session. BLOCKS until the child completes. Returns \`{ childSessionId, outcome: "success"|"error"|"timeout", notes: string }\`. Always check \`outcome\` before using \`notes\`. IMPORTANT: your session's time limit (maxSessionMinutes) keeps running while the child executes -- ensure your parent session has enough time for both your work AND the child's work. Maximum spawn depth is 3 by default (configurable). Use only when a step explicitly asks for delegation or when a clearly separable sub-task would benefit from its own WorkRail audit trail.
776
906
 
777
907
  ## Execution contract
778
908
  1. Read the step carefully. Do ALL the work the step asks for.
@@ -936,6 +1066,8 @@ async function runWorkflow(trigger, ctx, apiKey, daemonRegistry, emitter) {
936
1066
  return { _tag: 'success', workflowId: trigger.workflowId, stopReason: 'stop' };
937
1067
  }
938
1068
  const schemas = getSchemas();
1069
+ const spawnCurrentDepth = trigger.spawnDepth ?? 0;
1070
+ const spawnMaxDepth = trigger.agentConfig?.maxSubagentDepth ?? 3;
939
1071
  const tools = [
940
1072
  makeCompleteStepTool(sessionId, ctx, () => currentContinueToken, onAdvance, onComplete, (t) => { currentContinueToken = t; }, schemas, index_js_1.executeContinueWorkflow, emitter, workrailSessionId),
941
1073
  makeContinueWorkflowTool(sessionId, ctx, onAdvance, onComplete, schemas, index_js_1.executeContinueWorkflow, emitter, workrailSessionId),
@@ -947,6 +1079,7 @@ async function runWorkflow(trigger, ctx, apiKey, daemonRegistry, emitter) {
947
1079
  issueSummaries.push(summary);
948
1080
  }
949
1081
  }),
1082
+ makeSpawnAgentTool(sessionId, ctx, apiKey, workrailSessionId ?? '', spawnCurrentDepth, spawnMaxDepth, runWorkflow, schemas, emitter),
950
1083
  ];
951
1084
  const [soulContent, workspaceContext, sessionNotes] = await Promise.all([
952
1085
  loadDaemonSoul(trigger.soulFile),
@@ -445,12 +445,12 @@
445
445
  "sha256": "cf9d09641f1c31fffe6c7835b30bbbad52572befec1acab7fb9a0c188431af36",
446
446
  "bytes": 60355
447
447
  },
448
- "console-ui/assets/index-D7jQyCSD.js": {
449
- "sha256": "f0692154276f354dbbdce868634b19caf01a3b5d2a2e033bb1ecd19d61889eb9",
448
+ "console-ui/assets/index-n8cJrS4v.js": {
449
+ "sha256": "a676f6e7685eebaf2edb1feaa6cfe382131ce9faaee8efe6974e4073d935af7b",
450
450
  "bytes": 754955
451
451
  },
452
452
  "console-ui/index.html": {
453
- "sha256": "83c7ee221c0d7e05b7e1728f795a289cd317dfe922a49c460ac66f1cebd4c097",
453
+ "sha256": "14f1536e9c93a887a2c7c2a30c8297a0ae537c20f0f552cc2d79d1ee07728b7f",
454
454
  "bytes": 417
455
455
  },
456
456
  "console/standalone-console.d.ts": {
@@ -502,12 +502,12 @@
502
502
  "bytes": 1009
503
503
  },
504
504
  "daemon/workflow-runner.d.ts": {
505
- "sha256": "598ca3cda5dba827d0eddf80baf4136b401d821c81ec83aacbee05a63b836d9a",
506
- "bytes": 4103
505
+ "sha256": "0d6b407a188357fd00cc534f8af754e83d9f0f1a5f5f599d8b39f92ffeab8904",
506
+ "bytes": 4496
507
507
  },
508
508
  "daemon/workflow-runner.js": {
509
- "sha256": "a54677cdf2d2083fd9672b25b9d2264defa8dde7b357055bc14748d0ce9e7098",
510
- "bytes": 56093
509
+ "sha256": "d7a7781ac06354b73e3d8859aebd654986255f653ac8df49b2e4a68b3da2ae9b",
510
+ "bytes": 63759
511
511
  },
512
512
  "di/container.d.ts": {
513
513
  "sha256": "003bb7fb7478d627524b9b1e76bd0a963a243794a687ff233b96dc0e33a06d9f",
@@ -954,8 +954,8 @@
954
954
  "bytes": 2769
955
955
  },
956
956
  "mcp/handlers/v2-advance-events.js": {
957
- "sha256": "6b77a18f4818355b986b96af50df86d629f235226d619e27a35eb50384c0f770",
958
- "bytes": 5187
957
+ "sha256": "c23df725685ee2062f44e05512ee4463c9b29ed4d67a4e72846496d59920733c",
958
+ "bytes": 5235
959
959
  },
960
960
  "mcp/handlers/v2-checkpoint.d.ts": {
961
961
  "sha256": "8f22b341bb0ffffb3b24a89067e2a6513ef004ca21c1a42ce48979c2c663b18c",
@@ -1038,12 +1038,12 @@
1038
1038
  "bytes": 11397
1039
1039
  },
1040
1040
  "mcp/handlers/v2-execution/start.d.ts": {
1041
- "sha256": "3d93d6119b89d6cabf8bebbaafd24d8de53d84dd671440d221dda5a238ba4fc4",
1042
- "bytes": 3519
1041
+ "sha256": "1ebd5c3790f5bedaf032e4f5271a78d43629b82ecc351c3fc0f17f326d915d5d",
1042
+ "bytes": 3558
1043
1043
  },
1044
1044
  "mcp/handlers/v2-execution/start.js": {
1045
- "sha256": "f57771c4baa31204fc683615802a02c4c9cf65e8727426210fc656d173e9fe51",
1046
- "bytes": 21208
1045
+ "sha256": "d2ffbf775d5ea6ce68174d428129fad1377033e09fcdeb69c24c9d8fb04885b4",
1046
+ "bytes": 21354
1047
1047
  },
1048
1048
  "mcp/handlers/v2-execution/workflow-object-cache.d.ts": {
1049
1049
  "sha256": "7e58a2a020fd8443821dbe4e6a2702a9882c517f032a340c1b393cdebf4af907",
@@ -2166,8 +2166,8 @@
2166
2166
  "bytes": 3397
2167
2167
  },
2168
2168
  "v2/durable-core/schemas/export-bundle/index.d.ts": {
2169
- "sha256": "4705633548971164d18baa2564fc7306f3687665896a33743a0eccf753c701d4",
2170
- "bytes": 533636
2169
+ "sha256": "fa406033adbb001b8044836a96c999273814d14b35e4c6d98b644ab22424d3d9",
2170
+ "bytes": 535324
2171
2171
  },
2172
2172
  "v2/durable-core/schemas/export-bundle/index.js": {
2173
2173
  "sha256": "6e3566b2d05ea6302bbf4d311b8ec3e94725a8523834efe7670a79e7bd7dc40d",
@@ -2222,20 +2222,20 @@
2222
2222
  "bytes": 2138
2223
2223
  },
2224
2224
  "v2/durable-core/schemas/session/events.d.ts": {
2225
- "sha256": "825319ae3964b8983e823f4ed69804840ea69b494d583620387605fb5f127225",
2226
- "bytes": 80143
2225
+ "sha256": "dc0098d909c240bccd9508c6ed987b50b6a9c162f1f9f7a1d49d53dfefc1535f",
2226
+ "bytes": 80635
2227
2227
  },
2228
2228
  "v2/durable-core/schemas/session/events.js": {
2229
- "sha256": "cc9f2ae04c788e878533c0b807385bc48341df40c3e01aee22e5881ff5348364",
2230
- "bytes": 12904
2229
+ "sha256": "8af751c61d8c30802ce13174020893c8dfd59fcb4d15a34efc1abe05a2116e0d",
2230
+ "bytes": 12950
2231
2231
  },
2232
2232
  "v2/durable-core/schemas/session/gaps.d.ts": {
2233
- "sha256": "399cc4f39e065d60f1a339908da181016281d57903bb7ce525a41d07b53ecc71",
2234
- "bytes": 8721
2233
+ "sha256": "c42f2b86dd8275f5e35c8b144d5f49775741612b8625806b1aebeeb594248338",
2234
+ "bytes": 8983
2235
2235
  },
2236
2236
  "v2/durable-core/schemas/session/gaps.js": {
2237
- "sha256": "b57ac509c9cb6c13a5eb3ef7dd4d7bc97d072465613d31a0d24e5607525c2182",
2238
- "bytes": 2069
2237
+ "sha256": "566d96b60855e4d62360d8ecf0058b810fd514e2be1249221b2bd2cc3e7490d0",
2238
+ "bytes": 2101
2239
2239
  },
2240
2240
  "v2/durable-core/schemas/session/index.d.ts": {
2241
2241
  "sha256": "f4f500d33d212760f480d91fafd4474f7b12f9239a6c5e9c2d80d0fe96207b65",
@@ -50,7 +50,7 @@ function buildRecommendationWarningEvents(args) {
50
50
  data: {
51
51
  gapId,
52
52
  severity: 'warning',
53
- reason: w.kind,
53
+ reason: { category: 'unexpected', detail: 'evaluation_error' },
54
54
  summary: w.summary,
55
55
  resolution: { kind: 'unresolved' },
56
56
  },
@@ -46,6 +46,7 @@ export declare function buildInitialEvents(args: {
46
46
  };
47
47
  readonly goal: string;
48
48
  readonly extraContext?: Readonly<Record<string, string>>;
49
+ readonly parentSessionId?: string;
49
50
  }): readonly DomainEventV1[];
50
51
  export declare function mintStartTokens(args: {
51
52
  readonly sessionId: SessionId;
@@ -109,7 +109,7 @@ function loadAndPinWorkflow(args) {
109
109
  });
110
110
  }
111
111
  function buildInitialEvents(args) {
112
- const { sessionId, runId, nodeId, workflowId, workflowHash, workflowSourceKind, workflowSourceRef, snapshotRef, observations, idFactory, goal, extraContext, } = args;
112
+ const { sessionId, runId, nodeId, workflowId, workflowHash, workflowSourceKind, workflowSourceRef, snapshotRef, observations, idFactory, goal, extraContext, parentSessionId, } = args;
113
113
  const evtSessionCreated = idFactory.mintEventId();
114
114
  const evtRunStarted = idFactory.mintEventId();
115
115
  const evtNodeCreated = idFactory.mintEventId();
@@ -123,7 +123,7 @@ function buildInitialEvents(args) {
123
123
  sessionId,
124
124
  kind: constants_js_1.EVENT_KIND.SESSION_CREATED,
125
125
  dedupeKey: `session_created:${sessionId}`,
126
- data: {},
126
+ data: parentSessionId !== undefined ? { parentSessionId } : {},
127
127
  },
128
128
  {
129
129
  v: 1,
@@ -314,6 +314,7 @@ function executeStartWorkflow(input, ctx, internalContext) {
314
314
  idFactory,
315
315
  goal: input.goal,
316
316
  extraContext: internalContext,
317
+ parentSessionId: internalContext?.['parentSessionId'],
317
318
  });
318
319
  const emptyTruth = { manifest: [], events: [] };
319
320
  return gate.withHealthySessionLock(sessionId, (lock) => sessionStore.append(lock, {
@@ -75,10 +75,18 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
75
75
  }>>;
76
76
  } & {
77
77
  kind: z.ZodLiteral<"session_created">;
78
- data: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
78
+ data: z.ZodObject<{
79
+ parentSessionId: z.ZodOptional<z.ZodString>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ parentSessionId?: string | undefined;
82
+ }, {
83
+ parentSessionId?: string | undefined;
84
+ }>;
79
85
  }, "strip", z.ZodTypeAny, {
80
86
  kind: "session_created";
81
- data: {};
87
+ data: {
88
+ parentSessionId?: string | undefined;
89
+ };
82
90
  v: 1;
83
91
  sessionId: string;
84
92
  eventIndex: number;
@@ -90,7 +98,9 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
90
98
  } | undefined;
91
99
  }, {
92
100
  kind: "session_created";
93
- data: {};
101
+ data: {
102
+ parentSessionId?: string | undefined;
103
+ };
94
104
  v: 1;
95
105
  sessionId: string;
96
106
  eventIndex: number;
@@ -1849,12 +1859,12 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
1849
1859
  category: "user_only_dependency";
1850
1860
  }>, z.ZodObject<{
1851
1861
  category: z.ZodLiteral<"contract_violation">;
1852
- detail: z.ZodEnum<["missing_required_output", "invalid_required_output", "missing_required_notes"]>;
1862
+ detail: z.ZodEnum<["missing_required_output", "invalid_required_output", "missing_required_notes", "assessment_followup_required"]>;
1853
1863
  }, "strip", z.ZodTypeAny, {
1854
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
1864
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
1855
1865
  category: "contract_violation";
1856
1866
  }, {
1857
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
1867
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
1858
1868
  category: "contract_violation";
1859
1869
  }>, z.ZodObject<{
1860
1870
  category: z.ZodLiteral<"capability_missing">;
@@ -1917,7 +1927,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
1917
1927
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1918
1928
  category: "user_only_dependency";
1919
1929
  } | {
1920
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
1930
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
1921
1931
  category: "contract_violation";
1922
1932
  } | {
1923
1933
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -1947,7 +1957,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
1947
1957
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1948
1958
  category: "user_only_dependency";
1949
1959
  } | {
1950
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
1960
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
1951
1961
  category: "contract_violation";
1952
1962
  } | {
1953
1963
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -1980,7 +1990,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
1980
1990
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1981
1991
  category: "user_only_dependency";
1982
1992
  } | {
1983
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
1993
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
1984
1994
  category: "contract_violation";
1985
1995
  } | {
1986
1996
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -2022,7 +2032,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
2022
2032
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
2023
2033
  category: "user_only_dependency";
2024
2034
  } | {
2025
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
2035
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
2026
2036
  category: "contract_violation";
2027
2037
  } | {
2028
2038
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -4724,7 +4734,9 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
4724
4734
  }>;
4725
4735
  events: ({
4726
4736
  kind: "session_created";
4727
- data: {};
4737
+ data: {
4738
+ parentSessionId?: string | undefined;
4739
+ };
4728
4740
  v: 1;
4729
4741
  sessionId: string;
4730
4742
  eventIndex: number;
@@ -5022,7 +5034,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
5022
5034
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
5023
5035
  category: "user_only_dependency";
5024
5036
  } | {
5025
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
5037
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
5026
5038
  category: "contract_violation";
5027
5039
  } | {
5028
5040
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -5300,7 +5312,9 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
5300
5312
  }>;
5301
5313
  events: ({
5302
5314
  kind: "session_created";
5303
- data: {};
5315
+ data: {
5316
+ parentSessionId?: string | undefined;
5317
+ };
5304
5318
  v: 1;
5305
5319
  sessionId: string;
5306
5320
  eventIndex: number;
@@ -5598,7 +5612,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
5598
5612
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
5599
5613
  category: "user_only_dependency";
5600
5614
  } | {
5601
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
5615
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
5602
5616
  category: "contract_violation";
5603
5617
  } | {
5604
5618
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -5783,10 +5797,18 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
5783
5797
  }>>;
5784
5798
  } & {
5785
5799
  kind: z.ZodLiteral<"session_created">;
5786
- data: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
5800
+ data: z.ZodObject<{
5801
+ parentSessionId: z.ZodOptional<z.ZodString>;
5802
+ }, "strip", z.ZodTypeAny, {
5803
+ parentSessionId?: string | undefined;
5804
+ }, {
5805
+ parentSessionId?: string | undefined;
5806
+ }>;
5787
5807
  }, "strip", z.ZodTypeAny, {
5788
5808
  kind: "session_created";
5789
- data: {};
5809
+ data: {
5810
+ parentSessionId?: string | undefined;
5811
+ };
5790
5812
  v: 1;
5791
5813
  sessionId: string;
5792
5814
  eventIndex: number;
@@ -5798,7 +5820,9 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
5798
5820
  } | undefined;
5799
5821
  }, {
5800
5822
  kind: "session_created";
5801
- data: {};
5823
+ data: {
5824
+ parentSessionId?: string | undefined;
5825
+ };
5802
5826
  v: 1;
5803
5827
  sessionId: string;
5804
5828
  eventIndex: number;
@@ -7557,12 +7581,12 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
7557
7581
  category: "user_only_dependency";
7558
7582
  }>, z.ZodObject<{
7559
7583
  category: z.ZodLiteral<"contract_violation">;
7560
- detail: z.ZodEnum<["missing_required_output", "invalid_required_output", "missing_required_notes"]>;
7584
+ detail: z.ZodEnum<["missing_required_output", "invalid_required_output", "missing_required_notes", "assessment_followup_required"]>;
7561
7585
  }, "strip", z.ZodTypeAny, {
7562
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
7586
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
7563
7587
  category: "contract_violation";
7564
7588
  }, {
7565
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
7589
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
7566
7590
  category: "contract_violation";
7567
7591
  }>, z.ZodObject<{
7568
7592
  category: z.ZodLiteral<"capability_missing">;
@@ -7625,7 +7649,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
7625
7649
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
7626
7650
  category: "user_only_dependency";
7627
7651
  } | {
7628
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
7652
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
7629
7653
  category: "contract_violation";
7630
7654
  } | {
7631
7655
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -7655,7 +7679,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
7655
7679
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
7656
7680
  category: "user_only_dependency";
7657
7681
  } | {
7658
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
7682
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
7659
7683
  category: "contract_violation";
7660
7684
  } | {
7661
7685
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -7688,7 +7712,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
7688
7712
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
7689
7713
  category: "user_only_dependency";
7690
7714
  } | {
7691
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
7715
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
7692
7716
  category: "contract_violation";
7693
7717
  } | {
7694
7718
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -7730,7 +7754,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
7730
7754
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
7731
7755
  category: "user_only_dependency";
7732
7756
  } | {
7733
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
7757
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
7734
7758
  category: "contract_violation";
7735
7759
  } | {
7736
7760
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -10432,7 +10456,9 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
10432
10456
  }>;
10433
10457
  events: ({
10434
10458
  kind: "session_created";
10435
- data: {};
10459
+ data: {
10460
+ parentSessionId?: string | undefined;
10461
+ };
10436
10462
  v: 1;
10437
10463
  sessionId: string;
10438
10464
  eventIndex: number;
@@ -10730,7 +10756,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
10730
10756
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
10731
10757
  category: "user_only_dependency";
10732
10758
  } | {
10733
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
10759
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
10734
10760
  category: "contract_violation";
10735
10761
  } | {
10736
10762
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -11008,7 +11034,9 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
11008
11034
  }>;
11009
11035
  events: ({
11010
11036
  kind: "session_created";
11011
- data: {};
11037
+ data: {
11038
+ parentSessionId?: string | undefined;
11039
+ };
11012
11040
  v: 1;
11013
11041
  sessionId: string;
11014
11042
  eventIndex: number;
@@ -11306,7 +11334,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
11306
11334
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
11307
11335
  category: "user_only_dependency";
11308
11336
  } | {
11309
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
11337
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
11310
11338
  category: "contract_violation";
11311
11339
  } | {
11312
11340
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -11613,7 +11641,9 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
11613
11641
  }>;
11614
11642
  events: ({
11615
11643
  kind: "session_created";
11616
- data: {};
11644
+ data: {
11645
+ parentSessionId?: string | undefined;
11646
+ };
11617
11647
  v: 1;
11618
11648
  sessionId: string;
11619
11649
  eventIndex: number;
@@ -11911,7 +11941,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
11911
11941
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
11912
11942
  category: "user_only_dependency";
11913
11943
  } | {
11914
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
11944
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
11915
11945
  category: "contract_violation";
11916
11946
  } | {
11917
11947
  detail: "required_capability_unknown" | "required_capability_unavailable";
@@ -12206,7 +12236,9 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
12206
12236
  }>;
12207
12237
  events: ({
12208
12238
  kind: "session_created";
12209
- data: {};
12239
+ data: {
12240
+ parentSessionId?: string | undefined;
12241
+ };
12210
12242
  v: 1;
12211
12243
  sessionId: string;
12212
12244
  eventIndex: number;
@@ -12504,7 +12536,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
12504
12536
  detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
12505
12537
  category: "user_only_dependency";
12506
12538
  } | {
12507
- detail: "invalid_required_output" | "missing_required_output" | "missing_required_notes";
12539
+ detail: "invalid_required_output" | "missing_required_output" | "assessment_followup_required" | "missing_required_notes";
12508
12540
  category: "contract_violation";
12509
12541
  } | {
12510
12542
  detail: "required_capability_unknown" | "required_capability_unavailable";