retell-sync-cli 3.13.5 → 3.14.0
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/cli.js +1291 -985
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
8
13
|
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
9
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
22
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
23
|
for (let key of __getOwnPropNames(mod))
|
|
12
24
|
if (!__hasOwnProp.call(to, key))
|
|
13
25
|
__defProp(to, key, {
|
|
14
|
-
get: (
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
15
27
|
enumerable: true
|
|
16
28
|
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
17
31
|
return to;
|
|
18
32
|
};
|
|
19
33
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __returnValue = (v) => v;
|
|
35
|
+
function __exportSetter(name, newValue) {
|
|
36
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
37
|
+
}
|
|
20
38
|
var __export = (target, all) => {
|
|
21
39
|
for (var name in all)
|
|
22
40
|
__defProp(target, name, {
|
|
23
41
|
get: all[name],
|
|
24
42
|
enumerable: true,
|
|
25
43
|
configurable: true,
|
|
26
|
-
set: (
|
|
44
|
+
set: __exportSetter.bind(all, name)
|
|
27
45
|
});
|
|
28
46
|
};
|
|
29
47
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -2122,46 +2140,6 @@ var require_commander = __commonJS((exports) => {
|
|
|
2122
2140
|
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
2123
2141
|
});
|
|
2124
2142
|
|
|
2125
|
-
// ../../node_modules/.bun/cli-width@4.1.0/node_modules/cli-width/index.js
|
|
2126
|
-
var require_cli_width = __commonJS((exports, module) => {
|
|
2127
|
-
module.exports = cliWidth;
|
|
2128
|
-
function normalizeOpts(options) {
|
|
2129
|
-
const defaultOpts = {
|
|
2130
|
-
defaultWidth: 0,
|
|
2131
|
-
output: process.stdout,
|
|
2132
|
-
tty: __require("tty")
|
|
2133
|
-
};
|
|
2134
|
-
if (!options) {
|
|
2135
|
-
return defaultOpts;
|
|
2136
|
-
}
|
|
2137
|
-
Object.keys(defaultOpts).forEach(function(key) {
|
|
2138
|
-
if (!options[key]) {
|
|
2139
|
-
options[key] = defaultOpts[key];
|
|
2140
|
-
}
|
|
2141
|
-
});
|
|
2142
|
-
return options;
|
|
2143
|
-
}
|
|
2144
|
-
function cliWidth(options) {
|
|
2145
|
-
const opts = normalizeOpts(options);
|
|
2146
|
-
if (opts.output.getWindowSize) {
|
|
2147
|
-
return opts.output.getWindowSize()[0] || opts.defaultWidth;
|
|
2148
|
-
}
|
|
2149
|
-
if (opts.tty.getWindowSize) {
|
|
2150
|
-
return opts.tty.getWindowSize()[1] || opts.defaultWidth;
|
|
2151
|
-
}
|
|
2152
|
-
if (opts.output.columns) {
|
|
2153
|
-
return opts.output.columns;
|
|
2154
|
-
}
|
|
2155
|
-
if (process.env.CLI_WIDTH) {
|
|
2156
|
-
const width = parseInt(process.env.CLI_WIDTH, 10);
|
|
2157
|
-
if (!isNaN(width) && width !== 0) {
|
|
2158
|
-
return width;
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
return opts.defaultWidth;
|
|
2162
|
-
}
|
|
2163
|
-
});
|
|
2164
|
-
|
|
2165
2143
|
// ../../node_modules/.bun/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json
|
|
2166
2144
|
var require_boxes = __commonJS((exports, module) => {
|
|
2167
2145
|
module.exports = {
|
|
@@ -4574,14 +4552,14 @@ var require_bool = __commonJS((exports) => {
|
|
|
4574
4552
|
|
|
4575
4553
|
// ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
4576
4554
|
var require_stringifyNumber = __commonJS((exports) => {
|
|
4577
|
-
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
4555
|
+
function stringifyNumber({ format: format3, minFractionDigits, tag, value }) {
|
|
4578
4556
|
if (typeof value === "bigint")
|
|
4579
4557
|
return String(value);
|
|
4580
4558
|
const num = typeof value === "number" ? value : Number(value);
|
|
4581
4559
|
if (!isFinite(num))
|
|
4582
4560
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
4583
4561
|
let n7 = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
4584
|
-
if (!
|
|
4562
|
+
if (!format3 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n7)) {
|
|
4585
4563
|
let i2 = n7.indexOf(".");
|
|
4586
4564
|
if (i2 < 0) {
|
|
4587
4565
|
i2 = n7.length;
|
|
@@ -9235,7 +9213,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
9235
9213
|
}
|
|
9236
9214
|
return doc2;
|
|
9237
9215
|
}
|
|
9238
|
-
function
|
|
9216
|
+
function parse8(src, reviver, options) {
|
|
9239
9217
|
let _reviver = undefined;
|
|
9240
9218
|
if (typeof reviver === "function") {
|
|
9241
9219
|
_reviver = reviver;
|
|
@@ -9276,7 +9254,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
9276
9254
|
return value.toString(options);
|
|
9277
9255
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
9278
9256
|
}
|
|
9279
|
-
exports.parse =
|
|
9257
|
+
exports.parse = parse8;
|
|
9280
9258
|
exports.parseAllDocuments = parseAllDocuments;
|
|
9281
9259
|
exports.parseDocument = parseDocument;
|
|
9282
9260
|
exports.stringify = stringify;
|
|
@@ -96501,6 +96479,46 @@ ${Me12.join(`
|
|
|
96501
96479
|
Y42 = k0(G42);
|
|
96502
96480
|
});
|
|
96503
96481
|
|
|
96482
|
+
// ../../node_modules/.bun/cli-width@4.1.0/node_modules/cli-width/index.js
|
|
96483
|
+
var require_cli_width = __commonJS((exports, module) => {
|
|
96484
|
+
module.exports = cliWidth;
|
|
96485
|
+
function normalizeOpts(options8) {
|
|
96486
|
+
const defaultOpts = {
|
|
96487
|
+
defaultWidth: 0,
|
|
96488
|
+
output: process.stdout,
|
|
96489
|
+
tty: __require("tty")
|
|
96490
|
+
};
|
|
96491
|
+
if (!options8) {
|
|
96492
|
+
return defaultOpts;
|
|
96493
|
+
}
|
|
96494
|
+
Object.keys(defaultOpts).forEach(function(key2) {
|
|
96495
|
+
if (!options8[key2]) {
|
|
96496
|
+
options8[key2] = defaultOpts[key2];
|
|
96497
|
+
}
|
|
96498
|
+
});
|
|
96499
|
+
return options8;
|
|
96500
|
+
}
|
|
96501
|
+
function cliWidth(options8) {
|
|
96502
|
+
const opts = normalizeOpts(options8);
|
|
96503
|
+
if (opts.output.getWindowSize) {
|
|
96504
|
+
return opts.output.getWindowSize()[0] || opts.defaultWidth;
|
|
96505
|
+
}
|
|
96506
|
+
if (opts.tty.getWindowSize) {
|
|
96507
|
+
return opts.tty.getWindowSize()[1] || opts.defaultWidth;
|
|
96508
|
+
}
|
|
96509
|
+
if (opts.output.columns) {
|
|
96510
|
+
return opts.output.columns;
|
|
96511
|
+
}
|
|
96512
|
+
if (process.env.CLI_WIDTH) {
|
|
96513
|
+
const width = parseInt(process.env.CLI_WIDTH, 10);
|
|
96514
|
+
if (!isNaN(width) && width !== 0) {
|
|
96515
|
+
return width;
|
|
96516
|
+
}
|
|
96517
|
+
}
|
|
96518
|
+
return opts.defaultWidth;
|
|
96519
|
+
}
|
|
96520
|
+
});
|
|
96521
|
+
|
|
96504
96522
|
// ../../node_modules/.bun/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js
|
|
96505
96523
|
var require_lib = __commonJS((exports, module) => {
|
|
96506
96524
|
var Stream = __require("stream");
|
|
@@ -96642,214 +96660,6 @@ class ExitPromptError extends Error {
|
|
|
96642
96660
|
name = "ExitPromptError";
|
|
96643
96661
|
}
|
|
96644
96662
|
|
|
96645
|
-
// ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
96646
|
-
var signals = [];
|
|
96647
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
96648
|
-
if (process.platform !== "win32") {
|
|
96649
|
-
signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
96650
|
-
}
|
|
96651
|
-
if (process.platform === "linux") {
|
|
96652
|
-
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
96653
|
-
}
|
|
96654
|
-
|
|
96655
|
-
// ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
96656
|
-
var processOk = (process2) => !!process2 && typeof process2 === "object" && typeof process2.removeListener === "function" && typeof process2.emit === "function" && typeof process2.reallyExit === "function" && typeof process2.listeners === "function" && typeof process2.kill === "function" && typeof process2.pid === "number" && typeof process2.on === "function";
|
|
96657
|
-
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
96658
|
-
var global2 = globalThis;
|
|
96659
|
-
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
96660
|
-
|
|
96661
|
-
class Emitter {
|
|
96662
|
-
emitted = {
|
|
96663
|
-
afterExit: false,
|
|
96664
|
-
exit: false
|
|
96665
|
-
};
|
|
96666
|
-
listeners = {
|
|
96667
|
-
afterExit: [],
|
|
96668
|
-
exit: []
|
|
96669
|
-
};
|
|
96670
|
-
count = 0;
|
|
96671
|
-
id = Math.random();
|
|
96672
|
-
constructor() {
|
|
96673
|
-
if (global2[kExitEmitter]) {
|
|
96674
|
-
return global2[kExitEmitter];
|
|
96675
|
-
}
|
|
96676
|
-
ObjectDefineProperty(global2, kExitEmitter, {
|
|
96677
|
-
value: this,
|
|
96678
|
-
writable: false,
|
|
96679
|
-
enumerable: false,
|
|
96680
|
-
configurable: false
|
|
96681
|
-
});
|
|
96682
|
-
}
|
|
96683
|
-
on(ev, fn) {
|
|
96684
|
-
this.listeners[ev].push(fn);
|
|
96685
|
-
}
|
|
96686
|
-
removeListener(ev, fn) {
|
|
96687
|
-
const list = this.listeners[ev];
|
|
96688
|
-
const i = list.indexOf(fn);
|
|
96689
|
-
if (i === -1) {
|
|
96690
|
-
return;
|
|
96691
|
-
}
|
|
96692
|
-
if (i === 0 && list.length === 1) {
|
|
96693
|
-
list.length = 0;
|
|
96694
|
-
} else {
|
|
96695
|
-
list.splice(i, 1);
|
|
96696
|
-
}
|
|
96697
|
-
}
|
|
96698
|
-
emit(ev, code, signal) {
|
|
96699
|
-
if (this.emitted[ev]) {
|
|
96700
|
-
return false;
|
|
96701
|
-
}
|
|
96702
|
-
this.emitted[ev] = true;
|
|
96703
|
-
let ret = false;
|
|
96704
|
-
for (const fn of this.listeners[ev]) {
|
|
96705
|
-
ret = fn(code, signal) === true || ret;
|
|
96706
|
-
}
|
|
96707
|
-
if (ev === "exit") {
|
|
96708
|
-
ret = this.emit("afterExit", code, signal) || ret;
|
|
96709
|
-
}
|
|
96710
|
-
return ret;
|
|
96711
|
-
}
|
|
96712
|
-
}
|
|
96713
|
-
|
|
96714
|
-
class SignalExitBase {
|
|
96715
|
-
}
|
|
96716
|
-
var signalExitWrap = (handler) => {
|
|
96717
|
-
return {
|
|
96718
|
-
onExit(cb, opts) {
|
|
96719
|
-
return handler.onExit(cb, opts);
|
|
96720
|
-
},
|
|
96721
|
-
load() {
|
|
96722
|
-
return handler.load();
|
|
96723
|
-
},
|
|
96724
|
-
unload() {
|
|
96725
|
-
return handler.unload();
|
|
96726
|
-
}
|
|
96727
|
-
};
|
|
96728
|
-
};
|
|
96729
|
-
|
|
96730
|
-
class SignalExitFallback extends SignalExitBase {
|
|
96731
|
-
onExit() {
|
|
96732
|
-
return () => {};
|
|
96733
|
-
}
|
|
96734
|
-
load() {}
|
|
96735
|
-
unload() {}
|
|
96736
|
-
}
|
|
96737
|
-
|
|
96738
|
-
class SignalExit extends SignalExitBase {
|
|
96739
|
-
#hupSig = process2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
96740
|
-
#emitter = new Emitter;
|
|
96741
|
-
#process;
|
|
96742
|
-
#originalProcessEmit;
|
|
96743
|
-
#originalProcessReallyExit;
|
|
96744
|
-
#sigListeners = {};
|
|
96745
|
-
#loaded = false;
|
|
96746
|
-
constructor(process2) {
|
|
96747
|
-
super();
|
|
96748
|
-
this.#process = process2;
|
|
96749
|
-
this.#sigListeners = {};
|
|
96750
|
-
for (const sig of signals) {
|
|
96751
|
-
this.#sigListeners[sig] = () => {
|
|
96752
|
-
const listeners = this.#process.listeners(sig);
|
|
96753
|
-
let { count } = this.#emitter;
|
|
96754
|
-
const p = process2;
|
|
96755
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
96756
|
-
count += p.__signal_exit_emitter__.count;
|
|
96757
|
-
}
|
|
96758
|
-
if (listeners.length === count) {
|
|
96759
|
-
this.unload();
|
|
96760
|
-
const ret = this.#emitter.emit("exit", null, sig);
|
|
96761
|
-
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
96762
|
-
if (!ret)
|
|
96763
|
-
process2.kill(process2.pid, s);
|
|
96764
|
-
}
|
|
96765
|
-
};
|
|
96766
|
-
}
|
|
96767
|
-
this.#originalProcessReallyExit = process2.reallyExit;
|
|
96768
|
-
this.#originalProcessEmit = process2.emit;
|
|
96769
|
-
}
|
|
96770
|
-
onExit(cb, opts) {
|
|
96771
|
-
if (!processOk(this.#process)) {
|
|
96772
|
-
return () => {};
|
|
96773
|
-
}
|
|
96774
|
-
if (this.#loaded === false) {
|
|
96775
|
-
this.load();
|
|
96776
|
-
}
|
|
96777
|
-
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
96778
|
-
this.#emitter.on(ev, cb);
|
|
96779
|
-
return () => {
|
|
96780
|
-
this.#emitter.removeListener(ev, cb);
|
|
96781
|
-
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
96782
|
-
this.unload();
|
|
96783
|
-
}
|
|
96784
|
-
};
|
|
96785
|
-
}
|
|
96786
|
-
load() {
|
|
96787
|
-
if (this.#loaded) {
|
|
96788
|
-
return;
|
|
96789
|
-
}
|
|
96790
|
-
this.#loaded = true;
|
|
96791
|
-
this.#emitter.count += 1;
|
|
96792
|
-
for (const sig of signals) {
|
|
96793
|
-
try {
|
|
96794
|
-
const fn = this.#sigListeners[sig];
|
|
96795
|
-
if (fn)
|
|
96796
|
-
this.#process.on(sig, fn);
|
|
96797
|
-
} catch (_) {}
|
|
96798
|
-
}
|
|
96799
|
-
this.#process.emit = (ev, ...a) => {
|
|
96800
|
-
return this.#processEmit(ev, ...a);
|
|
96801
|
-
};
|
|
96802
|
-
this.#process.reallyExit = (code) => {
|
|
96803
|
-
return this.#processReallyExit(code);
|
|
96804
|
-
};
|
|
96805
|
-
}
|
|
96806
|
-
unload() {
|
|
96807
|
-
if (!this.#loaded) {
|
|
96808
|
-
return;
|
|
96809
|
-
}
|
|
96810
|
-
this.#loaded = false;
|
|
96811
|
-
signals.forEach((sig) => {
|
|
96812
|
-
const listener = this.#sigListeners[sig];
|
|
96813
|
-
if (!listener) {
|
|
96814
|
-
throw new Error("Listener not defined for signal: " + sig);
|
|
96815
|
-
}
|
|
96816
|
-
try {
|
|
96817
|
-
this.#process.removeListener(sig, listener);
|
|
96818
|
-
} catch (_) {}
|
|
96819
|
-
});
|
|
96820
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
96821
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
96822
|
-
this.#emitter.count -= 1;
|
|
96823
|
-
}
|
|
96824
|
-
#processReallyExit(code) {
|
|
96825
|
-
if (!processOk(this.#process)) {
|
|
96826
|
-
return 0;
|
|
96827
|
-
}
|
|
96828
|
-
this.#process.exitCode = code || 0;
|
|
96829
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
96830
|
-
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
96831
|
-
}
|
|
96832
|
-
#processEmit(ev, ...args) {
|
|
96833
|
-
const og = this.#originalProcessEmit;
|
|
96834
|
-
if (ev === "exit" && processOk(this.#process)) {
|
|
96835
|
-
if (typeof args[0] === "number") {
|
|
96836
|
-
this.#process.exitCode = args[0];
|
|
96837
|
-
}
|
|
96838
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
96839
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
96840
|
-
return ret;
|
|
96841
|
-
} else {
|
|
96842
|
-
return og.call(this.#process, ev, ...args);
|
|
96843
|
-
}
|
|
96844
|
-
}
|
|
96845
|
-
}
|
|
96846
|
-
var process2 = globalThis.process;
|
|
96847
|
-
var {
|
|
96848
|
-
onExit,
|
|
96849
|
-
load,
|
|
96850
|
-
unload
|
|
96851
|
-
} = signalExitWrap(processOk(process2) ? new SignalExit(process2) : new SignalExitFallback);
|
|
96852
|
-
|
|
96853
96663
|
// ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
96854
96664
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
96855
96665
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -97028,16 +96838,16 @@ var ansiStyles = assembleStyles();
|
|
|
97028
96838
|
var ansi_styles_default = ansiStyles;
|
|
97029
96839
|
|
|
97030
96840
|
// ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
|
|
97031
|
-
import
|
|
96841
|
+
import process2 from "process";
|
|
97032
96842
|
import os from "os";
|
|
97033
96843
|
import tty from "tty";
|
|
97034
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
96844
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
97035
96845
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
97036
96846
|
const position = argv.indexOf(prefix + flag);
|
|
97037
96847
|
const terminatorPosition = argv.indexOf("--");
|
|
97038
96848
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
97039
96849
|
}
|
|
97040
|
-
var { env } =
|
|
96850
|
+
var { env } = process2;
|
|
97041
96851
|
var flagForceColor;
|
|
97042
96852
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
97043
96853
|
flagForceColor = 0;
|
|
@@ -97093,7 +96903,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
97093
96903
|
if (env.TERM === "dumb") {
|
|
97094
96904
|
return min;
|
|
97095
96905
|
}
|
|
97096
|
-
if (
|
|
96906
|
+
if (process2.platform === "win32") {
|
|
97097
96907
|
const osRelease = os.release().split(".");
|
|
97098
96908
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
97099
96909
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
@@ -97385,7 +97195,7 @@ function diff(obj, newObj, options = { cyclesFix: true }, _stack = []) {
|
|
|
97385
97195
|
}
|
|
97386
97196
|
|
|
97387
97197
|
// src/commands/deploy.ts
|
|
97388
|
-
import
|
|
97198
|
+
import path19 from "path";
|
|
97389
97199
|
|
|
97390
97200
|
// ../../node_modules/.bun/remeda@2.33.6/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
|
|
97391
97201
|
function e(e2, t, n) {
|
|
@@ -97542,7 +97352,7 @@ function r2(e4, n7) {
|
|
|
97542
97352
|
|
|
97543
97353
|
// src/lib/agents.ts
|
|
97544
97354
|
import fs8 from "fs/promises";
|
|
97545
|
-
import
|
|
97355
|
+
import path17 from "path";
|
|
97546
97356
|
|
|
97547
97357
|
// ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
97548
97358
|
var exports_external = {};
|
|
@@ -97801,7 +97611,7 @@ __export(exports_core2, {
|
|
|
97801
97611
|
safeDecode: () => safeDecode,
|
|
97802
97612
|
registry: () => registry,
|
|
97803
97613
|
regexes: () => exports_regexes,
|
|
97804
|
-
process: () =>
|
|
97614
|
+
process: () => process3,
|
|
97805
97615
|
prettifyError: () => prettifyError,
|
|
97806
97616
|
parseAsync: () => parseAsync,
|
|
97807
97617
|
parse: () => parse,
|
|
@@ -108265,7 +108075,7 @@ function initializeContext(params) {
|
|
|
108265
108075
|
external: params?.external ?? undefined
|
|
108266
108076
|
};
|
|
108267
108077
|
}
|
|
108268
|
-
function
|
|
108078
|
+
function process3(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
108269
108079
|
var _a2;
|
|
108270
108080
|
const def = schema._zod.def;
|
|
108271
108081
|
const seen = ctx.seen.get(schema);
|
|
@@ -108302,7 +108112,7 @@ function process4(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
108302
108112
|
if (parent) {
|
|
108303
108113
|
if (!result.ref)
|
|
108304
108114
|
result.ref = parent;
|
|
108305
|
-
|
|
108115
|
+
process3(parent, ctx, params);
|
|
108306
108116
|
ctx.seen.get(parent).isParent = true;
|
|
108307
108117
|
}
|
|
108308
108118
|
}
|
|
@@ -108578,14 +108388,14 @@ function isTransforming(_schema, _ctx) {
|
|
|
108578
108388
|
}
|
|
108579
108389
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
108580
108390
|
const ctx = initializeContext({ ...params, processors });
|
|
108581
|
-
|
|
108391
|
+
process3(schema, ctx);
|
|
108582
108392
|
extractDefs(ctx, schema);
|
|
108583
108393
|
return finalize(ctx, schema);
|
|
108584
108394
|
};
|
|
108585
108395
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
108586
108396
|
const { libraryOptions, target } = params ?? {};
|
|
108587
108397
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
108588
|
-
|
|
108398
|
+
process3(schema, ctx);
|
|
108589
108399
|
extractDefs(ctx, schema);
|
|
108590
108400
|
return finalize(ctx, schema);
|
|
108591
108401
|
};
|
|
@@ -108836,7 +108646,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
108836
108646
|
if (typeof maximum === "number")
|
|
108837
108647
|
json.maxItems = maximum;
|
|
108838
108648
|
json.type = "array";
|
|
108839
|
-
json.items =
|
|
108649
|
+
json.items = process3(def.element, ctx, { ...params, path: [...params.path, "items"] });
|
|
108840
108650
|
};
|
|
108841
108651
|
var objectProcessor = (schema, ctx, _json, params) => {
|
|
108842
108652
|
const json = _json;
|
|
@@ -108845,7 +108655,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
108845
108655
|
json.properties = {};
|
|
108846
108656
|
const shape = def.shape;
|
|
108847
108657
|
for (const key in shape) {
|
|
108848
|
-
json.properties[key] =
|
|
108658
|
+
json.properties[key] = process3(shape[key], ctx, {
|
|
108849
108659
|
...params,
|
|
108850
108660
|
path: [...params.path, "properties", key]
|
|
108851
108661
|
});
|
|
@@ -108868,7 +108678,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
108868
108678
|
if (ctx.io === "output")
|
|
108869
108679
|
json.additionalProperties = false;
|
|
108870
108680
|
} else if (def.catchall) {
|
|
108871
|
-
json.additionalProperties =
|
|
108681
|
+
json.additionalProperties = process3(def.catchall, ctx, {
|
|
108872
108682
|
...params,
|
|
108873
108683
|
path: [...params.path, "additionalProperties"]
|
|
108874
108684
|
});
|
|
@@ -108877,7 +108687,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
108877
108687
|
var unionProcessor = (schema, ctx, json, params) => {
|
|
108878
108688
|
const def = schema._zod.def;
|
|
108879
108689
|
const isExclusive = def.inclusive === false;
|
|
108880
|
-
const options = def.options.map((x, i2) =>
|
|
108690
|
+
const options = def.options.map((x, i2) => process3(x, ctx, {
|
|
108881
108691
|
...params,
|
|
108882
108692
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i2]
|
|
108883
108693
|
}));
|
|
@@ -108889,11 +108699,11 @@ var unionProcessor = (schema, ctx, json, params) => {
|
|
|
108889
108699
|
};
|
|
108890
108700
|
var intersectionProcessor = (schema, ctx, json, params) => {
|
|
108891
108701
|
const def = schema._zod.def;
|
|
108892
|
-
const a =
|
|
108702
|
+
const a = process3(def.left, ctx, {
|
|
108893
108703
|
...params,
|
|
108894
108704
|
path: [...params.path, "allOf", 0]
|
|
108895
108705
|
});
|
|
108896
|
-
const b =
|
|
108706
|
+
const b = process3(def.right, ctx, {
|
|
108897
108707
|
...params,
|
|
108898
108708
|
path: [...params.path, "allOf", 1]
|
|
108899
108709
|
});
|
|
@@ -108910,11 +108720,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
108910
108720
|
json.type = "array";
|
|
108911
108721
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
108912
108722
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
108913
|
-
const prefixItems = def.items.map((x, i2) =>
|
|
108723
|
+
const prefixItems = def.items.map((x, i2) => process3(x, ctx, {
|
|
108914
108724
|
...params,
|
|
108915
108725
|
path: [...params.path, prefixPath, i2]
|
|
108916
108726
|
}));
|
|
108917
|
-
const rest = def.rest ?
|
|
108727
|
+
const rest = def.rest ? process3(def.rest, ctx, {
|
|
108918
108728
|
...params,
|
|
108919
108729
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
108920
108730
|
}) : null;
|
|
@@ -108954,7 +108764,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
108954
108764
|
const keyBag = keyType._zod.bag;
|
|
108955
108765
|
const patterns = keyBag?.patterns;
|
|
108956
108766
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
108957
|
-
const valueSchema =
|
|
108767
|
+
const valueSchema = process3(def.valueType, ctx, {
|
|
108958
108768
|
...params,
|
|
108959
108769
|
path: [...params.path, "patternProperties", "*"]
|
|
108960
108770
|
});
|
|
@@ -108964,12 +108774,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
108964
108774
|
}
|
|
108965
108775
|
} else {
|
|
108966
108776
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
108967
|
-
json.propertyNames =
|
|
108777
|
+
json.propertyNames = process3(def.keyType, ctx, {
|
|
108968
108778
|
...params,
|
|
108969
108779
|
path: [...params.path, "propertyNames"]
|
|
108970
108780
|
});
|
|
108971
108781
|
}
|
|
108972
|
-
json.additionalProperties =
|
|
108782
|
+
json.additionalProperties = process3(def.valueType, ctx, {
|
|
108973
108783
|
...params,
|
|
108974
108784
|
path: [...params.path, "additionalProperties"]
|
|
108975
108785
|
});
|
|
@@ -108984,7 +108794,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
108984
108794
|
};
|
|
108985
108795
|
var nullableProcessor = (schema, ctx, json, params) => {
|
|
108986
108796
|
const def = schema._zod.def;
|
|
108987
|
-
const inner =
|
|
108797
|
+
const inner = process3(def.innerType, ctx, params);
|
|
108988
108798
|
const seen = ctx.seen.get(schema);
|
|
108989
108799
|
if (ctx.target === "openapi-3.0") {
|
|
108990
108800
|
seen.ref = def.innerType;
|
|
@@ -108995,20 +108805,20 @@ var nullableProcessor = (schema, ctx, json, params) => {
|
|
|
108995
108805
|
};
|
|
108996
108806
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
108997
108807
|
const def = schema._zod.def;
|
|
108998
|
-
|
|
108808
|
+
process3(def.innerType, ctx, params);
|
|
108999
108809
|
const seen = ctx.seen.get(schema);
|
|
109000
108810
|
seen.ref = def.innerType;
|
|
109001
108811
|
};
|
|
109002
108812
|
var defaultProcessor = (schema, ctx, json, params) => {
|
|
109003
108813
|
const def = schema._zod.def;
|
|
109004
|
-
|
|
108814
|
+
process3(def.innerType, ctx, params);
|
|
109005
108815
|
const seen = ctx.seen.get(schema);
|
|
109006
108816
|
seen.ref = def.innerType;
|
|
109007
108817
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
109008
108818
|
};
|
|
109009
108819
|
var prefaultProcessor = (schema, ctx, json, params) => {
|
|
109010
108820
|
const def = schema._zod.def;
|
|
109011
|
-
|
|
108821
|
+
process3(def.innerType, ctx, params);
|
|
109012
108822
|
const seen = ctx.seen.get(schema);
|
|
109013
108823
|
seen.ref = def.innerType;
|
|
109014
108824
|
if (ctx.io === "input")
|
|
@@ -109016,7 +108826,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
|
|
|
109016
108826
|
};
|
|
109017
108827
|
var catchProcessor = (schema, ctx, json, params) => {
|
|
109018
108828
|
const def = schema._zod.def;
|
|
109019
|
-
|
|
108829
|
+
process3(def.innerType, ctx, params);
|
|
109020
108830
|
const seen = ctx.seen.get(schema);
|
|
109021
108831
|
seen.ref = def.innerType;
|
|
109022
108832
|
let catchValue;
|
|
@@ -109030,32 +108840,32 @@ var catchProcessor = (schema, ctx, json, params) => {
|
|
|
109030
108840
|
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
109031
108841
|
const def = schema._zod.def;
|
|
109032
108842
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
109033
|
-
|
|
108843
|
+
process3(innerType, ctx, params);
|
|
109034
108844
|
const seen = ctx.seen.get(schema);
|
|
109035
108845
|
seen.ref = innerType;
|
|
109036
108846
|
};
|
|
109037
108847
|
var readonlyProcessor = (schema, ctx, json, params) => {
|
|
109038
108848
|
const def = schema._zod.def;
|
|
109039
|
-
|
|
108849
|
+
process3(def.innerType, ctx, params);
|
|
109040
108850
|
const seen = ctx.seen.get(schema);
|
|
109041
108851
|
seen.ref = def.innerType;
|
|
109042
108852
|
json.readOnly = true;
|
|
109043
108853
|
};
|
|
109044
108854
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
109045
108855
|
const def = schema._zod.def;
|
|
109046
|
-
|
|
108856
|
+
process3(def.innerType, ctx, params);
|
|
109047
108857
|
const seen = ctx.seen.get(schema);
|
|
109048
108858
|
seen.ref = def.innerType;
|
|
109049
108859
|
};
|
|
109050
108860
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
109051
108861
|
const def = schema._zod.def;
|
|
109052
|
-
|
|
108862
|
+
process3(def.innerType, ctx, params);
|
|
109053
108863
|
const seen = ctx.seen.get(schema);
|
|
109054
108864
|
seen.ref = def.innerType;
|
|
109055
108865
|
};
|
|
109056
108866
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
109057
108867
|
const innerType = schema._zod.innerType;
|
|
109058
|
-
|
|
108868
|
+
process3(innerType, ctx, params);
|
|
109059
108869
|
const seen = ctx.seen.get(schema);
|
|
109060
108870
|
seen.ref = innerType;
|
|
109061
108871
|
};
|
|
@@ -109107,7 +108917,7 @@ function toJSONSchema(input, params) {
|
|
|
109107
108917
|
const defs = {};
|
|
109108
108918
|
for (const entry of registry2._idmap.entries()) {
|
|
109109
108919
|
const [_, schema] = entry;
|
|
109110
|
-
|
|
108920
|
+
process3(schema, ctx2);
|
|
109111
108921
|
}
|
|
109112
108922
|
const schemas = {};
|
|
109113
108923
|
const external = {
|
|
@@ -109130,7 +108940,7 @@ function toJSONSchema(input, params) {
|
|
|
109130
108940
|
return { schemas };
|
|
109131
108941
|
}
|
|
109132
108942
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
109133
|
-
|
|
108943
|
+
process3(input, ctx);
|
|
109134
108944
|
extractDefs(ctx, input);
|
|
109135
108945
|
return finalize(ctx, input);
|
|
109136
108946
|
}
|
|
@@ -109176,7 +108986,7 @@ class JSONSchemaGenerator {
|
|
|
109176
108986
|
});
|
|
109177
108987
|
}
|
|
109178
108988
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
109179
|
-
return
|
|
108989
|
+
return process3(schema, this.ctx, _params);
|
|
109180
108990
|
}
|
|
109181
108991
|
emit(schema, _params) {
|
|
109182
108992
|
if (_params) {
|
|
@@ -111117,7 +110927,8 @@ var DisconnectionReasonSchema = exports_external.enum([
|
|
|
111117
110927
|
"error_retell",
|
|
111118
110928
|
"error_unknown",
|
|
111119
110929
|
"error_user_not_joined",
|
|
111120
|
-
"registered_call_timeout"
|
|
110930
|
+
"registered_call_timeout",
|
|
110931
|
+
"unknown"
|
|
111121
110932
|
]);
|
|
111122
110933
|
var UserSentimentSchema = exports_external.enum([
|
|
111123
110934
|
"Negative",
|
|
@@ -111482,6 +111293,285 @@ function withMetadataArgument(func, _arguments) {
|
|
|
111482
111293
|
args.push(metadata_min_json_default);
|
|
111483
111294
|
return func.apply(this, args);
|
|
111484
111295
|
}
|
|
111296
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/isObject.js
|
|
111297
|
+
var objectConstructor = {}.constructor;
|
|
111298
|
+
function isObject2(object2) {
|
|
111299
|
+
return object2 !== undefined && object2 !== null && object2.constructor === objectConstructor;
|
|
111300
|
+
}
|
|
111301
|
+
|
|
111302
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/normalizeArguments.js
|
|
111303
|
+
function _typeof(o) {
|
|
111304
|
+
"@babel/helpers - typeof";
|
|
111305
|
+
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
111306
|
+
return typeof o2;
|
|
111307
|
+
} : function(o2) {
|
|
111308
|
+
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
111309
|
+
}, _typeof(o);
|
|
111310
|
+
}
|
|
111311
|
+
function ownKeys(e4, r3) {
|
|
111312
|
+
var t9 = Object.keys(e4);
|
|
111313
|
+
if (Object.getOwnPropertySymbols) {
|
|
111314
|
+
var o = Object.getOwnPropertySymbols(e4);
|
|
111315
|
+
r3 && (o = o.filter(function(r4) {
|
|
111316
|
+
return Object.getOwnPropertyDescriptor(e4, r4).enumerable;
|
|
111317
|
+
})), t9.push.apply(t9, o);
|
|
111318
|
+
}
|
|
111319
|
+
return t9;
|
|
111320
|
+
}
|
|
111321
|
+
function _objectSpread(e4) {
|
|
111322
|
+
for (var r3 = 1;r3 < arguments.length; r3++) {
|
|
111323
|
+
var t9 = arguments[r3] != null ? arguments[r3] : {};
|
|
111324
|
+
r3 % 2 ? ownKeys(Object(t9), true).forEach(function(r4) {
|
|
111325
|
+
_defineProperty(e4, r4, t9[r4]);
|
|
111326
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(t9)) : ownKeys(Object(t9)).forEach(function(r4) {
|
|
111327
|
+
Object.defineProperty(e4, r4, Object.getOwnPropertyDescriptor(t9, r4));
|
|
111328
|
+
});
|
|
111329
|
+
}
|
|
111330
|
+
return e4;
|
|
111331
|
+
}
|
|
111332
|
+
function _defineProperty(e4, r3, t9) {
|
|
111333
|
+
return (r3 = _toPropertyKey(r3)) in e4 ? Object.defineProperty(e4, r3, { value: t9, enumerable: true, configurable: true, writable: true }) : e4[r3] = t9, e4;
|
|
111334
|
+
}
|
|
111335
|
+
function _toPropertyKey(t9) {
|
|
111336
|
+
var i2 = _toPrimitive(t9, "string");
|
|
111337
|
+
return _typeof(i2) == "symbol" ? i2 : i2 + "";
|
|
111338
|
+
}
|
|
111339
|
+
function _toPrimitive(t9, r3) {
|
|
111340
|
+
if (_typeof(t9) != "object" || !t9)
|
|
111341
|
+
return t9;
|
|
111342
|
+
var e4 = t9[Symbol.toPrimitive];
|
|
111343
|
+
if (e4 !== undefined) {
|
|
111344
|
+
var i2 = e4.call(t9, r3 || "default");
|
|
111345
|
+
if (_typeof(i2) != "object")
|
|
111346
|
+
return i2;
|
|
111347
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
111348
|
+
}
|
|
111349
|
+
return (r3 === "string" ? String : Number)(t9);
|
|
111350
|
+
}
|
|
111351
|
+
function _slicedToArray(r3, e4) {
|
|
111352
|
+
return _arrayWithHoles(r3) || _iterableToArrayLimit(r3, e4) || _unsupportedIterableToArray(r3, e4) || _nonIterableRest();
|
|
111353
|
+
}
|
|
111354
|
+
function _nonIterableRest() {
|
|
111355
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
111356
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
111357
|
+
}
|
|
111358
|
+
function _unsupportedIterableToArray(r3, a) {
|
|
111359
|
+
if (r3) {
|
|
111360
|
+
if (typeof r3 == "string")
|
|
111361
|
+
return _arrayLikeToArray(r3, a);
|
|
111362
|
+
var t9 = {}.toString.call(r3).slice(8, -1);
|
|
111363
|
+
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ? _arrayLikeToArray(r3, a) : undefined;
|
|
111364
|
+
}
|
|
111365
|
+
}
|
|
111366
|
+
function _arrayLikeToArray(r3, a) {
|
|
111367
|
+
(a == null || a > r3.length) && (a = r3.length);
|
|
111368
|
+
for (var e4 = 0, n7 = Array(a);e4 < a; e4++)
|
|
111369
|
+
n7[e4] = r3[e4];
|
|
111370
|
+
return n7;
|
|
111371
|
+
}
|
|
111372
|
+
function _iterableToArrayLimit(r3, l) {
|
|
111373
|
+
var t9 = r3 == null ? null : typeof Symbol != "undefined" && r3[Symbol.iterator] || r3["@@iterator"];
|
|
111374
|
+
if (t9 != null) {
|
|
111375
|
+
var e4, n7, i2, u, a = [], f = true, o = false;
|
|
111376
|
+
try {
|
|
111377
|
+
if (i2 = (t9 = t9.call(r3)).next, l === 0) {
|
|
111378
|
+
if (Object(t9) !== t9)
|
|
111379
|
+
return;
|
|
111380
|
+
f = false;
|
|
111381
|
+
} else
|
|
111382
|
+
for (;!(f = (e4 = i2.call(t9)).done) && (a.push(e4.value), a.length !== l); f = true)
|
|
111383
|
+
;
|
|
111384
|
+
} catch (r4) {
|
|
111385
|
+
o = true, n7 = r4;
|
|
111386
|
+
} finally {
|
|
111387
|
+
try {
|
|
111388
|
+
if (!f && t9["return"] != null && (u = t9["return"](), Object(u) !== u))
|
|
111389
|
+
return;
|
|
111390
|
+
} finally {
|
|
111391
|
+
if (o)
|
|
111392
|
+
throw n7;
|
|
111393
|
+
}
|
|
111394
|
+
}
|
|
111395
|
+
return a;
|
|
111396
|
+
}
|
|
111397
|
+
}
|
|
111398
|
+
function _arrayWithHoles(r3) {
|
|
111399
|
+
if (Array.isArray(r3))
|
|
111400
|
+
return r3;
|
|
111401
|
+
}
|
|
111402
|
+
function normalizeArguments(args) {
|
|
111403
|
+
var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3];
|
|
111404
|
+
var text;
|
|
111405
|
+
var options;
|
|
111406
|
+
var metadata;
|
|
111407
|
+
if (typeof arg_1 === "string") {
|
|
111408
|
+
text = arg_1;
|
|
111409
|
+
} else
|
|
111410
|
+
throw new TypeError("A text for parsing must be a string.");
|
|
111411
|
+
if (!arg_2 || typeof arg_2 === "string") {
|
|
111412
|
+
if (arg_4) {
|
|
111413
|
+
options = arg_3;
|
|
111414
|
+
metadata = arg_4;
|
|
111415
|
+
} else {
|
|
111416
|
+
options = undefined;
|
|
111417
|
+
metadata = arg_3;
|
|
111418
|
+
}
|
|
111419
|
+
if (arg_2) {
|
|
111420
|
+
options = _objectSpread({
|
|
111421
|
+
defaultCountry: arg_2
|
|
111422
|
+
}, options);
|
|
111423
|
+
}
|
|
111424
|
+
} else if (isObject2(arg_2)) {
|
|
111425
|
+
if (arg_3) {
|
|
111426
|
+
options = arg_2;
|
|
111427
|
+
metadata = arg_3;
|
|
111428
|
+
} else {
|
|
111429
|
+
metadata = arg_2;
|
|
111430
|
+
}
|
|
111431
|
+
} else
|
|
111432
|
+
throw new Error("Invalid second argument: ".concat(arg_2));
|
|
111433
|
+
return {
|
|
111434
|
+
text,
|
|
111435
|
+
options,
|
|
111436
|
+
metadata
|
|
111437
|
+
};
|
|
111438
|
+
}
|
|
111439
|
+
|
|
111440
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/constants.js
|
|
111441
|
+
var MIN_LENGTH_FOR_NSN = 2;
|
|
111442
|
+
var MAX_LENGTH_FOR_NSN = 17;
|
|
111443
|
+
var MAX_LENGTH_COUNTRY_CODE = 3;
|
|
111444
|
+
var VALID_DIGITS = "0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9";
|
|
111445
|
+
var DASHES = "-\u2010-\u2015\u2212\u30FC\uFF0D";
|
|
111446
|
+
var SLASHES = "\uFF0F/";
|
|
111447
|
+
var DOTS = "\uFF0E.";
|
|
111448
|
+
var WHITESPACE = " \xA0\xAD\u200B\u2060\u3000";
|
|
111449
|
+
var BRACKETS = "()\uFF08\uFF09\uFF3B\uFF3D\\[\\]";
|
|
111450
|
+
var TILDES = "~\u2053\u223C\uFF5E";
|
|
111451
|
+
var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
|
|
111452
|
+
var PLUS_CHARS = "+\uFF0B";
|
|
111453
|
+
|
|
111454
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/ParseError.js
|
|
111455
|
+
function _typeof2(o) {
|
|
111456
|
+
"@babel/helpers - typeof";
|
|
111457
|
+
return _typeof2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
111458
|
+
return typeof o2;
|
|
111459
|
+
} : function(o2) {
|
|
111460
|
+
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
111461
|
+
}, _typeof2(o);
|
|
111462
|
+
}
|
|
111463
|
+
function _defineProperties(e4, r3) {
|
|
111464
|
+
for (var t9 = 0;t9 < r3.length; t9++) {
|
|
111465
|
+
var o = r3[t9];
|
|
111466
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e4, _toPropertyKey2(o.key), o);
|
|
111467
|
+
}
|
|
111468
|
+
}
|
|
111469
|
+
function _createClass(e4, r3, t9) {
|
|
111470
|
+
return r3 && _defineProperties(e4.prototype, r3), t9 && _defineProperties(e4, t9), Object.defineProperty(e4, "prototype", { writable: false }), e4;
|
|
111471
|
+
}
|
|
111472
|
+
function _toPropertyKey2(t9) {
|
|
111473
|
+
var i2 = _toPrimitive2(t9, "string");
|
|
111474
|
+
return _typeof2(i2) == "symbol" ? i2 : i2 + "";
|
|
111475
|
+
}
|
|
111476
|
+
function _toPrimitive2(t9, r3) {
|
|
111477
|
+
if (_typeof2(t9) != "object" || !t9)
|
|
111478
|
+
return t9;
|
|
111479
|
+
var e4 = t9[Symbol.toPrimitive];
|
|
111480
|
+
if (e4 !== undefined) {
|
|
111481
|
+
var i2 = e4.call(t9, r3 || "default");
|
|
111482
|
+
if (_typeof2(i2) != "object")
|
|
111483
|
+
return i2;
|
|
111484
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
111485
|
+
}
|
|
111486
|
+
return (r3 === "string" ? String : Number)(t9);
|
|
111487
|
+
}
|
|
111488
|
+
function _classCallCheck(a, n7) {
|
|
111489
|
+
if (!(a instanceof n7))
|
|
111490
|
+
throw new TypeError("Cannot call a class as a function");
|
|
111491
|
+
}
|
|
111492
|
+
function _callSuper(t9, o, e4) {
|
|
111493
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t9, _isNativeReflectConstruct() ? Reflect.construct(o, e4 || [], _getPrototypeOf(t9).constructor) : o.apply(t9, e4));
|
|
111494
|
+
}
|
|
111495
|
+
function _possibleConstructorReturn(t9, e4) {
|
|
111496
|
+
if (e4 && (_typeof2(e4) == "object" || typeof e4 == "function"))
|
|
111497
|
+
return e4;
|
|
111498
|
+
if (e4 !== undefined)
|
|
111499
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
111500
|
+
return _assertThisInitialized(t9);
|
|
111501
|
+
}
|
|
111502
|
+
function _assertThisInitialized(e4) {
|
|
111503
|
+
if (e4 === undefined)
|
|
111504
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
111505
|
+
return e4;
|
|
111506
|
+
}
|
|
111507
|
+
function _inherits(t9, e4) {
|
|
111508
|
+
if (typeof e4 != "function" && e4 !== null)
|
|
111509
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
111510
|
+
t9.prototype = Object.create(e4 && e4.prototype, { constructor: { value: t9, writable: true, configurable: true } }), Object.defineProperty(t9, "prototype", { writable: false }), e4 && _setPrototypeOf(t9, e4);
|
|
111511
|
+
}
|
|
111512
|
+
function _wrapNativeSuper(t9) {
|
|
111513
|
+
var r3 = typeof Map == "function" ? new Map : undefined;
|
|
111514
|
+
return _wrapNativeSuper = function _wrapNativeSuper2(t10) {
|
|
111515
|
+
if (t10 === null || !_isNativeFunction(t10))
|
|
111516
|
+
return t10;
|
|
111517
|
+
if (typeof t10 != "function")
|
|
111518
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
111519
|
+
if (r3 !== undefined) {
|
|
111520
|
+
if (r3.has(t10))
|
|
111521
|
+
return r3.get(t10);
|
|
111522
|
+
r3.set(t10, Wrapper);
|
|
111523
|
+
}
|
|
111524
|
+
function Wrapper() {
|
|
111525
|
+
return _construct(t10, arguments, _getPrototypeOf(this).constructor);
|
|
111526
|
+
}
|
|
111527
|
+
return Wrapper.prototype = Object.create(t10.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }), _setPrototypeOf(Wrapper, t10);
|
|
111528
|
+
}, _wrapNativeSuper(t9);
|
|
111529
|
+
}
|
|
111530
|
+
function _construct(t9, e4, r3) {
|
|
111531
|
+
if (_isNativeReflectConstruct())
|
|
111532
|
+
return Reflect.construct.apply(null, arguments);
|
|
111533
|
+
var o = [null];
|
|
111534
|
+
o.push.apply(o, e4);
|
|
111535
|
+
var p = new (t9.bind.apply(t9, o));
|
|
111536
|
+
return r3 && _setPrototypeOf(p, r3.prototype), p;
|
|
111537
|
+
}
|
|
111538
|
+
function _isNativeReflectConstruct() {
|
|
111539
|
+
try {
|
|
111540
|
+
var t9 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
111541
|
+
} catch (t10) {}
|
|
111542
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct2() {
|
|
111543
|
+
return !!t9;
|
|
111544
|
+
})();
|
|
111545
|
+
}
|
|
111546
|
+
function _isNativeFunction(t9) {
|
|
111547
|
+
try {
|
|
111548
|
+
return Function.toString.call(t9).indexOf("[native code]") !== -1;
|
|
111549
|
+
} catch (n7) {
|
|
111550
|
+
return typeof t9 == "function";
|
|
111551
|
+
}
|
|
111552
|
+
}
|
|
111553
|
+
function _setPrototypeOf(t9, e4) {
|
|
111554
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t10, e5) {
|
|
111555
|
+
return t10.__proto__ = e5, t10;
|
|
111556
|
+
}, _setPrototypeOf(t9, e4);
|
|
111557
|
+
}
|
|
111558
|
+
function _getPrototypeOf(t9) {
|
|
111559
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t10) {
|
|
111560
|
+
return t10.__proto__ || Object.getPrototypeOf(t10);
|
|
111561
|
+
}, _getPrototypeOf(t9);
|
|
111562
|
+
}
|
|
111563
|
+
var ParseError = /* @__PURE__ */ function(_Error) {
|
|
111564
|
+
function ParseError2(code) {
|
|
111565
|
+
var _this;
|
|
111566
|
+
_classCallCheck(this, ParseError2);
|
|
111567
|
+
_this = _callSuper(this, ParseError2, [code]);
|
|
111568
|
+
Object.setPrototypeOf(_this, ParseError2.prototype);
|
|
111569
|
+
_this.name = _this.constructor.name;
|
|
111570
|
+
return _this;
|
|
111571
|
+
}
|
|
111572
|
+
_inherits(ParseError2, _Error);
|
|
111573
|
+
return _createClass(ParseError2);
|
|
111574
|
+
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
111485
111575
|
|
|
111486
111576
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/tools/semver-compare.js
|
|
111487
111577
|
function semver_compare_default(a, b) {
|
|
@@ -111507,45 +111597,39 @@ function semver_compare_default(a, b) {
|
|
|
111507
111597
|
return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;
|
|
111508
111598
|
}
|
|
111509
111599
|
|
|
111510
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/isObject.js
|
|
111511
|
-
var objectConstructor = {}.constructor;
|
|
111512
|
-
function isObject2(object2) {
|
|
111513
|
-
return object2 !== undefined && object2 !== null && object2.constructor === objectConstructor;
|
|
111514
|
-
}
|
|
111515
|
-
|
|
111516
111600
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/metadata.js
|
|
111517
|
-
function
|
|
111601
|
+
function _typeof3(o) {
|
|
111518
111602
|
"@babel/helpers - typeof";
|
|
111519
|
-
return
|
|
111603
|
+
return _typeof3 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
111520
111604
|
return typeof o2;
|
|
111521
111605
|
} : function(o2) {
|
|
111522
111606
|
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
111523
|
-
},
|
|
111607
|
+
}, _typeof3(o);
|
|
111524
111608
|
}
|
|
111525
|
-
function
|
|
111609
|
+
function _classCallCheck2(a, n7) {
|
|
111526
111610
|
if (!(a instanceof n7))
|
|
111527
111611
|
throw new TypeError("Cannot call a class as a function");
|
|
111528
111612
|
}
|
|
111529
|
-
function
|
|
111613
|
+
function _defineProperties2(e4, r3) {
|
|
111530
111614
|
for (var t9 = 0;t9 < r3.length; t9++) {
|
|
111531
111615
|
var o = r3[t9];
|
|
111532
|
-
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e4,
|
|
111616
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e4, _toPropertyKey3(o.key), o);
|
|
111533
111617
|
}
|
|
111534
111618
|
}
|
|
111535
|
-
function
|
|
111536
|
-
return r3 &&
|
|
111619
|
+
function _createClass2(e4, r3, t9) {
|
|
111620
|
+
return r3 && _defineProperties2(e4.prototype, r3), t9 && _defineProperties2(e4, t9), Object.defineProperty(e4, "prototype", { writable: false }), e4;
|
|
111537
111621
|
}
|
|
111538
|
-
function
|
|
111539
|
-
var i2 =
|
|
111540
|
-
return
|
|
111622
|
+
function _toPropertyKey3(t9) {
|
|
111623
|
+
var i2 = _toPrimitive3(t9, "string");
|
|
111624
|
+
return _typeof3(i2) == "symbol" ? i2 : i2 + "";
|
|
111541
111625
|
}
|
|
111542
|
-
function
|
|
111543
|
-
if (
|
|
111626
|
+
function _toPrimitive3(t9, r3) {
|
|
111627
|
+
if (_typeof3(t9) != "object" || !t9)
|
|
111544
111628
|
return t9;
|
|
111545
111629
|
var e4 = t9[Symbol.toPrimitive];
|
|
111546
111630
|
if (e4 !== undefined) {
|
|
111547
111631
|
var i2 = e4.call(t9, r3 || "default");
|
|
111548
|
-
if (
|
|
111632
|
+
if (_typeof3(i2) != "object")
|
|
111549
111633
|
return i2;
|
|
111550
111634
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
111551
111635
|
}
|
|
@@ -111557,12 +111641,12 @@ var DEFAULT_EXT_PREFIX = " ext. ";
|
|
|
111557
111641
|
var CALLING_CODE_REG_EXP = /^\d+$/;
|
|
111558
111642
|
var Metadata = /* @__PURE__ */ function() {
|
|
111559
111643
|
function Metadata2(metadata) {
|
|
111560
|
-
|
|
111644
|
+
_classCallCheck2(this, Metadata2);
|
|
111561
111645
|
validateMetadata(metadata);
|
|
111562
111646
|
this.metadata = metadata;
|
|
111563
111647
|
setVersion.call(this, metadata);
|
|
111564
111648
|
}
|
|
111565
|
-
return
|
|
111649
|
+
return _createClass2(Metadata2, [{
|
|
111566
111650
|
key: "getCountries",
|
|
111567
111651
|
value: function getCountries() {
|
|
111568
111652
|
return Object.keys(this.metadata.countries).filter(function(_) {
|
|
@@ -111758,12 +111842,12 @@ var Metadata = /* @__PURE__ */ function() {
|
|
|
111758
111842
|
}();
|
|
111759
111843
|
var NumberingPlan = /* @__PURE__ */ function() {
|
|
111760
111844
|
function NumberingPlan2(metadata, globalMetadataObject) {
|
|
111761
|
-
|
|
111845
|
+
_classCallCheck2(this, NumberingPlan2);
|
|
111762
111846
|
this.globalMetadataObject = globalMetadataObject;
|
|
111763
111847
|
this.metadata = metadata;
|
|
111764
111848
|
setVersion.call(this, globalMetadataObject.metadata);
|
|
111765
111849
|
}
|
|
111766
|
-
return
|
|
111850
|
+
return _createClass2(NumberingPlan2, [{
|
|
111767
111851
|
key: "callingCode",
|
|
111768
111852
|
value: function callingCode() {
|
|
111769
111853
|
return this.metadata[0];
|
|
@@ -111891,11 +111975,11 @@ var NumberingPlan = /* @__PURE__ */ function() {
|
|
|
111891
111975
|
}();
|
|
111892
111976
|
var Format = /* @__PURE__ */ function() {
|
|
111893
111977
|
function Format2(format, metadata) {
|
|
111894
|
-
|
|
111978
|
+
_classCallCheck2(this, Format2);
|
|
111895
111979
|
this._format = format;
|
|
111896
111980
|
this.metadata = metadata;
|
|
111897
111981
|
}
|
|
111898
|
-
return
|
|
111982
|
+
return _createClass2(Format2, [{
|
|
111899
111983
|
key: "pattern",
|
|
111900
111984
|
value: function pattern() {
|
|
111901
111985
|
return this._format[0];
|
|
@@ -111940,11 +112024,11 @@ var Format = /* @__PURE__ */ function() {
|
|
|
111940
112024
|
var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
|
|
111941
112025
|
var Type = /* @__PURE__ */ function() {
|
|
111942
112026
|
function Type2(type, metadata) {
|
|
111943
|
-
|
|
112027
|
+
_classCallCheck2(this, Type2);
|
|
111944
112028
|
this.type = type;
|
|
111945
112029
|
this.metadata = metadata;
|
|
111946
112030
|
}
|
|
111947
|
-
return
|
|
112031
|
+
return _createClass2(Type2, [{
|
|
111948
112032
|
key: "pattern",
|
|
111949
112033
|
value: function pattern() {
|
|
111950
112034
|
if (this.metadata.v1)
|
|
@@ -111993,7 +112077,7 @@ function validateMetadata(metadata) {
|
|
|
111993
112077
|
}
|
|
111994
112078
|
}
|
|
111995
112079
|
var typeOf = function typeOf2(_) {
|
|
111996
|
-
return
|
|
112080
|
+
return _typeof3(_);
|
|
111997
112081
|
};
|
|
111998
112082
|
function getCountryCallingCode(country, metadata) {
|
|
111999
112083
|
metadata = new Metadata(metadata);
|
|
@@ -112025,12 +112109,120 @@ function setVersion(metadata) {
|
|
|
112025
112109
|
}
|
|
112026
112110
|
}
|
|
112027
112111
|
|
|
112028
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/
|
|
112112
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
|
|
112113
|
+
var RFC3966_EXTN_PREFIX = ";ext=";
|
|
112114
|
+
var getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
|
|
112115
|
+
return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
|
|
112116
|
+
};
|
|
112117
|
+
function createExtensionPattern(purpose) {
|
|
112118
|
+
var extLimitAfterExplicitLabel = "20";
|
|
112119
|
+
var extLimitAfterLikelyLabel = "15";
|
|
112120
|
+
var extLimitAfterAmbiguousChar = "9";
|
|
112121
|
+
var extLimitWhenNotSure = "6";
|
|
112122
|
+
var possibleSeparatorsBetweenNumberAndExtLabel = "[ \xA0\\t,]*";
|
|
112123
|
+
var possibleCharsAfterExtLabel = "[:\\.\uFF0E]?[ \xA0\\t,-]*";
|
|
112124
|
+
var optionalExtnSuffix = "#?";
|
|
112125
|
+
var explicitExtLabels = "(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)";
|
|
112126
|
+
var ambiguousExtLabels = "(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)";
|
|
112127
|
+
var ambiguousSeparator = "[- ]+";
|
|
112128
|
+
var possibleSeparatorsNumberExtLabelNoComma = "[ \xA0\\t]*";
|
|
112129
|
+
var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
|
|
112130
|
+
var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
|
|
112131
|
+
var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
|
|
112132
|
+
var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
|
|
112133
|
+
var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
|
|
112134
|
+
var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
|
|
112135
|
+
var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
|
|
112136
|
+
return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
|
|
112137
|
+
}
|
|
112138
|
+
|
|
112139
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
|
|
112140
|
+
var MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
|
|
112141
|
+
var VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}" + "(?:" + "[" + VALID_PUNCTUATION + "]*" + "[" + VALID_DIGITS + "]" + "){3,}" + "[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
|
|
112142
|
+
var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp("^" + "[" + PLUS_CHARS + "]{0,1}" + "(?:" + "[" + VALID_PUNCTUATION + "]*" + "[" + VALID_DIGITS + "]" + "){1,2}" + "$", "i");
|
|
112143
|
+
var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + "(?:" + createExtensionPattern() + ")?";
|
|
112144
|
+
var VALID_PHONE_NUMBER_PATTERN = new RegExp("^" + MIN_LENGTH_PHONE_NUMBER_PATTERN + "$" + "|" + "^" + VALID_PHONE_NUMBER_WITH_EXTENSION + "$", "i");
|
|
112145
|
+
function isViablePhoneNumber(number4) {
|
|
112146
|
+
return number4.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number4);
|
|
112147
|
+
}
|
|
112148
|
+
function isViablePhoneNumberStart(number4) {
|
|
112149
|
+
return VALID_PHONE_NUMBER_START_REG_EXP.test(number4);
|
|
112150
|
+
}
|
|
112151
|
+
|
|
112152
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js
|
|
112153
|
+
var EXTN_PATTERN = new RegExp("(?:" + createExtensionPattern() + ")$", "i");
|
|
112154
|
+
function extractExtension(number4) {
|
|
112155
|
+
var start = number4.search(EXTN_PATTERN);
|
|
112156
|
+
if (start < 0) {
|
|
112157
|
+
return {};
|
|
112158
|
+
}
|
|
112159
|
+
var numberWithoutExtension = number4.slice(0, start);
|
|
112160
|
+
var matches = number4.match(EXTN_PATTERN);
|
|
112161
|
+
var i2 = 1;
|
|
112162
|
+
while (i2 < matches.length) {
|
|
112163
|
+
if (matches[i2]) {
|
|
112164
|
+
return {
|
|
112165
|
+
number: numberWithoutExtension,
|
|
112166
|
+
ext: matches[i2]
|
|
112167
|
+
};
|
|
112168
|
+
}
|
|
112169
|
+
i2++;
|
|
112170
|
+
}
|
|
112171
|
+
}
|
|
112172
|
+
|
|
112173
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/parseDigits.js
|
|
112174
|
+
var DIGITS = {
|
|
112175
|
+
"0": "0",
|
|
112176
|
+
"1": "1",
|
|
112177
|
+
"2": "2",
|
|
112178
|
+
"3": "3",
|
|
112179
|
+
"4": "4",
|
|
112180
|
+
"5": "5",
|
|
112181
|
+
"6": "6",
|
|
112182
|
+
"7": "7",
|
|
112183
|
+
"8": "8",
|
|
112184
|
+
"9": "9",
|
|
112185
|
+
"\uFF10": "0",
|
|
112186
|
+
"\uFF11": "1",
|
|
112187
|
+
"\uFF12": "2",
|
|
112188
|
+
"\uFF13": "3",
|
|
112189
|
+
"\uFF14": "4",
|
|
112190
|
+
"\uFF15": "5",
|
|
112191
|
+
"\uFF16": "6",
|
|
112192
|
+
"\uFF17": "7",
|
|
112193
|
+
"\uFF18": "8",
|
|
112194
|
+
"\uFF19": "9",
|
|
112195
|
+
"\u0660": "0",
|
|
112196
|
+
"\u0661": "1",
|
|
112197
|
+
"\u0662": "2",
|
|
112198
|
+
"\u0663": "3",
|
|
112199
|
+
"\u0664": "4",
|
|
112200
|
+
"\u0665": "5",
|
|
112201
|
+
"\u0666": "6",
|
|
112202
|
+
"\u0667": "7",
|
|
112203
|
+
"\u0668": "8",
|
|
112204
|
+
"\u0669": "9",
|
|
112205
|
+
"\u06F0": "0",
|
|
112206
|
+
"\u06F1": "1",
|
|
112207
|
+
"\u06F2": "2",
|
|
112208
|
+
"\u06F3": "3",
|
|
112209
|
+
"\u06F4": "4",
|
|
112210
|
+
"\u06F5": "5",
|
|
112211
|
+
"\u06F6": "6",
|
|
112212
|
+
"\u06F7": "7",
|
|
112213
|
+
"\u06F8": "8",
|
|
112214
|
+
"\u06F9": "9"
|
|
112215
|
+
};
|
|
112216
|
+
function parseDigit(character) {
|
|
112217
|
+
return DIGITS[character];
|
|
112218
|
+
}
|
|
112219
|
+
|
|
112220
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js
|
|
112029
112221
|
function _createForOfIteratorHelperLoose(r3, e4) {
|
|
112030
112222
|
var t9 = typeof Symbol != "undefined" && r3[Symbol.iterator] || r3["@@iterator"];
|
|
112031
112223
|
if (t9)
|
|
112032
112224
|
return (t9 = t9.call(r3)).next.bind(t9);
|
|
112033
|
-
if (Array.isArray(r3) || (t9 =
|
|
112225
|
+
if (Array.isArray(r3) || (t9 = _unsupportedIterableToArray2(r3)) || e4 && r3 && typeof r3.length == "number") {
|
|
112034
112226
|
t9 && (r3 = t9);
|
|
112035
112227
|
var o = 0;
|
|
112036
112228
|
return function() {
|
|
@@ -112040,15 +112232,64 @@ function _createForOfIteratorHelperLoose(r3, e4) {
|
|
|
112040
112232
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
112041
112233
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
112042
112234
|
}
|
|
112043
|
-
function
|
|
112235
|
+
function _unsupportedIterableToArray2(r3, a) {
|
|
112044
112236
|
if (r3) {
|
|
112045
112237
|
if (typeof r3 == "string")
|
|
112046
|
-
return
|
|
112238
|
+
return _arrayLikeToArray2(r3, a);
|
|
112047
112239
|
var t9 = {}.toString.call(r3).slice(8, -1);
|
|
112048
|
-
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ?
|
|
112240
|
+
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ? _arrayLikeToArray2(r3, a) : undefined;
|
|
112049
112241
|
}
|
|
112050
112242
|
}
|
|
112051
|
-
function
|
|
112243
|
+
function _arrayLikeToArray2(r3, a) {
|
|
112244
|
+
(a == null || a > r3.length) && (a = r3.length);
|
|
112245
|
+
for (var e4 = 0, n7 = Array(a);e4 < a; e4++)
|
|
112246
|
+
n7[e4] = r3[e4];
|
|
112247
|
+
return n7;
|
|
112248
|
+
}
|
|
112249
|
+
function parseIncompletePhoneNumber(string4) {
|
|
112250
|
+
var result = "";
|
|
112251
|
+
for (var _iterator = _createForOfIteratorHelperLoose(string4.split("")), _step;!(_step = _iterator()).done; ) {
|
|
112252
|
+
var character = _step.value;
|
|
112253
|
+
result += parsePhoneNumberCharacter(character, result) || "";
|
|
112254
|
+
}
|
|
112255
|
+
return result;
|
|
112256
|
+
}
|
|
112257
|
+
function parsePhoneNumberCharacter(character, prevParsedCharacters, eventListener) {
|
|
112258
|
+
if (character === "+") {
|
|
112259
|
+
if (prevParsedCharacters) {
|
|
112260
|
+
if (typeof eventListener === "function") {
|
|
112261
|
+
eventListener("end");
|
|
112262
|
+
}
|
|
112263
|
+
return;
|
|
112264
|
+
}
|
|
112265
|
+
return "+";
|
|
112266
|
+
}
|
|
112267
|
+
return parseDigit(character);
|
|
112268
|
+
}
|
|
112269
|
+
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js
|
|
112270
|
+
function _createForOfIteratorHelperLoose2(r3, e4) {
|
|
112271
|
+
var t9 = typeof Symbol != "undefined" && r3[Symbol.iterator] || r3["@@iterator"];
|
|
112272
|
+
if (t9)
|
|
112273
|
+
return (t9 = t9.call(r3)).next.bind(t9);
|
|
112274
|
+
if (Array.isArray(r3) || (t9 = _unsupportedIterableToArray3(r3)) || e4 && r3 && typeof r3.length == "number") {
|
|
112275
|
+
t9 && (r3 = t9);
|
|
112276
|
+
var o = 0;
|
|
112277
|
+
return function() {
|
|
112278
|
+
return o >= r3.length ? { done: true } : { done: false, value: r3[o++] };
|
|
112279
|
+
};
|
|
112280
|
+
}
|
|
112281
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
112282
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
112283
|
+
}
|
|
112284
|
+
function _unsupportedIterableToArray3(r3, a) {
|
|
112285
|
+
if (r3) {
|
|
112286
|
+
if (typeof r3 == "string")
|
|
112287
|
+
return _arrayLikeToArray3(r3, a);
|
|
112288
|
+
var t9 = {}.toString.call(r3).slice(8, -1);
|
|
112289
|
+
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ? _arrayLikeToArray3(r3, a) : undefined;
|
|
112290
|
+
}
|
|
112291
|
+
}
|
|
112292
|
+
function _arrayLikeToArray3(r3, a) {
|
|
112052
112293
|
(a == null || a > r3.length) && (a = r3.length);
|
|
112053
112294
|
for (var e4 = 0, n7 = Array(a);e4 < a; e4++)
|
|
112054
112295
|
n7[e4] = r3[e4];
|
|
@@ -112056,7 +112297,7 @@ function _arrayLikeToArray(r3, a) {
|
|
|
112056
112297
|
}
|
|
112057
112298
|
function mergeArrays(a, b) {
|
|
112058
112299
|
var merged = a.slice();
|
|
112059
|
-
for (var _iterator =
|
|
112300
|
+
for (var _iterator = _createForOfIteratorHelperLoose2(b), _step;!(_step = _iterator()).done; ) {
|
|
112060
112301
|
var element = _step.value;
|
|
112061
112302
|
if (a.indexOf(element) < 0) {
|
|
112062
112303
|
merged.push(element);
|
|
@@ -112159,11 +112400,11 @@ function matchesEntirely(text, regularExpressionText) {
|
|
|
112159
112400
|
}
|
|
112160
112401
|
|
|
112161
112402
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getNumberType.js
|
|
112162
|
-
function
|
|
112403
|
+
function _createForOfIteratorHelperLoose3(r3, e4) {
|
|
112163
112404
|
var t9 = typeof Symbol != "undefined" && r3[Symbol.iterator] || r3["@@iterator"];
|
|
112164
112405
|
if (t9)
|
|
112165
112406
|
return (t9 = t9.call(r3)).next.bind(t9);
|
|
112166
|
-
if (Array.isArray(r3) || (t9 =
|
|
112407
|
+
if (Array.isArray(r3) || (t9 = _unsupportedIterableToArray4(r3)) || e4 && r3 && typeof r3.length == "number") {
|
|
112167
112408
|
t9 && (r3 = t9);
|
|
112168
112409
|
var o = 0;
|
|
112169
112410
|
return function() {
|
|
@@ -112173,15 +112414,15 @@ function _createForOfIteratorHelperLoose2(r3, e4) {
|
|
|
112173
112414
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
112174
112415
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
112175
112416
|
}
|
|
112176
|
-
function
|
|
112417
|
+
function _unsupportedIterableToArray4(r3, a) {
|
|
112177
112418
|
if (r3) {
|
|
112178
112419
|
if (typeof r3 == "string")
|
|
112179
|
-
return
|
|
112420
|
+
return _arrayLikeToArray4(r3, a);
|
|
112180
112421
|
var t9 = {}.toString.call(r3).slice(8, -1);
|
|
112181
|
-
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ?
|
|
112422
|
+
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ? _arrayLikeToArray4(r3, a) : undefined;
|
|
112182
112423
|
}
|
|
112183
112424
|
}
|
|
112184
|
-
function
|
|
112425
|
+
function _arrayLikeToArray4(r3, a) {
|
|
112185
112426
|
(a == null || a > r3.length) && (a = r3.length);
|
|
112186
112427
|
for (var e4 = 0, n7 = Array(a);e4 < a; e4++)
|
|
112187
112428
|
n7[e4] = r3[e4];
|
|
@@ -112211,7 +112452,7 @@ function getNumberType(input, options, metadata) {
|
|
|
112211
112452
|
}
|
|
112212
112453
|
return "FIXED_LINE";
|
|
112213
112454
|
}
|
|
112214
|
-
for (var _iterator =
|
|
112455
|
+
for (var _iterator = _createForOfIteratorHelperLoose3(NON_FIXED_LINE_PHONE_TYPES), _step;!(_step = _iterator()).done; ) {
|
|
112215
112456
|
var type = _step.value;
|
|
112216
112457
|
if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {
|
|
112217
112458
|
return type;
|
|
@@ -112261,20 +112502,6 @@ function couldNationalNumberBelongToCountry(nationalNumber, country, metadata) {
|
|
|
112261
112502
|
return false;
|
|
112262
112503
|
}
|
|
112263
112504
|
|
|
112264
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/constants.js
|
|
112265
|
-
var MIN_LENGTH_FOR_NSN = 2;
|
|
112266
|
-
var MAX_LENGTH_FOR_NSN = 17;
|
|
112267
|
-
var MAX_LENGTH_COUNTRY_CODE = 3;
|
|
112268
|
-
var VALID_DIGITS = "0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9";
|
|
112269
|
-
var DASHES = "-\u2010-\u2015\u2212\u30FC\uFF0D";
|
|
112270
|
-
var SLASHES = "\uFF0F/";
|
|
112271
|
-
var DOTS = "\uFF0E.";
|
|
112272
|
-
var WHITESPACE = " \xA0\xAD\u200B\u2060\u3000";
|
|
112273
|
-
var BRACKETS = "()\uFF08\uFF09\uFF3B\uFF3D\\[\\]";
|
|
112274
|
-
var TILDES = "~\u2053\u223C\uFF5E";
|
|
112275
|
-
var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
|
|
112276
|
-
var PLUS_CHARS = "+\uFF0B";
|
|
112277
|
-
|
|
112278
112505
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js
|
|
112279
112506
|
var CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
|
|
112280
112507
|
function stripIddPrefix(number4, country, callingCode, metadata) {
|
|
@@ -112342,11 +112569,11 @@ function extractNationalNumberFromPossiblyIncompleteNumber(number4, metadata) {
|
|
|
112342
112569
|
}
|
|
112343
112570
|
|
|
112344
112571
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js
|
|
112345
|
-
function
|
|
112572
|
+
function _createForOfIteratorHelperLoose4(r3, e4) {
|
|
112346
112573
|
var t9 = typeof Symbol != "undefined" && r3[Symbol.iterator] || r3["@@iterator"];
|
|
112347
112574
|
if (t9)
|
|
112348
112575
|
return (t9 = t9.call(r3)).next.bind(t9);
|
|
112349
|
-
if (Array.isArray(r3) || (t9 =
|
|
112576
|
+
if (Array.isArray(r3) || (t9 = _unsupportedIterableToArray5(r3)) || e4 && r3 && typeof r3.length == "number") {
|
|
112350
112577
|
t9 && (r3 = t9);
|
|
112351
112578
|
var o = 0;
|
|
112352
112579
|
return function() {
|
|
@@ -112356,15 +112583,15 @@ function _createForOfIteratorHelperLoose3(r3, e4) {
|
|
|
112356
112583
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
112357
112584
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
112358
112585
|
}
|
|
112359
|
-
function
|
|
112586
|
+
function _unsupportedIterableToArray5(r3, a) {
|
|
112360
112587
|
if (r3) {
|
|
112361
112588
|
if (typeof r3 == "string")
|
|
112362
|
-
return
|
|
112589
|
+
return _arrayLikeToArray5(r3, a);
|
|
112363
112590
|
var t9 = {}.toString.call(r3).slice(8, -1);
|
|
112364
|
-
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ?
|
|
112591
|
+
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ? _arrayLikeToArray5(r3, a) : undefined;
|
|
112365
112592
|
}
|
|
112366
112593
|
}
|
|
112367
|
-
function
|
|
112594
|
+
function _arrayLikeToArray5(r3, a) {
|
|
112368
112595
|
(a == null || a > r3.length) && (a = r3.length);
|
|
112369
112596
|
for (var e4 = 0, n7 = Array(a);e4 < a; e4++)
|
|
112370
112597
|
n7[e4] = r3[e4];
|
|
@@ -112373,7 +112600,7 @@ function _arrayLikeToArray3(r3, a) {
|
|
|
112373
112600
|
function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
|
|
112374
112601
|
var { countries, metadata } = _ref;
|
|
112375
112602
|
metadata = new Metadata(metadata);
|
|
112376
|
-
for (var _iterator =
|
|
112603
|
+
for (var _iterator = _createForOfIteratorHelperLoose4(countries), _step;!(_step = _iterator()).done; ) {
|
|
112377
112604
|
var country = _step.value;
|
|
112378
112605
|
metadata.selectNumberingPlan(country);
|
|
112379
112606
|
if (metadata.leadingDigits()) {
|
|
@@ -112454,6 +112681,7 @@ function isPossibleIncompleteNationalNumber(nationalNumber, country, metadata) {
|
|
|
112454
112681
|
return true;
|
|
112455
112682
|
}
|
|
112456
112683
|
}
|
|
112684
|
+
|
|
112457
112685
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js
|
|
112458
112686
|
function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number4, country, defaultCountry, defaultCallingCode, metadata) {
|
|
112459
112687
|
var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadata) : defaultCallingCode;
|
|
@@ -112551,46 +112779,6 @@ function getIddPrefix(country, callingCode, metadata) {
|
|
|
112551
112779
|
}
|
|
112552
112780
|
}
|
|
112553
112781
|
|
|
112554
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
|
|
112555
|
-
var RFC3966_EXTN_PREFIX = ";ext=";
|
|
112556
|
-
var getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
|
|
112557
|
-
return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
|
|
112558
|
-
};
|
|
112559
|
-
function createExtensionPattern(purpose) {
|
|
112560
|
-
var extLimitAfterExplicitLabel = "20";
|
|
112561
|
-
var extLimitAfterLikelyLabel = "15";
|
|
112562
|
-
var extLimitAfterAmbiguousChar = "9";
|
|
112563
|
-
var extLimitWhenNotSure = "6";
|
|
112564
|
-
var possibleSeparatorsBetweenNumberAndExtLabel = "[ \xA0\\t,]*";
|
|
112565
|
-
var possibleCharsAfterExtLabel = "[:\\.\uFF0E]?[ \xA0\\t,-]*";
|
|
112566
|
-
var optionalExtnSuffix = "#?";
|
|
112567
|
-
var explicitExtLabels = "(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)";
|
|
112568
|
-
var ambiguousExtLabels = "(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)";
|
|
112569
|
-
var ambiguousSeparator = "[- ]+";
|
|
112570
|
-
var possibleSeparatorsNumberExtLabelNoComma = "[ \xA0\\t]*";
|
|
112571
|
-
var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
|
|
112572
|
-
var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
|
|
112573
|
-
var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
|
|
112574
|
-
var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
|
|
112575
|
-
var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
|
|
112576
|
-
var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
|
|
112577
|
-
var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
|
|
112578
|
-
return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
|
|
112579
|
-
}
|
|
112580
|
-
|
|
112581
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
|
|
112582
|
-
var MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
|
|
112583
|
-
var VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}" + "(?:" + "[" + VALID_PUNCTUATION + "]*" + "[" + VALID_DIGITS + "]" + "){3,}" + "[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
|
|
112584
|
-
var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp("^" + "[" + PLUS_CHARS + "]{0,1}" + "(?:" + "[" + VALID_PUNCTUATION + "]*" + "[" + VALID_DIGITS + "]" + "){1,2}" + "$", "i");
|
|
112585
|
-
var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + "(?:" + createExtensionPattern() + ")?";
|
|
112586
|
-
var VALID_PHONE_NUMBER_PATTERN = new RegExp("^" + MIN_LENGTH_PHONE_NUMBER_PATTERN + "$" + "|" + "^" + VALID_PHONE_NUMBER_WITH_EXTENSION + "$", "i");
|
|
112587
|
-
function isViablePhoneNumber(number4) {
|
|
112588
|
-
return number4.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number4);
|
|
112589
|
-
}
|
|
112590
|
-
function isViablePhoneNumberStart(number4) {
|
|
112591
|
-
return VALID_PHONE_NUMBER_START_REG_EXP.test(number4);
|
|
112592
|
-
}
|
|
112593
|
-
|
|
112594
112782
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/RFC3966.js
|
|
112595
112783
|
function formatRFC3966(_ref) {
|
|
112596
112784
|
var { number: number4, ext } = _ref;
|
|
@@ -112728,15 +112916,15 @@ function pickFirstMatchingElement(elements, testFunction) {
|
|
|
112728
112916
|
}
|
|
112729
112917
|
|
|
112730
112918
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/PhoneNumber.js
|
|
112731
|
-
function
|
|
112919
|
+
function _typeof4(o) {
|
|
112732
112920
|
"@babel/helpers - typeof";
|
|
112733
|
-
return
|
|
112921
|
+
return _typeof4 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
112734
112922
|
return typeof o2;
|
|
112735
112923
|
} : function(o2) {
|
|
112736
112924
|
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
112737
|
-
},
|
|
112925
|
+
}, _typeof4(o);
|
|
112738
112926
|
}
|
|
112739
|
-
function
|
|
112927
|
+
function ownKeys2(e4, r3) {
|
|
112740
112928
|
var t9 = Object.keys(e4);
|
|
112741
112929
|
if (Object.getOwnPropertySymbols) {
|
|
112742
112930
|
var o = Object.getOwnPropertySymbols(e4);
|
|
@@ -112746,44 +112934,44 @@ function ownKeys(e4, r3) {
|
|
|
112746
112934
|
}
|
|
112747
112935
|
return t9;
|
|
112748
112936
|
}
|
|
112749
|
-
function
|
|
112937
|
+
function _objectSpread2(e4) {
|
|
112750
112938
|
for (var r3 = 1;r3 < arguments.length; r3++) {
|
|
112751
112939
|
var t9 = arguments[r3] != null ? arguments[r3] : {};
|
|
112752
|
-
r3 % 2 ?
|
|
112753
|
-
|
|
112754
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(t9)) :
|
|
112940
|
+
r3 % 2 ? ownKeys2(Object(t9), true).forEach(function(r4) {
|
|
112941
|
+
_defineProperty2(e4, r4, t9[r4]);
|
|
112942
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(t9)) : ownKeys2(Object(t9)).forEach(function(r4) {
|
|
112755
112943
|
Object.defineProperty(e4, r4, Object.getOwnPropertyDescriptor(t9, r4));
|
|
112756
112944
|
});
|
|
112757
112945
|
}
|
|
112758
112946
|
return e4;
|
|
112759
112947
|
}
|
|
112760
|
-
function
|
|
112761
|
-
return (r3 =
|
|
112948
|
+
function _defineProperty2(e4, r3, t9) {
|
|
112949
|
+
return (r3 = _toPropertyKey4(r3)) in e4 ? Object.defineProperty(e4, r3, { value: t9, enumerable: true, configurable: true, writable: true }) : e4[r3] = t9, e4;
|
|
112762
112950
|
}
|
|
112763
|
-
function
|
|
112951
|
+
function _classCallCheck3(a, n7) {
|
|
112764
112952
|
if (!(a instanceof n7))
|
|
112765
112953
|
throw new TypeError("Cannot call a class as a function");
|
|
112766
112954
|
}
|
|
112767
|
-
function
|
|
112955
|
+
function _defineProperties3(e4, r3) {
|
|
112768
112956
|
for (var t9 = 0;t9 < r3.length; t9++) {
|
|
112769
112957
|
var o = r3[t9];
|
|
112770
|
-
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e4,
|
|
112958
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e4, _toPropertyKey4(o.key), o);
|
|
112771
112959
|
}
|
|
112772
112960
|
}
|
|
112773
|
-
function
|
|
112774
|
-
return r3 &&
|
|
112961
|
+
function _createClass3(e4, r3, t9) {
|
|
112962
|
+
return r3 && _defineProperties3(e4.prototype, r3), t9 && _defineProperties3(e4, t9), Object.defineProperty(e4, "prototype", { writable: false }), e4;
|
|
112775
112963
|
}
|
|
112776
|
-
function
|
|
112777
|
-
var i2 =
|
|
112778
|
-
return
|
|
112964
|
+
function _toPropertyKey4(t9) {
|
|
112965
|
+
var i2 = _toPrimitive4(t9, "string");
|
|
112966
|
+
return _typeof4(i2) == "symbol" ? i2 : i2 + "";
|
|
112779
112967
|
}
|
|
112780
|
-
function
|
|
112781
|
-
if (
|
|
112968
|
+
function _toPrimitive4(t9, r3) {
|
|
112969
|
+
if (_typeof4(t9) != "object" || !t9)
|
|
112782
112970
|
return t9;
|
|
112783
112971
|
var e4 = t9[Symbol.toPrimitive];
|
|
112784
112972
|
if (e4 !== undefined) {
|
|
112785
112973
|
var i2 = e4.call(t9, r3 || "default");
|
|
112786
|
-
if (
|
|
112974
|
+
if (_typeof4(i2) != "object")
|
|
112787
112975
|
return i2;
|
|
112788
112976
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
112789
112977
|
}
|
|
@@ -112792,7 +112980,7 @@ function _toPrimitive2(t9, r3) {
|
|
|
112792
112980
|
var USE_NON_GEOGRAPHIC_COUNTRY_CODE2 = false;
|
|
112793
112981
|
var PhoneNumber = /* @__PURE__ */ function() {
|
|
112794
112982
|
function PhoneNumber2(countryOrCountryCallingCode, nationalNumber, metadata) {
|
|
112795
|
-
|
|
112983
|
+
_classCallCheck3(this, PhoneNumber2);
|
|
112796
112984
|
if (!countryOrCountryCallingCode) {
|
|
112797
112985
|
throw new TypeError("First argument is required");
|
|
112798
112986
|
}
|
|
@@ -112831,7 +113019,7 @@ var PhoneNumber = /* @__PURE__ */ function() {
|
|
|
112831
113019
|
return metadata;
|
|
112832
113020
|
};
|
|
112833
113021
|
}
|
|
112834
|
-
return
|
|
113022
|
+
return _createClass3(PhoneNumber2, [{
|
|
112835
113023
|
key: "setExt",
|
|
112836
113024
|
value: function setExt(ext) {
|
|
112837
113025
|
this.ext = ext;
|
|
@@ -112879,7 +113067,7 @@ var PhoneNumber = /* @__PURE__ */ function() {
|
|
|
112879
113067
|
}, {
|
|
112880
113068
|
key: "format",
|
|
112881
113069
|
value: function format(_format, options) {
|
|
112882
|
-
return formatNumber(this, _format, options ?
|
|
113070
|
+
return formatNumber(this, _format, options ? _objectSpread2(_objectSpread2({}, options), {}, {
|
|
112883
113071
|
v2: true
|
|
112884
113072
|
}) : {
|
|
112885
113073
|
v2: true
|
|
@@ -112928,246 +113116,6 @@ function getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJs
|
|
|
112928
113116
|
}
|
|
112929
113117
|
var E164_NUMBER_REGEXP = /^\+\d+$/;
|
|
112930
113118
|
|
|
112931
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/ParseError.js
|
|
112932
|
-
function _typeof3(o) {
|
|
112933
|
-
"@babel/helpers - typeof";
|
|
112934
|
-
return _typeof3 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
112935
|
-
return typeof o2;
|
|
112936
|
-
} : function(o2) {
|
|
112937
|
-
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
112938
|
-
}, _typeof3(o);
|
|
112939
|
-
}
|
|
112940
|
-
function _defineProperties3(e4, r3) {
|
|
112941
|
-
for (var t9 = 0;t9 < r3.length; t9++) {
|
|
112942
|
-
var o = r3[t9];
|
|
112943
|
-
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e4, _toPropertyKey3(o.key), o);
|
|
112944
|
-
}
|
|
112945
|
-
}
|
|
112946
|
-
function _createClass3(e4, r3, t9) {
|
|
112947
|
-
return r3 && _defineProperties3(e4.prototype, r3), t9 && _defineProperties3(e4, t9), Object.defineProperty(e4, "prototype", { writable: false }), e4;
|
|
112948
|
-
}
|
|
112949
|
-
function _toPropertyKey3(t9) {
|
|
112950
|
-
var i2 = _toPrimitive3(t9, "string");
|
|
112951
|
-
return _typeof3(i2) == "symbol" ? i2 : i2 + "";
|
|
112952
|
-
}
|
|
112953
|
-
function _toPrimitive3(t9, r3) {
|
|
112954
|
-
if (_typeof3(t9) != "object" || !t9)
|
|
112955
|
-
return t9;
|
|
112956
|
-
var e4 = t9[Symbol.toPrimitive];
|
|
112957
|
-
if (e4 !== undefined) {
|
|
112958
|
-
var i2 = e4.call(t9, r3 || "default");
|
|
112959
|
-
if (_typeof3(i2) != "object")
|
|
112960
|
-
return i2;
|
|
112961
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
112962
|
-
}
|
|
112963
|
-
return (r3 === "string" ? String : Number)(t9);
|
|
112964
|
-
}
|
|
112965
|
-
function _classCallCheck3(a, n7) {
|
|
112966
|
-
if (!(a instanceof n7))
|
|
112967
|
-
throw new TypeError("Cannot call a class as a function");
|
|
112968
|
-
}
|
|
112969
|
-
function _callSuper(t9, o, e4) {
|
|
112970
|
-
return o = _getPrototypeOf(o), _possibleConstructorReturn(t9, _isNativeReflectConstruct() ? Reflect.construct(o, e4 || [], _getPrototypeOf(t9).constructor) : o.apply(t9, e4));
|
|
112971
|
-
}
|
|
112972
|
-
function _possibleConstructorReturn(t9, e4) {
|
|
112973
|
-
if (e4 && (_typeof3(e4) == "object" || typeof e4 == "function"))
|
|
112974
|
-
return e4;
|
|
112975
|
-
if (e4 !== undefined)
|
|
112976
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
112977
|
-
return _assertThisInitialized(t9);
|
|
112978
|
-
}
|
|
112979
|
-
function _assertThisInitialized(e4) {
|
|
112980
|
-
if (e4 === undefined)
|
|
112981
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
112982
|
-
return e4;
|
|
112983
|
-
}
|
|
112984
|
-
function _inherits(t9, e4) {
|
|
112985
|
-
if (typeof e4 != "function" && e4 !== null)
|
|
112986
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
112987
|
-
t9.prototype = Object.create(e4 && e4.prototype, { constructor: { value: t9, writable: true, configurable: true } }), Object.defineProperty(t9, "prototype", { writable: false }), e4 && _setPrototypeOf(t9, e4);
|
|
112988
|
-
}
|
|
112989
|
-
function _wrapNativeSuper(t9) {
|
|
112990
|
-
var r3 = typeof Map == "function" ? new Map : undefined;
|
|
112991
|
-
return _wrapNativeSuper = function _wrapNativeSuper2(t10) {
|
|
112992
|
-
if (t10 === null || !_isNativeFunction(t10))
|
|
112993
|
-
return t10;
|
|
112994
|
-
if (typeof t10 != "function")
|
|
112995
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
112996
|
-
if (r3 !== undefined) {
|
|
112997
|
-
if (r3.has(t10))
|
|
112998
|
-
return r3.get(t10);
|
|
112999
|
-
r3.set(t10, Wrapper);
|
|
113000
|
-
}
|
|
113001
|
-
function Wrapper() {
|
|
113002
|
-
return _construct(t10, arguments, _getPrototypeOf(this).constructor);
|
|
113003
|
-
}
|
|
113004
|
-
return Wrapper.prototype = Object.create(t10.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }), _setPrototypeOf(Wrapper, t10);
|
|
113005
|
-
}, _wrapNativeSuper(t9);
|
|
113006
|
-
}
|
|
113007
|
-
function _construct(t9, e4, r3) {
|
|
113008
|
-
if (_isNativeReflectConstruct())
|
|
113009
|
-
return Reflect.construct.apply(null, arguments);
|
|
113010
|
-
var o = [null];
|
|
113011
|
-
o.push.apply(o, e4);
|
|
113012
|
-
var p = new (t9.bind.apply(t9, o));
|
|
113013
|
-
return r3 && _setPrototypeOf(p, r3.prototype), p;
|
|
113014
|
-
}
|
|
113015
|
-
function _isNativeReflectConstruct() {
|
|
113016
|
-
try {
|
|
113017
|
-
var t9 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
113018
|
-
} catch (t10) {}
|
|
113019
|
-
return (_isNativeReflectConstruct = function _isNativeReflectConstruct2() {
|
|
113020
|
-
return !!t9;
|
|
113021
|
-
})();
|
|
113022
|
-
}
|
|
113023
|
-
function _isNativeFunction(t9) {
|
|
113024
|
-
try {
|
|
113025
|
-
return Function.toString.call(t9).indexOf("[native code]") !== -1;
|
|
113026
|
-
} catch (n7) {
|
|
113027
|
-
return typeof t9 == "function";
|
|
113028
|
-
}
|
|
113029
|
-
}
|
|
113030
|
-
function _setPrototypeOf(t9, e4) {
|
|
113031
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t10, e5) {
|
|
113032
|
-
return t10.__proto__ = e5, t10;
|
|
113033
|
-
}, _setPrototypeOf(t9, e4);
|
|
113034
|
-
}
|
|
113035
|
-
function _getPrototypeOf(t9) {
|
|
113036
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t10) {
|
|
113037
|
-
return t10.__proto__ || Object.getPrototypeOf(t10);
|
|
113038
|
-
}, _getPrototypeOf(t9);
|
|
113039
|
-
}
|
|
113040
|
-
var ParseError = /* @__PURE__ */ function(_Error) {
|
|
113041
|
-
function ParseError2(code) {
|
|
113042
|
-
var _this;
|
|
113043
|
-
_classCallCheck3(this, ParseError2);
|
|
113044
|
-
_this = _callSuper(this, ParseError2, [code]);
|
|
113045
|
-
Object.setPrototypeOf(_this, ParseError2.prototype);
|
|
113046
|
-
_this.name = _this.constructor.name;
|
|
113047
|
-
return _this;
|
|
113048
|
-
}
|
|
113049
|
-
_inherits(ParseError2, _Error);
|
|
113050
|
-
return _createClass3(ParseError2);
|
|
113051
|
-
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
113052
|
-
|
|
113053
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js
|
|
113054
|
-
var EXTN_PATTERN = new RegExp("(?:" + createExtensionPattern() + ")$", "i");
|
|
113055
|
-
function extractExtension(number4) {
|
|
113056
|
-
var start = number4.search(EXTN_PATTERN);
|
|
113057
|
-
if (start < 0) {
|
|
113058
|
-
return {};
|
|
113059
|
-
}
|
|
113060
|
-
var numberWithoutExtension = number4.slice(0, start);
|
|
113061
|
-
var matches = number4.match(EXTN_PATTERN);
|
|
113062
|
-
var i2 = 1;
|
|
113063
|
-
while (i2 < matches.length) {
|
|
113064
|
-
if (matches[i2]) {
|
|
113065
|
-
return {
|
|
113066
|
-
number: numberWithoutExtension,
|
|
113067
|
-
ext: matches[i2]
|
|
113068
|
-
};
|
|
113069
|
-
}
|
|
113070
|
-
i2++;
|
|
113071
|
-
}
|
|
113072
|
-
}
|
|
113073
|
-
|
|
113074
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/parseDigits.js
|
|
113075
|
-
var DIGITS = {
|
|
113076
|
-
"0": "0",
|
|
113077
|
-
"1": "1",
|
|
113078
|
-
"2": "2",
|
|
113079
|
-
"3": "3",
|
|
113080
|
-
"4": "4",
|
|
113081
|
-
"5": "5",
|
|
113082
|
-
"6": "6",
|
|
113083
|
-
"7": "7",
|
|
113084
|
-
"8": "8",
|
|
113085
|
-
"9": "9",
|
|
113086
|
-
"\uFF10": "0",
|
|
113087
|
-
"\uFF11": "1",
|
|
113088
|
-
"\uFF12": "2",
|
|
113089
|
-
"\uFF13": "3",
|
|
113090
|
-
"\uFF14": "4",
|
|
113091
|
-
"\uFF15": "5",
|
|
113092
|
-
"\uFF16": "6",
|
|
113093
|
-
"\uFF17": "7",
|
|
113094
|
-
"\uFF18": "8",
|
|
113095
|
-
"\uFF19": "9",
|
|
113096
|
-
"\u0660": "0",
|
|
113097
|
-
"\u0661": "1",
|
|
113098
|
-
"\u0662": "2",
|
|
113099
|
-
"\u0663": "3",
|
|
113100
|
-
"\u0664": "4",
|
|
113101
|
-
"\u0665": "5",
|
|
113102
|
-
"\u0666": "6",
|
|
113103
|
-
"\u0667": "7",
|
|
113104
|
-
"\u0668": "8",
|
|
113105
|
-
"\u0669": "9",
|
|
113106
|
-
"\u06F0": "0",
|
|
113107
|
-
"\u06F1": "1",
|
|
113108
|
-
"\u06F2": "2",
|
|
113109
|
-
"\u06F3": "3",
|
|
113110
|
-
"\u06F4": "4",
|
|
113111
|
-
"\u06F5": "5",
|
|
113112
|
-
"\u06F6": "6",
|
|
113113
|
-
"\u06F7": "7",
|
|
113114
|
-
"\u06F8": "8",
|
|
113115
|
-
"\u06F9": "9"
|
|
113116
|
-
};
|
|
113117
|
-
function parseDigit(character) {
|
|
113118
|
-
return DIGITS[character];
|
|
113119
|
-
}
|
|
113120
|
-
|
|
113121
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js
|
|
113122
|
-
function _createForOfIteratorHelperLoose4(r3, e4) {
|
|
113123
|
-
var t9 = typeof Symbol != "undefined" && r3[Symbol.iterator] || r3["@@iterator"];
|
|
113124
|
-
if (t9)
|
|
113125
|
-
return (t9 = t9.call(r3)).next.bind(t9);
|
|
113126
|
-
if (Array.isArray(r3) || (t9 = _unsupportedIterableToArray4(r3)) || e4 && r3 && typeof r3.length == "number") {
|
|
113127
|
-
t9 && (r3 = t9);
|
|
113128
|
-
var o = 0;
|
|
113129
|
-
return function() {
|
|
113130
|
-
return o >= r3.length ? { done: true } : { done: false, value: r3[o++] };
|
|
113131
|
-
};
|
|
113132
|
-
}
|
|
113133
|
-
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
113134
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
113135
|
-
}
|
|
113136
|
-
function _unsupportedIterableToArray4(r3, a) {
|
|
113137
|
-
if (r3) {
|
|
113138
|
-
if (typeof r3 == "string")
|
|
113139
|
-
return _arrayLikeToArray4(r3, a);
|
|
113140
|
-
var t9 = {}.toString.call(r3).slice(8, -1);
|
|
113141
|
-
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ? _arrayLikeToArray4(r3, a) : undefined;
|
|
113142
|
-
}
|
|
113143
|
-
}
|
|
113144
|
-
function _arrayLikeToArray4(r3, a) {
|
|
113145
|
-
(a == null || a > r3.length) && (a = r3.length);
|
|
113146
|
-
for (var e4 = 0, n7 = Array(a);e4 < a; e4++)
|
|
113147
|
-
n7[e4] = r3[e4];
|
|
113148
|
-
return n7;
|
|
113149
|
-
}
|
|
113150
|
-
function parseIncompletePhoneNumber(string4) {
|
|
113151
|
-
var result = "";
|
|
113152
|
-
for (var _iterator = _createForOfIteratorHelperLoose4(string4.split("")), _step;!(_step = _iterator()).done; ) {
|
|
113153
|
-
var character = _step.value;
|
|
113154
|
-
result += parsePhoneNumberCharacter(character, result) || "";
|
|
113155
|
-
}
|
|
113156
|
-
return result;
|
|
113157
|
-
}
|
|
113158
|
-
function parsePhoneNumberCharacter(character, prevParsedCharacters, eventListener) {
|
|
113159
|
-
if (character === "+") {
|
|
113160
|
-
if (prevParsedCharacters) {
|
|
113161
|
-
if (typeof eventListener === "function") {
|
|
113162
|
-
eventListener("end");
|
|
113163
|
-
}
|
|
113164
|
-
return;
|
|
113165
|
-
}
|
|
113166
|
-
return "+";
|
|
113167
|
-
}
|
|
113168
|
-
return parseDigit(character);
|
|
113169
|
-
}
|
|
113170
|
-
|
|
113171
113119
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js
|
|
113172
113120
|
var PLUS_SIGN = "+";
|
|
113173
113121
|
var RFC3966_VISUAL_SEPARATOR_ = "[\\-\\.\\(\\)]?";
|
|
@@ -113414,61 +113362,6 @@ function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCo
|
|
|
113414
113362
|
}
|
|
113415
113363
|
|
|
113416
113364
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js
|
|
113417
|
-
function _typeof4(o) {
|
|
113418
|
-
"@babel/helpers - typeof";
|
|
113419
|
-
return _typeof4 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
113420
|
-
return typeof o2;
|
|
113421
|
-
} : function(o2) {
|
|
113422
|
-
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
113423
|
-
}, _typeof4(o);
|
|
113424
|
-
}
|
|
113425
|
-
function ownKeys2(e4, r3) {
|
|
113426
|
-
var t9 = Object.keys(e4);
|
|
113427
|
-
if (Object.getOwnPropertySymbols) {
|
|
113428
|
-
var o = Object.getOwnPropertySymbols(e4);
|
|
113429
|
-
r3 && (o = o.filter(function(r4) {
|
|
113430
|
-
return Object.getOwnPropertyDescriptor(e4, r4).enumerable;
|
|
113431
|
-
})), t9.push.apply(t9, o);
|
|
113432
|
-
}
|
|
113433
|
-
return t9;
|
|
113434
|
-
}
|
|
113435
|
-
function _objectSpread2(e4) {
|
|
113436
|
-
for (var r3 = 1;r3 < arguments.length; r3++) {
|
|
113437
|
-
var t9 = arguments[r3] != null ? arguments[r3] : {};
|
|
113438
|
-
r3 % 2 ? ownKeys2(Object(t9), true).forEach(function(r4) {
|
|
113439
|
-
_defineProperty2(e4, r4, t9[r4]);
|
|
113440
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(t9)) : ownKeys2(Object(t9)).forEach(function(r4) {
|
|
113441
|
-
Object.defineProperty(e4, r4, Object.getOwnPropertyDescriptor(t9, r4));
|
|
113442
|
-
});
|
|
113443
|
-
}
|
|
113444
|
-
return e4;
|
|
113445
|
-
}
|
|
113446
|
-
function _defineProperty2(e4, r3, t9) {
|
|
113447
|
-
return (r3 = _toPropertyKey4(r3)) in e4 ? Object.defineProperty(e4, r3, { value: t9, enumerable: true, configurable: true, writable: true }) : e4[r3] = t9, e4;
|
|
113448
|
-
}
|
|
113449
|
-
function _toPropertyKey4(t9) {
|
|
113450
|
-
var i2 = _toPrimitive4(t9, "string");
|
|
113451
|
-
return _typeof4(i2) == "symbol" ? i2 : i2 + "";
|
|
113452
|
-
}
|
|
113453
|
-
function _toPrimitive4(t9, r3) {
|
|
113454
|
-
if (_typeof4(t9) != "object" || !t9)
|
|
113455
|
-
return t9;
|
|
113456
|
-
var e4 = t9[Symbol.toPrimitive];
|
|
113457
|
-
if (e4 !== undefined) {
|
|
113458
|
-
var i2 = e4.call(t9, r3 || "default");
|
|
113459
|
-
if (_typeof4(i2) != "object")
|
|
113460
|
-
return i2;
|
|
113461
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
113462
|
-
}
|
|
113463
|
-
return (r3 === "string" ? String : Number)(t9);
|
|
113464
|
-
}
|
|
113465
|
-
function parsePhoneNumberWithError(text, options, metadata) {
|
|
113466
|
-
return parse5(text, _objectSpread2(_objectSpread2({}, options), {}, {
|
|
113467
|
-
v2: true
|
|
113468
|
-
}), metadata);
|
|
113469
|
-
}
|
|
113470
|
-
|
|
113471
|
-
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/normalizeArguments.js
|
|
113472
113365
|
function _typeof5(o) {
|
|
113473
113366
|
"@babel/helpers - typeof";
|
|
113474
113367
|
return _typeof5 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
@@ -113517,93 +113410,10 @@ function _toPrimitive5(t9, r3) {
|
|
|
113517
113410
|
}
|
|
113518
113411
|
return (r3 === "string" ? String : Number)(t9);
|
|
113519
113412
|
}
|
|
113520
|
-
function
|
|
113521
|
-
return
|
|
113522
|
-
|
|
113523
|
-
|
|
113524
|
-
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113525
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
113526
|
-
}
|
|
113527
|
-
function _unsupportedIterableToArray5(r3, a) {
|
|
113528
|
-
if (r3) {
|
|
113529
|
-
if (typeof r3 == "string")
|
|
113530
|
-
return _arrayLikeToArray5(r3, a);
|
|
113531
|
-
var t9 = {}.toString.call(r3).slice(8, -1);
|
|
113532
|
-
return t9 === "Object" && r3.constructor && (t9 = r3.constructor.name), t9 === "Map" || t9 === "Set" ? Array.from(r3) : t9 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t9) ? _arrayLikeToArray5(r3, a) : undefined;
|
|
113533
|
-
}
|
|
113534
|
-
}
|
|
113535
|
-
function _arrayLikeToArray5(r3, a) {
|
|
113536
|
-
(a == null || a > r3.length) && (a = r3.length);
|
|
113537
|
-
for (var e4 = 0, n7 = Array(a);e4 < a; e4++)
|
|
113538
|
-
n7[e4] = r3[e4];
|
|
113539
|
-
return n7;
|
|
113540
|
-
}
|
|
113541
|
-
function _iterableToArrayLimit(r3, l) {
|
|
113542
|
-
var t9 = r3 == null ? null : typeof Symbol != "undefined" && r3[Symbol.iterator] || r3["@@iterator"];
|
|
113543
|
-
if (t9 != null) {
|
|
113544
|
-
var e4, n7, i2, u, a = [], f = true, o = false;
|
|
113545
|
-
try {
|
|
113546
|
-
if (i2 = (t9 = t9.call(r3)).next, l === 0) {
|
|
113547
|
-
if (Object(t9) !== t9)
|
|
113548
|
-
return;
|
|
113549
|
-
f = false;
|
|
113550
|
-
} else
|
|
113551
|
-
for (;!(f = (e4 = i2.call(t9)).done) && (a.push(e4.value), a.length !== l); f = true)
|
|
113552
|
-
;
|
|
113553
|
-
} catch (r4) {
|
|
113554
|
-
o = true, n7 = r4;
|
|
113555
|
-
} finally {
|
|
113556
|
-
try {
|
|
113557
|
-
if (!f && t9["return"] != null && (u = t9["return"](), Object(u) !== u))
|
|
113558
|
-
return;
|
|
113559
|
-
} finally {
|
|
113560
|
-
if (o)
|
|
113561
|
-
throw n7;
|
|
113562
|
-
}
|
|
113563
|
-
}
|
|
113564
|
-
return a;
|
|
113565
|
-
}
|
|
113566
|
-
}
|
|
113567
|
-
function _arrayWithHoles(r3) {
|
|
113568
|
-
if (Array.isArray(r3))
|
|
113569
|
-
return r3;
|
|
113570
|
-
}
|
|
113571
|
-
function normalizeArguments(args) {
|
|
113572
|
-
var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3];
|
|
113573
|
-
var text;
|
|
113574
|
-
var options;
|
|
113575
|
-
var metadata;
|
|
113576
|
-
if (typeof arg_1 === "string") {
|
|
113577
|
-
text = arg_1;
|
|
113578
|
-
} else
|
|
113579
|
-
throw new TypeError("A text for parsing must be a string.");
|
|
113580
|
-
if (!arg_2 || typeof arg_2 === "string") {
|
|
113581
|
-
if (arg_4) {
|
|
113582
|
-
options = arg_3;
|
|
113583
|
-
metadata = arg_4;
|
|
113584
|
-
} else {
|
|
113585
|
-
options = undefined;
|
|
113586
|
-
metadata = arg_3;
|
|
113587
|
-
}
|
|
113588
|
-
if (arg_2) {
|
|
113589
|
-
options = _objectSpread3({
|
|
113590
|
-
defaultCountry: arg_2
|
|
113591
|
-
}, options);
|
|
113592
|
-
}
|
|
113593
|
-
} else if (isObject2(arg_2)) {
|
|
113594
|
-
if (arg_3) {
|
|
113595
|
-
options = arg_2;
|
|
113596
|
-
metadata = arg_3;
|
|
113597
|
-
} else {
|
|
113598
|
-
metadata = arg_2;
|
|
113599
|
-
}
|
|
113600
|
-
} else
|
|
113601
|
-
throw new Error("Invalid second argument: ".concat(arg_2));
|
|
113602
|
-
return {
|
|
113603
|
-
text,
|
|
113604
|
-
options,
|
|
113605
|
-
metadata
|
|
113606
|
-
};
|
|
113413
|
+
function parsePhoneNumberWithError(text, options, metadata) {
|
|
113414
|
+
return parse5(text, _objectSpread3(_objectSpread3({}, options), {}, {
|
|
113415
|
+
v2: true
|
|
113416
|
+
}), metadata);
|
|
113607
113417
|
}
|
|
113608
113418
|
|
|
113609
113419
|
// ../../node_modules/.bun/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js
|
|
@@ -113758,7 +113568,7 @@ function createCallSchemas(config2) {
|
|
|
113758
113568
|
const endedFields = exports_external.object({
|
|
113759
113569
|
end_timestamp: exports_external.coerce.date().catch(new Date(0)),
|
|
113760
113570
|
duration_ms: exports_external.number().catch(0),
|
|
113761
|
-
disconnection_reason: DisconnectionReasonSchema.catch("
|
|
113571
|
+
disconnection_reason: DisconnectionReasonSchema.catch("unknown"),
|
|
113762
113572
|
transcript: exports_external.string().optional(),
|
|
113763
113573
|
transcript_object: exports_external.array(TimestampedUtteranceSchema).optional(),
|
|
113764
113574
|
scrubbed_transcript_with_tool_calls: exports_external.array(TranscriptEntrySchema).optional(),
|
|
@@ -114172,6 +113982,17 @@ var FlowComponentSchema = exports_external.object({
|
|
|
114172
113982
|
start_node_id: exports_external.string().optional(),
|
|
114173
113983
|
begin_tag_display_position: DisplayPositionSchema.nullable().optional()
|
|
114174
113984
|
});
|
|
113985
|
+
var ConversationFlowComponentResponseSchema = exports_external.object({
|
|
113986
|
+
conversation_flow_component_id: exports_external.string(),
|
|
113987
|
+
user_modified_timestamp: exports_external.number(),
|
|
113988
|
+
linked_conversation_flow_ids: exports_external.array(exports_external.string()).optional(),
|
|
113989
|
+
name: exports_external.string().optional(),
|
|
113990
|
+
nodes: exports_external.array(FlowNodeSchema).optional(),
|
|
113991
|
+
tools: exports_external.array(LlmToolSchema).nullable().optional(),
|
|
113992
|
+
mcps: exports_external.array(McpConfigSchema).nullable().optional(),
|
|
113993
|
+
start_node_id: exports_external.string().nullable().optional(),
|
|
113994
|
+
begin_tag_display_position: DisplayPositionSchema.nullable().optional()
|
|
113995
|
+
});
|
|
114175
113996
|
var FlowModelChoiceSchema = exports_external.object({
|
|
114176
113997
|
type: exports_external.literal("cascading"),
|
|
114177
113998
|
model: LlmModelSchema,
|
|
@@ -114411,8 +114232,11 @@ var llmFieldDocs = {
|
|
|
114411
114232
|
tool_call_strict_mode: "Whether to use strict mode for tool calls. Only applicable when using certain supported models."
|
|
114412
114233
|
};
|
|
114413
114234
|
|
|
114235
|
+
// src/lib/flow-helpers.ts
|
|
114236
|
+
import path15 from "path";
|
|
114237
|
+
|
|
114414
114238
|
// ../../node_modules/.bun/boxen@8.0.1/node_modules/boxen/index.js
|
|
114415
|
-
import
|
|
114239
|
+
import process4 from "process";
|
|
114416
114240
|
|
|
114417
114241
|
// ../../node_modules/.bun/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
114418
114242
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
@@ -114954,7 +114778,7 @@ var NEWLINE = `
|
|
|
114954
114778
|
var PAD = " ";
|
|
114955
114779
|
var NONE = "none";
|
|
114956
114780
|
var terminalColumns = () => {
|
|
114957
|
-
const { env: env2, stdout, stderr } =
|
|
114781
|
+
const { env: env2, stdout, stderr } = process4;
|
|
114958
114782
|
if (stdout?.columns) {
|
|
114959
114783
|
return stdout.columns;
|
|
114960
114784
|
}
|
|
@@ -115138,8 +114962,8 @@ var boxContent = (content, contentWidth, options) => {
|
|
|
115138
114962
|
return result2;
|
|
115139
114963
|
};
|
|
115140
114964
|
var sanitizeOptions = (options) => {
|
|
115141
|
-
if (options.fullscreen &&
|
|
115142
|
-
let newDimensions = [
|
|
114965
|
+
if (options.fullscreen && process4?.stdout) {
|
|
114966
|
+
let newDimensions = [process4.stdout.columns, process4.stdout.rows];
|
|
115143
114967
|
if (typeof options.fullscreen === "function") {
|
|
115144
114968
|
newDimensions = options.fullscreen(...newDimensions);
|
|
115145
114969
|
}
|
|
@@ -115254,7 +115078,7 @@ import path6 from "path";
|
|
|
115254
115078
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
115255
115079
|
import v8 from "v8";
|
|
115256
115080
|
import assert2 from "assert";
|
|
115257
|
-
import { format, inspect } from "util";
|
|
115081
|
+
import { format as format3, inspect } from "util";
|
|
115258
115082
|
import { createRequire } from "module";
|
|
115259
115083
|
|
|
115260
115084
|
// ../../node_modules/.bun/prettier@3.7.4/node_modules/prettier/doc.mjs
|
|
@@ -115376,15 +115200,15 @@ var InvalidDocError = class extends Error {
|
|
|
115376
115200
|
};
|
|
115377
115201
|
var invalid_doc_error_default = InvalidDocError;
|
|
115378
115202
|
var traverseDocOnExitStackMarker = {};
|
|
115379
|
-
function traverseDoc(doc2, onEnter,
|
|
115203
|
+
function traverseDoc(doc2, onEnter, onExit, shouldTraverseConditionalGroups) {
|
|
115380
115204
|
const docsStack = [doc2];
|
|
115381
115205
|
while (docsStack.length > 0) {
|
|
115382
115206
|
const doc22 = docsStack.pop();
|
|
115383
115207
|
if (doc22 === traverseDocOnExitStackMarker) {
|
|
115384
|
-
|
|
115208
|
+
onExit(docsStack.pop());
|
|
115385
115209
|
continue;
|
|
115386
115210
|
}
|
|
115387
|
-
if (
|
|
115211
|
+
if (onExit) {
|
|
115388
115212
|
docsStack.push(doc22, traverseDocOnExitStackMarker);
|
|
115389
115213
|
}
|
|
115390
115214
|
const docType = get_doc_type_default(doc22);
|
|
@@ -117269,7 +117093,7 @@ var require_fill_range = __commonJS2({
|
|
|
117269
117093
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
117270
117094
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
117271
117095
|
let toNumber = padded === false && stringify2(start, end, options8) === false;
|
|
117272
|
-
let
|
|
117096
|
+
let format32 = options8.transform || transform2(toNumber);
|
|
117273
117097
|
if (options8.toRegex && step === 1) {
|
|
117274
117098
|
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options8);
|
|
117275
117099
|
}
|
|
@@ -117281,7 +117105,7 @@ var require_fill_range = __commonJS2({
|
|
|
117281
117105
|
if (options8.toRegex === true && step > 1) {
|
|
117282
117106
|
push2(a5);
|
|
117283
117107
|
} else {
|
|
117284
|
-
range.push(pad(
|
|
117108
|
+
range.push(pad(format32(a5, index), maxLen, toNumber));
|
|
117285
117109
|
}
|
|
117286
117110
|
a5 = descending ? a5 - step : a5 + step;
|
|
117287
117111
|
index++;
|
|
@@ -117295,7 +117119,7 @@ var require_fill_range = __commonJS2({
|
|
|
117295
117119
|
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
|
|
117296
117120
|
return invalidRange(start, end, options8);
|
|
117297
117121
|
}
|
|
117298
|
-
let
|
|
117122
|
+
let format32 = options8.transform || ((val) => String.fromCharCode(val));
|
|
117299
117123
|
let a5 = `${start}`.charCodeAt(0);
|
|
117300
117124
|
let b7 = `${end}`.charCodeAt(0);
|
|
117301
117125
|
let descending = a5 > b7;
|
|
@@ -117307,7 +117131,7 @@ var require_fill_range = __commonJS2({
|
|
|
117307
117131
|
let range = [];
|
|
117308
117132
|
let index = 0;
|
|
117309
117133
|
while (descending ? a5 >= b7 : a5 <= b7) {
|
|
117310
|
-
range.push(
|
|
117134
|
+
range.push(format32(a5, index));
|
|
117311
117135
|
a5 = descending ? a5 - step : a5 + step;
|
|
117312
117136
|
index++;
|
|
117313
117137
|
}
|
|
@@ -117561,7 +117385,7 @@ var require_parse = __commonJS2({
|
|
|
117561
117385
|
CHAR_NO_BREAK_SPACE,
|
|
117562
117386
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
117563
117387
|
} = require_constants();
|
|
117564
|
-
var
|
|
117388
|
+
var parse72 = (input, options8 = {}) => {
|
|
117565
117389
|
if (typeof input !== "string") {
|
|
117566
117390
|
throw new TypeError("Expected a string");
|
|
117567
117391
|
}
|
|
@@ -117765,7 +117589,7 @@ var require_parse = __commonJS2({
|
|
|
117765
117589
|
push2({ type: "eos" });
|
|
117766
117590
|
return ast;
|
|
117767
117591
|
};
|
|
117768
|
-
module.exports =
|
|
117592
|
+
module.exports = parse72;
|
|
117769
117593
|
}
|
|
117770
117594
|
});
|
|
117771
117595
|
var require_braces = __commonJS2({
|
|
@@ -117773,7 +117597,7 @@ var require_braces = __commonJS2({
|
|
|
117773
117597
|
var stringify2 = require_stringify2();
|
|
117774
117598
|
var compile = require_compile();
|
|
117775
117599
|
var expand = require_expand();
|
|
117776
|
-
var
|
|
117600
|
+
var parse72 = require_parse();
|
|
117777
117601
|
var braces = (input, options8 = {}) => {
|
|
117778
117602
|
let output = [];
|
|
117779
117603
|
if (Array.isArray(input)) {
|
|
@@ -117793,7 +117617,7 @@ var require_braces = __commonJS2({
|
|
|
117793
117617
|
}
|
|
117794
117618
|
return output;
|
|
117795
117619
|
};
|
|
117796
|
-
braces.parse = (input, options8 = {}) =>
|
|
117620
|
+
braces.parse = (input, options8 = {}) => parse72(input, options8);
|
|
117797
117621
|
braces.stringify = (input, options8 = {}) => {
|
|
117798
117622
|
if (typeof input === "string") {
|
|
117799
117623
|
return stringify2(braces.parse(input, options8), options8);
|
|
@@ -118370,7 +118194,7 @@ var require_parse2 = __commonJS2({
|
|
|
118370
118194
|
var syntaxError2 = (type, char) => {
|
|
118371
118195
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
118372
118196
|
};
|
|
118373
|
-
var
|
|
118197
|
+
var parse72 = (input, options8) => {
|
|
118374
118198
|
if (typeof input !== "string") {
|
|
118375
118199
|
throw new TypeError("Expected a string");
|
|
118376
118200
|
}
|
|
@@ -118520,7 +118344,7 @@ var require_parse2 = __commonJS2({
|
|
|
118520
118344
|
output = token2.close = `)$))${extglobStar}`;
|
|
118521
118345
|
}
|
|
118522
118346
|
if (token2.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
118523
|
-
const expression =
|
|
118347
|
+
const expression = parse72(rest, { ...options8, fastpaths: false }).output;
|
|
118524
118348
|
output = token2.close = `)${expression})${extglobStar})`;
|
|
118525
118349
|
}
|
|
118526
118350
|
if (token2.prev.type === "bos") {
|
|
@@ -119049,7 +118873,7 @@ var require_parse2 = __commonJS2({
|
|
|
119049
118873
|
}
|
|
119050
118874
|
return state;
|
|
119051
118875
|
};
|
|
119052
|
-
|
|
118876
|
+
parse72.fastpaths = (input, options8) => {
|
|
119053
118877
|
const opts = { ...options8 };
|
|
119054
118878
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
119055
118879
|
const len = input.length;
|
|
@@ -119118,14 +118942,14 @@ var require_parse2 = __commonJS2({
|
|
|
119118
118942
|
}
|
|
119119
118943
|
return source2;
|
|
119120
118944
|
};
|
|
119121
|
-
module.exports =
|
|
118945
|
+
module.exports = parse72;
|
|
119122
118946
|
}
|
|
119123
118947
|
});
|
|
119124
118948
|
var require_picomatch = __commonJS2({
|
|
119125
118949
|
"node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
119126
118950
|
var path15 = __require2("path");
|
|
119127
118951
|
var scan = require_scan();
|
|
119128
|
-
var
|
|
118952
|
+
var parse72 = require_parse2();
|
|
119129
118953
|
var utils2 = require_utils2();
|
|
119130
118954
|
var constants = require_constants2();
|
|
119131
118955
|
var isObject22 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
@@ -119191,11 +119015,11 @@ var require_picomatch = __commonJS2({
|
|
|
119191
119015
|
return { isMatch: false, output: "" };
|
|
119192
119016
|
}
|
|
119193
119017
|
const opts = options8 || {};
|
|
119194
|
-
const
|
|
119018
|
+
const format32 = opts.format || (posix ? utils2.toPosixSlashes : null);
|
|
119195
119019
|
let match = input === glob;
|
|
119196
|
-
let output = match &&
|
|
119020
|
+
let output = match && format32 ? format32(input) : input;
|
|
119197
119021
|
if (match === false) {
|
|
119198
|
-
output =
|
|
119022
|
+
output = format32 ? format32(input) : input;
|
|
119199
119023
|
match = output === glob;
|
|
119200
119024
|
}
|
|
119201
119025
|
if (match === false || opts.capture === true) {
|
|
@@ -119215,7 +119039,7 @@ var require_picomatch = __commonJS2({
|
|
|
119215
119039
|
picomatch.parse = (pattern, options8) => {
|
|
119216
119040
|
if (Array.isArray(pattern))
|
|
119217
119041
|
return pattern.map((p4) => picomatch.parse(p4, options8));
|
|
119218
|
-
return
|
|
119042
|
+
return parse72(pattern, { ...options8, fastpaths: false });
|
|
119219
119043
|
};
|
|
119220
119044
|
picomatch.scan = (input, options8) => scan(input, options8);
|
|
119221
119045
|
picomatch.compileRe = (state, options8, returnOutput = false, returnState = false) => {
|
|
@@ -119241,10 +119065,10 @@ var require_picomatch = __commonJS2({
|
|
|
119241
119065
|
}
|
|
119242
119066
|
let parsed = { negated: false, fastpaths: true };
|
|
119243
119067
|
if (options8.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
119244
|
-
parsed.output =
|
|
119068
|
+
parsed.output = parse72.fastpaths(input, options8);
|
|
119245
119069
|
}
|
|
119246
119070
|
if (!parsed.output) {
|
|
119247
|
-
parsed =
|
|
119071
|
+
parsed = parse72(input, options8);
|
|
119248
119072
|
}
|
|
119249
119073
|
return picomatch.compileRe(parsed, options8, returnOutput, returnState);
|
|
119250
119074
|
};
|
|
@@ -123368,9 +123192,9 @@ var require_fnmatch = __commonJS2({
|
|
|
123368
123192
|
}
|
|
123369
123193
|
return ret;
|
|
123370
123194
|
}
|
|
123371
|
-
Minimatch.prototype.parse =
|
|
123195
|
+
Minimatch.prototype.parse = parse72;
|
|
123372
123196
|
var SUBPARSE = {};
|
|
123373
|
-
function
|
|
123197
|
+
function parse72(pattern, isSub) {
|
|
123374
123198
|
var options8 = this.options;
|
|
123375
123199
|
if (!options8.noglobstar && pattern === "**")
|
|
123376
123200
|
return GLOBSTAR;
|
|
@@ -123842,7 +123666,7 @@ var require_ini = __commonJS2({
|
|
|
123842
123666
|
param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
|
|
123843
123667
|
comment: /^\s*[#;].*$/
|
|
123844
123668
|
};
|
|
123845
|
-
function
|
|
123669
|
+
function parse72(file2) {
|
|
123846
123670
|
return __awaiter(this, undefined, undefined, function() {
|
|
123847
123671
|
return __generator(this, function(_a7) {
|
|
123848
123672
|
return [2, new Promise(function(resolve3, reject) {
|
|
@@ -123857,7 +123681,7 @@ var require_ini = __commonJS2({
|
|
|
123857
123681
|
});
|
|
123858
123682
|
});
|
|
123859
123683
|
}
|
|
123860
|
-
exports.parse =
|
|
123684
|
+
exports.parse = parse72;
|
|
123861
123685
|
function parseSync(file2) {
|
|
123862
123686
|
return parseString2(fs42.readFileSync(file2, "utf8"));
|
|
123863
123687
|
}
|
|
@@ -124259,7 +124083,7 @@ var require_src = __commonJS2({
|
|
|
124259
124083
|
return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
|
|
124260
124084
|
}
|
|
124261
124085
|
exports.parseFromFilesSync = parseFromFilesSync;
|
|
124262
|
-
function
|
|
124086
|
+
function parse72(_filepath, _options) {
|
|
124263
124087
|
if (_options === undefined) {
|
|
124264
124088
|
_options = {};
|
|
124265
124089
|
}
|
|
@@ -124274,7 +124098,7 @@ var require_src = __commonJS2({
|
|
|
124274
124098
|
});
|
|
124275
124099
|
});
|
|
124276
124100
|
}
|
|
124277
|
-
exports.parse =
|
|
124101
|
+
exports.parse = parse72;
|
|
124278
124102
|
function parseSync(_filepath, _options) {
|
|
124279
124103
|
if (_options === undefined) {
|
|
124280
124104
|
_options = {};
|
|
@@ -125147,7 +124971,7 @@ __export3(index_exports, {
|
|
|
125147
124971
|
check: () => check2,
|
|
125148
124972
|
clearConfigCache: () => clearCache3,
|
|
125149
124973
|
doc: () => exports_doc,
|
|
125150
|
-
format: () =>
|
|
124974
|
+
format: () => format22,
|
|
125151
124975
|
formatWithCursor: () => formatWithCursor2,
|
|
125152
124976
|
getFileInfo: () => get_file_info_default,
|
|
125153
124977
|
getSupportInfo: () => getSupportInfo2,
|
|
@@ -128785,7 +128609,7 @@ function getMessage(key2, parameters, self2) {
|
|
|
128785
128609
|
if (parameters.length === 0)
|
|
128786
128610
|
return message;
|
|
128787
128611
|
parameters.unshift(message);
|
|
128788
|
-
return Reflect.apply(
|
|
128612
|
+
return Reflect.apply(format3, null, parameters);
|
|
128789
128613
|
}
|
|
128790
128614
|
function determineSpecificType(value) {
|
|
128791
128615
|
if (value === null || value === undefined) {
|
|
@@ -128951,9 +128775,9 @@ function getFileProtocolModuleFormat(url3, _context, ignoreErrors) {
|
|
|
128951
128775
|
}
|
|
128952
128776
|
return "module";
|
|
128953
128777
|
}
|
|
128954
|
-
const
|
|
128955
|
-
if (
|
|
128956
|
-
return
|
|
128778
|
+
const format32 = extensionFormatMap[value];
|
|
128779
|
+
if (format32)
|
|
128780
|
+
return format32;
|
|
128957
128781
|
if (ignoreErrors) {
|
|
128958
128782
|
return;
|
|
128959
128783
|
}
|
|
@@ -129018,8 +128842,8 @@ function emitLegacyIndexDeprecation(url3, packageJsonUrl, base, main) {
|
|
|
129018
128842
|
if (process42.noDeprecation) {
|
|
129019
128843
|
return;
|
|
129020
128844
|
}
|
|
129021
|
-
const
|
|
129022
|
-
if (
|
|
128845
|
+
const format32 = defaultGetFormatWithoutErrors(url3, { parentURL: base.href });
|
|
128846
|
+
if (format32 !== "module")
|
|
129023
128847
|
return;
|
|
129024
128848
|
const urlPath = fileURLToPath4(url3.href);
|
|
129025
128849
|
const packagePath = fileURLToPath4(new URL(".", packageJsonUrl));
|
|
@@ -129605,11 +129429,11 @@ async function loadExternalConfig(externalConfig, configFile) {
|
|
|
129605
129429
|
var load_external_config_default = loadExternalConfig;
|
|
129606
129430
|
async function loadConfig(configFile) {
|
|
129607
129431
|
const { base: fileName, ext: extension } = path8.parse(configFile);
|
|
129608
|
-
const
|
|
129609
|
-
if (!
|
|
129432
|
+
const load = fileName === "package.json" ? loadConfigFromPackageJson : fileName === "package.yaml" ? loadConfigFromPackageYaml : loaders_default[extension];
|
|
129433
|
+
if (!load) {
|
|
129610
129434
|
throw new Error(`No loader specified for extension "${extension || "noExt"}"`);
|
|
129611
129435
|
}
|
|
129612
|
-
let config2 = await
|
|
129436
|
+
let config2 = await load(configFile);
|
|
129613
129437
|
if (!config2) {
|
|
129614
129438
|
return;
|
|
129615
129439
|
}
|
|
@@ -133713,7 +133537,7 @@ function withPlugins(fn9, optionsArgumentIndex = 1) {
|
|
|
133713
133537
|
};
|
|
133714
133538
|
}
|
|
133715
133539
|
var formatWithCursor2 = withPlugins(formatWithCursor);
|
|
133716
|
-
async function
|
|
133540
|
+
async function format22(text, options8) {
|
|
133717
133541
|
const { formatted } = await formatWithCursor2(text, {
|
|
133718
133542
|
...options8,
|
|
133719
133543
|
cursorOffset: -1
|
|
@@ -133721,7 +133545,7 @@ async function format2(text, options8) {
|
|
|
133721
133545
|
return formatted;
|
|
133722
133546
|
}
|
|
133723
133547
|
async function check2(text, options8) {
|
|
133724
|
-
return await
|
|
133548
|
+
return await format22(text, options8) === text;
|
|
133725
133549
|
}
|
|
133726
133550
|
async function clearCache3() {
|
|
133727
133551
|
clearCache();
|
|
@@ -133935,6 +133759,77 @@ function createFlowVisualization(current, previous, next) {
|
|
|
133935
133759
|
`);
|
|
133936
133760
|
}
|
|
133937
133761
|
|
|
133762
|
+
// src/lib/flow-helpers.ts
|
|
133763
|
+
async function extractNodePrompts(nodes, dirPath, files) {
|
|
133764
|
+
const nodeNameById = new Map;
|
|
133765
|
+
const incomingEdges = new Map;
|
|
133766
|
+
for (const n8 of nodes) {
|
|
133767
|
+
if (n8.id && n8.name)
|
|
133768
|
+
nodeNameById.set(n8.id, n8.name);
|
|
133769
|
+
const allEdges = [
|
|
133770
|
+
...n8.edges ?? [],
|
|
133771
|
+
...n8.edge ? [n8.edge] : [],
|
|
133772
|
+
...n8.always_edge ? [n8.always_edge] : []
|
|
133773
|
+
];
|
|
133774
|
+
for (const edge of allEdges) {
|
|
133775
|
+
const destId = edge.destination_node_id;
|
|
133776
|
+
if (destId) {
|
|
133777
|
+
if (!incomingEdges.has(destId))
|
|
133778
|
+
incomingEdges.set(destId, []);
|
|
133779
|
+
if (n8.name)
|
|
133780
|
+
incomingEdges.get(destId).push(n8.name);
|
|
133781
|
+
}
|
|
133782
|
+
}
|
|
133783
|
+
}
|
|
133784
|
+
for (const node of nodes) {
|
|
133785
|
+
if (node.id && node.type === "conversation" && node.instruction?.type === "prompt" && typeof node.instruction.text === "string" && !node.instruction.text.startsWith("file://")) {
|
|
133786
|
+
const nodeHash = node.id.slice(-FILE_HASH_LENGTH);
|
|
133787
|
+
const nodeName = node.name ? `${toSnakeCase(node.name)}_${nodeHash}` : `${node.type}_${nodeHash}`;
|
|
133788
|
+
const nodeFileName = `nodes/${nodeName}.md`;
|
|
133789
|
+
const previous = node.id ? incomingEdges.get(node.id) ?? [] : [];
|
|
133790
|
+
const nodeEdges = node.edges;
|
|
133791
|
+
const nodeAlwaysEdge = node.always_edge;
|
|
133792
|
+
const next = [
|
|
133793
|
+
...nodeEdges ?? [],
|
|
133794
|
+
...nodeAlwaysEdge ? [nodeAlwaysEdge] : []
|
|
133795
|
+
].map((e31) => e31.destination_node_id ? nodeNameById.get(e31.destination_node_id) : undefined).filter((name) => !!name);
|
|
133796
|
+
const flowViz = node.name ? createFlowVisualization(node.name, previous, next) : undefined;
|
|
133797
|
+
files[path15.join(dirPath, nodeFileName)] = await writeMarkdown(node.instruction.text, { nodeId: node.id, flow: flowViz });
|
|
133798
|
+
node.instruction.text = `file://./${nodeFileName}`;
|
|
133799
|
+
}
|
|
133800
|
+
}
|
|
133801
|
+
}
|
|
133802
|
+
var roundPos = (p4) => ({
|
|
133803
|
+
x: Math.round(p4.x),
|
|
133804
|
+
y: Math.round(p4.y)
|
|
133805
|
+
});
|
|
133806
|
+
async function extractPositions(config2, dirPath, files) {
|
|
133807
|
+
const positions = {};
|
|
133808
|
+
if (config2.begin_tag_display_position) {
|
|
133809
|
+
positions.begin_tag = roundPos(config2.begin_tag_display_position);
|
|
133810
|
+
delete config2.begin_tag_display_position;
|
|
133811
|
+
}
|
|
133812
|
+
if (config2.nodes) {
|
|
133813
|
+
for (const node of config2.nodes) {
|
|
133814
|
+
if (node.id && node.display_position) {
|
|
133815
|
+
(positions.nodes ??= {})[node.id] = roundPos(node.display_position);
|
|
133816
|
+
delete node.display_position;
|
|
133817
|
+
}
|
|
133818
|
+
}
|
|
133819
|
+
}
|
|
133820
|
+
if (config2.components) {
|
|
133821
|
+
for (const comp of config2.components) {
|
|
133822
|
+
if (comp.name && comp.begin_tag_display_position) {
|
|
133823
|
+
(positions.components ??= {})[comp.name] = roundPos(comp.begin_tag_display_position);
|
|
133824
|
+
delete comp.begin_tag_display_position;
|
|
133825
|
+
}
|
|
133826
|
+
}
|
|
133827
|
+
}
|
|
133828
|
+
if (Object.keys(positions).length > 0) {
|
|
133829
|
+
files[path15.join(dirPath, ".positions.json")] = await writeJson(positions);
|
|
133830
|
+
}
|
|
133831
|
+
}
|
|
133832
|
+
|
|
133938
133833
|
// src/lib/agents.ts
|
|
133939
133834
|
var RETELL_BASE_URL = "https://api.retellai.com";
|
|
133940
133835
|
function getApiKey() {
|
|
@@ -134182,23 +134077,23 @@ async function getLocalState({
|
|
|
134182
134077
|
const agentIdGlob = new Bun.Glob("*/.agent.json");
|
|
134183
134078
|
for await (const agentIdPath of agentIdGlob.scan(agentsDir)) {
|
|
134184
134079
|
if (agentIdSet) {
|
|
134185
|
-
const metaContent = await Bun.file(
|
|
134080
|
+
const metaContent = await Bun.file(path17.join(agentsDir, agentIdPath)).text();
|
|
134186
134081
|
const meta3 = zod_default.object({ id: zod_default.string() }).safeParse(JSON.parse(metaContent));
|
|
134187
134082
|
if (!meta3.success || !agentIdSet.has(meta3.data.id)) {
|
|
134188
134083
|
continue;
|
|
134189
134084
|
}
|
|
134190
134085
|
}
|
|
134191
|
-
const agentDirName =
|
|
134192
|
-
const agentDirFull =
|
|
134086
|
+
const agentDirName = path17.dirname(agentIdPath);
|
|
134087
|
+
const agentDirFull = path17.join(agentsDir, agentDirName);
|
|
134193
134088
|
const filesGlob = new Bun.Glob("**/*");
|
|
134194
134089
|
for await (const file2 of filesGlob.scan({ cwd: agentDirFull, dot: true })) {
|
|
134195
|
-
const filePath =
|
|
134090
|
+
const filePath = path17.join(agentDirFull, file2);
|
|
134196
134091
|
const stat2 = await fs8.stat(filePath);
|
|
134197
134092
|
if (stat2.isFile()) {
|
|
134198
134093
|
files[`${agentDirName}/${file2}`] = await Bun.file(filePath).text();
|
|
134199
134094
|
}
|
|
134200
134095
|
}
|
|
134201
|
-
files[agentIdPath] = await Bun.file(
|
|
134096
|
+
files[agentIdPath] = await Bun.file(path17.join(agentsDir, agentIdPath)).text();
|
|
134202
134097
|
}
|
|
134203
134098
|
return canonicalizeFromFiles(files);
|
|
134204
134099
|
}
|
|
@@ -134209,21 +134104,21 @@ async function writeState(state, {
|
|
|
134209
134104
|
const files = await serializeState(state, { agentsDir });
|
|
134210
134105
|
const writtenFiles = new Set;
|
|
134211
134106
|
for (const [filePath, content] of Object.entries(files)) {
|
|
134212
|
-
const fullPath =
|
|
134213
|
-
await fs8.mkdir(
|
|
134107
|
+
const fullPath = path17.resolve(filePath);
|
|
134108
|
+
await fs8.mkdir(path17.dirname(fullPath), { recursive: true });
|
|
134214
134109
|
await Bun.write(fullPath, content);
|
|
134215
|
-
writtenFiles.add(
|
|
134110
|
+
writtenFiles.add(path17.relative(agentsDir, filePath));
|
|
134216
134111
|
}
|
|
134217
|
-
const writtenDirs = new Set([...writtenFiles].map((f7) => f7.split(
|
|
134112
|
+
const writtenDirs = new Set([...writtenFiles].map((f7) => f7.split(path17.sep)[0]).filter(Boolean));
|
|
134218
134113
|
const managedAgentIds = agentIds ? new Set(agentIds) : null;
|
|
134219
134114
|
const existingDirs = await fs8.readdir(agentsDir, { withFileTypes: true });
|
|
134220
134115
|
for (const dirent of existingDirs) {
|
|
134221
134116
|
if (!dirent.isDirectory())
|
|
134222
134117
|
continue;
|
|
134223
134118
|
const dirName = dirent.name;
|
|
134224
|
-
const dirPath =
|
|
134119
|
+
const dirPath = path17.join(agentsDir, dirName);
|
|
134225
134120
|
if (managedAgentIds) {
|
|
134226
|
-
const metaPath =
|
|
134121
|
+
const metaPath = path17.join(dirPath, ".agent.json");
|
|
134227
134122
|
const metaFile = Bun.file(metaPath);
|
|
134228
134123
|
const metaExists = await metaFile.exists();
|
|
134229
134124
|
if (metaExists) {
|
|
@@ -134239,9 +134134,9 @@ async function writeState(state, {
|
|
|
134239
134134
|
} else {
|
|
134240
134135
|
const existingFiles = await listFilesRecursive(dirPath);
|
|
134241
134136
|
for (const existingFile of existingFiles) {
|
|
134242
|
-
const relativePath =
|
|
134137
|
+
const relativePath = path17.join(dirName, existingFile);
|
|
134243
134138
|
if (!writtenFiles.has(relativePath)) {
|
|
134244
|
-
await fs8.rm(
|
|
134139
|
+
await fs8.rm(path17.join(dirPath, existingFile));
|
|
134245
134140
|
}
|
|
134246
134141
|
}
|
|
134247
134142
|
}
|
|
@@ -134252,8 +134147,8 @@ async function listFilesRecursive(dir) {
|
|
|
134252
134147
|
const files = [];
|
|
134253
134148
|
for (const entry of entries) {
|
|
134254
134149
|
if (entry.isDirectory()) {
|
|
134255
|
-
const subFiles = await listFilesRecursive(
|
|
134256
|
-
files.push(...subFiles.map((f7) =>
|
|
134150
|
+
const subFiles = await listFilesRecursive(path17.join(dir, entry.name));
|
|
134151
|
+
files.push(...subFiles.map((f7) => path17.join(entry.name, f7)));
|
|
134257
134152
|
} else {
|
|
134258
134153
|
files.push(entry.name);
|
|
134259
134154
|
}
|
|
@@ -134270,101 +134165,32 @@ async function serializeState(state, { agentsDir = DEFAULT_AGENTS_DIR } = {}) {
|
|
|
134270
134165
|
if (llm) {
|
|
134271
134166
|
const { _id: _llmId, _version: _llmVersion, ...llmConfig } = llm;
|
|
134272
134167
|
if (llmConfig.general_prompt) {
|
|
134273
|
-
files[
|
|
134168
|
+
files[path17.join(agentDirPath, "general_prompt.md")] = await writeMarkdown(llmConfig.general_prompt);
|
|
134274
134169
|
llmConfig.general_prompt = "file://./general_prompt.md";
|
|
134275
134170
|
}
|
|
134276
|
-
files[
|
|
134171
|
+
files[path17.join(agentDirPath, "llm.yaml")] = await writeYaml(llmConfig, { comments: llmFieldDocs });
|
|
134277
134172
|
}
|
|
134278
134173
|
} else if (agent.response_engine.type === "conversation-flow") {
|
|
134279
134174
|
const flow = flowMap.get(agent.response_engine.conversation_flow_id);
|
|
134280
134175
|
if (flow) {
|
|
134281
134176
|
const { _id: _flowId, _version: _flowVersion, ...flowConfig } = flow;
|
|
134282
134177
|
if (flowConfig.global_prompt) {
|
|
134283
|
-
files[
|
|
134178
|
+
files[path17.join(agentDirPath, "global_prompt.md")] = await writeMarkdown(flowConfig.global_prompt);
|
|
134284
134179
|
flowConfig.global_prompt = "file://./global_prompt.md";
|
|
134285
134180
|
}
|
|
134286
134181
|
if (flowConfig.nodes) {
|
|
134287
|
-
|
|
134288
|
-
const incomingEdges = new Map;
|
|
134289
|
-
for (const n8 of flowConfig.nodes) {
|
|
134290
|
-
if (n8.id && n8.name)
|
|
134291
|
-
nodeNameById.set(n8.id, n8.name);
|
|
134292
|
-
const edgesArray = "edges" in n8 ? n8.edges : undefined;
|
|
134293
|
-
const singleEdge = "edge" in n8 ? n8.edge : undefined;
|
|
134294
|
-
const alwaysEdge = "always_edge" in n8 ? n8.always_edge : undefined;
|
|
134295
|
-
const allEdges = [
|
|
134296
|
-
...edgesArray ?? [],
|
|
134297
|
-
...singleEdge ? [singleEdge] : [],
|
|
134298
|
-
...alwaysEdge ? [alwaysEdge] : []
|
|
134299
|
-
];
|
|
134300
|
-
for (const edge of allEdges) {
|
|
134301
|
-
const destId = edge.destination_node_id;
|
|
134302
|
-
if (destId) {
|
|
134303
|
-
if (!incomingEdges.has(destId))
|
|
134304
|
-
incomingEdges.set(destId, []);
|
|
134305
|
-
if (n8.name)
|
|
134306
|
-
incomingEdges.get(destId).push(n8.name);
|
|
134307
|
-
}
|
|
134308
|
-
}
|
|
134309
|
-
}
|
|
134310
|
-
for (const node of flowConfig.nodes) {
|
|
134311
|
-
if (node.id && node.type === "conversation" && node.instruction?.type === "prompt" && typeof node.instruction.text === "string" && !node.instruction.text.startsWith("file://")) {
|
|
134312
|
-
const nodeHash = node.id.slice(-FILE_HASH_LENGTH);
|
|
134313
|
-
const nodeName = node.name ? `${toSnakeCase(node.name)}_${nodeHash}` : `${node.type}_${nodeHash}`;
|
|
134314
|
-
const nodeFileName = `nodes/${nodeName}.md`;
|
|
134315
|
-
const previous = node.id ? incomingEdges.get(node.id) ?? [] : [];
|
|
134316
|
-
const nodeEdges = "edges" in node ? node.edges : undefined;
|
|
134317
|
-
const nodeAlwaysEdge = "always_edge" in node ? node.always_edge : undefined;
|
|
134318
|
-
const next = [
|
|
134319
|
-
...nodeEdges ?? [],
|
|
134320
|
-
...nodeAlwaysEdge ? [nodeAlwaysEdge] : []
|
|
134321
|
-
].map((e31) => e31.destination_node_id ? nodeNameById.get(e31.destination_node_id) : undefined).filter((name) => !!name);
|
|
134322
|
-
const flowViz = node.name ? createFlowVisualization(node.name, previous, next) : undefined;
|
|
134323
|
-
files[path15.join(agentDirPath, nodeFileName)] = await writeMarkdown(node.instruction.text, {
|
|
134324
|
-
nodeId: node.id,
|
|
134325
|
-
flow: flowViz
|
|
134326
|
-
});
|
|
134327
|
-
node.instruction.text = `file://./${nodeFileName}`;
|
|
134328
|
-
}
|
|
134329
|
-
}
|
|
134330
|
-
}
|
|
134331
|
-
const roundPos = (p4) => ({
|
|
134332
|
-
x: Math.round(p4.x),
|
|
134333
|
-
y: Math.round(p4.y)
|
|
134334
|
-
});
|
|
134335
|
-
const positions = {};
|
|
134336
|
-
if (flowConfig.begin_tag_display_position) {
|
|
134337
|
-
positions.begin_tag = roundPos(flowConfig.begin_tag_display_position);
|
|
134338
|
-
delete flowConfig.begin_tag_display_position;
|
|
134339
|
-
}
|
|
134340
|
-
if (flowConfig.nodes) {
|
|
134341
|
-
for (const node of flowConfig.nodes) {
|
|
134342
|
-
if (node.id && node.display_position) {
|
|
134343
|
-
(positions.nodes ??= {})[node.id] = roundPos(node.display_position);
|
|
134344
|
-
delete node.display_position;
|
|
134345
|
-
}
|
|
134346
|
-
}
|
|
134347
|
-
}
|
|
134348
|
-
if (flowConfig.components) {
|
|
134349
|
-
for (const comp of flowConfig.components) {
|
|
134350
|
-
if (comp.name && comp.begin_tag_display_position) {
|
|
134351
|
-
(positions.components ??= {})[comp.name] = roundPos(comp.begin_tag_display_position);
|
|
134352
|
-
delete comp.begin_tag_display_position;
|
|
134353
|
-
}
|
|
134354
|
-
}
|
|
134355
|
-
}
|
|
134356
|
-
if (Object.keys(positions).length > 0) {
|
|
134357
|
-
files[path15.join(agentDirPath, ".positions.json")] = await writeJson(positions);
|
|
134182
|
+
await extractNodePrompts(flowConfig.nodes, agentDirPath, files);
|
|
134358
134183
|
}
|
|
134359
|
-
|
|
134184
|
+
await extractPositions(flowConfig, agentDirPath, files);
|
|
134185
|
+
files[path17.join(agentDirPath, "conversation-flow.yaml")] = await writeYaml(flowConfig, { comments: flowFieldDocs });
|
|
134360
134186
|
}
|
|
134361
134187
|
}
|
|
134362
134188
|
};
|
|
134363
134189
|
for (const agent of state.voiceAgents) {
|
|
134364
134190
|
const agentDirName = getAgentDirName(agent);
|
|
134365
|
-
const agentDirPath =
|
|
134191
|
+
const agentDirPath = path17.join(agentsDir, agentDirName);
|
|
134366
134192
|
const responseEngineForMeta = agent.response_engine.type === "custom-llm" ? { type: "custom-llm" } : agent.response_engine;
|
|
134367
|
-
files[
|
|
134193
|
+
files[path17.join(agentDirPath, ".agent.json")] = await writeJson({
|
|
134368
134194
|
id: agent._id,
|
|
134369
134195
|
version: agent._version,
|
|
134370
134196
|
channel: "voice",
|
|
@@ -134381,13 +134207,13 @@ async function serializeState(state, { agentsDir = DEFAULT_AGENTS_DIR } = {}) {
|
|
|
134381
134207
|
llm_websocket_url: agent.response_engine.llm_websocket_url
|
|
134382
134208
|
} : voiceAgentConfig;
|
|
134383
134209
|
await serializeResponseEngine(agent, agentDirPath);
|
|
134384
|
-
files[
|
|
134210
|
+
files[path17.join(agentDirPath, "config.yaml")] = await writeYaml(configToWrite, { comments: agentFieldDocs });
|
|
134385
134211
|
}
|
|
134386
134212
|
for (const agent of state.chatAgents) {
|
|
134387
134213
|
const agentDirName = getAgentDirName(agent);
|
|
134388
|
-
const agentDirPath =
|
|
134214
|
+
const agentDirPath = path17.join(agentsDir, agentDirName);
|
|
134389
134215
|
const responseEngineForMeta = agent.response_engine.type === "custom-llm" ? { type: "custom-llm" } : agent.response_engine;
|
|
134390
|
-
files[
|
|
134216
|
+
files[path17.join(agentDirPath, ".agent.json")] = await writeJson({
|
|
134391
134217
|
id: agent._id,
|
|
134392
134218
|
version: agent._version,
|
|
134393
134219
|
channel: "chat",
|
|
@@ -134404,7 +134230,7 @@ async function serializeState(state, { agentsDir = DEFAULT_AGENTS_DIR } = {}) {
|
|
|
134404
134230
|
llm_websocket_url: agent.response_engine.llm_websocket_url
|
|
134405
134231
|
} : chatAgentConfig;
|
|
134406
134232
|
await serializeResponseEngine(agent, agentDirPath);
|
|
134407
|
-
files[
|
|
134233
|
+
files[path17.join(agentDirPath, "config.yaml")] = await writeYaml(chatConfigToWrite, { comments: chatAgentFieldDocs });
|
|
134408
134234
|
}
|
|
134409
134235
|
return files;
|
|
134410
134236
|
}
|
|
@@ -134560,8 +134386,8 @@ function canonicalizeTestCases(testCases) {
|
|
|
134560
134386
|
}));
|
|
134561
134387
|
}
|
|
134562
134388
|
async function getLocalTestCases(agentDirPath) {
|
|
134563
|
-
const testsDir =
|
|
134564
|
-
const metaFile = Bun.file(
|
|
134389
|
+
const testsDir = path17.join(agentDirPath, "tests");
|
|
134390
|
+
const metaFile = Bun.file(path17.join(testsDir, ".tests.json"));
|
|
134565
134391
|
if (!await metaFile.exists()) {
|
|
134566
134392
|
return [];
|
|
134567
134393
|
}
|
|
@@ -134576,7 +134402,7 @@ async function getLocalTestCases(agentDirPath) {
|
|
|
134576
134402
|
const testCases = [];
|
|
134577
134403
|
for (const testCaseMeta of metadata.test_cases) {
|
|
134578
134404
|
const testCaseName = toSnakeCase(testCaseMeta.name);
|
|
134579
|
-
const configPath =
|
|
134405
|
+
const configPath = path17.join(testsDir, `${testCaseName}.yaml`);
|
|
134580
134406
|
const configFile = Bun.file(configPath);
|
|
134581
134407
|
if (!await configFile.exists()) {
|
|
134582
134408
|
console.warn(`Warning: Could not find config file for test case ${testCaseMeta.name}`);
|
|
@@ -134585,7 +134411,7 @@ async function getLocalTestCases(agentDirPath) {
|
|
|
134585
134411
|
const config2 = readYaml(await configFile.text(), zod_default.looseObject({}));
|
|
134586
134412
|
const resolveFileContent = async (filePath) => {
|
|
134587
134413
|
const normalizedPath = filePath.replace(/^\.\//, "");
|
|
134588
|
-
const fullPath =
|
|
134414
|
+
const fullPath = path17.join(testsDir, normalizedPath);
|
|
134589
134415
|
const content = await Bun.file(fullPath).text();
|
|
134590
134416
|
return content;
|
|
134591
134417
|
};
|
|
@@ -134620,7 +134446,7 @@ async function fetchAndWriteTestCases({
|
|
|
134620
134446
|
];
|
|
134621
134447
|
for (const agent of allAgents) {
|
|
134622
134448
|
const agentDirName = getAgentDirName(agent);
|
|
134623
|
-
const agentDirPath =
|
|
134449
|
+
const agentDirPath = path17.join(agentsDir, agentDirName);
|
|
134624
134450
|
const engine = normalizeResponseEngine(agent.response_engine);
|
|
134625
134451
|
if (!engine)
|
|
134626
134452
|
continue;
|
|
@@ -134633,7 +134459,7 @@ async function fetchAndWriteTestCases({
|
|
|
134633
134459
|
continue;
|
|
134634
134460
|
}
|
|
134635
134461
|
if (testCases.length === 0) {
|
|
134636
|
-
const testsDir =
|
|
134462
|
+
const testsDir = path17.join(agentDirPath, "tests");
|
|
134637
134463
|
await fs8.rm(testsDir, { recursive: true, force: true }).catch(() => {});
|
|
134638
134464
|
continue;
|
|
134639
134465
|
}
|
|
@@ -134649,7 +134475,7 @@ async function writeTestCases(testCases, {
|
|
|
134649
134475
|
agentDirPath,
|
|
134650
134476
|
responseEngine
|
|
134651
134477
|
}) {
|
|
134652
|
-
const testsDir =
|
|
134478
|
+
const testsDir = path17.join(agentDirPath, "tests");
|
|
134653
134479
|
await fs8.mkdir(testsDir, { recursive: true });
|
|
134654
134480
|
const metadata = {
|
|
134655
134481
|
response_engine: responseEngine,
|
|
@@ -134658,7 +134484,7 @@ async function writeTestCases(testCases, {
|
|
|
134658
134484
|
name: tc3.name
|
|
134659
134485
|
}))
|
|
134660
134486
|
};
|
|
134661
|
-
await Bun.write(
|
|
134487
|
+
await Bun.write(path17.join(testsDir, ".tests.json"), await writeJson(metadata));
|
|
134662
134488
|
const writtenFiles = new Set([".tests.json"]);
|
|
134663
134489
|
for (const testCase of testCases) {
|
|
134664
134490
|
const {
|
|
@@ -134671,7 +134497,7 @@ async function writeTestCases(testCases, {
|
|
|
134671
134497
|
} = testCase;
|
|
134672
134498
|
const testCaseName = toSnakeCase(testCase.name);
|
|
134673
134499
|
const promptFileName = `${testCaseName}_prompt.md`;
|
|
134674
|
-
const promptFilePath =
|
|
134500
|
+
const promptFilePath = path17.join(testsDir, promptFileName);
|
|
134675
134501
|
await Bun.write(promptFilePath, await writeMarkdown(config2.user_prompt));
|
|
134676
134502
|
writtenFiles.add(promptFileName);
|
|
134677
134503
|
const configWithFileRef = {
|
|
@@ -134682,13 +134508,13 @@ async function writeTestCases(testCases, {
|
|
|
134682
134508
|
const configContent = await writeYaml(configWithFileRef, {
|
|
134683
134509
|
comments: testCaseFieldDocs
|
|
134684
134510
|
});
|
|
134685
|
-
await Bun.write(
|
|
134511
|
+
await Bun.write(path17.join(testsDir, configFileName), configContent);
|
|
134686
134512
|
writtenFiles.add(configFileName);
|
|
134687
134513
|
}
|
|
134688
134514
|
const existingFiles = await fs8.readdir(testsDir).catch(() => []);
|
|
134689
134515
|
for (const file2 of existingFiles) {
|
|
134690
134516
|
if (!writtenFiles.has(file2)) {
|
|
134691
|
-
await fs8.rm(
|
|
134517
|
+
await fs8.rm(path17.join(testsDir, file2), { force: true });
|
|
134692
134518
|
}
|
|
134693
134519
|
}
|
|
134694
134520
|
}
|
|
@@ -134840,6 +134666,175 @@ function computeChanges(source2, reference, { includeNew = false } = {}) {
|
|
|
134840
134666
|
}
|
|
134841
134667
|
return changes;
|
|
134842
134668
|
}
|
|
134669
|
+
function computeComponentChanges(local, remote) {
|
|
134670
|
+
const refMap = new Map(remote.map((c7) => [c7._id, c7]));
|
|
134671
|
+
const changes = [];
|
|
134672
|
+
for (const component of local) {
|
|
134673
|
+
const ref = refMap.get(component._id);
|
|
134674
|
+
if (!ref)
|
|
134675
|
+
continue;
|
|
134676
|
+
const a5 = keyArraysById(n6(ref, ["_id", "_timestamp"]));
|
|
134677
|
+
const b7 = keyArraysById(n6(component, ["_id", "_timestamp"]));
|
|
134678
|
+
const differences = diff(a5, b7);
|
|
134679
|
+
if (differences.length > 0) {
|
|
134680
|
+
changes.push({
|
|
134681
|
+
id: component._id,
|
|
134682
|
+
name: component.name ?? component._id,
|
|
134683
|
+
current: component,
|
|
134684
|
+
differences
|
|
134685
|
+
});
|
|
134686
|
+
}
|
|
134687
|
+
}
|
|
134688
|
+
return changes;
|
|
134689
|
+
}
|
|
134690
|
+
|
|
134691
|
+
// src/lib/components.ts
|
|
134692
|
+
import fs9 from "fs/promises";
|
|
134693
|
+
import path18 from "path";
|
|
134694
|
+
var DEFAULT_COMPONENTS_DIR = "./components";
|
|
134695
|
+
function getComponentDirName(component) {
|
|
134696
|
+
const label2 = component.name ?? component._id;
|
|
134697
|
+
return `${toSnakeCase(label2)}_${component._id.slice(-FILE_HASH_LENGTH)}`;
|
|
134698
|
+
}
|
|
134699
|
+
async function getRemoteComponents({
|
|
134700
|
+
componentIds = null
|
|
134701
|
+
} = {}) {
|
|
134702
|
+
const all = zod_default.array(ConversationFlowComponentResponseSchema).parse(await retellFetch("/list-conversation-flow-components"));
|
|
134703
|
+
const filtered = componentIds ? all.filter((c7) => componentIds.includes(c7.conversation_flow_component_id)) : all;
|
|
134704
|
+
return filtered.map(({ conversation_flow_component_id, user_modified_timestamp, ...rest }) => ({
|
|
134705
|
+
...rest,
|
|
134706
|
+
_id: conversation_flow_component_id,
|
|
134707
|
+
_timestamp: user_modified_timestamp
|
|
134708
|
+
}));
|
|
134709
|
+
}
|
|
134710
|
+
async function getLocalComponents({
|
|
134711
|
+
componentsDir = DEFAULT_COMPONENTS_DIR,
|
|
134712
|
+
componentIds = null
|
|
134713
|
+
} = {}) {
|
|
134714
|
+
const dirExists = await fs9.stat(componentsDir).then((s5) => s5.isDirectory()).catch(() => false);
|
|
134715
|
+
if (!dirExists)
|
|
134716
|
+
return [];
|
|
134717
|
+
const componentIdSet = componentIds ? new Set(componentIds) : null;
|
|
134718
|
+
const components = [];
|
|
134719
|
+
const glob = new Bun.Glob("*/.component.json");
|
|
134720
|
+
for await (const metaPath of glob.scan(componentsDir)) {
|
|
134721
|
+
const metaContent = await Bun.file(path18.join(componentsDir, metaPath)).text();
|
|
134722
|
+
const meta3 = readJson2(metaContent, zod_default.object({
|
|
134723
|
+
id: zod_default.string(),
|
|
134724
|
+
linked_flow_ids: zod_default.array(zod_default.string()).optional()
|
|
134725
|
+
}));
|
|
134726
|
+
if (componentIdSet && !componentIdSet.has(meta3.id))
|
|
134727
|
+
continue;
|
|
134728
|
+
const dirName = path18.dirname(metaPath);
|
|
134729
|
+
const dirFull = path18.join(componentsDir, dirName);
|
|
134730
|
+
const configContent = await Bun.file(path18.join(dirFull, "config.yaml")).text();
|
|
134731
|
+
const config2 = readYaml(configContent, zod_default.looseObject({}));
|
|
134732
|
+
const resolveFileContent = (filePath) => {
|
|
134733
|
+
const normalizedPath = filePath.replace(/^\.\//, "");
|
|
134734
|
+
const fullPath = path18.join(dirFull, normalizedPath);
|
|
134735
|
+
return Bun.file(fullPath).text();
|
|
134736
|
+
};
|
|
134737
|
+
await resolveFilePlaceholders2(config2, resolveFileContent);
|
|
134738
|
+
const positionsPath = path18.join(dirFull, ".positions.json");
|
|
134739
|
+
const positionsFile = Bun.file(positionsPath);
|
|
134740
|
+
if (await positionsFile.exists()) {
|
|
134741
|
+
const positions = readJson2(await positionsFile.text(), zod_default.looseObject({}));
|
|
134742
|
+
if (positions.begin_tag)
|
|
134743
|
+
config2.begin_tag_display_position = positions.begin_tag;
|
|
134744
|
+
if (positions.nodes && Array.isArray(config2.nodes)) {
|
|
134745
|
+
const nodePositions = positions.nodes;
|
|
134746
|
+
for (const node of config2.nodes) {
|
|
134747
|
+
if (node.id && nodePositions[node.id])
|
|
134748
|
+
node.display_position = nodePositions[node.id];
|
|
134749
|
+
}
|
|
134750
|
+
}
|
|
134751
|
+
}
|
|
134752
|
+
components.push({
|
|
134753
|
+
...config2,
|
|
134754
|
+
_id: meta3.id,
|
|
134755
|
+
_timestamp: 0
|
|
134756
|
+
});
|
|
134757
|
+
}
|
|
134758
|
+
return components;
|
|
134759
|
+
}
|
|
134760
|
+
async function serializeComponents(components, { componentsDir = DEFAULT_COMPONENTS_DIR } = {}) {
|
|
134761
|
+
const files = {};
|
|
134762
|
+
for (const component of components) {
|
|
134763
|
+
const dirName = getComponentDirName(component);
|
|
134764
|
+
const dirPath = path18.join(componentsDir, dirName);
|
|
134765
|
+
const { _id, _timestamp, linked_conversation_flow_ids, ...config2 } = component;
|
|
134766
|
+
files[path18.join(dirPath, ".component.json")] = await writeJson({
|
|
134767
|
+
id: _id,
|
|
134768
|
+
...linked_conversation_flow_ids?.length && {
|
|
134769
|
+
linked_flow_ids: linked_conversation_flow_ids
|
|
134770
|
+
}
|
|
134771
|
+
});
|
|
134772
|
+
if (config2.nodes) {
|
|
134773
|
+
await extractNodePrompts(config2.nodes, dirPath, files);
|
|
134774
|
+
}
|
|
134775
|
+
await extractPositions(config2, dirPath, files);
|
|
134776
|
+
files[path18.join(dirPath, "config.yaml")] = await writeYaml(config2);
|
|
134777
|
+
}
|
|
134778
|
+
return files;
|
|
134779
|
+
}
|
|
134780
|
+
async function writeComponents(components, {
|
|
134781
|
+
componentsDir = DEFAULT_COMPONENTS_DIR,
|
|
134782
|
+
componentIds = null
|
|
134783
|
+
} = {}) {
|
|
134784
|
+
const files = await serializeComponents(components, { componentsDir });
|
|
134785
|
+
const writtenFiles = new Set;
|
|
134786
|
+
for (const [filePath, content] of Object.entries(files)) {
|
|
134787
|
+
const fullPath = path18.resolve(filePath);
|
|
134788
|
+
await fs9.mkdir(path18.dirname(fullPath), { recursive: true });
|
|
134789
|
+
await Bun.write(fullPath, content);
|
|
134790
|
+
writtenFiles.add(path18.relative(componentsDir, filePath));
|
|
134791
|
+
}
|
|
134792
|
+
const writtenDirs = new Set([...writtenFiles].map((f7) => f7.split(path18.sep)[0]).filter(Boolean));
|
|
134793
|
+
const managedIds = componentIds ? new Set(componentIds) : null;
|
|
134794
|
+
const dirExists = await fs9.stat(componentsDir).then((s5) => s5.isDirectory()).catch(() => false);
|
|
134795
|
+
if (!dirExists)
|
|
134796
|
+
return;
|
|
134797
|
+
const existingDirs = await fs9.readdir(componentsDir, { withFileTypes: true });
|
|
134798
|
+
for (const dirent of existingDirs) {
|
|
134799
|
+
if (!dirent.isDirectory())
|
|
134800
|
+
continue;
|
|
134801
|
+
const dirName = dirent.name;
|
|
134802
|
+
const dirPath = path18.join(componentsDir, dirName);
|
|
134803
|
+
if (managedIds) {
|
|
134804
|
+
const metaPath = path18.join(dirPath, ".component.json");
|
|
134805
|
+
const metaFile = Bun.file(metaPath);
|
|
134806
|
+
if (await metaFile.exists()) {
|
|
134807
|
+
const meta3 = zod_default.object({ id: zod_default.string() }).safeParse(JSON.parse(await metaFile.text()));
|
|
134808
|
+
if (!meta3.success || !managedIds.has(meta3.data.id))
|
|
134809
|
+
continue;
|
|
134810
|
+
}
|
|
134811
|
+
}
|
|
134812
|
+
if (!writtenDirs.has(dirName)) {
|
|
134813
|
+
await fs9.rm(dirPath, { recursive: true });
|
|
134814
|
+
} else {
|
|
134815
|
+
const existingFiles = await listFilesRecursive2(dirPath);
|
|
134816
|
+
for (const existingFile of existingFiles) {
|
|
134817
|
+
const relativePath = path18.join(dirName, existingFile);
|
|
134818
|
+
if (!writtenFiles.has(relativePath)) {
|
|
134819
|
+
await fs9.rm(path18.join(dirPath, existingFile));
|
|
134820
|
+
}
|
|
134821
|
+
}
|
|
134822
|
+
}
|
|
134823
|
+
}
|
|
134824
|
+
}
|
|
134825
|
+
async function listFilesRecursive2(dir) {
|
|
134826
|
+
const entries = await fs9.readdir(dir, { withFileTypes: true });
|
|
134827
|
+
const files = [];
|
|
134828
|
+
for (const entry of entries) {
|
|
134829
|
+
if (entry.isDirectory()) {
|
|
134830
|
+
const subFiles = await listFilesRecursive2(path18.join(dir, entry.name));
|
|
134831
|
+
files.push(...subFiles.map((f7) => path18.join(entry.name, f7)));
|
|
134832
|
+
} else {
|
|
134833
|
+
files.push(entry.name);
|
|
134834
|
+
}
|
|
134835
|
+
}
|
|
134836
|
+
return files;
|
|
134837
|
+
}
|
|
134843
134838
|
// ../../node_modules/.bun/cli-spinners@3.4.0/node_modules/cli-spinners/spinners.json
|
|
134844
134839
|
var spinners_default = {
|
|
134845
134840
|
dots: {
|
|
@@ -136779,12 +136774,12 @@ function useEffect(cb2, depArray) {
|
|
|
136779
136774
|
import { styleText } from "util";
|
|
136780
136775
|
|
|
136781
136776
|
// ../../node_modules/.bun/@inquirer+figures@2.0.3/node_modules/@inquirer/figures/dist/index.js
|
|
136782
|
-
import
|
|
136777
|
+
import process5 from "process";
|
|
136783
136778
|
function isUnicodeSupported() {
|
|
136784
|
-
if (
|
|
136785
|
-
return
|
|
136779
|
+
if (process5.platform !== "win32") {
|
|
136780
|
+
return process5.env["TERM"] !== "linux";
|
|
136786
136781
|
}
|
|
136787
|
-
return Boolean(
|
|
136782
|
+
return Boolean(process5.env["WT_SESSION"]) || Boolean(process5.env["TERMINUS_SUBLIME"]) || process5.env["ConEmuTask"] === "{cmd::Cmder}" || process5.env["TERM_PROGRAM"] === "Terminus-Sublime" || process5.env["TERM_PROGRAM"] === "vscode" || process5.env["TERM"] === "xterm-256color" || process5.env["TERM"] === "alacritty" || process5.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
136788
136783
|
}
|
|
136789
136784
|
var common = {
|
|
136790
136785
|
circleQuestionMark: "(?)",
|
|
@@ -137264,6 +137259,214 @@ var import_mute_stream = __toESM(require_lib(), 1);
|
|
|
137264
137259
|
import * as readline2 from "readline";
|
|
137265
137260
|
import { AsyncResource as AsyncResource3 } from "async_hooks";
|
|
137266
137261
|
|
|
137262
|
+
// ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
137263
|
+
var signals = [];
|
|
137264
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
137265
|
+
if (process.platform !== "win32") {
|
|
137266
|
+
signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
137267
|
+
}
|
|
137268
|
+
if (process.platform === "linux") {
|
|
137269
|
+
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
137270
|
+
}
|
|
137271
|
+
|
|
137272
|
+
// ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
137273
|
+
var processOk = (process6) => !!process6 && typeof process6 === "object" && typeof process6.removeListener === "function" && typeof process6.emit === "function" && typeof process6.reallyExit === "function" && typeof process6.listeners === "function" && typeof process6.kill === "function" && typeof process6.pid === "number" && typeof process6.on === "function";
|
|
137274
|
+
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
137275
|
+
var global2 = globalThis;
|
|
137276
|
+
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
137277
|
+
|
|
137278
|
+
class Emitter {
|
|
137279
|
+
emitted = {
|
|
137280
|
+
afterExit: false,
|
|
137281
|
+
exit: false
|
|
137282
|
+
};
|
|
137283
|
+
listeners = {
|
|
137284
|
+
afterExit: [],
|
|
137285
|
+
exit: []
|
|
137286
|
+
};
|
|
137287
|
+
count = 0;
|
|
137288
|
+
id = Math.random();
|
|
137289
|
+
constructor() {
|
|
137290
|
+
if (global2[kExitEmitter]) {
|
|
137291
|
+
return global2[kExitEmitter];
|
|
137292
|
+
}
|
|
137293
|
+
ObjectDefineProperty(global2, kExitEmitter, {
|
|
137294
|
+
value: this,
|
|
137295
|
+
writable: false,
|
|
137296
|
+
enumerable: false,
|
|
137297
|
+
configurable: false
|
|
137298
|
+
});
|
|
137299
|
+
}
|
|
137300
|
+
on(ev2, fn9) {
|
|
137301
|
+
this.listeners[ev2].push(fn9);
|
|
137302
|
+
}
|
|
137303
|
+
removeListener(ev2, fn9) {
|
|
137304
|
+
const list = this.listeners[ev2];
|
|
137305
|
+
const i5 = list.indexOf(fn9);
|
|
137306
|
+
if (i5 === -1) {
|
|
137307
|
+
return;
|
|
137308
|
+
}
|
|
137309
|
+
if (i5 === 0 && list.length === 1) {
|
|
137310
|
+
list.length = 0;
|
|
137311
|
+
} else {
|
|
137312
|
+
list.splice(i5, 1);
|
|
137313
|
+
}
|
|
137314
|
+
}
|
|
137315
|
+
emit(ev2, code, signal) {
|
|
137316
|
+
if (this.emitted[ev2]) {
|
|
137317
|
+
return false;
|
|
137318
|
+
}
|
|
137319
|
+
this.emitted[ev2] = true;
|
|
137320
|
+
let ret = false;
|
|
137321
|
+
for (const fn9 of this.listeners[ev2]) {
|
|
137322
|
+
ret = fn9(code, signal) === true || ret;
|
|
137323
|
+
}
|
|
137324
|
+
if (ev2 === "exit") {
|
|
137325
|
+
ret = this.emit("afterExit", code, signal) || ret;
|
|
137326
|
+
}
|
|
137327
|
+
return ret;
|
|
137328
|
+
}
|
|
137329
|
+
}
|
|
137330
|
+
|
|
137331
|
+
class SignalExitBase {
|
|
137332
|
+
}
|
|
137333
|
+
var signalExitWrap = (handler) => {
|
|
137334
|
+
return {
|
|
137335
|
+
onExit(cb2, opts) {
|
|
137336
|
+
return handler.onExit(cb2, opts);
|
|
137337
|
+
},
|
|
137338
|
+
load() {
|
|
137339
|
+
return handler.load();
|
|
137340
|
+
},
|
|
137341
|
+
unload() {
|
|
137342
|
+
return handler.unload();
|
|
137343
|
+
}
|
|
137344
|
+
};
|
|
137345
|
+
};
|
|
137346
|
+
|
|
137347
|
+
class SignalExitFallback extends SignalExitBase {
|
|
137348
|
+
onExit() {
|
|
137349
|
+
return () => {};
|
|
137350
|
+
}
|
|
137351
|
+
load() {}
|
|
137352
|
+
unload() {}
|
|
137353
|
+
}
|
|
137354
|
+
|
|
137355
|
+
class SignalExit extends SignalExitBase {
|
|
137356
|
+
#hupSig = process6.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
137357
|
+
#emitter = new Emitter;
|
|
137358
|
+
#process;
|
|
137359
|
+
#originalProcessEmit;
|
|
137360
|
+
#originalProcessReallyExit;
|
|
137361
|
+
#sigListeners = {};
|
|
137362
|
+
#loaded = false;
|
|
137363
|
+
constructor(process6) {
|
|
137364
|
+
super();
|
|
137365
|
+
this.#process = process6;
|
|
137366
|
+
this.#sigListeners = {};
|
|
137367
|
+
for (const sig of signals) {
|
|
137368
|
+
this.#sigListeners[sig] = () => {
|
|
137369
|
+
const listeners = this.#process.listeners(sig);
|
|
137370
|
+
let { count } = this.#emitter;
|
|
137371
|
+
const p4 = process6;
|
|
137372
|
+
if (typeof p4.__signal_exit_emitter__ === "object" && typeof p4.__signal_exit_emitter__.count === "number") {
|
|
137373
|
+
count += p4.__signal_exit_emitter__.count;
|
|
137374
|
+
}
|
|
137375
|
+
if (listeners.length === count) {
|
|
137376
|
+
this.unload();
|
|
137377
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
137378
|
+
const s5 = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
137379
|
+
if (!ret)
|
|
137380
|
+
process6.kill(process6.pid, s5);
|
|
137381
|
+
}
|
|
137382
|
+
};
|
|
137383
|
+
}
|
|
137384
|
+
this.#originalProcessReallyExit = process6.reallyExit;
|
|
137385
|
+
this.#originalProcessEmit = process6.emit;
|
|
137386
|
+
}
|
|
137387
|
+
onExit(cb2, opts) {
|
|
137388
|
+
if (!processOk(this.#process)) {
|
|
137389
|
+
return () => {};
|
|
137390
|
+
}
|
|
137391
|
+
if (this.#loaded === false) {
|
|
137392
|
+
this.load();
|
|
137393
|
+
}
|
|
137394
|
+
const ev2 = opts?.alwaysLast ? "afterExit" : "exit";
|
|
137395
|
+
this.#emitter.on(ev2, cb2);
|
|
137396
|
+
return () => {
|
|
137397
|
+
this.#emitter.removeListener(ev2, cb2);
|
|
137398
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
137399
|
+
this.unload();
|
|
137400
|
+
}
|
|
137401
|
+
};
|
|
137402
|
+
}
|
|
137403
|
+
load() {
|
|
137404
|
+
if (this.#loaded) {
|
|
137405
|
+
return;
|
|
137406
|
+
}
|
|
137407
|
+
this.#loaded = true;
|
|
137408
|
+
this.#emitter.count += 1;
|
|
137409
|
+
for (const sig of signals) {
|
|
137410
|
+
try {
|
|
137411
|
+
const fn9 = this.#sigListeners[sig];
|
|
137412
|
+
if (fn9)
|
|
137413
|
+
this.#process.on(sig, fn9);
|
|
137414
|
+
} catch (_10) {}
|
|
137415
|
+
}
|
|
137416
|
+
this.#process.emit = (ev2, ...a5) => {
|
|
137417
|
+
return this.#processEmit(ev2, ...a5);
|
|
137418
|
+
};
|
|
137419
|
+
this.#process.reallyExit = (code) => {
|
|
137420
|
+
return this.#processReallyExit(code);
|
|
137421
|
+
};
|
|
137422
|
+
}
|
|
137423
|
+
unload() {
|
|
137424
|
+
if (!this.#loaded) {
|
|
137425
|
+
return;
|
|
137426
|
+
}
|
|
137427
|
+
this.#loaded = false;
|
|
137428
|
+
signals.forEach((sig) => {
|
|
137429
|
+
const listener = this.#sigListeners[sig];
|
|
137430
|
+
if (!listener) {
|
|
137431
|
+
throw new Error("Listener not defined for signal: " + sig);
|
|
137432
|
+
}
|
|
137433
|
+
try {
|
|
137434
|
+
this.#process.removeListener(sig, listener);
|
|
137435
|
+
} catch (_10) {}
|
|
137436
|
+
});
|
|
137437
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
137438
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
137439
|
+
this.#emitter.count -= 1;
|
|
137440
|
+
}
|
|
137441
|
+
#processReallyExit(code) {
|
|
137442
|
+
if (!processOk(this.#process)) {
|
|
137443
|
+
return 0;
|
|
137444
|
+
}
|
|
137445
|
+
this.#process.exitCode = code || 0;
|
|
137446
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
137447
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
137448
|
+
}
|
|
137449
|
+
#processEmit(ev2, ...args) {
|
|
137450
|
+
const og2 = this.#originalProcessEmit;
|
|
137451
|
+
if (ev2 === "exit" && processOk(this.#process)) {
|
|
137452
|
+
if (typeof args[0] === "number") {
|
|
137453
|
+
this.#process.exitCode = args[0];
|
|
137454
|
+
}
|
|
137455
|
+
const ret = og2.call(this.#process, ev2, ...args);
|
|
137456
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
137457
|
+
return ret;
|
|
137458
|
+
} else {
|
|
137459
|
+
return og2.call(this.#process, ev2, ...args);
|
|
137460
|
+
}
|
|
137461
|
+
}
|
|
137462
|
+
}
|
|
137463
|
+
var process6 = globalThis.process;
|
|
137464
|
+
var {
|
|
137465
|
+
onExit,
|
|
137466
|
+
load,
|
|
137467
|
+
unload
|
|
137468
|
+
} = signalExitWrap(processOk(process6) ? new SignalExit(process6) : new SignalExitFallback);
|
|
137469
|
+
|
|
137267
137470
|
// ../../node_modules/.bun/@inquirer+core@11.1.1+6925fcdbe69ee712/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
137268
137471
|
import { stripVTControlCharacters } from "util";
|
|
137269
137472
|
|
|
@@ -137682,7 +137885,8 @@ var dist_default4 = createPrompt((config2, done) => {
|
|
|
137682
137885
|
// src/lib/sync-config.ts
|
|
137683
137886
|
var SYNC_CONFIG_FILE = ".retell-sync.json";
|
|
137684
137887
|
var syncConfigSchema = zod_default.object({
|
|
137685
|
-
agents: zod_default.array(zod_default.string()).optional()
|
|
137888
|
+
agents: zod_default.array(zod_default.string()).optional(),
|
|
137889
|
+
components: zod_default.array(zod_default.string()).optional()
|
|
137686
137890
|
});
|
|
137687
137891
|
async function readSyncConfig() {
|
|
137688
137892
|
const file2 = Bun.file(SYNC_CONFIG_FILE);
|
|
@@ -137712,21 +137916,23 @@ async function selectAgentsInteractive() {
|
|
|
137712
137916
|
p4.set("pagination_key_version", String(opts.pagination_key_version));
|
|
137713
137917
|
return p4.toString();
|
|
137714
137918
|
};
|
|
137715
|
-
const [voiceAgents, chatAgents] = await Promise.all([
|
|
137919
|
+
const [voiceAgents, chatAgents, config2] = await Promise.all([
|
|
137716
137920
|
retellPagination(async (opts) => zod_default.array(VoiceAgentResponseSchema).parse(await retellFetch(`/list-agents?${paginationParams(opts)}`)), "agent_id"),
|
|
137717
|
-
retellPagination(async (opts) => zod_default.array(ChatAgentResponseSchema).parse(await retellFetch(`/list-chat-agents?${paginationParams(opts)}`)), "agent_id")
|
|
137921
|
+
retellPagination(async (opts) => zod_default.array(ChatAgentResponseSchema).parse(await retellFetch(`/list-chat-agents?${paginationParams(opts)}`)), "agent_id"),
|
|
137922
|
+
readSyncConfig()
|
|
137718
137923
|
]);
|
|
137924
|
+
const preSelected = new Set(config2?.agents ?? []);
|
|
137719
137925
|
const voiceAgentMap = new Map;
|
|
137720
137926
|
for (const agent of voiceAgents) {
|
|
137721
|
-
const
|
|
137722
|
-
if (!
|
|
137927
|
+
const existing2 = voiceAgentMap.get(agent.agent_id);
|
|
137928
|
+
if (!existing2 || (agent.version ?? 0) > (existing2.version ?? 0)) {
|
|
137723
137929
|
voiceAgentMap.set(agent.agent_id, { ...agent, _channel: "voice" });
|
|
137724
137930
|
}
|
|
137725
137931
|
}
|
|
137726
137932
|
const chatAgentMap = new Map;
|
|
137727
137933
|
for (const agent of chatAgents) {
|
|
137728
|
-
const
|
|
137729
|
-
if (!
|
|
137934
|
+
const existing2 = chatAgentMap.get(agent.agent_id);
|
|
137935
|
+
if (!existing2 || (agent.version ?? 0) > (existing2.version ?? 0)) {
|
|
137730
137936
|
chatAgentMap.set(agent.agent_id, { ...agent, _channel: "chat" });
|
|
137731
137937
|
}
|
|
137732
137938
|
}
|
|
@@ -137739,21 +137945,17 @@ async function selectAgentsInteractive() {
|
|
|
137739
137945
|
message: "Select agents to sync:",
|
|
137740
137946
|
choices: allAgents.map((agent) => ({
|
|
137741
137947
|
name: `${agent.agent_name ?? agent.agent_id} (${agent._channel})`,
|
|
137742
|
-
value: agent.agent_id
|
|
137948
|
+
value: agent.agent_id,
|
|
137949
|
+
checked: preSelected.has(agent.agent_id)
|
|
137743
137950
|
}))
|
|
137744
137951
|
});
|
|
137745
137952
|
if (selected.length === 0) {
|
|
137746
137953
|
warn("No agents selected");
|
|
137747
137954
|
return [];
|
|
137748
137955
|
}
|
|
137749
|
-
const
|
|
137750
|
-
|
|
137751
|
-
|
|
137752
|
-
});
|
|
137753
|
-
if (save) {
|
|
137754
|
-
await writeSyncConfig({ agents: selected });
|
|
137755
|
-
dim(`Saved to ${SYNC_CONFIG_FILE}`);
|
|
137756
|
-
}
|
|
137956
|
+
const existing = await readSyncConfig() ?? {};
|
|
137957
|
+
await writeSyncConfig({ ...existing, agents: selected });
|
|
137958
|
+
dim(`Saved to ${SYNC_CONFIG_FILE}`);
|
|
137757
137959
|
return selected;
|
|
137758
137960
|
}
|
|
137759
137961
|
async function resolveAgentIds(args, { all = false, select = false } = {}) {
|
|
@@ -137773,6 +137975,51 @@ async function resolveAgentIds(args, { all = false, select = false } = {}) {
|
|
|
137773
137975
|
}
|
|
137774
137976
|
return selectAgentsInteractive();
|
|
137775
137977
|
}
|
|
137978
|
+
async function selectComponentsInteractive() {
|
|
137979
|
+
const [allComponents, config2] = await Promise.all([
|
|
137980
|
+
zod_default.array(ConversationFlowComponentResponseSchema).parse(await retellFetch("/list-conversation-flow-components")),
|
|
137981
|
+
readSyncConfig()
|
|
137982
|
+
]);
|
|
137983
|
+
if (allComponents.length === 0) {
|
|
137984
|
+
warn("No shared components found in the account");
|
|
137985
|
+
return [];
|
|
137986
|
+
}
|
|
137987
|
+
const preSelected = new Set(config2?.components ?? []);
|
|
137988
|
+
const sorted = [...allComponents].sort((a5, b7) => (a5.name ?? a5.conversation_flow_component_id).localeCompare(b7.name ?? b7.conversation_flow_component_id));
|
|
137989
|
+
const selected = await dist_default3({
|
|
137990
|
+
message: "Select components to sync:",
|
|
137991
|
+
choices: sorted.map((c7) => ({
|
|
137992
|
+
name: c7.name ?? c7.conversation_flow_component_id,
|
|
137993
|
+
value: c7.conversation_flow_component_id,
|
|
137994
|
+
checked: preSelected.has(c7.conversation_flow_component_id)
|
|
137995
|
+
}))
|
|
137996
|
+
});
|
|
137997
|
+
if (selected.length === 0) {
|
|
137998
|
+
warn("No components selected");
|
|
137999
|
+
return [];
|
|
138000
|
+
}
|
|
138001
|
+
const existing = await readSyncConfig() ?? {};
|
|
138002
|
+
await writeSyncConfig({ ...existing, components: selected });
|
|
138003
|
+
dim(`Saved to ${SYNC_CONFIG_FILE}`);
|
|
138004
|
+
return selected;
|
|
138005
|
+
}
|
|
138006
|
+
async function resolveComponentIds({
|
|
138007
|
+
all = false,
|
|
138008
|
+
select = false
|
|
138009
|
+
} = {}) {
|
|
138010
|
+
if (select) {
|
|
138011
|
+
return selectComponentsInteractive();
|
|
138012
|
+
}
|
|
138013
|
+
if (all) {
|
|
138014
|
+
return null;
|
|
138015
|
+
}
|
|
138016
|
+
const config2 = await readSyncConfig();
|
|
138017
|
+
if (config2?.components && config2.components.length > 0) {
|
|
138018
|
+
dim(`Using ${config2.components.length} component(s) from ${SYNC_CONFIG_FILE}`);
|
|
138019
|
+
return config2.components;
|
|
138020
|
+
}
|
|
138021
|
+
return;
|
|
138022
|
+
}
|
|
137776
138023
|
|
|
137777
138024
|
// src/commands/pull.ts
|
|
137778
138025
|
var {$: $10 } = globalThis.Bun;
|
|
@@ -137802,12 +138049,18 @@ async function pullCommand(agentIdArgs, opts, cmd) {
|
|
|
137802
138049
|
process.exitCode = 1;
|
|
137803
138050
|
return;
|
|
137804
138051
|
}
|
|
138052
|
+
const componentIds = await resolveComponentIds({
|
|
138053
|
+
all: opts.all,
|
|
138054
|
+
select: opts.select
|
|
138055
|
+
});
|
|
137805
138056
|
await pull({
|
|
137806
138057
|
agentsDir: globalOpts.agentsDir,
|
|
137807
138058
|
agentIds,
|
|
137808
138059
|
yes: opts.yes,
|
|
137809
138060
|
version: version2,
|
|
137810
|
-
tests: opts.tests ?? true
|
|
138061
|
+
tests: opts.tests ?? true,
|
|
138062
|
+
componentsDir: globalOpts.componentsDir,
|
|
138063
|
+
componentIds
|
|
137811
138064
|
});
|
|
137812
138065
|
} catch (err) {
|
|
137813
138066
|
if (err instanceof ExitPromptError) {
|
|
@@ -137822,7 +138075,9 @@ async function pull({
|
|
|
137822
138075
|
agentIds = null,
|
|
137823
138076
|
yes = false,
|
|
137824
138077
|
version: version2,
|
|
137825
|
-
tests = true
|
|
138078
|
+
tests = true,
|
|
138079
|
+
componentsDir,
|
|
138080
|
+
componentIds
|
|
137826
138081
|
} = {}) {
|
|
137827
138082
|
const scopeLabel = agentIds ? `${agentIds.length} agent(s)` : "all agents";
|
|
137828
138083
|
const versionLabel = version2 != null ? ` (version ${version2})` : "";
|
|
@@ -137859,6 +138114,14 @@ async function pull({
|
|
|
137859
138114
|
const agentsWithTests = testResults.filter((r5) => r5.testCount > 0).length;
|
|
137860
138115
|
testSpinner.stop(source_default.dim(`${pluralize("test case", totalTests, true)} across ${pluralize("agent", agentsWithTests, true)}`));
|
|
137861
138116
|
}
|
|
138117
|
+
if (componentIds !== undefined) {
|
|
138118
|
+
const compSpinner = createSpinner("Fetching shared components...");
|
|
138119
|
+
const remoteComponents = await getRemoteComponents({ componentIds });
|
|
138120
|
+
compSpinner.stop(source_default.dim(pluralize("component", remoteComponents.length, true)));
|
|
138121
|
+
const compWriteSpinner = createSpinner("Writing component files...");
|
|
138122
|
+
await writeComponents(remoteComponents, { componentsDir, componentIds });
|
|
138123
|
+
compWriteSpinner.stop(source_default.green("Done"));
|
|
138124
|
+
}
|
|
137862
138125
|
console.log(source_default.dim(`Files written to ${source_default.bold(agentsDir)}. Review with git diff.`));
|
|
137863
138126
|
}
|
|
137864
138127
|
|
|
@@ -137872,11 +138135,17 @@ async function deployCommand(agentIdArgs, opts, cmd) {
|
|
|
137872
138135
|
all: opts.all,
|
|
137873
138136
|
select: opts.select
|
|
137874
138137
|
});
|
|
138138
|
+
const componentIds = await resolveComponentIds({
|
|
138139
|
+
all: opts.all,
|
|
138140
|
+
select: opts.select
|
|
138141
|
+
});
|
|
137875
138142
|
const affectedIds = await deploy({
|
|
137876
138143
|
agentsDir: globalOpts.agentsDir,
|
|
137877
138144
|
agentIds,
|
|
137878
138145
|
dryRun: opts.dryRun,
|
|
137879
|
-
verbose: opts.verbose
|
|
138146
|
+
verbose: opts.verbose,
|
|
138147
|
+
componentsDir: globalOpts.componentsDir,
|
|
138148
|
+
componentIds
|
|
137880
138149
|
});
|
|
137881
138150
|
if (opts.quiet && affectedIds.length > 0) {
|
|
137882
138151
|
console.log(affectedIds.join(" "));
|
|
@@ -137893,7 +138162,9 @@ async function deploy({
|
|
|
137893
138162
|
agentsDir = DEFAULT_AGENTS_DIR,
|
|
137894
138163
|
agentIds = null,
|
|
137895
138164
|
dryRun = false,
|
|
137896
|
-
verbose = false
|
|
138165
|
+
verbose = false,
|
|
138166
|
+
componentsDir,
|
|
138167
|
+
componentIds
|
|
137897
138168
|
} = {}) {
|
|
137898
138169
|
const scopeLabel = agentIds ? `${agentIds.length} agent(s)` : "all agents";
|
|
137899
138170
|
bold(`Deploying ${scopeLabel} to Retell draft...`);
|
|
@@ -137920,7 +138191,7 @@ async function deploy({
|
|
|
137920
138191
|
if (agent.response_engine.type !== "retell-llm" && agent.response_engine.type !== "conversation-flow") {
|
|
137921
138192
|
continue;
|
|
137922
138193
|
}
|
|
137923
|
-
const agentDirPath =
|
|
138194
|
+
const agentDirPath = path19.join(agentsDir, getAgentDirName(agent));
|
|
137924
138195
|
const localTestCases = await getLocalTestCases(agentDirPath);
|
|
137925
138196
|
if (localTestCases.length === 0)
|
|
137926
138197
|
continue;
|
|
@@ -137967,10 +138238,22 @@ async function deploy({
|
|
|
137967
138238
|
}
|
|
137968
138239
|
}
|
|
137969
138240
|
}
|
|
137970
|
-
|
|
138241
|
+
let componentChanges = [];
|
|
138242
|
+
if (componentIds !== undefined) {
|
|
138243
|
+
const [localComponents, remoteComponents] = await Promise.all([
|
|
138244
|
+
getLocalComponents({ componentsDir, componentIds }),
|
|
138245
|
+
getRemoteComponents({ componentIds })
|
|
138246
|
+
]);
|
|
138247
|
+
componentChanges = computeComponentChanges(localComponents, remoteComponents);
|
|
138248
|
+
}
|
|
138249
|
+
const changes = {
|
|
138250
|
+
...baseChanges,
|
|
138251
|
+
testCases: testCaseChanges,
|
|
138252
|
+
components: componentChanges
|
|
138253
|
+
};
|
|
137971
138254
|
const totalAgentChanges = changes.voiceAgents.length + changes.chatAgents.length;
|
|
137972
|
-
spinner.stop(source_default.dim(`Found ${source_default.white(totalAgentChanges)} agent
|
|
137973
|
-
const totalChanges = totalAgentChanges + changes.llms.length + changes.flows.length + changes.testCases.length;
|
|
138255
|
+
spinner.stop(source_default.dim(`Found ${source_default.white(totalAgentChanges)} agent, ${source_default.white(changes.llms.length)} LLM, ${source_default.white(changes.flows.length)} flow, ${source_default.white(changes.testCases.length)} test case, ${source_default.white(changes.components.length)} component changes`));
|
|
138256
|
+
const totalChanges = totalAgentChanges + changes.llms.length + changes.flows.length + changes.testCases.length + changes.components.length;
|
|
137974
138257
|
const affectedAgentIds = findAffectedAgentIds(changes, localState);
|
|
137975
138258
|
if (totalChanges === 0) {
|
|
137976
138259
|
success2("No changes to deploy");
|
|
@@ -138023,6 +138306,19 @@ async function deploy({
|
|
|
138023
138306
|
const { _id, ...updateData } = change.current;
|
|
138024
138307
|
await updateTestCaseDefinition(_id, updateData);
|
|
138025
138308
|
return { type: "test case", id: _id, name: change.name };
|
|
138309
|
+
}),
|
|
138310
|
+
...changes.components.map(async (change) => {
|
|
138311
|
+
const {
|
|
138312
|
+
_id,
|
|
138313
|
+
_timestamp,
|
|
138314
|
+
linked_conversation_flow_ids: _linkedFlows,
|
|
138315
|
+
...updateData
|
|
138316
|
+
} = change.current;
|
|
138317
|
+
await retellFetch(`/update-conversation-flow-component/${_id}`, {
|
|
138318
|
+
method: "PATCH",
|
|
138319
|
+
body: JSON.stringify(updateData)
|
|
138320
|
+
});
|
|
138321
|
+
return { type: "component", id: _id, name: change.name };
|
|
138026
138322
|
})
|
|
138027
138323
|
]);
|
|
138028
138324
|
spinner.stop(source_default.dim("Done"));
|
|
@@ -138037,7 +138333,7 @@ async function deploy({
|
|
|
138037
138333
|
success2(`Deployed ${pluralize("change", totalChanges, true)}`);
|
|
138038
138334
|
if (!isQuiet()) {
|
|
138039
138335
|
bold("Syncing latest state...");
|
|
138040
|
-
await pull({ agentsDir, agentIds });
|
|
138336
|
+
await pull({ agentsDir, agentIds, componentsDir, componentIds });
|
|
138041
138337
|
}
|
|
138042
138338
|
return [...affectedAgentIds];
|
|
138043
138339
|
}
|
|
@@ -138143,6 +138439,16 @@ Test cases to update:`));
|
|
|
138143
138439
|
}
|
|
138144
138440
|
}
|
|
138145
138441
|
}
|
|
138442
|
+
if (changes.components.length > 0) {
|
|
138443
|
+
console.log(source_default.cyan(`
|
|
138444
|
+
Shared components to update:`));
|
|
138445
|
+
for (const change of changes.components) {
|
|
138446
|
+
console.log(` ${source_default.bold(change.name)} ${source_default.dim(`(${change.id})`)}`);
|
|
138447
|
+
for (const d5 of change.differences) {
|
|
138448
|
+
printDiff(d5, { verbose });
|
|
138449
|
+
}
|
|
138450
|
+
}
|
|
138451
|
+
}
|
|
138146
138452
|
}
|
|
138147
138453
|
|
|
138148
138454
|
// src/commands/publish.ts
|
|
@@ -138318,8 +138624,8 @@ function patchAgentList(agents, publishedIds, publishedVersions, agentNames, dir
|
|
|
138318
138624
|
|
|
138319
138625
|
// src/cli.ts
|
|
138320
138626
|
var program2 = new Command;
|
|
138321
|
-
program2.name("retell").description("Retell AI agent management CLI").option("-w, --agents-dir <dir>", "Directory for agent files", DEFAULT_AGENTS_DIR);
|
|
138322
|
-
program2.command("pull [agentIds...]").description("Pull agents from Retell API
|
|
138323
|
-
program2.command("deploy [agentIds...]").description("Deploy local changes to Retell
|
|
138627
|
+
program2.name("retell").description("Retell AI agent management CLI").option("-w, --agents-dir <dir>", "Directory for agent files", DEFAULT_AGENTS_DIR).option("--components-dir <dir>", "Directory for shared component files", DEFAULT_COMPONENTS_DIR);
|
|
138628
|
+
program2.command("pull [agentIds...]").description("Pull agents and shared components from Retell API").option("-a, --all", "Pull all agents in the account").option("-s, --select", "Force interactive selection for agents and components").option("-y, --yes", "Skip confirmation prompts").option("-v, --version <number>", "Pull a specific version (requires agent IDs)").option("--no-tests", "Skip pulling test case definitions").action(pullCommand);
|
|
138629
|
+
program2.command("deploy [agentIds...]").description("Deploy local agent and component changes to Retell").option("-a, --all", "Deploy all agents in the account").option("-s, --select", "Force interactive selection for agents and components").option("-n, --dry-run", "Show changes without applying").option("-v, --verbose", "Show full diff details (use with --dry-run)").option("-q, --quiet", "Output only affected agent IDs (for piping)").action(deployCommand);
|
|
138324
138630
|
program2.command("publish [agentIds...]").description("Publish agents with unpublished draft changes").option("-a, --all", "Publish all agents in the account").option("-s, --select", "Force interactive agent selection").option("-n, --dry-run", "Show what would be published without publishing").option("-q, --quiet", "Output only published agent IDs (for piping)").action(publishCommand);
|
|
138325
138631
|
program2.parse();
|