@happyvertical/smrt-core 0.57.24 → 0.57.25
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 -2
- package/dist/manifest/static-manifest.js +1 -1
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/dist/vite-plugin/asset-url-compatibility.d.ts +2 -1
- package/dist/vite-plugin/asset-url-compatibility.d.ts.map +1 -1
- package/dist/vite-plugin/asset-url-compatibility.js +30 -2
- package/dist/vite-plugin/asset-url-compatibility.js.map +1 -1
- package/package.json +4 -4
package/dist/manifest.json
CHANGED
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-core",
|
|
6
|
-
"packageVersion": "0.57.
|
|
6
|
+
"packageVersion": "0.57.25",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "e74b69bba05f370750e186ee7575f19bc97c5ee81fcaa768eeb9464e26a52bdd",
|
|
11
|
+
"packageJson": "ca2230898a2bbcba83caece717df33cdd7c432993dda0315558abf86e9ce7450",
|
|
12
12
|
"agents": "3a78a0babd2884ac22e4b376a3c9618037ab818ad4bdd762751f82fa53c21d04",
|
|
13
13
|
"moduleDoc:agents/object-runtime.md": "fd2748649e820c2fe5960fa4a44c5f3e2a5afa57da89925e8b4cb3b53d67a07b",
|
|
14
14
|
"moduleDoc:agents/revision-guard.md": "f6ea32a6860964c98aba14b93587f40b33c8f7d0deccb2c54d21bff45db3da42",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
/**
|
|
3
3
|
* Keep Vite 7 asset URL transforms safe for large browser/Planner workers.
|
|
4
|
-
*
|
|
4
|
+
* The known backtracking prefilter and comment-only eligibility are guarded;
|
|
5
|
+
* Vite still owns asset parsing,
|
|
5
6
|
* resolution and rewriting. Vite 8 and unrecognized filter shapes are untouched.
|
|
6
7
|
* Install once in root plugins; existing worker plugin factories are preserved.
|
|
7
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-url-compatibility.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/asset-url-compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"asset-url-compatibility.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/asset-url-compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAwCnC;;;;;;GAMG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAmDlD"}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
//#region src/vite-plugin/asset-url-compatibility.ts
|
|
2
|
+
function hasImportMeta(ast) {
|
|
3
|
+
if (!ast || typeof ast !== "object" || ast.type !== "Program" || !Array.isArray(ast.body)) return true;
|
|
4
|
+
const pending = [ast];
|
|
5
|
+
let visited = 0;
|
|
6
|
+
while (pending.length) {
|
|
7
|
+
const node = pending.pop();
|
|
8
|
+
if (!node || typeof node !== "object") continue;
|
|
9
|
+
if (++visited > 1e6) return true;
|
|
10
|
+
if (Array.isArray(node)) {
|
|
11
|
+
for (const child of node) if (child && typeof child === "object") pending.push(child);
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const value = node;
|
|
15
|
+
if (value.type === "MetaProperty" && value.meta?.name === "import" && value.property?.name === "meta") return true;
|
|
16
|
+
for (const child of Object.values(value)) if (child && typeof child === "object") pending.push(child);
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
2
20
|
var unsafeAssetFilter = /new\s+URL.+import\.meta\.url/s;
|
|
3
21
|
/**
|
|
4
22
|
* Keep Vite 7 asset URL transforms safe for large browser/Planner workers.
|
|
5
|
-
*
|
|
23
|
+
* The known backtracking prefilter and comment-only eligibility are guarded;
|
|
24
|
+
* Vite still owns asset parsing,
|
|
6
25
|
* resolution and rewriting. Vite 8 and unrecognized filter shapes are untouched.
|
|
7
26
|
* Install once in root plugins; existing worker plugin factories are preserved.
|
|
8
27
|
*/
|
|
@@ -25,7 +44,16 @@ function smrtAssetUrlCompatibility() {
|
|
|
25
44
|
if (!transform || typeof transform !== "object") continue;
|
|
26
45
|
const filter = transform.filter;
|
|
27
46
|
const code = filter?.code;
|
|
28
|
-
if (filter && code instanceof RegExp && code.source === unsafeAssetFilter.source && code.flags === unsafeAssetFilter.flags)
|
|
47
|
+
if (filter && code instanceof RegExp && code.source === unsafeAssetFilter.source && code.flags === unsafeAssetFilter.flags) {
|
|
48
|
+
filter.code = "import.meta.url";
|
|
49
|
+
const handler = transform.handler;
|
|
50
|
+
transform.handler = function(...args) {
|
|
51
|
+
try {
|
|
52
|
+
if (!hasImportMeta(this.parse(args[0]))) return null;
|
|
53
|
+
} catch {}
|
|
54
|
+
return handler.apply(this, args);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
29
57
|
}
|
|
30
58
|
}
|
|
31
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-url-compatibility.js","names":[],"sources":["../../src/vite-plugin/asset-url-compatibility.ts"],"sourcesContent":["import type { Plugin } from 'vite';\n\nconst unsafeAssetFilter = /new\\s+URL.+import\\.meta\\.url/s;\n\n/**\n * Keep Vite 7 asset URL transforms safe for large browser/Planner workers.\n *
|
|
1
|
+
{"version":3,"file":"asset-url-compatibility.js","names":[],"sources":["../../src/vite-plugin/asset-url-compatibility.ts"],"sourcesContent":["import type { Plugin } from 'vite';\n\n// Returning true on exhaustion is conservative: only a complete walk may prove\n// that comment/string matches cannot require Vite's asset transform.\nfunction hasImportMeta(ast: unknown): boolean {\n if (\n !ast ||\n typeof ast !== 'object' ||\n (ast as { type?: unknown }).type !== 'Program' ||\n !Array.isArray((ast as { body?: unknown }).body)\n )\n return true;\n const pending: unknown[] = [ast];\n let visited = 0;\n while (pending.length) {\n const node = pending.pop();\n if (!node || typeof node !== 'object') continue;\n if (++visited > 1_000_000) return true;\n if (Array.isArray(node)) {\n for (const child of node) {\n if (child && typeof child === 'object') pending.push(child);\n }\n continue;\n }\n const value = node as Record<string, unknown>;\n if (\n value.type === 'MetaProperty' &&\n (value.meta as { name?: string } | undefined)?.name === 'import' &&\n (value.property as { name?: string } | undefined)?.name === 'meta'\n )\n return true;\n for (const child of Object.values(value)) {\n if (child && typeof child === 'object') pending.push(child);\n }\n }\n return false;\n}\n\nconst unsafeAssetFilter = /new\\s+URL.+import\\.meta\\.url/s;\n\n/**\n * Keep Vite 7 asset URL transforms safe for large browser/Planner workers.\n * The known backtracking prefilter and comment-only eligibility are guarded;\n * Vite still owns asset parsing,\n * resolution and rewriting. Vite 8 and unrecognized filter shapes are untouched.\n * Install once in root plugins; existing worker plugin factories are preserved.\n */\nexport function smrtAssetUrlCompatibility(): Plugin {\n let supportedVite = false;\n const createPlugin = (includeWorkers: boolean): Plugin => ({\n name: 'smrt-asset-url-compatibility',\n ...(includeWorkers\n ? ({\n async config(config) {\n const { version } = await import('vite');\n supportedVite = version.startsWith('7.');\n if (!supportedVite) return;\n const existing = config.worker?.plugins;\n return {\n worker: {\n plugins: (...args) => [\n existing?.(...args) ?? [],\n createPlugin(false),\n ],\n },\n };\n },\n } satisfies Partial<Plugin>)\n : {}),\n configResolved(config) {\n if (!supportedVite) return;\n for (const plugin of config.plugins) {\n if (plugin.name !== 'vite:asset-import-meta-url') continue;\n const transform = plugin.transform;\n if (!transform || typeof transform !== 'object') continue;\n const filter = transform.filter;\n const code = filter?.code;\n if (\n filter &&\n code instanceof RegExp &&\n code.source === unsafeAssetFilter.source &&\n code.flags === unsafeAssetFilter.flags\n ) {\n filter.code = 'import.meta.url';\n const handler = transform.handler;\n transform.handler = function (...args) {\n try {\n if (!hasImportMeta(this.parse(args[0]))) return null;\n } catch {\n // Unknown syntax/context must retain Vite's original behavior.\n }\n return handler.apply(this, args);\n };\n }\n }\n },\n });\n return createPlugin(true);\n}\n"],"mappings":";AAIA,SAAS,cAAc,KAAuB;CAC5C,IACE,CAAC,OACD,OAAO,QAAQ,YACd,IAA2B,SAAS,aACrC,CAAC,MAAM,QAAS,IAA2B,IAAI,GAE/C,OAAO;CACT,MAAM,UAAqB,CAAC,GAAG;CAC/B,IAAI,UAAU;CACd,OAAO,QAAQ,QAAQ;EACrB,MAAM,OAAO,QAAQ,IAAI;EACzB,IAAI,CAAC,QAAQ,OAAO,SAAS,UAAU;EACvC,IAAI,EAAE,UAAU,KAAW,OAAO;EAClC,IAAI,MAAM,QAAQ,IAAI,GAAG;GACvB,KAAK,MAAM,SAAS,MAClB,IAAI,SAAS,OAAO,UAAU,UAAU,QAAQ,KAAK,KAAK;GAE5D;EACF;EACA,MAAM,QAAQ;EACd,IACE,MAAM,SAAS,kBACd,MAAM,MAAwC,SAAS,YACvD,MAAM,UAA4C,SAAS,QAE5D,OAAO;EACT,KAAK,MAAM,SAAS,OAAO,OAAO,KAAK,GACrC,IAAI,SAAS,OAAO,UAAU,UAAU,QAAQ,KAAK,KAAK;CAE9D;CACA,OAAO;AACT;AAEA,IAAM,oBAAoB;;;;;;;;AAS1B,SAAgB,4BAAoC;CAClD,IAAI,gBAAgB;CACpB,MAAM,gBAAgB,oBAAqC;EACzD,MAAM;EACN,GAAI,iBACC,EACC,MAAM,OAAO,QAAQ;GACnB,MAAM,EAAE,YAAY,MAAM,OAAO;GACjC,gBAAgB,QAAQ,WAAW,IAAI;GACvC,IAAI,CAAC,eAAe;GACpB,MAAM,WAAW,OAAO,QAAQ;GAChC,OAAO,EACL,QAAQ,EACN,UAAU,GAAG,SAAS,CACpB,WAAW,GAAG,IAAI,KAAK,CAAC,GACxB,aAAa,KAAK,CACpB,EACF,EACF;EACF,EACF,IACA,CAAC;EACL,eAAe,QAAQ;GACrB,IAAI,CAAC,eAAe;GACpB,KAAK,MAAM,UAAU,OAAO,SAAS;IACnC,IAAI,OAAO,SAAS,8BAA8B;IAClD,MAAM,YAAY,OAAO;IACzB,IAAI,CAAC,aAAa,OAAO,cAAc,UAAU;IACjD,MAAM,SAAS,UAAU;IACzB,MAAM,OAAO,QAAQ;IACrB,IACE,UACA,gBAAgB,UAChB,KAAK,WAAW,kBAAkB,UAClC,KAAK,UAAU,kBAAkB,OACjC;KACA,OAAO,OAAO;KACd,MAAM,UAAU,UAAU;KAC1B,UAAU,UAAU,SAAU,GAAG,MAAM;MACrC,IAAI;OACF,IAAI,CAAC,cAAc,KAAK,MAAM,KAAK,EAAE,CAAC,GAAG,OAAO;MAClD,QAAQ,CAER;MACA,OAAO,QAAQ,MAAM,MAAM,IAAI;KACjC;IACF;GACF;EACF;CACF;CACA,OAAO,aAAa,IAAI;AAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-core",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.25",
|
|
4
4
|
"description": "Core AI agent framework with standardized collections, object-relational mapping, and code generators",
|
|
5
5
|
"author": "HappyVertical",
|
|
6
6
|
"type": "module",
|
|
@@ -199,9 +199,9 @@
|
|
|
199
199
|
"@happyvertical/files": "^0.106.0",
|
|
200
200
|
"@happyvertical/json": "^0.106.0",
|
|
201
201
|
"@happyvertical/logger": "^0.106.0",
|
|
202
|
-
"@happyvertical/smrt-config": "0.57.
|
|
203
|
-
"@happyvertical/smrt-scanner": "0.57.
|
|
204
|
-
"@happyvertical/smrt-types": "0.57.
|
|
202
|
+
"@happyvertical/smrt-config": "0.57.25",
|
|
203
|
+
"@happyvertical/smrt-scanner": "0.57.25",
|
|
204
|
+
"@happyvertical/smrt-types": "0.57.25",
|
|
205
205
|
"@happyvertical/sql": "^0.106.0",
|
|
206
206
|
"@happyvertical/utils": "^0.106.0",
|
|
207
207
|
"@noble/hashes": "^2.4.0",
|