@moxxy/cli 0.42.1 → 0.43.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/bin.js +386 -286
- package/dist/skills/browser.md +38 -3
- package/dist/skills/self-heal.md +24 -21
- package/package.json +2 -2
package/dist/bin.js
CHANGED
|
@@ -8,9 +8,7 @@ import path3__default, { join, dirname, resolve, relative, isAbsolute, posix, se
|
|
|
8
8
|
import { utf8Locale, ensurePrivateDir, moxxyHome, pruneStaleTempFiles, moxxyPath, hasProxy, installEgressProxy, readProxyEnv, writeFileAtomic, ensurePrivateFile, resolveChannelToken, rotateChannelToken, liveChannelStatus, spawnDedicatedChannel, stopDedicatedChannel, clearChannelStatus, MOXXY_WS_SUBPROTOCOL, bearerTokenMatches, PRIVATE_FILE_MODE, findExecutable, bearerGuard, tokenFromWsProtocolHeader, resolveExecutableTarget, spawnExecutableTarget, resolveOsPrincipal, redactProxyUrl, listLiveChannelStatuses, writeSignedNetworkCacheAtomic, CrossProcessFireLock, writeChannelStatus, writeBoundedNetworkCacheAtomicSync, writeBoundedDataCacheAtomic, readRequestBody } from '@moxxy/sdk/server';
|
|
9
9
|
import { spawn, execFile, spawnSync } from 'child_process';
|
|
10
10
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
11
|
-
import { MoxxyError, createMutex, defineMode, definePlugin, defineChannel, defineViewRenderer, DEFAULT_VIEW_TAGS, defineTunnelProvider, defineAuditExporter, defineAuditSink, z as z$1, withAgentConduct, defineTool, defineCommand, defineEmbedder, asPluginId, computerControlSnapshotSchema, runReactLoop, createDeferredPermissionResolver, isSafeViewUrl, redactSecrets, asTurnId, waitFor, unfinishedWorkCheckpoint, defineCompactor, abortError, activeCompactionRanges, defineCacheStrategy, denyByDefaultResolver, runManualCompaction, assertDefined, defineWorkflowExecutor, MOXXY_PCM16_24KHZ_MIME, isFileDiffDisplay, summarizeWithProvider, toolResultBytes, wakeAfter, isSelectableMode, summarizeSessionTokensFromEvents, summarizeTokensByModel, getInstallHint, toDiffRows, diffGutterNo, fileDiffVerb, fileDiffSummary, computerControlCommandSchema, computeElisionState, toolResultStubbed, toolResultStubText, conversationalStubbed, conversationalStub, isFirstPartyPackage, REDACTED_PLACEHOLDER, isSecretKey, addModelTotals, skillFrontmatterSchema, asSkillId, parseFrontmatter, createCallbackResolver, createAllowListResolver, countNodes, autoAllowResolver, SESSION_SOURCES, startChannelWith, EXIT_AFTER_PAIR_FLAG, renderFrontmatter, formatPrincipal, aggregateCapabilitySpecs, hostCredentialName, mentionedSkills, skillAttachment, withoutTools, toolsForMode, moxxyPackageSchema, auditActionOf, asToolCallId, dispatchToolCall, matchLoadableTools, verifyEd25519, defineSecretProvider, encodeLoginAuthUrl, redactSecretText, encodeLoginPrompt, ISOLATION_RANK, sleepWithAbort, asSessionId, migrateModeName, autoApproveFromEvents, AUTO_APPROVE_SUBTYPE, AUTO_APPROVE_PLUGIN_ID, parseFrontmatterFile, createJsonFileStore, autoApproveSwitch, computerApprovalFocusSchema, workflowApprovalItemsSchema, evaluateToolRule, asEventId } from '@moxxy/sdk';
|
|
12
|
-
import * as os from 'os';
|
|
13
|
-
import os__default, { homedir, tmpdir, userInfo } from 'os';
|
|
11
|
+
import { MoxxyError, createMutex, defineMode, definePlugin, defineChannel, defineViewRenderer, DEFAULT_VIEW_TAGS, defineTunnelProvider, defineAuditExporter, defineAuditSink, z as z$1, withAgentConduct, defineTool, defineCommand, defineEmbedder, asPluginId, computerControlSnapshotSchema, runReactLoop, createDeferredPermissionResolver, isSafeViewUrl, redactSecrets, asTurnId, waitFor, unfinishedWorkCheckpoint, unfinishedStepCheckpoint, defineCompactor, abortError, activeCompactionRanges, defineCacheStrategy, denyByDefaultResolver, runManualCompaction, assertDefined, defineWorkflowExecutor, MOXXY_PCM16_24KHZ_MIME, isFileDiffDisplay, summarizeWithProvider, toolResultBytes, wakeAfter, isSelectableMode, summarizeSessionTokensFromEvents, summarizeTokensByModel, getInstallHint, toDiffRows, diffGutterNo, fileDiffVerb, fileDiffSummary, computerControlCommandSchema, computeElisionState, toolResultStubbed, toolResultStubText, conversationalStubbed, conversationalStub, isFirstPartyPackage, REDACTED_PLACEHOLDER, isSecretKey, addModelTotals, skillFrontmatterSchema, asSkillId, parseFrontmatter, createCallbackResolver, createAllowListResolver, countNodes, autoAllowResolver, SESSION_SOURCES, startChannelWith, EXIT_AFTER_PAIR_FLAG, renderFrontmatter, formatPrincipal, aggregateCapabilitySpecs, hostCredentialName, mentionedSkills, skillAttachment, withoutTools, toolsForMode, moxxyPackageSchema, auditActionOf, asToolCallId, dispatchToolCall, matchLoadableTools, verifyEd25519, defineSecretProvider, encodeLoginAuthUrl, redactSecretText, encodeLoginPrompt, ISOLATION_RANK, sleepWithAbort, asSessionId, migrateModeName, autoApproveFromEvents, AUTO_APPROVE_SUBTYPE, AUTO_APPROVE_PLUGIN_ID, parseFrontmatterFile, createJsonFileStore, autoApproveSwitch, computerApprovalFocusSchema, workflowApprovalItemsSchema, evaluateToolRule, asEventId } from '@moxxy/sdk';
|
|
14
12
|
import { createRequire as createRequire$1 } from 'module';
|
|
15
13
|
import { z } from 'zod';
|
|
16
14
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
@@ -23,6 +21,8 @@ import net2, { createConnection, connect } from 'net';
|
|
|
23
21
|
import { Worker } from 'worker_threads';
|
|
24
22
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
25
23
|
import { StringDecoder } from 'string_decoder';
|
|
24
|
+
import * as os from 'os';
|
|
25
|
+
import os__default, { homedir, tmpdir, userInfo } from 'os';
|
|
26
26
|
import process$1, { env, cwd, stdout, stdin } from 'process';
|
|
27
27
|
import { Stream, PassThrough } from 'stream';
|
|
28
28
|
import tty, { ReadStream } from 'tty';
|
|
@@ -92,17 +92,17 @@ function diffSnapshot(before, after) {
|
|
|
92
92
|
function snapshotFilter(root) {
|
|
93
93
|
return (src) => src === root || !SNAPSHOT_EXCLUDE.has(path3.basename(src));
|
|
94
94
|
}
|
|
95
|
-
function selfUpdateRoot(
|
|
96
|
-
return path3.join(
|
|
95
|
+
function selfUpdateRoot(moxxyDir) {
|
|
96
|
+
return path3.join(moxxyDir, "self-update", "txns");
|
|
97
97
|
}
|
|
98
|
-
function txnDir(
|
|
99
|
-
return path3.join(selfUpdateRoot(
|
|
98
|
+
function txnDir(moxxyDir, txnId) {
|
|
99
|
+
return path3.join(selfUpdateRoot(moxxyDir), txnId);
|
|
100
100
|
}
|
|
101
|
-
function resolveTarget(
|
|
101
|
+
function resolveTarget(moxxyDir, kind, name) {
|
|
102
102
|
if (!NAME_SEGMENT_RE.test(name)) {
|
|
103
103
|
throw new Error(`invalid ${kind} name "${name}": only letters, digits, dot, dash and underscore are allowed`);
|
|
104
104
|
}
|
|
105
|
-
const p3 = kind === "plugin" ? path3.join(
|
|
105
|
+
const p3 = kind === "plugin" ? path3.join(moxxyDir, "plugins", name) : path3.join(moxxyDir, "skills", `${name}.md`);
|
|
106
106
|
return { kind, name, path: p3 };
|
|
107
107
|
}
|
|
108
108
|
function newTxnId(now = /* @__PURE__ */ new Date()) {
|
|
@@ -141,18 +141,18 @@ async function beginTransaction(opts) {
|
|
|
141
141
|
await writeJournal(opts.moxxyDir, journal);
|
|
142
142
|
return journal;
|
|
143
143
|
}
|
|
144
|
-
async function writeJournal(
|
|
144
|
+
async function writeJournal(moxxyDir, journal) {
|
|
145
145
|
journal.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
146
|
-
const file = path3.join(txnDir(
|
|
146
|
+
const file = path3.join(txnDir(moxxyDir, journal.txnId), "journal.json");
|
|
147
147
|
await writeFileAtomic(file, JSON.stringify(journal, null, 2) + "\n");
|
|
148
148
|
}
|
|
149
|
-
async function readJournal(
|
|
150
|
-
const file = path3.join(txnDir(
|
|
149
|
+
async function readJournal(moxxyDir, txnId) {
|
|
150
|
+
const file = path3.join(txnDir(moxxyDir, txnId), "journal.json");
|
|
151
151
|
const raw = await promises.readFile(file, "utf8");
|
|
152
152
|
return JSON.parse(raw);
|
|
153
153
|
}
|
|
154
|
-
async function listTransactions(
|
|
155
|
-
const root = selfUpdateRoot(
|
|
154
|
+
async function listTransactions(moxxyDir) {
|
|
155
|
+
const root = selfUpdateRoot(moxxyDir);
|
|
156
156
|
let ids;
|
|
157
157
|
try {
|
|
158
158
|
ids = (await promises.readdir(root, { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
@@ -162,7 +162,7 @@ async function listTransactions(moxxyDir2) {
|
|
|
162
162
|
const out = [];
|
|
163
163
|
for (const id of ids) {
|
|
164
164
|
try {
|
|
165
|
-
out.push(await readJournal(
|
|
165
|
+
out.push(await readJournal(moxxyDir, id));
|
|
166
166
|
} catch {
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -174,13 +174,13 @@ function recordAttempt(journal, attempt) {
|
|
|
174
174
|
function failedAttemptCount(journal) {
|
|
175
175
|
return journal.attempts.filter((a2) => !a2.ok).length;
|
|
176
176
|
}
|
|
177
|
-
async function restoreSnapshot(
|
|
177
|
+
async function restoreSnapshot(moxxyDir, journal) {
|
|
178
178
|
const { target, existedBefore } = journal;
|
|
179
179
|
if (!existedBefore) {
|
|
180
180
|
await promises.rm(target.path, { recursive: true, force: true });
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
const before = path3.join(txnDir(
|
|
183
|
+
const before = path3.join(txnDir(moxxyDir, journal.txnId), "before");
|
|
184
184
|
if (target.kind !== "plugin") {
|
|
185
185
|
await promises.rm(target.path, { recursive: true, force: true });
|
|
186
186
|
await promises.cp(before, target.path, { recursive: true, filter: snapshotFilter(before) });
|
|
@@ -199,11 +199,11 @@ async function restoreSnapshot(moxxyDir2, journal) {
|
|
|
199
199
|
await promises.mkdir(target.path, { recursive: true });
|
|
200
200
|
await promises.cp(before, target.path, { recursive: true, filter: snapshotFilter(before) });
|
|
201
201
|
}
|
|
202
|
-
async function gcTransactions(
|
|
203
|
-
const all = await listTransactions(
|
|
202
|
+
async function gcTransactions(moxxyDir, keep) {
|
|
203
|
+
const all = await listTransactions(moxxyDir);
|
|
204
204
|
const terminal = all.filter((j2) => j2.state === "committed" || j2.state === "rolled_back" || j2.state === "escalated");
|
|
205
205
|
for (const j2 of terminal.slice(keep)) {
|
|
206
|
-
await promises.rm(txnDir(
|
|
206
|
+
await promises.rm(txnDir(moxxyDir, j2.txnId), { recursive: true, force: true });
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
var MAX_FAILED_ATTEMPTS, NAME_SEGMENT_RE, SNAPSHOT_EXCLUDE;
|
|
@@ -613,49 +613,49 @@ async function corePreflight(install) {
|
|
|
613
613
|
});
|
|
614
614
|
return { ok: checks.every((c3) => c3.ok), checks };
|
|
615
615
|
}
|
|
616
|
-
function coreTxnRoot(
|
|
617
|
-
return path3.join(
|
|
616
|
+
function coreTxnRoot(moxxyDir) {
|
|
617
|
+
return path3.join(moxxyDir, "self-update", "core-txns");
|
|
618
618
|
}
|
|
619
|
-
function coreTxnDir(
|
|
620
|
-
return path3.join(coreTxnRoot(
|
|
619
|
+
function coreTxnDir(moxxyDir, txnId) {
|
|
620
|
+
return path3.join(coreTxnRoot(moxxyDir), txnId);
|
|
621
621
|
}
|
|
622
|
-
function repoDir(
|
|
623
|
-
return path3.join(
|
|
622
|
+
function repoDir(moxxyDir) {
|
|
623
|
+
return path3.join(moxxyDir, "self-update", "repo");
|
|
624
624
|
}
|
|
625
|
-
async function writeCoreJournal(
|
|
625
|
+
async function writeCoreJournal(moxxyDir, j2) {
|
|
626
626
|
j2.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
627
|
-
const file = path3.join(coreTxnDir(
|
|
627
|
+
const file = path3.join(coreTxnDir(moxxyDir, j2.txnId), "journal.json");
|
|
628
628
|
await writeFileAtomic(file, JSON.stringify(j2, null, 2) + "\n");
|
|
629
629
|
}
|
|
630
|
-
async function readCoreJournal(
|
|
631
|
-
return JSON.parse(await promises.readFile(path3.join(coreTxnDir(
|
|
630
|
+
async function readCoreJournal(moxxyDir, txnId) {
|
|
631
|
+
return JSON.parse(await promises.readFile(path3.join(coreTxnDir(moxxyDir, txnId), "journal.json"), "utf8"));
|
|
632
632
|
}
|
|
633
|
-
async function listCoreTxns(
|
|
633
|
+
async function listCoreTxns(moxxyDir) {
|
|
634
634
|
let ids;
|
|
635
635
|
try {
|
|
636
|
-
ids = (await promises.readdir(coreTxnRoot(
|
|
636
|
+
ids = (await promises.readdir(coreTxnRoot(moxxyDir), { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
637
637
|
} catch {
|
|
638
638
|
return [];
|
|
639
639
|
}
|
|
640
640
|
const out = [];
|
|
641
641
|
for (const id of ids) {
|
|
642
642
|
try {
|
|
643
|
-
out.push(await readCoreJournal(
|
|
643
|
+
out.push(await readCoreJournal(moxxyDir, id));
|
|
644
644
|
} catch {
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
return out.sort((a2, b3) => b3.createdAt.localeCompare(a2.createdAt));
|
|
648
648
|
}
|
|
649
|
-
async function countCorruptCoreTxns(
|
|
649
|
+
async function countCorruptCoreTxns(moxxyDir) {
|
|
650
650
|
let ids;
|
|
651
651
|
try {
|
|
652
|
-
ids = (await promises.readdir(coreTxnRoot(
|
|
652
|
+
ids = (await promises.readdir(coreTxnRoot(moxxyDir), { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
653
653
|
} catch {
|
|
654
654
|
return 0;
|
|
655
655
|
}
|
|
656
656
|
let corrupt = 0;
|
|
657
657
|
for (const id of ids) {
|
|
658
|
-
const file = path3.join(coreTxnDir(
|
|
658
|
+
const file = path3.join(coreTxnDir(moxxyDir, id), "journal.json");
|
|
659
659
|
let raw;
|
|
660
660
|
try {
|
|
661
661
|
raw = await promises.readFile(file, "utf8");
|
|
@@ -858,12 +858,12 @@ async function overlayApplied(snapshotDir2, pkgNames) {
|
|
|
858
858
|
return false;
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
|
-
async function finalizeStagedCoreUpdate(
|
|
861
|
+
async function finalizeStagedCoreUpdate(moxxyDir, install, keepTerminal = 5) {
|
|
862
862
|
const committed = [];
|
|
863
|
-
for (const j2 of await listCoreTxns(
|
|
863
|
+
for (const j2 of await listCoreTxns(moxxyDir)) {
|
|
864
864
|
if (j2.state !== "staged_restart")
|
|
865
865
|
continue;
|
|
866
|
-
const snapDir = path3.join(coreTxnDir(
|
|
866
|
+
const snapDir = path3.join(coreTxnDir(moxxyDir, j2.txnId), "snapshot");
|
|
867
867
|
if (install) {
|
|
868
868
|
const recon = await reconcileOverlay({
|
|
869
869
|
install,
|
|
@@ -872,31 +872,31 @@ async function finalizeStagedCoreUpdate(moxxyDir2, install, keepTerminal = 5) {
|
|
|
872
872
|
}).catch(() => ({ reconciled: false }));
|
|
873
873
|
if (recon.reconciled) {
|
|
874
874
|
j2.state = "rolled_back";
|
|
875
|
-
await writeCoreJournal(
|
|
875
|
+
await writeCoreJournal(moxxyDir, j2).catch(() => void 0);
|
|
876
876
|
continue;
|
|
877
877
|
}
|
|
878
878
|
if (!await overlayApplied(snapDir, j2.packages)) {
|
|
879
879
|
await restoreOverlay({ install, pkgNames: j2.packages, snapshotDir: snapDir }).catch(() => void 0);
|
|
880
880
|
j2.state = "rolled_back";
|
|
881
|
-
await writeCoreJournal(
|
|
881
|
+
await writeCoreJournal(moxxyDir, j2).catch(() => void 0);
|
|
882
882
|
continue;
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
885
|
j2.state = "committed";
|
|
886
|
-
await writeCoreJournal(
|
|
886
|
+
await writeCoreJournal(moxxyDir, j2).catch(() => void 0);
|
|
887
887
|
committed.push(j2.txnId);
|
|
888
888
|
}
|
|
889
|
-
await gcCoreTxns(
|
|
889
|
+
await gcCoreTxns(moxxyDir, keepTerminal).catch(() => void 0);
|
|
890
890
|
return committed;
|
|
891
891
|
}
|
|
892
892
|
function newCoreTxnId(now = /* @__PURE__ */ new Date()) {
|
|
893
893
|
return `core-${newTxnId(now)}`;
|
|
894
894
|
}
|
|
895
|
-
async function gcCoreTxns(
|
|
896
|
-
const all = await listCoreTxns(
|
|
895
|
+
async function gcCoreTxns(moxxyDir, keep) {
|
|
896
|
+
const all = await listCoreTxns(moxxyDir);
|
|
897
897
|
const terminal = all.filter((j2) => j2.state === "committed" || j2.state === "rolled_back");
|
|
898
898
|
for (const j2 of terminal.slice(Math.max(0, keep))) {
|
|
899
|
-
await promises.rm(coreTxnDir(
|
|
899
|
+
await promises.rm(coreTxnDir(moxxyDir, j2.txnId), { recursive: true, force: true }).catch(() => void 0);
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
902
|
function safeRepoPath(repo, rel) {
|
|
@@ -981,8 +981,8 @@ var init_deps = __esm({
|
|
|
981
981
|
PLUGIN_ID = "@moxxy/plugin-self-update";
|
|
982
982
|
}
|
|
983
983
|
});
|
|
984
|
-
function snapshotDir(
|
|
985
|
-
return path3.join(coreTxnDir(
|
|
984
|
+
function snapshotDir(moxxyDir, txnId) {
|
|
985
|
+
return path3.join(coreTxnDir(moxxyDir, txnId), "snapshot");
|
|
986
986
|
}
|
|
987
987
|
function resolveCore(c3) {
|
|
988
988
|
return resolveCoreInstall(c3.deps, c3.fromUrl);
|
|
@@ -1743,7 +1743,7 @@ var init_dist = __esm({
|
|
|
1743
1743
|
let appendEvent = null;
|
|
1744
1744
|
let options = {};
|
|
1745
1745
|
const deps = {
|
|
1746
|
-
moxxyDir:
|
|
1746
|
+
moxxyDir: moxxyHome(),
|
|
1747
1747
|
reload: () => host?.reload() ?? Promise.resolve(),
|
|
1748
1748
|
unload: (name) => host?.unload(name) ?? Promise.resolve(),
|
|
1749
1749
|
snapshot: () => snapshotFn ? snapshotFn() : {},
|
|
@@ -2939,6 +2939,16 @@ var init_subagents = __esm({
|
|
|
2939
2939
|
init_registry();
|
|
2940
2940
|
}
|
|
2941
2941
|
});
|
|
2942
|
+
|
|
2943
|
+
// ../core/dist/turn-model.js
|
|
2944
|
+
function resolveTurnModel(session, provider, named) {
|
|
2945
|
+
const configured = session.defaultModels ? session.defaultModels[provider.name] : void 0;
|
|
2946
|
+
return named ?? session.lastResolvedModel ?? configured ?? provider.models[0]?.id;
|
|
2947
|
+
}
|
|
2948
|
+
var init_turn_model = __esm({
|
|
2949
|
+
"../core/dist/turn-model.js"() {
|
|
2950
|
+
}
|
|
2951
|
+
});
|
|
2942
2952
|
async function* runTurn(session, prompt, opts = {}) {
|
|
2943
2953
|
const turnId = opts.turnId ?? session.startTurn().turnId;
|
|
2944
2954
|
const queue = [];
|
|
@@ -2974,7 +2984,7 @@ async function* runTurn(session, prompt, opts = {}) {
|
|
|
2974
2984
|
let model;
|
|
2975
2985
|
try {
|
|
2976
2986
|
provider = session.providers.getActive();
|
|
2977
|
-
const resolvedModel =
|
|
2987
|
+
const resolvedModel = resolveTurnModel(session, provider, opts.model);
|
|
2978
2988
|
if (!resolvedModel) {
|
|
2979
2989
|
throw new Error(`Active provider '${provider.name}' has no models configured`);
|
|
2980
2990
|
}
|
|
@@ -3015,6 +3025,7 @@ async function* runTurn(session, prompt, opts = {}) {
|
|
|
3015
3025
|
cacheStrategy: session.cacheStrategies.getActive(),
|
|
3016
3026
|
...session.elisionSettings ? { elision: session.elisionSettings } : {},
|
|
3017
3027
|
...session.lazyTools !== void 0 ? { lazyTools: session.lazyTools } : {},
|
|
3028
|
+
...session.unfinishedStepCheck !== void 0 ? { unfinishedStepCheck: session.unfinishedStepCheck } : {},
|
|
3018
3029
|
// Reasoning preference (effort) — honored only by providers/models that
|
|
3019
3030
|
// advertise `supportsReasoning` (gated in collectProviderStream).
|
|
3020
3031
|
...session.reasoning ? { reasoning: session.reasoning } : {},
|
|
@@ -3093,6 +3104,7 @@ async function collectTurn(session, prompt, opts = {}) {
|
|
|
3093
3104
|
var init_run_turn = __esm({
|
|
3094
3105
|
"../core/dist/run-turn.js"() {
|
|
3095
3106
|
init_subagents();
|
|
3107
|
+
init_turn_model();
|
|
3096
3108
|
}
|
|
3097
3109
|
});
|
|
3098
3110
|
|
|
@@ -3324,7 +3336,7 @@ function toposortPluginManifests(manifests) {
|
|
|
3324
3336
|
const order = [];
|
|
3325
3337
|
const visited = /* @__PURE__ */ new Set();
|
|
3326
3338
|
const onStack = /* @__PURE__ */ new Set();
|
|
3327
|
-
const
|
|
3339
|
+
const path73 = [];
|
|
3328
3340
|
const visitRoot = (root) => {
|
|
3329
3341
|
if (visited.has(root))
|
|
3330
3342
|
return;
|
|
@@ -3333,7 +3345,7 @@ function toposortPluginManifests(manifests) {
|
|
|
3333
3345
|
return;
|
|
3334
3346
|
const stack = [{ name: root, deps: pluginDeps(rootManifest.requirements), next: 0 }];
|
|
3335
3347
|
onStack.add(root);
|
|
3336
|
-
|
|
3348
|
+
path73.push(root);
|
|
3337
3349
|
while (stack.length > 0) {
|
|
3338
3350
|
const frame = stack[stack.length - 1];
|
|
3339
3351
|
if (!frame)
|
|
@@ -3345,20 +3357,20 @@ function toposortPluginManifests(manifests) {
|
|
|
3345
3357
|
if (visited.has(dep))
|
|
3346
3358
|
continue;
|
|
3347
3359
|
if (onStack.has(dep)) {
|
|
3348
|
-
const startIdx =
|
|
3349
|
-
throw new PluginCycleError(
|
|
3360
|
+
const startIdx = path73.indexOf(dep);
|
|
3361
|
+
throw new PluginCycleError(path73.slice(startIdx).concat(dep));
|
|
3350
3362
|
}
|
|
3351
3363
|
const depManifest = byPackage.get(dep);
|
|
3352
3364
|
if (!depManifest)
|
|
3353
3365
|
continue;
|
|
3354
3366
|
onStack.add(dep);
|
|
3355
|
-
|
|
3367
|
+
path73.push(dep);
|
|
3356
3368
|
stack.push({ name: dep, deps: pluginDeps(depManifest.requirements), next: 0 });
|
|
3357
3369
|
continue;
|
|
3358
3370
|
}
|
|
3359
3371
|
const done = stack.pop();
|
|
3360
3372
|
onStack.delete(done.name);
|
|
3361
|
-
|
|
3373
|
+
path73.pop();
|
|
3362
3374
|
visited.add(done.name);
|
|
3363
3375
|
const manifest = byPackage.get(done.name);
|
|
3364
3376
|
if (manifest)
|
|
@@ -5150,8 +5162,8 @@ var init_skills = __esm({
|
|
|
5150
5162
|
});
|
|
5151
5163
|
function formatZodIssues(error) {
|
|
5152
5164
|
return error.issues.map((iss) => {
|
|
5153
|
-
const
|
|
5154
|
-
return `${
|
|
5165
|
+
const path73 = iss.path.length ? iss.path.join(".") : "(root)";
|
|
5166
|
+
return `${path73}: ${iss.message}`;
|
|
5155
5167
|
}).join("; ");
|
|
5156
5168
|
}
|
|
5157
5169
|
function emptyLog() {
|
|
@@ -6958,18 +6970,18 @@ var init_engine = __esm({
|
|
|
6958
6970
|
// without serialization two overlapping calls both read the same snapshot,
|
|
6959
6971
|
// each append one rule, and the second write clobbers the first's rule.
|
|
6960
6972
|
mutex = createMutex();
|
|
6961
|
-
constructor(policy = emptyPolicy,
|
|
6973
|
+
constructor(policy = emptyPolicy, policyPath = null) {
|
|
6962
6974
|
this.policy = policy;
|
|
6963
|
-
this.policyPath =
|
|
6975
|
+
this.policyPath = policyPath;
|
|
6964
6976
|
}
|
|
6965
|
-
static async load(
|
|
6977
|
+
static async load(policyPath) {
|
|
6966
6978
|
try {
|
|
6967
|
-
const raw = await promises.readFile(
|
|
6979
|
+
const raw = await promises.readFile(policyPath, "utf8");
|
|
6968
6980
|
const parsed = permissionPolicySchema.parse(JSON.parse(raw));
|
|
6969
|
-
return new _PermissionEngine(parsed,
|
|
6981
|
+
return new _PermissionEngine(parsed, policyPath);
|
|
6970
6982
|
} catch (err) {
|
|
6971
6983
|
if (isNodeError(err) && err.code === "ENOENT") {
|
|
6972
|
-
return new _PermissionEngine(emptyPolicy,
|
|
6984
|
+
return new _PermissionEngine(emptyPolicy, policyPath);
|
|
6973
6985
|
}
|
|
6974
6986
|
throw err;
|
|
6975
6987
|
}
|
|
@@ -7184,6 +7196,7 @@ var init_session = __esm({
|
|
|
7184
7196
|
"../core/dist/session.js"() {
|
|
7185
7197
|
init_factory();
|
|
7186
7198
|
init_run_turn();
|
|
7199
|
+
init_turn_model();
|
|
7187
7200
|
init_log();
|
|
7188
7201
|
init_lifecycle();
|
|
7189
7202
|
init_host();
|
|
@@ -7293,6 +7306,8 @@ var init_session = __esm({
|
|
|
7293
7306
|
elisionSettings = null;
|
|
7294
7307
|
/** Lazy tool loading, from `config.context.lazyTools`. Unset = automatic (on for a long tool list). */
|
|
7295
7308
|
lazyTools = void 0;
|
|
7309
|
+
/** The end-of-turn reminder about a step that did not get done, from `config.context.unfinishedStepCheck`. Unset = on. */
|
|
7310
|
+
unfinishedStepCheck = void 0;
|
|
7296
7311
|
/**
|
|
7297
7312
|
* Reasoning/thinking preference, from `config.context.reasoning`. Forwarded
|
|
7298
7313
|
* to each turn's ModeContext and on to the provider, which honors it only
|
|
@@ -7312,6 +7327,8 @@ var init_session = __esm({
|
|
|
7312
7327
|
* Last-writer-wins for concurrent turns; null until the first turn runs.
|
|
7313
7328
|
*/
|
|
7314
7329
|
lastResolvedModel = null;
|
|
7330
|
+
/** The model each provider is set to run when a turn names none, from `plugins.provider.items.<name>.model`. */
|
|
7331
|
+
defaultModels = {};
|
|
7315
7332
|
/**
|
|
7316
7333
|
* Live runtime capabilities the host installs on a local Session (see
|
|
7317
7334
|
* SessionLike). A RemoteSession leaves them undefined. Declared here — rather
|
|
@@ -7620,6 +7637,8 @@ var init_session = __esm({
|
|
|
7620
7637
|
} catch {
|
|
7621
7638
|
}
|
|
7622
7639
|
}
|
|
7640
|
+
const declared = this.providers.list().find((p3) => p3.name === active2);
|
|
7641
|
+
const defaultModel = active2 ? resolveTurnModel(this, { name: active2, models: activeProviderModels ?? (declared ? declared.models : []) }) : void 0;
|
|
7623
7642
|
const ready = this.readyProviders;
|
|
7624
7643
|
return {
|
|
7625
7644
|
sessionId: this.id,
|
|
@@ -7670,7 +7689,8 @@ var init_session = __esm({
|
|
|
7670
7689
|
activeSynthesizer: this.synthesizers.getActiveName(),
|
|
7671
7690
|
autoApprove: this.autoApprove,
|
|
7672
7691
|
reasoningEffort: reasoningEffortOf(this.reasoning),
|
|
7673
|
-
fast: this.fast
|
|
7692
|
+
fast: this.fast,
|
|
7693
|
+
...defaultModel !== void 0 ? { defaultModel } : {}
|
|
7674
7694
|
};
|
|
7675
7695
|
}
|
|
7676
7696
|
};
|
|
@@ -8351,7 +8371,7 @@ function deriveTriggers(name) {
|
|
|
8351
8371
|
return [...out];
|
|
8352
8372
|
}
|
|
8353
8373
|
function defaultUserSkillsDir() {
|
|
8354
|
-
return
|
|
8374
|
+
return moxxyPath("skills");
|
|
8355
8375
|
}
|
|
8356
8376
|
function defaultProjectSkillsDir(cwd2) {
|
|
8357
8377
|
return path3.join(cwd2, ".moxxy", "skills");
|
|
@@ -8403,7 +8423,7 @@ The body is the instructions for future invocations. Keep it under 30 lines. Num
|
|
|
8403
8423
|
});
|
|
8404
8424
|
async function synthesizeSkill(session, intent, scope2, opts = {}, turnId) {
|
|
8405
8425
|
const provider = session.providers.getActive();
|
|
8406
|
-
const model =
|
|
8426
|
+
const model = resolveTurnModel(session, provider, opts.model) ?? "default";
|
|
8407
8427
|
const draft = await draftSkill(provider, model, intent, session.signal);
|
|
8408
8428
|
const baseDir = scope2 === "project" ? opts.projectDir ?? defaultProjectSkillsDir(session.cwd) : opts.userDir ?? defaultUserSkillsDir();
|
|
8409
8429
|
await promises.mkdir(baseDir, { recursive: true });
|
|
@@ -8634,6 +8654,7 @@ var init_synthesize = __esm({
|
|
|
8634
8654
|
"../core/dist/skills/synthesize.js"() {
|
|
8635
8655
|
init_loader();
|
|
8636
8656
|
init_synthesize_draft();
|
|
8657
|
+
init_turn_model();
|
|
8637
8658
|
MAX_AUDIT_LINES = 2e3;
|
|
8638
8659
|
}
|
|
8639
8660
|
});
|
|
@@ -13070,6 +13091,7 @@ __export(dist_exports, {
|
|
|
13070
13091
|
readSessionEventPage: () => readEventPage,
|
|
13071
13092
|
readSessionIndex: () => readIndex,
|
|
13072
13093
|
resetAuditHeadForTests: () => resetAuditHeadForTests,
|
|
13094
|
+
resolveTurnModel: () => resolveTurnModel,
|
|
13073
13095
|
restoreSessionEvents: () => restoreEvents,
|
|
13074
13096
|
runTurn: () => runTurn,
|
|
13075
13097
|
seedSessionMeta: () => seedSessionMeta,
|
|
@@ -13094,6 +13116,7 @@ var init_dist2 = __esm({
|
|
|
13094
13116
|
init_scope();
|
|
13095
13117
|
init_workflow_lease();
|
|
13096
13118
|
init_run_turn();
|
|
13119
|
+
init_turn_model();
|
|
13097
13120
|
init_setup_agent();
|
|
13098
13121
|
init_subagents();
|
|
13099
13122
|
init_usage_stats();
|
|
@@ -13471,6 +13494,11 @@ var init_schema = __esm({
|
|
|
13471
13494
|
elision: elisionConfigSchema.optional(),
|
|
13472
13495
|
/** Lazy tool loading: send only core + loaded tool schemas, index the rest. Unset = on above 200 tools. */
|
|
13473
13496
|
lazyTools: z.boolean().optional(),
|
|
13497
|
+
/**
|
|
13498
|
+
* The reminder at the end of a turn that ended on a step that did not get
|
|
13499
|
+
* done: take another way, or say what stops you. Asked once a turn. Unset = on.
|
|
13500
|
+
*/
|
|
13501
|
+
unfinishedStepCheck: z.boolean().optional(),
|
|
13474
13502
|
/**
|
|
13475
13503
|
* Reasoning/thinking preview. `true` enables it at the model's default depth;
|
|
13476
13504
|
* `{ effort }` sets the depth. Honored only by providers/models that support
|
|
@@ -13781,17 +13809,17 @@ var require_visit = __commonJS({
|
|
|
13781
13809
|
visit.BREAK = BREAK;
|
|
13782
13810
|
visit.SKIP = SKIP;
|
|
13783
13811
|
visit.REMOVE = REMOVE;
|
|
13784
|
-
function visit_(key, node, visitor,
|
|
13785
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
13812
|
+
function visit_(key, node, visitor, path73) {
|
|
13813
|
+
const ctrl = callVisitor(key, node, visitor, path73);
|
|
13786
13814
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
13787
|
-
replaceNode(key,
|
|
13788
|
-
return visit_(key, ctrl, visitor,
|
|
13815
|
+
replaceNode(key, path73, ctrl);
|
|
13816
|
+
return visit_(key, ctrl, visitor, path73);
|
|
13789
13817
|
}
|
|
13790
13818
|
if (typeof ctrl !== "symbol") {
|
|
13791
13819
|
if (identity.isCollection(node)) {
|
|
13792
|
-
|
|
13820
|
+
path73 = Object.freeze(path73.concat(node));
|
|
13793
13821
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
13794
|
-
const ci = visit_(i2, node.items[i2], visitor,
|
|
13822
|
+
const ci = visit_(i2, node.items[i2], visitor, path73);
|
|
13795
13823
|
if (typeof ci === "number")
|
|
13796
13824
|
i2 = ci - 1;
|
|
13797
13825
|
else if (ci === BREAK)
|
|
@@ -13802,13 +13830,13 @@ var require_visit = __commonJS({
|
|
|
13802
13830
|
}
|
|
13803
13831
|
}
|
|
13804
13832
|
} else if (identity.isPair(node)) {
|
|
13805
|
-
|
|
13806
|
-
const ck = visit_("key", node.key, visitor,
|
|
13833
|
+
path73 = Object.freeze(path73.concat(node));
|
|
13834
|
+
const ck = visit_("key", node.key, visitor, path73);
|
|
13807
13835
|
if (ck === BREAK)
|
|
13808
13836
|
return BREAK;
|
|
13809
13837
|
else if (ck === REMOVE)
|
|
13810
13838
|
node.key = null;
|
|
13811
|
-
const cv = visit_("value", node.value, visitor,
|
|
13839
|
+
const cv = visit_("value", node.value, visitor, path73);
|
|
13812
13840
|
if (cv === BREAK)
|
|
13813
13841
|
return BREAK;
|
|
13814
13842
|
else if (cv === REMOVE)
|
|
@@ -13829,17 +13857,17 @@ var require_visit = __commonJS({
|
|
|
13829
13857
|
visitAsync.BREAK = BREAK;
|
|
13830
13858
|
visitAsync.SKIP = SKIP;
|
|
13831
13859
|
visitAsync.REMOVE = REMOVE;
|
|
13832
|
-
async function visitAsync_(key, node, visitor,
|
|
13833
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
13860
|
+
async function visitAsync_(key, node, visitor, path73) {
|
|
13861
|
+
const ctrl = await callVisitor(key, node, visitor, path73);
|
|
13834
13862
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
13835
|
-
replaceNode(key,
|
|
13836
|
-
return visitAsync_(key, ctrl, visitor,
|
|
13863
|
+
replaceNode(key, path73, ctrl);
|
|
13864
|
+
return visitAsync_(key, ctrl, visitor, path73);
|
|
13837
13865
|
}
|
|
13838
13866
|
if (typeof ctrl !== "symbol") {
|
|
13839
13867
|
if (identity.isCollection(node)) {
|
|
13840
|
-
|
|
13868
|
+
path73 = Object.freeze(path73.concat(node));
|
|
13841
13869
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
13842
|
-
const ci = await visitAsync_(i2, node.items[i2], visitor,
|
|
13870
|
+
const ci = await visitAsync_(i2, node.items[i2], visitor, path73);
|
|
13843
13871
|
if (typeof ci === "number")
|
|
13844
13872
|
i2 = ci - 1;
|
|
13845
13873
|
else if (ci === BREAK)
|
|
@@ -13850,13 +13878,13 @@ var require_visit = __commonJS({
|
|
|
13850
13878
|
}
|
|
13851
13879
|
}
|
|
13852
13880
|
} else if (identity.isPair(node)) {
|
|
13853
|
-
|
|
13854
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
13881
|
+
path73 = Object.freeze(path73.concat(node));
|
|
13882
|
+
const ck = await visitAsync_("key", node.key, visitor, path73);
|
|
13855
13883
|
if (ck === BREAK)
|
|
13856
13884
|
return BREAK;
|
|
13857
13885
|
else if (ck === REMOVE)
|
|
13858
13886
|
node.key = null;
|
|
13859
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
13887
|
+
const cv = await visitAsync_("value", node.value, visitor, path73);
|
|
13860
13888
|
if (cv === BREAK)
|
|
13861
13889
|
return BREAK;
|
|
13862
13890
|
else if (cv === REMOVE)
|
|
@@ -13883,23 +13911,23 @@ var require_visit = __commonJS({
|
|
|
13883
13911
|
}
|
|
13884
13912
|
return visitor;
|
|
13885
13913
|
}
|
|
13886
|
-
function callVisitor(key, node, visitor,
|
|
13914
|
+
function callVisitor(key, node, visitor, path73) {
|
|
13887
13915
|
if (typeof visitor === "function")
|
|
13888
|
-
return visitor(key, node,
|
|
13916
|
+
return visitor(key, node, path73);
|
|
13889
13917
|
if (identity.isMap(node))
|
|
13890
|
-
return visitor.Map?.(key, node,
|
|
13918
|
+
return visitor.Map?.(key, node, path73);
|
|
13891
13919
|
if (identity.isSeq(node))
|
|
13892
|
-
return visitor.Seq?.(key, node,
|
|
13920
|
+
return visitor.Seq?.(key, node, path73);
|
|
13893
13921
|
if (identity.isPair(node))
|
|
13894
|
-
return visitor.Pair?.(key, node,
|
|
13922
|
+
return visitor.Pair?.(key, node, path73);
|
|
13895
13923
|
if (identity.isScalar(node))
|
|
13896
|
-
return visitor.Scalar?.(key, node,
|
|
13924
|
+
return visitor.Scalar?.(key, node, path73);
|
|
13897
13925
|
if (identity.isAlias(node))
|
|
13898
|
-
return visitor.Alias?.(key, node,
|
|
13926
|
+
return visitor.Alias?.(key, node, path73);
|
|
13899
13927
|
return void 0;
|
|
13900
13928
|
}
|
|
13901
|
-
function replaceNode(key,
|
|
13902
|
-
const parent =
|
|
13929
|
+
function replaceNode(key, path73, node) {
|
|
13930
|
+
const parent = path73[path73.length - 1];
|
|
13903
13931
|
if (identity.isCollection(parent)) {
|
|
13904
13932
|
parent.items[key] = node;
|
|
13905
13933
|
} else if (identity.isPair(parent)) {
|
|
@@ -14502,10 +14530,10 @@ var require_Collection = __commonJS({
|
|
|
14502
14530
|
var createNode2 = require_createNode();
|
|
14503
14531
|
var identity = require_identity();
|
|
14504
14532
|
var Node = require_Node();
|
|
14505
|
-
function collectionFromPath(schema,
|
|
14533
|
+
function collectionFromPath(schema, path73, value2) {
|
|
14506
14534
|
let v = value2;
|
|
14507
|
-
for (let i2 =
|
|
14508
|
-
const k =
|
|
14535
|
+
for (let i2 = path73.length - 1; i2 >= 0; --i2) {
|
|
14536
|
+
const k = path73[i2];
|
|
14509
14537
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
14510
14538
|
const a2 = [];
|
|
14511
14539
|
a2[k] = v;
|
|
@@ -14524,7 +14552,7 @@ var require_Collection = __commonJS({
|
|
|
14524
14552
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
14525
14553
|
});
|
|
14526
14554
|
}
|
|
14527
|
-
var isEmptyPath = (
|
|
14555
|
+
var isEmptyPath = (path73) => path73 == null || typeof path73 === "object" && !!path73[Symbol.iterator]().next().done;
|
|
14528
14556
|
var Collection = class extends Node.NodeBase {
|
|
14529
14557
|
constructor(type, schema) {
|
|
14530
14558
|
super(type);
|
|
@@ -14554,11 +14582,11 @@ var require_Collection = __commonJS({
|
|
|
14554
14582
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
14555
14583
|
* that already exists in the map.
|
|
14556
14584
|
*/
|
|
14557
|
-
addIn(
|
|
14558
|
-
if (isEmptyPath(
|
|
14585
|
+
addIn(path73, value2) {
|
|
14586
|
+
if (isEmptyPath(path73))
|
|
14559
14587
|
this.add(value2);
|
|
14560
14588
|
else {
|
|
14561
|
-
const [key, ...rest] =
|
|
14589
|
+
const [key, ...rest] = path73;
|
|
14562
14590
|
const node = this.get(key, true);
|
|
14563
14591
|
if (identity.isCollection(node))
|
|
14564
14592
|
node.addIn(rest, value2);
|
|
@@ -14572,8 +14600,8 @@ var require_Collection = __commonJS({
|
|
|
14572
14600
|
* Removes a value from the collection.
|
|
14573
14601
|
* @returns `true` if the item was found and removed.
|
|
14574
14602
|
*/
|
|
14575
|
-
deleteIn(
|
|
14576
|
-
const [key, ...rest] =
|
|
14603
|
+
deleteIn(path73) {
|
|
14604
|
+
const [key, ...rest] = path73;
|
|
14577
14605
|
if (rest.length === 0)
|
|
14578
14606
|
return this.delete(key);
|
|
14579
14607
|
const node = this.get(key, true);
|
|
@@ -14587,8 +14615,8 @@ var require_Collection = __commonJS({
|
|
|
14587
14615
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
14588
14616
|
* `true` (collections are always returned intact).
|
|
14589
14617
|
*/
|
|
14590
|
-
getIn(
|
|
14591
|
-
const [key, ...rest] =
|
|
14618
|
+
getIn(path73, keepScalar) {
|
|
14619
|
+
const [key, ...rest] = path73;
|
|
14592
14620
|
const node = this.get(key, true);
|
|
14593
14621
|
if (rest.length === 0)
|
|
14594
14622
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -14606,8 +14634,8 @@ var require_Collection = __commonJS({
|
|
|
14606
14634
|
/**
|
|
14607
14635
|
* Checks if the collection includes a value with the key `key`.
|
|
14608
14636
|
*/
|
|
14609
|
-
hasIn(
|
|
14610
|
-
const [key, ...rest] =
|
|
14637
|
+
hasIn(path73) {
|
|
14638
|
+
const [key, ...rest] = path73;
|
|
14611
14639
|
if (rest.length === 0)
|
|
14612
14640
|
return this.has(key);
|
|
14613
14641
|
const node = this.get(key, true);
|
|
@@ -14617,8 +14645,8 @@ var require_Collection = __commonJS({
|
|
|
14617
14645
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
14618
14646
|
* boolean to add/remove the item from the set.
|
|
14619
14647
|
*/
|
|
14620
|
-
setIn(
|
|
14621
|
-
const [key, ...rest] =
|
|
14648
|
+
setIn(path73, value2) {
|
|
14649
|
+
const [key, ...rest] = path73;
|
|
14622
14650
|
if (rest.length === 0) {
|
|
14623
14651
|
this.set(key, value2);
|
|
14624
14652
|
} else {
|
|
@@ -17098,9 +17126,9 @@ var require_Document = __commonJS({
|
|
|
17098
17126
|
this.contents.add(value2);
|
|
17099
17127
|
}
|
|
17100
17128
|
/** Adds a value to the document. */
|
|
17101
|
-
addIn(
|
|
17129
|
+
addIn(path73, value2) {
|
|
17102
17130
|
if (assertCollection(this.contents))
|
|
17103
|
-
this.contents.addIn(
|
|
17131
|
+
this.contents.addIn(path73, value2);
|
|
17104
17132
|
}
|
|
17105
17133
|
/**
|
|
17106
17134
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -17175,14 +17203,14 @@ var require_Document = __commonJS({
|
|
|
17175
17203
|
* Removes a value from the document.
|
|
17176
17204
|
* @returns `true` if the item was found and removed.
|
|
17177
17205
|
*/
|
|
17178
|
-
deleteIn(
|
|
17179
|
-
if (Collection.isEmptyPath(
|
|
17206
|
+
deleteIn(path73) {
|
|
17207
|
+
if (Collection.isEmptyPath(path73)) {
|
|
17180
17208
|
if (this.contents == null)
|
|
17181
17209
|
return false;
|
|
17182
17210
|
this.contents = null;
|
|
17183
17211
|
return true;
|
|
17184
17212
|
}
|
|
17185
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
17213
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path73) : false;
|
|
17186
17214
|
}
|
|
17187
17215
|
/**
|
|
17188
17216
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -17197,10 +17225,10 @@ var require_Document = __commonJS({
|
|
|
17197
17225
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
17198
17226
|
* `true` (collections are always returned intact).
|
|
17199
17227
|
*/
|
|
17200
|
-
getIn(
|
|
17201
|
-
if (Collection.isEmptyPath(
|
|
17228
|
+
getIn(path73, keepScalar) {
|
|
17229
|
+
if (Collection.isEmptyPath(path73))
|
|
17202
17230
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
17203
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
17231
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path73, keepScalar) : void 0;
|
|
17204
17232
|
}
|
|
17205
17233
|
/**
|
|
17206
17234
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -17211,10 +17239,10 @@ var require_Document = __commonJS({
|
|
|
17211
17239
|
/**
|
|
17212
17240
|
* Checks if the document includes a value at `path`.
|
|
17213
17241
|
*/
|
|
17214
|
-
hasIn(
|
|
17215
|
-
if (Collection.isEmptyPath(
|
|
17242
|
+
hasIn(path73) {
|
|
17243
|
+
if (Collection.isEmptyPath(path73))
|
|
17216
17244
|
return this.contents !== void 0;
|
|
17217
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
17245
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path73) : false;
|
|
17218
17246
|
}
|
|
17219
17247
|
/**
|
|
17220
17248
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -17231,13 +17259,13 @@ var require_Document = __commonJS({
|
|
|
17231
17259
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
17232
17260
|
* boolean to add/remove the item from the set.
|
|
17233
17261
|
*/
|
|
17234
|
-
setIn(
|
|
17235
|
-
if (Collection.isEmptyPath(
|
|
17262
|
+
setIn(path73, value2) {
|
|
17263
|
+
if (Collection.isEmptyPath(path73)) {
|
|
17236
17264
|
this.contents = value2;
|
|
17237
17265
|
} else if (this.contents == null) {
|
|
17238
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
17266
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path73), value2);
|
|
17239
17267
|
} else if (assertCollection(this.contents)) {
|
|
17240
|
-
this.contents.setIn(
|
|
17268
|
+
this.contents.setIn(path73, value2);
|
|
17241
17269
|
}
|
|
17242
17270
|
}
|
|
17243
17271
|
/**
|
|
@@ -19178,9 +19206,9 @@ var require_cst_visit = __commonJS({
|
|
|
19178
19206
|
visit.BREAK = BREAK;
|
|
19179
19207
|
visit.SKIP = SKIP;
|
|
19180
19208
|
visit.REMOVE = REMOVE;
|
|
19181
|
-
visit.itemAtPath = (cst,
|
|
19209
|
+
visit.itemAtPath = (cst, path73) => {
|
|
19182
19210
|
let item = cst;
|
|
19183
|
-
for (const [field, index] of
|
|
19211
|
+
for (const [field, index] of path73) {
|
|
19184
19212
|
const tok = item?.[field];
|
|
19185
19213
|
if (tok && "items" in tok) {
|
|
19186
19214
|
item = tok.items[index];
|
|
@@ -19189,23 +19217,23 @@ var require_cst_visit = __commonJS({
|
|
|
19189
19217
|
}
|
|
19190
19218
|
return item;
|
|
19191
19219
|
};
|
|
19192
|
-
visit.parentCollection = (cst,
|
|
19193
|
-
const parent = visit.itemAtPath(cst,
|
|
19194
|
-
const field =
|
|
19220
|
+
visit.parentCollection = (cst, path73) => {
|
|
19221
|
+
const parent = visit.itemAtPath(cst, path73.slice(0, -1));
|
|
19222
|
+
const field = path73[path73.length - 1][0];
|
|
19195
19223
|
const coll = parent?.[field];
|
|
19196
19224
|
if (coll && "items" in coll)
|
|
19197
19225
|
return coll;
|
|
19198
19226
|
throw new Error("Parent collection not found");
|
|
19199
19227
|
};
|
|
19200
|
-
function _visit(
|
|
19201
|
-
let ctrl = visitor(item,
|
|
19228
|
+
function _visit(path73, item, visitor) {
|
|
19229
|
+
let ctrl = visitor(item, path73);
|
|
19202
19230
|
if (typeof ctrl === "symbol")
|
|
19203
19231
|
return ctrl;
|
|
19204
19232
|
for (const field of ["key", "value"]) {
|
|
19205
19233
|
const token = item[field];
|
|
19206
19234
|
if (token && "items" in token) {
|
|
19207
19235
|
for (let i2 = 0; i2 < token.items.length; ++i2) {
|
|
19208
|
-
const ci = _visit(Object.freeze(
|
|
19236
|
+
const ci = _visit(Object.freeze(path73.concat([[field, i2]])), token.items[i2], visitor);
|
|
19209
19237
|
if (typeof ci === "number")
|
|
19210
19238
|
i2 = ci - 1;
|
|
19211
19239
|
else if (ci === BREAK)
|
|
@@ -19216,10 +19244,10 @@ var require_cst_visit = __commonJS({
|
|
|
19216
19244
|
}
|
|
19217
19245
|
}
|
|
19218
19246
|
if (typeof ctrl === "function" && field === "key")
|
|
19219
|
-
ctrl = ctrl(item,
|
|
19247
|
+
ctrl = ctrl(item, path73);
|
|
19220
19248
|
}
|
|
19221
19249
|
}
|
|
19222
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
19250
|
+
return typeof ctrl === "function" ? ctrl(item, path73) : ctrl;
|
|
19223
19251
|
}
|
|
19224
19252
|
exports.visit = visit;
|
|
19225
19253
|
}
|
|
@@ -21605,10 +21633,10 @@ async function removeProviderItem(providerName2, opts = {}) {
|
|
|
21605
21633
|
const configPath = opts.configPath ?? defaultUserConfigPath();
|
|
21606
21634
|
return configMutex.run(async () => {
|
|
21607
21635
|
const doc = await readUserConfigDoc(configPath);
|
|
21608
|
-
const
|
|
21609
|
-
if (!doc.hasIn(
|
|
21636
|
+
const path73 = ["plugins", "provider", "items", providerName2];
|
|
21637
|
+
if (!doc.hasIn(path73))
|
|
21610
21638
|
return false;
|
|
21611
|
-
doc.deleteIn(
|
|
21639
|
+
doc.deleteIn(path73);
|
|
21612
21640
|
await writeUserConfigDoc(configPath, doc);
|
|
21613
21641
|
return true;
|
|
21614
21642
|
});
|
|
@@ -21649,6 +21677,42 @@ async function loadActiveProvider(opts = {}) {
|
|
|
21649
21677
|
const provider = doc.getIn(["plugins", "provider", "default"]);
|
|
21650
21678
|
return typeof provider === "string" ? provider : null;
|
|
21651
21679
|
}
|
|
21680
|
+
function storedEffort(reasoning) {
|
|
21681
|
+
if (reasoning === true)
|
|
21682
|
+
return "default";
|
|
21683
|
+
if (!reasoning || typeof reasoning !== "object")
|
|
21684
|
+
return "off";
|
|
21685
|
+
const effort = reasoning.effort;
|
|
21686
|
+
return typeof effort === "string" && MODEL_DEFAULT_EFFORTS.includes(effort) ? effort : "default";
|
|
21687
|
+
}
|
|
21688
|
+
async function loadModelDefaults(opts = {}) {
|
|
21689
|
+
const doc = await readUserConfigDoc(opts.configPath ?? defaultUserConfigPath());
|
|
21690
|
+
const provider = doc.getIn(["plugins", "provider", "default"]);
|
|
21691
|
+
const model = typeof provider === "string" ? doc.getIn(["plugins", "provider", "items", provider, "model"]) : void 0;
|
|
21692
|
+
const context = readRawEntry(doc, ["context"]);
|
|
21693
|
+
return {
|
|
21694
|
+
provider: typeof provider === "string" ? provider : null,
|
|
21695
|
+
model: typeof model === "string" ? model : null,
|
|
21696
|
+
effort: storedEffort(context.reasoning),
|
|
21697
|
+
fast: context.fast === true
|
|
21698
|
+
};
|
|
21699
|
+
}
|
|
21700
|
+
async function setModelDefaults(change, opts = {}) {
|
|
21701
|
+
const configPath = opts.configPath ?? defaultUserConfigPath();
|
|
21702
|
+
await configMutex.run(async () => {
|
|
21703
|
+
const doc = await readUserConfigDoc(configPath);
|
|
21704
|
+
if (change.model) {
|
|
21705
|
+
doc.setIn(["plugins", "provider", "default"], change.model.provider);
|
|
21706
|
+
doc.setIn(["plugins", "provider", "items", change.model.provider, "model"], change.model.model);
|
|
21707
|
+
}
|
|
21708
|
+
if (change.effort !== void 0) {
|
|
21709
|
+
doc.setIn(["context", "reasoning"], change.effort === "off" ? false : { effort: change.effort });
|
|
21710
|
+
}
|
|
21711
|
+
if (change.fast !== void 0)
|
|
21712
|
+
doc.setIn(["context", "fast"], change.fast);
|
|
21713
|
+
await writeUserConfigDoc(configPath, doc);
|
|
21714
|
+
});
|
|
21715
|
+
}
|
|
21652
21716
|
async function loadDisabledProviders(opts = {}) {
|
|
21653
21717
|
const doc = await readUserConfigDoc(opts.configPath ?? defaultUserConfigPath());
|
|
21654
21718
|
const items = doc.getIn(["plugins", "provider", "items"]);
|
|
@@ -21694,28 +21758,29 @@ async function readPackagesMap(configPath) {
|
|
|
21694
21758
|
}
|
|
21695
21759
|
return out;
|
|
21696
21760
|
}
|
|
21697
|
-
function readRawEntry(doc,
|
|
21698
|
-
const node = doc.getIn(
|
|
21761
|
+
function readRawEntry(doc, path73) {
|
|
21762
|
+
const node = doc.getIn(path73, false);
|
|
21699
21763
|
if (!(0, import_yaml.isMap)(node))
|
|
21700
21764
|
return {};
|
|
21701
21765
|
const raw = node.toJSON();
|
|
21702
21766
|
return typeof raw === "object" && raw !== null && !Array.isArray(raw) ? raw : {};
|
|
21703
21767
|
}
|
|
21704
|
-
function pruneEmpty(doc,
|
|
21705
|
-
const node = doc.getIn(
|
|
21768
|
+
function pruneEmpty(doc, path73) {
|
|
21769
|
+
const node = doc.getIn(path73);
|
|
21706
21770
|
if ((0, import_yaml.isMap)(node) && node.items.length === 0)
|
|
21707
|
-
doc.deleteIn(
|
|
21771
|
+
doc.deleteIn(path73);
|
|
21708
21772
|
}
|
|
21709
21773
|
function isNotFound(err) {
|
|
21710
21774
|
return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
|
|
21711
21775
|
}
|
|
21712
|
-
var import_yaml, configMutex;
|
|
21776
|
+
var import_yaml, configMutex, MODEL_DEFAULT_EFFORTS;
|
|
21713
21777
|
var init_user_config = __esm({
|
|
21714
21778
|
"../config/dist/user-config.js"() {
|
|
21715
21779
|
import_yaml = __toESM(require_dist());
|
|
21716
21780
|
init_plugins_tree_schema();
|
|
21717
21781
|
init_plugin_settings_schema();
|
|
21718
21782
|
configMutex = createMutex();
|
|
21783
|
+
MODEL_DEFAULT_EFFORTS = ["low", "medium", "high", "xhigh"];
|
|
21719
21784
|
}
|
|
21720
21785
|
});
|
|
21721
21786
|
function verifyPolicyBundle(bytes, signatureB64, publicKeyPem, expectedId) {
|
|
@@ -21771,7 +21836,7 @@ async function loadPolicyBundles(refs, opts = {}) {
|
|
|
21771
21836
|
const sources = [];
|
|
21772
21837
|
if (refs.length === 0)
|
|
21773
21838
|
return { allow, deny, sources };
|
|
21774
|
-
const cacheDir = opts.cacheDir ??
|
|
21839
|
+
const cacheDir = opts.cacheDir ?? moxxyPath("policy");
|
|
21775
21840
|
await promises.mkdir(cacheDir, { recursive: true, mode: 448 }).catch(() => void 0);
|
|
21776
21841
|
for (const ref of refs) {
|
|
21777
21842
|
const cachePath = cacheFileFor(cacheDir, ref.url);
|
|
@@ -21888,6 +21953,7 @@ __export(dist_exports2, {
|
|
|
21888
21953
|
loadConfig: () => loadConfig,
|
|
21889
21954
|
loadDisabledPackageNames: () => loadDisabledPackageNames,
|
|
21890
21955
|
loadDisabledProviders: () => loadDisabledProviders,
|
|
21956
|
+
loadModelDefaults: () => loadModelDefaults,
|
|
21891
21957
|
loadPolicyBundles: () => loadPolicyBundles,
|
|
21892
21958
|
loadProviderItems: () => loadProviderItems,
|
|
21893
21959
|
lockedKeysOf: () => lockedKeysOf,
|
|
@@ -21906,6 +21972,7 @@ __export(dist_exports2, {
|
|
|
21906
21972
|
setCategoryDefault: () => setCategoryDefault,
|
|
21907
21973
|
setCategoryItemConfig: () => setCategoryItemConfig,
|
|
21908
21974
|
setConfigValue: () => setConfigValue,
|
|
21975
|
+
setModelDefaults: () => setModelDefaults,
|
|
21909
21976
|
setPluginEnabled: () => setPluginEnabled,
|
|
21910
21977
|
setProviderEnabled: () => setProviderEnabled,
|
|
21911
21978
|
setProviderItemConfig: () => setProviderItemConfig,
|
|
@@ -22896,9 +22963,9 @@ function setupFieldVaultKey(packageName, field) {
|
|
|
22896
22963
|
return `${pkg}_${field.key}`.replace(/([a-z])([A-Z])/g, "$1_$2").toUpperCase();
|
|
22897
22964
|
}
|
|
22898
22965
|
async function applySetupValues(opts) {
|
|
22899
|
-
const writeConfig = opts.writeConfig ?? (async (
|
|
22966
|
+
const writeConfig = opts.writeConfig ?? (async (path73, value2) => {
|
|
22900
22967
|
const { setConfigValue: setConfigValue2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports2));
|
|
22901
|
-
await setConfigValue2({ scope: "user", cwd: opts.cwd, path:
|
|
22968
|
+
await setConfigValue2({ scope: "user", cwd: opts.cwd, path: path73, value: value2 });
|
|
22902
22969
|
});
|
|
22903
22970
|
const missing = [];
|
|
22904
22971
|
for (const field of opts.setup.fields) {
|
|
@@ -24264,6 +24331,18 @@ var init_dist6 = __esm({
|
|
|
24264
24331
|
}
|
|
24265
24332
|
});
|
|
24266
24333
|
|
|
24334
|
+
// src/setup/default-models.ts
|
|
24335
|
+
function configuredDefaultModels(config) {
|
|
24336
|
+
const items = config.plugins?.provider?.items ?? {};
|
|
24337
|
+
return Object.fromEntries(
|
|
24338
|
+
Object.entries(items).flatMap(([name, item]) => item?.model ? [[name, item.model]] : [])
|
|
24339
|
+
);
|
|
24340
|
+
}
|
|
24341
|
+
var init_default_models = __esm({
|
|
24342
|
+
"src/setup/default-models.ts"() {
|
|
24343
|
+
}
|
|
24344
|
+
});
|
|
24345
|
+
|
|
24267
24346
|
// src/config-applier.ts
|
|
24268
24347
|
function buildSessionConfigApplier(session, initial, builtins = [], disabledPackages) {
|
|
24269
24348
|
let last = initial;
|
|
@@ -24309,6 +24388,10 @@ function buildSessionConfigApplier(session, initial, builtins = [], disabledPack
|
|
|
24309
24388
|
session.lazyTools = next.context?.lazyTools;
|
|
24310
24389
|
applied2.push("lazyTools");
|
|
24311
24390
|
}
|
|
24391
|
+
if (next.context?.unfinishedStepCheck !== last.context?.unfinishedStepCheck) {
|
|
24392
|
+
session.unfinishedStepCheck = next.context?.unfinishedStepCheck;
|
|
24393
|
+
applied2.push("unfinishedStepCheck");
|
|
24394
|
+
}
|
|
24312
24395
|
if (!deepEqual(next.context?.reasoning, last.context?.reasoning)) {
|
|
24313
24396
|
session.reasoning = next.context?.reasoning;
|
|
24314
24397
|
applied2.push("reasoning");
|
|
@@ -24324,6 +24407,11 @@ function buildSessionConfigApplier(session, initial, builtins = [], disabledPack
|
|
|
24324
24407
|
if (next.hookTimeoutMs !== last.hookTimeoutMs) {
|
|
24325
24408
|
pending.push("hookTimeoutMs (restart required)");
|
|
24326
24409
|
}
|
|
24410
|
+
const defaultModels = configuredDefaultModels(next);
|
|
24411
|
+
if (!deepEqual(defaultModels, configuredDefaultModels(last))) {
|
|
24412
|
+
session.defaultModels = defaultModels;
|
|
24413
|
+
applied2.push("defaultModel");
|
|
24414
|
+
}
|
|
24327
24415
|
if (providerChanged(last, next)) {
|
|
24328
24416
|
pending.push("provider.* (restart required)");
|
|
24329
24417
|
}
|
|
@@ -24440,6 +24528,7 @@ function arraysEqual(a2, b3) {
|
|
|
24440
24528
|
var init_config_applier = __esm({
|
|
24441
24529
|
"src/config-applier.ts"() {
|
|
24442
24530
|
init_dist2();
|
|
24531
|
+
init_default_models();
|
|
24443
24532
|
}
|
|
24444
24533
|
});
|
|
24445
24534
|
|
|
@@ -24470,6 +24559,7 @@ function applyContextConfig(session, context) {
|
|
|
24470
24559
|
if (!context) return;
|
|
24471
24560
|
if (context.elision) session.elisionSettings = context.elision;
|
|
24472
24561
|
if (context.lazyTools !== void 0) session.lazyTools = context.lazyTools;
|
|
24562
|
+
if (context.unfinishedStepCheck !== void 0) session.unfinishedStepCheck = context.unfinishedStepCheck;
|
|
24473
24563
|
if (context.loopGuard) session.loopGuard = context.loopGuard;
|
|
24474
24564
|
if (context.reasoning) session.reasoning = context.reasoning;
|
|
24475
24565
|
if (context.fast !== void 0) session.fast = context.fast;
|
|
@@ -24606,10 +24696,10 @@ var init_apply_transcriber = __esm({
|
|
|
24606
24696
|
});
|
|
24607
24697
|
function interactiveConfigTrustPrompt() {
|
|
24608
24698
|
if (!process.stdin.isTTY || !process.stderr.isTTY) return void 0;
|
|
24609
|
-
return async ({ path:
|
|
24699
|
+
return async ({ path: path73, sha256: sha2563 }) => {
|
|
24610
24700
|
process.stderr.write(
|
|
24611
24701
|
"\n" + colors.bold("This project wants to run code before moxxy starts.") + `
|
|
24612
|
-
${
|
|
24702
|
+
${path73}
|
|
24613
24703
|
` + colors.dim(` sha256 ${sha2563.slice(0, 16)}\u2026
|
|
24614
24704
|
`) + colors.dim(" Review it before approving. Approval is remembered for this exact\n") + colors.dim(" content, so an edit will ask again.\n")
|
|
24615
24705
|
);
|
|
@@ -24686,9 +24776,16 @@ var init_embedder = __esm({
|
|
|
24686
24776
|
};
|
|
24687
24777
|
}
|
|
24688
24778
|
});
|
|
24779
|
+
function userPolicyPath() {
|
|
24780
|
+
return moxxyPath("permissions.json");
|
|
24781
|
+
}
|
|
24782
|
+
var init_user_policy_path = __esm({
|
|
24783
|
+
"src/setup/user-policy-path.ts"() {
|
|
24784
|
+
}
|
|
24785
|
+
});
|
|
24689
24786
|
async function buildSession(args) {
|
|
24690
|
-
const
|
|
24691
|
-
const permissionEngine = await PermissionEngine.load(
|
|
24787
|
+
const policyPath = args.config.permissions?.policyPath ?? userPolicyPath();
|
|
24788
|
+
const permissionEngine = await PermissionEngine.load(policyPath);
|
|
24692
24789
|
permissionEngine.setImmutableRules({
|
|
24693
24790
|
allow: [...args.config.permissions?.allow ?? [], ...args.bundledRules?.allow ?? []],
|
|
24694
24791
|
deny: [...args.config.permissions?.deny ?? [], ...args.bundledRules?.deny ?? []]
|
|
@@ -24746,6 +24843,7 @@ async function buildSession(args) {
|
|
|
24746
24843
|
}
|
|
24747
24844
|
var init_build_session = __esm({
|
|
24748
24845
|
"src/setup/build-session.ts"() {
|
|
24846
|
+
init_user_policy_path();
|
|
24749
24847
|
init_dist2();
|
|
24750
24848
|
}
|
|
24751
24849
|
});
|
|
@@ -26552,11 +26650,11 @@ function parseBody(body) {
|
|
|
26552
26650
|
return { ok: false, value: null };
|
|
26553
26651
|
}
|
|
26554
26652
|
}
|
|
26555
|
-
function readJsonPath(parsed,
|
|
26653
|
+
function readJsonPath(parsed, path73) {
|
|
26556
26654
|
if (!parsed.ok)
|
|
26557
26655
|
return null;
|
|
26558
26656
|
let cur = parsed.value;
|
|
26559
|
-
for (const seg of
|
|
26657
|
+
for (const seg of path73.split(".")) {
|
|
26560
26658
|
if (cur === null || cur === void 0 || typeof cur !== "object")
|
|
26561
26659
|
return null;
|
|
26562
26660
|
cur = cur[seg];
|
|
@@ -31005,10 +31103,10 @@ var init_dist8 = __esm({
|
|
|
31005
31103
|
function defaultIdentityPath() {
|
|
31006
31104
|
return moxxyPath("proxy-identity.key");
|
|
31007
31105
|
}
|
|
31008
|
-
async function loadOrCreateIdentity(
|
|
31106
|
+
async function loadOrCreateIdentity(path73 = defaultIdentityPath()) {
|
|
31009
31107
|
let hex = null;
|
|
31010
31108
|
try {
|
|
31011
|
-
hex = (await readFile(
|
|
31109
|
+
hex = (await readFile(path73, "utf8")).trim();
|
|
31012
31110
|
} catch (err) {
|
|
31013
31111
|
if (err.code !== "ENOENT")
|
|
31014
31112
|
throw err;
|
|
@@ -31023,7 +31121,7 @@ async function loadOrCreateIdentity(path77 = defaultIdentityPath()) {
|
|
|
31023
31121
|
}
|
|
31024
31122
|
}
|
|
31025
31123
|
const identity = generateIdentity();
|
|
31026
|
-
await writeFileAtomic(
|
|
31124
|
+
await writeFileAtomic(path73, bytesToHex(identity.secretKey), { mode: 384 });
|
|
31027
31125
|
return identity;
|
|
31028
31126
|
}
|
|
31029
31127
|
var init_node2 = __esm({
|
|
@@ -39516,7 +39614,7 @@ var DEFAULT_MODE_NAME, checkpoints;
|
|
|
39516
39614
|
var init_turn_iterator = __esm({
|
|
39517
39615
|
"../mode-default/dist/turn-iterator.js"() {
|
|
39518
39616
|
DEFAULT_MODE_NAME = "default";
|
|
39519
|
-
checkpoints = [unfinishedWorkCheckpoint()];
|
|
39617
|
+
checkpoints = [unfinishedWorkCheckpoint(), unfinishedStepCheckpoint()];
|
|
39520
39618
|
}
|
|
39521
39619
|
});
|
|
39522
39620
|
var defaultMode, defaultModePlugin;
|
|
@@ -40428,7 +40526,7 @@ function surfaceInputWithinCap(m3) {
|
|
|
40428
40526
|
var RUNNER_PROTOCOL_VERSION, MIN_COMPATIBLE_PROTOCOL_VERSION, RunnerMethod, RunnerNotification, attachmentSchema, principalSchema, attachParamsSchema, runTurnParamsSchema, abortParamsSchema, setResolverParamsSchema, modeSetActiveParamsSchema, sessionSetReasoningParamsSchema, sessionSetFastParamsSchema, MAX_HISTORY_PAGE_LIMIT, sessionLoadHistoryParamsSchema, MAX_RECORDED_EXCHANGE_CHARS, recordedText, sessionRecordExchangeParamsSchema, sessionSetAutoApproveParamsSchema, providerSetActiveParamsSchema, providerSetEnabledParamsSchema, providerConfigureParamsSchema, permissionAddAllowParamsSchema, commandRunParamsSchema, MAX_TRANSCRIBE_AUDIO_B64_BYTES, MAX_SYNTHESIZE_TEXT_BYTES, MEDIA_DESCRIPTOR_MAX, transcribeParamsSchema, synthesizeParamsSchema, cancelSynthesizeParamsSchema, mcpEnableAndAttachParamsSchema, mcpDetachParamsSchema, workflowSetEnabledParamsSchema, workflowRunParamsSchema, workflowValidateDraftParamsSchema, workflowSaveParamsSchema, workflowGetRunParamsSchema, workflowResumeParamsSchema, surfaceOpenParamsSchema, MAX_SURFACE_INPUT_BYTES, surfaceInputParamsSchema, surfaceResizeParamsSchema, surfaceCloseParamsSchema;
|
|
40429
40527
|
var init_protocol2 = __esm({
|
|
40430
40528
|
"../runner/dist/protocol.js"() {
|
|
40431
|
-
RUNNER_PROTOCOL_VERSION =
|
|
40529
|
+
RUNNER_PROTOCOL_VERSION = 25;
|
|
40432
40530
|
MIN_COMPATIBLE_PROTOCOL_VERSION = 1;
|
|
40433
40531
|
RunnerMethod = {
|
|
40434
40532
|
/** client->server: handshake; returns the initial info snapshot. */
|
|
@@ -42749,8 +42847,8 @@ var init_client = __esm({
|
|
|
42749
42847
|
peerFiles(agentId) {
|
|
42750
42848
|
return this.peer.request(CollabHubMethod.PeerFiles, { agentId });
|
|
42751
42849
|
}
|
|
42752
|
-
peerRead(agentId,
|
|
42753
|
-
return this.peer.request(CollabHubMethod.PeerRead, { agentId, path:
|
|
42850
|
+
peerRead(agentId, path73) {
|
|
42851
|
+
return this.peer.request(CollabHubMethod.PeerRead, { agentId, path: path73 });
|
|
42754
42852
|
}
|
|
42755
42853
|
peerDiff(agentId) {
|
|
42756
42854
|
return this.peer.request(CollabHubMethod.PeerDiff, { agentId });
|
|
@@ -43089,11 +43187,11 @@ var init_tools7 = __esm({
|
|
|
43089
43187
|
permission: { action: "allow" },
|
|
43090
43188
|
isolation: HUB_RPC_PEER_ISOLATION,
|
|
43091
43189
|
modes: COLLAB_AGENT_MODES,
|
|
43092
|
-
handler: async ({ agentId, path:
|
|
43190
|
+
handler: async ({ agentId, path: path73 }) => {
|
|
43093
43191
|
const c3 = await getProcessHubClient();
|
|
43094
43192
|
if (!c3)
|
|
43095
43193
|
return NOT_IN_COLLAB;
|
|
43096
|
-
return c3.peerRead(agentId,
|
|
43194
|
+
return c3.peerRead(agentId, path73);
|
|
43097
43195
|
}
|
|
43098
43196
|
});
|
|
43099
43197
|
collabPeerDiff = defineTool({
|
|
@@ -44137,14 +44235,14 @@ var init_summarize = __esm({
|
|
|
44137
44235
|
Use terse bullet points. Do NOT restate the raw conversation, do NOT invent details, omit chit-chat and pleasantries. Output ONLY the brief text \u2014 no preamble, no sign-off. Keep it well under 400 words.`;
|
|
44138
44236
|
}
|
|
44139
44237
|
});
|
|
44140
|
-
function
|
|
44238
|
+
function moxxyHome3() {
|
|
44141
44239
|
return process.env.MOXXY_HOME ?? join(homedir(), ".moxxy");
|
|
44142
44240
|
}
|
|
44143
44241
|
function collabLockPath() {
|
|
44144
|
-
return process.env.MOXXY_COLLAB_LOCK || join(
|
|
44242
|
+
return process.env.MOXXY_COLLAB_LOCK || join(moxxyHome3(), "collab", "active.lock");
|
|
44145
44243
|
}
|
|
44146
44244
|
function collabRunsDir() {
|
|
44147
|
-
return join(
|
|
44245
|
+
return join(moxxyHome3(), "collab", "runs");
|
|
44148
44246
|
}
|
|
44149
44247
|
function parseCollabLock(raw) {
|
|
44150
44248
|
let info;
|
|
@@ -44317,8 +44415,8 @@ async function addWorktree(args) {
|
|
|
44317
44415
|
if (r2.code !== 0)
|
|
44318
44416
|
throw new Error(`git worktree add failed: ${r2.stderr.trim() || r2.stdout.trim()}`);
|
|
44319
44417
|
}
|
|
44320
|
-
async function removeWorktree(repoCwd,
|
|
44321
|
-
await git(repoCwd, ["worktree", "remove", "--force",
|
|
44418
|
+
async function removeWorktree(repoCwd, path73) {
|
|
44419
|
+
await git(repoCwd, ["worktree", "remove", "--force", path73]);
|
|
44322
44420
|
await git(repoCwd, ["worktree", "prune"]);
|
|
44323
44421
|
}
|
|
44324
44422
|
async function commitAll(worktreeCwd, message) {
|
|
@@ -44339,9 +44437,9 @@ async function changedFiles(worktreeCwd) {
|
|
|
44339
44437
|
if (!rec)
|
|
44340
44438
|
continue;
|
|
44341
44439
|
const status = rec.slice(0, 2).trim();
|
|
44342
|
-
const
|
|
44343
|
-
if (
|
|
44344
|
-
out.push({ status, path:
|
|
44440
|
+
const path73 = rec.slice(3);
|
|
44441
|
+
if (path73)
|
|
44442
|
+
out.push({ status, path: path73 });
|
|
44345
44443
|
if (status.startsWith("R") || status.startsWith("C"))
|
|
44346
44444
|
i2++;
|
|
44347
44445
|
}
|
|
@@ -44435,9 +44533,9 @@ function peerReaderFor(worktrees, baseSha) {
|
|
|
44435
44533
|
async files(agentId) {
|
|
44436
44534
|
return changedFiles(dirFor(agentId));
|
|
44437
44535
|
},
|
|
44438
|
-
async read(agentId,
|
|
44536
|
+
async read(agentId, path73) {
|
|
44439
44537
|
const dir = dirFor(agentId);
|
|
44440
|
-
return readFile(await resolveWithinReal(dir,
|
|
44538
|
+
return readFile(await resolveWithinReal(dir, path73), "utf8");
|
|
44441
44539
|
},
|
|
44442
44540
|
async diff(agentId) {
|
|
44443
44541
|
return diffVsBase(dirFor(agentId), baseSha);
|
|
@@ -44449,8 +44547,8 @@ function cwdPeerReader(cwd2) {
|
|
|
44449
44547
|
async files() {
|
|
44450
44548
|
return await isGitRepo(cwd2) ? changedFiles(cwd2) : [];
|
|
44451
44549
|
},
|
|
44452
|
-
async read(_agentId,
|
|
44453
|
-
return readFile(await resolveWithinReal(cwd2,
|
|
44550
|
+
async read(_agentId, path73) {
|
|
44551
|
+
return readFile(await resolveWithinReal(cwd2, path73), "utf8");
|
|
44454
44552
|
},
|
|
44455
44553
|
async diff() {
|
|
44456
44554
|
return "";
|
|
@@ -44695,8 +44793,8 @@ function readActiveCollab() {
|
|
|
44695
44793
|
return info;
|
|
44696
44794
|
}
|
|
44697
44795
|
function tryAcquireCollabLock(args) {
|
|
44698
|
-
const
|
|
44699
|
-
mkdirSync(dirname(
|
|
44796
|
+
const path73 = collabLockPath();
|
|
44797
|
+
mkdirSync(dirname(path73), { recursive: true });
|
|
44700
44798
|
const info = {
|
|
44701
44799
|
pid: process.pid,
|
|
44702
44800
|
sessionId: args.sessionId,
|
|
@@ -44707,7 +44805,7 @@ function tryAcquireCollabLock(args) {
|
|
|
44707
44805
|
const payload2 = JSON.stringify(info);
|
|
44708
44806
|
for (let attempt = 0; attempt < 5; attempt++) {
|
|
44709
44807
|
try {
|
|
44710
|
-
const fd = openSync(
|
|
44808
|
+
const fd = openSync(path73, "wx");
|
|
44711
44809
|
try {
|
|
44712
44810
|
writeFileSync(fd, payload2);
|
|
44713
44811
|
} finally {
|
|
@@ -44722,7 +44820,7 @@ function tryAcquireCollabLock(args) {
|
|
|
44722
44820
|
return { ok: false, holder: existing };
|
|
44723
44821
|
}
|
|
44724
44822
|
try {
|
|
44725
|
-
unlinkSync(
|
|
44823
|
+
unlinkSync(path73);
|
|
44726
44824
|
} catch {
|
|
44727
44825
|
}
|
|
44728
44826
|
}
|
|
@@ -45077,11 +45175,11 @@ function lastUserPromptText(ctx) {
|
|
|
45077
45175
|
}
|
|
45078
45176
|
return void 0;
|
|
45079
45177
|
}
|
|
45080
|
-
function readRoster(
|
|
45081
|
-
if (!existsSync(
|
|
45178
|
+
function readRoster(path73, maxAgents) {
|
|
45179
|
+
if (!existsSync(path73))
|
|
45082
45180
|
return [];
|
|
45083
45181
|
try {
|
|
45084
|
-
const raw = JSON.parse(readFileSync(
|
|
45182
|
+
const raw = JSON.parse(readFileSync(path73, "utf8"));
|
|
45085
45183
|
if (!Array.isArray(raw))
|
|
45086
45184
|
return [];
|
|
45087
45185
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -45561,11 +45659,11 @@ var init_agent_loop = __esm({
|
|
|
45561
45659
|
}
|
|
45562
45660
|
});
|
|
45563
45661
|
function peerSystemPrompt(env3) {
|
|
45564
|
-
const
|
|
45565
|
-
if (!
|
|
45662
|
+
const path73 = env3[COLLAB_ENV.CharterFile]?.trim();
|
|
45663
|
+
if (!path73)
|
|
45566
45664
|
return COLLAB_PEER_PROMPT;
|
|
45567
45665
|
try {
|
|
45568
|
-
return peerPromptWithCharter(readFileSync(
|
|
45666
|
+
return peerPromptWithCharter(readFileSync(path73, "utf8"));
|
|
45569
45667
|
} catch {
|
|
45570
45668
|
return COLLAB_PEER_PROMPT;
|
|
45571
45669
|
}
|
|
@@ -70980,10 +71078,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
70980
71078
|
var setErrorHandler = null;
|
|
70981
71079
|
var setSuspenseHandler = null;
|
|
70982
71080
|
{
|
|
70983
|
-
var copyWithDeleteImpl = function(obj,
|
|
70984
|
-
var key =
|
|
71081
|
+
var copyWithDeleteImpl = function(obj, path73, index2) {
|
|
71082
|
+
var key = path73[index2];
|
|
70985
71083
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
70986
|
-
if (index2 + 1 ===
|
|
71084
|
+
if (index2 + 1 === path73.length) {
|
|
70987
71085
|
if (isArray(updated)) {
|
|
70988
71086
|
updated.splice(key, 1);
|
|
70989
71087
|
} else {
|
|
@@ -70991,11 +71089,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
70991
71089
|
}
|
|
70992
71090
|
return updated;
|
|
70993
71091
|
}
|
|
70994
|
-
updated[key] = copyWithDeleteImpl(obj[key],
|
|
71092
|
+
updated[key] = copyWithDeleteImpl(obj[key], path73, index2 + 1);
|
|
70995
71093
|
return updated;
|
|
70996
71094
|
};
|
|
70997
|
-
var copyWithDelete = function(obj,
|
|
70998
|
-
return copyWithDeleteImpl(obj,
|
|
71095
|
+
var copyWithDelete = function(obj, path73) {
|
|
71096
|
+
return copyWithDeleteImpl(obj, path73, 0);
|
|
70999
71097
|
};
|
|
71000
71098
|
var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
|
|
71001
71099
|
var oldKey = oldPath[index2];
|
|
@@ -71033,17 +71131,17 @@ var require_react_reconciler_development = __commonJS({
|
|
|
71033
71131
|
}
|
|
71034
71132
|
return copyWithRenameImpl(obj, oldPath, newPath, 0);
|
|
71035
71133
|
};
|
|
71036
|
-
var copyWithSetImpl = function(obj,
|
|
71037
|
-
if (index2 >=
|
|
71134
|
+
var copyWithSetImpl = function(obj, path73, index2, value2) {
|
|
71135
|
+
if (index2 >= path73.length) {
|
|
71038
71136
|
return value2;
|
|
71039
71137
|
}
|
|
71040
|
-
var key =
|
|
71138
|
+
var key = path73[index2];
|
|
71041
71139
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
71042
|
-
updated[key] = copyWithSetImpl(obj[key],
|
|
71140
|
+
updated[key] = copyWithSetImpl(obj[key], path73, index2 + 1, value2);
|
|
71043
71141
|
return updated;
|
|
71044
71142
|
};
|
|
71045
|
-
var copyWithSet = function(obj,
|
|
71046
|
-
return copyWithSetImpl(obj,
|
|
71143
|
+
var copyWithSet = function(obj, path73, value2) {
|
|
71144
|
+
return copyWithSetImpl(obj, path73, 0, value2);
|
|
71047
71145
|
};
|
|
71048
71146
|
var findHook = function(fiber, id) {
|
|
71049
71147
|
var currentHook2 = fiber.memoizedState;
|
|
@@ -71053,10 +71151,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
71053
71151
|
}
|
|
71054
71152
|
return currentHook2;
|
|
71055
71153
|
};
|
|
71056
|
-
overrideHookState = function(fiber, id,
|
|
71154
|
+
overrideHookState = function(fiber, id, path73, value2) {
|
|
71057
71155
|
var hook = findHook(fiber, id);
|
|
71058
71156
|
if (hook !== null) {
|
|
71059
|
-
var newState = copyWithSet(hook.memoizedState,
|
|
71157
|
+
var newState = copyWithSet(hook.memoizedState, path73, value2);
|
|
71060
71158
|
hook.memoizedState = newState;
|
|
71061
71159
|
hook.baseState = newState;
|
|
71062
71160
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
@@ -71066,10 +71164,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
71066
71164
|
}
|
|
71067
71165
|
}
|
|
71068
71166
|
};
|
|
71069
|
-
overrideHookStateDeletePath = function(fiber, id,
|
|
71167
|
+
overrideHookStateDeletePath = function(fiber, id, path73) {
|
|
71070
71168
|
var hook = findHook(fiber, id);
|
|
71071
71169
|
if (hook !== null) {
|
|
71072
|
-
var newState = copyWithDelete(hook.memoizedState,
|
|
71170
|
+
var newState = copyWithDelete(hook.memoizedState, path73);
|
|
71073
71171
|
hook.memoizedState = newState;
|
|
71074
71172
|
hook.baseState = newState;
|
|
71075
71173
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
@@ -71092,8 +71190,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
71092
71190
|
}
|
|
71093
71191
|
}
|
|
71094
71192
|
};
|
|
71095
|
-
overrideProps = function(fiber,
|
|
71096
|
-
fiber.pendingProps = copyWithSet(fiber.memoizedProps,
|
|
71193
|
+
overrideProps = function(fiber, path73, value2) {
|
|
71194
|
+
fiber.pendingProps = copyWithSet(fiber.memoizedProps, path73, value2);
|
|
71097
71195
|
if (fiber.alternate) {
|
|
71098
71196
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
71099
71197
|
}
|
|
@@ -71102,8 +71200,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
71102
71200
|
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
|
|
71103
71201
|
}
|
|
71104
71202
|
};
|
|
71105
|
-
overridePropsDeletePath = function(fiber,
|
|
71106
|
-
fiber.pendingProps = copyWithDelete(fiber.memoizedProps,
|
|
71203
|
+
overridePropsDeletePath = function(fiber, path73) {
|
|
71204
|
+
fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path73);
|
|
71107
71205
|
if (fiber.alternate) {
|
|
71108
71206
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
71109
71207
|
}
|
|
@@ -78608,8 +78706,8 @@ var init_ErrorOverview = __esm({
|
|
|
78608
78706
|
init_dist26();
|
|
78609
78707
|
init_Box();
|
|
78610
78708
|
init_Text();
|
|
78611
|
-
cleanupPath = (
|
|
78612
|
-
return
|
|
78709
|
+
cleanupPath = (path73) => {
|
|
78710
|
+
return path73?.replace(`file://${cwd()}/`, "");
|
|
78613
78711
|
};
|
|
78614
78712
|
stackUtils = new import_stack_utils.default({
|
|
78615
78713
|
cwd: cwd(),
|
|
@@ -89472,7 +89570,7 @@ var init_PermissionEditor = __esm({
|
|
|
89472
89570
|
import_react72 = __toESM(require_react());
|
|
89473
89571
|
await init_build2();
|
|
89474
89572
|
init_dist2();
|
|
89475
|
-
PermissionEditor = ({ policyPath
|
|
89573
|
+
PermissionEditor = ({ policyPath }) => {
|
|
89476
89574
|
const { exit } = use_app_default();
|
|
89477
89575
|
const [engine, setEngine] = (0, import_react72.useState)(null);
|
|
89478
89576
|
const [rows, setRows] = (0, import_react72.useState)([]);
|
|
@@ -89483,7 +89581,7 @@ var init_PermissionEditor = __esm({
|
|
|
89483
89581
|
(0, import_react72.useEffect)(() => {
|
|
89484
89582
|
let cancelled = false;
|
|
89485
89583
|
(async () => {
|
|
89486
|
-
const e = await PermissionEngine.load(
|
|
89584
|
+
const e = await PermissionEngine.load(policyPath);
|
|
89487
89585
|
if (cancelled)
|
|
89488
89586
|
return;
|
|
89489
89587
|
setEngine(e);
|
|
@@ -89492,7 +89590,7 @@ var init_PermissionEditor = __esm({
|
|
|
89492
89590
|
return () => {
|
|
89493
89591
|
cancelled = true;
|
|
89494
89592
|
};
|
|
89495
|
-
}, [
|
|
89593
|
+
}, [policyPath]);
|
|
89496
89594
|
const refresh = (e) => {
|
|
89497
89595
|
const next = toRows(e);
|
|
89498
89596
|
setRows(next);
|
|
@@ -89607,7 +89705,7 @@ var init_PermissionEditor = __esm({
|
|
|
89607
89705
|
exit();
|
|
89608
89706
|
}
|
|
89609
89707
|
});
|
|
89610
|
-
return (0, import_jsx_runtime42.jsxs)(Box_default, { flexDirection: "column", padding: 1, children: [(0, import_jsx_runtime42.jsxs)(Box_default, { marginBottom: 1, children: [(0, import_jsx_runtime42.jsx)(Text, { bold: true, color: "magenta", children: "moxxy perms editor" }), (0, import_jsx_runtime42.jsxs)(Text, { dimColor: true, children: [" (",
|
|
89708
|
+
return (0, import_jsx_runtime42.jsxs)(Box_default, { flexDirection: "column", padding: 1, children: [(0, import_jsx_runtime42.jsxs)(Box_default, { marginBottom: 1, children: [(0, import_jsx_runtime42.jsx)(Text, { bold: true, color: "magenta", children: "moxxy perms editor" }), (0, import_jsx_runtime42.jsxs)(Text, { dimColor: true, children: [" (", policyPath, ")"] })] }), rows.length === 0 ? (0, import_jsx_runtime42.jsx)(Text, { dimColor: true, children: "(no rules \u2014 press `a` to add an allow rule, `D` for deny)" }) : rows.map((row, i2) => {
|
|
89611
89709
|
const focused = i2 === cursor3;
|
|
89612
89710
|
return (0, import_jsx_runtime42.jsxs)(Box_default, { children: [(0, import_jsx_runtime42.jsx)(Text, { color: focused ? "cyan" : void 0, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime42.jsx)(Text, { color: row.kind === "allow" ? "green" : "red", children: row.kind.padEnd(5) }), (0, import_jsx_runtime42.jsxs)(Text, { children: [" ", row.name] }), row.reason ? (0, import_jsx_runtime42.jsxs)(Text, { dimColor: true, children: [" \u2014 ", row.reason] }) : null] }, `${row.kind}:${row.name}:${i2}`);
|
|
89613
89711
|
}), (0, import_jsx_runtime42.jsx)(Box_default, { marginTop: 1, children: mode.kind === "add" ? (0, import_jsx_runtime42.jsxs)(Text, { children: ["new ", mode.bucket, " rule: ", (0, import_jsx_runtime42.jsx)(Text, { color: "cyan", children: mode.buffer }), (0, import_jsx_runtime42.jsx)(Text, { dimColor: true, children: " (enter to confirm, esc to cancel)" })] }) : mode.kind === "confirm-delete" ? (0, import_jsx_runtime42.jsxs)(Text, { color: "yellow", children: ["delete `", mode.row.name, "` (", mode.row.kind, ")? [y/N]"] }) : mode.kind === "message" ? (0, import_jsx_runtime42.jsxs)(Text, { color: /FAILED/i.test(mode.text) ? "red" : "green", children: [mode.text, " (press any key)"] }) : (0, import_jsx_runtime42.jsxs)(Text, { dimColor: true, children: ["\u2191/\u2193 move \xB7 space/enter flip \xB7 a add allow \xB7 D add deny \xB7 d delete \xB7 q quit", dirty || /FAILED/i.test(status) ? (0, import_jsx_runtime42.jsx)(Text, { color: /FAILED/i.test(status) ? "red" : "green", children: ` \xB7 ${status}` }) : null] }) })] });
|
|
@@ -90210,6 +90308,7 @@ var init_validation = __esm({
|
|
|
90210
90308
|
"app.updatePlan": z.undefined(),
|
|
90211
90309
|
"app.setup": z.undefined(),
|
|
90212
90310
|
"app.relaunch": z.undefined(),
|
|
90311
|
+
"app.revertUpdate": z.undefined(),
|
|
90213
90312
|
"app.appBooted": z.undefined(),
|
|
90214
90313
|
"app.updateDiagnostics": z.undefined(),
|
|
90215
90314
|
// Optional offline voice installation spawns the CLI and changes the active
|
|
@@ -90447,6 +90546,12 @@ var init_validation = __esm({
|
|
|
90447
90546
|
effort: z.enum(["off", "low", "medium", "high", "xhigh"])
|
|
90448
90547
|
}),
|
|
90449
90548
|
"settings.setFast": z.object({ workspaceId: optionalWorkspace, enabled: z.boolean() }),
|
|
90549
|
+
// Written into the config file: a provider name that cannot leave its key, and a model id of sane length.
|
|
90550
|
+
"settings.setModelDefaults": z.object({
|
|
90551
|
+
model: z.object({ provider: providerName, model: z.string().min(1).max(256) }).strict().optional(),
|
|
90552
|
+
effort: z.enum(["off", "low", "medium", "high", "xhigh"]).optional(),
|
|
90553
|
+
fast: z.boolean().optional()
|
|
90554
|
+
}).strict().refine((change) => Object.keys(change).length > 0, "nothing to change"),
|
|
90450
90555
|
"settings.writeSkill": z.object({ name: skillName, body: z.string().max(1e6) }),
|
|
90451
90556
|
"settings.readSkill": z.object({ name: skillName }),
|
|
90452
90557
|
"settings.deleteSkill": z.object({ name: skillName }),
|
|
@@ -91705,8 +91810,8 @@ function buildConnectUrl(opts) {
|
|
|
91705
91810
|
if (opts.tunnelUrl) {
|
|
91706
91811
|
const u5 = new URL(opts.tunnelUrl);
|
|
91707
91812
|
const scheme = u5.protocol === "https:" ? "wss" : "ws";
|
|
91708
|
-
const
|
|
91709
|
-
return `${scheme}://${u5.host}${
|
|
91813
|
+
const path73 = u5.pathname === "/" ? "/" : `${u5.pathname.replace(/\/$/, "")}/`;
|
|
91814
|
+
return `${scheme}://${u5.host}${path73}?t=${t2}${fp}`;
|
|
91710
91815
|
}
|
|
91711
91816
|
return `ws://${opts.localHost}:${opts.port}/?t=${t2}${fp}`;
|
|
91712
91817
|
}
|
|
@@ -93449,10 +93554,10 @@ var require_segments = __commonJS({
|
|
|
93449
93554
|
const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
|
|
93450
93555
|
const nodes = buildNodes(segs);
|
|
93451
93556
|
const graph = buildGraph(nodes, version);
|
|
93452
|
-
const
|
|
93557
|
+
const path73 = dijkstra.find_path(graph.map, "start", "end");
|
|
93453
93558
|
const optimizedSegs = [];
|
|
93454
|
-
for (let i2 = 1; i2 <
|
|
93455
|
-
optimizedSegs.push(graph.table[
|
|
93559
|
+
for (let i2 = 1; i2 < path73.length - 1; i2++) {
|
|
93560
|
+
optimizedSegs.push(graph.table[path73[i2]].node);
|
|
93456
93561
|
}
|
|
93457
93562
|
return exports.fromArray(mergeSegments(optimizedSegs));
|
|
93458
93563
|
};
|
|
@@ -95904,7 +96009,7 @@ var require_png2 = __commonJS({
|
|
|
95904
96009
|
});
|
|
95905
96010
|
png.pack();
|
|
95906
96011
|
};
|
|
95907
|
-
exports.renderToFile = function renderToFile(
|
|
96012
|
+
exports.renderToFile = function renderToFile(path73, qrData, options, cb) {
|
|
95908
96013
|
if (typeof cb === "undefined") {
|
|
95909
96014
|
cb = options;
|
|
95910
96015
|
options = void 0;
|
|
@@ -95915,7 +96020,7 @@ var require_png2 = __commonJS({
|
|
|
95915
96020
|
called = true;
|
|
95916
96021
|
cb.apply(null, args);
|
|
95917
96022
|
};
|
|
95918
|
-
const stream2 = fs52.createWriteStream(
|
|
96023
|
+
const stream2 = fs52.createWriteStream(path73);
|
|
95919
96024
|
stream2.on("error", done);
|
|
95920
96025
|
stream2.on("close", done);
|
|
95921
96026
|
exports.renderToFileStream(stream2, qrData, options);
|
|
@@ -95977,14 +96082,14 @@ var require_utf8 = __commonJS({
|
|
|
95977
96082
|
}
|
|
95978
96083
|
return output;
|
|
95979
96084
|
};
|
|
95980
|
-
exports.renderToFile = function renderToFile(
|
|
96085
|
+
exports.renderToFile = function renderToFile(path73, qrData, options, cb) {
|
|
95981
96086
|
if (typeof cb === "undefined") {
|
|
95982
96087
|
cb = options;
|
|
95983
96088
|
options = void 0;
|
|
95984
96089
|
}
|
|
95985
96090
|
const fs52 = __require("fs");
|
|
95986
96091
|
const utf82 = exports.render(qrData, options);
|
|
95987
|
-
fs52.writeFile(
|
|
96092
|
+
fs52.writeFile(path73, utf82, cb);
|
|
95988
96093
|
};
|
|
95989
96094
|
}
|
|
95990
96095
|
});
|
|
@@ -96105,7 +96210,7 @@ var require_svg_tag = __commonJS({
|
|
|
96105
96210
|
return str;
|
|
96106
96211
|
}
|
|
96107
96212
|
function qrToPath(data, size, margin) {
|
|
96108
|
-
let
|
|
96213
|
+
let path73 = "";
|
|
96109
96214
|
let moveBy = 0;
|
|
96110
96215
|
let newRow = false;
|
|
96111
96216
|
let lineLength = 0;
|
|
@@ -96116,19 +96221,19 @@ var require_svg_tag = __commonJS({
|
|
|
96116
96221
|
if (data[i2]) {
|
|
96117
96222
|
lineLength++;
|
|
96118
96223
|
if (!(i2 > 0 && col > 0 && data[i2 - 1])) {
|
|
96119
|
-
|
|
96224
|
+
path73 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
|
|
96120
96225
|
moveBy = 0;
|
|
96121
96226
|
newRow = false;
|
|
96122
96227
|
}
|
|
96123
96228
|
if (!(col + 1 < size && data[i2 + 1])) {
|
|
96124
|
-
|
|
96229
|
+
path73 += svgCmd("h", lineLength);
|
|
96125
96230
|
lineLength = 0;
|
|
96126
96231
|
}
|
|
96127
96232
|
} else {
|
|
96128
96233
|
moveBy++;
|
|
96129
96234
|
}
|
|
96130
96235
|
}
|
|
96131
|
-
return
|
|
96236
|
+
return path73;
|
|
96132
96237
|
}
|
|
96133
96238
|
exports.render = function render4(qrData, options, cb) {
|
|
96134
96239
|
const opts = Utils.getOptions(options);
|
|
@@ -96136,10 +96241,10 @@ var require_svg_tag = __commonJS({
|
|
|
96136
96241
|
const data = qrData.modules.data;
|
|
96137
96242
|
const qrcodesize = size + opts.margin * 2;
|
|
96138
96243
|
const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>';
|
|
96139
|
-
const
|
|
96244
|
+
const path73 = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
|
|
96140
96245
|
const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"';
|
|
96141
96246
|
const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" ';
|
|
96142
|
-
const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg +
|
|
96247
|
+
const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path73 + "</svg>\n";
|
|
96143
96248
|
if (typeof cb === "function") {
|
|
96144
96249
|
cb(null, svgTag);
|
|
96145
96250
|
}
|
|
@@ -96153,7 +96258,7 @@ var require_svg = __commonJS({
|
|
|
96153
96258
|
"../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg.js"(exports) {
|
|
96154
96259
|
var svgTagRenderer = require_svg_tag();
|
|
96155
96260
|
exports.render = svgTagRenderer.render;
|
|
96156
|
-
exports.renderToFile = function renderToFile(
|
|
96261
|
+
exports.renderToFile = function renderToFile(path73, qrData, options, cb) {
|
|
96157
96262
|
if (typeof cb === "undefined") {
|
|
96158
96263
|
cb = options;
|
|
96159
96264
|
options = void 0;
|
|
@@ -96161,7 +96266,7 @@ var require_svg = __commonJS({
|
|
|
96161
96266
|
const fs52 = __require("fs");
|
|
96162
96267
|
const svgTag = exports.render(qrData, options);
|
|
96163
96268
|
const xmlStr = '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">' + svgTag;
|
|
96164
|
-
fs52.writeFile(
|
|
96269
|
+
fs52.writeFile(path73, xmlStr, cb);
|
|
96165
96270
|
};
|
|
96166
96271
|
}
|
|
96167
96272
|
});
|
|
@@ -96319,8 +96424,8 @@ var require_server = __commonJS({
|
|
|
96319
96424
|
cb
|
|
96320
96425
|
};
|
|
96321
96426
|
}
|
|
96322
|
-
function getTypeFromFilename(
|
|
96323
|
-
return
|
|
96427
|
+
function getTypeFromFilename(path73) {
|
|
96428
|
+
return path73.slice((path73.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
|
|
96324
96429
|
}
|
|
96325
96430
|
function getRendererFromType(type) {
|
|
96326
96431
|
switch (type) {
|
|
@@ -96384,17 +96489,17 @@ var require_server = __commonJS({
|
|
|
96384
96489
|
const renderer2 = getRendererFromType(params.opts.type);
|
|
96385
96490
|
return render4(renderer2.renderToBuffer, text3, params);
|
|
96386
96491
|
};
|
|
96387
|
-
exports.toFile = function toFile(
|
|
96388
|
-
if (typeof
|
|
96492
|
+
exports.toFile = function toFile(path73, text3, opts, cb) {
|
|
96493
|
+
if (typeof path73 !== "string" || !(typeof text3 === "string" || typeof text3 === "object")) {
|
|
96389
96494
|
throw new Error("Invalid argument");
|
|
96390
96495
|
}
|
|
96391
96496
|
if (arguments.length < 3 && !canPromise()) {
|
|
96392
96497
|
throw new Error("Too few arguments provided");
|
|
96393
96498
|
}
|
|
96394
96499
|
const params = checkParams(text3, opts, cb);
|
|
96395
|
-
const type = params.opts.type || getTypeFromFilename(
|
|
96500
|
+
const type = params.opts.type || getTypeFromFilename(path73);
|
|
96396
96501
|
const renderer2 = getRendererFromType(type);
|
|
96397
|
-
const renderToFile = renderer2.renderToFile.bind(null,
|
|
96502
|
+
const renderToFile = renderer2.renderToFile.bind(null, path73);
|
|
96398
96503
|
return render4(renderToFile, text3, params);
|
|
96399
96504
|
};
|
|
96400
96505
|
exports.toFileStream = function toFileStream(stream2, text3, opts) {
|
|
@@ -97501,8 +97606,8 @@ function formatIssues(error, raw) {
|
|
|
97501
97606
|
const field = rest.join(".");
|
|
97502
97607
|
return field ? `${where}: ${field} ${msg}` : `${where} ${msg}`;
|
|
97503
97608
|
}
|
|
97504
|
-
const
|
|
97505
|
-
return
|
|
97609
|
+
const path73 = iss.path.join(".");
|
|
97610
|
+
return path73 ? `${path73} ${msg}` : `workflow ${msg}`;
|
|
97506
97611
|
});
|
|
97507
97612
|
}
|
|
97508
97613
|
function validateWorkflow(raw) {
|
|
@@ -97872,7 +97977,7 @@ var init_schema2 = __esm({
|
|
|
97872
97977
|
}
|
|
97873
97978
|
});
|
|
97874
97979
|
function defaultUserWorkflowsDir() {
|
|
97875
|
-
return
|
|
97980
|
+
return moxxyPath("workflows");
|
|
97876
97981
|
}
|
|
97877
97982
|
function defaultProjectWorkflowsDir(cwd2) {
|
|
97878
97983
|
return path3.join(cwd2, ".moxxy", "workflows");
|
|
@@ -100180,7 +100285,8 @@ function buildWorkflowRunner(args) {
|
|
|
100180
100285
|
return { runNow, resumeNow };
|
|
100181
100286
|
}
|
|
100182
100287
|
function activeModel(session) {
|
|
100183
|
-
|
|
100288
|
+
const provider = safeActiveProvider(session);
|
|
100289
|
+
return (provider ? resolveTurnModel(session, provider) : session.lastResolvedModel) ?? "default";
|
|
100184
100290
|
}
|
|
100185
100291
|
function safeActiveProvider(session) {
|
|
100186
100292
|
try {
|
|
@@ -103109,7 +103215,7 @@ __export(dist_exports4, {
|
|
|
103109
103215
|
note: () => note,
|
|
103110
103216
|
outro: () => outro,
|
|
103111
103217
|
password: () => password,
|
|
103112
|
-
path: () =>
|
|
103218
|
+
path: () => path58,
|
|
103113
103219
|
progress: () => progress,
|
|
103114
103220
|
select: () => select,
|
|
103115
103221
|
selectKey: () => selectKey,
|
|
@@ -103208,7 +103314,7 @@ function progress({
|
|
|
103208
103314
|
message: (t2) => g2(0, t2)
|
|
103209
103315
|
};
|
|
103210
103316
|
}
|
|
103211
|
-
var import_sisteransi2, unicode, isCI, isTTY, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, autocomplete, autocompleteMultiselect, K, Q, U2, box, confirm, date, p2, group, MULTISELECT_INSTRUCTIONS, m2, multiselect, groupMultiselect, log, cancel, intro, outro, multiline, W$1, C2, note, password,
|
|
103317
|
+
var import_sisteransi2, unicode, isCI, isTTY, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, autocomplete, autocompleteMultiselect, K, Q, U2, box, confirm, date, p2, group, MULTISELECT_INSTRUCTIONS, m2, multiselect, groupMultiselect, log, cancel, intro, outro, multiline, W$1, C2, note, password, path58, W, spinner, u4, SELECT_INSTRUCTIONS, c2, select, selectKey, i, stream, tasks, A, taskLog, text2;
|
|
103212
103318
|
var init_dist39 = __esm({
|
|
103213
103319
|
"../../node_modules/.pnpm/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
103214
103320
|
init_dist38();
|
|
@@ -104089,7 +104195,7 @@ ${n3}
|
|
|
104089
104195
|
}
|
|
104090
104196
|
}
|
|
104091
104197
|
}).prompt();
|
|
104092
|
-
|
|
104198
|
+
path58 = (e) => {
|
|
104093
104199
|
const a2 = e.validate;
|
|
104094
104200
|
return autocomplete({
|
|
104095
104201
|
...e,
|
|
@@ -105088,6 +105194,7 @@ async function setupSessionWithConfig(opts) {
|
|
|
105088
105194
|
applyPluginsTree(session, config, logger);
|
|
105089
105195
|
assertCriticalFloors(session);
|
|
105090
105196
|
applyContextConfig(session, config.context);
|
|
105197
|
+
session.defaultModels = configuredDefaultModels(config);
|
|
105091
105198
|
await applySessionHeaderPreferences(session, opts.sessionId, credentialResolver, logger);
|
|
105092
105199
|
progress2({ kind: "prefs-applied" });
|
|
105093
105200
|
const discovered = await discoverSkills({
|
|
@@ -105148,6 +105255,7 @@ var init_setup = __esm({
|
|
|
105148
105255
|
init_load_config();
|
|
105149
105256
|
init_egress();
|
|
105150
105257
|
init_context_config();
|
|
105258
|
+
init_default_models();
|
|
105151
105259
|
init_secrets();
|
|
105152
105260
|
init_apply_transcriber();
|
|
105153
105261
|
init_config_trust_prompt();
|
|
@@ -106775,11 +106883,11 @@ function servicePlatform() {
|
|
|
106775
106883
|
if (process.platform === "linux") return "linux";
|
|
106776
106884
|
return "unsupported";
|
|
106777
106885
|
}
|
|
106778
|
-
function
|
|
106886
|
+
function moxxyHome4() {
|
|
106779
106887
|
return process.env.MOXXY_HOME ?? path3__default.join(homedir(), ".moxxy");
|
|
106780
106888
|
}
|
|
106781
106889
|
function serviceLogPath(spec) {
|
|
106782
|
-
return path3__default.join(
|
|
106890
|
+
return path3__default.join(moxxyHome4(), "services", `${spec.id}.log`);
|
|
106783
106891
|
}
|
|
106784
106892
|
function nodeBin() {
|
|
106785
106893
|
return process.execPath;
|
|
@@ -108371,9 +108479,6 @@ var perms_exports = {};
|
|
|
108371
108479
|
__export(perms_exports, {
|
|
108372
108480
|
runPermsCommand: () => runPermsCommand
|
|
108373
108481
|
});
|
|
108374
|
-
function policyPath() {
|
|
108375
|
-
return path3.join(os.homedir(), ".moxxy", "permissions.json");
|
|
108376
|
-
}
|
|
108377
108482
|
async function runPermsCommand(argv) {
|
|
108378
108483
|
if (helpRequested(argv)) {
|
|
108379
108484
|
process.stdout.write(HELP7);
|
|
@@ -108387,13 +108492,13 @@ async function runPermsCommand(argv) {
|
|
|
108387
108492
|
init_dist29().then(() => dist_exports3)
|
|
108388
108493
|
]);
|
|
108389
108494
|
const { waitUntilExit } = render4(
|
|
108390
|
-
React56.createElement(PermissionEditor2, { policyPath:
|
|
108495
|
+
React56.createElement(PermissionEditor2, { policyPath: userPolicyPath() })
|
|
108391
108496
|
);
|
|
108392
108497
|
await waitUntilExit();
|
|
108393
108498
|
return 0;
|
|
108394
108499
|
}
|
|
108395
108500
|
const cmd = sub ?? "list";
|
|
108396
|
-
const engine = await PermissionEngine.load(
|
|
108501
|
+
const engine = await PermissionEngine.load(userPolicyPath());
|
|
108397
108502
|
switch (cmd) {
|
|
108398
108503
|
case "list": {
|
|
108399
108504
|
const policy = engine.policySnapshot;
|
|
@@ -108464,7 +108569,7 @@ ${HELP7}`);
|
|
|
108464
108569
|
return 0;
|
|
108465
108570
|
}
|
|
108466
108571
|
case "path": {
|
|
108467
|
-
process.stdout.write(
|
|
108572
|
+
process.stdout.write(userPolicyPath() + "\n");
|
|
108468
108573
|
return 0;
|
|
108469
108574
|
}
|
|
108470
108575
|
default:
|
|
@@ -108477,6 +108582,7 @@ var HELP7;
|
|
|
108477
108582
|
var init_perms = __esm({
|
|
108478
108583
|
async "src/commands/perms.ts"() {
|
|
108479
108584
|
init_dist2();
|
|
108585
|
+
init_user_policy_path();
|
|
108480
108586
|
await init_argv_helpers();
|
|
108481
108587
|
init_errors();
|
|
108482
108588
|
init_colors();
|
|
@@ -110698,6 +110804,8 @@ var init_daemon = __esm({
|
|
|
110698
110804
|
init_schedule_daemon_svc();
|
|
110699
110805
|
}
|
|
110700
110806
|
});
|
|
110807
|
+
|
|
110808
|
+
// src/commands/schedule/setup-cmd.ts
|
|
110701
110809
|
async function runScheduleSetup(argv) {
|
|
110702
110810
|
const allowFlag = argv.flags.allow;
|
|
110703
110811
|
const tools = typeof allowFlag === "string" ? allowFlag.split(",").map((s) => s.trim()).filter(Boolean) : DEFAULT_HEADLESS_ALLOW_TOOLS;
|
|
@@ -110720,8 +110828,8 @@ async function stepAllowTools(tools) {
|
|
|
110720
110828
|
`);
|
|
110721
110829
|
return;
|
|
110722
110830
|
}
|
|
110723
|
-
const
|
|
110724
|
-
const engine = await PermissionEngine.load(
|
|
110831
|
+
const policyPath = userPolicyPath();
|
|
110832
|
+
const engine = await PermissionEngine.load(policyPath);
|
|
110725
110833
|
const before = engine.policySnapshot;
|
|
110726
110834
|
const existingAllowNames = new Set(before.allow.map((r2) => r2.name));
|
|
110727
110835
|
const added = [];
|
|
@@ -110736,7 +110844,7 @@ async function stepAllowTools(tools) {
|
|
|
110736
110844
|
}
|
|
110737
110845
|
process.stdout.write(
|
|
110738
110846
|
`${tag(true)} ${colors.bold("allow")} ` + (added.length > 0 ? colors.bold(added.join(", ")) : colors.dim("(none new)")) + (skipped.length > 0 ? colors.dim(` [already allowed: ${skipped.join(", ")}]`) : "") + `
|
|
110739
|
-
${colors.dim("\u2192 " +
|
|
110847
|
+
${colors.dim("\u2192 " + policyPath)}
|
|
110740
110848
|
`
|
|
110741
110849
|
);
|
|
110742
110850
|
}
|
|
@@ -110802,6 +110910,7 @@ var init_setup_cmd = __esm({
|
|
|
110802
110910
|
init_colors();
|
|
110803
110911
|
await init_setup();
|
|
110804
110912
|
init_schedule_daemon_svc();
|
|
110913
|
+
init_user_policy_path();
|
|
110805
110914
|
DEFAULT_HEADLESS_ALLOW_TOOLS = ["telegram_send_message", "web_fetch"];
|
|
110806
110915
|
tag = (ok) => ok ? colors.bold("ok ") : colors.red("fail");
|
|
110807
110916
|
}
|
|
@@ -111031,6 +111140,7 @@ var doctor_exports = {};
|
|
|
111031
111140
|
__export(doctor_exports, {
|
|
111032
111141
|
buildAuditExportDoctorCheck: () => buildAuditExportDoctorCheck,
|
|
111033
111142
|
buildEgressDoctorCheck: () => buildEgressDoctorCheck,
|
|
111143
|
+
buildMemoryDoctorCheck: () => buildMemoryDoctorCheck,
|
|
111034
111144
|
buildPluginDoctorChecks: () => buildPluginDoctorChecks,
|
|
111035
111145
|
buildPolicyDoctorCheck: () => buildPolicyDoctorCheck,
|
|
111036
111146
|
buildSelfUpdateDoctorCheck: () => buildSelfUpdateDoctorCheck,
|
|
@@ -111163,34 +111273,7 @@ async function runDoctorChecks(deps) {
|
|
|
111163
111273
|
}
|
|
111164
111274
|
checks.push(buildVoiceDoctorCheck(session, await checkVoiceCaptureAvailable()));
|
|
111165
111275
|
checks.push(...buildPluginDoctorChecks(pluginRegistration));
|
|
111166
|
-
|
|
111167
|
-
checks.push({
|
|
111168
|
-
id: "memory",
|
|
111169
|
-
status: "warn",
|
|
111170
|
-
message: "memory extension not installed \u2014 long-term memory off (moxxy extensions install @moxxy/plugin-memory)"
|
|
111171
|
-
});
|
|
111172
|
-
} else {
|
|
111173
|
-
const memDir = path3.join(os.homedir(), ".moxxy", "memory");
|
|
111174
|
-
const memRes = await tryCatch(async () => {
|
|
111175
|
-
await promises.mkdir(memDir, { recursive: true });
|
|
111176
|
-
await promises.access(memDir, promises.constants.W_OK);
|
|
111177
|
-
const entries = await memory.list();
|
|
111178
|
-
return { count: entries.length };
|
|
111179
|
-
});
|
|
111180
|
-
if (memRes.ok) {
|
|
111181
|
-
checks.push({
|
|
111182
|
-
id: "memory",
|
|
111183
|
-
status: "ok",
|
|
111184
|
-
message: `${memDir} writable (${memRes.value.count} entries)`
|
|
111185
|
-
});
|
|
111186
|
-
} else {
|
|
111187
|
-
checks.push({
|
|
111188
|
-
id: "memory",
|
|
111189
|
-
status: "fail",
|
|
111190
|
-
message: `${memDir} not writable: ${memRes.error}`
|
|
111191
|
-
});
|
|
111192
|
-
}
|
|
111193
|
-
}
|
|
111276
|
+
checks.push(await buildMemoryDoctorCheck(memory));
|
|
111194
111277
|
const allSkills = session.skills.list();
|
|
111195
111278
|
checks.push({
|
|
111196
111279
|
id: "skills",
|
|
@@ -111291,6 +111374,26 @@ function buildEgressDoctorCheck(config) {
|
|
|
111291
111374
|
const hint = ca ? "" : " (set NODE_EXTRA_CA_CERTS if the proxy terminates TLS)";
|
|
111292
111375
|
return { id: "network", status, message: `${via}${bypass}${caNote}${hint}` };
|
|
111293
111376
|
}
|
|
111377
|
+
async function buildMemoryDoctorCheck(memory) {
|
|
111378
|
+
if (!memory) {
|
|
111379
|
+
return {
|
|
111380
|
+
id: "memory",
|
|
111381
|
+
status: "warn",
|
|
111382
|
+
message: "memory extension not installed \u2014 long-term memory off (moxxy extensions install @moxxy/plugin-memory)"
|
|
111383
|
+
};
|
|
111384
|
+
}
|
|
111385
|
+
const memDir = moxxyPath("memory");
|
|
111386
|
+
const memRes = await tryCatch(async () => {
|
|
111387
|
+
await promises.mkdir(memDir, { recursive: true });
|
|
111388
|
+
await promises.access(memDir, promises.constants.W_OK);
|
|
111389
|
+
const entries = await memory.list();
|
|
111390
|
+
return { count: entries.length };
|
|
111391
|
+
});
|
|
111392
|
+
if (memRes.ok) {
|
|
111393
|
+
return { id: "memory", status: "ok", message: `${memDir} writable (${memRes.value.count} entries)` };
|
|
111394
|
+
}
|
|
111395
|
+
return { id: "memory", status: "fail", message: `${memDir} not writable: ${memRes.error}` };
|
|
111396
|
+
}
|
|
111294
111397
|
async function buildSelfUpdateDoctorCheck(session) {
|
|
111295
111398
|
if (!session.tools.has("self_update_begin")) {
|
|
111296
111399
|
return { id: "self-update", status: "warn", message: "disabled (plugin not loaded)" };
|
|
@@ -112988,7 +113091,7 @@ var init_skills4 = __esm({
|
|
|
112988
113091
|
}
|
|
112989
113092
|
]
|
|
112990
113093
|
});
|
|
112991
|
-
AUDIT_PATH = () =>
|
|
113094
|
+
AUDIT_PATH = () => moxxyPath("skills", ".meta", "created.jsonl");
|
|
112992
113095
|
auditMutex = createMutex();
|
|
112993
113096
|
}
|
|
112994
113097
|
});
|
|
@@ -113015,7 +113118,7 @@ async function runPluginNewCommand(argv) {
|
|
|
113015
113118
|
}
|
|
113016
113119
|
const here = hasBoolFlag(argv, "here");
|
|
113017
113120
|
const force = hasBoolFlag(argv, "force");
|
|
113018
|
-
const root = here ? path3.join(process.cwd(), name) :
|
|
113121
|
+
const root = here ? path3.join(process.cwd(), name) : moxxyPath("plugins", name);
|
|
113019
113122
|
try {
|
|
113020
113123
|
const stat2 = await promises.stat(root);
|
|
113021
113124
|
if (stat2.isDirectory() && !force) {
|
|
@@ -114606,9 +114709,6 @@ var self_update_exports = {};
|
|
|
114606
114709
|
__export(self_update_exports, {
|
|
114607
114710
|
runSelfUpdateCommand: () => runSelfUpdateCommand
|
|
114608
114711
|
});
|
|
114609
|
-
function moxxyDir() {
|
|
114610
|
-
return path3.join(os.homedir(), ".moxxy");
|
|
114611
|
-
}
|
|
114612
114712
|
async function runSelfUpdateCommand(argv) {
|
|
114613
114713
|
const sub = argv.positional[0] ?? "status";
|
|
114614
114714
|
if (sub === "help" || helpRequested(argv)) {
|
|
@@ -114616,7 +114716,7 @@ async function runSelfUpdateCommand(argv) {
|
|
|
114616
114716
|
return 0;
|
|
114617
114717
|
}
|
|
114618
114718
|
if (sub === "status") {
|
|
114619
|
-
const dir =
|
|
114719
|
+
const dir = moxxyHome();
|
|
114620
114720
|
const txns = await listTransactions(dir);
|
|
114621
114721
|
const core = await listCoreTxns(dir);
|
|
114622
114722
|
process.stdout.write(colors.bold("Tier 1 \u2014 plugins / skills\n"));
|
|
@@ -114639,7 +114739,7 @@ async function runSelfUpdateCommand(argv) {
|
|
|
114639
114739
|
printError("usage: moxxy self-update rollback <coreTxnId>");
|
|
114640
114740
|
return 2;
|
|
114641
114741
|
}
|
|
114642
|
-
const dir =
|
|
114742
|
+
const dir = moxxyHome();
|
|
114643
114743
|
const journal = await readCoreJournal(dir, txnId).catch(() => null);
|
|
114644
114744
|
if (!journal) {
|
|
114645
114745
|
printError(`no core transaction "${txnId}" (only Tier-2 core txns can be rolled back from the CLI)`);
|