@intutic/cli 1.10.1 → 2.1.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 (177) hide show
  1. package/dist/cli.js +120 -128
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/attenuate.d.ts.map +1 -1
  4. package/dist/commands/attenuate.js +4 -2
  5. package/dist/commands/attenuate.js.map +1 -1
  6. package/dist/commands/budget.d.ts.map +1 -1
  7. package/dist/commands/budget.js +2 -2
  8. package/dist/commands/budget.js.map +1 -1
  9. package/dist/commands/connect.d.ts.map +1 -1
  10. package/dist/commands/connect.js +20 -9
  11. package/dist/commands/connect.js.map +1 -1
  12. package/dist/commands/doctor.d.ts +19 -1
  13. package/dist/commands/doctor.d.ts.map +1 -1
  14. package/dist/commands/doctor.js +33 -41
  15. package/dist/commands/doctor.js.map +1 -1
  16. package/dist/commands/enforce.d.ts +10 -0
  17. package/dist/commands/enforce.d.ts.map +1 -1
  18. package/dist/commands/enforce.js +36 -0
  19. package/dist/commands/enforce.js.map +1 -1
  20. package/dist/commands/exec.d.ts +7 -8
  21. package/dist/commands/exec.d.ts.map +1 -1
  22. package/dist/commands/exec.js +59 -60
  23. package/dist/commands/exec.js.map +1 -1
  24. package/dist/commands/gateway.d.ts.map +1 -1
  25. package/dist/commands/gateway.js +3 -1
  26. package/dist/commands/gateway.js.map +1 -1
  27. package/dist/commands/guardrails.d.ts.map +1 -1
  28. package/dist/commands/guardrails.js +18 -1
  29. package/dist/commands/guardrails.js.map +1 -1
  30. package/dist/commands/init.d.ts +5 -2
  31. package/dist/commands/init.d.ts.map +1 -1
  32. package/dist/commands/init.js +36 -22
  33. package/dist/commands/init.js.map +1 -1
  34. package/dist/commands/install-daemon.d.ts +1 -1
  35. package/dist/commands/install-daemon.d.ts.map +1 -1
  36. package/dist/commands/install-daemon.js +5 -3
  37. package/dist/commands/install-daemon.js.map +1 -1
  38. package/dist/commands/integrity.d.ts +31 -2
  39. package/dist/commands/integrity.d.ts.map +1 -1
  40. package/dist/commands/integrity.js +109 -3
  41. package/dist/commands/integrity.js.map +1 -1
  42. package/dist/commands/judge.d.ts +8 -4
  43. package/dist/commands/judge.d.ts.map +1 -1
  44. package/dist/commands/judge.js +41 -21
  45. package/dist/commands/judge.js.map +1 -1
  46. package/dist/commands/login.d.ts +1 -0
  47. package/dist/commands/login.d.ts.map +1 -1
  48. package/dist/commands/login.js +16 -1
  49. package/dist/commands/login.js.map +1 -1
  50. package/dist/commands/setup.d.ts +1 -2
  51. package/dist/commands/setup.d.ts.map +1 -1
  52. package/dist/commands/setup.js +11 -68
  53. package/dist/commands/setup.js.map +1 -1
  54. package/dist/commands/skill.d.ts +1 -0
  55. package/dist/commands/skill.d.ts.map +1 -1
  56. package/dist/commands/skill.js +17 -3
  57. package/dist/commands/skill.js.map +1 -1
  58. package/dist/commands/start.d.ts.map +1 -1
  59. package/dist/commands/start.js +5 -1
  60. package/dist/commands/start.js.map +1 -1
  61. package/dist/commands/syncContext.d.ts.map +1 -1
  62. package/dist/commands/syncContext.js +15 -5
  63. package/dist/commands/syncContext.js.map +1 -1
  64. package/dist/config/paths.d.ts +25 -3
  65. package/dist/config/paths.d.ts.map +1 -1
  66. package/dist/config/paths.js +47 -7
  67. package/dist/config/paths.js.map +1 -1
  68. package/dist/harness/agentFramework.d.ts +25 -0
  69. package/dist/harness/agentFramework.d.ts.map +1 -0
  70. package/dist/harness/agentFramework.js +37 -0
  71. package/dist/harness/agentFramework.js.map +1 -0
  72. package/dist/harness/agentcore.d.ts +6 -3
  73. package/dist/harness/agentcore.d.ts.map +1 -1
  74. package/dist/harness/agentcore.js +7 -4
  75. package/dist/harness/agentcore.js.map +1 -1
  76. package/dist/harness/aiSdkHarness.d.ts +1 -1
  77. package/dist/harness/aiSdkHarness.js +1 -1
  78. package/dist/harness/aiSdkWorkflow.d.ts +1 -1
  79. package/dist/harness/aiSdkWorkflow.d.ts.map +1 -1
  80. package/dist/harness/aiSdkWorkflow.js +5 -3
  81. package/dist/harness/aiSdkWorkflow.js.map +1 -1
  82. package/dist/harness/aider.d.ts +4 -3
  83. package/dist/harness/aider.d.ts.map +1 -1
  84. package/dist/harness/aider.js +7 -6
  85. package/dist/harness/aider.js.map +1 -1
  86. package/dist/harness/antigravity.d.ts +4 -2
  87. package/dist/harness/antigravity.d.ts.map +1 -1
  88. package/dist/harness/antigravity.js +14 -12
  89. package/dist/harness/antigravity.js.map +1 -1
  90. package/dist/harness/cline.d.ts +10 -4
  91. package/dist/harness/cline.d.ts.map +1 -1
  92. package/dist/harness/cline.js +39 -32
  93. package/dist/harness/cline.js.map +1 -1
  94. package/dist/harness/codex.d.ts +10 -4
  95. package/dist/harness/codex.d.ts.map +1 -1
  96. package/dist/harness/codex.js +28 -26
  97. package/dist/harness/codex.js.map +1 -1
  98. package/dist/harness/continue.d.ts +8 -5
  99. package/dist/harness/continue.d.ts.map +1 -1
  100. package/dist/harness/continue.js +27 -63
  101. package/dist/harness/continue.js.map +1 -1
  102. package/dist/harness/detector.d.ts +1 -1
  103. package/dist/harness/detector.d.ts.map +1 -1
  104. package/dist/harness/detector.js +3 -1
  105. package/dist/harness/detector.js.map +1 -1
  106. package/dist/harness/dsh.d.ts +2 -2
  107. package/dist/harness/dsh.js +3 -3
  108. package/dist/harness/dsh.js.map +1 -1
  109. package/dist/harness/eve.d.ts +1 -1
  110. package/dist/harness/eve.js +1 -1
  111. package/dist/harness/githubCopilot.d.ts +4 -2
  112. package/dist/harness/githubCopilot.d.ts.map +1 -1
  113. package/dist/harness/githubCopilot.js +10 -2
  114. package/dist/harness/githubCopilot.js.map +1 -1
  115. package/dist/harness/jsSdkGatedAdapter.d.ts.map +1 -1
  116. package/dist/harness/jsSdkGatedAdapter.js +4 -3
  117. package/dist/harness/jsSdkGatedAdapter.js.map +1 -1
  118. package/dist/harness/langgraph.js +4 -4
  119. package/dist/harness/langgraph.js.map +1 -1
  120. package/dist/harness/n8n.d.ts +5 -2
  121. package/dist/harness/n8n.d.ts.map +1 -1
  122. package/dist/harness/n8n.js +12 -3
  123. package/dist/harness/n8n.js.map +1 -1
  124. package/dist/harness/openWebUI.d.ts +7 -2
  125. package/dist/harness/openWebUI.d.ts.map +1 -1
  126. package/dist/harness/openWebUI.js +15 -4
  127. package/dist/harness/openWebUI.js.map +1 -1
  128. package/dist/harness/opencode.d.ts +3 -2
  129. package/dist/harness/opencode.d.ts.map +1 -1
  130. package/dist/harness/opencode.js +3 -2
  131. package/dist/harness/opencode.js.map +1 -1
  132. package/dist/harness/openhands.d.ts +3 -2
  133. package/dist/harness/openhands.d.ts.map +1 -1
  134. package/dist/harness/openhands.js +27 -26
  135. package/dist/harness/openhands.js.map +1 -1
  136. package/dist/harness/rooCode.d.ts +6 -5
  137. package/dist/harness/rooCode.d.ts.map +1 -1
  138. package/dist/harness/rooCode.js +9 -12
  139. package/dist/harness/rooCode.js.map +1 -1
  140. package/dist/harness/sdkGatedAdapter.d.ts.map +1 -1
  141. package/dist/harness/sdkGatedAdapter.js +4 -3
  142. package/dist/harness/sdkGatedAdapter.js.map +1 -1
  143. package/dist/harness/trueforge.js +2 -2
  144. package/dist/harness/trueforge.js.map +1 -1
  145. package/dist/harness/types.d.ts.map +1 -1
  146. package/dist/harness/types.js +3 -0
  147. package/dist/harness/types.js.map +1 -1
  148. package/dist/harness/windsurf.d.ts +4 -2
  149. package/dist/harness/windsurf.d.ts.map +1 -1
  150. package/dist/harness/windsurf.js +12 -5
  151. package/dist/harness/windsurf.js.map +1 -1
  152. package/dist/lib/localProxy.d.ts +19 -0
  153. package/dist/lib/localProxy.d.ts.map +1 -0
  154. package/dist/lib/localProxy.js +33 -0
  155. package/dist/lib/localProxy.js.map +1 -0
  156. package/dist/lib/onboarding.d.ts +1 -1
  157. package/dist/lib/onboarding.d.ts.map +1 -1
  158. package/dist/lib/onboarding.js +21 -27
  159. package/dist/lib/onboarding.js.map +1 -1
  160. package/dist/lib/sandbox/image.d.ts +27 -0
  161. package/dist/lib/sandbox/image.d.ts.map +1 -0
  162. package/dist/lib/sandbox/image.js +54 -0
  163. package/dist/lib/sandbox/image.js.map +1 -0
  164. package/dist/lib/sandbox/oci.d.ts +1 -0
  165. package/dist/lib/sandbox/oci.d.ts.map +1 -1
  166. package/dist/lib/sandbox/oci.js +4 -0
  167. package/dist/lib/sandbox/oci.js.map +1 -1
  168. package/dist/lib/sandbox/types.d.ts +5 -0
  169. package/dist/lib/sandbox/types.d.ts.map +1 -1
  170. package/package.json +6 -5
  171. package/resources/sandbox/Dockerfile +30 -0
  172. package/resources/sandbox/entrypoint.sh +108 -0
  173. package/resources/sandbox/firecracker-launch.sh +120 -0
  174. package/dist/harness/vscodeSettingsWriter.d.ts +0 -40
  175. package/dist/harness/vscodeSettingsWriter.d.ts.map +0 -1
  176. package/dist/harness/vscodeSettingsWriter.js +0 -116
  177. package/dist/harness/vscodeSettingsWriter.js.map +0 -1
@@ -0,0 +1,37 @@
1
+ /**
2
+ * agentFramework.ts — Microsoft Agent Framework adapter (env-file config,
3
+ * SDK-side gate).
4
+ *
5
+ * Same shape as langgraph.ts (see sdkGatedAdapter.ts). Agent Framework (the
6
+ * AutoGen + Semantic Kernel successor, `agent-framework` /
7
+ * `agent-framework-core` on PyPI, imported as `agent_framework`) is a separate
8
+ * framework from AutoGen (autogen.ts), so it has its own adapter (TD-375).
9
+ * Its tools run in the agent's own Python process, so the blocking gate ships
10
+ * SDK-side via
11
+ * `intutic_clawde.gate.adapters.agent_framework.IntuticFunctionMiddleware`, a
12
+ * `FunctionMiddleware` that skips `call_next()` on a deny (verified live
13
+ * against agent-framework-core==1.20.0).
14
+ *
15
+ * "agent-framework" is a generic phrase, so detection anchors the start of the
16
+ * name: it must not follow a letter, digit, `-`, `_` or `.`. That matches
17
+ * `agent-framework`, `agent-framework-core`, `agent-framework-openai` and the
18
+ * `agent_framework` spelling, but not some other project's
19
+ * `my-agent-framework`.
20
+ *
21
+ * HLD §3.14 — Harness Onboarding Matrix
22
+ * @module
23
+ */
24
+ import { HarnessType } from '@intutic/shared-types';
25
+ import { makeSdkGatedAdapter } from './sdkGatedAdapter.js';
26
+ const AGENT_FRAMEWORK_TOKEN = /(?:^|[^a-z0-9_.-])agent[-_]framework(?![a-z0-9])/m;
27
+ export const agentFrameworkAdapter = makeSdkGatedAdapter({
28
+ type: HarnessType.AGENT_FRAMEWORK,
29
+ label: 'Microsoft Agent Framework',
30
+ keywords: [AGENT_FRAMEWORK_TOKEN],
31
+ pipInstall: 'intutic-clawde[agent-framework]',
32
+ importLine: 'from intutic_clawde.gate.adapters.agent_framework import IntuticFunctionMiddleware',
33
+ usageSummary: 'Agent(middleware=[IntuticFunctionMiddleware()]) skips call_next() on a denied tool call, ' +
34
+ 'so the tool never runs and the model receives the refusal as the tool result.',
35
+ docsSlug: 'microsoft-agent-framework',
36
+ });
37
+ //# sourceMappingURL=agentFramework.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentFramework.js","sourceRoot":"","sources":["../../src/harness/agentFramework.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,qBAAqB,GAAG,mDAAmD,CAAA;AAEjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;IACvD,IAAI,EAAE,WAAW,CAAC,eAAe;IACjC,KAAK,EAAE,2BAA2B;IAClC,QAAQ,EAAE,CAAC,qBAAqB,CAAC;IACjC,UAAU,EAAE,iCAAiC;IAC7C,UAAU,EAAE,oFAAoF;IAChG,YAAY,EACV,2FAA2F;QAC3F,+EAA+E;IACjF,QAAQ,EAAE,2BAA2B;CACtC,CAAC,CAAA"}
@@ -40,9 +40,12 @@
40
40
  * commands write (confirmed via `bedrock_agentcore_starter_toolkit/cli/
41
41
  * runtime/_configure_impl.py` and every other CLI subcommand module that
42
42
  * reads it).
43
- * 5. `agentcore/agentcore.json` or `aws-targets.json` at the workspace root —
44
- * the config files the npm `@aws/agentcore` CLI writes (confirmed via the
45
- * literal strings in the published `dist/cli/index.mjs` bundle).
43
+ * 5. `agentcore/agentcore.json` or `agentcore/aws-targets.json` — the config
44
+ * files the npm `@aws/agentcore` CLI writes. Both live in the project's
45
+ * `agentcore/` directory, not at the root: confirmed by running
46
+ * `agentcore create` (0.31.1) offline with no AWS credentials, whose real
47
+ * output is vendored in `__fixtures__/agentcore-cli-0.31.1/`, and by the
48
+ * `${root}/agentcore/aws-targets.json` paths in the 0.27.0 bundle.
46
49
  *
47
50
  * No ReDoS surface: every check below is a plain substring/property test
48
51
  * over locally-read files, never a regex over untrusted network input.
@@ -1 +1 @@
1
- {"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../src/harness/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAiDjD,eAAO,MAAM,gBAAgB,EAAE,eAuB9B,CAAA"}
1
+ {"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../src/harness/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAiDjD,eAAO,MAAM,gBAAgB,EAAE,eAuB9B,CAAA"}
@@ -40,9 +40,12 @@
40
40
  * commands write (confirmed via `bedrock_agentcore_starter_toolkit/cli/
41
41
  * runtime/_configure_impl.py` and every other CLI subcommand module that
42
42
  * reads it).
43
- * 5. `agentcore/agentcore.json` or `aws-targets.json` at the workspace root —
44
- * the config files the npm `@aws/agentcore` CLI writes (confirmed via the
45
- * literal strings in the published `dist/cli/index.mjs` bundle).
43
+ * 5. `agentcore/agentcore.json` or `agentcore/aws-targets.json` — the config
44
+ * files the npm `@aws/agentcore` CLI writes. Both live in the project's
45
+ * `agentcore/` directory, not at the root: confirmed by running
46
+ * `agentcore create` (0.31.1) offline with no AWS credentials, whose real
47
+ * output is vendored in `__fixtures__/agentcore-cli-0.31.1/`, and by the
48
+ * `${root}/agentcore/aws-targets.json` paths in the 0.27.0 bundle.
46
49
  *
47
50
  * No ReDoS surface: every check below is a plain substring/property test
48
51
  * over locally-read files, never a regex over untrusted network input.
@@ -56,7 +59,7 @@ import { HarnessType } from '@intutic/shared-types';
56
59
  /** Python manifests scanned for the SDK/toolkit package names. */
57
60
  const PYTHON_MANIFESTS = ['pyproject.toml', 'requirements.txt', 'uv.lock'];
58
61
  /** Config files the `agentcore` CLIs (npm + Python starter toolkit) write. */
59
- const CONFIG_FILE_SIGNALS = ['.bedrock_agentcore.yaml', 'agentcore/agentcore.json', 'aws-targets.json'];
62
+ const CONFIG_FILE_SIGNALS = ['.bedrock_agentcore.yaml', 'agentcore/agentcore.json', 'agentcore/aws-targets.json'];
60
63
  async function hasAnyConfigFile(workspaceRoot) {
61
64
  for (const rel of CONFIG_FILE_SIGNALS) {
62
65
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"agentcore.js","sourceRoot":"","sources":["../../src/harness/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAInD,kEAAkE;AAClE,MAAM,gBAAgB,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,SAAS,CAAU,CAAA;AAEnF,8EAA8E;AAC9E,MAAM,mBAAmB,GAAG,CAAC,yBAAyB,EAAE,0BAA0B,EAAE,kBAAk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AED,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,IAAI,EAAE,WAAW,CAAC,iBAAiB;IACnC,mEAAmE;IACnE,yEAAyE;IACzE,mEAAmE;IACnE,cAAc,EAAE,EAAE;IAElB,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,IAAI,MAAM,gBAAgB,CAAC,aAAa,CAAC;YAAE,OAAO,IAAI,CAAA;QACtD,IAAI,MAAM,uBAAuB,CAAC,aAAa,CAAC;YAAE,OAAO,IAAI,CAAA;QAC7D,OAAO,qBAAqB,CAAC,aAAa,CAAC,CAAA;IAC7C,CAAC;IAED,yEAAyE;IACzE,2EAA2E;IAC3E,2DAA2D;IAC3D,KAAK,CAAC,WAAW,CAAC,cAAsB,EAAE,KAAqB,EAAE,SAAiB;QAChF,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,cAAsB;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
@@ -10,7 +10,7 @@
10
10
  * framework, hence `requiresAnyPrefix` rather than a single required package.
11
11
  *
12
12
  * TWO DOCUMENTED LIMITATIONS carried into the generated `.env.intutic`
13
- * (both confirmed against `@ai-sdk/harness@1.0.75`'s shipped types — see
13
+ * (both confirmed against `@ai-sdk/harness@1.0.75`'s shipped types, re-read on 1.0.138 — see
14
14
  * `@intutic/gate/harness`'s module doc for the full record):
15
15
  *
16
16
  * 1. Tool execution is SERVER-SIDE, in Vercel Sandbox microVMs — the
@@ -10,7 +10,7 @@
10
10
  * framework, hence `requiresAnyPrefix` rather than a single required package.
11
11
  *
12
12
  * TWO DOCUMENTED LIMITATIONS carried into the generated `.env.intutic`
13
- * (both confirmed against `@ai-sdk/harness@1.0.75`'s shipped types — see
13
+ * (both confirmed against `@ai-sdk/harness@1.0.75`'s shipped types, re-read on 1.0.138 — see
14
14
  * `@intutic/gate/harness`'s module doc for the full record):
15
15
  *
16
16
  * 1. Tool execution is SERVER-SIDE, in Vercel Sandbox microVMs — the
@@ -13,7 +13,7 @@
13
13
  * with both declares `@ai-sdk/workflow` anyway, which is the trigger.
14
14
  *
15
15
  * DOCUMENTED SEMANTICS carried into the generated `.env.intutic` (confirmed
16
- * against `@ai-sdk/workflow@1.0.69` + `workflow@4.8.3` — see
16
+ * against `@ai-sdk/workflow@1.0.69` + `workflow@4.8.3`, re-verified on 2.0.58 + 5.0.1 — see
17
17
  * `@intutic/gate/workflow`'s module doc for the full record): WorkflowAgent
18
18
  * has no agent-level approval option; the veto surface is per-tool
19
19
  * `needsApproval`, and a refusal thrown from it must be FatalError-compatible
@@ -1 +1 @@
1
- {"version":3,"file":"aiSdkWorkflow.d.ts","sourceRoot":"","sources":["../../src/harness/aiSdkWorkflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,eAAO,MAAM,oBAAoB,sCAY/B,CAAA"}
1
+ {"version":3,"file":"aiSdkWorkflow.d.ts","sourceRoot":"","sources":["../../src/harness/aiSdkWorkflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,eAAO,MAAM,oBAAoB,sCAc/B,CAAA"}
@@ -13,7 +13,7 @@
13
13
  * with both declares `@ai-sdk/workflow` anyway, which is the trigger.
14
14
  *
15
15
  * DOCUMENTED SEMANTICS carried into the generated `.env.intutic` (confirmed
16
- * against `@ai-sdk/workflow@1.0.69` + `workflow@4.8.3` — see
16
+ * against `@ai-sdk/workflow@1.0.69` + `workflow@4.8.3`, re-verified on 2.0.58 + 5.0.1 — see
17
17
  * `@intutic/gate/workflow`'s module doc for the full record): WorkflowAgent
18
18
  * has no agent-level approval option; the veto surface is per-tool
19
19
  * `needsApproval`, and a refusal thrown from it must be FatalError-compatible
@@ -29,8 +29,10 @@ export const aiSdkWorkflowAdapter = makeJsSdkGatedAdapter({
29
29
  label: 'AI SDK Workflow',
30
30
  requires: [{ name: '@ai-sdk/workflow' }],
31
31
  npmInstall: '@intutic/gate',
32
- importLine: "import { intuticNeedsApproval, withIntuticApproval } from '@intutic/gate/workflow'",
33
- usageSummary: 'new WorkflowAgent({ ..., tools: withIntuticApproval(tools) }) — attaches an async needsApproval ' +
32
+ importLine: "import { intuticApprovalStep, withIntuticApproval } from '@intutic/gate/workflow'",
33
+ usageSummary: 'new WorkflowAgent({ ..., tools: withIntuticApproval(tools, { step: intuticGate }) }), where ' +
34
+ "intuticGate is your own \"use step\" function returning intuticApprovalStep(toolName, input, { gate }) " +
35
+ '(needsApproval runs in the workflow sandbox, which has no Node.js). Attaches an async needsApproval ' +
34
36
  'per tool (WorkflowAgent itself has no approval option). BLOCK throws a FatalError-compatible ' +
35
37
  'refusal so the durable runtime aborts instead of retry-looping the denial; ALLOW resolves ' +
36
38
  "false (or true with { onAllow: 'human' } to keep the durable human-approval pause).",
@@ -1 +1 @@
1
- {"version":3,"file":"aiSdkWorkflow.js","sourceRoot":"","sources":["../../src/harness/aiSdkWorkflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;IACxD,IAAI,EAAE,WAAW,CAAC,eAAe;IACjC,KAAK,EAAE,iBAAiB;IACxB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IACxC,UAAU,EAAE,eAAe;IAC3B,UAAU,EAAE,oFAAoF;IAChG,YAAY,EACV,kGAAkG;QAClG,+FAA+F;QAC/F,4FAA4F;QAC5F,qFAAqF;IACvF,QAAQ,EAAE,iBAAiB;CAC5B,CAAC,CAAA"}
1
+ {"version":3,"file":"aiSdkWorkflow.js","sourceRoot":"","sources":["../../src/harness/aiSdkWorkflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;IACxD,IAAI,EAAE,WAAW,CAAC,eAAe;IACjC,KAAK,EAAE,iBAAiB;IACxB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IACxC,UAAU,EAAE,eAAe;IAC3B,UAAU,EAAE,mFAAmF;IAC/F,YAAY,EACV,8FAA8F;QAC9F,yGAAyG;QACzG,sGAAsG;QACtG,+FAA+F;QAC/F,4FAA4F;QAC5F,qFAAqF;IACvF,QAAQ,EAAE,iBAAiB;CAC5B,CAAC,CAAA"}
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * aider.ts — Aider adapter (full implementation with safe YAML merge).
3
3
  *
4
- * Writes SOP content into .aider.conf.yml using the aiderConfigMerger
5
- * which safely merges proxy keys and strips dangerous auto-exec keys
6
- * (test-cmd, lint-cmd) that Aider auto-executes on startup.
4
+ * Merges proxy routing into .aider.conf.yml using the aiderConfigMerger,
5
+ * which keeps the user's own keys, strips dangerous auto-exec keys
6
+ * (test-cmd, lint-cmd) that Aider auto-executes on startup, and lists the
7
+ * SOP text as a read-only context file (.intutic/aider-sops.md).
7
8
  *
8
9
  * HLD §3.14 — Harness Onboarding Matrix
9
10
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"aider.d.ts","sourceRoot":"","sources":["../../src/harness/aider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMjD,eAAO,MAAM,YAAY,EAAE,eAiC1B,CAAA"}
1
+ {"version":3,"file":"aider.d.ts","sourceRoot":"","sources":["../../src/harness/aider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMjD,eAAO,MAAM,YAAY,EAAE,eAiC1B,CAAA"}
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * aider.ts — Aider adapter (full implementation with safe YAML merge).
3
3
  *
4
- * Writes SOP content into .aider.conf.yml using the aiderConfigMerger
5
- * which safely merges proxy keys and strips dangerous auto-exec keys
6
- * (test-cmd, lint-cmd) that Aider auto-executes on startup.
4
+ * Merges proxy routing into .aider.conf.yml using the aiderConfigMerger,
5
+ * which keeps the user's own keys, strips dangerous auto-exec keys
6
+ * (test-cmd, lint-cmd) that Aider auto-executes on startup, and lists the
7
+ * SOP text as a read-only context file (.intutic/aider-sops.md).
7
8
  *
8
9
  * HLD §3.14 — Harness Onboarding Matrix
9
10
  * @module
@@ -32,9 +33,9 @@ export const aiderAdapter = {
32
33
  ? sops.map((sop) => `## ${sop.title}\n\n${sop.content}`).join('\n\n---\n\n')
33
34
  : undefined;
34
35
  // Safe merge: strips test-cmd/lint-cmd, preserves all other user keys,
35
- // injects proxy URL as openai-api-base and anthropic-api-base
36
- await mergeAiderConfig(filePath, proxyUrl, sopsText);
37
- return filePath;
36
+ // routes OpenAI (openai-api-base) and Anthropic (set-env) models through
37
+ // the proxy and lists the SOPs as a read-only context file.
38
+ return (await mergeAiderConfig(filePath, proxyUrl, sopsText)) ? filePath : null;
38
39
  },
39
40
  async readCurrentHash(workspaceRoot) {
40
41
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"aider.js","sourceRoot":"","sources":["../../src/harness/aider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAA;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AM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAA;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * Antigravity adapter — .gemini/settings.json
3
3
  *
4
- * Merges SOP content into the customInstructions field of the
5
- * Gemini settings JSON file.
4
+ * Merges SOP content into the customInstructions field of the workspace's
5
+ * Gemini settings JSON file, and installs the Gemini CLI `BeforeTool` gate in
6
+ * `~/.gemini/settings.json` (see antigravityHooks.ts). A settings file that is
7
+ * not a plain JSON object is left alone and reported.
6
8
  *
7
9
  * HLD §3.14 — Harness Onboarding Matrix
8
10
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../../src/harness/antigravity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMjD,eAAO,MAAM,kBAAkB,EAAE,eAsDhC,CAAA"}
1
+ {"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../../src/harness/antigravity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQjD,eAAO,MAAM,kBAAkB,EAAE,eAqDhC,CAAA"}
@@ -1,18 +1,22 @@
1
1
  /**
2
2
  * Antigravity adapter — .gemini/settings.json
3
3
  *
4
- * Merges SOP content into the customInstructions field of the
5
- * Gemini settings JSON file.
4
+ * Merges SOP content into the customInstructions field of the workspace's
5
+ * Gemini settings JSON file, and installs the Gemini CLI `BeforeTool` gate in
6
+ * `~/.gemini/settings.json` (see antigravityHooks.ts). A settings file that is
7
+ * not a plain JSON object is left alone and reported.
6
8
  *
7
9
  * HLD §3.14 — Harness Onboarding Matrix
8
10
  * @module
9
11
  */
10
12
  import { join } from 'node:path';
11
- import { access, readFile, writeFile, rename, mkdir } from 'node:fs/promises';
13
+ import { access, writeFile, rename, mkdir } from 'node:fs/promises';
12
14
  import { dirname } from 'node:path';
13
15
  import { HarnessType } from '@intutic/shared-types';
14
16
  import { hashFile } from '../lib/hash.js';
15
17
  import { newIso } from '@intutic/id';
18
+ import { loadCredentials } from '../config/store.js';
19
+ import { readJsonObjectForMerge, writeAntigravityHooks } from '@intutic/sync-daemon';
16
20
  const CONFIG_FILE = '.gemini/settings.json';
17
21
  export const antigravityAdapter = {
18
22
  type: HarnessType.ANTIGRAVITY,
@@ -27,19 +31,17 @@ export const antigravityAdapter = {
27
31
  }
28
32
  },
29
33
  async writeConfig(workspaceRoot, sops, proxyUrl) {
34
+ // The gate is installed even with zero SOPs: it is what refuses tool
35
+ // calls, and the built-in protections apply without any SOP.
36
+ const creds = await loadCredentials();
37
+ await writeAntigravityHooks(workspaceRoot, proxyUrl, creds?.workspaceId || 'local');
30
38
  if (sops.length === 0)
31
39
  return null;
32
40
  const filePath = join(workspaceRoot, CONFIG_FILE);
33
41
  const tmpPath = filePath + '.intutic-tmp';
34
- // Read existing settings or start fresh
35
- let settings = {};
36
- try {
37
- const existing = await readFile(filePath, 'utf-8');
38
- settings = JSON.parse(existing);
39
- }
40
- catch {
41
- // No existing file — start fresh
42
- }
42
+ const settings = await readJsonObjectForMerge(filePath);
43
+ if (settings === null)
44
+ return null;
43
45
  // Merge governance instructions
44
46
  const instructions = sops
45
47
  .map((sop) => `## ${sop.title}\n\n${sop.content}`)
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../../src/harness/antigravity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE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D,gBAAgB,MAAM,EAAE,EAAE;YAC1B,gBAAgB,QAAQ,EAAE;YAC1B,EAAE;YACF,YAAY;SACb,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEZ,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACnD,MAAM,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAA;QAC3E,MAAM,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAC/B,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,aAAqB;QACzC,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAA;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -1,9 +1,15 @@
1
1
  /**
2
- * cline.ts — Cline adapter (full implementation).
2
+ * cline.ts — Cline adapter.
3
3
  *
4
- * Detects the Cline VS Code extension, writes Intutic governance rules
5
- * as .clinerules (flat file), injects the PreToolUse blocking hook into .cline/hooks/,
6
- * and configures the proxy base URL via VS Code settings + .env.intutic sidecar.
4
+ * Detects the Cline VS Code extension, writes Intutic governance rules to
5
+ * `.clinerules/intutic-governance.md` and installs the PreToolUse gate at
6
+ * `.clinerules/hooks/PreToolUse` (see clineHooks.ts — `.clinerules` is a
7
+ * directory so both fit; a flat `.clinerules` an earlier version wrote is
8
+ * converted, one the user wrote is left alone).
9
+ *
10
+ * Cline keeps its API provider and base URL in its own settings panel, not in
11
+ * any file this adapter can write, so routing Cline through the proxy is a
12
+ * manual step (see the Cline integration page).
7
13
  *
8
14
  * HLD §3.14 — Harness Onboarding Matrix
9
15
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"cline.d.ts","sourceRoot":"","sources":["../../src/harness/cline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQjD,eAAO,MAAM,YAAY,EAAE,eA4D1B,CAAA"}
1
+ {"version":3,"file":"cline.d.ts","sourceRoot":"","sources":["../../src/harness/cline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQjD,eAAO,MAAM,YAAY,EAAE,eA4D1B,CAAA"}
@@ -1,29 +1,35 @@
1
1
  /**
2
- * cline.ts — Cline adapter (full implementation).
2
+ * cline.ts — Cline adapter.
3
3
  *
4
- * Detects the Cline VS Code extension, writes Intutic governance rules
5
- * as .clinerules (flat file), injects the PreToolUse blocking hook into .cline/hooks/,
6
- * and configures the proxy base URL via VS Code settings + .env.intutic sidecar.
4
+ * Detects the Cline VS Code extension, writes Intutic governance rules to
5
+ * `.clinerules/intutic-governance.md` and installs the PreToolUse gate at
6
+ * `.clinerules/hooks/PreToolUse` (see clineHooks.ts — `.clinerules` is a
7
+ * directory so both fit; a flat `.clinerules` an earlier version wrote is
8
+ * converted, one the user wrote is left alone).
9
+ *
10
+ * Cline keeps its API provider and base URL in its own settings panel, not in
11
+ * any file this adapter can write, so routing Cline through the proxy is a
12
+ * manual step (see the Cline integration page).
7
13
  *
8
14
  * HLD §3.14 — Harness Onboarding Matrix
9
15
  * @module
10
16
  */
11
- import { access, readdir, writeFile, rename, mkdir } from 'node:fs/promises';
12
- import { join, dirname } from 'node:path';
17
+ import { access, readdir, writeFile, rename } from 'node:fs/promises';
18
+ import { join } from 'node:path';
13
19
  import { homedir } from 'node:os';
14
20
  import { HarnessType } from '@intutic/shared-types';
15
21
  import { hashFile } from '../lib/hash.js';
22
+ import { loadCredentials } from '../config/store.js';
16
23
  import { newIso } from '@intutic/id';
17
- import { writeClineHooks } from '@intutic/sync-daemon/harness/clineHooks';
18
- import { injectClineProxySettings } from './vscodeSettingsWriter.js';
19
- const CONFIG_FILE = '.clinerules';
24
+ import { writeClineHooks, ensureClinerulesDirectory } from '@intutic/sync-daemon/harness/clineHooks';
25
+ const CONFIG_FILE = '.clinerules/intutic-governance.md';
20
26
  export const clineAdapter = {
21
27
  type: HarnessType.CLINE,
22
28
  configFileName: CONFIG_FILE,
23
29
  async detect(workspaceRoot) {
24
- // Check for .clinerules in workspace
30
+ // Check for .clinerules (file or directory) in workspace
25
31
  try {
26
- await access(join(workspaceRoot, CONFIG_FILE));
32
+ await access(join(workspaceRoot, '.clinerules'));
27
33
  return true;
28
34
  }
29
35
  catch {
@@ -40,27 +46,28 @@ export const clineAdapter = {
40
46
  }
41
47
  },
42
48
  async writeConfig(workspaceRoot, sops, proxyUrl) {
43
- // 1. Write .clinerules text rules
44
- const filePath = join(workspaceRoot, CONFIG_FILE);
45
- const instructions = sops.length > 0
46
- ? sops.map((sop) => `## ${sop.title}\n\n${sop.content}`).join('\n\n---\n\n')
47
- : '# Intutic governance active — no SOP rules configured yet.';
48
- const content = [
49
- '# Intutic Governance Rules (auto-generated)',
50
- '# DO NOT EDIT — managed by intutic sync daemon',
51
- `# Last sync: ${newIso()}`,
52
- '',
53
- instructions,
54
- '',
55
- ].join('\n');
56
- await mkdir(dirname(filePath), { recursive: true });
57
- const tmp = filePath + '.intutic-tmp';
58
- await writeFile(tmp, content, 'utf-8');
59
- await rename(tmp, filePath);
60
- // 2. Write PreToolUse blocking hooks into .cline/hooks/
61
- await writeClineHooks(workspaceRoot, proxyUrl);
62
- // 3. Inject proxy URL into VS Code settings + .env.intutic sidecar
63
- await injectClineProxySettings(workspaceRoot, proxyUrl);
49
+ // 1. Rules, as one file in the .clinerules directory Cline reads.
50
+ let filePath = null;
51
+ if (await ensureClinerulesDirectory(workspaceRoot)) {
52
+ filePath = join(workspaceRoot, CONFIG_FILE);
53
+ const instructions = sops.length > 0
54
+ ? sops.map((sop) => `## ${sop.title}\n\n${sop.content}`).join('\n\n---\n\n')
55
+ : '# Intutic governance active — no SOP rules configured yet.';
56
+ const content = [
57
+ '# Intutic Governance Rules (auto-generated)',
58
+ '# DO NOT EDIT — managed by intutic sync daemon',
59
+ `# Last sync: ${newIso()}`,
60
+ '',
61
+ instructions,
62
+ '',
63
+ ].join('\n');
64
+ const tmp = filePath + '.intutic-tmp';
65
+ await writeFile(tmp, content, 'utf-8');
66
+ await rename(tmp, filePath);
67
+ }
68
+ // 2. The PreToolUse gate in .clinerules/hooks/.
69
+ const creds = await loadCredentials();
70
+ await writeClineHooks(workspaceRoot, proxyUrl, creds?.workspaceId || 'local');
64
71
  return filePath;
65
72
  },
66
73
  async readCurrentHash(workspaceRoot) {
@@ -1 +1 @@
1
- {"version":3,"file":"cline.js","sourceRoot":"","sources":["../../src/harness/cline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAEpE,MAAM,WAAW,GAAG,aAAa,CAAA;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C,IAAI,EAAE,WAAW,CAAC,KAAK;IACvB,cAAc,EAAE,WAAW;IAE3B,KAAK,CAAC,MAAM,CAAC,aAAqB;Q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IAAI,CAAC,CAAA;YAEZ,MAAM,GAAG,GAAG,QAAQ,GAAG,cAAc,CAAA;YACrC,MAAM,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YACtC,MAAM,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAC7B,CAAC;QAED,gDAAgD;QAChD,MAAM,KAAK,GAAG,MAAM,eAAe,EAAE,CAAA;QACrC,MAAM,eAAe,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,IAAI,OAAO,CAAC,CAAA;QAE7E,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,aAAqB;QACzC,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAA;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -1,9 +1,15 @@
1
1
  /**
2
- * codex.ts — Codex adapter (updated: also writes ~/.codex/config.toml).
2
+ * codex.ts — Codex adapter.
3
3
  *
4
- * In addition to the workspace .env.intutic file, writes
5
- * ~/.codex/config.toml with model_providers.litellm.base_url so Codex
6
- * routes LLM calls through the Intutic proxy even without env var sourcing.
4
+ * Writes three things:
5
+ * - `.env.intutic` in the workspace, with the proxy base URLs for shells and
6
+ * scripts that source it;
7
+ * - `openai_base_url` in Codex's user config (`$CODEX_HOME/config.toml`,
8
+ * `~/.codex/config.toml` by default), merged into the user's file, so Codex
9
+ * routes LLM calls through the proxy without sourcing anything — see
10
+ * codexConfigMerger.ts;
11
+ * - the PreToolUse gate, registered in `~/.codex/hooks.json` and the
12
+ * project's `.codex/hooks.json` — see codexHooks.ts.
7
13
  *
8
14
  * HLD §3.14 — Harness Onboarding Matrix
9
15
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/harness/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD,eAAO,MAAM,YAAY,EAAE,eAkE1B,CAAA"}
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/harness/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAcjD,eAAO,MAAM,YAAY,EAAE,eAwD1B,CAAA"}
@@ -1,9 +1,15 @@
1
1
  /**
2
- * codex.ts — Codex adapter (updated: also writes ~/.codex/config.toml).
2
+ * codex.ts — Codex adapter.
3
3
  *
4
- * In addition to the workspace .env.intutic file, writes
5
- * ~/.codex/config.toml with model_providers.litellm.base_url so Codex
6
- * routes LLM calls through the Intutic proxy even without env var sourcing.
4
+ * Writes three things:
5
+ * - `.env.intutic` in the workspace, with the proxy base URLs for shells and
6
+ * scripts that source it;
7
+ * - `openai_base_url` in Codex's user config (`$CODEX_HOME/config.toml`,
8
+ * `~/.codex/config.toml` by default), merged into the user's file, so Codex
9
+ * routes LLM calls through the proxy without sourcing anything — see
10
+ * codexConfigMerger.ts;
11
+ * - the PreToolUse gate, registered in `~/.codex/hooks.json` and the
12
+ * project's `.codex/hooks.json` — see codexHooks.ts.
7
13
  *
8
14
  * HLD §3.14 — Harness Onboarding Matrix
9
15
  * @module
@@ -11,11 +17,17 @@
11
17
  import { join, dirname } from 'node:path';
12
18
  import { writeFile, rename, mkdir } from 'node:fs/promises';
13
19
  import { homedir } from 'node:os';
14
- import { HarnessType } from '@intutic/shared-types';
20
+ import { HarnessType, anthropicBaseUrl, openaiBaseUrl, proxyHost } from '@intutic/shared-types';
15
21
  import { hashFile } from '../lib/hash.js';
22
+ import { loadCredentials } from '../config/store.js';
16
23
  import { newIso } from '@intutic/id';
24
+ import { writeCodexHooks, mergeCodexConfig } from '@intutic/sync-daemon';
17
25
  const CONFIG_FILE = '.env.intutic';
18
- const CODEX_CONFIG = join(homedir(), '.codex', 'config.toml');
26
+ /** Codex's user config directory, resolved at call time so CODEX_HOME and
27
+ * HOME changes (and tests that move them) are honoured. */
28
+ function codexHome() {
29
+ return process.env.CODEX_HOME || join(homedir(), '.codex');
30
+ }
19
31
  export const codexAdapter = {
20
32
  type: HarnessType.CODEX,
21
33
  configFileName: CONFIG_FILE,
@@ -45,9 +57,9 @@ export const codexAdapter = {
45
57
  `# Last sync: ${newIso()}`,
46
58
  '# Source this file: source .env.intutic',
47
59
  '',
48
- `export ANTHROPIC_BASE_URL="${proxyUrl}"`,
49
- `export OPENAI_BASE_URL="${proxyUrl}"`,
50
- `export INTUTIC_PROXY_URL="${proxyUrl}"`,
60
+ `export ANTHROPIC_BASE_URL="${anthropicBaseUrl(proxyUrl)}"`,
61
+ `export OPENAI_BASE_URL="${openaiBaseUrl(proxyUrl)}"`,
62
+ `export INTUTIC_PROXY_URL="${proxyHost(proxyUrl)}"`,
51
63
  `export INTUTIC_SOP_COUNT=${sops.length}`,
52
64
  '',
53
65
  ].join('\n');
@@ -55,23 +67,13 @@ export const codexAdapter = {
55
67
  const tmpEnv = filePath + '.intutic-tmp';
56
68
  await writeFile(tmpEnv, envContent, 'utf-8');
57
69
  await rename(tmpEnv, filePath);
58
- // 2. ~/.codex/config.toml — persists proxy across sessions without env sourcing
59
- const codexToml = [
60
- '# Intutic proxy config (auto-generated)',
61
- '# DO NOT EDIT — managed by intutic sync daemon',
62
- `# Last sync: ${newIso()}`,
63
- '',
64
- '[model_providers.litellm]',
65
- `base_url = "${proxyUrl}"`,
66
- '',
67
- '[model_providers.openai]',
68
- `base_url = "${proxyUrl}"`,
69
- '',
70
- ].join('\n');
71
- await mkdir(dirname(CODEX_CONFIG), { recursive: true });
72
- const tmpToml = CODEX_CONFIG + '.intutic-tmp';
73
- await writeFile(tmpToml, codexToml, 'utf-8');
74
- await rename(tmpToml, CODEX_CONFIG);
70
+ // 2. Codex user config — persists proxy routing across sessions without
71
+ // env sourcing. Merged; a config.toml that does not parse is left alone.
72
+ await mergeCodexConfig(join(codexHome(), 'config.toml'), openaiBaseUrl(proxyUrl));
73
+ // 3. The PreToolUse gate. The routing above governs LLM egress only; the
74
+ // gate is what refuses tool calls.
75
+ const creds = await loadCredentials();
76
+ await writeCodexHooks(workspaceRoot, proxyUrl, creds?.workspaceId || 'local');
75
77
  return filePath;
76
78
  },
77
79
  async readCurrentHash(workspaceRoot) {
@@ -1 +1 @@
1
- {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/harness/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,WAAW,GAAG,cAAc,CAAA;AAClC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAA;AAE7D,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C,IAAI,EAAE,WAAW,CAAC,KAAK;IACvB,cAAc,EAAE,WAAW;IAE3B,KAAK,CAAC,MAAM,CAAC,cAAsB;QACjC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;YAAE,OAAO,IAAI,CAAA;QACvC,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC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continue AI coding assistant and merges the Intutic
5
- * proxy URL as apiBase into each model entry in ~/.continue/config.yaml.
6
- * Continue has no hook system so proxy routing (Vector B) is the only
7
- * available governance mechanism.
4
+ * Detects the Continue AI coding assistant and:
5
+ * - sets `apiBase` on each OpenAI/Anthropic model in `~/.continue/config.yaml`
6
+ * so its LLM calls reach the proxy (merged; see continueConfigMerger.ts);
7
+ * - installs the Continue CLI (`cn`) PreToolUse gate in
8
+ * `~/.continue/settings.json` and `<repo>/.continue/settings.json` (see
9
+ * continueHooks.ts). The IDE extension has no hook system, so for it proxy
10
+ * routing is the only mechanism.
8
11
  *
9
12
  * HLD §3.14 — Harness Onboarding Matrix
10
13
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"continue.d.ts","sourceRoot":"","sources":["../../src/harness/continue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AASjD,eAAO,MAAM,eAAe,EAAE,eAiE7B,CAAA"}
1
+ {"version":3,"file":"continue.d.ts","sourceRoot":"","sources":["../../src/harness/continue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAWjD,eAAO,MAAM,eAAe,EAAE,eA6B7B,CAAA"}