@tangle-network/agent-provider-tangle 3.6.7 → 3.6.9
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/README.md +1 -1
- package/dist/tangle-provider.js +8 -4
- package/dist/tangle-types.d.ts +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -245,7 +245,7 @@ So `create()` can return a sandbox that reports `running` while the platform sti
|
|
|
245
245
|
|
|
246
246
|
Composing an environment also reads the sandbox's deployment capability document once, and a sandbox that is not yet running cannot answer that read, so an environment composed during provisioning would claim nothing for the rest of its life.
|
|
247
247
|
|
|
248
|
-
`readyTimeoutMs` bounds the wait
|
|
248
|
+
`readyTimeoutMs` is passed to the HTTP `Sandbox.create` request, including a cold image pull, and also bounds the subsequent wait for `running`. It defaults to `DEFAULT_TANGLE_READY_TIMEOUT_MS` (120 seconds). A client whose `create` method ignores request options keeps its own create timeout; the provider still uses `readyTimeoutMs` for its later wait.
|
|
249
249
|
|
|
250
250
|
```ts
|
|
251
251
|
const provider = createTangleProvider({
|
package/dist/tangle-provider.js
CHANGED
|
@@ -168,7 +168,7 @@ export function createTangleProvider(options) {
|
|
|
168
168
|
throw new Error("Tangle native capture selected backend differs from the exact profile harness");
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
const createPromise = options.client.create(createOptions, input.signal ? { signal: input.signal } :
|
|
171
|
+
const createPromise = options.client.create(createOptions, { timeoutMs: readyTimeoutMs, ...(input.signal ? { signal: input.signal } : {}) });
|
|
172
172
|
let box;
|
|
173
173
|
try {
|
|
174
174
|
box = await awaitWithSignal(createPromise, input.signal);
|
|
@@ -416,7 +416,7 @@ export function createTangleProvider(options) {
|
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
418
|
/**
|
|
419
|
-
*
|
|
419
|
+
* Wait for a usable sandbox before a reconnect reads its container.
|
|
420
420
|
*
|
|
421
421
|
* The platform suspends a sandbox after its idle timeout (30 minutes by
|
|
422
422
|
* default) and nothing resumes it on access. A root turn stalled on an
|
|
@@ -425,10 +425,14 @@ export function createTangleProvider(options) {
|
|
|
425
425
|
* the driver exhausts its attempts. After the resume the sidecar reports the
|
|
426
426
|
* interrupted execution as a terminal failure, so the caller settles that
|
|
427
427
|
* execution and replaces it once instead of dispatching beside it.
|
|
428
|
+
* A box can also report running while its replacement filesystem incarnation
|
|
429
|
+
* is still becoming ready. The same SDK wait closes that gap before backend
|
|
430
|
+
* status is read.
|
|
428
431
|
*/
|
|
429
432
|
async function resumeForReconnect(box, client, timeoutMs, signal) {
|
|
430
|
-
|
|
431
|
-
|
|
433
|
+
// A running lifecycle status can precede the filesystem incarnation and
|
|
434
|
+
// selected backend becoming readable after a container restart. The SDK's
|
|
435
|
+
// waitFor("running") also waits for that incarnation to be ready.
|
|
432
436
|
if (box.status === "stopped") {
|
|
433
437
|
if (!box.resume) {
|
|
434
438
|
throw new Error(`Tangle sandbox ${box.id} is stopped and the linked client cannot resume it`);
|
package/dist/tangle-types.d.ts
CHANGED
|
@@ -815,9 +815,10 @@ export interface TangleProviderOptions {
|
|
|
815
815
|
mapCreateInput?: (input: CreateAgentEnvironmentInput) => CreateSandboxOptions;
|
|
816
816
|
exactProcess?: TangleExactProcessOptions;
|
|
817
817
|
/**
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
818
|
+
* Passed to the HTTP Sandbox creation request and the subsequent wait for
|
|
819
|
+
* `running`. A client that ignores create request options keeps its own
|
|
820
|
+
* create timeout. Defaults to `DEFAULT_TANGLE_READY_TIMEOUT_MS`, exported
|
|
821
|
+
* from this package (120 seconds).
|
|
821
822
|
*/
|
|
822
823
|
readyTimeoutMs?: number;
|
|
823
824
|
/** External provider-key and measurement verifier for confidential forks. */
|