threadnote 0.7.0 → 0.7.1

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.
@@ -34382,7 +34382,11 @@ async function writeOvFileWithRetry(config2, ov, uri, fromFile, initialMode, opt
34382
34382
  if (!isTransientOvFailure(result.stderr, result.stdout) || attempt === maxAttempts - 1) {
34383
34383
  throw new Error(`${formatShellCommand(ov, args)} failed: ${result.stderr || result.stdout}`);
34384
34384
  }
34385
- await sleep(1e3 * (attempt + 1));
34385
+ if (isResourceBusyFailure(result.stderr, result.stdout)) {
34386
+ await waitForOvQueue(ov, config2, options);
34387
+ } else {
34388
+ await sleep(1e3 * (attempt + 1));
34389
+ }
34386
34390
  }
34387
34391
  }
34388
34392
  async function waitForOvQueue(ov, config2, options = {}) {
@@ -34399,6 +34403,11 @@ function isTransientOvFailure(stderr, stdout) {
34399
34403
  ${stdout}`.toLowerCase();
34400
34404
  return output.includes("resource is busy") || output.includes("resource is being processed") || output.includes("network error") || output.includes("error sending request") || output.includes("http request failed") || output.includes("connection refused") || output.includes("connection reset") || output.includes("timed out");
34401
34405
  }
34406
+ function isResourceBusyFailure(stderr, stdout) {
34407
+ const output = `${stderr}
34408
+ ${stdout}`.toLowerCase();
34409
+ return output.includes("resource is busy") || output.includes("resource is being processed");
34410
+ }
34402
34411
  async function ingestSingleFile(ov, config2, uri, filePath, initialMode, options = {}) {
34403
34412
  const content = await (0, import_promises3.readFile)(filePath, "utf8");
34404
34413
  await writeMemoryFile(config2, ov, uri, content, initialMode, false, options);
@@ -34464,7 +34473,11 @@ async function removeMemoryUri(config2, ov, uri, dryRun, options = {}) {
34464
34473
  if (!isTransientOvFailure(result.stderr, result.stdout) || attempt === maxAttempts - 1) {
34465
34474
  throw new Error(`${formatShellCommand(ov, args)} failed: ${result.stderr || result.stdout}`);
34466
34475
  }
34467
- await sleep(1e3 * (attempt + 1));
34476
+ if (isResourceBusyFailure(result.stderr, result.stdout)) {
34477
+ await waitForOvQueue(ov, config2, options);
34478
+ } else {
34479
+ await sleep(1e3 * (attempt + 1));
34480
+ }
34468
34481
  }
34469
34482
  }
34470
34483
  async function vikingResourceExists(ov, config2, uri) {
@@ -8117,7 +8117,11 @@ async function writeOvFileWithRetry(config, ov, uri, fromFile, initialMode, opti
8117
8117
  if (!isTransientOvFailure(result.stderr, result.stdout) || attempt === maxAttempts - 1) {
8118
8118
  throw new Error(`${formatShellCommand(ov, args)} failed: ${result.stderr || result.stdout}`);
8119
8119
  }
8120
- await sleep(1e3 * (attempt + 1));
8120
+ if (isResourceBusyFailure(result.stderr, result.stdout)) {
8121
+ await waitForOvQueue(ov, config, options);
8122
+ } else {
8123
+ await sleep(1e3 * (attempt + 1));
8124
+ }
8121
8125
  }
8122
8126
  }
8123
8127
  async function waitForOvQueue(ov, config, options = {}) {
@@ -8134,6 +8138,11 @@ function isTransientOvFailure(stderr, stdout) {
8134
8138
  ${stdout}`.toLowerCase();
8135
8139
  return output2.includes("resource is busy") || output2.includes("resource is being processed") || output2.includes("network error") || output2.includes("error sending request") || output2.includes("http request failed") || output2.includes("connection refused") || output2.includes("connection reset") || output2.includes("timed out");
8136
8140
  }
8141
+ function isResourceBusyFailure(stderr, stdout) {
8142
+ const output2 = `${stderr}
8143
+ ${stdout}`.toLowerCase();
8144
+ return output2.includes("resource is busy") || output2.includes("resource is being processed");
8145
+ }
8137
8146
  async function ingestSingleFile(ov, config, uri, filePath, initialMode, options = {}) {
8138
8147
  const content = await (0, import_promises4.readFile)(filePath, "utf8");
8139
8148
  await writeMemoryFile(config, ov, uri, content, initialMode, false, options);
@@ -8199,7 +8208,11 @@ async function removeMemoryUri(config, ov, uri, dryRun, options = {}) {
8199
8208
  if (!isTransientOvFailure(result.stderr, result.stdout) || attempt === maxAttempts - 1) {
8200
8209
  throw new Error(`${formatShellCommand(ov, args)} failed: ${result.stderr || result.stdout}`);
8201
8210
  }
8202
- await sleep(1e3 * (attempt + 1));
8211
+ if (isResourceBusyFailure(result.stderr, result.stdout)) {
8212
+ await waitForOvQueue(ov, config, options);
8213
+ } else {
8214
+ await sleep(1e3 * (attempt + 1));
8215
+ }
8203
8216
  }
8204
8217
  }
8205
8218
  async function vikingResourceExists(ov, config, uri) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threadnote",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "commonjs",
5
5
  "main": "dist/threadnote.cjs",
6
6
  "description": "Shared local context and handoffs for development agents",