@sjawhar/claude-envoy 4.6.0 → 4.7.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.
@@ -8,15 +8,14 @@ function codexInboxDirectory(stateDirectory, sessionId) {
8
8
  return join(stateDirectory, "codex-inbox", encodeURIComponent(sessionId));
9
9
  }
10
10
  var lastOrder = 0;
11
- function itemName() {
11
+ function inboxItemName() {
12
12
  const order = Math.max(Date.now(), lastOrder + 1);
13
13
  lastOrder = order;
14
14
  return `${String(order).padStart(15, "0")}-${randomBytes(4).toString("hex")}.json`;
15
15
  }
16
- async function putInbox(directory, item) {
16
+ async function putInbox(directory, item, name = inboxItemName()) {
17
17
  const waiting = join(directory, "waiting");
18
18
  await mkdir(waiting, { recursive: true, mode: 448 });
19
- const name = itemName();
20
19
  const temporary = join(directory, `.${name}.tmp`);
21
20
  await writeFile(temporary, JSON.stringify(item), { mode: 384 });
22
21
  await rename(temporary, join(waiting, name));