@owlmeans/viable-common 0.0.21 → 0.0.23
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 +16 -3
- package/build/blueprint/case.js +3 -3
- package/build/connect/errors.d.ts +12 -0
- package/build/connect/errors.d.ts.map +1 -1
- package/build/connect/errors.js +12 -0
- package/build/connect/errors.js.map +1 -1
- package/build/planning/errors.d.ts +8 -0
- package/build/planning/errors.d.ts.map +1 -1
- package/build/planning/errors.js +8 -0
- package/build/planning/errors.js.map +1 -1
- package/package.json +8 -8
- package/src/blueprint/case.ts +3 -3
- package/src/connect/errors.ts +12 -0
- package/src/planning/errors.ts +8 -0
- package/tests/error-status.spec.ts +59 -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.23
|
|
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.19` 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.28
|
|
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.23",
|
|
5
|
+
"generatedAt": "2026-09-17T08:16:11.237Z",
|
|
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.23"` 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.23"` 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`,
|
|
@@ -222,7 +222,7 @@ in a design, a slot or a connector schema:
|
|
|
222
222
|
provider or a collection validator.
|
|
223
223
|
|
|
224
224
|
**A field that crosses a version skew carries no `enum`.** Users run
|
|
225
|
-
`npx -y @owlmeans/viable-mcp@^0.1.18-rc.
|
|
225
|
+
`npx -y @owlmeans/viable-mcp@^0.1.18-rc.19` (the moving prerelease tag) against a separately deployed
|
|
226
226
|
platform, so `ConnectCapabilitiesSchema.executors.items`
|
|
227
227
|
is a bare string: a newer executor kind must stay an unused capability on an older platform, never
|
|
228
228
|
a refused session. Apply the same reasoning to anything else a newer connector may send an older
|
|
@@ -320,6 +320,17 @@ Their type names and `viable-project:` markers are wire contracts. The platform
|
|
|
320
320
|
whole family and never redeclares a base: a class is unmarshalled by type name with the last
|
|
321
321
|
registration winning, so a second declaration replaces this one and `instanceof` stops matching.
|
|
322
322
|
|
|
323
|
+
Every refusal here declares its HTTP status on its leaf class (the `error` skill's principle), and
|
|
324
|
+
`tests/error-status.spec.ts` refuses an exported class whose status was not decided:
|
|
325
|
+
|
|
326
|
+
| Status | Classes |
|
|
327
|
+
|---|---|
|
|
328
|
+
| 402 | `ConnectOutOfCredits` |
|
|
329
|
+
| 404 | `ProjectNotFound`, `ProjectStoryNotFound`, `ConnectSessionNotFound`, `ConnectOpUnknown` |
|
|
330
|
+
| 409 | `ProjectAgentOccupied`, `ProjectStoryMissconfigured`, `ConnectSessionGone` (no connector attached), `LocalSlotUnsupported` (the project's target) |
|
|
331
|
+
| 422 | `ConnectOpRefused` (the connector refused the operation) |
|
|
332
|
+
| none (500) | the bases, `ConnectOpTimeout` (a peer's fault), `ProjectPermissionError` (never thrown; a permission refusal extends `AuthForbidden`) |
|
|
333
|
+
|
|
323
334
|
The platform's other refusals — conversion, moderation, reserved names, integrity — are declared in
|
|
324
335
|
the product repo, not here, so a consumer that cannot `instanceof` them matches by MARKER instead:
|
|
325
336
|
`@owlmeans/viable-sdk`'s `REFUSALS` map and the manager's `useErrorPhrase` read the same substrings,
|
|
@@ -340,7 +351,9 @@ unknown member, the census classifiers and the stage transitions), `connect-conv
|
|
|
340
351
|
conversion routes at their paths and methods, hanging under the connector base and carrying no paid
|
|
341
352
|
gate; capabilities accepting an executor kind this platform has never heard of; the answer and
|
|
342
353
|
resume bodies), `design.spec.ts` (the design aggregate, staleness ranking, and the design schema
|
|
343
|
-
refusing an undeclared field or an area outside the closed set, and `userStoryOfDesign`)
|
|
354
|
+
refusing an undeclared field or an area outside the closed set, and `userStoryOfDesign`),
|
|
355
|
+
`error-status.spec.ts` (every exported refusal's declared status, and its class and status after a
|
|
356
|
+
marshal round trip).
|
|
344
357
|
|
|
345
358
|
## Depends On
|
|
346
359
|
|
package/build/blueprint/case.js
CHANGED
|
@@ -45,8 +45,8 @@ export var GameKind;
|
|
|
45
45
|
/** What every AI case installs. The langchain peers are declared here, at ONE range. */
|
|
46
46
|
const AI_DEPS = {
|
|
47
47
|
[SubProject.Backend]: {
|
|
48
|
-
'@owlmeans/llm': '^0.1.18-rc.
|
|
49
|
-
'@owlmeans/agent': '^0.1.18-rc.
|
|
48
|
+
'@owlmeans/llm': '^0.1.18-rc.29',
|
|
49
|
+
'@owlmeans/agent': '^0.1.18-rc.30',
|
|
50
50
|
'@langchain/core': '^1.2.9',
|
|
51
51
|
'@langchain/anthropic': '^1.5.8',
|
|
52
52
|
'@langchain/openai': '^1.5.10',
|
|
@@ -189,7 +189,7 @@ in advance.
|
|
|
189
189
|
deps: {
|
|
190
190
|
[SubProject.Backend]: {
|
|
191
191
|
...AI_DEPS[SubProject.Backend],
|
|
192
|
-
'@owlmeans/agent-skills': '^0.1.18-rc.
|
|
192
|
+
'@owlmeans/agent-skills': '^0.1.18-rc.28',
|
|
193
193
|
},
|
|
194
194
|
},
|
|
195
195
|
libraries: AI_LIBRARIES,
|
|
@@ -6,6 +6,8 @@ export declare class ConnectError extends ResilientError {
|
|
|
6
6
|
/** No session with that id, or it belongs to another profile. */
|
|
7
7
|
export declare class ConnectSessionNotFound extends ConnectError {
|
|
8
8
|
static typeName: string;
|
|
9
|
+
/** The addressed session is absent or another profile's: answered 404. */
|
|
10
|
+
static httpStatus: number;
|
|
9
11
|
constructor(message?: string);
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
@@ -19,6 +21,8 @@ export declare class ConnectSessionNotFound extends ConnectError {
|
|
|
19
21
|
*/
|
|
20
22
|
export declare class ConnectSessionGone extends ConnectError {
|
|
21
23
|
static typeName: string;
|
|
24
|
+
/** The project has no connector attached: answered 409. */
|
|
25
|
+
static httpStatus: number;
|
|
22
26
|
constructor(message?: string);
|
|
23
27
|
}
|
|
24
28
|
/** The connector did not answer within the command's own deadline. Retryable. */
|
|
@@ -29,6 +33,8 @@ export declare class ConnectOpTimeout extends ConnectError {
|
|
|
29
33
|
/** The connector executed the operation and refused it — a path outside the project, say. */
|
|
30
34
|
export declare class ConnectOpRefused extends ConnectError {
|
|
31
35
|
static typeName: string;
|
|
36
|
+
/** The connector refused the operation it was handed: answered 422. */
|
|
37
|
+
static httpStatus: number;
|
|
32
38
|
constructor(message?: string);
|
|
33
39
|
}
|
|
34
40
|
/**
|
|
@@ -40,11 +46,15 @@ export declare class ConnectOpRefused extends ConnectError {
|
|
|
40
46
|
*/
|
|
41
47
|
export declare class LocalSlotUnsupported extends ConnectError {
|
|
42
48
|
static typeName: string;
|
|
49
|
+
/** The project's local target cannot serve the operation: answered 409. */
|
|
50
|
+
static httpStatus: number;
|
|
43
51
|
constructor(message?: string);
|
|
44
52
|
}
|
|
45
53
|
/** The op id is unknown, already answered, or belongs to another session. */
|
|
46
54
|
export declare class ConnectOpUnknown extends ConnectError {
|
|
47
55
|
static typeName: string;
|
|
56
|
+
/** The addressed operation is absent, answered or another session's: answered 404. */
|
|
57
|
+
static httpStatus: number;
|
|
48
58
|
constructor(message?: string);
|
|
49
59
|
}
|
|
50
60
|
/**
|
|
@@ -57,6 +67,8 @@ export declare class ConnectOpUnknown extends ConnectError {
|
|
|
57
67
|
*/
|
|
58
68
|
export declare class ConnectOutOfCredits extends ConnectError {
|
|
59
69
|
static typeName: string;
|
|
70
|
+
/** The organization's balance, not a fault: answered 402. */
|
|
71
|
+
static httpStatus: number;
|
|
60
72
|
gate: string;
|
|
61
73
|
requiredUsd: number;
|
|
62
74
|
balanceUsd: number;
|
|
@@ -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;
|
|
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;CACF;AAED,iFAAiF;AACjF,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAuB,QAAQ,SAAsC;IAErE,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,6FAA6F;AAC7F,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAuB,QAAQ,SAAsC;IACrE,uEAAuE;IACvE,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;;GAMG;AACH,qBAAa,oBAAqB,SAAQ,YAAY;IACpD,OAAuB,QAAQ,SAA6C;IAC5E,2EAA2E;IAC3E,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,6EAA6E;AAC7E,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAuB,QAAQ,SAAsC;IACrE,sFAAsF;IACtF,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,OAAuB,QAAQ,SAAyC;IACxE,6DAA6D;IAC7D,OAAc,UAAU,SAAM;IAEvB,IAAI,SAAK;IACT,WAAW,SAAI;IACf,UAAU,SAAI;IACd,QAAQ,SAAK;IAEpB,mEAAmE;IACnE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,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"}
|
package/build/connect/errors.js
CHANGED
|
@@ -8,6 +8,8 @@ export class ConnectError extends ResilientError {
|
|
|
8
8
|
/** No session with that id, or it belongs to another profile. */
|
|
9
9
|
export class ConnectSessionNotFound extends ConnectError {
|
|
10
10
|
static typeName = `SessionNotFound${ConnectError.typeName}`;
|
|
11
|
+
/** The addressed session is absent or another profile's: answered 404. */
|
|
12
|
+
static httpStatus = 404;
|
|
11
13
|
constructor(message = 'error') {
|
|
12
14
|
super(`session-not-found:${message}`);
|
|
13
15
|
this.type = ConnectSessionNotFound.typeName;
|
|
@@ -24,6 +26,8 @@ export class ConnectSessionNotFound extends ConnectError {
|
|
|
24
26
|
*/
|
|
25
27
|
export class ConnectSessionGone extends ConnectError {
|
|
26
28
|
static typeName = `SessionGone${ConnectError.typeName}`;
|
|
29
|
+
/** The project has no connector attached: answered 409. */
|
|
30
|
+
static httpStatus = 409;
|
|
27
31
|
constructor(message = 'error') {
|
|
28
32
|
super(`session-gone:${message}`);
|
|
29
33
|
this.type = ConnectSessionGone.typeName;
|
|
@@ -40,6 +44,8 @@ export class ConnectOpTimeout extends ConnectError {
|
|
|
40
44
|
/** The connector executed the operation and refused it — a path outside the project, say. */
|
|
41
45
|
export class ConnectOpRefused extends ConnectError {
|
|
42
46
|
static typeName = `OpRefused${ConnectError.typeName}`;
|
|
47
|
+
/** The connector refused the operation it was handed: answered 422. */
|
|
48
|
+
static httpStatus = 422;
|
|
43
49
|
constructor(message = 'error') {
|
|
44
50
|
super(`op-refused:${message}`);
|
|
45
51
|
this.type = ConnectOpRefused.typeName;
|
|
@@ -54,6 +60,8 @@ export class ConnectOpRefused extends ConnectError {
|
|
|
54
60
|
*/
|
|
55
61
|
export class LocalSlotUnsupported extends ConnectError {
|
|
56
62
|
static typeName = `LocalUnsupported${ConnectError.typeName}`;
|
|
63
|
+
/** The project's local target cannot serve the operation: answered 409. */
|
|
64
|
+
static httpStatus = 409;
|
|
57
65
|
constructor(message = 'error') {
|
|
58
66
|
super(`local-unsupported:${message}`);
|
|
59
67
|
this.type = LocalSlotUnsupported.typeName;
|
|
@@ -62,6 +70,8 @@ export class LocalSlotUnsupported extends ConnectError {
|
|
|
62
70
|
/** The op id is unknown, already answered, or belongs to another session. */
|
|
63
71
|
export class ConnectOpUnknown extends ConnectError {
|
|
64
72
|
static typeName = `OpUnknown${ConnectError.typeName}`;
|
|
73
|
+
/** The addressed operation is absent, answered or another session's: answered 404. */
|
|
74
|
+
static httpStatus = 404;
|
|
65
75
|
constructor(message = 'error') {
|
|
66
76
|
super(`op-unknown:${message}`);
|
|
67
77
|
this.type = ConnectOpUnknown.typeName;
|
|
@@ -77,6 +87,8 @@ export class ConnectOpUnknown extends ConnectError {
|
|
|
77
87
|
*/
|
|
78
88
|
export class ConnectOutOfCredits extends ConnectError {
|
|
79
89
|
static typeName = `OutOfCredits${ConnectError.typeName}`;
|
|
90
|
+
/** The organization's balance, not a fault: answered 402. */
|
|
91
|
+
static httpStatus = 402;
|
|
80
92
|
gate = '';
|
|
81
93
|
requiredUsd = 0;
|
|
82
94
|
balanceUsd = 0;
|
|
@@ -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;
|
|
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,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AC,CAAA;AACnD,cAAc,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;AACnD,cAAc,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;AACvD,cAAc,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;AACnD,cAAc,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA"}
|
|
@@ -17,6 +17,8 @@ export declare class ProjectResourceError extends ResourceError {
|
|
|
17
17
|
/** No project card with that id in the caller's organization. */
|
|
18
18
|
export declare class ProjectNotFound extends ProjectResourceError {
|
|
19
19
|
static typeName: string;
|
|
20
|
+
/** The addressed project is absent or another organization's: answered 404. */
|
|
21
|
+
static httpStatus: number;
|
|
20
22
|
constructor(message?: string);
|
|
21
23
|
}
|
|
22
24
|
/** The project exists, and the caller may not act on it. */
|
|
@@ -31,6 +33,8 @@ export declare class ProjectStoryError extends ProjectResourceError {
|
|
|
31
33
|
/** No story card with that id or code under the project. */
|
|
32
34
|
export declare class ProjectStoryNotFound extends ProjectStoryError {
|
|
33
35
|
static typeName: string;
|
|
36
|
+
/** The addressed story is absent from the project: answered 404. */
|
|
37
|
+
static httpStatus: number;
|
|
34
38
|
constructor(message?: string);
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
@@ -41,6 +45,8 @@ export declare class ProjectStoryNotFound extends ProjectStoryError {
|
|
|
41
45
|
*/
|
|
42
46
|
export declare class ProjectStoryMissconfigured extends ProjectStoryError {
|
|
43
47
|
static typeName: string;
|
|
48
|
+
/** The story's current state does not take the write: answered 409. */
|
|
49
|
+
static httpStatus: number;
|
|
44
50
|
constructor(message?: string);
|
|
45
51
|
}
|
|
46
52
|
export declare class ProjectError extends ResilientError {
|
|
@@ -59,6 +65,8 @@ export declare class ProjectAgentError extends ProjectError {
|
|
|
59
65
|
*/
|
|
60
66
|
export declare class ProjectAgentOccupied extends ProjectAgentError {
|
|
61
67
|
static typeName: string;
|
|
68
|
+
/** The project's agent is busy with the same kind of work: answered 409. */
|
|
69
|
+
static httpStatus: number;
|
|
62
70
|
constructor(message?: string);
|
|
63
71
|
}
|
|
64
72
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/planning/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD;;;;;;;;;GASG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,OAAuB,QAAQ,SAA2C;IAE1E,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,iEAAiE;AACjE,qBAAa,eAAgB,SAAQ,oBAAoB;IACvD,OAAuB,QAAQ,SAA6C;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/planning/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD;;;;;;;;;GASG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,OAAuB,QAAQ,SAA2C;IAE1E,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,iEAAiE;AACjE,qBAAa,eAAgB,SAAQ,oBAAoB;IACvD,OAAuB,QAAQ,SAA6C;IAC5E,+EAA+E;IAC/E,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,4DAA4D;AAC5D,qBAAa,sBAAuB,SAAQ,oBAAoB;IAC9D,OAAuB,QAAQ,SAA+C;IAE9E,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,qBAAa,iBAAkB,SAAQ,oBAAoB;IACzD,OAAuB,QAAQ,SAA0C;IAEzE,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,4DAA4D;AAC5D,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,OAAuB,QAAQ,SAA0C;IACzE,oEAAoE;IACpE,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,iBAAiB;IAC/D,OAAuB,QAAQ,SAAgD;IAC/E,uEAAuE;IACvE,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,qBAAa,YAAa,SAAQ,cAAc;IAC9C,OAAuB,QAAQ,SAA4C;IAE3E,YAAY,OAAO,GAAE,MAAgB,EAEpC;CACF;AAED,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAuB,QAAQ,SAAkC;IAEjE,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,OAAuB,QAAQ,SAA0C;IACzE,4EAA4E;IAC5E,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF"}
|
package/build/planning/errors.js
CHANGED
|
@@ -20,6 +20,8 @@ export class ProjectResourceError extends ResourceError {
|
|
|
20
20
|
/** No project card with that id in the caller's organization. */
|
|
21
21
|
export class ProjectNotFound extends ProjectResourceError {
|
|
22
22
|
static typeName = `NotFound${ProjectResourceError.typeName}`;
|
|
23
|
+
/** The addressed project is absent or another organization's: answered 404. */
|
|
24
|
+
static httpStatus = 404;
|
|
23
25
|
constructor(message = 'error') {
|
|
24
26
|
super(`not-found:${message}`);
|
|
25
27
|
this.type = ProjectNotFound.typeName;
|
|
@@ -43,6 +45,8 @@ export class ProjectStoryError extends ProjectResourceError {
|
|
|
43
45
|
/** No story card with that id or code under the project. */
|
|
44
46
|
export class ProjectStoryNotFound extends ProjectStoryError {
|
|
45
47
|
static typeName = `NotFound${ProjectStoryError.typeName}`;
|
|
48
|
+
/** The addressed story is absent from the project: answered 404. */
|
|
49
|
+
static httpStatus = 404;
|
|
46
50
|
constructor(message = 'error') {
|
|
47
51
|
super(`not-found:${message}`);
|
|
48
52
|
this.type = ProjectStoryNotFound.typeName;
|
|
@@ -56,6 +60,8 @@ export class ProjectStoryNotFound extends ProjectStoryError {
|
|
|
56
60
|
*/
|
|
57
61
|
export class ProjectStoryMissconfigured extends ProjectStoryError {
|
|
58
62
|
static typeName = `Missconfigured${ProjectStoryError.typeName}`;
|
|
63
|
+
/** The story's current state does not take the write: answered 409. */
|
|
64
|
+
static httpStatus = 409;
|
|
59
65
|
constructor(message = 'error') {
|
|
60
66
|
super(`missconfigured:${message}`);
|
|
61
67
|
this.type = ProjectStoryMissconfigured.typeName;
|
|
@@ -82,6 +88,8 @@ export class ProjectAgentError extends ProjectError {
|
|
|
82
88
|
*/
|
|
83
89
|
export class ProjectAgentOccupied extends ProjectAgentError {
|
|
84
90
|
static typeName = `Occupied${ProjectAgentError.typeName}`;
|
|
91
|
+
/** The project's agent is busy with the same kind of work: answered 409. */
|
|
92
|
+
static httpStatus = 409;
|
|
85
93
|
constructor(message = 'error') {
|
|
86
94
|
super(`occupied:${message}`);
|
|
87
95
|
this.type = ProjectAgentOccupied.typeName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/planning/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IAC9C,MAAM,CAAU,QAAQ,GAAG,gBAAgB,aAAa,CAAC,QAAQ,EAAE,CAAA;IAE1E,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAA;QAClC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC,QAAQ,CAAA;IAC3C,CAAC;CACF;AA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,QAAQ,YAAY,CAAC,QAAQ,EAAE,CAAA;IAEjE,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,SAAS,OAAO,EAAE,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAA;IACxC,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IAClD,MAAM,CAAU,QAAQ,GAAG,WAAW,iBAAiB,CAAC,QAAQ,EAAE,CAAA;IACzE,4EAA4E;IACrE,MAAM,CAAC,UAAU,GAAG,GAAG,CAAA;IAE9B,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,YAAY,OAAO,EAAE,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC,QAAQ,CAAA;IAC3C,CAAC;CACF;AAED,cAAc,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;AACvD,cAAc,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;AAClD,cAAc,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAA;AACzD,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;AACvD,cAAc,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;AAC7D,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;AAC/C,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,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.23",
|
|
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,13 +59,13 @@
|
|
|
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.
|
|
68
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
62
|
+
"@owlmeans/agent-common": "^0.1.18-rc.32",
|
|
63
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.28",
|
|
64
|
+
"@owlmeans/error": "^0.1.18-rc.27",
|
|
65
|
+
"@owlmeans/llm-common": "^0.1.18-rc.28",
|
|
66
|
+
"@owlmeans/planning": "^0.1.18-rc.1",
|
|
67
|
+
"@owlmeans/resource": "^0.1.18-rc.27",
|
|
68
|
+
"@owlmeans/route": "^0.1.18-rc.26"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
package/src/blueprint/case.ts
CHANGED
|
@@ -61,8 +61,8 @@ export interface BlueprintCaseDefinition {
|
|
|
61
61
|
/** What every AI case installs. The langchain peers are declared here, at ONE range. */
|
|
62
62
|
const AI_DEPS = {
|
|
63
63
|
[SubProject.Backend]: {
|
|
64
|
-
'@owlmeans/llm': '^0.1.18-rc.
|
|
65
|
-
'@owlmeans/agent': '^0.1.18-rc.
|
|
64
|
+
'@owlmeans/llm': '^0.1.18-rc.29',
|
|
65
|
+
'@owlmeans/agent': '^0.1.18-rc.30',
|
|
66
66
|
'@langchain/core': '^1.2.9',
|
|
67
67
|
'@langchain/anthropic': '^1.5.8',
|
|
68
68
|
'@langchain/openai': '^1.5.10',
|
|
@@ -214,7 +214,7 @@ in advance.
|
|
|
214
214
|
deps: {
|
|
215
215
|
[SubProject.Backend]: {
|
|
216
216
|
...AI_DEPS[SubProject.Backend],
|
|
217
|
-
'@owlmeans/agent-skills': '^0.1.18-rc.
|
|
217
|
+
'@owlmeans/agent-skills': '^0.1.18-rc.28',
|
|
218
218
|
},
|
|
219
219
|
},
|
|
220
220
|
libraries: AI_LIBRARIES,
|
package/src/connect/errors.ts
CHANGED
|
@@ -11,6 +11,8 @@ export class ConnectError extends ResilientError {
|
|
|
11
11
|
/** No session with that id, or it belongs to another profile. */
|
|
12
12
|
export class ConnectSessionNotFound extends ConnectError {
|
|
13
13
|
public static override typeName = `SessionNotFound${ConnectError.typeName}`
|
|
14
|
+
/** The addressed session is absent or another profile's: answered 404. */
|
|
15
|
+
public static httpStatus = 404
|
|
14
16
|
|
|
15
17
|
constructor(message: string = 'error') {
|
|
16
18
|
super(`session-not-found:${message}`)
|
|
@@ -29,6 +31,8 @@ export class ConnectSessionNotFound extends ConnectError {
|
|
|
29
31
|
*/
|
|
30
32
|
export class ConnectSessionGone extends ConnectError {
|
|
31
33
|
public static override typeName = `SessionGone${ConnectError.typeName}`
|
|
34
|
+
/** The project has no connector attached: answered 409. */
|
|
35
|
+
public static httpStatus = 409
|
|
32
36
|
|
|
33
37
|
constructor(message: string = 'error') {
|
|
34
38
|
super(`session-gone:${message}`)
|
|
@@ -49,6 +53,8 @@ export class ConnectOpTimeout extends ConnectError {
|
|
|
49
53
|
/** The connector executed the operation and refused it — a path outside the project, say. */
|
|
50
54
|
export class ConnectOpRefused extends ConnectError {
|
|
51
55
|
public static override typeName = `OpRefused${ConnectError.typeName}`
|
|
56
|
+
/** The connector refused the operation it was handed: answered 422. */
|
|
57
|
+
public static httpStatus = 422
|
|
52
58
|
|
|
53
59
|
constructor(message: string = 'error') {
|
|
54
60
|
super(`op-refused:${message}`)
|
|
@@ -65,6 +71,8 @@ export class ConnectOpRefused extends ConnectError {
|
|
|
65
71
|
*/
|
|
66
72
|
export class LocalSlotUnsupported extends ConnectError {
|
|
67
73
|
public static override typeName = `LocalUnsupported${ConnectError.typeName}`
|
|
74
|
+
/** The project's local target cannot serve the operation: answered 409. */
|
|
75
|
+
public static httpStatus = 409
|
|
68
76
|
|
|
69
77
|
constructor(message: string = 'error') {
|
|
70
78
|
super(`local-unsupported:${message}`)
|
|
@@ -75,6 +83,8 @@ export class LocalSlotUnsupported extends ConnectError {
|
|
|
75
83
|
/** The op id is unknown, already answered, or belongs to another session. */
|
|
76
84
|
export class ConnectOpUnknown extends ConnectError {
|
|
77
85
|
public static override typeName = `OpUnknown${ConnectError.typeName}`
|
|
86
|
+
/** The addressed operation is absent, answered or another session's: answered 404. */
|
|
87
|
+
public static httpStatus = 404
|
|
78
88
|
|
|
79
89
|
constructor(message: string = 'error') {
|
|
80
90
|
super(`op-unknown:${message}`)
|
|
@@ -92,6 +102,8 @@ export class ConnectOpUnknown extends ConnectError {
|
|
|
92
102
|
*/
|
|
93
103
|
export class ConnectOutOfCredits extends ConnectError {
|
|
94
104
|
public static override typeName = `OutOfCredits${ConnectError.typeName}`
|
|
105
|
+
/** The organization's balance, not a fault: answered 402. */
|
|
106
|
+
public static httpStatus = 402
|
|
95
107
|
|
|
96
108
|
public gate = ''
|
|
97
109
|
public requiredUsd = 0
|
package/src/planning/errors.ts
CHANGED
|
@@ -23,6 +23,8 @@ export class ProjectResourceError extends ResourceError {
|
|
|
23
23
|
/** No project card with that id in the caller's organization. */
|
|
24
24
|
export class ProjectNotFound extends ProjectResourceError {
|
|
25
25
|
public static override typeName = `NotFound${ProjectResourceError.typeName}`
|
|
26
|
+
/** The addressed project is absent or another organization's: answered 404. */
|
|
27
|
+
public static httpStatus = 404
|
|
26
28
|
|
|
27
29
|
constructor(message: string = 'error') {
|
|
28
30
|
super(`not-found:${message}`)
|
|
@@ -52,6 +54,8 @@ export class ProjectStoryError extends ProjectResourceError {
|
|
|
52
54
|
/** No story card with that id or code under the project. */
|
|
53
55
|
export class ProjectStoryNotFound extends ProjectStoryError {
|
|
54
56
|
public static override typeName = `NotFound${ProjectStoryError.typeName}`
|
|
57
|
+
/** The addressed story is absent from the project: answered 404. */
|
|
58
|
+
public static httpStatus = 404
|
|
55
59
|
|
|
56
60
|
constructor(message: string = 'error') {
|
|
57
61
|
super(`not-found:${message}`)
|
|
@@ -67,6 +71,8 @@ export class ProjectStoryNotFound extends ProjectStoryError {
|
|
|
67
71
|
*/
|
|
68
72
|
export class ProjectStoryMissconfigured extends ProjectStoryError {
|
|
69
73
|
public static override typeName = `Missconfigured${ProjectStoryError.typeName}`
|
|
74
|
+
/** The story's current state does not take the write: answered 409. */
|
|
75
|
+
public static httpStatus = 409
|
|
70
76
|
|
|
71
77
|
constructor(message: string = 'error') {
|
|
72
78
|
super(`missconfigured:${message}`)
|
|
@@ -99,6 +105,8 @@ export class ProjectAgentError extends ProjectError {
|
|
|
99
105
|
*/
|
|
100
106
|
export class ProjectAgentOccupied extends ProjectAgentError {
|
|
101
107
|
public static override typeName = `Occupied${ProjectAgentError.typeName}`
|
|
108
|
+
/** The project's agent is busy with the same kind of work: answered 409. */
|
|
109
|
+
public static httpStatus = 409
|
|
102
110
|
|
|
103
111
|
constructor(message: string = 'error') {
|
|
104
112
|
super(`occupied:${message}`)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test'
|
|
2
|
+
import { ResilientError } from '@owlmeans/error'
|
|
3
|
+
import * as connect from '../src/connect/errors.js'
|
|
4
|
+
import * as planning from '../src/planning/errors.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The status an HTTP boundary (`@owlmeans/server-api` `errorStatus`) reads off a class: a static
|
|
8
|
+
* `httpStatus` inherited through the constructor chain. A refusal of the caller's condition declares
|
|
9
|
+
* a 4xx; a fault or a base declares nothing and answers 500.
|
|
10
|
+
*/
|
|
11
|
+
const statusOf = (error: Error): unknown => (error.constructor as { httpStatus?: unknown }).httpStatus
|
|
12
|
+
|
|
13
|
+
const DECLARED: Record<string, number | undefined> = {
|
|
14
|
+
ConnectError: undefined,
|
|
15
|
+
ConnectSessionNotFound: 404,
|
|
16
|
+
ConnectOpUnknown: 404,
|
|
17
|
+
ConnectSessionGone: 409,
|
|
18
|
+
LocalSlotUnsupported: 409,
|
|
19
|
+
ConnectOpRefused: 422,
|
|
20
|
+
ConnectOutOfCredits: 402,
|
|
21
|
+
ConnectOpTimeout: undefined,
|
|
22
|
+
ProjectResourceError: undefined,
|
|
23
|
+
ProjectNotFound: 404,
|
|
24
|
+
ProjectStoryNotFound: 404,
|
|
25
|
+
ProjectStoryMissconfigured: 409,
|
|
26
|
+
ProjectAgentOccupied: 409,
|
|
27
|
+
// Never thrown; a permission refusal extends `AuthForbidden` instead of declaring 403.
|
|
28
|
+
ProjectPermissionError: undefined,
|
|
29
|
+
ProjectStoryError: undefined,
|
|
30
|
+
ProjectError: undefined,
|
|
31
|
+
ProjectAgentError: undefined,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const classes = Object.entries({ ...connect, ...planning }).filter(([, value]) =>
|
|
35
|
+
typeof value === 'function' && value.prototype instanceof ResilientError
|
|
36
|
+
) as [string, new (message?: string) => ResilientError][]
|
|
37
|
+
|
|
38
|
+
describe('viable-common refusals — declared HTTP statuses', () => {
|
|
39
|
+
test('every refusal class has decided its status', () => {
|
|
40
|
+
expect(classes.map(([name]) => name).sort()).toEqual(Object.keys(DECLARED).sort())
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
test('balance 402, an absent target 404, a conflicting state 409, refused content 422; faults nothing', () => {
|
|
44
|
+
for (const [name, Class] of classes) {
|
|
45
|
+
expect([name, statusOf(new Class('x'))]).toEqual([name, DECLARED[name]])
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
test('a refusal rebuilt from its marshalled form keeps its class and its status', () => {
|
|
50
|
+
for (const [name, Class] of classes) {
|
|
51
|
+
const back = ResilientError.ensure(new Class('x').marshal())
|
|
52
|
+
expect([name, back.constructor === Class, statusOf(back)]).toEqual([name, true, DECLARED[name]])
|
|
53
|
+
}
|
|
54
|
+
const credits = ResilientError.ensure(
|
|
55
|
+
new connect.ConnectOutOfCredits(connect.ConnectOutOfCredits.encode('story', 1, 0, 'https://x.test')).marshal()
|
|
56
|
+
)
|
|
57
|
+
expect([statusOf(credits), (credits as connect.ConnectOutOfCredits).gate]).toEqual([402, 'story'])
|
|
58
|
+
})
|
|
59
|
+
})
|