qlogicagent 2.16.3 → 2.16.5
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/README.md +2 -11
- package/dist/agent.js +20 -21
- package/dist/cli.js +517 -382
- package/dist/index.js +516 -381
- package/dist/orchestration.js +12 -13
- package/dist/protocol.js +1 -1
- package/dist/types/agent/tool-loop/completion-action-policy.d.ts +3 -1
- package/dist/types/agent/tool-loop.d.ts +12 -1
- package/dist/types/agent/types.d.ts +2 -2
- package/dist/types/cli/acp-extended-handlers.d.ts +25 -0
- package/dist/types/cli/agent-runtime-bootstrap.d.ts +0 -2
- package/dist/types/cli/community-resource-installer.d.ts +5 -3
- package/dist/types/cli/core-tools/fork-system-prompt.d.ts +0 -2
- package/dist/types/cli/core-tools/registry.d.ts +1 -2
- package/dist/types/cli/core-tools/session-tool-manifest.d.ts +0 -2
- package/dist/types/cli/handlers/community-handler.d.ts +4 -0
- package/dist/types/cli/handlers/goal-handler.d.ts +54 -0
- package/dist/types/cli/handlers/turn-handler.d.ts +0 -1
- package/dist/types/cli/skill-invocation-service.d.ts +6 -0
- package/dist/types/cli/{skill-meta-tool-bootstrap.d.ts → skill-tools-bootstrap.d.ts} +6 -12
- package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +0 -1
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +1 -9
- package/dist/types/cli/tool-bootstrap.d.ts +0 -2
- package/dist/types/contracts/turn-event.d.ts +1 -1
- package/dist/types/orchestration/agent-instance.d.ts +19 -2
- package/dist/types/orchestration/delegation-coordinator.d.ts +43 -0
- package/dist/types/orchestration/goal-acceptance.d.ts +20 -0
- package/dist/types/orchestration/goal-loop-coordinator.d.ts +87 -0
- package/dist/types/orchestration/goal-mode-adapters.d.ts +94 -0
- package/dist/types/orchestration/goal-run-persistence.d.ts +15 -0
- package/dist/types/orchestration/goal-run-types.d.ts +112 -0
- package/dist/types/orchestration/index.d.ts +1 -1
- package/dist/types/orchestration/skill-improvement.d.ts +1 -21
- package/dist/types/orchestration/subagent/agent-registry.d.ts +1 -1
- package/dist/types/orchestration/workflow/host-executors.d.ts +1 -1
- package/dist/types/orchestration/workflow/node-schema.d.ts +3 -3
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +2 -2
- package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +1 -1
- package/dist/types/protocol/methods.d.ts +0 -3
- package/dist/types/protocol/wire/acp-agent-management.d.ts +33 -1
- package/dist/types/protocol/wire/acp-protocol.d.ts +17 -2
- package/dist/types/protocol/wire/agent-events.d.ts +2 -2
- package/dist/types/protocol/wire/agent-methods.d.ts +0 -2
- package/dist/types/protocol/wire/notification-payloads.d.ts +36 -20
- package/dist/types/runtime/community/community-pet-publisher.d.ts +21 -24
- package/dist/types/runtime/community/community-signal-reporter.d.ts +0 -14
- package/dist/types/runtime/config/tunable-defaults.d.ts +0 -21
- package/dist/types/runtime/hooks/community-discovery-hook.d.ts +18 -0
- package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +2 -2
- package/dist/types/runtime/infra/agent-install-runner.d.ts +1 -1
- package/dist/types/runtime/infra/llmrouter-catalog.d.ts +10 -0
- package/dist/types/runtime/infra/skill-resolver.d.ts +1 -1
- package/dist/types/runtime/pet/pet-community-assets.d.ts +16 -11
- package/dist/types/runtime/pet/pet-profile-service.d.ts +2 -2
- package/dist/types/runtime/pet/petdex-asset.d.ts +28 -0
- package/dist/types/runtime/ports/tool-contracts.d.ts +1 -10
- package/dist/types/runtime/prompt/environment-context.d.ts +8 -32
- package/dist/types/runtime/tasks/task-types.d.ts +2 -32
- package/dist/types/skills/permissions/hook-runner.d.ts +0 -22
- package/dist/types/skills/plugins/plugin-api.d.ts +1 -1
- package/dist/types/skills/portable-tool.d.ts +2 -8
- package/dist/types/skills/tools/skill-tool.d.ts +57 -22
- package/dist/types/skills/tools.d.ts +5 -39
- package/dist/types/transport/acp-server.d.ts +13 -1
- package/package.json +1 -2
- package/dist/types/cli/core-tools/team-registry.d.ts +0 -62
- package/dist/types/cli/core-tools/team-tool-bootstrap.d.ts +0 -11
- package/dist/types/cli/core-tools/team-tool-service.d.ts +0 -43
- package/dist/types/cli/skill-meta-subturn-service.d.ts +0 -26
- package/dist/types/runtime/hooks/skill-recall-hooks.d.ts +0 -37
- package/dist/types/runtime/sandbox/skill-sandbox.d.ts +0 -53
- package/dist/types/runtime/sandbox/windows-skill-sandbox.d.ts +0 -78
- package/dist/types/skills/permissions/community-sandbox-policy.d.ts +0 -3
- package/dist/types/skills/permissions/community-sandbox-red-team-cli.d.ts +0 -7
- package/dist/types/skills/permissions/community-sandbox-red-team.d.ts +0 -32
- package/dist/types/skills/tools/team-tool.d.ts +0 -152
- package/dist/types/skills/tools/tool-search-tool.d.ts +0 -75
- package/dist/types/skills/tools/tool-selection-eval.d.ts +0 -49
- package/dist/types/skills/tools/tool-selection-eval.dataset.d.ts +0 -5
- package/dist/types/skills/tools/tool-selection-eval.tasks.d.ts +0 -9
|
@@ -35,37 +35,6 @@ export declare function createTaskGuidanceSection(domain?: TaskDomain): SystemPr
|
|
|
35
35
|
* Tells the LLM when to use specialized tools vs. primitives.
|
|
36
36
|
*/
|
|
37
37
|
export declare function createToolGuidanceSection(): SystemPromptSection;
|
|
38
|
-
type DeferredIndexEntry = {
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
searchHint?: string;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Render the deferred-tool listing with accuracy-aware token discipline.
|
|
45
|
-
*
|
|
46
|
-
* Dropping ALL descriptions to save tokens trades away tool-SELECTION accuracy:
|
|
47
|
-
* the model cannot tell `mcp__exa__search` from `mcp__github__search` by name.
|
|
48
|
-
* So spend the description budget exactly where confusion lives:
|
|
49
|
-
* - small set (<= richHintLimit): every tool rich.
|
|
50
|
-
* - built-in deferred tools (no server): always rich — small, bounded set.
|
|
51
|
-
* - MCP tools whose leaf name collides with another tool: keep the hint.
|
|
52
|
-
* - MCP tools with a unique leaf: name only (unambiguous; tool_search recovers
|
|
53
|
-
* details on demand).
|
|
54
|
-
* Names are ALWAYS listed so any capability can be `select:`ed directly.
|
|
55
|
-
*/
|
|
56
|
-
export declare function buildDeferredToolIndexBody(deferred: DeferredIndexEntry[], richHintLimit: number): string[];
|
|
57
|
-
/**
|
|
58
|
-
* Index of deferred tools so the model KNOWS these capabilities exist even
|
|
59
|
-
* though their schemas are not loaded. Without this the model sees only the
|
|
60
|
-
* non-deferred tool list and will wrongly claim it lacks e.g. video generation.
|
|
61
|
-
*
|
|
62
|
-
* Volatile (recomputed each turn) because the deferred set can change when
|
|
63
|
-
* dynamic registrations (MCP, session bootstrap) land; the rendered text is
|
|
64
|
-
* stable across turns otherwise, so prompt cache is preserved in practice.
|
|
65
|
-
*/
|
|
66
|
-
export declare function createDeferredToolIndexSection(listDeferredTools: () => DeferredIndexEntry[], options?: {
|
|
67
|
-
richHintLimit?: number;
|
|
68
|
-
}): SystemPromptSection;
|
|
69
38
|
/**
|
|
70
39
|
* Create a system prompt section that instructs the model on response language.
|
|
71
40
|
* CC parity: only injected when language is explicitly set; when absent,
|
|
@@ -76,6 +45,14 @@ export declare function createDeferredToolIndexSection(listDeferredTools: () =>
|
|
|
76
45
|
* (e.g., Chinese INDEX.md + English tool guidance).
|
|
77
46
|
*/
|
|
78
47
|
export declare function createLanguageSection(language?: string): SystemPromptSection;
|
|
48
|
+
/**
|
|
49
|
+
* Available Skills — CC skill-discovery parity. Lists every active (installed, not muted) skill
|
|
50
|
+
* with its description (hermes-style, description-only), and tells the model to load a matching
|
|
51
|
+
* skill via skill_view BEFORE acting — even when the user did not name it. This is the link that
|
|
52
|
+
* makes installed skills actually auto-activate; without it active skills only sit behind the
|
|
53
|
+
* skill_view tool as a passive catalog and never fire on their own.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createAvailableSkillsSection(cwdOverride?: string): SystemPromptSection;
|
|
79
56
|
/**
|
|
80
57
|
* Detect the response language from the user's current-turn text so the strong
|
|
81
58
|
* explicit-language branch of createLanguageSection actually fires.
|
|
@@ -87,4 +64,3 @@ export declare function createLanguageSection(language?: string): SystemPromptSe
|
|
|
87
64
|
* fallback handle English/other, which weak models already mirror fine).
|
|
88
65
|
*/
|
|
89
66
|
export declare function detectResponseLanguage(userText: string): string | undefined;
|
|
90
|
-
export {};
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
* PRODUCED today (have a real registration site):
|
|
16
16
|
* - local_bash: backgrounded shell command (BackgroundTaskManager.registerBashTask)
|
|
17
17
|
* - local_agent: backgrounded forked agent (BackgroundTaskManager.startAgentTask)
|
|
18
|
-
* - team_member: long-lived team subprocess (team-tool-service → registerExternalTask)
|
|
19
18
|
* - dream: memory consolidation (runDream → taskStore.registerTask)
|
|
20
19
|
*
|
|
21
20
|
* PLANNED — declared for the TASK_PREFIX taxonomy + UI/protocol contract, but NO
|
|
@@ -24,13 +23,8 @@
|
|
|
24
23
|
* - remote_agent: cloud sandbox (polling-based)
|
|
25
24
|
* - local_workflow: DAG/pipeline execution
|
|
26
25
|
* - monitor_mcp: MCP server monitoring agent
|
|
27
|
-
*
|
|
28
|
-
* Naming note: we deliberately diverge from upstream CC's `in_process_teammate`.
|
|
29
|
-
* Our team members run as isolated SUBPROCESSES (AgentProcessManager) in their own
|
|
30
|
-
* git worktrees, not AsyncLocalStorage in-process agents — so the honest name is
|
|
31
|
-
* `team_member`. Keeps the `t` task-id prefix.
|
|
32
26
|
*/
|
|
33
|
-
export type TaskType = "local_bash" | "local_agent" | "remote_agent" | "
|
|
27
|
+
export type TaskType = "local_bash" | "local_agent" | "remote_agent" | "local_workflow" | "monitor_mcp" | "dream";
|
|
34
28
|
/**
|
|
35
29
|
* How a sub-agent is isolated from the parent execution.
|
|
36
30
|
*
|
|
@@ -115,22 +109,6 @@ export interface RemoteAgentTaskState extends TaskStateBase {
|
|
|
115
109
|
/** Polling endpoint for status checks. */
|
|
116
110
|
pollEndpoint?: string;
|
|
117
111
|
}
|
|
118
|
-
/** Team member — long-lived collaborator subprocess in its own git worktree. */
|
|
119
|
-
export interface TeamMemberTaskState extends TaskStateBase {
|
|
120
|
-
type: "team_member";
|
|
121
|
-
/** Team this member belongs to. */
|
|
122
|
-
teamName: string;
|
|
123
|
-
/** Member's display name. */
|
|
124
|
-
agentName: string;
|
|
125
|
-
/** Stable member id (`team-<team>-<name>`) — routes team send / cancel. */
|
|
126
|
-
memberId: string;
|
|
127
|
-
/** Subprocess PID, once spawned. */
|
|
128
|
-
pid?: number;
|
|
129
|
-
/** Isolated git worktree path (when provisioned). */
|
|
130
|
-
worktreePath?: string;
|
|
131
|
-
/** Worktree branch name (for cleanup). */
|
|
132
|
-
worktreeBranch?: string;
|
|
133
|
-
}
|
|
134
112
|
/** A single dream agent turn — text output + tool use count. */
|
|
135
113
|
export interface DreamTurn {
|
|
136
114
|
text: string;
|
|
@@ -158,14 +136,6 @@ export interface PlannedTaskState extends TaskStateBase {
|
|
|
158
136
|
type: "local_workflow" | "monitor_mcp";
|
|
159
137
|
}
|
|
160
138
|
/** Union of all concrete task states. */
|
|
161
|
-
export type TaskState = LocalBashTaskState | LocalAgentTaskState | RemoteAgentTaskState |
|
|
162
|
-
/**
|
|
163
|
-
* Filter available tools by permission role.
|
|
164
|
-
*
|
|
165
|
-
* @param role - The agent's permission role
|
|
166
|
-
* @param availableTools - Full set of tool names
|
|
167
|
-
* @returns Filtered tool names appropriate for the role
|
|
168
|
-
*/
|
|
169
|
-
export declare function filterToolsByRole(role: PermissionRole, availableTools: string[]): string[];
|
|
139
|
+
export type TaskState = LocalBashTaskState | LocalAgentTaskState | RemoteAgentTaskState | DreamTaskState | PlannedTaskState;
|
|
170
140
|
/** Create a new task state with defaults populated. */
|
|
171
141
|
export declare function createTaskState(overrides: Pick<TaskStateBase, "taskId" | "type" | "label"> & Partial<TaskStateBase>): TaskStateBase;
|
|
@@ -43,13 +43,6 @@ export interface PermissionCheckerDeps {
|
|
|
43
43
|
sessionId?: string;
|
|
44
44
|
/** Getter for current turn ID (changes per turn). */
|
|
45
45
|
getTurnId?: () => string;
|
|
46
|
-
/** Best-effort community telemetry sink for consent-gated sandbox metrics. */
|
|
47
|
-
communityTelemetryRecorder?: {
|
|
48
|
-
recordTelemetry(input: {
|
|
49
|
-
event: "community.sandbox.violation";
|
|
50
|
-
metadata?: Record<string, unknown>;
|
|
51
|
-
}): Promise<unknown>;
|
|
52
|
-
};
|
|
53
46
|
}
|
|
54
47
|
export declare class PermissionChecker {
|
|
55
48
|
private readonly ruleEngine;
|
|
@@ -64,15 +57,6 @@ export declare class PermissionChecker {
|
|
|
64
57
|
private readonly auditLogger;
|
|
65
58
|
private readonly sessionId;
|
|
66
59
|
private readonly getTurnId;
|
|
67
|
-
private readonly communityTelemetryRecorder;
|
|
68
|
-
private readonly communitySandboxTurnIds;
|
|
69
|
-
/**
|
|
70
|
-
* cut7c — community-skill (untrusted) scoped deny/ask rules, passed per-call as
|
|
71
|
-
* `ruleEngine.check(..., { extraRules })` for community turns. NOT a second engine:
|
|
72
|
-
* the single rule engine evaluates these alongside the base rules. FS/exec tools are
|
|
73
|
-
* absent here → they flow through the unified pipeline (workspace + prompt + OS sandbox).
|
|
74
|
-
*/
|
|
75
|
-
private readonly communityScopedRules;
|
|
76
60
|
private unregisterHook;
|
|
77
61
|
/** Tool meta cache — populated from ToolDefinition[] at agent creation */
|
|
78
62
|
private toolMetaCache;
|
|
@@ -95,12 +79,6 @@ export declare class PermissionChecker {
|
|
|
95
79
|
*/
|
|
96
80
|
setToolMeta(tools: ToolDefinition[]): void;
|
|
97
81
|
get ruleEngineRef(): PermissionRuleEngine;
|
|
98
|
-
/**
|
|
99
|
-
* cut7c — whether the CURRENT turn is a community-skill (untrusted) turn. Consumed by
|
|
100
|
-
* the OS-sandbox builder to tighten community execs (netPolicy=deny: no outbound network
|
|
101
|
-
* from the sandboxed child) as defense-in-depth on POSIX.
|
|
102
|
-
*/
|
|
103
|
-
isCommunitySandboxTurn(): boolean;
|
|
104
82
|
/** Fire permission.denied hook + onDenied callback + audit log */
|
|
105
83
|
private fireDenied;
|
|
106
84
|
private handleResult;
|
|
@@ -11,7 +11,7 @@ export interface PluginApi {
|
|
|
11
11
|
registerHook(phase: PluginHookPhase, handler: HookHandler<any>): void;
|
|
12
12
|
/** Register a skill (Markdown instructions + metadata). */
|
|
13
13
|
registerSkill(skill: WorkspaceSkill): void;
|
|
14
|
-
/** Get plugin-scoped configuration (from
|
|
14
|
+
/** Get plugin-scoped configuration (from xiaozhiclaw/plugins/name/config.json). */
|
|
15
15
|
getConfig(): Record<string, unknown>;
|
|
16
16
|
/**
|
|
17
17
|
* Set an activation check function. When it returns false, the plugin's
|
|
@@ -66,13 +66,6 @@ export interface PortableTool<TParams = Record<string, unknown>> {
|
|
|
66
66
|
description: string;
|
|
67
67
|
/** JSON Schema object describing the tool's parameters. */
|
|
68
68
|
parameters: Record<string, unknown>;
|
|
69
|
-
/**
|
|
70
|
-
* When true, the tool should NOT appear in the default tool list.
|
|
71
|
-
* The host injects it only for complex tasks (e.g. multi-step reasoning)
|
|
72
|
-
* or when explicitly activated via tool_search.
|
|
73
|
-
* This saves context tokens in simple conversations.
|
|
74
|
-
*/
|
|
75
|
-
shouldDefer?: boolean;
|
|
76
69
|
/**
|
|
77
70
|
* Whether the tool can safely run concurrently with other tools.
|
|
78
71
|
* When true, the runtime may execute this tool in parallel with others.
|
|
@@ -132,8 +125,9 @@ export interface PortableTool<TParams = Record<string, unknown>> {
|
|
|
132
125
|
reason?: string;
|
|
133
126
|
};
|
|
134
127
|
/**
|
|
135
|
-
* Brief keyword hint
|
|
128
|
+
* Brief keyword hint describing the tool's intent
|
|
136
129
|
* (e.g. "return the final response as structured JSON").
|
|
130
|
+
* Carried as capability metadata for UI/search surfaces.
|
|
137
131
|
*/
|
|
138
132
|
searchHint?: string;
|
|
139
133
|
/**
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
2
|
import type { WorkspaceSkill } from "../skill-system/skill-types.js";
|
|
3
|
-
export declare const
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export declare const SKILL_VIEW_TOOL_NAME: "skill_view";
|
|
4
|
+
export declare const SKILLS_LIST_TOOL_NAME: "skills_list";
|
|
5
|
+
export declare const SKILL_MANAGE_TOOL_NAME: "skill_manage";
|
|
6
|
+
export type SkillManageAction = "create" | "edit" | "patch" | "delete" | "promote";
|
|
7
|
+
export interface SkillViewParams {
|
|
8
|
+
name: string;
|
|
8
9
|
args?: string;
|
|
10
|
+
filePath?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SkillsListParams {
|
|
13
|
+
category?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SkillManageParams {
|
|
16
|
+
action: SkillManageAction;
|
|
17
|
+
name: string;
|
|
9
18
|
category?: string;
|
|
10
19
|
content?: string;
|
|
11
20
|
filePath?: string;
|
|
@@ -13,25 +22,49 @@ export interface SkillToolParams {
|
|
|
13
22
|
oldString?: string;
|
|
14
23
|
newString?: string;
|
|
15
24
|
}
|
|
16
|
-
export declare const
|
|
25
|
+
export declare const SKILL_VIEW_TOOL_SCHEMA: {
|
|
26
|
+
readonly type: "object";
|
|
27
|
+
readonly properties: {
|
|
28
|
+
readonly name: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly description: "The skill to use. Calling skill_view(name='X') loads that skill and you follow its instructions in THIS turn — that single call is all you need to USE a skill.";
|
|
31
|
+
};
|
|
32
|
+
readonly args: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "Optional context/arguments to pass to the skill.";
|
|
35
|
+
};
|
|
36
|
+
readonly filePath: {
|
|
37
|
+
readonly type: "string";
|
|
38
|
+
readonly description: "Optional path of a supporting file inside the skill folder to read instead of running the skill (e.g. a reference doc or script). When omitted, the skill is loaded and run.";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly required: readonly ["name"];
|
|
42
|
+
};
|
|
43
|
+
export declare const SKILLS_LIST_TOOL_SCHEMA: {
|
|
44
|
+
readonly type: "object";
|
|
45
|
+
readonly properties: {
|
|
46
|
+
readonly category: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly description: "Optional category filter.";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly required: readonly [];
|
|
52
|
+
};
|
|
53
|
+
export declare const SKILL_MANAGE_TOOL_SCHEMA: {
|
|
17
54
|
readonly type: "object";
|
|
18
55
|
readonly properties: {
|
|
19
56
|
readonly action: {
|
|
20
57
|
readonly type: "string";
|
|
21
|
-
readonly enum: readonly ["
|
|
58
|
+
readonly enum: readonly ["create", "edit", "patch", "delete", "promote"];
|
|
22
59
|
readonly description: string;
|
|
23
60
|
};
|
|
24
61
|
readonly name: {
|
|
25
62
|
readonly type: "string";
|
|
26
|
-
readonly description: "
|
|
27
|
-
};
|
|
28
|
-
readonly args: {
|
|
29
|
-
readonly type: "string";
|
|
30
|
-
readonly description: "Arguments or context to pass when invoking a skill.";
|
|
63
|
+
readonly description: "The skill name to author or manage.";
|
|
31
64
|
};
|
|
32
65
|
readonly category: {
|
|
33
66
|
readonly type: "string";
|
|
34
|
-
readonly description: "
|
|
67
|
+
readonly description: "Optional category label for create/edit.";
|
|
35
68
|
};
|
|
36
69
|
readonly content: {
|
|
37
70
|
readonly type: "string";
|
|
@@ -39,22 +72,22 @@ export declare const SKILL_TOOL_SCHEMA: {
|
|
|
39
72
|
};
|
|
40
73
|
readonly filePath: {
|
|
41
74
|
readonly type: "string";
|
|
42
|
-
readonly description: "Path of a file inside the skill folder
|
|
75
|
+
readonly description: "Path of a file inside the skill folder to write with fileContent (create/edit). SKILL.md itself always goes through 'content'.";
|
|
43
76
|
};
|
|
44
77
|
readonly fileContent: {
|
|
45
78
|
readonly type: "string";
|
|
46
|
-
readonly description: "Supporting file content. With filePath, writes that file inside the skill folder
|
|
79
|
+
readonly description: "Supporting file content. With filePath, writes that file inside the skill folder.";
|
|
47
80
|
};
|
|
48
81
|
readonly oldString: {
|
|
49
82
|
readonly type: "string";
|
|
50
|
-
readonly description: "Text to find for patch action.";
|
|
83
|
+
readonly description: "Text to find for the patch action.";
|
|
51
84
|
};
|
|
52
85
|
readonly newString: {
|
|
53
86
|
readonly type: "string";
|
|
54
|
-
readonly description: "Replacement text for patch action.";
|
|
87
|
+
readonly description: "Replacement text for the patch action.";
|
|
55
88
|
};
|
|
56
89
|
};
|
|
57
|
-
readonly required: readonly ["action"];
|
|
90
|
+
readonly required: readonly ["action", "name"];
|
|
58
91
|
};
|
|
59
92
|
export interface SkillListItem {
|
|
60
93
|
name: string;
|
|
@@ -81,14 +114,14 @@ export interface SkillManageResult {
|
|
|
81
114
|
export interface SkillToolDeps {
|
|
82
115
|
/** List all available skills (Layer 0 metadata). */
|
|
83
116
|
listSkills(): WorkspaceSkill[];
|
|
84
|
-
/** List skills with full detail (for
|
|
117
|
+
/** List skills with full detail (for skills_list). */
|
|
85
118
|
listSkillsFull(category?: string): Promise<SkillListOutput>;
|
|
86
119
|
/** Read skill content (Layer 1 instructions). */
|
|
87
120
|
readSkillContent(name: string): Promise<string | null>;
|
|
88
121
|
/** View skill with optional file path. */
|
|
89
122
|
viewSkill(name: string, filePath?: string): Promise<SkillViewOutput | null>;
|
|
90
|
-
/**
|
|
91
|
-
|
|
123
|
+
/** Run a skill — returns its instructions for the main model to follow inline (mainstream, no sub-turn). */
|
|
124
|
+
runSkillInvocation?(skillName: string, skillContent: string, userArgs: string | undefined, signal?: AbortSignal): Promise<string>;
|
|
92
125
|
/** Manage skill (create/edit/patch/delete). */
|
|
93
126
|
manageSkill(params: {
|
|
94
127
|
action: string;
|
|
@@ -103,4 +136,6 @@ export interface SkillToolDeps {
|
|
|
103
136
|
/** Promote a project-level skill to user/global level. Returns success message. */
|
|
104
137
|
promoteSkill?(name: string): Promise<SkillManageResult>;
|
|
105
138
|
}
|
|
106
|
-
export declare function
|
|
139
|
+
export declare function createSkillViewTool(deps: SkillToolDeps): PortableTool<SkillViewParams>;
|
|
140
|
+
export declare function createSkillsListTool(deps: SkillToolDeps): PortableTool<SkillsListParams>;
|
|
141
|
+
export declare function createSkillManageTool(deps: SkillToolDeps): PortableTool<SkillManageParams>;
|
|
@@ -5,27 +5,16 @@
|
|
|
5
5
|
* New runtime code should depend on a ToolCatalog/ToolRegistry instance; the
|
|
6
6
|
* module-level functions below remain as a compatibility facade for older
|
|
7
7
|
* bootstrap paths while those call sites are migrated.
|
|
8
|
+
*
|
|
9
|
+
* All registered tools are resident: every enabled tool is offered to the model
|
|
10
|
+
* each turn (hermes-aligned). There is no deferral / on-demand discovery.
|
|
8
11
|
*/
|
|
9
12
|
import type { PortableTool } from "./portable-tool.js";
|
|
10
13
|
import type { ToolDefinition } from "../protocol/wire/index.js";
|
|
11
14
|
import { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent } from "./tool-access.js";
|
|
12
15
|
export { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent };
|
|
13
|
-
/**
|
|
14
|
-
* Deferral policy (CC-aligned): a few HIGH-FREQUENCY capabilities stay LOADED even if their
|
|
15
|
-
* factory marks them deferrable, so the model never has to voluntarily tool_search for the
|
|
16
|
-
* things users ask for most. Only the long tail (rare media variants, niche tools) and MCP
|
|
17
|
-
* stay deferred. Trades a small always-on token cost on common paths for discovery
|
|
18
|
-
* reliability — mirrors Claude Code (keeps common tools loaded; defers only the long
|
|
19
|
-
* tail / large MCP sets) rather than relying on the model to decide to search.
|
|
20
|
-
*/
|
|
21
|
-
export declare const COMMON_LOADED_CAPABILITIES: Set<string>;
|
|
22
16
|
export declare class ToolRegistry {
|
|
23
17
|
private readonly toolPool;
|
|
24
|
-
private readonly activatedTools;
|
|
25
|
-
private readonly maxActivatedDeferred;
|
|
26
|
-
constructor(options?: {
|
|
27
|
-
maxActivatedDeferred?: number;
|
|
28
|
-
});
|
|
29
18
|
setTools(tools: PortableTool[]): void;
|
|
30
19
|
addTool(tool: PortableTool<any>): void;
|
|
31
20
|
addTools(tools: PortableTool<any>[]): void;
|
|
@@ -36,22 +25,7 @@ export declare class ToolRegistry {
|
|
|
36
25
|
getToolCount(): number;
|
|
37
26
|
executeTool(name: string, toolCallId: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<import("./portable-tool.js").PortableToolResult>;
|
|
38
27
|
getTools(): PortableTool[];
|
|
39
|
-
|
|
40
|
-
isToolActivated(name: string): boolean;
|
|
41
|
-
clearActivatedTools(): void;
|
|
42
|
-
/**
|
|
43
|
-
* SSOT for "which tools are deferred". Both the deferred-tool index (system
|
|
44
|
-
* prompt) and the tool_search corpus consume this — never re-derive the
|
|
45
|
-
* deferred set inline. Lists every deferred+enabled tool regardless of
|
|
46
|
-
* activation, so the model can always see/search a capability that exists.
|
|
47
|
-
* searchHint is carried for the search corpus; the prompt index ignores it.
|
|
48
|
-
*/
|
|
49
|
-
listDeferredTools(): Array<{
|
|
50
|
-
name: string;
|
|
51
|
-
description: string;
|
|
52
|
-
searchHint?: string;
|
|
53
|
-
}>;
|
|
54
|
-
getToolManifest(includeDeferred?: boolean): ToolDefinition[];
|
|
28
|
+
getToolManifest(): ToolDefinition[];
|
|
55
29
|
}
|
|
56
30
|
export declare function getDefaultToolRegistry(): ToolRegistry;
|
|
57
31
|
export declare function setToolPool(tools: PortableTool[]): void;
|
|
@@ -64,12 +38,4 @@ export declare function getToolNames(): string[];
|
|
|
64
38
|
export declare function getToolCount(): number;
|
|
65
39
|
export declare function executeTool(name: string, toolCallId: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<import("./portable-tool.js").PortableToolResult>;
|
|
66
40
|
export declare function getTools(): PortableTool[];
|
|
67
|
-
export declare function
|
|
68
|
-
export declare function isToolActivated(name: string): boolean;
|
|
69
|
-
export declare function clearActivatedTools(): void;
|
|
70
|
-
export declare function listDeferredTools(): Array<{
|
|
71
|
-
name: string;
|
|
72
|
-
description: string;
|
|
73
|
-
searchHint?: string;
|
|
74
|
-
}>;
|
|
75
|
-
export declare function getToolManifest(includeDeferred?: boolean): ToolDefinition[];
|
|
41
|
+
export declare function getToolManifest(): ToolDefinition[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ACP ServerAgent-Client Protocol server layer for qlogicagent.
|
|
3
3
|
*
|
|
4
4
|
* This module implements qlogicagent as an ACP Server, allowing any ACP-compliant
|
|
5
|
-
* host (AionUI, Cursor,
|
|
5
|
+
* host (AionUI, Cursor, xiaozhiclaw, etc.) to connect and interact with the agent.
|
|
6
6
|
*
|
|
7
7
|
* Protocol: ACP v1 over JSON-RPC 2.0 / stdio (line-delimited JSON).
|
|
8
8
|
*
|
|
@@ -94,6 +94,18 @@ export interface AcpRequestHandler {
|
|
|
94
94
|
handleAcpProductReplay(params: Record<string, unknown>): Promise<unknown>;
|
|
95
95
|
handleAcpProductStatus(params: Record<string, unknown>): Promise<unknown>;
|
|
96
96
|
handleAcpProductSubscribe(params: Record<string, unknown>): Promise<unknown>;
|
|
97
|
+
handleAcpGoalStart(params: Record<string, unknown>): Promise<unknown>;
|
|
98
|
+
handleAcpGoalStatus(params: Record<string, unknown>): Promise<unknown>;
|
|
99
|
+
handleAcpGoalPause(params: Record<string, unknown>): Promise<unknown>;
|
|
100
|
+
handleAcpGoalResume(params: Record<string, unknown>): Promise<unknown>;
|
|
101
|
+
handleAcpGoalUpdateGoal(params: Record<string, unknown>): Promise<unknown>;
|
|
102
|
+
handleAcpGoalStop(params: Record<string, unknown>): Promise<unknown>;
|
|
103
|
+
handleAcpGoalMessage(params: Record<string, unknown>): Promise<unknown>;
|
|
104
|
+
handleAcpGoalSubscribe(params: Record<string, unknown>): Promise<unknown>;
|
|
105
|
+
handleAcpGoalEvents(params: Record<string, unknown>): Promise<unknown>;
|
|
106
|
+
handleAcpMentionDelegate(params: Record<string, unknown>): Promise<unknown>;
|
|
107
|
+
handleAcpMentionCancel(params: Record<string, unknown>): Promise<unknown>;
|
|
108
|
+
handleAcpMentionList(params: Record<string, unknown>): Promise<unknown>;
|
|
97
109
|
}
|
|
98
110
|
export interface AcpServerConfig {
|
|
99
111
|
verbose?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.16.
|
|
3
|
+
"version": "2.16.5",
|
|
4
4
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -80,7 +80,6 @@
|
|
|
80
80
|
"check:workspace-hygiene:strict": "node scripts/check-workspace-hygiene.mjs --strict",
|
|
81
81
|
"check:package-artifact": "npm run build && node scripts/check-package-artifact.mjs",
|
|
82
82
|
"redteam:community-desensitization": "tsx src/runtime/community/community-desensitization-red-team-cli.ts",
|
|
83
|
-
"redteam:community-sandbox": "tsx src/skills/permissions/community-sandbox-red-team-cli.ts",
|
|
84
83
|
"clean:workspace-hygiene": "node scripts/clean-workspace-hygiene.mjs",
|
|
85
84
|
"release": "node scripts/release.mjs"
|
|
86
85
|
},
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TeamRegistry — session-scoped roster for the team tool: create registers
|
|
3
|
-
* members (producer), the send action routes messages to them (consumer).
|
|
4
|
-
*
|
|
5
|
-
* The team tool spawns each member as a real subprocess agent
|
|
6
|
-
* (AgentProcessManager) and registers a delivery closure here. The send
|
|
7
|
-
* action looks the target up by name or full member id and routes the message
|
|
8
|
-
* into the member's process via that closure, returning the member's reply.
|
|
9
|
-
*
|
|
10
|
-
* This registry is the ONLY routing path to team members, so an
|
|
11
|
-
* unregistered/dead target fails loud.
|
|
12
|
-
*/
|
|
13
|
-
export interface TeamRegistryMember {
|
|
14
|
-
/** Full member id, e.g. "team-research-coder". */
|
|
15
|
-
memberId: string;
|
|
16
|
-
/** Display name within the team, e.g. "coder". */
|
|
17
|
-
name: string;
|
|
18
|
-
/** Team this member belongs to. */
|
|
19
|
-
teamName: string;
|
|
20
|
-
/** Role description. */
|
|
21
|
-
role: string;
|
|
22
|
-
/** Deliver a message into the member's process and return its reply text. */
|
|
23
|
-
deliver: (message: string, fromId: string) => Promise<string>;
|
|
24
|
-
/** Whether the member's process is still alive. */
|
|
25
|
-
isAlive: () => boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface TeamRegistryListEntry {
|
|
28
|
-
memberId: string;
|
|
29
|
-
name: string;
|
|
30
|
-
teamName: string;
|
|
31
|
-
role: string;
|
|
32
|
-
alive: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface DeliveryOutcome {
|
|
35
|
-
ok: boolean;
|
|
36
|
-
/** Per-recipient replies (broadcast may have several). */
|
|
37
|
-
replies?: Array<{
|
|
38
|
-
memberId: string;
|
|
39
|
-
name: string;
|
|
40
|
-
reply: string;
|
|
41
|
-
}>;
|
|
42
|
-
error?: string;
|
|
43
|
-
}
|
|
44
|
-
export declare class TeamRegistry {
|
|
45
|
-
private readonly members;
|
|
46
|
-
register(member: TeamRegistryMember): void;
|
|
47
|
-
unregister(memberId: string): void;
|
|
48
|
-
/** Live roster (alive flag reflects the underlying process). */
|
|
49
|
-
list(): TeamRegistryListEntry[];
|
|
50
|
-
/**
|
|
51
|
-
* Resolve a send `to` token to concrete members.
|
|
52
|
-
* Accepts a member name ("coder"), a full member id ("team-x-coder"),
|
|
53
|
-
* or "*" for broadcast to all alive members.
|
|
54
|
-
* Returns [] when nothing matches (caller fails loud).
|
|
55
|
-
*/
|
|
56
|
-
private resolveTargets;
|
|
57
|
-
/**
|
|
58
|
-
* Deliver a message to the resolved target(s) and collect replies.
|
|
59
|
-
* Fail-loud: no target → ok:false; any delivery error → surfaced.
|
|
60
|
-
*/
|
|
61
|
-
deliver(to: string, message: string, fromId: string): Promise<DeliveryOutcome>;
|
|
62
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ToolCatalog } from "../../runtime/ports/index.js";
|
|
2
|
-
import type { AgentLogger } from "../../agent/types.js";
|
|
3
|
-
import { type TeamToolServiceHost } from "./team-tool-service.js";
|
|
4
|
-
import type { TeamRegistry } from "./team-registry.js";
|
|
5
|
-
export interface TeamToolRegistrationDeps {
|
|
6
|
-
host: TeamToolServiceHost;
|
|
7
|
-
log: AgentLogger;
|
|
8
|
-
toolCatalog: ToolCatalog;
|
|
9
|
-
teamRegistry: TeamRegistry;
|
|
10
|
-
}
|
|
11
|
-
export declare function registerTeamTool({ host, log, toolCatalog, teamRegistry }: TeamToolRegistrationDeps): void;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { AgentLogger } from "../../agent/types.js";
|
|
2
|
-
import type { BackgroundTaskManager } from "../../runtime/infra/background-tasks.js";
|
|
3
|
-
import type { TeamToolDeps } from "../../skills/tools/team-tool.js";
|
|
4
|
-
import type { TeamRegistry } from "./team-registry.js";
|
|
5
|
-
export interface TeamToolService extends TeamToolDeps {
|
|
6
|
-
dispose(): void;
|
|
7
|
-
}
|
|
8
|
-
export interface TeamToolServiceHost {
|
|
9
|
-
readonly currentSessionId: string;
|
|
10
|
-
readonly verbose: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* The leader's resolved LLM config, pushed to each spawned member as standing
|
|
13
|
-
* session config (session/set_config_option). Without it a standalone member
|
|
14
|
-
* (no llmrouter directory to hydrate a catalog from) cannot provision a
|
|
15
|
-
* provider, and its first reply turn fails with NO_PROVIDER. Returns null
|
|
16
|
-
* when the leader has no resolved provider yet.
|
|
17
|
-
*/
|
|
18
|
-
getLlmConfig(): {
|
|
19
|
-
provider: string;
|
|
20
|
-
model: string;
|
|
21
|
-
apiKey: string;
|
|
22
|
-
baseUrl?: string;
|
|
23
|
-
} | null;
|
|
24
|
-
/** Lightweight memory INDEX injected into each member's system prompt (parent context). */
|
|
25
|
-
getMemoryIndex(): string | null;
|
|
26
|
-
/**
|
|
27
|
-
* Unified background-task registry. Team members register here as `team_member`
|
|
28
|
-
* tasks so the `task` tool's list/output/cancel reach them. Null when unbound.
|
|
29
|
-
*/
|
|
30
|
-
getBackgroundTasks(): BackgroundTaskManager | null;
|
|
31
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
32
|
-
emitAgentStatus(agentId: string, state: string, extra?: {
|
|
33
|
-
missedBeats?: number;
|
|
34
|
-
lastActivityAt?: number;
|
|
35
|
-
usage?: {
|
|
36
|
-
inputTokens: number;
|
|
37
|
-
outputTokens: number;
|
|
38
|
-
totalTokens: number;
|
|
39
|
-
};
|
|
40
|
-
}): void;
|
|
41
|
-
handleMcpToolCall(memberId: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
42
|
-
}
|
|
43
|
-
export declare function createTeamToolService(host: TeamToolServiceHost, log: AgentLogger, registry: TeamRegistry): TeamToolService;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { TurnEvent, TurnRequest } from "../agent/types.js";
|
|
2
|
-
import type { HookRegistry } from "../contracts/hooks.js";
|
|
3
|
-
import type { ToolCatalog } from "../runtime/ports/index.js";
|
|
4
|
-
import { type CommunitySignalReporter } from "../runtime/community/community-signal-reporter.js";
|
|
5
|
-
import { type SkillSandbox } from "../runtime/sandbox/skill-sandbox.js";
|
|
6
|
-
import { type SkillLifecycleRecord } from "../skills/skill-system/skill-lifecycle.js";
|
|
7
|
-
export interface SkillSubturnAgent {
|
|
8
|
-
run(request: TurnRequest, signal?: AbortSignal): AsyncGenerator<TurnEvent>;
|
|
9
|
-
}
|
|
10
|
-
export interface SkillSubturnHost {
|
|
11
|
-
getAgent(): SkillSubturnAgent | null;
|
|
12
|
-
getCurrentSessionId(): string;
|
|
13
|
-
getCurrentHooks(): HookRegistry | null;
|
|
14
|
-
}
|
|
15
|
-
export interface ExecuteSkillSubturnParams {
|
|
16
|
-
host: SkillSubturnHost;
|
|
17
|
-
toolCatalog: ToolCatalog;
|
|
18
|
-
skillName: string;
|
|
19
|
-
skillContent: string;
|
|
20
|
-
userArgs?: string;
|
|
21
|
-
signal?: AbortSignal;
|
|
22
|
-
communitySignalReporter?: CommunitySignalReporter | null;
|
|
23
|
-
skillSandbox?: SkillSandbox | null;
|
|
24
|
-
}
|
|
25
|
-
export declare function executeSkillSubturn(params: ExecuteSkillSubturnParams): Promise<string>;
|
|
26
|
-
export declare function resolveSkillSubagentTypeForLifecycle(skillName: string, record: SkillLifecycleRecord | undefined): string;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { HookRegistry } from "../../contracts/hooks.js";
|
|
2
|
-
import type { CommunityDiscoveryCoordinator } from "../community/community-discovery-coordinator.js";
|
|
3
|
-
export declare const SKILL_RECALL_CONFIG: {
|
|
4
|
-
readonly MAX_RECALLED_SKILLS: 3;
|
|
5
|
-
readonly MAX_SKILL_CONTENT_CHARS: 800;
|
|
6
|
-
readonly CACHE_TTL_MS: number;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Detect whether user message contains retrospective/cross-reference semantics
|
|
10
|
-
* OR similar-task patterns that could benefit from existing skills.
|
|
11
|
-
* Returns extracted keywords for skill matching if triggered, or null.
|
|
12
|
-
*/
|
|
13
|
-
export declare function detectRetrospectiveTrigger(message: string): string[] | null;
|
|
14
|
-
export interface SkillRecallHooksDeps {
|
|
15
|
-
/** Current project cwd (to exclude from cross-project search). */
|
|
16
|
-
currentCwd?: string;
|
|
17
|
-
/** Optional online community discovery coordinator. */
|
|
18
|
-
communityDiscovery?: CommunityDiscoveryCoordinator | null;
|
|
19
|
-
/** Logger. */
|
|
20
|
-
log: {
|
|
21
|
-
debug(msg: string): void;
|
|
22
|
-
warn(msg: string): void;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Register the cross-project skill recall hook on `memory.before_recall`.
|
|
27
|
-
* Runs at lower priority (60) than QMemory prefetch (50) so it supplements,
|
|
28
|
-
* not replaces, the standard memory recall.
|
|
29
|
-
*
|
|
30
|
-
* When triggered, injects cross-project skill metadata into recalledMemories.
|
|
31
|
-
*/
|
|
32
|
-
export declare function registerSkillRecallHooks(hooks: HookRegistry, deps: SkillRecallHooksDeps): () => void;
|
|
33
|
-
/**
|
|
34
|
-
* Invalidate the cross-project skill index cache.
|
|
35
|
-
* Call when skills are created/deleted/promoted to refresh.
|
|
36
|
-
*/
|
|
37
|
-
export declare function invalidateSkillRecallCache(): void;
|