@north-light/crouter 0.3.353 → 0.3.355
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/dist/api/client.d.ts +35 -25
- package/dist/api/client.js +2 -2
- package/dist/api/dto/broker-ops.d.ts +2 -36
- package/dist/api/dto/canvas.d.ts +8 -13
- package/dist/api/dto/config.d.ts +4 -0
- package/dist/api/dto/delivery.d.ts +61 -0
- package/dist/api/dto/docs.d.ts +135 -0
- package/dist/api/dto/docs.js +1 -0
- package/dist/api/dto/health.d.ts +26 -79
- package/dist/api/dto/node-outcomes.d.ts +1 -3
- package/dist/api/dto/nodes.d.ts +5 -26
- package/dist/api/dto/objects.d.ts +168 -0
- package/dist/api/dto/objects.js +1 -0
- package/dist/api/dto/profiles.d.ts +14 -8
- package/dist/api/dto/reports.d.ts +9 -7
- package/dist/api/dto/reviews.d.ts +11 -3
- package/dist/api/dto/worktree.d.ts +1 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +1 -1
- package/dist/api/routes.d.ts +14 -12
- package/dist/api/routes.js +1 -1
- package/dist/build-root.js +1 -1
- package/dist/builtin-memory/00-runtime-base/00-authoring.md +10 -5
- package/dist/builtin-memory/02-turn-lifecycle/02-resident.md +1 -0
- package/dist/builtin-memory/04-orchestration-kernel.md +10 -31
- package/dist/builtin-memory/05-kinds/advisor/01-orchestrator.md +1 -1
- package/dist/builtin-memory/05-kinds/explore/00-base.md +2 -2
- package/dist/builtin-memory/05-kinds/explore/01-orchestrator.md +2 -2
- package/dist/builtin-memory/crouter-concepts/INDEX.md +2 -2
- package/dist/builtin-memory/crouter-concepts/lifecycle-and-wakes.md +1 -1
- package/dist/builtin-memory/crouter-concepts/memory.md +15 -15
- package/dist/builtin-memory/crouter-concepts/nodes-and-the-canvas.md +1 -1
- package/dist/builtin-memory/crouter-concepts/profiles-kinds-and-modes.md +5 -5
- package/dist/builtin-memory/crouter-concepts/scopes-and-trust.md +1 -1
- package/dist/builtin-memory/crouter-concepts/why-a-daemon.md +1 -1
- package/dist/builtin-memory/crouter-sdk/INDEX.md +2 -2
- package/dist/builtin-memory/crouter-sdk/README.md +5 -6
- package/dist/builtin-memory/crouter-sdk/errors.md +0 -13
- package/dist/builtin-memory/crouter-sdk/guides/README.md +0 -1
- package/dist/builtin-memory/crouter-sdk/guides/event-driven-assistant.md +2 -2
- package/dist/builtin-memory/crouter-sdk/nodes.md +0 -2
- package/dist/builtin-memory/crouter-sdk/resources.md +0 -1
- package/dist/builtin-memory/explore/exploration-doc.md +4 -4
- package/dist/builtin-memory/insights/capture.md +6 -6
- package/dist/builtin-memory/insights/init.md +14 -14
- package/dist/builtin-memory/internal/INDEX.md +4 -4
- package/dist/builtin-memory/internal/agent-shaping.md +20 -20
- package/dist/builtin-memory/internal/examples/imessage-assistant.md +2 -2
- package/dist/builtin-memory/internal/marketplaces.md +2 -2
- package/dist/builtin-memory/internal/memory-loading.md +31 -30
- package/dist/builtin-memory/internal/nodes-and-canvas.md +1 -1
- package/dist/builtin-memory/internal/plugins.md +16 -14
- package/dist/builtin-memory/internal/storage-tiers.md +4 -4
- package/dist/builtin-memory/memory-read-orientation.md +1 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +32 -40
- package/dist/clients/attach/input/controller.js +1 -1
- package/dist/clients/attach/input/ref-autocomplete.js +1 -1
- package/dist/clients/attach/input/titled-editor.js +1 -1
- package/dist/clients/attach/overlays/file-review.d.ts +1 -0
- package/dist/clients/attach/overlays/file-review.js +2 -2
- package/dist/clients/attach/render/chat-view.d.ts +6 -0
- package/dist/clients/attach/render/chat-view.js +2 -2
- package/dist/clients/attach/render/crtr-output.d.ts +1 -2
- package/dist/clients/attach/render/crtr-output.js +17 -17
- package/dist/clients/attach/render/doc-links.d.ts +34 -0
- package/dist/clients/attach/render/doc-links.js +1 -0
- package/dist/clients/attach/render/group-activity.d.ts +8 -8
- package/dist/clients/attach/render/group-activity.js +2 -2
- package/dist/clients/attach/render/group-recap.js +1 -1
- package/dist/clients/attach/render/markdown-source.js +5 -5
- package/dist/clients/attach/render/tool-calls.d.ts +1 -1
- package/dist/clients/attach/session/doc-materialize.d.ts +53 -0
- package/dist/clients/attach/session/doc-materialize.js +3 -0
- package/dist/clients/attach/session/document-links.d.ts +21 -0
- package/dist/clients/attach/session/document-links.js +1 -0
- package/dist/clients/attach/session/file-links.d.ts +2 -0
- package/dist/clients/attach/session/file-links.js +1 -1
- package/dist/clients/attach/session/profile-files.js +1 -1
- package/dist/clients/attach/slash/dispatch.js +1 -1
- package/dist/clients/attach/viewer.js +816 -1561
- package/dist/clients/inbox/review/review-client.d.ts +5 -1
- package/dist/clients/inbox/review/review-client.js +1 -1
- package/dist/commands/api-client.d.ts +2 -0
- package/dist/commands/api-client.js +3 -3
- package/dist/commands/canvas/edges.d.ts +2 -0
- package/dist/commands/canvas/edges.js +2 -0
- package/dist/commands/canvas/list.d.ts +4 -0
- package/dist/commands/canvas/list.js +3 -0
- package/dist/commands/canvas/read.d.ts +8 -0
- package/dist/commands/canvas/read.js +5 -0
- package/dist/commands/canvas/search.d.ts +2 -0
- package/dist/commands/canvas/search.js +3 -0
- package/dist/commands/canvas/unwatch.d.ts +2 -0
- package/dist/commands/canvas/unwatch.js +1 -0
- package/dist/commands/canvas/watch.d.ts +3 -0
- package/dist/commands/canvas/watch.js +1 -0
- package/dist/commands/canvas-analytics.js +1 -1
- package/dist/commands/canvas-history/grep.js +4 -4
- package/dist/commands/canvas-history/read.js +2 -2
- package/dist/commands/canvas-history/search.js +7 -7
- package/dist/commands/canvas-history/shared.d.ts +0 -1
- package/dist/commands/canvas-history/shared.js +1 -1
- package/dist/commands/canvas-history/stats.js +2 -2
- package/dist/commands/canvas-history.js +1 -1
- package/dist/commands/canvas.js +1 -1
- package/dist/commands/doc/delete.d.ts +2 -0
- package/dist/commands/doc/delete.js +1 -0
- package/dist/commands/doc/edit.d.ts +2 -0
- package/dist/commands/doc/edit.js +1 -0
- package/dist/commands/doc/history.d.ts +2 -0
- package/dist/commands/doc/history.js +2 -0
- package/dist/commands/doc/lint.d.ts +2 -0
- package/dist/commands/doc/lint.js +2 -0
- package/dist/commands/doc/list.d.ts +2 -0
- package/dist/commands/doc/list.js +1 -0
- package/dist/commands/doc/move.d.ts +2 -0
- package/dist/commands/doc/move.js +1 -0
- package/dist/commands/doc/read.d.ts +2 -0
- package/dist/commands/doc/read.js +1 -0
- package/dist/commands/doc/shared.d.ts +25 -0
- package/dist/commands/doc/shared.js +2 -0
- package/dist/commands/doc/write.d.ts +2 -0
- package/dist/commands/doc/write.js +1 -0
- package/dist/commands/{memory.d.ts → doc.d.ts} +1 -1
- package/dist/commands/doc.js +1 -0
- package/dist/commands/human/review.js +1 -1
- package/dist/commands/node/bash.js +2 -2
- package/dist/commands/node/create.js +1 -1
- package/dist/commands/node/inspect.js +10 -10
- package/dist/commands/node/lifecycle.js +2 -2
- package/dist/commands/node/outcome.js +1 -1
- package/dist/commands/node/subscription.js +1 -1
- package/dist/commands/node-context.js +2 -2
- package/dist/commands/pkg/browse/catalog.js +1 -1
- package/dist/commands/pkg/browse/doc-view.js +1 -1
- package/dist/commands/pkg/browse/model.d.ts +9 -17
- package/dist/commands/pkg/plugin-inspect.js +1 -1
- package/dist/commands/pkg/plugin-manage.d.ts +4 -8
- package/dist/commands/pkg/plugin-manage.js +15 -17
- package/dist/commands/profile/list.js +1 -1
- package/dist/commands/profile/new.js +1 -1
- package/dist/commands/profile/project.js +1 -1
- package/dist/commands/profile/show.js +1 -1
- package/dist/commands/push.js +3 -3
- package/dist/commands/sys/config.js +1 -1
- package/dist/commands/sys/context/admin/actions.d.ts +18 -43
- package/dist/commands/sys/context/admin/actions.js +1 -2
- package/dist/commands/sys/context/admin/detail-panel.d.ts +17 -25
- package/dist/commands/sys/context/admin/detail-panel.js +2 -1
- package/dist/commands/sys/context/admin/docs-panel.d.ts +7 -6
- package/dist/commands/sys/context/admin/docs-panel.js +1 -1
- package/dist/commands/sys/context/admin/list-view.d.ts +12 -12
- package/dist/commands/sys/context/admin/list-view.js +1 -1
- package/dist/commands/sys/context/admin/model.d.ts +96 -69
- package/dist/commands/sys/context/admin/model.js +1 -1
- package/dist/commands/sys/context/admin/rail-panel.d.ts +7 -5
- package/dist/commands/sys/context/admin/rail-panel.js +1 -1
- package/dist/commands/sys/context/admin/read-view.d.ts +10 -14
- package/dist/commands/sys/context/admin/read-view.js +1 -2
- package/dist/commands/sys/context/admin/shell.d.ts +26 -31
- package/dist/commands/sys/context/admin/shell.js +1 -1
- package/dist/commands/sys/context/admin.js +2 -2
- package/dist/commands/sys/context/doc.js +2 -3
- package/dist/commands/sys/context/expose.js +2 -2
- package/dist/commands/sys/context/prompt-review.js +4 -4
- package/dist/commands/sys/context/resolve.d.ts +92 -65
- package/dist/commands/sys/context/resolve.js +7 -9
- package/dist/commands/sys/context.js +1 -1
- package/dist/commands/sys/doctor.js +1 -1
- package/dist/commands/sys/migrate.js +1 -1
- package/dist/commands/sys/panels/profiles-panel.d.ts +3 -1
- package/dist/commands/sys/panels/profiles-panel.js +1 -1
- package/dist/commands/sys/sync-deps.d.ts +6 -11
- package/dist/commands/sys/sync-deps.js +7 -8
- package/dist/commands/sys/sync-project-guidance.js +5 -4
- package/dist/commands/sys/sync-shared.d.ts +41 -4
- package/dist/commands/sys/sync-shared.js +1 -1
- package/dist/commands/sys/sync-skills.js +2 -2
- package/dist/commands/sys/sync.js +1 -1
- package/dist/core/bash-job-supervisor.d.ts +2 -3
- package/dist/core/bash-job-supervisor.js +3 -3
- package/dist/core/bash-jobs.d.ts +0 -5
- package/dist/core/bash-jobs.js +7 -7
- package/dist/core/bootstrap.js +2 -2
- package/dist/core/canvas/canvas.d.ts +6 -50
- package/dist/core/canvas/canvas.js +16 -21
- package/dist/core/canvas/db.d.ts +4 -1
- package/dist/core/canvas/db.js +2 -2
- package/dist/core/canvas/history.d.ts +11 -39
- package/dist/core/canvas/history.js +9 -20
- package/dist/core/canvas/install-id.d.ts +2 -2
- package/dist/core/canvas/install-id.js +1 -1
- package/dist/core/canvas/memory-reads.d.ts +5 -0
- package/dist/core/canvas/memory-reads.js +1 -1
- package/dist/core/canvas/migrations.js +215 -41
- package/dist/core/canvas/node-agent-paths.js +1 -1
- package/dist/core/canvas/node-tokens.js +1 -1
- package/dist/core/canvas/paths.d.ts +0 -4
- package/dist/core/canvas/paths.js +1 -1
- package/dist/core/canvas/remote-canvas-source.d.ts +0 -1
- package/dist/core/canvas/remote-canvas-source.js +1 -1
- package/dist/core/canvas/render-source.d.ts +9 -6
- package/dist/core/canvas/render-source.js +6 -6
- package/dist/core/canvas/sessions.js +2 -2
- package/dist/core/canvas/source.d.ts +6 -0
- package/dist/core/canvas/tree.d.ts +29 -0
- package/dist/core/canvas/tree.js +12 -0
- package/dist/core/canvas/types.d.ts +0 -20
- package/dist/core/command-plugins/bundle.js +1 -1
- package/dist/core/config.d.ts +1 -1
- package/dist/core/conversation-store/listener.js +4 -2
- package/dist/core/feed/feed.d.ts +9 -7
- package/dist/core/feed/feed.js +3 -7
- package/dist/core/feed/inbox.d.ts +3 -5
- package/dist/core/feed/inbox.js +1 -10
- package/dist/core/feed/messages.d.ts +33 -6
- package/dist/core/feed/messages.js +10 -7
- package/dist/core/feed/reports.d.ts +10 -0
- package/dist/core/feed/reports.js +2 -0
- package/dist/core/grants/remove.js +1 -1
- package/dist/core/graph/access.d.ts +24 -0
- package/dist/core/graph/access.js +8 -0
- package/dist/core/graph/bodies.d.ts +6 -0
- package/dist/core/graph/bodies.js +1 -0
- package/dist/core/graph/deletion.d.ts +10 -0
- package/dist/core/graph/deletion.js +5 -0
- package/dist/core/graph/diff.d.ts +4 -0
- package/dist/core/graph/diff.js +4 -0
- package/dist/core/graph/documents.d.ts +167 -0
- package/dist/core/graph/documents.js +10 -0
- package/dist/core/graph/edges.d.ts +25 -0
- package/dist/core/graph/edges.js +1 -0
- package/dist/core/graph/events.d.ts +26 -0
- package/dist/core/graph/events.js +7 -0
- package/dist/core/graph/exposures.d.ts +53 -0
- package/dist/core/graph/exposures.js +4 -0
- package/dist/core/graph/jobs.d.ts +31 -0
- package/dist/core/graph/jobs.js +2 -0
- package/dist/core/graph/names.d.ts +30 -0
- package/dist/core/graph/names.js +3 -0
- package/dist/core/graph/objects.d.ts +55 -0
- package/dist/core/graph/objects.js +9 -0
- package/dist/core/graph/package-docs.d.ts +31 -0
- package/dist/core/graph/package-docs.js +5 -0
- package/dist/core/graph/package-files.d.ts +20 -0
- package/dist/core/graph/package-files.js +2 -0
- package/dist/core/graph/reader.d.ts +21 -0
- package/dist/core/graph/reader.js +3 -0
- package/dist/core/graph/repo-sync/exchange.d.ts +34 -0
- package/dist/core/graph/repo-sync/exchange.js +2 -0
- package/dist/core/graph/repo-sync/identity.d.ts +30 -0
- package/dist/core/graph/repo-sync/identity.js +1 -0
- package/dist/core/graph/repo-sync/index.d.ts +4 -0
- package/dist/core/graph/repo-sync/index.js +1 -0
- package/dist/core/graph/repo-sync/mirror.d.ts +30 -0
- package/dist/core/graph/repo-sync/mirror.js +6 -0
- package/dist/core/graph/repo-sync/ref-format.d.ts +76 -0
- package/dist/core/graph/repo-sync/ref-format.js +2 -0
- package/dist/core/graph/repo-sync/repos.d.ts +17 -0
- package/dist/core/graph/repo-sync/repos.js +3 -0
- package/dist/core/graph/repo-sync/sync.d.ts +42 -0
- package/dist/core/graph/repo-sync/sync.js +2 -0
- package/dist/core/graph/rules.d.ts +26 -0
- package/dist/core/graph/rules.js +3 -0
- package/dist/core/graph/spaces/app.d.ts +3 -0
- package/dist/core/graph/spaces/app.js +1 -0
- package/dist/core/graph/spaces/index.d.ts +19 -0
- package/dist/core/graph/spaces/index.js +1 -0
- package/dist/core/graph/spaces/person.d.ts +5 -0
- package/dist/core/graph/spaces/person.js +2 -0
- package/dist/core/graph/spaces/repo.d.ts +4 -0
- package/dist/core/graph/spaces/repo.js +1 -0
- package/dist/core/graph/types.d.ts +75 -0
- package/dist/core/graph/types.js +1 -0
- package/dist/core/graph/watches.d.ts +62 -0
- package/dist/core/graph/watches.js +18 -0
- package/dist/core/human/feedback-companion.js +1 -1
- package/dist/core/human/requests.d.ts +3 -1
- package/dist/core/human/requests.js +6 -6
- package/dist/core/inspector/model.js +2 -2
- package/dist/core/io.js +5 -5
- package/dist/core/layout-migrate/index.d.ts +24 -1
- package/dist/core/layout-migrate/index.js +4 -4
- package/dist/core/layout-migrate/paths.d.ts +4 -0
- package/dist/core/layout-migrate/paths.js +1 -1
- package/dist/core/layout-migrate/stored-paths.d.ts +7 -0
- package/dist/core/layout-migrate/stored-paths.js +11 -11
- package/dist/core/layout-migrate/stores.d.ts +19 -6
- package/dist/core/layout-migrate/stores.js +3 -4
- package/dist/core/manifest.d.ts +0 -2
- package/dist/core/manifest.js +1 -1
- package/dist/core/{memory/extensions.d.ts → plugin-extensions.d.ts} +9 -10
- package/dist/core/plugin-extensions.js +1 -0
- package/dist/core/preview-registry.d.ts +1 -1
- package/dist/core/preview-registry.js +3 -2
- package/dist/core/profiles/manifest.d.ts +7 -7
- package/dist/core/profiles/manifest.js +1 -1
- package/dist/core/profiles/select.js +3 -3
- package/dist/core/review/birth.js +1 -1
- package/dist/core/review/companion.js +1 -1
- package/dist/core/review/stage.d.ts +12 -1
- package/dist/core/review/stage.js +1 -1
- package/dist/core/review/store.d.ts +2 -0
- package/dist/core/review/store.js +1 -1
- package/dist/core/review/types.d.ts +7 -1
- package/dist/core/runs/events.js +1 -1
- package/dist/core/runs/operations.js +5 -5
- package/dist/core/runs/questions.js +2 -2
- package/dist/core/runtime/bearings-render.d.ts +13 -7
- package/dist/core/runtime/bearings-render.js +12 -12
- package/dist/core/runtime/bearings.d.ts +8 -18
- package/dist/core/runtime/bearings.js +7 -7
- package/dist/core/runtime/broker/daemon-ops.d.ts +7 -12
- package/dist/core/runtime/broker/daemon-ops.js +1 -1
- package/dist/core/runtime/broker/fault-retry.d.ts +2 -0
- package/dist/core/runtime/broker/fault-retry.js +1 -1
- package/dist/core/runtime/broker/frame-dispatch.d.ts +1 -1
- package/dist/core/runtime/broker/frame-memory-refs.d.ts +7 -2
- package/dist/core/runtime/broker/frame-memory-refs.js +1 -1
- package/dist/core/runtime/broker/inbox.d.ts +1 -4
- package/dist/core/runtime/broker/inbox.js +1 -10
- package/dist/core/runtime/broker/rebind.js +1 -1
- package/dist/core/runtime/broker/retry-card-elision.d.ts +7 -0
- package/dist/core/runtime/broker/retry-card-elision.js +1 -0
- package/dist/core/runtime/broker-extension-render.d.ts +0 -13
- package/dist/core/runtime/broker-extension-render.js +2 -4
- package/dist/core/runtime/broker-persona-guidance.js +3 -3
- package/dist/core/runtime/broker-protocol.d.ts +1 -1
- package/dist/core/runtime/broker.js +1 -1
- package/dist/core/runtime/close.d.ts +9 -4
- package/dist/core/runtime/close.js +1 -1
- package/dist/core/runtime/deliver-live.js +1 -1
- package/dist/core/runtime/kickoff.js +17 -19
- package/dist/core/runtime/launch-target.d.ts +7 -0
- package/dist/core/runtime/launch-target.js +1 -1
- package/dist/core/runtime/ledger.d.ts +10 -0
- package/dist/core/runtime/ledger.js +3 -0
- package/dist/core/runtime/lifecycle.js +2 -2
- package/dist/core/runtime/nodes.d.ts +10 -2
- package/dist/core/runtime/nodes.js +1 -1
- package/dist/core/runtime/outcome-document.d.ts +2 -2
- package/dist/core/runtime/outcome-document.js +1 -1
- package/dist/core/runtime/persona.js +2 -2
- package/dist/core/runtime/placement.js +1 -1
- package/dist/core/runtime/promote.d.ts +2 -2
- package/dist/core/runtime/promote.js +1 -1
- package/dist/core/runtime/prospective-inventory-cli.js +2 -2
- package/dist/core/runtime/recycle.js +1 -1
- package/dist/core/runtime/reopen.js +1 -1
- package/dist/core/runtime/revive.js +2 -2
- package/dist/core/runtime/roadmap.d.ts +20 -9
- package/dist/core/runtime/roadmap.js +10 -6
- package/dist/core/runtime/spawn-env.js +1 -1
- package/dist/core/runtime/spawn.d.ts +5 -3
- package/dist/core/runtime/spawn.js +2 -2
- package/dist/core/runtime/structured-output.d.ts +3 -1
- package/dist/core/runtime/structured-output.js +4 -4
- package/dist/core/scope.d.ts +1 -32
- package/dist/core/scope.js +1 -1
- package/dist/core/scoped-state/db.js +2 -1
- package/dist/core/scoped-state/migrate.js +2 -2
- package/dist/core/scoped-state/profiles.d.ts +11 -0
- package/dist/core/scoped-state/profiles.js +1 -1
- package/dist/core/scoped-state/schema.d.ts +1 -1
- package/dist/core/scoped-state/schema.js +7 -5
- package/dist/core/spaces/permissions.d.ts +0 -14
- package/dist/core/spaces/permissions.js +1 -1
- package/dist/core/spaces/stop.d.ts +13 -0
- package/dist/core/spaces/stop.js +2 -2
- package/dist/core/storage/tables.d.ts +1 -1
- package/dist/core/substrate/delivery/corpus.d.ts +21 -0
- package/dist/core/substrate/delivery/corpus.js +3 -0
- package/dist/core/substrate/delivery/deliver.d.ts +76 -0
- package/dist/core/substrate/delivery/deliver.js +6 -0
- package/dist/core/substrate/delivery/listings.d.ts +30 -0
- package/dist/core/substrate/delivery/listings.js +7 -0
- package/dist/core/substrate/delivery/match.d.ts +28 -0
- package/dist/core/substrate/delivery/match.js +1 -0
- package/dist/core/substrate/delivery/plan.d.ts +67 -0
- package/dist/core/substrate/delivery/plan.js +3 -0
- package/dist/core/substrate/delivery/render-boot.d.ts +20 -0
- package/dist/core/substrate/delivery/render-boot.js +54 -0
- package/dist/core/substrate/delivery/render-event.d.ts +54 -0
- package/dist/core/substrate/delivery/render-event.js +8 -0
- package/dist/core/substrate/delivery/sub-persona-menu.d.ts +2 -0
- package/dist/core/substrate/delivery/sub-persona-menu.js +6 -0
- package/dist/core/substrate/delivery/types.d.ts +30 -0
- package/dist/core/substrate/delivery/types.js +0 -0
- package/dist/core/substrate/gate-explain.d.ts +0 -13
- package/dist/core/substrate/gate-explain.js +1 -1
- package/dist/core/substrate/schema.d.ts +11 -139
- package/dist/core/substrate/schema.js +1 -1
- package/dist/core/substrate/subject-fields.d.ts +3 -0
- package/dist/core/substrate/subject.d.ts +2 -1
- package/dist/core/substrate/subject.js +1 -1
- package/dist/daemon/api/handlers/app-profiles.js +1 -1
- package/dist/daemon/api/handlers/bash-jobs.js +1 -2
- package/dist/daemon/api/handlers/broker-ops.js +1 -1
- package/dist/daemon/api/handlers/canvas.js +5 -5
- package/dist/daemon/api/handlers/daemon.js +1 -1
- package/dist/daemon/api/handlers/delivery.d.ts +2 -0
- package/dist/daemon/api/handlers/delivery.js +1 -0
- package/dist/daemon/api/handlers/{memory.d.ts → docs.d.ts} +1 -1
- package/dist/daemon/api/handlers/docs.js +1 -0
- package/dist/daemon/api/handlers/hook-exec.js +1 -1
- package/dist/daemon/api/handlers/messages.js +2 -2
- package/dist/daemon/api/handlers/node-records.js +2 -2
- package/dist/daemon/api/handlers/nodes.js +1 -1
- package/dist/daemon/api/handlers/objects.d.ts +2 -0
- package/dist/daemon/api/handlers/objects.js +5 -0
- package/dist/daemon/api/handlers/package-docs.d.ts +2 -0
- package/dist/daemon/api/handlers/package-docs.js +1 -0
- package/dist/daemon/api/handlers/profiles.js +1 -1
- package/dist/daemon/api/handlers/reports.d.ts +2 -2
- package/dist/daemon/api/handlers/reports.js +4 -4
- package/dist/daemon/api/handlers/reviews.d.ts +4 -1
- package/dist/daemon/api/handlers/reviews.js +1 -1
- package/dist/daemon/api/map.d.ts +2 -2
- package/dist/daemon/api/map.js +2 -2
- package/dist/daemon/api/operations.d.ts +1 -1
- package/dist/daemon/api/operations.js +1 -1
- package/dist/daemon/api/reader.d.ts +17 -0
- package/dist/daemon/api/reader.js +1 -0
- package/dist/daemon/api/server.js +1 -1
- package/dist/daemon/control.d.ts +2 -3
- package/dist/daemon/crtrd.js +8 -6
- package/dist/daemon/fleet.js +4 -4
- package/dist/daemon/reconcilers/bash-deadline.d.ts +11 -1
- package/dist/daemon/reconcilers/bash-deadline.js +2 -1
- package/dist/daemon/reconcilers/broker-supervision.js +4 -4
- package/dist/daemon/reconcilers/live-obligation.js +1 -1
- package/dist/daemon/reconcilers/node-deadline.js +1 -1
- package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.js +1 -1
- package/dist/daemon/reconcilers/storage-maintenance.d.ts +1 -0
- package/dist/daemon/reconcilers/storage-maintenance.js +1 -1
- package/dist/daemon/review/deliver.js +2 -2
- package/dist/daemon/review/finish.js +1 -1
- package/dist/hook-authoring.d.ts +0 -1
- package/dist/hook-authoring.js +3 -3
- package/dist/migrations/004-canvas-documents/apply.d.ts +10 -0
- package/dist/migrations/004-canvas-documents/apply.js +1 -0
- package/dist/migrations/004-canvas-documents/fields.d.ts +24 -0
- package/dist/migrations/004-canvas-documents/fields.js +2 -0
- package/dist/migrations/004-canvas-documents/index.d.ts +16 -0
- package/dist/migrations/004-canvas-documents/index.js +2 -0
- package/dist/migrations/004-canvas-documents/legacy/discover.d.ts +16 -0
- package/dist/migrations/004-canvas-documents/legacy/discover.js +1 -0
- package/dist/migrations/004-canvas-documents/legacy/history.d.ts +5 -0
- package/dist/migrations/004-canvas-documents/legacy/history.js +2 -0
- package/dist/migrations/004-canvas-documents/legacy/nested.d.ts +7 -0
- package/dist/migrations/004-canvas-documents/legacy/nested.js +1 -0
- package/dist/migrations/004-canvas-documents/legacy/parse.d.ts +14 -0
- package/dist/migrations/004-canvas-documents/legacy/parse.js +1 -0
- package/dist/migrations/004-canvas-documents/legacy/types.d.ts +91 -0
- package/dist/migrations/004-canvas-documents/legacy/types.js +0 -0
- package/dist/migrations/004-canvas-documents/legacy-edges.d.ts +6 -0
- package/dist/migrations/004-canvas-documents/legacy-edges.js +18 -0
- package/dist/migrations/004-canvas-documents/plan.d.ts +102 -0
- package/dist/migrations/004-canvas-documents/plan.js +3 -0
- package/dist/migrations/004-canvas-documents/pointers.d.ts +23 -0
- package/dist/migrations/004-canvas-documents/pointers.js +4 -0
- package/dist/migrations/activation.d.ts +9 -18
- package/dist/migrations/activation.js +2 -2
- package/dist/pi-extensions/broker-local.d.ts +2 -2
- package/dist/pi-extensions/broker-local.js +2 -2
- package/dist/pi-extensions/canvas-bash-valve.js +5 -4
- package/dist/pi-extensions/canvas-context-intro.js +2 -2
- package/dist/pi-extensions/canvas-doc-substrate.d.ts +0 -1
- package/dist/pi-extensions/canvas-doc-substrate.js +6 -6
- package/dist/pi-extensions/canvas-inbox-watcher.js +2 -2
- package/dist/pi-extensions/canvas-passive-context.js +1 -1
- package/dist/pi-extensions/canvas-recap.js +2 -2
- package/dist/pi-extensions/canvas-stophook.d.ts +1 -1
- package/dist/pi-extensions/canvas-stophook.js +1 -1
- package/dist/prompts/review.js +3 -3
- package/dist/shared/env.d.ts +5 -0
- package/dist/shared/env.js +1 -1
- package/dist/shared/generated-context.js +2 -10
- package/dist/shared/inbox-entry-body.d.ts +22 -0
- package/dist/shared/inbox-entry-body.js +10 -0
- package/dist/{core/memory → shared}/inline-ref-guidance.d.ts +2 -2
- package/dist/shared/inline-ref-guidance.js +2 -0
- package/dist/types.d.ts +3 -1
- package/docs/cli/memory-and-preferences.md +12 -14
- package/docs/concepts/README.md +1 -1
- package/docs/concepts/lifecycle-and-wakes.md +1 -1
- package/docs/concepts/memory.md +15 -15
- package/docs/concepts/nodes-and-the-canvas.md +1 -1
- package/docs/concepts/profiles-kinds-and-modes.md +5 -5
- package/docs/concepts/scopes-and-trust.md +1 -1
- package/docs/concepts/why-a-daemon.md +1 -1
- package/docs/sdk/README.md +5 -6
- package/docs/sdk/errors.md +0 -13
- package/docs/sdk/guides/README.md +0 -1
- package/docs/sdk/nodes.md +0 -2
- package/docs/sdk/resources.md +0 -1
- package/package.json +2 -2
- package/packages/crouter-identity/package.json +1 -1
- package/runtime.lock.json +11 -11
- package/scripts/lib/isolation-env.mjs +8 -2
- package/dist/api/dto/memory.d.ts +0 -171
- package/dist/api/dto/memory.js +0 -1
- package/dist/builtin-memory/crouter-sdk/guides/app-memory.md +0 -73
- package/dist/builtin-memory/crouter-sdk/memory.md +0 -87
- package/dist/commands/broker-permissions.d.ts +0 -2
- package/dist/commands/broker-permissions.js +0 -1
- package/dist/commands/memory/client.d.ts +0 -11
- package/dist/commands/memory/client.js +0 -1
- package/dist/commands/memory/delete.d.ts +0 -1
- package/dist/commands/memory/delete.js +0 -1
- package/dist/commands/memory/edit.d.ts +0 -1
- package/dist/commands/memory/edit.js +0 -21
- package/dist/commands/memory/find.d.ts +0 -1
- package/dist/commands/memory/find.js +0 -1
- package/dist/commands/memory/history.d.ts +0 -1
- package/dist/commands/memory/history.js +0 -5
- package/dist/commands/memory/lint.d.ts +0 -1
- package/dist/commands/memory/lint.js +0 -1
- package/dist/commands/memory/list.d.ts +0 -1
- package/dist/commands/memory/list.js +0 -1
- package/dist/commands/memory/move.d.ts +0 -1
- package/dist/commands/memory/move.js +0 -1
- package/dist/commands/memory/origin.d.ts +0 -1
- package/dist/commands/memory/origin.js +0 -1
- package/dist/commands/memory/read.d.ts +0 -1
- package/dist/commands/memory/read.js +0 -6
- package/dist/commands/memory/shared.d.ts +0 -22
- package/dist/commands/memory/shared.js +0 -1
- package/dist/commands/memory/write.d.ts +0 -1
- package/dist/commands/memory/write.js +0 -13
- package/dist/commands/memory.js +0 -1
- package/dist/commands/node-inspect-artifacts.d.ts +0 -1
- package/dist/commands/node-inspect-artifacts.js +0 -8
- package/dist/core/help/memory-extensions.d.ts +0 -3
- package/dist/core/help/memory-extensions.js +0 -2
- package/dist/core/memory/cli-selector.d.ts +0 -13
- package/dist/core/memory/cli-selector.js +0 -1
- package/dist/core/memory/doc-link-grammar.d.ts +0 -20
- package/dist/core/memory/doc-link-grammar.js +0 -2
- package/dist/core/memory/extensions.js +0 -1
- package/dist/core/memory/history.d.ts +0 -87
- package/dist/core/memory/history.js +0 -6
- package/dist/core/memory/identity.d.ts +0 -65
- package/dist/core/memory/identity.js +0 -1
- package/dist/core/memory/inline-ref-guidance.js +0 -2
- package/dist/core/memory/inline-ref-inventory.d.ts +0 -9
- package/dist/core/memory/inline-ref-inventory.js +0 -1
- package/dist/core/memory/lint.d.ts +0 -163
- package/dist/core/memory/lint.js +0 -2
- package/dist/core/memory/mutation-domain.d.ts +0 -113
- package/dist/core/memory/mutation-domain.js +0 -12
- package/dist/core/memory/mutations.d.ts +0 -74
- package/dist/core/memory/mutations.js +0 -1
- package/dist/core/memory/project-namespace.d.ts +0 -31
- package/dist/core/memory/project-namespace.js +0 -2
- package/dist/core/memory/repository-association.d.ts +0 -31
- package/dist/core/memory/repository-association.js +0 -1
- package/dist/core/memory/service.d.ts +0 -145
- package/dist/core/memory/service.js +0 -2
- package/dist/core/memory/tree.d.ts +0 -39
- package/dist/core/memory/tree.js +0 -1
- package/dist/core/memory-resolver.d.ts +0 -280
- package/dist/core/memory-resolver.js +0 -2
- package/dist/core/nested-stores.d.ts +0 -18
- package/dist/core/nested-stores.js +0 -1
- package/dist/core/runtime/memory.d.ts +0 -3
- package/dist/core/runtime/memory.js +0 -1
- package/dist/core/substrate/frontmatter-validation.d.ts +0 -11
- package/dist/core/substrate/frontmatter-validation.js +0 -1
- package/dist/core/substrate/gate.d.ts +0 -16
- package/dist/core/substrate/gate.js +0 -1
- package/dist/core/substrate/index.d.ts +0 -18
- package/dist/core/substrate/index.js +0 -1
- package/dist/core/substrate/injected-store.d.ts +0 -75
- package/dist/core/substrate/injected-store.js +0 -2
- package/dist/core/substrate/listings.d.ts +0 -28
- package/dist/core/substrate/listings.js +0 -1
- package/dist/core/substrate/memory-events.d.ts +0 -6
- package/dist/core/substrate/memory-events.js +0 -1
- package/dist/core/substrate/on-read-node.d.ts +0 -6
- package/dist/core/substrate/on-read-node.js +0 -1
- package/dist/core/substrate/on-read.d.ts +0 -101
- package/dist/core/substrate/on-read.js +0 -9
- package/dist/core/substrate/plan.d.ts +0 -94
- package/dist/core/substrate/plan.js +0 -1
- package/dist/core/substrate/render-node.d.ts +0 -12
- package/dist/core/substrate/render-node.js +0 -1
- package/dist/core/substrate/render.d.ts +0 -41
- package/dist/core/substrate/render.js +0 -65
- package/dist/core/substrate/session-cache.d.ts +0 -27
- package/dist/core/substrate/session-cache.js +0 -1
- package/dist/core/substrate/surface-match.d.ts +0 -73
- package/dist/core/substrate/surface-match.js +0 -1
- package/dist/daemon/api/handlers/memory.js +0 -5
- package/dist/migrations/001-surfaces-frontmatter.d.ts +0 -2
- package/dist/migrations/001-surfaces-frontmatter.js +0 -1
- package/dist/migrations/002-profile-project-memory.d.ts +0 -2
- package/dist/migrations/002-profile-project-memory.js +0 -1
- package/dist/migrations/003-repository-root-memory-identity/front-door.d.ts +0 -26
- package/dist/migrations/003-repository-root-memory-identity/front-door.js +0 -11
- package/dist/migrations/003-repository-root-memory-identity/index.d.ts +0 -2
- package/dist/migrations/003-repository-root-memory-identity/index.js +0 -5
- package/dist/migrations/003-repository-root-memory-identity/references.d.ts +0 -95
- package/dist/migrations/003-repository-root-memory-identity/references.js +0 -5
- package/dist/migrations/003-repository-root-memory-identity/repository-facts.d.ts +0 -39
- package/dist/migrations/003-repository-root-memory-identity/repository-facts.js +0 -3
- package/dist/migrations/convergent.d.ts +0 -43
- package/dist/migrations/convergent.js +0 -2
- package/dist/migrations/corpus.d.ts +0 -75
- package/dist/migrations/corpus.js +0 -3
- package/dist/migrations/frontmatter-splice.d.ts +0 -15
- package/dist/migrations/frontmatter-splice.js +0 -8
- package/dist/migrations/profile-manifests.d.ts +0 -30
- package/dist/migrations/profile-manifests.js +0 -2
- package/dist/migrations/registry.d.ts +0 -7
- package/dist/migrations/registry.js +0 -1
- package/dist/migrations/runner.d.ts +0 -43
- package/dist/migrations/runner.js +0 -1
- package/dist/migrations/types.d.ts +0 -211
- package/dist/shared/birth-announcement.d.ts +0 -12
- package/dist/shared/birth-announcement.js +0 -1
- package/docs/sdk/guides/app-memory.md +0 -22
- package/docs/sdk/memory.md +0 -85
- /package/dist/{migrations/types.js → api/dto/delivery.js} +0 -0
- /package/dist/{core/memory → shared}/inline-ref-grammar.d.ts +0 -0
- /package/dist/{core/memory → shared}/inline-ref-grammar.js +0 -0
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { NodeMemoryTarget } from '../core/canvas/types.js';
|
|
2
|
-
import type { CorpusBlocker, CorpusDiscoveryRoot, CorpusIdentityRename, CorpusReferenceRewrite, CorpusRepositoryDecision, CorpusSnapshot, CorpusStore, CorpusStorePrefix, CorpusTarget, ProfileManifestSnapshot, StateMigration, StoreSnapshot } from './types.js';
|
|
3
|
-
/** A store before its documents are read. */
|
|
4
|
-
export type DiscoveredStore = Omit<CorpusStore, 'snapshot'>;
|
|
5
|
-
export interface CorpusDiscovery {
|
|
6
|
-
/** Every place discovery looked, in the order it looked. */
|
|
7
|
-
roots: CorpusDiscoveryRoot[];
|
|
8
|
-
/** Deduped by realpath, in discovery order. Stores whose directory does not
|
|
9
|
-
* exist are absent: there is nothing to migrate and nothing to point at. */
|
|
10
|
-
stores: DiscoveredStore[];
|
|
11
|
-
targets: CorpusTarget[];
|
|
12
|
-
/** Roots and targets discovery could not read. */
|
|
13
|
-
blockers: CorpusBlocker[];
|
|
14
|
-
}
|
|
15
|
-
export interface CorpusSkippedDoc {
|
|
16
|
-
storeRoot: string;
|
|
17
|
-
relPath: string;
|
|
18
|
-
error: string;
|
|
19
|
-
}
|
|
20
|
-
export interface CorpusRunResult {
|
|
21
|
-
/** Corpus migrations in the registry. Zero means the lane is inert. */
|
|
22
|
-
migrations: number;
|
|
23
|
-
/** True when blockers exist and a corpus migration was registered to gate. */
|
|
24
|
-
blocked: boolean;
|
|
25
|
-
blockers: CorpusBlocker[];
|
|
26
|
-
planned: {
|
|
27
|
-
migration: string;
|
|
28
|
-
consumers: string[];
|
|
29
|
-
identities: string[];
|
|
30
|
-
}[];
|
|
31
|
-
repositories: CorpusRepositoryDecision[];
|
|
32
|
-
storePrefixes: CorpusStorePrefix[];
|
|
33
|
-
renames: CorpusIdentityRename[];
|
|
34
|
-
references: CorpusReferenceRewrite[];
|
|
35
|
-
/** Files written, or under `--dry-run` the files that would be written. */
|
|
36
|
-
wrote: {
|
|
37
|
-
consumers: string[];
|
|
38
|
-
identities: string[];
|
|
39
|
-
};
|
|
40
|
-
/** True when the post-write rebuild ran every migration's `verify`. */
|
|
41
|
-
verified: boolean;
|
|
42
|
-
}
|
|
43
|
-
/** Discover the whole reachable corpus: every store, the targets that mount
|
|
44
|
-
* them, and the frontier searched to find them. `profiles` are the manifest
|
|
45
|
-
* lane's post-migration snapshots — a pre-migration manifest reads as corrupt,
|
|
46
|
-
* so discovery must run after that lane, not against `listProfiles()`. */
|
|
47
|
-
export declare function discoverCorpus(opts: {
|
|
48
|
-
cwd?: string;
|
|
49
|
-
profiles: readonly ProfileManifestSnapshot[];
|
|
50
|
-
explicitDirs?: readonly string[];
|
|
51
|
-
nodes: readonly NodeMemoryTarget[];
|
|
52
|
-
}): Promise<CorpusDiscovery>;
|
|
53
|
-
/** Read every discovered store's documents. `preloaded` supplies the per-store
|
|
54
|
-
* convergent lane's FOLDED snapshots so the corpus plans against the bytes a
|
|
55
|
-
* write run leaves behind — identical under `--dry-run`, where the same fold
|
|
56
|
-
* ran and nothing was written. */
|
|
57
|
-
export declare function loadCorpusSnapshots(discovery: CorpusDiscovery, opts?: {
|
|
58
|
-
preloaded?: ReadonlyMap<string, StoreSnapshot>;
|
|
59
|
-
}): {
|
|
60
|
-
snapshots: Map<string, StoreSnapshot>;
|
|
61
|
-
skipped: CorpusSkippedDoc[];
|
|
62
|
-
};
|
|
63
|
-
export declare function parseFailureBlockers(skipped: readonly CorpusSkippedDoc[]): CorpusBlocker[];
|
|
64
|
-
export declare function buildCorpusSnapshot(discovery: CorpusDiscovery, snapshots: ReadonlyMap<string, StoreSnapshot>): CorpusSnapshot;
|
|
65
|
-
/** Plan every corpus migration over the whole corpus, then — only when the
|
|
66
|
-
* global plan is blocker-free — write every migration's consumer rewrites
|
|
67
|
-
* before any identity rewrite. `rebuild` re-reads the corpus from file truth
|
|
68
|
-
* for the post-write `verify` pass. */
|
|
69
|
-
export declare function runCorpusMigrations(corpus: CorpusSnapshot, opts?: {
|
|
70
|
-
dryRun?: boolean;
|
|
71
|
-
migrations?: readonly StateMigration[];
|
|
72
|
-
/** Discovery and parse-failure blockers, gating identically to plan ones. */
|
|
73
|
-
blockers?: readonly CorpusBlocker[];
|
|
74
|
-
rebuild?: () => CorpusSnapshot;
|
|
75
|
-
}): CorpusRunResult;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var z=Object.defineProperty;var c=(t,n)=>z(t,"name",{value:n,configurable:!0});import{envProfileId as H}from"../shared/env.js";import{readdirSync as Q}from"node:fs";import{dirname as C,join as x}from"node:path";import{appsRoot as T,appSpace as V}from"../core/layout.js";import{atomicWriteText as L,listDirs as O,pathExists as v,realpathOrSelf as R,removePath as _,walkFiles as X}from"../core/fs-utils.js";import{memoryStoresInPrecedence as Z}from"../core/memory-resolver.js";import{descendantStoreRootsExhaustive as oo}from"../core/nested-stores.js";import{profileMemoryDir as eo}from"../core/profiles/manifest.js";import{memoryDir as to}from"../core/runtime/memory.js";import{listInstalledPlugins as so,listInstalledPluginsInRoot as no}from"../core/resolver.js";import{NEUTRAL_PROJECT_MEMORY as D,pluginMemoryDir as ro,projectScopeRoots as B,scopeRoot as io}from"../core/scope.js";import{CRTR_DIR_NAME as F}from"../types.js";import{foldDocChange as ao,loadStoreSnapshot as co}from"./convergent.js";import{STATE_MIGRATIONS as po}from"./registry.js";function fo(t){return(t instanceof Error?t.message:String(t)).split(`
|
|
2
|
-
`)[0]??""}c(fo,"firstLine");function uo(t){return`${t.profileId??"-"}:${t.nodeId??"-"}:${R(t.cwd)}`}c(uo,"targetId");function lo(t){const n=ro(t);return{scope:t.scope,storeRoot:n,namespace:t.name,plugin:t.name,mountStatus:v(n)?"ready":"absent",projectMemory:D}}c(lo,"pluginStoreDescriptor");function mo(t){return{scope:"node",storeRoot:t,namespace:"",mountStatus:v(t)?"ready":"absent",projectMemory:D}}c(mo,"nodeStoreDescriptor");function ho(){const t=[];for(const n of O(T()))for(const r of O(x(T(),n,"memory","nodes"))){const i=x(T(),n,"memory","nodes",r);if(!v(i))continue;X(i,d=>d.endsWith(".md")&&d!=="SKILL.md",d=>d.startsWith(".")).length>0&&t.push({nodeId:r,storeRoot:i})}return t}c(ho,"nodeStoresWithDocs");async function Do(t){const n=R(t.cwd??process.cwd()),r=H()||null,i=t.explicitDirs??[],m=[],d=new Set,u=c(o=>{const e=`${o.reason}\0${R(o.root)}\0${o.detail??""}`;d.has(e)||(d.add(e),m.push(o))},"addRoot"),y=new Map,P=c((o,e,s)=>{const f=R(o);let p=y.get(f);p===void 0&&(p={root:o,reason:e,profileIds:[]},y.set(f,p)),p.profileIds.includes(s)||p.profileIds.push(s)},"addProjectRoot"),$=[{reason:"cwd-ancestor",profileId:r,roots:B(n,r)},...t.profiles.map(({profileId:o,manifest:e})=>({reason:"profile-project",profileId:o,detail:o,roots:[...new Set(e.projects.flatMap(s=>[x(s.path,F),...B(s.path,null)]))]})),...i.map(o=>({reason:"explicit-dir",profileId:r,detail:o,roots:[x(R(o),F)]}))],S=new Map,b=c(o=>{const e=o.map(f=>R(f)).sort().join(`
|
|
3
|
-
`);let s=S.get(e);return s===void 0&&(s=oo([...o]),S.set(e,s)),s},"descendantsUnder"),j=c((o,e,s,f)=>{const p=f===void 0?{}:{detail:f};for(const h of o)u({reason:e,root:h,boundary:e==="explicit-dir"?"store":"ancestors",...p}),P(h,e,s);for(const h of b(o))u({reason:"descendant",root:h,boundary:"descendants",...p}),P(h,"descendant",s)},"expandRoots");for(const o of $)j(o.roots,o.reason,o.profileId,o.detail);const I=[],k=new Map,w=c((o,e,s)=>{const f=o.storeRoot;if(f===""||!v(f))return;const p=R(f);let h=k.get(p);if(h===void 0){h={key:p,descriptor:o,discovery:[],discoverySeen:new Set,targets:[],writable:o.scope!=="builtin"},k.set(p,h);try{Q(p)}catch(q){I.push({kind:"inaccessible-root",message:`memory store cannot be listed (${fo(q)}) \u2014 discovery cannot see its documents; fix the permissions and re-run`,storeRoot:p})}}const A=`${e.reason}\0${e.root}\0${e.targetId??""}`;h.discoverySeen.has(A)||(h.discoverySeen.add(A),h.discovery.push(e)),s!==void 0&&(h.targets.includes(s.id)||h.targets.push(s.id),s.storeKeys.includes(p)||s.storeKeys.push(p))},"register"),a=[],l=new Map,M=c((o,e,s)=>{const f=uo(s);if(l.has(f))return;const p={id:f,kind:o,origin:e,target:s,storeKeys:[]};l.set(f,p),a.push(p)},"addTarget");M("cwd",n,{cwd:n,profileId:r,nodeId:null});for(const{profileId:o,manifest:e}of t.profiles)M("profile",o,{cwd:e.projects[0]?.path??n,profileId:o,nodeId:null});const g=c(()=>{for(const{root:o,profileIds:e}of[...y.values()])for(const s of[...e])M("project",C(o),{cwd:C(o),profileId:s,nodeId:null})},"addProjectTargets"),Y=ho();v(T())&&u({reason:"node",root:T(),boundary:"nodes"});const G=new Map(t.nodes.map(o=>[o.nodeId,o]));for(const{nodeId:o,storeRoot:e}of Y){const s=G.get(o);if(s===void 0||s.cwd===""||to(o,s.grantee)!==e){const f=s===void 0?"no row":s.cwd===""?"empty cwd":"app assignment differs from folder";I.push({kind:"inaccessible-target",message:`node ${o} holds memory documents but canvas.db has no matching app assignment and usable row for it (${f}) \u2014 the corpus cannot resolve its project or profile`,storeRoot:R(e)}),w(mo(e),{reason:"node",root:e});continue}M("node",o,{cwd:s.cwd,profileId:s.profileId,nodeId:o,grantee:s.grantee})}const J=c(o=>{for(const e of Z(o.target)){if(e.plugin!==void 0){u({reason:"plugin",root:e.storeRoot,boundary:"store",detail:e.plugin}),w(e,{reason:"plugin",root:e.storeRoot,targetId:o.id},o);continue}if(e.scope==="project"){const f=C(e.storeRoot),p=y.get(R(f));p===void 0&&j([f],"cwd-ancestor",o.target.profileId,o.id),w(e,{reason:p?.reason??"cwd-ancestor",root:f,targetId:o.id},o);continue}const s=e.scope==="user"?"user":e.scope==="profile"?"profile":e.scope==="node"?"node":"builtin";u({reason:s,root:e.storeRoot,boundary:"store"}),w(e,{reason:s,root:e.storeRoot,targetId:o.id},o)}},"walkTarget"),E=new Set;for(;;){g();const o=a.filter(e=>!E.has(e.id));if(o.length===0)break;for(const e of o)E.add(e.id),J(e)}const K=io("user");K!==null&&u({reason:"plugin",root:K,boundary:"plugins"});const W=[...so("user")];for(const{root:o}of y.values())u({reason:"plugin",root:o,boundary:"plugins"}),W.push(...no("project",o));for(const o of W){const e=lo(o);u({reason:"plugin",root:e.storeRoot,boundary:"store",detail:o.name}),w(e,{reason:"plugin",root:e.storeRoot})}for(const{profileId:o,manifest:e}of t.profiles){const s=e.grantee?.startsWith("app:")?x(V(e.grantee).memory,"profiles",o):eo(o);u({reason:"profile",root:s,boundary:"store",detail:o}),w({scope:"profile",storeRoot:s,namespace:"",mountStatus:v(s)?"ready":"absent",projectMemory:D},{reason:"profile",root:s})}return{roots:m,stores:[...k.values()].map(o=>({key:o.key,descriptor:o.descriptor,discovery:o.discovery,targets:o.targets,writable:o.writable})),targets:a.map(o=>({id:o.id,kind:o.kind,origin:o.origin,target:o.target,storeKeys:o.storeKeys})),blockers:I}}c(Do,"discoverCorpus");function Eo(t,n={}){const r=new Map,i=[];for(const m of t.stores){const d=n.preloaded?.get(m.key);if(d!==void 0){r.set(m.key,d);continue}const u=co(m.descriptor.storeRoot);r.set(m.key,u.snapshot);for(const y of u.skipped)i.push({storeRoot:m.key,...y})}return{snapshots:r,skipped:i}}c(Eo,"loadCorpusSnapshots");function Ko(t){return t.map(n=>({kind:"parse-failure",message:`${n.relPath}: frontmatter is not valid YAML (${n.error}) \u2014 the document's identity cannot be read; fix the file and re-run`,storeRoot:n.storeRoot,path:x(n.storeRoot,n.relPath)}))}c(Ko,"parseFailureBlockers");function N(t,n,r){const i=new Map(t.map(d=>[d.key,d])),m=new Map(n.map(d=>[d.id,d]));return{stores:t,targets:n,roots:r,store:c(d=>i.get(d),"store"),storesForTarget:c(d=>(m.get(d)?.storeKeys??[]).map(u=>i.get(u)).filter(u=>u!==void 0),"storesForTarget")}}c(N,"makeCorpusSnapshot");function Wo(t,n){const r=t.stores.map(i=>({...i,snapshot:n.get(i.key)??{root:i.descriptor.storeRoot,docs:[]}}));return N(r,t.targets,t.roots)}c(Wo,"buildCorpusSnapshot");function go(t){const n=t.stores.map(r=>({...r,snapshot:{root:r.snapshot.root,docs:[...r.snapshot.docs]}}));return N(n,t.targets,t.roots)}c(go,"cloneCorpus");function U(t,n,r=new Set){let i;for(const m of t.stores)n.path.startsWith(`${m.snapshot.root}/`)&&(i===void 0||m.snapshot.root.length>i.snapshot.root.length)&&(i=m);if(i===void 0){if(r.has(n.path))return;throw new Error(`corpus migration: planned change outside every discovered store: ${n.path}`)}ao(i.snapshot,n)}c(U,"foldCorpusChange");function Ao(t,n={}){const r=(n.migrations??po).filter(a=>a.lane==="corpus"),i=[...n.blockers??[]],m=[],d=[],u=[],y=[],P=[],$=[],S=[],b=c((a,l)=>({migrations:r.length,blocked:i.length>0&&r.length>0,blockers:i,planned:m,repositories:d,storePrefixes:u,renames:y,references:P,wrote:l,verified:a}),"result"),j={consumers:[],identities:[]};if(r.length===0)return b(!1,j);const I=go(t);for(const a of r){const l=a.plan(I);i.push(...l.blockers),d.push(...l.repositories),u.push(...l.storePrefixes),y.push(...l.renames),P.push(...l.references);for(const g of l.consumers)U(I,g);const M=new Set(l.repositories.map(g=>g.declarationPath));for(const g of l.identities)U(I,g,M);$.push(...l.consumers),S.push(...l.identities),m.push({migration:a.description,consumers:l.consumers.map(g=>g.path),identities:l.identities.map(g=>g.path)})}const k={consumers:$.map(a=>a.path),identities:S.map(a=>a.path)};if(i.length>0)return b(!1,j);if(n.dryRun===!0)return b(!1,k);for(const a of $)a.after===null?_(a.path):L(a.path,a.after);for(const a of S)a.after===null?_(a.path):L(a.path,a.after);if(n.rebuild===void 0)return b(!1,k);const w=n.rebuild();for(const a of r)for(const l of a.verify?.(w)??[])i.push({...l,kind:"verification"});return b(!0,k)}c(Ao,"runCorpusMigrations");export{Wo as buildCorpusSnapshot,Do as discoverCorpus,Eo as loadCorpusSnapshots,Ko as parseFailureBlockers,Ao as runCorpusMigrations};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** Split a complete document into its raw frontmatter YAML and byte-preserved body. */
|
|
2
|
-
export declare function splitDocSource(source: string, docPath: string): {
|
|
3
|
-
rawYaml: string;
|
|
4
|
-
body: string;
|
|
5
|
-
};
|
|
6
|
-
/** Remove complete top-level mapping-key lines, including multiline values. */
|
|
7
|
-
export declare function dropTopLevelKeys(rawYaml: string, keys: readonly string[], docPath: string): string;
|
|
8
|
-
/** Remove selected items from a top-level block sequence without re-rendering retained bytes. */
|
|
9
|
-
export declare function dropSequenceItems(rawYaml: string, key: string, drop: (item: unknown) => boolean, docPath: string): string;
|
|
10
|
-
/** Append a rendered top-level mapping pair while retaining existing YAML bytes. */
|
|
11
|
-
export declare function appendRenderedKey(rawYaml: string, key: string, value: unknown, docPath: string): string;
|
|
12
|
-
/** Prove that a transformed YAML block parses to exactly the expected mapping. */
|
|
13
|
-
export declare function proveFrontmatterRoundTrip(after: string, expected: Record<string, unknown>, docPath: string): void;
|
|
14
|
-
/** Replace only the YAML block in a complete document; the body remains byte-for-byte unchanged. */
|
|
15
|
-
export declare function rebuildDocSource(source: string, newYaml: string, docPath: string): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var A=Object.defineProperty;var p=(e,t)=>A(e,"name",{value:t,configurable:!0});import{isMap as q,isSeq as v,parse as x,parseDocument as k,stringify as O}from"yaml";import{parseFrontmatterGeneric as R}from"../core/frontmatter.js";function w(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((r,n)=>w(r,t[n]));if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){const r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(c=>w(e[c],t[c]))}return!1}p(w,"deepEqual");function $(e,t){if(e.trim()==="")return[];const r=k(e);if(r.errors.length>0||!q(r.contents))throw new Error(`frontmatter splice: unparseable frontmatter in ${t}`);return r.contents.items}p($,"yamlMap");function j(e,t,r){const n=t.key?.range,c=t.value?.range;if(n===void 0)throw new Error(`frontmatter splice: rangeless key in ${r}`);const f=e.lastIndexOf(`
|
|
2
|
-
`,n[0]-1)+1;let o=c?.[2]??n[2];if(!(o>0&&e[o-1]===`
|
|
3
|
-
`)){for(;o<e.length&&(e[o]===" "||e[o]===" "||e[o]==="\r");)o++;e[o]===`
|
|
4
|
-
`&&o++}return[f,o]}p(j,"keyLineSpan");function h(e,t){$(e,t);let r;try{r=x(e)}catch{throw new Error(`frontmatter splice: unparseable frontmatter in ${t}`)}if(r===null||typeof r!="object"||Array.isArray(r))throw new Error(`frontmatter splice: frontmatter is not a mapping in ${t}`);return r}p(h,"parseRecord");function D(e,t){let r;try{r=R(e)}catch(n){throw new Error(`frontmatter splice: unparseable frontmatter in ${t}`,{cause:n})}if(r.raw===""&&r.body===e)throw new Error(`frontmatter splice: cannot locate frontmatter block in ${t}`);return{rawYaml:r.raw,body:r.body}}p(D,"splitDocSource");function I(e,t,r){const n=$(e,r),c=new Set(t),f=n.filter(i=>c.has(String(i.key))).map(i=>j(e,i,r)).sort((i,u)=>u[0]-i[0]);let o=e;for(const[i,u]of f)o=o.slice(0,i)+o.slice(u);const l=h(e,r);for(const i of t)delete l[i];return g(o,l,r),o}p(I,"dropTopLevelKeys");function M(e,t,r,n){const f=$(e,n).find(s=>String(s.key)===t);if(f===void 0)return e;if(!v(f.value))throw new Error(`frontmatter splice: ${t} is not a sequence in ${n}`);const o=f.value.items,l=o.map(s=>r(s.toJSON?.()));if(!l.some(Boolean))return e;const i=h(e,n),u=i[t];if(!Array.isArray(u))throw new Error(`frontmatter splice: ${t} is not a sequence in ${n}`);const E=u.filter((s,a)=>!l[a]);if(E.length===0){delete i[t];const s=I(e,[t],n);return g(s,i,n),s}const b=f.value.range;if(b===void 0)throw new Error(`frontmatter splice: rangeless sequence in ${n}`);const y=o.map(s=>{const a=s.range;if(a===void 0)throw new Error(`frontmatter splice: rangeless sequence item in ${n}`);return e.lastIndexOf(`
|
|
5
|
-
`,a[0]-1)+1});if(new Set(y).size!==y.length)throw new Error(`frontmatter splice: flow sequence cannot be spliced byte-precisely in ${n}`);const m=[];for(let s=0;s<o.length;s++){if(!l[s])continue;const a=y[s],S=y[s+1]??b[2];m.push([a,S])}m.sort((s,a)=>a[0]-s[0]);let d=e;for(const[s,a]of m)d=d.slice(0,s)+d.slice(a);return i[t]=E,g(d,i,n),d}p(M,"dropSequenceItems");function N(e,t,r,n){const c=h(e,n);c[t]=r;const f=O({[t]:r},{lineWidth:0});let o=e===""?f:(e.endsWith(`
|
|
6
|
-
`)?e:e+`
|
|
7
|
-
`)+f;return o=o.replace(/\r?\n$/,""),g(o,c,n),o}p(N,"appendRenderedKey");function g(e,t,r){let n;try{n=x(e===""?"{}":e)}catch(c){throw new Error(`frontmatter splice: transformed frontmatter does not parse in ${r}`,{cause:c})}if(!w(n??{},t))throw new Error(`frontmatter splice: spliced frontmatter does not round-trip in ${r}`)}p(g,"proveFrontmatterRoundTrip");function T(e,t,r){const{rawYaml:n,body:c}=D(e,r),f=e.length-c.length,o=e.indexOf(`
|
|
8
|
-
`),l=o<0?-1:o+1,i=l<0?-1:l+n.length;if(n===""&&f===e.length)throw new Error(`frontmatter splice: cannot locate frontmatter block in ${r}`);if(l<0||i>f)throw new Error(`frontmatter splice: cannot locate frontmatter block in ${r}`);return e.slice(0,l)+t+e.slice(i)}p(T,"rebuildDocSource");export{N as appendRenderedKey,M as dropSequenceItems,I as dropTopLevelKeys,g as proveFrontmatterRoundTrip,T as rebuildDocSource,D as splitDocSource};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ProfileManifestSnapshot, StateMigration } from './types.js';
|
|
2
|
-
export interface ProfileManifestRunResult {
|
|
3
|
-
/** Profile manifests found under the profiles root. */
|
|
4
|
-
profiles: number;
|
|
5
|
-
/** One row per migration that rewrote a manifest, in registry order. */
|
|
6
|
-
applied: {
|
|
7
|
-
profileId: string;
|
|
8
|
-
path: string;
|
|
9
|
-
migration: string;
|
|
10
|
-
}[];
|
|
11
|
-
/** Post-migration manifest per readable profile, in scan order — coherent
|
|
12
|
-
* under `dryRun`, where the same fold ran but nothing was written. */
|
|
13
|
-
snapshots: ProfileManifestSnapshot[];
|
|
14
|
-
/** Manifests left untouched because they are not valid JSON. Unreadable
|
|
15
|
-
* bytes are not a structure this lane can convert, and failing the run over
|
|
16
|
-
* one would block every other profile's convergence. */
|
|
17
|
-
skipped: {
|
|
18
|
-
profileId: string;
|
|
19
|
-
path: string;
|
|
20
|
-
error: string;
|
|
21
|
-
}[];
|
|
22
|
-
}
|
|
23
|
-
export declare function runProfileManifestMigrations(profilesRoot: string, opts: {
|
|
24
|
-
/** Held for the whole re-read/fold/write of one manifest — the same lock
|
|
25
|
-
* add/remove take, so a concurrent mutation either lands before the
|
|
26
|
-
* re-read or serializes after the write, never under it. */
|
|
27
|
-
withLock: <T>(profileId: string, fn: () => T) => T;
|
|
28
|
-
dryRun?: boolean;
|
|
29
|
-
migrations?: readonly StateMigration[];
|
|
30
|
-
}): ProfileManifestRunResult;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var l=(n,o)=>d(n,"name",{value:o,configurable:!0});import{existsSync as u,readFileSync as h,readdirSync as y}from"node:fs";import{join as S}from"node:path";import{atomicWriteJson as g}from"../core/fs-utils.js";import{STATE_MIGRATIONS as w}from"./registry.js";const A=/^[a-z0-9]+(?:-[a-z0-9]+)*-[0-9a-f]{8}$/;function x(n,o){const m=(o.migrations??w).filter(s=>s.lane==="profile-manifest"),e={profiles:0,applied:[],snapshots:[],skipped:[]};if(!u(n))return e;for(const s of y(n,{withFileTypes:!0})){if(!s.isDirectory())continue;const t=s.name;if(!A.test(t))continue;const i=S(n,t,"profile.json");u(i)&&(e.profiles+=1,o.withLock(t,()=>{let f;try{const r=JSON.parse(h(i,"utf8"));if(typeof r!="object"||r===null||Array.isArray(r))throw new Error("manifest is not a JSON object");f=r}catch(r){e.skipped.push({profileId:t,path:i,error:(r instanceof Error?r.message:String(r)).split(`
|
|
2
|
-
`)[0]});return}let a=f,c=!1;for(const r of m){const p=r.apply({profileId:t,path:i,raw:a});p!==null&&(a=p,c=!0,e.applied.push({profileId:t,path:i,migration:r.description}))}c&&o.dryRun!==!0&&g(i,a),e.snapshots.push({profileId:t,path:i,manifest:a})}))}return e}l(x,"runProfileManifestMigrations");export{x as runProfileManifestMigrations};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OnDiskMigrationLane, StateMigration } from './types.js';
|
|
2
|
-
export declare const STATE_MIGRATIONS: readonly StateMigration[];
|
|
3
|
-
export interface OnDiskMigrationIdentity {
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly lane: OnDiskMigrationLane;
|
|
6
|
-
}
|
|
7
|
-
export declare function onDiskMigrationIdentity(): readonly OnDiskMigrationIdentity[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var i=Object.defineProperty;var t=(o,r)=>i(o,"name",{value:r,configurable:!0});import{surfacesFrontmatterMigration as e}from"./001-surfaces-frontmatter.js";import{profileProjectMemoryMigration as n}from"./002-profile-project-memory.js";import{repositoryRootMemoryIdentityMigration as m}from"./003-repository-root-memory-identity/index.js";const a=[e,n,m];function y(){return a.filter(o=>o.lane!=="journaled").map(({id:o,lane:r})=>({id:o,lane:r}))}t(y,"onDiskMigrationIdentity");export{a as STATE_MIGRATIONS,y as onDiskMigrationIdentity};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { NodeMemoryTarget } from '../core/canvas/types.js';
|
|
2
|
-
import { type CorpusDiscovery } from './corpus.js';
|
|
3
|
-
import type { CorpusBlocker, CorpusIdentityRename, CorpusRepositoryDecision, CorpusStorePrefix, CorpusReferenceRewrite, OnDiskMigrationLane, StoreSnapshot } from './types.js';
|
|
4
|
-
export type OnDiskMigrationPhase = 'not-started' | 'planned' | 'written';
|
|
5
|
-
export interface OnDiskMigrationApplied {
|
|
6
|
-
store: string;
|
|
7
|
-
lane: OnDiskMigrationLane;
|
|
8
|
-
migration: string;
|
|
9
|
-
files: string[];
|
|
10
|
-
}
|
|
11
|
-
export interface OnDiskMigrationSkipped {
|
|
12
|
-
store: string;
|
|
13
|
-
relPath: string;
|
|
14
|
-
error: string;
|
|
15
|
-
}
|
|
16
|
-
export interface OnDiskMigrationRunResult {
|
|
17
|
-
profiles: number;
|
|
18
|
-
discovery: CorpusDiscovery;
|
|
19
|
-
snapshots: ReadonlyMap<string, StoreSnapshot>;
|
|
20
|
-
changed: number;
|
|
21
|
-
applied: OnDiskMigrationApplied[];
|
|
22
|
-
skipped: OnDiskMigrationSkipped[];
|
|
23
|
-
blocked: boolean;
|
|
24
|
-
blockers: CorpusBlocker[];
|
|
25
|
-
corpusPhase: OnDiskMigrationPhase;
|
|
26
|
-
wrote: {
|
|
27
|
-
profileManifests: string[];
|
|
28
|
-
documents: string[];
|
|
29
|
-
corpusConsumers: string[];
|
|
30
|
-
corpusIdentities: string[];
|
|
31
|
-
};
|
|
32
|
-
repositories: CorpusRepositoryDecision[];
|
|
33
|
-
storePrefixes: CorpusStorePrefix[];
|
|
34
|
-
renames: CorpusIdentityRename[];
|
|
35
|
-
references: CorpusReferenceRewrite[];
|
|
36
|
-
finalVerificationSucceeded: boolean;
|
|
37
|
-
dryRun: boolean;
|
|
38
|
-
}
|
|
39
|
-
export declare function runOnDiskMigrations(opts: {
|
|
40
|
-
dryRun?: boolean;
|
|
41
|
-
explicitDirs?: readonly string[];
|
|
42
|
-
nodes: readonly NodeMemoryTarget[];
|
|
43
|
-
}): Promise<OnDiskMigrationRunResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var b=Object.defineProperty;var l=(n,t)=>b(n,"name",{value:t,configurable:!0});import{profileSpace as y}from"../core/layout.js";import{listStoredProfiles as C}from"../core/scoped-state/profiles.js";import{resetScopeCache as R,userScopeRoot as S}from"../core/scope.js";import{buildCorpusSnapshot as g,discoverCorpus as v,loadCorpusSnapshots as k,parseFailureBlockers as M,runCorpusMigrations as P}from"./corpus.js";import{runConvergentMigrations as x}from"./convergent.js";async function j(n){const t=n.dryRun===!0,i=[],u=[],f=C(S()).map(({profileId:e,manifest:r})=>({profileId:e,manifest:r,path:y(r.grantee??"app:terminal",e).memory}));R();const s=await v({profiles:f,explicitDirs:n.explicitDirs,nodes:n.nodes}),p=[],d=new Map;for(const e of s.stores){if(!e.writable)continue;const r=x(e.descriptor.storeRoot,{dryRun:t});d.set(e.key,r.snapshot);for(const c of r.applied)i.push({store:e.key,lane:"convergent",migration:c.migration,files:c.files});for(const c of r.skipped)p.push({storeRoot:e.key,...c})}const a=k(s,{preloaded:d});p.push(...a.skipped);for(const e of p)u.push({store:e.storeRoot,relPath:e.relPath,error:e.error});const o=P(g(s,a.snapshots),{dryRun:t,blockers:[...s.blockers,...M(p)],rebuild:l(()=>g(s,k(s).snapshots),"rebuild")}),m=o.wrote.consumers.length>0||o.wrote.identities.length>0;if(m)for(const e of o.planned){const r=[...e.consumers,...e.identities];r.length>0&&i.push({store:"corpus",lane:"corpus",migration:e.migration,files:r})}const w=t?"planned":m?"written":"not-started",h=o.blocked;return{profiles:f.length,discovery:s,snapshots:a.snapshots,changed:i.reduce((e,r)=>e+r.files.length,0),applied:i,skipped:u,blocked:h,blockers:o.blockers,corpusPhase:w,wrote:{profileManifests:[],documents:i.filter(e=>e.lane==="convergent").flatMap(e=>e.files),corpusConsumers:o.wrote.consumers,corpusIdentities:o.wrote.identities},repositories:o.repositories,storePrefixes:o.storePrefixes,renames:o.renames,references:o.references,finalVerificationSucceeded:o.verified&&!h,dryRun:t}}l(j,"runOnDiskMigrations");export{j as runOnDiskMigrations};
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
-
import type { MemoryStoreDescriptor, MemoryTarget } from '../core/memory-resolver.js';
|
|
3
|
-
import type { ProjectNamespaceSource } from '../core/memory/project-namespace.js';
|
|
4
|
-
import type { ProfileManifest } from '../types.js';
|
|
5
|
-
export interface JournaledMigration {
|
|
6
|
-
lane: 'journaled';
|
|
7
|
-
description: string;
|
|
8
|
-
/** Runs inside the canvas-db migration transaction. Filesystem work under
|
|
9
|
-
* `canvasHome` is OUTSIDE that transaction — it must be crash-resumable
|
|
10
|
-
* (a re-run after a partial application completes rather than corrupts). */
|
|
11
|
-
apply(db: DatabaseSync, canvasHome: string): void;
|
|
12
|
-
}
|
|
13
|
-
export interface ConvergentMigration {
|
|
14
|
-
readonly id: string;
|
|
15
|
-
lane: 'convergent';
|
|
16
|
-
description: string;
|
|
17
|
-
/** Pure planning: return the full new text of each doc to rewrite. The
|
|
18
|
-
* runner filters no-op changes and performs the writes. */
|
|
19
|
-
apply(store: StoreSnapshot): DocChange[];
|
|
20
|
-
}
|
|
21
|
-
/** One stored `profile.json` handed to the profile-manifest lane. */
|
|
22
|
-
export interface ProfileManifestInput {
|
|
23
|
-
/** The immediate directory name under the profiles root. The only root
|
|
24
|
-
* classifier a migration may key on — a manifest `name` is mutable. */
|
|
25
|
-
profileId: string;
|
|
26
|
-
/** Absolute path to the `profile.json`. */
|
|
27
|
-
path: string;
|
|
28
|
-
/** Parsed JSON exactly as stored, historical shapes included. */
|
|
29
|
-
raw: Record<string, unknown>;
|
|
30
|
-
}
|
|
31
|
-
export interface ProfileManifestMigration {
|
|
32
|
-
readonly id: string;
|
|
33
|
-
lane: 'profile-manifest';
|
|
34
|
-
description: string;
|
|
35
|
-
/** Pure planning: the full replacement record, or null when this manifest is
|
|
36
|
-
* already current. A structure the migration cannot convert THROWS — the
|
|
37
|
-
* run fails rather than persisting a guessed value. */
|
|
38
|
-
apply(input: ProfileManifestInput): Record<string, unknown> | null;
|
|
39
|
-
}
|
|
40
|
-
export type OnDiskMigration = ConvergentMigration | ProfileManifestMigration | CorpusMigration;
|
|
41
|
-
export type OnDiskMigrationLane = OnDiskMigration['lane'];
|
|
42
|
-
export type StateMigration = JournaledMigration | OnDiskMigration;
|
|
43
|
-
/** One profile's manifest after every profile-manifest migration folded —
|
|
44
|
-
* the bytes on disk after a write run, and the bytes a write run WOULD have
|
|
45
|
-
* produced under `--dry-run`. */
|
|
46
|
-
export interface ProfileManifestSnapshot {
|
|
47
|
-
profileId: string;
|
|
48
|
-
path: string;
|
|
49
|
-
manifest: ProfileManifest;
|
|
50
|
-
}
|
|
51
|
-
/** One parsed markdown doc in a store snapshot. */
|
|
52
|
-
export interface StoreDoc {
|
|
53
|
-
/** Absolute file path. */
|
|
54
|
-
path: string;
|
|
55
|
-
/** Path relative to the store root, `/`-separated. */
|
|
56
|
-
relPath: string;
|
|
57
|
-
/** Full file text as read from disk. */
|
|
58
|
-
source: string;
|
|
59
|
-
/** Parsed frontmatter record (null when the file has no frontmatter block). */
|
|
60
|
-
frontmatter: Record<string, unknown> | null;
|
|
61
|
-
body: string;
|
|
62
|
-
}
|
|
63
|
-
/** Every parseable `.md` doc under one memory-store root. */
|
|
64
|
-
export interface StoreSnapshot {
|
|
65
|
-
root: string;
|
|
66
|
-
docs: StoreDoc[];
|
|
67
|
-
}
|
|
68
|
-
/** One planned rewrite: the full new file text for `path`. */
|
|
69
|
-
export interface DocChange {
|
|
70
|
-
path: string;
|
|
71
|
-
/** Complete replacement text for the file, or null to delete it. */
|
|
72
|
-
after: string | null;
|
|
73
|
-
}
|
|
74
|
-
/** Why a root or store entered the corpus. `cwd-ancestor` is the walk up from
|
|
75
|
-
* the invoking directory, `profile-project` a project a profile manifest names,
|
|
76
|
-
* `descendant` the exhaustive nested-store walk below either, `explicit-dir` a
|
|
77
|
-
* `--dir` argument. */
|
|
78
|
-
export type CorpusDiscoveryReason = 'user' | 'profile' | 'profile-project' | 'cwd-ancestor' | 'descendant' | 'node' | 'plugin' | 'builtin' | 'explicit-dir';
|
|
79
|
-
/** How far discovery searched from one root: the root's own store only, the
|
|
80
|
-
* ancestor walk above it, the exhaustive descendant walk below it, its
|
|
81
|
-
* installed plugins, or the canvas node stores. */
|
|
82
|
-
export type CorpusDiscoveryBoundary = 'store' | 'ancestors' | 'descendants' | 'plugins' | 'nodes';
|
|
83
|
-
/** One place discovery looked, reported whether or not it yielded a store —
|
|
84
|
-
* the frontier an operator reads to see what a run could NOT have seen. */
|
|
85
|
-
export interface CorpusDiscoveryRoot {
|
|
86
|
-
reason: CorpusDiscoveryReason;
|
|
87
|
-
/** The directory searched: a `.crouter` root, a store dir, or a scan root. */
|
|
88
|
-
root: string;
|
|
89
|
-
boundary: CorpusDiscoveryBoundary;
|
|
90
|
-
/** Profile id, node id, or the `--dir` argument that produced this root. */
|
|
91
|
-
detail?: string;
|
|
92
|
-
}
|
|
93
|
-
/** One reason a store is in the corpus. A store reached several ways keeps
|
|
94
|
-
* every reason — deduping physical stores must not erase why they matter. */
|
|
95
|
-
export interface CorpusStoreDiscovery {
|
|
96
|
-
reason: CorpusDiscoveryReason;
|
|
97
|
-
root: string;
|
|
98
|
-
targetId?: string;
|
|
99
|
-
}
|
|
100
|
-
export interface CorpusStore {
|
|
101
|
-
/** Realpath of the memory dir: the dedup key, and the id every report row and
|
|
102
|
-
* blocker cites this store by. */
|
|
103
|
-
key: string;
|
|
104
|
-
descriptor: MemoryStoreDescriptor;
|
|
105
|
-
/** Documents after the per-store convergent lane folded, so the corpus lane
|
|
106
|
-
* plans against exactly the bytes a write run leaves on disk. */
|
|
107
|
-
snapshot: StoreSnapshot;
|
|
108
|
-
discovery: readonly CorpusStoreDiscovery[];
|
|
109
|
-
/** Ids of every target that mounts this store. Empty for a store no target
|
|
110
|
-
* reaches — a disabled plugin, a node store whose metadata is unreadable. */
|
|
111
|
-
targets: readonly string[];
|
|
112
|
-
/** False for builtin: package-owned, regenerated on install, corpus INPUT
|
|
113
|
-
* only (link resolution and lint validation), never written. */
|
|
114
|
-
writable: boolean;
|
|
115
|
-
}
|
|
116
|
-
export interface CorpusTarget {
|
|
117
|
-
/** `${profileId ?? '-'}:${nodeId ?? '-'}:${realCwd}`. */
|
|
118
|
-
id: string;
|
|
119
|
-
kind: 'cwd' | 'profile' | 'project' | 'node';
|
|
120
|
-
/** Profile id, node id, or the directory this target speaks for. */
|
|
121
|
-
origin: string;
|
|
122
|
-
target: MemoryTarget;
|
|
123
|
-
/** Store keys in this target's source precedence order. */
|
|
124
|
-
storeKeys: readonly string[];
|
|
125
|
-
}
|
|
126
|
-
export interface CorpusSnapshot {
|
|
127
|
-
stores: readonly CorpusStore[];
|
|
128
|
-
targets: readonly CorpusTarget[];
|
|
129
|
-
roots: readonly CorpusDiscoveryRoot[];
|
|
130
|
-
store(key: string): CorpusStore | undefined;
|
|
131
|
-
/** The target's stores in precedence order; empty for an unknown target. */
|
|
132
|
-
storesForTarget(targetId: string): CorpusStore[];
|
|
133
|
-
}
|
|
134
|
-
/** Why a corpus run may not write. `inaccessible-root`/`inaccessible-target`
|
|
135
|
-
* mean discovery could not see all of the corpus; `package-owned-corpus` is a
|
|
136
|
-
* store the run may only read (builtin, or a package handed in read-only)
|
|
137
|
-
* whose documents still need an identity rewrite; `verification` is raised
|
|
138
|
-
* after both write phases, against a corpus rebuilt from file truth. */
|
|
139
|
-
export type CorpusBlockerKind = 'inaccessible-root' | 'inaccessible-target' | 'parse-failure' | 'namespace' | 'association' | 'front-door' | 'divergent-reference' | 'unsafe-route' | 'collision' | 'package-owned-corpus' | 'verification';
|
|
140
|
-
export interface CorpusBlocker {
|
|
141
|
-
kind: CorpusBlockerKind;
|
|
142
|
-
/** What is wrong and what the operator does about it. */
|
|
143
|
-
message: string;
|
|
144
|
-
storeRoot?: string;
|
|
145
|
-
targetId?: string;
|
|
146
|
-
/** The one file at fault. */
|
|
147
|
-
path?: string;
|
|
148
|
-
/** The canonical name or namespace at fault. */
|
|
149
|
-
name?: string;
|
|
150
|
-
/** Every file at fault when the finding is a relationship between them. */
|
|
151
|
-
paths?: string[];
|
|
152
|
-
}
|
|
153
|
-
export interface CorpusRepositoryDecision {
|
|
154
|
-
repositoryRoot: string;
|
|
155
|
-
repositoryKey: string;
|
|
156
|
-
declarationPath: string;
|
|
157
|
-
namespace: string;
|
|
158
|
-
source: 'declared' | ProjectNamespaceSource;
|
|
159
|
-
action: 'kept' | 'created' | 'filled-linked-root';
|
|
160
|
-
}
|
|
161
|
-
export type FrontDoorAction = 'none' | 'kept-root' | 'created-root' | `transferred-from:${string}`;
|
|
162
|
-
export interface CorpusStorePrefix {
|
|
163
|
-
storeRoot: string;
|
|
164
|
-
ownerDir: string;
|
|
165
|
-
repositoryRoot: string;
|
|
166
|
-
ownerRelativePath: string;
|
|
167
|
-
oldPrefix: string;
|
|
168
|
-
oldRule: 'pre-003' | 'per-store-declaration';
|
|
169
|
-
effectivePrefix: string;
|
|
170
|
-
nestedDeclarationAction: 'none' | 'removed' | 'synthetic-index-removed';
|
|
171
|
-
/** Only the repository-root store reports the repository's front-door action. */
|
|
172
|
-
frontDoorAction: FrontDoorAction;
|
|
173
|
-
}
|
|
174
|
-
export interface CorpusIdentityRename {
|
|
175
|
-
storeRoot: string;
|
|
176
|
-
path: string;
|
|
177
|
-
from: string;
|
|
178
|
-
to: string;
|
|
179
|
-
}
|
|
180
|
-
export interface CorpusReferenceRewrite {
|
|
181
|
-
storeRoot: string;
|
|
182
|
-
path: string;
|
|
183
|
-
kind: 'link' | 'memory-read';
|
|
184
|
-
from: string;
|
|
185
|
-
to: string;
|
|
186
|
-
}
|
|
187
|
-
export interface CorpusPlan {
|
|
188
|
-
/** A blocker anywhere stops the whole lane: nothing is written in any store. */
|
|
189
|
-
blockers: CorpusBlocker[];
|
|
190
|
-
/** Phase 1 — rewrites of authored links and routes that POINT AT an identity. */
|
|
191
|
-
consumers: DocChange[];
|
|
192
|
-
/** Phase 2 — rewrites that change a document's own identity. A non-null
|
|
193
|
-
* `after` is the file's complete final text INCLUDING that same file's
|
|
194
|
-
* phase-1 consumer rewrites: phase 2 writes last and would otherwise revert
|
|
195
|
-
* them. A null `after` deletes an obsolete synthetic identity document. */
|
|
196
|
-
identities: DocChange[];
|
|
197
|
-
repositories: CorpusRepositoryDecision[];
|
|
198
|
-
storePrefixes: CorpusStorePrefix[];
|
|
199
|
-
renames: CorpusIdentityRename[];
|
|
200
|
-
references: CorpusReferenceRewrite[];
|
|
201
|
-
}
|
|
202
|
-
export interface CorpusMigration {
|
|
203
|
-
readonly id: string;
|
|
204
|
-
lane: 'corpus';
|
|
205
|
-
description: string;
|
|
206
|
-
/** Pure planning over every discovered store at once. */
|
|
207
|
-
plan(corpus: CorpusSnapshot): CorpusPlan;
|
|
208
|
-
/** Re-checked against a corpus rebuilt from file truth AFTER both write
|
|
209
|
-
* phases; findings surface as `verification` blockers. */
|
|
210
|
-
verify?(corpus: CorpusSnapshot): CorpusBlocker[];
|
|
211
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** The entry marker keeps delivery-time rendering exclusive to birth notices. */
|
|
2
|
-
export declare const BIRTH_ANNOUNCEMENT_MARKER = "crtr.birth-announcement.v1";
|
|
3
|
-
export declare const BIRTH_ANNOUNCEMENT_AGE_TOKEN = "[[CRTR_BIRTH_ANNOUNCEMENT_AGE]]";
|
|
4
|
-
export declare function birthAnnouncementBody(child: {
|
|
5
|
-
name: string;
|
|
6
|
-
nodeId: string;
|
|
7
|
-
kind: string;
|
|
8
|
-
creator: string;
|
|
9
|
-
}): string;
|
|
10
|
-
export declare function birthAnnouncementAge(createdAt: string, now?: number): string;
|
|
11
|
-
/** Return a birth notice's body rendered at delivery, or null for every other entry. */
|
|
12
|
-
export declare function renderBirthAnnouncementBody(data: Record<string, unknown> | undefined, createdAt: string, now?: number): string | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var i=Object.defineProperty;var t=(n,o)=>i(n,"name",{value:o,configurable:!0});const c="crtr.birth-announcement.v1",a="[[CRTR_BIRTH_ANNOUNCEMENT_AGE]]";function _(n){return`${n.name} (${n.nodeId}, ${n.kind}) was created under you by ${n.creator} ${a} ago. For your awareness only \u2014 no response or action is needed, and no need to mention it unless asked. Treat its future reports as background you already know about; investigate only if something genuinely needs you.`}t(_,"birthAnnouncementBody");function d(n,o=Date.now()){const e=Math.max(0,o-Date.parse(n));if(e<6e4)return"moments";const r=Math.floor(e/6e4);if(r<60)return`${r} minute${r===1?"":"s"}`;const s=Math.floor(e/36e5);if(s<48)return`${s} hour${s===1?"":"s"}`;const u=Math.floor(e/864e5);return`${u} day${u===1?"":"s"}`}t(d,"birthAnnouncementAge");function f(n,o,e=Date.now()){return n?.birth_announcement!==c||typeof n.body!="string"?null:n.body.replace(a,d(o,e))}t(f,"renderBirthAnnouncementBody");export{a as BIRTH_ANNOUNCEMENT_AGE_TOKEN,c as BIRTH_ANNOUNCEMENT_MARKER,d as birthAnnouncementAge,_ as birthAnnouncementBody,f as renderBirthAnnouncementBody};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Application memory
|
|
3
|
-
description: When an application's agents need shared durable knowledge, read this because a profile store gives runs one owned memory location and scopes can allow reading without writing.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Application memory
|
|
7
|
-
|
|
8
|
-
Use this recipe when several runs need the same application guidance. Run `npx tsx examples/guides/app-memory.ts /path/to/repo`; it ensures a profile, creates a profile-owned knowledge document if it does not already exist, then starts a run allowed to read but not write memory.
|
|
9
|
-
|
|
10
|
-
<include lang="ts">../../../examples/guides/app-memory.ts</include>
|
|
11
|
-
|
|
12
|
-
A profile is the application's durable identity: it names the memory store and the projects whose context the profile can reach. The routing line is part of the document, not decoration. State both the moment the agent should read it and the reason it matters; a document with a vague routing line will not surface when the agent needs it.
|
|
13
|
-
|
|
14
|
-
The `boot`/`preview` surface exposes the document's routing line when this profile's agent starts. The task asks for a release note without naming `release/voice`; in the local run the agent read that document before producing the note. Without a surface entry, a memory document appears only in its directory listing and its routing line cannot select it at boot. The run passes `scopes: ['memory:read']`. That is an allow-list: node-targeted memory reads are allowed and writes are refused because `memory:write` is absent. The application itself is not narrowed by those node scopes, so keep application credentials and its memory mutation policy separate from the agent's capabilities.
|
|
15
|
-
|
|
16
|
-
Observed against the local daemon with `APP_PROFILE=release-notes-app-guide-boot-preview GUIDE_MODEL=openai-codex/gpt-6-sol:high`:
|
|
17
|
-
|
|
18
|
-
```text
|
|
19
|
-
You can now download your invoices as a CSV from account settings.
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Use profile memory for knowledge shared across the application's related projects. Put facts that belong to one repository in project memory instead, and temporary run notes in node memory. See [memory](../../concepts/memory.md) for the ownership tiers and [profiles, kinds, and modes](../../concepts/profiles-kinds-and-modes.md) for what a profile changes.
|
package/docs/sdk/memory.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Memory
|
|
3
|
-
description: Read and write memory documents with an explicit target for every request.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# `client.memory`
|
|
7
|
-
|
|
8
|
-
Phase 3. `client.memory` reads and writes the memory documents that shape an agent run. Every call names its target; the daemon never uses its own working directory or environment to select memory.
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
const page = await client.memory.list({ node: nodeId, kind: 'knowledge', limit: 50 });
|
|
12
|
-
const document = await client.memory.retrieve('insights/capture', { node: nodeId, frontmatter: true });
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Target
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
type MemoryScope = {
|
|
19
|
-
node?: string;
|
|
20
|
-
cwd?: string;
|
|
21
|
-
profile?: string;
|
|
22
|
-
store?: 'node' | 'project' | 'profile' | 'user' | 'builtin';
|
|
23
|
-
};
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Pass `node` to use that node's working directory and profile. Do not combine it with `cwd` or `profile`. With no target, only user and builtin memory are searched. `store` restricts the request to one memory tier; `store: 'node'` requires `node`, and `store: 'profile'` requires a profile target. `create` defaults to the nearest project store when one is available, otherwise the user store. `update`, `delete`, and `move` resolve the existing document through normal scope precedence when `store` is omitted. `builtin` is read-only.
|
|
27
|
-
|
|
28
|
-
When a request supplies `node`, its node row must hold `memory:read` for `list`, `retrieve`, `search`, `history`, and `resolve`, or `memory:write` for `create`, `update`, `delete`, and `move`. Calls without `node` are external application calls and are not narrowed by a node scope list.
|
|
29
|
-
|
|
30
|
-
## Methods
|
|
31
|
-
|
|
32
|
-
Every method accepts `RequestOptions` as its final optional argument (`signal`, `timeout`, `maxRetries`, and `headers`). A document name can contain `/`; the SDK encodes it as one path segment.
|
|
33
|
-
|
|
34
|
-
| Method | Parameters | Result |
|
|
35
|
-
|---|---|---|
|
|
36
|
-
| `memory.list(query?, options?)` | `MemoryScope & { kind?, limit?, after? }`; `limit` is 1–100 (default 100) | `MemoryPage<MemoryDocSummaryDTO>` |
|
|
37
|
-
| `memory.retrieve(name, query?, options?)` | `name`; `MemoryScope & { frontmatter? }` | `MemoryDocDTO` |
|
|
38
|
-
| `memory.create(params, options?)` | `MemoryDocCreateRequest` | `MemoryDocDTO` |
|
|
39
|
-
| `memory.update(name, params, options?)` | `name`; `MemoryDocUpdateRequest` | `MemoryDocDTO` |
|
|
40
|
-
| `memory.delete(name, scope?, options?)` | `name`; `MemoryScope` | `MemoryDocDeletedDTO` |
|
|
41
|
-
| `memory.move(name, params, options?)` | `name`; `MemoryDocMoveRequest` | `MemoryDocMovedDTO` |
|
|
42
|
-
| `memory.search(params, options?)` | `MemorySearchRequest` | `MemoryPage<MemorySearchHitDTO>` |
|
|
43
|
-
| `memory.history(name, query?, options?)` | `name`; `MemoryHistoryQuery` | `MemoryHistoryDTO` |
|
|
44
|
-
| `memory.resolve(name, scope?, options?)` | `name`; `MemoryScope` | `MemoryDocRefDTO` |
|
|
45
|
-
|
|
46
|
-
`MemoryDocCreateRequest` requires `name`, `kind`, `when_and_why_to_read`, and `body`; it also accepts `frontmatter`, `extensions`, and the scope fields. `frontmatter.privacy` accepts `public`, `friends`, or `private`; creation defaults to persisted `public`. `MemoryDocUpdateRequest` requires `rationale`, which is stored in revision history rather than document text, and optionally accepts `body`, `frontmatter`, `extensions`, `unset`, and the scope fields. Set `frontmatter.privacy` to change the level; it cannot be unset. A legacy document without the field reads as `private`. `MemoryDocMoveRequest` requires `to` and accepts the scope fields.
|
|
47
|
-
|
|
48
|
-
`retrieve` returns the body by default. With `frontmatter: true`, its `body` is the complete document source with the effective privacy level included for older documents. `MemoryDocDTO` also contains `privacy`, `frontmatter`, `representation` (`'leaf-file'` or `'directory-index'`), `links`, and any lint `findings`; document DTOs include their canonical name, kind, scope, extensions, path, store root, physical relative path, and any competing candidates. `resolve` returns the winning document's location and optional plugin name without reading its body.
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
await client.memory.create({
|
|
52
|
-
name: 'billing/refund-policy',
|
|
53
|
-
kind: 'knowledge',
|
|
54
|
-
when_and_why_to_read: 'When handling a refund request, read this because the eligibility window is not in the order record.',
|
|
55
|
-
body: 'Refunds are available for 60 days.',
|
|
56
|
-
profile: 'my-app',
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
await client.memory.update('billing/refund-policy', {
|
|
60
|
-
rationale: 'The eligibility window changed on 2026-01-04.',
|
|
61
|
-
body: 'Refunds are available for 90 days.',
|
|
62
|
-
profile: 'my-app',
|
|
63
|
-
});
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
The daemon returns document text without expanding shell blocks. Builtin and plugin documents are read-only. `kind`, `when-and-why-to-read`, `origin`, and `last-updated` cannot be set or removed directly. Each mutation writes a complete before/after history record; delete leaves a tombstone. `retrieve` and `resolve` return `NotFoundError` with status 404 and code `memory_document_not_found` for a deleted document or an unknown name. Concurrent writes are last-write-wins.
|
|
67
|
-
|
|
68
|
-
`search` uses ranked search by default. Set `body: true` to include document bodies in ranking, or `grep: true` for regular-expression line matches; `grep` and `body` cannot be combined, and `min_score` is only available in ranked search. Ranked hits contain `kind`, `score`, and `short_form`; grep hits contain `line` and `text`.
|
|
69
|
-
|
|
70
|
-
`history` returns newest-first revision summaries, optionally with `diff`, or the full before/after record for one `revision`. A delete leaves history available through its tombstone.
|
|
71
|
-
|
|
72
|
-
## Pages
|
|
73
|
-
|
|
74
|
-
`list` and `search` return `{ object: 'list', data, has_more }` as a `MemoryPage`. A page has `hasNextPage()`, `getNextPage()`, and is async iterable across every page. The list cursor is the final document's canonical name. Ranked search uses the final hit's name; grep uses an opaque cursor that includes the match location, which the SDK handles.
|
|
75
|
-
|
|
76
|
-
```ts
|
|
77
|
-
const page = await client.memory.search({ query: 'refund window', node: nodeId });
|
|
78
|
-
for (const hit of page.data) console.log(hit.name);
|
|
79
|
-
|
|
80
|
-
if (page.hasNextPage()) {
|
|
81
|
-
const next = await page.getNextPage();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
for await (const hit of page) console.log(hit.name);
|
|
85
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|