qlogicagent 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +402 -402
- package/dist/agent.js +18 -0
- package/dist/cli.js +360 -0
- package/dist/contracts.js +1 -0
- package/dist/index.js +22 -0
- package/dist/orchestration.js +125 -0
- package/dist/types/agent/agent.d.ts +43 -0
- package/dist/types/agent/constants.d.ts +47 -0
- package/dist/types/agent/tool-loop.d.ts +96 -0
- package/dist/types/agent/types.d.ts +250 -0
- package/dist/types/cli/main.d.ts +11 -0
- package/dist/types/cli/stdio-server.d.ts +56 -0
- package/dist/types/cli/tool-bootstrap.d.ts +21 -0
- package/dist/types/config/config.d.ts +17 -0
- package/dist/types/contracts/hooks.d.ts +175 -0
- package/dist/types/contracts/index.d.ts +10 -0
- package/dist/types/contracts/planner.d.ts +35 -0
- package/dist/types/contracts/skill-candidate.d.ts +63 -0
- package/dist/types/contracts/todo.d.ts +14 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/llm/builtin-providers.d.ts +10 -0
- package/dist/types/llm/debug-transport.d.ts +12 -0
- package/dist/types/llm/index.d.ts +16 -0
- package/dist/types/llm/llm-client.d.ts +43 -0
- package/dist/types/llm/model-catalog.d.ts +53 -0
- package/dist/types/llm/provider-def.d.ts +59 -0
- package/dist/types/llm/provider-registry.d.ts +54 -0
- package/dist/types/llm/transport.d.ts +62 -0
- package/dist/types/llm/transports/anthropic-messages.d.ts +31 -0
- package/dist/types/llm/transports/openai-chat.d.ts +36 -0
- package/dist/types/orchestration/agent-registry.d.ts +46 -0
- package/dist/types/orchestration/context-collapse.d.ts +58 -0
- package/dist/types/orchestration/context-compression.d.ts +301 -0
- package/dist/types/orchestration/conversation-repair.d.ts +61 -0
- package/dist/types/orchestration/curator-scheduler.d.ts +119 -0
- package/dist/types/orchestration/error-classification.d.ts +12 -0
- package/dist/types/orchestration/failover-classification.d.ts +8 -0
- package/dist/types/orchestration/failover-error.d.ts +33 -0
- package/dist/types/orchestration/fork-subagent.d.ts +100 -0
- package/dist/types/orchestration/index.d.ts +113 -0
- package/dist/types/orchestration/memory-provider.d.ts +14 -0
- package/dist/types/orchestration/reactive-compact.d.ts +73 -0
- package/dist/types/orchestration/retry-loop.d.ts +69 -0
- package/dist/types/orchestration/skill-candidate.d.ts +52 -0
- package/dist/types/orchestration/skill-consolidation.d.ts +123 -0
- package/dist/types/orchestration/skill-improvement.d.ts +59 -0
- package/dist/types/orchestration/skill-similarity.d.ts +98 -0
- package/dist/types/orchestration/task-types.d.ts +142 -0
- package/dist/types/orchestration/team-orchestration.d.ts +195 -0
- package/dist/types/orchestration/team-tool-loop-wiring.d.ts +92 -0
- package/dist/types/orchestration/tool-choice-policy.d.ts +54 -0
- package/dist/types/orchestration/tool-loop-state.d.ts +50 -0
- package/dist/types/orchestration/tool-schema.d.ts +39 -0
- package/dist/types/orchestration/turn-loop-guard.d.ts +86 -0
- package/dist/types/runtime/execution/dream-agent.d.ts +199 -0
- package/dist/types/runtime/execution/forked-agent.d.ts +111 -0
- package/dist/types/runtime/execution/index.d.ts +6 -0
- package/dist/types/runtime/execution/progress-tracker.d.ts +78 -0
- package/dist/types/runtime/execution/remote-agent.d.ts +63 -0
- package/dist/types/runtime/execution/streaming-tool-executor.d.ts +100 -0
- package/dist/types/runtime/execution/tool-eligibility.d.ts +59 -0
- package/dist/types/runtime/execution/tool-result-storage.d.ts +87 -0
- package/dist/types/runtime/hooks/context-compression.d.ts +61 -0
- package/dist/types/runtime/hooks/hook-registry.d.ts +12 -0
- package/dist/types/runtime/hooks/index.d.ts +3 -0
- package/dist/types/runtime/hooks/memory-hooks.d.ts +49 -0
- package/dist/types/runtime/index.d.ts +5 -0
- package/dist/types/runtime/infra/cleanup-registry.d.ts +23 -0
- package/dist/types/runtime/infra/file-watcher.d.ts +72 -0
- package/dist/types/runtime/infra/index.d.ts +6 -0
- package/dist/types/runtime/infra/secure-storage.d.ts +81 -0
- package/dist/types/runtime/infra/task-runtime.d.ts +108 -0
- package/dist/types/runtime/infra/token-budget.d.ts +92 -0
- package/dist/types/runtime/infra/worktree-backend.d.ts +85 -0
- package/dist/types/runtime/prompt/environment-context.d.ts +23 -0
- package/dist/types/runtime/prompt/index.d.ts +3 -0
- package/dist/types/runtime/prompt/instruction-loader.d.ts +64 -0
- package/dist/types/runtime/prompt/system-prompt-sections.d.ts +63 -0
- package/dist/types/runtime/session/index.d.ts +2 -0
- package/dist/types/runtime/session/session-memory.d.ts +91 -0
- package/dist/types/runtime/session/session-persistence.d.ts +94 -0
- package/dist/types/runtime/session/session-state.d.ts +117 -0
- package/dist/types/skills/index.d.ts +125 -0
- package/dist/types/skills/mcp/index.d.ts +3 -0
- package/dist/types/skills/mcp/mcp-http-client.d.ts +66 -0
- package/dist/types/skills/mcp/mcp-manager.d.ts +84 -0
- package/dist/types/skills/mcp/mcp-stdio-client.d.ts +84 -0
- package/dist/types/skills/memory-extractor.d.ts +64 -0
- package/dist/types/skills/memory-query-tool.d.ts +43 -0
- package/dist/types/skills/memory-store.d.ts +66 -0
- package/dist/types/skills/memory-tool.d.ts +67 -0
- package/dist/types/skills/permissions/bash-classifier.d.ts +30 -0
- package/dist/types/skills/permissions/classifier-cache.d.ts +51 -0
- package/dist/types/skills/permissions/denial-tracking.d.ts +42 -0
- package/dist/types/skills/permissions/hook-runner.d.ts +85 -0
- package/dist/types/skills/permissions/index.d.ts +12 -0
- package/dist/types/skills/permissions/permission-classifier.d.ts +41 -0
- package/dist/types/skills/permissions/rule-engine.d.ts +41 -0
- package/dist/types/skills/permissions/settings-watcher.d.ts +46 -0
- package/dist/types/skills/permissions/types.d.ts +113 -0
- package/dist/types/skills/plugins/index.d.ts +2 -0
- package/dist/types/skills/plugins/plugin-api.d.ts +38 -0
- package/dist/types/skills/plugins/plugin-loader.d.ts +45 -0
- package/dist/types/skills/plugins/plugin-marketplace.d.ts +61 -0
- package/dist/types/skills/portable-tool.d.ts +71 -0
- package/dist/types/skills/qmemory-adapter.d.ts +42 -0
- package/dist/types/skills/skill-frontmatter.d.ts +19 -0
- package/dist/types/skills/skill-guard.d.ts +23 -0
- package/dist/types/skills/skill-loader.d.ts +16 -0
- package/dist/types/skills/skill-source.d.ts +119 -0
- package/dist/types/skills/skill-types.d.ts +199 -0
- package/dist/types/skills/think-tool.d.ts +16 -0
- package/dist/types/skills/todo-tool.d.ts +63 -0
- package/dist/types/skills/tool-registry.d.ts +29 -0
- package/dist/types/skills/tools/agent-tool.d.ts +91 -0
- package/dist/types/skills/tools/apply-patch-tool.d.ts +29 -0
- package/dist/types/skills/tools/ask-user-tool.d.ts +80 -0
- package/dist/types/skills/tools/brief-tool.d.ts +74 -0
- package/dist/types/skills/tools/browser-tool.d.ts +114 -0
- package/dist/types/skills/tools/checkpoint-tool.d.ts +66 -0
- package/dist/types/skills/tools/config-tool.d.ts +63 -0
- package/dist/types/skills/tools/cron-tool.d.ts +116 -0
- package/dist/types/skills/tools/edit-tool.d.ts +43 -0
- package/dist/types/skills/tools/exec-tool.d.ts +97 -0
- package/dist/types/skills/tools/image-generate-tool.d.ts +62 -0
- package/dist/types/skills/tools/instructions-tool.d.ts +103 -0
- package/dist/types/skills/tools/lsp-tool.d.ts +153 -0
- package/dist/types/skills/tools/mcp-client-types.d.ts +269 -0
- package/dist/types/skills/tools/mcp-resource-tools.d.ts +14 -0
- package/dist/types/skills/tools/mcp-tool.d.ts +249 -0
- package/dist/types/skills/tools/memory-tool.d.ts +74 -0
- package/dist/types/skills/tools/monitor-tool.d.ts +113 -0
- package/dist/types/skills/tools/music-generate-tool.d.ts +55 -0
- package/dist/types/skills/tools/notebook-edit-tool.d.ts +15 -0
- package/dist/types/skills/tools/notify-tool.d.ts +53 -0
- package/dist/types/skills/tools/patch-tool.d.ts +45 -0
- package/dist/types/skills/tools/pdf-tool.d.ts +66 -0
- package/dist/types/skills/tools/plan-mode-tool.d.ts +98 -0
- package/dist/types/skills/tools/read-tool.d.ts +51 -0
- package/dist/types/skills/tools/repl-tool.d.ts +70 -0
- package/dist/types/skills/tools/search-tool.d.ts +112 -0
- package/dist/types/skills/tools/send-message-tool.d.ts +51 -0
- package/dist/types/skills/tools/shell/bash-provider.d.ts +26 -0
- package/dist/types/skills/tools/shell/command-classification.d.ts +44 -0
- package/dist/types/skills/tools/shell/command-semantics.d.ts +14 -0
- package/dist/types/skills/tools/shell/destructive-command-warning.d.ts +10 -0
- package/dist/types/skills/tools/shell/exec-permissions.d.ts +52 -0
- package/dist/types/skills/tools/shell/index.d.ts +17 -0
- package/dist/types/skills/tools/shell/powershell-provider.d.ts +15 -0
- package/dist/types/skills/tools/shell/shell-command.d.ts +54 -0
- package/dist/types/skills/tools/shell/shell-exec.d.ts +33 -0
- package/dist/types/skills/tools/shell/shell-provider.d.ts +85 -0
- package/dist/types/skills/tools/shell/task-output.d.ts +45 -0
- package/dist/types/skills/tools/skill-invoke-tool.d.ts +46 -0
- package/dist/types/skills/tools/skill-list-tool.d.ts +33 -0
- package/dist/types/skills/tools/skill-manage-tool.d.ts +73 -0
- package/dist/types/skills/tools/skill-view-tool.d.ts +37 -0
- package/dist/types/skills/tools/sleep-tool.d.ts +49 -0
- package/dist/types/skills/tools/structured-output-tool.d.ts +116 -0
- package/dist/types/skills/tools/task-tool.d.ts +104 -0
- package/dist/types/skills/tools/team-tool.d.ts +89 -0
- package/dist/types/skills/tools/tool-search-tool.d.ts +51 -0
- package/dist/types/skills/tools/tts-tool.d.ts +38 -0
- package/dist/types/skills/tools/video-edit-tool.d.ts +69 -0
- package/dist/types/skills/tools/video-generate-tool.d.ts +62 -0
- package/dist/types/skills/tools/video-merge-tool.d.ts +105 -0
- package/dist/types/skills/tools/video-upscale-tool.d.ts +45 -0
- package/dist/types/skills/tools/web-fetch-tool.d.ts +78 -0
- package/dist/types/skills/tools/web-search-tool.d.ts +57 -0
- package/dist/types/skills/tools/workflow-tool.d.ts +44 -0
- package/dist/types/skills/tools/worktree-tool.d.ts +69 -0
- package/dist/types/skills/tools/write-tool.d.ts +45 -0
- package/package.json +3 -2
|
@@ -0,0 +1,125 @@
|
|
|
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";
|
|
11
|
+
export { THINK_TOOL_NAME, THINK_TOOL_SCHEMA, createThinkTool } from "./think-tool.js";
|
|
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";
|
|
17
|
+
export { READ_TOOL_NAME, READ_TOOL_SCHEMA, createReadTool } from "./tools/read-tool.js";
|
|
18
|
+
export type { ReadToolParams, ReadToolDeps, ReadResultType } from "./tools/read-tool.js";
|
|
19
|
+
export { WRITE_TOOL_NAME, WRITE_TOOL_SCHEMA, createWriteTool } from "./tools/write-tool.js";
|
|
20
|
+
export type { WriteToolParams, WriteToolDeps } from "./tools/write-tool.js";
|
|
21
|
+
export { EDIT_TOOL_NAME, EDIT_TOOL_SCHEMA, createEditTool } from "./tools/edit-tool.js";
|
|
22
|
+
export type { EditToolParams, EditToolDeps } from "./tools/edit-tool.js";
|
|
23
|
+
export { APPLY_PATCH_TOOL_NAME, APPLY_PATCH_TOOL_SCHEMA, createApplyPatchTool } from "./tools/apply-patch-tool.js";
|
|
24
|
+
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
|
+
export { EXEC_TOOL_NAME, EXEC_TOOL_SCHEMA, createExecTool, ASSISTANT_BLOCKING_BUDGET_MS } from "./tools/exec-tool.js";
|
|
28
|
+
export type { ExecToolParams, ExecToolHost, ExecProgress, ExecToolOutput } from "./tools/exec-tool.js";
|
|
29
|
+
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";
|
|
30
|
+
export type { ShellType, ShellProvider, BuildCommandOpts, BuiltCommand, BashProviderOptions, CommandClassification, ProgressCallback, ExecResult, ShellCommand, ExecOptions, } from "./tools/shell/index.js";
|
|
31
|
+
export { SEARCH_TOOL_NAME, SEARCH_TOOL_SCHEMA, createSearchTool } from "./tools/search-tool.js";
|
|
32
|
+
export type { SearchToolParams, SearchToolDeps, SearchMode, SearchOutput, SearchFileResult, SearchContentResult, } from "./tools/search-tool.js";
|
|
33
|
+
export { IMAGE_GENERATE_TOOL_NAME, IMAGE_GENERATE_TOOL_SCHEMA, createImageGenerateTool } from "./tools/image-generate-tool.js";
|
|
34
|
+
export type { ImageGenerateToolParams, ImageGenerateToolDeps, ImageGenerateResult } from "./tools/image-generate-tool.js";
|
|
35
|
+
export { VIDEO_GENERATE_TOOL_NAME, VIDEO_GENERATE_TOOL_SCHEMA, createVideoGenerateTool } from "./tools/video-generate-tool.js";
|
|
36
|
+
export type { VideoGenerateToolParams, VideoGenerateToolDeps, VideoGenerateResult } from "./tools/video-generate-tool.js";
|
|
37
|
+
export { VIDEO_MERGE_TOOL_NAME, VIDEO_MERGE_TOOL_SCHEMA, createVideoMergeTool } from "./tools/video-merge-tool.js";
|
|
38
|
+
export type { VideoMergeToolParams, VideoMergeToolDeps, VideoMergeClip, VideoMergeResult } from "./tools/video-merge-tool.js";
|
|
39
|
+
export { VIDEO_UPSCALE_TOOL_NAME, VIDEO_UPSCALE_TOOL_SCHEMA, createVideoUpscaleTool } from "./tools/video-upscale-tool.js";
|
|
40
|
+
export type { VideoUpscaleToolParams, VideoUpscaleToolDeps, VideoUpscaleResult } from "./tools/video-upscale-tool.js";
|
|
41
|
+
export { VIDEO_EDIT_TOOL_NAME, VIDEO_EDIT_TOOL_SCHEMA, createVideoEditTool } from "./tools/video-edit-tool.js";
|
|
42
|
+
export type { VideoEditToolParams, VideoEditToolDeps, VideoEditResult } from "./tools/video-edit-tool.js";
|
|
43
|
+
export { MUSIC_GENERATE_TOOL_NAME, MUSIC_GENERATE_TOOL_SCHEMA, createMusicGenerateTool } from "./tools/music-generate-tool.js";
|
|
44
|
+
export type { MusicGenerateToolParams, MusicGenerateToolDeps, MusicGenerateResult } from "./tools/music-generate-tool.js";
|
|
45
|
+
export { TTS_TOOL_NAME, TTS_TOOL_SCHEMA, createTtsTool } from "./tools/tts-tool.js";
|
|
46
|
+
export type { TtsToolParams, TtsToolDeps, TtsResult } from "./tools/tts-tool.js";
|
|
47
|
+
export { WEB_FETCH_TOOL_NAME, WEB_FETCH_TOOL_SCHEMA, createWebFetchTool } from "./tools/web-fetch-tool.js";
|
|
48
|
+
export type { WebFetchToolParams, WebFetchToolDeps, WebFetchResult } from "./tools/web-fetch-tool.js";
|
|
49
|
+
export { WEB_SEARCH_TOOL_NAME, WEB_SEARCH_TOOL_SCHEMA, createWebSearchTool } from "./tools/web-search-tool.js";
|
|
50
|
+
export type { WebSearchToolParams, WebSearchToolDeps, WebSearchResult, WebSearchOutput } from "./tools/web-search-tool.js";
|
|
51
|
+
export { ASK_USER_TOOL_NAME, ASK_USER_TOOL_SCHEMA, createAskUserTool } from "./tools/ask-user-tool.js";
|
|
52
|
+
export type { AskUserToolParams, AskUserToolDeps, AskUserQuestion, AskUserOption, AskUserAnswer } from "./tools/ask-user-tool.js";
|
|
53
|
+
export { BRIEF_TOOL_NAME, BRIEF_TOOL_SCHEMA, createBriefTool } from "./tools/brief-tool.js";
|
|
54
|
+
export type { BriefToolParams, BriefToolDeps, BriefMessageStatus, BriefAttachment, BriefDeliveryResult, BriefModeConfig, } from "./tools/brief-tool.js";
|
|
55
|
+
export { TOOL_SEARCH_TOOL_NAME, TOOL_SEARCH_TOOL_SCHEMA, createToolSearchTool } from "./tools/tool-search-tool.js";
|
|
56
|
+
export type { ToolSearchToolParams, ToolSearchToolDeps, DeferredToolInfo, ToolSearchOutput } from "./tools/tool-search-tool.js";
|
|
57
|
+
export { SKILL_LIST_TOOL_NAME, SKILL_LIST_TOOL_SCHEMA, createSkillListTool } from "./tools/skill-list-tool.js";
|
|
58
|
+
export type { SkillListToolParams, SkillListToolDeps, SkillListItem, SkillListOutput } from "./tools/skill-list-tool.js";
|
|
59
|
+
export { SKILL_VIEW_TOOL_NAME, SKILL_VIEW_TOOL_SCHEMA, createSkillViewTool } from "./tools/skill-view-tool.js";
|
|
60
|
+
export type { SkillViewToolParams, SkillViewToolDeps, SkillViewOutput } from "./tools/skill-view-tool.js";
|
|
61
|
+
export { SKILL_MANAGE_TOOL_NAME, SKILL_MANAGE_TOOL_SCHEMA, createSkillManageTool } from "./tools/skill-manage-tool.js";
|
|
62
|
+
export type { SkillManageToolParams, SkillManageToolDeps, SkillManageResult, SkillManageAction } from "./tools/skill-manage-tool.js";
|
|
63
|
+
export { PATCH_TOOL_NAME, PATCH_TOOL_SCHEMA, createPatchTool, fuzzyFind } from "./tools/patch-tool.js";
|
|
64
|
+
export type { PatchToolParams, PatchToolDeps, PatchResult, MatchStrategy, MatchResult } from "./tools/patch-tool.js";
|
|
65
|
+
export { AGENT_TOOL_NAME, AGENT_TOOL_SCHEMA, createAgentTool } from "./tools/agent-tool.js";
|
|
66
|
+
export type { AgentToolParams, AgentToolDeps, AgentResult } from "./tools/agent-tool.js";
|
|
67
|
+
export { TASK_TOOL_NAME, TASK_TOOL_SCHEMA, createTaskTool } from "./tools/task-tool.js";
|
|
68
|
+
export type { TaskToolParams, TaskToolDeps, TaskInfo, TaskResult, TaskAction, TaskStatus } from "./tools/task-tool.js";
|
|
69
|
+
export { REPL_TOOL_NAME, REPL_TOOL_SCHEMA, REPL_HIDES_TOOLS, createReplTool } from "./tools/repl-tool.js";
|
|
70
|
+
export type { ReplToolParams, ReplToolDeps, ReplPrimitives, ReplExecResult } from "./tools/repl-tool.js";
|
|
71
|
+
export { BROWSER_TOOL_NAME, BROWSER_TOOL_SCHEMA, createBrowserTool } from "./tools/browser-tool.js";
|
|
72
|
+
export type { BrowserToolParams, BrowserToolDeps, BrowserAction, BrowserSnapshot, BrowserScreenshot } from "./tools/browser-tool.js";
|
|
73
|
+
export { CRON_TOOL_NAME, CRON_TOOL_SCHEMA, MAX_CRON_JOBS, createCronTool } from "./tools/cron-tool.js";
|
|
74
|
+
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
|
+
export { CHECKPOINT_TOOL_NAME, CHECKPOINT_TOOL_SCHEMA, createCheckpointTool } from "./tools/checkpoint-tool.js";
|
|
78
|
+
export type { CheckpointToolParams, CheckpointToolDeps, Checkpoint, CheckpointResult, CheckpointAction } from "./tools/checkpoint-tool.js";
|
|
79
|
+
export { NOTIFY_TOOL_NAME, NOTIFY_TOOL_SCHEMA, createNotifyTool } from "./tools/notify-tool.js";
|
|
80
|
+
export type { NotifyToolParams, NotifyToolDeps, NotifyResult } from "./tools/notify-tool.js";
|
|
81
|
+
export { SEND_MESSAGE_TOOL_NAME, SEND_MESSAGE_TOOL_SCHEMA, createSendMessageTool } from "./tools/send-message-tool.js";
|
|
82
|
+
export type { SendMessageToolParams, SendMessageToolDeps, SendMessageResult } from "./tools/send-message-tool.js";
|
|
83
|
+
export { TEAM_TOOL_NAME, TEAM_TOOL_SCHEMA, createTeamTool } from "./tools/team-tool.js";
|
|
84
|
+
export type { TeamToolParams, TeamToolDeps, TeamMember, Team, TeamResult, TeamAction } from "./tools/team-tool.js";
|
|
85
|
+
export { LSP_TOOL_NAME, LSP_TOOL_SCHEMA, createLspTool } from "./tools/lsp-tool.js";
|
|
86
|
+
export type { LspToolParams, LspToolDeps, LspOperation, LspLocation, LspSymbol, LspDiagnostic, LspHoverInfo, LspCompletion, LspRenameEdit, LspCodeAction, LspResult } from "./tools/lsp-tool.js";
|
|
87
|
+
export { PLAN_MODE_TOOL_NAME, PLAN_MODE_TOOL_SCHEMA, PLAN_MODE_ALLOWED_TOOLS, createPlanModeTool } from "./tools/plan-mode-tool.js";
|
|
88
|
+
export type { PlanModeToolParams, PlanModeToolDeps, PlanModeAction, PlanModeState, PlanModeResult } from "./tools/plan-mode-tool.js";
|
|
89
|
+
export { WORKTREE_TOOL_NAME, WORKTREE_TOOL_SCHEMA, createWorktreeTool } from "./tools/worktree-tool.js";
|
|
90
|
+
export type { WorktreeToolParams, WorktreeToolDeps, WorktreeAction, WorktreeInfo, WorktreeResult } from "./tools/worktree-tool.js";
|
|
91
|
+
export { MCP_TOOL_NAME, MCP_TOOL_SCHEMA, createMcpTool, createMcpAuthProxy } from "./tools/mcp-tool.js";
|
|
92
|
+
export { normalizeNameForMcp, buildMcpToolName, getMcpServerPrefix, parseMcpToolName, isMcpToolName, MCP_CONNECTION_TIMEOUT_MS, MCP_REQUEST_TIMEOUT_MS, MCP_TOOL_CALL_TIMEOUT_MS, MCP_MAX_RECONNECT_ATTEMPTS, MCP_MAX_DESCRIPTION_LENGTH, } from "./tools/mcp-tool.js";
|
|
93
|
+
export type { McpToolParams, McpToolDeps, McpAction, McpManageAction, McpServer, McpToolInfo, McpResource, McpResourceContent, McpCallResult, McpAuthResult, McpPromptResult, McpManageResult, McpAuthProxyDeps, McpServerConfig, McpStdioConfig, McpSseConfig, McpHttpConfig, McpWsConfig, McpInProcessConfig, McpServerState, McpConnectionStatus, McpServerCapabilities, McpExternalTool, McpToolAnnotations, McpToolIdentifier, McpToolsChangedEvent, McpResourceDefinition, McpResourceTemplate, McpPersistedResourceContent, McpPromptDefinition, McpPromptMessage, McpPromptArgument, McpPromptContent, McpElicitResult, McpElicitRequest, McpOAuthConfig, McpOAuthTokens, McpAuthState, McpLogEntry, McpLogLevel, McpTransportType, } from "./tools/mcp-tool.js";
|
|
94
|
+
export type { McpResourceContentItem, } from "./tools/mcp-client-types.js";
|
|
95
|
+
export { CONFIG_TOOL_NAME, CONFIG_TOOL_SCHEMA, CONFIG_READONLY_KEYS, createConfigTool } from "./tools/config-tool.js";
|
|
96
|
+
export type { ConfigToolParams, ConfigToolDeps, ConfigAction, ConfigSetting, ConfigResult } from "./tools/config-tool.js";
|
|
97
|
+
export { SLEEP_TOOL_NAME, SLEEP_TOOL_SCHEMA, createSleepTool } from "./tools/sleep-tool.js";
|
|
98
|
+
export type { SleepToolParams, SleepToolDeps, SleepResult } from "./tools/sleep-tool.js";
|
|
99
|
+
export { MONITOR_TOOL_NAME, MONITOR_TOOL_SCHEMA, createMonitorTool } from "./tools/monitor-tool.js";
|
|
100
|
+
export type { MonitorToolParams, MonitorToolDeps, MonitorSource, MonitorAction, MonitorCondition, MonitorInfo, MonitorResult, } from "./tools/monitor-tool.js";
|
|
101
|
+
export { STRUCTURED_OUTPUT_TOOL_NAME, STRUCTURED_OUTPUT_TOOL_SCHEMA, STRUCTURED_OUTPUT_MAX_CHARS, createStructuredOutputTool, createConfiguredStructuredOutputTool, isStructuredOutputEnabled, } from "./tools/structured-output-tool.js";
|
|
102
|
+
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";
|
|
112
|
+
export { SKILL_TOOL_NAME, SKILL_INVOKE_SCHEMA, createSkillTool } from "./tools/skill-invoke-tool.js";
|
|
113
|
+
export type { SkillInvokeParams, SkillToolDeps } from "./tools/skill-invoke-tool.js";
|
|
114
|
+
export { McpStdioClient } from "./mcp/mcp-stdio-client.js";
|
|
115
|
+
export { McpManager, parseMcpConfig } from "./mcp/mcp-manager.js";
|
|
116
|
+
export type { McpServerEntry, McpManagerConfig } from "./mcp/mcp-manager.js";
|
|
117
|
+
export { PluginLoader } from "./plugins/plugin-loader.js";
|
|
118
|
+
export { PLUGIN_HOOK_MAP } from "./plugins/plugin-api.js";
|
|
119
|
+
export type { PluginApi, PluginModule, PluginHookPhase } from "./plugins/plugin-api.js";
|
|
120
|
+
export type { PluginLoaderConfig } from "./plugins/plugin-loader.js";
|
|
121
|
+
export type { LoadedPlugin } from "./plugins/plugin-api.js";
|
|
122
|
+
export { PermissionRuleEngine, parsePermissionConfig } from "./permissions/rule-engine.js";
|
|
123
|
+
export { PermissionChecker } from "./permissions/hook-runner.js";
|
|
124
|
+
export type { PermissionCheckerDeps } from "./permissions/hook-runner.js";
|
|
125
|
+
export type { PermissionMode, PermissionBehavior, PermissionResult, PermissionRuleEntry, PermissionConfig, PermissionUpdate, PermissionDecisionReason, ToolPermissionCheckInput, ApprovalRequest, ApprovalResponse, } from "./permissions/types.js";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
interface McpToolSchema {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
inputSchema?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
interface McpToolCallResult {
|
|
8
|
+
content: Array<{
|
|
9
|
+
type: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
data?: string;
|
|
12
|
+
mimeType?: string;
|
|
13
|
+
}>;
|
|
14
|
+
isError?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface McpHttpClientConfig {
|
|
17
|
+
/** Unique name for this MCP server instance */
|
|
18
|
+
name: string;
|
|
19
|
+
/** HTTP endpoint URL (e.g. "http://localhost:3000/mcp") */
|
|
20
|
+
url: string;
|
|
21
|
+
/** Extra headers for every request */
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
/** Timeout for initialization handshake (ms, default: 30000) */
|
|
24
|
+
initTimeoutMs?: number;
|
|
25
|
+
/** Timeout for tool calls (ms, default: 120000) */
|
|
26
|
+
toolCallTimeoutMs?: number;
|
|
27
|
+
}
|
|
28
|
+
export declare class McpHttpClient {
|
|
29
|
+
private connected;
|
|
30
|
+
private toolsCache;
|
|
31
|
+
private serverName;
|
|
32
|
+
private serverVersion;
|
|
33
|
+
private sessionId;
|
|
34
|
+
private onToolsChanged;
|
|
35
|
+
readonly config: McpHttpClientConfig;
|
|
36
|
+
constructor(config: McpHttpClientConfig);
|
|
37
|
+
connect(): Promise<void>;
|
|
38
|
+
disconnect(): Promise<void>;
|
|
39
|
+
callTool(toolName: string, args?: Record<string, unknown>, signal?: AbortSignal): Promise<McpToolCallResult>;
|
|
40
|
+
listResources(): Promise<Array<{
|
|
41
|
+
uri: string;
|
|
42
|
+
name: string;
|
|
43
|
+
mimeType?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
}>>;
|
|
46
|
+
readResource(uri: string): Promise<Array<{
|
|
47
|
+
uri: string;
|
|
48
|
+
mimeType?: string;
|
|
49
|
+
text?: string;
|
|
50
|
+
blob?: string;
|
|
51
|
+
}>>;
|
|
52
|
+
toPortableTools(): PortableTool[];
|
|
53
|
+
getCachedTools(): McpToolSchema[];
|
|
54
|
+
get isConnected(): boolean;
|
|
55
|
+
get info(): {
|
|
56
|
+
name: string;
|
|
57
|
+
version: string;
|
|
58
|
+
};
|
|
59
|
+
setOnToolsChanged(callback: () => void): void;
|
|
60
|
+
private refreshTools;
|
|
61
|
+
private sendRequest;
|
|
62
|
+
private sendNotification;
|
|
63
|
+
private parseSSEResponse;
|
|
64
|
+
private schemaToPortableTool;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ToolRegistry } from "../tool-registry.js";
|
|
2
|
+
/** MCP resource entry from resources/list */
|
|
3
|
+
export interface McpResourceEntry {
|
|
4
|
+
uri: string;
|
|
5
|
+
name: string;
|
|
6
|
+
mimeType?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
/** MCP resource content from resources/read */
|
|
10
|
+
export interface McpResourceContent {
|
|
11
|
+
uri: string;
|
|
12
|
+
mimeType?: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
blob?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface McpServerEntry {
|
|
17
|
+
/** Server display name */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Transport type: "stdio" (default) or "http" */
|
|
20
|
+
type?: "stdio" | "http";
|
|
21
|
+
/** Command to spawn (stdio only) */
|
|
22
|
+
command?: string;
|
|
23
|
+
/** Command arguments (stdio only) */
|
|
24
|
+
args?: string[];
|
|
25
|
+
/** Extra environment variables (stdio only) */
|
|
26
|
+
env?: Record<string, string>;
|
|
27
|
+
/** HTTP endpoint URL (http only) */
|
|
28
|
+
url?: string;
|
|
29
|
+
/** Extra HTTP headers (http only) */
|
|
30
|
+
headers?: Record<string, string>;
|
|
31
|
+
/** Init timeout (ms) */
|
|
32
|
+
initTimeoutMs?: number;
|
|
33
|
+
/** Whether this server is disabled (skip connection) */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface McpManagerConfig {
|
|
37
|
+
servers: McpServerEntry[];
|
|
38
|
+
log?: {
|
|
39
|
+
info(msg: string): void;
|
|
40
|
+
warn(msg: string): void;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export declare class McpManager {
|
|
44
|
+
private clients;
|
|
45
|
+
private registry;
|
|
46
|
+
private log;
|
|
47
|
+
constructor(config: McpManagerConfig);
|
|
48
|
+
/**
|
|
49
|
+
* Connect to all configured MCP servers. Failures are logged but don't block.
|
|
50
|
+
*/
|
|
51
|
+
connectAll(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Register all MCP tools into the given ToolRegistry.
|
|
54
|
+
*/
|
|
55
|
+
injectTools(registry: ToolRegistry): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get names of all connected servers.
|
|
58
|
+
*/
|
|
59
|
+
getConnectedServers(): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Get total number of MCP tools across all servers.
|
|
62
|
+
*/
|
|
63
|
+
getToolCount(): number;
|
|
64
|
+
/**
|
|
65
|
+
* Disconnect all MCP servers.
|
|
66
|
+
*/
|
|
67
|
+
disconnectAll(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* List resources from all connected MCP servers (or a specific one).
|
|
70
|
+
*/
|
|
71
|
+
listResources(serverName?: string): Promise<Array<McpResourceEntry & {
|
|
72
|
+
server: string;
|
|
73
|
+
}>>;
|
|
74
|
+
/**
|
|
75
|
+
* Read a resource from a specific MCP server by URI.
|
|
76
|
+
*/
|
|
77
|
+
readResource(serverName: string, uri: string): Promise<McpResourceContent[]>;
|
|
78
|
+
private reinjectTools;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Parse MCP server configs from a JSON structure (mcp.json format).
|
|
82
|
+
* Compatible with Claude Code's mcp_servers.json structure.
|
|
83
|
+
*/
|
|
84
|
+
export declare function parseMcpConfig(json: unknown): McpServerEntry[];
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
interface McpToolSchema {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
inputSchema?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
interface McpToolCallResult {
|
|
8
|
+
content: Array<{
|
|
9
|
+
type: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
data?: string;
|
|
12
|
+
mimeType?: string;
|
|
13
|
+
}>;
|
|
14
|
+
isError?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface McpStdioClientConfig {
|
|
17
|
+
/** Unique name for this MCP server instance */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Command to spawn (e.g. "npx", "uvx", "node") */
|
|
20
|
+
command: string;
|
|
21
|
+
/** Arguments to pass to the command */
|
|
22
|
+
args?: string[];
|
|
23
|
+
/** Environment variables (merged with process.env) */
|
|
24
|
+
env?: Record<string, string>;
|
|
25
|
+
/** Working directory for the subprocess */
|
|
26
|
+
cwd?: string;
|
|
27
|
+
/** Timeout for initialization handshake (ms, default: 30000) */
|
|
28
|
+
initTimeoutMs?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare class McpStdioClient {
|
|
31
|
+
private process;
|
|
32
|
+
private readline;
|
|
33
|
+
private pending;
|
|
34
|
+
private nextId;
|
|
35
|
+
private connected;
|
|
36
|
+
private toolsCache;
|
|
37
|
+
private serverName;
|
|
38
|
+
private serverVersion;
|
|
39
|
+
private supportsToolsListChanged;
|
|
40
|
+
private onToolsChanged;
|
|
41
|
+
private stderrBuffer;
|
|
42
|
+
readonly config: McpStdioClientConfig;
|
|
43
|
+
constructor(config: McpStdioClientConfig);
|
|
44
|
+
connect(): Promise<void>;
|
|
45
|
+
disconnect(): Promise<void>;
|
|
46
|
+
get isConnected(): boolean;
|
|
47
|
+
get info(): {
|
|
48
|
+
name: string;
|
|
49
|
+
version: string;
|
|
50
|
+
};
|
|
51
|
+
refreshTools(): Promise<McpToolSchema[]>;
|
|
52
|
+
getCachedTools(): McpToolSchema[];
|
|
53
|
+
callTool(toolName: string, args?: Record<string, unknown>, signal?: AbortSignal): Promise<McpToolCallResult>;
|
|
54
|
+
listResources(): Promise<Array<{
|
|
55
|
+
uri: string;
|
|
56
|
+
name: string;
|
|
57
|
+
mimeType?: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
}>>;
|
|
60
|
+
readResource(uri: string): Promise<Array<{
|
|
61
|
+
uri: string;
|
|
62
|
+
mimeType?: string;
|
|
63
|
+
text?: string;
|
|
64
|
+
blob?: string;
|
|
65
|
+
}>>;
|
|
66
|
+
/**
|
|
67
|
+
* Convert MCP tools to PortableTool instances for ToolRegistry.
|
|
68
|
+
* Tool names are prefixed: mcp__{serverName}__{toolName}
|
|
69
|
+
*/
|
|
70
|
+
toPortableTools(): PortableTool[];
|
|
71
|
+
/**
|
|
72
|
+
* Register callback for tools/list_changed notifications.
|
|
73
|
+
*/
|
|
74
|
+
setOnToolsChanged(callback: (() => void) | null): void;
|
|
75
|
+
private executeAsTool;
|
|
76
|
+
private sendRequest;
|
|
77
|
+
private sendNotification;
|
|
78
|
+
private writeLine;
|
|
79
|
+
private handleLine;
|
|
80
|
+
private handleNotification;
|
|
81
|
+
private handleProcessError;
|
|
82
|
+
private handleProcessExit;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface ExtractedMemory {
|
|
2
|
+
text: string;
|
|
3
|
+
category: string;
|
|
4
|
+
importance: number;
|
|
5
|
+
speaker: string;
|
|
6
|
+
event_date?: string;
|
|
7
|
+
tags?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface ProfileUpdate {
|
|
10
|
+
category: string;
|
|
11
|
+
key: string;
|
|
12
|
+
value: string;
|
|
13
|
+
confidence: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ExtractionResult {
|
|
16
|
+
memories: ExtractedMemory[];
|
|
17
|
+
profileUpdates: ProfileUpdate[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Generic OpenAI-compatible chat completion function.
|
|
21
|
+
* Consumer provides the actual HTTP transport (e.g. admin/new-api fetch).
|
|
22
|
+
*/
|
|
23
|
+
export type ExtractionCompleteFn = (params: {
|
|
24
|
+
model: string;
|
|
25
|
+
messages: Array<{
|
|
26
|
+
role: string;
|
|
27
|
+
content: string;
|
|
28
|
+
}>;
|
|
29
|
+
tools: unknown[];
|
|
30
|
+
tool_choice: unknown;
|
|
31
|
+
temperature?: number;
|
|
32
|
+
max_tokens?: number;
|
|
33
|
+
}) => Promise<{
|
|
34
|
+
choices?: Array<{
|
|
35
|
+
message?: {
|
|
36
|
+
tool_calls?: Array<{
|
|
37
|
+
function?: {
|
|
38
|
+
name?: string;
|
|
39
|
+
arguments?: string;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
content?: string;
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
}>;
|
|
46
|
+
export interface MemoryExtractorOptions {
|
|
47
|
+
/** Model to use for extraction (default: "deepseek-chat"). */
|
|
48
|
+
model?: string;
|
|
49
|
+
/** Timeout in ms for the LLM call (default: 30_000). */
|
|
50
|
+
timeoutMs?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a memory extractor backed by an OpenAI-compatible LLM endpoint.
|
|
54
|
+
*
|
|
55
|
+
* The `complete` function is injected by the consumer so that
|
|
56
|
+
* skills layer stays transport-agnostic (no admin/new-api dependency).
|
|
57
|
+
*/
|
|
58
|
+
export declare function createMemoryExtractor(complete: ExtractionCompleteFn, options?: MemoryExtractorOptions): {
|
|
59
|
+
/**
|
|
60
|
+
* Extract structured memories from a conversation fragment.
|
|
61
|
+
* Returns empty result if text is too short or LLM call fails.
|
|
62
|
+
*/
|
|
63
|
+
extract(conversationText: string): Promise<ExtractionResult>;
|
|
64
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PortableTool } from "./portable-tool.js";
|
|
2
|
+
export declare const MEMORY_QUERY_TOOL_NAME: "memory_query";
|
|
3
|
+
export declare const MEMORY_QUERY_TOOL_SCHEMA: {
|
|
4
|
+
readonly type: "object";
|
|
5
|
+
readonly properties: {
|
|
6
|
+
readonly query: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly description: string;
|
|
9
|
+
};
|
|
10
|
+
readonly category: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly required: readonly ["query"];
|
|
16
|
+
};
|
|
17
|
+
export interface MediaPreferencesSummary {
|
|
18
|
+
imageStyle?: string;
|
|
19
|
+
videoStyle?: string;
|
|
20
|
+
musicGenre?: string;
|
|
21
|
+
musicMood?: string;
|
|
22
|
+
primaryPurpose?: string;
|
|
23
|
+
colorPreference?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Dependency-injected callbacks for memory query.
|
|
27
|
+
* Consumers provide these from their own memory system.
|
|
28
|
+
*/
|
|
29
|
+
export interface MemoryQueryToolDeps {
|
|
30
|
+
/** Query recalled facts/memories by natural language. */
|
|
31
|
+
queryGraph?: (query: string, userId: string) => string[];
|
|
32
|
+
/** Retrieve user profile summary. */
|
|
33
|
+
getProfileSummary?: (userId: string) => string | null;
|
|
34
|
+
/** Retrieve media preferences. */
|
|
35
|
+
getMediaPreferences?: (userId: string) => MediaPreferencesSummary | null;
|
|
36
|
+
/** User ID for this session. */
|
|
37
|
+
userId?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface MemoryQueryToolParams {
|
|
40
|
+
query: string;
|
|
41
|
+
category?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function createMemoryQueryTool(deps?: MemoryQueryToolDeps): PortableTool<MemoryQueryToolParams>;
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
}
|
|
18
|
+
export interface MemoryStoreSerialized {
|
|
19
|
+
memory: string;
|
|
20
|
+
user: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class MemoryStore {
|
|
23
|
+
private memoryEntries;
|
|
24
|
+
private userEntries;
|
|
25
|
+
private frozenSnapshot;
|
|
26
|
+
private snapshotFrozen;
|
|
27
|
+
private readonly memoryCharLimit;
|
|
28
|
+
private readonly userCharLimit;
|
|
29
|
+
constructor(options?: MemoryStoreOptions);
|
|
30
|
+
/**
|
|
31
|
+
* Load from serialized form (e.g. from PG or filesystem).
|
|
32
|
+
* Deduplicates entries on load.
|
|
33
|
+
*/
|
|
34
|
+
loadFromSerialized(data: Partial<MemoryStoreSerialized>): void;
|
|
35
|
+
/**
|
|
36
|
+
* Serialize current live state for persistence.
|
|
37
|
+
*/
|
|
38
|
+
serialize(): MemoryStoreSerialized;
|
|
39
|
+
/**
|
|
40
|
+
* Freeze current entries for system prompt injection.
|
|
41
|
+
* Call once at session start. After freezing, mutations update
|
|
42
|
+
* live state but NOT the system prompt block.
|
|
43
|
+
*/
|
|
44
|
+
freezeSnapshot(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Get frozen system prompt block for the given target.
|
|
47
|
+
* Returns empty string if no entries or not yet frozen.
|
|
48
|
+
*/
|
|
49
|
+
getSystemPromptBlock(target: MemoryStoreTarget): string;
|
|
50
|
+
add(target: MemoryStoreTarget, content: string): MemoryStoreResult;
|
|
51
|
+
replace(target: MemoryStoreTarget, oldText: string, newContent: string): MemoryStoreResult;
|
|
52
|
+
remove(target: MemoryStoreTarget, oldText: string): MemoryStoreResult;
|
|
53
|
+
getEntries(target: MemoryStoreTarget): readonly string[];
|
|
54
|
+
getUsage(target: MemoryStoreTarget): {
|
|
55
|
+
used: number;
|
|
56
|
+
limit: number;
|
|
57
|
+
percent: number;
|
|
58
|
+
};
|
|
59
|
+
isEmpty(): boolean;
|
|
60
|
+
private entriesFor;
|
|
61
|
+
private charLimitFor;
|
|
62
|
+
private formatUsage;
|
|
63
|
+
private renderBlock;
|
|
64
|
+
private successResult;
|
|
65
|
+
private errorResult;
|
|
66
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { MemoryProvider, MemorySearchResult } from "qlogicagent-runtime-contracts";
|
|
2
|
+
import type { MemoryStore, MemoryStoreTarget } from "./memory-store.js";
|
|
3
|
+
export declare const MEMORY_TOOL_NAME: "memory";
|
|
4
|
+
export declare const MEMORY_TOOL_MAX_CONTENT_LENGTH = 2000;
|
|
5
|
+
export declare const MEMORY_TOOL_ACTIONS: readonly ["add", "replace", "remove", "search"];
|
|
6
|
+
export type MemoryToolAction = (typeof MEMORY_TOOL_ACTIONS)[number];
|
|
7
|
+
export declare const MEMORY_TOOL_SCHEMA: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly action: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly enum: string[];
|
|
13
|
+
readonly description: string;
|
|
14
|
+
};
|
|
15
|
+
readonly target: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly enum: readonly ["memory", "user"];
|
|
18
|
+
readonly description: string;
|
|
19
|
+
};
|
|
20
|
+
readonly content: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: string;
|
|
23
|
+
};
|
|
24
|
+
readonly old_text: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly description: "Required for 'replace' and 'remove'. A substring that uniquely identifies the note entry to modify.";
|
|
27
|
+
};
|
|
28
|
+
readonly query: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly description: "Required for 'search'. Natural language query to find relevant memories.";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly required: readonly ["action"];
|
|
34
|
+
};
|
|
35
|
+
export declare const MEMORY_TOOL_DESCRIPTION: string;
|
|
36
|
+
export declare const MEMORY_TOOL_LABEL = "Memory";
|
|
37
|
+
export declare function isMemoryContentSafe(text: string): boolean;
|
|
38
|
+
export interface MemoryToolParams {
|
|
39
|
+
action: MemoryToolAction;
|
|
40
|
+
target?: MemoryStoreTarget;
|
|
41
|
+
content?: string;
|
|
42
|
+
old_text?: string;
|
|
43
|
+
query?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface MemoryToolResult {
|
|
46
|
+
ok: boolean;
|
|
47
|
+
message: string;
|
|
48
|
+
action: string;
|
|
49
|
+
/** For MD store operations: live entry count */
|
|
50
|
+
entryCount?: number;
|
|
51
|
+
/** For MD store operations: usage string */
|
|
52
|
+
usage?: string;
|
|
53
|
+
/** For search: qmemory results */
|
|
54
|
+
results?: MemorySearchResult[];
|
|
55
|
+
/** Indicates MD store was mutated (consumer should persist) */
|
|
56
|
+
storeModified?: boolean;
|
|
57
|
+
errorCode?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface MemoryToolExecutorDeps {
|
|
60
|
+
/** QMemory provider for semantic search. */
|
|
61
|
+
provider: MemoryProvider;
|
|
62
|
+
/** Local MD memory store for notes. */
|
|
63
|
+
store?: MemoryStore;
|
|
64
|
+
userId: string;
|
|
65
|
+
sessionId?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare function executeMemoryTool(params: MemoryToolParams, deps: MemoryToolExecutorDeps): Promise<MemoryToolResult>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bash Classifier — CC yoloClassifier bash branch parity.
|
|
3
|
+
*
|
|
4
|
+
* Specialized classifier for shell/bash commands.
|
|
5
|
+
* CC decomposes each bash tool call into structured analysis:
|
|
6
|
+
* 1. Parse the command string
|
|
7
|
+
* 2. Check against known safe/dangerous command patterns
|
|
8
|
+
* 3. Check working directory context
|
|
9
|
+
* 4. If ambiguous, defer to the LLM classifier
|
|
10
|
+
*
|
|
11
|
+
* This is a pre-filter that runs BEFORE the general classifier,
|
|
12
|
+
* so commonly-used safe shell commands bypass the LLM entirely.
|
|
13
|
+
*
|
|
14
|
+
* Reference: claude-code src/utils/permissions/yoloClassifier.ts (bash branch)
|
|
15
|
+
*/
|
|
16
|
+
export interface BashClassifyResult {
|
|
17
|
+
decision: "allow" | "deny" | "defer";
|
|
18
|
+
reason: string;
|
|
19
|
+
/** Informational warning for destructive commands (CC parity). */
|
|
20
|
+
destructiveWarning?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Classify a bash/shell command for safety.
|
|
24
|
+
*
|
|
25
|
+
* @param command - The shell command string
|
|
26
|
+
* @param cwd - Current working directory (for project context check)
|
|
27
|
+
* @param projectRoot - Project root directory
|
|
28
|
+
* @returns Classification result: allow / deny / defer (to LLM classifier)
|
|
29
|
+
*/
|
|
30
|
+
export declare function classifyBashCommand(command: string, cwd?: string, projectRoot?: string): BashClassifyResult;
|