somora 2026.930.1
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/LICENSE +21 -0
- package/README.md +364 -0
- package/bin/node-version.d.mts +3 -0
- package/bin/node-version.mjs +45 -0
- package/bin/somora.mjs +77 -0
- package/config.example.yaml +896 -0
- package/docs/agents.md +677 -0
- package/docs/api.md +3194 -0
- package/docs/browser.md +317 -0
- package/docs/builder.md +331 -0
- package/docs/cache-strategy.md +373 -0
- package/docs/compaction.md +253 -0
- package/docs/display.md +154 -0
- package/docs/dream-phases.md +891 -0
- package/docs/files.md +387 -0
- package/docs/imagegen.md +366 -0
- package/docs/images/somora-hero.png +0 -0
- package/docs/images/somora-mobile-2026-05-23.png +0 -0
- package/docs/images/somora-tui-2026-05-23.png +0 -0
- package/docs/images/somora-web-2026-05-23.png +0 -0
- package/docs/index.md +178 -0
- package/docs/lsp.md +93 -0
- package/docs/mcp.md +332 -0
- package/docs/memory.md +407 -0
- package/docs/mobile.md +310 -0
- package/docs/models.md +379 -0
- package/docs/projects.md +425 -0
- package/docs/realtime-voice.md +293 -0
- package/docs/resources.md +230 -0
- package/docs/sampling.md +128 -0
- package/docs/security.md +189 -0
- package/docs/sentinel.md +295 -0
- package/docs/setup.md +1217 -0
- package/docs/skills.md +501 -0
- package/docs/team.md +189 -0
- package/docs/thinking.md +463 -0
- package/docs/tmux.md +399 -0
- package/docs/tools.md +117 -0
- package/docs/videogen.md +191 -0
- package/docs/voice.md +288 -0
- package/docs/web.md +893 -0
- package/docs/wiki.md +583 -0
- package/npm-shrinkwrap.json +5670 -0
- package/package.json +116 -0
- package/src/attachments/store.ts +196 -0
- package/src/browser/change-stream.ts +31 -0
- package/src/browser/display.ts +108 -0
- package/src/browser/policy.ts +121 -0
- package/src/browser/screencast.ts +374 -0
- package/src/browser/service.ts +1337 -0
- package/src/browser/session.ts +15 -0
- package/src/browser/snapshot.ts +40 -0
- package/src/cli/auth.ts +117 -0
- package/src/cli/codex.ts +41 -0
- package/src/cli/lsp.ts +71 -0
- package/src/cli/resolvers/clawhub.ts +400 -0
- package/src/cli/setup.ts +835 -0
- package/src/cli/skill.ts +619 -0
- package/src/cli/somora.ts +548 -0
- package/src/cli/systemd-unit.ts +72 -0
- package/src/cli/team.ts +148 -0
- package/src/cli/tui/activity-stream.ts +121 -0
- package/src/cli/tui/api.ts +479 -0
- package/src/cli/tui/app.tsx +1169 -0
- package/src/cli/tui/autocomplete.tsx +55 -0
- package/src/cli/tui/commands.ts +913 -0
- package/src/cli/tui/dream-glyphs.ts +22 -0
- package/src/cli/tui/footer.tsx +15 -0
- package/src/cli/tui/format.ts +28 -0
- package/src/cli/tui/header.tsx +279 -0
- package/src/cli/tui/index.tsx +120 -0
- package/src/cli/tui/markdown.tsx +63 -0
- package/src/cli/tui/sampling.ts +162 -0
- package/src/cli/tui/separator.tsx +13 -0
- package/src/cli/tui/state.ts +42 -0
- package/src/cli/tui/stream.ts +330 -0
- package/src/cli/tui/thinking-text.ts +54 -0
- package/src/cli/tui/turn-views.tsx +499 -0
- package/src/cli/tui/types.ts +410 -0
- package/src/cli/tui/work-queue.ts +161 -0
- package/src/cli/update-args.ts +55 -0
- package/src/cli/wiki.ts +406 -0
- package/src/compaction/index.ts +28 -0
- package/src/compaction/midturn.ts +210 -0
- package/src/compaction/policy.ts +154 -0
- package/src/compaction/summarize.ts +691 -0
- package/src/compaction/template.ts +90 -0
- package/src/compaction/types.ts +148 -0
- package/src/config/loader.ts +276 -0
- package/src/config/reload.ts +43 -0
- package/src/config/types.ts +2292 -0
- package/src/dream/deep-actions.ts +324 -0
- package/src/dream/deep-dispatcher.ts +237 -0
- package/src/dream/deep-llm.ts +388 -0
- package/src/dream/deep-prompts.ts +106 -0
- package/src/dream/deep-runner.ts +757 -0
- package/src/dream/deep-skip-cache.ts +199 -0
- package/src/dream/deep-worker.ts +229 -0
- package/src/dream/json-salvage.ts +34 -0
- package/src/dream/judge.ts +188 -0
- package/src/dream/loop-state.ts +286 -0
- package/src/dream/lucid-actions.ts +303 -0
- package/src/dream/lucid-batches.ts +94 -0
- package/src/dream/lucid-prompt.ts +82 -0
- package/src/dream/lucid-runner.ts +744 -0
- package/src/dream/lucid-storage.ts +277 -0
- package/src/dream/lucid-structure.ts +102 -0
- package/src/dream/lucid-types.ts +137 -0
- package/src/dream/lucid-worker.ts +224 -0
- package/src/dream/rem-dedup.ts +502 -0
- package/src/dream/rem-extract.ts +782 -0
- package/src/dream/rem-reset-run.ts +67 -0
- package/src/dream/rem-runner.ts +696 -0
- package/src/dream/rem-worker.ts +527 -0
- package/src/dream/review-window.ts +71 -0
- package/src/dream/scheduler-state.ts +129 -0
- package/src/dream/storage.ts +497 -0
- package/src/dream/types.ts +133 -0
- package/src/dream/wiki-context.ts +133 -0
- package/src/engine/a2a.ts +33 -0
- package/src/engine/availability.ts +63 -0
- package/src/engine/claude-cli.ts +969 -0
- package/src/engine/codex-app-server-client.ts +294 -0
- package/src/engine/codex-bin.ts +49 -0
- package/src/engine/codex-cli.ts +1014 -0
- package/src/engine/codex-dynamic-tools.ts +239 -0
- package/src/engine/codex-home.ts +63 -0
- package/src/engine/codex-thread-config.ts +74 -0
- package/src/engine/context-budget.ts +257 -0
- package/src/engine/engine-meta-labels.ts +211 -0
- package/src/engine/grok-cli.ts +941 -0
- package/src/engine/inline-think.ts +59 -0
- package/src/engine/model-availability.ts +105 -0
- package/src/engine/openai-compatible.ts +2464 -0
- package/src/engine/reasoning-retry.ts +83 -0
- package/src/engine/registry.ts +13 -0
- package/src/engine/replay.ts +195 -0
- package/src/engine/sampling.ts +90 -0
- package/src/engine/thinking-params.ts +264 -0
- package/src/engine/types.ts +269 -0
- package/src/engine/user-tag.ts +24 -0
- package/src/imagegen/aspect.ts +128 -0
- package/src/imagegen/generate.ts +642 -0
- package/src/imagegen/references.ts +75 -0
- package/src/imagegen/types.ts +154 -0
- package/src/lsp/client.ts +183 -0
- package/src/lsp/fake-server.helper.mjs +42 -0
- package/src/lsp/format.ts +29 -0
- package/src/lsp/index.ts +21 -0
- package/src/lsp/manager.ts +238 -0
- package/src/lsp/registry.ts +151 -0
- package/src/mcp/config.ts +117 -0
- package/src/mcp/hub/audit.ts +55 -0
- package/src/mcp/hub/bridge.ts +115 -0
- package/src/mcp/hub/catalog.ts +69 -0
- package/src/mcp/hub/credentials.ts +406 -0
- package/src/mcp/hub/env-expand.ts +14 -0
- package/src/mcp/hub/manager.ts +770 -0
- package/src/mcp/hub/normalize.ts +213 -0
- package/src/mcp/server.ts +368 -0
- package/src/mcp/tool-schema.ts +20 -0
- package/src/media/capabilities.ts +392 -0
- package/src/media/records.ts +175 -0
- package/src/media/store.ts +217 -0
- package/src/media/types.ts +69 -0
- package/src/memory/chunking.ts +168 -0
- package/src/memory/embeddings.ts +262 -0
- package/src/memory/index.ts +15 -0
- package/src/memory/inject.ts +197 -0
- package/src/memory/manager.ts +996 -0
- package/src/memory/registry.ts +176 -0
- package/src/memory/rescan.ts +101 -0
- package/src/memory/retrieval.ts +586 -0
- package/src/memory/shared-index.ts +372 -0
- package/src/memory/slug.ts +39 -0
- package/src/memory/storage.ts +385 -0
- package/src/memory/watcher.ts +134 -0
- package/src/multimodal/blocks.ts +101 -0
- package/src/multimodal/dimensions.ts +214 -0
- package/src/multimodal/load.ts +86 -0
- package/src/multimodal/mime.ts +135 -0
- package/src/multimodal/pdf-render.ts +80 -0
- package/src/multimodal/user-content.ts +266 -0
- package/src/persona/files.ts +144 -0
- package/src/persona/loader.ts +598 -0
- package/src/persona/skill-gating-store.ts +59 -0
- package/src/persona/tool-gating-store.ts +113 -0
- package/src/projects/focus.ts +186 -0
- package/src/projects/prompt-block.ts +106 -0
- package/src/projects/scheme.ts +107 -0
- package/src/projects/store.ts +144 -0
- package/src/projects/types.ts +73 -0
- package/src/sentinel/dispatcher.ts +97 -0
- package/src/sentinel/schedule.ts +271 -0
- package/src/sentinel/scheduler.ts +840 -0
- package/src/sentinel/store.ts +259 -0
- package/src/sentinel/types.ts +221 -0
- package/src/server/activity-stream.ts +160 -0
- package/src/server/ask-calls.ts +137 -0
- package/src/server/ask-wait-graph.ts +171 -0
- package/src/server/async-tasks.ts +199 -0
- package/src/server/builder-busy.ts +86 -0
- package/src/server/builder-prompt.ts +204 -0
- package/src/server/builder-questions.ts +117 -0
- package/src/server/builder-session.ts +249 -0
- package/src/server/chat-aborts.ts +83 -0
- package/src/server/claude-config-dir.ts +71 -0
- package/src/server/claude-credential-sync.ts +454 -0
- package/src/server/env-file.ts +100 -0
- package/src/server/env.ts +115 -0
- package/src/server/heal-session.ts +151 -0
- package/src/server/history-page.ts +46 -0
- package/src/server/index.ts +7244 -0
- package/src/server/lockfile.ts +89 -0
- package/src/server/logger.ts +67 -0
- package/src/server/logs.ts +187 -0
- package/src/server/loopback-fetch.ts +130 -0
- package/src/server/openai-client.ts +89 -0
- package/src/server/prompt-assembly.ts +334 -0
- package/src/server/restart-reconcile.ts +139 -0
- package/src/server/run-turn-fallback.ts +275 -0
- package/src/server/run-turn-types.ts +91 -0
- package/src/server/run-turn.ts +1474 -0
- package/src/server/sanitize-assistant-text.ts +112 -0
- package/src/server/session-export.ts +220 -0
- package/src/server/session-queue.ts +376 -0
- package/src/server/session-workdir.ts +49 -0
- package/src/server/sse-h2-safe.ts +61 -0
- package/src/server/sse-liveness.ts +162 -0
- package/src/server/sse-serializer.ts +161 -0
- package/src/server/start-turn.ts +249 -0
- package/src/server/steer-inbox.ts +107 -0
- package/src/server/tls-keeper.ts +153 -0
- package/src/server/tool-format.ts +167 -0
- package/src/server/turn-framing.ts +52 -0
- package/src/server/turn-origin-kind.ts +74 -0
- package/src/server/turn-origin.ts +40 -0
- package/src/server/work-ledger.ts +975 -0
- package/src/server/workspace.ts +114 -0
- package/src/setup/config-edit.ts +201 -0
- package/src/setup/presets.ts +71 -0
- package/src/setup/prompt.ts +163 -0
- package/src/setup/tailscale.ts +44 -0
- package/src/skills/bin-checks.ts +227 -0
- package/src/skills/bootstrap.ts +347 -0
- package/src/skills/env-scope.ts +175 -0
- package/src/skills/gating.ts +71 -0
- package/src/skills/lint.ts +202 -0
- package/src/skills/load.ts +368 -0
- package/src/skills/path-helpers.ts +102 -0
- package/src/skills/registry.ts +178 -0
- package/src/ssh/exec.ts +142 -0
- package/src/ssh/index.ts +12 -0
- package/src/ssh/known-hosts.ts +109 -0
- package/src/ssh/pool.ts +307 -0
- package/src/storage/sessions.ts +602 -0
- package/src/team/render.ts +149 -0
- package/src/team/resolve.ts +122 -0
- package/src/team/store.ts +124 -0
- package/src/team/types.ts +111 -0
- package/src/team/write.ts +95 -0
- package/src/testing/isolated-home.mts +46 -0
- package/src/tmux/attention-watcher.ts +272 -0
- package/src/tmux/attention.ts +336 -0
- package/src/tmux/list.ts +91 -0
- package/src/tmux/origin-store.ts +102 -0
- package/src/tmux/tui-markers.ts +267 -0
- package/src/tools/agents/ask-cancel.ts +94 -0
- package/src/tools/agents/ask-result.ts +235 -0
- package/src/tools/agents/ask.ts +704 -0
- package/src/tools/agents/builder-dispatch.ts +217 -0
- package/src/tools/agents/images.ts +104 -0
- package/src/tools/agents/index.ts +42 -0
- package/src/tools/agents/long-task-timeouts.ts +39 -0
- package/src/tools/agents/session-list.ts +136 -0
- package/src/tools/agents/session-model.ts +106 -0
- package/src/tools/agents/spawn.ts +845 -0
- package/src/tools/agents/status.ts +589 -0
- package/src/tools/browser/index.ts +6 -0
- package/src/tools/browser/ops.ts +145 -0
- package/src/tools/browser/tools.ts +184 -0
- package/src/tools/builder/short-descriptions.ts +80 -0
- package/src/tools/builder/tools.ts +222 -0
- package/src/tools/docs/index.ts +1 -0
- package/src/tools/docs/tools.ts +228 -0
- package/src/tools/dream/index.ts +11 -0
- package/src/tools/dream/tools.ts +1002 -0
- package/src/tools/exec/allowlist.ts +233 -0
- package/src/tools/exec/background-detach.helper.mts +27 -0
- package/src/tools/exec/blacklist.ts +336 -0
- package/src/tools/exec/concurrency.ts +150 -0
- package/src/tools/exec/fit-output.ts +82 -0
- package/src/tools/exec/index.ts +7 -0
- package/src/tools/exec/internal-env.ts +89 -0
- package/src/tools/exec/job-store.ts +403 -0
- package/src/tools/exec/local.ts +649 -0
- package/src/tools/exec/remote.ts +399 -0
- package/src/tools/exec/tools.ts +934 -0
- package/src/tools/file/analyze.ts +378 -0
- package/src/tools/file/index.ts +2 -0
- package/src/tools/file/local.ts +707 -0
- package/src/tools/file/lsp-hook.ts +72 -0
- package/src/tools/file/persona-guard.ts +61 -0
- package/src/tools/file/policy.ts +292 -0
- package/src/tools/file/read-format.ts +129 -0
- package/src/tools/file/remote.ts +680 -0
- package/src/tools/file/replace.ts +507 -0
- package/src/tools/file/search-window.ts +224 -0
- package/src/tools/file/tools.ts +658 -0
- package/src/tools/file/write-scope.ts +182 -0
- package/src/tools/gating.ts +106 -0
- package/src/tools/image/budget.ts +82 -0
- package/src/tools/image/index.ts +7 -0
- package/src/tools/image/tools.ts +601 -0
- package/src/tools/index.ts +99 -0
- package/src/tools/memory/index.ts +12 -0
- package/src/tools/memory/tools.ts +399 -0
- package/src/tools/projects/index.ts +1 -0
- package/src/tools/projects/tools.ts +643 -0
- package/src/tools/registry.ts +427 -0
- package/src/tools/resources/index.ts +8 -0
- package/src/tools/resources/tools.ts +176 -0
- package/src/tools/resources/visibility.ts +60 -0
- package/src/tools/sentinel/index.ts +1 -0
- package/src/tools/sentinel/tools.ts +592 -0
- package/src/tools/skill/index.ts +4 -0
- package/src/tools/skill/tools.ts +285 -0
- package/src/tools/time/index.ts +5 -0
- package/src/tools/time/tools.ts +123 -0
- package/src/tools/tmux/index.ts +1 -0
- package/src/tools/tmux/local.ts +277 -0
- package/src/tools/tmux/remote.ts +168 -0
- package/src/tools/tmux/tools.ts +1064 -0
- package/src/tools/tool-output.ts +97 -0
- package/src/tools/types.ts +227 -0
- package/src/tools/video/index.ts +1 -0
- package/src/tools/video/tools.ts +425 -0
- package/src/tools/web/fetch.ts +337 -0
- package/src/tools/web/index.ts +4 -0
- package/src/tools/web/tools.ts +186 -0
- package/src/tools/wiki/index.ts +1 -0
- package/src/tools/wiki/tools.ts +445 -0
- package/src/tts/cache-gc.ts +128 -0
- package/src/tts/prepare-for-tts.ts +114 -0
- package/src/tts/service.ts +332 -0
- package/src/types/events.ts +695 -0
- package/src/types/turn-origin.ts +53 -0
- package/src/version.ts +21 -0
- package/src/videogen/dialects.ts +222 -0
- package/src/videogen/generate.ts +484 -0
- package/src/videogen/jobs.ts +178 -0
- package/src/videogen/runner.ts +125 -0
- package/src/videogen/wake.ts +119 -0
- package/src/voice/realtime/call.ts +948 -0
- package/src/voice/realtime/consult.ts +293 -0
- package/src/voice/realtime/fake-provider.ts +134 -0
- package/src/voice/realtime/manager.ts +384 -0
- package/src/voice/realtime/openai-provider.ts +471 -0
- package/src/voice/realtime/persona.ts +227 -0
- package/src/voice/realtime/session-match.ts +116 -0
- package/src/voice/realtime/types.ts +182 -0
- package/src/wiki/conflict.ts +113 -0
- package/src/wiki/explorer.ts +578 -0
- package/src/wiki/index-builder.ts +172 -0
- package/src/wiki/language.ts +134 -0
- package/src/wiki/log-builder.ts +150 -0
- package/src/wiki/map.ts +258 -0
- package/src/wiki/migration/analyze.ts +304 -0
- package/src/wiki/migration/execute.ts +689 -0
- package/src/wiki/migration/refine.ts +402 -0
- package/src/wiki/migration/store.ts +100 -0
- package/src/wiki/move-page.ts +57 -0
- package/src/wiki/structure-file.ts +192 -0
- package/src/wiki/taxonomy.ts +140 -0
- package/src/wiki/templates.ts +163 -0
- package/src/wiki/types.ts +133 -0
- package/templates/skills/README.md +24 -0
- package/templates/skills/_templates/api-wrapper/SKILL.md +26 -0
- package/templates/skills/_templates/cli-wrapper/BOOTSTRAP.md +32 -0
- package/templates/skills/_templates/cli-wrapper/SKILL.md +24 -0
- package/templates/skills/_templates/default/SKILL.md +25 -0
- package/templates/skills/builder-handover/SKILL.md +96 -0
- package/templates/skills/builder-handover/assets/ORDER.md +12 -0
- package/templates/skills/skill-author/SKILL.md +110 -0
- package/tsconfig.json +22 -0
- package/web/dist/assets/index-BaVv6pB2.js +631 -0
- package/web/dist/assets/index-BaVv6pB2.js.map +1 -0
- package/web/dist/assets/index-V3FV3Z25.css +32 -0
- package/web/dist/favicon.svg +8 -0
- package/web/dist/index.html +20 -0
- package/web/package.json +36 -0
- package/web/tsconfig.json +25 -0
- package/web-mobile/dist/apple-touch-icon.png +0 -0
- package/web-mobile/dist/assets/index-BqKt7IMx.css +1 -0
- package/web-mobile/dist/assets/index-X_vRr6cd.js +88 -0
- package/web-mobile/dist/assets/index-X_vRr6cd.js.map +1 -0
- package/web-mobile/dist/favicon.svg +8 -0
- package/web-mobile/dist/icon-192.png +0 -0
- package/web-mobile/dist/icon-512.png +0 -0
- package/web-mobile/dist/index.html +27 -0
- package/web-mobile/dist/manifest.webmanifest +32 -0
- package/web-mobile/dist/service-worker.js +90 -0
- package/web-mobile/package.json +28 -0
- package/web-mobile/tsconfig.json +25 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Top-level tools surface. Server constructs a single ToolRegistry,
|
|
2
|
+
// registers all groups, and hands ToolContext to each invocation.
|
|
3
|
+
|
|
4
|
+
import { ToolRegistry } from './registry.ts';
|
|
5
|
+
import { memoryTools } from './memory/index.ts';
|
|
6
|
+
import { dreamTools } from './dream/index.ts';
|
|
7
|
+
import { timeTools } from './time/index.ts';
|
|
8
|
+
import { webTools } from './web/index.ts';
|
|
9
|
+
import { somoraDocsTools } from './docs/index.ts';
|
|
10
|
+
import { resourceTools } from './resources/index.ts';
|
|
11
|
+
import { fileTools } from './file/index.ts';
|
|
12
|
+
import { analyzeFileTools } from './file/index.ts';
|
|
13
|
+
import { agentTools } from './agents/index.ts';
|
|
14
|
+
import { execTools } from './exec/index.ts';
|
|
15
|
+
import { tmuxTools } from './tmux/index.ts';
|
|
16
|
+
import { skillTools } from './skill/index.ts';
|
|
17
|
+
import { wikiTools } from './wiki/index.ts';
|
|
18
|
+
import { projectTools } from './projects/index.ts';
|
|
19
|
+
import { sentinelTools } from './sentinel/index.ts';
|
|
20
|
+
import { imageTools } from './image/index.ts';
|
|
21
|
+
import { videoTools } from './video/index.ts';
|
|
22
|
+
import { browserTools } from './browser/index.ts';
|
|
23
|
+
import { builderTools } from './builder/tools.ts';
|
|
24
|
+
|
|
25
|
+
export { ToolRegistry } from './registry.ts';
|
|
26
|
+
export type { ToolContext, ToolDefinition, ToolInvoker, ToolResult } from './types.ts';
|
|
27
|
+
export { memoryTools } from './memory/index.ts';
|
|
28
|
+
export { dreamTools } from './dream/index.ts';
|
|
29
|
+
export { timeTools } from './time/index.ts';
|
|
30
|
+
export { webTools } from './web/index.ts';
|
|
31
|
+
export { somoraDocsTools } from './docs/index.ts';
|
|
32
|
+
export { resourceTools } from './resources/index.ts';
|
|
33
|
+
export { fileTools, analyzeFileTools } from './file/index.ts';
|
|
34
|
+
export { agentTools, configureSpawnTools } from './agents/index.ts';
|
|
35
|
+
export {
|
|
36
|
+
configureExecConcurrencyCaps,
|
|
37
|
+
execTools,
|
|
38
|
+
logExecCaps,
|
|
39
|
+
recoverOrphanedJobs,
|
|
40
|
+
} from './exec/index.ts';
|
|
41
|
+
export { tmuxTools } from './tmux/index.ts';
|
|
42
|
+
export { skillTools } from './skill/index.ts';
|
|
43
|
+
export { wikiTools } from './wiki/index.ts';
|
|
44
|
+
export { projectTools } from './projects/index.ts';
|
|
45
|
+
export { sentinelTools } from './sentinel/index.ts';
|
|
46
|
+
export { imageTools } from './image/index.ts';
|
|
47
|
+
export { videoTools } from './video/index.ts';
|
|
48
|
+
export { browserTools } from './browser/index.ts';
|
|
49
|
+
export { configureDreamRunTool } from './dream/index.ts';
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Single source of truth for "every tool somora exposes". Both registration
|
|
53
|
+
* sites — the in-process HTTP/agent-loop registry (`src/server/index.ts`)
|
|
54
|
+
* and the MCP child-process registry (`src/mcp/server.ts`) — call this so
|
|
55
|
+
* the two engine paths can never drift. Adding a new tool bundle: import it
|
|
56
|
+
* above and add ONE `registerMany()` line below; both sites pick it up.
|
|
57
|
+
*
|
|
58
|
+
* The two registries are separate ToolRegistry instances (the MCP server
|
|
59
|
+
* runs in a child process per claude-cli/codex-cli turn — different process,
|
|
60
|
+
* different memory) but they're populated by the same code, so the
|
|
61
|
+
* effective tool set is identical across all three engines.
|
|
62
|
+
*
|
|
63
|
+
* Bug 2026-05-07 (Phase X scaffold): adding `skillTools()` only to the HTTP
|
|
64
|
+
* site left claude-cli blind to the new tool. Dual-registry consolidation
|
|
65
|
+
* is the fix that prevents the class of bug going forward.
|
|
66
|
+
*/
|
|
67
|
+
export function registerAllTools(registry: ToolRegistry): void {
|
|
68
|
+
registry.registerMany(memoryTools());
|
|
69
|
+
registry.registerMany(dreamTools());
|
|
70
|
+
registry.registerMany(timeTools());
|
|
71
|
+
registry.registerMany(webTools());
|
|
72
|
+
registry.registerMany(somoraDocsTools());
|
|
73
|
+
registry.registerMany(resourceTools());
|
|
74
|
+
registry.registerMany(fileTools());
|
|
75
|
+
registry.registerMany(analyzeFileTools());
|
|
76
|
+
registry.registerMany(agentTools());
|
|
77
|
+
registry.registerMany(execTools());
|
|
78
|
+
registry.registerMany(tmuxTools());
|
|
79
|
+
registry.registerMany(skillTools());
|
|
80
|
+
registry.registerMany(wikiTools());
|
|
81
|
+
// Project tools self-gate via their `available` probe on
|
|
82
|
+
// config.projects.enabled — when disabled, the registry filters them
|
|
83
|
+
// out of the model-facing list. So we always register; only the
|
|
84
|
+
// visibility flips based on config. Same pattern as wikiTools.
|
|
85
|
+
registry.registerMany(projectTools());
|
|
86
|
+
registry.registerMany(sentinelTools());
|
|
87
|
+
// Same self-gating pattern: registered unconditionally, hidden by
|
|
88
|
+
// their `available` probe unless imageGen is enabled AND has a
|
|
89
|
+
// model configured. A tool the agent can see but cannot run is
|
|
90
|
+
// worse than one that isn't offered.
|
|
91
|
+
registry.registerMany(imageTools());
|
|
92
|
+
registry.registerMany(videoTools());
|
|
93
|
+
// Shared browser: self-gates on config.browser.enabled via `available`.
|
|
94
|
+
registry.registerMany(browserTools());
|
|
95
|
+
// Builder tools (task list, questions, plan): registered for everyone,
|
|
96
|
+
// offered to builders by their kind allow-list (gating.ts) — a chat
|
|
97
|
+
// agent sees them only when its agent.yaml allows them.
|
|
98
|
+
registry.registerMany(builderTools());
|
|
99
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Memory tool bundle. Re-exports the individual tool definitions and
|
|
2
|
+
// provides `memoryTools()` for batch registration.
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
memorySearch,
|
|
6
|
+
memoryGet,
|
|
7
|
+
memoryList,
|
|
8
|
+
memoryWrite,
|
|
9
|
+
memoryEdit,
|
|
10
|
+
memoryDelete,
|
|
11
|
+
memoryTools,
|
|
12
|
+
} from './tools.ts';
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
// Memory tool definitions (DECISION #31). Six granular tools:
|
|
2
|
+
// memory_search — hybrid retrieval across ALL sources (own memory + vault)
|
|
3
|
+
// memory_get — fetch full content by `source/slug` reference
|
|
4
|
+
// memory_list — overview of own memory notes (no vault)
|
|
5
|
+
// memory_write — create or overwrite a note in own memory
|
|
6
|
+
// memory_edit — modify an existing own-memory note (fail if missing)
|
|
7
|
+
// memory_delete — remove a note from own memory
|
|
8
|
+
//
|
|
9
|
+
// All write tools refuse to operate on vault paths by construction: the
|
|
10
|
+
// slug regex rejects any string with `/`, `--`, uppercase letters, etc.
|
|
11
|
+
// See SLUG_RE in src/memory/manager.ts.
|
|
12
|
+
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import type { ToolDefinition } from '../types.ts';
|
|
15
|
+
|
|
16
|
+
// ── Shared helpers ────────────────────────────────────────────────────
|
|
17
|
+
|
|
18
|
+
/** Slug schema for own-memory writes — same regex as MemoryManager.SLUG_RE. */
|
|
19
|
+
const SlugSchema = z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.regex(/^[a-z0-9][a-z0-9_-]*$/, 'slug must be lowercase, start with letter/digit, only [a-z0-9_-] allowed');
|
|
23
|
+
|
|
24
|
+
/** Reference for memory_get — `memory/<slug>`, `wiki/<path>`, or
|
|
25
|
+
* `vault/<path>`. The wiki source was added in Phase 4 (DECISIONS
|
|
26
|
+
* #41/#42 + private/wiki-design.md): a designated subfolder of the
|
|
27
|
+
* Obsidian vault that Dream-B writes to and all agents share. */
|
|
28
|
+
const ReferenceSchema = z
|
|
29
|
+
.string()
|
|
30
|
+
.min(3)
|
|
31
|
+
.regex(/^(memory|wiki|vault)\/.+$/, 'reference must start with "memory/", "wiki/", or "vault/"');
|
|
32
|
+
|
|
33
|
+
const SourceFilterSchema = z
|
|
34
|
+
.enum(['memory', 'wiki', 'vault', 'all'])
|
|
35
|
+
.optional();
|
|
36
|
+
|
|
37
|
+
const FrontmatterSchema = z
|
|
38
|
+
.object({
|
|
39
|
+
description: z.string().optional(),
|
|
40
|
+
tags: z.array(z.string()).optional(),
|
|
41
|
+
})
|
|
42
|
+
.passthrough()
|
|
43
|
+
.optional();
|
|
44
|
+
|
|
45
|
+
// ── memory_search ─────────────────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
const SearchInput = z.object({
|
|
48
|
+
query: z.string().min(1),
|
|
49
|
+
limit: z.number().int().positive().max(50).optional(),
|
|
50
|
+
minScore: z.number().min(0).max(1).optional(),
|
|
51
|
+
source: SourceFilterSchema,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const memorySearch: ToolDefinition<z.infer<typeof SearchInput>> = {
|
|
55
|
+
name: 'memory_search',
|
|
56
|
+
toolset: 'memory',
|
|
57
|
+
description:
|
|
58
|
+
'Search across all your knowledge sources: your own short-term memory, the shared long-term ' +
|
|
59
|
+
'wiki, and read-only vault content. Returns top-N hits with `reference`, `score`, and a snippet. ' +
|
|
60
|
+
'Hits are tagged by source: `memory/<slug>` for your own notes, `wiki/<path>` for the shared ' +
|
|
61
|
+
'consolidated wiki, `vault/<path>` for read-only vault files. ' +
|
|
62
|
+
'Pass the `reference` value directly to `memory_get` to read the full content. ' +
|
|
63
|
+
'Use the optional `source` parameter to constrain the search to one layer when you know exactly ' +
|
|
64
|
+
'where to look (e.g. `source: "wiki"` for authoritative consolidated facts). ' +
|
|
65
|
+
'Default: searches all sources. Use this when the pre-injected <memory-context> block is ' +
|
|
66
|
+
'insufficient or you need to look up something specific.',
|
|
67
|
+
inputSchema: SearchInput,
|
|
68
|
+
jsonSchema: {
|
|
69
|
+
type: 'object',
|
|
70
|
+
properties: {
|
|
71
|
+
query: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
description:
|
|
74
|
+
'What to search for — keyword, question, or synonym. Embedding-based recall also finds non-literal matches.',
|
|
75
|
+
},
|
|
76
|
+
limit: {
|
|
77
|
+
type: 'integer',
|
|
78
|
+
minimum: 1,
|
|
79
|
+
maximum: 50,
|
|
80
|
+
description: 'Maximum number of hits to return (default 5).',
|
|
81
|
+
},
|
|
82
|
+
minScore: {
|
|
83
|
+
type: 'number',
|
|
84
|
+
minimum: 0,
|
|
85
|
+
maximum: 1,
|
|
86
|
+
description: 'Discard hits below this score (0..1, default 0.5).',
|
|
87
|
+
},
|
|
88
|
+
source: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
enum: ['memory', 'wiki', 'vault', 'all'],
|
|
91
|
+
description:
|
|
92
|
+
'Restrict search to a single layer. ' +
|
|
93
|
+
'"memory" = your own short-term notes; ' +
|
|
94
|
+
'"wiki" = shared consolidated long-term knowledge; ' +
|
|
95
|
+
'"vault" = read-only Obsidian content outside the wiki. ' +
|
|
96
|
+
'Default "all" = mix all three (ranked by source-boost).',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: ['query'],
|
|
100
|
+
additionalProperties: false,
|
|
101
|
+
},
|
|
102
|
+
async handler(input, ctx) {
|
|
103
|
+
const mgr = await ctx.getMemoryManager();
|
|
104
|
+
const sources =
|
|
105
|
+
!input.source || input.source === 'all' ? 'all' : [input.source];
|
|
106
|
+
// Agent-driven search defaults to a 0 floor so the agent sees the
|
|
107
|
+
// best top-N matches and can filter itself. Auto-injection still
|
|
108
|
+
// uses the higher autoInject.minScore — that's a different use case
|
|
109
|
+
// (ambient context where quality > recall).
|
|
110
|
+
const hits = await mgr.search(input.query, {
|
|
111
|
+
limit: input.limit,
|
|
112
|
+
minScore: input.minScore ?? 0,
|
|
113
|
+
sources,
|
|
114
|
+
});
|
|
115
|
+
return {
|
|
116
|
+
query: input.query,
|
|
117
|
+
count: hits.length,
|
|
118
|
+
hits: hits.map((h) => ({
|
|
119
|
+
reference: `${h.source}/${h.slug}`,
|
|
120
|
+
source: h.source,
|
|
121
|
+
slug: h.slug,
|
|
122
|
+
score: Number(h.score.toFixed(4)),
|
|
123
|
+
snippet: h.text.length > 400 ? h.text.slice(0, 400).trimEnd() + '…' : h.text,
|
|
124
|
+
startLine: h.startLine,
|
|
125
|
+
endLine: h.endLine,
|
|
126
|
+
path: h.filePath,
|
|
127
|
+
})),
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// ── memory_get ────────────────────────────────────────────────────────
|
|
133
|
+
|
|
134
|
+
const GetInput = z.object({
|
|
135
|
+
reference: ReferenceSchema,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export const memoryGet: ToolDefinition<z.infer<typeof GetInput>> = {
|
|
139
|
+
name: 'memory_get',
|
|
140
|
+
toolset: 'memory',
|
|
141
|
+
description:
|
|
142
|
+
'Fetch the full content of a note, wiki page, or vault file by its `reference` from a recall ' +
|
|
143
|
+
'hit (or from the <memory-context> block). ' +
|
|
144
|
+
'Format: `memory/<slug>` for your own short-term memory, `wiki/<path>` for the shared ' +
|
|
145
|
+
'long-term wiki, `vault/<path>` for read-only vault files. ' +
|
|
146
|
+
'Returns the full markdown content, parsed frontmatter, and file path.',
|
|
147
|
+
inputSchema: GetInput,
|
|
148
|
+
jsonSchema: {
|
|
149
|
+
type: 'object',
|
|
150
|
+
properties: {
|
|
151
|
+
reference: {
|
|
152
|
+
type: 'string',
|
|
153
|
+
pattern: '^(memory|wiki|vault)/.+$',
|
|
154
|
+
description: 'Recall reference, exactly as it appeared in a memory_search hit or in the memory-context block.',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
required: ['reference'],
|
|
158
|
+
additionalProperties: false,
|
|
159
|
+
},
|
|
160
|
+
async handler(input, ctx) {
|
|
161
|
+
const mgr = await ctx.getMemoryManager();
|
|
162
|
+
const result = await mgr.getByReference(input.reference);
|
|
163
|
+
if (!result) {
|
|
164
|
+
throw new Error(`reference '${input.reference}' not found in index`);
|
|
165
|
+
}
|
|
166
|
+
return result;
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// ── memory_list ───────────────────────────────────────────────────────
|
|
171
|
+
|
|
172
|
+
const ListInput = z.object({
|
|
173
|
+
tag: z.string().optional(),
|
|
174
|
+
source: SourceFilterSchema,
|
|
175
|
+
pathPrefix: z.string().min(1).optional(),
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
export const memoryList: ToolDefinition<z.infer<typeof ListInput>> = {
|
|
179
|
+
name: 'memory_list',
|
|
180
|
+
toolset: 'memory',
|
|
181
|
+
description:
|
|
182
|
+
'List notes with slug, description, and tags. Default scope: your own short-term memory only. ' +
|
|
183
|
+
'Pass `source: "wiki"` to browse the shared long-term wiki (e.g. with `pathPrefix: "personen/"` ' +
|
|
184
|
+
'to list just the people). Pass `source: "all"` to list everything across memory + wiki + vault — ' +
|
|
185
|
+
'rarely needed; vault can be very large.',
|
|
186
|
+
inputSchema: ListInput,
|
|
187
|
+
jsonSchema: {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
tag: {
|
|
191
|
+
type: 'string',
|
|
192
|
+
description: 'Optional: only return notes whose frontmatter contains this tag.',
|
|
193
|
+
},
|
|
194
|
+
source: {
|
|
195
|
+
type: 'string',
|
|
196
|
+
enum: ['memory', 'wiki', 'vault', 'all'],
|
|
197
|
+
description:
|
|
198
|
+
'Which source to list. "memory" = your own (default), "wiki" = shared consolidated, ' +
|
|
199
|
+
'"vault" = read-only vault, "all" = union of all three.',
|
|
200
|
+
},
|
|
201
|
+
pathPrefix: {
|
|
202
|
+
type: 'string',
|
|
203
|
+
description:
|
|
204
|
+
'Optional slug prefix filter. Useful for wiki subfolders, e.g. "personen/" or "projekte/".',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
additionalProperties: false,
|
|
208
|
+
},
|
|
209
|
+
async handler(input, ctx) {
|
|
210
|
+
const mgr = await ctx.getMemoryManager();
|
|
211
|
+
const sources =
|
|
212
|
+
!input.source || input.source === 'memory'
|
|
213
|
+
? undefined
|
|
214
|
+
: input.source === 'all'
|
|
215
|
+
? ('all' as const)
|
|
216
|
+
: [input.source];
|
|
217
|
+
const notes = await mgr.listNotes({
|
|
218
|
+
...(input.tag ? { tag: input.tag } : {}),
|
|
219
|
+
...(sources ? { sources } : {}),
|
|
220
|
+
...(input.pathPrefix ? { pathPrefix: input.pathPrefix } : {}),
|
|
221
|
+
});
|
|
222
|
+
return {
|
|
223
|
+
count: notes.length,
|
|
224
|
+
notes: notes.map((n) => ({
|
|
225
|
+
slug: n.slug,
|
|
226
|
+
source: n.source,
|
|
227
|
+
reference: `${n.source}/${n.slug}`,
|
|
228
|
+
description: n.description,
|
|
229
|
+
tags: n.tags ?? [],
|
|
230
|
+
updatedAt: new Date(n.updatedAt).toISOString(),
|
|
231
|
+
})),
|
|
232
|
+
};
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// ── memory_write ──────────────────────────────────────────────────────
|
|
237
|
+
|
|
238
|
+
const WriteInput = z.object({
|
|
239
|
+
slug: SlugSchema,
|
|
240
|
+
content: z.string(),
|
|
241
|
+
frontmatter: FrontmatterSchema,
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
export const memoryWrite: ToolDefinition<z.infer<typeof WriteInput>> = {
|
|
245
|
+
name: 'memory_write',
|
|
246
|
+
toolset: 'memory',
|
|
247
|
+
description:
|
|
248
|
+
'Create or overwrite a note in YOUR OWN short-term memory. ' +
|
|
249
|
+
'Slug must be lowercase and contain only [a-z0-9_-] — no paths, no slashes. ' +
|
|
250
|
+
'Writes to `~/.somora/agents/<your-name>/memory/<slug>.md`. ' +
|
|
251
|
+
'Cannot modify wiki or vault — those are written by Dream-B/C respectively (or by the user). ' +
|
|
252
|
+
'On overwrite of a normal note, `created` is preserved; `updated` is always set to now. ' +
|
|
253
|
+
'Stub-aware (Phase 4): if the slug is a stub (already promoted to the wiki, with frontmatter ' +
|
|
254
|
+
'`promoted_to`), this call appends the new content as a dated bullet under `## Recent ' +
|
|
255
|
+
'observations` instead of clobbering the stub. Dream-B will integrate those observations ' +
|
|
256
|
+
'into the wiki page on its next run.',
|
|
257
|
+
inputSchema: WriteInput,
|
|
258
|
+
jsonSchema: {
|
|
259
|
+
type: 'object',
|
|
260
|
+
properties: {
|
|
261
|
+
slug: {
|
|
262
|
+
type: 'string',
|
|
263
|
+
pattern: '^[a-z0-9][a-z0-9_-]*$',
|
|
264
|
+
description: 'File identifier — e.g. "auto", "apartment", "work-notes". Lowercase, no extension.',
|
|
265
|
+
},
|
|
266
|
+
content: {
|
|
267
|
+
type: 'string',
|
|
268
|
+
description:
|
|
269
|
+
'Markdown body (no YAML frontmatter — the tool manages that). ' +
|
|
270
|
+
'For stubs: a one-line observation appended to `## Recent observations`.',
|
|
271
|
+
},
|
|
272
|
+
frontmatter: {
|
|
273
|
+
type: 'object',
|
|
274
|
+
properties: {
|
|
275
|
+
description: { type: 'string', description: 'Short description (shown by memory_list).' },
|
|
276
|
+
tags: {
|
|
277
|
+
type: 'array',
|
|
278
|
+
items: { type: 'string' },
|
|
279
|
+
description: 'Tags for filtering.',
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
additionalProperties: true,
|
|
283
|
+
description: 'Optional. Any additional fields are persisted as-is. Ignored for stubs.',
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
required: ['slug', 'content'],
|
|
287
|
+
additionalProperties: false,
|
|
288
|
+
},
|
|
289
|
+
async handler(input, ctx) {
|
|
290
|
+
const mgr = await ctx.getMemoryManager();
|
|
291
|
+
const result = await mgr.writeNote(input.slug, input.content, input.frontmatter);
|
|
292
|
+
return {
|
|
293
|
+
slug: input.slug,
|
|
294
|
+
reference: `memory/${input.slug}`,
|
|
295
|
+
path: result.path,
|
|
296
|
+
created: result.created,
|
|
297
|
+
mode: result.mode,
|
|
298
|
+
};
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
// ── memory_edit ───────────────────────────────────────────────────────
|
|
303
|
+
|
|
304
|
+
const EditInput = z.object({
|
|
305
|
+
slug: SlugSchema,
|
|
306
|
+
content: z.string(),
|
|
307
|
+
frontmatter: FrontmatterSchema,
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
export const memoryEdit: ToolDefinition<z.infer<typeof EditInput>> = {
|
|
311
|
+
name: 'memory_edit',
|
|
312
|
+
toolset: 'memory',
|
|
313
|
+
description:
|
|
314
|
+
'Replace the content of an EXISTING memory note. Same shape as `memory_write`, ' +
|
|
315
|
+
'but fails if the note does not exist (prevents accidental creation from a typo in the slug). ' +
|
|
316
|
+
'To create a new note, use `memory_write` instead.',
|
|
317
|
+
inputSchema: EditInput,
|
|
318
|
+
jsonSchema: {
|
|
319
|
+
type: 'object',
|
|
320
|
+
properties: {
|
|
321
|
+
slug: {
|
|
322
|
+
type: 'string',
|
|
323
|
+
pattern: '^[a-z0-9][a-z0-9_-]*$',
|
|
324
|
+
description: 'Slug of the existing note to edit.',
|
|
325
|
+
},
|
|
326
|
+
content: {
|
|
327
|
+
type: 'string',
|
|
328
|
+
description: 'New full markdown body. Frontmatter is managed by the tool.',
|
|
329
|
+
},
|
|
330
|
+
frontmatter: {
|
|
331
|
+
type: 'object',
|
|
332
|
+
properties: {
|
|
333
|
+
description: { type: 'string' },
|
|
334
|
+
tags: { type: 'array', items: { type: 'string' } },
|
|
335
|
+
},
|
|
336
|
+
additionalProperties: true,
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
required: ['slug', 'content'],
|
|
340
|
+
additionalProperties: false,
|
|
341
|
+
},
|
|
342
|
+
async handler(input, ctx) {
|
|
343
|
+
const mgr = await ctx.getMemoryManager();
|
|
344
|
+
const result = await mgr.writeNote(input.slug, input.content, input.frontmatter, {
|
|
345
|
+
mustExist: true,
|
|
346
|
+
});
|
|
347
|
+
return {
|
|
348
|
+
slug: input.slug,
|
|
349
|
+
reference: `memory/${input.slug}`,
|
|
350
|
+
path: result.path,
|
|
351
|
+
};
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
// ── memory_delete ─────────────────────────────────────────────────────
|
|
356
|
+
|
|
357
|
+
const DeleteInput = z.object({
|
|
358
|
+
slug: SlugSchema,
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
export const memoryDelete: ToolDefinition<z.infer<typeof DeleteInput>> = {
|
|
362
|
+
name: 'memory_delete',
|
|
363
|
+
toolset: 'memory',
|
|
364
|
+
description:
|
|
365
|
+
'Delete one of your own memory notes. Cannot delete vault files via this tool. ' +
|
|
366
|
+
'Idempotent: returns deleted=false if the note does not (or no longer) exist.',
|
|
367
|
+
inputSchema: DeleteInput,
|
|
368
|
+
jsonSchema: {
|
|
369
|
+
type: 'object',
|
|
370
|
+
properties: {
|
|
371
|
+
slug: {
|
|
372
|
+
type: 'string',
|
|
373
|
+
pattern: '^[a-z0-9][a-z0-9_-]*$',
|
|
374
|
+
description: 'Slug of the note to delete.',
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
required: ['slug'],
|
|
378
|
+
additionalProperties: false,
|
|
379
|
+
},
|
|
380
|
+
async handler(input, ctx) {
|
|
381
|
+
const mgr = await ctx.getMemoryManager();
|
|
382
|
+
const deleted = await mgr.deleteNote(input.slug);
|
|
383
|
+
return {
|
|
384
|
+
slug: input.slug,
|
|
385
|
+
reference: `memory/${input.slug}`,
|
|
386
|
+
deleted,
|
|
387
|
+
};
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
// ── Bundle ────────────────────────────────────────────────────────────
|
|
392
|
+
|
|
393
|
+
export function memoryTools(): ToolDefinition[] {
|
|
394
|
+
// Cast widens each tool's narrow Zod-inferred input type to the registry's
|
|
395
|
+
// erased ToolDefinition<unknown>. The registry validates via the embedded
|
|
396
|
+
// Zod schema before invoking the handler, so type-safety isn't lost at
|
|
397
|
+
// runtime — we just need TypeScript to stop complaining about the bundle.
|
|
398
|
+
return [memorySearch, memoryGet, memoryList, memoryWrite, memoryEdit, memoryDelete] as ToolDefinition[];
|
|
399
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { projectTools } from './tools.ts';
|