even-keel 0.3.3 → 0.4.0-rc.1
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/.env.example +10 -0
- package/CHANGELOG.md +22 -0
- package/README.md +5 -3
- package/dist/src/account/globals.js +3 -3
- package/dist/src/account/homes.js +41 -0
- package/dist/src/account/longToken.js +99 -0
- package/dist/src/account/settingsGuard.js +1 -1
- package/dist/src/account/settingsLayer.js +78 -18
- package/dist/src/account/share.js +12 -3
- package/dist/src/account/tokenAccount.js +53 -0
- package/dist/src/account/watcher-options.js +1 -0
- package/dist/src/account/watcher.js +97 -12
- package/dist/src/agent/copies.js +2 -2
- package/dist/src/agent/copy.js +6 -3
- package/dist/src/agent/npm-global.js +21 -2
- package/dist/src/badge/collect.js +5 -4
- package/dist/src/badge/render.js +118 -35
- package/dist/src/badge/theme.js +17 -0
- package/dist/src/builtin/components.js +86 -0
- package/dist/src/builtin/control.js +70 -2
- package/dist/src/builtin/diff.js +73 -0
- package/dist/src/builtin/editor.js +6 -3
- package/dist/src/builtin/export-store.js +36 -5
- package/dist/src/builtin/export.js +244 -37
- package/dist/src/builtin/files.js +13 -4
- package/dist/src/builtin/history-log.js +40 -0
- package/dist/src/builtin/import-reading.js +125 -0
- package/dist/src/builtin/import-run.js +294 -0
- package/dist/src/builtin/import-store.js +75 -0
- package/dist/src/builtin/import.js +373 -0
- package/dist/src/builtin/milestones.js +116 -0
- package/dist/src/builtin/routes.js +84 -4
- package/dist/src/builtin/source.js +38 -11
- package/dist/src/builtin/store.js +204 -128
- package/dist/src/builtin/switch.js +18 -10
- package/dist/src/builtin/task-rows.js +157 -0
- package/dist/src/builtin/transfer-store.js +62 -0
- package/dist/src/chain/answers.js +14 -11
- package/dist/src/chain/archive-pages.js +44 -0
- package/dist/src/chain/arrange.js +109 -0
- package/dist/src/chain/carry.js +3 -3
- package/dist/src/chain/checkreports.js +9 -0
- package/dist/src/chain/cleanup.js +90 -20
- package/dist/src/chain/dispatcher.js +189 -482
- package/dist/src/chain/handoff-note.js +5 -0
- package/dist/src/chain/handoff-notes.js +44 -0
- package/dist/src/chain/lanes.js +55 -0
- package/dist/src/chain/launches.js +17 -2
- package/dist/src/chain/limit-moves.js +32 -0
- package/dist/src/chain/limitNotice.js +19 -8
- package/dist/src/chain/lists.js +26 -2
- package/dist/src/chain/maincheck.js +49 -10
- package/dist/src/chain/mainci.js +11 -62
- package/dist/src/chain/mainfix.js +114 -25
- package/dist/src/chain/order.js +48 -6
- package/dist/src/chain/outside.js +28 -0
- package/dist/src/chain/pauses.js +33 -3
- package/dist/src/chain/placement.js +113 -0
- package/dist/src/chain/prompts.js +32 -4
- package/dist/src/chain/quiet.js +25 -0
- package/dist/src/chain/relay.js +46 -11
- package/dist/src/chain/restartGuard.js +2 -2
- package/dist/src/chain/reviews.js +12 -7
- package/dist/src/chain/rules.js +14 -0
- package/dist/src/chain/shelved.js +3 -3
- package/dist/src/chain/start.js +7 -7
- package/dist/src/chain/step.js +246 -0
- package/dist/src/chain/store.js +2 -2
- package/dist/src/chain/talk.js +122 -0
- package/dist/src/chain/unchanged.js +8 -8
- package/dist/src/chain/user-message.js +38 -0
- package/dist/src/chats/chats.js +345 -0
- package/dist/src/chats/model.js +115 -0
- package/dist/src/chats/prompt.js +51 -0
- package/dist/src/chats/routes.js +60 -0
- package/dist/src/chats/store.js +101 -0
- package/dist/src/ci/adapters.js +2 -1
- package/dist/src/ci/forgejo-profile.js +2 -2
- package/dist/src/ci/protection-audit.js +2 -1
- package/dist/src/ci/watcher.js +2 -2
- package/dist/src/claude/adapter.js +2 -2
- package/dist/src/claude/cli.js +22 -4
- package/dist/src/claude/listing.js +128 -0
- package/dist/src/claude/login-browser.js +42 -0
- package/dist/src/claude/sdk/registry.js +1 -1
- package/dist/src/cli-args.js +62 -5
- package/dist/src/cli-check/lease.js +2 -1
- package/dist/src/cli-check/run.js +1 -1
- package/dist/src/cli-install.js +44 -0
- package/dist/src/cli.js +111 -36
- package/dist/src/codex/adapter.js +11 -4
- package/dist/src/codex/cli.js +13 -6
- package/dist/src/codex/plugins.js +6 -3
- package/dist/src/codex/rollout.js +51 -43
- package/dist/src/codex/rolloutFiles.js +62 -0
- package/dist/src/codex/tail.js +16 -3
- package/dist/src/codex/turns.js +1 -1
- package/dist/src/codex/usage.js +7 -2
- package/dist/src/codex/version.js +1 -1
- package/dist/src/config-form.js +36 -6
- package/dist/src/config-store.js +18 -4
- package/dist/src/config.js +15 -3
- package/dist/src/copilot/adapter.js +1 -1
- package/dist/src/copilot/cli.js +11 -5
- package/dist/src/diagnostics/missing-package.js +9 -0
- package/dist/src/diagnostics/stall-profile.js +99 -0
- package/dist/src/diagnostics/start-watch.js +45 -12
- package/dist/src/dictation/transcribe.js +124 -0
- package/dist/src/event-log/watch.js +28 -3
- package/dist/src/events.js +52 -10
- package/dist/src/fetch-dispatcher.js +11 -0
- package/dist/src/forgejo/api.js +11 -2
- package/dist/src/forgejo/editor.js +1 -1
- package/dist/src/git/diff.js +52 -0
- package/dist/src/git/dirs.js +19 -0
- package/dist/src/git/patterns.js +91 -0
- package/dist/src/git/push.js +63 -0
- package/dist/src/git/remote-head.js +69 -0
- package/dist/src/git/remote-urls.js +47 -0
- package/dist/src/git/slot-clean.js +144 -0
- package/dist/src/git/slot.js +12 -4
- package/dist/src/git/sync.js +49 -12
- package/dist/src/git/work.js +32 -8
- package/dist/src/git/worktree.js +12 -3
- package/dist/src/github/adapter.js +1 -0
- package/dist/src/github/editor.js +2 -0
- package/dist/src/github/import.js +311 -0
- package/dist/src/github/profile.js +1 -1
- package/dist/src/github/source.js +121 -28
- package/dist/src/github/uploads.js +8 -0
- package/dist/src/gitlab/api.js +4 -0
- package/dist/src/gitlab/editor.js +1 -1
- package/dist/src/gitlab/profile.js +1 -1
- package/dist/src/huly/adapter.js +2 -1
- package/dist/src/huly/colors.js +41 -0
- package/dist/src/huly/import-text.js +31 -0
- package/dist/src/huly/import.js +317 -0
- package/dist/src/huly/model.js +10 -3
- package/dist/src/huly/profile.js +1 -1
- package/dist/src/huly/source.js +46 -10
- package/dist/src/huly/transient.js +32 -0
- package/dist/src/intake/intake.js +42 -17
- package/dist/src/intake/model.js +2 -0
- package/dist/src/jira/api.js +4 -0
- package/dist/src/jira/editor.js +1 -1
- package/dist/src/jira/model.js +7 -2
- package/dist/src/jira/profile.js +1 -1
- package/dist/src/jobs/model.js +7 -1
- package/dist/src/jobs/runner.js +25 -7
- package/dist/src/limits/chatgpt-seat.js +31 -3
- package/dist/src/limits/chatgpt.js +16 -4
- package/dist/src/limits/identity.js +51 -0
- package/dist/src/limits/model.js +17 -3
- package/dist/src/limits/polls.js +200 -0
- package/dist/src/limits/token-windows.js +30 -0
- package/dist/src/limits/watcher.js +93 -9
- package/dist/src/linear/adapter.js +1 -0
- package/dist/src/linear/answer.js +27 -0
- package/dist/src/linear/import.js +282 -0
- package/dist/src/linear/profile.js +3 -2
- package/dist/src/linear/source.js +62 -8
- package/dist/src/link/address.js +28 -0
- package/dist/src/link/cert.js +41 -0
- package/dist/src/link/colors.js +20 -0
- package/dist/src/link/hooks.js +30 -0
- package/dist/src/link/hub-server.js +164 -0
- package/dist/src/link/hub-store.js +84 -0
- package/dist/src/link/hub.js +249 -0
- package/dist/src/link/identity.js +20 -0
- package/dist/src/link/local.js +75 -0
- package/dist/src/link/machine-store.js +177 -0
- package/dist/src/link/machine-transport.js +184 -0
- package/dist/src/link/machine.js +402 -0
- package/dist/src/link/protocol.js +77 -0
- package/dist/src/link/view.js +2 -0
- package/dist/src/locations.js +3 -0
- package/dist/src/machine/about.js +53 -0
- package/dist/src/machine/account-here.js +26 -0
- package/dist/src/machine/assignments.js +99 -0
- package/dist/src/machine/brief.js +99 -0
- package/dist/src/machine/chain-machines.js +37 -0
- package/dist/src/machine/config.js +48 -0
- package/dist/src/machine/facts.js +118 -0
- package/dist/src/machine/folder-check.js +103 -0
- package/dist/src/{chain → machine}/handover.js +70 -82
- package/dist/src/machine/hook-receiver.js +124 -0
- package/dist/src/machine/host.js +1 -0
- package/dist/src/machine/join-cli.js +59 -0
- package/dist/src/machine/join.js +96 -0
- package/dist/src/machine/main.js +71 -0
- package/dist/src/machine/marks.js +81 -0
- package/dist/src/machine/move-call.js +42 -0
- package/dist/src/machine/moves.js +210 -0
- package/dist/src/{chain → machine}/overage.js +9 -11
- package/dist/src/machine/own.js +33 -0
- package/dist/src/machine/page.js +74 -0
- package/dist/src/machine/pool.js +100 -0
- package/dist/src/machine/port.js +1 -0
- package/dist/src/machine/reassign.js +30 -0
- package/dist/src/machine/records.js +73 -0
- package/dist/src/machine/remote.js +300 -0
- package/dist/src/machine/runner.js +268 -0
- package/dist/src/machine/services.js +52 -0
- package/dist/src/machine/state.js +54 -0
- package/dist/src/machine/tally.js +65 -0
- package/dist/src/machine/task-moves.js +46 -0
- package/dist/src/machine/tasks.js +165 -0
- package/dist/src/machine-service.js +141 -0
- package/dist/src/main.js +12 -104
- package/dist/src/memory/mcp.js +206 -0
- package/dist/src/memory/mirror.js +142 -0
- package/dist/src/memory/record.js +69 -0
- package/dist/src/memory/store.js +81 -0
- package/dist/src/notice/en-advice.js +7 -0
- package/dist/src/notice/en-review.js +3 -0
- package/dist/src/notice/en-transfer.js +30 -0
- package/dist/src/notice/en-values.js +2 -0
- package/dist/src/notice/en.js +120 -11
- package/dist/src/npm-access.js +18 -2
- package/dist/src/opencode/adapter.js +3 -1
- package/dist/src/opencode/cli.js +11 -10
- package/dist/src/opencode/home.js +24 -4
- package/dist/src/opencode/tail.js +7 -1
- package/dist/src/opencode/transcript.js +21 -7
- package/dist/src/opencode/window.js +21 -5
- package/dist/src/packages/check.js +17 -8
- package/dist/src/packages/follow.js +54 -0
- package/dist/src/packages/gateway.js +86 -4
- package/dist/src/packages/hub.js +64 -0
- package/dist/src/packages/installs.js +226 -0
- package/dist/src/packages/launch.js +61 -13
- package/dist/src/packages/repo-reads.js +41 -0
- package/dist/src/packages/service.js +169 -243
- package/dist/src/packages/skills-package.js +39 -0
- package/dist/src/packages/stdio.js +24 -0
- package/dist/src/packages/version.js +2 -1
- package/dist/src/pass-memo.js +27 -0
- package/dist/src/patch.js +2 -1
- package/dist/src/profiles/rules.js +2 -2
- package/dist/src/projects/check.js +3 -2
- package/dist/src/projects/remotes.js +2 -1
- package/dist/src/projects/target-read.js +2 -1
- package/dist/src/review/open.js +27 -4
- package/dist/src/review/outsider.js +39 -0
- package/dist/src/review/wiring.js +2 -1
- package/dist/src/secrets/catalog.js +2 -0
- package/dist/src/server-request.js +51 -6
- package/dist/src/server-response.js +10 -2
- package/dist/src/server.js +102 -3
- package/dist/src/service/account-packages.js +24 -41
- package/dist/src/service/accounts.js +88 -135
- package/dist/src/service/badge.js +39 -6
- package/dist/src/service/chain-prompts.js +50 -5
- package/dist/src/service/chain.js +33 -378
- package/dist/src/service/chats.js +41 -0
- package/dist/src/service/cleanup.js +22 -7
- package/dist/src/service/cli-check.js +4 -4
- package/dist/src/service/defaults.js +32 -0
- package/dist/src/service/demo.js +3 -2
- package/dist/src/service/folders-here.js +21 -0
- package/dist/src/service/hosting-state.js +204 -0
- package/dist/src/service/hosting.js +153 -209
- package/dist/src/service/hub-bootstrap.js +204 -0
- package/dist/src/service/hub-brief.js +72 -0
- package/dist/src/service/hub-hooks.js +44 -0
- package/dist/src/service/hub-mcp.js +140 -0
- package/dist/src/service/install-check.js +19 -5
- package/dist/src/service/lifecycle.js +4 -2
- package/dist/src/service/machine-bootstrap.js +105 -0
- package/dist/src/service/machine-cards.js +62 -0
- package/dist/src/service/machine-chain.js +499 -0
- package/dist/src/service/machine-chats.js +91 -0
- package/dist/src/service/machine-context.js +103 -0
- package/dist/src/service/machine-host.js +226 -0
- package/dist/src/service/machine-link.js +476 -0
- package/dist/src/service/machine-network-options.js +12 -0
- package/dist/src/service/machine-network.js +741 -0
- package/dist/src/service/machine-packages.js +38 -0
- package/dist/src/service/machine-page.js +88 -0
- package/dist/src/service/machine-pool.js +177 -0
- package/dist/src/service/machine-process.js +84 -0
- package/dist/src/service/machine-services.js +117 -0
- package/dist/src/service/machine-settings.js +84 -0
- package/dist/src/service/machine-side.js +220 -0
- package/dist/src/service/page-history.js +31 -0
- package/dist/src/service/pool-after-green.js +92 -0
- package/dist/src/service/reassign.js +79 -0
- package/dist/src/service/session-monitor.js +119 -0
- package/dist/src/service/stats.js +3 -1
- package/dist/src/service/ticks.js +37 -0
- package/dist/src/service/trackers.js +1 -0
- package/dist/src/service.js +183 -440
- package/dist/src/sessions/agents.js +8 -4
- package/dist/src/sessions/cache.js +19 -0
- package/dist/src/sessions/chat.js +60 -13
- package/dist/src/sessions/inbox.js +10 -0
- package/dist/src/sessions/inboxes.js +112 -0
- package/dist/src/sessions/keepwarm.js +14 -0
- package/dist/src/sessions/lingering.js +4 -0
- package/dist/src/sessions/mail.js +3 -1
- package/dist/src/sessions/mailRelay.js +38 -2
- package/dist/src/sessions/mailbox-store.js +25 -0
- package/dist/src/sessions/mailbox.js +55 -26
- package/dist/src/sessions/monitor.js +17 -1
- package/dist/src/sessions/note.js +15 -4
- package/dist/src/sessions/orphans.js +131 -0
- package/dist/src/sessions/remote.js +5 -1
- package/dist/src/sessions/runs.js +39 -21
- package/dist/src/sessions/title.js +11 -6
- package/dist/src/sessions/transcript.js +41 -16
- package/dist/src/sessions/turn-ends.js +23 -0
- package/dist/src/sessions/view-index.js +38 -0
- package/dist/src/sessions/warm-pings.js +30 -0
- package/dist/src/settings/defaults.js +6 -1
- package/dist/src/settings/registry.js +49 -13
- package/dist/src/start.js +110 -0
- package/dist/src/stats/base-sql.js +8 -0
- package/dist/src/stats/machine-tally.js +46 -0
- package/dist/src/stats/model.js +3 -2
- package/dist/src/stats/reader.js +69 -16
- package/dist/src/stats/tally-schema.js +1 -1
- package/dist/src/stats/tally.js +13 -0
- package/dist/src/storage/backup-schedule.js +9 -2
- package/dist/src/storage/copy.js +9 -3
- package/dist/src/storage/database-steps.js +942 -0
- package/dist/src/storage/database.js +2 -630
- package/dist/src/storage/json-folder.js +44 -9
- package/dist/src/storage/migrations.js +6 -1
- package/dist/src/storage/owner.js +1 -1
- package/dist/src/storage/schema.js +1 -1
- package/dist/src/taskmcp/calls.js +26 -12
- package/dist/src/taskmcp/carried.js +69 -0
- package/dist/src/taskmcp/downloads.js +68 -32
- package/dist/src/taskmcp/files.js +4 -0
- package/dist/src/taskmcp/handoff.js +21 -0
- package/dist/src/taskmcp/history.js +48 -0
- package/dist/src/taskmcp/machine.js +205 -0
- package/dist/src/taskmcp/server.js +7 -2
- package/dist/src/taskmcp/tools.js +24 -4
- package/dist/src/tools/panel.js +5 -3
- package/dist/src/tools/sessionSettings.js +4 -1
- package/dist/src/tracker/author.js +13 -0
- package/dist/src/tracker/brief.js +24 -0
- package/dist/src/tracker/comments.js +19 -2
- package/dist/src/tracker/control.js +6 -1
- package/dist/src/tracker/editor.js +3 -2
- package/dist/src/tracker/error-text.js +21 -0
- package/dist/src/tracker/export-target.js +2 -1
- package/dist/src/tracker/export.js +116 -53
- package/dist/src/tracker/file-names.js +34 -0
- package/dist/src/tracker/history-export.js +14 -0
- package/dist/src/tracker/history.js +55 -0
- package/dist/src/tracker/import-plan.js +155 -0
- package/dist/src/tracker/import-retry.js +107 -0
- package/dist/src/tracker/import-source.js +33 -0
- package/dist/src/tracker/import.js +34 -0
- package/dist/src/tracker/link.js +4 -8
- package/dist/src/tracker/model.js +13 -0
- package/dist/src/tracker/pace.js +74 -0
- package/dist/src/tracker/parents.js +2 -1
- package/dist/src/tracker/rate-limit.js +63 -0
- package/dist/src/tracker/source.js +16 -6
- package/dist/src/tracker/start.js +72 -9
- package/dist/src/tracker/transfer-check.js +278 -0
- package/dist/src/tracker/transfer-stop.js +49 -0
- package/dist/src/updates/checkout.js +8 -0
- package/dist/src/updates/follow.js +108 -0
- package/dist/src/updates/model.js +23 -11
- package/dist/src/updates/rebuild.js +27 -0
- package/dist/src/updates/run.js +32 -16
- package/dist/src/updates/runner.js +193 -12
- package/dist/src/updates/steps.js +9 -6
- package/dist/src/updates/updater.js +18 -12
- package/dist/tally/src/activity-result.js +24 -0
- package/dist/tally/src/activity.js +52 -0
- package/dist/tally/src/chat-sessions.js +14 -0
- package/dist/tally/src/classify.js +2 -2
- package/dist/tally/src/collect.js +12 -4
- package/dist/tally/src/db-activity.js +28 -0
- package/dist/tally/src/db-backfills.js +38 -0
- package/dist/tally/src/db.js +104 -101
- package/dist/tally/src/machine-rows.js +23 -0
- package/dist/tally/src/migrations/17-machines.sql +7 -0
- package/dist/tally/src/migrations/18-chat-sessions.sql +70 -0
- package/dist/tally/src/migrations/19-limit-shares-one-pass.sql +32 -0
- package/dist/tally/src/migrations/20-warm-pings.sql +114 -0
- package/dist/tally/src/migrations/21-session-activity.sql +80 -0
- package/dist/tally/src/migrations/22-line-raws.sql +57 -0
- package/dist/tally/src/migrations.js +1 -1
- package/dist/tally/src/ship.js +82 -0
- package/dist/tally/src/step-runs.js +5 -20
- package/dist/tally/src/stream.js +4 -6
- package/dist/tally/src/turns.js +2 -2
- package/dist/tally/src/warm-pings.js +15 -0
- package/dist/web/assets/BadgeDialog-B_puf4gn.js +1 -0
- package/dist/web/assets/ButtonWithTip-CKUX2Zj9.css +1 -0
- package/dist/web/assets/ButtonWithTip-Dv_lTY2w.js +1 -0
- package/dist/web/assets/ChainDivider-BWHmlwAN.css +1 -0
- package/dist/web/assets/ChainDivider-CAgORlAt.js +2 -0
- package/dist/web/assets/{DescriptionEditor-CPfdoDlm.js → DescriptionEditor-BP9G4eW1.js} +5 -5
- package/dist/web/assets/FixButtons-VKGqxhsJ.js +7 -0
- package/dist/web/assets/FixButtons-xuzSmDiG.css +1 -0
- package/dist/web/assets/Loader-CRa8gNSO.css +1 -0
- package/dist/web/assets/Loader-gLtpd-HU.js +1 -0
- package/dist/web/assets/NewChatDialog-BNeZwqhQ.css +1 -0
- package/dist/web/assets/NewChatDialog-BPhSEUlM.js +1 -0
- package/dist/web/assets/OutsideView-CjqU_1_v.js +1 -0
- package/dist/web/assets/OutsideView-Hfkm7sQH.css +1 -0
- package/dist/web/assets/ProjectChatWindow-DFHqXtJT.js +1 -0
- package/dist/web/assets/ProjectPackages-C3WBhYWn.js +1 -0
- package/dist/web/assets/Select-ClnxKCav.js +1 -0
- package/dist/web/assets/Select-L3DXe4x4.css +1 -0
- package/dist/web/assets/TaskCard-DQJ_pizZ.js +2 -0
- package/dist/web/assets/TaskCard-MSKfeQSB.css +1 -0
- package/dist/web/assets/TranscriptWindow-B_0lkEov.css +1 -0
- package/dist/web/assets/TranscriptWindow-D-EQPrlF.js +6 -0
- package/dist/web/assets/TranscriptWindow-DTy64neg.js +1 -0
- package/dist/web/assets/accountParts-CIVGro5M.css +1 -0
- package/dist/web/assets/accountParts-CxNOHLQV.js +3 -0
- package/dist/web/assets/blocks-C3-5RdLi.css +1 -0
- package/dist/web/assets/blocks-DEe611CF.js +14 -0
- package/dist/web/assets/cardDrafts-BIJBcK7y.css +1 -0
- package/dist/web/assets/cardDrafts-Cu4oR7jf.js +12 -0
- package/dist/web/assets/cardSide-EOcop8Wv.css +1 -0
- package/dist/web/assets/cardSide-rO6Ughfv.js +2 -0
- package/dist/web/assets/{feedLine-CBjZXWwX.css → feedPin-BXDM-u8h.css} +1 -1
- package/dist/web/assets/feedPin-CHY_Owsx.js +3 -0
- package/dist/web/assets/format-DecSum6S.js +1 -0
- package/dist/web/assets/index-BgmurD3-.js +36 -0
- package/dist/web/assets/index-KJhwihX1.css +1 -0
- package/dist/web/assets/lib-D5hQoyXI.js +18 -0
- package/dist/web/assets/overview-BGjnxKG3.css +1 -0
- package/dist/web/assets/packageGroups-B-lwU2vO.js +1 -0
- package/dist/web/assets/packages-Cr9yWzy2.css +1 -0
- package/dist/web/assets/{react-dom-ntoTaxXv.js → react-dom-CzZfPJAD.js} +1 -1
- package/dist/web/assets/settingsRun-Cl3nW7b_.css +1 -0
- package/dist/web/assets/settingsRun-D-Dqm7pY.js +3 -0
- package/dist/web/assets/useFileDrop-ChaeIqmQ.js +1 -0
- package/dist/web/assets/useRowFocus-9aJnL77Z.js +1 -0
- package/dist/web/index.html +32 -24
- package/even-keel.config.example.json +1 -2
- package/package.json +11 -5
- package/plugins/agent-bridge/.claude-plugin/plugin.json +2 -2
- package/plugins/agent-bridge/.mcp.json +8 -0
- package/plugins/agent-bridge/README.md +4 -0
- package/plugins/agent-bridge/hooks/checkpoint-mark.mjs +4 -3
- package/plugins/agent-bridge/hooks/evenkeel.mjs +40 -3
- package/plugins/agent-bridge/hooks/handoff.mjs +12 -2
- package/plugins/agent-bridge/hooks/hooks.json +9 -0
- package/plugins/agent-bridge/hooks/inbox.mjs +26 -0
- package/plugins/agent-bridge/hooks/mailpost.mjs +52 -0
- package/plugins/agent-bridge/hooks/merge-check.mjs +2 -1
- package/plugins/agent-bridge/hooks/merges.mjs +24 -1
- package/plugins/agent-bridge/hooks/nudges.mjs +16 -7
- package/plugins/agent-bridge/opencode/agent-bridge.mjs +17 -14
- package/plugins/tally/.claude-plugin/plugin.json +1 -1
- package/plugins/tally/skills/session-audit/SKILL.md +4 -4
- package/plugins/tasks/.claude-plugin/plugin.json +1 -1
- package/plugins/tasks/skills/split/SKILL.md +4 -1
- package/plugins/tasks/skills/task/SKILL.md +1 -0
- package/service/EvenKeelTray.cs +52 -4
- package/service/install.ps1 +25 -3
- package/service/install.sh +61 -4
- package/dist/web/assets/BadgeDialog-B3VcoEuQ.js +0 -1
- package/dist/web/assets/ProjectPackages-BO4rIO5w.js +0 -1
- package/dist/web/assets/Select-BYWAe5Fn.js +0 -1
- package/dist/web/assets/Select-CYemy5Na.css +0 -1
- package/dist/web/assets/TaskCard-BV2lQojC.css +0 -1
- package/dist/web/assets/TaskCard-DvrNOwWg.js +0 -2
- package/dist/web/assets/TranscriptWindow-BNF7AkTM.css +0 -1
- package/dist/web/assets/TranscriptWindow-BiO9Wnwu.js +0 -4
- package/dist/web/assets/accountParts-DSHr6oHI.js +0 -3
- package/dist/web/assets/accountParts-tFRVownp.css +0 -1
- package/dist/web/assets/blocks-C9HVGHBz.js +0 -12
- package/dist/web/assets/blocks-Dx3DACiG.css +0 -1
- package/dist/web/assets/cardDrafts-2oX1SbA7.css +0 -1
- package/dist/web/assets/cardDrafts-4S62wAyr.js +0 -12
- package/dist/web/assets/cardSide-63fNWHHv.css +0 -1
- package/dist/web/assets/cardSide-B4pcPyyP.js +0 -2
- package/dist/web/assets/feedLine-Bw0m9J2B.js +0 -1
- package/dist/web/assets/hooks-DkC_CVfs.js +0 -1
- package/dist/web/assets/index-9wCKwZBT.js +0 -25
- package/dist/web/assets/index-CZNlGIGI.css +0 -1
- package/dist/web/assets/lib-DqcU8Atw.js +0 -18
- package/dist/web/assets/overview-B7iEgjQD.css +0 -1
- package/dist/web/assets/overview-CAfIOCOy.js +0 -7
- package/dist/web/assets/packageGroups-BQRZ8Kq6.js +0 -1
- package/dist/web/assets/packages-Dld4uH9X.css +0 -1
- package/dist/web/assets/rules-D-jNBQYg.js +0 -1
- package/dist/web/assets/useFileDrop-B3fsWqOP.js +0 -1
- package/dist/web/assets/useHeightGlide-75qzC7AC.js +0 -3
- package/dist/web/assets/useHeightGlide-B2o4yzDR.css +0 -1
- package/dist/web/assets/useRowFocus-DnfnHKTV.js +0 -1
- /package/dist/web/assets/{rules-Bgil4ZBp.css → lib-Bgil4ZBp.css} +0 -0
package/.env.example
CHANGED
|
@@ -23,11 +23,19 @@
|
|
|
23
23
|
# EVEN_KEEL_HOST=127.0.0.1
|
|
24
24
|
# EVEN_KEEL_PORT=4747
|
|
25
25
|
|
|
26
|
+
# Sample the service CPU and save profiles of event-loop stalls in logs/. Off by default.
|
|
27
|
+
# EVEN_KEEL_STALL_PROFILE=1
|
|
28
|
+
|
|
26
29
|
# The local MCP gateway chain sessions reach their packages' servers through (docs/packages.md); always on 127.0.0.1.
|
|
27
30
|
# EVEN_KEEL_MCP_PORT=4748
|
|
28
31
|
|
|
32
|
+
# The port the hub listens for other machines on, on all interfaces, while "Hub address for machines" is set (docs/machines.md). Read at startup.
|
|
33
|
+
# EVEN_KEEL_MACHINES_PORT=4749
|
|
34
|
+
|
|
29
35
|
# The page's token for requests from other machines; required when EVEN_KEEL_HOST is not loopback (docs/guide/setup.md).
|
|
30
36
|
# EVEN_KEEL_TOKEN=change-me-0123456789abcdef
|
|
37
|
+
# For Docker Compose, set a fresh token above. Image tag: latest, next, or an exact version.
|
|
38
|
+
# EVEN_KEEL_IMAGE_TAG=latest
|
|
31
39
|
|
|
32
40
|
# Folder with one Claude config folder per extra account; defaults to ~/.claude-accounts.
|
|
33
41
|
# EVEN_KEEL_ACCOUNTS_DIR=C:\Users\john.doe\.claude-accounts
|
|
@@ -64,3 +72,5 @@
|
|
|
64
72
|
# TALLY_LLM_URL=http://100.64.0.1:4000
|
|
65
73
|
# TALLY_LLM_KEY=sk-change-me
|
|
66
74
|
# TALLY_LLM_MODEL=google-gemini-3.1-flash-lite
|
|
75
|
+
# The chat microphone's model on the same LiteLLM (it must take audio); empty — the one below.
|
|
76
|
+
# TALLY_LLM_DICTATION_MODEL=google-gemini-3.5-flash-lite
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ All notable changes to Even Keel are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.3.4] - 2026-11-20
|
|
8
|
+
|
|
9
|
+
A patch of 0.3: Remote Control for a Claude account added from the page, and fewer "changed directly" plates on the Accounts page.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **A claude.ai account you add from the page has Remote Control on.** Its chain sessions show on claude.ai/code and in the Claude app from the first one. Before, the sign-in left Remote Control off, and the page sent you to `/config` without a way to turn it on.
|
|
14
|
+
- **"Turn on Remote Control"** in the account row's menu and in the session panel, where an account has Remote Control off. It applies from the account's next session.
|
|
15
|
+
- Chain sessions run on Claude Code 2.1.330, codex-cli 0.171.0 and Copilot CLI 1.0.114, the versions this release was checked against; OpenCode 1.19.6 stays.
|
|
16
|
+
- A ChatGPT workspace seat with a monthly credit limit reads that limit and its reset straight from the usage answer when the answer carries them, with no second request; before, the reset was assumed to be the start of the next month.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **The "changed directly" plates on the Accounts page show only edits that need your decision.** Keys the CLI writes into an account's `settings.json` itself, such as its notification settings, no longer get a plate.
|
|
21
|
+
- **"Make shared" and "Turn on Remote Control" work on a key the account holds as its own**, also when a plate about a direct edit of that key is still open: the edit is settled. Before, both buttons did nothing until the plate was answered.
|
|
22
|
+
- The README badge's "+N" counts the whole queue, not only the queued tasks the badge has room to draw.
|
|
23
|
+
- In **Move to another tracker**, the project key of a Linear project sits in the same grid as the team and the project, without a blank gap above it; switching the profile to another tracker kind clears the project of the previous one.
|
|
24
|
+
|
|
7
25
|
## [0.3.3] - 2026-11-18
|
|
8
26
|
|
|
9
27
|
A patch of 0.3: keep-warm through a long tool call, and a cache clock that knows about keep-warm.
|
|
@@ -104,6 +122,10 @@ A patch of 0.3: the CI and limit fixes that cost a chain time, and a clearer car
|
|
|
104
122
|
- The ⋯ menu of an account row offers **Replace key** for a working key too.
|
|
105
123
|
- **`even-keel install`, `even-keel update` and the first install from `npx` print the page's address** once the page answers, taken from `EVEN_KEEL_HOST`/`EVEN_KEEL_PORT` of the environment and the data folder's `.env`. If the page has not answered after 30 s, they say where the log is instead. The first install from `npx` then opens the page in the browser. On Linux it does that only on a desktop with a display, never over SSH.
|
|
106
124
|
|
|
125
|
+
### Added
|
|
126
|
+
|
|
127
|
+
- **A Claude subscription can be added on a long token.** "Subscription" in the new Claude Code account dialog now offers two cards: the full sign-in, with what it gives, and the long token of `claude setup-token`, with what it lacks — no Remote Control, limits only while a session runs, no e-mail, a new token in a year. Paste the token and one short turn checks it before the account is added; say which full sign-in it is the same account as, and it shows that account's limits. The account's row shows "long token" and its last day, warns a month before it, and "Issue a new token" replaces a refused or outdated one in the same folder.
|
|
128
|
+
|
|
107
129
|
### Changed
|
|
108
130
|
|
|
109
131
|
- **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`, Codex's `minimal` to `xhigh`, OpenCode's variant and Copilot's reasoning effort; 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.
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
**You write the tickets. It takes the night shift.** Even Keel is a service on your own machine that you drive from one web page. It takes a project's open tasks, 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 a question or a decision waits for you — on that page, in the tracker or on your phone.
|
|
11
11
|
|
|
12
|
-
**Who it's for:** you have a bunch of ideas and an agent subscription, and you'd rather have the agent work through them one task at a time than watch a terminal. No tracker? It has one built in. No git? A plain folder works.
|
|
12
|
+
**Who it's for:** you have a bunch of ideas and an agent subscription, and you'd rather have the agent work through them one task at a time than watch a terminal. No tracker? It has one built in. No git? A plain folder works. No subscription? OpenCode's free models, Codex and Copilot free tiers work too.
|
|
13
13
|
|
|
14
14
|
**Not for:** ten agents at once — it runs one task per folder, on purpose. And it won't write your tasks for you: a clear task makes a good night.
|
|
15
15
|
|
|
@@ -71,7 +71,7 @@ Parallel agents decide on their own what an unfinished task will look like, hand
|
|
|
71
71
|
|
|
72
72
|
## Before you run it
|
|
73
73
|
|
|
74
|
-
- **Even Keel depends on undocumented behaviour of the agents' CLIs**, none of it a public API. Last checked against **Claude Code 2.1.
|
|
74
|
+
- **Even Keel depends on undocumented behaviour of the agents' CLIs**, none of it a public API. Last checked against **Claude Code 2.1.330**, **codex-cli 0.171.0**, **OpenCode 1.19.6** and **Copilot CLI 1.0.114**; 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).
|
|
75
75
|
- **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.
|
|
76
76
|
- **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.
|
|
77
77
|
- **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.
|
|
@@ -89,6 +89,8 @@ Parallel agents decide on their own what an unfinished task will look like, hand
|
|
|
89
89
|
|
|
90
90
|
## As a service
|
|
91
91
|
|
|
92
|
+
On a server or NAS, [install with Docker Compose](docs/guide/docker.md) and update by pulling the image.
|
|
93
|
+
|
|
92
94
|
`npx even-keel` sets it up as your own user, no administrator needed: a start at sign-in with a tray icon on Windows, a systemd user unit on Linux, a launchd agent on macOS. It restarts Even Keel if it fails; stopping it leaves running sessions alone. `even-keel install` sets it up again (in PowerShell `even-keel.cmd`, [why](docs/guide/setup.md#windows-powershell)). Logs, the data folder, running it in a terminal or from a clone: [setup](docs/guide/setup.md#as-a-service).
|
|
93
95
|
|
|
94
96
|
## Updating
|
|
@@ -105,7 +107,7 @@ The settings live in Even Keel's database and are edited on the page, applied at
|
|
|
105
107
|
|
|
106
108
|
## What comes next
|
|
107
109
|
|
|
108
|
-
Looked at, not promised: several machines taking the tasks of one project,
|
|
110
|
+
Looked at, not promised: several machines taking the tasks of one project, a cap on how much of the usage limit one task may spend.
|
|
109
111
|
|
|
110
112
|
## Extending
|
|
111
113
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccountHomes, accountsRoot, codexAccountsRoot, copilotAccountsRoot, openCodeAccountsRoot } from './homes.js';
|
|
2
2
|
import { inTransaction } from '../storage/database.js';
|
|
3
3
|
/** Registration belongs to this installation; a CLI's own folder and credentials remain the CLI's. */
|
|
4
|
-
export async function openAccountHomes(db, env) {
|
|
4
|
+
export async function openAccountHomes(db, env, stateTable = 'service_state') {
|
|
5
5
|
const { rows } = await db.query('select account from global_accounts');
|
|
6
6
|
const registration = {
|
|
7
7
|
keys: new Set(rows.map((row) => row.account)),
|
|
@@ -10,13 +10,13 @@ export async function openAccountHomes(db, env) {
|
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
const homes = new AccountHomes(env, accountsRoot(env), codexAccountsRoot(env), openCodeAccountsRoot(env), copilotAccountsRoot(env), registration);
|
|
13
|
-
const legacy = await db.query(
|
|
13
|
+
const legacy = await db.query(`select 1 from ${stateTable} where name = 'accounts.adoptLegacy'`);
|
|
14
14
|
if (legacy.rows.length > 0) {
|
|
15
15
|
const visible = homes.availableGlobals();
|
|
16
16
|
await inTransaction(db, async (tx) => {
|
|
17
17
|
for (const home of visible)
|
|
18
18
|
await tx.query('insert into global_accounts (account) values ($1) on conflict do nothing', [home.key]);
|
|
19
|
-
await tx.query(
|
|
19
|
+
await tx.query(`delete from ${stateTable} where name = 'accounts.adoptLegacy'`);
|
|
20
20
|
});
|
|
21
21
|
for (const home of visible)
|
|
22
22
|
registration.keys.add(home.key);
|
|
@@ -9,10 +9,12 @@ import { fail } from '../notice/notice.js';
|
|
|
9
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
|
+
import { REMOTE_AT_STARTUP } from '../sessions/remote.js';
|
|
12
13
|
import { shortLivedProfile } from './aws.js';
|
|
13
14
|
import { userCredentials } from './gcloud.js';
|
|
14
15
|
import { cloudEnv, cloudOf } from './cloud.js';
|
|
15
16
|
import { KeychainCredentials, keychainService } from './keychain.js';
|
|
17
|
+
import { readLongToken, writeLongToken } from './longToken.js';
|
|
16
18
|
import { CODEX_ACCOUNT, folderName, GLOBAL_ACCOUNT, parseCredentialTimes } from './model.js';
|
|
17
19
|
import { API_KEY_VARIABLE, shareConfig } from './share.js';
|
|
18
20
|
const PENDING_PREFIX = '.pending-';
|
|
@@ -205,6 +207,21 @@ export class AccountHomes {
|
|
|
205
207
|
writeFileSync(join(home.dir, 'settings.json'), JSON.stringify({ env: cloudEnv(connection) }, null, 2));
|
|
206
208
|
return home;
|
|
207
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* A subscription account on a long token of `claude setup-token` (BTN-1005): a Claude folder whose `settings.json`
|
|
212
|
+
* carries the token, as an API account's carries its key; named `token` when the name is blank.
|
|
213
|
+
*/
|
|
214
|
+
addLongToken(name, token, now, tie = {}) {
|
|
215
|
+
const home = this.home(CLAUDE, folderName(name.trim() === '' ? 'token' : name, this.taken()));
|
|
216
|
+
mkdirSync(home.dir, { recursive: true });
|
|
217
|
+
this.forget();
|
|
218
|
+
writeLongToken(home.dir, token, now, tie);
|
|
219
|
+
return home;
|
|
220
|
+
}
|
|
221
|
+
/** The long token a Claude folder runs on; null for a folder signed in any other way. */
|
|
222
|
+
longTokenOf(home) {
|
|
223
|
+
return home.agent === CLAUDE ? readLongToken(home.dir) : null;
|
|
224
|
+
}
|
|
208
225
|
/** The cloud a Claude folder's `settings.json` connects to; null for any other folder. */
|
|
209
226
|
cloudOf(home) {
|
|
210
227
|
if (home.agent !== CLAUDE)
|
|
@@ -282,6 +299,30 @@ export class AccountHomes {
|
|
|
282
299
|
return false;
|
|
283
300
|
return shareConfig({ dir: this.global.dir, config: this.configFile(this.global) }, home.dir, console.warn, this.settings?.planner(home.key));
|
|
284
301
|
}
|
|
302
|
+
/** Whether the Claude folder's `settings.json` starts Remote Control with its sessions. */
|
|
303
|
+
remoteOn(home) {
|
|
304
|
+
return readObject(join(home.dir, 'settings.json'))[REMOTE_AT_STARTUP] === true;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Remote Control from the folder's next session (EKR-148): an account folder gets it in its own layer, which the
|
|
308
|
+
* global settings never override, and at once by a transfer; the global folder, its own file, merged.
|
|
309
|
+
*/
|
|
310
|
+
enableRemote(home) {
|
|
311
|
+
if (home.agent !== CLAUDE)
|
|
312
|
+
throw fail('account.unknown', { key: home.key });
|
|
313
|
+
if (!home.global && this.settings !== null) {
|
|
314
|
+
this.settings.setOwn(home, REMOTE_AT_STARTUP, true);
|
|
315
|
+
this.share(home);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const file = join(home.dir, 'settings.json');
|
|
319
|
+
const settings = readObject(file);
|
|
320
|
+
if (Object.keys(settings).length === 0 && existsSync(file) && !/^\s*(\{\s*\})?\s*$/.test(readFileSync(file, 'utf8'))) {
|
|
321
|
+
throw new Error(`claude: ${file} is no JSON object, Remote Control left off rather than overwrite it`);
|
|
322
|
+
}
|
|
323
|
+
mkdirSync(home.dir, { recursive: true });
|
|
324
|
+
writeFileSync(file, JSON.stringify({ ...settings, [REMOTE_AT_STARTUP]: true }, null, 2));
|
|
325
|
+
}
|
|
285
326
|
/** The `.claude.json` the CLI reads with this folder. */
|
|
286
327
|
configFile(home) {
|
|
287
328
|
if (!home.global)
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fail } from '../notice/notice.js';
|
|
4
|
+
import { OAUTH_TOKEN_VARIABLE } from './share.js';
|
|
5
|
+
/** What Even Keel knows of a folder's long token beside the token itself; kept in the account folder, never in git. */
|
|
6
|
+
export const LONG_TOKEN_FILE = 'even-keel-token.json';
|
|
7
|
+
/** `claude setup-token` issues a token for a year and the token carries no readable date: counted from the day it was added. */
|
|
8
|
+
const VALID_MS = 365 * 24 * 3600_000;
|
|
9
|
+
const TOKEN = /^sk-ant-oat\d\d-\S{20,}$/;
|
|
10
|
+
/** The trimmed token of the form `claude setup-token` prints; an API key or anything else is refused. */
|
|
11
|
+
export function assertLongToken(token) {
|
|
12
|
+
const value = token.trim();
|
|
13
|
+
if (!TOKEN.test(value))
|
|
14
|
+
throw fail('account.tokenInvalid', {});
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
function readObject(file) {
|
|
18
|
+
try {
|
|
19
|
+
const parsed = JSON.parse(readFileSync(file, 'utf8'));
|
|
20
|
+
return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed : {};
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function tokenIn(dir) {
|
|
27
|
+
const env = readObject(join(dir, 'settings.json')).env;
|
|
28
|
+
const token = typeof env === 'object' && env !== null ? env[OAUTH_TOKEN_VARIABLE] : undefined;
|
|
29
|
+
return typeof token === 'string' && token !== '' ? token : null;
|
|
30
|
+
}
|
|
31
|
+
/** The folder's long token as Even Keel knows it; null — its `settings.json` holds none. */
|
|
32
|
+
export function readLongToken(dir) {
|
|
33
|
+
if (tokenIn(dir) === null)
|
|
34
|
+
return null;
|
|
35
|
+
const kept = readObject(join(dir, LONG_TOKEN_FILE));
|
|
36
|
+
const account = accountOf(kept.account);
|
|
37
|
+
return {
|
|
38
|
+
until: typeof kept.until === 'string' ? kept.until : null,
|
|
39
|
+
...(typeof kept.sameAs === 'string' && kept.sameAs !== '' && { sameAs: kept.sameAs }),
|
|
40
|
+
...(account !== undefined && { account }),
|
|
41
|
+
...(typeof kept.refusedAt === 'string' && { refusedAt: kept.refusedAt }),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function accountOf(value) {
|
|
45
|
+
if (typeof value !== 'object' || value === null)
|
|
46
|
+
return undefined;
|
|
47
|
+
const { account, email } = value;
|
|
48
|
+
if (typeof account !== 'string' || account === '')
|
|
49
|
+
return undefined;
|
|
50
|
+
return { account, email: typeof email === 'string' && email !== '' ? email : null };
|
|
51
|
+
}
|
|
52
|
+
/** The token into the folder's `settings.json`, the rest of the file as it was, and a year from `now` as its last day. */
|
|
53
|
+
export function writeLongToken(dir, token, now, tie = {}) {
|
|
54
|
+
const file = join(dir, 'settings.json');
|
|
55
|
+
const settings = readObject(file);
|
|
56
|
+
const env = typeof settings.env === 'object' && settings.env !== null ? settings.env : {};
|
|
57
|
+
writeFileSync(file, JSON.stringify({ ...settings, env: { ...env, [OAUTH_TOKEN_VARIABLE]: token } }, null, 2));
|
|
58
|
+
const kept = {
|
|
59
|
+
until: new Date(now.getTime() + VALID_MS).toISOString(),
|
|
60
|
+
...(tie.sameAs !== undefined && { sameAs: tie.sameAs }),
|
|
61
|
+
...(tie.account !== undefined && { account: tie.account }),
|
|
62
|
+
};
|
|
63
|
+
writeFileSync(join(dir, LONG_TOKEN_FILE), JSON.stringify(kept, null, 2));
|
|
64
|
+
}
|
|
65
|
+
/** Puts back what `takeLongToken` returned, after a new token failed its check. */
|
|
66
|
+
export function restoreLongToken(dir, held) {
|
|
67
|
+
const file = join(dir, 'settings.json');
|
|
68
|
+
const settings = readObject(file);
|
|
69
|
+
const env = typeof settings.env === 'object' && settings.env !== null ? settings.env : {};
|
|
70
|
+
writeFileSync(file, JSON.stringify({ ...settings, env: { ...env, [OAUTH_TOKEN_VARIABLE]: held.token } }, null, 2));
|
|
71
|
+
if (held.kept === null)
|
|
72
|
+
rmSync(join(dir, LONG_TOKEN_FILE), { force: true });
|
|
73
|
+
else
|
|
74
|
+
writeFileSync(join(dir, LONG_TOKEN_FILE), held.kept);
|
|
75
|
+
}
|
|
76
|
+
/** The folder's token and its file as they are, to put back; null — the folder holds no token. */
|
|
77
|
+
export function takeLongToken(dir) {
|
|
78
|
+
const token = tokenIn(dir);
|
|
79
|
+
if (token === null)
|
|
80
|
+
return null;
|
|
81
|
+
try {
|
|
82
|
+
return { token, kept: readFileSync(join(dir, LONG_TOKEN_FILE), 'utf8') };
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return { token, kept: null };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Notes that the provider refused the folder's token; false — already noted or no token there. */
|
|
89
|
+
export function noteTokenRefused(dir, at) {
|
|
90
|
+
const known = readLongToken(dir);
|
|
91
|
+
if (known === null || known.refusedAt !== undefined)
|
|
92
|
+
return false;
|
|
93
|
+
writeFileSync(join(dir, LONG_TOKEN_FILE), JSON.stringify({ ...known, refusedAt: at }, null, 2));
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
/** The token no longer signs the folder in: refused by the provider, or past its last day. */
|
|
97
|
+
export function tokenOver(token, now) {
|
|
98
|
+
return token.refusedAt !== undefined || (token.until !== null && Date.parse(token.until) <= now.getTime());
|
|
99
|
+
}
|
|
@@ -84,7 +84,7 @@ export async function guardSettingsEdit(input, config, ask = async () => {
|
|
|
84
84
|
&& paths.basename(account.key) === account.key
|
|
85
85
|
&& targets.some((path) => samePath(path, paths.join(config.accountsDir, account.key, 'settings.json'), platform));
|
|
86
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 “
|
|
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 “This account only”.' : null;
|
|
88
88
|
}
|
|
89
89
|
catch {
|
|
90
90
|
return null;
|
|
@@ -38,6 +38,36 @@ export function editedKeys(folder, written) {
|
|
|
38
38
|
const keys = new Set([...Object.keys(folder), ...Object.keys(written)]);
|
|
39
39
|
return [...keys].filter((key) => !SILENT_KEYS.has(key) && !FOLDER_KEYS.has(key) && comparable(key, folder[key]) !== comparable(key, written[key])).sort();
|
|
40
40
|
}
|
|
41
|
+
/** Longer values are cut: the page shows them in a tip, and a whole `hooks` block would weigh on every state. */
|
|
42
|
+
const SHOWN_VALUE = 2000;
|
|
43
|
+
function shown(value) {
|
|
44
|
+
if (value === undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
const text = JSON.stringify(value);
|
|
47
|
+
return text.length <= SHOWN_VALUE ? text : `${text.slice(0, SHOWN_VALUE - 1)}…`;
|
|
48
|
+
}
|
|
49
|
+
/** What the page shows of an edited key: its value before and after, or for `env` only the names of what moved. */
|
|
50
|
+
export function settingsEdit(key, was, now) {
|
|
51
|
+
if (key === 'env') {
|
|
52
|
+
const before = sharedEnv(was);
|
|
53
|
+
const after = sharedEnv(now);
|
|
54
|
+
const names = [...new Set([...Object.keys(before), ...Object.keys(after)])].sort();
|
|
55
|
+
const differs = (name) => JSON.stringify(before[name]) !== JSON.stringify(after[name]);
|
|
56
|
+
return { key, variables: {
|
|
57
|
+
added: names.filter((name) => !(name in before)),
|
|
58
|
+
removed: names.filter((name) => !(name in after)),
|
|
59
|
+
changed: names.filter((name) => name in before && name in after && differs(name)),
|
|
60
|
+
} };
|
|
61
|
+
}
|
|
62
|
+
const edit = { key };
|
|
63
|
+
const before = shown(was);
|
|
64
|
+
const after = shown(now);
|
|
65
|
+
if (before !== undefined)
|
|
66
|
+
edit.was = before;
|
|
67
|
+
if (after !== undefined)
|
|
68
|
+
edit.now = after;
|
|
69
|
+
return edit;
|
|
70
|
+
}
|
|
41
71
|
/** The transfer of `settings.json` with the account's layer on top and the folder's own edits kept (`docs/accounts.md`). */
|
|
42
72
|
export function planSettings(global, folder, record, discard = new Set()) {
|
|
43
73
|
const file = mergeSettings(global, folder);
|
|
@@ -86,37 +116,48 @@ export class AccountSettings {
|
|
|
86
116
|
return plan.file;
|
|
87
117
|
};
|
|
88
118
|
}
|
|
89
|
-
/** The
|
|
119
|
+
/** The folder edits that would still need a decision at the next transfer. */
|
|
90
120
|
edits(home) {
|
|
121
|
+
return this.changes(home).map((change) => change.key);
|
|
122
|
+
}
|
|
123
|
+
/** `edits` with what each key was and is now. */
|
|
124
|
+
changes(home) {
|
|
91
125
|
const record = this.records.get(home.key);
|
|
92
126
|
if (record === undefined)
|
|
93
127
|
return [];
|
|
94
128
|
const file = join(home.dir, 'settings.json');
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const stat = statSync(file);
|
|
98
|
-
stamp = `${this.version}:${stat.mtimeMs}:${stat.size}`;
|
|
99
|
-
}
|
|
100
|
-
catch {
|
|
129
|
+
const folderStamp = fileStamp(file);
|
|
130
|
+
if (folderStamp === undefined)
|
|
101
131
|
return [];
|
|
102
|
-
|
|
132
|
+
const globalFile = join(this.globalDir, 'settings.json');
|
|
133
|
+
const stamp = `${this.version}:${folderStamp}:${fileStamp(globalFile)}`;
|
|
103
134
|
const cached = this.seen.get(home.key);
|
|
104
135
|
if (cached?.stamp === stamp)
|
|
105
|
-
return cached.
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
this.
|
|
110
|
-
|
|
136
|
+
return cached.changes;
|
|
137
|
+
const read = readJson(file);
|
|
138
|
+
const folder = stripSettingsGuard(read ?? {});
|
|
139
|
+
const written = stripSettingsGuard(record.written);
|
|
140
|
+
const changes = read === undefined ? [] : planSettings(stripSettingsGuard(readJson(globalFile) ?? {}), folder, record, this.discards.get(home.key)).edits.map((key) => settingsEdit(key, written[key], folder[key]));
|
|
141
|
+
this.seen.set(home.key, { stamp, changes });
|
|
142
|
+
return changes;
|
|
111
143
|
}
|
|
112
144
|
/** The keys of the account's own layer. */
|
|
113
145
|
own(account) {
|
|
114
146
|
return Object.keys(this.records.get(account)?.own ?? {}).sort();
|
|
115
147
|
}
|
|
116
|
-
/** Takes effect at the next transfer
|
|
117
|
-
resolve(home,
|
|
148
|
+
/** Every key or none: a key that is no edit any more refuses them all. Takes effect at the next transfer, which the caller starts. */
|
|
149
|
+
resolve(home, keys, choice) {
|
|
150
|
+
const list = typeof keys === 'string' ? [keys] : keys;
|
|
151
|
+
const edits = this.edits(home);
|
|
152
|
+
const missing = list.find((key) => !edits.includes(key));
|
|
153
|
+
if (missing !== undefined)
|
|
154
|
+
throw fail('account.settingsNoEdit', { account: home.key, key: missing });
|
|
155
|
+
for (const key of new Set(list))
|
|
156
|
+
this.resolveOne(home, key, choice);
|
|
157
|
+
}
|
|
158
|
+
resolveOne(home, key, choice) {
|
|
118
159
|
const record = this.records.get(home.key);
|
|
119
|
-
if (record === undefined
|
|
160
|
+
if (record === undefined)
|
|
120
161
|
throw fail('account.settingsNoEdit', { account: home.key, key });
|
|
121
162
|
const value = stripSettingsGuard(readJson(join(home.dir, 'settings.json')) ?? {})[key];
|
|
122
163
|
if (choice === 'discard') {
|
|
@@ -132,7 +173,17 @@ export class AccountSettings {
|
|
|
132
173
|
const global = readJson(file) ?? {};
|
|
133
174
|
setOrDelete(global, key, key === 'env' && value !== undefined ? { ...sharedEnv(value), ...ownVariables(global.env) } : value);
|
|
134
175
|
writeFileSync(file, JSON.stringify(global, null, 2));
|
|
135
|
-
|
|
176
|
+
if (Object.hasOwn(record.own, key))
|
|
177
|
+
this.dropOwn(home, key);
|
|
178
|
+
}
|
|
179
|
+
/** A key Even Keel itself gives the account (EKR-148); takes effect at the next transfer, which the caller starts. */
|
|
180
|
+
setOwn(home, key, value) {
|
|
181
|
+
const folder = stripSettingsGuard(readJson(join(home.dir, 'settings.json')) ?? {});
|
|
182
|
+
const record = this.records.get(home.key);
|
|
183
|
+
// A new folder starts at its current file. In a known folder only this key's edit is acknowledged.
|
|
184
|
+
const written = { ...(record?.written ?? folder) };
|
|
185
|
+
setOrDelete(written, key, folder[key]);
|
|
186
|
+
this.keep(home.key, { written, own: { ...record?.own, [key]: value } });
|
|
136
187
|
}
|
|
137
188
|
/** Takes effect at the next transfer into the folder, which the caller starts. */
|
|
138
189
|
dropOwn(home, key) {
|
|
@@ -176,6 +227,15 @@ function setOrDelete(target, key, value) {
|
|
|
176
227
|
else
|
|
177
228
|
target[key] = value;
|
|
178
229
|
}
|
|
230
|
+
function fileStamp(file) {
|
|
231
|
+
try {
|
|
232
|
+
const stat = statSync(file);
|
|
233
|
+
return `${stat.mtimeMs}:${stat.size}`;
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
return undefined;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
179
239
|
function readJson(file) {
|
|
180
240
|
try {
|
|
181
241
|
const value = JSON.parse(readFileSync(file, 'utf8'));
|
|
@@ -20,17 +20,26 @@ const ONBOARDING_KEYS = ['hasCompletedOnboarding', 'lastOnboardingVersion'];
|
|
|
20
20
|
const LINKED_DIRS = ['agents', 'commands', 'hooks', 'output-styles'];
|
|
21
21
|
const OWN_SKILLS = new Set(['synced', '.trash']);
|
|
22
22
|
export const API_KEY_VARIABLE = 'ANTHROPIC_API_KEY';
|
|
23
|
+
/** The long-lived token of `claude setup-token` (BTN-1005): it makes a long-token account, never shared between folders. */
|
|
24
|
+
export const OAUTH_TOKEN_VARIABLE = 'CLAUDE_CODE_OAUTH_TOKEN';
|
|
23
25
|
const COPIED_FILES = ['CLAUDE.md', join('plugins', 'installed_plugins.json'), join('plugins', 'known_marketplaces.json')];
|
|
24
26
|
/**
|
|
25
|
-
* The global settings win, except the folder's own API key and cloud connection: they are what makes an API
|
|
26
|
-
* account (`docs/accounts.md`). A cloud folder takes none of the cloud's variables from the global
|
|
27
|
+
* The global settings win, except the folder's own API key, long token and cloud connection: they are what makes an API,
|
|
28
|
+
* a long-token or a cloud account (`docs/accounts.md`). A cloud folder takes none of the cloud's variables from the global
|
|
29
|
+
* settings, and no folder takes the global long token.
|
|
27
30
|
*/
|
|
28
31
|
export function mergeSettings(global, folder) {
|
|
29
32
|
const merged = { ...folder, ...global };
|
|
30
33
|
const own = objectOf(folder?.env);
|
|
34
|
+
const globalEnv = Object.fromEntries(Object.entries(objectOf(global.env)).filter(([name]) => name !== OAUTH_TOKEN_VARIABLE));
|
|
35
|
+
if (OAUTH_TOKEN_VARIABLE in objectOf(global.env))
|
|
36
|
+
merged.env = globalEnv;
|
|
31
37
|
const key = own[API_KEY_VARIABLE];
|
|
32
38
|
if (typeof key === 'string')
|
|
33
|
-
merged.env = { ...
|
|
39
|
+
merged.env = { ...globalEnv, [API_KEY_VARIABLE]: key };
|
|
40
|
+
const token = own[OAUTH_TOKEN_VARIABLE];
|
|
41
|
+
if (typeof token === 'string')
|
|
42
|
+
merged.env = { ...globalEnv, [OAUTH_TOKEN_VARIABLE]: token };
|
|
34
43
|
if (cloudOf(own) !== null) {
|
|
35
44
|
const shared = Object.fromEntries(Object.entries(objectOf(merged.env ?? global.env)).filter(([name]) => !isCloudVariable(name)));
|
|
36
45
|
const cloud = Object.fromEntries(Object.entries(own).filter(([name]) => isCloudVariable(name)));
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CLAUDE } from '../claude/name.js';
|
|
2
|
+
import { fail } from '../notice/notice.js';
|
|
3
|
+
import { assertLongToken, restoreLongToken, takeLongToken, writeLongToken } from './longToken.js';
|
|
4
|
+
const reasonOf = (reason) => (reason instanceof Error ? reason.message : String(reason)).slice(0, 500);
|
|
5
|
+
/** The folder with a full sign-in the token is said to be of: a Claude folder that is on no token itself. */
|
|
6
|
+
function sameAccount(homes, key) {
|
|
7
|
+
if (key === undefined || key === null || key === '')
|
|
8
|
+
return undefined;
|
|
9
|
+
const home = homes.find(key);
|
|
10
|
+
if (home === undefined || home.agent !== CLAUDE || homes.longTokenOf(home) !== null)
|
|
11
|
+
throw fail('account.unknown', { key });
|
|
12
|
+
return key;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A subscription account on a long token (BTN-1005): the folder is made, one short turn runs on it, and a refusal
|
|
16
|
+
* removes it again, so no account is added that cannot run a session. `account` — the hub's account a machine's token
|
|
17
|
+
* is of (BTN-1002); `sameAs` may come as null through the link.
|
|
18
|
+
*/
|
|
19
|
+
export async function addTokenAccount(accounts, name, token, sameAs, account) {
|
|
20
|
+
const value = assertLongToken(token);
|
|
21
|
+
const same = sameAccount(accounts.homes, sameAs);
|
|
22
|
+
const home = accounts.homes.addLongToken(name, value, accounts.now(), { ...(same !== undefined && { sameAs: same }), ...(account != null && { account }) });
|
|
23
|
+
try {
|
|
24
|
+
await accounts.check(home);
|
|
25
|
+
}
|
|
26
|
+
catch (reason) {
|
|
27
|
+
await accounts.homes.remove(home);
|
|
28
|
+
throw fail('account.tokenRejected', { reason: reasonOf(reason) });
|
|
29
|
+
}
|
|
30
|
+
return home;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A new token in the folder of a long-token account, its name, roles and pools kept: checked by one short turn, and the
|
|
34
|
+
* old one is put back when the new one is refused. Running sessions go on with the token they started with.
|
|
35
|
+
*/
|
|
36
|
+
export async function replaceToken(accounts, home, token) {
|
|
37
|
+
const value = assertLongToken(token);
|
|
38
|
+
const held = home.global ? null : takeLongToken(home.dir);
|
|
39
|
+
if (held === null)
|
|
40
|
+
throw fail('account.keyNotHeld', { agent: home.agent });
|
|
41
|
+
const known = accounts.homes.longTokenOf(home);
|
|
42
|
+
writeLongToken(home.dir, value, accounts.now(), {
|
|
43
|
+
...(known?.sameAs !== undefined && { sameAs: known.sameAs }),
|
|
44
|
+
...(known?.account !== undefined && { account: known.account }),
|
|
45
|
+
});
|
|
46
|
+
try {
|
|
47
|
+
await accounts.check(home);
|
|
48
|
+
}
|
|
49
|
+
catch (reason) {
|
|
50
|
+
restoreLongToken(home.dir, held);
|
|
51
|
+
throw fail('account.tokenRejected', { reason: reasonOf(reason) });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|