@namzu/cli 26.3.0 → 28.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +271 -0
- package/README.md +67 -46
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -1
- package/dist/checkpoints/store.d.ts +17 -4
- package/dist/checkpoints/store.d.ts.map +1 -1
- package/dist/checkpoints/store.js +20 -5
- package/dist/checkpoints/store.js.map +1 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +124 -14
- package/dist/cli.js.map +1 -1
- package/dist/commands/acp.d.ts +23 -1
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/acp.js +41 -2
- package/dist/commands/acp.js.map +1 -1
- package/dist/commands/drain.d.ts +69 -2
- package/dist/commands/drain.d.ts.map +1 -1
- package/dist/commands/drain.js +216 -136
- package/dist/commands/drain.js.map +1 -1
- package/dist/commands/eval.js +1 -1
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/{run-flags.d.ts → exec-flags.d.ts} +36 -28
- package/dist/commands/exec-flags.d.ts.map +1 -0
- package/dist/commands/{run-flags.js → exec-flags.js} +35 -27
- package/dist/commands/exec-flags.js.map +1 -0
- package/dist/commands/exec-json.d.ts +75 -0
- package/dist/commands/exec-json.d.ts.map +1 -0
- package/dist/commands/exec-json.js +473 -0
- package/dist/commands/exec-json.js.map +1 -0
- package/dist/commands/exec.d.ts +42 -0
- package/dist/commands/exec.d.ts.map +1 -0
- package/dist/commands/exec.js +683 -0
- package/dist/commands/exec.js.map +1 -0
- package/dist/commands/host-queries.d.ts +12 -0
- package/dist/commands/host-queries.d.ts.map +1 -0
- package/dist/commands/host-queries.js +149 -0
- package/dist/commands/host-queries.js.map +1 -0
- package/dist/commands/prior-messages.js +1 -1
- package/dist/commands/prior-messages.js.map +1 -1
- package/dist/commands/provider-wait.d.ts +5 -5
- package/dist/commands/provider-wait.d.ts.map +1 -1
- package/dist/commands/provider-wait.js +2 -2
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +2 -0
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/resident-flags.d.ts +2 -2
- package/dist/commands/resident-flags.d.ts.map +1 -1
- package/dist/commands/resident-flags.js +4 -2
- package/dist/commands/resident-flags.js.map +1 -1
- package/dist/commands/resident-learning.js +1 -1
- package/dist/commands/resident-learning.js.map +1 -1
- package/dist/commands/resident.d.ts.map +1 -1
- package/dist/commands/resident.js +3 -2
- package/dist/commands/resident.js.map +1 -1
- package/dist/commands/serve.js +2 -2
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/skills.js +1 -1
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/state.js +8 -8
- package/dist/commands/state.js.map +1 -1
- package/dist/commands/stdin.d.ts +5 -5
- package/dist/commands/stdin.js +5 -5
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/config/load.d.ts +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +36 -5
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +59 -20
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/config/tool-result-screens.js +1 -1
- package/dist/config/turn-guards.d.ts +23 -0
- package/dist/config/turn-guards.d.ts.map +1 -0
- package/dist/config/turn-guards.js +46 -0
- package/dist/config/turn-guards.js.map +1 -0
- package/dist/context/directories.d.ts +37 -0
- package/dist/context/directories.d.ts.map +1 -0
- package/dist/context/directories.js +69 -0
- package/dist/context/directories.js.map +1 -0
- package/dist/context/environment.d.ts +55 -0
- package/dist/context/environment.d.ts.map +1 -1
- package/dist/context/environment.js +96 -0
- package/dist/context/environment.js.map +1 -1
- package/dist/context/project-tracker.d.ts +3 -3
- package/dist/context/project-tracker.d.ts.map +1 -1
- package/dist/context/project-tracker.js +3 -3
- package/dist/context/project-tracker.js.map +1 -1
- package/dist/context/project.d.ts +2 -2
- package/dist/context/project.js +2 -2
- package/dist/context/sandbox.d.ts +22 -3
- package/dist/context/sandbox.d.ts.map +1 -1
- package/dist/context/sandbox.js +42 -4
- package/dist/context/sandbox.js.map +1 -1
- package/dist/doctor/checks/chain.d.ts +1 -1
- package/dist/doctor/checks/chain.js +7 -7
- package/dist/doctor/checks/chain.js.map +1 -1
- package/dist/doctor/checks/invariants.d.ts +2 -2
- package/dist/doctor/checks/invariants.js +5 -5
- package/dist/doctor/checks/invariants.js.map +1 -1
- package/dist/doctor/checks/logging.js +1 -1
- package/dist/doctor/checks/logging.js.map +1 -1
- package/dist/doctor/checks/sandbox.js +1 -1
- package/dist/doctor/checks/sandbox.js.map +1 -1
- package/dist/doctor/checks/session-export.d.ts +1 -1
- package/dist/doctor/checks/session-export.js +2 -2
- package/dist/doctor/checks/session-export.js.map +1 -1
- package/dist/doctor/checks/telemetry.d.ts +1 -1
- package/dist/doctor/checks/telemetry.js +1 -1
- package/dist/doctor/registry.js +2 -2
- package/dist/doctor/registry.js.map +1 -1
- package/dist/exit-codes.d.ts +2 -2
- package/dist/exit-codes.js +2 -2
- package/dist/integrations/mcp/servers.d.ts +1 -1
- package/dist/integrations/providers/access.d.ts +4 -1
- package/dist/integrations/providers/access.d.ts.map +1 -1
- package/dist/integrations/providers/access.js +6 -3
- package/dist/integrations/providers/access.js.map +1 -1
- package/dist/integrations/providers/chain-capabilities.d.ts +6 -6
- package/dist/integrations/providers/chain-capabilities.js +8 -8
- package/dist/integrations/providers/chain-capabilities.js.map +1 -1
- package/dist/integrations/providers/register.d.ts +1 -1
- package/dist/integrations/providers/register.js +1 -1
- package/dist/integrations/providers/registry.d.ts +1 -1
- package/dist/integrations/providers/zen-catalogue.d.ts +100 -0
- package/dist/integrations/providers/zen-catalogue.d.ts.map +1 -0
- package/dist/integrations/providers/zen-catalogue.js +196 -0
- package/dist/integrations/providers/zen-catalogue.js.map +1 -0
- package/dist/integrations/resident/inspection.d.ts +4 -1
- package/dist/integrations/resident/inspection.d.ts.map +1 -1
- package/dist/integrations/resident/inspection.js +53 -34
- package/dist/integrations/resident/inspection.js.map +1 -1
- package/dist/integrations/resident/learning-storage.d.ts +7 -2
- package/dist/integrations/resident/learning-storage.d.ts.map +1 -1
- package/dist/integrations/resident/learning-storage.js +12 -8
- package/dist/integrations/resident/learning-storage.js.map +1 -1
- package/dist/integrations/resident/runner-launch.d.ts +3 -3
- package/dist/integrations/resident/runner-launch.d.ts.map +1 -1
- package/dist/integrations/resident/runner-store.d.ts +1 -1
- package/dist/integrations/resident/runner-store.d.ts.map +1 -1
- package/dist/integrations/resident/runner-store.js +5 -2
- package/dist/integrations/resident/runner-store.js.map +1 -1
- package/dist/integrations/resident/runner-worker.js +23 -0
- package/dist/integrations/resident/runner-worker.js.map +1 -1
- package/dist/integrations/resident/session-log-reads.d.ts +37 -0
- package/dist/integrations/resident/session-log-reads.d.ts.map +1 -0
- package/dist/integrations/resident/session-log-reads.js +125 -0
- package/dist/integrations/resident/session-log-reads.js.map +1 -0
- package/dist/integrations/resident/session-step.d.ts +4 -2
- package/dist/integrations/resident/session-step.d.ts.map +1 -1
- package/dist/integrations/resident/session-step.js +16 -14
- package/dist/integrations/resident/session-step.js.map +1 -1
- package/dist/integrations/resident/storage.d.ts +23 -1
- package/dist/integrations/resident/storage.d.ts.map +1 -1
- package/dist/integrations/resident/storage.js +60 -17
- package/dist/integrations/resident/storage.js.map +1 -1
- package/dist/integrations/resident/tool-evidence.d.ts +4 -2
- package/dist/integrations/resident/tool-evidence.d.ts.map +1 -1
- package/dist/integrations/resident/tool-evidence.js +36 -30
- package/dist/integrations/resident/tool-evidence.js.map +1 -1
- package/dist/integrations/resident/verification.d.ts +2 -2
- package/dist/integrations/resident/verification.d.ts.map +1 -1
- package/dist/integrations/resident/verification.js +4 -4
- package/dist/integrations/resident/verification.js.map +1 -1
- package/dist/integrations/sessions/checkpoint-view.d.ts +13 -0
- package/dist/integrations/sessions/checkpoint-view.d.ts.map +1 -0
- package/dist/integrations/sessions/checkpoint-view.js +48 -0
- package/dist/integrations/sessions/checkpoint-view.js.map +1 -0
- package/dist/integrations/sessions/context-inventory.js +1 -1
- package/dist/integrations/sessions/context-inventory.js.map +1 -1
- package/dist/integrations/sessions/conversation-search.d.ts +16 -20
- package/dist/integrations/sessions/conversation-search.d.ts.map +1 -1
- package/dist/integrations/sessions/conversation-search.js +305 -731
- package/dist/integrations/sessions/conversation-search.js.map +1 -1
- package/dist/integrations/sessions/evidence-page-validation.d.ts +4 -4
- package/dist/integrations/sessions/evidence-page-validation.d.ts.map +1 -1
- package/dist/integrations/sessions/evidence-page-validation.js +1 -1
- package/dist/integrations/sessions/evidence-page-validation.js.map +1 -1
- package/dist/integrations/sessions/evidence-recall.d.ts +40 -2
- package/dist/integrations/sessions/evidence-recall.d.ts.map +1 -1
- package/dist/integrations/sessions/evidence-recall.js +41 -97
- package/dist/integrations/sessions/evidence-recall.js.map +1 -1
- package/dist/integrations/sessions/store.d.ts +153 -85
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/store.js +414 -484
- package/dist/integrations/sessions/store.js.map +1 -1
- package/dist/integrations/sessions/task-context.d.ts +15 -2
- package/dist/integrations/sessions/task-context.d.ts.map +1 -1
- package/dist/integrations/sessions/task-context.js +34 -11
- package/dist/integrations/sessions/task-context.js.map +1 -1
- package/dist/integrations/sessions/transcript-export.d.ts +13 -6
- package/dist/integrations/sessions/transcript-export.d.ts.map +1 -1
- package/dist/integrations/sessions/transcript-export.js +148 -263
- package/dist/integrations/sessions/transcript-export.js.map +1 -1
- package/dist/integrations/state/home.d.ts +4 -16
- package/dist/integrations/state/home.d.ts.map +1 -1
- package/dist/integrations/state/home.js +6 -42
- package/dist/integrations/state/home.js.map +1 -1
- package/dist/integrations/state/project.d.ts +6 -7
- package/dist/integrations/state/project.d.ts.map +1 -1
- package/dist/integrations/state/project.js +7 -9
- package/dist/integrations/state/project.js.map +1 -1
- package/dist/integrations/state/report.d.ts +27 -41
- package/dist/integrations/state/report.d.ts.map +1 -1
- package/dist/integrations/state/report.js +172 -464
- package/dist/integrations/state/report.js.map +1 -1
- package/dist/integrations/state/retention.d.ts +18 -0
- package/dist/integrations/state/retention.d.ts.map +1 -0
- package/dist/integrations/state/retention.js +18 -0
- package/dist/integrations/state/retention.js.map +1 -0
- package/dist/integrations/subagents/activity.d.ts +36 -31
- package/dist/integrations/subagents/activity.d.ts.map +1 -1
- package/dist/integrations/subagents/activity.js +27 -23
- package/dist/integrations/subagents/activity.js.map +1 -1
- package/dist/integrations/subagents/batches.d.ts +91 -0
- package/dist/integrations/subagents/batches.d.ts.map +1 -0
- package/dist/integrations/subagents/batches.js +172 -0
- package/dist/integrations/subagents/batches.js.map +1 -0
- package/dist/integrations/subagents/parent.d.ts +26 -11
- package/dist/integrations/subagents/parent.d.ts.map +1 -1
- package/dist/integrations/subagents/parent.js +13 -28
- package/dist/integrations/subagents/parent.js.map +1 -1
- package/dist/integrations/subagents/policy.d.ts +2 -2
- package/dist/integrations/subagents/policy.d.ts.map +1 -1
- package/dist/integrations/subagents/policy.js +2 -2
- package/dist/integrations/subagents/policy.js.map +1 -1
- package/dist/integrations/subagents/replay.d.ts +91 -26
- package/dist/integrations/subagents/replay.d.ts.map +1 -1
- package/dist/integrations/subagents/replay.js +216 -114
- package/dist/integrations/subagents/replay.js.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts +50 -26
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +132 -126
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/integrations/subagents/saved-agents.d.ts +57 -0
- package/dist/integrations/subagents/saved-agents.d.ts.map +1 -0
- package/dist/integrations/subagents/saved-agents.js +102 -0
- package/dist/integrations/subagents/saved-agents.js.map +1 -0
- package/dist/integrations/subagents/slash.d.ts +55 -0
- package/dist/integrations/subagents/slash.d.ts.map +1 -0
- package/dist/integrations/subagents/slash.js +45 -0
- package/dist/integrations/subagents/slash.js.map +1 -0
- package/dist/integrations/telemetry/session-export.d.ts +6 -6
- package/dist/integrations/telemetry/session-export.d.ts.map +1 -1
- package/dist/integrations/telemetry/session-export.js +2 -2
- package/dist/integrations/web/search.d.ts +1 -1
- package/dist/logging.d.ts +5 -5
- package/dist/logging.js +6 -6
- package/dist/memory/presentation.d.ts +11 -0
- package/dist/memory/presentation.d.ts.map +1 -1
- package/dist/memory/presentation.js +25 -0
- package/dist/memory/presentation.js.map +1 -1
- package/dist/memory/store.d.ts +13 -7
- package/dist/memory/store.d.ts.map +1 -1
- package/dist/memory/store.js +37 -11
- package/dist/memory/store.js.map +1 -1
- package/dist/memory/typed.d.ts +116 -0
- package/dist/memory/typed.d.ts.map +1 -0
- package/dist/memory/typed.js +336 -0
- package/dist/memory/typed.js.map +1 -0
- package/dist/permissions/checks.d.ts +1 -1
- package/dist/permissions/checks.js +1 -1
- package/dist/permissions/headless-trust.d.ts +4 -4
- package/dist/permissions/headless-trust.d.ts.map +1 -1
- package/dist/permissions/headless-trust.js +6 -6
- package/dist/permissions/headless-trust.js.map +1 -1
- package/dist/permissions/mode.d.ts +4 -4
- package/dist/permissions/mode.js +1 -1
- package/dist/permissions/rules.d.ts +1 -1
- package/dist/permissions/rules.js +1 -1
- package/dist/termination.d.ts +75 -0
- package/dist/termination.d.ts.map +1 -0
- package/dist/termination.js +143 -0
- package/dist/termination.js.map +1 -0
- package/dist/tui/AgentExplorer.d.ts +2 -2
- package/dist/tui/AgentExplorer.js +4 -4
- package/dist/tui/AgentExplorer.js.map +1 -1
- package/dist/tui/App.d.ts +9 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +456 -307
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/LiveActivity.d.ts +1 -1
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts +8 -0
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.js +25 -2
- package/dist/tui/PermissionOverlay.js.map +1 -1
- package/dist/tui/Picker.js +1 -1
- package/dist/tui/agent.d.ts +211 -135
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +535 -316
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/conversation-evidence-view.js +3 -3
- package/dist/tui/conversation-evidence-view.js.map +1 -1
- package/dist/tui/conversation-history.d.ts +4 -21
- package/dist/tui/conversation-history.d.ts.map +1 -1
- package/dist/tui/conversation-history.js +4 -28
- package/dist/tui/conversation-history.js.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +27 -1
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/log-pane.js +1 -1
- package/dist/tui/markdownParser.d.ts +1 -1
- package/dist/tui/markdownParser.js +1 -1
- package/dist/tui/permission-review.d.ts +16 -0
- package/dist/tui/permission-review.d.ts.map +1 -1
- package/dist/tui/permission-review.js +25 -2
- package/dist/tui/permission-review.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +30 -41
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +75 -66
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/status-panel-layout.js +1 -1
- package/dist/tui/status-panel-layout.js.map +1 -1
- package/dist/tui/{run-interruption.d.ts → turn-interruption.d.ts} +4 -4
- package/dist/tui/turn-interruption.d.ts.map +1 -0
- package/dist/tui/{run-interruption.js → turn-interruption.js} +20 -20
- package/dist/tui/turn-interruption.js.map +1 -0
- package/dist/tui/turn-limits-settings.d.ts +39 -0
- package/dist/tui/turn-limits-settings.d.ts.map +1 -0
- package/dist/tui/{run-limits-settings.js → turn-limits-settings.js} +18 -18
- package/dist/tui/turn-limits-settings.js.map +1 -0
- package/dist/tui/types.d.ts +3 -3
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/user-commands/store.d.ts +4 -4
- package/dist/user-commands/store.js +5 -5
- package/dist/user-commands/store.js.map +1 -1
- package/package.json +6 -6
- package/dist/commands/run-flags.d.ts.map +0 -1
- package/dist/commands/run-flags.js.map +0 -1
- package/dist/commands/run-stream.d.ts +0 -65
- package/dist/commands/run-stream.d.ts.map +0 -1
- package/dist/commands/run-stream.js +0 -603
- package/dist/commands/run-stream.js.map +0 -1
- package/dist/commands/run.d.ts +0 -39
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -533
- package/dist/commands/run.js.map +0 -1
- package/dist/config/run-limits.d.ts +0 -11
- package/dist/config/run-limits.d.ts.map +0 -1
- package/dist/config/run-limits.js +0 -64
- package/dist/config/run-limits.js.map +0 -1
- package/dist/integrations/sessions/compaction-evidence.d.ts +0 -5
- package/dist/integrations/sessions/compaction-evidence.d.ts.map +0 -1
- package/dist/integrations/sessions/compaction-evidence.js +0 -59
- package/dist/integrations/sessions/compaction-evidence.js.map +0 -1
- package/dist/integrations/sessions/database.d.ts +0 -5
- package/dist/integrations/sessions/database.d.ts.map +0 -1
- package/dist/integrations/sessions/database.js +0 -34
- package/dist/integrations/sessions/database.js.map +0 -1
- package/dist/integrations/sessions/paths.d.ts +0 -7
- package/dist/integrations/sessions/paths.d.ts.map +0 -1
- package/dist/integrations/sessions/paths.js +0 -14
- package/dist/integrations/sessions/paths.js.map +0 -1
- package/dist/integrations/sessions/run-discovery.d.ts +0 -24
- package/dist/integrations/sessions/run-discovery.d.ts.map +0 -1
- package/dist/integrations/sessions/run-discovery.js +0 -142
- package/dist/integrations/sessions/run-discovery.js.map +0 -1
- package/dist/integrations/sessions/turn-evidence.d.ts +0 -129
- package/dist/integrations/sessions/turn-evidence.d.ts.map +0 -1
- package/dist/integrations/sessions/turn-evidence.js +0 -517
- package/dist/integrations/sessions/turn-evidence.js.map +0 -1
- package/dist/integrations/subagents/history.d.ts +0 -26
- package/dist/integrations/subagents/history.d.ts.map +0 -1
- package/dist/integrations/subagents/history.js +0 -76
- package/dist/integrations/subagents/history.js.map +0 -1
- package/dist/integrations/subagents/runs.d.ts +0 -72
- package/dist/integrations/subagents/runs.d.ts.map +0 -1
- package/dist/integrations/subagents/runs.js +0 -155
- package/dist/integrations/subagents/runs.js.map +0 -1
- package/dist/tui/run-interruption.d.ts.map +0 -1
- package/dist/tui/run-interruption.js.map +0 -1
- package/dist/tui/run-limits-settings.d.ts +0 -39
- package/dist/tui/run-limits-settings.d.ts.map +0 -1
- package/dist/tui/run-limits-settings.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../src/memory/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAIlB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../src/memory/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,OAAO,EACN,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAIlB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,wBAAwB,OAAQ,CAAA;AAC7C,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAkB1C,+FAA+F;AAC/F,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACvD,MAAM,CAYR;AAED,mFAAmF;AACnF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,MAAM,EAAE,CAIjF;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMvF;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACxC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,mBAAmB,EAC1B,OAAO,CAAC,EAAE,mBAAmB,GAC3B,MAAM,GAAG,IAAI,CAaf"}
|
|
@@ -48,4 +48,29 @@ export function renderMemorySaveResult(result, text) {
|
|
|
48
48
|
}
|
|
49
49
|
return `Remembered ${result.scope === 'user' ? 'for every project' : 'for this project'} (${result.path}): ${text}`;
|
|
50
50
|
}
|
|
51
|
+
/** What `#note` and `/memory add` report after writing a typed memory. */
|
|
52
|
+
export function renderTypedNoteResult(result, text) {
|
|
53
|
+
if (result.duplicate) {
|
|
54
|
+
return `Already remembered as ${result.name ?? 'an existing memory'}${result.path ? ` (${result.path})` : ''}; nothing new was saved.`;
|
|
55
|
+
}
|
|
56
|
+
if (!result.saved)
|
|
57
|
+
return 'No memory added. Use /memory add <text>.';
|
|
58
|
+
return `Remembered for this project as a ${result.type} memory${result.path ? ` (${result.path})` : ''}: ${text}`;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The stored-memory part of `/memory`, or null when there is none: the index
|
|
62
|
+
* lines every turn carries, then what turns recorded on their own under its
|
|
63
|
+
* own label and count, since those never reach the prompt's index and would
|
|
64
|
+
* otherwise be invisible here.
|
|
65
|
+
*/
|
|
66
|
+
export function renderStoredMemorySection(directory, index, derived) {
|
|
67
|
+
const sections = [];
|
|
68
|
+
if (index.text) {
|
|
69
|
+
sections.push(`Stored memories (${index.total}), in every turn's index\n${directory}\n\n${preview(index.text, directory)}`);
|
|
70
|
+
}
|
|
71
|
+
if (derived?.text) {
|
|
72
|
+
sections.push(`Recorded by turns (${derived.total}), not in the index; search_memory finds them\n${directory}\n\n${preview(derived.text, directory)}`);
|
|
73
|
+
}
|
|
74
|
+
return sections.length > 0 ? sections.join('\n\n') : null;
|
|
75
|
+
}
|
|
51
76
|
//# sourceMappingURL=presentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../../src/memory/presentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../../src/memory/presentation.ts"],"names":[],"mappings":"AAEA,OAAO,EAEN,wBAAwB,EAExB,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,YAAY,CAAA;AAGnB,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAA;AAC7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAA;AAE1C,SAAS,OAAO,CAAC,IAAY,EAAE,IAAY;IAC1C,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAA;IACzD,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,wBAAwB,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC5C,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,IAAI,GAAG;YAAE,MAAK;QACxC,IAAI,IAAI,KAAK,wBAAwB,GAAG,CAAC;YAAE,GAAG,GAAG,OAAO,CAAA;QACxD,QAAQ,GAAG,OAAO,GAAG,CAAC,CAAA;IACvB,CAAC;IACD,IAAI,GAAG,KAAK,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IACpC,kEAAkE;IAClE,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;IACrC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM;QAAE,GAAG,IAAI,CAAC,CAAA;IAC9C,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,IAAI,CA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AC,EAAE,CAC5G,CAAA;IACF,CAAC;IACD,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CACZ,sBAAsB,OAAO,CAAC,KAAK,kDAAkD,SAAS,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CACvI,CAAA;IACF,CAAC;IACD,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC1D,CAAC"}
|
package/dist/memory/store.d.ts
CHANGED
|
@@ -4,20 +4,24 @@
|
|
|
4
4
|
* Two scopes, three files:
|
|
5
5
|
* - `~/.namzu/USER.md` — who the operator is. User scope.
|
|
6
6
|
* - `~/.namzu/MEMORY.md` — facts that hold in every project. User scope.
|
|
7
|
-
* - `<project>/.namzu/MEMORY.md` — facts about this repository
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* - `<project>/.namzu/MEMORY.md` — facts about this repository, written by the
|
|
8
|
+
* operator. Project scope. It used to be where `#note` appended; those
|
|
9
|
+
* bullets stay. `/memory import-notes` copies them into stored memory
|
|
10
|
+
* (`importCuratedNotes`) without changing the file, and a launch only
|
|
11
|
+
* offers it (`migrateMemoryOnce`).
|
|
12
12
|
*
|
|
13
13
|
* Each section is capped before injection. A memory file grows for months;
|
|
14
14
|
* an uncapped one would spend the context every turn on the part nobody
|
|
15
15
|
* curated. The cap keeps the head, says how much it left out, and the fix is
|
|
16
16
|
* to edit the file — which is the whole point of a curated memory.
|
|
17
17
|
*
|
|
18
|
-
* Separate from
|
|
19
|
-
*
|
|
18
|
+
* Separate from stored memory (`memory/typed.ts`): typed Markdown files the
|
|
19
|
+
* kernel's memory tools search and update, whose generated index the prompt
|
|
20
|
+
* carries under its own heading. `#note` and `/memory add` write there now;
|
|
21
|
+
* `/memory --user add` still appends to the user file here, because stored
|
|
22
|
+
* memory belongs to one project.
|
|
20
23
|
*/
|
|
24
|
+
import { type MemoryLocation } from './io.js';
|
|
21
25
|
export { MEMORY_FILE_MAX_BYTES } from './io.js';
|
|
22
26
|
/** Characters of one section injected before the rest is left to the file. */
|
|
23
27
|
export declare const MEMORY_SECTION_MAX_CHARS = 8000;
|
|
@@ -38,6 +42,8 @@ export interface MemoryContent {
|
|
|
38
42
|
readonly project: string | null;
|
|
39
43
|
readonly diagnostics?: readonly MemoryDiagnostic[];
|
|
40
44
|
}
|
|
45
|
+
/** The project's curated file and the root it must resolve within. */
|
|
46
|
+
export declare function projectMemoryLocation(cwd: string): MemoryLocation;
|
|
41
47
|
/** Read bounded, valid UTF-8 files; distinguish missing/empty files from refused content. */
|
|
42
48
|
export declare function readMemory(home?: string, cwd?: string): MemoryContent;
|
|
43
49
|
export declare function composeMemoryPrompt(content: MemoryContent): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/memory/store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/memory/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,OAAO,EAAE,KAAK,cAAc,EAAuD,MAAM,SAAS,CAAA;AAElG,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE/C,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,OAAQ,CAAA;AAE7C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,CAAA;AAE5C,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,8EAA8E;A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,CAAC,gBAAgB,EAAE,OAAO,CAAA;CAClC;AAED,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAClC,kBAAkB,CAqBpB"}
|
package/dist/memory/store.js
CHANGED
|
@@ -4,19 +4,22 @@
|
|
|
4
4
|
* Two scopes, three files:
|
|
5
5
|
* - `~/.namzu/USER.md` — who the operator is. User scope.
|
|
6
6
|
* - `~/.namzu/MEMORY.md` — facts that hold in every project. User scope.
|
|
7
|
-
* - `<project>/.namzu/MEMORY.md` — facts about this repository
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* - `<project>/.namzu/MEMORY.md` — facts about this repository, written by the
|
|
8
|
+
* operator. Project scope. It used to be where `#note` appended; those
|
|
9
|
+
* bullets stay. `/memory import-notes` copies them into stored memory
|
|
10
|
+
* (`importCuratedNotes`) without changing the file, and a launch only
|
|
11
|
+
* offers it (`migrateMemoryOnce`).
|
|
12
12
|
*
|
|
13
13
|
* Each section is capped before injection. A memory file grows for months;
|
|
14
14
|
* an uncapped one would spend the context every turn on the part nobody
|
|
15
15
|
* curated. The cap keeps the head, says how much it left out, and the fix is
|
|
16
16
|
* to edit the file — which is the whole point of a curated memory.
|
|
17
17
|
*
|
|
18
|
-
* Separate from
|
|
19
|
-
*
|
|
18
|
+
* Separate from stored memory (`memory/typed.ts`): typed Markdown files the
|
|
19
|
+
* kernel's memory tools search and update, whose generated index the prompt
|
|
20
|
+
* carries under its own heading. `#note` and `/memory add` write there now;
|
|
21
|
+
* `/memory --user add` still appends to the user file here, because stored
|
|
22
|
+
* memory belongs to one project.
|
|
20
23
|
*/
|
|
21
24
|
import { realpathSync } from 'node:fs';
|
|
22
25
|
import { join, resolve } from 'node:path';
|
|
@@ -52,6 +55,10 @@ export function projectMemoryFilePath(cwd) {
|
|
|
52
55
|
return local;
|
|
53
56
|
return join(root, '.namzu', 'MEMORY.md');
|
|
54
57
|
}
|
|
58
|
+
/** The project's curated file and the root it must resolve within. */
|
|
59
|
+
export function projectMemoryLocation(cwd) {
|
|
60
|
+
return projectLocation(cwd);
|
|
61
|
+
}
|
|
55
62
|
function projectLocation(cwd) {
|
|
56
63
|
const directory = realpathSync(resolve(cwd));
|
|
57
64
|
return { path: projectMemoryFilePath(directory), root: cliProjectRoot(directory) };
|
|
@@ -84,11 +91,26 @@ export function readMemory(home, cwd) {
|
|
|
84
91
|
root: userRoot,
|
|
85
92
|
path: join(userRoot, 'MEMORY.md'),
|
|
86
93
|
}));
|
|
87
|
-
|
|
94
|
+
// Started in the home directory, the project's `.namzu/MEMORY.md` IS the
|
|
95
|
+
// user's `MEMORY.md` — same file, read twice, injected under two headings
|
|
96
|
+
// into every prompt. It is the user's file; it is read once, as that.
|
|
97
|
+
const project = cwd && !isUserMemoryFile(join(resolve(cwd), '.namzu', 'MEMORY.md'), userRoot)
|
|
88
98
|
? read(join(resolve(cwd), '.namzu', 'MEMORY.md'), () => projectLocation(cwd))
|
|
89
99
|
: null;
|
|
90
100
|
return { user, memory, project, ...(diagnostics.length > 0 ? { diagnostics } : {}) };
|
|
91
101
|
}
|
|
102
|
+
/** Whether a project memory path names the user's own `MEMORY.md`, symlinks resolved. */
|
|
103
|
+
function isUserMemoryFile(projectPath, userRoot) {
|
|
104
|
+
const canonical = (path) => {
|
|
105
|
+
try {
|
|
106
|
+
return realpathSync(path);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return resolve(path);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
return canonical(projectPath) === canonical(join(userRoot, 'MEMORY.md'));
|
|
113
|
+
}
|
|
92
114
|
function capped(text, file) {
|
|
93
115
|
if (text.length <= MEMORY_SECTION_MAX_CHARS)
|
|
94
116
|
return text;
|
|
@@ -105,10 +127,14 @@ export function composeMemoryPrompt(content) {
|
|
|
105
127
|
const sections = [];
|
|
106
128
|
if (content.user)
|
|
107
129
|
sections.push(`## About the user\n\n${capped(content.user, 'USER.md')}`);
|
|
108
|
-
|
|
109
|
-
|
|
130
|
+
// "Curated", never "durable" or bare "memory": the stored-memory index sits
|
|
131
|
+
// beside these sections under its own heading, and the model must be able
|
|
132
|
+
// to tell operator-written text from records it can search and update.
|
|
133
|
+
if (content.memory) {
|
|
134
|
+
sections.push(`## Curated memory (all projects)\n\n${capped(content.memory, 'MEMORY.md')}`);
|
|
135
|
+
}
|
|
110
136
|
if (content.project) {
|
|
111
|
-
sections.push(`##
|
|
137
|
+
sections.push(`## Curated memory (this project)\n\n${capped(content.project, '.namzu/MEMORY.md')}`);
|
|
112
138
|
}
|
|
113
139
|
if (sections.length === 0)
|
|
114
140
|
return null;
|
package/dist/memory/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/memory/store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/memory/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAEjE,OAAO,EAAuB,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAElG,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE/C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAA;AAI7C,MAAM,UAAU,SAAS,CAAC,IAAa;IACtC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAa;IACzC,OAAO,IA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ACpE,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stored memory: the typed, one-file-per-memory store the kernel's memory
|
|
3
|
+
* tools read and write, as the CLI uses it.
|
|
4
|
+
*
|
|
5
|
+
* Four jobs live here. `saveTypedNote` is what `#note` and `/memory add`
|
|
6
|
+
* write through. `composeStoredMemoryPrompt` turns the store's generated index
|
|
7
|
+
* into the prompt section the model sees every turn. `migrateMemoryOnce`
|
|
8
|
+
* moves the JSON store into typed files, once, and offers the project's
|
|
9
|
+
* curated bullets; `importCuratedNotes` copies those when the operator asks,
|
|
10
|
+
* never editing the curated file.
|
|
11
|
+
*
|
|
12
|
+
* The CURATED files (`USER.md`, `MEMORY.md` in the application home and the
|
|
13
|
+
* project) stay what they were: operator-authored text read into every turn.
|
|
14
|
+
* The two are never given the same heading in the prompt.
|
|
15
|
+
*/
|
|
16
|
+
import { type MarkdownMemoryStore, type MemoryType, type RenderedMemoryIndex } from '@namzu/sdk';
|
|
17
|
+
export interface TypedNoteResult {
|
|
18
|
+
/** False when the note was empty or an identical memory already exists. */
|
|
19
|
+
readonly saved: boolean;
|
|
20
|
+
readonly name?: string;
|
|
21
|
+
readonly type: MemoryType;
|
|
22
|
+
/** The memory file, or the existing duplicate's file. */
|
|
23
|
+
readonly path?: string;
|
|
24
|
+
/** Set when an active memory with this exact text already existed. */
|
|
25
|
+
readonly duplicate?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Save an operator note as a typed memory, default type `project`. A note
|
|
29
|
+
* whose exact text an active memory already holds is not saved twice; the
|
|
30
|
+
* result names the one that holds it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function saveTypedNote(store: MarkdownMemoryStore, text: string, type?: MemoryType): Promise<TypedNoteResult>;
|
|
33
|
+
/**
|
|
34
|
+
* The prompt section for the stored-memory index, or null when the store
|
|
35
|
+
* holds no active memory. Named so it can never be mistaken for the curated
|
|
36
|
+
* sections beside it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function composeStoredMemoryPrompt(index: RenderedMemoryIndex): string | null;
|
|
39
|
+
/** What one launch's migration did, for the operator notice. */
|
|
40
|
+
export interface MemoryMigrationReport {
|
|
41
|
+
readonly importedRecords: number;
|
|
42
|
+
/** JSON records the Markdown store refused (too large, a NUL byte); kept in the retired files. */
|
|
43
|
+
readonly skippedRecords: readonly string[];
|
|
44
|
+
/**
|
|
45
|
+
* The project's curated file holds top-level bullets, offered once per
|
|
46
|
+
* file: nothing is copied until the operator runs `/memory import-notes`,
|
|
47
|
+
* and the file itself is never changed.
|
|
48
|
+
*/
|
|
49
|
+
readonly notesOffer?: {
|
|
50
|
+
readonly path: string;
|
|
51
|
+
readonly count: number;
|
|
52
|
+
};
|
|
53
|
+
/** Things that did not happen and why; the migration is retried next launch. */
|
|
54
|
+
readonly problems: readonly string[];
|
|
55
|
+
}
|
|
56
|
+
/** What `/memory import-notes` did. The curated file is never changed. */
|
|
57
|
+
export interface CuratedNotesImport {
|
|
58
|
+
readonly path: string;
|
|
59
|
+
/** Top-level bullets the file holds, each counted once. */
|
|
60
|
+
readonly found: number;
|
|
61
|
+
/** Memories created by this turn. */
|
|
62
|
+
readonly copied: number;
|
|
63
|
+
/** Bullets already in stored memory, by an earlier import, a `#note`, or by hand. */
|
|
64
|
+
readonly alreadyStored: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The text of every top-level bullet (`- text`) in a curated file, each once,
|
|
68
|
+
* in order. No bullet is judged to be a note or not: the file is never
|
|
69
|
+
* changed, so copying one the operator wrote costs a memory they can archive,
|
|
70
|
+
* never a line of their file. A nested bullet belongs to its parent and is not
|
|
71
|
+
* taken; only a bullet's first line is.
|
|
72
|
+
*/
|
|
73
|
+
export declare function curatedBullets(text: string): string[];
|
|
74
|
+
/**
|
|
75
|
+
* Move what the JSON store held into typed files, once and safely again, and
|
|
76
|
+
* say once per curated file whether it holds notes that could move.
|
|
77
|
+
*
|
|
78
|
+
* 1. A JSON store (`index.json` + `content/`) in `directory` is imported
|
|
79
|
+
* record by record with its ids, timestamps and status, then moved aside
|
|
80
|
+
* to `index.json.migrated` and `content.migrated`. A record the Markdown
|
|
81
|
+
* store refuses to write — over its size limit, or holding a NUL byte —
|
|
82
|
+
* is reported and stays in the retired files; stopping on it would leave
|
|
83
|
+
* `index.json` in place and the store refusing every operation for good.
|
|
84
|
+
* Any other failure leaves the JSON store where it is, to retry next launch.
|
|
85
|
+
* 2. The project's curated `MEMORY.md` is never changed. When it holds
|
|
86
|
+
* top-level bullets — some may be notes `#note` used to append — the
|
|
87
|
+
* report offers them once per file, since the checkout's file and a
|
|
88
|
+
* subdirectory's own `.namzu/MEMORY.md` are different files, and
|
|
89
|
+
* `/memory import-notes` copies them into typed memories when the
|
|
90
|
+
* operator asks. They stay curated, read into every turn as before, until
|
|
91
|
+
* the operator deletes them from the file.
|
|
92
|
+
*/
|
|
93
|
+
export declare function migrateMemoryOnce(options: {
|
|
94
|
+
readonly store: MarkdownMemoryStore;
|
|
95
|
+
/** The store's directory, where a JSON store would have lived. */
|
|
96
|
+
readonly directory: string;
|
|
97
|
+
readonly cwd: string;
|
|
98
|
+
}): Promise<MemoryMigrationReport>;
|
|
99
|
+
/**
|
|
100
|
+
* Copy the project's curated bullets into typed memory files, because the
|
|
101
|
+
* operator asked (`/memory import-notes`). The curated file is read, never
|
|
102
|
+
* written: deleting a bullet from it is the operator's call. Idempotent: a
|
|
103
|
+
* bullet already stored — by an earlier or concurrent import, as a `#note`
|
|
104
|
+
* with the same text, or under its name with the same text — is not copied
|
|
105
|
+
* again.
|
|
106
|
+
*/
|
|
107
|
+
export declare function importCuratedNotes(options: {
|
|
108
|
+
readonly store: MarkdownMemoryStore;
|
|
109
|
+
readonly directory: string;
|
|
110
|
+
readonly cwd: string;
|
|
111
|
+
}): Promise<CuratedNotesImport>;
|
|
112
|
+
/** Operator notices for a migration; empty when nothing moved, nothing is offered and nothing failed. */
|
|
113
|
+
export declare function describeMemoryMigration(report: MemoryMigrationReport, directory: string): string[];
|
|
114
|
+
/** The operator's report for `/memory import-notes`. */
|
|
115
|
+
export declare function describeCuratedNotesImport(result: CuratedNotesImport, directory: string): string;
|
|
116
|
+
//# sourceMappingURL=typed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src/memory/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EAEN,KAAK,mBAAmB,EAGxB,KAAK,UAAU,EACf,KAAK,mBAAmB,EAExB,MAAM,YAAY,CAAA;AAKnB,MAAM,WAAW,eAAe;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,yDAAyD;IACzD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAC5B;AAcD;;;;GAIG;AACH,wBAAsB,aAAa,CAClC,KAAK,EAAE,mBAAmB,EAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,UAAsB,GAC1B,OAAO,CAAC,eAAe,CAAC,CA8B1B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CASnF;AAED,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,kGAAkG;IAClG,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MA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