@xiaozhiclaw/qlogicagent-core 0.6.5 → 0.6.7

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.
@@ -59,7 +59,9 @@ export interface ChatMessage {
59
59
  itemId?: string;
60
60
  contextAnchors?: ContextAnchor[];
61
61
  /** Derived projection of product facts, replaceable by the context transform. */
62
- contextProjection?: "facts";
62
+ contextProjection?: "facts" | "summary";
63
+ /** Derived summary text; never an authenticated fact or instruction. */
64
+ contextSummary?: string;
63
65
  /** For assistant messages with tool calls. */
64
66
  tool_calls?: ToolCallMessage[];
65
67
  /** For tool result messages. */
@@ -138,5 +140,7 @@ export interface ToolDefinition {
138
140
  semanticCapability?: SemanticToolCapability;
139
141
  /** Tool-specific deadline supplied by the product. */
140
142
  executionTimeoutMs?: number;
143
+ /** Only explicitly independent calls may overlap. Omission is a serial barrier. */
144
+ executionMode?: "parallel" | "sequential";
141
145
  };
142
146
  }
@@ -30,7 +30,7 @@ export type TurnEvent = {
30
30
  /** Product-requested pause at a durable model-ready boundary. */
31
31
  stopReason?: "paused";
32
32
  /** Task success remains unverified unless a higher-level product workflow proves it. */
33
- taskOutcome?: "unverified";
33
+ taskOutcome?: "unverified" | "satisfied" | "incomplete";
34
34
  usage?: WireTokenUsage;
35
35
  model?: string;
36
36
  provider?: string;
@@ -87,7 +87,7 @@ export interface CloudTaskRuntimeOptions {
87
87
  verifyGoal?(task: CloudTaskSnapshot): Promise<BusinessGoalEvidence>;
88
88
  /** Product-owned confirmed goals may be established through a tool confirmation receipt. */
89
89
  resolveGoal?(task: CloudTaskSnapshot): Promise<BusinessGoal | undefined>;
90
- /** Feed independently checked evidence back through the same loop; no separate correction runner. */
90
+ /** Override generic evidence feedback, or return [] to stop. Omission uses the same loop's default correction. */
91
91
  goalFeedback?(task: CloudTaskSnapshot, outcome: BusinessGoalOutcome): Promise<ChatMessage[]>;
92
92
  authorize(context: CloudExecutionContext, action: "create" | "read" | "execute" | "cancel" | "complete_wait" | "recover" | "append_input" | "resume"): Promise<void>;
93
93
  /** Validate product-authorized approval/input or query the original external job; never trust browser results. */
@@ -1,3 +1,5 @@
1
1
  import type { ChatMessage, EmbeddedRuntimeOptions, ModelContextPreparation, ModelContextProjection } from "./contracts.js";
2
2
  /** Reuse the canonical fallback after product retrieval; token estimates are advisory. */
3
3
  export declare function prepareSlidingWindowContext(messages: readonly ChatMessage[], context: ModelContextPreparation, countMessageTokens?: EmbeddedRuntimeOptions["countMessageTokens"]): ModelContextProjection;
4
+ /** One projection path for Embedded and Cloud, including original-response replay. */
5
+ export declare function prepareRuntimeContext(messages: readonly ChatMessage[], context: ModelContextPreparation, options: EmbeddedRuntimeOptions): Promise<ModelContextProjection>;
@@ -57,6 +57,15 @@ export interface EmbeddedRuntimeOptions {
57
57
  prepareContext?: (messages: readonly ChatMessage[], context: ModelContextPreparation) => Promise<ModelContextProjection>;
58
58
  /** Model-aware message measurement; the fallback is an advisory estimate. */
59
59
  countMessageTokens?: (message: Readonly<ChatMessage>, model: string) => number;
60
+ /** Incrementally summarize omitted history through the product's metered model service.
61
+ * The callback owns authorization, billing and cancellation for any inference it performs.
62
+ * Summaries remain untrusted data in the existing checkpoint, never a second memory store.
63
+ * prepareContext, when supplied, owns the whole projection instead.
64
+ */
65
+ summarizeContext?: (input: {
66
+ previousSummary?: string;
67
+ messages: readonly ChatMessage[];
68
+ }, context: ModelContextPreparation) => Promise<string>;
60
69
  /** Product-owned model projection; receipts retain the full result. Return undefined to keep it. */
61
70
  projectToolResult?: (message: Readonly<ChatMessage>) => Promise<string | undefined>;
62
71
  /** Evidence or new questions supplied by the product before accepting a model's final answer. */
@@ -65,6 +74,8 @@ export interface EmbeddedRuntimeOptions {
65
74
  }
66
75
  export interface ModelContextPreparation {
67
76
  model: string;
77
+ /** Exact resident schemas; the default projection reserves their input cost. */
78
+ tools?: readonly ToolDefinition[];
68
79
  /** Context capacity after reserving configured output; Infinity when capacity metadata is disabled. */
69
80
  inputBudgetTokens: number;
70
81
  sessionId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaozhiclaw/qlogicagent-core",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "Shared SaaS Agent inference and durable task runtime",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",