@intutic/sync-daemon 2.0.0 → 2.1.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/dist/agentReporter.d.ts +4 -12
- package/dist/agentReporter.d.ts.map +1 -1
- package/dist/agentReporter.js +25 -4
- package/dist/agentReporter.js.map +1 -1
- package/dist/configWriter.d.ts.map +1 -1
- package/dist/configWriter.js +20 -6
- package/dist/configWriter.js.map +1 -1
- package/dist/harness/aiderConfigMerger.d.ts +41 -5
- package/dist/harness/aiderConfigMerger.d.ts.map +1 -1
- package/dist/harness/aiderConfigMerger.js +110 -86
- package/dist/harness/aiderConfigMerger.js.map +1 -1
- package/dist/harness/antigravityHooks.d.ts +13 -8
- package/dist/harness/antigravityHooks.d.ts.map +1 -1
- package/dist/harness/antigravityHooks.js +51 -39
- package/dist/harness/antigravityHooks.js.map +1 -1
- package/dist/harness/claudeCodeHooks.d.ts.map +1 -1
- package/dist/harness/claudeCodeHooks.js +42 -28
- package/dist/harness/claudeCodeHooks.js.map +1 -1
- package/dist/harness/clineHooks.d.ts +39 -9
- package/dist/harness/clineHooks.d.ts.map +1 -1
- package/dist/harness/clineHooks.js +139 -60
- package/dist/harness/clineHooks.js.map +1 -1
- package/dist/harness/codexConfigMerger.d.ts +38 -0
- package/dist/harness/codexConfigMerger.d.ts.map +1 -0
- package/dist/harness/codexConfigMerger.js +101 -0
- package/dist/harness/codexConfigMerger.js.map +1 -0
- package/dist/harness/codexHooks.d.ts +4 -2
- package/dist/harness/codexHooks.d.ts.map +1 -1
- package/dist/harness/codexHooks.js +11 -11
- package/dist/harness/codexHooks.js.map +1 -1
- package/dist/harness/continueConfigMerger.d.ts +46 -0
- package/dist/harness/continueConfigMerger.d.ts.map +1 -0
- package/dist/harness/continueConfigMerger.js +90 -0
- package/dist/harness/continueConfigMerger.js.map +1 -0
- package/dist/harness/continueHooks.d.ts +15 -25
- package/dist/harness/continueHooks.d.ts.map +1 -1
- package/dist/harness/continueHooks.js +22 -119
- package/dist/harness/continueHooks.js.map +1 -1
- package/dist/harness/cursorHooks.d.ts +33 -16
- package/dist/harness/cursorHooks.d.ts.map +1 -1
- package/dist/harness/cursorHooks.js +66 -25
- package/dist/harness/cursorHooks.js.map +1 -1
- package/dist/harness/dshHooks.d.ts +59 -52
- package/dist/harness/dshHooks.d.ts.map +1 -1
- package/dist/harness/dshHooks.js +145 -147
- package/dist/harness/dshHooks.js.map +1 -1
- package/dist/harness/gateKind.d.ts.map +1 -1
- package/dist/harness/gateKind.js +1 -0
- package/dist/harness/gateKind.js.map +1 -1
- package/dist/harness/githubCopilotHooks.js +1 -1
- package/dist/harness/grokHooks.d.ts.map +1 -1
- package/dist/harness/grokHooks.js +7 -2
- package/dist/harness/grokHooks.js.map +1 -1
- package/dist/harness/hermesHooks.d.ts +9 -0
- package/dist/harness/hermesHooks.d.ts.map +1 -1
- package/dist/harness/hermesHooks.js +32 -31
- package/dist/harness/hermesHooks.js.map +1 -1
- package/dist/harness/jsonMergeTarget.d.ts +23 -0
- package/dist/harness/jsonMergeTarget.d.ts.map +1 -0
- package/dist/harness/jsonMergeTarget.js +50 -0
- package/dist/harness/jsonMergeTarget.js.map +1 -0
- package/dist/harness/mcpAutoWrite.d.ts +28 -6
- package/dist/harness/mcpAutoWrite.d.ts.map +1 -1
- package/dist/harness/mcpAutoWrite.js +258 -32
- package/dist/harness/mcpAutoWrite.js.map +1 -1
- package/dist/harness/n8nHooks.d.ts.map +1 -1
- package/dist/harness/n8nHooks.js +6 -7
- package/dist/harness/n8nHooks.js.map +1 -1
- package/dist/harness/openCodeHooks.d.ts +37 -6
- package/dist/harness/openCodeHooks.d.ts.map +1 -1
- package/dist/harness/openCodeHooks.js +101 -8
- package/dist/harness/openCodeHooks.js.map +1 -1
- package/dist/harness/openWebuiHooks.d.ts.map +1 -1
- package/dist/harness/openWebuiHooks.js +5 -4
- package/dist/harness/openWebuiHooks.js.map +1 -1
- package/dist/harness/openhandsHooks.d.ts +13 -0
- package/dist/harness/openhandsHooks.d.ts.map +1 -1
- package/dist/harness/openhandsHooks.js +70 -0
- package/dist/harness/openhandsHooks.js.map +1 -1
- package/dist/harness/piHooks.d.ts +17 -0
- package/dist/harness/piHooks.d.ts.map +1 -1
- package/dist/harness/piHooks.js +28 -29
- package/dist/harness/piHooks.js.map +1 -1
- package/dist/harness/protectedPaths.d.ts +64 -6
- package/dist/harness/protectedPaths.d.ts.map +1 -1
- package/dist/harness/protectedPaths.js +161 -11
- package/dist/harness/protectedPaths.js.map +1 -1
- package/dist/harness/windsurfHooks.d.ts +3 -1
- package/dist/harness/windsurfHooks.d.ts.map +1 -1
- package/dist/harness/windsurfHooks.js +64 -42
- package/dist/harness/windsurfHooks.js.map +1 -1
- package/dist/harness/windsurfJetBrainsProxy.d.ts +9 -6
- package/dist/harness/windsurfJetBrainsProxy.d.ts.map +1 -1
- package/dist/harness/windsurfJetBrainsProxy.js +17 -6
- package/dist/harness/windsurfJetBrainsProxy.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/policySnapshot.d.ts +19 -0
- package/dist/lib/policySnapshot.d.ts.map +1 -1
- package/dist/lib/policySnapshot.js +29 -2
- package/dist/lib/policySnapshot.js.map +1 -1
- package/dist/watcher/settingsGuard.d.ts.map +1 -1
- package/dist/watcher/settingsGuard.js +14 -15
- package/dist/watcher/settingsGuard.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* cursorHooks.ts — Cursor
|
|
2
|
+
* cursorHooks.ts — Cursor hook injection.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Registers the gate in Cursor's hooks.json (schema per cursor.com/docs/agent/
|
|
5
|
+
* hooks: `{version: 1, hooks: {<event>: [{command, matcher?, failClosed?}]}}`)
|
|
6
|
+
* for three events:
|
|
7
|
+
* - `beforeShellExecution` — every shell command;
|
|
8
|
+
* - `beforeMCPExecution` — every MCP tool call;
|
|
9
|
+
* - `preToolUse` matching `Write|Delete` — file writes and deletions, which
|
|
10
|
+
* have no dedicated before-hook (`afterFileEdit` runs too late to refuse).
|
|
8
11
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
12
|
+
* The gate refuses with exit code 2 and allows by printing
|
|
13
|
+
* `{"permission":"allow"}`: with `failClosed: true` Cursor blocks on a hook
|
|
14
|
+
* that crashes, times out or prints nothing, so an allow must be explicit.
|
|
15
|
+
*
|
|
16
|
+
* Levels: project (`<workspaceRoot>/.cursor/hooks.json`) and user
|
|
17
|
+
* (`~/.cursor/hooks.json`) on every sync; system level
|
|
18
|
+
* (`/Library/Application Support/Cursor` on macOS, `/etc/cursor` elsewhere)
|
|
19
|
+
* only through `intutic enterprise install`, which needs root. The project and
|
|
20
|
+
* user files are merged — hooks the user registered are kept.
|
|
11
21
|
*
|
|
12
22
|
* LLD #14 — Phase 3 cross-harness defence
|
|
13
23
|
* HLD §3.14 — Three-Tier Defense Cascade
|
|
@@ -20,12 +30,13 @@ import * as os from 'node:os';
|
|
|
20
30
|
import { createLogger } from '@intutic/logger';
|
|
21
31
|
import { newIso } from '@intutic/id';
|
|
22
32
|
import { emitJsGate, emitJsFailClosedPrelude } from './gateBody.js';
|
|
33
|
+
import { readJsonObjectForMerge } from './jsonMergeTarget.js';
|
|
23
34
|
const log = createLogger('sync-cursor-hooks');
|
|
24
|
-
/**
|
|
35
|
+
/** The Cursor events the gate is registered for, with each one's matcher. */
|
|
25
36
|
const HOOK_EVENTS = [
|
|
26
|
-
'beforeShellExecution',
|
|
27
|
-
'beforeMCPExecution',
|
|
28
|
-
'
|
|
37
|
+
{ event: 'beforeShellExecution' },
|
|
38
|
+
{ event: 'beforeMCPExecution' },
|
|
39
|
+
{ event: 'preToolUse', matcher: 'Write|Delete' },
|
|
29
40
|
];
|
|
30
41
|
/**
|
|
31
42
|
* Where system-level hooks.json lives for a given platform. Exported (not
|
|
@@ -51,18 +62,39 @@ export function systemHooksDirFor(platform) {
|
|
|
51
62
|
*/
|
|
52
63
|
export function buildHooksConfig(hookScriptPath) {
|
|
53
64
|
return {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
failClosed: true,
|
|
57
|
-
hooks: Object.fromEntries(HOOK_EVENTS.map((event) => [
|
|
65
|
+
version: 1,
|
|
66
|
+
hooks: Object.fromEntries(HOOK_EVENTS.map(({ event, matcher }) => [
|
|
58
67
|
event,
|
|
59
|
-
{
|
|
60
|
-
command: `node "${hookScriptPath}"`,
|
|
61
|
-
failClosed: true,
|
|
62
|
-
},
|
|
68
|
+
[{ command: `node "${hookScriptPath}"`, ...(matcher ? { matcher } : {}), failClosed: true }],
|
|
63
69
|
])),
|
|
64
70
|
};
|
|
65
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Merge the Intutic entries into an existing hooks.json object: the user's
|
|
74
|
+
* entries for every event are kept, entries running this gate are replaced,
|
|
75
|
+
* and the shape earlier versions wrote (an object per event, top-level
|
|
76
|
+
* `failClosed`/`_comment`/`_lastSync`, the nonexistent `beforeFileEdit`
|
|
77
|
+
* event) is dropped.
|
|
78
|
+
*/
|
|
79
|
+
export function mergeHooksConfig(existing, hookScriptPath) {
|
|
80
|
+
const ours = buildHooksConfig(hookScriptPath);
|
|
81
|
+
const command = `node "${hookScriptPath}"`;
|
|
82
|
+
const current = typeof existing.hooks === 'object' && existing.hooks !== null && !Array.isArray(existing.hooks)
|
|
83
|
+
? { ...existing.hooks }
|
|
84
|
+
: {};
|
|
85
|
+
delete current.beforeFileEdit;
|
|
86
|
+
for (const [event, entries] of Object.entries(ours.hooks)) {
|
|
87
|
+
const kept = Array.isArray(current[event])
|
|
88
|
+
? current[event].filter((e) => !(typeof e === 'object' && e !== null && e.command === command))
|
|
89
|
+
: [];
|
|
90
|
+
current[event] = [...kept, ...entries];
|
|
91
|
+
}
|
|
92
|
+
const rest = { ...existing };
|
|
93
|
+
delete rest.failClosed;
|
|
94
|
+
delete rest._comment;
|
|
95
|
+
delete rest._lastSync;
|
|
96
|
+
return { ...rest, version: typeof existing.version === 'number' ? existing.version : 1, hooks: current };
|
|
97
|
+
}
|
|
66
98
|
/**
|
|
67
99
|
* The pre-tool-check.js script content — receives JSON context from Cursor
|
|
68
100
|
* on stdin, exits 0 to allow or exits 2 to block.
|
|
@@ -169,7 +201,7 @@ process.stdin.on('end', () => {
|
|
|
169
201
|
// hook_event_name: "beforeMCPExecution", ...}\`) — composed in here, once,
|
|
170
202
|
// before anything reads \`toolName\`.
|
|
171
203
|
if (event === 'beforemcpexecution' && ctx.tool_name) {
|
|
172
|
-
const mcpServer = ctx.command || ctx.url || ctx.server_name || ctx.serverName;
|
|
204
|
+
const mcpServer = ctx.mcp_server_name || ctx.command || ctx.url || ctx.server_name || ctx.serverName;
|
|
173
205
|
if (mcpServer) toolName = 'mcp__' + mcpServer + '__' + ctx.tool_name;
|
|
174
206
|
}
|
|
175
207
|
|
|
@@ -179,8 +211,10 @@ process.stdin.on('end', () => {
|
|
|
179
211
|
// command and the target independently.
|
|
180
212
|
intuticGate(toolName, targetPath, command, logEvent, _intuticWsId, input);
|
|
181
213
|
|
|
182
|
-
// Allow
|
|
214
|
+
// Allow — explicitly: with failClosed set, Cursor treats a hook that
|
|
215
|
+
// prints nothing as a failure and blocks the call.
|
|
183
216
|
logEvent('tool_allowed', toolName, '');
|
|
217
|
+
process.stdout.write(JSON.stringify({ permission: 'allow' }));
|
|
184
218
|
process.exit(0);
|
|
185
219
|
} catch (err) {
|
|
186
220
|
// Fail CLOSED
|
|
@@ -214,16 +248,15 @@ export async function writeCursorHooks(workspaceRoot, proxyUrl, workspaceId = ''
|
|
|
214
248
|
await fs.writeFile(tmpScript, buildHookScript(proxyUrl, workspaceRoot, workspaceId), 'utf-8');
|
|
215
249
|
await fs.rename(tmpScript, hookScriptPath);
|
|
216
250
|
await fs.chmod(hookScriptPath, 0o755);
|
|
217
|
-
const config = buildHooksConfig(hookScriptPath);
|
|
218
251
|
// 1. Project-level: .cursor/hooks.json
|
|
219
252
|
const projectCursorDir = path.join(workspaceRoot, '.cursor');
|
|
220
253
|
await fs.mkdir(projectCursorDir, { recursive: true });
|
|
221
|
-
await
|
|
254
|
+
await mergeHooksJsonFile(path.join(projectCursorDir, 'hooks.json'), hookScriptPath);
|
|
222
255
|
log.info({ action: 'cursor_hooks_written', level: 'project', path: projectCursorDir }, 'Cursor project-level hooks written');
|
|
223
256
|
// 2. User-level: ~/.cursor/hooks.json
|
|
224
257
|
const userCursorDir = path.join(os.homedir(), '.cursor');
|
|
225
258
|
await fs.mkdir(userCursorDir, { recursive: true });
|
|
226
|
-
await
|
|
259
|
+
await mergeHooksJsonFile(path.join(userCursorDir, 'hooks.json'), hookScriptPath);
|
|
227
260
|
log.info({ action: 'cursor_hooks_written', level: 'user', path: userCursorDir }, 'Cursor user-level hooks written');
|
|
228
261
|
// 3. System-level (system administrator installation only). macOS has no
|
|
229
262
|
// /etc/cursor convention Cursor itself reads — its own app-support
|
|
@@ -234,7 +267,7 @@ export async function writeCursorHooks(workspaceRoot, proxyUrl, workspaceId = ''
|
|
|
234
267
|
const systemCursorDir = systemHooksDirFor(process.platform);
|
|
235
268
|
try {
|
|
236
269
|
await fs.mkdir(systemCursorDir, { recursive: true });
|
|
237
|
-
await
|
|
270
|
+
await mergeHooksJsonFile(path.join(systemCursorDir, 'hooks.json'), hookScriptPath);
|
|
238
271
|
log.info({ action: 'cursor_hooks_written', level: 'system', path: systemCursorDir }, 'Cursor system-level hooks written');
|
|
239
272
|
}
|
|
240
273
|
catch (err) {
|
|
@@ -242,6 +275,14 @@ export async function writeCursorHooks(workspaceRoot, proxyUrl, workspaceId = ''
|
|
|
242
275
|
}
|
|
243
276
|
}
|
|
244
277
|
}
|
|
278
|
+
/** Merge the gate into one hooks.json; a file that does not parse is left
|
|
279
|
+
* untouched (see jsonMergeTarget.ts). */
|
|
280
|
+
async function mergeHooksJsonFile(filePath, hookScriptPath) {
|
|
281
|
+
const existing = await readJsonObjectForMerge(filePath);
|
|
282
|
+
if (existing === null)
|
|
283
|
+
return;
|
|
284
|
+
await atomicWriteJson(filePath, mergeHooksConfig(existing, hookScriptPath));
|
|
285
|
+
}
|
|
245
286
|
async function atomicWriteJson(filePath, data) {
|
|
246
287
|
const tmp = filePath + '.intutic-tmp';
|
|
247
288
|
await fs.writeFile(tmp, JSON.stringify(data, null, 2) + '\n', 'utf-8');
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;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,iBAAiB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,MAAM,GAAG,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAA;AAE7C,6EAA6E;AAC7E,MAAM,WAAW,GAAuD;IACtE,EAAE,KAAK,EAAE,sBAAsB,EAAE;IACjC,EAAE,KAAK,EAAE,oBAAoB,EAAE;IAC/B,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE;CACjD,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAyB;IACzD,OAAO,QAAQ,K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D,CAAC,CAAA;QAC/G,CAAC;IACH,CAAC;AACH,CAAC;AAED;0CAC0C;AAC1C,KAAK,UAAU,kBAAkB,CAAC,QAAgB,EAAE,cAAsB;IACxE,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IACvD,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAM;IAC7B,MAAM,eAAe,CAAC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAA;AAC7E,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,IAAa;IAC5D,MAAM,GAAG,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"}
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
* Muse Code/Grok Build in Wave 1. This writer was authored against a real
|
|
22
22
|
* `npm pack` + read of those packages' shipped `.d.ts`/README files, not
|
|
23
23
|
* solely the phase brief's prior research (see the TD entry this phase filed
|
|
24
|
-
* for exactly what was checked
|
|
25
|
-
* dsh-
|
|
26
|
-
*
|
|
27
|
-
* dsh-
|
|
28
|
-
* `dsh-
|
|
24
|
+
* for exactly what was checked). In 0.1 three packages (dsh-permission,
|
|
25
|
+
* dsh-settings-local, dsh-fs-policy) 404'd as restricted; 0.2.0-rc.2 no
|
|
26
|
+
* longer depends on them — their roles moved to the public `dsh-settings`,
|
|
27
|
+
* `dsh-config-editor`, `dsh-sandbox-policy`, `dsh-permission-presets` and
|
|
28
|
+
* `dsh-user-approval`, all read directly for the 0.2 re-verification.
|
|
29
29
|
*
|
|
30
30
|
* Confirmed facts this writer relies on:
|
|
31
31
|
*
|
|
@@ -56,30 +56,31 @@
|
|
|
56
56
|
* for out-of-tree plugins) — which means `@intutic/gate` must actually be
|
|
57
57
|
* installed there; see {@link mergeProfileDependency} and the TD entry
|
|
58
58
|
* for why this writer cannot run `pnpm install` on the user's behalf.
|
|
59
|
-
* -
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* mounts
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* `llm-
|
|
81
|
-
*
|
|
82
|
-
*
|
|
59
|
+
* - **LLM egress, re-verified against dsh 0.2.0-rc.2 (TD-370, 2026-10-03).**
|
|
60
|
+
* 0.2 removed the harness-home `settings.yaml` document this writer used
|
|
61
|
+
* to merge into: `@deepseek-ai/dsh-settings` now imports a leftover
|
|
62
|
+
* `$DSH_HOME/settings.yaml` ONCE into whichever profile boots first
|
|
63
|
+
* (renaming it to `settings.yaml.imported`), and live configuration
|
|
64
|
+
* lives in each profile's `cordis.patch.yml` as an id-targeted override
|
|
65
|
+
* row (`dsh-config-editor` persists Models-page edits the same way). The
|
|
66
|
+
* default route is still the entry id `llm-deepseek` — in 0.2 that id
|
|
67
|
+
* mounts `@deepseek-ai/dsh-llm-deepseek-api-key`, which registers the
|
|
68
|
+
* `deepseek-official` provider `dsh-base`'s `agent-default-model` row
|
|
69
|
+
* selects (`provider: deepseek-official, model: deepseek-flash`) — and
|
|
70
|
+
* `dsh-llm-deepseek`'s README confirms its endpoint resolves "explicit
|
|
71
|
+
* value, then `$DEEPSEEK_BASE_URL`, then the official root"
|
|
72
|
+
* (`https://api.deepseek.com/anthropic`, Messages wire format; requests
|
|
73
|
+
* go to `<baseURL>/v1/messages`). {@link mergeProfileLlmRoute} therefore
|
|
74
|
+
* sets `config.baseURL` on that entry's override row in every profile
|
|
75
|
+
* patch. Observed live (uat/evidence/live-verify/dsh-0.2.md): a headless
|
|
76
|
+
* 0.2.0-rc.2 session sent every model request to the configured base URL.
|
|
77
|
+
* Two routes are deliberately NOT redirected: `llm-pi-ai` (0.2 refuses a
|
|
78
|
+
* hand-declared route without a non-empty `models` list, so the old
|
|
79
|
+
* `providers.intutic` route is now invalid config — dropped), and
|
|
80
|
+
* `llm-deepseek-account` (`deepseek-account` provider; its token is only
|
|
81
|
+
* released to `inferenceOrigin`, which accepts an alternate origin only
|
|
82
|
+
* with a grant from DeepSeek's platform — an opt-in, signed-in route this
|
|
83
|
+
* writer cannot point at a proxy). See the TD entry.
|
|
83
84
|
* - The `@intutic/gate/dsh` veto contract itself (`tools/pre-execute`,
|
|
84
85
|
* `PreToolDecision`'s real `'deny'`/`'allow'`/`'ask'` shape, Cordis's
|
|
85
86
|
* `waterfall` `next()` semantics) is confirmed from `dsh-tools`'s shipped
|
|
@@ -152,36 +153,42 @@ export declare function mergeProfilePatch(profileDir: string, workspaceRoot: str
|
|
|
152
153
|
* writer in this codebase only ever writes config, never invokes a package
|
|
153
154
|
* manager on the user's behalf. Until the user (or their own tooling) runs
|
|
154
155
|
* one, the `cordis.patch.yml` row this module also writes resolves to a
|
|
155
|
-
* MISSING module
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
156
|
+
* MISSING module. Observed live against dsh 0.2.0-rc.2: the loader prints
|
|
157
|
+
* `dsh: warning: 1 entry did not activate` / `intutic-governance
|
|
158
|
+
* (@intutic/gate/dsh): failed to import` on stderr and the session then runs
|
|
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 the TD entry and
|
|
161
|
+
* `apps/docs/integrations/dsh.md`.
|
|
162
|
+
*
|
|
163
|
+
* Adds the declaration only when the profile has none: an existing one was
|
|
164
|
+
* written by `dsh plugin --profile <name> add @intutic/gate` (pnpm records
|
|
165
|
+
* the installed range, e.g. `^2.0.0`) or by the user, and rewriting it to this
|
|
166
|
+
* writer's range on every sync would drift the manifest away from what is
|
|
167
|
+
* actually installed — observed live against dsh 0.2.0-rc.2, where the old
|
|
168
|
+
* `^0.1.0` overwrote pnpm's `^2.0.0`.
|
|
159
169
|
*/
|
|
160
170
|
export declare function mergeProfileDependency(profileDir: string): Promise<void>;
|
|
161
171
|
/**
|
|
162
|
-
*
|
|
172
|
+
* Points dsh's DEFAULT LLM route at the Intutic proxy by setting
|
|
173
|
+
* `config.baseURL` on the profile's `llm-deepseek` override row.
|
|
163
174
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* - `llm-pi-ai.providers.intutic` — a SELECTABLE route (mounts dormant
|
|
173
|
-
* until this section exists at all — see module doc). Kept alongside the
|
|
174
|
-
* new default-route merge: a user, or a future sync, can still point a
|
|
175
|
-
* model at it explicitly.
|
|
175
|
+
* A Cordis id-targeted patch REPLACES the entry's whole `config`
|
|
176
|
+
* (`dsh-app-boot`'s README: "an id-targeted patch does not deep-merge"), so
|
|
177
|
+
* when the profile already overrides this entry (a Models-page save, a hand
|
|
178
|
+
* edit, or dsh 0.2's one-time import of a legacy `settings.yaml`), only
|
|
179
|
+
* `baseURL` is set on THAT row and every other field it restates
|
|
180
|
+
* (`apiKeyEnv`, `reasoningEffort`, `models`, ...) round-trips untouched.
|
|
181
|
+
* Otherwise a fresh `{ id, config: { baseURL } }` row is appended — the
|
|
182
|
+
* base bundle's row carries no config, so nothing is lost by replacing it.
|
|
176
183
|
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
184
|
+
* Same parse-structurally / write-if-changed / append-only-on-unparseable
|
|
185
|
+
* discipline as {@link mergeProfilePatch}, on the same file.
|
|
179
186
|
*/
|
|
180
|
-
export declare function
|
|
187
|
+
export declare function mergeProfileLlmRoute(profileDir: string, proxyUrl: string): Promise<void>;
|
|
181
188
|
/**
|
|
182
189
|
* Register the Intutic governance plugin against every existing dsh profile
|
|
183
|
-
* on this machine, and
|
|
184
|
-
*
|
|
190
|
+
* on this machine, and point each profile's `llm-deepseek` (default) LLM
|
|
191
|
+
* route at the Intutic proxy.
|
|
185
192
|
*
|
|
186
193
|
* A no-op (logged, not an error) when `$DSH_HOME/profiles` does not exist
|
|
187
194
|
* yet — dsh has not been run with any `--profile <name>` on this machine, so
|
|
@@ -191,7 +198,7 @@ export declare function mergeSettingsYaml(dshHome: string, proxyUrl: string): Pr
|
|
|
191
198
|
*
|
|
192
199
|
* @param workspaceRoot - Absolute workspace root (stored in the plugin row's
|
|
193
200
|
* `config.repoRoot`).
|
|
194
|
-
* @param proxyUrl - Intutic proxy URL,
|
|
201
|
+
* @param proxyUrl - Intutic proxy URL, set as the `llm-deepseek` row's `baseURL`.
|
|
195
202
|
* @param workspaceId - Workspace ID, stored in the plugin row's config.
|
|
196
203
|
*/
|
|
197
204
|
export declare function writeDshHooks(workspaceRoot: string, proxyUrl: string, workspaceId?: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dshHooks.d.ts","sourceRoot":"","sources":["../../src/harness/dshHooks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dshHooks.d.ts","sourceRoot":"","sources":["../../src/harness/dshHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AAkCH;;;;0CAI0C;AAC1C,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,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