@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,121 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Contracts for the server installer (spec 2026-07-16-server-installer).
|
|
4
|
+
* The engine closes over `InstallStep` / `PlatformStrategy` and never learns
|
|
5
|
+
* what a step *does* β only `check` / `run` / `undo`. That seam is what makes
|
|
6
|
+
* "use ubuntu as a selector and run it that way" a registry lookup, and what
|
|
7
|
+
* makes the interactive helpers reusable across every future platform.
|
|
8
|
+
*/
|
|
9
|
+
/** The platforms the registry knows. Extend here + add a strategy file. */
|
|
10
|
+
export const PLATFORM_IDS = ['ubuntu-vps', 'macosx-ngrok'];
|
|
11
|
+
/** Per-step lifecycle. `failed` resumes identically to `pending`. */
|
|
12
|
+
export const STEP_STATUSES = ['pending', 'done', 'skipped', 'failed'];
|
|
13
|
+
/**
|
|
14
|
+
* One thing a step created, tagged by who owns its removal:
|
|
15
|
+
* - `owned` β cezar authored it and nothing else uses it β uninstall removes it.
|
|
16
|
+
* - `shared` β a system tool the operator may now depend on (gh, agent CLIs,
|
|
17
|
+
* certbot + its renewal timer, the cert itself) β uninstall lists it with a
|
|
18
|
+
* manual removal hint instead of yanking it.
|
|
19
|
+
*/
|
|
20
|
+
export const stepArtifactSchema = z.object({
|
|
21
|
+
kind: z.enum(['owned', 'shared']),
|
|
22
|
+
/** file | package | service | cert | htpasswd | config | note */
|
|
23
|
+
type: z.string().min(1),
|
|
24
|
+
/** Filesystem path for `owned` files (vhost, unit, htpasswd). */
|
|
25
|
+
path: z.string().optional(),
|
|
26
|
+
/** Human name: package id, unit name, cert domain, auth user. */
|
|
27
|
+
name: z.string().optional(),
|
|
28
|
+
/** `system` | `user` for services. */
|
|
29
|
+
scope: z.string().optional(),
|
|
30
|
+
/** For `shared` artifacts: the exact command the operator can run to remove it. */
|
|
31
|
+
removeHint: z.string().optional(),
|
|
32
|
+
});
|
|
33
|
+
/** What a step returns from `run()`; `undo()` receives it back verbatim. */
|
|
34
|
+
export const stepCreatedSchema = z
|
|
35
|
+
.object({ artifacts: z.array(stepArtifactSchema).default([]) })
|
|
36
|
+
.nullable();
|
|
37
|
+
/**
|
|
38
|
+
* Persisted per-step outcome β the `steps` map in `server.json`. A status this
|
|
39
|
+
* version doesn't know (written by a newer cezar) degrades to `failed`, which
|
|
40
|
+
* keeps the record AND keeps it on uninstall's undo path β never to a parse
|
|
41
|
+
* failure that would discard the whole ledger.
|
|
42
|
+
*/
|
|
43
|
+
export const stepOutcomeSchema = z.object({
|
|
44
|
+
status: z.enum(STEP_STATUSES).catch('failed'),
|
|
45
|
+
created: stepCreatedSchema.optional().catch(null),
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* `~/.cezar/server.json` β host-level, install-once. Additive-safe: every new
|
|
49
|
+
* field is optional / defaulted so an older cezar still parses a newer file
|
|
50
|
+
* (BACKWARD_COMPATIBILITY cross-version-state rule). No secrets live here.
|
|
51
|
+
*/
|
|
52
|
+
export const serverStateSchema = z
|
|
53
|
+
.object({
|
|
54
|
+
schema: z.literal(1).catch(1),
|
|
55
|
+
/**
|
|
56
|
+
* Free string, not an enum: a `server.json` written by a newer cezar with a
|
|
57
|
+
* platform this version doesn't ship must still parse β the registry lookup
|
|
58
|
+
* is where "unknown platform" is decided, with the ledger intact.
|
|
59
|
+
*/
|
|
60
|
+
platform: z.string().min(1).optional().catch(undefined),
|
|
61
|
+
/**
|
|
62
|
+
* Instance id (slug) this record belongs to β `default` for the original
|
|
63
|
+
* single-cockpit host, or a domain-derived slug for a named instance under
|
|
64
|
+
* `~/.cezar/server-instances/`. Self-describing so tooling can list what a
|
|
65
|
+
* host runs without re-deriving it from the filename.
|
|
66
|
+
*/
|
|
67
|
+
instance: z.string().min(1).optional().catch(undefined),
|
|
68
|
+
/** Public domain this instance answers on (drives nginx `server_name` +
|
|
69
|
+
* the SSL cert). Absent for a plain HTTP / default install. */
|
|
70
|
+
domain: z.string().optional().catch(undefined),
|
|
71
|
+
/**
|
|
72
|
+
* External-reverse-proxy mode (`--external-proxy`): the box already has a
|
|
73
|
+
* front (Dokploy/Traefik, Coolify, Caddy, an existing nginx) that owns
|
|
74
|
+
* :80/:443 and provides TLS + auth. cezar then installs NO nginx and NO
|
|
75
|
+
* cert of its own β just the service β and that proxy routes to `bindHost`.
|
|
76
|
+
*/
|
|
77
|
+
externalProxy: z.boolean().optional().catch(undefined),
|
|
78
|
+
/**
|
|
79
|
+
* Interface the cockpit binds. Loopback by default; an external-proxy
|
|
80
|
+
* install may need a host the proxy can actually reach (e.g. the docker
|
|
81
|
+
* bridge `172.17.0.1` when the proxy runs in a container).
|
|
82
|
+
*/
|
|
83
|
+
bindHost: z.string().optional().catch(undefined),
|
|
84
|
+
/** Flips true only when every required step is `done`. */
|
|
85
|
+
installed: z.boolean().default(false).catch(false),
|
|
86
|
+
/** True when this record was written by a CEZ_DRY_RUN preview β a real
|
|
87
|
+
* install/uninstall treats it as no record at all (self-healing). */
|
|
88
|
+
dryRun: z.boolean().optional().catch(undefined),
|
|
89
|
+
/** ISO stamp set by the caller (Date.now is unavailable in some contexts). */
|
|
90
|
+
createdAt: z.string().optional().catch(undefined),
|
|
91
|
+
updatedAt: z.string().optional().catch(undefined),
|
|
92
|
+
primaryPort: z.number().int().positive().default(4321).catch(4321),
|
|
93
|
+
/** Public URL / identity user surfaced at the end β display only. */
|
|
94
|
+
publicUrl: z.string().optional().catch(undefined),
|
|
95
|
+
/** macOS+ngrok free tier: the tunnel URL changes across restarts. */
|
|
96
|
+
ephemeral: z.boolean().optional().catch(undefined),
|
|
97
|
+
// A single malformed entry degrades to a `failed` record (undo still runs
|
|
98
|
+
// from constants), never to losing every other step's ledger.
|
|
99
|
+
steps: z
|
|
100
|
+
.record(z.string(), stepOutcomeSchema.catch({ status: 'failed', created: null }))
|
|
101
|
+
.default({})
|
|
102
|
+
.catch({}),
|
|
103
|
+
})
|
|
104
|
+
// Unknown top-level fields written by a newer cezar survive a load+save
|
|
105
|
+
// round-trip β the file's own additive-safe contract.
|
|
106
|
+
.passthrough();
|
|
107
|
+
/** Freshly-initialized state (no install yet). */
|
|
108
|
+
export function freshServerState() {
|
|
109
|
+
return serverStateSchema.parse({});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The interactive surface a step talks to. Implemented by `ui.ts` over
|
|
113
|
+
* `@clack/prompts`; declared here as a pure interface so `types.ts` (and the
|
|
114
|
+
* engine) never import the TUI library. Prompt methods resolve to the
|
|
115
|
+
* `CANCEL` sentinel instead of throwing when the user aborts.
|
|
116
|
+
*/
|
|
117
|
+
export const CANCEL = Symbol('cezar.ui.cancel');
|
|
118
|
+
/** Thrown by `preflight` to stop with a clean, user-facing reason (no stack). */
|
|
119
|
+
export class PreflightError extends Error {
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/server-install/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,cAAc,CAAU,CAAC;AAGpE,qEAAqE;AACrE,MAAM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SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;IACjD,qEAAqE;IACrE,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;IAClD,0EAA0E;IAC1E,8DAA8D;IAC9D,KAAK,EAAE,CAAC;SACL,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SAChF,OAAO,CAAC,EAAE,CAAC;SACX,KAAK,CAAC,EAAE,CAAC;CACb,CAAC;IACF,wEAAwE;IACxE,sDAAsD;KACrD,WAAW,EAAE,CAAC;AAGjB,kDAAkD;AAClD,MAAM,UAAU,gBAAgB;IAC9B,OAAO,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAmJhD,iFAAiF;AACjF,MAAM,OAAO,cAAe,SAAQ,KAAK;CAAG"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as clack from '@clack/prompts';
|
|
2
|
+
import { type Ui } from './types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The interactive surface, implemented over `@clack/prompts` β the one place
|
|
5
|
+
* the TUI library is imported. `types.ts`, the engine and the steps talk to
|
|
6
|
+
* the `Ui` interface only, so `@clack/prompts` never enters the server/runtime
|
|
7
|
+
* import graph (AGENTS.md keeps that stack tiny).
|
|
8
|
+
*
|
|
9
|
+
* Every prompt maps clack's cancel symbol to the `CANCEL` sentinel instead of
|
|
10
|
+
* throwing, so a Ctrl-C mid-install is a value the engine can persist-and-exit
|
|
11
|
+
* on, not an exception.
|
|
12
|
+
*/
|
|
13
|
+
/** The subset of `@clack/prompts` the UI uses β injectable for unit tests. */
|
|
14
|
+
export interface PromptBackend {
|
|
15
|
+
intro: typeof clack.intro;
|
|
16
|
+
outro: typeof clack.outro;
|
|
17
|
+
note: typeof clack.note;
|
|
18
|
+
log: typeof clack.log;
|
|
19
|
+
select: typeof clack.select;
|
|
20
|
+
multiselect: typeof clack.multiselect;
|
|
21
|
+
confirm: typeof clack.confirm;
|
|
22
|
+
text: typeof clack.text;
|
|
23
|
+
password: typeof clack.password;
|
|
24
|
+
spinner: typeof clack.spinner;
|
|
25
|
+
isCancel: typeof clack.isCancel;
|
|
26
|
+
}
|
|
27
|
+
/** The real interactive UI. */
|
|
28
|
+
export declare function createClackUi(backend?: PromptBackend): Ui;
|
|
29
|
+
/**
|
|
30
|
+
* Non-interactive UI for `--yes`, `CEZ_DRY_RUN`, and unit tests. Prompts resolve
|
|
31
|
+
* to deterministic safe defaults (initial value, or the first option, or ""),
|
|
32
|
+
* logs go to the console. It never touches stdin, so it can drive the engine
|
|
33
|
+
* headless. Optional `answers` override defaults per-prompt-message.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createAutoUi(answers?: Record<string, unknown>, sink?: (m: string) => void, opts?: {
|
|
36
|
+
/**
|
|
37
|
+
* Enforce each prompt's `validate` on auto-answers (real `--yes` runs must
|
|
38
|
+
* fail closed on an unanswerable prompt). Off for CEZ_DRY_RUN previews,
|
|
39
|
+
* which must walk every step with placeholder-grade values.
|
|
40
|
+
*/
|
|
41
|
+
strictValidate?: boolean;
|
|
42
|
+
}): Ui;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as clack from '@clack/prompts';
|
|
2
|
+
import { CANCEL, PreflightError } from './types.js';
|
|
3
|
+
import { StepAborted } from './steps.js';
|
|
4
|
+
const realBackend = {
|
|
5
|
+
intro: clack.intro,
|
|
6
|
+
outro: clack.outro,
|
|
7
|
+
note: clack.note,
|
|
8
|
+
log: clack.log,
|
|
9
|
+
select: clack.select,
|
|
10
|
+
multiselect: clack.multiselect,
|
|
11
|
+
confirm: clack.confirm,
|
|
12
|
+
text: clack.text,
|
|
13
|
+
password: clack.password,
|
|
14
|
+
spinner: clack.spinner,
|
|
15
|
+
isCancel: clack.isCancel,
|
|
16
|
+
};
|
|
17
|
+
/** Map a clack result to `T | CANCEL`, never a thrown cancel. */
|
|
18
|
+
function unwrap(value, isCancel) {
|
|
19
|
+
return isCancel(value) ? CANCEL : value;
|
|
20
|
+
}
|
|
21
|
+
/** The real interactive UI. */
|
|
22
|
+
export function createClackUi(backend = realBackend) {
|
|
23
|
+
// clack renders a prompt at stdin-EOF and never resolves β a piped/ssh'd
|
|
24
|
+
// invocation would hang forever while holding the single-writer install
|
|
25
|
+
// lock. Refuse up front with the way out. (Injected fake backends are for
|
|
26
|
+
// tests, which have no TTY.)
|
|
27
|
+
if (backend === realBackend && (!process.stdin.isTTY || !process.stdout.isTTY)) {
|
|
28
|
+
throw new PreflightError('this terminal is not interactive β re-run from a TTY, or pass --yes (or CEZ_DRY_RUN=1) for non-interactive mode');
|
|
29
|
+
}
|
|
30
|
+
const wrapValidate = (validate) => validate ? (v) => validate(v ?? '') : undefined;
|
|
31
|
+
return {
|
|
32
|
+
intro: (m) => backend.intro(m),
|
|
33
|
+
outro: (m) => backend.outro(m),
|
|
34
|
+
note: (m, title) => backend.note(m, title),
|
|
35
|
+
// Raw, un-boxed: clack's note() draws a bordered box that breaks when a long
|
|
36
|
+
// command wraps. Write straight to stdout so the command stays selectable.
|
|
37
|
+
message: (m) => process.stdout.write(`\n${m}\n`),
|
|
38
|
+
info: (m) => backend.log.info(m),
|
|
39
|
+
success: (m) => backend.log.success(m),
|
|
40
|
+
warn: (m) => backend.log.warn(m),
|
|
41
|
+
error: (m) => backend.log.error(m),
|
|
42
|
+
async select(opts) {
|
|
43
|
+
// clack's `Option<Value>` is a conditional type that can't resolve against
|
|
44
|
+
// an unconstrained generic; cast the options and keep the explicit T.
|
|
45
|
+
const res = await backend.select({
|
|
46
|
+
message: opts.message,
|
|
47
|
+
options: opts.options,
|
|
48
|
+
initialValue: opts.initialValue,
|
|
49
|
+
});
|
|
50
|
+
return unwrap(res, backend.isCancel);
|
|
51
|
+
},
|
|
52
|
+
async multiselect(opts) {
|
|
53
|
+
const res = await backend.multiselect({
|
|
54
|
+
message: opts.message,
|
|
55
|
+
options: opts.options,
|
|
56
|
+
required: opts.required ?? false,
|
|
57
|
+
});
|
|
58
|
+
return unwrap(res, backend.isCancel);
|
|
59
|
+
},
|
|
60
|
+
async confirm(opts) {
|
|
61
|
+
return unwrap(await backend.confirm(opts), backend.isCancel);
|
|
62
|
+
},
|
|
63
|
+
async text(opts) {
|
|
64
|
+
return unwrap(await backend.text({ ...opts, validate: wrapValidate(opts.validate) }), backend.isCancel);
|
|
65
|
+
},
|
|
66
|
+
async password(opts) {
|
|
67
|
+
return unwrap(await backend.password({ ...opts, validate: wrapValidate(opts.validate) }), backend.isCancel);
|
|
68
|
+
},
|
|
69
|
+
spinner() {
|
|
70
|
+
const s = backend.spinner();
|
|
71
|
+
return {
|
|
72
|
+
start: (m) => s.start(m),
|
|
73
|
+
stop: (m) => s.stop(m),
|
|
74
|
+
message: (m) => s.message(m),
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Non-interactive UI for `--yes`, `CEZ_DRY_RUN`, and unit tests. Prompts resolve
|
|
81
|
+
* to deterministic safe defaults (initial value, or the first option, or ""),
|
|
82
|
+
* logs go to the console. It never touches stdin, so it can drive the engine
|
|
83
|
+
* headless. Optional `answers` override defaults per-prompt-message.
|
|
84
|
+
*/
|
|
85
|
+
export function createAutoUi(answers = {}, sink = () => { }, opts = {}) {
|
|
86
|
+
const answer = (message, fallback) => (message in answers ? answers[message] : fallback);
|
|
87
|
+
const checkValid = (message, v, validate) => {
|
|
88
|
+
if (!opts.strictValidate)
|
|
89
|
+
return;
|
|
90
|
+
const invalid = validate?.(v);
|
|
91
|
+
if (invalid !== undefined) {
|
|
92
|
+
throw new StepAborted(`cannot auto-answer "${message}" (${invalid}) β run without --yes to answer it`);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
intro: sink,
|
|
97
|
+
outro: sink,
|
|
98
|
+
note: (m) => sink(m),
|
|
99
|
+
message: sink,
|
|
100
|
+
info: sink,
|
|
101
|
+
success: sink,
|
|
102
|
+
warn: sink,
|
|
103
|
+
error: sink,
|
|
104
|
+
async select(opts) {
|
|
105
|
+
return answer(opts.message, opts.initialValue ?? opts.options[0]?.value);
|
|
106
|
+
},
|
|
107
|
+
async multiselect(opts) {
|
|
108
|
+
return answer(opts.message, []);
|
|
109
|
+
},
|
|
110
|
+
async confirm(opts) {
|
|
111
|
+
return answer(opts.message, opts.initialValue ?? true);
|
|
112
|
+
},
|
|
113
|
+
// A placeholder is a HINT, never an answer β auto-adopting it turned the
|
|
114
|
+
// example domain `cezar.ngrok.app` into real input under `--yes`.
|
|
115
|
+
async text(o) {
|
|
116
|
+
const v = String(answer(o.message, o.initialValue ?? ''));
|
|
117
|
+
checkValid(o.message, v, o.validate);
|
|
118
|
+
return v;
|
|
119
|
+
},
|
|
120
|
+
async password(o) {
|
|
121
|
+
const v = String(answer(o.message, ''));
|
|
122
|
+
checkValid(o.message, v, o.validate);
|
|
123
|
+
return v;
|
|
124
|
+
},
|
|
125
|
+
spinner() {
|
|
126
|
+
return { start: (m) => m && sink(m), stop: (m) => m && sink(m), message: (m) => sink(m) };
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/server-install/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAiD,MAAM,YAAY,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,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AAC,CAAC;YACV,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,CAAC;YAC1D,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;YACrC,OAAO,CAAC,CAAC;QACX,CAAC;QACD,KAAK,CAAC,QAAQ,CAAC,CAAC;YACd,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;YACxC,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;YACrC,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO;YACL,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5F,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promotes `open-mercato/skills` (#391) β cezar's built-in default skills source
|
|
3
|
+
* (`DEFAULT_SKILLS_REPOS` in `src/config.ts`) that today only surfaces in `--help`. Split out of
|
|
4
|
+
* `src/index.ts` so it is testable without importing `index.ts` (which runs `main()` on import).
|
|
5
|
+
* It once had a cockpit twin to stay in step with; #603 replaced that with the opt-in
|
|
6
|
+
* `packages/web/src/components/skills-import-panel.tsx`, so the terminal is now the only surface
|
|
7
|
+
* that renders the promo.
|
|
8
|
+
*
|
|
9
|
+
* Printed on `serve` start β a few lines in an already-chatty startup block. It has two off
|
|
10
|
+
* switches, because a promo that cannot be silenced is a nag:
|
|
11
|
+
* - `CEZ_NO_BANNER=1` in the environment, and
|
|
12
|
+
* - `dismissedSkillsBanner` in `.ai/cezar/ui-state.json` β written by the cockpit banner until
|
|
13
|
+
* #603 removed it. The flag is still honoured, so anyone who dismissed it back then stays
|
|
14
|
+
* silenced; nothing writes it today.
|
|
15
|
+
* Reading that flag follows the `src/config.ts` rule: a missing/unreadable/malformed state file
|
|
16
|
+
* degrades to showing the banner, never to a crash or a blocked startup.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SKILLS_BANNER_LINES: readonly string[];
|
|
19
|
+
/** Both off switches in one place. Never throws. */
|
|
20
|
+
export declare function shouldShowSkillsBanner(repoRoot: string): Promise<boolean>;
|
|
21
|
+
/** The `serve` startup banner. `log` is injectable so the wiring is testable. */
|
|
22
|
+
export declare function printSkillsBanner(repoRoot: string, log?: (line?: string) => void): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readUiState } from './ui-state.js';
|
|
2
|
+
/**
|
|
3
|
+
* Promotes `open-mercato/skills` (#391) β cezar's built-in default skills source
|
|
4
|
+
* (`DEFAULT_SKILLS_REPOS` in `src/config.ts`) that today only surfaces in `--help`. Split out of
|
|
5
|
+
* `src/index.ts` so it is testable without importing `index.ts` (which runs `main()` on import).
|
|
6
|
+
* It once had a cockpit twin to stay in step with; #603 replaced that with the opt-in
|
|
7
|
+
* `packages/web/src/components/skills-import-panel.tsx`, so the terminal is now the only surface
|
|
8
|
+
* that renders the promo.
|
|
9
|
+
*
|
|
10
|
+
* Printed on `serve` start β a few lines in an already-chatty startup block. It has two off
|
|
11
|
+
* switches, because a promo that cannot be silenced is a nag:
|
|
12
|
+
* - `CEZ_NO_BANNER=1` in the environment, and
|
|
13
|
+
* - `dismissedSkillsBanner` in `.ai/cezar/ui-state.json` β written by the cockpit banner until
|
|
14
|
+
* #603 removed it. The flag is still honoured, so anyone who dismissed it back then stays
|
|
15
|
+
* silenced; nothing writes it today.
|
|
16
|
+
* Reading that flag follows the `src/config.ts` rule: a missing/unreadable/malformed state file
|
|
17
|
+
* degrades to showing the banner, never to a crash or a blocked startup.
|
|
18
|
+
*/
|
|
19
|
+
export const SKILLS_BANNER_LINES = [
|
|
20
|
+
' π€ Make the most of parallel coding with our AI skills',
|
|
21
|
+
' open-mercato/skills: reusable, technology-agnostic agent skills for PR',
|
|
22
|
+
' creation, code review, CI stabilisation, spec writing & more.',
|
|
23
|
+
' cezar already loads them for you β Skills β Refresh in the cockpit gets the latest.',
|
|
24
|
+
" To use them outside cezar: npx skills add open-mercato/skills --skill '*'",
|
|
25
|
+
];
|
|
26
|
+
/** Both off switches in one place. Never throws. */
|
|
27
|
+
export async function shouldShowSkillsBanner(repoRoot) {
|
|
28
|
+
if (process.env.CEZ_NO_BANNER === '1')
|
|
29
|
+
return false;
|
|
30
|
+
const uiState = await readUiState(repoRoot);
|
|
31
|
+
return uiState.dismissedSkillsBanner !== true;
|
|
32
|
+
}
|
|
33
|
+
/** The `serve` startup banner. `log` is injectable so the wiring is testable. */
|
|
34
|
+
export async function printSkillsBanner(repoRoot, log = console.log) {
|
|
35
|
+
if (!(await shouldShowSkillsBanner(repoRoot)))
|
|
36
|
+
return;
|
|
37
|
+
for (const line of SKILLS_BANNER_LINES)
|
|
38
|
+
log(line);
|
|
39
|
+
log();
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=skills-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-banner.js","sourceRoot":"","sources":["../src/skills-banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB;IACpD,0DAA0D;IAC1D,0EAA0E;IAC1E,iEAAiE;IACjE,uFAAuF;IACvF,8EAA8E;CAC/E,CAAC;AAEF,oDAAoD;AACpD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,QAAgB;IAC3D,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IACpD,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC,qBAAqB,KAAK,IAAI,CAAC;AAChD,CAAC;AAED,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,GAAG,GAA4B,OAAO,CAAC,GAAG;IAE1C,IAAI,CAAC,CAAC,MAAM,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QAAE,OAAO;IACtD,KAAK,MAAM,IAAI,IAAI,mBAAmB;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAClD,GAAG,EAAE,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type SkillsRepoSource } from './config.ts';
|
|
2
|
+
import { type Skill } from './skills.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The git remote for a configured source, or null when the value is unsafe to
|
|
5
|
+
* hand to `git` (#428). Team-skill repos are code-trusted β their skill bodies
|
|
6
|
+
* become agent system prompts β but the *string* is attacker-influenceable, so
|
|
7
|
+
* it must never be able to select a transport helper or pose as a git option.
|
|
8
|
+
* We accept exactly:
|
|
9
|
+
* - `owner/name` GitHub shorthand β canonical https
|
|
10
|
+
* - `https://` `http://` web URLs
|
|
11
|
+
* - `ssh://β¦` or scp-like `git@host:path`
|
|
12
|
+
* - a local path (`/abs`, `./`, `../`, `~/β¦`, `C:\β¦`) or `file://β¦`
|
|
13
|
+
* and reject the RCE/argument-injection surface: a leading `-`, the `::`
|
|
14
|
+
* remote-helper syntax (`ext::sh -c β¦`, `fd::β¦`), and any other URL scheme.
|
|
15
|
+
*
|
|
16
|
+
* Every reject here maps to a real vector. Shapes that are merely *unusual* β
|
|
17
|
+
* a Windows drive path, `~/β¦` β stay accepted: `BACKWARD_COMPATIBILITY.md` Β§5
|
|
18
|
+
* protects the `skillsRepos` source shape, so narrowing it is a breaking change
|
|
19
|
+
* and needs a migration path, not a silent refusal.
|
|
20
|
+
*/
|
|
21
|
+
export declare function safeRemoteFor(repo: string): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* A ref safe to pass to `git` as a positional revision (#428): a branch, tag,
|
|
24
|
+
* or commit SHA. Rejects a leading `-` (argument injection against git's option
|
|
25
|
+
* surface), range/pathspec metacharacters, and anything outside the git
|
|
26
|
+
* ref-name charset β so `${ref}:${path}` in `git show` can never be a `-`-flag.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isSafeRef(ref: string): boolean;
|
|
29
|
+
/** A full commit SHA (sha-1 or sha-256) β a pinned, immutable ref (#428). */
|
|
30
|
+
export declare function isPinnedSha(ref: string): boolean;
|
|
31
|
+
/** Stable cache directory name: the last two path segments, `owner__name`. */
|
|
32
|
+
export declare function bareDirFor(repo: string): string;
|
|
33
|
+
/** Clone the skills repo bare (no checkout) into the global cache, once. */
|
|
34
|
+
export declare function ensureBareClone(repo: string): Promise<{
|
|
35
|
+
bareDir: string;
|
|
36
|
+
created: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
/** "Refresh" β update every branch head in the bare clone from origin. */
|
|
39
|
+
export declare function fetchAll(bareDir: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Read one file from the bare clone at the source's ref. Null on any failure.
|
|
42
|
+
* `atCommit` pins the read to an already-resolved commit, so a caller listing
|
|
43
|
+
* many files reads them all at the same commit (and skips re-resolving).
|
|
44
|
+
*/
|
|
45
|
+
export declare function readRemoteSkill(src: SkillsRepoSource, path: string, atCommit?: string): Promise<string | null>;
|
|
46
|
+
/**
|
|
47
|
+
* List every skill the repo defines at `src.ref`. Reads from the local bare
|
|
48
|
+
* clone only β no network. Empty list when the clone doesn't exist yet or
|
|
49
|
+
* the ref can't be resolved.
|
|
50
|
+
*/
|
|
51
|
+
export declare function listRemoteSkills(src: SkillsRepoSource): Promise<Skill[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Copy a directory skill (SKILL.md + references/β¦) out of the bare clone into
|
|
54
|
+
* `<repoRoot>/.claude/skills/<name>/` so claude sees the references on disk,
|
|
55
|
+
* and keep it out of the user's git via `.git/info/exclude`. Returns false
|
|
56
|
+
* when there is nothing to materialize (not a directory skill, no cloneβ¦).
|
|
57
|
+
*/
|
|
58
|
+
export declare function materializeSkillDir(repoRoot: string, skill: Skill): Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a passive (non-`refresh`) load should `git fetch` an existing bare
|
|
61
|
+
* clone: yes on the first touch this process, and yes once the last fetch is
|
|
62
|
+
* older than `ttlMs`. Pure so the freshness policy is unit-tested without git.
|
|
63
|
+
*/
|
|
64
|
+
export declare function shouldPassiveFetch(opts: {
|
|
65
|
+
attempted: boolean;
|
|
66
|
+
fetchedAt: number;
|
|
67
|
+
now: number;
|
|
68
|
+
ttlMs: number;
|
|
69
|
+
}): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The current team-skill list for this project, straight from memory. The
|
|
72
|
+
* first call per `repoRoot` kicks off an async background load (clone + list)
|
|
73
|
+
* and returns immediately β the GUI refetches, so remote skills appear moments
|
|
74
|
+
* later instead of blocking the first `GET /api/skills`.
|
|
75
|
+
*/
|
|
76
|
+
export declare function getTeamSkillsCached(repoRoot: string): Skill[];
|
|
77
|
+
/**
|
|
78
|
+
* Wait for the same non-refreshing load kicked off by `getTeamSkillsCached`.
|
|
79
|
+
* The normal catalog read stays immediate; callers use this only for a
|
|
80
|
+
* background convergence read after they have already rendered local skills.
|
|
81
|
+
*/
|
|
82
|
+
export declare function waitForTeamSkills(repoRoot: string): Promise<Skill[]>;
|
|
83
|
+
/** Refresh: clone missing sources, `git fetch` existing ones, reload the list. */
|
|
84
|
+
export declare function refreshTeamSkills(repoRoot: string): Promise<Skill[]>;
|