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
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "byterover-cli",
|
|
3
3
|
"description": "ByteRover's CLI",
|
|
4
|
-
"
|
|
4
|
+
"keywords": [
|
|
5
|
+
"cli", "ai", "llm", "mcp", "developer-tools",
|
|
6
|
+
"context-memory", "autonomous-agents", "coding-assistant",
|
|
7
|
+
"knowledge-management"
|
|
8
|
+
],
|
|
9
|
+
"version": "3.0.0",
|
|
5
10
|
"author": "ByteRover",
|
|
6
11
|
"bin": {
|
|
7
12
|
"brv": "./bin/run.js"
|
|
@@ -22,7 +27,7 @@
|
|
|
22
27
|
"@ai-sdk/vercel": "^1.0.33",
|
|
23
28
|
"@ai-sdk/xai": "^2.0.57",
|
|
24
29
|
"@anthropic-ai/sdk": "^0.70.1",
|
|
25
|
-
"@campfirein/brv-transport-client": "github:campfirein/brv-transport-client#
|
|
30
|
+
"@campfirein/brv-transport-client": "github:campfirein/brv-transport-client#1.0.0",
|
|
26
31
|
"@google/genai": "^1.29.0",
|
|
27
32
|
"@inkjs/ui": "^2.0.0",
|
|
28
33
|
"@inquirer/prompts": "^7.9.0",
|
|
@@ -36,6 +41,7 @@
|
|
|
36
41
|
"ai": "^5.0.129",
|
|
37
42
|
"axios": "1.14.0",
|
|
38
43
|
"chalk": "^5.6.2",
|
|
44
|
+
"dotenv": "^17.3.1",
|
|
39
45
|
"esbuild": "^0.27.2",
|
|
40
46
|
"express": "^5.1.0",
|
|
41
47
|
"fullscreen-ink": "^0.1.0",
|
|
@@ -48,6 +54,7 @@
|
|
|
48
54
|
"ink-spinner": "^5.0.0",
|
|
49
55
|
"ink-text-input": "^6.0.0",
|
|
50
56
|
"inquirer-file-selector": "^1.0.1",
|
|
57
|
+
"isomorphic-git": "^1.37.2",
|
|
51
58
|
"js-yaml": "^4.1.1",
|
|
52
59
|
"lodash-es": "^4.17.22",
|
|
53
60
|
"minisearch": "^7.2.0",
|
|
@@ -110,12 +117,13 @@
|
|
|
110
117
|
"node": ">=20.0.0"
|
|
111
118
|
},
|
|
112
119
|
"files": [
|
|
120
|
+
"./.env.production",
|
|
113
121
|
"./bin",
|
|
114
122
|
"./dist",
|
|
115
123
|
"./oclif.manifest.json"
|
|
116
124
|
],
|
|
117
125
|
"homepage": "https://www.byterover.dev/",
|
|
118
|
-
"license": "
|
|
126
|
+
"license": "Elastic-2.0",
|
|
119
127
|
"main": "dist/index.js",
|
|
120
128
|
"type": "module",
|
|
121
129
|
"oclif": {
|
|
@@ -126,11 +134,11 @@
|
|
|
126
134
|
"init": [
|
|
127
135
|
"./dist/oclif/hooks/init/block-command-update-npm",
|
|
128
136
|
"./dist/oclif/hooks/init/welcome",
|
|
129
|
-
"./dist/oclif/hooks/init/update-notifier"
|
|
137
|
+
"./dist/oclif/hooks/init/update-notifier",
|
|
138
|
+
"./dist/oclif/hooks/init/validate-brv-config"
|
|
130
139
|
],
|
|
131
140
|
"command_not_found": "./dist/oclif/hooks/command_not_found/handle-invalid-commands",
|
|
132
141
|
"error": "./dist/oclif/hooks/error/clean-errors",
|
|
133
|
-
"prerun": "./dist/oclif/hooks/prerun/validate-brv-config-version",
|
|
134
142
|
"postrun": "./dist/oclif/hooks/postrun/restart-after-update"
|
|
135
143
|
},
|
|
136
144
|
"plugins": [
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Hook } from '@oclif/core';
|
|
2
|
-
import type { IProjectConfigStore } from '../../../server/core/interfaces/storage/i-project-config-store.js';
|
|
3
|
-
import { type AutoInitDeps } from '../../../server/infra/config/auto-init.js';
|
|
4
|
-
/**
|
|
5
|
-
* Commands that should skip auto-init and config version validation.
|
|
6
|
-
*/
|
|
7
|
-
export declare const SKIP_COMMANDS: Set<string>;
|
|
8
|
-
/**
|
|
9
|
-
* Dependencies for the curate-view patch marker, injected for testability.
|
|
10
|
-
* The marker file lives in the XDG/global data dir scoped to the current project,
|
|
11
|
-
* keeping internal patch bookkeeping out of the user-facing .brv/config.json.
|
|
12
|
-
*/
|
|
13
|
-
export type PatchMarkerDeps = {
|
|
14
|
-
isPatched(): Promise<boolean>;
|
|
15
|
-
markPatched(): Promise<void>;
|
|
16
|
-
patchFn?: (cwd: string) => Promise<void>;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Core validation logic extracted for testability.
|
|
20
|
-
* Auto-initializes .brv/ if it doesn't exist, then migrates config version if needed.
|
|
21
|
-
* Also ensures connector files are patched with `brv curate view` docs (once per project).
|
|
22
|
-
*
|
|
23
|
-
* @param commandId - The command being executed
|
|
24
|
-
* @param configStore - The config store to use for reading config
|
|
25
|
-
* @param autoInitDeps - Dependencies for auto-init (optional, for testing)
|
|
26
|
-
* @param patchMarkerDeps - Dependencies for the curate-view patch marker (optional, for testing)
|
|
27
|
-
*/
|
|
28
|
-
export declare const validateBrvConfigVersion: (commandId: string, configStore: IProjectConfigStore, autoInitDeps?: AutoInitDeps, patchMarkerDeps?: PatchMarkerDeps) => Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Prerun hook that auto-initializes .brv/ if missing, then validates config version.
|
|
31
|
-
*/
|
|
32
|
-
declare const hook: Hook<'prerun'>;
|
|
33
|
-
export default hook;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { access, mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
3
|
-
import { BRV_CONFIG_VERSION } from '../../../server/constants.js';
|
|
4
|
-
import { ensureProjectInitialized } from '../../../server/infra/config/auto-init.js';
|
|
5
|
-
import { ProjectConfigStore } from '../../../server/infra/config/file-config-store.js';
|
|
6
|
-
import { ensureCurateViewPatched } from '../../../server/infra/connectors/shared/rule-segment-patcher.js';
|
|
7
|
-
import { FileContextTreeService } from '../../../server/infra/context-tree/file-context-tree-service.js';
|
|
8
|
-
import { FileContextTreeSnapshotService } from '../../../server/infra/context-tree/file-context-tree-snapshot-service.js';
|
|
9
|
-
import { syncConfigToXdg } from '../../../server/utils/config-xdg-sync.js';
|
|
10
|
-
import { getProjectDataDir } from '../../../server/utils/path-utils.js';
|
|
11
|
-
/**
|
|
12
|
-
* Commands that should skip auto-init and config version validation.
|
|
13
|
-
*/
|
|
14
|
-
export const SKIP_COMMANDS = new Set(['--help', 'help', 'login', 'logout']);
|
|
15
|
-
const getCurateViewMarkerPath = (cwd) => join(getProjectDataDir(cwd), 'patches', 'curate-view.done');
|
|
16
|
-
const defaultPatchMarkerDeps = (cwd) => ({
|
|
17
|
-
async isPatched() {
|
|
18
|
-
try {
|
|
19
|
-
await access(getCurateViewMarkerPath(cwd));
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
async markPatched() {
|
|
27
|
-
const markerPath = getCurateViewMarkerPath(cwd);
|
|
28
|
-
await mkdir(dirname(markerPath), { recursive: true });
|
|
29
|
-
await writeFile(markerPath, '');
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
/**
|
|
33
|
-
* Core validation logic extracted for testability.
|
|
34
|
-
* Auto-initializes .brv/ if it doesn't exist, then migrates config version if needed.
|
|
35
|
-
* Also ensures connector files are patched with `brv curate view` docs (once per project).
|
|
36
|
-
*
|
|
37
|
-
* @param commandId - The command being executed
|
|
38
|
-
* @param configStore - The config store to use for reading config
|
|
39
|
-
* @param autoInitDeps - Dependencies for auto-init (optional, for testing)
|
|
40
|
-
* @param patchMarkerDeps - Dependencies for the curate-view patch marker (optional, for testing)
|
|
41
|
-
*/
|
|
42
|
-
export const validateBrvConfigVersion = async (commandId, configStore, autoInitDeps, patchMarkerDeps) => {
|
|
43
|
-
// Skip for commands that don't need config
|
|
44
|
-
if (SKIP_COMMANDS.has(commandId)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const exists = await configStore.exists();
|
|
48
|
-
if (!exists) {
|
|
49
|
-
// Auto-init: create .brv/ with minimal local config
|
|
50
|
-
const deps = autoInitDeps ?? {
|
|
51
|
-
contextTreeService: new FileContextTreeService(),
|
|
52
|
-
contextTreeSnapshotService: new FileContextTreeSnapshotService(),
|
|
53
|
-
projectConfigStore: configStore,
|
|
54
|
-
};
|
|
55
|
-
await ensureProjectInitialized(deps);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
// Read existing config — fromJson() preserves original version
|
|
59
|
-
const config = await configStore.read();
|
|
60
|
-
if (!config)
|
|
61
|
-
return;
|
|
62
|
-
// ProjectConfigStore checks .brv/ at process.cwd() directly (no walk-up),
|
|
63
|
-
// so configStore.exists() returning true means process.cwd() IS the project root.
|
|
64
|
-
const cwd = process.cwd();
|
|
65
|
-
// Gate the connector-file patch behind a per-project marker file in the XDG data dir.
|
|
66
|
-
// This keeps internal bookkeeping out of the user-facing .brv/config.json.
|
|
67
|
-
const marker = patchMarkerDeps ?? defaultPatchMarkerDeps(cwd);
|
|
68
|
-
const alreadyPatched = await marker.isPatched();
|
|
69
|
-
if (!alreadyPatched) {
|
|
70
|
-
const patchFn = patchMarkerDeps?.patchFn ?? ensureCurateViewPatched;
|
|
71
|
-
await patchFn(cwd).catch(() => { });
|
|
72
|
-
await marker.markPatched().catch(() => { });
|
|
73
|
-
}
|
|
74
|
-
if (config.version !== BRV_CONFIG_VERSION) {
|
|
75
|
-
const updated = config.withVersion(BRV_CONFIG_VERSION);
|
|
76
|
-
await configStore.write(updated);
|
|
77
|
-
await syncConfigToXdg(updated, cwd);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Prerun hook that auto-initializes .brv/ if missing, then validates config version.
|
|
82
|
-
*/
|
|
83
|
-
const hook = async function (options) {
|
|
84
|
-
await validateBrvConfigVersion(options.Command.id, new ProjectConfigStore());
|
|
85
|
-
};
|
|
86
|
-
export default hook;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents metadata associated with a bullet point
|
|
3
|
-
*/
|
|
4
|
-
export interface BulletMetadata {
|
|
5
|
-
relatedFiles: string[];
|
|
6
|
-
tags: string[];
|
|
7
|
-
timestamp: string;
|
|
8
|
-
}
|
|
9
|
-
export interface BulletJson {
|
|
10
|
-
content?: string;
|
|
11
|
-
id: string;
|
|
12
|
-
memoryId?: string;
|
|
13
|
-
metadata: {
|
|
14
|
-
relatedFiles: string[];
|
|
15
|
-
tags: string[];
|
|
16
|
-
timestamp: string;
|
|
17
|
-
};
|
|
18
|
-
section: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Represents a single knowledge entry in the playbook.
|
|
22
|
-
* Bullets contain reusable insights, strategies, or lessons learned.
|
|
23
|
-
*/
|
|
24
|
-
export declare class Bullet {
|
|
25
|
-
readonly content: string;
|
|
26
|
-
readonly id: string;
|
|
27
|
-
readonly memoryId?: string;
|
|
28
|
-
readonly metadata: BulletMetadata;
|
|
29
|
-
readonly section: string;
|
|
30
|
-
constructor(id: string, section: string, content: string, metadata: BulletMetadata, memoryId?: string);
|
|
31
|
-
/**
|
|
32
|
-
* Creates a Bullet instance from a JSON object.
|
|
33
|
-
* The content parameter must be provided separately when content is stored in files.
|
|
34
|
-
* @param json The JSON object containing bullet metadata
|
|
35
|
-
* @param content Optional content string (required if json.content is undefined)
|
|
36
|
-
*/
|
|
37
|
-
static fromJson(json: BulletJson, content?: string): Bullet;
|
|
38
|
-
/**
|
|
39
|
-
* Formats the bullet for display in a playbook
|
|
40
|
-
*/
|
|
41
|
-
toDisplayString(): string;
|
|
42
|
-
/**
|
|
43
|
-
* Converts the bullet to a JSON object
|
|
44
|
-
* @param includeContent If false, content field is omitted (for file-based storage)
|
|
45
|
-
*/
|
|
46
|
-
toJson(includeContent?: boolean): BulletJson;
|
|
47
|
-
/**
|
|
48
|
-
* Creates a new bullet with updated content
|
|
49
|
-
*/
|
|
50
|
-
withUpdatedContent(content: string): Bullet;
|
|
51
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a single knowledge entry in the playbook.
|
|
3
|
-
* Bullets contain reusable insights, strategies, or lessons learned.
|
|
4
|
-
*/
|
|
5
|
-
export class Bullet {
|
|
6
|
-
content;
|
|
7
|
-
id;
|
|
8
|
-
memoryId;
|
|
9
|
-
metadata;
|
|
10
|
-
section;
|
|
11
|
-
// eslint-disable-next-line max-params
|
|
12
|
-
constructor(id, section, content, metadata, memoryId) {
|
|
13
|
-
if (id.trim().length === 0) {
|
|
14
|
-
throw new Error('Bullet ID cannot be empty');
|
|
15
|
-
}
|
|
16
|
-
if (section.trim().length === 0) {
|
|
17
|
-
throw new Error('Bullet section cannot be empty');
|
|
18
|
-
}
|
|
19
|
-
if (content.trim().length === 0) {
|
|
20
|
-
throw new Error('Bullet content cannot be empty');
|
|
21
|
-
}
|
|
22
|
-
if (!metadata.timestamp || metadata.timestamp.trim().length === 0) {
|
|
23
|
-
throw new Error('Bullet metadata timestamp cannot be empty');
|
|
24
|
-
}
|
|
25
|
-
if (!metadata.relatedFiles || !Array.isArray(metadata.relatedFiles)) {
|
|
26
|
-
throw new Error('Bullet metadata relatedFiles must be an array');
|
|
27
|
-
}
|
|
28
|
-
if (!metadata.tags || metadata.tags.length === 0) {
|
|
29
|
-
throw new Error('Bullet metadata tags cannot be empty');
|
|
30
|
-
}
|
|
31
|
-
this.id = id;
|
|
32
|
-
this.section = section;
|
|
33
|
-
this.content = content;
|
|
34
|
-
this.metadata = metadata;
|
|
35
|
-
this.memoryId = memoryId;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Creates a Bullet instance from a JSON object.
|
|
39
|
-
* The content parameter must be provided separately when content is stored in files.
|
|
40
|
-
* @param json The JSON object containing bullet metadata
|
|
41
|
-
* @param content Optional content string (required if json.content is undefined)
|
|
42
|
-
*/
|
|
43
|
-
static fromJson(json, content) {
|
|
44
|
-
const bulletContent = json.content ?? content;
|
|
45
|
-
if (!bulletContent) {
|
|
46
|
-
throw new Error(`Bullet content is required for bullet ${json.id}`);
|
|
47
|
-
}
|
|
48
|
-
return new Bullet(json.id, json.section, bulletContent, {
|
|
49
|
-
relatedFiles: json.metadata.relatedFiles,
|
|
50
|
-
tags: json.metadata.tags,
|
|
51
|
-
timestamp: json.metadata.timestamp,
|
|
52
|
-
}, json.memoryId);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Formats the bullet for display in a playbook
|
|
56
|
-
*/
|
|
57
|
-
toDisplayString() {
|
|
58
|
-
const tags = this.metadata.tags.join(', ');
|
|
59
|
-
const tagDisplay = `[Tags: ${tags}]`;
|
|
60
|
-
const filesDisplay = this.metadata.relatedFiles.length > 0 ? `[Files: ${this.metadata.relatedFiles.join(', ')}]` : '[Files: none]';
|
|
61
|
-
const timestampDisplay = `[Updated: ${this.metadata.timestamp}]`;
|
|
62
|
-
const metadataDisplay = [tagDisplay, filesDisplay, timestampDisplay].join(' ');
|
|
63
|
-
return `- [${this.id}] ${this.content}\n ${this.section}\n ${metadataDisplay}`;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Converts the bullet to a JSON object
|
|
67
|
-
* @param includeContent If false, content field is omitted (for file-based storage)
|
|
68
|
-
*/
|
|
69
|
-
toJson(includeContent = true) {
|
|
70
|
-
const json = {
|
|
71
|
-
id: this.id,
|
|
72
|
-
memoryId: this.memoryId,
|
|
73
|
-
metadata: {
|
|
74
|
-
relatedFiles: this.metadata.relatedFiles,
|
|
75
|
-
tags: this.metadata.tags,
|
|
76
|
-
timestamp: this.metadata.timestamp,
|
|
77
|
-
},
|
|
78
|
-
section: this.section,
|
|
79
|
-
};
|
|
80
|
-
if (includeContent) {
|
|
81
|
-
json.content = this.content;
|
|
82
|
-
}
|
|
83
|
-
return json;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Creates a new bullet with updated content
|
|
87
|
-
*/
|
|
88
|
-
withUpdatedContent(content) {
|
|
89
|
-
return new Bullet(this.id, this.section, content, {
|
|
90
|
-
...this.metadata,
|
|
91
|
-
timestamp: new Date().toISOString(),
|
|
92
|
-
}, this.memoryId);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parameters for creating a Memory instance.
|
|
3
|
-
*
|
|
4
|
-
* Note: score, parentIds, and childrenIds are optional.
|
|
5
|
-
* These fields are present in primary memories (from the `memories` array)
|
|
6
|
-
* but absent in related memories (from the `related_memories` array).
|
|
7
|
-
*/
|
|
8
|
-
export type MemoryParams = {
|
|
9
|
-
bulletId: string;
|
|
10
|
-
childrenIds?: string[];
|
|
11
|
-
content: string;
|
|
12
|
-
id: string;
|
|
13
|
-
metadataType: string;
|
|
14
|
-
nodeKeys: string[];
|
|
15
|
-
parentIds?: string[];
|
|
16
|
-
score?: number;
|
|
17
|
-
section: string;
|
|
18
|
-
tags: string[];
|
|
19
|
-
timestamp: string;
|
|
20
|
-
title: string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Represents a memory retrieved from the ByteRover Memora service.
|
|
24
|
-
* Memories are hierarchical knowledge fragments that can have parent and child relationships.
|
|
25
|
-
*
|
|
26
|
-
* Note: score, parentIds, and childrenIds are optional fields.
|
|
27
|
-
* - Primary memories (from API `memories` array) have these fields
|
|
28
|
-
* - Related memories (from API `related_memories` array) don't have these fields
|
|
29
|
-
*/
|
|
30
|
-
export declare class Memory {
|
|
31
|
-
readonly bulletId: string;
|
|
32
|
-
readonly childrenIds?: readonly string[];
|
|
33
|
-
readonly content: string;
|
|
34
|
-
readonly id: string;
|
|
35
|
-
readonly metadataType: string;
|
|
36
|
-
readonly nodeKeys: readonly string[];
|
|
37
|
-
readonly parentIds?: readonly string[];
|
|
38
|
-
readonly score?: number;
|
|
39
|
-
readonly section: string;
|
|
40
|
-
readonly tags: readonly string[];
|
|
41
|
-
readonly timestamp: string;
|
|
42
|
-
readonly title: string;
|
|
43
|
-
constructor(params: MemoryParams);
|
|
44
|
-
/**
|
|
45
|
-
* Creates a Memory instance from a JSON object.
|
|
46
|
-
* @param json JSON object representing the Memory
|
|
47
|
-
* @returns An instance of Memory
|
|
48
|
-
*/
|
|
49
|
-
static fromJson(json: MemoryParams): Memory;
|
|
50
|
-
/**
|
|
51
|
-
* Converts the Memory instance to a JSON object.
|
|
52
|
-
* @returns A JSON object representing the Memory
|
|
53
|
-
*/
|
|
54
|
-
toJson(): MemoryParams;
|
|
55
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a memory retrieved from the ByteRover Memora service.
|
|
3
|
-
* Memories are hierarchical knowledge fragments that can have parent and child relationships.
|
|
4
|
-
*
|
|
5
|
-
* Note: score, parentIds, and childrenIds are optional fields.
|
|
6
|
-
* - Primary memories (from API `memories` array) have these fields
|
|
7
|
-
* - Related memories (from API `related_memories` array) don't have these fields
|
|
8
|
-
*/
|
|
9
|
-
export class Memory {
|
|
10
|
-
bulletId;
|
|
11
|
-
childrenIds;
|
|
12
|
-
content;
|
|
13
|
-
id;
|
|
14
|
-
metadataType;
|
|
15
|
-
nodeKeys;
|
|
16
|
-
parentIds;
|
|
17
|
-
score;
|
|
18
|
-
section;
|
|
19
|
-
tags;
|
|
20
|
-
timestamp;
|
|
21
|
-
title;
|
|
22
|
-
constructor(params) {
|
|
23
|
-
if (params.id.trim().length === 0) {
|
|
24
|
-
throw new Error('Memory ID cannot be empty');
|
|
25
|
-
}
|
|
26
|
-
if (params.bulletId.trim().length === 0) {
|
|
27
|
-
throw new Error('Memory bulletId cannot be empty');
|
|
28
|
-
}
|
|
29
|
-
if (params.title.trim().length === 0) {
|
|
30
|
-
throw new Error('Memory title cannot be empty');
|
|
31
|
-
}
|
|
32
|
-
if (params.content.trim().length === 0) {
|
|
33
|
-
throw new Error('Memory content cannot be empty');
|
|
34
|
-
}
|
|
35
|
-
if (params.section.trim().length === 0) {
|
|
36
|
-
throw new Error('Memory section cannot be empty');
|
|
37
|
-
}
|
|
38
|
-
if (params.timestamp.trim().length === 0) {
|
|
39
|
-
throw new Error('Memory timestamp cannot be empty');
|
|
40
|
-
}
|
|
41
|
-
if (params.metadataType.trim().length === 0) {
|
|
42
|
-
throw new Error('Memory metadataType cannot be empty');
|
|
43
|
-
}
|
|
44
|
-
// Only validate score if it's provided (primary memories have score, related memories don't)
|
|
45
|
-
if (params.score !== undefined && (params.score < 0 || params.score > 1)) {
|
|
46
|
-
throw new Error('Memory score must be between 0.0 and 1.0');
|
|
47
|
-
}
|
|
48
|
-
this.id = params.id;
|
|
49
|
-
this.bulletId = params.bulletId;
|
|
50
|
-
this.title = params.title;
|
|
51
|
-
this.content = params.content;
|
|
52
|
-
this.score = params.score;
|
|
53
|
-
this.section = params.section;
|
|
54
|
-
this.metadataType = params.metadataType;
|
|
55
|
-
this.timestamp = params.timestamp;
|
|
56
|
-
// Defensive copy to prevent external mutation
|
|
57
|
-
this.nodeKeys = [...params.nodeKeys];
|
|
58
|
-
this.parentIds = params.parentIds ? [...params.parentIds] : undefined;
|
|
59
|
-
this.childrenIds = params.childrenIds ? [...params.childrenIds] : undefined;
|
|
60
|
-
this.tags = [...params.tags];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Creates a Memory instance from a JSON object.
|
|
64
|
-
* @param json JSON object representing the Memory
|
|
65
|
-
* @returns An instance of Memory
|
|
66
|
-
*/
|
|
67
|
-
static fromJson(json) {
|
|
68
|
-
return new Memory(json);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Converts the Memory instance to a JSON object.
|
|
72
|
-
* @returns A JSON object representing the Memory
|
|
73
|
-
*/
|
|
74
|
-
toJson() {
|
|
75
|
-
return {
|
|
76
|
-
bulletId: this.bulletId,
|
|
77
|
-
...(this.childrenIds !== undefined && { childrenIds: [...this.childrenIds] }),
|
|
78
|
-
content: this.content,
|
|
79
|
-
id: this.id,
|
|
80
|
-
metadataType: this.metadataType,
|
|
81
|
-
nodeKeys: [...this.nodeKeys],
|
|
82
|
-
...(this.parentIds !== undefined && { parentIds: [...this.parentIds] }),
|
|
83
|
-
...(this.score !== undefined && { score: this.score }),
|
|
84
|
-
section: this.section,
|
|
85
|
-
tags: [...this.tags],
|
|
86
|
-
timestamp: this.timestamp,
|
|
87
|
-
title: this.title,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Bullet, type BulletJson, type BulletMetadata } from './bullet.js';
|
|
2
|
-
export interface PlaybookJson {
|
|
3
|
-
bullets: Record<string, BulletJson>;
|
|
4
|
-
nextId: number;
|
|
5
|
-
sections: Record<string, string[]>;
|
|
6
|
-
}
|
|
7
|
-
export interface PlaybookStats {
|
|
8
|
-
bullets: number;
|
|
9
|
-
sections: number;
|
|
10
|
-
tags: string[];
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The central knowledge repository that stores and manages bullets.
|
|
14
|
-
* Playbooks are organized into sections.
|
|
15
|
-
* Playbooks are used as temporary notes then will be pushed to byterover for usage.
|
|
16
|
-
*/
|
|
17
|
-
export declare class Playbook {
|
|
18
|
-
private readonly bullets;
|
|
19
|
-
private nextId;
|
|
20
|
-
private readonly sections;
|
|
21
|
-
constructor(bullets?: Map<string, Bullet>, sections?: Map<string, string[]>, nextId?: number);
|
|
22
|
-
/**
|
|
23
|
-
* Adds a new bullet to the playbook
|
|
24
|
-
*/
|
|
25
|
-
addBullet(section: string, content: string, bulletId?: string, metadata?: BulletMetadata): Bullet;
|
|
26
|
-
/**
|
|
27
|
-
* Adds a tag to a bullet
|
|
28
|
-
*/
|
|
29
|
-
addTagToBullet(bulletId: string, tag: string): Bullet | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Converts playbook to markdown format for LLM prompts
|
|
32
|
-
*/
|
|
33
|
-
asPrompt(): string;
|
|
34
|
-
/**
|
|
35
|
-
* Serializes to JSON string (pretty-printed)
|
|
36
|
-
* @param includeContent If false, content field is omitted from bullets (for file-based storage)
|
|
37
|
-
*/
|
|
38
|
-
dumps(includeContent?: boolean): string;
|
|
39
|
-
/**
|
|
40
|
-
* Retrieves a single bullet by ID
|
|
41
|
-
*/
|
|
42
|
-
getBullet(bulletId: string): Bullet | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Returns all bullets as an array
|
|
45
|
-
*/
|
|
46
|
-
getBullets(): Bullet[];
|
|
47
|
-
/**
|
|
48
|
-
* Returns bullets in a specific section
|
|
49
|
-
*/
|
|
50
|
-
getBulletsInSection(section: string): Bullet[];
|
|
51
|
-
/**
|
|
52
|
-
* Returns the next bullet ID that will be generated
|
|
53
|
-
*/
|
|
54
|
-
getNextId(): string;
|
|
55
|
-
/**
|
|
56
|
-
* Returns all section names
|
|
57
|
-
*/
|
|
58
|
-
getSections(): string[];
|
|
59
|
-
/**
|
|
60
|
-
* Removes a bullet from the playbook
|
|
61
|
-
*/
|
|
62
|
-
removeBullet(bulletId: string): void;
|
|
63
|
-
/**
|
|
64
|
-
* Removes a tag from a bullet
|
|
65
|
-
*/
|
|
66
|
-
removeTagFromBullet(bulletId: string, tag: string): Bullet | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Returns playbook statistics
|
|
69
|
-
*/
|
|
70
|
-
stats(): PlaybookStats;
|
|
71
|
-
toJson(includeContent?: boolean): PlaybookJson;
|
|
72
|
-
/**
|
|
73
|
-
* Updates an existing bullet's content and/or metadata
|
|
74
|
-
*/
|
|
75
|
-
updateBullet(bulletId: string, options: {
|
|
76
|
-
content?: string;
|
|
77
|
-
metadata?: BulletMetadata;
|
|
78
|
-
}): Bullet | undefined;
|
|
79
|
-
private _generateId;
|
|
80
|
-
}
|