even-keel 0.3.0-rc.1 → 0.3.0-rc.2
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/.claude-plugin/marketplace.json +5 -5
- package/.env.example +2 -2
- package/CHANGELOG.md +17 -0
- package/README.md +6 -4
- package/dist/src/account/header-levels.js +3 -2
- package/dist/src/account/homes.js +14 -4
- package/dist/src/account/model.js +31 -16
- package/dist/src/account/settingsGuard.js +92 -0
- package/dist/src/account/settingsGuardStrip.js +36 -0
- package/dist/src/account/settingsHook.js +15 -0
- package/dist/src/account/settingsLayer.js +190 -0
- package/dist/src/account/settingsUninstall.js +7 -0
- package/dist/src/account/share.js +11 -4
- package/dist/src/account/watcher.js +48 -6
- package/dist/src/agent/adapters.js +1 -1
- package/dist/src/agent/env.js +17 -9
- package/dist/src/agent/model-slots.js +32 -0
- package/dist/src/agent/providers.js +18 -1
- package/dist/src/agent/scripted.js +16 -2
- package/dist/src/agent/windows.js +35 -3
- package/dist/src/badge/action.js +41 -0
- package/dist/src/badge/check.js +60 -0
- package/dist/src/badge/collect.js +174 -0
- package/dist/src/badge/dates.js +29 -0
- package/dist/src/badge/drawing.js +3 -0
- package/dist/src/badge/fonts.generated.js +11 -0
- package/dist/src/badge/model.js +9 -0
- package/dist/src/badge/privacy.js +151 -0
- package/dist/src/badge/push.js +117 -0
- package/dist/src/badge/render.js +490 -0
- package/dist/src/badge/settings.js +43 -0
- package/dist/src/badge/stats.js +31 -0
- package/dist/src/badge/status.js +57 -0
- package/dist/src/badge/text.js +52 -0
- package/dist/src/badge/theme.js +54 -0
- package/dist/src/badge/translate.js +162 -0
- package/dist/src/builtin/control.js +21 -7
- package/dist/src/builtin/editor.js +52 -4
- package/dist/src/builtin/export-store.js +67 -0
- package/dist/src/builtin/export.js +202 -0
- package/dist/src/builtin/exporting.js +25 -0
- package/dist/src/builtin/model.js +2 -2
- package/dist/src/builtin/routes.js +17 -0
- package/dist/src/builtin/source.js +13 -12
- package/dist/src/builtin/store.js +25 -3
- package/dist/src/builtin/switch.js +77 -0
- package/dist/src/chain/answers.js +27 -0
- package/dist/src/chain/archive.js +0 -1
- package/dist/src/chain/checkreports.js +24 -0
- package/dist/src/chain/cleanup.js +1 -1
- package/dist/src/chain/dispatcher.js +53 -4
- package/dist/src/chain/fence.js +30 -0
- package/dist/src/chain/handover.js +6 -5
- package/dist/src/chain/launches.js +1 -1
- package/dist/src/chain/limitNotice.js +1 -1
- package/dist/src/chain/lists.js +33 -6
- package/dist/src/chain/maincheck.js +18 -8
- package/dist/src/chain/mainci.js +12 -8
- package/dist/src/chain/overage.js +7 -2
- package/dist/src/chain/places.js +1 -1
- package/dist/src/chain/prompts.js +50 -4
- package/dist/src/chain/relay.js +26 -11
- package/dist/src/chain/reviews.js +7 -3
- package/dist/src/chain/rules.js +40 -8
- package/dist/src/chain/start.js +20 -0
- package/dist/src/chain/store.js +11 -8
- package/dist/src/chain/unchanged.js +68 -5
- package/dist/src/claude/adapter.js +8 -7
- package/dist/src/claude/cli.js +11 -5
- package/dist/src/claude/sdk/host.js +2 -0
- package/dist/src/claude/tree.js +45 -14
- package/dist/src/cli-check/run.js +3 -3
- package/dist/src/cli-check/support.js +4 -4
- package/dist/src/cli.js +54 -17
- package/dist/src/codex/adapter.js +2 -0
- package/dist/src/codex/cli.js +10 -2
- package/dist/src/codex/protection.js +17 -11
- package/dist/src/codex/rollout.js +9 -2
- package/dist/src/config-form.js +36 -6
- package/dist/src/config-store.js +12 -4
- package/dist/src/config.js +27 -13
- package/dist/src/copilot/adapter.js +2 -0
- package/dist/src/copilot/cli.js +3 -2
- package/dist/src/copilot/home.js +1 -1
- package/dist/src/copilot/transcript.js +1 -2
- package/dist/src/demo/service.js +7 -1
- package/dist/src/diagnostics/stop.js +16 -0
- package/dist/src/env-file.js +4 -0
- package/dist/src/error-reason.js +10 -0
- package/dist/src/event-log/log.js +2 -1
- package/dist/src/event-log/page-events.js +9 -4
- package/dist/src/event-log/watch.js +4 -4
- package/dist/src/forgejo/adapter.js +1 -0
- package/dist/src/forgejo/api.js +16 -2
- package/dist/src/forgejo/editor.js +196 -0
- package/dist/src/forgejo/model.js +37 -4
- package/dist/src/forgejo/source.js +59 -9
- package/dist/src/git/clone-progress.js +168 -0
- package/dist/src/git/remote-run.js +162 -0
- package/dist/src/git/run.js +6 -2
- package/dist/src/git/setup.js +4 -5
- package/dist/src/git/slot.js +9 -7
- package/dist/src/git/worktree.js +13 -10
- package/dist/src/github/adapter.js +1 -0
- package/dist/src/github/editor.js +214 -0
- package/dist/src/github/edits.js +31 -0
- package/dist/src/github/model.js +10 -4
- package/dist/src/github/source.js +66 -15
- package/dist/src/gitlab/adapter.js +1 -0
- package/dist/src/gitlab/api.js +4 -2
- package/dist/src/gitlab/editor.js +248 -0
- package/dist/src/gitlab/model.js +43 -4
- package/dist/src/gitlab/source.js +113 -22
- package/dist/src/guard.js +26 -10
- package/dist/src/hotkeys.js +51 -0
- package/dist/src/huly/adapter.js +1 -0
- package/dist/src/huly/collab.js +15 -0
- package/dist/src/huly/editor.js +241 -0
- package/dist/src/huly/marks.js +48 -0
- package/dist/src/huly/model.js +22 -5
- package/dist/src/huly/source.js +111 -48
- package/dist/src/intake/github.js +10 -0
- package/dist/src/intake/intake.js +41 -1
- package/dist/src/intake/model.js +8 -3
- package/dist/src/jira/adapter.js +1 -0
- package/dist/src/jira/api.js +28 -7
- package/dist/src/jira/editor.js +243 -0
- package/dist/src/jira/model.js +14 -7
- package/dist/src/jira/source.js +38 -41
- package/dist/src/jobs/model.js +1 -0
- package/dist/src/jobs/runner.js +236 -0
- package/dist/src/limits/chatgpt.js +11 -0
- package/dist/src/limits/copilot.js +51 -18
- package/dist/src/limits/model.js +14 -5
- package/dist/src/limits/overage-session.js +2 -2
- package/dist/src/limits/overage.js +8 -5
- package/dist/src/limits/reset.js +7 -0
- package/dist/src/linear/adapter.js +1 -0
- package/dist/src/linear/editor.js +220 -0
- package/dist/src/linear/estimate.js +32 -0
- package/dist/src/linear/model.js +13 -1
- package/dist/src/linear/source.js +70 -16
- package/dist/src/main.js +53 -23
- package/dist/src/notice/en-advice.js +28 -0
- package/dist/src/notice/en-review.js +29 -0
- package/dist/src/notice/en-startup.js +21 -0
- package/dist/src/notice/en-values.js +47 -0
- package/dist/src/notice/en.js +127 -109
- package/dist/src/notice/notice.js +49 -6
- package/dist/src/npm-access.js +58 -0
- package/dist/src/opencode/adapter.js +2 -0
- package/dist/src/opencode/cli.js +6 -4
- package/dist/src/opencode/go.js +51 -0
- package/dist/src/opencode/home.js +34 -6
- package/dist/src/opencode/transcript.js +3 -4
- package/dist/src/opencode/usage.js +10 -4
- package/dist/src/packages/check.js +11 -5
- package/dist/src/packages/gateway.js +37 -6
- package/dist/src/packages/launch.js +1 -1
- package/dist/src/packages/model.js +61 -2
- package/dist/src/packages/npm.js +55 -6
- package/dist/src/packages/plugins.js +23 -2
- package/dist/src/packages/service.js +103 -16
- package/dist/src/packages/settings.js +13 -0
- package/dist/src/packages/store.js +1 -1
- package/dist/src/paths.js +32 -0
- package/dist/src/profiles/oauth-error.js +1 -9
- package/dist/src/profiles/oauth-response.js +2 -0
- package/dist/src/projects/add.js +23 -5
- package/dist/src/projects/check.js +66 -15
- package/dist/src/projects/creation.js +166 -0
- package/dist/src/projects/git-found.js +62 -0
- package/dist/src/projects/git-mode.js +116 -0
- package/dist/src/projects/own-folder.js +8 -0
- package/dist/src/projects/place.js +235 -0
- package/dist/src/projects/remote-branches.js +24 -0
- package/dist/src/projects/target-read.js +95 -0
- package/dist/src/projects/target.js +56 -0
- package/dist/src/review/note.js +58 -0
- package/dist/src/review/open.js +3 -3
- package/dist/src/review/wiring.js +6 -1
- package/dist/src/secrets/catalog.js +4 -1
- package/dist/src/server-control.js +1 -0
- package/dist/src/server-guard.js +4 -0
- package/dist/src/server-request.js +64 -7
- package/dist/src/server-response.js +3 -0
- package/dist/src/server-security.js +16 -0
- package/dist/src/server.js +87 -18
- package/dist/src/service/account-packages.js +116 -0
- package/dist/src/service/accounts.js +37 -97
- package/dist/src/service/badge-private.js +62 -0
- package/dist/src/service/badge.js +203 -0
- package/dist/src/service/chain-prompts.js +87 -0
- package/dist/src/service/chain.js +58 -96
- package/dist/src/service/cleanup.js +16 -7
- package/dist/src/service/cli-check.js +1 -1
- package/dist/src/service/closing.js +57 -0
- package/dist/src/service/demo.js +2 -1
- package/dist/src/service/hosting.js +148 -9
- package/dist/src/service/install-check.js +78 -0
- package/dist/src/service/lifecycle.js +4 -7
- package/dist/src/service/trackers.js +24 -1
- package/dist/src/service/vocabulary.js +17 -0
- package/dist/src/service.js +127 -10
- package/dist/src/sessions/agents.js +10 -2
- package/dist/src/sessions/approvals.js +1 -1
- package/dist/src/sessions/ask.js +13 -3
- package/dist/src/sessions/chat.js +2 -1
- package/dist/src/sessions/commandPrompt.js +13 -6
- package/dist/src/sessions/history.js +2 -0
- package/dist/src/sessions/launch.js +21 -25
- package/dist/src/sessions/lingering.js +25 -2
- package/dist/src/sessions/mail.js +7 -6
- package/dist/src/sessions/mailRelay.js +2 -2
- package/dist/src/sessions/mailbox.js +1 -1
- package/dist/src/sessions/monitor.js +31 -2
- package/dist/src/sessions/note.js +44 -19
- package/dist/src/sessions/permission.js +32 -10
- package/dist/src/sessions/protection.js +29 -7
- package/dist/src/sessions/runs-store.js +20 -0
- package/dist/src/sessions/runs.js +140 -0
- package/dist/src/sessions/transcript.js +58 -6
- package/dist/src/settings/registry.js +47 -23
- package/dist/src/setup.js +5 -0
- package/dist/src/state/settings.js +1 -0
- package/dist/src/stats/checkpoint.js +1 -1
- package/dist/src/stats/reader.js +9 -4
- package/dist/src/stats/rules-reader.js +2 -0
- package/dist/src/stats/steps-reader.js +5 -0
- package/dist/src/stats/tally-schema.js +1 -1
- package/dist/src/storage/backup-model.js +3 -0
- package/dist/src/storage/backup-schedule.js +197 -0
- package/dist/src/storage/backup-worker.js +9 -0
- package/dist/src/storage/backup.js +141 -0
- package/dist/src/storage/browser-hotkeys.js +25 -0
- package/dist/src/storage/context-windows.js +39 -0
- package/dist/src/storage/copy.js +39 -12
- package/dist/src/storage/database.js +177 -4
- package/dist/src/storage/left-folders.js +16 -0
- package/dist/src/storage/migrations.js +59 -1
- package/dist/src/storage/owner.js +10 -7
- package/dist/src/storage/schema.js +1 -1
- package/dist/src/storage/startup.js +25 -0
- package/dist/src/storage/state-files.js +1 -1
- package/dist/src/storage/vacuum.js +29 -0
- package/dist/src/taskmcp/args.js +51 -0
- package/dist/src/taskmcp/calls.js +549 -154
- package/dist/src/taskmcp/downloads.js +87 -0
- package/dist/src/taskmcp/files.js +58 -0
- package/dist/src/taskmcp/retries.js +57 -0
- package/dist/src/taskmcp/server.js +5 -1
- package/dist/src/taskmcp/tools.js +36 -7
- package/dist/src/taskmcp/vocabulary.js +75 -0
- package/dist/src/tools/panel.js +41 -8
- package/dist/src/tools/sessionSettings.js +2 -1
- package/dist/src/tools/settings.js +16 -3
- package/dist/src/tracker/card.js +10 -8
- package/dist/src/tracker/close.js +57 -0
- package/dist/src/tracker/closer.js +18 -15
- package/dist/src/tracker/control.js +11 -1
- package/dist/src/tracker/diagnostics.js +5 -2
- package/dist/src/tracker/editor.js +53 -0
- package/dist/src/tracker/export-target.js +30 -0
- package/dist/src/tracker/export.js +168 -0
- package/dist/src/tracker/link.js +91 -23
- package/dist/src/tracker/markers.js +7 -0
- package/dist/src/tracker/model.js +0 -10
- package/dist/src/tracker/parents.js +8 -0
- package/dist/src/tracker/questions.js +14 -0
- package/dist/src/tracker/readers.js +14 -0
- package/dist/src/tracker/source.js +1 -0
- package/dist/src/tracker/start.js +57 -5
- package/dist/src/tracker/templates.js +102 -0
- package/dist/src/updates/runner.js +1 -1
- package/dist/src/updates/settle.js +11 -3
- package/dist/src/updates/updater.js +2 -2
- package/dist/tally/src/collect.js +11 -5
- package/dist/tally/src/db-classify.js +46 -0
- package/dist/tally/src/db.js +14 -38
- package/dist/tally/src/migrations/13-normal-spans.sql +110 -0
- package/dist/tally/src/migrations/14-model-families.sql +25 -0
- package/dist/tally/src/migrations/15-task-moves.sql +32 -0
- package/dist/tally/src/migrations.js +1 -1
- package/dist/tally/src/task-moves.js +32 -0
- package/dist/web/assets/BadgeDialog-Dx2EERWr.js +1 -0
- package/dist/web/assets/BadgeDialog-W0giN4k2.css +1 -0
- package/dist/web/assets/{DescriptionEditor-D8PUeuQ6.js → DescriptionEditor-BL_6314d.js} +6 -6
- package/dist/web/assets/ProjectPackages-D-Hqs0sG.js +1 -0
- package/dist/web/assets/Select-B5xZpiCG.js +1 -0
- package/dist/web/assets/Select-CYemy5Na.css +1 -0
- package/dist/web/assets/TaskCard-B9EJ_Qa2.js +2 -0
- package/dist/web/assets/TaskCard-BV2lQojC.css +1 -0
- package/dist/web/assets/TranscriptWindow-BN6jSpev.css +1 -0
- package/dist/web/assets/TranscriptWindow-E8DxggYC.js +4 -0
- package/dist/web/assets/accountParts-c2gPSGKK.js +3 -0
- package/dist/web/assets/accountParts-tFRVownp.css +1 -0
- package/dist/web/assets/blocks-B03KxlgQ.js +12 -0
- package/dist/web/assets/blocks-Dx3DACiG.css +1 -0
- package/dist/web/assets/cardDrafts-Cb5dNpJ3.js +12 -0
- package/dist/web/assets/cardDrafts-izWnctoh.css +1 -0
- package/dist/web/assets/cardSide-63fNWHHv.css +1 -0
- package/dist/web/assets/cardSide-CIGvmTwG.js +2 -0
- package/dist/web/assets/feedLine-Buzox_AA.js +1 -0
- package/dist/web/assets/feedLine-CBjZXWwX.css +1 -0
- package/dist/web/assets/hooks-DdmIE6gF.js +1 -0
- package/dist/web/assets/index-CkYiatZt.css +1 -0
- package/dist/web/assets/index-DELgEMlH.js +25 -0
- package/dist/web/assets/lib-B8qNeB0X.css +1 -0
- package/dist/web/assets/lib-C1i2rKJZ.js +18 -0
- package/dist/web/assets/overview-B7iEgjQD.css +1 -0
- package/dist/web/assets/overview-D9PUjFeR.js +7 -0
- package/dist/web/assets/packageGroups-B34vA6-0.js +1 -0
- package/dist/web/assets/packages-Dld4uH9X.css +1 -0
- package/dist/web/assets/react-dom-vGPErQYp.js +1 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/rules-BVB-I2tg.js +1 -0
- package/dist/web/assets/rules-Bgil4ZBp.css +1 -0
- package/dist/web/assets/secret-CmK85pY6.js +1 -0
- package/dist/web/assets/secret-DldsC74x.css +1 -0
- package/dist/web/assets/useFileDrop-eZtIxL1H.js +1 -0
- package/dist/web/assets/useHeightGlide-BmtdsmN0.css +1 -0
- package/dist/web/assets/useHeightGlide-DQvvOoIL.js +3 -0
- package/dist/web/assets/useRowFocus-CwOoEmzD.js +1 -0
- package/dist/web/index.html +31 -20
- package/dist/web/theme.js +6 -0
- package/even-keel.config.example.json +3 -4
- package/package.json +4 -4
- package/plugins/agent-bridge/.claude-plugin/plugin.json +16 -0
- package/plugins/{checkpoint → agent-bridge}/README.md +20 -6
- package/plugins/agent-bridge/hooks/addressban.mjs +64 -0
- package/plugins/{checkpoint → agent-bridge}/hooks/checkpoint-mark.mjs +4 -3
- package/plugins/{checkpoint → agent-bridge}/hooks/evenkeel.mjs +38 -11
- package/plugins/agent-bridge/hooks/git-ban.mjs +31 -0
- package/plugins/agent-bridge/hooks/gitban.mjs +83 -0
- package/plugins/agent-bridge/hooks/handoff.mjs +20 -0
- package/plugins/{checkpoint → agent-bridge}/hooks/hooks.json +10 -0
- package/plugins/{checkpoint → agent-bridge}/hooks/mailbox.mjs +6 -3
- package/plugins/{checkpoint → agent-bridge}/hooks/merge-check.mjs +9 -3
- package/plugins/{checkpoint → agent-bridge}/hooks/merges.mjs +14 -1
- package/plugins/{checkpoint → agent-bridge}/hooks/nudges.mjs +11 -7
- package/plugins/{checkpoint/opencode/checkpoint.mjs → agent-bridge/opencode/agent-bridge.mjs} +23 -11
- package/plugins/forgejo/.claude-plugin/plugin.json +1 -1
- package/plugins/forgejo/skills/task/SKILL.md +2 -2
- package/plugins/github/.claude-plugin/plugin.json +1 -1
- package/plugins/github/README.md +1 -1
- package/plugins/github/skills/task/SKILL.md +2 -2
- package/plugins/gitlab/.claude-plugin/plugin.json +1 -1
- package/plugins/gitlab/skills/task/SKILL.md +2 -2
- package/plugins/huly/.claude-plugin/plugin.json +1 -1
- package/plugins/huly/skills/task/SKILL.md +4 -4
- package/plugins/jira/.claude-plugin/plugin.json +1 -1
- package/plugins/jira/skills/task/SKILL.md +3 -3
- package/plugins/linear/.claude-plugin/plugin.json +1 -1
- package/plugins/linear/README.md +1 -1
- package/plugins/linear/skills/task/SKILL.md +3 -3
- package/plugins/tally/.claude-plugin/plugin.json +1 -1
- package/plugins/tally/skills/session-audit/SKILL.md +5 -5
- package/plugins/tasks/.claude-plugin/plugin.json +2 -2
- package/plugins/tasks/README.md +25 -4
- package/plugins/tasks/hooks/calibration-context.mjs +45 -0
- package/plugins/tasks/hooks/calibration.mjs +92 -0
- package/plugins/tasks/hooks/check-service.mjs +15 -0
- package/plugins/tasks/hooks/hooks.json +28 -0
- package/plugins/tasks/hooks/service-check.mjs +34 -0
- package/plugins/tasks/hooks/show-calibration.mjs +19 -0
- package/plugins/tasks/opencode/tasks.mjs +28 -0
- package/plugins/tasks/skills/split/SKILL.md +2 -2
- package/plugins/tasks/skills/task/SKILL.md +19 -10
- package/service/install.sh +25 -2
- package/service/uninstall.ps1 +16 -0
- package/service/uninstall.sh +10 -0
- package/tally/tally.config.json +1 -0
- package/dist/web/assets/ConfirmDialog-CT1w8fds.css +0 -1
- package/dist/web/assets/ConfirmDialog-DtrqXMLY.js +0 -7
- package/dist/web/assets/Loader-D4ik19jr.css +0 -1
- package/dist/web/assets/Loader-mgoVDIvZ.js +0 -12
- package/dist/web/assets/ProjectPackages-DnCW8kXc.js +0 -1
- package/dist/web/assets/TaskCard-Bjnnsxah.js +0 -3
- package/dist/web/assets/TaskCard-f7aXQS6c.css +0 -1
- package/dist/web/assets/TranscriptWindow-B9zsSmIg.css +0 -1
- package/dist/web/assets/TranscriptWindow-BEAdgN2M.js +0 -4
- package/dist/web/assets/chatKeys-7ClMP73F.css +0 -1
- package/dist/web/assets/chatKeys-Doxn3auX.js +0 -1
- package/dist/web/assets/feedLine-qIhoKONX.js +0 -1
- package/dist/web/assets/index-ernY0hZ5.css +0 -1
- package/dist/web/assets/index-srs3Jx9s.js +0 -24
- package/dist/web/assets/lib-DZ3lmyI6.js +0 -18
- package/dist/web/assets/overview-B_Cnubfu.css +0 -1
- package/dist/web/assets/overview-hxpvjWJS.js +0 -1
- package/dist/web/assets/packageGroups-DMT_PhT3.css +0 -1
- package/dist/web/assets/packageGroups-DWLFjsUs.js +0 -8
- package/dist/web/assets/state-DZUHccAT.css +0 -1
- package/dist/web/assets/state-ky_dNYYi.js +0 -3
- package/dist/web/assets/useFileDrop-4efYr2eq.js +0 -1
- package/dist/web/assets/useModels-1WRBMBb2.css +0 -1
- package/dist/web/assets/useModels-C_U0wgab.js +0 -4
- package/dist/web/assets/useRowFocus-BjMFkowJ.js +0 -1
- package/dist/web/assets/useRowFocus-BsvvWNh2.css +0 -1
- package/plugins/checkpoint/.claude-plugin/plugin.json +0 -9
- package/plugins/checkpoint/hooks/handoff.mjs +0 -9
- /package/plugins/{checkpoint → agent-bridge}/hooks/context-checkpoint.mjs +0 -0
- /package/plugins/{checkpoint → agent-bridge}/hooks/permission.mjs +0 -0
- /package/plugins/{checkpoint → agent-bridge}/hooks/schema-hint.mjs +0 -0
- /package/plugins/{checkpoint → agent-bridge}/hooks/standard-gate.mjs +0 -0
- /package/plugins/{checkpoint → agent-bridge}/hooks/standards.mjs +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
|
|
3
3
|
"name": "even-keel",
|
|
4
|
-
"description": "Plugins for sessions run by Even Keel:
|
|
4
|
+
"description": "Plugins for sessions run by Even Keel: tracker tools and task skills, and the bridge between agent sessions and the service",
|
|
5
5
|
"owner": {
|
|
6
6
|
"name": "Even Keel"
|
|
7
7
|
},
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"name": "tasks",
|
|
47
|
-
"description": "Even Keel
|
|
47
|
+
"description": "Any tracker of an Even Keel project for sessions: its own tasks server with five tools — list, read, create in batches, update with description patches, comment — and skills to work a task and split it into subtasks",
|
|
48
48
|
"source": "./plugins/tasks",
|
|
49
49
|
"category": "productivity"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
"name": "
|
|
53
|
-
"description": "Context checkpoints: once the context
|
|
54
|
-
"source": "./plugins/
|
|
52
|
+
"name": "agent-bridge",
|
|
53
|
+
"description": "Bridge between agent sessions and Even Keel: context handoffs, chat messages mid-turn, permission questions, checks before merges, project standards, badge status and MCP schema hints. Context checkpoints for Even Keel chain sessions of Claude Code, Codex and OpenCode: once the context passes 200k tokens (and every 50k after, every 25k past 250k), the session is asked to write a handoff note and end its turn with `CHECKPOINT: <path>`, so that Even Keel continues the task in a fresh session instead of re-reading the whole context on every turn. A session that writes the note but forgets the line is sent back to add it. In a project without git, where every task shares one folder, the note is the task's own `.temp/handoff-<task>.md` instead of `.temp/handoff.md`. The context and the note come from Even Keel, which reads the transcripts of both agents, so a session it did not start is left alone. The first threshold is the project's calibrated one, and a task that has had three handoffs is asked only from 300k; on a small context window the late and hard thresholds come down to 85 % and 95 % of it. A project that turns handoffs by context off in Even Keel gets no nudge at all and is left to the agent's own compaction. Thresholds: CHECKPOINT_FIRST_TOKENS, CHECKPOINT_STEP_TOKENS, CHECKPOINT_LATE_TOKENS, CHECKPOINT_LATE_STEP_TOKENS, CHECKPOINT_HARD_TOKENS and CHECKPOINT_MAX_HANDOFFS. In a chain session of a project without a CI to judge its main branch, the merge of the task branch waits for the project's check commands from Even Keel and is blocked while they fail. A message the user writes from Even Keel's chat to a working session reaches it mid-turn: before or after its next tool call, at its stop (the turn goes on), or in place of a question it was about to ask. With the same call Even Keel may add a note of its own to a tool call's context: for a project that publishes a README badge, a request for one `status: …` line in the session's next message. A tool call Claude Code stops on a permission dialog for is asked on Even Keel's page too, and the user's \"Allow\" or \"Deny\" there answers the dialog without stopping the session. An MCP call Claude Code made before loading the tool's schema, whose numbers or lists went as strings and failed the server's validation, gets a hint in the context: load the schema with ToolSearch and repeat the call. A project's standards, set on Even Keel's page (a document of the repository and the files it guards): the first read of a guarded file brings the document into the context, the first edit of one before that is refused with the document, a compaction brings it again, and a standard that asks for it holds the merge (in PR mode, the PULL REQUEST mark) of a branch that changed its files until `.temp/shot/` has shots newer than the change and `.temp/<document>-check.md` answers each question of the document's section \"The check\". OpenCode sessions get the nudges and the chat's messages after each tool call, the standards, the merge check and the CHECKPOINT line from the plugin's OpenCode plugin (opencode/agent-bridge.mjs): a turn that wrote the note gets the line added to its last text instead of being sent back.",
|
|
54
|
+
"source": "./plugins/agent-bridge",
|
|
55
55
|
"category": "productivity"
|
|
56
56
|
},
|
|
57
57
|
{
|
package/.env.example
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copy to .env (ignored by git).
|
|
2
|
-
# The trackers' credentials are profiles: /settings ->
|
|
2
|
+
# The trackers' credentials are profiles: /settings -> Trackers and CI -> Add profile. Tracker variables found here
|
|
3
3
|
# on the first start become the default profile of their tracker, once; after that they are not read.
|
|
4
4
|
# HULY_URL=https://huly.example.com
|
|
5
5
|
# HULY_WORKSPACE=example
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
# The local MCP gateway chain sessions reach their packages' servers through (docs/packages.md); always on 127.0.0.1.
|
|
27
27
|
# EVEN_KEEL_MCP_PORT=4748
|
|
28
28
|
|
|
29
|
-
# The page's token for requests from other machines; required when EVEN_KEEL_HOST is not loopback (
|
|
29
|
+
# The page's token for requests from other machines; required when EVEN_KEEL_HOST is not loopback (docs/guide/setup.md).
|
|
30
30
|
# EVEN_KEEL_TOKEN=change-me-0123456789abcdef
|
|
31
31
|
|
|
32
32
|
# Folder with one Claude config folder per extra account; defaults to ~/.claude-accounts.
|
package/CHANGELOG.md
CHANGED
|
@@ -8,13 +8,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
8
8
|
|
|
9
9
|
### Changed
|
|
10
10
|
|
|
11
|
+
- **What a task runs on is set on its card, not by a tracker label.** A task's run — provider, model and effort — is kept by Even Keel: the card's **Runs on** picks it, and a session can set it through the tasks server's `run` field of `tasks_create` and `task_update`. The effort is new: Claude Code's `low` to `max` and Codex's `minimal` to `xhigh`; empty passes none. Labels `<Provider> | <model>` are no longer read. The update moves the run label of each open task into its run once, in the projects that had run labels on; the labels stay in the tracker. The setting `modelLabels` is removed.
|
|
12
|
+
- **OpenCode keeps a model for each provider it signs in to.** Switching OpenCode's account to one on another sign-in (ChatGPT, an Anthropic key, OpenRouter, Copilot, Go, the free models) and back no longer loses the model you set: the model field shows the one of the account's sign-in and says which it is, in the settings of Even Keel and of a project. In the config `models.opencode` becomes `models.opencode/<provider>`; the update moves yours by its model's prefix. On a task's card, picking another provider and back brings back the model you typed for it.
|
|
13
|
+
|
|
14
|
+
- **No label is kept out of the chain by default.** `chain.excludedLabels` starts empty and the built-in tracker no longer offers `Manual`: name the label you mark your own tasks with in the chain rules. An installation that relied on the default keeps `Manual` in its shared list after the update, so the same tasks stay out.
|
|
11
15
|
- **The main branch field offers the repository's branches, and saving another branch switches the main checkout to it**, in a project's settings and in the wizard that adds one: a branch the repository lacks is created from where the checkout stands, one only on a remote is taken from there, and the line under the field says which before you save. The wizard fills in the checkout's current branch and no longer refuses a branch the repository lacks. A checkout switched by hand is shown in the settings and on the chain's card, with buttons to make its branch the main one or to put the folder back, instead of only when a task fails to start.
|
|
12
16
|
|
|
17
|
+
### Security
|
|
18
|
+
|
|
19
|
+
- **A chain session's request to Even Keel's own address is refused.** Even Keel lets a request from its own machine through without the page's token, so a session under someone else's text could change Protection, answer a question for you or create a task in another project with a plain `curl`. The new Protection group **Requests to Even Keel's address**, on by default, makes the `agent-bridge` plugin (1.2.0) refuse a shell command that sends such a request, on every agent. It is a pattern, not isolation: a script the session wrote gets past it. Turn it off for a project whose tasks work with Even Keel's API.
|
|
20
|
+
- **The page takes a request only from its own origin, port included.** Before, the `Origin` check compared only the name, so a page on another port of an allowed name — a project's dev server on `localhost`, another service on your tailnet name — could post commands to Even Keel: start a chain, answer a session, add an MCP server. Now `Origin` must match the request's `Host` with its port, and a `POST` to `/api/` must be `Content-Type: application/json` (415 otherwise). A script posting to the API without that header has to add it.
|
|
21
|
+
- **An MCP server's whole dependency tree is pinned, and npm runs no install scripts.** A server started as `npx -y <package>@<range>` keeps its npm lock file next to its install, so two installs of one version run the same code; an update that changes a dependency says how many in a notice and lists them in the log. Install scripts of the package and its dependencies no longer run as the service's user: a package that needs them gets the **Install scripts** switch in its details. A server started any other way (`uvx`, `docker run`, `npx` without `-y`) shows "version not pinned" in its row. The new installs happen at a package's next update or check; one already installed keeps running as it was.
|
|
22
|
+
|
|
13
23
|
### Fixed
|
|
14
24
|
|
|
15
25
|
- **A project's lone `AGENTS.md` is no longer in a Claude session's context twice.** Claude Code reads the file by itself, so Even Keel stopped appending it to the system prompt; the same text reached every turn twice before.
|
|
16
26
|
- **A project's lone `AGENTS.md` reaches a Claude session again when a `CLAUDE.md` lies in a folder above the checkout**, such as `~/.claude/CLAUDE.md` for a checkout in your home folder. Claude Code skips the file then, so Even Keel appends it to the system prompt in that case only.
|
|
17
27
|
- The Forgejo plugin's `forgejo:task` skill loads again: its description is quoted, so the skill's frontmatter parses and chain sessions on Forgejo, Gitea and Codeberg projects get the skill (plugin 0.1.1). A test now parses the frontmatter of every bundled skill.
|
|
28
|
+
- **`npx even-keel` on macOS and Linux says what to do when npm cannot write its global folder**, as with Node from the nodejs.org installer, whose folder under `/usr/local` belongs to root: it installs nothing and prints the commands that move the folder into your home, also after an `EACCES` of npm itself. It refuses to run as root, since the service would then be installed for root.
|
|
29
|
+
|
|
30
|
+
## [0.2.4] - 2026-11-11
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- A project without a counted CI no longer takes main for green when the session merged without running its check. Main counts as green only when the check hook reports it passed on the merged tree (`checkpoint` plugin 0.14.1). A merge without that report, made by a session without the `checkpoint` package for one, is checked in the next task's folder before that task starts.
|
|
18
35
|
|
|
19
36
|
## [0.2.3] - 2026-11-07
|
|
20
37
|
|
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
</picture>
|
|
6
6
|
</h1>
|
|
7
7
|
|
|
8
|
+
<a href="https://github.com/NamerekT/even-keel/releases"><picture><source media="(prefers-color-scheme: light)" srcset="https://even-keel-badge.nykolai-tymchenko.workers.dev/even-keel.svg?theme=light"><img alt="Even Keel: what the chain is building now" src="https://even-keel-badge.nykolai-tymchenko.workers.dev/even-keel.svg?theme=dark"></picture></a>
|
|
9
|
+
|
|
8
10
|
**You write the tickets. It takes the night shift.** Even Keel takes the open tasks of a project from your tracker, in the order of their `blocks` links, and works through them one at a time with [Claude Code](https://docs.claude.com/en/docs/claude-code/overview), [Codex](https://github.com/openai/codex), [OpenCode](https://opencode.ai) or [GitHub Copilot](https://github.com/github/copilot-cli) while you do something else. It waits out a spent usage limit, hands a long session over to a fresh one and keeps going while you are away. Only what really needs you — a question, a decision — waits for you: on its page, in the tracker or on your phone.
|
|
9
11
|
|
|
10
12
|
**Already inside, so you don't glue five tools together:**
|
|
@@ -34,7 +36,7 @@ Even Keel wins in time, not in width: the agent keeps working while you are away
|
|
|
34
36
|
|
|
35
37
|
## What it does
|
|
36
38
|
|
|
37
|
-
- **A chain per project**, ordered by blockers first, then the order you drag on the page, then milestone and priority. A task
|
|
39
|
+
- **A chain per project**, ordered by blockers first, then the order you drag on the page, then milestone and priority. A task with a label you exclude stays yours.
|
|
38
40
|
- **A session per task**, in its own git worktree. It does the task and merges; Even Keel closes the task and starts the next.
|
|
39
41
|
- **Several trackers in one chain**, say the GitHub issues others file next to your private Huly project; or **several chains on one tracker project**, say fixes of a released version beside the next one.
|
|
40
42
|
- **Unattended mode** for nights: a task that needs your answer is left on its branch with the question, and the chain moves on.
|
|
@@ -49,11 +51,11 @@ Even Keel wins in time, not in width: the agent keeps working while you are away
|
|
|
49
51
|
| --- | --- | --- |
|
|
50
52
|
|  |  |  |
|
|
51
53
|
|
|
52
|
-
Every feature in full: [docs/guide
|
|
54
|
+
Every feature in full: [docs/guide](docs/guide/README.md), a page per area.
|
|
53
55
|
|
|
54
56
|
## Requirements
|
|
55
57
|
|
|
56
|
-
- **Node.js 24** or newer ([nodejs.org](https://nodejs.org/en/download); on Linux nvm needs no `sudo`).
|
|
58
|
+
- **Node.js 24** or newer ([nodejs.org](https://nodejs.org/en/download); on Linux nvm needs no `sudo`). On macOS the nodejs.org installer leaves npm's global folder to root: move it into your home first, with the [commands `npx even-keel` prints](docs/guide/setup.md#npms-global-folder-on-macos-and-linux), and never use `sudo`.
|
|
57
59
|
- **git** ([git-scm.com](https://git-scm.com/downloads)) with your name and e-mail set (`git config --global user.name` and `user.email`): sessions commit and merge under that name.
|
|
58
60
|
- **An agent and an account of it:** [Claude Code](https://docs.claude.com/en/docs/claude-code/setup), [Codex](https://github.com/openai/codex), [OpenCode](https://opencode.ai) (preview) or [GitHub Copilot CLI](https://github.com/github/copilot-cli) (preview), on a subscription or an API key; OpenCode also runs its free models. The setup can download the CLI for you.
|
|
59
61
|
- **A tracker:** a Huly workspace, GitHub, GitLab or Forgejo projects with Issues, a Linear workspace or a Jira Cloud site.
|
|
@@ -63,7 +65,7 @@ Every feature in full: [docs/guide/features.md](docs/guide/features.md).
|
|
|
63
65
|
|
|
64
66
|
- **Even Keel depends on undocumented behaviour of the agents' CLIs**, none of it a public API. Last checked against **Claude Code 2.1.319**, **codex-cli 0.167.0**, **OpenCode 1.19.5** and **Copilot CLI 1.0.106**; the page warns when yours is another version and can run sessions on the checked one instead. A CLI update may break a part of Even Keel until it is adapted — please open an issue when it does. Details: [setup](docs/guide/setup.md#the-clis-it-depends-on).
|
|
65
67
|
- **Your subscription, the providers' terms.** A project runs on one account per provider, and a spent limit is waited out, never got round by switching accounts. Even Keel does not share, pool or resell access. Each agent's sessions fall under its provider's terms, listed below.
|
|
66
|
-
- **Sessions don't ask you before each tool call** (Claude in auto mode, Codex with `--approve-for-me` or, if you choose, with no sandbox). Protection refuses destructive commands; set up any other permissions and hooks in your agents' settings before you start a chain.
|
|
68
|
+
- **Sessions don't ask you before each tool call** (Claude in auto mode, Codex with `--approve-for-me` or, if you choose, with no sandbox). Protection refuses destructive commands; set up any other permissions and hooks in your agents' settings before you start a chain. Whoever writes a task's text steers its session: read [whose text a session reads and what it may do](docs/guide/security.md) before a chain runs on a public repository.
|
|
67
69
|
- **Your sign-in stays with the CLIs.** Even Keel reads only expiry dates, the e-mail and the plan; tokens are never copied or sent anywhere. An API key you add goes only to its own provider.
|
|
68
70
|
- **Some behaviour has never been checked live**, such as long chains on Codex, OpenCode and Copilot. Read [What has not been verified](docs/unverified.md) before relying on it; every live check is logged in [What has been verified](docs/verified.md).
|
|
69
71
|
|
|
@@ -8,10 +8,11 @@ export function headerLevels(ctx) {
|
|
|
8
8
|
const current = ctx.tasks.find((task) => task.id === ctx.current?.task && open(task));
|
|
9
9
|
const next = nextTask(ctx.tasks, ctx.order.filter((id) => ctx.tasks.some((task) => task.id === id && open(task))), ctx.holding ?? []);
|
|
10
10
|
const task = current ?? ctx.tasks.find((each) => each.id === next);
|
|
11
|
-
const
|
|
11
|
+
const run = task === undefined ? undefined : ctx.runOf(task.id);
|
|
12
|
+
const choice = runChoice(run, ctx.project, ctx.hasAccount);
|
|
12
13
|
const pinned = current && ctx.current?.sessionId ? ctx.sessionAccount(ctx.current.sessionId) : undefined;
|
|
13
14
|
const account = pinned ?? choice.account;
|
|
14
|
-
const labelled =
|
|
15
|
+
const labelled = (run?.provider ?? null) !== null && choice.fallback === null;
|
|
15
16
|
const levels = [];
|
|
16
17
|
if (task && (labelled || account !== project))
|
|
17
18
|
levels.push({ account, source: 'task', task: task.id });
|
|
@@ -6,7 +6,7 @@ import { CODEX } from '../codex/name.js';
|
|
|
6
6
|
import { tokenOf, writeToken } from '../copilot/home.js';
|
|
7
7
|
import { COPILOT } from '../copilot/name.js';
|
|
8
8
|
import { fail } from '../notice/notice.js';
|
|
9
|
-
import { keyOf, keyVendor, replaceKey, writeKey } from '../opencode/home.js';
|
|
9
|
+
import { consoleKey, readAuth, keyOf, keyVendor, replaceKey, writeKey } from '../opencode/home.js';
|
|
10
10
|
import { OPENCODE } from '../opencode/name.js';
|
|
11
11
|
import { samePath } from '../paths.js';
|
|
12
12
|
import { shortLivedProfile } from './aws.js';
|
|
@@ -170,7 +170,9 @@ export class AccountHomes {
|
|
|
170
170
|
* `codex login --with-api-key` writes it (BTN-177). OpenCode's: an `auth.json` under the provider the key is of (BTN-214).
|
|
171
171
|
* Copilot's: the GitHub token in `even-keel.json` (BTN-215).
|
|
172
172
|
*/
|
|
173
|
-
addApiKey(name, key, agent = CLAUDE) {
|
|
173
|
+
addApiKey(name, key, agent = CLAUDE, provider) {
|
|
174
|
+
if (provider !== undefined && (agent !== OPENCODE || provider !== 'opencode-go'))
|
|
175
|
+
throw fail('request.required', { field: 'provider' });
|
|
174
176
|
const value = assertApiKey(key, agent);
|
|
175
177
|
const home = this.home(agent, folderName(name.trim() === '' ? (agent === COPILOT ? 'github' : 'api') : name, this.taken()));
|
|
176
178
|
mkdirSync(home.dir, { recursive: true });
|
|
@@ -180,7 +182,7 @@ export class AccountHomes {
|
|
|
180
182
|
return home;
|
|
181
183
|
}
|
|
182
184
|
if (agent === OPENCODE) {
|
|
183
|
-
writeKey(home.dir, value);
|
|
185
|
+
writeKey(home.dir, value, provider);
|
|
184
186
|
return home;
|
|
185
187
|
}
|
|
186
188
|
if (agent === CODEX) {
|
|
@@ -219,6 +221,8 @@ export class AccountHomes {
|
|
|
219
221
|
const held = home.global ? null : this.apiKeyOf(home);
|
|
220
222
|
if (held === null)
|
|
221
223
|
throw fail('account.keyNotHeld', { agent: home.agent });
|
|
224
|
+
if (home.agent === OPENCODE && consoleKey(readAuth(home.dir)) !== null)
|
|
225
|
+
return value;
|
|
222
226
|
const provider = keyProvider(home.agent, held);
|
|
223
227
|
if (keyProvider(home.agent, value) !== provider)
|
|
224
228
|
throw fail('account.keyOtherProvider', { provider });
|
|
@@ -267,11 +271,16 @@ export class AccountHomes {
|
|
|
267
271
|
return null;
|
|
268
272
|
}
|
|
269
273
|
}
|
|
274
|
+
settings = null;
|
|
275
|
+
/** What the transfer wrote into each folder's `settings.json` and each account's own layer (BTN-901). */
|
|
276
|
+
useSettings(settings) {
|
|
277
|
+
this.settings = settings;
|
|
278
|
+
}
|
|
270
279
|
/** Claude's shared configuration into an account folder; Codex reads its own `config.toml`. */
|
|
271
280
|
share(home) {
|
|
272
281
|
if (home.global || home.agent !== CLAUDE)
|
|
273
282
|
return false;
|
|
274
|
-
return shareConfig({ dir: this.global.dir, config: this.configFile(this.global) }, home.dir);
|
|
283
|
+
return shareConfig({ dir: this.global.dir, config: this.configFile(this.global) }, home.dir, console.warn, this.settings?.planner(home.key));
|
|
275
284
|
}
|
|
276
285
|
/** The `.claude.json` the CLI reads with this folder. */
|
|
277
286
|
configFile(home) {
|
|
@@ -287,6 +296,7 @@ export class AccountHomes {
|
|
|
287
296
|
return;
|
|
288
297
|
}
|
|
289
298
|
rmSync(home.dir, { recursive: true, force: true, maxRetries: 3 });
|
|
299
|
+
this.settings?.forget(home.key);
|
|
290
300
|
this.forget();
|
|
291
301
|
}
|
|
292
302
|
home(agent, name) {
|
|
@@ -185,13 +185,19 @@ export function launchBlock(view, key = view.active) {
|
|
|
185
185
|
return freeHeld(view.accounts, key);
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
|
-
*
|
|
189
|
-
* free accounts to get round the limits, so only the first of them works (BTN-176).
|
|
188
|
+
* Free ChatGPT folders past the first identity in folder order. That identity may have one folder per agent.
|
|
190
189
|
*/
|
|
191
190
|
export function extraFree(accounts) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
const [first, ...rest] = freeChatGpt(accounts);
|
|
192
|
+
if (first === undefined)
|
|
193
|
+
return [];
|
|
194
|
+
const agents = new Set([first.agent]);
|
|
195
|
+
return rest.filter(entry => {
|
|
196
|
+
if (!sameEmail(first.status, entry.status) || agents.has(entry.agent))
|
|
197
|
+
return true;
|
|
198
|
+
agents.add(entry.agent);
|
|
199
|
+
return false;
|
|
200
|
+
}).map(entry => entry.key);
|
|
195
201
|
}
|
|
196
202
|
/**
|
|
197
203
|
* Whether an account of the agent just added takes the shared pool's entry for it: it does while that entry names no
|
|
@@ -211,30 +217,39 @@ export function missingNotice(agent) {
|
|
|
211
217
|
return notice(agent === CODEX ? 'login.codexMissing' : 'login.claudeMissing', {});
|
|
212
218
|
}
|
|
213
219
|
/**
|
|
214
|
-
* Why a
|
|
215
|
-
* is that very account again.
|
|
220
|
+
* Why a free ChatGPT sign-in is not added. The same identity in another agent shares its allowance.
|
|
216
221
|
*/
|
|
217
222
|
export function secondFreeProblem(accounts, agent, status) {
|
|
218
|
-
if (
|
|
223
|
+
if (!isFree(agent, status))
|
|
219
224
|
return undefined;
|
|
220
|
-
const
|
|
225
|
+
const free = freeChatGpt(accounts);
|
|
226
|
+
const first = free[0];
|
|
221
227
|
if (first === undefined)
|
|
222
228
|
return undefined;
|
|
223
229
|
const account = first.status?.email ?? first.key;
|
|
224
|
-
const same =
|
|
230
|
+
const same = sameEmail(first.status, status);
|
|
231
|
+
if (same && !free.some(entry => entry.agent === agent && sameEmail(entry.status, status)))
|
|
232
|
+
return undefined;
|
|
225
233
|
return notice(same ? 'account.sameFree' : 'account.secondFree', { account });
|
|
226
234
|
}
|
|
227
235
|
function freeHeld(accounts, key) {
|
|
228
|
-
const
|
|
229
|
-
if (first === undefined || !
|
|
236
|
+
const first = freeChatGpt(accounts)[0];
|
|
237
|
+
if (first === undefined || !extraFree(accounts).includes(key))
|
|
230
238
|
return undefined;
|
|
231
239
|
return notice('account.extraFree', { account: first.status?.email ?? first.key });
|
|
232
240
|
}
|
|
233
|
-
function
|
|
234
|
-
return accounts.filter((entry) => entry.agent
|
|
241
|
+
function freeChatGpt(accounts) {
|
|
242
|
+
return accounts.filter((entry) => isFree(entry.agent, entry.status));
|
|
243
|
+
}
|
|
244
|
+
function isFree(agent, status) {
|
|
245
|
+
if (status?.loggedIn !== true)
|
|
246
|
+
return false;
|
|
247
|
+
if (agent === CODEX)
|
|
248
|
+
return status.subscriptionType === FREE_PLAN && !isApiKey(status);
|
|
249
|
+
return agent === OPENCODE && status.authMethod === 'oauth' && status.chatgptPlan === FREE_PLAN;
|
|
235
250
|
}
|
|
236
|
-
function
|
|
237
|
-
return
|
|
251
|
+
function sameEmail(left, right) {
|
|
252
|
+
return !!left.email && !!right.email && left.email.toLowerCase() === right.email.toLowerCase();
|
|
238
253
|
}
|
|
239
254
|
function stringOf(value) {
|
|
240
255
|
return typeof value === 'string' && value !== '' ? value : null;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { readFileSync, readdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { pathsOf, samePath } from '../paths.js';
|
|
5
|
+
import { SETTINGS_GUARD_MARK as MARK, stripSettingsGuard } from './settingsGuardStrip.js';
|
|
6
|
+
export { stripSettingsGuard };
|
|
7
|
+
function object(value) {
|
|
8
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : {};
|
|
9
|
+
}
|
|
10
|
+
export function withSettingsGuard(settings, config) {
|
|
11
|
+
const clean = stripSettingsGuard(settings);
|
|
12
|
+
const hooks = object(clean.hooks);
|
|
13
|
+
const script = fileURLToPath(new URL(import.meta.url.endsWith('.ts') ? '../../dist/src/account/settingsHook.js' : './settingsHook.js', import.meta.url));
|
|
14
|
+
const data = Buffer.from(JSON.stringify(config)).toString('base64url');
|
|
15
|
+
return { ...clean, hooks: { ...hooks, PreToolUse: [
|
|
16
|
+
...(Array.isArray(hooks.PreToolUse) ? hooks.PreToolUse : []),
|
|
17
|
+
{ matcher: 'Edit|Write|MultiEdit', hooks: [{ type: 'command', command: process.execPath,
|
|
18
|
+
args: [script, MARK, data], timeout: 5, onFailure: 'continue' }] },
|
|
19
|
+
] } };
|
|
20
|
+
}
|
|
21
|
+
export function removeSettingsGuard(dir) {
|
|
22
|
+
const file = join(dir, 'settings.json');
|
|
23
|
+
try {
|
|
24
|
+
const settings = JSON.parse(readFileSync(file, 'utf8'));
|
|
25
|
+
const clean = stripSettingsGuard(settings);
|
|
26
|
+
if (clean !== settings)
|
|
27
|
+
writeFileSync(file, JSON.stringify(clean, null, 2));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error.code === 'ENOENT')
|
|
31
|
+
return;
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Uninstall keeps account folders and user hooks; only managed Claude folders are visited. */
|
|
36
|
+
export function removeAccountSettingsGuards(accountsDir, globalDir) {
|
|
37
|
+
let entries;
|
|
38
|
+
try {
|
|
39
|
+
entries = readdirSync(accountsDir, { withFileTypes: true });
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (error.code === 'ENOENT')
|
|
43
|
+
return;
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
for (const entry of entries) {
|
|
47
|
+
const dir = join(accountsDir, entry.name);
|
|
48
|
+
if (!entry.isDirectory() || samePath(dir, globalDir))
|
|
49
|
+
continue;
|
|
50
|
+
try {
|
|
51
|
+
removeSettingsGuard(dir);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.warn(`account settings guard: could not remove hook from ${dir}: ${String(error)}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** No HTTP call for ordinary edits. The service confirms that a candidate belongs to a listed Claude account. */
|
|
59
|
+
export async function guardSettingsEdit(input, config, ask = async () => {
|
|
60
|
+
const response = await fetch(`${config.url}/api/state`, { signal: AbortSignal.timeout(1500), redirect: 'error' });
|
|
61
|
+
return response.ok ? response.json() : null;
|
|
62
|
+
}, platform = process.platform) {
|
|
63
|
+
try {
|
|
64
|
+
const event = object(input);
|
|
65
|
+
if (!['Edit', 'Write', 'MultiEdit'].includes(String(event.tool_name)))
|
|
66
|
+
return null;
|
|
67
|
+
const tool = object(event.tool_input);
|
|
68
|
+
const paths = pathsOf(platform);
|
|
69
|
+
const targets = [tool.file_path, ...(Array.isArray(tool.edits) ? tool.edits.map((edit) => object(edit).file_path) : [])]
|
|
70
|
+
.filter((path) => typeof path === 'string' && path !== '')
|
|
71
|
+
.map((path) => paths.resolve(typeof event.cwd === 'string' ? event.cwd : process.cwd(), path))
|
|
72
|
+
.filter((path) => platform === 'linux' ? paths.basename(path) === 'settings.json' : paths.basename(path).toLowerCase() === 'settings.json')
|
|
73
|
+
.filter((path) => samePath(paths.dirname(paths.dirname(path)), config.accountsDir, platform)
|
|
74
|
+
&& !samePath(paths.dirname(path), config.globalDir, platform)
|
|
75
|
+
&& samePath(path, paths.join(paths.dirname(path), 'settings.json'), platform));
|
|
76
|
+
if (targets.length === 0)
|
|
77
|
+
return null;
|
|
78
|
+
const accounts = object(object(await ask()).account).accounts;
|
|
79
|
+
if (!Array.isArray(accounts))
|
|
80
|
+
return null;
|
|
81
|
+
const managed = accounts.some((value) => {
|
|
82
|
+
const account = object(value);
|
|
83
|
+
return account.agent === 'claude' && account.global === false && typeof account.key === 'string'
|
|
84
|
+
&& paths.basename(account.key) === account.key
|
|
85
|
+
&& targets.some((path) => samePath(path, paths.join(config.accountsDir, account.key, 'settings.json'), platform));
|
|
86
|
+
});
|
|
87
|
+
return managed ? 'Even Keel manages this account folder’s settings.json. Edit shared settings in ~/.claude/settings.json; Even Keel transfers them to all Claude accounts before launch. For account-only settings, use Accounts in Even Keel: resolve a settings change with “Keep for this account only”.' : null;
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const SETTINGS_GUARD_MARK = '--even-keel-account-settings';
|
|
2
|
+
function object(value) {
|
|
3
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : {};
|
|
4
|
+
}
|
|
5
|
+
/** Removes only Even Keel's command, even when somebody put it beside a user's command in one group. */
|
|
6
|
+
export function stripSettingsGuard(settings) {
|
|
7
|
+
const hooks = { ...object(settings.hooks) };
|
|
8
|
+
let changed = false;
|
|
9
|
+
for (const [event, groups] of Object.entries(hooks)) {
|
|
10
|
+
if (!Array.isArray(groups))
|
|
11
|
+
continue;
|
|
12
|
+
const kept = groups.flatMap((group) => {
|
|
13
|
+
const entry = object(group);
|
|
14
|
+
if (!Array.isArray(entry.hooks))
|
|
15
|
+
return [group];
|
|
16
|
+
const commands = entry.hooks.filter((hook) => {
|
|
17
|
+
const command = object(hook).command;
|
|
18
|
+
const args = object(hook).args;
|
|
19
|
+
return !(typeof command === 'string' && command.includes(` ${SETTINGS_GUARD_MARK} `))
|
|
20
|
+
&& !(Array.isArray(args) && args.includes(SETTINGS_GUARD_MARK));
|
|
21
|
+
});
|
|
22
|
+
if (commands.length === entry.hooks.length)
|
|
23
|
+
return [group];
|
|
24
|
+
changed = true;
|
|
25
|
+
return commands.length === 0 ? [] : [{ ...entry, hooks: commands }];
|
|
26
|
+
});
|
|
27
|
+
if (kept.length > 0 || groups.length === 0)
|
|
28
|
+
hooks[event] = kept;
|
|
29
|
+
else
|
|
30
|
+
delete hooks[event];
|
|
31
|
+
}
|
|
32
|
+
if (!changed)
|
|
33
|
+
return settings;
|
|
34
|
+
const { hooks: _, ...rest } = settings;
|
|
35
|
+
return Object.keys(hooks).length === 0 ? rest : { ...rest, hooks };
|
|
36
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { guardSettingsEdit } from './settingsGuard.js';
|
|
3
|
+
try {
|
|
4
|
+
const index = process.argv.indexOf('--even-keel-account-settings');
|
|
5
|
+
const config = JSON.parse(Buffer.from(process.argv[index + 1], 'base64url').toString('utf8'));
|
|
6
|
+
const reason = await guardSettingsEdit(JSON.parse(readFileSync(0, 'utf8')), config);
|
|
7
|
+
if (reason !== null) {
|
|
8
|
+
process.stdout.write(JSON.stringify({ hookSpecificOutput: {
|
|
9
|
+
hookEventName: 'PreToolUse', permissionDecision: 'deny', permissionDecisionReason: reason,
|
|
10
|
+
} }));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// An unavailable service or malformed hook input must not hold an unrelated edit.
|
|
15
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fail } from '../notice/notice.js';
|
|
4
|
+
import { isCloudVariable } from './cloud.js';
|
|
5
|
+
import { API_KEY_VARIABLE, mergeSettings } from './share.js';
|
|
6
|
+
import { stripSettingsGuard } from './settingsGuard.js';
|
|
7
|
+
export const EDIT_CHOICES = ['share', 'own', 'discard'];
|
|
8
|
+
/**
|
|
9
|
+
* Keys the CLI writes into `settings.json` with no one asking for a setting: `claude install` and the update channel's
|
|
10
|
+
* switch. Read in the 2.1.319 binary; the startup migrations of `model` and `env` were seen there too, but a person
|
|
11
|
+
* writes those keys as well, so they stay watched (`docs/unverified/accounts.md`).
|
|
12
|
+
*/
|
|
13
|
+
const SILENT_KEYS = new Set(['autoUpdatesChannel', 'minimumVersion']);
|
|
14
|
+
/** The folder owns these whatever the global settings say (`mergeSettings`), so a change of them is no edit. */
|
|
15
|
+
const FOLDER_KEYS = new Set(['apiKeyHelper']);
|
|
16
|
+
function isOwnVariable(name) {
|
|
17
|
+
return name === API_KEY_VARIABLE || isCloudVariable(name);
|
|
18
|
+
}
|
|
19
|
+
function sharedEnv(value) {
|
|
20
|
+
return Object.fromEntries(Object.entries(objectOf(value)).filter(([name]) => !isOwnVariable(name)));
|
|
21
|
+
}
|
|
22
|
+
function ownVariables(value) {
|
|
23
|
+
return Object.fromEntries(Object.entries(objectOf(value)).filter(([name]) => isOwnVariable(name)));
|
|
24
|
+
}
|
|
25
|
+
function comparable(key, value) {
|
|
26
|
+
if (value === undefined)
|
|
27
|
+
return undefined;
|
|
28
|
+
if (key === 'hooks') {
|
|
29
|
+
const hooks = Object.fromEntries(Object.entries(objectOf(value)).filter(([, groups]) => !Array.isArray(groups) || groups.length > 0));
|
|
30
|
+
return Object.keys(hooks).length === 0 ? undefined : JSON.stringify(hooks);
|
|
31
|
+
}
|
|
32
|
+
return JSON.stringify(key === 'env' ? sharedEnv(value) : value);
|
|
33
|
+
}
|
|
34
|
+
/** The top-level keys of the folder's file whose value moved away from what the last transfer wrote there. */
|
|
35
|
+
export function editedKeys(folder, written) {
|
|
36
|
+
folder = stripSettingsGuard(folder);
|
|
37
|
+
written = stripSettingsGuard(written);
|
|
38
|
+
const keys = new Set([...Object.keys(folder), ...Object.keys(written)]);
|
|
39
|
+
return [...keys].filter((key) => !SILENT_KEYS.has(key) && !FOLDER_KEYS.has(key) && comparable(key, folder[key]) !== comparable(key, written[key])).sort();
|
|
40
|
+
}
|
|
41
|
+
/** The transfer of `settings.json` with the account's layer on top and the folder's own edits kept (`docs/accounts.md`). */
|
|
42
|
+
export function planSettings(global, folder, record, discard = new Set()) {
|
|
43
|
+
const file = mergeSettings(global, folder);
|
|
44
|
+
for (const [key, value] of Object.entries(record?.own ?? {})) {
|
|
45
|
+
if (value === null)
|
|
46
|
+
delete file[key];
|
|
47
|
+
else
|
|
48
|
+
file[key] = key === 'env' ? { ...objectOf(value), ...ownVariables(folder?.env) } : value;
|
|
49
|
+
}
|
|
50
|
+
const written = { ...file };
|
|
51
|
+
// An edit the transfer would write anyway — made shared, kept as the account's own — is resolved.
|
|
52
|
+
const edits = record === undefined || folder === undefined ? [] : editedKeys(folder, record.written)
|
|
53
|
+
.filter((key) => !discard.has(key) && comparable(key, folder[key]) !== comparable(key, file[key]));
|
|
54
|
+
for (const key of edits) {
|
|
55
|
+
setOrDelete(file, key, folder?.[key]);
|
|
56
|
+
setOrDelete(written, key, record?.written[key]);
|
|
57
|
+
}
|
|
58
|
+
return { file, written, edits };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The records of every account folder, held in memory and written behind (`save`): the transfer is synchronous. Reads
|
|
62
|
+
* the folder's file on each `edits`, so the page shows an edit as soon as it is made, not at the next launch.
|
|
63
|
+
*/
|
|
64
|
+
export class AccountSettings {
|
|
65
|
+
records;
|
|
66
|
+
globalDir;
|
|
67
|
+
save;
|
|
68
|
+
discards = new Map();
|
|
69
|
+
seen = new Map();
|
|
70
|
+
version = 0;
|
|
71
|
+
constructor(records, globalDir, save) {
|
|
72
|
+
this.records = records;
|
|
73
|
+
this.globalDir = globalDir;
|
|
74
|
+
this.save = save;
|
|
75
|
+
}
|
|
76
|
+
/** The `settings.json` part of `shareConfig` for the folder: remembers what it wrote and uses up a discard. */
|
|
77
|
+
planner(account) {
|
|
78
|
+
return (global, folder) => {
|
|
79
|
+
const discard = this.discards.get(account) ?? new Set();
|
|
80
|
+
const record = this.records.get(account);
|
|
81
|
+
const plan = planSettings(global, folder, record, discard);
|
|
82
|
+
this.discards.delete(account);
|
|
83
|
+
const next = { written: plan.written, own: record?.own ?? {} };
|
|
84
|
+
if (record === undefined || JSON.stringify(record) !== JSON.stringify(next))
|
|
85
|
+
this.keep(account, next);
|
|
86
|
+
return plan.file;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** The keys changed in the folder since the last transfer; none before the first one. */
|
|
90
|
+
edits(home) {
|
|
91
|
+
const record = this.records.get(home.key);
|
|
92
|
+
if (record === undefined)
|
|
93
|
+
return [];
|
|
94
|
+
const file = join(home.dir, 'settings.json');
|
|
95
|
+
let stamp;
|
|
96
|
+
try {
|
|
97
|
+
const stat = statSync(file);
|
|
98
|
+
stamp = `${this.version}:${stat.mtimeMs}:${stat.size}`;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
const cached = this.seen.get(home.key);
|
|
104
|
+
if (cached?.stamp === stamp)
|
|
105
|
+
return cached.edits;
|
|
106
|
+
const folder = readJson(file);
|
|
107
|
+
const discard = this.discards.get(home.key);
|
|
108
|
+
const edits = folder === undefined ? [] : editedKeys(folder, record.written).filter((key) => discard?.has(key) !== true);
|
|
109
|
+
this.seen.set(home.key, { stamp, edits });
|
|
110
|
+
return edits;
|
|
111
|
+
}
|
|
112
|
+
/** The keys of the account's own layer. */
|
|
113
|
+
own(account) {
|
|
114
|
+
return Object.keys(this.records.get(account)?.own ?? {}).sort();
|
|
115
|
+
}
|
|
116
|
+
/** Takes effect at the next transfer into the folder, which the caller starts. */
|
|
117
|
+
resolve(home, key, choice) {
|
|
118
|
+
const record = this.records.get(home.key);
|
|
119
|
+
if (record === undefined || !this.edits(home).includes(key))
|
|
120
|
+
throw fail('account.settingsNoEdit', { account: home.key, key });
|
|
121
|
+
const value = stripSettingsGuard(readJson(join(home.dir, 'settings.json')) ?? {})[key];
|
|
122
|
+
if (choice === 'discard') {
|
|
123
|
+
this.discards.set(home.key, new Set([...(this.discards.get(home.key) ?? []), key]));
|
|
124
|
+
this.version++;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (choice === 'own') {
|
|
128
|
+
this.keep(home.key, { ...record, own: { ...record.own, [key]: value === undefined ? null : key === 'env' ? sharedEnv(value) : value } });
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const file = join(this.globalDir, 'settings.json');
|
|
132
|
+
const global = readJson(file) ?? {};
|
|
133
|
+
setOrDelete(global, key, key === 'env' && value !== undefined ? { ...sharedEnv(value), ...ownVariables(global.env) } : value);
|
|
134
|
+
writeFileSync(file, JSON.stringify(global, null, 2));
|
|
135
|
+
this.version++;
|
|
136
|
+
}
|
|
137
|
+
/** Takes effect at the next transfer into the folder, which the caller starts. */
|
|
138
|
+
dropOwn(home, key) {
|
|
139
|
+
const record = this.records.get(home.key);
|
|
140
|
+
if (record === undefined || !(key in record.own))
|
|
141
|
+
throw fail('account.settingsNoOwn', { account: home.key, key });
|
|
142
|
+
const { [key]: _, ...own } = record.own;
|
|
143
|
+
this.keep(home.key, { ...record, own });
|
|
144
|
+
}
|
|
145
|
+
forget(account) {
|
|
146
|
+
this.discards.delete(account);
|
|
147
|
+
this.seen.delete(account);
|
|
148
|
+
if (!this.records.delete(account))
|
|
149
|
+
return;
|
|
150
|
+
this.version++;
|
|
151
|
+
this.save(account, null);
|
|
152
|
+
}
|
|
153
|
+
keep(account, record) {
|
|
154
|
+
this.records.set(account, record);
|
|
155
|
+
this.version++;
|
|
156
|
+
this.save(account, record);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/** Table `account_settings` (`docs/storage.md`). */
|
|
160
|
+
export async function loadAccountSettings(db) {
|
|
161
|
+
const { rows } = await db.query('select account, written, own from account_settings order by account');
|
|
162
|
+
return new Map(rows.map((row) => [row.account, { written: objectOf(JSON.parse(row.written)), own: objectOf(JSON.parse(row.own)) }]));
|
|
163
|
+
}
|
|
164
|
+
/** Starts its write at the call: see `Writes`. */
|
|
165
|
+
export async function saveAccountSettings(db, account, record, at) {
|
|
166
|
+
if (record === null) {
|
|
167
|
+
await db.query('delete from account_settings where account = $1', [account]);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
await db.query(`insert into account_settings (account, written, own, saved_at) values ($1, $2, $3, $4)
|
|
171
|
+
on conflict (account) do update set written = excluded.written, own = excluded.own, saved_at = excluded.saved_at`, [account, JSON.stringify(record.written), JSON.stringify(record.own), at.toISOString()]);
|
|
172
|
+
}
|
|
173
|
+
function setOrDelete(target, key, value) {
|
|
174
|
+
if (value === undefined)
|
|
175
|
+
delete target[key];
|
|
176
|
+
else
|
|
177
|
+
target[key] = value;
|
|
178
|
+
}
|
|
179
|
+
function readJson(file) {
|
|
180
|
+
try {
|
|
181
|
+
const value = JSON.parse(readFileSync(file, 'utf8'));
|
|
182
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : undefined;
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function objectOf(value) {
|
|
189
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : {};
|
|
190
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { loadEnv } from '../locations.js';
|
|
4
|
+
import { accountsRoot } from './homes.js';
|
|
5
|
+
import { removeAccountSettingsGuards } from './settingsGuard.js';
|
|
6
|
+
loadEnv();
|
|
7
|
+
removeAccountSettingsGuards(accountsRoot(process.env), process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), '.claude'));
|