@agentchatme/codex 0.0.17 → 0.0.17111

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.
@@ -3726,7 +3726,7 @@ var init_wrapper = __esm({
3726
3726
  import { parseArgs } from "util";
3727
3727
  import * as path7 from "path";
3728
3728
 
3729
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.13/node_modules/@agentchatme/agent-core/dist/chunk-NEGTEBFK.js
3729
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.1311/node_modules/@agentchatme/agent-core/dist/chunk-ER4AFPH7.js
3730
3730
  import * as fs from "fs";
3731
3731
  import * as path from "path";
3732
3732
  import * as fs2 from "fs";
@@ -3756,6 +3756,15 @@ var log = {
3756
3756
  info: (msg) => emit("info", msg),
3757
3757
  debug: (msg) => emit("debug", msg)
3758
3758
  };
3759
+ var VERSION = "0.0.1311";
3760
+ var CODING_AGENTS_CLIENT_IDENTITY = {
3761
+ name: "coding_agents",
3762
+ version: VERSION
3763
+ };
3764
+ var CODING_AGENTS_CLIENT_HEADERS = {
3765
+ "X-AgentChat-Client": CODING_AGENTS_CLIENT_IDENTITY.name,
3766
+ "X-AgentChat-Client-Version": CODING_AGENTS_CLIENT_IDENTITY.version
3767
+ };
3759
3768
  function acquireLeaderLock(home) {
3760
3769
  const lockPath = path.join(home, "daemon.lock");
3761
3770
  fs.mkdirSync(home, { recursive: true });
@@ -7918,6 +7927,7 @@ async function request(cfg, method, pathname, body) {
7918
7927
  const res = await fetch(url, {
7919
7928
  method,
7920
7929
  headers: {
7930
+ ...CODING_AGENTS_CLIENT_HEADERS,
7921
7931
  authorization: `Bearer ${cfg.apiKey}`,
7922
7932
  ...body !== void 0 ? { "content-type": "application/json" } : {}
7923
7933
  },
@@ -7963,7 +7973,7 @@ function idle(home) {
7963
7973
  }
7964
7974
  }
7965
7975
 
7966
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.13/node_modules/@agentchatme/agent-core/dist/daemon-entry.js
7976
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.1311/node_modules/@agentchatme/agent-core/dist/daemon-entry.js
7967
7977
  init_wrapper();
7968
7978
  import { EventEmitter } from "events";
7969
7979
  import * as path2 from "path";
@@ -8065,6 +8075,7 @@ var AgentWsClient = class extends EventEmitter {
8065
8075
  log.info(`ws ${this.state} (attempt ${this.attempt + 1}) \u2192 ${this.url}`);
8066
8076
  const ws = new import_websocket.default(this.url, {
8067
8077
  headers: {
8078
+ ...CODING_AGENTS_CLIENT_HEADERS,
8068
8079
  authorization: `Bearer ${this.apiKey}`,
8069
8080
  // Opt into the delivery-ack protocol: the server then leaves each
8070
8081
  // delivery 'stored' until we ack it (by message id) instead of
@@ -8164,6 +8175,7 @@ var ReplyCoord = class {
8164
8175
  const res = await fetch(url, {
8165
8176
  method,
8166
8177
  headers: {
8178
+ ...CODING_AGENTS_CLIENT_HEADERS,
8167
8179
  authorization: `Bearer ${this.cfg.apiKey}`,
8168
8180
  ...body !== void 0 ? { "content-type": "application/json" } : {}
8169
8181
  },
@@ -8413,6 +8425,13 @@ async function runDaemon(opts) {
8413
8425
  const watcher = fs3.watch(home, (_event, filename) => {
8414
8426
  if (filename === null || String(filename).startsWith("credentials")) nudged = true;
8415
8427
  });
8428
+ watcher.on("error", (err) => {
8429
+ log.warn(`credential watcher unavailable; polling instead: ${String(err)}`);
8430
+ try {
8431
+ watcher.close();
8432
+ } catch {
8433
+ }
8434
+ });
8416
8435
  watcher.unref();
8417
8436
  } catch {
8418
8437
  }
@@ -8471,7 +8490,7 @@ async function runDaemon(opts) {
8471
8490
  import * as fs5 from "fs";
8472
8491
  import { spawn, spawnSync } from "child_process";
8473
8492
 
8474
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.13/node_modules/@agentchatme/agent-core/dist/index.js
8493
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.1311/node_modules/@agentchatme/agent-core/dist/index.js
8475
8494
  var SESSION_TTL_MS = 48 * 60 * 60 * 1e3;
8476
8495
  var SessionStateSchema = external_exports.object({
8477
8496
  continuations: external_exports.number().int().min(0),