@runtypelabs/cli 2.16.16 → 2.16.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.
Files changed (2) hide show
  1. package/dist/index.js +208 -112
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1449,9 +1449,9 @@ function $constructor(name, initializer3, params) {
1449
1449
  const proto = _.prototype;
1450
1450
  const keys = Object.keys(proto);
1451
1451
  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);
1452
+ const k2 = keys[i];
1453
+ if (!(k2 in inst)) {
1454
+ inst[k2] = proto[k2].bind(inst);
1455
1455
  }
1456
1456
  }
1457
1457
  }
@@ -1582,7 +1582,7 @@ function assert(_) {
1582
1582
  }
1583
1583
  function getEnumValues(entries) {
1584
1584
  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);
1585
+ const values = Object.entries(entries).filter(([k2, _]) => numericValues.indexOf(+k2) === -1).map(([_, v2]) => v2);
1586
1586
  return values;
1587
1587
  }
1588
1588
  function joinValues(array2, separator = "|") {
@@ -1872,8 +1872,8 @@ function stringifyPrimitive(value) {
1872
1872
  return `${value}`;
1873
1873
  }
1874
1874
  function optionalKeys(shape) {
1875
- return Object.keys(shape).filter((k) => {
1876
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
1875
+ return Object.keys(shape).filter((k2) => {
1876
+ return shape[k2]._zod.optin === "optional" && shape[k2]._zod.optout === "optional";
1877
1877
  });
1878
1878
  }
1879
1879
  var NUMBER_FORMAT_RANGES = {
@@ -2150,8 +2150,8 @@ function issue(...args) {
2150
2150
  return { ...iss };
2151
2151
  }
2152
2152
  function cleanEnum(obj) {
2153
- return Object.entries(obj).filter(([k, _]) => {
2154
- return Number.isNaN(Number.parseInt(k, 10));
2153
+ return Object.entries(obj).filter(([k2, _]) => {
2154
+ return Number.isNaN(Number.parseInt(k2, 10));
2155
2155
  }).map((el) => el[1]);
2156
2156
  }
2157
2157
  function base64ToUint8Array(base643) {
@@ -3859,9 +3859,9 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
3859
3859
  }
3860
3860
  function normalizeDef(def) {
3861
3861
  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`);
3862
+ for (const k2 of keys) {
3863
+ if (!def.shape?.[k2]?._zod?.traits?.has("$ZodType")) {
3864
+ throw new Error(`Invalid element at key "${k2}": expected a Zod schema`);
3865
3865
  }
3866
3866
  }
3867
3867
  const okeys = optionalKeys(def.shape);
@@ -3982,8 +3982,8 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3982
3982
  const doc = new Doc(["shape", "payload", "ctx"]);
3983
3983
  const normalized = _normalized.value;
3984
3984
  const parseStr = (key) => {
3985
- const k = esc(key);
3986
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
3985
+ const k2 = esc(key);
3986
+ return `shape[${k2}]._zod.run({ value: input[${k2}], issues: [] }, ctx)`;
3987
3987
  };
3988
3988
  doc.write(`const input = payload.value;`);
3989
3989
  const ids = /* @__PURE__ */ Object.create(null);
@@ -3994,7 +3994,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3994
3994
  doc.write(`const newResult = {};`);
3995
3995
  for (const key of normalized.keys) {
3996
3996
  const id = ids[key];
3997
- const k = esc(key);
3997
+ const k2 = esc(key);
3998
3998
  const schema = shape[key];
3999
3999
  const isOptionalIn = schema?._zod?.optin === "optional";
4000
4000
  const isOptionalOut = schema?._zod?.optout === "optional";
@@ -4002,30 +4002,30 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
4002
4002
  if (isOptionalIn && isOptionalOut) {
4003
4003
  doc.write(`
4004
4004
  if (${id}.issues.length) {
4005
- if (${k} in input) {
4005
+ if (${k2} in input) {
4006
4006
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
4007
4007
  ...iss,
4008
- path: iss.path ? [${k}, ...iss.path] : [${k}]
4008
+ path: iss.path ? [${k2}, ...iss.path] : [${k2}]
4009
4009
  })));
4010
4010
  }
4011
4011
  }
4012
4012
 
4013
4013
  if (${id}.value === undefined) {
4014
- if (${k} in input) {
4015
- newResult[${k}] = undefined;
4014
+ if (${k2} in input) {
4015
+ newResult[${k2}] = undefined;
4016
4016
  }
4017
4017
  } else {
4018
- newResult[${k}] = ${id}.value;
4018
+ newResult[${k2}] = ${id}.value;
4019
4019
  }
4020
4020
 
4021
4021
  `);
4022
4022
  } else if (!isOptionalIn) {
4023
4023
  doc.write(`
4024
- const ${id}_present = ${k} in input;
4024
+ const ${id}_present = ${k2} in input;
4025
4025
  if (${id}.issues.length) {
4026
4026
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
4027
4027
  ...iss,
4028
- path: iss.path ? [${k}, ...iss.path] : [${k}]
4028
+ path: iss.path ? [${k2}, ...iss.path] : [${k2}]
4029
4029
  })));
4030
4030
  }
4031
4031
  if (!${id}_present && !${id}.issues.length) {
@@ -4033,15 +4033,15 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
4033
4033
  code: "invalid_type",
4034
4034
  expected: "nonoptional",
4035
4035
  input: undefined,
4036
- path: [${k}]
4036
+ path: [${k2}]
4037
4037
  });
4038
4038
  }
4039
4039
 
4040
4040
  if (${id}_present) {
4041
4041
  if (${id}.value === undefined) {
4042
- newResult[${k}] = undefined;
4042
+ newResult[${k2}] = undefined;
4043
4043
  } else {
4044
- newResult[${k}] = ${id}.value;
4044
+ newResult[${k2}] = ${id}.value;
4045
4045
  }
4046
4046
  }
4047
4047
 
@@ -4051,16 +4051,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
4051
4051
  if (${id}.issues.length) {
4052
4052
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
4053
4053
  ...iss,
4054
- path: iss.path ? [${k}, ...iss.path] : [${k}]
4054
+ path: iss.path ? [${k2}, ...iss.path] : [${k2}]
4055
4055
  })));
4056
4056
  }
4057
4057
 
4058
4058
  if (${id}.value === undefined) {
4059
- if (${k} in input) {
4060
- newResult[${k}] = undefined;
4059
+ if (${k2} in input) {
4060
+ newResult[${k2}] = undefined;
4061
4061
  }
4062
4062
  } else {
4063
- newResult[${k}] = ${id}.value;
4063
+ newResult[${k2}] = ${id}.value;
4064
4064
  }
4065
4065
 
4066
4066
  `);
@@ -4229,11 +4229,11 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
4229
4229
  const pv = option._zod.propValues;
4230
4230
  if (!pv || Object.keys(pv).length === 0)
4231
4231
  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();
4232
+ for (const [k2, v2] of Object.entries(pv)) {
4233
+ if (!propValues[k2])
4234
+ propValues[k2] = /* @__PURE__ */ new Set();
4235
4235
  for (const val of v2) {
4236
- propValues[k].add(val);
4236
+ propValues[k2].add(val);
4237
4237
  }
4238
4238
  }
4239
4239
  }
@@ -4351,10 +4351,10 @@ function handleIntersectionResults(result, left, right) {
4351
4351
  for (const iss of left.issues) {
4352
4352
  if (iss.code === "unrecognized_keys") {
4353
4353
  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;
4354
+ for (const k2 of iss.keys) {
4355
+ if (!unrecKeys.has(k2))
4356
+ unrecKeys.set(k2, {});
4357
+ unrecKeys.get(k2).l = true;
4358
4358
  }
4359
4359
  } else {
4360
4360
  result.issues.push(iss);
@@ -4362,16 +4362,16 @@ function handleIntersectionResults(result, left, right) {
4362
4362
  }
4363
4363
  for (const iss of right.issues) {
4364
4364
  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;
4365
+ for (const k2 of iss.keys) {
4366
+ if (!unrecKeys.has(k2))
4367
+ unrecKeys.set(k2, {});
4368
+ unrecKeys.get(k2).r = true;
4369
4369
  }
4370
4370
  } else {
4371
4371
  result.issues.push(iss);
4372
4372
  }
4373
4373
  }
4374
- const bothKeys = [...unrecKeys].filter(([, f2]) => f2.l && f2.r).map(([k]) => k);
4374
+ const bothKeys = [...unrecKeys].filter(([, f2]) => f2.l && f2.r).map(([k2]) => k2);
4375
4375
  if (bothKeys.length && unrecIssue) {
4376
4376
  result.issues.push({ ...unrecIssue, keys: bothKeys });
4377
4377
  }
@@ -4715,7 +4715,7 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
4715
4715
  const values = getEnumValues(def.entries);
4716
4716
  const valuesSet = new Set(values);
4717
4717
  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("|")})$`);
4718
+ inst._zod.pattern = new RegExp(`^(${values.filter((k2) => propertyKeyTypes.has(typeof k2)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
4719
4719
  inst._zod.parse = (payload, _ctx) => {
4720
4720
  const input = payload.value;
4721
4721
  if (valuesSet.has(input)) {
@@ -14415,11 +14415,11 @@ function record(keyType, valueType, params) {
14415
14415
  });
14416
14416
  }
14417
14417
  function partialRecord(keyType, valueType, params) {
14418
- const k = clone(keyType);
14419
- k._zod.values = void 0;
14418
+ const k2 = clone(keyType);
14419
+ k2._zod.values = void 0;
14420
14420
  return new ZodRecord({
14421
14421
  type: "record",
14422
- keyType: k,
14422
+ keyType: k2,
14423
14423
  valueType,
14424
14424
  ...util_exports.normalizeParams(params)
14425
14425
  });
@@ -15581,6 +15581,10 @@ var agentApprovalStartEventSchema = external_exports.object({
15581
15581
  toolName: external_exports.string(),
15582
15582
  toolType: external_exports.string(),
15583
15583
  description: external_exports.string(),
15584
+ // Agent-authored justification for this specific call, extracted from the
15585
+ // reserved `_approvalReason` parameter. It is the agent's claim about its
15586
+ // intent — UIs must attribute it to the agent and render it as plain text.
15587
+ reason: external_exports.string().optional(),
15584
15588
  parameters: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
15585
15589
  timeout: external_exports.number(),
15586
15590
  startedAt: external_exports.string(),
@@ -15888,7 +15892,13 @@ var stepSkipEventSchema = external_exports.object({
15888
15892
  error: external_exports.string().optional(),
15889
15893
  skippedAt: external_exports.string()
15890
15894
  });
15891
- var stepAwaitEventSchema = external_exports.object({ ...baseFlowEvent, type: external_exports.literal("step_await") }).passthrough();
15895
+ var stepAwaitEventSchema = external_exports.object({
15896
+ ...baseFlowEvent,
15897
+ type: external_exports.literal("step_await"),
15898
+ // Agent-authored justification for an approval-gated tool call
15899
+ // (awaitReason === 'approval_required'); see agentApprovalStartEventSchema.
15900
+ reason: external_exports.string().optional()
15901
+ }).passthrough();
15892
15902
  var toolStartEventSchema = external_exports.object({
15893
15903
  ...baseFlowEvent,
15894
15904
  type: external_exports.literal("tool_start"),
@@ -16215,7 +16225,12 @@ var approvalConfigSchema = external_exports.object({
16215
16225
  * false/undefined: no approval required (default) */
16216
16226
  require: external_exports.union([external_exports.array(external_exports.string()), external_exports.boolean()]).optional(),
16217
16227
  /** Timeout in ms for approval response (default: 300000 = 5 min) */
16218
- timeout: external_exports.number().optional()
16228
+ timeout: external_exports.number().optional(),
16229
+ /** Whether to ask the model for a per-call justification on approval-gated
16230
+ * tools by injecting a reserved optional `_approvalReason` string into the
16231
+ * model-visible parameters schema. The value is stripped before the tool
16232
+ * executes and surfaced to the approver. Default: true (opt out with false). */
16233
+ requestReason: external_exports.boolean().optional()
16219
16234
  });
16220
16235
  var toolSearchConfigSchema = external_exports.object({
16221
16236
  /** Explicit opt-in/out. When omitted, auto-activates if tool count >= threshold. */
@@ -33318,6 +33333,9 @@ var MODEL_FAMILY_PROVIDER_IDS = {
33318
33333
  "claude-4-sonnet": {
33319
33334
  "vercel": "anthropic/claude-4-sonnet"
33320
33335
  },
33336
+ "claude-fable-5": {
33337
+ "vercel": "anthropic/claude-fable-5"
33338
+ },
33321
33339
  "claude-haiku-4-5": {
33322
33340
  "anthropic": "claude-haiku-4-5-20251001",
33323
33341
  "vercel": "anthropic/claude-haiku-4.5"
@@ -34137,6 +34155,7 @@ var MODEL_FAMILY_PROVIDER_IDS = {
34137
34155
  "vercel": "minimax/minimax-m2.5-highspeed"
34138
34156
  },
34139
34157
  "minimax-m2-7": {
34158
+ "general-compute": "general-compute/minimax-m2.7",
34140
34159
  "vercel": "minimax/minimax-m2.7"
34141
34160
  },
34142
34161
  "minimax-m2-7-highspeed": {
@@ -34155,6 +34174,7 @@ var MODEL_FAMILY_PROVIDER_IDS = {
34155
34174
  "vercel": "minimax/minimax-m2.5-highspeed"
34156
34175
  },
34157
34176
  "minimax-m2.7": {
34177
+ "general-compute": "general-compute/minimax-m2.7",
34158
34178
  "vercel": "minimax/minimax-m2.7"
34159
34179
  },
34160
34180
  "minimax-m2.7-highspeed": {
@@ -34565,7 +34585,7 @@ var PLATFORM_KEY_PROVIDER_MAP = {
34565
34585
  "mock": false
34566
34586
  };
34567
34587
  var PLATFORM_KEY_PROVIDERS = new Set(
34568
- Object.entries(PLATFORM_KEY_PROVIDER_MAP).filter(([, v2]) => v2).map(([k]) => k)
34588
+ Object.entries(PLATFORM_KEY_PROVIDER_MAP).filter(([, v2]) => v2).map(([k2]) => k2)
34569
34589
  );
34570
34590
  var MANUAL_PROVIDER_MAP_OVERRIDES = {
34571
34591
  // Bedrock uses different model ID format
@@ -35539,7 +35559,11 @@ var agentRuntimeConfigSchema = external_exports.object({
35539
35559
  toolCallStrategy: external_exports.enum(["auto", "required", "none"]).optional(),
35540
35560
  approval: external_exports.object({
35541
35561
  require: external_exports.union([external_exports.array(external_exports.string()), external_exports.boolean()]),
35542
- timeout: external_exports.number().optional()
35562
+ timeout: external_exports.number().optional(),
35563
+ /** Opt out of agent-supplied approval reasons (`_approvalReason`
35564
+ * schema injection). Default: true. Mirrors approvalConfigSchema
35565
+ * in tool-types.ts. */
35566
+ requestReason: external_exports.boolean().optional()
35543
35567
  }).optional(),
35544
35568
  perToolLimits: external_exports.record(
35545
35569
  external_exports.string(),
@@ -35638,10 +35662,9 @@ var FULL_PRODUCT_OBJECT_VERSION_1_1 = "1.1";
35638
35662
  var FULL_PRODUCT_OBJECT_VERSION_2_0 = "2.0";
35639
35663
  var createPolicySchema = external_exports.enum(["create", "skip", "manual"]).optional();
35640
35664
  var flowStepSchema = external_exports.object({
35641
- type: external_exports.string().refine(
35642
- (t) => FLOW_STEP_TYPES.includes(t),
35643
- { message: "Invalid flow step type" }
35644
- ),
35665
+ type: external_exports.string().refine((t) => FLOW_STEP_TYPES.includes(t), {
35666
+ message: "Invalid flow step type"
35667
+ }),
35645
35668
  name: external_exports.string().min(1, "Step name is required"),
35646
35669
  config: external_exports.record(external_exports.string(), external_exports.any()).default({}),
35647
35670
  order: external_exports.number().int().nonnegative().optional(),
@@ -35706,13 +35729,15 @@ var agentVoiceConfigSchema = external_exports.object({
35706
35729
  });
35707
35730
  var agentErrorHandlingSchema = external_exports.object({
35708
35731
  onError: external_exports.enum(["fail", "continue", "fallback"]).optional(),
35709
- fallbacks: external_exports.array(external_exports.object({
35710
- type: external_exports.enum(["retry", "model"]),
35711
- model: external_exports.string().optional(),
35712
- temperature: external_exports.number().min(0).max(2).optional(),
35713
- maxTokens: external_exports.number().int().positive().optional(),
35714
- delay: external_exports.number().min(0).max(6e4).optional()
35715
- })).optional()
35732
+ fallbacks: external_exports.array(
35733
+ external_exports.object({
35734
+ type: external_exports.enum(["retry", "model"]),
35735
+ model: external_exports.string().optional(),
35736
+ temperature: external_exports.number().min(0).max(2).optional(),
35737
+ maxTokens: external_exports.number().int().positive().optional(),
35738
+ delay: external_exports.number().min(0).max(6e4).optional()
35739
+ })
35740
+ ).optional()
35716
35741
  });
35717
35742
  var agentArtifactsConfigSchema = external_exports.object({
35718
35743
  enabled: external_exports.literal(true),
@@ -35737,24 +35762,32 @@ var agentMcpServerSchema = external_exports.object({
35737
35762
  var agentToolsConfigSchema2 = external_exports.object({
35738
35763
  toolIds: external_exports.array(external_exports.string()).optional(),
35739
35764
  toolConfigs: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.any())).optional(),
35740
- runtimeTools: external_exports.array(external_exports.object({
35741
- name: external_exports.string().min(1),
35742
- description: external_exports.string().optional(),
35743
- toolType: external_exports.enum(["flow", "custom", "external", "local", "subagent"]).optional(),
35744
- parametersSchema: external_exports.record(external_exports.string(), external_exports.any()).optional(),
35745
- config: external_exports.record(external_exports.string(), external_exports.any())
35746
- })).optional(),
35765
+ runtimeTools: external_exports.array(
35766
+ external_exports.object({
35767
+ name: external_exports.string().min(1),
35768
+ description: external_exports.string().optional(),
35769
+ toolType: external_exports.enum(["flow", "custom", "external", "local", "subagent"]).optional(),
35770
+ parametersSchema: external_exports.record(external_exports.string(), external_exports.any()).optional(),
35771
+ config: external_exports.record(external_exports.string(), external_exports.any())
35772
+ })
35773
+ ).optional(),
35747
35774
  mcpServers: external_exports.array(agentMcpServerSchema).optional(),
35748
35775
  maxToolCalls: external_exports.number().int().min(1).max(100).optional(),
35749
35776
  toolCallStrategy: external_exports.enum(["auto", "required", "none"]).optional(),
35750
35777
  approval: external_exports.object({
35751
35778
  require: external_exports.union([external_exports.array(external_exports.string()), external_exports.boolean()]),
35752
- timeout: external_exports.number().positive().optional()
35779
+ timeout: external_exports.number().positive().optional(),
35780
+ /** Opt out of agent-supplied approval reasons (`_approvalReason` schema
35781
+ * injection). Default: true. Mirrors approvalConfigSchema in tool-types.ts. */
35782
+ requestReason: external_exports.boolean().optional()
35753
35783
  }).optional(),
35754
- perToolLimits: external_exports.record(external_exports.string(), external_exports.object({
35755
- maxCalls: external_exports.number().int().positive().optional(),
35756
- required: external_exports.boolean().optional()
35757
- })).optional(),
35784
+ perToolLimits: external_exports.record(
35785
+ external_exports.string(),
35786
+ external_exports.object({
35787
+ maxCalls: external_exports.number().int().positive().optional(),
35788
+ required: external_exports.boolean().optional()
35789
+ })
35790
+ ).optional(),
35758
35791
  subagentConfig: agentSubagentConfigSchema2.optional(),
35759
35792
  codeModeConfig: external_exports.object({
35760
35793
  toolPool: external_exports.array(external_exports.string()).optional(),
@@ -35937,10 +35970,12 @@ var recordSchema = external_exports.object({
35937
35970
  name: external_exports.string().optional(),
35938
35971
  metadata: external_exports.record(external_exports.string(), external_exports.any()).optional(),
35939
35972
  metadataSchema: external_exports.record(external_exports.string(), external_exports.any()).optional(),
35940
- messages: external_exports.array(external_exports.object({
35941
- role: external_exports.string().min(1),
35942
- content: external_exports.string()
35943
- })).optional(),
35973
+ messages: external_exports.array(
35974
+ external_exports.object({
35975
+ role: external_exports.string().min(1),
35976
+ content: external_exports.string()
35977
+ })
35978
+ ).optional(),
35944
35979
  createPolicy: createPolicySchema
35945
35980
  });
35946
35981
  var scheduleSchema = external_exports.object({
@@ -35953,10 +35988,12 @@ var scheduleSchema = external_exports.object({
35953
35988
  runAt: external_exports.string().datetime({ offset: true }).optional(),
35954
35989
  recordType: external_exports.string().optional(),
35955
35990
  recordFilter: external_exports.record(external_exports.string(), external_exports.any()).optional(),
35956
- messages: external_exports.array(external_exports.object({
35957
- role: external_exports.string().min(1),
35958
- content: external_exports.string()
35959
- })).optional(),
35991
+ messages: external_exports.array(
35992
+ external_exports.object({
35993
+ role: external_exports.string().min(1),
35994
+ content: external_exports.string()
35995
+ })
35996
+ ).optional(),
35960
35997
  executionOptions: external_exports.record(external_exports.string(), external_exports.any()).optional(),
35961
35998
  enabled: external_exports.boolean().optional(),
35962
35999
  createPolicy: createPolicySchema
@@ -35982,6 +36019,30 @@ var metaSchema = external_exports.object({
35982
36019
  generatorVersion: external_exports.string().min(1),
35983
36020
  planHash: external_exports.string().min(1)
35984
36021
  });
36022
+ var internalDocResourceSchema = external_exports.object({
36023
+ /** Open discriminator, e.g. 'doc' | 'example' | 'reference' | 'link'. Kept
36024
+ * as a free string (not an enum) so new kinds don't require a migration. */
36025
+ type: external_exports.string().min(1),
36026
+ /** Short human-readable label for the resource. */
36027
+ title: external_exports.string().min(1),
36028
+ /** Optional external/internal URL pointing at the resource. */
36029
+ url: external_exports.string().optional(),
36030
+ /** Optional inline body (markdown). Indexable as a retrieval chunk. */
36031
+ content: external_exports.string().optional()
36032
+ });
36033
+ var internalDocsSchema = external_exports.object({
36034
+ /** Long-form builder notes (markdown). The primary indexable body — cover
36035
+ * rationale, design choices, best practices, and implementation notes here.
36036
+ * (Kept as one body for now; may be promoted to typed sub-fields later —
36037
+ * any such additions must stay optional to remain backward-compatible.) */
36038
+ content: external_exports.string().optional(),
36039
+ /** Freeform tags to power future indexing / search / retrieval / faceting,
36040
+ * e.g. ['support', 'rag', 'beta']. */
36041
+ tags: external_exports.array(external_exports.string()).optional(),
36042
+ /** Linked knowledge resources (docs, examples, references). Extension point
36043
+ * for a broader template knowledge/resource system; grows additively. */
36044
+ resources: external_exports.array(internalDocResourceSchema).optional()
36045
+ });
35985
36046
  var fullProductObjectSchema = external_exports.object({
35986
36047
  version: external_exports.enum([
35987
36048
  FULL_PRODUCT_OBJECT_VERSION_1_0,
@@ -35992,7 +36053,11 @@ var fullProductObjectSchema = external_exports.object({
35992
36053
  name: external_exports.string().min(1),
35993
36054
  description: external_exports.string().min(1),
35994
36055
  icon: external_exports.string().optional(),
35995
- metadata: external_exports.record(external_exports.string(), external_exports.any()).optional()
36056
+ metadata: external_exports.record(external_exports.string(), external_exports.any()).optional(),
36057
+ // Internal builder docs (NON user-facing). See `internalDocsSchema`.
36058
+ // Never surfaced to end users / agents by default; safe to drop when
36059
+ // materializing an end-user-facing view of the product.
36060
+ internalDocs: internalDocsSchema.optional()
35996
36061
  }),
35997
36062
  capabilities: external_exports.array(capabilitySchema).max(50),
35998
36063
  tools: external_exports.array(toolSchema).max(100),
@@ -36375,15 +36440,21 @@ function validateConnectivity(fpo) {
36375
36440
  reachableCapIds.add(route.capabilityId);
36376
36441
  }
36377
36442
  }
36443
+ for (const schedule of fpo.schedules ?? []) {
36444
+ const capabilityId = schedule && typeof schedule === "object" ? schedule.capabilityId : void 0;
36445
+ if (typeof capabilityId === "string") {
36446
+ reachableCapIds.add(capabilityId);
36447
+ }
36448
+ }
36378
36449
  for (const [i, cap] of fpo.capabilities.entries()) {
36379
36450
  if (!reachableCapIds.has(cap.id)) {
36380
36451
  result.warnings.push(
36381
36452
  createIssue(
36382
36453
  "warning",
36383
36454
  "UNREACHABLE_CAPABILITY",
36384
- `Capability "${cap.id}" is not referenced by any surface route`,
36455
+ `Capability "${cap.id}" is not referenced by any surface route or schedule`,
36385
36456
  `capabilities[${i}]`,
36386
- "Add a surface route or remove the capability"
36457
+ "Add a surface route, add a top-level schedule, or remove the capability"
36387
36458
  )
36388
36459
  );
36389
36460
  }
@@ -36712,7 +36783,14 @@ var fullProductObjectTemplateSchema = external_exports.object({
36712
36783
  productObject: fullProductObjectSchema,
36713
36784
  template: external_exports.object({
36714
36785
  variables: external_exports.array(fpoTemplateVariableSchema).max(50)
36715
- })
36786
+ }),
36787
+ // Internal builder docs for THIS template (NON user-facing): why the
36788
+ // template is shaped this way, design choices, best practices, and
36789
+ // implementation notes. Distinct from `productObject.product.internalDocs`
36790
+ // (which travels with the materialized product) — this documents the
36791
+ // template/authoring intent itself. Never surfaced to end users / agents
36792
+ // by default. See `internalDocsSchema`.
36793
+ internalDocs: internalDocsSchema.optional()
36716
36794
  }).superRefine((doc, ctx) => {
36717
36795
  const hasVariables = doc.template.variables.length > 0;
36718
36796
  const hasPendingSecretTool = doc.productObject.tools.some(
@@ -37389,7 +37467,13 @@ var PLATFORM_CATALOG = {
37389
37467
  var SURFACE_TYPE_METADATA = {
37390
37468
  chat: {
37391
37469
  description: "Website widget, support bots, conversational interfaces. Uses Persona and can optionally accept WebMCP page tools discovered from document.modelContext.",
37392
- useCases: ["customer support", "onboarding", "internal tools", "FAQ bots", "page-aware assistants"],
37470
+ useCases: [
37471
+ "customer support",
37472
+ "onboarding",
37473
+ "internal tools",
37474
+ "FAQ bots",
37475
+ "page-aware assistants"
37476
+ ],
37393
37477
  examples: [
37394
37478
  "Support chatbot",
37395
37479
  "Sales assistant widget",
@@ -37546,9 +37630,17 @@ var SURFACE_TYPE_METADATA = {
37546
37630
  behaviorTypeRef: "runtype://types/surface-configs"
37547
37631
  },
37548
37632
  schedule: {
37549
- description: "Cron jobs and periodic processing",
37550
- useCases: ["scheduled reports", "data cleanup", "periodic monitoring"],
37551
- examples: ["Daily report generator", "Weekly data sync", "Hourly health check"],
37633
+ description: "Optional management/presentation surface for scheduled jobs; executable cron or one-time triggers live in top-level schedules[] or Schedule records",
37634
+ useCases: [
37635
+ "schedule management UI",
37636
+ "scheduled report overview",
37637
+ "periodic monitoring dashboard"
37638
+ ],
37639
+ examples: [
37640
+ "Daily report schedule manager",
37641
+ "Weekly data sync overview",
37642
+ "Hourly health check monitor"
37643
+ ],
37552
37644
  traits: {
37553
37645
  streaming: "none",
37554
37646
  messagesMutable: false,
@@ -38544,7 +38636,11 @@ var AgentInputSchema = external_exports.object({
38544
38636
  ).optional(),
38545
38637
  approval: external_exports.object({
38546
38638
  require: external_exports.union([external_exports.array(external_exports.string()), external_exports.boolean()]),
38547
- timeout: external_exports.number().optional()
38639
+ timeout: external_exports.number().optional(),
38640
+ /** Opt out of agent-supplied approval reasons (`_approvalReason`
38641
+ * schema injection). Default: true. Mirrors approvalConfigSchema
38642
+ * in tool-types.ts. */
38643
+ requestReason: external_exports.boolean().optional()
38548
38644
  }).optional(),
38549
38645
  subagentConfig: VirtualAgentSubagentConfigSchema.optional(),
38550
38646
  codeModeConfig: external_exports.object({
@@ -41608,8 +41704,8 @@ configCommand.command("get [key]").description("Get configuration value").action
41608
41704
  const allConfig = config2.store;
41609
41705
  if (Object.keys(allConfig).length > 0) {
41610
41706
  console.log(chalk9.cyan("Current Configuration:"));
41611
- for (const [k, v2] of Object.entries(allConfig)) {
41612
- console.log(` ${chalk9.green(k)}: ${v2}`);
41707
+ for (const [k2, v2] of Object.entries(allConfig)) {
41708
+ console.log(` ${chalk9.green(k2)}: ${v2}`);
41613
41709
  }
41614
41710
  } else {
41615
41711
  console.log(chalk9.gray("No configuration set"));
@@ -43001,7 +43097,7 @@ Keys (${keys.length}):`));
43001
43097
  const itemSummary = items.length === 0 ? "No items" : items.map(
43002
43098
  (i) => `${i.exposedName || i.capabilityName || i.capabilityId}${i.isEntryPoint ? " (entry point)" : ""}`
43003
43099
  ).join("\n");
43004
- const keySummary = keys.length === 0 ? "No keys" : keys.map((k) => `${k.name ?? "(unnamed)"} ${k.keyPrefix ?? ""}`.trim()).join("\n");
43100
+ const keySummary = keys.length === 0 ? "No keys" : keys.map((k2) => `${k2.name ?? "(unnamed)"} ${k2.keyPrefix ?? ""}`.trim()).join("\n");
43005
43101
  setResultNode(
43006
43102
  React9.createElement(EntityCard, {
43007
43103
  fields: [
@@ -43177,7 +43273,7 @@ logsCommand.command("stats").description("Aggregate log stats: totals, counts by
43177
43273
  const formatCounts = (counts) => {
43178
43274
  const entries = Object.entries(counts);
43179
43275
  if (entries.length === 0) return "(none)";
43180
- return entries.map(([k, v2]) => `${k}=${v2}`).join(", ");
43276
+ return entries.map(([k2, v2]) => `${k2}=${v2}`).join(", ");
43181
43277
  };
43182
43278
  if (!isTTY(options) || options.json) {
43183
43279
  try {
@@ -49086,11 +49182,11 @@ function compactRawStreamEventForCopy(event) {
49086
49182
  data = JSON.parse(JSON.stringify(event.listData, stringCompactionReplacer));
49087
49183
  } else {
49088
49184
  data = {};
49089
- for (const [k, v2] of Object.entries(event.data)) {
49090
- if (STREAM_EVENT_HEAVY_KEYS.has(k)) {
49091
- data[k] = compactHeavyField(v2);
49185
+ for (const [k2, v2] of Object.entries(event.data)) {
49186
+ if (STREAM_EVENT_HEAVY_KEYS.has(k2)) {
49187
+ data[k2] = compactHeavyField(v2);
49092
49188
  } else {
49093
- data[k] = compactJsonLike(v2);
49189
+ data[k2] = compactJsonLike(v2);
49094
49190
  }
49095
49191
  }
49096
49192
  }
@@ -57087,10 +57183,10 @@ apiKeysCommand.command("list").description("List your API keys").option("--json"
57087
57183
  total,
57088
57184
  emptyMessage: "No API keys found",
57089
57185
  renderCard: (item) => {
57090
- const k = item;
57091
- const prefix = k.prefix ? ` (${k.prefix}...)` : "";
57092
- const lastUsed = k.lastUsedAt ? ` last used: ${k.lastUsedAt}` : "";
57093
- return React20.createElement(Text32, null, ` ${k.id} ${k.name}${prefix}${lastUsed}`);
57186
+ const k2 = item;
57187
+ const prefix = k2.prefix ? ` (${k2.prefix}...)` : "";
57188
+ const lastUsed = k2.lastUsedAt ? ` last used: ${k2.lastUsedAt}` : "";
57189
+ return React20.createElement(Text32, null, ` ${k2.id} ${k2.name}${prefix}${lastUsed}`);
57094
57190
  }
57095
57191
  });
57096
57192
  };
@@ -57871,8 +57967,8 @@ import { execFileSync } from "child_process";
57871
57967
  // src/lib/persona-init.ts
57872
57968
  init_credential_store();
57873
57969
 
57874
- // ../../node_modules/.pnpm/@runtypelabs+persona@3.29.1/node_modules/@runtypelabs/persona/dist/codegen.js
57875
- 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" } };
57970
+ // ../../node_modules/.pnpm/@runtypelabs+persona@3.31.0/node_modules/@runtypelabs/persona/dist/codegen.js
57971
+ 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" } };
57876
57972
  var c = S.version;
57877
57973
  function u(e) {
57878
57974
  if (e !== void 0) return typeof e == "string" ? e : Array.isArray(e) ? `[${e.map((r) => r.toString()).join(", ")}]` : e.toString();
@@ -58035,7 +58131,7 @@ function I(e, r = "esm", n) {
58035
58131
  let s = { ...e };
58036
58132
  delete s.postprocessMessage, delete s.initialMessages;
58037
58133
  let o = n ? { ...n, hooks: T(n.hooks) } : void 0;
58038
- 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);
58134
+ 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);
58039
58135
  }
58040
58136
  function W(e, r) {
58041
58137
  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: {"];
@@ -58131,11 +58227,11 @@ function P(e) {
58131
58227
  }
58132
58228
  return s;
58133
58229
  }
58134
- function D(e, r) {
58230
+ function k(e, r) {
58135
58231
  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;");
58136
58232
  return `<script src="https://cdn.jsdelivr.net/npm/@runtypelabs/persona@${c}/dist/install.global.js" data-config='${t}'></script>`;
58137
58233
  }
58138
- function F(e, r) {
58234
+ function D(e, r) {
58139
58235
  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: {"];
58140
58236
  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]) => {
58141
58237
  t.push(` ${i}: "${a}",`);
@@ -58152,7 +58248,7 @@ function F(e, r) {
58152
58248
  }), 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(`
58153
58249
  `);
58154
58250
  }
58155
- function J(e, r) {
58251
+ function F(e, r) {
58156
58252
  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(`
58157
58253
  `).map((i, a) => a === 0 ? i : " " + i).join(`
58158
58254
  `)};`, "", " // 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);", ""];
@@ -59547,7 +59643,7 @@ function categoryBadge(category, useColor) {
59547
59643
  return chalk35.magenta(`[${category}]`);
59548
59644
  }
59549
59645
  function formatTailData(data) {
59550
- return Object.entries(data).map(([k, v2]) => `${k}=${typeof v2 === "string" ? v2 : JSON.stringify(v2)}`).join(" ");
59646
+ return Object.entries(data).map(([k2, v2]) => `${k2}=${typeof v2 === "string" ? v2 : JSON.stringify(v2)}`).join(" ");
59551
59647
  }
59552
59648
  function formatContextIds(event, useColor) {
59553
59649
  const ids = [];
@@ -59635,9 +59731,9 @@ async function createSession(apiUrl, apiKey, filters) {
59635
59731
  level: "levels",
59636
59732
  category: "categories"
59637
59733
  };
59638
- for (const [k, v2] of Object.entries(filters)) {
59639
- if (v2 !== void 0 && arrayFields[k]) {
59640
- filter[arrayFields[k]] = [v2];
59734
+ for (const [k2, v2] of Object.entries(filters)) {
59735
+ if (v2 !== void 0 && arrayFields[k2]) {
59736
+ filter[arrayFields[k2]] = [v2];
59641
59737
  }
59642
59738
  }
59643
59739
  const body = Object.keys(filter).length > 0 ? { filter } : {};
@@ -59691,7 +59787,7 @@ async function runTail(options) {
59691
59787
  category: options.category
59692
59788
  };
59693
59789
  const useColor = options.color;
59694
- const activeFilters = Object.entries(filters).filter(([, v2]) => v2 !== void 0).map(([k, v2]) => `${k}=${v2}`);
59790
+ const activeFilters = Object.entries(filters).filter(([, v2]) => v2 !== void 0).map(([k2, v2]) => `${k2}=${v2}`);
59695
59791
  process.stderr.write(
59696
59792
  (useColor ? chalk35.gray(
59697
59793
  `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.16",
3
+ "version": "2.16.18",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,13 +21,13 @@
21
21
  "micromatch": "^4.0.8",
22
22
  "rosie-skills": "0.8.1",
23
23
  "yaml": "^2.9.0",
24
- "@runtypelabs/sdk": "4.7.1",
25
24
  "@runtypelabs/ink-components": "0.3.2",
25
+ "@runtypelabs/sdk": "4.8.0",
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.16.0"
40
+ "@runtypelabs/shared": "1.17.1"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=22.0.0"