@owlmeans/viable-common 0.0.11 → 0.0.13
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 +68 -1
- package/agent-meta/manifest.json +23 -0
- package/agent-meta/skills/agent-presentation/SKILL.md +62 -0
- package/agent-meta/skills/viable-common/SKILL.md +180 -0
- package/build/agent/index.d.ts +1 -0
- package/build/agent/index.d.ts.map +1 -1
- package/build/agent/index.js +1 -0
- package/build/agent/index.js.map +1 -1
- package/build/agent/presentation.d.ts +102 -0
- package/build/agent/presentation.d.ts.map +1 -0
- package/build/agent/presentation.js +303 -0
- package/build/agent/presentation.js.map +1 -0
- package/build/blueprint/case.js +3 -3
- package/build/connect/consts.d.ts +93 -5
- package/build/connect/consts.d.ts.map +1 -1
- package/build/connect/consts.js +90 -1
- package/build/connect/consts.js.map +1 -1
- package/build/connect/entrypoints.d.ts +208 -4
- package/build/connect/entrypoints.d.ts.map +1 -1
- package/build/connect/entrypoints.js +61 -33
- package/build/connect/entrypoints.js.map +1 -1
- package/build/connect/errors.d.ts +20 -0
- package/build/connect/errors.d.ts.map +1 -1
- package/build/connect/errors.js +39 -0
- package/build/connect/errors.js.map +1 -1
- package/build/connect/ops.d.ts +46 -2
- package/build/connect/ops.d.ts.map +1 -1
- package/build/connect/references.d.ts +60 -1
- package/build/connect/references.d.ts.map +1 -1
- package/build/connect/references.js +16 -0
- package/build/connect/references.js.map +1 -1
- package/build/connect/schemas.d.ts +17 -2
- package/build/connect/schemas.d.ts.map +1 -1
- package/build/connect/schemas.js +91 -7
- package/build/connect/schemas.js.map +1 -1
- package/build/connect/types.d.ts +125 -1
- package/build/connect/types.d.ts.map +1 -1
- package/build/convert/consts.d.ts +539 -0
- package/build/convert/consts.d.ts.map +1 -0
- package/build/convert/consts.js +630 -0
- package/build/convert/consts.js.map +1 -0
- package/build/convert/helpers.d.ts +91 -0
- package/build/convert/helpers.d.ts.map +1 -0
- package/build/convert/helpers.js +301 -0
- package/build/convert/helpers.js.map +1 -0
- package/build/convert/index.d.ts +11 -0
- package/build/convert/index.d.ts.map +1 -0
- package/build/convert/index.js +4 -0
- package/build/convert/index.js.map +1 -0
- package/build/convert/schemas.d.ts +62 -0
- package/build/convert/schemas.d.ts.map +1 -0
- package/build/convert/schemas.js +626 -0
- package/build/convert/schemas.js.map +1 -0
- package/build/convert/types.d.ts +683 -0
- package/build/convert/types.d.ts.map +1 -0
- package/build/convert/types.js +2 -0
- package/build/convert/types.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/skills/catalogue.d.ts.map +1 -1
- package/build/skills/catalogue.js +76 -34
- package/build/skills/catalogue.js.map +1 -1
- package/build/slot/consts.d.ts +73 -2
- package/build/slot/consts.d.ts.map +1 -1
- package/build/slot/consts.js +105 -5
- package/build/slot/consts.js.map +1 -1
- package/build/slot/schemas.d.ts +9 -1
- package/build/slot/schemas.d.ts.map +1 -1
- package/build/slot/schemas.js +18 -0
- package/build/slot/schemas.js.map +1 -1
- package/build/slot/types.d.ts +71 -0
- package/build/slot/types.d.ts.map +1 -1
- package/package.json +15 -7
- package/src/agent/index.ts +1 -0
- package/src/agent/presentation.ts +335 -0
- package/src/blueprint/case.ts +3 -3
- package/src/connect/consts.ts +93 -1
- package/src/connect/entrypoints.ts +113 -40
- package/src/connect/errors.ts +44 -0
- package/src/connect/ops.ts +50 -2
- package/src/connect/references.ts +53 -5
- package/src/connect/schemas.ts +102 -13
- package/src/connect/types.ts +130 -2
- package/src/convert/consts.ts +672 -0
- package/src/convert/helpers.ts +340 -0
- package/src/convert/index.ts +10 -0
- package/src/convert/schemas.ts +663 -0
- package/src/convert/types.ts +741 -0
- package/src/index.ts +1 -0
- package/src/skills/catalogue.ts +76 -34
- package/src/slot/consts.ts +112 -6
- package/src/slot/schemas.ts +20 -1
- package/src/slot/types.ts +80 -0
- package/tests/connect-convert.spec.ts +162 -0
- package/tests/connect-entrypoints.spec.ts +12 -4
- package/tests/connect-errors.spec.ts +22 -0
- package/tests/convert.spec.ts +318 -0
- package/tests/presentation.spec.ts +85 -0
- package/tests/skills.spec.ts +47 -0
- /package/tests/{design.test.ts → design.spec.ts} +0 -0
package/build/slot/schemas.js
CHANGED
|
@@ -22,4 +22,22 @@ export const SlotCommandPayloadSchema = {
|
|
|
22
22
|
required: ['type', 'command'],
|
|
23
23
|
additionalProperties: false
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* The clone command's arguments, as a signed body carries them.
|
|
27
|
+
*
|
|
28
|
+
* `token` is declared because it is SENT — a body field the schema does not declare is stripped
|
|
29
|
+
* by validation and then verified against a signature the sender made over the whole thing, which
|
|
30
|
+
* the guard reports as a 401 rather than as the validation gap it is.
|
|
31
|
+
*/
|
|
32
|
+
export const SlotGitCloneArgsSchema = {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
remoteUrl: { type: 'string', minLength: 1, maxLength: 2048 },
|
|
36
|
+
branch: { type: 'string', maxLength: 256, nullable: true },
|
|
37
|
+
depth: { type: 'number', minimum: 0, nullable: true },
|
|
38
|
+
token: { type: 'string', maxLength: 4096, nullable: true },
|
|
39
|
+
},
|
|
40
|
+
required: ['remoteUrl'],
|
|
41
|
+
additionalProperties: false,
|
|
42
|
+
};
|
|
25
43
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/slot/schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGhG,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,C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QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,oBAAoB,EAAE,IAAI;SAC3B;KACF;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;IAC7B,oBAAoB,EAAE,KAAK;CACU,CAAA;AAEvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE;QAC5D,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1D,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACrD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC3D;IACD,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,oBAAoB,EAAE,KAAK;CACmB,CAAA"}
|
package/build/slot/types.d.ts
CHANGED
|
@@ -66,6 +66,77 @@ export interface SlotGitCommitResult {
|
|
|
66
66
|
export interface SlotGitLogResult {
|
|
67
67
|
commits: SlotGitCommitInfo[];
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Bring a remote repository onto the volume.
|
|
71
|
+
*
|
|
72
|
+
* `token` is a per-invocation credential and never reaches the tree: the executor passes it
|
|
73
|
+
* through the process environment for the one fetch, exactly as push and pull already do, so it
|
|
74
|
+
* appears in no `.git/config`, no remote URL and no argv anything can observe.
|
|
75
|
+
*/
|
|
76
|
+
export interface SlotGitCloneArgs {
|
|
77
|
+
remoteUrl: string;
|
|
78
|
+
/** The branch to check out. Absent means whatever the remote calls its default. */
|
|
79
|
+
branch?: string;
|
|
80
|
+
/** Fetch depth; 0 means the whole history. Defaults to a shallow fetch. */
|
|
81
|
+
depth?: number;
|
|
82
|
+
token?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface SlotGitCloneResult {
|
|
85
|
+
cloned: boolean;
|
|
86
|
+
/** The branch actually checked out — the resolved default, when none was asked for. */
|
|
87
|
+
branch: string;
|
|
88
|
+
head: SlotGitCommitInfo | null;
|
|
89
|
+
/** Executor diagnostics, when it has any worth reporting. */
|
|
90
|
+
result?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* One entry of a {@link SlotFileCommand.StatTree} listing.
|
|
94
|
+
*
|
|
95
|
+
* The shape both a publisher and a connector answer with, so a census walks a pod's volume and a
|
|
96
|
+
* developer's own directory through one contract. `binary` is the executor's own verdict — the
|
|
97
|
+
* caller has not read the file and cannot form one.
|
|
98
|
+
*/
|
|
99
|
+
export interface FileStat {
|
|
100
|
+
path: string;
|
|
101
|
+
bytes: number;
|
|
102
|
+
binary: boolean;
|
|
103
|
+
modifiedAt?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface StatTreeArgs {
|
|
106
|
+
/** Project-relative directory to walk. Absent means the whole project. */
|
|
107
|
+
dir?: string;
|
|
108
|
+
/** Entries to return before the answer reports itself truncated. */
|
|
109
|
+
limit?: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* `total` is what the walk SAW, `entries` what it returned.
|
|
113
|
+
*
|
|
114
|
+
* The two differ on a truncated walk, and the difference is what tells a caller its picture of the
|
|
115
|
+
* tree is partial — a bounded listing that reported only what it returned would be indistinguish-
|
|
116
|
+
* able from a small repository.
|
|
117
|
+
*/
|
|
118
|
+
export interface StatTreeResult {
|
|
119
|
+
entries: FileStat[];
|
|
120
|
+
truncated: boolean;
|
|
121
|
+
total: number;
|
|
122
|
+
}
|
|
123
|
+
export interface ReadHeadArgs {
|
|
124
|
+
path: string;
|
|
125
|
+
bytes: number;
|
|
126
|
+
}
|
|
127
|
+
/** Move everything in the project root under `dir`, leaving the named entries where they are. */
|
|
128
|
+
export interface RelocateArgs {
|
|
129
|
+
dir: string;
|
|
130
|
+
/** Root-relative names that stay put — the slot's own metadata and markers. */
|
|
131
|
+
keep?: string[];
|
|
132
|
+
}
|
|
133
|
+
export interface RelocateResult {
|
|
134
|
+
moved: number;
|
|
135
|
+
kept: string[];
|
|
136
|
+
}
|
|
137
|
+
export interface RemoveTreeArgs {
|
|
138
|
+
dir: string;
|
|
139
|
+
}
|
|
69
140
|
/** Arguments a shell command may carry. */
|
|
70
141
|
export interface SlotShellArgs {
|
|
71
142
|
subproject?: SubProject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/slot/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEjH,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,cAAc,CAAA;AAE7E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,eAAe,CAAA;IACrB,OAAO,EAAE,WAAW,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB;AAED;;;;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AAC,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/viable-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"license": "MIT",
|
|
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 and the
|
|
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",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -b",
|
|
@@ -35,6 +35,13 @@
|
|
|
35
35
|
"module": "./build/connect/index.js",
|
|
36
36
|
"types": "./build/connect/index.d.ts"
|
|
37
37
|
},
|
|
38
|
+
"./convert": {
|
|
39
|
+
"import": "./build/convert/index.js",
|
|
40
|
+
"require": "./build/convert/index.js",
|
|
41
|
+
"default": "./build/convert/index.js",
|
|
42
|
+
"module": "./build/convert/index.js",
|
|
43
|
+
"types": "./build/convert/index.d.ts"
|
|
44
|
+
},
|
|
38
45
|
"./integrity": {
|
|
39
46
|
"import": "./build/integrity/index.js",
|
|
40
47
|
"require": "./build/integrity/index.js",
|
|
@@ -47,15 +54,16 @@
|
|
|
47
54
|
"@langchain/core": "^1.2.9",
|
|
48
55
|
"@owlmeans/dep-config": "workspace:*",
|
|
49
56
|
"ajv": "^8.17.1",
|
|
57
|
+
"ajv-formats": "^3.0.1",
|
|
50
58
|
"nodemon": "^3.1.14",
|
|
51
59
|
"typescript": "^7.0.2"
|
|
52
60
|
},
|
|
53
61
|
"dependencies": {
|
|
54
|
-
"@owlmeans/agent-common": "^0.1.18-rc.
|
|
55
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
56
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
57
|
-
"@owlmeans/llm-common": "^0.1.18-rc.
|
|
58
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
62
|
+
"@owlmeans/agent-common": "^0.1.18-rc.25",
|
|
63
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.20",
|
|
64
|
+
"@owlmeans/error": "^0.1.18-rc.17",
|
|
65
|
+
"@owlmeans/llm-common": "^0.1.18-rc.21",
|
|
66
|
+
"@owlmeans/route": "^0.1.18-rc.18"
|
|
59
67
|
},
|
|
60
68
|
"publishConfig": {
|
|
61
69
|
"access": "public"
|
package/src/agent/index.ts
CHANGED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A compact, runtime-free description of how an agent message should be presented.
|
|
3
|
+
*
|
|
4
|
+
* The server emits this with thinking events and the browser refines it as streaming output
|
|
5
|
+
* becomes parseable. Keeping the vocabulary here prevents the two runtimes from drifting into
|
|
6
|
+
* their own guesses about the same model response.
|
|
7
|
+
*/
|
|
8
|
+
export enum AgentMessageCategory {
|
|
9
|
+
Code = 'code',
|
|
10
|
+
Diff = 'diff',
|
|
11
|
+
Structured = 'structured',
|
|
12
|
+
Markdown = 'markdown',
|
|
13
|
+
Plain = 'plain',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum AgentCodeLanguage {
|
|
17
|
+
ReactTsx = 'react-tsx',
|
|
18
|
+
Css = 'css',
|
|
19
|
+
TypeScript = 'typescript',
|
|
20
|
+
Json = 'json',
|
|
21
|
+
Other = 'other',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** A semantic shape that the manager can render as a purpose-built card. */
|
|
25
|
+
export enum AgentStructuredKind {
|
|
26
|
+
ToolCalls = 'tool-calls',
|
|
27
|
+
ArtifactSelection = 'artifact-selection',
|
|
28
|
+
EntitySelection = 'entity-selection',
|
|
29
|
+
StoryPlan = 'story-plan',
|
|
30
|
+
ScreenPlan = 'screen-plan',
|
|
31
|
+
ComponentPlan = 'component-plan',
|
|
32
|
+
TransitionPlan = 'transition-plan',
|
|
33
|
+
EntrypointSelection = 'entrypoint-selection',
|
|
34
|
+
AccessPolicy = 'access-policy',
|
|
35
|
+
ScaffoldPlan = 'scaffold-plan',
|
|
36
|
+
RuntimeDecision = 'runtime-decision',
|
|
37
|
+
CandidateRanking = 'candidate-ranking',
|
|
38
|
+
Decision = 'decision',
|
|
39
|
+
GenericRecord = 'generic-record',
|
|
40
|
+
GenericList = 'generic-list',
|
|
41
|
+
GenericValue = 'generic-value',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export enum AgentMarkdownKind {
|
|
45
|
+
Specification = 'specification',
|
|
46
|
+
DesignDocument = 'design-document',
|
|
47
|
+
Documentation = 'documentation',
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The family of specialist that produced an output, not an authorization role. */
|
|
51
|
+
export enum AgentMessageRole {
|
|
52
|
+
Technical = 'technical',
|
|
53
|
+
Analytical = 'analytical',
|
|
54
|
+
Product = 'product',
|
|
55
|
+
Ux = 'ux',
|
|
56
|
+
VisualDesign = 'visual-design',
|
|
57
|
+
Architect = 'architect',
|
|
58
|
+
Developer = 'developer',
|
|
59
|
+
Repair = 'repair',
|
|
60
|
+
Orchestrator = 'orchestrator',
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface AgentCodePresentation {
|
|
64
|
+
category: AgentMessageCategory.Code | AgentMessageCategory.Diff
|
|
65
|
+
language: AgentCodeLanguage
|
|
66
|
+
role: AgentMessageRole
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface AgentStructuredPresentation {
|
|
70
|
+
category: AgentMessageCategory.Structured
|
|
71
|
+
structure: AgentStructuredKind
|
|
72
|
+
role: AgentMessageRole
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface AgentMarkdownPresentation {
|
|
76
|
+
category: AgentMessageCategory.Markdown
|
|
77
|
+
document: AgentMarkdownKind
|
|
78
|
+
role: AgentMessageRole
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface AgentPlainPresentation {
|
|
82
|
+
category: AgentMessageCategory.Plain
|
|
83
|
+
role: AgentMessageRole
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type AgentMessagePresentation =
|
|
87
|
+
| AgentCodePresentation
|
|
88
|
+
| AgentStructuredPresentation
|
|
89
|
+
| AgentMarkdownPresentation
|
|
90
|
+
| AgentPlainPresentation
|
|
91
|
+
|
|
92
|
+
/** The attribution and content available to either side of a thinking event. */
|
|
93
|
+
export interface AgentMessageClassificationInput {
|
|
94
|
+
agent?: string
|
|
95
|
+
helper?: string
|
|
96
|
+
action?: string
|
|
97
|
+
outputType?: string
|
|
98
|
+
text?: string
|
|
99
|
+
value?: unknown
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
type RecordValue = Record<string, unknown>
|
|
103
|
+
|
|
104
|
+
const documentActions: Record<string, AgentMarkdownKind> = {
|
|
105
|
+
'write-specification': AgentMarkdownKind.Specification,
|
|
106
|
+
'summarize-specification': AgentMarkdownKind.Specification,
|
|
107
|
+
'write-design-concept': AgentMarkdownKind.DesignDocument,
|
|
108
|
+
'describe-ui-component': AgentMarkdownKind.DesignDocument,
|
|
109
|
+
'describe-ui-screen': AgentMarkdownKind.DesignDocument,
|
|
110
|
+
'describe-ui-layout': AgentMarkdownKind.DesignDocument,
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const codeActions = new Set(['code', 'update-code', 'update-code-full'])
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The model's schema makes the final output self-describing; while it streams, the helper action
|
|
117
|
+
* gives the client the same semantic cue before a complete JSON value exists.
|
|
118
|
+
*/
|
|
119
|
+
const structuredActions: Record<string, AgentStructuredKind> = {
|
|
120
|
+
'choose-files-for-fix': AgentStructuredKind.ArtifactSelection,
|
|
121
|
+
'list-files-to-fix': AgentStructuredKind.ArtifactSelection,
|
|
122
|
+
'extract-user-stories-from-spec': AgentStructuredKind.StoryPlan,
|
|
123
|
+
'derive-connecting-stories': AgentStructuredKind.StoryPlan,
|
|
124
|
+
'derive-area-scaffold-stories': AgentStructuredKind.StoryPlan,
|
|
125
|
+
'describe-ux-story-transitions': AgentStructuredKind.TransitionPlan,
|
|
126
|
+
'find-entrypoint-for-screen': AgentStructuredKind.EntrypointSelection,
|
|
127
|
+
'describe-api-access': AgentStructuredKind.AccessPolicy,
|
|
128
|
+
'describe-screen-access': AgentStructuredKind.AccessPolicy,
|
|
129
|
+
'plan-scaffold': AgentStructuredKind.ScaffoldPlan,
|
|
130
|
+
'runtime-gate': AgentStructuredKind.RuntimeDecision,
|
|
131
|
+
'detect-story-with-home-screen': AgentStructuredKind.CandidateRanking,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const asRecord = (value: unknown): RecordValue | undefined =>
|
|
135
|
+
value != null && typeof value === 'object' && !Array.isArray(value)
|
|
136
|
+
? value as RecordValue
|
|
137
|
+
: undefined
|
|
138
|
+
|
|
139
|
+
const actionOf = (input: AgentMessageClassificationInput): string => input.action?.toLowerCase() ?? ''
|
|
140
|
+
|
|
141
|
+
const sourceOf = (input: AgentMessageClassificationInput): string =>
|
|
142
|
+
`${input.agent ?? ''} ${input.helper ?? ''}`.toLowerCase()
|
|
143
|
+
|
|
144
|
+
const contentOf = (input: AgentMessageClassificationInput): string => input.text?.trim() ?? ''
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Source extraction is an internal context-reduction pass. Its terminal tool call contains only
|
|
148
|
+
* line ranges, which are useful to the coder but add no useful information to a person's journal.
|
|
149
|
+
*/
|
|
150
|
+
export const isAgentMessageHidden = (input: AgentMessageClassificationInput): boolean =>
|
|
151
|
+
actionOf(input) === 'source-extract'
|
|
152
|
+
|
|
153
|
+
/** Maps the attribution that reached the event boundary to the visual specialist family. */
|
|
154
|
+
export const agentMessageRoleOf = (input: AgentMessageClassificationInput): AgentMessageRole => {
|
|
155
|
+
const source = sourceOf(input)
|
|
156
|
+
const action = actionOf(input)
|
|
157
|
+
|
|
158
|
+
if (action === 'arbitrary-modification' || source.includes('orchestrator')) return AgentMessageRole.Orchestrator
|
|
159
|
+
if (source.includes('fix')) return AgentMessageRole.Repair
|
|
160
|
+
if (source.includes('coder') || source.includes('developer') || codeActions.has(action)) return AgentMessageRole.Developer
|
|
161
|
+
if (source.includes('visual') || source.includes('ui-helper')) return AgentMessageRole.VisualDesign
|
|
162
|
+
if (source.includes('ux-')) return AgentMessageRole.Ux
|
|
163
|
+
if (source.includes('business') || source.includes('ba-') || source.includes('analysis') || source.includes('analyst')) return AgentMessageRole.Analytical
|
|
164
|
+
if (source.includes('product') || source.includes('naming')) return AgentMessageRole.Product
|
|
165
|
+
if (source.includes('architect') || source.includes('arch') || source.includes('layout-helper') ||
|
|
166
|
+
source.includes('api-helper') || source.includes('access-helper') || source.includes('datalayer-helper') ||
|
|
167
|
+
source.includes('domain') || source.includes('nav-helper') || source.includes('ui-com-helper') ||
|
|
168
|
+
source.includes('ui-state-helper')) return AgentMessageRole.Architect
|
|
169
|
+
return AgentMessageRole.Technical
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Pulls a schema argument out of LangChain's serialised tool-call shape. */
|
|
173
|
+
export const agentToolCallArguments = (value: unknown): unknown => {
|
|
174
|
+
if (!Array.isArray(value) || value.length !== 1) return value
|
|
175
|
+
const call = asRecord(value[0])
|
|
176
|
+
return call?.args ?? value
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const structuredKindOf = (value: unknown): AgentStructuredKind | undefined => {
|
|
180
|
+
if (value == null) return undefined
|
|
181
|
+
|
|
182
|
+
const toolArgs = agentToolCallArguments(value)
|
|
183
|
+
const object = asRecord(toolArgs)
|
|
184
|
+
if (object == null) {
|
|
185
|
+
if (Array.isArray(toolArgs)) return AgentStructuredKind.GenericList
|
|
186
|
+
return undefined
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Checked ahead of the single-array shapes below: a scaffold plan carries its own `stories`
|
|
190
|
+
// array (so the StoryPlan check would otherwise swallow it), and a runtime decision straight
|
|
191
|
+
// from the MODEL never carries `actor`/`worker` — those are added only once the decision is
|
|
192
|
+
// persisted onto a StoryDesign — so requiring them here missed every live model call.
|
|
193
|
+
if ('identity' in object && 'guestHome' in object && 'areas' in object && 'stories' in object) {
|
|
194
|
+
return AgentStructuredKind.ScaffoldPlan
|
|
195
|
+
}
|
|
196
|
+
if (Array.isArray(object.jobs) && Array.isArray(object.agents) && 'kv' in object) {
|
|
197
|
+
return AgentStructuredKind.RuntimeDecision
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (Array.isArray(object.files)) return AgentStructuredKind.ArtifactSelection
|
|
201
|
+
if (Array.isArray(object.entities)) return AgentStructuredKind.EntitySelection
|
|
202
|
+
if (Array.isArray(object.stories)) return AgentStructuredKind.StoryPlan
|
|
203
|
+
if (Array.isArray(object.screens)) return AgentStructuredKind.ScreenPlan
|
|
204
|
+
if (Array.isArray(object.components)) return AgentStructuredKind.ComponentPlan
|
|
205
|
+
if (Array.isArray(object.transitions)) return AgentStructuredKind.TransitionPlan
|
|
206
|
+
if (Array.isArray(object.entries)) return AgentStructuredKind.EntrypointSelection
|
|
207
|
+
if (Array.isArray(object.candidates)) return AgentStructuredKind.CandidateRanking
|
|
208
|
+
if (Object.values(object).some(value => {
|
|
209
|
+
const entry = asRecord(value)
|
|
210
|
+
return entry != null && Array.isArray(entry.permissions) && 'level' in entry
|
|
211
|
+
})) return AgentStructuredKind.AccessPolicy
|
|
212
|
+
return AgentStructuredKind.GenericRecord
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const decisionAction = (action: string): boolean =>
|
|
216
|
+
action.startsWith('should-') || action.startsWith('is-') || action.includes('blueprint-case') || action.includes('choose-case')
|
|
217
|
+
|
|
218
|
+
const fileExtensionLanguage = (path: string): AgentCodeLanguage => {
|
|
219
|
+
const name = path.toLowerCase().split('?')[0]
|
|
220
|
+
if (/\.(tsx|jsx)$/.test(name)) return AgentCodeLanguage.ReactTsx
|
|
221
|
+
if (/\.css$/.test(name)) return AgentCodeLanguage.Css
|
|
222
|
+
if (/\.(ts|mts|cts|js|mjs|cjs)$/.test(name)) return AgentCodeLanguage.TypeScript
|
|
223
|
+
if (/\.json$/.test(name)) return AgentCodeLanguage.Json
|
|
224
|
+
return AgentCodeLanguage.Other
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** Finds the language of a unified diff from its destination (or source) file path. */
|
|
228
|
+
export const agentDiffLanguageOf = (text: string): AgentCodeLanguage => {
|
|
229
|
+
const match = text.match(/^\+\+\+\s+(?:b\/)?(.+)$/m) ?? text.match(/^---\s+(?:a\/)?(.+)$/m)
|
|
230
|
+
return match == null ? AgentCodeLanguage.Other : fileExtensionLanguage(match[1])
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const fencedLanguageOf = (text: string): AgentCodeLanguage | undefined => {
|
|
234
|
+
const match = text.match(/^```([\w+-]+)/m)
|
|
235
|
+
const language = match?.[1]?.toLowerCase()
|
|
236
|
+
if (language == null) return undefined
|
|
237
|
+
if (['tsx', 'jsx', 'react'].includes(language)) return AgentCodeLanguage.ReactTsx
|
|
238
|
+
if (language === 'css') return AgentCodeLanguage.Css
|
|
239
|
+
if (['ts', 'typescript', 'js', 'javascript'].includes(language)) return AgentCodeLanguage.TypeScript
|
|
240
|
+
if (language === 'json') return AgentCodeLanguage.Json
|
|
241
|
+
return AgentCodeLanguage.Other
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** Conservative code detection; prose with one identifier remains plain text. */
|
|
245
|
+
export const agentCodeLanguageOf = (text: string): AgentCodeLanguage => {
|
|
246
|
+
const content = text.trim().replace(/^```[\w+-]*\n?|\n?```$/g, '')
|
|
247
|
+
const fenced = fencedLanguageOf(text)
|
|
248
|
+
if (fenced != null) return fenced
|
|
249
|
+
if (content === '') return AgentCodeLanguage.Other
|
|
250
|
+
try {
|
|
251
|
+
JSON.parse(content)
|
|
252
|
+
if (/^[{[]/.test(content)) return AgentCodeLanguage.Json
|
|
253
|
+
} catch {
|
|
254
|
+
// The remaining heuristics deliberately require source-like syntax.
|
|
255
|
+
}
|
|
256
|
+
if (/<[A-Za-z][\w.:-]*(?:\s[^>]*)?\/>|<[A-Za-z][\w.:-]*(?:\s[^>]*)?>/.test(content) &&
|
|
257
|
+
/\b(import|export|const|function|return)\b/.test(content)) return AgentCodeLanguage.ReactTsx
|
|
258
|
+
if (/(^|\n)\s*(?:[.#][\w-]+|[a-z][\w-]*(?:\[[^\]]+\])?)\s*\{[^}]*:[^}]*\}/.test(content)) {
|
|
259
|
+
return AgentCodeLanguage.Css
|
|
260
|
+
}
|
|
261
|
+
if (/\b(import|export|interface|type|const|let|function|class)\b/.test(content) &&
|
|
262
|
+
/[;{}]|=>/.test(content)) return AgentCodeLanguage.TypeScript
|
|
263
|
+
return AgentCodeLanguage.Other
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export const isUnifiedDiff = (text: string): boolean =>
|
|
267
|
+
/^---\s+.+\n\+\+\+\s+.+/m.test(text) || (/^@@\s+[-+]/m.test(text) && /^(?:\+|-)[^+-]/m.test(text))
|
|
268
|
+
|
|
269
|
+
const markdownKindOf = (text: string): AgentMarkdownKind | undefined => {
|
|
270
|
+
if (/^#{1,6}\s+/m.test(text) || /^>\s+/m.test(text) || /^\|.+\|\s*$/m.test(text)) {
|
|
271
|
+
return AgentMarkdownKind.Documentation
|
|
272
|
+
}
|
|
273
|
+
const listItems = text.match(/^\s*(?:[-*+]\s+|\d+[.)]\s+)/gm)?.length ?? 0
|
|
274
|
+
return listItems >= 2 ? AgentMarkdownKind.Documentation : undefined
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Classifies known model output by source AND shape. The `value` comes from a caller's JSON
|
|
279
|
+
* parser; this runtime-free package intentionally never repairs or parses streamed JSON itself.
|
|
280
|
+
*/
|
|
281
|
+
/**
|
|
282
|
+
* Actions run by an unconstrained tool-calling loop (the coding agent, the repair/architect/
|
|
283
|
+
* lookup sub-agents, source extraction) rather than a single pinned-schema call. Their tool calls
|
|
284
|
+
* are file/shell operations, not model-schema output, so they always render as ToolCalls even
|
|
285
|
+
* when a call's arguments happen to shape-match a schema kind — `read_sources({ files })` looks
|
|
286
|
+
* exactly like an ArtifactSelection.
|
|
287
|
+
*/
|
|
288
|
+
const agentLoopActions = new Set([
|
|
289
|
+
'coding-agent-ask', 'arbitrary-modification', 'fix-agent', 'architect', 'declaration-lookup',
|
|
290
|
+
'source-extract',
|
|
291
|
+
])
|
|
292
|
+
|
|
293
|
+
const isGenericStructure = (kind: AgentStructuredKind | undefined): boolean =>
|
|
294
|
+
kind == null || kind === AgentStructuredKind.GenericRecord || kind === AgentStructuredKind.GenericList ||
|
|
295
|
+
kind === AgentStructuredKind.GenericValue
|
|
296
|
+
|
|
297
|
+
export const classifyAgentMessage = (input: AgentMessageClassificationInput): AgentMessagePresentation => {
|
|
298
|
+
const role = agentMessageRoleOf(input)
|
|
299
|
+
const action = actionOf(input)
|
|
300
|
+
const text = contentOf(input)
|
|
301
|
+
const structure = structuredKindOf(input.value)
|
|
302
|
+
|
|
303
|
+
if (input.outputType === 'tool_calls') {
|
|
304
|
+
// A single pinned-schema call resolves to its own card; everything else — several calls in
|
|
305
|
+
// one turn, an unconstrained agent-loop action, or a shape too generic to be informative —
|
|
306
|
+
// is a tool call, not a schema result.
|
|
307
|
+
const isMultiCall = Array.isArray(input.value) && input.value.length > 1
|
|
308
|
+
const isToolCalls = isMultiCall || agentLoopActions.has(action) || isGenericStructure(structure)
|
|
309
|
+
return {
|
|
310
|
+
category: AgentMessageCategory.Structured,
|
|
311
|
+
structure: isToolCalls ? AgentStructuredKind.ToolCalls : structure!,
|
|
312
|
+
role,
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (structure != null) return { category: AgentMessageCategory.Structured, structure, role }
|
|
316
|
+
const actionStructure = structuredActions[action]
|
|
317
|
+
if (actionStructure != null) return { category: AgentMessageCategory.Structured, structure: actionStructure, role }
|
|
318
|
+
if (decisionAction(action)) return { category: AgentMessageCategory.Structured, structure: AgentStructuredKind.Decision, role }
|
|
319
|
+
if (isUnifiedDiff(text) || action === 'update-code') {
|
|
320
|
+
return { category: AgentMessageCategory.Diff, language: agentDiffLanguageOf(text), role }
|
|
321
|
+
}
|
|
322
|
+
if (codeActions.has(action) || fencedLanguageOf(text) != null || agentCodeLanguageOf(text) !== AgentCodeLanguage.Other) {
|
|
323
|
+
return { category: AgentMessageCategory.Code, language: agentCodeLanguageOf(text), role }
|
|
324
|
+
}
|
|
325
|
+
const document = documentActions[action] ?? markdownKindOf(text)
|
|
326
|
+
if (document != null) return { category: AgentMessageCategory.Markdown, document, role }
|
|
327
|
+
if (input.value != null) {
|
|
328
|
+
return {
|
|
329
|
+
category: AgentMessageCategory.Structured,
|
|
330
|
+
structure: Array.isArray(input.value) ? AgentStructuredKind.GenericList : AgentStructuredKind.GenericValue,
|
|
331
|
+
role,
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return { category: AgentMessageCategory.Plain, role }
|
|
335
|
+
}
|
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.22',
|
|
65
|
+
'@owlmeans/agent': '^0.1.18-rc.25',
|
|
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.21',
|
|
218
218
|
},
|
|
219
219
|
},
|
|
220
220
|
libraries: AI_LIBRARIES,
|