@moxxy/cli 0.50.2 → 0.50.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bin.js +372 -46
  2. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -5,7 +5,7 @@ import * as fs43 from 'fs';
5
5
  import fs43__default, { promises, readFileSync, existsSync, statSync, readdirSync, mkdirSync, writeFileSync, realpathSync, unlinkSync, createReadStream, lstatSync, constants as constants$1, watch as watch$1 } from 'fs';
6
6
  import * as path3 from 'path';
7
7
  import path3__default, { dirname, join, posix, resolve, relative, sep, isAbsolute } from 'path';
8
- import { utf8Locale, ensurePrivateDir, moxxyHome, pruneStaleTempFiles, moxxyPath, hasProxy, installEgressProxy, readProxyEnv, writeFileAtomic, ensurePrivateFile, killTree as killTree$1, liveChannelStatus, spawnDedicatedChannel, stopDedicatedChannel, clearChannelStatus, findExecutable, PRIVATE_FILE_MODE, resolveOsPrincipal, redactProxyUrl, resolveExecutableTarget, spawnExecutableTarget, listLiveChannelStatuses, rotateChannelToken, writeSignedNetworkCacheAtomic, CrossProcessFireLock, fetchNpmLatest, writeChannelStatus, withFileLock, writeBoundedNetworkCacheAtomicSync, writeBoundedDataCacheAtomic, readRequestBody, bearerTokenMatches } from '@moxxy/sdk/server';
8
+ import { utf8Locale, ensurePrivateDir, moxxyHome, pruneStaleTempFiles, moxxyPath, hasProxy, installEgressProxy, readProxyEnv, writeFileAtomic, ensurePrivateFile, killTree as killTree$1, liveChannelStatus, spawnDedicatedChannel, stopDedicatedChannel, clearChannelStatus, findExecutable, PRIVATE_FILE_MODE, withFileLock, resolveOsPrincipal, redactProxyUrl, resolveExecutableTarget, spawnExecutableTarget, listLiveChannelStatuses, rotateChannelToken, writeSignedNetworkCacheAtomic, CrossProcessFireLock, fetchNpmLatest, writeChannelStatus, writeBoundedNetworkCacheAtomicSync, writeBoundedDataCacheAtomic, readRequestBody, bearerTokenMatches } from '@moxxy/sdk/server';
9
9
  import { spawn, spawnSync, execFile } from 'child_process';
10
10
  import { fileURLToPath, pathToFileURL } from 'url';
11
11
  import { MoxxyError, createMutex, defineChannel, definePlugin, defineViewRenderer, DEFAULT_VIEW_TAGS, defineTunnelProvider, defineAuditExporter, defineAuditSink, z as z$1, withAgentConduct, questionAnswersSchema, defineTool, defineEmbedder, defineMode, asPluginId, computerControlSnapshotSchema, createDeferredPermissionResolver, isSafeViewUrl, redactSecrets, questionAnswerDisplay, describeQuestionAnswers, searchConversation, conversationTurns, asTurnId, waitFor, unfinishedWorkCheckpoint, unfinishedStepCheckpoint, runReactLoop, defineCompactor, abortError, activeCompactionRanges, defineCacheStrategy, runManualCompaction, assertDefined, defineWorkflowExecutor, MOXXY_PCM16_24KHZ_MIME, isAgentNoReplyEvent, AGENT_NO_REPLY_TEXT, accountLimitOfEvent, isFileDiffDisplay, questionAnswerLines, stepListProgress, startingModel, fileDiffFromText, findAttachment, listAttachments, summarizeWithProvider, toolResultBytes, isSelectableMode, summarizeSessionTokensFromEvents, summarizeTokensByModel, getInstallHint, toDiffRows, diffGutterNo, fileDiffVerb, fileDiffSummary, openQuestionsFromEvents, emptyDraft, questionAnswersProblem, draftAnswers, computeElisionState, toolResultStubbed, toolResultStubText, conversationalStubbed, conversationalStub, chooseOption, typeOwnAnswer, isFirstPartyPackage, REDACTED_PLACEHOLDER, isSecretKey, addModelTotals, skillFrontmatterSchema, asSkillId, parseFrontmatter, denyByDefaultResolver, createCallbackResolver, createAllowListResolver, countNodes, autoAllowResolver, SESSION_SOURCES, startChannelWith, EXIT_AFTER_PAIR_FLAG, renderFrontmatter, envShareNameSchema, formatPrincipal, aggregateCapabilitySpecs, hostCredentialName, verifyEd25519, mentionedSkills, skillAttachment, withoutTools, toolsForMode, moxxyPackageSchema, auditActionOf, asToolCallId, dispatchToolCall, matchLoadableTools, defineSecretProvider, encodeLoginAuthUrl, redactSecretText, encodeLoginPrompt, defineCommand, ISOLATION_RANK, sleepWithAbort, asSessionId, migrateModeName, autoApproveFromEvents, AUTO_APPROVE_SUBTYPE, AUTO_APPROVE_PLUGIN_ID, autoApproveFromAgent, autoApproveRecorded, agentActivityRecord, withRecordedContextWindows, recordedContextWindows, parseFrontmatterFile, createJsonFileStore, eventForClient, autoApproveSwitch, computerControlCommandSchema, historyPageForClient, readAttachmentChunk, computerApprovalFocusSchema, workflowApprovalItemsSchema, evaluateToolRule, asEventId, QUESTION_ASKED, questionCloseNote, QUESTION_RESOLVED, QUESTION_CLOSED_NEW_MESSAGE as QUESTION_CLOSED_NEW_MESSAGE$1, questionRecord as questionRecord$1, QUESTION_PLUGIN_ID } from '@moxxy/sdk';
@@ -10283,7 +10283,7 @@ var require_jiti = __commonJS({
10283
10283
  function V() {
10284
10284
  return 10 !== n4.getToken() ? (k(3, [], [2, 5]), false) : (P3(false), 6 === n4.getToken() ? (I3(":"), T3(), U3() || k(4, [], [2, 5])) : k(5, [], [2, 5]), a3.pop(), true);
10285
10285
  }
10286
- function z68() {
10286
+ function z69() {
10287
10287
  l3(), T3();
10288
10288
  let e4 = false;
10289
10289
  for (; 2 !== n4.getToken() && 17 !== n4.getToken(); ) {
@@ -10310,14 +10310,14 @@ var require_jiti = __commonJS({
10310
10310
  case 3:
10311
10311
  return G();
10312
10312
  case 1:
10313
- return z68();
10313
+ return z69();
10314
10314
  case 10:
10315
10315
  return P3(true);
10316
10316
  default:
10317
10317
  return J();
10318
10318
  }
10319
10319
  }
10320
- return r2(T3, "scanNext"), r2(k, "handleError"), r2(P3, "parseString"), r2(J, "parseLiteral"), r2(V, "parseProperty"), r2(z68, "parseObject"), r2(G, "parseArray"), r2(U3, "parseValue"), T3(), 17 === n4.getToken() ? !!i4.allowEmptyContent || (k(4, [], []), false) : U3() ? (17 !== n4.getToken() && k(9, [], []), true) : (k(4, [], []), false);
10320
+ return r2(T3, "scanNext"), r2(k, "handleError"), r2(P3, "parseString"), r2(J, "parseLiteral"), r2(V, "parseProperty"), r2(z69, "parseObject"), r2(G, "parseArray"), r2(U3, "parseValue"), T3(), 17 === n4.getToken() ? !!i4.allowEmptyContent || (k(4, [], []), false) : U3() ? (17 !== n4.getToken() && k(9, [], []), true) : (k(4, [], []), false);
10321
10321
  }
10322
10322
  new Array(W2).fill(0).map((e3, t4) => "\n" + " ".repeat(t4)), new Array(W2).fill(0).map((e3, t4) => "\r" + " ".repeat(t4)), new Array(W2).fill(0).map((e3, t4) => "\r\n" + " ".repeat(t4)), new Array(W2).fill(0).map((e3, t4) => "\n" + " ".repeat(t4)), new Array(W2).fill(0).map((e3, t4) => "\r" + " ".repeat(t4)), new Array(W2).fill(0).map((e3, t4) => "\r\n" + " ".repeat(t4)), (function(e3) {
10323
10323
  e3.DEFAULT = { allowTrailingComma: false };
@@ -40035,10 +40035,10 @@ var require_react_production_min = __commonJS({
40035
40035
  var w = /* @__PURE__ */ Symbol.for("react.suspense");
40036
40036
  var x2 = /* @__PURE__ */ Symbol.for("react.memo");
40037
40037
  var y2 = /* @__PURE__ */ Symbol.for("react.lazy");
40038
- var z68 = Symbol.iterator;
40038
+ var z69 = Symbol.iterator;
40039
40039
  function A2(a2) {
40040
40040
  if (null === a2 || "object" !== typeof a2) return null;
40041
- a2 = z68 && a2[z68] || a2["@@iterator"];
40041
+ a2 = z69 && a2[z69] || a2["@@iterator"];
40042
40042
  return "function" === typeof a2 ? a2 : null;
40043
40043
  }
40044
40044
  var B = { isMounted: function() {
@@ -41726,9 +41726,9 @@ var require_react_development = __commonJS({
41726
41726
  }
41727
41727
  function getSourceInfoErrorAddendum(source) {
41728
41728
  if (source !== void 0) {
41729
- var fileName = source.fileName.replace(/^.*[\\\/]/, "");
41729
+ var fileName2 = source.fileName.replace(/^.*[\\\/]/, "");
41730
41730
  var lineNumber = source.lineNumber;
41731
- return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
41731
+ return "\n\nCheck your code at " + fileName2 + ":" + lineNumber + ".";
41732
41732
  }
41733
41733
  return "";
41734
41734
  }
@@ -42845,7 +42845,7 @@ var init_yoga_wasm_base64_esm = __esm({
42845
42845
  h2.noExitRuntime || true;
42846
42846
  "object" != typeof WebAssembly && x2("no native wasm support detected");
42847
42847
  var fa, ha = false;
42848
- function z68(a2, b3, c3) {
42848
+ function z69(a2, b3, c3) {
42849
42849
  c3 = b3 + c3;
42850
42850
  for (var d = ""; !(b3 >= c3); ) {
42851
42851
  var e = a2[b3++];
@@ -43495,7 +43495,7 @@ var init_yoga_wasm_base64_esm = __esm({
43495
43495
  return b3;
43496
43496
  }, Jb = {
43497
43497
  l: function(a2, b3, c3, d) {
43498
- x2("Assertion failed: " + (a2 ? z68(A2, a2) : "") + ", at: " + [b3 ? b3 ? z68(A2, b3) : "" : "unknown filename", c3, d ? d ? z68(A2, d) : "" : "unknown function"]);
43498
+ x2("Assertion failed: " + (a2 ? z69(A2, a2) : "") + ", at: " + [b3 ? b3 ? z69(A2, b3) : "" : "unknown filename", c3, d ? d ? z69(A2, d) : "" : "unknown function"]);
43499
43499
  },
43500
43500
  q: function(a2, b3, c3) {
43501
43501
  a2 = N(a2);
@@ -43748,7 +43748,7 @@ var init_yoga_wasm_base64_esm = __esm({
43748
43748
  if (c3) for (var g2 = f2, k = 0; k <= e; ++k) {
43749
43749
  var m3 = f2 + k;
43750
43750
  if (k == e || 0 == A2[m3]) {
43751
- g2 = g2 ? z68(A2, g2, m3 - g2) : "";
43751
+ g2 = g2 ? z69(A2, g2, m3 - g2) : "";
43752
43752
  if (void 0 === l2) var l2 = g2;
43753
43753
  else l2 += String.fromCharCode(0), l2 += g2;
43754
43754
  g2 = m3 + 1;
@@ -43945,7 +43945,7 @@ var init_yoga_wasm_base64_esm = __esm({
43945
43945
  b3 += 8;
43946
43946
  for (var m3 = 0; m3 < k; m3++) {
43947
43947
  var l2 = A2[g2 + m3], n3 = Fb[a2];
43948
- 0 === l2 || 10 === l2 ? ((1 === a2 ? ea : v)(z68(n3, 0)), n3.length = 0) : n3.push(l2);
43948
+ 0 === l2 || 10 === l2 ? ((1 === a2 ? ea : v)(z69(n3, 0)), n3.length = 0) : n3.push(l2);
43949
43949
  }
43950
43950
  e += k;
43951
43951
  }
@@ -44433,7 +44433,7 @@ var require_scheduler_production_min = __commonJS({
44433
44433
  var u5 = 1;
44434
44434
  var v = null;
44435
44435
  var y2 = 3;
44436
- var z68 = false;
44436
+ var z69 = false;
44437
44437
  var A2 = false;
44438
44438
  var B = false;
44439
44439
  var D = "function" === typeof setTimeout ? setTimeout : null;
@@ -44460,7 +44460,7 @@ var require_scheduler_production_min = __commonJS({
44460
44460
  function J(a2, b3) {
44461
44461
  A2 = false;
44462
44462
  B && (B = false, E2(L), L = -1);
44463
- z68 = true;
44463
+ z69 = true;
44464
44464
  var c3 = y2;
44465
44465
  try {
44466
44466
  G(b3);
@@ -44484,7 +44484,7 @@ var require_scheduler_production_min = __commonJS({
44484
44484
  }
44485
44485
  return w;
44486
44486
  } finally {
44487
- v = null, y2 = c3, z68 = false;
44487
+ v = null, y2 = c3, z69 = false;
44488
44488
  }
44489
44489
  }
44490
44490
  var N = false;
@@ -44541,7 +44541,7 @@ var require_scheduler_production_min = __commonJS({
44541
44541
  a2.callback = null;
44542
44542
  };
44543
44543
  exports.unstable_continueExecution = function() {
44544
- A2 || z68 || (A2 = true, I2(J));
44544
+ A2 || z69 || (A2 = true, I2(J));
44545
44545
  };
44546
44546
  exports.unstable_forceFrameRate = function(a2) {
44547
44547
  0 > a2 || 125 < a2 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P3 = 0 < a2 ? Math.floor(1e3 / a2) : 5;
@@ -44614,7 +44614,7 @@ var require_scheduler_production_min = __commonJS({
44614
44614
  }
44615
44615
  e = c3 + e;
44616
44616
  a2 = { id: u5++, callback: b3, priorityLevel: a2, startTime: c3, expirationTime: e, sortIndex: -1 };
44617
- c3 > d ? (a2.sortIndex = c3, f2(t2, a2), null === h2(r2) && a2 === h2(t2) && (B ? (E2(L), L = -1) : B = true, K2(H, c3 - d))) : (a2.sortIndex = e, f2(r2, a2), A2 || z68 || (A2 = true, I2(J)));
44617
+ c3 > d ? (a2.sortIndex = c3, f2(t2, a2), null === h2(r2) && a2 === h2(t2) && (B ? (E2(L), L = -1) : B = true, K2(H, c3 - d))) : (a2.sortIndex = e, f2(r2, a2), A2 || z69 || (A2 = true, I2(J)));
44618
44618
  return a2;
44619
44619
  };
44620
44620
  exports.unstable_shouldYield = M2;
@@ -45371,7 +45371,7 @@ var require_react_reconciler_production_min = __commonJS({
45371
45371
  gc[hc] = a2.current;
45372
45372
  a2.current = b3;
45373
45373
  }
45374
- var jc = {}, x2 = ic(jc), z68 = ic(false), kc = jc;
45374
+ var jc = {}, x2 = ic(jc), z69 = ic(false), kc = jc;
45375
45375
  function mc(a2, b3) {
45376
45376
  var c3 = a2.type.contextTypes;
45377
45377
  if (!c3) return jc;
@@ -45387,13 +45387,13 @@ var require_react_reconciler_production_min = __commonJS({
45387
45387
  return null !== a2 && void 0 !== a2;
45388
45388
  }
45389
45389
  function nc() {
45390
- q(z68);
45390
+ q(z69);
45391
45391
  q(x2);
45392
45392
  }
45393
45393
  function oc(a2, b3, c3) {
45394
45394
  if (x2.current !== jc) throw Error(n3(168));
45395
45395
  v(x2, b3);
45396
- v(z68, c3);
45396
+ v(z69, c3);
45397
45397
  }
45398
45398
  function pc(a2, b3, c3) {
45399
45399
  var d = a2.stateNode;
@@ -45407,14 +45407,14 @@ var require_react_reconciler_production_min = __commonJS({
45407
45407
  a2 = (a2 = a2.stateNode) && a2.__reactInternalMemoizedMergedChildContext || jc;
45408
45408
  kc = x2.current;
45409
45409
  v(x2, a2);
45410
- v(z68, z68.current);
45410
+ v(z69, z69.current);
45411
45411
  return true;
45412
45412
  }
45413
45413
  function rc(a2, b3, c3) {
45414
45414
  var d = a2.stateNode;
45415
45415
  if (!d) throw Error(n3(169));
45416
- c3 ? (a2 = pc(a2, b3, kc), d.__reactInternalMemoizedMergedChildContext = a2, q(z68), q(x2), v(x2, a2)) : q(z68);
45417
- v(z68, c3);
45416
+ c3 ? (a2 = pc(a2, b3, kc), d.__reactInternalMemoizedMergedChildContext = a2, q(z69), q(x2), v(x2, a2)) : q(z69);
45417
+ v(z69, c3);
45418
45418
  }
45419
45419
  var tc = Math.clz32 ? Math.clz32 : sc, uc = Math.log, vc = Math.LN2;
45420
45420
  function sc(a2) {
@@ -47012,7 +47012,7 @@ var require_react_reconciler_production_min = __commonJS({
47012
47012
  g2.state = p3;
47013
47013
  ke(b3, d, g2, e);
47014
47014
  k = b3.memoizedState;
47015
- h2 !== d || p3 !== k || z68.current || de ? ("function" === typeof m3 && (yf(b3, c3, m3, d), k = b3.memoizedState), (h2 = de || Af(b3, c3, h2, d, p3, k, l2)) ? (r2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b3.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), b3.memoizedProps = d, b3.memoizedState = k), g2.props = d, g2.state = k, g2.context = l2, d = h2) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), d = false);
47015
+ h2 !== d || p3 !== k || z69.current || de ? ("function" === typeof m3 && (yf(b3, c3, m3, d), k = b3.memoizedState), (h2 = de || Af(b3, c3, h2, d, p3, k, l2)) ? (r2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b3.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), b3.memoizedProps = d, b3.memoizedState = k), g2.props = d, g2.state = k, g2.context = l2, d = h2) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), d = false);
47016
47016
  } else {
47017
47017
  g2 = b3.stateNode;
47018
47018
  fe(a2, b3);
@@ -47030,7 +47030,7 @@ var require_react_reconciler_production_min = __commonJS({
47030
47030
  g2.state = p3;
47031
47031
  ke(b3, d, g2, e);
47032
47032
  var w = b3.memoizedState;
47033
- h2 !== r2 || p3 !== w || z68.current || de ? ("function" === typeof B && (yf(b3, c3, B, d), w = b3.memoizedState), (l2 = de || Af(b3, c3, l2, d, p3, w, k) || false) ? (m3 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d, w, k), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d, w, k)), "function" === typeof g2.componentDidUpdate && (b3.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b3.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), b3.memoizedProps = d, b3.memoizedState = w), g2.props = d, g2.state = w, g2.context = k, d = l2) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), d = false);
47033
+ h2 !== r2 || p3 !== w || z69.current || de ? ("function" === typeof B && (yf(b3, c3, B, d), w = b3.memoizedState), (l2 = de || Af(b3, c3, l2, d, p3, w, k) || false) ? (m3 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d, w, k), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d, w, k)), "function" === typeof g2.componentDidUpdate && (b3.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b3.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), b3.memoizedProps = d, b3.memoizedState = w), g2.props = d, g2.state = w, g2.context = k, d = l2) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), d = false);
47034
47034
  }
47035
47035
  return dg(a2, b3, c3, d, f2, e);
47036
47036
  }
@@ -47499,7 +47499,7 @@ var require_react_reconciler_production_min = __commonJS({
47499
47499
  case 3:
47500
47500
  c3 = b3.stateNode;
47501
47501
  te();
47502
- q(z68);
47502
+ q(z69);
47503
47503
  q(x2);
47504
47504
  ye();
47505
47505
  c3.pendingContext && (c3.context = c3.pendingContext, c3.pendingContext = null);
@@ -47642,7 +47642,7 @@ var require_react_reconciler_production_min = __commonJS({
47642
47642
  case 1:
47643
47643
  return A2(b3.type) && nc(), a2 = b3.flags, a2 & 65536 ? (b3.flags = a2 & -65537 | 128, b3) : null;
47644
47644
  case 3:
47645
- return te(), q(z68), q(x2), ye(), a2 = b3.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b3.flags = a2 & -65537 | 128, b3) : null;
47645
+ return te(), q(z69), q(x2), ye(), a2 = b3.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b3.flags = a2 & -65537 | 128, b3) : null;
47646
47646
  case 5:
47647
47647
  return ve(b3), null;
47648
47648
  case 13:
@@ -48697,7 +48697,7 @@ var require_react_reconciler_production_min = __commonJS({
48697
48697
  break;
48698
48698
  case 3:
48699
48699
  te();
48700
- q(z68);
48700
+ q(z69);
48701
48701
  q(x2);
48702
48702
  ye();
48703
48703
  break;
@@ -49174,7 +49174,7 @@ var require_react_reconciler_production_min = __commonJS({
49174
49174
  }
49175
49175
  var ai;
49176
49176
  ai = function(a2, b3, c3) {
49177
- if (null !== a2) if (a2.memoizedProps !== b3.pendingProps || z68.current) G = true;
49177
+ if (null !== a2) if (a2.memoizedProps !== b3.pendingProps || z69.current) G = true;
49178
49178
  else {
49179
49179
  if (0 === (a2.lanes & c3) && 0 === (b3.flags & 128)) return G = false, sg(a2, b3, c3);
49180
49180
  G = 0 !== (a2.flags & 131072) ? true : false;
@@ -49283,7 +49283,7 @@ var require_react_reconciler_production_min = __commonJS({
49283
49283
  g2 = e.value;
49284
49284
  Vd(b3, d, g2);
49285
49285
  if (null !== f2) if (Vc(f2.value, g2)) {
49286
- if (f2.children === e.children && !z68.current) {
49286
+ if (f2.children === e.children && !z69.current) {
49287
49287
  b3 = Tf(a2, b3, c3);
49288
49288
  break a;
49289
49289
  }
@@ -72481,6 +72481,235 @@ var init_agent_computer = __esm({
72481
72481
  "../chat-model/dist/agent-computer.js"() {
72482
72482
  }
72483
72483
  });
72484
+
72485
+ // ../chat-model/dist/agent-markup.js
72486
+ function agentMarkupAsText(text3, options = {}) {
72487
+ return rewrite(text3, options.streaming === true, { file: (path74, local) => local ?? path74, title: (title) => title });
72488
+ }
72489
+ function agentMarkupAsSpeech(text3) {
72490
+ return rewrite(text3, false, { file: (path74, local) => fileName(local ?? path74), title: (title) => title });
72491
+ }
72492
+ function rewrite(text3, streaming, render4) {
72493
+ if (!text3.includes(":") && !text3.includes(SEARCH_OPEN))
72494
+ return text3;
72495
+ const { found, tail } = scan(text3);
72496
+ const end = streaming && tail !== null ? tail : text3.length;
72497
+ if (found.length === 0)
72498
+ return end === text3.length ? text3 : text3.slice(0, end);
72499
+ let out = "";
72500
+ let at = 0;
72501
+ for (const item of found) {
72502
+ out += text3.slice(at, item.start);
72503
+ if (item.kind === "file")
72504
+ out += render4.file(item.value, localPath(item.value));
72505
+ else if (item.kind === "title")
72506
+ out += render4.title(item.value);
72507
+ at = item.end;
72508
+ }
72509
+ return out + text3.slice(at, end);
72510
+ }
72511
+ function scan(text3) {
72512
+ const found = [];
72513
+ let tail = null;
72514
+ for (const [from, to] of proseRanges(text3)) {
72515
+ let at = from;
72516
+ while (at < to) {
72517
+ const char = text3[at];
72518
+ if (char === "`") {
72519
+ at = afterCodeSpan(text3, at, to);
72520
+ continue;
72521
+ }
72522
+ if (char === SEARCH_OPEN) {
72523
+ if (!text3.startsWith(SEARCH_PREFIX, at)) {
72524
+ if (to === text3.length && SEARCH_PREFIX.startsWith(text3.slice(at)))
72525
+ tail = at;
72526
+ at += 1;
72527
+ continue;
72528
+ }
72529
+ const close = text3.indexOf(SEARCH_CLOSE, at);
72530
+ if (close === -1 || close >= to) {
72531
+ if (to === text3.length)
72532
+ tail = at;
72533
+ break;
72534
+ }
72535
+ found.push({ start: at, end: close + 1, kind: "drop" });
72536
+ at = close + 1;
72537
+ continue;
72538
+ }
72539
+ if (char === ":") {
72540
+ DIRECTIVE.lastIndex = at;
72541
+ const name = DIRECTIVE.exec(text3)?.[1];
72542
+ if (name !== void 0 && text3[at - 1] !== ":" && text3[at - 1] !== "\\") {
72543
+ const parsed = parseAttributes(text3, DIRECTIVE.lastIndex, to);
72544
+ if (parsed.kind === "incomplete") {
72545
+ if (to === text3.length)
72546
+ tail = at;
72547
+ break;
72548
+ }
72549
+ const item = parsed.kind === "ok" ? directive(name, at, parsed) : null;
72550
+ if (item !== null) {
72551
+ found.push(item);
72552
+ at = item.end;
72553
+ continue;
72554
+ }
72555
+ }
72556
+ }
72557
+ at += 1;
72558
+ }
72559
+ }
72560
+ return { found, tail: tail ?? partialOpener(text3) };
72561
+ }
72562
+ function directive(name, start, parsed) {
72563
+ if (name === "browser-complete") {
72564
+ return { start, end: parsed.end, kind: "title", value: parsed.attributes.get("title") ?? "" };
72565
+ }
72566
+ const path74 = parsed.attributes.get("path");
72567
+ return path74 ? { start, end: parsed.end, kind: "file", value: path74 } : null;
72568
+ }
72569
+ function proseRanges(text3) {
72570
+ const ranges = [];
72571
+ let start = 0;
72572
+ let fence = null;
72573
+ let line = 0;
72574
+ for (; ; ) {
72575
+ const next = text3.indexOf("\n", line);
72576
+ const lineEnd2 = next === -1 ? text3.length : next;
72577
+ const marker = FENCE.exec(text3.slice(line, lineEnd2))?.[1];
72578
+ if (fence === null && marker) {
72579
+ ranges.push([start, line]);
72580
+ fence = marker;
72581
+ } else if (fence !== null && marker && marker[0] === fence[0] && marker.length >= fence.length) {
72582
+ fence = null;
72583
+ start = lineEnd2;
72584
+ }
72585
+ if (next === -1)
72586
+ break;
72587
+ line = next + 1;
72588
+ }
72589
+ if (fence === null)
72590
+ ranges.push([start, text3.length]);
72591
+ return ranges;
72592
+ }
72593
+ function afterCodeSpan(text3, at, to) {
72594
+ let run2 = 1;
72595
+ while (text3[at + run2] === "`")
72596
+ run2 += 1;
72597
+ const ticks = "`".repeat(run2);
72598
+ let close = text3.indexOf(ticks, at + run2);
72599
+ while (close !== -1 && close < to) {
72600
+ let length = run2;
72601
+ while (text3[close + length] === "`")
72602
+ length += 1;
72603
+ if (length === run2)
72604
+ return close + run2;
72605
+ close = text3.indexOf(ticks, close + length);
72606
+ }
72607
+ return at + run2;
72608
+ }
72609
+ function parseAttributes(text3, from, to) {
72610
+ const limit = Math.min(to, from + MAX_LENGTH);
72611
+ const ran = () => ({ kind: limit === text3.length ? "incomplete" : "bad" });
72612
+ const attributes = /* @__PURE__ */ new Map();
72613
+ let at = from;
72614
+ for (; ; ) {
72615
+ while (text3[at] === " " || text3[at] === " ")
72616
+ at += 1;
72617
+ if (at >= limit)
72618
+ return ran();
72619
+ if (text3[at] === "}")
72620
+ return { kind: "ok", end: at + 1, attributes };
72621
+ KEY.lastIndex = at;
72622
+ const key = KEY.exec(text3)?.[0];
72623
+ if (!key)
72624
+ return { kind: "bad" };
72625
+ at += key.length;
72626
+ if (at >= limit)
72627
+ return ran();
72628
+ if (text3[at] !== "=")
72629
+ return { kind: "bad" };
72630
+ at += 1;
72631
+ if (at >= limit)
72632
+ return ran();
72633
+ let value2 = "";
72634
+ if (text3[at] === '"') {
72635
+ at += 1;
72636
+ for (; ; ) {
72637
+ if (at >= limit)
72638
+ return ran();
72639
+ const char = text3[at];
72640
+ if (char === "\n")
72641
+ return { kind: "bad" };
72642
+ if (char === "\\" && text3[at + 1] === '"') {
72643
+ value2 += '"';
72644
+ at += 2;
72645
+ continue;
72646
+ }
72647
+ at += 1;
72648
+ if (char === '"')
72649
+ break;
72650
+ value2 += char;
72651
+ }
72652
+ if (at >= limit)
72653
+ return ran();
72654
+ if (text3[at] !== " " && text3[at] !== " " && text3[at] !== "}")
72655
+ return { kind: "bad" };
72656
+ } else {
72657
+ while (at < limit && !/[\s}]/u.test(text3[at] ?? ""))
72658
+ value2 += text3[at++];
72659
+ if (at >= limit)
72660
+ return ran();
72661
+ if (value2 === "" || text3[at] === "\n")
72662
+ return { kind: "bad" };
72663
+ }
72664
+ if (!attributes.has(key))
72665
+ attributes.set(key, value2);
72666
+ }
72667
+ }
72668
+ function partialOpener(text3) {
72669
+ const colon = text3.lastIndexOf(":");
72670
+ if (colon === -1 || text3.length - colon < 3)
72671
+ return null;
72672
+ const rest = text3.slice(colon);
72673
+ if (!OPENERS.some((opener) => opener.startsWith(rest)))
72674
+ return null;
72675
+ const start = text3[colon - 1] === ":" ? colon - 1 : colon;
72676
+ return text3[start - 1] === ":" || text3[start - 1] === "\\" ? null : start;
72677
+ }
72678
+ function localPath(path74) {
72679
+ if (path74.startsWith("file:")) {
72680
+ try {
72681
+ const url = new URL(path74);
72682
+ if (url.host !== "" && url.host !== "localhost")
72683
+ return null;
72684
+ const pathname = decodeURIComponent(url.pathname);
72685
+ if (/^[\\/]{2}/u.test(pathname))
72686
+ return null;
72687
+ return pathname.replace(/^\/(?=[A-Za-z]:\/)/u, "");
72688
+ } catch {
72689
+ return null;
72690
+ }
72691
+ }
72692
+ if (/^[A-Za-z]:[\\/]/u.test(path74))
72693
+ return path74.replaceAll("\\", "/");
72694
+ return path74.startsWith("/") && !path74.startsWith("//") ? path74 : null;
72695
+ }
72696
+ function fileName(path74) {
72697
+ const parts = path74.replaceAll("\\", "/").split("/").filter((part) => part !== "");
72698
+ return parts.at(-1) ?? path74;
72699
+ }
72700
+ var DIRECTIVE, OPENERS, SEARCH_OPEN, SEARCH_PREFIX, SEARCH_CLOSE, MAX_LENGTH, FENCE, KEY;
72701
+ var init_agent_markup = __esm({
72702
+ "../chat-model/dist/agent-markup.js"() {
72703
+ DIRECTIVE = /:{1,2}(codex-file-citation|browser-complete)\{/uy;
72704
+ OPENERS = [":codex-file-citation{", ":browser-complete{"];
72705
+ SEARCH_OPEN = "\uE200";
72706
+ SEARCH_PREFIX = SEARCH_OPEN + "cite\uE202";
72707
+ SEARCH_CLOSE = "\uE201";
72708
+ MAX_LENGTH = 4096;
72709
+ FENCE = /^ {0,3}(`{3,}|~{3,})/u;
72710
+ KEY = /[A-Za-z_][\w-]*/uy;
72711
+ }
72712
+ });
72484
72713
  function questionClosedText(event) {
72485
72714
  const record = questionRecord(event);
72486
72715
  if (!record || record.kind !== "resolved" || record.outcome.kind !== "dismissed")
@@ -72894,16 +73123,17 @@ function normalizeSpeakableMarkdown(markdown, fencedCodeReplacement) {
72894
73123
  return stripNonVerbalArtifacts(withoutPaths).split(/\n{2,}/).map((p3) => p3.replace(/\s+/g, " ").trim()).filter(Boolean).map((p3) => /[.!?:]$/.test(p3) ? p3 : `${p3}.`).join(" ").replace(/\s+([.!?])/gu, "$1").replace(/\s+([,;:!?])/gu, "$1").replace(/([,;:])\s*[.!?]/gu, ".").replace(/([,;:])(?:\s*[,;:])+/gu, "$1").replace(/\s{2,}/g, " ").trim();
72895
73124
  }
72896
73125
  function toSpeakableText(markdown) {
72897
- return normalizeSpeakableMarkdown(markdown, " (code block) ");
73126
+ return normalizeSpeakableMarkdown(agentMarkupAsSpeech(markdown), " (code block) ");
72898
73127
  }
72899
73128
  function toVoiceConversationText(markdown) {
72900
- const withoutCode = markdown.replace(/```[\s\S]*?```/g, " ").replace(/~~~[\s\S]*?~~~/g, " ").replace(/```[\s\S]*$/g, " ").replace(/~~~[\s\S]*$/g, " ").replace(/^(?: {4}|\t).*(?:\n|$)/gm, " ");
73129
+ const withoutCode = agentMarkupAsSpeech(markdown).replace(/```[\s\S]*?```/g, " ").replace(/~~~[\s\S]*?~~~/g, " ").replace(/```[\s\S]*$/g, " ").replace(/~~~[\s\S]*$/g, " ").replace(/^(?: {4}|\t).*(?:\n|$)/gm, " ");
72901
73130
  return normalizeSpeakableMarkdown(withoutCode, " ");
72902
73131
  }
72903
73132
  var KEYCAP_EMOJI_RE, NON_VERBAL_SYMBOL_RE, EMOJI_MODIFIER_RE, EMOJI_JOINER_RE, DOMAIN_RE2, FILE_EXTENSION_RE, ABSOLUTE_FILE_PATH_RE, FILE_PATH_RE, DOTTED_PROSE_RE, SLASHED_PROSE_RE, TRAILING_PUNCTUATION, WEB_ADDRESS_RE;
72904
73133
  var init_speech_text = __esm({
72905
73134
  "../chat-model/dist/speech-text.js"() {
72906
73135
  init_speech_tables();
73136
+ init_agent_markup();
72907
73137
  init_spoken_links();
72908
73138
  init_streaming_speech();
72909
73139
  init_trim_trailing();
@@ -73055,6 +73285,7 @@ var init_dist24 = __esm({
73055
73285
  init_agent_work();
73056
73286
  init_agent_computer();
73057
73287
  init_format();
73288
+ init_agent_markup();
73058
73289
  init_question_note();
73059
73290
  init_log2();
73060
73291
  init_id();
@@ -73617,13 +73848,14 @@ var init_AssistantBlock = __esm({
73617
73848
  import_jsx_runtime13 = __toESM(require_jsx_runtime());
73618
73849
  import_react34 = __toESM(require_react());
73619
73850
  await init_build2();
73851
+ init_dist24();
73620
73852
  await init_Markdown();
73621
73853
  init_density();
73622
73854
  await init_ActivityDot();
73623
73855
  AssistantBlock = (0, import_react34.memo)(function AssistantBlock2({ content }) {
73624
73856
  if (!content.trim())
73625
73857
  return null;
73626
- return (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "row", marginTop: blockGap(), children: [(0, import_jsx_runtime13.jsx)(ActivityDot, { state: "neutral" }), (0, import_jsx_runtime13.jsx)(Box_default, { flexDirection: "column", flexGrow: 1, flexShrink: 1, marginLeft: 1, children: (0, import_jsx_runtime13.jsx)(Markdown, { content, firstBlockTight: true }) })] });
73858
+ return (0, import_jsx_runtime13.jsxs)(Box_default, { flexDirection: "row", marginTop: blockGap(), children: [(0, import_jsx_runtime13.jsx)(ActivityDot, { state: "neutral" }), (0, import_jsx_runtime13.jsx)(Box_default, { flexDirection: "column", flexGrow: 1, flexShrink: 1, marginLeft: 1, children: (0, import_jsx_runtime13.jsx)(Markdown, { content: agentMarkupAsText(content), firstBlockTight: true }) })] });
73627
73859
  });
73628
73860
  }
73629
73861
  });
@@ -75820,6 +76052,7 @@ var init_turn = __esm({
75820
76052
  // ../channel-kit/dist/plain-turn-renderer.js
75821
76053
  var init_plain_turn_renderer = __esm({
75822
76054
  "../channel-kit/dist/plain-turn-renderer.js"() {
76055
+ init_dist24();
75823
76056
  }
75824
76057
  });
75825
76058
 
@@ -75967,6 +76200,7 @@ var init_dist25 = __esm({
75967
76200
  init_frame_pump();
75968
76201
  init_turn();
75969
76202
  init_plain_turn_renderer();
76203
+ init_dist24();
75970
76204
  init_host_code();
75971
76205
  init_tofu();
75972
76206
  init_secrets2();
@@ -76685,13 +76919,13 @@ async function writeMcpConfig(cfg) {
76685
76919
  await writeFileAtomic(mcpConfigPath(), JSON.stringify(cfg, null, 2) + "\n");
76686
76920
  }
76687
76921
  async function mutateMcpConfig(fn) {
76688
- return configMutex2.run(async () => {
76922
+ return configMutex2.run(() => withFileLock(mcpConfigPath(), async () => {
76689
76923
  const cfg = await readMcpConfig();
76690
76924
  const { next, result } = await fn(cfg);
76691
76925
  if (next !== cfg)
76692
76926
  await writeMcpConfig(next);
76693
76927
  return result;
76694
- });
76928
+ }));
76695
76929
  }
76696
76930
  async function setServerDisabled(name, disabled) {
76697
76931
  return mutateMcpConfig((cfg) => {
@@ -84757,9 +84991,9 @@ async function readProvidersConfig(configPath) {
84757
84991
  const items = await loadProviderItems({});
84758
84992
  const providers = [];
84759
84993
  for (const [name, item] of Object.entries(items)) {
84760
- const stored = itemToStored(name, item);
84761
- if (stored)
84762
- providers.push(stored);
84994
+ const stored2 = itemToStored(name, item);
84995
+ if (stored2)
84996
+ providers.push(stored2);
84763
84997
  }
84764
84998
  return { providers };
84765
84999
  }
@@ -88399,6 +88633,10 @@ async function setupSessionWithConfig(opts) {
88399
88633
  const config = await resolveConfigPlaceholders(rawConfig, vault, logger);
88400
88634
  await applyEgressSettings(config);
88401
88635
  const disabledPackages = new Set(disabledPackageNames(config));
88636
+ if (opts.disableBackgroundDaemons) {
88637
+ disabledPackages.add("@moxxy/plugin-scheduler");
88638
+ disabledPackages.add("@moxxy/plugin-webhooks");
88639
+ }
88402
88640
  let sessionRef;
88403
88641
  const secretResolver = buildSecretResolver(() => sessionRef, vault, opts.cwd);
88404
88642
  const policy = await loadPolicyBundles(config.policy?.bundles ?? []);
@@ -89821,10 +90059,10 @@ function surfaceInputWithinCap(m3) {
89821
90059
  return true;
89822
90060
  return JSON.stringify(m3).length <= MAX_SURFACE_INPUT_BYTES;
89823
90061
  }
89824
- var RUNNER_PROTOCOL_VERSION, MIN_COMPATIBLE_PROTOCOL_VERSION, RunnerMethod, RunnerNotification, attachmentSchema, principalSchema, attachParamsSchema, runTurnParamsSchema, abortParamsSchema, setResolverParamsSchema, shareEnvParamsSchema, questionAnswerParamsSchema, modeSetActiveParamsSchema, sessionSetReasoningParamsSchema, sessionSetFastParamsSchema, MAX_HISTORY_PAGE_LIMIT, sessionLoadHistoryParamsSchema, sessionReadAttachmentParamsSchema, MAX_RECORDED_EXCHANGE_CHARS, recordedText, sessionRecordExchangeParamsSchema, sessionSetAutoApproveParamsSchema, sessionStopBackgroundWorkParamsSchema, providerSetActiveParamsSchema, providerCloseAgentSessionsParamsSchema, 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;
90062
+ var RUNNER_PROTOCOL_VERSION, MIN_COMPATIBLE_PROTOCOL_VERSION, RunnerMethod, RunnerNotification, attachmentSchema, principalSchema, attachParamsSchema, runTurnParamsSchema, abortParamsSchema, setResolverParamsSchema, shareEnvParamsSchema, questionAnswerParamsSchema, modeSetActiveParamsSchema, sessionSetReasoningParamsSchema, sessionSetFastParamsSchema, MAX_HISTORY_PAGE_LIMIT, sessionLoadHistoryParamsSchema, sessionReadAttachmentParamsSchema, MAX_RECORDED_EXCHANGE_CHARS, recordedText, sessionRecordExchangeParamsSchema, sessionSetAutoApproveParamsSchema, sessionStopBackgroundWorkParamsSchema, providerSetActiveParamsSchema, providerCloseAgentSessionsParamsSchema, providerSetEnabledParamsSchema, providerConfigureParamsSchema, permissionAddAllowParamsSchema, commandRunParamsSchema, MAX_TRANSCRIBE_AUDIO_B64_BYTES, MAX_SYNTHESIZE_TEXT_BYTES, MEDIA_DESCRIPTOR_MAX, transcribeParamsSchema, synthesizeParamsSchema, cancelSynthesizeParamsSchema, mcpEnableAndAttachParamsSchema, mcpNamedEntrySchema, mcpSourceParamsSchema, mcpStrings, mcpAddServerParamsSchema, mcpDetachParamsSchema, workflowSetEnabledParamsSchema, workflowRunParamsSchema, workflowValidateDraftParamsSchema, workflowSaveParamsSchema, workflowGetRunParamsSchema, workflowResumeParamsSchema, surfaceOpenParamsSchema, MAX_SURFACE_INPUT_BYTES, surfaceInputParamsSchema, surfaceResizeParamsSchema, surfaceCloseParamsSchema;
89825
90063
  var init_protocol2 = __esm({
89826
90064
  "../runner/dist/protocol.js"() {
89827
- RUNNER_PROTOCOL_VERSION = 36;
90065
+ RUNNER_PROTOCOL_VERSION = 37;
89828
90066
  MIN_COMPATIBLE_PROTOCOL_VERSION = 1;
89829
90067
  RunnerMethod = {
89830
90068
  /** client->server: handshake; returns the initial info snapshot. */
@@ -89915,6 +90153,14 @@ var init_protocol2 = __esm({
89915
90153
  McpEnableAndAttach: "mcp.enableAndAttach",
89916
90154
  /** client->server: detach an MCP server. */
89917
90155
  McpDetach: "mcp.detach",
90156
+ /** client->server: the chat's agent's own MCP servers that Moxxy also has, and which copy new chats use (null: no such agent). */
90157
+ McpSources: "mcp.sources",
90158
+ /** client->server: pick Moxxy's copy or the agent's own of one MCP server for new chats with any agent. */
90159
+ McpSetSource: "mcp.setSource",
90160
+ /** client->server: connect to a saved Moxxy MCP entry once and count its tools. */
90161
+ McpTestServer: "mcp.testServer",
90162
+ /** client->server: add an MCP server the person entered (secrets as `${vault:NAME}`): test it, save it, make its tools callable. */
90163
+ McpAddServer: "mcp.addServer",
89918
90164
  /** client->server: list all workflows registered on the runner. */
89919
90165
  WorkflowList: "workflow.list",
89920
90166
  /** client->server: enable/disable a workflow. */
@@ -90105,6 +90351,21 @@ var init_protocol2 = __esm({
90105
90351
  requestId: z.string().min(1).max(128).regex(/^[A-Za-z0-9-]+$/)
90106
90352
  });
90107
90353
  mcpEnableAndAttachParamsSchema = z.object({ name: z.string() });
90354
+ mcpNamedEntrySchema = z.object({ name: z.string().min(1).max(256) });
90355
+ mcpSourceParamsSchema = mcpNamedEntrySchema.extend({ source: z.enum(["agent", "moxxy"]) });
90356
+ mcpStrings = z.record(z.string().max(8192)).refine((map) => Object.keys(map).length <= 64, "too many entries");
90357
+ mcpAddServerParamsSchema = z.object({
90358
+ entry: z.object({
90359
+ name: z.string().min(1).max(60),
90360
+ kind: z.enum(["stdio", "http", "sse"]),
90361
+ command: z.string().min(1).max(4096).optional(),
90362
+ args: z.array(z.string().max(8192)).max(256).optional(),
90363
+ env: mcpStrings.optional(),
90364
+ cwd: z.string().max(4096).optional(),
90365
+ url: z.string().max(4096).optional(),
90366
+ headers: mcpStrings.optional()
90367
+ })
90368
+ });
90108
90369
  mcpDetachParamsSchema = z.object({ name: z.string() });
90109
90370
  workflowSetEnabledParamsSchema = z.object({
90110
90371
  name: z.string(),
@@ -90604,6 +90865,42 @@ async function handleMcpDetach(ctx, raw) {
90604
90865
  throw new Error("mcp admin not available on this runner");
90605
90866
  return admin.detach(params.name);
90606
90867
  }
90868
+ function activeSources(ctx) {
90869
+ const active = ctx.session.providers.getActiveName();
90870
+ return ctx.session.providers.list().find((provider) => provider.name === active)?.mcpSources;
90871
+ }
90872
+ async function handleMcpSources(ctx) {
90873
+ const sources = activeSources(ctx);
90874
+ const admin = ctx.session.mcpAdmin;
90875
+ if (!sources || !admin)
90876
+ return null;
90877
+ const names = (await admin.listServers()).map((server) => server.name);
90878
+ const { session } = ctx;
90879
+ const choices = await sources.list({ cwd: session.cwd, names, tools: session.tools.list(), sessionId: session.id });
90880
+ return { agent: sources.agent, choices };
90881
+ }
90882
+ async function handleMcpSetSource(ctx, raw) {
90883
+ const { name, source } = mcpSourceParamsSchema.parse(raw);
90884
+ const sources = activeSources(ctx);
90885
+ if (!sources)
90886
+ throw new Error("This chat\u2019s agent has no MCP servers of its own: the choice is unavailable.");
90887
+ await sources.set(name, source);
90888
+ return {};
90889
+ }
90890
+ async function handleMcpTestServer(ctx, raw) {
90891
+ const { name } = mcpNamedEntrySchema.parse(raw);
90892
+ const admin = ctx.session.mcpAdmin;
90893
+ if (!admin?.testServer)
90894
+ throw new Error("MCP connection test unavailable.");
90895
+ return admin.testServer(name);
90896
+ }
90897
+ async function handleMcpAddServer(ctx, raw) {
90898
+ const { entry } = mcpAddServerParamsSchema.parse(raw);
90899
+ const admin = ctx.session.mcpAdmin;
90900
+ if (!admin?.addServer)
90901
+ throw new Error("Adding an MCP server is unavailable.");
90902
+ return admin.addServer(entry);
90903
+ }
90607
90904
  var init_mcp_handlers = __esm({
90608
90905
  "../runner/dist/handlers/mcp-handlers.js"() {
90609
90906
  init_protocol2();
@@ -90909,6 +91206,10 @@ var init_server2 = __esm({
90909
91206
  peer.handle(RunnerMethod.CancelSynthesize, (raw) => handleCancelSynthesize(raw));
90910
91207
  peer.handle(RunnerMethod.McpListServers, () => handleMcpListServers(ctx));
90911
91208
  peer.handle(RunnerMethod.McpEnableAndAttach, (raw) => handleMcpEnableAndAttach(ctx, raw));
91209
+ peer.handle(RunnerMethod.McpSources, () => handleMcpSources(ctx));
91210
+ peer.handle(RunnerMethod.McpSetSource, (raw) => handleMcpSetSource(ctx, raw));
91211
+ peer.handle(RunnerMethod.McpTestServer, (raw) => handleMcpTestServer(ctx, raw));
91212
+ peer.handle(RunnerMethod.McpAddServer, (raw) => handleMcpAddServer(ctx, raw));
90912
91213
  peer.handle(RunnerMethod.McpDetach, (raw) => handleMcpDetach(ctx, raw));
90913
91214
  peer.handle(RunnerMethod.WorkflowList, () => handleWorkflowList(ctx));
90914
91215
  peer.handle(RunnerMethod.WorkflowSetEnabled, (raw) => handleWorkflowSetEnabled(ctx, raw));
@@ -91599,6 +91900,22 @@ var init_permissions = __esm({
91599
91900
  function makeMcpAdminView(ctx) {
91600
91901
  const { peer } = ctx;
91601
91902
  return {
91903
+ sources: () => {
91904
+ ctx.requireServerProtocol(37, "MCP source selection");
91905
+ return peer.request(RunnerMethod.McpSources);
91906
+ },
91907
+ setSource: async (name, source) => {
91908
+ ctx.requireServerProtocol(37, "MCP source selection");
91909
+ await peer.request(RunnerMethod.McpSetSource, { name, source });
91910
+ },
91911
+ testServer: (name) => {
91912
+ ctx.requireServerProtocol(37, "MCP connection test");
91913
+ return peer.request(RunnerMethod.McpTestServer, { name });
91914
+ },
91915
+ addServer: (entry) => {
91916
+ ctx.requireServerProtocol(37, "Adding an MCP server");
91917
+ return peer.request(RunnerMethod.McpAddServer, { entry });
91918
+ },
91602
91919
  listServers: () => peer.request(RunnerMethod.McpListServers),
91603
91920
  enableAndAttach: (name) => peer.request(RunnerMethod.McpEnableAndAttach, { name }),
91604
91921
  detach: (name) => peer.request(RunnerMethod.McpDetach, { name })
@@ -93747,11 +94064,13 @@ async function runServeStatus(except, all) {
93747
94064
  return 0;
93748
94065
  }
93749
94066
  async function runServeForeground(argv, except, all) {
93750
- const stickySessionId = process.env["MOXXY_SESSION_ID"]?.trim();
94067
+ const transient = process.env["MOXXY_TRANSIENT_RUNNER"] === "1";
94068
+ const stickySessionId = transient ? void 0 : process.env["MOXXY_SESSION_ID"]?.trim();
93751
94069
  const setup = await bootSessionWithConfig(argv, {
93752
94070
  skipKeyPrompt: true,
93753
94071
  tolerateNoProvider: true,
93754
- ...stickySessionId ? { sessionId: stickySessionId } : {}
94072
+ ...stickySessionId ? { sessionId: stickySessionId } : {},
94073
+ ...transient ? { disableSessionPersistence: true, disableBackgroundDaemons: true } : {}
93755
94074
  });
93756
94075
  const { session, vault, config, scheduler, webhooks } = setup;
93757
94076
  const setupHandle = { scheduler, webhooks };
@@ -93809,7 +94128,7 @@ async function runServeForeground(argv, except, all) {
93809
94128
  const webHandle = await coAttachWebSurface({ primary: "serve", session, vault, config });
93810
94129
  if (webHandle) started.push({ name: "web", handle: webHandle });
93811
94130
  }
93812
- const runningBackground = BACKGROUND_UNITS.filter((u5) => !except.has(u5.id)).map((u5) => u5.id);
94131
+ const runningBackground = transient ? [] : BACKGROUND_UNITS.filter((u5) => !except.has(u5.id)).map((u5) => u5.id);
93813
94132
  printStartupSummary({
93814
94133
  started: started.map((s) => s.name),
93815
94134
  failed,
@@ -94887,6 +95206,12 @@ var init_moxxy_tools = __esm({
94887
95206
  init_tool_catalog();
94888
95207
  }
94889
95208
  });
95209
+ var init_mcp_sources = __esm({
95210
+ "../agent-connection-kit/dist/mcp-sources.js"() {
95211
+ init_moxxy_tools();
95212
+ z$1.object({ items: z$1.array(z$1.object({ id: z$1.string() })) });
95213
+ }
95214
+ });
94890
95215
  var init_lines = __esm({
94891
95216
  "../agent-connection-kit/dist/lines.js"() {
94892
95217
  }
@@ -95984,6 +96309,7 @@ var init_dist34 = __esm({
95984
96309
  "../agent-connection-kit/dist/index.js"() {
95985
96310
  init_mcp_server();
95986
96311
  init_agent_skills();
96312
+ init_mcp_sources();
95987
96313
  init_moxxy_tools();
95988
96314
  init_json_rpc();
95989
96315
  init_lines();
@@ -101956,9 +102282,9 @@ async function runRotateToken(argv) {
101956
102282
  printError("usage: moxxy channels rotate-token <name>");
101957
102283
  return 2;
101958
102284
  }
101959
- const fileName = `${channelName}-token`;
101960
- rotateChannelToken({ fileName });
101961
- const file = path3__default.join(moxxyHome(), fileName);
102285
+ const fileName2 = `${channelName}-token`;
102286
+ rotateChannelToken({ fileName: fileName2 });
102287
+ const file = path3__default.join(moxxyHome(), fileName2);
101962
102288
  process.stdout.write(
101963
102289
  `${colors.bold(channelName)} ${colors.dim("pairing token rotated")}
101964
102290
  ${colors.dim(`new secret written to ${file}`)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxxy/cli",
3
- "version": "0.50.2",
3
+ "version": "0.50.4",
4
4
  "description": "moxxy command-line agent: TUI, one-shot prompts, setup, services, and API-key or installed-CLI subscription providers.",
5
5
  "keywords": [
6
6
  "moxxy",
@@ -49,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "undici": "^8.12.2",
51
51
  "zod": "^4.6.7",
52
- "@moxxy/sdk": "0.50.2"
52
+ "@moxxy/sdk": "0.50.4"
53
53
  },
54
54
  "optionalDependencies": {
55
55
  "@napi-rs/keyring": "^2.1.2"