agor-live 0.15.1 → 0.16.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/dist/cli/base-command.js +5 -1
- package/dist/cli/commands/board/add-session.js +5 -1
- package/dist/cli/commands/board/clone.js +5 -1
- package/dist/cli/commands/board/export.js +5 -1
- package/dist/cli/commands/board/import.js +5 -1
- package/dist/cli/commands/board/list.js +5 -1
- package/dist/cli/commands/daemon/sync.d.ts +19 -0
- package/dist/cli/commands/daemon/sync.js +277 -0
- package/dist/cli/commands/mcp/add.js +5 -1
- package/dist/cli/commands/mcp/list.js +5 -1
- package/dist/cli/commands/mcp/remove.js +5 -1
- package/dist/cli/commands/mcp/show.js +5 -1
- package/dist/cli/commands/repo/add-local.js +5 -1
- package/dist/cli/commands/repo/add.js +5 -1
- package/dist/cli/commands/repo/list.js +5 -1
- package/dist/cli/commands/repo/rm.js +5 -1
- package/dist/cli/commands/session/list.js +5 -1
- package/dist/cli/commands/session/load-claude.js +6 -3
- package/dist/cli/commands/user/create.js +6 -8
- package/dist/cli/commands/user/delete.js +5 -1
- package/dist/cli/commands/user/list.js +1 -1
- package/dist/cli/commands/user/update.js +7 -3
- package/dist/cli/commands/worktree/add.js +5 -1
- package/dist/cli/commands/worktree/archive.js +5 -1
- package/dist/cli/commands/worktree/cd.js +5 -1
- package/dist/cli/commands/worktree/env/restart.js +5 -1
- package/dist/cli/commands/worktree/env/start.js +5 -1
- package/dist/cli/commands/worktree/env/status.js +5 -1
- package/dist/cli/commands/worktree/env/stop.js +5 -1
- package/dist/cli/commands/worktree/list.js +5 -1
- package/dist/cli/commands/worktree/rm.js +5 -1
- package/dist/cli/commands/worktree/show.js +5 -1
- package/dist/cli/commands/worktree/unarchive.js +5 -1
- package/dist/cli/commands/worktree/update.js +5 -1
- package/dist/core/agentic-tool-1L19ixPC.d.ts +129 -0
- package/dist/core/agentic-tool-3oiAj9Lg.d.cts +129 -0
- package/dist/core/api/index.cjs +16 -3
- package/dist/core/api/index.d.cts +29 -13
- package/dist/core/api/index.d.ts +29 -13
- package/dist/core/api/index.js +15 -3
- package/dist/core/artifact-B5MFR79G.d.ts +117 -0
- package/dist/core/artifact-Bi-1jifF.d.cts +117 -0
- package/dist/core/{board-B8ItLtRy.d.cts → board-B9Xnux_i.d.ts} +67 -9
- package/dist/core/{board-DoB0I5Bf.d.ts → board-CPZGf5wF.d.cts} +67 -9
- package/dist/core/{board-comment-D9NA4gOJ.d.cts → board-comment-BQKnob6r.d.cts} +1 -1
- package/dist/core/{board-comment-rH4c6eVl.d.ts → board-comment-BoDqwrnL.d.ts} +1 -1
- package/dist/core/claude/index.cjs +438 -117
- package/dist/core/claude/index.d.cts +3 -3
- package/dist/core/claude/index.d.ts +3 -3
- package/dist/core/claude/index.js +446 -114
- package/dist/core/{client-D9Kijj2K.d.cts → client-BC_18M7T.d.cts} +1267 -133
- package/dist/core/{client-BLFnRbF1.d.ts → client-HEOUNaCs.d.ts} +1267 -133
- package/dist/core/config/browser.cjs +4 -2
- package/dist/core/config/browser.d.cts +16 -4
- package/dist/core/config/browser.d.ts +16 -4
- package/dist/core/config/browser.js +3 -2
- package/dist/core/config/index.cjs +647 -106
- package/dist/core/config/index.d.cts +230 -12
- package/dist/core/config/index.d.ts +230 -12
- package/dist/core/config/index.js +642 -103
- package/dist/core/{config-manager-_JsUrFp_.d.cts → config-manager-DK1LMXEc.d.cts} +9 -2
- package/dist/core/{config-manager-D0Yshxlj.d.ts → config-manager-YrO9mG5j.d.ts} +9 -2
- package/dist/core/config-services-CuhBWSs_.d.cts +183 -0
- package/dist/core/config-services-DrHSgUEm.d.ts +183 -0
- package/dist/core/db/index.cjs +1209 -449
- package/dist/core/db/index.d.cts +1319 -106
- package/dist/core/db/index.d.ts +1319 -106
- package/dist/core/db/index.js +1155 -390
- package/dist/core/db/session-guard.d.cts +8 -7
- package/dist/core/db/session-guard.d.ts +8 -7
- package/dist/core/drizzle/postgres/0020_salty_marten_broadcloak.sql +3 -0
- package/dist/core/drizzle/postgres/0021_far_masked_marvel.sql +23 -0
- package/dist/core/drizzle/postgres/0022_add_user_api_keys.sql +14 -0
- package/dist/core/drizzle/postgres/0023_tough_magik.sql +11 -0
- package/dist/core/drizzle/postgres/0029_rename_owner_to_superadmin.sql +7 -0
- package/dist/core/drizzle/postgres/meta/0020_snapshot.json +2692 -0
- package/dist/core/drizzle/postgres/meta/0021_snapshot.json +2863 -0
- package/dist/core/drizzle/postgres/meta/0022_snapshot.json +2959 -0
- package/dist/core/drizzle/postgres/meta/0023_snapshot.json +3006 -0
- package/dist/core/drizzle/postgres/meta/_journal.json +35 -0
- package/dist/core/drizzle/sqlite/0029_rename_owner_to_superadmin.sql +8 -0
- package/dist/core/drizzle/sqlite/0030_flat_mantis.sql +3 -0
- package/dist/core/drizzle/sqlite/0031_breezy_speed_demon.sql +23 -0
- package/dist/core/drizzle/sqlite/0032_add_user_api_keys.sql +13 -0
- package/dist/core/drizzle/sqlite/0033_dapper_thing.sql +34 -0
- package/dist/core/drizzle/sqlite/0034_add_session_to_others_can_check.sql +72 -0
- package/dist/core/drizzle/sqlite/meta/0030_snapshot.json +2126 -0
- package/dist/core/drizzle/sqlite/meta/0031_snapshot.json +2279 -0
- package/dist/core/drizzle/sqlite/meta/0032_snapshot.json +2359 -0
- package/dist/core/drizzle/sqlite/meta/0033_snapshot.json +2401 -0
- package/dist/core/drizzle/sqlite/meta/_journal.json +42 -0
- package/dist/core/environment/variable-resolver.d.cts +2 -2
- package/dist/core/environment/variable-resolver.d.ts +2 -2
- package/dist/core/feathers/index.cjs +2 -0
- package/dist/core/feathers/index.d.cts +1 -1
- package/dist/core/feathers/index.d.ts +1 -1
- package/dist/core/feathers/index.js +2 -1
- package/dist/core/{feathers-Cg1J1efu.d.ts → feathers-CYAHFZ05.d.cts} +2 -2
- package/dist/core/{feathers-Be7aUDva.d.cts → feathers-CzuSOZgY.d.ts} +2 -2
- package/dist/core/gateway/index.cjs +161 -17
- package/dist/core/gateway/index.d.cts +73 -10
- package/dist/core/gateway/index.d.ts +73 -10
- package/dist/core/gateway/index.js +160 -17
- package/dist/core/{gateway-DTy9-ZKL.d.ts → gateway-Ci8LcUxK.d.ts} +27 -4
- package/dist/core/{gateway-V6KNZUEh.d.cts → gateway-gHbaS6qt.d.cts} +27 -4
- package/dist/core/git/index.cjs +0 -1
- package/dist/core/git/index.d.cts +9 -2
- package/dist/core/git/index.d.ts +9 -2
- package/dist/core/git/index.js +0 -1
- package/dist/core/{id-BwPJtWxW.d.cts → id-Cv3ntaTJ.d.cts} +22 -1
- package/dist/core/{id-BwPJtWxW.d.ts → id-Cv3ntaTJ.d.ts} +22 -1
- package/dist/core/index.cjs +1747 -536
- package/dist/core/index.d.cts +23 -19
- package/dist/core/index.d.ts +23 -19
- package/dist/core/index.js +1691 -511
- package/dist/core/lib/feathers-validation.cjs +10 -2
- package/dist/core/lib/feathers-validation.d.cts +11 -3
- package/dist/core/lib/feathers-validation.d.ts +11 -3
- package/dist/core/lib/feathers-validation.js +9 -2
- package/dist/core/mcp/index.cjs +158 -12
- package/dist/core/mcp/index.d.cts +2 -2
- package/dist/core/mcp/index.d.ts +2 -2
- package/dist/core/mcp/index.js +158 -12
- package/dist/core/{mcp-DXLeQBg4.d.cts → mcp-CtC1DFEm.d.cts} +1 -1
- package/dist/core/{mcp-Bw8QAZjb.d.ts → mcp-VhU-PMHo.d.ts} +1 -1
- package/dist/core/{message-kDoxvdzV.d.cts → message-CbD99EwO.d.cts} +34 -3
- package/dist/core/{message-C9XTt2nM.d.ts → message-Cwhx2ItQ.d.ts} +34 -3
- package/dist/core/models/index.cjs +21 -4
- package/dist/core/models/index.d.cts +29 -5
- package/dist/core/models/index.d.ts +29 -5
- package/dist/core/models/index.js +21 -4
- package/dist/core/package.json +5 -0
- package/dist/core/permissions/index.d.cts +2 -2
- package/dist/core/permissions/index.d.ts +2 -2
- package/dist/core/{worktree-CaN2rWHR.d.ts → repo-CcvhnJDf.d.cts} +177 -170
- package/dist/core/{worktree-C9dSOqZc.d.cts → repo-j12tCmyK.d.ts} +177 -170
- package/dist/core/sdk/index.d.cts +1 -1
- package/dist/core/sdk/index.d.ts +1 -1
- package/dist/core/seed/index.cjs +650 -213
- package/dist/core/seed/index.d.cts +1 -1
- package/dist/core/seed/index.d.ts +1 -1
- package/dist/core/seed/index.js +651 -203
- package/dist/core/{session-sk7Brc9j.d.ts → session-Bw8_FN2l.d.ts} +59 -113
- package/dist/core/{session-AK6sM0bA.d.cts → session-DEU5FS0N.d.cts} +59 -113
- package/dist/core/{session-guard-DapC7XBf.d.ts → session-guard-BjHxMpvV.d.cts} +7 -3
- package/dist/core/{session-guard-CdRfdFNG.d.cts → session-guard-CJ7sfOF1.d.ts} +7 -3
- package/dist/core/{task-C2jNGWSt.d.ts → task-CKHC1gPj.d.ts} +1 -1
- package/dist/core/{task-Cw2N74jk.d.cts → task-DCPYEXlG.d.cts} +1 -1
- package/dist/core/templates/session-context.d.cts +5 -4
- package/dist/core/templates/session-context.d.ts +5 -4
- package/dist/core/tools/mcp/jwt-auth.d.cts +2 -2
- package/dist/core/tools/mcp/jwt-auth.d.ts +2 -2
- package/dist/core/tools/mcp/oauth-mcp-transport.cjs +72 -17
- package/dist/core/tools/mcp/oauth-mcp-transport.d.cts +46 -11
- package/dist/core/tools/mcp/oauth-mcp-transport.d.ts +46 -11
- package/dist/core/tools/mcp/oauth-mcp-transport.js +70 -17
- package/dist/core/types/index.cjs +235 -2
- package/dist/core/types/index.d.cts +16 -13
- package/dist/core/types/index.d.ts +16 -13
- package/dist/core/types/index.js +212 -1
- package/dist/core/{types-Cir-hbkf.d.ts → types-BE6DTpRe.d.cts} +47 -4
- package/dist/core/{types-Cir-hbkf.d.cts → types-BvYoeNhO.d.ts} +47 -4
- package/dist/core/unix/index.cjs +621 -182
- package/dist/core/unix/index.d.cts +8 -7
- package/dist/core/unix/index.d.ts +8 -7
- package/dist/core/unix/index.js +622 -172
- package/dist/core/{user-nwb8amML.d.ts → user-BpKIlt04.d.cts} +40 -6
- package/dist/core/{user-D5SSlZZa.d.cts → user-pO3lB_da.d.ts} +40 -6
- package/dist/core/utils/board-placement.cjs +120 -0
- package/dist/core/utils/board-placement.d.cts +63 -0
- package/dist/core/utils/board-placement.d.ts +63 -0
- package/dist/core/utils/board-placement.js +87 -0
- package/dist/core/utils/permission-mode-mapper.d.cts +3 -2
- package/dist/core/utils/permission-mode-mapper.d.ts +3 -2
- package/dist/core/utils/url.cjs +18 -0
- package/dist/core/utils/url.d.cts +13 -2
- package/dist/core/utils/url.d.ts +13 -2
- package/dist/core/utils/url.js +17 -0
- package/dist/daemon/auth/api-key-strategy.d.ts +28 -0
- package/dist/daemon/auth/api-key-strategy.js +61 -0
- package/dist/daemon/auth/session-token-strategy.js +3 -2
- package/dist/daemon/declarations.d.ts +6 -1
- package/dist/daemon/executor-tracking.d.ts +27 -0
- package/dist/daemon/executor-tracking.js +40 -0
- package/dist/daemon/index.js +13552 -11154
- package/dist/daemon/mcp/resolve-ids.d.ts +34 -0
- package/dist/daemon/mcp/resolve-ids.js +48 -0
- package/dist/daemon/mcp/server.d.ts +12 -4
- package/dist/daemon/mcp/server.js +1111 -310
- package/dist/daemon/mcp/tools/analytics.js +37 -5
- package/dist/daemon/mcp/tools/artifacts.d.ts +19 -0
- package/dist/daemon/mcp/tools/artifacts.js +14060 -0
- package/dist/daemon/mcp/tools/boards.js +92 -11
- package/dist/daemon/mcp/tools/card-types.js +20 -2
- package/dist/daemon/mcp/tools/cards.js +42 -10
- package/dist/daemon/mcp/tools/environment.js +19 -1
- package/dist/daemon/mcp/tools/mcp-servers.js +53 -126
- package/dist/daemon/mcp/tools/messages.js +34 -4
- package/dist/daemon/mcp/tools/repos.js +19 -1
- package/dist/daemon/mcp/tools/search.js +59 -4
- package/dist/daemon/mcp/tools/sessions.js +397 -53
- package/dist/daemon/mcp/tools/tasks.js +28 -4
- package/dist/daemon/mcp/tools/users.js +30 -10
- package/dist/daemon/mcp/tools/worktrees.js +235 -46
- package/dist/daemon/oauth-cache.d.ts +50 -0
- package/dist/daemon/oauth-cache.js +134 -0
- package/dist/daemon/register-hooks.d.ts +40 -0
- package/dist/daemon/register-hooks.js +2390 -0
- package/dist/daemon/register-routes.d.ts +49 -0
- package/dist/daemon/register-routes.js +20829 -0
- package/dist/daemon/register-services.d.ts +53 -0
- package/dist/daemon/register-services.js +8290 -0
- package/dist/daemon/services/artifacts.d.ts +131 -0
- package/dist/daemon/services/artifacts.js +662 -0
- package/dist/daemon/services/boards.d.ts +8 -0
- package/dist/daemon/services/boards.js +43 -0
- package/dist/daemon/services/cards.js +12 -27
- package/dist/daemon/services/config.d.ts +3 -0
- package/dist/daemon/services/config.js +7 -1
- package/dist/daemon/services/context.js +4 -17
- package/dist/daemon/services/file.js +4 -17
- package/dist/daemon/services/gateway.d.ts +2 -0
- package/dist/daemon/services/gateway.js +114 -2
- package/dist/daemon/services/health-monitor.d.ts +2 -2
- package/dist/daemon/services/repos.d.ts +4 -5
- package/dist/daemon/services/repos.js +63 -8
- package/dist/daemon/services/session-mcp-servers.d.ts +1 -1
- package/dist/daemon/services/sessions.d.ts +15 -4
- package/dist/daemon/services/sessions.js +6 -8
- package/dist/daemon/services/tasks.d.ts +6 -0
- package/dist/daemon/services/tasks.js +123 -1
- package/dist/daemon/services/user-api-keys.d.ts +28 -0
- package/dist/daemon/services/user-api-keys.js +54 -0
- package/dist/daemon/services/users.d.ts +3 -3
- package/dist/daemon/services/users.js +5 -4
- package/dist/daemon/services/worktree-owners.d.ts +2 -0
- package/dist/daemon/services/worktree-owners.js +39 -24
- package/dist/daemon/services/worktrees.d.ts +5 -1
- package/dist/daemon/services/worktrees.js +15 -0
- package/dist/daemon/setup/cors.d.ts +17 -7
- package/dist/daemon/setup/cors.js +57 -24
- package/dist/daemon/setup/index.d.ts +1 -0
- package/dist/daemon/setup/index.js +57 -24
- package/dist/daemon/setup/service-tiers.d.ts +45 -0
- package/dist/daemon/setup/service-tiers.js +111 -0
- package/dist/daemon/setup/socketio.d.ts +1 -0
- package/dist/daemon/startup.d.ts +27 -0
- package/dist/daemon/startup.js +750 -0
- package/dist/daemon/strategies/anonymous.js +2 -1
- package/dist/daemon/utils/authorization.d.ts +12 -4
- package/dist/daemon/utils/authorization.js +31 -15
- package/dist/daemon/utils/worktree-authorization.d.ts +66 -15
- package/dist/daemon/utils/worktree-authorization.js +127 -33
- package/dist/executor/db/feathers-repositories.d.ts +0 -1
- package/dist/executor/db/feathers-repositories.d.ts.map +1 -1
- package/dist/executor/db/feathers-repositories.js +0 -2
- package/dist/executor/handlers/sdk/base-executor.d.ts +6 -0
- package/dist/executor/handlers/sdk/base-executor.d.ts.map +1 -1
- package/dist/executor/handlers/sdk/base-executor.js +39 -12
- package/dist/executor/handlers/sdk/claude.d.ts.map +1 -1
- package/dist/executor/handlers/sdk/claude.js +0 -3
- package/dist/executor/handlers/sdk/copilot.d.ts.map +1 -1
- package/dist/executor/handlers/sdk/copilot.js +0 -1
- package/dist/executor/index.d.ts.map +1 -1
- package/dist/executor/index.js +18 -18
- package/dist/executor/sdk-handlers/base/diff-enrichment.d.ts +56 -0
- package/dist/executor/sdk-handlers/base/diff-enrichment.d.ts.map +1 -0
- package/dist/executor/sdk-handlers/base/diff-enrichment.js +329 -0
- package/dist/executor/sdk-handlers/claude/claude-tool.d.ts +34 -38
- package/dist/executor/sdk-handlers/claude/claude-tool.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/claude/claude-tool.js +207 -192
- package/dist/executor/sdk-handlers/claude/message-builder.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/claude/message-builder.js +6 -4
- package/dist/executor/sdk-handlers/claude/message-processor.d.ts +44 -1
- package/dist/executor/sdk-handlers/claude/message-processor.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/claude/message-processor.js +153 -4
- package/dist/executor/sdk-handlers/claude/permissions/permission-hooks.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/claude/permissions/permission-hooks.js +0 -3
- package/dist/executor/sdk-handlers/claude/prompt-service.d.ts +1 -3
- package/dist/executor/sdk-handlers/claude/prompt-service.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/claude/prompt-service.js +34 -45
- package/dist/executor/sdk-handlers/claude/query-builder.d.ts +7 -8
- package/dist/executor/sdk-handlers/claude/query-builder.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/claude/query-builder.js +34 -15
- package/dist/executor/sdk-handlers/codex/codex-tool.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/codex/codex-tool.js +3 -0
- package/dist/executor/sdk-handlers/copilot/permission-mapper.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/copilot/permission-mapper.js +0 -1
- package/dist/executor/sdk-handlers/gemini/gemini-tool.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/gemini/gemini-tool.js +5 -0
- package/dist/executor/sdk-handlers/opencode/opencode-tool.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/opencode/opencode-tool.js +29 -39
- package/dist/executor/types.d.ts +0 -1
- package/dist/executor/types.d.ts.map +1 -1
- package/dist/ui/assets/{_basePickBy-Bot5PTMf.js → _basePickBy-By_woBZB.js} +1 -1
- package/dist/ui/assets/_basePickBy-By_woBZB.js.gz +0 -0
- package/dist/ui/assets/{_baseUniq-BiadTt1m.js → _baseUniq-C2jLj-Al.js} +1 -1
- package/dist/ui/assets/_baseUniq-C2jLj-Al.js.gz +0 -0
- package/dist/ui/assets/{arc-ChDTFPx2.js → arc-DADMFVbt.js} +1 -1
- package/dist/ui/assets/arc-DADMFVbt.js.gz +0 -0
- package/dist/ui/assets/{architectureDiagram-VXUJARFQ-BD-EJNP6.js → architectureDiagram-VXUJARFQ-rNJ5lYJQ.js} +1 -1
- package/dist/ui/assets/architectureDiagram-VXUJARFQ-rNJ5lYJQ.js.gz +0 -0
- package/dist/ui/assets/base-80a1f760-BVsv_T1S.js +1 -0
- package/dist/ui/assets/{blockDiagram-VD42YOAC-DAlkiBRw.js → blockDiagram-VD42YOAC-CezN66iB.js} +1 -1
- package/dist/ui/assets/blockDiagram-VD42YOAC-CezN66iB.js.gz +0 -0
- package/dist/ui/assets/{c4Diagram-YG6GDRKO-DxoeLyzn.js → c4Diagram-YG6GDRKO-Dze59YuK.js} +1 -1
- package/dist/ui/assets/{c4Diagram-YG6GDRKO-DxoeLyzn.js.gz → c4Diagram-YG6GDRKO-Dze59YuK.js.gz} +0 -0
- package/dist/ui/assets/channel-B2nSdT47.js +1 -0
- package/dist/ui/assets/{chunk-4BX2VUAB-C1SxH1q6.js → chunk-4BX2VUAB-CXL-V_XA.js} +1 -1
- package/dist/ui/assets/{chunk-55IACEB6-mzz4nQTH.js → chunk-55IACEB6-CI3h0xTl.js} +1 -1
- package/dist/ui/assets/{chunk-B4BG7PRW-BYc7C1Yf.js → chunk-B4BG7PRW-CFohiEqO.js} +1 -1
- package/dist/ui/assets/chunk-B4BG7PRW-CFohiEqO.js.gz +0 -0
- package/dist/ui/assets/{chunk-DI55MBZ5-BGX5IQ0D.js → chunk-DI55MBZ5-BbF4fGKj.js} +1 -1
- package/dist/ui/assets/chunk-DI55MBZ5-BbF4fGKj.js.gz +0 -0
- package/dist/ui/assets/{chunk-FMBD7UC4-bKSuA5NL.js → chunk-FMBD7UC4-C5x6cpDg.js} +1 -1
- package/dist/ui/assets/{chunk-QN33PNHL-BD4Z8QU9.js → chunk-QN33PNHL-CEDiC29y.js} +1 -1
- package/dist/ui/assets/{chunk-QZHKN3VN-suaJ5j2D.js → chunk-QZHKN3VN-DPo28cCF.js} +1 -1
- package/dist/ui/assets/{chunk-TZMSLE5B-CscopKPs.js → chunk-TZMSLE5B-C94jSlIG.js} +1 -1
- package/dist/ui/assets/chunk-TZMSLE5B-C94jSlIG.js.gz +0 -0
- package/dist/ui/assets/classDiagram-2ON5EDUG-lwQJA5v0.js +1 -0
- package/dist/ui/assets/classDiagram-v2-WZHVMYZB-lwQJA5v0.js +1 -0
- package/dist/ui/assets/clone-DmZ98vg9.js +1 -0
- package/dist/ui/assets/consoleHook-59e792cb-cpS6JVM4.js +2 -0
- package/dist/ui/assets/consoleHook-59e792cb-cpS6JVM4.js.gz +0 -0
- package/dist/ui/assets/{cose-bilkent-S5V4N54A-xHv-ZHO9.js → cose-bilkent-S5V4N54A-CcoEg_Ct.js} +1 -1
- package/dist/ui/assets/cose-bilkent-S5V4N54A-CcoEg_Ct.js.gz +0 -0
- package/dist/ui/assets/{dagre-6UL2VRFP-CDDS4Pwv.js → dagre-6UL2VRFP-DWAyqs2B.js} +1 -1
- package/dist/ui/assets/dagre-6UL2VRFP-DWAyqs2B.js.gz +0 -0
- package/dist/ui/assets/{diagram-PSM6KHXK-Cf2uu4fz.js → diagram-PSM6KHXK-C7J2MNfc.js} +1 -1
- package/dist/ui/assets/diagram-PSM6KHXK-C7J2MNfc.js.gz +0 -0
- package/dist/ui/assets/{diagram-QEK2KX5R-QWhFFu_e.js → diagram-QEK2KX5R-6KZjqziN.js} +1 -1
- package/dist/ui/assets/diagram-QEK2KX5R-6KZjqziN.js.gz +0 -0
- package/dist/ui/assets/{diagram-S2PKOQOG-DxnCZpoP.js → diagram-S2PKOQOG-DIL01325.js} +1 -1
- package/dist/ui/assets/diagram-S2PKOQOG-DIL01325.js.gz +0 -0
- package/dist/ui/assets/{erDiagram-Q2GNP2WA-CSYL-aff.js → erDiagram-Q2GNP2WA-D5j4CetG.js} +1 -1
- package/dist/ui/assets/erDiagram-Q2GNP2WA-D5j4CetG.js.gz +0 -0
- package/dist/ui/assets/{flowDiagram-NV44I4VS-CJdeNjL8.js → flowDiagram-NV44I4VS-Bxx2iEi-.js} +1 -1
- package/dist/ui/assets/flowDiagram-NV44I4VS-Bxx2iEi-.js.gz +0 -0
- package/dist/ui/assets/{ganttDiagram-LVOFAZNH-VpQo6xQp.js → ganttDiagram-LVOFAZNH-BtBi1ZfT.js} +1 -1
- package/dist/ui/assets/ganttDiagram-LVOFAZNH-BtBi1ZfT.js.gz +0 -0
- package/dist/ui/assets/{gitGraphDiagram-NY62KEGX-BJpArTNa.js → gitGraphDiagram-NY62KEGX-CY1TKvzA.js} +1 -1
- package/dist/ui/assets/gitGraphDiagram-NY62KEGX-CY1TKvzA.js.gz +0 -0
- package/dist/ui/assets/{graph-CgflqCqF.js → graph-DC6eH7AX.js} +1 -1
- package/dist/ui/assets/graph-DC6eH7AX.js.gz +0 -0
- package/dist/ui/assets/index-599aeaf7-Dh_oObwY.js +16 -0
- package/dist/ui/assets/index-599aeaf7-Dh_oObwY.js.gz +0 -0
- package/dist/ui/assets/{index-BjxbtAmt.css → index-Cm_lkBJT.css} +1 -1
- package/dist/ui/assets/index-Cm_lkBJT.css.gz +0 -0
- package/dist/ui/assets/index-CxWOjjRu.js +1 -0
- package/dist/ui/assets/index-CxWOjjRu.js.gz +0 -0
- package/dist/ui/assets/{index-CquDvxQt.js → index-DJLnZ-9H.js} +1010 -270
- package/dist/ui/assets/index-DJLnZ-9H.js.gz +0 -0
- package/dist/ui/assets/index-DQn7RJ8z.js +4 -0
- package/dist/ui/assets/index-DQn7RJ8z.js.gz +0 -0
- package/dist/ui/assets/{infoDiagram-ER5ION4S-BaUlLKe-.js → infoDiagram-ER5ION4S-COpJ37pc.js} +1 -1
- package/dist/ui/assets/{journeyDiagram-XKPGCS4Q-DKDR94af.js → journeyDiagram-XKPGCS4Q-CpODBkng.js} +1 -1
- package/dist/ui/assets/journeyDiagram-XKPGCS4Q-CpODBkng.js.gz +0 -0
- package/dist/ui/assets/{kanban-definition-3W4ZIXB7-C1QCVo4j.js → kanban-definition-3W4ZIXB7-DWShJ5Su.js} +1 -1
- package/dist/ui/assets/kanban-definition-3W4ZIXB7-DWShJ5Su.js.gz +0 -0
- package/dist/ui/assets/{layout-BIX2oMtR.js → layout-ttMTfXMb.js} +1 -1
- package/dist/ui/assets/layout-ttMTfXMb.js.gz +0 -0
- package/dist/ui/assets/{linear-3ftczdqe.js → linear-DD8VTncp.js} +1 -1
- package/dist/ui/assets/linear-DD8VTncp.js.gz +0 -0
- package/dist/ui/assets/{mermaid.core-D-K-DYGP.js → mermaid.core-BlvxruUX.js} +5 -5
- package/dist/ui/assets/mermaid.core-BlvxruUX.js.gz +0 -0
- package/dist/ui/assets/{mindmap-definition-VGOIOE7T-DXjgGAyc.js → mindmap-definition-VGOIOE7T-CR0ESdqM.js} +1 -1
- package/dist/ui/assets/mindmap-definition-VGOIOE7T-CR0ESdqM.js.gz +0 -0
- package/dist/ui/assets/{pieDiagram-ADFJNKIX-DBmSRQku.js → pieDiagram-ADFJNKIX-B94eVYhY.js} +1 -1
- package/dist/ui/assets/pieDiagram-ADFJNKIX-B94eVYhY.js.gz +0 -0
- package/dist/ui/assets/{quadrantDiagram-AYHSOK5B-CvT5fhC1.js → quadrantDiagram-AYHSOK5B-C4tNKfCm.js} +1 -1
- package/dist/ui/assets/quadrantDiagram-AYHSOK5B-C4tNKfCm.js.gz +0 -0
- package/dist/ui/assets/{requirementDiagram-UZGBJVZJ-CB3zyFoP.js → requirementDiagram-UZGBJVZJ-CuG3A95Q.js} +1 -1
- package/dist/ui/assets/requirementDiagram-UZGBJVZJ-CuG3A95Q.js.gz +0 -0
- package/dist/ui/assets/{sankeyDiagram-TZEHDZUN-CCl6krK4.js → sankeyDiagram-TZEHDZUN-BCfc7mLC.js} +1 -1
- package/dist/ui/assets/sankeyDiagram-TZEHDZUN-BCfc7mLC.js.gz +0 -0
- package/dist/ui/assets/{sequenceDiagram-WL72ISMW-DDjQhjCG.js → sequenceDiagram-WL72ISMW-D8tVuIkx.js} +1 -1
- package/dist/ui/assets/sequenceDiagram-WL72ISMW-D8tVuIkx.js.gz +0 -0
- package/dist/ui/assets/{stateDiagram-FKZM4ZOC-DsRmveuj.js → stateDiagram-FKZM4ZOC-DvM8so2A.js} +1 -1
- package/dist/ui/assets/stateDiagram-FKZM4ZOC-DvM8so2A.js.gz +0 -0
- package/dist/ui/assets/stateDiagram-v2-4FDKWEC3-kQ-gZX7K.js +1 -0
- package/dist/ui/assets/{timeline-definition-IT6M3QCI-ZZyF9jEo.js → timeline-definition-IT6M3QCI-CP2O8vqw.js} +1 -1
- package/dist/ui/assets/timeline-definition-IT6M3QCI-CP2O8vqw.js.gz +0 -0
- package/dist/ui/assets/{treemap-KMMF4GRG--6k63E1P.js → treemap-KMMF4GRG-SGJAEegj.js} +1 -1
- package/dist/ui/assets/treemap-KMMF4GRG-SGJAEegj.js.gz +0 -0
- package/dist/ui/assets/{xychartDiagram-PRI3JC2R-DpvEuXwx.js → xychartDiagram-PRI3JC2R-CpwYBSmP.js} +1 -1
- package/dist/ui/assets/xychartDiagram-PRI3JC2R-CpwYBSmP.js.gz +0 -0
- package/dist/ui/index.html +2 -2
- package/package.json +3 -2
- package/dist/ui/assets/_basePickBy-Bot5PTMf.js.gz +0 -0
- package/dist/ui/assets/_baseUniq-BiadTt1m.js.gz +0 -0
- package/dist/ui/assets/arc-ChDTFPx2.js.gz +0 -0
- package/dist/ui/assets/architectureDiagram-VXUJARFQ-BD-EJNP6.js.gz +0 -0
- package/dist/ui/assets/blockDiagram-VD42YOAC-DAlkiBRw.js.gz +0 -0
- package/dist/ui/assets/channel-ektqaOu4.js +0 -1
- package/dist/ui/assets/chunk-B4BG7PRW-BYc7C1Yf.js.gz +0 -0
- package/dist/ui/assets/chunk-DI55MBZ5-BGX5IQ0D.js.gz +0 -0
- package/dist/ui/assets/chunk-TZMSLE5B-CscopKPs.js.gz +0 -0
- package/dist/ui/assets/classDiagram-2ON5EDUG-h7au4VHy.js +0 -1
- package/dist/ui/assets/classDiagram-v2-WZHVMYZB-h7au4VHy.js +0 -1
- package/dist/ui/assets/clone-ubO55Q5e.js +0 -1
- package/dist/ui/assets/cose-bilkent-S5V4N54A-xHv-ZHO9.js.gz +0 -0
- package/dist/ui/assets/dagre-6UL2VRFP-CDDS4Pwv.js.gz +0 -0
- package/dist/ui/assets/diagram-PSM6KHXK-Cf2uu4fz.js.gz +0 -0
- package/dist/ui/assets/diagram-QEK2KX5R-QWhFFu_e.js.gz +0 -0
- package/dist/ui/assets/diagram-S2PKOQOG-DxnCZpoP.js.gz +0 -0
- package/dist/ui/assets/erDiagram-Q2GNP2WA-CSYL-aff.js.gz +0 -0
- package/dist/ui/assets/flowDiagram-NV44I4VS-CJdeNjL8.js.gz +0 -0
- package/dist/ui/assets/ganttDiagram-LVOFAZNH-VpQo6xQp.js.gz +0 -0
- package/dist/ui/assets/gitGraphDiagram-NY62KEGX-BJpArTNa.js.gz +0 -0
- package/dist/ui/assets/graph-CgflqCqF.js.gz +0 -0
- package/dist/ui/assets/index-BjxbtAmt.css.gz +0 -0
- package/dist/ui/assets/index-CquDvxQt.js.gz +0 -0
- package/dist/ui/assets/journeyDiagram-XKPGCS4Q-DKDR94af.js.gz +0 -0
- package/dist/ui/assets/kanban-definition-3W4ZIXB7-C1QCVo4j.js.gz +0 -0
- package/dist/ui/assets/layout-BIX2oMtR.js.gz +0 -0
- package/dist/ui/assets/linear-3ftczdqe.js.gz +0 -0
- package/dist/ui/assets/mermaid.core-D-K-DYGP.js.gz +0 -0
- package/dist/ui/assets/mindmap-definition-VGOIOE7T-DXjgGAyc.js.gz +0 -0
- package/dist/ui/assets/pieDiagram-ADFJNKIX-DBmSRQku.js.gz +0 -0
- package/dist/ui/assets/quadrantDiagram-AYHSOK5B-CvT5fhC1.js.gz +0 -0
- package/dist/ui/assets/requirementDiagram-UZGBJVZJ-CB3zyFoP.js.gz +0 -0
- package/dist/ui/assets/sankeyDiagram-TZEHDZUN-CCl6krK4.js.gz +0 -0
- package/dist/ui/assets/sequenceDiagram-WL72ISMW-DDjQhjCG.js.gz +0 -0
- package/dist/ui/assets/stateDiagram-FKZM4ZOC-DsRmveuj.js.gz +0 -0
- package/dist/ui/assets/stateDiagram-v2-4FDKWEC3-BUm_20Sg.js +0 -1
- package/dist/ui/assets/timeline-definition-IT6M3QCI-ZZyF9jEo.js.gz +0 -0
- package/dist/ui/assets/treemap-KMMF4GRG--6k63E1P.js.gz +0 -0
- package/dist/ui/assets/xychartDiagram-PRI3JC2R-DpvEuXwx.js.gz +0 -0
package/dist/cli/base-command.js
CHANGED
|
@@ -55,7 +55,7 @@ var init_auth = __esm({
|
|
|
55
55
|
|
|
56
56
|
// src/base-command.ts
|
|
57
57
|
init_auth();
|
|
58
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
58
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
59
59
|
import { getDaemonUrl } from "@agor/core/config";
|
|
60
60
|
import { Command } from "@oclif/core";
|
|
61
61
|
import chalk from "chalk";
|
|
@@ -75,6 +75,10 @@ var BaseCommand = class extends Command {
|
|
|
75
75
|
);
|
|
76
76
|
this.exit(1);
|
|
77
77
|
}
|
|
78
|
+
const apiKey = getApiKeyFromEnv();
|
|
79
|
+
if (apiKey) {
|
|
80
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
81
|
+
}
|
|
78
82
|
const client = await createRestClient(this.daemonUrl);
|
|
79
83
|
const storedAuth = await loadToken();
|
|
80
84
|
if (storedAuth) {
|
|
@@ -60,7 +60,7 @@ import chalk2 from "chalk";
|
|
|
60
60
|
|
|
61
61
|
// src/base-command.ts
|
|
62
62
|
init_auth();
|
|
63
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
63
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
64
64
|
import { getDaemonUrl } from "@agor/core/config";
|
|
65
65
|
import { Command } from "@oclif/core";
|
|
66
66
|
import chalk from "chalk";
|
|
@@ -80,6 +80,10 @@ var BaseCommand = class extends Command {
|
|
|
80
80
|
);
|
|
81
81
|
this.exit(1);
|
|
82
82
|
}
|
|
83
|
+
const apiKey = getApiKeyFromEnv();
|
|
84
|
+
if (apiKey) {
|
|
85
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
86
|
+
}
|
|
83
87
|
const client = await createRestClient(this.daemonUrl);
|
|
84
88
|
const storedAuth = await loadToken();
|
|
85
89
|
if (storedAuth) {
|
|
@@ -58,7 +58,7 @@ import { Args } from "@oclif/core";
|
|
|
58
58
|
|
|
59
59
|
// src/base-command.ts
|
|
60
60
|
init_auth();
|
|
61
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
61
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
62
62
|
import { getDaemonUrl } from "@agor/core/config";
|
|
63
63
|
import { Command } from "@oclif/core";
|
|
64
64
|
import chalk from "chalk";
|
|
@@ -78,6 +78,10 @@ var BaseCommand = class extends Command {
|
|
|
78
78
|
);
|
|
79
79
|
this.exit(1);
|
|
80
80
|
}
|
|
81
|
+
const apiKey = getApiKeyFromEnv();
|
|
82
|
+
if (apiKey) {
|
|
83
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
84
|
+
}
|
|
81
85
|
const client = await createRestClient(this.daemonUrl);
|
|
82
86
|
const storedAuth = await loadToken();
|
|
83
87
|
if (storedAuth) {
|
|
@@ -58,7 +58,7 @@ import { Args, Flags } from "@oclif/core";
|
|
|
58
58
|
|
|
59
59
|
// src/base-command.ts
|
|
60
60
|
init_auth();
|
|
61
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
61
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
62
62
|
import { getDaemonUrl } from "@agor/core/config";
|
|
63
63
|
import { Command } from "@oclif/core";
|
|
64
64
|
import chalk from "chalk";
|
|
@@ -78,6 +78,10 @@ var BaseCommand = class extends Command {
|
|
|
78
78
|
);
|
|
79
79
|
this.exit(1);
|
|
80
80
|
}
|
|
81
|
+
const apiKey = getApiKeyFromEnv();
|
|
82
|
+
if (apiKey) {
|
|
83
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
84
|
+
}
|
|
81
85
|
const client = await createRestClient(this.daemonUrl);
|
|
82
86
|
const storedAuth = await loadToken();
|
|
83
87
|
if (storedAuth) {
|
|
@@ -58,7 +58,7 @@ import { Args } from "@oclif/core";
|
|
|
58
58
|
|
|
59
59
|
// src/base-command.ts
|
|
60
60
|
init_auth();
|
|
61
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
61
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
62
62
|
import { getDaemonUrl } from "@agor/core/config";
|
|
63
63
|
import { Command } from "@oclif/core";
|
|
64
64
|
import chalk from "chalk";
|
|
@@ -78,6 +78,10 @@ var BaseCommand = class extends Command {
|
|
|
78
78
|
);
|
|
79
79
|
this.exit(1);
|
|
80
80
|
}
|
|
81
|
+
const apiKey = getApiKeyFromEnv();
|
|
82
|
+
if (apiKey) {
|
|
83
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
84
|
+
}
|
|
81
85
|
const client = await createRestClient(this.daemonUrl);
|
|
82
86
|
const storedAuth = await loadToken();
|
|
83
87
|
if (storedAuth) {
|
|
@@ -61,7 +61,7 @@ import Table from "cli-table3";
|
|
|
61
61
|
|
|
62
62
|
// src/base-command.ts
|
|
63
63
|
init_auth();
|
|
64
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
64
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
65
65
|
import { getDaemonUrl } from "@agor/core/config";
|
|
66
66
|
import { Command } from "@oclif/core";
|
|
67
67
|
import chalk from "chalk";
|
|
@@ -81,6 +81,10 @@ var BaseCommand = class extends Command {
|
|
|
81
81
|
);
|
|
82
82
|
this.exit(1);
|
|
83
83
|
}
|
|
84
|
+
const apiKey = getApiKeyFromEnv();
|
|
85
|
+
if (apiKey) {
|
|
86
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
87
|
+
}
|
|
84
88
|
const client = await createRestClient(this.daemonUrl);
|
|
85
89
|
const storedAuth = await loadToken();
|
|
86
90
|
if (storedAuth) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as _oclif_core_interfaces from '@oclif/core/interfaces';
|
|
2
|
+
import { Command } from '@oclif/core';
|
|
3
|
+
|
|
4
|
+
declare class DaemonSync extends Command {
|
|
5
|
+
static description: string;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: {
|
|
8
|
+
'dry-run': _oclif_core_interfaces.BooleanFlag<boolean>;
|
|
9
|
+
config: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
private loadConfigFromPath;
|
|
13
|
+
private logCounts;
|
|
14
|
+
private syncRepos;
|
|
15
|
+
private syncWorktrees;
|
|
16
|
+
private syncUsers;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { DaemonSync as default };
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
// src/commands/daemon/sync.ts
|
|
2
|
+
import { existsSync, mkdirSync } from "fs";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
import {
|
|
5
|
+
buildSlugToRepoIdMap,
|
|
6
|
+
daemonResourcesConfigSchema,
|
|
7
|
+
determineRepoAction,
|
|
8
|
+
determineUserAction,
|
|
9
|
+
determineWorktreeAction,
|
|
10
|
+
getReposDir,
|
|
11
|
+
getWorktreePath,
|
|
12
|
+
loadConfig,
|
|
13
|
+
loadConfigFromFile,
|
|
14
|
+
resolvePassword,
|
|
15
|
+
validateResourceCrossReferences
|
|
16
|
+
} from "@agor/core/config";
|
|
17
|
+
import {
|
|
18
|
+
createDatabase,
|
|
19
|
+
getDatabaseUrl,
|
|
20
|
+
hash,
|
|
21
|
+
RepoRepository,
|
|
22
|
+
UsersRepository,
|
|
23
|
+
WorktreeRepository
|
|
24
|
+
} from "@agor/core/db";
|
|
25
|
+
import { autoAssignWorktreeUniqueId } from "@agor/core/environment/variable-resolver";
|
|
26
|
+
import { cloneRepo, createWorktree, getWorktreesDir } from "@agor/core/git";
|
|
27
|
+
import { Command, Flags } from "@oclif/core";
|
|
28
|
+
import chalk from "chalk";
|
|
29
|
+
var DaemonSync = class _DaemonSync extends Command {
|
|
30
|
+
static description = "Sync resources from config.yml into database and filesystem";
|
|
31
|
+
static examples = [
|
|
32
|
+
"<%= config.bin %> daemon sync",
|
|
33
|
+
"<%= config.bin %> daemon sync --dry-run",
|
|
34
|
+
"<%= config.bin %> daemon sync --config /path/to/config.yml"
|
|
35
|
+
];
|
|
36
|
+
static flags = {
|
|
37
|
+
"dry-run": Flags.boolean({
|
|
38
|
+
description: "Validate and report what would change without making changes",
|
|
39
|
+
default: false
|
|
40
|
+
}),
|
|
41
|
+
config: Flags.string({
|
|
42
|
+
char: "c",
|
|
43
|
+
description: "Path to config file (default: ~/.agor/config.yaml)"
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
const { flags } = await this.parse(_DaemonSync);
|
|
48
|
+
const dryRun = flags["dry-run"];
|
|
49
|
+
const config = flags.config ? await this.loadConfigFromPath(flags.config) : await loadConfig();
|
|
50
|
+
if (!config.resources) {
|
|
51
|
+
this.log(chalk.yellow("No resources section in config \u2014 nothing to sync."));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const parseResult = daemonResourcesConfigSchema.safeParse(config.resources);
|
|
55
|
+
if (!parseResult.success) {
|
|
56
|
+
this.log(chalk.red("Config validation failed:"));
|
|
57
|
+
for (const issue of parseResult.error.issues) {
|
|
58
|
+
this.log(chalk.red(` ${issue.path.join(".")}: ${issue.message}`));
|
|
59
|
+
}
|
|
60
|
+
this.exit(1);
|
|
61
|
+
}
|
|
62
|
+
const resources = parseResult.data;
|
|
63
|
+
const crossRefErrors = validateResourceCrossReferences(resources);
|
|
64
|
+
if (crossRefErrors.length > 0) {
|
|
65
|
+
this.log(chalk.red("Resource cross-reference errors:"));
|
|
66
|
+
for (const err of crossRefErrors) {
|
|
67
|
+
this.log(chalk.red(` ${err.path}: ${err.message}`));
|
|
68
|
+
}
|
|
69
|
+
this.exit(1);
|
|
70
|
+
}
|
|
71
|
+
this.log(chalk.bold("Syncing resources from config..."));
|
|
72
|
+
if (dryRun) {
|
|
73
|
+
this.log(chalk.yellow("(dry-run mode \u2014 no changes will be made)"));
|
|
74
|
+
}
|
|
75
|
+
this.log("");
|
|
76
|
+
const dbUrl = getDatabaseUrl();
|
|
77
|
+
const db = createDatabase({ url: dbUrl });
|
|
78
|
+
const repoRepo = new RepoRepository(db);
|
|
79
|
+
const worktreeRepo = new WorktreeRepository(db);
|
|
80
|
+
const usersRepo = new UsersRepository(db);
|
|
81
|
+
const repoCounts = await this.syncRepos(resources.repos ?? [], repoRepo, dryRun);
|
|
82
|
+
const worktreeCounts = await this.syncWorktrees(
|
|
83
|
+
resources.worktrees ?? [],
|
|
84
|
+
resources.repos ?? [],
|
|
85
|
+
worktreeRepo,
|
|
86
|
+
dryRun
|
|
87
|
+
);
|
|
88
|
+
const userCounts = await this.syncUsers(resources.users ?? [], usersRepo, dryRun);
|
|
89
|
+
this.log("");
|
|
90
|
+
this.log(chalk.bold("Sync complete:"));
|
|
91
|
+
this.logCounts("Repos", repoCounts);
|
|
92
|
+
this.logCounts("Worktrees", worktreeCounts);
|
|
93
|
+
this.logCounts("Users", userCounts);
|
|
94
|
+
}
|
|
95
|
+
async loadConfigFromPath(configPath) {
|
|
96
|
+
try {
|
|
97
|
+
return await loadConfigFromFile(configPath);
|
|
98
|
+
} catch (error) {
|
|
99
|
+
this.log(chalk.red(`Failed to load config from ${configPath}:`));
|
|
100
|
+
this.log(chalk.red(` ${error instanceof Error ? error.message : String(error)}`));
|
|
101
|
+
this.exit(1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
logCounts(label, counts) {
|
|
105
|
+
const parts = [];
|
|
106
|
+
if (counts.created > 0) parts.push(chalk.green(`${counts.created} created`));
|
|
107
|
+
if (counts.updated > 0) parts.push(chalk.yellow(`${counts.updated} updated`));
|
|
108
|
+
if (counts.unchanged > 0) parts.push(chalk.dim(`${counts.unchanged} unchanged`));
|
|
109
|
+
this.log(` ${label}: ${parts.length > 0 ? parts.join(", ") : chalk.dim("none declared")}`);
|
|
110
|
+
}
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
// Repo sync
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
async syncRepos(repos, repoRepo, dryRun) {
|
|
115
|
+
const counts = { created: 0, updated: 0, unchanged: 0 };
|
|
116
|
+
for (const repoCfg of repos) {
|
|
117
|
+
const existing = await repoRepo.findBySlug(repoCfg.slug);
|
|
118
|
+
const repoPath = join(getReposDir(), repoCfg.slug);
|
|
119
|
+
const fsExists = existsSync(repoPath);
|
|
120
|
+
const action = determineRepoAction(repoCfg, existing);
|
|
121
|
+
if (action === "create") {
|
|
122
|
+
this.log(` ${chalk.green("create")} repo ${chalk.cyan(repoCfg.slug)}`);
|
|
123
|
+
if (!dryRun) {
|
|
124
|
+
if (repoCfg.remote_url) {
|
|
125
|
+
mkdirSync(getReposDir(), { recursive: true });
|
|
126
|
+
await cloneRepo({ url: repoCfg.remote_url, targetDir: repoPath });
|
|
127
|
+
}
|
|
128
|
+
await repoRepo.create({
|
|
129
|
+
repo_id: repoCfg.repo_id,
|
|
130
|
+
slug: repoCfg.slug,
|
|
131
|
+
name: repoCfg.slug,
|
|
132
|
+
repo_type: repoCfg.repo_type ?? "remote",
|
|
133
|
+
remote_url: repoCfg.remote_url,
|
|
134
|
+
default_branch: repoCfg.default_branch ?? "main",
|
|
135
|
+
local_path: repoPath
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
counts.created++;
|
|
139
|
+
} else if (action === "update") {
|
|
140
|
+
this.log(` ${chalk.yellow("update")} repo ${chalk.cyan(repoCfg.slug)}`);
|
|
141
|
+
if (!dryRun && existing) {
|
|
142
|
+
await repoRepo.update(existing.repo_id, {
|
|
143
|
+
remote_url: repoCfg.remote_url ?? existing.remote_url,
|
|
144
|
+
default_branch: repoCfg.default_branch ?? existing.default_branch
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
counts.updated++;
|
|
148
|
+
} else {
|
|
149
|
+
counts.unchanged++;
|
|
150
|
+
}
|
|
151
|
+
if (existing && !fsExists && repoCfg.remote_url && !dryRun) {
|
|
152
|
+
this.log(` ${chalk.green("clone")} repo ${chalk.cyan(repoCfg.slug)} (filesystem missing)`);
|
|
153
|
+
mkdirSync(getReposDir(), { recursive: true });
|
|
154
|
+
await cloneRepo({ url: repoCfg.remote_url, targetDir: repoPath });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return counts;
|
|
158
|
+
}
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
// Worktree sync
|
|
161
|
+
// ---------------------------------------------------------------------------
|
|
162
|
+
async syncWorktrees(worktrees, repos, worktreeRepo, dryRun) {
|
|
163
|
+
const counts = { created: 0, updated: 0, unchanged: 0 };
|
|
164
|
+
const slugToId = buildSlugToRepoIdMap(repos);
|
|
165
|
+
for (const wtCfg of worktrees) {
|
|
166
|
+
const repoId = slugToId.get(wtCfg.repo);
|
|
167
|
+
if (!repoId) {
|
|
168
|
+
this.log(chalk.red(` skip worktree "${wtCfg.name}" \u2014 repo "${wtCfg.repo}" not found`));
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const existing = await worktreeRepo.findByRepoAndName(repoId, wtCfg.name);
|
|
172
|
+
const action = determineWorktreeAction(wtCfg, existing);
|
|
173
|
+
if (action === "create") {
|
|
174
|
+
this.log(
|
|
175
|
+
` ${chalk.green("create")} worktree ${chalk.cyan(`${wtCfg.repo}/${wtCfg.name}`)}`
|
|
176
|
+
);
|
|
177
|
+
if (!dryRun) {
|
|
178
|
+
const repoPath = join(getReposDir(), wtCfg.repo);
|
|
179
|
+
const worktreePath = getWorktreePath(wtCfg.repo, wtCfg.name);
|
|
180
|
+
if (!existsSync(worktreePath)) {
|
|
181
|
+
mkdirSync(join(getWorktreesDir(), wtCfg.repo), { recursive: true });
|
|
182
|
+
await createWorktree(
|
|
183
|
+
repoPath,
|
|
184
|
+
worktreePath,
|
|
185
|
+
wtCfg.ref,
|
|
186
|
+
false,
|
|
187
|
+
false,
|
|
188
|
+
void 0,
|
|
189
|
+
void 0,
|
|
190
|
+
wtCfg.ref_type
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
const usedIds = await worktreeRepo.getAllUsedUniqueIds();
|
|
194
|
+
const nextId = autoAssignWorktreeUniqueId(usedIds);
|
|
195
|
+
await worktreeRepo.create({
|
|
196
|
+
worktree_id: wtCfg.worktree_id,
|
|
197
|
+
repo_id: repoId,
|
|
198
|
+
name: wtCfg.name,
|
|
199
|
+
ref: wtCfg.ref,
|
|
200
|
+
ref_type: wtCfg.ref_type ?? "branch",
|
|
201
|
+
path: worktreePath,
|
|
202
|
+
worktree_unique_id: nextId,
|
|
203
|
+
others_can: wtCfg.others_can ?? "session",
|
|
204
|
+
mcp_server_ids: wtCfg.mcp_server_ids,
|
|
205
|
+
new_branch: false,
|
|
206
|
+
last_used: (/* @__PURE__ */ new Date()).toISOString()
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
counts.created++;
|
|
210
|
+
} else if (action === "update") {
|
|
211
|
+
this.log(
|
|
212
|
+
` ${chalk.yellow("update")} worktree ${chalk.cyan(`${wtCfg.repo}/${wtCfg.name}`)}`
|
|
213
|
+
);
|
|
214
|
+
if (!dryRun && existing) {
|
|
215
|
+
await worktreeRepo.update(existing.worktree_id, {
|
|
216
|
+
ref: wtCfg.ref,
|
|
217
|
+
ref_type: wtCfg.ref_type ?? existing.ref_type,
|
|
218
|
+
others_can: wtCfg.others_can ?? existing.others_can,
|
|
219
|
+
mcp_server_ids: wtCfg.mcp_server_ids ?? existing.mcp_server_ids
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
counts.updated++;
|
|
223
|
+
} else {
|
|
224
|
+
counts.unchanged++;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return counts;
|
|
228
|
+
}
|
|
229
|
+
// ---------------------------------------------------------------------------
|
|
230
|
+
// User sync
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
async syncUsers(users, usersRepo, dryRun) {
|
|
233
|
+
const counts = { created: 0, updated: 0, unchanged: 0 };
|
|
234
|
+
for (const userCfg of users) {
|
|
235
|
+
const existing = await usersRepo.findByEmail(userCfg.email);
|
|
236
|
+
const action = determineUserAction(userCfg, existing);
|
|
237
|
+
if (action === "create") {
|
|
238
|
+
this.log(` ${chalk.green("create")} user ${chalk.cyan(userCfg.email)}`);
|
|
239
|
+
if (!dryRun) {
|
|
240
|
+
const resolved = resolvePassword(userCfg.password);
|
|
241
|
+
if (resolved.mustChange) {
|
|
242
|
+
this.log(
|
|
243
|
+
` ${chalk.dim("generated temporary password for")} ${userCfg.email}: ${chalk.yellow(resolved.password)}`
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
const hashedPassword = await hash(resolved.password, 12);
|
|
247
|
+
await usersRepo.create({
|
|
248
|
+
user_id: userCfg.user_id,
|
|
249
|
+
email: userCfg.email,
|
|
250
|
+
name: userCfg.name,
|
|
251
|
+
role: userCfg.role ?? "member",
|
|
252
|
+
unix_username: userCfg.unix_username,
|
|
253
|
+
password: hashedPassword,
|
|
254
|
+
must_change_password: resolved.mustChange
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
counts.created++;
|
|
258
|
+
} else if (action === "update") {
|
|
259
|
+
this.log(` ${chalk.yellow("update")} user ${chalk.cyan(userCfg.email)}`);
|
|
260
|
+
if (!dryRun && existing) {
|
|
261
|
+
await usersRepo.update(existing.user_id, {
|
|
262
|
+
name: userCfg.name ?? existing.name,
|
|
263
|
+
role: userCfg.role ?? existing.role,
|
|
264
|
+
unix_username: userCfg.unix_username ?? existing.unix_username
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
counts.updated++;
|
|
268
|
+
} else {
|
|
269
|
+
counts.unchanged++;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return counts;
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
export {
|
|
276
|
+
DaemonSync as default
|
|
277
|
+
};
|
|
@@ -59,7 +59,7 @@ import chalk2 from "chalk";
|
|
|
59
59
|
|
|
60
60
|
// src/base-command.ts
|
|
61
61
|
init_auth();
|
|
62
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
62
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
63
63
|
import { getDaemonUrl } from "@agor/core/config";
|
|
64
64
|
import { Command } from "@oclif/core";
|
|
65
65
|
import chalk from "chalk";
|
|
@@ -79,6 +79,10 @@ var BaseCommand = class extends Command {
|
|
|
79
79
|
);
|
|
80
80
|
this.exit(1);
|
|
81
81
|
}
|
|
82
|
+
const apiKey = getApiKeyFromEnv();
|
|
83
|
+
if (apiKey) {
|
|
84
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
85
|
+
}
|
|
82
86
|
const client = await createRestClient(this.daemonUrl);
|
|
83
87
|
const storedAuth = await loadToken();
|
|
84
88
|
if (storedAuth) {
|
|
@@ -60,7 +60,7 @@ import Table from "cli-table3";
|
|
|
60
60
|
|
|
61
61
|
// src/base-command.ts
|
|
62
62
|
init_auth();
|
|
63
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
63
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
64
64
|
import { getDaemonUrl } from "@agor/core/config";
|
|
65
65
|
import { Command } from "@oclif/core";
|
|
66
66
|
import chalk from "chalk";
|
|
@@ -80,6 +80,10 @@ var BaseCommand = class extends Command {
|
|
|
80
80
|
);
|
|
81
81
|
this.exit(1);
|
|
82
82
|
}
|
|
83
|
+
const apiKey = getApiKeyFromEnv();
|
|
84
|
+
if (apiKey) {
|
|
85
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
86
|
+
}
|
|
83
87
|
const client = await createRestClient(this.daemonUrl);
|
|
84
88
|
const storedAuth = await loadToken();
|
|
85
89
|
if (storedAuth) {
|
|
@@ -59,7 +59,7 @@ import chalk2 from "chalk";
|
|
|
59
59
|
|
|
60
60
|
// src/base-command.ts
|
|
61
61
|
init_auth();
|
|
62
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
62
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
63
63
|
import { getDaemonUrl } from "@agor/core/config";
|
|
64
64
|
import { Command } from "@oclif/core";
|
|
65
65
|
import chalk from "chalk";
|
|
@@ -79,6 +79,10 @@ var BaseCommand = class extends Command {
|
|
|
79
79
|
);
|
|
80
80
|
this.exit(1);
|
|
81
81
|
}
|
|
82
|
+
const apiKey = getApiKeyFromEnv();
|
|
83
|
+
if (apiKey) {
|
|
84
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
85
|
+
}
|
|
82
86
|
const client = await createRestClient(this.daemonUrl);
|
|
83
87
|
const storedAuth = await loadToken();
|
|
84
88
|
if (storedAuth) {
|
|
@@ -59,7 +59,7 @@ import chalk2 from "chalk";
|
|
|
59
59
|
|
|
60
60
|
// src/base-command.ts
|
|
61
61
|
init_auth();
|
|
62
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
62
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
63
63
|
import { getDaemonUrl } from "@agor/core/config";
|
|
64
64
|
import { Command } from "@oclif/core";
|
|
65
65
|
import chalk from "chalk";
|
|
@@ -79,6 +79,10 @@ var BaseCommand = class extends Command {
|
|
|
79
79
|
);
|
|
80
80
|
this.exit(1);
|
|
81
81
|
}
|
|
82
|
+
const apiKey = getApiKeyFromEnv();
|
|
83
|
+
if (apiKey) {
|
|
84
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
85
|
+
}
|
|
82
86
|
const client = await createRestClient(this.daemonUrl);
|
|
83
87
|
const storedAuth = await loadToken();
|
|
84
88
|
if (storedAuth) {
|
|
@@ -59,7 +59,7 @@ import chalk2 from "chalk";
|
|
|
59
59
|
|
|
60
60
|
// src/base-command.ts
|
|
61
61
|
init_auth();
|
|
62
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
62
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
63
63
|
import { getDaemonUrl } from "@agor/core/config";
|
|
64
64
|
import { Command } from "@oclif/core";
|
|
65
65
|
import chalk from "chalk";
|
|
@@ -79,6 +79,10 @@ var BaseCommand = class extends Command {
|
|
|
79
79
|
);
|
|
80
80
|
this.exit(1);
|
|
81
81
|
}
|
|
82
|
+
const apiKey = getApiKeyFromEnv();
|
|
83
|
+
if (apiKey) {
|
|
84
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
85
|
+
}
|
|
82
86
|
const client = await createRestClient(this.daemonUrl);
|
|
83
87
|
const storedAuth = await loadToken();
|
|
84
88
|
if (storedAuth) {
|
|
@@ -60,7 +60,7 @@ import chalk2 from "chalk";
|
|
|
60
60
|
|
|
61
61
|
// src/base-command.ts
|
|
62
62
|
init_auth();
|
|
63
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
63
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
64
64
|
import { getDaemonUrl } from "@agor/core/config";
|
|
65
65
|
import { Command } from "@oclif/core";
|
|
66
66
|
import chalk from "chalk";
|
|
@@ -80,6 +80,10 @@ var BaseCommand = class extends Command {
|
|
|
80
80
|
);
|
|
81
81
|
this.exit(1);
|
|
82
82
|
}
|
|
83
|
+
const apiKey = getApiKeyFromEnv();
|
|
84
|
+
if (apiKey) {
|
|
85
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
86
|
+
}
|
|
83
87
|
const client = await createRestClient(this.daemonUrl);
|
|
84
88
|
const storedAuth = await loadToken();
|
|
85
89
|
if (storedAuth) {
|
|
@@ -62,7 +62,7 @@ import Table from "cli-table3";
|
|
|
62
62
|
|
|
63
63
|
// src/base-command.ts
|
|
64
64
|
init_auth();
|
|
65
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
65
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
66
66
|
import { getDaemonUrl } from "@agor/core/config";
|
|
67
67
|
import { Command } from "@oclif/core";
|
|
68
68
|
import chalk from "chalk";
|
|
@@ -82,6 +82,10 @@ var BaseCommand = class extends Command {
|
|
|
82
82
|
);
|
|
83
83
|
this.exit(1);
|
|
84
84
|
}
|
|
85
|
+
const apiKey = getApiKeyFromEnv();
|
|
86
|
+
if (apiKey) {
|
|
87
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
88
|
+
}
|
|
85
89
|
const client = await createRestClient(this.daemonUrl);
|
|
86
90
|
const storedAuth = await loadToken();
|
|
87
91
|
if (storedAuth) {
|
|
@@ -60,7 +60,7 @@ import inquirer from "inquirer";
|
|
|
60
60
|
|
|
61
61
|
// src/base-command.ts
|
|
62
62
|
init_auth();
|
|
63
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
63
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
64
64
|
import { getDaemonUrl } from "@agor/core/config";
|
|
65
65
|
import { Command } from "@oclif/core";
|
|
66
66
|
import chalk from "chalk";
|
|
@@ -80,6 +80,10 @@ var BaseCommand = class extends Command {
|
|
|
80
80
|
);
|
|
81
81
|
this.exit(1);
|
|
82
82
|
}
|
|
83
|
+
const apiKey = getApiKeyFromEnv();
|
|
84
|
+
if (apiKey) {
|
|
85
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
86
|
+
}
|
|
83
87
|
const client = await createRestClient(this.daemonUrl);
|
|
84
88
|
const storedAuth = await loadToken();
|
|
85
89
|
if (storedAuth) {
|
|
@@ -63,7 +63,7 @@ import Table from "cli-table3";
|
|
|
63
63
|
|
|
64
64
|
// src/base-command.ts
|
|
65
65
|
init_auth();
|
|
66
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
66
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
67
67
|
import { getDaemonUrl } from "@agor/core/config";
|
|
68
68
|
import { Command } from "@oclif/core";
|
|
69
69
|
import chalk from "chalk";
|
|
@@ -83,6 +83,10 @@ var BaseCommand = class extends Command {
|
|
|
83
83
|
);
|
|
84
84
|
this.exit(1);
|
|
85
85
|
}
|
|
86
|
+
const apiKey = getApiKeyFromEnv();
|
|
87
|
+
if (apiKey) {
|
|
88
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
89
|
+
}
|
|
86
90
|
const client = await createRestClient(this.daemonUrl);
|
|
87
91
|
const storedAuth = await loadToken();
|
|
88
92
|
if (storedAuth) {
|
|
@@ -68,7 +68,7 @@ import chalk2 from "chalk";
|
|
|
68
68
|
|
|
69
69
|
// src/base-command.ts
|
|
70
70
|
init_auth();
|
|
71
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
71
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
72
72
|
import { getDaemonUrl } from "@agor/core/config";
|
|
73
73
|
import { Command } from "@oclif/core";
|
|
74
74
|
import chalk from "chalk";
|
|
@@ -88,6 +88,10 @@ var BaseCommand = class extends Command {
|
|
|
88
88
|
);
|
|
89
89
|
this.exit(1);
|
|
90
90
|
}
|
|
91
|
+
const apiKey = getApiKeyFromEnv();
|
|
92
|
+
if (apiKey) {
|
|
93
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
94
|
+
}
|
|
91
95
|
const client = await createRestClient(this.daemonUrl);
|
|
92
96
|
const storedAuth = await loadToken();
|
|
93
97
|
if (storedAuth) {
|
|
@@ -235,8 +239,7 @@ ${chalk2.blue("\u25CF")} Loading Claude Code session: ${chalk2.cyan(sessionId)}
|
|
|
235
239
|
genealogy: {
|
|
236
240
|
children: []
|
|
237
241
|
},
|
|
238
|
-
tasks: []
|
|
239
|
-
message_count: conversation.length
|
|
242
|
+
tasks: []
|
|
240
243
|
};
|
|
241
244
|
const sessionsService = client.service("sessions");
|
|
242
245
|
const created = await sessionsService.create(agorSession);
|
|
@@ -60,7 +60,7 @@ import inquirer from "inquirer";
|
|
|
60
60
|
|
|
61
61
|
// src/base-command.ts
|
|
62
62
|
init_auth();
|
|
63
|
-
import { createRestClient, isDaemonRunning } from "@agor/core/api";
|
|
63
|
+
import { createRestClient, getApiKeyFromEnv, isDaemonRunning } from "@agor/core/api";
|
|
64
64
|
import { getDaemonUrl } from "@agor/core/config";
|
|
65
65
|
import { Command } from "@oclif/core";
|
|
66
66
|
import chalk from "chalk";
|
|
@@ -80,6 +80,10 @@ var BaseCommand = class extends Command {
|
|
|
80
80
|
);
|
|
81
81
|
this.exit(1);
|
|
82
82
|
}
|
|
83
|
+
const apiKey = getApiKeyFromEnv();
|
|
84
|
+
if (apiKey) {
|
|
85
|
+
return await createRestClient(this.daemonUrl, apiKey);
|
|
86
|
+
}
|
|
83
87
|
const client = await createRestClient(this.daemonUrl);
|
|
84
88
|
const storedAuth = await loadToken();
|
|
85
89
|
if (storedAuth) {
|
|
@@ -160,13 +164,7 @@ var UserCreate = class _UserCreate extends BaseCommand {
|
|
|
160
164
|
}),
|
|
161
165
|
role: Flags.string({
|
|
162
166
|
description: "User role",
|
|
163
|
-
options: [
|
|
164
|
-
/* 'owner', */
|
|
165
|
-
"admin",
|
|
166
|
-
"member",
|
|
167
|
-
"viewer"
|
|
168
|
-
],
|
|
169
|
-
// owner role unused
|
|
167
|
+
options: ["superadmin", "admin", "member", "viewer"],
|
|
170
168
|
default: "admin"
|
|
171
169
|
}),
|
|
172
170
|
"unix-username": Flags.string({
|