@cortexkit/opencode-magic-context 0.42.5 → 0.43.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/README.md +6 -7
- package/dist/agents/dreamer.d.ts +7 -9
- package/dist/agents/dreamer.d.ts.map +1 -1
- package/dist/agents/hidden-agent-registrations.d.ts.map +1 -1
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/config/index.d.ts +10 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/live-run-config.d.ts +12 -0
- package/dist/config/live-run-config.d.ts.map +1 -0
- package/dist/config/live-snapshot.d.ts +32 -0
- package/dist/config/live-snapshot.d.ts.map +1 -0
- package/dist/config/schema/magic-context.d.ts +13 -2
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-jyj54gbe.js → conflict-warning-hook-t2vb0wnx.js} +3 -3
- package/dist/{derive-budgets-v1fkhjjr.js → derive-budgets-0sg5vp61.js} +5 -2
- package/dist/features/builtin-commands/commands.d.ts +0 -4
- package/dist/features/builtin-commands/commands.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +6 -0
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +4 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-lease.d.ts +8 -0
- package/dist/features/magic-context/compartment-lease.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts +21 -0
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/context-authority.d.ts +37 -3
- package/dist/features/magic-context/context-authority.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts +23 -0
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts +5 -1
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts +48 -0
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/manual-summary.d.ts +7 -0
- package/dist/features/magic-context/dreamer/manual-summary.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/open-opencode-db.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/promote-primers.d.ts +8 -1
- package/dist/features/magic-context/dreamer/promote-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts +5 -2
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +22 -13
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts +9 -0
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts +3 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +7 -4
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +53 -2
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +3 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/tick-failure.d.ts +38 -0
- package/dist/features/magic-context/dreamer/tick-failure.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts +2 -0
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts +1 -0
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +1 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/memory-diagnostics.d.ts +6 -0
- package/dist/features/magic-context/memory/memory-diagnostics.d.ts.map +1 -0
- package/dist/features/magic-context/memory/memory-selection.d.ts +12 -0
- package/dist/features/magic-context/memory/memory-selection.d.ts.map +1 -0
- package/dist/features/magic-context/memory/memory-visibility.d.ts +46 -0
- package/dist/features/magic-context/memory/memory-visibility.d.ts.map +1 -0
- package/dist/features/magic-context/memory/mirror-reembed.d.ts +22 -0
- package/dist/features/magic-context/memory/mirror-reembed.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts +9 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts +6 -2
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/memory/transformers-remote-host.d.ts +6 -0
- package/dist/features/magic-context/memory/transformers-remote-host.d.ts.map +1 -0
- package/dist/features/magic-context/memory/transformers-web-entry.d.ts.map +1 -1
- package/dist/features/magic-context/message-fts-rowid-map.d.ts +3 -1
- package/dist/features/magic-context/message-fts-rowid-map.d.ts.map +1 -1
- package/dist/features/magic-context/message-index-async.d.ts +8 -3
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +7 -1
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/message-time-backfill.d.ts +19 -0
- package/dist/features/magic-context/message-time-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/migrations.d.ts +16 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/mural/storage-mural.d.ts +5 -0
- package/dist/features/magic-context/mural/storage-mural.d.ts.map +1 -1
- package/dist/features/magic-context/opencode2-relabel.d.ts +132 -0
- package/dist/features/magic-context/opencode2-relabel.d.ts.map +1 -0
- package/dist/features/magic-context/overflow-detection.d.ts +3 -0
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +1 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/protection-window.d.ts +1 -1
- package/dist/features/magic-context/protection-window.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +6 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/session-decision-calibration.d.ts +31 -0
- package/dist/features/magic-context/session-decision-calibration.d.ts.map +1 -0
- package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/shadow-backfill-state.d.ts +1 -1
- package/dist/features/magic-context/shadow-backfill-state.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts +5 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-historian-runs.d.ts +4 -2
- package/dist/features/magic-context/storage-historian-runs.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +16 -2
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-notes.d.ts +1 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
- package/dist/features/magic-context/storage-replay-document.d.ts +2 -0
- package/dist/features/magic-context/storage-replay-document.d.ts.map +1 -1
- package/dist/features/magic-context/storage-subagent-invocations.d.ts +1 -1
- package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +42 -4
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +2 -2
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts +95 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts +1 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +2 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/tool-definition-tokens.d.ts +1 -0
- package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -1
- package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts +5 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/hooks/auto-update-checker/index.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +10 -1
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +19 -4
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts +8 -0
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +5 -4
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-off-transition.d.ts +1 -0
- package/dist/hooks/magic-context/compaction-off-transition.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-render-epoch.d.ts +3 -1
- package/dist/hooks/magic-context/compartment-render-epoch.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +19 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +19 -11
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +4 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/decay-render.d.ts +1 -0
- package/dist/hooks/magic-context/decay-render.d.ts.map +1 -1
- package/dist/hooks/magic-context/decision-calibration.d.ts +24 -0
- package/dist/hooks/magic-context/decision-calibration.d.ts.map +1 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts +2 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts.map +1 -1
- package/dist/hooks/magic-context/dropped-input-guard.d.ts +50 -4
- package/dist/hooks/magic-context/dropped-input-guard.d.ts.map +1 -1
- package/dist/hooks/magic-context/embed-history-runner.d.ts +30 -0
- package/dist/hooks/magic-context/embed-history-runner.d.ts.map +1 -0
- package/dist/hooks/magic-context/emergency-drop.d.ts +13 -8
- package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-payloads.d.ts +2 -1
- package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts +2 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +12 -4
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-no-fire-cause.d.ts +5 -0
- package/dist/hooks/magic-context/historian-no-fire-cause.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts +3 -0
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts +0 -3
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +4 -4
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/host-served-rows.d.ts +58 -0
- package/dist/hooks/magic-context/host-served-rows.d.ts.map +1 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts +38 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/legacy-compartments.d.ts +20 -0
- package/dist/hooks/magic-context/legacy-compartments.d.ts.map +1 -0
- package/dist/hooks/magic-context/live-session-state.d.ts +7 -7
- package/dist/hooks/magic-context/m0-token-breakdown.d.ts +6 -0
- package/dist/hooks/magic-context/m0-token-breakdown.d.ts.map +1 -1
- package/dist/hooks/magic-context/maintenance-authority.d.ts +0 -1
- package/dist/hooks/magic-context/maintenance-authority.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts +4 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +24 -2
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-wire.d.ts +43 -1
- package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
- package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -1
- package/dist/hooks/magic-context/postprocess-read-cache.d.ts +8 -0
- package/dist/hooks/magic-context/postprocess-read-cache.d.ts.map +1 -0
- package/dist/hooks/magic-context/producer-window-guard.d.ts +47 -1
- package/dist/hooks/magic-context/producer-window-guard.d.ts.map +1 -1
- package/dist/hooks/magic-context/producer-window-test-support.d.ts +14 -0
- package/dist/hooks/magic-context/producer-window-test-support.d.ts.map +1 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +2 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +51 -10
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +8 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-formatting.d.ts +6 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +4 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +6 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts +17 -39
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +51 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts +28 -0
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts.map +1 -0
- package/dist/hooks/magic-context/sentinel.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +6 -7
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +21 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +63 -0
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts +19 -12
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +52 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-sweep-policy.d.ts +50 -0
- package/dist/hooks/magic-context/tool-sweep-policy.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +20 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +9 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +5 -3
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +44 -4
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-f9gem5cr.js → index-8w1skpnm.js} +85 -5
- package/dist/index-99sfbrrf.js +170 -0
- package/dist/index-9skq8m9y.js +16 -0
- package/dist/{index-3wbd8sdq.js → index-d0dh7v0f.js} +28107 -29850
- package/dist/{index-d8mgqezq.js → index-rpz2me0v.js} +133 -78
- package/dist/{index-p474rw9p.js → index-rvwvdq59.js} +1 -1
- package/dist/index-w2ety11c.js +393 -0
- package/dist/index-y5145x8k.js +619 -0
- package/dist/index-ygwdyntq.js +5407 -0
- package/dist/{index-jkrqhc7y.js → index-ykg9sdzz.js} +147 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7065 -3197
- package/dist/message-time-backfill-gzjer78y.js +108 -0
- package/dist/plugin/dream-timer.d.ts +13 -0
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +5 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/memory-id-translation.d.ts +109 -0
- package/dist/plugin/memory-id-translation.d.ts.map +1 -0
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +10 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/rust-note-backend.d.ts +84 -0
- package/dist/plugin/rust-note-backend.d.ts.map +1 -0
- package/dist/plugin/rust-tool-backends.d.ts +1 -1
- package/dist/plugin/rust-tool-backends.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts +1 -0
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/read-session-chunk-ec3jkvhg.js +61 -0
- package/dist/{recomp-orchestrator-k20sfpm2.js → recomp-orchestrator-6akjp11f.js} +8 -8
- package/dist/{send-session-notification-xnypkxpx.js → send-session-notification-f6gwkesy.js} +2 -2
- package/dist/shared/assistant-message-extractor.d.ts +6 -0
- package/dist/shared/assistant-message-extractor.d.ts.map +1 -1
- package/dist/shared/auto-update-provenance.d.ts +9 -0
- package/dist/shared/auto-update-provenance.d.ts.map +1 -0
- package/dist/shared/conflict-detector.d.ts +14 -5
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/hidden-variant-warnings.d.ts +5 -0
- package/dist/shared/hidden-variant-warnings.d.ts.map +1 -0
- package/dist/shared/host-limitations.d.ts +14 -0
- package/dist/shared/host-limitations.d.ts.map +1 -0
- package/dist/shared/keep-subagents.d.ts +1 -1
- package/dist/shared/keep-subagents.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts +1 -0
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/opencode-config-dir.d.ts +52 -0
- package/dist/shared/opencode-config-dir.d.ts.map +1 -1
- package/dist/shared/opencode-db-path.d.ts +46 -2
- package/dist/shared/opencode-db-path.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +6 -6
- package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts +10 -0
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +64 -5
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/status-detail-text.d.ts +1 -3
- package/dist/shared/status-detail-text.d.ts.map +1 -1
- package/dist/shared/status-summary.d.ts +7 -0
- package/dist/shared/status-summary.d.ts.map +1 -1
- package/dist/shared/status-view.d.ts +229 -0
- package/dist/shared/status-view.d.ts.map +1 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/shared/tail-hygiene-status.d.ts +8 -0
- package/dist/shared/tail-hygiene-status.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +32 -7
- package/dist/shared/user-facing-codes.d.ts.map +1 -1
- package/dist/shared/window-geometry.d.ts +3 -0
- package/dist/shared/window-geometry.d.ts.map +1 -1
- package/dist/{task-config-cv8k9y8r.js → task-config-ex4nt0q0.js} +1 -1
- package/dist/tools/ctx-expand/constants.d.ts +1 -1
- package/dist/tools/ctx-expand/constants.d.ts.map +1 -1
- package/dist/tools/ctx-expand/mode.d.ts +31 -0
- package/dist/tools/ctx-expand/mode.d.ts.map +1 -0
- package/dist/tools/ctx-expand/render.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/constants.d.ts +3 -1
- package/dist/tools/ctx-memory/constants.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts +1 -0
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/types.d.ts +2 -2
- package/dist/tools/ctx-note/constants.d.ts +1 -1
- package/dist/tools/ctx-note/constants.d.ts.map +1 -1
- package/dist/tools/ctx-note/render.d.ts +88 -0
- package/dist/tools/ctx-note/render.d.ts.map +1 -0
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/tools/ctx-note/types.d.ts +1 -1
- package/dist/tools/ctx-note/types.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/constants.d.ts +1 -1
- package/dist/tools/ctx-reduce/constants.d.ts.map +1 -1
- package/dist/tools/ctx-search/constants.d.ts +1 -1
- package/dist/tools/ctx-search/constants.d.ts.map +1 -1
- package/dist/tools/ctx-search/date-range.d.ts +9 -0
- package/dist/tools/ctx-search/date-range.d.ts.map +1 -0
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/types.d.ts +3 -1
- package/dist/tools/ctx-search/types.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +5 -5
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +75 -0
- package/dist/tools/parameter-descriptions.d.ts.map +1 -0
- package/dist/transformers-node-wasm.js +1918 -826
- package/dist/transformers-web.js +1736 -636
- package/dist/{transformers.node-dpmf3wpx.js → transformers.node-3zqr6k1w.js} +4087 -2898
- package/dist/tui/data/context-db.d.ts +19 -7
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/dist/tui-compiled/data/context-db.d.ts +19 -7
- package/dist/tui-compiled/data/context-db.d.ts.map +1 -1
- package/dist/v2/fold/host-media.d.ts +36 -0
- package/dist/v2/fold/host-media.d.ts.map +1 -0
- package/dist/v2/fold/restore.d.ts +21 -1
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +114 -14
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hooks/commands.d.ts +29 -0
- package/dist/v2/hooks/commands.d.ts.map +1 -0
- package/dist/v2/hooks/context.d.ts +58 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/deleted-session-tombstones.d.ts +10 -0
- package/dist/v2/hooks/deleted-session-tombstones.d.ts.map +1 -0
- package/dist/v2/hooks/dream-manual.d.ts +43 -0
- package/dist/v2/hooks/dream-manual.d.ts.map +1 -0
- package/dist/v2/hooks/dream-trigger.d.ts +7 -0
- package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +32 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -0
- package/dist/v2/hooks/model-limit-cache.d.ts +19 -0
- package/dist/v2/hooks/model-limit-cache.d.ts.map +1 -0
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/provider-admission.d.ts +22 -0
- package/dist/v2/hooks/provider-admission.d.ts.map +1 -0
- package/dist/v2/hooks/rpc-live-state.d.ts +9 -0
- package/dist/v2/hooks/rpc-live-state.d.ts.map +1 -0
- package/dist/v2/hooks/store.d.ts +38 -2
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/tools.d.ts +8 -0
- package/dist/v2/hooks/tools.d.ts.map +1 -0
- package/dist/v2/hooks/types.d.ts +157 -19
- package/dist/v2/hooks/types.d.ts.map +1 -1
- package/dist/v2/hooks/usage-reading.d.ts +42 -0
- package/dist/v2/hooks/usage-reading.d.ts.map +1 -0
- package/dist/v2/host-service.d.ts +65 -0
- package/dist/v2/host-service.d.ts.map +1 -0
- package/dist/v2/server.d.ts +19 -0
- package/dist/v2/server.d.ts.map +1 -1
- package/dist/v2/server.js +141849 -110533
- package/dist/v2/store-reader.d.ts +78 -6
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/tui/events.d.ts +7 -0
- package/dist/v2/tui/events.d.ts.map +1 -0
- package/dist/v2/tui/index.d.ts +33 -0
- package/dist/v2/tui/index.d.ts.map +1 -0
- package/dist/v2/tui/sidebar-mount.d.ts +40 -0
- package/dist/v2/tui/sidebar-mount.d.ts.map +1 -0
- package/dist/v2/tui/status-dialog-mount.d.ts +29 -0
- package/dist/v2/tui/status-dialog-mount.d.ts.map +1 -0
- package/dist/v2/tui/types.d.ts +148 -0
- package/dist/v2/tui/types.d.ts.map +1 -0
- package/dist/wrapup-orchestrator-5akc87gr.js +16 -0
- package/package.json +9 -7
- package/src/agents/dreamer.ts +7 -16
- package/src/agents/hidden-agent-registrations.ts +10 -22
- package/src/agents/magic-context-prompt.test.ts +29 -39
- package/src/agents/magic-context-prompt.ts +99 -122
- package/src/agents/permissions.test.ts +17 -21
- package/src/config/index.ts +39 -4
- package/src/config/live-run-config.test.ts +237 -0
- package/src/config/live-run-config.ts +80 -0
- package/src/config/live-schema-drift.test.ts +67 -0
- package/src/config/live-snapshot.test.ts +85 -0
- package/src/config/live-snapshot.ts +191 -0
- package/src/config/protected-tokens.test.ts +40 -0
- package/src/config/raw-loader.test.ts +1 -0
- package/src/config/schema/magic-context.test.ts +13 -5
- package/src/config/schema/magic-context.ts +109 -13
- package/src/features/magic-context/dreamer/task-registry.ts +137 -13
- package/src/shared/assistant-message-extractor.test.ts +21 -0
- package/src/shared/assistant-message-extractor.ts +43 -8
- package/src/shared/auto-update-provenance.ts +42 -0
- package/src/shared/child-session-teardown.test.ts +38 -3
- package/src/shared/child-session-teardown.ts +3 -3
- package/src/shared/conflict-detector.test.ts +277 -7
- package/src/shared/conflict-detector.ts +221 -80
- package/src/shared/hidden-variant-warnings.ts +21 -0
- package/src/shared/host-limitations.ts +43 -0
- package/src/shared/keep-subagents.ts +6 -6
- package/src/shared/model-suggestion-retry.test.ts +43 -0
- package/src/shared/model-suggestion-retry.ts +12 -0
- package/src/shared/models-dev-cache.test.ts +25 -0
- package/src/shared/models-dev-cache.ts +5 -0
- package/src/shared/opencode-config-dir.ts +80 -7
- package/src/shared/opencode-db-path.test.ts +174 -0
- package/src/shared/opencode-db-path.ts +193 -15
- package/src/shared/opencode-host-generation.test.ts +29 -0
- package/src/shared/prompt-surface-a1-golden.md +142 -215
- package/src/shared/prompt-surface-runtime.test.ts +20 -0
- package/src/shared/prompt-surface-runtime.ts +7 -5
- package/src/shared/rpc-server.ts +18 -0
- package/src/shared/rpc-types.ts +63 -4
- package/src/shared/status-detail-text.test.ts +52 -18
- package/src/shared/status-detail-text.ts +1 -90
- package/src/shared/status-summary.ts +37 -2
- package/src/shared/status-view.test.ts +441 -0
- package/src/shared/status-view.ts +707 -0
- package/src/shared/tag-transcript.ts +115 -16
- package/src/shared/tail-hygiene-status.ts +9 -1
- package/src/shared/user-facing-codes.test.ts +3 -4
- package/src/shared/user-facing-codes.ts +33 -8
- package/src/shared/window-geometry.test.ts +23 -5
- package/src/shared/window-geometry.ts +13 -3
- package/src/tui/data/context-db.ts +50 -15
- package/src/tui/dialogs/status-dialog-colors.test.ts +58 -0
- package/src/tui/dialogs/status-dialog.tsx +288 -0
- package/src/tui/entry.mjs +11 -1
- package/src/tui/index.tsx +7 -464
- package/src/tui/slots/sidebar-content.tsx +21 -5
- package/src/tui-compiled/data/context-db.ts +50 -15
- package/src/tui-compiled/dialogs/status-dialog.tsx +552 -0
- package/src/tui-compiled/index.tsx +43 -1025
- package/src/tui-compiled/slots/sidebar-content.tsx +173 -152
- package/src/v2/tui/__fixtures__/ga-host-theme.json +160 -0
- package/src/v2/tui/events.ts +23 -0
- package/src/v2/tui/host-contract.test.ts +251 -0
- package/src/v2/tui/index.ts +526 -0
- package/src/v2/tui/load-compiled-sidebar.d.mts +59 -0
- package/src/v2/tui/load-compiled-sidebar.mjs +24 -0
- package/src/v2/tui/load-compiled-status-dialog.d.mts +17 -0
- package/src/v2/tui/load-compiled-status-dialog.mjs +16 -0
- package/src/v2/tui/sidebar-fallback.test.ts +100 -0
- package/src/v2/tui/sidebar-mount.ts +164 -0
- package/src/v2/tui/sidebar-text.test.ts +70 -0
- package/src/v2/tui/status-dialog-fallback.test.ts +97 -0
- package/src/v2/tui/status-dialog-mount.ts +76 -0
- package/src/v2/tui/theme-mapping.test.ts +57 -0
- package/src/v2/tui/types.ts +132 -0
- package/tui.js +1 -0
- package/dist/features/magic-context/memory/memory-migration.d.ts +0 -129
- package/dist/features/magic-context/memory/memory-migration.d.ts.map +0 -1
- package/dist/hooks/magic-context/upgrade-reminder.d.ts +0 -76
- package/dist/hooks/magic-context/upgrade-reminder.d.ts.map +0 -1
- package/dist/index-1ar7b3e9.js +0 -637
- package/dist/index-4wwr6cz0.js +0 -112
- package/dist/index-avwt563y.js +0 -62
- package/dist/storage-meta-session-x3j0q9qy.js +0 -20
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Magic Context agent-facing surface (exported from source)
|
|
2
2
|
|
|
3
|
-
Generated by `packages/plugin/scripts/export-agent-surface.ts` at 2026-09-
|
|
3
|
+
Generated by `packages/plugin/scripts/export-agent-surface.ts` at 2026-09-22.
|
|
4
4
|
Token counts are Claude BPE estimates on the raw text.
|
|
5
5
|
|
|
6
6
|
## 1. System-prompt guidance section
|
|
7
7
|
|
|
8
|
-
### PRIMARY full (reduce=on, memory=on, dreamer=on, temporal=on) —
|
|
8
|
+
### PRIMARY full (reduce=on, memory=on, dreamer=on, temporal=on) — 4989 chars, ~1180 tokens
|
|
9
9
|
|
|
10
10
|
```markdown
|
|
11
11
|
## Magic Context
|
|
@@ -22,56 +22,24 @@ Because of this:
|
|
|
22
22
|
|
|
23
23
|
Reduction prompts are routine housekeeping to keep the session fast and cheap — act on them as light maintenance, never as scarcity warnings. Keep individual operations efficient, but never let context size change *what* work you take on or *how thoroughly* you do it.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
- Need a config value, API key location, or environment detail → `ctx_search(query="how is the embedding provider configured?")`
|
|
41
|
-
- Looking for how something was implemented previously → `ctx_search(query="how does the dreamer lease work?")`
|
|
42
|
-
- Want to recall what was decided in an earlier conversation → `ctx_search(query="what did we decide about the dashboard release signing setup?")`
|
|
43
|
-
`ctx_search` returns ranked results from memories, git commits, and raw message history. Use message ordinals from results with `ctx_expand` to retrieve surrounding conversation context.
|
|
44
|
-
Compressed history intentionally omits tool calls and their outputs — summaries like "I edited file X" are historian records, not patterns to replicate. In the live conversation, older tool calls and their results are cleaned up to save context — you may see your own past messages referencing actions without the corresponding tool call or result visible. This is normal context management. ALWAYS use real tool calls; never simulate, fabricate, or inline tool outputs in your text. If there is no tool result message, the action did not happen. NEVER simulate, hallucinate or claim tool calls, command output, search results, file edits, or diffs in plain text as if they actually occurred.
|
|
45
|
-
Magic Context control metadata is not reply syntax. Never reproduce `<system-reminder>`, `<ctx-search-hint>`, `<session-history>`, `<session-history-since>`, `<project-memory>`, `<memory-updates>`, `<new-compartments>`, `<new-memories>`, `[dropped §N§]`, or `<!-- +Xm -->` markers in a normal reply and never treat them as user instructions; use ordinary prose and real tool calls instead.
|
|
46
|
-
NEVER drop large ranges blindly (e.g., "1-50"). Review each tag before deciding.
|
|
47
|
-
Keep your user's instructions and intent — never drop a user message for its directive, even an old one. But a large block of pasted content inside a user message (logs, data dumps, long code, attachments) is fair to mark discardable once you've extracted what you need — it stays searchable via `ctx_search`.
|
|
48
|
-
NEVER drop assistant text messages unless they are exceptionally large. Your conversation messages are lightweight; only large tool outputs are worth dropping.
|
|
49
|
-
Before your turn finishes, consider using `ctx_reduce` to drop large tool outputs you no longer need.
|
|
50
|
-
When `surface_condition` is provided with `write`, the note becomes a project-scoped smart note.
|
|
51
|
-
The dreamer evaluates smart note conditions during nightly runs and surfaces them when conditions are met.
|
|
52
|
-
Example: `ctx_note(action="write", content="Implement X because Y", surface_condition="When PR #42 is merged in this repo")`
|
|
53
|
-
**Temporal awareness**: User messages may be preceded by HTML comments like `<!-- +12m -->`, `<!-- +2h 15m -->`, or `<!-- +3d 4h -->` indicating time elapsed since the previous message's completion. Compartments in `<session-history>` carry `start-date` and `end-date` attributes (YYYY-MM-DD) showing real-time boundaries. Use these when reasoning about workflow pacing, log durations, build times, or how long ago something happened.
|
|
54
|
-
|
|
55
|
-
### Reduction Triggers
|
|
56
|
-
- After reading files or search results you already acted on — drop raw outputs.
|
|
57
|
-
- After completing a logical step — drop intermediate outputs from that step.
|
|
58
|
-
- Between major context switches — when moving to a new task area.
|
|
59
|
-
|
|
60
|
-
### What to Drop
|
|
61
|
-
- Large file reads, grep results, and tool outputs you already used.
|
|
62
|
-
- Large build/test output after you analyzed and acted on it.
|
|
63
|
-
- Old diagnostic or exploration results that are no longer relevant.
|
|
64
|
-
|
|
65
|
-
### What to Keep
|
|
66
|
-
- ALL user messages and assistant conversation text — these are cheap and compartmentalized automatically.
|
|
67
|
-
- Your current task requirements and constraints.
|
|
68
|
-
- Recent errors and unresolved decisions.
|
|
69
|
-
- Active work context and files being edited.
|
|
70
|
-
|
|
71
|
-
Prefer many small targeted operations over one large blanket operation, and keep the working set tidy as routine maintenance.
|
|
25
|
+
### Your desk
|
|
26
|
+
|
|
27
|
+
Think of your context as a desk. Every message and every tool output lands on it, and each item arrives with a §N§ tag (§1§, §42§) — the tag is the item's handle.
|
|
28
|
+
|
|
29
|
+
When an item no longer needs to stay on the desk for the work ahead, stamp it: `ctx_reduce` with its tag. Stamping does not remove anything — the item stays on the desk, fully readable. From time to time, when stamped items have piled up and the desk needs room, Magic Context clears them all in one sweep; you don't pick the moment, you only stamp. Stamp as soon as an item has served its purpose, not at the end of the turn, and do it silently: nobody wants to read "I'll drop these outputs". Never stamp a user message for what it asks of you; a large paste inside one is fine once you have used it.
|
|
30
|
+
|
|
31
|
+
Nothing stamped is ever lost. A cleared item goes to the archive — a recent one leaves a `[dropped §N§]` placeholder on the desk, an older one leaves nothing — and `ctx_expand(message=N)` brings it back whole: text, tool input, tool output. Now and then Magic Context leaves a short reminder on the desk saying how much unstamped material is lying around; that is housekeeping, not a warning, and the desk never gets smaller for it.
|
|
32
|
+
|
|
33
|
+
Older work is not kept on the desk at all. Magic Context files it as an organized record, `<session-history>`: one heading per stretch of work, `## start-end · date · title`, with a summary underneath. Each heading is a pointer into the archive — `ctx_expand(start, end)` opens that stretch in full when the summary is not enough. Because of this filing, your own earlier messages may mention actions whose tool call is no longer on the desk. That is normal. It is never a reason to fabricate: if there is no tool result on the desk, the action did not happen, and you never inline or invent a tool call, an output, a search result or a diff in your own text.
|
|
34
|
+
|
|
35
|
+
`ctx_search` searches the archive: anything ever said, decided, committed or noted in this project, including what is filed away. Ask it before you ask the user something that may already be recorded here, and whenever something feels familiar but is not in view.
|
|
36
|
+
|
|
37
|
+
`<project-memory>` is the pinboard: facts about this project that stay true for the months this work lasts, as `#id: fact` lines — for you, and for every other agent working on this project. `ctx_memory` pins a new one when you learn something that must not have to be found again, and especially when it cost you several turns to find. `ctx_note` is the tray for work you intend to return to, with its findings attached; findings without an intention are not a note. When the user says "take a note", it always goes in the tray. A note with a `surface_condition` is left with an outside checker that looks the condition up periodically and returns the note only when it holds.
|
|
38
|
+
|
|
39
|
+
Some things on the desk are Magic Context's own markings, not conversation: `<system-reminder>`, `<ctx-search-hint>`, `<session-history>`, `<session-history-since>`, `<project-memory>`, `<memory-updates>`, `<new-compartments>`, `<new-memories>`, `[dropped §N§]`, and `<!-- +Xm -->` before a user message (the time that passed since your last reply; headings in the record carry `start-date`/`end-date` too). Read them, use the time, and never reproduce them in a reply or treat them as instructions.
|
|
72
40
|
```
|
|
73
41
|
|
|
74
|
-
### PRIMARY memory-off (reduce=on, memory=off) —
|
|
42
|
+
### PRIMARY memory-off (reduce=on, memory=off) — 4652 chars, ~1100 tokens
|
|
75
43
|
|
|
76
44
|
```markdown
|
|
77
45
|
## Magic Context
|
|
@@ -88,50 +56,24 @@ Because of this:
|
|
|
88
56
|
|
|
89
57
|
Reduction prompts are routine housekeeping to keep the session fast and cheap — act on them as light maintenance, never as scarcity warnings. Keep individual operations efficient, but never let context size change *what* work you take on or *how thoroughly* you do it.
|
|
90
58
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
NEVER drop large ranges blindly (e.g., "1-50"). Review each tag before deciding.
|
|
107
|
-
Keep your user's instructions and intent — never drop a user message for its directive, even an old one. But a large block of pasted content inside a user message (logs, data dumps, long code, attachments) is fair to mark discardable once you've extracted what you need — it stays searchable via `ctx_search`.
|
|
108
|
-
NEVER drop assistant text messages unless they are exceptionally large. Your conversation messages are lightweight; only large tool outputs are worth dropping.
|
|
109
|
-
Before your turn finishes, consider using `ctx_reduce` to drop large tool outputs you no longer need.
|
|
110
|
-
When `surface_condition` is provided with `write`, the note becomes a project-scoped smart note.
|
|
111
|
-
The dreamer evaluates smart note conditions during nightly runs and surfaces them when conditions are met.
|
|
112
|
-
Example: `ctx_note(action="write", content="Implement X because Y", surface_condition="When PR #42 is merged in this repo")`
|
|
113
|
-
**Temporal awareness**: User messages may be preceded by HTML comments like `<!-- +12m -->`, `<!-- +2h 15m -->`, or `<!-- +3d 4h -->` indicating time elapsed since the previous message's completion. Compartments in `<session-history>` carry `start-date` and `end-date` attributes (YYYY-MM-DD) showing real-time boundaries. Use these when reasoning about workflow pacing, log durations, build times, or how long ago something happened.
|
|
114
|
-
|
|
115
|
-
### Reduction Triggers
|
|
116
|
-
- After reading files or search results you already acted on — drop raw outputs.
|
|
117
|
-
- After completing a logical step — drop intermediate outputs from that step.
|
|
118
|
-
- Between major context switches — when moving to a new task area.
|
|
119
|
-
|
|
120
|
-
### What to Drop
|
|
121
|
-
- Large file reads, grep results, and tool outputs you already used.
|
|
122
|
-
- Large build/test output after you analyzed and acted on it.
|
|
123
|
-
- Old diagnostic or exploration results that are no longer relevant.
|
|
124
|
-
|
|
125
|
-
### What to Keep
|
|
126
|
-
- ALL user messages and assistant conversation text — these are cheap and compartmentalized automatically.
|
|
127
|
-
- Your current task requirements and constraints.
|
|
128
|
-
- Recent errors and unresolved decisions.
|
|
129
|
-
- Active work context and files being edited.
|
|
130
|
-
|
|
131
|
-
Prefer many small targeted operations over one large blanket operation, and keep the working set tidy as routine maintenance.
|
|
59
|
+
### Your desk
|
|
60
|
+
|
|
61
|
+
Think of your context as a desk. Every message and every tool output lands on it, and each item arrives with a §N§ tag (§1§, §42§) — the tag is the item's handle.
|
|
62
|
+
|
|
63
|
+
When an item no longer needs to stay on the desk for the work ahead, stamp it: `ctx_reduce` with its tag. Stamping does not remove anything — the item stays on the desk, fully readable. From time to time, when stamped items have piled up and the desk needs room, Magic Context clears them all in one sweep; you don't pick the moment, you only stamp. Stamp as soon as an item has served its purpose, not at the end of the turn, and do it silently: nobody wants to read "I'll drop these outputs". Never stamp a user message for what it asks of you; a large paste inside one is fine once you have used it.
|
|
64
|
+
|
|
65
|
+
Nothing stamped is ever lost. A cleared item goes to the archive — a recent one leaves a `[dropped §N§]` placeholder on the desk, an older one leaves nothing — and `ctx_expand(message=N)` brings it back whole: text, tool input, tool output. Now and then Magic Context leaves a short reminder on the desk saying how much unstamped material is lying around; that is housekeeping, not a warning, and the desk never gets smaller for it.
|
|
66
|
+
|
|
67
|
+
Older work is not kept on the desk at all. Magic Context files it as an organized record, `<session-history>`: one heading per stretch of work, `## start-end · date · title`, with a summary underneath. Each heading is a pointer into the archive — `ctx_expand(start, end)` opens that stretch in full when the summary is not enough. Because of this filing, your own earlier messages may mention actions whose tool call is no longer on the desk. That is normal. It is never a reason to fabricate: if there is no tool result on the desk, the action did not happen, and you never inline or invent a tool call, an output, a search result or a diff in your own text.
|
|
68
|
+
|
|
69
|
+
`ctx_search` searches the archive: anything ever said, decided, committed or noted in this project, including what is filed away. Ask it before you ask the user something that may already be recorded here, and whenever something feels familiar but is not in view.
|
|
70
|
+
|
|
71
|
+
`ctx_note` is the tray for work you intend to return to, with its findings attached; findings without an intention are not a note. When the user says "take a note", it always goes in the tray. A note with a `surface_condition` is left with an outside checker that looks the condition up periodically and returns the note only when it holds.
|
|
72
|
+
|
|
73
|
+
Some things on the desk are Magic Context's own markings, not conversation: `<system-reminder>`, `<ctx-search-hint>`, `<session-history>`, `<session-history-since>`, `<project-memory>`, `<memory-updates>`, `<new-compartments>`, `<new-memories>`, `[dropped §N§]`, and `<!-- +Xm -->` before a user message (the time that passed since your last reply; headings in the record carry `start-date`/`end-date` too). Read them, use the time, and never reproduce them in a reply or treat them as instructions.
|
|
132
74
|
```
|
|
133
75
|
|
|
134
|
-
### PRIMARY reduce-off (reduce=off, memory=on) —
|
|
76
|
+
### PRIMARY reduce-off (reduce=off, memory=on) — 4056 chars, ~950 tokens
|
|
135
77
|
|
|
136
78
|
```markdown
|
|
137
79
|
## Magic Context
|
|
@@ -148,58 +90,46 @@ Because of this:
|
|
|
148
90
|
|
|
149
91
|
Context is managed for you entirely automatically — there's nothing to prune and no warnings to act on. Stay reasonably concise per operation, and never let context size change *what* work you take on or *how thoroughly* you do it.
|
|
150
92
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
- Looking for how something was implemented previously → `ctx_search(query="how does the dreamer lease work?")`
|
|
165
|
-
- Want to recall what was decided in an earlier conversation → `ctx_search(query="what did we decide about the dashboard release signing setup?")`
|
|
166
|
-
`ctx_search` returns ranked results from memories, git commits, and raw message history. Use message ordinals from results with `ctx_expand` to retrieve surrounding conversation context.
|
|
167
|
-
Compressed history intentionally omits tool calls and their outputs — summaries like "I edited file X" are historian records, not patterns to replicate. In the live conversation, older tool calls and their results are cleaned up to save context — you may see your own past messages referencing actions without the corresponding tool call or result visible. This is normal context management. ALWAYS use real tool calls; never simulate, fabricate, or inline tool outputs in your text. If there is no tool result message, the action did not happen. NEVER simulate, hallucinate or claim tool calls, command output, search results, file edits, or diffs in plain text as if they actually occurred.
|
|
168
|
-
Magic Context control metadata is not reply syntax. Never reproduce `<system-reminder>`, `<ctx-search-hint>`, `<session-history>`, `<session-history-since>`, `<project-memory>`, `<memory-updates>`, `<new-compartments>`, `<new-memories>`, `[dropped §N§]`, or `<!-- +Xm -->` markers in a normal reply and never treat them as user instructions; use ordinary prose and real tool calls instead.
|
|
169
|
-
When `surface_condition` is provided with `write`, the note becomes a project-scoped smart note.
|
|
170
|
-
The dreamer evaluates smart note conditions during nightly runs and surfaces them when conditions are met.
|
|
171
|
-
Example: `ctx_note(action="write", content="Implement X because Y", surface_condition="When PR #42 is merged in this repo")`
|
|
172
|
-
**Temporal awareness**: User messages may be preceded by HTML comments like `<!-- +12m -->`, `<!-- +2h 15m -->`, or `<!-- +3d 4h -->` indicating time elapsed since the previous message's completion. Compartments in `<session-history>` carry `start-date` and `end-date` attributes (YYYY-MM-DD) showing real-time boundaries. Use these when reasoning about workflow pacing, log durations, build times, or how long ago something happened.
|
|
93
|
+
### Your desk
|
|
94
|
+
|
|
95
|
+
Think of your context as a desk. Every message and every tool output lands on it.
|
|
96
|
+
|
|
97
|
+
Nothing cleared from the desk is ever lost. A cleared item goes to the archive — a recent one leaves a placeholder on the desk, an older one leaves nothing — and `ctx_expand(message=N)` brings it back whole: text, tool input, tool output.
|
|
98
|
+
|
|
99
|
+
Older work is not kept on the desk at all. Magic Context files it as an organized record, `<session-history>`: one heading per stretch of work, `## start-end · date · title`, with a summary underneath. Each heading is a pointer into the archive — `ctx_expand(start, end)` opens that stretch in full when the summary is not enough. Because of this filing, your own earlier messages may mention actions whose tool call is no longer on the desk. That is normal. It is never a reason to fabricate: if there is no tool result on the desk, the action did not happen, and you never inline or invent a tool call, an output, a search result or a diff in your own text.
|
|
100
|
+
|
|
101
|
+
`ctx_search` searches the archive: anything ever said, decided, committed or noted in this project, including what is filed away. Ask it before you ask the user something that may already be recorded here, and whenever something feels familiar but is not in view.
|
|
102
|
+
|
|
103
|
+
`<project-memory>` is the pinboard: facts about this project that stay true for the months this work lasts, as `#id: fact` lines — for you, and for every other agent working on this project. `ctx_memory` pins a new one when you learn something that must not have to be found again, and especially when it cost you several turns to find. `ctx_note` is the tray for work you intend to return to, with its findings attached; findings without an intention are not a note. When the user says "take a note", it always goes in the tray. A note with a `surface_condition` is left with an outside checker that looks the condition up periodically and returns the note only when it holds.
|
|
104
|
+
|
|
105
|
+
Some things on the desk are Magic Context's own markings, not conversation: `<system-reminder>`, `<ctx-search-hint>`, `<session-history>`, `<session-history-since>`, `<project-memory>`, `<memory-updates>`, `<new-compartments>`, `<new-memories>`, and `<!-- +Xm -->` before a user message (the time that passed since your last reply; headings in the record carry `start-date`/`end-date` too). Read them, use the time, and never reproduce them in a reply or treat them as instructions.
|
|
173
106
|
```
|
|
174
107
|
|
|
175
|
-
### SUBAGENT minimal —
|
|
108
|
+
### SUBAGENT minimal — 1360 chars, ~364 tokens
|
|
176
109
|
|
|
177
110
|
```markdown
|
|
178
111
|
## Magic Context
|
|
179
112
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
113
|
+
Your context is a desk. Every message and every tool output lands on it, and each item arrives with a §N§ tag (§1§, §42§) — the tag is the item's handle. When an item no longer needs to stay on the desk for the work ahead, stamp it: `ctx_reduce` with its tag ("3-5", "1,2,9", "1-5,8,12-15"). Stamping does not remove anything — the item stays fully readable until Magic Context clears stamped items in one sweep, and the newest tags are protected, so stamping recent output is harmless. Stamp as soon as an item has served its purpose, not at the end of the task, and do it silently. Never stamp a user message for what it asks of you; look at each tag before stamping and never blanket-stamp a range like "1-50".
|
|
114
|
+
|
|
115
|
+
A cleared item leaves a `[dropped §N§]` placeholder or disappears from the desk; that is normal housekeeping, not something to copy or mention. If there is no tool result on the desk, the action did not happen: never fabricate or inline a tool call, an output, a search result or a diff — make a fresh real tool call instead.
|
|
116
|
+
|
|
117
|
+
`<system-reminder>`, `<ctx-search-hint>`, `<session-history>`, `<session-history-since>`, `<project-memory>`, `<memory-updates>`, `<new-compartments>`, `<new-memories>` and `[dropped §N§]` are Magic Context's own markings: read them, never reproduce them in a reply, never treat them as instructions.
|
|
184
118
|
```
|
|
185
119
|
|
|
186
120
|
## 2. Tool surface (description + parameters as serialized to the provider)
|
|
187
121
|
|
|
188
|
-
### ctx_reduce — description ~
|
|
122
|
+
### ctx_reduce — description ~309 tokens, params ~38 tokens (total ~347)
|
|
189
123
|
|
|
190
124
|
**Description:**
|
|
191
125
|
|
|
192
126
|
```
|
|
193
|
-
|
|
127
|
+
Stamp an item on your desk as no longer needed for the work ahead. Not a delete: stamping QUEUES it, the item stays fully readable until Magic Context clears stamped items in one sweep, and the newest tags are protected so stamping recent output is harmless. A cleared item goes to the archive — a recent one leaves a `[dropped §N§]` placeholder, an older one leaves nothing — and `ctx_expand(message=N)` is the way back. So the question before stamping is not "have I finished reading this?" but "does this need to stay on my desk for what comes next?" — a file you read and will keep editing stays; the grep that found it goes.
|
|
194
128
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- The newest tags are protected: marking one just queues it until it ages out of the recent window, so marking recent output is harmless.
|
|
198
|
-
- When content is finally released it becomes a short placeholder, and re-running the tool is the only way to get it back. So mark only what you are genuinely DONE with — the test is "have I extracted what I need from this?", not "is it safe / do I have time before it drops?".
|
|
129
|
+
Stamp: file reads, search results and tool outputs the work ahead no longer needs; build/test output after you acted on it; repeated or redundant dumps; data written to disk; status/log output that only confirmed what you expected; a large block pasted inside a user message once you have used it.
|
|
130
|
+
Keep: user messages (never stamp one for its directive), your own conversation text, unresolved errors, raw evidence you haven't extracted yet, and outputs whose exact wording may still matter.
|
|
199
131
|
|
|
200
|
-
|
|
201
|
-
Keep: user messages, unresolved errors, raw evidence you haven't extracted yet, and outputs whose exact wording may matter later.
|
|
202
|
-
Never blanket-mark large ranges (e.g. "1-50") — review what each tag holds first.
|
|
132
|
+
Look at each tag before stamping it; never blanket-stamp a range like "1-50". Many small targeted stamps beat one sweep. `drop` accepts "3-5", "1,2,9", "1-5,8,12-15".
|
|
203
133
|
```
|
|
204
134
|
|
|
205
135
|
**Parameters (JSON Schema per parameter, as serialized to the provider):**
|
|
@@ -207,28 +137,26 @@ Never blanket-mark large ranges (e.g. "1-50") — review what each tag holds fir
|
|
|
207
137
|
```json
|
|
208
138
|
{
|
|
209
139
|
"drop": {
|
|
210
|
-
"description": "Tag IDs to drop
|
|
140
|
+
"description": "Tag IDs to drop: \"3-5\", \"1,2,9\", \"1-5,8,12-15\".",
|
|
211
141
|
"type": "string"
|
|
212
142
|
}
|
|
213
143
|
}
|
|
214
144
|
```
|
|
215
145
|
|
|
216
|
-
### ctx_expand — description ~
|
|
146
|
+
### ctx_expand — description ~257 tokens, params ~121 tokens (total ~378)
|
|
217
147
|
|
|
218
148
|
**Description:**
|
|
219
149
|
|
|
220
150
|
```
|
|
221
|
-
Recover the original conversation
|
|
222
|
-
|
|
223
|
-
Older parts of this session are summarized under `## start-end · date · title` headings inside <session-history> — e.g. `## 120-245 · … · Fixed tagger collision`. Each heading replaces the raw messages in that ordinal range with a summary. When the summary isn't enough — you need exact wording, a specific value, an error message, or the reasoning behind a decision — expand the range:
|
|
151
|
+
Recover the original conversation behind your compacted history.
|
|
224
152
|
|
|
225
|
-
ctx_expand(start=120, end=245)
|
|
153
|
+
Earlier turns are summarized in <session-history> under `## start-end · date · title` headings; each heading stands for the raw messages in that ordinal range. When the summary isn't enough — exact wording, a value, an error message, the reasoning behind a decision — expand the range: ctx_expand(start=120, end=245). Also works around a ctx_search message hit: start=N-10, end=N+5. Ranges after the last compartment are your live tail — already visible, not expandable.
|
|
226
154
|
|
|
227
|
-
Returns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversized range returns the head and
|
|
155
|
+
Returns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversized range returns the head and says where to continue.
|
|
228
156
|
|
|
229
|
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
157
|
+
Finer recovery:
|
|
158
|
+
- verbose=true lists each message separately with its ordinal and a per-part preview (tool calls with output sizes) so you can pick one.
|
|
159
|
+
- message=N returns that one message in full — every text part and every tool call's complete input and output — from stored history. This is the way back to a tool output you released with ctx_reduce; if the message was deleted from history it says so.
|
|
232
160
|
```
|
|
233
161
|
|
|
234
162
|
**Parameters (JSON Schema per parameter, as serialized to the provider):**
|
|
@@ -236,45 +164,45 @@ Two recovery modes for finer detail:
|
|
|
236
164
|
```json
|
|
237
165
|
{
|
|
238
166
|
"start": {
|
|
239
|
-
"description": "First
|
|
167
|
+
"description": "First ordinal of the range — a compartment's start, or an ordinal from a ctx_search hit.",
|
|
240
168
|
"type": "number"
|
|
241
169
|
},
|
|
242
170
|
"end": {
|
|
243
|
-
"description": "Last
|
|
171
|
+
"description": "Last ordinal of the range, inclusive — a compartment's end.",
|
|
244
172
|
"type": "number"
|
|
245
173
|
},
|
|
246
174
|
"verbose": {
|
|
247
|
-
"description": "With start/end:
|
|
175
|
+
"description": "With start/end: one entry per message with ordinal and per-part preview instead of the transcript.",
|
|
248
176
|
"type": "boolean"
|
|
249
177
|
},
|
|
250
178
|
"message": {
|
|
251
|
-
"description": "
|
|
179
|
+
"description": "Recover ONE message in full by ordinal (all text, all tool inputs and outputs). Use alone, without start/end.",
|
|
252
180
|
"type": "number"
|
|
253
181
|
}
|
|
254
182
|
}
|
|
255
183
|
```
|
|
256
184
|
|
|
257
|
-
### ctx_note — description ~
|
|
185
|
+
### ctx_note — description ~376 tokens, params ~284 tokens (total ~660)
|
|
258
186
|
|
|
259
187
|
**Description:**
|
|
260
188
|
|
|
261
189
|
```
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
Use
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
190
|
+
Session notes are pending intentions: work you intend to return to, with its findings attached.
|
|
191
|
+
|
|
192
|
+
Use notes for:
|
|
193
|
+
- A finding to revisit when you return to the intended work
|
|
194
|
+
- A decision with its reasoning, when follow-up work remains
|
|
195
|
+
- A backlog item with evidence already found
|
|
196
|
+
- Something the user explicitly asks you to note
|
|
197
|
+
|
|
198
|
+
Don't use notes for: the next few steps; a plan you are actively executing; restart/fold insurance; or a record of how things stand (world-state, a design at a point in time) with nothing you intend to do about it — that goes stale silently; a fact worth keeping is memory, the rest is nothing. Use todos for active work. If the detail already lives in a file, record the path and what to inspect — don't copy the file into a note. Durable project facts belong in ctx_memory, not notes.
|
|
199
|
+
|
|
200
|
+
First line is the title (under 80 chars), followed by detail. Operations:
|
|
201
|
+
- write: save a new note (content required)
|
|
202
|
+
- read: one row per note — `#id · age · title` — ready smart notes first, then newest; rows untouched 30+ days are marked stale. Pass note_ids to read full bodies; limit/offset page; filter selects other statuses.
|
|
203
|
+
- update: change one note (note_ids=[N])
|
|
204
|
+
- dismiss: retire 1–50 notes (note_ids). Dismiss a note when its work lands or is abandoned; a queue you never dismiss from stops being read.
|
|
205
|
+
- surface_condition: make it a smart note — an outside checker periodically tests the condition using only externally verifiable signals (GitHub state, files, git, releases, web), never this conversation or future actions; the note is parked until the condition holds.
|
|
278
206
|
```
|
|
279
207
|
|
|
280
208
|
**Parameters (JSON Schema per parameter, as serialized to the provider):**
|
|
@@ -282,7 +210,7 @@ Example: ctx_note(action="write", content="Re-run the perf benchmark once the bo
|
|
|
282
210
|
```json
|
|
283
211
|
{
|
|
284
212
|
"action": {
|
|
285
|
-
"description": "
|
|
213
|
+
"description": "write | read | update | dismiss. Defaults to write when content is given, else read.",
|
|
286
214
|
"type": "string",
|
|
287
215
|
"enum": [
|
|
288
216
|
"write",
|
|
@@ -292,15 +220,15 @@ Example: ctx_note(action="write", content="Re-run the perf benchmark once the bo
|
|
|
292
220
|
]
|
|
293
221
|
},
|
|
294
222
|
"content": {
|
|
295
|
-
"description": "Note text
|
|
223
|
+
"description": "Note text for write/update: first line is the title (under 80 chars), then the detail.",
|
|
296
224
|
"type": "string"
|
|
297
225
|
},
|
|
298
226
|
"surface_condition": {
|
|
299
|
-
"description": "
|
|
227
|
+
"description": "Makes this a smart note: a condition an outside checker can verify on its own, periodically — repository state, releases, web pages, anything it can look up — never something only this conversation knows. The note is parked until the condition holds.",
|
|
300
228
|
"type": "string"
|
|
301
229
|
},
|
|
302
230
|
"filter": {
|
|
303
|
-
"description": "
|
|
231
|
+
"description": "Read filter: active (default: active + ready), all, pending (unsurfaced smart notes), ready, dismissed.",
|
|
304
232
|
"type": "string",
|
|
305
233
|
"enum": [
|
|
306
234
|
"all",
|
|
@@ -311,19 +239,15 @@ Example: ctx_note(action="write", content="Re-run the perf benchmark once the bo
|
|
|
311
239
|
]
|
|
312
240
|
},
|
|
313
241
|
"limit": {
|
|
314
|
-
"description": "
|
|
242
|
+
"description": "Rows per read (default 25).",
|
|
315
243
|
"type": "number"
|
|
316
244
|
},
|
|
317
245
|
"offset": {
|
|
318
|
-
"description": "Skip this many newest
|
|
319
|
-
"type": "number"
|
|
320
|
-
},
|
|
321
|
-
"note_id": {
|
|
322
|
-
"description": "Note ID (required for 'dismiss' and 'update' actions).",
|
|
246
|
+
"description": "Skip this many newest rows (default 0).",
|
|
323
247
|
"type": "number"
|
|
324
248
|
},
|
|
325
249
|
"note_ids": {
|
|
326
|
-
"description": "
|
|
250
|
+
"description": "Note ids: one for update, 1–50 for dismiss, any number for read (returns full bodies). Ignored by write.",
|
|
327
251
|
"minItems": 1,
|
|
328
252
|
"maxItems": 50,
|
|
329
253
|
"type": "array",
|
|
@@ -336,23 +260,22 @@ Example: ctx_note(action="write", content="Re-run the perf benchmark once the bo
|
|
|
336
260
|
}
|
|
337
261
|
```
|
|
338
262
|
|
|
339
|
-
### ctx_memory — description ~
|
|
263
|
+
### ctx_memory — description ~278 tokens, params ~190 tokens (total ~468)
|
|
340
264
|
|
|
341
265
|
**Description:**
|
|
342
266
|
|
|
343
267
|
```
|
|
344
|
-
Durable project
|
|
268
|
+
Durable facts about this project, shared with every agent working on it and kept for the months this work lasts.
|
|
345
269
|
|
|
346
|
-
Your active memories are already
|
|
270
|
+
Your active memories are already in <project-memory> as `#id: fact` lines. Write one when you learn something that must not have to be found again — a project rule, an architectural fact, a hard-won constraint, a config value, a naming convention — and especially when it cost you turns to find. One standalone fact per memory, phrased to make sense on its own. A pending intention with its evidence ("do X later, here is what we know") is ctx_note, not memory.
|
|
347
271
|
|
|
348
272
|
Actions:
|
|
349
|
-
- write:
|
|
350
|
-
- update: rewrite one memory whose fact changed (ids: [one], content).
|
|
273
|
+
- write: new memory (content + category).
|
|
274
|
+
- update: rewrite one memory whose fact changed (ids: [one], content; category optional to recategorize).
|
|
351
275
|
- archive: retire wrong or obsolete memories (ids: [one or more], optional reason).
|
|
352
|
-
- merge: collapse duplicates into one
|
|
353
|
-
- get: fetch
|
|
354
|
-
|
|
355
|
-
Example: ctx_memory(action="write", category="CONSTRAINTS", content="Pi stores sessions as JSONL under ~/.pi/agent/sessions/, not SQLite")
|
|
276
|
+
- merge: collapse duplicates into one (ids: [two or more], content).
|
|
277
|
+
- get: fetch by id (ids: 1–20), readable in every status.
|
|
278
|
+
Examples: category="CONFIG_VALUES", content="OpenCode source is at ~/Work/OSS/opencode" · category="CONSTRAINTS", content="Dashboard Tauri build needs RGBA PNGs, not grayscale"
|
|
356
279
|
```
|
|
357
280
|
|
|
358
281
|
**Parameters (JSON Schema per parameter, as serialized to the provider):**
|
|
@@ -360,23 +283,22 @@ Example: ctx_memory(action="write", category="CONSTRAINTS", content="Pi stores s
|
|
|
360
283
|
```json
|
|
361
284
|
{
|
|
362
285
|
"action": {
|
|
363
|
-
"description": "
|
|
286
|
+
"description": "write | update | archive | merge | get",
|
|
364
287
|
"type": "string",
|
|
365
288
|
"enum": [
|
|
366
289
|
"write",
|
|
367
|
-
"archive",
|
|
368
290
|
"update",
|
|
291
|
+
"archive",
|
|
369
292
|
"merge",
|
|
370
|
-
"get"
|
|
371
|
-
"list"
|
|
293
|
+
"get"
|
|
372
294
|
]
|
|
373
295
|
},
|
|
374
296
|
"content": {
|
|
375
|
-
"description": "The memory text — one standalone fact (
|
|
297
|
+
"description": "The memory text — one standalone fact (write, update, merge).",
|
|
376
298
|
"type": "string"
|
|
377
299
|
},
|
|
378
300
|
"category": {
|
|
379
|
-
"description": "
|
|
301
|
+
"description": "Kind of fact (required for write; on update/merge optional, omitted keeps the current category).",
|
|
380
302
|
"type": "string",
|
|
381
303
|
"enum": [
|
|
382
304
|
"PROJECT_RULES",
|
|
@@ -387,47 +309,44 @@ Example: ctx_memory(action="write", category="CONSTRAINTS", content="Pi stores s
|
|
|
387
309
|
]
|
|
388
310
|
},
|
|
389
311
|
"ids": {
|
|
390
|
-
"description": "
|
|
312
|
+
"description": "Memory ids from <project-memory>: one for update, one or more for archive, two or more for merge, 1–20 for get.",
|
|
391
313
|
"type": "array",
|
|
392
314
|
"items": {
|
|
393
315
|
"type": "number"
|
|
394
316
|
}
|
|
395
317
|
},
|
|
396
318
|
"limit": {
|
|
397
|
-
"description": "Max results for list (default
|
|
319
|
+
"description": "Max results for list (default 10).",
|
|
398
320
|
"type": "number"
|
|
399
321
|
},
|
|
400
322
|
"reason": {
|
|
401
|
-
"description": "Why
|
|
323
|
+
"description": "Why it is being archived (optional).",
|
|
402
324
|
"type": "string"
|
|
403
325
|
}
|
|
404
326
|
}
|
|
405
327
|
```
|
|
406
328
|
|
|
407
|
-
### ctx_search — description ~
|
|
329
|
+
### ctx_search — description ~322 tokens, params ~132 tokens (total ~454)
|
|
408
330
|
|
|
409
331
|
**Description:**
|
|
410
332
|
|
|
411
333
|
```
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
Retrieval matches meaning
|
|
415
|
-
-
|
|
416
|
-
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
-
|
|
424
|
-
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
- "did we discuss this earlier" → ["message"]
|
|
429
|
-
- "did we decide something about this / leave a follow-up" → ["note"]
|
|
430
|
-
- "what's our convention / rule for X" → ["memory"]
|
|
334
|
+
Search the archive — everything that ever happened in this project, not just what is on your desk.
|
|
335
|
+
|
|
336
|
+
Retrieval matches meaning and exact words and fuses them, so phrase `query` as a natural-language question that still carries the exact terms you expect in the answer (paths, symbols, config keys, error strings); a bare keyword stack finds less.
|
|
337
|
+
- "where is the opencode source code path?" (a location you once knew)
|
|
338
|
+
- "why did we choose SQLite over postgres?" (a decision and its reasons)
|
|
339
|
+
- "how does the dreamer lease work?" (a mechanism discussed or implemented earlier)
|
|
340
|
+
- Not: "upload client retry backoff config"
|
|
341
|
+
|
|
342
|
+
Results only contain what you CANNOT currently see — memories already in <project-memory> and the live tail are filtered out. A query that is just memory ids (`#7234`, `12, 34`) resolves them directly.
|
|
343
|
+
|
|
344
|
+
Sources (omit for all):
|
|
345
|
+
- memory — rules, constraints, conventions; "what's our convention for X"
|
|
346
|
+
- message — the raw conversation behind compacted history; "did we discuss this"; hits carry ordinals for ctx_expand(start=N-10, end=N+5)
|
|
347
|
+
- git_commit — commit history; "when did this change" (pair with message for regression hunts)
|
|
348
|
+
- note — parked follow-ups with their recorded text; "did we leave a follow-up"
|
|
349
|
+
Use from/to to restrict every source to an inclusive UTC date range.
|
|
431
350
|
```
|
|
432
351
|
|
|
433
352
|
**Parameters (JSON Schema per parameter, as serialized to the provider):**
|
|
@@ -435,15 +354,23 @@ Picking sources:
|
|
|
435
354
|
```json
|
|
436
355
|
{
|
|
437
356
|
"query": {
|
|
438
|
-
"description": "
|
|
357
|
+
"description": "A natural-language question carrying the exact terms you expect in the answer.",
|
|
439
358
|
"type": "string"
|
|
440
359
|
},
|
|
441
360
|
"limit": {
|
|
442
|
-
"description": "Maximum results
|
|
361
|
+
"description": "Maximum results (default 10).",
|
|
443
362
|
"type": "number"
|
|
444
363
|
},
|
|
364
|
+
"from": {
|
|
365
|
+
"description": "Earliest date, YYYY-MM-DD (inclusive).",
|
|
366
|
+
"type": "string"
|
|
367
|
+
},
|
|
368
|
+
"to": {
|
|
369
|
+
"description": "Latest date, YYYY-MM-DD (inclusive; default open).",
|
|
370
|
+
"type": "string"
|
|
371
|
+
},
|
|
445
372
|
"sources": {
|
|
446
|
-
"description": "
|
|
373
|
+
"description": "Restrict to these sources; omit for all. [] searches none.",
|
|
447
374
|
"type": "array",
|
|
448
375
|
"items": {
|
|
449
376
|
"type": "string",
|
|
@@ -465,9 +392,9 @@ The hash handler persists the MD5 of `output.system.join("\\n")`. The values bel
|
|
|
465
392
|
|
|
466
393
|
| Variant | Guidance bytes | MD5 system-prompt hash |
|
|
467
394
|
|---|---:|---|
|
|
468
|
-
| PRIMARY full |
|
|
469
|
-
| PRIMARY memory-off |
|
|
470
|
-
| PRIMARY reduce-off |
|
|
471
|
-
| SUBAGENT minimal |
|
|
395
|
+
| PRIMARY full | 5025 | `eaed1eda58c1c741546c9094481f4f0a` |
|
|
396
|
+
| PRIMARY memory-off | 4686 | `573866747d9aac2999f616a7885fb77a` |
|
|
397
|
+
| PRIMARY reduce-off | 4078 | `0a969d63dfe7d83f301099610556c418` |
|
|
398
|
+
| SUBAGENT minimal | 1376 | `2f5a0e99b9171fdfa08c7920cb18dc4d` |
|
|
472
399
|
|
|
473
400
|
The OpenCode and Pi runtime compatibility tests consume this snapshot for omitted `prompt_surface` and explicit `{ default: "full" }`: both assert guidance, registered tool descriptions, tool IDs, and hashes; OpenCode also asserts these parameter schemas directly, while Pi asserts its TypeBox-owned schemas stay byte-identical across both config forms.
|