@promptframe/cli 0.1.60 → 0.1.64

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.
Files changed (44) hide show
  1. package/README.md +38 -1
  2. package/dist/development-build-worker.d.ts +2 -0
  3. package/dist/development-build-worker.d.ts.map +1 -0
  4. package/dist/development-build-worker.js +184 -0
  5. package/dist/development-build-worker.js.map +1 -0
  6. package/dist/development-build.d.ts +22 -0
  7. package/dist/development-build.d.ts.map +1 -0
  8. package/dist/development-build.js +66 -0
  9. package/dist/development-build.js.map +1 -0
  10. package/dist/development-coordinator.d.ts +26 -0
  11. package/dist/development-coordinator.d.ts.map +1 -0
  12. package/dist/development-coordinator.js +114 -0
  13. package/dist/development-coordinator.js.map +1 -0
  14. package/dist/development-css.d.ts +10 -0
  15. package/dist/development-css.d.ts.map +1 -0
  16. package/dist/development-css.js +65 -0
  17. package/dist/development-css.js.map +1 -0
  18. package/dist/development-files.d.ts +6 -0
  19. package/dist/development-files.d.ts.map +1 -0
  20. package/dist/development-files.js +70 -0
  21. package/dist/development-files.js.map +1 -0
  22. package/dist/development-owner.d.ts +22 -0
  23. package/dist/development-owner.d.ts.map +1 -0
  24. package/dist/development-owner.js +253 -0
  25. package/dist/development-owner.js.map +1 -0
  26. package/dist/development-process.d.ts +15 -0
  27. package/dist/development-process.d.ts.map +1 -0
  28. package/dist/development-process.js +65 -0
  29. package/dist/development-process.js.map +1 -0
  30. package/dist/development-revisions.d.ts +58 -0
  31. package/dist/development-revisions.d.ts.map +1 -0
  32. package/dist/development-revisions.js +130 -0
  33. package/dist/development-revisions.js.map +1 -0
  34. package/dist/development-validation.d.ts +22 -0
  35. package/dist/development-validation.d.ts.map +1 -0
  36. package/dist/development-validation.js +122 -0
  37. package/dist/development-validation.js.map +1 -0
  38. package/dist/development-workspace.d.ts +37 -0
  39. package/dist/development-workspace.d.ts.map +1 -0
  40. package/dist/development-workspace.js +402 -0
  41. package/dist/development-workspace.js.map +1 -0
  42. package/dist/index.js +84 -1
  43. package/dist/index.js.map +1 -1
  44. package/package.json +10 -4
package/README.md CHANGED
@@ -4,7 +4,7 @@ PromptFrame component authoring CLI.
4
4
 
5
5
  Use it to inspect the public component standard, check component folders, validate manifests, inspect the local preview envelope, package source archives, upload components, check build status, rebuild evidence indexes, and rerun layout/security probes.
6
6
 
7
- Current source baseline is `@promptframe/cli@0.1.60`, `@promptframe/contracts@0.1.28`, `@promptframe/component-kit@0.1.22`, and `create-promptframe-component@0.1.50`. The published CLI consumes the contracts AST-aware public security policy evaluator, reports `securityPolicyDigest` / `securityEvaluatorMode` in JSON output, rejects red-team browser capability vectors such as Image/Audio beacons, Worker/SharedWorker, `window.open`, `postMessage`, dynamic script/iframe creation, browser fingerprinting, storage/cookie access, and dangerous HTML, reports `publicResources` for component-level public assets, keeps native `<img>` / `<video>` source checks case-sensitive so Remotion `<Img>` / `<Video>` remain valid, validates preview props against statically declared `propsSchema` fields and requires readable public prop descriptions, enforces strict Slot-first layout/source diagnostics, supports endpoint discovery, project list/current diagnostics, self-service CI token create/list/revoke, single-component and workspace GitHub workflow setup with `promptframe-workflow-version: 2`, `setup-ci --upgrade` stale-template repair, dynamic workspace matrix discovery, `RUNNER_LABELS` and pnpm 10 workflow support, pnpm workspace root lockfile evidence without component symlinks, `promptframe-workspace.json` validation, workspace root `check .` / `upload .` auto-detection, explicit `workspace:*` shared-package diagnostics, workspace upload source metadata headers, packages sanitized lockfile evidence for platform admission, release notes forwarding to upload, stderr NDJSON upload progress for `--json`, human-readable token kind/expiry summaries for `login`, `whoami`, and authenticated `upload`, server version auto-bump notes, and supports `status --fail-on-build-failed` for CI build-status gating.
7
+ Current source baseline is `@promptframe/cli@0.1.64`, `@promptframe/contracts@0.1.32`, `@promptframe/component-kit@0.1.26`, and `create-promptframe-component@0.1.54`. The published CLI consumes the contracts AST-aware public security policy evaluator, reports `securityPolicyDigest` / `securityEvaluatorMode` in JSON output, rejects red-team browser capability vectors such as Image/Audio beacons, Worker/SharedWorker, `window.open`, `postMessage`, dynamic script/iframe creation, browser fingerprinting, storage/cookie access, and dangerous HTML, reports `publicResources` for component-level public assets, keeps native `<img>` / `<video>` source checks case-sensitive so Remotion `<Img>` / `<Video>` remain valid, validates preview props against statically declared `propsSchema` fields and requires readable public prop descriptions, enforces strict Slot-first layout/source diagnostics, supports endpoint discovery, project list/current diagnostics, self-service CI token create/list/revoke, single-component and workspace GitHub workflow setup with `promptframe-workflow-version: 2`, `setup-ci --upgrade` stale-template repair, dynamic workspace matrix discovery, `RUNNER_LABELS` and pnpm 10 workflow support, pnpm workspace root lockfile evidence without component symlinks, `promptframe-workspace.json` validation, workspace root `check .` / `upload .` auto-detection, explicit `workspace:*` shared-package diagnostics, workspace upload source metadata headers, packages sanitized lockfile evidence for platform admission, release notes forwarding to upload, stderr NDJSON upload progress for `--json`, human-readable token kind/expiry summaries for `login`, `whoami`, and authenticated `upload`, server version auto-bump notes, and supports `status --fail-on-build-failed` for CI build-status gating.
8
8
 
9
9
  ```bash
10
10
  npm install -D @promptframe/cli
@@ -88,6 +88,24 @@ The upload-to-publish lifecycle has multiple gates. `upload` returning success m
88
88
 
89
89
  ### Repository layouts and monorepos
90
90
 
91
+ #### 根开发服务(源码入口)
92
+
93
+ 工作区根目录声明 `promptframe-workspace.json` 后,源码中的根开发入口使用一个 Vite watcher 管理全部模块:
94
+
95
+ ```bash
96
+ promptframe dev . --studio-origin https://studio.example
97
+ ```
98
+
99
+ 入口监听一个 loopback 地址,端口 `0` 由系统选择一个实际端口,也可用 `--port` 指定。成功监听后输出实际 URL、连接 ID、精确 Studio Origin 和十分钟连接凭据。凭据只用于本机显式连接,不是平台登录或上传 Token;不要提交或放进组件代码。远程浏览器、SSH/WSL 和 HTTPS 到本机的访问仍需真实桥接及浏览器许可,不能根据命令启动推断可达。
100
+
101
+ `/__promptframe/registry` 和 `events` 以精确 Host/Origin/Authorization 返回模块的当前捕获版本、checking/checked/failed、固定诊断及明确的 lastChecked。精确版本的 bundle 接口一次返回 Component/schema/index ESM、共享 chunk 和已捕获 public 资源;输出不附原包锁或连接凭据。原始 Vite 文件、`/@fs`、默认 HTML/HMR、子配置和 npm 脚本入口关闭。
102
+
103
+ 每个模块先捕获自身文件、实际 workspace pnpm 锁和声明,再运行普通 CLI validate、固定 Vite 闭合图构建和当前内容重捕获。漏通知、快速保存或旧构建晚回不能授权旧字节覆盖新版;失败保留明确标记的 lastChecked。检查状态是构建/规则事实,Player 必须在隔离执行后另报实际加载版本。根服务本身尚未提供 Studio 消费端或 Player 加载 ACK,也不代替平台正式 upload/admission。
104
+
105
+ 构建采用 Vite 8.0.10 和自动 JSX,支持捕获内的 JS/TS/JSON 静态图与 `.module.css`。CSS Modules 的类名按捕获版本和文件路径隔离,样式随实际组件挂载和卸载;默认脚手架的 `propsSchema`、命名 index 与 manifest 指定的组件导出会对齐 Player 原有入口。样式只支持本模块类选择器和纯布局、颜色表达式,不解析 CSS import、URL、composition、全局选择器或独立动画时钟;资源仍使用原公共资源 helper。React/ReactDOM/Remotion、zod 及 PromptFrame 公共 runtime 作为明确列出的共享 external,由消费端按兼容合同提供;不从作者 `node_modules` 偷读依赖。其它 npm/本机 alias、父目录源码、普通全局 CSS、`import.meta` 和非字面动态 import 尚不支持,返回确定诊断。锁文件捕获证明实际输入,不冒依赖安装或解析完整性;正式各模块独立包仍走原检查和上传。
106
+
107
+ 默认界为 32 模块、每模块 2048 文件/16MiB 输入、512 文件/8MiB 输出;检查/构建串行并有超时,受检产物保留总量 64MiB,HTTP 传输另有有界预留,最多八个通知连接。关闭时停止 watcher/HTTP,abort 并 join 实际检查/构建子进程后回收自身临时目录。这些本机进程和内容预算不构成 OS/网络或网页执行沙箱,也不声称全进程 heap/RSS 上限。
108
+
91
109
  The default CLI workflow assumes a single component repository: the current directory is the component package and contains `manifest.json`, `package.json`, `src/`, and optional `public/`.
92
110
 
93
111
  Monorepos are allowed only when component mapping is explicit. `promptframe-workspace.json` is the supported workspace SSOT; it lists each component `id` and relative `path`. `workspace validate` confirms every path exists and every selected directory's `manifest.json` declares the same id before upload. `PROMPTFRAME_CI_TOKEN` authorizes the upload; it does not map a repository, commit, or tag to a component for you.
@@ -165,3 +183,22 @@ Components generated by `create-promptframe-component` include `.promptframe/sca
165
183
  - `freshness.status`: `current`, `warning`, `upload_blocking`, or `security_breaking`.
166
184
 
167
185
  `validate` and `package` consume public policies from `@promptframe/contracts`: required files, preview limits, deterministic frame-driven source rules, dependency policy, and security policy. Source files are evaluated with the contracts AST-aware security evaluator so alias usage such as `const BC = BroadcastChannel; new BC()` is rejected while ordinary comments or strings mentioning a blocked API do not fail validation. `runtime.deterministic.fps_hardcoded_timing` is a manual-review validation gate: hardcoded frame timing in Remotion contexts fails `validate` with a repair hint to use `secondsToFrames`, `createDurationTimeline`, `createRevealPhases`, `createFillProgress`, or `timeline.at`. JSON, Markdown, and package metadata still use bounded pattern fallback for install scripts, prompt-injection strings, and remote URL signals. These local checks are early author feedback; the platform admission pipeline remains the final trust gate.
186
+
187
+ ## 工作区开发连接
188
+
189
+ 带有 `promptframe-workspace.json` 的工程使用一个本机服务连接 Studio:
190
+
191
+ ```bash
192
+ promptframe dev . --studio-origin https://your-studio.example
193
+ promptframe dev . --studio-origin https://your-studio.example --idle-timeout 30
194
+ promptframe dev . --studio-origin https://your-studio.example --replace
195
+ promptframe dev stop .
196
+ ```
197
+
198
+ 将启动时输出的完整 JSON 粘贴到同一浏览器主机的 Studio 开发连接面板。服务运行期间连接没有固定十分钟截止;没有推送连接且没有请求持续30分钟后正常退出,`--idle-timeout 0` 可关闭闲置退出。推送心跳默认为25秒。普通单组件 Vite 预览仍使用原5173入口。
199
+
200
+ 工作区默认端口为24000—24999,冲突时在段内选择并记住可用端口;`--port` 优先。`.promptframe/dev/` 保存本机连接ID、端口及实例锁,并自行忽略Git,不含连接凭据。重启后ID保持、凭据重新生成:在Studio重新粘贴一次新JSON即可继续使用同ID节点。旧随机ID的节点需要手动重新绑定一次。本地连接v2需要相容的Studio;旧v1连接仍遵守原有效期。
201
+
202
+ 关闭开发面板不停止连接;切换账号或作品、关闭页面会断开。刷新页面后重新粘贴连接JSON。停止或替换仅操作本工作区的实际实例;无法确认实例退出时命令报错,不自动强制终止进程。
203
+
204
+ 上传组件后,用准确的正式 `componentRef` 替换作品节点引用并移除该节点的 `componentSource`。仅上传成功不会自动改变作品的选源。确认作品已使用正式引用且不再需要本地预览后,可执行 `promptframe dev stop .`。
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=development-build-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development-build-worker.d.ts","sourceRoot":"","sources":["../src/development-build-worker.ts"],"names":[],"mappings":""}
@@ -0,0 +1,184 @@
1
+ import { posix } from 'node:path';
2
+ import ts from 'typescript';
3
+ import { build, version } from 'vite';
4
+ import { DevelopmentContents } from './development-revisions.js';
5
+ import { compileDevelopmentCssModule } from './development-css.js';
6
+ const prefix = '\0promptframe-captured:';
7
+ const entryPrefix = '\0promptframe-entry:';
8
+ const cssPrefix = '\0promptframe-css:';
9
+ const externals = new Set(['react', 'react/jsx-runtime', 'react/jsx-dev-runtime',
10
+ 'react-dom', 'react-dom/client', 'remotion', 'zod', '@promptframe/component-kit', '@promptframe/contracts',
11
+ '@promptframe/component-kit/layout', '@promptframe/component-kit/timing',
12
+ '@promptframe/component-kit/style', '@promptframe/component-kit/standard']);
13
+ let diagnosticCode = 'development.build.failed';
14
+ function fail(code) { diagnosticCode = code; throw new Error(code); }
15
+ async function main() {
16
+ let total = 0;
17
+ const input = [];
18
+ for await (const chunk of process.stdin) {
19
+ total += chunk.length;
20
+ if (total > 24 * 1024 * 1024)
21
+ fail('development.build.input_limit');
22
+ input.push(chunk);
23
+ }
24
+ const request = JSON.parse(Buffer.concat(input).toString('utf8'));
25
+ const captured = new DevelopmentContents(request.files.map(file => ({
26
+ path: file.path, bytes: Buffer.from(file.base64, 'base64'),
27
+ })), { maximumFiles: 2048, maximumBytes: 16 * 1024 * 1024 });
28
+ if (captured.revision !== request.sourceRevision || version !== '8.0.10')
29
+ fail('development.build.input_mismatch');
30
+ const files = new Map(captured.readFiles().map(file => [file.path, file.bytes]));
31
+ const manifestBytes = files.get('manifest.json');
32
+ if (!manifestBytes)
33
+ fail('development.build.manifest_missing');
34
+ const manifest = JSON.parse(Buffer.from(manifestBytes).toString('utf8'));
35
+ const entries = { component: manifest.entry.sourcePath, schema: manifest.entry.propsSchemaPath, index: 'src/index.ts' };
36
+ const cssPlaceholder = `__PROMPTFRAME_CAPTURED_CSS_${captured.revision}__`;
37
+ const styles = new Map();
38
+ // Normalize the manifest's real component export and both supported schema
39
+ // spellings to the Player's existing three-entry identity contract. Original
40
+ // index exports remain available; no second manifest authority is created.
41
+ const generated = new Map([
42
+ ['component', `import * as Source from ${JSON.stringify(prefix + entries.component)};
43
+ import { Fragment, createElement } from 'react';
44
+ const Component = Source[${JSON.stringify(manifest.entry.componentExport ?? 'default')}];
45
+ export default function CapturedComponent(props) {
46
+ return createElement(Fragment, null, createElement('style', null, ${JSON.stringify(cssPlaceholder)}), createElement(Component, props));
47
+ }`],
48
+ ['schema', `import * as Source from ${JSON.stringify(prefix + entries.schema)};
49
+ export * from ${JSON.stringify(prefix + entries.schema)};
50
+ export const PropsSchema = Source.PropsSchema ?? Source.propsSchema;`],
51
+ ['index', `export * from ${JSON.stringify(prefix + entries.index)};
52
+ export { default } from ${JSON.stringify(entryPrefix + 'component')};
53
+ export { PropsSchema } from ${JSON.stringify(entryPrefix + 'schema')};`],
54
+ ]);
55
+ const importedRuntimes = new Set();
56
+ const source = (path) => {
57
+ const bytes = files.get(path);
58
+ if (!bytes)
59
+ fail('development.build.uncaptured_import');
60
+ if (!/\.(?:[cm]?[jt]sx?|json)$/u.test(path) && !path.endsWith('.module.css'))
61
+ fail('development.build.unsupported_source_type');
62
+ const text = Buffer.from(bytes).toString('utf8');
63
+ if (!path.endsWith('.json') && !path.endsWith('.module.css')) {
64
+ const parsed = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true);
65
+ const visit = (node) => {
66
+ // These Vite features would discover files outside the closed import
67
+ // graph. They need an explicit captured-resource contract first.
68
+ if (ts.isMetaProperty(node) && node.keywordToken === ts.SyntaxKind.ImportKeyword) {
69
+ fail('development.build.import_meta_unsupported');
70
+ }
71
+ if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword
72
+ && (node.arguments.length !== 1 || !(ts.isStringLiteral(node.arguments[0]) || ts.isNoSubstitutionTemplateLiteral(node.arguments[0])))) {
73
+ fail('development.build.dynamic_import_unsupported');
74
+ }
75
+ ts.forEachChild(node, visit);
76
+ };
77
+ visit(parsed);
78
+ }
79
+ return text;
80
+ };
81
+ const plugin = {
82
+ name: 'promptframe-captured-sources', enforce: 'pre',
83
+ resolveId(id, importer) {
84
+ if (id.startsWith(entryPrefix)) {
85
+ if (importer && !importer.startsWith(entryPrefix))
86
+ return fail('development.build.uncaptured_import');
87
+ if (!generated.has(id.slice(entryPrefix.length)))
88
+ return fail('development.build.uncaptured_import');
89
+ return id;
90
+ }
91
+ if (id.startsWith(prefix)) {
92
+ if (!importer?.startsWith(entryPrefix))
93
+ return fail('development.build.uncaptured_import');
94
+ source(id.slice(prefix.length));
95
+ return id;
96
+ }
97
+ if (!importer?.startsWith(prefix) && !importer?.startsWith(entryPrefix))
98
+ return fail('development.build.uncaptured_import');
99
+ if (externals.has(id)) {
100
+ importedRuntimes.add(id);
101
+ return { id, external: true };
102
+ }
103
+ if (!importer.startsWith(prefix))
104
+ return fail('development.build.uncaptured_import');
105
+ if (!id.startsWith('.') || /[\\?#\0]/u.test(id))
106
+ return fail('development.build.unsupported_dependency');
107
+ const path = posix.normalize(posix.join(posix.dirname(importer.slice(prefix.length)), id));
108
+ if (path === '..' || path.startsWith('../') || posix.isAbsolute(path))
109
+ return fail('development.build.uncaptured_import');
110
+ const resolved = [path, ...['.ts', '.tsx', '.js', '.jsx', '.mjs', '.mts', '.json', '/index.ts', '/index.tsx', '/index.js'].map(ext => path + ext)]
111
+ .find(candidate => files.has(candidate));
112
+ if (!resolved)
113
+ return fail('development.build.uncaptured_import');
114
+ source(resolved);
115
+ // This loader already compiled the CSS Module to JS. A JS virtual ID
116
+ // keeps Vite's later CSS plugin from parsing that mapping as a stylesheet.
117
+ return resolved.endsWith('.module.css') ? cssPrefix + resolved + '.mjs' : prefix + resolved;
118
+ },
119
+ async load(id) {
120
+ if (id.startsWith(entryPrefix))
121
+ return generated.get(id.slice(entryPrefix.length));
122
+ if (!id.startsWith(prefix) && !id.startsWith(cssPrefix))
123
+ return fail('development.build.uncaptured_import');
124
+ const path = id.startsWith(cssPrefix) ? id.slice(cssPrefix.length, -4) : id.slice(prefix.length), text = source(path);
125
+ if (path.endsWith('.module.css')) {
126
+ let compiled;
127
+ try {
128
+ compiled = await compileDevelopmentCssModule({ path, text, sourceRevision: captured.revision });
129
+ }
130
+ catch {
131
+ return fail('development.build.unsupported_css');
132
+ }
133
+ styles.set(path, compiled.css);
134
+ return `export default ${JSON.stringify(compiled.classes)};`;
135
+ }
136
+ return text;
137
+ },
138
+ };
139
+ const result = await build({ root: process.cwd(), configFile: false, envFile: false,
140
+ mode: 'development', publicDir: false, logLevel: 'silent', plugins: [plugin],
141
+ css: { postcss: { plugins: [] } }, resolve: { tsconfigPaths: false },
142
+ oxc: { jsx: { runtime: 'automatic', importSource: 'react' } },
143
+ build: { write: false, target: 'es2022', minify: false, sourcemap: false, modulePreload: false,
144
+ lib: { entry: Object.fromEntries(Object.keys(entries).map(key => [key, entryPrefix + key])), formats: ['es'] },
145
+ rolldownOptions: { input: Object.fromEntries(Object.keys(entries).map(key => [key, entryPrefix + key])),
146
+ output: { entryFileNames: '[name].mjs', chunkFileNames: 'chunks/[name]-[hash].mjs',
147
+ assetFileNames: 'assets/[name]-[hash][extname]' } },
148
+ },
149
+ });
150
+ const built = Array.isArray(result) && result.length === 1 ? result[0] : result;
151
+ if (!built || !('output' in built))
152
+ fail('development.build.invalid_output');
153
+ const css = [...styles].sort(([a], [b]) => a.localeCompare(b, 'en')).map(([, text]) => text).join('\n');
154
+ let replacements = 0;
155
+ const output = built.output.map(file => {
156
+ if (file.type !== 'chunk')
157
+ return { path: file.fileName, bytes: Buffer.from(file.source) };
158
+ const code = file.code.replaceAll(JSON.stringify(cssPlaceholder), () => { replacements++; return JSON.stringify(css); });
159
+ return { path: file.fileName, bytes: Buffer.from(code) };
160
+ });
161
+ if (replacements !== 1)
162
+ fail('development.build.invalid_output');
163
+ output.push({ path: 'manifest.json', bytes: Buffer.from(manifestBytes) });
164
+ for (const [path, bytes] of files) {
165
+ if (path.startsWith('public/'))
166
+ output.push({ path: 'resources/public/' + path.slice(7), bytes: Buffer.from(bytes) });
167
+ if (path === 'src/preview-props.json')
168
+ output.push({ path: 'preview.json', bytes: Buffer.from(bytes) });
169
+ }
170
+ const artifacts = new DevelopmentContents(output, { maximumFiles: 512, maximumBytes: 8 * 1024 * 1024 });
171
+ process.stdout.write(JSON.stringify({ sourceRevision: captured.revision, builder: `vite/${version}/captured-v1`,
172
+ entries: Object.fromEntries(Object.keys(entries).map(key => [key, `${key}.mjs`])),
173
+ runtimeImports: [...importedRuntimes].sort(),
174
+ files: artifacts.readFiles().map(file => ({ path: file.path, base64: Buffer.from(file.bytes).toString('base64') })),
175
+ }));
176
+ }
177
+ try {
178
+ await main();
179
+ }
180
+ catch {
181
+ process.stderr.write(JSON.stringify({ code: diagnosticCode }));
182
+ process.exitCode = 1;
183
+ }
184
+ //# sourceMappingURL=development-build-worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development-build-worker.js","sourceRoot":"","sources":["../src/development-build-worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAe,MAAM,MAAM,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACj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EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;IACxG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,cAAc,EAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,OAAO,cAAc;QAC7G,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC;QACjF,cAAc,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,EAAE;QAC5C,KAAK,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;KACpH,CAAC,CAAC,CAAC;AACN,CAAC;AAED,IAAI,CAAC;IAAC,MAAM,IAAI,EAAE,CAAC;AAAC,CAAC;AACrB,MAAM,CAAC;IAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;IAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { DevelopmentContents } from './development-revisions.js';
2
+ export interface DevelopmentBuildReceipt {
3
+ readonly sourceRevision: string;
4
+ readonly builder: string;
5
+ readonly artifacts: DevelopmentContents;
6
+ readonly entries: Readonly<{
7
+ component: string;
8
+ schema: string;
9
+ index: string;
10
+ }>;
11
+ /** Only explicitly shared host runtimes are external, never arbitrary npm imports. */
12
+ readonly runtimeImports: readonly string[];
13
+ }
14
+ /** Compile the capture through a fixed Vite config and a closed virtual source
15
+ * graph. No workspace files, child vite.config, scripts or node_modules are
16
+ * resolved by the build. A build receipt alone does not assert a safety check. */
17
+ export declare function buildDevelopmentContents(contents: DevelopmentContents, options?: {
18
+ temporaryParent?: string;
19
+ timeoutMs?: number;
20
+ signal?: AbortSignal;
21
+ }): Promise<DevelopmentBuildReceipt>;
22
+ //# sourceMappingURL=development-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development-build.d.ts","sourceRoot":"","sources":["../src/development-build.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjF,sFAAsF;IACtF,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AAED;;kFAEkF;AAClF,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,GAAE;IAAE,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACnF,OAAO,CAAC,uBAAuB,CAAC,CAiDlC"}
@@ -0,0 +1,66 @@
1
+ import { mkdtemp, rm } from 'node:fs/promises';
2
+ import { tmpdir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { DevelopmentContents } from './development-revisions.js';
6
+ import { DevelopmentProcessError, runDevelopmentProcess } from './development-process.js';
7
+ const outputLimits = Object.freeze({ maximumFiles: 512, maximumBytes: 8 * 1024 * 1024 });
8
+ /** Compile the capture through a fixed Vite config and a closed virtual source
9
+ * graph. No workspace files, child vite.config, scripts or node_modules are
10
+ * resolved by the build. A build receipt alone does not assert a safety check. */
11
+ export async function buildDevelopmentContents(contents, options = {}) {
12
+ const timeoutMs = options.timeoutMs ?? 30_000;
13
+ if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 120_000) {
14
+ throw new DevelopmentProcessError('development.build.invalid_timeout');
15
+ }
16
+ options.signal?.throwIfAborted();
17
+ if (contents.byteLength > 16 * 1024 * 1024)
18
+ throw new DevelopmentProcessError('development.build.input_limit');
19
+ const files = contents.readFiles();
20
+ if (files.length > 2048)
21
+ throw new DevelopmentProcessError('development.build.input_limit');
22
+ const input = JSON.stringify({ sourceRevision: contents.revision,
23
+ files: files.map(file => ({ path: file.path, base64: Buffer.from(file.bytes).toString('base64') })) });
24
+ const directory = await mkdtemp(join(options.temporaryParent ?? tmpdir(), 'promptframe-build-'));
25
+ let hadFailure = false;
26
+ try {
27
+ const raw = await runDevelopmentProcess({
28
+ worker: fileURLToPath(new URL('./development-build-worker.js', import.meta.url)),
29
+ cwd: directory, input, timeoutMs, maximumOutputBytes: 20 * 1024 * 1024, signal: options.signal,
30
+ });
31
+ const result = JSON.parse(raw);
32
+ if (result.sourceRevision !== contents.revision || result.builder !== 'vite/8.0.10/captured-v1'
33
+ || !Array.isArray(result.files) || !Array.isArray(result.runtimeImports)
34
+ || !result.runtimeImports.every(id => typeof id === 'string') || !result.entries) {
35
+ throw new DevelopmentProcessError('development.build.invalid_receipt');
36
+ }
37
+ const artifacts = new DevelopmentContents(result.files.map(file => ({
38
+ path: file.path, bytes: Buffer.from(file.base64, 'base64'),
39
+ })), outputLimits);
40
+ const paths = new Set(artifacts.readFiles().map(file => file.path));
41
+ if (!['component', 'schema', 'index'].every(key => paths.has(result.entries[key]))) {
42
+ throw new DevelopmentProcessError('development.build.invalid_entries');
43
+ }
44
+ return Object.freeze({ sourceRevision: contents.revision, builder: result.builder, artifacts,
45
+ entries: Object.freeze({ ...result.entries }), runtimeImports: Object.freeze([...result.runtimeImports]) });
46
+ }
47
+ catch (error) {
48
+ hadFailure = true;
49
+ throw error;
50
+ }
51
+ finally {
52
+ // The worker has actually closed before returning/throwing above. A cleanup
53
+ // failure must not replace the original abort/compiler cause.
54
+ try {
55
+ await rm(directory, { recursive: true, force: true });
56
+ }
57
+ catch (error) {
58
+ if (!hadFailure)
59
+ throw error;
60
+ // Keep the first failure and make any retained private directory
61
+ // actionable to its local owner; never print source/error bodies.
62
+ process.stderr.write(JSON.stringify({ code: 'development.build.cleanup_failed', directory }) + '\n');
63
+ }
64
+ }
65
+ }
66
+ //# sourceMappingURL=development-build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development-build.js","sourceRoot":"","sources":["../src/development-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;AAUzF;;kFAEkF;AAClF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,QAA6B,EAC7B,UAAkF,EAAE;IAEpF,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;IAC9C,IAAI,C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O,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS;YAC1F,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;IAChH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,UAAU,GAAG,IAAI,CAAC;QAAC,MAAM,KAAK,CAAC;IACjC,CAAC;YAAS,CAAC;QACT,4EAA4E;QAC5E,8DAA8D;QAC9D,IAAI,CAAC;YAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAAC,CAAC;QAC9D,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,UAAU;gBAAE,MAAM,KAAK,CAAC;YAC7B,iEAAiE;YACjE,kEAAkE;YAClE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,kCAAkC,EAAE,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACvG,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type DevelopmentBuildReceipt } from './development-build.js';
2
+ import { type DevelopmentValidationReceipt } from './development-validation.js';
3
+ import { DevelopmentContents } from './development-revisions.js';
4
+ interface CompilerOptions {
5
+ signal?: AbortSignal;
6
+ }
7
+ interface DevelopmentCoordinatorOptions {
8
+ maximumModules: number;
9
+ capture(moduleId: string): DevelopmentContents | Promise<DevelopmentContents>;
10
+ maximumAttempts?: number;
11
+ /** Trusted composition ports, never supplied by component configs or HTTP. */
12
+ validate?: (source: DevelopmentContents, options: CompilerOptions) => Promise<DevelopmentValidationReceipt>;
13
+ build?: (source: DevelopmentContents, options: CompilerOptions) => Promise<DevelopmentBuildReceipt>;
14
+ }
15
+ /** Joins capture -> common checks -> captured Vite build -> current recapture.
16
+ * It exposes checked bytes, never a claim that a Player has loaded them. */
17
+ export declare class DevelopmentModuleCoordinator {
18
+ #private;
19
+ constructor(options: DevelopmentCoordinatorOptions);
20
+ state(moduleId: string): import("./development-revisions.js").DevelopmentModuleState | undefined;
21
+ buildReceipt(moduleId: string): DevelopmentBuildReceipt | undefined;
22
+ refresh(moduleId: string, options?: CompilerOptions): Promise<boolean>;
23
+ remove(moduleId: string): void;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=development-coordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development-coordinator.d.ts","sourceRoot":"","sources":["../src/development-coordinator.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAA+B,KAAK,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAA0D,MAAM,4BAA4B,CAAC;AAEzH,UAAU,eAAe;IAAG,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE;AAClD,UAAU,6BAA6B;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC5G,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACrG;AAED;4EAC4E;AAC5E,qBAAa,4BAA4B;;gBAS3B,OAAO,EAAE,6BAA6B;IAYlD,KAAK,CAAC,QAAQ,EAAE,MAAM;IACtB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAK7D,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAmDhF,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAI/B"}
@@ -0,0 +1,114 @@
1
+ import { PROMPTFRAME_PUBLIC_SECURITY_POLICY_DIGEST } from '@promptframe/contracts';
2
+ import { buildDevelopmentContents } from './development-build.js';
3
+ import { validateDevelopmentContents } from './development-validation.js';
4
+ import { DevelopmentRevisionGate } from './development-revisions.js';
5
+ /** Joins capture -> common checks -> captured Vite build -> current recapture.
6
+ * It exposes checked bytes, never a claim that a Player has loaded them. */
7
+ export class DevelopmentModuleCoordinator {
8
+ #gate;
9
+ #active = new Map();
10
+ #receipts = new WeakMap();
11
+ #attempts;
12
+ #capture;
13
+ #validate;
14
+ #build;
15
+ constructor(options) {
16
+ this.#capture = options.capture;
17
+ this.#validate = options.validate ?? validateDevelopmentContents;
18
+ this.#build = options.build ?? buildDevelopmentContents;
19
+ this.#attempts = options.maximumAttempts ?? 3;
20
+ if (!Number.isSafeInteger(this.#attempts) || this.#attempts < 1 || this.#attempts > 8) {
21
+ throw new Error('development.check.invalid_attempts');
22
+ }
23
+ this.#gate = new DevelopmentRevisionGate({ maximumModules: options.maximumModules,
24
+ checkerKey: `captured-v1:${PROMPTFRAME_PUBLIC_SECURITY_POLICY_DIGEST}:vite/8.0.10` });
25
+ }
26
+ state(moduleId) { return this.#gate.state(moduleId); }
27
+ buildReceipt(moduleId) {
28
+ const checked = this.#gate.state(moduleId)?.lastChecked;
29
+ return checked ? this.#receipts.get(checked) : undefined;
30
+ }
31
+ async refresh(moduleId, options = {}) {
32
+ this.#active.get(moduleId)?.abort(new Error('development.check.superseded'));
33
+ const controller = new AbortController();
34
+ this.#active.set(moduleId, controller);
35
+ const signal = options.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
36
+ const currentRequest = () => this.#active.get(moduleId) === controller;
37
+ try {
38
+ let source = await this.#capture(moduleId);
39
+ for (let attempt = 0; attempt < this.#attempts; attempt++) {
40
+ if (!currentRequest())
41
+ return false;
42
+ signal.throwIfAborted();
43
+ const check = this.#gate.begin(moduleId, source);
44
+ let build;
45
+ try {
46
+ const validation = await this.#validate(source, { signal });
47
+ if (!currentRequest())
48
+ return false;
49
+ signal.throwIfAborted();
50
+ if (validation.sourceRevision !== source.revision)
51
+ throw new Error('development.check.source_mismatch');
52
+ build = await this.#build(source, { signal });
53
+ if (build.sourceRevision !== source.revision)
54
+ throw new Error('development.check.source_mismatch');
55
+ }
56
+ catch (error) {
57
+ if (!currentRequest())
58
+ return false;
59
+ signal.throwIfAborted();
60
+ const current = await this.#capture(moduleId);
61
+ if (!currentRequest())
62
+ return false;
63
+ if (current.revision !== source.revision) {
64
+ source = current;
65
+ this.#gate.begin(moduleId, current);
66
+ continue;
67
+ }
68
+ this.#gate.reject(check, current, diagnostic(error));
69
+ return false;
70
+ }
71
+ if (!currentRequest())
72
+ return false;
73
+ signal.throwIfAborted();
74
+ const current = await this.#capture(moduleId);
75
+ if (!currentRequest())
76
+ return false;
77
+ if (this.#gate.publish(check, current, build.artifacts)) {
78
+ this.#receipts.set(this.#gate.state(moduleId).lastChecked, build);
79
+ return true;
80
+ }
81
+ source = current;
82
+ }
83
+ // Continuous changes remain visibly checking with explicit lastChecked.
84
+ // The next event/manual refresh retries; no quiet-period sleep authorizes.
85
+ return false;
86
+ }
87
+ catch (error) {
88
+ if (currentRequest())
89
+ this.#gate.invalidate(moduleId, signal.aborted ? 'development.check.aborted' : diagnostic(error));
90
+ return false;
91
+ }
92
+ finally {
93
+ if (currentRequest())
94
+ this.#active.delete(moduleId);
95
+ }
96
+ }
97
+ remove(moduleId) {
98
+ this.#active.get(moduleId)?.abort(new Error('development.check.removed'));
99
+ this.#active.delete(moduleId);
100
+ this.#gate.remove(moduleId);
101
+ }
102
+ }
103
+ function diagnostic(error) {
104
+ if (error && typeof error === 'object') {
105
+ for (const key of ['diagnosticCode', 'code', 'message']) {
106
+ const descriptor = Object.getOwnPropertyDescriptor(error, key);
107
+ if (typeof descriptor?.value === 'string' && /^[a-z0-9_]+(?:\.[a-z0-9_]+)+$/u.test(descriptor.value)
108
+ && descriptor.value.length <= 256)
109
+ return descriptor.value;
110
+ }
111
+ }
112
+ return 'development.check.failed';
113
+ }
114
+ //# sourceMappingURL=development-coordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development-coordinator.js","sourceRoot":"","sources":["../src/development-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yCAAyC,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAgC,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,2BAA2B,EAAqC,MAAM,6BAA6B,CAAC;AAC7G,OAAO,EAAuB,uBAAuB,EAAiC,MAAM,4BAA4B,CAAC;AAYzH;4EAC4E;AAC5E,MAAM,OAAO,4BAA4B;IAC9B,KAAK,CAA0B;IAC/B,OAAO,GAAG,IAAI,GAAG,EAA2B,CAAC;IAC7C,SAAS,GAAG,IAAI,OAAO,EAAqD,CAAC;IAC7E,SAAS,CAAS;IAClB,QAAQ,CAA2C;IACnD,SAAS,CAAyD;IAClE,MAAM,CAAsD;IAErE,YAAY,OAAsC;QAChD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,IAAI,2BAA2B,CAAC;QACjE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,wBAAwB,CAAC;QACxD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,eAAe,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC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EAAE;gBAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAED,MAAM,CAAC,QAAgB;QACrB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7D,CAAC;CACF;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,KAAK,MAAM,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC;YACxD,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC/D,IAAI,OAAO,UAAU,EAAE,KAAK,KAAK,QAAQ,IAAI,gCAAgC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;mBAC/F,UAAU,CAAC,KAAK,CAAC,MAAM,IAAI,GAAG;gBAAE,OAAO,UAAU,CAAC,KAAK,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,OAAO,0BAA0B,CAAC;AACpC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** The local Player accepts captured, module-scoped styles, with no CSS I/O. */
2
+ export declare function compileDevelopmentCssModule(input: {
3
+ path: string;
4
+ text: string;
5
+ sourceRevision: string;
6
+ }): Promise<{
7
+ css: string;
8
+ classes: Record<string, string>;
9
+ }>;
10
+ //# sourceMappingURL=development-css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development-css.d.ts","sourceRoot":"","sources":["../src/development-css.ts"],"names":[],"mappings":"AAKA,gFAAgF;AAChF,wBAAsB,2BAA2B,CAAC,KAAK,EAAE;IACvD,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;CACpD,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,CAiD5D"}
@@ -0,0 +1,65 @@
1
+ import { createHash } from 'node:crypto';
2
+ import postcss from 'postcss';
3
+ import selectorParser from 'postcss-selector-parser';
4
+ import { preprocessCSS, resolveConfig } from 'vite';
5
+ /** The local Player accepts captured, module-scoped styles, with no CSS I/O. */
6
+ export async function compileDevelopmentCssModule(input) {
7
+ const reject = () => { throw new Error('development.build.unsupported_css'); };
8
+ // Escaped identifiers/URLs, imports, composition and ambient selectors need
9
+ // a captured dependency contract. Do not delegate their resolution to Vite.
10
+ if (!input.path.endsWith('.module.css') || input.text.includes('\\')
11
+ || /[#@]\s*sourceMappingURL\s*=/iu.test(input.text))
12
+ reject();
13
+ const root = postcss.parse(input.text, { from: input.path });
14
+ root.walkAtRules(rule => {
15
+ if (!['media', 'supports', 'container'].includes(rule.name.toLowerCase()))
16
+ reject();
17
+ });
18
+ root.walkRules(rule => {
19
+ if (rule.parent?.type === 'rule')
20
+ reject();
21
+ selectorParser(selectors => {
22
+ selectors.each(selector => {
23
+ const first = selector.nodes.find(node => node.type !== 'comment');
24
+ if (first?.type !== 'class')
25
+ reject();
26
+ });
27
+ selectors.walkPseudos(pseudo => {
28
+ if ([':global', ':local', ':root', ':host', ':host-context', '::slotted'].includes(pseudo.value.toLowerCase()))
29
+ reject();
30
+ });
31
+ selectors.walkCombinators(combinator => {
32
+ if (!['', '>'].includes(combinator.value.trim()))
33
+ reject();
34
+ });
35
+ }).processSync(rule.selector);
36
+ });
37
+ root.walkDecls(declaration => {
38
+ if (/^(?:composes|compose-with|behavior|-moz-binding|(?:-\w+-)?animation|(?:-\w+-)?transition)(?:-|$)/iu.test(declaration.prop))
39
+ reject();
40
+ });
41
+ // These functions are pure layout/color expressions. In particular url(),
42
+ // image-set(), expression() and file/font loaders cannot acquire resources.
43
+ const functions = new Set(['var', 'calc', 'clamp', 'min', 'max', 'rgb', 'rgba', 'hsl', 'hsla',
44
+ 'hwb', 'lab', 'lch', 'oklab', 'oklch', 'color', 'color-mix', 'linear-gradient',
45
+ 'radial-gradient', 'conic-gradient', 'repeating-linear-gradient', 'repeating-radial-gradient',
46
+ 'translate', 'translatex', 'translatey', 'translatez', 'translate3d', 'scale', 'scalex', 'scaley',
47
+ 'scalez', 'scale3d', 'rotate', 'rotatex', 'rotatey', 'rotatez', 'rotate3d', 'skew', 'skewx',
48
+ 'skewy', 'matrix', 'matrix3d', 'perspective', 'blur', 'brightness', 'contrast', 'grayscale',
49
+ 'hue-rotate', 'invert', 'opacity', 'saturate', 'sepia', 'drop-shadow', 'repeat', 'minmax', 'fit-content',
50
+ 'selector', 'style']);
51
+ for (const match of input.text.matchAll(/([a-z_-][\w-]*)\s*\(/giu)) {
52
+ if (!functions.has(match[1].toLowerCase()))
53
+ reject();
54
+ }
55
+ const namespace = createHash('sha256').update(input.sourceRevision).update('\0').update(input.path).digest('hex').slice(0, 20);
56
+ const config = await resolveConfig({
57
+ root: process.cwd(), configFile: false, envFile: false, publicDir: false, logLevel: 'silent',
58
+ css: { postcss: { plugins: [], map: false }, modules: { generateScopedName: name => `pf_${namespace}_${name}` } },
59
+ }, 'build');
60
+ const result = await preprocessCSS(input.text, `/promptframe-captured/${input.path}`, config);
61
+ if (!result.modules || result.deps?.size)
62
+ reject();
63
+ return { css: result.code, classes: result.modules };
64
+ }
65
+ //# sourceMappingURL=development-css.js.map