byterover-cli 2.0.0 → 2.1.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/README.md +6 -81
- package/dist/agent/core/domain/llm/index.d.ts +1 -1
- package/dist/agent/core/domain/llm/index.js +1 -1
- package/dist/agent/core/domain/llm/registry.d.ts +8 -0
- package/dist/agent/core/domain/llm/registry.js +34 -0
- package/dist/agent/core/domain/sandbox/types.d.ts +2 -0
- package/dist/agent/core/domain/tools/constants.d.ts +3 -0
- package/dist/agent/core/domain/tools/constants.js +3 -0
- package/dist/agent/core/interfaces/cipher-services.d.ts +2 -4
- package/dist/agent/core/interfaces/i-cipher-agent.d.ts +9 -1
- package/dist/agent/core/interfaces/i-sandbox-service.d.ts +8 -0
- package/dist/agent/core/interfaces/i-tool-provider.d.ts +10 -0
- package/dist/agent/core/interfaces/i-tool-scheduler.d.ts +9 -0
- package/dist/agent/infra/agent/agent-schemas.d.ts +0 -9
- package/dist/agent/infra/agent/agent-schemas.js +0 -3
- package/dist/agent/infra/agent/cipher-agent.d.ts +25 -1
- package/dist/agent/infra/agent/cipher-agent.js +138 -11
- package/dist/agent/infra/agent/provider-update-config.d.ts +0 -2
- package/dist/agent/infra/agent/service-initializer.d.ts +2 -6
- package/dist/agent/infra/agent/service-initializer.js +45 -38
- package/dist/agent/infra/blob/blob-storage-factory.d.ts +2 -2
- package/dist/agent/infra/blob/blob-storage-factory.js +4 -4
- package/dist/agent/infra/blob/file-blob-storage.d.ts +96 -0
- package/dist/agent/infra/blob/file-blob-storage.js +454 -0
- package/dist/agent/infra/blob/index.d.ts +2 -3
- package/dist/agent/infra/blob/index.js +4 -6
- package/dist/agent/infra/llm/agent-llm-service.d.ts +3 -0
- package/dist/agent/infra/llm/agent-llm-service.js +34 -52
- package/dist/agent/infra/llm/context/compression/compression-helpers.d.ts +35 -0
- package/dist/agent/infra/llm/context/compression/compression-helpers.js +124 -0
- package/dist/agent/infra/llm/context/compression/escalated-compression.d.ts +62 -0
- package/dist/agent/infra/llm/context/compression/escalated-compression.js +144 -0
- package/dist/agent/infra/llm/context/compression/index.d.ts +3 -0
- package/dist/agent/infra/llm/context/compression/index.js +3 -0
- package/dist/agent/infra/llm/context/compression/reactive-overflow.d.ts +0 -27
- package/dist/agent/infra/llm/context/compression/reactive-overflow.js +5 -122
- package/dist/agent/infra/llm/context/context-manager.d.ts +20 -1
- package/dist/agent/infra/llm/context/context-manager.js +37 -7
- package/dist/agent/infra/llm/providers/index.js +0 -2
- package/dist/agent/infra/llm/providers/types.d.ts +1 -5
- package/dist/agent/infra/map/agentic-map-service.d.ts +97 -0
- package/dist/agent/infra/map/agentic-map-service.js +309 -0
- package/dist/agent/infra/map/context-tree-store.d.ts +94 -0
- package/dist/agent/infra/map/context-tree-store.js +278 -0
- package/dist/agent/infra/map/index.d.ts +4 -0
- package/dist/agent/infra/map/index.js +4 -0
- package/dist/agent/infra/map/llm-map-memory.d.ts +59 -0
- package/dist/agent/infra/map/llm-map-memory.js +187 -0
- package/dist/agent/infra/map/llm-map-service.d.ts +36 -0
- package/dist/agent/infra/map/llm-map-service.js +118 -0
- package/dist/agent/infra/map/map-shared.d.ts +140 -0
- package/dist/agent/infra/map/map-shared.js +325 -0
- package/dist/agent/infra/map/worker-pool.d.ts +45 -0
- package/dist/agent/infra/map/worker-pool.js +73 -0
- package/dist/agent/infra/sandbox/curation-helpers.d.ts +62 -0
- package/dist/agent/infra/sandbox/curation-helpers.js +219 -0
- package/dist/agent/infra/sandbox/sandbox-service.d.ts +12 -0
- package/dist/agent/infra/sandbox/sandbox-service.js +39 -7
- package/dist/agent/infra/sandbox/tools-sdk.d.ts +48 -1
- package/dist/agent/infra/sandbox/tools-sdk.js +52 -1
- package/dist/agent/infra/session/session-manager.d.ts +8 -1
- package/dist/agent/infra/session/session-manager.js +24 -4
- package/dist/agent/infra/storage/file-key-storage.d.ts +142 -0
- package/dist/agent/infra/storage/file-key-storage.js +572 -0
- package/dist/agent/infra/storage/granular-history-storage.d.ts +1 -1
- package/dist/agent/infra/storage/granular-history-storage.js +1 -1
- package/dist/agent/infra/system-prompt/contributors/context-tree-structure-contributor.d.ts +4 -0
- package/dist/agent/infra/system-prompt/contributors/context-tree-structure-contributor.js +42 -14
- package/dist/agent/infra/system-prompt/contributors/map-selection-contributor.d.ts +16 -0
- package/dist/agent/infra/system-prompt/contributors/map-selection-contributor.js +47 -0
- package/dist/agent/infra/tools/core-tool-scheduler.js +3 -1
- package/dist/agent/infra/tools/implementations/agentic-map-tool.d.ts +35 -0
- package/dist/agent/infra/tools/implementations/agentic-map-tool.js +156 -0
- package/dist/agent/infra/tools/implementations/code-exec-tool.js +1 -0
- package/dist/agent/infra/tools/implementations/curate-tool.d.ts +9 -9
- package/dist/agent/infra/tools/implementations/expand-knowledge-tool.d.ts +18 -0
- package/dist/agent/infra/tools/implementations/expand-knowledge-tool.js +43 -0
- package/dist/agent/infra/tools/implementations/llm-map-tool.d.ts +24 -0
- package/dist/agent/infra/tools/implementations/llm-map-tool.js +87 -0
- package/dist/agent/infra/tools/implementations/memory-symbol-tree.d.ts +28 -1
- package/dist/agent/infra/tools/implementations/memory-symbol-tree.js +27 -3
- package/dist/agent/infra/tools/implementations/search-knowledge-service.d.ts +1 -0
- package/dist/agent/infra/tools/implementations/search-knowledge-service.js +83 -12
- package/dist/agent/infra/tools/implementations/search-knowledge-tool.js +2 -2
- package/dist/agent/infra/tools/tool-manager.js +6 -0
- package/dist/agent/infra/tools/tool-provider.d.ts +12 -0
- package/dist/agent/infra/tools/tool-provider.js +78 -0
- package/dist/agent/infra/tools/tool-registry.d.ts +14 -0
- package/dist/agent/infra/tools/tool-registry.js +32 -0
- package/dist/agent/resources/prompts/system-prompt.yml +48 -74
- package/dist/agent/resources/tools/expand_knowledge.txt +20 -0
- package/dist/oclif/commands/curate/index.js +1 -2
- package/dist/oclif/commands/main.js +1 -0
- package/dist/oclif/commands/providers/connect.d.ts +1 -3
- package/dist/oclif/commands/providers/connect.js +7 -29
- package/dist/oclif/commands/query.js +1 -2
- package/dist/server/constants.d.ts +7 -0
- package/dist/server/constants.js +8 -0
- package/dist/server/core/domain/entities/provider-registry.js +1 -15
- package/dist/server/core/domain/knowledge/memory-scoring.js +1 -1
- package/dist/server/core/domain/knowledge/summary-types.d.ts +126 -0
- package/dist/server/core/domain/knowledge/summary-types.js +7 -0
- package/dist/server/core/domain/transport/schemas.d.ts +0 -4
- package/dist/server/core/interfaces/context-tree/i-context-tree-archive-service.d.ts +30 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-archive-service.js +1 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-manifest-service.d.ts +30 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-manifest-service.js +1 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-summary-service.d.ts +29 -0
- package/dist/server/core/interfaces/context-tree/i-context-tree-summary-service.js +1 -0
- package/dist/server/infra/cogit/context-tree-to-push-context-mapper.js +10 -3
- package/dist/server/infra/connectors/skill/skill-connector.d.ts +4 -0
- package/dist/server/infra/connectors/skill/skill-connector.js +4 -0
- package/dist/server/infra/context-tree/children-hash.d.ts +20 -0
- package/dist/server/infra/context-tree/children-hash.js +22 -0
- package/dist/server/infra/context-tree/derived-artifact.d.ts +28 -0
- package/dist/server/infra/context-tree/derived-artifact.js +48 -0
- package/dist/server/infra/context-tree/file-context-tree-archive-service.d.ts +37 -0
- package/dist/server/infra/context-tree/file-context-tree-archive-service.js +219 -0
- package/dist/server/infra/context-tree/file-context-tree-manifest-service.d.ts +50 -0
- package/dist/server/infra/context-tree/file-context-tree-manifest-service.js +278 -0
- package/dist/server/infra/context-tree/file-context-tree-merger.js +4 -0
- package/dist/server/infra/context-tree/file-context-tree-snapshot-service.js +12 -4
- package/dist/server/infra/context-tree/file-context-tree-summary-service.d.ts +44 -0
- package/dist/server/infra/context-tree/file-context-tree-summary-service.js +313 -0
- package/dist/server/infra/context-tree/file-context-tree-writer-service.js +5 -0
- package/dist/server/infra/context-tree/prompts/summary-generation.d.ts +22 -0
- package/dist/server/infra/context-tree/prompts/summary-generation.js +45 -0
- package/dist/server/infra/context-tree/snapshot-diff.d.ts +19 -0
- package/dist/server/infra/context-tree/snapshot-diff.js +39 -0
- package/dist/server/infra/context-tree/summary-frontmatter.d.ts +24 -0
- package/dist/server/infra/context-tree/summary-frontmatter.js +111 -0
- package/dist/server/infra/daemon/agent-process.js +2 -14
- package/dist/server/infra/executor/curate-executor.d.ts +1 -0
- package/dist/server/infra/executor/curate-executor.js +82 -34
- package/dist/server/infra/executor/folder-pack-executor.js +1 -1
- package/dist/server/infra/executor/pre-compaction/compaction-escalation.d.ts +6 -0
- package/dist/server/infra/executor/pre-compaction/compaction-escalation.js +6 -0
- package/dist/server/infra/executor/pre-compaction/index.d.ts +3 -0
- package/dist/server/infra/executor/pre-compaction/index.js +1 -0
- package/dist/server/infra/executor/pre-compaction/pre-compaction-service.d.ts +59 -0
- package/dist/server/infra/executor/pre-compaction/pre-compaction-service.js +124 -0
- package/dist/server/infra/executor/pre-compaction/prompts.d.ts +24 -0
- package/dist/server/infra/executor/pre-compaction/prompts.js +47 -0
- package/dist/server/infra/executor/query-executor.d.ts +3 -0
- package/dist/server/infra/executor/query-executor.js +39 -4
- package/dist/server/infra/http/authenticated-http-client.js +4 -0
- package/dist/server/infra/http/provider-model-fetcher-registry.js +1 -5
- package/dist/server/infra/http/provider-model-fetchers.d.ts +0 -14
- package/dist/server/infra/http/provider-model-fetchers.js +0 -132
- package/dist/server/infra/provider/provider-config-resolver.js +0 -55
- package/dist/server/utils/curate-result-parser.d.ts +4 -4
- package/dist/shared/constants/curation.d.ts +6 -0
- package/dist/shared/constants/curation.js +6 -0
- package/dist/shared/utils/escalation-utils.d.ts +59 -0
- package/dist/shared/utils/escalation-utils.js +141 -0
- package/dist/tui/components/command-input.js +1 -1
- package/dist/tui/components/inline-prompts/inline-confirm.js +6 -1
- package/dist/tui/features/commands/definitions/exit.d.ts +2 -0
- package/dist/tui/features/commands/definitions/exit.js +9 -0
- package/dist/tui/features/commands/definitions/index.js +3 -0
- package/dist/tui/features/exit/components/exit-flow.d.ts +10 -0
- package/dist/tui/features/exit/components/exit-flow.js +19 -0
- package/dist/tui/features/provider/components/provider-flow.js +1 -21
- package/oclif.manifest.json +100 -109
- package/package.json +11 -4
- package/dist/agent/infra/blob/migrations.d.ts +0 -63
- package/dist/agent/infra/blob/migrations.js +0 -148
- package/dist/agent/infra/blob/sqlite-blob-storage.d.ts +0 -82
- package/dist/agent/infra/blob/sqlite-blob-storage.js +0 -307
- package/dist/agent/infra/llm/providers/google-vertex.d.ts +0 -15
- package/dist/agent/infra/llm/providers/google-vertex.js +0 -36
- package/dist/agent/infra/storage/blob-history-storage.d.ts +0 -81
- package/dist/agent/infra/storage/blob-history-storage.js +0 -193
- package/dist/agent/infra/storage/dual-format-history-storage.d.ts +0 -83
- package/dist/agent/infra/storage/dual-format-history-storage.js +0 -165
- package/dist/agent/infra/storage/sqlite-key-storage.d.ts +0 -113
- package/dist/agent/infra/storage/sqlite-key-storage.js +0 -438
- package/dist/server/infra/provider/vertex-ai-utils.d.ts +0 -10
- package/dist/server/infra/provider/vertex-ai-utils.js +0 -28
- package/dist/tui/features/provider/components/credential-path-dialog.d.ts +0 -30
- package/dist/tui/features/provider/components/credential-path-dialog.js +0 -85
package/oclif.manifest.json
CHANGED
|
@@ -997,6 +997,104 @@
|
|
|
997
997
|
"switch.js"
|
|
998
998
|
]
|
|
999
999
|
},
|
|
1000
|
+
"space:list": {
|
|
1001
|
+
"aliases": [],
|
|
1002
|
+
"args": {},
|
|
1003
|
+
"description": "List all teams and spaces",
|
|
1004
|
+
"examples": [
|
|
1005
|
+
"<%= config.bin %> space list",
|
|
1006
|
+
"<%= config.bin %> space list --format json"
|
|
1007
|
+
],
|
|
1008
|
+
"flags": {
|
|
1009
|
+
"format": {
|
|
1010
|
+
"char": "f",
|
|
1011
|
+
"description": "Output format",
|
|
1012
|
+
"name": "format",
|
|
1013
|
+
"default": "text",
|
|
1014
|
+
"hasDynamicHelp": false,
|
|
1015
|
+
"multiple": false,
|
|
1016
|
+
"options": [
|
|
1017
|
+
"text",
|
|
1018
|
+
"json"
|
|
1019
|
+
],
|
|
1020
|
+
"type": "option"
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
"hasDynamicHelp": false,
|
|
1024
|
+
"hiddenAliases": [],
|
|
1025
|
+
"id": "space:list",
|
|
1026
|
+
"pluginAlias": "byterover-cli",
|
|
1027
|
+
"pluginName": "byterover-cli",
|
|
1028
|
+
"pluginType": "core",
|
|
1029
|
+
"strict": true,
|
|
1030
|
+
"enableJsonFlag": false,
|
|
1031
|
+
"isESM": true,
|
|
1032
|
+
"relativePath": [
|
|
1033
|
+
"dist",
|
|
1034
|
+
"oclif",
|
|
1035
|
+
"commands",
|
|
1036
|
+
"space",
|
|
1037
|
+
"list.js"
|
|
1038
|
+
]
|
|
1039
|
+
},
|
|
1040
|
+
"space:switch": {
|
|
1041
|
+
"aliases": [],
|
|
1042
|
+
"args": {},
|
|
1043
|
+
"description": "Switch to a different space",
|
|
1044
|
+
"examples": [
|
|
1045
|
+
"<%= config.bin %> space switch --team acme --name my-space",
|
|
1046
|
+
"<%= config.bin %> space switch --team acme --name my-space --format json"
|
|
1047
|
+
],
|
|
1048
|
+
"flags": {
|
|
1049
|
+
"format": {
|
|
1050
|
+
"char": "f",
|
|
1051
|
+
"description": "Output format",
|
|
1052
|
+
"name": "format",
|
|
1053
|
+
"default": "text",
|
|
1054
|
+
"hasDynamicHelp": false,
|
|
1055
|
+
"multiple": false,
|
|
1056
|
+
"options": [
|
|
1057
|
+
"text",
|
|
1058
|
+
"json"
|
|
1059
|
+
],
|
|
1060
|
+
"type": "option"
|
|
1061
|
+
},
|
|
1062
|
+
"name": {
|
|
1063
|
+
"char": "n",
|
|
1064
|
+
"description": "Name of the space to switch to",
|
|
1065
|
+
"name": "name",
|
|
1066
|
+
"required": true,
|
|
1067
|
+
"hasDynamicHelp": false,
|
|
1068
|
+
"multiple": false,
|
|
1069
|
+
"type": "option"
|
|
1070
|
+
},
|
|
1071
|
+
"team": {
|
|
1072
|
+
"char": "t",
|
|
1073
|
+
"description": "Team name",
|
|
1074
|
+
"name": "team",
|
|
1075
|
+
"required": true,
|
|
1076
|
+
"hasDynamicHelp": false,
|
|
1077
|
+
"multiple": false,
|
|
1078
|
+
"type": "option"
|
|
1079
|
+
}
|
|
1080
|
+
},
|
|
1081
|
+
"hasDynamicHelp": false,
|
|
1082
|
+
"hiddenAliases": [],
|
|
1083
|
+
"id": "space:switch",
|
|
1084
|
+
"pluginAlias": "byterover-cli",
|
|
1085
|
+
"pluginName": "byterover-cli",
|
|
1086
|
+
"pluginType": "core",
|
|
1087
|
+
"strict": true,
|
|
1088
|
+
"enableJsonFlag": false,
|
|
1089
|
+
"isESM": true,
|
|
1090
|
+
"relativePath": [
|
|
1091
|
+
"dist",
|
|
1092
|
+
"oclif",
|
|
1093
|
+
"commands",
|
|
1094
|
+
"space",
|
|
1095
|
+
"switch.js"
|
|
1096
|
+
]
|
|
1097
|
+
},
|
|
1000
1098
|
"providers:connect": {
|
|
1001
1099
|
"aliases": [],
|
|
1002
1100
|
"args": {
|
|
@@ -1012,8 +1110,7 @@
|
|
|
1012
1110
|
"<%= config.bin %> providers connect openai --api-key sk-xxx --model gpt-4.1",
|
|
1013
1111
|
"<%= config.bin %> providers connect byterover",
|
|
1014
1112
|
"<%= config.bin %> providers connect openai-compatible --base-url http://localhost:11434/v1",
|
|
1015
|
-
"<%= config.bin %> providers connect openai-compatible --base-url http://localhost:11434/v1 --api-key sk-xxx --model llama3"
|
|
1016
|
-
"<%= config.bin %> providers connect google-vertex --credential-file /path/to/service-account.json"
|
|
1113
|
+
"<%= config.bin %> providers connect openai-compatible --base-url http://localhost:11434/v1 --api-key sk-xxx --model llama3"
|
|
1017
1114
|
],
|
|
1018
1115
|
"flags": {
|
|
1019
1116
|
"api-key": {
|
|
@@ -1032,14 +1129,6 @@
|
|
|
1032
1129
|
"multiple": false,
|
|
1033
1130
|
"type": "option"
|
|
1034
1131
|
},
|
|
1035
|
-
"credential-file": {
|
|
1036
|
-
"char": "f",
|
|
1037
|
-
"description": "Path to service account JSON key file (for Google Vertex AI)",
|
|
1038
|
-
"name": "credential-file",
|
|
1039
|
-
"hasDynamicHelp": false,
|
|
1040
|
-
"multiple": false,
|
|
1041
|
-
"type": "option"
|
|
1042
|
-
},
|
|
1043
1132
|
"format": {
|
|
1044
1133
|
"description": "Output format (text or json)",
|
|
1045
1134
|
"name": "format",
|
|
@@ -1246,104 +1335,6 @@
|
|
|
1246
1335
|
"switch.js"
|
|
1247
1336
|
]
|
|
1248
1337
|
},
|
|
1249
|
-
"space:list": {
|
|
1250
|
-
"aliases": [],
|
|
1251
|
-
"args": {},
|
|
1252
|
-
"description": "List all teams and spaces",
|
|
1253
|
-
"examples": [
|
|
1254
|
-
"<%= config.bin %> space list",
|
|
1255
|
-
"<%= config.bin %> space list --format json"
|
|
1256
|
-
],
|
|
1257
|
-
"flags": {
|
|
1258
|
-
"format": {
|
|
1259
|
-
"char": "f",
|
|
1260
|
-
"description": "Output format",
|
|
1261
|
-
"name": "format",
|
|
1262
|
-
"default": "text",
|
|
1263
|
-
"hasDynamicHelp": false,
|
|
1264
|
-
"multiple": false,
|
|
1265
|
-
"options": [
|
|
1266
|
-
"text",
|
|
1267
|
-
"json"
|
|
1268
|
-
],
|
|
1269
|
-
"type": "option"
|
|
1270
|
-
}
|
|
1271
|
-
},
|
|
1272
|
-
"hasDynamicHelp": false,
|
|
1273
|
-
"hiddenAliases": [],
|
|
1274
|
-
"id": "space:list",
|
|
1275
|
-
"pluginAlias": "byterover-cli",
|
|
1276
|
-
"pluginName": "byterover-cli",
|
|
1277
|
-
"pluginType": "core",
|
|
1278
|
-
"strict": true,
|
|
1279
|
-
"enableJsonFlag": false,
|
|
1280
|
-
"isESM": true,
|
|
1281
|
-
"relativePath": [
|
|
1282
|
-
"dist",
|
|
1283
|
-
"oclif",
|
|
1284
|
-
"commands",
|
|
1285
|
-
"space",
|
|
1286
|
-
"list.js"
|
|
1287
|
-
]
|
|
1288
|
-
},
|
|
1289
|
-
"space:switch": {
|
|
1290
|
-
"aliases": [],
|
|
1291
|
-
"args": {},
|
|
1292
|
-
"description": "Switch to a different space",
|
|
1293
|
-
"examples": [
|
|
1294
|
-
"<%= config.bin %> space switch --team acme --name my-space",
|
|
1295
|
-
"<%= config.bin %> space switch --team acme --name my-space --format json"
|
|
1296
|
-
],
|
|
1297
|
-
"flags": {
|
|
1298
|
-
"format": {
|
|
1299
|
-
"char": "f",
|
|
1300
|
-
"description": "Output format",
|
|
1301
|
-
"name": "format",
|
|
1302
|
-
"default": "text",
|
|
1303
|
-
"hasDynamicHelp": false,
|
|
1304
|
-
"multiple": false,
|
|
1305
|
-
"options": [
|
|
1306
|
-
"text",
|
|
1307
|
-
"json"
|
|
1308
|
-
],
|
|
1309
|
-
"type": "option"
|
|
1310
|
-
},
|
|
1311
|
-
"name": {
|
|
1312
|
-
"char": "n",
|
|
1313
|
-
"description": "Name of the space to switch to",
|
|
1314
|
-
"name": "name",
|
|
1315
|
-
"required": true,
|
|
1316
|
-
"hasDynamicHelp": false,
|
|
1317
|
-
"multiple": false,
|
|
1318
|
-
"type": "option"
|
|
1319
|
-
},
|
|
1320
|
-
"team": {
|
|
1321
|
-
"char": "t",
|
|
1322
|
-
"description": "Team name",
|
|
1323
|
-
"name": "team",
|
|
1324
|
-
"required": true,
|
|
1325
|
-
"hasDynamicHelp": false,
|
|
1326
|
-
"multiple": false,
|
|
1327
|
-
"type": "option"
|
|
1328
|
-
}
|
|
1329
|
-
},
|
|
1330
|
-
"hasDynamicHelp": false,
|
|
1331
|
-
"hiddenAliases": [],
|
|
1332
|
-
"id": "space:switch",
|
|
1333
|
-
"pluginAlias": "byterover-cli",
|
|
1334
|
-
"pluginName": "byterover-cli",
|
|
1335
|
-
"pluginType": "core",
|
|
1336
|
-
"strict": true,
|
|
1337
|
-
"enableJsonFlag": false,
|
|
1338
|
-
"isESM": true,
|
|
1339
|
-
"relativePath": [
|
|
1340
|
-
"dist",
|
|
1341
|
-
"oclif",
|
|
1342
|
-
"commands",
|
|
1343
|
-
"space",
|
|
1344
|
-
"switch.js"
|
|
1345
|
-
]
|
|
1346
|
-
},
|
|
1347
1338
|
"hub:registry:add": {
|
|
1348
1339
|
"aliases": [],
|
|
1349
1340
|
"args": {
|
|
@@ -1543,5 +1534,5 @@
|
|
|
1543
1534
|
]
|
|
1544
1535
|
}
|
|
1545
1536
|
},
|
|
1546
|
-
"version": "2.
|
|
1537
|
+
"version": "2.1.0"
|
|
1547
1538
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "byterover-cli",
|
|
3
3
|
"description": "ByteRover's CLI",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"author": "ByteRover",
|
|
6
6
|
"bin": {
|
|
7
7
|
"brv": "./bin/run.js"
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"@ai-sdk/cohere": "^2.0.0",
|
|
14
14
|
"@ai-sdk/deepinfra": "^1.0.35",
|
|
15
15
|
"@ai-sdk/google": "^2.0.52",
|
|
16
|
-
"@ai-sdk/google-vertex": "^3.0.100",
|
|
17
16
|
"@ai-sdk/groq": "^2.0.34",
|
|
18
17
|
"@ai-sdk/mistral": "^2.0.27",
|
|
19
18
|
"@ai-sdk/openai": "^2.0.89",
|
|
@@ -23,7 +22,6 @@
|
|
|
23
22
|
"@ai-sdk/vercel": "^1.0.33",
|
|
24
23
|
"@ai-sdk/xai": "^2.0.57",
|
|
25
24
|
"@anthropic-ai/sdk": "^0.70.1",
|
|
26
|
-
"@anthropic-ai/vertex-sdk": "^0.14.0",
|
|
27
25
|
"@campfirein/brv-transport-client": "github:campfirein/brv-transport-client#release/0.8.2",
|
|
28
26
|
"@google/genai": "^1.29.0",
|
|
29
27
|
"@inkjs/ui": "^2.0.0",
|
|
@@ -97,6 +95,8 @@
|
|
|
97
95
|
"eslint-config-prettier": "^10",
|
|
98
96
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
99
97
|
"expect-type": "^1.2.2",
|
|
98
|
+
"husky": "^9.1.7",
|
|
99
|
+
"lint-staged": "^16.3.1",
|
|
100
100
|
"mocha": "^10",
|
|
101
101
|
"nock": "^14.0.10",
|
|
102
102
|
"oclif": "^4",
|
|
@@ -165,12 +165,19 @@
|
|
|
165
165
|
"dev": "node bin/kill-daemon.js && npm run build && ./bin/dev.js",
|
|
166
166
|
"dev:kill": "node bin/kill-daemon.js",
|
|
167
167
|
"lint": "eslint",
|
|
168
|
+
"lint:fix": "npm run lint -- --fix",
|
|
168
169
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
169
|
-
"posttest": "npm run lint",
|
|
170
170
|
"prepack": "npm run build && BRV_ENV=production oclif manifest",
|
|
171
|
+
"prepare": "husky",
|
|
171
172
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
173
|
+
"typecheck": "tsc --noEmit",
|
|
172
174
|
"version": "git add README.md"
|
|
173
175
|
},
|
|
176
|
+
"lint-staged": {
|
|
177
|
+
"*.{ts,tsx}": [
|
|
178
|
+
"npm run lint:fix"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
174
181
|
"types": "dist/index.d.ts",
|
|
175
182
|
"bundleDependencies": [
|
|
176
183
|
"@campfirein/brv-transport-client"
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type Database from 'better-sqlite3';
|
|
2
|
-
import type { BlobLogger } from '../../core/domain/blob/types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Migration definition type
|
|
5
|
-
*/
|
|
6
|
-
export type Migration = {
|
|
7
|
-
/**
|
|
8
|
-
* Description of what this migration does
|
|
9
|
-
*/
|
|
10
|
-
description: string;
|
|
11
|
-
/**
|
|
12
|
-
* Optional backward migration (downgrade)
|
|
13
|
-
* Only needed for critical rollback scenarios
|
|
14
|
-
* @param db - SQLite database instance
|
|
15
|
-
*/
|
|
16
|
-
down?(db: Database.Database): void;
|
|
17
|
-
/**
|
|
18
|
-
* Forward migration (upgrade)
|
|
19
|
-
* @param db - SQLite database instance
|
|
20
|
-
*/
|
|
21
|
-
up(db: Database.Database): void;
|
|
22
|
-
/**
|
|
23
|
-
* Migration version number (must be sequential)
|
|
24
|
-
*/
|
|
25
|
-
version: number;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* SQLite Blob Storage Migrations
|
|
29
|
-
*
|
|
30
|
-
* IMPORTANT RULES:
|
|
31
|
-
* 1. NEVER modify existing migrations - always add new ones
|
|
32
|
-
* 2. Version numbers must be sequential (1, 2, 3, ...)
|
|
33
|
-
* 3. Always use IF NOT EXISTS for safety
|
|
34
|
-
* 4. Test migrations thoroughly before releasing
|
|
35
|
-
* 5. Consider adding 'down' for complex changes
|
|
36
|
-
*/
|
|
37
|
-
export declare const MIGRATIONS: Migration[];
|
|
38
|
-
/**
|
|
39
|
-
* Get the current schema version from the database
|
|
40
|
-
*/
|
|
41
|
-
export declare function getCurrentVersion(db: Database.Database): number;
|
|
42
|
-
/**
|
|
43
|
-
* Set the schema version in the database
|
|
44
|
-
*/
|
|
45
|
-
export declare function setVersion(db: Database.Database, version: number): void;
|
|
46
|
-
/**
|
|
47
|
-
* Run all pending migrations
|
|
48
|
-
*
|
|
49
|
-
* @param db - SQLite database instance
|
|
50
|
-
* @param logger - Optional logger for migration output (defaults to console)
|
|
51
|
-
* @returns Number of migrations applied
|
|
52
|
-
* @throws Error if migration fails
|
|
53
|
-
*/
|
|
54
|
-
export declare function runMigrations(db: Database.Database, logger?: BlobLogger): number;
|
|
55
|
-
/**
|
|
56
|
-
* Rollback to a specific version (use with extreme caution!)
|
|
57
|
-
*
|
|
58
|
-
* @param db - SQLite database instance
|
|
59
|
-
* @param targetVersion - Version to rollback to
|
|
60
|
-
* @param logger - Optional logger for rollback output (defaults to console)
|
|
61
|
-
* @throws Error if rollback fails or migrations don't have 'down' methods
|
|
62
|
-
*/
|
|
63
|
-
export declare function rollbackToVersion(db: Database.Database, targetVersion: number, logger?: BlobLogger): void;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default logger that uses console (fallback when no logger provided)
|
|
3
|
-
*/
|
|
4
|
-
const defaultLogger = {
|
|
5
|
-
error: (message) => console.error(message),
|
|
6
|
-
info: (message) => console.log(message),
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* SQLite Blob Storage Migrations
|
|
10
|
-
*
|
|
11
|
-
* IMPORTANT RULES:
|
|
12
|
-
* 1. NEVER modify existing migrations - always add new ones
|
|
13
|
-
* 2. Version numbers must be sequential (1, 2, 3, ...)
|
|
14
|
-
* 3. Always use IF NOT EXISTS for safety
|
|
15
|
-
* 4. Test migrations thoroughly before releasing
|
|
16
|
-
* 5. Consider adding 'down' for complex changes
|
|
17
|
-
*/
|
|
18
|
-
export const MIGRATIONS = [
|
|
19
|
-
{
|
|
20
|
-
description: 'Initial schema: blobs table with comprehensive indexes',
|
|
21
|
-
down(db) {
|
|
22
|
-
// Rollback: drop all indexes and table
|
|
23
|
-
db.exec(`DROP INDEX IF EXISTS idx_blobs_size_created`);
|
|
24
|
-
db.exec(`DROP INDEX IF EXISTS idx_blobs_type_updated`);
|
|
25
|
-
db.exec(`DROP INDEX IF EXISTS idx_blobs_created_at`);
|
|
26
|
-
db.exec(`DROP INDEX IF EXISTS idx_blobs_updated_at`);
|
|
27
|
-
db.exec(`DROP INDEX IF EXISTS idx_blobs_size`);
|
|
28
|
-
db.exec(`DROP INDEX IF EXISTS idx_blobs_original_name`);
|
|
29
|
-
db.exec(`DROP INDEX IF EXISTS idx_blobs_content_type`);
|
|
30
|
-
db.exec(`DROP TABLE IF EXISTS blobs`);
|
|
31
|
-
},
|
|
32
|
-
up(db) {
|
|
33
|
-
// Create main table
|
|
34
|
-
db.exec(`
|
|
35
|
-
CREATE TABLE IF NOT EXISTS blobs (
|
|
36
|
-
key TEXT PRIMARY KEY,
|
|
37
|
-
content BLOB NOT NULL,
|
|
38
|
-
content_type TEXT,
|
|
39
|
-
original_name TEXT,
|
|
40
|
-
size INTEGER NOT NULL,
|
|
41
|
-
tags TEXT,
|
|
42
|
-
created_at INTEGER NOT NULL,
|
|
43
|
-
updated_at INTEGER NOT NULL
|
|
44
|
-
)
|
|
45
|
-
`);
|
|
46
|
-
// Single-column indexes
|
|
47
|
-
db.exec(`CREATE INDEX IF NOT EXISTS idx_blobs_content_type ON blobs(content_type)`);
|
|
48
|
-
db.exec(`CREATE INDEX IF NOT EXISTS idx_blobs_original_name ON blobs(original_name)`);
|
|
49
|
-
db.exec(`CREATE INDEX IF NOT EXISTS idx_blobs_size ON blobs(size)`);
|
|
50
|
-
db.exec(`CREATE INDEX IF NOT EXISTS idx_blobs_updated_at ON blobs(updated_at DESC)`);
|
|
51
|
-
db.exec(`CREATE INDEX IF NOT EXISTS idx_blobs_created_at ON blobs(created_at DESC)`);
|
|
52
|
-
// Composite indexes
|
|
53
|
-
db.exec(`CREATE INDEX IF NOT EXISTS idx_blobs_type_updated ON blobs(content_type, updated_at DESC)`);
|
|
54
|
-
db.exec(`CREATE INDEX IF NOT EXISTS idx_blobs_size_created ON blobs(size, created_at DESC)`);
|
|
55
|
-
},
|
|
56
|
-
version: 1,
|
|
57
|
-
},
|
|
58
|
-
// Example future migration (commented out):
|
|
59
|
-
// {
|
|
60
|
-
// version: 2,
|
|
61
|
-
// description: 'Add checksum column for data integrity verification',
|
|
62
|
-
// up(db) {
|
|
63
|
-
// db.exec(`ALTER TABLE blobs ADD COLUMN checksum TEXT`);
|
|
64
|
-
// db.exec(`CREATE INDEX IF NOT EXISTS idx_blobs_checksum ON blobs(checksum)`);
|
|
65
|
-
// },
|
|
66
|
-
// down(db) {
|
|
67
|
-
// // Note: SQLite doesn't support DROP COLUMN easily
|
|
68
|
-
// // Would need to recreate table without the column
|
|
69
|
-
// db.exec(`DROP INDEX IF EXISTS idx_blobs_checksum`);
|
|
70
|
-
// },
|
|
71
|
-
// },
|
|
72
|
-
];
|
|
73
|
-
/**
|
|
74
|
-
* Get the current schema version from the database
|
|
75
|
-
*/
|
|
76
|
-
export function getCurrentVersion(db) {
|
|
77
|
-
const result = db.pragma('user_version', { simple: true });
|
|
78
|
-
return result;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Set the schema version in the database
|
|
82
|
-
*/
|
|
83
|
-
export function setVersion(db, version) {
|
|
84
|
-
db.pragma(`user_version = ${version}`);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Run all pending migrations
|
|
88
|
-
*
|
|
89
|
-
* @param db - SQLite database instance
|
|
90
|
-
* @param logger - Optional logger for migration output (defaults to console)
|
|
91
|
-
* @returns Number of migrations applied
|
|
92
|
-
* @throws Error if migration fails
|
|
93
|
-
*/
|
|
94
|
-
export function runMigrations(db, logger = defaultLogger) {
|
|
95
|
-
const currentVersion = getCurrentVersion(db);
|
|
96
|
-
const pendingMigrations = MIGRATIONS.filter((m) => m.version > currentVersion);
|
|
97
|
-
if (pendingMigrations.length === 0) {
|
|
98
|
-
return 0;
|
|
99
|
-
}
|
|
100
|
-
let appliedCount = 0;
|
|
101
|
-
// Use transaction for atomic migrations
|
|
102
|
-
const runMigrationsInTransaction = db.transaction(() => {
|
|
103
|
-
for (const migration of pendingMigrations) {
|
|
104
|
-
try {
|
|
105
|
-
// Run the migration (no verbose logging during execution)
|
|
106
|
-
migration.up(db);
|
|
107
|
-
// Update version
|
|
108
|
-
setVersion(db, migration.version);
|
|
109
|
-
appliedCount++;
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
const errorMsg = `Database migration failed: ${error instanceof Error ? error.message : String(error)}`;
|
|
113
|
-
logger.error(errorMsg);
|
|
114
|
-
throw new Error(errorMsg);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
// Execute all migrations atomically
|
|
119
|
-
runMigrationsInTransaction();
|
|
120
|
-
return appliedCount;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Rollback to a specific version (use with extreme caution!)
|
|
124
|
-
*
|
|
125
|
-
* @param db - SQLite database instance
|
|
126
|
-
* @param targetVersion - Version to rollback to
|
|
127
|
-
* @param logger - Optional logger for rollback output (defaults to console)
|
|
128
|
-
* @throws Error if rollback fails or migrations don't have 'down' methods
|
|
129
|
-
*/
|
|
130
|
-
export function rollbackToVersion(db, targetVersion, logger = defaultLogger) {
|
|
131
|
-
const currentVersion = getCurrentVersion(db);
|
|
132
|
-
if (targetVersion >= currentVersion) {
|
|
133
|
-
throw new Error(`Cannot rollback: target version ${targetVersion} is not older than current ${currentVersion}`);
|
|
134
|
-
}
|
|
135
|
-
const migrationsToRollback = MIGRATIONS.filter((m) => m.version > targetVersion && m.version <= currentVersion).reverse(); // Rollback in reverse order
|
|
136
|
-
const rollbackInTransaction = db.transaction(() => {
|
|
137
|
-
for (const migration of migrationsToRollback) {
|
|
138
|
-
if (!migration.down) {
|
|
139
|
-
throw new Error(`Migration v${migration.version} does not support rollback (no 'down' method)`);
|
|
140
|
-
}
|
|
141
|
-
logger.info(`[Migration] Rolling back v${migration.version}: ${migration.description}`);
|
|
142
|
-
migration.down(db);
|
|
143
|
-
}
|
|
144
|
-
setVersion(db, targetVersion);
|
|
145
|
-
});
|
|
146
|
-
rollbackInTransaction();
|
|
147
|
-
logger.info(`[Migration] Rolled back to v${targetVersion}`);
|
|
148
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { BlobMetadata, BlobStats, BlobStorageConfig, StoredBlob } from '../../core/domain/blob/types.js';
|
|
2
|
-
import type { IBlobStorage } from '../../core/interfaces/i-blob-storage.js';
|
|
3
|
-
/**
|
|
4
|
-
* SQLite-based blob storage implementation
|
|
5
|
-
*
|
|
6
|
-
* Stores all blobs in a single SQLite database file:
|
|
7
|
-
* - .brv/storage.db
|
|
8
|
-
*
|
|
9
|
-
* Schema:
|
|
10
|
-
* - blobs: key, content, content_type, original_name, size, tags, created_at, updated_at
|
|
11
|
-
*
|
|
12
|
-
* Benefits over file-based storage:
|
|
13
|
-
* - O(1) lookup for exists/retrieve
|
|
14
|
-
* - Fast listing and filtering
|
|
15
|
-
* - ACID transactions for data integrity
|
|
16
|
-
* - Single file for easy backup/migration
|
|
17
|
-
*/
|
|
18
|
-
export declare class SqliteBlobStorage implements IBlobStorage {
|
|
19
|
-
private db;
|
|
20
|
-
private readonly dbPath;
|
|
21
|
-
private initialized;
|
|
22
|
-
private readonly inMemory;
|
|
23
|
-
private readonly logger;
|
|
24
|
-
private readonly maxBlobSize;
|
|
25
|
-
private readonly maxTotalSize;
|
|
26
|
-
private readonly storageDir;
|
|
27
|
-
constructor(config?: Partial<BlobStorageConfig>);
|
|
28
|
-
/**
|
|
29
|
-
* Clear all blobs from storage
|
|
30
|
-
* WARNING: This is a destructive operation
|
|
31
|
-
*/
|
|
32
|
-
clear(): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Close the database connection
|
|
35
|
-
*/
|
|
36
|
-
close(): void;
|
|
37
|
-
/**
|
|
38
|
-
* Delete a blob by its key
|
|
39
|
-
*/
|
|
40
|
-
delete(key: string): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Check if a blob exists
|
|
43
|
-
*/
|
|
44
|
-
exists(key: string): Promise<boolean>;
|
|
45
|
-
/**
|
|
46
|
-
* Get metadata for a blob without retrieving its content
|
|
47
|
-
*/
|
|
48
|
-
getMetadata(key: string): Promise<BlobMetadata | undefined>;
|
|
49
|
-
/**
|
|
50
|
-
* Get storage statistics
|
|
51
|
-
*/
|
|
52
|
-
getStats(): Promise<BlobStats>;
|
|
53
|
-
/**
|
|
54
|
-
* Initialize storage by creating the database and running migrations
|
|
55
|
-
*/
|
|
56
|
-
initialize(): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* List all blob keys, optionally filtered by prefix
|
|
59
|
-
*/
|
|
60
|
-
list(prefix?: string): Promise<string[]>;
|
|
61
|
-
/**
|
|
62
|
-
* Retrieve a blob by its key
|
|
63
|
-
*/
|
|
64
|
-
retrieve(key: string): Promise<StoredBlob | undefined>;
|
|
65
|
-
/**
|
|
66
|
-
* Store a blob with optional metadata
|
|
67
|
-
*/
|
|
68
|
-
store(key: string, content: Buffer | string, metadata?: Partial<BlobMetadata>): Promise<StoredBlob>;
|
|
69
|
-
/**
|
|
70
|
-
* Ensure storage has been initialized
|
|
71
|
-
*/
|
|
72
|
-
private ensureInitialized;
|
|
73
|
-
/**
|
|
74
|
-
* Convert database row to BlobMetadata
|
|
75
|
-
*/
|
|
76
|
-
private rowToMetadata;
|
|
77
|
-
/**
|
|
78
|
-
* Validate blob key
|
|
79
|
-
* Keys must be alphanumeric with hyphens and underscores only
|
|
80
|
-
*/
|
|
81
|
-
private validateKey;
|
|
82
|
-
}
|