@telorun/sdk 0.26.0 → 0.31.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.
package/dist/cancellation.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export interface CancellationToken {
|
|
|
36
36
|
*/
|
|
37
37
|
export interface InvokeContext {
|
|
38
38
|
readonly cancellation: CancellationToken;
|
|
39
|
+
/** Monotonic id minted by the kernel for this invocation — present only while
|
|
40
|
+
* tracing is active (a debug consumer is attached). Lets controllers correlate
|
|
41
|
+
* their work with the debug stream. */
|
|
42
|
+
readonly invocationId?: number;
|
|
43
|
+
/** The {@link invocationId} of the invocation that dispatched this one, or
|
|
44
|
+
* `undefined` at a trace root. Reconstructs the call tree on the consumer. */
|
|
45
|
+
readonly parentInvocationId?: number;
|
|
39
46
|
}
|
|
40
47
|
export interface CancellationSource {
|
|
41
48
|
readonly token: CancellationToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellation.d.ts","sourceRoot":"","sources":["../src/cancellation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC;yDACqD;IACrD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;2CACuC;IACvC,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACxE,kEAAkE;IAClE,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;
|
|
1
|
+
{"version":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EF,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,EAAE,aAAiD,CAAC;AAEtF,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAMzD"}
|
|
@@ -3,7 +3,17 @@ import type { ScopeHandle } from "./ref.js";
|
|
|
3
3
|
import type { ResourceInstance } from "./resource-instance.js";
|
|
4
4
|
import type { ResourceManifest } from "./resource-manifest.js";
|
|
5
5
|
import type { ResourceDefinition } from "./types.js";
|
|
6
|
-
export type EmitEvent = (event: string, payload?: any) => void | Promise<void>;
|
|
6
|
+
export type EmitEvent = (event: string, payload?: any, metadata?: Record<string, any>) => void | Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Per-kernel invocation tracer. Mints monotonic invocation ids and carries the
|
|
9
|
+
* gate that turns tracing on (a debug consumer is attached). Owned by the kernel,
|
|
10
|
+
* injected into the context tree; `enabled === false` is the zero-overhead default.
|
|
11
|
+
*/
|
|
12
|
+
export interface Tracer {
|
|
13
|
+
readonly enabled: boolean;
|
|
14
|
+
/** Mint the next monotonic invocation id (unique within the kernel run). */
|
|
15
|
+
next(): number;
|
|
16
|
+
}
|
|
7
17
|
/** Four-stage resource lifecycle defined in resource-lifecycle.md */
|
|
8
18
|
export type LifecycleState = "Pending" | "Validated" | "Initialized" | "Draining" | "Teardown";
|
|
9
19
|
/**
|
|
@@ -58,6 +68,9 @@ export interface EvaluationContext {
|
|
|
58
68
|
/** Looks up a registered resource definition by fully-qualified kind.
|
|
59
69
|
* Set by the kernel; used for declared-throw-union checks. */
|
|
60
70
|
getDefinition?: (kind: string) => ResourceDefinition | undefined;
|
|
71
|
+
/** Per-kernel invocation tracer. Set by the kernel on the root context and
|
|
72
|
+
* propagated through `spawnChild`; drives invocation-id minting in `invoke`. */
|
|
73
|
+
tracer?: Tracer;
|
|
61
74
|
readonly createInstance: InstanceFactory;
|
|
62
75
|
readonly context: Record<string, unknown>;
|
|
63
76
|
readonly secretValues: Set<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation-context.d.ts","sourceRoot":"","sources":["../src/evaluation-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"evaluation-context.d.ts","sourceRoot":"","sources":["../src/evaluation-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,SAAS,GAAG,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,GAAG,EACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,4EAA4E;IAC5E,IAAI,IAAI,MAAM,CAAC;CAChB;AAED,qEAAqE;AACrE,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AA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ACtD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IAChC,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAC3E,WAAW,CACT,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,MAAM,EAAE,EACf,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5B"}
|
package/package.json
CHANGED
package/src/cancellation.ts
CHANGED
|
@@ -41,6 +41,13 @@ export interface CancellationToken {
|
|
|
41
41
|
*/
|
|
42
42
|
export interface InvokeContext {
|
|
43
43
|
readonly cancellation: CancellationToken;
|
|
44
|
+
/** Monotonic id minted by the kernel for this invocation — present only while
|
|
45
|
+
* tracing is active (a debug consumer is attached). Lets controllers correlate
|
|
46
|
+
* their work with the debug stream. */
|
|
47
|
+
readonly invocationId?: number;
|
|
48
|
+
/** The {@link invocationId} of the invocation that dispatched this one, or
|
|
49
|
+
* `undefined` at a trace root. Reconstructs the call tree on the consumer. */
|
|
50
|
+
readonly parentInvocationId?: number;
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
export interface CancellationSource {
|
|
@@ -4,7 +4,22 @@ import type { ResourceInstance } from "./resource-instance.js";
|
|
|
4
4
|
import type { ResourceManifest } from "./resource-manifest.js";
|
|
5
5
|
import type { ResourceDefinition } from "./types.js";
|
|
6
6
|
|
|
7
|
-
export type EmitEvent = (
|
|
7
|
+
export type EmitEvent = (
|
|
8
|
+
event: string,
|
|
9
|
+
payload?: any,
|
|
10
|
+
metadata?: Record<string, any>,
|
|
11
|
+
) => void | Promise<void>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Per-kernel invocation tracer. Mints monotonic invocation ids and carries the
|
|
15
|
+
* gate that turns tracing on (a debug consumer is attached). Owned by the kernel,
|
|
16
|
+
* injected into the context tree; `enabled === false` is the zero-overhead default.
|
|
17
|
+
*/
|
|
18
|
+
export interface Tracer {
|
|
19
|
+
readonly enabled: boolean;
|
|
20
|
+
/** Mint the next monotonic invocation id (unique within the kernel run). */
|
|
21
|
+
next(): number;
|
|
22
|
+
}
|
|
8
23
|
|
|
9
24
|
/** Four-stage resource lifecycle defined in resource-lifecycle.md */
|
|
10
25
|
export type LifecycleState = "Pending" | "Validated" | "Initialized" | "Draining" | "Teardown";
|
|
@@ -83,6 +98,10 @@ export interface EvaluationContext {
|
|
|
83
98
|
* Set by the kernel; used for declared-throw-union checks. */
|
|
84
99
|
getDefinition?: (kind: string) => ResourceDefinition | undefined;
|
|
85
100
|
|
|
101
|
+
/** Per-kernel invocation tracer. Set by the kernel on the root context and
|
|
102
|
+
* propagated through `spawnChild`; drives invocation-id minting in `invoke`. */
|
|
103
|
+
tracer?: Tracer;
|
|
104
|
+
|
|
86
105
|
readonly createInstance: InstanceFactory;
|
|
87
106
|
readonly context: Record<string, unknown>;
|
|
88
107
|
readonly secretValues: Set<string>;
|