@moxxy/cli 0.48.3 → 0.49.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.
Files changed (2) hide show
  1. package/dist/bin.js +59 -7
  2. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -29,7 +29,8 @@ import { Stream, PassThrough } from 'stream';
29
29
  import tty, { ReadStream } from 'tty';
30
30
  import { EventEmitter } from 'events';
31
31
  import { isAgentWorkEvent } from '@moxxy/sdk/agent-work';
32
- import { isFileDiffDisplay as isFileDiffDisplay$1, isQuestionAnswerDisplay, toolImagesOf, isToolDisplayResult, isStepListDisplay } from '@moxxy/sdk/tool-display';
32
+ import { isFileDiffDisplay as isFileDiffDisplay$1, isQuestionAnswerDisplay, toolImagesOf, stepsAllDone, isToolDisplayResult, isStepListDisplay } from '@moxxy/sdk/tool-display';
33
+ import { isGoalMetEvent } from '@moxxy/sdk/agent-step';
33
34
  import { agentComputerUseOf } from '@moxxy/sdk/agent-computer-use';
34
35
  import { questionRecord, QUESTION_CLOSED_AGENT_WENT_ON, QUESTION_CLOSED_NEW_MESSAGE } from '@moxxy/sdk/questions';
35
36
  import { accountLimitInForce, recordedAccountLimit } from '@moxxy/sdk/agent-account-limit';
@@ -20154,6 +20155,11 @@ var init_agent_cli_watch = __esm({
20154
20155
  models(name) {
20155
20156
  return this.offered.get(name);
20156
20157
  }
20158
+ /** End the live sessions of one agent connection (before a sign-out); a name with no agent is a no-op. */
20159
+ async closeSessions(name) {
20160
+ const def = this.providers().find((p3) => p3.name === name);
20161
+ await def?.agentCli?.closeSessions?.();
20162
+ }
20157
20163
  /** Called when a CLI's state or version changed; returns the unsubscribe. */
20158
20164
  onChange(listener) {
20159
20165
  this.listeners.add(listener);
@@ -71778,6 +71784,8 @@ function createFoldState(compactByName = EMPTY_COMPACT_MAP) {
71778
71784
  function stepFold(s, e) {
71779
71785
  if (isAgentWorkEvent(e))
71780
71786
  return;
71787
+ if (isGoalMetEvent(e) && s.openSteps)
71788
+ s.openSteps.goalMet = true;
71781
71789
  const pushBlock = (block2) => {
71782
71790
  s.subagentGroup.current = null;
71783
71791
  if (s.openScope) {
@@ -71978,7 +71986,7 @@ function stepListOf(block2) {
71978
71986
  const call = block2.calls[i2];
71979
71987
  const list = call ? stepListOfCall(call) : null;
71980
71988
  if (list)
71981
- return list;
71989
+ return block2.goalMet ? stepsAllDone(list) : list;
71982
71990
  }
71983
71991
  return null;
71984
71992
  }
@@ -71989,7 +71997,7 @@ function joinStepList(s, call) {
71989
71997
  open3.calls.push(call);
71990
71998
  return;
71991
71999
  }
71992
- const list = { kind: "step-list", id: call.id, calls: [call], closed: false };
72000
+ const list = { kind: "step-list", id: call.id, calls: [call], closed: false, goalMet: false };
71993
72001
  if (replaceCallBlock(s.root, call.request.callId, list))
71994
72002
  s.openSteps = list;
71995
72003
  }
@@ -72093,7 +72101,7 @@ function blocksEquivalent(a2, b3) {
72093
72101
  return true;
72094
72102
  }
72095
72103
  if (a2.kind === "step-list" && b3.kind === "step-list") {
72096
- if (a2.closed !== b3.closed || a2.calls.length !== b3.calls.length)
72104
+ if (a2.closed !== b3.closed || a2.goalMet !== b3.goalMet || a2.calls.length !== b3.calls.length)
72097
72105
  return false;
72098
72106
  return a2.calls.every((call, i2) => {
72099
72107
  const other = b3.calls[i2];
@@ -89655,10 +89663,10 @@ function surfaceInputWithinCap(m3) {
89655
89663
  return true;
89656
89664
  return JSON.stringify(m3).length <= MAX_SURFACE_INPUT_BYTES;
89657
89665
  }
89658
- var RUNNER_PROTOCOL_VERSION, MIN_COMPATIBLE_PROTOCOL_VERSION, RunnerMethod, RunnerNotification, attachmentSchema, principalSchema, attachParamsSchema, runTurnParamsSchema, abortParamsSchema, setResolverParamsSchema, questionAnswerParamsSchema, modeSetActiveParamsSchema, sessionSetReasoningParamsSchema, sessionSetFastParamsSchema, MAX_HISTORY_PAGE_LIMIT, sessionLoadHistoryParamsSchema, sessionReadAttachmentParamsSchema, MAX_RECORDED_EXCHANGE_CHARS, recordedText, sessionRecordExchangeParamsSchema, sessionSetAutoApproveParamsSchema, sessionStopBackgroundWorkParamsSchema, 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;
89666
+ var RUNNER_PROTOCOL_VERSION, MIN_COMPATIBLE_PROTOCOL_VERSION, RunnerMethod, RunnerNotification, attachmentSchema, principalSchema, attachParamsSchema, runTurnParamsSchema, abortParamsSchema, setResolverParamsSchema, 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;
89659
89667
  var init_protocol2 = __esm({
89660
89668
  "../runner/dist/protocol.js"() {
89661
- RUNNER_PROTOCOL_VERSION = 33;
89669
+ RUNNER_PROTOCOL_VERSION = 34;
89662
89670
  MIN_COMPATIBLE_PROTOCOL_VERSION = 1;
89663
89671
  RunnerMethod = {
89664
89672
  /** client->server: handshake; returns the initial info snapshot. */
@@ -89729,6 +89737,7 @@ var init_protocol2 = __esm({
89729
89737
  ProviderRefreshReady: "provider.refreshReady",
89730
89738
  /** client->server: check every agent connection's CLI again, asking the vendors' registry anew (v28). */
89731
89739
  ProviderCheckAgents: "provider.checkAgents",
89740
+ ProviderCloseAgentSessions: "provider.closeAgentSessions",
89732
89741
  /** client->server: patch a stored (runtime-registered) provider's config (v7). */
89733
89742
  ProviderConfigure: "provider.configure",
89734
89743
  /** client->server: persist an allow-always permission rule. */
@@ -89883,6 +89892,9 @@ var init_protocol2 = __esm({
89883
89892
  name: z.string(),
89884
89893
  config: z.record(z.unknown()).optional()
89885
89894
  });
89895
+ providerCloseAgentSessionsParamsSchema = z.object({
89896
+ name: z.string().min(1)
89897
+ });
89886
89898
  providerSetEnabledParamsSchema = z.object({
89887
89899
  name: z.string().min(1),
89888
89900
  enabled: z.boolean()
@@ -90111,6 +90123,11 @@ async function handleProviderConfigure(ctx, raw) {
90111
90123
  broadcastInfo();
90112
90124
  return {};
90113
90125
  }
90126
+ async function handleProviderCloseAgentSessions(ctx, raw) {
90127
+ const { name } = providerCloseAgentSessionsParamsSchema.parse(raw);
90128
+ await ctx.session.agentClis.closeSessions(name);
90129
+ return {};
90130
+ }
90114
90131
  async function handleProviderCheckAgents(ctx) {
90115
90132
  await ctx.session.agentClis.check({ refresh: true });
90116
90133
  return {};
@@ -90507,6 +90524,7 @@ var init_server2 = __esm({
90507
90524
  peer.handle(RunnerMethod.ProviderSetEnabled, (raw) => handleProviderSetEnabled(ctx, raw));
90508
90525
  peer.handle(RunnerMethod.ProviderRefreshReady, () => handleProviderRefreshReady(ctx));
90509
90526
  peer.handle(RunnerMethod.ProviderCheckAgents, () => handleProviderCheckAgents(ctx));
90527
+ peer.handle(RunnerMethod.ProviderCloseAgentSessions, (raw) => handleProviderCloseAgentSessions(ctx, raw));
90510
90528
  peer.handle(RunnerMethod.ProviderConfigure, (raw) => handleProviderConfigure(ctx, raw));
90511
90529
  peer.handle(RunnerMethod.PermissionAddAllow, (raw) => handlePermissionAddAllow(ctx, raw));
90512
90530
  peer.handle(RunnerMethod.CommandRun, (raw) => handleCommandRun(ctx, raw));
@@ -91226,6 +91244,10 @@ function makeProviderAdminView(ctx) {
91226
91244
  requireServerProtocol(28, "Checking agent CLIs for updates");
91227
91245
  await peer.request(RunnerMethod.ProviderCheckAgents, {});
91228
91246
  },
91247
+ closeAgentSessions: async (name) => {
91248
+ requireServerProtocol(34, "Signing out of an agent");
91249
+ await peer.request(RunnerMethod.ProviderCloseAgentSessions, { name });
91250
+ },
91229
91251
  configure: async (name, patch) => {
91230
91252
  requireServerProtocol(7, "Configuring a provider");
91231
91253
  await peer.request(RunnerMethod.ProviderConfigure, { name, patch });
@@ -94678,7 +94700,12 @@ function codexWindowsPrograms(arch) {
94678
94700
  fromRealPackage: true,
94679
94701
  env: (packageRoot) => ({ CODEX_MANAGED_BY_PNPM: "1", CODEX_MANAGED_PACKAGE_ROOT: packageRoot })
94680
94702
  };
94681
- return [...shimRelative, pnpm];
94703
+ const searched = {
94704
+ path: `@openai/${build2.pkg}/${program}`,
94705
+ fromNodeSearch: true,
94706
+ env: (packageRoot) => ({ CODEX_MANAGED_BY_NPM: "1", CODEX_MANAGED_PACKAGE_ROOT: packageRoot })
94707
+ };
94708
+ return [...shimRelative, pnpm, searched];
94682
94709
  }
94683
94710
  function searchOptions(desc, opts) {
94684
94711
  const platform2 = opts.platform ?? process.platform;
@@ -94862,6 +94889,15 @@ function windowsShimRoot(desc, found, read) {
94862
94889
  }
94863
94890
  return path3__default.win32.dirname(found);
94864
94891
  }
94892
+ function nodeSearchFolders(from) {
94893
+ const folders = [];
94894
+ for (let dir = from; ; dir = path3__default.win32.dirname(dir)) {
94895
+ if (path3__default.win32.basename(dir).toLowerCase() !== "node_modules")
94896
+ folders.push(path3__default.win32.join(dir, "node_modules"));
94897
+ if (path3__default.win32.dirname(dir) === dir)
94898
+ return folders;
94899
+ }
94900
+ }
94865
94901
  function agentCliTargetAt(desc, found, opts = {}) {
94866
94902
  const platform2 = opts.platform ?? process.platform;
94867
94903
  if (platform2 !== "win32")
@@ -94882,6 +94918,15 @@ function agentCliTargetAt(desc, found, opts = {}) {
94882
94918
  }
94883
94919
  };
94884
94920
  for (const program of desc.windowsShim.native?.(opts.arch ?? process.arch) ?? []) {
94921
+ if (program.fromNodeSearch) {
94922
+ const packageRoot = realPackage() ?? at(`node_modules/${desc.npmPackage}`);
94923
+ for (const modules of nodeSearchFolders(packageRoot)) {
94924
+ const command2 = path3__default.win32.join(modules, ...program.path.split("/"));
94925
+ if (exists3(command2))
94926
+ return program.env ? { kind: "direct", command: command2, env: program.env(packageRoot) } : { kind: "direct", command: command2 };
94927
+ }
94928
+ continue;
94929
+ }
94885
94930
  const root = program.fromRealPackage ? realPackage() : dir;
94886
94931
  if (!root)
94887
94932
  continue;
@@ -95421,6 +95466,12 @@ var init_stop_agent = __esm({
95421
95466
  }
95422
95467
  });
95423
95468
 
95469
+ // ../agent-connection-kit/dist/agent-env.js
95470
+ var init_agent_env = __esm({
95471
+ "../agent-connection-kit/dist/agent-env.js"() {
95472
+ }
95473
+ });
95474
+
95424
95475
  // ../agent-connection-kit/dist/index.js
95425
95476
  var init_dist34 = __esm({
95426
95477
  "../agent-connection-kit/dist/index.js"() {
@@ -95437,6 +95488,7 @@ var init_dist34 = __esm({
95437
95488
  init_one_off_prompt();
95438
95489
  init_resume();
95439
95490
  init_stop_agent();
95491
+ init_agent_env();
95440
95492
  }
95441
95493
  });
95442
95494
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxxy/cli",
3
- "version": "0.48.3",
3
+ "version": "0.49.0",
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.48.3"
52
+ "@moxxy/sdk": "0.49.0"
53
53
  },
54
54
  "optionalDependencies": {
55
55
  "@napi-rs/keyring": "^2.1.2"