@intutic/cli 2.2.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 +481 -19
- 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 +109 -51
- 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 +4 -0
- package/dist/commands/disconnect.d.ts.map +1 -1
- package/dist/commands/disconnect.js +17 -3
- package/dist/commands/disconnect.js.map +1 -1
- 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.js +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 +14 -4
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +34 -4
- 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 +1 -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 +3 -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/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 +1 -1
- package/dist/harness/agenticOrchestrator.js +2 -2
- 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 -55
- 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 +14 -23
- 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 +23 -21
- 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 -23
- 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 +12 -20
- 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 +13 -24
- 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/muse.d.ts +3 -7
- package/dist/harness/muse.d.ts.map +1 -1
- package/dist/harness/muse.js +15 -35
- package/dist/harness/muse.js.map +1 -1
- package/dist/harness/n8n.d.ts +13 -14
- package/dist/harness/n8n.d.ts.map +1 -1
- package/dist/harness/n8n.js +21 -181
- 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.js +2 -2
- 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 +15 -30
- 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 +30 -24
- 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 +23 -39
- 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/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 +6 -1
- package/dist/harness/windsurf.d.ts.map +1 -1
- package/dist/harness/windsurf.js +21 -24
- package/dist/harness/windsurf.js.map +1 -1
- package/dist/harness/xirp.d.ts +1 -2
- package/dist/harness/xirp.d.ts.map +1 -1
- package/dist/harness/xirp.js +2 -3
- 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/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 +1 -2
- package/dist/lib/onboarding.js.map +1 -1
- package/dist/lib/policySnapshot.d.ts +3 -2
- package/dist/lib/policySnapshot.d.ts.map +1 -1
- package/dist/lib/policySnapshot.js +6 -3
- 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 -24
- package/dist/harness/base.d.ts.map +0 -1
- package/dist/harness/base.js +0 -74
- package/dist/harness/base.js.map +0 -1
package/dist/harness/types.js
CHANGED
|
@@ -5,101 +5,7 @@
|
|
|
5
5
|
* config to its native config file, and read the current file hash.
|
|
6
6
|
*
|
|
7
7
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
-
* LLD #8 — Sync Daemon / CLI
|
|
9
8
|
* @module
|
|
10
9
|
*/
|
|
11
|
-
|
|
12
|
-
export const HARNESS_CONFIG_FILES = {
|
|
13
|
-
'cursor': '.cursorrules',
|
|
14
|
-
'claude-code': 'CLAUDE.md',
|
|
15
|
-
'antigravity': '.gemini/settings.json',
|
|
16
|
-
'windsurf': '.windsurfrules',
|
|
17
|
-
'aider': '.aider.conf.yml',
|
|
18
|
-
'openhands': 'config.toml',
|
|
19
|
-
'codex': '.env.intutic',
|
|
20
|
-
'n8n': '', // Phase 2 — TD-037: API call, not file write
|
|
21
|
-
'openclaw': '.openclaw/openclaw.json',
|
|
22
|
-
'hermes': '.hermes/config.yaml',
|
|
23
|
-
'pi': '.pi/hooks.json',
|
|
24
|
-
'github-copilot': '.github/copilot-instructions.md',
|
|
25
|
-
'cline': '',
|
|
26
|
-
'roo-code': '',
|
|
27
|
-
'continue': '',
|
|
28
|
-
'claude-desktop': '',
|
|
29
|
-
'goose': '',
|
|
30
|
-
'open-webui': '',
|
|
31
|
-
'langgraph': '.env.intutic',
|
|
32
|
-
// Muse Code reads AGENTS.md (falling back to CLAUDE.md) — see muse.ts.
|
|
33
|
-
'muse-code': 'AGENTS.md',
|
|
34
|
-
// AGENTS.md is Grok Build's native rules file — the same cross-tool
|
|
35
|
-
// convention Codex/Amp read. Delivered via the generic markdown formatter
|
|
36
|
-
// (`buildMarkdownContent`) every `---`-separated rules
|
|
37
|
-
// file in this codebase already shares (Cursor, Claude Code, Windsurf,
|
|
38
|
-
// GitHub Copilot) — not a bespoke format.
|
|
39
|
-
'grok': 'AGENTS.md',
|
|
40
|
-
// OpenCode reads AGENTS.md (CLAUDE.md fallback) — see opencode.ts. The gate
|
|
41
|
-
// is the plugin `openCodeHooks.ts` generates, not this file.
|
|
42
|
-
'opencode': 'AGENTS.md',
|
|
43
|
-
// dsh has no workspace-relative rules file in the research this phase could
|
|
44
|
-
// verify — its config lives entirely under $DSH_HOME (profiles/*/cordis.patch.yml,
|
|
45
|
-
// settings.yaml), not the project workspace. Empty, matching goose/cline/
|
|
46
|
-
// continue/claude-desktop/open-webui's precedent for "no single canonical
|
|
47
|
-
// file" harnesses; dsh.ts's own adapter resolves its real paths directly.
|
|
48
|
-
'dsh': '',
|
|
49
|
-
// Xirp writes no config of its own — see xirp.ts's module doc. It
|
|
50
|
-
// orchestrates other already-gated harnesses (Claude Code, Codex,
|
|
51
|
-
// Antigravity/Gemini CLI), whose own adapters do the real writing.
|
|
52
|
-
'xirp': '',
|
|
53
|
-
// Agentic Orchestrator writes no config of its own — see
|
|
54
|
-
// agenticOrchestrator.ts's module doc. It orchestrates other CLI backends
|
|
55
|
-
// (Claude Code, Codex, OpenCode), whose own adapters do the real writing.
|
|
56
|
-
'agentic-orchestrator': '',
|
|
57
|
-
// Wave 1 SDK-gated frameworks — same rationale as langgraph above: no
|
|
58
|
-
// on-disk hook/config file exists to gate tool calls, so each of these
|
|
59
|
-
// writes .env.intutic (proxy base-URL vars + an SDK-gate pointer comment).
|
|
60
|
-
'langchain': '.env.intutic',
|
|
61
|
-
'crewai': '.env.intutic',
|
|
62
|
-
'autogen': '.env.intutic',
|
|
63
|
-
'ag2': '.env.intutic',
|
|
64
|
-
'google-adk': '.env.intutic',
|
|
65
|
-
'openai-agents': '.env.intutic',
|
|
66
|
-
'pydantic-ai': '.env.intutic',
|
|
67
|
-
'smolagents': '.env.intutic',
|
|
68
|
-
// A4: AWS Strands Agents — same Python SDK-gated rationale as the Wave 1
|
|
69
|
-
// family above (gate ships in intutic_clawde.gate.adapters.strands).
|
|
70
|
-
'strands': '.env.intutic',
|
|
71
|
-
// TD-375: Microsoft Agent Framework — same Python SDK-gated rationale
|
|
72
|
-
// (gate ships in intutic_clawde.gate.adapters.agent_framework).
|
|
73
|
-
'agent-framework': '.env.intutic',
|
|
74
|
-
// T2: JS/TS SDK-gated frameworks — same rationale as the Wave 1 Python
|
|
75
|
-
// family above, but the blocking gate ships in @intutic/gate
|
|
76
|
-
// (packages/gate-js) rather than intutic-clawde.
|
|
77
|
-
'mastra': '.env.intutic',
|
|
78
|
-
'vercel-ai-sdk': '.env.intutic',
|
|
79
|
-
// eve (Vercel, PREVIEW) — same JS/TS SDK-gated family; detection is a
|
|
80
|
-
// compound `eve` dep + `agent/` directory check — see eve.ts.
|
|
81
|
-
'eve': '.env.intutic',
|
|
82
|
-
// TrueForge (embedded-library mode only — see trueforge.ts's module doc
|
|
83
|
-
// and the HarnessType.TRUEFORGE doc comment); same JS/TS SDK-gated family.
|
|
84
|
-
'trueforge': '.env.intutic',
|
|
85
|
-
// A3: Vercel platform-agent runtimes — same @intutic/gate family. Note the
|
|
86
|
-
// env vars are weaker still for ai-sdk-harness (tool execution is
|
|
87
|
-
// server-side in Vercel Sandbox microVMs; see aiSdkHarness.ts's module doc
|
|
88
|
-
// and the envPreamble override it carries).
|
|
89
|
-
'ai-sdk-harness': '.env.intutic',
|
|
90
|
-
'ai-sdk-workflow': '.env.intutic',
|
|
91
|
-
// B2: AWS Bedrock AgentCore Runtime — hosts the customer's own framework
|
|
92
|
-
// code unchanged; the actual tool-call gate belongs to whichever
|
|
93
|
-
// already-supported framework adapter that code uses (Strands, LangGraph,
|
|
94
|
-
// ...), same 'delegated'/no-file-of-its-own shape as xirp/
|
|
95
|
-
// agentic-orchestrator above. See agentcore.ts's module doc.
|
|
96
|
-
'agentcore-runtime': '',
|
|
97
|
-
// B3: TrueForge, standalone/hosted server (see the HarnessType.TRUEFORGE_SERVER
|
|
98
|
-
// doc comment) — no CLI adapter exists for this row at all: it is an
|
|
99
|
-
// operator-configured deployment, not a package.json dependency of
|
|
100
|
-
// whatever repo `intutic init` runs against, so there is nothing for this
|
|
101
|
-
// detector to find and no config file to write. Governed entirely by
|
|
102
|
-
// services/trueforge-bridge instead (GateKind: 'bridge').
|
|
103
|
-
'trueforge-server': '',
|
|
104
|
-
};
|
|
10
|
+
export {};
|
|
105
11
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -1,7 +1,12 @@
|
|
|
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
12
|
* HTTP proxy settings into Windsurf's user settings.json, and switches
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windsurf.d.ts","sourceRoot":"","sources":["../../src/harness/windsurf.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"windsurf.d.ts","sourceRoot":"","sources":["../../src/harness/windsurf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AASjD,eAAO,MAAM,eAAe,EAAE,eA4B7B,CAAA"}
|
package/dist/harness/windsurf.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
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
12
|
* HTTP proxy settings into Windsurf's user settings.json, and switches
|
|
@@ -14,19 +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
|
-
const CONFIG_FILE = '.
|
|
25
|
+
import { ownRulesFileHash, retireLegacyRulesFile, writeOwnRulesFile } from './rulesFiles.js';
|
|
26
|
+
const CONFIG_FILE = '.windsurf/rules/intutic-governance.md';
|
|
27
|
+
const LEGACY_FILE = '.windsurfrules';
|
|
24
28
|
const WINDSURF_USER_DIR = join(homedir(), '.codeium', 'windsurf');
|
|
25
29
|
export const windsurfAdapter = {
|
|
26
30
|
type: HarnessType.WINDSURF,
|
|
27
31
|
configFileName: CONFIG_FILE,
|
|
28
32
|
async detect(workspaceRoot) {
|
|
29
|
-
for (const marker of [
|
|
33
|
+
for (const marker of [LEGACY_FILE, '.windsurf']) {
|
|
30
34
|
try {
|
|
31
35
|
await access(join(workspaceRoot, marker));
|
|
32
36
|
return true;
|
|
@@ -41,27 +45,20 @@ export const windsurfAdapter = {
|
|
|
41
45
|
return false;
|
|
42
46
|
}
|
|
43
47
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
await writeOwnedFile(filePath, workspaceRoot, content);
|
|
49
|
-
// 2. Write Cascade hooks.json at user + workspace level, configure TLS MITM
|
|
50
|
-
// proxy. The proxy serves HTTP CONNECT on the same listener as its API,
|
|
51
|
-
// so the port is the one `intutic connect` runs it on (PORT, 4000 by
|
|
52
|
-
// 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) {
|
|
53
52
|
const proxyPort = parseInt(process.env.PORT || '4000', 10);
|
|
54
53
|
const creds = await loadCredentials();
|
|
55
54
|
await writeWindsurfHooks(workspaceRoot, proxyUrl, proxyPort, creds?.workspaceId || 'local');
|
|
56
|
-
return filePath;
|
|
57
55
|
},
|
|
58
|
-
async
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
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);
|
|
65
62
|
},
|
|
66
63
|
};
|
|
67
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,k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E,KAAK,EAAE,WAAW,IAAI,OAAO,CAAC,CAAA;IAC7F,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,aAAqB,EAAE,IAAoB,EAAE,QAAgB;QAC7E,MAAM,qBAAqB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QACvD,OAAO,iBAAiB,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
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
* download available in this environment, so none of the detection paths
|
|
31
31
|
* below were live-verified against a real install — they follow this
|
|
32
32
|
* codebase's own convention for comparable tools (`~/.grok`, `~/.muse`,
|
|
33
|
-
* `<Name>.app` in `/Applications`) rather than a confirmed Xirp source.
|
|
34
|
-
* TD-390.
|
|
33
|
+
* `<Name>.app` in `/Applications`) rather than a confirmed Xirp source.
|
|
35
34
|
*
|
|
36
35
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
37
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
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
* download available in this environment, so none of the detection paths
|
|
31
31
|
* below were live-verified against a real install — they follow this
|
|
32
32
|
* codebase's own convention for comparable tools (`~/.grok`, `~/.muse`,
|
|
33
|
-
* `<Name>.app` in `/Applications`) rather than a confirmed Xirp source.
|
|
34
|
-
* TD-390.
|
|
33
|
+
* `<Name>.app` in `/Applications`) rather than a confirmed Xirp source.
|
|
35
34
|
*
|
|
36
35
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
37
36
|
* @module
|
|
@@ -47,7 +46,7 @@ const XIRP_APP_PATH = '/Applications/Xirp.app';
|
|
|
47
46
|
export const xirpAdapter = {
|
|
48
47
|
type: HarnessType.XIRP,
|
|
49
48
|
// No config file of its own — see module doc. Matches the goose/cline-
|
|
50
|
-
// style convention of an empty
|
|
49
|
+
// style convention of an empty HARNESS_FILES entry for a harness
|
|
51
50
|
// whose governance-relevant writes are not a single named file (in Xirp's
|
|
52
51
|
// case: no writes of its own at all).
|
|
53
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,IAA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|
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,G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AC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,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,U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OAAO,OAAO,CAAI,OAAO,EAAE,IAAI,EAAE,IAAI,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,M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E,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,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
|