@happyvertical/smrt-core 0.56.0 → 0.56.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/generators.md +37 -0
- package/dist/browser.d.ts +1 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +2 -1
- package/dist/cookbook/engine/commands.d.ts.map +1 -1
- package/dist/cookbook/engine/commands.js +12 -0
- package/dist/cookbook/engine/commands.js.map +1 -1
- package/dist/cookbook/engine/defaults.d.ts.map +1 -1
- package/dist/cookbook/engine/defaults.js +8 -0
- package/dist/cookbook/engine/defaults.js.map +1 -1
- package/dist/cookbook/engine/document.d.ts +4 -0
- package/dist/cookbook/engine/document.d.ts.map +1 -1
- package/dist/cookbook/engine/document.js +11 -3
- package/dist/cookbook/engine/document.js.map +1 -1
- package/dist/cookbook/engine/engine.d.ts.map +1 -1
- package/dist/cookbook/engine/engine.js +3 -1
- package/dist/cookbook/engine/engine.js.map +1 -1
- package/dist/cookbook/engine/schemas.d.ts.map +1 -1
- package/dist/cookbook/engine/schemas.js +8 -0
- package/dist/cookbook/engine/schemas.js.map +1 -1
- package/dist/cookbook/engine/types.d.ts +5 -1
- package/dist/cookbook/engine/types.d.ts.map +1 -1
- package/dist/cookbook/engine/types.js.map +1 -1
- package/dist/generators/index.d.ts +1 -0
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +2 -1
- package/dist/generators/mcp-runtime-template.d.ts +3 -0
- package/dist/generators/mcp-runtime-template.d.ts.map +1 -1
- package/dist/generators/mcp-runtime-template.js +30 -4
- package/dist/generators/mcp-runtime-template.js.map +1 -1
- package/dist/generators/mcp.d.ts +5 -0
- package/dist/generators/mcp.d.ts.map +1 -1
- package/dist/generators/mcp.js +78 -7
- package/dist/generators/mcp.js.map +1 -1
- package/dist/generators.js +2 -1
- package/dist/index.js +2 -1
- package/dist/manifest/browser-capability.generated.js +34 -5
- package/dist/manifest/browser-capability.generated.js.map +1 -1
- package/dist/manifest/index.js +1 -1
- package/dist/manifest/static-manifest.js +1 -1
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/mcp-serializer.d.ts +38 -0
- package/dist/mcp-serializer.d.ts.map +1 -0
- package/dist/mcp-serializer.js +60 -0
- package/dist/mcp-serializer.js.map +1 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/index.js +34 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/index.js.map +1 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/errors.js +343 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/get-format.js +109 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/get-format.js.map +1 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/package-json-reader.js +102 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/package-json-reader.js.map +1 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/resolve.js +673 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/resolve.js.map +1 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/utils.js +32 -0
- package/dist/node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/utils.js.map +1 -0
- package/dist/registry/types.d.ts +13 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +7 -5
- package/dist/utils/import-project-vite.js +1 -1
- package/dist/utils/import-workspace-module.js +1 -1
- package/dist/vite-plugin/dev-plane-route.js +1 -1
- package/dist/vite-plugin/import-build-aware.js +1 -1
- package/dist/vite-plugin/index.js +1 -1
- package/dist/vite-plugin/resources-route.js +1 -1
- package/dist/vite-plugin/sveltekit-generator.js +1 -1
- package/package.json +16 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/resolve.js"],"sourcesContent":["// Manually “tree shaken” from:\n// <https://github.com/nodejs/node/blob/81a9a97/lib/internal/modules/esm/resolve.js>\n// Last checked on: Apr 29, 2024.\n\n/**\n * @import {Stats} from 'node:fs'\n * @import {ErrnoException} from './errors.js'\n * @import {PackageConfig} from './package-json-reader.js'\n */\n\nimport assert from 'node:assert'\nimport {statSync, realpathSync} from 'node:fs'\nimport process from 'node:process'\nimport {fileURLToPath, pathToFileURL} from 'node:url'\nimport path from 'node:path'\nimport {builtinModules} from 'node:module'\nimport {defaultGetFormatWithoutErrors} from './get-format.js'\nimport {codes} from './errors.js'\nimport {getPackageScopeConfig, read} from './package-json-reader.js'\nimport {getConditionsSet} from './utils.js'\n\nconst RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]\n\nconst {\n ERR_NETWORK_IMPORT_DISALLOWED,\n ERR_INVALID_MODULE_SPECIFIER,\n ERR_INVALID_PACKAGE_CONFIG,\n ERR_INVALID_PACKAGE_TARGET,\n ERR_MODULE_NOT_FOUND,\n ERR_PACKAGE_IMPORT_NOT_DEFINED,\n ERR_PACKAGE_PATH_NOT_EXPORTED,\n ERR_UNSUPPORTED_DIR_IMPORT,\n ERR_UNSUPPORTED_RESOLVE_REQUEST\n} = codes\n\nconst own = {}.hasOwnProperty\n\nconst invalidSegmentRegEx =\n /(^|\\\\|\\/)((\\.|%2e)(\\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\\\|\\/|$)/i\nconst deprecatedInvalidSegmentRegEx =\n /(^|\\\\|\\/)((\\.|%2e)(\\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\\\|\\/|$)/i\nconst invalidPackageNameRegEx = /^\\.|%|\\\\/\nconst patternRegEx = /\\*/g\nconst encodedSeparatorRegEx = /%2f|%5c/i\n/** @type {Set<string>} */\nconst emittedPackageWarnings = new Set()\n\nconst doubleSlashRegEx = /[/\\\\]{2}/\n\n/**\n *\n * @param {string} target\n * @param {string} request\n * @param {string} match\n * @param {URL} packageJsonUrl\n * @param {boolean} internal\n * @param {URL} base\n * @param {boolean} isTarget\n */\nfunction emitInvalidSegmentDeprecation(\n target,\n request,\n match,\n packageJsonUrl,\n internal,\n base,\n isTarget\n) {\n // @ts-expect-error: apparently it does exist, TS.\n if (process.noDeprecation) {\n return\n }\n\n const pjsonPath = fileURLToPath(packageJsonUrl)\n const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null\n process.emitWarning(\n `Use of deprecated ${\n double ? 'double slash' : 'leading or trailing slash matching'\n } resolving \"${target}\" for module ` +\n `request \"${request}\" ${\n request === match ? '' : `matched to \"${match}\" `\n }in the \"${\n internal ? 'imports' : 'exports'\n }\" field module resolution of the package at ${pjsonPath}${\n base ? ` imported from ${fileURLToPath(base)}` : ''\n }.`,\n 'DeprecationWarning',\n 'DEP0166'\n )\n}\n\n/**\n * @param {URL} url\n * @param {URL} packageJsonUrl\n * @param {URL} base\n * @param {string} [main]\n * @returns {void}\n */\nfunction emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {\n // @ts-expect-error: apparently it does exist, TS.\n if (process.noDeprecation) {\n return\n }\n\n const format = defaultGetFormatWithoutErrors(url, {parentURL: base.href})\n if (format !== 'module') return\n const urlPath = fileURLToPath(url.href)\n const packagePath = fileURLToPath(new URL('.', packageJsonUrl))\n const basePath = fileURLToPath(base)\n if (!main) {\n process.emitWarning(\n `No \"main\" or \"exports\" field defined in the package.json for ${packagePath} resolving the main entry point \"${urlPath.slice(\n packagePath.length\n )}\", imported from ${basePath}.\\nDefault \"index\" lookups for the main are deprecated for ES modules.`,\n 'DeprecationWarning',\n 'DEP0151'\n )\n } else if (path.resolve(packagePath, main) !== urlPath) {\n process.emitWarning(\n `Package ${packagePath} has a \"main\" field set to \"${main}\", ` +\n `excluding the full filename and extension to the resolved file at \"${urlPath.slice(\n packagePath.length\n )}\", imported from ${basePath}.\\n Automatic extension resolution of the \"main\" field is ` +\n 'deprecated for ES modules.',\n 'DeprecationWarning',\n 'DEP0151'\n )\n }\n}\n\n/**\n * @param {string} path\n * @returns {Stats | undefined}\n */\nfunction tryStatSync(path) {\n // Note: from Node 15 onwards we can use `throwIfNoEntry: false` instead.\n try {\n return statSync(path)\n } catch {\n // Note: in Node code this returns `new Stats`,\n // but in Node 22 that’s marked as a deprecated internal API.\n // Which, well, we kinda are, but still to prevent that warning,\n // just yield `undefined`.\n }\n}\n\n/**\n * Legacy CommonJS main resolution:\n * 1. let M = pkg_url + (json main field)\n * 2. TRY(M, M.js, M.json, M.node)\n * 3. TRY(M/index.js, M/index.json, M/index.node)\n * 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node)\n * 5. NOT_FOUND\n *\n * @param {URL} url\n * @returns {boolean}\n */\nfunction fileExists(url) {\n const stats = statSync(url, {throwIfNoEntry: false})\n const isFile = stats ? stats.isFile() : undefined\n return isFile === null || isFile === undefined ? false : isFile\n}\n\n/**\n * @param {URL} packageJsonUrl\n * @param {PackageConfig} packageConfig\n * @param {URL} base\n * @returns {URL}\n */\nfunction legacyMainResolve(packageJsonUrl, packageConfig, base) {\n /** @type {URL | undefined} */\n let guess\n if (packageConfig.main !== undefined) {\n guess = new URL(packageConfig.main, packageJsonUrl)\n // Note: fs check redundances will be handled by Descriptor cache here.\n if (fileExists(guess)) return guess\n\n const tries = [\n `./${packageConfig.main}.js`,\n `./${packageConfig.main}.json`,\n `./${packageConfig.main}.node`,\n `./${packageConfig.main}/index.js`,\n `./${packageConfig.main}/index.json`,\n `./${packageConfig.main}/index.node`\n ]\n let i = -1\n\n while (++i < tries.length) {\n guess = new URL(tries[i], packageJsonUrl)\n if (fileExists(guess)) break\n guess = undefined\n }\n\n if (guess) {\n emitLegacyIndexDeprecation(\n guess,\n packageJsonUrl,\n base,\n packageConfig.main\n )\n return guess\n }\n // Fallthrough.\n }\n\n const tries = ['./index.js', './index.json', './index.node']\n let i = -1\n\n while (++i < tries.length) {\n guess = new URL(tries[i], packageJsonUrl)\n if (fileExists(guess)) break\n guess = undefined\n }\n\n if (guess) {\n emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main)\n return guess\n }\n\n // Not found.\n throw new ERR_MODULE_NOT_FOUND(\n fileURLToPath(new URL('.', packageJsonUrl)),\n fileURLToPath(base)\n )\n}\n\n/**\n * @param {URL} resolved\n * @param {URL} base\n * @param {boolean} [preserveSymlinks]\n * @returns {URL}\n */\nfunction finalizeResolution(resolved, base, preserveSymlinks) {\n if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {\n throw new ERR_INVALID_MODULE_SPECIFIER(\n resolved.pathname,\n 'must not include encoded \"/\" or \"\\\\\" characters',\n fileURLToPath(base)\n )\n }\n\n /** @type {string} */\n let filePath\n\n try {\n filePath = fileURLToPath(resolved)\n } catch (error) {\n const cause = /** @type {ErrnoException} */ (error)\n Object.defineProperty(cause, 'input', {value: String(resolved)})\n Object.defineProperty(cause, 'module', {value: String(base)})\n throw cause\n }\n\n const stats = tryStatSync(\n filePath.endsWith('/') ? filePath.slice(-1) : filePath\n )\n\n if (stats && stats.isDirectory()) {\n const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath(base))\n // @ts-expect-error Add this for `import.meta.resolve`.\n error.url = String(resolved)\n throw error\n }\n\n if (!stats || !stats.isFile()) {\n const error = new ERR_MODULE_NOT_FOUND(\n filePath || resolved.pathname,\n base && fileURLToPath(base),\n true\n )\n // @ts-expect-error Add this for `import.meta.resolve`.\n error.url = String(resolved)\n throw error\n }\n\n if (!preserveSymlinks) {\n const real = realpathSync(filePath)\n const {search, hash} = resolved\n resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? '/' : ''))\n resolved.search = search\n resolved.hash = hash\n }\n\n return resolved\n}\n\n/**\n * @param {string} specifier\n * @param {URL | undefined} packageJsonUrl\n * @param {URL} base\n * @returns {Error}\n */\nfunction importNotDefined(specifier, packageJsonUrl, base) {\n return new ERR_PACKAGE_IMPORT_NOT_DEFINED(\n specifier,\n packageJsonUrl && fileURLToPath(new URL('.', packageJsonUrl)),\n fileURLToPath(base)\n )\n}\n\n/**\n * @param {string} subpath\n * @param {URL} packageJsonUrl\n * @param {URL} base\n * @returns {Error}\n */\nfunction exportsNotFound(subpath, packageJsonUrl, base) {\n return new ERR_PACKAGE_PATH_NOT_EXPORTED(\n fileURLToPath(new URL('.', packageJsonUrl)),\n subpath,\n base && fileURLToPath(base)\n )\n}\n\n/**\n * @param {string} request\n * @param {string} match\n * @param {URL} packageJsonUrl\n * @param {boolean} internal\n * @param {URL} [base]\n * @returns {never}\n */\nfunction throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {\n const reason = `request is not a valid match in pattern \"${match}\" for the \"${\n internal ? 'imports' : 'exports'\n }\" resolution of ${fileURLToPath(packageJsonUrl)}`\n throw new ERR_INVALID_MODULE_SPECIFIER(\n request,\n reason,\n base && fileURLToPath(base)\n )\n}\n\n/**\n * @param {string} subpath\n * @param {unknown} target\n * @param {URL} packageJsonUrl\n * @param {boolean} internal\n * @param {URL} [base]\n * @returns {Error}\n */\nfunction invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {\n target =\n typeof target === 'object' && target !== null\n ? JSON.stringify(target, null, '')\n : `${target}`\n\n return new ERR_INVALID_PACKAGE_TARGET(\n fileURLToPath(new URL('.', packageJsonUrl)),\n subpath,\n target,\n internal,\n base && fileURLToPath(base)\n )\n}\n\n/**\n * @param {string} target\n * @param {string} subpath\n * @param {string} match\n * @param {URL} packageJsonUrl\n * @param {URL} base\n * @param {boolean} pattern\n * @param {boolean} internal\n * @param {boolean} isPathMap\n * @param {Set<string> | undefined} conditions\n * @returns {URL}\n */\nfunction resolvePackageTargetString(\n target,\n subpath,\n match,\n packageJsonUrl,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n) {\n if (subpath !== '' && !pattern && target[target.length - 1] !== '/')\n throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)\n\n if (!target.startsWith('./')) {\n if (internal && !target.startsWith('../') && !target.startsWith('/')) {\n let isURL = false\n\n try {\n new URL(target)\n isURL = true\n } catch {\n // Continue regardless of error.\n }\n\n if (!isURL) {\n const exportTarget = pattern\n ? RegExpPrototypeSymbolReplace.call(\n patternRegEx,\n target,\n () => subpath\n )\n : target + subpath\n\n return packageResolve(exportTarget, packageJsonUrl, conditions)\n }\n }\n\n throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)\n }\n\n if (invalidSegmentRegEx.exec(target.slice(2)) !== null) {\n if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {\n if (!isPathMap) {\n const request = pattern\n ? match.replace('*', () => subpath)\n : match + subpath\n const resolvedTarget = pattern\n ? RegExpPrototypeSymbolReplace.call(\n patternRegEx,\n target,\n () => subpath\n )\n : target\n emitInvalidSegmentDeprecation(\n resolvedTarget,\n request,\n match,\n packageJsonUrl,\n internal,\n base,\n true\n )\n }\n } else {\n throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)\n }\n }\n\n const resolved = new URL(target, packageJsonUrl)\n const resolvedPath = resolved.pathname\n const packagePath = new URL('.', packageJsonUrl).pathname\n\n if (!resolvedPath.startsWith(packagePath))\n throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)\n\n if (subpath === '') return resolved\n\n if (invalidSegmentRegEx.exec(subpath) !== null) {\n const request = pattern\n ? match.replace('*', () => subpath)\n : match + subpath\n if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {\n if (!isPathMap) {\n const resolvedTarget = pattern\n ? RegExpPrototypeSymbolReplace.call(\n patternRegEx,\n target,\n () => subpath\n )\n : target\n emitInvalidSegmentDeprecation(\n resolvedTarget,\n request,\n match,\n packageJsonUrl,\n internal,\n base,\n false\n )\n }\n } else {\n throwInvalidSubpath(request, match, packageJsonUrl, internal, base)\n }\n }\n\n if (pattern) {\n return new URL(\n RegExpPrototypeSymbolReplace.call(\n patternRegEx,\n resolved.href,\n () => subpath\n )\n )\n }\n\n return new URL(subpath, resolved)\n}\n\n/**\n * @param {string} key\n * @returns {boolean}\n */\nfunction isArrayIndex(key) {\n const keyNumber = Number(key)\n if (`${keyNumber}` !== key) return false\n return keyNumber >= 0 && keyNumber < 0xff_ff_ff_ff\n}\n\n/**\n * @param {URL} packageJsonUrl\n * @param {unknown} target\n * @param {string} subpath\n * @param {string} packageSubpath\n * @param {URL} base\n * @param {boolean} pattern\n * @param {boolean} internal\n * @param {boolean} isPathMap\n * @param {Set<string> | undefined} conditions\n * @returns {URL | null}\n */\nfunction resolvePackageTarget(\n packageJsonUrl,\n target,\n subpath,\n packageSubpath,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n) {\n if (typeof target === 'string') {\n return resolvePackageTargetString(\n target,\n subpath,\n packageSubpath,\n packageJsonUrl,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n )\n }\n\n if (Array.isArray(target)) {\n /** @type {Array<unknown>} */\n const targetList = target\n if (targetList.length === 0) return null\n\n /** @type {ErrnoException | null | undefined} */\n let lastException\n let i = -1\n\n while (++i < targetList.length) {\n const targetItem = targetList[i]\n /** @type {URL | null} */\n let resolveResult\n try {\n resolveResult = resolvePackageTarget(\n packageJsonUrl,\n targetItem,\n subpath,\n packageSubpath,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n )\n } catch (error) {\n const exception = /** @type {ErrnoException} */ (error)\n lastException = exception\n if (exception.code === 'ERR_INVALID_PACKAGE_TARGET') continue\n throw error\n }\n\n if (resolveResult === undefined) continue\n\n if (resolveResult === null) {\n lastException = null\n continue\n }\n\n return resolveResult\n }\n\n if (lastException === undefined || lastException === null) {\n return null\n }\n\n throw lastException\n }\n\n if (typeof target === 'object' && target !== null) {\n const keys = Object.getOwnPropertyNames(target)\n let i = -1\n\n while (++i < keys.length) {\n const key = keys[i]\n if (isArrayIndex(key)) {\n throw new ERR_INVALID_PACKAGE_CONFIG(\n fileURLToPath(packageJsonUrl),\n base,\n '\"exports\" cannot contain numeric property keys.'\n )\n }\n }\n\n i = -1\n\n while (++i < keys.length) {\n const key = keys[i]\n if (key === 'default' || (conditions && conditions.has(key))) {\n // @ts-expect-error: indexable.\n const conditionalTarget = /** @type {unknown} */ (target[key])\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n conditionalTarget,\n subpath,\n packageSubpath,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n )\n if (resolveResult === undefined) continue\n return resolveResult\n }\n }\n\n return null\n }\n\n if (target === null) {\n return null\n }\n\n throw invalidPackageTarget(\n packageSubpath,\n target,\n packageJsonUrl,\n internal,\n base\n )\n}\n\n/**\n * @param {unknown} exports\n * @param {URL} packageJsonUrl\n * @param {URL} base\n * @returns {boolean}\n */\nfunction isConditionalExportsMainSugar(exports, packageJsonUrl, base) {\n if (typeof exports === 'string' || Array.isArray(exports)) return true\n if (typeof exports !== 'object' || exports === null) return false\n\n const keys = Object.getOwnPropertyNames(exports)\n let isConditionalSugar = false\n let i = 0\n let keyIndex = -1\n while (++keyIndex < keys.length) {\n const key = keys[keyIndex]\n const currentIsConditionalSugar = key === '' || key[0] !== '.'\n if (i++ === 0) {\n isConditionalSugar = currentIsConditionalSugar\n } else if (isConditionalSugar !== currentIsConditionalSugar) {\n throw new ERR_INVALID_PACKAGE_CONFIG(\n fileURLToPath(packageJsonUrl),\n base,\n '\"exports\" cannot contain some keys starting with \\'.\\' and some not.' +\n ' The exports object must either be an object of package subpath keys' +\n ' or an object of main entry condition name keys only.'\n )\n }\n }\n\n return isConditionalSugar\n}\n\n/**\n * @param {string} match\n * @param {URL} pjsonUrl\n * @param {URL} base\n */\nfunction emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {\n // @ts-expect-error: apparently it does exist, TS.\n if (process.noDeprecation) {\n return\n }\n\n const pjsonPath = fileURLToPath(pjsonUrl)\n if (emittedPackageWarnings.has(pjsonPath + '|' + match)) return\n emittedPackageWarnings.add(pjsonPath + '|' + match)\n process.emitWarning(\n `Use of deprecated trailing slash pattern mapping \"${match}\" in the ` +\n `\"exports\" field module resolution of the package at ${pjsonPath}${\n base ? ` imported from ${fileURLToPath(base)}` : ''\n }. Mapping specifiers ending in \"/\" is no longer supported.`,\n 'DeprecationWarning',\n 'DEP0155'\n )\n}\n\n/**\n * @param {URL} packageJsonUrl\n * @param {string} packageSubpath\n * @param {Record<string, unknown>} packageConfig\n * @param {URL} base\n * @param {Set<string> | undefined} conditions\n * @returns {URL}\n */\nfunction packageExportsResolve(\n packageJsonUrl,\n packageSubpath,\n packageConfig,\n base,\n conditions\n) {\n let exports = packageConfig.exports\n\n if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {\n exports = {'.': exports}\n }\n\n if (\n own.call(exports, packageSubpath) &&\n !packageSubpath.includes('*') &&\n !packageSubpath.endsWith('/')\n ) {\n // @ts-expect-error: indexable.\n const target = exports[packageSubpath]\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n target,\n '',\n packageSubpath,\n base,\n false,\n false,\n false,\n conditions\n )\n if (resolveResult === null || resolveResult === undefined) {\n throw exportsNotFound(packageSubpath, packageJsonUrl, base)\n }\n\n return resolveResult\n }\n\n let bestMatch = ''\n let bestMatchSubpath = ''\n const keys = Object.getOwnPropertyNames(exports)\n let i = -1\n\n while (++i < keys.length) {\n const key = keys[i]\n const patternIndex = key.indexOf('*')\n\n if (\n patternIndex !== -1 &&\n packageSubpath.startsWith(key.slice(0, patternIndex))\n ) {\n // When this reaches EOL, this can throw at the top of the whole function:\n //\n // if (StringPrototypeEndsWith(packageSubpath, '/'))\n // throwInvalidSubpath(packageSubpath)\n //\n // To match \"imports\" and the spec.\n if (packageSubpath.endsWith('/')) {\n emitTrailingSlashPatternDeprecation(\n packageSubpath,\n packageJsonUrl,\n base\n )\n }\n\n const patternTrailer = key.slice(patternIndex + 1)\n\n if (\n packageSubpath.length >= key.length &&\n packageSubpath.endsWith(patternTrailer) &&\n patternKeyCompare(bestMatch, key) === 1 &&\n key.lastIndexOf('*') === patternIndex\n ) {\n bestMatch = key\n bestMatchSubpath = packageSubpath.slice(\n patternIndex,\n packageSubpath.length - patternTrailer.length\n )\n }\n }\n }\n\n if (bestMatch) {\n // @ts-expect-error: indexable.\n const target = /** @type {unknown} */ (exports[bestMatch])\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n target,\n bestMatchSubpath,\n bestMatch,\n base,\n true,\n false,\n packageSubpath.endsWith('/'),\n conditions\n )\n\n if (resolveResult === null || resolveResult === undefined) {\n throw exportsNotFound(packageSubpath, packageJsonUrl, base)\n }\n\n return resolveResult\n }\n\n throw exportsNotFound(packageSubpath, packageJsonUrl, base)\n}\n\n/**\n * @param {string} a\n * @param {string} b\n */\nfunction patternKeyCompare(a, b) {\n const aPatternIndex = a.indexOf('*')\n const bPatternIndex = b.indexOf('*')\n const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1\n const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1\n if (baseLengthA > baseLengthB) return -1\n if (baseLengthB > baseLengthA) return 1\n if (aPatternIndex === -1) return 1\n if (bPatternIndex === -1) return -1\n if (a.length > b.length) return -1\n if (b.length > a.length) return 1\n return 0\n}\n\n/**\n * @param {string} name\n * @param {URL} base\n * @param {Set<string>} [conditions]\n * @returns {URL}\n */\nfunction packageImportsResolve(name, base, conditions) {\n if (name === '#' || name.startsWith('#/') || name.endsWith('/')) {\n const reason = 'is not a valid internal imports specifier name'\n throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base))\n }\n\n /** @type {URL | undefined} */\n let packageJsonUrl\n\n const packageConfig = getPackageScopeConfig(base)\n\n if (packageConfig.exists) {\n packageJsonUrl = pathToFileURL(packageConfig.pjsonPath)\n const imports = packageConfig.imports\n if (imports) {\n if (own.call(imports, name) && !name.includes('*')) {\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n imports[name],\n '',\n name,\n base,\n false,\n true,\n false,\n conditions\n )\n if (resolveResult !== null && resolveResult !== undefined) {\n return resolveResult\n }\n } else {\n let bestMatch = ''\n let bestMatchSubpath = ''\n const keys = Object.getOwnPropertyNames(imports)\n let i = -1\n\n while (++i < keys.length) {\n const key = keys[i]\n const patternIndex = key.indexOf('*')\n\n if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) {\n const patternTrailer = key.slice(patternIndex + 1)\n if (\n name.length >= key.length &&\n name.endsWith(patternTrailer) &&\n patternKeyCompare(bestMatch, key) === 1 &&\n key.lastIndexOf('*') === patternIndex\n ) {\n bestMatch = key\n bestMatchSubpath = name.slice(\n patternIndex,\n name.length - patternTrailer.length\n )\n }\n }\n }\n\n if (bestMatch) {\n const target = imports[bestMatch]\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n target,\n bestMatchSubpath,\n bestMatch,\n base,\n true,\n true,\n false,\n conditions\n )\n\n if (resolveResult !== null && resolveResult !== undefined) {\n return resolveResult\n }\n }\n }\n }\n }\n\n throw importNotDefined(name, packageJsonUrl, base)\n}\n\n/**\n * @param {string} specifier\n * @param {URL} base\n */\nfunction parsePackageName(specifier, base) {\n let separatorIndex = specifier.indexOf('/')\n let validPackageName = true\n let isScoped = false\n if (specifier[0] === '@') {\n isScoped = true\n if (separatorIndex === -1 || specifier.length === 0) {\n validPackageName = false\n } else {\n separatorIndex = specifier.indexOf('/', separatorIndex + 1)\n }\n }\n\n const packageName =\n separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex)\n\n // Package name cannot have leading . and cannot have percent-encoding or\n // \\\\ separators.\n if (invalidPackageNameRegEx.exec(packageName) !== null) {\n validPackageName = false\n }\n\n if (!validPackageName) {\n throw new ERR_INVALID_MODULE_SPECIFIER(\n specifier,\n 'is not a valid package name',\n fileURLToPath(base)\n )\n }\n\n const packageSubpath =\n '.' + (separatorIndex === -1 ? '' : specifier.slice(separatorIndex))\n\n return {packageName, packageSubpath, isScoped}\n}\n\n/**\n * @param {string} specifier\n * @param {URL} base\n * @param {Set<string> | undefined} conditions\n * @returns {URL}\n */\nfunction packageResolve(specifier, base, conditions) {\n if (builtinModules.includes(specifier)) {\n return new URL('node:' + specifier)\n }\n\n const {packageName, packageSubpath, isScoped} = parsePackageName(\n specifier,\n base\n )\n\n // ResolveSelf\n const packageConfig = getPackageScopeConfig(base)\n\n // Can’t test.\n /* c8 ignore next 16 */\n if (packageConfig.exists) {\n const packageJsonUrl = pathToFileURL(packageConfig.pjsonPath)\n if (\n packageConfig.name === packageName &&\n packageConfig.exports !== undefined &&\n packageConfig.exports !== null\n ) {\n return packageExportsResolve(\n packageJsonUrl,\n packageSubpath,\n packageConfig,\n base,\n conditions\n )\n }\n }\n\n let packageJsonUrl = new URL(\n './node_modules/' + packageName + '/package.json',\n base\n )\n let packageJsonPath = fileURLToPath(packageJsonUrl)\n /** @type {string} */\n let lastPath\n do {\n const stat = tryStatSync(packageJsonPath.slice(0, -13))\n if (!stat || !stat.isDirectory()) {\n lastPath = packageJsonPath\n packageJsonUrl = new URL(\n (isScoped ? '../../../../node_modules/' : '../../../node_modules/') +\n packageName +\n '/package.json',\n packageJsonUrl\n )\n packageJsonPath = fileURLToPath(packageJsonUrl)\n continue\n }\n\n // Package match.\n const packageConfig = read(packageJsonPath, {base, specifier})\n if (packageConfig.exports !== undefined && packageConfig.exports !== null) {\n return packageExportsResolve(\n packageJsonUrl,\n packageSubpath,\n packageConfig,\n base,\n conditions\n )\n }\n\n if (packageSubpath === '.') {\n return legacyMainResolve(packageJsonUrl, packageConfig, base)\n }\n\n return new URL(packageSubpath, packageJsonUrl)\n // Cross-platform root check.\n } while (packageJsonPath.length !== lastPath.length)\n\n throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), false)\n}\n\n/**\n * @param {string} specifier\n * @returns {boolean}\n */\nfunction isRelativeSpecifier(specifier) {\n if (specifier[0] === '.') {\n if (specifier.length === 1 || specifier[1] === '/') return true\n if (\n specifier[1] === '.' &&\n (specifier.length === 2 || specifier[2] === '/')\n ) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * @param {string} specifier\n * @returns {boolean}\n */\nfunction shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {\n if (specifier === '') return false\n if (specifier[0] === '/') return true\n return isRelativeSpecifier(specifier)\n}\n\n/**\n * The “Resolver Algorithm Specification” as detailed in the Node docs (which is\n * sync and slightly lower-level than `resolve`).\n *\n * @param {string} specifier\n * `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc.\n * @param {URL} base\n * Full URL (to a file) that `specifier` is resolved relative from.\n * @param {Set<string>} [conditions]\n * Conditions.\n * @param {boolean} [preserveSymlinks]\n * Keep symlinks instead of resolving them.\n * @returns {URL}\n * A URL object to the found thing.\n */\nexport function moduleResolve(specifier, base, conditions, preserveSymlinks) {\n // Note: The Node code supports `base` as a string (in this internal API) too,\n // we don’t.\n if (conditions === undefined) {\n conditions = getConditionsSet()\n }\n\n const protocol = base.protocol\n const isData = protocol === 'data:'\n const isRemote = isData || protocol === 'http:' || protocol === 'https:'\n // Order swapped from spec for minor perf gain.\n // Ok since relative URLs cannot parse as URLs.\n /** @type {URL | undefined} */\n let resolved\n\n if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {\n try {\n resolved = new URL(specifier, base)\n } catch (error_) {\n const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base)\n error.cause = error_\n throw error\n }\n } else if (protocol === 'file:' && specifier[0] === '#') {\n resolved = packageImportsResolve(specifier, base, conditions)\n } else {\n try {\n resolved = new URL(specifier)\n } catch (error_) {\n // Note: actual code uses `canBeRequiredWithoutScheme`.\n if (isRemote && !builtinModules.includes(specifier)) {\n const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base)\n error.cause = error_\n throw error\n }\n\n resolved = packageResolve(specifier, base, conditions)\n }\n }\n\n assert.ok(resolved !== undefined, 'expected to be defined')\n\n if (resolved.protocol !== 'file:') {\n return resolved\n }\n\n return finalizeResolution(resolved, base, preserveSymlinks)\n}\n\n/**\n * @param {string} specifier\n * @param {URL | undefined} parsed\n * @param {URL | undefined} parsedParentURL\n */\nfunction checkIfDisallowedImport(specifier, parsed, parsedParentURL) {\n if (parsedParentURL) {\n // Avoid accessing the `protocol` property due to the lazy getters.\n const parentProtocol = parsedParentURL.protocol\n\n if (parentProtocol === 'http:' || parentProtocol === 'https:') {\n if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {\n // Avoid accessing the `protocol` property due to the lazy getters.\n const parsedProtocol = parsed?.protocol\n\n // `data:` and `blob:` disallowed due to allowing file: access via\n // indirection\n if (\n parsedProtocol &&\n parsedProtocol !== 'https:' &&\n parsedProtocol !== 'http:'\n ) {\n throw new ERR_NETWORK_IMPORT_DISALLOWED(\n specifier,\n parsedParentURL,\n 'remote imports cannot import from a local location.'\n )\n }\n\n return {url: parsed?.href || ''}\n }\n\n if (builtinModules.includes(specifier)) {\n throw new ERR_NETWORK_IMPORT_DISALLOWED(\n specifier,\n parsedParentURL,\n 'remote imports cannot import from a local location.'\n )\n }\n\n throw new ERR_NETWORK_IMPORT_DISALLOWED(\n specifier,\n parsedParentURL,\n 'only relative and absolute specifiers are supported.'\n )\n }\n }\n}\n\n// Note: this is from:\n// <https://github.com/nodejs/node/blob/3e74590/lib/internal/url.js#L687>\n/**\n * Checks if a value has the shape of a WHATWG URL object.\n *\n * Using a symbol or instanceof would not be able to recognize URL objects\n * coming from other implementations (e.g. in Electron), so instead we are\n * checking some well known properties for a lack of a better test.\n *\n * We use `href` and `protocol` as they are the only properties that are\n * easy to retrieve and calculate due to the lazy nature of the getters.\n *\n * @template {unknown} Value\n * @param {Value} self\n * @returns {Value is URL}\n */\nfunction isURL(self) {\n return Boolean(\n self &&\n typeof self === 'object' &&\n 'href' in self &&\n typeof self.href === 'string' &&\n 'protocol' in self &&\n typeof self.protocol === 'string' &&\n self.href &&\n self.protocol\n )\n}\n\n/**\n * Validate user-input in `context` supplied by a custom loader.\n *\n * @param {unknown} parentURL\n * @returns {asserts parentURL is URL | string | undefined}\n */\nfunction throwIfInvalidParentURL(parentURL) {\n if (parentURL === undefined) {\n return // Main entry point, so no parent\n }\n\n if (typeof parentURL !== 'string' && !isURL(parentURL)) {\n throw new codes.ERR_INVALID_ARG_TYPE(\n 'parentURL',\n ['string', 'URL'],\n parentURL\n )\n }\n}\n\n/**\n * @param {string} specifier\n * @param {{parentURL?: string, conditions?: Array<string>}} context\n * @returns {{url: string, format?: string | null}}\n */\nexport function defaultResolve(specifier, context = {}) {\n const {parentURL} = context\n assert.ok(parentURL !== undefined, 'expected `parentURL` to be defined')\n throwIfInvalidParentURL(parentURL)\n\n /** @type {URL | undefined} */\n let parsedParentURL\n if (parentURL) {\n try {\n parsedParentURL = new URL(parentURL)\n } catch {\n // Ignore exception\n }\n }\n\n /** @type {URL | undefined} */\n let parsed\n /** @type {string | undefined} */\n let protocol\n\n try {\n parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier)\n ? new URL(specifier, parsedParentURL)\n : new URL(specifier)\n\n // Avoid accessing the `protocol` property due to the lazy getters.\n protocol = parsed.protocol\n\n if (protocol === 'data:') {\n return {url: parsed.href, format: null}\n }\n } catch {\n // Ignore exception\n }\n\n // There are multiple deep branches that can either throw or return; instead\n // of duplicating that deeply nested logic for the possible returns, DRY and\n // check for a return. This seems the least gnarly.\n const maybeReturn = checkIfDisallowedImport(\n specifier,\n parsed,\n parsedParentURL\n )\n\n if (maybeReturn) return maybeReturn\n\n // This must come after checkIfDisallowedImport\n if (protocol === undefined && parsed) {\n protocol = parsed.protocol\n }\n\n if (protocol === 'node:') {\n return {url: specifier}\n }\n\n // This must come after checkIfDisallowedImport\n if (parsed && parsed.protocol === 'node:') return {url: specifier}\n\n const conditions = getConditionsSet(context.conditions)\n\n const url = moduleResolve(specifier, new URL(parentURL), conditions, false)\n\n return {\n // Do NOT cast `url` to a string: that will work even when there are real\n // problems, silencing them\n url: url.href,\n format: defaultGetFormatWithoutErrors(url, {parentURL})\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;AAqBA,IAAM,+BAA+B,OAAO,UAAU,OAAO;AAE7D,IAAM,EACJ,+BACA,8BACA,4BACA,4BACA,sBACA,gCACA,+BACA,4BACA,oCACE;AAEJ,IAAM,MAAM,CAAC,EAAE;AAEf,IAAM,sBACJ;AACF,IAAM,gCACJ;AACF,IAAM,0BAA0B;AAChC,IAAM,eAAe;AACrB,IAAM,wBAAwB;;AAE9B,IAAM,yCAAyB,IAAI,IAAI;AAEvC,IAAM,mBAAmB;;;;;;;;;;;AAYzB,SAAS,8BACP,QACA,SACA,OACA,gBACA,UACA,MACA,UACA;CAEA,IAAI,QAAQ,eACV;CAGF,MAAM,YAAY,cAAc,cAAc;CAC9C,MAAM,SAAS,iBAAiB,KAAK,WAAW,SAAS,OAAO,MAAM;CACtE,QAAQ,YACN,qBACE,SAAS,iBAAiB,qCAC3B,cAAc,OAAO,wBACR,QAAQ,IAClB,YAAY,QAAQ,KAAK,eAAe,MAAM,IAC/C,UACC,WAAW,YAAY,UACxB,8CAA8C,YAC7C,OAAO,kBAAkB,cAAc,IAAI,MAAM,GAClD,IACH,sBACA,SACF;AACF;;;;;;;;AASA,SAAS,2BAA2B,KAAK,gBAAgB,MAAM,MAAM;CAEnE,IAAI,QAAQ,eACV;CAIF,IADe,8BAA8B,K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1E,OAAO;EAGL,KAAK,IAAI;EACT,QAAQ,8BAA8B,KAAK,EAAC,UAAS,CAAC;CACxD;AACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { codes } from "./errors.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/utils.js
|
|
3
|
+
var { ERR_INVALID_ARG_VALUE } = codes;
|
|
4
|
+
var DEFAULT_CONDITIONS = Object.freeze(["node", "import"]);
|
|
5
|
+
var DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS);
|
|
6
|
+
/**
|
|
7
|
+
* Returns the default conditions for ES module loading.
|
|
8
|
+
*/
|
|
9
|
+
function getDefaultConditions() {
|
|
10
|
+
return DEFAULT_CONDITIONS;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns the default conditions for ES module loading, as a Set.
|
|
14
|
+
*/
|
|
15
|
+
function getDefaultConditionsSet() {
|
|
16
|
+
return DEFAULT_CONDITIONS_SET;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @param {Array<string>} [conditions]
|
|
20
|
+
* @returns {Set<string>}
|
|
21
|
+
*/
|
|
22
|
+
function getConditionsSet(conditions) {
|
|
23
|
+
if (conditions !== void 0 && conditions !== getDefaultConditions()) {
|
|
24
|
+
if (!Array.isArray(conditions)) throw new ERR_INVALID_ARG_VALUE("conditions", conditions, "expected an array");
|
|
25
|
+
return new Set(conditions);
|
|
26
|
+
}
|
|
27
|
+
return getDefaultConditionsSet();
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { getConditionsSet };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/import-meta-resolve@4.2.0/node_modules/import-meta-resolve/lib/utils.js"],"sourcesContent":["// Manually “tree shaken” from:\n// <https://github.com/nodejs/node/blob/81a9a97/lib/internal/modules/esm/utils.js>\n// Last checked on: Apr 29, 2024.\n\nimport {codes} from './errors.js'\n\nconst {ERR_INVALID_ARG_VALUE} = codes\n\n// In Node itself these values are populated from CLI arguments, before any\n// user code runs.\n// Here we just define the defaults.\nconst DEFAULT_CONDITIONS = Object.freeze(['node', 'import'])\nconst DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS)\n\n/**\n * Returns the default conditions for ES module loading.\n */\nfunction getDefaultConditions() {\n return DEFAULT_CONDITIONS\n}\n\n/**\n * Returns the default conditions for ES module loading, as a Set.\n */\nfunction getDefaultConditionsSet() {\n return DEFAULT_CONDITIONS_SET\n}\n\n/**\n * @param {Array<string>} [conditions]\n * @returns {Set<string>}\n */\nexport function getConditionsSet(conditions) {\n if (conditions !== undefined && conditions !== getDefaultConditions()) {\n if (!Array.isArray(conditions)) {\n throw new ERR_INVALID_ARG_VALUE(\n 'conditions',\n conditions,\n 'expected an array'\n )\n }\n\n return new Set(conditions)\n }\n\n return getDefaultConditionsSet()\n}\n"],"x_google_ignoreList":[0],"mappings":";;AAMA,IAAM,EAAC,0BAAyB;AAKhC,IAAM,qBAAqB,OAAO,OAAO,CAAC,QAAQ,QAAQ,CAAC;AAC3D,IAAM,yBAAyB,IAAI,IAAI,kBAAkB;;;;AAKzD,SAAS,uBAAuB;CAC9B,OAAO;AACT;;;;AAKA,SAAS,0BAA0B;CACjC,OAAO;AACT;;;;;AAMA,SAAgB,iBAAiB,YAAY;CAC3C,IAAI,eAAe,KAAA,KAAa,eAAe,qBAAqB,GAAG;EACrE,IAAI,CAAC,MAAM,QAAQ,UAAU,GAC3B,MAAM,IAAI,sBACR,cACA,YACA,mBACF;EAGF,OAAO,IAAI,IAAI,UAAU;CAC3B;CAEA,OAAO,wBAAwB;AACjC"}
|
package/dist/registry/types.d.ts
CHANGED
|
@@ -38,6 +38,17 @@ export interface ApiSerializerReference {
|
|
|
38
38
|
*/
|
|
39
39
|
exportName: string;
|
|
40
40
|
}
|
|
41
|
+
export interface McpSerializersConfig {
|
|
42
|
+
/**
|
|
43
|
+
* Async serializer used only for the standard MCP `get` response.
|
|
44
|
+
*
|
|
45
|
+
* The function receives the loaded object and the caller's public JSON
|
|
46
|
+
* options. It runs after authentication and tenant-scoped lookup, and must
|
|
47
|
+
* build its base projection with `toPublicJSON(options)` before adding any
|
|
48
|
+
* related public data.
|
|
49
|
+
*/
|
|
50
|
+
get?: ApiSerializerReference;
|
|
51
|
+
}
|
|
41
52
|
export interface ApiCustomRouteConfig {
|
|
42
53
|
/**
|
|
43
54
|
* Route scope for custom methods.
|
|
@@ -509,6 +520,8 @@ export interface SmartObjectConfig {
|
|
|
509
520
|
* withhold is still emitted.
|
|
510
521
|
*/
|
|
511
522
|
exclude?: string[];
|
|
523
|
+
/** Optional async enrichment for the standard read-only get tool. */
|
|
524
|
+
serializers?: McpSerializersConfig;
|
|
512
525
|
/**
|
|
513
526
|
* Enable the MCP Tasks extension for long-running custom actions.
|
|
514
527
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAe,CAAC;AACpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAW,CAAC;AAC5C,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAA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AC7E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,mFAAmF;IACnF,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC/C,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACjD,2DAA2D;IAC3D,kBAAkB,CAAC,EAAE;QACnB,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,OAAO,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,qBAAqB,EAAE,OAAO,CAAC;KAChC,CAAC;IACF,wEAAwE;IACxE,wBAAwB,CAAC,EACrB,UAAU,GACV,UAAU,GACV,kBAAkB,GAClB,gBAAgB;IAClB,sFAAsF;OACpF,mCAAmC,CAAC;IACxC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B"}
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-core",
|
|
6
|
-
"packageVersion": "0.56.
|
|
6
|
+
"packageVersion": "0.56.1",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "da6534a68906a70b9c595c895b35c758bc477608043670a7a4281ebfa46f51ed",
|
|
11
|
+
"packageJson": "28128c0b6fbd10f1c40f47690b71dbe43ff52f76504f386f8f52af69335958ac",
|
|
12
12
|
"agents": "a55cc2d7dccf8f5dc9fd515361fddf719466159ee11e265285cf14b3fcdd96fa",
|
|
13
13
|
"moduleDoc:agents/object-runtime.md": "fa70a9ead3464b1f9a451e385c59582d872944631db5ac3c7f64550c099dac40",
|
|
14
14
|
"moduleDoc:agents/revision-guard.md": "f6ea32a6860964c98aba14b93587f40b33c8f7d0deccb2c54d21bff45db3da42",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"moduleDoc:agents/schema-paths.md": "aef1b6fd687d0dbe444d20bf318e7c62fb9ef063ead933d2fd8168b87fee032e",
|
|
19
19
|
"moduleDoc:agents/change-feed.md": "c3d6206758dd1d2e0475177e1938fb7d7b6cfe8a6c4d3c3b56ef62bc7bc7739d",
|
|
20
20
|
"moduleDoc:agents/change-signals.md": "a2dbe7077483b5a19bd5ea9589b5a08fe847377c8e05d01d57f813c6d9cbc28b",
|
|
21
|
-
"moduleDoc:agents/generators.md": "
|
|
21
|
+
"moduleDoc:agents/generators.md": "f880fdf8422ed6073feb74c486ad8fa15af0a64e3b2f3c146b9138c42441b146",
|
|
22
22
|
"moduleDoc:agents/build-knowledge.md": "93ea3d5c708daea35ec7f90de81ed33974ce1610d76a2d1c32a77e149bec7ee8",
|
|
23
23
|
"moduleDoc:agents/memory.md": "a86bdf370403d08ecad3be86e341eb322dfe6e6b7a4e8806a6f8be9bf3421da5",
|
|
24
24
|
"moduleDoc:agents/system-diagnostics.md": "b7ccae18ee312bf788d5470f95fa78d3535f1789247d5372e40ca86538290772",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"./manifest.json",
|
|
49
49
|
"./manifest/discover-base-classes",
|
|
50
50
|
"./manifest/discover-smrt-packages",
|
|
51
|
+
"./mcp-serializer",
|
|
51
52
|
"./migrations",
|
|
52
53
|
"./prebuild",
|
|
53
54
|
"./prebuild/cli",
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
"@oxc-project/runtime": "^0.150.0",
|
|
82
83
|
"cheerio": "^1.2.0",
|
|
83
84
|
"fast-glob": "3.3.3",
|
|
85
|
+
"import-meta-resolve": "4.2.0",
|
|
84
86
|
"minimatch": "10.2.6",
|
|
85
87
|
"oxc-transform": "0.150.0",
|
|
86
88
|
"pluralize": "^8.0.0",
|
|
@@ -1186,7 +1188,7 @@
|
|
|
1186
1188
|
{
|
|
1187
1189
|
"path": "agents/generators.md",
|
|
1188
1190
|
"module": "generators",
|
|
1189
|
-
"content": "# smrt-core/code generators\n\nModule semantics for `src/generators/` + `src/vite-plugin/`. Package orientation, the cross-module\ninvariants, and the traps that apply before editing anything live in\n[../AGENTS.md](../AGENTS.md) — read that first.\n\n## Code Generators\n\n| Generator | Location | Output |\n|-----------|----------|--------|\n| REST API | `src/generators/rest.ts` | OpenAPI-compliant CRUD endpoints |\n| MCP Server | `src/generators/mcp.ts` | Model Context Protocol tools |\n| Web collections | `src/vite-plugin/web-collections.ts` (selectors) + `generateWebModule` | `@happyvertical/smrt-virt-web` — one typed collection definition per API-exposed REST collection (#1761), consumed by `@happyvertical/smrt-web` |\n\nThe same web virtual module exports `webMcpToolDefinitions` (#2518), a\ncanonical per-tool array selected independently of list materialization. Every\nnon-empty canonical API action set contributes tools, so get-only and\ncustom-action-only models are discoverable; custom actions declared on a\n`SmrtCollection` merge into the owning row collection. Each definition carries\ncomplete route and invalidation metadata. `collectionDefinitions` and its\nembedded descriptor copy remain unchanged for existing cache-backed consumers.\n\nGenerated API clients share `selectApiClientEntries()` across the runtime Vite\nmodule, its ambient declaration, and physical prebuild declarations. When a\ncollection class and its populated model share an endpoint, the model owns the\ncanonical collection key and row payload schema; the collection class remains\navailable under a deterministic class-derived secondary key. Selection and\ncollision suffixes must not depend on manifest insertion order (#2027).\nRoute emission iterates manifest objects in the same deterministic\nqualified-identity order (`orderedManifestObjectEntries`), so when two models\nshare one collection the last writer of each route file — and therefore the\nCRUD method set `resolveGeneratedEndpointCrudMethods` mirrors into\n`smrt-client.d.ts` — is stable across scan orders (#2754).\nFor aggregated manifests, inheritance and item-type references resolve exact\nqualified names first, then package-local simple names, then a stable identity\nfallback so duplicate class names across packages cannot reintroduce ordering.\n\nThe web module also emits a build-time **`manifestHash`** constant (#1764): `computeWebManifestHash(manifest)` is a deterministic, replica-stable digest of the emitted web-collection SHAPE (name/className/endpoint/idField/actions/fields/relationships), canonicalized (recursive key sort) before `sha256 → base64url`, truncated to 16 chars — so the same schema always hashes the same, and a field add/remove/type-change/edge-change changes it. A change means old persisted client rows may mis-hydrate, so smrt-web keys its durable persistence namespace on it and its `updateAvailable` contract signal compares against it. Four co-managed emission sites must not drift: the runtime value (`generateWebModule`), the `@happyvertical/smrt-virt-web` ambient d.ts (`vite-plugin/index.ts`), the physical `@smrt/web` d.ts (`prebuild/index.ts`), and the hand-written type mirror in `@happyvertical/smrt-web` (`packages/smrt-web/src/index.ts` — dependency-free, so textual sync only).\n\n`webMcpToolDefinitions` is deliberately outside that digest: tool-only route,\nidentifier, or annotation changes cannot alter persisted row hydration.\n\nPer-field web emission (#2046): `buildWebFieldDefinitions` carries `description` (from `@field({ description })`) and sanitized `ui` hints (from `@field({ ui: { basic, group, order, locked } })`, read off the manifest `_meta.ui` bag through per-key type guards) into each emitted field definition, and `buildWebToolDescriptors` threads the same `description` into browser MCP tool schemas. `sensitive`/`transient` fields are excluded from emission entirely, so their descriptions never ship. Both keys are conditional, so hint-less schemas emit byte-identical definitions (and hashes) as before; adding a description/ui hint changes the manifest hash — deliberate over-invalidation, harmless per the #1764 contract.\n\n## Generated MCP server output language\n\n`MCPGenerator` builds every file as TypeScript, so the requested `outputPath`\nextension decides what is written (#2279). `.ts`/`.mts` targets keep the source\nverbatim for `tsx` or Node type stripping — which is why the generated source\nmust stay erasable-syntax-only (no parameter properties, enums, or namespaces).\nEvery other target (`.smrt/mcp-server/index.js` by default) is transpiled to\nJavaScript with lazily loaded `oxc-transform` before writing, because the\nprinted run script and the generated `claude-config.example.json` both invoke\nit with plain `node`. Ordinary core imports and `.ts`/`.mts` output therefore\ndo not load OXC's native bindings.\nThis keeps `typescript` dev-only in `@happyvertical/smrt-core`; generated MCP\nsource must remain erasable-syntax-only. A `.cjs`/`.cts` target is rejected\noutright: generated servers are ES modules. `src/generators/mcp-emit.ts` owns\nthose decisions — do not reintroduce a bare `writeFile` of generated source.\n\nModular output writes `config`, `tools/index`, and `handlers/index` with the\nentry point's own extension, and emits the entry's relative import specifiers\nwith that same extension, so the files it imports both exist and load with the\nsame module semantics — an `.mjs` entry gets `.mjs` siblings, not `.js` ones a\nCommonJS package would then parse as CommonJS. The entry is written at the\nrequested path rather than a hardcoded `index.js`.\nGenerated code also has to be valid in an ES module: `arguments` is not a legal\nbinding name there, however convenient it reads.\n\n## Browser-plane playbook preflight route (#2590)\n\n`GET {basePath}/_preflight?key=<playbook key>` (`src/generators/preflight-route.ts`)\nis an advisory, read-effect, idempotent report of what a caller's playbook would\nbe allowed to do — capability *selection*, never authorization. Resolution and\nverdict shaping live in `@happyvertical/smrt-playbooks`, which depends on this\npackage, so core takes the evaluator as the `APIConfig.playbookPreflight` seam and\nthe dependency stays one-way. Without a provider the route 404s.\n\n**`authMiddleware` is never invoked by preflight**, and that is enforced\nstructurally rather than by discipline: `PlaybookPreflightRouteOptions` has no\nauth member of any kind, and `rest.ts` passes the boolean `appAuthConfigured`\ninstead — so there is no handle in the module to invoke by mistake. A synthetic-\n`Request` dry run is explicitly not an option: the middleware is request-bound,\nreturns a `Response` rather than a boolean, and may consult session stores,\nrate-limit, or audit. The app-auth layer therefore reports `unknown`, which is the\nhonest answer, and a future `authPredicate` seam can fill it in without changing\nthe contract.\n\nThe static layers preflight predicts against are exported from the same module —\n`isApiActionEnabledForObject`, `isRestActionRoutable`, `isRestRoutePublic`,\n`restFieldReadPermissions`, `restMethodForApiAction`,\n`resolveRegisteredObjectName` — and `APIGenerator`'s own\n`isApiActionEnabled` / `isRoutePublic` now delegate to them, so the route and the\nprediction of the route cannot drift. Exposure and existence are separate\nquestions: `include`/`exclude` gate a route, they do not conjure one, so\n`isRestActionRoutable` additionally requires a custom action to be declared in\n`api.routes` — the only map `dispatchCustomCollectionAction` iterates. A custom\naction is predicted against the verb its own route config declares, so a\n`public: 'read'` opt-out neither silently covers a `POST` action nor falsely\ndenies a declared `GET` one. Every unresolvable key returns the provider's single uniform\n\"unavailable\" body with an unconditional 200: unknown and unauthorized keys are\nindistinguishable at the HTTP layer too.\n\n## Emitted agent surface (#2591)\n\nGenerated model tools have always been build-time artifacts — virtual module,\nmanifest, knowledge graph. View intents (#2588) and playbooks (#2589) existed\nonly once something mounted, so \"what can an agent do in this app\" had no answer\nshort of enumerating every route. This closes that.\n\nThe same OXC scan that builds the manifest also runs the scanner's\nagent-surface matcher (`ScanResults.agentSurface`). `smrtPlugin()` captures it\nin `scanWithOxc`, projects it with `toKnowledgeAgentSurface`, and passes it to\n`buildDomainKnowledgeManifest` as `agentSurface`. Note that declaration\ndiscovery is NOT bound to the plugin's `include` glob — an app that scans\n`src/lib/objects/**` for models still has its `src/lib/agent/*.intents.ts`\nsidecars found (see `packages/scanner/AGENTS.md`). Two more consequences worth\nholding onto:\n\n- **It never touches `manifest.json`.** The runtime manifest stays\n runtime-focused; the agent-addressable surface is an agent/developer contract,\n so it lands in `.smrt/smrt-knowledge.json` and `dist/smrt-knowledge.json`\n only, under `agentSurface: { intents, playbooks, diagnostics }`.\n- **It is passed in, not scanned in `knowledge.ts`.** The scanner carries a\n native parser binary and `smrt-core`'s main entry is browser-reachable, so\n core's sync knowledge builder must not import it. The Vite plugin already\n imports the scanner lazily on the Node side and is the only caller that writes\n this artifact.\n\nThe field is **omitted entirely** when a package declares nothing, which is what\nmakes it additive in practice rather than only on paper: every existing\npackage's checked-in artifact stays byte-identical.\n\nEach declaring module gets a `sourceHashes` entry under the\n`agentSurface:<package-relative path>` prefix (`AGENT_SURFACE_HASH_PREFIX`), so\nEDITING an intent sidecar marks the artifact stale exactly like editing\n`AGENTS.md` does (`stale-domain-knowledge`).\n\nHashes alone cannot see an **added** declaration, though: a brand-new sidecar\nhas no recorded hash to mismatch, the runtime manifest never carries intents,\nand `AGENTS.md` is untouched — so every other signal stays green while the\nartifact omits a real operation. `dev:knowledge-check` therefore also re-derives\nthe declaration SET from source and compares it to the artifact by identity,\nreporting either direction as `stale-agent-surface`. The scan is bounded like\nthe numeric-precision lint: `src` only, behind the scanner's token pre-filter.\n\nThat re-derivation must model what the EMITTER sees, not merely what is on\ndisk, or it reports drift no rebuild can clear. Which files count is decided by\nthe scanner's exported `isAgentSurfaceSourcePath` — the same predicate the\nemitter itself uses, never a list copied into the checker — and the per-file\nresults run through `mergeAgentSurfaces` before comparing, because the merge is\nwhere a duplicate identity and a derived tool-name collision are resolved and\nthe artifact is the merged result.\nDiagnostics are compared alongside identities: a sidecar containing only a\ncomputed declaration adds no identity and has no prior hash, so without that,\n\"a diagnostic, never silence\" would quietly become \"a diagnostic, until the\nartifact goes stale\". The walk covers `<pkg>/src` while the emitter globs the\nwhole project root, so an emitted entry from outside `src` is not reported as\nmissing — this check did not look there, and claiming otherwise would be an\nerror nothing could clear.\n\nBoth `stale-*` codes are warnings by default and errors under `--strict`, which\nis what CI runs. Alongside them: `agent-surface-missing-identity`,\n`agent-surface-duplicate-identity`, and `agent-surface-empty-playbook` are\nerrors, and `agent-surface-not-static` and `agent-surface-tool-name-collision`\nare warnings. A cross-file duplicate arrives as a *diagnostic* rather than two\nentries — the scanner's merge already dropped the loser — so that diagnostic\nmaps to the duplicate error rather than the not-static warning; otherwise the\nerror would be unreachable for the case it exists to catch.\n\nA `tool-name-collision` diagnostic (#2725) is derived from the MANIFEST, not\nfrom the declaration: the plugin compares each emitted intent against\n`buildWebMcpToolDefinitions` for the same build, which is already filtered by\nthe exposure policy, and appends the result to the surface. So it is excluded\nfrom the drift comparison above — that pass re-derives declarations from source\nalone and has no manifest, so counting one as \"declared\" would report every\ncollision as drift no rebuild could clear. The check is advisory and drops\nnothing: `defineIntent` accepts the id, so the intent is emitted, and the\ndocument-global tool-name lock (#2613) rejects whichever registers second — the\nbuild-time notice is the earlier, cheaper form of the same answer. A build\ncannot see the provider's WebMCP `namespace` or `effects` policy, either of\nwhich separates the pair outright, so the message states that precondition\nrather than asserting the collision.\n\n`smrt doctor` prints the whole surface — model tools, intents, playbooks — from\nthese artifacts alone, with no application running.\n\n## Custom-action contract\n\n`resolveCustomActionMetadata()` is the common discovery and invocation contract\nfor generated REST routes and API clients, MCP, CLI, WebMCP, and simple\nREST-resource discovery. Receiver scope comes from the executable method, never a\nconfiguration-only `api.routes[name].scope` override: instance model methods\nare item-scoped and require `id`; static model methods and recognized\n`SmrtCollection` methods are collection-scoped and do not accept `id`. Route\nconfiguration may still choose its path and HTTP verb, but it cannot turn an\ninstance call into `ClassRef.action` or vice versa.\n\nWhen scanner method metadata exists, discovery projects each named parameter\nand its JSON-schema type, and invokers pass the values positionally in declared\norder. The legacy single `options` bag remains compatible when metadata is\nabsent (or the declared method takes `options`). Do not infer this from runtime\nfunction arity. An omitted typed `options` parameter remains `undefined`, so a\nmethod's JavaScript default initializer continues to apply; an explicit `null`\nremains `null`. Flat tool and CLI inputs reserve `id` for receiver parsing. If\nan action declares an `id` parameter, its flat MCP/WebMCP field is `actionId`\n(and CLI uses `--action-id`); REST keeps its independent path/body\nnamespaces. Typed CLI actions may use standard flag names such as `limit`,\n`offset`, `where`, and `format` without those values being stripped as CRUD\nflags.\n\nCustom actions may return an explicit, domain-neutral failure object with\n`ok: false`, `code`, and `message` plus optional `status`, `details`,\n`retryable`, and `correlationId`. `normalizeCustomActionFailure()` redacts it;\ngenerated REST returns `{ error: failure }` with the non-2xx status, while MCP\nreturns `isError: true` and `_meta['io.happyvertical/smrt']`. Opaque successful\nobjects (including `{ code, message }`) remain untouched; thrown exceptions are\nnot reclassified as domain failures.\n\nCustom route metadata also classifies browser-tool effects. Set `effect` to\n`read`, `write`, or `destructive`, with truthful `idempotent` and `openWorld`\nflags. CRUD classification is fixed: list/get are read, create/update are write,\nand delete is destructive. An undeclared custom action deliberately defaults to\ndestructive, non-idempotent, and open-world so a browser capability policy never\nfails open.\n\nGenerated reads (`list`/`get`) on the REST and SvelteKit generators support conditional GET (helpers in `src/generators/conditional-get.ts`). ETag v2 (#1765): the validator is the table's change-feed version (`getTableVersion`) keyed by the request representation, so a **concrete** `If-None-Match` short-circuits into a 304 with an empty body **before** the collection query runs — an unchanged table revalidates with zero table scan. A wildcard `If-None-Match: *` is deferred until the payload builds (existence confirmed), so a missing item still returns 404, not a false 304. Tenant-scoped reads fold the active tenant into the representation (`resolveTenantEtagDiscriminator`) so one tenant's cached validator never satisfies another's read of the same URL. Routes whose GET renders via a **custom serializer** (which can load related tables the base-table version can't observe) keep the v1 body-hash ETag (`#1757`, query-first but correct); the default `toPublicJSON` path — all REST reads and non-serializer SvelteKit reads — uses v2. v2 is weakly consistent by design (the cost of not reading the data): a revalidation in the sub-statement window between a committed write and its feed append can return a stale 304 that self-heals on the next revalidation. The other v2 window — a deploy that changes the response shape WITHOUT a table write — is closed by the **#1764 ETag salt**: `computeTableVersionEtag(version, representation, manifestHash?)` folds the build's web-collection shape digest into the digest, so a shape-only redeploy busts every read validator (`undefined` reproduces the pre-#1764 unsalted value byte-for-byte for direct helper callers). The generated SvelteKit route bakes the digest in as a `MANIFEST_HASH` constant (via `generateConditionalGetRouteHelper`'s `manifestHash` option, sourced from `computeWebManifestHash(manifest)`) — automatic for the SvelteKit transport. The runtime `APIGenerator` auto-populates the same salt from the runtime registry with `computeRuntimeWebManifestHash()` when `APIConfig.manifestHash` is omitted; explicit `APIConfig.manifestHash` still wins for custom setups. The digest scope is get-OR-list (`selectWebEtagSaltEntries`), so **get-only** routes are salted too. Strong consistency still requires the v1 body-hash path. Cache-Control policy (unchanged from #1757): `private, no-cache` by default; public models may opt into shared caching via `@smrt({ api: { public: true | 'read', cache: { sMaxage } } })` → `public, max-age=0, s-maxage=<n>`; non-public models never emit shared-cache headers. Tenant-scoped models (any mode) never emit them either — bodies vary with session-cookie tenant context that URL-keyed shared caches cannot see; `sMaxage` is neutralized to `private, no-cache` with a one-time warning.\n\n## Generated dev-plane route (#2782)\n\n`src/vite-plugin/dev-plane-route.ts` emits `<routesDir>/_dev/[...tool]/+server.ts`\nonly when `svelteKit.devPlaneRoute.enabled === true` and\n`@happyvertical/smrt-dev-mcp/dev-plane` resolves from the consumer (same\nresolvability guard as `_resources`). The route is dev-only (`$app/environment`\n`dev`, else 404), refuses to start without `SMRT_DEV_MCP_TOKEN` (503), and\ndelegates everything else to `createDevPlane`, passing `getSmrtConfig(...).db`\nfrom the embedded access prelude (below) so the plane shares the app's\nconnection.\nCore never imports smrt-dev-mcp; only the generated file does, at consumer\nruntime. The route carries the auto-generated header so the sweep owns it.\n\nGenerated SvelteKit write routes (#2977) call `requireRoutePermission(locals, action)` after `requireRouteAuth`: CRUD writes need `<collection>.create|update|delete` and mutating custom actions `<collection>.<method>` in the session permission snapshot on `locals`, else 403 (fail-closed; `api.public: true` stays open, `tenantContext.superAdminBypass` skips). See `packages/users/agents/permissions.md`.\n\n## MCP protocol identifiers (#3219)\n\nMCP discovery preserves existing names matching `[A-Za-z0-9_.-]{1,64}`.\nPreviously invalid names use their first 31 sanitized ASCII characters, `_`,\nand the first 32 hex characters of SHA-256 over the JSON tuple\n`[original class name, lowercased action name, original raw tool name]`.\nThis makes long or punctuation-bearing identifiers deterministic without\ncollapsing common prefixes. Discovery reserves compliant names first and fails\nclosed on any duplicate raw name or final alias collision instead of advertising\nambiguous dispatch (including class names differing only by case across packages).\nConsumers must use the advertised name rather than constructing one.\n\nThe generator retains a separate class/action binding for each descriptor and\nemits that mapping for generated runtimes. Dispatch, task eligibility, tenant\nscoping, ordering, and STI metadata use this binding; protocol aliases are not\nexecution identities. The advertised catalog still gates execution. The direct\nruntime-template API accepts `toolTargets`; omitting it retains the legacy\n`object_action` convention for existing direct callers. Supply explicit targets\nfor canonicalized names or class names containing underscores. This contract\ndoes not change CLI, REST, or WebMCP identifiers.\n\n`MCPGenerator.getToolIdentity(tool)` exposes the generator-validated original\nclass, action, and raw generated name to in-process catalog composers. App MCP\nuses it for class allow-lists, tenant checks, and compatible workflow guards;\nthose consumers must not reverse protocol aliases. The alias remains the sole\nwire tool name and is still the key for public patterns and generic tool policy.\n\n`MCPConfig.classNames` scopes generation (simple names, case-insensitive, or\nqualified `@scope/pkg:Class`); omitted, every registered class is a candidate.\nA simple name matching more than one registered class throws (scope it by\nqualified name). Each tool keeps its class's registry key, and configuration,\nfields, methods, dispatch, tasks and collections resolve through that key —\nnever through the first same-named class. Generated servers (single-file and\nmodular) carry it as `registryKey` in their tool targets and task actions and\nuse it for every emitted collection, policy, class and STI-base lookup;\n`objectName` stays the wire/display name.\nA host with an allow-list passes it so the duplicate-name check runs over the\npublished set only: an unrelated collision among classes it never lists must\nnot fail its catalog or calls (#3490). App MCP always scopes its generators.\n\n## Generated route collection access (#3416)\n\nThere is no generated route-access module. Every generated SvelteKit route\nthat needs collections (CRUD, custom actions, `_changes`, `_events`,\n`sync/apply`, `_dev`) embeds the prelude from\n`generateCollectionAccessImports()` (`sveltekit-config-import.ts`): it imports\nthe generated `smrt-register` module, then the app's config module\n(`$lib/server/smrt` by default) as `* as smrtApplication`, and destructures\n`getCollection`/`getSmrtConfig` from `createGeneratedCollectionAccess()`\n(`src/generated-collection-access.ts`). Generation fails before writing\nanything when `configFileName` resolves to the registration module\n(`smrt-register` with any script extension or case).\nThat helper resolves per call, never caching: a legacy `getCollection` /\n`getSmrtConfig` export wins (deprecated, warned once per module, for one\nrelease), else the exported app-runtime `runtime.getCollection()` /\n`classOptions()`, else it fails with an error naming the module. `_resources`\nand static collection-scoped actions only need registration, so they import\n`smrt-register` and then the config module. When the config module is missing\nand `@happyvertical/smrt-app-runtime/sveltekit` resolves from the consumer, the\ngenerator writes a runtime-shaped default instead of the legacy\n`getCollection` file.\n\n## Enum-constrained fields (#3598)\n\nThe scanner emits `enum: [...]` on a manifest field typed as a TS enum or\nstring/number literal union. Registry-sourced fields mirror it into\n`_meta.enum` (`createFieldFromManifest` / `mergeManifestField`); read it with\n`readFieldEnum()` (top level first, then `_meta`), never directly. Generated\ntool schemas (`fieldTypeToJsonSchema`, so MCP and WebMCP descriptors), OpenAPI\n(`swagger.ts`) and the legacy `generateSchemaProperties` emit JSON Schema\n`enum` for `text`/`integer`/`decimal` fields only; a nullable field appends\n`null` to the list so `type: [.., 'null']` still validates. The client web\ncollection `fields` map does not carry `enum` yet (it feeds the shape digest and\nthree hand-mirrored d.ts files); tool inputs read it from the manifest field.\n\n## Custom-action permission aliases (#3878)\n\n`@smrt({ operationPermissions: { run: { action: 'read' } } })` lets a custom\nmethod reuse an existing CRUD grant in its own collection. Generated SvelteKit\nPOST routes and smrt-users operation guards resolve the same mapping; the\ncatalog emits the target grant rather than a second method-named permission.\nCRUD itself cannot be aliased. Malformed declarations fail closed. Optional\n`databaseActions: ['SELECT', 'UPDATE']` adds explicit PostgreSQL policy bindings\nfor the aliased grant (for example a status-only archive guarded by `create`\nthat must load its item before updating it). This is server-authored authority\nmetadata: grant only the actions the method needs, review it with the method's\nmodel-level validation, and regenerate RLS policies when adopting a changed\nbinding.\n\nCustom actions retain the `{ action, result }` response envelope.\n"
|
|
1191
|
+
"content": "# smrt-core/code generators\n\nModule semantics for `src/generators/` + `src/vite-plugin/`. Package orientation, the cross-module\ninvariants, and the traps that apply before editing anything live in\n[../AGENTS.md](../AGENTS.md) — read that first.\n\n## Code Generators\n\n| Generator | Location | Output |\n|-----------|----------|--------|\n| REST API | `src/generators/rest.ts` | OpenAPI-compliant CRUD endpoints |\n| MCP Server | `src/generators/mcp.ts` | Model Context Protocol tools |\n| Web collections | `src/vite-plugin/web-collections.ts` (selectors) + `generateWebModule` | `@happyvertical/smrt-virt-web` — one typed collection definition per API-exposed REST collection (#1761), consumed by `@happyvertical/smrt-web` |\n\nThe same web virtual module exports `webMcpToolDefinitions` (#2518), a\ncanonical per-tool array selected independently of list materialization. Every\nnon-empty canonical API action set contributes tools, so get-only and\ncustom-action-only models are discoverable; custom actions declared on a\n`SmrtCollection` merge into the owning row collection. Each definition carries\ncomplete route and invalidation metadata. `collectionDefinitions` and its\nembedded descriptor copy remain unchanged for existing cache-backed consumers.\n\nGenerated API clients share `selectApiClientEntries()` across the runtime Vite\nmodule, its ambient declaration, and physical prebuild declarations. When a\ncollection class and its populated model share an endpoint, the model owns the\ncanonical collection key and row payload schema; the collection class remains\navailable under a deterministic class-derived secondary key. Selection and\ncollision suffixes must not depend on manifest insertion order (#2027).\nRoute emission iterates manifest objects in the same deterministic\nqualified-identity order (`orderedManifestObjectEntries`), so when two models\nshare one collection the last writer of each route file — and therefore the\nCRUD method set `resolveGeneratedEndpointCrudMethods` mirrors into\n`smrt-client.d.ts` — is stable across scan orders (#2754).\nFor aggregated manifests, inheritance and item-type references resolve exact\nqualified names first, then package-local simple names, then a stable identity\nfallback so duplicate class names across packages cannot reintroduce ordering.\n\nThe web module also emits a build-time **`manifestHash`** constant (#1764): `computeWebManifestHash(manifest)` is a deterministic, replica-stable digest of the emitted web-collection SHAPE (name/className/endpoint/idField/actions/fields/relationships), canonicalized (recursive key sort) before `sha256 → base64url`, truncated to 16 chars — so the same schema always hashes the same, and a field add/remove/type-change/edge-change changes it. A change means old persisted client rows may mis-hydrate, so smrt-web keys its durable persistence namespace on it and its `updateAvailable` contract signal compares against it. Four co-managed emission sites must not drift: the runtime value (`generateWebModule`), the `@happyvertical/smrt-virt-web` ambient d.ts (`vite-plugin/index.ts`), the physical `@smrt/web` d.ts (`prebuild/index.ts`), and the hand-written type mirror in `@happyvertical/smrt-web` (`packages/smrt-web/src/index.ts` — dependency-free, so textual sync only).\n\n`webMcpToolDefinitions` is deliberately outside that digest: tool-only route,\nidentifier, or annotation changes cannot alter persisted row hydration.\n\nPer-field web emission (#2046): `buildWebFieldDefinitions` carries `description` (from `@field({ description })`) and sanitized `ui` hints (from `@field({ ui: { basic, group, order, locked } })`, read off the manifest `_meta.ui` bag through per-key type guards) into each emitted field definition, and `buildWebToolDescriptors` threads the same `description` into browser MCP tool schemas. `sensitive`/`transient` fields are excluded from emission entirely, so their descriptions never ship. Both keys are conditional, so hint-less schemas emit byte-identical definitions (and hashes) as before; adding a description/ui hint changes the manifest hash — deliberate over-invalidation, harmless per the #1764 contract.\n\n## MCP `get` serializers\n\nA model may add an async serializer only to its standard generated MCP `get`\ntool. Configure a module specifier and named export under `mcp.serializers.get`:\n\n```ts\n@smrt({\n mcp: {\n serializers: {\n get: {\n importPath: '@scope/package',\n exportName: 'serializeThingMcpGet',\n },\n },\n },\n})\n```\n\nThe named export receives `(item, options: PublicJsonOptions)` and returns the\nget result (or a promise for it). Bare package specifiers resolve with ESM\nconditions from the declaring model's loaded module, so the serializer's owning\npackage is an application dependency rather than a dependency of core or a\ngeneric dispatcher. This anchor is independent of `process.cwd()`. Relative\nreferences retain ordinary dynamic-import behavior. The MCP runtime imports\nand caches the named module, then calls the serializer after normal\nauthentication, tenant-scoped lookup, and read access have admitted and loaded\nthe item. A missing or non-function export makes that `get` call fail. The hook\nreplaces only the standard `get` result; generated `list`, writes, deletes, and\ncustom actions keep their existing contracts.\n\nThe serializer owns its public projection. Start with\n`item.toPublicJSON(options)`, and project each related model with that model's\n`toPublicJSON(options)` before adding it. The final transport pass cannot make\narbitrary plain aliases permission-safe: returning a DTO does not cause fields\ninside it to be filtered by model policy. Do not use `toJSON()` or spread model\ninstances into a serializer result.\n\n## Generated MCP server output language\n\n`MCPGenerator` builds every file as TypeScript, so the requested `outputPath`\nextension decides what is written (#2279). `.ts`/`.mts` targets keep the source\nverbatim for `tsx` or Node type stripping — which is why the generated source\nmust stay erasable-syntax-only (no parameter properties, enums, or namespaces).\nEvery other target (`.smrt/mcp-server/index.js` by default) is transpiled to\nJavaScript with lazily loaded `oxc-transform` before writing, because the\nprinted run script and the generated `claude-config.example.json` both invoke\nit with plain `node`. Ordinary core imports and `.ts`/`.mts` output therefore\ndo not load OXC's native bindings.\nThis keeps `typescript` dev-only in `@happyvertical/smrt-core`; generated MCP\nsource must remain erasable-syntax-only. A `.cjs`/`.cts` target is rejected\noutright: generated servers are ES modules. `src/generators/mcp-emit.ts` owns\nthose decisions — do not reintroduce a bare `writeFile` of generated source.\n\nModular output writes `config`, `tools/index`, and `handlers/index` with the\nentry point's own extension, and emits the entry's relative import specifiers\nwith that same extension, so the files it imports both exist and load with the\nsame module semantics — an `.mjs` entry gets `.mjs` siblings, not `.js` ones a\nCommonJS package would then parse as CommonJS. The entry is written at the\nrequested path rather than a hardcoded `index.js`.\nGenerated code also has to be valid in an ES module: `arguments` is not a legal\nbinding name there, however convenient it reads.\n\n## Browser-plane playbook preflight route (#2590)\n\n`GET {basePath}/_preflight?key=<playbook key>` (`src/generators/preflight-route.ts`)\nis an advisory, read-effect, idempotent report of what a caller's playbook would\nbe allowed to do — capability *selection*, never authorization. Resolution and\nverdict shaping live in `@happyvertical/smrt-playbooks`, which depends on this\npackage, so core takes the evaluator as the `APIConfig.playbookPreflight` seam and\nthe dependency stays one-way. Without a provider the route 404s.\n\n**`authMiddleware` is never invoked by preflight**, and that is enforced\nstructurally rather than by discipline: `PlaybookPreflightRouteOptions` has no\nauth member of any kind, and `rest.ts` passes the boolean `appAuthConfigured`\ninstead — so there is no handle in the module to invoke by mistake. A synthetic-\n`Request` dry run is explicitly not an option: the middleware is request-bound,\nreturns a `Response` rather than a boolean, and may consult session stores,\nrate-limit, or audit. The app-auth layer therefore reports `unknown`, which is the\nhonest answer, and a future `authPredicate` seam can fill it in without changing\nthe contract.\n\nThe static layers preflight predicts against are exported from the same module —\n`isApiActionEnabledForObject`, `isRestActionRoutable`, `isRestRoutePublic`,\n`restFieldReadPermissions`, `restMethodForApiAction`,\n`resolveRegisteredObjectName` — and `APIGenerator`'s own\n`isApiActionEnabled` / `isRoutePublic` now delegate to them, so the route and the\nprediction of the route cannot drift. Exposure and existence are separate\nquestions: `include`/`exclude` gate a route, they do not conjure one, so\n`isRestActionRoutable` additionally requires a custom action to be declared in\n`api.routes` — the only map `dispatchCustomCollectionAction` iterates. A custom\naction is predicted against the verb its own route config declares, so a\n`public: 'read'` opt-out neither silently covers a `POST` action nor falsely\ndenies a declared `GET` one. Every unresolvable key returns the provider's single uniform\n\"unavailable\" body with an unconditional 200: unknown and unauthorized keys are\nindistinguishable at the HTTP layer too.\n\n## Emitted agent surface (#2591)\n\nGenerated model tools have always been build-time artifacts — virtual module,\nmanifest, knowledge graph. View intents (#2588) and playbooks (#2589) existed\nonly once something mounted, so \"what can an agent do in this app\" had no answer\nshort of enumerating every route. This closes that.\n\nThe same OXC scan that builds the manifest also runs the scanner's\nagent-surface matcher (`ScanResults.agentSurface`). `smrtPlugin()` captures it\nin `scanWithOxc`, projects it with `toKnowledgeAgentSurface`, and passes it to\n`buildDomainKnowledgeManifest` as `agentSurface`. Note that declaration\ndiscovery is NOT bound to the plugin's `include` glob — an app that scans\n`src/lib/objects/**` for models still has its `src/lib/agent/*.intents.ts`\nsidecars found (see `packages/scanner/AGENTS.md`). Two more consequences worth\nholding onto:\n\n- **It never touches `manifest.json`.** The runtime manifest stays\n runtime-focused; the agent-addressable surface is an agent/developer contract,\n so it lands in `.smrt/smrt-knowledge.json` and `dist/smrt-knowledge.json`\n only, under `agentSurface: { intents, playbooks, diagnostics }`.\n- **It is passed in, not scanned in `knowledge.ts`.** The scanner carries a\n native parser binary and `smrt-core`'s main entry is browser-reachable, so\n core's sync knowledge builder must not import it. The Vite plugin already\n imports the scanner lazily on the Node side and is the only caller that writes\n this artifact.\n\nThe field is **omitted entirely** when a package declares nothing, which is what\nmakes it additive in practice rather than only on paper: every existing\npackage's checked-in artifact stays byte-identical.\n\nEach declaring module gets a `sourceHashes` entry under the\n`agentSurface:<package-relative path>` prefix (`AGENT_SURFACE_HASH_PREFIX`), so\nEDITING an intent sidecar marks the artifact stale exactly like editing\n`AGENTS.md` does (`stale-domain-knowledge`).\n\nHashes alone cannot see an **added** declaration, though: a brand-new sidecar\nhas no recorded hash to mismatch, the runtime manifest never carries intents,\nand `AGENTS.md` is untouched — so every other signal stays green while the\nartifact omits a real operation. `dev:knowledge-check` therefore also re-derives\nthe declaration SET from source and compares it to the artifact by identity,\nreporting either direction as `stale-agent-surface`. The scan is bounded like\nthe numeric-precision lint: `src` only, behind the scanner's token pre-filter.\n\nThat re-derivation must model what the EMITTER sees, not merely what is on\ndisk, or it reports drift no rebuild can clear. Which files count is decided by\nthe scanner's exported `isAgentSurfaceSourcePath` — the same predicate the\nemitter itself uses, never a list copied into the checker — and the per-file\nresults run through `mergeAgentSurfaces` before comparing, because the merge is\nwhere a duplicate identity and a derived tool-name collision are resolved and\nthe artifact is the merged result.\nDiagnostics are compared alongside identities: a sidecar containing only a\ncomputed declaration adds no identity and has no prior hash, so without that,\n\"a diagnostic, never silence\" would quietly become \"a diagnostic, until the\nartifact goes stale\". The walk covers `<pkg>/src` while the emitter globs the\nwhole project root, so an emitted entry from outside `src` is not reported as\nmissing — this check did not look there, and claiming otherwise would be an\nerror nothing could clear.\n\nBoth `stale-*` codes are warnings by default and errors under `--strict`, which\nis what CI runs. Alongside them: `agent-surface-missing-identity`,\n`agent-surface-duplicate-identity`, and `agent-surface-empty-playbook` are\nerrors, and `agent-surface-not-static` and `agent-surface-tool-name-collision`\nare warnings. A cross-file duplicate arrives as a *diagnostic* rather than two\nentries — the scanner's merge already dropped the loser — so that diagnostic\nmaps to the duplicate error rather than the not-static warning; otherwise the\nerror would be unreachable for the case it exists to catch.\n\nA `tool-name-collision` diagnostic (#2725) is derived from the MANIFEST, not\nfrom the declaration: the plugin compares each emitted intent against\n`buildWebMcpToolDefinitions` for the same build, which is already filtered by\nthe exposure policy, and appends the result to the surface. So it is excluded\nfrom the drift comparison above — that pass re-derives declarations from source\nalone and has no manifest, so counting one as \"declared\" would report every\ncollision as drift no rebuild could clear. The check is advisory and drops\nnothing: `defineIntent` accepts the id, so the intent is emitted, and the\ndocument-global tool-name lock (#2613) rejects whichever registers second — the\nbuild-time notice is the earlier, cheaper form of the same answer. A build\ncannot see the provider's WebMCP `namespace` or `effects` policy, either of\nwhich separates the pair outright, so the message states that precondition\nrather than asserting the collision.\n\n`smrt doctor` prints the whole surface — model tools, intents, playbooks — from\nthese artifacts alone, with no application running.\n\n## Custom-action contract\n\n`resolveCustomActionMetadata()` is the common discovery and invocation contract\nfor generated REST routes and API clients, MCP, CLI, WebMCP, and simple\nREST-resource discovery. Receiver scope comes from the executable method, never a\nconfiguration-only `api.routes[name].scope` override: instance model methods\nare item-scoped and require `id`; static model methods and recognized\n`SmrtCollection` methods are collection-scoped and do not accept `id`. Route\nconfiguration may still choose its path and HTTP verb, but it cannot turn an\ninstance call into `ClassRef.action` or vice versa.\n\nWhen scanner method metadata exists, discovery projects each named parameter\nand its JSON-schema type, and invokers pass the values positionally in declared\norder. The legacy single `options` bag remains compatible when metadata is\nabsent (or the declared method takes `options`). Do not infer this from runtime\nfunction arity. An omitted typed `options` parameter remains `undefined`, so a\nmethod's JavaScript default initializer continues to apply; an explicit `null`\nremains `null`. Flat tool and CLI inputs reserve `id` for receiver parsing. If\nan action declares an `id` parameter, its flat MCP/WebMCP field is `actionId`\n(and CLI uses `--action-id`); REST keeps its independent path/body\nnamespaces. Typed CLI actions may use standard flag names such as `limit`,\n`offset`, `where`, and `format` without those values being stripped as CRUD\nflags.\n\nCustom actions may return an explicit, domain-neutral failure object with\n`ok: false`, `code`, and `message` plus optional `status`, `details`,\n`retryable`, and `correlationId`. `normalizeCustomActionFailure()` redacts it;\ngenerated REST returns `{ error: failure }` with the non-2xx status, while MCP\nreturns `isError: true` and `_meta['io.happyvertical/smrt']`. Opaque successful\nobjects (including `{ code, message }`) remain untouched; thrown exceptions are\nnot reclassified as domain failures.\n\nCustom route metadata also classifies browser-tool effects. Set `effect` to\n`read`, `write`, or `destructive`, with truthful `idempotent` and `openWorld`\nflags. CRUD classification is fixed: list/get are read, create/update are write,\nand delete is destructive. An undeclared custom action deliberately defaults to\ndestructive, non-idempotent, and open-world so a browser capability policy never\nfails open.\n\nGenerated reads (`list`/`get`) on the REST and SvelteKit generators support conditional GET (helpers in `src/generators/conditional-get.ts`). ETag v2 (#1765): the validator is the table's change-feed version (`getTableVersion`) keyed by the request representation, so a **concrete** `If-None-Match` short-circuits into a 304 with an empty body **before** the collection query runs — an unchanged table revalidates with zero table scan. A wildcard `If-None-Match: *` is deferred until the payload builds (existence confirmed), so a missing item still returns 404, not a false 304. Tenant-scoped reads fold the active tenant into the representation (`resolveTenantEtagDiscriminator`) so one tenant's cached validator never satisfies another's read of the same URL. Routes whose GET renders via a **custom serializer** (which can load related tables the base-table version can't observe) keep the v1 body-hash ETag (`#1757`, query-first but correct); the default `toPublicJSON` path — all REST reads and non-serializer SvelteKit reads — uses v2. v2 is weakly consistent by design (the cost of not reading the data): a revalidation in the sub-statement window between a committed write and its feed append can return a stale 304 that self-heals on the next revalidation. The other v2 window — a deploy that changes the response shape WITHOUT a table write — is closed by the **#1764 ETag salt**: `computeTableVersionEtag(version, representation, manifestHash?)` folds the build's web-collection shape digest into the digest, so a shape-only redeploy busts every read validator (`undefined` reproduces the pre-#1764 unsalted value byte-for-byte for direct helper callers). The generated SvelteKit route bakes the digest in as a `MANIFEST_HASH` constant (via `generateConditionalGetRouteHelper`'s `manifestHash` option, sourced from `computeWebManifestHash(manifest)`) — automatic for the SvelteKit transport. The runtime `APIGenerator` auto-populates the same salt from the runtime registry with `computeRuntimeWebManifestHash()` when `APIConfig.manifestHash` is omitted; explicit `APIConfig.manifestHash` still wins for custom setups. The digest scope is get-OR-list (`selectWebEtagSaltEntries`), so **get-only** routes are salted too. Strong consistency still requires the v1 body-hash path. Cache-Control policy (unchanged from #1757): `private, no-cache` by default; public models may opt into shared caching via `@smrt({ api: { public: true | 'read', cache: { sMaxage } } })` → `public, max-age=0, s-maxage=<n>`; non-public models never emit shared-cache headers. Tenant-scoped models (any mode) never emit them either — bodies vary with session-cookie tenant context that URL-keyed shared caches cannot see; `sMaxage` is neutralized to `private, no-cache` with a one-time warning.\n\n## Generated dev-plane route (#2782)\n\n`src/vite-plugin/dev-plane-route.ts` emits `<routesDir>/_dev/[...tool]/+server.ts`\nonly when `svelteKit.devPlaneRoute.enabled === true` and\n`@happyvertical/smrt-dev-mcp/dev-plane` resolves from the consumer (same\nresolvability guard as `_resources`). The route is dev-only (`$app/environment`\n`dev`, else 404), refuses to start without `SMRT_DEV_MCP_TOKEN` (503), and\ndelegates everything else to `createDevPlane`, passing `getSmrtConfig(...).db`\nfrom the embedded access prelude (below) so the plane shares the app's\nconnection.\nCore never imports smrt-dev-mcp; only the generated file does, at consumer\nruntime. The route carries the auto-generated header so the sweep owns it.\n\nGenerated SvelteKit write routes (#2977) call `requireRoutePermission(locals, action)` after `requireRouteAuth`: CRUD writes need `<collection>.create|update|delete` and mutating custom actions `<collection>.<method>` in the session permission snapshot on `locals`, else 403 (fail-closed; `api.public: true` stays open, `tenantContext.superAdminBypass` skips). See `packages/users/agents/permissions.md`.\n\n## MCP protocol identifiers (#3219)\n\nMCP discovery preserves existing names matching `[A-Za-z0-9_.-]{1,64}`.\nPreviously invalid names use their first 31 sanitized ASCII characters, `_`,\nand the first 32 hex characters of SHA-256 over the JSON tuple\n`[original class name, lowercased action name, original raw tool name]`.\nThis makes long or punctuation-bearing identifiers deterministic without\ncollapsing common prefixes. Discovery reserves compliant names first and fails\nclosed on any duplicate raw name or final alias collision instead of advertising\nambiguous dispatch (including class names differing only by case across packages).\nConsumers must use the advertised name rather than constructing one.\n\nThe generator retains a separate class/action binding for each descriptor and\nemits that mapping for generated runtimes. Dispatch, task eligibility, tenant\nscoping, ordering, and STI metadata use this binding; protocol aliases are not\nexecution identities. The advertised catalog still gates execution. The direct\nruntime-template API accepts `toolTargets`; omitting it retains the legacy\n`object_action` convention for existing direct callers. Supply explicit targets\nfor canonicalized names or class names containing underscores. This contract\ndoes not change CLI, REST, or WebMCP identifiers.\n\n`MCPGenerator.getToolIdentity(tool)` exposes the generator-validated original\nclass, action, and raw generated name to in-process catalog composers. App MCP\nuses it for class allow-lists, tenant checks, and compatible workflow guards;\nthose consumers must not reverse protocol aliases. The alias remains the sole\nwire tool name and is still the key for public patterns and generic tool policy.\n\n`MCPConfig.classNames` scopes generation (simple names, case-insensitive, or\nqualified `@scope/pkg:Class`); omitted, every registered class is a candidate.\nA simple name matching more than one registered class throws (scope it by\nqualified name). Each tool keeps its class's registry key, and configuration,\nfields, methods, dispatch, tasks and collections resolve through that key —\nnever through the first same-named class. Generated servers (single-file and\nmodular) carry it as `registryKey` in their tool targets and task actions and\nuse it for every emitted collection, policy, class and STI-base lookup;\n`objectName` stays the wire/display name.\nA host with an allow-list passes it so the duplicate-name check runs over the\npublished set only: an unrelated collision among classes it never lists must\nnot fail its catalog or calls (#3490). App MCP always scopes its generators.\n\n## Generated route collection access (#3416)\n\nThere is no generated route-access module. Every generated SvelteKit route\nthat needs collections (CRUD, custom actions, `_changes`, `_events`,\n`sync/apply`, `_dev`) embeds the prelude from\n`generateCollectionAccessImports()` (`sveltekit-config-import.ts`): it imports\nthe generated `smrt-register` module, then the app's config module\n(`$lib/server/smrt` by default) as `* as smrtApplication`, and destructures\n`getCollection`/`getSmrtConfig` from `createGeneratedCollectionAccess()`\n(`src/generated-collection-access.ts`). Generation fails before writing\nanything when `configFileName` resolves to the registration module\n(`smrt-register` with any script extension or case).\nThat helper resolves per call, never caching: a legacy `getCollection` /\n`getSmrtConfig` export wins (deprecated, warned once per module, for one\nrelease), else the exported app-runtime `runtime.getCollection()` /\n`classOptions()`, else it fails with an error naming the module. `_resources`\nand static collection-scoped actions only need registration, so they import\n`smrt-register` and then the config module. When the config module is missing\nand `@happyvertical/smrt-app-runtime/sveltekit` resolves from the consumer, the\ngenerator writes a runtime-shaped default instead of the legacy\n`getCollection` file.\n\n## Enum-constrained fields (#3598)\n\nThe scanner emits `enum: [...]` on a manifest field typed as a TS enum or\nstring/number literal union. Registry-sourced fields mirror it into\n`_meta.enum` (`createFieldFromManifest` / `mergeManifestField`); read it with\n`readFieldEnum()` (top level first, then `_meta`), never directly. Generated\ntool schemas (`fieldTypeToJsonSchema`, so MCP and WebMCP descriptors), OpenAPI\n(`swagger.ts`) and the legacy `generateSchemaProperties` emit JSON Schema\n`enum` for `text`/`integer`/`decimal` fields only; a nullable field appends\n`null` to the list so `type: [.., 'null']` still validates. The client web\ncollection `fields` map does not carry `enum` yet (it feeds the shape digest and\nthree hand-mirrored d.ts files); tool inputs read it from the manifest field.\n\n## Custom-action permission aliases (#3878)\n\n`@smrt({ operationPermissions: { run: { action: 'read' } } })` lets a custom\nmethod reuse an existing CRUD grant in its own collection. Generated SvelteKit\nPOST routes and smrt-users operation guards resolve the same mapping; the\ncatalog emits the target grant rather than a second method-named permission.\nCRUD itself cannot be aliased. Malformed declarations fail closed. Optional\n`databaseActions: ['SELECT', 'UPDATE']` adds explicit PostgreSQL policy bindings\nfor the aliased grant (for example a status-only archive guarded by `create`\nthat must load its item before updating it). This is server-authored authority\nmetadata: grant only the actions the method needs, review it with the method's\nmodel-level validation, and regenerate RLS policies when adopting a changed\nbinding.\n\nCustom actions retain the `{ action, result }` response envelope.\n"
|
|
1190
1192
|
},
|
|
1191
1193
|
{
|
|
1192
1194
|
"path": "agents/build-knowledge.md",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dirname, join, resolve } from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
2
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
4
|
import { createRequire } from "node:module";
|
|
4
|
-
import { pathToFileURL } from "node:url";
|
|
5
5
|
//#region src/utils/import-project-vite.ts
|
|
6
6
|
/** Picks the ESM entry of a package `exports["."]` target (string or conditions). */
|
|
7
7
|
function esmEntry(target) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dirname, join } from "node:path";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
2
|
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
4
|
//#region src/utils/import-workspace-module.ts
|
|
5
5
|
function findWorkspaceRoot(startDir) {
|
|
6
6
|
let current = startDir;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AUTO_GENERATED_ROUTE_HEADER } from "./route-header.js";
|
|
2
2
|
import { generateCollectionAccessImports } from "./sveltekit-config-import.js";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
4
5
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
5
6
|
import { createRequire } from "node:module";
|
|
6
|
-
import { pathToFileURL } from "node:url";
|
|
7
7
|
//#region src/vite-plugin/dev-plane-route.ts
|
|
8
8
|
/**
|
|
9
9
|
* Generated `_dev/[...tool]/+server.ts` route: the in-app runtime dev-plane
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dirname, extname, resolve } from "node:path";
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
2
3
|
import { existsSync } from "node:fs";
|
|
3
4
|
import { createRequire } from "node:module";
|
|
4
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
5
|
//#region src/vite-plugin/import-build-aware.ts
|
|
6
6
|
/**
|
|
7
7
|
* Import a module that exists in both source (`.ts`) and compiled (`.js`)
|
|
@@ -16,8 +16,8 @@ import { injectSvelteKitRegistration } from "./sveltekit-register-injection.js";
|
|
|
16
16
|
import { assertSvelteKitRouteCoordinationComplete, contributeSvelteKitRoutes, expectedSvelteKitRouteOwners, markSvelteKitRouteParticipant } from "./sveltekit-route-coordinator.js";
|
|
17
17
|
import { buildWorkerRegistration } from "./worker-registration.js";
|
|
18
18
|
import { dirname, join, resolve } from "node:path";
|
|
19
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
20
19
|
import { fileURLToPath } from "node:url";
|
|
20
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
21
21
|
//#region src/vite-plugin/index.ts
|
|
22
22
|
/**
|
|
23
23
|
* Vite plugin for automatic SMRT service generation
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AUTO_GENERATED_ROUTE_HEADER } from "./route-header.js";
|
|
2
2
|
import { resolveSvelteKitConfigImport } from "./sveltekit-config-import.js";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
4
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
6
|
import { createRequire } from "node:module";
|
|
6
|
-
import { pathToFileURL } from "node:url";
|
|
7
7
|
//#region src/vite-plugin/resources-route.ts
|
|
8
8
|
/**
|
|
9
9
|
* SvelteKit `_resources` route generation — CLI discovery endpoint (#2663;
|
|
@@ -13,9 +13,9 @@ import { canonicalSvelteKitPath } from "./sveltekit-path.js";
|
|
|
13
13
|
import { collectSyncApplyTargets, generateSyncApplyRoute } from "./sync-apply-route.js";
|
|
14
14
|
import { computeWebManifestHash, isCollectionManifestClass, orderedManifestObjectEntries, resolveCollectionItemObject, resolveCollectionItemTypeName } from "./web-collections.js";
|
|
15
15
|
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
16
|
+
import { pathToFileURL } from "node:url";
|
|
16
17
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
17
18
|
import { createRequire } from "node:module";
|
|
18
|
-
import { pathToFileURL } from "node:url";
|
|
19
19
|
//#region src/vite-plugin/sveltekit-generator.ts
|
|
20
20
|
/**
|
|
21
21
|
* SvelteKit route auto-generation from SMRT objects
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-core",
|
|
3
|
-
"version": "0.56.
|
|
3
|
+
"version": "0.56.1",
|
|
4
4
|
"description": "Core AI agent framework with standardized collections, object-relational mapping, and code generators",
|
|
5
5
|
"author": "HappyVertical",
|
|
6
6
|
"type": "module",
|
|
@@ -71,6 +71,11 @@
|
|
|
71
71
|
"import": "./dist/generators/mcp.js",
|
|
72
72
|
"default": "./dist/generators/mcp.js"
|
|
73
73
|
},
|
|
74
|
+
"./mcp-serializer": {
|
|
75
|
+
"types": "./dist/mcp-serializer.d.ts",
|
|
76
|
+
"import": "./dist/mcp-serializer.js",
|
|
77
|
+
"default": "./dist/mcp-serializer.js"
|
|
78
|
+
},
|
|
74
79
|
"./generators/swagger": {
|
|
75
80
|
"types": "./dist/generators/swagger.d.ts",
|
|
76
81
|
"import": "./dist/generators/swagger.js",
|
|
@@ -185,19 +190,20 @@
|
|
|
185
190
|
"./dist/utils/json.js": "./dist/utils/json.browser.js"
|
|
186
191
|
},
|
|
187
192
|
"dependencies": {
|
|
188
|
-
"@happyvertical/ai": "^0.103.
|
|
189
|
-
"@happyvertical/files": "^0.103.
|
|
190
|
-
"@happyvertical/json": "^0.103.
|
|
191
|
-
"@happyvertical/logger": "^0.103.
|
|
192
|
-
"@happyvertical/smrt-config": "0.56.
|
|
193
|
-
"@happyvertical/smrt-scanner": "0.56.
|
|
194
|
-
"@happyvertical/smrt-types": "0.56.
|
|
195
|
-
"@happyvertical/sql": "^0.103.
|
|
196
|
-
"@happyvertical/utils": "^0.103.
|
|
193
|
+
"@happyvertical/ai": "^0.103.7",
|
|
194
|
+
"@happyvertical/files": "^0.103.7",
|
|
195
|
+
"@happyvertical/json": "^0.103.7",
|
|
196
|
+
"@happyvertical/logger": "^0.103.7",
|
|
197
|
+
"@happyvertical/smrt-config": "0.56.1",
|
|
198
|
+
"@happyvertical/smrt-scanner": "0.56.1",
|
|
199
|
+
"@happyvertical/smrt-types": "0.56.1",
|
|
200
|
+
"@happyvertical/sql": "^0.103.7",
|
|
201
|
+
"@happyvertical/utils": "^0.103.7",
|
|
197
202
|
"@noble/hashes": "^2.4.0",
|
|
198
203
|
"@oxc-project/runtime": "^0.150.0",
|
|
199
204
|
"cheerio": "^1.2.0",
|
|
200
205
|
"fast-glob": "3.3.3",
|
|
206
|
+
"import-meta-resolve": "4.2.0",
|
|
201
207
|
"minimatch": "10.2.6",
|
|
202
208
|
"oxc-transform": "0.150.0",
|
|
203
209
|
"pluralize": "^8.0.0",
|