@jigging/jig 0.1.0-alpha.25 → 0.1.0-alpha.27

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.
@@ -27,7 +27,7 @@ var __export = (target, all) => {
27
27
  };
28
28
  var __require = import.meta.require;
29
29
 
30
- // ../../node_modules/.bun/@anthropic-ai+claude-agent-sdk@0.3.257+e224efc0bf5ce548/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
30
+ // ../../node_modules/.bun/@anthropic-ai+claude-agent-sdk@0.3.257+c3c5f1ff7ee98816/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
31
31
  import { createRequire as $ne } from "module";
32
32
  import * as xr from "fs/promises";
33
33
  import * as Dn from "path";
@@ -62165,7 +62165,7 @@ var legacyClientNotificationMethods = new Set([
62165
62165
  CLIENT_METHODS.elicitation_complete
62166
62166
  ]);
62167
62167
 
62168
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/goal-extension.js
62168
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/goal-extension.js
62169
62169
  var GOAL_EXTENSION_VERSION = 1;
62170
62170
  var GOAL_CONTROL_METHOD = "_session/goal";
62171
62171
  var GOAL_ACTIONS = ["set", "clear"];
@@ -62214,7 +62214,7 @@ function toGoalSnapshot(message) {
62214
62214
  };
62215
62215
  }
62216
62216
 
62217
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-titles.js
62217
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-titles.js
62218
62218
  var MAX_TITLE_LENGTH = 256;
62219
62219
  var MAX_TITLE_CONTEXT_LENGTH = 1000;
62220
62220
  var MIN_TITLE_CONTEXT_LENGTH = 10;
@@ -62341,7 +62341,7 @@ ${promptText}
62341
62341
  }
62342
62342
  }
62343
62343
 
62344
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/air-extension.js
62344
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/air-extension.js
62345
62345
  var AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY = "nativeSubagentSessions";
62346
62346
  var AIR_ASYNC_TASKS_CAPABILITY = "asyncTasks";
62347
62347
  var AIR_SESSION_FAILURE_CAPABILITY = "sessionFailure";
@@ -62382,7 +62382,7 @@ function asRecord(value) {
62382
62382
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
62383
62383
  }
62384
62384
 
62385
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-subagents.js
62385
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-subagents.js
62386
62386
  function clientSupportsSubagents(capabilities) {
62387
62387
  const subagents = capabilities?.subagents;
62388
62388
  if (typeof subagents === "object" && subagents !== null && !Array.isArray(subagents)) {
@@ -62394,7 +62394,7 @@ function asSdkSessionNotification(notification) {
62394
62394
  return notification;
62395
62395
  }
62396
62396
 
62397
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/native-subagents.js
62397
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/native-subagents.js
62398
62398
  var MAX_PENDING_PARENTS = 64;
62399
62399
  var MAX_PENDING_UPDATES = 256;
62400
62400
  var MAX_PENDING_UPDATES_PER_PARENT = 32;
@@ -62789,7 +62789,7 @@ function nonBlankString(value) {
62789
62789
  return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
62790
62790
  }
62791
62791
 
62792
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/async-tasks.js
62792
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/async-tasks.js
62793
62793
  function clientSupportsAsyncTasks(capabilities) {
62794
62794
  return clientSupportsAirCapability(capabilities, AIR_ASYNC_TASKS_CAPABILITY);
62795
62795
  }
@@ -63337,7 +63337,7 @@ function isRecord2(value) {
63337
63337
  return typeof value === "object" && value !== null && !Array.isArray(value);
63338
63338
  }
63339
63339
 
63340
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-agent.js
63340
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-agent.js
63341
63341
  import { execFile } from "child_process";
63342
63342
  import { randomUUID as randomUUID4 } from "crypto";
63343
63343
  import { existsSync as existsSync3 } from "fs";
@@ -63345,7 +63345,7 @@ import * as fs4 from "fs/promises";
63345
63345
  import * as os3 from "os";
63346
63346
  import * as path6 from "path";
63347
63347
  import { promisify } from "util";
63348
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/package.json
63348
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/package.json
63349
63349
  var package_default = {
63350
63350
  name: "@agentclientprotocol/claude-agent-acp",
63351
63351
  publishConfig: {
@@ -63434,7 +63434,7 @@ var package_default = {
63434
63434
  }
63435
63435
  };
63436
63436
 
63437
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/elicitation.js
63437
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/elicitation.js
63438
63438
  import { randomUUID as randomUUID2 } from "crypto";
63439
63439
  function mcpElicitationToCreateRequest(request, sessionId) {
63440
63440
  if (request.mode === "url") {
@@ -63616,7 +63616,7 @@ function refusalFallbackResultFromResponse(response) {
63616
63616
  return choice === RETRY_FALLBACK_RESULT ? RETRY_FALLBACK_RESULT : KEEP_REFUSAL_RESULT;
63617
63617
  }
63618
63618
 
63619
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/fork-session.js
63619
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/fork-session.js
63620
63620
  function forkPointMessageId(meta3) {
63621
63621
  const fork = meta3?.jetbrains?.air?.fork;
63622
63622
  if (fork?.version !== 1)
@@ -63648,7 +63648,7 @@ async function forkSession(params, dependencies) {
63648
63648
  return { sessionId: forked.sessionId };
63649
63649
  }
63650
63650
 
63651
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/modes.js
63651
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/modes.js
63652
63652
  var IS_ROOT = (process.geteuid?.() ?? process.getuid?.()) === 0;
63653
63653
  var ALLOW_BYPASS = !IS_ROOT || !!process.env.IS_SANDBOX;
63654
63654
  var PERMISSION_MODE_ALIASES = {
@@ -63686,7 +63686,7 @@ function resolvePermissionMode(defaultMode, logger = console) {
63686
63686
  return mapped;
63687
63687
  }
63688
63688
 
63689
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/normalization.js
63689
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/normalization.js
63690
63690
  var MAX_UPDATES = 100;
63691
63691
  var MAX_RULES_PER_UPDATE = 100;
63692
63692
  var MAX_DIRECTORIES_PER_UPDATE = 100;
@@ -63763,11 +63763,11 @@ function normalizeDurablePermissionChangeSet(suggestions, forcedAsk = false) {
63763
63763
  }
63764
63764
  }
63765
63765
 
63766
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/filesystem.js
63766
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/filesystem.js
63767
63767
  import os2 from "os";
63768
63768
  import path from "path";
63769
63769
 
63770
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/shared.js
63770
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/shared.js
63771
63771
  var PERMISSION_OPTION_ID = {
63772
63772
  allowOnce: "allow-once",
63773
63773
  allowWithUpdates: "allow-with-updates",
@@ -63818,7 +63818,7 @@ function withGeneratedUpdate(name, rejectName = "No") {
63818
63818
  return [allowOnce(), allowWithUpdates(name), reject(rejectName)];
63819
63819
  }
63820
63820
 
63821
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/filesystem.js
63821
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/filesystem.js
63822
63822
  function isFileSessionChangeSet(changeSet, operation) {
63823
63823
  return !!changeSet && changeSet.updates.every((update) => {
63824
63824
  if (update.destination !== "session")
@@ -63915,7 +63915,7 @@ function buildNotebookEditPermissionOptions(context) {
63915
63915
  return buildFilePermissionOptions(context, inputPath(context, "notebook_path"), "write");
63916
63916
  }
63917
63917
 
63918
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/shell.js
63918
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/shell.js
63919
63919
  import path2 from "path";
63920
63920
  function permissionRulePrefix(value) {
63921
63921
  return value.endsWith(":*") ? value.slice(0, -2) : value;
@@ -63997,7 +63997,7 @@ function buildPowerShellPermissionOptions(context) {
63997
63997
  return buildShellPermissionOptions(context, "PowerShell");
63998
63998
  }
63999
63999
 
64000
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/tools.js
64000
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/tools.js
64001
64001
  function buildWebFetchPermissionOptions(context) {
64002
64002
  const url2 = plainString(context.input.url);
64003
64003
  if (url2 && context.allowPersistentOptions !== false) {
@@ -64114,7 +64114,7 @@ function buildComputerUseMcpPermissionOptions(context) {
64114
64114
  return withOptionalUpdate(changeSet, changeSet ? `Yes, and don't ask again for ${toolLabel}` : undefined);
64115
64115
  }
64116
64116
 
64117
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options.js
64117
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options.js
64118
64118
  function buildClaudePermissionOptions(context) {
64119
64119
  return buildUnsortedClaudePermissionOptions(context).sort((left, right) => permissionOptionOrder(left) - permissionOptionOrder(right));
64120
64120
  }
@@ -64172,7 +64172,7 @@ function permissionOptionOrder(option) {
64172
64172
  }
64173
64173
  }
64174
64174
 
64175
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/tools.js
64175
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/tools.js
64176
64176
  import path3 from "path";
64177
64177
  function toDisplayPath(filePath, cwd) {
64178
64178
  if (!cwd)
@@ -65123,7 +65123,7 @@ var createTaskHook = (options) => async (input) => {
65123
65123
  return { continue: true };
65124
65124
  };
65125
65125
 
65126
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/presentation.js
65126
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/presentation.js
65127
65127
  function humanText(value, maxLength, singleLine = false) {
65128
65128
  if (typeof value !== "string")
65129
65129
  return;
@@ -65191,7 +65191,7 @@ ${JSON.stringify(value.input, null, 2)}
65191
65191
  };
65192
65192
  }
65193
65193
 
65194
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/effects.js
65194
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/effects.js
65195
65195
  function parseClaudePermissionSelection(response, toolName) {
65196
65196
  if (response.outcome?.outcome !== "selected")
65197
65197
  throw new Error("Tool use aborted");
@@ -65349,7 +65349,7 @@ function applyClaudePermissionSelection(selection, context) {
65349
65349
  }
65350
65350
  }
65351
65351
 
65352
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/response.js
65352
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/response.js
65353
65353
  function decodeClaudePermissionResponse(response, toolName, input, toolUseID, offeredOptions, durableChangeSet) {
65354
65354
  const selection = parseClaudePermissionSelection(response, toolName);
65355
65355
  const offeredOption = offeredOptions.find((option) => option.optionId === selection.optionId);
@@ -65368,7 +65368,7 @@ function decodeClaudePermissionResponse(response, toolName, input, toolUseID, of
65368
65368
  };
65369
65369
  }
65370
65370
 
65371
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/settings.js
65371
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/settings.js
65372
65372
  import * as fs2 from "fs";
65373
65373
  import * as path4 from "path";
65374
65374
  function getManagedSettingsPath() {
@@ -65500,7 +65500,7 @@ class SettingsManager {
65500
65500
  }
65501
65501
  }
65502
65502
 
65503
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-failure-extension.js
65503
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-failure-extension.js
65504
65504
  import { randomUUID as randomUUID3 } from "crypto";
65505
65505
  function airSessionFailureCapabilityMeta(...additionalCapabilities) {
65506
65506
  return airCapabilityMeta(AIR_SESSION_FAILURE_CAPABILITY, ...additionalCapabilities);
@@ -65795,7 +65795,7 @@ function providerFailureCategory(errorKind, isUsageLimit = false) {
65795
65795
  }
65796
65796
  }
65797
65797
 
65798
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/file-change-audit.js
65798
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/file-change-audit.js
65799
65799
  import * as fs3 from "fs";
65800
65800
  import * as path5 from "path";
65801
65801
  var AGENT_FILE_CHANGE_REPORT_CAPABILITY = "agentFileChangeReport";
@@ -66086,7 +66086,7 @@ function hasControlCharacter(value) {
66086
66086
  return false;
66087
66087
  }
66088
66088
 
66089
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/utils.js
66089
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/utils.js
66090
66090
  import { WritableStream as WritableStream2, ReadableStream as ReadableStream2 } from "stream/web";
66091
66091
 
66092
66092
  class Pushable {
@@ -66161,12 +66161,12 @@ function unreachable(value, logger = console) {
66161
66161
  logger.error(`Unexpected case: ${valueAsString}`);
66162
66162
  }
66163
66163
 
66164
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-config-ids.js
66164
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-config-ids.js
66165
66165
  var DEFAULT_MODEL_ID = "default";
66166
66166
  var DEFAULT_AGENT_ID = "default";
66167
66167
  var EFFORT_CONFIG_ID = "effort";
66168
66168
 
66169
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/clear-context-coordinator.js
66169
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/clear-context-coordinator.js
66170
66170
  function restartParams(session) {
66171
66171
  const originalParams = session.creationParams ?? { cwd: session.cwd, mcpServers: [] };
66172
66172
  const currentEffort = session.configOptions.find((option) => option.id === EFFORT_CONFIG_ID)?.currentValue;
@@ -66236,7 +66236,7 @@ async function continuePlanInFreshContext(sessionId, oldSession, reset, host, si
66236
66236
  host.ensureConsumer(freshSession, sessionId);
66237
66237
  }
66238
66238
 
66239
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/tool-result-meta.js
66239
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/tool-result-meta.js
66240
66240
  function parseToolResultMeta(raw) {
66241
66241
  if (!Array.isArray(raw))
66242
66242
  return;
@@ -66255,7 +66255,7 @@ function parseToolResultMeta(raw) {
66255
66255
  return byToolUseId;
66256
66256
  }
66257
66257
 
66258
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/exit-plan.js
66258
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/exit-plan.js
66259
66259
  function acceptedPlanToolResult(notification, toolUseId) {
66260
66260
  const update = notification.update;
66261
66261
  if (!toolUseId || update.sessionUpdate !== "tool_call_update" || update.toolCallId !== toolUseId) {
@@ -66385,7 +66385,7 @@ ${plan}` }]
66385
66385
  }
66386
66386
  }
66387
66387
  }
66388
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-mode.js
66388
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-mode.js
66389
66389
  var MODE_CONFIG_ID = "mode";
66390
66390
  var AUTO_MODE_FALLBACK = "acceptEdits";
66391
66391
  var AUTO_MODE_FALLBACK_NOTICE = "**Auto mode unavailable:** the selected model does not support Auto mode; using Accept edits instead.";
@@ -66596,7 +66596,7 @@ class SessionModeManager {
66596
66596
  }
66597
66597
  }
66598
66598
 
66599
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-agent.js
66599
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-agent.js
66600
66600
  var CLAUDE_CONFIG_DIR = process.env.CLAUDE_CONFIG_DIR ?? path6.join(os3.homedir(), ".claude");
66601
66601
  var execFileAsync = promisify(execFile);
66602
66602
  var MAX_INLINE_FAILURE_TITLE_LENGTH = 256;
@@ -71288,7 +71288,7 @@ function getMatchingModelUsage(modelUsage, currentModel) {
71288
71288
  }
71289
71289
  }
71290
71290
 
71291
- // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+3d26a449918ae7ef/node_modules/@agentclientprotocol/claude-agent-acp/dist/index.js
71291
+ // ../../node_modules/.bun/@agentclientprotocol+claude-agent-acp@0.73.0+fa4332ff673e3304/node_modules/@agentclientprotocol/claude-agent-acp/dist/index.js
71292
71292
  import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync2 } from "fs";
71293
71293
  import { join as join7 } from "path";
71294
71294
  if (process.argv.includes("--cli")) {
@@ -24,6 +24,8 @@ async function main() {
24
24
  bytes.fill(0);
25
25
  }
26
26
  process.env.CLAUDE_CODE_MAX_OUTPUT_TOKENS = MAX_OUTPUT_TOKENS;
27
+ if (process.env.JIG_AGENT_HOME !== undefined)
28
+ process.env.CLAUDE_CODE_TMPDIR = process.env.JIG_AGENT_HOME;
27
29
  delete process.env.JIG_CLAUDE_STARTUP_INPUT;
28
30
  delete process.env.LD_LIBRARY_PATH;
29
31
  await import(ADAPTER_SPECIFIER);
@@ -27905,9 +27905,21 @@ function isUnknownRecord(value) {
27905
27905
  var CUSTOM_GATEWAY_PROVIDER_ID = "custom-gateway";
27906
27906
  var OPENAI_PROVIDER_ID = "openai";
27907
27907
  var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
27908
+ var JIG_CODEX_AUTH_BOOTSTRAP = "__JIG_CODEX_AUTH_BOOTSTRAP__";
27908
27909
  var SUPPORTED_GATEWAY_PROTOCOLS = {
27909
27910
  openai: "responses"
27910
27911
  };
27912
+ function consumeJigCodexAuthBootstrap() {
27913
+ const bootstrap = globalThis[JIG_CODEX_AUTH_BOOTSTRAP];
27914
+ if (bootstrap === void 0) return null;
27915
+ delete globalThis[JIG_CODEX_AUTH_BOOTSTRAP];
27916
+ if (typeof bootstrap !== "function") throw new Error("Codex startup authentication is invalid");
27917
+ const value = bootstrap();
27918
+ if (value === null || typeof value !== "object" || typeof value.accessToken !== "string" || value.accessToken.length === 0 || typeof value.chatgptAccountId !== "string" || value.chatgptAccountId.length === 0) {
27919
+ throw new Error("Codex startup authentication is invalid");
27920
+ }
27921
+ return value;
27922
+ }
27911
27923
  var CodexAcpClient = class {
27912
27924
  codexClient;
27913
27925
  config;
@@ -27946,6 +27958,16 @@ var CodexAcpClient = class {
27946
27958
  title: request.clientInfo?.title ?? this.defaultClientInfo.title
27947
27959
  }
27948
27960
  });
27961
+ const jigAuth = consumeJigCodexAuthBootstrap();
27962
+ if (jigAuth !== null) {
27963
+ const login = await this.codexClient.accountLogin({
27964
+ type: "chatgptAuthTokens",
27965
+ accessToken: jigAuth.accessToken,
27966
+ chatgptAccountId: jigAuth.chatgptAccountId,
27967
+ chatgptPlanType: null
27968
+ });
27969
+ if (login.type !== "chatgptAuthTokens") throw new Error("Codex startup authentication failed");
27970
+ }
27949
27971
  this.configPath = response?.codexHome ?? null;
27950
27972
  }
27951
27973
  getHomePath() {
@@ -1,14 +1,17 @@
1
1
  // @bun
2
2
  // src/internal/codex-agent-launcher.ts
3
- import { closeSync, mkdirSync, openSync, readSync, writeSync, symlinkSync } from "fs";
3
+ import { closeSync, mkdirSync, openSync, readSync, symlinkSync, writeSync } from "fs";
4
4
  import { dirname } from "path";
5
5
  var STARTUP_INPUT_BYTES = 64 * 1024;
6
- var CODEX_HOME = "/tmp/codex-home";
7
- var CREDENTIAL_PATH = `${CODEX_HOME}/auth.json`;
6
+ var CODEX_HOME = process.env.JIG_AGENT_HOME ? `${process.env.JIG_AGENT_HOME}/codex-home` : "/tmp/codex-home";
7
+ var OUTPUT_ROOT = process.env.JIG_OUTPUT_ROOT ?? "/jig-output";
8
8
  var ADAPTER_SPECIFIER = "./codex-acp.js";
9
+ var AUTH_BOOTSTRAP = "__JIG_CODEX_AUTH_BOOTSTRAP__";
9
10
  if (import.meta.main)
10
11
  await main();
11
12
  async function main() {
13
+ delete process.env.JIG_AGENT_HOME;
14
+ delete process.env.JIG_OUTPUT_ROOT;
12
15
  mkdirSync(CODEX_HOME, { mode: 448 });
13
16
  materializeStartupFeatures();
14
17
  const startup = process.env.JIG_CODEX_STARTUP_INPUT;
@@ -16,7 +19,7 @@ async function main() {
16
19
  throw new Error("Codex startup input mode is invalid");
17
20
  }
18
21
  if (startup === "subscription")
19
- materializeCredential();
22
+ installCredentialBootstrap();
20
23
  delete process.env.JIG_CODEX_STARTUP_INPUT;
21
24
  const session = process.env.JIG_CODEX_SESSION_STATE;
22
25
  if (session !== undefined && session !== "1")
@@ -36,7 +39,9 @@ function codexStartupFeatures(configuration) {
36
39
  const entries = Object.entries(features);
37
40
  if (entries.length > 16 || entries.some(([key, value]) => !/^[a-z_]+(?![\s\S])/.test(key) || typeof value !== "boolean"))
38
41
  throw new Error("Codex features are invalid");
39
- return `[features]
42
+ return `cli_auth_credentials_store = "ephemeral"
43
+
44
+ [features]
40
45
  ${entries.map(([key, value]) => `${key} = ${value}`).join(`
41
46
  `)}
42
47
  `;
@@ -60,14 +65,14 @@ function materializeSession() {
60
65
  const contentBytes = view.getUint32(4, false);
61
66
  if (pathBytes > 256 || contentBytes > 8388608 || pathBytes === 0 !== (contentBytes === 0))
62
67
  throw new Error("Codex session bootstrap is invalid");
63
- mkdirSync("/jig-output/sessions", { mode: 448 });
64
- symlinkSync("/jig-output/sessions", `${CODEX_HOME}/sessions`);
68
+ mkdirSync(`${OUTPUT_ROOT}/sessions`, { mode: 448 });
69
+ symlinkSync(`${OUTPUT_ROOT}/sessions`, `${CODEX_HOME}/sessions`);
65
70
  if (pathBytes === 0)
66
71
  return;
67
72
  const path = new TextDecoder("utf-8", { fatal: true }).decode(readExactly(pathBytes));
68
73
  if (!/^sessions\/\d{4}\/\d{2}\/\d{2}\/rollout-[0-9T-]+-[0-9a-f-]{36}\.jsonl(?![\s\S])/.test(path))
69
74
  throw new Error("Codex session path is invalid");
70
- const target = `/jig-output/${path}`;
75
+ const target = `${OUTPUT_ROOT}/${path}`;
71
76
  mkdirSync(dirname(target), { recursive: true, mode: 448 });
72
77
  const descriptor = openSync(target, "wx", 384);
73
78
  try {
@@ -76,22 +81,38 @@ function materializeSession() {
76
81
  closeSync(descriptor);
77
82
  }
78
83
  }
79
- function materializeCredential() {
84
+ function installCredentialBootstrap() {
80
85
  const header = readExactly(4);
81
86
  const size = new DataView(header.buffer, header.byteOffset, header.byteLength).getUint32(0, false);
82
87
  if (size === 0 || size > STARTUP_INPUT_BYTES - 4) {
83
88
  throw new Error("Codex startup input is invalid");
84
89
  }
85
90
  const credential = readExactly(size);
86
- let descriptor;
91
+ let accessToken = "";
92
+ let accountId = "";
87
93
  try {
88
- descriptor = openSync(CREDENTIAL_PATH, "wx", 384);
89
- writeExactly(descriptor, credential);
94
+ const parsed = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(credential));
95
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed) || parsed.auth_mode !== "chatgptAuthTokens" || parsed.tokens === null || typeof parsed.tokens !== "object" || Array.isArray(parsed.tokens) || typeof parsed.tokens.access_token !== "string" || parsed.tokens.access_token.length === 0 || typeof parsed.tokens.account_id !== "string" || parsed.tokens.account_id.length === 0) {
96
+ throw new Error("Codex startup input is invalid");
97
+ }
98
+ accessToken = parsed.tokens.access_token;
99
+ accountId = parsed.tokens.account_id;
90
100
  } finally {
91
101
  credential.fill(0);
92
- if (descriptor !== undefined)
93
- closeSync(descriptor);
94
102
  }
103
+ Object.defineProperty(globalThis, AUTH_BOOTSTRAP, {
104
+ configurable: true,
105
+ enumerable: false,
106
+ value: () => {
107
+ if (accessToken.length === 0 || accountId.length === 0)
108
+ throw new Error("Codex startup input was already consumed");
109
+ const result = Object.freeze({ accessToken, chatgptAccountId: accountId });
110
+ accessToken = "";
111
+ accountId = "";
112
+ return result;
113
+ },
114
+ writable: false
115
+ });
95
116
  }
96
117
  function readExactly(size) {
97
118
  const result = new Uint8Array(size);
@@ -13559,11 +13559,11 @@ var PiRpcProcess = class _PiRpcProcess {
13559
13559
  const args = ["--mode", "rpc", "--no-themes"];
13560
13560
  if (params.sessionPath)
13561
13561
  args.push("--session", params.sessionPath);
13562
- const child = spawn(cmd, args, {
13562
+ const child = spawn(process.execPath, [cmd, ...args], {
13563
13563
  cwd: params.cwd,
13564
13564
  stdio: "pipe",
13565
13565
  env: process.env,
13566
- shell: shouldUseShellForPiCommand(cmd)
13566
+ shell: false
13567
13567
  });
13568
13568
  try {
13569
13569
  await new Promise((resolve4, reject) => {
@@ -5,8 +5,9 @@
5
5
  import { spawn } from "child_process";
6
6
  import { closeSync, mkdirSync, openSync, readSync, writeFileSync, writeSync } from "fs";
7
7
  var STARTUP_INPUT_BYTES = 64 * 1024;
8
- var PI_HOME = "/tmp/pi-home";
9
- var PI_AGENT_DIR = "/tmp/pi-agent";
8
+ var PRIVATE_TEMP_ROOT = process.env.JIG_AGENT_HOME ?? "/tmp";
9
+ var PI_HOME = `${PRIVATE_TEMP_ROOT}/pi-home`;
10
+ var PI_AGENT_DIR = `${PRIVATE_TEMP_ROOT}/pi-agent`;
10
11
  var CREDENTIAL_PATH = `${PI_AGENT_DIR}/auth.json`;
11
12
  var SETTINGS_PATH = `${PI_AGENT_DIR}/settings.json`;
12
13
  var MODELS_PATH = `${PI_AGENT_DIR}/models.json`;
@@ -50,6 +51,7 @@ var PRIVATE_PI_SETTINGS = Object.freeze({
50
51
  if (import.meta.main)
51
52
  await main();
52
53
  async function main() {
54
+ delete process.env.JIG_AGENT_HOME;
53
55
  const startup = process.env.JIG_PI_STARTUP_INPUT;
54
56
  if (startup === undefined) {
55
57
  await launchNativePi();
@@ -121,7 +123,7 @@ async function launchNativePi() {
121
123
  const provider = requireProvider(process.env.JIG_PI_PROVIDER);
122
124
  const model = requireSelection(process.env.JIG_PI_MODEL, "Pi model");
123
125
  const child = spawn(requireNativeExecutable(process.env.JIG_PI_EXECUTABLE), [...PRIVATE_PI_NATIVE_ARGUMENTS, "--provider", provider, "--model", model], {
124
- cwd: "/work",
126
+ cwd: process.env.JIG_AGENT_WORK ?? "/work",
125
127
  env: Object.fromEntries(Object.entries(process.env).filter(([key]) => key !== "LD_LIBRARY_PATH")),
126
128
  stdio: "inherit"
127
129
  });