@telorun/kernel 0.13.0 → 0.14.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.
Files changed (122) hide show
  1. package/dist/application-env.d.ts +1 -0
  2. package/dist/application-env.d.ts.map +1 -1
  3. package/dist/application-env.js +59 -1
  4. package/dist/application-env.js.map +1 -1
  5. package/dist/kernel.d.ts.map +1 -1
  6. package/dist/kernel.js +4 -1
  7. package/dist/kernel.js.map +1 -1
  8. package/dist/module-context.d.ts +8 -2
  9. package/dist/module-context.d.ts.map +1 -1
  10. package/dist/module-context.js +14 -2
  11. package/dist/module-context.js.map +1 -1
  12. package/dist/schema-validator.d.ts.map +1 -1
  13. package/dist/schema-validator.js +1 -0
  14. package/dist/schema-validator.js.map +1 -1
  15. package/package.json +3 -3
  16. package/src/application-env.ts +74 -1
  17. package/src/kernel.ts +4 -1
  18. package/src/module-context.ts +16 -2
  19. package/src/schema-validator.ts +1 -0
  20. package/dist/base-definition.d.ts +0 -14
  21. package/dist/base-definition.d.ts.map +0 -1
  22. package/dist/base-definition.js +0 -17
  23. package/dist/base-definition.js.map +0 -1
  24. package/dist/capabilities/capabilities/component.yaml +0 -4
  25. package/dist/capabilities/capabilities/executable.yaml +0 -8
  26. package/dist/capabilities/capabilities/handler.yaml +0 -4
  27. package/dist/capabilities/capabilities/listener.yaml +0 -4
  28. package/dist/capabilities/capabilities/provider.yaml +0 -4
  29. package/dist/capabilities/capabilities/template.yaml +0 -4
  30. package/dist/capabilities/capabilities/type.yaml +0 -4
  31. package/dist/capabilities/component.d.ts +0 -3
  32. package/dist/capabilities/component.d.ts.map +0 -1
  33. package/dist/capabilities/component.js +0 -4
  34. package/dist/capabilities/component.js.map +0 -1
  35. package/dist/capabilities/component.yaml +0 -3
  36. package/dist/capabilities/executable.d.ts +0 -3
  37. package/dist/capabilities/executable.d.ts.map +0 -1
  38. package/dist/capabilities/executable.js +0 -5
  39. package/dist/capabilities/executable.js.map +0 -1
  40. package/dist/capabilities/executable.yaml +0 -7
  41. package/dist/capabilities/handler.d.ts +0 -3
  42. package/dist/capabilities/handler.d.ts.map +0 -1
  43. package/dist/capabilities/handler.js +0 -4
  44. package/dist/capabilities/handler.js.map +0 -1
  45. package/dist/capabilities/handler.yaml +0 -3
  46. package/dist/capabilities/invokable.d.ts +0 -3
  47. package/dist/capabilities/invokable.d.ts.map +0 -1
  48. package/dist/capabilities/invokable.js +0 -5
  49. package/dist/capabilities/invokable.js.map +0 -1
  50. package/dist/capabilities/listener.d.ts +0 -3
  51. package/dist/capabilities/listener.d.ts.map +0 -1
  52. package/dist/capabilities/listener.js +0 -5
  53. package/dist/capabilities/listener.js.map +0 -1
  54. package/dist/capabilities/listener.yaml +0 -3
  55. package/dist/capabilities/mount.d.ts +0 -3
  56. package/dist/capabilities/mount.d.ts.map +0 -1
  57. package/dist/capabilities/mount.js +0 -5
  58. package/dist/capabilities/mount.js.map +0 -1
  59. package/dist/capabilities/provider.d.ts +0 -3
  60. package/dist/capabilities/provider.d.ts.map +0 -1
  61. package/dist/capabilities/provider.js +0 -8
  62. package/dist/capabilities/provider.js.map +0 -1
  63. package/dist/capabilities/provider.yaml +0 -3
  64. package/dist/capabilities/runnable.d.ts +0 -3
  65. package/dist/capabilities/runnable.d.ts.map +0 -1
  66. package/dist/capabilities/runnable.js +0 -5
  67. package/dist/capabilities/runnable.js.map +0 -1
  68. package/dist/capabilities/service.d.ts +0 -3
  69. package/dist/capabilities/service.d.ts.map +0 -1
  70. package/dist/capabilities/service.js +0 -5
  71. package/dist/capabilities/service.js.map +0 -1
  72. package/dist/capabilities/template.d.ts +0 -3
  73. package/dist/capabilities/template.d.ts.map +0 -1
  74. package/dist/capabilities/template.js +0 -5
  75. package/dist/capabilities/template.js.map +0 -1
  76. package/dist/capabilities/template.yaml +0 -3
  77. package/dist/capabilities/type.d.ts +0 -3
  78. package/dist/capabilities/type.d.ts.map +0 -1
  79. package/dist/capabilities/type.js +0 -5
  80. package/dist/capabilities/type.js.map +0 -1
  81. package/dist/capabilities/type.yaml +0 -3
  82. package/dist/controllers/capability/capability-controller.d.ts +0 -32
  83. package/dist/controllers/capability/capability-controller.d.ts.map +0 -1
  84. package/dist/controllers/capability/capability-controller.js +0 -26
  85. package/dist/controllers/capability/capability-controller.js.map +0 -1
  86. package/dist/controllers/module/module.json +0 -48
  87. package/dist/loader.d.ts +0 -18
  88. package/dist/loader.d.ts.map +0 -1
  89. package/dist/loader.js +0 -127
  90. package/dist/loader.js.map +0 -1
  91. package/dist/manifest-adapters/http-adapter.d.ts +0 -8
  92. package/dist/manifest-adapters/http-adapter.d.ts.map +0 -1
  93. package/dist/manifest-adapters/http-adapter.js +0 -31
  94. package/dist/manifest-adapters/http-adapter.js.map +0 -1
  95. package/dist/manifest-adapters/local-file-adapter.d.ts +0 -15
  96. package/dist/manifest-adapters/local-file-adapter.d.ts.map +0 -1
  97. package/dist/manifest-adapters/local-file-adapter.js +0 -95
  98. package/dist/manifest-adapters/local-file-adapter.js.map +0 -1
  99. package/dist/manifest-adapters/manifest-adapter.d.ts +0 -35
  100. package/dist/manifest-adapters/manifest-adapter.d.ts.map +0 -1
  101. package/dist/manifest-adapters/manifest-adapter.js +0 -2
  102. package/dist/manifest-adapters/manifest-adapter.js.map +0 -1
  103. package/dist/manifest-adapters/registry-adapter.d.ts +0 -9
  104. package/dist/manifest-adapters/registry-adapter.d.ts.map +0 -1
  105. package/dist/manifest-adapters/registry-adapter.js +0 -48
  106. package/dist/manifest-adapters/registry-adapter.js.map +0 -1
  107. package/dist/module-context-registry.d.ts +0 -48
  108. package/dist/module-context-registry.d.ts.map +0 -1
  109. package/dist/module-context-registry.js +0 -91
  110. package/dist/module-context-registry.js.map +0 -1
  111. package/dist/schema-valiator.d.ts +0 -15
  112. package/dist/schema-valiator.d.ts.map +0 -1
  113. package/dist/schema-valiator.js +0 -127
  114. package/dist/schema-valiator.js.map +0 -1
  115. package/dist/snapshot-serializer.d.ts +0 -62
  116. package/dist/snapshot-serializer.d.ts.map +0 -1
  117. package/dist/snapshot-serializer.js +0 -164
  118. package/dist/snapshot-serializer.js.map +0 -1
  119. package/dist/types.d.ts +0 -65
  120. package/dist/types.d.ts.map +0 -1
  121. package/dist/types.js +0 -8
  122. package/dist/types.js.map +0 -1
@@ -42,8 +42,8 @@ function collectSecretValues(secrets: Record<string, unknown>): Set<string> {
42
42
  }
43
43
 
44
44
  /**
45
- * Persistent, module-scoped context. Three reserved CEL namespaces:
46
- * variables, secrets, resources.
45
+ * Persistent, module-scoped context. Reserved CEL namespaces:
46
+ * variables, secrets, resources, ports (Application-only).
47
47
  *
48
48
  * Unlike the base EvaluationContext, ModuleContext is stateful and mutable:
49
49
  * variables/secrets/resources accumulate during multi-pass initialization and
@@ -57,6 +57,10 @@ export class ModuleContext extends EvaluationContext implements IModuleContext {
57
57
  private _variables: Record<string, unknown>;
58
58
  private _secrets: Record<string, unknown>;
59
59
  private _resources: Record<string, unknown>;
60
+ /** Resolved inbound ports (`ports.<name>` → integer). Application-only:
61
+ * populated on the root context from the Application's `ports` block;
62
+ * imported child modules keep this empty. */
63
+ private _ports: Record<string, unknown> = {};
60
64
 
61
65
  /** Maps import alias → real module name for kind resolution. */
62
66
  private readonly importAliases = new Map<string, string>();
@@ -102,11 +106,20 @@ export class ModuleContext extends EvaluationContext implements IModuleContext {
102
106
  return this._resources;
103
107
  }
104
108
 
109
+ get ports(): Record<string, unknown> {
110
+ return this._ports;
111
+ }
112
+
105
113
  setVariables(vars: Record<string, unknown>): void {
106
114
  this._variables = vars;
107
115
  this._rebuildContext();
108
116
  }
109
117
 
118
+ setPorts(ports: Record<string, unknown>): void {
119
+ this._ports = ports;
120
+ this._rebuildContext();
121
+ }
122
+
110
123
  setTargets(vars: string[]): void {
111
124
  this.targets = vars;
112
125
  }
@@ -212,6 +225,7 @@ export class ModuleContext extends EvaluationContext implements IModuleContext {
212
225
  variables: this._variables,
213
226
  secrets: this._secrets,
214
227
  resources: this._resources,
228
+ ports: this._ports,
215
229
  ...(this._hostEnv ? { env: lenientEnv(this._hostEnv) } : {}),
216
230
  };
217
231
  this._secretValues = collectSecretValues(this._secrets);
@@ -112,6 +112,7 @@ export class SchemaValidator {
112
112
  "x-telo-topology-role",
113
113
  "x-telo-step-context",
114
114
  "x-telo-widget",
115
+ "x-telo-type",
115
116
  ]) {
116
117
  this.ajv.addKeyword(kw);
117
118
  }
@@ -1,14 +0,0 @@
1
- import type { ModuleContext, ResourceContext, ResourceDefinition, ResourceInstance, ResourceManifest } from "@telorun/sdk";
2
- export interface BaseDefinition {
3
- name: string;
4
- expand?: {
5
- compile?: string[];
6
- runtime?: string[];
7
- };
8
- onDefinition?(definition: ResourceDefinition, ctx: ResourceContext): void | Promise<void>;
9
- onManifest?(manifest: ResourceManifest, ctx: ModuleContext): ResourceManifest | Promise<ResourceManifest>;
10
- onInit?(instance: ResourceInstance, ctx: ResourceContext): Promise<void>;
11
- onInvoke?(instance: ResourceInstance, inputs: any, ctx: ResourceContext): Promise<any>;
12
- }
13
- export declare function createBaseDefinition(def: BaseDefinition): BaseDefinition;
14
- //# sourceMappingURL=base-definition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-definition.d.ts","sourceRoot":"","sources":["../src/base-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,YAAY,CAAC,CAAC,UAAU,EAAE,kBAAkB,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1F,UAAU,CAAC,CACT,QAAQ,EAAE,gBAAgB,EAC1B,GAAG,EAAE,aAAa,GACjB,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChD,MAAM,CAAC,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,QAAQ,CAAC,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACxF;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAoBxE"}
@@ -1,17 +0,0 @@
1
- export function createBaseDefinition(def) {
2
- const compile = def.expand?.compile ?? [];
3
- const runtime = def.expand?.runtime ?? [];
4
- return {
5
- ...def,
6
- onManifest: compile.length
7
- ? (manifest, ctx) => ctx.expandPaths(manifest, compile, runtime)
8
- : def.onManifest,
9
- onInvoke: runtime.length
10
- ? async (instance, inputs, _ctx) => {
11
- const expanded = _ctx.moduleContext.expandPaths(inputs, runtime);
12
- return instance.invoke(expanded);
13
- }
14
- : def.onInvoke,
15
- };
16
- }
17
- //# sourceMappingURL=base-definition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-definition.js","sourceRoot":"","sources":["../src/base-definition.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,oBAAoB,CAAC,GAAmB;IACtD,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC;IAE1C,OAAO;QACL,GAAG,GAAG;QACN,UAAU,EAAE,OAAO,CAAC,MAAM;YACxB,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,CAChB,GAAG,CAAC,WAAW,CAAC,QAAmC,EAAE,OAAO,EAAE,OAAO,CAAqB;YAC9F,CAAC,CAAC,GAAG,CAAC,UAAU;QAClB,QAAQ,EAAE,OAAO,CAAC,MAAM;YACtB,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;gBAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAC7C,MAAiC,EACjC,OAAO,CACR,CAAC;gBACF,OAAO,QAAQ,CAAC,MAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,CAAC;YACH,CAAC,CAAC,GAAG,CAAC,QAAQ;KACjB,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- module: Kernel
4
- name: component
@@ -1,8 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- module: Kernel
4
- name: executable
5
- schema:
6
- type: object
7
- properties:
8
- foo: { type: string }
@@ -1,4 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- module: Kernel
4
- name: handler
@@ -1,4 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- module: Kernel
4
- name: listener
@@ -1,4 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- module: Kernel
4
- name: provider
@@ -1,4 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- module: Kernel
4
- name: template
@@ -1,4 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- module: Kernel
4
- name: type
@@ -1,3 +0,0 @@
1
- import type { BaseDefinition } from "../base-definition.js";
2
- export declare const component: BaseDefinition;
3
- //# sourceMappingURL=component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/capabilities/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,eAAO,MAAM,SAAS,EAAE,cAEvB,CAAC"}
@@ -1,4 +0,0 @@
1
- export const component = {
2
- name: "component",
3
- };
4
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/capabilities/component.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAmB;IACvC,IAAI,EAAE,WAAW;CAClB,CAAC"}
@@ -1,3 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- name: component
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const runnable: ResourceDefinition;
3
- //# sourceMappingURL=executable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executable.d.ts","sourceRoot":"","sources":["../../src/capabilities/executable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,kBAGtB,CAAC"}
@@ -1,5 +0,0 @@
1
- export const runnable = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Runnable", module: "Kernel" },
4
- };
5
- //# sourceMappingURL=executable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executable.js","sourceRoot":"","sources":["../../src/capabilities/executable.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAuB;IAC1C,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE;CACjD,CAAC"}
@@ -1,7 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- name: executable
4
- schema:
5
- type: object
6
- properties:
7
- foo: { type: string }
@@ -1,3 +0,0 @@
1
- import type { BaseDefinition } from "../base-definition.js";
2
- export declare const handler: BaseDefinition;
3
- //# sourceMappingURL=handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/capabilities/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,eAAO,MAAM,OAAO,EAAE,cAErB,CAAC"}
@@ -1,4 +0,0 @@
1
- export const handler = {
2
- name: "handler",
3
- };
4
- //# sourceMappingURL=handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/capabilities/handler.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAmB;IACrC,IAAI,EAAE,SAAS;CAChB,CAAC"}
@@ -1,3 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- name: handler
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const invocable: ResourceDefinition;
3
- //# sourceMappingURL=invokable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invokable.d.ts","sourceRoot":"","sources":["../../src/capabilities/invokable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,SAAS,EAAE,kBAGvB,CAAC"}
@@ -1,5 +0,0 @@
1
- export const invocable = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Invocable", module: "Kernel" },
4
- };
5
- //# sourceMappingURL=invokable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invokable.js","sourceRoot":"","sources":["../../src/capabilities/invokable.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAuB;IAC3C,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE;CAClD,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const service: ResourceDefinition;
3
- //# sourceMappingURL=listener.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../src/capabilities/listener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAE,kBAGrB,CAAC"}
@@ -1,5 +0,0 @@
1
- export const service = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Service", module: "Kernel" },
4
- };
5
- //# sourceMappingURL=listener.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listener.js","sourceRoot":"","sources":["../../src/capabilities/listener.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAuB;IACzC,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE;CAChD,CAAC"}
@@ -1,3 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- name: listener
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const mount: ResourceDefinition;
3
- //# sourceMappingURL=mount.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/capabilities/mount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,KAAK,EAAE,kBAGnB,CAAC"}
@@ -1,5 +0,0 @@
1
- export const mount = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Mount", module: "Kernel" },
4
- };
5
- //# sourceMappingURL=mount.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mount.js","sourceRoot":"","sources":["../../src/capabilities/mount.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAuB;IACvC,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;CAC9C,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const provider: ResourceDefinition;
3
- //# sourceMappingURL=provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/capabilities/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,kBAMtB,CAAC"}
@@ -1,8 +0,0 @@
1
- export const provider = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Provider", module: "Kernel" },
4
- expand: {
5
- compile: ["**"],
6
- },
7
- };
8
- //# sourceMappingURL=provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/capabilities/provider.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAuB;IAC1C,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE;IAChD,MAAM,EAAE;QACN,OAAO,EAAE,CAAC,IAAI,CAAC;KAChB;CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- name: provider
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const runnable: ResourceDefinition;
3
- //# sourceMappingURL=runnable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runnable.d.ts","sourceRoot":"","sources":["../../src/capabilities/runnable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,kBAGtB,CAAC"}
@@ -1,5 +0,0 @@
1
- export const runnable = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Runnable", module: "Kernel" },
4
- };
5
- //# sourceMappingURL=runnable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runnable.js","sourceRoot":"","sources":["../../src/capabilities/runnable.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAuB;IAC1C,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE;CACjD,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const service: ResourceDefinition;
3
- //# sourceMappingURL=service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/capabilities/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAE,kBAGrB,CAAC"}
@@ -1,5 +0,0 @@
1
- export const service = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Service", module: "Kernel" },
4
- };
5
- //# sourceMappingURL=service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/capabilities/service.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAuB;IACzC,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE;CAChD,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const template: ResourceDefinition;
3
- //# sourceMappingURL=template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/capabilities/template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,kBAGtB,CAAC"}
@@ -1,5 +0,0 @@
1
- export const template = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Template", module: "Kernel" },
4
- };
5
- //# sourceMappingURL=template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/capabilities/template.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAuB;IAC1C,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE;CACjD,CAAC"}
@@ -1,3 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- name: template
@@ -1,3 +0,0 @@
1
- import type { ResourceDefinition } from "@telorun/sdk";
2
- export declare const typeCapability: ResourceDefinition;
3
- //# sourceMappingURL=type.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/capabilities/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,cAAc,EAAE,kBAG5B,CAAC"}
@@ -1,5 +0,0 @@
1
- export const typeCapability = {
2
- kind: "Kernel.Abstract",
3
- metadata: { name: "Type", module: "Kernel" },
4
- };
5
- //# sourceMappingURL=type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/capabilities/type.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE;CAC7C,CAAC"}
@@ -1,3 +0,0 @@
1
- kind: Kernel.Capability
2
- metadata:
3
- name: type
@@ -1,32 +0,0 @@
1
- import type { ResourceContext, ResourceInstance } from "@telorun/sdk";
2
- type CapabilityResource = {
3
- kind: string;
4
- metadata: {
5
- name: string;
6
- [key: string]: any;
7
- };
8
- };
9
- declare class Capability implements ResourceInstance {
10
- private readonly resource;
11
- constructor(resource: CapabilityResource);
12
- init(ctx: ResourceContext): Promise<void>;
13
- }
14
- export declare function create(resource: any, _ctx: ResourceContext): Promise<Capability>;
15
- export declare const schema: {
16
- type: string;
17
- properties: {
18
- metadata: {
19
- type: string;
20
- properties: {
21
- name: {
22
- type: string;
23
- };
24
- };
25
- required: string[];
26
- };
27
- };
28
- required: string[];
29
- additionalProperties: boolean;
30
- };
31
- export {};
32
- //# sourceMappingURL=capability-controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capability-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/capability/capability-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEtE,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,cAAM,UAAW,YAAW,gBAAgB;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,kBAAkB;IAEnD,IAAI,CAAC,GAAG,EAAE,eAAe;CAGhC;AAED,wBAAsB,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAEtF;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;CAalB,CAAC"}
@@ -1,26 +0,0 @@
1
- class Capability {
2
- constructor(resource) {
3
- this.resource = resource;
4
- }
5
- async init(ctx) {
6
- ctx.registerCapability(this.resource.metadata.name);
7
- }
8
- }
9
- export async function create(resource, _ctx) {
10
- return new Capability(resource);
11
- }
12
- export const schema = {
13
- type: "object",
14
- properties: {
15
- metadata: {
16
- type: "object",
17
- properties: {
18
- name: { type: "string" },
19
- },
20
- required: ["name"],
21
- },
22
- },
23
- required: ["metadata"],
24
- additionalProperties: true,
25
- };
26
- //# sourceMappingURL=capability-controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capability-controller.js","sourceRoot":"","sources":["../../../src/controllers/capability/capability-controller.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU;IACd,YAA6B,QAA4B;QAA5B,aAAQ,GAAR,QAAQ,CAAoB;IAAG,CAAC;IAE7D,KAAK,CAAC,IAAI,CAAC,GAAoB;QAC7B,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,QAAa,EAAE,IAAqB;IAC/D,OAAO,IAAI,UAAU,CAAC,QAA8B,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aACzB;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;KACF;IACD,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,oBAAoB,EAAE,IAAI;CAC3B,CAAC"}
@@ -1,48 +0,0 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "metadata": {
5
- "type": "object",
6
- "properties": {
7
- "name": {
8
- "type": "string"
9
- }
10
- },
11
- "required": ["name"]
12
- },
13
- "imports": {
14
- "type": "array",
15
- "items": {
16
- "type": "string"
17
- },
18
- "description": "Paths to other modules to import"
19
- },
20
- "definitions": {
21
- "type": "array",
22
- "items": {
23
- "type": "string"
24
- },
25
- "description": "Paths to ResourceDefinition files"
26
- },
27
- "resources": {
28
- "type": "array",
29
- "items": {
30
- "oneOf": [
31
- {
32
- "type": "string"
33
- },
34
- {
35
- "type": "object",
36
- "properties": {
37
- "path": {
38
- "type": "string"
39
- }
40
- }
41
- }
42
- ]
43
- },
44
- "description": "Paths to resource instance files to load"
45
- }
46
- },
47
- "required": ["metadata"]
48
- }
package/dist/loader.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { Loader as BaseLoader } from "@telorun/analyzer";
2
- import { ResourceManifest } from "@telorun/sdk";
3
- export declare class Loader extends BaseLoader {
4
- private static projectRoot;
5
- private readonly localAdapter;
6
- constructor();
7
- private static ensureProjectRoot;
8
- resolvePath(base: string, relative: string): string;
9
- /**
10
- * Resolve a path-or-URL to its canonical file source URL.
11
- * If the path refers to a directory, returns the URL of module.yaml inside it.
12
- */
13
- resolveEntryPoint(pathOrUrl: string): Promise<string>;
14
- loadDirectory(pathOrUrl: string): Promise<ResourceManifest[]>;
15
- loadManifest(pathOrUrl: string, baseUrl: string, compileContext?: Record<string, unknown>): Promise<ResourceManifest[]>;
16
- private orderResourcesByKindDependencies;
17
- }
18
- //# sourceMappingURL=loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,cAAc,CAAC;AAKjE,qBAAa,MAAO,SAAQ,UAAU;IACpC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAuB;IACjD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmB;;IAQhD,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAMhC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAInD;;;OAGG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrD,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAyB7D,YAAY,CAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,cAAc,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAC3C,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAW9B,OAAO,CAAC,gCAAgC;CA0DzC"}