byterover-cli 2.5.2 → 3.0.0
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.production +8 -0
- package/LICENSE +44 -0
- package/README.md +240 -14
- package/bin/dev.js +8 -1
- package/bin/run.js +8 -1
- package/dist/agent/core/domain/knowledge/conflict-detector.d.ts +38 -0
- package/dist/agent/core/domain/knowledge/conflict-detector.js +71 -0
- package/dist/agent/core/domain/knowledge/conflict-resolver.d.ts +17 -0
- package/dist/agent/core/domain/knowledge/conflict-resolver.js +118 -0
- package/dist/agent/core/domain/knowledge/utils.d.ts +4 -0
- package/dist/agent/core/domain/knowledge/utils.js +6 -0
- package/dist/agent/core/interfaces/i-curate-service.d.ts +6 -0
- package/dist/agent/infra/tools/implementations/curate-tool.d.ts +67 -34
- package/dist/agent/infra/tools/implementations/curate-tool.js +294 -47
- package/dist/agent/resources/prompts/system-prompt.yml +15 -8
- package/dist/agent/resources/tools/code_exec.txt +3 -0
- package/dist/agent/resources/tools/curate.txt +12 -3
- package/dist/oclif/commands/connectors/install.d.ts +2 -1
- package/dist/oclif/commands/connectors/install.js +38 -3
- package/dist/oclif/commands/curate/index.d.ts +18 -0
- package/dist/oclif/commands/curate/index.js +78 -1
- package/dist/oclif/commands/init.d.ts +12 -0
- package/dist/oclif/commands/init.js +75 -0
- package/dist/oclif/commands/locations.js +1 -1
- package/dist/oclif/commands/providers/connect.d.ts +31 -1
- package/dist/oclif/commands/providers/connect.js +307 -27
- package/dist/oclif/commands/pull.d.ts +1 -0
- package/dist/oclif/commands/pull.js +7 -0
- package/dist/oclif/commands/push.d.ts +1 -0
- package/dist/oclif/commands/push.js +8 -0
- package/dist/oclif/commands/review/approve.d.ts +17 -0
- package/dist/oclif/commands/review/approve.js +37 -0
- package/dist/oclif/commands/review/base-review-decision.d.ts +18 -0
- package/dist/oclif/commands/review/base-review-decision.js +71 -0
- package/dist/oclif/commands/review/pending.d.ts +13 -0
- package/dist/oclif/commands/review/pending.js +94 -0
- package/dist/oclif/commands/review/reject.d.ts +17 -0
- package/dist/oclif/commands/review/reject.js +38 -0
- package/dist/oclif/commands/space/list.d.ts +2 -2
- package/dist/oclif/commands/space/list.js +13 -35
- package/dist/oclif/commands/space/switch.d.ts +2 -7
- package/dist/oclif/commands/space/switch.js +13 -56
- package/dist/oclif/commands/status.d.ts +1 -0
- package/dist/oclif/commands/status.js +11 -1
- package/dist/oclif/commands/vc/add.d.ts +7 -0
- package/dist/oclif/commands/vc/add.js +29 -0
- package/dist/oclif/commands/vc/branch.d.ts +15 -0
- package/dist/oclif/commands/vc/branch.js +70 -0
- package/dist/oclif/commands/vc/checkout.d.ts +14 -0
- package/dist/oclif/commands/vc/checkout.js +47 -0
- package/dist/oclif/commands/vc/clone.d.ts +9 -0
- package/dist/oclif/commands/vc/clone.js +61 -0
- package/dist/oclif/commands/vc/commit.d.ts +10 -0
- package/dist/oclif/commands/vc/commit.js +32 -0
- package/dist/oclif/commands/vc/config.d.ts +10 -0
- package/dist/oclif/commands/vc/config.js +30 -0
- package/dist/oclif/commands/vc/fetch.d.ts +10 -0
- package/dist/oclif/commands/vc/fetch.js +42 -0
- package/dist/oclif/commands/vc/index.d.ts +6 -0
- package/dist/oclif/commands/vc/index.js +8 -0
- package/dist/oclif/commands/vc/init.d.ts +6 -0
- package/dist/oclif/commands/vc/init.js +25 -0
- package/dist/oclif/commands/vc/log.d.ts +13 -0
- package/dist/oclif/commands/vc/log.js +48 -0
- package/dist/oclif/commands/vc/merge.d.ts +19 -0
- package/dist/oclif/commands/vc/merge.js +130 -0
- package/dist/oclif/commands/vc/pull.d.ts +13 -0
- package/dist/oclif/commands/vc/pull.js +60 -0
- package/dist/oclif/commands/vc/push.d.ts +13 -0
- package/dist/oclif/commands/vc/push.js +60 -0
- package/dist/oclif/commands/vc/remote/add.d.ts +10 -0
- package/dist/oclif/commands/vc/remote/add.js +30 -0
- package/dist/oclif/commands/vc/remote/index.d.ts +6 -0
- package/dist/oclif/commands/vc/remote/index.js +16 -0
- package/dist/oclif/commands/vc/remote/set-url.d.ts +10 -0
- package/dist/oclif/commands/vc/remote/set-url.js +30 -0
- package/dist/oclif/commands/vc/reset.d.ts +13 -0
- package/dist/oclif/commands/vc/reset.js +62 -0
- package/dist/oclif/commands/vc/status.d.ts +8 -0
- package/dist/oclif/commands/vc/status.js +106 -0
- package/dist/oclif/hooks/init/validate-brv-config.d.ts +26 -0
- package/dist/oclif/hooks/init/validate-brv-config.js +62 -0
- package/dist/oclif/lib/daemon-client.d.ts +2 -0
- package/dist/oclif/lib/daemon-client.js +36 -10
- package/dist/oclif/lib/prompt-utils.d.ts +43 -0
- package/dist/oclif/lib/prompt-utils.js +84 -0
- package/dist/oclif/lib/spinner.d.ts +8 -0
- package/dist/oclif/lib/spinner.js +23 -0
- package/dist/oclif/lib/task-client.d.ts +5 -0
- package/dist/oclif/lib/task-client.js +15 -2
- package/dist/server/config/environment.d.ts +2 -19
- package/dist/server/config/environment.js +31 -38
- package/dist/server/constants.d.ts +3 -9
- package/dist/server/constants.js +9 -12
- package/dist/server/core/domain/entities/auth-token.d.ts +2 -0
- package/dist/server/core/domain/entities/auth-token.js +7 -1
- package/dist/server/core/domain/entities/curate-log-entry.d.ts +11 -0
- package/dist/server/core/domain/entities/space.d.ts +4 -0
- package/dist/server/core/domain/entities/space.js +8 -0
- package/dist/server/core/domain/entities/team.d.ts +2 -0
- package/dist/server/core/domain/entities/team.js +4 -0
- package/dist/server/core/domain/errors/auth-error.d.ts +0 -6
- package/dist/server/core/domain/errors/auth-error.js +0 -12
- package/dist/server/core/domain/errors/git-error.d.ts +6 -0
- package/dist/server/core/domain/errors/git-error.js +12 -0
- package/dist/server/core/domain/errors/task-error.d.ts +4 -3
- package/dist/server/core/domain/errors/task-error.js +8 -8
- package/dist/server/core/domain/errors/transport-error.d.ts +0 -31
- package/dist/server/core/domain/errors/transport-error.js +0 -50
- package/dist/server/core/domain/errors/vc-error.d.ts +5 -0
- package/dist/server/core/domain/errors/vc-error.js +8 -0
- package/dist/server/core/domain/knowledge/markdown-writer.d.ts +4 -1
- package/dist/server/core/domain/knowledge/markdown-writer.js +37 -7
- package/dist/server/core/domain/transport/schemas.d.ts +6 -6
- package/dist/server/core/interfaces/context-tree/i-context-tree-service.d.ts +11 -0
- package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +6 -0
- package/dist/server/core/interfaces/services/i-git-service.d.ts +234 -0
- package/dist/server/core/interfaces/storage/i-curate-log-store.d.ts +5 -0
- package/dist/server/core/interfaces/storage/i-review-backup-store.d.ts +19 -0
- package/dist/server/core/interfaces/vc/i-vc-git-config-store.d.ts +8 -0
- package/dist/server/infra/config/auto-init.d.ts +0 -2
- package/dist/server/infra/config/auto-init.js +0 -1
- package/dist/server/infra/connectors/rules/rules-connector-config.d.ts +0 -4
- package/dist/server/infra/context-tree/file-context-tree-service.d.ts +2 -0
- package/dist/server/infra/context-tree/file-context-tree-service.js +13 -0
- package/dist/server/infra/daemon/brv-server.js +23 -3
- package/dist/server/infra/git/cogit-url.d.ts +17 -0
- package/dist/server/infra/git/cogit-url.js +39 -0
- package/dist/server/infra/git/git-http-wrapper.d.ts +20 -0
- package/dist/server/infra/git/git-http-wrapper.js +334 -0
- package/dist/server/infra/git/isomorphic-git-service.d.ts +78 -0
- package/dist/server/infra/git/isomorphic-git-service.js +983 -0
- package/dist/server/infra/http/models-dev-client.d.ts +0 -4
- package/dist/server/infra/http/models-dev-client.js +0 -6
- package/dist/server/infra/http/openrouter-api-client.d.ts +0 -8
- package/dist/server/infra/http/openrouter-api-client.js +0 -13
- package/dist/server/infra/http/provider-model-fetcher-registry.d.ts +0 -5
- package/dist/server/infra/http/provider-model-fetcher-registry.js +0 -7
- package/dist/server/infra/http/review-api-handler.d.ts +13 -0
- package/dist/server/infra/http/review-api-handler.js +286 -0
- package/dist/server/infra/http/review-ui.d.ts +7 -0
- package/dist/server/infra/http/review-ui.js +606 -0
- package/dist/server/infra/mcp/tools/brv-curate-tool.d.ts +2 -2
- package/dist/server/infra/process/curate-log-handler.d.ts +18 -2
- package/dist/server/infra/process/curate-log-handler.js +50 -13
- package/dist/server/infra/process/feature-handlers.js +41 -1
- package/dist/server/infra/process/task-router.js +16 -0
- package/dist/server/infra/provider/env-provider-detector.d.ts +0 -20
- package/dist/server/infra/provider/env-provider-detector.js +0 -27
- package/dist/server/infra/space/http-space-service.js +2 -0
- package/dist/server/infra/storage/file-curate-log-store.d.ts +10 -0
- package/dist/server/infra/storage/file-curate-log-store.js +35 -0
- package/dist/server/infra/storage/file-provider-config-store.d.ts +0 -4
- package/dist/server/infra/storage/file-provider-config-store.js +0 -6
- package/dist/server/infra/storage/file-review-backup-store.d.ts +29 -0
- package/dist/server/infra/storage/file-review-backup-store.js +121 -0
- package/dist/server/infra/transport/handlers/auth-handler.js +9 -5
- package/dist/server/infra/transport/handlers/handler-types.d.ts +9 -0
- package/dist/server/infra/transport/handlers/handler-types.js +11 -0
- package/dist/server/infra/transport/handlers/index.d.ts +4 -0
- package/dist/server/infra/transport/handlers/index.js +2 -0
- package/dist/server/infra/transport/handlers/init-handler.d.ts +1 -0
- package/dist/server/infra/transport/handlers/init-handler.js +13 -1
- package/dist/server/infra/transport/handlers/pull-handler.d.ts +3 -0
- package/dist/server/infra/transport/handlers/pull-handler.js +5 -1
- package/dist/server/infra/transport/handlers/push-handler.d.ts +20 -0
- package/dist/server/infra/transport/handlers/push-handler.js +116 -14
- package/dist/server/infra/transport/handlers/reset-handler.d.ts +11 -0
- package/dist/server/infra/transport/handlers/reset-handler.js +37 -1
- package/dist/server/infra/transport/handlers/review-handler.d.ts +35 -0
- package/dist/server/infra/transport/handlers/review-handler.js +162 -0
- package/dist/server/infra/transport/handlers/space-handler.d.ts +3 -0
- package/dist/server/infra/transport/handlers/space-handler.js +4 -1
- package/dist/server/infra/transport/handlers/status-handler.d.ts +5 -0
- package/dist/server/infra/transport/handlers/status-handler.js +51 -16
- package/dist/server/infra/transport/handlers/vc-handler.d.ts +100 -0
- package/dist/server/infra/transport/handlers/vc-handler.js +1050 -0
- package/dist/server/infra/transport/socket-io-transport-server.d.ts +7 -0
- package/dist/server/infra/transport/socket-io-transport-server.js +12 -1
- package/dist/server/infra/transport/transport-connector.d.ts +1 -1
- package/dist/server/infra/transport/transport-connector.js +2 -1
- package/dist/server/infra/vc/file-vc-git-config-store.d.ts +11 -0
- package/dist/server/infra/vc/file-vc-git-config-store.js +43 -0
- package/dist/server/templates/skill/SKILL.md +167 -33
- package/dist/server/utils/curate-result-parser.d.ts +64 -0
- package/dist/server/utils/curate-result-parser.js +8 -0
- package/dist/server/utils/file-content-reader.d.ts +2 -1
- package/dist/server/utils/file-helpers.d.ts +0 -24
- package/dist/server/utils/file-helpers.js +0 -81
- package/dist/server/utils/gitignore.d.ts +9 -0
- package/dist/server/utils/gitignore.js +47 -0
- package/dist/server/utils/process-logger.d.ts +0 -13
- package/dist/server/utils/process-logger.js +1 -78
- package/dist/shared/transport/events/index.d.ts +6 -0
- package/dist/shared/transport/events/index.js +3 -0
- package/dist/shared/transport/events/init-events.d.ts +8 -0
- package/dist/shared/transport/events/init-events.js +1 -0
- package/dist/shared/transport/events/push-events.d.ts +6 -0
- package/dist/shared/transport/events/review-events.d.ts +41 -0
- package/dist/shared/transport/events/review-events.js +5 -0
- package/dist/shared/transport/events/vc-events.d.ts +257 -0
- package/dist/shared/transport/events/vc-events.js +67 -0
- package/dist/shared/transport/types/dto.d.ts +6 -1
- package/dist/tui/app/pages/init-project-page.d.ts +9 -0
- package/dist/tui/app/pages/init-project-page.js +54 -0
- package/dist/tui/app/pages/protected-routes.js +14 -6
- package/dist/tui/components/index.d.ts +0 -2
- package/dist/tui/components/index.js +0 -1
- package/dist/tui/features/activity/hooks/use-activity-logs.js +7 -1
- package/dist/tui/features/commands/definitions/index.js +3 -0
- package/dist/tui/features/commands/definitions/space-list.js +9 -18
- package/dist/tui/features/commands/definitions/space-switch.js +10 -6
- package/dist/tui/features/commands/definitions/vc-add.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-add.js +15 -0
- package/dist/tui/features/commands/definitions/vc-branch.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-branch.js +33 -0
- package/dist/tui/features/commands/definitions/vc-checkout.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-checkout.js +32 -0
- package/dist/tui/features/commands/definitions/vc-clone.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-clone.js +18 -0
- package/dist/tui/features/commands/definitions/vc-commit.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-commit.js +32 -0
- package/dist/tui/features/commands/definitions/vc-config.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-config.js +40 -0
- package/dist/tui/features/commands/definitions/vc-fetch.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-fetch.js +37 -0
- package/dist/tui/features/commands/definitions/vc-init.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-init.js +11 -0
- package/dist/tui/features/commands/definitions/vc-log.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-log.js +25 -0
- package/dist/tui/features/commands/definitions/vc-merge.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-merge.js +48 -0
- package/dist/tui/features/commands/definitions/vc-pull.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-pull.js +42 -0
- package/dist/tui/features/commands/definitions/vc-push.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-push.js +38 -0
- package/dist/tui/features/commands/definitions/vc-remote.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-remote.js +57 -0
- package/dist/tui/features/commands/definitions/vc-reset.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-reset.js +35 -0
- package/dist/tui/features/commands/definitions/vc-status.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-status.js +11 -0
- package/dist/tui/features/commands/definitions/vc.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc.js +36 -0
- package/dist/tui/features/commands/hooks/use-slash-command-processor.js +5 -5
- package/dist/tui/features/log/api/execute-log.d.ts +8 -0
- package/dist/tui/features/log/api/execute-log.js +13 -0
- package/dist/tui/features/log/components/log-flow.d.ts +14 -0
- package/dist/tui/features/log/components/log-flow.js +29 -0
- package/dist/tui/features/log/utils/format-log.d.ts +3 -0
- package/dist/tui/features/log/utils/format-log.js +42 -0
- package/dist/tui/features/onboarding/hooks/use-app-view-mode.d.ts +9 -5
- package/dist/tui/features/onboarding/hooks/use-app-view-mode.js +12 -5
- package/dist/tui/features/push/components/push-flow.js +9 -2
- package/dist/tui/features/reset/components/reset-flow.js +2 -1
- package/dist/tui/features/status/components/status-view.js +2 -1
- package/dist/tui/features/status/utils/format-status.js +9 -0
- package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +11 -0
- package/dist/tui/features/tasks/stores/tasks-store.d.ts +10 -0
- package/dist/tui/features/tasks/stores/tasks-store.js +16 -0
- package/dist/tui/features/vc/add/api/execute-vc-add.d.ts +8 -0
- package/dist/tui/features/vc/add/api/execute-vc-add.js +13 -0
- package/dist/tui/features/vc/add/components/vc-add-flow.d.ts +7 -0
- package/dist/tui/features/vc/add/components/vc-add-flow.js +35 -0
- package/dist/tui/features/vc/branch/api/execute-vc-branch.d.ts +8 -0
- package/dist/tui/features/vc/branch/api/execute-vc-branch.js +13 -0
- package/dist/tui/features/vc/branch/components/vc-branch-flow.d.ts +8 -0
- package/dist/tui/features/vc/branch/components/vc-branch-flow.js +53 -0
- package/dist/tui/features/vc/branch/utils/format-branch.d.ts +4 -0
- package/dist/tui/features/vc/branch/utils/format-branch.js +12 -0
- package/dist/tui/features/vc/checkout/api/execute-vc-checkout.d.ts +8 -0
- package/dist/tui/features/vc/checkout/api/execute-vc-checkout.js +13 -0
- package/dist/tui/features/vc/checkout/components/vc-checkout-flow.d.ts +8 -0
- package/dist/tui/features/vc/checkout/components/vc-checkout-flow.js +33 -0
- package/dist/tui/features/vc/clone/api/execute-vc-clone.d.ts +8 -0
- package/dist/tui/features/vc/clone/api/execute-vc-clone.js +13 -0
- package/dist/tui/features/vc/clone/components/vc-clone-flow.d.ts +7 -0
- package/dist/tui/features/vc/clone/components/vc-clone-flow.js +79 -0
- package/dist/tui/features/vc/commit/api/execute-vc-commit.d.ts +8 -0
- package/dist/tui/features/vc/commit/api/execute-vc-commit.js +13 -0
- package/dist/tui/features/vc/commit/components/vc-commit-flow.d.ts +7 -0
- package/dist/tui/features/vc/commit/components/vc-commit-flow.js +29 -0
- package/dist/tui/features/vc/config/api/execute-vc-config.d.ts +8 -0
- package/dist/tui/features/vc/config/api/execute-vc-config.js +13 -0
- package/dist/tui/features/vc/config/components/vc-config-flow.d.ts +9 -0
- package/dist/tui/features/vc/config/components/vc-config-flow.js +30 -0
- package/dist/tui/features/vc/fetch/api/execute-vc-fetch.d.ts +8 -0
- package/dist/tui/features/vc/fetch/api/execute-vc-fetch.js +13 -0
- package/dist/tui/features/vc/fetch/components/vc-fetch-flow.d.ts +8 -0
- package/dist/tui/features/vc/fetch/components/vc-fetch-flow.js +75 -0
- package/dist/tui/features/vc/init/api/execute-vc-init.d.ts +8 -0
- package/dist/tui/features/vc/init/api/execute-vc-init.js +13 -0
- package/dist/tui/features/vc/init/components/vc-init-flow.d.ts +10 -0
- package/dist/tui/features/vc/init/components/vc-init-flow.js +37 -0
- package/dist/tui/features/vc/merge/api/execute-vc-merge.d.ts +8 -0
- package/dist/tui/features/vc/merge/api/execute-vc-merge.js +13 -0
- package/dist/tui/features/vc/merge/components/vc-merge-flow.d.ts +11 -0
- package/dist/tui/features/vc/merge/components/vc-merge-flow.js +72 -0
- package/dist/tui/features/vc/pull/api/execute-vc-pull.d.ts +8 -0
- package/dist/tui/features/vc/pull/api/execute-vc-pull.js +13 -0
- package/dist/tui/features/vc/pull/components/vc-pull-flow.d.ts +9 -0
- package/dist/tui/features/vc/pull/components/vc-pull-flow.js +83 -0
- package/dist/tui/features/vc/push/api/execute-vc-push.d.ts +8 -0
- package/dist/tui/features/vc/push/api/execute-vc-push.js +13 -0
- package/dist/tui/features/vc/push/components/vc-push-flow.d.ts +8 -0
- package/dist/tui/features/vc/push/components/vc-push-flow.js +83 -0
- package/dist/tui/features/vc/remote/api/execute-vc-remote.d.ts +8 -0
- package/dist/tui/features/vc/remote/api/execute-vc-remote.js +13 -0
- package/dist/tui/features/vc/remote/components/vc-remote-flow.d.ts +9 -0
- package/dist/tui/features/vc/remote/components/vc-remote-flow.js +42 -0
- package/dist/tui/features/vc/reset/api/execute-vc-reset.d.ts +8 -0
- package/dist/tui/features/vc/reset/api/execute-vc-reset.js +13 -0
- package/dist/tui/features/vc/reset/components/vc-reset-flow.d.ts +10 -0
- package/dist/tui/features/vc/reset/components/vc-reset-flow.js +63 -0
- package/dist/tui/features/vc/status/api/execute-vc-status.d.ts +8 -0
- package/dist/tui/features/vc/status/api/execute-vc-status.js +13 -0
- package/dist/tui/features/vc/status/components/vc-status-flow.d.ts +10 -0
- package/dist/tui/features/vc/status/components/vc-status-flow.js +133 -0
- package/dist/tui/lib/environment.d.ts +8 -0
- package/dist/tui/lib/environment.js +8 -0
- package/dist/tui/utils/error-messages.d.ts +5 -1
- package/dist/tui/utils/error-messages.js +32 -3
- package/node_modules/@campfirein/brv-transport-client/LICENSE +95 -0
- package/node_modules/@campfirein/brv-transport-client/README.md +3 -4
- package/node_modules/@campfirein/brv-transport-client/package.json +2 -2
- package/oclif.manifest.json +985 -65
- package/package.json +13 -5
- package/dist/oclif/hooks/prerun/validate-brv-config-version.d.ts +0 -33
- package/dist/oclif/hooks/prerun/validate-brv-config-version.js +0 -86
- package/dist/server/core/domain/entities/bullet.d.ts +0 -51
- package/dist/server/core/domain/entities/bullet.js +0 -94
- package/dist/server/core/domain/entities/memory.d.ts +0 -55
- package/dist/server/core/domain/entities/memory.js +0 -90
- package/dist/server/core/domain/entities/playbook.d.ts +0 -80
- package/dist/server/core/domain/entities/playbook.js +0 -214
- package/dist/server/core/domain/entities/presigned-url.d.ts +0 -9
- package/dist/server/core/domain/entities/presigned-url.js +0 -18
- package/dist/server/core/domain/entities/presigned-urls-response.d.ts +0 -10
- package/dist/server/core/domain/entities/presigned-urls-response.js +0 -18
- package/dist/server/core/domain/entities/retrieve-result.d.ts +0 -35
- package/dist/server/core/domain/entities/retrieve-result.js +0 -35
- package/dist/server/core/domain/errors/headless-prompt-error.d.ts +0 -11
- package/dist/server/core/domain/errors/headless-prompt-error.js +0 -18
- package/dist/server/core/interfaces/services/i-legacy-rule-detector.d.ts +0 -56
- package/dist/server/core/interfaces/services/i-memory-retrieval-service.d.ts +0 -39
- package/dist/server/core/interfaces/services/i-memory-storage-service.d.ts +0 -53
- package/dist/server/core/interfaces/services/i-terminal.d.ts +0 -146
- package/dist/server/core/interfaces/services/i-terminal.js +0 -1
- package/dist/server/core/interfaces/services/i-workspace-detector-service.d.ts +0 -8
- package/dist/server/core/interfaces/services/i-workspace-detector-service.js +0 -1
- package/dist/server/core/interfaces/storage/i-onboarding-preference-store.d.ts +0 -20
- package/dist/server/core/interfaces/storage/i-onboarding-preference-store.js +0 -1
- package/dist/server/infra/connectors/rules/legacy-rule-detector.d.ts +0 -21
- package/dist/server/infra/connectors/rules/legacy-rule-detector.js +0 -106
- package/dist/server/infra/memory/http-memory-retrieval-service.d.ts +0 -18
- package/dist/server/infra/memory/http-memory-retrieval-service.js +0 -64
- package/dist/server/infra/memory/http-memory-storage-service.d.ts +0 -18
- package/dist/server/infra/memory/http-memory-storage-service.js +0 -72
- package/dist/server/infra/memory/memory-to-playbook-mapper.d.ts +0 -33
- package/dist/server/infra/memory/memory-to-playbook-mapper.js +0 -51
- package/dist/server/infra/storage/file-onboarding-preference-store.d.ts +0 -10
- package/dist/server/infra/storage/file-onboarding-preference-store.js +0 -45
- package/dist/server/infra/terminal/headless-terminal.d.ts +0 -91
- package/dist/server/infra/terminal/headless-terminal.js +0 -211
- package/dist/server/infra/workspace/workspace-detector-service.d.ts +0 -57
- package/dist/server/infra/workspace/workspace-detector-service.js +0 -165
- package/dist/server/utils/crash-log.d.ts +0 -14
- package/dist/server/utils/crash-log.js +0 -19
- package/dist/server/utils/emoji-helpers.d.ts +0 -38
- package/dist/server/utils/emoji-helpers.js +0 -42
- package/dist/server/utils/error-handler.d.ts +0 -51
- package/dist/server/utils/error-handler.js +0 -169
- package/dist/server/utils/oclif-error-helpers.d.ts +0 -40
- package/dist/server/utils/oclif-error-helpers.js +0 -46
- package/dist/server/utils/tool-display-formatter.d.ts +0 -53
- package/dist/server/utils/tool-display-formatter.js +0 -257
- package/dist/tui/components/init.d.ts +0 -33
- package/dist/tui/components/init.js +0 -234
- package/dist/tui/features/space/api/get-spaces.d.ts +0 -16
- package/dist/tui/features/space/api/get-spaces.js +0 -17
- package/dist/tui/features/space/api/switch-space.d.ts +0 -11
- package/dist/tui/features/space/api/switch-space.js +0 -24
- package/dist/tui/features/space/components/space-list-view.d.ts +0 -12
- package/dist/tui/features/space/components/space-list-view.js +0 -56
- package/dist/tui/features/space/components/space-switch-flow.d.ts +0 -13
- package/dist/tui/features/space/components/space-switch-flow.js +0 -97
- /package/dist/server/core/interfaces/services/{i-legacy-rule-detector.js → i-git-service.js} +0 -0
- /package/dist/server/core/interfaces/{services/i-memory-retrieval-service.js → storage/i-review-backup-store.js} +0 -0
- /package/dist/server/core/interfaces/{services/i-memory-storage-service.js → vc/i-vc-git-config-store.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcBranchRequest, type IVcBranchResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcBranch: (request: IVcBranchRequest) => Promise<IVcBranchResponse>;
|
|
4
|
+
type UseExecuteVcBranchOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcBranch>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcBranch: ({ mutationConfig }?: UseExecuteVcBranchOptions) => import("@tanstack/react-query").UseMutationResult<IVcBranchResponse, Error, IVcBranchRequest, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { VcEvents, } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
4
|
+
export const executeVcBranch = (request) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.BRANCH, request);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcBranch = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcBranch,
|
|
13
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IVcBranchRequest } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import type { CustomDialogCallbacks } from '../../../../types/commands.js';
|
|
4
|
+
type VcBranchFlowProps = CustomDialogCallbacks & {
|
|
5
|
+
request: IVcBranchRequest;
|
|
6
|
+
};
|
|
7
|
+
export declare function VcBranchFlow({ onCancel, onComplete, request }: VcBranchFlowProps): React.ReactNode;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, useInput } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import { formatTransportError } from '../../../../utils/error-messages.js';
|
|
6
|
+
import { useExecuteVcBranch } from '../api/execute-vc-branch.js';
|
|
7
|
+
import { formatBranchList } from '../utils/format-branch.js';
|
|
8
|
+
const LABELS = {
|
|
9
|
+
create: 'Creating branch...',
|
|
10
|
+
delete: 'Deleting branch...',
|
|
11
|
+
list: 'Listing branches...',
|
|
12
|
+
'set-upstream': 'Setting upstream...',
|
|
13
|
+
};
|
|
14
|
+
export function VcBranchFlow({ onCancel, onComplete, request }) {
|
|
15
|
+
const branchMutation = useExecuteVcBranch();
|
|
16
|
+
useInput((_, key) => {
|
|
17
|
+
if (key.escape && !branchMutation.isPending)
|
|
18
|
+
onCancel();
|
|
19
|
+
});
|
|
20
|
+
const fired = React.useRef(false);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (fired.current)
|
|
23
|
+
return;
|
|
24
|
+
fired.current = true;
|
|
25
|
+
branchMutation.mutate(request, {
|
|
26
|
+
onError(error) {
|
|
27
|
+
onComplete(`Failed: ${formatTransportError(error)}`);
|
|
28
|
+
},
|
|
29
|
+
onSuccess(result) {
|
|
30
|
+
switch (result.action) {
|
|
31
|
+
case 'create': {
|
|
32
|
+
onComplete(`Created branch '${result.created}'.`);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case 'delete': {
|
|
36
|
+
onComplete(`Deleted branch '${result.deleted}'.`);
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case 'list': {
|
|
40
|
+
onComplete(formatBranchList(result.branches));
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case 'set-upstream': {
|
|
44
|
+
onComplete(`Branch '${result.branch}' set up to track '${result.upstream}'.`);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
// No default
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}, []);
|
|
52
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " ", LABELS[request.action]] }));
|
|
53
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
export function formatBranchList(branches) {
|
|
3
|
+
if (branches.length === 0)
|
|
4
|
+
return 'No branches found.';
|
|
5
|
+
return branches
|
|
6
|
+
.map((b) => {
|
|
7
|
+
const prefix = b.isCurrent ? '* ' : ' ';
|
|
8
|
+
const name = b.isRemote ? `remotes/${b.name}` : b.name;
|
|
9
|
+
return b.isCurrent ? `${prefix}${chalk.green(name)}` : `${prefix}${name}`;
|
|
10
|
+
})
|
|
11
|
+
.join('\n');
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcCheckoutRequest, type IVcCheckoutResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcCheckout: (request: IVcCheckoutRequest) => Promise<IVcCheckoutResponse>;
|
|
4
|
+
type UseExecuteVcCheckoutOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcCheckout>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcCheckout: ({ mutationConfig }?: UseExecuteVcCheckoutOptions) => import("@tanstack/react-query").UseMutationResult<IVcCheckoutResponse, Error, IVcCheckoutRequest, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { VcEvents, } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
4
|
+
export const executeVcCheckout = (request) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.CHECKOUT, request);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcCheckout = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcCheckout,
|
|
13
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IVcCheckoutRequest } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import type { CustomDialogCallbacks } from '../../../../types/commands.js';
|
|
4
|
+
type VcCheckoutFlowProps = CustomDialogCallbacks & {
|
|
5
|
+
request: IVcCheckoutRequest;
|
|
6
|
+
};
|
|
7
|
+
export declare function VcCheckoutFlow({ onCancel, onComplete, request }: VcCheckoutFlowProps): React.ReactNode;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, useInput } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import { formatTransportError } from '../../../../utils/error-messages.js';
|
|
6
|
+
import { useExecuteVcCheckout } from '../api/execute-vc-checkout.js';
|
|
7
|
+
export function VcCheckoutFlow({ onCancel, onComplete, request }) {
|
|
8
|
+
const checkoutMutation = useExecuteVcCheckout();
|
|
9
|
+
useInput((_, key) => {
|
|
10
|
+
if (key.escape && !checkoutMutation.isPending)
|
|
11
|
+
onCancel();
|
|
12
|
+
});
|
|
13
|
+
const fired = React.useRef(false);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (fired.current)
|
|
16
|
+
return;
|
|
17
|
+
fired.current = true;
|
|
18
|
+
checkoutMutation.mutate(request, {
|
|
19
|
+
onError(error) {
|
|
20
|
+
onComplete(`Failed: ${formatTransportError(error)}`);
|
|
21
|
+
},
|
|
22
|
+
onSuccess(result) {
|
|
23
|
+
if (result.created) {
|
|
24
|
+
onComplete(`Switched to a new branch '${result.branch}'`);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
onComplete(`Switched to branch '${result.branch}'`);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}, []);
|
|
32
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Switching to branch '", request.branch, "'..."] }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcCloneRequest, type IVcCloneResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcClone: (request: IVcCloneRequest) => Promise<IVcCloneResponse>;
|
|
4
|
+
type UseExecuteVcCloneOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcClone>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcClone: ({ mutationConfig }?: UseExecuteVcCloneOptions) => import("@tanstack/react-query").UseMutationResult<IVcCloneResponse, Error, IVcCloneRequest, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { VcEvents, } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
4
|
+
export const executeVcClone = (request) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.CLONE, request);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcClone = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcClone,
|
|
13
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CustomDialogCallbacks } from '../../../../types/commands.js';
|
|
3
|
+
interface VcCloneFlowProps extends CustomDialogCallbacks {
|
|
4
|
+
url?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function VcCloneFlow({ onCancel, onComplete, url }: VcCloneFlowProps): React.ReactNode;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { VcEvents } from '../../../../../shared/transport/events/vc-events.js';
|
|
6
|
+
import { InlineInput } from '../../../../components/inline-prompts/inline-input.js';
|
|
7
|
+
import { useTheme } from '../../../../hooks/index.js';
|
|
8
|
+
import { getWebAppUrl } from '../../../../lib/environment.js';
|
|
9
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
10
|
+
import { formatTransportError } from '../../../../utils/error-messages.js';
|
|
11
|
+
import { useExecuteVcClone } from '../api/execute-vc-clone.js';
|
|
12
|
+
function validateRemoteUrl(value) {
|
|
13
|
+
if (!value)
|
|
14
|
+
return 'URL is required';
|
|
15
|
+
try {
|
|
16
|
+
const parsed = new URL(value);
|
|
17
|
+
if (parsed.protocol !== 'https:') {
|
|
18
|
+
return 'URL must start with https://';
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return 'Invalid URL';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function VcCloneFlow({ onCancel, onComplete, url }) {
|
|
27
|
+
const { theme: { colors }, } = useTheme();
|
|
28
|
+
const [step, setStep] = useState(url ? 'cloning' : 'entering_url');
|
|
29
|
+
const [cloneUrl, setCloneUrl] = useState(url ?? null);
|
|
30
|
+
const [cloneError, setCloneError] = useState(null);
|
|
31
|
+
const [progressMessages, setProgressMessages] = useState([]);
|
|
32
|
+
const mutatedRef = useRef(false);
|
|
33
|
+
const cloneMutation = useExecuteVcClone();
|
|
34
|
+
useInput((_, key) => {
|
|
35
|
+
if (key.escape && !cloneMutation.isPending) {
|
|
36
|
+
onCancel();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (step !== 'cloning' || mutatedRef.current || !cloneUrl)
|
|
41
|
+
return;
|
|
42
|
+
mutatedRef.current = true;
|
|
43
|
+
const { apiClient } = useTransportStore.getState();
|
|
44
|
+
const unsub = apiClient?.on(VcEvents.CLONE_PROGRESS, (evt) => {
|
|
45
|
+
setProgressMessages((prev) => [...prev, evt.message]);
|
|
46
|
+
});
|
|
47
|
+
cloneMutation.mutate({ url: cloneUrl }, {
|
|
48
|
+
onError(err) {
|
|
49
|
+
unsub?.();
|
|
50
|
+
mutatedRef.current = false;
|
|
51
|
+
if (url) {
|
|
52
|
+
onComplete(formatTransportError(err));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
setCloneError(formatTransportError(err));
|
|
56
|
+
setStep('entering_url');
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
onSuccess(result) {
|
|
60
|
+
unsub?.();
|
|
61
|
+
const label = result.teamName && result.spaceName ? `${result.teamName}/${result.spaceName}` : 'repository';
|
|
62
|
+
onComplete(`Cloned ${label} successfully.`);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
return () => {
|
|
66
|
+
unsub?.();
|
|
67
|
+
};
|
|
68
|
+
}, [onComplete, step, cloneUrl, url]);
|
|
69
|
+
const handleUrlSubmit = useCallback((submittedUrl) => {
|
|
70
|
+
setCloneError(null);
|
|
71
|
+
setProgressMessages([]);
|
|
72
|
+
setCloneUrl(submittedUrl);
|
|
73
|
+
setStep('cloning');
|
|
74
|
+
}, []);
|
|
75
|
+
if (step === 'cloning') {
|
|
76
|
+
return (_jsxs(_Fragment, { children: [progressMessages.map((msg, idx) => (_jsx(Text, { children: msg }, idx))), _jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Cloning..."] })] }));
|
|
77
|
+
}
|
|
78
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [cloneError && _jsx(Text, { color: colors.errorText, children: cloneError }), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: "To clone a space:" }), _jsxs(Text, { children: [' ', "Go to ", _jsx(Text, { bold: true, children: getWebAppUrl() }), " \u2192 create or open a Space"] }), _jsxs(Text, { children: [' ', "and copy the remote URL."] })] }), _jsx(InlineInput, { message: "Paste your remote URL:", onSubmit: handleUrlSubmit, validate: validateRemoteUrl })] }));
|
|
79
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcCommitRequest, type IVcCommitResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcCommit: (request: IVcCommitRequest) => Promise<IVcCommitResponse>;
|
|
4
|
+
type UseExecuteVcCommitOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcCommit>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcCommit: ({ mutationConfig }?: UseExecuteVcCommitOptions) => import("@tanstack/react-query").UseMutationResult<IVcCommitResponse, Error, IVcCommitRequest, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { VcEvents, } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
4
|
+
export const executeVcCommit = (request) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.COMMIT, request);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcCommit = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcCommit,
|
|
13
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CustomDialogCallbacks } from '../../../../types/commands.js';
|
|
3
|
+
type VcCommitFlowProps = CustomDialogCallbacks & {
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function VcCommitFlow({ message, onCancel, onComplete }: VcCommitFlowProps): React.ReactNode;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, useInput } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import { formatTransportError } from '../../../../utils/error-messages.js';
|
|
6
|
+
import { useExecuteVcCommit } from '../api/execute-vc-commit.js';
|
|
7
|
+
export function VcCommitFlow({ message, onCancel, onComplete }) {
|
|
8
|
+
const commitMutation = useExecuteVcCommit();
|
|
9
|
+
useInput((_, key) => {
|
|
10
|
+
if (key.escape && !commitMutation.isPending) {
|
|
11
|
+
onCancel();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const fired = React.useRef(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (fired.current)
|
|
17
|
+
return;
|
|
18
|
+
fired.current = true;
|
|
19
|
+
commitMutation.mutate({ message }, {
|
|
20
|
+
onError(error) {
|
|
21
|
+
onComplete(`Failed to commit: ${formatTransportError(error)}`);
|
|
22
|
+
},
|
|
23
|
+
onSuccess(result) {
|
|
24
|
+
onComplete(`[${result.sha.slice(0, 7)}] ${result.message}`);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}, []);
|
|
28
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Committing..."] }));
|
|
29
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcConfigRequest, type IVcConfigResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcConfig: (request: IVcConfigRequest) => Promise<IVcConfigResponse>;
|
|
4
|
+
type UseExecuteVcConfigOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcConfig>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcConfig: ({ mutationConfig }?: UseExecuteVcConfigOptions) => import("@tanstack/react-query").UseMutationResult<IVcConfigResponse, Error, IVcConfigRequest, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { VcEvents, } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
4
|
+
export const executeVcConfig = (request) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.CONFIG, request);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcConfig = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcConfig,
|
|
13
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VcConfigKey } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import type { CustomDialogCallbacks } from '../../../../types/commands.js';
|
|
4
|
+
type VcConfigFlowProps = CustomDialogCallbacks & {
|
|
5
|
+
configKey: VcConfigKey;
|
|
6
|
+
value?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function VcConfigFlow({ configKey, onCancel, onComplete, value }: VcConfigFlowProps): React.ReactNode;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, useInput } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import { formatTransportError } from '../../../../utils/error-messages.js';
|
|
6
|
+
import { useExecuteVcConfig } from '../api/execute-vc-config.js';
|
|
7
|
+
export function VcConfigFlow({ configKey, onCancel, onComplete, value }) {
|
|
8
|
+
const configMutation = useExecuteVcConfig();
|
|
9
|
+
useInput((_, key) => {
|
|
10
|
+
if (key.escape && !configMutation.isPending) {
|
|
11
|
+
onCancel();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const fired = React.useRef(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (fired.current)
|
|
17
|
+
return;
|
|
18
|
+
fired.current = true;
|
|
19
|
+
configMutation.mutate({ key: configKey, value }, {
|
|
20
|
+
onError(error) {
|
|
21
|
+
onComplete(`Failed: ${formatTransportError(error)}`);
|
|
22
|
+
},
|
|
23
|
+
onSuccess(result) {
|
|
24
|
+
onComplete(`${result.key} = ${result.value}`);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}, []);
|
|
28
|
+
const action = value === undefined ? 'Getting' : 'Setting';
|
|
29
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " ", action, " ", configKey, "..."] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcFetchRequest, type IVcFetchResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcFetch: (request: IVcFetchRequest) => Promise<IVcFetchResponse>;
|
|
4
|
+
type UseExecuteVcFetchOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcFetch>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcFetch: ({ mutationConfig }?: UseExecuteVcFetchOptions) => import("@tanstack/react-query").UseMutationResult<IVcFetchResponse, Error, IVcFetchRequest, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { VcEvents, } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
4
|
+
export const executeVcFetch = (request) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.FETCH, request);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcFetch = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcFetch,
|
|
13
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CustomDialogCallbacks } from '../../../../types/commands.js';
|
|
3
|
+
type VcFetchFlowProps = CustomDialogCallbacks & {
|
|
4
|
+
ref?: string;
|
|
5
|
+
remote?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function VcFetchFlow({ onCancel, onComplete, ref: refProp, remote }: VcFetchFlowProps): React.ReactNode;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { VcErrorCode } from '../../../../../shared/transport/events/vc-events.js';
|
|
6
|
+
import { InlineInput } from '../../../../components/inline-prompts/inline-input.js';
|
|
7
|
+
import { useTheme } from '../../../../hooks/index.js';
|
|
8
|
+
import { getWebAppUrl } from '../../../../lib/environment.js';
|
|
9
|
+
import { formatTransportError, getTransportErrorCode } from '../../../../utils/error-messages.js';
|
|
10
|
+
import { useExecuteVcRemote } from '../../remote/api/execute-vc-remote.js';
|
|
11
|
+
import { useExecuteVcFetch } from '../api/execute-vc-fetch.js';
|
|
12
|
+
function validateRemoteUrl(value) {
|
|
13
|
+
if (!value)
|
|
14
|
+
return 'URL is required';
|
|
15
|
+
try {
|
|
16
|
+
const parsed = new URL(value);
|
|
17
|
+
if (parsed.protocol !== 'https:') {
|
|
18
|
+
return 'URL must start with https://';
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return 'Invalid URL';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function VcFetchFlow({ onCancel, onComplete, ref: refProp, remote }) {
|
|
27
|
+
const { theme: { colors }, } = useTheme();
|
|
28
|
+
const [step, setStep] = useState('fetching');
|
|
29
|
+
const fetchMutation = useExecuteVcFetch();
|
|
30
|
+
const remoteMutation = useExecuteVcRemote();
|
|
31
|
+
useInput((_, key) => {
|
|
32
|
+
if (key.escape && !fetchMutation.isPending && !remoteMutation.isPending) {
|
|
33
|
+
onCancel();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const executeFetch = useCallback(() => {
|
|
37
|
+
fetchMutation.mutate({ ref: refProp, remote }, {
|
|
38
|
+
onError(error) {
|
|
39
|
+
if (getTransportErrorCode(error) === VcErrorCode.NO_REMOTE) {
|
|
40
|
+
setStep('configuring_remote');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
onComplete(`Failed to fetch: ${formatTransportError(error)}`);
|
|
44
|
+
},
|
|
45
|
+
onSuccess(result) {
|
|
46
|
+
onComplete(`Fetched from ${result.remote}.`);
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}, [fetchMutation, onComplete, refProp, remote]);
|
|
50
|
+
const fired = useRef(false);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (fired.current)
|
|
53
|
+
return;
|
|
54
|
+
fired.current = true;
|
|
55
|
+
executeFetch();
|
|
56
|
+
}, []);
|
|
57
|
+
const handleUrlSubmit = useCallback((url) => {
|
|
58
|
+
remoteMutation.mutate({ subcommand: 'add', url }, {
|
|
59
|
+
onError(error) {
|
|
60
|
+
onComplete(`Failed to add remote: ${formatTransportError(error)}`);
|
|
61
|
+
},
|
|
62
|
+
onSuccess() {
|
|
63
|
+
setStep('fetching');
|
|
64
|
+
executeFetch();
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}, [executeFetch, onComplete, remoteMutation]);
|
|
68
|
+
if (step === 'configuring_remote') {
|
|
69
|
+
if (remoteMutation.isPending) {
|
|
70
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Adding remote..."] }));
|
|
71
|
+
}
|
|
72
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colors.warning, children: "No remote configured." }), _jsx(Text, {}), _jsx(Text, { children: "To connect to cloud:" }), _jsxs(Text, { children: [" Go to ", _jsx(Text, { bold: true, children: getWebAppUrl() }), " \u2192 create or open a Space"] }), _jsx(Text, { children: " and copy the remote URL." })] }), _jsx(InlineInput, { message: "Paste your remote URL:", onSubmit: handleUrlSubmit, validate: validateRemoteUrl })] }));
|
|
73
|
+
}
|
|
74
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Fetching..."] }));
|
|
75
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcInitResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcInit: () => Promise<IVcInitResponse>;
|
|
4
|
+
type UseExecuteVcInitOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcInit>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcInit: ({ mutationConfig }?: UseExecuteVcInitOptions) => import("@tanstack/react-query").UseMutationResult<IVcInitResponse, Error, undefined, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { VcEvents } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
4
|
+
export const executeVcInit = () => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.INIT, {});
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcInit = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcInit,
|
|
13
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VcInitFlow Component
|
|
3
|
+
*
|
|
4
|
+
* Initializes the git repository in .brv/context-tree/ via VcHandler.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { CustomDialogCallbacks } from '../../../../types/commands.js';
|
|
8
|
+
type VcInitFlowProps = CustomDialogCallbacks;
|
|
9
|
+
export declare function VcInitFlow({ onCancel, onComplete }: VcInitFlowProps): React.ReactNode;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* VcInitFlow Component
|
|
4
|
+
*
|
|
5
|
+
* Initializes the git repository in .brv/context-tree/ via VcHandler.
|
|
6
|
+
*/
|
|
7
|
+
import { Text, useInput } from 'ink';
|
|
8
|
+
import Spinner from 'ink-spinner';
|
|
9
|
+
import React, { useEffect } from 'react';
|
|
10
|
+
import { formatTransportError } from '../../../../utils/error-messages.js';
|
|
11
|
+
import { useExecuteVcInit } from '../api/execute-vc-init.js';
|
|
12
|
+
export function VcInitFlow({ onCancel, onComplete }) {
|
|
13
|
+
const initMutation = useExecuteVcInit();
|
|
14
|
+
useInput((_, key) => {
|
|
15
|
+
if (key.escape && !initMutation.isPending) {
|
|
16
|
+
onCancel();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const fired = React.useRef(false);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (fired.current)
|
|
22
|
+
return;
|
|
23
|
+
fired.current = true;
|
|
24
|
+
initMutation.mutate(undefined, {
|
|
25
|
+
onError(error) {
|
|
26
|
+
onComplete(`Failed to initialize: ${formatTransportError(error)}`);
|
|
27
|
+
},
|
|
28
|
+
onSuccess(result) {
|
|
29
|
+
const msg = result.reinitialized
|
|
30
|
+
? `Reinitialized Git repository in ${result.gitDir}`
|
|
31
|
+
: `Initialized Git repository in ${result.gitDir}`;
|
|
32
|
+
onComplete(msg);
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}, []);
|
|
36
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Initializing git repository..."] }));
|
|
37
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcMergeRequest, type IVcMergeResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcMerge: (request: IVcMergeRequest) => Promise<IVcMergeResponse>;
|
|
4
|
+
type UseExecuteVcMergeOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcMerge>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcMerge: ({ mutationConfig }?: UseExecuteVcMergeOptions) => import("@tanstack/react-query").UseMutationResult<IVcMergeResponse, Error, IVcMergeRequest, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { VcEvents, } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { useTransportStore } from '../../../../stores/transport-store.js';
|
|
4
|
+
export const executeVcMerge = (request) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.MERGE, request);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcMerge = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcMerge,
|
|
13
|
+
});
|