@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/windsurf.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* windsurf.ts — Windsurf adapter (full implementation with hooks + TLS MITM proxy config).
|
|
3
3
|
*
|
|
4
|
-
* Writes
|
|
4
|
+
* Writes the rule sets to `.windsurf/rules/intutic-governance.md` with
|
|
5
|
+
* `trigger: always_on`, which Cascade includes in every message
|
|
6
|
+
* (https://docs.devin.ai/desktop/cascade/memories, where Windsurf's rules
|
|
7
|
+
* docs now live; `.windsurfrules`, which earlier versions overwrote, is the
|
|
8
|
+
* legacy single file, and the user's own copy of it comes back), and injects
|
|
9
|
+
* Cascade hook scripts
|
|
5
10
|
* at user-level (~/.codeium/windsurf/hooks.json) and workspace-level
|
|
6
11
|
* (.windsurf/hooks.json), merged with any hooks already there. Also merges
|
|
7
|
-
* HTTP proxy settings into
|
|
12
|
+
* HTTP proxy settings into Windsurf's user settings.json, and switches
|
|
8
13
|
* the IDE HTTP proxy of every JetBrains IDE where the Windsurf plugin is set
|
|
9
14
|
* up, so Windsurf's AI traffic goes through the Intutic TLS MITM proxy.
|
|
10
15
|
*
|
|
@@ -14,20 +19,18 @@
|
|
|
14
19
|
import { access } from 'node:fs/promises';
|
|
15
20
|
import { join } from 'node:path';
|
|
16
21
|
import { homedir } from 'node:os';
|
|
17
|
-
import { HarnessType } from '@intutic/shared-types';
|
|
18
|
-
import { hashFile } from '../lib/hash.js';
|
|
19
|
-
import { buildMarkdownContent } from './base.js';
|
|
22
|
+
import { HarnessType, rulesFrontMatterOf } from '@intutic/shared-types';
|
|
20
23
|
import { loadCredentials } from '../config/store.js';
|
|
21
24
|
import { writeWindsurfHooks } from '@intutic/sync-daemon/harness/windsurfHooks';
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
+
import { ownRulesFileHash, retireLegacyRulesFile, writeOwnRulesFile } from './rulesFiles.js';
|
|
26
|
+
const CONFIG_FILE = '.windsurf/rules/intutic-governance.md';
|
|
27
|
+
const LEGACY_FILE = '.windsurfrules';
|
|
25
28
|
const WINDSURF_USER_DIR = join(homedir(), '.codeium', 'windsurf');
|
|
26
29
|
export const windsurfAdapter = {
|
|
27
30
|
type: HarnessType.WINDSURF,
|
|
28
31
|
configFileName: CONFIG_FILE,
|
|
29
32
|
async detect(workspaceRoot) {
|
|
30
|
-
for (const marker of [
|
|
33
|
+
for (const marker of [LEGACY_FILE, '.windsurf']) {
|
|
31
34
|
try {
|
|
32
35
|
await access(join(workspaceRoot, marker));
|
|
33
36
|
return true;
|
|
@@ -42,30 +45,20 @@ export const windsurfAdapter = {
|
|
|
42
45
|
return false;
|
|
43
46
|
}
|
|
44
47
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
await mkdir(dirname(filePath), { recursive: true });
|
|
50
|
-
const tmp = filePath + '.intutic-tmp';
|
|
51
|
-
await writeFile(tmp, content, 'utf-8');
|
|
52
|
-
await rename(tmp, filePath);
|
|
53
|
-
// 2. Write Cascade hooks.json at user + workspace level, configure TLS MITM
|
|
54
|
-
// proxy. The proxy serves HTTP CONNECT on the same listener as its API,
|
|
55
|
-
// so the port is the one `intutic connect` runs it on (PORT, 4000 by
|
|
56
|
-
// default).
|
|
48
|
+
/** Cascade hooks.json at user + workspace level, and the TLS MITM proxy.
|
|
49
|
+
* The proxy serves HTTP CONNECT on the same listener as its API, so the
|
|
50
|
+
* port is the one `intutic connect` runs it on (PORT, 4000 by default). */
|
|
51
|
+
async installGate(workspaceRoot, proxyUrl) {
|
|
57
52
|
const proxyPort = parseInt(process.env.PORT || '4000', 10);
|
|
58
53
|
const creds = await loadCredentials();
|
|
59
54
|
await writeWindsurfHooks(workspaceRoot, proxyUrl, proxyPort, creds?.workspaceId || 'local');
|
|
60
|
-
return filePath;
|
|
61
55
|
},
|
|
62
|
-
async
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
56
|
+
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
57
|
+
await retireLegacyRulesFile(workspaceRoot, LEGACY_FILE);
|
|
58
|
+
return writeOwnRulesFile(workspaceRoot, CONFIG_FILE, sops, proxyUrl, rulesFrontMatterOf(HarnessType.WINDSURF, 'Intutic governance rules'));
|
|
59
|
+
},
|
|
60
|
+
readCurrentHash(workspaceRoot) {
|
|
61
|
+
return ownRulesFileHash(workspaceRoot, CONFIG_FILE);
|
|
69
62
|
},
|
|
70
63
|
};
|
|
71
64
|
//# sourceMappingURL=windsurf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windsurf.js","sourceRoot":"","sources":["../../src/harness/windsurf.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"windsurf.js","sourceRoot":"","sources":["../../src/harness/windsurf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAGvE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB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AiB,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,kBAAkB,CAAC,WAAW,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC,CAAA;IAC5I,CAAC;IAED,eAAe,CAAC,aAAqB;QACnC,OAAO,gBAAgB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;IACrD,CAAC;CACF,CAAA"}
|
package/dist/harness/xirp.d.ts
CHANGED
|
@@ -13,13 +13,11 @@
|
|
|
13
13
|
* That means this adapter exists for DETECTION/reporting only. `writeConfig`
|
|
14
14
|
* writes nothing: whatever Intutic already writes for the wrapped harness
|
|
15
15
|
* (`claudeCode.ts` / `codex.ts` / `antigravity.ts`'s own adapters) is what
|
|
16
|
-
* governs a tool call made inside a Xirp-managed session
|
|
17
|
-
* files
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* gitWorktrees.ts` + its wiring into `syncLoop.ts`) is what closes that gap;
|
|
22
|
-
* this adapter's only job is recognising that a Xirp-managed workspace is
|
|
16
|
+
* governs a tool call made inside a Xirp-managed session. Project-level
|
|
17
|
+
* files do not reach the git worktree Xirp creates for that session (a
|
|
18
|
+
* worktree has its own working tree, and these files are untracked), so it
|
|
19
|
+
* is the wrapped harness's user-level registration that applies there. This
|
|
20
|
+
* adapter's only job is recognising that a Xirp-managed workspace is
|
|
23
21
|
* present at all, so `intutic status`/`intutic init` can report it.
|
|
24
22
|
*
|
|
25
23
|
* See `services/sync-daemon/__tests__/harness/gateRegistry.ts`'s NO_GATE row
|
|
@@ -32,8 +30,7 @@
|
|
|
32
30
|
* download available in this environment, so none of the detection paths
|
|
33
31
|
* below were live-verified against a real install — they follow this
|
|
34
32
|
* codebase's own convention for comparable tools (`~/.grok`, `~/.muse`,
|
|
35
|
-
* `<Name>.app` in `/Applications`) rather than a confirmed Xirp source.
|
|
36
|
-
* TD-390.
|
|
33
|
+
* `<Name>.app` in `/Applications`) rather than a confirmed Xirp source.
|
|
37
34
|
*
|
|
38
35
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
39
36
|
* @module
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xirp.d.ts","sourceRoot":"","sources":["../../src/harness/xirp.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"xirp.d.ts","sourceRoot":"","sources":["../../src/harness/xirp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD,eAAO,MAAM,WAAW,EAAE,eAgDzB,CAAA"}
|
package/dist/harness/xirp.js
CHANGED
|
@@ -13,13 +13,11 @@
|
|
|
13
13
|
* That means this adapter exists for DETECTION/reporting only. `writeConfig`
|
|
14
14
|
* writes nothing: whatever Intutic already writes for the wrapped harness
|
|
15
15
|
* (`claudeCode.ts` / `codex.ts` / `antigravity.ts`'s own adapters) is what
|
|
16
|
-
* governs a tool call made inside a Xirp-managed session
|
|
17
|
-
* files
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* gitWorktrees.ts` + its wiring into `syncLoop.ts`) is what closes that gap;
|
|
22
|
-
* this adapter's only job is recognising that a Xirp-managed workspace is
|
|
16
|
+
* governs a tool call made inside a Xirp-managed session. Project-level
|
|
17
|
+
* files do not reach the git worktree Xirp creates for that session (a
|
|
18
|
+
* worktree has its own working tree, and these files are untracked), so it
|
|
19
|
+
* is the wrapped harness's user-level registration that applies there. This
|
|
20
|
+
* adapter's only job is recognising that a Xirp-managed workspace is
|
|
23
21
|
* present at all, so `intutic status`/`intutic init` can report it.
|
|
24
22
|
*
|
|
25
23
|
* See `services/sync-daemon/__tests__/harness/gateRegistry.ts`'s NO_GATE row
|
|
@@ -32,8 +30,7 @@
|
|
|
32
30
|
* download available in this environment, so none of the detection paths
|
|
33
31
|
* below were live-verified against a real install — they follow this
|
|
34
32
|
* codebase's own convention for comparable tools (`~/.grok`, `~/.muse`,
|
|
35
|
-
* `<Name>.app` in `/Applications`) rather than a confirmed Xirp source.
|
|
36
|
-
* TD-390.
|
|
33
|
+
* `<Name>.app` in `/Applications`) rather than a confirmed Xirp source.
|
|
37
34
|
*
|
|
38
35
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
39
36
|
* @module
|
|
@@ -49,7 +46,7 @@ const XIRP_APP_PATH = '/Applications/Xirp.app';
|
|
|
49
46
|
export const xirpAdapter = {
|
|
50
47
|
type: HarnessType.XIRP,
|
|
51
48
|
// No config file of its own — see module doc. Matches the goose/cline-
|
|
52
|
-
// style convention of an empty
|
|
49
|
+
// style convention of an empty HARNESS_FILES entry for a harness
|
|
53
50
|
// whose governance-relevant writes are not a single named file (in Xirp's
|
|
54
51
|
// case: no writes of its own at all).
|
|
55
52
|
configFileName: '',
|
package/dist/harness/xirp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xirp.js","sourceRoot":"","sources":["../../src/harness/xirp.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"xirp.js","sourceRoot":"","sources":["../../src/harness/xirp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAInD,0EAA0E;AAC1E,MAAM,kBAAkB,GAAG,OAAO,CAAA;AAClC,0EAA0E;AAC1E,MAAM,aAAa,GAAG,wBAAwB,CAAA;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAoB;IAC1C,IAAI,EAAE,WAAW,CAAC,IAAI;IACtB,uEAAuE;IACvE,iEAAiE;IACjE,0EAA0E;IAC1E,sCAAsC;IACtC,cAAc,EAAE,EAAE;IAElB,KAAK,CAAC,MAAM,CAAC,cAAsB;QACjC,mEAAmE;QACnE,kEAAkE;QAClE,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QAE/C,qEAAqE;QACrE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAA;QACrC,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,OAAO,CAAC,CAAA;gBACrB,OAAO,IAAI,CAAA;YACb,CAAC;YAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAChC,CAAC;QAED,0DAA0D;QAC1D,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAA;YACjD,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAE9B,4CAA4C;QAC5C,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,aAAa,CAAC,CAAA;YAC3B,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAE9B,OAAO,KAAK,CAAA;IACd,CAAC;IAED,2EAA2E;IAC3E,0EAA0E;IAC1E,sEAAsE;IACtE,kCAAkC;IAClC,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"}
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Uses native fetch() (Node 18+). All requests include
|
|
5
5
|
* Authorization: Bearer <apiKey> header.
|
|
6
6
|
*
|
|
7
|
-
* LLD #8 — Sync Daemon / CLI
|
|
8
7
|
* @module
|
|
9
8
|
*/
|
|
10
9
|
import type { SyncConfigPayload, DaemonStatus, SopHashReport } from '@intutic/shared-types';
|
|
@@ -45,6 +44,14 @@ export interface ApiClient {
|
|
|
45
44
|
status: number;
|
|
46
45
|
body: T;
|
|
47
46
|
}>;
|
|
47
|
+
/**
|
|
48
|
+
* GET for a file download: the body as bytes.
|
|
49
|
+
*
|
|
50
|
+
* `get()` parses JSON, which a report served as markdown, CSV or PDF is
|
|
51
|
+
* not (`/api/v1/compliance/frameworks/:id/coverage?format=pdf`). A non-2xx
|
|
52
|
+
* throws exactly as `get()` does, since those errors are JSON.
|
|
53
|
+
*/
|
|
54
|
+
getFile(path: string): Promise<Uint8Array>;
|
|
48
55
|
/** Generic POST request for arbitrary API paths. */
|
|
49
56
|
post<T>(path: string, body?: unknown): Promise<T>;
|
|
50
57
|
/**
|
|
@@ -59,6 +66,19 @@ export interface ApiClient {
|
|
|
59
66
|
status: number;
|
|
60
67
|
body: T;
|
|
61
68
|
}>;
|
|
69
|
+
/**
|
|
70
|
+
* PUT and DELETE that hand back the status, for the same reason:
|
|
71
|
+
* `PUT /api/v1/policy-guardrails/guardrails/:id` answers 400 with the
|
|
72
|
+
* validator's named checks and 409 with a `code`, and both are the answer.
|
|
73
|
+
*/
|
|
74
|
+
putWithStatus<T>(path: string, body?: unknown): Promise<{
|
|
75
|
+
status: number;
|
|
76
|
+
body: T;
|
|
77
|
+
}>;
|
|
78
|
+
delWithStatus<T>(path: string): Promise<{
|
|
79
|
+
status: number;
|
|
80
|
+
body: T;
|
|
81
|
+
}>;
|
|
62
82
|
/**
|
|
63
83
|
* Multipart POST that hands back the status.
|
|
64
84
|
*
|
|
@@ -83,6 +103,12 @@ export interface ApiClient {
|
|
|
83
103
|
* @param controlPlaneUrl - Base URL (e.g., http://localhost:3001 or https://api.intutic.ai)
|
|
84
104
|
* @param apiKey - API key (vk_*) or JWT access token
|
|
85
105
|
*/
|
|
106
|
+
/**
|
|
107
|
+
* The error a failed call throws. A 403 carries the server's `detail` when it
|
|
108
|
+
* gives one (a role guard names the roles that may make the call), so a member
|
|
109
|
+
* whose role cannot do something is told which role can, not shown raw JSON.
|
|
110
|
+
*/
|
|
111
|
+
export declare function apiFailure(method: string, path: string, status: number, text: string): Error;
|
|
86
112
|
export declare function createApiClient(controlPlaneUrl: string, apiKey: string): ApiClient;
|
|
87
113
|
/**
|
|
88
114
|
* Decodes a TOON payload, normalising "not TOON" to an empty list.
|
package/dist/lib/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACd,MAAM,uBAAuB,CAAA;AAI9B,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC5D,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpF,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpE,KAAK,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACxF,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;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AAQ,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAA;IAC/E,mDAAmD;IACnD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAChD,qDAAqD;IACrD,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAClD,sDAAsD;IACtD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;CACjD;AAED;;;;;GAKG;AACH;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAU5F;AAED,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CA2IlF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAElE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAmBzD"}
|
package/dist/lib/api.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Uses native fetch() (Node 18+). All requests include
|
|
5
5
|
* Authorization: Bearer <apiKey> header.
|
|
6
6
|
*
|
|
7
|
-
* LLD #8 — Sync Daemon / CLI
|
|
8
7
|
* @module
|
|
9
8
|
*/
|
|
10
9
|
import { toonDecode as sharedToonDecode } from '@intutic/shared-types';
|
|
@@ -15,6 +14,24 @@ import { injectTraceHeaders } from './otelPropagation.js';
|
|
|
15
14
|
* @param controlPlaneUrl - Base URL (e.g., http://localhost:3001 or https://api.intutic.ai)
|
|
16
15
|
* @param apiKey - API key (vk_*) or JWT access token
|
|
17
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* The error a failed call throws. A 403 carries the server's `detail` when it
|
|
19
|
+
* gives one (a role guard names the roles that may make the call), so a member
|
|
20
|
+
* whose role cannot do something is told which role can, not shown raw JSON.
|
|
21
|
+
*/
|
|
22
|
+
export function apiFailure(method, path, status, text) {
|
|
23
|
+
if (status === 403) {
|
|
24
|
+
try {
|
|
25
|
+
const body = JSON.parse(text);
|
|
26
|
+
if (typeof body.detail === 'string')
|
|
27
|
+
return new Error(`API ${method} ${path} refused (403): ${body.detail}`);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
// Not JSON: fall through to the raw text.
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return new Error(`API ${method} ${path} failed (${status}): ${text}`);
|
|
34
|
+
}
|
|
18
35
|
export function createApiClient(controlPlaneUrl, apiKey) {
|
|
19
36
|
const baseHeaders = {
|
|
20
37
|
'Content-Type': 'application/json',
|
|
@@ -33,10 +50,29 @@ export function createApiClient(controlPlaneUrl, apiKey) {
|
|
|
33
50
|
});
|
|
34
51
|
if (!res.ok) {
|
|
35
52
|
const text = await res.text().catch(() => 'Unknown error');
|
|
36
|
-
throw
|
|
53
|
+
throw apiFailure(method, path, res.status, text);
|
|
37
54
|
}
|
|
38
55
|
return unwrapToonEnvelope(await res.json());
|
|
39
56
|
}
|
|
57
|
+
/** A JSON request whose non-2xx answer is returned, not thrown; a body that is not JSON comes back as `{ error: text }`. */
|
|
58
|
+
async function withStatus(method, path, body) {
|
|
59
|
+
const headers = { ...baseHeaders };
|
|
60
|
+
injectTraceHeaders(headers);
|
|
61
|
+
const res = await fetch(`${controlPlaneUrl}${path}`, {
|
|
62
|
+
method,
|
|
63
|
+
headers,
|
|
64
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
65
|
+
});
|
|
66
|
+
const text = await res.text();
|
|
67
|
+
let parsed;
|
|
68
|
+
try {
|
|
69
|
+
parsed = JSON.parse(text);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
parsed = { error: text };
|
|
73
|
+
}
|
|
74
|
+
return { status: res.status, body: unwrapToonEnvelope(parsed) };
|
|
75
|
+
}
|
|
40
76
|
return {
|
|
41
77
|
async fetchConfig(workspaceId) {
|
|
42
78
|
return request('POST', '/api/v1/sync/config', { workspaceId });
|
|
@@ -72,26 +108,27 @@ export function createApiClient(controlPlaneUrl, apiKey) {
|
|
|
72
108
|
}
|
|
73
109
|
return { status: res.status, body: body };
|
|
74
110
|
},
|
|
111
|
+
async getFile(path) {
|
|
112
|
+
const headers = { Authorization: baseHeaders.Authorization };
|
|
113
|
+
injectTraceHeaders(headers);
|
|
114
|
+
const res = await fetch(`${controlPlaneUrl}${path}`, { method: 'GET', headers });
|
|
115
|
+
if (!res.ok) {
|
|
116
|
+
const text = await res.text().catch(() => 'Unknown error');
|
|
117
|
+
throw apiFailure('GET', path, res.status, text);
|
|
118
|
+
}
|
|
119
|
+
return new Uint8Array(await res.arrayBuffer());
|
|
120
|
+
},
|
|
75
121
|
async post(path, body) {
|
|
76
122
|
return request('POST', path, body);
|
|
77
123
|
},
|
|
78
124
|
async postWithStatus(path, body) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const text = await res.text();
|
|
87
|
-
let parsed;
|
|
88
|
-
try {
|
|
89
|
-
parsed = JSON.parse(text);
|
|
90
|
-
}
|
|
91
|
-
catch {
|
|
92
|
-
parsed = { error: text };
|
|
93
|
-
}
|
|
94
|
-
return { status: res.status, body: unwrapToonEnvelope(parsed) };
|
|
125
|
+
return withStatus('POST', path, body);
|
|
126
|
+
},
|
|
127
|
+
async putWithStatus(path, body) {
|
|
128
|
+
return withStatus('PUT', path, body);
|
|
129
|
+
},
|
|
130
|
+
async delWithStatus(path) {
|
|
131
|
+
return withStatus('DELETE', path);
|
|
95
132
|
},
|
|
96
133
|
async postForm(path, form) {
|
|
97
134
|
const headers = { Authorization: baseHeaders.Authorization };
|
package/dist/lib/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AA8DzD;;;;;GAKG;AACH;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,IAAY,EAAE,MAAc,EAAE,IAAY;IACnF,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAyB,CAAA;YACrD,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;gBAAE,OAAO,IAAI,KAAK,CAAC,OAAO,MAAM,IAAI,IAAI,mBAAmB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QAC9G,CAAC;QAAC,MAAM,CAAC;YACP,0CAA0C;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,OAAO,MAAM,IAAI,IAAI,YAAY,MAAM,MAAM,IAAI,EAAE,CAAC,CAAA;AACvE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,eAAuB,EAAE,MAAc;IACrE,MAAM,WAAW,GAAG;QAClB,cAAc,EAAE,kBAAkB;QAClC,eAAe,EAAE,UAAU,MAAM,EAAE;KACpC,CAAA;IAED,KAAK,UAAU,O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,CAAC,CAAA;QACxC,CAAC;QAED,KAAK,CAAC,GAAG,CAAI,IAAY,EAAE,IAAc;YACvC,OAAO,OAAO,CAAI,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QACzC,CAAC;KACF,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;AACrC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,IACE,CAAC,IAAI;QACL,OAAO,IAAI,KAAK,QAAQ;QACxB,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC;QAClB,IAAgC,CAAC,QAAQ,CAAC,KAAK,MAAM,EACtD,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,IAAI,GAAG,IAA+B,CAAA;IAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,CAAA;IACzC,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,YAAY,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAErF,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAA;IACrB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAA;IACnB,OAAO,IAAI,CAAC,cAAc,CAAC,CAAA;IAC3B,IAAI,CAAC,YAAY,CAAC,GAAG,OAAO,CAAA;IAC5B,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* command-pipeline taint analysis, and (with `--use-behavioral`) full
|
|
6
6
|
* AST/dataflow analysis of skill content — genuinely deeper than this
|
|
7
7
|
* codebase's own regex-genre scanning (`packages/shared-types/src/scriptScan.ts`,
|
|
8
|
-
* Phase S2).
|
|
8
|
+
* Phase S2). This integration is the
|
|
9
9
|
* follow-up to that phase's deliberately-scoped pattern matching.
|
|
10
10
|
*
|
|
11
11
|
* # Why a shell-out, not a dependency
|
package/dist/lib/ciscoScanner.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* command-pipeline taint analysis, and (with `--use-behavioral`) full
|
|
6
6
|
* AST/dataflow analysis of skill content — genuinely deeper than this
|
|
7
7
|
* codebase's own regex-genre scanning (`packages/shared-types/src/scriptScan.ts`,
|
|
8
|
-
* Phase S2).
|
|
8
|
+
* Phase S2). This integration is the
|
|
9
9
|
* follow-up to that phase's deliberately-scoped pattern matching.
|
|
10
10
|
*
|
|
11
11
|
* # Why a shell-out, not a dependency
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decisionsLogRefresh.d.ts","sourceRoot":"","sources":["../../src/lib/decisionsLogRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"decisionsLogRefresh.d.ts","sourceRoot":"","sources":["../../src/lib/decisionsLogRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CA2BnG"}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { loadCredentials } from '../config/store.js';
|
|
15
15
|
import { createApiClient } from './api.js';
|
|
16
|
-
import { refreshDecisionsDigest } from '@intutic/sync-daemon';
|
|
17
|
-
import {
|
|
16
|
+
import { refreshDecisionsDigest, retireClaudeMdDigest } from '@intutic/sync-daemon';
|
|
17
|
+
import { loadConfig } from '../config/store.js';
|
|
18
18
|
/**
|
|
19
19
|
* Checks `WorkspaceSettings.decisionsLogEnabled` before writing anything.
|
|
20
20
|
*
|
|
@@ -34,16 +34,15 @@ export async function refreshDecisionsLog(workspaceRoot) {
|
|
|
34
34
|
if (!settings?.decisionsLogEnabled) {
|
|
35
35
|
return { refreshed: false, reason: 'decisionsLogEnabled is off' };
|
|
36
36
|
}
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
// draw from the way the daemon's sync loop does.
|
|
37
|
+
// Every harness this machine governs gets the entries where it reads
|
|
38
|
+
// its instructions, as on the daemon's own cycle.
|
|
39
|
+
await retireClaudeMdDigest(workspaceRoot);
|
|
41
40
|
const result = await refreshDecisionsDigest({
|
|
42
41
|
controlPlaneUrl: creds.controlPlaneUrl,
|
|
43
42
|
apiKey: creds.apiKey,
|
|
44
43
|
workspaceId: creds.workspaceId,
|
|
45
44
|
workspaceRoot,
|
|
46
|
-
harnesses: [
|
|
45
|
+
harnesses: (loadConfig()?.harnesses ?? []),
|
|
47
46
|
});
|
|
48
47
|
return result ? { refreshed: true } : { refreshed: false, reason: 'digest fetch failed' };
|
|
49
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decisionsLogRefresh.js","sourceRoot":"","sources":["../../src/lib/decisionsLogRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"decisionsLogRefresh.js","sourceRoot":"","sources":["../../src/lib/decisionsLogRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EA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AC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAA;IACvF,CAAC;AACH,CAAC"}
|
|
@@ -23,4 +23,19 @@ export interface ReportDeviceStateOptions {
|
|
|
23
23
|
* surfacing, this function never throws over it.
|
|
24
24
|
*/
|
|
25
25
|
export declare function reportDeviceState(opts?: ReportDeviceStateOptions): Promise<DeviceReportResult>;
|
|
26
|
+
/** How long `intutic disconnect` waits for the control plane before going on without it. */
|
|
27
|
+
export declare const DISCONNECT_REPORT_TIMEOUT_MS = 5000;
|
|
28
|
+
/**
|
|
29
|
+
* Tells the control plane this machine ran `intutic disconnect`
|
|
30
|
+
* (`POST /api/v1/devices/disconnect`), so it stops expecting the machine's
|
|
31
|
+
* gates and does not read the machine going quiet as a fault. Sent before
|
|
32
|
+
* disconnect removes the credentials, under the fingerprint the device and
|
|
33
|
+
* the AI inventory report. Never throws, and gives up after
|
|
34
|
+
* {@link DISCONNECT_REPORT_TIMEOUT_MS}: an unreachable control plane must not
|
|
35
|
+
* stop a disconnect.
|
|
36
|
+
*/
|
|
37
|
+
export declare function reportDisconnect(opts: {
|
|
38
|
+
scope: 'machine' | 'harness';
|
|
39
|
+
harnesses: readonly string[];
|
|
40
|
+
}): Promise<DeviceReportResult>;
|
|
26
41
|
//# sourceMappingURL=deviceReport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceReport.d.ts","sourceRoot":"","sources":["../../src/lib/deviceReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"deviceReport.d.ts","sourceRoot":"","sources":["../../src/lib/deviceReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,GAAE,wBAA6B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8BxG;AAED,4FAA4F;AAC5F,eAAO,MAAM,4BAA4B,OAAQ,CAAA;AAEjD;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,KAAK,EAAE,SAAS,GAAG,SAAS,CAAA;IAC5B,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAe9B"}
|
package/dist/lib/deviceReport.js
CHANGED
|
@@ -13,6 +13,7 @@ import { loadCredentials } from '../config/store.js';
|
|
|
13
13
|
import { resolveControlPlaneUrl } from '../config/paths.js';
|
|
14
14
|
import { createApiClient } from './api.js';
|
|
15
15
|
import { readEnforcementState } from './enforcementState.js';
|
|
16
|
+
import { inventoryDeviceIdentity } from './inventory.js';
|
|
16
17
|
const { version: cliVersion } = createRequire(import.meta.url)('../../package.json');
|
|
17
18
|
/**
|
|
18
19
|
* Reads `~/.intutic/` credentials and the local enforcement state file, and
|
|
@@ -52,4 +53,33 @@ export async function reportDeviceState(opts = {}) {
|
|
|
52
53
|
return { reported: false, reason: err instanceof Error ? err.message : String(err) };
|
|
53
54
|
}
|
|
54
55
|
}
|
|
56
|
+
/** How long `intutic disconnect` waits for the control plane before going on without it. */
|
|
57
|
+
export const DISCONNECT_REPORT_TIMEOUT_MS = 5_000;
|
|
58
|
+
/**
|
|
59
|
+
* Tells the control plane this machine ran `intutic disconnect`
|
|
60
|
+
* (`POST /api/v1/devices/disconnect`), so it stops expecting the machine's
|
|
61
|
+
* gates and does not read the machine going quiet as a fault. Sent before
|
|
62
|
+
* disconnect removes the credentials, under the fingerprint the device and
|
|
63
|
+
* the AI inventory report. Never throws, and gives up after
|
|
64
|
+
* {@link DISCONNECT_REPORT_TIMEOUT_MS}: an unreachable control plane must not
|
|
65
|
+
* stop a disconnect.
|
|
66
|
+
*/
|
|
67
|
+
export async function reportDisconnect(opts) {
|
|
68
|
+
try {
|
|
69
|
+
const creds = await loadCredentials();
|
|
70
|
+
if (!creds)
|
|
71
|
+
return { reported: false, reason: 'not authenticated' };
|
|
72
|
+
const device = await inventoryDeviceIdentity(cliVersion);
|
|
73
|
+
const res = await fetch(`${resolveControlPlaneUrl()}/api/v1/devices/disconnect`, {
|
|
74
|
+
method: 'POST',
|
|
75
|
+
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${creds.apiKey}` },
|
|
76
|
+
body: JSON.stringify({ fingerprint: device.fingerprint, hostname: device.hostname, scope: opts.scope, harnesses: opts.harnesses }),
|
|
77
|
+
signal: AbortSignal.timeout(DISCONNECT_REPORT_TIMEOUT_MS),
|
|
78
|
+
});
|
|
79
|
+
return res.ok ? { reported: true } : { reported: false, reason: `the control plane answered ${res.status}` };
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
return { reported: false, reason: err instanceof Error ? err.message : String(err) };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
55
85
|
//# sourceMappingURL=deviceReport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceReport.js","sourceRoot":"","sources":["../../src/lib/deviceReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"deviceReport.js","sourceRoot":"","sources":["../../src/lib/deviceReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM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AAG,MAAM,KAAK,CAAC,GAAG,sBAAsB,EAAE,4BAA4B,EAAE;YAC/E,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,UAAU,KAAK,CAAC,MAAM,EAAE,EAAE;YACxF,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;YAClI,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,4BAA4B,CAAC;SAC1D,CAAC,CAAA;QACF,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B,GAAG,CAAC,MAAM,EAAE,EAAE,CAAA;IAC9G,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAA;IACtF,CAAC;AACH,CAAC"}
|
|
@@ -4,21 +4,31 @@ export interface InjectionResult {
|
|
|
4
4
|
vars: string[];
|
|
5
5
|
method: string;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Where the injector reads and writes. Defaults to the real machine; tests
|
|
9
|
+
* pass temporary paths and a recording `exec` so they never touch it.
|
|
10
|
+
*/
|
|
11
|
+
export interface EnvInjectorTarget {
|
|
12
|
+
platform?: NodeJS.Platform;
|
|
13
|
+
/** The user's `~/.bashrc`. */
|
|
14
|
+
bashrc?: string;
|
|
15
|
+
/** The system-wide file used on Linux when it is writable. */
|
|
16
|
+
etcEnvironment?: string;
|
|
17
|
+
exec?: (command: string) => void;
|
|
18
|
+
}
|
|
7
19
|
export declare class PlatformNotSupportedError extends Error {
|
|
8
20
|
constructor(platform: string);
|
|
9
21
|
}
|
|
10
|
-
export declare class ElevationRequiredError extends Error {
|
|
11
|
-
constructor(path: string);
|
|
12
|
-
}
|
|
13
22
|
/**
|
|
14
23
|
* Injects ANTHROPIC_BASE_URL and OPENAI_BASE_URL as persistent env vars.
|
|
15
24
|
*
|
|
16
25
|
* @param proxyUrl - The Intutic proxy URL (e.g. https://proxy.acme.intutic.ai)
|
|
17
26
|
* @returns InjectionResult describing what was done
|
|
18
27
|
*/
|
|
19
|
-
export declare function injectBaseUrlEnvVars(proxyUrl: string): Promise<InjectionResult>;
|
|
28
|
+
export declare function injectBaseUrlEnvVars(proxyUrl: string, target?: EnvInjectorTarget): Promise<InjectionResult>;
|
|
20
29
|
/**
|
|
21
|
-
* Removes the injected base URL env vars
|
|
30
|
+
* Removes the injected base URL env vars: from wherever `injectBaseUrlEnvVars`
|
|
31
|
+
* can have put them, so a removal is idempotent and complete.
|
|
22
32
|
*/
|
|
23
|
-
export declare function removeBaseUrlEnvVars(): Promise<void>;
|
|
33
|
+
export declare function removeBaseUrlEnvVars(target?: EnvInjectorTarget): Promise<void>;
|
|
24
34
|
//# sourceMappingURL=envInjector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envInjector.d.ts","sourceRoot":"","sources":["../../src/lib/envInjector.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,MAAM,CAAC,QAAQ,CAAA;IAC1B,KAAK,EAAM,QAAQ,GAAG,MAAM,CAAA;IAC5B,IAAI,EAAO,MAAM,EAAE,CAAA;IACnB,MAAM,EAAK,MAAM,CAAA;CAClB;AAED,
|
|
1
|
+
{"version":3,"file":"envInjector.d.ts","sourceRoot":"","sources":["../../src/lib/envInjector.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,MAAM,CAAC,QAAQ,CAAA;IAC1B,KAAK,EAAM,QAAQ,GAAG,MAAM,CAAA;IAC5B,IAAI,EAAO,MAAM,EAAE,CAAA;IACnB,MAAM,EAAK,MAAM,CAAA;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAC1B,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC;AAWD,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,QAAQ,EAAE,MAAM;CAI7B;AAmED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CA6BjH;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCpF"}
|