@xenosystem/agent-sdk 0.9.9 → 0.9.10

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/dist/index.d.cts CHANGED
@@ -612,7 +612,7 @@ interface PolicyEnforcerConfig {
612
612
  };
613
613
  }
614
614
  type AgentSandbox = PolicyEnforcerConfig;
615
- declare const SDK_VERSION = "0.9.9";
615
+ declare const SDK_VERSION = "0.9.10";
616
616
  type AuditRiskLevel = "none" | "low" | "medium" | "high" | "critical";
617
617
  type AuditDecision = "allow" | "ask" | "deny";
618
618
  type AuditStatus = "ok" | "error";
@@ -3790,7 +3790,7 @@ declare class QueryLifecycle {
3790
3790
  private checkWatchdog;
3791
3791
  }
3792
3792
  type ToolOperationRuntimeEventType = "tool.operation.started" | "tool.operation.progress" | "tool.operation.promotion_requested" | "tool.operation.promoted" | "tool.operation.stalled" | "tool.operation.verifying" | "tool.operation.completed" | "tool.operation.failed" | "tool.operation.timed_out" | "tool.operation.cancelled";
3793
- type XenoRuntimeEventType = "thread.started" | "turn.started" | "turn.completed" | "turn.failed" | "turn.interrupted" | "query.state" | "query.watchdog" | "provider.event" | "model.text.delta" | "tool.started" | "tool.permission" | "tool.completed" | "tool.history.repaired" | "tool.failure_guard.tripped" | ToolOperationRuntimeEventType | "turn.suspended" | "turn.continuation_enqueued" | "turn.continuation_resumed" | "turn.continuation_exhausted" | "diff.completed";
3793
+ type XenoRuntimeEventType = "thread.started" | "turn.started" | "turn.completed" | "turn.failed" | "turn.interrupted" | "query.state" | "query.watchdog" | "provider.event" | "model.text.delta" | "context.pressure" | "context.injected" | "tool.started" | "tool.permission" | "tool.completed" | "tool.history.repaired" | "tool.failure_guard.tripped" | ToolOperationRuntimeEventType | "turn.suspended" | "turn.continuation_enqueued" | "turn.continuation_resumed" | "turn.continuation_exhausted" | "diff.completed";
3794
3794
  interface XenoRuntimeEventBase {
3795
3795
  id: string;
3796
3796
  sequence: number;
@@ -3809,6 +3809,8 @@ type XenoRuntimeEvent = (XenoRuntimeEventBase & {
3809
3809
  model: string;
3810
3810
  effort?: string;
3811
3811
  promptPreview: string;
3812
+ contextBudgetTokens?: number;
3813
+ contextBudgetSource?: "config" | "provider" | "fallback";
3812
3814
  }) | (XenoRuntimeEventBase & {
3813
3815
  type: "turn.completed";
3814
3816
  outputPreview: string;
@@ -3817,6 +3819,22 @@ type XenoRuntimeEvent = (XenoRuntimeEventBase & {
3817
3819
  output: number;
3818
3820
  total: number;
3819
3821
  };
3822
+ contextTokens?: number;
3823
+ }) | (XenoRuntimeEventBase & {
3824
+ type: "context.pressure";
3825
+ turnId: string;
3826
+ iteration: number;
3827
+ contextTokens: number;
3828
+ budgetTokens: number;
3829
+ budgetSource: "config" | "provider" | "fallback";
3830
+ }) | (XenoRuntimeEventBase & {
3831
+ type: "context.injected";
3832
+ messageId: string;
3833
+ sourceNodeId?: string;
3834
+ label?: string;
3835
+ deferred: boolean;
3836
+ turnId?: string;
3837
+ iteration?: number;
3820
3838
  }) | (XenoRuntimeEventBase & {
3821
3839
  type: "turn.failed" | "turn.interrupted";
3822
3840
  error: string;
@@ -4678,6 +4696,8 @@ declare class AgentLoop {
4678
4696
  private _messages;
4679
4697
  private totalInputTokens;
4680
4698
  private totalOutputTokens;
4699
+ private lastRequestInputTokens;
4700
+ private pendingContextInjections;
4681
4701
  private lastCheckpointMessageCount;
4682
4702
  private ollamaBaseUrl;
4683
4703
  private activeAbortController;
@@ -4774,9 +4794,21 @@ declare class AgentLoop {
4774
4794
  private summarizeBackgroundTaskSnapshot;
4775
4795
  private maybeDrainBackgroundTasksAtIterationBudget;
4776
4796
  private getApiRequestTimeoutMs;
4797
+ private resolveContextBudget;
4777
4798
  private getModelContextLimit;
4778
4799
  private createApiRequestSignal;
4779
4800
  private buildRuntimeSystemPrompt;
4801
+ private unresolvedToolUseIds;
4802
+ injectContext(input: {
4803
+ content: string;
4804
+ sourceNodeId?: string;
4805
+ label?: string;
4806
+ }): Promise<{
4807
+ status: "injected" | "deferred";
4808
+ pendingCount: number;
4809
+ }>;
4810
+ get pendingContextInjectionCount(): number;
4811
+ private flushContextInjections;
4780
4812
  get messages(): Message[];
4781
4813
  set messages(value: Message[]);
4782
4814
  private shouldAutoCheckpoint;
package/dist/index.d.ts CHANGED
@@ -612,7 +612,7 @@ interface PolicyEnforcerConfig {
612
612
  };
613
613
  }
614
614
  type AgentSandbox = PolicyEnforcerConfig;
615
- declare const SDK_VERSION = "0.9.9";
615
+ declare const SDK_VERSION = "0.9.10";
616
616
  type AuditRiskLevel = "none" | "low" | "medium" | "high" | "critical";
617
617
  type AuditDecision = "allow" | "ask" | "deny";
618
618
  type AuditStatus = "ok" | "error";
@@ -3790,7 +3790,7 @@ declare class QueryLifecycle {
3790
3790
  private checkWatchdog;
3791
3791
  }
3792
3792
  type ToolOperationRuntimeEventType = "tool.operation.started" | "tool.operation.progress" | "tool.operation.promotion_requested" | "tool.operation.promoted" | "tool.operation.stalled" | "tool.operation.verifying" | "tool.operation.completed" | "tool.operation.failed" | "tool.operation.timed_out" | "tool.operation.cancelled";
3793
- type XenoRuntimeEventType = "thread.started" | "turn.started" | "turn.completed" | "turn.failed" | "turn.interrupted" | "query.state" | "query.watchdog" | "provider.event" | "model.text.delta" | "tool.started" | "tool.permission" | "tool.completed" | "tool.history.repaired" | "tool.failure_guard.tripped" | ToolOperationRuntimeEventType | "turn.suspended" | "turn.continuation_enqueued" | "turn.continuation_resumed" | "turn.continuation_exhausted" | "diff.completed";
3793
+ type XenoRuntimeEventType = "thread.started" | "turn.started" | "turn.completed" | "turn.failed" | "turn.interrupted" | "query.state" | "query.watchdog" | "provider.event" | "model.text.delta" | "context.pressure" | "context.injected" | "tool.started" | "tool.permission" | "tool.completed" | "tool.history.repaired" | "tool.failure_guard.tripped" | ToolOperationRuntimeEventType | "turn.suspended" | "turn.continuation_enqueued" | "turn.continuation_resumed" | "turn.continuation_exhausted" | "diff.completed";
3794
3794
  interface XenoRuntimeEventBase {
3795
3795
  id: string;
3796
3796
  sequence: number;
@@ -3809,6 +3809,8 @@ type XenoRuntimeEvent = (XenoRuntimeEventBase & {
3809
3809
  model: string;
3810
3810
  effort?: string;
3811
3811
  promptPreview: string;
3812
+ contextBudgetTokens?: number;
3813
+ contextBudgetSource?: "config" | "provider" | "fallback";
3812
3814
  }) | (XenoRuntimeEventBase & {
3813
3815
  type: "turn.completed";
3814
3816
  outputPreview: string;
@@ -3817,6 +3819,22 @@ type XenoRuntimeEvent = (XenoRuntimeEventBase & {
3817
3819
  output: number;
3818
3820
  total: number;
3819
3821
  };
3822
+ contextTokens?: number;
3823
+ }) | (XenoRuntimeEventBase & {
3824
+ type: "context.pressure";
3825
+ turnId: string;
3826
+ iteration: number;
3827
+ contextTokens: number;
3828
+ budgetTokens: number;
3829
+ budgetSource: "config" | "provider" | "fallback";
3830
+ }) | (XenoRuntimeEventBase & {
3831
+ type: "context.injected";
3832
+ messageId: string;
3833
+ sourceNodeId?: string;
3834
+ label?: string;
3835
+ deferred: boolean;
3836
+ turnId?: string;
3837
+ iteration?: number;
3820
3838
  }) | (XenoRuntimeEventBase & {
3821
3839
  type: "turn.failed" | "turn.interrupted";
3822
3840
  error: string;
@@ -4678,6 +4696,8 @@ declare class AgentLoop {
4678
4696
  private _messages;
4679
4697
  private totalInputTokens;
4680
4698
  private totalOutputTokens;
4699
+ private lastRequestInputTokens;
4700
+ private pendingContextInjections;
4681
4701
  private lastCheckpointMessageCount;
4682
4702
  private ollamaBaseUrl;
4683
4703
  private activeAbortController;
@@ -4774,9 +4794,21 @@ declare class AgentLoop {
4774
4794
  private summarizeBackgroundTaskSnapshot;
4775
4795
  private maybeDrainBackgroundTasksAtIterationBudget;
4776
4796
  private getApiRequestTimeoutMs;
4797
+ private resolveContextBudget;
4777
4798
  private getModelContextLimit;
4778
4799
  private createApiRequestSignal;
4779
4800
  private buildRuntimeSystemPrompt;
4801
+ private unresolvedToolUseIds;
4802
+ injectContext(input: {
4803
+ content: string;
4804
+ sourceNodeId?: string;
4805
+ label?: string;
4806
+ }): Promise<{
4807
+ status: "injected" | "deferred";
4808
+ pendingCount: number;
4809
+ }>;
4810
+ get pendingContextInjectionCount(): number;
4811
+ private flushContextInjections;
4780
4812
  get messages(): Message[];
4781
4813
  set messages(value: Message[]);
4782
4814
  private shouldAutoCheckpoint;