qlogicagent 2.24.13 → 2.24.14

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.
@@ -223,7 +223,7 @@ export interface AcpUsage {
223
223
  cachedWriteTokens?: number;
224
224
  _meta?: Record<string, unknown>;
225
225
  }
226
- export declare const ACP_AUTHORITATIVE_USAGE_META_KEY = "xiaozhiclaw/authoritativeUsage";
226
+ export declare const ACP_USAGE_RECORDS_META_KEY = "xiaozhiclaw/usageRecords";
227
227
  export type AcpStopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
228
228
  export interface AcpJsonRpcRequest {
229
229
  jsonrpc: "2.0";
@@ -1,6 +1,6 @@
1
1
  export { type ChatMessage, type ChatMessageRole, type ContextAnchor, type ContextAnchorCategory, type ContextEnvelope, type LocalizedToolText, type SemanticToolCapability, type ThinkingBlock, type ToolCapabilityCategory, type ToolCallMessage, type ToolDefinition, type ToolIdentity, } from "./chat-types.js";
2
- export { type MediaResultType, type NotificationMethod, type NotificationMethodMap, type TurnDeltaNotification, type TurnEndNotification, type TurnMediaResultNotification, type TurnReasoningDeltaNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type WireAuthoritativeUsage, type WireTokenUsage, } from "./notification-payloads.js";
3
- export { ACP_METHODS, ACP_PROTOCOL_VERSION, isAcpJsonRpcNotification, isAcpJsonRpcRequest, isAcpJsonRpcResponse, parseAcpMessage, type AcpAgentCapabilities, type AcpConfigOptionDescriptor, type AcpContentBlock, type AcpFsReadTextFileParams, type AcpFsReadTextFileResult, type AcpFsWriteTextFileParams, type AcpFsWriteTextFileResult, type AcpHostCapabilities, type AcpInitializeParams, type AcpInitializeResult, type AcpJsonRpcError, type AcpJsonRpcMessage, type AcpJsonRpcNotification, type AcpJsonRpcRequest, type AcpJsonRpcResponse, type AcpMode, type AcpPermissionOption, type AcpPermissionRequestParams, ACP_PERMISSION_PRESENTATION_META_KEY, type AcpPermissionPresentationMetaV1, type AcpPermissionRequestResult, type AcpSessionCancelParams, type AcpSessionCloseParams, type AcpSessionMeta, type AcpSessionLoadParams, type AcpSessionModeState, type AcpSessionNewParams, type AcpSessionNewResult, type AcpSessionPromptParams, type AcpSessionPromptResult, ACP_AUTHORITATIVE_USAGE_META_KEY, type AcpSessionSetConfigParams, type AcpSessionSetConfigResult, type AcpStandardMethod, type AcpStopReason, type AcpUsage, } from "./acp-protocol.js";
2
+ export { type MediaResultType, type NotificationMethod, type NotificationMethodMap, type TurnDeltaNotification, type TurnEndNotification, type TurnMediaResultNotification, type TurnReasoningDeltaNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type WireUsageRecord, type WireUsageSource, type WireTokenUsage, } from "./notification-payloads.js";
3
+ export { ACP_METHODS, ACP_PROTOCOL_VERSION, isAcpJsonRpcNotification, isAcpJsonRpcRequest, isAcpJsonRpcResponse, parseAcpMessage, type AcpAgentCapabilities, type AcpConfigOptionDescriptor, type AcpContentBlock, type AcpFsReadTextFileParams, type AcpFsReadTextFileResult, type AcpFsWriteTextFileParams, type AcpFsWriteTextFileResult, type AcpHostCapabilities, type AcpInitializeParams, type AcpInitializeResult, type AcpJsonRpcError, type AcpJsonRpcMessage, type AcpJsonRpcNotification, type AcpJsonRpcRequest, type AcpJsonRpcResponse, type AcpMode, type AcpPermissionOption, type AcpPermissionRequestParams, ACP_PERMISSION_PRESENTATION_META_KEY, type AcpPermissionPresentationMetaV1, type AcpPermissionRequestResult, type AcpSessionCancelParams, type AcpSessionCloseParams, type AcpSessionMeta, type AcpSessionLoadParams, type AcpSessionModeState, type AcpSessionNewParams, type AcpSessionNewResult, type AcpSessionPromptParams, type AcpSessionPromptResult, ACP_USAGE_RECORDS_META_KEY, type AcpSessionSetConfigParams, type AcpSessionSetConfigResult, type AcpStandardMethod, type AcpStopReason, type AcpUsage, } from "./acp-protocol.js";
4
4
  export { type ApprovalRequiredToolContract, type ModelSelectionReason, type PendingPromptContract, type RuntimeCapabilitySummaryContract, type RuntimeSessionContract, type SessionIdentityContract, } from "./session.js";
5
5
  export { CAPABILITY_MANIFEST_DIFF_SECTIONS, cloneCapabilityManifestSnapshot, createCapabilityManifestDiffPayload, deriveCapabilityToolNamespaces, deriveCapabilityWorkspaceIds, mergeCapabilityManifestSnapshot, type CapabilityManifestApprovalMode, type CapabilityManifestApprovalPolicyContract, type CapabilityManifestDiffSection, type CapabilityMcpManifestContract, type CapabilityManifestSnapshotContract, type HostCapabilitySnapshotContract, type CapabilityPluginManifestContract, type RuntimeCapabilityViewContract, type RuntimeToolEligibilityContract, type CapabilitySkillManifestContract, type CapabilityToolManifestContract, type CapabilityWorkspaceSummaryContract, type ToolEligibilityResolvedSource, type ToolEligibilityReasonCode, type ToolEligibilityStatus, } from "./capability-manifest.js";
6
6
  export { WEB_ACTION_SCOPE_VALUES, WEB_APPROVAL_DEFAULT_VALUES, WEB_CAPABILITY_FAMILY_VALUES, WEB_CAPABILITY_ID_VALUES, WEB_DEGRADATION_TARGET_VALUES, WEB_ESCALATION_REASON_VALUES, WEB_EXECUTION_MODE_VALUES, WEB_POLICY_RISK_CLASS_VALUES, WEB_RETRY_POLICY_VALUES, WEB_STATEFULNESS_VALUES, WEB_TASK_MODE_VALUES, type WebActionScope, type WebApprovalDefault, type WebCapabilityDescriptorContract, type WebCapabilityFamily, type WebCapabilityId, type WebDegradationTarget, type WebEscalationReason, type WebExecutionMode, type WebPolicyRiskClass, type WebRetryPolicy, type WebStatefulness, type WebTaskMode, type ToolRiskLevel, } from "./web-capability.js";
@@ -1,9 +1,21 @@
1
1
  /** Token accounting returned by an Agent turn. */
2
- export interface WireAuthoritativeUsage {
3
- source: string;
4
- currency: string;
5
- cost: string;
2
+ export type WireUsageSource = "llmrouter.settlement" | "provider.reported" | "host.observed" | "estimated";
3
+ export interface WireUsageRecord {
4
+ schemaVersion: 1;
5
+ source: WireUsageSource;
6
6
  requestIds: string[];
7
+ tokens: {
8
+ inputTokens?: number;
9
+ outputTokens?: number;
10
+ totalTokens?: number;
11
+ reasoningTokens?: number;
12
+ cacheReadTokens?: number;
13
+ cacheWriteTokens?: number;
14
+ };
15
+ cost?: {
16
+ currency: string;
17
+ amount: string;
18
+ };
7
19
  }
8
20
  export interface WireTokenUsage {
9
21
  inputTokens: number;
@@ -11,7 +23,7 @@ export interface WireTokenUsage {
11
23
  reasoningTokens?: number;
12
24
  cacheRead?: number;
13
25
  cacheWrite?: number;
14
- authoritative?: WireAuthoritativeUsage;
26
+ records?: WireUsageRecord[];
15
27
  }
16
28
  /** Internal events that have a direct standard ACP projection. */
17
29
  export interface TurnDeltaNotification {
@@ -82,21 +82,23 @@ export type LLMChunk = {
82
82
  reasoningTokens?: number;
83
83
  cacheReadTokens?: number;
84
84
  cacheCreationTokens?: number;
85
- authoritative?: {
86
- schemaVersion: number;
87
- source: string;
88
- requestId: string;
89
- currency: string;
90
- cost: string;
85
+ records?: Array<{
86
+ schemaVersion: 1;
87
+ source: "llmrouter.settlement" | "provider.reported" | "host.observed" | "estimated";
88
+ requestIds: string[];
91
89
  tokens: {
92
- promptTokens: number;
93
- completionTokens: number;
94
- totalTokens: number;
95
- reasoningTokens: number;
96
- cacheReadTokens: number;
97
- cacheCreationTokens: number;
90
+ inputTokens?: number;
91
+ outputTokens?: number;
92
+ totalTokens?: number;
93
+ reasoningTokens?: number;
94
+ cacheReadTokens?: number;
95
+ cacheWriteTokens?: number;
98
96
  };
99
- };
97
+ cost?: {
98
+ currency: string;
99
+ amount: string;
100
+ };
101
+ }>;
100
102
  } | {
101
103
  type: "response_id";
102
104
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.24.13",
3
+ "version": "2.24.14",
4
4
  "packageManager": "pnpm@10.23.0",
5
5
  "description": "XiaozhiClaw standard ACP Agent adapter",
6
6
  "type": "module",
@@ -84,7 +84,7 @@
84
84
  "@agentclientprotocol/sdk": "^0.25.0",
85
85
  "@napi-rs/canvas": "0.1.100",
86
86
  "@xiaozhiclaw/module-sdk": "0.4.5",
87
- "@xiaozhiclaw/provider-core": "0.1.44",
87
+ "@xiaozhiclaw/provider-core": "0.1.46",
88
88
  "ajv": "8.20.0",
89
89
  "better-sqlite3": "^12.10.0",
90
90
  "dotenv": "^17.3.1",