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,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InitProjectPage
|
|
3
|
+
*
|
|
4
|
+
* Shown when .brv/ doesn't exist at cwd.
|
|
5
|
+
* Confirms with the user, then runs local init + vc init via daemon.
|
|
6
|
+
* On success, invalidates status cache → useAppViewMode transitions forward.
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
export declare function InitProjectPage(): React.ReactNode;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* InitProjectPage
|
|
4
|
+
*
|
|
5
|
+
* Shown when .brv/ doesn't exist at cwd.
|
|
6
|
+
* Confirms with the user, then runs local init + vc init via daemon.
|
|
7
|
+
* On success, invalidates status cache → useAppViewMode transitions forward.
|
|
8
|
+
*/
|
|
9
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
10
|
+
import { Box, Text, useApp } from 'ink';
|
|
11
|
+
import Spinner from 'ink-spinner';
|
|
12
|
+
import { useCallback, useState } from 'react';
|
|
13
|
+
import { InitEvents } from '../../../shared/transport/events/init-events.js';
|
|
14
|
+
import { VcEvents } from '../../../shared/transport/events/vc-events.js';
|
|
15
|
+
import { EnterPrompt } from '../../components/enter-prompt.js';
|
|
16
|
+
import { getStatusQueryOptions } from '../../features/status/api/get-status.js';
|
|
17
|
+
import { useTheme } from '../../hooks/index.js';
|
|
18
|
+
import { useTransportStore } from '../../stores/transport-store.js';
|
|
19
|
+
import { MainLayout } from '../layouts/main-layout.js';
|
|
20
|
+
export function InitProjectPage() {
|
|
21
|
+
const queryClient = useQueryClient();
|
|
22
|
+
const { theme: { colors }, } = useTheme();
|
|
23
|
+
const [state, setState] = useState('confirm');
|
|
24
|
+
const { exit } = useApp();
|
|
25
|
+
const [error, setError] = useState();
|
|
26
|
+
const runInit = useCallback(async () => {
|
|
27
|
+
setState('running');
|
|
28
|
+
try {
|
|
29
|
+
const { apiClient } = useTransportStore.getState();
|
|
30
|
+
if (!apiClient)
|
|
31
|
+
throw new Error('Not connected to daemon');
|
|
32
|
+
// Step 1: Local init
|
|
33
|
+
await apiClient.request(InitEvents.LOCAL, { force: false });
|
|
34
|
+
// Step 2: VC init
|
|
35
|
+
await apiClient.request(VcEvents.INIT, {});
|
|
36
|
+
setState('done');
|
|
37
|
+
// Invalidate status so useAppViewMode re-evaluates and transitions
|
|
38
|
+
queryClient.invalidateQueries(getStatusQueryOptions());
|
|
39
|
+
}
|
|
40
|
+
catch (error_) {
|
|
41
|
+
setError(error_ instanceof Error ? error_.message : 'Initialization failed');
|
|
42
|
+
setState('error');
|
|
43
|
+
}
|
|
44
|
+
}, [queryClient]);
|
|
45
|
+
const handleConfirm = useCallback((confirmed) => {
|
|
46
|
+
if (confirmed) {
|
|
47
|
+
runInit();
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
exit();
|
|
51
|
+
}
|
|
52
|
+
}, [exit, runInit]);
|
|
53
|
+
return (_jsx(MainLayout, { showInput: false, children: _jsxs(Box, { flexDirection: "column", paddingTop: 1, children: [state === 'confirm' && (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Text, { color: colors.secondary, children: ["Project not initialized in ", process.cwd()] }), _jsx(EnterPrompt, { action: "initialize ByteRover here", onEnter: () => handleConfirm(true) })] })), state === 'running' && (_jsxs(Text, { color: colors.text, children: [_jsx(Spinner, { type: "dots" }), " Initializing project..."] })), state === 'error' && _jsx(Text, { color: colors.errorText, children: error })] }) }));
|
|
54
|
+
}
|
|
@@ -2,13 +2,21 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useAppViewMode } from '../../features/onboarding/hooks/use-app-view-mode.js';
|
|
3
3
|
import { ConfigProviderPage } from './config-provider-page.js';
|
|
4
4
|
import { HomePage } from './home-page.js';
|
|
5
|
+
// import {InitProjectPage} from './init-project-page.js'
|
|
5
6
|
export function ProtectedRoutes() {
|
|
6
7
|
const viewMode = useAppViewMode();
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
switch (viewMode.type) {
|
|
9
|
+
case 'config-provider': {
|
|
10
|
+
return _jsx(ConfigProviderPage, {});
|
|
11
|
+
}
|
|
12
|
+
// case 'init-project': {
|
|
13
|
+
// return <InitProjectPage />
|
|
14
|
+
// }
|
|
15
|
+
case 'loading': {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
case 'ready': {
|
|
19
|
+
return _jsx(HomePage, {});
|
|
20
|
+
}
|
|
9
21
|
}
|
|
10
|
-
if (viewMode.type === 'config-provider') {
|
|
11
|
-
return _jsx(ConfigProviderPage, {});
|
|
12
|
-
}
|
|
13
|
-
return _jsx(HomePage, {});
|
|
14
22
|
}
|
|
@@ -11,8 +11,6 @@ export { EnterPrompt } from './enter-prompt.js';
|
|
|
11
11
|
export { ExecutionChanges, ExecutionContent, ExecutionInput, ExecutionProgress, ExecutionStatus, ExpandedLogView, LogItem, truncateContent, } from './execution/index.js';
|
|
12
12
|
export { Footer } from './footer.js';
|
|
13
13
|
export { Header } from './header.js';
|
|
14
|
-
export { Init } from './init.js';
|
|
15
|
-
export type { InitProps } from './init.js';
|
|
16
14
|
export { List } from './list.js';
|
|
17
15
|
export { Logo } from './logo.js';
|
|
18
16
|
export type { LogoVariant } from './logo.js';
|
|
@@ -9,7 +9,6 @@ export { EnterPrompt } from './enter-prompt.js';
|
|
|
9
9
|
export { ExecutionChanges, ExecutionContent, ExecutionInput, ExecutionProgress, ExecutionStatus, ExpandedLogView, LogItem, truncateContent, } from './execution/index.js';
|
|
10
10
|
export { Footer } from './footer.js';
|
|
11
11
|
export { Header } from './header.js';
|
|
12
|
-
export { Init } from './init.js';
|
|
13
12
|
export { List } from './list.js';
|
|
14
13
|
export { Logo } from './logo.js';
|
|
15
14
|
export { Markdown } from './markdown.js';
|
|
@@ -185,9 +185,15 @@ export function useActivityLogs() {
|
|
|
185
185
|
toolCallName: tc.toolName,
|
|
186
186
|
}));
|
|
187
187
|
const changes = composeChangesFromToolCalls(task.toolCalls);
|
|
188
|
+
let content = task.status === 'error' ? formatTaskError(task.error) : (task.result ?? '');
|
|
189
|
+
if (task.reviewNotification) {
|
|
190
|
+
const { pendingCount, reviewUrl } = task.reviewNotification;
|
|
191
|
+
const fileLabel = pendingCount === 1 ? 'file needs' : 'files need';
|
|
192
|
+
content += `\n\n⚠ ${pendingCount} ${fileLabel} review: ${reviewUrl}`;
|
|
193
|
+
}
|
|
188
194
|
const activityLog = {
|
|
189
195
|
changes,
|
|
190
|
-
content
|
|
196
|
+
content,
|
|
191
197
|
files: task.files,
|
|
192
198
|
folders: task.folders,
|
|
193
199
|
id: task.taskId,
|
|
@@ -14,6 +14,7 @@ import { queryCommand } from './query.js';
|
|
|
14
14
|
import { resetCommand } from './reset.js';
|
|
15
15
|
import { spaceCommand } from './space.js';
|
|
16
16
|
import { statusCommand } from './status.js';
|
|
17
|
+
import { vcCommand } from './vc.js';
|
|
17
18
|
/**
|
|
18
19
|
* Load all REPL slash commands.
|
|
19
20
|
*
|
|
@@ -38,6 +39,8 @@ export const load = () => [
|
|
|
38
39
|
modelCommand,
|
|
39
40
|
// Space management
|
|
40
41
|
spaceCommand,
|
|
42
|
+
// Git semantic (vc commands)
|
|
43
|
+
vcCommand,
|
|
41
44
|
// Context tree management
|
|
42
45
|
resetCommand,
|
|
43
46
|
// Session management
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SpaceListView } from '../../space/components/space-list-view.js';
|
|
3
|
-
import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
-
const listFlags = {
|
|
5
|
-
json: Flags.boolean({
|
|
6
|
-
char: 'j',
|
|
7
|
-
default: false,
|
|
8
|
-
description: 'Output in JSON format',
|
|
9
|
-
}),
|
|
10
|
-
};
|
|
1
|
+
import { getStatus } from '../../status/api/get-status.js';
|
|
11
2
|
export const spaceListCommand = {
|
|
12
|
-
async action(
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
async action() {
|
|
4
|
+
const { status } = await getStatus();
|
|
5
|
+
const isVc = status.contextTreeStatus === 'git_vc';
|
|
6
|
+
const content = isVc
|
|
7
|
+
? 'The space list command has been deprecated. Visit the ByteRover web dashboard to view your spaces.'
|
|
8
|
+
: 'The space list command has been deprecated. Visit the ByteRover web dashboard to view your spaces and follow the migration guide to version control.';
|
|
9
|
+
return { content, messageType: 'error', type: 'message' };
|
|
18
10
|
},
|
|
19
|
-
description: 'List all spaces
|
|
20
|
-
flags: toCommandFlags(listFlags),
|
|
11
|
+
description: 'List all spaces (deprecated)',
|
|
21
12
|
name: 'list',
|
|
22
13
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SpaceSwitchFlow } from '../../space/components/space-switch-flow.js';
|
|
1
|
+
import { getStatus } from '../../status/api/get-status.js';
|
|
3
2
|
export const spaceSwitchCommand = {
|
|
4
|
-
action
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
async action() {
|
|
4
|
+
const { status } = await getStatus();
|
|
5
|
+
const isVc = status.contextTreeStatus === 'git_vc';
|
|
6
|
+
const content = isVc
|
|
7
|
+
? 'The space switch command has been deprecated. To work with a different space, use: brv vc clone <url>'
|
|
8
|
+
: 'The space switch command has been deprecated. Visit the ByteRover web dashboard to follow the migration guide from snapshot to version control.';
|
|
9
|
+
return { content, messageType: 'error', type: 'message' };
|
|
10
|
+
},
|
|
11
|
+
description: 'Switch to a different space (deprecated)',
|
|
8
12
|
name: 'switch',
|
|
9
13
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcAddFlow } from '../../vc/add/components/vc-add-flow.js';
|
|
3
|
+
import { parseReplArgs } from '../utils/arg-parser.js';
|
|
4
|
+
export const vcAddSubCommand = {
|
|
5
|
+
async action(_context, rawArgs) {
|
|
6
|
+
const parsed = await parseReplArgs(rawArgs, { strict: false });
|
|
7
|
+
// argv contains all non-flag tokens; default to '.' like git add .
|
|
8
|
+
const filePaths = parsed.argv.length > 0 ? parsed.argv : ['.'];
|
|
9
|
+
return {
|
|
10
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcAddFlow, { filePaths, onCancel, onComplete }),
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
description: 'Stage files for the next commit',
|
|
14
|
+
name: 'add',
|
|
15
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcBranchFlow } from '../../vc/branch/components/vc-branch-flow.js';
|
|
3
|
+
import { Args, Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
+
const vcBranchArgs = {
|
|
5
|
+
name: Args.string({ description: 'Branch name to create' }),
|
|
6
|
+
};
|
|
7
|
+
const vcBranchFlags = {
|
|
8
|
+
all: Flags.boolean({ char: 'a', default: false, description: 'List all branches including remote-tracking' }),
|
|
9
|
+
delete: Flags.string({ char: 'd', description: 'Delete a branch by name' }),
|
|
10
|
+
'set-upstream-to': Flags.string({ description: 'Set upstream tracking (e.g. origin/main)' }),
|
|
11
|
+
};
|
|
12
|
+
function resolveRequest(parsed) {
|
|
13
|
+
if (parsed.flags['set-upstream-to'])
|
|
14
|
+
return { action: 'set-upstream', upstream: parsed.flags['set-upstream-to'] };
|
|
15
|
+
if (parsed.flags.delete)
|
|
16
|
+
return { action: 'delete', name: parsed.flags.delete };
|
|
17
|
+
if (parsed.args.name)
|
|
18
|
+
return { action: 'create', name: parsed.args.name };
|
|
19
|
+
return { action: 'list', all: parsed.flags.all };
|
|
20
|
+
}
|
|
21
|
+
export const vcBranchSubCommand = {
|
|
22
|
+
async action(_context, rawArgs) {
|
|
23
|
+
const parsed = await parseReplArgs(rawArgs, { args: vcBranchArgs, flags: vcBranchFlags, strict: false });
|
|
24
|
+
const request = resolveRequest(parsed);
|
|
25
|
+
return {
|
|
26
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcBranchFlow, { onCancel, onComplete, request }),
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
args: [{ description: 'Branch name to create', name: 'name' }],
|
|
30
|
+
description: 'List, create, or delete local branches',
|
|
31
|
+
flags: toCommandFlags(vcBranchFlags),
|
|
32
|
+
name: 'branch',
|
|
33
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcCheckoutFlow } from '../../vc/checkout/components/vc-checkout-flow.js';
|
|
3
|
+
import { Args, Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
+
const vcCheckoutArgs = {
|
|
5
|
+
branch: Args.string({ description: 'Branch to switch to', required: true }),
|
|
6
|
+
};
|
|
7
|
+
const vcCheckoutFlags = {
|
|
8
|
+
create: Flags.boolean({ char: 'b', default: false, description: 'Create a new branch and switch to it' }),
|
|
9
|
+
force: Flags.boolean({ default: false, description: 'Discard local changes and switch' }),
|
|
10
|
+
};
|
|
11
|
+
function resolveRequest(parsed) {
|
|
12
|
+
if (!parsed.args.branch)
|
|
13
|
+
throw new Error('Branch name is required.');
|
|
14
|
+
return {
|
|
15
|
+
branch: parsed.args.branch,
|
|
16
|
+
create: parsed.flags.create,
|
|
17
|
+
force: parsed.flags.force,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export const vcCheckoutSubCommand = {
|
|
21
|
+
async action(_context, rawArgs) {
|
|
22
|
+
const parsed = await parseReplArgs(rawArgs, { args: vcCheckoutArgs, flags: vcCheckoutFlags, strict: false });
|
|
23
|
+
const request = resolveRequest(parsed);
|
|
24
|
+
return {
|
|
25
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcCheckoutFlow, { onCancel, onComplete, request }),
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
args: [{ description: 'Branch to switch to', name: 'branch', required: true }],
|
|
29
|
+
description: 'Switch to an existing branch, or create and switch with -b',
|
|
30
|
+
flags: toCommandFlags(vcCheckoutFlags),
|
|
31
|
+
name: 'checkout',
|
|
32
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcCloneFlow } from '../../vc/clone/components/vc-clone-flow.js';
|
|
3
|
+
import { Args, parseReplArgs } from '../utils/arg-parser.js';
|
|
4
|
+
const vcCloneArgs = {
|
|
5
|
+
url: Args.string({ description: 'Clone URL (optional — prompts for URL if omitted)' }),
|
|
6
|
+
};
|
|
7
|
+
export const vcCloneSubCommand = {
|
|
8
|
+
async action(_context, rawArgs) {
|
|
9
|
+
const parsed = await parseReplArgs(rawArgs, { args: vcCloneArgs, strict: false });
|
|
10
|
+
const { url } = parsed.args;
|
|
11
|
+
return {
|
|
12
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcCloneFlow, { onCancel, onComplete, url }),
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
args: [{ description: 'Clone URL (optional)', name: 'url' }],
|
|
16
|
+
description: 'Clone a ByteRover space repository',
|
|
17
|
+
name: 'clone',
|
|
18
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcCommitFlow } from '../../vc/commit/components/vc-commit-flow.js';
|
|
3
|
+
import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
+
const vcCommitFlags = {
|
|
5
|
+
message: Flags.string({ char: 'm', description: 'Commit message' }),
|
|
6
|
+
};
|
|
7
|
+
export const vcCommitSubCommand = {
|
|
8
|
+
async action(_context, rawArgs) {
|
|
9
|
+
const parsed = await parseReplArgs(rawArgs, { flags: vcCommitFlags, strict: false });
|
|
10
|
+
// Join remaining argv with the flag value to support unquoted multi-word messages
|
|
11
|
+
// e.g. /vc commit -m hello world → message = "hello world"
|
|
12
|
+
// e.g. /vc commit hello world → message = "hello world"
|
|
13
|
+
const extra = parsed.argv.join(' ');
|
|
14
|
+
const message = parsed.flags.message
|
|
15
|
+
? (extra ? `${parsed.flags.message} ${extra}` : parsed.flags.message)
|
|
16
|
+
: (extra || undefined);
|
|
17
|
+
if (!message) {
|
|
18
|
+
const errorMsg = {
|
|
19
|
+
content: 'Usage: /vc commit -m "<message>"',
|
|
20
|
+
messageType: 'error',
|
|
21
|
+
type: 'message',
|
|
22
|
+
};
|
|
23
|
+
return errorMsg;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcCommitFlow, { message, onCancel, onComplete }),
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
description: 'Save staged changes as a commit',
|
|
30
|
+
flags: toCommandFlags(vcCommitFlags),
|
|
31
|
+
name: 'commit',
|
|
32
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { isVcConfigKey } from '../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { VcConfigFlow } from '../../vc/config/components/vc-config-flow.js';
|
|
4
|
+
import { Args, parseReplArgs } from '../utils/arg-parser.js';
|
|
5
|
+
const vcConfigArgs = {
|
|
6
|
+
key: Args.string({ description: 'Config key (user.name or user.email)' }),
|
|
7
|
+
value: Args.string({ description: 'Config value to set (omit to get current value)' }),
|
|
8
|
+
};
|
|
9
|
+
export const vcConfigSubCommand = {
|
|
10
|
+
async action(_context, rawArgs) {
|
|
11
|
+
const parsed = await parseReplArgs(rawArgs, { args: vcConfigArgs, strict: false });
|
|
12
|
+
const { key } = parsed.args;
|
|
13
|
+
const { value } = parsed.args;
|
|
14
|
+
if (!key) {
|
|
15
|
+
const errorMsg = {
|
|
16
|
+
content: 'Usage: /vc config user.name "<value>" | /vc config user.email "<value>"',
|
|
17
|
+
messageType: 'error',
|
|
18
|
+
type: 'message',
|
|
19
|
+
};
|
|
20
|
+
return errorMsg;
|
|
21
|
+
}
|
|
22
|
+
if (!isVcConfigKey(key)) {
|
|
23
|
+
const errorMsg = {
|
|
24
|
+
content: `Unknown key '${key}'. Allowed: user.name, user.email.`,
|
|
25
|
+
messageType: 'error',
|
|
26
|
+
type: 'message',
|
|
27
|
+
};
|
|
28
|
+
return errorMsg;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcConfigFlow, { configKey: key, onCancel, onComplete, value }),
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
args: [
|
|
35
|
+
{ description: 'Config key (user.name or user.email)', name: 'key' },
|
|
36
|
+
{ description: 'Value to set (omit to read current value)', name: 'value' },
|
|
37
|
+
],
|
|
38
|
+
description: 'Get or set commit author for ByteRover version control',
|
|
39
|
+
name: 'config',
|
|
40
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcFetchFlow } from '../../vc/fetch/components/vc-fetch-flow.js';
|
|
3
|
+
import { Args, parseReplArgs } from '../utils/arg-parser.js';
|
|
4
|
+
/* eslint-disable perfectionist/sort-objects -- positional order matters: remote before branch */
|
|
5
|
+
const vcFetchArgs = {
|
|
6
|
+
remote: Args.string({ description: 'Remote name (only origin supported)' }),
|
|
7
|
+
branch: Args.string({ description: 'Branch to fetch' }),
|
|
8
|
+
};
|
|
9
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
10
|
+
export const vcFetchSubCommand = {
|
|
11
|
+
async action(_context, rawArgs) {
|
|
12
|
+
const parsed = await parseReplArgs(rawArgs, { args: vcFetchArgs, strict: false });
|
|
13
|
+
const { branch, remote } = parsed.args;
|
|
14
|
+
if (remote && remote !== 'origin') {
|
|
15
|
+
const errorMsg = {
|
|
16
|
+
content: `Only 'origin' remote is currently supported.`,
|
|
17
|
+
messageType: 'error',
|
|
18
|
+
type: 'message',
|
|
19
|
+
};
|
|
20
|
+
return errorMsg;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcFetchFlow, {
|
|
24
|
+
onCancel,
|
|
25
|
+
onComplete,
|
|
26
|
+
ref: branch,
|
|
27
|
+
remote,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
args: [
|
|
32
|
+
{ description: 'Remote name (only origin supported)', name: 'remote', required: false },
|
|
33
|
+
{ description: 'Branch to fetch', name: 'branch', required: false },
|
|
34
|
+
],
|
|
35
|
+
description: 'Fetch refs from ByteRover cloud',
|
|
36
|
+
name: 'fetch',
|
|
37
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcInitFlow } from '../../vc/init/components/vc-init-flow.js';
|
|
3
|
+
export const vcInitSubCommand = {
|
|
4
|
+
action() {
|
|
5
|
+
return {
|
|
6
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcInitFlow, { onCancel, onComplete }),
|
|
7
|
+
};
|
|
8
|
+
},
|
|
9
|
+
description: 'Initialize ByteRover version control for context tree',
|
|
10
|
+
name: 'init',
|
|
11
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LogFlow } from '../../log/components/log-flow.js';
|
|
3
|
+
import { Args, Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
+
const vcLogArgs = {
|
|
5
|
+
branch: Args.string({ description: 'Branch name to show history for' }),
|
|
6
|
+
};
|
|
7
|
+
const vcLogFlags = {
|
|
8
|
+
all: Flags.boolean({ char: 'a', default: false, description: 'Show commits from all branches' }),
|
|
9
|
+
limit: Flags.string({ default: '10', description: 'Number of commits to show (default: 10)' }),
|
|
10
|
+
};
|
|
11
|
+
export const vcLogSubCommand = {
|
|
12
|
+
async action(_context, args) {
|
|
13
|
+
const parsed = await parseReplArgs(args, { args: vcLogArgs, flags: vcLogFlags, strict: false });
|
|
14
|
+
const limit = Number(parsed.flags.limit ?? '10');
|
|
15
|
+
const all = parsed.flags.all ?? false;
|
|
16
|
+
const { branch } = parsed.args;
|
|
17
|
+
return {
|
|
18
|
+
render: ({ onCancel, onComplete }) => React.createElement(LogFlow, { all, branch, limit, onCancel, onComplete }),
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
args: [{ description: 'Branch name to show history for', name: 'branch' }],
|
|
22
|
+
description: 'Show commit history for the context-tree',
|
|
23
|
+
flags: toCommandFlags(vcLogFlags),
|
|
24
|
+
name: 'log',
|
|
25
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcMergeFlow } from '../../vc/merge/components/vc-merge-flow.js';
|
|
3
|
+
import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
+
const vcMergeFlags = {
|
|
5
|
+
abort: Flags.boolean({ description: 'Abort the current merge', exclusive: ['continue'] }),
|
|
6
|
+
'allow-unrelated-histories': Flags.boolean({ default: false, description: 'Allow merging unrelated histories' }),
|
|
7
|
+
continue: Flags.boolean({ description: 'Continue after resolving conflicts', exclusive: ['abort'] }),
|
|
8
|
+
message: Flags.string({ char: 'm', description: 'Merge commit message' }),
|
|
9
|
+
};
|
|
10
|
+
export const vcMergeSubCommand = {
|
|
11
|
+
async action(_context, rawArgs) {
|
|
12
|
+
const parsed = await parseReplArgs(rawArgs, { flags: vcMergeFlags, strict: false });
|
|
13
|
+
const { abort, continue: cont, message } = parsed.flags;
|
|
14
|
+
const branch = parsed.argv[0];
|
|
15
|
+
if (abort) {
|
|
16
|
+
return {
|
|
17
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcMergeFlow, { action: 'abort', onCancel, onComplete }),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (cont) {
|
|
21
|
+
return {
|
|
22
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcMergeFlow, { action: 'continue', message, onCancel, onComplete }),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (!branch) {
|
|
26
|
+
const errorMsg = {
|
|
27
|
+
content: 'Usage: /vc merge <branch> | --abort | --continue',
|
|
28
|
+
messageType: 'error',
|
|
29
|
+
type: 'message',
|
|
30
|
+
};
|
|
31
|
+
return errorMsg;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcMergeFlow, {
|
|
35
|
+
action: 'merge',
|
|
36
|
+
allowUnrelatedHistories: parsed.flags['allow-unrelated-histories'],
|
|
37
|
+
branch,
|
|
38
|
+
message,
|
|
39
|
+
onCancel,
|
|
40
|
+
onComplete,
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
args: [{ description: 'Branch to merge', name: 'branch', required: false }],
|
|
45
|
+
description: 'Merge a branch into the current branch',
|
|
46
|
+
flags: toCommandFlags(vcMergeFlags),
|
|
47
|
+
name: 'merge',
|
|
48
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcPullFlow } from '../../vc/pull/components/vc-pull-flow.js';
|
|
3
|
+
import { Args, Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
+
/* eslint-disable perfectionist/sort-objects -- positional order matters: remote before branch */
|
|
5
|
+
const vcPullArgs = {
|
|
6
|
+
remote: Args.string({ description: 'Remote name (only origin supported)' }),
|
|
7
|
+
branch: Args.string({ description: 'Branch to pull' }),
|
|
8
|
+
};
|
|
9
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
10
|
+
const vcPullFlags = {
|
|
11
|
+
'allow-unrelated-histories': Flags.boolean({ default: false, description: 'Allow merging unrelated histories' }),
|
|
12
|
+
};
|
|
13
|
+
export const vcPullSubCommand = {
|
|
14
|
+
async action(_context, rawArgs) {
|
|
15
|
+
const parsed = await parseReplArgs(rawArgs, { args: vcPullArgs, flags: vcPullFlags, strict: false });
|
|
16
|
+
const { branch, remote } = parsed.args;
|
|
17
|
+
if (remote && remote !== 'origin') {
|
|
18
|
+
const errorMsg = {
|
|
19
|
+
content: `Only 'origin' remote is currently supported.`,
|
|
20
|
+
messageType: 'error',
|
|
21
|
+
type: 'message',
|
|
22
|
+
};
|
|
23
|
+
return errorMsg;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcPullFlow, {
|
|
27
|
+
allowUnrelatedHistories: parsed.flags['allow-unrelated-histories'],
|
|
28
|
+
branch,
|
|
29
|
+
onCancel,
|
|
30
|
+
onComplete,
|
|
31
|
+
remote,
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
args: [
|
|
36
|
+
{ description: 'Remote name (only origin supported)', name: 'remote', required: false },
|
|
37
|
+
{ description: 'Branch to pull', name: 'branch', required: false },
|
|
38
|
+
],
|
|
39
|
+
description: 'Pull commits from ByteRover cloud',
|
|
40
|
+
flags: toCommandFlags(vcPullFlags),
|
|
41
|
+
name: 'pull',
|
|
42
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcPushFlow } from '../../vc/push/components/vc-push-flow.js';
|
|
3
|
+
import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
+
const vcPushFlags = {
|
|
5
|
+
'set-upstream': Flags.boolean({ char: 'u', description: 'Set upstream tracking branch' }),
|
|
6
|
+
};
|
|
7
|
+
export const vcPushSubCommand = {
|
|
8
|
+
async action(_context, rawArgs) {
|
|
9
|
+
const parsed = await parseReplArgs(rawArgs, { flags: vcPushFlags, strict: false });
|
|
10
|
+
const { 'set-upstream': setUpstream } = parsed.flags;
|
|
11
|
+
const positional = parsed.argv ?? [];
|
|
12
|
+
// Git push semantics: push [<remote> [<branch>]]
|
|
13
|
+
// /vc push → current branch
|
|
14
|
+
// /vc push origin → current branch (explicit remote)
|
|
15
|
+
// /vc push origin feat/x → feat/x
|
|
16
|
+
// /vc push feat/x → error (unknown remote)
|
|
17
|
+
let branch;
|
|
18
|
+
if (positional.length >= 2) {
|
|
19
|
+
if (positional[0] !== 'origin') {
|
|
20
|
+
throw new Error(`Unknown remote '${positional[0]}'.`);
|
|
21
|
+
}
|
|
22
|
+
branch = positional[1];
|
|
23
|
+
}
|
|
24
|
+
else if (positional.length === 1 && positional[0] !== 'origin') {
|
|
25
|
+
throw new Error(`Unknown remote '${positional[0]}'. Use '/vc push origin ${positional[0]}' to push a specific branch.`);
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcPushFlow, { branch, onCancel, onComplete, setUpstream }),
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
args: [
|
|
32
|
+
{ description: 'Remote name (e.g. origin)', name: 'remote', required: false },
|
|
33
|
+
{ description: 'Branch to push to', name: 'branch', required: false },
|
|
34
|
+
],
|
|
35
|
+
description: 'Push commits to ByteRover cloud',
|
|
36
|
+
flags: toCommandFlags(vcPushFlags),
|
|
37
|
+
name: 'push',
|
|
38
|
+
};
|