@agentdocumentformat/cli 0.7.3 → 0.7.4
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/adf.mjs +2 -2
- package/dist/chunks/{chunk-776TSXEP.mjs → chunk-BMNZ2VPS.mjs} +1 -1
- package/dist/chunks/{daemon-G6OQZER2.mjs → daemon-YMIWVG5G.mjs} +87 -55
- package/dist/chunks/{telegram-5ISVFBV3.mjs → telegram-V4VH4PNE.mjs} +1 -1
- package/dist/chunks/{whatsapp-XSAMNGPJ.mjs → whatsapp-RDOC54X5.mjs} +1 -1
- package/package.json +1 -1
package/dist/adf.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import "./chunks/chunk-M2RX3S2T.mjs";
|
|
|
9
9
|
|
|
10
10
|
// src/main/cli/bin.ts
|
|
11
11
|
function version() {
|
|
12
|
-
return "0.7.
|
|
12
|
+
return "0.7.4";
|
|
13
13
|
}
|
|
14
14
|
var DAEMON_HELP = `Usage: adf daemon [--port <n>] [--host <h>] [--settings <file>]
|
|
15
15
|
adf daemon start [--port <n>] [--force]
|
|
@@ -140,7 +140,7 @@ async function main(argv) {
|
|
|
140
140
|
let { daemonPaths } = await import("./chunks/daemon-control-HKFVSQTQ.mjs");
|
|
141
141
|
process.env.ADF_DAEMON_PIDFILE = daemonPaths(Number(process.env.ADF_DAEMON_PORT ?? 7385)).pidFile;
|
|
142
142
|
}
|
|
143
|
-
return await import("./chunks/daemon-
|
|
143
|
+
return await import("./chunks/daemon-YMIWVG5G.mjs"), -1;
|
|
144
144
|
}
|
|
145
145
|
let [{ runCli, tuiInvocation }, control] = await Promise.all([import("./chunks/cli-ZGVQRVSQ.mjs"), import("./chunks/daemon-control-HKFVSQTQ.mjs")]);
|
|
146
146
|
return tuiInvocation(argv) && process.env.NODE_ENV === void 0 && (process.env.NODE_ENV = "production", process.env.ADF_NODE_ENV_DEFAULTED = "1"), await runCli(argv, {
|
|
@@ -27,7 +27,7 @@ async function convertToOggOpus(input) {
|
|
|
27
27
|
"-vn",
|
|
28
28
|
"-y",
|
|
29
29
|
outPath
|
|
30
|
-
], (error) => {
|
|
30
|
+
], { windowsHide: !0 }, (error) => {
|
|
31
31
|
error ? reject(new Error(`ffmpeg conversion failed: ${error.message}. Is ffmpeg installed?`)) : resolve();
|
|
32
32
|
});
|
|
33
33
|
}), await fsp.readFile(outPath);
|
|
@@ -40138,7 +40138,7 @@ var require_light_my_request = __commonJS({
|
|
|
40138
40138
|
var require_fastify = __commonJS({
|
|
40139
40139
|
"node_modules/fastify/fastify.js"(exports, module) {
|
|
40140
40140
|
"use strict";
|
|
40141
|
-
var
|
|
40141
|
+
var VERSION7 = "5.12.1", Avvio = require_boot(), http = __require("node:http"), diagnostics = __require("node:diagnostics_channel"), lightMyRequest, {
|
|
40142
40142
|
kAvvioBoot,
|
|
40143
40143
|
kChildren,
|
|
40144
40144
|
kServerBindings,
|
|
@@ -40410,7 +40410,7 @@ var require_fastify = __commonJS({
|
|
|
40410
40410
|
version: {
|
|
40411
40411
|
configurable: !0,
|
|
40412
40412
|
get() {
|
|
40413
|
-
return
|
|
40413
|
+
return VERSION7;
|
|
40414
40414
|
}
|
|
40415
40415
|
},
|
|
40416
40416
|
errorHandler: {
|
|
@@ -65081,6 +65081,17 @@ import {
|
|
|
65081
65081
|
} from "fs";
|
|
65082
65082
|
import { execFile } from "child_process";
|
|
65083
65083
|
import { promisify as promisify2 } from "util";
|
|
65084
|
+
|
|
65085
|
+
// src/main/utils/npm-spec.ts
|
|
65086
|
+
var NAME = /^(@[\w.-]+\/)?[\w.-]+$/, VERSION = /^[\w.^~*+-]+$/;
|
|
65087
|
+
function assertNpmSpec(name21, version) {
|
|
65088
|
+
let at = name21.lastIndexOf("@"), bare = at > 0 ? name21.slice(0, at) : name21;
|
|
65089
|
+
if (!NAME.test(bare)) throw new Error(`Invalid npm package name: ${name21}`);
|
|
65090
|
+
for (let v of [at > 0 ? name21.slice(at + 1) : void 0, version])
|
|
65091
|
+
if (v !== void 0 && !VERSION.test(v)) throw new Error(`Invalid npm version: ${v}`);
|
|
65092
|
+
}
|
|
65093
|
+
|
|
65094
|
+
// src/main/services/sandbox-packages.service.ts
|
|
65084
65095
|
var execFileAsync = promisify2(execFile), IS_WIN = process.platform === "win32", NPM_BIN = IS_WIN ? "npm.cmd" : "npm", MAX_PACKAGE_SIZE_MB = 50, MAX_TOTAL_SIZE_MB = 200, LOG_TAG = "[SandboxPackages]", SandboxPackagesService = class {
|
|
65085
65096
|
getBaseDir() {
|
|
65086
65097
|
return join10(getUserDataPath(), "sandbox-packages");
|
|
@@ -65113,7 +65124,9 @@ var execFileAsync = promisify2(execFile), IS_WIN = process.platform === "win32",
|
|
|
65113
65124
|
* Returns the installed version and size.
|
|
65114
65125
|
*/
|
|
65115
65126
|
async install(name21, version, onProgress, agentName) {
|
|
65116
|
-
let manifest = this.loadManifest(), versionSpec = version ?? "latest"
|
|
65127
|
+
let manifest = this.loadManifest(), versionSpec = version ?? "latest";
|
|
65128
|
+
assertNpmSpec(name21, versionSpec);
|
|
65129
|
+
let existing = manifest.packages[name21];
|
|
65117
65130
|
if (existing && version && existing.version === version)
|
|
65118
65131
|
return { name: name21, version: existing.version, size_mb: existing.size_mb, already_installed: !0 };
|
|
65119
65132
|
this.ensureBaseDir();
|
|
@@ -65127,7 +65140,8 @@ var execFileAsync = promisify2(execFile), IS_WIN = process.platform === "win32",
|
|
|
65127
65140
|
cwd: baseDir,
|
|
65128
65141
|
env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" },
|
|
65129
65142
|
timeout: 12e4,
|
|
65130
|
-
shell: IS_WIN
|
|
65143
|
+
shell: IS_WIN,
|
|
65144
|
+
windowsHide: !0
|
|
65131
65145
|
}
|
|
65132
65146
|
);
|
|
65133
65147
|
stderr && !stderr.includes("npm warn") && console.warn(`${LOG_TAG} npm stderr for ${name21}:`, stderr), console.log(`${LOG_TAG} npm output:`, stdout.slice(0, 500));
|
|
@@ -65301,7 +65315,8 @@ var execFileAsync = promisify2(execFile), IS_WIN = process.platform === "win32",
|
|
|
65301
65315
|
cwd: this.getBaseDir(),
|
|
65302
65316
|
env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" },
|
|
65303
65317
|
timeout: 6e4,
|
|
65304
|
-
shell: IS_WIN
|
|
65318
|
+
shell: IS_WIN,
|
|
65319
|
+
windowsHide: !0
|
|
65305
65320
|
}
|
|
65306
65321
|
);
|
|
65307
65322
|
} catch (err) {
|
|
@@ -65781,7 +65796,7 @@ var EXTRA_SEARCH_PATHS = {
|
|
|
65781
65796
|
};
|
|
65782
65797
|
function exec(cmd, args) {
|
|
65783
65798
|
return new Promise((resolve15) => {
|
|
65784
|
-
execFile3(cmd, args, { timeout: 1e4 }, (error, stdout, stderr) => {
|
|
65799
|
+
execFile3(cmd, args, { timeout: 1e4, windowsHide: !0 }, (error, stdout, stderr) => {
|
|
65785
65800
|
resolve15({ stdout: stdout?.trim() ?? "", stderr: stderr?.trim() ?? "", code: error ? error.code === "ENOENT" ? -1 : 1 : 0 });
|
|
65786
65801
|
});
|
|
65787
65802
|
});
|
|
@@ -66218,9 +66233,13 @@ function machineSize(cfg, host2 = hostCapacity()) {
|
|
|
66218
66233
|
cpus: boundedInt(cfg.machineCpus, host2.cpus) ?? DEFAULT_SETTINGS.machineCpus
|
|
66219
66234
|
};
|
|
66220
66235
|
}
|
|
66221
|
-
var PodmanService = class _PodmanService extends EventEmitter5 {
|
|
66236
|
+
var PODMAN_MISS_TTL_MS = 6e4, PodmanService = class _PodmanService extends EventEmitter5 {
|
|
66222
66237
|
status = "stopped";
|
|
66223
66238
|
podmanBin = null;
|
|
66239
|
+
/** Shared in-flight probe, so concurrent callers run one probe between them. */
|
|
66240
|
+
podmanProbe = null;
|
|
66241
|
+
/** When a probe last found no Podman; misses are cached for PODMAN_MISS_TTL_MS. */
|
|
66242
|
+
podmanMissAt = 0;
|
|
66224
66243
|
activeAgentIds = /* @__PURE__ */ new Set();
|
|
66225
66244
|
stopTimer = null;
|
|
66226
66245
|
errorMessage;
|
|
@@ -66313,12 +66332,14 @@ var PodmanService = class _PodmanService extends EventEmitter5 {
|
|
|
66313
66332
|
}
|
|
66314
66333
|
/**
|
|
66315
66334
|
* Resolve the podman binary path (cached after first call).
|
|
66316
|
-
* Returns null if Podman is not installed.
|
|
66335
|
+
* Returns null if Podman is not installed. A miss is cached briefly: the
|
|
66336
|
+
* probe spawns wsl/where/podman, and without Podman every compute call
|
|
66337
|
+
* would re-run it. setup() clears the miss so a fresh install is seen.
|
|
66317
66338
|
*/
|
|
66318
66339
|
async findPodman() {
|
|
66319
|
-
|
|
66320
|
-
|
|
66321
|
-
|
|
66340
|
+
return this.podmanBin ? this.podmanBin : Date.now() - this.podmanMissAt < PODMAN_MISS_TTL_MS ? null : (this.podmanProbe ??= checkPodmanAvailability().then((info) => (info.available && info.binPath ? this.podmanBin = info.binPath : this.podmanMissAt = Date.now(), this.podmanBin)).finally(() => {
|
|
66341
|
+
this.podmanProbe = null;
|
|
66342
|
+
}), this.podmanProbe);
|
|
66322
66343
|
}
|
|
66323
66344
|
/**
|
|
66324
66345
|
* Ensure the shared container is running.
|
|
@@ -66717,8 +66738,9 @@ var PodmanService = class _PodmanService extends EventEmitter5 {
|
|
|
66717
66738
|
*/
|
|
66718
66739
|
async setup(step, installCommand) {
|
|
66719
66740
|
if (!SETUP_STEPS.has(step)) return { success: !1, error: `Unknown step: ${step}` };
|
|
66741
|
+
this.podmanMissAt = 0;
|
|
66720
66742
|
let run2 = (cmd, cmdArgs, timeout = 3e5) => new Promise((resolve15) => {
|
|
66721
|
-
execFile4(cmd, cmdArgs, { timeout }, (error, stdout, stderr) => {
|
|
66743
|
+
execFile4(cmd, cmdArgs, { timeout, windowsHide: !0 }, (error, stdout, stderr) => {
|
|
66722
66744
|
resolve15({
|
|
66723
66745
|
stdout: stdout?.trim() ?? "",
|
|
66724
66746
|
stderr: stderr?.trim() ?? "",
|
|
@@ -66771,7 +66793,8 @@ var PodmanService = class _PodmanService extends EventEmitter5 {
|
|
|
66771
66793
|
execArgs.push("-e", `${k}=${v}`);
|
|
66772
66794
|
return execArgs.push(SHARED_CONTAINER, command, ...args), spawn2(this.podmanBin, execArgs, {
|
|
66773
66795
|
stdio: ["pipe", "pipe", "pipe"],
|
|
66774
|
-
shell: !1
|
|
66796
|
+
shell: !1,
|
|
66797
|
+
windowsHide: !0
|
|
66775
66798
|
});
|
|
66776
66799
|
}
|
|
66777
66800
|
/**
|
|
@@ -66787,7 +66810,8 @@ var PodmanService = class _PodmanService extends EventEmitter5 {
|
|
|
66787
66810
|
runArgs.push("-e", `${k}=${v}`);
|
|
66788
66811
|
return runArgs.push(image, command, ...args), spawn2(bin, runArgs, {
|
|
66789
66812
|
stdio: ["pipe", "pipe", "pipe"],
|
|
66790
|
-
shell: !1
|
|
66813
|
+
shell: !1,
|
|
66814
|
+
windowsHide: !0
|
|
66791
66815
|
});
|
|
66792
66816
|
}
|
|
66793
66817
|
/**
|
|
@@ -67447,7 +67471,7 @@ var PodmanService = class _PodmanService extends EventEmitter5 {
|
|
|
67447
67471
|
}
|
|
67448
67472
|
exec0(cmd, args, timeout = 3e4) {
|
|
67449
67473
|
return new Promise((resolve15) => {
|
|
67450
|
-
execFile4(cmd, args, { timeout }, (error, stdout, stderr) => {
|
|
67474
|
+
execFile4(cmd, args, { timeout, windowsHide: !0 }, (error, stdout, stderr) => {
|
|
67451
67475
|
resolve15({
|
|
67452
67476
|
stdout: stdout?.trim() ?? "",
|
|
67453
67477
|
stderr: stderr?.trim() ?? "",
|
|
@@ -67662,7 +67686,7 @@ function sameContainerId(expected, actual) {
|
|
|
67662
67686
|
}
|
|
67663
67687
|
function run(command, args, timeout) {
|
|
67664
67688
|
return new Promise((resolve15) => {
|
|
67665
|
-
execFile5(command, args, { timeout, maxBuffer: 2 * 1024 * 1024 }, (error, stdout, stderr) => {
|
|
67689
|
+
execFile5(command, args, { timeout, maxBuffer: 2 * 1024 * 1024, windowsHide: !0 }, (error, stdout, stderr) => {
|
|
67666
67690
|
let errorCode = error?.code, code = typeof errorCode == "number" ? errorCode : error ? 1 : 0;
|
|
67667
67691
|
resolve15({ stdout: stdout?.trim() ?? "", stderr: stderr?.trim() ?? "", code });
|
|
67668
67692
|
});
|
|
@@ -73862,7 +73886,8 @@ var DEFAULT_QUEUE_HIGH_WATER_BYTES = 4 * 1024 * 1024, DEFAULT_OPTIONS = {
|
|
|
73862
73886
|
child = spawn3(endpoint.command[0], endpoint.command.slice(1), {
|
|
73863
73887
|
cwd: endpoint.cwd,
|
|
73864
73888
|
env: endpoint.env ? { ...process.env, ...endpoint.env } : process.env,
|
|
73865
|
-
stdio: "pipe"
|
|
73889
|
+
stdio: "pipe",
|
|
73890
|
+
windowsHide: !0
|
|
73866
73891
|
});
|
|
73867
73892
|
} else if (endpoint.isolation === "container_shared") {
|
|
73868
73893
|
if (!this.config?.container_shared_bind) throw new Error("Shared-container process stream binding is not enabled for this agent");
|
|
@@ -75391,7 +75416,7 @@ import { join as join19, dirname as dirname10, resolve as resolve10 } from "path
|
|
|
75391
75416
|
import { existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync7, statSync as statSync6, writeFileSync as writeFileSync6, rmSync as rmSync4 } from "fs";
|
|
75392
75417
|
import { execFile as execFile6 } from "child_process";
|
|
75393
75418
|
import { promisify as promisify3 } from "util";
|
|
75394
|
-
var execFileAsync2 = promisify3(execFile6);
|
|
75419
|
+
var execFileAsync2 = promisify3(execFile6), IS_WIN2 = process.platform === "win32", NPM_BIN2 = IS_WIN2 ? "npm.cmd" : "npm";
|
|
75395
75420
|
function resolveEntryPoint(installDir, packageName) {
|
|
75396
75421
|
let pkgJsonPath = join19(installDir, "node_modules", packageName, "package.json");
|
|
75397
75422
|
if (!existsSync10(pkgJsonPath)) {
|
|
@@ -75468,13 +75493,14 @@ var PackageResolver = class {
|
|
|
75468
75493
|
* Returns the installed package info on success.
|
|
75469
75494
|
*/
|
|
75470
75495
|
async install(packageName, onProgress) {
|
|
75496
|
+
assertNpmSpec(packageName);
|
|
75471
75497
|
let baseDir = this.getBaseDir(), safeName = packageName.replace(/[/@]/g, "_"), installDir = join19(baseDir, safeName);
|
|
75472
75498
|
existsSync10(installDir) || mkdirSync7(installDir, { recursive: !0 });
|
|
75473
75499
|
let pkgJsonPath = join19(installDir, "package.json");
|
|
75474
75500
|
existsSync10(pkgJsonPath) || writeFileSync6(pkgJsonPath, JSON.stringify({ name: `pkg-${safeName}`, private: !0 }, null, 2)), onProgress?.(`Installing ${packageName}...`);
|
|
75475
75501
|
try {
|
|
75476
75502
|
let { stdout, stderr } = await execFileAsync2(
|
|
75477
|
-
|
|
75503
|
+
NPM_BIN2,
|
|
75478
75504
|
["install", "--save", "--no-audit", "--no-fund", packageName],
|
|
75479
75505
|
{
|
|
75480
75506
|
cwd: installDir,
|
|
@@ -75483,8 +75509,11 @@ var PackageResolver = class {
|
|
|
75483
75509
|
// Avoid Electron's bundled Node interfering with npm
|
|
75484
75510
|
ELECTRON_RUN_AS_NODE: "1"
|
|
75485
75511
|
},
|
|
75486
|
-
timeout: 12e4
|
|
75512
|
+
timeout: 12e4,
|
|
75487
75513
|
// 2 minute timeout
|
|
75514
|
+
// npm is npm.cmd on Windows; Node only runs .cmd through a shell.
|
|
75515
|
+
shell: IS_WIN2,
|
|
75516
|
+
windowsHide: !0
|
|
75488
75517
|
}
|
|
75489
75518
|
);
|
|
75490
75519
|
stderr && !stderr.includes("npm warn") && console.warn(`[PackageResolver] npm stderr for ${packageName}:`, stderr), onProgress?.(`Resolving entry point for ${packageName}...`);
|
|
@@ -76499,11 +76528,11 @@ var ChannelAdapterManager = class extends EventEmitter7 {
|
|
|
76499
76528
|
|
|
76500
76529
|
// src/main/adapters/built-in-loaders.ts
|
|
76501
76530
|
var BUILT_IN_ADAPTER_LOADERS = {
|
|
76502
|
-
telegram: async () => (await import("./telegram-
|
|
76531
|
+
telegram: async () => (await import("./telegram-V4VH4PNE.mjs")).createAdapter,
|
|
76503
76532
|
email: async () => (await import("./email-V4Q4VJON.mjs")).createAdapter,
|
|
76504
76533
|
discord: async () => (await import("./discord-IWDQJA7A.mjs")).createAdapter,
|
|
76505
76534
|
slack: async () => (await import("./slack-3L5QTDZX.mjs")).createAdapter,
|
|
76506
|
-
whatsapp: async () => (await import("./whatsapp-
|
|
76535
|
+
whatsapp: async () => (await import("./whatsapp-RDOC54X5.mjs")).createAdapter
|
|
76507
76536
|
};
|
|
76508
76537
|
async function loadBuiltInAdapter(adapterType) {
|
|
76509
76538
|
let loader = BUILT_IN_ADAPTER_LOADERS[adapterType];
|
|
@@ -76541,7 +76570,8 @@ function startLoopbackTunnel(opts) {
|
|
|
76541
76570
|
let { podmanBin, containerName, hostPort } = opts, containerPort = opts.containerPort ?? hostPort, log = opts.log ?? (() => {
|
|
76542
76571
|
}), bridges = /* @__PURE__ */ new Set(), sockets = /* @__PURE__ */ new Set(), server = createServer2((socket) => {
|
|
76543
76572
|
let bridge = nodeSpawn(podmanBin, ["exec", "-i", containerName, "node", "-e", BRIDGE_SRC, String(containerPort)], {
|
|
76544
|
-
stdio: ["pipe", "pipe", "ignore"]
|
|
76573
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
76574
|
+
windowsHide: !0
|
|
76545
76575
|
});
|
|
76546
76576
|
bridges.add(bridge), sockets.add(socket), socket.pipe(bridge.stdin), bridge.stdout.pipe(socket);
|
|
76547
76577
|
let teardown = () => {
|
|
@@ -76776,7 +76806,7 @@ function createHeadlessMcpAuthPreflight(log) {
|
|
|
76776
76806
|
let emit = log ?? ((msg) => console.log(msg)), openUrl = (url) => {
|
|
76777
76807
|
emit(`[MCP] Auth preflight authorization URL: ${url}`);
|
|
76778
76808
|
try {
|
|
76779
|
-
let [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["rundll32", ["url.dll,FileProtocolHandler", url]] : ["xdg-open", [url]], child = nodeSpawn(cmd, [...args], { detached: !0, stdio: "ignore" });
|
|
76809
|
+
let [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["rundll32", ["url.dll,FileProtocolHandler", url]] : ["xdg-open", [url]], child = nodeSpawn(cmd, [...args], { detached: !0, stdio: "ignore", windowsHide: !0 });
|
|
76780
76810
|
child.on("error", () => {
|
|
76781
76811
|
}), child.unref();
|
|
76782
76812
|
} catch {
|
|
@@ -81535,7 +81565,7 @@ var MeshManager = class extends EventEmitter10 {
|
|
|
81535
81565
|
};
|
|
81536
81566
|
|
|
81537
81567
|
// node_modules/@ai-sdk/anthropic/dist/index.mjs
|
|
81538
|
-
var
|
|
81568
|
+
var VERSION2 = "3.0.37", anthropicErrorDataSchema = lazySchema(
|
|
81539
81569
|
() => zodSchema(
|
|
81540
81570
|
external_exports2.object({
|
|
81541
81571
|
type: external_exports2.literal("error"),
|
|
@@ -85410,7 +85440,7 @@ function createAnthropic(options = {}) {
|
|
|
85410
85440
|
...authHeaders,
|
|
85411
85441
|
...options.headers
|
|
85412
85442
|
},
|
|
85413
|
-
`ai-sdk/anthropic/${
|
|
85443
|
+
`ai-sdk/anthropic/${VERSION2}`
|
|
85414
85444
|
);
|
|
85415
85445
|
}, createChatModel = (modelId) => {
|
|
85416
85446
|
var _a24;
|
|
@@ -85926,7 +85956,7 @@ function withUserAgentSuffix2(headers, ...userAgentSuffixParts) {
|
|
|
85926
85956
|
[currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" ")
|
|
85927
85957
|
), Object.fromEntries(normalizedHeaders.entries());
|
|
85928
85958
|
}
|
|
85929
|
-
var
|
|
85959
|
+
var VERSION3 = "4.0.23", getOriginalFetch = () => globalThis.fetch, getFromApi2 = async ({
|
|
85930
85960
|
url,
|
|
85931
85961
|
headers = {},
|
|
85932
85962
|
successfulResponseHandler,
|
|
@@ -85939,7 +85969,7 @@ var VERSION2 = "4.0.23", getOriginalFetch = () => globalThis.fetch, getFromApi2
|
|
|
85939
85969
|
method: "GET",
|
|
85940
85970
|
headers: withUserAgentSuffix2(
|
|
85941
85971
|
headers,
|
|
85942
|
-
`ai-sdk/provider-utils/${
|
|
85972
|
+
`ai-sdk/provider-utils/${VERSION3}`,
|
|
85943
85973
|
getRuntimeEnvironmentUserAgent2()
|
|
85944
85974
|
),
|
|
85945
85975
|
signal: abortSignal
|
|
@@ -87132,7 +87162,7 @@ var getOriginalFetch2 = () => globalThis.fetch, postJsonToApi2 = async ({
|
|
|
87132
87162
|
method: "POST",
|
|
87133
87163
|
headers: withUserAgentSuffix2(
|
|
87134
87164
|
headers,
|
|
87135
|
-
`ai-sdk/provider-utils/${
|
|
87165
|
+
`ai-sdk/provider-utils/${VERSION3}`,
|
|
87136
87166
|
getRuntimeEnvironmentUserAgent2()
|
|
87137
87167
|
),
|
|
87138
87168
|
body: body.content,
|
|
@@ -90529,7 +90559,7 @@ async function getVercelRequestId() {
|
|
|
90529
90559
|
var _a83;
|
|
90530
90560
|
return (_a83 = (0, import_oidc.getContext)().headers) == null ? void 0 : _a83["x-vercel-id"];
|
|
90531
90561
|
}
|
|
90532
|
-
var
|
|
90562
|
+
var VERSION4 = "3.0.36", AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
90533
90563
|
function createGatewayProvider(options = {}) {
|
|
90534
90564
|
var _a83, _b82;
|
|
90535
90565
|
let pendingMetadata = null, metadataCache = null, cacheRefreshMillis = (_a83 = options.metadataCacheRefreshMillis) != null ? _a83 : 1e3 * 60 * 5, lastFetchTime = 0, baseURL = (_b82 = withoutTrailingSlash(options.baseURL)) != null ? _b82 : "https://ai-gateway.vercel.sh/v3/ai", getHeaders = async () => {
|
|
@@ -90542,7 +90572,7 @@ function createGatewayProvider(options = {}) {
|
|
|
90542
90572
|
[GATEWAY_AUTH_METHOD_HEADER]: auth2.authMethod,
|
|
90543
90573
|
...options.headers
|
|
90544
90574
|
},
|
|
90545
|
-
`ai-sdk/gateway/${
|
|
90575
|
+
`ai-sdk/gateway/${VERSION4}`
|
|
90546
90576
|
);
|
|
90547
90577
|
} catch (error) {
|
|
90548
90578
|
throw GatewayAuthenticationError.createContextualError({
|
|
@@ -90648,7 +90678,7 @@ async function getGatewayAuthToken(options) {
|
|
|
90648
90678
|
var _globalThis = typeof globalThis == "object" ? globalThis : global;
|
|
90649
90679
|
|
|
90650
90680
|
// node_modules/@opentelemetry/api/build/esm/version.js
|
|
90651
|
-
var
|
|
90681
|
+
var VERSION5 = "1.9.0";
|
|
90652
90682
|
|
|
90653
90683
|
// node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
90654
90684
|
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
@@ -90691,25 +90721,25 @@ function _makeCompatibilityCheck(ownVersion) {
|
|
|
90691
90721
|
return globalVersionParsed.prerelease != null || ownVersionParsed.major !== globalVersionParsed.major ? _reject(globalVersion) : ownVersionParsed.major === 0 ? ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch ? _accept(globalVersion) : _reject(globalVersion) : ownVersionParsed.minor <= globalVersionParsed.minor ? _accept(globalVersion) : _reject(globalVersion);
|
|
90692
90722
|
};
|
|
90693
90723
|
}
|
|
90694
|
-
var isCompatible = _makeCompatibilityCheck(
|
|
90724
|
+
var isCompatible = _makeCompatibilityCheck(VERSION5);
|
|
90695
90725
|
|
|
90696
90726
|
// node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
|
|
90697
|
-
var major =
|
|
90727
|
+
var major = VERSION5.split(".")[0], GLOBAL_OPENTELEMETRY_API_KEY = /* @__PURE__ */ Symbol.for("opentelemetry.js.api." + major), _global = _globalThis;
|
|
90698
90728
|
function registerGlobal(type, instance6, diag, allowOverride) {
|
|
90699
90729
|
var _a21;
|
|
90700
90730
|
allowOverride === void 0 && (allowOverride = !1);
|
|
90701
90731
|
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a21 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a21 !== void 0 ? _a21 : {
|
|
90702
|
-
version:
|
|
90732
|
+
version: VERSION5
|
|
90703
90733
|
};
|
|
90704
90734
|
if (!allowOverride && api[type]) {
|
|
90705
90735
|
var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
|
|
90706
90736
|
return diag.error(err.stack || err.message), !1;
|
|
90707
90737
|
}
|
|
90708
|
-
if (api.version !==
|
|
90709
|
-
var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" +
|
|
90738
|
+
if (api.version !== VERSION5) {
|
|
90739
|
+
var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" + VERSION5);
|
|
90710
90740
|
return diag.error(err.stack || err.message), !1;
|
|
90711
90741
|
}
|
|
90712
|
-
return api[type] = instance6, diag.debug("@opentelemetry/api: Registered a global for " + type + " v" +
|
|
90742
|
+
return api[type] = instance6, diag.debug("@opentelemetry/api: Registered a global for " + type + " v" + VERSION5 + "."), !0;
|
|
90713
90743
|
}
|
|
90714
90744
|
function getGlobal(type) {
|
|
90715
90745
|
var _a21, _b17, globalVersion = (_a21 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a21 === void 0 ? void 0 : _a21.version;
|
|
@@ -90717,7 +90747,7 @@ function getGlobal(type) {
|
|
|
90717
90747
|
return (_b17 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b17 === void 0 ? void 0 : _b17[type];
|
|
90718
90748
|
}
|
|
90719
90749
|
function unregisterGlobal(type, diag) {
|
|
90720
|
-
diag.debug("@opentelemetry/api: Unregistering a global for " + type + " v" +
|
|
90750
|
+
diag.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION5 + ".");
|
|
90721
90751
|
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
90722
90752
|
api && delete api[type];
|
|
90723
90753
|
}
|
|
@@ -91617,14 +91647,14 @@ function detectMediaType({
|
|
|
91617
91647
|
))
|
|
91618
91648
|
return signature.mediaType;
|
|
91619
91649
|
}
|
|
91620
|
-
var
|
|
91650
|
+
var VERSION6 = "6.0.73", download = async ({ url }) => {
|
|
91621
91651
|
var _a21;
|
|
91622
91652
|
let urlText = url.toString();
|
|
91623
91653
|
try {
|
|
91624
91654
|
let response = await fetch(urlText, {
|
|
91625
91655
|
headers: withUserAgentSuffix(
|
|
91626
91656
|
{},
|
|
91627
|
-
`ai-sdk/${
|
|
91657
|
+
`ai-sdk/${VERSION6}`,
|
|
91628
91658
|
getRuntimeEnvironmentUserAgent()
|
|
91629
91659
|
)
|
|
91630
91660
|
});
|
|
@@ -93787,7 +93817,7 @@ async function generateText({
|
|
|
93787
93817
|
abortSignal: mergedAbortSignal
|
|
93788
93818
|
}), callSettings = prepareCallSettings(settings2), headersWithUserAgent = withUserAgentSuffix(
|
|
93789
93819
|
headers ?? {},
|
|
93790
|
-
`ai/${
|
|
93820
|
+
`ai/${VERSION6}`
|
|
93791
93821
|
), baseTelemetryAttributes = getBaseTelemetryAttributes({
|
|
93792
93822
|
model,
|
|
93793
93823
|
telemetry,
|
|
@@ -98499,7 +98529,7 @@ import { join as join29 } from "path";
|
|
|
98499
98529
|
import { existsSync as existsSync15, mkdirSync as mkdirSync11, readFileSync as readFileSync10, writeFileSync as writeFileSync11, rmSync as rmSync7 } from "fs";
|
|
98500
98530
|
import { execFile as execFile8 } from "child_process";
|
|
98501
98531
|
import { promisify as promisify4 } from "util";
|
|
98502
|
-
var execFileAsync3 = promisify4(execFile8),
|
|
98532
|
+
var execFileAsync3 = promisify4(execFile8), IS_WIN3 = process.platform === "win32", NPM_BIN3 = IS_WIN3 ? "npm.cmd" : "npm", STDLIB_PACKAGES = [
|
|
98503
98533
|
// Document
|
|
98504
98534
|
{ name: "xlsx", version: "0.18.5" },
|
|
98505
98535
|
{ name: "pdf-lib", version: "1.17.1" },
|
|
@@ -98569,13 +98599,14 @@ var execFileAsync3 = promisify4(execFile8), IS_WIN2 = process.platform === "win3
|
|
|
98569
98599
|
), onProgress?.(`Installing ${name21}@${version}...`);
|
|
98570
98600
|
try {
|
|
98571
98601
|
let { stdout, stderr } = await execFileAsync3(
|
|
98572
|
-
|
|
98602
|
+
NPM_BIN3,
|
|
98573
98603
|
["install", "--save", "--no-audit", "--no-fund", `${name21}@${version}`],
|
|
98574
98604
|
{
|
|
98575
98605
|
cwd: installDir,
|
|
98576
98606
|
env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" },
|
|
98577
98607
|
timeout: 12e4,
|
|
98578
|
-
shell:
|
|
98608
|
+
shell: IS_WIN3,
|
|
98609
|
+
windowsHide: !0
|
|
98579
98610
|
}
|
|
98580
98611
|
);
|
|
98581
98612
|
stderr && !stderr.includes("npm warn") && console.warn(`[SandboxStdlib] npm stderr for ${name21}:`, stderr);
|
|
@@ -99670,7 +99701,7 @@ var UvManager = class {
|
|
|
99670
99701
|
}
|
|
99671
99702
|
async _getVersion(uvBin) {
|
|
99672
99703
|
try {
|
|
99673
|
-
let { stdout } = await execFileAsync4(uvBin, ["--version"], { timeout: 1e4 }), match = stdout.trim().match(/^uv\s+(\d+\.\d+\.\d+)/);
|
|
99704
|
+
let { stdout } = await execFileAsync4(uvBin, ["--version"], { timeout: 1e4, windowsHide: !0 }), match = stdout.trim().match(/^uv\s+(\d+\.\d+\.\d+)/);
|
|
99674
99705
|
return match ? match[1] : null;
|
|
99675
99706
|
} catch {
|
|
99676
99707
|
return null;
|
|
@@ -99689,14 +99720,14 @@ var UvManager = class {
|
|
|
99689
99720
|
"-NoProfile",
|
|
99690
99721
|
"-Command",
|
|
99691
99722
|
`Expand-Archive -Path '${archivePath}' -DestinationPath '${tempDir}' -Force`
|
|
99692
|
-
], { timeout: 6e4 }) : await execFileAsync4("tar", ["xzf", archivePath, "-C", tempDir, "--strip-components=1"], { timeout: 6e4 });
|
|
99723
|
+
], { timeout: 6e4, windowsHide: !0 }) : await execFileAsync4("tar", ["xzf", archivePath, "-C", tempDir, "--strip-components=1"], { timeout: 6e4, windowsHide: !0 });
|
|
99693
99724
|
let extractedBinary = join30(tempDir, binaryName);
|
|
99694
99725
|
if (!existsSync16(extractedBinary))
|
|
99695
99726
|
throw new Error(`Binary ${binaryName} not found after extraction in ${tempDir}`);
|
|
99696
99727
|
let tempTarget = `${targetPath}.tmp`;
|
|
99697
99728
|
if (renameSync4(extractedBinary, tempTarget), renameSync4(tempTarget, targetPath), process.platform !== "win32" && chmodSync(targetPath, 493), process.platform === "darwin")
|
|
99698
99729
|
try {
|
|
99699
|
-
await execFileAsync4("xattr", ["-d", "com.apple.quarantine", targetPath], { timeout: 5e3 });
|
|
99730
|
+
await execFileAsync4("xattr", ["-d", "com.apple.quarantine", targetPath], { timeout: 5e3, windowsHide: !0 });
|
|
99700
99731
|
} catch {
|
|
99701
99732
|
}
|
|
99702
99733
|
return console.log(`[UvManager] Installed uv to ${targetPath}`), targetPath;
|
|
@@ -99713,7 +99744,7 @@ var UvManager = class {
|
|
|
99713
99744
|
// ---------------------------------------------------------------------------
|
|
99714
99745
|
async ensurePython(minVersion = "3.12") {
|
|
99715
99746
|
let uv = await this.ensureUv();
|
|
99716
|
-
await this._hasPython(uv, minVersion) || (console.log(`[UvManager] Installing Python ${minVersion}...`), await execFileAsync4(uv, ["python", "install", minVersion], { timeout: 3e5 }), console.log(`[UvManager] Python ${minVersion} installed`));
|
|
99747
|
+
await this._hasPython(uv, minVersion) || (console.log(`[UvManager] Installing Python ${minVersion}...`), await execFileAsync4(uv, ["python", "install", minVersion], { timeout: 3e5, windowsHide: !0 }), console.log(`[UvManager] Python ${minVersion} installed`));
|
|
99717
99748
|
}
|
|
99718
99749
|
async isPythonAvailable(minVersion = "3.12") {
|
|
99719
99750
|
try {
|
|
@@ -99725,7 +99756,7 @@ var UvManager = class {
|
|
|
99725
99756
|
}
|
|
99726
99757
|
async _hasPython(uv, minVersion) {
|
|
99727
99758
|
try {
|
|
99728
|
-
return await execFileAsync4(uv, ["python", "find", minVersion], { timeout: 1e4 }), !0;
|
|
99759
|
+
return await execFileAsync4(uv, ["python", "find", minVersion], { timeout: 1e4, windowsHide: !0 }), !0;
|
|
99729
99760
|
} catch {
|
|
99730
99761
|
return !1;
|
|
99731
99762
|
}
|
|
@@ -99737,12 +99768,13 @@ var UvManager = class {
|
|
|
99737
99768
|
let uv = await this.ensureUv(), spec = version ? `${pkg}@${version}` : pkg;
|
|
99738
99769
|
onProgress?.(`Installing ${spec} via uv...`), console.log(`[UvManager] Installing tool: ${spec}`), await execFileAsync4(uv, ["tool", "install", spec], {
|
|
99739
99770
|
timeout: 12e4,
|
|
99771
|
+
windowsHide: !0,
|
|
99740
99772
|
env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" }
|
|
99741
99773
|
}), onProgress?.(`Installed ${spec}`), console.log(`[UvManager] Installed tool: ${spec}`);
|
|
99742
99774
|
}
|
|
99743
99775
|
async toolUninstall(pkg) {
|
|
99744
99776
|
let uv = await this.ensureUv();
|
|
99745
|
-
console.log(`[UvManager] Uninstalling tool: ${pkg}`), await execFileAsync4(uv, ["tool", "uninstall", pkg], { timeout: 3e4 });
|
|
99777
|
+
console.log(`[UvManager] Uninstalling tool: ${pkg}`), await execFileAsync4(uv, ["tool", "uninstall", pkg], { timeout: 3e4, windowsHide: !0 });
|
|
99746
99778
|
}
|
|
99747
99779
|
/**
|
|
99748
99780
|
* Absolute path to a tool's executable, or throw so callers fall back to
|
|
@@ -99764,13 +99796,13 @@ var UvManager = class {
|
|
|
99764
99796
|
}
|
|
99765
99797
|
}, exeName = (name21) => process.platform === "win32" ? `${name21}.exe` : name21, names = [.../* @__PURE__ */ new Set([...await this.listEntryPoints(pkg), pkg])], binDirs = [];
|
|
99766
99798
|
try {
|
|
99767
|
-
let { stdout } = await execFileAsync4(uv, ["tool", "dir", "--bin"], { timeout: 1e4 });
|
|
99799
|
+
let { stdout } = await execFileAsync4(uv, ["tool", "dir", "--bin"], { timeout: 1e4, windowsHide: !0 });
|
|
99768
99800
|
stdout.trim() && binDirs.push(stdout.trim());
|
|
99769
99801
|
} catch {
|
|
99770
99802
|
}
|
|
99771
99803
|
binDirs.push(join30(homedir4(), ".local", "bin"));
|
|
99772
99804
|
try {
|
|
99773
|
-
let { stdout } = await execFileAsync4(uv, ["tool", "dir"], { timeout: 1e4 }), toolDir = stdout.trim();
|
|
99805
|
+
let { stdout } = await execFileAsync4(uv, ["tool", "dir"], { timeout: 1e4, windowsHide: !0 }), toolDir = stdout.trim();
|
|
99774
99806
|
toolDir && binDirs.push(join30(toolDir, pkg, process.platform === "win32" ? "Scripts" : "bin"));
|
|
99775
99807
|
} catch {
|
|
99776
99808
|
}
|
|
@@ -99785,7 +99817,7 @@ var UvManager = class {
|
|
|
99785
99817
|
async listEntryPoints(pkg) {
|
|
99786
99818
|
let uv = await this.ensureUv();
|
|
99787
99819
|
try {
|
|
99788
|
-
let { stdout } = await execFileAsync4(uv, ["tool", "list"], { timeout: 1e4 }), names = [], inPkg = !1;
|
|
99820
|
+
let { stdout } = await execFileAsync4(uv, ["tool", "list"], { timeout: 1e4, windowsHide: !0 }), names = [], inPkg = !1;
|
|
99789
99821
|
for (let line of stdout.split(`
|
|
99790
99822
|
`))
|
|
99791
99823
|
line.startsWith("- ") ? inPkg && names.push(line.slice(2).trim()) : inPkg = line.match(/^(\S+)\s+v?\S+/)?.[1] === pkg;
|
|
@@ -99797,7 +99829,7 @@ var UvManager = class {
|
|
|
99797
99829
|
async listTools() {
|
|
99798
99830
|
let uv = await this.ensureUv();
|
|
99799
99831
|
try {
|
|
99800
|
-
let { stdout } = await execFileAsync4(uv, ["tool", "list"], { timeout: 1e4 }), tools = [];
|
|
99832
|
+
let { stdout } = await execFileAsync4(uv, ["tool", "list"], { timeout: 1e4, windowsHide: !0 }), tools = [];
|
|
99801
99833
|
for (let line of stdout.split(`
|
|
99802
99834
|
`)) {
|
|
99803
99835
|
let match = line.match(/^(\S+)\s+v?(\S+)/);
|
package/package.json
CHANGED