@lunora/container 1.0.0-alpha.42 → 1.0.0-alpha.44
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 +2 -2
- package/dist/do/index.d.mts +57 -5
- package/dist/do/index.d.ts +57 -5
- package/dist/do/index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/packem_shared/{jurisdiction.d-KcQu2ZT_.d.mts → jurisdiction.d-rC2ejtvT.d.mts} +4 -2
- package/dist/packem_shared/{jurisdiction.d-KcQu2ZT_.d.ts → jurisdiction.d-rC2ejtvT.d.ts} +4 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -172,12 +172,12 @@ export const api = defineContainer({
|
|
|
172
172
|
|
|
173
173
|
### Hard timeout
|
|
174
174
|
|
|
175
|
-
`sleepAfter` caps _idle_ time; `hardTimeout` caps _total_ lifetime — a runaway-cost backstop measured from start, regardless of activity (same grammar as `sleepAfter`). When it elapses the generated class's `onHardTimeoutExpired` hook runs (default: `stop()`); the timer is run-generation-stamped so a stale timer from a slept/crashed run can't kill a fresh one.
|
|
175
|
+
`sleepAfter` caps _idle_ time; `hardTimeout` caps _total_ lifetime — a runaway-cost backstop measured from start, regardless of activity (same grammar as `sleepAfter`). When it elapses the generated class's `onHardTimeoutExpired` hook runs (default: `stop()`, i.e. SIGTERM with no escalation — a container that ignores SIGTERM outlives its cap unless you override the hook and follow up with `destroy()`); the timer is run-generation-stamped so a stale timer from a slept/crashed run can't kill a fresh one.
|
|
176
176
|
|
|
177
177
|
```ts
|
|
178
178
|
export const job = defineContainer({
|
|
179
179
|
image: "./containers/job",
|
|
180
|
-
hardTimeout: "1h", //
|
|
180
|
+
hardTimeout: "1h", // stopped after an hour, busy or not
|
|
181
181
|
});
|
|
182
182
|
```
|
|
183
183
|
|
package/dist/do/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ContainerDefinition, D as DurableObjectJurisdiction } from "../packem_shared/jurisdiction.d-
|
|
1
|
+
import { C as ContainerDefinition, D as DurableObjectJurisdiction } from "../packem_shared/jurisdiction.d-rC2ejtvT.mjs";
|
|
2
2
|
import { DurableObject, WorkerEntrypoint } from 'cloudflare:workers';
|
|
3
3
|
/**
|
|
4
4
|
* ContainerStartOptions as they come from worker types
|
|
@@ -522,16 +522,26 @@ declare class LunoraContainer<Env = unknown> extends Container<Env> {
|
|
|
522
522
|
private readonly lunoraSecretsStore?;
|
|
523
523
|
/** Memoised Secrets Store resolution: run once, then merged into `envVars` before the first start. */
|
|
524
524
|
private lunoraSecretsStoreResolved?;
|
|
525
|
+
/**
|
|
526
|
+
* Count of runs observed to have ENDED, bumped by the `onStop` hook. Read
|
|
527
|
+
* across a start: a bump means the run that start snapshotted is over,
|
|
528
|
+
* whatever the `running` flag said at snapshot time. See `beginStart`.
|
|
529
|
+
*/
|
|
530
|
+
private lunoraStops;
|
|
525
531
|
constructor(context: DurableObjectContext, env: Env, definition: ContainerDefinition, exportName?: string, jurisdiction?: DurableObjectJurisdiction);
|
|
526
532
|
/**
|
|
527
|
-
* Proxy entry for every `ctx.containers.<name>` fetch.
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
*
|
|
533
|
+
* Proxy entry for every `ctx.containers.<name>` fetch. The base starts the
|
|
534
|
+
* container for this request through {@link startAndWaitForPorts}, which is
|
|
535
|
+
* where the `secretsStore` resolution lives — a request that finds the
|
|
536
|
+
* container already healthy needs no resolution at all.
|
|
531
537
|
*/
|
|
532
538
|
override containerFetch(...args: Parameters<Container<Env>["containerFetch"]>): Promise<Response>;
|
|
533
539
|
/**
|
|
534
540
|
* The start path `containerFetch` takes (and the one an app can call itself).
|
|
541
|
+
* Resolves the `secretsStore` bindings into `envVars` first — `doStartContainer`
|
|
542
|
+
* reads `this.envVars`, so a container started this way would otherwise boot
|
|
543
|
+
* without its Secrets Store values.
|
|
544
|
+
*
|
|
535
545
|
* The base's last act is `blockConcurrencyWhile(… onStart())`, so this
|
|
536
546
|
* override resumes on the far side of that gate — which is where
|
|
537
547
|
* {@link afterContainerStart} has to run. See its docblock.
|
|
@@ -557,6 +567,14 @@ declare class LunoraContainer<Env = unknown> extends Container<Env> {
|
|
|
557
567
|
* {@link onStart}). Default: stop the instance. Override to drain/checkpoint
|
|
558
568
|
* first. A stale schedule from a previous run, or an already-stopped
|
|
559
569
|
* instance, is ignored (upstream cloudflare/containers#85).
|
|
570
|
+
*
|
|
571
|
+
* `stop()` sends SIGTERM and returns; nothing escalates to `destroy()`. The
|
|
572
|
+
* cap is therefore a signal, not a bound — a container that traps or ignores
|
|
573
|
+
* SIGTERM keeps running, and the schedule is ONE-SHOT (the base deletes the
|
|
574
|
+
* row once it fires), so nothing signals it a second time either: an ignored
|
|
575
|
+
* SIGTERM means the cap is spent, not retried. Override this hook and follow
|
|
576
|
+
* the stop with a `destroy()` after a grace period if your workload needs a
|
|
577
|
+
* real ceiling.
|
|
560
578
|
*/
|
|
561
579
|
onHardTimeoutExpired(payload?: {
|
|
562
580
|
generation?: number;
|
|
@@ -588,6 +606,40 @@ declare class LunoraContainer<Env = unknown> extends Container<Env> {
|
|
|
588
606
|
* the in-gate placement got this for free from `blockConcurrencyWhile`.
|
|
589
607
|
*/
|
|
590
608
|
private afterContainerStart;
|
|
609
|
+
/**
|
|
610
|
+
* Decide — synchronously, before anything is started — whether this start
|
|
611
|
+
* begins a NEW container run, and drop the previous run's readiness gate when
|
|
612
|
+
* it does. Returns whether the container was already running.
|
|
613
|
+
*
|
|
614
|
+
* The gate has to be keyed on the run, and `onStop` alone cannot key it:
|
|
615
|
+
* `@cloudflare/containers` reaches `onStop` only through
|
|
616
|
+
* `syncPendingStoppedEvents`, which `start()` never calls (only
|
|
617
|
+
* `startAndWaitForPorts`, `stop()` and the alarm loop do), while the monitor
|
|
618
|
+
* callback that observes a container exit merely records the state. So a
|
|
619
|
+
* `start()` in the up-to-three-minute window before the next alarm found the
|
|
620
|
+
* finished run's settled gate and skipped BOTH `armHardTimeout` and the
|
|
621
|
+
* `readyOn` probes — run 2 ran uncapped and was proxied to before it reported
|
|
622
|
+
* ready. A `hardTimeout` firing its own SIGTERM lands in exactly that window.
|
|
623
|
+
*
|
|
624
|
+
* The mirror case is why the answer is not "always re-arm": a start that finds
|
|
625
|
+
* the container already up begins no run, and re-arming there moves the cap
|
|
626
|
+
* (see {@link afterContainerStart}).
|
|
627
|
+
*
|
|
628
|
+
* Read with no `await` between it and `super`, so two concurrent starts of a
|
|
629
|
+
* stopped container both observe `false` and the second joins the first's
|
|
630
|
+
* gate instead of arming a second schedule — and so the flag is as fresh as
|
|
631
|
+
* it can be. It is a snapshot either way, and the run can end after it: the
|
|
632
|
+
* base's own pre-start work (`getPortsToCheck`, `syncPendingStoppedEvents`)
|
|
633
|
+
* still runs on the far side of it, and a start that came in on a live
|
|
634
|
+
* container would then arm nothing for the run the base goes on to start.
|
|
635
|
+
* Hence the second half of the answer, in the callers: an `onStop` observed
|
|
636
|
+
* ACROSS the base call ({@link lunoraStops}) demotes the snapshot, because
|
|
637
|
+
* the run it described is over. What that does not cover is an exit inside
|
|
638
|
+
* `start()`'s own base call — that path never syncs pending stop events, so
|
|
639
|
+
* nothing reports the exit until the next alarm or `startAndWaitForPorts`,
|
|
640
|
+
* and the cap for such a run is armed only when one of those arrives.
|
|
641
|
+
*/
|
|
642
|
+
private beginStart;
|
|
591
643
|
/**
|
|
592
644
|
* Block until the `readyOn` probes for the current start have passed.
|
|
593
645
|
*
|
package/dist/do/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ContainerDefinition, D as DurableObjectJurisdiction } from "../packem_shared/jurisdiction.d-
|
|
1
|
+
import { C as ContainerDefinition, D as DurableObjectJurisdiction } from "../packem_shared/jurisdiction.d-rC2ejtvT.js";
|
|
2
2
|
import { DurableObject, WorkerEntrypoint } from 'cloudflare:workers';
|
|
3
3
|
/**
|
|
4
4
|
* ContainerStartOptions as they come from worker types
|
|
@@ -522,16 +522,26 @@ declare class LunoraContainer<Env = unknown> extends Container<Env> {
|
|
|
522
522
|
private readonly lunoraSecretsStore?;
|
|
523
523
|
/** Memoised Secrets Store resolution: run once, then merged into `envVars` before the first start. */
|
|
524
524
|
private lunoraSecretsStoreResolved?;
|
|
525
|
+
/**
|
|
526
|
+
* Count of runs observed to have ENDED, bumped by the `onStop` hook. Read
|
|
527
|
+
* across a start: a bump means the run that start snapshotted is over,
|
|
528
|
+
* whatever the `running` flag said at snapshot time. See `beginStart`.
|
|
529
|
+
*/
|
|
530
|
+
private lunoraStops;
|
|
525
531
|
constructor(context: DurableObjectContext, env: Env, definition: ContainerDefinition, exportName?: string, jurisdiction?: DurableObjectJurisdiction);
|
|
526
532
|
/**
|
|
527
|
-
* Proxy entry for every `ctx.containers.<name>` fetch.
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
*
|
|
533
|
+
* Proxy entry for every `ctx.containers.<name>` fetch. The base starts the
|
|
534
|
+
* container for this request through {@link startAndWaitForPorts}, which is
|
|
535
|
+
* where the `secretsStore` resolution lives — a request that finds the
|
|
536
|
+
* container already healthy needs no resolution at all.
|
|
531
537
|
*/
|
|
532
538
|
override containerFetch(...args: Parameters<Container<Env>["containerFetch"]>): Promise<Response>;
|
|
533
539
|
/**
|
|
534
540
|
* The start path `containerFetch` takes (and the one an app can call itself).
|
|
541
|
+
* Resolves the `secretsStore` bindings into `envVars` first — `doStartContainer`
|
|
542
|
+
* reads `this.envVars`, so a container started this way would otherwise boot
|
|
543
|
+
* without its Secrets Store values.
|
|
544
|
+
*
|
|
535
545
|
* The base's last act is `blockConcurrencyWhile(… onStart())`, so this
|
|
536
546
|
* override resumes on the far side of that gate — which is where
|
|
537
547
|
* {@link afterContainerStart} has to run. See its docblock.
|
|
@@ -557,6 +567,14 @@ declare class LunoraContainer<Env = unknown> extends Container<Env> {
|
|
|
557
567
|
* {@link onStart}). Default: stop the instance. Override to drain/checkpoint
|
|
558
568
|
* first. A stale schedule from a previous run, or an already-stopped
|
|
559
569
|
* instance, is ignored (upstream cloudflare/containers#85).
|
|
570
|
+
*
|
|
571
|
+
* `stop()` sends SIGTERM and returns; nothing escalates to `destroy()`. The
|
|
572
|
+
* cap is therefore a signal, not a bound — a container that traps or ignores
|
|
573
|
+
* SIGTERM keeps running, and the schedule is ONE-SHOT (the base deletes the
|
|
574
|
+
* row once it fires), so nothing signals it a second time either: an ignored
|
|
575
|
+
* SIGTERM means the cap is spent, not retried. Override this hook and follow
|
|
576
|
+
* the stop with a `destroy()` after a grace period if your workload needs a
|
|
577
|
+
* real ceiling.
|
|
560
578
|
*/
|
|
561
579
|
onHardTimeoutExpired(payload?: {
|
|
562
580
|
generation?: number;
|
|
@@ -588,6 +606,40 @@ declare class LunoraContainer<Env = unknown> extends Container<Env> {
|
|
|
588
606
|
* the in-gate placement got this for free from `blockConcurrencyWhile`.
|
|
589
607
|
*/
|
|
590
608
|
private afterContainerStart;
|
|
609
|
+
/**
|
|
610
|
+
* Decide — synchronously, before anything is started — whether this start
|
|
611
|
+
* begins a NEW container run, and drop the previous run's readiness gate when
|
|
612
|
+
* it does. Returns whether the container was already running.
|
|
613
|
+
*
|
|
614
|
+
* The gate has to be keyed on the run, and `onStop` alone cannot key it:
|
|
615
|
+
* `@cloudflare/containers` reaches `onStop` only through
|
|
616
|
+
* `syncPendingStoppedEvents`, which `start()` never calls (only
|
|
617
|
+
* `startAndWaitForPorts`, `stop()` and the alarm loop do), while the monitor
|
|
618
|
+
* callback that observes a container exit merely records the state. So a
|
|
619
|
+
* `start()` in the up-to-three-minute window before the next alarm found the
|
|
620
|
+
* finished run's settled gate and skipped BOTH `armHardTimeout` and the
|
|
621
|
+
* `readyOn` probes — run 2 ran uncapped and was proxied to before it reported
|
|
622
|
+
* ready. A `hardTimeout` firing its own SIGTERM lands in exactly that window.
|
|
623
|
+
*
|
|
624
|
+
* The mirror case is why the answer is not "always re-arm": a start that finds
|
|
625
|
+
* the container already up begins no run, and re-arming there moves the cap
|
|
626
|
+
* (see {@link afterContainerStart}).
|
|
627
|
+
*
|
|
628
|
+
* Read with no `await` between it and `super`, so two concurrent starts of a
|
|
629
|
+
* stopped container both observe `false` and the second joins the first's
|
|
630
|
+
* gate instead of arming a second schedule — and so the flag is as fresh as
|
|
631
|
+
* it can be. It is a snapshot either way, and the run can end after it: the
|
|
632
|
+
* base's own pre-start work (`getPortsToCheck`, `syncPendingStoppedEvents`)
|
|
633
|
+
* still runs on the far side of it, and a start that came in on a live
|
|
634
|
+
* container would then arm nothing for the run the base goes on to start.
|
|
635
|
+
* Hence the second half of the answer, in the callers: an `onStop` observed
|
|
636
|
+
* ACROSS the base call ({@link lunoraStops}) demotes the snapshot, because
|
|
637
|
+
* the run it described is over. What that does not cover is an exit inside
|
|
638
|
+
* `start()`'s own base call — that path never syncs pending stop events, so
|
|
639
|
+
* nothing reports the exit until the next alarm or `startAndWaitForPorts`,
|
|
640
|
+
* and the cap for such a run is armed only when one of those arrives.
|
|
641
|
+
*/
|
|
642
|
+
private beginStart;
|
|
591
643
|
/**
|
|
592
644
|
* Block until the `readyOn` probes for the current start have passed.
|
|
593
645
|
*
|
package/dist/do/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LunoraError as u}from"@lunora/errors";import{a as
|
|
1
|
+
import{LunoraError as u}from"@lunora/errors";import{a as f}from"../packem_shared/abort-deadline-jwbW9Ala.mjs";import{resolveContainerEnvVars as g,parseDurationSeconds as m}from"../packem_shared/containerBindingName-C7SonAIK.mjs";import{a as y}from"../packem_shared/jurisdiction-DtE9s70w.mjs";import{Container as R}from"../packem_shared/ContainerProxy-fTW_pXWY.mjs";import{ContainerProxy as D,outboundParams as M}from"../packem_shared/ContainerProxy-fTW_pXWY.mjs";const E="lunora",N=(o,t,n,e)=>({container:o,event:n,instance:t,level:n==="error"?"error":"info",message:e,source:E,ts:Date.now(),type:"container"}),i=(o,t,n,e)=>{const r=N(o,t,n,e),s=JSON.stringify(r);return n==="error"?console.error(s):console.log(s),r},T="__lunora_admin__:recordContainerEvent",S="__root__",_=o=>{if(o===null||typeof o!="object")return!1;const t=o;return typeof t.get=="function"&&typeof t.idFromName=="function"},O=(o,t)=>{const n=y(o,t);return typeof n.getByName=="function"?n.getByName(S):n.get(n.idFromName(S))},I=async(o,t,n)=>{try{const e=o??{},r=e.SHARD;if(!_(r))return;const s=typeof e.LUNORA_ADMIN_TOKEN=="string"?e.LUNORA_ADMIN_TOKEN:void 0;if(!s||s.length===0)return;const a=new Request("https://shard.internal/rpc",{body:JSON.stringify({args:{event:t},functionPath:T}),headers:{authorization:`Bearer ${s}`,"content-type":"application/json"},method:"POST"});await O(r,n).fetch(a)}catch{}},v=500,w=3e4,h="__lunoraHardTimeoutGeneration";class L extends R{lunoraJurisdiction;lunoraName;lunoraDefaultPort;lunoraHardTimeoutSeconds;lunoraReadiness;lunoraReadyOn;lunoraSecretsStore;lunoraSecretsStoreResolved;lunoraStops=0;constructor(t,n,e,r,s){super(t,n,{defaultPort:e.defaultPort,entrypoint:e.entrypoint?[...e.entrypoint]:void 0,envVars:g(e,n,r),sleepAfter:e.sleepAfter}),e.enableInternet!==void 0&&(this.enableInternet=e.enableInternet),e.requiredPorts!==void 0&&(this.requiredPorts=[...e.requiredPorts]),e.interceptHttps!==void 0&&(this.interceptHttps=e.interceptHttps),e.allowedHosts!==void 0&&(this.allowedHosts=[...e.allowedHosts]),e.deniedHosts!==void 0&&(this.deniedHosts=[...e.deniedHosts]),e.pingEndpoint!==void 0&&(this.pingEndpoint=e.pingEndpoint),e.labels!==void 0&&(this.labels={...e.labels}),this.lunoraName=r??"container",this.lunoraJurisdiction=s,this.lunoraDefaultPort=e.defaultPort,this.lunoraReadyOn=e.readyOn?[...e.readyOn]:[],this.lunoraHardTimeoutSeconds=e.hardTimeout===void 0?void 0:m(e.hardTimeout),this.lunoraSecretsStore=e.secretsStore}async containerFetch(...t){return await this.awaitReadinessGate(),super.containerFetch(...t)}async startAndWaitForPorts(...t){await this.resolveSecretsStoreEnv();const n=this.lunoraStops,e=this.beginStart();await super.startAndWaitForPorts(...t),await this.afterContainerStart(e&&this.lunoraStops===n)}async start(...t){const[n]=t;n?.envVars===void 0&&await this.resolveSecretsStoreEnv();const e=this.lunoraStops,r=this.beginStart();await super.start(...t),await this.afterContainerStart(r&&this.lunoraStops===e)}async onActivityExpired(){const t=i(this.lunoraName,this.instanceId(),"sleep");this.surfaceInStudioLogs(t),await super.onActivityExpired()}onError(t){const n=i(this.lunoraName,this.instanceId(),"error",t instanceof Error?t.message:String(t));return this.surfaceInStudioLogs(n),super.onError(t)}async onStart(){const t=i(this.lunoraName,this.instanceId(),"start");this.surfaceInStudioLogs(t),await super.onStart()}async onHardTimeoutExpired(t){const n=await this.ctx.storage.get(h);if(t?.generation!==void 0&&t.generation!==n||this.ctx.container?.running!==!0)return;const e=i(this.lunoraName,this.instanceId(),"stop","hard timeout reached");this.surfaceInStudioLogs(e),await this.stop()}async onStop(t){const n=i(this.lunoraName,this.instanceId(),"stop",`${t.reason} (exit ${String(t.exitCode)})`);this.surfaceInStudioLogs(n),this.lunoraReadiness=void 0,this.lunoraStops+=1,await super.onStop(t)}async afterContainerStart(t){const n=this.lunoraReadiness;if(n!==void 0){await n;return}const e=(async()=>{t||await this.armHardTimeout(),await this.awaitContainerReadiness()})();this.lunoraReadiness=e;try{await e}catch(r){throw this.lunoraReadiness===e&&(this.lunoraReadiness=void 0),r}}beginStart(){const t=this.ctx.container?.running===!0;return t||(this.lunoraReadiness=void 0),t}async awaitReadinessGate(){if(this.lunoraReadyOn.length===0)return;if(this.lunoraReadiness===void 0){const{status:n}=await this.getState();if(n!=="healthy")return;this.lunoraReadiness=this.awaitContainerReadiness()}const t=this.lunoraReadiness;try{await t}catch(n){throw this.lunoraReadiness===t&&(this.lunoraReadiness=void 0),n}}async armHardTimeout(){if(this.lunoraHardTimeoutSeconds===void 0)return;const t=(await this.ctx.storage.get(h)??0)+1;await this.ctx.storage.put(h,t),await this.schedule(this.lunoraHardTimeoutSeconds,"onHardTimeoutExpired",{generation:t})}async resolveSecretsStoreEnv(){const t=this.lunoraSecretsStore;t!==void 0&&(this.lunoraSecretsStoreResolved??=(async()=>{const n=this.env,e={};for(const[r,s]of Object.entries(t)){const a=n[s];if(a===void 0||typeof a.get!="function")throw new u("INTERNAL",`container "${this.lunoraName}": secretsStore env "${r}" points at binding "${s}", which is not a Secrets Store binding on the Worker env. Add a \`secrets_store_secrets\` entry binding "${s}".`);const c=await a.get();if(typeof c!="string")throw new TypeError(`container "${this.lunoraName}": Secrets Store binding "${s}" (env "${r}") did not resolve to a string value.`);e[r]=c}this.envVars={...this.envVars,...e}})().catch(n=>{throw this.lunoraSecretsStoreResolved=void 0,n}),await this.lunoraSecretsStoreResolved)}async awaitContainerReadiness(){if(this.lunoraReadyOn.length===0)return;const{container:t}=this.ctx;if(t===void 0)return;const n=Date.now()+w;await Promise.all(this.lunoraReadyOn.map(async e=>this.awaitReadinessCheck(t,e,n)))}async awaitReadinessCheck(t,n,e){const r=n.port??this.lunoraDefaultPort;if(r===void 0)throw new u("INTERNAL",`container "${this.lunoraName}": readyOn check "${n.path}" has no port — set the check's \`port\` or the container \`defaultPort\`.`);const s=n.status??200,a=n.path.startsWith("/")?n.path:`/${n.path}`,c=t.getTcpPort(r);for(;;){const d=Math.max(v,e-Date.now()),l=f(void 0,d,()=>new DOMException(`readiness probe timed out after ${String(d)}ms`,"TimeoutError"));try{if((await c.fetch(`http://container${a}`,{signal:l.signal})).status===s)return}catch{}finally{l.dispose()}if(Date.now()>=e)throw new u("INTERNAL",`container "${this.lunoraName}": readiness check "${n.path}" (port ${String(r)}) did not return ${String(s)} within ${String(w)}ms`);await new Promise(p=>{setTimeout(p,v)})}}surfaceInStudioLogs(t){I(this.env,t,this.lunoraJurisdiction).catch(()=>{})}instanceId(){try{const{id:t}=this.ctx;return typeof t?.toString=="function"?t.toString():"unknown"}catch{return"unknown"}}}export{D as ContainerProxy,L as LunoraContainer,M as outboundParams};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DurableObjectJurisdiction, a as ContainerConfig, C as ContainerDefinition, b as ContainerImageSource, N as NormalizedContainerImage } from "./packem_shared/jurisdiction.d-
|
|
2
|
-
export type { B as BuildImageSource, c as ContainerInstanceType, d as ContainerReadinessCheck, e as ContainerRollout, f as CustomContainerInstanceType, g as NamedContainerInstanceType, R as RegistryImageSource } from "./packem_shared/jurisdiction.d-
|
|
1
|
+
import { D as DurableObjectJurisdiction, a as ContainerConfig, C as ContainerDefinition, b as ContainerImageSource, N as NormalizedContainerImage } from "./packem_shared/jurisdiction.d-rC2ejtvT.mjs";
|
|
2
|
+
export type { B as BuildImageSource, c as ContainerInstanceType, d as ContainerReadinessCheck, e as ContainerRollout, f as CustomContainerInstanceType, g as NamedContainerInstanceType, R as RegistryImageSource } from "./packem_shared/jurisdiction.d-rC2ejtvT.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Per-call options for `ContainerHandle.exec`.
|
|
5
5
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DurableObjectJurisdiction, a as ContainerConfig, C as ContainerDefinition, b as ContainerImageSource, N as NormalizedContainerImage } from "./packem_shared/jurisdiction.d-
|
|
2
|
-
export type { B as BuildImageSource, c as ContainerInstanceType, d as ContainerReadinessCheck, e as ContainerRollout, f as CustomContainerInstanceType, g as NamedContainerInstanceType, R as RegistryImageSource } from "./packem_shared/jurisdiction.d-
|
|
1
|
+
import { D as DurableObjectJurisdiction, a as ContainerConfig, C as ContainerDefinition, b as ContainerImageSource, N as NormalizedContainerImage } from "./packem_shared/jurisdiction.d-rC2ejtvT.js";
|
|
2
|
+
export type { B as BuildImageSource, c as ContainerInstanceType, d as ContainerReadinessCheck, e as ContainerRollout, f as CustomContainerInstanceType, g as NamedContainerInstanceType, R as RegistryImageSource } from "./packem_shared/jurisdiction.d-rC2ejtvT.js";
|
|
3
3
|
/**
|
|
4
4
|
* Per-call options for `ContainerHandle.exec`.
|
|
5
5
|
*/
|
|
@@ -138,8 +138,10 @@ interface ContainerConfig {
|
|
|
138
138
|
* of activity — a runaway-cost backstop on top of the idle
|
|
139
139
|
* {@link ContainerConfig.sleepAfter}. Same grammar as `sleepAfter`
|
|
140
140
|
* (`"30s"`, `"5m"`, `"1h"`, or a plain number of seconds). When it elapses,
|
|
141
|
-
* the `LunoraContainer.onHardTimeoutExpired` hook runs (default: `stop()
|
|
142
|
-
*
|
|
141
|
+
* the `LunoraContainer.onHardTimeoutExpired` hook runs (default: `stop()`,
|
|
142
|
+
* which sends SIGTERM and does not escalate — a container that ignores the
|
|
143
|
+
* signal outlives its cap unless the hook is overridden to follow up with
|
|
144
|
+
* `destroy()`). (Upstream cloudflare/containers#85.)
|
|
143
145
|
*/
|
|
144
146
|
hardTimeout?: number | string;
|
|
145
147
|
/** Image source — a local Dockerfile path/directory or a registry reference. */
|
|
@@ -138,8 +138,10 @@ interface ContainerConfig {
|
|
|
138
138
|
* of activity — a runaway-cost backstop on top of the idle
|
|
139
139
|
* {@link ContainerConfig.sleepAfter}. Same grammar as `sleepAfter`
|
|
140
140
|
* (`"30s"`, `"5m"`, `"1h"`, or a plain number of seconds). When it elapses,
|
|
141
|
-
* the `LunoraContainer.onHardTimeoutExpired` hook runs (default: `stop()
|
|
142
|
-
*
|
|
141
|
+
* the `LunoraContainer.onHardTimeoutExpired` hook runs (default: `stop()`,
|
|
142
|
+
* which sends SIGTERM and does not escalate — a container that ignores the
|
|
143
|
+
* signal outlives its cap unless the hook is overridden to follow up with
|
|
144
|
+
* `destroy()`). (Upstream cloudflare/containers#85.)
|
|
143
145
|
*/
|
|
144
146
|
hardTimeout?: number | string;
|
|
145
147
|
/** Image source — a local Dockerfile path/directory or a registry reference. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/container",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.44",
|
|
4
4
|
"description": "Cloudflare Containers for Lunora: defineContainer, generated Container DO classes, and the ctx.containers action surface",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
59
|
+
"@lunora/errors": "1.0.0-alpha.31"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": "^22.15.0 || >=24.11.0"
|