@runtypelabs/cli 2.16.17 → 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.
- package/dist/index.js +69 -69
- package/package.json +3 -3
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
|
|
1453
|
-
if (!(
|
|
1454
|
-
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(([
|
|
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((
|
|
1876
|
-
return shape[
|
|
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(([
|
|
2154
|
-
return Number.isNaN(Number.parseInt(
|
|
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
|
|
3863
|
-
if (!def.shape?.[
|
|
3864
|
-
throw new Error(`Invalid element at key "${
|
|
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
|
|
3986
|
-
return `shape[${
|
|
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
|
|
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 (${
|
|
4005
|
+
if (${k2} in input) {
|
|
4006
4006
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
4007
4007
|
...iss,
|
|
4008
|
-
path: iss.path ? [${
|
|
4008
|
+
path: iss.path ? [${k2}, ...iss.path] : [${k2}]
|
|
4009
4009
|
})));
|
|
4010
4010
|
}
|
|
4011
4011
|
}
|
|
4012
4012
|
|
|
4013
4013
|
if (${id}.value === undefined) {
|
|
4014
|
-
if (${
|
|
4015
|
-
newResult[${
|
|
4014
|
+
if (${k2} in input) {
|
|
4015
|
+
newResult[${k2}] = undefined;
|
|
4016
4016
|
}
|
|
4017
4017
|
} else {
|
|
4018
|
-
newResult[${
|
|
4018
|
+
newResult[${k2}] = ${id}.value;
|
|
4019
4019
|
}
|
|
4020
4020
|
|
|
4021
4021
|
`);
|
|
4022
4022
|
} else if (!isOptionalIn) {
|
|
4023
4023
|
doc.write(`
|
|
4024
|
-
const ${id}_present = ${
|
|
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 ? [${
|
|
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: [${
|
|
4036
|
+
path: [${k2}]
|
|
4037
4037
|
});
|
|
4038
4038
|
}
|
|
4039
4039
|
|
|
4040
4040
|
if (${id}_present) {
|
|
4041
4041
|
if (${id}.value === undefined) {
|
|
4042
|
-
newResult[${
|
|
4042
|
+
newResult[${k2}] = undefined;
|
|
4043
4043
|
} else {
|
|
4044
|
-
newResult[${
|
|
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 ? [${
|
|
4054
|
+
path: iss.path ? [${k2}, ...iss.path] : [${k2}]
|
|
4055
4055
|
})));
|
|
4056
4056
|
}
|
|
4057
4057
|
|
|
4058
4058
|
if (${id}.value === undefined) {
|
|
4059
|
-
if (${
|
|
4060
|
-
newResult[${
|
|
4059
|
+
if (${k2} in input) {
|
|
4060
|
+
newResult[${k2}] = undefined;
|
|
4061
4061
|
}
|
|
4062
4062
|
} else {
|
|
4063
|
-
newResult[${
|
|
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 [
|
|
4233
|
-
if (!propValues[
|
|
4234
|
-
propValues[
|
|
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[
|
|
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
|
|
4355
|
-
if (!unrecKeys.has(
|
|
4356
|
-
unrecKeys.set(
|
|
4357
|
-
unrecKeys.get(
|
|
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
|
|
4366
|
-
if (!unrecKeys.has(
|
|
4367
|
-
unrecKeys.set(
|
|
4368
|
-
unrecKeys.get(
|
|
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(([
|
|
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((
|
|
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
|
|
14419
|
-
|
|
14418
|
+
const k2 = clone(keyType);
|
|
14419
|
+
k2._zod.values = void 0;
|
|
14420
14420
|
return new ZodRecord({
|
|
14421
14421
|
type: "record",
|
|
14422
|
-
keyType:
|
|
14422
|
+
keyType: k2,
|
|
14423
14423
|
valueType,
|
|
14424
14424
|
...util_exports.normalizeParams(params)
|
|
14425
14425
|
});
|
|
@@ -34585,7 +34585,7 @@ var PLATFORM_KEY_PROVIDER_MAP = {
|
|
|
34585
34585
|
"mock": false
|
|
34586
34586
|
};
|
|
34587
34587
|
var PLATFORM_KEY_PROVIDERS = new Set(
|
|
34588
|
-
Object.entries(PLATFORM_KEY_PROVIDER_MAP).filter(([, v2]) => v2).map(([
|
|
34588
|
+
Object.entries(PLATFORM_KEY_PROVIDER_MAP).filter(([, v2]) => v2).map(([k2]) => k2)
|
|
34589
34589
|
);
|
|
34590
34590
|
var MANUAL_PROVIDER_MAP_OVERRIDES = {
|
|
34591
34591
|
// Bedrock uses different model ID format
|
|
@@ -41704,8 +41704,8 @@ configCommand.command("get [key]").description("Get configuration value").action
|
|
|
41704
41704
|
const allConfig = config2.store;
|
|
41705
41705
|
if (Object.keys(allConfig).length > 0) {
|
|
41706
41706
|
console.log(chalk9.cyan("Current Configuration:"));
|
|
41707
|
-
for (const [
|
|
41708
|
-
console.log(` ${chalk9.green(
|
|
41707
|
+
for (const [k2, v2] of Object.entries(allConfig)) {
|
|
41708
|
+
console.log(` ${chalk9.green(k2)}: ${v2}`);
|
|
41709
41709
|
}
|
|
41710
41710
|
} else {
|
|
41711
41711
|
console.log(chalk9.gray("No configuration set"));
|
|
@@ -43097,7 +43097,7 @@ Keys (${keys.length}):`));
|
|
|
43097
43097
|
const itemSummary = items.length === 0 ? "No items" : items.map(
|
|
43098
43098
|
(i) => `${i.exposedName || i.capabilityName || i.capabilityId}${i.isEntryPoint ? " (entry point)" : ""}`
|
|
43099
43099
|
).join("\n");
|
|
43100
|
-
const keySummary = keys.length === 0 ? "No keys" : keys.map((
|
|
43100
|
+
const keySummary = keys.length === 0 ? "No keys" : keys.map((k2) => `${k2.name ?? "(unnamed)"} ${k2.keyPrefix ?? ""}`.trim()).join("\n");
|
|
43101
43101
|
setResultNode(
|
|
43102
43102
|
React9.createElement(EntityCard, {
|
|
43103
43103
|
fields: [
|
|
@@ -43273,7 +43273,7 @@ logsCommand.command("stats").description("Aggregate log stats: totals, counts by
|
|
|
43273
43273
|
const formatCounts = (counts) => {
|
|
43274
43274
|
const entries = Object.entries(counts);
|
|
43275
43275
|
if (entries.length === 0) return "(none)";
|
|
43276
|
-
return entries.map(([
|
|
43276
|
+
return entries.map(([k2, v2]) => `${k2}=${v2}`).join(", ");
|
|
43277
43277
|
};
|
|
43278
43278
|
if (!isTTY(options) || options.json) {
|
|
43279
43279
|
try {
|
|
@@ -49182,11 +49182,11 @@ function compactRawStreamEventForCopy(event) {
|
|
|
49182
49182
|
data = JSON.parse(JSON.stringify(event.listData, stringCompactionReplacer));
|
|
49183
49183
|
} else {
|
|
49184
49184
|
data = {};
|
|
49185
|
-
for (const [
|
|
49186
|
-
if (STREAM_EVENT_HEAVY_KEYS.has(
|
|
49187
|
-
data[
|
|
49185
|
+
for (const [k2, v2] of Object.entries(event.data)) {
|
|
49186
|
+
if (STREAM_EVENT_HEAVY_KEYS.has(k2)) {
|
|
49187
|
+
data[k2] = compactHeavyField(v2);
|
|
49188
49188
|
} else {
|
|
49189
|
-
data[
|
|
49189
|
+
data[k2] = compactJsonLike(v2);
|
|
49190
49190
|
}
|
|
49191
49191
|
}
|
|
49192
49192
|
}
|
|
@@ -57183,10 +57183,10 @@ apiKeysCommand.command("list").description("List your API keys").option("--json"
|
|
|
57183
57183
|
total,
|
|
57184
57184
|
emptyMessage: "No API keys found",
|
|
57185
57185
|
renderCard: (item) => {
|
|
57186
|
-
const
|
|
57187
|
-
const prefix =
|
|
57188
|
-
const lastUsed =
|
|
57189
|
-
return React20.createElement(Text32, null, ` ${
|
|
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}`);
|
|
57190
57190
|
}
|
|
57191
57191
|
});
|
|
57192
57192
|
};
|
|
@@ -57967,8 +57967,8 @@ import { execFileSync } from "child_process";
|
|
|
57967
57967
|
// src/lib/persona-init.ts
|
|
57968
57968
|
init_credential_store();
|
|
57969
57969
|
|
|
57970
|
-
// ../../node_modules/.pnpm/@runtypelabs+persona@3.
|
|
57971
|
-
var S = { name: "@runtypelabs/persona", version: "3.
|
|
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" } };
|
|
57972
57972
|
var c = S.version;
|
|
57973
57973
|
function u(e) {
|
|
57974
57974
|
if (e !== void 0) return typeof e == "string" ? e : Array.isArray(e) ? `[${e.map((r) => r.toString()).join(", ")}]` : e.toString();
|
|
@@ -58131,7 +58131,7 @@ function I(e, r = "esm", n) {
|
|
|
58131
58131
|
let s = { ...e };
|
|
58132
58132
|
delete s.postprocessMessage, delete s.initialMessages;
|
|
58133
58133
|
let o = n ? { ...n, hooks: T(n.hooks) } : void 0;
|
|
58134
|
-
return r === "esm" ? W(s, o) : r === "script-installer" ?
|
|
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);
|
|
58135
58135
|
}
|
|
58136
58136
|
function W(e, r) {
|
|
58137
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: {"];
|
|
@@ -58227,11 +58227,11 @@ function P(e) {
|
|
|
58227
58227
|
}
|
|
58228
58228
|
return s;
|
|
58229
58229
|
}
|
|
58230
|
-
function
|
|
58230
|
+
function k(e, r) {
|
|
58231
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, "'");
|
|
58232
58232
|
return `<script src="https://cdn.jsdelivr.net/npm/@runtypelabs/persona@${c}/dist/install.global.js" data-config='${t}'></script>`;
|
|
58233
58233
|
}
|
|
58234
|
-
function
|
|
58234
|
+
function D(e, r) {
|
|
58235
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: {"];
|
|
58236
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]) => {
|
|
58237
58237
|
t.push(` ${i}: "${a}",`);
|
|
@@ -58248,7 +58248,7 @@ function F(e, r) {
|
|
|
58248
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(`
|
|
58249
58249
|
`);
|
|
58250
58250
|
}
|
|
58251
|
-
function
|
|
58251
|
+
function F(e, r) {
|
|
58252
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(`
|
|
58253
58253
|
`).map((i, a) => a === 0 ? i : " " + i).join(`
|
|
58254
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);", ""];
|
|
@@ -59643,7 +59643,7 @@ function categoryBadge(category, useColor) {
|
|
|
59643
59643
|
return chalk35.magenta(`[${category}]`);
|
|
59644
59644
|
}
|
|
59645
59645
|
function formatTailData(data) {
|
|
59646
|
-
return Object.entries(data).map(([
|
|
59646
|
+
return Object.entries(data).map(([k2, v2]) => `${k2}=${typeof v2 === "string" ? v2 : JSON.stringify(v2)}`).join(" ");
|
|
59647
59647
|
}
|
|
59648
59648
|
function formatContextIds(event, useColor) {
|
|
59649
59649
|
const ids = [];
|
|
@@ -59731,9 +59731,9 @@ async function createSession(apiUrl, apiKey, filters) {
|
|
|
59731
59731
|
level: "levels",
|
|
59732
59732
|
category: "categories"
|
|
59733
59733
|
};
|
|
59734
|
-
for (const [
|
|
59735
|
-
if (v2 !== void 0 && arrayFields[
|
|
59736
|
-
filter[arrayFields[
|
|
59734
|
+
for (const [k2, v2] of Object.entries(filters)) {
|
|
59735
|
+
if (v2 !== void 0 && arrayFields[k2]) {
|
|
59736
|
+
filter[arrayFields[k2]] = [v2];
|
|
59737
59737
|
}
|
|
59738
59738
|
}
|
|
59739
59739
|
const body = Object.keys(filter).length > 0 ? { filter } : {};
|
|
@@ -59787,7 +59787,7 @@ async function runTail(options) {
|
|
|
59787
59787
|
category: options.category
|
|
59788
59788
|
};
|
|
59789
59789
|
const useColor = options.color;
|
|
59790
|
-
const activeFilters = Object.entries(filters).filter(([, v2]) => v2 !== void 0).map(([
|
|
59790
|
+
const activeFilters = Object.entries(filters).filter(([, v2]) => v2 !== void 0).map(([k2, v2]) => `${k2}=${v2}`);
|
|
59791
59791
|
process.stderr.write(
|
|
59792
59792
|
(useColor ? chalk35.gray(
|
|
59793
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.
|
|
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",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/micromatch": "^4.0.9",
|
|
30
|
-
"@runtypelabs/persona": "3.
|
|
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.
|
|
40
|
+
"@runtypelabs/shared": "1.17.1"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=22.0.0"
|