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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RequestListener } from 'node:http';
|
|
1
2
|
import type { TransportServerConfig } from '../../core/domain/transport/types.js';
|
|
2
3
|
import type { ConnectionHandler, ITransportServer, RequestHandler } from '../../core/interfaces/transport/index.js';
|
|
3
4
|
/**
|
|
@@ -12,6 +13,7 @@ export declare class SocketIOTransportServer implements ITransportServer {
|
|
|
12
13
|
private readonly config;
|
|
13
14
|
private connectionHandlers;
|
|
14
15
|
private disconnectionHandlers;
|
|
16
|
+
private httpRequestHandler?;
|
|
15
17
|
private httpServer;
|
|
16
18
|
private io;
|
|
17
19
|
private port;
|
|
@@ -34,6 +36,11 @@ export declare class SocketIOTransportServer implements ITransportServer {
|
|
|
34
36
|
onRequest<TRequest = unknown, TResponse = unknown>(event: string, handler: RequestHandler<TRequest, TResponse>): void;
|
|
35
37
|
removeFromRoom(clientId: string, room: string): void;
|
|
36
38
|
sendTo<T = unknown>(clientId: string, event: string, data: T): void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets an HTTP request handler (e.g., Express app) to handle non-Socket.IO HTTP requests.
|
|
41
|
+
* Must be called before start().
|
|
42
|
+
*/
|
|
43
|
+
setHttpRequestHandler(handler: RequestListener): void;
|
|
37
44
|
start(port: number): Promise<void>;
|
|
38
45
|
stop(): Promise<void>;
|
|
39
46
|
private registerEventHandler;
|
|
@@ -22,6 +22,7 @@ export class SocketIOTransportServer {
|
|
|
22
22
|
config;
|
|
23
23
|
connectionHandlers = [];
|
|
24
24
|
disconnectionHandlers = [];
|
|
25
|
+
httpRequestHandler;
|
|
25
26
|
httpServer;
|
|
26
27
|
io;
|
|
27
28
|
port;
|
|
@@ -104,12 +105,22 @@ export class SocketIOTransportServer {
|
|
|
104
105
|
socket.emit(event, data);
|
|
105
106
|
}
|
|
106
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Sets an HTTP request handler (e.g., Express app) to handle non-Socket.IO HTTP requests.
|
|
110
|
+
* Must be called before start().
|
|
111
|
+
*/
|
|
112
|
+
setHttpRequestHandler(handler) {
|
|
113
|
+
if (this.running) {
|
|
114
|
+
throw new TransportServerAlreadyRunningError(this.port ?? 0);
|
|
115
|
+
}
|
|
116
|
+
this.httpRequestHandler = handler;
|
|
117
|
+
}
|
|
107
118
|
async start(port) {
|
|
108
119
|
if (this.running) {
|
|
109
120
|
throw new TransportServerAlreadyRunningError(this.port ?? port);
|
|
110
121
|
}
|
|
111
122
|
return new Promise((resolve, reject) => {
|
|
112
|
-
this.httpServer = createServer();
|
|
123
|
+
this.httpServer = this.httpRequestHandler ? createServer(this.httpRequestHandler) : createServer();
|
|
113
124
|
// In development mode, allow admin.socket.io for debugging
|
|
114
125
|
const corsOrigin = isDevelopment() ? [this.config.corsOrigin, 'https://admin.socket.io'] : this.config.corsOrigin;
|
|
115
126
|
this.io = new Server(this.httpServer, {
|
|
@@ -10,4 +10,4 @@ export type TransportConnector = (fromDir?: string) => Promise<ConnectionResult>
|
|
|
10
10
|
* projectPath is auto-filled by the transport library from the discovered
|
|
11
11
|
* project root (walks up from fromDir to find .brv/).
|
|
12
12
|
*/
|
|
13
|
-
export declare function createDaemonAwareConnector(): TransportConnector;
|
|
13
|
+
export declare function createDaemonAwareConnector(projectPath?: string): TransportConnector;
|
|
@@ -9,10 +9,11 @@ import { resolveLocalServerMainPath } from '../../utils/server-main-resolver.js'
|
|
|
9
9
|
* projectPath is auto-filled by the transport library from the discovered
|
|
10
10
|
* project root (walks up from fromDir to find .brv/).
|
|
11
11
|
*/
|
|
12
|
-
export function createDaemonAwareConnector() {
|
|
12
|
+
export function createDaemonAwareConnector(projectPath) {
|
|
13
13
|
return (fromDir) => connectToDaemon({
|
|
14
14
|
clientType: 'cli',
|
|
15
15
|
fromDir,
|
|
16
|
+
projectPath,
|
|
16
17
|
serverPath: resolveLocalServerMainPath(),
|
|
17
18
|
});
|
|
18
19
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IVcGitConfig, IVcGitConfigStore } from '../../core/interfaces/vc/i-vc-git-config-store.js';
|
|
2
|
+
export interface IFileVcGitConfigStoreDeps {
|
|
3
|
+
readonly getDataDir: () => string;
|
|
4
|
+
}
|
|
5
|
+
export declare class FileVcGitConfigStore implements IVcGitConfigStore {
|
|
6
|
+
private readonly deps;
|
|
7
|
+
constructor(deps?: IFileVcGitConfigStoreDeps);
|
|
8
|
+
get(projectPath: string): Promise<IVcGitConfig | undefined>;
|
|
9
|
+
set(projectPath: string, config: IVcGitConfig): Promise<void>;
|
|
10
|
+
private configPath;
|
|
11
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { getGlobalDataDir } from '../../utils/global-data-path.js';
|
|
5
|
+
const defaultDeps = {
|
|
6
|
+
getDataDir: getGlobalDataDir,
|
|
7
|
+
};
|
|
8
|
+
function projectKey(projectPath) {
|
|
9
|
+
return createHash('sha1').update(projectPath).digest('hex').slice(0, 16);
|
|
10
|
+
}
|
|
11
|
+
function isIVcGitConfig(value) {
|
|
12
|
+
if (typeof value !== 'object' || value === null)
|
|
13
|
+
return false;
|
|
14
|
+
const v = value;
|
|
15
|
+
return (v.name === undefined || typeof v.name === 'string') && (v.email === undefined || typeof v.email === 'string');
|
|
16
|
+
}
|
|
17
|
+
export class FileVcGitConfigStore {
|
|
18
|
+
deps;
|
|
19
|
+
constructor(deps = defaultDeps) {
|
|
20
|
+
this.deps = deps;
|
|
21
|
+
}
|
|
22
|
+
async get(projectPath) {
|
|
23
|
+
const configPath = this.configPath(projectPath);
|
|
24
|
+
try {
|
|
25
|
+
const content = await readFile(configPath, 'utf8');
|
|
26
|
+
const parsed = JSON.parse(content);
|
|
27
|
+
if (!isIVcGitConfig(parsed))
|
|
28
|
+
return undefined;
|
|
29
|
+
return parsed;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async set(projectPath, config) {
|
|
36
|
+
const projectDir = join(this.deps.getDataDir(), 'projects', projectKey(projectPath));
|
|
37
|
+
await mkdir(projectDir, { recursive: true });
|
|
38
|
+
await writeFile(join(projectDir, 'vc-git-config.json'), JSON.stringify(config, null, 2), 'utf8');
|
|
39
|
+
}
|
|
40
|
+
configPath(projectPath) {
|
|
41
|
+
return join(this.deps.getDataDir(), 'projects', projectKey(projectPath), 'vc-git-config.json');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -9,7 +9,7 @@ Use the `brv` CLI to manage your project's long-term memory.
|
|
|
9
9
|
Install: `npm install -g byterover-cli`
|
|
10
10
|
Knowledge is stored in `.brv/context-tree/` as human-readable Markdown files.
|
|
11
11
|
|
|
12
|
-
**No authentication needed.** `brv query` and `brv
|
|
12
|
+
**No authentication needed.** `brv query`, `brv curate`, and `brv vc` (local version control) work out of the box. Login is only required for remote sync (`brv vc push`/`brv vc pull`).
|
|
13
13
|
|
|
14
14
|
## Workflow
|
|
15
15
|
1. **Before Thinking:** Run `brv query` to understand existing patterns.
|
|
@@ -35,7 +35,7 @@ brv query "How is authentication implemented?"
|
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### 2. Curate Context
|
|
38
|
-
**Overview
|
|
38
|
+
**Overview:** Analyze and save knowledge to the local knowledge base. Uses a configured LLM provider to categorize and structure the context you provide.
|
|
39
39
|
|
|
40
40
|
**Use this skill when:**
|
|
41
41
|
- The user wants you to remember something
|
|
@@ -79,7 +79,70 @@ brv curate view --since 1h --status completed
|
|
|
79
79
|
brv curate view --help
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
### 3.
|
|
82
|
+
### 3. Review Pending Changes
|
|
83
|
+
**Overview:** After a curate operation, some changes may require human review before being applied. Use `brv review` to list, approve, or reject pending operations.
|
|
84
|
+
|
|
85
|
+
**Use this when:**
|
|
86
|
+
- A curate operation reports pending reviews (shown in curate output)
|
|
87
|
+
- The user wants to check, approve, or reject pending changes
|
|
88
|
+
|
|
89
|
+
**Do NOT use this skill when:**
|
|
90
|
+
- There are no pending reviews (check with `brv review pending` first)
|
|
91
|
+
|
|
92
|
+
**Commands:**
|
|
93
|
+
|
|
94
|
+
List all pending reviews for the current project:
|
|
95
|
+
```bash
|
|
96
|
+
brv review pending
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Sample output:
|
|
100
|
+
```
|
|
101
|
+
2 operations pending review
|
|
102
|
+
|
|
103
|
+
Task: ddcb3dc6-d957-4a56-b9c3-d0bdc04317f3
|
|
104
|
+
[UPSERT · HIGH IMPACT] - path: architecture/context/context_compression_pipeline.md
|
|
105
|
+
Why: Documenting switch to token-budget sliding window
|
|
106
|
+
After: Context compression pipeline switching from reactive-overflow to token-budget sliding window in src/agent/infra/llm/context/compression/
|
|
107
|
+
|
|
108
|
+
[UPSERT · HIGH IMPACT] - path: architecture/tools/agent_tool_registry.md
|
|
109
|
+
Why: Documenting tool registry rewrite with capability-based permissions
|
|
110
|
+
After: Agent tool registry rewrite in src/agent/infra/tools/tool-registry.ts using capability-based permissions
|
|
111
|
+
|
|
112
|
+
To approve all: brv review approve ddcb3dc6-d957-4a56-b9c3-d0bdc04317f3
|
|
113
|
+
To reject all: brv review reject ddcb3dc6-d957-4a56-b9c3-d0bdc04317f3
|
|
114
|
+
Per file: brv review <approve|reject> ddcb3dc6-d957-4a56-b9c3-d0bdc04317f3 --file <path> [--file <path>]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Each pending task shows: operation type (ADD/UPDATE/DELETE/MERGE/UPSERT), file path, reason, and before/after summaries. High-impact operations are flagged.
|
|
118
|
+
|
|
119
|
+
Approve all operations for a task (applies the changes):
|
|
120
|
+
```bash
|
|
121
|
+
brv review approve <taskId>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Reject all operations for a task (discards pending changes; restores backup for UPDATE/DELETE operations):
|
|
125
|
+
```bash
|
|
126
|
+
brv review reject <taskId>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Approve or reject specific files within a task:
|
|
130
|
+
```bash
|
|
131
|
+
brv review approve <taskId> --file <path> --file <path>
|
|
132
|
+
brv review reject <taskId> --file <path>
|
|
133
|
+
```
|
|
134
|
+
File paths are relative to context tree (as shown in `brv review pending` output).
|
|
135
|
+
|
|
136
|
+
**Note**: Always ask the user before approving or rejecting critical changes.
|
|
137
|
+
|
|
138
|
+
**JSON output** (useful for agent-driven workflows):
|
|
139
|
+
```bash
|
|
140
|
+
brv review pending --format json
|
|
141
|
+
brv review approve <taskId> --format json
|
|
142
|
+
brv review reject <taskId> --format json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 4. LLM Provider Setup
|
|
83
146
|
`brv query` and `brv curate` require a configured LLM provider. Connect the default ByteRover provider (no API key needed):
|
|
84
147
|
|
|
85
148
|
```bash
|
|
@@ -93,7 +156,7 @@ brv providers list
|
|
|
93
156
|
brv providers connect openai --api-key sk-xxx --model gpt-4.1
|
|
94
157
|
```
|
|
95
158
|
|
|
96
|
-
###
|
|
159
|
+
### 5. Project Locations
|
|
97
160
|
**Overview:** List registered projects and their context tree paths. Returns project metadata including initialization status and active state. Use `-f json` for machine-readable output.
|
|
98
161
|
|
|
99
162
|
**Use this when:**
|
|
@@ -111,50 +174,121 @@ brv locations -f json
|
|
|
111
174
|
|
|
112
175
|
JSON fields: `projectPath`, `contextTreePath`, `isCurrent`, `isActive`, `isInitialized`.
|
|
113
176
|
|
|
114
|
-
###
|
|
115
|
-
**Overview:**
|
|
177
|
+
### 6. Version Control
|
|
178
|
+
**Overview:** `brv vc` provides git-based version control for your context tree. It uses standard git semantics — branching, committing, merging, history, and conflict resolution — all working locally with no authentication required. Remote sync with a team is optional. The legacy `brv push`, `brv pull`, and `brv space` commands are deprecated — use `brv vc push`, `brv vc pull`, and `brv vc clone`/`brv vc remote add` instead.
|
|
179
|
+
|
|
180
|
+
**Use this when:**
|
|
181
|
+
- The user wants to track, commit, or inspect changes to the knowledge base
|
|
182
|
+
- The user wants to branch, merge, or undo knowledge changes
|
|
183
|
+
- The user wants to sync knowledge with a team (push/pull)
|
|
184
|
+
- The user wants to connect to or clone a team space
|
|
185
|
+
- The user asks about knowledge history or diffs
|
|
186
|
+
|
|
187
|
+
**Do NOT use this when:**
|
|
188
|
+
- The user wants to query or curate knowledge — use `brv query`/`brv curate` instead
|
|
189
|
+
- The user wants to review pending curate operations — use `brv review` instead
|
|
190
|
+
- Version control is not initialized and the user didn't ask to set it up
|
|
191
|
+
|
|
192
|
+
**Commands:**
|
|
193
|
+
|
|
194
|
+
Available commands: `init`, `status`, `add`, `commit`, `reset`, `log`, `branch`, `checkout`, `merge`, `config`, `clone`, `remote`, `fetch`, `push`, `pull`.
|
|
116
195
|
|
|
117
|
-
|
|
118
|
-
|
|
196
|
+
#### First-Time Setup
|
|
197
|
+
|
|
198
|
+
**Setup — local (no auth needed):**
|
|
199
|
+
```bash
|
|
200
|
+
brv vc init
|
|
201
|
+
brv vc config user.name "Your Name"
|
|
202
|
+
brv vc config user.email "you@example.com"
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Setup — clone a team space (requires `brv login`):**
|
|
119
206
|
```bash
|
|
120
207
|
brv login --api-key sample-key-string
|
|
208
|
+
brv vc clone https://byterover.dev/<team>/<space>.git
|
|
121
209
|
```
|
|
122
|
-
|
|
210
|
+
|
|
211
|
+
**Setup — connect existing project to a remote (requires `brv login`):**
|
|
123
212
|
```bash
|
|
124
|
-
brv
|
|
213
|
+
brv login --api-key sample-key-string
|
|
214
|
+
brv vc remote add origin https://byterover.dev/<team>/<space>.git
|
|
125
215
|
```
|
|
126
|
-
|
|
216
|
+
|
|
217
|
+
#### Local Workflow
|
|
218
|
+
|
|
219
|
+
**Check status:**
|
|
220
|
+
```bash
|
|
221
|
+
brv vc status
|
|
127
222
|
```
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
- d-department (space)
|
|
223
|
+
|
|
224
|
+
**Stage and commit:**
|
|
225
|
+
```bash
|
|
226
|
+
brv vc add . # stage all
|
|
227
|
+
brv vc add notes.md docs/ # stage specific files
|
|
228
|
+
brv vc commit -m "add authentication patterns"
|
|
135
229
|
```
|
|
136
|
-
|
|
230
|
+
|
|
231
|
+
**View history:**
|
|
137
232
|
```bash
|
|
138
|
-
brv
|
|
233
|
+
brv vc log
|
|
234
|
+
brv vc log --limit 20
|
|
235
|
+
brv vc log --all
|
|
139
236
|
```
|
|
140
237
|
|
|
141
|
-
**
|
|
142
|
-
Once connected, `brv push` and `brv pull` sync with that space.
|
|
238
|
+
**Unstage or undo:**
|
|
143
239
|
```bash
|
|
144
|
-
#
|
|
145
|
-
brv
|
|
240
|
+
brv vc reset # unstage all files
|
|
241
|
+
brv vc reset <file> # unstage a specific file
|
|
242
|
+
brv vc reset --soft HEAD~1 # undo last commit, keep changes staged
|
|
243
|
+
brv vc reset --hard HEAD~1 # discard last commit and changes
|
|
244
|
+
```
|
|
146
245
|
|
|
147
|
-
|
|
148
|
-
|
|
246
|
+
#### Branch Management
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
brv vc branch # list branches
|
|
250
|
+
brv vc branch feature/auth # create a branch
|
|
251
|
+
brv vc branch -a # list all (including remote-tracking)
|
|
252
|
+
brv vc branch -d feature/auth # delete a branch
|
|
253
|
+
brv vc checkout feature/auth # switch branch
|
|
254
|
+
brv vc checkout -b feature/new # create and switch
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**Merge:**
|
|
258
|
+
```bash
|
|
259
|
+
brv vc merge feature/auth # merge into current branch
|
|
260
|
+
brv vc merge --continue # continue after resolving conflicts
|
|
261
|
+
brv vc merge --abort # abort a conflicted merge
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Set upstream tracking:**
|
|
265
|
+
```bash
|
|
266
|
+
brv vc branch --set-upstream-to origin/main
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### Cloud Sync (Remote Operations)
|
|
270
|
+
|
|
271
|
+
Requires ByteRover authentication (`brv login`) and a configured remote.
|
|
272
|
+
|
|
273
|
+
**Manage remotes:**
|
|
274
|
+
```bash
|
|
275
|
+
brv vc remote # show current remote
|
|
276
|
+
brv vc remote add origin <url> # add a remote
|
|
277
|
+
brv vc remote set-url origin <url> # update remote URL
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
**Fetch, pull, and push:**
|
|
281
|
+
```bash
|
|
282
|
+
brv vc fetch # fetch remote refs
|
|
283
|
+
brv vc pull # fetch + merge remote commits
|
|
284
|
+
brv vc push # push commits to cloud
|
|
285
|
+
brv vc push -u origin main # push and set upstream tracking
|
|
149
286
|
```
|
|
150
287
|
|
|
151
|
-
**
|
|
152
|
-
- Push local changes first (`brv push`) — switching is blocked if unsaved changes exist.
|
|
153
|
-
- Then switch:
|
|
288
|
+
**Clone a space:**
|
|
154
289
|
```bash
|
|
155
|
-
brv
|
|
290
|
+
brv vc clone https://byterover.dev/<team>/<space>.git
|
|
156
291
|
```
|
|
157
|
-
- The switch automatically pulls context from the new space.
|
|
158
292
|
|
|
159
293
|
## Data Handling
|
|
160
294
|
|
|
@@ -162,9 +296,9 @@ brv space switch --team marketing-team --name d-department
|
|
|
162
296
|
|
|
163
297
|
**File access**: The `-f` flag on `brv curate` reads files from the current project directory only. Paths outside the project root are rejected. Maximum 5 files per command, text and document formats only.
|
|
164
298
|
|
|
165
|
-
**LLM usage**: `brv query` and `brv curate` send context to a configured LLM provider for processing. The LLM sees the query or curate text and any included file contents. No data is sent to ByteRover servers unless you explicitly run `brv push`.
|
|
299
|
+
**LLM usage**: `brv query` and `brv curate` send context to a configured LLM provider for processing. The LLM sees the query or curate text and any included file contents. No data is sent to ByteRover servers unless you explicitly run `brv vc push`.
|
|
166
300
|
|
|
167
|
-
**Cloud sync**: `brv push` and `brv pull` require authentication (`brv login`) and
|
|
301
|
+
**Cloud sync**: `brv vc push` and `brv vc pull` require authentication (`brv login`) and sync knowledge with ByteRover's cloud service via git. All other commands operate without ByteRover authentication.
|
|
168
302
|
|
|
169
303
|
## Error Handling
|
|
170
304
|
**User Action Required:**
|
|
@@ -2,43 +2,91 @@ import { z } from 'zod';
|
|
|
2
2
|
import type { CurateLogOperation } from '../core/domain/entities/curate-log-entry.js';
|
|
3
3
|
import type { LlmToolResultEvent } from '../core/domain/transport/schemas.js';
|
|
4
4
|
export declare const CurateOperationSchema: z.ZodObject<{
|
|
5
|
+
additionalFilePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
confidence: z.ZodOptional<z.ZodEnum<["high", "low"]>>;
|
|
5
7
|
filePath: z.ZodOptional<z.ZodString>;
|
|
8
|
+
impact: z.ZodOptional<z.ZodEnum<["high", "low"]>>;
|
|
6
9
|
message: z.ZodOptional<z.ZodString>;
|
|
10
|
+
needsReview: z.ZodOptional<z.ZodBoolean>;
|
|
7
11
|
path: z.ZodString;
|
|
12
|
+
previousSummary: z.ZodOptional<z.ZodString>;
|
|
13
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
14
|
+
reviewStatus: z.ZodOptional<z.ZodEnum<["approved", "pending", "rejected"]>>;
|
|
8
15
|
status: z.ZodEnum<["failed", "success"]>;
|
|
16
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
9
17
|
type: z.ZodEnum<["ADD", "DELETE", "MERGE", "UPDATE", "UPSERT"]>;
|
|
10
18
|
}, "strip", z.ZodTypeAny, {
|
|
11
19
|
path: string;
|
|
12
20
|
type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
|
|
13
21
|
status: "failed" | "success";
|
|
14
22
|
message?: string | undefined;
|
|
23
|
+
summary?: string | undefined;
|
|
24
|
+
reason?: string | undefined;
|
|
15
25
|
filePath?: string | undefined;
|
|
26
|
+
confidence?: "high" | "low" | undefined;
|
|
27
|
+
impact?: "high" | "low" | undefined;
|
|
28
|
+
additionalFilePaths?: string[] | undefined;
|
|
29
|
+
needsReview?: boolean | undefined;
|
|
30
|
+
previousSummary?: string | undefined;
|
|
31
|
+
reviewStatus?: "pending" | "rejected" | "approved" | undefined;
|
|
16
32
|
}, {
|
|
17
33
|
path: string;
|
|
18
34
|
type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
|
|
19
35
|
status: "failed" | "success";
|
|
20
36
|
message?: string | undefined;
|
|
37
|
+
summary?: string | undefined;
|
|
38
|
+
reason?: string | undefined;
|
|
21
39
|
filePath?: string | undefined;
|
|
40
|
+
confidence?: "high" | "low" | undefined;
|
|
41
|
+
impact?: "high" | "low" | undefined;
|
|
42
|
+
additionalFilePaths?: string[] | undefined;
|
|
43
|
+
needsReview?: boolean | undefined;
|
|
44
|
+
previousSummary?: string | undefined;
|
|
45
|
+
reviewStatus?: "pending" | "rejected" | "approved" | undefined;
|
|
22
46
|
}>;
|
|
23
47
|
export declare const CurateResultSchema: z.ZodObject<{
|
|
24
48
|
applied: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
49
|
+
additionalFilePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
50
|
+
confidence: z.ZodOptional<z.ZodEnum<["high", "low"]>>;
|
|
25
51
|
filePath: z.ZodOptional<z.ZodString>;
|
|
52
|
+
impact: z.ZodOptional<z.ZodEnum<["high", "low"]>>;
|
|
26
53
|
message: z.ZodOptional<z.ZodString>;
|
|
54
|
+
needsReview: z.ZodOptional<z.ZodBoolean>;
|
|
27
55
|
path: z.ZodString;
|
|
56
|
+
previousSummary: z.ZodOptional<z.ZodString>;
|
|
57
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
58
|
+
reviewStatus: z.ZodOptional<z.ZodEnum<["approved", "pending", "rejected"]>>;
|
|
28
59
|
status: z.ZodEnum<["failed", "success"]>;
|
|
60
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
29
61
|
type: z.ZodEnum<["ADD", "DELETE", "MERGE", "UPDATE", "UPSERT"]>;
|
|
30
62
|
}, "strip", z.ZodTypeAny, {
|
|
31
63
|
path: string;
|
|
32
64
|
type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
|
|
33
65
|
status: "failed" | "success";
|
|
34
66
|
message?: string | undefined;
|
|
67
|
+
summary?: string | undefined;
|
|
68
|
+
reason?: string | undefined;
|
|
35
69
|
filePath?: string | undefined;
|
|
70
|
+
confidence?: "high" | "low" | undefined;
|
|
71
|
+
impact?: "high" | "low" | undefined;
|
|
72
|
+
additionalFilePaths?: string[] | undefined;
|
|
73
|
+
needsReview?: boolean | undefined;
|
|
74
|
+
previousSummary?: string | undefined;
|
|
75
|
+
reviewStatus?: "pending" | "rejected" | "approved" | undefined;
|
|
36
76
|
}, {
|
|
37
77
|
path: string;
|
|
38
78
|
type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
|
|
39
79
|
status: "failed" | "success";
|
|
40
80
|
message?: string | undefined;
|
|
81
|
+
summary?: string | undefined;
|
|
82
|
+
reason?: string | undefined;
|
|
41
83
|
filePath?: string | undefined;
|
|
84
|
+
confidence?: "high" | "low" | undefined;
|
|
85
|
+
impact?: "high" | "low" | undefined;
|
|
86
|
+
additionalFilePaths?: string[] | undefined;
|
|
87
|
+
needsReview?: boolean | undefined;
|
|
88
|
+
previousSummary?: string | undefined;
|
|
89
|
+
reviewStatus?: "pending" | "rejected" | "approved" | undefined;
|
|
42
90
|
}>, "many">>;
|
|
43
91
|
summary: z.ZodOptional<z.ZodObject<{
|
|
44
92
|
added: z.ZodOptional<z.ZodNumber>;
|
|
@@ -72,7 +120,15 @@ export declare const CurateResultSchema: z.ZodObject<{
|
|
|
72
120
|
type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
|
|
73
121
|
status: "failed" | "success";
|
|
74
122
|
message?: string | undefined;
|
|
123
|
+
summary?: string | undefined;
|
|
124
|
+
reason?: string | undefined;
|
|
75
125
|
filePath?: string | undefined;
|
|
126
|
+
confidence?: "high" | "low" | undefined;
|
|
127
|
+
impact?: "high" | "low" | undefined;
|
|
128
|
+
additionalFilePaths?: string[] | undefined;
|
|
129
|
+
needsReview?: boolean | undefined;
|
|
130
|
+
previousSummary?: string | undefined;
|
|
131
|
+
reviewStatus?: "pending" | "rejected" | "approved" | undefined;
|
|
76
132
|
}[] | undefined;
|
|
77
133
|
}, {
|
|
78
134
|
summary?: {
|
|
@@ -87,7 +143,15 @@ export declare const CurateResultSchema: z.ZodObject<{
|
|
|
87
143
|
type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
|
|
88
144
|
status: "failed" | "success";
|
|
89
145
|
message?: string | undefined;
|
|
146
|
+
summary?: string | undefined;
|
|
147
|
+
reason?: string | undefined;
|
|
90
148
|
filePath?: string | undefined;
|
|
149
|
+
confidence?: "high" | "low" | undefined;
|
|
150
|
+
impact?: "high" | "low" | undefined;
|
|
151
|
+
additionalFilePaths?: string[] | undefined;
|
|
152
|
+
needsReview?: boolean | undefined;
|
|
153
|
+
previousSummary?: string | undefined;
|
|
154
|
+
reviewStatus?: "pending" | "rejected" | "approved" | undefined;
|
|
91
155
|
}[] | undefined;
|
|
92
156
|
}>;
|
|
93
157
|
/**
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
// ── Zod schemas ──────────────────────────────────────────────────────────────
|
|
3
3
|
export const CurateOperationSchema = z.object({
|
|
4
|
+
additionalFilePaths: z.array(z.string()).optional(),
|
|
5
|
+
confidence: z.enum(['high', 'low']).optional(),
|
|
4
6
|
filePath: z.string().optional(),
|
|
7
|
+
impact: z.enum(['high', 'low']).optional(),
|
|
5
8
|
message: z.string().optional(),
|
|
9
|
+
needsReview: z.boolean().optional(),
|
|
6
10
|
path: z.string(),
|
|
11
|
+
previousSummary: z.string().optional(),
|
|
12
|
+
reason: z.string().optional(),
|
|
13
|
+
reviewStatus: z.enum(['approved', 'pending', 'rejected']).optional(),
|
|
7
14
|
status: z.enum(['failed', 'success']),
|
|
15
|
+
summary: z.string().optional(),
|
|
8
16
|
type: z.enum(['ADD', 'DELETE', 'MERGE', 'UPDATE', 'UPSERT']),
|
|
9
17
|
});
|
|
10
18
|
export const CurateResultSchema = z.object({
|
|
@@ -26,7 +26,7 @@ export interface FileReadResult {
|
|
|
26
26
|
/**
|
|
27
27
|
* Configuration options for file reading.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
interface FileContentReaderConfig {
|
|
30
30
|
/** Maximum content length per file in characters (default: 40000) */
|
|
31
31
|
maxContentLength?: number;
|
|
32
32
|
/** Maximum lines to read for text files (default: 2000) */
|
|
@@ -79,3 +79,4 @@ export declare class FileContentReader {
|
|
|
79
79
|
* Factory function to create a FileContentReader instance.
|
|
80
80
|
*/
|
|
81
81
|
export declare function createFileContentReader(documentParser?: IDocumentParserService): FileContentReader;
|
|
82
|
+
export {};
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Finds the most recent file in a directory by modification time.
|
|
3
|
-
* @param directory - Absolute path to directory to search
|
|
4
|
-
* @returns Absolute path to the most recent file
|
|
5
|
-
* @throws Error if directory is empty or doesn't exist
|
|
6
|
-
*/
|
|
7
|
-
export declare function findLatestFile(directory: string): Promise<string>;
|
|
8
|
-
/**
|
|
9
|
-
* Removes all files from a directory while preserving the directory itself.
|
|
10
|
-
* Returns the number of files removed.
|
|
11
|
-
* Silently succeeds if directory doesn't exist.
|
|
12
|
-
* @param dirPath - Absolute path to directory to clear
|
|
13
|
-
* @returns Number of files removed
|
|
14
|
-
*/
|
|
15
|
-
export declare function clearDirectory(dirPath: string): Promise<number>;
|
|
16
1
|
/**
|
|
17
2
|
* Sanitizes a folder path by replacing all special characters with a hyphen.
|
|
18
3
|
* @param folderName - The folder path need to sanitize
|
|
@@ -33,12 +18,3 @@ export declare function sanitizeFolderName(folderName: string): string;
|
|
|
33
18
|
* ```
|
|
34
19
|
*/
|
|
35
20
|
export declare function toSnakeCase(name: string): string;
|
|
36
|
-
/**
|
|
37
|
-
* Lists all immediate children (files and directories) of the given directory,
|
|
38
|
-
* and, for each child folder, shows its own immediate children.
|
|
39
|
-
* @param dirPath The directory path whose children to list.
|
|
40
|
-
* @returns An object where keys are child names, and values are:
|
|
41
|
-
* - for files: undefined
|
|
42
|
-
* - for directories: an array of their immediate children
|
|
43
|
-
*/
|
|
44
|
-
export declare function listDirectoryChildren(dirPath?: string): Record<string, string[] | undefined>;
|
|
@@ -1,49 +1,3 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import { readdir, unlink } from 'node:fs/promises';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
/**
|
|
5
|
-
* Finds the most recent file in a directory by modification time.
|
|
6
|
-
* @param directory - Absolute path to directory to search
|
|
7
|
-
* @returns Absolute path to the most recent file
|
|
8
|
-
* @throws Error if directory is empty or doesn't exist
|
|
9
|
-
*/
|
|
10
|
-
export async function findLatestFile(directory) {
|
|
11
|
-
const files = await readdir(directory, { withFileTypes: true });
|
|
12
|
-
const fileNames = files.filter((f) => f.isFile()).map((f) => f.name);
|
|
13
|
-
if (fileNames.length === 0) {
|
|
14
|
-
throw new Error(`No files found in directory: ${directory}`);
|
|
15
|
-
}
|
|
16
|
-
// Sort files by name (timestamp-based naming ensures latest is last)
|
|
17
|
-
// Assuming filenames follow pattern: prefix-{timestamp}.json
|
|
18
|
-
fileNames.sort();
|
|
19
|
-
const latestFile = fileNames.at(-1);
|
|
20
|
-
return join(directory, latestFile);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Removes all files from a directory while preserving the directory itself.
|
|
24
|
-
* Returns the number of files removed.
|
|
25
|
-
* Silently succeeds if directory doesn't exist.
|
|
26
|
-
* @param dirPath - Absolute path to directory to clear
|
|
27
|
-
* @returns Number of files removed
|
|
28
|
-
*/
|
|
29
|
-
export async function clearDirectory(dirPath) {
|
|
30
|
-
try {
|
|
31
|
-
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
32
|
-
// Filter to only get files (not subdirectories)
|
|
33
|
-
const files = entries.filter((entry) => entry.isFile());
|
|
34
|
-
// Remove each file
|
|
35
|
-
await Promise.all(files.map((file) => unlink(join(dirPath, file.name))));
|
|
36
|
-
return files.length;
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
// If directory doesn't exist (ENOENT), return 0
|
|
40
|
-
if (error.code === 'ENOENT') {
|
|
41
|
-
return 0;
|
|
42
|
-
}
|
|
43
|
-
// Re-throw other errors
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
1
|
/**
|
|
48
2
|
* Sanitizes a folder path by replacing all special characters with a hyphen.
|
|
49
3
|
* @param folderName - The folder path need to sanitize
|
|
@@ -73,38 +27,3 @@ export function toSnakeCase(name) {
|
|
|
73
27
|
.replaceAll(/_{2,}/g, '_')
|
|
74
28
|
.replaceAll(/^_|_$/g, '');
|
|
75
29
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Lists all immediate children (files and directories) of the given directory,
|
|
78
|
-
* and, for each child folder, shows its own immediate children.
|
|
79
|
-
* @param dirPath The directory path whose children to list.
|
|
80
|
-
* @returns An object where keys are child names, and values are:
|
|
81
|
-
* - for files: undefined
|
|
82
|
-
* - for directories: an array of their immediate children
|
|
83
|
-
*/
|
|
84
|
-
export function listDirectoryChildren(dirPath = '.brv/context-tree') {
|
|
85
|
-
const result = {};
|
|
86
|
-
const children = fs.readdirSync(dirPath);
|
|
87
|
-
for (const child of children) {
|
|
88
|
-
const childPath = `${dirPath}/${child}`;
|
|
89
|
-
let stat;
|
|
90
|
-
try {
|
|
91
|
-
stat = fs.statSync(childPath);
|
|
92
|
-
}
|
|
93
|
-
catch {
|
|
94
|
-
result[child] = undefined;
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
if (stat.isDirectory()) {
|
|
98
|
-
try {
|
|
99
|
-
result[child] = fs.readdirSync(childPath);
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
result[child] = undefined;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
result[child] = undefined;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return result;
|
|
110
|
-
}
|