@intutic/cli 2.2.0 → 2.4.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 +582 -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/budgetLimits.d.ts +70 -0
- package/dist/commands/budgetLimits.d.ts.map +1 -0
- package/dist/commands/budgetLimits.js +223 -0
- package/dist/commands/budgetLimits.js.map +1 -0
- 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 +6 -2
- package/dist/commands/credentials.d.ts.map +1 -1
- package/dist/commands/credentials.js +99 -10
- package/dist/commands/credentials.js.map +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/incidents.d.ts +32 -0
- package/dist/commands/incidents.d.ts.map +1 -0
- package/dist/commands/incidents.js +94 -0
- package/dist/commands/incidents.js.map +1 -0
- 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 +44 -0
- package/dist/commands/settings.d.ts.map +1 -0
- package/dist/commands/settings.js +110 -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 +3 -3
- package/dist/lib/providerProbe.d.ts.map +1 -1
- package/dist/lib/providerProbe.js +15 -7
- package/dist/lib/providerProbe.js.map +1 -1
- 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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rulesFiles.ts — the two ways a rule set reaches a harness's instructions.
|
|
3
|
+
*
|
|
4
|
+
* Which file each harness reads is `HARNESS_RULES_FILES` in
|
|
5
|
+
* `@intutic/shared-types`, with the product documentation that says so. The
|
|
6
|
+
* adapters write through these helpers, and `rulesFiles.test.ts` checks every
|
|
7
|
+
* adapter writes where the map says and nowhere else.
|
|
8
|
+
*
|
|
9
|
+
* - {@link writeRulesSectionFile}: a file the user also writes (`CLAUDE.md`,
|
|
10
|
+
* `AGENTS.md`, `GEMINI.md`, `.goosehints`, ...). The rule sets go between
|
|
11
|
+
* the INTUTIC:RULES markers and the rest of the file is the user's.
|
|
12
|
+
* - {@link writeOwnRulesFile}: a file of Intutic's own in a directory the
|
|
13
|
+
* product reads every file of (`.cursor/rules/`, `.continue/rules/`, ...).
|
|
14
|
+
*
|
|
15
|
+
* Neither carries a sync time: the same rule sets give the same bytes, so a
|
|
16
|
+
* sync with nothing new leaves the file alone.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
import type { SyncSopEntry } from '@intutic/shared-types';
|
|
21
|
+
/**
|
|
22
|
+
* One markdown section per SOP. Each SOP the control plane synced ends with
|
|
23
|
+
* its `sop://` pointer comment, which maps the rules in the file back to the
|
|
24
|
+
* SOP that produced them.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildSopSections(sops: SyncSopEntry[]): string;
|
|
27
|
+
/**
|
|
28
|
+
* The rule sets as markdown: the generated header (which `intutic disconnect`
|
|
29
|
+
* recognises), the proxy URL, one section per SOP.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildRulesBody(sops: SyncSopEntry[], proxyUrl: string, shape: 'section' | 'file'): string;
|
|
32
|
+
/**
|
|
33
|
+
* Writes the rule sets as the marked section of `relPath`. Nothing is written
|
|
34
|
+
* without a rule set. Returns the absolute path, or null.
|
|
35
|
+
*/
|
|
36
|
+
export declare function writeRulesSectionFile(workspaceRoot: string, relPath: string, sops: SyncSopEntry[], proxyUrl: string): Promise<string | null>;
|
|
37
|
+
/** The section's hash: the user's own edits elsewhere in the file are not drift. */
|
|
38
|
+
export declare function rulesSectionHash(workspaceRoot: string, relPath: string): Promise<string | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Writes the rule sets as Intutic's own file `relPath`, after `frontMatter`
|
|
41
|
+
* (the product's own keys, e.g. `alwaysApply: true`) when given. Nothing is
|
|
42
|
+
* written without a rule set. Returns the absolute path, or null.
|
|
43
|
+
*/
|
|
44
|
+
export declare function writeOwnRulesFile(workspaceRoot: string, relPath: string, sops: SyncSopEntry[], proxyUrl: string, frontMatter?: string): Promise<string | null>;
|
|
45
|
+
/** The hash of a whole file Intutic owns; null when it does not exist. */
|
|
46
|
+
export declare function ownRulesFileHash(workspaceRoot: string, relPath: string): Promise<string | null>;
|
|
47
|
+
/**
|
|
48
|
+
* Takes back the whole rules file earlier versions wrote at `relPath`, a path
|
|
49
|
+
* the product has stopped reading or reads only as a legacy fallback: the
|
|
50
|
+
* user's original comes back, or the file goes when Intutic created it.
|
|
51
|
+
*/
|
|
52
|
+
export declare function retireLegacyRulesFile(workspaceRoot: string, relPath: string): Promise<void>;
|
|
53
|
+
//# sourceMappingURL=rulesFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rulesFiles.d.ts","sourceRoot":"","sources":["../../src/harness/rulesFiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIzD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,CAI7D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAWxG;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,YAAY,EAAE,EACpB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAKxB;AAED,oFAAoF;AACpF,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASrG;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,YAAY,EAAE,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED,0EAA0E;AAC1E,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMrG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3F"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rulesFiles.ts — the two ways a rule set reaches a harness's instructions.
|
|
3
|
+
*
|
|
4
|
+
* Which file each harness reads is `HARNESS_RULES_FILES` in
|
|
5
|
+
* `@intutic/shared-types`, with the product documentation that says so. The
|
|
6
|
+
* adapters write through these helpers, and `rulesFiles.test.ts` checks every
|
|
7
|
+
* adapter writes where the map says and nowhere else.
|
|
8
|
+
*
|
|
9
|
+
* - {@link writeRulesSectionFile}: a file the user also writes (`CLAUDE.md`,
|
|
10
|
+
* `AGENTS.md`, `GEMINI.md`, `.goosehints`, ...). The rule sets go between
|
|
11
|
+
* the INTUTIC:RULES markers and the rest of the file is the user's.
|
|
12
|
+
* - {@link writeOwnRulesFile}: a file of Intutic's own in a directory the
|
|
13
|
+
* product reads every file of (`.cursor/rules/`, `.continue/rules/`, ...).
|
|
14
|
+
*
|
|
15
|
+
* Neither carries a sync time: the same rule sets give the same bytes, so a
|
|
16
|
+
* sync with nothing new leaves the file alone.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
import { readFile } from 'node:fs/promises';
|
|
22
|
+
import { retireRulesFile, rulesSectionOf, writeOwnedFile, writeRulesSection } from '@intutic/sync-daemon';
|
|
23
|
+
import { hashFile, hashString } from '../lib/hash.js';
|
|
24
|
+
/**
|
|
25
|
+
* One markdown section per SOP. Each SOP the control plane synced ends with
|
|
26
|
+
* its `sop://` pointer comment, which maps the rules in the file back to the
|
|
27
|
+
* SOP that produced them.
|
|
28
|
+
*/
|
|
29
|
+
export function buildSopSections(sops) {
|
|
30
|
+
return sops
|
|
31
|
+
.map((sop) => `## ${sop.title}\n\n${sop.content}${sop.sopRef ? `\n${sop.sopRef}` : ''}`)
|
|
32
|
+
.join('\n\n---\n\n');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The rule sets as markdown: the generated header (which `intutic disconnect`
|
|
36
|
+
* recognises), the proxy URL, one section per SOP.
|
|
37
|
+
*/
|
|
38
|
+
export function buildRulesBody(sops, proxyUrl, shape) {
|
|
39
|
+
return [
|
|
40
|
+
'# Intutic Governance Rules (auto-generated)',
|
|
41
|
+
shape === 'section'
|
|
42
|
+
? '# DO NOT EDIT this section — managed by intutic sync daemon; edit outside the INTUTIC:RULES markers'
|
|
43
|
+
: '# DO NOT EDIT — managed by intutic sync daemon; put rules of your own in another file',
|
|
44
|
+
'',
|
|
45
|
+
`> **Proxy URL:** \`${proxyUrl}\``,
|
|
46
|
+
'',
|
|
47
|
+
buildSopSections(sops),
|
|
48
|
+
].join('\n');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Writes the rule sets as the marked section of `relPath`. Nothing is written
|
|
52
|
+
* without a rule set. Returns the absolute path, or null.
|
|
53
|
+
*/
|
|
54
|
+
export async function writeRulesSectionFile(workspaceRoot, relPath, sops, proxyUrl) {
|
|
55
|
+
if (sops.length === 0)
|
|
56
|
+
return null;
|
|
57
|
+
const filePath = join(workspaceRoot, relPath);
|
|
58
|
+
await writeRulesSection(filePath, workspaceRoot, buildRulesBody(sops, proxyUrl, 'section'));
|
|
59
|
+
return filePath;
|
|
60
|
+
}
|
|
61
|
+
/** The section's hash: the user's own edits elsewhere in the file are not drift. */
|
|
62
|
+
export async function rulesSectionHash(workspaceRoot, relPath) {
|
|
63
|
+
let content;
|
|
64
|
+
try {
|
|
65
|
+
content = await readFile(join(workspaceRoot, relPath), 'utf-8');
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const section = rulesSectionOf(content);
|
|
71
|
+
return section === null ? null : hashString(section);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Writes the rule sets as Intutic's own file `relPath`, after `frontMatter`
|
|
75
|
+
* (the product's own keys, e.g. `alwaysApply: true`) when given. Nothing is
|
|
76
|
+
* written without a rule set. Returns the absolute path, or null.
|
|
77
|
+
*/
|
|
78
|
+
export async function writeOwnRulesFile(workspaceRoot, relPath, sops, proxyUrl, frontMatter) {
|
|
79
|
+
if (sops.length === 0)
|
|
80
|
+
return null;
|
|
81
|
+
const filePath = join(workspaceRoot, relPath);
|
|
82
|
+
const body = `${buildRulesBody(sops, proxyUrl, 'file')}\n`;
|
|
83
|
+
const content = frontMatter ? `---\n${frontMatter.trimEnd()}\n---\n\n${body}` : body;
|
|
84
|
+
// Unchanged rule sets leave the file, and its modification time, alone.
|
|
85
|
+
if ((await readFile(filePath, 'utf-8').catch(() => null)) !== content)
|
|
86
|
+
await writeOwnedFile(filePath, workspaceRoot, content);
|
|
87
|
+
return filePath;
|
|
88
|
+
}
|
|
89
|
+
/** The hash of a whole file Intutic owns; null when it does not exist. */
|
|
90
|
+
export async function ownRulesFileHash(workspaceRoot, relPath) {
|
|
91
|
+
try {
|
|
92
|
+
return await hashFile(join(workspaceRoot, relPath));
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Takes back the whole rules file earlier versions wrote at `relPath`, a path
|
|
100
|
+
* the product has stopped reading or reads only as a legacy fallback: the
|
|
101
|
+
* user's original comes back, or the file goes when Intutic created it.
|
|
102
|
+
*/
|
|
103
|
+
export function retireLegacyRulesFile(workspaceRoot, relPath) {
|
|
104
|
+
return retireRulesFile(join(workspaceRoot, relPath), workspaceRoot);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=rulesFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rulesFiles.js","sourceRoot":"","sources":["../../src/harness/rulesFiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACzG,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAErD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAoB;IACnD,OAAO,IAAI;SACR,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,KAAK,OAAO,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;SACvF,IAAI,CAAC,aAAa,CAAC,CAAA;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAoB,EAAE,QAAgB,EAAE,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AAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IAC7C,MAAM,IAAI,GAAG,GAAG,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAA;IAC1D,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,WAAW,CAAC,OAAO,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IACpF,wEAAwE;IACxE,IAAI,CAAC,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,OAAO;QAAE,MAAM,cAAc,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAA;IAC7H,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,aAAqB,EAAE,OAAe;IAC3E,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAA;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,aAAqB,EAAE,OAAe;IAC1E,OAAO,eAAe,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAA;AACrE,CAAC"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* tool calls at all; its choke point is the generated Python CODE STRING,
|
|
13
13
|
* gated by `intutic_clawde.gate.adapters.smolagents.IntuticPythonExecutor`
|
|
14
14
|
* (wraps any `PythonExecutor`) — verified live against smolagents==1.26.0 by
|
|
15
|
-
* driving a real `CodeAgent.run()` end to end. See that module's doc
|
|
16
|
-
*
|
|
15
|
+
* driving a real `CodeAgent.run()` end to end. See that module's doc for
|
|
16
|
+
* what governing code TEXT does and does not cover.
|
|
17
17
|
*
|
|
18
18
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
19
19
|
* @module
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* tool calls at all; its choke point is the generated Python CODE STRING,
|
|
13
13
|
* gated by `intutic_clawde.gate.adapters.smolagents.IntuticPythonExecutor`
|
|
14
14
|
* (wraps any `PythonExecutor`) — verified live against smolagents==1.26.0 by
|
|
15
|
-
* driving a real `CodeAgent.run()` end to end. See that module's doc
|
|
16
|
-
*
|
|
15
|
+
* driving a real `CodeAgent.run()` end to end. See that module's doc for
|
|
16
|
+
* what governing code TEXT does and does not cover.
|
|
17
17
|
*
|
|
18
18
|
* HLD §3.14 — Harness Onboarding Matrix
|
|
19
19
|
* @module
|
|
@@ -27,7 +27,7 @@ export const smolagentsAdapter = makeSdkGatedAdapter({
|
|
|
27
27
|
pipInstall: 'intutic-clawde[smolagents]',
|
|
28
28
|
importLine: 'from intutic_clawde.gate.adapters.smolagents import IntuticPythonExecutor',
|
|
29
29
|
usageSummary: 'IntuticPythonExecutor gates CodeAgent\'s generated code text before running it; ' +
|
|
30
|
-
'ToolCallingAgent tools are covered by @guard/guard_tools instead
|
|
30
|
+
'ToolCallingAgent tools are covered by @guard/guard_tools instead.',
|
|
31
31
|
docsSlug: 'smolagents',
|
|
32
32
|
});
|
|
33
33
|
//# sourceMappingURL=smolagents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smolagents.js","sourceRoot":"","sources":["../../src/harness/smolagents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IACnD,IAAI,EAAE,WAAW,CAAC,UAAU;IAC5B,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,UAAU,EAAE,4BAA4B;IACxC,UAAU,EAAE,2EAA2E;IACvF,YAAY,EACV,kFAAkF;QAClF,
|
|
1
|
+
{"version":3,"file":"smolagents.js","sourceRoot":"","sources":["../../src/harness/smolagents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IACnD,IAAI,EAAE,WAAW,CAAC,UAAU;IAC5B,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,UAAU,EAAE,4BAA4B;IACxC,UAAU,EAAE,2EAA2E;IACvF,YAAY,EACV,kFAAkF;QAClF,mEAAmE;IACrE,QAAQ,EAAE,YAAY;CACvB,CAAC,CAAA"}
|
package/dist/harness/types.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
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
10
|
import type { HarnessType, SyncSopEntry } from '@intutic/shared-types';
|
|
@@ -13,18 +12,33 @@ import type { HarnessType, SyncSopEntry } from '@intutic/shared-types';
|
|
|
13
12
|
export interface IHarnessAdapter {
|
|
14
13
|
/** Harness type identifier. */
|
|
15
14
|
readonly type: HarnessType;
|
|
16
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The file drift is tracked on, relative to the workspace root: the
|
|
17
|
+
* harness's rules file when it has one in the workspace (`rulesFileOf` in
|
|
18
|
+
* `@intutic/shared-types`), else the workspace file the adapter writes; ''
|
|
19
|
+
* for none.
|
|
20
|
+
*/
|
|
17
21
|
readonly configFileName: string;
|
|
18
22
|
/** Detect whether this harness is present in the workspace. */
|
|
19
23
|
detect(workspaceRoot: string): Promise<boolean>;
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
25
|
+
* Install what governs this harness whatever rule sets the workspace has:
|
|
26
|
+
* its tool-call gate, and the proxy routing that rides with it. The gate
|
|
27
|
+
* enforces the built-in protections, the destructive-command tier, group
|
|
28
|
+
* rules and holds, none of which need a rule set, so `intutic connect` runs
|
|
29
|
+
* this for every configured harness. Absent when the harness has no gate
|
|
30
|
+
* Intutic installs.
|
|
31
|
+
*/
|
|
32
|
+
installGate?(workspaceRoot: string, proxyUrl: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Write the rule sets into the file the harness reads as standing
|
|
35
|
+
* instructions — the one `HARNESS_RULES_FILES` names, and no other.
|
|
36
|
+
* `intutic connect` calls it only when a rule set targets the harness, or
|
|
37
|
+
* on a forced sync. Returns the absolute path written, or null if nothing
|
|
38
|
+
* was.
|
|
23
39
|
*/
|
|
24
40
|
writeConfig(workspaceRoot: string, sops: SyncSopEntry[], proxyUrl: string): Promise<string | null>;
|
|
25
41
|
/** Read SHA-256 hash of current config file content. Returns null if file doesn't exist. */
|
|
26
42
|
readCurrentHash(workspaceRoot: string): Promise<string | null>;
|
|
27
43
|
}
|
|
28
|
-
/** Harness config file mapping for file-based harnesses. */
|
|
29
|
-
export declare const HARNESS_CONFIG_FILES: Record<HarnessType, string>;
|
|
30
44
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEtE,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,+DAA+D;IAC/D,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/C;;;;;;;OAOG;IACH,WAAW,CAAC,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpE;;;;;;OAMG;IACH,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAClG,4FAA4F;IAC5F,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CAC/D"}
|
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,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAGvE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACp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AqB,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,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;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,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