@fased/fased 0.1.38 → 0.1.40
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/brand.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/cli/daemon-cli/install.js +38 -14
- package/dist/cli/daemon-cli/register-service-commands.js +1 -1
- package/dist/cli/update-cli/service-target.js +13 -0
- package/dist/cli/update-cli/update-command.js +122 -44
- package/dist/commands/daemon-install-helpers.js +3 -0
- package/dist/daemon/service.js +5 -0
- package/dist/daemon/systemd-system.js +237 -0
- package/dist/daemon/systemd.js +2 -2
- package/dist/infra/update-runner.js +41 -5
- package/dist/plugin-sdk/{accounts-COY-15zJ.js → accounts-C5BjfxoO.js} +1 -1
- package/dist/plugin-sdk/{allow-list-Cgjx0Mc-.js → allow-list-DqLmAAjC.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-BPK8t0tI.js → audio-preflight-CSRhaknd.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-kCa_KGRH.js → audio-preflight-DlkuhmkH.js} +2 -2
- package/dist/plugin-sdk/channel-plugin-common.js +2 -2
- package/dist/plugin-sdk/{chunk-items-DGHUeFuI.js → chunk-items-B1CvDQbk.js} +1 -1
- package/dist/plugin-sdk/command-status.js +2 -2
- package/dist/plugin-sdk/{config-C0qggNKQ.js → config-BxVjLTIv.js} +7 -7
- package/dist/plugin-sdk/{config-z0k05dwe.js → config-DLVjQxOu.js} +7 -7
- package/dist/plugin-sdk/{config-BULEb5QB.js → config-HEgnpfBH.js} +7 -7
- package/dist/plugin-sdk/{config-DgD5T-Ui.js → config-g1MG9Bet.js} +7 -7
- package/dist/plugin-sdk/discord.js +6 -6
- package/dist/plugin-sdk/{guilds-iTYlgBat.js → guilds-BivaIhOn.js} +1 -1
- package/dist/plugin-sdk/index.js +12 -2
- package/dist/plugin-sdk/{login-YveoqEvH.js → login-CfRfRNc7.js} +2 -2
- package/dist/plugin-sdk/{monitor-rOs3mUol.js → monitor-4qlGtlZm.js} +3 -3
- package/dist/plugin-sdk/{monitor-C6Ohw9BA.js → monitor-CA4i9Vhf.js} +4 -4
- package/dist/plugin-sdk/{monitor-6lkdOqhQ.js → monitor-CIQ75vj5.js} +3 -3
- package/dist/plugin-sdk/{monitor-o20KTHIi.js → monitor-uao4bwTm.js} +6 -6
- package/dist/plugin-sdk/{openresponses-http-BJONnUdy.js → openresponses-http-Do-lt3tH.js} +1 -1
- package/dist/plugin-sdk/{openresponses-http-DkWqYznu.js → openresponses-http-Y766bB2w.js} +2 -2
- package/dist/plugin-sdk/{pi-embedded-runner-DqDy0MWN.js → pi-embedded-runner-Cl-dGLKY.js} +7 -7
- package/dist/plugin-sdk/{pi-model-discovery-runtime-w4DRRv53.js → pi-model-discovery-runtime-CfDDK1n5.js} +2 -2
- package/dist/plugin-sdk/{pi-model-discovery-runtime-CQOauapl.js → pi-model-discovery-runtime-DYfUuqPN.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-C5ssE6EW.js → pi-model-discovery-runtime-DxoFm4Vd.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-CKKNoqwk.js → pi-model-discovery-runtime-LB-5lX5L.js} +1 -1
- package/dist/plugin-sdk/{pw-ai-Boor5vYw.js → pw-ai-SNCI9UXT.js} +1 -1
- package/dist/plugin-sdk/{resolve-channels-gIpOj1wt.js → resolve-channels-BptLzpDb.js} +3 -3
- package/dist/plugin-sdk/{resolve-users-CTKaESmf.js → resolve-users-C0YLyf20.js} +3 -3
- package/dist/plugin-sdk/{resolve-utils-bixHYDBj.js → resolve-utils-Bq0vrn3x.js} +1 -1
- package/dist/plugin-sdk/{retry-CB29XXbz.js → retry-CxA2fayk.js} +2 -2
- package/dist/plugin-sdk/{runtime-dependency-Deg_sw2k.js → runtime-dependency-B-1u41Ph.js} +9 -9
- package/dist/plugin-sdk/{slack-CGTAN4UD.js → slack-BnH97t7_.js} +3 -3
- package/dist/plugin-sdk/{slack-BErIh0uj.js → slack-DvaEXxo5.js} +4 -4
- package/dist/plugin-sdk/slack.js +2 -2
- package/dist/plugin-sdk/src/brand.d.ts +2 -2
- package/dist/plugin-sdk/src/daemon/systemd-system.d.ts +28 -0
- package/dist/plugin-sdk/{status-CCGFb0f2.js → status-DKwtdFcx.js} +15 -15
- package/dist/plugin-sdk/{sticker-cache-wxl1Me2i.js → sticker-cache-C6yLVx3S.js} +2 -2
- package/dist/plugin-sdk/{sticker-cache-CKAkkCoU.js → sticker-cache-Dmrdawoj.js} +2 -2
- package/dist/plugin-sdk/{telegram-actions-r86ntIKR.js → telegram-actions-DnvgAPkX.js} +2 -2
- package/dist/plugin-sdk/{telegram-actions-BRUNEXMr.js → telegram-actions-JyjH4UpU.js} +3 -3
- package/dist/plugin-sdk/{web-02I0vmdu.js → web-4BVlmvJD.js} +2 -2
- package/dist/plugin-sdk/{web-CXz56wyu.js → web-DsLHqCkb.js} +1 -1
- package/dist/plugin-sdk/whatsapp.js +4 -4
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/scripts/start-managed.sh +2 -2
|
@@ -288,6 +288,26 @@ async function safeRemove(pathname) {
|
|
|
288
288
|
force: true
|
|
289
289
|
}).catch(() => undefined);
|
|
290
290
|
}
|
|
291
|
+
async function finalizeUpdateTransaction(transaction) {
|
|
292
|
+
if (!transaction) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
await safeRemove(transaction.backupRoot);
|
|
296
|
+
}
|
|
297
|
+
async function rollbackUpdateTransaction(transaction) {
|
|
298
|
+
if (!transaction) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
const failedRoot = `${transaction.packageRoot}.failed-${Date.now()}`;
|
|
302
|
+
await fs.rename(transaction.packageRoot, failedRoot);
|
|
303
|
+
try {
|
|
304
|
+
await fs.rename(transaction.backupRoot, transaction.packageRoot);
|
|
305
|
+
} catch (error) {
|
|
306
|
+
await fs.rename(failedRoot, transaction.packageRoot).catch(() => undefined);
|
|
307
|
+
throw error;
|
|
308
|
+
}
|
|
309
|
+
await safeRemove(failedRoot);
|
|
310
|
+
}
|
|
291
311
|
async function swapPackageRoot(params) {
|
|
292
312
|
const packageParent = path.dirname(params.pkgRoot);
|
|
293
313
|
const backupRoot = path.join(packageParent, `.fased-backup-${Date.now()}-${path.basename(params.pkgRoot)}`);
|
|
@@ -305,6 +325,7 @@ async function runHostedArtifactUpdate(params) {
|
|
|
305
325
|
const tempRoot = await fs.mkdtemp(path.join(packageParent, ".fased-artifact-update-"));
|
|
306
326
|
const steps = [];
|
|
307
327
|
let backupRoot = null;
|
|
328
|
+
let retainBackup = false;
|
|
308
329
|
try {
|
|
309
330
|
const spec = `${params.packageName}@${params.expectedVersion}`;
|
|
310
331
|
const packStep = await runStep({
|
|
@@ -450,13 +471,19 @@ async function runHostedArtifactUpdate(params) {
|
|
|
450
471
|
};
|
|
451
472
|
}
|
|
452
473
|
const afterVersion = await readPackageVersion(params.pkgRoot);
|
|
474
|
+
retainBackup = true;
|
|
453
475
|
return {
|
|
454
476
|
kind: "updated",
|
|
455
477
|
steps,
|
|
456
|
-
afterVersion
|
|
478
|
+
afterVersion,
|
|
479
|
+
transaction: {
|
|
480
|
+
kind: "package-root-swap",
|
|
481
|
+
packageRoot: params.pkgRoot,
|
|
482
|
+
backupRoot
|
|
483
|
+
}
|
|
457
484
|
};
|
|
458
485
|
} finally {
|
|
459
|
-
if (backupRoot) {
|
|
486
|
+
if (backupRoot && !retainBackup) {
|
|
460
487
|
await safeRemove(backupRoot);
|
|
461
488
|
}
|
|
462
489
|
await safeRemove(tempRoot);
|
|
@@ -475,6 +502,7 @@ async function runHostedReleaseArtifactUpdate(params) {
|
|
|
475
502
|
const tempRoot = await fs.mkdtemp(path.join(packageParent, ".fased-release-update-"));
|
|
476
503
|
const steps = [];
|
|
477
504
|
let backupRoot = null;
|
|
505
|
+
let retainBackup = false;
|
|
478
506
|
let progressIndex = 0;
|
|
479
507
|
const totalSteps = 4;
|
|
480
508
|
const startProgress = (name, command, cwd) => {
|
|
@@ -651,13 +679,19 @@ async function runHostedReleaseArtifactUpdate(params) {
|
|
|
651
679
|
afterVersion: await readPackageVersion(params.pkgRoot)
|
|
652
680
|
};
|
|
653
681
|
}
|
|
682
|
+
retainBackup = true;
|
|
654
683
|
return {
|
|
655
684
|
kind: "updated",
|
|
656
685
|
steps,
|
|
657
|
-
afterVersion: await readPackageVersion(params.pkgRoot)
|
|
686
|
+
afterVersion: await readPackageVersion(params.pkgRoot),
|
|
687
|
+
transaction: {
|
|
688
|
+
kind: "package-root-swap",
|
|
689
|
+
packageRoot: params.pkgRoot,
|
|
690
|
+
backupRoot
|
|
691
|
+
}
|
|
658
692
|
};
|
|
659
693
|
} finally {
|
|
660
|
-
if (backupRoot) {
|
|
694
|
+
if (backupRoot && !retainBackup) {
|
|
661
695
|
await safeRemove(backupRoot);
|
|
662
696
|
}
|
|
663
697
|
await safeRemove(tempRoot);
|
|
@@ -1374,6 +1408,7 @@ async function runGatewayUpdate(opts = {}) {
|
|
|
1374
1408
|
root: pkgRoot,
|
|
1375
1409
|
before: { version: beforeVersion },
|
|
1376
1410
|
after: { version: releaseResult.afterVersion },
|
|
1411
|
+
transaction: releaseResult.transaction,
|
|
1377
1412
|
steps,
|
|
1378
1413
|
durationMs: Date.now() - startedAt
|
|
1379
1414
|
};
|
|
@@ -1418,6 +1453,7 @@ async function runGatewayUpdate(opts = {}) {
|
|
|
1418
1453
|
root: pkgRoot,
|
|
1419
1454
|
before: { version: beforeVersion },
|
|
1420
1455
|
after: { version: artifactResult.afterVersion },
|
|
1456
|
+
transaction: artifactResult.transaction,
|
|
1421
1457
|
steps,
|
|
1422
1458
|
durationMs: Date.now() - startedAt
|
|
1423
1459
|
};
|
|
@@ -1518,4 +1554,4 @@ async function runGatewayUpdate(opts = {}) {
|
|
|
1518
1554
|
}
|
|
1519
1555
|
|
|
1520
1556
|
//#endregion
|
|
1521
|
-
export { runGatewayUpdate };
|
|
1557
|
+
export { finalizeUpdateTransaction, rollbackUpdateTransaction, runGatewayUpdate };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as info, E as resolveUserPath, I as expandHomePrefix, L as resolveRequiredHomeDir, M as getChildLogger, O as defaultRuntime, P as resolveOAuthDir, j as success, v as DEFAULT_ACCOUNT_ID, y as normalizeAccountId } from "./config-
|
|
1
|
+
import { A as info, E as resolveUserPath, I as expandHomePrefix, L as resolveRequiredHomeDir, M as getChildLogger, O as defaultRuntime, P as resolveOAuthDir, j as success, v as DEFAULT_ACCOUNT_ID, y as normalizeAccountId } from "./config-g1MG9Bet.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import os from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as retryAsync, o as DEFAULT_ACCOUNT_ID, s as normalizeAccountId, t as resolveRetryConfig } from "./retry-
|
|
1
|
+
import { n as retryAsync, o as DEFAULT_ACCOUNT_ID, s as normalizeAccountId, t as resolveRetryConfig } from "./retry-CxA2fayk.js";
|
|
2
2
|
|
|
3
3
|
//#region src/discord/token.ts
|
|
4
4
|
function normalizeDiscordToken(raw) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as resolveMediaAttachmentLocalRoots, Dt as createMediaAttachmentCache, Et as buildProviderRegistry, Mt as isAudioAttachment, Ot as normalizeMediaAttachments, jt as runCapability } from "./pi-embedded-runner-
|
|
1
|
+
import { At as resolveMediaAttachmentLocalRoots, Dt as createMediaAttachmentCache, Et as buildProviderRegistry, Mt as isAudioAttachment, Ot as normalizeMediaAttachments, jt as runCapability } from "./pi-embedded-runner-Cl-dGLKY.js";
|
|
2
2
|
import "./runtime-BPyuAmka.js";
|
|
3
3
|
import "./subsystem-DBPNbQDQ.js";
|
|
4
4
|
import { i as logVerbose, s as shouldLogVerbose } from "./globals-B_jjtAje.js";
|
|
@@ -14,8 +14,8 @@ import "./accounts-BwkH5bTD.js";
|
|
|
14
14
|
import "./tokens-BK5rrwBB.js";
|
|
15
15
|
import "./allow-list-CBtbuDI8.js";
|
|
16
16
|
import "./paths-DTurNPnO.js";
|
|
17
|
-
import { ct as buildProviderRegistry, ft as resolveMediaAttachmentLocalRoots, lt as createMediaAttachmentCache, mt as isAudioAttachment, pt as runCapability, ut as normalizeMediaAttachments } from "./status-
|
|
18
|
-
import "./runtime-dependency-
|
|
17
|
+
import { ct as buildProviderRegistry, ft as resolveMediaAttachmentLocalRoots, lt as createMediaAttachmentCache, mt as isAudioAttachment, pt as runCapability, ut as normalizeMediaAttachments } from "./status-DKwtdFcx.js";
|
|
18
|
+
import "./runtime-dependency-B-1u41Ph.js";
|
|
19
19
|
import "./ssrf-Cce6LubA.js";
|
|
20
20
|
import "./skill-commands-hyZA0LE3.js";
|
|
21
21
|
import "./pi-model-discovery-DadlvsZW.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveImplicitProviders, c as resolveProcessScopedMap, d as expandHomePrefix, f as resolveRequiredHomeDir, h as normalizeAccountId, i as resolveImplicitCopilotProvider, l as isRecord, m as DEFAULT_ACCOUNT_ID, p as formatCliCommand, r as normalizeProviders, s as resolveFasedAgentDir, t as loadConfig, u as createSubsystemLogger } from "./config-
|
|
1
|
+
import { a as resolveImplicitProviders, c as resolveProcessScopedMap, d as expandHomePrefix, f as resolveRequiredHomeDir, h as normalizeAccountId, i as resolveImplicitCopilotProvider, l as isRecord, m as DEFAULT_ACCOUNT_ID, p as formatCliCommand, r as normalizeProviders, s as resolveFasedAgentDir, t as loadConfig, u as createSubsystemLogger } from "./config-BxVjLTIv.js";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import os from "node:os";
|
|
@@ -856,7 +856,7 @@ async function loadContextCache() {
|
|
|
856
856
|
await ensureFasedModelsJson(cfg);
|
|
857
857
|
} catch {}
|
|
858
858
|
try {
|
|
859
|
-
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-runtime-
|
|
859
|
+
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-runtime-DxoFm4Vd.js");
|
|
860
860
|
const agentDir = resolveFasedAgentDir();
|
|
861
861
|
const modelRegistry = discoverModels(discoverAuthStorage(agentDir), agentDir);
|
|
862
862
|
applyDiscoveredContextWindows({
|
|
@@ -14,8 +14,8 @@ import "./accounts-BwkH5bTD.js";
|
|
|
14
14
|
import "./tokens-BK5rrwBB.js";
|
|
15
15
|
import "./allow-list-CBtbuDI8.js";
|
|
16
16
|
import "./paths-DTurNPnO.js";
|
|
17
|
-
import { n as buildCommandsMessagePaginated, r as buildHelpMessage, t as buildCommandsMessage } from "./status-
|
|
18
|
-
import "./runtime-dependency-
|
|
17
|
+
import { n as buildCommandsMessagePaginated, r as buildHelpMessage, t as buildCommandsMessage } from "./status-DKwtdFcx.js";
|
|
18
|
+
import "./runtime-dependency-B-1u41Ph.js";
|
|
19
19
|
import "./ssrf-Cce6LubA.js";
|
|
20
20
|
import "./skill-commands-hyZA0LE3.js";
|
|
21
21
|
import "./pi-model-discovery-DadlvsZW.js";
|
|
@@ -4,7 +4,7 @@ import path from "node:path";
|
|
|
4
4
|
import chalk, { Chalk } from "chalk";
|
|
5
5
|
import { Logger } from "tslog";
|
|
6
6
|
import os from "node:os";
|
|
7
|
-
import
|
|
7
|
+
import json5 from "json5";
|
|
8
8
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
9
9
|
import fs$1 from "node:fs/promises";
|
|
10
10
|
import { execFile, execFileSync } from "node:child_process";
|
|
@@ -433,7 +433,7 @@ function readLoggingConfig() {
|
|
|
433
433
|
try {
|
|
434
434
|
if (!fs.existsSync(configPath)) return;
|
|
435
435
|
const raw = fs.readFileSync(configPath, "utf-8");
|
|
436
|
-
const logging =
|
|
436
|
+
const logging = json5.parse(raw)?.logging;
|
|
437
437
|
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
|
|
438
438
|
return logging;
|
|
439
439
|
} catch {
|
|
@@ -2795,7 +2795,7 @@ function loadPluginManifest(rootDir) {
|
|
|
2795
2795
|
}
|
|
2796
2796
|
let raw;
|
|
2797
2797
|
try {
|
|
2798
|
-
raw =
|
|
2798
|
+
raw = json5.parse(fs.readFileSync(opened.fd, "utf-8"));
|
|
2799
2799
|
} catch (err) {
|
|
2800
2800
|
return {
|
|
2801
2801
|
ok: false,
|
|
@@ -13235,7 +13235,7 @@ const defaultResolver = {
|
|
|
13235
13235
|
resolvedPath,
|
|
13236
13236
|
rootRealDir
|
|
13237
13237
|
}),
|
|
13238
|
-
parseJson: (raw) =>
|
|
13238
|
+
parseJson: (raw) => json5.parse(raw)
|
|
13239
13239
|
};
|
|
13240
13240
|
/**
|
|
13241
13241
|
* Resolves all $include directives in a parsed config object.
|
|
@@ -19848,7 +19848,7 @@ function resolveConfigPathForDeps(deps) {
|
|
|
19848
19848
|
function normalizeDeps(overrides = {}) {
|
|
19849
19849
|
return {
|
|
19850
19850
|
fs: overrides.fs ?? fs,
|
|
19851
|
-
json5: overrides.json5 ??
|
|
19851
|
+
json5: overrides.json5 ?? json5,
|
|
19852
19852
|
env: overrides.env ?? process.env,
|
|
19853
19853
|
homedir: overrides.homedir ?? (() => resolveRequiredHomeDir(overrides.env ?? process.env, os.homedir)),
|
|
19854
19854
|
configPath: overrides.configPath ?? "",
|
|
@@ -19859,11 +19859,11 @@ function maybeLoadDotEnvForConfig(env) {
|
|
|
19859
19859
|
if (env !== process.env) return;
|
|
19860
19860
|
loadDotEnv({ quiet: true });
|
|
19861
19861
|
}
|
|
19862
|
-
function parseConfigJson5(raw, json5 =
|
|
19862
|
+
function parseConfigJson5(raw, json5$1 = json5) {
|
|
19863
19863
|
try {
|
|
19864
19864
|
return {
|
|
19865
19865
|
ok: true,
|
|
19866
|
-
parsed: json5.parse(raw)
|
|
19866
|
+
parsed: json5$1.parse(raw)
|
|
19867
19867
|
};
|
|
19868
19868
|
} catch (err) {
|
|
19869
19869
|
return {
|
|
@@ -4,7 +4,7 @@ import chalk, { Chalk } from "chalk";
|
|
|
4
4
|
import fs, { constants } from "node:fs";
|
|
5
5
|
import { Logger } from "tslog";
|
|
6
6
|
import os from "node:os";
|
|
7
|
-
import
|
|
7
|
+
import json5 from "json5";
|
|
8
8
|
import util, { isDeepStrictEqual, promisify } from "node:util";
|
|
9
9
|
import fs$1 from "node:fs/promises";
|
|
10
10
|
import { execFile, execFileSync } from "node:child_process";
|
|
@@ -325,7 +325,7 @@ function readLoggingConfig() {
|
|
|
325
325
|
try {
|
|
326
326
|
if (!fs.existsSync(configPath)) return;
|
|
327
327
|
const raw = fs.readFileSync(configPath, "utf-8");
|
|
328
|
-
const logging =
|
|
328
|
+
const logging = json5.parse(raw)?.logging;
|
|
329
329
|
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
|
|
330
330
|
return logging;
|
|
331
331
|
} catch {
|
|
@@ -2807,7 +2807,7 @@ function loadPluginManifest(rootDir) {
|
|
|
2807
2807
|
}
|
|
2808
2808
|
let raw;
|
|
2809
2809
|
try {
|
|
2810
|
-
raw =
|
|
2810
|
+
raw = json5.parse(fs.readFileSync(opened.fd, "utf-8"));
|
|
2811
2811
|
} catch (err) {
|
|
2812
2812
|
return {
|
|
2813
2813
|
ok: false,
|
|
@@ -13247,7 +13247,7 @@ const defaultResolver = {
|
|
|
13247
13247
|
resolvedPath,
|
|
13248
13248
|
rootRealDir
|
|
13249
13249
|
}),
|
|
13250
|
-
parseJson: (raw) =>
|
|
13250
|
+
parseJson: (raw) => json5.parse(raw)
|
|
13251
13251
|
};
|
|
13252
13252
|
/**
|
|
13253
13253
|
* Resolves all $include directives in a parsed config object.
|
|
@@ -19860,7 +19860,7 @@ function resolveConfigPathForDeps(deps) {
|
|
|
19860
19860
|
function normalizeDeps(overrides = {}) {
|
|
19861
19861
|
return {
|
|
19862
19862
|
fs: overrides.fs ?? fs,
|
|
19863
|
-
json5: overrides.json5 ??
|
|
19863
|
+
json5: overrides.json5 ?? json5,
|
|
19864
19864
|
env: overrides.env ?? process.env,
|
|
19865
19865
|
homedir: overrides.homedir ?? (() => resolveRequiredHomeDir(overrides.env ?? process.env, os.homedir)),
|
|
19866
19866
|
configPath: overrides.configPath ?? "",
|
|
@@ -19871,11 +19871,11 @@ function maybeLoadDotEnvForConfig(env) {
|
|
|
19871
19871
|
if (env !== process.env) return;
|
|
19872
19872
|
loadDotEnv({ quiet: true });
|
|
19873
19873
|
}
|
|
19874
|
-
function parseConfigJson5(raw, json5 =
|
|
19874
|
+
function parseConfigJson5(raw, json5$1 = json5) {
|
|
19875
19875
|
try {
|
|
19876
19876
|
return {
|
|
19877
19877
|
ok: true,
|
|
19878
|
-
parsed: json5.parse(raw)
|
|
19878
|
+
parsed: json5$1.parse(raw)
|
|
19879
19879
|
};
|
|
19880
19880
|
} catch (err) {
|
|
19881
19881
|
return {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { C as normalizeLogLevel, E as resolveDefaultConfigCandidates, O as resolveOAuthPath, S as levelToMinLevel, T as resolveConfigPath, _ as getChildLogger, b as resolveEnvLogLevelOverride, c as isBlockedObjectKey, f as resolveConfigDir, h as isVerbose, i as normalizeAgentId, j as resolveRequiredHomeDir, k as resolveStateDir, m as isPlainObject$2, n as retryAsync, p as resolveUserPath, r as DEFAULT_AGENT_ID, u as isRecord$2, v as isFileLogLevelEnabled, w as readLoggingConfig, x as loggingState, y as resolveNodeRequireFromMeta } from "./retry-
|
|
1
|
+
import { C as normalizeLogLevel, E as resolveDefaultConfigCandidates, O as resolveOAuthPath, S as levelToMinLevel, T as resolveConfigPath, _ as getChildLogger, b as resolveEnvLogLevelOverride, c as isBlockedObjectKey, f as resolveConfigDir, h as isVerbose, i as normalizeAgentId, j as resolveRequiredHomeDir, k as resolveStateDir, m as isPlainObject$2, n as retryAsync, p as resolveUserPath, r as DEFAULT_AGENT_ID, u as isRecord$2, v as isFileLogLevelEnabled, w as readLoggingConfig, x as loggingState, y as resolveNodeRequireFromMeta } from "./retry-CxA2fayk.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { Chalk } from "chalk";
|
|
5
5
|
import fs, { constants } from "node:fs";
|
|
6
6
|
import os from "node:os";
|
|
7
|
-
import
|
|
7
|
+
import json5 from "json5";
|
|
8
8
|
import util, { isDeepStrictEqual, promisify } from "node:util";
|
|
9
9
|
import fs$1 from "node:fs/promises";
|
|
10
10
|
import { execFile, execFileSync } from "node:child_process";
|
|
@@ -2144,7 +2144,7 @@ function loadPluginManifest(rootDir) {
|
|
|
2144
2144
|
}
|
|
2145
2145
|
let raw;
|
|
2146
2146
|
try {
|
|
2147
|
-
raw =
|
|
2147
|
+
raw = json5.parse(fs.readFileSync(opened.fd, "utf-8"));
|
|
2148
2148
|
} catch (err) {
|
|
2149
2149
|
return {
|
|
2150
2150
|
ok: false,
|
|
@@ -12510,7 +12510,7 @@ const defaultResolver = {
|
|
|
12510
12510
|
resolvedPath,
|
|
12511
12511
|
rootRealDir
|
|
12512
12512
|
}),
|
|
12513
|
-
parseJson: (raw) =>
|
|
12513
|
+
parseJson: (raw) => json5.parse(raw)
|
|
12514
12514
|
};
|
|
12515
12515
|
/**
|
|
12516
12516
|
* Resolves all $include directives in a parsed config object.
|
|
@@ -19123,7 +19123,7 @@ function resolveConfigPathForDeps(deps) {
|
|
|
19123
19123
|
function normalizeDeps(overrides = {}) {
|
|
19124
19124
|
return {
|
|
19125
19125
|
fs: overrides.fs ?? fs,
|
|
19126
|
-
json5: overrides.json5 ??
|
|
19126
|
+
json5: overrides.json5 ?? json5,
|
|
19127
19127
|
env: overrides.env ?? process.env,
|
|
19128
19128
|
homedir: overrides.homedir ?? (() => resolveRequiredHomeDir(overrides.env ?? process.env, os.homedir)),
|
|
19129
19129
|
configPath: overrides.configPath ?? "",
|
|
@@ -19134,11 +19134,11 @@ function maybeLoadDotEnvForConfig(env) {
|
|
|
19134
19134
|
if (env !== process.env) return;
|
|
19135
19135
|
loadDotEnv({ quiet: true });
|
|
19136
19136
|
}
|
|
19137
|
-
function parseConfigJson5(raw, json5 =
|
|
19137
|
+
function parseConfigJson5(raw, json5$1 = json5) {
|
|
19138
19138
|
try {
|
|
19139
19139
|
return {
|
|
19140
19140
|
ok: true,
|
|
19141
|
-
parsed: json5.parse(raw)
|
|
19141
|
+
parsed: json5$1.parse(raw)
|
|
19142
19142
|
};
|
|
19143
19143
|
} catch (err) {
|
|
19144
19144
|
return {
|
|
@@ -4,7 +4,7 @@ import chalk, { Chalk } from "chalk";
|
|
|
4
4
|
import fs, { constants } from "node:fs";
|
|
5
5
|
import { Logger } from "tslog";
|
|
6
6
|
import os from "node:os";
|
|
7
|
-
import
|
|
7
|
+
import json5 from "json5";
|
|
8
8
|
import util, { isDeepStrictEqual, promisify } from "node:util";
|
|
9
9
|
import fs$1 from "node:fs/promises";
|
|
10
10
|
import { execFile, execFileSync } from "node:child_process";
|
|
@@ -325,7 +325,7 @@ function readLoggingConfig() {
|
|
|
325
325
|
try {
|
|
326
326
|
if (!fs.existsSync(configPath)) return;
|
|
327
327
|
const raw = fs.readFileSync(configPath, "utf-8");
|
|
328
|
-
const logging =
|
|
328
|
+
const logging = json5.parse(raw)?.logging;
|
|
329
329
|
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
|
|
330
330
|
return logging;
|
|
331
331
|
} catch {
|
|
@@ -3028,7 +3028,7 @@ function loadPluginManifest(rootDir) {
|
|
|
3028
3028
|
}
|
|
3029
3029
|
let raw;
|
|
3030
3030
|
try {
|
|
3031
|
-
raw =
|
|
3031
|
+
raw = json5.parse(fs.readFileSync(opened.fd, "utf-8"));
|
|
3032
3032
|
} catch (err) {
|
|
3033
3033
|
return {
|
|
3034
3034
|
ok: false,
|
|
@@ -13468,7 +13468,7 @@ const defaultResolver = {
|
|
|
13468
13468
|
resolvedPath,
|
|
13469
13469
|
rootRealDir
|
|
13470
13470
|
}),
|
|
13471
|
-
parseJson: (raw) =>
|
|
13471
|
+
parseJson: (raw) => json5.parse(raw)
|
|
13472
13472
|
};
|
|
13473
13473
|
/**
|
|
13474
13474
|
* Resolves all $include directives in a parsed config object.
|
|
@@ -20081,7 +20081,7 @@ function resolveConfigPathForDeps(deps) {
|
|
|
20081
20081
|
function normalizeDeps(overrides = {}) {
|
|
20082
20082
|
return {
|
|
20083
20083
|
fs: overrides.fs ?? fs,
|
|
20084
|
-
json5: overrides.json5 ??
|
|
20084
|
+
json5: overrides.json5 ?? json5,
|
|
20085
20085
|
env: overrides.env ?? process.env,
|
|
20086
20086
|
homedir: overrides.homedir ?? (() => resolveRequiredHomeDir(overrides.env ?? process.env, os.homedir)),
|
|
20087
20087
|
configPath: overrides.configPath ?? "",
|
|
@@ -20092,11 +20092,11 @@ function maybeLoadDotEnvForConfig(env) {
|
|
|
20092
20092
|
if (env !== process.env) return;
|
|
20093
20093
|
loadDotEnv({ quiet: true });
|
|
20094
20094
|
}
|
|
20095
|
-
function parseConfigJson5(raw, json5 =
|
|
20095
|
+
function parseConfigJson5(raw, json5$1 = json5) {
|
|
20096
20096
|
try {
|
|
20097
20097
|
return {
|
|
20098
20098
|
ok: true,
|
|
20099
|
-
parsed: json5.parse(raw)
|
|
20099
|
+
parsed: json5$1.parse(raw)
|
|
20100
20100
|
};
|
|
20101
20101
|
} catch (err) {
|
|
20102
20102
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as resolveImplicitCopilotProvider, c as resolveFasedAgentDir, d as saveJsonFile, f as formatCliCommand, g as normalizeChatChannelId, h as createSubsystemLogger, i as normalizeProviders, l as resolveProcessScopedMap, m as isTruthyEnvValue, n as DiscordConfigSchema, o as resolveImplicitProviders, p as resolveDefaultAgentId, t as loadConfig, u as loadJsonFile } from "./config-
|
|
2
|
-
import { A as expandHomePrefix, D as resolveOAuthDir, a as resolveAgentIdFromSessionKey, d as normalizeE164, g as logVerbose, i as normalizeAgentId, j as resolveRequiredHomeDir, k as resolveStateDir, l as formatTerminalLink, o as DEFAULT_ACCOUNT_ID, p as resolveUserPath, s as normalizeAccountId, u as isRecord } from "./retry-
|
|
3
|
-
import { i as resolveDiscordToken, r as normalizeDiscordToken, t as normalizeDiscordSlug$1 } from "./allow-list-
|
|
1
|
+
import { a as resolveImplicitCopilotProvider, c as resolveFasedAgentDir, d as saveJsonFile, f as formatCliCommand, g as normalizeChatChannelId, h as createSubsystemLogger, i as normalizeProviders, l as resolveProcessScopedMap, m as isTruthyEnvValue, n as DiscordConfigSchema, o as resolveImplicitProviders, p as resolveDefaultAgentId, t as loadConfig, u as loadJsonFile } from "./config-HEgnpfBH.js";
|
|
2
|
+
import { A as expandHomePrefix, D as resolveOAuthDir, a as resolveAgentIdFromSessionKey, d as normalizeE164, g as logVerbose, i as normalizeAgentId, j as resolveRequiredHomeDir, k as resolveStateDir, l as formatTerminalLink, o as DEFAULT_ACCOUNT_ID, p as resolveUserPath, s as normalizeAccountId, u as isRecord } from "./retry-CxA2fayk.js";
|
|
3
|
+
import { i as resolveDiscordToken, r as normalizeDiscordToken, t as normalizeDiscordSlug$1 } from "./allow-list-DqLmAAjC.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs, { constants } from "node:fs";
|
|
@@ -1549,7 +1549,7 @@ async function loadContextCache() {
|
|
|
1549
1549
|
await ensureFasedModelsJson(cfg);
|
|
1550
1550
|
} catch {}
|
|
1551
1551
|
try {
|
|
1552
|
-
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-runtime-
|
|
1552
|
+
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-runtime-CfDDK1n5.js");
|
|
1553
1553
|
const agentDir = resolveFasedAgentDir();
|
|
1554
1554
|
const modelRegistry = discoverModels(discoverAuthStorage(agentDir), agentDir);
|
|
1555
1555
|
applyDiscoveredContextWindows({
|
|
@@ -2787,7 +2787,7 @@ async function promptDiscordAllowFrom(params) {
|
|
|
2787
2787
|
parseId,
|
|
2788
2788
|
invalidWithoutTokenNote: "Bot token missing; use numeric user ids (or mention form) only.",
|
|
2789
2789
|
resolveEntries: async ({ token, entries }) => {
|
|
2790
|
-
const { resolveDiscordUserAllowlist } = await import("./resolve-users-
|
|
2790
|
+
const { resolveDiscordUserAllowlist } = await import("./resolve-users-C0YLyf20.js");
|
|
2791
2791
|
return resolveDiscordUserAllowlist({
|
|
2792
2792
|
token,
|
|
2793
2793
|
entries
|
|
@@ -2915,7 +2915,7 @@ const discordOnboardingAdapter = {
|
|
|
2915
2915
|
resolved: false
|
|
2916
2916
|
}));
|
|
2917
2917
|
if (accountWithTokens.token && entries.length > 0) try {
|
|
2918
|
-
const { resolveDiscordChannelAllowlist } = await import("./resolve-channels-
|
|
2918
|
+
const { resolveDiscordChannelAllowlist } = await import("./resolve-channels-BptLzpDb.js");
|
|
2919
2919
|
resolved = await resolveDiscordChannelAllowlist({
|
|
2920
2920
|
token: accountWithTokens.token,
|
|
2921
2921
|
entries
|
package/dist/plugin-sdk/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as resolveToolDisplay, A as clearHistoryEntriesIfEnabled, An as DEFAULT_FEDERATION_BASE_URL, Bn as validatePushTestParams, Cn as readRequestBodyWithLimit, Cr as assertOkOrThrowHttpError, Dn as runFederationAutoConnectOnce, Dr as BLUEBUBBLES_GROUP_ACTIONS, E as DEFAULT_GROUP_HISTORY_LIMIT, En as resolveChannelMediaMaxBytes, Er as BLUEBUBBLES_ACTION_NAMES, F as recordInboundSession, G as formatInboundFromLabel, Hn as errorShape, I as removeAckReactionAfterReply, Jn as processLineMessage, Kn as resolveModel, L as shouldAckReaction, Ln as loadOrCreateDeviceIdentity, M as recordPendingHistoryEntry, Mn as resolveAgentPublicOrigin, N as recordPendingHistoryEntryIfEnabled, Nn as resolveFederationBaseUrl, O as buildPendingHistoryContextFromMap, On as startFederationAutoConnect, Or as CHANNEL_MESSAGE_ACTION_NAMES, P as formatDocsLink, Pn as resolveFederationHandle, R as shouldAckReactionForWhatsApp, Rn as publicKeyRawBase64UrlFromPem, S as detectBinary, Sn as readJsonBodyWithLimit, Sr as warnMissingProviderGroupPolicyFallbackOnce, Tr as BLUEBUBBLES_ACTIONS, Ut as optionalStringEnum, Vn as ErrorCodes, Wt as stringEnum, Xn as createReceiptCard, Yn as stripMarkdown, Zn as attachFooterText, _ as resolveDefaultLineAccountId, _n as DEFAULT_WEBHOOK_BODY_TIMEOUT_MS, _r as resolveControlCommandGate, _t as getChannelAgentToolMeta, an as getAcpSessionManager, ar as listDevicePairing, b as logInboundDrop, bn as installRequestBodyLimitGuard, br as resolveDefaultGroupPolicy, c as loadModelCatalog, cn as unregisterAcpRuntimeBackend, d as issuePairingChallenge, dr as DM_GROUP_ACCESS_REASON, er as DEFAULT_HEARTBEAT_ACK_MAX_CHARS, f as createTypingCallbacks, fr as readStoreAllowFromForDmPolicy, g as normalizeAccountId$1, h as listLineAccountIds, hr as resolveEffectiveAllowFromLists, ir as approveDevicePairing, j as evictOldHistoryKeys, jn as normalizeHandle, k as clearHistoryEntries, ln as resolveRuntimeOptionsFromMeta, lr as extractToolSend, m as resolveMentionGatingWithBypass, mr as resolveDmGroupAccessWithLists, nr as resolveHeartbeatPrompt, o as resolveStrictAgenticRuntimeMode, on as getAcpRuntimeBackend, or as rejectDevicePairing, ot as createFasedAgentCodingTools, p as resolveMentionGating, pr as resolveDmGroupAccessWithCommandGate, qn as hasMarkdownToConvert, rr as waitForAbortSignal, sn as registerAcpRuntimeBackend, sr as createDedupeCache, st as resolveEffectiveToolPolicy, t as runEmbeddedPiAgent, tr as DEFAULT_HEARTBEAT_EVERY, u as deriveModelMetadata, un as AcpRuntimeError, ur as withTempDownloadPath, v as resolveLineAccount, vn as DEFAULT_WEBHOOK_MAX_BODY_BYTES, vr as GROUP_POLICY_BLOCKED_LABEL, vt as getPluginToolMeta, wn as requestBodyErrorToText, wr as registerPluginHttpRoute, wt as peekSystemEvents, x as logTypingFailure, xn as isRequestBodyLimitError, xr as resolveOpenProviderRuntimeGroupPolicy, y as logAckFailure, yn as RequestBodyLimitError, yr as resolveAllowlistProviderRuntimeGroupPolicy, yt as buildChannelSummary, zn as formatValidationErrors } from "./pi-embedded-runner-
|
|
1
|
+
import { $t as resolveToolDisplay, A as clearHistoryEntriesIfEnabled, An as DEFAULT_FEDERATION_BASE_URL, Bn as validatePushTestParams, Cn as readRequestBodyWithLimit, Cr as assertOkOrThrowHttpError, Dn as runFederationAutoConnectOnce, Dr as BLUEBUBBLES_GROUP_ACTIONS, E as DEFAULT_GROUP_HISTORY_LIMIT, En as resolveChannelMediaMaxBytes, Er as BLUEBUBBLES_ACTION_NAMES, F as recordInboundSession, G as formatInboundFromLabel, Hn as errorShape, I as removeAckReactionAfterReply, Jn as processLineMessage, Kn as resolveModel, L as shouldAckReaction, Ln as loadOrCreateDeviceIdentity, M as recordPendingHistoryEntry, Mn as resolveAgentPublicOrigin, N as recordPendingHistoryEntryIfEnabled, Nn as resolveFederationBaseUrl, O as buildPendingHistoryContextFromMap, On as startFederationAutoConnect, Or as CHANNEL_MESSAGE_ACTION_NAMES, P as formatDocsLink, Pn as resolveFederationHandle, R as shouldAckReactionForWhatsApp, Rn as publicKeyRawBase64UrlFromPem, S as detectBinary, Sn as readJsonBodyWithLimit, Sr as warnMissingProviderGroupPolicyFallbackOnce, Tr as BLUEBUBBLES_ACTIONS, Ut as optionalStringEnum, Vn as ErrorCodes, Wt as stringEnum, Xn as createReceiptCard, Yn as stripMarkdown, Zn as attachFooterText, _ as resolveDefaultLineAccountId, _n as DEFAULT_WEBHOOK_BODY_TIMEOUT_MS, _r as resolveControlCommandGate, _t as getChannelAgentToolMeta, an as getAcpSessionManager, ar as listDevicePairing, b as logInboundDrop, bn as installRequestBodyLimitGuard, br as resolveDefaultGroupPolicy, c as loadModelCatalog, cn as unregisterAcpRuntimeBackend, d as issuePairingChallenge, dr as DM_GROUP_ACCESS_REASON, er as DEFAULT_HEARTBEAT_ACK_MAX_CHARS, f as createTypingCallbacks, fr as readStoreAllowFromForDmPolicy, g as normalizeAccountId$1, h as listLineAccountIds, hr as resolveEffectiveAllowFromLists, ir as approveDevicePairing, j as evictOldHistoryKeys, jn as normalizeHandle, k as clearHistoryEntries, ln as resolveRuntimeOptionsFromMeta, lr as extractToolSend, m as resolveMentionGatingWithBypass, mr as resolveDmGroupAccessWithLists, nr as resolveHeartbeatPrompt, o as resolveStrictAgenticRuntimeMode, on as getAcpRuntimeBackend, or as rejectDevicePairing, ot as createFasedAgentCodingTools, p as resolveMentionGating, pr as resolveDmGroupAccessWithCommandGate, qn as hasMarkdownToConvert, rr as waitForAbortSignal, sn as registerAcpRuntimeBackend, sr as createDedupeCache, st as resolveEffectiveToolPolicy, t as runEmbeddedPiAgent, tr as DEFAULT_HEARTBEAT_EVERY, u as deriveModelMetadata, un as AcpRuntimeError, ur as withTempDownloadPath, v as resolveLineAccount, vn as DEFAULT_WEBHOOK_MAX_BODY_BYTES, vr as GROUP_POLICY_BLOCKED_LABEL, vt as getPluginToolMeta, wn as requestBodyErrorToText, wr as registerPluginHttpRoute, wt as peekSystemEvents, x as logTypingFailure, xn as isRequestBodyLimitError, xr as resolveOpenProviderRuntimeGroupPolicy, y as logAckFailure, yn as RequestBodyLimitError, yr as resolveAllowlistProviderRuntimeGroupPolicy, yt as buildChannelSummary, zn as formatValidationErrors } from "./pi-embedded-runner-Cl-dGLKY.js";
|
|
2
2
|
import { Ct as resolveIMessageGroupToolPolicy, Ft as listIMessageAccountIds, It as resolveDefaultIMessageAccountId, Lt as resolveIMessageAccount, Mt as listSignalAccountIds, Nt as resolveDefaultSignalAccountId, Pt as resolveSignalAccount, St as resolveIMessageGroupRequireMention, Vt as resolveToolsBySender, _t as normalizeSignalMessagingTarget, an as logMutatingAdminRpcAudit, at as resolveMainSessionKey, bt as resolveGoogleChatGroupRequireMention, c as listAgentsForGateway, ct as listChannelPlugins, et as resolveFreshSessionTotalTokens, f as resolveContextTokensForModel, ft as looksLikeHandleOrPhoneTarget, gt as looksLikeSignalTargetId, ln as authorizeOperatorScopesForMethod, mn as listPluginCommands, on as consumeMutatingAdminRpcBudget, pn as getPluginCommandSpecs, pt as trimMessagingTarget, s as classifySessionKey, t as getActivePluginRegistry, tn as getChatChannelMeta, u as resolveSessionModelRef, vn as normalizePluginHttpPath, vt as resolveBlueBubblesGroupRequireMention, x as loadSessionStore, xt as resolveGoogleChatGroupToolPolicy, yt as resolveBlueBubblesGroupToolPolicy } from "./runtime-BPyuAmka.js";
|
|
3
3
|
import { n as stripAnsi, t as createSubsystemLogger } from "./subsystem-DBPNbQDQ.js";
|
|
4
4
|
import { g as registerLogTransport, w as resolvePreferredFasedAgentTmpDir } from "./globals-B_jjtAje.js";
|
|
@@ -54,11 +54,12 @@ import "./tables-CJE8kB35.js";
|
|
|
54
54
|
import { t as buildMediaPayload } from "./media-payload-CcW51vQj.js";
|
|
55
55
|
import path from "node:path";
|
|
56
56
|
import chalk from "chalk";
|
|
57
|
-
import fs, { createWriteStream } from "node:fs";
|
|
57
|
+
import fs, { createWriteStream, existsSync } from "node:fs";
|
|
58
58
|
import os from "node:os";
|
|
59
59
|
import JSON5 from "json5";
|
|
60
60
|
import { format } from "node:util";
|
|
61
61
|
import fs$1 from "node:fs/promises";
|
|
62
|
+
import { spawn } from "node:child_process";
|
|
62
63
|
import { createHash, createPrivateKey, randomUUID, sign } from "node:crypto";
|
|
63
64
|
import { pipeline } from "node:stream/promises";
|
|
64
65
|
import { z } from "zod";
|
|
@@ -2258,6 +2259,15 @@ function resolveBrewExecutable(opts) {
|
|
|
2258
2259
|
//#region src/agents/skills/bundled-context.ts
|
|
2259
2260
|
const skillsLogger = createSubsystemLogger("skills");
|
|
2260
2261
|
|
|
2262
|
+
//#endregion
|
|
2263
|
+
//#region src/daemon/systemd-system.ts
|
|
2264
|
+
const SERVICE_NAME = "fased-gateway";
|
|
2265
|
+
const SYSTEM_UNIT_CANDIDATES = [
|
|
2266
|
+
`/etc/systemd/system/${SERVICE_NAME}.service`,
|
|
2267
|
+
`/usr/lib/systemd/system/${SERVICE_NAME}.service`,
|
|
2268
|
+
`/lib/systemd/system/${SERVICE_NAME}.service`
|
|
2269
|
+
];
|
|
2270
|
+
|
|
2261
2271
|
//#endregion
|
|
2262
2272
|
//#region src/commands/status.acpx-bridge.ts
|
|
2263
2273
|
const ACPX_PUSH_TEST_TOOL_NAME = "fased_push_test_request";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as info, E as resolveUserPath, M as getChildLogger, N as toPinoLikeLogger, O as defaultRuntime, b as ensureDir, d as redactSensitiveText, f as formatCliCommand, j as success, k as danger, m as logInfo, t as loadConfig, u as VERSION } from "./config-
|
|
2
|
-
import { a as logoutWeb, c as resolveDefaultWebAuthDir, l as resolveWebCredsBackupPath, o as maybeRestoreCredsFromBackup, r as resolveWhatsAppAccount, s as readCredsJsonRaw, u as resolveWebCredsPath } from "./accounts-
|
|
1
|
+
import { A as info, E as resolveUserPath, M as getChildLogger, N as toPinoLikeLogger, O as defaultRuntime, b as ensureDir, d as redactSensitiveText, f as formatCliCommand, j as success, k as danger, m as logInfo, t as loadConfig, u as VERSION } from "./config-g1MG9Bet.js";
|
|
2
|
+
import { a as logoutWeb, c as resolveDefaultWebAuthDir, l as resolveWebCredsBackupPath, o as maybeRestoreCredsFromBackup, r as resolveWhatsAppAccount, s as readCredsJsonRaw, u as resolveWebCredsPath } from "./accounts-C5BjfxoO.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { DisconnectReason, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "@whiskeysockets/baileys";
|
|
5
5
|
import qrcode from "qrcode-terminal";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as clearHistoryEntriesIfEnabled, B as dispatchReplyWithDispatcher, C as buildPairingReply, Ct as enqueueSystemEvent, Dt as createMediaAttachmentCache, Et as buildProviderRegistry, F as recordInboundSession, Fn as buildGatewayConnectionDetails, Gn as parseTtsDirectives, Gt as hasControlCommand, H as createInboundDebouncer, In as GatewayClient, J as createReplyDispatcherWithTyping, Jt as buildMentionRegexes, K as resolveEnvelopeFormatOptions, L as shouldAckReaction, N as recordPendingHistoryEntryIfEnabled, O as buildPendingHistoryContextFromMap, Ot as normalizeMediaAttachments, Q as buildModelsProviderData, Sr as warnMissingProviderGroupPolicyFallbackOnce, St as formatDurationSeconds, U as resolveInboundDebounceMs, Un as resolveTtsConfig, W as formatInboundEnvelope, Wn as textToSpeech, Y as EmbeddedBlockChunker, Yt as matchesMentionWithExplicit, Z as resolveStoredModelOverride, _r as resolveControlCommandGate, a as agentCommand, b as logInboundDrop, br as resolveDefaultGroupPolicy, en as stripReasoningTagsFromText, f as createTypingCallbacks, fr as readStoreAllowFromForDmPolicy, gr as resolveCommandAuthorizedFromAuthorizers, jt as runCapability, kn as resolveAgentAvatar, m as resolveMentionGatingWithBypass, mr as resolveDmGroupAccessWithLists, q as dispatchInboundMessage, vr as GROUP_POLICY_BLOCKED_LABEL, x as logTypingFailure, xr as resolveOpenProviderRuntimeGroupPolicy, y as logAckFailure, z as dispatchReplyWithBufferedBlockDispatcher } from "./pi-embedded-runner-
|
|
1
|
+
import { A as clearHistoryEntriesIfEnabled, B as dispatchReplyWithDispatcher, C as buildPairingReply, Ct as enqueueSystemEvent, Dt as createMediaAttachmentCache, Et as buildProviderRegistry, F as recordInboundSession, Fn as buildGatewayConnectionDetails, Gn as parseTtsDirectives, Gt as hasControlCommand, H as createInboundDebouncer, In as GatewayClient, J as createReplyDispatcherWithTyping, Jt as buildMentionRegexes, K as resolveEnvelopeFormatOptions, L as shouldAckReaction, N as recordPendingHistoryEntryIfEnabled, O as buildPendingHistoryContextFromMap, Ot as normalizeMediaAttachments, Q as buildModelsProviderData, Sr as warnMissingProviderGroupPolicyFallbackOnce, St as formatDurationSeconds, U as resolveInboundDebounceMs, Un as resolveTtsConfig, W as formatInboundEnvelope, Wn as textToSpeech, Y as EmbeddedBlockChunker, Yt as matchesMentionWithExplicit, Z as resolveStoredModelOverride, _r as resolveControlCommandGate, a as agentCommand, b as logInboundDrop, br as resolveDefaultGroupPolicy, en as stripReasoningTagsFromText, f as createTypingCallbacks, fr as readStoreAllowFromForDmPolicy, gr as resolveCommandAuthorizedFromAuthorizers, jt as runCapability, kn as resolveAgentAvatar, m as resolveMentionGatingWithBypass, mr as resolveDmGroupAccessWithLists, q as dispatchInboundMessage, vr as GROUP_POLICY_BLOCKED_LABEL, x as logTypingFailure, xr as resolveOpenProviderRuntimeGroupPolicy, y as logAckFailure, z as dispatchReplyWithBufferedBlockDispatcher } from "./pi-embedded-runner-Cl-dGLKY.js";
|
|
2
2
|
import { $t as GATEWAY_CLIENT_MODES, S as readSessionUpdatedAt, Yt as normalizeMessageChannel, en as GATEWAY_CLIENT_NAMES, ut as getChannelDock, x as loadSessionStore } from "./runtime-BPyuAmka.js";
|
|
3
3
|
import { r as createNonExitingRuntime, t as createSubsystemLogger } from "./subsystem-DBPNbQDQ.js";
|
|
4
4
|
import { i as logVerbose, l as warn, p as getChildLogger, s as shouldLogVerbose, t as danger, w as resolvePreferredFasedAgentTmpDir } from "./globals-B_jjtAje.js";
|
|
@@ -59,7 +59,7 @@ import { C as editMessageDiscord, Q as stripUndefinedFields, a as removeReaction
|
|
|
59
59
|
import { i as createThreadBindingManager, r as createNoopThreadBindingManager, t as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings.lifecycle-gmHv3hc7.js";
|
|
60
60
|
import { t as createReplyReferencePlanner } from "./reply-reference-DxIu2vr0.js";
|
|
61
61
|
import { i as createStatusReactionController, r as DEFAULT_TIMING, t as createFinalizableDraftLifecycle } from "./draft-stream-controls-v_5gdUYG.js";
|
|
62
|
-
import { n as buildUntrustedChannelMetadata, t as chunkItems } from "./chunk-items-
|
|
62
|
+
import { n as buildUntrustedChannelMetadata, t as chunkItems } from "./chunk-items-B1CvDQbk.js";
|
|
63
63
|
import { t as fetchDiscordApplicationId } from "./probe-Dqx0N4uk.js";
|
|
64
64
|
import { t as DiscordUiContainer } from "./ui-7sxJ-x37.js";
|
|
65
65
|
import "./guilds-DmzO7n0X.js";
|
|
@@ -1390,7 +1390,7 @@ async function preflightDiscordMessage(params) {
|
|
|
1390
1390
|
let preflightTranscript;
|
|
1391
1391
|
const hasAudioAttachment = message.attachments?.some((att) => att.contentType?.startsWith("audio/"));
|
|
1392
1392
|
if (!isDirectMessage && shouldRequireMention && hasAudioAttachment && !baseText && mentionRegexes.length > 0) try {
|
|
1393
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
1393
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-CSRhaknd.js");
|
|
1394
1394
|
const audioPaths = message.attachments?.filter((att) => att.contentType?.startsWith("audio/")).map((att) => att.url) ?? [];
|
|
1395
1395
|
if (audioPaths.length > 0) preflightTranscript = await transcribeFirstAudio({
|
|
1396
1396
|
ctx: {
|
|
@@ -15,8 +15,8 @@ import "./accounts-BwkH5bTD.js";
|
|
|
15
15
|
import "./tokens-BK5rrwBB.js";
|
|
16
16
|
import "./allow-list-CBtbuDI8.js";
|
|
17
17
|
import { l as resolveStorePath } from "./paths-DTurNPnO.js";
|
|
18
|
-
import { $ as buildModelsProviderData, B as dispatchReplyWithBufferedBlockDispatcher, C as computeBackoff, D as resolveOpenProviderRuntimeGroupPolicy, Dt as buildMentionRegexes, Et as isAbortRequestText, F as resolveCommandAuthorizedFromAuthorizers, G as formatInboundEnvelope, Gt as stripReasoningTagsFromText, I as resolveControlCommandGate, Jt as formatDurationPrecise, K as resolveEnvelopeFormatOptions, Kt as findCodeRegions, L as removeAckReactionAfterReply, M as clearHistoryEntriesIfEnabled, N as recordPendingHistoryEntryIfEnabled, Ot as matchesMentionWithExplicit, P as recordInboundSession, Q as resolveStoredModelOverride, R as shouldAckReaction, S as buildPairingReply, U as createInboundDebouncer, W as resolveInboundDebounceMs, Wt as formatReasoningMessage, Xt as enqueueSystemEvent, Y as createDedupeCache, at as parseModelCallbackData, b as logInboundDrop, c as findModelInCatalog, et as formatModelsAvailableHeader, f as createTypingCallbacks, h as waitForAbortSignal, it as getModelsPageSize, j as buildPendingHistoryContextFromMap, jt as registerUnhandledRejectionHandler, k as DEFAULT_GROUP_HISTORY_LIMIT, l as loadModelCatalog, ln as readJsonBodyWithLimit, m as resolveMentionGatingWithBypass, n as buildCommandsMessagePaginated, nt as buildProviderKeyboard, ot as buildCommandsPaginationKeyboard, qt as isInsideCode, rt as calculateTotalPages, st as resolveChannelConfigWrites, tn as resolveTelegramInlineButtonsScope, tt as buildModelsKeyboard, u as modelSupportsVision, w as sleepWithAbort, wt as hasControlCommand, x as logTypingFailure, y as logAckFailure } from "./status-
|
|
19
|
-
import "./runtime-dependency-
|
|
18
|
+
import { $ as buildModelsProviderData, B as dispatchReplyWithBufferedBlockDispatcher, C as computeBackoff, D as resolveOpenProviderRuntimeGroupPolicy, Dt as buildMentionRegexes, Et as isAbortRequestText, F as resolveCommandAuthorizedFromAuthorizers, G as formatInboundEnvelope, Gt as stripReasoningTagsFromText, I as resolveControlCommandGate, Jt as formatDurationPrecise, K as resolveEnvelopeFormatOptions, Kt as findCodeRegions, L as removeAckReactionAfterReply, M as clearHistoryEntriesIfEnabled, N as recordPendingHistoryEntryIfEnabled, Ot as matchesMentionWithExplicit, P as recordInboundSession, Q as resolveStoredModelOverride, R as shouldAckReaction, S as buildPairingReply, U as createInboundDebouncer, W as resolveInboundDebounceMs, Wt as formatReasoningMessage, Xt as enqueueSystemEvent, Y as createDedupeCache, at as parseModelCallbackData, b as logInboundDrop, c as findModelInCatalog, et as formatModelsAvailableHeader, f as createTypingCallbacks, h as waitForAbortSignal, it as getModelsPageSize, j as buildPendingHistoryContextFromMap, jt as registerUnhandledRejectionHandler, k as DEFAULT_GROUP_HISTORY_LIMIT, l as loadModelCatalog, ln as readJsonBodyWithLimit, m as resolveMentionGatingWithBypass, n as buildCommandsMessagePaginated, nt as buildProviderKeyboard, ot as buildCommandsPaginationKeyboard, qt as isInsideCode, rt as calculateTotalPages, st as resolveChannelConfigWrites, tn as resolveTelegramInlineButtonsScope, tt as buildModelsKeyboard, u as modelSupportsVision, w as sleepWithAbort, wt as hasControlCommand, x as logTypingFailure, y as logAckFailure } from "./status-DKwtdFcx.js";
|
|
19
|
+
import "./runtime-dependency-B-1u41Ph.js";
|
|
20
20
|
import "./ssrf-Cce6LubA.js";
|
|
21
21
|
import { n as listSkillCommandsForAgents } from "./skill-commands-hyZA0LE3.js";
|
|
22
22
|
import "./pi-model-discovery-DadlvsZW.js";
|
|
@@ -51,7 +51,7 @@ import { n as recordChannelActivity } from "./channel-activity-Cf5sKkfd.js";
|
|
|
51
51
|
import { _ as splitTelegramCaption, d as isRecoverableTelegramNetworkError, f as markdownToTelegramChunks, g as resolveTelegramFetch, h as wrapFileReferencesInHtml, i as editMessageTelegram, l as resolveTelegramVoiceSend, m as renderTelegramHtmlText, p as markdownToTelegramHtml, t as buildInlineKeyboard, u as wasSentByBot, v as withTelegramApiErrorLogging } from "./send-B09HRfHN.js";
|
|
52
52
|
import "./retry-policy-BLYEgIwP.js";
|
|
53
53
|
import { t as makeProxyFetch } from "./proxy-CV9uL4Wi.js";
|
|
54
|
-
import { i as getCachedSticker, n as describeStickerImage, t as cacheSticker } from "./sticker-cache-
|
|
54
|
+
import { i as getCachedSticker, n as describeStickerImage, t as cacheSticker } from "./sticker-cache-Dmrdawoj.js";
|
|
55
55
|
import { i as createStatusReactionController, n as DEFAULT_EMOJIS, t as createFinalizableDraftLifecycle } from "./draft-stream-controls-Bfbhumzv.js";
|
|
56
56
|
import crypto from "node:crypto";
|
|
57
57
|
import os from "node:os";
|
|
@@ -2035,7 +2035,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, replyMedia =
|
|
|
2035
2035
|
const hasAudio = allMedia.some((media) => media.contentType?.startsWith("audio/"));
|
|
2036
2036
|
let preflightTranscript;
|
|
2037
2037
|
if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0) try {
|
|
2038
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
2038
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-DlkuhmkH.js");
|
|
2039
2039
|
preflightTranscript = await transcribeFirstAudio({
|
|
2040
2040
|
ctx: {
|
|
2041
2041
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as formatModelsAvailableHeader, $n as resolveTelegramInlineButtonsScope, A as clearHistoryEntriesIfEnabled, C as buildPairingReply, Ct as enqueueSystemEvent, E as DEFAULT_GROUP_HISTORY_LIMIT, F as recordInboundSession, Gt as hasControlCommand, H as createInboundDebouncer, I as removeAckReactionAfterReply, Jt as buildMentionRegexes, K as resolveEnvelopeFormatOptions, L as shouldAckReaction, N as recordPendingHistoryEntryIfEnabled, Nt as registerUnhandledRejectionHandler, O as buildPendingHistoryContextFromMap, Q as buildModelsProviderData, Qt as formatReasoningMessage, Sn as readJsonBodyWithLimit, T as sleepWithAbort, Tt as resolveChannelConfigWrites, U as resolveInboundDebounceMs, W as formatInboundEnvelope, Yt as matchesMentionWithExplicit, Z as resolveStoredModelOverride, _r as resolveControlCommandGate, at as buildCommandsPaginationKeyboard, b as logInboundDrop, bt as buildCommandsMessagePaginated, c as loadModelCatalog, en as stripReasoningTagsFromText, et as buildModelsKeyboard, f as createTypingCallbacks, gr as resolveCommandAuthorizedFromAuthorizers, it as parseModelCallbackData, l as modelSupportsVision, m as resolveMentionGatingWithBypass, nn as isInsideCode, nt as calculateTotalPages, qt as isAbortRequestText, rr as waitForAbortSignal, rt as getModelsPageSize, s as findModelInCatalog, sr as createDedupeCache, tn as findCodeRegions, tt as buildProviderKeyboard, w as computeBackoff, x as logTypingFailure, xr as resolveOpenProviderRuntimeGroupPolicy, xt as formatDurationPrecise, y as logAckFailure, z as dispatchReplyWithBufferedBlockDispatcher } from "./pi-embedded-runner-
|
|
1
|
+
import { $ as formatModelsAvailableHeader, $n as resolveTelegramInlineButtonsScope, A as clearHistoryEntriesIfEnabled, C as buildPairingReply, Ct as enqueueSystemEvent, E as DEFAULT_GROUP_HISTORY_LIMIT, F as recordInboundSession, Gt as hasControlCommand, H as createInboundDebouncer, I as removeAckReactionAfterReply, Jt as buildMentionRegexes, K as resolveEnvelopeFormatOptions, L as shouldAckReaction, N as recordPendingHistoryEntryIfEnabled, Nt as registerUnhandledRejectionHandler, O as buildPendingHistoryContextFromMap, Q as buildModelsProviderData, Qt as formatReasoningMessage, Sn as readJsonBodyWithLimit, T as sleepWithAbort, Tt as resolveChannelConfigWrites, U as resolveInboundDebounceMs, W as formatInboundEnvelope, Yt as matchesMentionWithExplicit, Z as resolveStoredModelOverride, _r as resolveControlCommandGate, at as buildCommandsPaginationKeyboard, b as logInboundDrop, bt as buildCommandsMessagePaginated, c as loadModelCatalog, en as stripReasoningTagsFromText, et as buildModelsKeyboard, f as createTypingCallbacks, gr as resolveCommandAuthorizedFromAuthorizers, it as parseModelCallbackData, l as modelSupportsVision, m as resolveMentionGatingWithBypass, nn as isInsideCode, nt as calculateTotalPages, qt as isAbortRequestText, rr as waitForAbortSignal, rt as getModelsPageSize, s as findModelInCatalog, sr as createDedupeCache, tn as findCodeRegions, tt as buildProviderKeyboard, w as computeBackoff, x as logTypingFailure, xr as resolveOpenProviderRuntimeGroupPolicy, xt as formatDurationPrecise, y as logAckFailure, z as dispatchReplyWithBufferedBlockDispatcher } from "./pi-embedded-runner-Cl-dGLKY.js";
|
|
2
2
|
import { C as recordSessionMetaFromInbound, Dt as resolveTelegramAccount, Rt as resolveChannelGroupPolicy, S as readSessionUpdatedAt, fn as executePluginCommand, hn as matchPluginCommand, pn as getPluginCommandSpecs, x as loadSessionStore, zt as resolveChannelGroupRequireMention } from "./runtime-BPyuAmka.js";
|
|
3
3
|
import { i as defaultRuntime, r as createNonExitingRuntime, t as createSubsystemLogger } from "./subsystem-DBPNbQDQ.js";
|
|
4
4
|
import { i as logVerbose, l as warn, p as getChildLogger, s as shouldLogVerbose, t as danger } from "./globals-B_jjtAje.js";
|
|
@@ -51,7 +51,7 @@ import { n as recordChannelActivity } from "./channel-activity-Cf5sKkfd.js";
|
|
|
51
51
|
import { _ as splitTelegramCaption, d as isRecoverableTelegramNetworkError, f as markdownToTelegramChunks, g as resolveTelegramFetch, h as wrapFileReferencesInHtml, i as editMessageTelegram, l as resolveTelegramVoiceSend, m as renderTelegramHtmlText, p as markdownToTelegramHtml, t as buildInlineKeyboard, u as wasSentByBot, v as withTelegramApiErrorLogging } from "./send-BzFdvD_i.js";
|
|
52
52
|
import "./retry-policy-sM01QZT2.js";
|
|
53
53
|
import { t as makeProxyFetch } from "./proxy-CKQOQYAl.js";
|
|
54
|
-
import { i as getCachedSticker, n as describeStickerImage, t as cacheSticker } from "./sticker-cache-
|
|
54
|
+
import { i as getCachedSticker, n as describeStickerImage, t as cacheSticker } from "./sticker-cache-C6yLVx3S.js";
|
|
55
55
|
import { i as createStatusReactionController, n as DEFAULT_EMOJIS, t as createFinalizableDraftLifecycle } from "./draft-stream-controls-v_5gdUYG.js";
|
|
56
56
|
import path from "node:path";
|
|
57
57
|
import os from "node:os";
|
|
@@ -2035,7 +2035,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, replyMedia =
|
|
|
2035
2035
|
const hasAudio = allMedia.some((media) => media.contentType?.startsWith("audio/"));
|
|
2036
2036
|
let preflightTranscript;
|
|
2037
2037
|
if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0) try {
|
|
2038
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
2038
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-CSRhaknd.js");
|
|
2039
2039
|
preflightTranscript = await transcribeFirstAudio({
|
|
2040
2040
|
ctx: {
|
|
2041
2041
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|