@vite-hub/workspace 0.6.0 → 0.7.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 +5 -5
- package/dist/{asset-registry-0CdRAjIV.js → asset-registry-DJyE42kr.js} +1 -1
- package/dist/blob-database.d.ts +1 -1
- package/dist/blob-database.js +6 -6
- package/dist/checkout.js +2 -2
- package/dist/cloudflare.d.ts +1 -1
- package/dist/cloudflare.js +1 -1
- package/dist/{config-jo5QgE1w.js → config--ZzAvhMp.js} +14 -9
- package/dist/{config-DeA287c0.d.ts → config-DF6sqKXB.d.ts} +1 -1
- package/dist/durability.d.ts +1 -1
- package/dist/durability.js +2 -2
- package/dist/{error-diagnostics-B4me-ouV.js → error-diagnostics-CHgE8TQM.js} +16 -0
- package/dist/{error-diagnostics-kKXseq8d.js → error-diagnostics-CsiNo_oI.js} +3 -3
- package/dist/{file-BrNAXQgY.js → file-DQ5-TBTD.js} +1 -1
- package/dist/{file-metadata-Bpsvjw_X.js → file-metadata-Dqpldj0h.js} +7 -2
- package/dist/{files--z2dLC5z.js → files-D1UkSjzX.js} +2 -2
- package/dist/files.d.ts +5 -5
- package/dist/files.js +5 -5
- package/dist/{github-k--_LCrX.js → github-BECfOMaw.js} +4 -4
- package/dist/{glob-BreFjNAV.js → glob-BIg9O4yY.js} +2 -2
- package/dist/{glob-BEutagp1.js → glob-BIsxLusH.js} +1 -1
- package/dist/{host-C8yZizfk.js → host-BYBRcSnh.js} +7 -7
- package/dist/hosted-vercel-blob.d.ts +1 -1
- package/dist/hosted-vercel-blob.js +464 -1
- package/dist/hosted.d.ts +1 -1
- package/dist/hosted.js +917 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.js +13 -13
- package/dist/internal/path.js +108 -1
- package/dist/internal/workspace.d.ts +2 -3
- package/dist/internal/workspace.js +2 -2
- package/dist/{lifecycle-IReZfi0b.js → lifecycle-BK7WNfcP.js} +8 -8
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +2 -2
- package/dist/{mcp-resources-DeJnbOaw.js → mcp-resources-F4SJF4_P.js} +2 -2
- package/dist/{memory-BlSRrBH1.js → memory-BCZl_ZsJ.js} +26 -4
- package/dist/{metadata-target-CaGLY4ay.js → metadata-target-DPGF6L68.js} +59 -24
- package/dist/{operation-definition-CqZkx1Rm.d.ts → operations-BALFFdKj.d.ts} +1 -0
- package/dist/{operations-BIaK_uYG.js → operations-DJ_7W0gs.js} +8 -7
- package/dist/operations.d.ts +2 -2
- package/dist/operations.js +1327 -2
- package/dist/{path-Bb9OIc_F.js → path-DYHw5KNk.js} +11 -3
- package/dist/plugins-BYxsPDBH.d.ts +12 -0
- package/dist/{provider-CN14ewvx.js → provider-fcI7kJ5k.js} +256 -70
- package/dist/providers/github/store.d.ts +1 -1
- package/dist/providers/github/store.js +1994 -1
- package/dist/{registry-BbUg9vJB.js → registry-CFeUQsja.js} +3 -3
- package/dist/{registry-B0g19sdy.d.ts → registry-h1-cT-cE.d.ts} +1 -1
- package/dist/{registry-s2Ob9PeX.d.ts → registry-hnARUKNF.d.ts} +2 -2
- package/dist/replacement-CVZVsflC.js +76 -0
- package/dist/{request-scope-CXCI_wCb.js → request-scope-jH4H0Sbm.js} +3 -1
- package/dist/{rule-keys-BLEbi1h5.js → rule-keys-xMpiTLq1.js} +1 -1
- package/dist/{rules-BPDXypZV.js → rules-DYQCKYdt.js} +4 -4
- package/dist/runtime/assets.d.ts +1 -1
- package/dist/runtime/assets.js +4 -4
- package/dist/runtime/empty-assets-registry.d.ts +1 -1
- package/dist/runtime/empty-registry.d.ts +2 -2
- package/dist/runtime/registry.d.ts +1 -1
- package/dist/runtime/request.js +1 -1
- package/dist/runtime/state.d.ts +17 -6
- package/dist/runtime/state.js +7 -7
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +38 -23
- package/dist/{search-C_nVorq7.js → search-CG6UNOtn.js} +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +301 -1
- package/dist/{shared-C20Wh1mp.js → shared-PFnkYidS.js} +59 -21
- package/dist/source-metadata.d.ts +2 -2
- package/dist/source-metadata.js +3 -3
- package/dist/{sync-BBfR4g5y.js → sync-CUkCuP_g.js} +5 -5
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/{types-Bel5IDmF.d.ts → types-BnSUug2v.d.ts} +13 -1
- package/dist/{use-D0DyTMxM.js → use-BCMkT-kC.js} +15 -51
- package/dist/{use-CpphIBof.d.ts → use-CJ5rdIrW.d.ts} +1 -1
- package/dist/{use-tools-CHduR5k6.js → use-tools-CcXs2hFA.js} +4 -4
- package/dist/{use-tools-CAK10LTc.d.ts → use-tools-DFVqZwgc.d.ts} +2 -2
- package/dist/{utils-DXP9xfXo.js → utils-Bv1NBg8r.js} +5 -5
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +368 -62
- package/dist/{workspace-BOuxrZrP.d.ts → workspace-B6QreLJd.d.ts} +1 -1
- package/dist/{workspace-CLuPkyZR.js → workspace-D1m00MCM.js} +340 -104
- package/dist/workspace-inspection-scanner-BlJ8bCAB.js +140 -0
- package/package.json +12 -12
- package/dist/errors-CnFDXxeJ.d.ts +0 -4
- package/dist/hosted-8BTKAtMX.js +0 -883
- package/dist/hosted-vercel-blob-B6kygYqn.js +0 -408
- package/dist/operations-DS1C4uXd.js +0 -1308
- package/dist/path-CuYE8-X6.js +0 -57
- package/dist/plugins-CLc32jvL.d.ts +0 -8
- package/dist/server-aa1a4rkV.js +0 -301
- package/dist/state-BdDfBtOR.d.ts +0 -17
- package/dist/store-cx3OqNTi.js +0 -1971
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-DnNXxpGL.js";
|
|
2
|
+
import { t as moduleLanguage } from "./vite.js";
|
|
3
|
+
import { parseSync } from "vite";
|
|
4
|
+
// ../internal/src/build/scan-module.ts
|
|
5
|
+
/**
|
|
6
|
+
* Reads facts from JavaScript and TypeScript modules at build and dev time. The scanner parses each module once with
|
|
7
|
+
* the oxc parser that Vite ships through Rolldown, and never runs it. Values that are not static literals read as
|
|
8
|
+
* `dynamic`, so callers can report their own diagnostics.
|
|
9
|
+
*/
|
|
10
|
+
var scan_module_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
+
argumentExpression: () => argumentExpression,
|
|
12
|
+
defaultExportExpression: () => defaultExportExpression,
|
|
13
|
+
objectProperties: () => objectProperties,
|
|
14
|
+
scanModule: () => scanModule,
|
|
15
|
+
unwrapExpression: () => unwrapExpression
|
|
16
|
+
});
|
|
17
|
+
/** The value of an expression that the scanner cannot read without running the module. */
|
|
18
|
+
const dynamic = Symbol("dynamic");
|
|
19
|
+
/** Parses a module once. `file` selects the grammar from its extension and defaults to TypeScript. */
|
|
20
|
+
function scanModule(source, file = "module.ts") {
|
|
21
|
+
const result = parseSync(file, source, {
|
|
22
|
+
lang: moduleLanguage(file),
|
|
23
|
+
preserveParens: false,
|
|
24
|
+
sourceType: "module"
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
comments: result.comments,
|
|
28
|
+
errors: result.errors,
|
|
29
|
+
file,
|
|
30
|
+
program: result.program,
|
|
31
|
+
source
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Removes parentheses, `as`, `satisfies`, `!`, and `<T>` assertions around an expression. */
|
|
35
|
+
function unwrapExpression(node) {
|
|
36
|
+
while (node.type === "ParenthesizedExpression" || node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "TSNonNullExpression" || node.type === "TSTypeAssertion") node = node.expression;
|
|
37
|
+
return node;
|
|
38
|
+
}
|
|
39
|
+
/** A call argument without assertions, or undefined for a spread or missing argument. */
|
|
40
|
+
function argumentExpression(argument) {
|
|
41
|
+
return argument === void 0 || argument.type === "SpreadElement" ? void 0 : unwrapExpression(argument);
|
|
42
|
+
}
|
|
43
|
+
/** The expression of `export default <expression>`, without assertions. Declarations return undefined. */
|
|
44
|
+
function defaultExportExpression(module) {
|
|
45
|
+
for (const statement of module.program.body) {
|
|
46
|
+
if (statement.type !== "ExportDefaultDeclaration") continue;
|
|
47
|
+
const declaration = statement.declaration;
|
|
48
|
+
if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration" || declaration.type === "TSInterfaceDeclaration") return;
|
|
49
|
+
return unwrapExpression(declaration);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function staticKey(property) {
|
|
53
|
+
const key = property.key;
|
|
54
|
+
if (key.type === "Identifier" && !property.computed) return key.name;
|
|
55
|
+
if (key.type === "PrivateIdentifier") return;
|
|
56
|
+
const value = staticValue(key);
|
|
57
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : void 0;
|
|
58
|
+
}
|
|
59
|
+
/** The members of an object literal in source order. */
|
|
60
|
+
function objectProperties(object) {
|
|
61
|
+
return object.properties.map((node) => node.type === "SpreadElement" ? {
|
|
62
|
+
computed: false,
|
|
63
|
+
key: void 0,
|
|
64
|
+
node,
|
|
65
|
+
value: void 0
|
|
66
|
+
} : {
|
|
67
|
+
computed: node.computed,
|
|
68
|
+
key: staticKey(node),
|
|
69
|
+
node,
|
|
70
|
+
value: unwrapExpression(node.value)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** The value of a template literal without substitutions. */
|
|
74
|
+
function staticTemplate(node) {
|
|
75
|
+
if (node.expressions.length) return dynamic;
|
|
76
|
+
return node.quasis[0]?.value.cooked ?? dynamic;
|
|
77
|
+
}
|
|
78
|
+
const escapePattern = /\\(u\{[^}]*\}?|u[\s\S]{0,4}|x[\s\S]{0,2}|0\d|[\s\S])/g;
|
|
79
|
+
/**
|
|
80
|
+
* True when a string literal has an escape that strict mode code rejects. The parser recovers from some bad escapes
|
|
81
|
+
* and accepts legacy octal escapes, so the scanner checks them again.
|
|
82
|
+
*/
|
|
83
|
+
function hasInvalidEscape(raw) {
|
|
84
|
+
for (const [, escape = ""] of raw.matchAll(escapePattern)) if (escape.startsWith("u{")) {
|
|
85
|
+
const code = escape.slice(2, -1);
|
|
86
|
+
if (!escape.endsWith("}") || !/^[\da-fA-F]+$/.test(code) || Number.parseInt(code, 16) > 1114111) return true;
|
|
87
|
+
} else if (escape.startsWith("u")) {
|
|
88
|
+
if (!/^u[\da-fA-F]{4}$/.test(escape)) return true;
|
|
89
|
+
} else if (escape.startsWith("x")) {
|
|
90
|
+
if (!/^x[\da-fA-F]{2}$/.test(escape)) return true;
|
|
91
|
+
} else if (/^(?:[1-9]|0\d)$/.test(escape)) return true;
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Reads a literal value: strings, numbers, booleans, `null`, `undefined`, template literals without substitutions,
|
|
96
|
+
* and arrays and objects of these. Any other expression gives `dynamic`.
|
|
97
|
+
*/
|
|
98
|
+
function staticValue(node) {
|
|
99
|
+
node = unwrapExpression(node);
|
|
100
|
+
switch (node.type) {
|
|
101
|
+
case "Literal":
|
|
102
|
+
if ("regex" in node) return dynamic;
|
|
103
|
+
return typeof node.value === "string" && hasInvalidEscape(node.raw ?? "") ? dynamic : node.value;
|
|
104
|
+
case "TemplateLiteral": return staticTemplate(node);
|
|
105
|
+
case "Identifier": return node.name === "undefined" ? void 0 : dynamic;
|
|
106
|
+
case "UnaryExpression": {
|
|
107
|
+
if (node.operator === "void") return staticValue(node.argument) === dynamic ? dynamic : void 0;
|
|
108
|
+
const value = staticValue(node.argument);
|
|
109
|
+
if (node.operator === "-" && (typeof value === "number" || typeof value === "bigint")) return -value;
|
|
110
|
+
return dynamic;
|
|
111
|
+
}
|
|
112
|
+
case "ArrayExpression": {
|
|
113
|
+
const values = [];
|
|
114
|
+
for (const element of node.elements) {
|
|
115
|
+
if (element === null || element.type === "SpreadElement") return dynamic;
|
|
116
|
+
const value = staticValue(element);
|
|
117
|
+
if (value === dynamic) return dynamic;
|
|
118
|
+
values.push(value);
|
|
119
|
+
}
|
|
120
|
+
return values;
|
|
121
|
+
}
|
|
122
|
+
case "ObjectExpression": {
|
|
123
|
+
const values = {};
|
|
124
|
+
for (const property of objectProperties(node)) {
|
|
125
|
+
if (property.key === void 0 || property.node.type !== "Property" || property.node.kind !== "init" || property.node.method || property.value === void 0) return dynamic;
|
|
126
|
+
const value = staticValue(property.value);
|
|
127
|
+
if (value === dynamic) return dynamic;
|
|
128
|
+
Object.defineProperty(values, property.key, {
|
|
129
|
+
configurable: true,
|
|
130
|
+
enumerable: true,
|
|
131
|
+
value,
|
|
132
|
+
writable: true
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return values;
|
|
136
|
+
}
|
|
137
|
+
default: return dynamic;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
export { scan_module_exports as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Agent-oriented filesystem state and Vite integration for ViteHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
"dependencies": {
|
|
151
151
|
"@valibot/to-json-schema": "^1.8.0",
|
|
152
152
|
"@vercel/nft": "^1.11.12",
|
|
153
|
-
"@vite-hub/runtime": "0.
|
|
154
|
-
"@vite-hub/source": "0.
|
|
153
|
+
"@vite-hub/runtime": "0.7.0",
|
|
154
|
+
"@vite-hub/source": "0.7.0",
|
|
155
155
|
"birpc": "^4.2.0",
|
|
156
156
|
"defu": "^6.1.7",
|
|
157
157
|
"exsolve": "^1.2.0",
|
|
@@ -162,18 +162,18 @@
|
|
|
162
162
|
"nostics": "1.4.0",
|
|
163
163
|
"valibot": "^1.5.0",
|
|
164
164
|
"yaml": "^2.9.1",
|
|
165
|
-
"@vite-hub/markdown-template": "0.
|
|
166
|
-
"@vite-hub/blob": "0.
|
|
167
|
-
"@vite-hub/database": "0.
|
|
168
|
-
"@vite-hub/sandbox": "0.
|
|
165
|
+
"@vite-hub/markdown-template": "0.7.0",
|
|
166
|
+
"@vite-hub/blob": "0.7.0",
|
|
167
|
+
"@vite-hub/database": "0.7.0",
|
|
168
|
+
"@vite-hub/sandbox": "0.7.0"
|
|
169
169
|
},
|
|
170
170
|
"devDependencies": {
|
|
171
171
|
"@types/node": "^24.19.2",
|
|
172
172
|
"@vercel/blob": "^2.9.0",
|
|
173
|
-
"@vite-hub/env": "0.
|
|
174
|
-
"@vite-hub/forge": "0.
|
|
173
|
+
"@vite-hub/env": "0.7.0",
|
|
174
|
+
"@vite-hub/forge": "0.7.0",
|
|
175
175
|
"@vite-hub/internal": "0.0.1",
|
|
176
|
-
"@vite-hub/shell": "0.
|
|
176
|
+
"@vite-hub/shell": "0.7.0",
|
|
177
177
|
"ai": "7.0.179",
|
|
178
178
|
"esbuild": "^0.28.2",
|
|
179
179
|
"publint": "^0.3.25",
|
|
@@ -186,11 +186,11 @@
|
|
|
186
186
|
"@libsql/client": "^0.18.0"
|
|
187
187
|
},
|
|
188
188
|
"peerDependencies": {
|
|
189
|
-
"@vite-hub/shell": "0.
|
|
189
|
+
"@vite-hub/shell": "0.7.0",
|
|
190
190
|
"ai": "^6.0.0 || ^7.0.0-0",
|
|
191
191
|
"vite": ">=8.0.0",
|
|
192
192
|
"drizzle-orm": "1.0.0-rc.5 || 1.0.0-rc.6 || ^1.0.0",
|
|
193
|
-
"@vite-hub/forge": "0.
|
|
193
|
+
"@vite-hub/forge": "0.7.0"
|
|
194
194
|
},
|
|
195
195
|
"peerDependenciesMeta": {
|
|
196
196
|
"@vite-hub/shell": {
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ViteHubError } from "@vite-hub/runtime";
|
|
2
|
-
type WorkspaceErrorCode = "WORKSPACE_CONFLICT" | "WORKSPACE_FAILED" | "WORKSPACE_NOT_FOUND" | "WORKSPACE_PATH_INVALID";
|
|
3
|
-
declare function isWorkspaceConflict(value: unknown): boolean;
|
|
4
|
-
export { isWorkspaceConflict as n, WorkspaceErrorCode as t };
|