@telorun/kernel 0.15.0 → 0.16.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 (127) hide show
  1. package/dist/controllers/module/import-controller.d.ts.map +1 -1
  2. package/dist/controllers/module/import-controller.js +50 -8
  3. package/dist/controllers/module/import-controller.js.map +1 -1
  4. package/dist/evaluation-context.d.ts +7 -0
  5. package/dist/evaluation-context.d.ts.map +1 -1
  6. package/dist/evaluation-context.js +24 -3
  7. package/dist/evaluation-context.js.map +1 -1
  8. package/dist/kernel.d.ts.map +1 -1
  9. package/dist/kernel.js +21 -4
  10. package/dist/kernel.js.map +1 -1
  11. package/dist/module-context.d.ts +25 -1
  12. package/dist/module-context.d.ts.map +1 -1
  13. package/dist/module-context.js +47 -2
  14. package/dist/module-context.js.map +1 -1
  15. package/dist/resource-context.d.ts +2 -0
  16. package/dist/resource-context.d.ts.map +1 -1
  17. package/dist/resource-context.js +19 -1
  18. package/dist/resource-context.js.map +1 -1
  19. package/package.json +6 -5
  20. package/src/controllers/module/import-controller.ts +66 -17
  21. package/src/evaluation-context.ts +30 -5
  22. package/src/kernel.ts +31 -6
  23. package/src/module-context.ts +62 -2
  24. package/src/resource-context.ts +27 -2
  25. package/dist/base-definition.d.ts +0 -14
  26. package/dist/base-definition.d.ts.map +0 -1
  27. package/dist/base-definition.js +0 -17
  28. package/dist/base-definition.js.map +0 -1
  29. package/dist/capabilities/capabilities/component.yaml +0 -4
  30. package/dist/capabilities/capabilities/executable.yaml +0 -8
  31. package/dist/capabilities/capabilities/handler.yaml +0 -4
  32. package/dist/capabilities/capabilities/listener.yaml +0 -4
  33. package/dist/capabilities/capabilities/provider.yaml +0 -4
  34. package/dist/capabilities/capabilities/template.yaml +0 -4
  35. package/dist/capabilities/capabilities/type.yaml +0 -4
  36. package/dist/capabilities/component.d.ts +0 -3
  37. package/dist/capabilities/component.d.ts.map +0 -1
  38. package/dist/capabilities/component.js +0 -4
  39. package/dist/capabilities/component.js.map +0 -1
  40. package/dist/capabilities/component.yaml +0 -3
  41. package/dist/capabilities/executable.d.ts +0 -3
  42. package/dist/capabilities/executable.d.ts.map +0 -1
  43. package/dist/capabilities/executable.js +0 -5
  44. package/dist/capabilities/executable.js.map +0 -1
  45. package/dist/capabilities/executable.yaml +0 -7
  46. package/dist/capabilities/handler.d.ts +0 -3
  47. package/dist/capabilities/handler.d.ts.map +0 -1
  48. package/dist/capabilities/handler.js +0 -4
  49. package/dist/capabilities/handler.js.map +0 -1
  50. package/dist/capabilities/handler.yaml +0 -3
  51. package/dist/capabilities/invokable.d.ts +0 -3
  52. package/dist/capabilities/invokable.d.ts.map +0 -1
  53. package/dist/capabilities/invokable.js +0 -5
  54. package/dist/capabilities/invokable.js.map +0 -1
  55. package/dist/capabilities/listener.d.ts +0 -3
  56. package/dist/capabilities/listener.d.ts.map +0 -1
  57. package/dist/capabilities/listener.js +0 -5
  58. package/dist/capabilities/listener.js.map +0 -1
  59. package/dist/capabilities/listener.yaml +0 -3
  60. package/dist/capabilities/mount.d.ts +0 -3
  61. package/dist/capabilities/mount.d.ts.map +0 -1
  62. package/dist/capabilities/mount.js +0 -5
  63. package/dist/capabilities/mount.js.map +0 -1
  64. package/dist/capabilities/provider.d.ts +0 -3
  65. package/dist/capabilities/provider.d.ts.map +0 -1
  66. package/dist/capabilities/provider.js +0 -8
  67. package/dist/capabilities/provider.js.map +0 -1
  68. package/dist/capabilities/provider.yaml +0 -3
  69. package/dist/capabilities/runnable.d.ts +0 -3
  70. package/dist/capabilities/runnable.d.ts.map +0 -1
  71. package/dist/capabilities/runnable.js +0 -5
  72. package/dist/capabilities/runnable.js.map +0 -1
  73. package/dist/capabilities/service.d.ts +0 -3
  74. package/dist/capabilities/service.d.ts.map +0 -1
  75. package/dist/capabilities/service.js +0 -5
  76. package/dist/capabilities/service.js.map +0 -1
  77. package/dist/capabilities/template.d.ts +0 -3
  78. package/dist/capabilities/template.d.ts.map +0 -1
  79. package/dist/capabilities/template.js +0 -5
  80. package/dist/capabilities/template.js.map +0 -1
  81. package/dist/capabilities/template.yaml +0 -3
  82. package/dist/capabilities/type.d.ts +0 -3
  83. package/dist/capabilities/type.d.ts.map +0 -1
  84. package/dist/capabilities/type.js +0 -5
  85. package/dist/capabilities/type.js.map +0 -1
  86. package/dist/capabilities/type.yaml +0 -3
  87. package/dist/controllers/capability/capability-controller.d.ts +0 -32
  88. package/dist/controllers/capability/capability-controller.d.ts.map +0 -1
  89. package/dist/controllers/capability/capability-controller.js +0 -26
  90. package/dist/controllers/capability/capability-controller.js.map +0 -1
  91. package/dist/controllers/module/module.json +0 -48
  92. package/dist/loader.d.ts +0 -18
  93. package/dist/loader.d.ts.map +0 -1
  94. package/dist/loader.js +0 -127
  95. package/dist/loader.js.map +0 -1
  96. package/dist/manifest-adapters/http-adapter.d.ts +0 -8
  97. package/dist/manifest-adapters/http-adapter.d.ts.map +0 -1
  98. package/dist/manifest-adapters/http-adapter.js +0 -31
  99. package/dist/manifest-adapters/http-adapter.js.map +0 -1
  100. package/dist/manifest-adapters/local-file-adapter.d.ts +0 -15
  101. package/dist/manifest-adapters/local-file-adapter.d.ts.map +0 -1
  102. package/dist/manifest-adapters/local-file-adapter.js +0 -95
  103. package/dist/manifest-adapters/local-file-adapter.js.map +0 -1
  104. package/dist/manifest-adapters/manifest-adapter.d.ts +0 -35
  105. package/dist/manifest-adapters/manifest-adapter.d.ts.map +0 -1
  106. package/dist/manifest-adapters/manifest-adapter.js +0 -2
  107. package/dist/manifest-adapters/manifest-adapter.js.map +0 -1
  108. package/dist/manifest-adapters/registry-adapter.d.ts +0 -9
  109. package/dist/manifest-adapters/registry-adapter.d.ts.map +0 -1
  110. package/dist/manifest-adapters/registry-adapter.js +0 -48
  111. package/dist/manifest-adapters/registry-adapter.js.map +0 -1
  112. package/dist/module-context-registry.d.ts +0 -48
  113. package/dist/module-context-registry.d.ts.map +0 -1
  114. package/dist/module-context-registry.js +0 -91
  115. package/dist/module-context-registry.js.map +0 -1
  116. package/dist/schema-valiator.d.ts +0 -15
  117. package/dist/schema-valiator.d.ts.map +0 -1
  118. package/dist/schema-valiator.js +0 -127
  119. package/dist/schema-valiator.js.map +0 -1
  120. package/dist/snapshot-serializer.d.ts +0 -62
  121. package/dist/snapshot-serializer.d.ts.map +0 -1
  122. package/dist/snapshot-serializer.js +0 -164
  123. package/dist/snapshot-serializer.js.map +0 -1
  124. package/dist/types.d.ts +0 -65
  125. package/dist/types.d.ts.map +0 -1
  126. package/dist/types.js +0 -8
  127. package/dist/types.js.map +0 -1
@@ -161,6 +161,10 @@ export class ResourceContextImpl implements ResourceContext {
161
161
  return this.moduleContext.invokeResolved(kind, name, instance, inputs);
162
162
  }
163
163
 
164
+ resolveImportedInstance(alias: string, name: string): ResourceInstance | undefined {
165
+ return this.moduleContext.resolveImportedInstance(alias, name);
166
+ }
167
+
164
168
  async run(name: string) {
165
169
  await this.moduleContext.run(name);
166
170
  }
@@ -195,7 +199,10 @@ export class ResourceContextImpl implements ResourceContext {
195
199
  * @returns Normalized {kind, name} reference
196
200
  * @throws RuntimeError if 'kind' is missing
197
201
  */
198
- resolveChildren(resource: any, resourceName?: string): { kind: string; name: string } {
202
+ resolveChildren(
203
+ resource: any,
204
+ resourceName?: string,
205
+ ): { kind: string; name: string; alias?: string } {
199
206
  if (!resource || typeof resource !== "object") {
200
207
  throw new RuntimeError(
201
208
  "ERR_INVALID_VALUE",
@@ -217,7 +224,25 @@ export class ResourceContextImpl implements ResourceContext {
217
224
  // this rescue — schemas exercising those hidden slots must use the
218
225
  // legacy string or `{kind, name}` forms for now.
219
226
  if (isRefSentinel(resource)) {
220
- const refName = resource.source;
227
+ const source = resource.source;
228
+ const dot = source.indexOf(".");
229
+ const alias = dot > 0 ? source.slice(0, dot) : undefined;
230
+ // Cross-module exported instance (`!ref Alias.name`) — resolve the {kind, name} ref
231
+ // from the import's exported scope and reattach the alias so downstream scope
232
+ // resolution (executeInvokeStep → ScopeContext.getInstance) routes into the import's
233
+ // child context rather than scope-local resources.
234
+ if (alias && alias !== "Self") {
235
+ const name = source.slice(dot + 1);
236
+ const ref = this.moduleContext.resolveImportedRef(alias, name);
237
+ if (!ref) {
238
+ throw new RuntimeError(
239
+ "ERR_RESOURCE_NOT_FOUND",
240
+ `[${this.metadata.name}] !ref '${source}' is not an exported instance of import '${alias}'.`,
241
+ );
242
+ }
243
+ return { kind: ref.kind, name: ref.name, alias };
244
+ }
245
+ const refName = alias === "Self" ? source.slice(dot + 1) : source;
221
246
  const entry = this.moduleContext.resourceInstances.get(refName);
222
247
  if (!entry) {
223
248
  throw new RuntimeError(
@@ -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"}