@north-light/crouter 0.3.349 → 0.3.350
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/bin/crtr-launcher +4 -0
- package/bin/runtime-generation-manifest.mjs +12 -2
- package/dist/api/client.d.ts +50 -7
- package/dist/api/client.js +2 -2
- package/dist/api/dto/analytics.d.ts +184 -0
- package/dist/api/dto/analytics.js +0 -0
- package/dist/api/dto/broker-ops.d.ts +43 -1
- package/dist/api/dto/config.d.ts +11 -0
- package/dist/api/dto/grants.d.ts +14 -0
- package/dist/api/dto/grants.js +0 -0
- package/dist/api/dto/human-requests.d.ts +14 -0
- package/dist/api/dto/memory.d.ts +6 -0
- package/dist/api/dto/modelauth.d.ts +35 -0
- package/dist/api/dto/node-records.d.ts +35 -0
- package/dist/api/dto/node-records.js +0 -0
- package/dist/api/dto/nodes.d.ts +5 -0
- package/dist/api/dto/profiles.d.ts +38 -3
- package/dist/api/dto/worktree.d.ts +11 -0
- package/dist/api/errors.d.ts +23 -1
- package/dist/api/errors.js +1 -1
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +1 -1
- package/dist/api/node-transport.js +1 -1
- package/dist/api/routes.d.ts +22 -0
- package/dist/api/routes.js +1 -1
- package/dist/build-root.d.ts +6 -1
- package/dist/build-root.js +1 -1
- package/dist/builtin-memory/crouter-sdk/client.md +34 -0
- package/dist/builtin-memory/crouter-sdk/errors.md +2 -0
- package/dist/builtin-memory/crouter-sdk/memory.md +2 -2
- package/dist/builtin-memory/crouter-sdk/streaming.md +21 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/claude-plugin-commands.ts +8 -4
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +39 -118
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.d.ts +6 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.js +41 -27
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +52 -29
- package/dist/cli.js +9 -8
- package/dist/clients/attach/chrome/inbox-strip.js +1 -1
- package/dist/clients/attach/chrome/roster.js +1 -1
- package/dist/clients/attach/config.js +1 -1
- package/dist/clients/attach/overlays/auth.js +2 -2
- package/dist/clients/attach/overlays/graph.js +1 -1
- package/dist/clients/attach/render/tool-calls.js +3 -3
- package/dist/clients/attach/session/connection.js +1 -1
- package/dist/clients/attach/session/profile-files.js +1 -1
- package/dist/clients/attach/viewer.js +1569 -816
- package/dist/commands/api-client.js +3 -3
- package/dist/commands/broker-permissions.d.ts +2 -0
- package/dist/commands/broker-permissions.js +1 -0
- package/dist/commands/canvas-analytics/chart.d.ts +52 -0
- package/dist/commands/canvas-analytics/chart.js +1 -0
- package/dist/commands/canvas-analytics/drilldown.d.ts +34 -0
- package/dist/commands/canvas-analytics/drilldown.js +1 -0
- package/dist/commands/canvas-analytics/format.d.ts +29 -0
- package/dist/commands/canvas-analytics/format.js +1 -0
- package/dist/commands/canvas-analytics/graph-detail.d.ts +2 -0
- package/dist/commands/canvas-analytics/graph-detail.js +2 -0
- package/dist/commands/canvas-analytics/graphs.d.ts +9 -0
- package/dist/commands/canvas-analytics/graphs.js +1 -0
- package/dist/commands/canvas-analytics/memory.d.ts +2 -0
- package/dist/commands/canvas-analytics/memory.js +1 -0
- package/dist/commands/canvas-analytics/overview.d.ts +2 -0
- package/dist/commands/canvas-analytics/overview.js +1 -0
- package/dist/commands/canvas-analytics/shell.d.ts +60 -0
- package/dist/commands/canvas-analytics/shell.js +2 -0
- package/dist/commands/canvas-analytics/time.d.ts +2 -0
- package/dist/commands/canvas-analytics/time.js +1 -0
- package/dist/commands/canvas-analytics/usage.d.ts +2 -0
- package/dist/commands/canvas-analytics/usage.js +1 -0
- package/dist/commands/canvas-analytics/view.d.ts +85 -0
- package/dist/commands/canvas-analytics/view.js +1 -0
- package/dist/commands/canvas-analytics.d.ts +2 -0
- package/dist/commands/canvas-analytics.js +1 -0
- package/dist/commands/canvas-prune.js +1 -1
- package/dist/commands/canvas.js +1 -1
- package/dist/commands/cron.js +5 -5
- package/dist/commands/human/components.d.ts +2 -0
- package/dist/commands/human/components.js +2 -2
- package/dist/commands/human/prompts.js +1 -1
- package/dist/commands/human/queue.js +1 -1
- package/dist/commands/memory/client.d.ts +11 -0
- package/dist/commands/memory/client.js +1 -0
- package/dist/commands/memory/delete.js +1 -1
- package/dist/commands/memory/edit.js +3 -3
- package/dist/commands/memory/find.js +1 -1
- package/dist/commands/memory/history.js +4 -4
- package/dist/commands/memory/lint.js +1 -1
- package/dist/commands/memory/list.d.ts +0 -2
- package/dist/commands/memory/list.js +1 -1
- package/dist/commands/memory/move.js +1 -1
- package/dist/commands/memory/origin.js +1 -1
- package/dist/commands/memory/read.d.ts +0 -5
- package/dist/commands/memory/read.js +3 -3
- package/dist/commands/memory/shared.d.ts +0 -178
- package/dist/commands/memory/shared.js +1 -12
- package/dist/commands/memory/write.js +5 -5
- package/dist/commands/node/bash.js +5 -5
- package/dist/commands/node/create.d.ts +0 -17
- package/dist/commands/node/create.js +2 -3
- package/dist/commands/node/inspect.js +6 -6
- package/dist/commands/node/lifecycle.js +2 -2
- package/dist/commands/node-context.js +2 -2
- package/dist/commands/node-inspect-artifacts.js +6 -6
- package/dist/commands/pkg/browse/catalog.js +1 -1
- package/dist/commands/pkg/browse/model.d.ts +1 -1
- package/dist/commands/pkg/market-manage.js +1 -1
- package/dist/commands/pkg/plugin-manage.js +10 -10
- package/dist/commands/profile/daemon-profiles.d.ts +13 -0
- package/dist/commands/profile/daemon-profiles.js +4 -0
- package/dist/commands/profile/delete.js +1 -1
- package/dist/commands/profile/env.d.ts +6 -0
- package/dist/commands/profile/env.js +2 -2
- package/dist/commands/profile/kind.js +1 -2
- package/dist/commands/profile/list.js +1 -1
- package/dist/commands/profile/meta.js +1 -1
- package/dist/commands/profile/new.js +1 -1
- package/dist/commands/profile/pause.js +1 -1
- package/dist/commands/profile/project.js +1 -1
- package/dist/commands/profile/rename.js +1 -1
- package/dist/commands/profile/show.js +1 -1
- package/dist/commands/profile.js +1 -1
- package/dist/commands/push.js +3 -3
- package/dist/commands/surface-inspect.js +1 -1
- package/dist/commands/sys/branch.js +1 -1
- package/dist/commands/sys/config.js +1 -1
- package/dist/commands/sys/connect.js +3 -3
- package/dist/commands/sys/context/admin/actions.js +1 -1
- package/dist/commands/sys/context/admin/model.d.ts +1 -0
- package/dist/commands/sys/context/admin/model.js +1 -1
- package/dist/commands/sys/context/admin.js +1 -1
- package/dist/commands/sys/context/expose.js +2 -1
- package/dist/commands/sys/context/prompt-review.js +2 -2
- package/dist/commands/sys/context/resolve.js +7 -7
- package/dist/commands/sys/context/sysprompt.js +1 -1
- package/dist/commands/sys/join.d.ts +1 -0
- package/dist/commands/sys/join.js +1 -0
- package/dist/commands/sys/migrate.js +1 -1
- package/dist/commands/sys/panels/models-panel.js +1 -1
- package/dist/commands/sys/panels/profiles-panel.d.ts +0 -1
- package/dist/commands/sys/panels/profiles-panel.js +1 -1
- package/dist/commands/sys/provider-login.js +6 -6
- package/dist/commands/sys/setup-core.d.ts +1 -1
- package/dist/commands/sys/setup-core.js +6 -6
- package/dist/commands/sys/setup-settings-runner.js +1 -1
- package/dist/commands/sys/setup.js +1 -1
- package/dist/commands/sys/spaces.d.ts +1 -0
- package/dist/commands/sys/spaces.js +2 -0
- package/dist/commands/sys/sync-deps.js +2 -2
- package/dist/commands/sys/sync-project-guidance.js +4 -4
- package/dist/commands/sys/sync-skills.js +2 -2
- package/dist/commands/sys/worktrees.d.ts +1 -0
- package/dist/commands/sys/worktrees.js +1 -1
- package/dist/commands/sys.js +1 -1
- package/dist/core/auth-file.js +2 -2
- package/dist/core/bash-job-supervisor.d.ts +6 -0
- package/dist/core/bash-job-supervisor.js +4 -0
- package/dist/core/bash-jobs.d.ts +13 -6
- package/dist/core/bash-jobs.js +8 -7
- package/dist/core/broker-client/transport-relay.d.ts +6 -3
- package/dist/core/broker-client/transport-relay.js +1 -1
- package/dist/core/broker-client/transport-socket.d.ts +6 -1
- package/dist/core/broker-client/transport-socket.js +1 -1
- package/dist/core/canvas/canvas.d.ts +39 -18
- package/dist/core/canvas/canvas.js +21 -20
- package/dist/core/canvas/context-strip.d.ts +20 -0
- package/dist/core/canvas/context-strip.js +5 -0
- package/dist/core/canvas/crons.d.ts +12 -20
- package/dist/core/canvas/crons.js +15 -13
- package/dist/core/canvas/db.js +2 -2
- package/dist/core/canvas/deliveries.d.ts +4 -1
- package/dist/core/canvas/deliveries.js +1 -1
- package/dist/core/canvas/executions.js +1 -1
- package/dist/core/canvas/history.d.ts +2 -1
- package/dist/core/canvas/history.js +17 -18
- package/dist/core/canvas/memory-reads.d.ts +19 -0
- package/dist/core/canvas/memory-reads.js +1 -0
- package/dist/core/canvas/migrations.d.ts +0 -4
- package/dist/core/canvas/migrations.js +99 -32
- package/dist/core/canvas/nav-render.js +1 -1
- package/dist/core/canvas/node-agent-paths.d.ts +8 -0
- package/dist/core/canvas/node-agent-paths.js +1 -0
- package/dist/core/canvas/node-recap.d.ts +2 -2
- package/dist/core/canvas/node-recap.js +2 -2
- package/dist/core/canvas/node-tokens.d.ts +24 -0
- package/dist/core/canvas/node-tokens.js +5 -0
- package/dist/core/canvas/paths.d.ts +16 -19
- package/dist/core/canvas/paths.js +1 -1
- package/dist/core/canvas/render-source.d.ts +2 -2
- package/dist/core/canvas/render-source.js +6 -9
- package/dist/core/canvas/sessions.d.ts +18 -0
- package/dist/core/canvas/sessions.js +4 -1
- package/dist/core/canvas/types.d.ts +22 -6
- package/dist/core/command-hooks/compose.js +1 -1
- package/dist/core/command-hooks/discovery.d.ts +15 -1
- package/dist/core/command-hooks/discovery.js +1 -1
- package/dist/core/command-hooks/help.d.ts +2 -2
- package/dist/core/command-hooks/lifecycle-create.d.ts +1 -1
- package/dist/core/command-hooks/lifecycle-create.js +1 -1
- package/dist/core/command-hooks/transport/exec-invoke.d.ts +2 -0
- package/dist/core/command-hooks/transport/exec-invoke.js +1 -1
- package/dist/core/command-hooks/transport/exec-lifecycle.d.ts +1 -0
- package/dist/core/command-hooks/transport/exec-lifecycle.js +1 -1
- package/dist/core/command-hooks/transport/plan.d.ts +3 -0
- package/dist/core/command-hooks/transport/plan.js +1 -0
- package/dist/core/command-plugins/discovery.js +1 -1
- package/dist/core/command.d.ts +6 -2
- package/dist/core/command.js +6 -6
- package/dist/core/config.d.ts +8 -5
- package/dist/core/config.js +1 -1
- package/dist/core/conversation-store/client-worker.d.ts +1 -0
- package/dist/core/conversation-store/client-worker.js +1 -0
- package/dist/core/conversation-store/client.d.ts +2 -0
- package/dist/core/conversation-store/client.js +2 -0
- package/dist/core/conversation-store/file-store.d.ts +37 -0
- package/dist/core/conversation-store/file-store.js +9 -0
- package/dist/core/conversation-store/index.d.ts +50 -0
- package/dist/core/conversation-store/index.js +1 -0
- package/dist/core/conversation-store/listener.d.ts +4 -0
- package/dist/core/conversation-store/listener.js +3 -0
- package/dist/core/conversation-store/patch.d.ts +1 -0
- package/dist/core/conversation-store/patch.js +1 -0
- package/dist/core/directory/join.d.ts +27 -0
- package/dist/core/directory/join.js +1 -0
- package/dist/core/disk-usage.d.ts +4 -0
- package/dist/core/disk-usage.js +1 -0
- package/dist/core/events/emit.d.ts +2 -0
- package/dist/core/events/emit.js +3 -1
- package/dist/core/feed/feed.js +4 -4
- package/dist/core/feed/messages.d.ts +3 -0
- package/dist/core/feed/messages.js +6 -6
- package/dist/core/fs-utils.d.ts +2 -0
- package/dist/core/fs-utils.js +3 -3
- package/dist/core/grants/local.d.ts +4 -0
- package/dist/core/grants/local.js +1 -0
- package/dist/core/grants/mirror.d.ts +44 -0
- package/dist/core/grants/mirror.js +4 -0
- package/dist/core/grants/on-sync.d.ts +22 -0
- package/dist/core/grants/on-sync.js +1 -0
- package/dist/core/grants/remove.d.ts +7 -0
- package/dist/core/grants/remove.js +1 -0
- package/dist/core/grants/sandboxes.d.ts +7 -0
- package/dist/core/grants/sandboxes.js +1 -0
- package/dist/core/grants/sync.d.ts +12 -0
- package/dist/core/grants/sync.js +1 -0
- package/dist/core/help/memory-extensions.d.ts +3 -0
- package/dist/core/help/memory-extensions.js +2 -0
- package/dist/core/help.d.ts +14 -0
- package/dist/core/help.js +7 -7
- package/dist/core/host-exports/builtins.js +3 -3
- package/dist/core/host-exports/export.js +3 -3
- package/dist/core/human/action-binding.d.ts +2 -0
- package/dist/core/human/action-binding.js +1 -1
- package/dist/core/human/feedback-companion.d.ts +0 -1
- package/dist/core/human/feedback-companion.js +1 -1
- package/dist/core/human/page-schema.d.ts +1 -1
- package/dist/core/inspector/core.d.ts +2 -0
- package/dist/core/inspector/core.js +1 -1
- package/dist/core/inspector/tui.js +2 -2
- package/dist/core/installed-plugins.js +1 -1
- package/dist/core/io.js +6 -6
- package/dist/core/keybindings/catalog.d.ts +1 -1
- package/dist/core/keybindings/catalog.js +1 -1
- package/dist/core/layout-migrate/index.d.ts +15 -0
- package/dist/core/layout-migrate/index.js +4 -0
- package/dist/core/layout-migrate/paths.d.ts +26 -0
- package/dist/core/layout-migrate/paths.js +1 -0
- package/dist/core/layout-migrate/stored-paths.d.ts +2 -0
- package/dist/core/layout-migrate/stored-paths.js +11 -0
- package/dist/core/layout-migrate/stores.d.ts +17 -0
- package/dist/core/layout-migrate/stores.js +4 -0
- package/dist/core/layout.d.ts +26 -0
- package/dist/core/layout.js +2 -0
- package/dist/core/llm/run.d.ts +60 -0
- package/dist/core/llm/run.js +4 -0
- package/dist/core/memory/cli-selector.d.ts +13 -0
- package/dist/core/memory/cli-selector.js +1 -0
- package/dist/core/memory/history.d.ts +5 -4
- package/dist/core/memory/history.js +6 -6
- package/dist/core/memory/inline-ref-inventory.d.ts +2 -1
- package/dist/core/memory/inline-ref-inventory.js +1 -1
- package/dist/core/memory/lint.js +2 -2
- package/dist/core/memory/mutation-domain.d.ts +2 -2
- package/dist/core/memory/mutation-domain.js +8 -7
- package/dist/core/memory/mutations.js +1 -1
- package/dist/core/memory/service.d.ts +5 -0
- package/dist/core/memory/service.js +2 -2
- package/dist/core/memory-resolver.d.ts +11 -7
- package/dist/core/memory-resolver.js +2 -2
- package/dist/core/model-auth/daemon-login.d.ts +13 -0
- package/dist/core/model-auth/daemon-login.js +1 -0
- package/dist/core/model-auth/flows.d.ts +45 -0
- package/dist/core/model-auth/flows.js +1 -0
- package/dist/core/model-auth/handoff-jti.d.ts +4 -0
- package/dist/core/model-auth/handoff-jti.js +1 -0
- package/dist/core/model-routes.js +1 -1
- package/dist/core/nested-stores.d.ts +2 -1
- package/dist/core/nested-stores.js +1 -2
- package/dist/core/preview-registry.js +2 -2
- package/dist/core/profiles/env-store.js +2 -2
- package/dist/core/profiles/manifest.d.ts +16 -5
- package/dist/core/profiles/manifest.js +1 -1
- package/dist/core/provider-management.js +1 -1
- package/dist/core/review/birth.js +1 -1
- package/dist/core/review/companion.d.ts +0 -2
- package/dist/core/review/companion.js +1 -1
- package/dist/core/review/fork.js +2 -2
- package/dist/core/review/realize.js +1 -1
- package/dist/core/review/stage.d.ts +1 -1
- package/dist/core/review/stage.js +1 -1
- package/dist/core/review/types.d.ts +1 -1
- package/dist/core/runs/events.d.ts +34 -0
- package/dist/core/runs/events.js +1 -0
- package/dist/core/runs/operations.d.ts +43 -0
- package/dist/core/runs/operations.js +12 -0
- package/dist/core/runtime/bearings-render.d.ts +2 -2
- package/dist/core/runtime/bearings-render.js +11 -11
- package/dist/core/runtime/bearings.js +2 -2
- package/dist/core/runtime/broker/cli-relay.d.ts +5 -0
- package/dist/core/runtime/broker/cli-relay.js +1 -0
- package/dist/core/runtime/broker/client-registry.d.ts +0 -5
- package/dist/core/runtime/broker/client-registry.js +1 -1
- package/dist/core/runtime/broker/daemon-ops.d.ts +28 -1
- package/dist/core/runtime/broker/daemon-ops.js +1 -1
- package/dist/core/runtime/broker/engine-drive.d.ts +0 -2
- package/dist/core/runtime/broker/engine-drive.js +1 -1
- package/dist/core/runtime/broker/fault-retry.d.ts +9 -0
- package/dist/core/runtime/broker/fault-retry.js +1 -1
- package/dist/core/runtime/broker/frame-dispatch.d.ts +5 -9
- package/dist/core/runtime/broker/frame-dispatch.js +1 -1
- package/dist/core/runtime/broker/frame-engine-control.d.ts +3 -2
- package/dist/core/runtime/broker/frame-engine-control.js +1 -1
- package/dist/core/runtime/broker/frame-memory-refs.d.ts +4 -3
- package/dist/core/runtime/broker/frame-memory-refs.js +1 -1
- package/dist/core/runtime/broker/frame-read.js +1 -1
- package/dist/core/runtime/broker/frame-session.js +1 -1
- package/dist/core/runtime/broker/held-deferred-inbox.d.ts +3 -1
- package/dist/core/runtime/broker/held-deferred-inbox.js +1 -1
- package/dist/core/runtime/broker/inbox.d.ts +1 -2
- package/dist/core/runtime/broker/inbox.js +7 -10
- package/dist/core/runtime/broker/model-adapter.d.ts +9 -0
- package/dist/core/runtime/broker/model-adapter.js +2 -0
- package/dist/core/runtime/broker/node-token.d.ts +3 -0
- package/dist/core/runtime/broker/node-token.js +1 -0
- package/dist/core/runtime/broker/read-ops.js +1 -1
- package/dist/core/runtime/broker/rebind.d.ts +2 -0
- package/dist/core/runtime/broker/rebind.js +1 -1
- package/dist/core/runtime/broker/tool-groups.js +1 -1
- package/dist/core/runtime/broker/turn-ignition.d.ts +3 -3
- package/dist/core/runtime/broker/turn-ignition.js +1 -1
- package/dist/core/runtime/broker-cli.js +3 -3
- package/dist/core/runtime/broker-extension-render.d.ts +2 -5
- package/dist/core/runtime/broker-extension-render.js +4 -4
- package/dist/core/runtime/broker-persona-guidance.js +3 -3
- package/dist/core/runtime/broker-protocol.d.ts +7 -8
- package/dist/core/runtime/broker.js +1 -1
- package/dist/core/runtime/canvas-extensions.d.ts +1 -0
- package/dist/core/runtime/canvas-extensions.js +1 -1
- package/dist/core/runtime/close.d.ts +9 -0
- package/dist/core/runtime/close.js +1 -1
- package/dist/core/runtime/deliver-live.js +1 -1
- package/dist/core/runtime/fleet.d.ts +1 -1
- package/dist/core/runtime/front-door-login.js +1 -1
- package/dist/core/runtime/front-door.js +2 -2
- package/dist/core/runtime/headless-pi.d.ts +1 -1
- package/dist/core/runtime/headless-pi.js +1 -1
- package/dist/core/runtime/host.d.ts +1 -1
- package/dist/core/runtime/host.js +3 -1
- package/dist/core/runtime/invocation.d.ts +3 -0
- package/dist/core/runtime/kickoff.d.ts +1 -0
- package/dist/core/runtime/kickoff.js +16 -16
- package/dist/core/runtime/launch-target.d.ts +1 -1
- package/dist/core/runtime/launch-target.js +1 -1
- package/dist/core/runtime/launch.d.ts +10 -35
- package/dist/core/runtime/launch.js +1 -1
- package/dist/core/runtime/lifecycle.js +2 -2
- package/dist/core/runtime/memory.d.ts +1 -1
- package/dist/core/runtime/memory.js +1 -1
- package/dist/core/runtime/model-registry.js +1 -1
- package/dist/core/runtime/model-swap.d.ts +17 -19
- package/dist/core/runtime/model-swap.js +1 -1
- package/dist/core/runtime/node-read.js +3 -2
- package/dist/core/runtime/nodes.d.ts +7 -0
- package/dist/core/runtime/nodes.js +1 -1
- package/dist/core/runtime/outcome-document.js +1 -1
- package/dist/core/runtime/package-health.js +2 -2
- package/dist/core/runtime/persona.js +2 -2
- package/dist/core/runtime/pi-vendored.js +1 -1
- package/dist/core/runtime/placement-tmux.d.ts +1 -1
- package/dist/core/runtime/placement-tmux.js +1 -1
- package/dist/core/runtime/placement.js +1 -1
- package/dist/core/runtime/promote.js +1 -1
- package/dist/core/runtime/provider-credential-gate.js +2 -2
- package/dist/core/runtime/recovery-hold.d.ts +2 -0
- package/dist/core/runtime/recovery-hold.js +1 -0
- package/dist/core/runtime/recycle.js +1 -1
- package/dist/core/runtime/reopen.js +1 -1
- package/dist/core/runtime/reset.js +1 -1
- package/dist/core/runtime/revive.d.ts +1 -1
- package/dist/core/runtime/revive.js +2 -3
- package/dist/core/runtime/roadmap.js +4 -4
- package/dist/core/runtime/run-command.d.ts +6 -0
- package/dist/core/runtime/run-command.js +1 -1
- package/dist/core/runtime/session-branch.d.ts +2 -8
- package/dist/core/runtime/session-branch.js +1 -1
- package/dist/core/runtime/session-list-cache.d.ts +6 -22
- package/dist/core/runtime/session-list-cache.js +1 -1
- package/dist/core/runtime/situational-context.js +2 -2
- package/dist/core/runtime/spawn-env.d.ts +6 -6
- package/dist/core/runtime/spawn-env.js +1 -1
- package/dist/core/runtime/spawn.d.ts +5 -0
- package/dist/core/runtime/spawn.js +2 -2
- package/dist/core/runtime/stop-guard.js +2 -2
- package/dist/core/runtime/stop-signals.d.ts +2 -2
- package/dist/core/runtime/stop-signals.js +1 -1
- package/dist/core/runtime/structured-output.d.ts +10 -4
- package/dist/core/runtime/structured-output.js +4 -4
- package/dist/core/runtime/tmux-bindings.js +3 -3
- package/dist/core/runtime/tmux-driver.d.ts +4 -0
- package/dist/core/runtime/tmux-driver.js +7 -7
- package/dist/core/runtime/view-socket.d.ts +9 -2
- package/dist/core/runtime/view-socket.js +1 -1
- package/dist/core/runtime/warm-pool.js +1 -1
- package/dist/core/scope.d.ts +3 -2
- package/dist/core/scope.js +1 -1
- package/dist/core/scoped-state/db.js +1 -1
- package/dist/core/scoped-state/migrate.js +3 -3
- package/dist/core/scoped-state/profiles.d.ts +2 -1
- package/dist/core/scoped-state/profiles.js +1 -1
- package/dist/core/scoped-state/schema.d.ts +2 -1
- package/dist/core/scoped-state/schema.js +4 -4
- package/dist/core/scopes.d.ts +2 -2
- package/dist/core/scopes.js +1 -1
- package/dist/core/secrets.d.ts +1 -0
- package/dist/core/secrets.js +2 -2
- package/dist/core/spaces/mounts.d.ts +32 -0
- package/dist/core/spaces/mounts.js +1 -0
- package/dist/core/spaces/open-beneath.d.ts +71 -0
- package/dist/core/spaces/open-beneath.js +1 -0
- package/dist/core/spaces/permissions.d.ts +46 -0
- package/dist/core/spaces/permissions.js +1 -0
- package/dist/core/spaces/process.d.ts +27 -0
- package/dist/core/spaces/process.js +1 -0
- package/dist/core/spaces/space.d.ts +8 -0
- package/dist/core/spaces/space.js +2 -0
- package/dist/core/spaces/stop.d.ts +8 -0
- package/dist/core/spaces/stop.js +2 -0
- package/dist/core/spaces/users.d.ts +19 -0
- package/dist/core/spaces/users.js +1 -0
- package/dist/core/subscription-state.d.ts +2 -0
- package/dist/core/subscription-state.js +3 -3
- package/dist/core/substrate/frontmatter-validation.js +1 -1
- package/dist/core/substrate/injected-store.d.ts +28 -3
- package/dist/core/substrate/injected-store.js +2 -1
- package/dist/core/substrate/listings.js +1 -1
- package/dist/core/substrate/memory-events.d.ts +6 -0
- package/dist/core/substrate/memory-events.js +1 -0
- package/dist/core/substrate/on-read-node.js +1 -1
- package/dist/core/substrate/on-read.d.ts +6 -6
- package/dist/core/substrate/on-read.js +5 -5
- package/dist/core/substrate/plan.js +1 -1
- package/dist/core/substrate/render-node.js +1 -1
- package/dist/core/substrate/render.d.ts +4 -3
- package/dist/core/substrate/render.js +38 -38
- package/dist/core/substrate/schema.d.ts +6 -0
- package/dist/core/substrate/schema.js +1 -1
- package/dist/core/tui/panel.js +1 -1
- package/dist/core/user-settings.d.ts +12 -0
- package/dist/core/user-settings.js +1 -1
- package/dist/core/worktree-mutation-async.js +5 -5
- package/dist/core/worktree-quarantine.js +1 -1
- package/dist/core/worktree-remove.d.ts +15 -0
- package/dist/core/worktree-remove.js +1 -0
- package/dist/core/worktree-sweep.js +6 -6
- package/dist/daemon/analytics/compute.d.ts +37 -0
- package/dist/daemon/analytics/compute.js +1 -0
- package/dist/daemon/analytics/scan-worker.d.ts +1 -0
- package/dist/daemon/analytics/scan-worker.js +2 -0
- package/dist/daemon/analytics/scan.d.ts +37 -0
- package/dist/daemon/analytics/scan.js +1 -0
- package/dist/daemon/api/app-listener.d.ts +11 -0
- package/dist/daemon/api/app-listener.js +21 -0
- package/dist/daemon/api/bridge.js +5 -5
- package/dist/daemon/api/handlers/analytics.d.ts +2 -0
- package/dist/daemon/api/handlers/analytics.js +1 -0
- package/dist/daemon/api/handlers/attach.js +1 -1
- package/dist/daemon/api/handlers/bash-jobs.js +2 -2
- package/dist/daemon/api/handlers/bash.js +1 -1
- package/dist/daemon/api/handlers/broker-ops.js +1 -1
- package/dist/daemon/api/handlers/canvas.d.ts +1 -1
- package/dist/daemon/api/handlers/canvas.js +6 -6
- package/dist/daemon/api/handlers/crons.js +1 -1
- package/dist/daemon/api/handlers/files.d.ts +1 -1
- package/dist/daemon/api/handlers/files.js +1 -1
- package/dist/daemon/api/handlers/health.js +2 -2
- package/dist/daemon/api/handlers/hook-exec.d.ts +2 -0
- package/dist/daemon/api/handlers/hook-exec.js +1 -0
- package/dist/daemon/api/handlers/human-requests.js +1 -1
- package/dist/daemon/api/handlers/inbox.js +1 -1
- package/dist/daemon/api/handlers/llm.d.ts +2 -0
- package/dist/daemon/api/handlers/llm.js +3 -0
- package/dist/daemon/api/handlers/memory-reads.d.ts +4 -0
- package/dist/daemon/api/handlers/memory-reads.js +1 -0
- package/dist/daemon/api/handlers/memory.js +5 -1
- package/dist/daemon/api/handlers/messages.js +2 -2
- package/dist/daemon/api/handlers/modelauth.js +1 -1
- package/dist/daemon/api/handlers/node-outcomes.js +1 -1
- package/dist/daemon/api/handlers/node-records.d.ts +2 -0
- package/dist/daemon/api/handlers/node-records.js +3 -0
- package/dist/daemon/api/handlers/nodes.d.ts +1 -1
- package/dist/daemon/api/handlers/nodes.js +1 -1
- package/dist/daemon/api/handlers/profiles.d.ts +4 -1
- package/dist/daemon/api/handlers/profiles.js +1 -1
- package/dist/daemon/api/handlers/reports.js +5 -3
- package/dist/daemon/api/handlers/reviews.d.ts +1 -1
- package/dist/daemon/api/handlers/reviews.js +1 -1
- package/dist/daemon/api/handlers/run-routes.d.ts +2 -0
- package/dist/daemon/api/handlers/run-routes.js +1 -0
- package/dist/daemon/api/handlers/runs.d.ts +9 -0
- package/dist/daemon/api/handlers/runs.js +1 -0
- package/dist/daemon/api/handlers/subscriptions.js +1 -1
- package/dist/daemon/api/handlers/worktree.js +1 -1
- package/dist/daemon/api/map.d.ts +10 -4
- package/dist/daemon/api/map.js +2 -2
- package/dist/daemon/api/operations.d.ts +18 -0
- package/dist/daemon/api/operations.js +1 -0
- package/dist/daemon/api/principal.d.ts +42 -0
- package/dist/daemon/api/principal.js +1 -0
- package/dist/daemon/api/router.d.ts +27 -3
- package/dist/daemon/api/router.js +1 -1
- package/dist/daemon/api/server.d.ts +4 -0
- package/dist/daemon/api/server.js +1 -1
- package/dist/daemon/api/vendor-signin.d.ts +7 -0
- package/dist/daemon/api/vendor-signin.js +77 -0
- package/dist/daemon/api/viewer-presence.d.ts +3 -0
- package/dist/daemon/api/viewer-presence.js +1 -0
- package/dist/daemon/cron/armed-context.d.ts +4 -0
- package/dist/daemon/cron/armed-context.js +1 -1
- package/dist/daemon/cron/escalation.js +3 -3
- package/dist/daemon/cron/lease-recovery.js +1 -1
- package/dist/daemon/cron/sinks.js +2 -2
- package/dist/daemon/cron-run.d.ts +5 -5
- package/dist/daemon/cron-run.js +1 -1
- package/dist/daemon/crtrd.js +8 -7
- package/dist/daemon/delivery/run-delivery.d.ts +4 -0
- package/dist/daemon/delivery/run-delivery.js +1 -1
- package/dist/daemon/fleet.d.ts +1 -1
- package/dist/daemon/fleet.js +6 -6
- package/dist/daemon/human/finish.js +7 -7
- package/dist/daemon/joined-owner.d.ts +5 -0
- package/dist/daemon/joined-owner.js +1 -0
- package/dist/daemon/manage.js +2 -2
- package/dist/daemon/messaging/node-message.js +1 -1
- package/dist/daemon/park-activity.js +1 -1
- package/dist/daemon/reconcilers/bash-deadline.js +1 -1
- package/dist/daemon/reconcilers/broker-supervision.d.ts +1 -1
- package/dist/daemon/reconcilers/broker-supervision.js +4 -4
- package/dist/daemon/reconcilers/delivery-lane.js +1 -1
- package/dist/daemon/reconcilers/live-obligation.d.ts +7 -0
- package/dist/daemon/reconcilers/live-obligation.js +1 -1
- package/dist/daemon/reconcilers/node-lifecycle/tick.js +1 -1
- package/dist/daemon/reconcilers/storage-maintenance.d.ts +20 -1
- package/dist/daemon/reconcilers/storage-maintenance.js +1 -1
- package/dist/daemon/runs/append-section.d.ts +6 -0
- package/dist/daemon/runs/append-section.js +2 -0
- package/dist/daemon/runs/observer.d.ts +5 -0
- package/dist/daemon/runs/observer.js +4 -0
- package/dist/launcher/bwrap.d.ts +4 -0
- package/dist/launcher/bwrap.js +2 -0
- package/dist/launcher/client.d.ts +2 -0
- package/dist/launcher/client.js +3 -0
- package/dist/launcher/main.d.ts +1 -0
- package/dist/launcher/main.js +3 -0
- package/dist/launcher/netrule.d.ts +1 -0
- package/dist/launcher/netrule.js +1 -0
- package/dist/launcher/seccomp.d.ts +1 -0
- package/dist/launcher/seccomp.js +1 -0
- package/dist/launcher/spec.d.ts +88 -0
- package/dist/launcher/spec.js +1 -0
- package/dist/launcher/users.d.ts +18 -0
- package/dist/launcher/users.js +7 -0
- package/dist/launcher/validate.d.ts +22 -0
- package/dist/launcher/validate.js +1 -0
- package/dist/migrations/corpus.js +3 -3
- package/dist/migrations/runner.js +1 -1
- package/dist/native/linux/addon.node +0 -0
- package/dist/native/linux.d.ts +29 -0
- package/dist/native/linux.js +1 -0
- package/dist/pi-extensions/broker-local.js +2 -2
- package/dist/pi-extensions/canvas-bash-valve.d.ts +1 -3
- package/dist/pi-extensions/canvas-bash-valve.js +4 -7
- package/dist/pi-extensions/canvas-context-intro.d.ts +1 -2
- package/dist/pi-extensions/canvas-context-intro.js +2 -2
- package/dist/pi-extensions/canvas-doc-substrate.js +6 -6
- package/dist/pi-extensions/canvas-inbox-watcher.d.ts +2 -1
- package/dist/pi-extensions/canvas-inbox-watcher.js +2 -1
- package/dist/pi-extensions/canvas-passive-context.d.ts +1 -1
- package/dist/pi-extensions/canvas-passive-context.js +11 -11
- package/dist/pi-extensions/canvas-recap.js +6 -6
- package/dist/pi-extensions/canvas-stophook.js +1 -1
- package/dist/pi-extensions/canvas-structured-output.js +4 -4
- package/dist/pi-extensions/canvas-tool-guide.js +1 -1
- package/dist/pi-extensions/system-prompt-entry.d.ts +15 -0
- package/dist/pi-extensions/system-prompt-entry.js +1 -0
- package/dist/shared/env.d.ts +5 -1
- package/dist/shared/env.js +1 -1
- package/dist/shared/strip-cd-prefix.d.ts +1 -0
- package/dist/shared/strip-cd-prefix.js +1 -0
- package/dist/types.d.ts +31 -15
- package/docs/cli/memory-and-preferences.md +3 -1
- package/docs/sdk/client.md +34 -0
- package/docs/sdk/errors.md +2 -0
- package/docs/sdk/memory.md +2 -2
- package/docs/sdk/streaming.md +21 -0
- package/package.json +18 -4
- package/packages/crouter-identity/dist/index.d.ts +54 -0
- package/packages/crouter-identity/dist/index.js +166 -0
- package/packages/crouter-identity/package.json +33 -0
- package/runtime.lock.json +34 -8
- package/scripts/build-native-linux.mjs +16 -0
- package/scripts/install-runtime.mjs +9 -7
- package/scripts/lib/isolation-env.mjs +42 -0
- package/scripts/runtime-smoke.mjs +49 -0
- package/src/native/linux/addon.c +249 -0
- package/dist/core/profiles/state-block.d.ts +0 -4
- package/dist/core/profiles/state-block.js +0 -3
- package/dist/core/runtime/broker/auth-reload.d.ts +0 -41
- package/dist/core/runtime/broker/auth-reload.js +0 -1
- package/dist/core/substrate/cli-context-delivery.d.ts +0 -22
- package/dist/core/substrate/cli-context-delivery.js +0 -1
|
@@ -11,7 +11,17 @@ export function runtimeHome() {
|
|
|
11
11
|
export const GENERATION_ID = /^[a-f0-9]{64}$/;
|
|
12
12
|
export const MANIFEST_SCHEMA = 1;
|
|
13
13
|
export const PACKAGE_NAME = '@north-light/crouter';
|
|
14
|
-
export const ENTRY_NAMES = ['broker', 'cli', 'daemon'];
|
|
14
|
+
export const ENTRY_NAMES = ['broker', 'cli', 'daemon', 'launcher'];
|
|
15
|
+
/** Entries every generation carries. Generations installed before the root
|
|
16
|
+
* launcher existed lack `launcher`; a source-linked install moves `bin/` with
|
|
17
|
+
* git while the installed generation stays put, so launching those older
|
|
18
|
+
* generations must keep working for every entry they do carry. */
|
|
19
|
+
const REQUIRED_ENTRY_NAMES = ['broker', 'cli', 'daemon'];
|
|
20
|
+
|
|
21
|
+
function entryNamesSupported(entries) {
|
|
22
|
+
const names = Object.keys(entries);
|
|
23
|
+
return REQUIRED_ENTRY_NAMES.every((name) => names.includes(name)) && names.every((name) => ENTRY_NAMES.includes(name));
|
|
24
|
+
}
|
|
15
25
|
export const MANIFEST_KEYS = ['arch', 'createdAt', 'entries', 'files', 'id', 'nodeVersion', 'packageName', 'packageVersion', 'platform', 'schema'];
|
|
16
26
|
|
|
17
27
|
/** Extract the Node major version number from a `process.version`-shaped
|
|
@@ -254,7 +264,7 @@ export function validateManifestShape(manifest, { id, entryName }) {
|
|
|
254
264
|
error: `runtime generation was built for node ${manifest.nodeVersion}, this is ${process.version} — reinstall the runtime (\`npm run install-runtime\` / reinstall crouter)`,
|
|
255
265
|
};
|
|
256
266
|
}
|
|
257
|
-
if (manifest.schema !== MANIFEST_SCHEMA || manifest.id !== id || !GENERATION_ID.test(manifest.id) || manifest.packageName !== PACKAGE_NAME || typeof manifest.packageVersion !== 'string' || manifest.packageVersion === '' || manifest.platform !== process.platform || manifest.arch !== process.arch || typeof manifest.createdAt !== 'string' || Number.isNaN(Date.parse(manifest.createdAt)) || !manifest.entries || typeof manifest.entries !== 'object' || Array.isArray(manifest.entries) ||
|
|
267
|
+
if (manifest.schema !== MANIFEST_SCHEMA || manifest.id !== id || !GENERATION_ID.test(manifest.id) || manifest.packageName !== PACKAGE_NAME || typeof manifest.packageVersion !== 'string' || manifest.packageVersion === '' || manifest.platform !== process.platform || manifest.arch !== process.arch || typeof manifest.createdAt !== 'string' || Number.isNaN(Date.parse(manifest.createdAt)) || !manifest.entries || typeof manifest.entries !== 'object' || Array.isArray(manifest.entries) || !entryNamesSupported(manifest.entries) || !Array.isArray(manifest.files)) {
|
|
258
268
|
return { ok: false, error: 'generation manifest has an unsupported schema or identity' };
|
|
259
269
|
}
|
|
260
270
|
const entry = manifest.entries[entryName];
|
package/dist/api/client.d.ts
CHANGED
|
@@ -2,28 +2,30 @@ import type { DaemonAdmitDTO, DaemonRestartDTO, HealthDTO, MigrateStateDTO, Migr
|
|
|
2
2
|
import type { BashJobStatusDTO, BashJobStopResultDTO } from './dto/bash-jobs.js';
|
|
3
3
|
import type { ArtifactListDTO, ArtifactsQuery, ContextListDTO, CreateNodeRequest, ListNodesQuery, NodeDetailDTO, NodeMessagesPageDTO, NodeMessagesQuery, NodeSessionDTO, NodeSnapshotDTO, NodeSubjectDTO, NodeSummaryDTO, TranscriptDTO, TranscriptQuery } from './dto/nodes.js';
|
|
4
4
|
import type { NodeOutcomeResponseDTO, OutcomeDeliveryDTO, RegisterOutcomeDeliveryRequest } from './dto/node-outcomes.js';
|
|
5
|
+
import type { AnalyticsDTO, AnalyticsQuery, MemoryReadsRequestDTO } from './dto/analytics.js';
|
|
5
6
|
import type { NodeEventsQuery } from './dto/node-events.js';
|
|
7
|
+
import type { NodeLogAppendRequest, NodeLogAppendResultDTO, NodeTelemetryRecordRequest, NodeRecapRecordRequest, NodeMessageBodyDTO, NodePushedFinalRequest, NodePushedFinalResultDTO } from './dto/node-records.js';
|
|
6
8
|
import type { InterruptResultDTO, MessageResultDTO, SendMessageRequest } from './dto/messages.js';
|
|
7
9
|
import type { PushReportRequest, PushReportResultDTO, ReportDTO, ReportsQuery, SubmitResultDTO, SubmitResultRequest } from './dto/reports.js';
|
|
8
10
|
import type { CloseRequest, CloseResultDTO, PromoteRequest, RelaunchRootResultDTO, ReviveRequest, ReviveResultDTO, WaitRequest, YieldRequest } from './dto/lifecycle.js';
|
|
9
11
|
import type { SubscribeRequest, SubscriptionDTO } from './dto/subscriptions.js';
|
|
10
12
|
import type { FocusDTO, RegisterFocusRequest, SetFocusPaneRequest } from './dto/focus.js';
|
|
11
13
|
import { type ArmCronRequest, type CancelCronQuery, type CronDTO, type CronRunDTO, type CronScopeQuery, type CronShowDTO, type ListCronsQuery, type PokeCronsResult } from './dto/crons.js';
|
|
12
|
-
import type { NodeConfigPatch } from './dto/config.js';
|
|
14
|
+
import type { KindListDTO, NodeConfigPatch } from './dto/config.js';
|
|
13
15
|
import type { AttachEnsureRequest, AttachEnsureResultDTO } from './dto/attach.js';
|
|
14
|
-
import type { DeleteProfileRequest, DeleteProfileResultDTO, EnsureProfileRequest, ProfileDTO, ProfilePauseResultDTO, UpdateProfileMetadataRequest } from './dto/profiles.js';
|
|
16
|
+
import type { CreateProfileRequest, DeleteProfileRequest, DeleteProfileResultDTO, EnsureProfileRequest, ProfileDTO, ProfileEnvChangeDTO, ProfileEnvNamesDTO, ProfilePauseResultDTO, UpdateProfileMetadataRequest, UpdateProfileRequest } from './dto/profiles.js';
|
|
15
17
|
import type { FileEncoding, FileListDTO, FilePeekDTO, FileWriteDTO } from './dto/files.js';
|
|
16
18
|
import type { BashRunDTO, BashRunParams } from './dto/bash.js';
|
|
17
|
-
import type { MemoryDocCreateRequest, MemoryDocDeletedDTO, MemoryDocDTO, MemoryDocMoveRequest, MemoryDocMovedDTO, MemoryDocRefDTO, MemoryDocUpdateRequest, MemoryHistoryDTO, MemoryHistoryQuery, MemoryListDTO, MemoryListQuery, MemoryScope, MemoryDocSummaryDTO, MemorySearchHitDTO, MemorySearchRequest } from './dto/memory.js';
|
|
19
|
+
import type { MemoryDocCreateRequest, MemoryDocDeletedDTO, MemoryDocDTO, MemoryDocMoveRequest, MemoryDocMovedDTO, MemoryOriginConversationDTO, MemoryDocRefDTO, MemoryDocUpdateRequest, MemoryHistoryDTO, MemoryHistoryQuery, MemoryListDTO, MemoryListQuery, MemoryScope, MemoryDocSummaryDTO, MemorySearchHitDTO, MemorySearchRequest } from './dto/memory.js';
|
|
18
20
|
import type { ChatInventoryDTO, ProspectiveChatInventoryDTO, ProspectiveChatInventoryQuery } from './dto/chat-inventory.js';
|
|
19
|
-
import type { CredentialRemovalResultDTO, CredentialResultDTO, InstallCredentialRequest, ModelAuthListDTO, ModelAuthReadinessDTO, ModelAuthReadinessQuery } from './dto/modelauth.js';
|
|
21
|
+
import type { CredentialRemovalResultDTO, CredentialResultDTO, InstallCredentialRequest, CompleteModelAuthFlowRequest, ModelAuthFlowCompletedDTO, ModelAuthFlowDTO, ModelAuthFlowStartedDTO, ModelAuthListDTO, ModelAuthReadinessDTO, ModelAuthReadinessQuery, StartModelAuthFlowRequest } from './dto/modelauth.js';
|
|
20
22
|
import type { CancelReviewRequest, CreateReviewRequest, ListReviewsQuery, ReviewCancelResultDTO, ReviewDocumentBaseDTO, ReviewDTO, ReviewListDTO, ReviewSubmitResultDTO } from './dto/reviews.js';
|
|
21
23
|
import type { CreateReviewCommentRequest, EditReviewCommentRequest, ListReviewCommentsQuery, ReadReviewCommentEventsQuery, ReviewCommentActionRequest, ReviewCommentDetailDTO, ReviewCommentEventsDTO, ReviewCommentForkDTO, ReviewCommentListDTO, ReviewCommentMutationDTO, ReviewCommentRangeBatchRequest, ReviewCommentRangeBatchResultDTO } from './dto/review-comments.js';
|
|
22
24
|
import type { CancelInboxTicketRequest, CanceledTicketResultDTO, InboxListDTO, InboxPageDTO, InboxPageHistoryDTO, InboxPageResponseDTO, InboxTicketIdDTO, PageFeedbackResolutionDTO, PageResponsesDTO, PageTicketResultDTO, RespondInboxPageRequest } from './dto/inbox.js';
|
|
23
|
-
import type { CreateHumanRequestDTO, CreateHumanRequestRequest, HumanRequestDTO, HumanRequestIdDTO, ReplaceHumanRequestRequest, RespondHumanRequestRequest, SettleHumanRequestRequest } from './dto/human-requests.js';
|
|
25
|
+
import type { CreateHumanRequestDTO, CreateHumanRequestRequest, HumanRequestDTO, HumanRequestIdDTO, ReplaceHumanRequestRequest, RespondHumanRequestRequest, SettleHumanRequestRequest, PageComponentListDTO } from './dto/human-requests.js';
|
|
24
26
|
import type { AttentionCountsDTO, AttentionDTO, DashboardDTO, DashboardQuery, HistoryGrepQuery, HistoryGrepResultDTO, HistoryReadQuery, HistoryStatsQuery, HistoryStatsResultDTO, HistoryReadResultDTO, HistorySearchQuery, HistorySearchResultDTO, GraphDTO, PruneRequest, PruneResultDTO, RosterDTO, SnapshotDTO } from './dto/canvas.js';
|
|
25
|
-
import type { AbandonWorktreeRequest, AbandonWorktreeResultDTO, CloseWorktreeResultDTO, QuarantinedWorktreeDTO } from './dto/worktree.js';
|
|
26
|
-
import type { BrokerExtensionStateDTO, BrokerExecutionRequest, BrokerGeneratedNameRequest, BrokerGeneratedNameResultDTO, BrokerModelCommitRequest, BrokerModelCommitResultDTO, BrokerParkActivityResultDTO, BrokerParkCompleteRequest, BrokerPersonaAckRequest, BrokerPersonaAckResultDTO, BrokerSessionBoundRequest, BrokerSessionBoundResultDTO, BrokerSettleDirective, BrokerSettleRequest, BrokerTelemetryRequest } from './dto/broker-ops.js';
|
|
27
|
+
import type { AbandonWorktreeRequest, AbandonWorktreeResultDTO, CloseWorktreeResultDTO, QuarantinedWorktreeDTO, SpaceListDTO } from './dto/worktree.js';
|
|
28
|
+
import type { BrokerExtensionStateDTO, BrokerContextRequest, BrokerContextDTO, BrokerContextCommitRequest, BrokerContextEventRequest, BrokerExecutionRequest, BrokerGeneratedNameRequest, BrokerGeneratedNameResultDTO, BrokerModelCommitRequest, BrokerModelCommitResultDTO, BrokerParkActivityResultDTO, BrokerParkCompleteRequest, BrokerPersonaAckRequest, BrokerPersonaAckResultDTO, BrokerSessionBoundRequest, BrokerSessionBoundResultDTO, BrokerSettleDirective, BrokerSettleRequest, BrokerTelemetryRequest } from './dto/broker-ops.js';
|
|
27
29
|
import type { AcknowledgeMailRequest, AcknowledgeMailResultDTO, ClaimMailRequest, ClaimMailResultDTO } from './dto/mail.js';
|
|
28
30
|
import type { BrokerFaultInputDTO, BrokerFaultRequest, BrokerFaultResultDTO, BrokerProviderRetryRequest, BrokerProviderRetryResultDTO, BrokerTurnRequest, BrokerTurnResultDTO, NodeFaultClearResultDTO, RecoveryStateDTO } from './dto/recovery.js';
|
|
29
31
|
export interface CrtrClientOptions {
|
|
@@ -100,6 +102,12 @@ export declare class CrtrClient {
|
|
|
100
102
|
restartDaemon(): Promise<DaemonRestartDTO>;
|
|
101
103
|
admitDaemon(): Promise<DaemonAdmitDTO>;
|
|
102
104
|
migrateState(req: MigrateStateRequest): Promise<MigrateStateDTO>;
|
|
105
|
+
appendNodeLog(id: string, req: NodeLogAppendRequest): Promise<NodeLogAppendResultDTO>;
|
|
106
|
+
putNodeTelemetry(id: string, req: NodeTelemetryRecordRequest): Promise<void>;
|
|
107
|
+
putNodeRecap(id: string, req: NodeRecapRecordRequest): Promise<void>;
|
|
108
|
+
readNodeInboxReport(id: string, ref: string, executionId: string): Promise<NodeMessageBodyDTO>;
|
|
109
|
+
readNodePassiveMessage(id: string, ref: string): Promise<NodeMessageBodyDTO>;
|
|
110
|
+
nodePushedFinal(id: string, req: NodePushedFinalRequest): Promise<NodePushedFinalResultDTO>;
|
|
103
111
|
createNode(req: CreateNodeRequest): Promise<NodeDetailDTO>;
|
|
104
112
|
/** List canvas nodes with composable row filters. `include: 'activity'` adds
|
|
105
113
|
* latest/canonical reports and pending-human counts in the same response. */
|
|
@@ -149,6 +157,10 @@ export declare class CrtrClient {
|
|
|
149
157
|
}): Promise<NodeFaultClearResultDTO>;
|
|
150
158
|
commitBrokerModel(id: string, req: BrokerModelCommitRequest): Promise<BrokerModelCommitResultDTO>;
|
|
151
159
|
brokerExtensionState(id: string): Promise<BrokerExtensionStateDTO>;
|
|
160
|
+
brokerContext(id: string, req: BrokerContextRequest): Promise<BrokerContextDTO>;
|
|
161
|
+
brokerMemoryRefs(id: string, expectedExecutionId: string): Promise<import('./dto/broker-ops.js').BrokerMemoryRefsDTO>;
|
|
162
|
+
commitBrokerContext(id: string, req: BrokerContextCommitRequest): Promise<void>;
|
|
163
|
+
brokerContextEvent(id: string, req: BrokerContextEventRequest): Promise<BrokerContextDTO>;
|
|
152
164
|
commitBrokerGeneratedName(id: string, req: BrokerGeneratedNameRequest): Promise<BrokerGeneratedNameResultDTO>;
|
|
153
165
|
commitBrokerPersonaAck(id: string, req: BrokerPersonaAckRequest): Promise<BrokerPersonaAckResultDTO>;
|
|
154
166
|
closeNode(id: string, req?: CloseRequest): Promise<CloseResultDTO>;
|
|
@@ -157,6 +169,9 @@ export declare class CrtrClient {
|
|
|
157
169
|
promoteNode(id: string, req: PromoteRequest): Promise<NodeDetailDTO>;
|
|
158
170
|
yieldNode(id: string, req: YieldRequest): Promise<NodeDetailDTO>;
|
|
159
171
|
waitNode(id: string, req: WaitRequest): Promise<NodeDetailDTO>;
|
|
172
|
+
listKinds(): Promise<KindListDTO>;
|
|
173
|
+
/** A model change may first wait up to 30 s for a starting broker's view
|
|
174
|
+
* socket and then 15 s for its ack, so it gets that budget on top. */
|
|
160
175
|
patchConfig(id: string, patch: NodeConfigPatch): Promise<NodeDetailDTO>;
|
|
161
176
|
/** Land + close the node's managed git worktree (spec §6.2). Server-side
|
|
162
177
|
* because it interleaves a canvas WRITE with a git land transaction and
|
|
@@ -164,6 +179,8 @@ export declare class CrtrClient {
|
|
|
164
179
|
closeWorktree(id: string): Promise<CloseWorktreeResultDTO>;
|
|
165
180
|
abandonWorktree(id: string, req: AbandonWorktreeRequest): Promise<AbandonWorktreeResultDTO>;
|
|
166
181
|
listQuarantinedWorktrees(): Promise<QuarantinedWorktreeDTO[]>;
|
|
182
|
+
/** Every space on the runtime with its size (person only). */
|
|
183
|
+
listSpaces(): Promise<SpaceListDTO>;
|
|
167
184
|
subscribe(id: string, req: SubscribeRequest): Promise<SubscriptionDTO>;
|
|
168
185
|
listFocuses(): Promise<FocusDTO[]>;
|
|
169
186
|
focusOf(nodeId: string): Promise<FocusDTO | null>;
|
|
@@ -217,6 +234,7 @@ export declare class CrtrClient {
|
|
|
217
234
|
writeFile(path: string, content: string, encoding?: FileEncoding, options?: CrtrRequestOptions): Promise<FileWriteDTO>;
|
|
218
235
|
listFiles(path: string, limit?: number, options?: CrtrRequestOptions): Promise<FileListDTO>;
|
|
219
236
|
runBash(params: BashRunParams, options?: CrtrRequestOptions): Promise<BashRunDTO>;
|
|
237
|
+
getMemoryOriginConversation(conversationId: string): Promise<MemoryOriginConversationDTO>;
|
|
220
238
|
/** Resolve an exact canonical `[[name]]` memory-document link to the winning
|
|
221
239
|
* document's physical origin for the given node — the node's own precedence
|
|
222
240
|
* chain, not this process's. Pair with `peekFile` to render the document. */
|
|
@@ -235,7 +253,14 @@ export declare class CrtrClient {
|
|
|
235
253
|
* the profile already exists; their directories are only required to exist
|
|
236
254
|
* when this call creates the profile. */
|
|
237
255
|
ensureProfile(name: string, req?: EnsureProfileRequest): Promise<ProfileDTO>;
|
|
256
|
+
/** Create a profile of the caller's app; a name it already holds is refused. */
|
|
257
|
+
createProfile(req: CreateProfileRequest): Promise<ProfileDTO>;
|
|
238
258
|
listProfiles(): Promise<ProfileDTO[]>;
|
|
259
|
+
/** Rename, set the default kind, or add or remove one project. */
|
|
260
|
+
updateProfile(name: string, req: UpdateProfileRequest): Promise<ProfileDTO>;
|
|
261
|
+
listProfileEnv(name: string): Promise<ProfileEnvNamesDTO>;
|
|
262
|
+
setProfileEnv(name: string, variable: string, value: string): Promise<ProfileEnvChangeDTO>;
|
|
263
|
+
removeProfileEnv(name: string, variable: string): Promise<ProfileEnvChangeDTO>;
|
|
239
264
|
getProfile(name: string): Promise<ProfileDTO>;
|
|
240
265
|
pauseProfile(name: string): Promise<ProfilePauseResultDTO>;
|
|
241
266
|
resumeProfile(name: string): Promise<ProfilePauseResultDTO>;
|
|
@@ -247,6 +272,14 @@ export declare class CrtrClient {
|
|
|
247
272
|
getModelAuthReadiness(query?: ModelAuthReadinessQuery): Promise<ModelAuthReadinessDTO>;
|
|
248
273
|
installCredential(provider: string, req: InstallCredentialRequest): Promise<CredentialResultDTO>;
|
|
249
274
|
removeCredential(provider: string): Promise<CredentialRemovalResultDTO>;
|
|
275
|
+
/** `model_auth.start` — the daemon runs the vendor OAuth; the caller only shows `url`. */
|
|
276
|
+
startModelAuth(req: StartModelAuthFlowRequest): Promise<ModelAuthFlowStartedDTO>;
|
|
277
|
+
/** `model_auth.complete` — hand the daemon the code the vendor showed. */
|
|
278
|
+
completeModelAuth(flowId: string, req: CompleteModelAuthFlowRequest): Promise<ModelAuthFlowCompletedDTO>;
|
|
279
|
+
/** `model_auth.cancel` — end an in-flight flow the person gave up on; it writes nothing. */
|
|
280
|
+
cancelModelAuth(flowId: string): Promise<ModelAuthFlowDTO>;
|
|
281
|
+
/** A flow's state; `waitSeconds` (1-25) long-polls until it leaves `pending`. */
|
|
282
|
+
getModelAuthFlow(flowId: string, waitSeconds?: number): Promise<ModelAuthFlowDTO>;
|
|
250
283
|
createReview(req: CreateReviewRequest): Promise<ReviewDTO>;
|
|
251
284
|
listReviews(query?: ListReviewsQuery): Promise<ReviewListDTO>;
|
|
252
285
|
getReview(reviewId: string): Promise<ReviewDTO>;
|
|
@@ -285,6 +318,8 @@ export declare class CrtrClient {
|
|
|
285
318
|
* `action.name` is rejected before the page is published, leaving no inbox
|
|
286
319
|
* row behind. */
|
|
287
320
|
createHumanRequest(request: CreateHumanRequestRequest): Promise<CreateHumanRequestDTO>;
|
|
321
|
+
/** Product page components registered on the runtime (config + enabled plugins). */
|
|
322
|
+
listPageComponents(): Promise<PageComponentListDTO>;
|
|
288
323
|
/** Read one request: its current state, its answer when answered, and the
|
|
289
324
|
* delivery state of its completion action when it bound one. */
|
|
290
325
|
getHumanRequest(requestId: HumanRequestIdDTO): Promise<HumanRequestDTO>;
|
|
@@ -329,6 +364,14 @@ export declare class CrtrClient {
|
|
|
329
364
|
/** The machine-readable browser canvas roster (`crtr canvas snapshot`) —
|
|
330
365
|
* distinct from the per-node `getSnapshot`. */
|
|
331
366
|
canvasSnapshot(): Promise<SnapshotDTO>;
|
|
367
|
+
/** The Analytics page model (`GET /v1/canvas/analytics`, person only). The
|
|
368
|
+
* daemon scans transcripts for the window: a cold 7d scan of ~2 GB of
|
|
369
|
+
* transcripts measured 10 s, and with scan workers capped at 4 a queued
|
|
370
|
+
* request waits about one scan more. 60 s is 3x that worst case; past it the
|
|
371
|
+
* page shows the error instead of computing forever. */
|
|
372
|
+
analytics(q: AnalyticsQuery): Promise<AnalyticsDTO>;
|
|
373
|
+
/** Record memory reads/loads for one node (`POST /v1/nodes/:id/memory-reads`). */
|
|
374
|
+
recordMemoryReads(nodeId: string, body: MemoryReadsRequestDTO): Promise<void>;
|
|
332
375
|
/** The lean, set-based topology roster (`GET /v1/canvas/roster`) — exactly
|
|
333
376
|
* two indexed queries server-side, no per-row enrichment. The recurring
|
|
334
377
|
* poll target for attach/browser topology; use `canvasSnapshot` for the
|
package/dist/api/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var p=Object.defineProperty;var d=(n,e)=>p(n,"name",{value:e,configurable:!0});import{ApiError as h,isErrorBody as b}from"./errors.js";import{routes as r}from"./routes.js";import{isSafeNodeId as S}from"./dto/common.js";import{isSafeBashJobId as g}from"./dto/bash-jobs.js";import{isSafeCronId as R}from"./dto/crons.js";const k=3e4,C=Symbol.for("@north-light/crouter-api/local-socket-fetch"),G=1e4,D=200;async function N({windowMs:n,probe:e,initialError:t,pollIntervalMs:s=D,retry:i=d(()=>!0,"retry"),now:a=Date.now,sleep:P=w}){const l=a()+n;let u=t;for(;;){const c=l-a();if(c<=0)throw u??new Error("crtrd availability window expired without a probe failure");try{await e(c);return}catch(f){if(u=f,!i(f))throw f}const m=l-a();if(m<=0)throw u;await P(Math.min(s,m))}}d(N,"waitForDaemonAvailability");class U{static{d(this,"CrtrClient")}baseUrl;fetch;headers;autostart;timeoutMs;maxRetries;localSocketTransport;onColdSocket;coldStartDiagnostic;coldStartPollWindowMs;coldStartAttempted=!1;constructor(e){if(e.baseUrl==="")throw new TypeError("CrtrClient requires baseUrl");this.baseUrl=new URL(e.baseUrl),this.fetch=e.fetch??globalThis.fetch,this.headers={...e.headers},this.autostart=e.autostart??!1,this.timeoutMs=e.timeoutMs??k,this.maxRetries=e.maxRetries??2,this.localSocketTransport=this.fetch[C]===!0,e.onColdSocket!==void 0&&(this.onColdSocket=e.onColdSocket),e.coldStartDiagnostic!==void 0&&(this.coldStartDiagnostic=e.coldStartDiagnostic),this.coldStartPollWindowMs=e.coldStartPollWindowMs??G}healthz(){return this.request("GET",r.healthz())}async probeHealthz(e){const t=await this.transport("GET",r.healthz(),void 0,{timeout:e});if(t.status===503)try{const s=await t.clone().json();if(typeof s.startup_blocked=="string")return s}catch{}return v(t)}status(){return this.request("GET",r.status())}restartDaemon(){return this.request("POST",r.daemonRestart())}admitDaemon(){return this.request("POST",r.daemonAdmit())}migrateState(e){return this.request("POST",r.daemonMigrate(),e)}createNode(e){return this.request("POST",r.nodes(),e)}listNodes(e){return this.request("GET",o(r.nodes(),e))}getNode(e){return this.request("GET",r.node(this.nodePath(e)))}getNodeOutcome(e,{waitSeconds:t}={}){if(t!==void 0&&(!Number.isInteger(t)||t<0||t>25))throw new RangeError("waitSeconds must be an integer between 0 and 25");return this.request("GET",o(r.nodeOutcome(this.nodePath(e)),{wait:t}),void 0,{timeout:(t??0)*1e3+this.timeoutMs})}getNodeEvents(e,t={},s={}){if(t.after!==void 0&&(!Number.isSafeInteger(t.after)||t.after<0))throw new RangeError("after must be a non-negative safe integer");return this.transport("GET",o(r.nodeEvents(this.nodePath(e)),t),void 0,{...s,headers:{accept:"text/event-stream",...s.headers??{}},timeout:0})}registerOutcomeDelivery(e,t){return this.request("PUT",r.nodeOutcomeDelivery(this.nodePath(e)),t)}getOutcomeDelivery(e){return this.request("GET",r.nodeOutcomeDelivery(this.nodePath(e)))}async disarmOutcomeDelivery(e){await this.request("DELETE",r.nodeOutcomeDelivery(this.nodePath(e)))}listBashJobs(e){return this.request("GET",r.nodeJobs(this.nodePath(e)))}stopBashJob(e,t){return this.request("DELETE",r.nodeJob(this.nodePath(e),this.jobPath(t)))}sendMessage(e,t){return this.request("POST",r.nodeMessages(this.nodePath(e)),t)}interruptNode(e){return this.request("POST",r.nodeInterrupt(this.nodePath(e)),{})}pushReport(e,t){return this.request("POST",r.nodeReports(this.nodePath(e)),t)}submitResult(e,t){return this.request("POST",r.nodeResult(this.nodePath(e)),t)}forkNode(e){return this.request("POST",r.nodeFork(this.nodePath(e)),{})}reviveNode(e,t){return this.request("POST",r.nodeRevive(this.nodePath(e)),t??{})}relaunchRoot(e){return this.request("POST",r.nodeRelaunchRoot(this.nodePath(e)),{})}bindBrokerSession(e,t){return this.request("POST",r.nodeBrokerSessionBound(this.nodePath(e)),t)}settleBroker(e,t){return this.request("POST",r.nodeBrokerSettle(this.nodePath(e)),t)}completeBrokerPark(e,t){return this.request("POST",r.nodeBrokerParkComplete(this.nodePath(e)),t)}recordBrokerParkActivity(e,t){return this.request("POST",r.nodeBrokerParkActivity(this.nodePath(e)),t)}async recordBrokerTelemetry(e,t){await this.request("POST",r.nodeBrokerTelemetry(this.nodePath(e)),t)}claimNodeMail(e,t){return this.request("POST",r.nodeMailClaim(this.nodePath(e)),t)}acknowledgeNodeMail(e,t){return this.request("POST",r.nodeMailAcknowledge(this.nodePath(e)),t)}recordBrokerTurn(e,t){return this.request("POST",r.brokerTurn(this.nodePath(e)),t)}mutateBrokerProviderRetry(e,t){return this.request("POST",r.brokerProviderRetry(this.nodePath(e)),t)}mutateBrokerFault(e,t){return this.request("POST",r.brokerFault(this.nodePath(e)),t)}getBrokerRecovery(e,t){return this.request("GET",`${r.brokerRecovery(this.nodePath(e))}?expected_execution_id=${encodeURIComponent(t)}`)}recordNodeFault(e,t){return this.request("POST",r.nodeFault(this.nodePath(e)),t)}clearNodeFault(e,t={}){const s=new URLSearchParams;t.link!==void 0&&s.set("link",t.link),t.preserve_episode!==void 0&&s.set("preserve_episode",String(t.preserve_episode));const i=s.size===0?"":`?${s.toString()}`;return this.request("DELETE",`${r.nodeFault(this.nodePath(e))}${i}`)}commitBrokerModel(e,t){return this.request("POST",r.nodeBrokerModel(this.nodePath(e)),t)}brokerExtensionState(e){return this.request("GET",r.nodeBrokerExtensionState(this.nodePath(e)))}commitBrokerGeneratedName(e,t){return this.request("POST",r.nodeBrokerGeneratedName(this.nodePath(e)),t)}commitBrokerPersonaAck(e,t){return this.request("POST",r.nodeBrokerPersonaAck(this.nodePath(e)),t)}closeNode(e,t){return this.request("POST",r.nodeClose(this.nodePath(e)),t??{})}recycleNode(e){return this.request("POST",r.nodeRecycle(this.nodePath(e)),{})}demoteNode(e){return this.request("POST",r.nodeDemote(this.nodePath(e)),{})}promoteNode(e,t){return this.request("POST",r.nodePromote(this.nodePath(e)),t)}yieldNode(e,t){return this.request("POST",r.nodeYield(this.nodePath(e)),t)}waitNode(e,t){return this.request("POST",r.nodeWait(this.nodePath(e)),t)}patchConfig(e,t){return this.request("PATCH",r.nodeConfig(this.nodePath(e)),t)}closeWorktree(e){return this.request("POST",r.nodeWorktreeClose(this.nodePath(e)),{})}abandonWorktree(e,t){return this.request("POST",r.nodeWorktreeAbandon(this.nodePath(e)),t)}listQuarantinedWorktrees(){return this.request("GET",r.quarantinedWorktrees())}subscribe(e,t){return this.request("POST",r.nodeSubscriptions(this.nodePath(e)),t)}listFocuses(){return this.request("GET",r.focuses())}focusOf(e){return this.request("GET",o(r.focusByNode(),{node_id:e}))}focusByPane(e){return this.request("GET",o(r.focusByPane(),{pane:e}))}registerFocus(e){return this.request("POST",r.focuses(),e)}async setFocusPane(e,t){await this.request("PATCH",r.focus(e),t)}async closeFocus(e){await this.request("DELETE",r.focus(e))}async unsubscribe(e,t){await this.request("DELETE",r.nodeSubscription(this.nodePath(e),this.nodePath(t)))}armCron(e){return this.request("POST",r.crons(),e)}listCrons(e){return this.request("GET",o(r.crons(),e))}showCron(e,t){return this.request("GET",o(r.cron(this.cronPath(e)),t))}pauseCron(e,t){return this.request("POST",o(r.cronPause(this.cronPath(e)),t),{})}resumeCron(e,t){return this.request("POST",o(r.cronResume(this.cronPath(e)),t),{})}runCron(e,t){return this.request("POST",o(r.cronRun(this.cronPath(e)),t),{})}async cancelCron(e,t){await this.request("DELETE",o(r.cron(this.cronPath(e)),t))}pokeCrons(){return this.request("POST",r.cronsPoke(),{})}ensureAttach(e,t){return this.request("POST",r.nodeAttach(this.nodePath(e)),t??{})}getReports(e,t){return this.request("GET",o(r.nodeReports(this.nodePath(e)),t))}getTranscript(e,t){return this.request("GET",o(r.nodeTranscript(this.nodePath(e)),t))}getSnapshot(e){return this.request("GET",r.nodeSnapshot(this.nodePath(e)))}nodeSubject(e){return this.request("GET",r.nodeSubject(this.nodePath(e)))}getNodeMessages(e,t){return this.request("GET",o(r.nodeMessages(this.nodePath(e)),t))}getSession(e){return this.request("GET",r.nodeSession(this.nodePath(e)))}getChatInventory(e){return this.request("GET",r.nodeChatInventory(this.nodePath(e)))}getProspectiveChatInventory(e){return this.request("GET",o(r.prospectiveChatInventory(),e))}getArtifacts(e,t){return this.request("GET",o(r.nodeArtifacts(this.nodePath(e)),t))}getContext(e){return this.request("GET",r.nodeContext(this.nodePath(e)))}peekFile(e,t,s){return this.request("GET",o(r.filePeek(),{path:e,encoding:t}),void 0,s)}writeFile(e,t,s,i){return this.request("POST",r.fileWrite(),{path:e,content:t,encoding:s},i)}listFiles(e,t,s){return this.request("GET",o(r.fileList(),{path:e,limit:t}),void 0,s)}runBash(e,t){return this.request("POST",r.bash(),e,t)}resolveMemoryDoc(e,t={}){return this.request("GET",o(r.memoryResolve(),{name:e,...t}))}listMemoryDocs(e){return this.request("GET",o(r.memoryDocs(),e))}getMemoryDoc(e,t){return this.request("GET",o(r.memoryDoc(e),t))}createMemoryDoc(e){return this.request("POST",r.memoryDocs(),e)}updateMemoryDoc(e,t){return this.request("PATCH",r.memoryDoc(e),t)}deleteMemoryDoc(e,t){return this.request("DELETE",o(r.memoryDoc(e),t))}moveMemoryDoc(e,t){return this.request("POST",r.memoryDocMove(e),t)}searchMemoryDocs(e){return this.request("POST",r.memorySearch(),e)}getMemoryHistory(e,t){return this.request("GET",o(r.memoryDocHistory(e),t))}ensureProfile(e,t){return this.request("PUT",r.profile(e),t??{})}listProfiles(){return this.request("GET",r.profiles())}getProfile(e){return this.request("GET",r.profile(e))}pauseProfile(e){return this.request("POST",r.profilePause(e),{})}resumeProfile(e){return this.request("POST",r.profileResume(e),{})}updateProfileMetadata(e,t){return this.request("PATCH",r.profileMetadata(e),t)}deleteProfile(e,t){return this.request("DELETE",r.profile(e),t)}listModelAuth(){return this.request("GET",r.modelAuths())}getModelAuthReadiness(e){return this.request("GET",o(r.modelAuthReadiness(),e))}installCredential(e,t){return this.request("PUT",r.modelAuth(e),t)}removeCredential(e){return this.request("DELETE",r.modelAuth(e))}createReview(e){return this.request("POST",r.humanReviews(),e)}listReviews(e){return this.request("GET",o(r.humanReviews(),e))}getReview(e){return this.request("GET",r.humanReview(this.reviewPath(e)))}submitReview(e){return this.request("POST",r.humanReviewSubmit(this.reviewPath(e)),{})}cancelReview(e,t={}){return this.request("POST",r.humanReviewCancel(this.reviewPath(e)),t)}getReviewDocumentBase(e){return this.request("GET",r.humanReviewDocument(this.reviewPath(e)))}createReviewComment(e,t){const s=e===void 0?"self":this.reviewPath(e);return this.request("POST",r.humanReviewComments(s),t)}listReviewComments(e,t){const s=e===void 0?"self":this.reviewPath(e);return this.request("GET",o(r.humanReviewComments(s),t))}readReviewCommentEvents(e,t){return this.request("GET",o(r.humanReviewCommentEvents(this.reviewPath(e)),t))}updateReviewCommentRanges(e,t){return this.request("POST",r.humanReviewCommentRanges(this.reviewPath(e)),t)}getReviewComment(e){return this.request("GET",r.humanComment(this.commentPath(e)))}editReviewComment(e,t){return this.request("POST",r.humanCommentEdit(this.commentPath(e)),t)}resolveReviewComment(e,t={}){return this.request("POST",r.humanCommentResolve(this.commentPath(e)),t)}reopenReviewComment(e,t={}){return this.request("POST",r.humanCommentReopen(this.commentPath(e)),t)}deleteReviewComment(e,t={}){return this.request("POST",r.humanCommentDelete(this.commentPath(e)),t)}forkReviewComment(e){return this.request("POST",r.humanCommentFork(this.commentPath(e)),{})}listHumanInbox(){return this.request("GET",r.humanInbox())}getHumanInboxPage(e){return this.request("GET",r.humanInboxTicket(this.ticketId(e)))}getInboxHistory(e){if(e===void 0)return this.request("GET",r.humanInbox()+"/history");if(typeof e!="string"||e==="")throw new TypeError(`invalid node id: ${JSON.stringify(e)}`);return this.request("GET",o(r.humanInbox()+"/history",{node_id:e}))}respondHumanInboxPage(e,t){return this.request("POST",r.humanInboxRespond(this.ticketId(e)),t)}postInboxProgress(e,t){return this.request("POST",r.humanInboxProgress(this.ticketId(e)),{responses:t})}getInboxResponse(e){return this.request("GET",r.humanInboxResponse(this.ticketId(e)))}cancelHumanInboxTicket(e,t){return this.request("POST",r.humanInboxCancel(this.ticketId(e)),t??{})}createHumanRequest(e){return this.request("POST",r.humanRequests(),e)}getHumanRequest(e){return this.request("GET",r.humanRequest(this.requestPath(e)))}replaceHumanRequest(e,t){return this.request("POST",r.humanRequestReplace(this.requestPath(e)),t)}respondHumanRequest(e,t){return this.request("POST",r.humanRequestRespond(this.requestPath(e)),t)}dismissHumanRequest(e,t={}){return this.request("POST",r.humanRequestDismiss(this.requestPath(e)),t)}cancelHumanRequest(e,t={}){return this.request("POST",r.humanRequestCancel(this.requestPath(e)),t)}resolvePageFeedbackComment(e,t,s){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(t))throw new TypeError(`invalid feedback comment id: ${JSON.stringify(t)}`);return this.request("POST",r.humanInboxFeedbackResolve(this.ticketId(e),t),{node_id:s})}async dashboard(e){const t=e?.under!==void 0?{under:e.under}:void 0,[s,i]=await Promise.all([this.listNodes(t),this.status()]);return{nodes:s,counts:i.node_counts,generated_at:new Date().toISOString()}}attention(){return this.request("GET",r.canvasAttention())}attentionCounts(e){const t={node_ids:e};return this.request("POST",r.canvasAttentionCounts(),t)}historySearch(e){return this.request("POST",r.canvasHistorySearch(),e)}historyGrep(e){return this.request("POST",r.canvasHistoryGrep(),e)}historyRead(e){return this.request("GET",o(r.canvasHistoryRead(),e))}historyStats(e){return this.request("POST",r.canvasHistoryStats(),e)}canvasSnapshot(){return this.request("GET",r.canvasSnapshot())}canvasRoster(){return this.request("GET",r.canvasRoster())}canvasGraph(){return this.request("GET",r.canvasGraph())}prune(e){return this.request("POST",r.canvasPrune(),e)}async request(e,t,s,i){try{return await v(await this.send(e,t,s,i))}catch(a){throw T(a,i?.signal)}}async send(e,t,s,i={}){const a=e==="GET"||e==="HEAD"||e==="DELETE",P=i.maxRetries??this.maxRetries;for(let l=0;;l++){let u;try{u=await this.transport(e,t,s,i)}catch(c){if(this.isColdSocketError(c))try{await this.handleColdSocket(c),u=await this.transport(e,t,s,i)}catch(m){throw T(m,i.signal)}else{if(this.isInterruptedSocketError(c)&&this.localSocketTransport&&(!a||l<P))return await this.rideOutInterruptedRequest(e,t,s,i);if(a&&l<P&&!x(c,i.signal)&&(!this.localSocketTransport||!this.isInterruptedSocketError(c))){await w(O(l+1));continue}else throw T(c,i.signal)}}if(a&&l<P&&M(u.status)){await _(u),await w(O(l+1));continue}return u}}nodePath(e){if(!S(e))throw new h(400,"invalid_node_id",`invalid node id: ${JSON.stringify(e)}`);return e}jobPath(e){if(!g(e))throw new h(400,"invalid_job_id",`invalid background job id: ${JSON.stringify(e)}`);return e}cronPath(e){if(!R(e))throw new h(400,"invalid_cron_id",`invalid cron id: ${JSON.stringify(e)}`);return e}requestPath(e){if(!S(e))throw new h(400,"invalid_request_id",`invalid request id: ${JSON.stringify(e)}`);return e}ticketId(e){if(!/^[a-f0-9]{64}$/.test(e))throw new TypeError(`invalid inbox ticket id: ${JSON.stringify(e)}`);return e}reviewPath(e){if(!S(e))throw new h(400,"invalid_review_id",`invalid review id: ${JSON.stringify(e)}`);return e}commentPath(e){if(!/^[a-f0-9]{32}$/.test(e))throw new h(400,"invalid_comment_id",`invalid comment id: ${JSON.stringify(e)}`);return e}transport(e,t,s,i={}){const a=s===void 0?void 0:JSON.stringify(s),P={accept:"application/json",...this.headers,...i.headers};a!==void 0&&(P["content-type"]="application/json");const l=i.timeout??this.timeoutMs,u=new AbortController,c=l>0?setTimeout(()=>u.abort(new DOMException("request timed out","TimeoutError")),l):void 0,m=i.signal,f=d(()=>u.abort(m?.reason),"onExternalAbort");m!==void 0&&(m.aborted?u.abort(m.reason):m.addEventListener("abort",f,{once:!0}));const y=d(()=>{c!==void 0&&clearTimeout(c),m?.removeEventListener("abort",f)},"finish");return this.fetch(new URL(t,this.baseUrl),{method:e,headers:P,body:a,signal:u.signal}).then(q=>this.retainRequestLifetime(q,y,()=>u.signal.aborted?u.signal.reason:void 0),q=>{throw y(),q})}retainRequestLifetime(e,t,s){if(e.body===null)return t(),e;const i=e.body.getReader();let a=!1;const P=d(()=>{a||(a=!0,t())},"close"),l=new ReadableStream({async pull(u){try{const{done:c,value:m}=await i.read();c?(P(),u.close()):u.enqueue(m)}catch(c){P(),u.error(s()??c)}},async cancel(u){P(),await i.cancel(u)}});return new Response(l,{status:e.status,statusText:e.statusText,headers:e.headers})}isColdSocketError(e){const t=E(e);return t==="ECONNREFUSED"||t==="ENOENT"||t==="ENOTSOCK"}isInterruptedSocketError(e){const t=E(e);return t==="ECONNRESET"||t==="EPIPE"}async rideOutInterruptedRequest(e,t,s,i={}){try{await this.awaitAvailability()}catch(a){throw T(a,i.signal)}if(e!=="GET"&&e!=="HEAD")throw new h(503,"daemon_request_interrupted",`crtrd connection ended before this ${e} response; the request may or may not have been applied.`);try{return await this.transport(e,t,s,i)}catch(a){throw T(a,i.signal)}}async awaitAvailability(e){await N({windowMs:this.coldStartPollWindowMs,initialError:e,probe:d(async t=>{const s=await this.transport("GET",r.healthz(),void 0,{timeout:t});if(s.status>=200&&s.status<300)return;const i=await s.text();try{if(typeof JSON.parse(i).startup_blocked=="string")return}catch{}throw new h(s.status,"daemon_health_unavailable",`crtrd health check returned HTTP ${s.status}: ${i.slice(0,500)}`)},"probe")})}async handleColdSocket(e){const t=this.autostart&&this.onColdSocket!==void 0&&!this.coldStartAttempted;t&&(this.coldStartAttempted=!0,await this.onColdSocket());try{await this.awaitAvailability(e)}catch(s){if(t){const i=A(this.coldStartDiagnostic);if(i!==void 0){const a=T(s);throw new h(a.status,a.code,`${a.message}
|
|
2
|
-
${i}`)}}throw s}}}function o(n,e){if(e===void 0)return n;const t=new URLSearchParams;for(const[i,a]of Object.entries(e))a!=null&&t.set(i,String(a));const s=t.toString();return s===""?n:`${n}?${s}`}d(o,"withQuery");async function
|
|
1
|
+
var g=Object.defineProperty;var d=(n,e)=>g(n,"name",{value:e,configurable:!0});import{ApiError as h,isErrorBody as b}from"./errors.js";import{routes as r}from"./routes.js";import{isSafeNodeId as E}from"./dto/common.js";import{isSafeBashJobId as R}from"./dto/bash-jobs.js";import{isSafeCronId as k}from"./dto/crons.js";const C=3e4,G=Symbol.for("@north-light/crouter-api/local-socket-fetch"),M=1e4,D=200;async function _({windowMs:n,probe:e,initialError:t,pollIntervalMs:s=D,retry:i=d(()=>!0,"retry"),now:a=Date.now,sleep:P=w}){const l=a()+n;let u=t;for(;;){const c=l-a();if(c<=0)throw u??new Error("crtrd availability window expired without a probe failure");try{await e(c);return}catch(f){if(u=f,!i(f))throw f}const m=l-a();if(m<=0)throw u;await P(Math.min(s,m))}}d(_,"waitForDaemonAvailability");class U{static{d(this,"CrtrClient")}baseUrl;fetch;headers;autostart;timeoutMs;maxRetries;localSocketTransport;onColdSocket;coldStartDiagnostic;coldStartPollWindowMs;coldStartAttempted=!1;constructor(e){if(e.baseUrl==="")throw new TypeError("CrtrClient requires baseUrl");this.baseUrl=new URL(e.baseUrl),this.fetch=e.fetch??globalThis.fetch,this.headers={...e.headers},this.autostart=e.autostart??!1,this.timeoutMs=e.timeoutMs??C,this.maxRetries=e.maxRetries??2,this.localSocketTransport=this.fetch[G]===!0,e.onColdSocket!==void 0&&(this.onColdSocket=e.onColdSocket),e.coldStartDiagnostic!==void 0&&(this.coldStartDiagnostic=e.coldStartDiagnostic),this.coldStartPollWindowMs=e.coldStartPollWindowMs??M}healthz(){return this.request("GET",r.healthz())}async probeHealthz(e){const t=await this.transport("GET",r.healthz(),void 0,{timeout:e});if(t.status===503)try{const s=await t.clone().json();if(typeof s.startup_blocked=="string")return s}catch{}return p(t)}status(){return this.request("GET",r.status())}restartDaemon(){return this.request("POST",r.daemonRestart())}admitDaemon(){return this.request("POST",r.daemonAdmit())}migrateState(e){return this.request("POST",r.daemonMigrate(),e)}appendNodeLog(e,t){return this.request("POST",r.nodeLog(this.nodePath(e)),t)}async putNodeTelemetry(e,t){await this.request("PUT",r.nodeTelemetry(this.nodePath(e)),t)}async putNodeRecap(e,t){await this.request("PUT",r.nodeRecap(this.nodePath(e)),t)}readNodeInboxReport(e,t,s){return this.request("GET",o(r.nodeInboxReport(this.nodePath(e)),{ref:t,execution_id:s}))}readNodePassiveMessage(e,t){return this.request("GET",o(r.nodePassiveMessage(this.nodePath(e)),{ref:t}))}nodePushedFinal(e,t){return this.request("POST",r.nodePushedFinal(this.nodePath(e)),t)}createNode(e){return this.request("POST",r.nodes(),e)}listNodes(e){return this.request("GET",o(r.nodes(),e))}getNode(e){return this.request("GET",r.node(this.nodePath(e)))}getNodeOutcome(e,{waitSeconds:t}={}){if(t!==void 0&&(!Number.isInteger(t)||t<0||t>25))throw new RangeError("waitSeconds must be an integer between 0 and 25");return this.request("GET",o(r.nodeOutcome(this.nodePath(e)),{wait:t}),void 0,{timeout:(t??0)*1e3+this.timeoutMs})}getNodeEvents(e,t={},s={}){if(t.after!==void 0&&(!Number.isSafeInteger(t.after)||t.after<0))throw new RangeError("after must be a non-negative safe integer");return this.transport("GET",o(r.nodeEvents(this.nodePath(e)),t),void 0,{...s,headers:{accept:"text/event-stream",...s.headers??{}},timeout:0})}registerOutcomeDelivery(e,t){return this.request("PUT",r.nodeOutcomeDelivery(this.nodePath(e)),t)}getOutcomeDelivery(e){return this.request("GET",r.nodeOutcomeDelivery(this.nodePath(e)))}async disarmOutcomeDelivery(e){await this.request("DELETE",r.nodeOutcomeDelivery(this.nodePath(e)))}listBashJobs(e){return this.request("GET",r.nodeJobs(this.nodePath(e)))}stopBashJob(e,t){return this.request("DELETE",r.nodeJob(this.nodePath(e),this.jobPath(t)))}sendMessage(e,t){return this.request("POST",r.nodeMessages(this.nodePath(e)),t)}interruptNode(e){return this.request("POST",r.nodeInterrupt(this.nodePath(e)),{})}pushReport(e,t){return this.request("POST",r.nodeReports(this.nodePath(e)),t)}submitResult(e,t){return this.request("POST",r.nodeResult(this.nodePath(e)),t)}forkNode(e){return this.request("POST",r.nodeFork(this.nodePath(e)),{})}reviveNode(e,t){return this.request("POST",r.nodeRevive(this.nodePath(e)),t??{})}relaunchRoot(e){return this.request("POST",r.nodeRelaunchRoot(this.nodePath(e)),{})}bindBrokerSession(e,t){return this.request("POST",r.nodeBrokerSessionBound(this.nodePath(e)),t)}settleBroker(e,t){return this.request("POST",r.nodeBrokerSettle(this.nodePath(e)),t)}completeBrokerPark(e,t){return this.request("POST",r.nodeBrokerParkComplete(this.nodePath(e)),t)}recordBrokerParkActivity(e,t){return this.request("POST",r.nodeBrokerParkActivity(this.nodePath(e)),t)}async recordBrokerTelemetry(e,t){await this.request("POST",r.nodeBrokerTelemetry(this.nodePath(e)),t)}claimNodeMail(e,t){return this.request("POST",r.nodeMailClaim(this.nodePath(e)),t)}acknowledgeNodeMail(e,t){return this.request("POST",r.nodeMailAcknowledge(this.nodePath(e)),t)}recordBrokerTurn(e,t){return this.request("POST",r.brokerTurn(this.nodePath(e)),t)}mutateBrokerProviderRetry(e,t){return this.request("POST",r.brokerProviderRetry(this.nodePath(e)),t)}mutateBrokerFault(e,t){return this.request("POST",r.brokerFault(this.nodePath(e)),t)}getBrokerRecovery(e,t){return this.request("GET",`${r.brokerRecovery(this.nodePath(e))}?expected_execution_id=${encodeURIComponent(t)}`)}recordNodeFault(e,t){return this.request("POST",r.nodeFault(this.nodePath(e)),t)}clearNodeFault(e,t={}){const s=new URLSearchParams;t.link!==void 0&&s.set("link",t.link),t.preserve_episode!==void 0&&s.set("preserve_episode",String(t.preserve_episode));const i=s.size===0?"":`?${s.toString()}`;return this.request("DELETE",`${r.nodeFault(this.nodePath(e))}${i}`)}commitBrokerModel(e,t){return this.request("POST",r.nodeBrokerModel(this.nodePath(e)),t)}brokerExtensionState(e){return this.request("GET",r.nodeBrokerExtensionState(this.nodePath(e)))}brokerContext(e,t){return this.request("POST",r.nodeBrokerContext(this.nodePath(e)),t)}brokerMemoryRefs(e,t){return this.request("POST",r.nodeBrokerMemoryRefs(this.nodePath(e)),{expected_execution_id:t})}commitBrokerContext(e,t){return this.request("POST",r.nodeBrokerContextCommit(this.nodePath(e)),t)}brokerContextEvent(e,t){return this.request("POST",r.nodeBrokerContextEvent(this.nodePath(e)),t)}commitBrokerGeneratedName(e,t){return this.request("POST",r.nodeBrokerGeneratedName(this.nodePath(e)),t)}commitBrokerPersonaAck(e,t){return this.request("POST",r.nodeBrokerPersonaAck(this.nodePath(e)),t)}closeNode(e,t){return this.request("POST",r.nodeClose(this.nodePath(e)),t??{})}recycleNode(e){return this.request("POST",r.nodeRecycle(this.nodePath(e)),{})}demoteNode(e){return this.request("POST",r.nodeDemote(this.nodePath(e)),{})}promoteNode(e,t){return this.request("POST",r.nodePromote(this.nodePath(e)),t)}yieldNode(e,t){return this.request("POST",r.nodeYield(this.nodePath(e)),t)}waitNode(e,t){return this.request("POST",r.nodeWait(this.nodePath(e)),t)}listKinds(){return this.request("GET",r.kinds())}patchConfig(e,t){return this.request("PATCH",r.nodeConfig(this.nodePath(e)),t,t.model!==void 0?{timeout:45e3+this.timeoutMs}:void 0)}closeWorktree(e){return this.request("POST",r.nodeWorktreeClose(this.nodePath(e)),{})}abandonWorktree(e,t){return this.request("POST",r.nodeWorktreeAbandon(this.nodePath(e)),t)}listQuarantinedWorktrees(){return this.request("GET",r.quarantinedWorktrees())}listSpaces(){return this.request("GET",r.spaces())}subscribe(e,t){return this.request("POST",r.nodeSubscriptions(this.nodePath(e)),t)}listFocuses(){return this.request("GET",r.focuses())}focusOf(e){return this.request("GET",o(r.focusByNode(),{node_id:e}))}focusByPane(e){return this.request("GET",o(r.focusByPane(),{pane:e}))}registerFocus(e){return this.request("POST",r.focuses(),e)}async setFocusPane(e,t){await this.request("PATCH",r.focus(e),t)}async closeFocus(e){await this.request("DELETE",r.focus(e))}async unsubscribe(e,t){await this.request("DELETE",r.nodeSubscription(this.nodePath(e),this.nodePath(t)))}armCron(e){return this.request("POST",r.crons(),e)}listCrons(e){return this.request("GET",o(r.crons(),e))}showCron(e,t){return this.request("GET",o(r.cron(this.cronPath(e)),t))}pauseCron(e,t){return this.request("POST",o(r.cronPause(this.cronPath(e)),t),{})}resumeCron(e,t){return this.request("POST",o(r.cronResume(this.cronPath(e)),t),{})}runCron(e,t){return this.request("POST",o(r.cronRun(this.cronPath(e)),t),{})}async cancelCron(e,t){await this.request("DELETE",o(r.cron(this.cronPath(e)),t))}pokeCrons(){return this.request("POST",r.cronsPoke(),{})}ensureAttach(e,t){return this.request("POST",r.nodeAttach(this.nodePath(e)),t??{})}getReports(e,t){return this.request("GET",o(r.nodeReports(this.nodePath(e)),t))}getTranscript(e,t){return this.request("GET",o(r.nodeTranscript(this.nodePath(e)),t))}getSnapshot(e){return this.request("GET",r.nodeSnapshot(this.nodePath(e)))}nodeSubject(e){return this.request("GET",r.nodeSubject(this.nodePath(e)))}getNodeMessages(e,t){return this.request("GET",o(r.nodeMessages(this.nodePath(e)),t))}getSession(e){return this.request("GET",r.nodeSession(this.nodePath(e)))}getChatInventory(e){return this.request("GET",r.nodeChatInventory(this.nodePath(e)))}getProspectiveChatInventory(e){return this.request("GET",o(r.prospectiveChatInventory(),e))}getArtifacts(e,t){return this.request("GET",o(r.nodeArtifacts(this.nodePath(e)),t))}getContext(e){return this.request("GET",r.nodeContext(this.nodePath(e)))}peekFile(e,t,s){return this.request("GET",o(r.filePeek(),{path:e,encoding:t}),void 0,s)}writeFile(e,t,s,i){return this.request("POST",r.fileWrite(),{path:e,content:t,encoding:s},i)}listFiles(e,t,s){return this.request("GET",o(r.fileList(),{path:e,limit:t}),void 0,s)}runBash(e,t){return this.request("POST",r.bash(),e,t)}getMemoryOriginConversation(e){return this.request("GET",o(r.memoryOrigin(),{conversation_id:e}))}resolveMemoryDoc(e,t={}){return this.request("GET",o(r.memoryResolve(),{name:e,...t}))}listMemoryDocs(e){return this.request("GET",o(r.memoryDocs(),e))}getMemoryDoc(e,t){return this.request("GET",o(r.memoryDoc(e),t))}createMemoryDoc(e){return this.request("POST",r.memoryDocs(),e)}updateMemoryDoc(e,t){return this.request("PATCH",r.memoryDoc(e),t)}deleteMemoryDoc(e,t){return this.request("DELETE",o(r.memoryDoc(e),t))}moveMemoryDoc(e,t){return this.request("POST",r.memoryDocMove(e),t)}searchMemoryDocs(e){return this.request("POST",r.memorySearch(),e)}getMemoryHistory(e,t){return this.request("GET",o(r.memoryDocHistory(e),t))}ensureProfile(e,t){return this.request("PUT",r.profile(e),t??{})}createProfile(e){return this.request("POST",r.profiles(),e)}listProfiles(){return this.request("GET",r.profiles())}updateProfile(e,t){return this.request("PATCH",r.profile(e),t)}listProfileEnv(e){return this.request("GET",r.profileEnv(e))}setProfileEnv(e,t,s){return this.request("PUT",r.profileEnvVar(e,t),{value:s})}removeProfileEnv(e,t){return this.request("DELETE",r.profileEnvVar(e,t))}getProfile(e){return this.request("GET",r.profile(e))}pauseProfile(e){return this.request("POST",r.profilePause(e),{})}resumeProfile(e){return this.request("POST",r.profileResume(e),{})}updateProfileMetadata(e,t){return this.request("PATCH",r.profileMetadata(e),t)}deleteProfile(e,t){return this.request("DELETE",r.profile(e),t)}listModelAuth(){return this.request("GET",r.modelAuths())}getModelAuthReadiness(e){return this.request("GET",o(r.modelAuthReadiness(),e))}installCredential(e,t){return this.request("PUT",r.modelAuth(e),t)}removeCredential(e){return this.request("DELETE",r.modelAuth(e))}startModelAuth(e){return this.request("POST",r.modelAuthFlows(),e,{timeout:3e4+this.timeoutMs})}completeModelAuth(e,t){return this.request("POST",r.modelAuthFlowComplete(e),t,{timeout:35e3+this.timeoutMs})}cancelModelAuth(e){return this.request("POST",r.modelAuthFlowCancel(e),{})}getModelAuthFlow(e,t){return this.request("GET",o(r.modelAuthFlow(e),{wait:t}),void 0,{timeout:(t??0)*1e3+this.timeoutMs})}createReview(e){return this.request("POST",r.humanReviews(),e)}listReviews(e){return this.request("GET",o(r.humanReviews(),e))}getReview(e){return this.request("GET",r.humanReview(this.reviewPath(e)))}submitReview(e){return this.request("POST",r.humanReviewSubmit(this.reviewPath(e)),{})}cancelReview(e,t={}){return this.request("POST",r.humanReviewCancel(this.reviewPath(e)),t)}getReviewDocumentBase(e){return this.request("GET",r.humanReviewDocument(this.reviewPath(e)))}createReviewComment(e,t){const s=e===void 0?"self":this.reviewPath(e);return this.request("POST",r.humanReviewComments(s),t)}listReviewComments(e,t){const s=e===void 0?"self":this.reviewPath(e);return this.request("GET",o(r.humanReviewComments(s),t))}readReviewCommentEvents(e,t){return this.request("GET",o(r.humanReviewCommentEvents(this.reviewPath(e)),t))}updateReviewCommentRanges(e,t){return this.request("POST",r.humanReviewCommentRanges(this.reviewPath(e)),t)}getReviewComment(e){return this.request("GET",r.humanComment(this.commentPath(e)))}editReviewComment(e,t){return this.request("POST",r.humanCommentEdit(this.commentPath(e)),t)}resolveReviewComment(e,t={}){return this.request("POST",r.humanCommentResolve(this.commentPath(e)),t)}reopenReviewComment(e,t={}){return this.request("POST",r.humanCommentReopen(this.commentPath(e)),t)}deleteReviewComment(e,t={}){return this.request("POST",r.humanCommentDelete(this.commentPath(e)),t)}forkReviewComment(e){return this.request("POST",r.humanCommentFork(this.commentPath(e)),{})}listHumanInbox(){return this.request("GET",r.humanInbox())}getHumanInboxPage(e){return this.request("GET",r.humanInboxTicket(this.ticketId(e)))}getInboxHistory(e){if(e===void 0)return this.request("GET",r.humanInbox()+"/history");if(typeof e!="string"||e==="")throw new TypeError(`invalid node id: ${JSON.stringify(e)}`);return this.request("GET",o(r.humanInbox()+"/history",{node_id:e}))}respondHumanInboxPage(e,t){return this.request("POST",r.humanInboxRespond(this.ticketId(e)),t)}postInboxProgress(e,t){return this.request("POST",r.humanInboxProgress(this.ticketId(e)),{responses:t})}getInboxResponse(e){return this.request("GET",r.humanInboxResponse(this.ticketId(e)))}cancelHumanInboxTicket(e,t){return this.request("POST",r.humanInboxCancel(this.ticketId(e)),t??{})}createHumanRequest(e){return this.request("POST",r.humanRequests(),e)}listPageComponents(){return this.request("GET",r.humanComponents())}getHumanRequest(e){return this.request("GET",r.humanRequest(this.requestPath(e)))}replaceHumanRequest(e,t){return this.request("POST",r.humanRequestReplace(this.requestPath(e)),t)}respondHumanRequest(e,t){return this.request("POST",r.humanRequestRespond(this.requestPath(e)),t)}dismissHumanRequest(e,t={}){return this.request("POST",r.humanRequestDismiss(this.requestPath(e)),t)}cancelHumanRequest(e,t={}){return this.request("POST",r.humanRequestCancel(this.requestPath(e)),t)}resolvePageFeedbackComment(e,t,s){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(t))throw new TypeError(`invalid feedback comment id: ${JSON.stringify(t)}`);return this.request("POST",r.humanInboxFeedbackResolve(this.ticketId(e),t),{node_id:s})}async dashboard(e){const t=e?.under!==void 0?{under:e.under}:void 0,[s,i]=await Promise.all([this.listNodes(t),this.status()]);return{nodes:s,counts:i.node_counts,generated_at:new Date().toISOString()}}attention(){return this.request("GET",r.canvasAttention())}attentionCounts(e){const t={node_ids:e};return this.request("POST",r.canvasAttentionCounts(),t)}historySearch(e){return this.request("POST",r.canvasHistorySearch(),e)}historyGrep(e){return this.request("POST",r.canvasHistoryGrep(),e)}historyRead(e){return this.request("GET",o(r.canvasHistoryRead(),e))}historyStats(e){return this.request("POST",r.canvasHistoryStats(),e)}canvasSnapshot(){return this.request("GET",r.canvasSnapshot())}analytics(e){return this.request("GET",o(r.canvasAnalytics(),e),void 0,{timeout:6e4})}async recordMemoryReads(e,t){await this.request("POST",r.nodeMemoryReads(this.nodePath(e)),t)}canvasRoster(){return this.request("GET",r.canvasRoster())}canvasGraph(){return this.request("GET",r.canvasGraph())}prune(e){return this.request("POST",r.canvasPrune(),e)}async request(e,t,s,i){try{return await p(await this.send(e,t,s,i))}catch(a){throw T(a,i?.signal)}}async send(e,t,s,i={}){const a=e==="GET"||e==="HEAD"||e==="DELETE",P=i.maxRetries??this.maxRetries;for(let l=0;;l++){let u;try{u=await this.transport(e,t,s,i)}catch(c){if(this.isColdSocketError(c))try{await this.handleColdSocket(c),u=await this.transport(e,t,s,i)}catch(m){throw T(m,i.signal)}else{if(this.isInterruptedSocketError(c)&&this.localSocketTransport&&(!a||l<P))return await this.rideOutInterruptedRequest(e,t,s,i);if(a&&l<P&&!N(c,i.signal)&&(!this.localSocketTransport||!this.isInterruptedSocketError(c))){await w(O(l+1));continue}else throw T(c,i.signal)}}if(a&&l<P&&x(u.status)){await v(u),await w(O(l+1));continue}return u}}nodePath(e){if(!E(e))throw new h(400,"invalid_node_id",`invalid node id: ${JSON.stringify(e)}`);return e}jobPath(e){if(!R(e))throw new h(400,"invalid_job_id",`invalid background job id: ${JSON.stringify(e)}`);return e}cronPath(e){if(!k(e))throw new h(400,"invalid_cron_id",`invalid cron id: ${JSON.stringify(e)}`);return e}requestPath(e){if(!E(e))throw new h(400,"invalid_request_id",`invalid request id: ${JSON.stringify(e)}`);return e}ticketId(e){if(!/^[a-f0-9]{64}$/.test(e))throw new TypeError(`invalid inbox ticket id: ${JSON.stringify(e)}`);return e}reviewPath(e){if(!E(e))throw new h(400,"invalid_review_id",`invalid review id: ${JSON.stringify(e)}`);return e}commentPath(e){if(!/^[a-f0-9]{32}$/.test(e))throw new h(400,"invalid_comment_id",`invalid comment id: ${JSON.stringify(e)}`);return e}transport(e,t,s,i={}){const a=s===void 0?void 0:JSON.stringify(s),P={accept:"application/json",...this.headers,...i.headers};a!==void 0&&(P["content-type"]="application/json");const l=i.timeout??this.timeoutMs,u=new AbortController,c=l>0?setTimeout(()=>u.abort(new DOMException("request timed out","TimeoutError")),l):void 0,m=i.signal,f=d(()=>u.abort(m?.reason),"onExternalAbort");m!==void 0&&(m.aborted?u.abort(m.reason):m.addEventListener("abort",f,{once:!0}));const y=d(()=>{c!==void 0&&clearTimeout(c),m?.removeEventListener("abort",f)},"finish");return this.fetch(new URL(t,this.baseUrl),{method:e,headers:P,body:a,signal:u.signal}).then(q=>this.retainRequestLifetime(q,y,()=>u.signal.aborted?u.signal.reason:void 0),q=>{throw y(),q})}retainRequestLifetime(e,t,s){if(e.body===null)return t(),e;const i=e.body.getReader();let a=!1;const P=d(()=>{a||(a=!0,t())},"close"),l=new ReadableStream({async pull(u){try{const{done:c,value:m}=await i.read();c?(P(),u.close()):u.enqueue(m)}catch(c){P(),u.error(s()??c)}},async cancel(u){P(),await i.cancel(u)}});return new Response(l,{status:e.status,statusText:e.statusText,headers:e.headers})}isColdSocketError(e){const t=S(e);return t==="ECONNREFUSED"||t==="ENOENT"||t==="ENOTSOCK"}isInterruptedSocketError(e){const t=S(e);return t==="ECONNRESET"||t==="EPIPE"}async rideOutInterruptedRequest(e,t,s,i={}){try{await this.awaitAvailability()}catch(a){throw T(a,i.signal)}if(e!=="GET"&&e!=="HEAD")throw new h(503,"daemon_request_interrupted",`crtrd connection ended before this ${e} response; the request may or may not have been applied.`);try{return await this.transport(e,t,s,i)}catch(a){throw T(a,i.signal)}}async awaitAvailability(e){await _({windowMs:this.coldStartPollWindowMs,initialError:e,probe:d(async t=>{const s=await this.transport("GET",r.healthz(),void 0,{timeout:t});if(s.status>=200&&s.status<300){await v(s);return}const i=await s.text();try{if(typeof JSON.parse(i).startup_blocked=="string")return}catch{}throw new h(s.status,"daemon_health_unavailable",`crtrd health check returned HTTP ${s.status}: ${i.slice(0,500)}`)},"probe")})}async handleColdSocket(e){const t=this.autostart&&this.onColdSocket!==void 0&&!this.coldStartAttempted;t&&(this.coldStartAttempted=!0,await this.onColdSocket());try{await this.awaitAvailability(e)}catch(s){if(t){const i=A(this.coldStartDiagnostic);if(i!==void 0){const a=T(s);throw new h(a.status,a.code,`${a.message}
|
|
2
|
+
${i}`)}}throw s}}}function o(n,e){if(e===void 0)return n;const t=new URLSearchParams;for(const[i,a]of Object.entries(e))a!=null&&t.set(i,String(a));const s=t.toString();return s===""?n:`${n}?${s}`}d(o,"withQuery");async function p(n){const e=n.status>=200&&n.status<300,t=(await n.text()).trim();let s;if(t!=="")try{s=JSON.parse(t)}catch{if(e)return;throw new h(n.status,"invalid_response",t.slice(0,500),void 0,n.headers)}if(e)return s;throw b(s)?new h(n.status,s.error.code,s.error.message,s.error.details,n.headers,s.error):new h(n.status,"internal",`request failed with status ${n.status}`,void 0,n.headers)}d(p,"parse");function x(n){return n===429||n>=500}d(x,"isRetryableStatus");async function v(n){try{await n.body?.cancel()}catch{}}d(v,"drainResponseBody");function O(n){return Math.min(2e3,250*2**(n-1))}d(O,"retryDelayMs");function S(n){if(typeof n!="object"||n===null)return;const e=n.code;if(typeof e=="string")return e;const t=n.cause;if(typeof t=="object"&&t!==null){const s=t.code;if(typeof s=="string")return s}}d(S,"transportErrorCode");function N(n,e){return e?.aborted?!0:n instanceof DOMException&&(n.name==="AbortError"||n.name==="TimeoutError")}d(N,"isAbortError");function T(n,e){if(e?.aborted)return new h(0,"request_aborted","request aborted by caller signal");if(n instanceof h)return n;if(n instanceof DOMException&&n.name==="TimeoutError")return new h(504,"request_timeout",`crtrd request timed out: ${n.message}`);if(n instanceof DOMException&&n.name==="AbortError")return new h(0,"request_aborted","request aborted by caller signal");const t=S(n),s=n instanceof Error?n.message:String(n);return t==="ECONNREFUSED"||t==="ENOENT"||t==="ENOTSOCK"?new h(503,"daemon_unavailable",`crtrd is not reachable: ${s}`):t==="ETIMEDOUT"?new h(504,"request_timeout",`crtrd request timed out: ${s}`):new h(503,"transport_error",s)}d(T,"toTransportApiError");function w(n){return new Promise(e=>setTimeout(e,n))}d(w,"sleepMs");function A(n){if(n!==void 0)try{return n()}catch{return}}d(A,"safeColdStartDiagnostic");export{U as CrtrClient,A as safeColdStartDiagnostic,_ as waitForDaemonAvailability};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
export type AnalyticsWindow = '24h' | '7d';
|
|
2
|
+
export interface AnalyticsQuery {
|
|
3
|
+
as_of: string;
|
|
4
|
+
window: AnalyticsWindow;
|
|
5
|
+
project?: string;
|
|
6
|
+
}
|
|
7
|
+
export type MeasureDTO<T> = {
|
|
8
|
+
ok: true;
|
|
9
|
+
value: T;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
reason: string;
|
|
13
|
+
};
|
|
14
|
+
export interface AnalyticsDTO {
|
|
15
|
+
as_of: string;
|
|
16
|
+
window_start: string;
|
|
17
|
+
window: AnalyticsWindow;
|
|
18
|
+
project: string | null;
|
|
19
|
+
projects: Array<{
|
|
20
|
+
cwd: string;
|
|
21
|
+
api_price_estimate: number;
|
|
22
|
+
}>;
|
|
23
|
+
transcripts: {
|
|
24
|
+
total: number;
|
|
25
|
+
read: number;
|
|
26
|
+
unreadable: Array<{
|
|
27
|
+
node_id: string;
|
|
28
|
+
reason: 'file missing' | 'unreadable' | 'parse error';
|
|
29
|
+
}>;
|
|
30
|
+
} | null;
|
|
31
|
+
unknown_responses: number | null;
|
|
32
|
+
oldest_agent_created: string | null;
|
|
33
|
+
memory_log_started_at: string | null;
|
|
34
|
+
agents: AgentRowDTO[];
|
|
35
|
+
graphs: MeasureDTO<GraphsDTO>;
|
|
36
|
+
time: MeasureDTO<TimeDTO>;
|
|
37
|
+
usage: MeasureDTO<UsageDTO>;
|
|
38
|
+
memory: MeasureDTO<{
|
|
39
|
+
read: MemoryViewDTO;
|
|
40
|
+
loaded: MemoryViewDTO;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export interface AgentRowDTO {
|
|
44
|
+
node_id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
kind: string;
|
|
47
|
+
graph_id: string;
|
|
48
|
+
in_graph_detail: boolean;
|
|
49
|
+
parent: string | null;
|
|
50
|
+
depth: number;
|
|
51
|
+
created: string;
|
|
52
|
+
finalized_at: string | null;
|
|
53
|
+
lifecycle: 'resident' | 'terminal';
|
|
54
|
+
active: boolean;
|
|
55
|
+
spawned_in_window: boolean;
|
|
56
|
+
finished_in_window: boolean;
|
|
57
|
+
agent_time_ms: number | null;
|
|
58
|
+
api_price_estimate: number;
|
|
59
|
+
tokens: number;
|
|
60
|
+
responses: number;
|
|
61
|
+
response_times_ms: number[];
|
|
62
|
+
final_report_ref: string | null;
|
|
63
|
+
}
|
|
64
|
+
export interface GraphRowDTO {
|
|
65
|
+
graph_id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
root_deleted: boolean;
|
|
68
|
+
cwd: string;
|
|
69
|
+
root_kind: string;
|
|
70
|
+
root_lifecycle: 'resident' | 'terminal';
|
|
71
|
+
root_created: string;
|
|
72
|
+
active_agents: number;
|
|
73
|
+
depth: number;
|
|
74
|
+
api_price_estimate: number;
|
|
75
|
+
tokens: number;
|
|
76
|
+
spawned_kinds: string[];
|
|
77
|
+
}
|
|
78
|
+
export interface GraphsDTO {
|
|
79
|
+
count: number;
|
|
80
|
+
spawned: number;
|
|
81
|
+
deepest: number;
|
|
82
|
+
graphs: GraphRowDTO[];
|
|
83
|
+
size_buckets: Array<{
|
|
84
|
+
label: '1' | '2–5' | '6–10' | '11–20' | '21+';
|
|
85
|
+
graphs: number;
|
|
86
|
+
}>;
|
|
87
|
+
spawned_by_kind: Array<{
|
|
88
|
+
kind: string;
|
|
89
|
+
agents: number;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
export interface DurationStatsDTO {
|
|
93
|
+
count: number;
|
|
94
|
+
p10_ms: number;
|
|
95
|
+
median_ms: number;
|
|
96
|
+
p90_ms: number;
|
|
97
|
+
max_ms: number;
|
|
98
|
+
}
|
|
99
|
+
export interface TimeDTO {
|
|
100
|
+
all: DurationStatsDTO | null;
|
|
101
|
+
by_kind: Array<{
|
|
102
|
+
kind: string;
|
|
103
|
+
} & DurationStatsDTO>;
|
|
104
|
+
activity: {
|
|
105
|
+
bucket_ms: number;
|
|
106
|
+
buckets: Array<{
|
|
107
|
+
start: string;
|
|
108
|
+
agents: number;
|
|
109
|
+
}>;
|
|
110
|
+
max: number;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export interface ModelKeyDTO {
|
|
114
|
+
provider: string;
|
|
115
|
+
model: string;
|
|
116
|
+
}
|
|
117
|
+
export interface ModelRowDTO extends ModelKeyDTO {
|
|
118
|
+
responses: number;
|
|
119
|
+
api_price_estimate: number;
|
|
120
|
+
tokens: number;
|
|
121
|
+
tokens_by_type: {
|
|
122
|
+
cache_read: number;
|
|
123
|
+
cache_write: number;
|
|
124
|
+
input: number;
|
|
125
|
+
output: number;
|
|
126
|
+
};
|
|
127
|
+
cache_read_share: number;
|
|
128
|
+
context: {
|
|
129
|
+
median: number;
|
|
130
|
+
p90: number;
|
|
131
|
+
max: number;
|
|
132
|
+
buckets: [number, number, number, number, number];
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
export interface UsageDTO {
|
|
136
|
+
api_price_estimate: number;
|
|
137
|
+
tokens: number;
|
|
138
|
+
median_context: number | null;
|
|
139
|
+
models: ModelRowDTO[];
|
|
140
|
+
legend: ModelKeyDTO[];
|
|
141
|
+
kinds: Array<{
|
|
142
|
+
kind: string;
|
|
143
|
+
api_price_estimate: number;
|
|
144
|
+
tokens: number;
|
|
145
|
+
responses_by_model: Array<ModelKeyDTO & {
|
|
146
|
+
responses: number;
|
|
147
|
+
}>;
|
|
148
|
+
}>;
|
|
149
|
+
}
|
|
150
|
+
export interface MemoryDocRowDTO {
|
|
151
|
+
name: string;
|
|
152
|
+
scope: string;
|
|
153
|
+
reads: number;
|
|
154
|
+
agents: number;
|
|
155
|
+
graphs: number;
|
|
156
|
+
readers_by_kind: Array<{
|
|
157
|
+
kind: string;
|
|
158
|
+
agents: number;
|
|
159
|
+
}>;
|
|
160
|
+
readers: Array<{
|
|
161
|
+
node_id: string;
|
|
162
|
+
kind: string;
|
|
163
|
+
name: string;
|
|
164
|
+
graph_id: string;
|
|
165
|
+
reads: number;
|
|
166
|
+
first_at: string;
|
|
167
|
+
}>;
|
|
168
|
+
}
|
|
169
|
+
export interface MemoryViewDTO {
|
|
170
|
+
entries: number;
|
|
171
|
+
documents: number;
|
|
172
|
+
agents_with_entry: number;
|
|
173
|
+
active_agents: number;
|
|
174
|
+
rows: MemoryDocRowDTO[];
|
|
175
|
+
}
|
|
176
|
+
export interface MemoryReadEventDTO {
|
|
177
|
+
name: string;
|
|
178
|
+
scope: string;
|
|
179
|
+
at: string;
|
|
180
|
+
type: 'read' | 'loaded';
|
|
181
|
+
}
|
|
182
|
+
export interface MemoryReadsRequestDTO {
|
|
183
|
+
events: MemoryReadEventDTO[];
|
|
184
|
+
}
|
|
File without changes
|
|
@@ -62,7 +62,11 @@ export interface BrokerParkCompleteRequest extends BrokerExecutionRequest {
|
|
|
62
62
|
/** Durable model recipe selected by the live broker after Pi accepts a model or thinking change. */
|
|
63
63
|
export interface BrokerModelCommitRequest extends BrokerExecutionRequest {
|
|
64
64
|
spec: string;
|
|
65
|
-
|
|
65
|
+
/** Portable routing contract for a user-selected change; absent means exact. */
|
|
66
|
+
intent?: {
|
|
67
|
+
family: string;
|
|
68
|
+
strength: 'ultra' | 'strong' | 'medium' | 'light';
|
|
69
|
+
};
|
|
66
70
|
userSelected: boolean;
|
|
67
71
|
}
|
|
68
72
|
export interface BrokerModelCommitResultDTO {
|
|
@@ -72,6 +76,7 @@ export interface BrokerModelCommitResultDTO {
|
|
|
72
76
|
* render their local Pi hooks without reading canvas.db themselves. */
|
|
73
77
|
export interface BrokerExtensionNodeDTO {
|
|
74
78
|
node_id: string;
|
|
79
|
+
grantee: string;
|
|
75
80
|
name: string;
|
|
76
81
|
description?: string;
|
|
77
82
|
title?: string;
|
|
@@ -114,6 +119,7 @@ export type BrokerExtensionSubjectDTO = NodeSubjectDTO;
|
|
|
114
119
|
* data; this daemon projection supplies only existence and display metadata. */
|
|
115
120
|
export interface BrokerReportNodeDTO {
|
|
116
121
|
node_id: string;
|
|
122
|
+
grantee: string;
|
|
117
123
|
name: string;
|
|
118
124
|
created: string;
|
|
119
125
|
}
|
|
@@ -128,6 +134,42 @@ export interface BrokerExtensionStateDTO {
|
|
|
128
134
|
subject: BrokerExtensionSubjectDTO;
|
|
129
135
|
report_nodes: BrokerReportNodeDTO[];
|
|
130
136
|
}
|
|
137
|
+
/** Memory-bearing context is rendered by crtrd, not by a sandboxed broker. */
|
|
138
|
+
export interface BrokerContextSnapshotDTO {
|
|
139
|
+
preferenceSnapshot: string | null;
|
|
140
|
+
exposures: Record<string, {
|
|
141
|
+
system?: number;
|
|
142
|
+
transcript?: number;
|
|
143
|
+
}>;
|
|
144
|
+
}
|
|
145
|
+
export interface BrokerContextRequest extends BrokerExecutionRequest {
|
|
146
|
+
mode: 'baseline' | 'compact' | 'preferences';
|
|
147
|
+
}
|
|
148
|
+
/** One full document body that entered the context: a `loaded` memory-log event. */
|
|
149
|
+
export interface BrokerContextLoadDTO {
|
|
150
|
+
name: string;
|
|
151
|
+
scope: string;
|
|
152
|
+
}
|
|
153
|
+
export interface BrokerContextDTO {
|
|
154
|
+
content: string;
|
|
155
|
+
compact: boolean;
|
|
156
|
+
snapshot: BrokerContextSnapshotDTO;
|
|
157
|
+
/** Full bodies this preparation delivers; the broker returns them with the commit. */
|
|
158
|
+
loads: BrokerContextLoadDTO[];
|
|
159
|
+
}
|
|
160
|
+
export interface BrokerMemoryRefsDTO {
|
|
161
|
+
refs: import('../../core/runtime/broker-protocol.js').RefMeta[];
|
|
162
|
+
names: string[];
|
|
163
|
+
}
|
|
164
|
+
export interface BrokerContextCommitRequest extends BrokerExecutionRequest {
|
|
165
|
+
snapshot: BrokerContextSnapshotDTO;
|
|
166
|
+
/** The prepared `loads` once the broker has delivered them; recorded as `loaded` events. */
|
|
167
|
+
loads?: BrokerContextLoadDTO[];
|
|
168
|
+
}
|
|
169
|
+
export interface BrokerContextEventRequest extends BrokerExecutionRequest {
|
|
170
|
+
event: 'read' | 'command' | 'pre-command' | 'compact' | 'persona';
|
|
171
|
+
value?: string;
|
|
172
|
+
}
|
|
131
173
|
/** Guarded generated-label update. `initial` can only fill a blank generated
|
|
132
174
|
* description; `recap` additionally compares the exact automatic-name snapshot
|
|
133
175
|
* captured before the headless naming call. */
|
package/dist/api/dto/config.d.ts
CHANGED
|
@@ -19,3 +19,14 @@ export interface NodeConfigPatch {
|
|
|
19
19
|
/** Per-run allow-list. A patch may only remove scopes; it applies to a live broker on its next revive. */
|
|
20
20
|
scopes?: string[];
|
|
21
21
|
}
|
|
22
|
+
/** One installed persona kind, as the daemon resolves kinds for node creation. */
|
|
23
|
+
export interface KindDTO {
|
|
24
|
+
kind: string;
|
|
25
|
+
when_to_use: string | null;
|
|
26
|
+
/** Top-level kinds a sub-kind is offered to; null takes the default (its own ancestor). */
|
|
27
|
+
available_to: string[] | null;
|
|
28
|
+
}
|
|
29
|
+
/** `GET /v1/kinds` — every kind the daemon accepts on create, sorted by name. */
|
|
30
|
+
export interface KindListDTO {
|
|
31
|
+
kinds: KindDTO[];
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface GrantGetDTO {
|
|
2
|
+
sub: string;
|
|
3
|
+
grantee: string;
|
|
4
|
+
client_id: string;
|
|
5
|
+
grant: string;
|
|
6
|
+
exp: number;
|
|
7
|
+
rev: number;
|
|
8
|
+
resolved_scopes: {
|
|
9
|
+
scope: string;
|
|
10
|
+
mode: 'always' | 'ask';
|
|
11
|
+
}[];
|
|
12
|
+
spend_cap: number | null;
|
|
13
|
+
payer: 'user';
|
|
14
|
+
}
|
|
File without changes
|
|
@@ -97,3 +97,17 @@ export interface SettleHumanRequestRequest {
|
|
|
97
97
|
reason?: string;
|
|
98
98
|
actor?: string;
|
|
99
99
|
}
|
|
100
|
+
/** One product page component registered by config or an enabled plugin. */
|
|
101
|
+
export interface PageComponentDTO {
|
|
102
|
+
kind: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
useWhen?: string;
|
|
105
|
+
doc?: string;
|
|
106
|
+
/** A display-only product slot contributes no page response. */
|
|
107
|
+
display?: boolean;
|
|
108
|
+
}
|
|
109
|
+
/** `GET /v1/human/components` — the product page components the runtime's
|
|
110
|
+
* config and enabled plugins register, merged in precedence order. */
|
|
111
|
+
export interface PageComponentListDTO {
|
|
112
|
+
components: PageComponentDTO[];
|
|
113
|
+
}
|
package/dist/api/dto/memory.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export declare const MEMORY_SCOPES: readonly ["node", "project", "profile", "use
|
|
|
2
2
|
export type MemoryScopeName = typeof MEMORY_SCOPES[number];
|
|
3
3
|
/** A canonical document address: slash-joined safe segments, carried as one percent-encoded path segment. */
|
|
4
4
|
export declare function isMemoryDocName(name: string): boolean;
|
|
5
|
+
export interface MemoryOriginConversationDTO {
|
|
6
|
+
session_file: string;
|
|
7
|
+
}
|
|
5
8
|
export interface MemoryScope {
|
|
6
9
|
node?: string;
|
|
7
10
|
cwd?: string;
|
|
@@ -12,6 +15,7 @@ export interface MemoryDocSummaryDTO {
|
|
|
12
15
|
name: string;
|
|
13
16
|
short_form: string;
|
|
14
17
|
kind: string;
|
|
18
|
+
privacy: 'public' | 'friends' | 'private';
|
|
15
19
|
scope: MemoryScopeName;
|
|
16
20
|
extensions: Record<string, Record<string, string | boolean | number>>;
|
|
17
21
|
path: string;
|
|
@@ -95,6 +99,7 @@ export type MemorySearchHitDTO = MemoryRankedSearchHitDTO | MemoryGrepSearchHitD
|
|
|
95
99
|
export interface MemoryRankedSearchHitDTO {
|
|
96
100
|
name: string;
|
|
97
101
|
kind: string;
|
|
102
|
+
privacy: 'public' | 'friends' | 'private';
|
|
98
103
|
scope: MemoryScopeName;
|
|
99
104
|
score: number;
|
|
100
105
|
short_form: string;
|
|
@@ -105,6 +110,7 @@ export interface MemoryRankedSearchHitDTO {
|
|
|
105
110
|
}
|
|
106
111
|
export interface MemoryGrepSearchHitDTO {
|
|
107
112
|
name: string;
|
|
113
|
+
privacy: 'public' | 'friends' | 'private';
|
|
108
114
|
scope: MemoryScopeName;
|
|
109
115
|
line: number;
|
|
110
116
|
text: string;
|