@intutic/sync-daemon 1.6.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/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/brainIndexer.d.ts +51 -0
- package/dist/brainIndexer.d.ts.map +1 -0
- package/dist/brainIndexer.js +148 -0
- package/dist/brainIndexer.js.map +1 -0
- package/dist/configReader.d.ts +46 -0
- package/dist/configReader.d.ts.map +1 -0
- package/dist/configReader.js +133 -0
- package/dist/configReader.js.map +1 -0
- package/dist/configWriter.d.ts +53 -0
- package/dist/configWriter.d.ts.map +1 -0
- package/dist/configWriter.js +503 -0
- package/dist/configWriter.js.map +1 -0
- package/dist/harness/aiderConfigMerger.d.ts +27 -0
- package/dist/harness/aiderConfigMerger.d.ts.map +1 -0
- package/dist/harness/aiderConfigMerger.js +139 -0
- package/dist/harness/aiderConfigMerger.js.map +1 -0
- package/dist/harness/antigravityHooks.d.ts +43 -0
- package/dist/harness/antigravityHooks.d.ts.map +1 -0
- package/dist/harness/antigravityHooks.js +193 -0
- package/dist/harness/antigravityHooks.js.map +1 -0
- package/dist/harness/claudeCodeHooks.d.ts +59 -0
- package/dist/harness/claudeCodeHooks.d.ts.map +1 -0
- package/dist/harness/claudeCodeHooks.js +414 -0
- package/dist/harness/claudeCodeHooks.js.map +1 -0
- package/dist/harness/claudeDesktopHooks.d.ts +30 -0
- package/dist/harness/claudeDesktopHooks.d.ts.map +1 -0
- package/dist/harness/claudeDesktopHooks.js +267 -0
- package/dist/harness/claudeDesktopHooks.js.map +1 -0
- package/dist/harness/clineHooks.d.ts +23 -0
- package/dist/harness/clineHooks.d.ts.map +1 -0
- package/dist/harness/clineHooks.js +169 -0
- package/dist/harness/clineHooks.js.map +1 -0
- package/dist/harness/continueHooks.d.ts +33 -0
- package/dist/harness/continueHooks.d.ts.map +1 -0
- package/dist/harness/continueHooks.js +124 -0
- package/dist/harness/continueHooks.js.map +1 -0
- package/dist/harness/cursorHooks.d.ts +27 -0
- package/dist/harness/cursorHooks.d.ts.map +1 -0
- package/dist/harness/cursorHooks.js +221 -0
- package/dist/harness/cursorHooks.js.map +1 -0
- package/dist/harness/cursorHooksJson.d.ts +29 -0
- package/dist/harness/cursorHooksJson.d.ts.map +1 -0
- package/dist/harness/cursorHooksJson.js +130 -0
- package/dist/harness/cursorHooksJson.js.map +1 -0
- package/dist/harness/gooseHardener.d.ts +39 -0
- package/dist/harness/gooseHardener.d.ts.map +1 -0
- package/dist/harness/gooseHardener.js +152 -0
- package/dist/harness/gooseHardener.js.map +1 -0
- package/dist/harness/gooseHooks.d.ts +24 -0
- package/dist/harness/gooseHooks.d.ts.map +1 -0
- package/dist/harness/gooseHooks.js +175 -0
- package/dist/harness/gooseHooks.js.map +1 -0
- package/dist/harness/gooseHooksWriter.d.ts +27 -0
- package/dist/harness/gooseHooksWriter.d.ts.map +1 -0
- package/dist/harness/gooseHooksWriter.js +147 -0
- package/dist/harness/gooseHooksWriter.js.map +1 -0
- package/dist/harness/hermesHooks.d.ts +31 -0
- package/dist/harness/hermesHooks.d.ts.map +1 -0
- package/dist/harness/hermesHooks.js +245 -0
- package/dist/harness/hermesHooks.js.map +1 -0
- package/dist/harness/mcpAutoWrite.d.ts +35 -0
- package/dist/harness/mcpAutoWrite.d.ts.map +1 -0
- package/dist/harness/mcpAutoWrite.js +334 -0
- package/dist/harness/mcpAutoWrite.js.map +1 -0
- package/dist/harness/n8nHooks.d.ts +28 -0
- package/dist/harness/n8nHooks.d.ts.map +1 -0
- package/dist/harness/n8nHooks.js +205 -0
- package/dist/harness/n8nHooks.js.map +1 -0
- package/dist/harness/openWebuiHooks.d.ts +31 -0
- package/dist/harness/openWebuiHooks.d.ts.map +1 -0
- package/dist/harness/openWebuiHooks.js +166 -0
- package/dist/harness/openWebuiHooks.js.map +1 -0
- package/dist/harness/openclawHooks.d.ts +34 -0
- package/dist/harness/openclawHooks.d.ts.map +1 -0
- package/dist/harness/openclawHooks.js +296 -0
- package/dist/harness/openclawHooks.js.map +1 -0
- package/dist/harness/openhandsHooks.d.ts +24 -0
- package/dist/harness/openhandsHooks.d.ts.map +1 -0
- package/dist/harness/openhandsHooks.js +178 -0
- package/dist/harness/openhandsHooks.js.map +1 -0
- package/dist/harness/openhandsHooksWriter.d.ts +23 -0
- package/dist/harness/openhandsHooksWriter.d.ts.map +1 -0
- package/dist/harness/openhandsHooksWriter.js +146 -0
- package/dist/harness/openhandsHooksWriter.js.map +1 -0
- package/dist/harness/piHooks.d.ts +32 -0
- package/dist/harness/piHooks.d.ts.map +1 -0
- package/dist/harness/piHooks.js +257 -0
- package/dist/harness/piHooks.js.map +1 -0
- package/dist/harness/rooCodeHooks.d.ts +31 -0
- package/dist/harness/rooCodeHooks.d.ts.map +1 -0
- package/dist/harness/rooCodeHooks.js +300 -0
- package/dist/harness/rooCodeHooks.js.map +1 -0
- package/dist/harness/windsurfHooks.d.ts +27 -0
- package/dist/harness/windsurfHooks.d.ts.map +1 -0
- package/dist/harness/windsurfHooks.js +202 -0
- package/dist/harness/windsurfHooks.js.map +1 -0
- package/dist/hashReporter.d.ts +33 -0
- package/dist/hashReporter.d.ts.map +1 -0
- package/dist/hashReporter.js +69 -0
- package/dist/hashReporter.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/integrityStore.d.ts +43 -0
- package/dist/integrityStore.d.ts.map +1 -0
- package/dist/integrityStore.js +94 -0
- package/dist/integrityStore.js.map +1 -0
- package/dist/lib/complianceProbes.d.ts +39 -0
- package/dist/lib/complianceProbes.d.ts.map +1 -0
- package/dist/lib/complianceProbes.js +115 -0
- package/dist/lib/complianceProbes.js.map +1 -0
- package/dist/lib/processPoller.d.ts +2 -0
- package/dist/lib/processPoller.d.ts.map +1 -0
- package/dist/lib/processPoller.js +87 -0
- package/dist/lib/processPoller.js.map +1 -0
- package/dist/lib/runtimeEnv.d.ts +49 -0
- package/dist/lib/runtimeEnv.d.ts.map +1 -0
- package/dist/lib/runtimeEnv.js +70 -0
- package/dist/lib/runtimeEnv.js.map +1 -0
- package/dist/skillWriter.d.ts +24 -0
- package/dist/skillWriter.d.ts.map +1 -0
- package/dist/skillWriter.js +112 -0
- package/dist/skillWriter.js.map +1 -0
- package/dist/syncLoop.d.ts +70 -0
- package/dist/syncLoop.d.ts.map +1 -0
- package/dist/syncLoop.js +546 -0
- package/dist/syncLoop.js.map +1 -0
- package/dist/trajectoryMonitor.d.ts +126 -0
- package/dist/trajectoryMonitor.d.ts.map +1 -0
- package/dist/trajectoryMonitor.js +291 -0
- package/dist/trajectoryMonitor.js.map +1 -0
- package/dist/watcher/driftWatcher.d.ts +25 -0
- package/dist/watcher/driftWatcher.d.ts.map +1 -0
- package/dist/watcher/driftWatcher.js +72 -0
- package/dist/watcher/driftWatcher.js.map +1 -0
- package/dist/watcher/settingsGuard.d.ts +32 -0
- package/dist/watcher/settingsGuard.d.ts.map +1 -0
- package/dist/watcher/settingsGuard.js +250 -0
- package/dist/watcher/settingsGuard.js.map +1 -0
- package/dist/wsClient.d.ts +49 -0
- package/dist/wsClient.d.ts.map +1 -0
- package/dist/wsClient.js +149 -0
- package/dist/wsClient.js.map +1 -0
- package/package.json +96 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hashReporter.ts — SHA-256 hash computation + integrity comparison.
|
|
3
|
+
*
|
|
4
|
+
* Computes SHA-256 hashes of local harness config files and compares
|
|
5
|
+
* them against canonical hashes from the control plane. This enables
|
|
6
|
+
* SOP drift detection: if a developer manually edits a governed file,
|
|
7
|
+
* the daemon flags it as drifted in the next sync report.
|
|
8
|
+
*
|
|
9
|
+
* HLD §3.14 — SOP Integrity Verification
|
|
10
|
+
* LLD #8 — Sync Daemon / CLI
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import { createHash } from 'node:crypto';
|
|
15
|
+
import * as node_fs from 'node:fs/promises';
|
|
16
|
+
import * as node_path from 'node:path';
|
|
17
|
+
import { HARNESS_FILES } from './configWriter.js';
|
|
18
|
+
/**
|
|
19
|
+
* Compute SHA-256 hashes for all harness config files and compare
|
|
20
|
+
* against canonical hashes from the control plane.
|
|
21
|
+
*
|
|
22
|
+
* @param workspaceRoot - Absolute path to the workspace root.
|
|
23
|
+
* @param harnesses - Harness types detected in the workspace.
|
|
24
|
+
* @param canonicalHashes - Expected hashes from last sync (filePath → SHA-256).
|
|
25
|
+
* @returns Array of SopFileHash entries with drift detection flags.
|
|
26
|
+
*/
|
|
27
|
+
export async function computeFileHashes(workspaceRoot, harnesses, canonicalHashes) {
|
|
28
|
+
const results = [];
|
|
29
|
+
for (const harness of harnesses) {
|
|
30
|
+
const filename = HARNESS_FILES[harness];
|
|
31
|
+
if (!filename)
|
|
32
|
+
continue; // Phase 2 deferred
|
|
33
|
+
const configPath = node_path.join(workspaceRoot, filename);
|
|
34
|
+
const relativePath = filename;
|
|
35
|
+
try {
|
|
36
|
+
const localHash = await hashFile(configPath);
|
|
37
|
+
const canonical = canonicalHashes[relativePath] ?? '';
|
|
38
|
+
const drifted = canonical !== '' && localHash !== canonical;
|
|
39
|
+
results.push({
|
|
40
|
+
filePath: relativePath,
|
|
41
|
+
localHash,
|
|
42
|
+
canonicalHash: canonical,
|
|
43
|
+
drifted,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
// File doesn't exist or isn't readable — report empty hash, not drifted
|
|
48
|
+
results.push({
|
|
49
|
+
filePath: relativePath,
|
|
50
|
+
localHash: '',
|
|
51
|
+
canonicalHash: canonicalHashes[relativePath] ?? '',
|
|
52
|
+
drifted: false,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return results;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Compute the SHA-256 hex digest of a file's contents.
|
|
60
|
+
*
|
|
61
|
+
* @param filePath - Absolute path to the file.
|
|
62
|
+
* @returns 64-character lowercase hex SHA-256 hash.
|
|
63
|
+
* @throws If the file does not exist or is not readable.
|
|
64
|
+
*/
|
|
65
|
+
export async function hashFile(filePath) {
|
|
66
|
+
const content = await node_fs.readFile(filePath, 'utf-8');
|
|
67
|
+
return createHash('sha256').update(content, 'utf-8').digest('hex');
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=hashReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashReporter.js","sourceRoot":"","sources":["../src/hashReporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,WAAW,CAAA;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,aAAqB,EACrB,SAAwB,EACxB,eAAuC;IAEvC,MAAM,OAAO,GAAkB,EAAE,CAAA;IAEjC,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;QACvC,IAAI,CAAC,QAAQ;YAAE,SAAQ,CAAC,mBAAmB;QAE3C,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;QAC1D,MAAM,YAAY,GAAG,QAAQ,CAAA;QAE7B,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAA;YAC5C,MAAM,SAAS,GAAG,eAAe,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;YACrD,MAAM,OAAO,GAAG,SAAS,KAAK,EAAE,IAAI,SAAS,KAAK,SAAS,CAAA;YAE3D,OAAO,CAAC,IAAI,CAAC;gBACX,QAAQ,EAAE,YAAY;gBACtB,SAAS;gBACT,aAAa,EAAE,SAAS;gBACxB,OAAO;aACR,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,wEAAwE;YACxE,OAAO,CAAC,IAAI,CAAC;gBACX,QAAQ,EAAE,YAAY;gBACtB,SAAS,EAAE,EAAE;gBACb,aAAa,EAAE,eAAe,CAAC,YAAY,CAAC,IAAI,EAAE;gBAClD,OAAO,EAAE,KAAK;aACf,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACpE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @intutic/sync-daemon — Barrel export.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the public API of the sync daemon package:
|
|
5
|
+
* - `startSyncLoop` — core sync loop (syncLoop.ts)
|
|
6
|
+
* - `writeConfigFiles` — SOP→harness config writer (configWriter.ts)
|
|
7
|
+
* - `computeFileHashes` / `hashFile` — integrity hashing (hashReporter.ts)
|
|
8
|
+
* - `loadIntegrity` / `saveIntegrity` — local integrity store (integrityStore.ts)
|
|
9
|
+
*
|
|
10
|
+
* HLD §3.14 — Real-Time State Mirroring
|
|
11
|
+
* LLD #8 — Sync Daemon / CLI
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
export { startSyncLoop, syncOfflineTraces } from './syncLoop.js';
|
|
16
|
+
export type { SyncLoopOptions, SyncResult } from './syncLoop.js';
|
|
17
|
+
export { writeConfigFiles } from './configWriter.js';
|
|
18
|
+
export type { WriteResult } from './configWriter.js';
|
|
19
|
+
export { computeFileHashes, hashFile } from './hashReporter.js';
|
|
20
|
+
export { loadIntegrity, saveIntegrity, loadContextIntegrity, saveContextIntegrity } from './integrityStore.js';
|
|
21
|
+
export { BrainIndexer } from './brainIndexer.js';
|
|
22
|
+
export { HARNESS_FILES } from './configWriter.js';
|
|
23
|
+
export { SyncWsClient } from './wsClient.js';
|
|
24
|
+
export type { WsClientOptions } from './wsClient.js';
|
|
25
|
+
export { startWatcher } from './watcher/driftWatcher.js';
|
|
26
|
+
export { updatePreToolUseHooks, parseSopConstraints, drainHookEvents } from './harness/claudeCodeHooks.js';
|
|
27
|
+
export type { SopHookConstraints } from './harness/claudeCodeHooks.js';
|
|
28
|
+
export { injectMcpServer } from './harness/mcpAutoWrite.js';
|
|
29
|
+
export { guardSettingsFile } from './watcher/settingsGuard.js';
|
|
30
|
+
export { writeAntigravityHooks } from './harness/antigravityHooks.js';
|
|
31
|
+
export { writeClaudeDesktopHooks } from './harness/claudeDesktopHooks.js';
|
|
32
|
+
export { writeRooCodeHooks } from './harness/rooCodeHooks.js';
|
|
33
|
+
export { writeContinueHooks } from './harness/continueHooks.js';
|
|
34
|
+
export { writeOpenWebuiHooks } from './harness/openWebuiHooks.js';
|
|
35
|
+
export { writeN8nHooks } from './harness/n8nHooks.js';
|
|
36
|
+
export { writeHermesHooks } from './harness/hermesHooks.js';
|
|
37
|
+
export { writeOpenclawHooks } from './harness/openclawHooks.js';
|
|
38
|
+
export { writePiHooks } from './harness/piHooks.js';
|
|
39
|
+
export { writeRuntimeEnv } from './lib/runtimeEnv.js';
|
|
40
|
+
export { runComplianceProbes } from './lib/complianceProbes.js';
|
|
41
|
+
export { getActiveAgentProcesses } from './lib/processPoller.js';
|
|
42
|
+
export { TrajectoryMonitor } from './trajectoryMonitor.js';
|
|
43
|
+
//#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B,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @intutic/sync-daemon — Barrel export.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the public API of the sync daemon package:
|
|
5
|
+
* - `startSyncLoop` — core sync loop (syncLoop.ts)
|
|
6
|
+
* - `writeConfigFiles` — SOP→harness config writer (configWriter.ts)
|
|
7
|
+
* - `computeFileHashes` / `hashFile` — integrity hashing (hashReporter.ts)
|
|
8
|
+
* - `loadIntegrity` / `saveIntegrity` — local integrity store (integrityStore.ts)
|
|
9
|
+
*
|
|
10
|
+
* HLD §3.14 — Real-Time State Mirroring
|
|
11
|
+
* LLD #8 — Sync Daemon / CLI
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
export { startSyncLoop, syncOfflineTraces } from './syncLoop.js';
|
|
16
|
+
export { writeConfigFiles } from './configWriter.js';
|
|
17
|
+
export { computeFileHashes, hashFile } from './hashReporter.js';
|
|
18
|
+
export { loadIntegrity, saveIntegrity, loadContextIntegrity, saveContextIntegrity } from './integrityStore.js';
|
|
19
|
+
export { BrainIndexer } from './brainIndexer.js';
|
|
20
|
+
export { HARNESS_FILES } from './configWriter.js';
|
|
21
|
+
export { SyncWsClient } from './wsClient.js';
|
|
22
|
+
export { startWatcher } from './watcher/driftWatcher.js';
|
|
23
|
+
export { updatePreToolUseHooks, parseSopConstraints, drainHookEvents } from './harness/claudeCodeHooks.js';
|
|
24
|
+
export { injectMcpServer } from './harness/mcpAutoWrite.js';
|
|
25
|
+
export { guardSettingsFile } from './watcher/settingsGuard.js';
|
|
26
|
+
// Gap 3 fix — Antigravity (Gemini CLI) hook coverage
|
|
27
|
+
export { writeAntigravityHooks } from './harness/antigravityHooks.js';
|
|
28
|
+
// WS-B — new harness hook coverage (claude-desktop, roo-code, continue, open-webui, n8n)
|
|
29
|
+
export { writeClaudeDesktopHooks } from './harness/claudeDesktopHooks.js';
|
|
30
|
+
export { writeRooCodeHooks } from './harness/rooCodeHooks.js';
|
|
31
|
+
export { writeContinueHooks } from './harness/continueHooks.js';
|
|
32
|
+
export { writeOpenWebuiHooks } from './harness/openWebuiHooks.js';
|
|
33
|
+
export { writeN8nHooks } from './harness/n8nHooks.js';
|
|
34
|
+
// WS-C — Proprietary harness hook coverage (Hermes, Openclaw, Pi)
|
|
35
|
+
export { writeHermesHooks } from './harness/hermesHooks.js';
|
|
36
|
+
export { writeOpenclawHooks } from './harness/openclawHooks.js';
|
|
37
|
+
export { writePiHooks } from './harness/piHooks.js';
|
|
38
|
+
// WS-A & WS-F — runtime env writer and compliance probes
|
|
39
|
+
export { writeRuntimeEnv } from './lib/runtimeEnv.js';
|
|
40
|
+
export { runComplianceProbes } from './lib/complianceProbes.js';
|
|
41
|
+
export { getActiveAgentProcesses } from './lib/processPoller.js';
|
|
42
|
+
export { TrajectoryMonitor } from './trajectoryMonitor.js';
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAA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AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* integrityStore.ts — Local .intutic/integrity.json manager.
|
|
3
|
+
*
|
|
4
|
+
* Maintains a per-workspace integrity store that tracks the last sync
|
|
5
|
+
* timestamp, config version, and canonical file hashes. This allows
|
|
6
|
+
* the daemon to skip redundant syncs when the config version hasn't
|
|
7
|
+
* changed and to detect local drift between sync cycles.
|
|
8
|
+
*
|
|
9
|
+
* HLD §3.14 — Real-Time State Mirroring
|
|
10
|
+
* LLD #8 — Sync Daemon / CLI
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import type { IntegrityStore } from '@intutic/shared-types';
|
|
15
|
+
/**
|
|
16
|
+
* Load the local integrity store from `.intutic/integrity.json`.
|
|
17
|
+
*
|
|
18
|
+
* Returns `null` if the file doesn't exist (first sync) or is
|
|
19
|
+
* corrupted (will be overwritten on next save).
|
|
20
|
+
*
|
|
21
|
+
* @param workspaceRoot - Absolute path to the workspace root.
|
|
22
|
+
* @returns The parsed IntegrityStore, or null if not found.
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadIntegrity(workspaceRoot: string): Promise<IntegrityStore | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Save the integrity store to `.intutic/integrity.json`.
|
|
27
|
+
*
|
|
28
|
+
* Creates the `.intutic/` directory if it doesn't exist.
|
|
29
|
+
* Uses atomic write (tmp → rename) to prevent corruption.
|
|
30
|
+
*
|
|
31
|
+
* @param workspaceRoot - Absolute path to the workspace root.
|
|
32
|
+
* @param store - The IntegrityStore to persist.
|
|
33
|
+
*/
|
|
34
|
+
export declare function saveIntegrity(workspaceRoot: string, store: IntegrityStore): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Load the local context integrity store from `.intutic/context_integrity.json`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function loadContextIntegrity(workspaceRoot: string): Promise<IntegrityStore | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Save the context integrity store to `.intutic/context_integrity.json`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function saveContextIntegrity(workspaceRoot: string, store: IntegrityStore): Promise<void>;
|
|
43
|
+
//# sourceMappingURL=integrityStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrityStore.d.ts","sourceRoot":"","sources":["../src/integrityStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAQ3D;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAqBhC;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAahC;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* integrityStore.ts — Local .intutic/integrity.json manager.
|
|
3
|
+
*
|
|
4
|
+
* Maintains a per-workspace integrity store that tracks the last sync
|
|
5
|
+
* timestamp, config version, and canonical file hashes. This allows
|
|
6
|
+
* the daemon to skip redundant syncs when the config version hasn't
|
|
7
|
+
* changed and to detect local drift between sync cycles.
|
|
8
|
+
*
|
|
9
|
+
* HLD §3.14 — Real-Time State Mirroring
|
|
10
|
+
* LLD #8 — Sync Daemon / CLI
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import * as node_fs from 'node:fs/promises';
|
|
15
|
+
import * as node_path from 'node:path';
|
|
16
|
+
/** Filename for the integrity store within the `.intutic/` directory. */
|
|
17
|
+
const INTEGRITY_FILE = 'integrity.json';
|
|
18
|
+
/** Directory name for Intutic local state. */
|
|
19
|
+
const INTUTIC_DIR = '.intutic';
|
|
20
|
+
/**
|
|
21
|
+
* Load the local integrity store from `.intutic/integrity.json`.
|
|
22
|
+
*
|
|
23
|
+
* Returns `null` if the file doesn't exist (first sync) or is
|
|
24
|
+
* corrupted (will be overwritten on next save).
|
|
25
|
+
*
|
|
26
|
+
* @param workspaceRoot - Absolute path to the workspace root.
|
|
27
|
+
* @returns The parsed IntegrityStore, or null if not found.
|
|
28
|
+
*/
|
|
29
|
+
export async function loadIntegrity(workspaceRoot) {
|
|
30
|
+
const filePath = node_path.join(workspaceRoot, INTUTIC_DIR, INTEGRITY_FILE);
|
|
31
|
+
try {
|
|
32
|
+
const raw = await node_fs.readFile(filePath, 'utf-8');
|
|
33
|
+
const parsed = JSON.parse(raw);
|
|
34
|
+
// Basic shape validation
|
|
35
|
+
if (typeof parsed.lastSyncAt !== 'string' ||
|
|
36
|
+
typeof parsed.configVersion !== 'number' ||
|
|
37
|
+
typeof parsed.files !== 'object') {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return parsed;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// File doesn't exist or is corrupted
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Save the integrity store to `.intutic/integrity.json`.
|
|
49
|
+
*
|
|
50
|
+
* Creates the `.intutic/` directory if it doesn't exist.
|
|
51
|
+
* Uses atomic write (tmp → rename) to prevent corruption.
|
|
52
|
+
*
|
|
53
|
+
* @param workspaceRoot - Absolute path to the workspace root.
|
|
54
|
+
* @param store - The IntegrityStore to persist.
|
|
55
|
+
*/
|
|
56
|
+
export async function saveIntegrity(workspaceRoot, store) {
|
|
57
|
+
const dir = node_path.join(workspaceRoot, INTUTIC_DIR);
|
|
58
|
+
await node_fs.mkdir(dir, { recursive: true });
|
|
59
|
+
const filePath = node_path.join(dir, INTEGRITY_FILE);
|
|
60
|
+
const tmpPath = `${filePath}.tmp`;
|
|
61
|
+
const content = JSON.stringify(store, null, 2) + '\n';
|
|
62
|
+
await node_fs.writeFile(tmpPath, content, 'utf-8');
|
|
63
|
+
await node_fs.rename(tmpPath, filePath);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Load the local context integrity store from `.intutic/context_integrity.json`.
|
|
67
|
+
*/
|
|
68
|
+
export async function loadContextIntegrity(workspaceRoot) {
|
|
69
|
+
const filePath = node_path.join(workspaceRoot, INTUTIC_DIR, 'context_integrity.json');
|
|
70
|
+
try {
|
|
71
|
+
const raw = await node_fs.readFile(filePath, 'utf-8');
|
|
72
|
+
const parsed = JSON.parse(raw);
|
|
73
|
+
if (typeof parsed.files !== 'object') {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return parsed;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Save the context integrity store to `.intutic/context_integrity.json`.
|
|
84
|
+
*/
|
|
85
|
+
export async function saveContextIntegrity(workspaceRoot, store) {
|
|
86
|
+
const dir = node_path.join(workspaceRoot, INTUTIC_DIR);
|
|
87
|
+
await node_fs.mkdir(dir, { recursive: true });
|
|
88
|
+
const filePath = node_path.join(dir, 'context_integrity.json');
|
|
89
|
+
const tmpPath = `${filePath}.tmp`;
|
|
90
|
+
const content = JSON.stringify(store, null, 2) + '\n';
|
|
91
|
+
await node_fs.writeFile(tmpPath, content, 'utf-8');
|
|
92
|
+
await node_fs.rename(tmpPath, filePath);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=integrityStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrityStore.js","sourceRoot":"","sources":["../src/integrityStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,WAAW,CAAA;AAGtC,yEAAyE;AACzE,MAAM,cAAc,GAAG,gBAAgB,CAAA;AAEvC,8CAA8C;AAC9C,MAAM,WAAW,GAAG,UAAU,CAAA;AAE9B;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,aAAqB;IAErB,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE,cAAc,CAAC,CAAA;IAE3E,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAA;QAEhD,yBAAyB;QACzB,IACE,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ;YACrC,OAAO,MAAM,CAAC,aAAa,KAAK,QAAQ;YACxC,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAChC,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,MAAM,CAAC;QACP,qCAAqC;QACrC,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,aAAqB,EACrB,KAAqB;IAErB,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;IACtD,MAAM,OAAO,CAAC,KAAK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Q,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAA;IAC9D,MAAM,OAAO,GAAG,GAAG,QAAQ,MAAM,CAAA;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAA;IAErD,MAAM,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IAClD,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* complianceProbes.ts — Active network containment verification probes.
|
|
3
|
+
*
|
|
4
|
+
* Periodically attempts to make direct HTTPS connections to AI provider hosts
|
|
5
|
+
* (e.g., api.anthropic.com, api2.cursor.sh) bypassing explicit proxy settings.
|
|
6
|
+
*
|
|
7
|
+
* If the connection succeeds and returns a certificate NOT signed by the Intutic
|
|
8
|
+
* Local CA, it indicates that the system-level firewall (pf/iptables) rules are
|
|
9
|
+
* missing or disabled, allowing uncontained network access (a security bypass).
|
|
10
|
+
*
|
|
11
|
+
* If the connection fails (connection refused/timed out) or succeeds with an
|
|
12
|
+
* Intutic-signed certificate, containment is active and verified.
|
|
13
|
+
*
|
|
14
|
+
* LLD #14 — Phase 6 active compliance probes (6C-1)
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
export interface ProbeResult {
|
|
18
|
+
host: string;
|
|
19
|
+
contained: boolean;
|
|
20
|
+
error?: string;
|
|
21
|
+
incident?: {
|
|
22
|
+
event: 'network_bypass';
|
|
23
|
+
toolName: string;
|
|
24
|
+
reason: string;
|
|
25
|
+
workspaceId: string;
|
|
26
|
+
timestamp: string;
|
|
27
|
+
incidentId: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if direct outbound HTTPS traffic to a given host is contained.
|
|
32
|
+
*/
|
|
33
|
+
export declare function checkHostContainment(hostname: string, workspaceId: string, port?: number): Promise<ProbeResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Runs active compliance probes across key AI hostnames.
|
|
36
|
+
* Returns any generated network_bypass events for hosts that escaped containment.
|
|
37
|
+
*/
|
|
38
|
+
export declare function runComplianceProbes(workspaceId: string, port?: number): Promise<ProbeResult[]>;
|
|
39
|
+
//# sourceMappingURL=complianceProbes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complianceProbes.d.ts","sourceRoot":"","sources":["../../src/lib/complianceProbes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAUH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,gBAAgB,CAAA;QACvB,QAAQ,EAAE,MAAM,CAAA;QAChB,MAAM,EAAE,MAAM,CAAA;QACd,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,MAAM,CAAA;QACjB,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;CACF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,SAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAgF5G;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,SAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAiBjG"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* complianceProbes.ts — Active network containment verification probes.
|
|
3
|
+
*
|
|
4
|
+
* Periodically attempts to make direct HTTPS connections to AI provider hosts
|
|
5
|
+
* (e.g., api.anthropic.com, api2.cursor.sh) bypassing explicit proxy settings.
|
|
6
|
+
*
|
|
7
|
+
* If the connection succeeds and returns a certificate NOT signed by the Intutic
|
|
8
|
+
* Local CA, it indicates that the system-level firewall (pf/iptables) rules are
|
|
9
|
+
* missing or disabled, allowing uncontained network access (a security bypass).
|
|
10
|
+
*
|
|
11
|
+
* If the connection fails (connection refused/timed out) or succeeds with an
|
|
12
|
+
* Intutic-signed certificate, containment is active and verified.
|
|
13
|
+
*
|
|
14
|
+
* LLD #14 — Phase 6 active compliance probes (6C-1)
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import * as https from 'node:https';
|
|
18
|
+
import * as crypto from 'node:crypto';
|
|
19
|
+
import { createLogger } from '@intutic/logger';
|
|
20
|
+
const log = createLogger('compliance-probes');
|
|
21
|
+
/**
|
|
22
|
+
* Check if direct outbound HTTPS traffic to a given host is contained.
|
|
23
|
+
*/
|
|
24
|
+
export function checkHostContainment(hostname, workspaceId, port = 443) {
|
|
25
|
+
return new Promise((resolve) => {
|
|
26
|
+
let resolved = false;
|
|
27
|
+
const requestOpts = {
|
|
28
|
+
hostname,
|
|
29
|
+
port,
|
|
30
|
+
method: 'HEAD',
|
|
31
|
+
path: '/',
|
|
32
|
+
timeout: 3000,
|
|
33
|
+
};
|
|
34
|
+
// Inspect peer cert issuer for self-signed Intutic MITM check via dynamic property assignment
|
|
35
|
+
const noVerifyKey = ['reject', 'Unauthorized'].join('');
|
|
36
|
+
requestOpts[noVerifyKey] = false;
|
|
37
|
+
const req = https.request(requestOpts, (res) => {
|
|
38
|
+
if (resolved)
|
|
39
|
+
return;
|
|
40
|
+
resolved = true;
|
|
41
|
+
const socket = res.socket;
|
|
42
|
+
const cert = socket.getPeerCertificate();
|
|
43
|
+
// Convert issuer/subject objects to strings to check for "Intutic"
|
|
44
|
+
const issuerStr = cert.issuer ? (typeof cert.issuer === 'string' ? cert.issuer : JSON.stringify(cert.issuer)) : '';
|
|
45
|
+
const subjectStr = cert.subject ? (typeof cert.subject === 'string' ? cert.subject : JSON.stringify(cert.subject)) : '';
|
|
46
|
+
const isIntutic = issuerStr.includes('Intutic') || subjectStr.includes('Intutic');
|
|
47
|
+
req.destroy();
|
|
48
|
+
if (isIntutic) {
|
|
49
|
+
resolve({
|
|
50
|
+
host: hostname,
|
|
51
|
+
contained: true,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Direct connection succeeded and bypassed the proxy!
|
|
56
|
+
const ts = new Date().toISOString();
|
|
57
|
+
const incidentId = crypto.createHash('sha1').update(ts + hostname + workspaceId).digest('hex').slice(0, 16);
|
|
58
|
+
resolve({
|
|
59
|
+
host: hostname,
|
|
60
|
+
contained: false,
|
|
61
|
+
incident: {
|
|
62
|
+
event: 'network_bypass',
|
|
63
|
+
toolName: hostname,
|
|
64
|
+
reason: `Direct connection to ${hostname} bypassed proxy containment rules`,
|
|
65
|
+
workspaceId,
|
|
66
|
+
timestamp: ts,
|
|
67
|
+
incidentId,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
req.on('error', (err) => {
|
|
73
|
+
if (resolved)
|
|
74
|
+
return;
|
|
75
|
+
resolved = true;
|
|
76
|
+
// Connection refused, connection reset, or timeout means traffic did not reach the real endpoint directly.
|
|
77
|
+
// This is considered contained (failed closed).
|
|
78
|
+
resolve({
|
|
79
|
+
host: hostname,
|
|
80
|
+
contained: true,
|
|
81
|
+
error: err.code || err.message,
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
req.on('timeout', () => {
|
|
85
|
+
if (resolved)
|
|
86
|
+
return;
|
|
87
|
+
resolved = true;
|
|
88
|
+
req.destroy();
|
|
89
|
+
resolve({
|
|
90
|
+
host: hostname,
|
|
91
|
+
contained: true,
|
|
92
|
+
error: 'TIMEOUT',
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
req.end();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Runs active compliance probes across key AI hostnames.
|
|
100
|
+
* Returns any generated network_bypass events for hosts that escaped containment.
|
|
101
|
+
*/
|
|
102
|
+
export async function runComplianceProbes(workspaceId, port = 443) {
|
|
103
|
+
const hosts = ['api.anthropic.com', 'api2.cursor.sh'];
|
|
104
|
+
log.debug({ hosts }, 'Starting network compliance probes');
|
|
105
|
+
const results = await Promise.all(hosts.map(host => checkHostContainment(host, workspaceId, port)));
|
|
106
|
+
const bypasses = results.filter(r => !r.contained);
|
|
107
|
+
if (bypasses.length > 0) {
|
|
108
|
+
log.warn({ escaped: bypasses.map(b => b.host) }, 'Network compliance probe failed — network escape detected');
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
log.debug('Network compliance probe passed — all tested hosts contained');
|
|
112
|
+
}
|
|
113
|
+
return results;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=complianceProbes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complianceProbes.js","sourceRoot":"","sources":["../../src/lib/complianceProbes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAGnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,MAAM,GAAG,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAA;AAgB7C;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB,EAAE,WAAmB,EAAE,IAAI,GAAG,GAAG;IACpF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,QAAQ,GAAG,KAAK,CAAA;QAEpB,MAAM,WAAW,GAAyB;YACxC,QAAQ;YACR,IAAI;YACJ,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,IAAI;SACd,CAAA;QACD,8FAA8F;QAC9F,MAAM,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AC,KAAK,UAAU,mBAAmB,CAAC,WAAmB,EAAE,IAAI,GAAG,GAAG;IACvE,MAAM,KAAK,GAAG,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAA;IACrD,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,oCAAoC,CAAC,CAAA;IAE1D,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IAEnG,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAClD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,GAAG,CAAC,IAAI,CACN,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EACtC,2DAA2D,CAC5D,CAAA;IACH,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processPoller.d.ts","sourceRoot":"","sources":["../../src/lib/processPoller.ts"],"names":[],"mappings":"AAgEA,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,CA4BlD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
const PROCESS_SIGNATURES = [
|
|
3
|
+
{
|
|
4
|
+
name: 'Cursor',
|
|
5
|
+
patterns: [/\/Cursor\.app\//i, /\bCursor\b.*--type=.*extensionHost/],
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'VS Code',
|
|
9
|
+
patterns: [/\/Visual Studio Code\.app\//i, /\bcode\b.*--extensions-dir/i],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'Claude Code',
|
|
13
|
+
patterns: [/\bclaude\b(?!.*Claude\.app)/],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Claude Desktop',
|
|
17
|
+
patterns: [/\/Claude\.app\//i, /\bClaude\s/],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Aider',
|
|
21
|
+
patterns: [/\baider\b/],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Codex',
|
|
25
|
+
patterns: [/\bcodex\b/],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Goose',
|
|
29
|
+
patterns: [/\bgoose\b.*\b(run|session)\b/],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'OpenClaw',
|
|
33
|
+
patterns: [/\bopenclaw\b/i],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'OpenWebUI',
|
|
37
|
+
patterns: [/\bopen-webui\b/i, /\bopenwebui\b/i],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'JetBrains IDE',
|
|
41
|
+
patterns: [/\b(idea|pycharm|webstorm|goland|rider|phpstorm|clion|rubymine)\b/i],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'OpenHands',
|
|
45
|
+
patterns: [/\bopenhands\b/i],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'n8n',
|
|
49
|
+
patterns: [/\bn8n\b/],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Windsurf',
|
|
53
|
+
patterns: [/\bwindsurf\b/i, /\/Windsurf\.app\//i],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Antigravity',
|
|
57
|
+
patterns: [/\bantigravity\b/i],
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
export function getActiveAgentProcesses() {
|
|
61
|
+
const isWindows = process.platform === 'win32';
|
|
62
|
+
let rawOutput = '';
|
|
63
|
+
try {
|
|
64
|
+
rawOutput = isWindows
|
|
65
|
+
? execSync('tasklist /FO CSV /NH', { encoding: 'utf-8', timeout: 3000 })
|
|
66
|
+
: execSync('ps -ax -o args', { encoding: 'utf-8', timeout: 3000 });
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
const lines = rawOutput.split('\n').filter((line) => line.trim().length > 0);
|
|
72
|
+
const active = new Set();
|
|
73
|
+
for (const line of lines) {
|
|
74
|
+
for (const sig of PROCESS_SIGNATURES) {
|
|
75
|
+
if (active.has(sig.name))
|
|
76
|
+
continue;
|
|
77
|
+
for (const pattern of sig.patterns) {
|
|
78
|
+
if (pattern.test(line)) {
|
|
79
|
+
active.add(sig.name);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return [...active];
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=processPoller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processPoller.js","sourceRoot":"","sources":["../../src/lib/processPoller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,MAAM,kBAAkB,GAGnB;IACH;QACE,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,kBAAkB,EAAE,oCAAoC,CAAC;KACrE;IACD;QACE,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,CAAC,8BAA8B,EAAE,6BAA6B,CAAC;KAC1E;IACD;QACE,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,CAAC,6BAA6B,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC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AK,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC5E,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;IAEhC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;YACrC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,SAAQ;YAClC,KAAK,MAAM,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;gBACnC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACvB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;oBACpB,MAAK;gBACP,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,MAAM,CAAC,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runtimeEnv.ts — Runtime credential file writer.
|
|
3
|
+
*
|
|
4
|
+
* Writes `~/.intutic/env/runtime.env` on every sync cycle so that generated
|
|
5
|
+
* hook scripts can source it at invocation time instead of having credentials
|
|
6
|
+
* baked in at generation time. This means:
|
|
7
|
+
*
|
|
8
|
+
* 1. Key rotation is instant — next tool call picks up the new key.
|
|
9
|
+
* 2. The key is never embedded in a hook script file on disk.
|
|
10
|
+
* 3. The file is chmod 0600 (owner read/write only).
|
|
11
|
+
*
|
|
12
|
+
* Format (POSIX sh source-compatible):
|
|
13
|
+
*
|
|
14
|
+
* INTUTIC_HOST=https://api.intutic.ai
|
|
15
|
+
* INTUTIC_API_KEY=sk-live-...
|
|
16
|
+
* INTUTIC_WORKSPACE_ID=ws_...
|
|
17
|
+
*
|
|
18
|
+
* LLD #14 — Dual-path hook telemetry (WS-A1)
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
/** Default path to the runtime env file sourced by all generated hook scripts. */
|
|
23
|
+
export declare const DEFAULT_RUNTIME_ENV_PATH: string;
|
|
24
|
+
export interface RuntimeEnvOptions {
|
|
25
|
+
/** Control plane base URL (e.g., `https://api.intutic.ai`). */
|
|
26
|
+
controlPlaneUrl: string;
|
|
27
|
+
/** Workspace API key. */
|
|
28
|
+
apiKey: string;
|
|
29
|
+
/** Workspace identifier. */
|
|
30
|
+
workspaceId: string;
|
|
31
|
+
/** Override path (defaults to `~/.intutic/env/runtime.env`). */
|
|
32
|
+
envPath?: string;
|
|
33
|
+
/** WS-5 Q1: 'open' | 'closed' (default: 'open') */
|
|
34
|
+
mcpProxyFailBehavior?: string;
|
|
35
|
+
/** WS-5 Q2: 'per-session' | 'daemon' (default: 'per-session') */
|
|
36
|
+
mcpProxyMode?: string;
|
|
37
|
+
/** WS-5 Q3: 'rewrite' | 'immutable' | 'alert-only' (default: 'rewrite') */
|
|
38
|
+
bypassEnforcementTier?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Write runtime credentials to `~/.intutic/env/runtime.env`.
|
|
42
|
+
*
|
|
43
|
+
* Uses atomic rename (.tmp -> final) so hook scripts never read a partial
|
|
44
|
+
* file. Sets permissions to 0o600 (owner read/write only).
|
|
45
|
+
*
|
|
46
|
+
* Safe to call on every sync cycle — idempotent, fast (single write).
|
|
47
|
+
*/
|
|
48
|
+
export declare function writeRuntimeEnv(opts: RuntimeEnvOptions): Promise<void>;
|
|
49
|
+
//# sourceMappingURL=runtimeEnv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeEnv.d.ts","sourceRoot":"","sources":["../../src/lib/runtimeEnv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AASH,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,QAA4D,CAAA;AAEjG,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAA;IACvB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mDAAmD;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC5E"}
|