byterover-cli 2.6.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.production +1 -0
- package/README.md +240 -14
- 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 -0
- package/dist/server/config/environment.js +2 -0
- package/dist/server/constants.d.ts +3 -0
- package/dist/server/constants.js +9 -0
- 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/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 -0
- package/dist/server/core/domain/errors/task-error.js +8 -0
- 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/services/i-git-service.js +1 -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/storage/i-review-backup-store.js +1 -0
- package/dist/server/core/interfaces/vc/i-vc-git-config-store.d.ts +8 -0
- package/dist/server/core/interfaces/vc/i-vc-git-config-store.js +1 -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/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/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/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-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/gitignore.d.ts +9 -0
- package/dist/server/utils/gitignore.js +47 -0
- 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/oclif.manifest.json +1018 -98
- package/package.json +9 -3
- 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/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
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { isVcRemoteSubcommand } from '../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { getGitRemoteBaseUrl } from '../../../lib/environment.js';
|
|
4
|
+
import { VcRemoteFlow } from '../../vc/remote/components/vc-remote-flow.js';
|
|
5
|
+
import { Args, parseReplArgs } from '../utils/arg-parser.js';
|
|
6
|
+
/* eslint-disable perfectionist/sort-objects -- positional order matters: subcommand, name, url */
|
|
7
|
+
const vcRemoteArgs = {
|
|
8
|
+
subcommand: Args.string({ description: 'Subcommand: add | set-url (omit to show current remote)' }),
|
|
9
|
+
name: Args.string({ description: 'Remote name (e.g. origin)' }),
|
|
10
|
+
url: Args.string({ description: `Remote URL (e.g. ${getGitRemoteBaseUrl()}/<team>/<space>.git)` }),
|
|
11
|
+
};
|
|
12
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
13
|
+
export const vcRemoteSubCommand = {
|
|
14
|
+
async action(_context, rawArgs) {
|
|
15
|
+
const parsed = await parseReplArgs(rawArgs, { args: vcRemoteArgs, strict: false });
|
|
16
|
+
const { name, subcommand: rawSubcommand, url } = parsed.args;
|
|
17
|
+
if (!rawSubcommand) {
|
|
18
|
+
return {
|
|
19
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcRemoteFlow, { onCancel, onComplete, subcommand: 'show' }),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (!isVcRemoteSubcommand(rawSubcommand)) {
|
|
23
|
+
const errorMsg = {
|
|
24
|
+
content: `Unknown subcommand '${rawSubcommand}'. Usage: /vc remote [add|set-url] <name> <url>`,
|
|
25
|
+
messageType: 'error',
|
|
26
|
+
type: 'message',
|
|
27
|
+
};
|
|
28
|
+
return errorMsg;
|
|
29
|
+
}
|
|
30
|
+
if (!name || !url) {
|
|
31
|
+
const errorMsg = {
|
|
32
|
+
content: `Usage: /vc remote ${rawSubcommand} <name> <url>`,
|
|
33
|
+
messageType: 'error',
|
|
34
|
+
type: 'message',
|
|
35
|
+
};
|
|
36
|
+
return errorMsg;
|
|
37
|
+
}
|
|
38
|
+
if (name !== 'origin') {
|
|
39
|
+
const errorMsg = {
|
|
40
|
+
content: `Only 'origin' remote is currently supported.`,
|
|
41
|
+
messageType: 'error',
|
|
42
|
+
type: 'message',
|
|
43
|
+
};
|
|
44
|
+
return errorMsg;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcRemoteFlow, { onCancel, onComplete, subcommand: rawSubcommand, url }),
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
args: [
|
|
51
|
+
{ description: 'Subcommand: add | set-url (omit to show current remote)', name: 'subcommand' },
|
|
52
|
+
{ description: 'Remote name (e.g. origin)', name: 'name' },
|
|
53
|
+
{ description: 'Remote URL', name: 'url' },
|
|
54
|
+
],
|
|
55
|
+
description: 'Manage remote origin for ByteRover version control',
|
|
56
|
+
name: 'remote',
|
|
57
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcResetFlow } from '../../vc/reset/components/vc-reset-flow.js';
|
|
3
|
+
import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
|
|
4
|
+
const vcResetFlags = {
|
|
5
|
+
hard: Flags.boolean({ description: 'Reset HEAD, index, and working tree', exclusive: ['soft'] }),
|
|
6
|
+
soft: Flags.boolean({ description: 'Reset HEAD only, keep changes staged', exclusive: ['hard'] }),
|
|
7
|
+
};
|
|
8
|
+
export const vcResetSubCommand = {
|
|
9
|
+
async action(_context, rawArgs) {
|
|
10
|
+
const parsed = await parseReplArgs(rawArgs, { flags: vcResetFlags, strict: false });
|
|
11
|
+
const { hard, soft } = parsed.flags;
|
|
12
|
+
const args = parsed.argv.filter((a) => typeof a === 'string');
|
|
13
|
+
// When --soft or --hard is set, first arg is the optional ref (default HEAD)
|
|
14
|
+
const mode = soft ? 'soft' : hard ? 'hard' : undefined;
|
|
15
|
+
const ref = mode ? args[0] : undefined;
|
|
16
|
+
const filePaths = mode ? undefined : (args.length > 0 ? args : undefined);
|
|
17
|
+
if (filePaths) {
|
|
18
|
+
return {
|
|
19
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcResetFlow, { filePaths, onCancel, onComplete }),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (mode) {
|
|
23
|
+
return {
|
|
24
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcResetFlow, { mode, onCancel, onComplete, ref }),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcResetFlow, { onCancel, onComplete }),
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
args: [{ description: 'File paths to unstage', name: 'files', required: false }],
|
|
32
|
+
description: 'Unstage files or undo commits',
|
|
33
|
+
flags: toCommandFlags(vcResetFlags),
|
|
34
|
+
name: 'reset',
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VcStatusFlow } from '../../vc/status/components/vc-status-flow.js';
|
|
3
|
+
export const vcStatusSubCommand = {
|
|
4
|
+
action() {
|
|
5
|
+
return {
|
|
6
|
+
render: ({ onCancel, onComplete }) => React.createElement(VcStatusFlow, { onCancel, onComplete }),
|
|
7
|
+
};
|
|
8
|
+
},
|
|
9
|
+
description: 'Show ByteRover version control status',
|
|
10
|
+
name: 'status',
|
|
11
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { vcAddSubCommand } from './vc-add.js';
|
|
2
|
+
import { vcBranchSubCommand } from './vc-branch.js';
|
|
3
|
+
import { vcCheckoutSubCommand } from './vc-checkout.js';
|
|
4
|
+
import { vcCloneSubCommand } from './vc-clone.js';
|
|
5
|
+
import { vcCommitSubCommand } from './vc-commit.js';
|
|
6
|
+
import { vcConfigSubCommand } from './vc-config.js';
|
|
7
|
+
import { vcFetchSubCommand } from './vc-fetch.js';
|
|
8
|
+
import { vcInitSubCommand } from './vc-init.js';
|
|
9
|
+
import { vcLogSubCommand } from './vc-log.js';
|
|
10
|
+
import { vcMergeSubCommand } from './vc-merge.js';
|
|
11
|
+
import { vcPullSubCommand } from './vc-pull.js';
|
|
12
|
+
import { vcPushSubCommand } from './vc-push.js';
|
|
13
|
+
import { vcRemoteSubCommand } from './vc-remote.js';
|
|
14
|
+
import { vcResetSubCommand } from './vc-reset.js';
|
|
15
|
+
import { vcStatusSubCommand } from './vc-status.js';
|
|
16
|
+
export const vcCommand = {
|
|
17
|
+
description: 'Version control commands for ByteRover',
|
|
18
|
+
name: 'vc',
|
|
19
|
+
subCommands: [
|
|
20
|
+
vcCloneSubCommand,
|
|
21
|
+
vcInitSubCommand,
|
|
22
|
+
vcAddSubCommand,
|
|
23
|
+
vcCommitSubCommand,
|
|
24
|
+
vcResetSubCommand,
|
|
25
|
+
vcFetchSubCommand,
|
|
26
|
+
vcPullSubCommand,
|
|
27
|
+
vcPushSubCommand,
|
|
28
|
+
vcStatusSubCommand,
|
|
29
|
+
vcLogSubCommand,
|
|
30
|
+
vcMergeSubCommand,
|
|
31
|
+
vcBranchSubCommand,
|
|
32
|
+
vcCheckoutSubCommand,
|
|
33
|
+
vcConfigSubCommand,
|
|
34
|
+
vcRemoteSubCommand,
|
|
35
|
+
],
|
|
36
|
+
};
|
|
@@ -96,14 +96,14 @@ export function useSlashCommandProcessor(context, commands) {
|
|
|
96
96
|
type: 'message',
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
// Extract file and folder references from args
|
|
100
|
-
|
|
101
|
-
const
|
|
99
|
+
// Extract file and folder references from args for context metadata.
|
|
100
|
+
// Pass the original args string to the action — parseReplArgs handles quote-aware splitting internally.
|
|
101
|
+
const { files, folders } = splitArgs(args);
|
|
102
102
|
// Build execution context with invocation details
|
|
103
103
|
const execContext = {
|
|
104
104
|
...context,
|
|
105
105
|
invocation: {
|
|
106
|
-
args
|
|
106
|
+
args,
|
|
107
107
|
files,
|
|
108
108
|
folders,
|
|
109
109
|
name: commandNameForContext,
|
|
@@ -112,7 +112,7 @@ export function useSlashCommandProcessor(context, commands) {
|
|
|
112
112
|
};
|
|
113
113
|
setIsProcessing(true);
|
|
114
114
|
try {
|
|
115
|
-
const result = await actionToExecute(execContext,
|
|
115
|
+
const result = await actionToExecute(execContext, args);
|
|
116
116
|
return result;
|
|
117
117
|
}
|
|
118
118
|
catch (error) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../lib/react-query.js';
|
|
2
|
+
import { type IVcLogRequest, type IVcLogResponse } from '../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeLog: (req: IVcLogRequest) => Promise<IVcLogResponse>;
|
|
4
|
+
type UseExecuteLogOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeLog>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteLog: ({ mutationConfig }?: UseExecuteLogOptions) => import("@tanstack/react-query").UseMutationResult<IVcLogResponse, Error, IVcLogRequest, 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 executeLog = (req) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.LOG, req);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteLog = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeLog,
|
|
13
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LogFlow Component
|
|
3
|
+
*
|
|
4
|
+
* Fetches and displays git commit history for the context-tree via VcHandler.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { CustomDialogCallbacks } from '../../../types/commands.js';
|
|
8
|
+
type LogFlowProps = CustomDialogCallbacks & {
|
|
9
|
+
all: boolean;
|
|
10
|
+
branch: string | undefined;
|
|
11
|
+
limit: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function LogFlow({ all, branch, limit, onComplete }: LogFlowProps): React.ReactNode;
|
|
14
|
+
export {};
|