qlogicagent 2.24.13 → 2.24.15
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/agent.js +5 -5
- package/dist/cli.js +7 -7
- package/dist/embedded.js +9 -9
- package/dist/index.js +127 -127
- package/dist/types/protocol/wire/acp-protocol.d.ts +1 -1
- package/dist/types/protocol/wire/index.d.ts +2 -2
- package/dist/types/protocol/wire/notification-payloads.d.ts +17 -5
- package/dist/types/runtime/ports/model-transport-contracts.d.ts +16 -14
- package/dist/types/runtime/ports/tool-contracts.d.ts +1 -0
- package/dist/types/skills/mcp/mcp-manager.d.ts +9 -0
- package/dist/types/skills/tools.d.ts +2 -1
- package/package.json +2 -2
|
@@ -223,7 +223,7 @@ export interface AcpUsage {
|
|
|
223
223
|
cachedWriteTokens?: number;
|
|
224
224
|
_meta?: Record<string, unknown>;
|
|
225
225
|
}
|
|
226
|
-
export declare const
|
|
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
|
|
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,
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
26
|
+
records?: WireUsageRecord[];
|
|
15
27
|
}
|
|
16
28
|
/** Internal events that have a direct standard ACP projection. */
|
|
17
29
|
export interface TurnDeltaNotification {
|
|
@@ -30,7 +30,6 @@ export interface LLMRequest {
|
|
|
30
30
|
type: string;
|
|
31
31
|
config?: Record<string, unknown>;
|
|
32
32
|
}>;
|
|
33
|
-
previousResponseId?: string;
|
|
34
33
|
store?: boolean;
|
|
35
34
|
storeExpireAt?: number;
|
|
36
35
|
instructions?: string;
|
|
@@ -67,6 +66,7 @@ export type LLMChunk = {
|
|
|
67
66
|
id?: string;
|
|
68
67
|
name?: string;
|
|
69
68
|
arguments: string;
|
|
69
|
+
argumentsMode?: "append" | "replace";
|
|
70
70
|
} | {
|
|
71
71
|
type: "reasoning_delta";
|
|
72
72
|
text: string;
|
|
@@ -82,21 +82,23 @@ export type LLMChunk = {
|
|
|
82
82
|
reasoningTokens?: number;
|
|
83
83
|
cacheReadTokens?: number;
|
|
84
84
|
cacheCreationTokens?: number;
|
|
85
|
-
|
|
86
|
-
schemaVersion:
|
|
87
|
-
source:
|
|
88
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
totalTokens
|
|
95
|
-
reasoningTokens
|
|
96
|
-
cacheReadTokens
|
|
97
|
-
|
|
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;
|
|
@@ -46,6 +46,7 @@ export interface ToolCatalog {
|
|
|
46
46
|
getToolManifest(): ToolDefinition[];
|
|
47
47
|
getToolNames(): string[];
|
|
48
48
|
setTools(tools: RuntimeToolContract[]): void;
|
|
49
|
+
replaceTools(removeNames: readonly string[], tools: RuntimeToolContract[]): void;
|
|
49
50
|
addTool(tool: RuntimeToolContract): void;
|
|
50
51
|
addTools(tools: RuntimeToolContract[]): void;
|
|
51
52
|
removeTool(name: string): boolean;
|
|
@@ -4,6 +4,7 @@ interface ToolRegistryLike {
|
|
|
4
4
|
addTools(tools: PortableTool[]): void;
|
|
5
5
|
getToolNames(): string[];
|
|
6
6
|
removeTool(name: string): boolean;
|
|
7
|
+
replaceTools(removeNames: readonly string[], tools: PortableTool[]): void;
|
|
7
8
|
}
|
|
8
9
|
export type McpServerToolInfo = ServerToolInfo & {
|
|
9
10
|
readonly title?: string;
|
|
@@ -154,8 +155,16 @@ export declare class McpManager {
|
|
|
154
155
|
disconnectAll(): Promise<void>;
|
|
155
156
|
private toPortableTool;
|
|
156
157
|
private refreshServerInstructions;
|
|
158
|
+
private readServerSnapshot;
|
|
159
|
+
private readServerInstructions;
|
|
160
|
+
private setServerInstructions;
|
|
157
161
|
private wrapToolsForWorkspaceBoundary;
|
|
158
162
|
private injectPortableTools;
|
|
163
|
+
private preparePortableTools;
|
|
164
|
+
private recordInjectedTools;
|
|
165
|
+
private replaceInjectedServerTools;
|
|
166
|
+
private replaceAllInjectedTools;
|
|
167
|
+
private replaceRegisteredTools;
|
|
159
168
|
private retractServerTools;
|
|
160
169
|
private registerTools;
|
|
161
170
|
private removeRegisteredTool;
|
|
@@ -10,8 +10,9 @@ import type { ToolDefinition } from "../protocol/wire/index.js";
|
|
|
10
10
|
import { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent } from "./tool-access.js";
|
|
11
11
|
export { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent };
|
|
12
12
|
export declare class ToolRegistry {
|
|
13
|
-
private
|
|
13
|
+
private toolPool;
|
|
14
14
|
setTools(tools: PortableTool[]): void;
|
|
15
|
+
replaceTools(removeNames: readonly string[], tools: PortableTool[]): void;
|
|
15
16
|
addTool(tool: PortableTool<any>): void;
|
|
16
17
|
addTools(tools: PortableTool<any>[]): void;
|
|
17
18
|
removeTool(name: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.15",
|
|
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.
|
|
87
|
+
"@xiaozhiclaw/provider-core": "0.1.47",
|
|
88
88
|
"ajv": "8.20.0",
|
|
89
89
|
"better-sqlite3": "^12.10.0",
|
|
90
90
|
"dotenv": "^17.3.1",
|