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,211 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { HeadlessPromptError } from '../../core/domain/errors/headless-prompt-error.js';
|
|
3
|
-
/**
|
|
4
|
-
* Terminal implementation for headless/non-interactive mode.
|
|
5
|
-
* Outputs to stdout/stderr and handles prompts via defaults or fails gracefully.
|
|
6
|
-
*/
|
|
7
|
-
export class HeadlessTerminal {
|
|
8
|
-
currentActionId = null;
|
|
9
|
-
errorOutput;
|
|
10
|
-
failOnPrompt;
|
|
11
|
-
output;
|
|
12
|
-
outputFormat;
|
|
13
|
-
promptDefaults;
|
|
14
|
-
constructor(options = {}) {
|
|
15
|
-
this.outputFormat = options.outputFormat ?? 'text';
|
|
16
|
-
this.promptDefaults = options.promptDefaults ?? {};
|
|
17
|
-
this.failOnPrompt = options.failOnPrompt ?? true;
|
|
18
|
-
this.output = options.outputStream ?? process.stdout;
|
|
19
|
-
this.errorOutput = options.errorStream ?? process.stderr;
|
|
20
|
-
}
|
|
21
|
-
// ==================== Output Methods ====================
|
|
22
|
-
actionStart(message) {
|
|
23
|
-
this.currentActionId = randomUUID();
|
|
24
|
-
if (this.outputFormat === 'json') {
|
|
25
|
-
this.writeJson({
|
|
26
|
-
actionId: this.currentActionId,
|
|
27
|
-
id: randomUUID(),
|
|
28
|
-
message,
|
|
29
|
-
timestamp: new Date().toISOString(),
|
|
30
|
-
type: 'action_start',
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
// In text mode, suppress action start for cleaner output
|
|
34
|
-
}
|
|
35
|
-
actionStop(message) {
|
|
36
|
-
if (this.outputFormat === 'json' && this.currentActionId) {
|
|
37
|
-
this.writeJson({
|
|
38
|
-
actionId: this.currentActionId,
|
|
39
|
-
id: randomUUID(),
|
|
40
|
-
message: message ?? '',
|
|
41
|
-
timestamp: new Date().toISOString(),
|
|
42
|
-
type: 'action_stop',
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
this.currentActionId = null;
|
|
46
|
-
}
|
|
47
|
-
async confirm(options) {
|
|
48
|
-
// Check for explicit default in promptDefaults
|
|
49
|
-
const defaultValue = this.getDefault('confirm', options.message);
|
|
50
|
-
if (defaultValue !== undefined) {
|
|
51
|
-
return Boolean(defaultValue);
|
|
52
|
-
}
|
|
53
|
-
// Use options.default if provided
|
|
54
|
-
if (options.default !== undefined) {
|
|
55
|
-
return options.default;
|
|
56
|
-
}
|
|
57
|
-
// Fail or return false
|
|
58
|
-
if (this.failOnPrompt) {
|
|
59
|
-
throw new HeadlessPromptError('confirm', options.message);
|
|
60
|
-
}
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
error(message) {
|
|
64
|
-
if (this.outputFormat === 'json') {
|
|
65
|
-
this.writeJson({
|
|
66
|
-
id: randomUUID(),
|
|
67
|
-
message,
|
|
68
|
-
timestamp: new Date().toISOString(),
|
|
69
|
-
type: 'error',
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
this.errorOutput.write(`Error: ${message}\n`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
async fileSelector(options) {
|
|
77
|
-
// Check for explicit default in promptDefaults
|
|
78
|
-
const defaultValue = this.getDefault('file_selector', options.message);
|
|
79
|
-
if (defaultValue !== undefined && typeof defaultValue === 'string') {
|
|
80
|
-
return {
|
|
81
|
-
isDirectory: options.type === 'directory',
|
|
82
|
-
name: defaultValue.split('/').pop() ?? defaultValue,
|
|
83
|
-
path: defaultValue,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
// Allow cancel if specified
|
|
87
|
-
if (options.allowCancel) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
// Fail
|
|
91
|
-
if (this.failOnPrompt) {
|
|
92
|
-
throw new HeadlessPromptError('file_selector', options.message);
|
|
93
|
-
}
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
// ==================== Input Methods ====================
|
|
97
|
-
async input(options) {
|
|
98
|
-
// Check for explicit default in promptDefaults
|
|
99
|
-
const defaultValue = this.getDefault('input', options.message);
|
|
100
|
-
if (defaultValue !== undefined) {
|
|
101
|
-
const value = String(defaultValue);
|
|
102
|
-
// Validate if validator is provided
|
|
103
|
-
if (options.validate) {
|
|
104
|
-
const validationResult = options.validate(value);
|
|
105
|
-
if (validationResult !== true) {
|
|
106
|
-
const errorMsg = typeof validationResult === 'string' ? validationResult : 'Validation failed';
|
|
107
|
-
throw new HeadlessPromptError('input', `${options.message} (validation error: ${errorMsg})`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return value;
|
|
111
|
-
}
|
|
112
|
-
// Fail
|
|
113
|
-
if (this.failOnPrompt) {
|
|
114
|
-
throw new HeadlessPromptError('input', options.message);
|
|
115
|
-
}
|
|
116
|
-
return '';
|
|
117
|
-
}
|
|
118
|
-
log(message) {
|
|
119
|
-
if (this.outputFormat === 'json') {
|
|
120
|
-
this.writeJson({
|
|
121
|
-
id: randomUUID(),
|
|
122
|
-
message: message ?? '',
|
|
123
|
-
timestamp: new Date().toISOString(),
|
|
124
|
-
type: 'log',
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
this.output.write((message ?? '') + '\n');
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
async search(options) {
|
|
132
|
-
// Search prompts require user interaction - always fail in headless mode
|
|
133
|
-
// unless a default is explicitly provided
|
|
134
|
-
const defaultValue = this.getDefault('search', options.message);
|
|
135
|
-
if (defaultValue !== undefined) {
|
|
136
|
-
return defaultValue;
|
|
137
|
-
}
|
|
138
|
-
throw new HeadlessPromptError('search', options.message);
|
|
139
|
-
}
|
|
140
|
-
async select(options) {
|
|
141
|
-
// Check for explicit default in promptDefaults (by value or name)
|
|
142
|
-
const defaultValue = this.getDefault('select', options.message);
|
|
143
|
-
if (defaultValue !== undefined) {
|
|
144
|
-
const choice = options.choices.find((c) => c.value === defaultValue || c.name === defaultValue);
|
|
145
|
-
if (choice) {
|
|
146
|
-
return choice.value;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
// Fail or return first choice
|
|
150
|
-
if (this.failOnPrompt) {
|
|
151
|
-
throw new HeadlessPromptError('select', options.message, options.choices.map((c) => c.name));
|
|
152
|
-
}
|
|
153
|
-
// Return first choice as fallback
|
|
154
|
-
if (options.choices.length > 0) {
|
|
155
|
-
return options.choices[0].value;
|
|
156
|
-
}
|
|
157
|
-
throw new HeadlessPromptError('select', options.message, []);
|
|
158
|
-
}
|
|
159
|
-
warn(message) {
|
|
160
|
-
if (this.outputFormat === 'json') {
|
|
161
|
-
this.writeJson({
|
|
162
|
-
id: randomUUID(),
|
|
163
|
-
message,
|
|
164
|
-
timestamp: new Date().toISOString(),
|
|
165
|
-
type: 'warning',
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
this.errorOutput.write(`Warning: ${message}\n`);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
// ==================== Helper Methods ====================
|
|
173
|
-
/**
|
|
174
|
-
* Write final response with success/error status.
|
|
175
|
-
*/
|
|
176
|
-
writeFinalResponse(response) {
|
|
177
|
-
if (this.outputFormat === 'json') {
|
|
178
|
-
this.output.write(JSON.stringify({
|
|
179
|
-
...response,
|
|
180
|
-
timestamp: new Date().toISOString(),
|
|
181
|
-
}) + '\n');
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Write final result in JSON format (convenience method for commands).
|
|
186
|
-
*/
|
|
187
|
-
writeResult(data) {
|
|
188
|
-
if (this.outputFormat === 'json') {
|
|
189
|
-
this.writeJson({
|
|
190
|
-
id: randomUUID(),
|
|
191
|
-
message: JSON.stringify(data),
|
|
192
|
-
timestamp: new Date().toISOString(),
|
|
193
|
-
type: 'result',
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
getDefault(promptType, promptMessage) {
|
|
198
|
-
// First check by exact message
|
|
199
|
-
if (this.promptDefaults[promptMessage] !== undefined) {
|
|
200
|
-
return this.promptDefaults[promptMessage];
|
|
201
|
-
}
|
|
202
|
-
// Then check by prompt type
|
|
203
|
-
if (this.promptDefaults[promptType] !== undefined) {
|
|
204
|
-
return this.promptDefaults[promptType];
|
|
205
|
-
}
|
|
206
|
-
return undefined;
|
|
207
|
-
}
|
|
208
|
-
writeJson(data) {
|
|
209
|
-
this.output.write(JSON.stringify(data) + '\n');
|
|
210
|
-
}
|
|
211
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Agent } from '../../core/domain/entities/agent.js';
|
|
2
|
-
import type { IWorkspaceDetectorService, WorkspaceInfo } from '../../core/interfaces/services/i-workspace-detector-service.js';
|
|
3
|
-
/**
|
|
4
|
-
* Service to detect IDE workspaces that contain the current working directory
|
|
5
|
-
* Supports: VS Code (Github Copilot), Cursor, Claude, and Codex
|
|
6
|
-
*/
|
|
7
|
-
export declare class WorkspaceDetectorService implements IWorkspaceDetectorService {
|
|
8
|
-
private readonly claudeUserPath;
|
|
9
|
-
private readonly codexUserPath;
|
|
10
|
-
private readonly cursorUserPath;
|
|
11
|
-
private readonly cwd;
|
|
12
|
-
private readonly vscodeUserPath;
|
|
13
|
-
constructor(cwd?: string);
|
|
14
|
-
/**
|
|
15
|
-
* Detect workspaces for the given IDE
|
|
16
|
-
*
|
|
17
|
-
* Supports: Github Copilot (VSCode), Cursor, Claude Code, Codex
|
|
18
|
-
*
|
|
19
|
-
* chatLogPath:
|
|
20
|
-
* - For Cursor/VSCode: Path to workspace storage folder if workspace.json matches cwd
|
|
21
|
-
* - For Claude Code: Path to claude project folder matching cwd (with special naming pattern)
|
|
22
|
-
* - For Codex: Direct path to codex sessions folder
|
|
23
|
-
*/
|
|
24
|
-
detectWorkspaces(agent: Agent): WorkspaceInfo;
|
|
25
|
-
/**
|
|
26
|
-
* Convert current working directory to Claude Code folder name format
|
|
27
|
-
* Example: /Users/datpham/dpmemories/byterover-cli -> -Users-datpham-dpmemories-byterover-cli
|
|
28
|
-
*/
|
|
29
|
-
private cwdToClaudeFolderName;
|
|
30
|
-
/**
|
|
31
|
-
* Detect Claude Code workspaces
|
|
32
|
-
* Claude Code stores projects in ~/.claude/projects with folder names like "-Users-datpham-dpmemories-byterover-cli"
|
|
33
|
-
* These folder names are derived from the project path with slashes replaced by dashes
|
|
34
|
-
*/
|
|
35
|
-
private detectClaudeWorkspaces;
|
|
36
|
-
/**
|
|
37
|
-
* Detect Codex workspaces
|
|
38
|
-
* Codex uses a single sessions folder
|
|
39
|
-
*/
|
|
40
|
-
private detectCodexWorkspaces;
|
|
41
|
-
/**
|
|
42
|
-
* Detect Cursor workspaces
|
|
43
|
-
*/
|
|
44
|
-
private detectCursorWorkspaces;
|
|
45
|
-
/**
|
|
46
|
-
* Detect VSCode workspaces (Github Copilot)
|
|
47
|
-
*/
|
|
48
|
-
private detectVSCodeWorkspaces;
|
|
49
|
-
/**
|
|
50
|
-
* Detect workspaces using workspace.json file (VSCode, Cursor)
|
|
51
|
-
*/
|
|
52
|
-
private detectWorkspacesByFile;
|
|
53
|
-
/**
|
|
54
|
-
* Check if current working directory is within the given workspace folder
|
|
55
|
-
*/
|
|
56
|
-
private isCurrentDirInWorkspace;
|
|
57
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
/**
|
|
5
|
-
* Service to detect IDE workspaces that contain the current working directory
|
|
6
|
-
* Supports: VS Code (Github Copilot), Cursor, Claude, and Codex
|
|
7
|
-
*/
|
|
8
|
-
export class WorkspaceDetectorService {
|
|
9
|
-
claudeUserPath;
|
|
10
|
-
codexUserPath;
|
|
11
|
-
cursorUserPath;
|
|
12
|
-
cwd;
|
|
13
|
-
vscodeUserPath;
|
|
14
|
-
constructor(cwd = process.cwd()) {
|
|
15
|
-
this.cwd = cwd;
|
|
16
|
-
this.vscodeUserPath = join(homedir(), 'Library/Application Support/Code/User/workspaceStorage');
|
|
17
|
-
this.cursorUserPath = join(homedir(), 'Library/Application Support/Cursor/User/workspaceStorage');
|
|
18
|
-
this.claudeUserPath = join(homedir(), '.claude/projects');
|
|
19
|
-
this.codexUserPath = join(homedir(), '.codex/sessions');
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Detect workspaces for the given IDE
|
|
23
|
-
*
|
|
24
|
-
* Supports: Github Copilot (VSCode), Cursor, Claude Code, Codex
|
|
25
|
-
*
|
|
26
|
-
* chatLogPath:
|
|
27
|
-
* - For Cursor/VSCode: Path to workspace storage folder if workspace.json matches cwd
|
|
28
|
-
* - For Claude Code: Path to claude project folder matching cwd (with special naming pattern)
|
|
29
|
-
* - For Codex: Direct path to codex sessions folder
|
|
30
|
-
*/
|
|
31
|
-
detectWorkspaces(agent) {
|
|
32
|
-
const chatLogPath = '';
|
|
33
|
-
switch (agent) {
|
|
34
|
-
case 'Claude Code': {
|
|
35
|
-
return this.detectClaudeWorkspaces(chatLogPath);
|
|
36
|
-
}
|
|
37
|
-
case 'Codex': {
|
|
38
|
-
return this.detectCodexWorkspaces(chatLogPath);
|
|
39
|
-
}
|
|
40
|
-
case 'Cursor': {
|
|
41
|
-
return this.detectCursorWorkspaces(chatLogPath);
|
|
42
|
-
}
|
|
43
|
-
case 'Github Copilot': {
|
|
44
|
-
return this.detectVSCodeWorkspaces(chatLogPath);
|
|
45
|
-
}
|
|
46
|
-
default: {
|
|
47
|
-
return { chatLogPath, cwd: this.cwd };
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Convert current working directory to Claude Code folder name format
|
|
53
|
-
* Example: /Users/datpham/dpmemories/byterover-cli -> -Users-datpham-dpmemories-byterover-cli
|
|
54
|
-
*/
|
|
55
|
-
cwdToClaudeFolderName(cwd) {
|
|
56
|
-
// Remove leading slash and replace all slashes with dashes, then prepend dash
|
|
57
|
-
return '-' + cwd.slice(1).replaceAll('/', '-');
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Detect Claude Code workspaces
|
|
61
|
-
* Claude Code stores projects in ~/.claude/projects with folder names like "-Users-datpham-dpmemories-byterover-cli"
|
|
62
|
-
* These folder names are derived from the project path with slashes replaced by dashes
|
|
63
|
-
*/
|
|
64
|
-
detectClaudeWorkspaces(chatLogPath) {
|
|
65
|
-
try {
|
|
66
|
-
if (!existsSync(this.claudeUserPath)) {
|
|
67
|
-
return { chatLogPath, cwd: this.cwd };
|
|
68
|
-
}
|
|
69
|
-
// Convert cwd to Claude folder name format: /Users/datpham/dpmemories/byterover-cli -> -Users-datpham-dpmemories-byterover-cli
|
|
70
|
-
const claudeFolderName = this.cwdToClaudeFolderName(this.cwd);
|
|
71
|
-
const projectFolders = readdirSync(this.claudeUserPath);
|
|
72
|
-
for (const folderName of projectFolders) {
|
|
73
|
-
const folderPath = join(this.claudeUserPath, folderName);
|
|
74
|
-
// Check if this folder matches the current working directory
|
|
75
|
-
if (folderName === claudeFolderName) {
|
|
76
|
-
chatLogPath = folderPath;
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
// Ignore directory read errors
|
|
83
|
-
}
|
|
84
|
-
return { chatLogPath, cwd: this.cwd };
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Detect Codex workspaces
|
|
88
|
-
* Codex uses a single sessions folder
|
|
89
|
-
*/
|
|
90
|
-
detectCodexWorkspaces(chatLogPath) {
|
|
91
|
-
try {
|
|
92
|
-
if (existsSync(this.codexUserPath)) {
|
|
93
|
-
chatLogPath = this.codexUserPath;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
// Ignore errors
|
|
98
|
-
}
|
|
99
|
-
return { chatLogPath, cwd: this.cwd };
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Detect Cursor workspaces
|
|
103
|
-
*/
|
|
104
|
-
detectCursorWorkspaces(chatLogPath) {
|
|
105
|
-
return this.detectWorkspacesByFile(this.cursorUserPath, chatLogPath);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Detect VSCode workspaces (Github Copilot)
|
|
109
|
-
*/
|
|
110
|
-
detectVSCodeWorkspaces(chatLogPath) {
|
|
111
|
-
return this.detectWorkspacesByFile(this.vscodeUserPath, chatLogPath);
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Detect workspaces using workspace.json file (VSCode, Cursor)
|
|
115
|
-
*/
|
|
116
|
-
detectWorkspacesByFile(userPath, chatLogPath) {
|
|
117
|
-
try {
|
|
118
|
-
if (!existsSync(userPath)) {
|
|
119
|
-
return { chatLogPath, cwd: this.cwd };
|
|
120
|
-
}
|
|
121
|
-
const workspaceIds = readdirSync(userPath);
|
|
122
|
-
for (const wsId of workspaceIds) {
|
|
123
|
-
const wsPath = join(userPath, wsId);
|
|
124
|
-
const workspaceFile = join(wsPath, 'workspace.json');
|
|
125
|
-
if (!existsSync(workspaceFile)) {
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
try {
|
|
129
|
-
const content = readFileSync(workspaceFile, 'utf8');
|
|
130
|
-
const data = JSON.parse(content);
|
|
131
|
-
// Only handle single folder windows (workspace files are ignored)
|
|
132
|
-
if (!data.folder) {
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
const folderPath = decodeURIComponent(data.folder.replace('file://', ''));
|
|
136
|
-
// Set chatLogPath ONLY if folder exactly matches cwd
|
|
137
|
-
if (folderPath === this.cwd) {
|
|
138
|
-
chatLogPath = wsPath;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch {
|
|
142
|
-
// Ignore JSON parse errors
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
// Ignore directory read errors
|
|
148
|
-
}
|
|
149
|
-
return { chatLogPath, cwd: this.cwd };
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Check if current working directory is within the given workspace folder
|
|
153
|
-
*/
|
|
154
|
-
isCurrentDirInWorkspace(folderPath) {
|
|
155
|
-
// Exact match
|
|
156
|
-
if (this.cwd === folderPath) {
|
|
157
|
-
return true;
|
|
158
|
-
}
|
|
159
|
-
// Check if current dir is a subdirectory
|
|
160
|
-
if (this.cwd.startsWith(folderPath + '/')) {
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Crash Log - Re-exports from unified process-logger.
|
|
3
|
-
*
|
|
4
|
-
* @deprecated Use crashLog from process-logger.ts directly.
|
|
5
|
-
* This file is kept for backwards compatibility.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use crashLog from process-logger.ts
|
|
9
|
-
*/
|
|
10
|
-
export declare function writeCrashLog(error: Error | string, context?: string): Promise<string>;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use getSessionLogPath from process-logger.ts
|
|
13
|
-
*/
|
|
14
|
-
export declare function getLogsDir(): string;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Crash Log - Re-exports from unified process-logger.
|
|
3
|
-
*
|
|
4
|
-
* @deprecated Use crashLog from process-logger.ts directly.
|
|
5
|
-
* This file is kept for backwards compatibility.
|
|
6
|
-
*/
|
|
7
|
-
import { crashLog, getSessionLogPath } from './process-logger.js';
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Use crashLog from process-logger.ts
|
|
10
|
-
*/
|
|
11
|
-
export async function writeCrashLog(error, context) {
|
|
12
|
-
return crashLog(error, context);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use getSessionLogPath from process-logger.ts
|
|
16
|
-
*/
|
|
17
|
-
export function getLogsDir() {
|
|
18
|
-
return getSessionLogPath();
|
|
19
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Emoji and message formatting helpers
|
|
3
|
-
*
|
|
4
|
-
* Provides utilities for checking and handling emoji prefixes in error messages
|
|
5
|
-
* to prevent duplicate prefixes like "❌ Error: ❌ Billing error: ..."
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Check if a message already has an emoji prefix
|
|
9
|
-
*
|
|
10
|
-
* Detects common emoji prefixes used in CLI output:
|
|
11
|
-
* - ❌ (error)
|
|
12
|
-
* - ✓ (success)
|
|
13
|
-
* - ⚠️ (warning)
|
|
14
|
-
* - Any Unicode emoji in ranges U+1F300–U+1F9FF
|
|
15
|
-
*
|
|
16
|
-
* @param message - Message to check
|
|
17
|
-
* @returns true if message starts with emoji, false otherwise
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* hasEmojiPrefix("❌ Error message") // true
|
|
21
|
-
* hasEmojiPrefix("✓ Success") // true
|
|
22
|
-
* hasEmojiPrefix("Normal message") // false
|
|
23
|
-
*/
|
|
24
|
-
export declare function hasEmojiPrefix(message: string): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Add error prefix to message if it doesn't already have emoji prefix
|
|
27
|
-
*
|
|
28
|
-
* Prevents duplicate prefixes by checking if message already starts with emoji.
|
|
29
|
-
* If message has emoji prefix, returns as-is. Otherwise, adds "❌ Error: " prefix.
|
|
30
|
-
*
|
|
31
|
-
* @param message - Error message to format
|
|
32
|
-
* @returns Formatted error message with prefix
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* addErrorPrefix("❌ Billing error") // "❌ Billing error" (no duplicate)
|
|
36
|
-
* addErrorPrefix("Something went wrong") // "❌ Error: Something went wrong"
|
|
37
|
-
*/
|
|
38
|
-
export declare function addErrorPrefix(message: string): string;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Emoji and message formatting helpers
|
|
3
|
-
*
|
|
4
|
-
* Provides utilities for checking and handling emoji prefixes in error messages
|
|
5
|
-
* to prevent duplicate prefixes like "❌ Error: ❌ Billing error: ..."
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Check if a message already has an emoji prefix
|
|
9
|
-
*
|
|
10
|
-
* Detects common emoji prefixes used in CLI output:
|
|
11
|
-
* - ❌ (error)
|
|
12
|
-
* - ✓ (success)
|
|
13
|
-
* - ⚠️ (warning)
|
|
14
|
-
* - Any Unicode emoji in ranges U+1F300–U+1F9FF
|
|
15
|
-
*
|
|
16
|
-
* @param message - Message to check
|
|
17
|
-
* @returns true if message starts with emoji, false otherwise
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* hasEmojiPrefix("❌ Error message") // true
|
|
21
|
-
* hasEmojiPrefix("✓ Success") // true
|
|
22
|
-
* hasEmojiPrefix("Normal message") // false
|
|
23
|
-
*/
|
|
24
|
-
export function hasEmojiPrefix(message) {
|
|
25
|
-
return /^[\u{1F300}-\u{1F9FF}]|^❌|^✓|^⚠️/u.test(message);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Add error prefix to message if it doesn't already have emoji prefix
|
|
29
|
-
*
|
|
30
|
-
* Prevents duplicate prefixes by checking if message already starts with emoji.
|
|
31
|
-
* If message has emoji prefix, returns as-is. Otherwise, adds "❌ Error: " prefix.
|
|
32
|
-
*
|
|
33
|
-
* @param message - Error message to format
|
|
34
|
-
* @returns Formatted error message with prefix
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* addErrorPrefix("❌ Billing error") // "❌ Billing error" (no duplicate)
|
|
38
|
-
* addErrorPrefix("Something went wrong") // "❌ Error: Something went wrong"
|
|
39
|
-
*/
|
|
40
|
-
export function addErrorPrefix(message) {
|
|
41
|
-
return hasEmojiPrefix(message) ? message : `❌ Error: ${message}`;
|
|
42
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Centralized error handling utility for CLI commands
|
|
3
|
-
*
|
|
4
|
-
* Provides user-friendly error messages based on error type:
|
|
5
|
-
* - Network errors: Check internet connection
|
|
6
|
-
* - Server errors: Retry later
|
|
7
|
-
* - Billing errors: Check account/payment
|
|
8
|
-
* - Auth errors: Re-login required
|
|
9
|
-
* - Validation errors: Check input
|
|
10
|
-
*/
|
|
11
|
-
export declare enum ErrorType {
|
|
12
|
-
AUTH = "AUTH",
|
|
13
|
-
BILLING = "BILLING",
|
|
14
|
-
NETWORK = "NETWORK",
|
|
15
|
-
SERVER = "SERVER",
|
|
16
|
-
UNKNOWN = "UNKNOWN",
|
|
17
|
-
VALIDATION = "VALIDATION"
|
|
18
|
-
}
|
|
19
|
-
export interface ClassifiedError {
|
|
20
|
-
message: string;
|
|
21
|
-
originalError: Error;
|
|
22
|
-
type: ErrorType;
|
|
23
|
-
userMessage: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Classify error and return user-friendly message
|
|
27
|
-
*/
|
|
28
|
-
export declare function classifyError(error: unknown): ClassifiedError;
|
|
29
|
-
/**
|
|
30
|
-
* Format error for display to user
|
|
31
|
-
*
|
|
32
|
-
* @param error - Error to format
|
|
33
|
-
* @returns User-friendly error message
|
|
34
|
-
*/
|
|
35
|
-
export declare function formatError(error: unknown): string;
|
|
36
|
-
/**
|
|
37
|
-
* Check if error is a network error
|
|
38
|
-
*/
|
|
39
|
-
export declare function isNetworkError(error: unknown): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Check if error is a server error
|
|
42
|
-
*/
|
|
43
|
-
export declare function isServerError(error: unknown): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Check if error is an authentication error
|
|
46
|
-
*/
|
|
47
|
-
export declare function isAuthError(error: unknown): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Check if error is a billing error
|
|
50
|
-
*/
|
|
51
|
-
export declare function isBillingError(error: unknown): boolean;
|