qlogicagent 0.5.2 → 0.6.0
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 +403 -402
- package/dist/agent.js +18 -0
- package/dist/cli.js +384 -0
- package/dist/contracts.js +1 -0
- package/dist/index.js +383 -0
- package/dist/orchestration.js +34 -0
- package/dist/types/agent/agent.d.ts +43 -0
- package/dist/types/agent/constants.d.ts +47 -0
- package/dist/types/agent/tool-access.d.ts +30 -0
- package/dist/types/agent/tool-loop.d.ts +94 -0
- package/dist/types/agent/types.d.ts +238 -0
- package/dist/types/cli/main.d.ts +11 -0
- package/dist/types/cli/stdio-server.d.ts +78 -0
- package/dist/types/cli/tool-bootstrap.d.ts +40 -0
- package/dist/types/cli/transport.d.ts +40 -0
- package/dist/types/config/config.d.ts +17 -0
- package/dist/types/contracts/hooks.d.ts +175 -0
- package/dist/types/contracts/index.d.ts +9 -0
- package/dist/types/contracts/planner.d.ts +35 -0
- package/dist/types/contracts/todo.d.ts +23 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/llm/builtin-providers.d.ts +10 -0
- package/dist/types/llm/debug-transport.d.ts +12 -0
- package/dist/types/llm/index.d.ts +16 -0
- package/dist/types/llm/llm-client.d.ts +43 -0
- package/dist/types/llm/model-catalog.d.ts +53 -0
- package/dist/types/llm/provider-def.d.ts +59 -0
- package/dist/types/llm/provider-registry.d.ts +54 -0
- package/dist/types/llm/transport.d.ts +62 -0
- package/dist/types/llm/transports/anthropic-messages.d.ts +31 -0
- package/dist/types/llm/transports/openai-chat.d.ts +36 -0
- package/dist/types/orchestration/context/context-collapse.d.ts +58 -0
- package/dist/types/orchestration/context/context-compression.d.ts +301 -0
- package/dist/types/orchestration/context/reactive-compact.d.ts +73 -0
- package/dist/types/orchestration/context/turn-loop-guard.d.ts +86 -0
- package/dist/types/orchestration/error-handling/error-classification.d.ts +12 -0
- package/dist/types/orchestration/error-handling/failover-classification.d.ts +8 -0
- package/dist/types/orchestration/error-handling/failover-error.d.ts +33 -0
- package/dist/types/orchestration/error-handling/retry-loop.d.ts +69 -0
- package/dist/types/orchestration/index.d.ts +15 -0
- package/dist/types/orchestration/skill-improvement.d.ts +59 -0
- package/dist/types/orchestration/subagent/agent-registry.d.ts +46 -0
- package/dist/types/orchestration/subagent/fork-subagent.d.ts +98 -0
- package/dist/types/orchestration/subagent/task-types.d.ts +142 -0
- package/dist/types/orchestration/tool-loop/conversation-repair.d.ts +61 -0
- package/dist/types/orchestration/tool-loop/tool-choice-policy.d.ts +54 -0
- package/dist/types/orchestration/tool-loop/tool-loop-state.d.ts +50 -0
- package/dist/types/orchestration/tool-loop/tool-schema.d.ts +39 -0
- package/dist/types/runtime/execution/dream-agent.d.ts +199 -0
- package/dist/types/runtime/execution/forked-agent.d.ts +109 -0
- package/dist/types/runtime/execution/index.d.ts +6 -0
- package/dist/types/runtime/execution/progress-tracker.d.ts +78 -0
- package/dist/types/runtime/execution/remote-agent.d.ts +63 -0
- package/dist/types/runtime/execution/streaming-tool-executor.d.ts +100 -0
- package/dist/types/runtime/execution/tool-eligibility.d.ts +59 -0
- package/dist/types/runtime/execution/tool-result-storage.d.ts +87 -0
- package/dist/types/runtime/hooks/context-compression.d.ts +61 -0
- package/dist/types/runtime/hooks/hook-registry.d.ts +12 -0
- package/dist/types/runtime/hooks/index.d.ts +3 -0
- package/dist/types/runtime/hooks/memory-hooks.d.ts +49 -0
- package/dist/types/runtime/index.d.ts +5 -0
- package/dist/types/runtime/infra/agent-paths.d.ts +57 -0
- package/dist/types/runtime/infra/checkpoint-backend.d.ts +8 -0
- package/dist/types/runtime/infra/cleanup-registry.d.ts +23 -0
- package/dist/types/runtime/infra/disk-storage.d.ts +36 -0
- package/dist/types/runtime/infra/file-watcher.d.ts +72 -0
- package/dist/types/runtime/infra/index.d.ts +8 -0
- package/dist/types/runtime/infra/secure-storage.d.ts +81 -0
- package/dist/types/runtime/infra/task-runtime.d.ts +108 -0
- package/dist/types/runtime/infra/token-budget.d.ts +92 -0
- package/dist/types/runtime/infra/worktree-backend.d.ts +85 -0
- package/dist/types/runtime/prompt/environment-context.d.ts +23 -0
- package/dist/types/runtime/prompt/index.d.ts +3 -0
- package/dist/types/runtime/prompt/instruction-loader.d.ts +64 -0
- package/dist/types/runtime/prompt/system-prompt-sections.d.ts +63 -0
- package/dist/types/runtime/session/index.d.ts +2 -0
- package/dist/types/runtime/session/session-memory.d.ts +90 -0
- package/dist/types/runtime/session/session-persistence.d.ts +94 -0
- package/dist/types/runtime/session/session-state.d.ts +117 -0
- package/dist/types/skills/index.d.ts +119 -0
- package/dist/types/skills/mcp/index.d.ts +3 -0
- package/dist/types/skills/mcp/mcp-http-client.d.ts +66 -0
- package/dist/types/skills/mcp/mcp-manager.d.ts +83 -0
- package/dist/types/skills/mcp/mcp-stdio-client.d.ts +84 -0
- package/dist/types/skills/memory/memory-extractor.d.ts +64 -0
- package/dist/types/skills/memory/memory-store.d.ts +86 -0
- package/dist/types/skills/memory/memory-tool.d.ts +87 -0
- package/dist/types/skills/memory/qmemory-adapter.d.ts +42 -0
- package/dist/types/skills/permissions/bash-classifier.d.ts +30 -0
- package/dist/types/skills/permissions/classifier-cache.d.ts +51 -0
- package/dist/types/skills/permissions/denial-tracking.d.ts +42 -0
- package/dist/types/skills/permissions/hook-runner.d.ts +85 -0
- package/dist/types/skills/permissions/index.d.ts +12 -0
- package/dist/types/skills/permissions/permission-classifier.d.ts +41 -0
- package/dist/types/skills/permissions/rule-engine.d.ts +41 -0
- package/dist/types/skills/permissions/settings-watcher.d.ts +46 -0
- package/dist/types/skills/permissions/types.d.ts +113 -0
- package/dist/types/skills/plugins/index.d.ts +2 -0
- package/dist/types/skills/plugins/plugin-api.d.ts +38 -0
- package/dist/types/skills/plugins/plugin-loader.d.ts +42 -0
- package/dist/types/skills/plugins/plugin-marketplace.d.ts +61 -0
- package/dist/types/skills/portable-tool.d.ts +104 -0
- package/dist/types/skills/skill-system/skill-frontmatter.d.ts +19 -0
- package/dist/types/skills/skill-system/skill-guard.d.ts +23 -0
- package/dist/types/skills/skill-system/skill-loader.d.ts +16 -0
- package/dist/types/skills/skill-system/skill-source.d.ts +119 -0
- package/dist/types/skills/skill-system/skill-types.d.ts +199 -0
- package/dist/types/skills/think-tool.d.ts +16 -0
- package/dist/types/skills/todo-tool.d.ts +72 -0
- package/dist/types/skills/tools/agent-tool.d.ts +91 -0
- package/dist/types/skills/tools/apply-patch-tool.d.ts +29 -0
- package/dist/types/skills/tools/ask-user-tool.d.ts +80 -0
- package/dist/types/skills/tools/brief-tool.d.ts +74 -0
- package/dist/types/skills/tools/browser-tool.d.ts +114 -0
- package/dist/types/skills/tools/checkpoint-tool.d.ts +66 -0
- package/dist/types/skills/tools/config-tool.d.ts +63 -0
- package/dist/types/skills/tools/cron-tool.d.ts +116 -0
- package/dist/types/skills/tools/edit-tool.d.ts +43 -0
- package/dist/types/skills/tools/exec-tool.d.ts +97 -0
- package/dist/types/skills/tools/image-generate-tool.d.ts +62 -0
- package/dist/types/skills/tools/instructions-tool.d.ts +65 -0
- package/dist/types/skills/tools/lsp-tool.d.ts +153 -0
- package/dist/types/skills/tools/mcp-client-types.d.ts +269 -0
- package/dist/types/skills/tools/mcp-resource-tools.d.ts +14 -0
- package/dist/types/skills/tools/mcp-tool.d.ts +249 -0
- package/dist/types/skills/tools/monitor-tool.d.ts +113 -0
- package/dist/types/skills/tools/music-generate-tool.d.ts +55 -0
- package/dist/types/skills/tools/notebook-edit-tool.d.ts +15 -0
- package/dist/types/skills/tools/notify-tool.d.ts +53 -0
- package/dist/types/skills/tools/patch-tool.d.ts +45 -0
- package/dist/types/skills/tools/plan-mode-tool.d.ts +98 -0
- package/dist/types/skills/tools/read-tool.d.ts +51 -0
- package/dist/types/skills/tools/repl-tool.d.ts +70 -0
- package/dist/types/skills/tools/search-tool.d.ts +112 -0
- package/dist/types/skills/tools/send-message-tool.d.ts +51 -0
- package/dist/types/skills/tools/shell/bash-provider.d.ts +26 -0
- package/dist/types/skills/tools/shell/command-classification.d.ts +44 -0
- package/dist/types/skills/tools/shell/command-semantics.d.ts +14 -0
- package/dist/types/skills/tools/shell/destructive-command-warning.d.ts +10 -0
- package/dist/types/skills/tools/shell/exec-permissions.d.ts +52 -0
- package/dist/types/skills/tools/shell/index.d.ts +17 -0
- package/dist/types/skills/tools/shell/powershell-provider.d.ts +15 -0
- package/dist/types/skills/tools/shell/shell-command.d.ts +54 -0
- package/dist/types/skills/tools/shell/shell-exec.d.ts +33 -0
- package/dist/types/skills/tools/shell/shell-provider.d.ts +85 -0
- package/dist/types/skills/tools/shell/task-output.d.ts +45 -0
- package/dist/types/skills/tools/skill-invoke-tool.d.ts +46 -0
- package/dist/types/skills/tools/skill-list-tool.d.ts +33 -0
- package/dist/types/skills/tools/skill-manage-tool.d.ts +73 -0
- package/dist/types/skills/tools/skill-view-tool.d.ts +37 -0
- package/dist/types/skills/tools/sleep-tool.d.ts +49 -0
- package/dist/types/skills/tools/structured-output-tool.d.ts +116 -0
- package/dist/types/skills/tools/task-tool.d.ts +104 -0
- package/dist/types/skills/tools/team-tool.d.ts +89 -0
- package/dist/types/skills/tools/tool-search-tool.d.ts +51 -0
- package/dist/types/skills/tools/tts-tool.d.ts +38 -0
- package/dist/types/skills/tools/video-edit-tool.d.ts +69 -0
- package/dist/types/skills/tools/video-generate-tool.d.ts +62 -0
- package/dist/types/skills/tools/video-merge-tool.d.ts +105 -0
- package/dist/types/skills/tools/video-upscale-tool.d.ts +45 -0
- package/dist/types/skills/tools/web-fetch-tool.d.ts +78 -0
- package/dist/types/skills/tools/web-search-tool.d.ts +57 -0
- package/dist/types/skills/tools/workflow-tool.d.ts +44 -0
- package/dist/types/skills/tools/worktree-tool.d.ts +69 -0
- package/dist/types/skills/tools/write-tool.d.ts +45 -0
- package/dist/types/skills/tools.d.ts +65 -0
- package/package.json +4 -3
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const WEB_SEARCH_TOOL_NAME: "web_search";
|
|
3
|
+
export interface WebSearchToolParams {
|
|
4
|
+
query: string;
|
|
5
|
+
allowedDomains?: string[];
|
|
6
|
+
blockedDomains?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare const WEB_SEARCH_TOOL_SCHEMA: {
|
|
9
|
+
readonly type: "object";
|
|
10
|
+
readonly properties: {
|
|
11
|
+
readonly query: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly description: "Search query string. Be specific and concise for best results.";
|
|
14
|
+
};
|
|
15
|
+
readonly allowedDomains: {
|
|
16
|
+
readonly type: "array";
|
|
17
|
+
readonly items: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
};
|
|
20
|
+
readonly description: string;
|
|
21
|
+
};
|
|
22
|
+
readonly blockedDomains: {
|
|
23
|
+
readonly type: "array";
|
|
24
|
+
readonly items: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
};
|
|
27
|
+
readonly description: "Exclude results from these domains. Cannot be used together with allowedDomains.";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
readonly required: readonly ["query"];
|
|
31
|
+
};
|
|
32
|
+
export interface WebSearchResult {
|
|
33
|
+
title: string;
|
|
34
|
+
url: string;
|
|
35
|
+
snippet: string;
|
|
36
|
+
}
|
|
37
|
+
export interface WebSearchOutput {
|
|
38
|
+
query: string;
|
|
39
|
+
results: WebSearchResult[];
|
|
40
|
+
totalResults?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Host-provided web search backend.
|
|
44
|
+
* The host may use any search engine (SearXNG, Brave, Tavily, etc.).
|
|
45
|
+
*/
|
|
46
|
+
export interface WebSearchToolDeps {
|
|
47
|
+
/**
|
|
48
|
+
* Execute a web search and return results.
|
|
49
|
+
* The host is responsible for API key management and rate limiting.
|
|
50
|
+
*/
|
|
51
|
+
search(query: string, options?: {
|
|
52
|
+
allowedDomains?: string[];
|
|
53
|
+
blockedDomains?: string[];
|
|
54
|
+
maxResults?: number;
|
|
55
|
+
}): Promise<WebSearchOutput>;
|
|
56
|
+
}
|
|
57
|
+
export declare function createWebSearchTool(deps: WebSearchToolDeps): PortableTool<WebSearchToolParams>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export type WorkflowAction = "list" | "run" | "describe";
|
|
3
|
+
export interface WorkflowStep {
|
|
4
|
+
/** Step identifier */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Tool name to invoke */
|
|
7
|
+
tool: string;
|
|
8
|
+
/** Tool arguments (supports ${prev.result} interpolation) */
|
|
9
|
+
args: Record<string, unknown>;
|
|
10
|
+
/** Step IDs this step depends on (for DAG ordering) */
|
|
11
|
+
dependsOn?: string[];
|
|
12
|
+
/** Condition expression: "always" | "on_success" | "on_failure" (default: "on_success") */
|
|
13
|
+
condition?: "always" | "on_success" | "on_failure";
|
|
14
|
+
/** Human-readable label */
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface WorkflowDefinition {
|
|
18
|
+
/** Workflow name */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Description */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** Ordered steps (executed in dependency order) */
|
|
23
|
+
steps: WorkflowStep[];
|
|
24
|
+
/** Variables that can be overridden at runtime */
|
|
25
|
+
variables?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
export interface WorkflowToolParams {
|
|
28
|
+
/** Action to perform */
|
|
29
|
+
action: WorkflowAction;
|
|
30
|
+
/** Workflow name (for run/describe) */
|
|
31
|
+
workflow?: string;
|
|
32
|
+
/** Variable overrides (for run) */
|
|
33
|
+
variables?: Record<string, string>;
|
|
34
|
+
}
|
|
35
|
+
export interface WorkflowToolDeps {
|
|
36
|
+
/** Execute a tool by name and return its text result */
|
|
37
|
+
invokeTool(toolName: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<{
|
|
38
|
+
result: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
}>;
|
|
41
|
+
/** Get current working directory */
|
|
42
|
+
getCwd(): string;
|
|
43
|
+
}
|
|
44
|
+
export declare function createWorkflowTool(deps: WorkflowToolDeps): PortableTool<WorkflowToolParams>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const WORKTREE_TOOL_NAME: "worktree";
|
|
3
|
+
export type WorktreeAction = "enter" | "exit" | "list";
|
|
4
|
+
export interface WorktreeToolParams {
|
|
5
|
+
/** Action: enter (create worktree), exit (leave worktree), list (show all) */
|
|
6
|
+
action: WorktreeAction;
|
|
7
|
+
/** Branch/worktree name (for enter). kebab-case, max 64 chars. */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** For exit: 'keep' retains the worktree, 'remove' deletes it */
|
|
10
|
+
exitAction?: "keep" | "remove";
|
|
11
|
+
/** Required true to discard uncommitted changes on exit with remove */
|
|
12
|
+
discardChanges?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const WORKTREE_TOOL_SCHEMA: {
|
|
15
|
+
readonly type: "object";
|
|
16
|
+
readonly properties: {
|
|
17
|
+
readonly action: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly enum: readonly ["enter", "exit", "list"];
|
|
20
|
+
readonly description: string;
|
|
21
|
+
};
|
|
22
|
+
readonly name: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: string;
|
|
25
|
+
};
|
|
26
|
+
readonly exitAction: {
|
|
27
|
+
readonly type: "string";
|
|
28
|
+
readonly enum: readonly ["keep", "remove"];
|
|
29
|
+
readonly description: "For exit: 'keep' retains the worktree for later use; 'remove' deletes it.";
|
|
30
|
+
};
|
|
31
|
+
readonly discardChanges: {
|
|
32
|
+
readonly type: "boolean";
|
|
33
|
+
readonly description: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly required: readonly ["action"];
|
|
37
|
+
};
|
|
38
|
+
export interface WorktreeInfo {
|
|
39
|
+
name: string;
|
|
40
|
+
path: string;
|
|
41
|
+
branch: string;
|
|
42
|
+
isCurrent: boolean;
|
|
43
|
+
hasChanges: boolean;
|
|
44
|
+
unpushedCommits: number;
|
|
45
|
+
}
|
|
46
|
+
export interface WorktreeResult {
|
|
47
|
+
success: boolean;
|
|
48
|
+
worktree?: WorktreeInfo;
|
|
49
|
+
worktrees?: WorktreeInfo[];
|
|
50
|
+
previousCwd?: string;
|
|
51
|
+
error?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Host-provided git worktree backend.
|
|
55
|
+
* Manages worktree creation, switching, and cleanup.
|
|
56
|
+
*/
|
|
57
|
+
export interface WorktreeToolDeps {
|
|
58
|
+
/** Create a new worktree and switch session cwd */
|
|
59
|
+
enterWorktree(name?: string): Promise<WorktreeResult>;
|
|
60
|
+
/** Exit worktree (keep or remove) */
|
|
61
|
+
exitWorktree(action: "keep" | "remove", discardChanges?: boolean): Promise<WorktreeResult>;
|
|
62
|
+
/** List all worktrees */
|
|
63
|
+
listWorktrees(): Promise<WorktreeResult>;
|
|
64
|
+
/** Check if currently in a worktree */
|
|
65
|
+
isInWorktree(): boolean;
|
|
66
|
+
/** Get current worktree info */
|
|
67
|
+
currentWorktree?(): WorktreeInfo | null;
|
|
68
|
+
}
|
|
69
|
+
export declare function createWorktreeTool(deps: WorktreeToolDeps): PortableTool<WorktreeToolParams>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const WRITE_TOOL_NAME: "write";
|
|
3
|
+
export interface WriteToolParams {
|
|
4
|
+
path: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const WRITE_TOOL_SCHEMA: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly path: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "Absolute path to the file to write.";
|
|
13
|
+
};
|
|
14
|
+
readonly content: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: "Content to write to the file.";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly required: readonly ["path", "content"];
|
|
20
|
+
};
|
|
21
|
+
/** Deps injected by the host runtime for file writing. */
|
|
22
|
+
export interface WriteToolDeps {
|
|
23
|
+
/** Write content to a file. Create parent dirs as needed. */
|
|
24
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
25
|
+
/** Resolve a relative path to absolute. */
|
|
26
|
+
resolvePath(input: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Check if file has been read before writing (first-read-then-write protection).
|
|
29
|
+
* Returns null if write is allowed, or a warning message.
|
|
30
|
+
* If not provided, no protection is applied.
|
|
31
|
+
*/
|
|
32
|
+
checkReadBeforeWrite?(path: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Validate write access for the given path.
|
|
35
|
+
* Returns null if allowed, or an error message if blocked.
|
|
36
|
+
*/
|
|
37
|
+
validatePath?(path: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Check for concurrent modification before overwriting an existing file.
|
|
40
|
+
* Returns null if safe to write, or a warning if modified since last read.
|
|
41
|
+
* If not provided, no concurrent modification check is performed.
|
|
42
|
+
*/
|
|
43
|
+
checkConcurrentModification?(path: string): string | null;
|
|
44
|
+
}
|
|
45
|
+
export declare function createWriteTool(deps: WriteToolDeps): PortableTool<WriteToolParams>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Registry — CC-aligned getAllBaseTools() pattern.
|
|
3
|
+
*
|
|
4
|
+
* CC reference: claude-code-haha/src/tools.ts
|
|
5
|
+
*
|
|
6
|
+
* This is the SINGLE SOURCE OF TRUTH for all available tools.
|
|
7
|
+
* Tools are returned as a flat array from getAllBaseTools().
|
|
8
|
+
* Filtering/gating happens via getTools() using deny rules.
|
|
9
|
+
*
|
|
10
|
+
* Factory functions (createXxxTool) are kept because qlogicagent
|
|
11
|
+
* tools receive deps at creation time (vs CC context at call time).
|
|
12
|
+
* The registration pattern is aligned: pure function returns array.
|
|
13
|
+
*/
|
|
14
|
+
import type { PortableTool } from "./portable-tool.js";
|
|
15
|
+
import type { ToolDefinition } from "../agent/types.js";
|
|
16
|
+
import { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent } from "../agent/tool-access.js";
|
|
17
|
+
export { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent };
|
|
18
|
+
/**
|
|
19
|
+
* Register tools into the internal pool. Called by initToolDeps().
|
|
20
|
+
*/
|
|
21
|
+
export declare function setToolPool(tools: PortableTool[]): void;
|
|
22
|
+
/**
|
|
23
|
+
* Add a single tool to the pool (for dynamic tools like MCP, plugins).
|
|
24
|
+
*/
|
|
25
|
+
export declare function addTool(tool: PortableTool<any>): void;
|
|
26
|
+
/**
|
|
27
|
+
* Add multiple tools to the pool at once.
|
|
28
|
+
*/
|
|
29
|
+
export declare function addTools(tools: PortableTool<any>[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* Remove a tool by name. Returns true if it existed.
|
|
32
|
+
*/
|
|
33
|
+
export declare function removeTool(name: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Find a tool by name.
|
|
36
|
+
*/
|
|
37
|
+
export declare function findTool(name: string): PortableTool | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a tool exists.
|
|
40
|
+
*/
|
|
41
|
+
export declare function hasTool(name: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Get all tool names.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getToolNames(): string[];
|
|
46
|
+
/**
|
|
47
|
+
* Get the number of registered tools.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getToolCount(): number;
|
|
50
|
+
/**
|
|
51
|
+
* Execute a tool by name.
|
|
52
|
+
*/
|
|
53
|
+
export declare function executeTool(name: string, toolCallId: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<import("./portable-tool.js").PortableToolResult>;
|
|
54
|
+
/**
|
|
55
|
+
* CC: getTools() — return all enabled tools.
|
|
56
|
+
* Filters the pool by isEnabled() gate; disabled tools are invisible to callers.
|
|
57
|
+
* CC reference: claude-code-haha/src/tools.ts getTools()
|
|
58
|
+
*/
|
|
59
|
+
export declare function getTools(): PortableTool[];
|
|
60
|
+
/**
|
|
61
|
+
* Generate ToolDefinition[] manifest for LLM tool_use.
|
|
62
|
+
* Filters by isEnabled() — disabled tools never reach the model.
|
|
63
|
+
* CC: getTools() + manifest generation combined.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getToolManifest(includeDeferred?: boolean): ToolDefinition[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,10 +32,11 @@
|
|
|
32
32
|
"dev": "tsx watch src/index.ts",
|
|
33
33
|
"build": "node scripts/build.mjs",
|
|
34
34
|
"build:tsc": "tsc --noCheck",
|
|
35
|
-
"start": "node dist/cli
|
|
35
|
+
"start": "node dist/cli.js",
|
|
36
36
|
"test": "vitest run",
|
|
37
37
|
"test:watch": "vitest",
|
|
38
|
-
"lint": "oxlint ."
|
|
38
|
+
"lint": "oxlint .",
|
|
39
|
+
"release": "node scripts/release.mjs"
|
|
39
40
|
},
|
|
40
41
|
"engines": {
|
|
41
42
|
"node": ">=22.0.0"
|