@wjarka/cezarion 0.10.0-pr30.54
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/LICENSE +21 -0
- package/README.md +838 -0
- package/dist/agent-config/account-identity.d.ts +44 -0
- package/dist/agent-config/account-identity.js +128 -0
- package/dist/agent-config/account-identity.js.map +1 -0
- package/dist/agent-config/catalog.d.ts +72 -0
- package/dist/agent-config/catalog.js +223 -0
- package/dist/agent-config/catalog.js.map +1 -0
- package/dist/agent-config/files.d.ts +46 -0
- package/dist/agent-config/files.js +119 -0
- package/dist/agent-config/files.js.map +1 -0
- package/dist/agent-config/model-settings/claude.d.ts +2 -0
- package/dist/agent-config/model-settings/claude.js +11 -0
- package/dist/agent-config/model-settings/claude.js.map +1 -0
- package/dist/agent-config/model-settings/codex.d.ts +2 -0
- package/dist/agent-config/model-settings/codex.js +16 -0
- package/dist/agent-config/model-settings/codex.js.map +1 -0
- package/dist/agent-config/model-settings/opencode.d.ts +2 -0
- package/dist/agent-config/model-settings/opencode.js +8 -0
- package/dist/agent-config/model-settings/opencode.js.map +1 -0
- package/dist/agent-config/model-settings/pi.d.ts +12 -0
- package/dist/agent-config/model-settings/pi.js +18 -0
- package/dist/agent-config/model-settings/pi.js.map +1 -0
- package/dist/agent-config/model-settings/shared.d.ts +9 -0
- package/dist/agent-config/model-settings/shared.js +93 -0
- package/dist/agent-config/model-settings/shared.js.map +1 -0
- package/dist/agent-config/model-settings/types.d.ts +9 -0
- package/dist/agent-config/model-settings/types.js +2 -0
- package/dist/agent-config/model-settings/types.js.map +1 -0
- package/dist/agent-config/models.d.ts +9 -0
- package/dist/agent-config/models.js +32 -0
- package/dist/agent-config/models.js.map +1 -0
- package/dist/agent-config/seed.d.ts +7 -0
- package/dist/agent-config/seed.js +90 -0
- package/dist/agent-config/seed.js.map +1 -0
- package/dist/agent-config/service.d.ts +44 -0
- package/dist/agent-config/service.js +71 -0
- package/dist/agent-config/service.js.map +1 -0
- package/dist/agent-config/validate.d.ts +21 -0
- package/dist/agent-config/validate.js +76 -0
- package/dist/agent-config/validate.js.map +1 -0
- package/dist/automations/coordinator.d.ts +26 -0
- package/dist/automations/coordinator.js +66 -0
- package/dist/automations/coordinator.js.map +1 -0
- package/dist/automations/github-poller.d.ts +74 -0
- package/dist/automations/github-poller.js +234 -0
- package/dist/automations/github-poller.js.map +1 -0
- package/dist/automations/scheduler.d.ts +42 -0
- package/dist/automations/scheduler.js +192 -0
- package/dist/automations/scheduler.js.map +1 -0
- package/dist/automations/store.d.ts +65 -0
- package/dist/automations/store.js +298 -0
- package/dist/automations/store.js.map +1 -0
- package/dist/automations/task-template.d.ts +18 -0
- package/dist/automations/task-template.js +95 -0
- package/dist/automations/task-template.js.map +1 -0
- package/dist/automations/types.d.ts +255 -0
- package/dist/automations/types.js +159 -0
- package/dist/automations/types.js.map +1 -0
- package/dist/config.d.ts +77 -0
- package/dist/config.js +242 -0
- package/dist/config.js.map +1 -0
- package/dist/contract/agent-config.d.ts +153 -0
- package/dist/contract/agent-profiles.d.ts +347 -0
- package/dist/contract/automations.d.ts +935 -0
- package/dist/contract/events.d.ts +104 -0
- package/dist/contract/github.d.ts +556 -0
- package/dist/contract/health.d.ts +102 -0
- package/dist/contract/index.d.ts +16 -0
- package/dist/contract/index.js +1895 -0
- package/dist/contract/projects.d.ts +210 -0
- package/dist/contract/repo.d.ts +234 -0
- package/dist/contract/runs.d.ts +1473 -0
- package/dist/contract/skills.d.ts +232 -0
- package/dist/contract/workflows.d.ts +218 -0
- package/dist/contract/workspace.d.ts +579 -0
- package/dist/core/agent-env.d.ts +31 -0
- package/dist/core/agent-env.js +371 -0
- package/dist/core/agent-env.js.map +1 -0
- package/dist/core/agent-model-policy.d.ts +10 -0
- package/dist/core/agent-model-policy.js +36 -0
- package/dist/core/agent-model-policy.js.map +1 -0
- package/dist/core/agent-profiles.d.ts +62 -0
- package/dist/core/agent-profiles.js +90 -0
- package/dist/core/agent-profiles.js.map +1 -0
- package/dist/core/agent-runner.d.ts +211 -0
- package/dist/core/agent-runner.js +68 -0
- package/dist/core/agent-runner.js.map +1 -0
- package/dist/core/ask.d.ts +105 -0
- package/dist/core/ask.js +187 -0
- package/dist/core/ask.js.map +1 -0
- package/dist/core/backend-detect.d.ts +16 -0
- package/dist/core/backend-detect.js +155 -0
- package/dist/core/backend-detect.js.map +1 -0
- package/dist/core/claude-cli-runner.d.ts +59 -0
- package/dist/core/claude-cli-runner.js +483 -0
- package/dist/core/claude-cli-runner.js.map +1 -0
- package/dist/core/claude-ui-mapper.d.ts +80 -0
- package/dist/core/claude-ui-mapper.js +598 -0
- package/dist/core/claude-ui-mapper.js.map +1 -0
- package/dist/core/codex-app-server-runner.d.ts +41 -0
- package/dist/core/codex-app-server-runner.js +584 -0
- package/dist/core/codex-app-server-runner.js.map +1 -0
- package/dist/core/codex-app-server-transport.d.ts +35 -0
- package/dist/core/codex-app-server-transport.js +150 -0
- package/dist/core/codex-app-server-transport.js.map +1 -0
- package/dist/core/codex-model-catalog.d.ts +10 -0
- package/dist/core/codex-model-catalog.js +110 -0
- package/dist/core/codex-model-catalog.js.map +1 -0
- package/dist/core/codex-ui-mapper.d.ts +112 -0
- package/dist/core/codex-ui-mapper.js +766 -0
- package/dist/core/codex-ui-mapper.js.map +1 -0
- package/dist/core/model-identity.d.ts +125 -0
- package/dist/core/model-identity.js +132 -0
- package/dist/core/model-identity.js.map +1 -0
- package/dist/core/model-presets.d.ts +21 -0
- package/dist/core/model-presets.js +81 -0
- package/dist/core/model-presets.js.map +1 -0
- package/dist/core/ndjson.d.ts +6 -0
- package/dist/core/ndjson.js +23 -0
- package/dist/core/ndjson.js.map +1 -0
- package/dist/core/opencode-model-catalog.d.ts +32 -0
- package/dist/core/opencode-model-catalog.js +153 -0
- package/dist/core/opencode-model-catalog.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +32 -0
- package/dist/core/opencode-server-runner.js +882 -0
- package/dist/core/opencode-server-runner.js.map +1 -0
- package/dist/core/opencode-ui-mapper.d.ts +137 -0
- package/dist/core/opencode-ui-mapper.js +800 -0
- package/dist/core/opencode-ui-mapper.js.map +1 -0
- package/dist/core/pi-model-catalog.d.ts +31 -0
- package/dist/core/pi-model-catalog.js +152 -0
- package/dist/core/pi-model-catalog.js.map +1 -0
- package/dist/core/pi-runner.d.ts +24 -0
- package/dist/core/pi-runner.js +403 -0
- package/dist/core/pi-runner.js.map +1 -0
- package/dist/core/pi-ui-mapper.d.ts +36 -0
- package/dist/core/pi-ui-mapper.js +304 -0
- package/dist/core/pi-ui-mapper.js.map +1 -0
- package/dist/core/process-usage.d.ts +66 -0
- package/dist/core/process-usage.js +193 -0
- package/dist/core/process-usage.js.map +1 -0
- package/dist/core/provider-auth.d.ts +154 -0
- package/dist/core/provider-auth.js +509 -0
- package/dist/core/provider-auth.js.map +1 -0
- package/dist/core/provider-availability.d.ts +3 -0
- package/dist/core/provider-availability.js +14 -0
- package/dist/core/provider-availability.js.map +1 -0
- package/dist/core/runner-factory.d.ts +8 -0
- package/dist/core/runner-factory.js +25 -0
- package/dist/core/runner-factory.js.map +1 -0
- package/dist/core/runner-model-catalog.d.ts +29 -0
- package/dist/core/runner-model-catalog.js +78 -0
- package/dist/core/runner-model-catalog.js.map +1 -0
- package/dist/core/secret-redaction.d.ts +37 -0
- package/dist/core/secret-redaction.js +115 -0
- package/dist/core/secret-redaction.js.map +1 -0
- package/dist/core/shell-env.d.ts +28 -0
- package/dist/core/shell-env.js +56 -0
- package/dist/core/shell-env.js.map +1 -0
- package/dist/core/tool-display.d.ts +31 -0
- package/dist/core/tool-display.js +179 -0
- package/dist/core/tool-display.js.map +1 -0
- package/dist/core/ui-events.d.ts +335 -0
- package/dist/core/ui-events.js +25 -0
- package/dist/core/ui-events.js.map +1 -0
- package/dist/core/usage-limit.d.ts +42 -0
- package/dist/core/usage-limit.js +209 -0
- package/dist/core/usage-limit.js.map +1 -0
- package/dist/core/usage.d.ts +11 -0
- package/dist/core/usage.js +15 -0
- package/dist/core/usage.js.map +1 -0
- package/dist/core/v1-text-coalescer.d.ts +36 -0
- package/dist/core/v1-text-coalescer.js +72 -0
- package/dist/core/v1-text-coalescer.js.map +1 -0
- package/dist/git-diff-base.d.ts +85 -0
- package/dist/git-diff-base.js +180 -0
- package/dist/git-diff-base.js.map +1 -0
- package/dist/git-refs.d.ts +11 -0
- package/dist/git-refs.js +14 -0
- package/dist/git-refs.js.map +1 -0
- package/dist/git-worktree.d.ts +161 -0
- package/dist/git-worktree.js +508 -0
- package/dist/git-worktree.js.map +1 -0
- package/dist/handoff.d.ts +62 -0
- package/dist/handoff.js +154 -0
- package/dist/handoff.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +680 -0
- package/dist/index.js.map +1 -0
- package/dist/install-as-command.d.ts +40 -0
- package/dist/install-as-command.js +52 -0
- package/dist/install-as-command.js.map +1 -0
- package/dist/pack-check.d.ts +17 -0
- package/dist/pack-check.js +27 -0
- package/dist/pack-check.js.map +1 -0
- package/dist/paths.d.ts +140 -0
- package/dist/paths.js +192 -0
- package/dist/paths.js.map +1 -0
- package/dist/planner.d.ts +27 -0
- package/dist/planner.js +268 -0
- package/dist/planner.js.map +1 -0
- package/dist/release/manifests.d.ts +81 -0
- package/dist/release/manifests.js +74 -0
- package/dist/release/manifests.js.map +1 -0
- package/dist/release/snapshot.d.ts +67 -0
- package/dist/release/snapshot.js +97 -0
- package/dist/release/snapshot.js.map +1 -0
- package/dist/release/stable.d.ts +38 -0
- package/dist/release/stable.js +55 -0
- package/dist/release/stable.js.map +1 -0
- package/dist/runs/agent-tmpdir.d.ts +41 -0
- package/dist/runs/agent-tmpdir.js +183 -0
- package/dist/runs/agent-tmpdir.js.map +1 -0
- package/dist/runs/auto-name.d.ts +75 -0
- package/dist/runs/auto-name.js +179 -0
- package/dist/runs/auto-name.js.map +1 -0
- package/dist/runs/event-history.d.ts +50 -0
- package/dist/runs/event-history.js +613 -0
- package/dist/runs/event-history.js.map +1 -0
- package/dist/runs/retention.d.ts +60 -0
- package/dist/runs/retention.js +86 -0
- package/dist/runs/retention.js.map +1 -0
- package/dist/runs/review-gate.d.ts +18 -0
- package/dist/runs/review-gate.js +21 -0
- package/dist/runs/review-gate.js.map +1 -0
- package/dist/runs/run-index.d.ts +19 -0
- package/dist/runs/run-index.js +43 -0
- package/dist/runs/run-index.js.map +1 -0
- package/dist/runs/store.d.ts +446 -0
- package/dist/runs/store.js +1118 -0
- package/dist/runs/store.js.map +1 -0
- package/dist/runs/task-markers.d.ts +28 -0
- package/dist/runs/task-markers.js +74 -0
- package/dist/runs/task-markers.js.map +1 -0
- package/dist/runs/task-refs.d.ts +25 -0
- package/dist/runs/task-refs.js +74 -0
- package/dist/runs/task-refs.js.map +1 -0
- package/dist/runs/ui-event-sink.d.ts +81 -0
- package/dist/runs/ui-event-sink.js +210 -0
- package/dist/runs/ui-event-sink.js.map +1 -0
- package/dist/server/app-type.d.ts +21 -0
- package/dist/server/app-type.js +2 -0
- package/dist/server/app-type.js.map +1 -0
- package/dist/server/capabilities.d.ts +70 -0
- package/dist/server/capabilities.js +152 -0
- package/dist/server/capabilities.js.map +1 -0
- package/dist/server/checkout.d.ts +128 -0
- package/dist/server/checkout.js +296 -0
- package/dist/server/checkout.js.map +1 -0
- package/dist/server/forge/github.d.ts +513 -0
- package/dist/server/forge/github.js +2364 -0
- package/dist/server/forge/github.js.map +1 -0
- package/dist/server/forge/index.d.ts +40 -0
- package/dist/server/forge/index.js +72 -0
- package/dist/server/forge/index.js.map +1 -0
- package/dist/server/forge/types.d.ts +242 -0
- package/dist/server/forge/types.js +2 -0
- package/dist/server/forge/types.js.map +1 -0
- package/dist/server/fs-browse.d.ts +105 -0
- package/dist/server/fs-browse.js +182 -0
- package/dist/server/fs-browse.js.map +1 -0
- package/dist/server/git-changes.d.ts +213 -0
- package/dist/server/git-changes.js +555 -0
- package/dist/server/git-changes.js.map +1 -0
- package/dist/server/git.d.ts +28 -0
- package/dist/server/git.js +112 -0
- package/dist/server/git.js.map +1 -0
- package/dist/server/github.d.ts +9 -0
- package/dist/server/github.js +8 -0
- package/dist/server/github.js.map +1 -0
- package/dist/server/launch-key.d.ts +7 -0
- package/dist/server/launch-key.js +33 -0
- package/dist/server/launch-key.js.map +1 -0
- package/dist/server/open-in-app.d.ts +66 -0
- package/dist/server/open-in-app.js +211 -0
- package/dist/server/open-in-app.js.map +1 -0
- package/dist/server/open-in-terminal.d.ts +70 -0
- package/dist/server/open-in-terminal.js +179 -0
- package/dist/server/open-in-terminal.js.map +1 -0
- package/dist/server/pr.d.ts +7 -0
- package/dist/server/pr.js +7 -0
- package/dist/server/pr.js.map +1 -0
- package/dist/server/project-context.d.ts +120 -0
- package/dist/server/project-context.js +182 -0
- package/dist/server/project-context.js.map +1 -0
- package/dist/server/provider-action-gate.d.ts +8 -0
- package/dist/server/provider-action-gate.js +56 -0
- package/dist/server/provider-action-gate.js.map +1 -0
- package/dist/server/provider-auth-runtime.d.ts +21 -0
- package/dist/server/provider-auth-runtime.js +66 -0
- package/dist/server/provider-auth-runtime.js.map +1 -0
- package/dist/server/server.d.ts +13138 -0
- package/dist/server/server.js +5263 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/static-ui.d.ts +49 -0
- package/dist/server/static-ui.js +92 -0
- package/dist/server/static-ui.js.map +1 -0
- package/dist/server/validators.d.ts +97 -0
- package/dist/server/validators.js +86 -0
- package/dist/server/validators.js.map +1 -0
- package/dist/server/ws.d.ts +85 -0
- package/dist/server/ws.js +218 -0
- package/dist/server/ws.js.map +1 -0
- package/dist/server/wsl.d.ts +25 -0
- package/dist/server/wsl.js +92 -0
- package/dist/server/wsl.js.map +1 -0
- package/dist/server-install/engine.d.ts +50 -0
- package/dist/server-install/engine.js +324 -0
- package/dist/server-install/engine.js.map +1 -0
- package/dist/server-install/platforms/macosx-ngrok.d.ts +6 -0
- package/dist/server-install/platforms/macosx-ngrok.js +345 -0
- package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
- package/dist/server-install/platforms/ubuntu-vps.d.ts +78 -0
- package/dist/server-install/platforms/ubuntu-vps.js +1016 -0
- package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
- package/dist/server-install/state.d.ts +52 -0
- package/dist/server-install/state.js +182 -0
- package/dist/server-install/state.js.map +1 -0
- package/dist/server-install/steps.d.ts +109 -0
- package/dist/server-install/steps.js +334 -0
- package/dist/server-install/steps.js.map +1 -0
- package/dist/server-install/strategies.d.ts +4 -0
- package/dist/server-install/strategies.js +20 -0
- package/dist/server-install/strategies.js.map +1 -0
- package/dist/server-install/types.d.ts +287 -0
- package/dist/server-install/types.js +121 -0
- package/dist/server-install/types.js.map +1 -0
- package/dist/server-install/ui.d.ts +42 -0
- package/dist/server-install/ui.js +130 -0
- package/dist/server-install/ui.js.map +1 -0
- package/dist/skills-banner.d.ts +22 -0
- package/dist/skills-banner.js +41 -0
- package/dist/skills-banner.js.map +1 -0
- package/dist/skills-remote.d.ts +84 -0
- package/dist/skills-remote.js +468 -0
- package/dist/skills-remote.js.map +1 -0
- package/dist/skills-update.d.ts +88 -0
- package/dist/skills-update.js +392 -0
- package/dist/skills-update.js.map +1 -0
- package/dist/skills.d.ts +82 -0
- package/dist/skills.js +251 -0
- package/dist/skills.js.map +1 -0
- package/dist/todos.d.ts +48 -0
- package/dist/todos.js +201 -0
- package/dist/todos.js.map +1 -0
- package/dist/ui-state.d.ts +26 -0
- package/dist/ui-state.js +38 -0
- package/dist/ui-state.js.map +1 -0
- package/dist/update-check.d.ts +12 -0
- package/dist/update-check.js +41 -0
- package/dist/update-check.js.map +1 -0
- package/dist/workflows/load.d.ts +15 -0
- package/dist/workflows/load.js +56 -0
- package/dist/workflows/load.js.map +1 -0
- package/dist/workflows/run.d.ts +758 -0
- package/dist/workflows/run.js +3389 -0
- package/dist/workflows/run.js.map +1 -0
- package/dist/workflows/types.d.ts +153 -0
- package/dist/workflows/types.js +212 -0
- package/dist/workflows/types.js.map +1 -0
- package/dist/workspace/agent-accounts.d.ts +153 -0
- package/dist/workspace/agent-accounts.js +304 -0
- package/dist/workspace/agent-accounts.js.map +1 -0
- package/dist/workspace/agent-profiles.d.ts +78 -0
- package/dist/workspace/agent-profiles.js +115 -0
- package/dist/workspace/agent-profiles.js.map +1 -0
- package/dist/workspace/config.d.ts +169 -0
- package/dist/workspace/config.js +379 -0
- package/dist/workspace/config.js.map +1 -0
- package/dist/workspace/migrations.d.ts +45 -0
- package/dist/workspace/migrations.js +147 -0
- package/dist/workspace/migrations.js.map +1 -0
- package/dist/workspace/projects-cli.d.ts +25 -0
- package/dist/workspace/projects-cli.js +172 -0
- package/dist/workspace/projects-cli.js.map +1 -0
- package/dist/workspace/projects.d.ts +109 -0
- package/dist/workspace/projects.js +250 -0
- package/dist/workspace/projects.js.map +1 -0
- package/dist/workspace/semaphore.d.ts +179 -0
- package/dist/workspace/semaphore.js +195 -0
- package/dist/workspace/semaphore.js.map +1 -0
- package/dist/workspace/ui-state.d.ts +34 -0
- package/dist/workspace/ui-state.js +53 -0
- package/dist/workspace/ui-state.js.map +1 -0
- package/package.json +70 -0
- package/scripts/check-pack.mjs +46 -0
- package/scripts/inline-contract.mjs +112 -0
- package/scripts/install-as-command.mjs +120 -0
- package/scripts/mock-claude.mjs +520 -0
- package/scripts/mock-pi-rpc.mjs +83 -0
- package/scripts/sync-readme.mjs +20 -0
- package/scripts/test-process-usage.mjs +47 -0
- package/web/dist/assets/alert-dialog-B4Ofsgv7.js +1 -0
- package/web/dist/assets/arrow-down-Dy8dup7j.js +1 -0
- package/web/dist/assets/arrow-left-BJaucbhn.js +1 -0
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
- package/web/dist/assets/centered-state-duPW0phQ.js +43 -0
- package/web/dist/assets/chevron-right-Be4A5TCS.js +1 -0
- package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
- package/web/dist/assets/collapsible-DdcNBdSk.js +1 -0
- package/web/dist/assets/commit-list-CgvN9vec.js +1 -0
- package/web/dist/assets/compare-variants-CQA2nd65.js +1 -0
- package/web/dist/assets/core-BCsw8oQw.js +12 -0
- package/web/dist/assets/css-BsVw1vtW.js +1 -0
- package/web/dist/assets/diff-B6Agp5Hl.js +3 -0
- package/web/dist/assets/diff-stat-BoXuGkgq.js +1 -0
- package/web/dist/assets/diff-view-CD8XI-fj.js +6 -0
- package/web/dist/assets/diff-woXpYk--.js +1 -0
- package/web/dist/assets/dropdown-menu-B3SYw-k5.js +1 -0
- package/web/dist/assets/editable-title-B-hjp5wl.js +1 -0
- package/web/dist/assets/ellipsis-vertical-BYwzw0xl.js +1 -0
- package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
- package/web/dist/assets/file-BRj5eISx.js +1 -0
- package/web/dist/assets/folder-z4oT5981.js +1 -0
- package/web/dist/assets/git-toolbar-owSEkYld.js +1 -0
- package/web/dist/assets/github-Bz2VgRX3.js +1 -0
- package/web/dist/assets/go-rLFTqkRN.js +1 -0
- package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
- package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
- package/web/dist/assets/html-BY76lXLH.js +1 -0
- package/web/dist/assets/image-preview-h3WFluuy.js +1 -0
- package/web/dist/assets/index-BbcQNT92.css +2 -0
- package/web/dist/assets/index-EtQQQ6Kj.js +7 -0
- package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
- package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/web/dist/assets/json-qhed-kSA.js +1 -0
- package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
- package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
- package/web/dist/assets/lib-BQXq3kEf.js +1 -0
- package/web/dist/assets/lib-BxQXEXDF.js +1 -0
- package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
- package/web/dist/assets/markdown-DqBKYPiB.js +2 -0
- package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
- package/web/dist/assets/new-task-form-BdJKRBJX.js +1 -0
- package/web/dist/assets/pill-BQfmfpYp.js +1 -0
- package/web/dist/assets/project-router-DxgFZY1l.js +1 -0
- package/web/dist/assets/prompt-templates-B6m16gq-.js +15 -0
- package/web/dist/assets/python-gzcpVVnB.js +1 -0
- package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
- package/web/dist/assets/refresh-cw-mhSpxf2a.js +1 -0
- package/web/dist/assets/repo-git-CUNRxR3_.js +1 -0
- package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/web/dist/assets/run-diff-DsmmDVfx.js +3 -0
- package/web/dist/assets/run-header-BkhrseLJ.js +1 -0
- package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
- package/web/dist/assets/search-x-BqDMB2g8.js +1 -0
- package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
- package/web/dist/assets/skill-empty-hint-BWEvTggc.js +1 -0
- package/web/dist/assets/skills-9oR_oHse.js +1 -0
- package/web/dist/assets/skills-DwIxnnWO.js +1 -0
- package/web/dist/assets/sparkles-DIoTQpyx.js +1 -0
- package/web/dist/assets/sql-BsFa4tDR.js +1 -0
- package/web/dist/assets/square-terminal-Cc7CuQxc.js +1 -0
- package/web/dist/assets/tab-link-D1fQgpmO.js +1 -0
- package/web/dist/assets/task-changes-BKeLlDpK.js +1 -0
- package/web/dist/assets/task-commits-gcEFZIa5.js +1 -0
- package/web/dist/assets/task-files-BGAqoXTW.js +2 -0
- package/web/dist/assets/task-thread-DT8aUYTS.js +9 -0
- package/web/dist/assets/textarea-BOVbfy5C.js +1 -0
- package/web/dist/assets/thread-loading-CypW73KD.js +1 -0
- package/web/dist/assets/toml-CcmNWLt0.js +1 -0
- package/web/dist/assets/trash-2-CJq6LHWn.js +1 -0
- package/web/dist/assets/triangle-alert-CjDFvU27.js +1 -0
- package/web/dist/assets/tsx-udAQXfEw.js +1 -0
- package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
- package/web/dist/assets/upload-CPDZlJeK.js +1 -0
- package/web/dist/assets/use-desktop-5JsLmi0a.js +1 -0
- package/web/dist/assets/use-submit-shortcut-CHVFevty.js +1 -0
- package/web/dist/assets/utils-DiO6zyJd.js +64 -0
- package/web/dist/assets/workflows-rQDFzWRt.js +11 -0
- package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
- package/web/dist/assets/zoomable-image-COWqb11v.js +1 -0
- package/web/dist/index.html +80 -0
- package/web/dist/open-mercato.svg +11 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Stable-release decisions — the pure half of `scripts/release.mjs`.
|
|
2
|
+
*
|
|
3
|
+
* Sibling of `snapshot.ts`, but for the *owner-driven* `latest` channel. The
|
|
4
|
+
* `Release` workflow (`.github/workflows/release.yml`) is run manually and
|
|
5
|
+
* never fires from a push, so — unlike snapshots — a stable release is the only
|
|
6
|
+
* thing that ever moves the `latest` dist-tag (spec
|
|
7
|
+
* `.ai/specs/2026-07-18-npm-preview-publish.md`, #482).
|
|
8
|
+
*
|
|
9
|
+
* Two decisions live here so they stay unit-testable and side-effect-free: the next stable
|
|
10
|
+
* version for a given bump, and the pin style the release set is stamped with. Crucially,
|
|
11
|
+
* stable releases use a **caret** range — the opposite of the snapshot stamper's exact pin —
|
|
12
|
+
* so a stable `cezarion` picks up compatible patch releases of the implementation package.
|
|
13
|
+
*/
|
|
14
|
+
import { stampManifestSet } from './manifests.js';
|
|
15
|
+
export const RELEASE_BUMPS = ['patch', 'minor', 'major', 'existing'];
|
|
16
|
+
export function isReleaseBump(value) {
|
|
17
|
+
return RELEASE_BUMPS.includes(value);
|
|
18
|
+
}
|
|
19
|
+
/** Compute the next stable version from the current base and a bump mode.
|
|
20
|
+
*
|
|
21
|
+
* `base` must be a plain `major.minor.patch` (no prerelease/build suffix) — a
|
|
22
|
+
* stable release should never start from a snapshot version. `existing` returns
|
|
23
|
+
* the base verbatim; the increments zero out the lower components the way
|
|
24
|
+
* `npm version` does. Returns `null` for an unparseable base so the caller can
|
|
25
|
+
* fail loudly instead of publishing a garbage version. */
|
|
26
|
+
export function computeStableVersion(bump, base) {
|
|
27
|
+
const m = /^(\d+)\.(\d+)\.(\d+)$/.exec(base.trim());
|
|
28
|
+
if (!m)
|
|
29
|
+
return null;
|
|
30
|
+
const [major, minor, patch] = [Number(m[1]), Number(m[2]), Number(m[3])];
|
|
31
|
+
switch (bump) {
|
|
32
|
+
case 'existing':
|
|
33
|
+
return `${major}.${minor}.${patch}`;
|
|
34
|
+
case 'patch':
|
|
35
|
+
return `${major}.${minor}.${patch + 1}`;
|
|
36
|
+
case 'minor':
|
|
37
|
+
return `${major}.${minor + 1}.0`;
|
|
38
|
+
case 'major':
|
|
39
|
+
return `${major + 1}.0.0`;
|
|
40
|
+
default:
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Stamp the release set to a stable version.
|
|
45
|
+
*
|
|
46
|
+
* Mirror of `stampSnapshotManifests`, differing in exactly one decision: intra-release
|
|
47
|
+
* dependencies get a **caret** range (`^0.1.6`), not an exact pin. A stable `cezarion` should
|
|
48
|
+
* follow compatible releases of the implementation package, and a stable service should follow
|
|
49
|
+
* compatible releases of the api-client; a snapshot must pin the one exact build it was cut
|
|
50
|
+
* from. Everything else — which manifests exist, which sections carry the pin, what the alias
|
|
51
|
+
* inherits — lives in `manifests.ts` so the two channels cannot drift apart. */
|
|
52
|
+
export function stampStableManifests(manifests, version) {
|
|
53
|
+
return stampManifestSet(manifests, version, (v) => `^${v}`);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=stable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stable.js","sourceRoot":"","sources":["../../src/release/stable.ts"],"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EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Where a run's agent-scoped temp directory lives. */
|
|
2
|
+
export declare function agentTmpDir(dataDir: string, runId: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* The preflight's failure. Named so the spawn path can tell it apart from an
|
|
5
|
+
* ordinary crash and turn it into the run's `error` — the same treatment
|
|
6
|
+
* `ModelIdentityError` gets, and the same channel the thread footer renders.
|
|
7
|
+
*/
|
|
8
|
+
export declare class AgentTempDirError extends Error {
|
|
9
|
+
readonly path: string;
|
|
10
|
+
constructor(path: string, reason: unknown);
|
|
11
|
+
}
|
|
12
|
+
/** Opt-out spelling matches the house style for default-on behaviour
|
|
13
|
+
* (`CEZ_AUTONAME=0`, `CEZ_SKILLS_AUTO_UPDATE=0`): only an exact `0` disables. */
|
|
14
|
+
export declare function agentTmpDirEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The `TMPDIR`/`TEMP`/`TMP` overrides for this run, after proving the resolved
|
|
17
|
+
* directory actually accepts writes. Throws `AgentTempDirError` when it does
|
|
18
|
+
* not — callers turn that into the run's error rather than spawning.
|
|
19
|
+
*
|
|
20
|
+
* All three spellings are set, on every platform: a tool that reads `TMP` (or
|
|
21
|
+
* `TEMP`) would otherwise keep following the host value straight back to the
|
|
22
|
+
* exhausted directory this exists to escape.
|
|
23
|
+
*
|
|
24
|
+
* Returns `{}` under the opt-out, without probing anything: the hatch turns the
|
|
25
|
+
* whole feature off, preflight included, so it stays an escape someone can
|
|
26
|
+
* actually take.
|
|
27
|
+
*/
|
|
28
|
+
export declare function agentTmpEnv(dataDir: string, runId: string, env?: NodeJS.ProcessEnv): Record<string, string>;
|
|
29
|
+
/**
|
|
30
|
+
* Reap one run's directory. Scratch, not an artifact: nothing reads it once the
|
|
31
|
+
* agent is gone, and a Continue re-creates it through `agentTmpEnv`. Never
|
|
32
|
+
* throws — reaping must not break a terminal transition.
|
|
33
|
+
*/
|
|
34
|
+
export declare function removeAgentTmpDir(dataDir: string, runId: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Remove every per-run directory that is not in `keepRunIds` — the startup
|
|
37
|
+
* sweep, so a crash (which never reaches the terminal-transition reap) cannot
|
|
38
|
+
* accumulate them forever. Confined to `<dataDir>/tmp`; sibling run state is
|
|
39
|
+
* never enumerated, let alone touched. Returns the ids actually reaped.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sweepAgentTmpDirs(dataDir: string, keepRunIds: Iterable<string>): string[];
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task-scoped temp directory for spawned agents (#785).
|
|
3
|
+
*
|
|
4
|
+
* Every agent used to inherit the host's `TMPDIR`/`TEMP`/`TMP` verbatim — they
|
|
5
|
+
* ride in on `buildChildEnv`'s base allowlist — so every run on the machine
|
|
6
|
+
* shared one directory. On a box that runs agents continuously and never
|
|
7
|
+
* reboots, that directory is a tmpfs nobody reaps, and once it hits its quota
|
|
8
|
+
* the failure is *silent*: the Claude Code CLI roots its scratch tree at
|
|
9
|
+
* `os.tmpdir()` and round-trips each `Bash` command's stdout/stderr through a
|
|
10
|
+
* file there. Under `EDQUOT` the inode is still allocated, so the file is
|
|
11
|
+
* created and the write fails — the command runs, its side effects land, and
|
|
12
|
+
* the agent reads back an empty result with a bogus exit status. Nothing in the
|
|
13
|
+
* cockpit says anything is wrong.
|
|
14
|
+
*
|
|
15
|
+
* Two properties fix that, and this module owns both:
|
|
16
|
+
*
|
|
17
|
+
* 1. **Isolation** — each run gets `<dataDir>/tmp/<runId>`, on the same disk
|
|
18
|
+
* as the run's own state rather than a shared tmpfs, reaped when the run
|
|
19
|
+
* ends. `buildChildEnv` applies the per-run env last, so these values win
|
|
20
|
+
* over the host's without any allowlist change.
|
|
21
|
+
* 2. **Fail loud** — the directory is write-probed before the backend spawns.
|
|
22
|
+
* A run that cannot get a working temp directory fails immediately with a
|
|
23
|
+
* named, actionable error instead of spawning an agent that will run blind.
|
|
24
|
+
*
|
|
25
|
+
* `CEZ_AGENT_TMPDIR=0` opts out of BOTH — cezar keeps its hands off the temp
|
|
26
|
+
* directory entirely and the pre-#785 behaviour is back, byte for byte. That is
|
|
27
|
+
* deliberate: an escape hatch that still imposed the preflight would be a hatch
|
|
28
|
+
* you cannot actually escape through, and this repo's graceful-degradation rule
|
|
29
|
+
* says a new check must never become the only way to run.
|
|
30
|
+
*/
|
|
31
|
+
import { existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
32
|
+
import { join } from 'node:path';
|
|
33
|
+
/** Run ids are uuids; anything else must never reach a recursive `rmSync`.
|
|
34
|
+
*
|
|
35
|
+
* `.` and `..` are excluded explicitly, not as pedantry: they match the
|
|
36
|
+
* character class, and `join(dataDir, 'tmp', '..')` resolves to `<dataDir>`
|
|
37
|
+
* itself — a recursive removal of every run's state. A guard that admits the
|
|
38
|
+
* one input capable of turning this helper into data loss is not a guard. */
|
|
39
|
+
function safeRunId(id) {
|
|
40
|
+
return /^[A-Za-z0-9._-]+$/.test(id) && id !== '.' && id !== '..';
|
|
41
|
+
}
|
|
42
|
+
/** Where a run's agent-scoped temp directory lives. */
|
|
43
|
+
export function agentTmpDir(dataDir, runId) {
|
|
44
|
+
return join(dataDir, 'tmp', runId);
|
|
45
|
+
}
|
|
46
|
+
/** The root every per-run directory hangs off — the ONLY tree this module
|
|
47
|
+
* removes anything from (`runs/`, `runs.json` and `worktrees/` are siblings). */
|
|
48
|
+
function agentTmpRoot(dataDir) {
|
|
49
|
+
return join(dataDir, 'tmp');
|
|
50
|
+
}
|
|
51
|
+
/** `errno` → the phrasing a human recognises from their shell. */
|
|
52
|
+
const REASONS = {
|
|
53
|
+
EDQUOT: 'Disk quota exceeded',
|
|
54
|
+
ENOSPC: 'No space left on device',
|
|
55
|
+
EACCES: 'Permission denied',
|
|
56
|
+
EPERM: 'Operation not permitted',
|
|
57
|
+
EROFS: 'Read-only file system',
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The preflight's failure. Named so the spawn path can tell it apart from an
|
|
61
|
+
* ordinary crash and turn it into the run's `error` — the same treatment
|
|
62
|
+
* `ModelIdentityError` gets, and the same channel the thread footer renders.
|
|
63
|
+
*/
|
|
64
|
+
export class AgentTempDirError extends Error {
|
|
65
|
+
path;
|
|
66
|
+
constructor(path, reason) {
|
|
67
|
+
const code = reason?.code;
|
|
68
|
+
const why = (code && REASONS[code])
|
|
69
|
+
?? code
|
|
70
|
+
?? (reason instanceof Error ? reason.message : String(reason));
|
|
71
|
+
super(`agent temp directory is not writable: ${path} (${why}) — free disk space, `
|
|
72
|
+
+ 'or set CEZ_AGENT_TMPDIR=0 to fall back to the host TMPDIR');
|
|
73
|
+
this.name = 'AgentTempDirError';
|
|
74
|
+
this.path = path;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** Opt-out spelling matches the house style for default-on behaviour
|
|
78
|
+
* (`CEZ_AUTONAME=0`, `CEZ_SKILLS_AUTO_UPDATE=0`): only an exact `0` disables. */
|
|
79
|
+
export function agentTmpDirEnabled(env = process.env) {
|
|
80
|
+
return env.CEZ_AGENT_TMPDIR !== '0';
|
|
81
|
+
}
|
|
82
|
+
/** Distinguishes concurrent probes from one process; the pid alone would let two
|
|
83
|
+
* spawns racing on the same directory delete each other's file mid-probe. */
|
|
84
|
+
let probeSeq = 0;
|
|
85
|
+
/**
|
|
86
|
+
* Write-probe `dir`. Creating the file is not enough to prove the directory
|
|
87
|
+
* works — a quota-exhausted tmpfs still allocates the inode and only fails the
|
|
88
|
+
* `write(2)` — so the probe writes real bytes and removes them again. A
|
|
89
|
+
* directory that is merely *full but writable* passes, by design.
|
|
90
|
+
*/
|
|
91
|
+
function probeWritable(dir) {
|
|
92
|
+
const probe = join(dir, `.cez-tmp-probe-${process.pid}-${(probeSeq += 1)}`);
|
|
93
|
+
try {
|
|
94
|
+
writeFileSync(probe, 'cez');
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
throw new AgentTempDirError(dir, err);
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
try {
|
|
101
|
+
rmSync(probe, { force: true });
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
// best-effort: a probe we could not remove is not a reason to fail a run.
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The `TMPDIR`/`TEMP`/`TMP` overrides for this run, after proving the resolved
|
|
110
|
+
* directory actually accepts writes. Throws `AgentTempDirError` when it does
|
|
111
|
+
* not — callers turn that into the run's error rather than spawning.
|
|
112
|
+
*
|
|
113
|
+
* All three spellings are set, on every platform: a tool that reads `TMP` (or
|
|
114
|
+
* `TEMP`) would otherwise keep following the host value straight back to the
|
|
115
|
+
* exhausted directory this exists to escape.
|
|
116
|
+
*
|
|
117
|
+
* Returns `{}` under the opt-out, without probing anything: the hatch turns the
|
|
118
|
+
* whole feature off, preflight included, so it stays an escape someone can
|
|
119
|
+
* actually take.
|
|
120
|
+
*/
|
|
121
|
+
export function agentTmpEnv(dataDir, runId, env = process.env) {
|
|
122
|
+
if (!agentTmpDirEnabled(env))
|
|
123
|
+
return {};
|
|
124
|
+
const dir = agentTmpDir(dataDir, runId);
|
|
125
|
+
try {
|
|
126
|
+
mkdirSync(dir, { recursive: true });
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
throw new AgentTempDirError(dir, err);
|
|
130
|
+
}
|
|
131
|
+
probeWritable(dir);
|
|
132
|
+
return { TMPDIR: dir, TEMP: dir, TMP: dir };
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Reap one run's directory. Scratch, not an artifact: nothing reads it once the
|
|
136
|
+
* agent is gone, and a Continue re-creates it through `agentTmpEnv`. Never
|
|
137
|
+
* throws — reaping must not break a terminal transition.
|
|
138
|
+
*/
|
|
139
|
+
export function removeAgentTmpDir(dataDir, runId) {
|
|
140
|
+
if (!safeRunId(runId))
|
|
141
|
+
return;
|
|
142
|
+
try {
|
|
143
|
+
rmSync(agentTmpDir(dataDir, runId), { recursive: true, force: true });
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
// best-effort; the startup sweep picks up whatever survives.
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Remove every per-run directory that is not in `keepRunIds` — the startup
|
|
151
|
+
* sweep, so a crash (which never reaches the terminal-transition reap) cannot
|
|
152
|
+
* accumulate them forever. Confined to `<dataDir>/tmp`; sibling run state is
|
|
153
|
+
* never enumerated, let alone touched. Returns the ids actually reaped.
|
|
154
|
+
*/
|
|
155
|
+
export function sweepAgentTmpDirs(dataDir, keepRunIds) {
|
|
156
|
+
const root = agentTmpRoot(dataDir);
|
|
157
|
+
if (!existsSync(root))
|
|
158
|
+
return [];
|
|
159
|
+
const keep = new Set(keepRunIds);
|
|
160
|
+
const reaped = [];
|
|
161
|
+
let entries;
|
|
162
|
+
try {
|
|
163
|
+
entries = readdirSync(root, { withFileTypes: true })
|
|
164
|
+
.filter((e) => e.isDirectory())
|
|
165
|
+
.map((e) => e.name);
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
return [];
|
|
169
|
+
}
|
|
170
|
+
for (const name of entries) {
|
|
171
|
+
if (keep.has(name) || !safeRunId(name))
|
|
172
|
+
continue;
|
|
173
|
+
try {
|
|
174
|
+
rmSync(join(root, name), { recursive: true, force: true });
|
|
175
|
+
reaped.push(name);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
// best-effort: a locked directory is retried on the next boot.
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return reaped;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=agent-tmpdir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-tmpdir.js","sourceRoot":"","s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AC;QAC3B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAAE,SAAS;QACjD,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,+DAA+D;QACjE,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type TaskRefs } from './task-refs.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The one-shot LLM namer (spec 2026-07-17-task-auto-naming): turns a task's
|
|
4
|
+
* INTENT — skill + arguments + prompt + PR/issue context, never the agent's
|
|
5
|
+
* streamed words — into a short `<number>: <gerund phrase>` display title with
|
|
6
|
+
* structured, regex-cross-checked PR/issue numbers. Mirrors the planner (spec
|
|
7
|
+
* 008): `[cez-namer]` dry-run marker, strict JSON, never blocks, never fails a
|
|
8
|
+
* run. This module is the pure half; the runner call lives in `generateRunName`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NAMER_TIMEOUT_MS = 20000;
|
|
11
|
+
/** Title budget in code points — the tasks table shows ~20-25 chars, 40 is the hard cap. */
|
|
12
|
+
export declare const TITLE_MAX = 40;
|
|
13
|
+
/**
|
|
14
|
+
* Master switch for ALL LLM naming (creation-time and live refresh):
|
|
15
|
+
* `CEZ_AUTONAME=0` kills it outright; under `CEZ_DRY_RUN=1` naming is off by
|
|
16
|
+
* default too (the mock's canned title would REPLACE honest heuristic titles
|
|
17
|
+
* in demos and e2e) unless `CEZ_AUTONAME=1` forces it — the hook the dry-run
|
|
18
|
+
* naming tests use.
|
|
19
|
+
*/
|
|
20
|
+
export declare function autoNamingActive(env?: NodeJS.ProcessEnv): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Live title updates switch (owner decision on PR #479 — deliberately ON by
|
|
23
|
+
* default, deviating from the cost-opt-in house rule; cost is bounded by the
|
|
24
|
+
* cheap `namerModel`, one call per turn end, and the skip conditions in
|
|
25
|
+
* `RunManager.recordTurnEnd`). Precedence: `config.liveTitleUpdates` (the
|
|
26
|
+
* Settings toggle) wins over the `CEZ_TITLE_UPDATES` env default (`'0'` = off)
|
|
27
|
+
* wins over the built-in ON.
|
|
28
|
+
*/
|
|
29
|
+
export declare function liveTitleUpdatesEnabled(config: {
|
|
30
|
+
liveTitleUpdates?: boolean;
|
|
31
|
+
}, env?: NodeJS.ProcessEnv): boolean;
|
|
32
|
+
export declare const NAMER_SYSTEM_PROMPT: string;
|
|
33
|
+
export interface NamerContext {
|
|
34
|
+
task: string;
|
|
35
|
+
skillName?: string;
|
|
36
|
+
skillDescription?: string;
|
|
37
|
+
/** Live refresh only (spec step 3): the just-finished turn's text. */
|
|
38
|
+
turnText?: string;
|
|
39
|
+
/** Live refresh only: current `git diff --shortstat` line. */
|
|
40
|
+
diffStat?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface NameResult {
|
|
43
|
+
titleSummary: string;
|
|
44
|
+
prNumber?: number;
|
|
45
|
+
issueNumber?: number;
|
|
46
|
+
}
|
|
47
|
+
/** The `[cez-namer]` marker lets the CEZ_DRY_RUN mock recognize a naming call. */
|
|
48
|
+
export declare function buildNamerPrompt(ctx: NamerContext): string;
|
|
49
|
+
/**
|
|
50
|
+
* Anti-hallucination cross-check: the model's `pr`/`issue` is accepted only
|
|
51
|
+
* when the regex layer agrees or the number literally occurs in the task text;
|
|
52
|
+
* on any disagreement the regex wins. The regex's own explicit findings always
|
|
53
|
+
* carry through, so a lying model can add nothing and remove nothing.
|
|
54
|
+
*/
|
|
55
|
+
export declare function crossCheckRefs(raw: {
|
|
56
|
+
pr?: number;
|
|
57
|
+
issue?: number;
|
|
58
|
+
}, task: string, refs: TaskRefs): {
|
|
59
|
+
prNumber?: number;
|
|
60
|
+
issueNumber?: number;
|
|
61
|
+
};
|
|
62
|
+
/** Enforce the title contract regardless of what the model produced. */
|
|
63
|
+
export declare function postValidateTitle(title: string, refNumber?: number): string;
|
|
64
|
+
/**
|
|
65
|
+
* The one-shot runner call: never throws, never blocks a run — every failure
|
|
66
|
+
* path (runner error, timeout, junk twice) answers null and the caller keeps
|
|
67
|
+
* the heuristic title. `namerModel` is a Claude alias, so it is passed only
|
|
68
|
+
* when the namer runs on Claude (the `plannerModel` precedent).
|
|
69
|
+
*/
|
|
70
|
+
export declare function generateRunName(repoRoot: string, ctx: NamerContext): Promise<NameResult | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Raw model text → validated NameResult, or null when the answer is junk
|
|
73
|
+
* (caller retries once, then keeps the heuristic title).
|
|
74
|
+
*/
|
|
75
|
+
export declare function composeNameResult(rawText: string, ctx: NamerContext): NameResult | null;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { loadConfig } from '../config.js';
|
|
3
|
+
import { createRunner } from '../core/runner-factory.js';
|
|
4
|
+
import { parseStructured } from '../planner.js';
|
|
5
|
+
import { resolveProfileEnvForRoot } from '../workspace/agent-profiles.js';
|
|
6
|
+
import { extractTaskRefs, refineTaskRefs, titleRefNumber } from './task-refs.js';
|
|
7
|
+
/**
|
|
8
|
+
* The one-shot LLM namer (spec 2026-07-17-task-auto-naming): turns a task's
|
|
9
|
+
* INTENT — skill + arguments + prompt + PR/issue context, never the agent's
|
|
10
|
+
* streamed words — into a short `<number>: <gerund phrase>` display title with
|
|
11
|
+
* structured, regex-cross-checked PR/issue numbers. Mirrors the planner (spec
|
|
12
|
+
* 008): `[cez-namer]` dry-run marker, strict JSON, never blocks, never fails a
|
|
13
|
+
* run. This module is the pure half; the runner call lives in `generateRunName`.
|
|
14
|
+
*/
|
|
15
|
+
export const NAMER_TIMEOUT_MS = 20_000;
|
|
16
|
+
/** Title budget in code points — the tasks table shows ~20-25 chars, 40 is the hard cap. */
|
|
17
|
+
export const TITLE_MAX = 40;
|
|
18
|
+
/**
|
|
19
|
+
* Master switch for ALL LLM naming (creation-time and live refresh):
|
|
20
|
+
* `CEZ_AUTONAME=0` kills it outright; under `CEZ_DRY_RUN=1` naming is off by
|
|
21
|
+
* default too (the mock's canned title would REPLACE honest heuristic titles
|
|
22
|
+
* in demos and e2e) unless `CEZ_AUTONAME=1` forces it — the hook the dry-run
|
|
23
|
+
* naming tests use.
|
|
24
|
+
*/
|
|
25
|
+
export function autoNamingActive(env = process.env) {
|
|
26
|
+
if (env.CEZ_AUTONAME === '0')
|
|
27
|
+
return false;
|
|
28
|
+
if (env.CEZ_DRY_RUN === '1' && env.CEZ_AUTONAME !== '1')
|
|
29
|
+
return false;
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Live title updates switch (owner decision on PR #479 — deliberately ON by
|
|
34
|
+
* default, deviating from the cost-opt-in house rule; cost is bounded by the
|
|
35
|
+
* cheap `namerModel`, one call per turn end, and the skip conditions in
|
|
36
|
+
* `RunManager.recordTurnEnd`). Precedence: `config.liveTitleUpdates` (the
|
|
37
|
+
* Settings toggle) wins over the `CEZ_TITLE_UPDATES` env default (`'0'` = off)
|
|
38
|
+
* wins over the built-in ON.
|
|
39
|
+
*/
|
|
40
|
+
export function liveTitleUpdatesEnabled(config, env = process.env) {
|
|
41
|
+
if (config.liveTitleUpdates !== undefined)
|
|
42
|
+
return config.liveTitleUpdates;
|
|
43
|
+
return env.CEZ_TITLE_UPDATES !== '0';
|
|
44
|
+
}
|
|
45
|
+
export const NAMER_SYSTEM_PROMPT = 'You are a task-naming assistant for an AI coding agent cockpit. Respond with ONLY a JSON object: ' +
|
|
46
|
+
'{"title": string, "pr"?: number, "issue"?: number}. Rules: "title" is a terse lowercase gerund phrase ' +
|
|
47
|
+
'naming the task INTENT (e.g. "implementing cr fixes", "verifying pr ui"), at most 40 characters, no ' +
|
|
48
|
+
'trailing period, and NEVER a restatement of an assistant reply. When the task is about a GitHub pull ' +
|
|
49
|
+
'request or issue, set "pr" or "issue" to that number and do NOT repeat the number inside the title ' +
|
|
50
|
+
'text. Never invent a number that is not in the task.';
|
|
51
|
+
const namerResponseSchema = z.object({
|
|
52
|
+
title: z.string().min(1),
|
|
53
|
+
pr: z.number().int().positive().optional(),
|
|
54
|
+
issue: z.number().int().positive().optional(),
|
|
55
|
+
});
|
|
56
|
+
/** The `[cez-namer]` marker lets the CEZ_DRY_RUN mock recognize a naming call. */
|
|
57
|
+
export function buildNamerPrompt(ctx) {
|
|
58
|
+
const refs = advisoryRefs(ctx);
|
|
59
|
+
const lines = [
|
|
60
|
+
'[cez-namer] Name this task.',
|
|
61
|
+
'',
|
|
62
|
+
...(ctx.skillName ? [`Selected skill: /${ctx.skillName}`] : []),
|
|
63
|
+
...(ctx.skillDescription ? [`Skill description: ${ctx.skillDescription}`] : []),
|
|
64
|
+
'Task:',
|
|
65
|
+
clip(ctx.task, 500),
|
|
66
|
+
];
|
|
67
|
+
if (refs.length)
|
|
68
|
+
lines.push('', `References found programmatically (advisory): ${refs.join(', ')}`);
|
|
69
|
+
if (ctx.turnText)
|
|
70
|
+
lines.push('', 'Latest progress (context only — do not quote it):', clip(ctx.turnText, 400));
|
|
71
|
+
if (ctx.diffStat)
|
|
72
|
+
lines.push('', `Change size so far: ${ctx.diffStat}`);
|
|
73
|
+
return lines.join('\n');
|
|
74
|
+
}
|
|
75
|
+
function advisoryRefs(ctx) {
|
|
76
|
+
const refs = refineTaskRefs(extractTaskRefs(ctx.task), ctx.skillName);
|
|
77
|
+
const out = [];
|
|
78
|
+
if (refs.prNumber !== undefined)
|
|
79
|
+
out.push(`pr ${refs.prNumber}`);
|
|
80
|
+
if (refs.issueNumber !== undefined)
|
|
81
|
+
out.push(`issue ${refs.issueNumber}`);
|
|
82
|
+
if (refs.ambiguousNumber !== undefined)
|
|
83
|
+
out.push(`number ${refs.ambiguousNumber} (kind unknown)`);
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
function clip(text, max) {
|
|
87
|
+
const chars = [...text.trim()];
|
|
88
|
+
return chars.length > max ? `${chars.slice(0, max).join('')}…` : chars.join('');
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Anti-hallucination cross-check: the model's `pr`/`issue` is accepted only
|
|
92
|
+
* when the regex layer agrees or the number literally occurs in the task text;
|
|
93
|
+
* on any disagreement the regex wins. The regex's own explicit findings always
|
|
94
|
+
* carry through, so a lying model can add nothing and remove nothing.
|
|
95
|
+
*/
|
|
96
|
+
export function crossCheckRefs(raw, task, refs) {
|
|
97
|
+
const inTask = (n) => n !== undefined && new RegExp(`(^|\\D)${n}(\\D|$)`).test(task);
|
|
98
|
+
const claimedPr = refs.prNumber ?? (raw.pr !== undefined && (inTask(raw.pr) || refs.ambiguousNumber === raw.pr) ? raw.pr : undefined);
|
|
99
|
+
const claimedIssue = refs.issueNumber ?? (raw.issue !== undefined && (inTask(raw.issue) || refs.ambiguousNumber === raw.issue) ? raw.issue : undefined);
|
|
100
|
+
return {
|
|
101
|
+
...(claimedPr !== undefined ? { prNumber: claimedPr } : {}),
|
|
102
|
+
...(claimedIssue !== undefined ? { issueNumber: claimedIssue } : {}),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/** Enforce the title contract regardless of what the model produced. */
|
|
106
|
+
export function postValidateTitle(title, refNumber) {
|
|
107
|
+
let t = title.trim().replace(/\.+$/, '').replace(/\s+/g, ' ');
|
|
108
|
+
// The number leads; strip a model-repeated number from the phrase first.
|
|
109
|
+
if (refNumber !== undefined) {
|
|
110
|
+
t = t.replace(new RegExp(`^#?${refNumber}\\s*[:—-]?\\s*`), '');
|
|
111
|
+
}
|
|
112
|
+
if (t)
|
|
113
|
+
t = t[0]?.toLowerCase() + t.slice(1);
|
|
114
|
+
const chars = [...t];
|
|
115
|
+
if (chars.length > TITLE_MAX)
|
|
116
|
+
t = `${chars.slice(0, TITLE_MAX - 1).join('').trimEnd()}…`;
|
|
117
|
+
return refNumber !== undefined ? `${refNumber}: ${t}`.trim().replace(/:\s*$/, ':') : t;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The one-shot runner call: never throws, never blocks a run — every failure
|
|
121
|
+
* path (runner error, timeout, junk twice) answers null and the caller keeps
|
|
122
|
+
* the heuristic title. `namerModel` is a Claude alias, so it is passed only
|
|
123
|
+
* when the namer runs on Claude (the `plannerModel` precedent).
|
|
124
|
+
*/
|
|
125
|
+
export async function generateRunName(repoRoot, ctx) {
|
|
126
|
+
try {
|
|
127
|
+
const config = await loadConfig(repoRoot);
|
|
128
|
+
const runner = createRunner(config.defaultRunner);
|
|
129
|
+
const model = config.defaultRunner === 'claude' ? config.namerModel : undefined;
|
|
130
|
+
// Name under the project's own agent account (spec 2026-07-29-agent-profiles) — naming is
|
|
131
|
+
// a model call like any other, and billing it to the personal subscription for a work
|
|
132
|
+
// project is the exact confusion accounts exist to remove.
|
|
133
|
+
const { env: profileEnv } = await resolveProfileEnvForRoot(repoRoot, config.defaultRunner);
|
|
134
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
135
|
+
const result = await runner.run({
|
|
136
|
+
systemPrompt: NAMER_SYSTEM_PROMPT,
|
|
137
|
+
userPrompt: buildNamerPrompt(ctx),
|
|
138
|
+
cwd: repoRoot,
|
|
139
|
+
allowedTools: [],
|
|
140
|
+
model,
|
|
141
|
+
timeoutMs: NAMER_TIMEOUT_MS,
|
|
142
|
+
// Shadow the argv-capture hook: dry-run tests capture the AGENT's argv
|
|
143
|
+
// through CEZ_MOCK_ARGS_FILE; the namer's bookkeeping call must not
|
|
144
|
+
// interleave lines into that file.
|
|
145
|
+
env: { ...profileEnv, CEZ_MOCK_ARGS_FILE: '' },
|
|
146
|
+
});
|
|
147
|
+
const composed = composeNameResult(result.text, ctx);
|
|
148
|
+
if (composed)
|
|
149
|
+
return composed;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// runner unavailable / crashed — the heuristic title stays
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Raw model text → validated NameResult, or null when the answer is junk
|
|
159
|
+
* (caller retries once, then keeps the heuristic title).
|
|
160
|
+
*/
|
|
161
|
+
export function composeNameResult(rawText, ctx) {
|
|
162
|
+
const parsed = parseStructured(rawText, namerResponseSchema);
|
|
163
|
+
if (!parsed)
|
|
164
|
+
return null;
|
|
165
|
+
// #623: a terse title is one phrase, not concatenated progress narration. Reject
|
|
166
|
+
// unambiguous missing sentence whitespace (the observed `.Config` / `.The`
|
|
167
|
+
// shape) and keep the honest heuristic title instead of trying to guess
|
|
168
|
+
// where a model's prose should have been split.
|
|
169
|
+
if (/[.!?][A-Z]/.test(parsed.title))
|
|
170
|
+
return null;
|
|
171
|
+
const refs = refineTaskRefs(extractTaskRefs(ctx.task), ctx.skillName);
|
|
172
|
+
const checked = crossCheckRefs(parsed, ctx.task, refs);
|
|
173
|
+
const refNumber = checked.prNumber ?? checked.issueNumber ?? titleRefNumber(refs);
|
|
174
|
+
const titleSummary = postValidateTitle(parsed.title, refNumber);
|
|
175
|
+
if (!titleSummary || titleSummary === String(refNumber ?? ''))
|
|
176
|
+
return null;
|
|
177
|
+
return { titleSummary, ...checked };
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=auto-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-name.js","sourceRoot":"","sources":["../../src/runs/auto-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCA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,2DAA2D;IAC7D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,GAAiB;IAClE,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;IAC7D,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,iFAAiF;IACjF,2EAA2E;IAC3E,wEAAwE;IACxE,gDAAgD;IAChD,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,IAAI,GAAG,cAAc,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,WAAW,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClF,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAChE,IAAI,CAAC,YAAY,IAAI,YAAY,KAAK,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3E,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type RunEvent, type RunHistoryContext, type RunHistoryEvent, type RunHistoryPage } from '../contract/index.js';
|
|
3
|
+
declare const pageCursorSchema: z.ZodObject<{
|
|
4
|
+
v: z.ZodLiteral<1>;
|
|
5
|
+
kind: z.ZodLiteral<"page">;
|
|
6
|
+
direction: z.ZodEnum<{
|
|
7
|
+
newer: "newer";
|
|
8
|
+
older: "older";
|
|
9
|
+
}>;
|
|
10
|
+
fileSize: z.ZodNumber;
|
|
11
|
+
boundarySeq: z.ZodNumber;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
declare const liveCursorSchema: z.ZodObject<{
|
|
14
|
+
v: z.ZodLiteral<1>;
|
|
15
|
+
kind: z.ZodLiteral<"live">;
|
|
16
|
+
offset: z.ZodNumber;
|
|
17
|
+
boundarySeq: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare class HistoryCursorError extends Error {
|
|
20
|
+
readonly status: 400 | 409;
|
|
21
|
+
constructor(status: 400 | 409, message: string);
|
|
22
|
+
}
|
|
23
|
+
export declare function decodePageCursor(cursor: string): z.infer<typeof pageCursorSchema>;
|
|
24
|
+
export declare function decodeLiveCursor(cursor: string): z.infer<typeof liveCursorSchema>;
|
|
25
|
+
interface CanonicalItem {
|
|
26
|
+
key: string;
|
|
27
|
+
firstSeq: number;
|
|
28
|
+
lastSeq: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Classify the source events into the same protocol-level item units the cockpit renders.
|
|
32
|
+
*
|
|
33
|
+
* Projection always operates on complete collected turns. A v2-covered turn suppresses its v1
|
|
34
|
+
* tool twins; lifecycle snapshots sharing a step/item identity collapse to one item.
|
|
35
|
+
*/
|
|
36
|
+
export declare function canonicalSessionItems(events: readonly RunEvent[]): CanonicalItem[];
|
|
37
|
+
export interface HistoryReadInstrumentation {
|
|
38
|
+
fileSize: number;
|
|
39
|
+
bytesRead: number;
|
|
40
|
+
retainedEvents: number;
|
|
41
|
+
}
|
|
42
|
+
export declare function readRunHistoryPage(filePath: string, cursor?: string, onRead?: (instrumentation: HistoryReadInstrumentation) => void): Promise<RunHistoryPage>;
|
|
43
|
+
/** One forward pass retaining the latest Plan snapshot and only the selector-equivalent agent episode. */
|
|
44
|
+
export declare function deriveRunContextEvents(filePath: string): Promise<RunHistoryContext>;
|
|
45
|
+
export declare function readEventsAfterLiveCursor(filePath: string, cursor: string): Promise<{
|
|
46
|
+
events: RunHistoryEvent[];
|
|
47
|
+
boundarySeq: number;
|
|
48
|
+
}>;
|
|
49
|
+
export declare function validateLiveCursor(filePath: string, cursor: string): Promise<void>;
|
|
50
|
+
export {};
|