@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,112 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
const exec = promisify(execFile);
|
|
4
|
+
async function git(root, args) {
|
|
5
|
+
const { stdout } = await exec('git', args, { cwd: root, maxBuffer: 10 * 1024 * 1024 });
|
|
6
|
+
return stdout;
|
|
7
|
+
}
|
|
8
|
+
/** Null when `dir` isn't inside a git repository. */
|
|
9
|
+
export async function getRepoInfo(dir) {
|
|
10
|
+
try {
|
|
11
|
+
const root = (await git(dir, ['rev-parse', '--show-toplevel'])).trim();
|
|
12
|
+
const branch = (await git(root, ['rev-parse', '--abbrev-ref', 'HEAD'])).trim();
|
|
13
|
+
let remote;
|
|
14
|
+
try {
|
|
15
|
+
remote = (await git(root, ['remote', 'get-url', 'origin'])).trim() || undefined;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// No remote named `origin` — fall back to the first configured remote,
|
|
19
|
+
// so repos whose only remote is named e.g. `github` or `upstream` still
|
|
20
|
+
// get forge detection. Truly remote-less repos land in the inner catch.
|
|
21
|
+
try {
|
|
22
|
+
const names = (await git(root, ['remote'])).split('\n').map((n) => n.trim()).filter(Boolean);
|
|
23
|
+
if (names[0]) {
|
|
24
|
+
remote = (await git(root, ['remote', 'get-url', names[0]])).trim() || undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// no remotes at all — local-only repo
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return { root, branch, remote };
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** The current commit, pinned as a full SHA. Null outside a repository or before its first commit. */
|
|
38
|
+
export async function getHeadCommit(root) {
|
|
39
|
+
try {
|
|
40
|
+
return (await git(root, ['rev-parse', '--verify', 'HEAD^{commit}'])).trim() || null;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export async function getStatus(root) {
|
|
47
|
+
const out = await git(root, ['status', '--porcelain']);
|
|
48
|
+
return out
|
|
49
|
+
.split('\n')
|
|
50
|
+
.filter(Boolean)
|
|
51
|
+
.map((line) => ({ status: line.slice(0, 2).trim() || '??', path: line.slice(3) }));
|
|
52
|
+
}
|
|
53
|
+
/** Working-tree diff vs HEAD (staged + unstaged), capped for the GUI. */
|
|
54
|
+
export async function getDiff(root, cap = 400_000) {
|
|
55
|
+
const diff = await git(root, ['diff', 'HEAD']);
|
|
56
|
+
if (diff.length > cap)
|
|
57
|
+
return `${diff.slice(0, cap)}\n… (diff truncated)`;
|
|
58
|
+
return diff;
|
|
59
|
+
}
|
|
60
|
+
/** Local + origin branch names, deduped (origin/x counts as x), sorted.
|
|
61
|
+
* Feeds the Repo tab's base-branch picker. */
|
|
62
|
+
export async function getBranches(root) {
|
|
63
|
+
const names = new Set();
|
|
64
|
+
try {
|
|
65
|
+
const local = await git(root, ['branch', '--list', '--format=%(refname:short)']);
|
|
66
|
+
for (const line of local.split('\n')) {
|
|
67
|
+
const name = line.trim();
|
|
68
|
+
if (name)
|
|
69
|
+
names.add(name);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// no branches — empty list
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
const remote = await git(root, ['branch', '-r', '--list', '--format=%(refname:short)']);
|
|
77
|
+
for (const line of remote.split('\n')) {
|
|
78
|
+
const name = line.trim();
|
|
79
|
+
if (!name || name.includes('HEAD'))
|
|
80
|
+
continue;
|
|
81
|
+
names.add(name.replace(/^origin\//, ''));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// no remotes — local only
|
|
86
|
+
}
|
|
87
|
+
return [...names].filter((n) => !n.startsWith('cez/')).sort((a, b) => a.localeCompare(b));
|
|
88
|
+
}
|
|
89
|
+
/** One commit — message + stat + patch — for the Repo view's expandable rows. */
|
|
90
|
+
export async function getCommit(root, sha, cap = 200_000) {
|
|
91
|
+
if (!/^[0-9a-f]{4,40}$/i.test(sha))
|
|
92
|
+
return '(not a commit hash)';
|
|
93
|
+
const out = await git(root, ['show', '--stat', '--patch', '--no-color', sha]);
|
|
94
|
+
if (out.length > cap)
|
|
95
|
+
return `${out.slice(0, cap)}\n… (diff truncated)`;
|
|
96
|
+
return out;
|
|
97
|
+
}
|
|
98
|
+
export async function getLog(root, count = 20) {
|
|
99
|
+
const out = await git(root, [
|
|
100
|
+
'log',
|
|
101
|
+
`-${count}`,
|
|
102
|
+
'--pretty=format:%h%x1f%s%x1f%an%x1f%cr',
|
|
103
|
+
]);
|
|
104
|
+
return out
|
|
105
|
+
.split('\n')
|
|
106
|
+
.filter(Boolean)
|
|
107
|
+
.map((line) => {
|
|
108
|
+
const [hash = '', subject = '', author = '', when = ''] = line.split('\x1f');
|
|
109
|
+
return { hash, subject, author, when };
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/server/git.ts"],"names":[],"mappings":"AAAA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G,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin delegate — the gh-CLI listing logic moved behind the forge-driver seam
|
|
3
|
+
* (`src/server/forge/github.ts`, cockpit-ui redesign spec §"Forge-driver
|
|
4
|
+
* seam"). Kept so existing imports and the protected `/api/github` response
|
|
5
|
+
* shape (BACKWARD_COMPATIBILITY.md §2) stay exactly as they were.
|
|
6
|
+
*/
|
|
7
|
+
export { fetchGithub, fetchGithubChecks, fetchGithubComments, fetchGithubPrDiff, fetchGithubRefStatus, forgetRefStatus, readCachedRefStatuses, refNumberFromUrl, GithubPrNotFoundError, GH_MAX_LIMIT, GH_CHECKS_MAX, GH_REF_STATUS_MAX, } from './forge/github.ts';
|
|
8
|
+
export type { GithubData, GithubItem, GithubChecksData, GithubRefStatusData, ReferenceStatus, } from './forge/github.ts';
|
|
9
|
+
export type { ForgeComment, ForgeCommentsData, ForgeTimelineEvent, ForgeTimelineEventKind, ForgePrDiffResult, ForgePrChange, } from './forge/types.ts';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin delegate — the gh-CLI listing logic moved behind the forge-driver seam
|
|
3
|
+
* (`src/server/forge/github.ts`, cockpit-ui redesign spec §"Forge-driver
|
|
4
|
+
* seam"). Kept so existing imports and the protected `/api/github` response
|
|
5
|
+
* shape (BACKWARD_COMPATIBILITY.md §2) stay exactly as they were.
|
|
6
|
+
*/
|
|
7
|
+
export { fetchGithub, fetchGithubChecks, fetchGithubComments, fetchGithubPrDiff, fetchGithubRefStatus, forgetRefStatus, readCachedRefStatuses, refNumberFromUrl, GithubPrNotFoundError, GH_MAX_LIMIT, GH_CHECKS_MAX, GH_REF_STATUS_MAX, } from './forge/github.js';
|
|
8
|
+
//# sourceMappingURL=github.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../src/server/github.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launch-key (spec 011): a random secret baked into the bookmarklets so only
|
|
3
|
+
* pages that got it from THIS cockpit can auto-start a run via `/new?auto=1`.
|
|
4
|
+
* A rogue web page can navigate the browser to localhost, but it cannot read
|
|
5
|
+
* `.ai/cezar/launch-key` — without the key `/new` only prefills the form.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureLaunchKey(dataDir: string): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
/**
|
|
5
|
+
* Launch-key (spec 011): a random secret baked into the bookmarklets so only
|
|
6
|
+
* pages that got it from THIS cockpit can auto-start a run via `/new?auto=1`.
|
|
7
|
+
* A rogue web page can navigate the browser to localhost, but it cannot read
|
|
8
|
+
* `.ai/cezar/launch-key` — without the key `/new` only prefills the form.
|
|
9
|
+
*/
|
|
10
|
+
export function ensureLaunchKey(dataDir) {
|
|
11
|
+
const path = join(dataDir, 'launch-key');
|
|
12
|
+
try {
|
|
13
|
+
if (existsSync(path)) {
|
|
14
|
+
const existing = readFileSync(path, 'utf8').trim();
|
|
15
|
+
if (existing)
|
|
16
|
+
return existing;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// unreadable — fall through and regenerate
|
|
21
|
+
}
|
|
22
|
+
const key = randomUUID();
|
|
23
|
+
try {
|
|
24
|
+
mkdirSync(dataDir, { recursive: true });
|
|
25
|
+
writeFileSync(path, `${key}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
26
|
+
chmodSync(path, 0o600); // best-effort — mode is ignored on pre-existing files
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// non-fatal: the key still protects auto-start for this process lifetime
|
|
30
|
+
}
|
|
31
|
+
return key;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=launch-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch-key.js","sourceRoot":"","sources":["../../src/server/launch-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACzC,IAAI,CAAC;QACH,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;YACnD,IAAI,QAAQ;gBAAE,OAAO,QAAQ,CAAC;QAChC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,2CAA2C;IAC7C,CAAC;IACD,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACxC,aAAa,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACnE,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,sDAAsD;IAChF,CAAC;IAAC,MAAM,CAAC;QACP,yEAAyE;IAC3E,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { RunnerId } from '../core/agent-runner.ts';
|
|
2
|
+
/**
|
|
3
|
+
* "Open in…" session takeover (#open-in): detect the editors / file managers / terminals on THIS
|
|
4
|
+
* machine, and open a run's worktree in the one the user picks — the desktop-app equivalent of
|
|
5
|
+
* the "cd <path>" hint. Local-only; the server gates these behind `localHandoff` (CEZ_REMOTE).
|
|
6
|
+
*
|
|
7
|
+
* Detection is best-effort and cross-platform: an editor counts as present if its CLI is on PATH
|
|
8
|
+
* or (macOS) its .app bundle is installed. Finder/file-manager and Terminal are always offered.
|
|
9
|
+
*
|
|
10
|
+
* WSL (#361): when this process itself runs inside WSL, `process.platform` reads `linux` but the
|
|
11
|
+
* user's GUI apps mostly live on the Windows side, reachable through interop. `resolveOnPath`
|
|
12
|
+
* additionally probes directly-spawnable `.com`/`.exe` suffixes there (Node's own PATH lookup
|
|
13
|
+
* only does that under real win32), and `openInApp`/`openFileManager` translate the worktree path
|
|
14
|
+
* to its `\\wsl$\…` (or `C:\…`) form before handing it to a resolved Windows-side binary — a WSL-native
|
|
15
|
+
* launcher (e.g. VS Code's Remote-WSL `code` shim) keeps the POSIX path unchanged.
|
|
16
|
+
*/
|
|
17
|
+
export interface OpenTarget {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
/** A stable icon key the UI maps to a concrete icon component (#361). Optional so an older
|
|
21
|
+
* server talking to a newer client (or vice versa) just falls back to a generic icon —
|
|
22
|
+
* never a protocol break. */
|
|
23
|
+
icon?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Is `bin` (with a directly-spawnable Windows suffix under win32/WSL interop) on PATH?
|
|
26
|
+
* Returns the exact resolved name (which may carry the suffix) — pure filesystem probe, no
|
|
27
|
+
* child process — or null. `.cmd`/`.bat` are intentionally excluded: modern Node refuses to
|
|
28
|
+
* spawn them directly, while launching them through a shell would reintroduce the BatBadBut
|
|
29
|
+
* command-injection surface fixed in #459. An unavailable target is safer than one the menu
|
|
30
|
+
* offers and then silently fails to open (#469 review).
|
|
31
|
+
*
|
|
32
|
+
* The optional environment arguments keep Windows/WSL suffix behavior testable on any host. */
|
|
33
|
+
export declare function resolveOnPath(bin: string, platform?: NodeJS.Platform, wsl?: boolean, searchPath?: string): string | null;
|
|
34
|
+
/** The runner behind a `cli:<runner>` open target, or null when the id isn't a CLI handoff. */
|
|
35
|
+
export declare function agentCliRunner(targetId: string): RunnerId | null;
|
|
36
|
+
/** The open targets available on this machine: the file manager, a terminal, every detected
|
|
37
|
+
* editor, and every installed coding-agent CLI. Order is stable so the menu never reshuffles. */
|
|
38
|
+
export declare function detectOpenTargets(): OpenTarget[];
|
|
39
|
+
/** The (bin, args) a file-manager launch resolves to — pure so the per-platform routing
|
|
40
|
+
* (including the WSL→Explorer interop branch) is unit-testable without spawning anything.
|
|
41
|
+
* `platform`/`wsl` default to the real environment; tests pass them explicitly. */
|
|
42
|
+
export declare function fileManagerLaunch(dir: string, platform?: NodeJS.Platform, wsl?: boolean): {
|
|
43
|
+
bin: string;
|
|
44
|
+
args: string[];
|
|
45
|
+
};
|
|
46
|
+
/** Open a single worktree FILE with whatever application the OS has registered as its
|
|
47
|
+
* default handler — the diff pane's "open in default app" action for images (#365). Distinct
|
|
48
|
+
* from `openFileManager` above: that opens a *directory* in the file manager; this launches
|
|
49
|
+
* the file itself (e.g. the OS's default image viewer), never a directory listing. Local-only
|
|
50
|
+
* by construction — the caller gates this behind `localHandoff`.
|
|
51
|
+
*
|
|
52
|
+
* `path` is worktree CONTENT — a filename some cloned repo or coding agent chose — so it is
|
|
53
|
+
* hostile input, and it must never reach a process that re-parses its command line. That rules
|
|
54
|
+
* `cmd.exe` out on Windows: an argument array does NOT protect you there, because libuv quotes
|
|
55
|
+
* a spawn arg only when it contains a space/tab/quote and passes everything else verbatim, so
|
|
56
|
+
* `cmd /c start "" C:\dev\proj\a&calc&.png` would let cmd's `&` run `calc` (BatBadBut,
|
|
57
|
+
* CVE-2024-27980). `explorer <file>` hands the file to its registered handler with no such
|
|
58
|
+
* re-parsing — the same launcher `openFileManager` already uses for directories. */
|
|
59
|
+
export declare function openFileInDefaultApp(path: string): Promise<boolean>;
|
|
60
|
+
/** Open `dir` in the given target. Unknown/unavailable target → false (the caller 409s). */
|
|
61
|
+
export declare function openInApp(targetId: string, dir: string): Promise<boolean>;
|
|
62
|
+
/** The path argument to hand a resolved binary: a Windows-suffixed name found through WSL
|
|
63
|
+
* interop needs the Windows-side path; a bare-name binary (native Linux, or a WSL-aware shim
|
|
64
|
+
* like VS Code's Remote-WSL `code`) takes the POSIX path unchanged. `wsl` defaults to the real
|
|
65
|
+
* environment; tests pass it explicitly so this needs no global platform stubbing. */
|
|
66
|
+
export declare function launchPathFor(resolvedBin: string, dir: string, wsl?: boolean): string;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { accessSync, constants, existsSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { openInTerminal, refuseSpawnUnderTest } from './open-in-terminal.js';
|
|
6
|
+
import { isWsl, translateToWindowsPath } from './wsl.js';
|
|
7
|
+
const EDITORS = [
|
|
8
|
+
{ id: 'vscode', label: 'VS Code', icon: 'vscode', cli: 'code', mac: 'Visual Studio Code' },
|
|
9
|
+
{ id: 'cursor', label: 'Cursor', icon: 'cursor', cli: 'cursor', mac: 'Cursor' },
|
|
10
|
+
{ id: 'zed', label: 'Zed', icon: 'zed', cli: 'zed', mac: 'Zed' },
|
|
11
|
+
{ id: 'windsurf', label: 'Windsurf', icon: 'windsurf', cli: 'windsurf', mac: 'Windsurf' },
|
|
12
|
+
{ id: 'sublime', label: 'Sublime Text', icon: 'sublime', cli: 'subl', mac: 'Sublime Text' },
|
|
13
|
+
// JetBrains (#361 gap 3): Toolbox's "generate shell scripts" produces one bare-name launcher
|
|
14
|
+
// per product on every OS (idea, pycharm, …); the .app names below cover the Community /
|
|
15
|
+
// Ultimate / Professional edition splits Toolbox and the standalone installers both produce.
|
|
16
|
+
{ id: 'idea', label: 'IntelliJ IDEA', icon: 'idea', cli: 'idea', mac: ['IntelliJ IDEA', 'IntelliJ IDEA CE', 'IntelliJ IDEA Ultimate'] },
|
|
17
|
+
{ id: 'pycharm', label: 'PyCharm', icon: 'pycharm', cli: 'pycharm', mac: ['PyCharm', 'PyCharm CE', 'PyCharm Professional'] },
|
|
18
|
+
{ id: 'webstorm', label: 'WebStorm', icon: 'webstorm', cli: 'webstorm', mac: 'WebStorm' },
|
|
19
|
+
{ id: 'goland', label: 'GoLand', icon: 'goland', cli: 'goland', mac: 'GoLand' },
|
|
20
|
+
{ id: 'rubymine', label: 'RubyMine', icon: 'rubymine', cli: 'rubymine', mac: 'RubyMine' },
|
|
21
|
+
{ id: 'phpstorm', label: 'PhpStorm', icon: 'phpstorm', cli: 'phpstorm', mac: 'PhpStorm' },
|
|
22
|
+
{ id: 'clion', label: 'CLion', icon: 'clion', cli: 'clion', mac: 'CLion' },
|
|
23
|
+
{ id: 'rider', label: 'Rider', icon: 'rider', cli: 'rider', mac: 'Rider' },
|
|
24
|
+
{ id: 'android-studio', label: 'Android Studio', icon: 'android-studio', cli: 'studio', mac: 'Android Studio' },
|
|
25
|
+
{ id: 'xcode', label: 'Xcode', icon: 'xcode', mac: 'Xcode' },
|
|
26
|
+
{ id: 'warp', label: 'Warp', icon: 'warp', cli: 'warp', mac: 'Warp' },
|
|
27
|
+
];
|
|
28
|
+
const FILE_MANAGER_LABEL = process.platform === 'darwin' ? 'Finder' : process.platform === 'win32' || isWsl() ? 'Explorer' : 'Files';
|
|
29
|
+
/** Is `bin` (with a directly-spawnable Windows suffix under win32/WSL interop) on PATH?
|
|
30
|
+
* Returns the exact resolved name (which may carry the suffix) — pure filesystem probe, no
|
|
31
|
+
* child process — or null. `.cmd`/`.bat` are intentionally excluded: modern Node refuses to
|
|
32
|
+
* spawn them directly, while launching them through a shell would reintroduce the BatBadBut
|
|
33
|
+
* command-injection surface fixed in #459. An unavailable target is safer than one the menu
|
|
34
|
+
* offers and then silently fails to open (#469 review).
|
|
35
|
+
*
|
|
36
|
+
* The optional environment arguments keep Windows/WSL suffix behavior testable on any host. */
|
|
37
|
+
export function resolveOnPath(bin, platform = process.platform, wsl = isWsl(), searchPath = process.env.PATH ?? '') {
|
|
38
|
+
const dirs = searchPath.split(platform === 'win32' ? ';' : ':');
|
|
39
|
+
const suffixed = platform === 'win32' || wsl;
|
|
40
|
+
const names = suffixed ? [bin, `${bin}.com`, `${bin}.exe`] : [bin];
|
|
41
|
+
for (const dir of dirs) {
|
|
42
|
+
if (!dir)
|
|
43
|
+
continue;
|
|
44
|
+
for (const name of names) {
|
|
45
|
+
try {
|
|
46
|
+
accessSync(join(dir, name), constants.X_OK);
|
|
47
|
+
return name;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// keep looking
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
function onPath(bin) {
|
|
57
|
+
return resolveOnPath(bin) !== null;
|
|
58
|
+
}
|
|
59
|
+
/** macOS: is any of `names` (`<name>.app`) installed in a standard Applications dir? */
|
|
60
|
+
function macAppExists(names) {
|
|
61
|
+
if (process.platform !== 'darwin')
|
|
62
|
+
return false;
|
|
63
|
+
const candidates = Array.isArray(names) ? names : [names];
|
|
64
|
+
return candidates.some((name) => [
|
|
65
|
+
`/Applications/${name}.app`,
|
|
66
|
+
join(homedir(), 'Applications', `${name}.app`),
|
|
67
|
+
`/System/Applications/${name}.app`,
|
|
68
|
+
].some((p) => existsSync(p)));
|
|
69
|
+
}
|
|
70
|
+
function editorAvailable(editor) {
|
|
71
|
+
if (editor.cli && onPath(editor.cli))
|
|
72
|
+
return true;
|
|
73
|
+
if (editor.mac && macAppExists(editor.mac))
|
|
74
|
+
return true;
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
/** Coding-agent CLIs a session can be handed off to (#cli-handoff). Selecting one opens a
|
|
78
|
+
* terminal that resumes THIS run's session when the runner matches, or launches a fresh CLI in
|
|
79
|
+
* the worktree otherwise. The actual command is built server-side (needs the run's session). */
|
|
80
|
+
const AGENT_CLIS = [
|
|
81
|
+
{ runner: 'claude', label: 'Claude CLI', icon: 'claude', bin: 'claude', envBin: process.env.CEZ_CLAUDE_BIN },
|
|
82
|
+
{ runner: 'codex', label: 'Codex CLI', icon: 'codex', bin: 'codex', envBin: process.env.CEZ_CODEX_BIN },
|
|
83
|
+
{ runner: 'opencode', label: 'OpenCode', icon: 'opencode', bin: 'opencode', envBin: process.env.CEZ_OPENCODE_BIN },
|
|
84
|
+
{ runner: 'pi', label: 'pi CLI', icon: 'pi', bin: 'pi', envBin: process.env.CEZ_PI_BIN },
|
|
85
|
+
];
|
|
86
|
+
/** The runner behind a `cli:<runner>` open target, or null when the id isn't a CLI handoff. */
|
|
87
|
+
export function agentCliRunner(targetId) {
|
|
88
|
+
const match = AGENT_CLIS.find((c) => `cli:${c.runner}` === targetId);
|
|
89
|
+
return match ? match.runner : null;
|
|
90
|
+
}
|
|
91
|
+
/** The open targets available on this machine: the file manager, a terminal, every detected
|
|
92
|
+
* editor, and every installed coding-agent CLI. Order is stable so the menu never reshuffles. */
|
|
93
|
+
export function detectOpenTargets() {
|
|
94
|
+
const targets = [
|
|
95
|
+
{ id: 'finder', label: FILE_MANAGER_LABEL, icon: 'folder' },
|
|
96
|
+
{ id: 'terminal', label: 'Terminal', icon: 'terminal' },
|
|
97
|
+
];
|
|
98
|
+
for (const editor of EDITORS) {
|
|
99
|
+
if (editorAvailable(editor))
|
|
100
|
+
targets.push({ id: editor.id, label: editor.label, icon: editor.icon });
|
|
101
|
+
}
|
|
102
|
+
for (const cli of AGENT_CLIS) {
|
|
103
|
+
if ((cli.envBin && existsSync(cli.envBin)) || onPath(cli.bin)) {
|
|
104
|
+
targets.push({ id: `cli:${cli.runner}`, label: cli.label, icon: cli.icon });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return targets;
|
|
108
|
+
}
|
|
109
|
+
/** The (bin, args) a file-manager launch resolves to — pure so the per-platform routing
|
|
110
|
+
* (including the WSL→Explorer interop branch) is unit-testable without spawning anything.
|
|
111
|
+
* `platform`/`wsl` default to the real environment; tests pass them explicitly. */
|
|
112
|
+
export function fileManagerLaunch(dir, platform = process.platform, wsl = isWsl()) {
|
|
113
|
+
if (platform === 'darwin')
|
|
114
|
+
return { bin: 'open', args: [dir] };
|
|
115
|
+
if (platform === 'win32')
|
|
116
|
+
return { bin: 'explorer', args: [dir] };
|
|
117
|
+
if (wsl)
|
|
118
|
+
return { bin: 'explorer.exe', args: [translateToWindowsPath(dir)] };
|
|
119
|
+
return { bin: 'xdg-open', args: [dir] };
|
|
120
|
+
}
|
|
121
|
+
/** Open `dir` in the file manager, natively per platform. Under WSL there is no Linux desktop to
|
|
122
|
+
* hand `xdg-open` to — go through interop to Windows Explorer instead, translating the path. */
|
|
123
|
+
async function openFileManager(dir) {
|
|
124
|
+
const { bin, args } = fileManagerLaunch(dir);
|
|
125
|
+
return runDetached(bin, args);
|
|
126
|
+
}
|
|
127
|
+
/** Open a single worktree FILE with whatever application the OS has registered as its
|
|
128
|
+
* default handler — the diff pane's "open in default app" action for images (#365). Distinct
|
|
129
|
+
* from `openFileManager` above: that opens a *directory* in the file manager; this launches
|
|
130
|
+
* the file itself (e.g. the OS's default image viewer), never a directory listing. Local-only
|
|
131
|
+
* by construction — the caller gates this behind `localHandoff`.
|
|
132
|
+
*
|
|
133
|
+
* `path` is worktree CONTENT — a filename some cloned repo or coding agent chose — so it is
|
|
134
|
+
* hostile input, and it must never reach a process that re-parses its command line. That rules
|
|
135
|
+
* `cmd.exe` out on Windows: an argument array does NOT protect you there, because libuv quotes
|
|
136
|
+
* a spawn arg only when it contains a space/tab/quote and passes everything else verbatim, so
|
|
137
|
+
* `cmd /c start "" C:\dev\proj\a&calc&.png` would let cmd's `&` run `calc` (BatBadBut,
|
|
138
|
+
* CVE-2024-27980). `explorer <file>` hands the file to its registered handler with no such
|
|
139
|
+
* re-parsing — the same launcher `openFileManager` already uses for directories. */
|
|
140
|
+
export async function openFileInDefaultApp(path) {
|
|
141
|
+
if (process.platform === 'darwin')
|
|
142
|
+
return runDetached('open', [path]);
|
|
143
|
+
if (process.platform === 'win32')
|
|
144
|
+
return runDetached('explorer', [path]);
|
|
145
|
+
return runDetached('xdg-open', [path]);
|
|
146
|
+
}
|
|
147
|
+
/** Open `dir` in the given target. Unknown/unavailable target → false (the caller 409s). */
|
|
148
|
+
export async function openInApp(targetId, dir) {
|
|
149
|
+
if (targetId === 'finder')
|
|
150
|
+
return openFileManager(dir);
|
|
151
|
+
// A bare interactive shell at the worktree — `:` is a no-op so no command actually runs.
|
|
152
|
+
if (targetId === 'terminal')
|
|
153
|
+
return openInTerminal(dir, ':');
|
|
154
|
+
const editor = EDITORS.find((e) => e.id === targetId);
|
|
155
|
+
if (!editor)
|
|
156
|
+
return false;
|
|
157
|
+
if (editor.cli) {
|
|
158
|
+
const resolved = resolveOnPath(editor.cli);
|
|
159
|
+
if (resolved)
|
|
160
|
+
return runDetached(resolved, [launchPathFor(resolved, dir)]);
|
|
161
|
+
}
|
|
162
|
+
if (editor.mac && macAppExists(editor.mac))
|
|
163
|
+
return runDetached('open', ['-a', pickInstalledMacApp(editor.mac), dir]);
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
/** The path argument to hand a resolved binary: a Windows-suffixed name found through WSL
|
|
167
|
+
* interop needs the Windows-side path; a bare-name binary (native Linux, or a WSL-aware shim
|
|
168
|
+
* like VS Code's Remote-WSL `code`) takes the POSIX path unchanged. `wsl` defaults to the real
|
|
169
|
+
* environment; tests pass it explicitly so this needs no global platform stubbing. */
|
|
170
|
+
export function launchPathFor(resolvedBin, dir, wsl = isWsl()) {
|
|
171
|
+
if (wsl && /\.(com|exe)$/i.test(resolvedBin))
|
|
172
|
+
return translateToWindowsPath(dir);
|
|
173
|
+
return dir;
|
|
174
|
+
}
|
|
175
|
+
/** Which of an editor's candidate .app names is actually installed — `macAppExists` already
|
|
176
|
+
* confirmed at least one is, this just picks it for the `open -a` argument. */
|
|
177
|
+
function pickInstalledMacApp(names) {
|
|
178
|
+
const candidates = Array.isArray(names) ? names : [names];
|
|
179
|
+
return (candidates.find((name) => [
|
|
180
|
+
`/Applications/${name}.app`,
|
|
181
|
+
join(homedir(), 'Applications', `${name}.app`),
|
|
182
|
+
`/System/Applications/${name}.app`,
|
|
183
|
+
].some((p) => existsSync(p))) ?? candidates[0]);
|
|
184
|
+
}
|
|
185
|
+
/** Spawn detached; success = no error within a short settle window (mirrors open-in-terminal). */
|
|
186
|
+
function runDetached(bin, args) {
|
|
187
|
+
return new Promise((resolve) => {
|
|
188
|
+
refuseSpawnUnderTest(bin, args);
|
|
189
|
+
let child;
|
|
190
|
+
try {
|
|
191
|
+
child = spawn(bin, args, { stdio: 'ignore', detached: true });
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
resolve(false);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
let settled = false;
|
|
198
|
+
const settle = (ok) => {
|
|
199
|
+
if (settled)
|
|
200
|
+
return;
|
|
201
|
+
settled = true;
|
|
202
|
+
resolve(ok);
|
|
203
|
+
};
|
|
204
|
+
child.once('error', () => settle(false));
|
|
205
|
+
setTimeout(() => {
|
|
206
|
+
child.unref();
|
|
207
|
+
settle(true);
|
|
208
|
+
}, 250);
|
|
209
|
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C,MAAM,CAAC;YACP,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO;QACT,CAAC;QACD,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,MAAM,GAAG,CAAC,EAAW,EAAE,EAAE;YAC7B,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,OAAO,CAAC,EAAE,CAAC,CAAC;QACd,CAAC,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACzC,UAAU,CAAC,GAAG,EAAE;YACd,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,MAAM,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Open a real terminal window at `cwd` running `command` — the "take over the
|
|
3
|
+
* agent session locally" handoff. Cross-platform strategy ported from
|
|
4
|
+
* github-janitor's `openInTerminal.ts`: macOS via osascript, Windows via
|
|
5
|
+
* cmd/start, Linux by probing common emulators with a temp launch script
|
|
6
|
+
* (which sidesteps per-emulator quoting rules). WSL (#361) reuses the Linux
|
|
7
|
+
* script but hands it to a Windows-side terminal through interop, re-entering
|
|
8
|
+
* the distro with `wsl.exe` — there is no Linux desktop of its own to open
|
|
9
|
+
* `x-terminal-emulator` etc. on.
|
|
10
|
+
*
|
|
11
|
+
* Returns true when a launcher was started without an immediate error; the
|
|
12
|
+
* caller shows a copy-the-command fallback otherwise.
|
|
13
|
+
*/
|
|
14
|
+
export declare function openInTerminal(cwd: string, command: string,
|
|
15
|
+
/** Environment the opened shell must carry — today, the agent account's config dir (spec
|
|
16
|
+
* 2026-07-29-agent-profiles). Rendered per platform and made to PERSIST, because the window
|
|
17
|
+
* stays open and the user types the next `claude` in it themselves. An empty/absent env
|
|
18
|
+
* changes nothing about the command. Returns false without launching anything when the
|
|
19
|
+
* values cannot be embedded safely: a terminal silently aimed at the wrong account is worse
|
|
20
|
+
* than no terminal, since nothing in the window would say so. */
|
|
21
|
+
env?: Record<string, string>): Promise<boolean>;
|
|
22
|
+
/** The Windows-side (bin, args) candidates for launching `scriptPath` inside `distro` through
|
|
23
|
+
* WSL interop, in try-order — Windows Terminal first, a classic console window as fallback. Pure
|
|
24
|
+
* (no spawning) so the exact command line is unit-testable without a real WSL host.
|
|
25
|
+
*
|
|
26
|
+
* Every launcher here is shell-free by construction, and must stay that way: routing through
|
|
27
|
+
* `cmd.exe` (`/c start …`) would reintroduce BatBadBut (CVE-2024-27980, see #459). Passing an
|
|
28
|
+
* argument array is NOT protection when the binary is a shell — libuv only quotes arguments
|
|
29
|
+
* containing space, tab or quote, so a space-free `distro` like `a&calc&` would reach `cmd`
|
|
30
|
+
* live and be interpreted. `wt.exe` and `conhost.exe` parse no metacharacters, so the same
|
|
31
|
+
* input is inert. `distro` is additionally validated at the source (`wslDistroName`). */
|
|
32
|
+
export declare function wslTerminalLaunchers(scriptPath: string, distro: string): Array<[string, string[]]>;
|
|
33
|
+
/** Grace period before a launch script's directory is removed. Generous next to the
|
|
34
|
+
* ~250 ms each emulator candidate is given, because the cost of being early is a
|
|
35
|
+
* window that never opens, and the cost of being late is a few hundred bytes. */
|
|
36
|
+
export declare const LAUNCH_SCRIPT_TTL_MS = 60000;
|
|
37
|
+
/**
|
|
38
|
+
* Writes the temp launch script shared by the plain-Linux and WSL branches — `cd` into
|
|
39
|
+
* the worktree, run `command`, then drop into an interactive shell so the window stays
|
|
40
|
+
* open — and schedules its own removal (#785).
|
|
41
|
+
*
|
|
42
|
+
* Every "open in terminal" used to leave its `cez-term-*` directory behind forever. On a
|
|
43
|
+
* host whose `/tmp` is a tmpfs that never reboots, cezar's own litter is part of what
|
|
44
|
+
* exhausts the directory the agents' output capture depends on, so the opener cleans up
|
|
45
|
+
* after itself. Deleting the script mid-run is safe: the emulator has already `exec`'d
|
|
46
|
+
* bash on it, and POSIX keeps an unlinked file's inode alive for every open descriptor.
|
|
47
|
+
* The timer is `unref`'d — a pending cleanup must never be the reason `cezar serve`
|
|
48
|
+
* refuses to exit.
|
|
49
|
+
*
|
|
50
|
+
* Exported for the regression test, which must prove the directory does not survive
|
|
51
|
+
* without spawning a real terminal emulator.
|
|
52
|
+
*/
|
|
53
|
+
export declare function createLaunchScript(cwd: string, command: string, ttlMs?: number): string;
|
|
54
|
+
/**
|
|
55
|
+
* A test that reaches a real launcher opens a window on the developer's machine — a Terminal on
|
|
56
|
+
* macOS, a `cmd` window on Windows, an emulator on Linux — and #820 is what that looks like: a
|
|
57
|
+
* suite run left a Terminal sitting in a `cez-profiles-home-*` fixture directory the same run had
|
|
58
|
+
* already deleted. Throwing beats returning `false`: a silent refusal would let the omission
|
|
59
|
+
* survive as a passing test, and the fix is always the same one line — inject the launcher seam
|
|
60
|
+
* (`openTerminal` / `openFile` / `openApp` on `ServerDeps`) instead of reaching the real one.
|
|
61
|
+
*
|
|
62
|
+
* `CEZ_ALLOW_TEST_SPAWN=1` is the deliberate exception, for a file that has replaced
|
|
63
|
+
* `node:child_process` with a mock: nothing reaches a real process there, and asserting the argv a
|
|
64
|
+
* launcher WOULD pass is exactly how the Windows launcher-safety cases (#469, BatBadBut) are
|
|
65
|
+
* pinned. Set it around those tests, never process-wide.
|
|
66
|
+
*
|
|
67
|
+
* Exported so `open-in-app.ts` shares this one definition rather than keeping a second copy that
|
|
68
|
+
* could drift.
|
|
69
|
+
*/
|
|
70
|
+
export declare function refuseSpawnUnderTest(bin: string, args: readonly string[]): void;
|