dsh-agy-cli 0.0.0-stage → 0.12.1
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 +31 -0
- package/README.en.md +48 -0
- package/README.md +67 -2
- package/agents/dsh-agy-image-view.md +17 -0
- package/agents/dsh-agy-mcp-executor.md +32 -0
- package/agents/dsh-agy-read-only.md +20 -0
- package/agents/dsh-agy-tool-free.md +16 -0
- package/agents/dsh-agy-workspace-write.md +23 -0
- package/bin/dsh-agy-cli.js +9 -0
- package/bin/win32-x64/agy-launcher.exe +0 -0
- package/cordis.patch.yml +16 -0
- package/dist/client.js +4259 -0
- package/lib/agent-installer.d.ts +66 -0
- package/lib/agent-installer.js +147 -0
- package/lib/agent-presets.d.ts +42 -0
- package/lib/agent-presets.js +130 -0
- package/lib/agents-cli.d.ts +3 -0
- package/lib/agents-cli.js +110 -0
- package/lib/agy/diagnostics.d.ts +29 -0
- package/lib/agy/diagnostics.js +109 -0
- package/lib/agy/errors.d.ts +20 -0
- package/lib/agy/errors.js +77 -0
- package/lib/agy/experimental-transport.d.ts +79 -0
- package/lib/agy/experimental-transport.js +612 -0
- package/lib/agy/keepalive.d.ts +140 -0
- package/lib/agy/keepalive.js +445 -0
- package/lib/agy/limiter.d.ts +32 -0
- package/lib/agy/limiter.js +111 -0
- package/lib/agy/log.d.ts +214 -0
- package/lib/agy/log.js +503 -0
- package/lib/agy/models.d.ts +49 -0
- package/lib/agy/models.js +203 -0
- package/lib/agy/overrides.d.ts +17 -0
- package/lib/agy/overrides.js +73 -0
- package/lib/agy/parser.d.ts +102 -0
- package/lib/agy/parser.js +492 -0
- package/lib/agy/persistent-transport.d.ts +101 -0
- package/lib/agy/persistent-transport.js +753 -0
- package/lib/agy/process.d.ts +144 -0
- package/lib/agy/process.js +452 -0
- package/lib/agy/redact.d.ts +3 -0
- package/lib/agy/redact.js +24 -0
- package/lib/agy/stream-protocol.d.ts +50 -0
- package/lib/agy/stream-protocol.js +156 -0
- package/lib/agy/windows-launcher.d.ts +21 -0
- package/lib/agy/windows-launcher.js +76 -0
- package/lib/diagnostics.d.ts +78 -0
- package/lib/diagnostics.js +162 -0
- package/lib/doctor.d.ts +138 -0
- package/lib/doctor.js +940 -0
- package/lib/dsh/context.d.ts +133 -0
- package/lib/dsh/context.js +352 -0
- package/lib/dsh-home.d.ts +6 -0
- package/lib/dsh-home.js +11 -0
- package/lib/index.d.ts +54 -0
- package/lib/index.js +267 -0
- package/lib/mcp/agy-registration.d.ts +70 -0
- package/lib/mcp/agy-registration.js +245 -0
- package/lib/mcp/bridge.d.ts +73 -0
- package/lib/mcp/bridge.js +295 -0
- package/lib/mcp/endpoint.d.ts +41 -0
- package/lib/mcp/endpoint.js +142 -0
- package/lib/mcp/protocol.d.ts +107 -0
- package/lib/mcp/protocol.js +197 -0
- package/lib/mcp/tool-projection.d.ts +64 -0
- package/lib/mcp/tool-projection.js +168 -0
- package/lib/provider/agy.d.ts +153 -0
- package/lib/provider/agy.js +2159 -0
- package/lib/provider/config.d.ts +226 -0
- package/lib/provider/config.js +294 -0
- package/lib/provider/error-codes.d.ts +22 -0
- package/lib/provider/error-codes.js +29 -0
- package/lib/provider/image-bridge.d.ts +60 -0
- package/lib/provider/image-bridge.js +290 -0
- package/lib/provider/mock.d.ts +15 -0
- package/lib/provider/mock.js +78 -0
- package/lib/provider/prompt-budget.d.ts +45 -0
- package/lib/provider/prompt-budget.js +596 -0
- package/lib/provider/serialize.d.ts +15 -0
- package/lib/provider/serialize.js +82 -0
- package/lib/provider/tool-protocol.d.ts +80 -0
- package/lib/provider/tool-protocol.js +848 -0
- package/lib/provider/tool-schema-file.d.ts +11 -0
- package/lib/provider/tool-schema-file.js +27 -0
- package/lib/session/file-store.d.ts +56 -0
- package/lib/session/file-store.js +186 -0
- package/lib/session/store.d.ts +49 -0
- package/lib/session/store.js +62 -0
- package/lib/web/router.d.ts +19 -0
- package/lib/web/router.js +994 -0
- package/package.json +115 -4
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export class AgyQueueError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
constructor(message, code, options) {
|
|
4
|
+
super(message, options);
|
|
5
|
+
this.code = code;
|
|
6
|
+
this.name = 'AgyQueueError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function validateInteger(name, value, minimum, maximum) {
|
|
10
|
+
if (!Number.isInteger(value) || value < minimum || value > maximum) {
|
|
11
|
+
throw new RangeError(`${name} must be an integer between ${minimum} and ${maximum}`);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
/** FIFO limiter for AGY child processes, with bounded queue and cancellation. */
|
|
16
|
+
export class AgyConcurrencyLimiter {
|
|
17
|
+
maxConcurrent;
|
|
18
|
+
maxQueue;
|
|
19
|
+
queueTimeoutMs;
|
|
20
|
+
active = 0;
|
|
21
|
+
queue = [];
|
|
22
|
+
constructor(options) {
|
|
23
|
+
this.maxConcurrent = validateInteger('maxConcurrent', options.maxConcurrent, 1, 64);
|
|
24
|
+
this.maxQueue = validateInteger('maxQueue', options.maxQueue, 0, 256);
|
|
25
|
+
this.queueTimeoutMs = validateInteger('queueTimeoutMs', options.queueTimeoutMs, 0, 3_600_000);
|
|
26
|
+
}
|
|
27
|
+
getStats() {
|
|
28
|
+
return {
|
|
29
|
+
active: this.active,
|
|
30
|
+
queued: this.queue.length,
|
|
31
|
+
maxConcurrent: this.maxConcurrent,
|
|
32
|
+
maxQueue: this.maxQueue,
|
|
33
|
+
queueTimeoutMs: this.queueTimeoutMs,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
acquire(signal) {
|
|
37
|
+
if (signal?.aborted) {
|
|
38
|
+
return Promise.reject(new AgyQueueError('AGY request aborted while waiting for a process slot', 'ABORTED'));
|
|
39
|
+
}
|
|
40
|
+
if (this.active < this.maxConcurrent) {
|
|
41
|
+
this.active += 1;
|
|
42
|
+
return Promise.resolve(this.createRelease());
|
|
43
|
+
}
|
|
44
|
+
if (this.queue.length >= this.maxQueue) {
|
|
45
|
+
return Promise.reject(new AgyQueueError('AGY process queue is full', 'QUEUE_FULL'));
|
|
46
|
+
}
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
const entry = {
|
|
49
|
+
resolve,
|
|
50
|
+
reject,
|
|
51
|
+
signal,
|
|
52
|
+
onAbort: () => this.rejectEntry(entry, new AgyQueueError('AGY request aborted while waiting for a process slot', 'ABORTED')),
|
|
53
|
+
timer: undefined,
|
|
54
|
+
settled: false,
|
|
55
|
+
};
|
|
56
|
+
if (this.queueTimeoutMs > 0) {
|
|
57
|
+
entry.timer = setTimeout(() => this.rejectEntry(entry, new AgyQueueError('AGY request exceeded the process queue timeout', 'QUEUE_TIMEOUT')), this.queueTimeoutMs);
|
|
58
|
+
}
|
|
59
|
+
signal?.addEventListener('abort', entry.onAbort, { once: true });
|
|
60
|
+
this.queue.push(entry);
|
|
61
|
+
this.drain();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
createRelease() {
|
|
65
|
+
let released = false;
|
|
66
|
+
return () => {
|
|
67
|
+
if (released)
|
|
68
|
+
return;
|
|
69
|
+
released = true;
|
|
70
|
+
this.active -= 1;
|
|
71
|
+
this.drain();
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
rejectEntry(entry, error) {
|
|
75
|
+
if (entry.settled)
|
|
76
|
+
return;
|
|
77
|
+
const index = this.queue.indexOf(entry);
|
|
78
|
+
if (index >= 0)
|
|
79
|
+
this.queue.splice(index, 1);
|
|
80
|
+
entry.settled = true;
|
|
81
|
+
if (entry.timer !== undefined)
|
|
82
|
+
clearTimeout(entry.timer);
|
|
83
|
+
entry.signal?.removeEventListener('abort', entry.onAbort);
|
|
84
|
+
entry.reject(error);
|
|
85
|
+
}
|
|
86
|
+
resolveEntry(entry) {
|
|
87
|
+
if (entry.settled)
|
|
88
|
+
return;
|
|
89
|
+
entry.settled = true;
|
|
90
|
+
if (entry.timer !== undefined)
|
|
91
|
+
clearTimeout(entry.timer);
|
|
92
|
+
entry.signal?.removeEventListener('abort', entry.onAbort);
|
|
93
|
+
this.active += 1;
|
|
94
|
+
entry.resolve(this.createRelease());
|
|
95
|
+
}
|
|
96
|
+
drain() {
|
|
97
|
+
while (this.active < this.maxConcurrent && this.queue.length > 0) {
|
|
98
|
+
const entry = this.queue.shift();
|
|
99
|
+
if (entry === undefined)
|
|
100
|
+
return;
|
|
101
|
+
if (entry.settled)
|
|
102
|
+
continue;
|
|
103
|
+
if (entry.signal?.aborted) {
|
|
104
|
+
this.rejectEntry(entry, new AgyQueueError('AGY request aborted while waiting for a process slot', 'ABORTED'));
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
this.resolveEntry(entry);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=limiter.js.map
|
package/lib/agy/log.d.ts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { type AgyProcessDiagnostic, type AgyReasoningEffort, type ProcessResult, type ProcessTermination } from './process.js';
|
|
2
|
+
import { type AgyToolEventDiagnostic, type AgyEventCategoryCounts, type AgyToolEventKind } from './parser.js';
|
|
3
|
+
import type { ToolPolicy } from '../provider/config.js';
|
|
4
|
+
import type { TokenUsage } from '@deepseek-ai/dsh-llm';
|
|
5
|
+
import { type ModelDiscoveryErrorCode } from '../provider/error-codes.js';
|
|
6
|
+
import type { ModelDiscoverySource } from './models.js';
|
|
7
|
+
import type { ToolProtocolArgumentIssue, ToolProtocolCompatibility } from '../provider/tool-protocol.js';
|
|
8
|
+
export type AgyModelDiscoveryLogSource = 'static' | ModelDiscoverySource;
|
|
9
|
+
export type AgyPermissionPreset = 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
10
|
+
export type AgySandboxMode = AgyPermissionPreset;
|
|
11
|
+
export type AgyApprovalPolicy = 'ask' | 'never';
|
|
12
|
+
export type AgyBridgeOutcome = 'text-only' | 'mcp-tools' | 'dsh-pending' | 'dsh-message' | 'dsh-tool-call' | 'agy-owned' | 'context-rejected' | 'schema-rejected' | 'protocol-rejected' | 'agy-internal-tool' | 'permission-required' | 'failed';
|
|
13
|
+
export type AgyRequestMode = 'full' | 'bootstrap' | 'delta' | 'full-fallback';
|
|
14
|
+
export type AgyDispatchKind = 'cold' | 'persistent';
|
|
15
|
+
export type AgyUsageSource = 'step' | 'result-fallback';
|
|
16
|
+
export type AgyCarrierValidation = 'recipient-rejected' | 'valid-message' | 'valid-tool-call' | 'invalid-envelope' | 'unknown-tool' | 'arguments-invalid' | 'response-limit';
|
|
17
|
+
/** Safe, fixed labels for a rejected DSH-owned final response. */
|
|
18
|
+
export type AgyProtocolFailureDetail = 'not-json' | 'envelope' | 'message-shape' | 'tool-call-shape' | 'response-limit' | 'validation' | 'unknown';
|
|
19
|
+
export type AgyProtocolArgumentIssue = ToolProtocolArgumentIssue;
|
|
20
|
+
/** Safe shape labels; the response body is intentionally never logged. */
|
|
21
|
+
export type AgyProtocolResponseShape = 'empty' | 'object-like' | 'array-like' | 'fenced' | 'plain-text' | 'non-string';
|
|
22
|
+
export type AgyLogEvent = 'agy.request.started' | 'agy.request.completed' | 'agy.request.failed';
|
|
23
|
+
export interface AgyLogRecord {
|
|
24
|
+
event: AgyLogEvent;
|
|
25
|
+
requestId: string;
|
|
26
|
+
provider: string;
|
|
27
|
+
model: string;
|
|
28
|
+
agent: string;
|
|
29
|
+
toolPolicy: ToolPolicy;
|
|
30
|
+
toolSchemaCount: number;
|
|
31
|
+
toolCallCount: number;
|
|
32
|
+
bridgeOutcome: AgyBridgeOutcome;
|
|
33
|
+
permissionPreset?: AgyPermissionPreset;
|
|
34
|
+
sandboxMode?: AgySandboxMode;
|
|
35
|
+
approvalPolicy?: AgyApprovalPolicy;
|
|
36
|
+
reasoningEffort?: AgyReasoningEffort;
|
|
37
|
+
purpose?: 'compaction' | 'session-title';
|
|
38
|
+
modelDiscoverySource?: AgyModelDiscoveryLogSource;
|
|
39
|
+
modelDiscoveryWarningCode?: ModelDiscoveryErrorCode;
|
|
40
|
+
attempt: number;
|
|
41
|
+
processAttemptCount?: number;
|
|
42
|
+
retryMaxRetries?: number;
|
|
43
|
+
inputFrameBytes?: number;
|
|
44
|
+
inputFrameLimitBytes?: number;
|
|
45
|
+
promptBytes?: number;
|
|
46
|
+
promptLimitBytes?: number;
|
|
47
|
+
toolResultCount?: number;
|
|
48
|
+
largestToolResultBytes?: number;
|
|
49
|
+
truncatedToolResultCount?: number;
|
|
50
|
+
historyCompacted?: boolean;
|
|
51
|
+
omittedMessageCount?: number;
|
|
52
|
+
toolEventKind?: AgyToolEventKind;
|
|
53
|
+
toolEventStreamIndex?: number;
|
|
54
|
+
toolEventDiagnostic?: AgyToolEventDiagnostic;
|
|
55
|
+
/** True when the wrapper was intentionally aborted after a validated carrier was captured. */
|
|
56
|
+
carrierAbortExpected?: boolean;
|
|
57
|
+
carrierValidation?: AgyCarrierValidation;
|
|
58
|
+
protocolRepairAttempts?: number;
|
|
59
|
+
protocolRepairReason?: 'not-json' | 'arguments-invalid' | 'internal-tool-event';
|
|
60
|
+
protocolFailureDetail?: AgyProtocolFailureDetail;
|
|
61
|
+
protocolResponseShape?: AgyProtocolResponseShape;
|
|
62
|
+
protocolResponseBytes?: number;
|
|
63
|
+
protocolToolName?: string;
|
|
64
|
+
protocolArgumentIssue?: AgyProtocolArgumentIssue;
|
|
65
|
+
protocolMissingRequiredKeys?: readonly string[];
|
|
66
|
+
protocolReceivedArgumentKeys?: readonly string[];
|
|
67
|
+
protocolCompatibilityApplied?: ToolProtocolCompatibility;
|
|
68
|
+
eventCount: number;
|
|
69
|
+
toolEventCount: number;
|
|
70
|
+
permissionEventCount: number;
|
|
71
|
+
eventCategoryCounts: Readonly<AgyEventCategoryCounts>;
|
|
72
|
+
/**
|
|
73
|
+
* Which AGY process served the attempt: `persistent` reuses a warm worker for
|
|
74
|
+
* this DSH session, `cold` spawned a fresh AGY process. The two paths differ by
|
|
75
|
+
* AGY's whole startup cost (process spawn, auth, MCP handshake), so every
|
|
76
|
+
* latency field below is meaningless without this marker.
|
|
77
|
+
*/
|
|
78
|
+
dispatch?: AgyDispatchKind;
|
|
79
|
+
/** Milliseconds from process start to the first parsed AGY event. */
|
|
80
|
+
firstEventMs?: number;
|
|
81
|
+
/** Milliseconds from process start to the first streamed text delta. */
|
|
82
|
+
firstTextMs?: number;
|
|
83
|
+
finalStatus?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Raw JSON of AGY's own `result` frame, bounded to the fields that explain a
|
|
86
|
+
* non-SUCCESS ending. `status: "ERROR"` alone carries no diagnosis, and AGY
|
|
87
|
+
* omits `error` on the long-context failures this adapter sees, so the whole
|
|
88
|
+
* frame is the only place its explanation can live.
|
|
89
|
+
*/
|
|
90
|
+
finalResultRaw?: string;
|
|
91
|
+
sessionId?: string;
|
|
92
|
+
conversationId?: string;
|
|
93
|
+
durationMs?: number;
|
|
94
|
+
exitCode?: number | null;
|
|
95
|
+
termination?: ProcessTermination;
|
|
96
|
+
queueWaitMs?: number;
|
|
97
|
+
usage?: TokenUsage;
|
|
98
|
+
/** Current physical-turn usage selected from the latest step event. */
|
|
99
|
+
usageSource?: AgyUsageSource;
|
|
100
|
+
/** AGY result usage is conversation-cumulative and is telemetry only. */
|
|
101
|
+
cumulativeUsage?: TokenUsage;
|
|
102
|
+
cacheHit?: boolean;
|
|
103
|
+
cacheTokenShare?: number;
|
|
104
|
+
requestMode?: AgyRequestMode;
|
|
105
|
+
conversationReused?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* A persistent worker came up with a different conversation than the stored
|
|
108
|
+
* binding, so the binding was dropped and the turn resent from full history.
|
|
109
|
+
*/
|
|
110
|
+
conversationMismatch?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* AGY closed the turn with `status: ERROR` after text had already streamed.
|
|
113
|
+
* The partial text was delivered and the failure was kept as a reasoning
|
|
114
|
+
* annotation instead of being thrown away with the whole turn.
|
|
115
|
+
*/
|
|
116
|
+
partialAnswerDelivered?: boolean;
|
|
117
|
+
stablePrefixBytes?: number;
|
|
118
|
+
stablePrefixHash?: string;
|
|
119
|
+
toolSchemaHash?: string;
|
|
120
|
+
/** Session/conversation identifiers are represented only by one-way fingerprints. */
|
|
121
|
+
sessionFingerprint?: string;
|
|
122
|
+
conversationFingerprint?: string;
|
|
123
|
+
processDiagnostic?: AgyProcessDiagnostic;
|
|
124
|
+
errorCode?: string;
|
|
125
|
+
}
|
|
126
|
+
export type AgyLogger = (record: Readonly<AgyLogRecord>) => void;
|
|
127
|
+
/**
|
|
128
|
+
* Temporary test-observability sink. The caller must pass an already
|
|
129
|
+
* sanitized record; this file is intentionally outside the DSH session store
|
|
130
|
+
* because that store currently drops Error.cause and nested diagnostics.
|
|
131
|
+
*/
|
|
132
|
+
export declare const AGY_DIAGNOSTIC_LOG_PATH: string;
|
|
133
|
+
export declare function appendAgyDiagnosticRecord(record: Readonly<AgyLogRecord>): void;
|
|
134
|
+
/** Mutable request counters kept separate from the public log shape. */
|
|
135
|
+
export interface AgyTelemetry {
|
|
136
|
+
readonly requestId: string;
|
|
137
|
+
readonly provider: string;
|
|
138
|
+
readonly model: string;
|
|
139
|
+
readonly agent: string;
|
|
140
|
+
readonly toolPolicy: ToolPolicy;
|
|
141
|
+
readonly toolSchemaCount: number;
|
|
142
|
+
toolCallCount: number;
|
|
143
|
+
bridgeOutcome: AgyBridgeOutcome;
|
|
144
|
+
permissionPreset?: AgyPermissionPreset;
|
|
145
|
+
sandboxMode?: AgySandboxMode;
|
|
146
|
+
approvalPolicy?: AgyApprovalPolicy;
|
|
147
|
+
readonly reasoningEffort?: AgyReasoningEffort;
|
|
148
|
+
readonly purpose?: 'compaction' | 'session-title';
|
|
149
|
+
readonly modelDiscoverySource?: AgyModelDiscoveryLogSource;
|
|
150
|
+
readonly modelDiscoveryWarningCode?: ModelDiscoveryErrorCode;
|
|
151
|
+
readonly sessionId: string | undefined;
|
|
152
|
+
readonly startedAt: number;
|
|
153
|
+
durationMs: number | undefined;
|
|
154
|
+
attempt: number;
|
|
155
|
+
processAttemptCount: number;
|
|
156
|
+
retryMaxRetries: number;
|
|
157
|
+
inputFrameBytes: number | undefined;
|
|
158
|
+
inputFrameLimitBytes: number | undefined;
|
|
159
|
+
promptBytes: number | undefined;
|
|
160
|
+
promptLimitBytes: number | undefined;
|
|
161
|
+
toolResultCount: number | undefined;
|
|
162
|
+
largestToolResultBytes: number | undefined;
|
|
163
|
+
truncatedToolResultCount: number | undefined;
|
|
164
|
+
historyCompacted: boolean;
|
|
165
|
+
omittedMessageCount: number;
|
|
166
|
+
toolEventKind: AgyToolEventKind | undefined;
|
|
167
|
+
toolEventStreamIndex: number | undefined;
|
|
168
|
+
toolEventDiagnostic: AgyToolEventDiagnostic | undefined;
|
|
169
|
+
carrierAbortExpected: boolean;
|
|
170
|
+
carrierValidation: AgyCarrierValidation | undefined;
|
|
171
|
+
protocolRepairAttempts: number;
|
|
172
|
+
protocolRepairReason: 'not-json' | 'arguments-invalid' | 'internal-tool-event' | undefined;
|
|
173
|
+
protocolFailureDetail: AgyProtocolFailureDetail | undefined;
|
|
174
|
+
protocolResponseShape: AgyProtocolResponseShape | undefined;
|
|
175
|
+
protocolResponseBytes: number | undefined;
|
|
176
|
+
protocolToolName: string | undefined;
|
|
177
|
+
protocolArgumentIssue: AgyProtocolArgumentIssue | undefined;
|
|
178
|
+
protocolMissingRequiredKeys: readonly string[] | undefined;
|
|
179
|
+
protocolReceivedArgumentKeys: readonly string[] | undefined;
|
|
180
|
+
protocolCompatibilityApplied: ToolProtocolCompatibility | undefined;
|
|
181
|
+
eventCount: number;
|
|
182
|
+
toolEventCount: number;
|
|
183
|
+
permissionEventCount: number;
|
|
184
|
+
eventCategoryCounts: AgyEventCategoryCounts;
|
|
185
|
+
dispatch: AgyDispatchKind | undefined;
|
|
186
|
+
firstEventMs: number | undefined;
|
|
187
|
+
firstTextMs: number | undefined;
|
|
188
|
+
finalStatus: string | undefined;
|
|
189
|
+
finalResultRaw: string | undefined;
|
|
190
|
+
conversationId: string | undefined;
|
|
191
|
+
queueWaitMs: number | undefined;
|
|
192
|
+
process: ProcessResult | undefined;
|
|
193
|
+
usage: TokenUsage | undefined;
|
|
194
|
+
usageSource: AgyUsageSource | undefined;
|
|
195
|
+
cumulativeUsage: TokenUsage | undefined;
|
|
196
|
+
cacheHit: boolean | undefined;
|
|
197
|
+
cacheTokenShare: number | undefined;
|
|
198
|
+
requestMode: AgyRequestMode | undefined;
|
|
199
|
+
conversationReused: boolean | undefined;
|
|
200
|
+
/** A persistent worker could not continue the stored conversation; binding dropped, resent from full history. */
|
|
201
|
+
conversationMismatch: boolean | undefined;
|
|
202
|
+
/** A failed AGY turn still delivered the text it had already streamed. */
|
|
203
|
+
partialAnswerDelivered: boolean | undefined;
|
|
204
|
+
stablePrefixBytes: number | undefined;
|
|
205
|
+
stablePrefixHash: string | undefined;
|
|
206
|
+
toolSchemaHash: string | undefined;
|
|
207
|
+
processDiagnostic: AgyProcessDiagnostic | undefined;
|
|
208
|
+
}
|
|
209
|
+
/** Build a whitelist-only record; prompt, stderr, env and executable are absent by design. */
|
|
210
|
+
export declare function buildAgyLogRecord(telemetry: AgyTelemetry, event: AgyLogEvent, errorCode?: string): AgyLogRecord;
|
|
211
|
+
/** Apply a final whitelist-only safety pass before the host logger receives metadata. */
|
|
212
|
+
export declare function sanitizeAgyLogRecord(record: AgyLogRecord): AgyLogRecord;
|
|
213
|
+
export declare function emitAgyLog(logger: AgyLogger | undefined, record: AgyLogRecord): void;
|
|
214
|
+
//# sourceMappingURL=log.d.ts.map
|