@telorun/kernel 0.87.0 → 0.88.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.
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
export { InvokeStepSchema, isSchemaFragment, JsonSchema7Schema, KindSchemaSchema, MANIFEST_SCHEMA_URI, ManifestRootSchema, manifestFragmentRef, ResourceRefSchema, RetryPolicySchema, StepSchema, withSchemaFragments, } from "@telorun/analyzer";
|
|
2
2
|
export declare const ResourceDefinitionSchema: {
|
|
3
3
|
oneOf: ({
|
|
4
|
-
not: {
|
|
5
|
-
required: string[];
|
|
6
|
-
};
|
|
7
|
-
required: string[];
|
|
8
|
-
properties: {
|
|
9
|
-
capability: {
|
|
10
|
-
const: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
unevaluatedProperties?: undefined;
|
|
14
|
-
} | {
|
|
15
4
|
required: string[];
|
|
16
5
|
properties: {
|
|
6
|
+
throws?: boolean | undefined;
|
|
17
7
|
capability: {
|
|
18
8
|
const: string;
|
|
19
9
|
};
|
|
20
10
|
};
|
|
21
|
-
not?: undefined;
|
|
22
|
-
unevaluatedProperties?: undefined;
|
|
23
11
|
} | {
|
|
24
12
|
not: {
|
|
25
13
|
required: string[];
|
|
@@ -30,8 +18,6 @@ export declare const ResourceDefinitionSchema: {
|
|
|
30
18
|
};
|
|
31
19
|
};
|
|
32
20
|
unevaluatedProperties: boolean;
|
|
33
|
-
required?: undefined;
|
|
34
|
-
properties?: undefined;
|
|
35
21
|
})[];
|
|
36
22
|
type: string;
|
|
37
23
|
required: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-schemas.d.ts","sourceRoot":"","sources":["../src/manifest-schemas.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest-schemas.d.ts","sourceRoot":"","sources":["../src/manifest-schemas.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAoH3B,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBpC,CAAC;AAEF;;;;;kFAKkF;AAClF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAelC,CAAC;AAWF,UAAU,aAAa;IACrB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;CACvB;AAYD,eAAO,MAAM,0BAA0B,eAA0C,CAAC;AAClF,eAAO,MAAM,wBAAwB,eAAwC,CAAC;AAE9E;;2EAE2E;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/manifest-schemas.js
CHANGED
|
@@ -99,40 +99,39 @@ const KNOWN_CAPABILITIES = [
|
|
|
99
99
|
/** Rule 8: `throws:` is only meaningful on Telo.Invocable or Telo.Runnable.
|
|
100
100
|
* On Service/Mount/Provider/Type/etc. a thrown error is a boot-time failure,
|
|
101
101
|
* not a structured runtime error for a downstream caller, so declaring one
|
|
102
|
-
* is a schema error.
|
|
103
|
-
|
|
102
|
+
* is a schema error.
|
|
103
|
+
*
|
|
104
|
+
* Spelled as a `false` schema at the property rather than `not: {required}` so
|
|
105
|
+
* the failure NAMES THE KEY: AJV reports `not` at the document root with
|
|
106
|
+
* nothing about the inner schema, which left the whole union unable to say
|
|
107
|
+
* which key was at fault — and the reducer then preferred a branch whose
|
|
108
|
+
* `capability` const merely disagreed, reporting `/capability must be equal to
|
|
109
|
+
* constant` about a document whose capability was right and whose `throws:` was
|
|
110
|
+
* wrong. This form reports `/throws is not allowed here`. */
|
|
111
|
+
/** One capability's branch. `throws` and `capability` live in ONE `properties`
|
|
112
|
+
* map, built here — spreading a second object carrying `properties` silently
|
|
113
|
+
* REPLACES the capability constant, which turns every forbidding branch into
|
|
114
|
+
* "any definition with a capability and no throws" and makes the whole `oneOf`
|
|
115
|
+
* match several branches at once. */
|
|
116
|
+
const capabilityBranch = (capability, mayThrow) => ({
|
|
117
|
+
required: ["capability"],
|
|
118
|
+
properties: {
|
|
119
|
+
capability: { const: capability },
|
|
120
|
+
...(mayThrow ? {} : { throws: false }),
|
|
121
|
+
},
|
|
122
|
+
});
|
|
104
123
|
export const ResourceDefinitionSchema = {
|
|
105
124
|
...baseDefinition,
|
|
106
125
|
oneOf: [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
properties: { capability: { const: "Telo.Provider" } },
|
|
117
|
-
...forbidThrows,
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
required: ["capability"],
|
|
121
|
-
properties: { capability: { const: "Telo.Type" } },
|
|
122
|
-
...forbidThrows,
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
required: ["capability"],
|
|
126
|
-
properties: { capability: { const: "Telo.Mount" } },
|
|
127
|
-
...forbidThrows,
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
// A sink is written to directly, never dispatched, so a thrown error is a
|
|
131
|
-
// boot-time failure rather than a structured runtime error for a caller.
|
|
132
|
-
required: ["capability"],
|
|
133
|
-
properties: { capability: { const: "Telo.Sink" } },
|
|
134
|
-
...forbidThrows,
|
|
135
|
-
},
|
|
126
|
+
capabilityBranch("Telo.Service", false),
|
|
127
|
+
capabilityBranch("Telo.Runnable", true),
|
|
128
|
+
capabilityBranch("Telo.Invocable", true),
|
|
129
|
+
capabilityBranch("Telo.Provider", false),
|
|
130
|
+
capabilityBranch("Telo.Type", false),
|
|
131
|
+
capabilityBranch("Telo.Mount", false),
|
|
132
|
+
// A sink is written to directly, never dispatched, so a thrown error is a
|
|
133
|
+
// boot-time failure rather than a structured runtime error for a caller.
|
|
134
|
+
capabilityBranch("Telo.Sink", false),
|
|
136
135
|
// Unknown/absent capability: open schema for third-party extensibility
|
|
137
136
|
{
|
|
138
137
|
not: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-schemas.js","sourceRoot":"","sources":["../src/manifest-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,KAAK,CAAC;AAC5B,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,0EAA0E;AAC1E,2EAA2E;AAC3E,+EAA+E;AAC/E,iEAAiE;AACjE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAChF,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC;AAE3C,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,gFAAgF;AAChF,gEAAgE;AAChE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,UAAU,EAAE;QAC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oBAAoB,CAAC,GAAG,CAAC,CAAC;AAC1B,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAWxB,SAAS,aAAa,CAAC,MAAc;IACnC,IAAI,QAAoD,CAAC;IACzD,MAAM,EAAE,GAAkB,CAAC,IAAa,EAAE,EAAE;QAC1C,IAAI,CAAC,QAAQ;YAAE,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1B,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAkC,CAAC;QACxD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IACF,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC,wBAAwB,CAAC,CAAC;AAClF,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC,sBAAsB,CAAC,CAAC;AAE9E;;2EAE2E;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/kernel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"description": "Telo Runtime - A lightweight, polyglot execution host.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@marcbachmann/cel-js": "^7.6.1",
|
|
63
63
|
"@sinclair/typebox": "^0.34.48",
|
|
64
|
-
"@telorun/analyzer": "0.
|
|
64
|
+
"@telorun/analyzer": "0.72.0",
|
|
65
65
|
"@telorun/glob": "0.2.0",
|
|
66
|
-
"@telorun/templating": "0.
|
|
66
|
+
"@telorun/templating": "0.19.0",
|
|
67
67
|
"ajv": "^8.17.1",
|
|
68
68
|
"ajv-formats": "^3.0.1",
|
|
69
69
|
"packageurl-js": "^2.0.1",
|
package/src/manifest-schemas.ts
CHANGED
|
@@ -118,41 +118,40 @@ const KNOWN_CAPABILITIES = [
|
|
|
118
118
|
/** Rule 8: `throws:` is only meaningful on Telo.Invocable or Telo.Runnable.
|
|
119
119
|
* On Service/Mount/Provider/Type/etc. a thrown error is a boot-time failure,
|
|
120
120
|
* not a structured runtime error for a downstream caller, so declaring one
|
|
121
|
-
* is a schema error.
|
|
122
|
-
|
|
121
|
+
* is a schema error.
|
|
122
|
+
*
|
|
123
|
+
* Spelled as a `false` schema at the property rather than `not: {required}` so
|
|
124
|
+
* the failure NAMES THE KEY: AJV reports `not` at the document root with
|
|
125
|
+
* nothing about the inner schema, which left the whole union unable to say
|
|
126
|
+
* which key was at fault — and the reducer then preferred a branch whose
|
|
127
|
+
* `capability` const merely disagreed, reporting `/capability must be equal to
|
|
128
|
+
* constant` about a document whose capability was right and whose `throws:` was
|
|
129
|
+
* wrong. This form reports `/throws is not allowed here`. */
|
|
130
|
+
/** One capability's branch. `throws` and `capability` live in ONE `properties`
|
|
131
|
+
* map, built here — spreading a second object carrying `properties` silently
|
|
132
|
+
* REPLACES the capability constant, which turns every forbidding branch into
|
|
133
|
+
* "any definition with a capability and no throws" and makes the whole `oneOf`
|
|
134
|
+
* match several branches at once. */
|
|
135
|
+
const capabilityBranch = (capability: string, mayThrow: boolean) => ({
|
|
136
|
+
required: ["capability"],
|
|
137
|
+
properties: {
|
|
138
|
+
capability: { const: capability },
|
|
139
|
+
...(mayThrow ? {} : { throws: false }),
|
|
140
|
+
},
|
|
141
|
+
});
|
|
123
142
|
|
|
124
143
|
export const ResourceDefinitionSchema = {
|
|
125
144
|
...baseDefinition,
|
|
126
145
|
oneOf: [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
properties: { capability: { const: "Telo.Provider" } },
|
|
137
|
-
...forbidThrows,
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
required: ["capability"],
|
|
141
|
-
properties: { capability: { const: "Telo.Type" } },
|
|
142
|
-
...forbidThrows,
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
required: ["capability"],
|
|
146
|
-
properties: { capability: { const: "Telo.Mount" } },
|
|
147
|
-
...forbidThrows,
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
// A sink is written to directly, never dispatched, so a thrown error is a
|
|
151
|
-
// boot-time failure rather than a structured runtime error for a caller.
|
|
152
|
-
required: ["capability"],
|
|
153
|
-
properties: { capability: { const: "Telo.Sink" } },
|
|
154
|
-
...forbidThrows,
|
|
155
|
-
},
|
|
146
|
+
capabilityBranch("Telo.Service", false),
|
|
147
|
+
capabilityBranch("Telo.Runnable", true),
|
|
148
|
+
capabilityBranch("Telo.Invocable", true),
|
|
149
|
+
capabilityBranch("Telo.Provider", false),
|
|
150
|
+
capabilityBranch("Telo.Type", false),
|
|
151
|
+
capabilityBranch("Telo.Mount", false),
|
|
152
|
+
// A sink is written to directly, never dispatched, so a thrown error is a
|
|
153
|
+
// boot-time failure rather than a structured runtime error for a caller.
|
|
154
|
+
capabilityBranch("Telo.Sink", false),
|
|
156
155
|
// Unknown/absent capability: open schema for third-party extensibility
|
|
157
156
|
{
|
|
158
157
|
not: {
|