byterover-cli 2.6.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.production +1 -0
- package/README.md +240 -14
- package/dist/agent/core/domain/knowledge/conflict-detector.d.ts +38 -0
- package/dist/agent/core/domain/knowledge/conflict-detector.js +71 -0
- package/dist/agent/core/domain/knowledge/conflict-resolver.d.ts +17 -0
- package/dist/agent/core/domain/knowledge/conflict-resolver.js +118 -0
- package/dist/agent/core/domain/knowledge/utils.d.ts +4 -0
- package/dist/agent/core/domain/knowledge/utils.js +6 -0
- package/dist/agent/core/interfaces/i-curate-service.d.ts +6 -0
- package/dist/agent/infra/tools/implementations/curate-tool.d.ts +67 -34
- package/dist/agent/infra/tools/implementations/curate-tool.js +294 -47
- package/dist/agent/resources/prompts/system-prompt.yml +15 -8
- package/dist/agent/resources/tools/code_exec.txt +3 -0
- package/dist/agent/resources/tools/curate.txt +12 -3
- package/dist/oclif/commands/connectors/install.d.ts +2 -1
- package/dist/oclif/commands/connectors/install.js +38 -3
- package/dist/oclif/commands/curate/index.d.ts +18 -0
- package/dist/oclif/commands/curate/index.js +78 -1
- package/dist/oclif/commands/init.d.ts +12 -0
- package/dist/oclif/commands/init.js +75 -0
- package/dist/oclif/commands/locations.js +1 -1
- package/dist/oclif/commands/providers/connect.d.ts +31 -1
- package/dist/oclif/commands/providers/connect.js +307 -27
- package/dist/oclif/commands/pull.d.ts +1 -0
- package/dist/oclif/commands/pull.js +7 -0
- package/dist/oclif/commands/push.d.ts +1 -0
- package/dist/oclif/commands/push.js +8 -0
- package/dist/oclif/commands/review/approve.d.ts +17 -0
- package/dist/oclif/commands/review/approve.js +37 -0
- package/dist/oclif/commands/review/base-review-decision.d.ts +18 -0
- package/dist/oclif/commands/review/base-review-decision.js +71 -0
- package/dist/oclif/commands/review/pending.d.ts +13 -0
- package/dist/oclif/commands/review/pending.js +94 -0
- package/dist/oclif/commands/review/reject.d.ts +17 -0
- package/dist/oclif/commands/review/reject.js +38 -0
- package/dist/oclif/commands/space/list.d.ts +2 -2
- package/dist/oclif/commands/space/list.js +13 -35
- package/dist/oclif/commands/space/switch.d.ts +2 -7
- package/dist/oclif/commands/space/switch.js +13 -56
- package/dist/oclif/commands/status.d.ts +1 -0
- package/dist/oclif/commands/status.js +11 -1
- package/dist/oclif/commands/vc/add.d.ts +7 -0
- package/dist/oclif/commands/vc/add.js +29 -0
- package/dist/oclif/commands/vc/branch.d.ts +15 -0
- package/dist/oclif/commands/vc/branch.js +70 -0
- package/dist/oclif/commands/vc/checkout.d.ts +14 -0
- package/dist/oclif/commands/vc/checkout.js +47 -0
- package/dist/oclif/commands/vc/clone.d.ts +9 -0
- package/dist/oclif/commands/vc/clone.js +61 -0
- package/dist/oclif/commands/vc/commit.d.ts +10 -0
- package/dist/oclif/commands/vc/commit.js +32 -0
- package/dist/oclif/commands/vc/config.d.ts +10 -0
- package/dist/oclif/commands/vc/config.js +30 -0
- package/dist/oclif/commands/vc/fetch.d.ts +10 -0
- package/dist/oclif/commands/vc/fetch.js +42 -0
- package/dist/oclif/commands/vc/index.d.ts +6 -0
- package/dist/oclif/commands/vc/index.js +8 -0
- package/dist/oclif/commands/vc/init.d.ts +6 -0
- package/dist/oclif/commands/vc/init.js +25 -0
- package/dist/oclif/commands/vc/log.d.ts +13 -0
- package/dist/oclif/commands/vc/log.js +48 -0
- package/dist/oclif/commands/vc/merge.d.ts +19 -0
- package/dist/oclif/commands/vc/merge.js +130 -0
- package/dist/oclif/commands/vc/pull.d.ts +13 -0
- package/dist/oclif/commands/vc/pull.js +60 -0
- package/dist/oclif/commands/vc/push.d.ts +13 -0
- package/dist/oclif/commands/vc/push.js +60 -0
- package/dist/oclif/commands/vc/remote/add.d.ts +10 -0
- package/dist/oclif/commands/vc/remote/add.js +30 -0
- package/dist/oclif/commands/vc/remote/index.d.ts +6 -0
- package/dist/oclif/commands/vc/remote/index.js +16 -0
- package/dist/oclif/commands/vc/remote/set-url.d.ts +10 -0
- package/dist/oclif/commands/vc/remote/set-url.js +30 -0
- package/dist/oclif/commands/vc/reset.d.ts +13 -0
- package/dist/oclif/commands/vc/reset.js +62 -0
- package/dist/oclif/commands/vc/status.d.ts +8 -0
- package/dist/oclif/commands/vc/status.js +106 -0
- package/dist/oclif/hooks/init/validate-brv-config.d.ts +26 -0
- package/dist/oclif/hooks/init/validate-brv-config.js +62 -0
- package/dist/oclif/lib/daemon-client.d.ts +2 -0
- package/dist/oclif/lib/daemon-client.js +36 -10
- package/dist/oclif/lib/prompt-utils.d.ts +43 -0
- package/dist/oclif/lib/prompt-utils.js +84 -0
- package/dist/oclif/lib/spinner.d.ts +8 -0
- package/dist/oclif/lib/spinner.js +23 -0
- package/dist/oclif/lib/task-client.d.ts +5 -0
- package/dist/oclif/lib/task-client.js +15 -2
- package/dist/server/config/environment.d.ts +2 -0
- package/dist/server/config/environment.js +2 -0
- package/dist/server/constants.d.ts +3 -0
- package/dist/server/constants.js +9 -0
- package/dist/server/core/domain/entities/auth-token.d.ts +2 -0
- package/dist/server/core/domain/entities/auth-token.js +7 -1
- package/dist/server/core/domain/entities/curate-log-entry.d.ts +11 -0
- package/dist/server/core/domain/entities/space.d.ts +4 -0
- package/dist/server/core/domain/entities/space.js +8 -0
- package/dist/server/core/domain/entities/team.d.ts +2 -0
- package/dist/server/core/domain/entities/team.js +4 -0
- package/dist/server/core/domain/errors/git-error.d.ts +6 -0
- package/dist/server/core/domain/errors/git-error.js +12 -0
- package/dist/server/core/domain/errors/task-error.d.ts +4 -0
- package/dist/server/core/domain/errors/task-error.js +8 -0
- package/dist/server/core/domain/errors/vc-error.d.ts +5 -0
- package/dist/server/core/domain/errors/vc-error.js +8 -0
- package/dist/server/core/domain/knowledge/markdown-writer.d.ts +4 -1
- package/dist/server/core/domain/knowledge/markdown-writer.js +37 -7
- package/dist/server/core/domain/transport/schemas.d.ts +6 -6
- package/dist/server/core/interfaces/context-tree/i-context-tree-service.d.ts +11 -0
- package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +6 -0
- package/dist/server/core/interfaces/services/i-git-service.d.ts +234 -0
- package/dist/server/core/interfaces/services/i-git-service.js +1 -0
- package/dist/server/core/interfaces/storage/i-curate-log-store.d.ts +5 -0
- package/dist/server/core/interfaces/storage/i-review-backup-store.d.ts +19 -0
- package/dist/server/core/interfaces/storage/i-review-backup-store.js +1 -0
- package/dist/server/core/interfaces/vc/i-vc-git-config-store.d.ts +8 -0
- package/dist/server/core/interfaces/vc/i-vc-git-config-store.js +1 -0
- package/dist/server/infra/config/auto-init.d.ts +0 -2
- package/dist/server/infra/config/auto-init.js +0 -1
- package/dist/server/infra/context-tree/file-context-tree-service.d.ts +2 -0
- package/dist/server/infra/context-tree/file-context-tree-service.js +13 -0
- package/dist/server/infra/daemon/brv-server.js +23 -3
- package/dist/server/infra/git/cogit-url.d.ts +17 -0
- package/dist/server/infra/git/cogit-url.js +39 -0
- package/dist/server/infra/git/git-http-wrapper.d.ts +20 -0
- package/dist/server/infra/git/git-http-wrapper.js +334 -0
- package/dist/server/infra/git/isomorphic-git-service.d.ts +78 -0
- package/dist/server/infra/git/isomorphic-git-service.js +983 -0
- package/dist/server/infra/http/review-api-handler.d.ts +13 -0
- package/dist/server/infra/http/review-api-handler.js +286 -0
- package/dist/server/infra/http/review-ui.d.ts +7 -0
- package/dist/server/infra/http/review-ui.js +606 -0
- package/dist/server/infra/mcp/tools/brv-curate-tool.d.ts +2 -2
- package/dist/server/infra/process/curate-log-handler.d.ts +18 -2
- package/dist/server/infra/process/curate-log-handler.js +50 -13
- package/dist/server/infra/process/feature-handlers.js +41 -1
- package/dist/server/infra/process/task-router.js +16 -0
- package/dist/server/infra/space/http-space-service.js +2 -0
- package/dist/server/infra/storage/file-curate-log-store.d.ts +10 -0
- package/dist/server/infra/storage/file-curate-log-store.js +35 -0
- package/dist/server/infra/storage/file-review-backup-store.d.ts +29 -0
- package/dist/server/infra/storage/file-review-backup-store.js +121 -0
- package/dist/server/infra/transport/handlers/auth-handler.js +9 -5
- package/dist/server/infra/transport/handlers/handler-types.d.ts +9 -0
- package/dist/server/infra/transport/handlers/handler-types.js +11 -0
- package/dist/server/infra/transport/handlers/index.d.ts +4 -0
- package/dist/server/infra/transport/handlers/index.js +2 -0
- package/dist/server/infra/transport/handlers/init-handler.d.ts +1 -0
- package/dist/server/infra/transport/handlers/init-handler.js +13 -1
- package/dist/server/infra/transport/handlers/pull-handler.d.ts +3 -0
- package/dist/server/infra/transport/handlers/pull-handler.js +5 -1
- package/dist/server/infra/transport/handlers/push-handler.d.ts +20 -0
- package/dist/server/infra/transport/handlers/push-handler.js +116 -14
- package/dist/server/infra/transport/handlers/reset-handler.d.ts +11 -0
- package/dist/server/infra/transport/handlers/reset-handler.js +37 -1
- package/dist/server/infra/transport/handlers/review-handler.d.ts +35 -0
- package/dist/server/infra/transport/handlers/review-handler.js +162 -0
- package/dist/server/infra/transport/handlers/space-handler.d.ts +3 -0
- package/dist/server/infra/transport/handlers/space-handler.js +4 -1
- package/dist/server/infra/transport/handlers/status-handler.d.ts +5 -0
- package/dist/server/infra/transport/handlers/status-handler.js +51 -16
- package/dist/server/infra/transport/handlers/vc-handler.d.ts +100 -0
- package/dist/server/infra/transport/handlers/vc-handler.js +1050 -0
- package/dist/server/infra/transport/socket-io-transport-server.d.ts +7 -0
- package/dist/server/infra/transport/socket-io-transport-server.js +12 -1
- package/dist/server/infra/transport/transport-connector.d.ts +1 -1
- package/dist/server/infra/transport/transport-connector.js +2 -1
- package/dist/server/infra/vc/file-vc-git-config-store.d.ts +11 -0
- package/dist/server/infra/vc/file-vc-git-config-store.js +43 -0
- package/dist/server/templates/skill/SKILL.md +167 -33
- package/dist/server/utils/curate-result-parser.d.ts +64 -0
- package/dist/server/utils/curate-result-parser.js +8 -0
- package/dist/server/utils/gitignore.d.ts +9 -0
- package/dist/server/utils/gitignore.js +47 -0
- package/dist/shared/transport/events/index.d.ts +6 -0
- package/dist/shared/transport/events/index.js +3 -0
- package/dist/shared/transport/events/init-events.d.ts +8 -0
- package/dist/shared/transport/events/init-events.js +1 -0
- package/dist/shared/transport/events/push-events.d.ts +6 -0
- package/dist/shared/transport/events/review-events.d.ts +41 -0
- package/dist/shared/transport/events/review-events.js +5 -0
- package/dist/shared/transport/events/vc-events.d.ts +257 -0
- package/dist/shared/transport/events/vc-events.js +67 -0
- package/dist/shared/transport/types/dto.d.ts +6 -1
- package/dist/tui/app/pages/init-project-page.d.ts +9 -0
- package/dist/tui/app/pages/init-project-page.js +54 -0
- package/dist/tui/app/pages/protected-routes.js +14 -6
- package/dist/tui/components/index.d.ts +0 -2
- package/dist/tui/components/index.js +0 -1
- package/dist/tui/features/activity/hooks/use-activity-logs.js +7 -1
- package/dist/tui/features/commands/definitions/index.js +3 -0
- package/dist/tui/features/commands/definitions/space-list.js +9 -18
- package/dist/tui/features/commands/definitions/space-switch.js +10 -6
- package/dist/tui/features/commands/definitions/vc-add.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-add.js +15 -0
- package/dist/tui/features/commands/definitions/vc-branch.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-branch.js +33 -0
- package/dist/tui/features/commands/definitions/vc-checkout.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-checkout.js +32 -0
- package/dist/tui/features/commands/definitions/vc-clone.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-clone.js +18 -0
- package/dist/tui/features/commands/definitions/vc-commit.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-commit.js +32 -0
- package/dist/tui/features/commands/definitions/vc-config.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-config.js +40 -0
- package/dist/tui/features/commands/definitions/vc-fetch.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-fetch.js +37 -0
- package/dist/tui/features/commands/definitions/vc-init.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-init.js +11 -0
- package/dist/tui/features/commands/definitions/vc-log.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-log.js +25 -0
- package/dist/tui/features/commands/definitions/vc-merge.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-merge.js +48 -0
- package/dist/tui/features/commands/definitions/vc-pull.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-pull.js +42 -0
- package/dist/tui/features/commands/definitions/vc-push.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-push.js +38 -0
- package/dist/tui/features/commands/definitions/vc-remote.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-remote.js +57 -0
- package/dist/tui/features/commands/definitions/vc-reset.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-reset.js +35 -0
- package/dist/tui/features/commands/definitions/vc-status.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-status.js +11 -0
- package/dist/tui/features/commands/definitions/vc.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc.js +36 -0
- package/dist/tui/features/commands/hooks/use-slash-command-processor.js +5 -5
- package/dist/tui/features/log/api/execute-log.d.ts +8 -0
- package/dist/tui/features/log/api/execute-log.js +13 -0
- package/dist/tui/features/log/components/log-flow.d.ts +14 -0
- package/dist/tui/features/log/components/log-flow.js +29 -0
- package/dist/tui/features/log/utils/format-log.d.ts +3 -0
- package/dist/tui/features/log/utils/format-log.js +42 -0
- package/dist/tui/features/onboarding/hooks/use-app-view-mode.d.ts +9 -5
- package/dist/tui/features/onboarding/hooks/use-app-view-mode.js +12 -5
- package/dist/tui/features/push/components/push-flow.js +9 -2
- package/dist/tui/features/reset/components/reset-flow.js +2 -1
- package/dist/tui/features/status/components/status-view.js +2 -1
- package/dist/tui/features/status/utils/format-status.js +9 -0
- package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +11 -0
- package/dist/tui/features/tasks/stores/tasks-store.d.ts +10 -0
- package/dist/tui/features/tasks/stores/tasks-store.js +16 -0
- package/dist/tui/features/vc/add/api/execute-vc-add.d.ts +8 -0
- package/dist/tui/features/vc/add/api/execute-vc-add.js +13 -0
- package/dist/tui/features/vc/add/components/vc-add-flow.d.ts +7 -0
- package/dist/tui/features/vc/add/components/vc-add-flow.js +35 -0
- package/dist/tui/features/vc/branch/api/execute-vc-branch.d.ts +8 -0
- package/dist/tui/features/vc/branch/api/execute-vc-branch.js +13 -0
- package/dist/tui/features/vc/branch/components/vc-branch-flow.d.ts +8 -0
- package/dist/tui/features/vc/branch/components/vc-branch-flow.js +53 -0
- package/dist/tui/features/vc/branch/utils/format-branch.d.ts +4 -0
- package/dist/tui/features/vc/branch/utils/format-branch.js +12 -0
- package/dist/tui/features/vc/checkout/api/execute-vc-checkout.d.ts +8 -0
- package/dist/tui/features/vc/checkout/api/execute-vc-checkout.js +13 -0
- package/dist/tui/features/vc/checkout/components/vc-checkout-flow.d.ts +8 -0
- package/dist/tui/features/vc/checkout/components/vc-checkout-flow.js +33 -0
- package/dist/tui/features/vc/clone/api/execute-vc-clone.d.ts +8 -0
- package/dist/tui/features/vc/clone/api/execute-vc-clone.js +13 -0
- package/dist/tui/features/vc/clone/components/vc-clone-flow.d.ts +7 -0
- package/dist/tui/features/vc/clone/components/vc-clone-flow.js +79 -0
- package/dist/tui/features/vc/commit/api/execute-vc-commit.d.ts +8 -0
- package/dist/tui/features/vc/commit/api/execute-vc-commit.js +13 -0
- package/dist/tui/features/vc/commit/components/vc-commit-flow.d.ts +7 -0
- package/dist/tui/features/vc/commit/components/vc-commit-flow.js +29 -0
- package/dist/tui/features/vc/config/api/execute-vc-config.d.ts +8 -0
- package/dist/tui/features/vc/config/api/execute-vc-config.js +13 -0
- package/dist/tui/features/vc/config/components/vc-config-flow.d.ts +9 -0
- package/dist/tui/features/vc/config/components/vc-config-flow.js +30 -0
- package/dist/tui/features/vc/fetch/api/execute-vc-fetch.d.ts +8 -0
- package/dist/tui/features/vc/fetch/api/execute-vc-fetch.js +13 -0
- package/dist/tui/features/vc/fetch/components/vc-fetch-flow.d.ts +8 -0
- package/dist/tui/features/vc/fetch/components/vc-fetch-flow.js +75 -0
- package/dist/tui/features/vc/init/api/execute-vc-init.d.ts +8 -0
- package/dist/tui/features/vc/init/api/execute-vc-init.js +13 -0
- package/dist/tui/features/vc/init/components/vc-init-flow.d.ts +10 -0
- package/dist/tui/features/vc/init/components/vc-init-flow.js +37 -0
- package/dist/tui/features/vc/merge/api/execute-vc-merge.d.ts +8 -0
- package/dist/tui/features/vc/merge/api/execute-vc-merge.js +13 -0
- package/dist/tui/features/vc/merge/components/vc-merge-flow.d.ts +11 -0
- package/dist/tui/features/vc/merge/components/vc-merge-flow.js +72 -0
- package/dist/tui/features/vc/pull/api/execute-vc-pull.d.ts +8 -0
- package/dist/tui/features/vc/pull/api/execute-vc-pull.js +13 -0
- package/dist/tui/features/vc/pull/components/vc-pull-flow.d.ts +9 -0
- package/dist/tui/features/vc/pull/components/vc-pull-flow.js +83 -0
- package/dist/tui/features/vc/push/api/execute-vc-push.d.ts +8 -0
- package/dist/tui/features/vc/push/api/execute-vc-push.js +13 -0
- package/dist/tui/features/vc/push/components/vc-push-flow.d.ts +8 -0
- package/dist/tui/features/vc/push/components/vc-push-flow.js +83 -0
- package/dist/tui/features/vc/remote/api/execute-vc-remote.d.ts +8 -0
- package/dist/tui/features/vc/remote/api/execute-vc-remote.js +13 -0
- package/dist/tui/features/vc/remote/components/vc-remote-flow.d.ts +9 -0
- package/dist/tui/features/vc/remote/components/vc-remote-flow.js +42 -0
- package/dist/tui/features/vc/reset/api/execute-vc-reset.d.ts +8 -0
- package/dist/tui/features/vc/reset/api/execute-vc-reset.js +13 -0
- package/dist/tui/features/vc/reset/components/vc-reset-flow.d.ts +10 -0
- package/dist/tui/features/vc/reset/components/vc-reset-flow.js +63 -0
- package/dist/tui/features/vc/status/api/execute-vc-status.d.ts +8 -0
- package/dist/tui/features/vc/status/api/execute-vc-status.js +13 -0
- package/dist/tui/features/vc/status/components/vc-status-flow.d.ts +10 -0
- package/dist/tui/features/vc/status/components/vc-status-flow.js +133 -0
- package/dist/tui/lib/environment.d.ts +8 -0
- package/dist/tui/lib/environment.js +8 -0
- package/dist/tui/utils/error-messages.d.ts +5 -1
- package/dist/tui/utils/error-messages.js +32 -3
- package/oclif.manifest.json +1018 -98
- package/package.json +9 -3
- package/dist/oclif/hooks/prerun/validate-brv-config-version.d.ts +0 -33
- package/dist/oclif/hooks/prerun/validate-brv-config-version.js +0 -86
- package/dist/tui/components/init.d.ts +0 -33
- package/dist/tui/components/init.js +0 -234
- package/dist/tui/features/space/api/get-spaces.d.ts +0 -16
- package/dist/tui/features/space/api/get-spaces.js +0 -17
- package/dist/tui/features/space/api/switch-space.d.ts +0 -11
- package/dist/tui/features/space/api/switch-space.js +0 -24
- package/dist/tui/features/space/components/space-list-view.d.ts +0 -12
- package/dist/tui/features/space/components/space-list-view.js +0 -56
- package/dist/tui/features/space/components/space-switch-flow.d.ts +0 -13
- package/dist/tui/features/space/components/space-switch-flow.js +0 -97
|
@@ -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({
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Appends ByteRover gitignore entries to the project's .gitignore.
|
|
3
|
+
*
|
|
4
|
+
* Only acts when the project is a git repo (.git/ exists).
|
|
5
|
+
* Idempotent: skips if entries are already present.
|
|
6
|
+
* Best-effort: failures are silently ignored since gitignore
|
|
7
|
+
* is a convenience feature that should never block the caller.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ensureGitignoreEntries(directory: string): Promise<void>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { access, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
const GITIGNORE_ENTRIES = `# ByteRover — .brv/context-tree/ contains a nested .git managed by brv vc.
|
|
4
|
+
# Without these entries, \`git add .\` fails with "does not have a commit checked out".
|
|
5
|
+
.brv/
|
|
6
|
+
`;
|
|
7
|
+
/**
|
|
8
|
+
* Appends ByteRover gitignore entries to the project's .gitignore.
|
|
9
|
+
*
|
|
10
|
+
* Only acts when the project is a git repo (.git/ exists).
|
|
11
|
+
* Idempotent: skips if entries are already present.
|
|
12
|
+
* Best-effort: failures are silently ignored since gitignore
|
|
13
|
+
* is a convenience feature that should never block the caller.
|
|
14
|
+
*/
|
|
15
|
+
export async function ensureGitignoreEntries(directory) {
|
|
16
|
+
try {
|
|
17
|
+
const dir = directory;
|
|
18
|
+
// Only add entries in git repositories
|
|
19
|
+
await access(join(dir, '.git'));
|
|
20
|
+
const gitignorePath = join(dir, '.gitignore');
|
|
21
|
+
let existing = '';
|
|
22
|
+
try {
|
|
23
|
+
existing = await readFile(gitignorePath, 'utf8');
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// .gitignore doesn't exist yet — will create it
|
|
27
|
+
}
|
|
28
|
+
// Idempotent: skip if already present
|
|
29
|
+
if (existing.includes('.brv/'))
|
|
30
|
+
return;
|
|
31
|
+
// Ensure a blank line separates existing content from new entries
|
|
32
|
+
let content;
|
|
33
|
+
if (existing.length === 0) {
|
|
34
|
+
content = GITIGNORE_ENTRIES;
|
|
35
|
+
}
|
|
36
|
+
else if (existing.endsWith('\n')) {
|
|
37
|
+
content = existing + '\n' + GITIGNORE_ENTRIES;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
content = existing + '\n\n' + GITIGNORE_ENTRIES;
|
|
41
|
+
}
|
|
42
|
+
await writeFile(gitignorePath, content, 'utf8');
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Best-effort — gitignore failure should not block the caller
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -13,6 +13,7 @@ export * from './provider-events.js';
|
|
|
13
13
|
export * from './pull-events.js';
|
|
14
14
|
export * from './push-events.js';
|
|
15
15
|
export * from './reset-events.js';
|
|
16
|
+
export * from './review-events.js';
|
|
16
17
|
export * from './session-events.js';
|
|
17
18
|
export * from './space-events.js';
|
|
18
19
|
export * from './status-events.js';
|
|
@@ -64,6 +65,7 @@ export declare const AllEventGroups: readonly [{
|
|
|
64
65
|
readonly GET_AGENTS: "init:getAgents";
|
|
65
66
|
readonly GET_SPACES: "init:getSpaces";
|
|
66
67
|
readonly GET_TEAMS: "init:getTeams";
|
|
68
|
+
readonly LOCAL: "init:local";
|
|
67
69
|
readonly PROGRESS: "init:progress";
|
|
68
70
|
}, {
|
|
69
71
|
readonly CHUNK: "llmservice:chunk";
|
|
@@ -107,6 +109,10 @@ export declare const AllEventGroups: readonly [{
|
|
|
107
109
|
readonly PROGRESS: "push:progress";
|
|
108
110
|
}, {
|
|
109
111
|
readonly EXECUTE: "reset:execute";
|
|
112
|
+
}, {
|
|
113
|
+
readonly DECIDE_TASK: "review:decideTask";
|
|
114
|
+
readonly NOTIFY: "review:notify";
|
|
115
|
+
readonly PENDING: "review:pending";
|
|
110
116
|
}, {
|
|
111
117
|
readonly SWITCHED: "session:switched";
|
|
112
118
|
}, {
|
|
@@ -15,6 +15,7 @@ export * from './provider-events.js';
|
|
|
15
15
|
export * from './pull-events.js';
|
|
16
16
|
export * from './push-events.js';
|
|
17
17
|
export * from './reset-events.js';
|
|
18
|
+
export * from './review-events.js';
|
|
18
19
|
export * from './session-events.js';
|
|
19
20
|
export * from './space-events.js';
|
|
20
21
|
export * from './status-events.js';
|
|
@@ -34,6 +35,7 @@ import { ProviderEvents } from './provider-events.js';
|
|
|
34
35
|
import { PullEvents } from './pull-events.js';
|
|
35
36
|
import { PushEvents } from './push-events.js';
|
|
36
37
|
import { ResetEvents } from './reset-events.js';
|
|
38
|
+
import { ReviewEvents } from './review-events.js';
|
|
37
39
|
import { SessionEvents } from './session-events.js';
|
|
38
40
|
import { SpaceEvents } from './space-events.js';
|
|
39
41
|
import { StatusEvents } from './status-events.js';
|
|
@@ -56,6 +58,7 @@ export const AllEventGroups = [
|
|
|
56
58
|
PullEvents,
|
|
57
59
|
PushEvents,
|
|
58
60
|
ResetEvents,
|
|
61
|
+
ReviewEvents,
|
|
59
62
|
SessionEvents,
|
|
60
63
|
LocationsEvents,
|
|
61
64
|
SpaceEvents,
|
|
@@ -7,6 +7,7 @@ export declare const InitEvents: {
|
|
|
7
7
|
readonly GET_AGENTS: "init:getAgents";
|
|
8
8
|
readonly GET_SPACES: "init:getSpaces";
|
|
9
9
|
readonly GET_TEAMS: "init:getTeams";
|
|
10
|
+
readonly LOCAL: "init:local";
|
|
10
11
|
readonly PROGRESS: "init:progress";
|
|
11
12
|
};
|
|
12
13
|
export interface InitGetTeamsResponse {
|
|
@@ -31,6 +32,13 @@ export interface InitExecuteRequest {
|
|
|
31
32
|
export interface InitExecuteResponse {
|
|
32
33
|
success: boolean;
|
|
33
34
|
}
|
|
35
|
+
export interface InitLocalRequest {
|
|
36
|
+
force?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface InitLocalResponse {
|
|
39
|
+
alreadyInitialized: boolean;
|
|
40
|
+
success: boolean;
|
|
41
|
+
}
|
|
34
42
|
export interface InitProgressEvent {
|
|
35
43
|
message: string;
|
|
36
44
|
step: string;
|