@dailephd/my-centcom 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/apps/daemon/dist/artifacts/returnSnapshots.d.ts +12 -0
- package/apps/daemon/dist/artifacts/returnSnapshots.js +41 -0
- package/apps/daemon/dist/bootstrap/app.d.ts +21 -0
- package/apps/daemon/dist/bootstrap/app.js +27 -0
- package/apps/daemon/dist/bootstrap/installLayout.d.ts +81 -0
- package/apps/daemon/dist/bootstrap/installLayout.js +164 -0
- package/apps/daemon/dist/bootstrap/main.d.ts +14 -0
- package/apps/daemon/dist/bootstrap/main.js +141 -0
- package/apps/daemon/dist/bootstrap/operatorConsole.d.ts +75 -0
- package/apps/daemon/dist/bootstrap/operatorConsole.js +293 -0
- package/apps/daemon/dist/bootstrap/privateDataRoot.d.ts +38 -0
- package/apps/daemon/dist/bootstrap/privateDataRoot.js +204 -0
- package/apps/daemon/dist/bootstrap/secureMain.d.ts +118 -0
- package/apps/daemon/dist/bootstrap/secureMain.js +403 -0
- package/apps/daemon/dist/bootstrap/setup.d.ts +93 -0
- package/apps/daemon/dist/bootstrap/setup.js +738 -0
- package/apps/daemon/dist/context/changeProposal.d.ts +97 -0
- package/apps/daemon/dist/context/changeProposal.js +259 -0
- package/apps/daemon/dist/context/gitEvidence.d.ts +88 -0
- package/apps/daemon/dist/context/gitEvidence.js +332 -0
- package/apps/daemon/dist/context/gitObservation.d.ts +30 -0
- package/apps/daemon/dist/context/gitObservation.js +113 -0
- package/apps/daemon/dist/context/projectReadIssuer.d.ts +68 -0
- package/apps/daemon/dist/context/projectReadIssuer.js +158 -0
- package/apps/daemon/dist/context/projectReadService.d.ts +153 -0
- package/apps/daemon/dist/context/projectReadService.js +652 -0
- package/apps/daemon/dist/context/projectViewService.d.ts +85 -0
- package/apps/daemon/dist/context/projectViewService.js +332 -0
- package/apps/daemon/dist/context/proposalRecorder.d.ts +11 -0
- package/apps/daemon/dist/context/proposalRecorder.js +19 -0
- package/apps/daemon/dist/plugins/drivers/codexMcpConfig.d.ts +40 -0
- package/apps/daemon/dist/plugins/drivers/codexMcpConfig.js +73 -0
- package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.d.ts +49 -0
- package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.js +70 -0
- package/apps/daemon/dist/plugins/drivers/fakePluginDriver.d.ts +16 -0
- package/apps/daemon/dist/plugins/drivers/fakePluginDriver.js +115 -0
- package/apps/daemon/dist/plugins/drivers/finiteCliDriver.d.ts +153 -0
- package/apps/daemon/dist/plugins/drivers/finiteCliDriver.js +505 -0
- package/apps/daemon/dist/plugins/registry/operationCatalog.d.ts +23 -0
- package/apps/daemon/dist/plugins/registry/operationCatalog.js +41 -0
- package/apps/daemon/dist/plugins/registry/registryOperationCatalog.d.ts +14 -0
- package/apps/daemon/dist/plugins/registry/registryOperationCatalog.js +29 -0
- package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.d.ts +151 -0
- package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.js +579 -0
- package/apps/daemon/dist/projects/codingAuthority.d.ts +102 -0
- package/apps/daemon/dist/projects/codingAuthority.js +244 -0
- package/apps/daemon/dist/projects/fixtureAuthorization.d.ts +54 -0
- package/apps/daemon/dist/projects/fixtureAuthorization.js +172 -0
- package/apps/daemon/dist/projects/pairedAuthority.d.ts +158 -0
- package/apps/daemon/dist/projects/pairedAuthority.js +273 -0
- package/apps/daemon/dist/projects/trustedCliConsent.d.ts +47 -0
- package/apps/daemon/dist/projects/trustedCliConsent.js +84 -0
- package/apps/daemon/dist/runs/changeApplier.d.ts +59 -0
- package/apps/daemon/dist/runs/changeApplier.js +319 -0
- package/apps/daemon/dist/runs/codingWorkflowService.d.ts +283 -0
- package/apps/daemon/dist/runs/codingWorkflowService.js +785 -0
- package/apps/daemon/dist/runs/durableIntentCoordinator.d.ts +72 -0
- package/apps/daemon/dist/runs/durableIntentCoordinator.js +160 -0
- package/apps/daemon/dist/runs/inMemoryCoordinator.d.ts +55 -0
- package/apps/daemon/dist/runs/inMemoryCoordinator.js +375 -0
- package/apps/daemon/dist/runs/runExecutor.d.ts +154 -0
- package/apps/daemon/dist/runs/runExecutor.js +295 -0
- package/apps/daemon/dist/runs/workflowService.d.ts +185 -0
- package/apps/daemon/dist/runs/workflowService.js +300 -0
- package/apps/daemon/dist/runtime/boundedProcessHost.d.ts +111 -0
- package/apps/daemon/dist/runtime/boundedProcessHost.js +752 -0
- package/apps/daemon/dist/runtime/evidenceRedaction.d.ts +30 -0
- package/apps/daemon/dist/runtime/evidenceRedaction.js +79 -0
- package/apps/daemon/dist/runtime/executionDiagnostics.d.ts +134 -0
- package/apps/daemon/dist/runtime/executionDiagnostics.js +213 -0
- package/apps/daemon/dist/runtime/modelExecutionPolicy.d.ts +22 -0
- package/apps/daemon/dist/runtime/modelExecutionPolicy.js +19 -0
- package/apps/daemon/dist/runtime/mxcExecution.d.ts +12 -0
- package/apps/daemon/dist/runtime/mxcExecution.js +163 -0
- package/apps/daemon/dist/runtime/mxcIntegrity.d.ts +24 -0
- package/apps/daemon/dist/runtime/mxcIntegrity.js +81 -0
- package/apps/daemon/dist/runtime/mxcWorker.d.ts +2 -0
- package/apps/daemon/dist/runtime/mxcWorker.js +45 -0
- package/apps/daemon/dist/runtime/provisionedExecution.d.ts +150 -0
- package/apps/daemon/dist/runtime/provisionedExecution.js +653 -0
- package/apps/daemon/dist/runtime/testExecution.d.ts +76 -0
- package/apps/daemon/dist/runtime/testExecution.js +106 -0
- package/apps/daemon/dist/runtime/testProfiles.d.ts +10 -0
- package/apps/daemon/dist/runtime/testProfiles.js +4 -0
- package/apps/daemon/dist/runtime/trustedAgentStaging.d.ts +89 -0
- package/apps/daemon/dist/runtime/trustedAgentStaging.js +262 -0
- package/apps/daemon/dist/runtime/trustedCaBundle.d.ts +77 -0
- package/apps/daemon/dist/runtime/trustedCaBundle.js +125 -0
- package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.d.ts +166 -0
- package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.js +521 -0
- package/apps/daemon/dist/storage/diagnosticLog.d.ts +63 -0
- package/apps/daemon/dist/storage/diagnosticLog.js +136 -0
- package/apps/daemon/dist/storage/executionTelemetry.d.ts +63 -0
- package/apps/daemon/dist/storage/executionTelemetry.js +247 -0
- package/apps/daemon/dist/storage/protectedSecrets.d.ts +39 -0
- package/apps/daemon/dist/storage/protectedSecrets.js +106 -0
- package/apps/daemon/dist/storage/sqliteLedger.d.ts +786 -0
- package/apps/daemon/dist/storage/sqliteLedger.js +1303 -0
- package/apps/daemon/dist/transports/http/dispatch.d.ts +43 -0
- package/apps/daemon/dist/transports/http/dispatch.js +405 -0
- package/apps/daemon/dist/transports/http/secureRoutes.d.ts +40 -0
- package/apps/daemon/dist/transports/http/secureRoutes.js +332 -0
- package/apps/daemon/dist/transports/http/workflowRoutes.d.ts +41 -0
- package/apps/daemon/dist/transports/http/workflowRoutes.js +473 -0
- package/apps/daemon/dist/transports/mcp/localProjectReadServer.d.ts +182 -0
- package/apps/daemon/dist/transports/mcp/localProjectReadServer.js +221 -0
- package/apps/daemon/dist/transports/native/nativeHost.d.ts +24 -0
- package/apps/daemon/dist/transports/native/nativeHost.js +344 -0
- package/apps/daemon/package.json +24 -0
- package/apps/daemon/src/runtime/benign/referenceEcho.mjs +27 -0
- package/apps/daemon/src/runtime/windows/buildSupervisor.mjs +87 -0
- package/apps/daemon/src/runtime/windows/supervisorMain.cs +676 -0
- package/apps/extension/manifest.secure.json +25 -0
- package/apps/extension/scripts/build.mjs +173 -0
- package/apps/extension/src/background/secureWorker.ts +1595 -0
- package/apps/extension/src/background/serviceWorker.ts +892 -0
- package/apps/extension/src/content/captureSelection.ts +64 -0
- package/apps/extension/src/content/secureInsert.ts +207 -0
- package/apps/extension/src/probe/index.html +41 -0
- package/apps/extension/src/probe/main.ts +201 -0
- package/apps/extension/src/sidepanel/index.html +203 -0
- package/apps/extension/src/sidepanel/main.ts +903 -0
- package/package.json +19 -3
- package/packages/contracts/dist/artifacts.d.ts +66 -0
- package/packages/contracts/dist/artifacts.js +64 -0
- package/packages/contracts/dist/automation.d.ts +540 -0
- package/packages/contracts/dist/automation.js +191 -0
- package/packages/contracts/dist/browser.d.ts +251 -0
- package/packages/contracts/dist/browser.js +131 -0
- package/packages/contracts/dist/context.d.ts +71 -0
- package/packages/contracts/dist/context.js +73 -0
- package/packages/contracts/dist/diagnostics.d.ts +99 -0
- package/packages/contracts/dist/diagnostics.js +284 -0
- package/packages/contracts/dist/effects.d.ts +42 -0
- package/packages/contracts/dist/effects.js +42 -0
- package/packages/contracts/dist/errors.d.ts +75 -0
- package/packages/contracts/dist/errors.js +70 -0
- package/packages/contracts/dist/events.d.ts +50 -0
- package/packages/contracts/dist/events.js +34 -0
- package/packages/contracts/dist/executionDiagnostics.d.ts +212 -0
- package/packages/contracts/dist/executionDiagnostics.js +101 -0
- package/packages/contracts/dist/identity.d.ts +54 -0
- package/packages/contracts/dist/identity.js +40 -0
- package/packages/contracts/dist/index.d.ts +20 -0
- package/packages/contracts/dist/index.js +20 -0
- package/packages/contracts/dist/invocation.d.ts +90 -0
- package/packages/contracts/dist/invocation.js +77 -0
- package/packages/contracts/dist/lifecycle.d.ts +130 -0
- package/packages/contracts/dist/lifecycle.js +135 -0
- package/packages/contracts/dist/plugin.d.ts +214 -0
- package/packages/contracts/dist/plugin.js +117 -0
- package/packages/contracts/dist/projectRead.d.ts +205 -0
- package/packages/contracts/dist/projectRead.js +162 -0
- package/packages/contracts/dist/secure.d.ts +128 -0
- package/packages/contracts/dist/secure.js +99 -0
- package/packages/contracts/package.json +32 -0
- package/packages/contracts/src/artifacts.ts +83 -0
- package/packages/contracts/src/automation.ts +238 -0
- package/packages/contracts/src/browser.ts +164 -0
- package/packages/contracts/src/context.ts +91 -0
- package/packages/contracts/src/diagnostics.ts +318 -0
- package/packages/contracts/src/effects.ts +49 -0
- package/packages/contracts/src/errors.ts +83 -0
- package/packages/contracts/src/events.ts +46 -0
- package/packages/contracts/src/executionDiagnostics.ts +116 -0
- package/packages/contracts/src/identity.ts +68 -0
- package/packages/contracts/src/index.ts +20 -0
- package/packages/contracts/src/invocation.ts +96 -0
- package/packages/contracts/src/lifecycle.ts +169 -0
- package/packages/contracts/src/plugin.ts +174 -0
- package/packages/contracts/src/projectRead.ts +179 -0
- package/packages/contracts/src/secure.ts +136 -0
- package/provenance.json +179 -9
- package/source.zip +0 -0
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { createHash, timingSafeEqual } from 'node:crypto';
|
|
3
|
+
import { EventEmitter } from 'node:events';
|
|
4
|
+
import { lstatSync, realpathSync, statSync } from 'node:fs';
|
|
5
|
+
import { open } from 'node:fs/promises';
|
|
6
|
+
import { dirname, isAbsolute, normalize } from 'node:path';
|
|
7
|
+
import { PassThrough } from 'node:stream';
|
|
8
|
+
/** Sanitized: only a fixed code. */
|
|
9
|
+
export class SupervisorError extends Error {
|
|
10
|
+
code;
|
|
11
|
+
constructor(code) {
|
|
12
|
+
super(code);
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.name = 'SupervisorError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export const MAX_REQUEST_BYTES = 65536;
|
|
18
|
+
export const MAX_FRAME_BYTES = 65536;
|
|
19
|
+
export const MAX_CONTROL_FRAMES = 1024;
|
|
20
|
+
const PROTOCOL_VERSION = 1;
|
|
21
|
+
const SHA256_HEX = /^[0-9a-fA-F]{64}$/;
|
|
22
|
+
const FAILURE_CODE = /^[A-Z][A-Z0-9_]{2,47}$/;
|
|
23
|
+
const BRANDED = new WeakSet();
|
|
24
|
+
export const isWindowsJobSupervisor = (v) => typeof v === 'object' && v !== null && BRANDED.has(v);
|
|
25
|
+
// ---------- frame encoding ----------
|
|
26
|
+
export function encodeFrame(type, payload) {
|
|
27
|
+
const h = Buffer.alloc(8);
|
|
28
|
+
h[0] = 0x4d;
|
|
29
|
+
h[1] = 0x43;
|
|
30
|
+
h[2] = PROTOCOL_VERSION;
|
|
31
|
+
h[3] = type.charCodeAt(0);
|
|
32
|
+
h.writeUInt32LE(payload.length, 4);
|
|
33
|
+
return Buffer.concat([h, payload]);
|
|
34
|
+
}
|
|
35
|
+
function rawField(tag, b) {
|
|
36
|
+
const h = Buffer.alloc(5);
|
|
37
|
+
h[0] = tag;
|
|
38
|
+
h.writeUInt32LE(b.length, 1);
|
|
39
|
+
return Buffer.concat([h, b]);
|
|
40
|
+
}
|
|
41
|
+
function field(tag, text) {
|
|
42
|
+
return rawField(tag, Buffer.from(text, 'utf8'));
|
|
43
|
+
}
|
|
44
|
+
/** Hard ceiling mirrored from the helper and the shared contract (STDIN_MAX_BYTES_V1). */
|
|
45
|
+
export const STDIN_MAX_BYTES = 32768;
|
|
46
|
+
export function encodeLaunchRequest(spec, identity = 'CALLER_TOKEN') {
|
|
47
|
+
const parts = [field(1, spec.exe), field(2, spec.sha256.toLowerCase()), field(3, spec.cwd)];
|
|
48
|
+
for (const a of spec.args)
|
|
49
|
+
parts.push(field(4, a));
|
|
50
|
+
for (const [k, v] of Object.entries(spec.env))
|
|
51
|
+
parts.push(field(5, `${k}=${v}`));
|
|
52
|
+
if (identity === 'RESTRICTED_LOW_INTEGRITY')
|
|
53
|
+
parts.push(field(6, identity));
|
|
54
|
+
if (spec.stdin !== undefined) {
|
|
55
|
+
if (spec.stdin.length < 1 || spec.stdin.length > STDIN_MAX_BYTES)
|
|
56
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
57
|
+
parts.push(rawField(7, spec.stdin), field(8, createHash('sha256').update(spec.stdin).digest('hex')));
|
|
58
|
+
}
|
|
59
|
+
const payload = Buffer.concat(parts);
|
|
60
|
+
if (payload.length > MAX_REQUEST_BYTES)
|
|
61
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
62
|
+
return encodeFrame('L', payload);
|
|
63
|
+
}
|
|
64
|
+
// ---------- strict text-frame schemas ----------
|
|
65
|
+
const SCHEMAS = {
|
|
66
|
+
H: ['digestPrecheck', 'shareMode'],
|
|
67
|
+
N: ['status', 'bytesExpected', 'bytesWritten', 'win32', 'eofClosed'],
|
|
68
|
+
I: ['identity', 'tokenType', 'restrictingSids', 'integrity', 'privileges', 'childTokenVerified'],
|
|
69
|
+
S: ['pid', 'createTime', 'assignedBeforeResume', 'inJobConfirmed', 'resumePrevCount', 'activeBeforeResume', 'imageVerified', 'digestPrecheck'],
|
|
70
|
+
X: ['exitCode', 'cancelled', 'ownerGone', 'protocolViolation', 'readersJoined'],
|
|
71
|
+
T: ['total', 'snapshot', 'allGone', 'activeAfter', 'waitMs', 'reason'],
|
|
72
|
+
F: ['code', 'win32'],
|
|
73
|
+
Z: ['ok'],
|
|
74
|
+
};
|
|
75
|
+
const VALUE = /^[A-Za-z0-9_-]{1,40}$/;
|
|
76
|
+
class Violation extends Error {
|
|
77
|
+
}
|
|
78
|
+
function parseKv(type, payload) {
|
|
79
|
+
const keys = SCHEMAS[type];
|
|
80
|
+
let text;
|
|
81
|
+
try {
|
|
82
|
+
text = new TextDecoder('utf-8', { fatal: true }).decode(payload);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
throw new Violation('utf8');
|
|
86
|
+
}
|
|
87
|
+
const out = new Map();
|
|
88
|
+
const lines = text.split('\n');
|
|
89
|
+
if (lines.pop() !== '')
|
|
90
|
+
throw new Violation('lines');
|
|
91
|
+
for (const line of lines) {
|
|
92
|
+
const eq = line.indexOf('=');
|
|
93
|
+
if (eq < 1)
|
|
94
|
+
throw new Violation('kv');
|
|
95
|
+
const k = line.slice(0, eq);
|
|
96
|
+
const v = line.slice(eq + 1);
|
|
97
|
+
if (!keys.includes(k) || out.has(k) || !VALUE.test(v))
|
|
98
|
+
throw new Violation('field');
|
|
99
|
+
out.set(k, v);
|
|
100
|
+
}
|
|
101
|
+
if (out.size !== keys.length)
|
|
102
|
+
throw new Violation('missing');
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
const num = (m, k) => {
|
|
106
|
+
const v = m.get(k) ?? '';
|
|
107
|
+
if (!/^[0-9]{1,15}$/.test(v))
|
|
108
|
+
throw new Violation('num');
|
|
109
|
+
return Number(v);
|
|
110
|
+
};
|
|
111
|
+
const flag = (m, k) => {
|
|
112
|
+
const v = m.get(k);
|
|
113
|
+
if (v !== '0' && v !== '1')
|
|
114
|
+
throw new Violation('flag');
|
|
115
|
+
return v === '1';
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Pure, I/O-free decoder for the helper's output stream. Everything the helper says is untrusted until it passes this
|
|
119
|
+
* state machine: header magic/version, length <= MAX_FRAME_BYTES, known frame type, strict UTF-8 key=value schemas with
|
|
120
|
+
* exactly the allowed keys, frame order, at most MAX_CONTROL_FRAMES control frames and exactly one terminal frame.
|
|
121
|
+
*/
|
|
122
|
+
export class HelperProtocolDecoder {
|
|
123
|
+
sink;
|
|
124
|
+
expectedIdentity;
|
|
125
|
+
expectedStdinBytes;
|
|
126
|
+
ev = {
|
|
127
|
+
processLaunched: false, rootExited: false, jobAssignedBeforeResume: false, knownTreeTerminatedAndChecked: false,
|
|
128
|
+
executableDigestPrechecked: false, trackedJobMembersAtTermination: null, totalProcessesEverInJob: null,
|
|
129
|
+
terminationWaitMs: null, terminationReason: null, cancelRequestedWhileRunning: false,
|
|
130
|
+
ownerLossObserved: false, helperFailureCode: null, protocol: 'OK',
|
|
131
|
+
executionIdentity: 'CALLER_TOKEN', childTokenVerified: false,
|
|
132
|
+
stdinStatus: 'NOT_REQUESTED', stdinBytesExpected: null, stdinBytesWritten: null, stdinEofClosed: false,
|
|
133
|
+
};
|
|
134
|
+
sawN = false;
|
|
135
|
+
sawI = false;
|
|
136
|
+
sawS = false;
|
|
137
|
+
sawX = false;
|
|
138
|
+
sawT = false;
|
|
139
|
+
sawZ = false;
|
|
140
|
+
sawF = false;
|
|
141
|
+
sawH = false;
|
|
142
|
+
exitCode = null;
|
|
143
|
+
cancelled = false;
|
|
144
|
+
controlFrames = 0;
|
|
145
|
+
pending = Buffer.alloc(0);
|
|
146
|
+
constructor(sink, expectedIdentity = 'CALLER_TOKEN', expectedStdinBytes = null) {
|
|
147
|
+
this.sink = sink;
|
|
148
|
+
this.expectedIdentity = expectedIdentity;
|
|
149
|
+
this.expectedStdinBytes = expectedStdinBytes;
|
|
150
|
+
this.ev.executionIdentity = expectedIdentity;
|
|
151
|
+
if (expectedStdinBytes !== null) {
|
|
152
|
+
this.ev.stdinStatus = 'NOT_ATTEMPTED';
|
|
153
|
+
this.ev.stdinBytesExpected = expectedStdinBytes;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
get pendingBytes() { return this.pending.length; }
|
|
157
|
+
feed(chunk) {
|
|
158
|
+
if (this.ev.protocol !== 'OK')
|
|
159
|
+
return;
|
|
160
|
+
this.pending = this.pending.length === 0 ? chunk : Buffer.concat([this.pending, chunk]);
|
|
161
|
+
try {
|
|
162
|
+
for (;;) {
|
|
163
|
+
if (this.pending.length < 8)
|
|
164
|
+
break;
|
|
165
|
+
if (this.pending[0] !== 0x4d || this.pending[1] !== 0x43 || this.pending[2] !== PROTOCOL_VERSION)
|
|
166
|
+
throw new Violation('header');
|
|
167
|
+
const len = this.pending.readUInt32LE(4);
|
|
168
|
+
if (len > MAX_FRAME_BYTES)
|
|
169
|
+
throw new Violation('length');
|
|
170
|
+
if (this.pending.length < 8 + len)
|
|
171
|
+
break;
|
|
172
|
+
const type = String.fromCharCode(this.pending[3]);
|
|
173
|
+
const payload = Buffer.from(this.pending.subarray(8, 8 + len));
|
|
174
|
+
this.pending = this.pending.subarray(8 + len);
|
|
175
|
+
this.frame(type, payload);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
catch (e) {
|
|
179
|
+
if (!(e instanceof Violation))
|
|
180
|
+
throw e;
|
|
181
|
+
this.ev.protocol = 'VIOLATION';
|
|
182
|
+
this.ev.knownTreeTerminatedAndChecked = false; // a stream that broke its own contract is not trusted for any positive claim
|
|
183
|
+
this.ev.childTokenVerified = false;
|
|
184
|
+
this.sink.violation('VIOLATION');
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** The helper's stdout ended. Truthfully classify a stream that stopped without a terminal frame. */
|
|
188
|
+
endOfStream() {
|
|
189
|
+
if (this.sawZ || this.ev.protocol !== 'OK')
|
|
190
|
+
return;
|
|
191
|
+
this.ev.protocol = this.pending.length > 0 ? 'TRUNCATED' : 'NO_TERMINAL_FRAME';
|
|
192
|
+
}
|
|
193
|
+
frame(type, payload) {
|
|
194
|
+
if (this.sawZ)
|
|
195
|
+
throw new Violation('after-terminal');
|
|
196
|
+
if (type !== 'O' && type !== 'E') {
|
|
197
|
+
this.controlFrames += 1;
|
|
198
|
+
if (this.controlFrames > MAX_CONTROL_FRAMES)
|
|
199
|
+
throw new Violation('control-frames');
|
|
200
|
+
}
|
|
201
|
+
const ev = this.ev;
|
|
202
|
+
switch (type) {
|
|
203
|
+
case 'H': {
|
|
204
|
+
if (this.sawH || this.sawS || this.sawF)
|
|
205
|
+
throw new Violation('order');
|
|
206
|
+
const m = parseKv('H', payload);
|
|
207
|
+
if (!flag(m, 'digestPrecheck') || m.get('shareMode') !== 'read-only')
|
|
208
|
+
throw new Violation('H');
|
|
209
|
+
this.sawH = true;
|
|
210
|
+
ev.executableDigestPrechecked = true;
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
case 'I': {
|
|
214
|
+
// Identity report: only when the trusted owner asked for the restricted identity, once, after H and before S.
|
|
215
|
+
if (this.expectedIdentity !== 'RESTRICTED_LOW_INTEGRITY' || !this.sawH || this.sawI || this.sawS || this.sawF)
|
|
216
|
+
throw new Violation('order');
|
|
217
|
+
const m = parseKv('I', payload);
|
|
218
|
+
if (m.get('identity') !== 'RESTRICTED_LOW_INTEGRITY' || m.get('tokenType') !== 'primary' || m.get('integrity') !== 'low' || m.get('restrictingSids') !== '5' || m.get('privileges') !== '1' || !flag(m, 'childTokenVerified'))
|
|
219
|
+
throw new Violation('I');
|
|
220
|
+
this.sawI = true;
|
|
221
|
+
ev.childTokenVerified = true;
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
case 'S': {
|
|
225
|
+
if (!this.sawH || this.sawS || this.sawF)
|
|
226
|
+
throw new Violation('order');
|
|
227
|
+
if (this.expectedIdentity === 'RESTRICTED_LOW_INTEGRITY' && !this.sawI)
|
|
228
|
+
throw new Violation('identity-not-verified');
|
|
229
|
+
const m = parseKv('S', payload);
|
|
230
|
+
num(m, 'pid');
|
|
231
|
+
if (!/^[0-9]{1,20}$/.test(m.get('createTime') ?? ''))
|
|
232
|
+
throw new Violation('num');
|
|
233
|
+
num(m, 'activeBeforeResume');
|
|
234
|
+
if (!flag(m, 'assignedBeforeResume') || !flag(m, 'inJobConfirmed') || !flag(m, 'imageVerified') || !flag(m, 'digestPrecheck') || num(m, 'resumePrevCount') !== 1)
|
|
235
|
+
throw new Violation('S');
|
|
236
|
+
this.sawS = true;
|
|
237
|
+
ev.processLaunched = true;
|
|
238
|
+
ev.jobAssignedBeforeResume = true;
|
|
239
|
+
this.sink.started();
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
case 'O':
|
|
243
|
+
case 'E': {
|
|
244
|
+
if (!this.sawS || this.sawX)
|
|
245
|
+
throw new Violation('order');
|
|
246
|
+
if (payload.length === 0 || payload.length > 16384)
|
|
247
|
+
throw new Violation('chunk');
|
|
248
|
+
this.sink.data(type, payload);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
case 'N': {
|
|
252
|
+
// Stdin report: only when the trusted owner asked for stdin delivery, once, after S and before X.
|
|
253
|
+
if (this.expectedStdinBytes === null || !this.sawS || this.sawX || this.sawN)
|
|
254
|
+
throw new Violation('order');
|
|
255
|
+
const m = parseKv('N', payload);
|
|
256
|
+
const status = m.get('status');
|
|
257
|
+
const expected = num(m, 'bytesExpected');
|
|
258
|
+
const written = num(m, 'bytesWritten');
|
|
259
|
+
num(m, 'win32');
|
|
260
|
+
const eof = flag(m, 'eofClosed');
|
|
261
|
+
if (expected !== this.expectedStdinBytes || written > expected)
|
|
262
|
+
throw new Violation('N');
|
|
263
|
+
if (status === 'delivered') {
|
|
264
|
+
if (written !== expected || !eof)
|
|
265
|
+
throw new Violation('N');
|
|
266
|
+
}
|
|
267
|
+
else if (status === 'early_exit' || status === 'error') {
|
|
268
|
+
if (eof)
|
|
269
|
+
throw new Violation('N');
|
|
270
|
+
}
|
|
271
|
+
else
|
|
272
|
+
throw new Violation('N');
|
|
273
|
+
this.sawN = true;
|
|
274
|
+
ev.stdinStatus = status === 'delivered' ? 'DELIVERED_EOF' : status === 'early_exit' ? 'EARLY_EXIT' : 'ERROR';
|
|
275
|
+
ev.stdinBytesWritten = written;
|
|
276
|
+
ev.stdinEofClosed = eof;
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
case 'X': {
|
|
280
|
+
if (!this.sawS || this.sawX)
|
|
281
|
+
throw new Violation('order');
|
|
282
|
+
if (this.expectedStdinBytes !== null && !this.sawN)
|
|
283
|
+
throw new Violation('stdin-not-reported');
|
|
284
|
+
const m = parseKv('X', payload);
|
|
285
|
+
this.exitCode = num(m, 'exitCode') | 0;
|
|
286
|
+
this.cancelled = flag(m, 'cancelled');
|
|
287
|
+
ev.cancelRequestedWhileRunning = this.cancelled;
|
|
288
|
+
ev.ownerLossObserved = flag(m, 'ownerGone');
|
|
289
|
+
const proto = flag(m, 'protocolViolation');
|
|
290
|
+
flag(m, 'readersJoined');
|
|
291
|
+
this.sawX = true;
|
|
292
|
+
ev.rootExited = true;
|
|
293
|
+
if (proto)
|
|
294
|
+
throw new Violation('helper-saw-bad-control-frame');
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
case 'T': {
|
|
298
|
+
if (!this.sawX || this.sawT)
|
|
299
|
+
throw new Violation('order');
|
|
300
|
+
const m = parseKv('T', payload);
|
|
301
|
+
const allGone = flag(m, 'allGone');
|
|
302
|
+
ev.totalProcessesEverInJob = num(m, 'total');
|
|
303
|
+
ev.trackedJobMembersAtTermination = num(m, 'snapshot');
|
|
304
|
+
ev.terminationWaitMs = num(m, 'waitMs');
|
|
305
|
+
const activeAfter = num(m, 'activeAfter');
|
|
306
|
+
ev.terminationReason = m.get('reason') ?? null;
|
|
307
|
+
this.sawT = true;
|
|
308
|
+
ev.knownTreeTerminatedAndChecked = allGone && activeAfter === 0 && this.sawS && ev.jobAssignedBeforeResume;
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
case 'F': {
|
|
312
|
+
if (this.sawF)
|
|
313
|
+
throw new Violation('order');
|
|
314
|
+
const m = parseKv('F', payload);
|
|
315
|
+
const code = m.get('code') ?? '';
|
|
316
|
+
if (!FAILURE_CODE.test(code))
|
|
317
|
+
throw new Violation('F');
|
|
318
|
+
num(m, 'win32');
|
|
319
|
+
this.sawF = true;
|
|
320
|
+
ev.helperFailureCode = code;
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
case 'Z': {
|
|
324
|
+
const m = parseKv('Z', payload);
|
|
325
|
+
const ok = flag(m, 'ok');
|
|
326
|
+
if (ok ? !(this.sawS && this.sawX && this.sawT && !this.sawF && (this.expectedStdinBytes === null || this.sawN)) : !this.sawF)
|
|
327
|
+
throw new Violation('Z');
|
|
328
|
+
this.sawZ = true;
|
|
329
|
+
this.sink.terminal(this.sawS);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
default: throw new Violation('type');
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
export function createWindowsJobSupervisor(config) {
|
|
337
|
+
if (process.platform !== 'win32')
|
|
338
|
+
throw new SupervisorError('UNSUPPORTED_PLATFORM');
|
|
339
|
+
if (config === null || typeof config !== 'object')
|
|
340
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
341
|
+
const { helperPath, helperSha256 } = config;
|
|
342
|
+
const identity = config.executionIdentity === undefined ? 'CALLER_TOKEN' : config.executionIdentity;
|
|
343
|
+
if (identity !== 'CALLER_TOKEN' && identity !== 'RESTRICTED_LOW_INTEGRITY')
|
|
344
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
345
|
+
if (Object.keys(config).some((k) => k !== 'helperPath' && k !== 'helperSha256' && k !== 'executionIdentity'))
|
|
346
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
347
|
+
if (typeof helperPath !== 'string' || helperPath.length === 0 || helperPath.length > 1024 || !isAbsolute(helperPath) || !/^[A-Za-z]:[\\/]/.test(helperPath) || /[\u0000-\u001f]/.test(helperPath))
|
|
348
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
349
|
+
if (typeof helperSha256 !== 'string' || !SHA256_HEX.test(helperSha256))
|
|
350
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
351
|
+
let canon;
|
|
352
|
+
try {
|
|
353
|
+
const st = lstatSync(helperPath);
|
|
354
|
+
if (st.isSymbolicLink() || !st.isFile())
|
|
355
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
356
|
+
canon = realpathSync.native(helperPath);
|
|
357
|
+
if (canon.toLowerCase() !== normalize(helperPath).toLowerCase())
|
|
358
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
359
|
+
}
|
|
360
|
+
catch (e) {
|
|
361
|
+
if (e instanceof SupervisorError)
|
|
362
|
+
throw e;
|
|
363
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
364
|
+
}
|
|
365
|
+
const expected = Buffer.from(helperSha256, 'hex');
|
|
366
|
+
const pinned = statSync(canon, { bigint: true });
|
|
367
|
+
const systemRoot = process.env.SystemRoot ?? process.env.WINDIR;
|
|
368
|
+
if (typeof systemRoot !== 'string' || !isAbsolute(systemRoot))
|
|
369
|
+
throw new SupervisorError('HELPER_CONFIG_INVALID');
|
|
370
|
+
async function verifyHelper() {
|
|
371
|
+
let fh;
|
|
372
|
+
try {
|
|
373
|
+
fh = await open(canon, 'r');
|
|
374
|
+
const before = await fh.stat({ bigint: true });
|
|
375
|
+
if (!before.isFile() || before.dev !== pinned.dev || before.ino !== pinned.ino || before.size !== pinned.size)
|
|
376
|
+
throw new SupervisorError('HELPER_UNVERIFIED');
|
|
377
|
+
const hash = createHash('sha256');
|
|
378
|
+
const buf = Buffer.allocUnsafe(1 << 16);
|
|
379
|
+
let total = 0n;
|
|
380
|
+
for (;;) {
|
|
381
|
+
const { bytesRead } = await fh.read(buf, 0, buf.length, null);
|
|
382
|
+
if (bytesRead === 0)
|
|
383
|
+
break;
|
|
384
|
+
total += BigInt(bytesRead);
|
|
385
|
+
if (total > before.size)
|
|
386
|
+
throw new SupervisorError('HELPER_UNVERIFIED');
|
|
387
|
+
hash.update(buf.subarray(0, bytesRead));
|
|
388
|
+
}
|
|
389
|
+
const after = await fh.stat({ bigint: true });
|
|
390
|
+
if (total !== before.size || after.size !== before.size || after.mtimeNs !== before.mtimeNs)
|
|
391
|
+
throw new SupervisorError('HELPER_UNVERIFIED');
|
|
392
|
+
const d = hash.digest();
|
|
393
|
+
if (d.length !== expected.length || !timingSafeEqual(d, expected))
|
|
394
|
+
throw new SupervisorError('HELPER_UNVERIFIED');
|
|
395
|
+
}
|
|
396
|
+
catch (e) {
|
|
397
|
+
if (e instanceof SupervisorError)
|
|
398
|
+
throw e;
|
|
399
|
+
throw new SupervisorError('HELPER_UNVERIFIED');
|
|
400
|
+
}
|
|
401
|
+
finally {
|
|
402
|
+
try {
|
|
403
|
+
await fh?.close();
|
|
404
|
+
}
|
|
405
|
+
catch { /* closed */ }
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
function spawnSupervised(spec) {
|
|
409
|
+
const launch = encodeLaunchRequest(spec, identity); // throws before any process exists if the request is oversize
|
|
410
|
+
const em = new EventEmitter();
|
|
411
|
+
const stdout = new PassThrough();
|
|
412
|
+
const stderr = new PassThrough();
|
|
413
|
+
em.stdout = stdout;
|
|
414
|
+
em.stderr = stderr;
|
|
415
|
+
let ended = false;
|
|
416
|
+
let killedHelper = false;
|
|
417
|
+
let cancelSent = false;
|
|
418
|
+
const helper = spawn(canon, [], {
|
|
419
|
+
cwd: dirname(canon),
|
|
420
|
+
env: { SystemRoot: systemRoot, WINDIR: systemRoot, TEMP: spec.env.TEMP ?? spec.env.temp ?? systemRoot, TMP: spec.env.TMP ?? spec.env.tmp ?? systemRoot },
|
|
421
|
+
shell: false, windowsHide: true, detached: false, stdio: ['pipe', 'pipe', 'ignore'],
|
|
422
|
+
});
|
|
423
|
+
const killHelper = () => { if (!killedHelper) {
|
|
424
|
+
killedHelper = true;
|
|
425
|
+
try {
|
|
426
|
+
helper.kill();
|
|
427
|
+
}
|
|
428
|
+
catch { /* gone */ }
|
|
429
|
+
} };
|
|
430
|
+
const finishStreams = () => {
|
|
431
|
+
if (ended)
|
|
432
|
+
return;
|
|
433
|
+
ended = true;
|
|
434
|
+
const signal = dec.cancelled ? 'SIGTERM' : null;
|
|
435
|
+
const code = dec.cancelled ? null : dec.exitCode;
|
|
436
|
+
setImmediate(() => {
|
|
437
|
+
em.emit('exit', code, signal);
|
|
438
|
+
stdout.end();
|
|
439
|
+
stderr.end();
|
|
440
|
+
setImmediate(() => em.emit('close', code, signal));
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
const failBeforeStart = () => {
|
|
444
|
+
if (ended)
|
|
445
|
+
return;
|
|
446
|
+
ended = true;
|
|
447
|
+
setImmediate(() => { em.emit('error', new Error('SUPERVISOR_LAUNCH_FAILED')); stdout.end(); stderr.end(); });
|
|
448
|
+
};
|
|
449
|
+
const dec = new HelperProtocolDecoder({
|
|
450
|
+
data: (kind, payload) => {
|
|
451
|
+
const s = kind === 'O' ? stdout : stderr;
|
|
452
|
+
const ok = s.write(payload);
|
|
453
|
+
if (!ok) {
|
|
454
|
+
helper.stdout?.pause();
|
|
455
|
+
s.once('drain', () => helper.stdout?.resume());
|
|
456
|
+
}
|
|
457
|
+
return ok;
|
|
458
|
+
},
|
|
459
|
+
started: () => { setImmediate(() => em.emit('spawn')); },
|
|
460
|
+
terminal: (launched) => { if (launched)
|
|
461
|
+
finishStreams();
|
|
462
|
+
else
|
|
463
|
+
failBeforeStart(); },
|
|
464
|
+
violation: () => killHelper(), // closing the helper closes the Job (KILL_ON_JOB_CLOSE)
|
|
465
|
+
}, identity, spec.stdin === undefined ? null : spec.stdin.length);
|
|
466
|
+
helper.stdout?.on('data', (c) => dec.feed(c));
|
|
467
|
+
helper.stdout?.on('error', () => undefined);
|
|
468
|
+
helper.stdin?.on('error', () => undefined);
|
|
469
|
+
helper.once('error', () => { dec.endOfStream(); failBeforeStart(); });
|
|
470
|
+
helper.once('close', () => {
|
|
471
|
+
dec.endOfStream();
|
|
472
|
+
if (ended || dec.sawZ)
|
|
473
|
+
return;
|
|
474
|
+
// The helper ended without a valid terminal frame. If the target had started, nothing was positively checked.
|
|
475
|
+
if (!dec.sawS)
|
|
476
|
+
failBeforeStart();
|
|
477
|
+
else
|
|
478
|
+
finishStreams();
|
|
479
|
+
});
|
|
480
|
+
try {
|
|
481
|
+
helper.stdin?.write(launch);
|
|
482
|
+
}
|
|
483
|
+
catch {
|
|
484
|
+
killHelper();
|
|
485
|
+
}
|
|
486
|
+
em.kill = (signal) => {
|
|
487
|
+
if (ended || killedHelper)
|
|
488
|
+
return false;
|
|
489
|
+
if (signal === 'SIGKILL') {
|
|
490
|
+
killHelper();
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
if (cancelSent)
|
|
494
|
+
return true;
|
|
495
|
+
cancelSent = true;
|
|
496
|
+
try {
|
|
497
|
+
helper.stdin?.write(encodeFrame('C', Buffer.alloc(0)));
|
|
498
|
+
}
|
|
499
|
+
catch { /* helper gone */ }
|
|
500
|
+
return true;
|
|
501
|
+
};
|
|
502
|
+
em.evidence = () => Object.freeze({
|
|
503
|
+
...dec.ev,
|
|
504
|
+
atomicImageIdentity: 'NOT_VERIFIED',
|
|
505
|
+
osFilesystemConfinement: 'NOT_VERIFIED',
|
|
506
|
+
privateDatabaseIsolation: 'NOT_VERIFIED',
|
|
507
|
+
});
|
|
508
|
+
Object.defineProperty(em, 'helperPid', { get: () => helper.pid });
|
|
509
|
+
return em;
|
|
510
|
+
}
|
|
511
|
+
const supervisor = Object.freeze({
|
|
512
|
+
kind: 'WINDOWS_JOB_SUPERVISOR',
|
|
513
|
+
executionIdentity: identity,
|
|
514
|
+
verifyHelper,
|
|
515
|
+
checkLaunchRequest: (spec) => { encodeLaunchRequest(spec, identity); },
|
|
516
|
+
spawn: spawnSupervised,
|
|
517
|
+
});
|
|
518
|
+
BRANDED.add(supervisor);
|
|
519
|
+
return supervisor;
|
|
520
|
+
}
|
|
521
|
+
//# sourceMappingURL=windowsJobSupervisor.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { formatDiagEvent, type DiagEventV1, type DiagLevel } from '../../../../packages/contracts/dist/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* SW-062: the daemon's single diagnostic log (C09 owns durable local state).
|
|
4
|
+
*
|
|
5
|
+
* - JSON Lines, one sanitised event per line (contracts `makeDiagEvent` is the only constructor: secrets, challenge/approval codes, prompts,
|
|
6
|
+
* conversation text, bearer tokens and filesystem paths cannot be recorded).
|
|
7
|
+
* - Lives in `<private data root>/logs/`. That directory is created INSIDE the already verified private data root, so it inherits the
|
|
8
|
+
* protected current-user + SYSTEM DACL (POSIX: 0700 dir / 0600 file). The inheritance of the logs files themselves is NOT separately verified.
|
|
9
|
+
* - Bounded: each file is capped (`maxBytes`), at most `maxFiles` files exist (daemon.log, daemon.log.1 ...), a single line is capped, and an
|
|
10
|
+
* in-memory ring of recent events serves the operator console. Oldest data is dropped, never grown.
|
|
11
|
+
* - Never throws: a logging failure must not change the outcome of a request. Failures are only counted (`writeFailures`).
|
|
12
|
+
*/
|
|
13
|
+
export declare const DIAG_LOG_DIR_NAME = "logs";
|
|
14
|
+
export declare const DIAG_LOG_FILE_NAME = "daemon.log";
|
|
15
|
+
export declare const DIAG_LOG_DEFAULT_MAX_BYTES = 1048576;
|
|
16
|
+
export declare const DIAG_LOG_DEFAULT_MAX_FILES = 4;
|
|
17
|
+
export declare const DIAG_LOG_MAX_LINE_BYTES = 2048;
|
|
18
|
+
export declare const DIAG_RING_SIZE = 200;
|
|
19
|
+
export interface DiagnosticLogOptions {
|
|
20
|
+
/** Directory that holds the log files, or undefined for memory-only (tests, or when no private data root exists). */
|
|
21
|
+
readonly dir?: string;
|
|
22
|
+
readonly maxBytes?: number;
|
|
23
|
+
readonly maxFiles?: number;
|
|
24
|
+
readonly minLevel?: DiagLevel;
|
|
25
|
+
readonly ringSize?: number;
|
|
26
|
+
readonly now?: () => number;
|
|
27
|
+
/** SW-062: base file name (default daemon.log); the native host writes native-host.log in the same private logs directory. */
|
|
28
|
+
readonly fileName?: string;
|
|
29
|
+
}
|
|
30
|
+
export type DiagFields = Partial<Pick<DiagEventV1, 'correlationId' | 'outcome' | 'elapsedMs'>> & {
|
|
31
|
+
meta?: unknown;
|
|
32
|
+
};
|
|
33
|
+
export declare class DiagnosticLog {
|
|
34
|
+
private readonly dir;
|
|
35
|
+
private readonly maxBytes;
|
|
36
|
+
private readonly maxFiles;
|
|
37
|
+
private readonly minRank;
|
|
38
|
+
private readonly ringSize;
|
|
39
|
+
private readonly now;
|
|
40
|
+
private readonly fileName;
|
|
41
|
+
private readonly ring;
|
|
42
|
+
private size;
|
|
43
|
+
writeFailures: number;
|
|
44
|
+
constructor(opts?: DiagnosticLogOptions);
|
|
45
|
+
get filePath(): string | undefined;
|
|
46
|
+
private file;
|
|
47
|
+
log(level: DiagLevel, component: DiagEventV1['component'], operation: string, event: string, f?: DiagFields): DiagEventV1;
|
|
48
|
+
debug(c: DiagEventV1['component'], op: string, ev: string, f?: DiagFields): DiagEventV1;
|
|
49
|
+
info(c: DiagEventV1['component'], op: string, ev: string, f?: DiagFields): DiagEventV1;
|
|
50
|
+
warn(c: DiagEventV1['component'], op: string, ev: string, f?: DiagFields): DiagEventV1;
|
|
51
|
+
error(c: DiagEventV1['component'], op: string, ev: string, f?: DiagFields): DiagEventV1;
|
|
52
|
+
recent(n?: number, correlationId?: string): readonly DiagEventV1[];
|
|
53
|
+
/** SW-097 allowlisted daemon lifecycle only, replayed from the existing rotated log.
|
|
54
|
+
* No request, project, metadata, path or log body crosses this boundary. */
|
|
55
|
+
lifecycleHistory(): {
|
|
56
|
+
ts: string;
|
|
57
|
+
event: string;
|
|
58
|
+
}[];
|
|
59
|
+
private append;
|
|
60
|
+
private rotate;
|
|
61
|
+
}
|
|
62
|
+
export declare const formatDiagLine: typeof formatDiagEvent;
|
|
63
|
+
//# sourceMappingURL=diagnosticLog.d.ts.map
|