@super-one/cli 0.75.3 → 0.75.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/MANIFEST.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@super-one/cli",
3
- "version": "0.75.3",
3
+ "version": "0.75.4",
4
4
  "kind": "npm",
5
5
  "minNodeMajor": 20,
6
- "builtAt": "2026-10-20T10:20:27.095Z"
6
+ "builtAt": "2026-10-21T04:02:10.353Z"
7
7
  }
package/lib/cli.mjs CHANGED
@@ -137,8 +137,8 @@ import { fileURLToPath } from "node:url";
137
137
  function resolveCliReleaseVersion() {
138
138
  const fromEnv = process.env.SUPERONE_CLI_VERSION?.trim();
139
139
  if (fromEnv) return fromEnv;
140
- if ("0.75.3".trim()) {
141
- return "0.75.3".trim();
140
+ if ("0.75.4".trim()) {
141
+ return "0.75.4".trim();
142
142
  }
143
143
  const fromDist = readDistManifestVersion();
144
144
  if (fromDist) return fromDist;
@@ -12818,6 +12818,8 @@ var init_agent_types = __esm({
12818
12818
  ENVIRONMENT_LIST_DRAFTS: "environment:listDrafts",
12819
12819
  ENVIRONMENT_UPSERT_DRAFT: "environment:upsertDraft",
12820
12820
  ENVIRONMENT_DELETE_DRAFT: "environment:deleteDraft",
12821
+ ENVIRONMENT_OPEN_DRAFT: "environment:openDraft",
12822
+ ENVIRONMENT_CLOSE_DRAFT: "environment:closeDraft",
12821
12823
  ENVIRONMENT_DISCONNECT_DRAFT: "environment:disconnectDraft",
12822
12824
  ENVIRONMENT_PREPARE_DRAFT_OPEN: "environment:prepareDraftOpen",
12823
12825
  ENVIRONMENT_DRAFT_OPEN_READY: "environment:draftOpenReady",
@@ -12881,6 +12883,8 @@ var init_agent_types = __esm({
12881
12883
  ENVIRONMENT_INSTALL_PROGRESS: "environment:installProgress",
12882
12884
  /** Node-local AI provider credentials (masked). */
12883
12885
  ENVIRONMENT_PROVIDER_LIST_CREDENTIALS: "environment:providerListCredentials",
12886
+ /** Claude subscription accounts on the node, not the controller. */
12887
+ ENVIRONMENT_CLAUDE_LIST_ACCOUNTS: "environment:claudeListAccounts",
12884
12888
  ENVIRONMENT_PROVIDER_CREATE_CREDENTIAL: "environment:providerCreateCredential",
12885
12889
  ENVIRONMENT_PROVIDER_UPDATE_CREDENTIAL: "environment:providerUpdateCredential",
12886
12890
  ENVIRONMENT_PROVIDER_DELETE_CREDENTIAL: "environment:providerDeleteCredential",
@@ -34053,29 +34057,88 @@ var init_async_coalescer = __esm({
34053
34057
  ttlMs;
34054
34058
  cache = /* @__PURE__ */ new Map();
34055
34059
  inFlight = /* @__PURE__ */ new Map();
34056
- get(key, compute) {
34057
- if (this.ttlMs > 0) {
34058
- const hit = this.cache.get(key);
34059
- if (hit && Date.now() - hit.at < this.ttlMs) return Promise.resolve(hit.value);
34060
+ generation = /* @__PURE__ */ new Map();
34061
+ ttlFor(key) {
34062
+ return typeof this.ttlMs === "function" ? this.ttlMs(key) : this.ttlMs;
34063
+ }
34064
+ generationOf(key) {
34065
+ return this.generation.get(key) ?? 0;
34066
+ }
34067
+ bump(key) {
34068
+ this.generation.set(key, this.generationOf(key) + 1);
34069
+ }
34070
+ readFresh(key) {
34071
+ const ttl = this.ttlFor(key);
34072
+ if (!(ttl > 0)) return null;
34073
+ const hit = this.cache.get(key);
34074
+ if (!hit) return null;
34075
+ if (Number.isFinite(ttl) && Date.now() - hit.at >= ttl) return null;
34076
+ return hit;
34077
+ }
34078
+ /** Cached value still inside its TTL, if any. */
34079
+ peek(key) {
34080
+ return this.readFresh(key)?.value;
34081
+ }
34082
+ /**
34083
+ * Remember a value the caller already fetched. An older in-flight result
34084
+ * will not overwrite it.
34085
+ */
34086
+ remember(key, value) {
34087
+ if (this.ttlFor(key) > 0) this.cache.set(key, { at: Date.now(), value });
34088
+ this.bump(key);
34089
+ this.inFlight.delete(key);
34090
+ }
34091
+ /** True when a compute for the current generation is still running. */
34092
+ isInFlight(key) {
34093
+ const running = this.inFlight.get(key);
34094
+ return !!running && running.generation === this.generationOf(key);
34095
+ }
34096
+ get(key, compute, options) {
34097
+ const force = options?.force === true;
34098
+ if (!force) {
34099
+ const hit = this.readFresh(key);
34100
+ if (hit) return Promise.resolve(hit.value);
34101
+ } else {
34102
+ this.cache.delete(key);
34060
34103
  }
34104
+ const generation = this.generationOf(key);
34061
34105
  const running = this.inFlight.get(key);
34062
- if (running) return running;
34106
+ if (running && running.generation === generation && (running.force || !force)) {
34107
+ return running.promise;
34108
+ }
34109
+ let started = generation;
34110
+ if (force && running && running.generation === generation && !running.force) {
34111
+ this.bump(key);
34112
+ started = this.generationOf(key);
34113
+ }
34114
+ const cacheIf = options?.cacheIf;
34063
34115
  const promise2 = compute().then((value) => {
34064
- if (this.ttlMs > 0) this.cache.set(key, { at: Date.now(), value });
34116
+ if (this.generationOf(key) === started && this.ttlFor(key) > 0 && (!cacheIf || cacheIf(value))) {
34117
+ this.cache.set(key, { at: Date.now(), value });
34118
+ }
34065
34119
  return value;
34066
34120
  }).finally(() => {
34067
- if (this.inFlight.get(key) === promise2) this.inFlight.delete(key);
34121
+ if (this.inFlight.get(key)?.promise === promise2) this.inFlight.delete(key);
34068
34122
  });
34069
- this.inFlight.set(key, promise2);
34123
+ this.inFlight.set(key, { generation: started, promise: promise2, force });
34070
34124
  return promise2;
34071
34125
  }
34072
- /** Drop a cached result. In-flight work is left alone — it is already the newest read. */
34126
+ /** Drop a cached result and detach the in-flight compute so the next get starts over. */
34073
34127
  invalidate(key) {
34074
34128
  this.cache.delete(key);
34129
+ this.bump(key);
34130
+ this.inFlight.delete(key);
34131
+ }
34132
+ /** Drop every cached key that matches. In-flight computes for those keys are detached too. */
34133
+ invalidateMatching(match) {
34134
+ const keys = /* @__PURE__ */ new Set([...this.cache.keys(), ...this.inFlight.keys(), ...this.generation.keys()]);
34135
+ for (const key of keys) if (match(key)) this.invalidate(key);
34075
34136
  }
34076
34137
  /** Drop all cached results (tests / host disconnect). */
34077
34138
  clear() {
34078
34139
  this.cache.clear();
34140
+ for (const key of this.inFlight.keys()) this.bump(key);
34141
+ this.inFlight.clear();
34079
34142
  }
34080
34143
  };
34081
34144
  }
@@ -104467,7 +104530,7 @@ async function startNodeServer(opts) {
104467
104530
  return;
104468
104531
  }
104469
104532
  wire = createConnectionWire(ws2, accept.finish(msg));
104470
- send({ type: "channel_ready" });
104533
+ send({ type: "channel_ready", inlineAuth: true });
104471
104534
  return;
104472
104535
  }
104473
104536
  if (!isBinary) throw new SecureChannelError("channel_protocol", "expected a sealed binary frame");
@@ -104587,7 +104650,10 @@ async function handleHttp(req, res, opts) {
104587
104650
  ok: !opts.identity.identityConflict,
104588
104651
  environmentId: opts.identity.environmentId,
104589
104652
  nodePublicKeyFingerprint: opts.identity.publicKeyFingerprint,
104590
- identityConflict: opts.identity.identityConflict === true
104653
+ identityConflict: opts.identity.identityConflict === true,
104654
+ // Same capability as channel_ready. Absent on nodes that only speak the
104655
+ // separate-socket auth exchanges.
104656
+ ...opts.secureChannel ? { inlineAuth: true } : {}
104591
104657
  });
104592
104658
  return;
104593
104659
  }
@@ -104664,7 +104730,9 @@ function handleAuthRequest(path, body, bearer, opts) {
104664
104730
  proofSignature,
104665
104731
  verifyDeviceProof: opts.verifyDeviceProof
104666
104732
  });
104667
- return { status: 200, body: result3 };
104733
+ if (body.issueTicket !== true) return { status: 200, body: result3 };
104734
+ const ticket = opts.auth.createWsTicket(result3.accessToken);
104735
+ return { status: 200, body: { ...result3, ticket: ticket.ticket, ticketExpiresAt: ticket.expiresAt } };
104668
104736
  } catch (err) {
104669
104737
  return failure(err, "token refresh failed");
104670
104738
  }
@@ -108634,18 +108702,23 @@ function extendHistoryIndex(base, messages) {
108634
108702
  function handleSessionGet(payload, ctx) {
108635
108703
  const denied = requireScopes(ctx.client, OPERATION_SCOPES.readSession);
108636
108704
  if (denied) return denied;
108637
- const sessionId = String(asRecord(payload).sessionId ?? "");
108705
+ const body = asRecord(payload);
108706
+ const sessionId = String(body.sessionId ?? "");
108638
108707
  if (!ctx.sessions) return mapThrown(unsupportedMethodError("session.get"));
108639
108708
  const session = ctx.sessions.get(sessionId);
108640
- const config2 = session?.harnessId === "acp" ? ctx.sessionProviders?.get(session.providerId)?.config : void 0;
108641
108709
  if (!session) return { result: null };
108642
- const { transcript, ...metadata } = session;
108710
+ const { transcript, acpAgentId: recordedAgentId, ...metadata } = session;
108711
+ const configAgentId = session.harnessId === "acp" ? ctx.sessionProviders?.get(session.providerId)?.config?.agentId : void 0;
108712
+ const acpAgentId = namedAgent(recordedAgentId) ?? namedAgent(configAgentId);
108643
108713
  return { result: {
108644
108714
  ...metadata,
108645
- ...asRecord(payload).includeTranscript === false ? {} : { transcript },
108646
- ...session.harnessId === "acp" ? { acpAgentId: config2?.agentId ?? null } : {}
108715
+ ...body.includeTranscript === false ? {} : { transcript },
108716
+ ...acpAgentId ? { acpAgentId } : {}
108647
108717
  } };
108648
108718
  }
108719
+ function namedAgent(value) {
108720
+ return typeof value === "string" && value ? value : void 0;
108721
+ }
108649
108722
  async function handleSessionLoad(payload, ctx) {
108650
108723
  const denied = requireScopes(ctx.client, OPERATION_SCOPES.readSession);
108651
108724
  if (denied) return denied;
@@ -111100,6 +111173,7 @@ function mapSessionRow(s4) {
111100
111173
  providerResume,
111101
111174
  ...providerSessionId ? { providerSessionId } : {},
111102
111175
  ...s4.parentSessionId ? { parentSessionId: s4.parentSessionId } : {},
111176
+ ...typeof s4.acpAgentId === "string" && s4.acpAgentId ? { acpAgentId: s4.acpAgentId } : {},
111103
111177
  tags: Array.isArray(s4.tags) ? s4.tags : []
111104
111178
  };
111105
111179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-one/cli",
3
- "version": "0.75.3",
3
+ "version": "0.75.4",
4
4
  "description": "SuperOne headless node CLI — remote execution environment (RPC, workspaces, sessions).",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",