@intutic/sync-daemon 1.10.0 → 2.0.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 +2 -2
- package/dist/agentReporter.d.ts +205 -0
- package/dist/agentReporter.d.ts.map +1 -0
- package/dist/agentReporter.js +394 -0
- package/dist/agentReporter.js.map +1 -0
- package/dist/configReader.d.ts +39 -2
- package/dist/configReader.d.ts.map +1 -1
- package/dist/configReader.js +56 -2
- package/dist/configReader.js.map +1 -1
- package/dist/configWriter.d.ts +51 -1
- package/dist/configWriter.d.ts.map +1 -1
- package/dist/configWriter.js +490 -63
- package/dist/configWriter.js.map +1 -1
- package/dist/harness/antigravityHooks.d.ts.map +1 -1
- package/dist/harness/antigravityHooks.js +33 -55
- package/dist/harness/antigravityHooks.js.map +1 -1
- package/dist/harness/claudeCodeHooks.d.ts +47 -13
- package/dist/harness/claudeCodeHooks.d.ts.map +1 -1
- package/dist/harness/claudeCodeHooks.js +316 -54
- package/dist/harness/claudeCodeHooks.js.map +1 -1
- package/dist/harness/claudeDesktopHooks.d.ts.map +1 -1
- package/dist/harness/claudeDesktopHooks.js +35 -48
- package/dist/harness/claudeDesktopHooks.js.map +1 -1
- package/dist/harness/clineHooks.d.ts.map +1 -1
- package/dist/harness/clineHooks.js +42 -34
- package/dist/harness/clineHooks.js.map +1 -1
- package/dist/harness/codexHooks.d.ts +36 -0
- package/dist/harness/codexHooks.d.ts.map +1 -0
- package/dist/harness/codexHooks.js +227 -0
- package/dist/harness/codexHooks.js.map +1 -0
- package/dist/harness/continueHooks.d.ts +45 -5
- package/dist/harness/continueHooks.d.ts.map +1 -1
- package/dist/harness/continueHooks.js +225 -5
- package/dist/harness/continueHooks.js.map +1 -1
- package/dist/harness/cursorHooks.d.ts +31 -0
- package/dist/harness/cursorHooks.d.ts.map +1 -1
- package/dist/harness/cursorHooks.js +78 -49
- package/dist/harness/cursorHooks.js.map +1 -1
- package/dist/harness/dshHooks.d.ts +198 -0
- package/dist/harness/dshHooks.d.ts.map +1 -0
- package/dist/harness/dshHooks.js +569 -0
- package/dist/harness/dshHooks.js.map +1 -0
- package/dist/harness/gateBody.d.ts +422 -0
- package/dist/harness/gateBody.d.ts.map +1 -0
- package/dist/harness/gateBody.js +1816 -0
- package/dist/harness/gateBody.js.map +1 -0
- package/dist/harness/gateKind.d.ts +164 -0
- package/dist/harness/gateKind.d.ts.map +1 -0
- package/dist/harness/gateKind.js +143 -0
- package/dist/harness/gateKind.js.map +1 -0
- package/dist/harness/githubCopilotHooks.d.ts +54 -0
- package/dist/harness/githubCopilotHooks.d.ts.map +1 -0
- package/dist/harness/githubCopilotHooks.js +218 -0
- package/dist/harness/githubCopilotHooks.js.map +1 -0
- package/dist/harness/gooseHooks.d.ts.map +1 -1
- package/dist/harness/gooseHooks.js +67 -37
- package/dist/harness/gooseHooks.js.map +1 -1
- package/dist/harness/grokHooks.d.ts +77 -0
- package/dist/harness/grokHooks.d.ts.map +1 -0
- package/dist/harness/grokHooks.js +350 -0
- package/dist/harness/grokHooks.js.map +1 -0
- package/dist/harness/hermesHooks.d.ts.map +1 -1
- package/dist/harness/hermesHooks.js +26 -55
- package/dist/harness/hermesHooks.js.map +1 -1
- package/dist/harness/holdRedaction.d.ts +69 -0
- package/dist/harness/holdRedaction.d.ts.map +1 -0
- package/dist/harness/holdRedaction.js +211 -0
- package/dist/harness/holdRedaction.js.map +1 -0
- package/dist/harness/jetbrainsXmlConfig.d.ts +51 -0
- package/dist/harness/jetbrainsXmlConfig.d.ts.map +1 -0
- package/dist/harness/jetbrainsXmlConfig.js +151 -0
- package/dist/harness/jetbrainsXmlConfig.js.map +1 -0
- package/dist/harness/mcpAutoWrite.d.ts +100 -3
- package/dist/harness/mcpAutoWrite.d.ts.map +1 -1
- package/dist/harness/mcpAutoWrite.js +712 -90
- package/dist/harness/mcpAutoWrite.js.map +1 -1
- package/dist/harness/museHooks.d.ts +53 -0
- package/dist/harness/museHooks.d.ts.map +1 -0
- package/dist/harness/museHooks.js +273 -0
- package/dist/harness/museHooks.js.map +1 -0
- package/dist/harness/n8nHooks.d.ts +25 -9
- package/dist/harness/n8nHooks.d.ts.map +1 -1
- package/dist/harness/n8nHooks.js +174 -9
- package/dist/harness/n8nHooks.js.map +1 -1
- package/dist/harness/openCodeHooks.d.ts +93 -0
- package/dist/harness/openCodeHooks.d.ts.map +1 -0
- package/dist/harness/openCodeHooks.js +248 -0
- package/dist/harness/openCodeHooks.js.map +1 -0
- package/dist/harness/openWebuiHooks.d.ts.map +1 -1
- package/dist/harness/openWebuiHooks.js +56 -11
- package/dist/harness/openWebuiHooks.js.map +1 -1
- package/dist/harness/openclawHooks.d.ts.map +1 -1
- package/dist/harness/openclawHooks.js +30 -54
- package/dist/harness/openclawHooks.js.map +1 -1
- package/dist/harness/openhandsHooks.d.ts.map +1 -1
- package/dist/harness/openhandsHooks.js +35 -41
- package/dist/harness/openhandsHooks.js.map +1 -1
- package/dist/harness/piHooks.d.ts.map +1 -1
- package/dist/harness/piHooks.js +31 -58
- package/dist/harness/piHooks.js.map +1 -1
- package/dist/harness/protectedPaths.d.ts +353 -0
- package/dist/harness/protectedPaths.d.ts.map +1 -0
- package/dist/harness/protectedPaths.js +805 -0
- package/dist/harness/protectedPaths.js.map +1 -0
- package/dist/harness/rooCodeHooks.d.ts.map +1 -1
- package/dist/harness/rooCodeHooks.js +34 -48
- package/dist/harness/rooCodeHooks.js.map +1 -1
- package/dist/harness/windsurfHooks.d.ts +72 -0
- package/dist/harness/windsurfHooks.d.ts.map +1 -1
- package/dist/harness/windsurfHooks.js +172 -58
- package/dist/harness/windsurfHooks.js.map +1 -1
- package/dist/harness/windsurfJetBrainsProxy.d.ts +78 -0
- package/dist/harness/windsurfJetBrainsProxy.d.ts.map +1 -0
- package/dist/harness/windsurfJetBrainsProxy.js +159 -0
- package/dist/harness/windsurfJetBrainsProxy.js.map +1 -0
- package/dist/hashReporter.js +1 -1
- package/dist/hashReporter.js.map +1 -1
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/integrityStore.d.ts +0 -8
- package/dist/integrityStore.d.ts.map +1 -1
- package/dist/integrityStore.js +6 -29
- package/dist/integrityStore.js.map +1 -1
- package/dist/lib/approvedBypasses.d.ts +76 -0
- package/dist/lib/approvedBypasses.d.ts.map +1 -0
- package/dist/lib/approvedBypasses.js +140 -0
- package/dist/lib/approvedBypasses.js.map +1 -0
- package/dist/lib/complianceProbes.d.ts.map +1 -1
- package/dist/lib/complianceProbes.js +5 -0
- package/dist/lib/complianceProbes.js.map +1 -1
- package/dist/lib/decisionsDigest.d.ts +99 -0
- package/dist/lib/decisionsDigest.d.ts.map +1 -0
- package/dist/lib/decisionsDigest.js +199 -0
- package/dist/lib/decisionsDigest.js.map +1 -0
- package/dist/lib/egressPolicy.d.ts +69 -0
- package/dist/lib/egressPolicy.d.ts.map +1 -0
- package/dist/lib/egressPolicy.js +126 -0
- package/dist/lib/egressPolicy.js.map +1 -0
- package/dist/lib/gitWorktrees.d.ts +140 -0
- package/dist/lib/gitWorktrees.d.ts.map +1 -0
- package/dist/lib/gitWorktrees.js +191 -0
- package/dist/lib/gitWorktrees.js.map +1 -0
- package/dist/lib/policySnapshot.d.ts +224 -0
- package/dist/lib/policySnapshot.d.ts.map +1 -0
- package/dist/lib/policySnapshot.js +637 -0
- package/dist/lib/policySnapshot.js.map +1 -0
- package/dist/lib/processPoller.d.ts +44 -0
- package/dist/lib/processPoller.d.ts.map +1 -1
- package/dist/lib/processPoller.js +176 -1
- package/dist/lib/processPoller.js.map +1 -1
- package/dist/lib/runtimeEnv.d.ts +8 -0
- package/dist/lib/runtimeEnv.d.ts.map +1 -1
- package/dist/lib/runtimeEnv.js +3 -0
- package/dist/lib/runtimeEnv.js.map +1 -1
- package/dist/localTrajectoryHeuristics.d.ts +51 -0
- package/dist/localTrajectoryHeuristics.d.ts.map +1 -0
- package/dist/localTrajectoryHeuristics.js +90 -0
- package/dist/localTrajectoryHeuristics.js.map +1 -0
- package/dist/sessionReporter.d.ts +70 -0
- package/dist/sessionReporter.d.ts.map +1 -0
- package/dist/sessionReporter.js +140 -0
- package/dist/sessionReporter.js.map +1 -0
- package/dist/skillWriter.d.ts +1 -1
- package/dist/skillWriter.d.ts.map +1 -1
- package/dist/skillWriter.js +5 -2
- package/dist/skillWriter.js.map +1 -1
- package/dist/syncLoop.d.ts +105 -3
- package/dist/syncLoop.d.ts.map +1 -1
- package/dist/syncLoop.js +397 -65
- package/dist/syncLoop.js.map +1 -1
- package/dist/trajectoryMonitor.d.ts +2 -0
- package/dist/trajectoryMonitor.d.ts.map +1 -1
- package/dist/trajectoryMonitor.js +57 -0
- package/dist/trajectoryMonitor.js.map +1 -1
- package/dist/watcher/driftWatcher.d.ts.map +1 -1
- package/dist/watcher/driftWatcher.js +12 -3
- package/dist/watcher/driftWatcher.js.map +1 -1
- package/dist/watcher/settingsGuard.d.ts +23 -0
- package/dist/watcher/settingsGuard.d.ts.map +1 -1
- package/dist/watcher/settingsGuard.js +202 -17
- package/dist/watcher/settingsGuard.js.map +1 -1
- package/package.json +37 -6
- package/dist/brainIndexer.d.ts +0 -51
- package/dist/brainIndexer.d.ts.map +0 -1
- package/dist/brainIndexer.js +0 -148
- package/dist/brainIndexer.js.map +0 -1
- package/dist/harness/cursorHooksJson.d.ts +0 -29
- package/dist/harness/cursorHooksJson.d.ts.map +0 -1
- package/dist/harness/cursorHooksJson.js +0 -130
- package/dist/harness/cursorHooksJson.js.map +0 -1
- package/dist/harness/gooseHooksWriter.d.ts +0 -27
- package/dist/harness/gooseHooksWriter.d.ts.map +0 -1
- package/dist/harness/gooseHooksWriter.js +0 -147
- package/dist/harness/gooseHooksWriter.js.map +0 -1
- package/dist/harness/openhandsHooksWriter.d.ts +0 -23
- package/dist/harness/openhandsHooksWriter.d.ts.map +0 -1
- package/dist/harness/openhandsHooksWriter.js +0 -146
- package/dist/harness/openhandsHooksWriter.js.map +0 -1
package/dist/configReader.d.ts
CHANGED
|
@@ -9,7 +9,21 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
|
-
import type { HarnessType, CapturedConfigFile } from '@intutic/shared-types';
|
|
12
|
+
import type { HarnessType, CapturedConfigFile, GovernanceCoverageInputs } from '@intutic/shared-types';
|
|
13
|
+
/**
|
|
14
|
+
* The four enforcement inputs `POST /api/v1/governance-coverage/snapshot`
|
|
15
|
+
* expects. Re-exported from `@intutic/shared-types` (TD-443) — previously
|
|
16
|
+
* declared locally here as a hand-kept duplicate of
|
|
17
|
+
* `harnessGradeSweep.ts`'s `deriveEnforcementInputs` return shape on the
|
|
18
|
+
* control-plane side, which drifted (this module's `syncLoop.ts` consumer
|
|
19
|
+
* was missing an `Array.isArray` guard the control-plane side had). Both
|
|
20
|
+
* sides now derive from `packages/shared-types/src/governanceCoverage.ts`'s
|
|
21
|
+
* single mapping — safe for this module to depend on since it is a leaf
|
|
22
|
+
* package, not `services/control-plane` itself, so the publicly-mirrored
|
|
23
|
+
* `services/sync-daemon` still never imports from the enterprise-only
|
|
24
|
+
* service.
|
|
25
|
+
*/
|
|
26
|
+
export type { GovernanceCoverageInputs } from '@intutic/shared-types';
|
|
13
27
|
/**
|
|
14
28
|
* Determine whether config capture should run on this iteration.
|
|
15
29
|
* Captures every Nth iteration to avoid flooding the control plane.
|
|
@@ -38,9 +52,32 @@ export declare function readHarnessConfigs(workspaceRoot: string, harnesses: Har
|
|
|
38
52
|
* @returns Number of files actually uploaded (after dedup).
|
|
39
53
|
*/
|
|
40
54
|
export declare function uploadConfigCapture(controlPlaneUrl: string, apiKey: string, workspaceId: string, harnessType: HarnessType, configs: CapturedConfigFile[]): Promise<number>;
|
|
55
|
+
/**
|
|
56
|
+
* Trigger an immediate governance-coverage grade snapshot for one harness
|
|
57
|
+
* (`POST /api/v1/governance-coverage/snapshot` — see that route's own doc
|
|
58
|
+
* comment: "Called by the sync-daemon after detecting harness config
|
|
59
|
+
* changes," which nothing actually did until this wiring). Best-effort and
|
|
60
|
+
* non-fatal by design, matching `uploadConfigCapture`'s own network-failure
|
|
61
|
+
* handling above: the hourly control-plane sweep (`harnessGradeSweep.ts`)
|
|
62
|
+
* re-grades every harness regardless, so a failed request here only costs
|
|
63
|
+
* the up-to-the-minute freshness this call exists to provide, never
|
|
64
|
+
* correctness.
|
|
65
|
+
*/
|
|
66
|
+
export declare function reportGovernanceCoverageSnapshot(controlPlaneUrl: string, apiKey: string, workspaceId: string, harnessType: HarnessType, inputs: GovernanceCoverageInputs): Promise<void>;
|
|
41
67
|
/**
|
|
42
68
|
* Full config capture cycle: read + upload.
|
|
43
69
|
* Groups by harness type for proper capture payloads.
|
|
70
|
+
*
|
|
71
|
+
* @param governanceInputs - This cycle's per-harness enforcement signals
|
|
72
|
+
* (from `runSyncIteration`'s agent-facets collection), used to fire a
|
|
73
|
+
* governance-coverage snapshot immediately after a harness's rules file is
|
|
74
|
+
* actually found to have changed — never on every sync tick, only on the
|
|
75
|
+
* iterations where `uploadConfigCapture`'s content-hash dedup lets a file
|
|
76
|
+
* through. Falls back to `hasRulesFile: true` / everything else `false`
|
|
77
|
+
* when the caller has no facets for a harness yet (first cycle before the
|
|
78
|
+
* agent-report step has run) — conservative in the same direction
|
|
79
|
+
* `harnessGradeSweep.ts`'s own doc comment argues for: "a wrong mapping
|
|
80
|
+
* overstates enforcement, which is worse than an empty grid."
|
|
44
81
|
*/
|
|
45
|
-
export declare function captureAndUpload(controlPlaneUrl: string, apiKey: string, workspaceId: string, workspaceRoot: string, harnesses: HarnessType[]): Promise<void>;
|
|
82
|
+
export declare function captureAndUpload(controlPlaneUrl: string, apiKey: string, workspaceId: string, workspaceRoot: string, harnesses: HarnessType[], governanceInputs?: Partial<Record<HarnessType, GovernanceCoverageInputs>>): Promise<void>;
|
|
46
83
|
//# sourceMappingURL=configReader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configReader.d.ts","sourceRoot":"","sources":["../src/configReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"configReader.d.ts","sourceRoot":"","sources":["../src/configReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAElB,wBAAwB,EACzB,MAAM,uBAAuB,CAAA;AAkB9B;;;;;;;;;;;;GAYG;AACH,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAErE;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAG1E;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,WAAW,EAAE,GACvB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAgC/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,kBAAkB,EAAE,GAC5B,OAAO,CAAC,MAAM,CAAC,CAsCjB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CACpC,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,WAAW,EAAE,EACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC,GACxE,OAAO,CAAC,IAAI,CAAC,CA6Bf"}
|
package/dist/configReader.js
CHANGED
|
@@ -21,7 +21,6 @@ const MAX_FILE_SIZE_BYTES = 512 * 1024; // 512 KB
|
|
|
21
21
|
// ─── Local hash cache ────────────────────────────────────────────────
|
|
22
22
|
/** Cache of last-uploaded content hashes per file path. Avoids redundant uploads. */
|
|
23
23
|
const lastUploadedHashes = new Map();
|
|
24
|
-
// ─── Public API ──────────────────────────────────────────────────────
|
|
25
24
|
/**
|
|
26
25
|
* Determine whether config capture should run on this iteration.
|
|
27
26
|
* Captures every Nth iteration to avoid flooding the control plane.
|
|
@@ -115,17 +114,72 @@ export async function uploadConfigCapture(controlPlaneUrl, apiKey, workspaceId,
|
|
|
115
114
|
}
|
|
116
115
|
return changed.length;
|
|
117
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Trigger an immediate governance-coverage grade snapshot for one harness
|
|
119
|
+
* (`POST /api/v1/governance-coverage/snapshot` — see that route's own doc
|
|
120
|
+
* comment: "Called by the sync-daemon after detecting harness config
|
|
121
|
+
* changes," which nothing actually did until this wiring). Best-effort and
|
|
122
|
+
* non-fatal by design, matching `uploadConfigCapture`'s own network-failure
|
|
123
|
+
* handling above: the hourly control-plane sweep (`harnessGradeSweep.ts`)
|
|
124
|
+
* re-grades every harness regardless, so a failed request here only costs
|
|
125
|
+
* the up-to-the-minute freshness this call exists to provide, never
|
|
126
|
+
* correctness.
|
|
127
|
+
*/
|
|
128
|
+
export async function reportGovernanceCoverageSnapshot(controlPlaneUrl, apiKey, workspaceId, harnessType, inputs) {
|
|
129
|
+
try {
|
|
130
|
+
const res = await fetch(`${controlPlaneUrl}/api/v1/governance-coverage/snapshot`, {
|
|
131
|
+
method: 'POST',
|
|
132
|
+
headers: {
|
|
133
|
+
'content-type': 'application/json',
|
|
134
|
+
authorization: `Bearer ${apiKey}`,
|
|
135
|
+
},
|
|
136
|
+
body: JSON.stringify({
|
|
137
|
+
workspaceId,
|
|
138
|
+
harnessType,
|
|
139
|
+
mcpProxyActive: inputs.mcpProxyActive,
|
|
140
|
+
nativeHookActive: inputs.nativeHookActive,
|
|
141
|
+
llmProxyActive: inputs.llmProxyActive,
|
|
142
|
+
hasRulesFile: inputs.hasRulesFile,
|
|
143
|
+
}),
|
|
144
|
+
signal: AbortSignal.timeout(10_000),
|
|
145
|
+
});
|
|
146
|
+
if (!res.ok) {
|
|
147
|
+
const body = await res.text().catch(() => '');
|
|
148
|
+
console.warn(`[config-reader] Governance coverage snapshot failed (${res.status}): ${body}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
console.warn('[config-reader] Governance coverage snapshot request failed:', err);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
118
155
|
/**
|
|
119
156
|
* Full config capture cycle: read + upload.
|
|
120
157
|
* Groups by harness type for proper capture payloads.
|
|
158
|
+
*
|
|
159
|
+
* @param governanceInputs - This cycle's per-harness enforcement signals
|
|
160
|
+
* (from `runSyncIteration`'s agent-facets collection), used to fire a
|
|
161
|
+
* governance-coverage snapshot immediately after a harness's rules file is
|
|
162
|
+
* actually found to have changed — never on every sync tick, only on the
|
|
163
|
+
* iterations where `uploadConfigCapture`'s content-hash dedup lets a file
|
|
164
|
+
* through. Falls back to `hasRulesFile: true` / everything else `false`
|
|
165
|
+
* when the caller has no facets for a harness yet (first cycle before the
|
|
166
|
+
* agent-report step has run) — conservative in the same direction
|
|
167
|
+
* `harnessGradeSweep.ts`'s own doc comment argues for: "a wrong mapping
|
|
168
|
+
* overstates enforcement, which is worse than an empty grid."
|
|
121
169
|
*/
|
|
122
|
-
export async function captureAndUpload(controlPlaneUrl, apiKey, workspaceId, workspaceRoot, harnesses) {
|
|
170
|
+
export async function captureAndUpload(controlPlaneUrl, apiKey, workspaceId, workspaceRoot, harnesses, governanceInputs) {
|
|
123
171
|
for (const harness of harnesses) {
|
|
124
172
|
const configs = await readHarnessConfigs(workspaceRoot, [harness]);
|
|
125
173
|
if (configs.length > 0) {
|
|
126
174
|
const uploaded = await uploadConfigCapture(controlPlaneUrl, apiKey, workspaceId, harness, configs);
|
|
127
175
|
if (uploaded > 0) {
|
|
128
176
|
console.log(`[config-reader] Captured ${uploaded} ${harness} config file(s)`);
|
|
177
|
+
await reportGovernanceCoverageSnapshot(controlPlaneUrl, apiKey, workspaceId, harness, governanceInputs?.[harness] ?? {
|
|
178
|
+
mcpProxyActive: false,
|
|
179
|
+
nativeHookActive: false,
|
|
180
|
+
llmProxyActive: false,
|
|
181
|
+
hasRulesFile: true,
|
|
182
|
+
});
|
|
129
183
|
}
|
|
130
184
|
}
|
|
131
185
|
}
|
package/dist/configReader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configReader.js","sourceRoot":"","sources":["../src/configReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"configReader.js","sourceRoot":"","sources":["../src/configReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAOrC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,wEAAwE;AAExE,oFAAoF;AACpF,MAAM,wBAAwB,GAAG,CAAC,CAAA;AAElC,kEAAkE;AAClE,MAAM,mBAAmB,GAAG,GAAG,GAAG,IAAI,CAAA,CAAE,SAAS;AAEjD,wEAAwE;AAExE,qFAAqF;AACrF,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAA;AAmBpD;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,cAA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AA8D,EAAE,GAAG,CAAC,CAAA;IACnF,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,eAAuB,EACvB,MAAc,EACd,WAAmB,EACnB,aAAqB,EACrB,SAAwB,EACxB,gBAAyE;IAEzE,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;QAClE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CACxC,eAAe,EACf,MAAM,EACN,WAAW,EACX,OAAO,EACP,OAAO,CACR,CAAA;YACD,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CAAC,4BAA4B,QAAQ,IAAI,OAAO,iBAAiB,CAAC,CAAA;gBAE7E,MAAM,gCAAgC,CACpC,eAAe,EACf,MAAM,EACN,WAAW,EACX,OAAO,EACP,gBAAgB,EAAE,CAAC,OAAO,CAAC,IAAI;oBAC7B,cAAc,EAAE,KAAK;oBACrB,gBAAgB,EAAE,KAAK;oBACvB,cAAc,EAAE,KAAK;oBACrB,YAAY,EAAE,IAAI;iBACnB,CACF,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/configWriter.d.ts
CHANGED
|
@@ -25,6 +25,14 @@ export interface WriteResult {
|
|
|
25
25
|
/** Paths where the harness was skipped (not detected or deferred). */
|
|
26
26
|
filesSkipped: string[];
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* The workspace's local SOPs (`.intutic/sops/<dir>/*.md`, narrowed by
|
|
30
|
+
* `session-context.json`'s `activeLocalSops` when present). Shared by the
|
|
31
|
+
* config writer and by the gate-cache refresh, which compiles their
|
|
32
|
+
* `review_before:` tokens into hold rules (TD-474 item 4). A missing
|
|
33
|
+
* directory is an empty list.
|
|
34
|
+
*/
|
|
35
|
+
export declare function loadLocalSopEntries(workspaceRoot: string, harnesses: HarnessType[]): Promise<SyncSopEntry[]>;
|
|
28
36
|
/**
|
|
29
37
|
* Write SOP content to all targeted harness config files.
|
|
30
38
|
*
|
|
@@ -41,13 +49,55 @@ export interface WriteResult {
|
|
|
41
49
|
export declare function writeConfigFiles(workspaceRoot: string, sops: SyncSopEntry[], proxyUrl: string, harnesses: HarnessType[], workspaceId?: string,
|
|
42
50
|
/** WS-5 Q3: 'rewrite' (default) | 'immutable' | 'alert-only' */
|
|
43
51
|
bypassEnforcementTier?: string): Promise<WriteResult>;
|
|
52
|
+
/** Outcome of a single ADD/DELETE/REPLACE operation within one suggestion's edit set. */
|
|
53
|
+
export interface ConfigEditOperationOutcome {
|
|
54
|
+
/** Index into the suggestion's `edits` array. */
|
|
55
|
+
index: number;
|
|
56
|
+
operation: string;
|
|
57
|
+
/** Whether this operation's effect actually landed in the on-disk file. */
|
|
58
|
+
applied: boolean;
|
|
59
|
+
/** Present when `applied` is false — why it didn't land. */
|
|
60
|
+
reason?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Per-suggestion result of `applyConfigEdits` — what the daemon reports back
|
|
64
|
+
* to control-plane via `POST /api/v1/skillopt/:suggestionId/apply-result`
|
|
65
|
+
* (TD-349).
|
|
66
|
+
*/
|
|
67
|
+
export interface ConfigEditApplyOutcome {
|
|
68
|
+
suggestionId: string;
|
|
69
|
+
/** True only when every operation for this suggestion landed. */
|
|
70
|
+
ok: boolean;
|
|
71
|
+
perOperation: ConfigEditOperationOutcome[];
|
|
72
|
+
}
|
|
44
73
|
/**
|
|
45
74
|
* Apply a list of custom config edits (ADD, DELETE, REPLACE) to a workspace rule file.
|
|
75
|
+
*
|
|
76
|
+
* Returns one `ConfigEditApplyOutcome` per input suggestion (TD-349) instead
|
|
77
|
+
* of `void` — every operation's real fate (fuzzy-match miss on DELETE/
|
|
78
|
+
* REPLACE, an unresolvable target file, or the final `atomicWrite` itself
|
|
79
|
+
* failing) is recorded here rather than only `console.warn`'d, so the caller
|
|
80
|
+
* (syncLoop.ts) can ack the daemon's actual outcome back to control-plane
|
|
81
|
+
* instead of the daemon-side write being invisible to it.
|
|
46
82
|
*/
|
|
47
83
|
export declare function applyConfigEdits(workspaceRoot: string, appliedEdits: Array<{
|
|
48
84
|
suggestionId: string;
|
|
49
85
|
harnessType: string;
|
|
50
86
|
filePath: string;
|
|
51
87
|
edits: string | ConfigEdit[];
|
|
52
|
-
}>, bypassEnforcementTier?: string): Promise<
|
|
88
|
+
}>, bypassEnforcementTier?: string): Promise<ConfigEditApplyOutcome[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Write content to a file atomically.
|
|
91
|
+
*
|
|
92
|
+
* Writes to a `.tmp` sibling first, then renames to the target path.
|
|
93
|
+
* This prevents partial/corrupt files if the process is interrupted mid-write.
|
|
94
|
+
*
|
|
95
|
+
* If bypassEnforcementTier === 'immutable', clears the macOS user-immutable
|
|
96
|
+
* flag before writing and re-sets it after (WS-5 Q3).
|
|
97
|
+
*
|
|
98
|
+
* Exported for reuse by other full-regenerate writers in this daemon (e.g.
|
|
99
|
+
* `lib/decisionsDigest.ts`) that want the same write-tmp-then-rename
|
|
100
|
+
* atomicity without duplicating it.
|
|
101
|
+
*/
|
|
102
|
+
export declare function atomicWrite(filePath: string, content: string, bypassEnforcementTier?: string): Promise<void>;
|
|
53
103
|
//# sourceMappingURL=configWriter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configWriter.d.ts","sourceRoot":"","sources":["../src/configWriter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"configWriter.d.ts","sourceRoot":"","sources":["../src/configWriter.ts"],"names":[],"mappings":"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