qlogicagent 2.0.0 → 2.2.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 (69) hide show
  1. package/README.md +8 -8
  2. package/dist/agent.js +8 -8
  3. package/dist/cli.js +250 -203
  4. package/dist/contracts.js +1 -1
  5. package/dist/index.js +249 -202
  6. package/dist/orchestration.js +6 -6
  7. package/dist/types/agent/types.d.ts +3 -1
  8. package/dist/types/cli/stdio-server.d.ts +27 -8
  9. package/dist/types/cli/tool-bootstrap.d.ts +8 -0
  10. package/dist/types/contracts/hooks.d.ts +3 -0
  11. package/dist/types/contracts/index.d.ts +0 -1
  12. package/dist/types/contracts/todo.d.ts +8 -21
  13. package/dist/types/llm/adapters/aliyun-oss-file-upload-adapter.d.ts +44 -0
  14. package/dist/types/llm/adapters/gemini-file-upload-adapter.d.ts +26 -0
  15. package/dist/types/llm/adapters/hub-oss-file-upload-adapter.d.ts +29 -0
  16. package/dist/types/llm/adapters/index.d.ts +10 -0
  17. package/dist/types/llm/adapters/openai-file-upload-adapter.d.ts +38 -0
  18. package/dist/types/llm/adapters/volcengine-file-upload-adapter.d.ts +24 -0
  19. package/dist/types/llm/file-upload-service.d.ts +68 -0
  20. package/dist/types/llm/transports/anthropic-messages.d.ts +4 -0
  21. package/dist/types/llm/transports/gemini-generatecontent.d.ts +4 -0
  22. package/dist/types/llm/transports/media-resolve.d.ts +50 -0
  23. package/dist/types/llm/transports/openai-chat.d.ts +4 -0
  24. package/dist/types/llm/transports/openai-responses.d.ts +3 -0
  25. package/dist/types/llm/transports/volcengine-responses.d.ts +4 -0
  26. package/dist/types/orchestration/tool-loop/tool-schema.d.ts +1 -0
  27. package/dist/types/protocol/methods.d.ts +70 -0
  28. package/dist/types/protocol/notifications.d.ts +42 -0
  29. package/dist/types/runtime/execution/dream-agent.d.ts +2 -0
  30. package/dist/types/runtime/execution/dream-category-context.d.ts +47 -0
  31. package/dist/types/runtime/execution/dream-category-context.test.d.ts +1 -0
  32. package/dist/types/runtime/execution/index.d.ts +1 -0
  33. package/dist/types/runtime/execution/memory-decay.d.ts +57 -0
  34. package/dist/types/runtime/execution/memory-decay.test.d.ts +1 -0
  35. package/dist/types/runtime/hooks/index.d.ts +1 -0
  36. package/dist/types/runtime/hooks/memory-hooks.d.ts +20 -0
  37. package/dist/types/runtime/hooks/skill-recall-hooks.d.ts +36 -0
  38. package/dist/types/runtime/infra/agent-paths.d.ts +20 -2
  39. package/dist/types/runtime/infra/disk-storage.d.ts +0 -16
  40. package/dist/types/runtime/infra/index.d.ts +4 -2
  41. package/dist/types/runtime/infra/media-persistence.d.ts +71 -0
  42. package/dist/types/runtime/infra/project-instructions-store.d.ts +30 -0
  43. package/dist/types/runtime/infra/project-plan-store.d.ts +27 -0
  44. package/dist/types/runtime/infra/project-store.d.ts +30 -0
  45. package/dist/types/runtime/session/session-persistence.d.ts +3 -1
  46. package/dist/types/skills/index.d.ts +7 -9
  47. package/dist/types/skills/memory/categories.d.ts +5 -0
  48. package/dist/types/skills/memory/find-relevant-memories.d.ts +70 -0
  49. package/dist/types/skills/memory/memdir.d.ts +85 -0
  50. package/dist/types/skills/memory/memory-tool.d.ts +16 -44
  51. package/dist/types/skills/memory/qmemory-adapter.d.ts +12 -0
  52. package/dist/types/skills/memory/recall-category-filter.d.ts +54 -0
  53. package/dist/types/skills/permissions/group-security-policy.d.ts +15 -0
  54. package/dist/types/skills/permissions/index.d.ts +1 -0
  55. package/dist/types/skills/plugins/plugin-loader.d.ts +5 -0
  56. package/dist/types/skills/portable-tool.d.ts +13 -2
  57. package/dist/types/skills/tools/plan-mode-tool.d.ts +1 -1
  58. package/dist/types/skills/tools/read-tool.d.ts +2 -2
  59. package/dist/types/skills/tools/skill-tool.d.ts +16 -3
  60. package/dist/types/skills/tools/task-tool.d.ts +64 -75
  61. package/package.json +1 -1
  62. package/dist/types/contracts/planner.d.ts +0 -35
  63. package/dist/types/orchestration/error-handling/failover-error.d.ts +0 -33
  64. package/dist/types/skills/memory/memory-store.d.ts +0 -86
  65. package/dist/types/skills/todo-tool.d.ts +0 -72
  66. package/dist/types/skills/tools/skill-invoke-tool.d.ts +0 -46
  67. package/dist/types/skills/tools/skill-list-tool.d.ts +0 -33
  68. package/dist/types/skills/tools/skill-manage-tool.d.ts +0 -73
  69. package/dist/types/skills/tools/skill-view-tool.d.ts +0 -37
@@ -5,7 +5,12 @@
5
5
  export interface ToolContentBlock {
6
6
  type: "text" | "image";
7
7
  text?: string;
8
- /** base64-encoded image data (only when type === "image") */
8
+ /**
9
+ * base64-encoded image data (only when type === "image").
10
+ * Used by browser screenshots and MCP tools where data is already in memory.
11
+ * The tool invoker promotes these to data-URL imageUrls for transport resolution.
12
+ * For file-based images, prefer returning localPath via PortableToolResult.imageUrls.
13
+ */
9
14
  data?: string;
10
15
  mimeType?: string;
11
16
  }
@@ -16,6 +21,12 @@ export interface PortableToolResult {
16
21
  content: ToolContentBlock[];
17
22
  /** Arbitrary structured metadata for the calling runtime. */
18
23
  details?: Record<string, unknown>;
24
+ /**
25
+ * Local image file paths produced by this tool (e.g. read tool reading an image).
26
+ * Transport layer resolves these via FileUploadAdapter before sending to the LLM.
27
+ * This avoids loading large files into memory as base64.
28
+ */
29
+ imageUrls?: string[];
19
30
  }
20
31
  /**
21
32
  * A runtime-agnostic tool definition.
@@ -23,7 +34,7 @@ export interface PortableToolResult {
23
34
  * @typeParam TParams The expected parameter shape (for TypeScript consumers).
24
35
  */
25
36
  export interface PortableTool<TParams = Record<string, unknown>> {
26
- /** Unique tool name (e.g. "think", "todo", "memory"). */
37
+ /** Unique tool name (e.g. "think", "task", "memory"). */
27
38
  name: string;
28
39
  /** Human-readable label. */
29
40
  label: string;
@@ -54,7 +54,7 @@ export declare const PLAN_MODE_TOOL_SCHEMA: {
54
54
  };
55
55
  readonly required: readonly ["action"];
56
56
  };
57
- /** Tools allowed during plan mode (read-only + reasoning) */
57
+ /** Tools allowed during plan mode (read-only + reasoning + task tracking) */
58
58
  export declare const PLAN_MODE_ALLOWED_TOOLS: readonly string[];
59
59
  export interface PlanModeState {
60
60
  active: boolean;
@@ -26,13 +26,13 @@ export declare const READ_TOOL_SCHEMA: {
26
26
  export type ReadResultType = "text" | "image" | "binary_rejected";
27
27
  /** Deps injected by the host runtime for file reading. */
28
28
  export interface ReadToolDeps {
29
- /** Read file content. Return string for text, base64 for images, or rejection. */
29
+ /** Read file content. Return string for text, image path for images, or rejection. */
30
30
  readFile(path: string): Promise<{
31
31
  type: "text";
32
32
  text: string;
33
33
  } | {
34
34
  type: "image";
35
- base64: string;
35
+ localPath: string;
36
36
  mimeType: string;
37
37
  } | {
38
38
  type: "binary";
@@ -1,7 +1,7 @@
1
1
  import type { PortableTool } from "../portable-tool.js";
2
2
  import type { WorkspaceSkill } from "../skill-system/skill-types.js";
3
3
  export declare const SKILL_TOOL_NAME: "skill";
4
- export type SkillAction = "invoke" | "list" | "view" | "create" | "edit" | "patch" | "delete";
4
+ export type SkillAction = "invoke" | "list" | "view" | "create" | "edit" | "patch" | "delete" | "promote" | "install";
5
5
  export interface SkillToolParams {
6
6
  action: SkillAction;
7
7
  name?: string;
@@ -12,18 +12,20 @@ export interface SkillToolParams {
12
12
  fileContent?: string;
13
13
  oldString?: string;
14
14
  newString?: string;
15
+ /** URL to download skill from (for 'install' action). */
16
+ url?: string;
15
17
  }
16
18
  export declare const SKILL_TOOL_SCHEMA: {
17
19
  readonly type: "object";
18
20
  readonly properties: {
19
21
  readonly action: {
20
22
  readonly type: "string";
21
- readonly enum: readonly ["invoke", "list", "view", "create", "edit", "patch", "delete"];
23
+ readonly enum: readonly ["invoke", "list", "view", "create", "edit", "patch", "delete", "promote", "install"];
22
24
  readonly description: string;
23
25
  };
24
26
  readonly name: {
25
27
  readonly type: "string";
26
- readonly description: "Skill name (required for invoke/view/create/edit/patch/delete).";
28
+ readonly description: "Skill name (required for invoke/view/create/edit/patch/delete/promote).";
27
29
  };
28
30
  readonly args: {
29
31
  readonly type: "string";
@@ -53,6 +55,10 @@ export declare const SKILL_TOOL_SCHEMA: {
53
55
  readonly type: "string";
54
56
  readonly description: "Replacement text for patch action.";
55
57
  };
58
+ readonly url: {
59
+ readonly type: "string";
60
+ readonly description: "URL to download a skill from (for 'install' action). Supports skill stores (skillhub.cn, skill.io, GitHub raw links, etc.) and any direct .md URL.";
61
+ };
56
62
  };
57
63
  readonly required: readonly ["action"];
58
64
  };
@@ -61,6 +67,8 @@ export interface SkillListItem {
61
67
  description: string;
62
68
  version?: string;
63
69
  category?: string;
70
+ /** Where the skill lives: "global" (user-level) or "project" (cwd-level). */
71
+ scope?: "global" | "project" | "plugin" | "config";
64
72
  }
65
73
  export interface SkillListOutput {
66
74
  skills: SkillListItem[];
@@ -91,11 +99,16 @@ export interface SkillToolDeps {
91
99
  manageSkill(params: {
92
100
  action: string;
93
101
  name: string;
102
+ category?: string;
94
103
  content?: string;
95
104
  filePath?: string;
96
105
  fileContent?: string;
97
106
  oldString?: string;
98
107
  newString?: string;
99
108
  }): Promise<SkillManageResult>;
109
+ /** Promote a project-level skill to user/global level. Returns success message. */
110
+ promoteSkill?(name: string): Promise<SkillManageResult>;
111
+ /** Install a skill from a URL. Downloads .md content and saves it. */
112
+ installSkill?(url: string, name?: string): Promise<SkillManageResult>;
100
113
  }
101
114
  export declare function createSkillMetaTool(deps: SkillToolDeps): PortableTool<SkillToolParams>;
@@ -1,104 +1,93 @@
1
1
  import type { PortableTool } from "../portable-tool.js";
2
2
  export declare const TASK_TOOL_NAME: "task";
3
- export type TaskAction = "create" | "get" | "list" | "output" | "stop";
4
- export type TaskStatus = "pending" | "running" | "completed" | "failed" | "stopped";
3
+ export declare const TASK_ACTIONS: readonly ["create", "update", "delete", "list", "get"];
4
+ export type TaskAction = (typeof TASK_ACTIONS)[number];
5
+ export type TaskStatus = "not-started" | "in-progress" | "completed";
6
+ export declare const TASK_STATUS_VALUES: readonly TaskStatus[];
7
+ export interface TaskItem {
8
+ id: number;
9
+ title: string;
10
+ status: TaskStatus;
11
+ description?: string;
12
+ owner?: string;
13
+ blockedBy?: number[];
14
+ blocks?: number[];
15
+ }
16
+ export interface TaskListSummary {
17
+ total: number;
18
+ completed: number;
19
+ inProgress: number;
20
+ notStarted: number;
21
+ blocked: number;
22
+ }
5
23
  export interface TaskToolParams {
6
24
  action: TaskAction;
7
- /** Task ID (required for get/output/stop) */
8
- taskId?: string;
9
- /** Task prompt (required for create) */
10
- prompt?: string;
11
- /** Short description (3-7 words, for create) */
25
+ id?: number;
26
+ title?: string;
12
27
  description?: string;
13
- /** Allowed tools for the background agent */
14
- allowedTools?: string[];
15
- /** Working directory for the task */
16
- cwd?: string;
17
- /** Model override for the task agent */
18
- model?: string;
19
- /** Max output lines to return (for output action, default 100) */
20
- maxLines?: number;
28
+ status?: TaskStatus;
29
+ owner?: string;
30
+ addBlocks?: number[];
31
+ addBlockedBy?: number[];
21
32
  }
22
33
  export declare const TASK_TOOL_SCHEMA: {
23
34
  readonly type: "object";
24
35
  readonly properties: {
25
36
  readonly action: {
26
37
  readonly type: "string";
27
- readonly enum: readonly ["create", "get", "list", "output", "stop"];
38
+ readonly enum: readonly ["create", "update", "delete", "list", "get"];
28
39
  readonly description: string;
29
40
  };
30
- readonly taskId: {
31
- readonly type: "string";
32
- readonly description: "Task ID. Required for get/output/stop.";
41
+ readonly id: {
42
+ readonly type: "number";
43
+ readonly description: "[update|delete|get] Task id to operate on.";
33
44
  };
34
- readonly prompt: {
45
+ readonly title: {
35
46
  readonly type: "string";
36
- readonly description: string;
47
+ readonly description: "[create|update] Task title (3-7 words, imperative form).";
37
48
  };
38
49
  readonly description: {
39
50
  readonly type: "string";
40
- readonly description: "Short (3-7 word) description of the task. Used for tracking and display.";
41
- };
42
- readonly allowedTools: {
43
- readonly type: "array";
44
- readonly items: {
45
- readonly type: "string";
46
- };
47
- readonly description: "Restrict background agent to only these tools. If omitted, inherits parent's tools.";
51
+ readonly description: "[create|update] Detailed task description.";
48
52
  };
49
- readonly cwd: {
53
+ readonly status: {
50
54
  readonly type: "string";
51
- readonly description: "Working directory for the background task (absolute path).";
55
+ readonly enum: readonly ["not-started", "in-progress", "completed"];
56
+ readonly description: "[create|update] Task status. create defaults to not-started.";
52
57
  };
53
- readonly model: {
58
+ readonly owner: {
54
59
  readonly type: "string";
55
- readonly description: "Model override for the task agent (e.g. 'sonnet', 'opus').";
60
+ readonly description: "[create|update] Owner agent/subagent identifier.";
56
61
  };
57
- readonly maxLines: {
58
- readonly type: "number";
59
- readonly description: "Max output lines to return for the 'output' action (default: 100).";
60
- readonly minimum: 1;
61
- readonly maximum: 2000;
62
+ readonly addBlocks: {
63
+ readonly type: "array";
64
+ readonly items: {
65
+ readonly type: "number";
66
+ };
67
+ readonly description: "[update] Task IDs that this task should block (they depend on this task).";
68
+ };
69
+ readonly addBlockedBy: {
70
+ readonly type: "array";
71
+ readonly items: {
72
+ readonly type: "number";
73
+ };
74
+ readonly description: "[update] Task IDs that should block this task (this task depends on them).";
62
75
  };
63
76
  };
64
77
  readonly required: readonly ["action"];
65
78
  };
66
- export interface TaskInfo {
67
- taskId: string;
68
- status: TaskStatus;
69
- description?: string;
70
- prompt?: string;
71
- createdAt: number;
72
- completedAt?: number;
73
- result?: string;
74
- error?: string;
75
- }
76
- export interface TaskResult {
77
- success: boolean;
78
- task?: TaskInfo;
79
- tasks?: TaskInfo[];
80
- output?: string;
81
- error?: string;
79
+ export interface TaskToolOptions {
80
+ /** Unique agent/session identifier for per-agent task isolation. */
81
+ agentId?: string;
82
+ /** Enable verification nudge (default: true). */
83
+ verificationNudge?: boolean;
82
84
  }
83
- /** Host-provided task management backend. */
84
- export interface TaskToolDeps {
85
- /** Create a new background agent task. Returns the created task info. */
86
- createTask(params: {
87
- prompt: string;
88
- description?: string;
89
- allowedTools?: string[];
90
- cwd?: string;
91
- model?: string;
92
- }): Promise<TaskInfo>;
93
- /** Get a task by ID. Returns null if not found. */
94
- getTask(taskId: string): Promise<TaskInfo | null>;
95
- /** List all tasks (optionally filtered by status). */
96
- listTasks(filter?: {
97
- status?: TaskStatus;
98
- }): Promise<TaskInfo[]>;
99
- /** Get output/logs from a task. */
100
- getTaskOutput(taskId: string, maxLines?: number): Promise<string>;
101
- /** Stop a running task. Returns true if stopped successfully. */
102
- stopTask(taskId: string): Promise<boolean>;
85
+ export interface TaskToolHooks {
86
+ onTaskCreated?: (task: TaskItem) => void;
87
+ onTaskCompleted?: (task: TaskItem) => void;
103
88
  }
104
- export declare function createTaskTool(deps: TaskToolDeps): PortableTool<TaskToolParams>;
89
+ export declare function summarizeTaskList(items: readonly TaskItem[]): TaskListSummary;
90
+ /**
91
+ * Create a stateful task tool instance (V2 — CC TaskCreate/Update/List/Get aligned).
92
+ */
93
+ export declare function createTaskTool(options?: TaskToolOptions, hooks?: TaskToolHooks): PortableTool<TaskToolParams>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,35 +0,0 @@
1
- export declare const TASK_STEP_STATUS_VALUES: readonly ["pending", "in-progress", "completed", "skipped"];
2
- export type TaskStepStatus = (typeof TASK_STEP_STATUS_VALUES)[number];
3
- export declare const TASK_PLAN_STATUS_VALUES: readonly ["active", "completed", "abandoned"];
4
- export type TaskPlanStatus = (typeof TASK_PLAN_STATUS_VALUES)[number];
5
- export interface TaskStep {
6
- index: number;
7
- description: string;
8
- status: TaskStepStatus;
9
- result?: string;
10
- }
11
- export interface TaskPlan {
12
- id: string;
13
- sessionId: string;
14
- userId: string;
15
- goal: string;
16
- steps: TaskStep[];
17
- status: TaskPlanStatus;
18
- createdAt: string;
19
- updatedAt: string;
20
- constraints?: string[];
21
- keyIdentifiers?: string[];
22
- }
23
- export interface TaskPlanContextSnippet {
24
- text: string;
25
- tokens: number;
26
- planId: string;
27
- }
28
- export interface TaskPlanProgressSnapshot {
29
- goal: string;
30
- steps: Array<{
31
- description: string;
32
- status: TaskStepStatus | string;
33
- result?: string;
34
- }>;
35
- }
@@ -1,33 +0,0 @@
1
- import { type FailoverReason } from "./failover-classification.js";
2
- export declare class FailoverError extends Error {
3
- readonly reason: FailoverReason;
4
- readonly provider?: string;
5
- readonly model?: string;
6
- readonly profileId?: string;
7
- readonly status?: number;
8
- readonly code?: string;
9
- constructor(message: string, params: {
10
- reason: FailoverReason;
11
- provider?: string;
12
- model?: string;
13
- profileId?: string;
14
- status?: number;
15
- code?: string;
16
- cause?: unknown;
17
- });
18
- }
19
- export declare function isFailoverError(err: unknown): err is FailoverError;
20
- export declare function resolveFailoverStatus(reason: FailoverReason): number | undefined;
21
- export declare function isTimeoutError(err: unknown): boolean;
22
- export declare function resolveFailoverReasonFromError(err: unknown): FailoverReason | null;
23
- export declare function describeFailoverError(err: unknown): {
24
- message: string;
25
- reason?: FailoverReason;
26
- status?: number;
27
- code?: string;
28
- };
29
- export declare function coerceToFailoverError(err: unknown, context?: {
30
- provider?: string;
31
- model?: string;
32
- profileId?: string;
33
- }): FailoverError | null;
@@ -1,86 +0,0 @@
1
- export declare const MEMORY_ENTRY_DELIMITER = "\n\u00A7\n";
2
- export declare const DEFAULT_MEMORY_CHAR_LIMIT = 2200;
3
- export declare const DEFAULT_USER_CHAR_LIMIT = 1375;
4
- export type MemoryStoreTarget = "memory" | "user";
5
- export interface MemoryStoreResult {
6
- ok: boolean;
7
- message: string;
8
- target: MemoryStoreTarget;
9
- entries: readonly string[];
10
- entryCount: number;
11
- usage: string;
12
- errorCode?: string;
13
- }
14
- export interface MemoryStoreOptions {
15
- memoryCharLimit?: number;
16
- userCharLimit?: number;
17
- /** When true, mutations automatically persist to ~/.qlogicagent/memory.json */
18
- persistToDisk?: boolean;
19
- }
20
- export interface MemoryStoreSerialized {
21
- memory: string;
22
- user: string;
23
- }
24
- export declare class MemoryStore {
25
- private memoryEntries;
26
- private userEntries;
27
- private frozenSnapshot;
28
- private snapshotFrozen;
29
- private saveTimer;
30
- private readonly memoryCharLimit;
31
- private readonly userCharLimit;
32
- private readonly persistToDisk;
33
- constructor(options?: MemoryStoreOptions);
34
- /**
35
- * Load from serialized form (e.g. from PG or filesystem).
36
- * Deduplicates entries on load.
37
- */
38
- loadFromSerialized(data: Partial<MemoryStoreSerialized>): void;
39
- /**
40
- * Serialize current live state for persistence.
41
- */
42
- serialize(): MemoryStoreSerialized;
43
- /**
44
- * Load from disk (~/.qlogicagent/memory.json). No-op if file doesn't exist.
45
- * Call this at startup when persistToDisk is enabled.
46
- */
47
- loadFromDisk(): Promise<void>;
48
- /**
49
- * Synchronous variant for use in sync constructors / init paths.
50
- */
51
- loadFromDiskSync(): void;
52
- /**
53
- * Schedule a debounced save to disk (500ms). Multiple rapid mutations
54
- * coalesce into a single disk write.
55
- */
56
- private scheduleSave;
57
- /** Flush any pending save immediately. Call before shutdown. */
58
- flush(): Promise<void>;
59
- /**
60
- * Freeze current entries for system prompt injection.
61
- * Call once at session start. After freezing, mutations update
62
- * live state but NOT the system prompt block.
63
- */
64
- freezeSnapshot(): void;
65
- /**
66
- * Get frozen system prompt block for the given target.
67
- * Returns empty string if no entries or not yet frozen.
68
- */
69
- getSystemPromptBlock(target: MemoryStoreTarget): string;
70
- add(target: MemoryStoreTarget, content: string): MemoryStoreResult;
71
- replace(target: MemoryStoreTarget, oldText: string, newContent: string): MemoryStoreResult;
72
- remove(target: MemoryStoreTarget, oldText: string): MemoryStoreResult;
73
- getEntries(target: MemoryStoreTarget): readonly string[];
74
- getUsage(target: MemoryStoreTarget): {
75
- used: number;
76
- limit: number;
77
- percent: number;
78
- };
79
- isEmpty(): boolean;
80
- private entriesFor;
81
- private charLimitFor;
82
- private formatUsage;
83
- private renderBlock;
84
- private successResult;
85
- private errorResult;
86
- }
@@ -1,72 +0,0 @@
1
- import type { TodoItemStatus } from "../contracts/todo.js";
2
- import type { PortableTool } from "./portable-tool.js";
3
- export declare const TODO_TOOL_NAME: "todo";
4
- export declare const TODO_ACTIONS: readonly ["create", "update", "delete", "list"];
5
- export type TodoAction = (typeof TODO_ACTIONS)[number];
6
- export interface TodoToolParams {
7
- action: TodoAction;
8
- id?: number;
9
- title?: string;
10
- description?: string;
11
- status?: TodoItemStatus;
12
- owner?: string;
13
- addBlocks?: number[];
14
- addBlockedBy?: number[];
15
- }
16
- export declare const TODO_TOOL_SCHEMA: {
17
- readonly type: "object";
18
- readonly properties: {
19
- readonly action: {
20
- readonly type: "string";
21
- readonly enum: readonly ["create", "update", "delete", "list"];
22
- readonly description: string;
23
- };
24
- readonly id: {
25
- readonly type: "number";
26
- readonly description: "[update|delete] Task id to operate on.";
27
- };
28
- readonly title: {
29
- readonly type: "string";
30
- readonly description: "[create|update] Task title (3-7 words).";
31
- };
32
- readonly description: {
33
- readonly type: "string";
34
- readonly description: "[create|update] Detailed task description.";
35
- };
36
- readonly status: {
37
- readonly type: "string";
38
- readonly enum: readonly ["not-started", "in-progress", "completed"];
39
- readonly description: "[create|update] Task status. create defaults to not-started.";
40
- };
41
- readonly owner: {
42
- readonly type: "string";
43
- readonly description: "[create|update] Owner agent/subagent identifier.";
44
- };
45
- readonly addBlocks: {
46
- readonly type: "array";
47
- readonly items: {
48
- readonly type: "number";
49
- };
50
- readonly description: "[update] Task IDs that this task should block.";
51
- };
52
- readonly addBlockedBy: {
53
- readonly type: "array";
54
- readonly items: {
55
- readonly type: "number";
56
- };
57
- readonly description: "[update] Task IDs that should block this task.";
58
- };
59
- };
60
- readonly required: readonly ["action"];
61
- };
62
- /**
63
- * Configuration for todo tool behavior.
64
- */
65
- export interface TodoToolOptions {
66
- /** Unique agent/session identifier for per-agent todo isolation. */
67
- agentId?: string;
68
- }
69
- /**
70
- * Create a stateful todo tool instance (V2 — incremental CRUD).
71
- */
72
- export declare function createTodoTool(options?: TodoToolOptions): PortableTool<TodoToolParams>;
@@ -1,46 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- import type { WorkspaceSkill } from "../skill-system/skill-types.js";
3
- export declare const SKILL_TOOL_NAME: "skill_invoke";
4
- export interface SkillInvokeParams {
5
- skill: string;
6
- args?: string;
7
- }
8
- export declare const SKILL_INVOKE_SCHEMA: {
9
- readonly type: "object";
10
- readonly properties: {
11
- readonly skill: {
12
- readonly type: "string";
13
- readonly description: "Name of the skill to invoke. Use skill_list to see available skills.";
14
- };
15
- readonly args: {
16
- readonly type: "string";
17
- readonly description: string;
18
- };
19
- };
20
- readonly required: readonly ["skill"];
21
- };
22
- export interface SkillToolDeps {
23
- /**
24
- * Get all available skills (Layer 0 metadata).
25
- * Returns name + description pairs for tool manifest enrichment.
26
- */
27
- listSkills(): WorkspaceSkill[];
28
- /**
29
- * Read skill content (Layer 1 instructions).
30
- * Returns the full SKILL.md content for the named skill.
31
- * Returns null if skill not found.
32
- */
33
- readSkillContent(name: string): Promise<string | null>;
34
- /**
35
- * Execute the skill instructions as a sub-turn.
36
- * The implementation should:
37
- * 1. Build system prompt from SKILL.md content
38
- * 2. Run a sub-turn (fork) with skill instructions
39
- * 3. Return the sub-turn's final response
40
- *
41
- * If not provided, the skill content is returned directly
42
- * (the LLM can then follow the instructions in context).
43
- */
44
- executeSkillSubturn?(skillName: string, skillContent: string, userArgs: string | undefined, signal?: AbortSignal): Promise<string>;
45
- }
46
- export declare function createSkillTool(deps: SkillToolDeps): PortableTool<SkillInvokeParams>;
@@ -1,33 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const SKILL_LIST_TOOL_NAME: "skill_list";
3
- export interface SkillListToolParams {
4
- category?: string;
5
- }
6
- export declare const SKILL_LIST_TOOL_SCHEMA: {
7
- readonly type: "object";
8
- readonly properties: {
9
- readonly category: {
10
- readonly type: "string";
11
- readonly description: "Filter skills by category (e.g. 'devops', 'mlops'). Omit to list all.";
12
- };
13
- };
14
- readonly required: readonly [];
15
- };
16
- export interface SkillListItem {
17
- name: string;
18
- description: string;
19
- version?: string;
20
- category?: string;
21
- }
22
- export interface SkillListOutput {
23
- skills: SkillListItem[];
24
- categories: string[];
25
- }
26
- /**
27
- * Host-provided skill registry for listing.
28
- */
29
- export interface SkillListToolDeps {
30
- /** List all available skills, optionally filtered by category. */
31
- listSkills(category?: string): Promise<SkillListOutput>;
32
- }
33
- export declare function createSkillListTool(deps: SkillListToolDeps): PortableTool<SkillListToolParams>;