@ornexus/neocortex 4.60.18 → 4.60.19

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 (88) hide show
  1. package/dist/sbom.cdx.json +6504 -6410
  2. package/docs/install/installer-diagnostics.md +52 -0
  3. package/install.ps1 +1 -1
  4. package/install.sh +1 -1
  5. package/package.json +27 -4
  6. package/packages/client/dist/agent/refresh-stubs.d.ts +7 -0
  7. package/packages/client/dist/agent/refresh-stubs.js +2 -2
  8. package/packages/client/dist/cache/encrypted-cache.d.ts +3 -0
  9. package/packages/client/dist/cache/encrypted-cache.js +1 -1
  10. package/packages/client/dist/checkpoint/checkpoint-client-reader.js +2 -2
  11. package/packages/client/dist/cli.js +3 -3
  12. package/packages/client/dist/commands/activate.js +7 -7
  13. package/packages/client/dist/commands/config.js +1 -1
  14. package/packages/client/dist/commands/invoke.d.ts +64 -0
  15. package/packages/client/dist/commands/invoke.js +54 -47
  16. package/packages/client/dist/config/secure-config.d.ts +9 -3
  17. package/packages/client/dist/config/secure-config.js +8 -8
  18. package/packages/client/dist/config.d.ts +1 -1
  19. package/packages/client/dist/config.js +1 -1
  20. package/packages/client/dist/continuity/continuity-client-state-store.d.ts +1 -0
  21. package/packages/client/dist/continuity/continuity-client-state-store.js +1 -1
  22. package/packages/client/dist/continuity/invoke-hooks.d.ts +2 -1
  23. package/packages/client/dist/continuity/invoke-hooks.js +1 -1
  24. package/packages/client/dist/continuity/sqlite-store.d.ts +21 -0
  25. package/packages/client/dist/continuity/sqlite-store.js +49 -49
  26. package/packages/client/dist/effects/invoke-effect-gateways.d.ts +22 -0
  27. package/packages/client/dist/effects/invoke-effect-gateways.js +1 -0
  28. package/packages/client/dist/errors/frontmatter-diagnostics.d.ts +20 -0
  29. package/packages/client/dist/errors/frontmatter-diagnostics.js +1 -0
  30. package/packages/client/dist/generated/command-registry.generated.d.ts +2836 -0
  31. package/packages/client/dist/generated/command-registry.generated.js +1 -0
  32. package/packages/client/dist/graph-retrieval/pre-command-hook.d.ts +2 -0
  33. package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -1
  34. package/packages/client/dist/index.d.ts +1 -0
  35. package/packages/client/dist/index.js +1 -1
  36. package/packages/client/dist/license/license-client.d.ts +3 -0
  37. package/packages/client/dist/license/license-client.js +1 -1
  38. package/packages/client/dist/machine/fingerprint.d.ts +3 -1
  39. package/packages/client/dist/machine/fingerprint.js +2 -2
  40. package/packages/client/dist/memory/project-memory-writer.js +19 -15
  41. package/packages/client/dist/{subagent-approval-policy.d.ts → policy/subagent-approval-policy.d.ts} +8 -3
  42. package/packages/client/dist/policy/subagent-approval-policy.js +1 -0
  43. package/packages/client/dist/resolvers/local-resolver.d.ts +3 -0
  44. package/packages/client/dist/resolvers/local-resolver.js +4 -4
  45. package/packages/client/dist/runner/cli.d.ts +1 -0
  46. package/packages/client/dist/runner/cli.js +1 -1
  47. package/packages/client/dist/runner/headless/prepared-story-bundle.d.ts +20 -0
  48. package/packages/client/dist/runner/headless/prepared-story-bundle.js +1 -0
  49. package/packages/client/dist/runner/headless/run-yoloop.d.ts +2 -0
  50. package/packages/client/dist/runner/headless/run-yoloop.js +1 -1
  51. package/packages/client/dist/runner/portal-sync-worker.js +1 -1
  52. package/packages/client/dist/runner/scheduler.d.ts +3 -0
  53. package/packages/client/dist/runner/scheduler.js +7 -7
  54. package/packages/client/dist/state/project-state-snapshot.js +1 -1
  55. package/packages/client/dist/tier/tier-aware-client.js +1 -1
  56. package/packages/client/dist/version.d.ts +3 -0
  57. package/packages/client/dist/version.js +1 -0
  58. package/packages/client/dist/yoloop/discovery-hook.js +2 -2
  59. package/packages/client/dist/yoloop/invoke-hooks.js +4 -4
  60. package/packages/client/dist/yoloop/shared-discover-epics.d.ts +9 -3
  61. package/packages/client/dist/yoloop/shared-discover-epics.js +1 -1
  62. package/packages/client/dist/yoloop/shared-yoloop-types.d.ts +24 -0
  63. package/packages/client/dist/yoloop/target-normalization.d.ts +24 -0
  64. package/packages/client/dist/yoloop/target-normalization.js +1 -0
  65. package/packages/client/dist/yoloop/yoloop-client-state-store.d.ts +4 -0
  66. package/packages/client/dist/yoloop/yoloop-client-state-store.js +1 -1
  67. package/packages/shared/dist/command-registry-contract.js +382 -0
  68. package/packages/shared/dist/generated/command-registry.generated.js +4216 -0
  69. package/packages/shared/dist/generated/invocation-schema.generated.js +1850 -0
  70. package/packages/shared/dist/invocation/index.d.ts +175 -0
  71. package/packages/shared/dist/invocation/index.js +587 -0
  72. package/packages/shared/dist/nx-invoke-signature.js +233 -0
  73. package/packages/shared/dist/strict-readonly.js +381 -0
  74. package/packages/shared/dist/yoloop/wave-decision-receipt.js +77 -0
  75. package/targets-stubs/antigravity/gemini.md +1 -1
  76. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  77. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  78. package/targets-stubs/claude-code/neocortex-root.md +5 -2
  79. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  80. package/targets-stubs/claude-code/neocortex.md +7 -2
  81. package/targets-stubs/codex/AGENTS.md +4 -1
  82. package/targets-stubs/codex/neocortex.toml +4 -0
  83. package/targets-stubs/cursor/agent.md +2 -2
  84. package/targets-stubs/gemini-cli/agent.md +2 -2
  85. package/targets-stubs/opencode/neocortex-root.md +4 -1
  86. package/targets-stubs/opencode/neocortex.md +3 -0
  87. package/targets-stubs/vscode/neocortex.agent.md +2 -2
  88. package/packages/client/dist/subagent-approval-policy.js +0 -1
@@ -0,0 +1,77 @@
1
+ /** P208.03 -- public-safe deterministic planning DecisionReceipts. */
2
+ import { createHash } from 'node:crypto';
3
+ export const YOLOOP_WAVE_DECISION_RECEIPT_VERSION = 1;
4
+ export function createYoloopWaveDecisionReceipt(input) {
5
+ const epicId = requireId(input.epicId, 'epic-id-invalid');
6
+ const graphRevision = requireHash(input.graphRevision, 'graph-revision-invalid');
7
+ const createdAt = requireTimestamp(input.createdAt, 'created-at-invalid');
8
+ const selectedStoryIds = uniqueSafe(input.selectedStoryIds.map((id) => requireId(id, 'story-id-invalid')));
9
+ const pairProofs = input.pairProofs.map((proof) => ({
10
+ leftStoryId: requireId(proof.leftStoryId, 'pair-story-id-invalid'),
11
+ rightStoryId: requireId(proof.rightStoryId, 'pair-story-id-invalid'),
12
+ coexist: proof.coexist === true,
13
+ reasonCodes: uniqueSafe(proof.reasonCodes.map(requireReason)),
14
+ refHashes: uniqueSafe((proof.refs ?? []).map(hashPublicRef)),
15
+ })).sort((a, b) => `${a.leftStoryId}:${a.rightStoryId}`.localeCompare(`${b.leftStoryId}:${b.rightStoryId}`));
16
+ const body = {
17
+ schemaVersion: YOLOOP_WAVE_DECISION_RECEIPT_VERSION,
18
+ epicId,
19
+ graphRevision,
20
+ selectedStoryIds,
21
+ pairProofs,
22
+ reasonCodes: uniqueSafe(input.reasonCodes.map(requireReason)),
23
+ budgetHash: hashCanonical(input.budget),
24
+ capacityHash: hashCanonical(input.capacity),
25
+ priorReceiptIds: uniqueSafe((input.priorReceiptIds ?? []).map((id) => requireHash(id, 'prior-receipt-invalid'))),
26
+ createdAt,
27
+ publicSafe: true,
28
+ };
29
+ return Object.freeze({ ...body, receiptId: hashCanonical(body) });
30
+ }
31
+ export function validateYoloopPreparationBundle(bundle, expected) {
32
+ const errors = [];
33
+ if (bundle.schemaVersion !== 1 || bundle.branchless !== true)
34
+ errors.push('bundle-contract-invalid');
35
+ if (bundle.epicId !== expected.epicId || bundle.storyId !== expected.storyId)
36
+ errors.push('bundle-identity-mismatch');
37
+ if (bundle.executionBranch !== expected.executionBranch)
38
+ errors.push('bundle-branch-mismatch');
39
+ if (bundle.baseSha !== expected.baseSha)
40
+ errors.push('bundle-base-stale');
41
+ if (bundle.graphRevision !== expected.graphRevision)
42
+ errors.push('bundle-graph-stale');
43
+ if (![bundle.baseSha, bundle.bundleDigest, bundle.graphRevision, bundle.claimRevision].every(isHash))
44
+ errors.push('bundle-digest-invalid');
45
+ if (!isTimestamp(bundle.createdAt) || !isTimestamp(bundle.expiresAt) || bundle.expiresAt <= expected.nowIso || bundle.expiresAt <= bundle.createdAt)
46
+ errors.push('bundle-expired');
47
+ if (!Array.isArray(bundle.validationRefs) || bundle.validationRefs.length === 0 || bundle.validationRefs.some((ref) => !isSafeRef(ref)))
48
+ errors.push('bundle-validation-missing');
49
+ return [...new Set(errors)].sort();
50
+ }
51
+ function hashCanonical(value) {
52
+ return createHash('sha256').update(canonical(value)).digest('hex');
53
+ }
54
+ function canonical(value) {
55
+ if (value === null || typeof value !== 'object')
56
+ return JSON.stringify(value);
57
+ if (Array.isArray(value))
58
+ return `[${value.map(canonical).join(',')}]`;
59
+ return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => `${JSON.stringify(key)}:${canonical(item)}`).join(',')}}`;
60
+ }
61
+ function hashPublicRef(ref) {
62
+ if (!isSafeRef(ref))
63
+ throw new Error('decision-ref-unsafe');
64
+ return createHash('sha256').update(ref).digest('hex');
65
+ }
66
+ function requireId(value, code) { if (!/^[A-Za-z0-9._-]{1,80}$/.test(value))
67
+ throw new Error(code); return value; }
68
+ function requireReason(value) { if (!/^[a-z0-9][a-z0-9._-]{0,79}$/.test(value))
69
+ throw new Error('reason-code-invalid'); return value; }
70
+ function requireHash(value, code) { if (!isHash(value))
71
+ throw new Error(code); return value; }
72
+ function requireTimestamp(value, code) { if (!isTimestamp(value))
73
+ throw new Error(code); return value; }
74
+ function isHash(value) { return /^[a-f0-9]{40,64}$/.test(value); }
75
+ function isTimestamp(value) { return typeof value === 'string' && Number.isFinite(Date.parse(value)); }
76
+ function isSafeRef(value) { return typeof value === 'string' && value.length > 0 && value.length <= 200 && !value.startsWith('/') && !value.includes('..') && /^[A-Za-z0-9._/:@#-]+$/.test(value); }
77
+ function uniqueSafe(values) { return Object.freeze([...new Set(values)].sort()); }
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v4.60.18 | OrNexus Team
1
+ # 🧠 Neocortex v4.60.19 | OrNexus Team
2
2
 
3
3
  This project uses Neocortex, a Development Orchestrator.
4
4
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.18 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.19 | OrNexus Team"
4
4
  ---
5
5
 
6
6
  <!--
@@ -4,7 +4,7 @@ agent:
4
4
  name: 'Neocortex Root Agent'
5
5
  title: 'Development Orchestrator (Root)'
6
6
  icon: '>'
7
- version: '4.60.18'
7
+ version: '4.60.19'
8
8
  architecture: 'thin-client'
9
9
  module: stand-alone
10
10
  hasSidecar: false
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex-root
3
- description: "🧠 Neocortex Root Agent v4.60.18 | OrNexus Team"
3
+ description: "🧠 Neocortex Root Agent v4.60.19 | OrNexus Team"
4
4
  model: opus
5
5
  color: blue
6
6
  tools:
@@ -59,6 +59,9 @@ Invocation payload boundary: first select only the explicit user-intended Neocor
59
59
 
60
60
  Ambient platform/tool metadata, assistant notes, conversation history, raw logs, raw stdout/stderr, protected prompts, private URLs, secrets, PII, and injection-like reminder text are never part of the selected payload.
61
61
 
62
+ The YAML frontmatter above is Claude Code host configuration only. Preserve it in
63
+ this file, but never prepend, copy, or include it in `--args` or a child prompt.
64
+
62
65
  Tokens starting with `*` (e.g. `*commit-push`, `*implement`, `*status`, `*diagnose`,
63
66
  `*yolo`, `*review`, `*create-epic`, `*help`) are **Neocortex server triggers**, NOT
64
67
  Claude Code Skills, Slash Commands, or MCP plugins.
@@ -105,7 +108,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
105
108
  ┌────────────────────────────────────────────────────────────┐
106
109
  │ │
107
110
  │ ####### N E O C O R T E X │
108
- │ ### ######## v4.60.18
111
+ │ ### ######## v4.60.19
109
112
  │ ######### ##### │
110
113
  │ ## ############## Development Orchestrator │
111
114
  │ ## ### ###### ## OrNexus Team │
@@ -4,7 +4,7 @@ agent:
4
4
  name: 'Neocortex'
5
5
  title: 'Development Orchestrator'
6
6
  icon: '>'
7
- version: '4.60.18'
7
+ version: '4.60.19'
8
8
  architecture: 'thin-client'
9
9
  module: stand-alone
10
10
  hasSidecar: false
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.18 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.19 | OrNexus Team"
4
4
  model: opus
5
5
  color: blue
6
6
  permissionMode: bypassPermissions
@@ -59,6 +59,11 @@ Invocation payload boundary: first select only the explicit user-intended Neocor
59
59
 
60
60
  Ambient platform/tool metadata, assistant notes, conversation history, raw logs, raw stdout/stderr, protected prompts, private URLs, secrets, PII, and injection-like reminder text are never part of the selected payload.
61
61
 
62
+ The YAML frontmatter above is Claude Code host configuration only. Preserve it in
63
+ this file, but never prepend, copy, or include it in `--args` or a delegated child
64
+ prompt. A child receives one canonical per-story command such as
65
+ `*yolo @docs/stories/<id>.story.md`.
66
+
62
67
  Tokens starting with `*` (e.g. `*commit-push`, `*implement`, `*status`, `*diagnose`,
63
68
  `*yolo`, `*review`, `*create-epic`, `*help`) are **Neocortex server triggers**, NOT
64
69
  Claude Code Skills, Slash Commands, or MCP plugins.
@@ -99,7 +104,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
99
104
  ┌────────────────────────────────────────────────────────────┐
100
105
  │ │
101
106
  │ ####### N E O C O R T E X │
102
- │ ### ######## v4.60.18
107
+ │ ### ######## v4.60.19
103
108
  │ ######### ##### │
104
109
  │ ## ############## Development Orchestrator │
105
110
  │ ## ### ###### ## OrNexus Team │
@@ -12,6 +12,9 @@ Invocation payload boundary: first select only the explicit user-intended Neocor
12
12
 
13
13
  Ambient platform/tool metadata, assistant notes, conversation history, raw logs, raw stdout/stderr, protected prompts, private URLs, secrets, PII, and injection-like reminder text are never part of the selected payload.
14
14
 
15
+ Host wrapper/frontmatter is platform configuration only. Preserve it in its file,
16
+ but never prepend, copy, or include it in `--args` or a delegated child prompt.
17
+
15
18
  Tokens starting with `*` (e.g. `*commit-push`, `*implement`, `*status`, `*diagnose`,
16
19
  `*yolo`, `*review`, `*create-epic`, `*help`) are **Neocortex server triggers**, NOT
17
20
  Codex built-in commands or actions.
@@ -25,7 +28,7 @@ Codex built-in commands or actions.
25
28
 
26
29
  <!-- END: Plugin Conflict Prevention -->
27
30
 
28
- # Neocortex v4.60.18 | OrNexus Team
31
+ # Neocortex v4.60.19 | OrNexus Team
29
32
 
30
33
  You are a Development Orchestrator. All orchestration logic is delivered by the remote Neocortex server.
31
34
 
@@ -22,6 +22,10 @@ Invocation payload boundary: first select only the explicit user-intended Neocor
22
22
 
23
23
  Ambient platform/tool metadata, assistant notes, conversation history, raw logs, raw stdout/stderr, protected prompts, private URLs, secrets, PII, and injection-like reminder text are never part of the selected payload.
24
24
 
25
+ Host wrapper/frontmatter is platform configuration only. Never prepend, copy, or
26
+ include it in `{DELEGATED_PROMPT}`; the delegated payload must remain one canonical
27
+ per-story command such as `*yolo @docs/stories/<id>.story.md`.
28
+
25
29
  neocortex-client invoke \
26
30
  --args "{DELEGATED_PROMPT}" \
27
31
  --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" \
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.18 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.19 | OrNexus Team"
4
4
  model: inherit
5
5
  readonly: false
6
6
  is_background: false
@@ -64,7 +64,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
64
64
  ┌────────────────────────────────────────────────────────────┐
65
65
  │ │
66
66
  │ ####### N E O C O R T E X │
67
- │ ### ######## v4.60.18
67
+ │ ### ######## v4.60.19
68
68
  │ ######### ##### │
69
69
  │ ## ############## Development Orchestrator │
70
70
  │ ## ### ###### ## OrNexus Team │
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex-root
3
- description: "🧠 Neocortex v4.60.18 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.19 | OrNexus Team"
4
4
  kind: local
5
5
  tools:
6
6
  # File operations (Gemini CLI built-ins)
@@ -62,7 +62,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
62
62
  ┌────────────────────────────────────────────────────────────┐
63
63
  │ │
64
64
  │ ####### N E O C O R T E X │
65
- │ ### ######## v4.60.18
65
+ │ ### ######## v4.60.19
66
66
  │ ######### ##### │
67
67
  │ ## ############## Development Orchestrator │
68
68
  │ ## ### ###### ## OrNexus Team │
@@ -16,6 +16,9 @@ Invocation payload boundary: first select only the explicit user-intended Neocor
16
16
 
17
17
  Ambient platform/tool metadata, assistant notes, conversation history, raw logs, raw stdout/stderr, protected prompts, private URLs, secrets, PII, and injection-like reminder text are never part of the selected payload.
18
18
 
19
+ The YAML frontmatter above is OpenCode host configuration only. Preserve it in
20
+ this file, but never prepend, copy, or include it in `--args` or a child prompt.
21
+
19
22
  Tokens starting with `*` (e.g. `*commit-push`, `*implement`, `*status`, `*diagnose`,
20
23
  `*yolo`, `*review`, `*create-epic`, `*help`) are **Neocortex server triggers**, NOT
21
24
  OpenCode built-in commands or local plugins.
@@ -55,7 +58,7 @@ explicit server opt-in rather than a local assumption.
55
58
  ┌────────────────────────────────────────────────────────────┐
56
59
  │ │
57
60
  │ ####### N E O C O R T E X │
58
- │ ### ######## v4.60.18
61
+ │ ### ######## v4.60.19
59
62
  │ ######### ##### │
60
63
  │ ## ############## Development Orchestrator │
61
64
  │ ## ### ###### ## OrNexus Team │
@@ -12,6 +12,9 @@ permission:
12
12
 
13
13
  You are the isolated `neocortex` subagent for OpenCode.
14
14
 
15
+ The YAML frontmatter above is OpenCode host configuration only. Preserve it in
16
+ this file, but never prepend, copy, or include it in `{DELEGATED_PROMPT}`.
17
+
15
18
  ## Canonical Project Memory
16
19
 
17
20
  `NEOCORTEX.md` is the canonical project-memory source. This OpenCode subagent
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "neocortex"
3
- description: "Neocortex v4.60.18 | OrNexus Team"
3
+ description: "Neocortex v4.60.19 | OrNexus Team"
4
4
  tools:
5
5
  # Read / Edit (built-in tool sets)
6
6
  - read
@@ -68,7 +68,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
68
68
  ┌────────────────────────────────────────────────────────────┐
69
69
  │ │
70
70
  │ ####### N E O C O R T E X │
71
- │ ### ######## v4.60.18
71
+ │ ### ######## v4.60.19
72
72
  │ ######### ##### │
73
73
  │ ## ############## Development Orchestrator │
74
74
  │ ## ### ###### ## OrNexus Team │
@@ -1 +0,0 @@
1
- import{normalizeTargetId as r}from"./adapters/platform-detector.js";const m=1,u="max",p="[P201-EV-MAX-POLICY]",a="host-capability-unvalidated",c="host-capability-unsupported",i=Object.freeze({"claude-code":{maximumMode:"max",scope:"child",reductionReason:"host-policy-reduced",fallbackMode:"none",fallbackReasonCode:null},opencode:{maximumMode:"standard",scope:"child",reductionReason:a,fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},codex:{maximumMode:"standard",scope:"inherited",reductionReason:a,fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},gemini:{maximumMode:"standard",scope:"inherited",reductionReason:a,fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},vscode:{maximumMode:"standard",scope:"session",reductionReason:a,fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},"github-copilot-cli":{maximumMode:"standard",scope:"session",reductionReason:a,fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},kimi:{maximumMode:"standard",scope:"inherited",reductionReason:a,fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},cursor:{maximumMode:"standard",scope:"session",reductionReason:a,fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},antigravity:{maximumMode:"standard",scope:"inherited",reductionReason:a,fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},openclaw:{maximumMode:"disabled",scope:"none",reductionReason:c,fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unsupported"},runner:{maximumMode:"disabled",scope:"none",reductionReason:c,fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unsupported"},unknown:{maximumMode:"disabled",scope:"none",reductionReason:"platform-target-unknown",fallbackMode:"shell-loop",fallbackReasonCode:"platform-target-unknown"}}),s=Object.freeze({disabled:0,standard:1,max:2});function M(e){return e==="max"||e==="standard"||e==="disabled"}function f(e){const o=e?r(e)??"unknown":"unknown",d=i[o];return Object.freeze({platformTarget:o,maximumMode:d.maximumMode,scope:d.scope,reductionReason:d.reductionReason})}function R(e={}){const o=e.userOverride??u,d=e.userOverride?"user-override":"managed-default",n=e.hostPolicy??f(e.platformTarget),l=i[n.platformTarget],t=s[o]>s[n.maximumMode];return Object.freeze({schemaVersion:m,requestedMode:o,effectiveMode:t?n.maximumMode:o,source:d,platformTarget:n.platformTarget,scope:n.scope,effectiveReason:t?n.reductionReason:"requested-mode-honored",fallbackMode:l.fallbackMode,fallbackReasonCode:l.fallbackReasonCode})}function k(e,o,d){return Object.freeze({evidence:p,event:e,occurredAt:d,...o})}export{p as SUBAGENT_APPROVAL_EVIDENCE,u as SUBAGENT_APPROVAL_MANAGED_DEFAULT,m as SUBAGENT_APPROVAL_POLICY_SCHEMA_VERSION,k as createSubagentApprovalAuditEvent,f as deriveSubagentHostApprovalPolicy,M as isSubagentApprovalMode,R as resolveSubagentApprovalPolicy};