@intutic/sync-daemon 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 +1 -1
- package/dist/agentReporter.d.ts +23 -11
- package/dist/agentReporter.d.ts.map +1 -1
- package/dist/agentReporter.js +20 -13
- package/dist/agentReporter.js.map +1 -1
- package/dist/configReader.d.ts +1 -3
- package/dist/configReader.d.ts.map +1 -1
- package/dist/configReader.js +0 -2
- package/dist/configReader.js.map +1 -1
- package/dist/configWriter.d.ts +11 -12
- package/dist/configWriter.d.ts.map +1 -1
- package/dist/configWriter.js +35 -58
- package/dist/configWriter.js.map +1 -1
- package/dist/disconnect/harnesses.d.ts +0 -2
- package/dist/disconnect/harnesses.d.ts.map +1 -1
- package/dist/disconnect/harnesses.js +157 -80
- package/dist/disconnect/harnesses.js.map +1 -1
- package/dist/disconnect/index.d.ts.map +1 -1
- package/dist/disconnect/index.js +11 -1
- package/dist/disconnect/index.js.map +1 -1
- package/dist/disconnect/mcp.d.ts +21 -0
- package/dist/disconnect/mcp.d.ts.map +1 -1
- package/dist/disconnect/mcp.js +71 -0
- package/dist/disconnect/mcp.js.map +1 -1
- package/dist/disconnect/recognise.d.ts +2 -2
- package/dist/disconnect/recognise.d.ts.map +1 -1
- package/dist/disconnect/recognise.js +15 -5
- package/dist/disconnect/recognise.js.map +1 -1
- package/dist/harness/aiderConfigMerger.d.ts +28 -8
- package/dist/harness/aiderConfigMerger.d.ts.map +1 -1
- package/dist/harness/aiderConfigMerger.js +59 -11
- package/dist/harness/aiderConfigMerger.js.map +1 -1
- package/dist/harness/antigravityCliHooks.d.ts +61 -0
- package/dist/harness/antigravityCliHooks.d.ts.map +1 -0
- package/dist/harness/antigravityCliHooks.js +207 -0
- package/dist/harness/antigravityCliHooks.js.map +1 -0
- package/dist/harness/antigravityHooks.d.ts +12 -2
- package/dist/harness/antigravityHooks.d.ts.map +1 -1
- package/dist/harness/antigravityHooks.js +36 -16
- package/dist/harness/antigravityHooks.js.map +1 -1
- package/dist/harness/antigravityProducts.d.ts +40 -0
- package/dist/harness/antigravityProducts.d.ts.map +1 -0
- package/dist/harness/antigravityProducts.js +109 -0
- package/dist/harness/antigravityProducts.js.map +1 -0
- package/dist/harness/claudeAgentsMd.d.ts +29 -0
- package/dist/harness/claudeAgentsMd.d.ts.map +1 -0
- package/dist/harness/claudeAgentsMd.js +80 -0
- package/dist/harness/claudeAgentsMd.js.map +1 -0
- package/dist/harness/claudeCodeHooks.d.ts +6 -5
- package/dist/harness/claudeCodeHooks.d.ts.map +1 -1
- package/dist/harness/claudeCodeHooks.js +98 -24
- package/dist/harness/claudeCodeHooks.js.map +1 -1
- package/dist/harness/clineHooks.d.ts +0 -1
- package/dist/harness/clineHooks.d.ts.map +1 -1
- package/dist/harness/clineHooks.js +10 -4
- package/dist/harness/clineHooks.js.map +1 -1
- package/dist/harness/codexHooks.d.ts +2 -0
- package/dist/harness/codexHooks.d.ts.map +1 -1
- package/dist/harness/codexHooks.js +12 -4
- package/dist/harness/codexHooks.js.map +1 -1
- package/dist/harness/cursorHooks.d.ts +5 -2
- package/dist/harness/cursorHooks.d.ts.map +1 -1
- package/dist/harness/cursorHooks.js +9 -3
- package/dist/harness/cursorHooks.js.map +1 -1
- package/dist/harness/dshHooks.d.ts +5 -5
- package/dist/harness/dshHooks.d.ts.map +1 -1
- package/dist/harness/dshHooks.js +5 -5
- package/dist/harness/gateArtifacts.d.ts +35 -0
- package/dist/harness/gateArtifacts.d.ts.map +1 -0
- package/dist/harness/gateArtifacts.js +88 -0
- package/dist/harness/gateArtifacts.js.map +1 -0
- package/dist/harness/gateBody.d.ts +186 -69
- package/dist/harness/gateBody.d.ts.map +1 -1
- package/dist/harness/gateBody.js +820 -182
- package/dist/harness/gateBody.js.map +1 -1
- package/dist/harness/gateSightings.d.ts +47 -0
- package/dist/harness/gateSightings.d.ts.map +1 -0
- package/dist/harness/gateSightings.js +159 -0
- package/dist/harness/gateSightings.js.map +1 -0
- package/dist/harness/githubCopilotHooks.d.ts.map +1 -1
- package/dist/harness/githubCopilotHooks.js +7 -1
- package/dist/harness/githubCopilotHooks.js.map +1 -1
- package/dist/harness/gooseHardener.d.ts +0 -1
- package/dist/harness/gooseHardener.d.ts.map +1 -1
- package/dist/harness/gooseHardener.js +1 -1
- package/dist/harness/gooseHardener.js.map +1 -1
- package/dist/harness/gooseHooks.d.ts +14 -1
- package/dist/harness/gooseHooks.d.ts.map +1 -1
- package/dist/harness/gooseHooks.js +55 -29
- package/dist/harness/gooseHooks.js.map +1 -1
- package/dist/harness/grokHooks.d.ts +2 -2
- package/dist/harness/grokHooks.d.ts.map +1 -1
- package/dist/harness/grokHooks.js +11 -6
- package/dist/harness/grokHooks.js.map +1 -1
- package/dist/harness/hermesHooks.d.ts +18 -8
- package/dist/harness/hermesHooks.d.ts.map +1 -1
- package/dist/harness/hermesHooks.js +48 -17
- package/dist/harness/hermesHooks.js.map +1 -1
- package/dist/harness/mcpAutoWrite.d.ts +24 -9
- package/dist/harness/mcpAutoWrite.d.ts.map +1 -1
- package/dist/harness/mcpAutoWrite.js +218 -25
- package/dist/harness/mcpAutoWrite.js.map +1 -1
- package/dist/harness/museHooks.d.ts +3 -3
- package/dist/harness/museHooks.d.ts.map +1 -1
- package/dist/harness/museHooks.js +9 -5
- package/dist/harness/museHooks.js.map +1 -1
- package/dist/harness/n8nHooks.d.ts +0 -1
- package/dist/harness/n8nHooks.d.ts.map +1 -1
- package/dist/harness/n8nHooks.js +4 -1
- package/dist/harness/n8nHooks.js.map +1 -1
- package/dist/harness/openCodeHooks.d.ts +2 -2
- package/dist/harness/openCodeHooks.d.ts.map +1 -1
- package/dist/harness/openCodeHooks.js +7 -3
- package/dist/harness/openCodeHooks.js.map +1 -1
- package/dist/harness/openWebuiHooks.d.ts +0 -1
- package/dist/harness/openWebuiHooks.d.ts.map +1 -1
- package/dist/harness/openWebuiHooks.js +5 -1
- package/dist/harness/openWebuiHooks.js.map +1 -1
- package/dist/harness/openclawHooks.d.ts +70 -18
- package/dist/harness/openclawHooks.d.ts.map +1 -1
- package/dist/harness/openclawHooks.js +213 -161
- package/dist/harness/openclawHooks.js.map +1 -1
- package/dist/harness/openhandsHooks.d.ts +24 -10
- package/dist/harness/openhandsHooks.d.ts.map +1 -1
- package/dist/harness/openhandsHooks.js +49 -48
- package/dist/harness/openhandsHooks.js.map +1 -1
- package/dist/harness/piHooks.d.ts +52 -17
- package/dist/harness/piHooks.d.ts.map +1 -1
- package/dist/harness/piHooks.js +177 -166
- package/dist/harness/piHooks.js.map +1 -1
- package/dist/harness/protectedPaths.d.ts +107 -25
- package/dist/harness/protectedPaths.d.ts.map +1 -1
- package/dist/harness/protectedPaths.js +342 -48
- package/dist/harness/protectedPaths.js.map +1 -1
- package/dist/harness/rulesSection.d.ts +62 -0
- package/dist/harness/rulesSection.d.ts.map +1 -0
- package/dist/harness/rulesSection.js +145 -0
- package/dist/harness/rulesSection.js.map +1 -0
- package/dist/harness/windsurfHooks.d.ts +0 -1
- package/dist/harness/windsurfHooks.d.ts.map +1 -1
- package/dist/harness/windsurfHooks.js +4 -1
- package/dist/harness/windsurfHooks.js.map +1 -1
- package/dist/index.d.ts +12 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/inventory.d.ts +53 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +133 -0
- package/dist/inventory.js.map +1 -0
- package/dist/lib/complianceProbes.d.ts +2 -1
- package/dist/lib/complianceProbes.d.ts.map +1 -1
- package/dist/lib/complianceProbes.js +1 -1
- package/dist/lib/complianceProbes.js.map +1 -1
- package/dist/lib/decisionsDigest.d.ts +34 -16
- package/dist/lib/decisionsDigest.d.ts.map +1 -1
- package/dist/lib/decisionsDigest.js +105 -46
- package/dist/lib/decisionsDigest.js.map +1 -1
- package/dist/lib/egressPolicy.d.ts +2 -2
- package/dist/lib/egressPolicy.js +2 -2
- package/dist/lib/mcpRegistryPy.d.ts +11 -0
- package/dist/lib/mcpRegistryPy.d.ts.map +1 -0
- package/dist/lib/mcpRegistryPy.js +173 -0
- package/dist/lib/mcpRegistryPy.js.map +1 -0
- package/dist/lib/phrasesPy.d.ts +11 -0
- package/dist/lib/phrasesPy.d.ts.map +1 -0
- package/dist/lib/phrasesPy.js +351 -0
- package/dist/lib/phrasesPy.js.map +1 -0
- package/dist/lib/policySnapshot.d.ts +46 -10
- package/dist/lib/policySnapshot.d.ts.map +1 -1
- package/dist/lib/policySnapshot.js +136 -47
- package/dist/lib/policySnapshot.js.map +1 -1
- package/dist/lib/processPoller.d.ts.map +1 -1
- package/dist/lib/processPoller.js +9 -2
- package/dist/lib/processPoller.js.map +1 -1
- package/dist/lib/regexLinearity.d.ts +43 -0
- package/dist/lib/regexLinearity.d.ts.map +1 -0
- package/dist/lib/regexLinearity.js +275 -0
- package/dist/lib/regexLinearity.js.map +1 -0
- package/dist/lib/runtimeEnv.d.ts +1 -3
- package/dist/lib/runtimeEnv.d.ts.map +1 -1
- package/dist/lib/runtimeEnv.js +0 -2
- package/dist/lib/runtimeEnv.js.map +1 -1
- package/dist/lib/sequencePy.d.ts +10 -0
- package/dist/lib/sequencePy.d.ts.map +1 -0
- package/dist/lib/sequencePy.js +102 -0
- package/dist/lib/sequencePy.js.map +1 -0
- package/dist/sessionReporter.d.ts +17 -11
- package/dist/sessionReporter.d.ts.map +1 -1
- package/dist/sessionReporter.js +36 -23
- package/dist/sessionReporter.js.map +1 -1
- package/dist/skillWriter.d.ts +23 -5
- package/dist/skillWriter.d.ts.map +1 -1
- package/dist/skillWriter.js +159 -16
- package/dist/skillWriter.js.map +1 -1
- package/dist/syncCycle.d.ts.map +1 -1
- package/dist/syncCycle.js +21 -9
- package/dist/syncCycle.js.map +1 -1
- package/dist/trajectoryMonitor.d.ts +1 -3
- package/dist/trajectoryMonitor.d.ts.map +1 -1
- package/dist/trajectoryMonitor.js +1 -4
- package/dist/trajectoryMonitor.js.map +1 -1
- package/dist/watcher/driftWatcher.d.ts +0 -1
- package/dist/watcher/driftWatcher.d.ts.map +1 -1
- package/dist/watcher/driftWatcher.js +1 -2
- package/dist/watcher/driftWatcher.js.map +1 -1
- package/dist/watcher/settingsGuard.d.ts +33 -7
- package/dist/watcher/settingsGuard.d.ts.map +1 -1
- package/dist/watcher/settingsGuard.js +373 -61
- package/dist/watcher/settingsGuard.js.map +1 -1
- package/dist/watcher/vscodeHookSettings.d.ts +30 -0
- package/dist/watcher/vscodeHookSettings.d.ts.map +1 -0
- package/dist/watcher/vscodeHookSettings.js +170 -0
- package/dist/watcher/vscodeHookSettings.js.map +1 -0
- package/dist/wsClient.d.ts +0 -1
- package/dist/wsClient.d.ts.map +1 -1
- package/dist/wsClient.js +0 -1
- package/dist/wsClient.js.map +1 -1
- package/package.json +5 -5
- package/dist/harness/claudeDesktopHooks.d.ts +0 -33
- package/dist/harness/claudeDesktopHooks.d.ts.map +0 -1
- package/dist/harness/claudeDesktopHooks.js +0 -256
- package/dist/harness/claudeDesktopHooks.js.map +0 -1
- package/dist/harness/continueHooks.d.ts +0 -63
- package/dist/harness/continueHooks.d.ts.map +0 -1
- package/dist/harness/continueHooks.js +0 -250
- package/dist/harness/continueHooks.js.map +0 -1
- package/dist/harness/gateKind.d.ts +0 -164
- package/dist/harness/gateKind.d.ts.map +0 -1
- package/dist/harness/gateKind.js +0 -144
- package/dist/harness/gateKind.js.map +0 -1
- package/dist/harness/rooCodeHooks.d.ts +0 -31
- package/dist/harness/rooCodeHooks.d.ts.map +0 -1
- package/dist/harness/rooCodeHooks.js +0 -281
- package/dist/harness/rooCodeHooks.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* cursorHooks.ts — Cursor hook injection.
|
|
3
3
|
*
|
|
4
4
|
* Registers the gate in Cursor's hooks.json (schema per cursor.com/docs/agent/
|
|
5
|
-
* hooks: `{version: 1, hooks: {<event>: [{command, matcher?, failClosed?}]}}`)
|
|
5
|
+
* hooks: `{version: 1, hooks: {<event>: [{command, matcher?, timeout?, failClosed?}]}}`)
|
|
6
6
|
* for three events:
|
|
7
7
|
* - `beforeShellExecution` — every shell command;
|
|
8
8
|
* - `beforeMCPExecution` — every MCP tool call;
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* The gate refuses with exit code 2 and allows by printing
|
|
13
13
|
* `{"permission":"allow"}`: with `failClosed: true` Cursor blocks on a hook
|
|
14
14
|
* that crashes, times out or prints nothing, so an allow must be explicit.
|
|
15
|
+
* `timeout` (seconds) is set because Cursor does not state its default, and
|
|
16
|
+
* the gate's deadline is derived from it.
|
|
15
17
|
*
|
|
16
18
|
* Levels: project (`<workspaceRoot>/.cursor/hooks.json`) and user
|
|
17
19
|
* (`~/.cursor/hooks.json`) on every sync; system level
|
|
@@ -19,7 +21,6 @@
|
|
|
19
21
|
* only through `intutic enterprise install`, which needs root. The project and
|
|
20
22
|
* user files are merged — hooks the user registered are kept.
|
|
21
23
|
*
|
|
22
|
-
* LLD #14 — Phase 3 cross-harness defence
|
|
23
24
|
* HLD §3.14 — Three-Tier Defense Cascade
|
|
24
25
|
*
|
|
25
26
|
* @module
|
|
@@ -30,6 +31,7 @@ import * as os from 'node:os';
|
|
|
30
31
|
import { createLogger } from '@intutic/logger';
|
|
31
32
|
import { keepOriginal } from '../disconnect/originals.js';
|
|
32
33
|
import { newIso } from '@intutic/id';
|
|
34
|
+
import { HOOK_TIMEOUT_SECONDS } from '@intutic/shared-types';
|
|
33
35
|
import { emitJsGate, emitJsFailClosedPrelude } from './gateBody.js';
|
|
34
36
|
import { readJsonObjectForMerge } from './jsonMergeTarget.js';
|
|
35
37
|
const log = createLogger('sync-cursor-hooks');
|
|
@@ -66,7 +68,7 @@ export function buildHooksConfig(hookScriptPath) {
|
|
|
66
68
|
version: 1,
|
|
67
69
|
hooks: Object.fromEntries(HOOK_EVENTS.map(({ event, matcher }) => [
|
|
68
70
|
event,
|
|
69
|
-
[{ command: `node "${hookScriptPath}"`, ...(matcher ? { matcher } : {}), failClosed: true }],
|
|
71
|
+
[{ command: `node "${hookScriptPath}"`, ...(matcher ? { matcher } : {}), timeout: HOOK_TIMEOUT_SECONDS, failClosed: true }],
|
|
70
72
|
])),
|
|
71
73
|
};
|
|
72
74
|
}
|
|
@@ -136,6 +138,9 @@ function logEvent(verdict, toolName, reason) {
|
|
|
136
138
|
try {
|
|
137
139
|
const ts = new Date().toISOString();
|
|
138
140
|
const incidentId = crypto.createHash('sha1').update(ts + toolName + _intuticWsId).digest('hex').slice(0, 16);
|
|
141
|
+
// The event's id: random, made once here, and resent with the line it is
|
|
142
|
+
// written into, so the control plane processes the event once.
|
|
143
|
+
const eventId = crypto.randomBytes(16).toString('hex');
|
|
139
144
|
const entry = JSON.stringify({
|
|
140
145
|
// Passed through, not collapsed to two values: the advisory tier emits
|
|
141
146
|
// 'tool_flagged', and a ternary here silently recorded it as an allow.
|
|
@@ -145,6 +150,7 @@ function logEvent(verdict, toolName, reason) {
|
|
|
145
150
|
harnessType: 'cursor',
|
|
146
151
|
timestamp: ts,
|
|
147
152
|
incidentId,
|
|
153
|
+
eventId,
|
|
148
154
|
...(_intuticSessionId ? { sessionId: _intuticSessionId } : {}),
|
|
149
155
|
}) + '\\n';
|
|
150
156
|
fs.appendFileSync(${JSON.stringify(hookEventsLog)}, entry, { flag: 'a' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursorHooks.js","sourceRoot":"","sources":["../../src/harness/cursorHooks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cursorHooks.js","sourceRoot":"","sources":["../../src/harness/cursorHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,iB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,GAAG,QAAQ,GAAG,cAAc,CAAA;IACrC,MAAM,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAA;IACtE,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;AAChC,CAAC"}
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
* included. Node resolves it from the profile directory's own
|
|
55
55
|
* `node_modules` (the "two-anchor" resolution `profile.d.ts` documents
|
|
56
56
|
* for out-of-tree plugins) — which means `@intutic/gate` must actually be
|
|
57
|
-
* installed there; see {@link mergeProfileDependency}
|
|
57
|
+
* installed there; see {@link mergeProfileDependency}
|
|
58
58
|
* for why this writer cannot run `pnpm install` on the user's behalf.
|
|
59
|
-
* - **LLM egress, re-verified against dsh 0.2.0-rc.2 (
|
|
59
|
+
* - **LLM egress, re-verified against dsh 0.2.0-rc.2 (2026-10-03).**
|
|
60
60
|
* 0.2 removed the harness-home `settings.yaml` document this writer used
|
|
61
61
|
* to merge into: `@deepseek-ai/dsh-settings` now imports a leftover
|
|
62
62
|
* `$DSH_HOME/settings.yaml` ONCE into whichever profile boots first
|
|
@@ -118,11 +118,11 @@ export interface DshCoverageGap {
|
|
|
118
118
|
/** Number of EXISTING dsh profiles — see {@link listDshProfileDirs}. */
|
|
119
119
|
profileCount: number;
|
|
120
120
|
/** `dshDetected && profileCount === 0`: dsh is present but nothing is
|
|
121
|
-
* governed yet —
|
|
121
|
+
* governed yet — the "silent no-profile window". */
|
|
122
122
|
gap: boolean;
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
|
-
* Detects
|
|
125
|
+
* Detects the "silent no-profile window": the stretch between `intutic
|
|
126
126
|
* connect` and the user's first `dsh --profile <name>` run, during which dsh
|
|
127
127
|
* is entirely ungoverned — {@link writeDshHooks} is a documented no-op with
|
|
128
128
|
* nothing to register into yet — and, before this function existed, nothing
|
|
@@ -157,7 +157,7 @@ export declare function mergeProfilePatch(profileDir: string, workspaceRoot: str
|
|
|
157
157
|
* `dsh: warning: 1 entry did not activate` / `intutic-governance
|
|
158
158
|
* (@intutic/gate/dsh): failed to import` on stderr and the session then runs
|
|
159
159
|
* UNGOVERNED — loud, but fail-OPEN (dsh's hard-fail list is global to the
|
|
160
|
-
* launcher; a profile row cannot mark itself required). See
|
|
160
|
+
* launcher; a profile row cannot mark itself required). See
|
|
161
161
|
* `apps/docs/integrations/dsh.md`.
|
|
162
162
|
*
|
|
163
163
|
* Adds the declaration only when the profile has none: an existing one was
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dshHooks.d.ts","sourceRoot":"","sources":["../../src/harness/dshHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AAmCH;;;;0CAI0C;AAC1C,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgB3E;AAoBD,MAAM,WAAW,cAAc;IAC7B;mFAC+E;IAC/E,WAAW,EAAE,OAAO,CAAA;IACpB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAA;IACpB;
|
|
1
|
+
{"version":3,"file":"dshHooks.d.ts","sourceRoot":"","sources":["../../src/harness/dshHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AAmCH;;;;0CAI0C;AAC1C,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgB3E;AAoBD,MAAM,WAAW,cAAc;IAC7B;mFAC+E;IAC/E,WAAW,EAAE,OAAO,CAAA;IACpB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAA;IACpB;yDACqD;IACrD,GAAG,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,SAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,CAQ9F;AAkED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4DrH;AAID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB9E;AA0BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD9F;AA4ED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5G"}
|
package/dist/harness/dshHooks.js
CHANGED
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
* included. Node resolves it from the profile directory's own
|
|
55
55
|
* `node_modules` (the "two-anchor" resolution `profile.d.ts` documents
|
|
56
56
|
* for out-of-tree plugins) — which means `@intutic/gate` must actually be
|
|
57
|
-
* installed there; see {@link mergeProfileDependency}
|
|
57
|
+
* installed there; see {@link mergeProfileDependency}
|
|
58
58
|
* for why this writer cannot run `pnpm install` on the user's behalf.
|
|
59
|
-
* - **LLM egress, re-verified against dsh 0.2.0-rc.2 (
|
|
59
|
+
* - **LLM egress, re-verified against dsh 0.2.0-rc.2 (2026-10-03).**
|
|
60
60
|
* 0.2 removed the harness-home `settings.yaml` document this writer used
|
|
61
61
|
* to merge into: `@deepseek-ai/dsh-settings` now imports a leftover
|
|
62
62
|
* `$DSH_HOME/settings.yaml` ONCE into whichever profile boots first
|
|
@@ -163,7 +163,7 @@ export async function listDshProfileDirs(dshHome) {
|
|
|
163
163
|
}
|
|
164
164
|
return out;
|
|
165
165
|
}
|
|
166
|
-
// ─── Coverage-gap detection (
|
|
166
|
+
// ─── Coverage-gap detection (the silent no-profile window) ────────────────
|
|
167
167
|
/** Markers dsh leaves under `$DSH_HOME` even before any profile exists —
|
|
168
168
|
* mirrors `tools/cli/src/harness/dsh.ts`'s own `detect()` list, minus the
|
|
169
169
|
* `profiles` marker itself (which is what "zero profiles" already answers
|
|
@@ -180,7 +180,7 @@ function isDshOnPath() {
|
|
|
180
180
|
return false;
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
|
-
* Detects
|
|
183
|
+
* Detects the "silent no-profile window": the stretch between `intutic
|
|
184
184
|
* connect` and the user's first `dsh --profile <name>` run, during which dsh
|
|
185
185
|
* is entirely ungoverned — {@link writeDshHooks} is a documented no-op with
|
|
186
186
|
* nothing to register into yet — and, before this function existed, nothing
|
|
@@ -335,7 +335,7 @@ export async function mergeProfilePatch(profileDir, workspaceRoot, workspaceId)
|
|
|
335
335
|
* `dsh: warning: 1 entry did not activate` / `intutic-governance
|
|
336
336
|
* (@intutic/gate/dsh): failed to import` on stderr and the session then runs
|
|
337
337
|
* UNGOVERNED — loud, but fail-OPEN (dsh's hard-fail list is global to the
|
|
338
|
-
* launcher; a profile row cannot mark itself required). See
|
|
338
|
+
* launcher; a profile row cannot mark itself required). See
|
|
339
339
|
* `apps/docs/integrations/dsh.md`.
|
|
340
340
|
*
|
|
341
341
|
* Adds the declaration only when the profile has none: an existing one was
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gateArtifacts.ts — where each hook-gated harness's gate file lives, so the
|
|
3
|
+
* AI inventory can say whether it is on disk.
|
|
4
|
+
*
|
|
5
|
+
* Every path is the one the harness's writer emits, relative to the root it
|
|
6
|
+
* was given: the `intutic connect` workspace, or the home directory for the
|
|
7
|
+
* writers that install per user. The inventory looks under both. A harness
|
|
8
|
+
* whose gate is not a file this daemon writes (`gateKind.ts`: `sdk`, `none`,
|
|
9
|
+
* `delegated`, `bridge`) has no entry.
|
|
10
|
+
*
|
|
11
|
+
* `gateArtifacts.test.ts` holds this list to the gate registry the generated
|
|
12
|
+
* gates are tested from (`__tests__/harness/gateRegistry.ts`), in both
|
|
13
|
+
* directions, so a new or removed gate cannot leave it stale.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import type { HarnessType } from '@intutic/shared-types';
|
|
18
|
+
/** Gate file paths per harness, relative to the workspace root or the home directory. */
|
|
19
|
+
export declare const GATE_ARTIFACTS: Readonly<Partial<Record<HarnessType, readonly string[]>>>;
|
|
20
|
+
/**
|
|
21
|
+
* The gate file of each gate id of the harness with two (`gateIdentitiesOf`
|
|
22
|
+
* in `@intutic/shared-types`): Google Antigravity's and Gemini CLI's, both
|
|
23
|
+
* written by the `antigravity` writers and both listed under that harness above.
|
|
24
|
+
*/
|
|
25
|
+
export declare const GATE_IDENTITY_ARTIFACTS: Readonly<Record<string, readonly string[]>>;
|
|
26
|
+
/** dsh's gate is a patch file in each profile under `$DSH_HOME/profiles`, whose names only the machine knows. */
|
|
27
|
+
export declare const DSH_PROFILE_GATE_FILE = "cordis.patch.yml";
|
|
28
|
+
/**
|
|
29
|
+
* The absolute path of this harness's gate file if one is on disk, else null.
|
|
30
|
+
* Only meaningful for a `hook`-gated harness; any other returns null.
|
|
31
|
+
*/
|
|
32
|
+
export declare function findGateFile(harness: string, workspaceRoot: string, home: string): Promise<string | null>;
|
|
33
|
+
/** As {@link findGateFile}, for one gate id of a harness with two ({@link GATE_IDENTITY_ARTIFACTS}). */
|
|
34
|
+
export declare function findIdentityGateFile(gateId: string, workspaceRoot: string, home: string): Promise<string | null>;
|
|
35
|
+
//# sourceMappingURL=gateArtifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateArtifacts.d.ts","sourceRoot":"","sources":["../../src/harness/gateArtifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGxD,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAkBpF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAG/E,CAAA;AAED,iHAAiH;AACjH,eAAO,MAAM,qBAAqB,qBAAqB,CAAA;AAUvD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAS/G;AAED,wGAAwG;AACxG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEhH"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gateArtifacts.ts — where each hook-gated harness's gate file lives, so the
|
|
3
|
+
* AI inventory can say whether it is on disk.
|
|
4
|
+
*
|
|
5
|
+
* Every path is the one the harness's writer emits, relative to the root it
|
|
6
|
+
* was given: the `intutic connect` workspace, or the home directory for the
|
|
7
|
+
* writers that install per user. The inventory looks under both. A harness
|
|
8
|
+
* whose gate is not a file this daemon writes (`gateKind.ts`: `sdk`, `none`,
|
|
9
|
+
* `delegated`, `bridge`) has no entry.
|
|
10
|
+
*
|
|
11
|
+
* `gateArtifacts.test.ts` holds this list to the gate registry the generated
|
|
12
|
+
* gates are tested from (`__tests__/harness/gateRegistry.ts`), in both
|
|
13
|
+
* directions, so a new or removed gate cannot leave it stale.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import * as node_fs from 'node:fs/promises';
|
|
18
|
+
import * as node_path from 'node:path';
|
|
19
|
+
import { listDshProfileDirs, resolveDshHome } from './dshHooks.js';
|
|
20
|
+
/** Gate file paths per harness, relative to the workspace root or the home directory. */
|
|
21
|
+
export const GATE_ARTIFACTS = {
|
|
22
|
+
'claude-code': ['.intutic/hooks/claude-code-check.js'],
|
|
23
|
+
'cursor': ['.intutic/hooks/cursor-check.js'],
|
|
24
|
+
'windsurf': ['.intutic/hooks/windsurf-check.js'],
|
|
25
|
+
'codex': ['.intutic/hooks/codex-check.js'],
|
|
26
|
+
'antigravity': ['.intutic/hooks/antigravity-check.sh', '.intutic/hooks/antigravity-cli-check.js'],
|
|
27
|
+
'openhands': ['.intutic/hooks/openhands-check.sh'],
|
|
28
|
+
'hermes': ['.intutic/hooks/hermes-check.sh'],
|
|
29
|
+
'pi': ['.pi/agent/extensions/intutic-governance.js'],
|
|
30
|
+
'openclaw': ['.intutic/hooks/openclaw/intutic-governance.cjs'],
|
|
31
|
+
'muse-code': ['.intutic/hooks/muse-check.js'],
|
|
32
|
+
'github-copilot': ['.intutic/hooks/github-copilot-check.js'],
|
|
33
|
+
'grok': ['.intutic/hooks/grok-check.js'],
|
|
34
|
+
'cline': ['.clinerules/hooks/PreToolUse'],
|
|
35
|
+
'goose': ['.agents/plugins/intutic-governance/scripts/intutic-check.sh'],
|
|
36
|
+
'opencode': ['.opencode/plugins/intutic-governance.js', '.opencode/plugins/intutic-governance/index.js'],
|
|
37
|
+
'n8n': ['.intutic/hooks/n8n-governance-hook.js'],
|
|
38
|
+
'open-webui': ['.open-webui/intutic-governance-filter.py'],
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The gate file of each gate id of the harness with two (`gateIdentitiesOf`
|
|
42
|
+
* in `@intutic/shared-types`): Google Antigravity's and Gemini CLI's, both
|
|
43
|
+
* written by the `antigravity` writers and both listed under that harness above.
|
|
44
|
+
*/
|
|
45
|
+
export const GATE_IDENTITY_ARTIFACTS = {
|
|
46
|
+
'antigravity': ['.intutic/hooks/antigravity-cli-check.js'],
|
|
47
|
+
'gemini-cli': ['.intutic/hooks/antigravity-check.sh'],
|
|
48
|
+
};
|
|
49
|
+
/** dsh's gate is a patch file in each profile under `$DSH_HOME/profiles`, whose names only the machine knows. */
|
|
50
|
+
export const DSH_PROFILE_GATE_FILE = 'cordis.patch.yml';
|
|
51
|
+
async function isFile(p) {
|
|
52
|
+
try {
|
|
53
|
+
return (await node_fs.stat(p)).isFile();
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The absolute path of this harness's gate file if one is on disk, else null.
|
|
61
|
+
* Only meaningful for a `hook`-gated harness; any other returns null.
|
|
62
|
+
*/
|
|
63
|
+
export async function findGateFile(harness, workspaceRoot, home) {
|
|
64
|
+
if (harness === 'dsh') {
|
|
65
|
+
for (const profile of await listDshProfileDirs(resolveDshHome())) {
|
|
66
|
+
const file = node_path.join(profile, DSH_PROFILE_GATE_FILE);
|
|
67
|
+
if (await isFile(file))
|
|
68
|
+
return file;
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return firstFile(GATE_ARTIFACTS[harness] ?? [], workspaceRoot, home);
|
|
73
|
+
}
|
|
74
|
+
/** As {@link findGateFile}, for one gate id of a harness with two ({@link GATE_IDENTITY_ARTIFACTS}). */
|
|
75
|
+
export function findIdentityGateFile(gateId, workspaceRoot, home) {
|
|
76
|
+
return firstFile(GATE_IDENTITY_ARTIFACTS[gateId] ?? [], workspaceRoot, home);
|
|
77
|
+
}
|
|
78
|
+
async function firstFile(rels, workspaceRoot, home) {
|
|
79
|
+
for (const rel of rels) {
|
|
80
|
+
for (const root of [workspaceRoot, home]) {
|
|
81
|
+
const file = node_path.join(root, rel);
|
|
82
|
+
if (await isFile(file))
|
|
83
|
+
return file;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=gateArtifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateArtifacts.js","sourceRoot":"","sources":["../../src/harness/gateArtifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,WAAW,CAAA;AAEtC,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAElE,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAA8D;IACvF,aAAa,EAAE,CAAC,qCAAqC,CAAC;IACtD,QAAQ,EAAE,CAAC,gCAAgC,CAAC;IAC5C,UAAU,EAAE,CAAC,kCAAkC,CAAC;IAChD,OAAO,EAAE,CAAC,+BAA+B,CAAC;IAC1C,aAAa,EAAE,CAAC,qCAAqC,EAAE,yCAAyC,CAAC;IACjG,WAAW,EAAE,CAAC,mCAAmC,CAAC;IAClD,QAAQ,EAAE,CAAC,gCAAgC,CAAC;IAC5C,IAAI,EAAE,CAAC,4CAA4C,CAAC;IACpD,UAAU,EAAE,CAAC,gDAAgD,CAAC;IAC9D,WAAW,EAAE,CAAC,8BAA8B,CAAC;IAC7C,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;IAC5D,MAAM,EAAE,CAAC,8BAA8B,CAAC;IACxC,OAAO,EAAE,CAAC,8B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