qlogicagent 2.23.0 → 2.23.2
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 +43 -45
- package/dist/cli.js +7 -7
- package/dist/host-contract.js +1 -1
- package/dist/index.js +334 -338
- package/dist/protocol.js +1 -1
- package/dist/skills/builtin/desktop-screenshot/SKILL.md +3 -1
- package/dist/types/agent/agent.d.ts +0 -1
- package/dist/types/agent/tool-loop/loop-helpers.d.ts +1 -2
- package/dist/types/agent/tool-loop.d.ts +2 -4
- package/dist/types/agent/types.d.ts +2 -5
- package/dist/types/cli/handlers/turn-handler.d.ts +12 -11
- package/dist/types/contracts/turn-event.d.ts +6 -8
- package/dist/types/host-contract/index.d.ts +37 -87
- package/dist/types/orchestration/solo-evaluator.d.ts +2 -2
- package/dist/types/protocol/wire/acp-protocol.d.ts +1 -1
- package/dist/types/protocol/wire/index.d.ts +1 -1
- package/dist/types/protocol/wire/notification-payloads.d.ts +1 -13
- package/dist/types/runtime/config/tunable-defaults.d.ts +14 -6
- package/dist/types/runtime/infra/turn-telemetry-store.d.ts +1 -2
- package/dist/types/runtime/prompt/host-skill-directory.d.ts +16 -0
- package/dist/types/skills/mcp/mcp-manager.d.ts +12 -4
- package/dist/types/skills/memory/host-memory-provider.d.ts +2 -2
- package/dist/types/skills/memory/task-distillation.d.ts +1 -1
- package/dist/types/skills/tools/shell/command-classification.d.ts +0 -36
- package/dist/types/transport/acp-server.d.ts +3 -3
- package/dist/types/transport/delegate-client.d.ts +2 -2
- package/package.json +3 -3
- package/dist/types/agent/tool-loop/tool-budget-continuation-policy.d.ts +0 -45
- package/dist/types/runtime/prompt/capability-routing-policy.d.ts +0 -9
|
@@ -105,11 +105,11 @@ export declare class SoloEvaluator {
|
|
|
105
105
|
*/
|
|
106
106
|
start(params: SoloStartParams): Promise<string>;
|
|
107
107
|
/**
|
|
108
|
-
* 激活层(
|
|
108
|
+
* 激活层(active Host path §1.5):gateway-routed delegate 路径 —— 竞速者回合经网关代派(x/delegate),不本地
|
|
109
109
|
* spawn。同 handle(solo-racer/soloId/agentId/seq)⇒ supervisor 按 memberKey 复用同一竞速者进程与
|
|
110
110
|
* ACP 会话:初赛 → follow-up → 评比全程上下文连续(取代旧「watchdog reap + 按需 re-spawn」循环,
|
|
111
111
|
* worktree 文件仍是 durable state)。cwd=worktree;self 竞速者的 QLOGICAGENT_WORKTREE_WORKDIR /
|
|
112
|
-
* QLOGICAGENT_SOLO_LEAN 由 gateway 按 kind=solo-racer 派生注入(AgentSpec.envOverrides,
|
|
112
|
+
* QLOGICAGENT_SOLO_LEAN 由 gateway 按 kind=solo-racer 派生注入(AgentSpec.envOverrides,current contract
|
|
113
113
|
* —— descriptor/env 注入在 qla 侧退场,env 是监督者按成员种类决定的启动器不变量,非调用方入参)。
|
|
114
114
|
* usage 由 TurnResult.usage 承(不再读共享 PM 的 usage tracker)。
|
|
115
115
|
*/
|
|
@@ -73,7 +73,7 @@ export interface AcpQlogicagentCapability {
|
|
|
73
73
|
/** Multi-agent orchestration (solo / product / team). */
|
|
74
74
|
orchestration?: boolean;
|
|
75
75
|
/**
|
|
76
|
-
* T9 capability 握手 gate(
|
|
76
|
+
* T9 capability 握手 gate(delegate transport 跨进程 delegate 传输;host→agent 声明位)。
|
|
77
77
|
* host(gateway)声明「我服务 gateway-routed delegate」——即由 GatewayDelegateServer 认
|
|
78
78
|
* `x/delegate` 请求、下行 `x/delegate.update` 回流帧。qlogicagent(leader)【仅当】收到此位才走
|
|
79
79
|
* DelegateClient sends x/delegate only when this bit is present. If omitted, orchestration is
|
|
@@ -5,7 +5,7 @@ export { type ChatMessage, type ChatMessageRole, type ContextAnchor, type Contex
|
|
|
5
5
|
export { type AgentRpcMethodMap, type ProductInstanceDef, type ProductPhase, type ProductStatus, type ProductSummary, type ProductTaskDef, type ProductTaskStatus, type SoloAgentResult, type SoloAgentState, type SoloState, type SoloStatus, } from "./agent-methods.js";
|
|
6
6
|
export type * from "./acp-agent-management.js";
|
|
7
7
|
export { AGENT_TEAM_WS_EVENT_NAMES, AGENT_WS_EVENT_NAMES, ALL_AGENT_WS_EVENT_NAMES, type AgentTeamWsEventName, type AgentWsEventName, type AllAgentWsEventName, } from "./agent-events.js";
|
|
8
|
-
export { type AgentSource, type ArtifactType, type
|
|
8
|
+
export { type AgentSource, type ArtifactType, type MediaResultType, type MemoryDecayCompletedNotification, type MemoryUpdatedNotification, type NotificationMethod, type NotificationMethodMap, type NotificationThreadItem, type ThreadItemNotification, type PermissionRuleUpdatedNotification, type PlanInterruptedNotification, type PongNotification, type ProductBudgetUpdateNotification, type ProductBudgetWarningNotification, type ProductCheckpointedNotification, type ProductCompletedNotification, type ProductDagTopologyNotification, type ProductTaskCompletedNotification, type ProductTaskFailedNotification, type ProductTaskOutputDeltaNotification, type ProductMembersNotification, type ProductAgentActivityNotification, type ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectDetachedNotification, type ProjectAttachedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SessionRecoveryPendingNotification, type SoloAgentDeltaNotification, type SoloAgentUsageNotification, type SoloEvaluationNotification, type SoloProgressNotification, type TeamMemberNotification, type ToolApprovalRequestNotification, type TurnAnnotationsNotification, type TurnArtifactContractNotification, type TurnArtifactNotification, type TurnAskUserNotification, type TurnDeltaNotification, type TurnEndNotification, type TurnErrorNotification, type TurnExecProgressNotification, type TurnHeartbeatNotification, type TurnMediaResultNotification, type TurnPlanUpdateNotification, type TurnProgressNotification, type TurnReasoningDeltaNotification, type TurnRecoveryNotification, type TurnSidechainCompletedNotification, type TurnSidechainStartedNotification, type TurnSkillAcquisitionNeededNotification, type TurnStartNotification, type TurnSubagentActivityNotification, type TurnSubagentActivityStatus, type TurnSubagentCompletedNotification, type TurnSubagentDecisionNotification, type TurnSubagentDeltaNotification, type TurnSubagentEndedNotification, type TurnSubagentEvidenceItem, type TurnSubagentStartedNotification, type TurnSubagentTokenUsage, type TurnSuggestionsNotification, type TurnTaskUpdatedNotification, type TurnTodosUpdatedNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type TurnToolSelectionPolicyNotification, type ToolCallExecutionEvidence, type FinalAnswerEvidence, type TurnToolUseSummaryNotification, type TurnUsageUpdateNotification, type WireTokenUsage, type ProductPlanReadyNotification, type ProductPlanFailedNotification, type ProductPlanningDeltaNotification, type ProductLeaderMessageNotification, type ProductPlanningAskNotification, type MentionDelegateStartedNotification, type MentionDelegateActivityNotification, type MentionDelegateSettledNotification, type WorkflowDeletedNotification, type WorkflowRecordNotification, type WorkflowRunCompletedNotification, type WorkflowRunFailedNotification, type WorkflowRunStartedNotification, } from "./notification-payloads.js";
|
|
9
9
|
export { ACP_EXTENDED_METHODS, ACP_EXTENDED_SESSION_UPDATE_TYPES, ACP_METHODS, ACP_PROTOCOL_VERSION, ACP_SESSION_UPDATE_TYPES, isAcpJsonRpcNotification, isAcpJsonRpcRequest, isAcpJsonRpcResponse, isExtendedSessionUpdateType, isStandardSessionUpdateType, parseAcpMessage, type AcpAgentCapabilities, type AcpAgentMessageChunkPayload, type AcpAgentThoughtChunkPayload, type AcpConfigOptionDescriptor, type AcpConfigOptionUpdatePayload, type AcpContentBlock, type AcpEndTurnPayload, type AcpExtendedMethod, type AcpExtendedSessionUpdateType, 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, type AcpPermissionRequestResult, type AcpPlanPayload, type AcpSessionCancelParams, type AcpSessionCloseParams, type AcpSessionMeta, type AcpSessionLoadParams, type AcpSessionModeState, type AcpSessionNewParams, type AcpSessionNewResult, type AcpSessionPromptParams, type AcpSessionPromptResult, type AcpSessionSetConfigParams, type AcpSessionUpdateNotification, type AcpSessionUpdateType, type AcpStandardMethod, type AcpStandardSessionUpdateType, type AcpStopReason, type AcpToolCallPayload, type AcpToolCallUpdatePayload, type AcpUsage, type AcpUsageUpdatePayload, type AcpXSessionInfoPayload, type AcpXSkillInstructionPayload, } from "./acp-protocol.js";
|
|
10
10
|
export { type ApprovalRequiredToolContract, type ModelSelectionReason, type PendingPromptContract, type RuntimeCapabilitySummaryContract, type RuntimeSessionContract, type SessionIdentityContract, } from "./session.js";
|
|
11
11
|
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";
|
|
@@ -328,7 +328,6 @@ export interface TurnToolUseSummaryNotification {
|
|
|
328
328
|
telemetrySource?: "agent";
|
|
329
329
|
ledgerSchemaVersion: 4;
|
|
330
330
|
toolCalls: ToolCallExecutionEvidence[];
|
|
331
|
-
routingEvidence?: CapabilityRoutingEvidence;
|
|
332
331
|
finalAnswerEvidence: FinalAnswerEvidence;
|
|
333
332
|
availableToolNames: string[];
|
|
334
333
|
enabledToolNames: string[];
|
|
@@ -338,27 +337,16 @@ export interface TurnToolUseSummaryNotification {
|
|
|
338
337
|
reason: string;
|
|
339
338
|
}>;
|
|
340
339
|
}
|
|
341
|
-
/** Typed turn ownership and authorized tool-surface telemetry. */
|
|
342
|
-
export interface CapabilityRoutingEvidence {
|
|
343
|
-
schemaVersion: 2;
|
|
344
|
-
owner: "structured-planner" | "direct-response" | "typed-builtin";
|
|
345
|
-
source: "structured-planner" | "direct-response" | "typed-builtin";
|
|
346
|
-
routingStatus: "selected";
|
|
347
|
-
routingReason: string;
|
|
348
|
-
availableToolCount: number;
|
|
349
|
-
exposedToolCount: number;
|
|
350
|
-
}
|
|
351
340
|
export interface TurnToolSelectionPolicyNotification {
|
|
352
341
|
turnId: string;
|
|
353
342
|
policyId: string;
|
|
354
|
-
intent: "
|
|
343
|
+
intent: "benchmark_state_maintenance" | "fresh_evidence" | "verification" | "final_answer" | "tool_recovery" | "lifecycle_reconciliation";
|
|
355
344
|
reason: string;
|
|
356
345
|
availableToolNames: string[];
|
|
357
346
|
enabledToolNamesBefore: string[];
|
|
358
347
|
enabledToolNamesAfter: string[];
|
|
359
348
|
suppressedToolNames: string[];
|
|
360
349
|
nextAction: string;
|
|
361
|
-
routingEvidence?: CapabilityRoutingEvidence;
|
|
362
350
|
}
|
|
363
351
|
/** Queryable long-horizon turn lifecycle telemetry. */
|
|
364
352
|
export interface TurnLifecycleNotification {
|
|
@@ -13,9 +13,15 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Grouping follows subsystem boundaries.
|
|
15
15
|
*/
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Compatibility value exposed through the legacy tunables profile.
|
|
18
|
+
* Turn execution is unbounded unless the caller explicitly supplies maxRounds.
|
|
19
|
+
*/
|
|
17
20
|
export declare const MAX_ROUNDS_LIMIT = 100;
|
|
18
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Compatibility value exposed through the legacy tunables profile.
|
|
23
|
+
* It is not applied as an implicit top-level turn limit.
|
|
24
|
+
*/
|
|
19
25
|
export declare const DEFAULT_MAX_ROUNDS = 25;
|
|
20
26
|
/** Default temperature for LLM calls (0 = deterministic). */
|
|
21
27
|
export declare const DEFAULT_TEMPERATURE = 0;
|
|
@@ -29,10 +35,10 @@ export declare const DEFAULT_TOOL_EXECUTION_TIMEOUT_MS: number;
|
|
|
29
35
|
export declare const MAX_CONSECUTIVE_FAILURES = 3;
|
|
30
36
|
/** Max times the exact same (tool_name, arguments) pair can repeat. */
|
|
31
37
|
export declare const MAX_IDENTICAL_CALL_REPEATS = 2;
|
|
32
|
-
/** Max
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
38
|
+
/** Max hard failures for the same normalized target before blocking.
|
|
39
|
+
* Generic typed tools use their full canonical arguments, so a corrected schema or payload is a
|
|
40
|
+
* different invocation. Search and exec retain their domain-specific normalized target keys.
|
|
41
|
+
* Soft-empty results and rejected proposals are not executions and do not consume this budget. */
|
|
36
42
|
export declare const MAX_TOOL_VARIANT_FAILURES = 2;
|
|
37
43
|
/** Default context window size (tokens). */
|
|
38
44
|
export declare const DEFAULT_CONTEXT_WINDOW_TOKENS = 128000;
|
|
@@ -160,7 +166,9 @@ export declare const DREAM_MAX_DURATION_MS = 300000;
|
|
|
160
166
|
* Used by private X7 host profile tooling and local runtime consumers.
|
|
161
167
|
*/
|
|
162
168
|
export interface TunableDefaults {
|
|
169
|
+
/** @deprecated Compatibility-only; not an implicit execution limit. */
|
|
163
170
|
maxRoundsLimit: number;
|
|
171
|
+
/** @deprecated Compatibility-only; callers must explicitly set maxRounds. */
|
|
164
172
|
defaultMaxRounds: number;
|
|
165
173
|
defaultTemperature: number;
|
|
166
174
|
maxToolBudgetCap: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HostDelegationTelemetrySummary } from "../../host-contract/index.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { FinalAnswerEvidence, ToolCallExecutionEvidence } from "../../protocol/wire/notification-payloads.js";
|
|
3
3
|
export type AgentMode = "chat" | "solo" | "product" | "workflow" | "unknown";
|
|
4
4
|
export interface TurnTelemetryUsage {
|
|
5
5
|
inputTokens?: number;
|
|
@@ -18,7 +18,6 @@ export interface TurnTelemetryFileContext {
|
|
|
18
18
|
}
|
|
19
19
|
export interface TurnTelemetryExecutionEvidence {
|
|
20
20
|
ledgerSchemaVersion: 4;
|
|
21
|
-
routingEvidence?: CapabilityRoutingEvidence;
|
|
22
21
|
toolCalls: ToolCallExecutionEvidence[];
|
|
23
22
|
finalAnswerEvidence: FinalAnswerEvidence;
|
|
24
23
|
availableToolNames: string[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ToolDefinition } from "../../agent/types.js";
|
|
2
|
+
export type HostSkillDirectoryProjection = {
|
|
3
|
+
tools: ToolDefinition[];
|
|
4
|
+
prompt?: undefined;
|
|
5
|
+
revision?: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
tools: ToolDefinition[];
|
|
8
|
+
prompt: string;
|
|
9
|
+
revision: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Promote the Host's standard MCP Skill directory metadata into first-class model context.
|
|
13
|
+
* The Host remains the catalog authority and the model remains the selector; this adapter
|
|
14
|
+
* only prevents a large directory from being buried inside one generic tool description.
|
|
15
|
+
*/
|
|
16
|
+
export declare function projectHostSkillDirectory(tools: readonly ToolDefinition[]): HostSkillDirectoryProjection;
|
|
@@ -42,7 +42,7 @@ export interface McpServerEntry {
|
|
|
42
42
|
include?: string[];
|
|
43
43
|
exclude?: string[];
|
|
44
44
|
};
|
|
45
|
-
/** Per-tool invocation budget for this server (1s..
|
|
45
|
+
/** Per-tool invocation budget for this server (1s..30min). */
|
|
46
46
|
callTimeoutMs?: number;
|
|
47
47
|
}
|
|
48
48
|
export interface McpSecurityIssue {
|
|
@@ -51,8 +51,8 @@ export interface McpSecurityIssue {
|
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* A configured server that is not currently serving tools. Surfaced (not just logged)
|
|
54
|
-
* so
|
|
55
|
-
*
|
|
54
|
+
* so inventory diagnostics can disclose "configured but unavailable" instead of the
|
|
55
|
+
* server silently vanishing from the projected tool pool.
|
|
56
56
|
*/
|
|
57
57
|
export interface McpServerFailure {
|
|
58
58
|
name: string;
|
|
@@ -73,6 +73,14 @@ export interface McpManagerConfig {
|
|
|
73
73
|
}
|
|
74
74
|
export declare function resolveMcpCallTimeoutMs(value: number | undefined): number;
|
|
75
75
|
export declare function withMcpDeadline<T>(operation: Promise<T>, timeoutMs: number, label: string): Promise<T>;
|
|
76
|
+
/**
|
|
77
|
+
* Propagate the agent turn's cancellation into mcporter. Runtime.callTool does
|
|
78
|
+
* not accept an AbortSignal, so closing the affected server is the public
|
|
79
|
+
* transport boundary that terminates the in-flight request and its stdio
|
|
80
|
+
* process tree. The next invocation reconnects through the normal mcporter
|
|
81
|
+
* runtime path.
|
|
82
|
+
*/
|
|
83
|
+
export declare function callMcpToolWithAbort(runtime: Runtime, serverName: string, toolName: string, options: Parameters<Runtime["callTool"]>[2], signal?: AbortSignal): Promise<Awaited<ReturnType<Runtime["callTool"]>>>;
|
|
76
84
|
/**
|
|
77
85
|
* Read the authoritative MCP tools/list payload from mcporter's public
|
|
78
86
|
* connection boundary. mcporter's convenience listTools() intentionally
|
|
@@ -173,7 +181,7 @@ export declare function toPortableResult(result: unknown, _source?: {
|
|
|
173
181
|
args?: Record<string, unknown>;
|
|
174
182
|
}): PortableToolResult;
|
|
175
183
|
export declare function validateMcpToolWorkspaceBoundary(toolName: string, args: unknown, workspaceRoot: string | undefined): string | null;
|
|
176
|
-
export declare function
|
|
184
|
+
export declare function parseMcpServerMap(json: unknown): McpServerEntry[];
|
|
177
185
|
export declare function filterMcpTools<T extends {
|
|
178
186
|
name: string;
|
|
179
187
|
}>(tools: readonly T[], filter?: McpServerEntry["tools"]): T[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HostMemoryProvider —— qlogicagent
|
|
2
|
+
* HostMemoryProvider —— qlogicagent 通过 Host request 访问 Host-owned memories.db。
|
|
3
3
|
*
|
|
4
4
|
* Gateway Memory 权威公开面的 **proxy 实现**:大脑逻辑(dream/distill/晋升/consolidation/召回 hook)
|
|
5
5
|
* 零改动,底下的存取经 `x/host.request`(HostRequestClient)打到 gateway 四权威 host 服务(memory 域),
|
|
6
6
|
* store(memories.db)只有 gateway 进程打开。
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* 契约权威:host-contract §13
|
|
9
9
|
* (HostRequestParams;wire 形态 = { service:"memory", method, params:<位置参数数组> })。
|
|
10
10
|
*
|
|
11
11
|
* 【PROXY 共享面(以 host-contract 常量为准;两仓照此表,一字不差)】
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* (task-distill-candidates / promotion-proposals / procedure-usage,均 A 域)的读写权威
|
|
13
13
|
* 已全部归 gateway MemoryProfileService(唯一写者);qlogicagent 大脑经 HostMemoryProvider
|
|
14
14
|
* proxy 的 read/write{DistillCandidates,PromotionProposals,ProcedureUsage} 存取,本文件只提供
|
|
15
|
-
*
|
|
15
|
+
* 采集/聚类/晋升的确定性算法由本模块及其测试锁定。
|
|
16
16
|
*/
|
|
17
17
|
import { type HubSkillCategory } from "../skill-system/skill-category.js";
|
|
18
18
|
import type { ProcedureVerificationEvidence } from "../../host-contract/index.js";
|
|
@@ -1,53 +1,17 @@
|
|
|
1
|
-
/** Commands that search/find content (collapsible in UI). */
|
|
2
1
|
export declare const SEARCH_COMMANDS: Set<string>;
|
|
3
|
-
/** Commands that read/display file content (collapsible in UI). */
|
|
4
2
|
export declare const READ_COMMANDS: Set<string>;
|
|
5
|
-
/** Commands that list directory contents. */
|
|
6
3
|
export declare const LIST_COMMANDS: Set<string>;
|
|
7
|
-
/**
|
|
8
|
-
* Commands that are semantically neutral — they don't interact
|
|
9
|
-
* with the file system in a meaningful way. Skipped when
|
|
10
|
-
* classifying piped commands.
|
|
11
|
-
*/
|
|
12
4
|
export declare const SEMANTIC_NEUTRAL_COMMANDS: Set<string>;
|
|
13
|
-
/**
|
|
14
|
-
* Commands that produce no stdout on success.
|
|
15
|
-
* For these, the tool shows "Done" instead of "(No output)".
|
|
16
|
-
*/
|
|
17
5
|
export declare const SILENT_COMMANDS: Set<string>;
|
|
18
6
|
export interface CommandClassification {
|
|
19
|
-
/** First "real" command word (after env vars / wrappers). */
|
|
20
7
|
firstCommand: string | null;
|
|
21
|
-
/** Whether the command is search-like (find, grep, etc.). */
|
|
22
8
|
isSearch: boolean;
|
|
23
|
-
/** Whether the command only reads (cat, head, stat, etc.). */
|
|
24
9
|
isRead: boolean;
|
|
25
|
-
/** Whether the command lists files (ls, tree, du). */
|
|
26
10
|
isList: boolean;
|
|
27
|
-
/** Whether the command is expected to produce no stdout. */
|
|
28
11
|
isSilent: boolean;
|
|
29
|
-
/** Whether the command is safe to run in parallel with others. */
|
|
30
12
|
isConcurrencySafe: boolean;
|
|
31
|
-
/** Whether the command only reads state (never mutates). */
|
|
32
13
|
isReadOnly: boolean;
|
|
33
14
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Check whether a command has any `cd` or pushd/popd that changes CWD.
|
|
36
|
-
* Ported from cc's `commandHasAnyCd()`.
|
|
37
|
-
*/
|
|
38
15
|
export declare function commandHasAnyCd(command: string): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Classify a shell command.
|
|
41
|
-
*
|
|
42
|
-
* Mirrors cc's `isSearchOrReadBashCommand()` + `isSilentBashCommand()`.
|
|
43
|
-
*/
|
|
44
16
|
export declare function classifyCommand(command: string): CommandClassification;
|
|
45
|
-
export declare function requiresDedicatedReadSearchTool(classification: CommandClassification): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Actionable, command-type-specific redirect for a blocked exec command. Spelling out the
|
|
48
|
-
* exact dedicated tool (read for file contents, search for content lookup) lets the model
|
|
49
|
-
* self-correct instead of retrying the same blocked command into a recovery stop. Only
|
|
50
|
-
* called for reads/searches now (directory listing is allowed via exec — see above).
|
|
51
|
-
*/
|
|
52
|
-
export declare function dedicatedToolRedirectMessage(classification: CommandClassification): string;
|
|
53
17
|
export declare function commandTargetsBinaryFile(command: string | null): boolean;
|
|
@@ -131,7 +131,7 @@ export declare class AcpServer {
|
|
|
131
131
|
private hostSupportsExtendedEvents;
|
|
132
132
|
/** Whether the host supports x/ extended RPC methods */
|
|
133
133
|
private hostSupportsExtendedMethods;
|
|
134
|
-
/** T9(
|
|
134
|
+
/** T9(delegate transport):host 是否在 initialize 声明服务 gateway-routed delegate(x/delegate 族;设计 §2.4)。 */
|
|
135
135
|
private hostSupportsDelegate;
|
|
136
136
|
/** Exact host-request capability negotiated during initialize. */
|
|
137
137
|
private negotiatedHostRequestCapability;
|
|
@@ -142,7 +142,7 @@ export declare class AcpServer {
|
|
|
142
142
|
/** Map from outbound JSON-RPC request id -> permissionId for response matching */
|
|
143
143
|
private outboundRequestMap;
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* delegate transport 跨进程 delegate 客户端(泛化本类的 outbound-request 底座;设计 §5.1)。与审批 outboundRequestMap
|
|
146
146
|
* 并存:x/delegate 用 `del-*` rpc id,审批用 `perm-*`,handleResponse 先问 delegate 再落审批,互不干扰。
|
|
147
147
|
* All orchestration stations call this client through the authority-neutral DelegateBridge.
|
|
148
148
|
*/
|
|
@@ -177,7 +177,7 @@ export declare class AcpServer {
|
|
|
177
177
|
get supportsExtendedEvents(): boolean;
|
|
178
178
|
/** Whether the host supports extended methods */
|
|
179
179
|
get supportsExtendedMethods(): boolean;
|
|
180
|
-
/** T9(
|
|
180
|
+
/** T9(delegate transport):host 是否声明服务 gateway-routed delegate(gate;设计 §2.4)。 */
|
|
181
181
|
get supportsDelegate(): boolean;
|
|
182
182
|
/** Exact service check over the initialize capability; no boolean/prefix fallback. */
|
|
183
183
|
supportsHostRequestService(service: HostRequestService): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* DelegateClient —— qlogicagent(leader)侧的跨进程 delegate 传输客户端(
|
|
2
|
+
* DelegateClient —— qlogicagent(leader)侧的跨进程 delegate 传输客户端(delegate transport lane impl-transport-qla)。
|
|
3
3
|
*
|
|
4
4
|
* 契约单一事实源:host-contract §12 DelegateWire(冻结,严禁本文件自改契约)。
|
|
5
|
-
*
|
|
5
|
+
* Wire authority:host-contract §12 DelegateWire;行为由本文件及其 contract tests 锁定。
|
|
6
6
|
*
|
|
7
7
|
* 方向倒置(设计 §1):今天 qlogicagent→gateway 唯一 outbound 请求 = session/request_permission
|
|
8
8
|
* (acp-server.ts:247 requestPermission)。本客户端泛化该 outbound-request 底座,新增:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.23.
|
|
3
|
+
"version": "2.23.2",
|
|
4
4
|
"packageManager": "pnpm@10.23.0",
|
|
5
5
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
6
6
|
"type": "module",
|
|
@@ -170,8 +170,8 @@
|
|
|
170
170
|
"dependencies": {
|
|
171
171
|
"@agentclientprotocol/sdk": "^0.25.0",
|
|
172
172
|
"@napi-rs/canvas": "0.1.100",
|
|
173
|
-
"@xiaozhiclaw/module-sdk": "0.
|
|
174
|
-
"@xiaozhiclaw/provider-core": "0.1.
|
|
173
|
+
"@xiaozhiclaw/module-sdk": "0.4.0",
|
|
174
|
+
"@xiaozhiclaw/provider-core": "0.1.34",
|
|
175
175
|
"ajv": "8.20.0",
|
|
176
176
|
"better-sqlite3": "^12.10.0",
|
|
177
177
|
"dotenv": "^17.3.1",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 工具/轮数预算的「进度门控续跑」策略(A)。
|
|
3
|
-
*
|
|
4
|
-
* 默认工具预算(DEFAULT_TOOL_BUDGET)和轮数预算(DEFAULT_MAX_ROUNDS)对「建一个完整 app/游戏」这类
|
|
5
|
-
* 任务偏低,撞上就被迫收尾、任务半成品。本策略把预算从「写死的硬停」改成「软检查点 + 可续跑」:
|
|
6
|
-
* 预算耗尽时,若本轮窗口**确有进度**(产出了新的成功工具结果)且**没卡在循环里**(AP5 同款:同一文件
|
|
7
|
-
* 反复读),就再续一个窗口;否则停。续跑次数和绝对硬顶(MAX_*_CAP)双重封顶,杜绝失控。
|
|
8
|
-
*
|
|
9
|
-
* 与既有 token 预算续跑(budget-continuation-policy.ts)同构,只是进度信号换成「成功工具调用增量」、
|
|
10
|
-
* 失控信号换成「读循环」。纯函数,便于单测。
|
|
11
|
-
*/
|
|
12
|
-
/** 一轮 turn 内最多续跑次数 —— 与 token 续跑的 MAX_BUDGET_CONTINUATIONS 对齐。 */
|
|
13
|
-
export declare const MAX_TOOL_BUDGET_CONTINUATIONS = 5;
|
|
14
|
-
export interface ToolBudgetContinuationInput {
|
|
15
|
-
/** 当前工具调用预算(可能已被前几次续跑抬高过)。 */
|
|
16
|
-
currentToolBudget: number;
|
|
17
|
-
/** 当前轮数预算。 */
|
|
18
|
-
currentRoundBudget: number;
|
|
19
|
-
/** 工具调用绝对硬顶(失控兜底)。 */
|
|
20
|
-
toolHardCap: number;
|
|
21
|
-
/** 轮数绝对硬顶。 */
|
|
22
|
-
roundHardCap: number;
|
|
23
|
-
/** 已续跑次数。 */
|
|
24
|
-
continuationCount: number;
|
|
25
|
-
/** 上个检查点以来新增的「成功且非空」工具结果数 —— 进度信号。 */
|
|
26
|
-
successfulSinceLastCheck: number;
|
|
27
|
-
/** 文件读取计数(AP5 读循环检测,失控信号)。 */
|
|
28
|
-
fileReadCounts: ReadonlyMap<string, number>;
|
|
29
|
-
/** 每次续跑给工具预算加的窗口(= DEFAULT_TOOL_BUDGET)。 */
|
|
30
|
-
windowTools: number;
|
|
31
|
-
/** 每次续跑给轮数预算加的窗口(= DEFAULT_MAX_ROUNDS)。 */
|
|
32
|
-
windowRounds: number;
|
|
33
|
-
}
|
|
34
|
-
export interface ToolBudgetContinuationDecision {
|
|
35
|
-
nextToolBudget: number;
|
|
36
|
-
nextRoundBudget: number;
|
|
37
|
-
continuationCount: number;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* 决定是否续跑。返回 null = 不续(应停下并诚实收尾);返回 decision = 续跑(把预算抬到 next*)。
|
|
41
|
-
*
|
|
42
|
-
* 停的条件(任一):①续跑次数用满;②两个预算都已到硬顶;③本窗口零进度(没新增成功结果);
|
|
43
|
-
* ④卡在读循环。其余情况续跑,但每个预算都不超过各自硬顶。
|
|
44
|
-
*/
|
|
45
|
-
export declare function resolveToolBudgetContinuation(input: ToolBudgetContinuationInput): ToolBudgetContinuationDecision | null;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type CapabilityRoutingOwner = "structured-planner" | "direct-response" | "typed-builtin";
|
|
2
|
-
/**
|
|
3
|
-
* Resolves the typed turn owner. Skill and MCP selection stays with the primary
|
|
4
|
-
* model over the complete Host-authorized tool surface.
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolveCapabilityRoutingOwner(input: {
|
|
7
|
-
structuredPlannerTurn: boolean;
|
|
8
|
-
directResponse: boolean;
|
|
9
|
-
}): CapabilityRoutingOwner;
|