@runtypelabs/cli 2.16.17 → 2.16.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +604 -359
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -615,292 +615,6 @@ function loadBrandConfig(env) {
615
615
  var BRAND = loadBrandConfig();
616
616
  var DEFAULT_BRAND_CONFIG = BRAND_CONFIGS[DEFAULT_BRAND_NAME];
617
617
 
618
- // ../shared/dist/chunk-3BMGMHHD.mjs
619
- function getNestedValue(obj, path16) {
620
- let normalizedPath = path16;
621
- normalizedPath = normalizedPath.replace(/^\$\.?/, "");
622
- normalizedPath = normalizedPath.replace(/\[(\d+)\]/g, ".$1");
623
- normalizedPath = normalizedPath.replace(/\[['"]([^'"\]]+)['"]\]/g, ".$1");
624
- normalizedPath = normalizedPath.replace(/\[([^'"\]]+)\]/g, ".$1");
625
- normalizedPath = normalizedPath.replace(/^\./, "");
626
- const keys = normalizedPath.split(".");
627
- let current = obj;
628
- for (let i = 0; i < keys.length; i++) {
629
- const key = keys[i];
630
- if (current === null || current === void 0 || key === void 0) {
631
- return void 0;
632
- }
633
- if (Array.isArray(current)) {
634
- if (/^\d+$/.test(key)) {
635
- const index = parseInt(key, 10);
636
- if (index >= 0 && index < current.length) {
637
- current = current[index];
638
- } else {
639
- return void 0;
640
- }
641
- } else {
642
- return void 0;
643
- }
644
- } else if (current && typeof current === "object") {
645
- if (DANGEROUS_KEYS.has(key)) return void 0;
646
- current = current[key];
647
- } else {
648
- return void 0;
649
- }
650
- }
651
- return current;
652
- }
653
- var DANGEROUS_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
654
- var TEMPLATE_EXPRESSION_PATTERN = /\{\{([^{}]+)\}\}/g;
655
- function parseTemplateExpression(expr) {
656
- const tokens = tokenizeFallbackExpression(expr);
657
- if (tokens) {
658
- return {
659
- kind: "fallback",
660
- operator: tokens.operator,
661
- operands: tokens.rawOperands.map(parseOperand)
662
- };
663
- }
664
- const trimmed = expr.trim();
665
- const pipeIndex = trimmed.indexOf("|");
666
- if (pipeIndex === -1) {
667
- return { kind: "legacy", variable: trimmed };
668
- }
669
- return {
670
- kind: "legacy",
671
- variable: trimmed.slice(0, pipeIndex).trim(),
672
- defaultValue: trimmed.slice(pipeIndex + 1).trim()
673
- };
674
- }
675
- function tokenizeFallbackExpression(expr) {
676
- const operands = [];
677
- let current = "";
678
- let quote = null;
679
- let operator = null;
680
- for (let i = 0; i < expr.length; i++) {
681
- const ch = expr[i];
682
- if (quote) {
683
- current += ch;
684
- if (ch === quote && countTrailingBackslashes(expr, i) % 2 === 0) {
685
- quote = null;
686
- }
687
- continue;
688
- }
689
- if (ch === '"' || ch === "'") {
690
- quote = ch;
691
- current += ch;
692
- continue;
693
- }
694
- if (ch === "|" && expr[i + 1] === "|") {
695
- if (operator === "??") {
696
- throw new Error(
697
- `Cannot mix '||' and '??' in template expression: "${expr}". Use one operator or wrap branches in separate {{...}} blocks.`
698
- );
699
- }
700
- operator = "||";
701
- operands.push(current);
702
- current = "";
703
- i++;
704
- continue;
705
- }
706
- if (ch === "?" && expr[i + 1] === "?") {
707
- if (operator === "||") {
708
- throw new Error(
709
- `Cannot mix '||' and '??' in template expression: "${expr}". Use one operator or wrap branches in separate {{...}} blocks.`
710
- );
711
- }
712
- operator = "??";
713
- operands.push(current);
714
- current = "";
715
- i++;
716
- continue;
717
- }
718
- current += ch;
719
- }
720
- if (operator === null) return null;
721
- operands.push(current);
722
- return { rawOperands: operands, operator };
723
- }
724
- function parseOperand(raw) {
725
- const t = raw.trim();
726
- if (t.startsWith('"') && t.endsWith('"') && t.length >= 2 || t.startsWith("'") && t.endsWith("'") && t.length >= 2) {
727
- const inner = t.slice(1, -1);
728
- return { kind: "literal", value: inner.replace(/\\(.)/g, "$1") };
729
- }
730
- if (/^-?\d+(\.\d+)?$/.test(t)) {
731
- return { kind: "literal", value: Number(t) };
732
- }
733
- if (t === "true") return { kind: "literal", value: true };
734
- if (t === "false") return { kind: "literal", value: false };
735
- if (t === "null") return { kind: "literal", value: null };
736
- return { kind: "path", path: t };
737
- }
738
- function evaluateOperand(operand, context) {
739
- if (operand.kind === "literal") return operand.value;
740
- return getNestedValue(context, operand.path);
741
- }
742
- function countTrailingBackslashes(s, i) {
743
- let n = 0;
744
- let j2 = i - 1;
745
- while (j2 >= 0 && s[j2] === "\\") {
746
- n++;
747
- j2--;
748
- }
749
- return n;
750
- }
751
- function passesOperator(value, operator) {
752
- if (operator === "||") return Boolean(value);
753
- return value !== null && value !== void 0;
754
- }
755
- function stringifyValue(value) {
756
- if (value === null || value === void 0) return "";
757
- if (typeof value === "object") return JSON.stringify(value);
758
- return String(value);
759
- }
760
- var _SimpleTemplateEngine = class _SimpleTemplateEngine2 {
761
- substitute(template, context = {}) {
762
- const usedVariables = [];
763
- const usedDefaults = [];
764
- const missingVariables = [];
765
- const result = template.replace(_SimpleTemplateEngine2.EXPRESSION_PATTERN, (match, expr) => {
766
- let parsed;
767
- try {
768
- parsed = parseTemplateExpression(expr);
769
- } catch {
770
- return match;
771
- }
772
- if (parsed.kind === "legacy") {
773
- return resolveLegacy(parsed, context, {
774
- usedVariables,
775
- usedDefaults,
776
- missingVariables,
777
- match
778
- });
779
- }
780
- return resolveFallback(parsed, context, {
781
- usedVariables,
782
- missingVariables,
783
- match
784
- });
785
- });
786
- return {
787
- result,
788
- usedVariables,
789
- usedDefaults,
790
- missingVariables
791
- };
792
- }
793
- /**
794
- * Extract all variable references from a template.
795
- * Each `{{ ... }}` produces one entry; for fallback expressions the entry
796
- * carries every path operand under `paths`, and `hasDefault: true` whenever
797
- * the chain has any non-path terminal (literal) the user can fall back to.
798
- */
799
- extractVariables(template) {
800
- const out = [];
801
- const pattern = new RegExp(_SimpleTemplateEngine2.EXPRESSION_PATTERN.source, "g");
802
- let match;
803
- while (match = pattern.exec(template)) {
804
- const expr = match[1];
805
- if (!expr) continue;
806
- let parsed;
807
- try {
808
- parsed = parseTemplateExpression(expr);
809
- } catch {
810
- continue;
811
- }
812
- if (parsed.kind === "legacy") {
813
- if (!parsed.variable) continue;
814
- out.push({
815
- variable: parsed.variable,
816
- hasDefault: parsed.defaultValue !== void 0,
817
- defaultValue: parsed.defaultValue
818
- });
819
- continue;
820
- }
821
- const paths = parsed.operands.filter((o) => o.kind === "path").map((o) => o.path);
822
- const hasLiteralFallback = parsed.operands.some((o) => o.kind === "literal");
823
- const primary = paths[0] ?? "";
824
- out.push({
825
- variable: primary,
826
- hasDefault: hasLiteralFallback,
827
- paths
828
- });
829
- }
830
- return out;
831
- }
832
- /**
833
- * Validate that a template can be processed with given context.
834
- * Returns warnings and errors.
835
- */
836
- validate(template, context = {}) {
837
- const warnings = [];
838
- const errors = [];
839
- try {
840
- const result = this.substitute(template, context);
841
- if (result.usedDefaults.length > 0) {
842
- warnings.push(
843
- `Used ${result.usedDefaults.length} default values: ${result.usedDefaults.map((d) => d.variable).join(", ")}`
844
- );
845
- }
846
- if (result.missingVariables.length > 0) {
847
- errors.push(`Missing variables without defaults: ${result.missingVariables.join(", ")}`);
848
- }
849
- return {
850
- isValid: errors.length === 0,
851
- warnings,
852
- errors
853
- };
854
- } catch (error51) {
855
- return {
856
- isValid: false,
857
- warnings,
858
- errors: [`Template parsing error: ${error51}`]
859
- };
860
- }
861
- }
862
- };
863
- _SimpleTemplateEngine.EXPRESSION_PATTERN = TEMPLATE_EXPRESSION_PATTERN;
864
- var SimpleTemplateEngine = _SimpleTemplateEngine;
865
- function resolveLegacy(parsed, context, tracking) {
866
- const value = getNestedValue(context, parsed.variable);
867
- if (value !== void 0 && value !== null) {
868
- tracking.usedVariables.push(parsed.variable);
869
- return stringifyValue(value);
870
- }
871
- if (parsed.defaultValue !== void 0) {
872
- tracking.usedDefaults.push({
873
- variable: parsed.variable,
874
- defaultValue: parsed.defaultValue
875
- });
876
- return parsed.defaultValue;
877
- }
878
- tracking.missingVariables.push(parsed.variable);
879
- return tracking.match;
880
- }
881
- function resolveFallback(parsed, context, tracking) {
882
- let chosen = null;
883
- for (const operand of parsed.operands) {
884
- const value = evaluateOperand(operand, context);
885
- if (operand.kind === "path" && value !== void 0) {
886
- tracking.usedVariables.push(operand.path);
887
- }
888
- if (chosen === null && passesOperator(value, parsed.operator)) {
889
- chosen = { value, isPath: operand.kind === "path" };
890
- }
891
- }
892
- if (chosen) return stringifyValue(chosen.value);
893
- const last = parsed.operands[parsed.operands.length - 1];
894
- if (last && last.kind === "literal") {
895
- return stringifyValue(last.value);
896
- }
897
- for (const operand of parsed.operands) {
898
- if (operand.kind === "path") tracking.missingVariables.push(operand.path);
899
- }
900
- return tracking.match;
901
- }
902
- var templateEngine = new SimpleTemplateEngine();
903
-
904
618
  // ../../node_modules/.pnpm/zod@4.4.2/node_modules/zod/v4/classic/external.js
905
619
  var external_exports = {};
906
620
  __export(external_exports, {
@@ -1449,9 +1163,9 @@ function $constructor(name, initializer3, params) {
1449
1163
  const proto = _.prototype;
1450
1164
  const keys = Object.keys(proto);
1451
1165
  for (let i = 0; i < keys.length; i++) {
1452
- const k = keys[i];
1453
- if (!(k in inst)) {
1454
- inst[k] = proto[k].bind(inst);
1166
+ const k2 = keys[i];
1167
+ if (!(k2 in inst)) {
1168
+ inst[k2] = proto[k2].bind(inst);
1455
1169
  }
1456
1170
  }
1457
1171
  }
@@ -1582,7 +1296,7 @@ function assert(_) {
1582
1296
  }
1583
1297
  function getEnumValues(entries) {
1584
1298
  const numericValues = Object.values(entries).filter((v2) => typeof v2 === "number");
1585
- const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v2]) => v2);
1299
+ const values = Object.entries(entries).filter(([k2, _]) => numericValues.indexOf(+k2) === -1).map(([_, v2]) => v2);
1586
1300
  return values;
1587
1301
  }
1588
1302
  function joinValues(array2, separator = "|") {
@@ -1872,8 +1586,8 @@ function stringifyPrimitive(value) {
1872
1586
  return `${value}`;
1873
1587
  }
1874
1588
  function optionalKeys(shape) {
1875
- return Object.keys(shape).filter((k) => {
1876
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
1589
+ return Object.keys(shape).filter((k2) => {
1590
+ return shape[k2]._zod.optin === "optional" && shape[k2]._zod.optout === "optional";
1877
1591
  });
1878
1592
  }
1879
1593
  var NUMBER_FORMAT_RANGES = {
@@ -2150,8 +1864,8 @@ function issue(...args) {
2150
1864
  return { ...iss };
2151
1865
  }
2152
1866
  function cleanEnum(obj) {
2153
- return Object.entries(obj).filter(([k, _]) => {
2154
- return Number.isNaN(Number.parseInt(k, 10));
1867
+ return Object.entries(obj).filter(([k2, _]) => {
1868
+ return Number.isNaN(Number.parseInt(k2, 10));
2155
1869
  }).map((el) => el[1]);
2156
1870
  }
2157
1871
  function base64ToUint8Array(base643) {
@@ -3859,9 +3573,9 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
3859
3573
  }
3860
3574
  function normalizeDef(def) {
3861
3575
  const keys = Object.keys(def.shape);
3862
- for (const k of keys) {
3863
- if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
3864
- throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
3576
+ for (const k2 of keys) {
3577
+ if (!def.shape?.[k2]?._zod?.traits?.has("$ZodType")) {
3578
+ throw new Error(`Invalid element at key "${k2}": expected a Zod schema`);
3865
3579
  }
3866
3580
  }
3867
3581
  const okeys = optionalKeys(def.shape);
@@ -3982,8 +3696,8 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3982
3696
  const doc = new Doc(["shape", "payload", "ctx"]);
3983
3697
  const normalized = _normalized.value;
3984
3698
  const parseStr = (key) => {
3985
- const k = esc(key);
3986
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
3699
+ const k2 = esc(key);
3700
+ return `shape[${k2}]._zod.run({ value: input[${k2}], issues: [] }, ctx)`;
3987
3701
  };
3988
3702
  doc.write(`const input = payload.value;`);
3989
3703
  const ids = /* @__PURE__ */ Object.create(null);
@@ -3994,7 +3708,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3994
3708
  doc.write(`const newResult = {};`);
3995
3709
  for (const key of normalized.keys) {
3996
3710
  const id = ids[key];
3997
- const k = esc(key);
3711
+ const k2 = esc(key);
3998
3712
  const schema = shape[key];
3999
3713
  const isOptionalIn = schema?._zod?.optin === "optional";
4000
3714
  const isOptionalOut = schema?._zod?.optout === "optional";
@@ -4002,30 +3716,30 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
4002
3716
  if (isOptionalIn && isOptionalOut) {
4003
3717
  doc.write(`
4004
3718
  if (${id}.issues.length) {
4005
- if (${k} in input) {
3719
+ if (${k2} in input) {
4006
3720
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
4007
3721
  ...iss,
4008
- path: iss.path ? [${k}, ...iss.path] : [${k}]
3722
+ path: iss.path ? [${k2}, ...iss.path] : [${k2}]
4009
3723
  })));
4010
3724
  }
4011
3725
  }
4012
3726
 
4013
3727
  if (${id}.value === undefined) {
4014
- if (${k} in input) {
4015
- newResult[${k}] = undefined;
3728
+ if (${k2} in input) {
3729
+ newResult[${k2}] = undefined;
4016
3730
  }
4017
3731
  } else {
4018
- newResult[${k}] = ${id}.value;
3732
+ newResult[${k2}] = ${id}.value;
4019
3733
  }
4020
3734
 
4021
3735
  `);
4022
3736
  } else if (!isOptionalIn) {
4023
3737
  doc.write(`
4024
- const ${id}_present = ${k} in input;
3738
+ const ${id}_present = ${k2} in input;
4025
3739
  if (${id}.issues.length) {
4026
3740
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
4027
3741
  ...iss,
4028
- path: iss.path ? [${k}, ...iss.path] : [${k}]
3742
+ path: iss.path ? [${k2}, ...iss.path] : [${k2}]
4029
3743
  })));
4030
3744
  }
4031
3745
  if (!${id}_present && !${id}.issues.length) {
@@ -4033,15 +3747,15 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
4033
3747
  code: "invalid_type",
4034
3748
  expected: "nonoptional",
4035
3749
  input: undefined,
4036
- path: [${k}]
3750
+ path: [${k2}]
4037
3751
  });
4038
3752
  }
4039
3753
 
4040
3754
  if (${id}_present) {
4041
3755
  if (${id}.value === undefined) {
4042
- newResult[${k}] = undefined;
3756
+ newResult[${k2}] = undefined;
4043
3757
  } else {
4044
- newResult[${k}] = ${id}.value;
3758
+ newResult[${k2}] = ${id}.value;
4045
3759
  }
4046
3760
  }
4047
3761
 
@@ -4051,16 +3765,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
4051
3765
  if (${id}.issues.length) {
4052
3766
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
4053
3767
  ...iss,
4054
- path: iss.path ? [${k}, ...iss.path] : [${k}]
3768
+ path: iss.path ? [${k2}, ...iss.path] : [${k2}]
4055
3769
  })));
4056
3770
  }
4057
3771
 
4058
3772
  if (${id}.value === undefined) {
4059
- if (${k} in input) {
4060
- newResult[${k}] = undefined;
3773
+ if (${k2} in input) {
3774
+ newResult[${k2}] = undefined;
4061
3775
  }
4062
3776
  } else {
4063
- newResult[${k}] = ${id}.value;
3777
+ newResult[${k2}] = ${id}.value;
4064
3778
  }
4065
3779
 
4066
3780
  `);
@@ -4229,11 +3943,11 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
4229
3943
  const pv = option._zod.propValues;
4230
3944
  if (!pv || Object.keys(pv).length === 0)
4231
3945
  throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
4232
- for (const [k, v2] of Object.entries(pv)) {
4233
- if (!propValues[k])
4234
- propValues[k] = /* @__PURE__ */ new Set();
3946
+ for (const [k2, v2] of Object.entries(pv)) {
3947
+ if (!propValues[k2])
3948
+ propValues[k2] = /* @__PURE__ */ new Set();
4235
3949
  for (const val of v2) {
4236
- propValues[k].add(val);
3950
+ propValues[k2].add(val);
4237
3951
  }
4238
3952
  }
4239
3953
  }
@@ -4351,10 +4065,10 @@ function handleIntersectionResults(result, left, right) {
4351
4065
  for (const iss of left.issues) {
4352
4066
  if (iss.code === "unrecognized_keys") {
4353
4067
  unrecIssue ?? (unrecIssue = iss);
4354
- for (const k of iss.keys) {
4355
- if (!unrecKeys.has(k))
4356
- unrecKeys.set(k, {});
4357
- unrecKeys.get(k).l = true;
4068
+ for (const k2 of iss.keys) {
4069
+ if (!unrecKeys.has(k2))
4070
+ unrecKeys.set(k2, {});
4071
+ unrecKeys.get(k2).l = true;
4358
4072
  }
4359
4073
  } else {
4360
4074
  result.issues.push(iss);
@@ -4362,16 +4076,16 @@ function handleIntersectionResults(result, left, right) {
4362
4076
  }
4363
4077
  for (const iss of right.issues) {
4364
4078
  if (iss.code === "unrecognized_keys") {
4365
- for (const k of iss.keys) {
4366
- if (!unrecKeys.has(k))
4367
- unrecKeys.set(k, {});
4368
- unrecKeys.get(k).r = true;
4079
+ for (const k2 of iss.keys) {
4080
+ if (!unrecKeys.has(k2))
4081
+ unrecKeys.set(k2, {});
4082
+ unrecKeys.get(k2).r = true;
4369
4083
  }
4370
4084
  } else {
4371
4085
  result.issues.push(iss);
4372
4086
  }
4373
4087
  }
4374
- const bothKeys = [...unrecKeys].filter(([, f2]) => f2.l && f2.r).map(([k]) => k);
4088
+ const bothKeys = [...unrecKeys].filter(([, f2]) => f2.l && f2.r).map(([k2]) => k2);
4375
4089
  if (bothKeys.length && unrecIssue) {
4376
4090
  result.issues.push({ ...unrecIssue, keys: bothKeys });
4377
4091
  }
@@ -4715,7 +4429,7 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
4715
4429
  const values = getEnumValues(def.entries);
4716
4430
  const valuesSet = new Set(values);
4717
4431
  inst._zod.values = valuesSet;
4718
- inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
4432
+ inst._zod.pattern = new RegExp(`^(${values.filter((k2) => propertyKeyTypes.has(typeof k2)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
4719
4433
  inst._zod.parse = (payload, _ctx) => {
4720
4434
  const input = payload.value;
4721
4435
  if (valuesSet.has(input)) {
@@ -14415,11 +14129,11 @@ function record(keyType, valueType, params) {
14415
14129
  });
14416
14130
  }
14417
14131
  function partialRecord(keyType, valueType, params) {
14418
- const k = clone(keyType);
14419
- k._zod.values = void 0;
14132
+ const k2 = clone(keyType);
14133
+ k2._zod.values = void 0;
14420
14134
  return new ZodRecord({
14421
14135
  type: "record",
14422
- keyType: k,
14136
+ keyType: k2,
14423
14137
  valueType,
14424
14138
  ...util_exports.normalizeParams(params)
14425
14139
  });
@@ -15409,6 +15123,328 @@ function date4(params) {
15409
15123
  // ../../node_modules/.pnpm/zod@4.4.2/node_modules/zod/v4/classic/external.js
15410
15124
  config(en_default());
15411
15125
 
15126
+ // ../shared/dist/chunk-TWJN5HII.mjs
15127
+ var apiReleaseChannelSchema = external_exports.enum(["staging", "production"]);
15128
+ var API_ARTIFACT_SCRIPT_PATTERN = /^api-[a-z0-9][a-z0-9-]{0,62}$/;
15129
+ var apiArtifactScriptNameSchema = external_exports.string().regex(
15130
+ API_ARTIFACT_SCRIPT_PATTERN,
15131
+ "API artifact script names look like api-<sha12> or api-<sha12>-<suffix> (lowercase alphanumeric and dashes)"
15132
+ );
15133
+ var apiHeaderOverrideModeSchema = external_exports.enum(["open", "token"]);
15134
+ var apiArtifactStatusSchema = external_exports.enum([
15135
+ "uploaded",
15136
+ "active",
15137
+ "superseded",
15138
+ "pinned",
15139
+ "failed",
15140
+ "deleted"
15141
+ ]);
15142
+ var apiCanaryConfigSchema = external_exports.object({
15143
+ script: apiArtifactScriptNameSchema,
15144
+ percent: external_exports.number().int().min(1).max(100)
15145
+ });
15146
+ var apiRoutingDocSchema = external_exports.object({
15147
+ version: external_exports.number().int().nonnegative(),
15148
+ updatedAt: external_exports.string().min(1),
15149
+ api: external_exports.object({
15150
+ activeScript: apiArtifactScriptNameSchema.nullable(),
15151
+ previousScript: apiArtifactScriptNameSchema.nullable(),
15152
+ canary: apiCanaryConfigSchema.nullable(),
15153
+ pinsEnabled: external_exports.boolean(),
15154
+ legacyFallback: external_exports.boolean(),
15155
+ headerOverride: apiHeaderOverrideModeSchema
15156
+ })
15157
+ }).refine((doc) => doc.api.activeScript !== null || doc.api.legacyFallback, {
15158
+ message: "activeScript may only be null while legacyFallback is true",
15159
+ path: ["api", "activeScript"]
15160
+ });
15161
+
15162
+ // ../shared/dist/chunk-3V2W6XMX.mjs
15163
+ function getNestedValue(obj, path16) {
15164
+ let normalizedPath = path16;
15165
+ normalizedPath = normalizedPath.replace(/^\$\.?/, "");
15166
+ normalizedPath = normalizedPath.replace(/\[(\d+)\]/g, ".$1");
15167
+ normalizedPath = normalizedPath.replace(/\[['"]([^'"\]]+)['"]\]/g, ".$1");
15168
+ normalizedPath = normalizedPath.replace(/\[([^'"\]]+)\]/g, ".$1");
15169
+ normalizedPath = normalizedPath.replace(/^\./, "");
15170
+ const keys = normalizedPath.split(".");
15171
+ let current = obj;
15172
+ for (let i = 0; i < keys.length; i++) {
15173
+ const key = keys[i];
15174
+ if (current === null || current === void 0 || key === void 0) {
15175
+ return void 0;
15176
+ }
15177
+ if (Array.isArray(current)) {
15178
+ if (/^\d+$/.test(key)) {
15179
+ const index = parseInt(key, 10);
15180
+ if (index >= 0 && index < current.length) {
15181
+ current = current[index];
15182
+ } else {
15183
+ return void 0;
15184
+ }
15185
+ } else {
15186
+ return void 0;
15187
+ }
15188
+ } else if (current && typeof current === "object") {
15189
+ if (DANGEROUS_KEYS.has(key)) return void 0;
15190
+ current = current[key];
15191
+ } else {
15192
+ return void 0;
15193
+ }
15194
+ }
15195
+ return current;
15196
+ }
15197
+ var DANGEROUS_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
15198
+ var TEMPLATE_EXPRESSION_PATTERN = /\{\{([^{}]+)\}\}/g;
15199
+ function parseTemplateExpression(expr) {
15200
+ const tokens = tokenizeFallbackExpression(expr);
15201
+ if (tokens) {
15202
+ return {
15203
+ kind: "fallback",
15204
+ operator: tokens.operator,
15205
+ operands: tokens.rawOperands.map(parseOperand)
15206
+ };
15207
+ }
15208
+ const trimmed = expr.trim();
15209
+ const pipeIndex = trimmed.indexOf("|");
15210
+ if (pipeIndex === -1) {
15211
+ return { kind: "legacy", variable: trimmed };
15212
+ }
15213
+ return {
15214
+ kind: "legacy",
15215
+ variable: trimmed.slice(0, pipeIndex).trim(),
15216
+ defaultValue: trimmed.slice(pipeIndex + 1).trim()
15217
+ };
15218
+ }
15219
+ function tokenizeFallbackExpression(expr) {
15220
+ const operands = [];
15221
+ let current = "";
15222
+ let quote = null;
15223
+ let operator = null;
15224
+ for (let i = 0; i < expr.length; i++) {
15225
+ const ch = expr[i];
15226
+ if (quote) {
15227
+ current += ch;
15228
+ if (ch === quote && countTrailingBackslashes(expr, i) % 2 === 0) {
15229
+ quote = null;
15230
+ }
15231
+ continue;
15232
+ }
15233
+ if (ch === '"' || ch === "'") {
15234
+ quote = ch;
15235
+ current += ch;
15236
+ continue;
15237
+ }
15238
+ if (ch === "|" && expr[i + 1] === "|") {
15239
+ if (operator === "??") {
15240
+ throw new Error(
15241
+ `Cannot mix '||' and '??' in template expression: "${expr}". Use one operator or wrap branches in separate {{...}} blocks.`
15242
+ );
15243
+ }
15244
+ operator = "||";
15245
+ operands.push(current);
15246
+ current = "";
15247
+ i++;
15248
+ continue;
15249
+ }
15250
+ if (ch === "?" && expr[i + 1] === "?") {
15251
+ if (operator === "||") {
15252
+ throw new Error(
15253
+ `Cannot mix '||' and '??' in template expression: "${expr}". Use one operator or wrap branches in separate {{...}} blocks.`
15254
+ );
15255
+ }
15256
+ operator = "??";
15257
+ operands.push(current);
15258
+ current = "";
15259
+ i++;
15260
+ continue;
15261
+ }
15262
+ current += ch;
15263
+ }
15264
+ if (operator === null) return null;
15265
+ operands.push(current);
15266
+ return { rawOperands: operands, operator };
15267
+ }
15268
+ function parseOperand(raw) {
15269
+ const t = raw.trim();
15270
+ if (t.startsWith('"') && t.endsWith('"') && t.length >= 2 || t.startsWith("'") && t.endsWith("'") && t.length >= 2) {
15271
+ const inner = t.slice(1, -1);
15272
+ return { kind: "literal", value: inner.replace(/\\(.)/g, "$1") };
15273
+ }
15274
+ if (/^-?\d+(\.\d+)?$/.test(t)) {
15275
+ return { kind: "literal", value: Number(t) };
15276
+ }
15277
+ if (t === "true") return { kind: "literal", value: true };
15278
+ if (t === "false") return { kind: "literal", value: false };
15279
+ if (t === "null") return { kind: "literal", value: null };
15280
+ return { kind: "path", path: t };
15281
+ }
15282
+ function evaluateOperand(operand, context) {
15283
+ if (operand.kind === "literal") return operand.value;
15284
+ return getNestedValue(context, operand.path);
15285
+ }
15286
+ function countTrailingBackslashes(s, i) {
15287
+ let n = 0;
15288
+ let j2 = i - 1;
15289
+ while (j2 >= 0 && s[j2] === "\\") {
15290
+ n++;
15291
+ j2--;
15292
+ }
15293
+ return n;
15294
+ }
15295
+ function passesOperator(value, operator) {
15296
+ if (operator === "||") return Boolean(value);
15297
+ return value !== null && value !== void 0;
15298
+ }
15299
+ function stringifyValue(value) {
15300
+ if (value === null || value === void 0) return "";
15301
+ if (typeof value === "object") return JSON.stringify(value);
15302
+ return String(value);
15303
+ }
15304
+ var _SimpleTemplateEngine = class _SimpleTemplateEngine2 {
15305
+ substitute(template, context = {}) {
15306
+ const usedVariables = [];
15307
+ const usedDefaults = [];
15308
+ const missingVariables = [];
15309
+ const result = template.replace(_SimpleTemplateEngine2.EXPRESSION_PATTERN, (match, expr) => {
15310
+ let parsed;
15311
+ try {
15312
+ parsed = parseTemplateExpression(expr);
15313
+ } catch {
15314
+ return match;
15315
+ }
15316
+ if (parsed.kind === "legacy") {
15317
+ return resolveLegacy(parsed, context, {
15318
+ usedVariables,
15319
+ usedDefaults,
15320
+ missingVariables,
15321
+ match
15322
+ });
15323
+ }
15324
+ return resolveFallback(parsed, context, {
15325
+ usedVariables,
15326
+ missingVariables,
15327
+ match
15328
+ });
15329
+ });
15330
+ return {
15331
+ result,
15332
+ usedVariables,
15333
+ usedDefaults,
15334
+ missingVariables
15335
+ };
15336
+ }
15337
+ /**
15338
+ * Extract all variable references from a template.
15339
+ * Each `{{ ... }}` produces one entry; for fallback expressions the entry
15340
+ * carries every path operand under `paths`, and `hasDefault: true` whenever
15341
+ * the chain has any non-path terminal (literal) the user can fall back to.
15342
+ */
15343
+ extractVariables(template) {
15344
+ const out = [];
15345
+ const pattern = new RegExp(_SimpleTemplateEngine2.EXPRESSION_PATTERN.source, "g");
15346
+ let match;
15347
+ while (match = pattern.exec(template)) {
15348
+ const expr = match[1];
15349
+ if (!expr) continue;
15350
+ let parsed;
15351
+ try {
15352
+ parsed = parseTemplateExpression(expr);
15353
+ } catch {
15354
+ continue;
15355
+ }
15356
+ if (parsed.kind === "legacy") {
15357
+ if (!parsed.variable) continue;
15358
+ out.push({
15359
+ variable: parsed.variable,
15360
+ hasDefault: parsed.defaultValue !== void 0,
15361
+ defaultValue: parsed.defaultValue
15362
+ });
15363
+ continue;
15364
+ }
15365
+ const paths = parsed.operands.filter((o) => o.kind === "path").map((o) => o.path);
15366
+ const hasLiteralFallback = parsed.operands.some((o) => o.kind === "literal");
15367
+ const primary = paths[0] ?? "";
15368
+ out.push({
15369
+ variable: primary,
15370
+ hasDefault: hasLiteralFallback,
15371
+ paths
15372
+ });
15373
+ }
15374
+ return out;
15375
+ }
15376
+ /**
15377
+ * Validate that a template can be processed with given context.
15378
+ * Returns warnings and errors.
15379
+ */
15380
+ validate(template, context = {}) {
15381
+ const warnings = [];
15382
+ const errors = [];
15383
+ try {
15384
+ const result = this.substitute(template, context);
15385
+ if (result.usedDefaults.length > 0) {
15386
+ warnings.push(
15387
+ `Used ${result.usedDefaults.length} default values: ${result.usedDefaults.map((d) => d.variable).join(", ")}`
15388
+ );
15389
+ }
15390
+ if (result.missingVariables.length > 0) {
15391
+ errors.push(`Missing variables without defaults: ${result.missingVariables.join(", ")}`);
15392
+ }
15393
+ return {
15394
+ isValid: errors.length === 0,
15395
+ warnings,
15396
+ errors
15397
+ };
15398
+ } catch (error51) {
15399
+ return {
15400
+ isValid: false,
15401
+ warnings,
15402
+ errors: [`Template parsing error: ${error51}`]
15403
+ };
15404
+ }
15405
+ }
15406
+ };
15407
+ _SimpleTemplateEngine.EXPRESSION_PATTERN = TEMPLATE_EXPRESSION_PATTERN;
15408
+ var SimpleTemplateEngine = _SimpleTemplateEngine;
15409
+ function resolveLegacy(parsed, context, tracking) {
15410
+ const value = getNestedValue(context, parsed.variable);
15411
+ if (value !== void 0 && value !== null) {
15412
+ tracking.usedVariables.push(parsed.variable);
15413
+ return stringifyValue(value);
15414
+ }
15415
+ if (parsed.defaultValue !== void 0) {
15416
+ tracking.usedDefaults.push({
15417
+ variable: parsed.variable,
15418
+ defaultValue: parsed.defaultValue
15419
+ });
15420
+ return parsed.defaultValue;
15421
+ }
15422
+ tracking.missingVariables.push(parsed.variable);
15423
+ return tracking.match;
15424
+ }
15425
+ function resolveFallback(parsed, context, tracking) {
15426
+ let chosen = null;
15427
+ for (const operand of parsed.operands) {
15428
+ const value = evaluateOperand(operand, context);
15429
+ if (operand.kind === "path" && value !== void 0) {
15430
+ tracking.usedVariables.push(operand.path);
15431
+ }
15432
+ if (chosen === null && passesOperator(value, parsed.operator)) {
15433
+ chosen = { value, isPath: operand.kind === "path" };
15434
+ }
15435
+ }
15436
+ if (chosen) return stringifyValue(chosen.value);
15437
+ const last = parsed.operands[parsed.operands.length - 1];
15438
+ if (last && last.kind === "literal") {
15439
+ return stringifyValue(last.value);
15440
+ }
15441
+ for (const operand of parsed.operands) {
15442
+ if (operand.kind === "path") tracking.missingVariables.push(operand.path);
15443
+ }
15444
+ return tracking.match;
15445
+ }
15446
+ var templateEngine = new SimpleTemplateEngine();
15447
+
15412
15448
  // ../shared/dist/index.mjs
15413
15449
  var mediaAnnotationsSchema = external_exports.object({
15414
15450
  audience: external_exports.array(external_exports.enum(["user", "assistant"])).optional()
@@ -16135,7 +16171,7 @@ var productConfigurationSummarySchema = external_exports.object({
16135
16171
  configurationUrl: external_exports.string(),
16136
16172
  handoff: secretHandoffSchema.optional()
16137
16173
  });
16138
- var ORGANIZATION_INTEGRATION_PROVIDERS = ["slack", "telegram", "discord", "linear", "github"];
16174
+ var ORGANIZATION_INTEGRATION_PROVIDERS = ["slack", "telegram", "discord", "linear", "github", "granola"];
16139
16175
  var integrationProviderSchema = external_exports.enum(ORGANIZATION_INTEGRATION_PROVIDERS);
16140
16176
  var integrationStatusSchema = external_exports.enum(["active", "revoked", "pending"]);
16141
16177
  var FILTER_OPERATORS = [
@@ -33283,13 +33319,124 @@ var IMESSAGE_INTEGRATION = {
33283
33319
  }
33284
33320
  ]
33285
33321
  };
33322
+ var GRANOLA_INTEGRATION = {
33323
+ id: "granola",
33324
+ name: "Granola",
33325
+ description: "Read meeting notes, transcripts, and folders from Granola",
33326
+ transport: "http",
33327
+ url: "",
33328
+ // Direct API calls - no external proxy needed
33329
+ requiredCredentials: [],
33330
+ category: MCPServerCategory.PRODUCTIVITY,
33331
+ documentationUrl: "https://docs.granola.ai",
33332
+ icon: "granola",
33333
+ tools: [
33334
+ {
33335
+ name: "list_meeting_notes",
33336
+ description: "List Granola meeting notes, newest first, with cursor pagination. Only notes whose AI summary has been generated are returned. Use updated_after with an ISO 8601 timestamp to fetch notes changed since a checkpoint (e.g. a schedule\u2019s last run time).",
33337
+ parametersSchema: {
33338
+ type: "object",
33339
+ properties: {
33340
+ // @snake-case-ok-start: tool input fields use snake_case for LLM ergonomics
33341
+ created_after: {
33342
+ type: "string",
33343
+ description: "Only return notes created after this ISO 8601 timestamp."
33344
+ },
33345
+ created_before: {
33346
+ type: "string",
33347
+ description: "Only return notes created before this ISO 8601 timestamp."
33348
+ },
33349
+ updated_after: {
33350
+ type: "string",
33351
+ description: "Only return notes updated after this ISO 8601 timestamp."
33352
+ },
33353
+ cursor: {
33354
+ type: "string",
33355
+ description: "Pagination cursor from a previous response."
33356
+ },
33357
+ page_size: {
33358
+ type: "number",
33359
+ description: "Notes per page (1-30, default 10).",
33360
+ minimum: 1,
33361
+ maximum: 30
33362
+ }
33363
+ // @snake-case-ok-end
33364
+ },
33365
+ required: []
33366
+ }
33367
+ },
33368
+ {
33369
+ name: "get_meeting_note",
33370
+ description: "Fetch a single Granola meeting note: AI summary, attendees, calendar event, and folder membership. Returns a not-yet-processed error for meetings whose summary has not been generated. Set include_transcript to also fetch the raw transcript (transcript access is plan-gated by Granola).",
33371
+ parametersSchema: {
33372
+ type: "object",
33373
+ properties: {
33374
+ // @snake-case-ok-start: tool input fields use snake_case for LLM ergonomics
33375
+ note_id: {
33376
+ type: "string",
33377
+ description: "Granola note ID (e.g. not_1d3tmYTlCICgjy)."
33378
+ },
33379
+ include_transcript: {
33380
+ type: "boolean",
33381
+ description: "Include the meeting transcript in the response."
33382
+ }
33383
+ // @snake-case-ok-end
33384
+ },
33385
+ required: ["note_id"]
33386
+ }
33387
+ },
33388
+ {
33389
+ name: "get_meeting_transcript",
33390
+ description: "Fetch only the transcript of a Granola meeting note. Transcript access is plan-gated by Granola (Business/Enterprise).",
33391
+ parametersSchema: {
33392
+ type: "object",
33393
+ properties: {
33394
+ // @snake-case-ok: tool input fields use snake_case for LLM ergonomics
33395
+ note_id: {
33396
+ type: "string",
33397
+ description: "Granola note ID (e.g. not_1d3tmYTlCICgjy)."
33398
+ }
33399
+ },
33400
+ required: ["note_id"]
33401
+ }
33402
+ },
33403
+ {
33404
+ name: "list_folders",
33405
+ description: "List Granola folders accessible to the connected API key.",
33406
+ parametersSchema: {
33407
+ type: "object",
33408
+ properties: {},
33409
+ required: []
33410
+ }
33411
+ },
33412
+ {
33413
+ name: "find_meeting_notes",
33414
+ description: "Search recent Granola meeting notes by title or participant (owner/attendee) name/email. Granola has no server-side search endpoint, so this pages through recent notes (bounded) and filters client-side.",
33415
+ parametersSchema: {
33416
+ type: "object",
33417
+ properties: {
33418
+ query: {
33419
+ type: "string",
33420
+ description: "Text matched case-insensitively against note titles and participant (owner/attendee) names/emails."
33421
+ },
33422
+ since: {
33423
+ type: "string",
33424
+ description: "Only search notes created after this ISO 8601 timestamp (default: last 30 days)."
33425
+ }
33426
+ },
33427
+ required: ["query"]
33428
+ }
33429
+ }
33430
+ ]
33431
+ };
33286
33432
  var INTEGRATIONS_REGISTRY = [
33287
33433
  SLACK_INTEGRATION,
33288
33434
  GOOGLE_INTEGRATION,
33289
33435
  LINEAR_INTEGRATION,
33290
33436
  GITHUB_INTEGRATION,
33291
33437
  TELEGRAM_INTEGRATION,
33292
- IMESSAGE_INTEGRATION
33438
+ IMESSAGE_INTEGRATION,
33439
+ GRANOLA_INTEGRATION
33293
33440
  ];
33294
33441
  function getAllIntegrations() {
33295
33442
  return INTEGRATIONS_REGISTRY;
@@ -33326,6 +33473,18 @@ var DEFAULT_MODELS_FOR_NEW_ACCOUNTS = [
33326
33473
  { provider: "runtype", modelId: "gemma-4-26b-a4b-it", isDefault: false }
33327
33474
  ];
33328
33475
  var DEFAULT_MODEL_ID = DEFAULT_MODELS_FOR_NEW_ACCOUNTS.find((m2) => m2.isDefault)?.modelId ?? "qwen/qwen3.5-9b";
33476
+ var userProfileFeaturesSchema = external_exports.object({
33477
+ enableAgentSkills: external_exports.boolean(),
33478
+ // Routed model id the product generator dispatches with. Driven by the
33479
+ // `product-generator-model` string flag; defaults to `kimi-k2.6`.
33480
+ productGeneratorModel: external_exports.string(),
33481
+ // Gates the WebMCP-powered dashboard assistant (copilot panel + chat
33482
+ // proxy). Driven by the `enable-dashboard-assistant` boolean flag.
33483
+ enableDashboardAssistant: external_exports.boolean(),
33484
+ // Routed model id the dashboard assistant dispatches with. Driven by the
33485
+ // `dashboard-assistant-model` string flag.
33486
+ dashboardAssistantModel: external_exports.string()
33487
+ });
33329
33488
  var MODEL_FAMILY_PROVIDER_IDS = {
33330
33489
  "claude-4-opus": {
33331
33490
  "vercel": "anthropic/claude-4-opus"
@@ -34585,7 +34744,7 @@ var PLATFORM_KEY_PROVIDER_MAP = {
34585
34744
  "mock": false
34586
34745
  };
34587
34746
  var PLATFORM_KEY_PROVIDERS = new Set(
34588
- Object.entries(PLATFORM_KEY_PROVIDER_MAP).filter(([, v2]) => v2).map(([k]) => k)
34747
+ Object.entries(PLATFORM_KEY_PROVIDER_MAP).filter(([, v2]) => v2).map(([k2]) => k2)
34589
34748
  );
34590
34749
  var MANUAL_PROVIDER_MAP_OVERRIDES = {
34591
34750
  // Bedrock uses different model ID format
@@ -37143,7 +37302,7 @@ var FLOW_STEP_TYPE_METADATA = {
37143
37302
  description: "Execute JavaScript code in a sandboxed environment. Access flow variables via the `input` object and return a result.",
37144
37303
  category: "data",
37145
37304
  isPrompt: false,
37146
- configHints: "script, outputVariable, sandboxProvider (cloudflare-worker (default)|quickjs|runtype-sandbox|daytona), language (required for runtype-sandbox: javascript|typescript|python)"
37305
+ configHints: "script, outputVariable, sandboxProvider (cloudflare-worker (default)|quickjs|runtype-sandbox|daytona), language (required for runtype-sandbox: javascript|typescript|python). Each flow variable is also injected as a top-level `const` in the script scope under cloudflare-worker and daytona \u2014 do NOT `const`/`let`/`var` a same-named variable (throws `SyntaxError: Identifier already declared` at sandbox-load time). Prefer reading flow variables as `input.X` for clarity and forward compatibility."
37147
37306
  },
37148
37307
  template: {
37149
37308
  description: "Render a Liquid template into HTML, email-html, markdown, PDF, or text. Prefer over a prompt step when the output is a structured document (invoice, receipt, email body, report) and the data is already available.",
@@ -37951,13 +38110,92 @@ For agent-driven dynamic spawning, set \`subagentConfig\` on the agent's \`tools
37951
38110
  - Integration tools require the user to have connected the integration in Settings > Integrations
37952
38111
  - Orthogonal tools are available to all users via platform keys`;
37953
38112
  })();
38113
+ var TOOL_SELECTION_SUMMARY = (() => {
38114
+ const integrations = getAllIntegrations();
38115
+ const integrationLines = integrations.map((integration) => {
38116
+ const toolNames = integration.tools.map((t) => `${t.name}`).join(", ");
38117
+ return `- **${integration.name}** (\`builtin:${integration.id}:<tool>\`): ${toolNames}`;
38118
+ });
38119
+ const vendorSlugs = /* @__PURE__ */ new Set();
38120
+ for (const tool of ORTHOGONAL_PLATFORM_TOOLS) {
38121
+ if (tool.hidden || tool.deprecated || !tool.managedExecution.verified) continue;
38122
+ vendorSlugs.add(tool.managedExecution.apiSlug);
38123
+ }
38124
+ const vendorNames = [...vendorSlugs].sort().map((slug) => ORTHOGONAL_API_NAMES[slug] ?? slug).join(", ");
38125
+ return `## Tool Selection Summary
38126
+
38127
+ Tools are added to prompt steps via \`tools: { toolIds: ["<id>"] }\`. The AI model autonomously decides when to call each tool during generation. Pick from the guide below; fetch the full catalogs only when you need parameter details.
38128
+
38129
+ ### Tool Selection Guide
38130
+
38131
+ - **Image generation** \u2192 \`builtin:gpt-image-2\`
38132
+ - **Web search (provider-native, inline citations)** \u2192 see the Provider-Native Search section
38133
+ - **Web search (standalone, AI-powered)** \u2192 \`builtin:exa\`
38134
+ - **Simple web scraping to markdown** \u2192 \`builtin:firecrawl\`
38135
+ - **Rendered web pages, screenshots, structured extraction, or link harvesting** \u2192 \`builtin:browser:markdown\`, \`builtin:browser:snapshot\`, \`builtin:browser:json\`, \`builtin:browser:scrape\`, \`builtin:browser:links\` (stateless, one-shot)
38136
+ - **Autonomous browsing (just want the outcome)** \u2192 \`builtin:browser:agent\` with a natural-language \`goal\` plus \`startUrl\` or \`sessionId\` \u2014 try this BEFORE the manual session tools
38137
+ - **Interactive browsing (precise control)** \u2192 \`builtin:browser:open\`, then \`builtin:browser:click\` / \`type\` / \`scroll\` / \`session-screenshot\` / \`evaluate\` / \`navigate\`, and \`builtin:browser:close\` when done
38138
+ - **Multi-page rendered crawling** \u2192 use the flow \`crawl\` step instead of repeated \`browser:*\` calls
38139
+ - **Find people / company enrichment** \u2192 \`platform:orthogonal:apollo:people_match\`, \`platform:orthogonal:apollo:organization_enrich\`
38140
+ - **Send Slack message** \u2192 \`builtin:slack:send_message\`
38141
+ - **Send email via Gmail** \u2192 \`builtin:google:gmail_send\`
38142
+ - **Create Linear issue** \u2192 \`builtin:linear:create_issue\`
38143
+ - **Create GitHub PR** \u2192 \`builtin:github:create_pull_request\`
38144
+ - **Host a file (public CDN URL or signed private URL)** \u2192 \`builtin:store_asset\`
38145
+ - **Publish an HTML page that renders in the browser** \u2192 \`builtin:publish_page\` (shareable 7-day \`/preview/\` URL)
38146
+ - **Semantic vector search** \u2192 \`builtin:vector-search\`
38147
+ - **Text-to-speech / speech-to-text** \u2192 \`builtin:elevenlabs-tts\` / \`builtin:elevenlabs-stt\`
38148
+ - **Emit rich content** \u2192 \`builtin:emit_artifact_markdown\`, \`builtin:emit_artifact_component\`
38149
+ - **Record CRUD** \u2192 \`builtin:runtype_record_upsert\`, \`builtin:runtype_record_get\`, \`builtin:runtype_record_list\`, \`builtin:runtype_record_delete\`
38150
+ - **Agent memory (persist + recall across sessions)** \u2192 \`builtin:save_memory\`, \`builtin:recall_memory\`, \`builtin:memory_summary\`
38151
+ - **E-commerce checkout** \u2192 \`builtin:ucp_discover\`, \`builtin:ucp_search_catalog\`, \`builtin:ucp_create_checkout\`
38152
+
38153
+ ### Integration Tools (require connected credentials)
38154
+
38155
+ ${integrationLines.join("\n")}
38156
+
38157
+ ### Third-Party API Tools (Orthogonal)
38158
+
38159
+ Platform-managed API tools \u2014 no API key needed. Vendors: ${vendorNames}. Tool ID format: \`platform:orthogonal:<vendor>:<tool>\`.
38160
+
38161
+ ### Custom MCP Servers (saved by the user)
38162
+
38163
+ Reference saved MCP servers in \`toolIds\` as \`mcp:<serverName>:<toolName>\`, or use the wildcard \`mcp:<serverName>:*\` to attach every tool the server exposes (wildcard wins if both forms are present).
38164
+
38165
+ ### Subagent Runtime Tools
38166
+
38167
+ Subagent tools are not catalog entries \u2014 they are runtime tools defined inline on a prompt step's \`tools.runtimeTools\` array with \`toolType: 'subagent'\` (config: \`agentId\` or inline \`agent\`, plus \`allowedTools\`). For agent-driven dynamic spawning, set \`subagentConfig\` on the agent's tools config. Fetch the \`subagent-delegation\` documentation topic for the full guide.
38168
+
38169
+ ### Drill-down
38170
+
38171
+ For full tool descriptions and parameter schemas, fetch the \`builtin-tools\` and \`orthogonal-tools\` documentation topics (or read \`runtype://catalog/builtin-tools\`, \`runtype://catalog/orthogonal-tools\`, and the per-vendor \`runtype://catalog/orthogonal-tools/{vendor}\` resources).`;
38172
+ })();
38173
+ function renderGoldenPathSentence(names) {
38174
+ return `validate with \`${names.validateFlow}\`/\`${names.validateProduct}\` before creating, and test with \`${names.executeAgent}\`/\`${names.runFlow}\` before sharing a result`;
38175
+ }
38176
+ var GOLDEN_PATH_SENTENCE = renderGoldenPathSentence({
38177
+ validateFlow: "validate_flow",
38178
+ validateProduct: "validate_product",
38179
+ executeAgent: "execute_agent",
38180
+ runFlow: "run_flow"
38181
+ });
38182
+ var GOLDEN_PATH_SENTENCE_CODE_MODE = renderGoldenPathSentence({
38183
+ validateFlow: "validateFlow",
38184
+ validateProduct: "validateProduct",
38185
+ executeAgent: "executeAgent",
38186
+ runFlow: "runFlow"
38187
+ });
37954
38188
  var DOCUMENTATION_TOPIC_MAP = {
38189
+ // `index` is intentionally FIRST so it leads the enum in the tool schema —
38190
+ // weak models should discover the task→topic table before anything else.
38191
+ index: "runtype://catalog/topic-index",
37955
38192
  "platform-catalog": "runtype://catalog/platform",
37956
38193
  "surface-types": "runtype://catalog/surface-types",
37957
38194
  "flow-step-types": "runtype://catalog/flow-step-types",
37958
38195
  models: "runtype://catalog/models",
37959
38196
  "product-schema": "runtype://schema/fpo",
37960
38197
  "types-fpo": "runtype://types/fpo",
38198
+ "types-fpo-template": "runtype://types/fpo-template",
37961
38199
  "types-flow-steps": "runtype://types/flow-steps",
37962
38200
  "types-entities": "runtype://types/entities",
37963
38201
  "types-surface-configs": "runtype://types/surface-configs",
@@ -37965,8 +38203,13 @@ var DOCUMENTATION_TOPIC_MAP = {
37965
38203
  "builtin-tools": "runtype://catalog/builtin-tools",
37966
38204
  "agent-skills": "runtype://catalog/skills",
37967
38205
  "external-tools": "runtype://guide/external-tools",
38206
+ "validation-errors": "runtype://guide/validation-errors",
38207
+ "subagent-delegation": "runtype://guide/subagent-delegation",
38208
+ limits: "runtype://catalog/limits",
38209
+ "provider-native-search": "runtype://catalog/provider-native-search",
37968
38210
  "dashboard-links": "runtype://catalog/dashboard-links",
37969
38211
  "mock-ecommerce": "runtype://catalog/mock-ecommerce",
38212
+ "ucp-commerce": "runtype://catalog/ucp-commerce",
37970
38213
  "persona-embed": "runtype://catalog/persona-embed",
37971
38214
  "persona-fullscreen-assistant": "runtype://guide/persona-fullscreen-assistant",
37972
38215
  "sdk-reference": "runtype://types/sdk-reference"
@@ -37986,7 +38229,9 @@ var NON_AI_PROVIDER_IDS = /* @__PURE__ */ new Set([
37986
38229
  // Audio / Speech
37987
38230
  "elevenlabs",
37988
38231
  // Observability
37989
- "braintrust"
38232
+ "braintrust",
38233
+ // Meeting Notes
38234
+ "granola"
37990
38235
  ]);
37991
38236
  function isNonAIProvider(id) {
37992
38237
  const normalized = id.trim().toLowerCase();
@@ -41704,8 +41949,8 @@ configCommand.command("get [key]").description("Get configuration value").action
41704
41949
  const allConfig = config2.store;
41705
41950
  if (Object.keys(allConfig).length > 0) {
41706
41951
  console.log(chalk9.cyan("Current Configuration:"));
41707
- for (const [k, v2] of Object.entries(allConfig)) {
41708
- console.log(` ${chalk9.green(k)}: ${v2}`);
41952
+ for (const [k2, v2] of Object.entries(allConfig)) {
41953
+ console.log(` ${chalk9.green(k2)}: ${v2}`);
41709
41954
  }
41710
41955
  } else {
41711
41956
  console.log(chalk9.gray("No configuration set"));
@@ -43097,7 +43342,7 @@ Keys (${keys.length}):`));
43097
43342
  const itemSummary = items.length === 0 ? "No items" : items.map(
43098
43343
  (i) => `${i.exposedName || i.capabilityName || i.capabilityId}${i.isEntryPoint ? " (entry point)" : ""}`
43099
43344
  ).join("\n");
43100
- const keySummary = keys.length === 0 ? "No keys" : keys.map((k) => `${k.name ?? "(unnamed)"} ${k.keyPrefix ?? ""}`.trim()).join("\n");
43345
+ const keySummary = keys.length === 0 ? "No keys" : keys.map((k2) => `${k2.name ?? "(unnamed)"} ${k2.keyPrefix ?? ""}`.trim()).join("\n");
43101
43346
  setResultNode(
43102
43347
  React9.createElement(EntityCard, {
43103
43348
  fields: [
@@ -43273,7 +43518,7 @@ logsCommand.command("stats").description("Aggregate log stats: totals, counts by
43273
43518
  const formatCounts = (counts) => {
43274
43519
  const entries = Object.entries(counts);
43275
43520
  if (entries.length === 0) return "(none)";
43276
- return entries.map(([k, v2]) => `${k}=${v2}`).join(", ");
43521
+ return entries.map(([k2, v2]) => `${k2}=${v2}`).join(", ");
43277
43522
  };
43278
43523
  if (!isTTY(options) || options.json) {
43279
43524
  try {
@@ -49182,11 +49427,11 @@ function compactRawStreamEventForCopy(event) {
49182
49427
  data = JSON.parse(JSON.stringify(event.listData, stringCompactionReplacer));
49183
49428
  } else {
49184
49429
  data = {};
49185
- for (const [k, v2] of Object.entries(event.data)) {
49186
- if (STREAM_EVENT_HEAVY_KEYS.has(k)) {
49187
- data[k] = compactHeavyField(v2);
49430
+ for (const [k2, v2] of Object.entries(event.data)) {
49431
+ if (STREAM_EVENT_HEAVY_KEYS.has(k2)) {
49432
+ data[k2] = compactHeavyField(v2);
49188
49433
  } else {
49189
- data[k] = compactJsonLike(v2);
49434
+ data[k2] = compactJsonLike(v2);
49190
49435
  }
49191
49436
  }
49192
49437
  }
@@ -57183,10 +57428,10 @@ apiKeysCommand.command("list").description("List your API keys").option("--json"
57183
57428
  total,
57184
57429
  emptyMessage: "No API keys found",
57185
57430
  renderCard: (item) => {
57186
- const k = item;
57187
- const prefix = k.prefix ? ` (${k.prefix}...)` : "";
57188
- const lastUsed = k.lastUsedAt ? ` last used: ${k.lastUsedAt}` : "";
57189
- return React20.createElement(Text32, null, ` ${k.id} ${k.name}${prefix}${lastUsed}`);
57431
+ const k2 = item;
57432
+ const prefix = k2.prefix ? ` (${k2.prefix}...)` : "";
57433
+ const lastUsed = k2.lastUsedAt ? ` last used: ${k2.lastUsedAt}` : "";
57434
+ return React20.createElement(Text32, null, ` ${k2.id} ${k2.name}${prefix}${lastUsed}`);
57190
57435
  }
57191
57436
  });
57192
57437
  };
@@ -57967,8 +58212,8 @@ import { execFileSync } from "child_process";
57967
58212
  // src/lib/persona-init.ts
57968
58213
  init_credential_store();
57969
58214
 
57970
- // ../../node_modules/.pnpm/@runtypelabs+persona@3.29.1/node_modules/@runtypelabs/persona/dist/codegen.js
57971
- var S = { name: "@runtypelabs/persona", version: "3.29.1", description: "Themeable, pluggable streaming agent widget for websites, in plain JS with support for voice input and reasoning / tool output.", type: "module", main: "dist/index.cjs", module: "dist/index.js", types: "dist/index.d.ts", exports: { ".": { types: "./dist/index.d.ts", import: "./dist/index.js", require: "./dist/index.cjs" }, "./theme-reference": { types: "./dist/theme-reference.d.ts", import: "./dist/theme-reference.js", require: "./dist/theme-reference.cjs" }, "./codegen": { types: "./dist/codegen.d.ts", import: "./dist/codegen.js", require: "./dist/codegen.cjs" }, "./theme-editor": { types: "./dist/theme-editor.d.ts", import: "./dist/theme-editor.js", require: "./dist/theme-editor.cjs" }, "./testing": { types: "./dist/testing.d.ts", import: "./dist/testing.js", require: "./dist/testing.cjs" }, "./smart-dom-reader": { types: "./dist/smart-dom-reader.d.ts", import: "./dist/smart-dom-reader.js", require: "./dist/smart-dom-reader.cjs" }, "./animations/glyph-cycle": { types: "./dist/animations/glyph-cycle.d.ts", import: "./dist/animations/glyph-cycle.js", require: "./dist/animations/glyph-cycle.cjs" }, "./animations/wipe": { types: "./dist/animations/wipe.d.ts", import: "./dist/animations/wipe.js", require: "./dist/animations/wipe.cjs" }, "./widget.css": "./dist/widget.css" }, files: ["dist", "src"], scripts: { build: "rimraf dist && pnpm run build:styles && pnpm run build:client && pnpm run build:installer && pnpm run build:launcher && pnpm run build:theme-ref && pnpm run build:codegen && pnpm run build:theme-editor && pnpm run build:testing && pnpm run build:smart-dom-reader && pnpm run build:animations", "build:theme-editor": "tsup src/theme-editor.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting", "build:testing": "tsup src/testing.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting", "build:smart-dom-reader": "tsup src/smart-dom-reader.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting", "build:animations": "tsup src/animations/glyph-cycle.ts src/animations/wipe.ts --format esm,cjs --minify --dts --out-dir dist/animations --no-splitting", "build:theme-ref": "tsup src/theme-reference.ts --format esm,cjs --minify --dts", "build:codegen": "tsup src/codegen.ts --format esm,cjs --minify --dts", "build:styles": `node -e "const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('src/styles/widget.css','dist/widget.css');"`, "build:client": `tsup src/index.ts --format esm,cjs --minify --sourcemap --splitting false --dts --loader ".css=text" && tsup src/index-global.ts --format iife --global-name AgentWidget --minify --sourcemap --splitting false --out-dir dist --loader ".css=text" && node -e "const fs=require('fs');for(const ext of ['.global.js','.global.js.map']){const from='dist/index-global'+ext;if(fs.existsSync(from))fs.renameSync(from,'dist/index'+ext);}"`, "build:installer": "tsup src/install.ts --format iife --global-name SiteAgentInstaller --out-dir dist --minify --sourcemap --no-splitting", "build:launcher": `tsup src/launcher-global.ts --format iife --global-name AgentWidgetLauncher --minify --sourcemap --splitting false --out-dir dist && node -e "const fs=require('fs');for(const ext of ['.global.js','.global.js.map']){const from='dist/launcher-global'+ext;if(fs.existsSync(from))fs.renameSync(from,'dist/launcher'+ext);}"`, lint: "eslint . --ext .ts", typecheck: "pnpm run check:runtype-types && tsc --noEmit", test: "vitest", "test:ui": "vitest --ui", "test:run": "vitest run", size: "size-limit", "fetch:runtype-openapi": "node scripts/fetch-runtype-openapi.mjs", "generate:runtype-types": "pnpm run fetch:runtype-openapi && node scripts/generate-runtype-openapi-types.mjs", "check:runtype-types": "pnpm run fetch:runtype-openapi && node scripts/generate-runtype-openapi-types.mjs --check" }, dependencies: { "@mcp-b/webmcp-polyfill": "^3.0.0", dompurify: "^3.3.3", idiomorph: "^0.7.4", lucide: "^0.552.0", marked: "^12.0.2", "partial-json": "^0.1.7", zod: "^3.22.4" }, devDependencies: { "@size-limit/file": "^12.1.0", "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.0.0", "@vitest/ui": "^4.0.9", eslint: "^8.57.0", "eslint-config-prettier": "^9.1.0", "fake-indexeddb": "^6.2.5", rimraf: "^5.0.5", "size-limit": "^12.1.0", tsup: "^8.0.1", typescript: "^5.4.5", vitest: "^4.0.9" }, engines: { node: ">=20.0.0" }, author: "Runtype", license: "MIT", keywords: ["ai", "chat", "widget", "streaming", "typescript", "persona", "agent"], repository: { type: "git", url: "git+https://github.com/runtypelabs/persona.git", directory: "packages/widget" }, bugs: { url: "https://github.com/runtypelabs/persona/issues" }, homepage: "https://github.com/runtypelabs/persona/tree/main/packages/widget#readme", publishConfig: { access: "public" } };
58215
+ // ../../node_modules/.pnpm/@runtypelabs+persona@3.31.0/node_modules/@runtypelabs/persona/dist/codegen.js
58216
+ var S = { name: "@runtypelabs/persona", version: "3.31.0", description: "Themeable, pluggable streaming agent widget for websites, in plain JS with support for voice input and reasoning / tool output.", type: "module", main: "dist/index.cjs", module: "dist/index.js", types: "dist/index.d.ts", exports: { ".": { types: "./dist/index.d.ts", import: "./dist/index.js", require: "./dist/index.cjs" }, "./theme-reference": { types: "./dist/theme-reference.d.ts", import: "./dist/theme-reference.js", require: "./dist/theme-reference.cjs" }, "./codegen": { types: "./dist/codegen.d.ts", import: "./dist/codegen.js", require: "./dist/codegen.cjs" }, "./theme-editor": { types: "./dist/theme-editor.d.ts", import: "./dist/theme-editor.js", require: "./dist/theme-editor.cjs" }, "./testing": { types: "./dist/testing.d.ts", import: "./dist/testing.js", require: "./dist/testing.cjs" }, "./smart-dom-reader": { types: "./dist/smart-dom-reader.d.ts", import: "./dist/smart-dom-reader.js", require: "./dist/smart-dom-reader.cjs" }, "./plugin-kit": { types: "./dist/plugin-kit.d.ts", import: "./dist/plugin-kit.js", require: "./dist/plugin-kit.cjs" }, "./animations/glyph-cycle": { types: "./dist/animations/glyph-cycle.d.ts", import: "./dist/animations/glyph-cycle.js", require: "./dist/animations/glyph-cycle.cjs" }, "./animations/wipe": { types: "./dist/animations/wipe.d.ts", import: "./dist/animations/wipe.js", require: "./dist/animations/wipe.cjs" }, "./widget.css": "./dist/widget.css" }, files: ["dist", "src"], scripts: { build: "rimraf dist && pnpm run build:styles && pnpm run build:client && pnpm run build:installer && pnpm run build:launcher && pnpm run build:theme-ref && pnpm run build:codegen && pnpm run build:theme-editor && pnpm run build:testing && pnpm run build:smart-dom-reader && pnpm run build:plugin-kit && pnpm run build:animations", "build:plugin-kit": "tsup src/plugin-kit.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting", "build:theme-editor": "tsup src/theme-editor.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting", "build:testing": "tsup src/testing.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting", "build:smart-dom-reader": "tsup src/smart-dom-reader.ts --format esm,cjs --minify --dts --out-dir dist --no-splitting", "build:animations": "tsup src/animations/glyph-cycle.ts src/animations/wipe.ts --format esm,cjs --minify --dts --out-dir dist/animations --no-splitting", "build:theme-ref": "tsup src/theme-reference.ts --format esm,cjs --minify --dts", "build:codegen": "tsup src/codegen.ts --format esm,cjs --minify --dts", "build:styles": `node -e "const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('src/styles/widget.css','dist/widget.css');"`, "build:client": `tsup src/index.ts --format esm,cjs --minify --sourcemap --splitting false --dts --loader ".css=text" && tsup src/index-global.ts --format iife --global-name AgentWidget --minify --sourcemap --splitting false --out-dir dist --loader ".css=text" && node -e "const fs=require('fs');for(const ext of ['.global.js','.global.js.map']){const from='dist/index-global'+ext;if(fs.existsSync(from))fs.renameSync(from,'dist/index'+ext);}"`, "build:installer": "tsup src/install.ts --format iife --global-name SiteAgentInstaller --out-dir dist --minify --sourcemap --no-splitting", "build:launcher": `tsup src/launcher-global.ts --format iife --global-name AgentWidgetLauncher --minify --sourcemap --splitting false --out-dir dist && node -e "const fs=require('fs');for(const ext of ['.global.js','.global.js.map']){const from='dist/launcher-global'+ext;if(fs.existsSync(from))fs.renameSync(from,'dist/launcher'+ext);}"`, lint: "eslint . --ext .ts", typecheck: "pnpm run check:runtype-types && tsc --noEmit", test: "vitest", "test:ui": "vitest --ui", "test:run": "vitest run", size: "size-limit", "fetch:runtype-openapi": "node scripts/fetch-runtype-openapi.mjs", "generate:runtype-types": "pnpm run fetch:runtype-openapi && node scripts/generate-runtype-openapi-types.mjs", "check:runtype-types": "pnpm run fetch:runtype-openapi && node scripts/generate-runtype-openapi-types.mjs --check" }, dependencies: { "@mcp-b/webmcp-polyfill": "^3.0.0", dompurify: "^3.3.3", idiomorph: "^0.7.4", lucide: "^0.552.0", marked: "^12.0.2", "partial-json": "^0.1.7", zod: "^3.22.4" }, devDependencies: { "@size-limit/file": "^12.1.0", "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.0.0", "@vitest/ui": "^4.0.9", eslint: "^8.57.0", "eslint-config-prettier": "^9.1.0", "fake-indexeddb": "^6.2.5", rimraf: "^5.0.5", "size-limit": "^12.1.0", tsup: "^8.0.1", typescript: "^5.4.5", vitest: "^4.0.9" }, engines: { node: ">=20.0.0" }, author: "Runtype", license: "MIT", keywords: ["ai", "chat", "widget", "streaming", "typescript", "persona", "agent"], repository: { type: "git", url: "git+https://github.com/runtypelabs/persona.git", directory: "packages/widget" }, bugs: { url: "https://github.com/runtypelabs/persona/issues" }, homepage: "https://github.com/runtypelabs/persona/tree/main/packages/widget#readme", publishConfig: { access: "public" } };
57972
58217
  var c = S.version;
57973
58218
  function u(e) {
57974
58219
  if (e !== void 0) return typeof e == "string" ? e : Array.isArray(e) ? `[${e.map((r) => r.toString()).join(", ")}]` : e.toString();
@@ -58131,7 +58376,7 @@ function I(e, r = "esm", n) {
58131
58376
  let s = { ...e };
58132
58377
  delete s.postprocessMessage, delete s.initialMessages;
58133
58378
  let o = n ? { ...n, hooks: T(n.hooks) } : void 0;
58134
- return r === "esm" ? W(s, o) : r === "script-installer" ? D(s, o) : r === "script-advanced" ? J(s, o) : r === "react-component" ? H(s, o) : r === "react-advanced" ? N(s, o) : F(s, o);
58379
+ return r === "esm" ? W(s, o) : r === "script-installer" ? k(s, o) : r === "script-advanced" ? F(s, o) : r === "react-component" ? H(s, o) : r === "react-advanced" ? N(s, o) : D(s, o);
58135
58380
  }
58136
58381
  function W(e, r) {
58137
58382
  let n = r == null ? void 0 : r.hooks, s = h(e), o = s !== "plain", t = ["import '@runtypelabs/persona/widget.css';", "import { initAgentWidget, markdownPostprocessor } from '@runtypelabs/persona';", "", "initAgentWidget({", ` target: '${g(r)}',`, " config: {"];
@@ -58227,11 +58472,11 @@ function P(e) {
58227
58472
  }
58228
58473
  return s;
58229
58474
  }
58230
- function D(e, r) {
58475
+ function k(e, r) {
58231
58476
  let n = P(e), o = !!(r != null && r.windowKey || r != null && r.target) ? { config: n, ...r != null && r.windowKey ? { windowKey: r.windowKey } : {}, ...r != null && r.target ? { target: r.target } : {} } : n, t = JSON.stringify(o, null, 0).replace(/'/g, "&#39;");
58232
58477
  return `<script src="https://cdn.jsdelivr.net/npm/@runtypelabs/persona@${c}/dist/install.global.js" data-config='${t}'></script>`;
58233
58478
  }
58234
- function F(e, r) {
58479
+ function D(e, r) {
58235
58480
  let n = r == null ? void 0 : r.hooks, s = h(e), o = s !== "plain", t = ["<!-- Load CSS -->", `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@runtypelabs/persona@${c}/dist/widget.css" />`, "", "<!-- Load JavaScript -->", `<script src="https://cdn.jsdelivr.net/npm/@runtypelabs/persona@${c}/dist/index.global.js"></script>`, "", "<!-- Initialize widget -->", "<script>", " var handle = window.AgentWidget.initAgentWidget({", ` target: '${g(r)}',`, ...r != null && r.windowKey ? [` windowKey: '${r.windowKey}',`] : [], " config: {"];
58236
58481
  return e.apiUrl && t.push(` apiUrl: "${e.apiUrl}",`), e.clientToken && t.push(` clientToken: "${e.clientToken}",`), e.flowId && t.push(` flowId: "${e.flowId}",`), o && t.push(` parserType: "${s}",`), e.theme && typeof e.theme == "object" && Object.keys(e.theme).length > 0 && l(t, "theme", e.theme, " "), e.launcher && l(t, "launcher", e.launcher, " "), e.copy && (t.push(" copy: {"), Object.entries(e.copy).forEach(([i, a]) => {
58237
58482
  t.push(` ${i}: "${a}",`);
@@ -58248,7 +58493,7 @@ function F(e, r) {
58248
58493
  }), t.push(" ],")), e.suggestionChipsConfig && (t.push(" suggestionChipsConfig: {"), e.suggestionChipsConfig.fontFamily && t.push(` fontFamily: "${e.suggestionChipsConfig.fontFamily}",`), e.suggestionChipsConfig.fontWeight && t.push(` fontWeight: "${e.suggestionChipsConfig.fontWeight}",`), e.suggestionChipsConfig.paddingX && t.push(` paddingX: "${e.suggestionChipsConfig.paddingX}",`), e.suggestionChipsConfig.paddingY && t.push(` paddingY: "${e.suggestionChipsConfig.paddingY}",`), t.push(" },")), t.push(...f(e, " ")), t.push(...m(e, " ", n)), t.push(...y(e, " ")), t.push(...C(e, " ")), t.push(...$(n, " ")), e.debug && t.push(` debug: ${e.debug},`), n != null && n.postprocessMessage ? t.push(` postprocessMessage: ${n.postprocessMessage}`) : t.push(" postprocessMessage: ({ text }) => window.AgentWidget.markdownPostprocessor(text)"), t.push(" }"), t.push(" });"), t.push("</script>"), t.join(`
58249
58494
  `);
58250
58495
  }
58251
- function J(e, r) {
58496
+ function F(e, r) {
58252
58497
  let n = r == null ? void 0 : r.hooks, s = P(e), t = ["<script>", "(function() {", " 'use strict';", "", " // Configuration", ` var CONFIG = ${JSON.stringify(s, null, 2).split(`
58253
58498
  `).map((i, a) => a === 0 ? i : " " + i).join(`
58254
58499
  `)};`, "", " // Constants", ` var CDN_BASE = 'https://cdn.jsdelivr.net/npm/@runtypelabs/persona@${c}/dist';`, " var STORAGE_KEY = 'chat-widget-state';", " var PROCESSED_ACTIONS_KEY = 'chat-widget-processed-actions';", "", " // DOM context provider - extracts page elements for AI context", " var domContextProvider = function() {", " var selectors = {", ` products: '[data-product-id], .product-card, .product-item, [role="article"]',`, ` buttons: 'button, [role="button"], .btn',`, " links: 'a[href]',", " inputs: 'input, textarea, select'", " };", "", " var elements = [];", " Object.entries(selectors).forEach(function(entry) {", " var type = entry[0], selector = entry[1];", " document.querySelectorAll(selector).forEach(function(element) {", " if (!(element instanceof HTMLElement)) return;", " var widgetHost = element.closest('.persona-host');", " if (widgetHost) return;", " var text = element.innerText ? element.innerText.trim() : '';", " if (!text) return;", "", " var selectorString = element.id ? '#' + element.id :", ` element.getAttribute('data-testid') ? '[data-testid="' + element.getAttribute('data-testid') + '"]' :`, ` element.getAttribute('data-product-id') ? '[data-product-id="' + element.getAttribute('data-product-id') + '"]' :`, " element.tagName.toLowerCase();", "", " var elementData = {", " type: type,", " tagName: element.tagName.toLowerCase(),", " selector: selectorString,", " innerText: text.substring(0, 200)", " };", "", " if (type === 'links' && element instanceof HTMLAnchorElement && element.href) {", " elementData.href = element.href;", " }", " elements.push(elementData);", " });", " });", "", " var counts = elements.reduce(function(acc, el) {", " acc[el.type] = (acc[el.type] || 0) + 1;", " return acc;", " }, {});", "", " return {", " page_elements: elements.slice(0, 50),", " page_element_count: elements.length,", " element_types: counts,", " page_url: window.location.href,", " page_title: document.title,", " timestamp: new Date().toISOString()", " };", " };", "", " // Load CSS dynamically", " var loadCSS = function() {", " if (document.querySelector('link[data-persona]')) return;", " var link = document.createElement('link');", " link.rel = 'stylesheet';", " link.href = CDN_BASE + '/widget.css';", " link.setAttribute('data-persona', 'true');", " document.head.appendChild(link);", " };", "", " // Load JS dynamically", " var loadJS = function(callback) {", " if (window.AgentWidget) { callback(); return; }", " var script = document.createElement('script');", " script.src = CDN_BASE + '/index.global.js';", " script.onload = callback;", " script.onerror = function() { console.error('Failed to load AgentWidget'); };", " document.head.appendChild(script);", " };", "", " // Create widget config with advanced features", " var createWidgetConfig = function(agentWidget) {", " var widgetConfig = Object.assign({}, CONFIG);", ""];
@@ -59643,7 +59888,7 @@ function categoryBadge(category, useColor) {
59643
59888
  return chalk35.magenta(`[${category}]`);
59644
59889
  }
59645
59890
  function formatTailData(data) {
59646
- return Object.entries(data).map(([k, v2]) => `${k}=${typeof v2 === "string" ? v2 : JSON.stringify(v2)}`).join(" ");
59891
+ return Object.entries(data).map(([k2, v2]) => `${k2}=${typeof v2 === "string" ? v2 : JSON.stringify(v2)}`).join(" ");
59647
59892
  }
59648
59893
  function formatContextIds(event, useColor) {
59649
59894
  const ids = [];
@@ -59731,9 +59976,9 @@ async function createSession(apiUrl, apiKey, filters) {
59731
59976
  level: "levels",
59732
59977
  category: "categories"
59733
59978
  };
59734
- for (const [k, v2] of Object.entries(filters)) {
59735
- if (v2 !== void 0 && arrayFields[k]) {
59736
- filter[arrayFields[k]] = [v2];
59979
+ for (const [k2, v2] of Object.entries(filters)) {
59980
+ if (v2 !== void 0 && arrayFields[k2]) {
59981
+ filter[arrayFields[k2]] = [v2];
59737
59982
  }
59738
59983
  }
59739
59984
  const body = Object.keys(filter).length > 0 ? { filter } : {};
@@ -59787,7 +60032,7 @@ async function runTail(options) {
59787
60032
  category: options.category
59788
60033
  };
59789
60034
  const useColor = options.color;
59790
- const activeFilters = Object.entries(filters).filter(([, v2]) => v2 !== void 0).map(([k, v2]) => `${k}=${v2}`);
60035
+ const activeFilters = Object.entries(filters).filter(([, v2]) => v2 !== void 0).map(([k2, v2]) => `${k2}=${v2}`);
59791
60036
  process.stderr.write(
59792
60037
  (useColor ? chalk35.gray(
59793
60038
  `Connecting to ${apiUrl}...${activeFilters.length ? ` filters: ${activeFilters.join(", ")}` : ""}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.16.17",
3
+ "version": "2.16.19",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,12 +22,12 @@
22
22
  "rosie-skills": "0.8.1",
23
23
  "yaml": "^2.9.0",
24
24
  "@runtypelabs/ink-components": "0.3.2",
25
- "@runtypelabs/sdk": "4.8.0",
25
+ "@runtypelabs/sdk": "4.8.1",
26
26
  "@runtypelabs/terminal-animations": "0.2.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/micromatch": "^4.0.9",
30
- "@runtypelabs/persona": "3.29.1",
30
+ "@runtypelabs/persona": "3.31.0",
31
31
  "@types/express": "^5.0.6",
32
32
  "@types/node": "^25.3.3",
33
33
  "@types/react": "^19.2.14",
@@ -37,7 +37,7 @@
37
37
  "tsx": "^4.7.1",
38
38
  "typescript": "^5.3.3",
39
39
  "vitest": "^4.1.0",
40
- "@runtypelabs/shared": "1.17.0"
40
+ "@runtypelabs/shared": "1.21.0"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=22.0.0"