@agentchatme/codex 0.0.17113 → 0.0.17114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ const require=__acCreateRequire(import.meta.url);
5
5
  // src/index.ts
6
6
  import { parseArgs } from "util";
7
7
 
8
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.1312/node_modules/@agentchatme/agent-core/dist/chunk-AGDJ4A6R.js
8
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.1313/node_modules/@agentchatme/agent-core/dist/chunk-27XDHOL3.js
9
9
  import * as fs2 from "fs";
10
10
  import * as path2 from "path";
11
11
  import * as fs3 from "fs";
@@ -35,7 +35,7 @@ var log = {
35
35
  info: (msg) => emit("info", msg),
36
36
  debug: (msg) => emit("debug", msg)
37
37
  };
38
- var VERSION = "0.0.1312";
38
+ var VERSION = "0.0.1313";
39
39
  var CODING_AGENTS_CLIENT_IDENTITY = {
40
40
  name: "coding_agents",
41
41
  version: VERSION
@@ -44,6 +44,25 @@ var CODING_AGENTS_CLIENT_HEADERS = {
44
44
  "X-AgentChat-Client": CODING_AGENTS_CLIENT_IDENTITY.name,
45
45
  "X-AgentChat-Client-Version": CODING_AGENTS_CLIENT_IDENTITY.version
46
46
  };
47
+ var SEC = 1e3;
48
+ var MIN = 60 * SEC;
49
+ var HOUR = 60 * MIN;
50
+ var DAY = 24 * HOUR;
51
+ function relativeAge(ms) {
52
+ if (ms < 45 * SEC) return "just now";
53
+ if (ms < 90 * SEC) return "1 minute ago";
54
+ if (ms < 45 * MIN) return `${Math.round(ms / MIN)} minutes ago`;
55
+ if (ms < 90 * MIN) return "1 hour ago";
56
+ if (ms < 22 * HOUR) return `${Math.round(ms / HOUR)} hours ago`;
57
+ if (ms < 36 * HOUR) return "1 day ago";
58
+ return `${Math.round(ms / DAY)} days ago`;
59
+ }
60
+ function relativeWhen(createdAt, now2 = Date.now()) {
61
+ if (!createdAt) return "";
62
+ const t = Date.parse(createdAt);
63
+ if (Number.isNaN(t)) return "";
64
+ return relativeAge(Math.max(0, now2 - t));
65
+ }
47
66
  function atomicWriteFile(filePath, data, mode) {
48
67
  const dir = path2.dirname(filePath);
49
68
  fs2.mkdirSync(dir, { recursive: true, mode: 448 });
@@ -4204,8 +4223,11 @@ var SyncRowSchema = external_exports.object({
4204
4223
  // fallback against a future server-side rename).
4205
4224
  sender: external_exports.string().optional(),
4206
4225
  sender_handle: external_exports.string().optional(),
4226
+ seq: external_exports.number().optional(),
4207
4227
  type: external_exports.string().optional(),
4208
4228
  content: external_exports.record(external_exports.unknown()).optional(),
4229
+ metadata: external_exports.record(external_exports.unknown()).optional(),
4230
+ status: external_exports.string().optional(),
4209
4231
  created_at: external_exports.string().optional()
4210
4232
  }).passthrough();
4211
4233
  function contextOf(row) {
@@ -4304,6 +4326,28 @@ async function claimReply(cfg, messageId, holder) {
4304
4326
  return true;
4305
4327
  }
4306
4328
  }
4329
+ async function claimReplyBatch(cfg, messageIds, holder) {
4330
+ if (messageIds.length === 0) return 0;
4331
+ try {
4332
+ const data = await request(cfg, "POST", "/v1/reply/claim-batch", {
4333
+ message_ids: messageIds,
4334
+ holder
4335
+ });
4336
+ const parsed = external_exports.object({ claimed_count: external_exports.number().int().min(0).max(messageIds.length) }).passthrough().safeParse(data);
4337
+ return parsed.success ? parsed.data.claimed_count : messageIds.length;
4338
+ } catch (err) {
4339
+ if (!/AgentChat API (404|405)\b/.test(String(err))) {
4340
+ log.warn(`reply-batch-claim failed (surfacing all): ${String(err)}`);
4341
+ return messageIds.length;
4342
+ }
4343
+ }
4344
+ let claimed = 0;
4345
+ for (const messageId of messageIds) {
4346
+ if (!await claimReply(cfg, messageId, holder)) break;
4347
+ claimed += 1;
4348
+ }
4349
+ return claimed;
4350
+ }
4307
4351
  function lastDeliveryId(rows) {
4308
4352
  for (let i = rows.length - 1; i >= 0; i--) {
4309
4353
  const id = rows[i]?.delivery_id;
@@ -4390,12 +4434,12 @@ function alwaysOnHealth(home) {
4390
4434
  return { wanted: state !== "off", healthy: state !== "down" };
4391
4435
  }
4392
4436
 
4393
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.1312/node_modules/@agentchatme/agent-core/dist/index.js
4437
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.1313/node_modules/@agentchatme/agent-core/dist/index.js
4394
4438
  import * as fs from "fs";
4395
4439
  import * as path from "path";
4396
4440
  import * as readline from "readline";
4397
4441
 
4398
- // node_modules/.pnpm/agentchatme@1.0.221_ws@8.21.1/node_modules/agentchatme/dist/index.js
4442
+ // node_modules/.pnpm/agentchatme@1.0.2212_ws@8.21.1/node_modules/agentchatme/dist/index.js
4399
4443
  var ErrorCode = {
4400
4444
  AGENT_NOT_FOUND: "AGENT_NOT_FOUND",
4401
4445
  AGENT_SUSPENDED: "AGENT_SUSPENDED",
@@ -4601,7 +4645,7 @@ function createAgentChatError(body, status, headers) {
4601
4645
  return new AgentChatError(body, status, requestId);
4602
4646
  }
4603
4647
  }
4604
- var VERSION2 = "1.0.221";
4648
+ var VERSION2 = "1.0.2212";
4605
4649
  function detectRuntime() {
4606
4650
  const g = globalThis;
4607
4651
  if (typeof g.Bun?.version === "string") return `bun/${g.Bun.version}`;
@@ -4655,8 +4699,8 @@ var HttpTransport = class {
4655
4699
  }
4656
4700
  this.fetchFn = f.bind(globalThis);
4657
4701
  }
4658
- async request(method, path8, opts = {}) {
4659
- const url = `${this.baseUrl}${path8}`;
4702
+ async request(method, path9, opts = {}) {
4703
+ const url = `${this.baseUrl}${path9}`;
4660
4704
  const policy = resolveRetryPolicy(opts.retry, this.retry);
4661
4705
  const canRetry = isRetryEligible(method, opts.idempotencyKey, opts.retry);
4662
4706
  const maxAttempts = canRetry ? policy.maxRetries + 1 : 1;
@@ -4986,31 +5030,31 @@ var AgentChatClient = class _AgentChatClient {
4986
5030
  this.onBacklogWarning = options.onBacklogWarning;
4987
5031
  }
4988
5032
  // ─── Internal request helpers ─────────────────────────────────────────────
4989
- async get(path8, opts) {
4990
- const res = await this.http.request("GET", path8, this.toRequestOpts(opts));
5033
+ async get(path9, opts) {
5034
+ const res = await this.http.request("GET", path9, this.toRequestOpts(opts));
4991
5035
  return res.data;
4992
5036
  }
4993
- async del(path8, opts) {
4994
- const res = await this.http.request("DELETE", path8, this.toRequestOpts(opts));
5037
+ async del(path9, opts) {
5038
+ const res = await this.http.request("DELETE", path9, this.toRequestOpts(opts));
4995
5039
  return res.data;
4996
5040
  }
4997
- async post(path8, body, opts) {
4998
- const res = await this.http.request("POST", path8, {
5041
+ async post(path9, body, opts) {
5042
+ const res = await this.http.request("POST", path9, {
4999
5043
  ...this.toRequestOpts(opts),
5000
5044
  body
5001
5045
  });
5002
5046
  return res.data;
5003
5047
  }
5004
- async patch(path8, body, opts) {
5005
- const res = await this.http.request("PATCH", path8, {
5048
+ async patch(path9, body, opts) {
5049
+ const res = await this.http.request("PATCH", path9, {
5006
5050
  ...this.toRequestOpts(opts),
5007
5051
  body
5008
5052
  });
5009
5053
  return res.data;
5010
5054
  }
5011
- async put(path8, body, opts) {
5055
+ async put(path9, body, opts) {
5012
5056
  const headers = opts?.contentType ? { "Content-Type": opts.contentType } : void 0;
5013
- const res = await this.http.request("PUT", path8, {
5057
+ const res = await this.http.request("PUT", path9, {
5014
5058
  ...this.toRequestOpts(opts),
5015
5059
  body,
5016
5060
  rawBody: opts?.rawBody,
@@ -5216,6 +5260,7 @@ var AgentChatClient = class _AgentChatClient {
5216
5260
  * most one:
5217
5261
  * - `beforeSeq` — backwards scrollback (rows with seq < N, newest first)
5218
5262
  * - `afterSeq` — forwards gap-fill (rows with seq > N, oldest first)
5263
+ * - `aroundMessageId` — backwards window ending at that exact message
5219
5264
  *
5220
5265
  * `afterSeq` is the path `RealtimeClient` uses for in-order recovery
5221
5266
  * when a per-conversation seq gap is detected. Application code usually
@@ -5226,6 +5271,9 @@ var AgentChatClient = class _AgentChatClient {
5226
5271
  params.set("limit", String(options?.limit ?? 50));
5227
5272
  if (options?.beforeSeq !== void 0) params.set("before_seq", String(options.beforeSeq));
5228
5273
  if (options?.afterSeq !== void 0) params.set("after_seq", String(options.afterSeq));
5274
+ if (options?.aroundMessageId !== void 0) {
5275
+ params.set("around_message_id", options.aroundMessageId);
5276
+ }
5229
5277
  return this.get(
5230
5278
  `/v1/messages/${encodeURIComponent(conversationId)}?${params.toString()}`,
5231
5279
  options
@@ -5243,10 +5291,10 @@ var AgentChatClient = class _AgentChatClient {
5243
5291
  * Idempotent — hiding an already-hidden message is a success no-op.
5244
5292
  */
5245
5293
  /**
5246
- * Mark a message as read. Advances the caller's read cursor to the
5247
- * target message's seq — idempotent, monotonic (the server ignores
5248
- * attempts to walk the cursor backwards). A `message.read` event is
5249
- * fanned out to the sender via WebSocket + webhook.
5294
+ * Mark one message as read for the caller. This updates that message's
5295
+ * recipient envelope only; it does not implicitly mark earlier messages,
5296
+ * so a conversation can legitimately contain unread gaps. A `message.read`
5297
+ * event is fanned out to the sender via WebSocket + webhook.
5250
5298
  *
5251
5299
  * Realtime clients also have a WebSocket shortcut (`message.read_ack`
5252
5300
  * frame) that bypasses this HTTP call. The REST method exists for
@@ -5283,6 +5331,17 @@ var AgentChatClient = class _AgentChatClient {
5283
5331
  opts
5284
5332
  );
5285
5333
  }
5334
+ /**
5335
+ * Fetch compact server-authored room metadata: group summary or DM
5336
+ * counterparty, contact memory, and the exact unread seq boundary.
5337
+ * Message bodies stay on `getMessages`.
5338
+ */
5339
+ getConversationContext(conversationId, opts) {
5340
+ return this.get(
5341
+ `/v1/conversations/${encodeURIComponent(conversationId)}/context`,
5342
+ opts
5343
+ );
5344
+ }
5286
5345
  /**
5287
5346
  * Hide a conversation from the caller's inbox (soft-delete, caller-scoped).
5288
5347
  * The other side's view is untouched — by design, matching the
@@ -5296,8 +5355,15 @@ var AgentChatClient = class _AgentChatClient {
5296
5355
  opts
5297
5356
  );
5298
5357
  }
5299
- listConversations(opts) {
5300
- return this.get("/v1/conversations", opts);
5358
+ listConversations(options) {
5359
+ const params = new URLSearchParams();
5360
+ if (options?.limit !== void 0) params.set("limit", String(options.limit));
5361
+ if (options?.offset !== void 0) params.set("offset", String(options.offset));
5362
+ const qs = params.toString();
5363
+ return this.get(
5364
+ `/v1/conversations${qs ? `?${qs}` : ""}`,
5365
+ options
5366
+ );
5301
5367
  }
5302
5368
  // ─── Groups ───────────────────────────────────────────────────────────────
5303
5369
  /**
@@ -5703,13 +5769,13 @@ var AgentChatClient = class _AgentChatClient {
5703
5769
  );
5704
5770
  }
5705
5771
  };
5706
- var SEC = 1e3;
5707
- var MIN = 60 * SEC;
5708
- var HOUR = 60 * MIN;
5709
- var DAY = 24 * HOUR;
5772
+ var SEC2 = 1e3;
5773
+ var MIN2 = 60 * SEC2;
5774
+ var HOUR2 = 60 * MIN2;
5775
+ var DAY2 = 24 * HOUR2;
5710
5776
  var MAX_ATTACHMENT_SIZE = 25 * 1024 * 1024;
5711
5777
 
5712
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.1312/node_modules/@agentchatme/agent-core/dist/index.js
5778
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.1313/node_modules/@agentchatme/agent-core/dist/index.js
5713
5779
  import * as fs22 from "fs";
5714
5780
  import * as os from "os";
5715
5781
  import * as path22 from "path";
@@ -5906,25 +5972,6 @@ function stripAllBlocks(existing, start, end) {
5906
5972
  }
5907
5973
  return text;
5908
5974
  }
5909
- var SEC2 = 1e3;
5910
- var MIN2 = 60 * SEC2;
5911
- var HOUR2 = 60 * MIN2;
5912
- var DAY2 = 24 * HOUR2;
5913
- function relativeAge(ms) {
5914
- if (ms < 45 * SEC2) return "just now";
5915
- if (ms < 90 * SEC2) return "1 minute ago";
5916
- if (ms < 45 * MIN2) return `${Math.round(ms / MIN2)} minutes ago`;
5917
- if (ms < 90 * MIN2) return "1 hour ago";
5918
- if (ms < 22 * HOUR2) return `${Math.round(ms / HOUR2)} hours ago`;
5919
- if (ms < 36 * HOUR2) return "1 day ago";
5920
- return `${Math.round(ms / DAY2)} days ago`;
5921
- }
5922
- function relativeWhen(createdAt, now2 = Date.now()) {
5923
- if (!createdAt) return "";
5924
- const t = Date.parse(createdAt);
5925
- if (Number.isNaN(t)) return "";
5926
- return relativeAge(Math.max(0, now2 - t));
5927
- }
5928
5975
  var SNIPPET_MAX = 140;
5929
5976
  function snippetOf(row) {
5930
5977
  const content = row.content ?? {};
@@ -5945,9 +5992,11 @@ function digestConversations(rows, selfHandle = null) {
5945
5992
  existing.count += 1;
5946
5993
  if (!existing.senders.includes(sender)) existing.senders.push(sender);
5947
5994
  existing.latestSnippet = snippetOf(row);
5995
+ existing.latestMessageId = row.id;
5948
5996
  existing.latestCreatedAt = row.created_at ?? existing.latestCreatedAt;
5949
5997
  existing.groupName = ctx.groupName ?? existing.groupName;
5950
5998
  existing.mentionsYou = existing.mentionsYou || mentionsSelf;
5999
+ if (mentionsSelf) existing.mentionedMessageIds.push(row.id);
5951
6000
  } else {
5952
6001
  byConversation.set(row.conversation_id, {
5953
6002
  conversationId: row.conversation_id,
@@ -5955,9 +6004,11 @@ function digestConversations(rows, selfHandle = null) {
5955
6004
  senders: [sender],
5956
6005
  count: 1,
5957
6006
  latestSnippet: snippetOf(row),
6007
+ latestMessageId: row.id,
5958
6008
  latestCreatedAt: row.created_at,
5959
6009
  groupName: ctx.groupName,
5960
- mentionsYou: mentionsSelf
6010
+ mentionsYou: mentionsSelf,
6011
+ mentionedMessageIds: mentionsSelf ? [row.id] : []
5961
6012
  });
5962
6013
  }
5963
6014
  }
@@ -5971,7 +6022,9 @@ function digestLines(digests) {
5971
6022
  const age = relativeWhen(d.latestCreatedAt);
5972
6023
  const recency = age ? `, latest ${age}` : "";
5973
6024
  const mention = d.mentionsYou ? " \u2014 mentions you" : "";
5974
- return `${i + 1}. ${who} (${count}, ${kind}${recency}${mention}), preview=${JSON.stringify(d.latestSnippet)}`;
6025
+ const attentionIds = d.mentionedMessageIds.slice(-30);
6026
+ const attention = attentionIds.length > 0 ? `, attention_message_ids=${JSON.stringify(attentionIds)}${d.mentionedMessageIds.length > attentionIds.length ? ` (+${d.mentionedMessageIds.length - attentionIds.length} older mentions in history)` : ""}` : "";
6027
+ return `${i + 1}. ${who} (${count}, ${kind}${recency}${mention}), latest_message_id=${d.latestMessageId}${attention}, preview=${JSON.stringify(d.latestSnippet)}`;
5975
6028
  });
5976
6029
  }
5977
6030
  function formatSessionStart(handle, rows) {
@@ -5986,7 +6039,7 @@ function formatSessionStart(handle, rows) {
5986
6039
  "",
5987
6040
  ...digestLines(digests),
5988
6041
  "",
5989
- "Triage per your AgentChat skill: read a conversation with agentchat_get_conversation before replying; reply only where an open request is addressed to you; finished conversations get silence, not acknowledgments. Mention anything the user should know about."
6042
+ "Triage per your AgentChat skill: read a conversation with agentchat_get_conversation before replying, passing its latest_message_id as around_message_id and any listed attention_message_ids exactly; reply only where an open request is addressed to you; finished conversations get silence, not acknowledgments. Mention anything the user should know about."
5990
6043
  ].join("\n");
5991
6044
  }
5992
6045
  function formatStopPickup(handle, rows) {
@@ -6000,7 +6053,7 @@ function formatStopPickup(handle, rows) {
6000
6053
  "",
6001
6054
  ...digestLines(digests),
6002
6055
  "",
6003
- "Handle these per your AgentChat skill, then finish. Reply via agentchat_send_message only where warranted \u2014 if nothing is actionable, simply end the turn (silence is a valid outcome)."
6056
+ "Handle these per your AgentChat skill, opening each conversation with agentchat_get_conversation, its latest_message_id as around_message_id, and any listed attention_message_ids exactly. Reply via agentchat_send_message only where warranted \u2014 if nothing is actionable, simply end the turn (silence is a valid outcome)."
6004
6057
  ].join("\n");
6005
6058
  }
6006
6059
  function formatAlwaysOnDown(copy) {
@@ -6113,12 +6166,12 @@ function ackableRows(rows) {
6113
6166
  return usable;
6114
6167
  }
6115
6168
  async function claimContiguousPrefix(cfg, rows, holder) {
6116
- const won = await Promise.all(rows.map((r) => claimReply(cfg, r.id, holder)));
6117
- const prefix = [];
6118
- for (let i = 0; i < rows.length; i++) {
6119
- if (!won[i]) break;
6120
- prefix.push(rows[i]);
6121
- }
6169
+ const claimed = await claimReplyBatch(
6170
+ cfg,
6171
+ rows.map((row) => row.id),
6172
+ holder
6173
+ );
6174
+ const prefix = rows.slice(0, claimed);
6122
6175
  if (prefix.length < rows.length) {
6123
6176
  log.info(
6124
6177
  `coexistence: daemon owns ${rows.length - prefix.length} row(s); surfacing ${prefix.length}`
@@ -7321,24 +7374,25 @@ function serviceEnv() {
7321
7374
 
7322
7375
  // src/wiring.ts
7323
7376
  import * as fs6 from "fs";
7324
- import * as path6 from "path";
7377
+ import * as path7 from "path";
7325
7378
  import { fileURLToPath } from "url";
7326
7379
 
7327
7380
  // src/adapter.ts
7328
7381
  import * as fs5 from "fs";
7382
+ import * as path6 from "path";
7329
7383
  import { spawn as spawn2, spawnSync as spawnSync2 } from "child_process";
7330
7384
 
7331
7385
  // src/version.ts
7332
- var VERSION3 = "0.0.17113";
7386
+ var VERSION3 = "0.0.17114";
7333
7387
 
7334
7388
  // src/adapter.ts
7335
7389
  var MAX_EVENT_TAIL_CHARS = 1024 * 1024;
7336
- var AGENTCHAT_MCP_PACKAGE = "@agentchatme/mcp@0.1.11212";
7390
+ var AGENTCHAT_MCP_PACKAGE = "@agentchatme/mcp@0.1.11214";
7337
7391
 
7338
7392
  // src/wiring.ts
7339
7393
  var TOML_START = "# agentchat:start";
7340
7394
  var TOML_END = "# agentchat:end";
7341
- var BUNDLE_REL = path6.join("bin", "agentchat.mjs");
7395
+ var BUNDLE_REL = path7.join("bin", "agentchat.mjs");
7342
7396
  function atomicText(file, data) {
7343
7397
  let mode = 384;
7344
7398
  try {
@@ -7348,18 +7402,18 @@ function atomicText(file, data) {
7348
7402
  atomicWriteFile(file, data, mode);
7349
7403
  }
7350
7404
  function codexConfigPath() {
7351
- return path6.join(codexHome(), "config.toml");
7405
+ return path7.join(codexHome(), "config.toml");
7352
7406
  }
7353
7407
  function codexHooksPath() {
7354
- return path6.join(codexHome(), "hooks.json");
7408
+ return path7.join(codexHome(), "hooks.json");
7355
7409
  }
7356
7410
  function stableBundlePath() {
7357
- return path6.join(identityHome(), BUNDLE_REL);
7411
+ return path7.join(identityHome(), BUNDLE_REL);
7358
7412
  }
7359
- var DAEMON_REL = path6.join("bin", "agentchat-daemon.mjs");
7413
+ var DAEMON_REL = path7.join("bin", "agentchat-daemon.mjs");
7360
7414
  var MANUAL_REL = "SKILL.md";
7361
7415
  function manualPath() {
7362
- return path6.join(identityHome(), MANUAL_REL);
7416
+ return path7.join(identityHome(), MANUAL_REL);
7363
7417
  }
7364
7418
  function writeManual() {
7365
7419
  try {
@@ -7378,10 +7432,10 @@ function writeManual() {
7378
7432
  }
7379
7433
  }
7380
7434
  function shippedDaemonPath() {
7381
- return path6.join(path6.dirname(fileURLToPath(import.meta.url)), "daemon-main.js");
7435
+ return path7.join(path7.dirname(fileURLToPath(import.meta.url)), "daemon-main.js");
7382
7436
  }
7383
7437
  function stableDaemonPath() {
7384
- return path6.join(identityHome(), DAEMON_REL);
7438
+ return path7.join(identityHome(), DAEMON_REL);
7385
7439
  }
7386
7440
  function copyDaemonBundle() {
7387
7441
  const src = shippedDaemonPath();
@@ -7389,8 +7443,8 @@ function copyDaemonBundle() {
7389
7443
  throw new Error(`the daemon bundle is missing from this install (expected ${src})`);
7390
7444
  }
7391
7445
  const dest = stableDaemonPath();
7392
- fs6.mkdirSync(path6.dirname(dest), { recursive: true });
7393
- if (path6.resolve(src) !== path6.resolve(dest)) atomicCopyFile(src, dest);
7446
+ fs6.mkdirSync(path7.dirname(dest), { recursive: true });
7447
+ if (path7.resolve(src) !== path7.resolve(dest)) atomicCopyFile(src, dest);
7394
7448
  else fs6.chmodSync(dest, 493);
7395
7449
  return dest;
7396
7450
  }
@@ -7526,9 +7580,9 @@ function unmergeHooks(existing) {
7526
7580
  }
7527
7581
  function copyBundle(bundleSrc) {
7528
7582
  const dest = stableBundlePath();
7529
- fs6.mkdirSync(path6.dirname(dest), { recursive: true });
7530
- const srcResolved = path6.resolve(bundleSrc);
7531
- if (srcResolved !== path6.resolve(dest)) {
7583
+ fs6.mkdirSync(path7.dirname(dest), { recursive: true });
7584
+ const srcResolved = path7.resolve(bundleSrc);
7585
+ if (srcResolved !== path7.resolve(dest)) {
7532
7586
  atomicCopyFile(srcResolved, dest);
7533
7587
  }
7534
7588
  return dest;
@@ -7629,7 +7683,7 @@ function removeCodexWiring(opts = {}) {
7629
7683
 
7630
7684
  // src/identity.ts
7631
7685
  import * as fs8 from "fs";
7632
- import * as path7 from "path";
7686
+ import * as path8 from "path";
7633
7687
  import { spawnSync as spawnSync3 } from "child_process";
7634
7688
 
7635
7689
  // src/always-on.ts
@@ -7821,7 +7875,7 @@ function runNotNow() {
7821
7875
  try {
7822
7876
  writeAnchor(anchorFile(), renderDeclinedBlock({ invoke: invocation(), label: LABEL }));
7823
7877
  } catch (err) {
7824
- console.error(`Recorded, but could not update ${path7.basename(anchorFile())}: ${String(err)}`);
7878
+ console.error(`Recorded, but could not update ${path8.basename(anchorFile())}: ${String(err)}`);
7825
7879
  return 1;
7826
7880
  }
7827
7881
  console.log(