@lucascouts/claude-agent-acp-plus 0.27.0 → 0.28.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.
@@ -1,5 +1,5 @@
1
1
  import { AuthenticateRequest, CancelNotification, ClientCapabilities, CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, DisableProviderRequest, DisableProviderResponse, ForkSessionRequest, ForkSessionResponse, InitializeRequest, InitializeResponse, ListProvidersRequest, ListProvidersResponse, LlmProtocol, ListSessionsRequest, ListSessionsResponse, LoadSessionRequest, LoadSessionResponse, LogoutRequest, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse, ReadTextFileRequest, ReadTextFileResponse, SetProviderRequest, SetProviderResponse, RequestPermissionRequest, RequestPermissionResponse, ResumeSessionRequest, ResumeSessionResponse, SessionConfigOption, SessionModeState, SessionNotification, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, SetSessionModeRequest, SetSessionModeResponse, CloseSessionRequest, CloseSessionResponse, DeleteSessionRequest, DeleteSessionResponse, WriteTextFileRequest, WriteTextFileResponse } from "@agentclientprotocol/sdk";
2
- import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage, Settings } from "@anthropic-ai/claude-agent-sdk";
2
+ import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
3
3
  import { GoalRequest, GoalControlResponse, GoalSnapshot } from "./goal-extension.js";
4
4
  import { SessionTitles } from "./session-titles.js";
5
5
  import { ContentBlockParam } from "@anthropic-ai/sdk/resources";
@@ -450,12 +450,13 @@ export type Session = {
450
450
  * user's intent so it persists across model switches; the Fast mode config
451
451
  * option is only surfaced while the selected model supports it. */
452
452
  fastModeEnabled: boolean;
453
- /** Whether Ultracode is the session's current effort selection. Tracked as
454
- * intent for the same reason `fastModeEnabled` is: the entry disappears from
455
- * the picker on a model without `xhigh`, and reappears selected when a model
456
- * that has it is chosen again. It is NOT derivable from the effort level —
457
- * `xhigh` on its own is a legitimate selection that is not Ultracode. */
458
- ultracode: boolean;
453
+ /** The Ultracode intent, kept apart from availability (`ultracode.ts`): the
454
+ * option hides on a model that cannot run it and reappears with this value
455
+ * when one that can is chosen again. */
456
+ ultracodeRequested: boolean;
457
+ /** Whether the Ultracode option is shown — the CLI's
458
+ * `applied.ultracodeAvailable` once read back, the heuristic until then. */
459
+ ultracodeAvailable: boolean;
459
460
  /** Whether this session's resolved settings disable workflows — the half of
460
461
  * the Ultracode gate that is not a model capability. Read once at
461
462
  * initialize and held, rather than re-read per model switch: settings are
@@ -1353,6 +1354,16 @@ export declare class ClaudeAcpAgent {
1353
1354
  * once the option exists (i.e. the current model supports fast mode), so the
1354
1355
  * option is guaranteed to be present in `configOptions`. */
1355
1356
  private applyFastMode;
1357
+ /** The Ultracode display state for `buildConfigOptions`. */
1358
+ private ultracodeState;
1359
+ /**
1360
+ * Replace the Ultracode heuristic with the CLI's `applied` report, without
1361
+ * blocking the caller — never inline, because control requests queue ahead
1362
+ * of interrupt and close (upstream #1216). `seedIntent` at session start; a
1363
+ * model switch keeps its intent and only re-reads availability. Deferred a
1364
+ * tick so a resulting `config_option_update` follows the session/new reply.
1365
+ */
1366
+ private refreshUltracodeInBackground;
1356
1367
  /** Lazily swap a session's SDK query for a fresh one so a Thinking change
1357
1368
  * takes effect on the next turn (R1.3): thinking has no live flag-settings
1358
1369
  * path in the SDK, so mid-session application goes through query recreation
@@ -1499,17 +1510,12 @@ export declare function buildConfigOptions(modes: SessionModeState, models: Sess
1499
1510
  * Both session call sites always supply it (R1.1); `undefined` (direct
1500
1511
  * callers/tests) omits the row. */
1501
1512
  thinkingEnabled?: boolean,
1502
- /** Display state for the Ultracode entry of the effort picker. Omitted by
1503
- * direct callers/tests, in which case availability is derived from
1504
- * `settings` and the entry renders unselected. */
1513
+ /** Display state for the Ultracode option, placed after effort. Omitted by
1514
+ * direct callers/tests, in which case the option is not shown. */
1505
1515
  ultracode?: UltracodeOptionState,
1506
- /** Resolved session settings, read for `disableWorkflows` — the half of the
1507
- * Ultracode gate that is not a model capability — and, alongside them, the
1508
- * declared accounts plus the one in force, which decide whether an account
1509
- * selector is advertised at all (R6.1/R6.2). `accounts` is not a field of
1510
- * the SDK's `Settings`, so it is carried beside them rather than picked
1511
- * from them. */
1512
- settings?: Pick<Settings, "disableWorkflows"> & AccountOptionState): SessionConfigOption[];
1516
+ /** The declared accounts plus the one in force, which decide whether an
1517
+ * account selector is advertised at all (R6.1/R6.2). */
1518
+ settings?: AccountOptionState): SessionConfigOption[];
1513
1519
  export declare function resolveModelPreference(models: ModelInfo[], preference: string): ModelInfo | null;
1514
1520
  /** Map the live model reported by a resumed session onto the picker's model
1515
1521
  * list. The CLI restores a resumed session's model from the transcript's
@@ -1 +1 @@
1
- {"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EAGnB,kBAAkB,EAClB,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EAGb,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EAEd,mBAAmB,EACnB,oBAAoB,EAEpB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC7B,8BAA8B,EAC9B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AAE,sBAAsB,CAAC;CAC7C,GACA,mBAAmB,EAAE,CAgIvB;AAED;;;;;;;;;;;oEAWoE;AACpE,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAC3D,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAczB;AAED,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM;;;EAoErC"}
package/dist/acp-agent.js CHANGED
@@ -19,7 +19,7 @@ import { filterSupersededModels } from "./model-recency.js";
19
19
  import { SettingsManager } from "./settings.js";
20
20
  import { ContextCompactionLifecycle, contextCompactionMetadataFromBoundary, } from "./context-compaction.js";
21
21
  import { createThinkingConfigOption, effectiveThinkingConfig, resolveThinkingSelection, THINKING_CONFIG_ID, } from "./thinking-option.js";
22
- import { effortOptionValue, isUltracodeAvailable, isUltracodeValue, ULTRACODE_OPTION_NAME, ULTRACODE_OPTION_VALUE, ultracodeFlagSettings, } from "./ultracode.js";
22
+ import { applyLegacyUltracodeEffort, applyUltracodeReadback, applyUltracodeToggle, effortFlagSettings, isLegacyUltracodeEffort, isUltracodeAvailable, readUltracodeState, resolveUltracodeRequested, ULTRACODE_CONFIG_ID, ultracodeConfigOption, } from "./ultracode.js";
23
23
  import { handleRewindCommand, parseRewindInvocation } from "./rewind-command.js";
24
24
  import { resolvePermissionMode, sessionAllowsBypass } from "./permissions/modes.js";
25
25
  import { normalizeDurablePermissionChangeSet } from "./permissions/normalization.js";
@@ -284,7 +284,11 @@ export function quotaPollIntervalMs(raw = process.env.CLAUDE_ACP_QUOTA_POLL_MS)
284
284
  * (the result is skipped, its trailing idle absorbed as owed, so the
285
285
  * #825 detector can't fire); misrouting an autonomous result into the
286
286
  * user lane is the bounded misattribution class this set exists to
287
- * reduce. */
287
+ * reduce.
288
+ *
289
+ * Exception: a result from one of these origins that names a pending prompt
290
+ * in `user_message_uuids` consumed that folded prompt and takes the user
291
+ * lane (see the result handler). */
288
292
  const AUTONOMOUS_RESULT_ORIGINS = new Set([
289
293
  "task-notification",
290
294
  "peer",
@@ -2221,6 +2225,40 @@ export class ClaudeAcpAgent {
2221
2225
  };
2222
2226
  /** The unsettled in-flight turn owning this prompt uuid, if any. */
2223
2227
  const findUnsettledTurn = (uuid) => (session.turnQueue ?? []).find((t) => t.promptUuid === uuid && !t.settled);
2228
+ /** Whether this result is the answer to a prompt that is still waiting.
2229
+ *
2230
+ * Claude Code can start a turn on its own, for example when a background
2231
+ * task finishes. If the user sends a prompt while that turn runs, Claude
2232
+ * Code adds the prompt to the running turn. The turn's result is still
2233
+ * marked as a background result, but it lists the uuids of the prompts it
2234
+ * answered.
2235
+ *
2236
+ * A turn held open for its background subagents already has its result,
2237
+ * so a result that names it does not answer it. */
2238
+ const answersPendingPrompt = (message) => {
2239
+ // Newer CLIs list every prompt the turn answered. Older ones name only
2240
+ // the last one.
2241
+ let answeredPromptUuids = [];
2242
+ if (Array.isArray(message.user_message_uuids)) {
2243
+ answeredPromptUuids = message.user_message_uuids;
2244
+ }
2245
+ else if (typeof message.user_message_uuid === "string") {
2246
+ answeredPromptUuids = [message.user_message_uuid];
2247
+ }
2248
+ for (const promptUuid of answeredPromptUuids) {
2249
+ const turn = findUnsettledTurn(promptUuid);
2250
+ if (turn === undefined) {
2251
+ // Not a prompt of this session, or it was answered already.
2252
+ continue;
2253
+ }
2254
+ if (isHeldOpen(turn)) {
2255
+ // This turn already has its result and only waits for its subagents.
2256
+ continue;
2257
+ }
2258
+ return true;
2259
+ }
2260
+ return false;
2261
+ };
2224
2262
  /** The first queued turn still awaiting its outcome, if any — the single
2225
2263
  * spelling of "a prompt is pending" shared by the head promotion and
2226
2264
  * the autonomous stretch-close guard. */
@@ -3509,7 +3547,10 @@ export class ClaudeAcpAgent {
3509
3547
  // the user's prompt's. Autonomous results must never touch the
3510
3548
  // user-turn lifecycle (stop reason, settles, failActive,
3511
3549
  // slash-command output forwarding), though their cost is real.
3512
- const isAutonomousResult = message.origin != null && AUTONOMOUS_RESULT_ORIGINS.has(message.origin.kind);
3550
+ // The exception: the user's prompt was added to that turn while it
3551
+ // ran, so its result answers the prompt (see answersPendingPrompt).
3552
+ const startedByClaudeCode = message.origin != null && AUTONOMOUS_RESULT_ORIGINS.has(message.origin.kind);
3553
+ const isAutonomousResult = startedByClaudeCode && !answersPendingPrompt(message);
3513
3554
  const pendingExitPlanModeInterruption = session.pendingExitPlanModeInterruption;
3514
3555
  const pendingExitPlanContextReset = session.pendingExitPlanContextReset;
3515
3556
  try {
@@ -5068,6 +5109,18 @@ export class ClaudeAcpAgent {
5068
5109
  await this.applyFastMode(session, resolveFastModeEnabled(params));
5069
5110
  return { configOptions: session.configOptions };
5070
5111
  }
5112
+ // Ultracode is a boolean too, and bypasses the same validation. The legacy
5113
+ // `effort = "ultracode"` (the retired notch) is accepted for one release.
5114
+ const useBoolean = clientSupportsBooleanConfigOptions(this.clientCapabilities);
5115
+ if (params.configId === ULTRACODE_CONFIG_ID) {
5116
+ await applyUltracodeToggle(session, resolveUltracodeRequested(params), useBoolean);
5117
+ return { configOptions: session.configOptions };
5118
+ }
5119
+ if (params.configId === EFFORT_CONFIG_ID &&
5120
+ isLegacyUltracodeEffort(params.value) &&
5121
+ (await applyLegacyUltracodeEffort(session, useBoolean))) {
5122
+ return { configOptions: session.configOptions };
5123
+ }
5071
5124
  // The Thinking toggle only records the session's intent — the SDK query
5072
5125
  // swap is deferred to the next prompt() start (lazy recreate, sub-task
5073
5126
  // 1.3), so there is no SDK call to fail here and the config option is
@@ -5753,7 +5806,10 @@ export class ClaudeAcpAgent {
5753
5806
  if (session.fastModeDisabledReason === "model_not_allowed") {
5754
5807
  session.fastModeDisabledReason = undefined;
5755
5808
  }
5756
- // Rebuild config options since effort levels depend on the selected model
5809
+ // Rebuild config options since effort levels depend on the selected model.
5810
+ // The new model decides whether Ultracode is shown (heuristic now, the
5811
+ // CLI's readback below); the retained intent decides its value.
5812
+ session.ultracodeAvailable = isUltracodeAvailable(newModelInfo?.supportsEffort ? (newModelInfo.supportedEffortLevels ?? []) : [], { disableWorkflows: session.workflowsDisabled });
5757
5813
  const effortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
5758
5814
  const currentEffort = typeof effortOpt?.currentValue === "string" ? effortOpt.currentValue : undefined;
5759
5815
  session.configOptions = buildConfigOptions(session.modes, session.models, session.modelInfos, currentEffort, session.agents, session.currentAgent, {
@@ -5772,15 +5828,7 @@ export class ClaudeAcpAgent {
5772
5828
  // (R1.6).
5773
5829
  session.thinkingEnabled ??
5774
5830
  effectiveThinkingConfig(undefined, process.env.MAX_THINKING_TOKENS, this.logger) !==
5775
- undefined, {
5776
- // The new model decides whether the entry renders at all; the session's
5777
- // retained intent decides whether it renders selected. A model without
5778
- // `xhigh` drops the entry, and `validEffort` then falls back for it the
5779
- // same way it does for any unsupported level.
5780
- available: isUltracodeAvailable(newModelInfo?.supportsEffort ? (newModelInfo.supportedEffortLevels ?? []) : [], { disableWorkflows: session.workflowsDisabled }),
5781
- enabled: session.ultracode,
5782
- }, {
5783
- disableWorkflows: session.workflowsDisabled,
5831
+ undefined, this.ultracodeState(session, session.ultracodeAvailable), {
5784
5832
  // Threaded for the same reason Thinking is (R1.7): an option not
5785
5833
  // passed through this rebuild silently drops from the picker on
5786
5834
  // every model switch. The account is model-independent, so the row
@@ -5792,8 +5840,7 @@ export class ClaudeAcpAgent {
5792
5840
  const newEffortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
5793
5841
  const newEffort = typeof newEffortOpt?.currentValue === "string" ? newEffortOpt.currentValue : undefined;
5794
5842
  if (newEffort !== currentEffort) {
5795
- await session.query.applyFlagSettings(ultracodeFlagSettings(newEffort));
5796
- session.ultracode = isUltracodeValue(newEffort);
5843
+ await session.query.applyFlagSettings(effortFlagSettings(newEffort, session.ultracodeRequested));
5797
5844
  }
5798
5845
  // Emit current_mode_update only after session.modes AND
5799
5846
  // session.configOptions have been fully reconciled. This way, a failure
@@ -5805,8 +5852,10 @@ export class ClaudeAcpAgent {
5805
5852
  await this.sessionModes.publishFallbackState(sessionId, session);
5806
5853
  }
5807
5854
  // Last, so the switch's own control requests don't queue behind it.
5808
- if (modelChanged)
5855
+ if (modelChanged) {
5809
5856
  this.refreshContextWindowInBackground(sessionId, session);
5857
+ this.refreshUltracodeInBackground(sessionId, session, false);
5858
+ }
5810
5859
  }
5811
5860
  else if (configId === AGENT_CONFIG_ID) {
5812
5861
  // Live agent switch — no subprocess restart needed. Apply the SDK flag
@@ -5843,11 +5892,9 @@ export class ClaudeAcpAgent {
5843
5892
  else {
5844
5893
  session.configOptions = session.configOptions.map((o) => o.id === configId && typeof o.currentValue === "string" ? { ...o, currentValue: value } : o);
5845
5894
  if (configId === EFFORT_CONFIG_ID) {
5846
- // Both keys, always. Selecting a plain level after Ultracode must CLEAR
5847
- // the flag, and only an explicit `null` clears it — see
5848
- // `ultracodeFlagSettings`.
5849
- await session.query.applyFlagSettings(ultracodeFlagSettings(value));
5850
- session.ultracode = isUltracodeValue(value);
5895
+ // An effort change without `ultracode` turns it off, so the intent
5896
+ // rides along — see `effortFlagSettings`.
5897
+ await session.query.applyFlagSettings(effortFlagSettings(value, session.ultracodeRequested));
5851
5898
  }
5852
5899
  }
5853
5900
  }
@@ -5900,6 +5947,50 @@ export class ClaudeAcpAgent {
5900
5947
  session.fastModeEnabled = enabled;
5901
5948
  this.refreshFastModeOption(session, enabled);
5902
5949
  }
5950
+ /** The Ultracode display state for `buildConfigOptions`. */
5951
+ ultracodeState(session, available) {
5952
+ return {
5953
+ available,
5954
+ requested: session.ultracodeRequested,
5955
+ useBooleanOption: clientSupportsBooleanConfigOptions(this.clientCapabilities),
5956
+ };
5957
+ }
5958
+ /**
5959
+ * Replace the Ultracode heuristic with the CLI's `applied` report, without
5960
+ * blocking the caller — never inline, because control requests queue ahead
5961
+ * of interrupt and close (upstream #1216). `seedIntent` at session start; a
5962
+ * model switch keeps its intent and only re-reads availability. Deferred a
5963
+ * tick so a resulting `config_option_update` follows the session/new reply.
5964
+ */
5965
+ refreshUltracodeInBackground(sessionId, session, seedIntent) {
5966
+ const { query } = session;
5967
+ const modelId = session.models.currentModelId;
5968
+ const requestedAtStart = session.ultracodeRequested;
5969
+ const stillCurrent = () => this.sessions[sessionId] === session &&
5970
+ session.query === query &&
5971
+ session.models.currentModelId === modelId;
5972
+ setTimeout(() => {
5973
+ void readUltracodeState(query, (error) => {
5974
+ this.logger.log(`[ultracode] get_settings failed session=${sessionId}: ${String(error)}`);
5975
+ })
5976
+ .then(async (readback) => {
5977
+ if (!readback || !stillCurrent())
5978
+ return;
5979
+ // A toggle that landed while the read was in flight is newer than it.
5980
+ const seed = seedIntent && session.ultracodeRequested === requestedAtStart;
5981
+ const useBoolean = clientSupportsBooleanConfigOptions(this.clientCapabilities);
5982
+ if (!applyUltracodeReadback(session, readback, seed, useBoolean))
5983
+ return;
5984
+ await this.client.sessionUpdate({
5985
+ sessionId,
5986
+ update: { sessionUpdate: "config_option_update", configOptions: session.configOptions },
5987
+ });
5988
+ })
5989
+ .catch((error) => {
5990
+ this.logger.error(`[ultracode] readback failed session=${sessionId}:`, error);
5991
+ });
5992
+ }, 0);
5993
+ }
5903
5994
  /** Lazily swap a session's SDK query for a fresh one so a Thinking change
5904
5995
  * takes effect on the next turn (R1.3): thinking has no live flag-settings
5905
5996
  * path in the SDK, so mid-session application goes through query recreation
@@ -6021,14 +6112,16 @@ export class ClaudeAcpAgent {
6021
6112
  // await is already included.
6022
6113
  const effortOpt = session.configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
6023
6114
  const effortValue = typeof effortOpt?.currentValue === "string" ? effortOpt.currentValue : undefined;
6024
- const { effortLevel, ultracode } = ultracodeFlagSettings(effortValue);
6025
- // Only the positive case is re-applied: the replacement's flag layer
6115
+ const effortFlags = effortFlagSettings(effortValue, session.ultracodeRequested);
6116
+ // Only the positive cases are re-applied: the replacement's flag layer
6026
6117
  // starts empty, so clearing a key that was never set would be a control
6027
- // request that says nothing. `ultracode` is sent WITH its level rather
6028
- // than alone — the SDK requires an xhigh-capable model for it, and a
6029
- // flag layer carrying one half of the pair is a state no picker names.
6030
- if (effortLevel !== null) {
6031
- await replacement.applyFlagSettings(ultracode === true ? { effortLevel, ultracode: true } : { effortLevel });
6118
+ // request that says nothing. The Ultracode intent is replayed even at
6119
+ // Default effort.
6120
+ if (effortFlags.effortLevel !== null) {
6121
+ await replacement.applyFlagSettings(effortFlags);
6122
+ }
6123
+ else if (effortFlags.ultracode) {
6124
+ await replacement.applyFlagSettings({ ultracode: true });
6032
6125
  }
6033
6126
  const supportsFastMode = session.modelInfos.find((m) => m.value === session.models.currentModelId)
6034
6127
  ?.supportsFastMode ?? false;
@@ -6810,6 +6903,7 @@ export class ClaudeAcpAgent {
6810
6903
  disabledReason: fastModeDisabledReason,
6811
6904
  };
6812
6905
  const workflowsDisabled = settingsManager.getSettings().disableWorkflows === true;
6906
+ const ultracodeRequested = settingsManager.getSettings().ultracode === true;
6813
6907
  const configOptions = buildConfigOptions(modes, models,
6814
6908
  // Catalog-based (see `modelInfos` above), matching the model-switch
6815
6909
  // rebuild (which passes `session.modelInfos`): `buildConfigOptions`
@@ -6823,31 +6917,24 @@ export class ClaudeAcpAgent {
6823
6917
  // effectiveThinkingConfig(undefined, MAX_THINKING_TOKENS) from above, so
6824
6918
  // reusing it avoids re-parsing (and re-logging an invalid) env var —
6825
6919
  // exactly one error log per query creation.
6826
- thinking !== undefined, {
6827
- // Seeded from settings, not inferred from the level: `Settings.ultracode`
6828
- // is what the user (or a `--settings` payload) actually asked for, while
6829
- // `xhigh` on its own is a legitimate selection that is not Ultracode.
6830
- available: isUltracodeAvailable(currentModelInfo?.supportsEffort ? (currentModelInfo.supportedEffortLevels ?? []) : [], { disableWorkflows: workflowsDisabled }),
6831
- enabled: settingsManager.getSettings().ultracode === true,
6832
- }, {
6833
- disableWorkflows: workflowsDisabled,
6920
+ thinking !== undefined,
6921
+ // Seeded from settings and the heuristic; the CLI's own report replaces
6922
+ // both in the background (`refreshUltracodeInBackground`, below).
6923
+ this.ultracodeState({ ultracodeRequested }, isUltracodeAvailable(currentModelInfo?.supportsEffort ? (currentModelInfo.supportedEffortLevels ?? []) : [], { disableWorkflows: workflowsDisabled })), {
6834
6924
  // Both halves of the selector, resolved above alongside the env they
6835
6925
  // produced — so the row the client renders and the configuration
6836
6926
  // directory the query was actually started with cannot disagree.
6837
6927
  accounts: declaredAccounts,
6838
6928
  currentAccount: accountEntry?.value,
6839
6929
  });
6840
- // Apply the initial effort level to the SDK so it matches the UI default
6930
+ // Apply the initial effort level to the SDK so it matches the UI default.
6931
+ // It carries the Ultracode intent: an effort change without the key would
6932
+ // turn off an `ultracode: true` the session was started with.
6841
6933
  const initialEffort = configOptions.find((o) => o.id === EFFORT_CONFIG_ID);
6842
- // The picker's resolved value, not the raw setting: `buildConfigOptions`
6843
- // has already dropped Ultracode if this model cannot reach `xhigh`, and the
6844
- // session must track what is displayed rather than what was requested.
6845
- const initialUltracode = typeof initialEffort?.currentValue === "string" &&
6846
- isUltracodeValue(initialEffort.currentValue);
6847
6934
  if (initialEffort &&
6848
6935
  typeof initialEffort.currentValue === "string" &&
6849
6936
  initialEffort.currentValue !== "default") {
6850
- await q.applyFlagSettings(ultracodeFlagSettings(initialEffort.currentValue));
6937
+ await q.applyFlagSettings(effortFlagSettings(initialEffort.currentValue, ultracodeRequested));
6851
6938
  }
6852
6939
  // Seed the context window WITHOUT any extra IPC on the session/new path.
6853
6940
  // On session/load, the resumed session's own `getContextUsage` report — a
@@ -6912,7 +6999,8 @@ export class ClaudeAcpAgent {
6912
6999
  configOptions,
6913
7000
  agents,
6914
7001
  currentAgent,
6915
- ultracode: initialUltracode,
7002
+ ultracodeRequested,
7003
+ ultracodeAvailable: configOptions.some((o) => o.id === ULTRACODE_CONFIG_ID),
6916
7004
  workflowsDisabled,
6917
7005
  declaredAccounts,
6918
7006
  currentAccount: accountEntry?.value,
@@ -6960,6 +7048,7 @@ export class ClaudeAcpAgent {
6960
7048
  // A guessed window seed (text heuristic / default) is refined the same way,
6961
7049
  // unawaited; a resumed session's authoritative seed makes it a no-op.
6962
7050
  this.refreshContextWindowInBackground(sessionId, this.sessions[sessionId]);
7051
+ this.refreshUltracodeInBackground(sessionId, this.sessions[sessionId], true);
6963
7052
  return {
6964
7053
  sessionId,
6965
7054
  modes,
@@ -7293,16 +7382,11 @@ export function buildConfigOptions(modes, models, modelInfos, currentEffortLevel
7293
7382
  * Both session call sites always supply it (R1.1); `undefined` (direct
7294
7383
  * callers/tests) omits the row. */
7295
7384
  thinkingEnabled,
7296
- /** Display state for the Ultracode entry of the effort picker. Omitted by
7297
- * direct callers/tests, in which case availability is derived from
7298
- * `settings` and the entry renders unselected. */
7385
+ /** Display state for the Ultracode option, placed after effort. Omitted by
7386
+ * direct callers/tests, in which case the option is not shown. */
7299
7387
  ultracode,
7300
- /** Resolved session settings, read for `disableWorkflows` — the half of the
7301
- * Ultracode gate that is not a model capability — and, alongside them, the
7302
- * declared accounts plus the one in force, which decide whether an account
7303
- * selector is advertised at all (R6.1/R6.2). `accounts` is not a field of
7304
- * the SDK's `Settings`, so it is carried beside them rather than picked
7305
- * from them. */
7388
+ /** The declared accounts plus the one in force, which decide whether an
7389
+ * account selector is advertised at all (R6.1/R6.2). */
7306
7390
  settings) {
7307
7391
  const options = [
7308
7392
  SessionModeManager.configOption(modes),
@@ -7336,11 +7420,6 @@ settings) {
7336
7420
  ? (currentModelInfo.supportedEffortLevels ?? [])
7337
7421
  : [];
7338
7422
  if (supportedLevels.length > 0) {
7339
- // Ultracode rides the effort picker as one extra entry past the last level,
7340
- // which is where the VS Code extension draws it too. It is NOT a level (see
7341
- // `ultracode.ts`): the entry stands for `xhigh` plus workflow orchestration,
7342
- // and it is offered only when both halves are reachable.
7343
- const ultracodeAvailable = ultracode?.available ?? isUltracodeAvailable(supportedLevels, settings);
7344
7423
  const effortOptions = [
7345
7424
  { value: "default", name: "Default" },
7346
7425
  ...supportedLevels.map((level) => ({
@@ -7350,21 +7429,9 @@ settings) {
7350
7429
  .map((part) => (part ? part.charAt(0).toUpperCase() + part.slice(1) : part))
7351
7430
  .join(" "),
7352
7431
  })),
7353
- ...(ultracodeAvailable
7354
- ? [{ value: ULTRACODE_OPTION_VALUE, name: ULTRACODE_OPTION_NAME }]
7355
- : []),
7356
7432
  ];
7357
- const includes = (l) => l === "default" ||
7358
- supportedLevels.includes(l) ||
7359
- (ultracodeAvailable && l === ULTRACODE_OPTION_VALUE);
7360
- // `effortOptionValue` resolves the flag against the level BEFORE validation,
7361
- // so an Ultracode session on a model that dropped `xhigh` falls back to
7362
- // "Default" through the same path any unsupported level does.
7363
- const displayedEffort = effortOptionValue(currentEffortLevel, {
7364
- available: ultracodeAvailable,
7365
- enabled: ultracode?.enabled ?? false,
7366
- });
7367
- const validEffort = displayedEffort && includes(displayedEffort) ? displayedEffort : "default";
7433
+ const includes = (l) => l === "default" || supportedLevels.includes(l);
7434
+ const validEffort = currentEffortLevel && includes(currentEffortLevel) ? currentEffortLevel : "default";
7368
7435
  options.push({
7369
7436
  id: EFFORT_CONFIG_ID,
7370
7437
  name: "Effort",
@@ -7375,6 +7442,11 @@ settings) {
7375
7442
  options: effortOptions,
7376
7443
  });
7377
7444
  }
7445
+ // Ultracode: a toggle beside effort, not an effort level (`ultracode.ts`).
7446
+ const ultracodeOption = ultracodeConfigOption(ultracode);
7447
+ if (ultracodeOption) {
7448
+ options.push(ultracodeOption);
7449
+ }
7378
7450
  // Surface the Fast mode toggle only when the current model supports it. The
7379
7451
  // option renders as a native boolean toggle for Clients that opted in, and a
7380
7452
  // two-value select otherwise.
@@ -1,100 +1,166 @@
1
1
  /**
2
- * The "Ultracode" entry of the Effort picker.
2
+ * Ultracode — an independent, session-scoped boolean option.
3
3
  *
4
- * **Ultracode is not a sixth effort level, and reading it as one produces the
5
- * wrong control.** Claude Code's VS Code extension models it as a boolean that
6
- * turns on two things at once — `xhigh` effort *and* standing dynamic-workflow
7
- * orchestration — and its own tooltip says so: `"Ultracode - xhigh +
8
- * workflows"`. Its five real levels are `low` `medium` `high` `xhigh` `max`;
9
- * Ultracode is drawn as one extra notch past the last of them, styled
10
- * differently, and selecting any ordinary level clears it.
4
+ * **What it is.** The SDK's `Settings.ultracode` is *"standing
5
+ * dynamic-workflow orchestration at any effort level"*, session-scoped and
6
+ * applied through `apply_flag_settings`. It is not an effort level and it does
7
+ * not imply one: the CLI (`/effort ultracode on|off`, "any effort level, this
8
+ * session only") and the VS Code extension (a switch in the effort popover)
9
+ * both model it as a toggle beside effort. An earlier version of this module
10
+ * followed an older extension tooltip ("xhigh + workflows") and drew it as a
11
+ * notch in the effort select that forced `xhigh`; that silently raised the
12
+ * effort of a session started with `ultracode: true`, cleared it on any effort
13
+ * pick, and lost it on a model switch (PARITY-REPORT §21.2).
11
14
  *
12
- * ACP has no compound control to carry that, so the adapter projects it the way
13
- * the extension's UI reads rather than the way its state is stored: one more
14
- * entry in the `effort` select. The compound stays here, in one module, instead
15
- * of being spread across the three places `acp-agent.ts` applies effort.
15
+ * **The wire contract** (`applyFlagSettings`, unchanged SDK 0.3.285..0.3.299):
16
+ * - `ultracode: true|false` turns it on or off and leaves effort alone;
17
+ * - an `effortLevel` change sent WITHOUT the key turns it off;
18
+ * - `null` resets it to off.
19
+ * Hence the two payload rules below: the toggle sends `{ultracode:true}` or
20
+ * `{ultracode:null}`, and every effort change re-sends `ultracode:true` while
21
+ * the intent is on — and never `null`.
16
22
  *
17
- * The SDK carries both halves and names the channel: `Settings.ultracode` is
18
- * *"xhigh effort plus standing dynamic-workflow orchestration. Session-scoped —
19
- * typically provided via --settings or the apply_flag_settings control
20
- * request"*. `apply_flag_settings` is already how the effort option is applied,
21
- * so no new transport is involved.
23
+ * **Intent is not availability.** The CLI keeps the request and computes "in
24
+ * effect = requested and available", where available means workflows are
25
+ * enabled and the model supports `xhigh`. The adapter mirrors that: the
26
+ * session holds the intent, the option is shown only while available, and a
27
+ * model switch never drops the intent. The CLI reports both through the
28
+ * `get_settings` control request (`applied.{ultracode, ultracodeRequested,
29
+ * ultracodeAvailable}`), which the SDK runtime exposes as `Query.getSettings()`
30
+ * but `sdk.d.ts` does not declare — {@link readUltracodeState} wraps it.
22
31
  *
23
32
  * Kept self-contained — no import from `acp-agent.ts` — for the reason
24
- * `thinking-option.ts` and `rewind-command.ts` state: that file is ~9,900 lines
25
- * and moves upstream almost daily, so every coupling to it is paid again at
26
- * each sync.
33
+ * `thinking-option.ts` and `rewind-command.ts` state: that file is ~10,000
34
+ * lines and moves upstream almost daily, so every coupling to it is paid again
35
+ * at each sync.
27
36
  */
37
+ import type { SessionConfigOption, SetSessionConfigOptionRequest } from "@agentclientprotocol/sdk";
28
38
  import type { EffortLevel, Settings } from "@anthropic-ai/claude-agent-sdk";
29
- /** Value of the synthetic "Ultracode" entry in the effort picker. It is a
30
- * reserved sentinel: no `EffortLevel` is spelled this way, so it cannot
31
- * collide with a level the SDK reports in `supportedEffortLevels`. */
32
- export declare const ULTRACODE_OPTION_VALUE = "ultracode";
33
- /** Display name of that entry, matching the extension's own label. */
39
+ /** Config option id. */
40
+ export declare const ULTRACODE_CONFIG_ID = "ultracode";
41
+ /** Display name, matching the CLI's and the extension's label. */
34
42
  export declare const ULTRACODE_OPTION_NAME = "Ultracode";
35
- /** The effort level Ultracode implies. Not configurable: the extension hardcodes
36
- * `xhigh` in `enableUltracode()`, and the SDK's own description of the setting
37
- * names the same level. A different level here would silently mean something
38
- * else than it does in the reference client. */
43
+ /** Select-fallback values for clients without boolean config options. The
44
+ * same spelling Fast mode uses, so one client-side mapping serves both. */
45
+ export declare const ULTRACODE_ON = "on";
46
+ export declare const ULTRACODE_OFF = "off";
47
+ /** The effort level the model must support for Ultracode to be available.
48
+ * Availability only: Ultracode never SETS this level. */
39
49
  export declare const ULTRACODE_EFFORT_LEVEL: EffortLevel;
40
- /** Display state for the Ultracode entry, resolved by the caller. Mirrors the
41
- * shape `FastModeOptionState` uses for the same job — availability and current
42
- * value are two different questions, and folding them into one boolean loses
43
- * the case where the entry should render but not be selected. */
50
+ /** The value the old effort-select notch carried. Accepted for one release
51
+ * from clients that still send it (see {@link isLegacyUltracodeEffort}). */
52
+ export declare const LEGACY_ULTRACODE_EFFORT_VALUE = "ultracode";
53
+ /** Display state for the option, resolved by the caller. Mirrors
54
+ * `FastModeOptionState`: availability and value are different questions. */
44
55
  export interface UltracodeOptionState {
45
- /** Whether the entry should appear at all. */
56
+ /** Whether the option is shown at all. */
46
57
  available: boolean;
47
- /** Whether it is the currently selected effort. */
48
- enabled: boolean;
58
+ /** The session's intent — shown as the option's value. */
59
+ requested: boolean;
60
+ /** Whether the client opted into boolean config options. */
61
+ useBooleanOption: boolean;
49
62
  }
50
63
  /**
51
- * Whether the Ultracode entry may be offered, under the same two conditions the
52
- * extension checks in its own `ultracodeAvailable`:
64
+ * The fallback availability check, used until (or instead of) the CLI's own
65
+ * `applied.ultracodeAvailable`:
53
66
  *
54
- * 1. workflows are not disabled — Ultracode *is* the workflow half, so offering
55
- * it where `disableWorkflows` is set would advertise something that cannot
56
- * happen;
57
- * 2. the current model supports `xhigh` — Ultracode has no meaning on a model
58
- * that cannot reach the level it implies.
67
+ * 1. workflows are not disabled — Ultracode *is* workflow orchestration;
68
+ * 2. the current model supports `xhigh`.
59
69
  *
60
- * Both are read rather than assumed: an unknown settings shape leaves
61
- * `disableWorkflows` undefined, which is *not* `true`, so the gate opens — the
62
- * same direction the extension's `=== !0` comparison takes.
70
+ * Partial by nature: the CLI also checks managed settings, org policy,
71
+ * `enableWorkflows` and `CLAUDE_CODE_DISABLE_WORKFLOWS`. An absent
72
+ * `disableWorkflows` opens the gate, the same direction the extension's
73
+ * `=== !0` comparison takes.
63
74
  */
64
75
  export declare function isUltracodeAvailable(supportedEffortLevels: readonly string[], settings: Pick<Settings, "disableWorkflows"> | undefined): boolean;
65
- /** Whether a picker value denotes Ultracode rather than a plain effort level. */
66
- export declare function isUltracodeValue(value: string | undefined): boolean;
76
+ /** Build the option: a native boolean for clients that opted in, an on/off
77
+ * select otherwise (the ACP boolean-config-option RFD makes that a MUST). */
78
+ export declare function createUltracodeConfigOption(requested: boolean, useBooleanOption: boolean): SessionConfigOption;
79
+ /** The option for a resolved state, or `undefined` while unavailable. */
80
+ export declare function ultracodeConfigOption(state: UltracodeOptionState | undefined): SessionConfigOption | undefined;
67
81
  /**
68
- * The `apply_flag_settings` payload for an effort selection, Ultracode included.
82
+ * Put the option where it belongs in an existing list — right after `effort`
83
+ * (after `model` when the model has no effort option), before `fast` — or
84
+ * remove it when `next` is undefined. Used when a background readback changes
85
+ * availability without a full rebuild.
86
+ */
87
+ export declare function placeUltracodeOption(options: SessionConfigOption[], next: SessionConfigOption | undefined): SessionConfigOption[];
88
+ /** Resolve the requested value from `session/set_config_option`: a native
89
+ * boolean, or the on/off select-fallback strings. */
90
+ export declare function resolveUltracodeRequested(params: SetSessionConfigOptionRequest): boolean;
91
+ /** The toggle's payload. Off is an explicit `null`: `undefined` is dropped by
92
+ * JSON transport, and the SDK only clears a flag on `null`. */
93
+ export declare function ultracodeTogglePayload(requested: boolean): {
94
+ ultracode: true | null;
95
+ };
96
+ /**
97
+ * The `apply_flag_settings` payload for an effort change — a user pick, the
98
+ * model-switch fallback, the initial effort, or a recreate's replay.
69
99
  *
70
- * **The `null` is the load-bearing part.** The SDK shallow-merges flag settings
71
- * and only clears a key when an explicit `null` arrives — `undefined` is dropped
72
- * by JSON transport and leaves the previous value standing. So every selection
73
- * has to say something about `ultracode`, not just the one that turns it on:
74
- * without the clear, picking `High` after Ultracode would lower the effort and
75
- * leave workflow orchestration running, which is a state no picker entry names.
76
- * The same reasoning applies to `effortLevel` — this function absorbed the older
77
- * `toSdkEffortLevel` helper for exactly that reason: both keys are decided in
78
- * one place, so neither can be forgotten on a path the other takes.
100
+ * An `effortLevel` change sent without `ultracode` turns Ultracode off, so the
101
+ * key rides along whenever the intent is on. It is never sent as `null` here:
102
+ * an effort change is not a request to turn Ultracode off.
79
103
  *
80
- * @param value the picker value — `"default"`, an `EffortLevel`, or the
81
- * Ultracode sentinel. `undefined` means the option is absent for this model.
104
+ * @param value the effort select's value — `"default"`, an `EffortLevel`, or
105
+ * `undefined` when the model has no effort option.
82
106
  */
83
- export declare function ultracodeFlagSettings(value: string | undefined): {
107
+ export declare function effortFlagSettings(value: string | undefined, ultracodeRequested: boolean): {
84
108
  effortLevel: EffortLevel | null;
85
- ultracode: boolean | null;
109
+ ultracode?: true;
86
110
  };
111
+ /** Whether an effort value is the retired Ultracode notch. Clients that saved
112
+ * it get `{effortLevel:'xhigh', ultracode:true}` for one release. */
113
+ export declare function isLegacyUltracodeEffort(value: unknown): boolean;
114
+ /** What the CLI reported. Each field is absent when the CLI did not say. */
115
+ export interface UltracodeReadback {
116
+ requested?: boolean;
117
+ available?: boolean;
118
+ }
87
119
  /**
88
- * The picker value to display, given the persisted effort level and whether the
89
- * Ultracode flag is on.
120
+ * Read `applied.{ultracodeRequested, ultracodeAvailable}` through the SDK's
121
+ * untyped `Query.getSettings()`.
122
+ *
123
+ * Structural, never trusting: an SDK without the method, a rejected request,
124
+ * or a response without `applied` all resolve to `undefined`, and the caller
125
+ * keeps the heuristic. Never rejects.
90
126
  *
91
- * The flag wins over the level, and only when it is *available*: a session that
92
- * carries `ultracode: true` from settings while the current model cannot reach
93
- * `xhigh` must not show an entry the picker is not rendering. The extension
94
- * reaches the same state through `adoptAppliedEffort`, which reads
95
- * `applied.ultracode` first and falls back to inferring it from `xhigh`; we do
96
- * not infer, because `xhigh` alone is a legitimate selection that is not
97
- * Ultracode, and guessing would silently turn workflows on in the label.
127
+ * **Call it in the background, never inline.** Control requests are
128
+ * serialized and queue ahead of interrupt and close (upstream #1216), and on a
129
+ * fresh session the CLI does not service them until the first turn.
130
+ */
131
+ export declare function readUltracodeState(query: unknown, onError?: (error: unknown) => void): Promise<UltracodeReadback | undefined>;
132
+ /**
133
+ * The slice of a session these helpers read and write. Structural, so this
134
+ * module does not import the `Session` type from `acp-agent.ts`.
135
+ */
136
+ export interface UltracodeSession {
137
+ query: {
138
+ applyFlagSettings(settings: Record<string, unknown>): Promise<void>;
139
+ };
140
+ configOptions: SessionConfigOption[];
141
+ /** The intent: what the user (or settings, or the CLI's readback) asked for. */
142
+ ultracodeRequested: boolean;
143
+ /** Whether the option is shown: the CLI's `applied.ultracodeAvailable` when
144
+ * read, else {@link isUltracodeAvailable}'s heuristic. */
145
+ ultracodeAvailable: boolean;
146
+ }
147
+ /** Rebuild the option in place from the session's state. */
148
+ export declare function refreshUltracodeOption(session: UltracodeSession, useBooleanOption: boolean): void;
149
+ /** Toggle the intent. Applies first, then records — a rejected control
150
+ * request leaves the session and its option untouched, as Fast mode does. */
151
+ export declare function applyUltracodeToggle(session: UltracodeSession, requested: boolean, useBooleanOption: boolean): Promise<void>;
152
+ /**
153
+ * The one-release migration for clients that still send the retired notch:
154
+ * `effort = "ultracode"` becomes `{effortLevel:'xhigh', ultracode:true}`.
155
+ * Returns `false`, sending nothing, when this model's effort select does not
156
+ * offer `xhigh` — the caller then rejects the value like any other.
157
+ */
158
+ export declare function applyLegacyUltracodeEffort(session: UltracodeSession, useBooleanOption: boolean): Promise<boolean>;
159
+ /**
160
+ * Fold a CLI readback into the session. Availability is always taken; the
161
+ * intent only when `seedIntent` (session start — a model switch keeps the
162
+ * intent it has). Returns whether the option the client sees changed, i.e.
163
+ * whether a `config_option_update` is owed.
98
164
  */
99
- export declare function effortOptionValue(effortLevel: string | undefined, ultracode: UltracodeOptionState | undefined): string | undefined;
165
+ export declare function applyUltracodeReadback(session: UltracodeSession, readback: UltracodeReadback, seedIntent: boolean, useBooleanOption: boolean): boolean;
100
166
  //# sourceMappingURL=ultracode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ultracode.d.ts","sourceRoot":"","sources":["../src/ultracode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KA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AE,gBAAgB,EACzB,gBAAgB,EAAE,OAAO,GACxB,OAAO,CAAC,OAAO,CAAC,CAalB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,iBAAiB,EAC3B,UAAU,EAAE,OAAO,EACnB,gBAAgB,EAAE,OAAO,GACxB,OAAO,CAST"}
package/dist/ultracode.js CHANGED
@@ -1,103 +1,236 @@
1
1
  /**
2
- * The "Ultracode" entry of the Effort picker.
2
+ * Ultracode — an independent, session-scoped boolean option.
3
3
  *
4
- * **Ultracode is not a sixth effort level, and reading it as one produces the
5
- * wrong control.** Claude Code's VS Code extension models it as a boolean that
6
- * turns on two things at once — `xhigh` effort *and* standing dynamic-workflow
7
- * orchestration — and its own tooltip says so: `"Ultracode - xhigh +
8
- * workflows"`. Its five real levels are `low` `medium` `high` `xhigh` `max`;
9
- * Ultracode is drawn as one extra notch past the last of them, styled
10
- * differently, and selecting any ordinary level clears it.
4
+ * **What it is.** The SDK's `Settings.ultracode` is *"standing
5
+ * dynamic-workflow orchestration at any effort level"*, session-scoped and
6
+ * applied through `apply_flag_settings`. It is not an effort level and it does
7
+ * not imply one: the CLI (`/effort ultracode on|off`, "any effort level, this
8
+ * session only") and the VS Code extension (a switch in the effort popover)
9
+ * both model it as a toggle beside effort. An earlier version of this module
10
+ * followed an older extension tooltip ("xhigh + workflows") and drew it as a
11
+ * notch in the effort select that forced `xhigh`; that silently raised the
12
+ * effort of a session started with `ultracode: true`, cleared it on any effort
13
+ * pick, and lost it on a model switch (PARITY-REPORT §21.2).
11
14
  *
12
- * ACP has no compound control to carry that, so the adapter projects it the way
13
- * the extension's UI reads rather than the way its state is stored: one more
14
- * entry in the `effort` select. The compound stays here, in one module, instead
15
- * of being spread across the three places `acp-agent.ts` applies effort.
15
+ * **The wire contract** (`applyFlagSettings`, unchanged SDK 0.3.285..0.3.299):
16
+ * - `ultracode: true|false` turns it on or off and leaves effort alone;
17
+ * - an `effortLevel` change sent WITHOUT the key turns it off;
18
+ * - `null` resets it to off.
19
+ * Hence the two payload rules below: the toggle sends `{ultracode:true}` or
20
+ * `{ultracode:null}`, and every effort change re-sends `ultracode:true` while
21
+ * the intent is on — and never `null`.
16
22
  *
17
- * The SDK carries both halves and names the channel: `Settings.ultracode` is
18
- * *"xhigh effort plus standing dynamic-workflow orchestration. Session-scoped —
19
- * typically provided via --settings or the apply_flag_settings control
20
- * request"*. `apply_flag_settings` is already how the effort option is applied,
21
- * so no new transport is involved.
23
+ * **Intent is not availability.** The CLI keeps the request and computes "in
24
+ * effect = requested and available", where available means workflows are
25
+ * enabled and the model supports `xhigh`. The adapter mirrors that: the
26
+ * session holds the intent, the option is shown only while available, and a
27
+ * model switch never drops the intent. The CLI reports both through the
28
+ * `get_settings` control request (`applied.{ultracode, ultracodeRequested,
29
+ * ultracodeAvailable}`), which the SDK runtime exposes as `Query.getSettings()`
30
+ * but `sdk.d.ts` does not declare — {@link readUltracodeState} wraps it.
22
31
  *
23
32
  * Kept self-contained — no import from `acp-agent.ts` — for the reason
24
- * `thinking-option.ts` and `rewind-command.ts` state: that file is ~9,900 lines
25
- * and moves upstream almost daily, so every coupling to it is paid again at
26
- * each sync.
33
+ * `thinking-option.ts` and `rewind-command.ts` state: that file is ~10,000
34
+ * lines and moves upstream almost daily, so every coupling to it is paid again
35
+ * at each sync.
27
36
  */
28
- /** Value of the synthetic "Ultracode" entry in the effort picker. It is a
29
- * reserved sentinel: no `EffortLevel` is spelled this way, so it cannot
30
- * collide with a level the SDK reports in `supportedEffortLevels`. */
31
- export const ULTRACODE_OPTION_VALUE = "ultracode";
32
- /** Display name of that entry, matching the extension's own label. */
37
+ /** Config option id. */
38
+ export const ULTRACODE_CONFIG_ID = "ultracode";
39
+ /** Display name, matching the CLI's and the extension's label. */
33
40
  export const ULTRACODE_OPTION_NAME = "Ultracode";
34
- /** The effort level Ultracode implies. Not configurable: the extension hardcodes
35
- * `xhigh` in `enableUltracode()`, and the SDK's own description of the setting
36
- * names the same level. A different level here would silently mean something
37
- * else than it does in the reference client. */
41
+ const ULTRACODE_DESCRIPTION = "Run dynamic workflows on every task";
42
+ /** Select-fallback values for clients without boolean config options. The
43
+ * same spelling Fast mode uses, so one client-side mapping serves both. */
44
+ export const ULTRACODE_ON = "on";
45
+ export const ULTRACODE_OFF = "off";
46
+ /** The effort level the model must support for Ultracode to be available.
47
+ * Availability only: Ultracode never SETS this level. */
38
48
  export const ULTRACODE_EFFORT_LEVEL = "xhigh";
49
+ /** The value the old effort-select notch carried. Accepted for one release
50
+ * from clients that still send it (see {@link isLegacyUltracodeEffort}). */
51
+ export const LEGACY_ULTRACODE_EFFORT_VALUE = "ultracode";
39
52
  /**
40
- * Whether the Ultracode entry may be offered, under the same two conditions the
41
- * extension checks in its own `ultracodeAvailable`:
53
+ * The fallback availability check, used until (or instead of) the CLI's own
54
+ * `applied.ultracodeAvailable`:
42
55
  *
43
- * 1. workflows are not disabled — Ultracode *is* the workflow half, so offering
44
- * it where `disableWorkflows` is set would advertise something that cannot
45
- * happen;
46
- * 2. the current model supports `xhigh` — Ultracode has no meaning on a model
47
- * that cannot reach the level it implies.
56
+ * 1. workflows are not disabled — Ultracode *is* workflow orchestration;
57
+ * 2. the current model supports `xhigh`.
48
58
  *
49
- * Both are read rather than assumed: an unknown settings shape leaves
50
- * `disableWorkflows` undefined, which is *not* `true`, so the gate opens — the
51
- * same direction the extension's `=== !0` comparison takes.
59
+ * Partial by nature: the CLI also checks managed settings, org policy,
60
+ * `enableWorkflows` and `CLAUDE_CODE_DISABLE_WORKFLOWS`. An absent
61
+ * `disableWorkflows` opens the gate, the same direction the extension's
62
+ * `=== !0` comparison takes.
52
63
  */
53
64
  export function isUltracodeAvailable(supportedEffortLevels, settings) {
54
65
  if (settings?.disableWorkflows === true)
55
66
  return false;
56
67
  return supportedEffortLevels.includes(ULTRACODE_EFFORT_LEVEL);
57
68
  }
58
- /** Whether a picker value denotes Ultracode rather than a plain effort level. */
59
- export function isUltracodeValue(value) {
60
- return value === ULTRACODE_OPTION_VALUE;
69
+ /** Build the option: a native boolean for clients that opted in, an on/off
70
+ * select otherwise (the ACP boolean-config-option RFD makes that a MUST). */
71
+ export function createUltracodeConfigOption(requested, useBooleanOption) {
72
+ const base = {
73
+ id: ULTRACODE_CONFIG_ID,
74
+ name: ULTRACODE_OPTION_NAME,
75
+ description: ULTRACODE_DESCRIPTION,
76
+ category: "model_config",
77
+ };
78
+ if (useBooleanOption) {
79
+ return { ...base, type: "boolean", currentValue: requested };
80
+ }
81
+ return {
82
+ ...base,
83
+ type: "select",
84
+ currentValue: requested ? ULTRACODE_ON : ULTRACODE_OFF,
85
+ options: [
86
+ { value: ULTRACODE_ON, name: "On" },
87
+ { value: ULTRACODE_OFF, name: "Off" },
88
+ ],
89
+ };
90
+ }
91
+ /** The option for a resolved state, or `undefined` while unavailable. */
92
+ export function ultracodeConfigOption(state) {
93
+ if (!state?.available)
94
+ return undefined;
95
+ return createUltracodeConfigOption(state.requested, state.useBooleanOption);
96
+ }
97
+ /**
98
+ * Put the option where it belongs in an existing list — right after `effort`
99
+ * (after `model` when the model has no effort option), before `fast` — or
100
+ * remove it when `next` is undefined. Used when a background readback changes
101
+ * availability without a full rebuild.
102
+ */
103
+ export function placeUltracodeOption(options, next) {
104
+ const rest = options.filter((o) => o.id !== ULTRACODE_CONFIG_ID);
105
+ if (!next)
106
+ return rest;
107
+ let anchor = rest.findIndex((o) => o.id === "effort");
108
+ if (anchor < 0)
109
+ anchor = rest.findIndex((o) => o.id === "model");
110
+ const at = anchor < 0 ? rest.length : anchor + 1;
111
+ return [...rest.slice(0, at), next, ...rest.slice(at)];
112
+ }
113
+ /** Resolve the requested value from `session/set_config_option`: a native
114
+ * boolean, or the on/off select-fallback strings. */
115
+ export function resolveUltracodeRequested(params) {
116
+ const value = params.value;
117
+ if (typeof value === "boolean")
118
+ return value;
119
+ if (value === ULTRACODE_ON)
120
+ return true;
121
+ if (value === ULTRACODE_OFF)
122
+ return false;
123
+ throw new Error(`Invalid value for config option ${ULTRACODE_CONFIG_ID}: ${String(value)}`);
124
+ }
125
+ /** The toggle's payload. Off is an explicit `null`: `undefined` is dropped by
126
+ * JSON transport, and the SDK only clears a flag on `null`. */
127
+ export function ultracodeTogglePayload(requested) {
128
+ return { ultracode: requested ? true : null };
61
129
  }
62
130
  /**
63
- * The `apply_flag_settings` payload for an effort selection, Ultracode included.
131
+ * The `apply_flag_settings` payload for an effort change — a user pick, the
132
+ * model-switch fallback, the initial effort, or a recreate's replay.
64
133
  *
65
- * **The `null` is the load-bearing part.** The SDK shallow-merges flag settings
66
- * and only clears a key when an explicit `null` arrives — `undefined` is dropped
67
- * by JSON transport and leaves the previous value standing. So every selection
68
- * has to say something about `ultracode`, not just the one that turns it on:
69
- * without the clear, picking `High` after Ultracode would lower the effort and
70
- * leave workflow orchestration running, which is a state no picker entry names.
71
- * The same reasoning applies to `effortLevel` — this function absorbed the older
72
- * `toSdkEffortLevel` helper for exactly that reason: both keys are decided in
73
- * one place, so neither can be forgotten on a path the other takes.
134
+ * An `effortLevel` change sent without `ultracode` turns Ultracode off, so the
135
+ * key rides along whenever the intent is on. It is never sent as `null` here:
136
+ * an effort change is not a request to turn Ultracode off.
74
137
  *
75
- * @param value the picker value — `"default"`, an `EffortLevel`, or the
76
- * Ultracode sentinel. `undefined` means the option is absent for this model.
138
+ * @param value the effort select's value — `"default"`, an `EffortLevel`, or
139
+ * `undefined` when the model has no effort option.
77
140
  */
78
- export function ultracodeFlagSettings(value) {
79
- if (isUltracodeValue(value)) {
80
- return { effortLevel: ULTRACODE_EFFORT_LEVEL, ultracode: true };
81
- }
82
- return {
83
- effortLevel: value === undefined || value === "default" ? null : value,
84
- ultracode: null,
85
- };
141
+ export function effortFlagSettings(value, ultracodeRequested) {
142
+ const effortLevel = value === undefined || value === "default" ? null : value;
143
+ return ultracodeRequested ? { effortLevel, ultracode: true } : { effortLevel };
144
+ }
145
+ /** Whether an effort value is the retired Ultracode notch. Clients that saved
146
+ * it get `{effortLevel:'xhigh', ultracode:true}` for one release. */
147
+ export function isLegacyUltracodeEffort(value) {
148
+ return value === LEGACY_ULTRACODE_EFFORT_VALUE;
86
149
  }
87
150
  /**
88
- * The picker value to display, given the persisted effort level and whether the
89
- * Ultracode flag is on.
151
+ * Read `applied.{ultracodeRequested, ultracodeAvailable}` through the SDK's
152
+ * untyped `Query.getSettings()`.
153
+ *
154
+ * Structural, never trusting: an SDK without the method, a rejected request,
155
+ * or a response without `applied` all resolve to `undefined`, and the caller
156
+ * keeps the heuristic. Never rejects.
90
157
  *
91
- * The flag wins over the level, and only when it is *available*: a session that
92
- * carries `ultracode: true` from settings while the current model cannot reach
93
- * `xhigh` must not show an entry the picker is not rendering. The extension
94
- * reaches the same state through `adoptAppliedEffort`, which reads
95
- * `applied.ultracode` first and falls back to inferring it from `xhigh`; we do
96
- * not infer, because `xhigh` alone is a legitimate selection that is not
97
- * Ultracode, and guessing would silently turn workflows on in the label.
158
+ * **Call it in the background, never inline.** Control requests are
159
+ * serialized and queue ahead of interrupt and close (upstream #1216), and on a
160
+ * fresh session the CLI does not service them until the first turn.
161
+ */
162
+ export async function readUltracodeState(query, onError) {
163
+ const getSettings = query?.getSettings;
164
+ if (typeof getSettings !== "function")
165
+ return undefined;
166
+ let response;
167
+ try {
168
+ response = await getSettings.call(query);
169
+ }
170
+ catch (error) {
171
+ onError?.(error);
172
+ return undefined;
173
+ }
174
+ const applied = response?.applied;
175
+ if (typeof applied !== "object" || applied === null)
176
+ return undefined;
177
+ const { ultracodeRequested, ultracodeAvailable } = applied;
178
+ const readback = {};
179
+ if (typeof ultracodeRequested === "boolean")
180
+ readback.requested = ultracodeRequested;
181
+ if (typeof ultracodeAvailable === "boolean")
182
+ readback.available = ultracodeAvailable;
183
+ return readback.requested === undefined && readback.available === undefined
184
+ ? undefined
185
+ : readback;
186
+ }
187
+ /** Rebuild the option in place from the session's state. */
188
+ export function refreshUltracodeOption(session, useBooleanOption) {
189
+ session.configOptions = placeUltracodeOption(session.configOptions, ultracodeConfigOption({
190
+ available: session.ultracodeAvailable,
191
+ requested: session.ultracodeRequested,
192
+ useBooleanOption,
193
+ }));
194
+ }
195
+ /** Toggle the intent. Applies first, then records — a rejected control
196
+ * request leaves the session and its option untouched, as Fast mode does. */
197
+ export async function applyUltracodeToggle(session, requested, useBooleanOption) {
198
+ await session.query.applyFlagSettings(ultracodeTogglePayload(requested));
199
+ session.ultracodeRequested = requested;
200
+ refreshUltracodeOption(session, useBooleanOption);
201
+ }
202
+ /**
203
+ * The one-release migration for clients that still send the retired notch:
204
+ * `effort = "ultracode"` becomes `{effortLevel:'xhigh', ultracode:true}`.
205
+ * Returns `false`, sending nothing, when this model's effort select does not
206
+ * offer `xhigh` — the caller then rejects the value like any other.
98
207
  */
99
- export function effortOptionValue(effortLevel, ultracode) {
100
- if (ultracode?.available && ultracode.enabled)
101
- return ULTRACODE_OPTION_VALUE;
102
- return effortLevel;
208
+ export async function applyLegacyUltracodeEffort(session, useBooleanOption) {
209
+ const effort = session.configOptions.find((o) => o.id === "effort");
210
+ const offersXhigh = effort?.type === "select" &&
211
+ effort.options.some((o) => "value" in o && o.value === ULTRACODE_EFFORT_LEVEL);
212
+ if (!offersXhigh)
213
+ return false;
214
+ await session.query.applyFlagSettings(effortFlagSettings(ULTRACODE_EFFORT_LEVEL, true));
215
+ session.ultracodeRequested = true;
216
+ session.configOptions = session.configOptions.map((o) => o.id === "effort" && o.type === "select" ? { ...o, currentValue: ULTRACODE_EFFORT_LEVEL } : o);
217
+ refreshUltracodeOption(session, useBooleanOption);
218
+ return true;
219
+ }
220
+ /**
221
+ * Fold a CLI readback into the session. Availability is always taken; the
222
+ * intent only when `seedIntent` (session start — a model switch keeps the
223
+ * intent it has). Returns whether the option the client sees changed, i.e.
224
+ * whether a `config_option_update` is owed.
225
+ */
226
+ export function applyUltracodeReadback(session, readback, seedIntent, useBooleanOption) {
227
+ const before = JSON.stringify(session.configOptions.find((o) => o.id === ULTRACODE_CONFIG_ID));
228
+ if (readback.available !== undefined)
229
+ session.ultracodeAvailable = readback.available;
230
+ if (seedIntent && readback.requested !== undefined) {
231
+ session.ultracodeRequested = readback.requested;
232
+ }
233
+ refreshUltracodeOption(session, useBooleanOption);
234
+ const after = JSON.stringify(session.configOptions.find((o) => o.id === ULTRACODE_CONFIG_ID));
235
+ return before !== after;
103
236
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.27.0",
6
+ "version": "0.28.0",
7
7
  "description": "Claude Code in Zed and other ACP clients with the VS Code extension's UX — multi-select questions, refusal consent, live quota windows, background tasks, Ultracode effort and session notices. Fork of claude-agent-acp.",
8
8
  "main": "dist/lib.js",
9
9
  "types": "dist/lib.d.ts",