@happyvertical/smrt-cli 0.55.16 → 0.55.18
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.md +4 -0
- package/agents/app-commands.md +10 -0
- package/agents/kitchen.md +24 -4
- package/dist/{AuditLogCollection-WDHL-_AF-C1ZiQ7V9.js → AuditLogCollection-WDHL-_AF-BR9tsLbQ.js} +1 -1
- package/dist/{OidcIdentity-BUblgQLs-D3Aab-GC.js → OidcIdentity-BUblgQLs-B6envAUE.js} +2 -2
- package/dist/{OidcIdentityCollection-ClOyaHeF-DFU0wHa8.js → OidcIdentityCollection-ClOyaHeF-_-cDfNWK.js} +1 -1
- package/dist/{ProfileAssetCollection-CRMcjLJ--Dn-umPHt.js → ProfileAssetCollection-CRMcjLJ--CKfrlVWt.js} +3 -3
- package/dist/{ProfileCollection-C4INKh7Y-BkYbrF-h.js → ProfileCollection-C4INKh7Y-BP2o4IFS.js} +17 -17
- package/dist/{ProfileLinkCollection-DFfZRsgv-Bofzf-Yw.js → ProfileLinkCollection-DFfZRsgv-BQQEvA6s.js} +2 -2
- package/dist/{ProfileMetadataCollection-BIYKy4Y3-CXjlWaGs.js → ProfileMetadataCollection-BIYKy4Y3-C_sXwe3U.js} +1 -1
- package/dist/{ProfileMetafieldCollection-Buz7gzag-CiGCszRX.js → ProfileMetafieldCollection-Buz7gzag-BoaevkDx.js} +1 -1
- package/dist/{ProfileRelationshipCollection-C4g_QLI4-Bqb15ye8.js → ProfileRelationshipCollection-C4g_QLI4-C5nFGBkL.js} +1 -1
- package/dist/{ProfileTypeCollection-B7kwi1mU-Bvx-bDdd.js → ProfileTypeCollection-B7kwi1mU-CjbBy-PH.js} +2 -2
- package/dist/app/cli.d.ts.map +1 -1
- package/dist/app/operations.d.ts.map +1 -1
- package/dist/app/portability.d.ts +23 -1
- package/dist/app/portability.d.ts.map +1 -1
- package/dist/app.js +2 -2
- package/dist/{cli-OZsH5cdL.js → cli-Cgj-996T.js} +51 -5
- package/dist/commands/kitchen/mcp/bridge.d.ts +3 -0
- package/dist/commands/kitchen/mcp/bridge.d.ts.map +1 -0
- package/dist/commands/kitchen/mcp/preview.d.ts +8 -0
- package/dist/commands/kitchen/mcp/preview.d.ts.map +1 -0
- package/dist/commands/kitchen/mcp/server.d.ts.map +1 -1
- package/dist/commands/kitchen/mcp/tools.d.ts +21 -2
- package/dist/commands/kitchen/mcp/tools.d.ts.map +1 -1
- package/dist/commands/kitchen/mcp/ui.d.ts +40 -0
- package/dist/commands/kitchen/mcp/ui.d.ts.map +1 -0
- package/dist/commands/kitchen.d.ts.map +1 -1
- package/dist/commands/utilities.d.ts.map +1 -1
- package/dist/{commands-BnN3-s2f.js → commands-D4LBfSTU.js} +348 -4
- package/dist/{dist-E6ZsbcFn.js → dist-8MmT9tzq.js} +2 -2
- package/dist/{dist-AM3Ihu2D.js → dist-BxLP3BAE.js} +16 -16
- package/dist/dist-C544Nb6N.js +21 -0
- package/dist/{dist-BAcq9rFh.js → dist-RUIoXDwu.js} +3 -3
- package/dist/{dist-Bp_HahKu.js → dist-iCY-Jwl-.js} +4 -4
- package/dist/index.js +12 -12
- package/dist/{oidcProvisioningPrimitives-DNP9EZlU-D6tRfyyK.js → oidcProvisioningPrimitives-DNP9EZlU-CVdaCYWx.js} +3 -3
- package/dist/{portability-CES1YC2m.js → portability-ClYZy8ut.js} +28 -5
- package/dist/{resolveIdentity-CkyqvctR-CXzDyaMs.js → resolveIdentity-CkyqvctR-CvwoQpQ4.js} +14 -14
- package/dist/{server-Dp096tZj.js → server-C69K3w-t.js} +682 -39
- package/package.json +11 -11
- package/scripts/verify-package-types-exports.js +6 -1
- package/dist/dist-C0OyGC_L.js +0 -21
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Opt-in desktop capability probe. This is not the Planner UI. */
|
|
2
|
+
export declare const KITCHEN_UI_URI = "ui://smrt-kitchen/capability-v1.html";
|
|
3
|
+
export declare const KITCHEN_UI_MIME = "text/html;profile=mcp-app";
|
|
4
|
+
export declare const KITCHEN_UI_RESOURCE: {
|
|
5
|
+
uri: string;
|
|
6
|
+
name: string;
|
|
7
|
+
mimeType: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const KITCHEN_UI_CONTENT: {
|
|
10
|
+
text: string;
|
|
11
|
+
_meta: {
|
|
12
|
+
ui: {
|
|
13
|
+
prefersBorder: boolean;
|
|
14
|
+
csp: {
|
|
15
|
+
connectDomains: never[];
|
|
16
|
+
resourceDomains: never[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
uri: string;
|
|
21
|
+
name: string;
|
|
22
|
+
mimeType: string;
|
|
23
|
+
};
|
|
24
|
+
/** Load only an operator-selected local artifact; tool arguments never choose files. */
|
|
25
|
+
export declare function loadPlannerUi(file: string, resumePlanId?: string): {
|
|
26
|
+
uri: string;
|
|
27
|
+
name: string;
|
|
28
|
+
text: string;
|
|
29
|
+
_meta: {
|
|
30
|
+
ui: {
|
|
31
|
+
prefersBorder: boolean;
|
|
32
|
+
csp: {
|
|
33
|
+
connectDomains: never[];
|
|
34
|
+
resourceDomains: never[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
mimeType: string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../src/commands/kitchen/mcp/ui.ts"],"names":[],"mappings":"AAIA,mEAAmE;AACnE,eAAO,MAAM,cAAc,yCAAyC,CAAC;AACrE,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAE3D,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;CAgB9B,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;;;;;;;;;;;;;;EAmBhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kitchen.d.ts","sourceRoot":"","sources":["../../src/commands/kitchen.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"kitchen.d.ts","sourceRoot":"","sources":["../../src/commands/kitchen.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAyDtD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA4KtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/commands/utilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/commands/utilities.ts"],"names":[],"mappings":"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"}
|
|
@@ -7475,6 +7475,27 @@ var kitchenCommands = {
|
|
|
7475
7475
|
description: "Serve the Kitchen planning tools over stdio MCP for a local agent plugin (ChatGPT, Codex, Claude); no model or credential is used",
|
|
7476
7476
|
args: [],
|
|
7477
7477
|
options: {
|
|
7478
|
+
"ui-smoke": {
|
|
7479
|
+
type: "boolean",
|
|
7480
|
+
description: "Expose a static MCP Apps resource to check local desktop rendering",
|
|
7481
|
+
default: false
|
|
7482
|
+
},
|
|
7483
|
+
"planner-ui": {
|
|
7484
|
+
type: "string",
|
|
7485
|
+
description: "Path to self-contained smrt-planner app/mcp.html for local MCP Apps rendering"
|
|
7486
|
+
},
|
|
7487
|
+
"plans-dir": {
|
|
7488
|
+
type: "string",
|
|
7489
|
+
description: "Private local directory holding restart-safe Kitchen plans"
|
|
7490
|
+
},
|
|
7491
|
+
"preview-port": {
|
|
7492
|
+
type: "string",
|
|
7493
|
+
description: "Loopback HTTP port for a live browser preview (0 chooses a free port)"
|
|
7494
|
+
},
|
|
7495
|
+
"preview-origin": {
|
|
7496
|
+
type: "string",
|
|
7497
|
+
description: "Exact 127.0.0.1 browser origin allowed to call the preview bridge"
|
|
7498
|
+
},
|
|
7478
7499
|
template: {
|
|
7479
7500
|
type: "string",
|
|
7480
7501
|
description: "Default project template for apply_plan (default github:happyvertical/smrt-start)"
|
|
@@ -7501,8 +7522,13 @@ var kitchenCommands = {
|
|
|
7501
7522
|
}
|
|
7502
7523
|
},
|
|
7503
7524
|
handler: async (_args, options) => {
|
|
7504
|
-
const { runKitchenMcp } = await import("./server-
|
|
7525
|
+
const { runKitchenMcp } = await import("./server-C69K3w-t.js");
|
|
7505
7526
|
await runKitchenMcp({
|
|
7527
|
+
uiSmoke: options["ui-smoke"],
|
|
7528
|
+
plannerUi: options["planner-ui"],
|
|
7529
|
+
plansDir: options["plans-dir"],
|
|
7530
|
+
previewPort: options["preview-port"] === void 0 ? void 0 : Number(options["preview-port"]),
|
|
7531
|
+
previewOrigin: options["preview-origin"],
|
|
7506
7532
|
dir: process.cwd(),
|
|
7507
7533
|
template: options.template,
|
|
7508
7534
|
manifests: asList(options.manifests),
|
|
@@ -7737,6 +7763,304 @@ var playgroundCommands = {
|
|
|
7737
7763
|
}
|
|
7738
7764
|
};
|
|
7739
7765
|
//#endregion
|
|
7766
|
+
//#region src/commands/cascade-layers-reset-scan.mjs
|
|
7767
|
+
/**
|
|
7768
|
+
* Unlayered universal-reset scanner for `smrt doctor` (#3862).
|
|
7769
|
+
*
|
|
7770
|
+
* Unlayered CSS beats every `@layer` regardless of specificity. A host's
|
|
7771
|
+
* unlayered `*, *::before, *::after { margin: 0; padding: 0 }` (or Tailwind
|
|
7772
|
+
* preflight / normalize.css / sanitize.css imported without a layer) therefore
|
|
7773
|
+
* strips padding from every smrt component, whose rules sit in `smrt.theme`.
|
|
7774
|
+
*
|
|
7775
|
+
* Dependency-free ESM so the monorepo lint gate
|
|
7776
|
+
* (`scripts/check-smrt-cascade-layers.mjs`) can run the same code under plain
|
|
7777
|
+
* `node`. Parsing is deliberately small: comments and string literals are
|
|
7778
|
+
* skipped, `@layer` blocks are tracked by brace depth, and only style rules
|
|
7779
|
+
* and `@import` statements outside any layer are reported.
|
|
7780
|
+
*/
|
|
7781
|
+
var SMRT_PACKAGES = ["@happyvertical/smrt-ui", "@happyvertical/smrt-svelte"];
|
|
7782
|
+
var RESET_RECIPE = "wrap the reset in @layer smrt.reset { … }, or import it with @import url(...) layer(smrt.reset); see packages/smrt-ui/agents/styling.md#cascade-layers";
|
|
7783
|
+
var UNIVERSAL_SELECTOR = /^(\*(::(before|after|backdrop|marker|placeholder))?|html|body)$/;
|
|
7784
|
+
var RESET_DECLARATION = /^(margin|padding)(?:-[a-z-]+)?\s*:\s*0(?:px|rem|em|%)?(?=[\s!;]|$)/i;
|
|
7785
|
+
var RESET_IMPORT_NAME = /normalize|sanitize|reset|preflight/i;
|
|
7786
|
+
/**
|
|
7787
|
+
* Replace comments with spaces (newlines kept so line numbers stay true),
|
|
7788
|
+
* leaving string literals such as `content: "/* x *\/"` untouched.
|
|
7789
|
+
*
|
|
7790
|
+
* @param {string} css
|
|
7791
|
+
* @returns {string}
|
|
7792
|
+
*/
|
|
7793
|
+
function stripCssComments(css) {
|
|
7794
|
+
let out = "";
|
|
7795
|
+
let quote = null;
|
|
7796
|
+
for (let i = 0; i < css.length; i += 1) {
|
|
7797
|
+
const c = css[i];
|
|
7798
|
+
if (quote) {
|
|
7799
|
+
out += c;
|
|
7800
|
+
if (c === "\\" && i + 1 < css.length) {
|
|
7801
|
+
out += css[i + 1];
|
|
7802
|
+
i += 1;
|
|
7803
|
+
} else if (c === quote) quote = null;
|
|
7804
|
+
continue;
|
|
7805
|
+
}
|
|
7806
|
+
if (c === "\"" || c === "'") {
|
|
7807
|
+
quote = c;
|
|
7808
|
+
out += c;
|
|
7809
|
+
continue;
|
|
7810
|
+
}
|
|
7811
|
+
if (c === "/" && css[i + 1] === "*") {
|
|
7812
|
+
const end = css.indexOf("*/", i + 2);
|
|
7813
|
+
const stop = end === -1 ? css.length : end + 2;
|
|
7814
|
+
out += css.slice(i, stop).replace(/[^\n]/g, " ");
|
|
7815
|
+
i = stop - 1;
|
|
7816
|
+
continue;
|
|
7817
|
+
}
|
|
7818
|
+
out += c;
|
|
7819
|
+
}
|
|
7820
|
+
return out;
|
|
7821
|
+
}
|
|
7822
|
+
/**
|
|
7823
|
+
* 1-based line lookup for `source`: newline offsets are indexed once, then each
|
|
7824
|
+
* lookup is a binary search, so large minified stylesheets stay linear-ish.
|
|
7825
|
+
*
|
|
7826
|
+
* @param {string} source
|
|
7827
|
+
* @returns {(index: number) => number}
|
|
7828
|
+
*/
|
|
7829
|
+
function lineIndex(source) {
|
|
7830
|
+
const starts = [0];
|
|
7831
|
+
for (let i = 0; i < source.length; i += 1) if (source[i] === "\n") starts.push(i + 1);
|
|
7832
|
+
return (index) => {
|
|
7833
|
+
let lo = 0;
|
|
7834
|
+
let hi = starts.length - 1;
|
|
7835
|
+
while (lo < hi) {
|
|
7836
|
+
const mid = lo + hi + 1 >> 1;
|
|
7837
|
+
if (starts[mid] <= index) lo = mid;
|
|
7838
|
+
else hi = mid - 1;
|
|
7839
|
+
}
|
|
7840
|
+
return lo + 1;
|
|
7841
|
+
};
|
|
7842
|
+
}
|
|
7843
|
+
/**
|
|
7844
|
+
* Svelte scoping: `:global(X)` is the unscoped selector X, and `:global { … }`
|
|
7845
|
+
* is a block of unscoped rules. Both are rewritten so the global form is
|
|
7846
|
+
* matched. Newlines are kept, so line numbers do not move.
|
|
7847
|
+
*
|
|
7848
|
+
* @param {string} body
|
|
7849
|
+
* @returns {string}
|
|
7850
|
+
*/
|
|
7851
|
+
function unwrapSvelteGlobal(body) {
|
|
7852
|
+
const token = ":global(";
|
|
7853
|
+
let out = "";
|
|
7854
|
+
let cursor = 0;
|
|
7855
|
+
for (;;) {
|
|
7856
|
+
const start = body.indexOf(token, cursor);
|
|
7857
|
+
if (start === -1) break;
|
|
7858
|
+
out += body.slice(cursor, start);
|
|
7859
|
+
let depth = 1;
|
|
7860
|
+
let end = start + 8;
|
|
7861
|
+
while (end < body.length && depth > 0) {
|
|
7862
|
+
if (body[end] === "(") depth += 1;
|
|
7863
|
+
else if (body[end] === ")") depth -= 1;
|
|
7864
|
+
end += 1;
|
|
7865
|
+
}
|
|
7866
|
+
if (depth > 0) {
|
|
7867
|
+
out += body.slice(start);
|
|
7868
|
+
return out.replace(/:global\s*\{/g, "@global {");
|
|
7869
|
+
}
|
|
7870
|
+
out += body.slice(start + 8, end - 1);
|
|
7871
|
+
cursor = end;
|
|
7872
|
+
}
|
|
7873
|
+
out += body.slice(cursor);
|
|
7874
|
+
return out.replace(/:global\s*\{/g, "@global {");
|
|
7875
|
+
}
|
|
7876
|
+
/**
|
|
7877
|
+
* Find unlayered universal resets and unlayered reset `@import`s in a
|
|
7878
|
+
* stylesheet. Rules inside any `@layer` block (including `@layer smrt.*` and
|
|
7879
|
+
* Tailwind's `@layer base`) are never reported.
|
|
7880
|
+
*
|
|
7881
|
+
* @param {string} css
|
|
7882
|
+
* @returns {Array<{ line: number, kind: 'rule' | 'import', selector: string, detail: string }>}
|
|
7883
|
+
*/
|
|
7884
|
+
function findUnlayeredResets(css) {
|
|
7885
|
+
const src = stripCssComments(css);
|
|
7886
|
+
const lineOf = lineIndex(src);
|
|
7887
|
+
const findings = [];
|
|
7888
|
+
/** @type {Array<{ kind: 'layer' | 'rule' | 'group', head: string, headLine: number, decls: string[] }>} */
|
|
7889
|
+
const stack = [];
|
|
7890
|
+
let prelude = "";
|
|
7891
|
+
let preludeStart = -1;
|
|
7892
|
+
let quote = null;
|
|
7893
|
+
const flushDecl = () => {
|
|
7894
|
+
const text = prelude.trim();
|
|
7895
|
+
const frame = stack[stack.length - 1];
|
|
7896
|
+
if (text && frame && frame.kind === "rule") frame.decls.push(text);
|
|
7897
|
+
prelude = "";
|
|
7898
|
+
preludeStart = -1;
|
|
7899
|
+
};
|
|
7900
|
+
for (let i = 0; i < src.length; i += 1) {
|
|
7901
|
+
const c = src[i];
|
|
7902
|
+
if (quote) {
|
|
7903
|
+
prelude += c;
|
|
7904
|
+
if (c === "\\" && i + 1 < src.length) {
|
|
7905
|
+
prelude += src[i + 1];
|
|
7906
|
+
i += 1;
|
|
7907
|
+
} else if (c === quote) quote = null;
|
|
7908
|
+
continue;
|
|
7909
|
+
}
|
|
7910
|
+
if (c === "\"" || c === "'") {
|
|
7911
|
+
quote = c;
|
|
7912
|
+
if (preludeStart === -1) preludeStart = i;
|
|
7913
|
+
prelude += c;
|
|
7914
|
+
continue;
|
|
7915
|
+
}
|
|
7916
|
+
if (c === "{") {
|
|
7917
|
+
const head = prelude.trim();
|
|
7918
|
+
const headIndex = preludeStart === -1 ? i : preludeStart;
|
|
7919
|
+
let kind = "rule";
|
|
7920
|
+
if (/^@layer\b/i.test(head)) kind = "layer";
|
|
7921
|
+
else if (head.startsWith("@")) kind = "group";
|
|
7922
|
+
stack.push({
|
|
7923
|
+
kind,
|
|
7924
|
+
head,
|
|
7925
|
+
headLine: lineOf(headIndex),
|
|
7926
|
+
decls: []
|
|
7927
|
+
});
|
|
7928
|
+
prelude = "";
|
|
7929
|
+
preludeStart = -1;
|
|
7930
|
+
continue;
|
|
7931
|
+
}
|
|
7932
|
+
if (c === "}") {
|
|
7933
|
+
flushDecl();
|
|
7934
|
+
const frame = stack.pop();
|
|
7935
|
+
if (frame && frame.kind === "rule" && !stack.some((f) => f.kind === "layer")) {
|
|
7936
|
+
const universal = frame.head.split(",").map((selector) => selector.trim()).filter((selector) => UNIVERSAL_SELECTOR.test(selector));
|
|
7937
|
+
const resetDecls = frame.decls.filter((decl) => RESET_DECLARATION.test(decl));
|
|
7938
|
+
if (universal.length > 0 && resetDecls.length > 0) findings.push({
|
|
7939
|
+
line: frame.headLine,
|
|
7940
|
+
kind: "rule",
|
|
7941
|
+
selector: frame.head,
|
|
7942
|
+
detail: resetDecls.join("; ")
|
|
7943
|
+
});
|
|
7944
|
+
}
|
|
7945
|
+
continue;
|
|
7946
|
+
}
|
|
7947
|
+
if (c === ";") {
|
|
7948
|
+
const head = prelude.trim();
|
|
7949
|
+
if (stack.length === 0 && /^@import\b/i.test(head)) {
|
|
7950
|
+
const url = head.match(/@import\s+(?:url\(\s*)?["']?([^"')\s;]+)/i);
|
|
7951
|
+
const rest = head.replace(/url\([^)]*\)|"[^"]*"|'[^']*'/gi, " ");
|
|
7952
|
+
if (!/\blayer\b/i.test(rest) && url && RESET_IMPORT_NAME.test(url[1])) findings.push({
|
|
7953
|
+
line: lineOf(preludeStart === -1 ? i : preludeStart),
|
|
7954
|
+
kind: "import",
|
|
7955
|
+
selector: head,
|
|
7956
|
+
detail: `unlayered import of ${url[1]}`
|
|
7957
|
+
});
|
|
7958
|
+
}
|
|
7959
|
+
flushDecl();
|
|
7960
|
+
continue;
|
|
7961
|
+
}
|
|
7962
|
+
if (preludeStart === -1 && !/\s/.test(c)) preludeStart = i;
|
|
7963
|
+
prelude += c;
|
|
7964
|
+
}
|
|
7965
|
+
return findings;
|
|
7966
|
+
}
|
|
7967
|
+
/**
|
|
7968
|
+
* Svelte `<style>` bodies, with findings mapped to the `.svelte` file's lines.
|
|
7969
|
+
*
|
|
7970
|
+
* @param {string} source
|
|
7971
|
+
* @returns {Array<{ line: number, kind: 'rule' | 'import', selector: string, detail: string }>}
|
|
7972
|
+
*/
|
|
7973
|
+
function findUnlayeredResetsInSvelte(source) {
|
|
7974
|
+
const findings = [];
|
|
7975
|
+
const lineOf = lineIndex(source);
|
|
7976
|
+
const pattern = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
|
|
7977
|
+
let match;
|
|
7978
|
+
while ((match = pattern.exec(source)) !== null) {
|
|
7979
|
+
const bodyStart = match.index + match[0].indexOf(">") + 1;
|
|
7980
|
+
for (const finding of findUnlayeredResets(unwrapSvelteGlobal(match[1]))) findings.push({
|
|
7981
|
+
...finding,
|
|
7982
|
+
line: lineOf(bodyStart) + finding.line - 1
|
|
7983
|
+
});
|
|
7984
|
+
}
|
|
7985
|
+
return findings;
|
|
7986
|
+
}
|
|
7987
|
+
var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
7988
|
+
"node_modules",
|
|
7989
|
+
"dist",
|
|
7990
|
+
".svelte-kit",
|
|
7991
|
+
".git",
|
|
7992
|
+
"build",
|
|
7993
|
+
".turbo"
|
|
7994
|
+
]);
|
|
7995
|
+
/**
|
|
7996
|
+
* Project CSS sources: `src/**` `*.css` and `*.svelte`, plus a root `app.css`.
|
|
7997
|
+
*
|
|
7998
|
+
* @param {string} root
|
|
7999
|
+
* @returns {string[]} absolute paths
|
|
8000
|
+
*/
|
|
8001
|
+
function listCascadeSources(root) {
|
|
8002
|
+
const files = [];
|
|
8003
|
+
const walk = (dir) => {
|
|
8004
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) if (entry.isDirectory()) {
|
|
8005
|
+
if (!SKIP_DIRS.has(entry.name)) walk(join(dir, entry.name));
|
|
8006
|
+
} else if (entry.isFile() && /\.(css|svelte)$/.test(entry.name)) files.push(join(dir, entry.name));
|
|
8007
|
+
};
|
|
8008
|
+
const src = join(root, "src");
|
|
8009
|
+
if (existsSync(src) && statSync(src).isDirectory()) walk(src);
|
|
8010
|
+
const rootCss = join(root, "app.css");
|
|
8011
|
+
if (existsSync(rootCss) && !files.includes(rootCss)) files.push(rootCss);
|
|
8012
|
+
return files;
|
|
8013
|
+
}
|
|
8014
|
+
/**
|
|
8015
|
+
* Whether a project's package.json depends on smrt-ui or smrt-svelte.
|
|
8016
|
+
*
|
|
8017
|
+
* @param {Record<string, any> | null | undefined} packageJson
|
|
8018
|
+
* @returns {boolean}
|
|
8019
|
+
*/
|
|
8020
|
+
function dependsOnSmrtUi(packageJson) {
|
|
8021
|
+
return [
|
|
8022
|
+
"dependencies",
|
|
8023
|
+
"devDependencies",
|
|
8024
|
+
"peerDependencies"
|
|
8025
|
+
].some((section) => SMRT_PACKAGES.some((name) => Boolean(packageJson?.[section]?.[name])));
|
|
8026
|
+
}
|
|
8027
|
+
/**
|
|
8028
|
+
* Scan a project root for unlayered universal resets.
|
|
8029
|
+
*
|
|
8030
|
+
* @param {string} root project directory
|
|
8031
|
+
* @param {{ packageJson?: Record<string, any> | null, requireSmrtDependency?: boolean }} [options]
|
|
8032
|
+
* `requireSmrtDependency` (default true) skips projects that do not depend on
|
|
8033
|
+
* smrt-ui/smrt-svelte. Monorepo passes set it to false.
|
|
8034
|
+
* @returns {{
|
|
8035
|
+
* applies: boolean,
|
|
8036
|
+
* filesScanned: number,
|
|
8037
|
+
* findings: Array<{ file: string, line: number, kind: 'rule' | 'import', selector: string, detail: string }>,
|
|
8038
|
+
* }}
|
|
8039
|
+
*/
|
|
8040
|
+
function scanProjectForUnlayeredResets(root, options = {}) {
|
|
8041
|
+
const applies = !(options.requireSmrtDependency !== false) || dependsOnSmrtUi(options.packageJson);
|
|
8042
|
+
if (!applies) return {
|
|
8043
|
+
applies,
|
|
8044
|
+
filesScanned: 0,
|
|
8045
|
+
findings: []
|
|
8046
|
+
};
|
|
8047
|
+
const files = listCascadeSources(root);
|
|
8048
|
+
const findings = [];
|
|
8049
|
+
for (const file of files) {
|
|
8050
|
+
const text = readFileSync(file, "utf8");
|
|
8051
|
+
const found = file.endsWith(".svelte") ? findUnlayeredResetsInSvelte(text) : findUnlayeredResets(text);
|
|
8052
|
+
for (const finding of found) findings.push({
|
|
8053
|
+
file: relative(root, file),
|
|
8054
|
+
...finding
|
|
8055
|
+
});
|
|
8056
|
+
}
|
|
8057
|
+
return {
|
|
8058
|
+
applies,
|
|
8059
|
+
filesScanned: files.length,
|
|
8060
|
+
findings
|
|
8061
|
+
};
|
|
8062
|
+
}
|
|
8063
|
+
//#endregion
|
|
7740
8064
|
//#region src/commands/db-drop-framework-base-tables.ts
|
|
7741
8065
|
/**
|
|
7742
8066
|
* db:drop-framework-base-tables Command
|
|
@@ -7888,7 +8212,7 @@ var dbMaterializeTenantHierarchyCommand = {
|
|
|
7888
8212
|
if (!config.database?.url || config.database.url === ":memory:") throw new Error("Database configuration required for db:materialize-tenant-hierarchy. Configure database.url in smrt.config.ts (or DATABASE_URL).");
|
|
7889
8213
|
const dbType = config.database.type || "sqlite";
|
|
7890
8214
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
7891
|
-
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-
|
|
8215
|
+
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-BxLP3BAE.js");
|
|
7892
8216
|
db = await getDatabase({
|
|
7893
8217
|
type: dbType,
|
|
7894
8218
|
url: config.database.url
|
|
@@ -8097,7 +8421,7 @@ var dbMigrateLedgerAccountsCommand = {
|
|
|
8097
8421
|
if (dbType !== "postgres") throw new Error("db:migrate-ledger-accounts currently supports PostgreSQL only; no changes were made. See the smrt-ledgers README for SQLite.");
|
|
8098
8422
|
await autoDiscoverAndLoad();
|
|
8099
8423
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
8100
|
-
const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-
|
|
8424
|
+
const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-iCY-Jwl-.js");
|
|
8101
8425
|
db = await getDatabase({
|
|
8102
8426
|
type: dbType,
|
|
8103
8427
|
url: config.database.url
|
|
@@ -10497,7 +10821,7 @@ var utilityCommands = {
|
|
|
10497
10821
|
description: "Application operations: install, setup, recover, start, stop, doctor, open, backup, export, import, migrate, worker, dev, build (`smrt app help`)",
|
|
10498
10822
|
args: ["[operation]", "[args...]"],
|
|
10499
10823
|
handler: async (args) => {
|
|
10500
|
-
const { runAppCommand } = await import("./cli-
|
|
10824
|
+
const { runAppCommand } = await import("./cli-Cgj-996T.js").then((n) => n.r);
|
|
10501
10825
|
const code = await runAppCommand(args);
|
|
10502
10826
|
if (code !== 0) process.exitCode = code;
|
|
10503
10827
|
}
|
|
@@ -11988,6 +12312,26 @@ export default testManifest;
|
|
|
11988
12312
|
else if (existsSync(envExamplePath)) check(".env file exists", false, void 0, ".env.example exists - copy it to .env");
|
|
11989
12313
|
else check(".env file exists", false, void 0, "No .env file - environment variables may be needed");
|
|
11990
12314
|
console.log();
|
|
12315
|
+
let cascadeLayers = {
|
|
12316
|
+
applies: false,
|
|
12317
|
+
filesScanned: 0,
|
|
12318
|
+
findings: []
|
|
12319
|
+
};
|
|
12320
|
+
try {
|
|
12321
|
+
cascadeLayers = scanProjectForUnlayeredResets(cwd, { packageJson });
|
|
12322
|
+
} catch (error) {
|
|
12323
|
+
warnings.push(`cascade-layer scan skipped: ${error instanceof Error ? error.message : String(error)}`);
|
|
12324
|
+
}
|
|
12325
|
+
if (cascadeLayers.applies) {
|
|
12326
|
+
console.log("🎨 Cascade Layers\n");
|
|
12327
|
+
if (cascadeLayers.findings.length === 0) passed.push("No unlayered universal resets");
|
|
12328
|
+
else for (const finding of cascadeLayers.findings) {
|
|
12329
|
+
const message = `unlayered reset at ${finding.file}:${finding.line} (${finding.selector}): ${RESET_RECIPE}`;
|
|
12330
|
+
warnings.push(message);
|
|
12331
|
+
console.log(` ⚠️ ${message}`);
|
|
12332
|
+
}
|
|
12333
|
+
console.log();
|
|
12334
|
+
}
|
|
11991
12335
|
if (options.db) {
|
|
11992
12336
|
console.log("🗄️ Live Database Parity\n");
|
|
11993
12337
|
const { report, error, database } = await runLiveSchemaParity({ discover: false });
|
|
@@ -266,7 +266,7 @@ async function queryWithGlobals(collection, tenantId, label) {
|
|
|
266
266
|
createLogger({ level: "info" });
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region ../tenancy/dist/index.js
|
|
269
|
-
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-tenancy","packageVersion":"0.55.
|
|
269
|
+
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-tenancy","packageVersion":"0.55.18","objects":{"@happyvertical/smrt-tenancy:BillingRelationship":{"name":"billingrelationship","className":"BillingRelationship","qualifiedName":"@happyvertical/smrt-tenancy:BillingRelationship","collection":"billingrelationships","filePath":"/home/runner/work/smrt/smrt/packages/tenancy/src/billing-relationship.ts","packageName":"@happyvertical/smrt-tenancy","fields":{"childTenantId":{"type":"crossPackageRef","required":true,"related":"@happyvertical/smrt-users:Tenant","_meta":{"required":true}},"resellerTenantId":{"type":"crossPackageRef","required":true,"related":"@happyvertical/smrt-users:Tenant","_meta":{"required":true}},"billingOwnerMode":{"type":"text","required":false,"default":"self","enum":["self","reseller"]}},"methods":{},"decoratorConfig":{"tableName":"_smrt_billing_relationships","conflictColumns":["child_tenant_id"],"api":false,"cli":false,"mcp":false},"extends":"SmrtObject","exportName":"BillingRelationship","collectionExportName":"BillingRelationshipCollection","validationRules":[{"field":"childTenantId","rule":"required","fieldType":"crossPackageRef"},{"field":"resellerTenantId","rule":"required","fieldType":"crossPackageRef"}],"schema":{"tableName":"_smrt_billing_relationships","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_billing_relationships\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"child_tenant_id\\" UUID NOT NULL,\\n \\"reseller_tenant_id\\" UUID NOT NULL,\\n \\"billing_owner_mode\\" TEXT DEFAULT 'self'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"child_tenant_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"reseller_tenant_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"billing_owner_mode":{"type":"TEXT","notNull":false,"unique":false,"default":"self"}},"indexes":[{"name":"_smrt_billing_relationships_child_tenant_id_idx","columns":["child_tenant_id"],"unique":true},{"name":"_smrt_billing_relationships_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_billing_relationships_created_at_idx","columns":["created_at"]},{"name":"_smrt_billing_relationships_reseller_tenant_id_idx","columns":["reseller_tenant_id"]}],"version":"4d7f410a"},"importPath":"@happyvertical/smrt-tenancy"},"@happyvertical/smrt-tenancy:BillingRelationshipCollection":{"name":"billingrelationshipcollection","className":"BillingRelationshipCollection","qualifiedName":"@happyvertical/smrt-tenancy:BillingRelationshipCollection","collection":"billingrelationships","filePath":"/home/runner/work/smrt/smrt/packages/tenancy/src/billing-relationship.ts","packageName":"@happyvertical/smrt-tenancy","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_billing_relationships","api":false,"mcp":false,"cli":false},"extends":"SmrtCollection","extendsTypeArg":"BillingRelationship","exportName":"BillingRelationshipCollection","collectionExportName":"BillingRelationshipCollectionCollection","schema":{"tableName":"_smrt_billing_relationships","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_billing_relationships\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"child_tenant_id\\" UUID NOT NULL,\\n \\"reseller_tenant_id\\" UUID NOT NULL,\\n \\"billing_owner_mode\\" TEXT DEFAULT 'self'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"child_tenant_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"reseller_tenant_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"billing_owner_mode":{"type":"TEXT","notNull":false,"unique":false,"default":"self"}},"indexes":[{"name":"_smrt_billing_relationships_child_tenant_id_idx","columns":["child_tenant_id"],"unique":true},{"name":"_smrt_billing_relationships_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_billing_relationships_created_at_idx","columns":["created_at"]},{"name":"_smrt_billing_relationships_reseller_tenant_id_idx","columns":["reseller_tenant_id"]}],"version":"4d7f410a"},"importPath":"@happyvertical/smrt-tenancy"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-core"],"browser":{"status":"server-only","issues":["#3624"],"reason":"node:async_hooks"},"stampsConstructors":true}`));
|
|
270
270
|
var __defProp$2 = Object.defineProperty;
|
|
271
271
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
272
272
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
|
|
@@ -381,7 +381,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
381
381
|
if (!no_symbols) __defProp$1(target, Symbol.toStringTag, { value: "Module" });
|
|
382
382
|
return target;
|
|
383
383
|
};
|
|
384
|
-
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-prompts","packageVersion":"0.55.
|
|
384
|
+
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-prompts","packageVersion":"0.55.18","objects":{"@happyvertical/smrt-prompts:PromptOverrideCollection":{"name":"promptoverridecollection","className":"PromptOverrideCollection","qualifiedName":"@happyvertical/smrt-prompts:PromptOverrideCollection","collection":"promptoverrides","filePath":"/home/runner/work/smrt/smrt/packages/prompts/src/collections/PromptOverrideCollection.ts","packageName":"@happyvertical/smrt-prompts","fields":{},"methods":{"getAppOverride":{"name":"getAppOverride","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"options","type":"object","optional":true,"memberTypes":["string"]}],"returnType":"Promise<PromptOverride | null>","isStatic":false,"isPublic":true},"getTenantOverride":{"name":"getTenantOverride","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"tenantId","type":"string","optional":false},{"name":"options","type":"object","optional":true,"memberTypes":["string"]}],"returnType":"Promise<PromptOverride | null>","isStatic":false,"isPublic":true},"getResolutionLayers":{"name":"getResolutionLayers","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"tenantId","type":"string | null","optional":true,"unionBranches":[{"type":"string"},{"type":"null"}]},{"name":"options","type":"object","optional":true,"memberTypes":["string"]}],"returnType":"Promise<object>","isStatic":false,"isPublic":true},"getOverrideMapForKeys":{"name":"getOverrideMapForKeys","async":true,"parameters":[{"name":"keys","type":"string[]","optional":false},{"name":"scopeType","type":"PromptOverrideScopeType","optional":false},{"name":"scopeId","type":"string","optional":false}],"returnType":"Promise<Map<string, PromptOverride>>","isStatic":false,"isPublic":true},"findByScope":{"name":"findByScope","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"scopeType","type":"PromptOverrideScopeType","optional":false},{"name":"scopeId","type":"string","optional":false}],"returnType":"Promise<PromptOverride | null>","isStatic":false,"isPublic":true},"setTemplateOverride":{"name":"setTemplateOverride","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"scopeType","type":"PromptOverrideScopeType","optional":false},{"name":"scopeId","type":"string","optional":false},{"name":"template","type":"string | null","optional":false,"unionBranches":[{"type":"string"},{"type":"null"}]}],"returnType":"Promise<PromptOverride>","isStatic":false,"isPublic":true},"removeOverride":{"name":"removeOverride","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"scopeType","type":"PromptOverrideScopeType","optional":false},{"name":"scopeId","type":"string","optional":false}],"returnType":"Promise<boolean>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_prompt_overrides","api":false,"mcp":false,"cli":false},"extends":"SmrtCollection","extendsTypeArg":"PromptOverride","exportName":"PromptOverrideCollection","collectionExportName":"PromptOverrideCollectionCollection","schema":{"tableName":"_smrt_prompt_overrides","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_prompt_overrides\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"key\\" TEXT NOT NULL DEFAULT '',\\n \\"tenant_id\\" UUID,\\n \\"template\\" TEXT,\\n \\"profile\\" TEXT,\\n \\"model\\" TEXT,\\n \\"params\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"key":{"type":"TEXT","notNull":true,"unique":false,"default":""},"tenant_id":{"type":"UUID","notNull":false,"unique":false},"template":{"type":"TEXT","notNull":false,"unique":false},"profile":{"type":"TEXT","notNull":false,"unique":false},"model":{"type":"TEXT","notNull":false,"unique":false},"params":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_prompt_overrides_key_context_idx","columns":["key","context"],"unique":true},{"name":"_smrt_prompt_overrides_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_prompt_overrides_created_at_idx","columns":["created_at"]}],"version":"38f505e7"},"importPath":"@happyvertical/smrt-prompts"},"@happyvertical/smrt-prompts:PromptOverride":{"name":"promptoverride","className":"PromptOverride","qualifiedName":"@happyvertical/smrt-prompts:PromptOverride","collection":"promptoverrides","filePath":"/home/runner/work/smrt/smrt/packages/prompts/src/models/PromptOverride.ts","packageName":"@happyvertical/smrt-prompts","fields":{"key":{"type":"text","required":true,"default":"","_meta":{"required":true}},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true}},"template":{"type":"text","required":false,"_meta":{"nullable":true}},"profile":{"type":"text","required":false,"_meta":{"nullable":true}},"model":{"type":"text","required":false,"_meta":{"nullable":true}},"params":{"type":"text","required":false,"_meta":{"nullable":true}}},"methods":{"getParams":{"name":"getParams","async":false,"parameters":[],"returnType":"PromptParams","isStatic":false,"isPublic":true},"setParams":{"name":"setParams","async":false,"parameters":[{"name":"params","type":"PromptParams | null","optional":false,"unionBranches":[{"type":"PromptParams"},{"type":"null"}]}],"returnType":"void","isStatic":false,"isPublic":true},"toPromptLayer":{"name":"toPromptLayer","async":false,"parameters":[],"returnType":"PromptLayer","isStatic":false,"isPublic":true},"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_prompt_overrides","conflictColumns":["key","context"],"api":false,"cli":false,"mcp":false},"extends":"SmrtObject","exportName":"PromptOverride","collectionExportName":"PromptOverrideCollection","validationRules":[{"field":"key","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_prompt_overrides","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_prompt_overrides\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"key\\" TEXT NOT NULL DEFAULT '',\\n \\"tenant_id\\" UUID,\\n \\"template\\" TEXT,\\n \\"profile\\" TEXT,\\n \\"model\\" TEXT,\\n \\"params\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"key":{"type":"TEXT","notNull":true,"unique":false,"default":""},"tenant_id":{"type":"UUID","notNull":false,"unique":false},"template":{"type":"TEXT","notNull":false,"unique":false},"profile":{"type":"TEXT","notNull":false,"unique":false},"model":{"type":"TEXT","notNull":false,"unique":false},"params":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_prompt_overrides_key_context_idx","columns":["key","context"],"unique":true},{"name":"_smrt_prompt_overrides_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_prompt_overrides_created_at_idx","columns":["created_at"]}],"version":"38f505e7"},"importPath":"@happyvertical/smrt-prompts"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3624"],"via":["@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
385
385
|
var PROMPT_CACHE_TTL_MS = 3e4;
|
|
386
386
|
var promptCache = /* @__PURE__ */ new Map();
|
|
387
387
|
var cacheGenerations = /* @__PURE__ */ new Map();
|