byterover-cli 2.5.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.production +8 -0
- package/LICENSE +44 -0
- package/README.md +240 -14
- package/bin/dev.js +8 -1
- package/bin/run.js +8 -1
- package/dist/agent/core/domain/knowledge/conflict-detector.d.ts +38 -0
- package/dist/agent/core/domain/knowledge/conflict-detector.js +71 -0
- package/dist/agent/core/domain/knowledge/conflict-resolver.d.ts +17 -0
- package/dist/agent/core/domain/knowledge/conflict-resolver.js +118 -0
- package/dist/agent/core/domain/knowledge/utils.d.ts +4 -0
- package/dist/agent/core/domain/knowledge/utils.js +6 -0
- package/dist/agent/core/interfaces/i-curate-service.d.ts +6 -0
- package/dist/agent/infra/tools/implementations/curate-tool.d.ts +67 -34
- package/dist/agent/infra/tools/implementations/curate-tool.js +294 -47
- package/dist/agent/resources/prompts/system-prompt.yml +15 -8
- package/dist/agent/resources/tools/code_exec.txt +3 -0
- package/dist/agent/resources/tools/curate.txt +12 -3
- package/dist/oclif/commands/connectors/install.d.ts +2 -1
- package/dist/oclif/commands/connectors/install.js +38 -3
- package/dist/oclif/commands/curate/index.d.ts +18 -0
- package/dist/oclif/commands/curate/index.js +78 -1
- package/dist/oclif/commands/init.d.ts +12 -0
- package/dist/oclif/commands/init.js +75 -0
- package/dist/oclif/commands/locations.js +1 -1
- package/dist/oclif/commands/providers/connect.d.ts +31 -1
- package/dist/oclif/commands/providers/connect.js +307 -27
- package/dist/oclif/commands/pull.d.ts +1 -0
- package/dist/oclif/commands/pull.js +7 -0
- package/dist/oclif/commands/push.d.ts +1 -0
- package/dist/oclif/commands/push.js +8 -0
- package/dist/oclif/commands/review/approve.d.ts +17 -0
- package/dist/oclif/commands/review/approve.js +37 -0
- package/dist/oclif/commands/review/base-review-decision.d.ts +18 -0
- package/dist/oclif/commands/review/base-review-decision.js +71 -0
- package/dist/oclif/commands/review/pending.d.ts +13 -0
- package/dist/oclif/commands/review/pending.js +94 -0
- package/dist/oclif/commands/review/reject.d.ts +17 -0
- package/dist/oclif/commands/review/reject.js +38 -0
- package/dist/oclif/commands/space/list.d.ts +2 -2
- package/dist/oclif/commands/space/list.js +13 -35
- package/dist/oclif/commands/space/switch.d.ts +2 -7
- package/dist/oclif/commands/space/switch.js +13 -56
- package/dist/oclif/commands/status.d.ts +1 -0
- package/dist/oclif/commands/status.js +11 -1
- package/dist/oclif/commands/vc/add.d.ts +7 -0
- package/dist/oclif/commands/vc/add.js +29 -0
- package/dist/oclif/commands/vc/branch.d.ts +15 -0
- package/dist/oclif/commands/vc/branch.js +70 -0
- package/dist/oclif/commands/vc/checkout.d.ts +14 -0
- package/dist/oclif/commands/vc/checkout.js +47 -0
- package/dist/oclif/commands/vc/clone.d.ts +9 -0
- package/dist/oclif/commands/vc/clone.js +61 -0
- package/dist/oclif/commands/vc/commit.d.ts +10 -0
- package/dist/oclif/commands/vc/commit.js +32 -0
- package/dist/oclif/commands/vc/config.d.ts +10 -0
- package/dist/oclif/commands/vc/config.js +30 -0
- package/dist/oclif/commands/vc/fetch.d.ts +10 -0
- package/dist/oclif/commands/vc/fetch.js +42 -0
- package/dist/oclif/commands/vc/index.d.ts +6 -0
- package/dist/oclif/commands/vc/index.js +8 -0
- package/dist/oclif/commands/vc/init.d.ts +6 -0
- package/dist/oclif/commands/vc/init.js +25 -0
- package/dist/oclif/commands/vc/log.d.ts +13 -0
- package/dist/oclif/commands/vc/log.js +48 -0
- package/dist/oclif/commands/vc/merge.d.ts +19 -0
- package/dist/oclif/commands/vc/merge.js +130 -0
- package/dist/oclif/commands/vc/pull.d.ts +13 -0
- package/dist/oclif/commands/vc/pull.js +60 -0
- package/dist/oclif/commands/vc/push.d.ts +13 -0
- package/dist/oclif/commands/vc/push.js +60 -0
- package/dist/oclif/commands/vc/remote/add.d.ts +10 -0
- package/dist/oclif/commands/vc/remote/add.js +30 -0
- package/dist/oclif/commands/vc/remote/index.d.ts +6 -0
- package/dist/oclif/commands/vc/remote/index.js +16 -0
- package/dist/oclif/commands/vc/remote/set-url.d.ts +10 -0
- package/dist/oclif/commands/vc/remote/set-url.js +30 -0
- package/dist/oclif/commands/vc/reset.d.ts +13 -0
- package/dist/oclif/commands/vc/reset.js +62 -0
- package/dist/oclif/commands/vc/status.d.ts +8 -0
- package/dist/oclif/commands/vc/status.js +106 -0
- package/dist/oclif/hooks/init/validate-brv-config.d.ts +26 -0
- package/dist/oclif/hooks/init/validate-brv-config.js +62 -0
- package/dist/oclif/lib/daemon-client.d.ts +2 -0
- package/dist/oclif/lib/daemon-client.js +36 -10
- package/dist/oclif/lib/prompt-utils.d.ts +43 -0
- package/dist/oclif/lib/prompt-utils.js +84 -0
- package/dist/oclif/lib/spinner.d.ts +8 -0
- package/dist/oclif/lib/spinner.js +23 -0
- package/dist/oclif/lib/task-client.d.ts +5 -0
- package/dist/oclif/lib/task-client.js +15 -2
- package/dist/server/config/environment.d.ts +2 -19
- package/dist/server/config/environment.js +31 -38
- package/dist/server/constants.d.ts +3 -9
- package/dist/server/constants.js +9 -12
- package/dist/server/core/domain/entities/auth-token.d.ts +2 -0
- package/dist/server/core/domain/entities/auth-token.js +7 -1
- package/dist/server/core/domain/entities/curate-log-entry.d.ts +11 -0
- package/dist/server/core/domain/entities/space.d.ts +4 -0
- package/dist/server/core/domain/entities/space.js +8 -0
- package/dist/server/core/domain/entities/team.d.ts +2 -0
- package/dist/server/core/domain/entities/team.js +4 -0
- package/dist/server/core/domain/errors/auth-error.d.ts +0 -6
- package/dist/server/core/domain/errors/auth-error.js +0 -12
- package/dist/server/core/domain/errors/git-error.d.ts +6 -0
- package/dist/server/core/domain/errors/git-error.js +12 -0
- package/dist/server/core/domain/errors/task-error.d.ts +4 -3
- package/dist/server/core/domain/errors/task-error.js +8 -8
- package/dist/server/core/domain/errors/transport-error.d.ts +0 -31
- package/dist/server/core/domain/errors/transport-error.js +0 -50
- package/dist/server/core/domain/errors/vc-error.d.ts +5 -0
- package/dist/server/core/domain/errors/vc-error.js +8 -0
- package/dist/server/core/domain/knowledge/markdown-writer.d.ts +4 -1
- package/dist/server/core/domain/knowledge/markdown-writer.js +37 -7
- package/dist/server/core/domain/transport/schemas.d.ts +6 -6
- package/dist/server/core/interfaces/context-tree/i-context-tree-service.d.ts +11 -0
- package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +6 -0
- package/dist/server/core/interfaces/services/i-git-service.d.ts +234 -0
- package/dist/server/core/interfaces/storage/i-curate-log-store.d.ts +5 -0
- package/dist/server/core/interfaces/storage/i-review-backup-store.d.ts +19 -0
- package/dist/server/core/interfaces/vc/i-vc-git-config-store.d.ts +8 -0
- package/dist/server/infra/config/auto-init.d.ts +0 -2
- package/dist/server/infra/config/auto-init.js +0 -1
- package/dist/server/infra/connectors/rules/rules-connector-config.d.ts +0 -4
- package/dist/server/infra/context-tree/file-context-tree-service.d.ts +2 -0
- package/dist/server/infra/context-tree/file-context-tree-service.js +13 -0
- package/dist/server/infra/daemon/brv-server.js +23 -3
- package/dist/server/infra/git/cogit-url.d.ts +17 -0
- package/dist/server/infra/git/cogit-url.js +39 -0
- package/dist/server/infra/git/git-http-wrapper.d.ts +20 -0
- package/dist/server/infra/git/git-http-wrapper.js +334 -0
- package/dist/server/infra/git/isomorphic-git-service.d.ts +78 -0
- package/dist/server/infra/git/isomorphic-git-service.js +983 -0
- package/dist/server/infra/http/models-dev-client.d.ts +0 -4
- package/dist/server/infra/http/models-dev-client.js +0 -6
- package/dist/server/infra/http/openrouter-api-client.d.ts +0 -8
- package/dist/server/infra/http/openrouter-api-client.js +0 -13
- package/dist/server/infra/http/provider-model-fetcher-registry.d.ts +0 -5
- package/dist/server/infra/http/provider-model-fetcher-registry.js +0 -7
- package/dist/server/infra/http/review-api-handler.d.ts +13 -0
- package/dist/server/infra/http/review-api-handler.js +286 -0
- package/dist/server/infra/http/review-ui.d.ts +7 -0
- package/dist/server/infra/http/review-ui.js +606 -0
- package/dist/server/infra/mcp/tools/brv-curate-tool.d.ts +2 -2
- package/dist/server/infra/process/curate-log-handler.d.ts +18 -2
- package/dist/server/infra/process/curate-log-handler.js +50 -13
- package/dist/server/infra/process/feature-handlers.js +41 -1
- package/dist/server/infra/process/task-router.js +16 -0
- package/dist/server/infra/provider/env-provider-detector.d.ts +0 -20
- package/dist/server/infra/provider/env-provider-detector.js +0 -27
- package/dist/server/infra/space/http-space-service.js +2 -0
- package/dist/server/infra/storage/file-curate-log-store.d.ts +10 -0
- package/dist/server/infra/storage/file-curate-log-store.js +35 -0
- package/dist/server/infra/storage/file-provider-config-store.d.ts +0 -4
- package/dist/server/infra/storage/file-provider-config-store.js +0 -6
- package/dist/server/infra/storage/file-review-backup-store.d.ts +29 -0
- package/dist/server/infra/storage/file-review-backup-store.js +121 -0
- package/dist/server/infra/transport/handlers/auth-handler.js +9 -5
- package/dist/server/infra/transport/handlers/handler-types.d.ts +9 -0
- package/dist/server/infra/transport/handlers/handler-types.js +11 -0
- package/dist/server/infra/transport/handlers/index.d.ts +4 -0
- package/dist/server/infra/transport/handlers/index.js +2 -0
- package/dist/server/infra/transport/handlers/init-handler.d.ts +1 -0
- package/dist/server/infra/transport/handlers/init-handler.js +13 -1
- package/dist/server/infra/transport/handlers/pull-handler.d.ts +3 -0
- package/dist/server/infra/transport/handlers/pull-handler.js +5 -1
- package/dist/server/infra/transport/handlers/push-handler.d.ts +20 -0
- package/dist/server/infra/transport/handlers/push-handler.js +116 -14
- package/dist/server/infra/transport/handlers/reset-handler.d.ts +11 -0
- package/dist/server/infra/transport/handlers/reset-handler.js +37 -1
- package/dist/server/infra/transport/handlers/review-handler.d.ts +35 -0
- package/dist/server/infra/transport/handlers/review-handler.js +162 -0
- package/dist/server/infra/transport/handlers/space-handler.d.ts +3 -0
- package/dist/server/infra/transport/handlers/space-handler.js +4 -1
- package/dist/server/infra/transport/handlers/status-handler.d.ts +5 -0
- package/dist/server/infra/transport/handlers/status-handler.js +51 -16
- package/dist/server/infra/transport/handlers/vc-handler.d.ts +100 -0
- package/dist/server/infra/transport/handlers/vc-handler.js +1050 -0
- package/dist/server/infra/transport/socket-io-transport-server.d.ts +7 -0
- package/dist/server/infra/transport/socket-io-transport-server.js +12 -1
- package/dist/server/infra/transport/transport-connector.d.ts +1 -1
- package/dist/server/infra/transport/transport-connector.js +2 -1
- package/dist/server/infra/vc/file-vc-git-config-store.d.ts +11 -0
- package/dist/server/infra/vc/file-vc-git-config-store.js +43 -0
- package/dist/server/templates/skill/SKILL.md +167 -33
- package/dist/server/utils/curate-result-parser.d.ts +64 -0
- package/dist/server/utils/curate-result-parser.js +8 -0
- package/dist/server/utils/file-content-reader.d.ts +2 -1
- package/dist/server/utils/file-helpers.d.ts +0 -24
- package/dist/server/utils/file-helpers.js +0 -81
- package/dist/server/utils/gitignore.d.ts +9 -0
- package/dist/server/utils/gitignore.js +47 -0
- package/dist/server/utils/process-logger.d.ts +0 -13
- package/dist/server/utils/process-logger.js +1 -78
- package/dist/shared/transport/events/index.d.ts +6 -0
- package/dist/shared/transport/events/index.js +3 -0
- package/dist/shared/transport/events/init-events.d.ts +8 -0
- package/dist/shared/transport/events/init-events.js +1 -0
- package/dist/shared/transport/events/push-events.d.ts +6 -0
- package/dist/shared/transport/events/review-events.d.ts +41 -0
- package/dist/shared/transport/events/review-events.js +5 -0
- package/dist/shared/transport/events/vc-events.d.ts +257 -0
- package/dist/shared/transport/events/vc-events.js +67 -0
- package/dist/shared/transport/types/dto.d.ts +6 -1
- package/dist/tui/app/pages/init-project-page.d.ts +9 -0
- package/dist/tui/app/pages/init-project-page.js +54 -0
- package/dist/tui/app/pages/protected-routes.js +14 -6
- package/dist/tui/components/index.d.ts +0 -2
- package/dist/tui/components/index.js +0 -1
- package/dist/tui/features/activity/hooks/use-activity-logs.js +7 -1
- package/dist/tui/features/commands/definitions/index.js +3 -0
- package/dist/tui/features/commands/definitions/space-list.js +9 -18
- package/dist/tui/features/commands/definitions/space-switch.js +10 -6
- package/dist/tui/features/commands/definitions/vc-add.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-add.js +15 -0
- package/dist/tui/features/commands/definitions/vc-branch.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-branch.js +33 -0
- package/dist/tui/features/commands/definitions/vc-checkout.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-checkout.js +32 -0
- package/dist/tui/features/commands/definitions/vc-clone.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-clone.js +18 -0
- package/dist/tui/features/commands/definitions/vc-commit.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-commit.js +32 -0
- package/dist/tui/features/commands/definitions/vc-config.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-config.js +40 -0
- package/dist/tui/features/commands/definitions/vc-fetch.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-fetch.js +37 -0
- package/dist/tui/features/commands/definitions/vc-init.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-init.js +11 -0
- package/dist/tui/features/commands/definitions/vc-log.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-log.js +25 -0
- package/dist/tui/features/commands/definitions/vc-merge.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-merge.js +48 -0
- package/dist/tui/features/commands/definitions/vc-pull.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-pull.js +42 -0
- package/dist/tui/features/commands/definitions/vc-push.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-push.js +38 -0
- package/dist/tui/features/commands/definitions/vc-remote.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-remote.js +57 -0
- package/dist/tui/features/commands/definitions/vc-reset.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-reset.js +35 -0
- package/dist/tui/features/commands/definitions/vc-status.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-status.js +11 -0
- package/dist/tui/features/commands/definitions/vc.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc.js +36 -0
- package/dist/tui/features/commands/hooks/use-slash-command-processor.js +5 -5
- package/dist/tui/features/log/api/execute-log.d.ts +8 -0
- package/dist/tui/features/log/api/execute-log.js +13 -0
- package/dist/tui/features/log/components/log-flow.d.ts +14 -0
- package/dist/tui/features/log/components/log-flow.js +29 -0
- package/dist/tui/features/log/utils/format-log.d.ts +3 -0
- package/dist/tui/features/log/utils/format-log.js +42 -0
- package/dist/tui/features/onboarding/hooks/use-app-view-mode.d.ts +9 -5
- package/dist/tui/features/onboarding/hooks/use-app-view-mode.js +12 -5
- package/dist/tui/features/push/components/push-flow.js +9 -2
- package/dist/tui/features/reset/components/reset-flow.js +2 -1
- package/dist/tui/features/status/components/status-view.js +2 -1
- package/dist/tui/features/status/utils/format-status.js +9 -0
- package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +11 -0
- package/dist/tui/features/tasks/stores/tasks-store.d.ts +10 -0
- package/dist/tui/features/tasks/stores/tasks-store.js +16 -0
- package/dist/tui/features/vc/add/api/execute-vc-add.d.ts +8 -0
- package/dist/tui/features/vc/add/api/execute-vc-add.js +13 -0
- package/dist/tui/features/vc/add/components/vc-add-flow.d.ts +7 -0
- package/dist/tui/features/vc/add/components/vc-add-flow.js +35 -0
- package/dist/tui/features/vc/branch/api/execute-vc-branch.d.ts +8 -0
- package/dist/tui/features/vc/branch/api/execute-vc-branch.js +13 -0
- package/dist/tui/features/vc/branch/components/vc-branch-flow.d.ts +8 -0
- package/dist/tui/features/vc/branch/components/vc-branch-flow.js +53 -0
- package/dist/tui/features/vc/branch/utils/format-branch.d.ts +4 -0
- package/dist/tui/features/vc/branch/utils/format-branch.js +12 -0
- package/dist/tui/features/vc/checkout/api/execute-vc-checkout.d.ts +8 -0
- package/dist/tui/features/vc/checkout/api/execute-vc-checkout.js +13 -0
- package/dist/tui/features/vc/checkout/components/vc-checkout-flow.d.ts +8 -0
- package/dist/tui/features/vc/checkout/components/vc-checkout-flow.js +33 -0
- package/dist/tui/features/vc/clone/api/execute-vc-clone.d.ts +8 -0
- package/dist/tui/features/vc/clone/api/execute-vc-clone.js +13 -0
- package/dist/tui/features/vc/clone/components/vc-clone-flow.d.ts +7 -0
- package/dist/tui/features/vc/clone/components/vc-clone-flow.js +79 -0
- package/dist/tui/features/vc/commit/api/execute-vc-commit.d.ts +8 -0
- package/dist/tui/features/vc/commit/api/execute-vc-commit.js +13 -0
- package/dist/tui/features/vc/commit/components/vc-commit-flow.d.ts +7 -0
- package/dist/tui/features/vc/commit/components/vc-commit-flow.js +29 -0
- package/dist/tui/features/vc/config/api/execute-vc-config.d.ts +8 -0
- package/dist/tui/features/vc/config/api/execute-vc-config.js +13 -0
- package/dist/tui/features/vc/config/components/vc-config-flow.d.ts +9 -0
- package/dist/tui/features/vc/config/components/vc-config-flow.js +30 -0
- package/dist/tui/features/vc/fetch/api/execute-vc-fetch.d.ts +8 -0
- package/dist/tui/features/vc/fetch/api/execute-vc-fetch.js +13 -0
- package/dist/tui/features/vc/fetch/components/vc-fetch-flow.d.ts +8 -0
- package/dist/tui/features/vc/fetch/components/vc-fetch-flow.js +75 -0
- package/dist/tui/features/vc/init/api/execute-vc-init.d.ts +8 -0
- package/dist/tui/features/vc/init/api/execute-vc-init.js +13 -0
- package/dist/tui/features/vc/init/components/vc-init-flow.d.ts +10 -0
- package/dist/tui/features/vc/init/components/vc-init-flow.js +37 -0
- package/dist/tui/features/vc/merge/api/execute-vc-merge.d.ts +8 -0
- package/dist/tui/features/vc/merge/api/execute-vc-merge.js +13 -0
- package/dist/tui/features/vc/merge/components/vc-merge-flow.d.ts +11 -0
- package/dist/tui/features/vc/merge/components/vc-merge-flow.js +72 -0
- package/dist/tui/features/vc/pull/api/execute-vc-pull.d.ts +8 -0
- package/dist/tui/features/vc/pull/api/execute-vc-pull.js +13 -0
- package/dist/tui/features/vc/pull/components/vc-pull-flow.d.ts +9 -0
- package/dist/tui/features/vc/pull/components/vc-pull-flow.js +83 -0
- package/dist/tui/features/vc/push/api/execute-vc-push.d.ts +8 -0
- package/dist/tui/features/vc/push/api/execute-vc-push.js +13 -0
- package/dist/tui/features/vc/push/components/vc-push-flow.d.ts +8 -0
- package/dist/tui/features/vc/push/components/vc-push-flow.js +83 -0
- package/dist/tui/features/vc/remote/api/execute-vc-remote.d.ts +8 -0
- package/dist/tui/features/vc/remote/api/execute-vc-remote.js +13 -0
- package/dist/tui/features/vc/remote/components/vc-remote-flow.d.ts +9 -0
- package/dist/tui/features/vc/remote/components/vc-remote-flow.js +42 -0
- package/dist/tui/features/vc/reset/api/execute-vc-reset.d.ts +8 -0
- package/dist/tui/features/vc/reset/api/execute-vc-reset.js +13 -0
- package/dist/tui/features/vc/reset/components/vc-reset-flow.d.ts +10 -0
- package/dist/tui/features/vc/reset/components/vc-reset-flow.js +63 -0
- package/dist/tui/features/vc/status/api/execute-vc-status.d.ts +8 -0
- package/dist/tui/features/vc/status/api/execute-vc-status.js +13 -0
- package/dist/tui/features/vc/status/components/vc-status-flow.d.ts +10 -0
- package/dist/tui/features/vc/status/components/vc-status-flow.js +133 -0
- package/dist/tui/lib/environment.d.ts +8 -0
- package/dist/tui/lib/environment.js +8 -0
- package/dist/tui/utils/error-messages.d.ts +5 -1
- package/dist/tui/utils/error-messages.js +32 -3
- package/node_modules/@campfirein/brv-transport-client/LICENSE +95 -0
- package/node_modules/@campfirein/brv-transport-client/README.md +3 -4
- package/node_modules/@campfirein/brv-transport-client/package.json +2 -2
- package/oclif.manifest.json +985 -65
- package/package.json +13 -5
- package/dist/oclif/hooks/prerun/validate-brv-config-version.d.ts +0 -33
- package/dist/oclif/hooks/prerun/validate-brv-config-version.js +0 -86
- package/dist/server/core/domain/entities/bullet.d.ts +0 -51
- package/dist/server/core/domain/entities/bullet.js +0 -94
- package/dist/server/core/domain/entities/memory.d.ts +0 -55
- package/dist/server/core/domain/entities/memory.js +0 -90
- package/dist/server/core/domain/entities/playbook.d.ts +0 -80
- package/dist/server/core/domain/entities/playbook.js +0 -214
- package/dist/server/core/domain/entities/presigned-url.d.ts +0 -9
- package/dist/server/core/domain/entities/presigned-url.js +0 -18
- package/dist/server/core/domain/entities/presigned-urls-response.d.ts +0 -10
- package/dist/server/core/domain/entities/presigned-urls-response.js +0 -18
- package/dist/server/core/domain/entities/retrieve-result.d.ts +0 -35
- package/dist/server/core/domain/entities/retrieve-result.js +0 -35
- package/dist/server/core/domain/errors/headless-prompt-error.d.ts +0 -11
- package/dist/server/core/domain/errors/headless-prompt-error.js +0 -18
- package/dist/server/core/interfaces/services/i-legacy-rule-detector.d.ts +0 -56
- package/dist/server/core/interfaces/services/i-memory-retrieval-service.d.ts +0 -39
- package/dist/server/core/interfaces/services/i-memory-storage-service.d.ts +0 -53
- package/dist/server/core/interfaces/services/i-terminal.d.ts +0 -146
- package/dist/server/core/interfaces/services/i-terminal.js +0 -1
- package/dist/server/core/interfaces/services/i-workspace-detector-service.d.ts +0 -8
- package/dist/server/core/interfaces/services/i-workspace-detector-service.js +0 -1
- package/dist/server/core/interfaces/storage/i-onboarding-preference-store.d.ts +0 -20
- package/dist/server/core/interfaces/storage/i-onboarding-preference-store.js +0 -1
- package/dist/server/infra/connectors/rules/legacy-rule-detector.d.ts +0 -21
- package/dist/server/infra/connectors/rules/legacy-rule-detector.js +0 -106
- package/dist/server/infra/memory/http-memory-retrieval-service.d.ts +0 -18
- package/dist/server/infra/memory/http-memory-retrieval-service.js +0 -64
- package/dist/server/infra/memory/http-memory-storage-service.d.ts +0 -18
- package/dist/server/infra/memory/http-memory-storage-service.js +0 -72
- package/dist/server/infra/memory/memory-to-playbook-mapper.d.ts +0 -33
- package/dist/server/infra/memory/memory-to-playbook-mapper.js +0 -51
- package/dist/server/infra/storage/file-onboarding-preference-store.d.ts +0 -10
- package/dist/server/infra/storage/file-onboarding-preference-store.js +0 -45
- package/dist/server/infra/terminal/headless-terminal.d.ts +0 -91
- package/dist/server/infra/terminal/headless-terminal.js +0 -211
- package/dist/server/infra/workspace/workspace-detector-service.d.ts +0 -57
- package/dist/server/infra/workspace/workspace-detector-service.js +0 -165
- package/dist/server/utils/crash-log.d.ts +0 -14
- package/dist/server/utils/crash-log.js +0 -19
- package/dist/server/utils/emoji-helpers.d.ts +0 -38
- package/dist/server/utils/emoji-helpers.js +0 -42
- package/dist/server/utils/error-handler.d.ts +0 -51
- package/dist/server/utils/error-handler.js +0 -169
- package/dist/server/utils/oclif-error-helpers.d.ts +0 -40
- package/dist/server/utils/oclif-error-helpers.js +0 -46
- package/dist/server/utils/tool-display-formatter.d.ts +0 -53
- package/dist/server/utils/tool-display-formatter.js +0 -257
- package/dist/tui/components/init.d.ts +0 -33
- package/dist/tui/components/init.js +0 -234
- package/dist/tui/features/space/api/get-spaces.d.ts +0 -16
- package/dist/tui/features/space/api/get-spaces.js +0 -17
- package/dist/tui/features/space/api/switch-space.d.ts +0 -11
- package/dist/tui/features/space/api/switch-space.js +0 -24
- package/dist/tui/features/space/components/space-list-view.d.ts +0 -12
- package/dist/tui/features/space/components/space-list-view.js +0 -56
- package/dist/tui/features/space/components/space-switch-flow.d.ts +0 -13
- package/dist/tui/features/space/components/space-switch-flow.js +0 -97
- /package/dist/server/core/interfaces/services/{i-legacy-rule-detector.js → i-git-service.js} +0 -0
- /package/dist/server/core/interfaces/{services/i-memory-retrieval-service.js → storage/i-review-backup-store.js} +0 -0
- /package/dist/server/core/interfaces/{services/i-memory-storage-service.js → vc/i-vc-git-config-store.js} +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Store for onboarding preferences.
|
|
3
|
-
* Used to persist when onboarding was last dismissed to implement
|
|
4
|
-
* cooldown periods (e.g., show onboarding at most once per week).
|
|
5
|
-
*/
|
|
6
|
-
export interface IOnboardingPreferenceStore {
|
|
7
|
-
/**
|
|
8
|
-
* Get the timestamp when onboarding was last dismissed.
|
|
9
|
-
* Returns undefined if never dismissed.
|
|
10
|
-
*/
|
|
11
|
-
getLastDismissedAt(): Promise<number | undefined>;
|
|
12
|
-
/**
|
|
13
|
-
* Set the timestamp when onboarding was dismissed.
|
|
14
|
-
*/
|
|
15
|
-
setLastDismissedAt(timestamp: number): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Clear the stored preference.
|
|
18
|
-
*/
|
|
19
|
-
clear(): Promise<void>;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Agent } from '../../../core/domain/entities/agent.js';
|
|
2
|
-
import type { ILegacyRuleDetector, LegacyRuleDetectionResult } from '../../../core/interfaces/services/i-legacy-rule-detector.js';
|
|
3
|
-
export declare class LegacyRuleDetector implements ILegacyRuleDetector {
|
|
4
|
-
private static readonly SECTION_SEPARATOR_PATTERN;
|
|
5
|
-
private static readonly WORKFLOW_HEADER_PATTERN;
|
|
6
|
-
detectLegacyRules(content: string, agentName: Agent): LegacyRuleDetectionResult;
|
|
7
|
-
/**
|
|
8
|
-
* Attempts to find the start of a ByteRover rule section by working backwards from the footer.
|
|
9
|
-
*
|
|
10
|
-
* Strategy 3 (Conservative Multi-Pattern Match):
|
|
11
|
-
* 1. Look backwards for "# Workflow Instruction" header (most reliable)
|
|
12
|
-
* 2. If not found, look backwards for "---" separator before command reference
|
|
13
|
-
* 3. If still not found, return undefined (uncertain)
|
|
14
|
-
*
|
|
15
|
-
* @param lines All lines in the file.
|
|
16
|
-
* @param footerIndex Index of the line containing the footer tag (0-indexed).
|
|
17
|
-
* @param usedLineRanges Line ranges already claimed by detected sections.
|
|
18
|
-
* @returns Index of the start line (0-indexed), or undefined if uncertain.
|
|
19
|
-
*/
|
|
20
|
-
private findSectionStart;
|
|
21
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { BRV_RULE_TAG } from '../shared/constants.js';
|
|
2
|
-
export class LegacyRuleDetector {
|
|
3
|
-
static SECTION_SEPARATOR_PATTERN = /^---\s*$/;
|
|
4
|
-
static WORKFLOW_HEADER_PATTERN = /^#\sWorkflow Instruction$/;
|
|
5
|
-
detectLegacyRules(content, agentName) {
|
|
6
|
-
// Normalize line endings to handle CRLF
|
|
7
|
-
const normalizedContent = content.replaceAll('\r\n', '\n').replaceAll('\r', '\n');
|
|
8
|
-
const lines = normalizedContent.split('\n');
|
|
9
|
-
const footerTag = `${BRV_RULE_TAG} ${agentName}`;
|
|
10
|
-
const reliableMatches = [];
|
|
11
|
-
const uncertainMatches = [];
|
|
12
|
-
const usedLineRanges = [];
|
|
13
|
-
// Find all occurrences of the footer tag
|
|
14
|
-
for (const [index, line] of lines.entries()) {
|
|
15
|
-
// Use exact match to avoid matching partial agent names like "Github Copilot Extended"
|
|
16
|
-
if (line.trim() === footerTag) {
|
|
17
|
-
const footerIndex = index;
|
|
18
|
-
const footerLineNumber = footerIndex + 1;
|
|
19
|
-
// Try to find the start of this ByteRover section
|
|
20
|
-
const startIndex = this.findSectionStart(lines, footerIndex, usedLineRanges);
|
|
21
|
-
if (startIndex === undefined) {
|
|
22
|
-
// Uncertain match - couldn't reliably determine start
|
|
23
|
-
uncertainMatches.push({
|
|
24
|
-
footerLine: footerLineNumber,
|
|
25
|
-
reason: 'Could not reliably determine the start of the ByteRover rule section.',
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
// Reliable match found
|
|
30
|
-
const startLineNumber = startIndex + 1;
|
|
31
|
-
const sectionContent = lines.slice(startIndex, footerIndex + 1).join('\n');
|
|
32
|
-
reliableMatches.push({
|
|
33
|
-
content: sectionContent,
|
|
34
|
-
endLine: footerLineNumber,
|
|
35
|
-
startLine: startLineNumber,
|
|
36
|
-
});
|
|
37
|
-
// Mark this range as used so it won't be reused by subsequent footers
|
|
38
|
-
usedLineRanges.push({ end: footerIndex, start: startIndex });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return { reliableMatches, uncertainMatches };
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Attempts to find the start of a ByteRover rule section by working backwards from the footer.
|
|
46
|
-
*
|
|
47
|
-
* Strategy 3 (Conservative Multi-Pattern Match):
|
|
48
|
-
* 1. Look backwards for "# Workflow Instruction" header (most reliable)
|
|
49
|
-
* 2. If not found, look backwards for "---" separator before command reference
|
|
50
|
-
* 3. If still not found, return undefined (uncertain)
|
|
51
|
-
*
|
|
52
|
-
* @param lines All lines in the file.
|
|
53
|
-
* @param footerIndex Index of the line containing the footer tag (0-indexed).
|
|
54
|
-
* @param usedLineRanges Line ranges already claimed by detected sections.
|
|
55
|
-
* @returns Index of the start line (0-indexed), or undefined if uncertain.
|
|
56
|
-
*/
|
|
57
|
-
findSectionStart(lines, footerIndex, usedLineRanges) {
|
|
58
|
-
// Strategy 1: Look for "# Workflow Instruction" header (most reliable)
|
|
59
|
-
for (let i = footerIndex - 1; i >= 0; i--) {
|
|
60
|
-
if (LegacyRuleDetector.WORKFLOW_HEADER_PATTERN.test(lines[i])) {
|
|
61
|
-
// Check if this header is within any already-detected section
|
|
62
|
-
const isWithinUsedRange = usedLineRanges.some((range) => i >= range.start && i <= range.end);
|
|
63
|
-
if (!isWithinUsedRange) {
|
|
64
|
-
return i;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
// Strategy 2: Look for "---" separator
|
|
69
|
-
// We need to find the section separator that appears before the command reference
|
|
70
|
-
// and after the workflow content. This is less reliable but still useful.
|
|
71
|
-
const separatorIndices = [];
|
|
72
|
-
for (let i = footerIndex - 1; i >= 0; i--) {
|
|
73
|
-
if (LegacyRuleDetector.SECTION_SEPARATOR_PATTERN.test(lines[i])) {
|
|
74
|
-
separatorIndices.push(i);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// If we found at least one separator, use it as a fallback
|
|
78
|
-
// We want the one closest to the footer but before the "---" that precedes the footer
|
|
79
|
-
if (separatorIndices.length > 0) {
|
|
80
|
-
// The footer line should be preceded by "---", so we skip that one
|
|
81
|
-
// and look for the next separator going backwards
|
|
82
|
-
let candidateIndex;
|
|
83
|
-
for (const sepIndex of separatorIndices) {
|
|
84
|
-
const linesBetween = footerIndex - sepIndex;
|
|
85
|
-
if (linesBetween === 1) {
|
|
86
|
-
// This is the separator right before the footer, skip it
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
// Check if this separator is within any already-detected section
|
|
90
|
-
const isWithinUsedRange = usedLineRanges.some((range) => sepIndex >= range.start && sepIndex <= range.end);
|
|
91
|
-
if (isWithinUsedRange) {
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
// This could be a section separator within the ByteRover content
|
|
95
|
-
// Use the first one we find (closest to footer)
|
|
96
|
-
candidateIndex = sepIndex + 1;
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
if (candidateIndex !== undefined && candidateIndex < footerIndex) {
|
|
100
|
-
return candidateIndex;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
// Strategy 3: Could not reliably determine start
|
|
104
|
-
return undefined;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { IMemoryRetrievalService, RetrieveParams } from '../../core/interfaces/services/i-memory-retrieval-service.js';
|
|
2
|
-
import { RetrieveResult } from '../../core/domain/entities/retrieve-result.js';
|
|
3
|
-
export type MemoryRetrievalServiceConfig = {
|
|
4
|
-
apiBaseUrl: string;
|
|
5
|
-
timeout?: number;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* HTTP implementation of IMemoryRetrievalService for ByteRover Memora service.
|
|
9
|
-
* Handles retrieval of memories based on search queries.
|
|
10
|
-
*/
|
|
11
|
-
export declare class HttpMemoryRetrievalService implements IMemoryRetrievalService {
|
|
12
|
-
private readonly config;
|
|
13
|
-
constructor(config: MemoryRetrievalServiceConfig);
|
|
14
|
-
retrieve(params: RetrieveParams): Promise<RetrieveResult>;
|
|
15
|
-
private buildQueryParams;
|
|
16
|
-
private mapToMemory;
|
|
17
|
-
private mapToRetrieveResult;
|
|
18
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Memory } from '../../core/domain/entities/memory.js';
|
|
2
|
-
import { RetrieveResult } from '../../core/domain/entities/retrieve-result.js';
|
|
3
|
-
import { getErrorMessage } from '../../utils/error-helpers.js';
|
|
4
|
-
import { AuthenticatedHttpClient } from '../http/authenticated-http-client.js';
|
|
5
|
-
/**
|
|
6
|
-
* HTTP implementation of IMemoryRetrievalService for ByteRover Memora service.
|
|
7
|
-
* Handles retrieval of memories based on search queries.
|
|
8
|
-
*/
|
|
9
|
-
export class HttpMemoryRetrievalService {
|
|
10
|
-
config;
|
|
11
|
-
constructor(config) {
|
|
12
|
-
this.config = {
|
|
13
|
-
...config,
|
|
14
|
-
timeout: config.timeout ?? 30_000, // Default 30 seconds timeout (memory retrieval may be slower)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
async retrieve(params) {
|
|
18
|
-
try {
|
|
19
|
-
const httpClient = new AuthenticatedHttpClient(params.sessionKey);
|
|
20
|
-
// Build query parameters
|
|
21
|
-
const queryParams = this.buildQueryParams(params);
|
|
22
|
-
const response = await httpClient.get(`${this.config.apiBaseUrl}/retrieve?${queryParams}`, {
|
|
23
|
-
timeout: this.config.timeout,
|
|
24
|
-
});
|
|
25
|
-
return this.mapToRetrieveResult(response);
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
throw new Error(`Failed to retrieve memories: ${getErrorMessage(error)}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
buildQueryParams(params) {
|
|
32
|
-
const queryParams = new URLSearchParams({
|
|
33
|
-
project_id: params.spaceId,
|
|
34
|
-
query: params.query,
|
|
35
|
-
});
|
|
36
|
-
// Add node_keys only if provided
|
|
37
|
-
if (params.nodeKeys !== undefined && params.nodeKeys.length > 0) {
|
|
38
|
-
queryParams.set('node_keys', params.nodeKeys.join(','));
|
|
39
|
-
}
|
|
40
|
-
return queryParams.toString();
|
|
41
|
-
}
|
|
42
|
-
mapToMemory(apiMemory) {
|
|
43
|
-
return new Memory({
|
|
44
|
-
bulletId: apiMemory.bullet_id,
|
|
45
|
-
childrenIds: apiMemory.children_ids,
|
|
46
|
-
content: apiMemory.content,
|
|
47
|
-
id: apiMemory.id,
|
|
48
|
-
metadataType: apiMemory.metadata_type,
|
|
49
|
-
nodeKeys: apiMemory.node_keys,
|
|
50
|
-
parentIds: apiMemory.parent_ids,
|
|
51
|
-
score: apiMemory.score,
|
|
52
|
-
section: apiMemory.section,
|
|
53
|
-
tags: apiMemory.tags,
|
|
54
|
-
timestamp: apiMemory.timestamp,
|
|
55
|
-
title: apiMemory.title,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
mapToRetrieveResult(response) {
|
|
59
|
-
return new RetrieveResult({
|
|
60
|
-
memories: response.memories.map((m) => this.mapToMemory(m)),
|
|
61
|
-
relatedMemories: response.related_memories.map((m) => this.mapToMemory(m)),
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ConfirmUploadParams, GetPresignedUrlsParams, IMemoryStorageService } from '../../core/interfaces/services/i-memory-storage-service.js';
|
|
2
|
-
import { PresignedUrlsResponse } from '../../core/domain/entities/presigned-urls-response.js';
|
|
3
|
-
export type MemoryStorageServiceConfig = {
|
|
4
|
-
apiBaseUrl: string;
|
|
5
|
-
timeout?: number;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* HTTP implementation of IMemoryStorageService for ByteRover CoGit service.
|
|
9
|
-
* Handles uploading playbooks to blob storage.
|
|
10
|
-
*/
|
|
11
|
-
export declare class HttpMemoryStorageService implements IMemoryStorageService {
|
|
12
|
-
private readonly config;
|
|
13
|
-
constructor(config: MemoryStorageServiceConfig);
|
|
14
|
-
confirmUpload(params: ConfirmUploadParams): Promise<void>;
|
|
15
|
-
getPresignedUrls(params: GetPresignedUrlsParams): Promise<PresignedUrlsResponse>;
|
|
16
|
-
uploadFile(uploadUrl: string, content: string): Promise<void>;
|
|
17
|
-
private mapToPresignedUrls;
|
|
18
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/* eslint-disable camelcase */
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
import { PresignedUrl } from '../../core/domain/entities/presigned-url.js';
|
|
4
|
-
import { PresignedUrlsResponse } from '../../core/domain/entities/presigned-urls-response.js';
|
|
5
|
-
import { getErrorMessage } from '../../utils/error-helpers.js';
|
|
6
|
-
import { AuthenticatedHttpClient } from '../http/authenticated-http-client.js';
|
|
7
|
-
import { ProxyConfig } from '../http/proxy-config.js';
|
|
8
|
-
/**
|
|
9
|
-
* HTTP implementation of IMemoryStorageService for ByteRover CoGit service.
|
|
10
|
-
* Handles uploading playbooks to blob storage.
|
|
11
|
-
*/
|
|
12
|
-
export class HttpMemoryStorageService {
|
|
13
|
-
config;
|
|
14
|
-
constructor(config) {
|
|
15
|
-
this.config = {
|
|
16
|
-
...config,
|
|
17
|
-
timeout: config.timeout ?? 30_000, // Default 30 seconds timeout
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
async confirmUpload(params) {
|
|
21
|
-
try {
|
|
22
|
-
const httpClient = new AuthenticatedHttpClient(params.sessionKey);
|
|
23
|
-
const url = `${this.config.apiBaseUrl}/organizations/${params.teamId}/projects/${params.spaceId}/memory-processing/confirm-upload`;
|
|
24
|
-
const requestBody = {
|
|
25
|
-
request_id: params.requestId,
|
|
26
|
-
};
|
|
27
|
-
await httpClient.post(url, requestBody, {
|
|
28
|
-
timeout: this.config.timeout,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
throw new Error(`Failed to confirm upload: ${getErrorMessage(error)}`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
async getPresignedUrls(params) {
|
|
36
|
-
try {
|
|
37
|
-
const httpClient = new AuthenticatedHttpClient(params.sessionKey);
|
|
38
|
-
const url = `${this.config.apiBaseUrl}/organizations/${params.teamId}/projects/${params.spaceId}/memory-processing/presigned-urls`;
|
|
39
|
-
const requestBody = {
|
|
40
|
-
branch: params.branch,
|
|
41
|
-
file_names: params.fileNames,
|
|
42
|
-
};
|
|
43
|
-
const response = await httpClient.post(url, requestBody, {
|
|
44
|
-
timeout: this.config.timeout,
|
|
45
|
-
});
|
|
46
|
-
const presignedUrls = response.data.presigned_urls.map((presignedUrlData) => this.mapToPresignedUrls(presignedUrlData));
|
|
47
|
-
return new PresignedUrlsResponse(presignedUrls, response.data.request_id);
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
throw new Error(`Failed to get presigned URLs: ${getErrorMessage(error)}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
async uploadFile(uploadUrl, content) {
|
|
54
|
-
try {
|
|
55
|
-
await axios.put(uploadUrl, content, {
|
|
56
|
-
headers: {
|
|
57
|
-
'Content-Type': 'application/json',
|
|
58
|
-
},
|
|
59
|
-
httpAgent: ProxyConfig.getProxyAgent(),
|
|
60
|
-
httpsAgent: ProxyConfig.getProxyAgent(),
|
|
61
|
-
proxy: false,
|
|
62
|
-
timeout: this.config.timeout,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
throw new Error(`Failed to upload file: ${getErrorMessage(error)}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
mapToPresignedUrls(presignedUrlData) {
|
|
70
|
-
return new PresignedUrl(presignedUrlData.file_name, presignedUrlData.presigned_url);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Memory } from '../../core/domain/entities/memory.js';
|
|
2
|
-
import type { RetrieveResult } from '../../core/domain/entities/retrieve-result.js';
|
|
3
|
-
import { Bullet } from '../../core/domain/entities/bullet.js';
|
|
4
|
-
import { Playbook } from '../../core/domain/entities/playbook.js';
|
|
5
|
-
/**
|
|
6
|
-
* Transforms a Memory entity into a Bullet entity for playbook storage.
|
|
7
|
-
*
|
|
8
|
-
* Mapping:
|
|
9
|
-
* - memory.bulletId -> bullet.id
|
|
10
|
-
* - memory.section -> bullet.section
|
|
11
|
-
* - memory.content -> bullet.content
|
|
12
|
-
* - memory.tags -> bullet.metadata.tags
|
|
13
|
-
* - memory.nodeKeys -> bullet.metadata.relatedFiles
|
|
14
|
-
* - memory.timestamp -> bullet.metadata.timestamp
|
|
15
|
-
* - memory.id -> bullet.memoryId
|
|
16
|
-
*
|
|
17
|
-
* @param memory The Memory entity to transform
|
|
18
|
-
* @returns A Bullet entity
|
|
19
|
-
*/
|
|
20
|
-
export declare const transformMemoryToBullet: (memory: Memory) => Bullet;
|
|
21
|
-
/**
|
|
22
|
-
* Transforms a RetrieveResult into a Playbook.
|
|
23
|
-
*
|
|
24
|
-
* This function:
|
|
25
|
-
* 1. Combines both memories and relatedMemories from the result
|
|
26
|
-
* 2. Transforms each Memory into a Bullet
|
|
27
|
-
* 3. Organizes bullets by section
|
|
28
|
-
* 4. Creates a new Playbook with nextId set to 1 (reset value)
|
|
29
|
-
*
|
|
30
|
-
* @param result The RetrieveResult containing memories from Memora service
|
|
31
|
-
* @returns A Playbook containing all retrieved memories as bullets
|
|
32
|
-
*/
|
|
33
|
-
export declare const transformRetrieveResultToPlaybook: (result: RetrieveResult) => Playbook;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Bullet } from '../../core/domain/entities/bullet.js';
|
|
2
|
-
import { Playbook } from '../../core/domain/entities/playbook.js';
|
|
3
|
-
/**
|
|
4
|
-
* Transforms a Memory entity into a Bullet entity for playbook storage.
|
|
5
|
-
*
|
|
6
|
-
* Mapping:
|
|
7
|
-
* - memory.bulletId -> bullet.id
|
|
8
|
-
* - memory.section -> bullet.section
|
|
9
|
-
* - memory.content -> bullet.content
|
|
10
|
-
* - memory.tags -> bullet.metadata.tags
|
|
11
|
-
* - memory.nodeKeys -> bullet.metadata.relatedFiles
|
|
12
|
-
* - memory.timestamp -> bullet.metadata.timestamp
|
|
13
|
-
* - memory.id -> bullet.memoryId
|
|
14
|
-
*
|
|
15
|
-
* @param memory The Memory entity to transform
|
|
16
|
-
* @returns A Bullet entity
|
|
17
|
-
*/
|
|
18
|
-
export const transformMemoryToBullet = (memory) => {
|
|
19
|
-
const metadata = {
|
|
20
|
-
relatedFiles: [...memory.nodeKeys],
|
|
21
|
-
tags: [...memory.tags],
|
|
22
|
-
timestamp: memory.timestamp,
|
|
23
|
-
};
|
|
24
|
-
return new Bullet(memory.bulletId, memory.section, memory.content, metadata, memory.id);
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Transforms a RetrieveResult into a Playbook.
|
|
28
|
-
*
|
|
29
|
-
* This function:
|
|
30
|
-
* 1. Combines both memories and relatedMemories from the result
|
|
31
|
-
* 2. Transforms each Memory into a Bullet
|
|
32
|
-
* 3. Organizes bullets by section
|
|
33
|
-
* 4. Creates a new Playbook with nextId set to 1 (reset value)
|
|
34
|
-
*
|
|
35
|
-
* @param result The RetrieveResult containing memories from Memora service
|
|
36
|
-
* @returns A Playbook containing all retrieved memories as bullets
|
|
37
|
-
*/
|
|
38
|
-
export const transformRetrieveResultToPlaybook = (result) => {
|
|
39
|
-
const bulletsMap = new Map();
|
|
40
|
-
const sectionsMap = new Map();
|
|
41
|
-
const allMemories = [...result.memories, ...result.relatedMemories];
|
|
42
|
-
for (const memory of allMemories) {
|
|
43
|
-
const bullet = transformMemoryToBullet(memory);
|
|
44
|
-
bulletsMap.set(bullet.id, bullet);
|
|
45
|
-
if (!sectionsMap.has(bullet.section)) {
|
|
46
|
-
sectionsMap.set(bullet.section, []);
|
|
47
|
-
}
|
|
48
|
-
sectionsMap.get(bullet.section).push(bullet.id);
|
|
49
|
-
}
|
|
50
|
-
return new Playbook(bulletsMap, sectionsMap, bulletsMap.size + 1);
|
|
51
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { IOnboardingPreferenceStore } from '../../core/interfaces/storage/i-onboarding-preference-store.js';
|
|
2
|
-
/**
|
|
3
|
-
* Onboarding preference store implementation using a lock file.
|
|
4
|
-
* Stores last dismissed timestamp in XDG data directory.
|
|
5
|
-
*/
|
|
6
|
-
export declare class FileOnboardingPreferenceStore implements IOnboardingPreferenceStore {
|
|
7
|
-
clear(): Promise<void>;
|
|
8
|
-
getLastDismissedAt(): Promise<number | undefined>;
|
|
9
|
-
setLastDismissedAt(timestamp: number): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
3
|
-
import { getGlobalDataDir } from '../../utils/global-data-path.js';
|
|
4
|
-
const ONBOARDING_LOCK_FILE = join(getGlobalDataDir(), '.onboarding-dismissed');
|
|
5
|
-
/**
|
|
6
|
-
* Onboarding preference store implementation using a lock file.
|
|
7
|
-
* Stores last dismissed timestamp in XDG data directory.
|
|
8
|
-
*/
|
|
9
|
-
export class FileOnboardingPreferenceStore {
|
|
10
|
-
async clear() {
|
|
11
|
-
try {
|
|
12
|
-
if (existsSync(ONBOARDING_LOCK_FILE)) {
|
|
13
|
-
rmSync(ONBOARDING_LOCK_FILE);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
// Ignore errors
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
async getLastDismissedAt() {
|
|
21
|
-
try {
|
|
22
|
-
if (!existsSync(ONBOARDING_LOCK_FILE)) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
const content = readFileSync(ONBOARDING_LOCK_FILE, 'utf8').trim();
|
|
26
|
-
const timestamp = Number.parseInt(content, 10);
|
|
27
|
-
return Number.isNaN(timestamp) ? undefined : timestamp;
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
async setLastDismissedAt(timestamp) {
|
|
34
|
-
try {
|
|
35
|
-
const parentDir = dirname(ONBOARDING_LOCK_FILE);
|
|
36
|
-
if (!existsSync(parentDir)) {
|
|
37
|
-
mkdirSync(parentDir, { recursive: true });
|
|
38
|
-
}
|
|
39
|
-
writeFileSync(ONBOARDING_LOCK_FILE, String(timestamp), 'utf8');
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
// Silently ignore errors - onboarding preference is non-critical
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { ConfirmOptions, FileSelectorItem, FileSelectorOptions, InputOptions, ITerminal, SearchOptions, SelectOptions } from '../../core/interfaces/services/i-terminal.js';
|
|
2
|
-
/**
|
|
3
|
-
* Output format for headless terminal.
|
|
4
|
-
* - 'text': Human-readable text output
|
|
5
|
-
* - 'json': NDJSON (newline-delimited JSON) for machine parsing
|
|
6
|
-
*/
|
|
7
|
-
export type HeadlessOutputFormat = 'json' | 'text';
|
|
8
|
-
/**
|
|
9
|
-
* JSON message types for structured output.
|
|
10
|
-
*/
|
|
11
|
-
export type HeadlessMessageType = 'action_start' | 'action_stop' | 'error' | 'log' | 'result' | 'warning';
|
|
12
|
-
/**
|
|
13
|
-
* Structured JSON output message.
|
|
14
|
-
*/
|
|
15
|
-
export interface HeadlessJsonMessage {
|
|
16
|
-
actionId?: string;
|
|
17
|
-
id: string;
|
|
18
|
-
message: string;
|
|
19
|
-
timestamp: string;
|
|
20
|
-
type: HeadlessMessageType;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Options for creating a HeadlessTerminal.
|
|
24
|
-
*/
|
|
25
|
-
export interface HeadlessTerminalOptions {
|
|
26
|
-
/**
|
|
27
|
-
* Stream for errors (defaults to process.stderr).
|
|
28
|
-
*/
|
|
29
|
-
errorStream?: NodeJS.WritableStream;
|
|
30
|
-
/**
|
|
31
|
-
* If true, throw HeadlessPromptError when a prompt cannot be answered.
|
|
32
|
-
* If false, use sensible defaults (first choice, false for confirm, etc.)
|
|
33
|
-
* @default true
|
|
34
|
-
*/
|
|
35
|
-
failOnPrompt?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Output format: 'text' for human readable, 'json' for machine parsing.
|
|
38
|
-
* @default 'text'
|
|
39
|
-
*/
|
|
40
|
-
outputFormat?: HeadlessOutputFormat;
|
|
41
|
-
/**
|
|
42
|
-
* Stream for output (defaults to process.stdout).
|
|
43
|
-
*/
|
|
44
|
-
outputStream?: NodeJS.WritableStream;
|
|
45
|
-
/**
|
|
46
|
-
* Default values for prompts, keyed by prompt message or prompt type.
|
|
47
|
-
* Used to answer prompts automatically in headless mode.
|
|
48
|
-
*/
|
|
49
|
-
promptDefaults?: Record<string, unknown>;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Terminal implementation for headless/non-interactive mode.
|
|
53
|
-
* Outputs to stdout/stderr and handles prompts via defaults or fails gracefully.
|
|
54
|
-
*/
|
|
55
|
-
export declare class HeadlessTerminal implements ITerminal {
|
|
56
|
-
private currentActionId;
|
|
57
|
-
private readonly errorOutput;
|
|
58
|
-
private readonly failOnPrompt;
|
|
59
|
-
private readonly output;
|
|
60
|
-
private readonly outputFormat;
|
|
61
|
-
private readonly promptDefaults;
|
|
62
|
-
constructor(options?: HeadlessTerminalOptions);
|
|
63
|
-
actionStart(message: string): void;
|
|
64
|
-
actionStop(message?: string): void;
|
|
65
|
-
confirm(options: ConfirmOptions): Promise<boolean>;
|
|
66
|
-
error(message: string): void;
|
|
67
|
-
fileSelector(options: FileSelectorOptions): Promise<FileSelectorItem | null>;
|
|
68
|
-
input(options: InputOptions): Promise<string>;
|
|
69
|
-
log(message?: string): void;
|
|
70
|
-
search<T>(options: SearchOptions<T>): Promise<T>;
|
|
71
|
-
select<T>(options: SelectOptions<T>): Promise<T>;
|
|
72
|
-
warn(message: string): void;
|
|
73
|
-
/**
|
|
74
|
-
* Write final response with success/error status.
|
|
75
|
-
*/
|
|
76
|
-
writeFinalResponse(response: {
|
|
77
|
-
command: string;
|
|
78
|
-
data?: unknown;
|
|
79
|
-
error?: {
|
|
80
|
-
code: string;
|
|
81
|
-
message: string;
|
|
82
|
-
};
|
|
83
|
-
success: boolean;
|
|
84
|
-
}): void;
|
|
85
|
-
/**
|
|
86
|
-
* Write final result in JSON format (convenience method for commands).
|
|
87
|
-
*/
|
|
88
|
-
writeResult(data: Record<string, unknown>): void;
|
|
89
|
-
private getDefault;
|
|
90
|
-
private writeJson;
|
|
91
|
-
}
|