@telorun/sdk 0.2.7 → 0.3.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/README.md +54 -0
- package/dist/compiled-value.d.ts +2 -0
- package/dist/compiled-value.d.ts.map +1 -1
- package/dist/evaluation-context.d.ts +16 -102
- package/dist/evaluation-context.d.ts.map +1 -1
- package/dist/evaluation-context.js +0 -390
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/invoke-error.d.ts +14 -0
- package/dist/invoke-error.d.ts.map +1 -0
- package/dist/invoke-error.js +34 -0
- package/dist/module-context.d.ts +12 -36
- package/dist/module-context.d.ts.map +1 -1
- package/dist/module-context.js +1 -177
- package/dist/ref.d.ts +1 -1
- package/dist/ref.d.ts.map +1 -1
- package/dist/ref.js +1 -1
- package/dist/resource-context.d.ts +17 -0
- package/dist/resource-context.d.ts.map +1 -1
- package/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +19 -1
- package/src/compiled-value.ts +2 -0
- package/src/evaluation-context.ts +45 -461
- package/src/index.ts +1 -0
- package/src/invoke-error.ts +39 -0
- package/src/module-context.ts +22 -203
- package/src/ref.ts +1 -1
- package/src/resource-context.ts +23 -0
- package/src/types.ts +18 -0
- package/dist/capability-definition.d.ts +0 -8
- package/dist/capability-definition.d.ts.map +0 -1
- package/dist/capability-definition.js +0 -21
- package/dist/cel-environment.d.ts +0 -3
- package/dist/cel-environment.d.ts.map +0 -1
- package/dist/cel-environment.js +0 -13
- package/dist/execution-context.d.ts +0 -13
- package/dist/execution-context.d.ts.map +0 -1
- package/dist/execution-context.js +0 -13
- package/src/execution-context.ts +0 -21
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./module-context.js";
|
|
|
10
10
|
export * from "./resource-context.js";
|
|
11
11
|
export * from "./resource-instance.js";
|
|
12
12
|
export * from "./resource-manifest.js";
|
|
13
|
+
export * from "./invoke-error.js";
|
|
13
14
|
export * from "./runtime-error.js";
|
|
14
15
|
export * from "./runtime-event.js";
|
|
15
16
|
export * from "./runtime-resource.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured, catchable error for invocables and runnables. Route handlers and
|
|
3
|
+
* Run.Sequence try/catch match on `code`; downstream renderers consume `data`.
|
|
4
|
+
*
|
|
5
|
+
* Use `isInvokeError` for recognition, not `instanceof` — dual-realm safe
|
|
6
|
+
* across pnpm hoist splits, registry modules, and future sandbox isolation.
|
|
7
|
+
*/
|
|
8
|
+
export declare class InvokeError extends Error {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly data?: unknown;
|
|
11
|
+
constructor(code: string, message: string, data?: unknown);
|
|
12
|
+
}
|
|
13
|
+
export declare function isInvokeError(err: unknown): err is InvokeError;
|
|
14
|
+
//# sourceMappingURL=invoke-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoke-error.d.ts","sourceRoot":"","sources":["../src/invoke-error.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;gBAEZ,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO;CAiB1D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAM9D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const INVOKE_ERROR = Symbol.for("telo.InvokeError");
|
|
2
|
+
/**
|
|
3
|
+
* Structured, catchable error for invocables and runnables. Route handlers and
|
|
4
|
+
* Run.Sequence try/catch match on `code`; downstream renderers consume `data`.
|
|
5
|
+
*
|
|
6
|
+
* Use `isInvokeError` for recognition, not `instanceof` — dual-realm safe
|
|
7
|
+
* across pnpm hoist splits, registry modules, and future sandbox isolation.
|
|
8
|
+
*/
|
|
9
|
+
export class InvokeError extends Error {
|
|
10
|
+
code;
|
|
11
|
+
data;
|
|
12
|
+
constructor(code, message, data) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = "InvokeError";
|
|
15
|
+
this.code = code;
|
|
16
|
+
this.data = data;
|
|
17
|
+
// Set via defineProperty (not a class field initializer) so the marker is
|
|
18
|
+
// always present regardless of TS/runtime class-field semantics
|
|
19
|
+
// (useDefineForClassFields, Error-subclass quirks, etc.) and stays
|
|
20
|
+
// non-enumerable so JSON serialisation / CEL property access don't trip
|
|
21
|
+
// over it.
|
|
22
|
+
Object.defineProperty(this, INVOKE_ERROR, {
|
|
23
|
+
value: true,
|
|
24
|
+
enumerable: false,
|
|
25
|
+
writable: false,
|
|
26
|
+
configurable: false,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function isInvokeError(err) {
|
|
31
|
+
return (typeof err === "object" &&
|
|
32
|
+
err !== null &&
|
|
33
|
+
err[INVOKE_ERROR] === true);
|
|
34
|
+
}
|
package/dist/module-context.d.ts
CHANGED
|
@@ -1,53 +1,29 @@
|
|
|
1
|
-
import { Invocable } from "./capabilities/invokable.js";
|
|
2
|
-
import {
|
|
1
|
+
import type { Invocable } from "./capabilities/invokable.js";
|
|
2
|
+
import type { EvaluationContext } from "./evaluation-context.js";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* variables, secrets, resources.
|
|
4
|
+
* Public contract for a persistent, module-scoped context.
|
|
6
5
|
*
|
|
6
|
+
* Three reserved CEL namespaces: variables, secrets, resources.
|
|
7
7
|
* Unlike the base EvaluationContext, ModuleContext is stateful and mutable:
|
|
8
|
-
* variables/secrets/resources accumulate during multi-pass initialization
|
|
9
|
-
*
|
|
10
|
-
* here for alias-prefixed kind resolution (e.g. MyImport.Http.Route).
|
|
8
|
+
* variables/secrets/resources accumulate during multi-pass initialization.
|
|
9
|
+
* Import aliases are tracked here for alias-prefixed kind resolution.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
* resources — no separate imports namespace needed.
|
|
11
|
+
* The class implementation lives in `@telorun/kernel`.
|
|
14
12
|
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
private _resources;
|
|
21
|
-
/** Maps import alias → real module name for kind resolution. */
|
|
13
|
+
export interface ModuleContext extends EvaluationContext {
|
|
14
|
+
readonly variables: Record<string, unknown>;
|
|
15
|
+
readonly secrets: Record<string, unknown>;
|
|
16
|
+
readonly resources: Record<string, unknown>;
|
|
17
|
+
/** Maps import alias -> real module name for kind resolution. */
|
|
22
18
|
readonly importAliases: Map<string, string>;
|
|
23
|
-
/** Maps import alias → allowed kind names. Absent entry = unrestricted (e.g. Kernel). */
|
|
24
|
-
private readonly importedKinds;
|
|
25
|
-
constructor(source: string, variables: Record<string, unknown> | undefined, secrets: Record<string, unknown> | undefined, resources: Record<string, unknown> | undefined, targets: string[] | undefined, createInstance: InstanceFactory | undefined, emit: EmitEvent, _hostEnv?: Record<string, string | undefined> | undefined);
|
|
26
|
-
get variables(): Record<string, unknown>;
|
|
27
|
-
get secrets(): Record<string, unknown>;
|
|
28
|
-
get resources(): Record<string, unknown>;
|
|
29
19
|
setVariables(vars: Record<string, unknown>): void;
|
|
30
20
|
setTargets(vars: string[]): void;
|
|
31
21
|
setSecrets(secrets: Record<string, unknown>): void;
|
|
32
22
|
setResource(name: string, props: Record<string, unknown>): void;
|
|
33
|
-
protected onResourceSnapshotted(name: string, snap: Record<string, unknown>): void;
|
|
34
|
-
/**
|
|
35
|
-
* Register an imported module under the given alias, with the list of kind names
|
|
36
|
-
* it exports. An empty kinds array means no restriction (used for built-ins like Kernel).
|
|
37
|
-
*/
|
|
38
23
|
registerImport(alias: string, targetModule: string, kinds: string[]): void;
|
|
39
24
|
getInstance(name: string): unknown;
|
|
40
25
|
getInvocable<TInput = Record<string, any>, TOutput = any>(name: string): Invocable<TInput, TOutput>;
|
|
41
|
-
/**
|
|
42
|
-
* Resolve a fully-qualified kind like "Http.Server" to its real kind "http-server.Server".
|
|
43
|
-
* Splits on the first dot, looks up the prefix in importAliases, validates against
|
|
44
|
-
* importedKinds (if set), and reconstructs the resolved kind.
|
|
45
|
-
* Throws with a clear message if the alias is unknown or the kind is not exported.
|
|
46
|
-
*/
|
|
47
26
|
resolveKind(kind: string): string;
|
|
48
|
-
private _rebuildContext;
|
|
49
|
-
invoke<TInputs>(kind: string, name: string, inputs: TInputs): Promise<any>;
|
|
50
|
-
run(name: string): Promise<void>;
|
|
51
27
|
runTargets(): Promise<void>;
|
|
52
28
|
}
|
|
53
29
|
//# sourceMappingURL=module-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-context.d.ts","sourceRoot":"","sources":["../src/module-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"module-context.d.ts","sourceRoot":"","sources":["../src/module-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE5C,iEAAiE;IACjE,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE5C,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAClD,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACnD,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAEhE,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3E,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,GAAG,EACtD,IAAI,EAAE,MAAM,GACX,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B"}
|
package/dist/module-context.js
CHANGED
|
@@ -1,177 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/** Wraps process.env so that missing keys return null instead of throwing in CEL.
|
|
3
|
-
* cel-js uses Object.hasOwn(obj, key) before accessing obj[key], so we must
|
|
4
|
-
* intercept getOwnPropertyDescriptor to report every string key as "own". */
|
|
5
|
-
function lenientEnv(env) {
|
|
6
|
-
return new Proxy(env, {
|
|
7
|
-
get(target, key) {
|
|
8
|
-
if (typeof key !== "string")
|
|
9
|
-
return target[key];
|
|
10
|
-
return key in target ? (target[key] ?? null) : null;
|
|
11
|
-
},
|
|
12
|
-
has() {
|
|
13
|
-
return true;
|
|
14
|
-
},
|
|
15
|
-
getOwnPropertyDescriptor(target, key) {
|
|
16
|
-
if (typeof key !== "string")
|
|
17
|
-
return Object.getOwnPropertyDescriptor(target, key);
|
|
18
|
-
const value = key in target ? (target[key] ?? null) : null;
|
|
19
|
-
return { configurable: true, enumerable: true, writable: true, value };
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function collectSecretValues(secrets) {
|
|
24
|
-
const values = new Set();
|
|
25
|
-
for (const value of Object.values(secrets)) {
|
|
26
|
-
if (typeof value === "string" && value.length > 0) {
|
|
27
|
-
values.add(value);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return values;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Persistent, module-scoped context. Three reserved CEL namespaces:
|
|
34
|
-
* variables, secrets, resources.
|
|
35
|
-
*
|
|
36
|
-
* Unlike the base EvaluationContext, ModuleContext is stateful and mutable:
|
|
37
|
-
* variables/secrets/resources accumulate during multi-pass initialization and
|
|
38
|
-
* the context record is rebuilt on each mutation. Import aliases are tracked
|
|
39
|
-
* here for alias-prefixed kind resolution (e.g. MyImport.Http.Route).
|
|
40
|
-
*
|
|
41
|
-
* Imported modules are surfaced under resources.<alias> alongside local
|
|
42
|
-
* resources — no separate imports namespace needed.
|
|
43
|
-
*/
|
|
44
|
-
export class ModuleContext extends EvaluationContext {
|
|
45
|
-
targets;
|
|
46
|
-
_hostEnv;
|
|
47
|
-
_variables;
|
|
48
|
-
_secrets;
|
|
49
|
-
_resources;
|
|
50
|
-
/** Maps import alias → real module name for kind resolution. */
|
|
51
|
-
importAliases = new Map();
|
|
52
|
-
/** Maps import alias → allowed kind names. Absent entry = unrestricted (e.g. Kernel). */
|
|
53
|
-
importedKinds = new Map();
|
|
54
|
-
constructor(source, variables = {}, secrets = {}, resources = {}, targets = [], createInstance = async () => null, emit, _hostEnv) {
|
|
55
|
-
super(source, {}, createInstance, new Set(), emit);
|
|
56
|
-
this.targets = targets;
|
|
57
|
-
this._hostEnv = _hostEnv;
|
|
58
|
-
this._variables = variables;
|
|
59
|
-
this._secrets = secrets;
|
|
60
|
-
this._resources = resources;
|
|
61
|
-
this._rebuildContext();
|
|
62
|
-
}
|
|
63
|
-
get variables() {
|
|
64
|
-
return this._variables;
|
|
65
|
-
}
|
|
66
|
-
get secrets() {
|
|
67
|
-
return this._secrets;
|
|
68
|
-
}
|
|
69
|
-
get resources() {
|
|
70
|
-
return this._resources;
|
|
71
|
-
}
|
|
72
|
-
setVariables(vars) {
|
|
73
|
-
this._variables = vars;
|
|
74
|
-
this._rebuildContext();
|
|
75
|
-
}
|
|
76
|
-
setTargets(vars) {
|
|
77
|
-
this.targets = vars;
|
|
78
|
-
}
|
|
79
|
-
setSecrets(secrets) {
|
|
80
|
-
this._secrets = secrets;
|
|
81
|
-
this._rebuildContext();
|
|
82
|
-
}
|
|
83
|
-
setResource(name, props) {
|
|
84
|
-
this._resources = { ...this._resources, [name]: props };
|
|
85
|
-
this._rebuildContext();
|
|
86
|
-
}
|
|
87
|
-
onResourceSnapshotted(name, snap) {
|
|
88
|
-
this.setResource(name, snap);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Register an imported module under the given alias, with the list of kind names
|
|
92
|
-
* it exports. An empty kinds array means no restriction (used for built-ins like Kernel).
|
|
93
|
-
*/
|
|
94
|
-
registerImport(alias, targetModule, kinds) {
|
|
95
|
-
this.importAliases.set(alias, targetModule);
|
|
96
|
-
if (kinds.length > 0) {
|
|
97
|
-
this.importedKinds.set(alias, new Set(kinds));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
getInstance(name) {
|
|
101
|
-
const entry = this.resourceInstances.get(name);
|
|
102
|
-
if (!entry) {
|
|
103
|
-
throw new Error(`Resource '${name}' not found in module context. Available resources: ${[...this.resourceInstances.keys()].join(", ")}`);
|
|
104
|
-
}
|
|
105
|
-
return entry?.instance;
|
|
106
|
-
}
|
|
107
|
-
getInvocable(name) {
|
|
108
|
-
const instance = this.getInstance(name);
|
|
109
|
-
if (instance &&
|
|
110
|
-
typeof instance === "object" &&
|
|
111
|
-
"invoke" in instance &&
|
|
112
|
-
typeof instance.invoke !== "function") {
|
|
113
|
-
throw new Error(`Resource '${name}' does not have an invoke() method.`);
|
|
114
|
-
}
|
|
115
|
-
return instance;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Resolve a fully-qualified kind like "Http.Server" to its real kind "http-server.Server".
|
|
119
|
-
* Splits on the first dot, looks up the prefix in importAliases, validates against
|
|
120
|
-
* importedKinds (if set), and reconstructs the resolved kind.
|
|
121
|
-
* Throws with a clear message if the alias is unknown or the kind is not exported.
|
|
122
|
-
*/
|
|
123
|
-
resolveKind(kind) {
|
|
124
|
-
const dot = kind.indexOf(".");
|
|
125
|
-
if (dot === -1) {
|
|
126
|
-
throw new Error(`Kind '${kind}' must be fully qualified (e.g. 'Module.KindName')`);
|
|
127
|
-
}
|
|
128
|
-
const prefix = kind.slice(0, dot);
|
|
129
|
-
const suffix = kind.slice(dot + 1);
|
|
130
|
-
const realModule = this.importAliases.get(prefix);
|
|
131
|
-
if (!realModule) {
|
|
132
|
-
const known = [...this.importAliases.keys()].join(", ") || "(none)";
|
|
133
|
-
throw new Error(`Kind '${kind}': no module imported with alias '${prefix}'. Known aliases: ${known}`);
|
|
134
|
-
}
|
|
135
|
-
const allowed = this.importedKinds.get(prefix);
|
|
136
|
-
if (allowed !== undefined && !allowed.has(suffix)) {
|
|
137
|
-
throw new Error(`Kind '${suffix}' is not exported by module '${realModule}' (imported as '${prefix}'). ` +
|
|
138
|
-
`Exported kinds: ${[...allowed].join(", ")}`);
|
|
139
|
-
}
|
|
140
|
-
return `${realModule}.${suffix}`;
|
|
141
|
-
}
|
|
142
|
-
_rebuildContext() {
|
|
143
|
-
this._context = {
|
|
144
|
-
variables: this._variables,
|
|
145
|
-
secrets: this._secrets,
|
|
146
|
-
resources: this._resources,
|
|
147
|
-
...(this._hostEnv ? { env: lenientEnv(this._hostEnv) } : {}),
|
|
148
|
-
};
|
|
149
|
-
this._secretValues = collectSecretValues(this._secrets);
|
|
150
|
-
}
|
|
151
|
-
async invoke(kind, name, inputs) {
|
|
152
|
-
const result = await super.invoke(kind, name, inputs);
|
|
153
|
-
const entry = this.resourceInstances.get(name);
|
|
154
|
-
if (entry && typeof entry.instance.snapshot === "function") {
|
|
155
|
-
const snap = await Promise.resolve(entry.instance.snapshot());
|
|
156
|
-
this.setResource(name, snap);
|
|
157
|
-
}
|
|
158
|
-
return result;
|
|
159
|
-
}
|
|
160
|
-
async run(name) {
|
|
161
|
-
const resource = this.resourceInstances.get(name);
|
|
162
|
-
if (!resource) {
|
|
163
|
-
throw new Error(`Target resource ${name} not found in module context. Available resources: ${[...this.resourceInstances.keys()].join(", ")}`);
|
|
164
|
-
}
|
|
165
|
-
if (typeof resource.instance.run === "function") {
|
|
166
|
-
await resource.instance.run();
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
throw new Error(`Target resource ${name} does not have a run() method.`);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
async runTargets() {
|
|
173
|
-
for (const target of this.targets) {
|
|
174
|
-
await this.run(target);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
1
|
+
export {};
|
package/dist/ref.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type Injected<T> = {
|
|
|
36
36
|
/** Returns a schema node that emits `x-telo-ref` for buildReferenceFieldMap and carries
|
|
37
37
|
* KindRef<T> as its TypeScript type. For TypeBox schemas use Type.Unsafe<KindRef<T>>(Ref(...)).
|
|
38
38
|
*
|
|
39
|
-
* @param ref Canonical ref string: "namespace/module-name#TypeName" or "
|
|
39
|
+
* @param ref Canonical ref string: "namespace/module-name#TypeName" or "telo#TypeName" */
|
|
40
40
|
export declare const Ref: <T = ResourceInstance>(ref: string) => KindRef<T>;
|
|
41
41
|
/** Returns a schema node that emits `x-telo-scope` for buildReferenceFieldMap and carries
|
|
42
42
|
* ScopeRef as its TypeScript type. For TypeBox schemas use Type.Unsafe<ScopeRef>(Scope(...)).
|
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AM,KAAG,OAAO,CAAC,CAAC,CACf,CAAC;AAEnD;;;;wEAIwE;AACxE,eAAO,MAAM,KAAK,GAAI,gBAAgB,MAAM,GAAG,MAAM,EAAE,KAAG,QACG,CAAC"}
|
package/dist/ref.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Returns a schema node that emits `x-telo-ref` for buildReferenceFieldMap and carries
|
|
2
2
|
* KindRef<T> as its TypeScript type. For TypeBox schemas use Type.Unsafe<KindRef<T>>(Ref(...)).
|
|
3
3
|
*
|
|
4
|
-
* @param ref Canonical ref string: "namespace/module-name#TypeName" or "
|
|
4
|
+
* @param ref Canonical ref string: "namespace/module-name#TypeName" or "telo#TypeName" */
|
|
5
5
|
export const Ref = (ref) => ({ "x-telo-ref": ref });
|
|
6
6
|
/** Returns a schema node that emits `x-telo-scope` for buildReferenceFieldMap and carries
|
|
7
7
|
* ScopeRef as its TypeScript type. For TypeBox schemas use Type.Unsafe<ScopeRef>(Scope(...)).
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { ControllerContext } from "./controller-context.js";
|
|
2
2
|
import { EvaluationContext } from "./evaluation-context.js";
|
|
3
3
|
import { ModuleContext } from "./module-context.js";
|
|
4
|
+
import { ResourceInstance } from "./resource-instance.js";
|
|
5
|
+
import { ResourceManifest } from "./resource-manifest.js";
|
|
4
6
|
import { RuntimeResource } from "./runtime-resource.js";
|
|
7
|
+
export interface LoadOptions {
|
|
8
|
+
/** When true, `${{ }}` templates are replaced with CompiledValue wrappers
|
|
9
|
+
* so they can be evaluated at runtime. Leave unset for static analysis. */
|
|
10
|
+
compile?: boolean;
|
|
11
|
+
}
|
|
5
12
|
export interface DataValidator {
|
|
6
13
|
validate(data: any): void;
|
|
7
14
|
isValid(data: any): boolean;
|
|
@@ -23,6 +30,7 @@ export interface ResourceContext extends ControllerContext {
|
|
|
23
30
|
acquireHold(reason?: string): () => void;
|
|
24
31
|
emitEvent(event: string, payload?: any): Promise<void>;
|
|
25
32
|
invoke<TInputs>(kind: string, name: string, inputs: TInputs, options?: any): Promise<any>;
|
|
33
|
+
invokeResolved<TInputs>(kind: string, name: string, instance: ResourceInstance, inputs: TInputs): Promise<any>;
|
|
26
34
|
run(kind: string, name: string): Promise<void>;
|
|
27
35
|
getResources(kind: string): RuntimeResource[];
|
|
28
36
|
getResourcesByName(kind: string, name: string): RuntimeResource | null;
|
|
@@ -46,7 +54,16 @@ export interface ResourceContext extends ControllerContext {
|
|
|
46
54
|
registerDefinition(definition: any): void;
|
|
47
55
|
registerModuleImport(alias: string, targetModule: string, kinds: string[]): void;
|
|
48
56
|
teardownResource(kind: string, name: string): Promise<void>;
|
|
57
|
+
/** Load a single module (its own file + `include`d partials). Use this when
|
|
58
|
+
* you need just the declaring file's manifests. */
|
|
59
|
+
loadModule(url: string, options?: LoadOptions): Promise<ResourceManifest[]>;
|
|
60
|
+
/** Load a module and follow its Telo.Import chain, returning the union of
|
|
61
|
+
* the module's manifests plus all transitively-imported Telo.Definition
|
|
62
|
+
* manifests. Use this when you need the full kind surface area visible from
|
|
63
|
+
* the module. */
|
|
64
|
+
loadManifests(url: string): Promise<ResourceManifest[]>;
|
|
49
65
|
readonly moduleContext: ModuleContext;
|
|
66
|
+
readonly env: Record<string, string | undefined>;
|
|
50
67
|
readonly stdin: NodeJS.ReadableStream;
|
|
51
68
|
readonly stdout: NodeJS.WritableStream;
|
|
52
69
|
readonly stderr: NodeJS.WritableStream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-context.d.ts","sourceRoot":"","sources":["../src/resource-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC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AAC;IACxD,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;CACxC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -11,6 +11,20 @@ export interface ExecContext {
|
|
|
11
11
|
execute(urn: string, input: any): Promise<any>;
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
}
|
|
14
|
+
export interface ThrowCodeSpec {
|
|
15
|
+
description: string;
|
|
16
|
+
data?: Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Declared throw contract for a Telo.Invocable or Telo.Runnable definition.
|
|
20
|
+
* Codes-only (explicit contract) in Phase 1; `inherit` and `passthrough` land
|
|
21
|
+
* in Phase 2 together with the analyzer dataflow pass.
|
|
22
|
+
*/
|
|
23
|
+
export interface ThrowsSpec {
|
|
24
|
+
codes?: Record<string, ThrowCodeSpec>;
|
|
25
|
+
inherit?: boolean;
|
|
26
|
+
passthrough?: boolean;
|
|
27
|
+
}
|
|
14
28
|
export interface ResourceDefinition {
|
|
15
29
|
kind: string;
|
|
16
30
|
metadata: {
|
|
@@ -24,6 +38,8 @@ export interface ResourceDefinition {
|
|
|
24
38
|
runtime: string;
|
|
25
39
|
entry: string;
|
|
26
40
|
}>;
|
|
41
|
+
/** Declared throw contract — only valid on Telo.Invocable / Telo.Runnable. */
|
|
42
|
+
throws?: ThrowsSpec;
|
|
27
43
|
}
|
|
28
44
|
/**
|
|
29
45
|
* Controller definition for a resource kind.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":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AM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,IAAI,CAAC;IACzC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAI1B,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED,qBAAa,YAAa,SAAQ,KAAK;IAE5B,IAAI,EAAE,gBAAgB;IAEtB,WAAW,CAAC,EAAE,iBAAiB,EAAE;gBAFjC,IAAI,EAAE,gBAAgB,EAC7B,OAAO,EAAE,MAAM,EACR,WAAW,CAAC,EAAE,iBAAiB,EAAE,YAAA;CAK3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Telo SDK - Public API for Telo module authors.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"telo",
|
|
7
|
+
"sdk",
|
|
8
|
+
"runtime",
|
|
9
|
+
"modules"
|
|
10
|
+
],
|
|
11
|
+
"author": "Bartosz Pasiński <bartosz.pasinski@codenet.pl>",
|
|
12
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/telorun/telo.git",
|
|
16
|
+
"directory": "sdk/nodejs"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/telorun/telo#readme",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/telorun/telo/issues"
|
|
21
|
+
},
|
|
4
22
|
"type": "module",
|
|
5
23
|
"main": "./dist/index.js",
|
|
6
24
|
"exports": {
|
package/src/compiled-value.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* The SDK has no knowledge of CEL — it only calls .call(). */
|
|
4
4
|
export interface CompiledValue {
|
|
5
5
|
readonly __compiled: true;
|
|
6
|
+
/** Original expression source text (e.g. "env.PORT"), if available. */
|
|
7
|
+
readonly source?: string;
|
|
6
8
|
call(ctx: Record<string, unknown>): unknown;
|
|
7
9
|
}
|
|
8
10
|
|