@pwfabric/compiler 1.0.0-rc.0 → 1.0.0-rc.2

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.
@@ -27,4 +27,3 @@ export interface CompanionScan {
27
27
  * followed.
28
28
  */
29
29
  export declare function collectCompanions(files: Readonly<Record<string, string | Uint8Array>>, entry: string, screen?: ScreenFn): CompanionScan;
30
- //# sourceMappingURL=companions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"companions.js","sourceRoot":"","sources":["../src/companions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACjC,OAAO,EAAE,YAAY,EAAyC,MAAM,aAAa,CAAA;AAKjF;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAA;IACzE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IAClD,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,IAAY,EACZ,KAAyD;IAEzD,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;IACzE,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IAClE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC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AAA;QAC5B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE;YAC1B,mBAAmB,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC5B,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;gBAClD,IAAI,MAAM;oBAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAChC,OAAO,MAAM,KAAK,IAAI,CAAA;YACxB,CAAC;SACF,CAAC,CAAA;QACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,MAAM,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAA;YAChD,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;QACnE,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;gBAAE,SAAQ;YAC9B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAChB,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACvB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAwB,CAAC,CAAC,CAAC,CAAA;QACvG,CAAC;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAA;AAChE,CAAC","sourcesContent":["/**\n * Companions — the shared pack code an atom's entry may import at value level.\n *\n * A pack keeps code that several atoms share in `atoms/lib/` (or `lib/` in the\n * rootless layout) and in `_shared-*` files next to the atoms. Those are the\n * only files a value-level relative import may reach; anything else in the tree\n * belongs to another atom and is not shipped with this one.\n *\n * {@link collectCompanions} walks an entry's relative imports transitively,\n * screening the entry and every companion it reaches with the same\n * {@link screenSource} rules, and returns the companion paths `compileAtom`\n * should be given. It is pure: the tree comes in as a map, nothing is read.\n *\n * @module @pwfabric/compiler/companions\n */\nimport { posix } from 'node:path'\nimport { screenSource, type ScreenOptions, type ScreenResult } from './screen.js'\n\n/** A screening function with {@link screenSource}'s shape — injectable for tests or stricter hosts. */\nexport type ScreenFn = (source: string, opts?: ScreenOptions) => ScreenResult\n\n/**\n * Whether a tree path may be reached by a value-level relative import:\n * shared lib code (`lib/…`, `atoms/lib/…`) or a `_shared-*` file anywhere.\n */\nexport function isCompanionTarget(path: string): boolean {\n if (path.startsWith('lib/') || path.startsWith('atoms/lib/')) return true\n const base = path.slice(path.lastIndexOf('/') + 1)\n return base.startsWith('_shared-')\n}\n\n/**\n * Resolve `spec`, imported from `fromPath`, to a companion file in `files`, or\n * `null` when it does not name one (missing, outside the tree, or not a\n * companion target).\n */\nexport function resolveCompanion(\n fromPath: string,\n spec: string,\n files: ReadonlySet<string> | ReadonlyMap<string, unknown>\n): string | null {\n const joined = posix.normalize(posix.join(posix.dirname(fromPath), spec))\n if (joined.startsWith('..') || joined.startsWith('/')) return null\n const noJs = joined.replace(/\\.(m?js|jsx)$/, '')\n const candidates = [\n joined,\n `${noJs}.ts`,\n `${noJs}.tsx`,\n `${joined}.ts`,\n `${joined}.tsx`,\n `${joined}.json`,\n `${joined}/index.ts`,\n `${joined}/index.tsx`,\n ]\n for (const c of candidates) {\n if (files.has(c) && isCompanionTarget(c)) return c\n }\n return null\n}\n\n/** Result of {@link collectCompanions}. */\nexport interface CompanionScan {\n readonly ok: boolean\n /** Every screening violation; a companion's are prefixed with its path. */\n readonly violations: readonly string[]\n /** Companion paths the entry reaches, in discovery order. Pass to `compileAtom`. */\n readonly companions: readonly string[]\n}\n\nfunction textOf(value: string | Uint8Array): string {\n return typeof value === 'string' ? value : new TextDecoder().decode(value)\n}\n\n/**\n * Screen `entry` and every companion it reaches, transitively. A relative value\n * import passes only when it resolves to a companion target, and that target is\n * screened in turn. JSON companions are data: collected, not screened or\n * followed.\n */\nexport function collectCompanions(\n files: Readonly<Record<string, string | Uint8Array>>,\n entry: string,\n screen: ScreenFn = screenSource\n): CompanionScan {\n const index = new Map(Object.entries(files))\n const source = index.get(entry)\n if (source === undefined) {\n return { ok: false, violations: [`entry '${entry}' is not in the source tree`], companions: [] }\n }\n const violations: string[] = []\n const companions: string[] = []\n const queue: Array<[string, string]> = [[entry, textOf(source)]]\n const seen = new Set<string>([entry])\n while (queue.length > 0) {\n const [path, text] = queue.shift() as [string, string]\n const reached: string[] = []\n const result = screen(text, {\n allowRelativeImport: (spec) => {\n const target = resolveCompanion(path, spec, index)\n if (target) reached.push(target)\n return target !== null\n },\n })\n if (!result.ok) {\n const prefix = path === entry ? '' : `${path}: `\n violations.push(...result.violations.map((v) => `${prefix}${v}`))\n }\n for (const target of reached) {\n if (seen.has(target)) continue\n seen.add(target)\n companions.push(target)\n if (!target.endsWith('.json')) queue.push([target, textOf(index.get(target) as string | Uint8Array)])\n }\n }\n return { ok: violations.length === 0, violations, companions }\n}\n"]}
package/dist/compile.d.ts CHANGED
@@ -84,4 +84,3 @@ export interface CompileResult {
84
84
  }
85
85
  /** Compile one atom. Never throws for bad input — every problem is a diagnostic. */
86
86
  export declare function compileAtom(input: CompileInput): Promise<CompileResult>;
87
- //# sourceMappingURL=compile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,SA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ACb,CAA4D;IAE5D,OAAO,EAAE,GAAG,CAAC,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA;AACrF,CAAC","sourcesContent":["/**\n * compileAtom — the single atom compiler.\n *\n * Source files in, one ES module out: a block's `component.tsx` (or a\n * capability's `handler.ts`, or a connector/provider engine) plus the\n * companion files it imports, bundled with esbuild into one ESM module the\n * runtime loads. The host-provided imports — the list in\n * `@pwfabric/core` (`BLOCK_HOST_IMPORTS`) — stay external;\n * the host's import map supplies them at load time.\n *\n * IN MEMORY ONLY. Every file comes from the caller's `files` map; an esbuild\n * plugin resolves and loads from that map and nothing else. There are no disk\n * writes, no disk reads of user paths and no network. A relative import that\n * climbs out of the tree is a diagnostic, not a read of whatever sits there.\n *\n * THE SEAM. The compiler returns data — bytes, hash, diagnostics. Storing the\n * bundle, recording it against an atom, licence checks and caching are the\n * caller's job, never this package's.\n *\n * DETERMINISM. Same input + same compiler version + same esbuild version →\n * identical `code` and `hash`. Both versions are returned so a caller can\n * record them beside the hash.\n *\n * @module @pwfabric/compiler/compile\n */\nimport { createHash } from 'node:crypto'\nimport { posix } from 'node:path'\nimport * as esbuild from 'esbuild'\nimport { atomKindMeta, type AtomKind } from '@pwfabric/contracts'\nimport { blockBundleExternals } from '@pwfabric/core'\nimport { joinVirtual, normalizeVirtualPath, PathEscapeError, resolveCandidates } from './paths.js'\nimport { buildWrapperSource, isValidEngineName, isValidSourceBase } from './wrappers.js'\nimport { COMPILER_VERSION, ESBUILD_VERSION } from './version.js'\n\n// ============================================================\n// CONTRACT\n// ============================================================\n\n/** Default cap on one compiled bundle; the caller may raise or lower it. */\nexport const MAX_ATOM_BUNDLE_BYTES = 500 * 1024\n\n/** esbuild language targets the compiler accepts. */\nexport type CompileTarget =\n | 'es2018'\n | 'es2019'\n | 'es2020'\n | 'es2021'\n | 'es2022'\n | 'es2023'\n | 'es2024'\n | 'esnext'\n\n/** Machine-readable reason for a diagnostic. */\nexport type DiagnosticCode =\n /** Bad call shape: missing entry, empty source, a kind that is not bundled. */\n | 'INVALID_INPUT'\n /** A file key or a relative import resolves outside the source tree. */\n | 'PATH_ESCAPE'\n /** A bare import that is not a host import. */\n | 'NON_HOST_IMPORT'\n /** A subpath of a host import — compiled external, but the host import map only resolves exact specifiers. */\n | 'HOST_SUBPATH_IMPORT'\n /** A relative import that names no file in the tree. */\n | 'UNRESOLVED_IMPORT'\n /** A relative import that names a file the caller did not declare as a companion. */\n | 'NOT_A_COMPANION'\n /** A file type the compiler has no loader for. */\n | 'UNSUPPORTED_FILE'\n /** A syntax or type-strip error reported by esbuild itself. */\n | 'ESBUILD_FAILED'\n /** The bundle is larger than `maxBytes`. */\n | 'BUNDLE_TOO_LARGE'\n\nexport interface Diagnostic {\n readonly severity: 'error' | 'warning'\n readonly code: DiagnosticCode\n readonly message: string\n /** Virtual path of the file the diagnostic points at, when esbuild knows it. */\n readonly file?: string\n readonly line?: number\n readonly column?: number\n}\n\nexport interface CompileInput {\n /**\n * The source tree: POSIX path relative to a virtual root → file content.\n * Backslashes are normalised; absolute or root-escaping keys are refused.\n */\n readonly files: Readonly<Record<string, string | Uint8Array>>\n /**\n * The entry's path in `files`. For `identity` kinds (block, capability) it is\n * the atom's own source (`blocks/<cat>/<name>/component.tsx`). For\n * `sibling-generated` kinds (connector, provider) it is the wrapper path the\n * contract derives (`resolveSiblingEntry(...).wrapperPath`); the compiler\n * generates that file, and the engine source must be in `files`.\n */\n readonly entry: string\n /**\n * Paths in `files` the entry may reach through relative imports (shared lib\n * code, `_shared-*` siblings, an engine source). Omitted → every file in\n * `files` may be reached. Given → importing any other file is a\n * `NOT_A_COMPANION` error. `collectCompanions()` computes this list.\n */\n readonly companions?: readonly string[]\n /** Atom kind; drives the entry wrapper. Default `'block'`. */\n readonly kind?: AtomKind\n /** `sibling-generated` kinds only: the engine's base name (connector `<Name>`, provider `<domain>`). */\n readonly engineName?: string\n /** Default `'es2022'`. */\n readonly target?: CompileTarget\n /** Default `true`. */\n readonly minify?: boolean\n /** Produce a source map in `map`. Default `false`. */\n readonly sourcemap?: boolean\n /** Bundle size cap in bytes. Default {@link MAX_ATOM_BUNDLE_BYTES}. */\n readonly maxBytes?: number\n}\n\nexport interface CompileResult {\n readonly ok: boolean\n /** The ES module. Empty when `ok` is false. */\n readonly code: string\n /** Source map JSON, when `sourcemap` was requested and the compile succeeded. */\n readonly map?: string\n /** `sha256:<hex>` of the UTF-8 bytes of `code`. Empty when `ok` is false. */\n readonly hash: string\n /** Byte length of `code`. */\n readonly size: number\n readonly diagnostics: readonly Diagnostic[]\n /** Host imports the module imports, sorted. These are what the host must provide to load it. */\n readonly externals: readonly string[]\n readonly compilerVersion: string\n readonly esbuildVersion: string\n}\n\n// ============================================================\n// LOADERS\n// ============================================================\n\nconst LOADERS: Readonly<Record<string, esbuild.Loader>> = {\n '.ts': 'ts',\n '.mts': 'ts',\n '.cts': 'ts',\n '.tsx': 'tsx',\n '.js': 'js',\n '.mjs': 'js',\n '.cjs': 'js',\n '.jsx': 'jsx',\n '.json': 'json',\n}\n\nconst NAMESPACE = 'pwfabric-atom'\nconst OUTFILE = 'bundle.mjs'\n\n// ============================================================\n// COMPILER\n// ============================================================\n\n/** Compile one atom. Never throws for bad input — every problem is a diagnostic. */\nexport async function compileAtom(input: CompileInput): Promise<CompileResult> {\n const diagnostics: Diagnostic[] = []\n const fail = (extra?: Diagnostic): CompileResult => {\n if (extra) diagnostics.push(extra)\n return result({ ok: false, code: '', hash: '', size: 0, diagnostics, externals: [] })\n }\n\n // ── normalise the tree ─────────────────────────────────────────\n const files = new Map<string, string | Uint8Array>()\n for (const [rawKey, content] of Object.entries(input.files)) {\n try {\n files.set(normalizeVirtualPath(rawKey), content)\n } catch (e) {\n if (e instanceof PathEscapeError) return fail(error('PATH_ESCAPE', `file key '${rawKey}' resolves outside the source tree`))\n throw e\n }\n }\n\n let entry: string\n let allowed: Set<string> | null = null\n try {\n entry = normalizeVirtualPath(input.entry)\n if (input.companions) allowed = new Set(input.companions.map(normalizeVirtualPath))\n } catch (e) {\n if (e instanceof PathEscapeError) return fail(error('PATH_ESCAPE', `${e.message}`))\n throw e\n }\n\n // ── entry wrapper, by kind ─────────────────────────────────────\n const kind: AtomKind = input.kind ?? 'block'\n const meta = atomKindMeta(kind)\n if (!meta.bundled) return fail(error('INVALID_INPUT', `Atom kind \"${kind}\" is not a bundled kind`))\n\n let esbuildEntry: string\n const ext = posix.extname(entry)\n if (meta.entry === 'identity') {\n const source = files.get(entry)\n if (source === undefined) return fail(error('INVALID_INPUT', `entry '${entry}' is not in the source tree`))\n if (source.length === 0) return fail(error('INVALID_INPUT', `Atom source for \"${entry}\" is empty`))\n const sourceBase = posix.basename(entry, ext)\n // The basename is written into the generated wrapper; it must be a plain name.\n if (!isValidSourceBase(sourceBase)) {\n return fail(error('INVALID_INPUT', `entry basename ${JSON.stringify(sourceBase)} may only contain letters, digits, '_', '-' and '.'`))\n }\n const wrapperPath = posix.join(posix.dirname(entry), `_bundle-entry${ext}`)\n if (files.has(wrapperPath)) {\n return fail(error('INVALID_INPUT', `'${wrapperPath}' is reserved for the generated entry wrapper`))\n }\n files.set(wrapperPath, buildWrapperSource(kind, { sourceBase }))\n allowed?.add(entry)\n esbuildEntry = wrapperPath\n } else if (meta.entry === 'sibling-generated') {\n if (!input.engineName) return fail(error('INVALID_INPUT', `Atom \"${entry}\" (${kind}) needs engineName`))\n // The engine name is written into the generated wrapper; it must be a plain name.\n if (!isValidEngineName(input.engineName)) {\n return fail(error('INVALID_INPUT', `engineName ${JSON.stringify(input.engineName)} may only contain letters, digits, '_' and '-'`))\n }\n if (files.has(entry)) {\n return fail(error('INVALID_INPUT', `'${entry}' is generated by the compiler for ${kind} atoms; it must not be in the source tree`))\n }\n files.set(entry, buildWrapperSource(kind, { engineName: input.engineName }))\n esbuildEntry = entry\n } else {\n return fail(error('INVALID_INPUT', `Atom kind \"${kind}\" has no bundleable entry`))\n }\n allowed?.add(esbuildEntry)\n\n // ── bundle ─────────────────────────────────────────────────────\n const hostImports = new Set(blockBundleExternals())\n const plugin = virtualTreePlugin(files, allowed, hostImports)\n\n let built: esbuild.BuildResult<{ write: false; metafile: true }>\n try {\n built = await esbuild.build({\n entryPoints: [esbuildEntry],\n outfile: OUTFILE,\n write: false,\n metafile: true,\n bundle: true,\n format: 'esm',\n platform: 'browser',\n target: input.target ?? 'es2022',\n minify: input.minify ?? true,\n treeShaking: true,\n sourcemap: input.sourcemap ? 'external' : false,\n jsx: 'automatic',\n logLevel: 'silent',\n plugins: [plugin],\n })\n } catch (e) {\n const failure = e as Partial<esbuild.BuildFailure>\n if (!Array.isArray(failure.errors)) throw e\n diagnostics.push(...failure.errors.map((m) => fromMessage(m, 'error')))\n diagnostics.push(...(failure.warnings ?? []).map((m) => fromMessage(m, 'warning')))\n return fail()\n }\n diagnostics.push(...built.warnings.map((m) => fromMessage(m, 'warning')))\n\n const out = built.outputFiles.find((f) => f.path.endsWith('.mjs'))\n const mapFile = built.outputFiles.find((f) => f.path.endsWith('.mjs.map'))\n /* c8 ignore next -- esbuild always emits the bundle when the build succeeds */\n if (!out) return fail(error('ESBUILD_FAILED', 'esbuild produced no output'))\n\n const maxBytes = input.maxBytes ?? MAX_ATOM_BUNDLE_BYTES\n if (out.contents.length > maxBytes) {\n return fail(error('BUNDLE_TOO_LARGE', `Atom \"${entry}\" bundle ${out.contents.length} bytes exceeds limit ${maxBytes}`))\n }\n\n const externals = new Set<string>()\n for (const output of Object.values(built.metafile.outputs)) {\n for (const imp of output.imports) if (imp.external) externals.add(imp.path)\n }\n\n return result({\n ok: true,\n code: out.text,\n ...(mapFile ? { map: mapFile.text } : {}),\n hash: `sha256:${createHash('sha256').update(out.contents).digest('hex')}`,\n size: out.contents.length,\n diagnostics,\n externals: [...externals].sort(),\n })\n}\n\n// ============================================================\n// THE VIRTUAL TREE\n// ============================================================\n\n/**\n * Resolves every import against the in-memory tree. Bare host imports are\n * external; every other bare import, every unresolvable or escaping relative\n * import and every undeclared companion is an error carrying its code in\n * `detail`, so all of them are reported in one pass.\n */\nfunction virtualTreePlugin(\n files: ReadonlyMap<string, string | Uint8Array>,\n allowed: ReadonlySet<string> | null,\n hostImports: ReadonlySet<string>\n): esbuild.Plugin {\n const reject = (code: DiagnosticCode, text: string): esbuild.OnResolveResult => ({\n errors: [{ text, detail: code }],\n })\n return {\n name: 'pwfabric-virtual-tree',\n setup(build) {\n build.onResolve({ filter: /.*/ }, (args) => {\n const spec = args.path\n if (args.kind === 'entry-point') return { path: spec, namespace: NAMESPACE }\n\n if (spec.startsWith('/') || /^[A-Za-z]:[\\\\/]/.test(spec)) {\n return reject('PATH_ESCAPE', `absolute import '${spec}' is not allowed; import relative to the file`)\n }\n if (spec.startsWith('.')) {\n let joined: string\n try {\n joined = joinVirtual(args.importer, spec)\n } catch {\n return reject('PATH_ESCAPE', `relative import '${spec}' resolves outside the source tree`)\n }\n const hit = resolveCandidates(joined).find((c) => files.has(c))\n if (!hit) return reject('UNRESOLVED_IMPORT', `cannot resolve '${spec}' from '${args.importer}'`)\n if (allowed && !allowed.has(hit)) {\n return reject('NOT_A_COMPANION', `'${spec}' resolves to '${hit}', which is not a declared companion of this atom`)\n }\n return { path: hit, namespace: NAMESPACE }\n }\n\n if (hostImports.has(spec)) return { path: spec, external: true }\n const hostRoot = [...hostImports].find((h) => spec.startsWith(`${h}/`))\n if (hostRoot) {\n return {\n path: spec,\n external: true,\n warnings: [\n {\n text: `'${spec}' is a subpath of the host import '${hostRoot}'; it stays external, but a host import map resolves exact specifiers only, so the host must map it explicitly`,\n detail: 'HOST_SUBPATH_IMPORT',\n },\n ],\n }\n }\n return reject(\n 'NON_HOST_IMPORT',\n `'${spec}' is not a host import. A bare import must be one the host provides (${[...hostImports].sort().join(', ')}); bundle anything else as a companion file`\n )\n })\n\n build.onLoad({ filter: /.*/, namespace: NAMESPACE }, (args) => {\n const loader = LOADERS[posix.extname(args.path)]\n if (!loader) {\n return { errors: [{ text: `no loader for '${args.path}' (supported: ${Object.keys(LOADERS).join(', ')})`, detail: 'UNSUPPORTED_FILE' }] }\n }\n return { contents: files.get(args.path) as string | Uint8Array, loader }\n })\n },\n }\n}\n\n// ============================================================\n// HELPERS\n// ============================================================\n\nfunction error(code: DiagnosticCode, message: string): Diagnostic {\n return { severity: 'error', code, message }\n}\n\nconst KNOWN_CODES: ReadonlySet<string> = new Set<DiagnosticCode>([\n 'INVALID_INPUT',\n 'PATH_ESCAPE',\n 'NON_HOST_IMPORT',\n 'HOST_SUBPATH_IMPORT',\n 'UNRESOLVED_IMPORT',\n 'NOT_A_COMPANION',\n 'UNSUPPORTED_FILE',\n 'ESBUILD_FAILED',\n 'BUNDLE_TOO_LARGE',\n])\n\nfunction fromMessage(m: esbuild.Message, severity: Diagnostic['severity']): Diagnostic {\n const code: DiagnosticCode =\n typeof m.detail === 'string' && KNOWN_CODES.has(m.detail) ? (m.detail as DiagnosticCode) : 'ESBUILD_FAILED'\n const loc = m.location\n return {\n severity,\n code,\n message: m.text,\n ...(loc ? { file: loc.file.replace(`${NAMESPACE}:`, ''), line: loc.line, column: loc.column } : {}),\n }\n}\n\nfunction result(\n r: Omit<CompileResult, 'compilerVersion' | 'esbuildVersion'>\n): CompileResult {\n return { ...r, compilerVersion: COMPILER_VERSION, esbuildVersion: ESBUILD_VERSION }\n}\n"]}
package/dist/folder.d.ts CHANGED
@@ -3,4 +3,3 @@ import { type CompileInput, type CompileResult } from './compile.js';
3
3
  export declare function readSourceTree(dir: string): Promise<Record<string, Uint8Array>>;
4
4
  /** Compile the atom whose entry is `entry` (relative to `dir`) from the tree under `dir`. */
5
5
  export declare function compileFolder(dir: string, entry: string, options?: Omit<CompileInput, 'files' | 'entry'>): Promise<CompileResult>;
6
- //# sourceMappingURL=folder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"folder.js","sourceRoot":"","sources":["../src/folder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,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AAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACxE,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;YAClC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;gBACpB,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;oBAAE,SAAQ;gBAC7D,MAAM,IAAI,CAAC,IAAI,CAAC,CAAA;YAClB,CAAC;iBAAM,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;gBACtB,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAA;YACxE,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IACD,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;IACf,OAAO,KAAK,CAAA;AACd,CAAC;AAED,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,KAAa,EACb,UAAiD,EAAE;IAEnD,OAAO,WAAW,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAC7E,CAAC","sourcesContent":["/**\n * compileFolder — a convenience for a source tree that lives on disk.\n *\n * Reads every file under `dir` into memory (skipping `node_modules`, `dist`\n * and dot-directories), then hands the map to {@link compileAtom}. Reading is\n * the only disk access; compilation itself stays in memory. A pack reader that\n * already holds the tree should call `compileAtom` directly.\n *\n * @module @pwfabric/compiler/folder\n */\nimport { readdir, readFile } from 'node:fs/promises'\nimport { join, relative, sep } from 'node:path'\nimport { compileAtom, type CompileInput, type CompileResult } from './compile.js'\n\nconst SKIP_DIRS = new Set(['node_modules', 'dist'])\n\n/** Read a directory into a `files` map keyed by POSIX path relative to `dir`. */\nexport async function readSourceTree(dir: string): Promise<Record<string, Uint8Array>> {\n const files: Record<string, Uint8Array> = {}\n const walk = async (current: string): Promise<void> => {\n const entries = await readdir(current, { withFileTypes: true })\n entries.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))\n for (const e of entries) {\n const full = join(current, e.name)\n if (e.isDirectory()) {\n if (SKIP_DIRS.has(e.name) || e.name.startsWith('.')) continue\n await walk(full)\n } else if (e.isFile()) {\n files[relative(dir, full).split(sep).join('/')] = await readFile(full)\n }\n }\n }\n await walk(dir)\n return files\n}\n\n/** Compile the atom whose entry is `entry` (relative to `dir`) from the tree under `dir`. */\nexport async function compileFolder(\n dir: string,\n entry: string,\n options: Omit<CompileInput, 'files' | 'entry'> = {}\n): Promise<CompileResult> {\n return compileAtom({ ...options, files: await readSourceTree(dir), entry })\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -13,4 +13,3 @@ export { screenSource, maskSource, SCREEN_IMPORT_ALLOWLIST, screenBlockSource, B
13
13
  export { collectCompanions, isCompanionTarget, resolveCompanion, type CompanionScan, type ScreenFn, } from './companions.js';
14
14
  export { buildWrapperSource, isValidEngineName, isValidSourceBase, type WrapperContext } from './wrappers.js';
15
15
  export { COMPILER_VERSION, ESBUILD_VERSION } from './version.js';
16
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,WAAW,EACX,qBAAqB,GAMtB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EACL,YAAY,EACZ,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,6BAA6B,GAG9B,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GAGjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAuB,MAAM,eAAe,CAAA;AAC7G,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,WAAW,EACX,qBAAqB,GAMtB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EACL,YAAY,EACZ,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,6BAA6B,GAG9B,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GAGjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAuB,MAAM,eAAe,CAAA;AAC7G,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA","sourcesContent":["/**\n * @pwfabric/compiler — the atom compiler.\n *\n * Block / capability / connector / provider source in, one ES module out, with\n * the host-provided imports left external. Pure: the caller supplies the files\n * and stores the result.\n *\n * @module @pwfabric/compiler\n */\nexport {\n compileAtom,\n MAX_ATOM_BUNDLE_BYTES,\n type CompileInput,\n type CompileResult,\n type CompileTarget,\n type Diagnostic,\n type DiagnosticCode,\n} from './compile.js'\nexport { compileFolder, readSourceTree } from './folder.js'\nexport {\n screenSource,\n maskSource,\n SCREEN_IMPORT_ALLOWLIST,\n screenBlockSource,\n BLOCK_SOURCE_IMPORT_ALLOWLIST,\n type ScreenOptions,\n type ScreenResult,\n} from './screen.js'\nexport {\n collectCompanions,\n isCompanionTarget,\n resolveCompanion,\n type CompanionScan,\n type ScreenFn,\n} from './companions.js'\nexport { buildWrapperSource, isValidEngineName, isValidSourceBase, type WrapperContext } from './wrappers.js'\nexport { COMPILER_VERSION, ESBUILD_VERSION } from './version.js'\n"]}
package/dist/paths.d.ts CHANGED
@@ -22,4 +22,3 @@ export declare function joinVirtual(fromPath: string, spec: string): string;
22
22
  * plus each resolve extension; then `index.*` inside it.
23
23
  */
24
24
  export declare function resolveCandidates(joined: string): string[];
25
- //# sourceMappingURL=paths.d.ts.map
package/dist/paths.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAEjC,gEAAgE;AAChE,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACnB;IAArB,YAAqB,SAAiB;QACpC,KAAK,CAAC,0CAA0C,SAAS,EAAE,CAAC,CAAA;QADzC,cAAS,GAAT,SAAS,CAAQ;QAEpC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAA;IAC/B,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACvC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,eAAe,CAAC,GAAG,CAAC,CAAA;IAClF,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,eAAe,CAAC,GAAG,CAAC,CAAA;IACzF,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAA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AC;SAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;QAC1B,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACxC,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,kBAAkB;QAAE,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,CAAA;IAC7D,KAAK,MAAM,CAAC,IAAI,kBAAkB;QAAE,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,SAAS,CAAC,EAAE,CAAC,CAAA;IACnE,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["/**\n * Virtual paths. The compiler never touches a disk: every file lives in the\n * caller's `files` map under a POSIX path relative to a virtual root. This\n * module is the one place that decides what such a path may look like.\n *\n * Containment is decided by where a path RESOLVES, not by whether it spells\n * `..`: `lib/../lib/x.ts` is fine, `../x.ts` is not. A relative import that\n * climbs within the tree is legitimate (a block in `blocks/a/b/` reaching\n * `lib/` climbs three levels); one that climbs past the root is the escape.\n */\nimport { posix } from 'node:path'\n\n/** Thrown for a path that resolves outside the virtual root. */\nexport class PathEscapeError extends Error {\n constructor(readonly attempted: string) {\n super(`Path resolves outside the source tree: ${attempted}`)\n this.name = 'PathEscapeError'\n }\n}\n\n/**\n * Normalise a caller-supplied key to the canonical virtual form: forward\n * slashes, no leading `./`, no `.`/`..` segments. Throws {@link PathEscapeError}\n * for an absolute path (POSIX or drive-letter), a NUL byte, an empty path, or a\n * path whose `..` segments climb past the root.\n */\nexport function normalizeVirtualPath(raw: string): string {\n const slashed = raw.replace(/\\\\/g, '/')\n if (slashed.length === 0 || slashed.includes('\\0')) throw new PathEscapeError(raw)\n if (slashed.startsWith('/') || /^[A-Za-z]:/.test(slashed)) throw new PathEscapeError(raw)\n const normalized = posix.normalize(slashed)\n if (normalized === '..' || normalized.startsWith('../') || normalized === '.' || normalized.endsWith('/')) {\n throw new PathEscapeError(raw)\n }\n return normalized\n}\n\n/**\n * Join a relative specifier onto the directory of `fromPath` and normalise.\n * Throws {@link PathEscapeError} when the result leaves the root.\n */\nexport function joinVirtual(fromPath: string, spec: string): string {\n const joined = posix.normalize(posix.join(posix.dirname(fromPath), spec))\n if (joined === '..' || joined.startsWith('../') || joined.startsWith('/')) {\n throw new PathEscapeError(spec)\n }\n return joined\n}\n\n/** esbuild's default resolve order, which the on-disk compiler relied on. */\nconst RESOLVE_EXTENSIONS = ['.tsx', '.ts', '.jsx', '.js', '.json'] as const\n\n/**\n * The files a resolved-but-unextended path may name, in esbuild's own order:\n * the exact path; for a `.js`/`.jsx`/`.mjs` spelling, the TypeScript file it\n * stands for (esbuild rewrites `./x.js` to `./x.ts` the same way); the path\n * plus each resolve extension; then `index.*` inside it.\n */\nexport function resolveCandidates(joined: string): string[] {\n const out = [joined]\n const ext = posix.extname(joined)\n if (ext === '.js' || ext === '.jsx') {\n const base = joined.slice(0, -ext.length)\n out.push(`${base}.ts`, `${base}.tsx`)\n } else if (ext === '.mjs') {\n out.push(`${joined.slice(0, -4)}.mts`)\n }\n for (const e of RESOLVE_EXTENSIONS) out.push(`${joined}${e}`)\n for (const e of RESOLVE_EXTENSIONS) out.push(`${joined}/index${e}`)\n return out\n}\n"]}
package/dist/screen.d.ts CHANGED
@@ -118,4 +118,3 @@ export declare function screenSource(source: string, opts?: ScreenOptions): Scre
118
118
  export declare const screenBlockSource: typeof screenSource;
119
119
  /** Alternative name for `SCREEN_IMPORT_ALLOWLIST`. */
120
120
  export declare const BLOCK_SOURCE_IMPORT_ALLOWLIST: readonly string[];
121
- //# sourceMappingURL=screen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"screen.js","sourceRoot":"","sources":["../src/screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD;;;;;;;;;;;;;;G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AAc,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;QACtE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,SAAQ;QAC3E,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACrD,UAAU,CAAC,IAAI,CACb,QAAQ,IAAI,sBAAsB,CAAC,CAAC,IAAI,uHAAuH,CAChK,CAAA;QACH,CAAC;aAAM,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACrD,UAAU,CAAC,IAAI,CACb,QAAQ,IAAI,aAAa,CAAC,CAAC,IAAI,4CAA4C,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACjH,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;AAC3E,CAAC;AAED,2CAA2C;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAA;AAC7C,sDAAsD;AACtD,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAA","sourcesContent":["/**\n * Source screening — what a block or capability source may CONTAIN.\n *\n * ── THIS IS A HYGIENE CHECK, NOT A SECURITY BOUNDARY. ──\n * It is a regex denylist over comment- and literal-masked text. Aliasing a global through a binding (`const g = globalThis;\n * g['fe' + 'tch']`), `Reflect.get`, `top[...]` and similar spellings walk past\n * it — the tests pin several as known gaps. Running untrusted block code safely\n * is the HOST's job: an isolated origin or sandboxed iframe/worker for block\n * bundles, plus a Content Security Policy. Do not treat a passing screen as\n * permission to run a module with the host's privileges.\n *\n * Authorisation (\"may this caller add a block\") is the host's business. This\n * answers the different question: once a source string reaches the compiler,\n * may the module it becomes reach the ambient browser capabilities that turn\n * \"renders a component\" into \"reads your session and ships it somewhere\"?\n *\n * A source that arrives as content — written by a model steered by text an\n * attacker can influence, or posted directly by a caller — is compiled and then\n * executed by every renderer that loads it, on the host's own origin, inside an\n * authenticated session. So the module is constrained: it may render from its\n * props; it may not reach network egress, credential stores or code\n * construction.\n *\n * This narrows the blast radius. It does NOT stop prompt injection — see\n * {@link screenSource}'s KNOWN GAPS for exactly what still gets through.\n *\n * The compiler does not call this for you: `compileAtom` compiles what it is\n * given. A host that compiles untrusted source screens it first, and screens\n * every companion the source reaches — `collectCompanions` does both.\n *\n * @module @pwfabric/compiler/screen\n */\n\nimport { blockBundleExternals } from '@pwfabric/core'\n\n/**\n * Module specifiers a screened source may import at VALUE level.\n *\n * DERIVED from the host import list (`blockBundleExternals()` over\n * `BLOCK_HOST_IMPORTS` in `@pwfabric/core`), so the screen and\n * the bundler can never disagree. A narrower hand-written list would refuse\n * real packs, which import the runtime for the event bus, surface id and\n * connection contexts. A specifier the bundler\n * leaves external and every host maps for compiled blocks is a specifier the\n * screen admits; one list says both.\n *\n * What still keeps a screened module from network egress, credential stores\n * and code construction is layer 2 (the forbidden-capability scan) and the\n * host's sandbox — not the narrowness of this list.\n */\nexport const SCREEN_IMPORT_ALLOWLIST: readonly string[] = Object.freeze([...blockBundleExternals()])\n\nexport type ScreenResult =\n | { readonly ok: true }\n | { readonly ok: false; readonly violations: readonly string[] }\n\n/**\n * Browser capabilities a screened source may not reach.\n *\n * Every entry was checked against a large set of real block components before\n * being added: it appears in none of them, so none is the price of a\n * legitimate block. The list is the \"turns rendering into exfiltration or\n * execution\" set, not a general-purpose JS denylist:\n *\n * - arbitrary code construction (`eval`, `Function`, `.constructor(...)`)\n * - network egress (`fetch`, `XMLHttpRequest`, `WebSocket`, `EventSource`,\n * `sendBeacon`, `importScripts`, `Worker`, `RTCPeerConnection`)\n * - cross-context messaging (`postMessage`)\n * - credential/state reads (`document.cookie`, `localStorage`,\n * `sessionStorage`, `indexedDB`, `caches`, `process.env`)\n * - document rewriting (`document.write`/`writeln`/`domain`,\n * `createElement('script')`)\n * - the obvious spellings-around: computed member access on a global\n * (`window[...]`, `globalThis[...]`, `self[...]`, `document[...]`) and\n * module loading at run time (`import()`, `require()`).\n *\n * Patterns whose evidence lives INSIDE a string literal (the `createElement`\n * pair) run against the comment-masked-but-literals-intact source instead. They\n * are weak by construction — `createElement(tag)` with a computed `tag` walks\n * straight past — but the literal spelling is the one a model actually emits.\n */\nconst FORBIDDEN_SOURCE_PATTERNS: ReadonlyArray<readonly [RegExp, string]> = [\n [/\\beval\\s*\\(/, 'eval()'],\n [/\\bnew\\s+Function\\b/, 'new Function()'],\n [/\\bFunction\\s*\\(/, 'Function() as a constructor/call'],\n [/\\.\\s*constructor\\s*[[(]/, '.constructor access (Function-constructor escape)'],\n [/\\bfetch\\s*\\(/, 'fetch()'],\n [/\\bXMLHttpRequest\\b/, 'XMLHttpRequest'],\n [/\\bWebSocket\\b/, 'WebSocket'],\n [/\\bEventSource\\b/, 'EventSource'],\n [/\\bsendBeacon\\b/, 'navigator.sendBeacon()'],\n [/\\bimportScripts\\s*\\(/, 'importScripts()'],\n [/\\b(?:Shared)?Worker\\s*\\(/, 'Worker()'],\n [/\\bRTCPeerConnection\\b/, 'RTCPeerConnection'],\n [/\\bpostMessage\\s*\\(/, 'postMessage()'],\n [/\\bdocument\\s*\\.\\s*cookie\\b/, 'document.cookie'],\n [/\\bdocument\\s*\\.\\s*(?:write|writeln|domain)\\b/, 'document.write / writeln / domain'],\n [/\\blocalStorage\\b/, 'localStorage'],\n [/\\bsessionStorage\\b/, 'sessionStorage'],\n [/\\bindexedDB\\b/, 'indexedDB'],\n [/\\bcaches\\s*\\./, 'caches (CacheStorage)'],\n [/\\bprocess\\s*\\.\\s*env\\b/, 'process.env'],\n [/\\b(?:window|globalThis|self|document)\\s*\\[/, 'computed member access on a global object'],\n [/\\bimport\\s*\\(/, 'dynamic import()'],\n [/\\brequire\\s*\\(/, 'require()'],\n] as const\nconst FORBIDDEN_LITERAL_PATTERNS: ReadonlyArray<readonly [RegExp, string]> = [\n [/\\bcreateElement\\s*\\(\\s*['\"`]script['\"`]/, \"createElement('script')\"],\n [/\\bcreateElement\\s*\\(\\s*['\"`]iframe['\"`]/, \"createElement('iframe')\"],\n] as const\n\n/**\n * Blank out comments and (optionally) string/template/regex literal CONTENT,\n * preserving byte offsets and newlines so reported line numbers stay true.\n *\n * Why this exists rather than a raw `source.includes('fetch(')`: a shipped\n * first-party block's JSDoc says `same-origin fetch('/api/orders')`. A scan that\n * did not strip comments would refuse a block for describing itself. Template\n * SUBSTITUTIONS (`${...}`) are deliberately kept live — that is real code.\n *\n * The literal scanner must run even when `blankLiterals` is false, because a\n * `//` or a `/` inside a string would otherwise be misread as a comment or a\n * regex and swallow the rest of the file.\n */\nexport function maskSource(src: string, blankLiterals: boolean): string {\n let out = ''\n let i = 0\n let prev = '\\n'\n const blank = (ch: string): string => (ch === '\\n' ? '\\n' : ' ')\n const emit = (ch: string): void => {\n out += blankLiterals ? blank(ch) : ch\n }\n\n while (i < src.length) {\n const two = src.slice(i, i + 2)\n\n if (two === '//') {\n while (i < src.length && src[i] !== '\\n') {\n out += ' '\n i++\n }\n continue\n }\n if (two === '/*') {\n while (i < src.length && src.slice(i, i + 2) !== '*/') {\n out += blank(src[i] as string)\n i++\n }\n out += ' '\n i += 2\n continue\n }\n\n const c = src[i] as string\n\n if (c === \"'\" || c === '\"') {\n emit(c)\n i++\n while (i < src.length && src[i] !== c) {\n if (src[i] === '\\\\') {\n emit(src[i] as string)\n i++\n if (i >= src.length) break\n }\n emit(src[i] as string)\n i++\n }\n if (i < src.length) {\n emit(src[i] as string)\n i++\n }\n prev = c\n continue\n }\n\n if (c === '`') {\n emit(c)\n i++\n while (i < src.length) {\n if (src[i] === '\\\\') {\n emit(src[i] as string)\n i++\n if (i >= src.length) break\n emit(src[i] as string)\n i++\n continue\n }\n if (src[i] === '`') {\n emit(src[i] as string)\n i++\n break\n }\n if (src.slice(i, i + 2) === '${') {\n // Live code — copy verbatim, tracking brace depth back to the `}`.\n out += '${'\n i += 2\n let depth = 1\n while (i < src.length && depth > 0) {\n const s = src[i] as string\n if (s === '{') depth++\n else if (s === '}') depth--\n out += s\n i++\n }\n continue\n }\n emit(src[i] as string)\n i++\n }\n prev = '`'\n continue\n }\n\n // Regex literal: a `/` in a position where a value may start.\n if (c === '/' && /[(,=:[!&|?{};+\\-*%~^<>\\n]/.test(prev)) {\n emit(c)\n i++\n while (i < src.length && src[i] !== '/' && src[i] !== '\\n') {\n if (src[i] === '\\\\') {\n emit(src[i] as string)\n i++\n if (i >= src.length) break\n }\n emit(src[i] as string)\n i++\n }\n if (i < src.length && src[i] === '/') {\n emit(src[i] as string)\n i++\n }\n while (i < src.length && /[dgimsuy]/.test(src[i] as string)) {\n emit(src[i] as string)\n i++\n }\n prev = '/'\n continue\n }\n\n out += c\n if (!/\\s/.test(c)) prev = c\n i++\n }\n return out\n}\n\nconst IMPORT_FROM_RE = /(?:^|[\\n;])[ \\t]*(import|export)\\b([ \\t]+type\\b)?([^;]*?)\\bfrom[ \\t]*['\"]([^'\"]+)['\"]/g\nconst BARE_IMPORT_RE = /(?:^|[\\n;])[ \\t]*import[ \\t]*['\"]([^'\"]+)['\"]/g\n\nfunction lineOf(src: string, index: number): number {\n return src.slice(0, index).split('\\n').length\n}\n\n/**\n * Where the statement itself starts inside an import match. The import\n * patterns open on the newline or `;` that precedes a statement, so the match\n * index can sit one line early — or, at the very start of the file, not early\n * at all. Skipping the separators gives the statement's own line either way.\n */\nfunction statementIndex(src: string, matchIndex: number): number {\n let i = matchIndex\n while (i < src.length && /[\\n; \\t]/.test(src[i] as string)) i++\n return i\n}\n\n/** Options for {@link screenSource}. */\nexport interface ScreenOptions {\n /**\n * The door for shared pack code. A value-level relative import is allowed\n * only when this returns true for the specifier — i.e. the caller says it\n * resolves to a file it will ship as a companion (`atoms/lib/*` or a\n * `_shared-*` sibling) and will screen that file with this same function.\n * Without the option every relative value import is rejected.\n */\n readonly allowRelativeImport?: (spec: string) => boolean\n}\n\n/**\n * Screen one source before it is allowed anywhere near the compiler. Returns\n * every violation found (not just the first) so a repair loop gets a complete,\n * actionable message.\n *\n * TWO LAYERS:\n * 1. IMPORT ALLOWLIST — every value-level `import`/`export ... from` and bare\n * `import '...'` specifier must be in {@link SCREEN_IMPORT_ALLOWLIST}.\n * Relative specifiers are rejected at value level unless\n * {@link ScreenOptions.allowRelativeImport} admits them, but permitted on\n * `import type` / `export type` statements, which the compiler erases.\n * 2. ESCAPE SCAN — the forbidden-capability patterns over the\n * comment-and-literal-masked source.\n *\n * ── KNOWN GAPS. Read these before believing this closes anything. ──\n *\n * This is a DENYLIST over source text, not a sandbox, and it is deliberately\n * incomplete. It does not stop:\n *\n * - **Prompt injection itself.** Attacker-controlled text still steers the\n * model. All this changes is what the resulting module is allowed to do.\n * - **`dangerouslySetInnerHTML` / `innerHTML`.** 30 of the 100 first-party\n * blocks use `dangerouslySetInnerHTML` for inline SVG icon paths, so it is\n * allowed — a screened block CAN inject arbitrary markup.\n * - **Navigation-based exfiltration.** `window.location.href = ...` is used by\n * first-party blocks for link handling, so it is allowed; a block can\n * navigate the tab to an attacker URL with data in the query.\n * - **Rendering hostile content into props/children**, phishing UI, and any\n * purely-visual deception.\n * - **Sufficiently indirect spellings.** The scan is textual: identifiers\n * assembled at run time, property names built from arrays, aliasing a global\n * through a permitted binding, or `top`/`parent` (excluded from the\n * computed-access rule because they are common local names) can still reach\n * a banned capability. Closing that class needs an execution sandbox (CSP +\n * an isolated origin/worker for block bundles), not a string scan.\n */\nexport function screenSource(source: string, opts?: ScreenOptions): ScreenResult {\n const violations: string[] = []\n\n // Layer 2 runs over fully-masked source (comments + literal content gone).\n const code = maskSource(source, true)\n for (const [pattern, label] of FORBIDDEN_SOURCE_PATTERNS) {\n const m = pattern.exec(code)\n if (m) {\n violations.push(`line ${lineOf(code, m.index)}: ${label} is not permitted in a block component`)\n }\n }\n\n // Layer 1 runs over comment-masked-but-literals-intact source: the\n // specifier itself lives inside quotes, but a commented-out import must not\n // count. The literal-evidence patterns share that view.\n const withStrings = maskSource(source, false)\n for (const [pattern, label] of FORBIDDEN_LITERAL_PATTERNS) {\n const lm = pattern.exec(withStrings)\n if (lm) {\n violations.push(\n `line ${lineOf(withStrings, lm.index)}: ${label} is not permitted in a block component`\n )\n }\n }\n\n const specs: Array<{ typeOnly: boolean; spec: string; index: number }> = []\n IMPORT_FROM_RE.lastIndex = 0\n let m: RegExpExecArray | null\n while ((m = IMPORT_FROM_RE.exec(withStrings)) !== null) {\n specs.push({ typeOnly: m[2] !== undefined, spec: m[4] as string, index: m.index })\n }\n BARE_IMPORT_RE.lastIndex = 0\n while ((m = BARE_IMPORT_RE.exec(withStrings)) !== null) {\n specs.push({ typeOnly: false, spec: m[1] as string, index: m.index })\n }\n\n for (const s of specs) {\n if (s.typeOnly) continue\n const line = lineOf(withStrings, statementIndex(withStrings, s.index))\n if (s.spec.startsWith('.') && opts?.allowRelativeImport?.(s.spec)) continue\n if (s.spec.startsWith('.') || s.spec.startsWith('/')) {\n violations.push(\n `line ${line}: relative import '${s.spec}' — a generated block is bundled as a single self-contained file; only \\`import type\\` may reference a sibling module`\n )\n } else if (!SCREEN_IMPORT_ALLOWLIST.includes(s.spec)) {\n violations.push(\n `line ${line}: import '${s.spec}' is outside the block import allowlist (${SCREEN_IMPORT_ALLOWLIST.join(', ')})`\n )\n }\n }\n\n return violations.length === 0 ? { ok: true } : { ok: false, violations }\n}\n\n/** Alternative name for `screenSource`. */\nexport const screenBlockSource = screenSource\n/** Alternative name for `SCREEN_IMPORT_ALLOWLIST`. */\nexport const BLOCK_SOURCE_IMPORT_ALLOWLIST = SCREEN_IMPORT_ALLOWLIST\n"]}
package/dist/version.d.ts CHANGED
@@ -2,4 +2,3 @@
2
2
  export declare const COMPILER_VERSION: string;
3
3
  /** The esbuild version that produced the bytes. */
4
4
  export declare const ESBUILD_VERSION: string;
5
- //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,SAAS,CAAA;AAEnD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAE9C,2FAA2F;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAY,OAAO,CAAC,iBAAiB,CAAyB,CAAC,OAAO,CAAA;AAEnG,mDAAmD;AACnD,MAAM,CAAC,MAAM,eAAe,GAAW,cAAc,CAAA"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,SAAS,CAAA;AAEnD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAE9C,2FAA2F;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAY,OAAO,CAAC,iBAAiB,CAAyB,CAAC,OAAO,CAAA;AAEnG,mDAAmD;AACnD,MAAM,CAAC,MAAM,eAAe,GAAW,cAAc,CAAA","sourcesContent":["/**\n * Versions a caller records next to a compiled bundle.\n *\n * Same input + same compiler version + same esbuild version → identical bytes.\n * Both versions are read at run time (not copied into a constant) so a release\n * that bumps `package.json` cannot leave a stale number behind.\n */\nimport { createRequire } from 'node:module'\nimport { version as esbuildVersion } from 'esbuild'\n\nconst require = createRequire(import.meta.url)\n\n/** This package's version — `dist/` and `src/` both sit one level below `package.json`. */\nexport const COMPILER_VERSION: string = (require('../package.json') as { version: string }).version\n\n/** The esbuild version that produced the bytes. */\nexport const ESBUILD_VERSION: string = esbuildVersion\n"]}
@@ -41,4 +41,3 @@ export declare function isValidSourceBase(base: string): boolean;
41
41
  * Throws on a name that fails {@link isValidEngineName} / {@link isValidSourceBase}.
42
42
  */
43
43
  export declare function buildWrapperSource(kind: AtomKind, ctx: WrapperContext): string;
44
- //# sourceMappingURL=wrappers.d.ts.map
package/dist/wrappers.js CHANGED
@@ -74,6 +74,10 @@ const _resolveDefinition = (m) => {
74
74
 
75
75
  const _resolveComponent = (m) => {
76
76
  if (typeof m.default === 'function') return m.default
77
+ // A block written with defineBlock() exports only its definition, and the
78
+ // definition carries the component.
79
+ const d = _resolveDefinition(m)
80
+ if (d && typeof d.component === 'function') return d.component
77
81
  for (const k of Object.keys(m)) {
78
82
  const v = m[k]
79
83
  if (typeof v === 'function') return v
@@ -1 +1 @@
1
- {"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../src/wrappers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAA;AAYjE;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,kBAAkB,CAAA;AACzC,MAAM,cAAc,GAAG,mBAAmB,CAAA;AAE1C,2EAA2E;AAC3E,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAClC,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,GAAG,CAAA;AAC1E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAc,EA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;;;;;;;;;;;;;;MA0B7E,IAAI,CAAC,SAAS,CAAC,oBAAoB,MAAM,6DAA6D,CAAC;;;;CAI5G,CAAA;AACD,CAAC","sourcesContent":["/**\n * Entry wrappers — the thin module the compiler actually bundles.\n *\n * Which template applies is decided by the kind's `entry` metadata in\n * `@pwfabric/contracts` (`atomKindMeta(kind).entry`), not by\n * ad-hoc \"block vs capability vs connector\" branches:\n *\n * - block (identity) → re-export the component and the definition under\n * the stable names `Component` + `definition`, so the\n * runtime's block module loader reads two fixed keys\n * whatever the author named them.\n * - capability (identity) → opaque `export *` (the handler contract is not\n * normalised).\n * - connector (sibling) → loader-contract adapter: `createConnector` that\n * delegates to an explicit export, wraps an engine\n * class (`prototype.query`), or calls/constructs the\n * default export of the sibling `./<Name>`.\n * - provider (sibling) → per-facet entry over the SHARED vendor motor\n * (`../index`): binds the domain's entity map from\n * `./<domain>` into the vendor engine class, or falls\n * back to a vendor `create*` factory.\n *\n * @module @pwfabric/compiler/wrappers\n */\nimport { atomKindMeta, type AtomKind } from '@pwfabric/contracts'\n\n/**\n * Context passed to the wrapper registry. `identity` kinds supply `sourceBase`\n * (basename of the atom's own source, no extension); `sibling-generated` kinds\n * supply `engineName` (connector `<Name>` / provider `<domain>`).\n */\nexport interface WrapperContext {\n readonly sourceBase?: string\n readonly engineName?: string\n}\n\n/**\n * NAMES ARE UNTRUSTED. `engineName` and `sourceBase` come from pack folder and\n * file names, and they are written into generated SOURCE — a name carrying a\n * quote, a newline or `'; …; //` would be code that no screen ever looked at.\n * Two defences, both always on: the name must match a strict pattern (checked\n * here and, as a diagnostic, by `compileAtom` before it gets this far), and\n * every specifier, property key and message built from a name is emitted\n * through `JSON.stringify`, never spliced between hand-written quotes.\n */\nconst ENGINE_NAME_RE = /^[A-Za-z0-9_-]+$/\nconst SOURCE_BASE_RE = /^[A-Za-z0-9_.-]+$/\n\n/** Connector `<Name>` / provider `<domain>`: letters, digits, `_`, `-`. */\nexport function isValidEngineName(name: string): boolean {\n return ENGINE_NAME_RE.test(name)\n}\n\n/** Entry basename without extension: letters, digits, `_`, `-`, `.` — never `..`. */\nexport function isValidSourceBase(base: string): boolean {\n return SOURCE_BASE_RE.test(base) && !base.includes('..') && base !== '.'\n}\n\n/**\n * The single wrapper registry, keyed off the kind's contract metadata.\n * Throws on a name that fails {@link isValidEngineName} / {@link isValidSourceBase}.\n */\nexport function buildWrapperSource(kind: AtomKind, ctx: WrapperContext): string {\n const meta = atomKindMeta(kind)\n if (meta.entry === 'sibling-generated') {\n const name = ctx.engineName ?? ''\n if (!isValidEngineName(name)) throw new Error(`invalid engine name ${JSON.stringify(name)}`)\n return kind === 'provider' ? providerEntrySource(name) : connectorEntrySource(name)\n }\n // identity\n const sourceBase = ctx.sourceBase ?? ''\n if (!isValidSourceBase(sourceBase)) throw new Error(`invalid entry basename ${JSON.stringify(sourceBase)}`)\n if (kind === 'block') {\n return `import * as _atom from ${JSON.stringify(`./${sourceBase}.js`)}\n\nconst _isDef = (v) =>\n v != null && typeof v === 'object' && 'type' in v && 'schema' in v\n\nconst _resolveDefinition = (m) => {\n for (const k of Object.keys(m)) {\n const v = m[k]\n if (_isDef(v)) return v\n }\n return null\n}\n\nconst _resolveComponent = (m) => {\n if (typeof m.default === 'function') return m.default\n // A block written with defineBlock() exports only its definition, and the\n // definition carries the component.\n const d = _resolveDefinition(m)\n if (d && typeof d.component === 'function') return d.component\n for (const k of Object.keys(m)) {\n const v = m[k]\n if (typeof v === 'function') return v\n }\n return null\n}\n\nexport const definition = _resolveDefinition(_atom)\nexport const Component = _resolveComponent(_atom)\n`\n }\n // capability + any other identity kind\n return `export * from ${JSON.stringify(`./${sourceBase}.js`)}\\n`\n}\n\n// ── sibling-generated engine adapters ──\n\nconst SHARED_ENGINE_HELPERS = `\nconst _isEngineClass = (v: unknown): boolean =>\n typeof v === 'function' &&\n !!(v as { prototype?: { query?: unknown } }).prototype &&\n typeof (v as { prototype: { query?: unknown } }).prototype.query === 'function'\n`\n\n/**\n * Wrapper for kind='connector' — adapts `connectors/<Name>.ts` to the loader\n * contract. Priority: explicit `createConnector` export → engine class\n * (`prototype.query`) → default export (called or constructed).\n */\nfunction connectorEntrySource(name: string): string {\n return `// AUTO-GENERATED (pwfabric-compiler) — loader-contract adapter.\nimport * as _mod from ${JSON.stringify(`./${name}`)}\n${SHARED_ENGINE_HELPERS}\nexport function createConnector(\n getAccessToken: () => Promise<string | null>,\n config: Record<string, unknown>\n): unknown {\n const m = _mod as Record<string, unknown>\n const direct = m['createConnector']\n if (typeof direct === 'function' && !_isEngineClass(direct)) {\n return (direct as (t: unknown, c: unknown) => unknown)(getAccessToken, config)\n }\n for (const k of Object.keys(m)) {\n const v = m[k]\n if (_isEngineClass(v)) {\n return new (v as new (t: unknown, c: unknown) => unknown)(getAccessToken, config)\n }\n }\n const d = m['default']\n if (typeof d === 'function') {\n return _isEngineClass(d)\n ? new (d as new (t: unknown, c: unknown) => unknown)(getAccessToken, config)\n : (d as (t: unknown, c: unknown) => unknown)(getAccessToken, config)\n }\n throw new Error(\n ${JSON.stringify(`connector module \"${name}\" exports no engine (createConnector / class with query() / default)`)}\n )\n}\nexport default createConnector\n`\n}\n\n/**\n * Wrapper for kind='provider' — thin per-facet entry over the SHARED vendor\n * motor. Binds the domain: the entity module's EntityMap + the vendor index's\n * engine class (`new Engine(getAccessToken, domainMap)`). Falls back to a\n * vendor-level `create*` factory (all-domain engine) when no engine class is\n * exported.\n */\nfunction providerEntrySource(domain: string): string {\n return `// AUTO-GENERATED (pwfabric-compiler) — per-facet engine entry.\nimport * as _vendor from '../index'\nimport * as _domain from ${JSON.stringify(`./${domain}`)}\n${SHARED_ENGINE_HELPERS}\nconst _isEntityMap = (v: unknown): boolean => {\n if (!v || typeof v !== 'object' || Array.isArray(v)) return false\n const vals = Object.values(v as Record<string, unknown>)\n return vals.length > 0 && vals.every((x) => !!x && typeof x === 'object')\n}\n\nconst _domainMap = (() => {\n const m = _domain as Record<string, unknown>\n if (_isEntityMap(m[${JSON.stringify(domain)}])) return m[${JSON.stringify(domain)}]\n if (_isEntityMap(m['default'])) return m['default']\n for (const k of Object.keys(m)) if (_isEntityMap(m[k])) return m[k]\n return null\n})()\n\nexport function createConnector(\n getAccessToken: () => Promise<string | null>,\n config: Record<string, unknown>\n): unknown {\n const vendor = _vendor as Record<string, unknown>\n if (_domainMap) {\n for (const k of Object.keys(vendor)) {\n const v = vendor[k]\n if (_isEngineClass(v)) {\n return new (v as new (t: unknown, m: unknown) => unknown)(getAccessToken, _domainMap)\n }\n }\n }\n for (const k of Object.keys(vendor)) {\n const v = vendor[k]\n if (typeof v === 'function' && !_isEngineClass(v) && k.startsWith('create')) {\n return (v as (t: unknown, c: unknown) => unknown)(getAccessToken, config)\n }\n }\n throw new Error(\n ${JSON.stringify(`provider module \"${domain}\" — vendor index exposes no engine class or create* factory`)}\n )\n}\nexport default createConnector\n`\n}\n"]}
package/package.json CHANGED
@@ -1,26 +1,40 @@
1
1
  {
2
2
  "name": "@pwfabric/compiler",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "PWFabric atom compiler: block and capability source to one ES module the runtime loads",
5
5
  "type": "module",
6
+ "license": "BUSL-1.1",
7
+ "author": "PhiMajor Solutions",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/pwfabric/pwfabric.git",
11
+ "directory": "packages/compiler"
12
+ },
13
+ "homepage": "https://github.com/pwfabric/pwfabric#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/pwfabric/pwfabric/issues"
16
+ },
6
17
  "main": "./dist/index.js",
7
18
  "types": "./dist/index.d.ts",
8
19
  "exports": {
9
20
  ".": {
10
21
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
22
+ "import": "./dist/index.js",
23
+ "default": "./dist/index.js"
12
24
  }
13
25
  },
14
26
  "files": [
15
- "dist"
27
+ "dist",
28
+ "LICENSE",
29
+ "README.md"
16
30
  ],
31
+ "engines": {
32
+ "node": ">=22"
33
+ },
17
34
  "dependencies": {
18
35
  "esbuild": "0.25.12",
19
- "@pwfabric/contracts": "1.0.0-rc.0",
20
- "@pwfabric/core": "1.0.0-rc.0"
21
- },
22
- "publishConfig": {
23
- "access": "public"
36
+ "@pwfabric/contracts": "1.0.0-rc.2",
37
+ "@pwfabric/core": "1.0.0-rc.2"
24
38
  },
25
39
  "devDependencies": {
26
40
  "@types/node": "^22.0.0",
@@ -28,17 +42,9 @@
28
42
  "typescript": "^5.4.0",
29
43
  "vitest": "^2.0.0"
30
44
  },
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/pwfabric/pwfabric",
34
- "directory": "packages/compiler"
35
- },
36
- "homepage": "https://github.com/pwfabric/pwfabric#readme",
37
- "bugs": {
38
- "url": "https://github.com/pwfabric/pwfabric/issues"
45
+ "publishConfig": {
46
+ "access": "public"
39
47
  },
40
- "license": "BUSL-1.1",
41
- "author": "PhiMajor Solutions",
42
48
  "scripts": {
43
49
  "build": "rm -rf dist tsconfig.tsbuildinfo && tsc",
44
50
  "dev": "tsc --watch",
@@ -1 +0,0 @@
1
- {"version":3,"file":"companions.d.ts","sourceRoot":"","sources":["../src/companions.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAgB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEjF,uGAAuG;AACvG,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa,KAAK,YAAY,CAAA;AAE7E;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GACxD,MAAM,GAAG,IAAI,CAkBf;AAED,2CAA2C;AAC3C,MA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,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC;AAyBD,oFAAoF;AACpF,wBAAsB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CA0H7E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../src/folder.ts"],"names":[],"mappings":"AAYA,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjF,iFAAiF;AACjF,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAiBrF;AAED,6FAA6F;AAC7F,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAAM,GAClD,OAAO,CAAC,aAAa,CAAC,CAExB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EACL,YAAY,EACZ,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,6BAA6B,EAC7B,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,QAAQ,GACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AAC7G,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAYA,gEAAgE;AAChE,qBAAa,eAAgB,SAAQ,KAAK;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM;gBAAjB,SAAS,EAAE,MAAM;CAIvC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASxD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMlE;AAKD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAY1D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../src/screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAA+C,CAAA;AAEpG,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GACrB;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAA;AAyDlE;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,GAAG,MAAM,CAuHtE;AAqBD,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;CACzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,CAoD/E;AAED,2CAA2C;AAC3C,eAAO,MAAM,iBAAiB,qBAAe,CAAA;AAC7C,sDAAsD;AACtD,eAAO,MAAM,6BAA6B,mBAA0B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAYA,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,EAAE,MAAoE,CAAA;AAEnG,mDAAmD;AACnD,eAAO,MAAM,eAAe,EAAE,MAAuB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../src/wrappers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEjE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAcD,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,cAAc,GAAG,MAAM,CAuC9E"}