@north-light/cli 0.3.561 → 0.3.563
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/client.d.ts +27 -4
- package/dist/api/client.js +3 -3
- package/dist/api/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/api/dto/bash-jobs.d.ts +5 -1
- package/dist/api/dto/broker-ops.d.ts +25 -1
- package/dist/api/dto/charges.d.ts +9 -2
- package/dist/api/dto/delivery.d.ts +26 -2
- package/dist/api/dto/execution-start.d.ts +57 -0
- package/dist/api/dto/execution-start.js +0 -0
- package/dist/api/dto/modelauth.d.ts +5 -0
- package/dist/api/dto/node-records.d.ts +16 -0
- package/dist/api/dto/objects.d.ts +1 -1
- package/dist/api/dto/reports.d.ts +0 -3
- package/dist/api/dto/run-events.d.ts +7 -1
- package/dist/api/dto/settings.d.ts +55 -0
- package/dist/api/dto/settings.js +0 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +1 -1
- package/dist/api/routes.d.ts +11 -0
- package/dist/api/routes.js +1 -1
- package/dist/build-root.d.ts +1 -0
- package/dist/build-root.js +1 -1
- package/dist/builtin-memory/crouter-sdk/release-notes.md +4 -0
- package/dist/cli.js +7 -7
- package/dist/clients/attach/chrome/bash-jobs.d.ts +11 -1
- package/dist/clients/attach/chrome/bash-jobs.js +1 -1
- package/dist/clients/attach/chrome/canvas-panels.d.ts +1 -1
- package/dist/clients/attach/chrome/roster.js +6 -4
- package/dist/clients/attach/overlays/auth.js +2 -2
- package/dist/clients/attach/render/chat-view.js +1 -1
- package/dist/clients/attach/viewer.js +550 -567
- package/dist/commands/canvas-config.js +2 -2
- package/dist/commands/canvas-use.js +1 -1
- package/dist/commands/human.js +2 -2
- package/dist/commands/node/bash.js +3 -3
- package/dist/commands/node/create.js +2 -2
- package/dist/commands/person-settings.d.ts +1 -0
- package/dist/commands/person-settings.js +1 -0
- package/dist/commands/pkg/market-manage.d.ts +2 -2
- package/dist/commands/pkg/market-manage.js +1 -1
- package/dist/commands/pkg/plugin-manage.js +13 -13
- package/dist/commands/pkg/shared.js +1 -1
- package/dist/commands/profile/default.js +1 -1
- package/dist/commands/push.js +2 -3
- package/dist/commands/sys/config.js +1 -1
- package/dist/commands/sys/connect.js +1 -1
- package/dist/commands/sys/context/sysprompt.js +2 -2
- package/dist/commands/sys/doctor.js +1 -1
- package/dist/commands/sys/join.js +1 -1
- package/dist/commands/sys/panels/broker-limits-panel.js +1 -1
- package/dist/commands/sys/panels/keybindings-panel.js +1 -1
- package/dist/commands/sys/panels/models-panel.d.ts +8 -2
- package/dist/commands/sys/panels/models-panel.js +1 -1
- package/dist/commands/sys/panels/prefs-panel.d.ts +1 -0
- package/dist/commands/sys/panels/prefs-panel.js +1 -1
- package/dist/commands/sys/panels/profiles-panel.js +1 -1
- package/dist/commands/sys/panels/provider-panel.d.ts +4 -0
- package/dist/commands/sys/panels/provider-panel.js +1 -1
- package/dist/commands/sys/provider-login.js +5 -5
- package/dist/commands/sys/setup-core.js +3 -3
- package/dist/commands/sys/setup-settings-runner.js +1 -1
- package/dist/commands/sys/spend.js +3 -3
- package/dist/commands/sys/update.js +1 -1
- package/dist/core/auth-file.d.ts +11 -19
- package/dist/core/auth-file.js +1 -2
- package/dist/core/auto-update.d.ts +1 -1
- package/dist/core/auto-update.js +4 -4
- package/dist/core/bash-jobs.d.ts +29 -71
- package/dist/core/bash-jobs.js +9 -10
- package/dist/core/blobs/directory.d.ts +3 -0
- package/dist/core/blobs/directory.js +1 -0
- package/dist/core/blobs/fault.d.ts +3 -0
- package/dist/core/blobs/fault.js +1 -0
- package/dist/core/blobs/index.d.ts +21 -0
- package/dist/core/blobs/index.js +1 -0
- package/dist/core/blobs/r2.d.ts +9 -0
- package/dist/core/blobs/r2.js +4 -0
- package/dist/core/bootstrap.d.ts +1 -1
- package/dist/core/bootstrap.js +2 -2
- package/dist/core/canvas/canvas.d.ts +9 -7
- package/dist/core/canvas/canvas.js +8 -8
- package/dist/core/canvas/crons.d.ts +3 -2
- package/dist/core/canvas/crons.js +3 -3
- package/dist/core/canvas/daemon-owner.d.ts +5 -0
- package/dist/core/canvas/daemon-owner.js +1 -1
- package/dist/core/canvas/db.d.ts +10 -9
- package/dist/core/canvas/db.js +4 -4
- package/dist/core/canvas/executions.d.ts +100 -4
- package/dist/core/canvas/executions.js +1 -1
- package/dist/core/canvas/export-sqlite.js +1 -1
- package/dist/core/canvas/focuses.d.ts +4 -0
- package/dist/core/canvas/focuses.js +1 -1
- package/dist/core/canvas/history.js +9 -9
- package/dist/core/canvas/managed-worktree-sweep-candidates.d.ts +2 -1
- package/dist/core/canvas/managed-worktree-sweep-candidates.js +3 -2
- package/dist/core/canvas/node-tokens.d.ts +1 -4
- package/dist/core/canvas/node-tokens.js +3 -3
- package/dist/core/canvas/paths.d.ts +0 -1
- package/dist/core/canvas/paths.js +1 -1
- package/dist/core/canvas/person-state.d.ts +26 -0
- package/dist/core/canvas/person-state.js +1 -0
- package/dist/core/canvas/person.d.ts +3 -10
- package/dist/core/canvas/person.js +7 -7
- package/dist/core/canvas/reconciler-leases.d.ts +12 -0
- package/dist/core/canvas/reconciler-leases.js +8 -0
- package/dist/core/canvas/recovery.d.ts +4 -0
- package/dist/core/canvas/recovery.js +1 -1
- package/dist/core/canvas/schema-pg/003-fleet-removals.sql +1 -1
- package/dist/core/canvas/schema-pg/005-fleet-blobs.sql +13 -0
- package/dist/core/canvas/schema-pg/006-job-rows.sql +20 -0
- package/dist/core/canvas/schema-pg/007-ledger-check.sql +117 -0
- package/dist/core/canvas/schema-version.d.ts +1 -1
- package/dist/core/canvas/schema-version.js +1 -1
- package/dist/core/canvas/sessions.d.ts +8 -11
- package/dist/core/canvas/sessions.js +1 -4
- package/dist/core/canvas/tree.d.ts +4 -2
- package/dist/core/canvas/tree.js +6 -6
- package/dist/core/canvas/types.d.ts +7 -0
- package/dist/core/command-hooks/transport/exec-lifecycle.js +1 -1
- package/dist/core/command-plugins/bundle.d.ts +1 -1
- package/dist/core/command-plugins/bundle.js +1 -1
- package/dist/core/command-plugins/compose.d.ts +1 -1
- package/dist/core/command-plugins/discovery.d.ts +0 -1
- package/dist/core/command-plugins/discovery.js +1 -1
- package/dist/core/command-plugins/help-addenda.js +1 -1
- package/dist/core/command-plugins/presence.d.ts +2 -0
- package/dist/core/command-plugins/presence.js +1 -1
- package/dist/core/config.d.ts +16 -15
- package/dist/core/config.js +1 -1
- package/dist/core/conversation-store/client-worker.js +1 -1
- package/dist/core/conversation-store/client.js +2 -2
- package/dist/core/conversation-store/index.d.ts +9 -11
- package/dist/core/conversation-store/index.js +1 -1
- package/dist/core/conversation-store/patch.js +1 -1
- package/dist/core/conversation-store/row-store.d.ts +14 -0
- package/dist/core/conversation-store/row-store.js +13 -0
- package/dist/core/directory/join.d.ts +5 -3
- package/dist/core/directory/join.js +1 -1
- package/dist/core/env-name.d.ts +1 -0
- package/dist/core/env-name.js +1 -1
- package/dist/core/environment-recipe.d.ts +15 -0
- package/dist/core/environment-recipe.js +1 -0
- package/dist/core/environments.js +1 -1
- package/dist/core/events/emit.js +2 -2
- package/dist/core/events/run-event-chunks.d.ts +25 -0
- package/dist/core/events/run-event-chunks.js +5 -0
- package/dist/core/feed/messages.js +5 -5
- package/dist/core/grants/mirror.d.ts +15 -0
- package/dist/core/grants/mirror.js +15 -3
- package/dist/core/grants/on-sync.d.ts +9 -5
- package/dist/core/grants/on-sync.js +1 -1
- package/dist/core/grants/remove.d.ts +1 -6
- package/dist/core/grants/remove.js +1 -1
- package/dist/core/grants/sync.js +1 -1
- package/dist/core/grants/watch.d.ts +15 -9
- package/dist/core/grants/watch.js +1 -1
- package/dist/core/graph/custom.js +8 -8
- package/dist/core/graph/jobs.d.ts +83 -5
- package/dist/core/graph/jobs.js +11 -2
- package/dist/core/graph/kinds/job.js +2 -2
- package/dist/core/graph/names.js +7 -7
- package/dist/core/graph/objects.d.ts +5 -1
- package/dist/core/graph/objects.js +11 -11
- package/dist/core/graph/reader.d.ts +3 -0
- package/dist/core/graph/reader.js +3 -3
- package/dist/core/graph/repo-sync/identity.d.ts +3 -1
- package/dist/core/graph/repo-sync/identity.js +1 -1
- package/dist/core/graph/repo-sync/repos.d.ts +1 -1
- package/dist/core/graph/repo-sync/repos.js +2 -2
- package/dist/core/graph/repo-sync/sync.js +2 -2
- package/dist/core/installed-plugins.js +1 -1
- package/dist/core/keybindings/persistence.d.ts +1 -1
- package/dist/core/keybindings/persistence.js +1 -1
- package/dist/core/layout-migrate/loose-keys.d.ts +1 -1
- package/dist/core/layout-migrate/loose-keys.js +1 -1
- package/dist/core/ledger/account.d.ts +12 -0
- package/dist/core/ledger/account.js +2 -0
- package/dist/core/ledger/charges.d.ts +2 -2
- package/dist/core/ledger/charges.js +1 -1
- package/dist/core/ledger/check.d.ts +5 -1
- package/dist/core/ledger/check.js +1 -7
- package/dist/core/ledger/chunks.d.ts +8 -0
- package/dist/core/ledger/chunks.js +2 -0
- package/dist/core/ledger/index.d.ts +2 -1
- package/dist/core/ledger/index.js +1 -1
- package/dist/core/ledger/infra-allowance.d.ts +9 -0
- package/dist/core/ledger/infra-allowance.js +1 -0
- package/dist/core/ledger/limits.js +3 -3
- package/dist/core/ledger/payer.d.ts +1 -1
- package/dist/core/ledger/payer.js +1 -1
- package/dist/core/ledger/read.d.ts +14 -4
- package/dist/core/ledger/read.js +2 -3
- package/dist/core/ledger/totals.d.ts +5 -16
- package/dist/core/ledger/totals.js +4 -4
- package/dist/core/ledger/types.d.ts +12 -3
- package/dist/core/llm/run.js +2 -2
- package/dist/core/managed-providers.d.ts +72 -0
- package/dist/core/managed-providers.js +1 -0
- package/dist/core/model-auth/api-credential-store.d.ts +10 -0
- package/dist/core/model-auth/api-credential-store.js +1 -0
- package/dist/core/model-auth/daemon-login.d.ts +1 -1
- package/dist/core/model-auth/daemon-login.js +1 -1
- package/dist/core/model-auth/flows.d.ts +5 -4
- package/dist/core/model-auth/flows.js +1 -1
- package/dist/core/model-auth/handoff-jti.d.ts +3 -4
- package/dist/core/model-auth/handoff-jti.js +1 -1
- package/dist/core/model-auth/readiness.js +1 -1
- package/dist/core/model-config.d.ts +1 -1
- package/dist/core/model-config.js +1 -1
- package/dist/core/model-routes-pool.d.ts +14 -0
- package/dist/core/model-routes-pool.js +1 -0
- package/dist/core/model-routes.d.ts +11 -16
- package/dist/core/model-routes.js +1 -1
- package/dist/core/peer/ingest.d.ts +2 -0
- package/dist/core/peer/ingest.js +1 -1
- package/dist/core/peer/stubs.d.ts +8 -0
- package/dist/core/peer/stubs.js +1 -1
- package/dist/core/permissions/evaluator.d.ts +7 -2
- package/dist/core/permissions/evaluator.js +2 -2
- package/dist/core/plugin-env.js +1 -1
- package/dist/core/pool-credential-store.d.ts +2 -5
- package/dist/core/pool-credential-store.js +1 -1
- package/dist/core/profiles/app-env-store.d.ts +5 -5
- package/dist/core/profiles/app-env-store.js +1 -2
- package/dist/core/profiles/default-binding.d.ts +5 -5
- package/dist/core/profiles/default-binding.js +1 -1
- package/dist/core/profiles/env-store.d.ts +10 -21
- package/dist/core/profiles/env-store.js +1 -2
- package/dist/core/profiles/manifest.d.ts +14 -18
- package/dist/core/profiles/manifest.js +1 -1
- package/dist/core/profiles/relocate.js +1 -1
- package/dist/core/profiles/select.js +21 -21
- package/dist/core/provider-credential.d.ts +1 -1
- package/dist/core/provider-credential.js +1 -1
- package/dist/core/provider-management.d.ts +3 -4
- package/dist/core/provider-management.js +1 -1
- package/dist/core/providers/bundles.js +2 -2
- package/dist/core/providers/call.d.ts +3 -34
- package/dist/core/providers/description.d.ts +34 -0
- package/dist/core/providers/description.js +0 -0
- package/dist/core/providers/token-cache.d.ts +14 -14
- package/dist/core/providers/token-cache.js +1 -1
- package/dist/core/review/companion.js +1 -1
- package/dist/core/runs/activity.d.ts +1 -1
- package/dist/core/runs/activity.js +1 -1
- package/dist/core/runs/events.d.ts +7 -5
- package/dist/core/runs/events.js +2 -6
- package/dist/core/runs/operations.d.ts +1 -1
- package/dist/core/runs/operations.js +6 -6
- package/dist/core/runtime/bearings.js +1 -1
- package/dist/core/runtime/broker/attachments-fetch.d.ts +5 -0
- package/dist/core/runtime/broker/attachments-fetch.js +1 -0
- package/dist/core/runtime/broker/bash-job-launch.d.ts +4 -2
- package/dist/core/runtime/broker/bash-job-launch.js +1 -1
- package/dist/core/runtime/broker/boot-state.d.ts +9 -0
- package/dist/core/runtime/broker/boot-state.js +1 -0
- package/dist/core/runtime/broker/cli-relay.d.ts +2 -1
- package/dist/core/runtime/broker/cli-relay.js +1 -1
- package/dist/core/runtime/broker/client-registry.d.ts +3 -3
- package/dist/core/runtime/broker/daemon-ops.d.ts +10 -1
- package/dist/core/runtime/broker/daemon-ops.js +1 -1
- package/dist/core/runtime/broker/fault-retry.d.ts +2 -0
- package/dist/core/runtime/broker/fault-retry.js +1 -1
- package/dist/core/runtime/broker/frame-engine-control.js +1 -1
- package/dist/core/runtime/broker/held-deferred-inbox.d.ts +3 -0
- package/dist/core/runtime/broker/held-deferred-inbox.js +1 -1
- package/dist/core/runtime/broker/job-reporter.d.ts +18 -0
- package/dist/core/runtime/broker/job-reporter.js +2 -0
- package/dist/core/runtime/broker/model-adapter.d.ts +3 -0
- package/dist/core/runtime/broker/model-adapter.js +3 -2
- package/dist/core/runtime/broker/signal-stream.js +1 -1
- package/dist/core/runtime/broker/spilled-body.d.ts +5 -0
- package/dist/core/runtime/broker/spilled-body.js +1 -0
- package/dist/core/runtime/broker/summaries-post.d.ts +5 -0
- package/dist/core/runtime/broker/summaries-post.js +1 -0
- package/dist/core/runtime/broker/tool-groups.d.ts +3 -0
- package/dist/core/runtime/broker/tool-groups.js +1 -1
- package/dist/core/runtime/broker/turn-replies.d.ts +1 -0
- package/dist/core/runtime/broker/turn-replies.js +1 -1
- package/dist/core/runtime/broker-persona-guidance.js +2 -2
- package/dist/core/runtime/broker.js +1 -1
- package/dist/core/runtime/deliver-live.js +1 -1
- package/dist/core/runtime/first-boot-rows.d.ts +8 -0
- package/dist/core/runtime/first-boot-rows.js +2 -0
- package/dist/core/runtime/fleet.d.ts +13 -12
- package/dist/core/runtime/front-door-login.js +1 -1
- package/dist/core/runtime/front-door.js +6 -6
- package/dist/core/runtime/headless-pi.js +1 -1
- package/dist/core/runtime/host.d.ts +14 -3
- package/dist/core/runtime/host.js +3 -3
- package/dist/core/runtime/invocation.d.ts +6 -0
- package/dist/core/runtime/kickoff.d.ts +2 -14
- package/dist/core/runtime/kickoff.js +17 -19
- package/dist/core/runtime/launch-config-worker.js +1 -1
- package/dist/core/runtime/launch.js +2 -2
- package/dist/core/runtime/model-registry.js +1 -1
- package/dist/core/runtime/node-read.d.ts +4 -6
- package/dist/core/runtime/node-read.js +3 -3
- package/dist/core/runtime/nodes.js +1 -1
- package/dist/core/runtime/outcome-document.d.ts +0 -1
- package/dist/core/runtime/outcome-document.js +1 -1
- package/dist/core/runtime/output-result.d.ts +15 -0
- package/dist/core/runtime/output-result.js +5 -0
- package/dist/core/runtime/placement.d.ts +17 -1
- package/dist/core/runtime/placement.js +1 -1
- package/dist/core/runtime/provider-credential-gate.d.ts +6 -2
- package/dist/core/runtime/provider-credential-gate.js +2 -2
- package/dist/core/runtime/recovery-hold.d.ts +21 -2
- package/dist/core/runtime/recovery-hold.js +2 -1
- package/dist/core/runtime/recycle.js +1 -1
- package/dist/core/runtime/reset.js +1 -1
- package/dist/core/runtime/revive.d.ts +2 -2
- package/dist/core/runtime/revive.js +2 -2
- package/dist/core/runtime/runner/blaxel/client.d.ts +81 -0
- package/dist/core/runtime/runner/blaxel/client.js +1 -0
- package/dist/core/runtime/runner/blaxel/image-build.d.ts +74 -0
- package/dist/core/runtime/runner/blaxel/image-build.js +5 -0
- package/dist/core/runtime/runner/blaxel/runner.d.ts +41 -0
- package/dist/core/runtime/runner/blaxel/runner.js +3 -0
- package/dist/core/runtime/runner/index.d.ts +8 -0
- package/dist/core/runtime/runner/index.js +1 -0
- package/dist/core/runtime/runner/process.d.ts +11 -0
- package/dist/core/runtime/runner/process.js +1 -0
- package/dist/core/runtime/runner/types.d.ts +95 -0
- package/dist/core/runtime/runner/types.js +0 -0
- package/dist/core/runtime/situational-context.d.ts +3 -6
- package/dist/core/runtime/situational-context.js +2 -2
- package/dist/core/runtime/situational-live.js +1 -1
- package/dist/core/runtime/spawn-env-rows.d.ts +5 -0
- package/dist/core/runtime/spawn-env-rows.js +1 -0
- package/dist/core/runtime/spawn-env.d.ts +4 -18
- package/dist/core/runtime/spawn-env.js +1 -1
- package/dist/core/runtime/spawn.js +2 -2
- package/dist/core/runtime/stop-guard.d.ts +1 -1
- package/dist/core/runtime/stop-guard.js +2 -8
- package/dist/core/runtime/structured-output.d.ts +0 -67
- package/dist/core/runtime/structured-output.js +3 -8
- package/dist/core/runtime/tmux-driver.d.ts +8 -0
- package/dist/core/runtime/tmux-driver.js +6 -6
- package/dist/core/runtime/view-socket.d.ts +20 -0
- package/dist/core/runtime/view-socket.js +3 -1
- package/dist/core/runtime/warm-pool.d.ts +13 -1
- package/dist/core/runtime/warm-pool.js +1 -1
- package/dist/core/scoped-state/legacy-profiles.d.ts +11 -0
- package/dist/core/scoped-state/legacy-profiles.js +1 -0
- package/dist/core/scoped-state/materialized-plugins.d.ts +18 -0
- package/dist/core/scoped-state/materialized-plugins.js +1 -0
- package/dist/core/scoped-state/migrate.d.ts +8 -1
- package/dist/core/scoped-state/migrate.js +3 -3
- package/dist/core/scoped-state/person-rows.d.ts +10 -0
- package/dist/core/scoped-state/person-rows.js +6 -0
- package/dist/core/scoped-state/person-store.d.ts +72 -0
- package/dist/core/scoped-state/person-store.js +1 -0
- package/dist/core/secrets/blaxel-launch.d.ts +24 -0
- package/dist/core/secrets/blaxel-launch.js +4 -0
- package/dist/core/secrets/blaxel-register.d.ts +2 -0
- package/dist/core/secrets/blaxel-register.js +1 -0
- package/dist/core/secrets/env-rows.d.ts +17 -0
- package/dist/core/secrets/env-rows.js +4 -0
- package/dist/core/secrets/environment-owner.d.ts +8 -0
- package/dist/core/secrets/environment-owner.js +1 -0
- package/dist/core/secrets/environment-secrets.d.ts +14 -0
- package/dist/core/secrets/environment-secrets.js +1 -0
- package/dist/core/secrets/index.d.ts +2 -0
- package/dist/core/secrets/index.js +1 -0
- package/dist/core/secrets/key.d.ts +3 -0
- package/dist/core/secrets/key.js +2 -0
- package/dist/core/secrets/seal.d.ts +18 -0
- package/dist/core/secrets/seal.js +1 -0
- package/dist/core/spaces/mounts.d.ts +1 -1
- package/dist/core/spaces/mounts.js +1 -1
- package/dist/core/spaces/process.d.ts +1 -1
- package/dist/core/spaces/stop.d.ts +7 -5
- package/dist/core/spaces/stop.js +2 -2
- package/dist/core/spaces/users.d.ts +2 -1
- package/dist/core/spaces/users.js +1 -1
- package/dist/core/storage/attachments.d.ts +11 -8
- package/dist/core/storage/attachments.js +1 -1
- package/dist/core/storage/tables.d.ts +4 -0
- package/dist/core/storage/tables.js +3 -3
- package/dist/core/subscription-state.d.ts +34 -72
- package/dist/core/subscription-state.js +1 -4
- package/dist/core/substrate/delivery/plan.js +1 -1
- package/dist/core/user-settings.js +1 -1
- package/dist/daemon/api/app-listener.js +10 -10
- package/dist/daemon/api/auth/person-bearer.d.ts +14 -0
- package/dist/daemon/api/auth/person-bearer.js +1 -0
- package/dist/daemon/api/bridge.js +4 -4
- package/dist/daemon/api/document-listener.js +3 -3
- package/dist/daemon/api/environment-of.d.ts +18 -0
- package/dist/daemon/api/environment-of.js +5 -0
- package/dist/daemon/api/handlers/analytics.js +1 -1
- package/dist/daemon/api/handlers/app-profiles.d.ts +2 -2
- package/dist/daemon/api/handlers/app-profiles.js +1 -1
- package/dist/daemon/api/handlers/bash-jobs.js +1 -1
- package/dist/daemon/api/handlers/bash.js +1 -1
- package/dist/daemon/api/handlers/broker-ops.d.ts +3 -0
- package/dist/daemon/api/handlers/broker-ops.js +1 -1
- package/dist/daemon/api/handlers/broker-recovery.js +1 -1
- package/dist/daemon/api/handlers/broker-signals.d.ts +0 -3
- package/dist/daemon/api/handlers/broker-signals.js +2 -2
- package/dist/daemon/api/handlers/canvas.js +4 -4
- package/dist/daemon/api/handlers/charges.d.ts +1 -1
- package/dist/daemon/api/handlers/charges.js +1 -1
- package/dist/daemon/api/handlers/conversations.d.ts +2 -0
- package/dist/daemon/api/handlers/conversations.js +3 -0
- package/dist/daemon/api/handlers/crons.js +1 -1
- package/dist/daemon/api/handlers/daemon.js +1 -1
- package/dist/daemon/api/handlers/delivery.d.ts +1 -1
- package/dist/daemon/api/handlers/delivery.js +1 -1
- package/dist/daemon/api/handlers/docs.js +1 -1
- package/dist/daemon/api/handlers/exec.js +1 -1
- package/dist/daemon/api/handlers/execution-start.d.ts +2 -0
- package/dist/daemon/api/handlers/execution-start.js +2 -0
- package/dist/daemon/api/handlers/files.js +1 -1
- package/dist/daemon/api/handlers/git-credential.d.ts +11 -0
- package/dist/daemon/api/handlers/git-credential.js +1 -0
- package/dist/daemon/api/handlers/hook-exec.d.ts +1 -1
- package/dist/daemon/api/handlers/hook-exec.js +1 -1
- package/dist/daemon/api/handlers/human-requests.js +1 -1
- package/dist/daemon/api/handlers/inbox.js +1 -1
- package/dist/daemon/api/handlers/messages.js +1 -1
- package/dist/daemon/api/handlers/model-config.js +1 -1
- package/dist/daemon/api/handlers/modelauth.d.ts +1 -1
- package/dist/daemon/api/handlers/modelauth.js +1 -1
- package/dist/daemon/api/handlers/node-events.d.ts +6 -0
- package/dist/daemon/api/handlers/node-events.js +3 -3
- package/dist/daemon/api/handlers/node-outcomes.js +1 -1
- package/dist/daemon/api/handlers/node-records.js +3 -2
- package/dist/daemon/api/handlers/nodes.js +1 -1
- package/dist/daemon/api/handlers/objects.js +3 -3
- package/dist/daemon/api/handlers/profiles.js +1 -1
- package/dist/daemon/api/handlers/providers.js +1 -1
- package/dist/daemon/api/handlers/reports.js +9 -13
- package/dist/daemon/api/handlers/reviews.js +1 -1
- package/dist/daemon/api/handlers/runs.js +1 -1
- package/dist/daemon/api/handlers/settings.d.ts +2 -0
- package/dist/daemon/api/handlers/settings.js +1 -0
- package/dist/daemon/api/handlers/structured-requests.js +1 -1
- package/dist/daemon/api/handlers/vendor-status.d.ts +1 -1
- package/dist/daemon/api/handlers/vendor-status.js +1 -1
- package/dist/daemon/api/handlers/worktree.js +1 -1
- package/dist/daemon/api/map.d.ts +2 -2
- package/dist/daemon/api/map.js +2 -2
- package/dist/daemon/api/operations.js +1 -1
- package/dist/daemon/api/reader.d.ts +8 -1
- package/dist/daemon/api/reader.js +1 -1
- package/dist/daemon/api/router.d.ts +4 -2
- package/dist/daemon/api/router.js +1 -1
- package/dist/daemon/api/server.d.ts +15 -3
- package/dist/daemon/api/server.js +1 -1
- package/dist/daemon/api/vendor-signin.d.ts +2 -1
- package/dist/daemon/api/vendor-signin.js +19 -19
- package/dist/daemon/api/viewer-presence.d.ts +20 -6
- package/dist/daemon/api/viewer-presence.js +2 -1
- package/dist/daemon/boot-settings.d.ts +3 -0
- package/dist/daemon/boot-settings.js +1 -0
- package/dist/daemon/broker-signals/bus.d.ts +48 -11
- package/dist/daemon/broker-signals/bus.js +1 -1
- package/dist/daemon/cron/armed-context.js +1 -1
- package/dist/daemon/cron/lease-recovery.js +1 -1
- package/dist/daemon/cron/live-runs.d.ts +6 -0
- package/dist/daemon/cron/live-runs.js +1 -1
- package/dist/daemon/cron/run-socket.js +1 -1
- package/dist/daemon/cron-run.js +2 -2
- package/dist/daemon/crtrd-cli.js +1 -1
- package/dist/daemon/crtrd.d.ts +10 -0
- package/dist/daemon/crtrd.js +18 -17
- package/dist/daemon/delivery/run-delivery.d.ts +1 -1
- package/dist/daemon/delivery/run-delivery.js +1 -1
- package/dist/daemon/due-sources.d.ts +1 -1
- package/dist/daemon/due-sources.js +1 -1
- package/dist/daemon/due.js +7 -6
- package/dist/daemon/fleet.d.ts +6 -6
- package/dist/daemon/fleet.js +9 -9
- package/dist/daemon/park-activity.d.ts +2 -1
- package/dist/daemon/park-activity.js +1 -1
- package/dist/daemon/park-pending.d.ts +20 -13
- package/dist/daemon/park-pending.js +3 -1
- package/dist/daemon/profile-delete.js +1 -1
- package/dist/daemon/reconcilers/bash-deadline.d.ts +15 -10
- package/dist/daemon/reconcilers/bash-deadline.js +1 -3
- package/dist/daemon/reconcilers/broker-supervision.d.ts +13 -3
- package/dist/daemon/reconcilers/broker-supervision.js +4 -4
- package/dist/daemon/reconcilers/cron-lane.d.ts +0 -1
- package/dist/daemon/reconcilers/cron-lane.js +1 -1
- package/dist/daemon/reconcilers/fault-retry-backstop.d.ts +2 -9
- package/dist/daemon/reconcilers/fault-retry-backstop.js +1 -1
- package/dist/daemon/reconcilers/grant-effects.d.ts +8 -0
- package/dist/daemon/reconcilers/grant-effects.js +1 -0
- package/dist/daemon/reconcilers/grove-instance-sweep.d.ts +1 -3
- package/dist/daemon/reconcilers/grove-instance-sweep.js +1 -1
- package/dist/daemon/reconcilers/ledger-r2.d.ts +27 -0
- package/dist/daemon/reconcilers/ledger-r2.js +7 -0
- package/dist/daemon/reconcilers/ledger-sandbox.d.ts +55 -0
- package/dist/daemon/reconcilers/ledger-sandbox.js +9 -0
- package/dist/daemon/reconcilers/ledger-storage.d.ts +22 -0
- package/dist/daemon/reconcilers/ledger-storage.js +5 -0
- package/dist/daemon/reconcilers/live-obligation.d.ts +3 -2
- package/dist/daemon/reconcilers/live-obligation.js +1 -1
- package/dist/daemon/reconcilers/managed-worktree-sweep.d.ts +0 -5
- package/dist/daemon/reconcilers/managed-worktree-sweep.js +1 -1
- package/dist/daemon/reconcilers/node-deadline.d.ts +2 -1
- package/dist/daemon/reconcilers/node-deadline.js +1 -1
- package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.d.ts +1 -2
- package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.js +1 -1
- package/dist/daemon/reconcilers/node-lifecycle/remote-wake.d.ts +31 -0
- package/dist/daemon/reconcilers/node-lifecycle/remote-wake.js +1 -0
- package/dist/daemon/reconcilers/node-lifecycle/requested-stops.d.ts +5 -0
- package/dist/daemon/reconcilers/node-lifecycle/requested-stops.js +2 -0
- package/dist/daemon/reconcilers/node-lifecycle/tick.js +1 -1
- package/dist/daemon/reconcilers/pending-review-submit.js +1 -1
- package/dist/daemon/reconcilers/recipe-image.d.ts +49 -0
- package/dist/daemon/reconcilers/recipe-image.js +7 -0
- package/dist/daemon/reconcilers/row-claim.d.ts +19 -0
- package/dist/daemon/reconcilers/row-claim.js +2 -0
- package/dist/daemon/reconcilers/storage-due-work.d.ts +18 -3
- package/dist/daemon/reconcilers/storage-due-work.js +2 -1
- package/dist/daemon/reconcilers/storage-maintenance.d.ts +5 -13
- package/dist/daemon/reconcilers/storage-maintenance.js +1 -1
- package/dist/daemon/reconcilers/structured-request-lane.js +1 -1
- package/dist/daemon/reconcilers/throttled-lane.d.ts +11 -0
- package/dist/daemon/reconcilers/throttled-lane.js +1 -0
- package/dist/daemon/review/finish.js +1 -1
- package/dist/daemon/run-notices.d.ts +3 -0
- package/dist/daemon/run-notices.js +1 -1
- package/dist/daemon/runs/append-section.d.ts +4 -1
- package/dist/daemon/runs/append-section.js +2 -2
- package/dist/daemon/runs/observer.d.ts +3 -2
- package/dist/daemon/runs/observer.js +3 -2
- package/dist/daemon/runs/view-transport.d.ts +19 -0
- package/dist/daemon/runs/view-transport.js +1 -0
- package/dist/daemon/structured-requests/boot.d.ts +2 -1
- package/dist/daemon/structured-requests/boot.js +1 -1
- package/dist/daemon/structured-requests/effects.d.ts +4 -3
- package/dist/daemon/structured-requests/effects.js +1 -1
- package/dist/daemon/structured-requests/notifier.d.ts +2 -0
- package/dist/daemon/structured-requests/notifier.js +1 -1
- package/dist/daemon/structured-requests/sidecar.d.ts +4 -3
- package/dist/daemon/structured-requests/sidecar.js +1 -1
- package/dist/launcher/validate.js +1 -1
- package/dist/migrations/004-canvas-documents/index.js +2 -2
- package/dist/pi-extensions/broker-local.d.ts +3 -3
- package/dist/pi-extensions/broker-local.js +1 -2
- package/dist/pi-extensions/canvas-bash-valve.js +6 -6
- package/dist/pi-extensions/canvas-context-intro.js +2 -2
- package/dist/pi-extensions/canvas-elapsed.js +2 -2
- package/dist/pi-extensions/canvas-goal-capture.js +1 -1
- package/dist/pi-extensions/canvas-inbox-watcher.js +2 -2
- package/dist/pi-extensions/canvas-review-boundary.d.ts +11 -1
- package/dist/pi-extensions/canvas-review-boundary.js +3 -3
- package/dist/pi-extensions/canvas-stophook.js +1 -1
- package/dist/pi-extensions/canvas-structured-output.d.ts +5 -3
- package/dist/pi-extensions/canvas-structured-output.js +6 -11
- package/dist/pi-extensions/canvas-tool-guide.d.ts +9 -2
- package/dist/pi-extensions/canvas-tool-guide.js +6 -6
- package/dist/shared/inbox-entry-body.js +7 -7
- package/dist/types.d.ts +12 -0
- package/docs/sdk/release-notes.md +4 -0
- package/package.json +7 -4
- package/packages/crouter-identity/package.json +1 -1
- package/runtime.lock.json +13 -13
- package/scripts/git-credential-crtr +33 -0
- package/scripts/sandbox-bootstrap.sh +54 -0
- package/scripts/sandbox-start.mjs +320 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.d.ts +0 -78
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.js +0 -1179
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +0 -1406
- package/dist/core/conversation-store/file-store.d.ts +0 -37
- package/dist/core/conversation-store/file-store.js +0 -9
- package/dist/core/conversation-store/listener.d.ts +0 -4
- package/dist/core/conversation-store/listener.js +0 -8
- package/dist/core/scoped-state/profiles.d.ts +0 -27
- package/dist/core/scoped-state/profiles.js +0 -1
- package/dist/core/scoped-state/providers.d.ts +0 -24
- package/dist/core/scoped-state/providers.js +0 -1
- package/dist/core/scoped-state/settings.d.ts +0 -28
- package/dist/core/scoped-state/settings.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var h=Object.defineProperty;var d=(e,
|
|
2
|
-
`):[`Reviewed file: ${
|
|
3
|
-
`);e.sendMessage({customType:_,content:b("review-boundary",{},c),display:!0,details:{reviewId:
|
|
1
|
+
var h=Object.defineProperty;var d=(e,i)=>h(e,"name",{value:i,configurable:!0});import{envNodeId as f}from"../shared/env.js";import{bootExtensionState as m}from"../core/runtime/broker/boot-state.js";import{isReviewBoundary as w,REVIEW_BOUNDARY_CUSTOM_TYPE as _}from"../core/runtime/session-visibility.js";import{formatCard as b}from"../shared/generated-context.js";function l(e,i=m){e.on("session_start",async(p,v)=>{const r=f();if(!r||r.trim()==="")return;let n;try{n=(await i(r)).node}catch{return}if(n.review_binding==null||v.sessionManager.getBranch().some(g=>w(g,n.review_binding?.review_id)))return;const t=n.review_binding,{review_id:o,origin_node_id:s,target_file:a}=t,c=t.kind==="page_feedback"?[`This conversation began from feedback on page ${o}.`,`Page source: ${a}`,`Origin node: ${s}`,"","The person's visible transcript starts here. Everything above this marker is the origin node's work \u2014 inherited context they have not seen."].join(`
|
|
2
|
+
`):[`Reviewed file: ${a}`,`Review ID: ${o}`,`Origin node: ${s}`,"","The person's visible transcript starts here. Everything above this marker is inherited context they have not seen."].join(`
|
|
3
|
+
`);e.sendMessage({customType:_,content:b("review-boundary",{},c),display:!0,details:{reviewId:o,originNodeId:s,targetFile:a,kind:t.kind??"review"}})})}d(l,"registerCanvasReviewBoundary");var T=l;export{T as default,l as registerCanvasReviewBoundary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var X=Object.defineProperty;var l=(n,t)=>X(n,"name",{value:t,configurable:!0});import{brokerSignalClient as
|
|
1
|
+
var X=Object.defineProperty;var l=(n,t)=>X(n,"name",{value:t,configurable:!0});import{brokerSignalClient as A}from"../core/runtime/broker/signal-stream.js";import{brokerExecutionId as J}from"../core/runtime/broker/daemon-ops.js";import{envNodeId as K}from"../shared/env.js";import{stripCdPrefix as Z}from"../shared/strip-cd-prefix.js";import{mutateBrokerFault as ee,recordBrokerTelemetry as te,recordBrokerTurn as x,clearBrokerPushedFinal as ne,consumeBrokerPushedFinal as re}from"../core/runtime/broker/daemon-ops.js";import{bindBrokerSession as oe,cachedBrokerNode as j,postBrokerIdle as se,relaunchBrokerRoot as ae,settleBroker as L}from"../core/runtime/broker/daemon-ops.js";import{emitEvent as F}from"../core/events/emit.js";import{CONTEXT_NUDGE_CUSTOM_TYPE as ie,formatCard as le}from"../shared/generated-context.js";import{isReviewBoundary as ue}from"../core/runtime/session-visibility.js";import{clearRefusedTurn as ce,isRuntimeTeardownInProgress as de,refuseTurn as fe,runRefreshAbort as he}from"../core/runtime/broker/extension-abort.js";import{announceMessageOrigin as Y}from"../core/runtime/stamp/channel.js";const z=80;function ye(n,t){const i=t??{},s=l(w=>typeof w=="string"?w:"","pick"),h=Z(s(i.command).trim())||s(i.path)||s(i.file_path)||s(i.pattern)||s(i.description)||s(i.prompt),y=(h!==""?`${n}: ${h}`:n).replace(/\s+/g," ").trim();return y.length>z?y.slice(0,z):y}l(ye,"summarizeActivity");function pe(n){for(let t=n.length-1;t>=0;t--)if(n[t]?.role==="assistant")return n[t]}l(pe,"lastAssistantMessage");function me(n){try{const t=n?.sessionManager?.getBranch();if(!Array.isArray(t))return[];const i=new Set;for(const s of t){if(!ue(s))continue;const u=s.details?.reviewId;typeof u=="string"&&i.add(u)}return[...i]}catch{return[]}}l(me,"currentReviewBoundaryIds");const G=1e4,C=[13e4,15e4,17e4,185e3,2e5];function ge(n){const t=C[0],i=C[C.length-1];if(n<t)return null;if(n>=i)return i+Math.floor((n-i)/G)*G;let s=t;for(const u of C)n>=u&&(s=u);return s}l(ge,"steerBand");function we(n,t,i){const s=Math.round(n/1e3),u=n>=185e3;if(i==="orchestrator")return n<15e4?`Context ~${s}k and growing. When you reach a good stopping point, consider updating your roadmap (\`crtr doc edit roadmap\`) and running \`crtr node yield\` to refresh against it \u2014 no rush yet.`:u?`Context ~${s}k \u2014 this is getting long. Stop taking on new work now: bring your roadmap current, hand off anything outstanding, and \`crtr node yield\` immediately to refresh before this context overflows.`:`Context ~${s}k. Update your roadmap (\`crtr doc edit roadmap\`) so a fresh revive can continue, delegate any outstanding work, then \`crtr node yield\` to refresh.`;if(t==="resident"){const h="If substantial work remains, `crtr node yield` to continue fresh against your goal and your note. Add --promote only when worthwhile independent work can run in parallel and coordinating it should become your primary job; `crtr node yield -h` has the boundary.";return n<15e4?`Context ~${s}k and growing. ${h} Otherwise no rush \u2014 wrap up when you reach a good stopping point.`:u?`Context ~${s}k \u2014 this is getting long. Wrap up now before this context overflows: finish what's in hand, or \`crtr node yield\` immediately to continue fresh against your goal and your note if substantial work remains.`:`Context ~${s}k. ${h} If you're near done, just finish here; if there's more open-ended work, \`crtr node yield\` rather than letting this context grow.`}return n<15e4?`Context ~${s}k and growing. If you're near done, finish with \`crtr push final\`. If real work remains, \`crtr node yield\` to continue in a fresh window against your goal and your note \u2014 no rush yet.`:u?`Context ~${s}k \u2014 this is getting long. Wrap up now before this context overflows: \`crtr push final\` if you're close, otherwise \`crtr node yield\` immediately to continue in a fresh window against your goal and your note.`:`Context ~${s}k. If you're close, finish with \`crtr push final\`; otherwise \`crtr node yield\` now to refresh into a clean window and keep going against your goal and your note.`}l(we,"steerNote");function _e(n){const t=K();if(t===void 0||t.trim()==="")return;let i=0,s=0,u="",h=null,y=null;const w=new Set;let k=!1,I=!1;const N=l(e=>{if(!I){I=!0;try{he(()=>e?.abort?.())}catch{}}},"abortForRefresh");let T;const Q=A().subscribe("node",()=>{const e=A();k&&e.state==="connected"&&e.latestNode?.intent==="refresh"&&N(T)}),c=l((e,r)=>{F({event:"broker.daemon.operation.failed",level:"error",node_id:t,error:r,fields:{operation:e}})},"emitDaemonOperationFailure"),D=l((e,r)=>{if(e.action==="reprompt"){Y(e.prompt,{type:"runtime",kind:"stop-guard"}),n.sendUserMessage(e.prompt,{deliverAs:"followUp"});return}if(e.action==="stay_resident"){se(t).then(()=>A().stop(),o=>c("idle",o));return}if(e.action==="shutdown")try{r?.shutdown?.()}catch{}},"enactSettleDirective"),V=3e3;let O=0,S=Promise.resolve(),d=null,U=null,q=-1/0,p=null,B=0;const R=l(()=>{if(d===null||d===U)return;const e=d;U=e,q=Date.now(),S=S.then(()=>te(t,e)).catch(r=>c("telemetry",r))},"queueTelemetry"),E=l((e,r)=>{if(d!==null&&d.tokens_in===i&&d.tokens_out===s&&d.model===u&&d.context_tokens===e&&d.last_activity===r)return;B=Math.max(Date.now(),B+1),d={tokens_in:i,tokens_out:s,model:u,context_tokens:e,last_activity:r,updated_at:new Date(B).toISOString()};const o=2e3-(Date.now()-q);o<=0?R():p===null&&(p=setTimeout(()=>{p=null,R()},o),p.unref?.())},"publishTelemetry"),$=l(()=>(p!==null&&clearTimeout(p),p=null,R(),S),"flushTelemetry");let M=Promise.resolve();const H=l(e=>(M=M.catch(()=>{}).then(async()=>{const r=await x(t,{event:"progress"});(r.fault_link==="daemon\u2192node"||e&&r.fault_link==="pi\u2192provider")&&await ee(t,{op:"clear",link:r.fault_link})}),M),"reportProgress"),v=l(()=>{const e=Date.now();e-O<V||(O=e,H(!1).catch(r=>c("turn_progress",r)))},"heartbeat");n.on("session_start",async(e,r)=>{try{const o=r?.sessionManager?.getSessionId?.();if(typeof o!="string"||o==="")return;const m=r?.sessionManager?.getSessionFile?.(),g=typeof m=="string"&&m!==""?m:null,_=typeof e?.reason=="string"?e.reason:null;_==="new"&&(i=0,s=0,w.clear());const a=await oe(t,{piSessionId:o,sessionFile:g,pid:process.pid,reason:_,reviewBoundaryIds:me(r)});if(a.action==="none"&&A().start(t,J()),a.action==="shutdown"){try{r?.shutdown?.()}catch{}return}if(a.action==="relaunch_root"){ae(t).catch(f=>{const b=f instanceof Error?f.message:String(f);r?.ui?.notify?.(`/new refused: ${b}`,"error"),F({event:"broker.daemon.operation.failed",level:"error",node_id:t,error:f,fields:{operation:"relaunch_root"}})});return}}catch(o){F({event:"broker.daemon.operation.failed",level:"error",node_id:t,error:o,fields:{operation:"session_bound"}})}}),n.on("agent_start",async(e,r)=>{k=!0,T=r;try{if(!(await x(t,{event:"started"})).applied)throw new Error("daemon refused turn open")}catch(o){c("turn_open",o),r?.ui?.notify?.("Turn refused: the broker no longer owns this node.","error"),fe(()=>r?.abort?.())}}),n.on("input",async()=>{k||(I=!1),ce();try{await ne(t)}catch(e){throw c("clear_pushed_final",e),e}}),n.on("tool_execution_start",e=>{try{y=ye(String(e?.toolName??""),e?.args),E(h,y),v()}catch{}}),n.on("tool_execution_update",()=>{try{v()}catch{}}),n.on("message_update",()=>{try{v()}catch{}}),n.on("tool_execution_end",async(e,r)=>{try{v(),(await j(t)).intent==="refresh"&&N(r)}catch{}}),n.on("session_shutdown",async(e,r)=>{Q(),k=!1,T=void 0,await $();try{await x(t,{event:"closed",end_reason:"teardown-aborted"})}catch(o){c("turn_close_teardown",o)}if(e?.reason==="quit")try{const o=await L(t,{stopReason:"quit",pushedFinal:!1});D(o,r)}catch(o){c("settle_quit",o)}});const W=l(e=>{e?.role!=="assistant"||e.usage==null||(i+=Number(e.usage.input??0)||0,s+=Number(e.usage.output??0)||0,typeof e.model=="string"&&e.model!==""&&(u=e.model))},"accumulate");n.on("turn_end",async(e,r)=>{W(e?.message);let o=null;try{const a=r.getContextUsage()?.tokens;typeof a=="number"&&(o=a)}catch{}o!==null&&(h=o),E(o,y),await $();try{const a=e?.message?.stopReason!=="error"&&e?.message?.stopReason!=="aborted";await H(a)}catch(a){c("turn_end_fault_clear",a)}const m=Array.isArray(e?.message?.content)?e.message.content:[],g=e?.message?.stopReason??"",_=g!=="error"&&g!=="aborted"&&m.some(a=>a?.type==="toolCall");try{const a=o!==null?ge(o):null,f=a!==null&&!w.has(a)?await j(t):null;if(a!==null&&f!==null){w.add(a);const b=le("context-nudge",{},we(a,f.lifecycle,f.mode));_?(Y(b,{type:"runtime",kind:"context-nudge"}),n.sendUserMessage(b,{deliverAs:"steer"})):n.sendMessage({customType:ie,content:b,display:!0},{deliverAs:"nextTurn"})}}catch(a){c("turn_boundary",a)}});let P=null;n.on("agent_end",e=>{P=e;try{const r=Array.isArray(e?.messages)?e.messages:[];for(const o of r)W(o)}catch{}}),n.on("agent_settled",async(e,r)=>{k=!1,T=void 0,E(h,y),await $();const o=P;if(P=null,de())return;try{await x(t,{event:"closed",end_reason:"settled"})}catch(a){c("turn_close",a);return}const m=Array.isArray(o?.messages)?o.messages:[],g=pe(m),_=typeof g?.stopReason=="string"?g.stopReason:"";try{const a=o===null?{pushedFinal:!1}:await re(t),f=await L(t,{stopReason:_,pushedFinal:a.pushedFinal});D(f,r)}catch(a){c("settle",a)}})}l(_e,"registerCanvasStophook");var $e=_e;export{$e as default,_e as registerCanvasStophook,we as steerNote};
|
|
@@ -33,8 +33,10 @@ interface ToolDefinitionLike {
|
|
|
33
33
|
interface PiLike {
|
|
34
34
|
on(event: 'before_agent_start', handler: (event: BeforeAgentStartEventLike) => {
|
|
35
35
|
systemPrompt: string;
|
|
36
|
-
} | void
|
|
37
|
-
|
|
36
|
+
} | void | Promise<{
|
|
37
|
+
systemPrompt: string;
|
|
38
|
+
} | void>): void;
|
|
39
|
+
on(event: 'turn_end', handler: () => void | Promise<void>): void;
|
|
38
40
|
registerTool(tool: ToolDefinitionLike): void;
|
|
39
41
|
getActiveTools(): string[];
|
|
40
42
|
setActiveTools(toolNames: string[]): void;
|
|
@@ -44,6 +46,6 @@ export declare function structuredOutputPromptBlock(request: StructuredOutputReq
|
|
|
44
46
|
/** The model-facing text for an accepted submission — the same wording `crtr push result` prints. */
|
|
45
47
|
export declare function submitResultText(result: SubmitResultDTO): string;
|
|
46
48
|
/** Build the `submit_result` tool for one node. Exported for the test suite. */
|
|
47
|
-
export declare function createSubmitResultTool(nodeId: string, submit?: (req: SubmitResultRequest) => Promise<SubmitResultDTO>): ToolDefinitionLike;
|
|
49
|
+
export declare function createSubmitResultTool(nodeId: string, submit?: (req: SubmitResultRequest) => Promise<SubmitResultDTO>, readPending?: () => Promise<StructuredOutputRequest | null>): ToolDefinitionLike;
|
|
48
50
|
export declare function registerCanvasStructuredOutput(pi: PiLike): void;
|
|
49
51
|
export default registerCanvasStructuredOutput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var b=Object.defineProperty;var
|
|
2
|
-
${e.mode==="terminal"?`This node owes a terminal structured result. When the work is complete, submit it: ${
|
|
1
|
+
var b=Object.defineProperty;var o=(e,t)=>b(e,"name",{value:t,configurable:!0});import{Type as i}from"typebox";import{envNodeId as q}from"../shared/env.js";import{localClient as p}from"../api/node-transport.js";import{ApiError as w}from"../api/index.js";import{SUBMIT_RESULT_TOOL as a}from"../core/runtime/structured-output.js";function O(e){const t=JSON.stringify(e.schema,null,2),r=`call the ${`\`${a}\` tool with \`request_id: "${e.request_id}"\``} and the JSON in \`result\``,n=`call \`${a}\` with \`decline: { reason, code }\` instead`;return`<structured-output-request>
|
|
2
|
+
${e.mode==="terminal"?`This node owes a terminal structured result. When the work is complete, submit it: ${r}. That records it and pushes your final report in one step, finishing this node. Do NOT call \`crtr push final\` yourself; it is blocked while this request is pending. If the schema cannot be honestly satisfied (blocked, unavailable, bad input), ${n} of inventing a value \u2014 that finishes the node with a declined outcome. You cannot stop or go dormant until the result is accepted or declined.`:`This node owes a one-off structured result. Submit it: ${r}. That records it and pushes an update report to your subscribers, then you continue working normally. If the schema cannot be honestly satisfied, ${n} of inventing a value. You cannot stop or go dormant until the result is accepted or declined.`}
|
|
3
3
|
|
|
4
4
|
The submitted JSON is validated against this schema; a mismatch rejects with field errors and records nothing, so fix it and call the tool again.
|
|
5
5
|
|
|
@@ -8,16 +8,11 @@ Required schema:
|
|
|
8
8
|
\`\`\`json
|
|
9
9
|
${t}
|
|
10
10
|
\`\`\`
|
|
11
|
-
</structured-output-request>`}
|
|
11
|
+
</structured-output-request>`}o(O,"structuredOutputPromptBlock");function $(e){const t=e.declined,s=e.mode==="terminal"?`${t?"Decline recorded":"Result recorded"} \u2014 node finished; its engine shuts down on next stop. Nothing more to do here: STOP your turn immediately. Reply with just "Done." and nothing else.`:`${t?"One-off request declined":"One-off result recorded"} and pushed \u2014 the structured-output gate is cleared; continue working normally.`,r=t===void 0?"":`
|
|
12
12
|
- code: ${t.code} (${t.retryable?"retryable":"not retryable"})`;return`${s}
|
|
13
13
|
|
|
14
|
-
- ${t
|
|
15
|
-
- report: ${e.report}`}d(w,"submitResultText");function O(e,t){if(typeof t!="string")return t;const s=h(e),n=s.state==="valid"?s.request.schema.type:void 0;if(n!=="object"&&n!=="array")return t;try{return JSON.parse(t)}catch{return t}}d(O,"normalizeResult");function l(e){return{content:[{type:"text",text:e}],details:void 0,isError:!0}}d(l,"errorResult");function T(e,t=s=>y({autostart:!1}).submitResult(e,s)){return{name:a,label:"Submit result",description:"Answer this node's pending structured-output request. Pass the request id from the structured-output instruction and either `result` (the JSON value matching the required schema) or `decline` when the schema cannot be honestly satisfied. The result is validated against the schema; a mismatch is rejected with field errors and nothing is recorded.",promptSnippet:"Submit the JSON result for a pending structured-output request (or decline it)",parameters:i.Object({request_id:i.String({description:"The request id named in the structured-output instruction."}),result:i.Optional(i.Unknown({description:"The JSON value matching the required schema. Omit when declining."})),decline:i.Optional(i.Object({reason:i.String({description:"One sentence on why the schema cannot be honestly satisfied."}),code:i.String({description:"A whitespace-free token naming the decline class, as the requester documented."}),retryable:i.Optional(i.Boolean({description:"Whether a retry could succeed. Default false."}))},{description:"Decline the request instead of submitting a result."}))}),defaultActive:!1,async execute(s,n){const r=typeof n.request_id=="string"?n.request_id.trim():"";if(r==="")return l("request_id is required: pass the request id named in the structured-output instruction.");const c=Object.hasOwn(n,"result")&&n.result!==void 0,o=n.decline;if(c&&o!==void 0)return l("Pass either `result` or `decline`, not both.");if(!c&&o===void 0)return l("Pass `result` (the JSON value matching the required schema), or `decline` when the schema cannot be honestly satisfied.");const f=o!==void 0?{request_id:r,decline:o.reason,code:o.code,retryable:o.retryable===!0}:{request_id:r,value:O(e,n.result)};try{const u=await t(f);return{content:[{type:"text",text:w(u)}],details:u}}catch(u){if(u instanceof q){const m=u.details,p=typeof m?.next=="string"?`
|
|
14
|
+
- report: ${e.report}${r}`}o($,"submitResultText");async function m(e){return(await p({autostart:!1}).brokerStructuredRequest(e)).request}o(m,"readPendingRequest");function T(e,t){if(typeof t!="string")return t;const s=e?.schema.type;if(s!=="object"&&s!=="array")return t;try{return JSON.parse(t)}catch{return t}}o(T,"normalizeResult");function l(e){return{content:[{type:"text",text:e}],details:void 0,isError:!0}}o(l,"errorResult");function S(e,t=r=>p({autostart:!1}).submitResult(e,r),s=()=>m(e)){return{name:a,label:"Submit result",description:"Answer this node's pending structured-output request. Pass the request id from the structured-output instruction and either `result` (the JSON value matching the required schema) or `decline` when the schema cannot be honestly satisfied. The result is validated against the schema; a mismatch is rejected with field errors and nothing is recorded.",promptSnippet:"Submit the JSON result for a pending structured-output request (or decline it)",parameters:i.Object({request_id:i.String({description:"The request id named in the structured-output instruction."}),result:i.Optional(i.Unknown({description:"The JSON value matching the required schema. Omit when declining."})),decline:i.Optional(i.Object({reason:i.String({description:"One sentence on why the schema cannot be honestly satisfied."}),code:i.String({description:"A whitespace-free token naming the decline class, as the requester documented."}),retryable:i.Optional(i.Boolean({description:"Whether a retry could succeed. Default false."}))},{description:"Decline the request instead of submitting a result."}))}),defaultActive:!1,async execute(r,n){const d=typeof n.request_id=="string"?n.request_id.trim():"";if(d==="")return l("request_id is required: pass the request id named in the structured-output instruction.");const h=Object.hasOwn(n,"result")&&n.result!==void 0,c=n.decline;if(h&&c!==void 0)return l("Pass either `result` or `decline`, not both.");if(!h&&c===void 0)return l("Pass `result` (the JSON value matching the required schema), or `decline` when the schema cannot be honestly satisfied.");const y=c!==void 0?{request_id:d,decline:c.reason,code:c.code,retryable:c.retryable===!0}:{request_id:d,value:T(await s(),n.result)};try{const u=await t(y);return{content:[{type:"text",text:$(u)}],details:u}}catch(u){if(u instanceof w){const f=u.details,g=typeof f?.next=="string"?`
|
|
16
15
|
|
|
17
|
-
${
|
|
16
|
+
${f.next}`:"";return l(`${u.code}: ${u.message}${g}`)}return l(`The result was not submitted: ${u.message}`)}}}}o(S,"createSubmitResultTool");function x(e){const t=q();if(t===void 0||t.trim()==="")return;e.registerTool(S(t));const s=o(r=>{const n=e.getActiveTools(),d=n.includes(a);r&&!d?e.setActiveTools([...n,a]):!r&&d&&e.setActiveTools(n.filter(h=>h!==a))},"syncTool");e.on("before_agent_start",async r=>{const n=await m(t);if(s(n!==null),n!==null)return{systemPrompt:`${r.systemPrompt}
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
This node owes a structured result, but its request file is unreadable to this process (${r.error}). Call the \`${a}\` tool with the request_id and required schema named in the stop-guard message; the server validates it.
|
|
21
|
-
</structured-output-request>`};if(r.state==="valid")return{systemPrompt:`${n.systemPrompt}
|
|
22
|
-
|
|
23
|
-
${$(r.request)}`}}),e.on("turn_end",()=>{s(h(t).state!=="absent")})}d(S,"registerCanvasStructuredOutput");var P=S;export{a as SUBMIT_RESULT_TOOL,T as createSubmitResultTool,P as default,S as registerCanvasStructuredOutput,$ as structuredOutputPromptBlock,w as submitResultText};
|
|
18
|
+
${O(n)}`}}),e.on("turn_end",async()=>{s(await m(t)!==null)})}o(x,"registerCanvasStructuredOutput");var J=x;export{a as SUBMIT_RESULT_TOOL,S as createSubmitResultTool,J as default,x as registerCanvasStructuredOutput,O as structuredOutputPromptBlock,$ as submitResultText};
|
|
@@ -2,13 +2,20 @@ declare function injectToolGuide(systemPrompt: string, helpText: string): string
|
|
|
2
2
|
interface BeforeAgentStartEventLike {
|
|
3
3
|
systemPrompt: string;
|
|
4
4
|
}
|
|
5
|
+
interface SessionStartCtxLike {
|
|
6
|
+
sessionManager: {
|
|
7
|
+
getBranch(): ReadonlyArray<{
|
|
8
|
+
type: string;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
5
12
|
interface PiLike {
|
|
6
|
-
on(event: 'session_start', handler: () => void | Promise<void>): void;
|
|
13
|
+
on(event: 'session_start', handler: (event: unknown, ctx: SessionStartCtxLike) => void | Promise<void>): void;
|
|
7
14
|
on(event: 'before_agent_start', handler: (event: BeforeAgentStartEventLike) => {
|
|
8
15
|
systemPrompt: string;
|
|
9
16
|
} | void): void;
|
|
10
17
|
}
|
|
11
18
|
/** Register the root crtr tool-guide injection for a canvas node. */
|
|
12
|
-
export declare function registerCanvasToolGuide(pi: PiLike): void;
|
|
19
|
+
export declare function registerCanvasToolGuide(pi: PiLike, release?: () => string): void;
|
|
13
20
|
export { injectToolGuide };
|
|
14
21
|
export default registerCanvasToolGuide;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p=Object.defineProperty;var i=(e,r)=>p(e,"name",{value:r,configurable:!0});import{envNodeId as h,envScopes as v}from"../shared/env.js";import{crtrVersion as g}from"../shared/crtr-version.js";import{effectiveCommandPlugins as x}from"../core/command-plugins/presence.js";import{emitEvent as y}from"../core/events/emit.js";import{execFile as _}from"node:child_process";import{createHash as $}from"node:crypto";import{mkdirSync as S,readFileSync as O,writeFileSync as j}from"node:fs";import{homedir as N}from"node:os";import{dirname as k,join as w}from"node:path";import{promisify as C}from"node:util";const I=C(_),R=`
|
|
2
2
|
|
|
3
|
-
Guidelines:`;function T(
|
|
4
|
-
${
|
|
5
|
-
</crtr-tool-guide>`,
|
|
3
|
+
Guidelines:`;function T(e){const r=process.env.CRTR_PLUGINS_REVISION;return r!==void 0&&r!==""?r:x(e).map(t=>`${t.scope}:${t.name}@${t.version??""}:${t.root}`).sort().join("|")}i(T,"pluginsRevision");function b(e,r){const t=[r,e,v()?.join(",")??"",T(e)].join("\0"),o=$("sha1").update(t).digest("hex").slice(0,16);return w(N(),".cache","crouter",`crtr-tool-guide-${o}.json`)}i(b,"helpCacheFile");function d(e,r){const t=`<crtr-tool-guide>
|
|
4
|
+
${r}
|
|
5
|
+
</crtr-tool-guide>`,o=e.indexOf(R);return o===-1?`${e}
|
|
6
6
|
|
|
7
|
-
${
|
|
7
|
+
${t}`:`${e.slice(0,o)}
|
|
8
8
|
|
|
9
|
-
${
|
|
9
|
+
${t}${e.slice(o)}`}i(d,"injectToolGuide");function F(e,r=g){const t=h();if(t===void 0||t.trim()==="")return;let o="";function a(c,f,s){y({level:c==="failed"?"warn":"info",event:"broker.startup.tool_guide",duration_ms:performance.now()-f,...c==="failed"?{outcome:"failed"}:{},fields:{source:c,resumed:s}})}i(a,"emitSource");async function l(c,f){const s=performance.now(),m=f.sessionManager.getBranch().some(n=>n.type==="message"),u=b(process.cwd(),r());try{const n=JSON.parse(O(u,"utf8"));if(typeof n.text=="string"&&n.text!==""){o=n.text,a("disk_cache",s,m);return}}catch{}try{const{stdout:n}=await I("crtr",["-h"],{timeout:1e4});o=n.trim();try{S(k(u),{recursive:!0}),j(u,JSON.stringify({text:o}),"utf8")}catch{}a("captured",s,m)}catch(n){console.error("[canvas-tool-guide] crtr -h capture failed:",n),a("failed",s,m)}}i(l,"refresh"),e.on("session_start",l),e.on("before_agent_start",c=>{if(o!=="")return{systemPrompt:d(c.systemPrompt,o)}})}i(F,"registerCanvasToolGuide");var q=F;export{q as default,d as injectToolGuide,F as registerCanvasToolGuide};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var w=Object.defineProperty;var
|
|
2
|
-
`);return
|
|
3
|
-
`),r=!0),t.length
|
|
1
|
+
var w=Object.defineProperty;var o=(e,t)=>w(e,"name",{value:t,configurable:!0});import{formatInboxRefInstruction as l}from"./generated-context.js";const f=12,$=1e3,y=1e3;function A(e){return(e===void 0?null:/^([a-z0-9-]+)\/reports\/[^/]+$/.exec(e))?.[1]}o(A,"reportRefNodeId");function j(e){let t=e,r=!1;const i=t.split(`
|
|
2
|
+
`);return i.length>f&&(t=i.slice(0,f).join(`
|
|
3
|
+
`),r=!0),t.length>$&&(t=t.slice(0,$),r=!0),{text:t.trimEnd(),clipped:r}}o(j,"clipBody");function x(e){const t=typeof e.data?.body=="string"?String(e.data.body).trim():"";return t===""||t===e.label?"":t}o(x,"inlineBody");function v(e){const t=e.data?.push;return typeof t=="object"&&t!==null&&typeof t.event=="string"?t:null}o(v,"pushOf");function u(e){const t=e.owner_handle??e.owner;return t==null?e.name:`${t}/${e.name}`}o(u,"objectRef");function _(e){return e.type==="document"?`[[${u(e)}]]`:e.type==="job"?`job ${e.id} (\`${e.name}\`)`:e.type==="node"?`node ${e.name} (${e.id})${e.machine?` on ${e.machine}`:""}`:`${e.type} ${e.name}`}o(_,"objectText");function k(e,t){return t.actor===null?"the runtime":e.from_name===void 0||e.from_name===t.actor?t.actor:`${e.from_name} (${t.actor})`}o(k,"actorText");function m(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}o(m,"list");function I(e,t){const r=_(t.object),i=k(e,t),n=t.attrs,a=t.object.type==="document"?` Read it with \`crtr canvas read ${u(t.object)}\`.`:"";switch(t.event){case"created":return t.object.type==="node"?`${i} created ${r}${typeof n.kind=="string"?`, kind ${n.kind}`:""}.`:`${i} created ${r}.${a}`;case"read":return`${i} read ${r}.`;case"watched":return`${i} started watching ${r}.`;case"deleted":return`${i} deleted ${r}.`;case"edited":{const s=m(n.authors),c=m(n.rationales),d=typeof n.from_revision=="number"&&typeof n.revision=="number"&&n.revision-n.from_revision>1?`revisions ${n.from_revision+1}\u2013${n.revision}`:typeof n.revision=="number"?`revision ${n.revision}`:"a new revision",b=s.length===0?i:s.join(", "),g=c.length===0?"":` Rationale: ${c.join("; ")}.`,h=n.needs_merge===!0?" Two edits were made from the same revision; read it and edit it to merge them.":"",p=` You get this because you read or wrote it; if it no longer concerns your work, stop with \`crtr canvas unwatch ${u(t.object)}\`.`;return`${b} edited ${r} (${d}).${g}${h}${a}${p}`}case"messaged":return`${i} messaged ${r}.`;case"sent":return`${i} sent a message as ${r}.`;case"configured":return`${i} changed the settings of ${r}${typeof n.changed=="string"?`: ${n.changed}`:""}.`;case"exited":return`${r[0].toUpperCase()}${r.slice(1)} exited with code ${String(n["exit-code"])}. Output: ${String(n["output-key"])}`;case"silent":{const s=typeof n.files=="string"?n.files:"";return`${r[0].toUpperCase()}${r.slice(1)} has been silent for ${String(n["silent-for"])}: its processes used almost no CPU and none of the files they hold open for writing changed. It may be hung. Watched: ${s===""?"the job log only":s}. Inspect those files; stop it with \`crtr node bash kill ${t.object.id}\`; or, if it is meant to sit idle, stop these messages with \`crtr node bash quiet ${t.object.id}\`.`}case"killed":{const s=t.actor===null?"":` by ${i}`,c=typeof n.reason=="string"?` (${n.reason})`:"",d=n.reason==="deadline"?` It was canceled at its deadline; claim it with \`crtr node bash extend ${t.object.id} --for <duration>\` next time.`:"";return`${r[0].toUpperCase()}${r.slice(1)} was killed${s}${c}.${d} Output: ${String(n["output-key"])}`}default:return e.label}}o(I,"renderPush");function C(e,t){if(t!==null&&t.length<y&&e.ref!==void 0)return`${t.trimEnd()}
|
|
4
4
|
|
|
5
|
-
${l(e.ref)}`;const r=x(e);if(r===""){const a=v(e);return a!==null&&e.ref===void 0?
|
|
5
|
+
${l(e.ref)}`;const r=x(e);if(r===""){const a=v(e);return a!==null&&e.ref===void 0?I(e,a):e.ref===void 0?e.label:`${e.label}
|
|
6
6
|
|
|
7
|
-
${l(e.ref)}`}const{text:
|
|
7
|
+
${l(e.ref)}`}const{text:i,clipped:n}=j(r);return e.ref!==void 0?`${i}
|
|
8
8
|
|
|
9
|
-
${l(e.ref)}`:n?`${
|
|
10
|
-
\u2026 (body clipped)`:o
|
|
9
|
+
${l(e.ref)}`:n?`${i}
|
|
10
|
+
\u2026 (body clipped)`:i}o(C,"renderEntryBody");export{y as INLINE_REPORT_MAX_CHARS,j as clipBody,x as inlineBody,C as renderEntryBody,A as reportRefNodeId};
|
package/dist/types.d.ts
CHANGED
|
@@ -405,6 +405,18 @@ export interface ScopeConfig {
|
|
|
405
405
|
/** The money ledger. `take_pct` (0-100, default 0) is Northlight's take on each priced model or tool charge; at 0 no take rows are written. */
|
|
406
406
|
ledger?: {
|
|
407
407
|
take_pct?: number;
|
|
408
|
+
/** USD per GB-hour of Blaxel sandbox awake time; the `ledger-sandbox` lane writes no rows while it is unset. */
|
|
409
|
+
sandbox_usd_per_gb_hour?: number;
|
|
410
|
+
/** Seconds a sandbox stays awake after its broker goes idle or exits (default 30). */
|
|
411
|
+
sandbox_standby_s?: number;
|
|
412
|
+
/** USD per GB-month of R2 storage; the `ledger-storage` lane writes no `r2` rows while it is unset. */
|
|
413
|
+
storage_usd_per_gb_month?: number;
|
|
414
|
+
/** USD per GB-month of Blaxel sandbox disk; the `ledger-storage` lane writes no `blaxel` rows while it is unset. */
|
|
415
|
+
sandbox_disk_usd_per_gb_month?: number;
|
|
416
|
+
/** USD of sandbox and storage a billing account uses free each UTC month (default 50); `billed_usd` on those rows is the part above it. */
|
|
417
|
+
infra_free_usd_per_month?: number;
|
|
418
|
+
/** The `ledger-r2` lane moves closed months into the blob store only while this is true (off until 5b is accepted). */
|
|
419
|
+
r2_move?: boolean;
|
|
408
420
|
};
|
|
409
421
|
/** Conversation store configuration for the daemon. */
|
|
410
422
|
store?: {
|
|
@@ -7,6 +7,10 @@ description: Behavior changes in @north-light/sdk that an app must act on, newes
|
|
|
7
7
|
|
|
8
8
|
Changes to `@north-light/sdk` that can change what an existing app sees. Newest first.
|
|
9
9
|
|
|
10
|
+
## 0.3.562
|
|
11
|
+
|
|
12
|
+
A cloud role's runtime (one with `CRTR_DIRECTORY_URL` and `CRTR_PUBLIC_API_URL` set) accepts a directory person bearer on its TCP listener: the caller acts as that person and reads only the nodes that person may read; schedules, charges, files and provider calls are refused `403 permission_error` to it. Any other listener still refuses a person bearer `401`, now with the code `person_bearer_not_supported` (was `person_bearer_not_supported_on_cloud_role`). A cloud role also answers `GET /v1/runtime/vendor-status` and `POST /v1/runtime/vendor-account-remove` for the person the directory's token names, and refuses a token that names no person `401`.
|
|
13
|
+
|
|
10
14
|
## 0.3.560
|
|
11
15
|
|
|
12
16
|
A read waits through a hosted runtime being created or replaced, instead of failing with `503`. No new option.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.563",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -70,6 +70,9 @@
|
|
|
70
70
|
"scripts/postinstall.mjs",
|
|
71
71
|
"scripts/patch-pi-tree-root-ordering.mjs",
|
|
72
72
|
"scripts/install-runtime.mjs",
|
|
73
|
+
"scripts/sandbox-start.mjs",
|
|
74
|
+
"scripts/sandbox-bootstrap.sh",
|
|
75
|
+
"scripts/git-credential-crtr",
|
|
73
76
|
"scripts/lib/isolation-env.mjs",
|
|
74
77
|
"scripts/lib/canvas-schema-gate.mjs",
|
|
75
78
|
"scripts/lib/pack-args.mjs",
|
|
@@ -98,7 +101,7 @@
|
|
|
98
101
|
"build:plugin": "tsc -p packages/crouter-plugin/tsconfig.json",
|
|
99
102
|
"typecheck": "tsc --noEmit && tsc -p src/doc-editor/tsconfig.json",
|
|
100
103
|
"typecheck:pi-packages": "npx tsc -p src/builtin-pi-packages/pi-crtr-extensions/tsconfig.json",
|
|
101
|
-
"test:runtime-packaging": "node --test scripts/runtime-smoke.test.mjs scripts/pack-args.test.mjs scripts/ensure-native-linux.test.mjs scripts/release-version.test.mjs",
|
|
104
|
+
"test:runtime-packaging": "node --test scripts/runtime-smoke.test.mjs scripts/pack-args.test.mjs scripts/ensure-native-linux.test.mjs scripts/release-version.test.mjs scripts/sandbox-start.test.mjs",
|
|
102
105
|
"contract:check": "node scripts/contract.mjs check",
|
|
103
106
|
"contract:surface": "node scripts/contract.mjs generate",
|
|
104
107
|
"docs:check-reference": "npm exec --workspace @north-light/docs -- tsx scripts/check-reference.ts",
|
|
@@ -122,7 +125,7 @@
|
|
|
122
125
|
"test:seam": "npm run build && npm run test:seam:built",
|
|
123
126
|
"test:sdk": "npm run build:api && npm run build:identity && node --conditions=crtr-src --import tsx/esm --test --test-timeout=60000 'packages/crouter-sdk/src/__tests__/*.test.ts' 'packages/crouter-sdk/src/__tests__/integration/*.test.ts'",
|
|
124
127
|
"test:sdk:pg": "node -e \"if (!process.env.TEST_DATABASE_URL) { console.error('test:sdk:pg needs TEST_DATABASE_URL (a disposable PostgreSQL), e.g. docker run --rm -d -e POSTGRES_PASSWORD=pw -p 127.0.0.1:55432:5432 postgres:18-alpine; TEST_DATABASE_URL=postgres://postgres:pw@127.0.0.1:55432/postgres'); process.exit(1) }\" && node --conditions=crtr-src --import tsx/esm --test --test-timeout=60000 'packages/crouter-sdk/src/**/__tests__/**/*.pg.test.ts'",
|
|
125
|
-
"test:seam:built": "CRTR_NO_DAEMON_AUTOSTART=1 node scripts/test-lane.mjs -- node --import ./scripts/test-env-scrub.mjs --test --test-concurrency=$(node -p 'Math.min(4, Math.max(2, require(`node:os`).availableParallelism() - 2))') --test-timeout=180000 ${CRTR_TEST_SHARD:+--test-shard=$CRTR_TEST_SHARD} 'dist/**/__tests__/seam/*.test.js'",
|
|
128
|
+
"test:seam:built": "CRTR_NO_DAEMON_AUTOSTART=1 node scripts/test-lane.mjs -- node --import ./scripts/test-env-scrub.mjs --test --test-concurrency=$(node -p 'Math.min(4, Math.max(2, require(`node:os`).availableParallelism() - 2))') --test-timeout=180000 ${CRTR_TEST_SHARD:+--test-shard=$CRTR_TEST_SHARD} 'dist/**/__tests__/seam/*.test.js' scripts/sandbox-bootstrap.test.mjs scripts/sandbox-clone.test.mjs",
|
|
126
129
|
"test:all": "npm test && npm run test:integration && npm run test:seam",
|
|
127
130
|
"test:isolated": "node scripts/test-isolated.mjs",
|
|
128
131
|
"build:identity": "tsc -p packages/crouter-identity/tsconfig.json"
|
|
@@ -141,7 +144,7 @@
|
|
|
141
144
|
},
|
|
142
145
|
"license": "UNLICENSED",
|
|
143
146
|
"dependencies": {
|
|
144
|
-
"@north-light/identity": "0.3.
|
|
147
|
+
"@north-light/identity": "0.3.563",
|
|
145
148
|
"@earendil-works/pi-agent-core": "1.1.0",
|
|
146
149
|
"@earendil-works/pi-ai": "1.1.0",
|
|
147
150
|
"@earendil-works/pi-coding-agent": "1.1.0",
|
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.563",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/cli",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.563",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"workspaces": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@milkdown/preset-gfm": "^7.22.3",
|
|
25
25
|
"@milkdown/prose": "^7.22.3",
|
|
26
26
|
"@milkdown/utils": "^7.22.3",
|
|
27
|
-
"@north-light/identity": "0.3.
|
|
27
|
+
"@north-light/identity": "0.3.563",
|
|
28
28
|
"cron-parser": "^5.6.0",
|
|
29
29
|
"esbuild": "^0.27.7",
|
|
30
30
|
"jose": "^6.2.12",
|
|
@@ -12455,17 +12455,17 @@
|
|
|
12455
12455
|
},
|
|
12456
12456
|
"packages/crouter-api": {
|
|
12457
12457
|
"name": "@north-light/api",
|
|
12458
|
-
"version": "0.3.
|
|
12458
|
+
"version": "0.3.563",
|
|
12459
12459
|
"license": "UNLICENSED"
|
|
12460
12460
|
},
|
|
12461
12461
|
"packages/crouter-env-docker": {
|
|
12462
12462
|
"name": "@north-light/env-docker",
|
|
12463
|
-
"version": "0.3.
|
|
12463
|
+
"version": "0.3.563",
|
|
12464
12464
|
"license": "UNLICENSED"
|
|
12465
12465
|
},
|
|
12466
12466
|
"packages/crouter-identity": {
|
|
12467
12467
|
"name": "@north-light/identity",
|
|
12468
|
-
"version": "0.3.
|
|
12468
|
+
"version": "0.3.563",
|
|
12469
12469
|
"license": "UNLICENSED",
|
|
12470
12470
|
"dependencies": {
|
|
12471
12471
|
"jose": "^6.2.1"
|
|
@@ -12473,21 +12473,21 @@
|
|
|
12473
12473
|
},
|
|
12474
12474
|
"packages/crouter-plugin": {
|
|
12475
12475
|
"name": "@north-light/plugin",
|
|
12476
|
-
"version": "0.3.
|
|
12476
|
+
"version": "0.3.563",
|
|
12477
12477
|
"license": "UNLICENSED",
|
|
12478
12478
|
"dependencies": {
|
|
12479
|
-
"@north-light/api": "0.3.
|
|
12480
|
-
"@north-light/identity": "0.3.
|
|
12479
|
+
"@north-light/api": "0.3.563",
|
|
12480
|
+
"@north-light/identity": "0.3.563"
|
|
12481
12481
|
}
|
|
12482
12482
|
},
|
|
12483
12483
|
"packages/crouter-sdk": {
|
|
12484
12484
|
"name": "@north-light/sdk",
|
|
12485
|
-
"version": "0.3.
|
|
12485
|
+
"version": "0.3.563",
|
|
12486
12486
|
"license": "UNLICENSED",
|
|
12487
12487
|
"dependencies": {
|
|
12488
|
-
"@north-light/api": "0.3.
|
|
12489
|
-
"@north-light/identity": "0.3.
|
|
12490
|
-
"@north-light/plugin": "0.3.
|
|
12488
|
+
"@north-light/api": "0.3.563",
|
|
12489
|
+
"@north-light/identity": "0.3.563",
|
|
12490
|
+
"@north-light/plugin": "0.3.563",
|
|
12491
12491
|
"jose": "^6.2.1"
|
|
12492
12492
|
},
|
|
12493
12493
|
"bin": {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// scripts/git-credential-crtr — git credential helper for github.com (design-fleet, Components: Git credential helper; C-A2).
|
|
3
|
+
// `git-credential-crtr get` reads git's key=value request on stdin and answers username/password from
|
|
4
|
+
// `POST /v1/environments/<id>/git-credential` through the broker's relay socket (`CRTR_API_SOCKET`), which holds the
|
|
5
|
+
// node token; this process never sees it. It caches nothing. `store` and `erase` do nothing.
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
import { request } from 'node:http';
|
|
8
|
+
|
|
9
|
+
const [, , action] = process.argv;
|
|
10
|
+
if (action !== 'get') process.exit(0);
|
|
11
|
+
|
|
12
|
+
const fields = Object.fromEntries(readFileSync(0, 'utf8').split('\n').filter((l) => l.includes('=')).map((l) => [l.slice(0, l.indexOf('=')), l.slice(l.indexOf('=') + 1)]));
|
|
13
|
+
if (fields.host !== 'github.com') process.exit(0);
|
|
14
|
+
|
|
15
|
+
const fail = (message) => { process.stderr.write(`git-credential-crtr: ${message}\n`); process.exit(1); };
|
|
16
|
+
const socketPath = process.env.CRTR_API_SOCKET ?? fail('CRTR_API_SOCKET is not set');
|
|
17
|
+
let environmentId = process.env.CRTR_ENVIRONMENT_ID;
|
|
18
|
+
if (!environmentId) {
|
|
19
|
+
try { environmentId = readFileSync(`${process.env.CRTR_HOME ?? '/var/lib/crtr'}/environment-id`, 'utf8').trim(); } catch { fail('the environment id is unknown'); }
|
|
20
|
+
}
|
|
21
|
+
const body = JSON.stringify({ host: fields.host, ...(fields.path ? { path: fields.path } : {}) });
|
|
22
|
+
const req = request({ socketPath, path: `/v1/environments/${environmentId}/git-credential`, method: 'POST', headers: { 'content-type': 'application/json', 'content-length': Buffer.byteLength(body) }, timeout: 30_000 }, (res) => {
|
|
23
|
+
let text = '';
|
|
24
|
+
res.on('data', (c) => { text += c; });
|
|
25
|
+
res.on('end', () => {
|
|
26
|
+
if (res.statusCode !== 200) return fail(`the control plane answered ${res.statusCode}: ${text.slice(0, 300)}`);
|
|
27
|
+
const out = JSON.parse(text);
|
|
28
|
+
process.stdout.write(`username=${out.username}\npassword=${out.password}\npasswordExpiryUtc=${Math.floor(Date.parse(out.expiry) / 1000)}\n`);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
req.on('error', (e) => fail(e.message));
|
|
32
|
+
req.on('timeout', () => { req.destroy(); fail('timed out'); });
|
|
33
|
+
req.end(body);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# scripts/sandbox-bootstrap.sh — the Blaxel runner's process command (design-fleet, Wake call step 5; C-A2).
|
|
3
|
+
#
|
|
4
|
+
# Runs as root in the sandbox's `broker-<execution id>` process. Environment: CRTR_NODE_TOKEN, CRTR_RELEASE,
|
|
5
|
+
# CRTR_RELEASE_URL, CRTR_RELEASE_SHA256 and the rest the runner set. Once per sandbox it creates the `crtr` user
|
|
6
|
+
# (`crtrd` refuses root) and its directories; it installs the release if it is absent (download, sha256 check,
|
|
7
|
+
# unpack into a temp dir, rename into place, keep three), then hands over to `crtr-sandbox-start` as `crtr`.
|
|
8
|
+
# The node token reaches the start script on stdin, never in its environment, so no process of user `crtr` can
|
|
9
|
+
# read it from /proc. A failed download or checksum exits non-zero and prints `crtr-sandbox-start: failed <reason>`
|
|
10
|
+
# as its last line (the runner's `status` reports that reason).
|
|
11
|
+
set -eu
|
|
12
|
+
|
|
13
|
+
fail() { echo "crtr-sandbox-start: failed $1${2:+ ($2)}" >&2; exit "${3:-1}"; }
|
|
14
|
+
|
|
15
|
+
: "${CRTR_RELEASE:?}" "${CRTR_RELEASE_URL:?}" "${CRTR_RELEASE_SHA256:?}" "${CRTR_NODE_TOKEN:?}"
|
|
16
|
+
case "$CRTR_RELEASE" in *[!A-Za-z0-9._-]*|'') fail bad_release "$CRTR_RELEASE" ;; esac
|
|
17
|
+
|
|
18
|
+
ROOT=${CRTR_SANDBOX_ROOT:-/opt/crtr}
|
|
19
|
+
RELEASES="$ROOT/releases"
|
|
20
|
+
RELEASE_DIR="$RELEASES/$CRTR_RELEASE"
|
|
21
|
+
RUN_USER=${CRTR_RUN_USER:-crtr}
|
|
22
|
+
|
|
23
|
+
if ! id "$RUN_USER" >/dev/null 2>&1; then
|
|
24
|
+
adduser -D -h "/home/$RUN_USER" -s /bin/sh "$RUN_USER" || fail user_create
|
|
25
|
+
fi
|
|
26
|
+
mkdir -p /run/crtr /var/lib/crtr /work "$RELEASES"
|
|
27
|
+
chown "$RUN_USER" /run/crtr /var/lib/crtr /work
|
|
28
|
+
# pi's grep tool wants ripgrep; installing it once per sandbox avoids a GitHub download at the first grep.
|
|
29
|
+
if ! command -v rg >/dev/null 2>&1; then apk add --no-cache ripgrep >/dev/null 2>&1 || echo "crtr-sandbox-start: ripgrep not installed" >&2; fi
|
|
30
|
+
|
|
31
|
+
if [ ! -f "$RELEASE_DIR/.complete" ]; then
|
|
32
|
+
tmp=$(mktemp -d "$RELEASES/.tmp.XXXXXX")
|
|
33
|
+
trap 'rm -rf "$tmp"' EXIT
|
|
34
|
+
wget -q -O "$tmp/runtime.tar.gz" "$CRTR_RELEASE_URL" || fail release_download "$CRTR_RELEASE"
|
|
35
|
+
actual=$(sha256sum "$tmp/runtime.tar.gz" | cut -d' ' -f1)
|
|
36
|
+
[ "$actual" = "$CRTR_RELEASE_SHA256" ] || fail release_checksum "expected $CRTR_RELEASE_SHA256, got $actual"
|
|
37
|
+
mkdir "$tmp/unpack"
|
|
38
|
+
tar -xzf "$tmp/runtime.tar.gz" -C "$tmp/unpack" || fail release_unpack
|
|
39
|
+
: > "$tmp/unpack/.complete"
|
|
40
|
+
# A concurrent start installing the same release wins the rename; both leave a complete directory.
|
|
41
|
+
if ! mv "$tmp/unpack" "$RELEASE_DIR" 2>/dev/null; then [ -f "$RELEASE_DIR/.complete" ] || fail release_install; fi
|
|
42
|
+
rm -rf "$tmp"
|
|
43
|
+
trap - EXIT
|
|
44
|
+
fi
|
|
45
|
+
ln -sfn "$RELEASE_DIR" "$ROOT/current.new" && mv -T "$ROOT/current.new" "$ROOT/current"
|
|
46
|
+
# Keep the three newest releases (the current one among them).
|
|
47
|
+
ls -1t "$RELEASES" 2>/dev/null | grep -v '^\.' | tail -n +4 | while read -r old; do
|
|
48
|
+
[ "$old" = "$CRTR_RELEASE" ] || rm -rf "${RELEASES:?}/$old"
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
token=$CRTR_NODE_TOKEN
|
|
52
|
+
unset CRTR_NODE_TOKEN
|
|
53
|
+
# `su -p` keeps the rest of the environment; the start script derives HOME and the layout itself.
|
|
54
|
+
printf '%s' "$token" | exec su -p -s /bin/sh "$RUN_USER" -c "exec node '$RELEASE_DIR/scripts/sandbox-start.mjs'"
|