@milaboratories/pl-model-backend 1.3.0 → 1.3.2

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.
@@ -1,25 +1,2 @@
1
- //#region src/capabilities.ts
2
- /**
3
- * Backend capability tokens advertised by pl in
4
- * `MaintenanceAPI.Ping.Response.capabilities` and required by compiled
5
- * templates via `TemplateDataV3.requiredCapabilities`.
6
- *
7
- * Single TypeScript source of truth shared across:
8
- * - `@platforma-sdk/tengo-builder` — populates the field at compile time
9
- * - `@platforma-sdk/block-tools` — copies it onto the published manifest
10
- * - `@milaboratories/pl-middle-layer` — checks it at install time
11
- *
12
- * Mirror of `pl/platform/api/plapiserver/server_capabilities.go` — keep
13
- * tokens in sync with the backend's advertised list. Format is
14
- * `<feature>:<version>`; bump the version when wire semantics change.
15
- */
16
- /**
17
- * Backend bundles a wasmtime-based WASI 0.2 / Component Model runtime.
18
- * Templates that reference wasm components via `assets.importWasm(...)`
19
- * require this capability.
20
- */
21
- const CapabilityWasm = "wasm:v1";
22
- //#endregion
23
- exports.CapabilityWasm = CapabilityWasm;
24
-
25
- //# sourceMappingURL=capabilities.cjs.map
1
+ require("./_virtual/_rolldown/runtime.cjs");
2
+ require("@milaboratories/pl-client");
@@ -1,24 +1,2 @@
1
- //#region src/capabilities.d.ts
2
- /**
3
- * Backend capability tokens advertised by pl in
4
- * `MaintenanceAPI.Ping.Response.capabilities` and required by compiled
5
- * templates via `TemplateDataV3.requiredCapabilities`.
6
- *
7
- * Single TypeScript source of truth shared across:
8
- * - `@platforma-sdk/tengo-builder` — populates the field at compile time
9
- * - `@platforma-sdk/block-tools` — copies it onto the published manifest
10
- * - `@milaboratories/pl-middle-layer` — checks it at install time
11
- *
12
- * Mirror of `pl/platform/api/plapiserver/server_capabilities.go` — keep
13
- * tokens in sync with the backend's advertised list. Format is
14
- * `<feature>:<version>`; bump the version when wire semantics change.
15
- */
16
- /**
17
- * Backend bundles a wasmtime-based WASI 0.2 / Component Model runtime.
18
- * Templates that reference wasm components via `assets.importWasm(...)`
19
- * require this capability.
20
- */
21
- declare const CapabilityWasm = "wasm:v1";
22
- //#endregion
23
- export { CapabilityWasm };
24
- //# sourceMappingURL=capabilities.d.ts.map
1
+ import { BackendCapability, hasCapability } from "@milaboratories/pl-client";
2
+ export { type BackendCapability, hasCapability };
@@ -1,25 +1,2 @@
1
- //#region src/capabilities.ts
2
- /**
3
- * Backend capability tokens advertised by pl in
4
- * `MaintenanceAPI.Ping.Response.capabilities` and required by compiled
5
- * templates via `TemplateDataV3.requiredCapabilities`.
6
- *
7
- * Single TypeScript source of truth shared across:
8
- * - `@platforma-sdk/tengo-builder` — populates the field at compile time
9
- * - `@platforma-sdk/block-tools` — copies it onto the published manifest
10
- * - `@milaboratories/pl-middle-layer` — checks it at install time
11
- *
12
- * Mirror of `pl/platform/api/plapiserver/server_capabilities.go` — keep
13
- * tokens in sync with the backend's advertised list. Format is
14
- * `<feature>:<version>`; bump the version when wire semantics change.
15
- */
16
- /**
17
- * Backend bundles a wasmtime-based WASI 0.2 / Component Model runtime.
18
- * Templates that reference wasm components via `assets.importWasm(...)`
19
- * require this capability.
20
- */
21
- const CapabilityWasm = "wasm:v1";
22
- //#endregion
23
- export { CapabilityWasm };
24
-
25
- //# sourceMappingURL=capabilities.js.map
1
+ import { hasCapability } from "@milaboratories/pl-client";
2
+ export { hasCapability };
package/dist/index.cjs CHANGED
@@ -1,8 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_capabilities = require("./capabilities.cjs");
2
+ require("./_virtual/_rolldown/runtime.cjs");
3
+ require("./capabilities.cjs");
3
4
  const require_serde = require("./serde.cjs");
4
5
  const require_template_resources_v1 = require("./template_resources_v1.cjs");
5
- exports.CapabilityWasm = require_capabilities.CapabilityWasm;
6
+ let _milaboratories_pl_client = require("@milaboratories/pl-client");
6
7
  Object.defineProperty(exports, "PlTemplateLibV1", {
7
8
  enumerable: true,
8
9
  get: function() {
@@ -27,5 +28,11 @@ Object.defineProperty(exports, "PlTemplateV1", {
27
28
  return require_template_resources_v1.PlTemplateV1;
28
29
  }
29
30
  });
31
+ Object.defineProperty(exports, "hasCapability", {
32
+ enumerable: true,
33
+ get: function() {
34
+ return _milaboratories_pl_client.hasCapability;
35
+ }
36
+ });
30
37
  exports.parseTemplate = require_serde.parseTemplate;
31
38
  exports.serializeTemplate = require_serde.serializeTemplate;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { CapabilityWasm } from "./capabilities.js";
1
+ import { BackendCapability, hasCapability } from "./capabilities.js";
2
2
  import { TemplateAssetData, TemplateData, TemplateLibData, TemplateSoftwareData } from "./template_data_v2.js";
3
3
  import { CompiledTemplateV3, TemplateAssetDataV3, TemplateDataV3, TemplateLibDataV3, TemplateSoftwareDataV3, TemplateWasmDataV3 } from "./template_data_v3.js";
4
4
  import { parseTemplate, serializeTemplate } from "./serde.js";
5
5
  import { PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1 } from "./template_resources_v1.js";
6
- export { CapabilityWasm, CompiledTemplateV3, PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1, TemplateAssetData, TemplateAssetDataV3, TemplateData, TemplateDataV3, TemplateLibData, TemplateLibDataV3, TemplateSoftwareData, TemplateSoftwareDataV3, TemplateWasmDataV3, parseTemplate, serializeTemplate };
6
+ export { BackendCapability, CompiledTemplateV3, PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1, TemplateAssetData, TemplateAssetDataV3, TemplateData, TemplateDataV3, TemplateLibData, TemplateLibDataV3, TemplateSoftwareData, TemplateSoftwareDataV3, TemplateWasmDataV3, hasCapability, parseTemplate, serializeTemplate };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { CapabilityWasm } from "./capabilities.js";
1
+ import { hasCapability } from "./capabilities.js";
2
2
  import { parseTemplate, serializeTemplate } from "./serde.js";
3
3
  import { PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1 } from "./template_resources_v1.js";
4
- export { CapabilityWasm, PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1, parseTemplate, serializeTemplate };
4
+ export { PlTemplateLibV1, PlTemplateOverrideV1, PlTemplateSoftwareV1, PlTemplateV1, hasCapability, parseTemplate, serializeTemplate };
@@ -1,3 +1,5 @@
1
+ import { BackendCapability } from "./capabilities.js";
2
+
1
3
  //#region src/template_data_v3.d.ts
2
4
  interface TemplateLibDataV3 {
3
5
  /** i.e. @milaboratory/some-package:lib1 */
@@ -59,8 +61,8 @@ interface TemplateDataV3 {
59
61
  * Backend capability tokens this template (and its transitively-imported
60
62
  * sub-templates) requires to run. Populated by `tengo-builder` at compile
61
63
  * time:
62
- * - `CapabilityWasm` ("wasm:v1") is added when a wasm artifact is
63
- * embedded (via `assets.importWasm`, directly or through a library).
64
+ * - `"wasm:v1"` is added when a wasm artifact is embedded (via
65
+ * `assets.importWasm`, directly or through a library).
64
66
  * - Child templates contribute their own `requiredCapabilities` —
65
67
  * unioned transitively, so the top template carries the full set.
66
68
  *
@@ -71,7 +73,7 @@ interface TemplateDataV3 {
71
73
  * advertises in `MaintenanceAPI.Ping.Response.capabilities` — see
72
74
  * `./capabilities.ts`.
73
75
  */
74
- requiredCapabilities?: string[];
76
+ requiredCapabilities?: BackendCapability[];
75
77
  }
76
78
  interface CompiledTemplateV3 {
77
79
  /** Discriminator for future use */
@@ -1 +1 @@
1
- {"version":3,"file":"template_data_v3.d.ts","names":[],"sources":["../src/template_data_v3.ts"],"mappings":";UAAiB,iBAAA;EAAA;EAEf,IAAA;;EAEA,OAAA;EAFA;EAIA,UAAA;AAAA;AAAA,UAGe,sBAAA;EAHL;EAKV,IAAA;EAFqC;EAIrC,OAAA;EAJqC;EAMrC,UAAA;AAAA;AAAA,UAGe,mBAAA;EAHL;EAKV,IAAA;EAFe;EA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BxC,IAAA,GAAO,MAAA,SAAe,kBAAA;EAnBtB;;;;;;;;;;;;;;;;EAqCA,oBAAA,GAAuB,iBAAA;AAAA;AAAA,UAGR,kBAAA;EAHyB;EAKxC,IAAA;EAFe;EAKf,YAAA,EAAc,MAAA;EAEd,QAAA,EAAU,cAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-model-backend",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Backend model for Platforma.bio",
5
5
  "files": [
6
6
  "./dist/**/*",
@@ -20,16 +20,16 @@
20
20
  "dependencies": {
21
21
  "canonicalize": "~2.1.0",
22
22
  "zod": "~3.25.76",
23
- "@milaboratories/pl-client": "3.7.0"
23
+ "@milaboratories/pl-client": "3.8.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "~24.5.2",
27
27
  "@vitest/coverage-istanbul": "^4.1.3",
28
28
  "typescript": "~5.9.3",
29
29
  "vitest": "^4.1.3",
30
+ "@milaboratories/ts-configs": "1.2.3",
30
31
  "@milaboratories/ts-builder": "1.5.0",
31
- "@milaboratories/build-configs": "2.0.0",
32
- "@milaboratories/ts-configs": "1.2.3"
32
+ "@milaboratories/build-configs": "2.0.0"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "ts-builder build --target node",
@@ -1,21 +1,4 @@
1
1
  /**
2
- * Backend capability tokens advertised by pl in
3
- * `MaintenanceAPI.Ping.Response.capabilities` and required by compiled
4
- * templates via `TemplateDataV3.requiredCapabilities`.
5
- *
6
- * Single TypeScript source of truth shared across:
7
- * - `@platforma-sdk/tengo-builder` — populates the field at compile time
8
- * - `@platforma-sdk/block-tools` — copies it onto the published manifest
9
- * - `@milaboratories/pl-middle-layer` — checks it at install time
10
- *
11
- * Mirror of `pl/platform/api/plapiserver/server_capabilities.go` — keep
12
- * tokens in sync with the backend's advertised list. Format is
13
- * `<feature>:<version>`; bump the version when wire semantics change.
2
+ * Re-export backend capability types for easier access.
14
3
  */
15
-
16
- /**
17
- * Backend bundles a wasmtime-based WASI 0.2 / Component Model runtime.
18
- * Templates that reference wasm components via `assets.importWasm(...)`
19
- * require this capability.
20
- */
21
- export const CapabilityWasm = "wasm:v1";
4
+ export { hasCapability, type BackendCapability } from "@milaboratories/pl-client";
@@ -1,3 +1,5 @@
1
+ import type { BackendCapability } from "./capabilities";
2
+
1
3
  export interface TemplateLibDataV3 {
2
4
  /** i.e. @milaboratory/some-package:lib1 */
3
5
  name: string;
@@ -66,8 +68,8 @@ export interface TemplateDataV3 {
66
68
  * Backend capability tokens this template (and its transitively-imported
67
69
  * sub-templates) requires to run. Populated by `tengo-builder` at compile
68
70
  * time:
69
- * - `CapabilityWasm` ("wasm:v1") is added when a wasm artifact is
70
- * embedded (via `assets.importWasm`, directly or through a library).
71
+ * - `"wasm:v1"` is added when a wasm artifact is embedded (via
72
+ * `assets.importWasm`, directly or through a library).
71
73
  * - Child templates contribute their own `requiredCapabilities` —
72
74
  * unioned transitively, so the top template carries the full set.
73
75
  *
@@ -78,7 +80,7 @@ export interface TemplateDataV3 {
78
80
  * advertises in `MaintenanceAPI.Ping.Response.capabilities` — see
79
81
  * `./capabilities.ts`.
80
82
  */
81
- requiredCapabilities?: string[];
83
+ requiredCapabilities?: BackendCapability[];
82
84
  }
83
85
 
84
86
  export interface CompiledTemplateV3 {
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.cjs","names":[],"sources":["../src/capabilities.ts"],"sourcesContent":["/**\n * Backend capability tokens advertised by pl in\n * `MaintenanceAPI.Ping.Response.capabilities` and required by compiled\n * templates via `TemplateDataV3.requiredCapabilities`.\n *\n * Single TypeScript source of truth shared across:\n * - `@platforma-sdk/tengo-builder` — populates the field at compile time\n * - `@platforma-sdk/block-tools` — copies it onto the published manifest\n * - `@milaboratories/pl-middle-layer` — checks it at install time\n *\n * Mirror of `pl/platform/api/plapiserver/server_capabilities.go` — keep\n * tokens in sync with the backend's advertised list. Format is\n * `<feature>:<version>`; bump the version when wire semantics change.\n */\n\n/**\n * Backend bundles a wasmtime-based WASI 0.2 / Component Model runtime.\n * Templates that reference wasm components via `assets.importWasm(...)`\n * require this capability.\n */\nexport const CapabilityWasm = \"wasm:v1\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,iBAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.d.ts","names":[],"sources":["../src/capabilities.ts"],"mappings":";;AAoBA;;;;;;;;;;;;;;;;;;cAAa,cAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.js","names":[],"sources":["../src/capabilities.ts"],"sourcesContent":["/**\n * Backend capability tokens advertised by pl in\n * `MaintenanceAPI.Ping.Response.capabilities` and required by compiled\n * templates via `TemplateDataV3.requiredCapabilities`.\n *\n * Single TypeScript source of truth shared across:\n * - `@platforma-sdk/tengo-builder` — populates the field at compile time\n * - `@platforma-sdk/block-tools` — copies it onto the published manifest\n * - `@milaboratories/pl-middle-layer` — checks it at install time\n *\n * Mirror of `pl/platform/api/plapiserver/server_capabilities.go` — keep\n * tokens in sync with the backend's advertised list. Format is\n * `<feature>:<version>`; bump the version when wire semantics change.\n */\n\n/**\n * Backend bundles a wasmtime-based WASI 0.2 / Component Model runtime.\n * Templates that reference wasm components via `assets.importWasm(...)`\n * require this capability.\n */\nexport const CapabilityWasm = \"wasm:v1\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,iBAAiB"}