@econ-v1/app-sdk 7.0.18 → 7.0.20
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -108,6 +108,10 @@ export interface CapabilityRequest {
|
|
|
108
108
|
trace_context?: Record<string, string>;
|
|
109
109
|
/** Opaque host-issued correlator copied only across nested capability calls. */
|
|
110
110
|
invocation_context_id?: string;
|
|
111
|
+
/** Lease duration in seconds for the app's lifetime, as granted by the
|
|
112
|
+
* host's lease engine. Absent/`undefined` means an unbounded lease
|
|
113
|
+
* (T=∞ — today's behavior). Purely additive wire field. */
|
|
114
|
+
lease_secs?: number;
|
|
111
115
|
}
|
|
112
116
|
export interface CapabilityResponse {
|
|
113
117
|
id: string;
|
|
@@ -148,6 +152,16 @@ export declare const host: {
|
|
|
148
152
|
info: (message: string) => void;
|
|
149
153
|
warn: (message: string) => void;
|
|
150
154
|
error: (message: string) => void;
|
|
155
|
+
/**
|
|
156
|
+
* Hold the app's lease open for work that outlives the frame that started
|
|
157
|
+
* it (e.g. a detached background task). Increments the same in-flight
|
|
158
|
+
* counter that brackets `handleCapability`/`handleRequest`/`handleEvent`,
|
|
159
|
+
* which blocks the lease timer from arming while the hold is outstanding.
|
|
160
|
+
*
|
|
161
|
+
* Returns a release closure. Idempotent: calling it more than once has no
|
|
162
|
+
* further effect after the first call.
|
|
163
|
+
*/
|
|
164
|
+
holdLease: () => (() => void);
|
|
151
165
|
};
|
|
152
166
|
/**
|
|
153
167
|
* Invoke a capability on the host via the capability router.
|
|
@@ -167,6 +181,17 @@ export declare function invokeCapability(request: CapabilityRequest, timeoutMs?:
|
|
|
167
181
|
* This is a fire-and-forget operation — no response is returned.
|
|
168
182
|
*/
|
|
169
183
|
export declare function publishEvent(eventName: string, data: unknown): void;
|
|
184
|
+
/** @internal test-only export; not part of the public SDK surface. */
|
|
185
|
+
export declare function _testResetLeaseState(): void;
|
|
186
|
+
/** @internal test-only export; not part of the public SDK surface. */
|
|
187
|
+
export declare function _testSetLeaseExitFn(fn: () => void): void;
|
|
188
|
+
/** @internal test-only export; not part of the public SDK surface. */
|
|
189
|
+
export declare function _testLeaseState(): {
|
|
190
|
+
inFlight: number;
|
|
191
|
+
rememberedSecs: number | undefined;
|
|
192
|
+
timerArmed: boolean;
|
|
193
|
+
draining: boolean;
|
|
194
|
+
};
|
|
170
195
|
export interface AppMemorySample {
|
|
171
196
|
heap_used_kb: number;
|
|
172
197
|
heap_total_kb: number;
|