@stackmemoryai/stackmemory 1.10.5 → 1.14.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.
- package/LICENSE +131 -64
- package/README.md +107 -24
- package/bin/claude-sm +16 -1
- package/bin/claude-smd +16 -1
- package/bin/codex-smd +16 -1
- package/bin/gemini-sm +16 -1
- package/bin/hermes-sm +21 -0
- package/bin/hermes-smd +21 -0
- package/bin/opencode-sm +16 -1
- package/dist/src/cli/claude-sm.js +266 -84
- package/dist/src/cli/codex-sm.js +225 -33
- package/dist/src/cli/commands/bench.js +209 -2
- package/dist/src/cli/commands/brain.js +206 -0
- package/dist/src/cli/commands/cache.js +126 -0
- package/dist/src/cli/commands/company-os.js +184 -0
- package/dist/src/cli/commands/context.js +5 -0
- package/dist/src/cli/commands/daemon.js +41 -0
- package/dist/src/cli/commands/handoff.js +40 -9
- package/dist/src/cli/commands/onboard.js +70 -3
- package/dist/src/cli/commands/operator.js +127 -0
- package/dist/src/cli/commands/optimize.js +117 -0
- package/dist/src/cli/commands/orchestrate.js +232 -5
- package/dist/src/cli/commands/orchestrator.js +315 -26
- package/dist/src/cli/commands/pack.js +322 -0
- package/dist/src/cli/commands/patterns.js +254 -0
- package/dist/src/cli/commands/portal.js +161 -0
- package/dist/src/cli/commands/scaffold.js +92 -0
- package/dist/src/cli/commands/search.js +40 -1
- package/dist/src/cli/commands/setup.js +178 -11
- package/dist/src/cli/commands/skills.js +10 -1
- package/dist/src/cli/commands/state.js +265 -0
- package/dist/src/cli/commands/sync.js +253 -0
- package/dist/src/cli/commands/tasks.js +130 -1
- package/dist/src/cli/commands/vision.js +221 -0
- package/dist/src/cli/gemini-sm.js +19 -29
- package/dist/src/cli/hermes-sm.js +224 -0
- package/dist/src/cli/index.js +105 -39
- package/dist/src/cli/opencode-sm.js +38 -21
- package/dist/src/cli/utils/determinism-watcher.js +66 -0
- package/dist/src/cli/utils/real-cli-bin.js +116 -0
- package/dist/src/core/brain/brain-store.js +187 -0
- package/dist/src/core/brain/brain-sync.js +193 -0
- package/dist/src/core/brain/index.js +78 -0
- package/dist/src/core/brain/types.js +10 -0
- package/dist/src/core/cache/content-cache.js +238 -0
- package/dist/src/{integrations/diffmem → core/cache}/index.js +5 -5
- package/dist/src/core/cache/token-estimator.js +39 -0
- package/dist/src/core/config/feature-flags.js +2 -6
- package/dist/src/core/context/frame-database.js +79 -27
- package/dist/src/core/context/recursive-context-manager.js +1 -1
- package/dist/src/core/context/rehydration.js +2 -1
- package/dist/src/core/cross-search/cross-project-search.js +269 -0
- package/dist/src/core/cross-search/index.js +10 -0
- package/dist/src/core/database/sqlite-adapter.js +14 -84
- package/dist/src/core/extensions/provider-adapter.js +5 -0
- package/dist/src/core/models/model-router.js +54 -2
- package/dist/src/core/models/provider-pricing.js +58 -4
- package/dist/src/core/monitoring/logger.js +2 -1
- package/dist/src/core/optimization/trace-optimizer.js +413 -0
- package/dist/src/core/patterns/index.js +22 -0
- package/dist/src/core/patterns/pattern-applier.js +39 -0
- package/dist/src/core/patterns/pattern-observer.js +157 -0
- package/dist/src/core/patterns/pattern-store.js +259 -0
- package/dist/src/core/patterns/types.js +19 -0
- package/dist/src/core/provenance/confidence-scorer.js +128 -0
- package/dist/src/core/provenance/index.js +40 -0
- package/dist/src/core/provenance/provenance-store.js +194 -0
- package/dist/src/core/provenance/types.js +82 -0
- package/dist/src/core/retrieval/llm-context-retrieval.js +5 -4
- package/dist/src/core/retrieval/unified-context-assembler.js +11 -66
- package/dist/src/core/session/project-handoff.js +64 -0
- package/dist/src/core/session/session-manager.js +28 -0
- package/dist/src/core/shared-state/canonical-store.js +564 -0
- package/dist/src/core/skill-packs/index.js +18 -0
- package/dist/src/core/skill-packs/parser.js +42 -0
- package/dist/src/core/skill-packs/registry.js +224 -0
- package/dist/src/core/skill-packs/types.js +79 -0
- package/dist/src/core/storage/cloud-sync-manager.js +116 -0
- package/dist/src/core/storage/cloud-sync.js +574 -0
- package/dist/src/core/storage/two-tier-storage.js +5 -1
- package/dist/src/core/tasks/master-tasks-template.js +43 -0
- package/dist/src/core/tasks/md-task-parser.js +138 -0
- package/dist/src/core/trace/trace-event-store.js +282 -0
- package/dist/src/core/vision/index.js +27 -0
- package/dist/src/core/vision/signals.js +79 -0
- package/dist/src/core/vision/types.js +22 -0
- package/dist/src/core/vision/vision-file.js +146 -0
- package/dist/src/core/vision/vision-loop.js +220 -0
- package/dist/src/core/wiki/wiki-compiler.js +103 -1
- package/dist/src/daemon/daemon-config.js +52 -0
- package/dist/src/daemon/services/desire-path-service.js +566 -0
- package/dist/src/daemon/services/github-service.js +126 -0
- package/dist/src/daemon/services/research-stream-service.js +320 -0
- package/dist/src/daemon/services/telemetry-service.js +192 -0
- package/dist/src/daemon/unified-daemon.js +58 -1
- package/dist/src/features/browser/cli-browser-agent.js +417 -0
- package/dist/src/features/browser/stagehand-workflows.js +578 -0
- package/dist/src/features/operator/adapter-factory.js +62 -0
- package/dist/src/features/operator/browser-adapter.js +109 -0
- package/dist/src/features/operator/desktop-adapter.js +125 -0
- package/dist/src/features/operator/index.js +39 -0
- package/dist/src/features/operator/llm-decision.js +137 -0
- package/dist/src/features/operator/operator-logger.js +92 -0
- package/dist/src/features/operator/overnight-runner.js +327 -0
- package/dist/src/features/operator/screen-adapter.js +91 -0
- package/dist/src/features/operator/session-manager.js +127 -0
- package/dist/src/features/operator/state-machine.js +227 -0
- package/dist/src/features/operator/task-queue.js +81 -0
- package/dist/src/features/portal/index.js +26 -0
- package/dist/src/features/portal/server.js +240 -0
- package/dist/src/features/portal/types.js +14 -0
- package/dist/src/features/portal/ui.js +195 -0
- package/dist/src/features/sweep/pty-wrapper.js +13 -5
- package/dist/src/features/tasks/task-aware-context.js +2 -1
- package/dist/src/features/tui/simple-monitor.js +0 -23
- package/dist/src/features/tui/swarm-monitor.js +8 -66
- package/dist/src/features/web/client/hooks/use-socket.js +12 -0
- package/dist/src/{core/merge/index.js → features/web/client/lib/utils.js} +8 -4
- package/dist/src/features/web/client/next-env.d.js +4 -0
- package/dist/src/features/web/client/stores/session-store.js +12 -0
- package/dist/src/features/web/server/gcp-billing.js +76 -0
- package/dist/src/features/web/server/index.js +10 -0
- package/dist/src/features/web/server/spend-calculator.js +228 -0
- package/dist/src/hooks/schemas.js +6 -1
- package/dist/src/integrations/anthropic/client.js +3 -2
- package/dist/src/integrations/claude-code/agent-bridge.js +0 -3
- package/dist/src/integrations/claude-code/subagent-client.js +307 -11
- package/dist/src/integrations/claude-code/task-coordinator.js +2 -1
- package/dist/src/integrations/github/pr-state.js +158 -0
- package/dist/src/integrations/linear/client.js +4 -1
- package/dist/src/integrations/linear/webhook-retry.js +196 -0
- package/dist/src/integrations/linear/webhook-server.js +18 -22
- package/dist/src/integrations/mcp/handlers/cloud-sync-handlers.js +101 -0
- package/dist/src/integrations/mcp/handlers/index.js +40 -84
- package/dist/src/integrations/mcp/server.js +542 -641
- package/dist/src/integrations/mcp/tool-alias-registry.js +297 -0
- package/dist/src/integrations/mcp/tool-definitions.js +152 -682
- package/dist/src/mcp/stackmemory-mcp-server.js +571 -231
- package/dist/src/orchestrators/multimodal/determinism.js +244 -0
- package/dist/src/orchestrators/multimodal/harness.js +149 -78
- package/dist/src/orchestrators/multimodal/providers.js +44 -3
- package/dist/src/skills/recursive-agent-orchestrator.js +2 -4
- package/dist/src/utils/hook-installer.js +0 -8
- package/dist/src/utils/process-cleanup.js +1 -7
- package/docs/README.md +42 -0
- package/docs/guides/README_INSTALL.md +208 -0
- package/package.json +27 -9
- package/packs/coding/python-fastapi/instructions.md +60 -0
- package/packs/coding/python-fastapi/pack.yaml +28 -0
- package/packs/coding/typescript-react/instructions.md +47 -0
- package/packs/coding/typescript-react/pack.yaml +28 -0
- package/packs/core/commands/capture.md +32 -0
- package/packs/core/commands/learn.md +73 -0
- package/packs/core/commands/next.md +36 -0
- package/packs/core/commands/restart.md +58 -0
- package/packs/core/commands/restore.md +29 -0
- package/packs/core/commands/start.md +57 -0
- package/packs/core/commands/stop.md +65 -0
- package/packs/core/commands/summary.md +40 -0
- package/packs/core/manifest.json +24 -0
- package/packs/ops/decision-recovery/instructions.md +65 -0
- package/packs/ops/decision-recovery/pack.yaml +89 -0
- package/scripts/claude-code-wrapper.sh +11 -0
- package/scripts/claude-sm-setup.sh +12 -1
- package/scripts/codex-wrapper.sh +11 -0
- package/scripts/git-hooks/branch-context-manager.sh +11 -0
- package/scripts/git-hooks/post-checkout-stackmemory.sh +11 -0
- package/scripts/git-hooks/post-commit-stackmemory.sh +11 -0
- package/scripts/git-hooks/pre-commit-stackmemory.sh +11 -0
- package/scripts/hooks/cleanup-shell.sh +12 -1
- package/scripts/hooks/task-complete.sh +12 -1
- package/scripts/install-code-execution-hooks.sh +12 -1
- package/scripts/install-sweep-hook.sh +12 -0
- package/scripts/install.sh +11 -0
- package/scripts/opencode-wrapper.sh +11 -0
- package/scripts/portal/cloud-init.yaml +69 -0
- package/scripts/portal/setup.sh +69 -0
- package/scripts/portal/stackmemory-portal.service +34 -0
- package/scripts/setup-claude-integration.sh +12 -1
- package/scripts/smoke-init-db.sh +23 -0
- package/scripts/stackmemory-daemon.sh +11 -0
- package/scripts/verify-dist.cjs +11 -4
- package/dist/src/cli/commands/ralph.js +0 -1053
- package/dist/src/cli/commands/team.js +0 -168
- package/dist/src/core/context/shared-context-layer.js +0 -620
- package/dist/src/core/context/stack-merge-resolver.js +0 -748
- package/dist/src/core/merge/conflict-detector.js +0 -430
- package/dist/src/core/merge/resolution-engine.js +0 -557
- package/dist/src/core/merge/stack-diff.js +0 -531
- package/dist/src/core/merge/unified-merge-resolver.js +0 -302
- package/dist/src/hooks/diffmem-hooks.js +0 -376
- package/dist/src/integrations/diffmem/client.js +0 -208
- package/dist/src/integrations/diffmem/config.js +0 -14
- package/dist/src/integrations/greptile/client.js +0 -101
- package/dist/src/integrations/greptile/config.js +0 -14
- package/dist/src/integrations/greptile/index.js +0 -11
- package/dist/src/integrations/mcp/handlers/cord-handlers.js +0 -397
- package/dist/src/integrations/mcp/handlers/diffmem-handlers.js +0 -455
- package/dist/src/integrations/mcp/handlers/greptile-handlers.js +0 -456
- package/dist/src/integrations/mcp/handlers/provider-handlers.js +0 -227
- package/dist/src/integrations/mcp/handlers/team-handlers.js +0 -211
- package/dist/src/integrations/ralph/bridge/ralph-stackmemory-bridge.js +0 -863
- package/dist/src/integrations/ralph/context/context-budget-manager.js +0 -308
- package/dist/src/integrations/ralph/context/stackmemory-context-loader.js +0 -391
- package/dist/src/integrations/ralph/index.js +0 -17
- package/dist/src/integrations/ralph/learning/pattern-learner.js +0 -435
- package/dist/src/integrations/ralph/lifecycle/iteration-lifecycle.js +0 -448
- package/dist/src/integrations/ralph/loopmax.js +0 -488
- package/dist/src/integrations/ralph/monitoring/swarm-dashboard.js +0 -293
- package/dist/src/integrations/ralph/monitoring/swarm-registry.js +0 -107
- package/dist/src/integrations/ralph/orchestration/multi-loop-orchestrator.js +0 -508
- package/dist/src/integrations/ralph/patterns/compounding-engineering-pattern.js +0 -407
- package/dist/src/integrations/ralph/patterns/extended-coherence-sessions.js +0 -495
- package/dist/src/integrations/ralph/patterns/oracle-worker-pattern.js +0 -387
- package/dist/src/integrations/ralph/performance/performance-optimizer.js +0 -357
- package/dist/src/integrations/ralph/recovery/crash-recovery.js +0 -461
- package/dist/src/integrations/ralph/state/state-reconciler.js +0 -420
- package/dist/src/integrations/ralph/swarm/git-workflow-manager.js +0 -444
- package/dist/src/integrations/ralph/swarm/swarm-coordinator.js +0 -1007
- package/dist/src/integrations/ralph/visualization/ralph-debugger.js +0 -635
- package/scripts/ralph-loop-implementation.js +0 -404
- /package/dist/src/core/{merge → cache}/types.js +0 -0
- /package/dist/src/{integrations/diffmem/types.js → core/storage/cloud-sync-types.js} +0 -0
- /package/dist/src/{integrations/greptile/types.js → core/trace/trace-event.js} +0 -0
- /package/dist/src/{integrations/ralph → features/operator}/types.js +0 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
2
|
+
import { dirname as __pathDirname } from 'path';
|
|
3
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
4
|
+
const __dirname = __pathDirname(__filename);
|
|
5
|
+
const TOOL_ALIASES = {
|
|
6
|
+
// --- Context tools ---
|
|
7
|
+
context: "get_context",
|
|
8
|
+
get_ctx: "get_context",
|
|
9
|
+
sm_context: "get_context",
|
|
10
|
+
sm_get_context: "get_context",
|
|
11
|
+
fetch_context: "get_context",
|
|
12
|
+
read_context: "get_context",
|
|
13
|
+
record_decision: "add_decision",
|
|
14
|
+
log_decision: "add_decision",
|
|
15
|
+
save_decision: "add_decision",
|
|
16
|
+
sm_decision: "add_decision",
|
|
17
|
+
push_frame: "start_frame",
|
|
18
|
+
open_frame: "start_frame",
|
|
19
|
+
begin_frame: "start_frame",
|
|
20
|
+
new_frame: "start_frame",
|
|
21
|
+
pop_frame: "close_frame",
|
|
22
|
+
end_frame: "close_frame",
|
|
23
|
+
finish_frame: "close_frame",
|
|
24
|
+
anchor: "add_anchor",
|
|
25
|
+
sm_anchor: "add_anchor",
|
|
26
|
+
save_anchor: "add_anchor",
|
|
27
|
+
hot_stack: "get_hot_stack",
|
|
28
|
+
stack: "get_hot_stack",
|
|
29
|
+
sm_stack: "get_hot_stack",
|
|
30
|
+
// --- Task tools ---
|
|
31
|
+
new_task: "create_task",
|
|
32
|
+
add_task: "create_task",
|
|
33
|
+
sm_task: "create_task",
|
|
34
|
+
sm_create_task: "create_task",
|
|
35
|
+
update_task: "update_task_status",
|
|
36
|
+
set_task_status: "update_task_status",
|
|
37
|
+
task_update: "update_task_status",
|
|
38
|
+
list_tasks: "get_active_tasks",
|
|
39
|
+
tasks: "get_active_tasks",
|
|
40
|
+
sm_tasks: "get_active_tasks",
|
|
41
|
+
active_tasks: "get_active_tasks",
|
|
42
|
+
task_metrics: "get_task_metrics",
|
|
43
|
+
metrics: "get_task_metrics",
|
|
44
|
+
// --- Search & Discovery ---
|
|
45
|
+
sm_context_search: "sm_search",
|
|
46
|
+
search: "sm_search",
|
|
47
|
+
context_search: "sm_search",
|
|
48
|
+
sm_find: "sm_search",
|
|
49
|
+
find: "sm_search",
|
|
50
|
+
discover: "sm_discover",
|
|
51
|
+
sm_explore: "sm_discover",
|
|
52
|
+
explore: "sm_discover",
|
|
53
|
+
related: "sm_related_files",
|
|
54
|
+
find_related: "sm_related_files",
|
|
55
|
+
session_summary: "sm_session_summary",
|
|
56
|
+
summary: "sm_session_summary",
|
|
57
|
+
// --- Save/Load context (old MCP server) ---
|
|
58
|
+
sm_save: "save_context",
|
|
59
|
+
sm_context_save: "save_context",
|
|
60
|
+
store_context: "save_context",
|
|
61
|
+
sm_load: "load_context",
|
|
62
|
+
sm_context_load: "load_context",
|
|
63
|
+
retrieve_context: "load_context",
|
|
64
|
+
// --- Linear tools ---
|
|
65
|
+
linear_issues: "linear_get_tasks",
|
|
66
|
+
linear_list: "linear_get_tasks",
|
|
67
|
+
get_linear_tasks: "linear_get_tasks",
|
|
68
|
+
linear_update: "linear_update_task",
|
|
69
|
+
update_linear: "linear_update_task",
|
|
70
|
+
linear_comment: "linear_create_comment",
|
|
71
|
+
comment_on_issue: "linear_create_comment",
|
|
72
|
+
linear_comments: "linear_list_comments",
|
|
73
|
+
// --- Trace tools ---
|
|
74
|
+
traces: "get_traces",
|
|
75
|
+
sm_traces: "get_traces",
|
|
76
|
+
list_traces: "get_traces",
|
|
77
|
+
trace_stats: "get_trace_statistics",
|
|
78
|
+
trace_statistics: "get_trace_statistics",
|
|
79
|
+
// --- Smart context ---
|
|
80
|
+
smart: "smart_context",
|
|
81
|
+
sm_smart: "smart_context",
|
|
82
|
+
intelligent_context: "smart_context",
|
|
83
|
+
sm_summary: "get_summary",
|
|
84
|
+
project_summary: "get_summary",
|
|
85
|
+
// --- Planning tools ---
|
|
86
|
+
// --- Pending tools ---
|
|
87
|
+
pending: "pending_list",
|
|
88
|
+
list_pending: "pending_list",
|
|
89
|
+
clear_pending: "pending_clear",
|
|
90
|
+
show_pending: "pending_show",
|
|
91
|
+
// --- Edit tools ---
|
|
92
|
+
fuzzy_edit: "sm_edit",
|
|
93
|
+
edit: "sm_edit",
|
|
94
|
+
sm_fuzzy_edit: "sm_edit",
|
|
95
|
+
// --- Digest tools ---
|
|
96
|
+
digest: "sm_digest",
|
|
97
|
+
activity_digest: "sm_digest",
|
|
98
|
+
daily_digest: "sm_digest",
|
|
99
|
+
// --- Desire paths ---
|
|
100
|
+
desire_paths: "sm_desire_paths",
|
|
101
|
+
desires: "sm_desire_paths",
|
|
102
|
+
failed_tools: "sm_desire_paths",
|
|
103
|
+
// --- Provenant tools ---
|
|
104
|
+
decision_search: "provenant_search",
|
|
105
|
+
search_decisions: "provenant_search",
|
|
106
|
+
log_decision_graph: "provenant_log",
|
|
107
|
+
decision_log: "provenant_log",
|
|
108
|
+
decision_status: "provenant_status",
|
|
109
|
+
graph_status: "provenant_status",
|
|
110
|
+
contradictions: "provenant_contradictions",
|
|
111
|
+
conflicts: "provenant_contradictions",
|
|
112
|
+
resolve: "provenant_resolve",
|
|
113
|
+
resolve_contradiction: "provenant_resolve"
|
|
114
|
+
};
|
|
115
|
+
const PARAM_ALIASES = {
|
|
116
|
+
// Agents often send `query` for search-like tools
|
|
117
|
+
sm_search: {
|
|
118
|
+
search_term: "query",
|
|
119
|
+
search: "query",
|
|
120
|
+
text: "query",
|
|
121
|
+
q: "query",
|
|
122
|
+
max: "limit",
|
|
123
|
+
max_results: "limit",
|
|
124
|
+
count: "limit"
|
|
125
|
+
},
|
|
126
|
+
sm_discover: {
|
|
127
|
+
search: "query",
|
|
128
|
+
q: "query",
|
|
129
|
+
search_query: "query",
|
|
130
|
+
max: "maxFiles",
|
|
131
|
+
max_files: "maxFiles",
|
|
132
|
+
limit: "maxFiles",
|
|
133
|
+
include: "includePatterns",
|
|
134
|
+
exclude: "excludePatterns"
|
|
135
|
+
},
|
|
136
|
+
get_context: {
|
|
137
|
+
search: "query",
|
|
138
|
+
q: "query",
|
|
139
|
+
text: "query",
|
|
140
|
+
max: "limit",
|
|
141
|
+
max_results: "limit",
|
|
142
|
+
count: "limit"
|
|
143
|
+
},
|
|
144
|
+
smart_context: {
|
|
145
|
+
search: "query",
|
|
146
|
+
q: "query",
|
|
147
|
+
tokens: "tokenBudget",
|
|
148
|
+
token_budget: "tokenBudget",
|
|
149
|
+
max_tokens: "tokenBudget",
|
|
150
|
+
budget: "tokenBudget",
|
|
151
|
+
refresh: "forceRefresh",
|
|
152
|
+
force: "forceRefresh"
|
|
153
|
+
},
|
|
154
|
+
get_active_tasks: {
|
|
155
|
+
state: "status",
|
|
156
|
+
max: "limit",
|
|
157
|
+
max_results: "limit",
|
|
158
|
+
count: "limit",
|
|
159
|
+
query: "search",
|
|
160
|
+
q: "search"
|
|
161
|
+
},
|
|
162
|
+
linear_get_tasks: {
|
|
163
|
+
status: "state",
|
|
164
|
+
max: "limit",
|
|
165
|
+
max_results: "limit",
|
|
166
|
+
count: "limit",
|
|
167
|
+
q: "search",
|
|
168
|
+
query: "search",
|
|
169
|
+
team: "team_id",
|
|
170
|
+
assignee: "assignee_id"
|
|
171
|
+
},
|
|
172
|
+
add_decision: {
|
|
173
|
+
text: "content",
|
|
174
|
+
decision: "content",
|
|
175
|
+
value: "content",
|
|
176
|
+
kind: "type",
|
|
177
|
+
category: "type"
|
|
178
|
+
},
|
|
179
|
+
add_anchor: {
|
|
180
|
+
content: "text",
|
|
181
|
+
value: "text",
|
|
182
|
+
anchor: "text",
|
|
183
|
+
kind: "type",
|
|
184
|
+
category: "type",
|
|
185
|
+
importance: "priority",
|
|
186
|
+
weight: "priority"
|
|
187
|
+
},
|
|
188
|
+
start_frame: {
|
|
189
|
+
title: "name",
|
|
190
|
+
goal: "name",
|
|
191
|
+
label: "name",
|
|
192
|
+
kind: "type",
|
|
193
|
+
frame_type: "type"
|
|
194
|
+
},
|
|
195
|
+
create_task: {
|
|
196
|
+
name: "title",
|
|
197
|
+
goal: "title",
|
|
198
|
+
label: "title",
|
|
199
|
+
desc: "description",
|
|
200
|
+
detail: "description",
|
|
201
|
+
details: "description"
|
|
202
|
+
},
|
|
203
|
+
sm_desire_paths: {
|
|
204
|
+
type: "category",
|
|
205
|
+
kind: "category",
|
|
206
|
+
max: "limit",
|
|
207
|
+
max_results: "limit",
|
|
208
|
+
lookback: "days",
|
|
209
|
+
period: "days"
|
|
210
|
+
},
|
|
211
|
+
provenant_search: {
|
|
212
|
+
text: "query",
|
|
213
|
+
search: "query",
|
|
214
|
+
q: "query",
|
|
215
|
+
max: "limit",
|
|
216
|
+
max_results: "limit",
|
|
217
|
+
from: "since",
|
|
218
|
+
after: "since",
|
|
219
|
+
by: "actor",
|
|
220
|
+
who: "actor"
|
|
221
|
+
},
|
|
222
|
+
provenant_log: {
|
|
223
|
+
decision: "content",
|
|
224
|
+
text: "content",
|
|
225
|
+
value: "content",
|
|
226
|
+
by: "actor",
|
|
227
|
+
who: "actor",
|
|
228
|
+
why: "reasoning",
|
|
229
|
+
reason: "reasoning",
|
|
230
|
+
rationale: "reasoning"
|
|
231
|
+
},
|
|
232
|
+
sm_edit: {
|
|
233
|
+
path: "file_path",
|
|
234
|
+
file: "file_path",
|
|
235
|
+
find: "old_string",
|
|
236
|
+
search: "old_string",
|
|
237
|
+
replace: "new_string",
|
|
238
|
+
replacement: "new_string"
|
|
239
|
+
},
|
|
240
|
+
sm_digest: {
|
|
241
|
+
time: "period",
|
|
242
|
+
range: "period",
|
|
243
|
+
timeframe: "period"
|
|
244
|
+
},
|
|
245
|
+
get_summary: {
|
|
246
|
+
refresh: "forceRefresh",
|
|
247
|
+
force: "forceRefresh"
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
function resolveToolAlias(name) {
|
|
251
|
+
const alias = TOOL_ALIASES[name];
|
|
252
|
+
if (alias) {
|
|
253
|
+
return { canonicalName: alias, wasAlias: true, originalName: name };
|
|
254
|
+
}
|
|
255
|
+
return { canonicalName: name, wasAlias: false, originalName: name };
|
|
256
|
+
}
|
|
257
|
+
function resolveParamAliases(toolName, params) {
|
|
258
|
+
const aliases = PARAM_ALIASES[toolName];
|
|
259
|
+
if (!aliases) {
|
|
260
|
+
return { resolvedParams: { ...params }, renames: {} };
|
|
261
|
+
}
|
|
262
|
+
const resolved = {};
|
|
263
|
+
const renames = {};
|
|
264
|
+
for (const [key, value] of Object.entries(params)) {
|
|
265
|
+
if (!aliases[key]) {
|
|
266
|
+
resolved[key] = value;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
for (const [key, value] of Object.entries(params)) {
|
|
270
|
+
const canonicalKey = aliases[key];
|
|
271
|
+
if (canonicalKey && !(canonicalKey in resolved)) {
|
|
272
|
+
resolved[canonicalKey] = value;
|
|
273
|
+
renames[key] = canonicalKey;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return { resolvedParams: resolved, renames };
|
|
277
|
+
}
|
|
278
|
+
function getAliasesForTool(canonicalName) {
|
|
279
|
+
return Object.entries(TOOL_ALIASES).filter(([, target]) => target === canonicalName).map(([alias]) => alias);
|
|
280
|
+
}
|
|
281
|
+
function getToolsWithAliases() {
|
|
282
|
+
return Array.from(new Set(Object.values(TOOL_ALIASES)));
|
|
283
|
+
}
|
|
284
|
+
function getAliasRegistry() {
|
|
285
|
+
return TOOL_ALIASES;
|
|
286
|
+
}
|
|
287
|
+
function getParamAliasRegistry() {
|
|
288
|
+
return PARAM_ALIASES;
|
|
289
|
+
}
|
|
290
|
+
export {
|
|
291
|
+
getAliasRegistry,
|
|
292
|
+
getAliasesForTool,
|
|
293
|
+
getParamAliasRegistry,
|
|
294
|
+
getToolsWithAliases,
|
|
295
|
+
resolveParamAliases,
|
|
296
|
+
resolveToolAlias
|
|
297
|
+
};
|