@owlmeans/viable-common 0.0.32 → 0.0.33
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 +3 -3
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/agent-presentation/SKILL.md +1 -1
- package/agent-meta/skills/viable-common/SKILL.md +28 -7
- package/build/blueprint/case.js +3 -3
- package/build/connect/errors.d.ts +23 -0
- package/build/connect/errors.d.ts.map +1 -1
- package/build/connect/errors.js +50 -0
- package/build/connect/errors.js.map +1 -1
- package/build/skills/catalogue.d.ts.map +1 -1
- package/build/skills/catalogue.js +15 -1
- package/build/skills/catalogue.js.map +1 -1
- package/package.json +7 -7
- package/src/blueprint/case.ts +3 -3
- package/src/connect/errors.ts +55 -0
- package/src/skills/catalogue.ts +15 -1
- package/tests/connect-errors.spec.ts +31 -1
- package/tests/error-status.spec.ts +6 -1
- package/tests/skills.spec.ts +15 -0
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ filesystem, no inference SDK. It is safe to import from a browser bundle.
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
bun add @owlmeans/viable-common@^0.0.
|
|
24
|
+
bun add @owlmeans/viable-common@^0.0.33
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Rules worth knowing before you change something
|
|
@@ -39,7 +39,7 @@ means "inherit" has no other spelling. `tests/convert.spec.ts` walks every expor
|
|
|
39
39
|
both faults, and for draft-04 tuple `items`.
|
|
40
40
|
|
|
41
41
|
**A field that crosses a version skew carries no `enum`.** A connector is installed with
|
|
42
|
-
`npx -y @owlmeans/viable-mcp@^0.1.18-rc.
|
|
42
|
+
`npx -y @owlmeans/viable-mcp@^0.1.18-rc.30` and talks to a separately deployed platform, so an executor kind it
|
|
43
43
|
sends must remain an unused capability on an older platform rather than a refused session.
|
|
44
44
|
|
|
45
45
|
**A ceiling exists once.** The inquiry answer cap here equals `DEFAULT_INQUIRY_ANSWER_CHARS` in
|
|
@@ -59,7 +59,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
59
59
|
your project's skill store (`.agents/skills/`):
|
|
60
60
|
|
|
61
61
|
```sh
|
|
62
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
62
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.38
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/viable-common",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.0.33",
|
|
5
|
+
"generatedAt": "2026-09-23T19:57:40.697Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -6,7 +6,7 @@ description: Shared, runtime-free taxonomy for presenting OwlMeans Viable agent
|
|
|
6
6
|
|
|
7
7
|
# Agent output presentation
|
|
8
8
|
|
|
9
|
-
**Install:** `"@owlmeans/viable-common": "^0.0.
|
|
9
|
+
**Install:** `"@owlmeans/viable-common": "^0.0.33"` in `dependencies`
|
|
10
10
|
|
|
11
11
|
`@owlmeans/viable-common`'s `agent/presentation.ts` owns the browser-safe vocabulary for agent
|
|
12
12
|
output. Keep the server and every client on `classifyAgentMessage()`; consumers may refine a
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/viable-common
|
|
9
9
|
|
|
10
10
|
**Layer:** Cross-cutting domain (contracts only)
|
|
11
|
-
**Install:** `"@owlmeans/viable-common": "^0.0.
|
|
11
|
+
**Install:** `"@owlmeans/viable-common": "^0.0.33"` in `dependencies`
|
|
12
12
|
**Subpaths:** `.` · `./slot` · `./connect` · `./convert` · `./integrity`
|
|
13
13
|
**Runtime-free:** no `@langchain/*`, no filesystem, no Ajv at run time (a devDependency, for the
|
|
14
14
|
tests that compile the schemas). It depends on `@owlmeans/planning`, `@owlmeans/resource`,
|
|
@@ -253,7 +253,7 @@ code, never as `minItems`/`maxItems`. The descriptions are what the planning mod
|
|
|
253
253
|
state each field's purpose and bounds; `gate.target` is filled by code and described as such.
|
|
254
254
|
|
|
255
255
|
**A field that crosses a version skew carries no `enum`.** Users run
|
|
256
|
-
`npx -y @owlmeans/viable-mcp@^0.1.18-rc.
|
|
256
|
+
`npx -y @owlmeans/viable-mcp@^0.1.18-rc.30` (the moving prerelease tag) against a separately deployed
|
|
257
257
|
platform, so `ConnectCapabilitiesSchema.executors.items`
|
|
258
258
|
is a bare string: a newer executor kind must stay an unused capability on an older platform, never
|
|
259
259
|
a refused session. Apply the same reasoning to anything else a newer connector may send an older
|
|
@@ -353,6 +353,14 @@ full-scale screen that reads and clears it. Every `ViableSkill` member has a bod
|
|
|
353
353
|
`SKILL_ORDER`: the prompt service skips an alias it cannot resolve, so a missing body is a rule no
|
|
354
354
|
model ever receives.
|
|
355
355
|
|
|
356
|
+
`OwlMeansServer` and `FixerHeuristics` teach one rule from both ends: the PROTOCOL decides a
|
|
357
|
+
handler's types. A handler's parameter and return types are exactly what its declaration in the
|
|
358
|
+
target's shared entrypoints module names, imported from the shared package — never an input or
|
|
359
|
+
record type declared in the api or backend package, which the shared package cannot import. The
|
|
360
|
+
example handler therefore takes the shared `Task`, never an invented `…Payload`/`…Input` type
|
|
361
|
+
(an example wins over the rule beside it), and a `TS2345` function-vs-function mismatch at a binding
|
|
362
|
+
line is repaired in the HANDLER, never by bending the declaration toward it.
|
|
363
|
+
|
|
356
364
|
## Closed sets that mean something
|
|
357
365
|
|
|
358
366
|
- **`ProjectArea`** — guest `/`, user `/frontoffice`, admin `/admin`, operator `/backoffice`. A
|
|
@@ -367,7 +375,7 @@ model ever receives.
|
|
|
367
375
|
send, and no role but `Common` may resolve to the `common` directory.
|
|
368
376
|
- **`ConversionStage`** — advanced only through `stageAfter` / `canEnter` / `decisionFor`. A stage
|
|
369
377
|
transition computed at a call site is how a conversion re-enters a stage it already paid for.
|
|
370
|
-
- **`ModerationCategory`** — a wire contract with
|
|
378
|
+
- **`ModerationCategory`** — a wire contract with eight languages of wording behind it. A fifth
|
|
371
379
|
shape is PHRASED into one of the four, never added.
|
|
372
380
|
|
|
373
381
|
## The conversion vocabulary is shared with three executors that walk the same tree
|
|
@@ -404,8 +412,18 @@ actually gave. Never introduce a local cap; import the one that exists.
|
|
|
404
412
|
## Errors: declared here, phrased where they are read
|
|
405
413
|
|
|
406
414
|
`ConnectError` and its family (`ConnectSessionNotFound`, `ConnectSessionGone`, `ConnectOpTimeout`,
|
|
407
|
-
`ConnectOpRefused`, `LocalSlotUnsupported`, `ConnectOpUnknown
|
|
408
|
-
markers under `viable-connect:`.
|
|
415
|
+
`ConnectOpRefused`, `LocalSlotUnsupported`, `ConnectOpUnknown`, `ConnectOutOfCredits`,
|
|
416
|
+
`ConnectConsentRequired`) are `ResilientError` classes with markers under `viable-connect:`. The two
|
|
417
|
+
refusals a connector turns into words for a person pack their fields into the message (only `type`
|
|
418
|
+
and `message` survive a marshal) and rebuild them in `finalizeUnmarshal()`: `ConnectOutOfCredits`
|
|
419
|
+
`out-of-credits:<gate>:<requiredUsd>:<balanceUsd>:<encodeURIComponent(topUpUrl)>` →
|
|
420
|
+
`gate`, `requiredUsd`, `balanceUsd`, `topUpUrl`; `ConnectConsentRequired`
|
|
421
|
+
`consent-required:<gate>:<deadline epoch ms | 0>:<encodeURIComponent(consentUrl)>` → `gate`,
|
|
422
|
+
`deadline?` (the latest withdrawal deadline waiting for consent; `0` = unknown), `consentUrl` —
|
|
423
|
+
build either with its `static encode(...)`. The deadline is epoch milliseconds and the URL goes
|
|
424
|
+
last because an ISO date and a URL both contain colons. `ConnectConsentRequired` is the connector's
|
|
425
|
+
face of the EU spend consent (`@owlmeans/payment` `PerformanceConsentRequired` on the web): only a
|
|
426
|
+
PERSON can give it, in the browser at `consentUrl`. `ConnectSessionGone` is registered FATAL on the agent side: a run
|
|
409
427
|
whose executor has gone away must stop at once rather than spend a retry ladder, and the step fails
|
|
410
428
|
as an OUTCOME so the run row records where it stopped and `pipeline.resume` picks it up when a
|
|
411
429
|
connector returns.
|
|
@@ -424,6 +442,7 @@ Every refusal here declares its HTTP status on its leaf class (the `error` skill
|
|
|
424
442
|
| Status | Classes |
|
|
425
443
|
|---|---|
|
|
426
444
|
| 402 | `ConnectOutOfCredits` |
|
|
445
|
+
| 428 | `ConnectConsentRequired` (a precondition only a person can meet) |
|
|
427
446
|
| 404 | `ProjectNotFound`, `ProjectStoryNotFound`, `ConnectSessionNotFound`, `ConnectOpUnknown` |
|
|
428
447
|
| 409 | `ProjectAgentOccupied`, `ProjectStoryMissconfigured`, `ConnectSessionGone` (no connector attached), `LocalSlotUnsupported` (the project's target) |
|
|
429
448
|
| 422 | `ConnectOpRefused` (the connector refused the operation) |
|
|
@@ -446,7 +465,8 @@ refusals' type names surviving a marshal), `scaffold.spec.ts` (an old-shape and
|
|
|
446
465
|
both passing the schema and the `scaffold` slot, `null` optionals accepted, no `minItems`),
|
|
447
466
|
`blueprint.spec.ts` (each case's gate preference, the default, and the persona-skill unions),
|
|
448
467
|
`branding.spec.ts` (the build env and the metadata vocabulary), `skills.spec.ts` (every skill has a
|
|
449
|
-
body and a weight, the handler wrap-once teaching,
|
|
468
|
+
body and a weight, the handler wrap-once teaching, handler types taken from the protocol and the
|
|
469
|
+
mismatch repaired in the handler, the house style and the landing-gate skill),
|
|
450
470
|
`connect-entrypoints.spec.ts` (the tree's protocol count, no story route, the job-id round trip,
|
|
451
471
|
the branding routes and their save body),
|
|
452
472
|
`convert.spec.ts` (the three structural walks over the barrel, the
|
|
@@ -457,7 +477,8 @@ gate; capabilities accepting an executor kind this platform has never heard of;
|
|
|
457
477
|
resume bodies), `design.spec.ts` (the design aggregate, staleness ranking, and the design schema
|
|
458
478
|
refusing an undeclared field or an area outside the closed set, and `userStoryOfDesign`),
|
|
459
479
|
`error-status.spec.ts` (every exported refusal's declared status, and its class and status after a
|
|
460
|
-
marshal round trip).
|
|
480
|
+
marshal round trip), `connect-errors.spec.ts` (the packed fields of `ConnectOutOfCredits` and
|
|
481
|
+
`ConnectConsentRequired` fresh and after a round trip, an unknown deadline as `0`).
|
|
461
482
|
|
|
462
483
|
## Depends On
|
|
463
484
|
|
package/build/blueprint/case.js
CHANGED
|
@@ -46,8 +46,8 @@ export var GameKind;
|
|
|
46
46
|
/** What every AI case installs. The langchain peers are declared here, at ONE range. */
|
|
47
47
|
const AI_DEPS = {
|
|
48
48
|
[SubProject.Backend]: {
|
|
49
|
-
'@owlmeans/llm': '^0.1.18-rc.
|
|
50
|
-
'@owlmeans/agent': '^0.1.18-rc.
|
|
49
|
+
'@owlmeans/llm': '^0.1.18-rc.37',
|
|
50
|
+
'@owlmeans/agent': '^0.1.18-rc.38',
|
|
51
51
|
'@langchain/core': '^1.2.9',
|
|
52
52
|
'@langchain/anthropic': '^1.5.8',
|
|
53
53
|
'@langchain/openai': '^1.5.10',
|
|
@@ -230,7 +230,7 @@ in advance.
|
|
|
230
230
|
deps: {
|
|
231
231
|
[SubProject.Backend]: {
|
|
232
232
|
...AI_DEPS[SubProject.Backend],
|
|
233
|
-
'@owlmeans/agent-skills': '^0.1.18-rc.
|
|
233
|
+
'@owlmeans/agent-skills': '^0.1.18-rc.38',
|
|
234
234
|
},
|
|
235
235
|
},
|
|
236
236
|
libraries: AI_LIBRARIES,
|
|
@@ -79,4 +79,27 @@ export declare class ConnectOutOfCredits extends ConnectError {
|
|
|
79
79
|
private applyFields;
|
|
80
80
|
finalizeUnmarshal(): void;
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* The action would spend credits bought less than 14 days ago under EU consumer rules, and a person
|
|
84
|
+
* has not yet expressly asked the platform to start using them (the purchase can still be
|
|
85
|
+
* withdrawn from). Only a person can give that request — in the browser, at `consentUrl`.
|
|
86
|
+
*
|
|
87
|
+
* Packed like `ConnectOutOfCredits`, because only `type` and `message` survive a marshal:
|
|
88
|
+
* `consent-required:<gate>:<deadline epoch ms | 0>:<encodeURIComponent(consentUrl)>`. The deadline
|
|
89
|
+
* is epoch milliseconds and the URL goes last, because an ISO date and a URL both contain colons.
|
|
90
|
+
*/
|
|
91
|
+
export declare class ConnectConsentRequired extends ConnectError {
|
|
92
|
+
static typeName: string;
|
|
93
|
+
/** A precondition only a person can meet, not a fault: answered 428. */
|
|
94
|
+
static httpStatus: number;
|
|
95
|
+
gate: string;
|
|
96
|
+
/** The latest withdrawal deadline of the purchases waiting for consent, when known. */
|
|
97
|
+
deadline?: Date;
|
|
98
|
+
consentUrl: string;
|
|
99
|
+
/** Build the packed message a caller passes to the constructor. */
|
|
100
|
+
static encode(gate: string, consentUrl: string, deadline?: Date | null): string;
|
|
101
|
+
constructor(message?: string);
|
|
102
|
+
private applyFields;
|
|
103
|
+
finalizeUnmarshal(): void;
|
|
104
|
+
}
|
|
82
105
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/connect/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,qBAAa,YAAa,SAAQ,cAAc;IAC9C,OAAuB,QAAQ,SAA4C;IAE3E,YAAY,OAAO,GAAE,MAAgB,EAEpC;CACF;AAED,iEAAiE;AACjE,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,OAAuB,QAAQ,SAA4C;IAC3E,0EAA0E;IAC1E,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;IAClD,OAAuB,QAAQ,SAAwC;IACvE,2DAA2D;IAC3D,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;C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AE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7F;IAED,YAAY,OAAO,GAAE,MAAgB,EAIpC;IAED,OAAO,CAAC,WAAW;IAWV,iBAAiB,IAAI,IAAI,CAEjC;CACF;AAED;;;;;;;;GAQG;AACH,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,OAAuB,QAAQ,SAA4C;IAC3E,wEAAwE;IACxE,OAAc,UAAU,SAAM;IAEvB,IAAI,SAAK;IAChB,uFAAuF;IAChF,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,UAAU,SAAK;IAEtB,mEAAmE;IACnE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,CAI9E;IAED,YAAY,OAAO,GAAE,MAAgB,EAIpC;IAED,OAAO,CAAC,WAAW;IAiBV,iBAAiB,IAAI,IAAI,CAEjC;CACF"}
|
package/build/connect/errors.js
CHANGED
|
@@ -117,6 +117,55 @@ export class ConnectOutOfCredits extends ConnectError {
|
|
|
117
117
|
this.applyFields();
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* The action would spend credits bought less than 14 days ago under EU consumer rules, and a person
|
|
122
|
+
* has not yet expressly asked the platform to start using them (the purchase can still be
|
|
123
|
+
* withdrawn from). Only a person can give that request — in the browser, at `consentUrl`.
|
|
124
|
+
*
|
|
125
|
+
* Packed like `ConnectOutOfCredits`, because only `type` and `message` survive a marshal:
|
|
126
|
+
* `consent-required:<gate>:<deadline epoch ms | 0>:<encodeURIComponent(consentUrl)>`. The deadline
|
|
127
|
+
* is epoch milliseconds and the URL goes last, because an ISO date and a URL both contain colons.
|
|
128
|
+
*/
|
|
129
|
+
export class ConnectConsentRequired extends ConnectError {
|
|
130
|
+
static typeName = `ConsentRequired${ConnectError.typeName}`;
|
|
131
|
+
/** A precondition only a person can meet, not a fault: answered 428. */
|
|
132
|
+
static httpStatus = 428;
|
|
133
|
+
gate = '';
|
|
134
|
+
/** The latest withdrawal deadline of the purchases waiting for consent, when known. */
|
|
135
|
+
deadline;
|
|
136
|
+
consentUrl = '';
|
|
137
|
+
/** Build the packed message a caller passes to the constructor. */
|
|
138
|
+
static encode(gate, consentUrl, deadline) {
|
|
139
|
+
const at = deadline != null && !Number.isNaN(deadline.getTime()) ? deadline.getTime() : 0;
|
|
140
|
+
return `${gate}:${at}:${encodeURIComponent(consentUrl)}`;
|
|
141
|
+
}
|
|
142
|
+
constructor(message = 'error') {
|
|
143
|
+
super(`consent-required:${message}`);
|
|
144
|
+
this.type = ConnectConsentRequired.typeName;
|
|
145
|
+
this.applyFields();
|
|
146
|
+
}
|
|
147
|
+
applyFields() {
|
|
148
|
+
const marker = 'consent-required:';
|
|
149
|
+
const at = this.message.lastIndexOf(marker);
|
|
150
|
+
if (at < 0)
|
|
151
|
+
return;
|
|
152
|
+
const [gate, deadline, encodedUrl] = this.message.slice(at + marker.length).split(':');
|
|
153
|
+
this.gate = gate ?? '';
|
|
154
|
+
const ms = Number(deadline ?? 0);
|
|
155
|
+
this.deadline = Number.isFinite(ms) && ms > 0 ? new Date(ms) : undefined;
|
|
156
|
+
let url = '';
|
|
157
|
+
try {
|
|
158
|
+
url = encodedUrl != null && encodedUrl !== '' ? decodeURIComponent(encodedUrl) : '';
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
url = encodedUrl ?? '';
|
|
162
|
+
}
|
|
163
|
+
this.consentUrl = url;
|
|
164
|
+
}
|
|
165
|
+
finalizeUnmarshal() {
|
|
166
|
+
this.applyFields();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
120
169
|
ResilientError.registerErrorClass(ConnectError);
|
|
121
170
|
ResilientError.registerErrorClass(ConnectSessionNotFound);
|
|
122
171
|
ResilientError.registerErrorClass(ConnectSessionGone);
|
|
@@ -125,4 +174,5 @@ ResilientError.registerErrorClass(ConnectOpRefused);
|
|
|
125
174
|
ResilientError.registerErrorClass(LocalSlotUnsupported);
|
|
126
175
|
ResilientError.registerErrorClass(ConnectOpUnknown);
|
|
127
176
|
ResilientError.registerErrorClass(ConnectOutOfCredits);
|
|
177
|
+
ResilientError.registerErrorClass(ConnectConsentRequired);
|
|
128
178
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/connect/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,OAAO,YAAa,SAAQ,cAAc;IACvC,MAAM,CAAU,QAAQ,GAAG,gBAAgB,cAAc,CAAC,QAAQ,EAAE,CAAA;IAE3E,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,kBAAkB,OAAO,EAAE,CAAC,CAAA;IAC3D,CAAC;CACF;AAED,iEAAiE;AACjE,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IAC/C,MAAM,CAAU,QAAQ,GAAG,kBAAkB,YAAY,CAAC,QAAQ,EAAE,CAAA;IAC3E,0EAA0E;IACnE,MAAM,CAAC,UAAU,GAAG,GAAG,CAAA;IAE9B,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,qBAAqB,OAAO,EAAE,CAAC,CAAA;QACrC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC,QAAQ,CAAA;IAC7C,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IAC3C,MAAM,CAAU,QAAQ,GAAG,cAAc,YAAY,CAAC,QAAQ,EAAE,CAAA;IACvE,2DAA2D;IACpD,MAAM,CAAC,UAAU,GAAG,GAAG,CAAA;IAE9B,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,gBAAgB,OAAO,EAAE,CA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AAA;AACD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,UAE9B,CAAA;AACD,eAAO,MAAM,iBAAiB,UAAmE,CAAA;AAEjG;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,UAEzB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,UAAgD,CAAA;AAE5E;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAUrB,CAAA;AAER,eAAO,MAAM,aAAa,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"catalogue.d.ts","sourceRoot":"","sources":["../../src/skills/catalogue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAe,WAAW,EAAE,MAAM,aAAa,CAAA;AAgBtD,2FAA2F;AAC3F,eAAO,MAAM,eAAe,SAAU,MAAM,EAAE,KAAG,MACuC,CAAA;AAKxF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,UAAU,CAAA;AACxC,eAAO,MAAM,kBAAkB,UAE9B,CAAA;AACD,eAAO,MAAM,sBAAsB,UAKlC,CAAA;AACD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,UAE9B,CAAA;AACD,eAAO,MAAM,iBAAiB,UAAmE,CAAA;AAEjG;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,UAEzB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,UAAgD,CAAA;AAE5E;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAUrB,CAAA;AAER,eAAO,MAAM,aAAa,EAAE,eAAe,EA2uD1C,CAAA;AAED,yFAAyF;AACzF,eAAO,MAAM,WAAW,UAAW,WAAW,KAAG,eACI,CAAA"}
|
|
@@ -1201,7 +1201,8 @@ file per entity: \`sources/api/src/app/<entity>/<action>.ts\`. It NEVER imports
|
|
|
1201
1201
|
NEVER calls \`handlers<Context>()\`; that belongs only in the file that BINDS it:
|
|
1202
1202
|
|
|
1203
1203
|
// sources/api/src/app/task/create.ts — the handler module
|
|
1204
|
-
|
|
1204
|
+
import type { Task } from 'project-common/models/task/task'
|
|
1205
|
+
export const handleTaskCreate = async (payload: Task, ctx: Context) => {
|
|
1205
1206
|
const tasks = getTaskResource(ctx)
|
|
1206
1207
|
return await tasks.create(payload)
|
|
1207
1208
|
}
|
|
@@ -1249,6 +1250,12 @@ package, and every request to the route then fails with \`TypeError: handler is
|
|
|
1249
1250
|
\`api.body(p, (payload, ctx, request) => …)\` — the typed body first;
|
|
1250
1251
|
\`api.params(p, (params, ctx, request) => …)\` — the typed route params first;
|
|
1251
1252
|
\`api.request(p, (request, ctx) => …)\` — the whole request first.
|
|
1253
|
+
- The PROTOCOL decides the handler's types. The body, params and response its declaration in
|
|
1254
|
+
\`sources/common/src/entrypoints.ts\` names are the handler's parameter and return types, imported
|
|
1255
|
+
from the shared package. Never declare an input or record type in \`sources/api\` or
|
|
1256
|
+
\`sources/backend\` (\`CreateTaskInput\`, \`TaskRecord\`, \`Task & { id: string }\`): the shared
|
|
1257
|
+
package cannot import it, so the declaration can never name it, and the binding fails with
|
|
1258
|
+
\`TS2345 "Argument of type '(payload: CreateTaskInput, ctx: Context) => …' is not assignable"\`.
|
|
1252
1259
|
Only \`.request\` hands you the request as the FIRST argument. When you need to name its type,
|
|
1253
1260
|
\`HandlerRequest\` comes from \`@owlmeans/entrypoint\` — \`@owlmeans/server-api\` does NOT export it.
|
|
1254
1261
|
- Handlers are ENTITY-SCOPED: \`sources/api/src/app/<entity>/<action>.ts\`, named exports only.
|
|
@@ -1290,6 +1297,13 @@ says before rewriting anything.
|
|
|
1290
1297
|
handler module. Left as a type error, this is also the runtime fingerprint of the same defect:
|
|
1291
1298
|
a story reported \`completed\` whose every request to that route fails with
|
|
1292
1299
|
\`TypeError: handler is not a function\` (\`execute is not a function\` for \`.request\`).
|
|
1300
|
+
- **\`TS2345 "Argument of type '(payload: X, …) => …' is not assignable to parameter of type
|
|
1301
|
+
'(payload: Y, …) => …'"\` at a \`bind(...)\` line in \`sources/api/src/entrypoints.ts\` is the
|
|
1302
|
+
HANDLER disagreeing with its protocol.** The declaration in \`sources/common/src/entrypoints.ts\`
|
|
1303
|
+
is the authority: change the handler's parameter and return types to exactly the declared ones,
|
|
1304
|
+
imported from the shared package. Never edit the declaration toward the handler, never declare a
|
|
1305
|
+
type in \`sources/common/src/entrypoints.ts\` to match it, and never cast at the binding — each
|
|
1306
|
+
of those moves the error into the other file and the loop never converges.
|
|
1293
1307
|
- "Cannot find module" for \`postgres\`, \`@/lib/db.js\` or \`@/db/schema/...\` inside a
|
|
1294
1308
|
\`resources/**\` file means the file was written against the REMOVED Drizzle-DDL layout.
|
|
1295
1309
|
Rewrite it as an OwlMeans resource: an AJV schema on \`resource.schema\`, built with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogue.js","sourceRoot":"","sources":["../../src/skills/catalogue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEtD;;;;;;;;GAQG;AAEH,MAAM,KAAK,GAAG,CAAC,KAAkB,EAAE,KAAa,EAAE,IAAY,EAAmB,EAAE,CAAC,CAAC;IACnF,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC;CAC3D,CAAC,CAAA;AAEF,2FAA2F;AAC3F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAc,EAAU,EAAE,CACxD,kDAAkD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AAExF,MAAM,SAAS,GAAG,CAAC,KAAkB,EAAE,KAAa,EAAE,IAAc,EAAmB,EAAE,CACvF,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAA;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,CAAC,KAAK,KAAK,KAAK,CAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/viable-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Runtime-free contracts of the OwlMeans Viable platform — the analysis, design and metadata shapes of a generated project, its target-shape manifest, the slot command vocabulary, the connector protocol and the conversion vocabulary.",
|
|
6
6
|
"type": "module",
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"typescript": "^7.0.2"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@owlmeans/agent-common": "^0.1.18-rc.
|
|
63
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
64
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
65
|
-
"@owlmeans/llm-common": "^0.1.18-rc.
|
|
66
|
-
"@owlmeans/planning": "^0.1.18-rc.
|
|
67
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
62
|
+
"@owlmeans/agent-common": "^0.1.18-rc.40",
|
|
63
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.36",
|
|
64
|
+
"@owlmeans/error": "^0.1.18-rc.35",
|
|
65
|
+
"@owlmeans/llm-common": "^0.1.18-rc.36",
|
|
66
|
+
"@owlmeans/planning": "^0.1.18-rc.9",
|
|
67
|
+
"@owlmeans/resource": "^0.1.18-rc.35",
|
|
68
68
|
"@owlmeans/route": "^0.1.18-rc.33"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
package/src/blueprint/case.ts
CHANGED
|
@@ -62,8 +62,8 @@ export interface BlueprintCaseDefinition {
|
|
|
62
62
|
/** What every AI case installs. The langchain peers are declared here, at ONE range. */
|
|
63
63
|
const AI_DEPS = {
|
|
64
64
|
[SubProject.Backend]: {
|
|
65
|
-
'@owlmeans/llm': '^0.1.18-rc.
|
|
66
|
-
'@owlmeans/agent': '^0.1.18-rc.
|
|
65
|
+
'@owlmeans/llm': '^0.1.18-rc.37',
|
|
66
|
+
'@owlmeans/agent': '^0.1.18-rc.38',
|
|
67
67
|
'@langchain/core': '^1.2.9',
|
|
68
68
|
'@langchain/anthropic': '^1.5.8',
|
|
69
69
|
'@langchain/openai': '^1.5.10',
|
|
@@ -261,7 +261,7 @@ in advance.
|
|
|
261
261
|
deps: {
|
|
262
262
|
[SubProject.Backend]: {
|
|
263
263
|
...AI_DEPS[SubProject.Backend],
|
|
264
|
-
'@owlmeans/agent-skills': '^0.1.18-rc.
|
|
264
|
+
'@owlmeans/agent-skills': '^0.1.18-rc.38',
|
|
265
265
|
},
|
|
266
266
|
},
|
|
267
267
|
libraries: AI_LIBRARIES,
|
package/src/connect/errors.ts
CHANGED
|
@@ -137,6 +137,60 @@ export class ConnectOutOfCredits extends ConnectError {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* The action would spend credits bought less than 14 days ago under EU consumer rules, and a person
|
|
142
|
+
* has not yet expressly asked the platform to start using them (the purchase can still be
|
|
143
|
+
* withdrawn from). Only a person can give that request — in the browser, at `consentUrl`.
|
|
144
|
+
*
|
|
145
|
+
* Packed like `ConnectOutOfCredits`, because only `type` and `message` survive a marshal:
|
|
146
|
+
* `consent-required:<gate>:<deadline epoch ms | 0>:<encodeURIComponent(consentUrl)>`. The deadline
|
|
147
|
+
* is epoch milliseconds and the URL goes last, because an ISO date and a URL both contain colons.
|
|
148
|
+
*/
|
|
149
|
+
export class ConnectConsentRequired extends ConnectError {
|
|
150
|
+
public static override typeName = `ConsentRequired${ConnectError.typeName}`
|
|
151
|
+
/** A precondition only a person can meet, not a fault: answered 428. */
|
|
152
|
+
public static httpStatus = 428
|
|
153
|
+
|
|
154
|
+
public gate = ''
|
|
155
|
+
/** The latest withdrawal deadline of the purchases waiting for consent, when known. */
|
|
156
|
+
public deadline?: Date
|
|
157
|
+
public consentUrl = ''
|
|
158
|
+
|
|
159
|
+
/** Build the packed message a caller passes to the constructor. */
|
|
160
|
+
static encode(gate: string, consentUrl: string, deadline?: Date | null): string {
|
|
161
|
+
const at = deadline != null && !Number.isNaN(deadline.getTime()) ? deadline.getTime() : 0
|
|
162
|
+
|
|
163
|
+
return `${gate}:${at}:${encodeURIComponent(consentUrl)}`
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
constructor(message: string = 'error') {
|
|
167
|
+
super(`consent-required:${message}`)
|
|
168
|
+
this.type = ConnectConsentRequired.typeName
|
|
169
|
+
this.applyFields()
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
private applyFields(): void {
|
|
173
|
+
const marker = 'consent-required:'
|
|
174
|
+
const at = this.message.lastIndexOf(marker)
|
|
175
|
+
if (at < 0) return
|
|
176
|
+
const [gate, deadline, encodedUrl] = this.message.slice(at + marker.length).split(':')
|
|
177
|
+
this.gate = gate ?? ''
|
|
178
|
+
const ms = Number(deadline ?? 0)
|
|
179
|
+
this.deadline = Number.isFinite(ms) && ms > 0 ? new Date(ms) : undefined
|
|
180
|
+
let url = ''
|
|
181
|
+
try {
|
|
182
|
+
url = encodedUrl != null && encodedUrl !== '' ? decodeURIComponent(encodedUrl) : ''
|
|
183
|
+
} catch {
|
|
184
|
+
url = encodedUrl ?? ''
|
|
185
|
+
}
|
|
186
|
+
this.consentUrl = url
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
override finalizeUnmarshal(): void {
|
|
190
|
+
this.applyFields()
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
140
194
|
ResilientError.registerErrorClass(ConnectError)
|
|
141
195
|
ResilientError.registerErrorClass(ConnectSessionNotFound)
|
|
142
196
|
ResilientError.registerErrorClass(ConnectSessionGone)
|
|
@@ -145,3 +199,4 @@ ResilientError.registerErrorClass(ConnectOpRefused)
|
|
|
145
199
|
ResilientError.registerErrorClass(LocalSlotUnsupported)
|
|
146
200
|
ResilientError.registerErrorClass(ConnectOpUnknown)
|
|
147
201
|
ResilientError.registerErrorClass(ConnectOutOfCredits)
|
|
202
|
+
ResilientError.registerErrorClass(ConnectConsentRequired)
|
package/src/skills/catalogue.ts
CHANGED
|
@@ -1238,7 +1238,8 @@ file per entity: \`sources/api/src/app/<entity>/<action>.ts\`. It NEVER imports
|
|
|
1238
1238
|
NEVER calls \`handlers<Context>()\`; that belongs only in the file that BINDS it:
|
|
1239
1239
|
|
|
1240
1240
|
// sources/api/src/app/task/create.ts — the handler module
|
|
1241
|
-
|
|
1241
|
+
import type { Task } from 'project-common/models/task/task'
|
|
1242
|
+
export const handleTaskCreate = async (payload: Task, ctx: Context) => {
|
|
1242
1243
|
const tasks = getTaskResource(ctx)
|
|
1243
1244
|
return await tasks.create(payload)
|
|
1244
1245
|
}
|
|
@@ -1286,6 +1287,12 @@ package, and every request to the route then fails with \`TypeError: handler is
|
|
|
1286
1287
|
\`api.body(p, (payload, ctx, request) => …)\` — the typed body first;
|
|
1287
1288
|
\`api.params(p, (params, ctx, request) => …)\` — the typed route params first;
|
|
1288
1289
|
\`api.request(p, (request, ctx) => …)\` — the whole request first.
|
|
1290
|
+
- The PROTOCOL decides the handler's types. The body, params and response its declaration in
|
|
1291
|
+
\`sources/common/src/entrypoints.ts\` names are the handler's parameter and return types, imported
|
|
1292
|
+
from the shared package. Never declare an input or record type in \`sources/api\` or
|
|
1293
|
+
\`sources/backend\` (\`CreateTaskInput\`, \`TaskRecord\`, \`Task & { id: string }\`): the shared
|
|
1294
|
+
package cannot import it, so the declaration can never name it, and the binding fails with
|
|
1295
|
+
\`TS2345 "Argument of type '(payload: CreateTaskInput, ctx: Context) => …' is not assignable"\`.
|
|
1289
1296
|
Only \`.request\` hands you the request as the FIRST argument. When you need to name its type,
|
|
1290
1297
|
\`HandlerRequest\` comes from \`@owlmeans/entrypoint\` — \`@owlmeans/server-api\` does NOT export it.
|
|
1291
1298
|
- Handlers are ENTITY-SCOPED: \`sources/api/src/app/<entity>/<action>.ts\`, named exports only.
|
|
@@ -1328,6 +1335,13 @@ says before rewriting anything.
|
|
|
1328
1335
|
handler module. Left as a type error, this is also the runtime fingerprint of the same defect:
|
|
1329
1336
|
a story reported \`completed\` whose every request to that route fails with
|
|
1330
1337
|
\`TypeError: handler is not a function\` (\`execute is not a function\` for \`.request\`).
|
|
1338
|
+
- **\`TS2345 "Argument of type '(payload: X, …) => …' is not assignable to parameter of type
|
|
1339
|
+
'(payload: Y, …) => …'"\` at a \`bind(...)\` line in \`sources/api/src/entrypoints.ts\` is the
|
|
1340
|
+
HANDLER disagreeing with its protocol.** The declaration in \`sources/common/src/entrypoints.ts\`
|
|
1341
|
+
is the authority: change the handler's parameter and return types to exactly the declared ones,
|
|
1342
|
+
imported from the shared package. Never edit the declaration toward the handler, never declare a
|
|
1343
|
+
type in \`sources/common/src/entrypoints.ts\` to match it, and never cast at the binding — each
|
|
1344
|
+
of those moves the error into the other file and the loop never converges.
|
|
1331
1345
|
- "Cannot find module" for \`postgres\`, \`@/lib/db.js\` or \`@/db/schema/...\` inside a
|
|
1332
1346
|
\`resources/**\` file means the file was written against the REMOVED Drizzle-DDL layout.
|
|
1333
1347
|
Rewrite it as an OwlMeans resource: an AJV schema on \`resource.schema\`, built with
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test'
|
|
2
2
|
import { ResilientError } from '@owlmeans/error'
|
|
3
|
-
import { ConnectOutOfCredits } from '../src/connect/errors.js'
|
|
3
|
+
import { ConnectConsentRequired, ConnectOutOfCredits } from '../src/connect/errors.js'
|
|
4
4
|
|
|
5
5
|
describe('@owlmeans/viable-common — ConnectOutOfCredits', () => {
|
|
6
6
|
test('carries its fields fresh, and survives a marshal/unmarshal round trip', () => {
|
|
@@ -20,3 +20,33 @@ describe('@owlmeans/viable-common — ConnectOutOfCredits', () => {
|
|
|
20
20
|
}))
|
|
21
21
|
})
|
|
22
22
|
})
|
|
23
|
+
|
|
24
|
+
describe('@owlmeans/viable-common — ConnectConsentRequired', () => {
|
|
25
|
+
const url = 'https://vib-stage.owlmeans.org/account/billing?consent=1&from=mcp:story'
|
|
26
|
+
const deadline = new Date('2026-10-09T00:00:00.000Z')
|
|
27
|
+
|
|
28
|
+
test('packs gate, deadline and URL, and survives a marshal/unmarshal round trip', () => {
|
|
29
|
+
const fresh = new ConnectConsentRequired(ConnectConsentRequired.encode('story', url, deadline))
|
|
30
|
+
|
|
31
|
+
expect(fresh.message).toBe(`viable-connect:consent-required:story:${deadline.getTime()}:${encodeURIComponent(url)}`)
|
|
32
|
+
expect(fresh.gate).toBe('story')
|
|
33
|
+
expect(fresh.deadline?.toISOString()).toBe(deadline.toISOString())
|
|
34
|
+
expect(fresh.consentUrl).toBe(url)
|
|
35
|
+
expect((fresh.constructor as { httpStatus?: number }).httpStatus).toBe(428)
|
|
36
|
+
|
|
37
|
+
const restored = ResilientError.ensure(fresh.marshal())
|
|
38
|
+
|
|
39
|
+
expect(restored).toBeInstanceOf(ConnectConsentRequired)
|
|
40
|
+
expect(restored).toEqual(expect.objectContaining({ gate: 'story', consentUrl: url }))
|
|
41
|
+
expect((restored as ConnectConsentRequired).deadline?.toISOString()).toBe(deadline.toISOString())
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
test('an unknown deadline travels as 0 and reads back as absent', () => {
|
|
45
|
+
const fresh = new ConnectConsentRequired(ConnectConsentRequired.encode('create', url))
|
|
46
|
+
|
|
47
|
+
expect(fresh.message).toContain(':create:0:')
|
|
48
|
+
expect(fresh.deadline).toBeUndefined()
|
|
49
|
+
expect(fresh.consentUrl).toBe(url)
|
|
50
|
+
expect((ResilientError.ensure(fresh.marshal()) as ConnectConsentRequired).deadline).toBeUndefined()
|
|
51
|
+
})
|
|
52
|
+
})
|
|
@@ -18,6 +18,7 @@ const DECLARED: Record<string, number | undefined> = {
|
|
|
18
18
|
LocalSlotUnsupported: 409,
|
|
19
19
|
ConnectOpRefused: 422,
|
|
20
20
|
ConnectOutOfCredits: 402,
|
|
21
|
+
ConnectConsentRequired: 428,
|
|
21
22
|
ConnectOpTimeout: undefined,
|
|
22
23
|
ProjectResourceError: undefined,
|
|
23
24
|
ProjectNotFound: 404,
|
|
@@ -40,7 +41,7 @@ describe('viable-common refusals — declared HTTP statuses', () => {
|
|
|
40
41
|
expect(classes.map(([name]) => name).sort()).toEqual(Object.keys(DECLARED).sort())
|
|
41
42
|
})
|
|
42
43
|
|
|
43
|
-
test('balance 402, an absent target 404, a conflicting state 409, refused content 422; faults nothing', () => {
|
|
44
|
+
test('balance 402, an absent target 404, a conflicting state 409, refused content 422, a consent only a person gives 428; faults nothing', () => {
|
|
44
45
|
for (const [name, Class] of classes) {
|
|
45
46
|
expect([name, statusOf(new Class('x'))]).toEqual([name, DECLARED[name]])
|
|
46
47
|
}
|
|
@@ -55,5 +56,9 @@ describe('viable-common refusals — declared HTTP statuses', () => {
|
|
|
55
56
|
new connect.ConnectOutOfCredits(connect.ConnectOutOfCredits.encode('story', 1, 0, 'https://x.test')).marshal()
|
|
56
57
|
)
|
|
57
58
|
expect([statusOf(credits), (credits as connect.ConnectOutOfCredits).gate]).toEqual([402, 'story'])
|
|
59
|
+
const consent = ResilientError.ensure(
|
|
60
|
+
new connect.ConnectConsentRequired(connect.ConnectConsentRequired.encode('story', 'https://x.test/?consent=1')).marshal()
|
|
61
|
+
)
|
|
62
|
+
expect([statusOf(consent), (consent as connect.ConnectConsentRequired).consentUrl]).toEqual([428, 'https://x.test/?consent=1'])
|
|
58
63
|
})
|
|
59
64
|
})
|
package/tests/skills.spec.ts
CHANGED
|
@@ -40,6 +40,21 @@ describe('viable-common catalogue — handler wrap-once', () => {
|
|
|
40
40
|
expect(body).toContain("project-backend/")
|
|
41
41
|
})
|
|
42
42
|
|
|
43
|
+
it('OwlMeansServer types a handler with the shared type its protocol declares, never an invented payload type', () => {
|
|
44
|
+
const body = viableSkill(ViableSkill.OwlMeansServer).body
|
|
45
|
+
|
|
46
|
+
expect(body).not.toContain('TaskCreatePayload')
|
|
47
|
+
expect(body).toContain('payload: Task, ctx: Context')
|
|
48
|
+
expect(body).toContain('The PROTOCOL decides the handler\'s types')
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('FixerHeuristics repairs a handler/protocol mismatch in the HANDLER, never in the declaration', () => {
|
|
52
|
+
const body = viableSkill(ViableSkill.FixerHeuristics).body
|
|
53
|
+
|
|
54
|
+
expect(body).toContain('HANDLER disagreeing with its protocol')
|
|
55
|
+
expect(body).toContain('Never edit the declaration toward the handler')
|
|
56
|
+
})
|
|
57
|
+
|
|
43
58
|
it('OwlmeansContext and OwlmeansState show no project-common/project-backend deep import with an extension', () => {
|
|
44
59
|
for (const alias of [ViableSkill.OwlmeansContext, ViableSkill.OwlmeansState]) {
|
|
45
60
|
expect(viableSkill(alias).body).not.toMatch(/project-(?:common|backend)\/[^\s'"`]*\.(?:js|type)\b/)
|