@vite-hub/workspace 0.0.4 → 0.3.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 +339 -115
- package/dist/abort-BCwpdrN0.js +32 -0
- package/dist/{asset-registry-8QI3ML3K.js → asset-registry-DfBV5kmw.js} +3 -2
- package/dist/blob-database.d.ts +474 -0
- package/dist/blob-database.js +608 -0
- package/dist/checkout.d.ts +128 -0
- package/dist/checkout.js +849 -0
- package/dist/cloudflare.d.ts +6 -7
- package/dist/cloudflare.js +1 -1
- package/dist/config-B-863EgC.js +15 -0
- package/dist/config-BAgL2dtB.js +1076 -0
- package/dist/{config-DE9xlaIw.d.ts → config-BQKcPawI.d.ts} +1 -2
- package/dist/discard-CNNtCozM.js +8 -0
- package/dist/durability.d.ts +22 -0
- package/dist/durability.js +70 -0
- package/dist/error-diagnostics-CtKjGtGb.js +188 -0
- package/dist/error-diagnostics-DSkCJC_L.js +266 -0
- package/dist/file-2pFYNtsU.js +22 -0
- package/dist/{files-Q6xZjDHA.js → files-BOo4SbwE.js} +3 -3
- package/dist/files.d.ts +38 -0
- package/dist/files.js +6 -0
- package/dist/{github-DHnjxQIX.js → github-CrYp4v8k.js} +44 -24
- package/dist/glob-B8YGvTrZ.js +21 -0
- package/dist/glob-Cjxms1t7.js +30 -0
- package/dist/{host-DJH8cuoU.js → host-BFBpXn0N.js} +144 -77
- package/dist/{hosted-RPeJOCFz.js → hosted-KcUR_jPv.js} +303 -97
- package/dist/hosted-vercel-blob-B3-wRdUm.js +410 -0
- package/dist/hosted-vercel-blob.d.ts +6 -7
- package/dist/hosted-vercel-blob.js +1 -1
- package/dist/hosted.d.ts +10 -9
- package/dist/hosted.js +2 -2
- package/dist/index.d.ts +26 -47
- package/dist/index.js +30 -100
- package/dist/internal/path.d.ts +2 -0
- package/dist/internal/path.js +2 -0
- package/dist/lifecycle-B-enk_4A.js +596 -0
- package/dist/lineage.d.ts +26 -0
- package/dist/lineage.js +76 -0
- package/dist/loader.d.ts +5 -6
- package/dist/loader.js +3 -2
- package/dist/mcp-resources-DF0F5rcL.js +39 -0
- package/dist/memory-BOexthyW.js +247 -0
- package/dist/metadata-target-CWz6KHKq.js +1589 -0
- package/dist/object-Da1zyPCR.js +11 -0
- package/dist/operation-definition-8gOe-ubD.d.ts +234 -0
- package/dist/operations-C6FpR8Rr.js +389 -0
- package/dist/operations-CE2drFih.js +1234 -0
- package/dist/operations.d.ts +90 -0
- package/dist/operations.js +3 -0
- package/dist/path--wrT_Azm.js +113 -0
- package/dist/path-AxMho1wo.d.ts +7 -0
- package/dist/path-DrSIenjj.js +59 -0
- package/dist/path-zHxQUbqa.d.ts +9 -0
- package/dist/plugins-C8C0auoW.d.ts +10 -0
- package/dist/provider-9s4Ufkm5.js +1479 -0
- package/dist/providers/github/store.d.ts +3 -5
- package/dist/providers/github/store.js +1 -1
- package/dist/registry-B3BBm4Ts.d.ts +19 -0
- package/dist/{registry-D3yzt8HQ.js → registry-CNphafBx.js} +60 -23
- package/dist/registry-CYNN623b.d.ts +9 -0
- package/dist/request-scope-Dw5n8bMC.js +83 -0
- package/dist/results-DgkZUmTL.js +8 -0
- package/dist/{chunk-2rV9d50f.js → rolldown-runtime-rQ84J-ij.js} +3 -4
- package/dist/runtime/assets.d.ts +3 -5
- package/dist/runtime/assets.js +7 -6
- package/dist/runtime/empty-assets-registry.d.ts +1 -2
- package/dist/runtime/empty-registry.d.ts +2 -2
- package/dist/runtime/registry.d.ts +2 -0
- package/dist/runtime/registry.js +23 -0
- package/dist/runtime/request.d.ts +4 -0
- package/dist/runtime/request.js +8 -0
- package/dist/runtime/state.d.ts +5 -4
- package/dist/runtime/state.js +8 -18
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime.d.ts +52 -17
- package/dist/runtime.js +324 -67
- package/dist/{search-BpiCF2Tw.js → search-C_RfoM2j.js} +10 -9
- package/dist/server-8tGltlGz.js +303 -0
- package/dist/server.d.ts +36 -39
- package/dist/server.js +2 -328
- package/dist/shared-B3_EUk89.js +848 -0
- package/dist/source-metadata.d.ts +10 -7
- package/dist/source-metadata.js +12 -12
- package/dist/state-BISnUf1s.d.ts +35 -0
- package/dist/{ai-BqCC8BpY.js → state-DbrW-njQ.js} +237 -114
- package/dist/store-ybhyD38Z.js +1873 -0
- package/dist/{sync-DnTQwt8r.js → sync-CCD_VYC8.js} +61 -41
- package/dist/target-jWhTdIuF.js +89 -0
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/{types-CYuwjJ4V.d.ts → types-BbtwmBZ5.d.ts} +321 -35
- package/dist/use-C6lV3-wC.d.ts +321 -0
- package/dist/{use-BTNDR5Rd.js → use-CSpT5W87.js} +141 -107
- package/dist/utils-CgMZCHsX.js +616 -0
- package/dist/vite.d.ts +585 -2
- package/dist/vite.js +21369 -2
- package/dist/workspace-CYB2xZ1T.d.ts +7 -0
- package/dist/{workspace-Dq08Yn72.js → workspace-sPWn2Jxj.js} +441 -225
- package/package.json +97 -72
- package/dist/ai-CjxvGqM0.d.ts +0 -162
- package/dist/ai.d.ts +0 -3
- package/dist/ai.js +0 -2
- package/dist/collections/client.d.ts +0 -39
- package/dist/collections/client.js +0 -137
- package/dist/collections.d.ts +0 -59
- package/dist/collections.js +0 -159
- package/dist/config-Bc3c4Su1.js +0 -7904
- package/dist/config-CHLLWklZ.js +0 -36
- package/dist/file-Bc1X7pco.js +0 -23
- package/dist/glob-CEZKeZFC.js +0 -18
- package/dist/hosted-vercel-blob-d6C8ND5j.js +0 -23580
- package/dist/lifecycle-LrL3sA4n.js +0 -316
- package/dist/metadata-target-B0tOmVW7.js +0 -717
- package/dist/mountx.d.ts +0 -10
- package/dist/mountx.js +0 -143
- package/dist/nitro.d.ts +0 -2
- package/dist/nitro.js +0 -2
- package/dist/nuxt.d.ts +0 -26
- package/dist/nuxt.js +0 -42
- package/dist/path-Cp59koVz.js +0 -139
- package/dist/provider-B1yLjCJJ.js +0 -746
- package/dist/publish.d.ts +0 -35
- package/dist/publish.js +0 -112
- package/dist/registry-Uj6IVxes.d.ts +0 -11
- package/dist/request-execution-B-dSFlGB.js +0 -84
- package/dist/runtime-options-BsPSv5O7.js +0 -13
- package/dist/runtime-type-iEE6BjQJ.js +0 -34
- package/dist/shared-DTR1Hhma.js +0 -331
- package/dist/state-tYcRWEh2.d.ts +0 -26
- package/dist/store-Dt_Jyys3.js +0 -608
- package/dist/target-D4Bqb1eH.js +0 -11
- package/dist/token-CVzURBxC.js +0 -61
- package/dist/use-BiHzt0xA.d.ts +0 -103
- package/dist/vite-BptCrpv2.js +0 -4526
- package/dist/vite-CtA9guIM.d.ts +0 -66
- package/dist/workspace-Xddf4G1B.d.ts +0 -6
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/workspace",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Agent-oriented filesystem state and Vite integration for ViteHub.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"ai-agents",
|
|
6
7
|
"cloudflare",
|
|
8
|
+
"filesystem",
|
|
9
|
+
"nuxt",
|
|
10
|
+
"typescript",
|
|
7
11
|
"vercel",
|
|
8
12
|
"vite",
|
|
9
13
|
"vitehub",
|
|
10
14
|
"workspace"
|
|
11
15
|
],
|
|
12
|
-
"homepage": "https://
|
|
16
|
+
"homepage": "https://vitehub.dev",
|
|
13
17
|
"bugs": "https://github.com/vite-hub/vitehub/issues",
|
|
14
18
|
"license": "Apache-2.0",
|
|
15
19
|
"author": "onmax <maximogarciamtnez@gmail.com>",
|
|
@@ -38,127 +42,145 @@
|
|
|
38
42
|
"exports": {
|
|
39
43
|
".": {
|
|
40
44
|
"types": "./dist/index.d.ts",
|
|
41
|
-
"import": "./dist/index.js"
|
|
45
|
+
"import": "./dist/index.js",
|
|
46
|
+
"default": "./dist/index.js"
|
|
42
47
|
},
|
|
43
|
-
"./
|
|
44
|
-
"types": "./dist/
|
|
45
|
-
"import": "./dist/
|
|
48
|
+
"./blob-database": {
|
|
49
|
+
"types": "./dist/blob-database.d.ts",
|
|
50
|
+
"import": "./dist/blob-database.js",
|
|
51
|
+
"default": "./dist/blob-database.js"
|
|
52
|
+
},
|
|
53
|
+
"./checkout": {
|
|
54
|
+
"types": "./dist/checkout.d.ts",
|
|
55
|
+
"import": "./dist/checkout.js",
|
|
56
|
+
"default": "./dist/checkout.js"
|
|
46
57
|
},
|
|
47
58
|
"./cloudflare": {
|
|
48
59
|
"types": "./dist/cloudflare.d.ts",
|
|
49
|
-
"import": "./dist/cloudflare.js"
|
|
50
|
-
|
|
51
|
-
"./collections": {
|
|
52
|
-
"types": "./dist/collections.d.ts",
|
|
53
|
-
"import": "./dist/collections.js"
|
|
54
|
-
},
|
|
55
|
-
"./collections/client": {
|
|
56
|
-
"types": "./dist/collections/client.d.ts",
|
|
57
|
-
"import": "./dist/collections/client.js"
|
|
60
|
+
"import": "./dist/cloudflare.js",
|
|
61
|
+
"default": "./dist/cloudflare.js"
|
|
58
62
|
},
|
|
59
|
-
"./
|
|
60
|
-
"types": "./dist/
|
|
61
|
-
"import": "./dist/
|
|
63
|
+
"./durability": {
|
|
64
|
+
"types": "./dist/durability.d.ts",
|
|
65
|
+
"import": "./dist/durability.js",
|
|
66
|
+
"default": "./dist/durability.js"
|
|
62
67
|
},
|
|
63
|
-
"./
|
|
64
|
-
"types": "./dist/
|
|
65
|
-
"import": "./dist/
|
|
68
|
+
"./files": {
|
|
69
|
+
"types": "./dist/files.d.ts",
|
|
70
|
+
"import": "./dist/files.js",
|
|
71
|
+
"default": "./dist/files.js"
|
|
66
72
|
},
|
|
67
|
-
"./
|
|
68
|
-
"types": "./dist/
|
|
69
|
-
"import": "./dist/
|
|
73
|
+
"./internal/path": {
|
|
74
|
+
"types": "./dist/internal/path.d.ts",
|
|
75
|
+
"import": "./dist/internal/path.js",
|
|
76
|
+
"default": "./dist/internal/path.js"
|
|
70
77
|
},
|
|
71
|
-
"./
|
|
72
|
-
"types": "./dist/
|
|
73
|
-
"import": "./dist/
|
|
78
|
+
"./lineage": {
|
|
79
|
+
"types": "./dist/lineage.d.ts",
|
|
80
|
+
"import": "./dist/lineage.js",
|
|
81
|
+
"default": "./dist/lineage.js"
|
|
74
82
|
},
|
|
75
|
-
"./
|
|
76
|
-
"types": "./dist/
|
|
77
|
-
"import": "./dist/
|
|
83
|
+
"./loader": {
|
|
84
|
+
"types": "./dist/loader.d.ts",
|
|
85
|
+
"import": "./dist/loader.js",
|
|
86
|
+
"default": "./dist/loader.js"
|
|
78
87
|
},
|
|
79
88
|
"./runtime": {
|
|
80
89
|
"types": "./dist/runtime.d.ts",
|
|
81
|
-
"import": "./dist/runtime.js"
|
|
90
|
+
"import": "./dist/runtime.js",
|
|
91
|
+
"default": "./dist/runtime.js"
|
|
82
92
|
},
|
|
83
93
|
"./server": {
|
|
84
94
|
"types": "./dist/server.d.ts",
|
|
85
|
-
"import": "./dist/server.js"
|
|
95
|
+
"import": "./dist/server.js",
|
|
96
|
+
"default": "./dist/server.js"
|
|
86
97
|
},
|
|
87
98
|
"./source-metadata": {
|
|
88
99
|
"types": "./dist/source-metadata.d.ts",
|
|
89
|
-
"import": "./dist/source-metadata.js"
|
|
100
|
+
"import": "./dist/source-metadata.js",
|
|
101
|
+
"default": "./dist/source-metadata.js"
|
|
90
102
|
},
|
|
91
103
|
"./test": {
|
|
92
104
|
"types": "./dist/test.d.ts",
|
|
93
|
-
"import": "./dist/test.js"
|
|
105
|
+
"import": "./dist/test.js",
|
|
106
|
+
"default": "./dist/test.js"
|
|
94
107
|
},
|
|
95
108
|
"./vite": {
|
|
96
109
|
"types": "./dist/vite.d.ts",
|
|
97
|
-
"import": "./dist/vite.js"
|
|
110
|
+
"import": "./dist/vite.js",
|
|
111
|
+
"default": "./dist/vite.js"
|
|
98
112
|
},
|
|
99
113
|
"./package.json": "./package.json",
|
|
100
114
|
"./internal/runtime/assets": {
|
|
101
115
|
"types": "./dist/runtime/assets.d.ts",
|
|
102
|
-
"import": "./dist/runtime/assets.js"
|
|
116
|
+
"import": "./dist/runtime/assets.js",
|
|
117
|
+
"default": "./dist/runtime/assets.js"
|
|
103
118
|
},
|
|
104
119
|
"./internal/runtime/hosted": {
|
|
105
120
|
"types": "./dist/hosted.d.ts",
|
|
106
|
-
"import": "./dist/hosted.js"
|
|
121
|
+
"import": "./dist/hosted.js",
|
|
122
|
+
"default": "./dist/hosted.js"
|
|
107
123
|
},
|
|
108
124
|
"./internal/runtime/hosted-vercel-blob": {
|
|
109
125
|
"types": "./dist/hosted-vercel-blob.d.ts",
|
|
110
|
-
"import": "./dist/hosted-vercel-blob.js"
|
|
111
|
-
|
|
112
|
-
"./internal/runtime/state": {
|
|
113
|
-
"types": "./dist/runtime/state.d.ts",
|
|
114
|
-
"import": "./dist/runtime/state.js"
|
|
126
|
+
"import": "./dist/hosted-vercel-blob.js",
|
|
127
|
+
"default": "./dist/hosted-vercel-blob.js"
|
|
115
128
|
},
|
|
116
129
|
"./internal/runtime/workspace": {
|
|
117
130
|
"types": "./dist/runtime/workspace.d.ts",
|
|
118
|
-
"import": "./dist/runtime/workspace.js"
|
|
131
|
+
"import": "./dist/runtime/workspace.js",
|
|
132
|
+
"default": "./dist/runtime/workspace.js"
|
|
119
133
|
},
|
|
120
134
|
"./internal/stores/github": {
|
|
121
135
|
"types": "./dist/providers/github/store.d.ts",
|
|
122
|
-
"import": "./dist/providers/github/store.js"
|
|
136
|
+
"import": "./dist/providers/github/store.js",
|
|
137
|
+
"default": "./dist/providers/github/store.js"
|
|
123
138
|
}
|
|
124
139
|
},
|
|
125
140
|
"dependencies": {
|
|
126
|
-
"@
|
|
127
|
-
"@vercel/nft": "^1.
|
|
128
|
-
"@vite-hub/
|
|
129
|
-
"@vite-hub/
|
|
130
|
-
"
|
|
141
|
+
"@valibot/to-json-schema": "^1.8.0",
|
|
142
|
+
"@vercel/nft": "^1.11.0",
|
|
143
|
+
"@vite-hub/runtime": "0.3.0",
|
|
144
|
+
"@vite-hub/source": "0.3.0",
|
|
145
|
+
"birpc": "^4.2.0",
|
|
131
146
|
"defu": "^6.1.7",
|
|
132
|
-
"esbuild": "^0.
|
|
133
|
-
"exsolve": "^1.1.
|
|
134
|
-
"
|
|
135
|
-
"isomorphic-git": "^1.38.7",
|
|
147
|
+
"esbuild": "^0.28.2",
|
|
148
|
+
"exsolve": "^1.1.3",
|
|
149
|
+
"isomorphic-git": "^1.44.10",
|
|
136
150
|
"jiti": "^2.7.0",
|
|
137
|
-
"mountx": "0.0.2",
|
|
138
151
|
"minimatch": "^10.2.6",
|
|
139
152
|
"mrmime": "^2.0.1",
|
|
140
|
-
"
|
|
153
|
+
"nostics": "1.4.0",
|
|
154
|
+
"valibot": "^1.5.0",
|
|
155
|
+
"yaml": "^2.9.1",
|
|
156
|
+
"@vite-hub/markdown-template": "0.3.0",
|
|
157
|
+
"@vite-hub/blob": "0.3.0",
|
|
158
|
+
"@vite-hub/database": "0.3.0",
|
|
159
|
+
"@vite-hub/sandbox": "0.3.0"
|
|
141
160
|
},
|
|
142
161
|
"devDependencies": {
|
|
143
|
-
"@types/node": "^24.
|
|
162
|
+
"@types/node": "^24.19.1",
|
|
144
163
|
"@vercel/blob": "^2.8.0",
|
|
145
|
-
"@vite-hub/env": "0.0
|
|
146
|
-
"@vite-hub/
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
164
|
+
"@vite-hub/env": "0.3.0",
|
|
165
|
+
"@vite-hub/forge": "0.3.0",
|
|
166
|
+
"@vite-hub/internal": "0.0.1",
|
|
167
|
+
"@vite-hub/shell": "0.3.0",
|
|
168
|
+
"ai": "7.0.130",
|
|
169
|
+
"publint": "^0.3.25",
|
|
150
170
|
"typescript": "^6.0.3",
|
|
151
|
-
"vite": "^8.
|
|
152
|
-
"vite-plus": "^0.
|
|
153
|
-
"vitest": "^4.1.
|
|
154
|
-
"
|
|
155
|
-
"
|
|
171
|
+
"vite": "^8.2.2",
|
|
172
|
+
"vite-plus": "^0.3.3",
|
|
173
|
+
"vitest": "^4.1.11",
|
|
174
|
+
"drizzle-orm": "1.0.0-rc.5",
|
|
175
|
+
"miniflare": "4.20260730.0",
|
|
176
|
+
"@libsql/client": "^0.18.0"
|
|
156
177
|
},
|
|
157
178
|
"peerDependencies": {
|
|
158
|
-
"@vite-hub/shell": "0.0
|
|
179
|
+
"@vite-hub/shell": "0.3.0",
|
|
159
180
|
"ai": "^6.0.0 || ^7.0.0-0",
|
|
160
181
|
"vite": ">=8.0.0",
|
|
161
|
-
"
|
|
182
|
+
"drizzle-orm": "1.0.0-rc.5 || ^1.0.0",
|
|
183
|
+
"@vite-hub/forge": "0.3.0"
|
|
162
184
|
},
|
|
163
185
|
"peerDependenciesMeta": {
|
|
164
186
|
"@vite-hub/shell": {
|
|
@@ -167,17 +189,20 @@
|
|
|
167
189
|
"vite": {
|
|
168
190
|
"optional": true
|
|
169
191
|
},
|
|
170
|
-
"
|
|
192
|
+
"drizzle-orm": {
|
|
193
|
+
"optional": true
|
|
194
|
+
},
|
|
195
|
+
"@vite-hub/forge": {
|
|
171
196
|
"optional": true
|
|
172
197
|
}
|
|
173
198
|
},
|
|
174
199
|
"engines": {
|
|
175
|
-
"node": ">=
|
|
200
|
+
"node": ">=22.18.0"
|
|
176
201
|
},
|
|
177
202
|
"scripts": {
|
|
178
203
|
"build": "vp pack",
|
|
179
204
|
"dev": "vp pack --watch",
|
|
180
|
-
"typecheck": "
|
|
181
|
-
"test": "vp run -t @vite-hub/workspace#build && vp test"
|
|
205
|
+
"typecheck": "vp run --cache -t @vite-hub/workspace#build && node ../../test/package-typecheck.mjs --noEmit -p ./tsconfig.json",
|
|
206
|
+
"test": "vp run --cache -t @vite-hub/workspace#build && vp test"
|
|
182
207
|
}
|
|
183
208
|
}
|
package/dist/ai-CjxvGqM0.d.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { D as WorkspaceAssets, T as Workspace, tt as WorkspaceMaterializeSourcesResult } from "./types-CYuwjJ4V.js";
|
|
2
|
-
import { Tool, ToolSet } from "ai";
|
|
3
|
-
|
|
4
|
-
//#region src/ai.d.ts
|
|
5
|
-
type ShellObservationEvent = "command_finished" | "command_timed_out" | "policy_denied" | "session_disposed";
|
|
6
|
-
interface ShellRuntimeExecOptions {
|
|
7
|
-
cwd?: string;
|
|
8
|
-
env?: Record<string, string>;
|
|
9
|
-
onStderr?: (chunk: string) => void;
|
|
10
|
-
onStdout?: (chunk: string) => void;
|
|
11
|
-
stdin?: string;
|
|
12
|
-
timeout?: number;
|
|
13
|
-
workspacePaths?: string[];
|
|
14
|
-
}
|
|
15
|
-
interface ShellObservation {
|
|
16
|
-
command?: string;
|
|
17
|
-
cwd?: string;
|
|
18
|
-
durationMs?: number;
|
|
19
|
-
event: ShellObservationEvent;
|
|
20
|
-
exitCode: number | null;
|
|
21
|
-
maxOutputLength?: number;
|
|
22
|
-
outputTruncated?: boolean;
|
|
23
|
-
stderr: string;
|
|
24
|
-
stdout: string;
|
|
25
|
-
timedOut?: boolean;
|
|
26
|
-
workspaceGuardrail?: {
|
|
27
|
-
kind: "broad_search" | "missing_path" | "no_match" | "timeout";
|
|
28
|
-
path?: string;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
interface ShellAnalyzeOptions {
|
|
32
|
-
maxInputBytes?: number;
|
|
33
|
-
timeoutMs?: number;
|
|
34
|
-
}
|
|
35
|
-
interface ShellAnalyzeResult {
|
|
36
|
-
commands?: string[];
|
|
37
|
-
error?: string;
|
|
38
|
-
hasCommandSubstitution?: boolean;
|
|
39
|
-
hasHeredocs?: boolean;
|
|
40
|
-
hasPipelines?: boolean;
|
|
41
|
-
hasRedirects?: boolean;
|
|
42
|
-
ok: boolean;
|
|
43
|
-
parser: "sh-syntax";
|
|
44
|
-
}
|
|
45
|
-
interface ShellProcess {
|
|
46
|
-
id: string;
|
|
47
|
-
command: string;
|
|
48
|
-
cwd?: string;
|
|
49
|
-
stop(): Promise<ShellObservation>;
|
|
50
|
-
}
|
|
51
|
-
interface ShellBoundary {
|
|
52
|
-
cwd: boolean;
|
|
53
|
-
env: boolean;
|
|
54
|
-
filesystem: {
|
|
55
|
-
mountPoint?: string;
|
|
56
|
-
writable: boolean;
|
|
57
|
-
};
|
|
58
|
-
network: boolean | "unknown";
|
|
59
|
-
processes: {
|
|
60
|
-
background: boolean;
|
|
61
|
-
interactive: boolean;
|
|
62
|
-
};
|
|
63
|
-
streaming: boolean;
|
|
64
|
-
timeout: {
|
|
65
|
-
enforcedBy: "provider" | "runtime" | "unsupported";
|
|
66
|
-
supported: boolean;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
interface ShellExecutionProvider {
|
|
70
|
-
analyze?: (command: string, options?: ShellAnalyzeOptions) => Promise<ShellAnalyzeResult>;
|
|
71
|
-
boundary: ShellBoundary;
|
|
72
|
-
exec(command: string, options?: ShellRuntimeExecOptions): Promise<ShellObservation>;
|
|
73
|
-
startProcess?: (command: string, options?: ShellRuntimeExecOptions) => Promise<ShellProcess>;
|
|
74
|
-
}
|
|
75
|
-
interface ShellSessionPolicy {
|
|
76
|
-
maxOutputLength?: number;
|
|
77
|
-
maxShellCalls?: number;
|
|
78
|
-
timeout?: number;
|
|
79
|
-
}
|
|
80
|
-
type WorkspaceShellResult = ShellObservation;
|
|
81
|
-
interface WorkspacePathResult {
|
|
82
|
-
path: string;
|
|
83
|
-
}
|
|
84
|
-
interface WorkspaceMoveResult {
|
|
85
|
-
from: string;
|
|
86
|
-
to: string;
|
|
87
|
-
}
|
|
88
|
-
interface WorkspaceReadOperations {
|
|
89
|
-
list?: boolean;
|
|
90
|
-
materialize?: boolean;
|
|
91
|
-
read?: boolean;
|
|
92
|
-
search?: boolean;
|
|
93
|
-
}
|
|
94
|
-
interface WorkspaceWriteOperations {
|
|
95
|
-
appendFile?: boolean;
|
|
96
|
-
copyPath?: boolean;
|
|
97
|
-
deletePath?: boolean;
|
|
98
|
-
makeDir?: boolean;
|
|
99
|
-
movePath?: boolean;
|
|
100
|
-
writeFile?: boolean;
|
|
101
|
-
}
|
|
102
|
-
type WorkspaceToolOperations = WorkspaceReadOperations & {
|
|
103
|
-
write?: true | WorkspaceWriteOperations;
|
|
104
|
-
};
|
|
105
|
-
interface WorkspaceToolOptions<Operations extends WorkspaceToolOperations | undefined = undefined> extends Pick<ShellSessionPolicy, "maxOutputLength" | "maxShellCalls" | "timeout"> {
|
|
106
|
-
broadSearchPaths?: string[];
|
|
107
|
-
cwd?: string;
|
|
108
|
-
executionProvider?: ShellExecutionProvider | (() => MaybePromise<ShellExecutionProvider | undefined>);
|
|
109
|
-
operations?: Operations;
|
|
110
|
-
}
|
|
111
|
-
type EnabledReadCapability<Operations, Key extends keyof WorkspaceReadOperations> = Operations extends Record<Key, infer Value> ? Value extends false ? false : true : true;
|
|
112
|
-
type ShellEnabled<Operations> = true extends EnabledReadCapability<Operations, "list"> | EnabledReadCapability<Operations, "read"> | EnabledReadCapability<Operations, "search"> ? true : false;
|
|
113
|
-
type ResolvedWriteOperations<Operations> = Operations extends {
|
|
114
|
-
write: infer Write;
|
|
115
|
-
} ? Write : false;
|
|
116
|
-
type WorkspaceWriteToolMap = {
|
|
117
|
-
appendFile: Tool<{
|
|
118
|
-
content: string;
|
|
119
|
-
path: string;
|
|
120
|
-
}, WorkspacePathResult>;
|
|
121
|
-
copyPath: Tool<{
|
|
122
|
-
from: string;
|
|
123
|
-
overwrite?: boolean;
|
|
124
|
-
to: string;
|
|
125
|
-
}, WorkspaceMoveResult>;
|
|
126
|
-
deletePath: Tool<{
|
|
127
|
-
force?: boolean;
|
|
128
|
-
path: string;
|
|
129
|
-
recursive?: boolean;
|
|
130
|
-
}, WorkspacePathResult>;
|
|
131
|
-
makeDir: Tool<{
|
|
132
|
-
path: string;
|
|
133
|
-
recursive?: boolean;
|
|
134
|
-
}, WorkspacePathResult>;
|
|
135
|
-
movePath: Tool<{
|
|
136
|
-
from: string;
|
|
137
|
-
overwrite?: boolean;
|
|
138
|
-
to: string;
|
|
139
|
-
}, WorkspaceMoveResult>;
|
|
140
|
-
writeFile: Tool<{
|
|
141
|
-
content: string;
|
|
142
|
-
mediaType?: string;
|
|
143
|
-
path: string;
|
|
144
|
-
}, WorkspacePathResult>;
|
|
145
|
-
};
|
|
146
|
-
type EnabledWriteTools<Selection> = Selection extends true ? WorkspaceWriteToolMap : Selection extends WorkspaceWriteOperations ? { [Key in keyof WorkspaceWriteToolMap as Key extends keyof Selection ? Selection[Key] extends true ? Key : never : never]: WorkspaceWriteToolMap[Key] } : {};
|
|
147
|
-
type WorkspaceTools<Operations = undefined> = ((ShellEnabled<Operations> extends true ? {
|
|
148
|
-
shell: Tool<{
|
|
149
|
-
command: string;
|
|
150
|
-
}, WorkspaceShellResult>;
|
|
151
|
-
} : {}) & EnabledWriteTools<ResolvedWriteOperations<Operations>> & (Operations extends {
|
|
152
|
-
materialize: true;
|
|
153
|
-
} ? {
|
|
154
|
-
materialize_sources: Tool<{
|
|
155
|
-
path?: string;
|
|
156
|
-
sources?: string[];
|
|
157
|
-
}, WorkspaceMaterializeSourcesResult>;
|
|
158
|
-
} : {})) & ToolSet;
|
|
159
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
160
|
-
declare function createWorkspaceTools<Operations extends WorkspaceToolOperations | undefined = undefined>(input: Workspace | WorkspaceAssets, options?: WorkspaceToolOptions<Operations>): WorkspaceTools<Operations>;
|
|
161
|
-
//#endregion
|
|
162
|
-
export { WorkspaceReadOperations as a, WorkspaceToolOptions as c, WorkspaceWriteToolMap as d, createWorkspaceTools as f, WorkspacePathResult as i, WorkspaceTools as l, ShellEnabled as n, WorkspaceShellResult as o, WorkspaceMoveResult as r, WorkspaceToolOperations as s, EnabledReadCapability as t, WorkspaceWriteOperations as u };
|
package/dist/ai.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { tt as WorkspaceMaterializeSourcesResult } from "./types-CYuwjJ4V.js";
|
|
2
|
-
import { a as WorkspaceReadOperations, c as WorkspaceToolOptions, d as WorkspaceWriteToolMap, f as createWorkspaceTools, i as WorkspacePathResult, l as WorkspaceTools, n as ShellEnabled, o as WorkspaceShellResult, r as WorkspaceMoveResult, s as WorkspaceToolOperations, t as EnabledReadCapability, u as WorkspaceWriteOperations } from "./ai-CjxvGqM0.js";
|
|
3
|
-
export { EnabledReadCapability, ShellEnabled, type WorkspaceMaterializeSourcesResult, WorkspaceMoveResult, WorkspacePathResult, WorkspaceReadOperations, WorkspaceShellResult, WorkspaceToolOperations, WorkspaceToolOptions, WorkspaceTools, WorkspaceWriteOperations, WorkspaceWriteToolMap, createWorkspaceTools };
|
package/dist/ai.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { WorkspaceCollectionItem, WorkspaceCollectionPage } from "../collections.js";
|
|
2
|
-
import { ComputedRef, MaybeRefOrGetter, Ref } from "vue";
|
|
3
|
-
|
|
4
|
-
//#region src/collections/client.d.ts
|
|
5
|
-
interface WorkspaceCollectionRequestOptions {
|
|
6
|
-
query?: Record<string, unknown>;
|
|
7
|
-
signal: AbortSignal;
|
|
8
|
-
}
|
|
9
|
-
type WorkspaceCollectionRequester = <T>(endpoint: string, options: WorkspaceCollectionRequestOptions) => Promise<T>;
|
|
10
|
-
interface UseWorkspaceCollectionOptions {
|
|
11
|
-
immediate?: boolean;
|
|
12
|
-
limit?: number;
|
|
13
|
-
query?: MaybeRefOrGetter<Record<string, unknown>>;
|
|
14
|
-
request?: WorkspaceCollectionRequester;
|
|
15
|
-
}
|
|
16
|
-
interface UseWorkspaceCollectionReturn<T> {
|
|
17
|
-
error: Ref<unknown>;
|
|
18
|
-
facets: Ref<WorkspaceCollectionPage<T>["facets"]>;
|
|
19
|
-
hasMore: ComputedRef<boolean>;
|
|
20
|
-
items: Ref<T[]>;
|
|
21
|
-
loadMore: () => Promise<WorkspaceCollectionPage<T> | undefined>;
|
|
22
|
-
pending: Ref<boolean>;
|
|
23
|
-
refresh: () => Promise<WorkspaceCollectionPage<T> | undefined>;
|
|
24
|
-
total: Ref<number>;
|
|
25
|
-
}
|
|
26
|
-
interface UseWorkspaceCollectionItemOptions {
|
|
27
|
-
immediate?: boolean;
|
|
28
|
-
request?: WorkspaceCollectionRequester;
|
|
29
|
-
}
|
|
30
|
-
interface UseWorkspaceCollectionItemReturn<T> {
|
|
31
|
-
data: Ref<T | null>;
|
|
32
|
-
error: Ref<unknown>;
|
|
33
|
-
pending: Ref<boolean>;
|
|
34
|
-
refresh: () => Promise<WorkspaceCollectionItem<T> | undefined>;
|
|
35
|
-
}
|
|
36
|
-
declare function useWorkspaceCollection<T = Record<string, unknown>>(endpoint: string, options?: UseWorkspaceCollectionOptions): UseWorkspaceCollectionReturn<T>;
|
|
37
|
-
declare function useWorkspaceCollectionItem<T = Record<string, unknown>>(endpoint: string, value: MaybeRefOrGetter<string | undefined>, options?: UseWorkspaceCollectionItemOptions): UseWorkspaceCollectionItemReturn<T>;
|
|
38
|
-
//#endregion
|
|
39
|
-
export { UseWorkspaceCollectionItemOptions, UseWorkspaceCollectionItemReturn, UseWorkspaceCollectionOptions, UseWorkspaceCollectionReturn, WorkspaceCollectionRequestOptions, WorkspaceCollectionRequester, useWorkspaceCollection, useWorkspaceCollectionItem };
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { $fetch } from "ofetch";
|
|
2
|
-
import { computed, onScopeDispose, ref, toValue, watch } from "vue";
|
|
3
|
-
//#region src/collections/client.ts
|
|
4
|
-
const defaultRequester = async (endpoint, options) => {
|
|
5
|
-
return await $fetch(endpoint, options);
|
|
6
|
-
};
|
|
7
|
-
function isAbortError(error) {
|
|
8
|
-
return Boolean(error && typeof error === "object" && "name" in error && error.name === "AbortError");
|
|
9
|
-
}
|
|
10
|
-
function isStaleCursorError(error) {
|
|
11
|
-
if (!error || typeof error !== "object") return false;
|
|
12
|
-
return ("statusCode" in error ? error.statusCode : "status" in error ? error.status : void 0) === 409;
|
|
13
|
-
}
|
|
14
|
-
function useWorkspaceCollection(endpoint, options = {}) {
|
|
15
|
-
const items = ref([]);
|
|
16
|
-
const facets = ref({});
|
|
17
|
-
const total = ref(0);
|
|
18
|
-
const nextCursor = ref(null);
|
|
19
|
-
const pending = ref(false);
|
|
20
|
-
const error = ref(null);
|
|
21
|
-
const request = options.request || defaultRequester;
|
|
22
|
-
let active;
|
|
23
|
-
let loaded = false;
|
|
24
|
-
async function load(reset) {
|
|
25
|
-
if (!reset && (pending.value || loaded && !nextCursor.value)) return;
|
|
26
|
-
active?.abort();
|
|
27
|
-
const controller = new AbortController();
|
|
28
|
-
active = controller;
|
|
29
|
-
pending.value = true;
|
|
30
|
-
error.value = null;
|
|
31
|
-
try {
|
|
32
|
-
const response = await request(endpoint, {
|
|
33
|
-
query: {
|
|
34
|
-
...options.query ? toValue(options.query) : {},
|
|
35
|
-
cursor: reset ? void 0 : nextCursor.value || void 0,
|
|
36
|
-
limit: options.limit
|
|
37
|
-
},
|
|
38
|
-
signal: controller.signal
|
|
39
|
-
});
|
|
40
|
-
if (active !== controller) return;
|
|
41
|
-
items.value = reset ? response.items : [...items.value, ...response.items];
|
|
42
|
-
facets.value = response.facets;
|
|
43
|
-
total.value = response.total;
|
|
44
|
-
nextCursor.value = response.nextCursor;
|
|
45
|
-
loaded = true;
|
|
46
|
-
return response;
|
|
47
|
-
} catch (cause) {
|
|
48
|
-
if (active !== controller || isAbortError(cause)) return;
|
|
49
|
-
if (!reset && isStaleCursorError(cause)) return await load(true);
|
|
50
|
-
error.value = cause;
|
|
51
|
-
} finally {
|
|
52
|
-
if (active === controller) {
|
|
53
|
-
active = void 0;
|
|
54
|
-
pending.value = false;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const stop = watch(() => options.query ? toValue(options.query) : void 0, () => {
|
|
59
|
-
load(true);
|
|
60
|
-
}, {
|
|
61
|
-
deep: true,
|
|
62
|
-
immediate: options.immediate !== false && (options.request !== void 0 || "window" in globalThis)
|
|
63
|
-
});
|
|
64
|
-
onScopeDispose(() => {
|
|
65
|
-
stop();
|
|
66
|
-
active?.abort();
|
|
67
|
-
active = void 0;
|
|
68
|
-
pending.value = false;
|
|
69
|
-
});
|
|
70
|
-
return {
|
|
71
|
-
error,
|
|
72
|
-
facets,
|
|
73
|
-
hasMore: computed(() => Boolean(nextCursor.value)),
|
|
74
|
-
items,
|
|
75
|
-
loadMore: () => load(false),
|
|
76
|
-
pending,
|
|
77
|
-
refresh: () => load(true),
|
|
78
|
-
total
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function useWorkspaceCollectionItem(endpoint, value, options = {}) {
|
|
82
|
-
const data = ref(null);
|
|
83
|
-
const pending = ref(false);
|
|
84
|
-
const error = ref(null);
|
|
85
|
-
const request = options.request || defaultRequester;
|
|
86
|
-
let active;
|
|
87
|
-
async function refresh() {
|
|
88
|
-
const resolvedValue = toValue(value);
|
|
89
|
-
if (resolvedValue === void 0) {
|
|
90
|
-
active?.abort();
|
|
91
|
-
active = void 0;
|
|
92
|
-
data.value = null;
|
|
93
|
-
error.value = null;
|
|
94
|
-
pending.value = false;
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
active?.abort();
|
|
98
|
-
const controller = new AbortController();
|
|
99
|
-
active = controller;
|
|
100
|
-
pending.value = true;
|
|
101
|
-
error.value = null;
|
|
102
|
-
try {
|
|
103
|
-
const response = await request(endpoint, {
|
|
104
|
-
query: { value: resolvedValue },
|
|
105
|
-
signal: controller.signal
|
|
106
|
-
});
|
|
107
|
-
if (active !== controller) return;
|
|
108
|
-
data.value = response.item;
|
|
109
|
-
return response;
|
|
110
|
-
} catch (cause) {
|
|
111
|
-
if (active !== controller || isAbortError(cause)) return;
|
|
112
|
-
error.value = cause;
|
|
113
|
-
} finally {
|
|
114
|
-
if (active === controller) {
|
|
115
|
-
active = void 0;
|
|
116
|
-
pending.value = false;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
const stop = watch(() => toValue(value), () => {
|
|
121
|
-
refresh();
|
|
122
|
-
}, { immediate: options.immediate !== false && (options.request !== void 0 || "window" in globalThis) });
|
|
123
|
-
onScopeDispose(() => {
|
|
124
|
-
stop();
|
|
125
|
-
active?.abort();
|
|
126
|
-
active = void 0;
|
|
127
|
-
pending.value = false;
|
|
128
|
-
});
|
|
129
|
-
return {
|
|
130
|
-
data,
|
|
131
|
-
error,
|
|
132
|
-
pending,
|
|
133
|
-
refresh
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
//#endregion
|
|
137
|
-
export { useWorkspaceCollection, useWorkspaceCollectionItem };
|
package/dist/collections.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { it as WorkspaceName } from "./types-CYuwjJ4V.js";
|
|
2
|
-
import { i as ReadonlyWorkspaceFacade } from "./use-BiHzt0xA.js";
|
|
3
|
-
|
|
4
|
-
//#region src/collections.d.ts
|
|
5
|
-
interface WorkspaceCollectionEmptyFilter {
|
|
6
|
-
empty: true;
|
|
7
|
-
}
|
|
8
|
-
declare const workspaceCollectionEmpty: WorkspaceCollectionEmptyFilter;
|
|
9
|
-
type WorkspaceCollectionFilter = string | string[] | WorkspaceCollectionEmptyFilter;
|
|
10
|
-
interface WorkspaceCollectionSort {
|
|
11
|
-
direction?: "asc" | "desc";
|
|
12
|
-
field: string;
|
|
13
|
-
}
|
|
14
|
-
interface WorkspaceCollectionQuery {
|
|
15
|
-
cursor?: string;
|
|
16
|
-
facets?: string[];
|
|
17
|
-
filters?: Record<string, WorkspaceCollectionFilter | undefined>;
|
|
18
|
-
limit?: number;
|
|
19
|
-
search?: string;
|
|
20
|
-
searchFields?: string[];
|
|
21
|
-
select?: string[];
|
|
22
|
-
sort?: WorkspaceCollectionSort;
|
|
23
|
-
}
|
|
24
|
-
interface WorkspaceCollectionItemQuery {
|
|
25
|
-
key: string;
|
|
26
|
-
select?: string[];
|
|
27
|
-
value: string | number;
|
|
28
|
-
}
|
|
29
|
-
interface WorkspaceCollectionOptions<Name extends WorkspaceName = WorkspaceName> {
|
|
30
|
-
defaultLimit?: number;
|
|
31
|
-
maxLimit?: number;
|
|
32
|
-
path: string;
|
|
33
|
-
workspace: Name | ReadonlyWorkspaceFacade<Name> | Promise<ReadonlyWorkspaceFacade<Name>>;
|
|
34
|
-
}
|
|
35
|
-
interface WorkspaceCollectionPageOptions<Name extends WorkspaceName = WorkspaceName> extends WorkspaceCollectionOptions<Name> {
|
|
36
|
-
query?: WorkspaceCollectionQuery;
|
|
37
|
-
}
|
|
38
|
-
interface WorkspaceCollectionItemOptions<Name extends WorkspaceName = WorkspaceName> extends WorkspaceCollectionOptions<Name> {
|
|
39
|
-
query: WorkspaceCollectionItemQuery;
|
|
40
|
-
}
|
|
41
|
-
interface WorkspaceCollectionFacetValue {
|
|
42
|
-
count: number;
|
|
43
|
-
value: string;
|
|
44
|
-
}
|
|
45
|
-
interface WorkspaceCollectionPage<T = Record<string, unknown>> {
|
|
46
|
-
digest: string;
|
|
47
|
-
facets: Record<string, WorkspaceCollectionFacetValue[]>;
|
|
48
|
-
items: T[];
|
|
49
|
-
nextCursor: string | null;
|
|
50
|
-
total: number;
|
|
51
|
-
}
|
|
52
|
-
interface WorkspaceCollectionItem<T = Record<string, unknown>> {
|
|
53
|
-
digest: string;
|
|
54
|
-
item: T | null;
|
|
55
|
-
}
|
|
56
|
-
declare function queryWorkspaceCollection<T = Record<string, unknown>, Name extends WorkspaceName = WorkspaceName>(options: WorkspaceCollectionPageOptions<Name>): Promise<WorkspaceCollectionPage<T>>;
|
|
57
|
-
declare function getWorkspaceCollectionItem<T = Record<string, unknown>, Name extends WorkspaceName = WorkspaceName>(options: WorkspaceCollectionItemOptions<Name>): Promise<WorkspaceCollectionItem<T>>;
|
|
58
|
-
//#endregion
|
|
59
|
-
export { WorkspaceCollectionEmptyFilter, WorkspaceCollectionFacetValue, WorkspaceCollectionFilter, WorkspaceCollectionItem, WorkspaceCollectionItemOptions, WorkspaceCollectionItemQuery, WorkspaceCollectionOptions, WorkspaceCollectionPage, WorkspaceCollectionPageOptions, WorkspaceCollectionQuery, WorkspaceCollectionSort, getWorkspaceCollectionItem, queryWorkspaceCollection, workspaceCollectionEmpty };
|