@xenosystem/agent-sdk 0.10.3 → 0.10.4

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.
@@ -1358,6 +1358,22 @@ interface ModelWorkAccounting {
1358
1358
  admit(request: Readonly<ModelWorkRequestIdentity>, signal: AbortSignal): void | Promise<void>;
1359
1359
  settle(result: Readonly<ModelWorkSettlement>, signal: AbortSignal): void | Promise<void>;
1360
1360
  }
1361
+ interface RunAuthorityDispatch {
1362
+ turnId: string;
1363
+ iteration: number;
1364
+ model: string;
1365
+ attempt: number;
1366
+ }
1367
+ interface RunAuthorityToolCall {
1368
+ turnId: string;
1369
+ iteration: number;
1370
+ toolName: string;
1371
+ toolCallId: string;
1372
+ }
1373
+ interface RunAuthority {
1374
+ authorizeDispatch(request: Readonly<RunAuthorityDispatch>, signal: AbortSignal): void | Promise<void>;
1375
+ authorizeToolCall(request: Readonly<RunAuthorityToolCall>, signal: AbortSignal): void | Promise<void>;
1376
+ }
1361
1377
  interface ModeSwitchRequest {
1362
1378
  from: ExecutionMode;
1363
1379
  to: ExecutionMode;
@@ -1397,6 +1413,7 @@ interface AgentLoopConfig {
1397
1413
  onToolEnd?: (name: string, result: ToolResult) => void;
1398
1414
  onIteration?: (iteration: number, totalTokens: number) => void;
1399
1415
  modelWorkAccounting?: ModelWorkAccounting;
1416
+ runAuthority?: RunAuthority;
1400
1417
  onError?: (error: Error, context: string) => void;
1401
1418
  onTranscriptError?: (error: Error, context: string) => void;
1402
1419
  onModeSwitchRequest?: (request: ModeSwitchRequest) => Promise<boolean>;
@@ -1534,6 +1551,7 @@ declare class AgentLoop {
1534
1551
  configureModelExecution(options: {
1535
1552
  provider?: LLMProvider;
1536
1553
  modelWorkAccounting?: ModelWorkAccounting;
1554
+ runAuthority?: RunAuthority;
1537
1555
  }): void;
1538
1556
  get lastTraceId(): string | null;
1539
1557
  get lastRunTermination(): AgentRunTermination | null;
@@ -1358,6 +1358,22 @@ interface ModelWorkAccounting {
1358
1358
  admit(request: Readonly<ModelWorkRequestIdentity>, signal: AbortSignal): void | Promise<void>;
1359
1359
  settle(result: Readonly<ModelWorkSettlement>, signal: AbortSignal): void | Promise<void>;
1360
1360
  }
1361
+ interface RunAuthorityDispatch {
1362
+ turnId: string;
1363
+ iteration: number;
1364
+ model: string;
1365
+ attempt: number;
1366
+ }
1367
+ interface RunAuthorityToolCall {
1368
+ turnId: string;
1369
+ iteration: number;
1370
+ toolName: string;
1371
+ toolCallId: string;
1372
+ }
1373
+ interface RunAuthority {
1374
+ authorizeDispatch(request: Readonly<RunAuthorityDispatch>, signal: AbortSignal): void | Promise<void>;
1375
+ authorizeToolCall(request: Readonly<RunAuthorityToolCall>, signal: AbortSignal): void | Promise<void>;
1376
+ }
1361
1377
  interface ModeSwitchRequest {
1362
1378
  from: ExecutionMode;
1363
1379
  to: ExecutionMode;
@@ -1397,6 +1413,7 @@ interface AgentLoopConfig {
1397
1413
  onToolEnd?: (name: string, result: ToolResult) => void;
1398
1414
  onIteration?: (iteration: number, totalTokens: number) => void;
1399
1415
  modelWorkAccounting?: ModelWorkAccounting;
1416
+ runAuthority?: RunAuthority;
1400
1417
  onError?: (error: Error, context: string) => void;
1401
1418
  onTranscriptError?: (error: Error, context: string) => void;
1402
1419
  onModeSwitchRequest?: (request: ModeSwitchRequest) => Promise<boolean>;
@@ -1534,6 +1551,7 @@ declare class AgentLoop {
1534
1551
  configureModelExecution(options: {
1535
1552
  provider?: LLMProvider;
1536
1553
  modelWorkAccounting?: ModelWorkAccounting;
1554
+ runAuthority?: RunAuthority;
1537
1555
  }): void;
1538
1556
  get lastTraceId(): string | null;
1539
1557
  get lastRunTermination(): AgentRunTermination | null;