@intutic/cli 2.1.0 → 2.3.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.
- package/README.md +8 -8
- package/dist/cli.d.ts +0 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +492 -21
- package/dist/cli.js.map +1 -1
- package/dist/commands/apiCommand.d.ts +40 -0
- package/dist/commands/apiCommand.d.ts.map +1 -0
- package/dist/commands/apiCommand.js +88 -0
- package/dist/commands/apiCommand.js.map +1 -0
- package/dist/commands/budget.d.ts +4 -0
- package/dist/commands/budget.d.ts.map +1 -1
- package/dist/commands/budget.js +8 -0
- package/dist/commands/budget.js.map +1 -1
- package/dist/commands/compliance.d.ts +122 -0
- package/dist/commands/compliance.d.ts.map +1 -0
- package/dist/commands/compliance.js +278 -0
- package/dist/commands/compliance.js.map +1 -0
- package/dist/commands/connect.d.ts +26 -1
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +222 -86
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/credentials.d.ts +1 -1
- package/dist/commands/credentials.js +1 -1
- package/dist/commands/decision.d.ts +4 -4
- package/dist/commands/decision.js +4 -4
- package/dist/commands/disconnect.d.ts +29 -0
- package/dist/commands/disconnect.d.ts.map +1 -0
- package/dist/commands/disconnect.js +266 -0
- package/dist/commands/disconnect.js.map +1 -0
- package/dist/commands/doctor.d.ts +0 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +0 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/enforce.d.ts +1 -1
- package/dist/commands/enforce.js +1 -1
- package/dist/commands/enterprise.d.ts +3 -2
- package/dist/commands/enterprise.d.ts.map +1 -1
- package/dist/commands/enterprise.js +11 -3
- package/dist/commands/enterprise.js.map +1 -1
- package/dist/commands/env.d.ts +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +3 -8
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/exec.d.ts +2 -3
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/exec.js +4 -5
- package/dist/commands/exec.js.map +1 -1
- package/dist/commands/gateLiveness.d.ts +15 -0
- package/dist/commands/gateLiveness.d.ts.map +1 -0
- package/dist/commands/gateLiveness.js +34 -0
- package/dist/commands/gateLiveness.js.map +1 -0
- package/dist/commands/gateway.d.ts +16 -4
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +47 -6
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/github.d.ts +20 -0
- package/dist/commands/github.d.ts.map +1 -0
- package/dist/commands/github.js +41 -0
- package/dist/commands/github.js.map +1 -0
- package/dist/commands/guardrails.d.ts +28 -2
- package/dist/commands/guardrails.d.ts.map +1 -1
- package/dist/commands/guardrails.js +233 -24
- package/dist/commands/guardrails.js.map +1 -1
- package/dist/commands/init.d.ts +1 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install-daemon.d.ts +1 -1
- package/dist/commands/install-daemon.js +2 -2
- package/dist/commands/integrity.d.ts +10 -2
- package/dist/commands/integrity.d.ts.map +1 -1
- package/dist/commands/integrity.js +10 -3
- package/dist/commands/integrity.js.map +1 -1
- package/dist/commands/inventory.d.ts +60 -0
- package/dist/commands/inventory.d.ts.map +1 -0
- package/dist/commands/inventory.js +141 -0
- package/dist/commands/inventory.js.map +1 -0
- package/dist/commands/judge.d.ts +1 -1
- package/dist/commands/judge.js +2 -2
- package/dist/commands/judge.js.map +1 -1
- package/dist/commands/login.d.ts +0 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +0 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.d.ts +0 -1
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/logout.js +0 -1
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/mcp.d.ts +31 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +65 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/notifications.d.ts +54 -0
- package/dist/commands/notifications.d.ts.map +1 -0
- package/dist/commands/notifications.js +151 -0
- package/dist/commands/notifications.js.map +1 -0
- package/dist/commands/org.d.ts +3 -3
- package/dist/commands/org.js +3 -3
- package/dist/commands/policy.d.ts +6 -1
- package/dist/commands/policy.d.ts.map +1 -1
- package/dist/commands/policy.js +77 -37
- package/dist/commands/policy.js.map +1 -1
- package/dist/commands/predict-cost.d.ts +1 -2
- package/dist/commands/predict-cost.d.ts.map +1 -1
- package/dist/commands/predict-cost.js +1 -4
- package/dist/commands/predict-cost.js.map +1 -1
- package/dist/commands/rollback.d.ts.map +1 -1
- package/dist/commands/rollback.js +3 -1
- package/dist/commands/rollback.js.map +1 -1
- package/dist/commands/routing.d.ts +1 -1
- package/dist/commands/routing.js +1 -1
- package/dist/commands/rules.d.ts +74 -0
- package/dist/commands/rules.d.ts.map +1 -0
- package/dist/commands/rules.js +283 -0
- package/dist/commands/rules.js.map +1 -0
- package/dist/commands/settings.d.ts +43 -0
- package/dist/commands/settings.d.ts.map +1 -0
- package/dist/commands/settings.js +108 -0
- package/dist/commands/settings.js.map +1 -0
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/siem.d.ts +53 -0
- package/dist/commands/siem.d.ts.map +1 -0
- package/dist/commands/siem.js +132 -0
- package/dist/commands/siem.js.map +1 -0
- package/dist/commands/skill.d.ts +5 -5
- package/dist/commands/skill.js +7 -7
- package/dist/commands/skill.js.map +1 -1
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +2 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/syncContext.d.ts +0 -1
- package/dist/commands/syncContext.d.ts.map +1 -1
- package/dist/commands/syncContext.js +0 -1
- package/dist/commands/syncContext.js.map +1 -1
- package/dist/commands/team.d.ts +2 -2
- package/dist/commands/team.js +2 -2
- package/dist/commands/traces.d.ts +0 -3
- package/dist/commands/traces.d.ts.map +1 -1
- package/dist/commands/traces.js +0 -3
- package/dist/commands/traces.js.map +1 -1
- package/dist/commands/usage.d.ts +41 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +129 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/whoami.d.ts +0 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +0 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/config/keychain.d.ts +0 -1
- package/dist/config/keychain.d.ts.map +1 -1
- package/dist/config/keychain.js +0 -1
- package/dist/config/keychain.js.map +1 -1
- package/dist/config/paths.d.ts +0 -1
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +0 -1
- package/dist/config/paths.js.map +1 -1
- package/dist/config/store.d.ts +0 -1
- package/dist/config/store.d.ts.map +1 -1
- package/dist/config/store.js +0 -1
- package/dist/config/store.js.map +1 -1
- package/dist/harness/ag2.d.ts +1 -1
- package/dist/harness/ag2.js +1 -1
- package/dist/harness/agentFramework.d.ts +1 -1
- package/dist/harness/agentFramework.js +1 -1
- package/dist/harness/agenticOrchestrator.d.ts +4 -6
- package/dist/harness/agenticOrchestrator.d.ts.map +1 -1
- package/dist/harness/agenticOrchestrator.js +5 -7
- package/dist/harness/agenticOrchestrator.js.map +1 -1
- package/dist/harness/agentsMd.d.ts +24 -0
- package/dist/harness/agentsMd.d.ts.map +1 -0
- package/dist/harness/agentsMd.js +28 -0
- package/dist/harness/agentsMd.js.map +1 -0
- package/dist/harness/aider.d.ts +3 -1
- package/dist/harness/aider.d.ts.map +1 -1
- package/dist/harness/aider.js +9 -7
- package/dist/harness/aider.js.map +1 -1
- package/dist/harness/antigravity.d.ts +23 -5
- package/dist/harness/antigravity.d.ts.map +1 -1
- package/dist/harness/antigravity.js +45 -54
- package/dist/harness/antigravity.js.map +1 -1
- package/dist/harness/autogen.d.ts +1 -1
- package/dist/harness/autogen.js +2 -2
- package/dist/harness/autogen.js.map +1 -1
- package/dist/harness/claudeCode.d.ts +22 -1
- package/dist/harness/claudeCode.d.ts.map +1 -1
- package/dist/harness/claudeCode.js +47 -3
- package/dist/harness/claudeCode.js.map +1 -1
- package/dist/harness/cline.d.ts.map +1 -1
- package/dist/harness/cline.js +16 -24
- package/dist/harness/cline.js.map +1 -1
- package/dist/harness/codex.d.ts +6 -1
- package/dist/harness/codex.d.ts.map +1 -1
- package/dist/harness/codex.js +26 -28
- package/dist/harness/codex.js.map +1 -1
- package/dist/harness/continue.d.ts +10 -4
- package/dist/harness/continue.d.ts.map +1 -1
- package/dist/harness/continue.js +22 -22
- package/dist/harness/continue.js.map +1 -1
- package/dist/harness/cursor.d.ts +5 -2
- package/dist/harness/cursor.d.ts.map +1 -1
- package/dist/harness/cursor.js +19 -27
- package/dist/harness/cursor.js.map +1 -1
- package/dist/harness/detector.d.ts +0 -1
- package/dist/harness/detector.d.ts.map +1 -1
- package/dist/harness/detector.js +0 -1
- package/dist/harness/detector.js.map +1 -1
- package/dist/harness/dsh.d.ts +5 -3
- package/dist/harness/dsh.d.ts.map +1 -1
- package/dist/harness/dsh.js +17 -29
- package/dist/harness/dsh.js.map +1 -1
- package/dist/harness/eve.d.ts +3 -4
- package/dist/harness/eve.d.ts.map +1 -1
- package/dist/harness/eve.js +3 -4
- package/dist/harness/eve.js.map +1 -1
- package/dist/harness/githubCopilot.d.ts +4 -1
- package/dist/harness/githubCopilot.d.ts.map +1 -1
- package/dist/harness/githubCopilot.js +13 -24
- package/dist/harness/githubCopilot.js.map +1 -1
- package/dist/harness/goose.d.ts +7 -3
- package/dist/harness/goose.d.ts.map +1 -1
- package/dist/harness/goose.js +18 -21
- package/dist/harness/goose.js.map +1 -1
- package/dist/harness/grok.d.ts +2 -2
- package/dist/harness/grok.d.ts.map +1 -1
- package/dist/harness/grok.js +15 -28
- package/dist/harness/grok.js.map +1 -1
- package/dist/harness/hermes.d.ts +6 -0
- package/dist/harness/hermes.d.ts.map +1 -1
- package/dist/harness/hermes.js +17 -16
- package/dist/harness/hermes.js.map +1 -1
- package/dist/harness/jsSdkGatedAdapter.d.ts.map +1 -1
- package/dist/harness/jsSdkGatedAdapter.js +4 -6
- package/dist/harness/jsSdkGatedAdapter.js.map +1 -1
- package/dist/harness/langgraph.d.ts.map +1 -1
- package/dist/harness/langgraph.js +4 -6
- package/dist/harness/langgraph.js.map +1 -1
- package/dist/harness/muse.d.ts +3 -7
- package/dist/harness/muse.d.ts.map +1 -1
- package/dist/harness/muse.js +17 -39
- package/dist/harness/muse.js.map +1 -1
- package/dist/harness/n8n.d.ts +13 -7
- package/dist/harness/n8n.d.ts.map +1 -1
- package/dist/harness/n8n.js +21 -127
- package/dist/harness/n8n.js.map +1 -1
- package/dist/harness/openWebUI.d.ts.map +1 -1
- package/dist/harness/openWebUI.js +5 -4
- package/dist/harness/openWebUI.js.map +1 -1
- package/dist/harness/openaiAgents.d.ts +1 -1
- package/dist/harness/openaiAgents.d.ts.map +1 -1
- package/dist/harness/openaiAgents.js +6 -3
- package/dist/harness/openaiAgents.js.map +1 -1
- package/dist/harness/openclaw.d.ts +8 -0
- package/dist/harness/openclaw.d.ts.map +1 -1
- package/dist/harness/openclaw.js +27 -12
- package/dist/harness/openclaw.js.map +1 -1
- package/dist/harness/opencode.d.ts +4 -5
- package/dist/harness/opencode.d.ts.map +1 -1
- package/dist/harness/opencode.js +17 -34
- package/dist/harness/opencode.js.map +1 -1
- package/dist/harness/openhands.d.ts +9 -3
- package/dist/harness/openhands.d.ts.map +1 -1
- package/dist/harness/openhands.js +43 -25
- package/dist/harness/openhands.js.map +1 -1
- package/dist/harness/pi.d.ts +7 -2
- package/dist/harness/pi.d.ts.map +1 -1
- package/dist/harness/pi.js +19 -18
- package/dist/harness/pi.js.map +1 -1
- package/dist/harness/rooCode.d.ts +12 -5
- package/dist/harness/rooCode.d.ts.map +1 -1
- package/dist/harness/rooCode.js +25 -43
- package/dist/harness/rooCode.js.map +1 -1
- package/dist/harness/rulesFiles.d.ts +53 -0
- package/dist/harness/rulesFiles.d.ts.map +1 -0
- package/dist/harness/rulesFiles.js +106 -0
- package/dist/harness/rulesFiles.js.map +1 -0
- package/dist/harness/sdkGatedAdapter.d.ts.map +1 -1
- package/dist/harness/sdkGatedAdapter.js +4 -6
- package/dist/harness/sdkGatedAdapter.js.map +1 -1
- package/dist/harness/smolagents.d.ts +2 -2
- package/dist/harness/smolagents.js +3 -3
- package/dist/harness/smolagents.js.map +1 -1
- package/dist/harness/types.d.ts +20 -6
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js +1 -95
- package/dist/harness/types.js.map +1 -1
- package/dist/harness/windsurf.d.ts +7 -2
- package/dist/harness/windsurf.d.ts.map +1 -1
- package/dist/harness/windsurf.js +22 -29
- package/dist/harness/windsurf.js.map +1 -1
- package/dist/harness/xirp.d.ts +6 -9
- package/dist/harness/xirp.d.ts.map +1 -1
- package/dist/harness/xirp.js +7 -10
- package/dist/harness/xirp.js.map +1 -1
- package/dist/lib/api.d.ts +27 -1
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +55 -18
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/ciscoScanner.d.ts +1 -1
- package/dist/lib/ciscoScanner.js +1 -1
- package/dist/lib/decisionsLogRefresh.d.ts.map +1 -1
- package/dist/lib/decisionsLogRefresh.js +6 -7
- package/dist/lib/decisionsLogRefresh.js.map +1 -1
- package/dist/lib/deviceReport.d.ts +15 -0
- package/dist/lib/deviceReport.d.ts.map +1 -1
- package/dist/lib/deviceReport.js +30 -0
- package/dist/lib/deviceReport.js.map +1 -1
- package/dist/lib/envInjector.d.ts +16 -6
- package/dist/lib/envInjector.d.ts.map +1 -1
- package/dist/lib/envInjector.js +99 -88
- package/dist/lib/envInjector.js.map +1 -1
- package/dist/lib/gitHooks.d.ts +0 -1
- package/dist/lib/gitHooks.d.ts.map +1 -1
- package/dist/lib/gitHooks.js +8 -9
- package/dist/lib/gitHooks.js.map +1 -1
- package/dist/lib/gracefulShutdown.d.ts +1 -1
- package/dist/lib/gracefulShutdown.js +1 -1
- package/dist/lib/hash.d.ts +0 -1
- package/dist/lib/hash.d.ts.map +1 -1
- package/dist/lib/hash.js +0 -1
- package/dist/lib/hash.js.map +1 -1
- package/dist/lib/inventory.d.ts +47 -0
- package/dist/lib/inventory.d.ts.map +1 -0
- package/dist/lib/inventory.js +106 -0
- package/dist/lib/inventory.js.map +1 -0
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +0 -1
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/mdmManifest.d.ts +30 -2
- package/dist/lib/mdmManifest.d.ts.map +1 -1
- package/dist/lib/mdmManifest.js +50 -2
- package/dist/lib/mdmManifest.js.map +1 -1
- package/dist/lib/onboarding.d.ts +0 -1
- package/dist/lib/onboarding.d.ts.map +1 -1
- package/dist/lib/onboarding.js +2 -3
- package/dist/lib/onboarding.js.map +1 -1
- package/dist/lib/otelPropagation.d.ts +1 -1
- package/dist/lib/otelPropagation.js +1 -1
- package/dist/lib/policySnapshot.d.ts +3 -1
- package/dist/lib/policySnapshot.d.ts.map +1 -1
- package/dist/lib/policySnapshot.js +15 -5
- package/dist/lib/policySnapshot.js.map +1 -1
- package/dist/lib/process.d.ts +5 -1
- package/dist/lib/process.d.ts.map +1 -1
- package/dist/lib/process.js +13 -4
- package/dist/lib/process.js.map +1 -1
- package/dist/lib/providerProbe.d.ts +2 -2
- package/dist/lib/providerProbe.js +2 -2
- package/dist/lib/sandbox/firecracker.d.ts +3 -3
- package/dist/lib/sandbox/firecracker.js +3 -3
- package/dist/lib/sandbox/index.d.ts +2 -2
- package/dist/lib/sandbox/index.js +2 -2
- package/dist/lib/sandbox/oci.d.ts +1 -1
- package/dist/lib/sandbox/oci.js +1 -1
- package/dist/lib/sandbox/types.d.ts +1 -1
- package/dist/lib/sandbox/types.js +1 -1
- package/dist/lib/sopFrontMatter.d.ts +1 -1
- package/dist/lib/sopFrontMatter.js +1 -1
- package/package.json +6 -5
- package/resources/sandbox/Dockerfile +1 -1
- package/resources/sandbox/entrypoint.sh +4 -4
- package/resources/sandbox/firecracker-launch.sh +1 -1
- package/dist/harness/base.d.ts +0 -20
- package/dist/harness/base.d.ts.map +0 -1
- package/dist/harness/base.js +0 -73
- package/dist/harness/base.js.map +0 -1
package/dist/harness/n8n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"n8n.js","sourceRoot":"","sources":["../../src/harness/n8n.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"n8n.js","sourceRoot":"","sources":["../../src/harness/n8n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,IAAI,EAAE,WAAW,CAAC,GAAG;IACrB,cAAc,EAAE,EAAE;IAElB,KAAK,CAAC,MAAM,CAAC,cAAsB;QACjC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,uBAAuB,CAAA;QAC7D,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,gBAAgB,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACzF,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAA;QACvE,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAA;QACpC,CAAC;IACH,CAAC;IAED,oCAAoC;IACpC,KAAK,CAAC,WAAW,CAAC,aAAqB,EAAE,QAAgB;QACvD,MAAM,KAAK,GAAG,MAAM,eAAe,EAAE,CAAA;QACrC,MAAM,aAAa,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,IAAI,OAAO,CAAC,CAAA;IAC7E,CAAC;IAED,yCAAyC;IACzC,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openWebUI.d.ts","sourceRoot":"","sources":["../../src/harness/openWebUI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"openWebUI.d.ts","sourceRoot":"","sources":["../../src/harness/openWebUI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD,eAAO,MAAM,gBAAgB,EAAE,eAqB9B,CAAA"}
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
14
14
|
* @module
|
|
15
15
|
*/
|
|
16
|
-
import { join } from 'node:path';
|
|
17
|
-
import { homedir } from 'node:os';
|
|
18
16
|
import { HarnessType } from '@intutic/shared-types';
|
|
19
17
|
import { loadCredentials } from '../config/store.js';
|
|
20
18
|
import { writeOpenWebuiHooks } from '@intutic/sync-daemon';
|
|
@@ -24,10 +22,13 @@ export const openWebUIAdapter = {
|
|
|
24
22
|
async detect(_workspaceRoot) {
|
|
25
23
|
return false;
|
|
26
24
|
},
|
|
27
|
-
async
|
|
25
|
+
async installGate(workspaceRoot, proxyUrl) {
|
|
28
26
|
const creds = await loadCredentials();
|
|
29
27
|
await writeOpenWebuiHooks(workspaceRoot, proxyUrl, creds?.workspaceId || 'local');
|
|
30
|
-
|
|
28
|
+
},
|
|
29
|
+
/** No rules file: the filter an admin installs is this harness's governance. */
|
|
30
|
+
async writeConfig() {
|
|
31
|
+
return null;
|
|
31
32
|
},
|
|
32
33
|
async readCurrentHash() {
|
|
33
34
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openWebUI.js","sourceRoot":"","sources":["../../src/harness/openWebUI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openWebUI.js","sourceRoot":"","sources":["../../src/harness/openWebUI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,IAAI,EAAE,WAAW,CAAC,UAAU;IAC5B,cAAc,EAAE,EAAE;IAElB,KAAK,CAAC,MAAM,CAAC,cAAsB;QACjC,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,aAAqB,EAAE,QAAgB;QACvD,MAAM,KAAK,GAAG,MAAM,eAAe,EAAE,CAAA;QACrC,MAAM,mBAAmB,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,IAAI,OAAO,CAAC,CAAA;IACnF,CAAC;IAED,gFAAgF;IAChF,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* pointer comment differs. A workspace detected as TypeScript-only gets the
|
|
30
30
|
* `@intutic/gate/openai` pointer; Python-only gets the Python pointer; a
|
|
31
31
|
* monorepo with both gets the Python file with the TypeScript pointer
|
|
32
|
-
* appended (
|
|
32
|
+
* appended (until 2026-09-22 the TS half was only reachable
|
|
33
33
|
* through the docs page).
|
|
34
34
|
*
|
|
35
35
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openaiAgents.d.ts","sourceRoot":"","sources":["../../src/harness/openaiAgents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;
|
|
1
|
+
{"version":3,"file":"openaiAgents.d.ts","sourceRoot":"","sources":["../../src/harness/openaiAgents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAuCjD,eAAO,MAAM,mBAAmB,EAAE,eA0CjC,CAAA"}
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
* pointer comment differs. A workspace detected as TypeScript-only gets the
|
|
30
30
|
* `@intutic/gate/openai` pointer; Python-only gets the Python pointer; a
|
|
31
31
|
* monorepo with both gets the Python file with the TypeScript pointer
|
|
32
|
-
* appended (
|
|
32
|
+
* appended (until 2026-09-22 the TS half was only reachable
|
|
33
33
|
* through the docs page).
|
|
34
34
|
*
|
|
35
35
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
36
36
|
* @module
|
|
37
37
|
*/
|
|
38
|
-
import { appendFile } from 'node:fs/promises';
|
|
38
|
+
import { appendFile, readFile } from 'node:fs/promises';
|
|
39
|
+
import { noteWritten } from '@intutic/sync-daemon';
|
|
39
40
|
import { HarnessType } from '@intutic/shared-types';
|
|
40
41
|
import { makeSdkGatedAdapter } from './sdkGatedAdapter.js';
|
|
41
42
|
import { makeJsSdkGatedAdapter } from './jsSdkGatedAdapter.js';
|
|
@@ -86,7 +87,7 @@ export const openaiAgentsAdapter = {
|
|
|
86
87
|
}
|
|
87
88
|
const filePath = await pythonAdapter.writeConfig(workspaceRoot, sops, proxyUrl);
|
|
88
89
|
if (filePath && js) {
|
|
89
|
-
// Both ecosystems in one workspace
|
|
90
|
+
// Both ecosystems in one workspace: the file is the
|
|
90
91
|
// Python adapter's, so its pointer named only the Python gate and the
|
|
91
92
|
// TypeScript half of the monorepo was left to find `@intutic/gate`
|
|
92
93
|
// through the docs page. Say it here too.
|
|
@@ -98,6 +99,8 @@ export const openaiAgentsAdapter = {
|
|
|
98
99
|
'# See https://docs.intutic.ai/integrations/openai-agents',
|
|
99
100
|
'',
|
|
100
101
|
].join('\n'), 'utf-8');
|
|
102
|
+
// Still entirely Intutic's: recorded, so disconnect does not mistake the addition for a user edit.
|
|
103
|
+
await noteWritten(filePath, workspaceRoot, await readFile(filePath, 'utf-8'));
|
|
101
104
|
}
|
|
102
105
|
return filePath;
|
|
103
106
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openaiAgents.js","sourceRoot":"","sources":["../../src/harness/openaiAgents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"openaiAgents.js","sourceRoot":"","sources":["../../src/harness/openaiAgents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAA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,SAAS,CAAC,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC7D,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC/E,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;YACnB,oDAAoD;YACpD,sEAAsE;YACtE,mEAAmE;YACnE,0CAA0C;YAC1C,MAAM,UAAU,CACd,QAAQ,EACR;gBACE,+EAA+E;gBAC/E,8EAA8E;gBAC9E,+BAA+B;gBAC/B,yEAAyE;gBACzE,0DAA0D;gBAC1D,EAAE;aACH,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ,OAAO,CACR,CAAA;YACD,mGAAmG;YACnG,MAAM,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;QAC/E,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,sEAAsE;IACtE,eAAe,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,aAAa,CAAC;CACjF,CAAA"}
|
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
* Detects OpenClaw presence and invokes the sync-daemon hooks compiler
|
|
5
5
|
* to inject Intutic pre-tool use gates.
|
|
6
6
|
*
|
|
7
|
+
* OpenClaw loads standing instructions only from its own agent workspace
|
|
8
|
+
* (`AGENTS.md` and the other bootstrap files), never from a project, even
|
|
9
|
+
* when it works in one. The rule sets therefore go into a marked section of
|
|
10
|
+
* that workspace's `AGENTS.md` (see `openclawAgentWorkspace`), and the rest
|
|
11
|
+
* of the file stays the user's. OpenClaw truncates a bootstrap file past
|
|
12
|
+
* 20,000 characters
|
|
13
|
+
* (https://github.com/openclaw/openclaw/blob/98457908cf3e4fbbd0354b530e0aa0d15b560158/docs/gateway/config-agents/workspace-and-bootstrap.md).
|
|
14
|
+
*
|
|
7
15
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
16
|
* @module
|
|
9
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw.d.ts","sourceRoot":"","sources":["../../src/harness/openclaw.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openclaw.d.ts","sourceRoot":"","sources":["../../src/harness/openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQjD,eAAO,MAAM,eAAe,EAAE,eAqC7B,CAAA"}
|
package/dist/harness/openclaw.js
CHANGED
|
@@ -4,24 +4,34 @@
|
|
|
4
4
|
* Detects OpenClaw presence and invokes the sync-daemon hooks compiler
|
|
5
5
|
* to inject Intutic pre-tool use gates.
|
|
6
6
|
*
|
|
7
|
+
* OpenClaw loads standing instructions only from its own agent workspace
|
|
8
|
+
* (`AGENTS.md` and the other bootstrap files), never from a project, even
|
|
9
|
+
* when it works in one. The rule sets therefore go into a marked section of
|
|
10
|
+
* that workspace's `AGENTS.md` (see `openclawAgentWorkspace`), and the rest
|
|
11
|
+
* of the file stays the user's. OpenClaw truncates a bootstrap file past
|
|
12
|
+
* 20,000 characters
|
|
13
|
+
* (https://github.com/openclaw/openclaw/blob/98457908cf3e4fbbd0354b530e0aa0d15b560158/docs/gateway/config-agents/workspace-and-bootstrap.md).
|
|
14
|
+
*
|
|
7
15
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
16
|
* @module
|
|
9
17
|
*/
|
|
10
18
|
import { join } from 'node:path';
|
|
11
|
-
import { access } from 'node:fs/promises';
|
|
19
|
+
import { access, readFile } from 'node:fs/promises';
|
|
12
20
|
import { existsSync } from 'node:fs';
|
|
13
21
|
import { homedir } from 'node:os';
|
|
14
22
|
import { HarnessType } from '@intutic/shared-types';
|
|
15
|
-
import {
|
|
23
|
+
import { hashString } from '../lib/hash.js';
|
|
16
24
|
import { loadCredentials } from '../config/store.js';
|
|
17
|
-
import { writeOpenclawHooks } from '@intutic/sync-daemon';
|
|
18
|
-
|
|
25
|
+
import { openclawAgentWorkspace, rulesSectionOf, writeOpenclawHooks, writeRulesSection } from '@intutic/sync-daemon';
|
|
26
|
+
import { buildRulesBody } from './rulesFiles.js';
|
|
27
|
+
const DETECT_FILE = '.openclaw/openclaw.json';
|
|
19
28
|
export const openclawAdapter = {
|
|
20
29
|
type: HarnessType.OPENCLAW,
|
|
21
|
-
|
|
30
|
+
// The rules file is outside the workspace.
|
|
31
|
+
configFileName: '',
|
|
22
32
|
async detect(workspaceRoot) {
|
|
23
33
|
const globalOpenclaw = join(homedir(), '.openclaw');
|
|
24
|
-
const localOpenclaw = join(workspaceRoot,
|
|
34
|
+
const localOpenclaw = join(workspaceRoot, DETECT_FILE);
|
|
25
35
|
try {
|
|
26
36
|
if (existsSync(globalOpenclaw))
|
|
27
37
|
return true;
|
|
@@ -32,16 +42,21 @@ export const openclawAdapter = {
|
|
|
32
42
|
return false;
|
|
33
43
|
}
|
|
34
44
|
},
|
|
35
|
-
async
|
|
36
|
-
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
45
|
+
async installGate(workspaceRoot, proxyUrl) {
|
|
37
46
|
const creds = await loadCredentials();
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
await writeOpenclawHooks(workspaceRoot, proxyUrl, creds?.workspaceId || 'local');
|
|
48
|
+
},
|
|
49
|
+
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
50
|
+
if (sops.length === 0)
|
|
51
|
+
return null;
|
|
52
|
+
const filePath = join(await openclawAgentWorkspace(), 'AGENTS.md');
|
|
53
|
+
await writeRulesSection(filePath, workspaceRoot, buildRulesBody(sops, proxyUrl, 'section'));
|
|
40
54
|
return filePath;
|
|
41
55
|
},
|
|
42
|
-
async readCurrentHash(
|
|
56
|
+
async readCurrentHash() {
|
|
43
57
|
try {
|
|
44
|
-
|
|
58
|
+
const section = rulesSectionOf(await readFile(join(await openclawAgentWorkspace(), 'AGENTS.md'), 'utf-8'));
|
|
59
|
+
return section === null ? null : hashString(section);
|
|
45
60
|
}
|
|
46
61
|
catch {
|
|
47
62
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw.js","sourceRoot":"","sources":["../../src/harness/openclaw.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openclaw.js","sourceRoot":"","sources":["../../src/harness/openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACpH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,WAAW,GAAG,yBAAyB,CAAA;AAE7C,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,2CAA2C;IAC3C,cAAc,EAAE,EAAE;IAElB,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAA;QACnD,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QACtD,IAAI,CAAC;YACH,I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is `AGENTS.md`
|
|
6
|
-
* (project, with a `CLAUDE.md` fallback, and `~/.config/opencode/AGENTS.md
|
|
7
|
-
*
|
|
8
|
-
* `AGENTS.md
|
|
9
|
-
* own.
|
|
6
|
+
* (project, with a `CLAUDE.md` fallback, and `~/.config/opencode/AGENTS.md`;
|
|
7
|
+
* https://opencode.ai/docs/rules/). The rule sets go there through the
|
|
8
|
+
* shared `AGENTS.md` writer (agentsMd.ts).
|
|
10
9
|
*
|
|
11
10
|
* The governance-critical half is a **plugin**, not a hook file: OpenCode
|
|
12
11
|
* loads `.opencode/plugins/*.js` into its own process and runs the plugin's
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
* every tool call; throwing refuses the call. That plugin is generated by
|
|
15
14
|
* `@intutic/sync-daemon`'s `openCodeHooks.ts`, the same split Muse and Grok
|
|
16
15
|
* use for their hook writers. This adapter does not write `opencode.json`;
|
|
17
|
-
* the sync daemon's `mcpAutoWrite.ts` edits its `mcp` block only
|
|
16
|
+
* the sync daemon's `mcpAutoWrite.ts` edits its `mcp` block only —
|
|
18
17
|
* see the writer's module doc.
|
|
19
18
|
*
|
|
20
19
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/harness/opencode.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/harness/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AASjD,eAAO,MAAM,eAAe,EAAE,eA+C7B,CAAA"}
|
package/dist/harness/opencode.js
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* binary `opencode`).
|
|
4
4
|
*
|
|
5
5
|
* OpenCode is a terminal coding agent whose instructions file is `AGENTS.md`
|
|
6
|
-
* (project, with a `CLAUDE.md` fallback, and `~/.config/opencode/AGENTS.md
|
|
7
|
-
*
|
|
8
|
-
* `AGENTS.md
|
|
9
|
-
* own.
|
|
6
|
+
* (project, with a `CLAUDE.md` fallback, and `~/.config/opencode/AGENTS.md`;
|
|
7
|
+
* https://opencode.ai/docs/rules/). The rule sets go there through the
|
|
8
|
+
* shared `AGENTS.md` writer (agentsMd.ts).
|
|
10
9
|
*
|
|
11
10
|
* The governance-critical half is a **plugin**, not a hook file: OpenCode
|
|
12
11
|
* loads `.opencode/plugins/*.js` into its own process and runs the plugin's
|
|
@@ -14,28 +13,25 @@
|
|
|
14
13
|
* every tool call; throwing refuses the call. That plugin is generated by
|
|
15
14
|
* `@intutic/sync-daemon`'s `openCodeHooks.ts`, the same split Muse and Grok
|
|
16
15
|
* use for their hook writers. This adapter does not write `opencode.json`;
|
|
17
|
-
* the sync daemon's `mcpAutoWrite.ts` edits its `mcp` block only
|
|
16
|
+
* the sync daemon's `mcpAutoWrite.ts` edits its `mcp` block only —
|
|
18
17
|
* see the writer's module doc.
|
|
19
18
|
*
|
|
20
19
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
21
20
|
* @module
|
|
22
21
|
*/
|
|
23
|
-
import { join
|
|
24
|
-
import { access
|
|
22
|
+
import { join } from 'node:path';
|
|
23
|
+
import { access } from 'node:fs/promises';
|
|
25
24
|
import { homedir } from 'node:os';
|
|
26
25
|
import { HarnessType } from '@intutic/shared-types';
|
|
27
|
-
import { hashFile } from '../lib/hash.js';
|
|
28
|
-
import { buildMarkdownContent } from './base.js';
|
|
29
26
|
import { writeOpenCodeHooks } from '@intutic/sync-daemon/harness/openCodeHooks';
|
|
30
|
-
|
|
31
|
-
const CONFIG_FILE = 'AGENTS.md';
|
|
27
|
+
import { AGENTS_MD, agentsMdHash, writeAgentsMd } from './agentsMd.js';
|
|
32
28
|
/** `$OPENCODE_CONFIG_DIR` or `~/.config/opencode` — the user-level config dir. */
|
|
33
29
|
function openCodeConfigDir() {
|
|
34
30
|
return process.env.OPENCODE_CONFIG_DIR || join(homedir(), '.config', 'opencode');
|
|
35
31
|
}
|
|
36
32
|
export const opencodeAdapter = {
|
|
37
33
|
type: HarnessType.OPENCODE,
|
|
38
|
-
configFileName:
|
|
34
|
+
configFileName: AGENTS_MD,
|
|
39
35
|
async detect(workspaceRoot) {
|
|
40
36
|
// 1. Project-local `.opencode/` directory or `opencode.json{,c}`. Not
|
|
41
37
|
// AGENTS.md alone — Muse and Grok read the same file.
|
|
@@ -69,30 +65,17 @@ export const opencodeAdapter = {
|
|
|
69
65
|
catch { /* ignore */ }
|
|
70
66
|
return false;
|
|
71
67
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (sops.length > 0) {
|
|
77
|
-
const content = buildMarkdownContent(sops, proxyUrl);
|
|
78
|
-
await mkdir(dirname(agentsPath), { recursive: true });
|
|
79
|
-
const tmp = agentsPath + '.intutic-tmp';
|
|
80
|
-
await writeFile(tmp, content, 'utf-8');
|
|
81
|
-
await rename(tmp, agentsPath);
|
|
82
|
-
}
|
|
83
|
-
// 2. The plugin gate. `intutic connect` has no workspace id in scope —
|
|
84
|
-
// same limitation `museAdapter` has — the sync daemon re-runs this
|
|
85
|
-
// with a real one on the next cycle.
|
|
68
|
+
/** The plugin gate. `intutic connect` has no workspace id in scope — same
|
|
69
|
+
* limitation `museAdapter` has — the sync daemon re-runs this with a real
|
|
70
|
+
* one on the next cycle. */
|
|
71
|
+
async installGate(workspaceRoot, proxyUrl) {
|
|
86
72
|
await writeOpenCodeHooks(workspaceRoot, proxyUrl, '');
|
|
87
|
-
return agentsPath;
|
|
88
73
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
74
|
+
writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
75
|
+
return writeAgentsMd(workspaceRoot, sops, proxyUrl);
|
|
76
|
+
},
|
|
77
|
+
readCurrentHash(workspaceRoot) {
|
|
78
|
+
return agentsMdHash(workspaceRoot);
|
|
96
79
|
},
|
|
97
80
|
};
|
|
98
81
|
//# sourceMappingURL=opencode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/harness/opencode.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/harness/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAEtE,kFAAkF;AAClF,SAAS,iBAAiB;IACxB,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;AAClF,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,cAAc,EAAE,SAAS;IAEzB,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,sEAAsE;QACtE,yDAAyD;QACzD,KAAK,MAAM,MAAM,IAAI,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAE,CAAC;YACtE,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAA;gBACzC,OAAO,IAAI,CAAA;YACb,CAAC;YAAC,MAAM,CAAC,CAAC,cAA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ACpC,CAAC;CACF,CAAA"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* openhands.ts — OpenHands adapter (full implementation with hooks + llm.base_url).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* .
|
|
4
|
+
* - rules: `.openhands/microagents/intutic-governance.md`, a repository
|
|
5
|
+
* microagent with no triggers, which OpenHands keeps active in every
|
|
6
|
+
* conversation (V0's `microagent.py`: "no triggers -> REPO (always
|
|
7
|
+
* active)"; the V1 software-agent SDK loads the same directory as legacy
|
|
8
|
+
* skills, "no keywords -> always active"). Earlier versions put the rules
|
|
9
|
+
* in an `[intutic]` table of `config.toml`, which OpenHands never reads;
|
|
10
|
+
* connect drops that table and disconnect removes it;
|
|
11
|
+
* - `[llm] base_url` merged into `config.toml`, keeping the rest of the file;
|
|
12
|
+
* - the PreToolUse hook in `.openhands/hooks.json`.
|
|
7
13
|
*
|
|
8
14
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
15
|
* @module
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openhands.d.ts","sourceRoot":"","sources":["../../src/harness/openhands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openhands.d.ts","sourceRoot":"","sources":["../../src/harness/openhands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAUjD,eAAO,MAAM,gBAAgB,EAAE,eAwD9B,CAAA"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* openhands.ts — OpenHands adapter (full implementation with hooks + llm.base_url).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* .
|
|
4
|
+
* - rules: `.openhands/microagents/intutic-governance.md`, a repository
|
|
5
|
+
* microagent with no triggers, which OpenHands keeps active in every
|
|
6
|
+
* conversation (V0's `microagent.py`: "no triggers -> REPO (always
|
|
7
|
+
* active)"; the V1 software-agent SDK loads the same directory as legacy
|
|
8
|
+
* skills, "no keywords -> always active"). Earlier versions put the rules
|
|
9
|
+
* in an `[intutic]` table of `config.toml`, which OpenHands never reads;
|
|
10
|
+
* connect drops that table and disconnect removes it;
|
|
11
|
+
* - `[llm] base_url` merged into `config.toml`, keeping the rest of the file;
|
|
12
|
+
* - the PreToolUse hook in `.openhands/hooks.json`.
|
|
7
13
|
*
|
|
8
14
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
15
|
* @module
|
|
@@ -12,53 +18,65 @@ import { join, dirname } from 'node:path';
|
|
|
12
18
|
import { access, readFile, writeFile, rename, mkdir } from 'node:fs/promises';
|
|
13
19
|
import { HarnessType } from '@intutic/shared-types';
|
|
14
20
|
import { hashFile } from '../lib/hash.js';
|
|
15
|
-
import { writeOpenHandsHooks, mergeOpenHandsToml } from '@intutic/sync-daemon/harness/openhandsHooks';
|
|
21
|
+
import { writeOpenHandsHooks, mergeOpenHandsToml, isOpenHandsConfig } from '@intutic/sync-daemon/harness/openhandsHooks';
|
|
22
|
+
import { keepOriginal } from '@intutic/sync-daemon';
|
|
16
23
|
import { log } from '../lib/logger.js';
|
|
24
|
+
import { writeOwnRulesFile } from './rulesFiles.js';
|
|
17
25
|
const CONFIG_FILE = 'config.toml';
|
|
26
|
+
const RULES_FILE = '.openhands/microagents/intutic-governance.md';
|
|
18
27
|
export const openhandsAdapter = {
|
|
19
28
|
type: HarnessType.OPENHANDS,
|
|
20
|
-
configFileName:
|
|
29
|
+
configFileName: RULES_FILE,
|
|
30
|
+
// `.openhands/` is OpenHands' own per-repository directory (`setup.sh`,
|
|
31
|
+
// microagents). Without it, a `config.toml` counts only when it is an
|
|
32
|
+
// OpenHands configuration: the file name alone matched every Hugo site and
|
|
33
|
+
// any other project with a config.toml.
|
|
21
34
|
async detect(workspaceRoot) {
|
|
22
35
|
try {
|
|
23
|
-
await access(join(workspaceRoot,
|
|
36
|
+
await access(join(workspaceRoot, '.openhands'));
|
|
24
37
|
return true;
|
|
25
38
|
}
|
|
39
|
+
catch {
|
|
40
|
+
// No per-repository directory: look at config.toml.
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
return isOpenHandsConfig(await readFile(join(workspaceRoot, CONFIG_FILE), 'utf-8'));
|
|
44
|
+
}
|
|
26
45
|
catch {
|
|
27
46
|
return false;
|
|
28
47
|
}
|
|
29
48
|
},
|
|
49
|
+
/** The .openhands/hooks.json PreToolUse hook. */
|
|
50
|
+
async installGate(workspaceRoot, proxyUrl) {
|
|
51
|
+
await writeOpenHandsHooks(workspaceRoot, proxyUrl);
|
|
52
|
+
},
|
|
30
53
|
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
: '# Intutic governance active — no SOP rules configured yet.';
|
|
35
|
-
// Merged into the user's config.toml: [llm] base_url and an [intutic]
|
|
36
|
-
// table for the SOP text; everything else is kept. A file that does not
|
|
37
|
-
// parse is left alone.
|
|
54
|
+
// Merged into the user's config.toml: [llm] base_url; everything else is
|
|
55
|
+
// kept. A file that does not parse is left alone.
|
|
56
|
+
const configPath = join(workspaceRoot, CONFIG_FILE);
|
|
38
57
|
let raw = '';
|
|
39
58
|
try {
|
|
40
|
-
raw = await readFile(
|
|
59
|
+
raw = await readFile(configPath, 'utf-8');
|
|
41
60
|
}
|
|
42
61
|
catch { /* no config.toml yet */ }
|
|
43
|
-
const merged = mergeOpenHandsToml(raw, proxyUrl
|
|
62
|
+
const merged = mergeOpenHandsToml(raw, proxyUrl);
|
|
44
63
|
let written = null;
|
|
45
64
|
if (merged === null) {
|
|
46
|
-
log.warn(`${
|
|
65
|
+
log.warn(`${configPath} is not valid TOML — left untouched`);
|
|
47
66
|
}
|
|
48
|
-
else {
|
|
49
|
-
const tmpPath =
|
|
50
|
-
await
|
|
67
|
+
else if (merged !== raw) {
|
|
68
|
+
const tmpPath = configPath + '.intutic-tmp';
|
|
69
|
+
await keepOriginal(configPath, workspaceRoot);
|
|
70
|
+
await mkdir(dirname(configPath), { recursive: true });
|
|
51
71
|
await writeFile(tmpPath, merged, 'utf-8');
|
|
52
|
-
await rename(tmpPath,
|
|
53
|
-
written =
|
|
72
|
+
await rename(tmpPath, configPath);
|
|
73
|
+
written = configPath;
|
|
54
74
|
}
|
|
55
|
-
|
|
56
|
-
await writeOpenHandsHooks(workspaceRoot, proxyUrl);
|
|
57
|
-
return written;
|
|
75
|
+
return (await writeOwnRulesFile(workspaceRoot, RULES_FILE, sops, proxyUrl)) ?? written;
|
|
58
76
|
},
|
|
59
77
|
async readCurrentHash(workspaceRoot) {
|
|
60
78
|
try {
|
|
61
|
-
return await hashFile(join(workspaceRoot,
|
|
79
|
+
return await hashFile(join(workspaceRoot, RULES_FILE));
|
|
62
80
|
}
|
|
63
81
|
catch {
|
|
64
82
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openhands.js","sourceRoot":"","sources":["../../src/harness/openhands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openhands.js","sourceRoot":"","sources":["../../src/harness/openhands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AACxH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACt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AAA;QAChD,IAAI,OAAO,GAAkB,IAAI,CAAA;QACjC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU,qCAAqC,CAAC,CAAA;QAC9D,CAAC;aAAM,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,UAAU,GAAG,cAAc,CAAA;YAC3C,MAAM,YAAY,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;YAC7C,MAAM,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YACrD,MAAM,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;YACzC,MAAM,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;YACjC,OAAO,GAAG,UAAU,CAAA;QACtB,CAAC;QAED,OAAO,CAAC,MAAM,iBAAiB,CAAC,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,IAAI,OAAO,CAAA;IACxF,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,aAAqB;QACzC,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAA;QACxD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
|
package/dist/harness/pi.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* pi.ts — Pi adapter.
|
|
3
3
|
*
|
|
4
|
-
* Detects Pi
|
|
5
|
-
*
|
|
4
|
+
* Detects Pi (its `~/.pi` home, or a project's `.pi` directory) and installs
|
|
5
|
+
* the gate: an extension in `~/.pi/agent/extensions/` (see piHooks.ts).
|
|
6
|
+
*
|
|
7
|
+
* Pi loads `AGENTS.md` from its agent directory and from every directory
|
|
8
|
+
* between where it runs and the filesystem root, so the rule sets go into the
|
|
9
|
+
* workspace's `AGENTS.md` through the shared writer (agentsMd.ts;
|
|
10
|
+
* https://github.com/earendil-works/pi/blob/6fb2e7815167e6b19006fc526d1a5d0f5f998787/packages/coding-agent/docs/configuration.md).
|
|
6
11
|
*
|
|
7
12
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
13
|
* @module
|
package/dist/harness/pi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQjD,eAAO,MAAM,SAAS,EAAE,eA4BvB,CAAA"}
|
package/dist/harness/pi.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* pi.ts — Pi adapter.
|
|
3
3
|
*
|
|
4
|
-
* Detects Pi
|
|
5
|
-
*
|
|
4
|
+
* Detects Pi (its `~/.pi` home, or a project's `.pi` directory) and installs
|
|
5
|
+
* the gate: an extension in `~/.pi/agent/extensions/` (see piHooks.ts).
|
|
6
|
+
*
|
|
7
|
+
* Pi loads `AGENTS.md` from its agent directory and from every directory
|
|
8
|
+
* between where it runs and the filesystem root, so the rule sets go into the
|
|
9
|
+
* workspace's `AGENTS.md` through the shared writer (agentsMd.ts;
|
|
10
|
+
* https://github.com/earendil-works/pi/blob/6fb2e7815167e6b19006fc526d1a5d0f5f998787/packages/coding-agent/docs/configuration.md).
|
|
6
11
|
*
|
|
7
12
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
13
|
* @module
|
|
@@ -12,16 +17,17 @@ import { access } from 'node:fs/promises';
|
|
|
12
17
|
import { existsSync } from 'node:fs';
|
|
13
18
|
import { homedir } from 'node:os';
|
|
14
19
|
import { HarnessType } from '@intutic/shared-types';
|
|
15
|
-
import { hashFile } from '../lib/hash.js';
|
|
16
20
|
import { loadCredentials } from '../config/store.js';
|
|
21
|
+
import { AGENTS_MD, agentsMdHash, writeAgentsMd } from './agentsMd.js';
|
|
17
22
|
import { writePiHooks } from '@intutic/sync-daemon';
|
|
18
|
-
|
|
23
|
+
/** A project's Pi configuration directory (settings, extensions, MCP servers). */
|
|
24
|
+
const DETECT_FILE = '.pi';
|
|
19
25
|
export const piAdapter = {
|
|
20
26
|
type: HarnessType.PI,
|
|
21
|
-
configFileName:
|
|
27
|
+
configFileName: AGENTS_MD,
|
|
22
28
|
async detect(workspaceRoot) {
|
|
23
29
|
const globalPi = join(homedir(), '.pi');
|
|
24
|
-
const localPi = join(workspaceRoot,
|
|
30
|
+
const localPi = join(workspaceRoot, DETECT_FILE);
|
|
25
31
|
try {
|
|
26
32
|
if (existsSync(globalPi))
|
|
27
33
|
return true;
|
|
@@ -32,20 +38,15 @@ export const piAdapter = {
|
|
|
32
38
|
return false;
|
|
33
39
|
}
|
|
34
40
|
},
|
|
35
|
-
async
|
|
36
|
-
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
41
|
+
async installGate(workspaceRoot, proxyUrl) {
|
|
37
42
|
const creds = await loadCredentials();
|
|
38
|
-
|
|
39
|
-
await writePiHooks(workspaceRoot, proxyUrl, workspaceId);
|
|
40
|
-
return filePath;
|
|
43
|
+
await writePiHooks(workspaceRoot, proxyUrl, creds?.workspaceId || 'local');
|
|
41
44
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
45
|
+
writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
46
|
+
return writeAgentsMd(workspaceRoot, sops, proxyUrl);
|
|
47
|
+
},
|
|
48
|
+
readCurrentHash(workspaceRoot) {
|
|
49
|
+
return agentsMdHash(workspaceRoot);
|
|
49
50
|
},
|
|
50
51
|
};
|
|
51
52
|
//# sourceMappingURL=pi.js.map
|
package/dist/harness/pi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,kFAAkF;AAClF,MAAM,WAAW,GAAG,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,IAAI,EAAE,WAAW,CAAC,EAAE;IACpB,cAAc,EAAE,SAAS;IAEzB,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAA;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QAChD,IAAI,CAAC;YACH,IAAI,UAAU,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;YACrC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAA;YACrB,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YAC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