qlogicagent 0.5.3 → 1.0.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 (104) hide show
  1. package/README.md +24 -23
  2. package/dist/agent.js +13 -13
  3. package/dist/cli.js +218 -184
  4. package/dist/contracts.js +1 -1
  5. package/dist/index.js +391 -20
  6. package/dist/orchestration.js +14 -105
  7. package/dist/types/agent/agent.d.ts +1 -1
  8. package/dist/types/agent/constants.d.ts +2 -2
  9. package/dist/types/agent/tool-access.d.ts +30 -0
  10. package/dist/types/agent/tool-loop.d.ts +2 -4
  11. package/dist/types/agent/types.d.ts +51 -13
  12. package/dist/types/cli/main.d.ts +3 -3
  13. package/dist/types/cli/stdio-server.d.ts +89 -7
  14. package/dist/types/cli/tool-bootstrap.d.ts +16 -5
  15. package/dist/types/cli/transport.d.ts +40 -0
  16. package/dist/types/contracts/index.d.ts +0 -1
  17. package/dist/types/contracts/todo.d.ts +9 -0
  18. package/dist/types/index.d.ts +3 -0
  19. package/dist/types/llm/index.d.ts +7 -1
  20. package/dist/types/llm/media-client.d.ts +43 -0
  21. package/dist/types/llm/media-transport.d.ts +80 -0
  22. package/dist/types/llm/model-catalog.d.ts +5 -5
  23. package/dist/types/llm/provider-def.d.ts +7 -0
  24. package/dist/types/llm/provider-registry.d.ts +1 -1
  25. package/dist/types/llm/transport.d.ts +2 -0
  26. package/dist/types/llm/transports/anthropic-messages.d.ts +34 -11
  27. package/dist/types/llm/transports/gemini-media.d.ts +21 -0
  28. package/dist/types/llm/transports/minimax-media.d.ts +21 -0
  29. package/dist/types/llm/transports/openai-chat.d.ts +1 -1
  30. package/dist/types/llm/transports/openai-media.d.ts +24 -0
  31. package/dist/types/llm/transports/qwen-media.d.ts +25 -0
  32. package/dist/types/llm/transports/volcengine-media.d.ts +34 -0
  33. package/dist/types/orchestration/index.d.ts +14 -112
  34. package/dist/types/orchestration/skill-improvement.d.ts +2 -2
  35. package/dist/types/orchestration/{fork-subagent.d.ts → subagent/fork-subagent.d.ts} +2 -4
  36. package/dist/types/orchestration/{tool-schema.d.ts → tool-loop/tool-schema.d.ts} +1 -2
  37. package/dist/types/protocol/index.d.ts +7 -0
  38. package/dist/types/protocol/methods.d.ts +380 -0
  39. package/dist/types/protocol/notifications.d.ts +296 -0
  40. package/dist/types/runtime/execution/dream-agent.d.ts +1 -1
  41. package/dist/types/runtime/execution/forked-agent.d.ts +1 -3
  42. package/dist/types/runtime/hooks/context-compression.d.ts +1 -1
  43. package/dist/types/runtime/infra/agent-paths.d.ts +57 -0
  44. package/dist/types/runtime/infra/checkpoint-backend.d.ts +8 -0
  45. package/dist/types/runtime/infra/disk-storage.d.ts +36 -0
  46. package/dist/types/runtime/infra/file-watcher.d.ts +2 -2
  47. package/dist/types/runtime/infra/index.d.ts +2 -0
  48. package/dist/types/runtime/infra/secure-storage.d.ts +1 -1
  49. package/dist/types/runtime/infra/task-runtime.d.ts +1 -1
  50. package/dist/types/runtime/prompt/environment-context.d.ts +1 -1
  51. package/dist/types/runtime/prompt/instruction-loader.d.ts +6 -6
  52. package/dist/types/runtime/session/index.d.ts +1 -1
  53. package/dist/types/runtime/session/session-memory.d.ts +0 -1
  54. package/dist/types/runtime/session/session-persistence.d.ts +1 -1
  55. package/dist/types/runtime/session/session-state.d.ts +18 -9
  56. package/dist/types/skills/index.d.ts +20 -26
  57. package/dist/types/skills/mcp/mcp-manager.d.ts +3 -4
  58. package/dist/types/skills/mcp/mcp-stdio-client.d.ts +1 -1
  59. package/dist/types/skills/{memory-store.d.ts → memory/memory-store.d.ts} +20 -0
  60. package/dist/types/skills/{memory-tool.d.ts → memory/memory-tool.d.ts} +20 -0
  61. package/dist/types/skills/{qmemory-adapter.d.ts → memory/qmemory-adapter.d.ts} +1 -0
  62. package/dist/types/skills/permissions/hook-runner.d.ts +1 -1
  63. package/dist/types/skills/permissions/settings-watcher.d.ts +2 -2
  64. package/dist/types/skills/plugins/plugin-api.d.ts +1 -1
  65. package/dist/types/skills/plugins/plugin-loader.d.ts +1 -4
  66. package/dist/types/skills/plugins/plugin-marketplace.d.ts +1 -1
  67. package/dist/types/skills/portable-tool.d.ts +34 -1
  68. package/dist/types/skills/todo-tool.d.ts +51 -42
  69. package/dist/types/skills/tools/instructions-tool.d.ts +20 -58
  70. package/dist/types/skills/tools/shell/shell-exec.d.ts +2 -0
  71. package/dist/types/skills/tools/skill-invoke-tool.d.ts +2 -2
  72. package/dist/types/skills/tools.d.ts +65 -0
  73. package/package.json +2 -2
  74. package/dist/types/contracts/skill-candidate.d.ts +0 -63
  75. package/dist/types/orchestration/curator-scheduler.d.ts +0 -119
  76. package/dist/types/orchestration/memory-provider.d.ts +0 -14
  77. package/dist/types/orchestration/skill-candidate.d.ts +0 -52
  78. package/dist/types/orchestration/skill-consolidation.d.ts +0 -123
  79. package/dist/types/orchestration/skill-similarity.d.ts +0 -98
  80. package/dist/types/orchestration/team-orchestration.d.ts +0 -195
  81. package/dist/types/orchestration/team-tool-loop-wiring.d.ts +0 -92
  82. package/dist/types/skills/memory-query-tool.d.ts +0 -43
  83. package/dist/types/skills/tool-registry.d.ts +0 -29
  84. package/dist/types/skills/tools/memory-tool.d.ts +0 -74
  85. package/dist/types/skills/tools/pdf-tool.d.ts +0 -66
  86. /package/dist/types/orchestration/{context-collapse.d.ts → context/context-collapse.d.ts} +0 -0
  87. /package/dist/types/orchestration/{context-compression.d.ts → context/context-compression.d.ts} +0 -0
  88. /package/dist/types/orchestration/{reactive-compact.d.ts → context/reactive-compact.d.ts} +0 -0
  89. /package/dist/types/orchestration/{turn-loop-guard.d.ts → context/turn-loop-guard.d.ts} +0 -0
  90. /package/dist/types/orchestration/{error-classification.d.ts → error-handling/error-classification.d.ts} +0 -0
  91. /package/dist/types/orchestration/{failover-classification.d.ts → error-handling/failover-classification.d.ts} +0 -0
  92. /package/dist/types/orchestration/{failover-error.d.ts → error-handling/failover-error.d.ts} +0 -0
  93. /package/dist/types/orchestration/{retry-loop.d.ts → error-handling/retry-loop.d.ts} +0 -0
  94. /package/dist/types/orchestration/{agent-registry.d.ts → subagent/agent-registry.d.ts} +0 -0
  95. /package/dist/types/orchestration/{task-types.d.ts → subagent/task-types.d.ts} +0 -0
  96. /package/dist/types/orchestration/{conversation-repair.d.ts → tool-loop/conversation-repair.d.ts} +0 -0
  97. /package/dist/types/orchestration/{tool-choice-policy.d.ts → tool-loop/tool-choice-policy.d.ts} +0 -0
  98. /package/dist/types/orchestration/{tool-loop-state.d.ts → tool-loop/tool-loop-state.d.ts} +0 -0
  99. /package/dist/types/skills/{memory-extractor.d.ts → memory/memory-extractor.d.ts} +0 -0
  100. /package/dist/types/skills/{skill-frontmatter.d.ts → skill-system/skill-frontmatter.d.ts} +0 -0
  101. /package/dist/types/skills/{skill-guard.d.ts → skill-system/skill-guard.d.ts} +0 -0
  102. /package/dist/types/skills/{skill-loader.d.ts → skill-system/skill-loader.d.ts} +0 -0
  103. /package/dist/types/skills/{skill-source.d.ts → skill-system/skill-source.d.ts} +0 -0
  104. /package/dist/types/skills/{skill-types.d.ts → skill-system/skill-types.d.ts} +0 -0
@@ -1,19 +1,17 @@
1
1
  export type { PortableTool, PortableToolResult, ToolContentBlock, } from "./portable-tool.js";
2
- export { ToolRegistry } from "./tool-registry.js";
3
- export { MEMORY_TOOL_NAME, MEMORY_TOOL_MAX_CONTENT_LENGTH, MEMORY_TOOL_ACTIONS, MEMORY_TOOL_SCHEMA, MEMORY_TOOL_DESCRIPTION, MEMORY_TOOL_LABEL, isMemoryContentSafe, executeMemoryTool, } from "./memory-tool.js";
4
- export type { MemoryToolAction, MemoryToolParams, MemoryToolResult, MemoryToolExecutorDeps, } from "./memory-tool.js";
5
- export { MemoryStore, MEMORY_ENTRY_DELIMITER, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_USER_CHAR_LIMIT, } from "./memory-store.js";
6
- export type { MemoryStoreTarget, MemoryStoreResult, MemoryStoreOptions, MemoryStoreSerialized, } from "./memory-store.js";
7
- export { createQMemoryAdapter } from "./qmemory-adapter.js";
8
- export type { QMemoryAdapterConfig, QMemoryHealthStatus, ExtractedMemoryItem } from "./qmemory-adapter.js";
9
- export { createMemoryExtractor } from "./memory-extractor.js";
10
- export type { ExtractedMemory, ProfileUpdate, ExtractionResult, ExtractionCompleteFn, MemoryExtractorOptions, } from "./memory-extractor.js";
2
+ export { setToolPool, addTool, addTools, removeTool, findTool, hasTool, getToolNames, getToolCount, executeTool, getToolManifest, getTools, AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent, } from "./tools.js";
3
+ export { MEMORY_TOOL_NAME, MEMORY_TOOL_MAX_CONTENT_LENGTH, MEMORY_TOOL_ACTIONS, MEMORY_TOOL_SCHEMA, MEMORY_TOOL_DESCRIPTION, MEMORY_TOOL_LABEL, isMemoryContentSafe, executeMemoryTool, } from "./memory/memory-tool.js";
4
+ export type { MemoryToolAction, MemoryToolParams, MemoryToolResult, MemoryToolExecutorDeps, MediaPreferencesSummary, } from "./memory/memory-tool.js";
5
+ export { MemoryStore, MEMORY_ENTRY_DELIMITER, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_USER_CHAR_LIMIT, } from "./memory/memory-store.js";
6
+ export type { MemoryStoreTarget, MemoryStoreResult, MemoryStoreOptions, MemoryStoreSerialized, } from "./memory/memory-store.js";
7
+ export { createQMemoryAdapter } from "./memory/qmemory-adapter.js";
8
+ export type { QMemoryAdapterConfig, QMemoryHealthStatus, ExtractedMemoryItem } from "./memory/qmemory-adapter.js";
9
+ export { createMemoryExtractor } from "./memory/memory-extractor.js";
10
+ export type { ExtractedMemory, ProfileUpdate, ExtractionResult, ExtractionCompleteFn, MemoryExtractorOptions, } from "./memory/memory-extractor.js";
11
11
  export { THINK_TOOL_NAME, THINK_TOOL_SCHEMA, createThinkTool } from "./think-tool.js";
12
12
  export type { ThinkToolParams } from "./think-tool.js";
13
- export { TODO_TOOL_NAME, TODO_TOOL_SCHEMA, createTodoTool } from "./todo-tool.js";
14
- export type { TodoToolParams, TodoToolOptions } from "./todo-tool.js";
15
- export { MEMORY_QUERY_TOOL_NAME, MEMORY_QUERY_TOOL_SCHEMA, createMemoryQueryTool, } from "./memory-query-tool.js";
16
- export type { MemoryQueryToolParams, MemoryQueryToolDeps, MediaPreferencesSummary, } from "./memory-query-tool.js";
13
+ export { TODO_TOOL_NAME, TODO_TOOL_SCHEMA, TODO_ACTIONS, createTodoTool } from "./todo-tool.js";
14
+ export type { TodoToolParams, TodoToolOptions, TodoAction } from "./todo-tool.js";
17
15
  export { READ_TOOL_NAME, READ_TOOL_SCHEMA, createReadTool } from "./tools/read-tool.js";
18
16
  export type { ReadToolParams, ReadToolDeps, ReadResultType } from "./tools/read-tool.js";
19
17
  export { WRITE_TOOL_NAME, WRITE_TOOL_SCHEMA, createWriteTool } from "./tools/write-tool.js";
@@ -22,8 +20,6 @@ export { EDIT_TOOL_NAME, EDIT_TOOL_SCHEMA, createEditTool } from "./tools/edit-t
22
20
  export type { EditToolParams, EditToolDeps } from "./tools/edit-tool.js";
23
21
  export { APPLY_PATCH_TOOL_NAME, APPLY_PATCH_TOOL_SCHEMA, createApplyPatchTool } from "./tools/apply-patch-tool.js";
24
22
  export type { ApplyPatchToolParams, ApplyPatchToolDeps, ApplyPatchSummary } from "./tools/apply-patch-tool.js";
25
- export { PDF_TOOL_NAME, PDF_TOOL_SCHEMA, createPdfTool } from "./tools/pdf-tool.js";
26
- export type { PdfToolParams, PdfToolDeps } from "./tools/pdf-tool.js";
27
23
  export { EXEC_TOOL_NAME, EXEC_TOOL_SCHEMA, createExecTool, ASSISTANT_BLOCKING_BUDGET_MS } from "./tools/exec-tool.js";
28
24
  export type { ExecToolParams, ExecToolHost, ExecProgress, ExecToolOutput } from "./tools/exec-tool.js";
29
25
  export { isPowerShellToolEnabled, getDefaultShellType, generateCommandId, createBashProvider, createPowerShellProvider, encodePowerShellCommand, classifyCommand, commandHasAnyCd, SEARCH_COMMANDS, READ_COMMANDS, LIST_COMMANDS, SILENT_COMMANDS, SAFE_ENV_VARS, BARE_SHELL_PREFIXES, stripSafeWrappers, stripAllLeadingEnvVars, getSimpleCommandPrefix, getFirstWordPrefix, stripWrappersFromArgv, detectBlockedSleepPattern, TaskOutput, generateTaskId, getTaskOutputDir, setTaskOutputDir, getTaskOutputPath, MAX_TASK_OUTPUT_BYTES, wrapSpawn, createAbortedCommand, createFailedCommand, exec, getCwd, setCwd, initCwd, getOriginalCwd, setShellProvider, getShellProvider, } from "./tools/shell/index.js";
@@ -72,8 +68,6 @@ export { BROWSER_TOOL_NAME, BROWSER_TOOL_SCHEMA, createBrowserTool } from "./too
72
68
  export type { BrowserToolParams, BrowserToolDeps, BrowserAction, BrowserSnapshot, BrowserScreenshot } from "./tools/browser-tool.js";
73
69
  export { CRON_TOOL_NAME, CRON_TOOL_SCHEMA, MAX_CRON_JOBS, createCronTool } from "./tools/cron-tool.js";
74
70
  export type { CronToolParams, CronToolDeps, CronJob, CronResult, CronAction } from "./tools/cron-tool.js";
75
- export { MEMORY_SEARCH_TOOL_NAME, MEMORY_SEARCH_TOOL_SCHEMA, createMemorySearchTool } from "./tools/memory-tool.js";
76
- export type { MemorySearchToolParams, MemorySearchToolDeps, MemoryEntry, MemoryQueryOutput, MemorySource } from "./tools/memory-tool.js";
77
71
  export { CHECKPOINT_TOOL_NAME, CHECKPOINT_TOOL_SCHEMA, createCheckpointTool } from "./tools/checkpoint-tool.js";
78
72
  export type { CheckpointToolParams, CheckpointToolDeps, Checkpoint, CheckpointResult, CheckpointAction } from "./tools/checkpoint-tool.js";
79
73
  export { NOTIFY_TOOL_NAME, NOTIFY_TOOL_SCHEMA, createNotifyTool } from "./tools/notify-tool.js";
@@ -100,15 +94,15 @@ export { MONITOR_TOOL_NAME, MONITOR_TOOL_SCHEMA, createMonitorTool } from "./too
100
94
  export type { MonitorToolParams, MonitorToolDeps, MonitorSource, MonitorAction, MonitorCondition, MonitorInfo, MonitorResult, } from "./tools/monitor-tool.js";
101
95
  export { STRUCTURED_OUTPUT_TOOL_NAME, STRUCTURED_OUTPUT_TOOL_SCHEMA, STRUCTURED_OUTPUT_MAX_CHARS, createStructuredOutputTool, createConfiguredStructuredOutputTool, isStructuredOutputEnabled, } from "./tools/structured-output-tool.js";
102
96
  export type { StructuredOutputToolParams, StructuredOutputToolDeps, StructuredOutputResult, SchemaValidationError, ConfiguredToolResult, SchemaCompiler, } from "./tools/structured-output-tool.js";
103
- export { INSTRUCTIONS_LIST_TOOL_NAME, INSTRUCTIONS_LIST_SCHEMA, createInstructionsListTool, INSTRUCTIONS_READ_TOOL_NAME, INSTRUCTIONS_READ_SCHEMA, createInstructionsReadTool, INSTRUCTIONS_WRITE_TOOL_NAME, INSTRUCTIONS_WRITE_SCHEMA, createInstructionsWriteTool, INSTRUCTIONS_DELETE_TOOL_NAME, INSTRUCTIONS_DELETE_SCHEMA, createInstructionsDeleteTool, } from "./tools/instructions-tool.js";
104
- export type { InstructionFileInfo, InstructionFileContent, InstructionsToolDeps, InstructionsListParams, InstructionsReadParams, InstructionsWriteParams, InstructionsDeleteParams, } from "./tools/instructions-tool.js";
105
- export type { ParsedSkillFrontmatter, WorkspaceSkill, SkillInstallSpec, SkillMetadata, SkillInvocationPolicy, SkillEntry, SkillCommandDispatchSpec, SkillCommandSpec, SkillSnapshot, SkillScanSeverity, SkillScanFinding, SkillScanSummary, SkillScanOptions, SkillFsDeps, SkillPathDeps, SkillLoadLimits, SkillSearchPaths, SkillLoaderDeps, } from "./skill-types.js";
106
- export { parseFrontmatter, resolveSkillMetadata, resolveSkillInvocationPolicy, resolveSkillKey, } from "./skill-frontmatter.js";
107
- export { loadSkillEntries, filterSkillEntries, buildSkillSnapshot, } from "./skill-loader.js";
108
- export { scanSource, scanSkillDirectory, hasCriticalFindings, isScannable, } from "./skill-guard.js";
109
- export type { SkillGuardDeps } from "./skill-guard.js";
110
- export { installSkill, uninstallSkill, createEmptyLockfile, } from "./skill-source.js";
111
- export type { TrustLevel, ScanVerdict, SkillSourceDescriptor, SkillFetchResult, SkillFetchDeps, SkillStorageDeps, SkillLockEntry, SkillLockfile, SkillInstallResult, } from "./skill-source.js";
97
+ export { INSTRUCTIONS_TOOL_NAME, INSTRUCTIONS_TOOL_SCHEMA, createInstructionsTool, } from "./tools/instructions-tool.js";
98
+ export type { InstructionFileInfo, InstructionFileContent, InstructionsToolDeps, InstructionsAction, InstructionsToolParams, } from "./tools/instructions-tool.js";
99
+ export type { ParsedSkillFrontmatter, WorkspaceSkill, SkillInstallSpec, SkillMetadata, SkillInvocationPolicy, SkillEntry, SkillCommandDispatchSpec, SkillCommandSpec, SkillSnapshot, SkillScanSeverity, SkillScanFinding, SkillScanSummary, SkillScanOptions, SkillFsDeps, SkillPathDeps, SkillLoadLimits, SkillSearchPaths, SkillLoaderDeps, } from "./skill-system/skill-types.js";
100
+ export { parseFrontmatter, resolveSkillMetadata, resolveSkillInvocationPolicy, resolveSkillKey, } from "./skill-system/skill-frontmatter.js";
101
+ export { loadSkillEntries, filterSkillEntries, buildSkillSnapshot, } from "./skill-system/skill-loader.js";
102
+ export { scanSource, scanSkillDirectory, hasCriticalFindings, isScannable, } from "./skill-system/skill-guard.js";
103
+ export type { SkillGuardDeps } from "./skill-system/skill-guard.js";
104
+ export { installSkill, uninstallSkill, createEmptyLockfile, } from "./skill-system/skill-source.js";
105
+ export type { TrustLevel, ScanVerdict, SkillSourceDescriptor, SkillFetchResult, SkillFetchDeps, SkillStorageDeps, SkillLockEntry, SkillLockfile, SkillInstallResult, } from "./skill-system/skill-source.js";
112
106
  export { SKILL_TOOL_NAME, SKILL_INVOKE_SCHEMA, createSkillTool } from "./tools/skill-invoke-tool.js";
113
107
  export type { SkillInvokeParams, SkillToolDeps } from "./tools/skill-invoke-tool.js";
114
108
  export { McpStdioClient } from "./mcp/mcp-stdio-client.js";
@@ -1,4 +1,3 @@
1
- import type { ToolRegistry } from "../tool-registry.js";
2
1
  /** MCP resource entry from resources/list */
3
2
  export interface McpResourceEntry {
4
3
  uri: string;
@@ -42,7 +41,7 @@ export interface McpManagerConfig {
42
41
  }
43
42
  export declare class McpManager {
44
43
  private clients;
45
- private registry;
44
+ private injected;
46
45
  private log;
47
46
  constructor(config: McpManagerConfig);
48
47
  /**
@@ -50,9 +49,9 @@ export declare class McpManager {
50
49
  */
51
50
  connectAll(): Promise<void>;
52
51
  /**
53
- * Register all MCP tools into the given ToolRegistry.
52
+ * Register all MCP tools into the centralized tool pool.
54
53
  */
55
- injectTools(registry: ToolRegistry): void;
54
+ injectTools(): void;
56
55
  /**
57
56
  * Get names of all connected servers.
58
57
  */
@@ -64,7 +64,7 @@ export declare class McpStdioClient {
64
64
  blob?: string;
65
65
  }>>;
66
66
  /**
67
- * Convert MCP tools to PortableTool instances for ToolRegistry.
67
+ * Convert MCP tools to PortableTool instances for the tool pool.
68
68
  * Tool names are prefixed: mcp__{serverName}__{toolName}
69
69
  */
70
70
  toPortableTools(): PortableTool[];
@@ -14,6 +14,8 @@ export interface MemoryStoreResult {
14
14
  export interface MemoryStoreOptions {
15
15
  memoryCharLimit?: number;
16
16
  userCharLimit?: number;
17
+ /** When true, mutations automatically persist to ~/.qlogicagent/memory.json */
18
+ persistToDisk?: boolean;
17
19
  }
18
20
  export interface MemoryStoreSerialized {
19
21
  memory: string;
@@ -24,8 +26,10 @@ export declare class MemoryStore {
24
26
  private userEntries;
25
27
  private frozenSnapshot;
26
28
  private snapshotFrozen;
29
+ private saveTimer;
27
30
  private readonly memoryCharLimit;
28
31
  private readonly userCharLimit;
32
+ private readonly persistToDisk;
29
33
  constructor(options?: MemoryStoreOptions);
30
34
  /**
31
35
  * Load from serialized form (e.g. from PG or filesystem).
@@ -36,6 +40,22 @@ export declare class MemoryStore {
36
40
  * Serialize current live state for persistence.
37
41
  */
38
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>;
39
59
  /**
40
60
  * Freeze current entries for system prompt injection.
41
61
  * Call once at session start. After freezing, mutations update
@@ -1,5 +1,13 @@
1
1
  import type { MemoryProvider, MemorySearchResult } from "qlogicagent-runtime-contracts";
2
2
  import type { MemoryStore, MemoryStoreTarget } from "./memory-store.js";
3
+ export interface MediaPreferencesSummary {
4
+ imageStyle?: string;
5
+ videoStyle?: string;
6
+ musicGenre?: string;
7
+ musicMood?: string;
8
+ primaryPurpose?: string;
9
+ colorPreference?: string;
10
+ }
3
11
  export declare const MEMORY_TOOL_NAME: "memory";
4
12
  export declare const MEMORY_TOOL_MAX_CONTENT_LENGTH = 2000;
5
13
  export declare const MEMORY_TOOL_ACTIONS: readonly ["add", "replace", "remove", "search"];
@@ -29,6 +37,11 @@ export declare const MEMORY_TOOL_SCHEMA: {
29
37
  readonly type: "string";
30
38
  readonly description: "Required for 'search'. Natural language query to find relevant memories.";
31
39
  };
40
+ readonly category: {
41
+ readonly type: "string";
42
+ readonly enum: readonly ["profile", "facts", "media", "projects"];
43
+ readonly description: string;
44
+ };
32
45
  };
33
46
  readonly required: readonly ["action"];
34
47
  };
@@ -41,6 +54,7 @@ export interface MemoryToolParams {
41
54
  content?: string;
42
55
  old_text?: string;
43
56
  query?: string;
57
+ category?: "profile" | "facts" | "media" | "projects";
44
58
  }
45
59
  export interface MemoryToolResult {
46
60
  ok: boolean;
@@ -63,5 +77,11 @@ export interface MemoryToolExecutorDeps {
63
77
  store?: MemoryStore;
64
78
  userId: string;
65
79
  sessionId?: string;
80
+ /** Query recalled facts/memories by natural language. */
81
+ queryGraph?: (query: string, userId: string) => string[];
82
+ /** Retrieve user profile summary. */
83
+ getProfileSummary?: (userId: string) => string | null;
84
+ /** Retrieve media preferences. */
85
+ getMediaPreferences?: (userId: string) => MediaPreferencesSummary | null;
66
86
  }
67
87
  export declare function executeMemoryTool(params: MemoryToolParams, deps: MemoryToolExecutorDeps): Promise<MemoryToolResult>;
@@ -35,6 +35,7 @@ export interface QMemoryHealthStatus {
35
35
  */
36
36
  export declare function createQMemoryAdapter(config: QMemoryAdapterConfig): MemoryProvider & {
37
37
  health(): Promise<QMemoryHealthStatus>;
38
+ remove(memoryId: string): Promise<boolean>;
38
39
  ingestExtracted(items: ExtractedMemoryItem[], userId: string, options?: MemoryIngestOptions): Promise<{
39
40
  memoriesAdded: number;
40
41
  }>;
@@ -3,7 +3,7 @@ import type { ToolDefinition } from "../../agent/types.js";
3
3
  import { PermissionRuleEngine } from "./rule-engine.js";
4
4
  import type { PermissionUpdate, ApprovalRequest, ApprovalResponse } from "./types.js";
5
5
  import { type ClassifierLLMCall } from "./permission-classifier.js";
6
- import type { PermissionRole } from "../../orchestration/task-types.js";
6
+ import type { PermissionRole } from "../../orchestration/subagent/task-types.js";
7
7
  export interface PermissionCheckerDeps {
8
8
  ruleEngine: PermissionRuleEngine;
9
9
  hookRegistry: HookRegistry;
@@ -5,7 +5,7 @@
5
5
  * when it changes on disk. This allows users to adjust permission rules
6
6
  * without restarting the agent session.
7
7
  *
8
- * Settings file location: `.openclaw/settings.json` in the project root
8
+ * Settings file location: `.qlogicagent/settings.json` in the project root
9
9
  *
10
10
  * Watched fields:
11
11
  * - permissionMode: PermissionMode
@@ -24,7 +24,7 @@ export interface SettingsFile {
24
24
  defaultBehavior?: PermissionBehavior;
25
25
  }
26
26
  export interface SettingsWatcherDeps {
27
- /** Project root directory (where .openclaw/ lives) */
27
+ /** Project root directory (where .qlogicagent/ lives) */
28
28
  projectRoot: string;
29
29
  /** Permission rule engine to update on changes */
30
30
  ruleEngine: PermissionRuleEngine;
@@ -1,6 +1,6 @@
1
1
  import type { PortableTool } from "../portable-tool.js";
2
2
  import type { HookPoint, HookHandler } from "../../contracts/hooks.js";
3
- import type { WorkspaceSkill } from "../skill-types.js";
3
+ import type { WorkspaceSkill } from "../skill-system/skill-types.js";
4
4
  export type PluginHookPhase = "preToolUse" | "postToolUse" | "onTurnStart" | "onTurnEnd" | "onSessionEnd";
5
5
  /** Map plugin hook phases to internal HookPoint names */
6
6
  export declare const PLUGIN_HOOK_MAP: Record<PluginHookPhase, HookPoint>;
@@ -1,12 +1,9 @@
1
- import type { ToolRegistry } from "../tool-registry.js";
2
1
  import type { HookRegistry } from "../../contracts/hooks.js";
3
- import type { WorkspaceSkill } from "../skill-types.js";
2
+ import type { WorkspaceSkill } from "../skill-system/skill-types.js";
4
3
  import { type LoadedPlugin } from "./plugin-api.js";
5
4
  export interface PluginLoaderConfig {
6
5
  /** Directories to scan for plugins (order = priority) */
7
6
  pluginDirs: string[];
8
- /** ToolRegistry to inject plugin tools into */
9
- toolRegistry: ToolRegistry;
10
7
  /** HookRegistry to wire plugin hooks into */
11
8
  hookRegistry: HookRegistry;
12
9
  /** Logger */
@@ -51,7 +51,7 @@ export declare function loadCachedPlugins(): string[];
51
51
  export declare function installMarketplacePlugins(config: MarketplaceConfig, log: MarketplaceLogger): Promise<string[]>;
52
52
  /**
53
53
  * Get the marketplace config from user settings.
54
- * Reads ~/.openclaw/marketplace.json
54
+ * Reads ~/.qlogicagent/marketplace.json
55
55
  */
56
56
  export declare function loadMarketplaceConfig(): MarketplaceConfig | null;
57
57
  /**
@@ -23,7 +23,7 @@ export interface PortableToolResult {
23
23
  * @typeParam TParams The expected parameter shape (for TypeScript consumers).
24
24
  */
25
25
  export interface PortableTool<TParams = Record<string, unknown>> {
26
- /** Unique tool name (e.g. "think", "todo", "memory_query"). */
26
+ /** Unique tool name (e.g. "think", "todo", "memory"). */
27
27
  name: string;
28
28
  /** Human-readable label. */
29
29
  label: string;
@@ -49,6 +49,27 @@ export interface PortableTool<TParams = Record<string, unknown>> {
49
49
  * Read-only tools can skip confirmation prompts in strict permission modes.
50
50
  */
51
51
  isReadOnly?: boolean;
52
+ /**
53
+ * Whether the tool is currently available.
54
+ * CC parity: tools that return false are excluded from getTools().
55
+ * Default: true (always enabled).
56
+ */
57
+ isEnabled?: () => boolean;
58
+ /**
59
+ * Whether the tool performs destructive operations (delete, overwrite, etc.).
60
+ * CC parity: Tool.isDestructive field.
61
+ * Used by permission system to require confirmation.
62
+ */
63
+ isDestructive?: boolean;
64
+ /**
65
+ * Tool-specific permission check before execution.
66
+ * CC parity: Tool.checkPermissions — returns allow/deny with reason.
67
+ * Default (via buildTool): always allow, deferring to general permission system.
68
+ */
69
+ checkPermissions?: (params: TParams) => {
70
+ behavior: "allow" | "deny";
71
+ reason?: string;
72
+ };
52
73
  /**
53
74
  * Brief keyword hint for tool_search to match against
54
75
  * (e.g. "return the final response as structured JSON").
@@ -69,3 +90,15 @@ export interface PortableTool<TParams = Record<string, unknown>> {
69
90
  */
70
91
  execute(toolCallId: string, params: TParams, signal?: AbortSignal): Promise<PortableToolResult>;
71
92
  }
93
+ /**
94
+ * Build a complete PortableTool from a partial definition, filling safe defaults.
95
+ * CC parity: buildTool() factory in Tool.ts.
96
+ *
97
+ * Defaults (fail-closed where it matters):
98
+ * - isEnabled → true
99
+ * - isConcurrencySafe → false
100
+ * - isReadOnly → false
101
+ * - isDestructive → false
102
+ * - checkPermissions → { behavior: "allow" } (defer to general permission system)
103
+ */
104
+ export declare function buildTool<TParams = Record<string, unknown>>(partial: PortableTool<TParams>): PortableTool<TParams>;
@@ -1,63 +1,72 @@
1
- import type { TodoItem } from "../contracts/todo.js";
1
+ import type { TodoItemStatus } from "../contracts/todo.js";
2
2
  import type { PortableTool } from "./portable-tool.js";
3
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];
4
6
  export interface TodoToolParams {
5
- todoList: TodoItem[];
7
+ action: TodoAction;
8
+ id?: number;
9
+ title?: string;
10
+ description?: string;
11
+ status?: TodoItemStatus;
12
+ owner?: string;
13
+ addBlocks?: number[];
14
+ addBlockedBy?: number[];
6
15
  }
7
16
  export declare const TODO_TOOL_SCHEMA: {
8
17
  readonly type: "object";
9
18
  readonly properties: {
10
- readonly todoList: {
11
- readonly type: "array";
19
+ readonly action: {
20
+ readonly type: "string";
21
+ readonly enum: readonly ["create", "update", "delete", "list"];
12
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";
13
54
  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"];
55
+ readonly type: "number";
31
56
  };
57
+ readonly description: "[update] Task IDs that should block this task.";
32
58
  };
33
59
  };
34
- readonly required: readonly ["todoList"];
60
+ readonly required: readonly ["action"];
35
61
  };
36
62
  /**
37
- * Configuration for todo tool behavior (CC-aligned features).
63
+ * Configuration for todo tool behavior.
38
64
  */
39
65
  export interface TodoToolOptions {
40
- /**
41
- * Unique agent/session identifier for per-agent todo isolation.
42
- * When provided, different agents have independent todo lists.
43
- */
66
+ /** Unique agent/session identifier for per-agent todo isolation. */
44
67
  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
68
  }
57
69
  /**
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.
70
+ * Create a stateful todo tool instance (V2 — incremental CRUD).
62
71
  */
63
72
  export declare function createTodoTool(options?: TodoToolOptions): PortableTool<TodoToolParams>;
@@ -21,83 +21,45 @@ export interface InstructionsToolDeps {
21
21
  /** Remove an instruction file. Returns true if deleted. */
22
22
  remove(projectId: string, filename: string): boolean;
23
23
  }
24
- export declare const INSTRUCTIONS_LIST_TOOL_NAME: "instructions_list";
25
- export interface InstructionsListParams {
24
+ export declare const INSTRUCTIONS_TOOL_NAME: "instructions";
25
+ export type InstructionsAction = "list" | "read" | "write" | "edit" | "delete";
26
+ export interface InstructionsToolParams {
27
+ action: InstructionsAction;
26
28
  project_id: string;
29
+ filename?: string;
30
+ content?: string;
31
+ old_text?: string;
32
+ new_text?: string;
27
33
  }
28
- export declare const INSTRUCTIONS_LIST_SCHEMA: {
34
+ export declare const INSTRUCTIONS_TOOL_SCHEMA: {
29
35
  readonly type: "object";
30
36
  readonly properties: {
31
- readonly project_id: {
37
+ readonly action: {
32
38
  readonly type: "string";
33
- readonly description: "Project ID to list instructions for. Use \"default\" for the default project.";
39
+ readonly enum: readonly ["list", "read", "write", "edit", "delete"];
40
+ readonly description: "Operation: list all files, read a file, write (create/overwrite), edit (partial replace), or delete a file.";
34
41
  };
35
- };
36
- readonly required: readonly ["project_id"];
37
- };
38
- export declare function createInstructionsListTool(deps: InstructionsToolDeps): PortableTool<InstructionsListParams>;
39
- export declare const INSTRUCTIONS_READ_TOOL_NAME: "instructions_read";
40
- export interface InstructionsReadParams {
41
- project_id: string;
42
- filename: string;
43
- }
44
- export declare const INSTRUCTIONS_READ_SCHEMA: {
45
- readonly type: "object";
46
- readonly properties: {
47
42
  readonly project_id: {
48
43
  readonly type: "string";
49
44
  readonly description: "Project ID. Use \"default\" for the default project.";
50
45
  };
51
46
  readonly filename: {
52
47
  readonly type: "string";
53
- readonly description: "Instruction file name (e.g. \"code-style.md\"). Supports sub-paths like \"testing/unit-test.md\".";
54
- };
55
- };
56
- readonly required: readonly ["project_id", "filename"];
57
- };
58
- export declare function createInstructionsReadTool(deps: InstructionsToolDeps): PortableTool<InstructionsReadParams>;
59
- export declare const INSTRUCTIONS_WRITE_TOOL_NAME: "instructions_write";
60
- export interface InstructionsWriteParams {
61
- project_id: string;
62
- filename: string;
63
- content: string;
64
- }
65
- export declare const INSTRUCTIONS_WRITE_SCHEMA: {
66
- readonly type: "object";
67
- readonly properties: {
68
- readonly project_id: {
69
- readonly type: "string";
70
- readonly description: "Project ID. Use \"default\" for the default project.";
71
- };
72
- readonly filename: {
73
- readonly type: "string";
74
- readonly description: "Instruction file name ending in .md (e.g. \"code-style.md\"). Sub-paths like \"testing/unit-test.md\" are supported.";
48
+ readonly description: "Instruction file name ending in .md (e.g. \"code-style.md\"). Required for read/write/delete. Sub-paths like \"testing/unit-test.md\" are supported.";
75
49
  };
76
50
  readonly content: {
77
51
  readonly type: "string";
78
- readonly description: "Markdown content for the instruction file.";
52
+ readonly description: "Markdown content for the instruction file. Required for write action.";
79
53
  };
80
- };
81
- readonly required: readonly ["project_id", "filename", "content"];
82
- };
83
- export declare function createInstructionsWriteTool(deps: InstructionsToolDeps): PortableTool<InstructionsWriteParams>;
84
- export declare const INSTRUCTIONS_DELETE_TOOL_NAME: "instructions_delete";
85
- export interface InstructionsDeleteParams {
86
- project_id: string;
87
- filename: string;
88
- }
89
- export declare const INSTRUCTIONS_DELETE_SCHEMA: {
90
- readonly type: "object";
91
- readonly properties: {
92
- readonly project_id: {
54
+ readonly old_text: {
93
55
  readonly type: "string";
94
- readonly description: "Project ID. Use \"default\" for the default project.";
56
+ readonly description: "Required for edit action: the exact existing text to find and replace (must appear exactly once).";
95
57
  };
96
- readonly filename: {
58
+ readonly new_text: {
97
59
  readonly type: "string";
98
- readonly description: "Instruction file name to delete (e.g. \"code-style.md\").";
60
+ readonly description: "Required for edit action: the replacement text.";
99
61
  };
100
62
  };
101
- readonly required: readonly ["project_id", "filename"];
63
+ readonly required: readonly ["action", "project_id"];
102
64
  };
103
- export declare function createInstructionsDeleteTool(deps: InstructionsToolDeps): PortableTool<InstructionsDeleteParams>;
65
+ export declare function createInstructionsTool(deps: InstructionsToolDeps): PortableTool<InstructionsToolParams>;
@@ -14,6 +14,8 @@ export interface ExecOptions {
14
14
  shouldAutoBackground?: boolean;
15
15
  /** When provided, stdout is piped and this callback fires per chunk. */
16
16
  onStdout?: (data: string) => void;
17
+ /** Per-call CWD override. When set, spawn uses this instead of the session CWD. */
18
+ cwd?: string;
17
19
  }
18
20
  /**
19
21
  * Set the shell provider for this session.
@@ -1,5 +1,5 @@
1
1
  import type { PortableTool } from "../portable-tool.js";
2
- import type { WorkspaceSkill } from "../skill-types.js";
2
+ import type { WorkspaceSkill } from "../skill-system/skill-types.js";
3
3
  export declare const SKILL_TOOL_NAME: "skill_invoke";
4
4
  export interface SkillInvokeParams {
5
5
  skill: string;
@@ -35,7 +35,7 @@ export interface SkillToolDeps {
35
35
  * Execute the skill instructions as a sub-turn.
36
36
  * The implementation should:
37
37
  * 1. Build system prompt from SKILL.md content
38
- * 2. Run a sub-turn (sidechain) with skill instructions
38
+ * 2. Run a sub-turn (fork) with skill instructions
39
39
  * 3. Return the sub-turn's final response
40
40
  *
41
41
  * If not provided, the skill content is returned directly
@@ -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[];