qlogicagent 0.3.0 → 0.4.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.
Files changed (119) hide show
  1. package/README.md +45 -45
  2. package/package.json +1 -1
  3. package/dist/agent.js +0 -1
  4. package/dist/cli.js +0 -9
  5. package/dist/contracts.js +0 -1
  6. package/dist/index.js +0 -5
  7. package/dist/orchestration.js +0 -118
  8. package/dist/types/agent/agent.d.ts +0 -43
  9. package/dist/types/agent/tool-loop.d.ts +0 -64
  10. package/dist/types/agent/types.d.ts +0 -175
  11. package/dist/types/cli/main.d.ts +0 -11
  12. package/dist/types/cli/stdio-server.d.ts +0 -45
  13. package/dist/types/config/config.d.ts +0 -17
  14. package/dist/types/contracts/hooks.d.ts +0 -120
  15. package/dist/types/contracts/index.d.ts +0 -10
  16. package/dist/types/contracts/planner.d.ts +0 -35
  17. package/dist/types/contracts/skill-candidate.d.ts +0 -63
  18. package/dist/types/contracts/todo.d.ts +0 -14
  19. package/dist/types/index.d.ts +0 -13
  20. package/dist/types/llm/builtin-providers.d.ts +0 -10
  21. package/dist/types/llm/index.d.ts +0 -15
  22. package/dist/types/llm/llm-client.d.ts +0 -43
  23. package/dist/types/llm/model-catalog.d.ts +0 -53
  24. package/dist/types/llm/provider-def.d.ts +0 -59
  25. package/dist/types/llm/provider-registry.d.ts +0 -54
  26. package/dist/types/llm/transport.d.ts +0 -62
  27. package/dist/types/llm/transports/anthropic-messages.d.ts +0 -31
  28. package/dist/types/llm/transports/openai-chat.d.ts +0 -36
  29. package/dist/types/orchestration/agent-registry.d.ts +0 -41
  30. package/dist/types/orchestration/approval-aware-tool-plan.d.ts +0 -32
  31. package/dist/types/orchestration/context-compression.d.ts +0 -220
  32. package/dist/types/orchestration/conversation-repair.d.ts +0 -61
  33. package/dist/types/orchestration/curator-scheduler.d.ts +0 -119
  34. package/dist/types/orchestration/embedded-failover-policy.d.ts +0 -110
  35. package/dist/types/orchestration/error-classification.d.ts +0 -12
  36. package/dist/types/orchestration/failover-classification.d.ts +0 -8
  37. package/dist/types/orchestration/failover-error.d.ts +0 -33
  38. package/dist/types/orchestration/fork-subagent.d.ts +0 -100
  39. package/dist/types/orchestration/index.d.ts +0 -120
  40. package/dist/types/orchestration/memory-flush-policy.d.ts +0 -57
  41. package/dist/types/orchestration/memory-provider.d.ts +0 -14
  42. package/dist/types/orchestration/parallel-tool-calls.d.ts +0 -41
  43. package/dist/types/orchestration/prompt-cache-strategy.d.ts +0 -126
  44. package/dist/types/orchestration/reactive-compact.d.ts +0 -73
  45. package/dist/types/orchestration/retry-loop.d.ts +0 -22
  46. package/dist/types/orchestration/skill-candidate.d.ts +0 -52
  47. package/dist/types/orchestration/skill-consolidation.d.ts +0 -123
  48. package/dist/types/orchestration/skill-improvement.d.ts +0 -59
  49. package/dist/types/orchestration/skill-similarity.d.ts +0 -98
  50. package/dist/types/orchestration/streaming-tool-executor.d.ts +0 -73
  51. package/dist/types/orchestration/team-orchestration.d.ts +0 -195
  52. package/dist/types/orchestration/team-tool-loop-wiring.d.ts +0 -92
  53. package/dist/types/orchestration/tool-choice-policy.d.ts +0 -54
  54. package/dist/types/orchestration/tool-loop-state.d.ts +0 -50
  55. package/dist/types/orchestration/tool-schema.d.ts +0 -39
  56. package/dist/types/orchestration/transcript-repair.d.ts +0 -42
  57. package/dist/types/orchestration/turn-loop-guard.d.ts +0 -86
  58. package/dist/types/orchestration/web-browser-policy.d.ts +0 -17
  59. package/dist/types/runtime/context-compression.d.ts +0 -61
  60. package/dist/types/runtime/hook-registry.d.ts +0 -12
  61. package/dist/types/runtime/memory-hooks.d.ts +0 -23
  62. package/dist/types/runtime/tool-eligibility.d.ts +0 -59
  63. package/dist/types/skills/index.d.ts +0 -108
  64. package/dist/types/skills/memory-extractor.d.ts +0 -64
  65. package/dist/types/skills/memory-query-tool.d.ts +0 -43
  66. package/dist/types/skills/memory-store.d.ts +0 -66
  67. package/dist/types/skills/memory-tool.d.ts +0 -67
  68. package/dist/types/skills/portable-tool.d.ts +0 -71
  69. package/dist/types/skills/qmemory-adapter.d.ts +0 -52
  70. package/dist/types/skills/skill-frontmatter.d.ts +0 -19
  71. package/dist/types/skills/skill-guard.d.ts +0 -23
  72. package/dist/types/skills/skill-loader.d.ts +0 -16
  73. package/dist/types/skills/skill-source.d.ts +0 -119
  74. package/dist/types/skills/skill-types.d.ts +0 -199
  75. package/dist/types/skills/think-tool.d.ts +0 -16
  76. package/dist/types/skills/todo-tool.d.ts +0 -63
  77. package/dist/types/skills/tools/agent-tool.d.ts +0 -91
  78. package/dist/types/skills/tools/apply-patch-tool.d.ts +0 -29
  79. package/dist/types/skills/tools/ask-user-tool.d.ts +0 -80
  80. package/dist/types/skills/tools/brief-tool.d.ts +0 -74
  81. package/dist/types/skills/tools/browser-tool.d.ts +0 -114
  82. package/dist/types/skills/tools/checkpoint-tool.d.ts +0 -66
  83. package/dist/types/skills/tools/config-tool.d.ts +0 -63
  84. package/dist/types/skills/tools/cron-tool.d.ts +0 -116
  85. package/dist/types/skills/tools/edit-tool.d.ts +0 -43
  86. package/dist/types/skills/tools/exec-tool.d.ts +0 -102
  87. package/dist/types/skills/tools/image-generate-tool.d.ts +0 -62
  88. package/dist/types/skills/tools/instructions-tool.d.ts +0 -103
  89. package/dist/types/skills/tools/lsp-tool.d.ts +0 -153
  90. package/dist/types/skills/tools/mcp-client-types.d.ts +0 -269
  91. package/dist/types/skills/tools/mcp-tool.d.ts +0 -249
  92. package/dist/types/skills/tools/memory-tool.d.ts +0 -74
  93. package/dist/types/skills/tools/monitor-tool.d.ts +0 -113
  94. package/dist/types/skills/tools/music-generate-tool.d.ts +0 -55
  95. package/dist/types/skills/tools/notify-tool.d.ts +0 -53
  96. package/dist/types/skills/tools/patch-tool.d.ts +0 -45
  97. package/dist/types/skills/tools/pdf-tool.d.ts +0 -66
  98. package/dist/types/skills/tools/plan-mode-tool.d.ts +0 -59
  99. package/dist/types/skills/tools/read-tool.d.ts +0 -51
  100. package/dist/types/skills/tools/repl-tool.d.ts +0 -70
  101. package/dist/types/skills/tools/search-tool.d.ts +0 -112
  102. package/dist/types/skills/tools/send-message-tool.d.ts +0 -51
  103. package/dist/types/skills/tools/skill-list-tool.d.ts +0 -33
  104. package/dist/types/skills/tools/skill-manage-tool.d.ts +0 -73
  105. package/dist/types/skills/tools/skill-view-tool.d.ts +0 -37
  106. package/dist/types/skills/tools/sleep-tool.d.ts +0 -49
  107. package/dist/types/skills/tools/structured-output-tool.d.ts +0 -116
  108. package/dist/types/skills/tools/task-tool.d.ts +0 -104
  109. package/dist/types/skills/tools/team-tool.d.ts +0 -89
  110. package/dist/types/skills/tools/tool-search-tool.d.ts +0 -51
  111. package/dist/types/skills/tools/tts-tool.d.ts +0 -38
  112. package/dist/types/skills/tools/video-edit-tool.d.ts +0 -69
  113. package/dist/types/skills/tools/video-generate-tool.d.ts +0 -62
  114. package/dist/types/skills/tools/video-merge-tool.d.ts +0 -105
  115. package/dist/types/skills/tools/video-upscale-tool.d.ts +0 -45
  116. package/dist/types/skills/tools/web-fetch-tool.d.ts +0 -78
  117. package/dist/types/skills/tools/web-search-tool.d.ts +0 -57
  118. package/dist/types/skills/tools/worktree-tool.d.ts +0 -69
  119. package/dist/types/skills/tools/write-tool.d.ts +0 -45
@@ -1,16 +0,0 @@
1
- import type { PortableTool } from "./portable-tool.js";
2
- export declare const THINK_TOOL_NAME: "think";
3
- export interface ThinkToolParams {
4
- thought: string;
5
- }
6
- export declare const THINK_TOOL_SCHEMA: {
7
- readonly type: "object";
8
- readonly properties: {
9
- readonly thought: {
10
- readonly type: "string";
11
- readonly description: string;
12
- };
13
- };
14
- readonly required: readonly ["thought"];
15
- };
16
- export declare function createThinkTool(): PortableTool<ThinkToolParams>;
@@ -1,63 +0,0 @@
1
- import type { TodoItem } from "../contracts/todo.js";
2
- import type { PortableTool } from "./portable-tool.js";
3
- export declare const TODO_TOOL_NAME: "todo";
4
- export interface TodoToolParams {
5
- todoList: TodoItem[];
6
- }
7
- export declare const TODO_TOOL_SCHEMA: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly todoList: {
11
- readonly type: "array";
12
- readonly description: string;
13
- readonly items: {
14
- readonly type: "object";
15
- readonly properties: {
16
- readonly id: {
17
- readonly type: "number";
18
- readonly description: "Unique numeric id (sequential from 1).";
19
- };
20
- readonly title: {
21
- readonly type: "string";
22
- readonly description: "Concise action-oriented label (3-7 words). Displayed in UI.";
23
- };
24
- readonly status: {
25
- readonly type: "string";
26
- readonly enum: readonly ["not-started", "in-progress", "completed"];
27
- readonly description: "not-started | in-progress (max 1) | completed";
28
- };
29
- };
30
- readonly required: readonly ["id", "title", "status"];
31
- };
32
- };
33
- };
34
- readonly required: readonly ["todoList"];
35
- };
36
- /**
37
- * Configuration for todo tool behavior (CC-aligned features).
38
- */
39
- export interface TodoToolOptions {
40
- /**
41
- * Unique agent/session identifier for per-agent todo isolation.
42
- * When provided, different agents have independent todo lists.
43
- */
44
- agentId?: string;
45
- /**
46
- * Whether verification nudge is enabled.
47
- * When all items are completed (≥3 items, none matching /verif/i),
48
- * the tool signals that a verification sub-agent should be spawned.
49
- */
50
- enableVerificationNudge?: boolean;
51
- /**
52
- * Whether to auto-clear the list when all items are completed.
53
- * Matches CC behavior: allDone → newTodos = [].
54
- */
55
- autoClearOnComplete?: boolean;
56
- }
57
- /**
58
- * Create a stateful todo tool instance.
59
- *
60
- * Each call returns a tool with its own session-local list.
61
- * Multiple instances can exist for different sessions/agents.
62
- */
63
- export declare function createTodoTool(options?: TodoToolOptions): PortableTool<TodoToolParams>;
@@ -1,91 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const AGENT_TOOL_NAME: "agent";
3
- /**
4
- * Built-in agent types (CC-aligned registry).
5
- * The LLM selects which agent to fork based on the task.
6
- */
7
- export type BuiltInAgentType = "general" | "explore" | "plan" | "code" | "research" | "verify";
8
- export declare const BUILT_IN_AGENT_TYPES: BuiltInAgentType[];
9
- export interface AgentToolParams {
10
- /** Built-in agent type to invoke. */
11
- agent: BuiltInAgentType;
12
- /** Detailed task prompt for the sub-agent. */
13
- prompt: string;
14
- /** Short description of the task (3-7 words). Used for status display. */
15
- description?: string;
16
- /** Max turns override (default varies by agent type). */
17
- maxTurns?: number;
18
- /** Run in background (returns task_id immediately). */
19
- background?: boolean;
20
- }
21
- export declare const AGENT_TOOL_SCHEMA: {
22
- readonly type: "object";
23
- readonly properties: {
24
- readonly agent: {
25
- readonly type: "string";
26
- readonly enum: readonly ["general", "explore", "plan", "code", "research", "verify"];
27
- readonly description: string;
28
- };
29
- readonly prompt: {
30
- readonly type: "string";
31
- readonly description: string;
32
- };
33
- readonly description: {
34
- readonly type: "string";
35
- readonly description: "Short description (3-7 words) for status tracking.";
36
- };
37
- readonly maxTurns: {
38
- readonly type: "number";
39
- readonly description: "Max turns for the sub-agent. Defaults: general=200, explore=50, plan=80, code=200, research=30, verify=40.";
40
- };
41
- readonly background: {
42
- readonly type: "boolean";
43
- readonly description: "If true, runs in background and returns a task_id. Poll with task tool. Default: false.";
44
- };
45
- };
46
- readonly required: readonly ["agent", "prompt"];
47
- readonly additionalProperties: false;
48
- };
49
- export interface AgentResult {
50
- agentId: string;
51
- status: "completed" | "running" | "failed";
52
- output?: string;
53
- error?: string;
54
- maxTurnsReached?: boolean;
55
- tokensUsed?: number;
56
- }
57
- /**
58
- * Host-provided fork execution backend (CC-aligned).
59
- *
60
- * Key properties of the fork mechanism:
61
- * 1. Child shares parent's message prefix (prompt cache hit)
62
- * 2. Child uses byte-identical prefix via placeholder results
63
- * 3. Child has independent tool context (isolation)
64
- * 4. Results flow back via in-memory streaming (not DB)
65
- * 5. Fork depth tracked in-memory (max 4 layers)
66
- */
67
- export interface AgentToolDeps {
68
- /**
69
- * Fork and run a sub-agent.
70
- * The implementation must:
71
- * - Share parent's rendered system prompt (byte-identical for cache)
72
- * - Inherit parent's tool pool (filtered by agent definition)
73
- * - Track fork depth (reject if > MAX_FORK_DEPTH)
74
- * - Return output via in-memory streaming backflow
75
- */
76
- forkAgent(params: {
77
- agent: BuiltInAgentType;
78
- prompt: string;
79
- description?: string;
80
- maxTurns?: number;
81
- background?: boolean;
82
- abortSignal?: AbortSignal;
83
- }): Promise<AgentResult>;
84
- /** Abort signal from the parent turn. */
85
- abortSignal?: AbortSignal;
86
- /** Current fork depth (0 = root). Used for depth guard. */
87
- currentForkDepth?: number;
88
- }
89
- /** Maximum fork depth for in-memory agents. */
90
- export declare const MAX_FORK_DEPTH = 4;
91
- export declare function createAgentTool(deps: AgentToolDeps): PortableTool<AgentToolParams>;
@@ -1,29 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const APPLY_PATCH_TOOL_NAME: "apply_patch";
3
- export interface ApplyPatchToolParams {
4
- input: string;
5
- }
6
- export declare const APPLY_PATCH_TOOL_SCHEMA: {
7
- readonly type: "object";
8
- readonly properties: {
9
- readonly input: {
10
- readonly type: "string";
11
- readonly description: "Patch content using the *** Begin Patch / *** End Patch format.";
12
- };
13
- };
14
- readonly required: readonly ["input"];
15
- };
16
- export interface ApplyPatchSummary {
17
- added: string[];
18
- modified: string[];
19
- deleted: string[];
20
- }
21
- /** Deps injected by the host runtime for file patching. */
22
- export interface ApplyPatchToolDeps {
23
- readFile(path: string): Promise<string>;
24
- writeFile(path: string, content: string): Promise<void>;
25
- deleteFile(path: string): Promise<void>;
26
- fileExists(path: string): Promise<boolean>;
27
- resolvePath(input: string): string;
28
- }
29
- export declare function createApplyPatchTool(deps: ApplyPatchToolDeps): PortableTool<ApplyPatchToolParams>;
@@ -1,80 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const ASK_USER_TOOL_NAME: "ask_user";
3
- export interface AskUserOption {
4
- label: string;
5
- description?: string;
6
- }
7
- export interface AskUserQuestion {
8
- question: string;
9
- header: string;
10
- options?: AskUserOption[];
11
- multiSelect?: boolean;
12
- }
13
- export interface AskUserToolParams {
14
- questions: AskUserQuestion[];
15
- }
16
- export declare const ASK_USER_TOOL_SCHEMA: {
17
- readonly type: "object";
18
- readonly properties: {
19
- readonly questions: {
20
- readonly type: "array";
21
- readonly minItems: 1;
22
- readonly maxItems: 4;
23
- readonly description: "1-4 clarifying questions to ask the user.";
24
- readonly items: {
25
- readonly type: "object";
26
- readonly properties: {
27
- readonly question: {
28
- readonly type: "string";
29
- readonly description: "The question text. Should end with '?'.";
30
- };
31
- readonly header: {
32
- readonly type: "string";
33
- readonly description: "Short identifier/tag for this question (max 50 chars).";
34
- };
35
- readonly options: {
36
- readonly type: "array";
37
- readonly description: "2-4 options for the user to choose from. Omit for free text.";
38
- readonly items: {
39
- readonly type: "object";
40
- readonly properties: {
41
- readonly label: {
42
- readonly type: "string";
43
- readonly description: "Display label (1-5 words).";
44
- };
45
- readonly description: {
46
- readonly type: "string";
47
- readonly description: "Brief explanation of this option.";
48
- };
49
- };
50
- readonly required: readonly ["label"];
51
- };
52
- };
53
- readonly multiSelect: {
54
- readonly type: "boolean";
55
- readonly description: "Allow selecting multiple options (default: false).";
56
- };
57
- };
58
- readonly required: readonly ["question", "header"];
59
- };
60
- };
61
- };
62
- readonly required: readonly ["questions"];
63
- };
64
- export interface AskUserAnswer {
65
- question: string;
66
- answer: string;
67
- }
68
- /**
69
- * Host-provided user interaction backend.
70
- * The host renders the questions in the UI and collects answers.
71
- */
72
- export interface AskUserToolDeps {
73
- /**
74
- * Present questions to the user and collect answers.
75
- * Returns a map of question text → answer text.
76
- * If the user declines, returns null.
77
- */
78
- askUser(questions: AskUserQuestion[]): Promise<Record<string, string> | null>;
79
- }
80
- export declare function createAskUserTool(deps: AskUserToolDeps): PortableTool<AskUserToolParams>;
@@ -1,74 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const BRIEF_TOOL_NAME: "send_user_message";
3
- export type BriefMessageStatus = "normal" | "proactive";
4
- export interface BriefAttachment {
5
- /** Absolute or workspace-relative path */
6
- path: string;
7
- /** Size in bytes (filled by host) */
8
- size?: number;
9
- /** Whether the file is an image */
10
- isImage?: boolean;
11
- /** Upload UUID (host may upload for web preview) */
12
- fileUuid?: string;
13
- }
14
- export interface BriefToolParams {
15
- /** Markdown-formatted message to display to the user */
16
- message: string;
17
- /** File attachments to include with the message */
18
- attachments?: string[];
19
- /** Message status — 'proactive' for unsolicited updates */
20
- status?: BriefMessageStatus;
21
- }
22
- export declare const BRIEF_TOOL_SCHEMA: {
23
- readonly type: "object";
24
- readonly properties: {
25
- readonly message: {
26
- readonly type: "string";
27
- readonly description: string;
28
- readonly minLength: 1;
29
- };
30
- readonly attachments: {
31
- readonly type: "array";
32
- readonly description: "Optional file paths to attach (images, documents, etc.).";
33
- readonly items: {
34
- readonly type: "string";
35
- };
36
- readonly maxItems: 10;
37
- };
38
- readonly status: {
39
- readonly type: "string";
40
- readonly enum: readonly ["normal", "proactive"];
41
- readonly description: string;
42
- };
43
- };
44
- readonly required: readonly ["message"];
45
- };
46
- export interface BriefDeliveryResult {
47
- delivered: boolean;
48
- attachments?: BriefAttachment[];
49
- sentAt?: string;
50
- error?: string;
51
- }
52
- /**
53
- * Host-provided message delivery backend.
54
- */
55
- export interface BriefToolDeps {
56
- /** Deliver the message to the user's UI */
57
- deliverMessage(params: {
58
- message: string;
59
- attachments?: string[];
60
- status: BriefMessageStatus;
61
- }): Promise<BriefDeliveryResult>;
62
- /** Validate and resolve attachment paths. Returns resolved attachments or error. */
63
- resolveAttachments?(paths: string[]): Promise<BriefAttachment[] | {
64
- error: string;
65
- }>;
66
- }
67
- /** Check if brief mode is active (host determines this) */
68
- export interface BriefModeConfig {
69
- /** Whether the agent is in brief/chat mode */
70
- isBriefMode: boolean;
71
- /** Whether the user opted in via UI/CLI */
72
- userOptIn?: boolean;
73
- }
74
- export declare function createBriefTool(deps: BriefToolDeps): PortableTool<BriefToolParams>;
@@ -1,114 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const BROWSER_TOOL_NAME: "browser";
3
- export type BrowserAction = "navigate" | "click" | "type" | "scroll" | "snapshot" | "screenshot" | "console" | "cdp";
4
- export interface BrowserToolParams {
5
- /** Browser action to perform */
6
- action: BrowserAction;
7
- /** URL for navigate action */
8
- url?: string;
9
- /** Element reference (e.g. "@e5") for click/type actions */
10
- ref?: string;
11
- /** Text to type */
12
- text?: string;
13
- /** Scroll direction */
14
- direction?: "up" | "down" | "left" | "right";
15
- /** CDP method name for raw cdp action */
16
- method?: string;
17
- /** CDP params object */
18
- params?: Record<string, unknown>;
19
- /** JavaScript expression for console eval */
20
- expression?: string;
21
- /** Whether to include full accessibility tree */
22
- full?: boolean;
23
- }
24
- export declare const BROWSER_TOOL_SCHEMA: {
25
- readonly type: "object";
26
- readonly properties: {
27
- readonly action: {
28
- readonly type: "string";
29
- readonly enum: readonly ["navigate", "click", "type", "scroll", "snapshot", "screenshot", "console", "cdp"];
30
- readonly description: string;
31
- };
32
- readonly url: {
33
- readonly type: "string";
34
- readonly description: "URL to navigate to. Required for 'navigate' action.";
35
- };
36
- readonly ref: {
37
- readonly type: "string";
38
- readonly description: "Element reference like \"@e5\" from a previous snapshot. Required for click/type.";
39
- };
40
- readonly text: {
41
- readonly type: "string";
42
- readonly description: "Text to type into the referenced element. Required for 'type' action.";
43
- };
44
- readonly direction: {
45
- readonly type: "string";
46
- readonly enum: readonly ["up", "down", "left", "right"];
47
- readonly description: "Scroll direction. Required for 'scroll' action.";
48
- };
49
- readonly method: {
50
- readonly type: "string";
51
- readonly description: "CDP method name (e.g. 'Page.reload'). Required for 'cdp' action.";
52
- };
53
- readonly params: {
54
- readonly type: "object";
55
- readonly description: "Parameters for the CDP method. Optional for 'cdp' action.";
56
- };
57
- readonly expression: {
58
- readonly type: "string";
59
- readonly description: "JavaScript expression to evaluate. Used with 'console' action.";
60
- };
61
- readonly full: {
62
- readonly type: "boolean";
63
- readonly description: "Include full accessibility tree (default: compact). Used with 'snapshot'.";
64
- };
65
- };
66
- readonly required: readonly ["action"];
67
- };
68
- export interface BrowserSnapshot {
69
- elements: Array<{
70
- ref: string;
71
- role: string;
72
- name: string;
73
- text?: string;
74
- }>;
75
- url: string;
76
- title: string;
77
- }
78
- export interface BrowserScreenshot {
79
- base64: string;
80
- mimeType: string;
81
- width: number;
82
- height: number;
83
- }
84
- /**
85
- * Host-provided browser automation backend.
86
- * The host manages Chrome/Chromium lifecycle and CDP connections.
87
- */
88
- export interface BrowserToolDeps {
89
- navigate(url: string): Promise<{
90
- snapshot: BrowserSnapshot;
91
- }>;
92
- click(ref: string): Promise<{
93
- success: boolean;
94
- error?: string;
95
- }>;
96
- type(ref: string, text: string): Promise<{
97
- success: boolean;
98
- error?: string;
99
- }>;
100
- scroll(direction: "up" | "down" | "left" | "right"): Promise<{
101
- success: boolean;
102
- }>;
103
- snapshot(full?: boolean): Promise<BrowserSnapshot>;
104
- screenshot(): Promise<BrowserScreenshot>;
105
- consoleEval(expression?: string): Promise<{
106
- result?: string;
107
- messages?: string[];
108
- errors?: string[];
109
- }>;
110
- cdp(method: string, params?: Record<string, unknown>): Promise<Record<string, unknown>>;
111
- /** Validate URL safety (SSRF prevention). Returns error message if blocked, null if safe. */
112
- validateUrl(url: string): string | null;
113
- }
114
- export declare function createBrowserTool(deps: BrowserToolDeps): PortableTool<BrowserToolParams>;
@@ -1,66 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const CHECKPOINT_TOOL_NAME: "checkpoint";
3
- export type CheckpointAction = "create" | "list" | "restore" | "diff";
4
- export interface CheckpointToolParams {
5
- action: CheckpointAction;
6
- /** Checkpoint ID (for restore/diff) */
7
- checkpointId?: string;
8
- /** Optional message for create */
9
- message?: string;
10
- /** File paths to restore (partial restore). If empty, restores all. */
11
- paths?: string[];
12
- }
13
- export declare const CHECKPOINT_TOOL_SCHEMA: {
14
- readonly type: "object";
15
- readonly properties: {
16
- readonly action: {
17
- readonly type: "string";
18
- readonly enum: readonly ["create", "list", "restore", "diff"];
19
- readonly description: string;
20
- };
21
- readonly checkpointId: {
22
- readonly type: "string";
23
- readonly description: "Checkpoint ID. Required for restore and diff.";
24
- };
25
- readonly message: {
26
- readonly type: "string";
27
- readonly description: "Optional descriptive message for the checkpoint.";
28
- };
29
- readonly paths: {
30
- readonly type: "array";
31
- readonly items: {
32
- readonly type: "string";
33
- };
34
- readonly description: "File paths to restore (partial restore). Omit to restore everything.";
35
- };
36
- };
37
- readonly required: readonly ["action"];
38
- };
39
- export interface Checkpoint {
40
- id: string;
41
- message: string;
42
- timestamp: string;
43
- fileCount: number;
44
- }
45
- export interface CheckpointResult {
46
- success: boolean;
47
- checkpoint?: Checkpoint;
48
- checkpoints?: Checkpoint[];
49
- diff?: string;
50
- error?: string;
51
- }
52
- /**
53
- * Host-provided checkpoint backend.
54
- * Uses shadow git repos (isolated from user project) for snapshots.
55
- */
56
- export interface CheckpointToolDeps {
57
- /** Create a snapshot of the current workspace state */
58
- createCheckpoint(message?: string): Promise<CheckpointResult>;
59
- /** List all available checkpoints */
60
- listCheckpoints(): Promise<CheckpointResult>;
61
- /** Restore workspace to a checkpoint state (optionally partial) */
62
- restoreCheckpoint(checkpointId: string, paths?: string[]): Promise<CheckpointResult>;
63
- /** Show diff between current state and a checkpoint */
64
- diffCheckpoint(checkpointId: string): Promise<CheckpointResult>;
65
- }
66
- export declare function createCheckpointTool(deps: CheckpointToolDeps): PortableTool<CheckpointToolParams>;
@@ -1,63 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const CONFIG_TOOL_NAME: "config";
3
- export type ConfigAction = "get" | "set" | "list" | "reset";
4
- export interface ConfigToolParams {
5
- /** Config action */
6
- action: ConfigAction;
7
- /** Setting key path (e.g. "model", "language", "theme") */
8
- key?: string;
9
- /** Value to set (for 'set' action) */
10
- value?: string | boolean | number;
11
- }
12
- export declare const CONFIG_TOOL_SCHEMA: {
13
- readonly type: "object";
14
- readonly properties: {
15
- readonly action: {
16
- readonly type: "string";
17
- readonly enum: readonly ["get", "set", "list", "reset"];
18
- readonly description: string;
19
- };
20
- readonly key: {
21
- readonly type: "string";
22
- readonly description: string;
23
- };
24
- readonly value: {
25
- readonly description: "Value to set. Type depends on the setting. Required for 'set' action.";
26
- };
27
- };
28
- readonly required: readonly ["action"];
29
- };
30
- export interface ConfigSetting {
31
- key: string;
32
- value: unknown;
33
- type: "string" | "boolean" | "number" | "enum";
34
- description: string;
35
- options?: string[];
36
- readOnly?: boolean;
37
- }
38
- export interface ConfigResult {
39
- success: boolean;
40
- setting?: ConfigSetting;
41
- settings?: ConfigSetting[];
42
- previousValue?: unknown;
43
- error?: string;
44
- }
45
- /** Keys that cannot be modified by LLM (security-critical) */
46
- export declare const CONFIG_READONLY_KEYS: readonly string[];
47
- /**
48
- * Host-provided config backend.
49
- * Manages persistent agent settings with safety guardrails.
50
- */
51
- export interface ConfigToolDeps {
52
- /** Get a single config value */
53
- getConfig(key: string): Promise<ConfigResult>;
54
- /** Set a config value (respects readonly/whitelist) */
55
- setConfig(key: string, value: unknown): Promise<ConfigResult>;
56
- /** List all available config settings */
57
- listConfig(): Promise<ConfigResult>;
58
- /** Reset a setting to default */
59
- resetConfig(key: string): Promise<ConfigResult>;
60
- /** Check if a key is supported/valid */
61
- isValidKey?(key: string): boolean;
62
- }
63
- export declare function createConfigTool(deps: ConfigToolDeps): PortableTool<ConfigToolParams>;