@xenosystem/agent-sdk 0.9.26 → 0.9.28
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/THIRD_PARTY_NOTICES.md +89 -0
- package/dist/artifacts/index.cjs +6 -6
- package/dist/artifacts/index.js +6 -6
- package/dist/artifacts/metafile-cjs.json +1 -1
- package/dist/artifacts/metafile-esm.json +1 -1
- package/dist/automation/index.cjs +1 -1
- package/dist/automation/index.js +1 -1
- package/dist/automation/metafile-cjs.json +1 -1
- package/dist/automation/metafile-esm.json +1 -1
- package/dist/control-plane/index.cjs +7 -7
- package/dist/control-plane/index.js +7 -7
- package/dist/control-plane/metafile-cjs.json +1 -1
- package/dist/control-plane/metafile-esm.json +1 -1
- package/dist/control-room/index.cjs +1 -1
- package/dist/control-room/index.d.cts +2 -1
- package/dist/control-room/index.d.ts +2 -1
- package/dist/control-room/index.js +1 -1
- package/dist/control-room/metafile-cjs.json +1 -1
- package/dist/control-room/metafile-esm.json +1 -1
- package/dist/coordination/index.cjs +2 -2
- package/dist/coordination/index.d.cts +70 -4
- package/dist/coordination/index.d.ts +70 -4
- package/dist/coordination/index.js +2 -2
- package/dist/coordination/metafile-cjs.json +1 -1
- package/dist/coordination/metafile-esm.json +1 -1
- package/dist/electron/index.cjs +151 -151
- package/dist/electron/index.d.cts +81 -0
- package/dist/electron/index.d.ts +81 -0
- package/dist/electron/index.js +153 -153
- package/dist/electron/metafile-cjs.json +1 -1
- package/dist/electron/metafile-esm.json +1 -1
- package/dist/hosted/metafile-cjs.json +1 -1
- package/dist/hosted/metafile-esm.json +1 -1
- package/dist/index.cjs +334 -334
- package/dist/index.d.cts +542 -364
- package/dist/index.d.ts +542 -364
- package/dist/index.js +331 -331
- package/dist/mcp/index.cjs +19 -19
- package/dist/mcp/index.d.cts +2 -1
- package/dist/mcp/index.d.ts +2 -1
- package/dist/mcp/index.js +16 -16
- package/dist/mcp/metafile-cjs.json +1 -1
- package/dist/mcp/metafile-esm.json +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/providers/index.cjs +10 -10
- package/dist/providers/index.d.cts +15 -1
- package/dist/providers/index.d.ts +15 -1
- package/dist/providers/index.js +10 -10
- package/dist/providers/metafile-cjs.json +1 -1
- package/dist/providers/metafile-esm.json +1 -1
- package/dist/recipes/index.cjs +1 -1
- package/dist/recipes/index.js +2 -2
- package/dist/recipes/metafile-cjs.json +1 -1
- package/dist/recipes/metafile-esm.json +1 -1
- package/dist/research/metafile-cjs.json +1 -1
- package/dist/research/metafile-esm.json +1 -1
- package/dist/session/index.cjs +24 -24
- package/dist/session/index.d.cts +49 -1
- package/dist/session/index.d.ts +49 -1
- package/dist/session/index.js +24 -24
- package/dist/session/metafile-cjs.json +1 -1
- package/dist/session/metafile-esm.json +1 -1
- package/package.json +2 -1
|
@@ -394,6 +394,7 @@ interface SessionMeta {
|
|
|
394
394
|
lastActivity: string;
|
|
395
395
|
workingDirectory: string;
|
|
396
396
|
model: string;
|
|
397
|
+
executionMode?: ExecutionMode;
|
|
397
398
|
parentSession?: string;
|
|
398
399
|
checkpoints: string[];
|
|
399
400
|
messageCount: number;
|
|
@@ -1100,6 +1101,54 @@ declare class AuditLogger {
|
|
|
1100
1101
|
exportJson(targetPath: string): Promise<number>;
|
|
1101
1102
|
flush(): Promise<void>;
|
|
1102
1103
|
}
|
|
1104
|
+
interface ToolContinuationGoal {
|
|
1105
|
+
sessionId: string;
|
|
1106
|
+
goalId: string;
|
|
1107
|
+
requestId: string;
|
|
1108
|
+
}
|
|
1109
|
+
interface TranscriptBytePageOptions {
|
|
1110
|
+
cursor?: string;
|
|
1111
|
+
maxBytes?: number;
|
|
1112
|
+
direction?: "forward" | "backward";
|
|
1113
|
+
}
|
|
1114
|
+
interface TranscriptBytePage {
|
|
1115
|
+
encoding: "base64";
|
|
1116
|
+
content: string;
|
|
1117
|
+
direction: "forward" | "backward";
|
|
1118
|
+
offset: number;
|
|
1119
|
+
bytesRead: number;
|
|
1120
|
+
totalBytes: number;
|
|
1121
|
+
transcriptVersion: string;
|
|
1122
|
+
nextCursor: string | null;
|
|
1123
|
+
}
|
|
1124
|
+
interface TranscriptRecordPageOptions {
|
|
1125
|
+
cursor?: string;
|
|
1126
|
+
maxBytes?: number;
|
|
1127
|
+
maxRecords?: number;
|
|
1128
|
+
}
|
|
1129
|
+
interface TranscriptPageRecord {
|
|
1130
|
+
offset: number;
|
|
1131
|
+
bytes: number;
|
|
1132
|
+
event: Readonly<Record<string, unknown>> & {
|
|
1133
|
+
id: string;
|
|
1134
|
+
timestamp: string;
|
|
1135
|
+
type: string;
|
|
1136
|
+
sequence: number;
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
interface TranscriptRecordPage {
|
|
1140
|
+
cursor: string;
|
|
1141
|
+
records: TranscriptPageRecord[];
|
|
1142
|
+
issues: Array<{
|
|
1143
|
+
code: "invalid_record" | "record_exceeds_page_budget";
|
|
1144
|
+
offset: number;
|
|
1145
|
+
bytes: number;
|
|
1146
|
+
}>;
|
|
1147
|
+
bytesRead: number;
|
|
1148
|
+
totalBytes: number;
|
|
1149
|
+
transcriptVersion: string;
|
|
1150
|
+
nextCursor: string | null;
|
|
1151
|
+
}
|
|
1103
1152
|
declare class TranscriptWriter {
|
|
1104
1153
|
private sessionDir;
|
|
1105
1154
|
private sessionId;
|
|
@@ -1121,6 +1170,8 @@ declare class TranscriptWriter {
|
|
|
1121
1170
|
private resolveWorkspaceMarkdownPath;
|
|
1122
1171
|
private appendMarkdownEvent;
|
|
1123
1172
|
private buildMarkdownDocument;
|
|
1173
|
+
readBytePage(options?: TranscriptBytePageOptions): Promise<TranscriptBytePage | null>;
|
|
1174
|
+
readRecordPage(options?: TranscriptRecordPageOptions): Promise<TranscriptRecordPage | null>;
|
|
1124
1175
|
read(options?: {
|
|
1125
1176
|
types?: TranscriptEventType[];
|
|
1126
1177
|
limit?: number;
|
|
@@ -1173,6 +1224,7 @@ interface SessionCreateOptions {
|
|
|
1173
1224
|
parentSession?: string;
|
|
1174
1225
|
workingDirectory: string;
|
|
1175
1226
|
model: string;
|
|
1227
|
+
executionMode?: ExecutionMode;
|
|
1176
1228
|
hostBinding?: AgentSessionHostBindingV1;
|
|
1177
1229
|
}
|
|
1178
1230
|
interface SessionResumeOptions {
|
|
@@ -1270,6 +1322,23 @@ interface CompletionGuard {
|
|
|
1270
1322
|
evaluate(ctx: CompletionGuardEvaluationContext): CompletionGuardDecision | null | undefined | Promise<CompletionGuardDecision | null | undefined>;
|
|
1271
1323
|
}
|
|
1272
1324
|
type CompressionLLMFn = (systemPrompt: string, messages: Message[]) => Promise<string>;
|
|
1325
|
+
interface ModelWorkRequestIdentity {
|
|
1326
|
+
requestId: string;
|
|
1327
|
+
turnId: string;
|
|
1328
|
+
iteration: number;
|
|
1329
|
+
model: string;
|
|
1330
|
+
}
|
|
1331
|
+
type ModelWorkSettlement = ModelWorkRequestIdentity & ({
|
|
1332
|
+
status: "metered";
|
|
1333
|
+
inputTokens: number;
|
|
1334
|
+
outputTokens: number;
|
|
1335
|
+
} | {
|
|
1336
|
+
status: "unknown";
|
|
1337
|
+
});
|
|
1338
|
+
interface ModelWorkAccounting {
|
|
1339
|
+
admit(request: Readonly<ModelWorkRequestIdentity>, signal: AbortSignal): void | Promise<void>;
|
|
1340
|
+
settle(result: Readonly<ModelWorkSettlement>, signal: AbortSignal): void | Promise<void>;
|
|
1341
|
+
}
|
|
1273
1342
|
interface ModeSwitchRequest {
|
|
1274
1343
|
from: ExecutionMode;
|
|
1275
1344
|
to: ExecutionMode;
|
|
@@ -1292,6 +1361,7 @@ interface AgentLoopConfig {
|
|
|
1292
1361
|
systemPrompt: string;
|
|
1293
1362
|
requesterLabel?: string;
|
|
1294
1363
|
ownerSessionId?: string;
|
|
1364
|
+
getOwnerSessionId?: () => string | undefined;
|
|
1295
1365
|
executionMode?: ExecutionMode;
|
|
1296
1366
|
permissionEngine: PermissionEngine;
|
|
1297
1367
|
toolRegistry?: ToolRegistry;
|
|
@@ -1300,6 +1370,7 @@ interface AgentLoopConfig {
|
|
|
1300
1370
|
onToolWillExecute?: (name: string, input: Record<string, unknown>) => void | Promise<void>;
|
|
1301
1371
|
onToolEnd?: (name: string, result: ToolResult) => void;
|
|
1302
1372
|
onIteration?: (iteration: number, totalTokens: number) => void;
|
|
1373
|
+
modelWorkAccounting?: ModelWorkAccounting;
|
|
1303
1374
|
onError?: (error: Error, context: string) => void;
|
|
1304
1375
|
onTranscriptError?: (error: Error, context: string) => void;
|
|
1305
1376
|
onModeSwitchRequest?: (request: ModeSwitchRequest) => Promise<boolean>;
|
|
@@ -1383,12 +1454,16 @@ interface SessionIntegrationConfig {
|
|
|
1383
1454
|
}
|
|
1384
1455
|
interface AgentRunOptions {
|
|
1385
1456
|
messageId?: string;
|
|
1457
|
+
goalTurn?: ToolContinuationGoal;
|
|
1458
|
+
continuationId?: string;
|
|
1386
1459
|
}
|
|
1387
1460
|
declare class AgentLoop {
|
|
1388
1461
|
private config;
|
|
1389
1462
|
private toolRegistry;
|
|
1390
1463
|
private _messages;
|
|
1391
1464
|
private totalInputTokens;
|
|
1465
|
+
private modelWorkAttemptedRequests;
|
|
1466
|
+
private modelWorkMeteredRequests;
|
|
1392
1467
|
private totalOutputTokens;
|
|
1393
1468
|
private lastRequestInputTokens;
|
|
1394
1469
|
private pendingContextInjections;
|
|
@@ -1398,6 +1473,7 @@ declare class AgentLoop {
|
|
|
1398
1473
|
private interruptionRequested;
|
|
1399
1474
|
private currentTraceId;
|
|
1400
1475
|
private lastRunTraceId;
|
|
1476
|
+
private currentOwnerSessionId;
|
|
1401
1477
|
private lastRunTerminationInfo;
|
|
1402
1478
|
private activeTaskPrompt;
|
|
1403
1479
|
private activeToolPolicy;
|
|
@@ -1424,6 +1500,11 @@ declare class AgentLoop {
|
|
|
1424
1500
|
output: number;
|
|
1425
1501
|
total: number;
|
|
1426
1502
|
};
|
|
1503
|
+
get modelWorkUsage(): {
|
|
1504
|
+
attemptedRequests: number;
|
|
1505
|
+
meteredRequests: number;
|
|
1506
|
+
coverageComplete: boolean;
|
|
1507
|
+
};
|
|
1427
1508
|
get lastTraceId(): string | null;
|
|
1428
1509
|
get lastRunTermination(): AgentRunTermination | null;
|
|
1429
1510
|
get queryState(): QueryState;
|
package/dist/electron/index.d.ts
CHANGED
|
@@ -394,6 +394,7 @@ interface SessionMeta {
|
|
|
394
394
|
lastActivity: string;
|
|
395
395
|
workingDirectory: string;
|
|
396
396
|
model: string;
|
|
397
|
+
executionMode?: ExecutionMode;
|
|
397
398
|
parentSession?: string;
|
|
398
399
|
checkpoints: string[];
|
|
399
400
|
messageCount: number;
|
|
@@ -1100,6 +1101,54 @@ declare class AuditLogger {
|
|
|
1100
1101
|
exportJson(targetPath: string): Promise<number>;
|
|
1101
1102
|
flush(): Promise<void>;
|
|
1102
1103
|
}
|
|
1104
|
+
interface ToolContinuationGoal {
|
|
1105
|
+
sessionId: string;
|
|
1106
|
+
goalId: string;
|
|
1107
|
+
requestId: string;
|
|
1108
|
+
}
|
|
1109
|
+
interface TranscriptBytePageOptions {
|
|
1110
|
+
cursor?: string;
|
|
1111
|
+
maxBytes?: number;
|
|
1112
|
+
direction?: "forward" | "backward";
|
|
1113
|
+
}
|
|
1114
|
+
interface TranscriptBytePage {
|
|
1115
|
+
encoding: "base64";
|
|
1116
|
+
content: string;
|
|
1117
|
+
direction: "forward" | "backward";
|
|
1118
|
+
offset: number;
|
|
1119
|
+
bytesRead: number;
|
|
1120
|
+
totalBytes: number;
|
|
1121
|
+
transcriptVersion: string;
|
|
1122
|
+
nextCursor: string | null;
|
|
1123
|
+
}
|
|
1124
|
+
interface TranscriptRecordPageOptions {
|
|
1125
|
+
cursor?: string;
|
|
1126
|
+
maxBytes?: number;
|
|
1127
|
+
maxRecords?: number;
|
|
1128
|
+
}
|
|
1129
|
+
interface TranscriptPageRecord {
|
|
1130
|
+
offset: number;
|
|
1131
|
+
bytes: number;
|
|
1132
|
+
event: Readonly<Record<string, unknown>> & {
|
|
1133
|
+
id: string;
|
|
1134
|
+
timestamp: string;
|
|
1135
|
+
type: string;
|
|
1136
|
+
sequence: number;
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
interface TranscriptRecordPage {
|
|
1140
|
+
cursor: string;
|
|
1141
|
+
records: TranscriptPageRecord[];
|
|
1142
|
+
issues: Array<{
|
|
1143
|
+
code: "invalid_record" | "record_exceeds_page_budget";
|
|
1144
|
+
offset: number;
|
|
1145
|
+
bytes: number;
|
|
1146
|
+
}>;
|
|
1147
|
+
bytesRead: number;
|
|
1148
|
+
totalBytes: number;
|
|
1149
|
+
transcriptVersion: string;
|
|
1150
|
+
nextCursor: string | null;
|
|
1151
|
+
}
|
|
1103
1152
|
declare class TranscriptWriter {
|
|
1104
1153
|
private sessionDir;
|
|
1105
1154
|
private sessionId;
|
|
@@ -1121,6 +1170,8 @@ declare class TranscriptWriter {
|
|
|
1121
1170
|
private resolveWorkspaceMarkdownPath;
|
|
1122
1171
|
private appendMarkdownEvent;
|
|
1123
1172
|
private buildMarkdownDocument;
|
|
1173
|
+
readBytePage(options?: TranscriptBytePageOptions): Promise<TranscriptBytePage | null>;
|
|
1174
|
+
readRecordPage(options?: TranscriptRecordPageOptions): Promise<TranscriptRecordPage | null>;
|
|
1124
1175
|
read(options?: {
|
|
1125
1176
|
types?: TranscriptEventType[];
|
|
1126
1177
|
limit?: number;
|
|
@@ -1173,6 +1224,7 @@ interface SessionCreateOptions {
|
|
|
1173
1224
|
parentSession?: string;
|
|
1174
1225
|
workingDirectory: string;
|
|
1175
1226
|
model: string;
|
|
1227
|
+
executionMode?: ExecutionMode;
|
|
1176
1228
|
hostBinding?: AgentSessionHostBindingV1;
|
|
1177
1229
|
}
|
|
1178
1230
|
interface SessionResumeOptions {
|
|
@@ -1270,6 +1322,23 @@ interface CompletionGuard {
|
|
|
1270
1322
|
evaluate(ctx: CompletionGuardEvaluationContext): CompletionGuardDecision | null | undefined | Promise<CompletionGuardDecision | null | undefined>;
|
|
1271
1323
|
}
|
|
1272
1324
|
type CompressionLLMFn = (systemPrompt: string, messages: Message[]) => Promise<string>;
|
|
1325
|
+
interface ModelWorkRequestIdentity {
|
|
1326
|
+
requestId: string;
|
|
1327
|
+
turnId: string;
|
|
1328
|
+
iteration: number;
|
|
1329
|
+
model: string;
|
|
1330
|
+
}
|
|
1331
|
+
type ModelWorkSettlement = ModelWorkRequestIdentity & ({
|
|
1332
|
+
status: "metered";
|
|
1333
|
+
inputTokens: number;
|
|
1334
|
+
outputTokens: number;
|
|
1335
|
+
} | {
|
|
1336
|
+
status: "unknown";
|
|
1337
|
+
});
|
|
1338
|
+
interface ModelWorkAccounting {
|
|
1339
|
+
admit(request: Readonly<ModelWorkRequestIdentity>, signal: AbortSignal): void | Promise<void>;
|
|
1340
|
+
settle(result: Readonly<ModelWorkSettlement>, signal: AbortSignal): void | Promise<void>;
|
|
1341
|
+
}
|
|
1273
1342
|
interface ModeSwitchRequest {
|
|
1274
1343
|
from: ExecutionMode;
|
|
1275
1344
|
to: ExecutionMode;
|
|
@@ -1292,6 +1361,7 @@ interface AgentLoopConfig {
|
|
|
1292
1361
|
systemPrompt: string;
|
|
1293
1362
|
requesterLabel?: string;
|
|
1294
1363
|
ownerSessionId?: string;
|
|
1364
|
+
getOwnerSessionId?: () => string | undefined;
|
|
1295
1365
|
executionMode?: ExecutionMode;
|
|
1296
1366
|
permissionEngine: PermissionEngine;
|
|
1297
1367
|
toolRegistry?: ToolRegistry;
|
|
@@ -1300,6 +1370,7 @@ interface AgentLoopConfig {
|
|
|
1300
1370
|
onToolWillExecute?: (name: string, input: Record<string, unknown>) => void | Promise<void>;
|
|
1301
1371
|
onToolEnd?: (name: string, result: ToolResult) => void;
|
|
1302
1372
|
onIteration?: (iteration: number, totalTokens: number) => void;
|
|
1373
|
+
modelWorkAccounting?: ModelWorkAccounting;
|
|
1303
1374
|
onError?: (error: Error, context: string) => void;
|
|
1304
1375
|
onTranscriptError?: (error: Error, context: string) => void;
|
|
1305
1376
|
onModeSwitchRequest?: (request: ModeSwitchRequest) => Promise<boolean>;
|
|
@@ -1383,12 +1454,16 @@ interface SessionIntegrationConfig {
|
|
|
1383
1454
|
}
|
|
1384
1455
|
interface AgentRunOptions {
|
|
1385
1456
|
messageId?: string;
|
|
1457
|
+
goalTurn?: ToolContinuationGoal;
|
|
1458
|
+
continuationId?: string;
|
|
1386
1459
|
}
|
|
1387
1460
|
declare class AgentLoop {
|
|
1388
1461
|
private config;
|
|
1389
1462
|
private toolRegistry;
|
|
1390
1463
|
private _messages;
|
|
1391
1464
|
private totalInputTokens;
|
|
1465
|
+
private modelWorkAttemptedRequests;
|
|
1466
|
+
private modelWorkMeteredRequests;
|
|
1392
1467
|
private totalOutputTokens;
|
|
1393
1468
|
private lastRequestInputTokens;
|
|
1394
1469
|
private pendingContextInjections;
|
|
@@ -1398,6 +1473,7 @@ declare class AgentLoop {
|
|
|
1398
1473
|
private interruptionRequested;
|
|
1399
1474
|
private currentTraceId;
|
|
1400
1475
|
private lastRunTraceId;
|
|
1476
|
+
private currentOwnerSessionId;
|
|
1401
1477
|
private lastRunTerminationInfo;
|
|
1402
1478
|
private activeTaskPrompt;
|
|
1403
1479
|
private activeToolPolicy;
|
|
@@ -1424,6 +1500,11 @@ declare class AgentLoop {
|
|
|
1424
1500
|
output: number;
|
|
1425
1501
|
total: number;
|
|
1426
1502
|
};
|
|
1503
|
+
get modelWorkUsage(): {
|
|
1504
|
+
attemptedRequests: number;
|
|
1505
|
+
meteredRequests: number;
|
|
1506
|
+
coverageComplete: boolean;
|
|
1507
|
+
};
|
|
1427
1508
|
get lastTraceId(): string | null;
|
|
1428
1509
|
get lastRunTermination(): AgentRunTermination | null;
|
|
1429
1510
|
get queryState(): QueryState;
|