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,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 {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* LogFlow Component
|
|
4
|
+
*
|
|
5
|
+
* Fetches and displays git commit history for the context-tree via VcHandler.
|
|
6
|
+
*/
|
|
7
|
+
import { Text } from 'ink';
|
|
8
|
+
import Spinner from 'ink-spinner';
|
|
9
|
+
import { useEffect } from 'react';
|
|
10
|
+
import { useExecuteLog } from '../api/execute-log.js';
|
|
11
|
+
import { formatCommitLog } from '../utils/format-log.js';
|
|
12
|
+
export function LogFlow({ all, branch, limit, onComplete }) {
|
|
13
|
+
const logMutation = useExecuteLog();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
logMutation.mutate({ all, limit, ref: branch }, {
|
|
16
|
+
onError(error) {
|
|
17
|
+
onComplete(`Failed to get log: ${error.message.replace(/ for event '[^']+'$/, '')}`);
|
|
18
|
+
},
|
|
19
|
+
onSuccess(result) {
|
|
20
|
+
if (result.commits.length === 0) {
|
|
21
|
+
onComplete('No commits found.');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
onComplete(formatCommitLog(result.commits, result.currentBranch));
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}, []);
|
|
28
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Loading commit history..."] }));
|
|
29
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
export function formatRelativeDate(date) {
|
|
3
|
+
const now = Date.now();
|
|
4
|
+
const diffMs = now - date.getTime();
|
|
5
|
+
const diffSec = Math.floor(diffMs / 1000);
|
|
6
|
+
if (diffSec < 60)
|
|
7
|
+
return `${diffSec} second${diffSec === 1 ? '' : 's'} ago`;
|
|
8
|
+
const diffMin = Math.floor(diffSec / 60);
|
|
9
|
+
if (diffMin < 60)
|
|
10
|
+
return `${diffMin} minute${diffMin === 1 ? '' : 's'} ago`;
|
|
11
|
+
const diffHour = Math.floor(diffMin / 60);
|
|
12
|
+
if (diffHour < 24)
|
|
13
|
+
return `${diffHour} hour${diffHour === 1 ? '' : 's'} ago`;
|
|
14
|
+
const diffDay = Math.floor(diffHour / 24);
|
|
15
|
+
if (diffDay < 30)
|
|
16
|
+
return `${diffDay} day${diffDay === 1 ? '' : 's'} ago`;
|
|
17
|
+
const diffMonth = Math.floor(diffDay / 30);
|
|
18
|
+
if (diffMonth < 12)
|
|
19
|
+
return `${diffMonth} month${diffMonth === 1 ? '' : 's'} ago`;
|
|
20
|
+
const diffYear = Math.floor(diffMonth / 12);
|
|
21
|
+
return `${diffYear} year${diffYear === 1 ? '' : 's'} ago`;
|
|
22
|
+
}
|
|
23
|
+
export function formatCommitLog(commits, currentBranch) {
|
|
24
|
+
if (commits.length === 0)
|
|
25
|
+
return '';
|
|
26
|
+
return commits
|
|
27
|
+
.map((commit, index) => {
|
|
28
|
+
const shortSha = chalk.yellow(commit.sha.slice(0, 7));
|
|
29
|
+
const headMarker = index === 0
|
|
30
|
+
? currentBranch
|
|
31
|
+
? ` ${chalk.yellow.bold(`(HEAD -> ${currentBranch})`)}`
|
|
32
|
+
: ` ${chalk.yellow.bold('(HEAD)')}`
|
|
33
|
+
: '';
|
|
34
|
+
const relativeDate = formatRelativeDate(new Date(commit.timestamp));
|
|
35
|
+
return [
|
|
36
|
+
`* ${shortSha}${headMarker} ${commit.message}`,
|
|
37
|
+
` Author: ${commit.author.name} <${commit.author.email}>`,
|
|
38
|
+
` ${relativeDate}`,
|
|
39
|
+
].join('\n');
|
|
40
|
+
})
|
|
41
|
+
.join('\n\n');
|
|
42
|
+
}
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* This is the single source of truth for determining what UI to show.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Application view modes as a discriminated union.
|
|
9
9
|
*/
|
|
10
10
|
export type AppViewMode = {
|
|
11
11
|
type: 'config-provider';
|
|
12
|
+
} | {
|
|
13
|
+
type: 'init-project';
|
|
12
14
|
} | {
|
|
13
15
|
type: 'loading';
|
|
14
16
|
} | {
|
|
@@ -20,6 +22,7 @@ export type AppViewMode = {
|
|
|
20
22
|
export type DeriveAppViewModeParams = {
|
|
21
23
|
activeModel?: string;
|
|
22
24
|
activeProviderId?: string;
|
|
25
|
+
contextTreeStatus?: string;
|
|
23
26
|
isAuthorized: boolean;
|
|
24
27
|
isLoading: boolean;
|
|
25
28
|
};
|
|
@@ -29,10 +32,11 @@ export type DeriveAppViewModeParams = {
|
|
|
29
32
|
*
|
|
30
33
|
* Decision tree:
|
|
31
34
|
* 1. Loading → 'loading'
|
|
32
|
-
* 2.
|
|
33
|
-
* 3. ByteRover +
|
|
34
|
-
* 4.
|
|
35
|
-
* 5.
|
|
35
|
+
* 2. Project not initialized → 'init-project'
|
|
36
|
+
* 3. ByteRover + unauthenticated → 'config-provider'
|
|
37
|
+
* 4. ByteRover + authenticated → 'ready'
|
|
38
|
+
* 5. Non-byterover + no active model → 'config-provider'
|
|
39
|
+
* 6. Otherwise → 'ready'
|
|
36
40
|
*/
|
|
37
41
|
export declare function deriveAppViewMode(params: DeriveAppViewModeParams): AppViewMode;
|
|
38
42
|
/**
|
|
@@ -6,21 +6,26 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { useAuthStore } from '../../auth/stores/auth-store.js';
|
|
8
8
|
import { useGetActiveProviderConfig } from '../../provider/api/get-active-provider-config.js';
|
|
9
|
+
import { useGetStatus } from '../../status/api/get-status.js';
|
|
9
10
|
/**
|
|
10
11
|
* Pure decision logic for determining the app view mode.
|
|
11
12
|
* Extracted from useAppViewMode for testability.
|
|
12
13
|
*
|
|
13
14
|
* Decision tree:
|
|
14
15
|
* 1. Loading → 'loading'
|
|
15
|
-
* 2.
|
|
16
|
-
* 3. ByteRover +
|
|
17
|
-
* 4.
|
|
18
|
-
* 5.
|
|
16
|
+
* 2. Project not initialized → 'init-project'
|
|
17
|
+
* 3. ByteRover + unauthenticated → 'config-provider'
|
|
18
|
+
* 4. ByteRover + authenticated → 'ready'
|
|
19
|
+
* 5. Non-byterover + no active model → 'config-provider'
|
|
20
|
+
* 6. Otherwise → 'ready'
|
|
19
21
|
*/
|
|
20
22
|
export function deriveAppViewMode(params) {
|
|
21
23
|
if (params.isLoading) {
|
|
22
24
|
return { type: 'loading' };
|
|
23
25
|
}
|
|
26
|
+
// if (['not_initialized', 'unknown'].includes(params.contextTreeStatus || '')) {
|
|
27
|
+
// return {type: 'init-project'}
|
|
28
|
+
// }
|
|
24
29
|
if (params.activeProviderId === 'byterover' && !params.isAuthorized) {
|
|
25
30
|
return { type: 'config-provider' };
|
|
26
31
|
}
|
|
@@ -38,11 +43,13 @@ export function deriveAppViewMode(params) {
|
|
|
38
43
|
*/
|
|
39
44
|
export function useAppViewMode() {
|
|
40
45
|
const { isAuthorized, isLoadingInitial: isLoadingAuth } = useAuthStore();
|
|
46
|
+
const { data: statusData, isLoading: isLoadingStatus } = useGetStatus();
|
|
41
47
|
const { data: activeData, isLoading: isLoadingActive } = useGetActiveProviderConfig();
|
|
42
48
|
return deriveAppViewMode({
|
|
43
49
|
activeModel: activeData?.activeModel,
|
|
44
50
|
activeProviderId: activeData?.activeProviderId,
|
|
51
|
+
contextTreeStatus: statusData?.status.contextTreeStatus,
|
|
45
52
|
isAuthorized,
|
|
46
|
-
isLoading: isLoadingAuth || isLoadingActive,
|
|
53
|
+
isLoading: isLoadingAuth || isLoadingStatus || isLoadingActive,
|
|
47
54
|
});
|
|
48
55
|
}
|
|
@@ -27,7 +27,14 @@ export function PushFlow({ branch, onComplete, skipConfirm }) {
|
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
if (prepareData && !prepareData.hasChanges) {
|
|
30
|
-
|
|
30
|
+
if (prepareData.excludedReviewCount > 0) {
|
|
31
|
+
const fileLabel = prepareData.excludedReviewCount === 1 ? 'file is' : 'files are';
|
|
32
|
+
onComplete(`No pushable changes. ${prepareData.excludedReviewCount} ${fileLabel} pending review.` +
|
|
33
|
+
(prepareData.reviewUrl ? `\n Review: ${prepareData.reviewUrl}` : ''));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
onComplete('No context changes to push.');
|
|
37
|
+
}
|
|
31
38
|
return;
|
|
32
39
|
}
|
|
33
40
|
if (prepareData) {
|
|
@@ -70,7 +77,7 @@ export function PushFlow({ branch, onComplete, skipConfirm }) {
|
|
|
70
77
|
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Checking for Context Tree changes..."] }));
|
|
71
78
|
}
|
|
72
79
|
if (step === 'confirm' && prepareData) {
|
|
73
|
-
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: `Changes found: ${prepareData.summary} (${prepareData.fileCount} files)` }), _jsx(Text, { children: `\nYou are about to push to ByteRover memory storage:` }), _jsx(Text, { children: ` Branch: ${branch}` }), _jsx(InlineConfirm, { default: false, message: "Push to ByteRover", onConfirm: (confirmed) => {
|
|
80
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: `Changes found: ${prepareData.summary} (${prepareData.fileCount} files)` }), prepareData.excludedReviewCount > 0 && (_jsxs(Text, { color: "yellow", children: [`⚠ ${prepareData.excludedReviewCount} file(s) excluded from push (pending/rejected review).`, prepareData.reviewUrl ? `\n Review: ${prepareData.reviewUrl}` : ''] })), _jsx(Text, { children: `\nYou are about to push to ByteRover memory storage:` }), _jsx(Text, { children: ` Branch: ${branch}` }), _jsx(InlineConfirm, { default: false, message: "Push to ByteRover", onConfirm: (confirmed) => {
|
|
74
81
|
if (confirmed) {
|
|
75
82
|
setStep('executing');
|
|
76
83
|
}
|
|
@@ -8,6 +8,7 @@ import { Text } from 'ink';
|
|
|
8
8
|
import Spinner from 'ink-spinner';
|
|
9
9
|
import { useEffect, useState } from 'react';
|
|
10
10
|
import { InlineConfirm } from '../../../components/inline-prompts/inline-confirm.js';
|
|
11
|
+
import { formatTransportError } from '../../../utils/error-messages.js';
|
|
11
12
|
import { useExecuteReset } from '../api/execute-reset.js';
|
|
12
13
|
export function ResetFlow({ onComplete, skipConfirm }) {
|
|
13
14
|
const [step, setStep] = useState(skipConfirm ? 'executing' : 'confirm');
|
|
@@ -18,7 +19,7 @@ export function ResetFlow({ onComplete, skipConfirm }) {
|
|
|
18
19
|
return;
|
|
19
20
|
resetMutation.mutate(undefined, {
|
|
20
21
|
onError(error) {
|
|
21
|
-
onComplete(`Failed to reset context tree: ${error
|
|
22
|
+
onComplete(`Failed to reset context tree: ${formatTransportError(error)}`);
|
|
22
23
|
},
|
|
23
24
|
onSuccess(result) {
|
|
24
25
|
if (result.success) {
|
|
@@ -7,6 +7,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { Text } from 'ink';
|
|
8
8
|
import Spinner from 'ink-spinner';
|
|
9
9
|
import { useEffect } from 'react';
|
|
10
|
+
import { formatTransportError } from '../../../utils/error-messages.js';
|
|
10
11
|
import { useGetStatus } from '../api/get-status.js';
|
|
11
12
|
import { formatStatus } from '../utils/format-status.js';
|
|
12
13
|
export function StatusView({ onComplete, version }) {
|
|
@@ -16,7 +17,7 @@ export function StatusView({ onComplete, version }) {
|
|
|
16
17
|
onComplete(formatStatus(data.status, version));
|
|
17
18
|
}
|
|
18
19
|
if (error) {
|
|
19
|
-
onComplete(`Failed to get status: ${error
|
|
20
|
+
onComplete(`Failed to get status: ${formatTransportError(error)}`);
|
|
20
21
|
}
|
|
21
22
|
}, [data, error, onComplete, version]);
|
|
22
23
|
if (isLoading) {
|
|
@@ -30,6 +30,10 @@ export function formatStatus(status, version) {
|
|
|
30
30
|
lines.push('Space: Not connected');
|
|
31
31
|
}
|
|
32
32
|
switch (status.contextTreeStatus) {
|
|
33
|
+
case 'git_vc': {
|
|
34
|
+
lines.push('Context Tree: Byterover version control (use /vc commands)');
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
33
37
|
case 'has_changes': {
|
|
34
38
|
if (status.contextTreeChanges && status.contextTreeRelativeDir) {
|
|
35
39
|
const { added, deleted, modified } = status.contextTreeChanges;
|
|
@@ -58,5 +62,10 @@ export function formatStatus(status, version) {
|
|
|
58
62
|
lines.push('Context Tree: Unable to check status');
|
|
59
63
|
}
|
|
60
64
|
}
|
|
65
|
+
if (status.pendingReviewCount && status.pendingReviewCount > 0) {
|
|
66
|
+
const fileLabel = status.pendingReviewCount === 1 ? 'file' : 'files';
|
|
67
|
+
lines.push(chalk.yellow(`Pending Reviews: ${status.pendingReviewCount} ${fileLabel} need review`) +
|
|
68
|
+
(status.reviewUrl ? `\n Review: ${chalk.blue(status.reviewUrl)}` : ''));
|
|
69
|
+
}
|
|
61
70
|
return lines.join('\n');
|
|
62
71
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Call this once from a top-level component to wire up task lifecycle events.
|
|
4
4
|
*/
|
|
5
5
|
import { useEffect } from 'react';
|
|
6
|
+
import { ReviewEvents } from '../../../../shared/transport/events/review-events.js';
|
|
6
7
|
import { useTransportStore } from '../../../stores/transport-store.js';
|
|
7
8
|
import { useTasksStore } from '../stores/tasks-store.js';
|
|
8
9
|
export function useTaskSubscriptions() {
|
|
@@ -65,6 +66,16 @@ export function useTaskSubscriptions() {
|
|
|
65
66
|
taskId: data.taskId,
|
|
66
67
|
type: data.type === 'reasoning' ? 'reasoning' : 'text',
|
|
67
68
|
});
|
|
69
|
+
}), client.on(ReviewEvents.NOTIFY, (data) => {
|
|
70
|
+
if (data.pendingCount === 0) {
|
|
71
|
+
store.clearReviewNotification(data.taskId);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
store.setReviewNotification(data.taskId, {
|
|
75
|
+
pendingCount: data.pendingCount,
|
|
76
|
+
reviewUrl: data.reviewUrl,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
68
79
|
}));
|
|
69
80
|
return () => {
|
|
70
81
|
for (const unsub of unsubscribers)
|
|
@@ -26,6 +26,10 @@ export interface TaskErrorData {
|
|
|
26
26
|
code?: string;
|
|
27
27
|
message: string;
|
|
28
28
|
}
|
|
29
|
+
export interface ReviewNotification {
|
|
30
|
+
pendingCount: number;
|
|
31
|
+
reviewUrl: string;
|
|
32
|
+
}
|
|
29
33
|
export interface Task {
|
|
30
34
|
completedAt?: number;
|
|
31
35
|
content: string;
|
|
@@ -37,6 +41,8 @@ export interface Task {
|
|
|
37
41
|
isStreaming?: boolean;
|
|
38
42
|
reasoningContents?: ReasoningContentItem[];
|
|
39
43
|
result?: string;
|
|
44
|
+
/** Set when curate completes with pending HITL review operations. */
|
|
45
|
+
reviewNotification?: ReviewNotification;
|
|
40
46
|
sessionId?: string;
|
|
41
47
|
startedAt?: number;
|
|
42
48
|
status: TaskStatus;
|
|
@@ -62,6 +68,8 @@ export interface TasksActions {
|
|
|
62
68
|
taskId: string;
|
|
63
69
|
type: 'reasoning' | 'text';
|
|
64
70
|
}) => void;
|
|
71
|
+
/** Clear the review notification on a task (called after approve/reject) */
|
|
72
|
+
clearReviewNotification: (taskId: string) => void;
|
|
65
73
|
/** Clear all tasks */
|
|
66
74
|
clearTasks: () => void;
|
|
67
75
|
/** Create a new task */
|
|
@@ -76,6 +84,8 @@ export interface TasksActions {
|
|
|
76
84
|
setError: (taskId: string, error: TaskErrorData) => void;
|
|
77
85
|
/** Set task LLM response (final) */
|
|
78
86
|
setResponse: (taskId: string, content: string, sessionId?: string) => void;
|
|
87
|
+
/** Set review notification on a completed curate task */
|
|
88
|
+
setReviewNotification: (taskId: string, notification: ReviewNotification) => void;
|
|
79
89
|
/** Set task to started */
|
|
80
90
|
setStarted: (taskId: string) => void;
|
|
81
91
|
/** Update a tool call result */
|
|
@@ -103,6 +103,14 @@ export const useTasksStore = create()((set, get) => ({
|
|
|
103
103
|
}
|
|
104
104
|
return { stats: computeStats(tasks), tasks };
|
|
105
105
|
}),
|
|
106
|
+
clearReviewNotification: (taskId) => set((state) => {
|
|
107
|
+
const task = state.tasks.get(taskId);
|
|
108
|
+
if (!task?.reviewNotification)
|
|
109
|
+
return state;
|
|
110
|
+
const tasks = new Map(state.tasks);
|
|
111
|
+
tasks.set(taskId, { ...task, reviewNotification: undefined });
|
|
112
|
+
return { stats: computeStats(tasks), tasks };
|
|
113
|
+
}),
|
|
106
114
|
clearTasks: () => set({ stats: { created: 0, started: 0 }, tasks: new Map() }),
|
|
107
115
|
createTask: (taskId, type, content, files) => set((state) => {
|
|
108
116
|
const tasks = new Map(state.tasks);
|
|
@@ -218,6 +226,14 @@ export const useTasksStore = create()((set, get) => ({
|
|
|
218
226
|
});
|
|
219
227
|
return { stats: computeStats(tasks), tasks };
|
|
220
228
|
}),
|
|
229
|
+
setReviewNotification: (taskId, notification) => set((state) => {
|
|
230
|
+
const task = state.tasks.get(taskId);
|
|
231
|
+
if (!task)
|
|
232
|
+
return state;
|
|
233
|
+
const tasks = new Map(state.tasks);
|
|
234
|
+
tasks.set(taskId, { ...task, reviewNotification: notification });
|
|
235
|
+
return { stats: computeStats(tasks), tasks };
|
|
236
|
+
}),
|
|
221
237
|
setStarted: (taskId) => set((state) => {
|
|
222
238
|
const task = state.tasks.get(taskId);
|
|
223
239
|
if (!task)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MutationConfig } from '../../../../lib/react-query.js';
|
|
2
|
+
import { type IVcAddRequest, type IVcAddResponse } from '../../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
export declare const executeVcAdd: (request: IVcAddRequest) => Promise<IVcAddResponse>;
|
|
4
|
+
type UseExecuteVcAddOptions = {
|
|
5
|
+
mutationConfig?: MutationConfig<typeof executeVcAdd>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExecuteVcAdd: ({ mutationConfig }?: UseExecuteVcAddOptions) => import("@tanstack/react-query").UseMutationResult<IVcAddResponse, Error, IVcAddRequest, 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 executeVcAdd = (request) => {
|
|
5
|
+
const { apiClient } = useTransportStore.getState();
|
|
6
|
+
if (!apiClient)
|
|
7
|
+
return Promise.reject(new Error('Not connected'));
|
|
8
|
+
return apiClient.request(VcEvents.ADD, request);
|
|
9
|
+
};
|
|
10
|
+
export const useExecuteVcAdd = ({ mutationConfig } = {}) => useMutation({
|
|
11
|
+
...mutationConfig,
|
|
12
|
+
mutationFn: executeVcAdd,
|
|
13
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CustomDialogCallbacks } from '../../../../types/commands.js';
|
|
3
|
+
type VcAddFlowProps = CustomDialogCallbacks & {
|
|
4
|
+
filePaths: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare function VcAddFlow({ filePaths, onCancel, onComplete }: VcAddFlowProps): React.ReactNode;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, useInput } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import { formatTransportError } from '../../../../utils/error-messages.js';
|
|
6
|
+
import { useExecuteVcAdd } from '../api/execute-vc-add.js';
|
|
7
|
+
export function VcAddFlow({ filePaths, onCancel, onComplete }) {
|
|
8
|
+
const addMutation = useExecuteVcAdd();
|
|
9
|
+
useInput((_, key) => {
|
|
10
|
+
if (key.escape && !addMutation.isPending) {
|
|
11
|
+
onCancel();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const fired = React.useRef(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (fired.current)
|
|
17
|
+
return;
|
|
18
|
+
fired.current = true;
|
|
19
|
+
addMutation.mutate({ filePaths }, {
|
|
20
|
+
onError(error) {
|
|
21
|
+
onComplete(`Failed to stage: ${formatTransportError(error)}`);
|
|
22
|
+
},
|
|
23
|
+
onSuccess(result) {
|
|
24
|
+
if (result.count === 0) {
|
|
25
|
+
onComplete('Nothing to stage.');
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
onComplete(`Staged ${result.count} file(s).`);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}, []);
|
|
33
|
+
const label = filePaths.length === 1 && filePaths[0] === '.' ? '.' : filePaths.join(' ');
|
|
34
|
+
return (_jsxs(Text, { children: [_jsx(Spinner, { type: "dots" }), " Staging ", label, "..."] }));
|
|
35
|
+
}
|