qlogicagent 2.12.7 → 2.12.9
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 +91 -157
- package/dist/agent.js +6 -6
- package/dist/cli.js +411 -426
- package/dist/index.js +410 -425
- package/dist/orchestration.js +6 -6
- package/dist/protocol.js +1 -1
- package/dist/types/agent/memory-recall-injection.d.ts +34 -0
- package/dist/types/agent/tool-loop/budget-continuation-policy.d.ts +22 -0
- package/dist/types/agent/tool-loop/completion-action-policy.d.ts +19 -0
- package/dist/types/agent/tool-loop/completion-stop-policy.d.ts +19 -0
- package/dist/types/agent/tool-loop/compression-pipeline.d.ts +44 -0
- package/dist/types/agent/tool-loop/skill-instruction-policy.d.ts +7 -0
- package/dist/types/agent/tool-loop/stream-error-recovery.d.ts +59 -0
- package/dist/types/agent/tool-loop/tool-failure-policy.d.ts +22 -0
- package/dist/types/agent/types.d.ts +2 -2
- package/dist/types/cli/acp-message-router.d.ts +8 -0
- package/dist/types/cli/acp-session-host.d.ts +20 -4
- package/dist/types/cli/cli-agent-builder.d.ts +1 -1
- package/dist/types/cli/core-tool-coordinator.d.ts +1 -0
- package/dist/types/cli/core-tools/config-tool-bootstrap.d.ts +1 -5
- package/dist/types/cli/core-tools/config-tool-service.d.ts +9 -5
- package/dist/types/cli/core-tools/registry.d.ts +1 -2
- package/dist/types/cli/core-tools/session-tool-manifest.d.ts +11 -0
- package/dist/types/cli/core-tools/team-registry.d.ts +8 -8
- package/dist/types/cli/core-tools/team-tool-service.d.ts +6 -3
- package/dist/types/cli/dev-tools/dev-tool-registry.d.ts +1 -2
- package/dist/types/cli/gateway-rpc-connection.d.ts +50 -0
- package/dist/types/cli/handlers/session-handler.d.ts +2 -1
- package/dist/types/cli/handlers/workflow-handler.d.ts +10 -0
- package/dist/types/cli/model-client-resolver.d.ts +12 -3
- package/dist/types/cli/resolved-agent-cache.d.ts +47 -0
- package/dist/types/cli/rpc-registry.d.ts +59 -5
- package/dist/types/cli/session-context.d.ts +32 -0
- package/dist/types/cli/skill-meta-tool-bootstrap.d.ts +7 -0
- package/dist/types/cli/stdio-acp-protocol-coordinator.d.ts +18 -0
- package/dist/types/cli/stdio-acp-request-host.d.ts +3 -0
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +50 -0
- package/dist/types/cli/stdio-server.d.ts +103 -178
- package/dist/types/cli/stdio-session-runtime-coordinator.d.ts +19 -0
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +30 -0
- package/dist/types/cli/tool-bootstrap-media-registration.d.ts +8 -0
- package/dist/types/cli/tool-bootstrap-paths.d.ts +7 -0
- package/dist/types/cli/tool-bootstrap-web-registration.d.ts +13 -0
- package/dist/types/cli/tool-bootstrap-workflow-registration.d.ts +7 -0
- package/dist/types/cli/tool-bootstrap.d.ts +5 -22
- package/dist/types/cli/tunable-store.d.ts +26 -0
- package/dist/types/cli/workflow-host-adapter.d.ts +29 -0
- package/dist/types/contracts/hooks.d.ts +6 -0
- package/dist/types/orchestration/workflow/run-history-store.d.ts +58 -0
- package/dist/types/orchestration/workflow/workflow-controller.d.ts +23 -1
- package/dist/types/orchestration/workflow/workflow-store.d.ts +24 -0
- package/dist/types/protocol/wire/acp-protocol.d.ts +1 -2
- package/dist/types/protocol/wire/gateway-rpc.d.ts +0 -112
- package/dist/types/runtime/config/tunable-defaults.d.ts +6 -0
- package/dist/types/runtime/infra/agent-paths.d.ts +0 -2
- package/dist/types/runtime/infra/agent-process.d.ts +12 -9
- package/dist/types/runtime/infra/default-path-service.d.ts +0 -1
- package/dist/types/runtime/infra/index.d.ts +1 -1
- package/dist/types/runtime/infra/key-pool.d.ts +1 -0
- package/dist/types/runtime/infra/llmrouter-catalog.d.ts +8 -0
- package/dist/types/runtime/ports/path-service.d.ts +0 -1
- package/dist/types/runtime/ports/tool-contracts.d.ts +1 -1
- package/dist/types/runtime/prompt/environment-context.d.ts +13 -0
- package/dist/types/runtime/prompt/index.d.ts +1 -0
- package/dist/types/runtime/prompt/prompt-policy.d.ts +2 -0
- package/dist/types/runtime/prompt/system-prompt-sections.d.ts +2 -0
- package/dist/types/runtime/session/session-catalog.d.ts +4 -0
- package/dist/types/runtime/session/session-metadata-store.d.ts +8 -0
- package/dist/types/runtime/session/session-paths.d.ts +9 -0
- package/dist/types/runtime/session/session-persistence.d.ts +14 -159
- package/dist/types/runtime/session/session-resume.d.ts +4 -0
- package/dist/types/runtime/session/session-schema.d.ts +10 -0
- package/dist/types/runtime/session/session-summary.d.ts +5 -0
- package/dist/types/runtime/session/session-transcript-store.d.ts +13 -0
- package/dist/types/runtime/session/session-types.d.ts +77 -0
- package/dist/types/runtime/session/session-write-queue.d.ts +2 -0
- package/dist/types/runtime/tasks/task-types.d.ts +1 -1
- package/dist/types/skills/mcp/index.d.ts +1 -3
- package/dist/types/skills/mcp/mcp-manager.d.ts +14 -38
- package/dist/types/skills/permissions/rule-engine.d.ts +1 -0
- package/dist/types/skills/plugins/plugin-api.d.ts +0 -1
- package/dist/types/skills/plugins/plugin-loader.d.ts +0 -4
- package/dist/types/skills/portable-tool.d.ts +2 -2
- package/dist/types/skills/tools/config-tool.d.ts +1 -3
- package/dist/types/skills/tools/skill-tool.d.ts +2 -2
- package/dist/types/skills/tools/team-tool.d.ts +44 -4
- package/dist/types/skills/tools/tool-search-tool.d.ts +11 -0
- package/package.json +3 -2
- package/dist/types/assistants/assistant-registry.d.ts +0 -4
- package/dist/types/assistants/assistant-store.d.ts +0 -23
- package/dist/types/assistants/assistant-turn-context.d.ts +0 -20
- package/dist/types/assistants/assistant-types.d.ts +0 -38
- package/dist/types/assistants/plugin-assistant-registry.d.ts +0 -16
- package/dist/types/cli/core-tools/utility-tool-bootstrap.d.ts +0 -12
- package/dist/types/cli/dev-tools/repl-tool-service.d.ts +0 -5
- package/dist/types/cli/handlers/assistants-handler.d.ts +0 -13
- package/dist/types/skills/mcp/mcp-http-client.d.ts +0 -68
- package/dist/types/skills/mcp/mcp-stdio-client.d.ts +0 -86
- package/dist/types/skills/think-tool.d.ts +0 -16
- package/dist/types/skills/tools/apply-patch-tool.d.ts +0 -29
- package/dist/types/skills/tools/mcp-client-types.d.ts +0 -269
- package/dist/types/skills/tools/mcp-resource-tools.d.ts +0 -14
- package/dist/types/skills/tools/mcp-tool.d.ts +0 -249
- package/dist/types/skills/tools/project-switch-tool.d.ts +0 -24
- package/dist/types/skills/tools/repl-tool.d.ts +0 -70
- package/dist/types/skills/tools/send-message-tool.d.ts +0 -57
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ChatMessage } from "../../protocol/wire/index.js";
|
|
2
|
+
import type { TokenUsage } from "../../agent/types.js";
|
|
3
|
+
import type { SessionUsageSnapshot } from "./session-state.js";
|
|
4
|
+
export declare const SESSION_SCHEMA_VERSION = 1;
|
|
5
|
+
export interface SessionMetadata {
|
|
6
|
+
schemaVersion?: number;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
projectId: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
lastActiveAt: string;
|
|
11
|
+
model?: string;
|
|
12
|
+
/** Agent that owns this session (e.g. "qlogicagent", "codex"). */
|
|
13
|
+
agentId?: string;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
turnCount: number;
|
|
16
|
+
messageCount: number;
|
|
17
|
+
title?: string;
|
|
18
|
+
taskSummary?: string;
|
|
19
|
+
taskSummaryGeneratedAt?: number;
|
|
20
|
+
pinnedAt?: string;
|
|
21
|
+
archivedAt?: string;
|
|
22
|
+
sealedAt?: string;
|
|
23
|
+
previousSessionId?: string;
|
|
24
|
+
carryoverSummary?: string;
|
|
25
|
+
type?: "personal" | "group";
|
|
26
|
+
ownerPlatform?: string;
|
|
27
|
+
ownerId?: string;
|
|
28
|
+
groupKey?: string;
|
|
29
|
+
groupName?: string;
|
|
30
|
+
groupPlatform?: string;
|
|
31
|
+
totalInputTokens?: number;
|
|
32
|
+
totalOutputTokens?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface PersistedSession {
|
|
35
|
+
metadata: SessionMetadata;
|
|
36
|
+
messages: PersistedChatMessage[];
|
|
37
|
+
}
|
|
38
|
+
export interface MessageDisplayMetadata {
|
|
39
|
+
messageId?: string;
|
|
40
|
+
platform?: string;
|
|
41
|
+
sourceChannel?: string;
|
|
42
|
+
source?: string;
|
|
43
|
+
chatId?: string;
|
|
44
|
+
userId?: string;
|
|
45
|
+
userName?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface PersistedChatMessage extends ChatMessage {
|
|
48
|
+
timestamp?: string;
|
|
49
|
+
turnId?: string;
|
|
50
|
+
usage?: TokenUsage;
|
|
51
|
+
displayMetadata?: MessageDisplayMetadata;
|
|
52
|
+
}
|
|
53
|
+
export interface SessionListEntry {
|
|
54
|
+
sessionId: string;
|
|
55
|
+
title?: string;
|
|
56
|
+
lastActiveAt: string;
|
|
57
|
+
messageCount: number;
|
|
58
|
+
model?: string;
|
|
59
|
+
agentId?: string;
|
|
60
|
+
pinnedAt?: string;
|
|
61
|
+
archivedAt?: string;
|
|
62
|
+
sealedAt?: string;
|
|
63
|
+
projectId: string;
|
|
64
|
+
type?: "personal" | "group";
|
|
65
|
+
createdAt: string;
|
|
66
|
+
groupKey?: string;
|
|
67
|
+
previousSessionId?: string;
|
|
68
|
+
carryoverSummary?: string | null;
|
|
69
|
+
}
|
|
70
|
+
export interface TaskSummaryDeps {
|
|
71
|
+
transport: import("../ports/index.js").LLMTransport;
|
|
72
|
+
apiKey: string;
|
|
73
|
+
model: string;
|
|
74
|
+
}
|
|
75
|
+
export type SessionMetadataPatch = Partial<Record<keyof SessionMetadata, SessionMetadata[keyof SessionMetadata] | null>>;
|
|
76
|
+
export type SessionStateSaveMetadata = Partial<SessionMetadata>;
|
|
77
|
+
export type { ChatMessage, SessionUsageSnapshot, TokenUsage };
|
|
@@ -117,7 +117,7 @@ export interface TeamMemberTaskState extends TaskStateBase {
|
|
|
117
117
|
teamName: string;
|
|
118
118
|
/** Member's display name. */
|
|
119
119
|
agentName: string;
|
|
120
|
-
/** Stable member id (`team-<team>-<name>`) — routes
|
|
120
|
+
/** Stable member id (`team-<team>-<name>`) — routes team send / cancel. */
|
|
121
121
|
memberId: string;
|
|
122
122
|
/** Subprocess PID, once spawned. */
|
|
123
123
|
pid?: number;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { McpHttpClient, type McpHttpClientConfig } from "./mcp-http-client.js";
|
|
3
|
-
export { McpManager, parseMcpConfig, type McpServerEntry, type McpManagerConfig } from "./mcp-manager.js";
|
|
1
|
+
export { McpManager, parseMcpConfig, validateMcpToolWorkspaceBoundary, type McpServerEntry, type McpManagerConfig } from "./mcp-manager.js";
|
|
@@ -4,20 +4,6 @@ interface ToolRegistryLike {
|
|
|
4
4
|
getToolNames(): string[];
|
|
5
5
|
removeTool(name: string): boolean;
|
|
6
6
|
}
|
|
7
|
-
/** MCP resource entry from resources/list */
|
|
8
|
-
export interface McpResourceEntry {
|
|
9
|
-
uri: string;
|
|
10
|
-
name: string;
|
|
11
|
-
mimeType?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
}
|
|
14
|
-
/** MCP resource content from resources/read */
|
|
15
|
-
export interface McpResourceContent {
|
|
16
|
-
uri: string;
|
|
17
|
-
mimeType?: string;
|
|
18
|
-
text?: string;
|
|
19
|
-
blob?: string;
|
|
20
|
-
}
|
|
21
7
|
export interface McpServerEntry {
|
|
22
8
|
/** Server display name */
|
|
23
9
|
name: string;
|
|
@@ -35,7 +21,7 @@ export interface McpServerEntry {
|
|
|
35
21
|
url?: string;
|
|
36
22
|
/** Extra HTTP headers (http only) */
|
|
37
23
|
headers?: Record<string, string>;
|
|
38
|
-
/** Init timeout (ms) */
|
|
24
|
+
/** Init timeout (ms) — accepted for config compatibility; mcporter owns connect timeouts. */
|
|
39
25
|
initTimeoutMs?: number;
|
|
40
26
|
/** Whether this server is disabled (skip connection) */
|
|
41
27
|
disabled?: boolean;
|
|
@@ -52,46 +38,36 @@ export interface McpManagerConfig {
|
|
|
52
38
|
toolCatalog?: ToolRegistryLike;
|
|
53
39
|
}
|
|
54
40
|
export declare class McpManager {
|
|
55
|
-
private
|
|
56
|
-
private
|
|
41
|
+
private runtime;
|
|
42
|
+
private definitions;
|
|
43
|
+
private toolsByServer;
|
|
44
|
+
private injectedNames;
|
|
57
45
|
private log;
|
|
58
46
|
private workspaceRoot?;
|
|
59
47
|
private toolCatalog?;
|
|
60
48
|
constructor(config: McpManagerConfig);
|
|
49
|
+
private toServerDefinition;
|
|
61
50
|
/**
|
|
62
|
-
* Connect to all configured MCP servers
|
|
51
|
+
* Connect to all configured MCP servers and snapshot their tools.
|
|
52
|
+
* Per-server failures are logged but don't block the rest.
|
|
63
53
|
*/
|
|
64
54
|
connectAll(): Promise<void>;
|
|
65
55
|
/**
|
|
66
|
-
* Register all MCP tools into the
|
|
56
|
+
* Register all snapshotted MCP tools into the tool pool.
|
|
67
57
|
*/
|
|
68
58
|
injectTools(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Get names of all connected servers.
|
|
71
|
-
*/
|
|
59
|
+
/** Get names of all connected servers. */
|
|
72
60
|
getConnectedServers(): string[];
|
|
73
|
-
/**
|
|
74
|
-
* Get total number of MCP tools across all servers.
|
|
75
|
-
*/
|
|
61
|
+
/** Get total number of MCP tools across all servers. */
|
|
76
62
|
getToolCount(): number;
|
|
77
63
|
/**
|
|
78
|
-
*
|
|
64
|
+
* Close all MCP connections and retract the injected tools, so a config
|
|
65
|
+
* reload never leaves ghost tools bound to a closed runtime.
|
|
79
66
|
*/
|
|
80
67
|
disconnectAll(): Promise<void>;
|
|
81
|
-
|
|
82
|
-
* List resources from all connected MCP servers (or a specific one).
|
|
83
|
-
*/
|
|
84
|
-
listResources(serverName?: string): Promise<Array<McpResourceEntry & {
|
|
85
|
-
server: string;
|
|
86
|
-
}>>;
|
|
87
|
-
/**
|
|
88
|
-
* Read a resource from a specific MCP server by URI.
|
|
89
|
-
*/
|
|
90
|
-
readResource(serverName: string, uri: string): Promise<McpResourceContent[]>;
|
|
68
|
+
private toPortableTool;
|
|
91
69
|
private wrapToolsForWorkspaceBoundary;
|
|
92
|
-
private reinjectTools;
|
|
93
70
|
private registerTools;
|
|
94
|
-
private getRegisteredToolNames;
|
|
95
71
|
private removeRegisteredTool;
|
|
96
72
|
}
|
|
97
73
|
export declare function validateMcpToolWorkspaceBoundary(toolName: string, args: unknown, workspaceRoot: string | undefined): string | null;
|
|
@@ -31,6 +31,7 @@ export declare class PermissionRuleEngine {
|
|
|
31
31
|
}): PermissionResult;
|
|
32
32
|
/** Rebuild compiledPatterns: [persistent-deny] → [session] → [persistent non-deny]. */
|
|
33
33
|
private recompile;
|
|
34
|
+
private matchCompiledRules;
|
|
34
35
|
/**
|
|
35
36
|
* Match a caller-supplied rule set (deny-first) against this call, using the SAME
|
|
36
37
|
* matching semantics as the base rules (pathPrefix prefix-match, else toolName glob).
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
2
|
import type { HookRegistry } from "../../contracts/hooks.js";
|
|
3
|
-
import type { AssistantPreset } from "../../assistants/assistant-types.js";
|
|
4
3
|
import type { WorkspaceSkill } from "../skill-system/skill-types.js";
|
|
5
4
|
import { type LoadedPlugin } from "./plugin-api.js";
|
|
6
5
|
interface PluginToolRegistry {
|
|
@@ -24,7 +23,6 @@ export declare class PluginLoader {
|
|
|
24
23
|
private config;
|
|
25
24
|
private loaded;
|
|
26
25
|
private pluginSkills;
|
|
27
|
-
private pluginAssistants;
|
|
28
26
|
private activations;
|
|
29
27
|
private log;
|
|
30
28
|
constructor(config: PluginLoaderConfig);
|
|
@@ -37,7 +35,6 @@ export declare class PluginLoader {
|
|
|
37
35
|
* Get all skills registered by plugins.
|
|
38
36
|
*/
|
|
39
37
|
getPluginSkills(): WorkspaceSkill[];
|
|
40
|
-
getPluginAssistants(): AssistantPreset[];
|
|
41
38
|
/**
|
|
42
39
|
* Get list of all loaded plugins.
|
|
43
40
|
*/
|
|
@@ -54,7 +51,6 @@ export declare class PluginLoader {
|
|
|
54
51
|
*/
|
|
55
52
|
refreshActivations(): Promise<void>;
|
|
56
53
|
private loadPlugin;
|
|
57
|
-
private loadAssistantManifest;
|
|
58
54
|
private addRegisteredTool;
|
|
59
55
|
private removeRegisteredTool;
|
|
60
56
|
}
|
|
@@ -49,7 +49,7 @@ export interface PortableToolResult {
|
|
|
49
49
|
* @typeParam TParams The expected parameter shape (for TypeScript consumers).
|
|
50
50
|
*/
|
|
51
51
|
export interface PortableTool<TParams = Record<string, unknown>> {
|
|
52
|
-
/** Unique tool name (e.g. "
|
|
52
|
+
/** Unique tool name (e.g. "task", "memory"). */
|
|
53
53
|
name: string;
|
|
54
54
|
/** Human-readable label. */
|
|
55
55
|
label: string;
|
|
@@ -119,7 +119,7 @@ export interface PortableTool<TParams = Record<string, unknown>> {
|
|
|
119
119
|
/**
|
|
120
120
|
* Whether egress carries user data (as opposed to read-only queries).
|
|
121
121
|
* Only meaningful when isEgress is true.
|
|
122
|
-
* Examples:
|
|
122
|
+
* Examples: file_upload (true), web_search (false).
|
|
123
123
|
*/
|
|
124
124
|
egressCarriesData?: boolean;
|
|
125
125
|
/**
|
|
@@ -22,7 +22,7 @@ export declare const CONFIG_TOOL_SCHEMA: {
|
|
|
22
22
|
readonly description: string;
|
|
23
23
|
};
|
|
24
24
|
readonly value: {
|
|
25
|
-
readonly description: "Value to set. Type
|
|
25
|
+
readonly description: "Value to set. Type must match the tunable (numeric strings are coerced). Required for 'set'.";
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
readonly required: readonly ["action"];
|
|
@@ -42,8 +42,6 @@ export interface ConfigResult {
|
|
|
42
42
|
previousValue?: unknown;
|
|
43
43
|
error?: string;
|
|
44
44
|
}
|
|
45
|
-
/** Keys that cannot be modified by LLM (security-critical) */
|
|
46
|
-
export declare const CONFIG_READONLY_KEYS: readonly string[];
|
|
47
45
|
/**
|
|
48
46
|
* Host-provided config backend.
|
|
49
47
|
* Manages persistent agent settings with safety guardrails.
|
|
@@ -39,11 +39,11 @@ export declare const SKILL_TOOL_SCHEMA: {
|
|
|
39
39
|
};
|
|
40
40
|
readonly filePath: {
|
|
41
41
|
readonly type: "string";
|
|
42
|
-
readonly description: "
|
|
42
|
+
readonly description: "Path of a file inside the skill folder: read it (view) or write it with fileContent (create/edit). SKILL.md itself always goes through 'content'.";
|
|
43
43
|
};
|
|
44
44
|
readonly fileContent: {
|
|
45
45
|
readonly type: "string";
|
|
46
|
-
readonly description: "
|
|
46
|
+
readonly description: "Supporting file content. With filePath, writes that file inside the skill folder (create: alongside SKILL.md; edit: file-only update).";
|
|
47
47
|
};
|
|
48
48
|
readonly oldString: {
|
|
49
49
|
readonly type: "string";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
2
|
export declare const TEAM_TOOL_NAME: "team";
|
|
3
|
-
export type TeamAction = "create" | "delete" | "list" | "status";
|
|
3
|
+
export type TeamAction = "create" | "delete" | "list" | "status" | "send";
|
|
4
4
|
export interface TeamMember {
|
|
5
5
|
name: string;
|
|
6
6
|
role: string;
|
|
@@ -22,19 +22,37 @@ export interface TeamToolParams {
|
|
|
22
22
|
description?: string;
|
|
23
23
|
/** Members to include (for create) */
|
|
24
24
|
members?: TeamMember[];
|
|
25
|
+
/** Target member name or '*' for broadcast (required for send) */
|
|
26
|
+
to?: string;
|
|
27
|
+
/** Message content (required for send) */
|
|
28
|
+
message?: string;
|
|
29
|
+
/** Optional short summary for logging/routing (send) */
|
|
30
|
+
summary?: string;
|
|
25
31
|
}
|
|
26
32
|
export declare const TEAM_TOOL_SCHEMA: {
|
|
27
33
|
readonly type: "object";
|
|
28
34
|
readonly properties: {
|
|
29
35
|
readonly action: {
|
|
30
36
|
readonly type: "string";
|
|
31
|
-
readonly enum: readonly ["create", "delete", "list", "status"];
|
|
32
|
-
readonly description: "Team action: create (new team), delete (disband), list (all teams), status (team details).";
|
|
37
|
+
readonly enum: readonly ["create", "delete", "list", "status", "send"];
|
|
38
|
+
readonly description: "Team action: create (new team), delete (disband), list (all teams), status (team details), send (message a member and collect the reply).";
|
|
33
39
|
};
|
|
34
40
|
readonly teamName: {
|
|
35
41
|
readonly type: "string";
|
|
36
42
|
readonly description: "Team name. Required for create/delete/status.";
|
|
37
43
|
};
|
|
44
|
+
readonly to: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly description: "Target member name, full member id, or '*' to broadcast to all live members. Required for send.";
|
|
47
|
+
};
|
|
48
|
+
readonly message: {
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
readonly description: "Message content to deliver to the member. Required for send.";
|
|
51
|
+
};
|
|
52
|
+
readonly summary: {
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
readonly description: "Optional short summary (for logging/routing). Used by send.";
|
|
55
|
+
};
|
|
38
56
|
readonly description: {
|
|
39
57
|
readonly type: "string";
|
|
40
58
|
readonly description: "Team description/objective. Used for create.";
|
|
@@ -85,9 +103,20 @@ export interface TeamResult {
|
|
|
85
103
|
error: string;
|
|
86
104
|
}>;
|
|
87
105
|
}
|
|
106
|
+
export interface TeamSendResult {
|
|
107
|
+
success: boolean;
|
|
108
|
+
recipients?: string[];
|
|
109
|
+
error?: string;
|
|
110
|
+
/** Replies collected from the recipient(s) — the message loop is synchronous. */
|
|
111
|
+
replies?: Array<{
|
|
112
|
+
memberId: string;
|
|
113
|
+
name: string;
|
|
114
|
+
reply: string;
|
|
115
|
+
}>;
|
|
116
|
+
}
|
|
88
117
|
/**
|
|
89
118
|
* Host-provided team management backend.
|
|
90
|
-
* Creates agent teams
|
|
119
|
+
* Creates agent teams whose members are messaged via the send action.
|
|
91
120
|
*/
|
|
92
121
|
export interface TeamToolDeps {
|
|
93
122
|
createTeam(params: {
|
|
@@ -112,5 +141,16 @@ export interface TeamToolDeps {
|
|
|
112
141
|
runningFor?: number;
|
|
113
142
|
}>;
|
|
114
143
|
}>;
|
|
144
|
+
/** Deliver a message to member(s) and collect their replies (send action). */
|
|
145
|
+
sendMessage(params: {
|
|
146
|
+
to: string;
|
|
147
|
+
message: string;
|
|
148
|
+
summary?: string;
|
|
149
|
+
senderId: string;
|
|
150
|
+
}): Promise<TeamSendResult>;
|
|
151
|
+
/** Current agent's id (send action sender). */
|
|
152
|
+
getSenderId(): string;
|
|
153
|
+
/** Live teammate names (send action target validation). */
|
|
154
|
+
listTeammates(): string[];
|
|
115
155
|
}
|
|
116
156
|
export declare function createTeamTool(deps: TeamToolDeps): PortableTool<TeamToolParams>;
|
|
@@ -48,4 +48,15 @@ export interface ToolSearchToolDeps {
|
|
|
48
48
|
*/
|
|
49
49
|
activateTool?(name: string): Promise<boolean>;
|
|
50
50
|
}
|
|
51
|
+
export interface ToolSearchCorpusEntry {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
searchHint?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Score a keyword query against a tool corpus (CC-aligned weights).
|
|
58
|
+
* Query syntax: plain terms rank, "+term" is required (must appear in
|
|
59
|
+
* name/description/searchHint). CJK terms match by substring.
|
|
60
|
+
*/
|
|
61
|
+
export declare function searchToolCorpus(entries: ToolSearchCorpusEntry[], query: string, maxResults: number): ToolSearchOutput;
|
|
51
62
|
export declare function createToolSearchTool(deps: ToolSearchToolDeps): PortableTool<ToolSearchToolParams>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.9",
|
|
4
4
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -89,10 +89,11 @@
|
|
|
89
89
|
"@agentclientprotocol/sdk": "^0.25.0",
|
|
90
90
|
"@napi-rs/canvas": "0.1.100",
|
|
91
91
|
"@xiaozhiclaw/pet-core": "0.1.1",
|
|
92
|
-
"@xiaozhiclaw/provider-core": "0.1.
|
|
92
|
+
"@xiaozhiclaw/provider-core": "0.1.8",
|
|
93
93
|
"better-sqlite3": "^12.10.0",
|
|
94
94
|
"dotenv": "^17.3.1",
|
|
95
95
|
"ioredis": "^5.11.1",
|
|
96
|
+
"mcporter": "^0.12.0",
|
|
96
97
|
"nanoid": "^5.1.5",
|
|
97
98
|
"pino": "^9.6.0",
|
|
98
99
|
"pino-pretty": "^13.0.0"
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AssistantPreset, AssistantRuntimeContext } from "./assistant-types.js";
|
|
2
|
-
export declare const BUILTIN_ASSISTANT_PRESETS: AssistantPreset[];
|
|
3
|
-
export declare function listAssistantPresets(): AssistantPreset[];
|
|
4
|
-
export declare function resolveAssistantPreset(id: string): AssistantRuntimeContext;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { AssistantPreset, AssistantPromptTemplate, AssistantRuntimeContext } from "./assistant-types.js";
|
|
2
|
-
import { type PluginAssistantDiagnostic } from "./plugin-assistant-registry.js";
|
|
3
|
-
export type UserAssistantPresetInput = Partial<AssistantPreset> & {
|
|
4
|
-
name: string;
|
|
5
|
-
prompts: AssistantPromptTemplate[];
|
|
6
|
-
};
|
|
7
|
-
export interface AssistantPresetStateOverride {
|
|
8
|
-
enabled?: boolean;
|
|
9
|
-
sortOrder?: number;
|
|
10
|
-
modelHints?: string[];
|
|
11
|
-
}
|
|
12
|
-
export interface AssistantPresetListOptions {
|
|
13
|
-
pluginManifestDirectories?: string[];
|
|
14
|
-
}
|
|
15
|
-
export declare function listAssistantPresets(options?: AssistantPresetListOptions): Promise<AssistantPreset[]>;
|
|
16
|
-
export declare function listAssistantDiagnostics(): PluginAssistantDiagnostic[];
|
|
17
|
-
export declare function resolveAssistantPreset(assistantId: string): Promise<AssistantRuntimeContext>;
|
|
18
|
-
export declare function upsertUserAssistantPreset(input: UserAssistantPresetInput): Promise<AssistantPreset>;
|
|
19
|
-
export declare function createUserAssistantPreset(input: UserAssistantPresetInput): Promise<AssistantPreset>;
|
|
20
|
-
export declare function updateUserAssistantPreset(input: UserAssistantPresetInput): Promise<AssistantPreset>;
|
|
21
|
-
export declare function deleteUserAssistantPreset(assistantId: string): Promise<void>;
|
|
22
|
-
export declare function setAssistantPresetState(assistantId: string, override: AssistantPresetStateOverride): Promise<AssistantPreset>;
|
|
23
|
-
export declare function cloneBuiltinAssistantPreset(assistantId: string): Promise<AssistantPreset>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ChatMessage } from "../protocol/wire/index.js";
|
|
2
|
-
import type { AssistantRuntimeContext, AssistantPresetSource } from "./assistant-types.js";
|
|
3
|
-
export interface AssistantSessionSnapshotInput {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
source: AssistantPresetSource;
|
|
7
|
-
context?: string;
|
|
8
|
-
enabledSkills: string[];
|
|
9
|
-
disabledBuiltinSkills: string[];
|
|
10
|
-
}
|
|
11
|
-
export interface AssistantSessionSnapshot {
|
|
12
|
-
id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
source: AssistantPresetSource;
|
|
15
|
-
contextHash: string;
|
|
16
|
-
enabledSkills: string[];
|
|
17
|
-
disabledBuiltinSkills: string[];
|
|
18
|
-
}
|
|
19
|
-
export declare function applyAssistantRuntimeContext<T extends ChatMessage>(messages: T[], context: AssistantRuntimeContext | null | undefined): Array<T | ChatMessage>;
|
|
20
|
-
export declare function createAssistantSessionSnapshot(input: AssistantSessionSnapshotInput): AssistantSessionSnapshot;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export type AssistantPresetSource = "builtin" | "user" | "plugin";
|
|
2
|
-
export interface AssistantPromptTemplate {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
titleI18n?: Record<string, string>;
|
|
6
|
-
description?: string;
|
|
7
|
-
descriptionI18n?: Record<string, string>;
|
|
8
|
-
prompt: string;
|
|
9
|
-
promptI18n?: Record<string, string>;
|
|
10
|
-
icon?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface AssistantPreset {
|
|
13
|
-
kind: "assistant-preset";
|
|
14
|
-
id: string;
|
|
15
|
-
source: AssistantPresetSource;
|
|
16
|
-
name: string;
|
|
17
|
-
nameI18n?: Record<string, string>;
|
|
18
|
-
description?: string;
|
|
19
|
-
descriptionI18n?: Record<string, string>;
|
|
20
|
-
avatar?: string;
|
|
21
|
-
enabled: boolean;
|
|
22
|
-
sortOrder: number;
|
|
23
|
-
enabledSkills: string[];
|
|
24
|
-
disabledBuiltinSkills: string[];
|
|
25
|
-
context?: string;
|
|
26
|
-
prompts: AssistantPromptTemplate[];
|
|
27
|
-
modelHints: string[];
|
|
28
|
-
pluginId?: string;
|
|
29
|
-
readonly?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface AssistantRuntimeContext {
|
|
32
|
-
assistantId: string;
|
|
33
|
-
context?: string;
|
|
34
|
-
enabledSkillNames: string[];
|
|
35
|
-
disabledBuiltinSkillNames: string[];
|
|
36
|
-
modelHints: string[];
|
|
37
|
-
prompts: AssistantPromptTemplate[];
|
|
38
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AssistantPreset } from "./assistant-types.js";
|
|
2
|
-
export type PluginAssistantDiagnosticSeverity = "error" | "warning";
|
|
3
|
-
export interface PluginAssistantDiagnostic {
|
|
4
|
-
pluginId: string;
|
|
5
|
-
manifestPath?: string;
|
|
6
|
-
severity: PluginAssistantDiagnosticSeverity;
|
|
7
|
-
message: string;
|
|
8
|
-
assistantId?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function registerPluginAssistantManifest(pluginId: string, manifestPath: string, manifest: unknown): AssistantPreset[];
|
|
11
|
-
export declare function syncPluginAssistantManifestDirectory(directory: string): void;
|
|
12
|
-
export declare function clearPluginAssistantPresetsForTests(): void;
|
|
13
|
-
export declare function unregisterPluginAssistantManifest(pluginId: string): void;
|
|
14
|
-
export declare function listPluginAssistantPresets(): AssistantPreset[];
|
|
15
|
-
export declare function listPluginAssistantDiagnostics(): PluginAssistantDiagnostic[];
|
|
16
|
-
export declare function parseAssistantManifestText(text: string): unknown;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ToolCatalog } from "../../runtime/ports/index.js";
|
|
2
|
-
import type { AgentLogger } from "../../agent/types.js";
|
|
3
|
-
import type { TeamRegistry } from "./team-registry.js";
|
|
4
|
-
export interface UtilityToolRegistrationDeps {
|
|
5
|
-
toolCatalog: ToolCatalog;
|
|
6
|
-
host: {
|
|
7
|
-
readonly currentSessionId: string;
|
|
8
|
-
};
|
|
9
|
-
log: Pick<AgentLogger, "info">;
|
|
10
|
-
teamRegistry: TeamRegistry;
|
|
11
|
-
}
|
|
12
|
-
export declare function registerUtilityTools({ host, log, toolCatalog, teamRegistry }: UtilityToolRegistrationDeps): void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
|
|
2
|
-
export interface AssistantsHandlerHost {
|
|
3
|
-
getActiveProjectRoot?(): string;
|
|
4
|
-
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
5
|
-
}
|
|
6
|
-
export declare function handleAssistantsList(this: AssistantsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
7
|
-
export declare function handleAssistantsResolve(this: AssistantsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
8
|
-
export declare function handleAssistantsCloneBuiltin(this: AssistantsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
9
|
-
export declare function handleAssistantsUpsert(this: AssistantsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
10
|
-
export declare function handleAssistantsCreate(this: AssistantsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
11
|
-
export declare function handleAssistantsUpdate(this: AssistantsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
12
|
-
export declare function handleAssistantsSetState(this: AssistantsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
13
|
-
export declare function handleAssistantsDelete(this: AssistantsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
import { type McpToolAnnotations } from "./mcp-tool-metadata.js";
|
|
3
|
-
interface McpToolSchema {
|
|
4
|
-
name: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
inputSchema?: Record<string, unknown>;
|
|
7
|
-
annotations?: McpToolAnnotations;
|
|
8
|
-
}
|
|
9
|
-
interface McpToolCallResult {
|
|
10
|
-
content: Array<{
|
|
11
|
-
type: string;
|
|
12
|
-
text?: string;
|
|
13
|
-
data?: string;
|
|
14
|
-
mimeType?: string;
|
|
15
|
-
}>;
|
|
16
|
-
isError?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface McpHttpClientConfig {
|
|
19
|
-
/** Unique name for this MCP server instance */
|
|
20
|
-
name: string;
|
|
21
|
-
/** HTTP endpoint URL (e.g. "http://localhost:3000/mcp") */
|
|
22
|
-
url: string;
|
|
23
|
-
/** Extra headers for every request */
|
|
24
|
-
headers?: Record<string, string>;
|
|
25
|
-
/** Timeout for initialization handshake (ms, default: 30000) */
|
|
26
|
-
initTimeoutMs?: number;
|
|
27
|
-
/** Timeout for tool calls (ms, default: 120000) */
|
|
28
|
-
toolCallTimeoutMs?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare class McpHttpClient {
|
|
31
|
-
private connected;
|
|
32
|
-
private toolsCache;
|
|
33
|
-
private serverName;
|
|
34
|
-
private serverVersion;
|
|
35
|
-
private sessionId;
|
|
36
|
-
private onToolsChanged;
|
|
37
|
-
readonly config: McpHttpClientConfig;
|
|
38
|
-
constructor(config: McpHttpClientConfig);
|
|
39
|
-
connect(): Promise<void>;
|
|
40
|
-
disconnect(): Promise<void>;
|
|
41
|
-
callTool(toolName: string, args?: Record<string, unknown>, signal?: AbortSignal): Promise<McpToolCallResult>;
|
|
42
|
-
listResources(): Promise<Array<{
|
|
43
|
-
uri: string;
|
|
44
|
-
name: string;
|
|
45
|
-
mimeType?: string;
|
|
46
|
-
description?: string;
|
|
47
|
-
}>>;
|
|
48
|
-
readResource(uri: string): Promise<Array<{
|
|
49
|
-
uri: string;
|
|
50
|
-
mimeType?: string;
|
|
51
|
-
text?: string;
|
|
52
|
-
blob?: string;
|
|
53
|
-
}>>;
|
|
54
|
-
toPortableTools(): PortableTool[];
|
|
55
|
-
getCachedTools(): McpToolSchema[];
|
|
56
|
-
get isConnected(): boolean;
|
|
57
|
-
get info(): {
|
|
58
|
-
name: string;
|
|
59
|
-
version: string;
|
|
60
|
-
};
|
|
61
|
-
setOnToolsChanged(callback: () => void): void;
|
|
62
|
-
private refreshTools;
|
|
63
|
-
private sendRequest;
|
|
64
|
-
private sendNotification;
|
|
65
|
-
private parseSSEResponse;
|
|
66
|
-
private schemaToPortableTool;
|
|
67
|
-
}
|
|
68
|
-
export {};
|