@north-light/crouter 0.3.352 → 0.3.354
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 +133 -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 +167 -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 +9 -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/04-orchestration-kernel.md +7 -7
- 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/render/chat-view.js +1 -1
- 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/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/tool-calls.d.ts +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 +806 -1553
- 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 +9 -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 +160 -0
- package/dist/core/graph/documents.js +7 -0
- package/dist/core/graph/edges.d.ts +24 -0
- package/dist/core/graph/edges.js +1 -0
- package/dist/core/graph/events.d.ts +26 -0
- package/dist/core/graph/events.js +6 -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 +28 -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 +17 -9
- package/dist/core/runtime/roadmap.js +4 -4
- 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 +27 -0
- package/dist/core/substrate/delivery/listings.js +4 -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 +47 -0
- package/dist/core/substrate/delivery/render-event.js +6 -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/app-listener.js +11 -11
- 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/modelauth.d.ts +3 -0
- package/dist/daemon/api/handlers/modelauth.js +1 -1
- 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.js +1 -1
- package/dist/daemon/api/handlers/vendor-status.d.ts +8 -0
- package/dist/daemon/api/handlers/vendor-status.js +1 -0
- 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/principal.d.ts +5 -0
- package/dist/daemon/api/principal.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/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
|
@@ -23,4 +23,4 @@ A node wakes when work actually arrives: a subscribed child pushes a report, ano
|
|
|
23
23
|
|
|
24
24
|
Do not keep a node active to poll a child, a person, or a message. Creation automatically subscribes a parent to its child, and the runtime delivers the child’s outcome. Waiting for something the canvas can push is free: end the turn and let the node become dormant. Schedule a cron only for recurring work or an external condition that nothing can push into the canvas, such as checking a CI run. A timer added “just in case” a child does not report duplicates a runtime guarantee and hides a runtime defect.
|
|
25
25
|
|
|
26
|
-
A broker crash does not erase the node. The daemon retains the durable node row, conversation, waits, and outstanding inbox entries, then applies its recovery policy. This is what makes a resident event-driven assistant practical: it can wait for a webhook, be dormant for hours, and resume its saved work only when the webhook produces a message. Use [`nodes.message`](../sdk/nodes.md#sending-a-follow-up) to deliver that external event, and run `crtr
|
|
26
|
+
A broker crash does not erase the node. The daemon retains the durable node row, conversation, waits, and outstanding inbox entries, then applies its recovery policy. This is what makes a resident event-driven assistant practical: it can wait for a webhook, be dormant for hours, and resume its saved work only when the webhook produces a message. Use [`nodes.message`](../sdk/nodes.md#sending-a-follow-up) to deliver that external event, and run `crtr canvas read internal/nodes-and-canvas` for lifecycle operations.
|
package/docs/concepts/memory.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description: When shaping an agent without rewriting its prompt, read this because
|
|
2
|
+
title: Documents
|
|
3
|
+
description: When shaping an agent without rewriting its prompt, read this because documents separate facts to consult from behavior to embody and let each owner control who receives them.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Documents
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Documents shape a node without adding the same instructions to every prompt. A document says what it contains, who owns it, and when it should enter context. The result is durable guidance that can be discovered when relevant instead of a growing startup prompt.
|
|
9
9
|
|
|
10
10
|
There are two kinds. **Knowledge** is something an agent consults: a procedure, fact, or technical reference. A **preference** is behavior the agent should embody: a standing directive or correction. This is a use-based split. A procedure and a fact are both knowledge because the agent reads either one to answer a question; a preference changes how it acts.
|
|
11
11
|
|
|
12
|
-
|
|
|
12
|
+
| Owner | Who it is | Put here |
|
|
13
13
|
|---|---|---|
|
|
14
14
|
| Node | One running node | A note needed across that node’s fresh contexts |
|
|
15
|
-
|
|
|
15
|
+
| Repo | One repository | Repository facts and procedures |
|
|
16
16
|
| Profile | One application identity and its purview | Application-wide conventions and knowledge |
|
|
17
17
|
| User | One person | Facts and preferences that follow them everywhere |
|
|
18
|
-
|
|
|
18
|
+
| Plugin `crtr` | crouter | Runtime documentation that ships to every user |
|
|
19
19
|
|
|
20
|
-
Choose the narrowest
|
|
20
|
+
Choose the narrowest owner that reaches the next agent who needs the document. For an application author, the profile is the usual owner for knowledge shared by that application’s nodes across repositories. A node’s `memory:read` and `memory:write` scopes can respectively permit reading while denying changes.
|
|
21
21
|
|
|
22
22
|
```mermaid
|
|
23
23
|
flowchart LR
|
|
24
|
-
Doc[
|
|
25
|
-
|
|
26
|
-
Preview -->
|
|
27
|
-
|
|
24
|
+
Doc[Document] --> Rule[Delivery rule: on, if, deliver]
|
|
25
|
+
Rule -->|activity matches| Preview[Name, preview, or full body]
|
|
26
|
+
Preview --> Line[Preview tells the agent why to read]
|
|
27
|
+
Line --> Read[Explicit full read when needed]
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
A
|
|
30
|
+
A delivery rule is the delivery mechanism. A document is not loaded because of its name or because its preview resembles the task. Each rule names an activity such as boot, workspace-open, file-read, document-read, command, or pre-command; it can also match a path, carry an `if` on the node’s shape, and selects what to deliver: the name, the preview, or the full content. A document with no delivery rule stays in its listing until an agent deliberately finds or reads it.
|
|
31
31
|
|
|
32
|
-
The
|
|
32
|
+
The preview is delivered at the middle level, not a trigger. For example, a profile document can have a file-read rule that delivers its preview when an order record is opened. Its line — “When handling a refund request, read this because the eligibility window is not in the order record” — then tells the agent why an explicit full read is useful. The rule delivers the preview; the line helps the agent decide whether to read the body without pretending to replace it.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Documents therefore support progressive disclosure. You can record knowledge freely, but it costs future contexts only when a delivery rule delivers it. Read `crtr doc write -h` to write a document and `crtr canvas read internal/memory-loading` for the delivery mechanics.
|
|
@@ -25,4 +25,4 @@ The one way work reports upward is a **push**. A push writes a durable report an
|
|
|
25
25
|
|
|
26
26
|
A node owns an outcome, not merely an artifact. It may write files and reports while working, but its terminal result is credible only when it has evidence that the requested goal was met. The canvas supports that responsibility: it preserves the goal, durable artifacts, reports, and relationships across fresh contexts and broker replacement.
|
|
27
27
|
|
|
28
|
-
Use a one-shot SDK call such as [`nodes.parse`](../sdk/nodes.md#parse-and-structured-output) when work is bounded and its only useful output is a typed result. Use `nodes.create` when the application needs a continuing conversation or must observe work while it runs. For the operational graph and report model, run `crtr
|
|
28
|
+
Use a one-shot SDK call such as [`nodes.parse`](../sdk/nodes.md#parse-and-structured-output) when work is bounded and its only useful output is a typed result. Use `nodes.create` when the application needs a continuing conversation or must observe work while it runs. For the operational graph and report model, run `crtr canvas read internal/nodes-and-canvas`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Profiles, kinds, and modes
|
|
3
|
-
description: When designing an agent run, read this because profiles, kinds, modes, and
|
|
3
|
+
description: When designing an agent run, read this because profiles, kinds, modes, and document owners solve different problems and prevent a long prompt from becoming an unstable substitute for an application identity.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Profiles, kinds, and modes
|
|
@@ -12,20 +12,20 @@ Shape a run by choosing the dial that owns the decision. The four dials are inde
|
|
|
12
12
|
| Profile | Which application identity, project purview, environment, and profile memory apply? | An application or body of work has stable directories and conventions |
|
|
13
13
|
| Kind | What standing role, model tier, tools, and expertise should the agent have? | The work matches a recurring role such as developer or reviewer |
|
|
14
14
|
| Mode | Does this node work hands-on or coordinate independent children? | Parallel work makes coordination the main job |
|
|
15
|
-
|
|
|
15
|
+
| Document owner | Who should receive a document? | Guidance must reach one node, repo, profile, user, or all crouter users |
|
|
16
16
|
|
|
17
|
-
A profile is not a label on a run. It is a stable agent identity with its own
|
|
17
|
+
A profile is not a label on a run. It is a stable agent identity with its own documents and a purview of project directories. It lets an application create nodes from the same target context even if the caller runs elsewhere. Create a profile when an app has a durable set of directories, environment values, and conventions worth sharing. Do not make a profile for every repository or individual request. Use [`client.profiles`](../sdk/resources.md) and the SDK’s `profile` create field to select the application’s identity.
|
|
18
18
|
|
|
19
19
|
```mermaid
|
|
20
20
|
flowchart LR
|
|
21
21
|
Profile[Profile: purview, environment, memory] --> Node
|
|
22
22
|
Kind[Kind: role and tools] --> Node
|
|
23
23
|
Mode[Mode: base or orchestrator] --> Node
|
|
24
|
-
Tier[
|
|
24
|
+
Tier[Document owner: reach] --> Node
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
A kind is a recurring role, not a decorative name. It carries a role-specific posture and may choose a suitable model tier and tools. A custom kind beats a long prompt when the role recurs and needs standing discipline that should survive every run: for example, an application’s compliance reviewer that always needs the same tools, expertise, and model choice. A one-off instruction belongs in the node’s prompt, where it does not create a permanent persona to maintain.
|
|
28
28
|
|
|
29
29
|
Base mode is the normal choice: the node owns and performs the work, using a child only for a separable part. Promote to orchestrator only when independent parts can proceed in parallel and the benefits outweigh coordination and integration. A terminal orchestrator still finishes normally; residency is separate and belongs to a person-facing ongoing conversation.
|
|
30
30
|
|
|
31
|
-
These choices keep the application prompt focused. Identity belongs in a profile, standing role in a kind, task-specific intent in the prompt, coordination in mode, and reusable knowledge in the narrowest
|
|
31
|
+
These choices keep the application prompt focused. Identity belongs in a profile, standing role in a kind, task-specific intent in the prompt, coordination in mode, and reusable knowledge in the narrowest document owner. For the full selection rules, run `crtr canvas read internal/agent-shaping`; [`nodes.create`](../sdk/nodes.md) documents the profile, kind, and mode fields an application passes.
|
|
@@ -29,4 +29,4 @@ Scopes rely on a more basic trust boundary: `crtrd` is the sole writer of durabl
|
|
|
29
29
|
|
|
30
30
|
For a browser or remote process, run `crtr sys connect`. It enables the daemon’s TCP listener when needed and returns `base_url` plus a bearer `token` to give the application. `crtr sys connect --scopes …` mints a new scoped token instead of returning the owner token. Treat either token as a credential: the remote app sends it as `Authorization: Bearer <token>`, and its scope list is the ceiling for scope-gated calls and newly created nodes.
|
|
31
31
|
|
|
32
|
-
The remote API is an explicit boundary, not permission to reach around it. Keep application code on the SDK or `/v1` contract, and let the daemon own state transitions. Run `crtr
|
|
32
|
+
The remote API is an explicit boundary, not permission to reach around it. Keep application code on the SDK or `/v1` contract, and let the daemon own state transitions. Run `crtr canvas read internal/nodes-and-canvas` for the operational ownership model.
|
|
@@ -26,4 +26,4 @@ The costs are real. A daemon must be running, and canvas state has one home inst
|
|
|
26
26
|
|
|
27
27
|
Those costs buy a simpler model: one state owner, one broker launcher, and clients that can reconnect. A CLI command, an SDK application, and a terminal viewer all use the same API for canvas state. They can come and go without creating competing writers or losing the graph that explains what each agent is doing.
|
|
28
28
|
|
|
29
|
-
For the lower-level runtime model, run `crtr
|
|
29
|
+
For the lower-level runtime model, run `crtr canvas read internal/nodes-and-canvas`. For a complete remote application setup, start with the SDK [getting started guide](../sdk/getting-started.md).
|
package/docs/sdk/README.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Drive a crouter daemon from a Node or browser application with the
|
|
|
5
5
|
|
|
6
6
|
# `@north-light/crouter-sdk`
|
|
7
7
|
|
|
8
|
-
The ESM-only client an application installs to drive a crouter daemon: create agent runs, watch streamed events, wait for typed results,
|
|
8
|
+
The ESM-only client an application installs to drive a crouter daemon: create agent runs, watch streamed events, wait for typed results, and reach the rest of the daemon's `/v1` API.
|
|
9
9
|
|
|
10
10
|
One package, one class. `new Crouter()` in Node talks to the owner's unix socket. `new Crouter({ baseURL, token })` in a browser or a remote process talks to the daemon's TCP listener with a bearer token. Resource methods issue `/v1` requests; `createAndWait`, `parse`, and `auth.status` compose more than one request. crtrd stays the sole owner of canvas state.
|
|
11
11
|
|
|
@@ -32,7 +32,6 @@ if (run.kind === 'result') console.log(run.output_parsed.root_cause);
|
|
|
32
32
|
| [Client construction](./client.md) | Every constructor option and its environment-variable fallback; per-request options |
|
|
33
33
|
| [Nodes](./nodes.md) | `create` parameters, the outcome union, `parse()` with a zod schema, `waitForOutcome`, `message`, `cancel`, nested resources |
|
|
34
34
|
| [Streaming](./streaming.md) | The event table, `stream()` / `events()`, the activity helper, resume with `after`, `stream_gap` and `stream_dropped` |
|
|
35
|
-
| [Memory](./memory.md) | The scope object and every `client.memory` method |
|
|
36
35
|
| [Files](./files.md) | Absolute-path reads, writes, and one-level lists |
|
|
37
36
|
| [Bash](./bash.md) | One bounded command and its output result |
|
|
38
37
|
| [Resource map](./resources.md) | Every namespace with its phase, what is deliberately excluded, and the `client.request()` escape hatch |
|
|
@@ -42,21 +41,21 @@ if (run.kind === 'result') console.log(run.output_parsed.root_cause);
|
|
|
42
41
|
|
|
43
42
|
## Phases
|
|
44
43
|
|
|
45
|
-
The surface ships in three cuts.
|
|
44
|
+
The surface ships in three cuts.
|
|
46
45
|
|
|
47
46
|
| Phase | What lands | State |
|
|
48
47
|
|---|---|---|
|
|
49
48
|
| **Phase 1** | Client construction and transports; `client.auth.status()`; `client.nodes.create`, `retrieve`, `list`, `outcome`, `waitForOutcome`, `createAndWait`, `parse`, `message`, `cancel`, and `interrupt`; `nodes.reports.list`; `profiles.ensure` and `retrieve`; `system.status` and `health`; the error hierarchy; per-request options; `crtr sys connect`; and `env-docker.connection()` | Shipped |
|
|
50
49
|
| **Phase 2 namespaces** | Node lifecycle, job, worktree, and result; canvas and canvas history; crons; human requests and inbox; models; `client.files.read` through `/v1/files/peek`, `write`, and `list`; and `client.bash.run` | Shipped |
|
|
51
50
|
| **Phase 2 streaming** | `GET /v1/nodes/{id}/events`, `nodes.stream(params, options?)`, `nodes.events(id, options?)`, `NodeStream`, and the activity helper | Shipped |
|
|
52
|
-
| **Phase 3** |
|
|
51
|
+
| **Phase 3** | The review, comment, and chat-inventory namespaces | Not shipped |
|
|
53
52
|
|
|
54
53
|
The per-run `scopes` create field ships in phase 1. `nodes.update` scope support remains phase 2 and is not in the shipped client or wire declarations.
|
|
55
54
|
|
|
56
55
|
## Verification status
|
|
57
56
|
|
|
58
|
-
The SDK declarations
|
|
57
|
+
The SDK declarations and streaming examples are verified.
|
|
59
58
|
|
|
60
59
|
## Where the agents read this
|
|
61
60
|
|
|
62
|
-
The same content routed for agents lives in the builtin memory document `crouter-sdk`, which ships with the `crtr` binary. An agent working in an application's repository reaches it with `crtr
|
|
61
|
+
The same content routed for agents lives in the builtin memory document `crouter-sdk`, which ships with the `crtr` binary. An agent working in an application's repository reaches it with `crtr canvas read crouter-sdk` and does not need this repository checked out.
|
package/docs/sdk/errors.md
CHANGED
|
@@ -64,19 +64,6 @@ The SDK validates path-segment identifiers before it makes a request. Invalid no
|
|
|
64
64
|
| The bearer token's ceiling lacks the scope a route needs, or `nodes.create` asks for `scopes` outside it (`details.scopes` lists them) | `PermissionDeniedError`, 403 `scope_denied` |
|
|
65
65
|
| A scoped token reaches an owner-only route (daemon restart, attach, broker internals, canvas prune, profile pause/resume/delete, model credential install) | `PermissionDeniedError`, 403 `owner_only` |
|
|
66
66
|
|
|
67
|
-
## Memory requests
|
|
68
|
-
|
|
69
|
-
| Condition | Class, status, and code |
|
|
70
|
-
|---|---|
|
|
71
|
-
| `retrieve` or `resolve` names a document that does not exist, including a document deleted earlier | `NotFoundError`, 404 `memory_document_not_found` |
|
|
72
|
-
| `history` names a document with no document or revision history | `NotFoundError`, 404 `not_found` |
|
|
73
|
-
| History is requested for a builtin or plugin document | `BadRequestError`, 400 `usage` |
|
|
74
|
-
| A mutation directly sets protected frontmatter (`kind`, `when-and-why-to-read`, `origin`, or `last-updated`) | `BadRequestError`, 400 `invalid_request` |
|
|
75
|
-
| An update would make no change | `BadRequestError`, 400 `usage` |
|
|
76
|
-
| A node-targeted caller lacks `memory:read` or `memory:write` | `PermissionDeniedError`, 403 `scope_denied` |
|
|
77
|
-
|
|
78
|
-
Invalid names, invalid scope combinations, invalid limits, builtin mutation selections, and invalid search combinations are also `BadRequestError` responses. Builtin and plugin documents cannot be mutated; no code should treat a 400 refusal as a successful write.
|
|
79
|
-
|
|
80
67
|
## The wire body
|
|
81
68
|
|
|
82
69
|
The daemon answers an error with:
|
|
@@ -13,6 +13,5 @@ These recipes turn the SDK namespaces into complete applications: a bounded extr
|
|
|
13
13
|
| [Event-driven assistant](./event-driven-assistant.md) | Events arrive over time from a webhook, queue, or watcher. | A resident node that wakes for each event. |
|
|
14
14
|
| [Fan-out pipeline](./fan-out-pipeline.md) | One task needs independent research before a synthesis. | An orchestrator's final report. |
|
|
15
15
|
| [Human approval](./human-approval.md) | A person must decide before work continues. | A node resumed by an inbox answer. |
|
|
16
|
-
| [Application memory](./app-memory.md) | Several runs need the same durable application knowledge. | A profile-owned document read by a scoped run. |
|
|
17
16
|
|
|
18
17
|
Start with typed extraction for a request/response job. Use a resident node when the same assistant should react again later. Use an orchestrator only when child work can proceed independently; otherwise keep the composition in your application.
|
package/docs/sdk/nodes.md
CHANGED
|
@@ -189,8 +189,6 @@ for (const report of reports) console.log(report.tier, report.body);
|
|
|
189
189
|
|
|
190
190
|
List routes return what the daemon returns. `nodes.list`, `nodes.reports.list`, and `nodes.jobs.list` return plain arrays — there is no page object, no `hasNextPage()`, and no `after` cursor on them, because the daemon has no paging substrate behind those routes and an envelope there would promise a continuation that can never happen.
|
|
191
191
|
|
|
192
|
-
The one place the page envelope exists is the phase-3 memory routes. See [Memory](./memory.md).
|
|
193
|
-
|
|
194
192
|
## Identifier validation
|
|
195
193
|
|
|
196
194
|
Methods that take a node id validate it before the request: core node methods, lifecycle methods, `nodes.reports`, `nodes.jobs`, `nodes.worktree`, and `nodes.result`. An invalid id throws `TypeError` locally and sends no request. `nodes.outcome(id, { wait })` also throws `RangeError` locally when `wait` is not an integer from 0 through 25.
|
package/docs/sdk/resources.md
CHANGED
|
@@ -26,7 +26,6 @@ Every namespace exported by the client. Namespaces are camelCase. Verbs are `cre
|
|
|
26
26
|
| `human.inbox` | `list`, `retrieve`, `respond`, `progress`, `cancel`, `history`, `response` | `/v1/human/inbox…` |
|
|
27
27
|
| `models.credentials` | `list`, `install`, `remove` | `/v1/model-auth…` |
|
|
28
28
|
| `models.config` | `update` | `PUT /v1/model-config` |
|
|
29
|
-
| `memory` | `list`, `retrieve`, `create`, `update`, `delete`, `move`, `search`, `history`, `resolve` | `/v1/memory…`; see [Memory](./memory.md) |
|
|
30
29
|
|
|
31
30
|
Action methods keep the product's literal name (`fork`, `revive`, `promote`, `yield`) rather than being renamed into a generic verb. Every request-capable method takes `RequestOptions` as its final argument after its path, body, or query arguments. `RequestOptions` is `{ headers?, signal?, timeout?, maxRetries? }`; stream event options exclude `timeout` and add `after`.
|
|
32
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.354",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"@earendil-works/pi-ai": "0.87.1",
|
|
132
132
|
"@earendil-works/pi-coding-agent": "0.87.1",
|
|
133
133
|
"@earendil-works/pi-tui": "0.87.1",
|
|
134
|
-
"@north-light/crouter-identity": "^0.3.
|
|
134
|
+
"@north-light/crouter-identity": "^0.3.354",
|
|
135
135
|
"cron-parser": "^5.6.0",
|
|
136
136
|
"esbuild": "^0.27.7",
|
|
137
137
|
"jose": "^6.2.12",
|
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.354",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/crouter",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.354",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "GPL-3.0-only",
|
|
12
12
|
"workspaces": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@earendil-works/pi-ai": "0.87.1",
|
|
19
19
|
"@earendil-works/pi-coding-agent": "0.87.1",
|
|
20
20
|
"@earendil-works/pi-tui": "0.87.1",
|
|
21
|
-
"@north-light/crouter-identity": "^0.3.
|
|
21
|
+
"@north-light/crouter-identity": "^0.3.354",
|
|
22
22
|
"cron-parser": "^5.6.0",
|
|
23
23
|
"esbuild": "^0.27.7",
|
|
24
24
|
"jose": "^6.2.12",
|
|
@@ -10885,17 +10885,17 @@
|
|
|
10885
10885
|
},
|
|
10886
10886
|
"packages/crouter-api": {
|
|
10887
10887
|
"name": "@north-light/crouter-api",
|
|
10888
|
-
"version": "0.3.
|
|
10888
|
+
"version": "0.3.354",
|
|
10889
10889
|
"license": "GPL-3.0-only"
|
|
10890
10890
|
},
|
|
10891
10891
|
"packages/crouter-env-docker": {
|
|
10892
10892
|
"name": "@north-light/crouter-env-docker",
|
|
10893
|
-
"version": "0.3.
|
|
10893
|
+
"version": "0.3.354",
|
|
10894
10894
|
"license": "GPL-3.0-only"
|
|
10895
10895
|
},
|
|
10896
10896
|
"packages/crouter-identity": {
|
|
10897
10897
|
"name": "@north-light/crouter-identity",
|
|
10898
|
-
"version": "0.3.
|
|
10898
|
+
"version": "0.3.354",
|
|
10899
10899
|
"license": "GPL-3.0-only",
|
|
10900
10900
|
"dependencies": {
|
|
10901
10901
|
"jose": "^6.2.1"
|
|
@@ -10903,19 +10903,19 @@
|
|
|
10903
10903
|
},
|
|
10904
10904
|
"packages/crouter-plugin": {
|
|
10905
10905
|
"name": "@north-light/crouter-plugin",
|
|
10906
|
-
"version": "0.3.
|
|
10906
|
+
"version": "0.3.354",
|
|
10907
10907
|
"license": "GPL-3.0-only",
|
|
10908
10908
|
"dependencies": {
|
|
10909
|
-
"@north-light/crouter-api": "^0.3.
|
|
10909
|
+
"@north-light/crouter-api": "^0.3.354"
|
|
10910
10910
|
}
|
|
10911
10911
|
},
|
|
10912
10912
|
"packages/crouter-sdk": {
|
|
10913
10913
|
"name": "@north-light/crouter-sdk",
|
|
10914
|
-
"version": "0.3.
|
|
10914
|
+
"version": "0.3.354",
|
|
10915
10915
|
"license": "GPL-3.0-only",
|
|
10916
10916
|
"dependencies": {
|
|
10917
|
-
"@north-light/crouter-api": "^0.3.
|
|
10918
|
-
"@north-light/crouter-identity": "^0.3.
|
|
10917
|
+
"@north-light/crouter-api": "^0.3.354",
|
|
10918
|
+
"@north-light/crouter-identity": "^0.3.354",
|
|
10919
10919
|
"jose": "^6.2.1"
|
|
10920
10920
|
}
|
|
10921
10921
|
}
|
package/dist/api/dto/memory.d.ts
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
export declare const MEMORY_SCOPES: readonly ["node", "project", "profile", "user", "builtin"];
|
|
2
|
-
export type MemoryScopeName = typeof MEMORY_SCOPES[number];
|
|
3
|
-
/** A canonical document address: slash-joined safe segments, carried as one percent-encoded path segment. */
|
|
4
|
-
export declare function isMemoryDocName(name: string): boolean;
|
|
5
|
-
export interface MemoryOriginConversationDTO {
|
|
6
|
-
session_file: string;
|
|
7
|
-
}
|
|
8
|
-
export interface MemoryScope {
|
|
9
|
-
node?: string;
|
|
10
|
-
cwd?: string;
|
|
11
|
-
profile?: string;
|
|
12
|
-
store?: MemoryScopeName;
|
|
13
|
-
}
|
|
14
|
-
export interface MemoryDocSummaryDTO {
|
|
15
|
-
name: string;
|
|
16
|
-
short_form: string;
|
|
17
|
-
kind: string;
|
|
18
|
-
privacy: 'public' | 'friends' | 'private';
|
|
19
|
-
scope: MemoryScopeName;
|
|
20
|
-
extensions: Record<string, Record<string, string | boolean | number>>;
|
|
21
|
-
path: string;
|
|
22
|
-
store_root: string;
|
|
23
|
-
physical_relative_path: string;
|
|
24
|
-
candidates?: MemoryCandidateDTO[];
|
|
25
|
-
}
|
|
26
|
-
export interface MemoryCandidateDTO {
|
|
27
|
-
winner: boolean;
|
|
28
|
-
scope: MemoryScopeName;
|
|
29
|
-
store_root: string;
|
|
30
|
-
physical_relative_path: string;
|
|
31
|
-
path: string;
|
|
32
|
-
}
|
|
33
|
-
export interface MemoryDocDTO extends MemoryDocSummaryDTO {
|
|
34
|
-
body: string;
|
|
35
|
-
frontmatter: Record<string, unknown> | null;
|
|
36
|
-
representation: 'leaf-file' | 'directory-index';
|
|
37
|
-
links: string[];
|
|
38
|
-
findings?: MemoryLintFindingDTO[];
|
|
39
|
-
}
|
|
40
|
-
export interface MemoryLintFindingDTO {
|
|
41
|
-
severity: string;
|
|
42
|
-
rule: string;
|
|
43
|
-
message: string;
|
|
44
|
-
}
|
|
45
|
-
export interface MemoryListQuery extends MemoryScope {
|
|
46
|
-
kind?: string;
|
|
47
|
-
limit?: number;
|
|
48
|
-
after?: string;
|
|
49
|
-
}
|
|
50
|
-
export interface MemoryDocCreateRequest extends MemoryScope {
|
|
51
|
-
name: string;
|
|
52
|
-
kind: string;
|
|
53
|
-
when_and_why_to_read: string;
|
|
54
|
-
body: string;
|
|
55
|
-
frontmatter?: Record<string, unknown>;
|
|
56
|
-
extensions?: Record<string, Record<string, string | boolean | number>>;
|
|
57
|
-
}
|
|
58
|
-
export interface MemoryDocUpdateRequest extends MemoryScope {
|
|
59
|
-
rationale: string;
|
|
60
|
-
body?: string;
|
|
61
|
-
frontmatter?: Record<string, unknown>;
|
|
62
|
-
extensions?: Record<string, Record<string, string | boolean | number>>;
|
|
63
|
-
unset?: string[];
|
|
64
|
-
}
|
|
65
|
-
export interface MemoryDocDeletedDTO {
|
|
66
|
-
name: string;
|
|
67
|
-
scope: MemoryScopeName;
|
|
68
|
-
path: string;
|
|
69
|
-
log_path: string;
|
|
70
|
-
deleted: true;
|
|
71
|
-
}
|
|
72
|
-
export interface MemoryDocMoveRequest extends MemoryScope {
|
|
73
|
-
to: string;
|
|
74
|
-
}
|
|
75
|
-
export interface MemoryDocMovedDTO {
|
|
76
|
-
name: string;
|
|
77
|
-
previous_name: string;
|
|
78
|
-
scope: MemoryScopeName;
|
|
79
|
-
path: string;
|
|
80
|
-
log_path: string;
|
|
81
|
-
refs_rewritten: Array<{
|
|
82
|
-
name: string;
|
|
83
|
-
scope: MemoryScopeName;
|
|
84
|
-
path: string;
|
|
85
|
-
refs: number;
|
|
86
|
-
}>;
|
|
87
|
-
follow_up: string;
|
|
88
|
-
}
|
|
89
|
-
export interface MemorySearchRequest extends MemoryScope {
|
|
90
|
-
query: string;
|
|
91
|
-
kind?: string;
|
|
92
|
-
grep?: boolean;
|
|
93
|
-
body?: boolean;
|
|
94
|
-
limit?: number;
|
|
95
|
-
after?: string;
|
|
96
|
-
min_score?: number;
|
|
97
|
-
}
|
|
98
|
-
export type MemorySearchHitDTO = MemoryRankedSearchHitDTO | MemoryGrepSearchHitDTO;
|
|
99
|
-
export interface MemoryRankedSearchHitDTO {
|
|
100
|
-
name: string;
|
|
101
|
-
kind: string;
|
|
102
|
-
privacy: 'public' | 'friends' | 'private';
|
|
103
|
-
scope: MemoryScopeName;
|
|
104
|
-
score: number;
|
|
105
|
-
short_form: string;
|
|
106
|
-
path: string;
|
|
107
|
-
store_root: string;
|
|
108
|
-
physical_relative_path: string;
|
|
109
|
-
candidates?: MemoryCandidateDTO[];
|
|
110
|
-
}
|
|
111
|
-
export interface MemoryGrepSearchHitDTO {
|
|
112
|
-
name: string;
|
|
113
|
-
privacy: 'public' | 'friends' | 'private';
|
|
114
|
-
scope: MemoryScopeName;
|
|
115
|
-
line: number;
|
|
116
|
-
text: string;
|
|
117
|
-
path: string;
|
|
118
|
-
store_root: string;
|
|
119
|
-
physical_relative_path: string;
|
|
120
|
-
candidates?: MemoryCandidateDTO[];
|
|
121
|
-
}
|
|
122
|
-
export interface MemoryHistoryQuery extends MemoryScope {
|
|
123
|
-
limit?: number;
|
|
124
|
-
revision?: number;
|
|
125
|
-
diff?: boolean;
|
|
126
|
-
}
|
|
127
|
-
export interface MemoryHistoryRevisionDTO {
|
|
128
|
-
revision: number;
|
|
129
|
-
op: 'create' | 'edit' | 'delete' | 'move';
|
|
130
|
-
at: string;
|
|
131
|
-
node?: string;
|
|
132
|
-
rationale?: string;
|
|
133
|
-
verbatim?: true;
|
|
134
|
-
body_changed: boolean;
|
|
135
|
-
frontmatter_changed: string[];
|
|
136
|
-
diff?: string;
|
|
137
|
-
}
|
|
138
|
-
export interface MemoryHistoryRecordDTO {
|
|
139
|
-
revision: number;
|
|
140
|
-
op: 'create' | 'edit' | 'delete' | 'move';
|
|
141
|
-
at: string;
|
|
142
|
-
node?: string;
|
|
143
|
-
cwd: string;
|
|
144
|
-
from?: string;
|
|
145
|
-
rationale?: string;
|
|
146
|
-
verbatim?: boolean;
|
|
147
|
-
before: string;
|
|
148
|
-
after: string;
|
|
149
|
-
}
|
|
150
|
-
export interface MemoryHistoryDTO {
|
|
151
|
-
name: string;
|
|
152
|
-
scope: MemoryScopeName;
|
|
153
|
-
log_path: string;
|
|
154
|
-
total: number;
|
|
155
|
-
deleted?: unknown;
|
|
156
|
-
revisions?: MemoryHistoryRevisionDTO[];
|
|
157
|
-
record?: MemoryHistoryRecordDTO;
|
|
158
|
-
}
|
|
159
|
-
export interface MemoryDocRefDTO {
|
|
160
|
-
name: string;
|
|
161
|
-
scope: string;
|
|
162
|
-
path: string;
|
|
163
|
-
store_root: string;
|
|
164
|
-
physical_relative_path: string;
|
|
165
|
-
plugin?: string;
|
|
166
|
-
}
|
|
167
|
-
export interface MemoryListDTO<T> {
|
|
168
|
-
object: 'list';
|
|
169
|
-
data: T[];
|
|
170
|
-
has_more: boolean;
|
|
171
|
-
}
|
package/dist/api/dto/memory.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r=Object.defineProperty;var o=(e,t)=>r(e,"name",{value:t,configurable:!0});const i=["node","project","profile","user","builtin"];function c(e){return/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*$/.test(e)}o(c,"isMemoryDocName");export{i as MEMORY_SCOPES,c as isMemoryDocName};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
kind: knowledge
|
|
3
|
-
when-and-why-to-read: When an application's agents need shared durable
|
|
4
|
-
knowledge, read this because a profile store gives runs one owned memory
|
|
5
|
-
location and scopes can allow reading without writing.
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Application memory
|
|
9
|
-
|
|
10
|
-
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.
|
|
11
|
-
|
|
12
|
-
```ts
|
|
13
|
-
import Crouter, { NotFoundError } from '@north-light/crouter-sdk';
|
|
14
|
-
import { resolve } from 'node:path';
|
|
15
|
-
import { z } from 'zod';
|
|
16
|
-
|
|
17
|
-
const client = new Crouter();
|
|
18
|
-
const cwd = resolve(process.argv[2] ?? process.cwd());
|
|
19
|
-
const profileName = process.env.APP_PROFILE ?? 'release-notes-app';
|
|
20
|
-
|
|
21
|
-
const profile = await client.profiles.ensure(profileName, {
|
|
22
|
-
projects: [{ path: cwd, memory: 'content' }],
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
await client.memory.retrieve('release/voice', { profile: profile.id, store: 'profile' });
|
|
27
|
-
} catch (error) {
|
|
28
|
-
if (!(error instanceof NotFoundError)) throw error;
|
|
29
|
-
await client.memory.create({
|
|
30
|
-
name: 'release/voice',
|
|
31
|
-
kind: 'knowledge',
|
|
32
|
-
when_and_why_to_read: 'When writing release notes, read this because it defines the product voice and terms customers recognize.',
|
|
33
|
-
body: 'Use short factual sentences. Name the user-visible result before implementation details.',
|
|
34
|
-
frontmatter: { surfaces: ['{"on":"boot","at":"preview"}'] },
|
|
35
|
-
profile: profile.id,
|
|
36
|
-
store: 'profile',
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const result = await client.nodes.parse({
|
|
41
|
-
cwd,
|
|
42
|
-
model: process.env.GUIDE_MODEL,
|
|
43
|
-
profile: profile.id,
|
|
44
|
-
root: true,
|
|
45
|
-
root_lifecycle: 'terminal',
|
|
46
|
-
deadline: '5m',
|
|
47
|
-
scopes: ['memory:read'],
|
|
48
|
-
prompt: 'Write one short release note announcing that customers can download invoices as CSV from account settings. Do not write or update memory.',
|
|
49
|
-
output_schema: z.object({ release_note: z.string() }),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
if (result.kind === 'result') {
|
|
53
|
-
console.log(result.output_parsed.release_note);
|
|
54
|
-
} else if (result.reason === 'declined') {
|
|
55
|
-
console.error(`agent declined: ${result.declined?.reason ?? 'no reason supplied'}`);
|
|
56
|
-
process.exitCode = 2;
|
|
57
|
-
} else {
|
|
58
|
-
console.error(`agent failed: ${result.reason}`, result.detail);
|
|
59
|
-
process.exitCode = 1;
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
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.
|
|
64
|
-
|
|
65
|
-
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.
|
|
66
|
-
|
|
67
|
-
Observed against the local daemon with `APP_PROFILE=release-notes-app-guide-boot-preview GUIDE_MODEL=openai-codex/gpt-6-sol:high`:
|
|
68
|
-
|
|
69
|
-
```text
|
|
70
|
-
You can now download your invoices as a CSV from account settings.
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
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 [[crouter-concepts/memory]] for the ownership tiers and [[crouter-concepts/profiles-kinds-and-modes]] for what a profile changes.
|