@owlmeans/viable-common 0.0.43 → 0.0.44
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 +22 -11
- package/build/agent/consts.d.ts +58 -0
- package/build/agent/consts.d.ts.map +1 -0
- package/build/agent/consts.js +63 -0
- package/build/agent/consts.js.map +1 -0
- package/build/agent/consts.local.d.ts +21 -0
- package/build/agent/consts.local.d.ts.map +1 -0
- package/build/agent/consts.local.js +44 -0
- package/build/agent/consts.local.js.map +1 -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 +2 -86
- package/build/agent/presentation.d.ts.map +1 -1
- package/build/agent/presentation.js +2 -104
- package/build/agent/presentation.js.map +1 -1
- package/build/agent/types.d.ts +30 -0
- package/build/agent/types.d.ts.map +1 -1
- package/build/agent/types.local.d.ts +2 -0
- package/build/agent/types.local.d.ts.map +1 -0
- package/build/agent/types.local.js +2 -0
- package/build/agent/types.local.js.map +1 -0
- package/build/areas/consts.d.ts +5 -0
- package/build/areas/consts.d.ts.map +1 -1
- package/build/areas/consts.js +4 -0
- package/build/areas/consts.js.map +1 -1
- package/build/areas/tenancy.d.ts +1 -36
- package/build/areas/tenancy.d.ts.map +1 -1
- package/build/areas/tenancy.js +1 -5
- package/build/areas/tenancy.js.map +1 -1
- package/build/areas/types.d.ts +32 -0
- package/build/areas/types.d.ts.map +1 -1
- package/build/ba/types.d.ts +1 -1
- package/build/ba/types.d.ts.map +1 -1
- package/build/blueprint/consts.d.ts +41 -0
- package/build/blueprint/consts.d.ts.map +1 -1
- package/build/blueprint/consts.js +51 -0
- package/build/blueprint/consts.js.map +1 -1
- package/build/blueprint/consts.local.d.ts +2 -0
- package/build/blueprint/consts.local.d.ts.map +1 -0
- package/build/blueprint/consts.local.js +3 -0
- package/build/blueprint/consts.local.js.map +1 -0
- package/build/blueprint/index.d.ts +1 -0
- package/build/blueprint/index.d.ts.map +1 -1
- package/build/blueprint/index.js +1 -0
- package/build/blueprint/index.js.map +1 -1
- package/build/blueprint/types.d.ts +2 -50
- package/build/blueprint/types.d.ts.map +1 -1
- package/build/blueprint/types.js +1 -65
- package/build/blueprint/types.js.map +1 -1
- package/build/blueprint/utils.d.ts +11 -0
- package/build/blueprint/utils.d.ts.map +1 -0
- package/build/blueprint/utils.js +16 -0
- package/build/blueprint/utils.js.map +1 -0
- package/build/branding.d.ts +0 -8
- package/build/branding.d.ts.map +1 -1
- package/build/branding.js +0 -16
- package/build/branding.js.map +1 -1
- package/build/connect/consts.d.ts +0 -10
- package/build/connect/consts.d.ts.map +1 -1
- package/build/connect/consts.js +0 -23
- package/build/connect/consts.js.map +1 -1
- package/build/connect/entrypoints.d.ts +49 -86
- package/build/connect/entrypoints.d.ts.map +1 -1
- package/build/connect/entrypoints.js +5 -2
- package/build/connect/entrypoints.js.map +1 -1
- package/build/connect/errors.d.ts +32 -0
- package/build/connect/errors.d.ts.map +1 -1
- package/build/connect/errors.js +65 -0
- package/build/connect/errors.js.map +1 -1
- package/build/connect/index.d.ts +1 -0
- package/build/connect/index.d.ts.map +1 -1
- package/build/connect/index.js +1 -0
- package/build/connect/index.js.map +1 -1
- package/build/connect/references.d.ts +1 -153
- package/build/connect/references.d.ts.map +1 -1
- package/build/connect/references.js.map +1 -1
- package/build/connect/schemas.d.ts +2 -1
- package/build/connect/schemas.d.ts.map +1 -1
- package/build/connect/schemas.js +9 -0
- package/build/connect/schemas.js.map +1 -1
- package/build/connect/types.d.ts +214 -1
- package/build/connect/types.d.ts.map +1 -1
- package/build/connect/types.local.d.ts +4 -0
- package/build/connect/types.local.d.ts.map +1 -0
- package/build/connect/types.local.js +2 -0
- package/build/connect/types.local.js.map +1 -0
- package/build/connect/utils.d.ts +12 -0
- package/build/connect/utils.d.ts.map +1 -0
- package/build/connect/utils.js +25 -0
- package/build/connect/utils.js.map +1 -0
- package/build/consts.d.ts +8 -0
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +16 -0
- package/build/consts.js.map +1 -1
- package/build/convert/consts.d.ts +0 -12
- package/build/convert/consts.d.ts.map +1 -1
- package/build/convert/consts.js +0 -3
- package/build/convert/consts.js.map +1 -1
- package/build/convert/consts.local.d.ts +55 -0
- package/build/convert/consts.local.d.ts.map +1 -0
- package/build/convert/consts.local.js +104 -0
- package/build/convert/consts.local.js.map +1 -0
- package/build/convert/helpers.d.ts.map +1 -1
- package/build/convert/helpers.js +1 -102
- package/build/convert/helpers.js.map +1 -1
- package/build/convert/index.d.ts +1 -0
- package/build/convert/index.d.ts.map +1 -1
- package/build/convert/index.js +1 -0
- package/build/convert/index.js.map +1 -1
- package/build/convert/types.d.ts +10 -1
- package/build/convert/types.d.ts.map +1 -1
- package/build/convert/utils.d.ts +4 -0
- package/build/convert/utils.d.ts.map +1 -0
- package/build/convert/utils.js +5 -0
- package/build/convert/utils.js.map +1 -0
- package/build/design/consts.d.ts +37 -0
- package/build/design/consts.d.ts.map +1 -1
- package/build/design/consts.js +44 -8
- package/build/design/consts.js.map +1 -1
- package/build/design/runtime.d.ts +2 -103
- package/build/design/runtime.d.ts.map +1 -1
- package/build/design/runtime.js +1 -44
- package/build/design/runtime.js.map +1 -1
- package/build/design/schemas.d.ts +1 -9
- package/build/design/schemas.d.ts.map +1 -1
- package/build/design/schemas.js +1 -1
- package/build/design/schemas.js.map +1 -1
- package/build/design/types.d.ts +75 -1
- package/build/design/types.d.ts.map +1 -1
- package/build/dev/schemas.d.ts.map +1 -1
- package/build/dev/schemas.js.map +1 -1
- package/build/dev/types.local.d.ts +4 -0
- package/build/dev/types.local.d.ts.map +1 -0
- package/build/dev/types.local.js +2 -0
- package/build/dev/types.local.js.map +1 -0
- package/build/integrity/consts.d.ts +0 -117
- package/build/integrity/consts.d.ts.map +1 -1
- package/build/integrity/consts.js +0 -281
- package/build/integrity/consts.js.map +1 -1
- package/build/integrity/consts.local.d.ts +5 -0
- package/build/integrity/consts.local.d.ts.map +1 -0
- package/build/integrity/consts.local.js +5 -0
- package/build/integrity/consts.local.js.map +1 -0
- package/build/integrity/index.d.ts +1 -0
- package/build/integrity/index.d.ts.map +1 -1
- package/build/integrity/index.js +1 -0
- package/build/integrity/index.js.map +1 -1
- package/build/integrity/types.d.ts +33 -1
- package/build/integrity/types.d.ts.map +1 -1
- package/build/integrity/utils.d.ts +88 -0
- package/build/integrity/utils.d.ts.map +1 -0
- package/build/integrity/utils.js +280 -0
- package/build/integrity/utils.js.map +1 -0
- package/build/integrity/verify.d.ts.map +1 -1
- package/build/integrity/verify.js +2 -1
- package/build/integrity/verify.js.map +1 -1
- package/build/intent/consts.local.d.ts +4 -0
- package/build/intent/consts.local.d.ts.map +1 -0
- package/build/intent/consts.local.js +3 -0
- package/build/intent/consts.local.js.map +1 -0
- package/build/intent/entrypoints.d.ts +0 -1
- package/build/intent/entrypoints.d.ts.map +1 -1
- package/build/intent/flow.d.ts.map +1 -1
- package/build/intent/flow.js +2 -2
- package/build/intent/flow.js.map +1 -1
- package/build/intent/types.d.ts +2 -0
- package/build/intent/types.d.ts.map +1 -1
- package/build/metadata/consts.d.ts +33 -0
- package/build/metadata/consts.d.ts.map +1 -1
- package/build/metadata/consts.js +37 -0
- package/build/metadata/consts.js.map +1 -1
- package/build/metadata/types.d.ts +1 -33
- package/build/metadata/types.d.ts.map +1 -1
- package/build/metadata/types.js +1 -38
- package/build/metadata/types.js.map +1 -1
- package/build/planning/consts.d.ts +13 -1
- package/build/planning/consts.d.ts.map +1 -1
- package/build/planning/consts.js +13 -0
- package/build/planning/consts.js.map +1 -1
- package/build/planning/index.d.ts +0 -1
- package/build/planning/index.d.ts.map +1 -1
- package/build/planning/index.js +0 -1
- package/build/planning/index.js.map +1 -1
- package/build/planning/landing.d.ts +0 -12
- package/build/planning/landing.d.ts.map +1 -1
- package/build/planning/landing.js +1 -13
- package/build/planning/landing.js.map +1 -1
- package/build/planning/schemas.d.ts +37 -0
- package/build/planning/schemas.d.ts.map +1 -1
- package/build/planning/schemas.js +173 -4
- package/build/planning/schemas.js.map +1 -1
- package/build/planning/types.d.ts +2 -2
- package/build/planning/types.d.ts.map +1 -1
- package/build/preview/consts.d.ts +3 -1
- package/build/preview/consts.d.ts.map +1 -1
- package/build/preview/consts.js +2 -0
- package/build/preview/consts.js.map +1 -1
- package/build/preview/types.d.ts +17 -2
- package/build/preview/types.d.ts.map +1 -1
- package/build/scaffold/helpers.d.ts +1 -14
- package/build/scaffold/helpers.d.ts.map +1 -1
- package/build/scaffold/helpers.js +11 -0
- package/build/scaffold/helpers.js.map +1 -1
- package/build/scaffold/types.d.ts +2 -0
- package/build/scaffold/types.d.ts.map +1 -1
- package/build/slot/consts.d.ts +7 -13
- package/build/slot/consts.d.ts.map +1 -1
- package/build/slot/consts.js +10 -36
- package/build/slot/consts.js.map +1 -1
- package/build/slot/helpers.d.ts +1 -6
- package/build/slot/helpers.d.ts.map +1 -1
- package/build/slot/helpers.js.map +1 -1
- package/build/slot/index.d.ts +1 -0
- package/build/slot/index.d.ts.map +1 -1
- package/build/slot/index.js +1 -0
- package/build/slot/index.js.map +1 -1
- package/build/slot/layout.d.ts +1 -57
- package/build/slot/layout.d.ts.map +1 -1
- package/build/slot/layout.js +0 -12
- package/build/slot/layout.js.map +1 -1
- package/build/slot/types.d.ts +55 -1
- package/build/slot/types.d.ts.map +1 -1
- package/build/slot/utils.d.ts +18 -0
- package/build/slot/utils.d.ts.map +1 -0
- package/build/slot/utils.js +41 -0
- package/build/slot/utils.js.map +1 -0
- package/build/topology/card.d.ts +1 -6
- package/build/topology/card.d.ts.map +1 -1
- package/build/topology/card.js +1 -3
- package/build/topology/card.js.map +1 -1
- package/build/topology/consts.local.d.ts +4 -0
- package/build/topology/consts.local.d.ts.map +1 -0
- package/build/topology/consts.local.js +4 -0
- package/build/topology/consts.local.js.map +1 -0
- package/build/topology/types.d.ts +5 -0
- package/build/topology/types.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/agent/consts.local.ts +47 -0
- package/src/agent/consts.ts +61 -0
- package/src/agent/index.ts +1 -0
- package/src/agent/presentation.ts +4 -147
- package/src/agent/types.local.ts +1 -0
- package/src/agent/types.ts +40 -0
- package/src/areas/consts.ts +7 -0
- package/src/areas/tenancy.ts +2 -38
- package/src/areas/types.ts +31 -0
- package/src/ba/types.ts +1 -1
- package/src/blueprint/consts.local.ts +3 -0
- package/src/blueprint/consts.ts +52 -0
- package/src/blueprint/index.ts +1 -0
- package/src/blueprint/types.ts +2 -72
- package/src/blueprint/utils.ts +20 -0
- package/src/branding.ts +0 -17
- package/src/connect/consts.ts +0 -22
- package/src/connect/entrypoints.ts +7 -35
- package/src/connect/errors.ts +75 -0
- package/src/connect/index.ts +1 -0
- package/src/connect/references.ts +4 -75
- package/src/connect/schemas.ts +11 -0
- package/src/connect/types.local.ts +5 -0
- package/src/connect/types.ts +124 -1
- package/src/connect/utils.ts +23 -0
- package/src/consts.ts +17 -0
- package/src/convert/consts.local.ts +120 -0
- package/src/convert/consts.ts +0 -14
- package/src/convert/helpers.ts +1 -119
- package/src/convert/index.ts +1 -0
- package/src/convert/types.ts +11 -5
- package/src/convert/utils.ts +8 -0
- package/src/design/consts.ts +48 -0
- package/src/design/runtime.ts +2 -115
- package/src/design/schemas.ts +2 -10
- package/src/design/types.ts +81 -1
- package/src/dev/schemas.ts +1 -3
- package/src/dev/types.local.ts +4 -0
- package/src/integrity/consts.local.ts +5 -0
- package/src/integrity/consts.ts +0 -348
- package/src/integrity/index.ts +1 -0
- package/src/integrity/types.ts +34 -1
- package/src/integrity/utils.ts +320 -0
- package/src/integrity/verify.ts +2 -4
- package/src/intent/consts.local.ts +3 -0
- package/src/intent/entrypoints.ts +0 -1
- package/src/intent/flow.ts +2 -3
- package/src/intent/types.ts +3 -0
- package/src/metadata/consts.ts +37 -0
- package/src/metadata/types.ts +1 -37
- package/src/planning/consts.ts +15 -2
- package/src/planning/index.ts +0 -1
- package/src/planning/landing.ts +1 -14
- package/src/planning/schemas.ts +191 -4
- package/src/planning/types.ts +2 -2
- package/src/preview/consts.ts +2 -0
- package/src/preview/types.ts +19 -0
- package/src/scaffold/helpers.ts +1 -4
- package/src/scaffold/types.ts +3 -0
- package/src/slot/consts.ts +11 -40
- package/src/slot/helpers.ts +1 -6
- package/src/slot/index.ts +1 -0
- package/src/slot/layout.ts +1 -62
- package/src/slot/types.ts +57 -1
- package/src/slot/utils.ts +45 -0
- package/src/topology/card.ts +2 -9
- package/src/topology/consts.local.ts +6 -0
- package/src/topology/types.ts +6 -0
- package/tests/branding.spec.ts +2 -2
- package/tests/connect-convert.spec.ts +21 -1
- package/tests/connect-errors.spec.ts +34 -1
- package/tests/convert.spec.ts +2 -3
- package/tests/error-status.spec.ts +7 -1
- package/tests/planning.spec.ts +3 -18
- package/tests/presentation.spec.ts +2 -4
- package/build/planning/flows.d.ts +0 -34
- package/build/planning/flows.d.ts.map +0 -1
- package/build/planning/flows.js +0 -174
- package/build/planning/flows.js.map +0 -1
- package/src/planning/flows.ts +0 -204
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/viable-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
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, and the intent-first hand-off from the public site to the platform.",
|
|
6
6
|
"type": "module",
|
|
@@ -58,24 +58,24 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@langchain/core": "^1.2.
|
|
61
|
+
"@langchain/core": "^1.2.14",
|
|
62
62
|
"@owlmeans/dep-config": "workspace:*",
|
|
63
|
-
"ajv": "^8.
|
|
63
|
+
"ajv": "^8.20.0",
|
|
64
64
|
"ajv-formats": "^3.0.1",
|
|
65
65
|
"nodemon": "^3.1.14",
|
|
66
66
|
"typescript": "^7.0.2"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@owlmeans/agent-common": "^0.1.18-rc.
|
|
70
|
-
"@owlmeans/auth": "^0.1.18-rc.
|
|
71
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
72
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
73
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
74
|
-
"@owlmeans/flow": "^0.1.18-rc.
|
|
75
|
-
"@owlmeans/llm-common": "^0.1.18-rc.
|
|
76
|
-
"@owlmeans/planning": "^0.1.18-rc.
|
|
77
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
78
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
69
|
+
"@owlmeans/agent-common": "^0.1.18-rc.47",
|
|
70
|
+
"@owlmeans/auth": "^0.1.18-rc.39",
|
|
71
|
+
"@owlmeans/context": "^0.1.18-rc.33",
|
|
72
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.40",
|
|
73
|
+
"@owlmeans/error": "^0.1.18-rc.37",
|
|
74
|
+
"@owlmeans/flow": "^0.1.18-rc.44",
|
|
75
|
+
"@owlmeans/llm-common": "^0.1.18-rc.38",
|
|
76
|
+
"@owlmeans/planning": "^0.1.18-rc.18",
|
|
77
|
+
"@owlmeans/resource": "^0.1.18-rc.39",
|
|
78
|
+
"@owlmeans/route": "^0.1.18-rc.34"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AgentMarkdownKind, AgentStructuredKind } from './consts.js'
|
|
2
|
+
|
|
3
|
+
export const documentActions: Record<string, AgentMarkdownKind> = {
|
|
4
|
+
'write-specification': AgentMarkdownKind.Specification,
|
|
5
|
+
'summarize-specification': AgentMarkdownKind.Specification,
|
|
6
|
+
'write-design-concept': AgentMarkdownKind.DesignDocument,
|
|
7
|
+
'describe-ui-component': AgentMarkdownKind.DesignDocument,
|
|
8
|
+
'describe-ui-screen': AgentMarkdownKind.DesignDocument,
|
|
9
|
+
'describe-ui-layout': AgentMarkdownKind.DesignDocument,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const codeActions = new Set(['code', 'update-code', 'update-code-full'])
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The model's schema makes the final output self-describing; while it streams, the helper action
|
|
16
|
+
* gives the client the same semantic cue before a complete JSON value exists.
|
|
17
|
+
*/
|
|
18
|
+
export const structuredActions: Record<string, AgentStructuredKind> = {
|
|
19
|
+
'choose-files-for-fix': AgentStructuredKind.ArtifactSelection,
|
|
20
|
+
'list-files-to-fix': AgentStructuredKind.ArtifactSelection,
|
|
21
|
+
'extract-user-stories-from-spec': AgentStructuredKind.StoryPlan,
|
|
22
|
+
'derive-connecting-stories': AgentStructuredKind.StoryPlan,
|
|
23
|
+
'derive-area-scaffold-stories': AgentStructuredKind.StoryPlan,
|
|
24
|
+
'describe-ux-story-transitions': AgentStructuredKind.TransitionPlan,
|
|
25
|
+
'find-entrypoint-for-screen': AgentStructuredKind.EntrypointSelection,
|
|
26
|
+
'describe-api-access': AgentStructuredKind.AccessPolicy,
|
|
27
|
+
'describe-screen-access': AgentStructuredKind.AccessPolicy,
|
|
28
|
+
'plan-scaffold': AgentStructuredKind.ScaffoldPlan,
|
|
29
|
+
'runtime-gate': AgentStructuredKind.RuntimeDecision,
|
|
30
|
+
'detect-story-with-home-screen': AgentStructuredKind.CandidateRanking,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Classifies known model output by source AND shape. The `value` comes from a caller's JSON
|
|
35
|
+
* parser; this runtime-free package intentionally never repairs or parses streamed JSON itself.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Actions run by an unconstrained tool-calling loop (the coding agent, the repair/architect/
|
|
39
|
+
* lookup sub-agents, source extraction) rather than a single pinned-schema call. Their tool calls
|
|
40
|
+
* are file/shell operations, not model-schema output, so they always render as ToolCalls even
|
|
41
|
+
* when a call's arguments happen to shape-match a schema kind — `read_sources({ files })` looks
|
|
42
|
+
* exactly like an ArtifactSelection.
|
|
43
|
+
*/
|
|
44
|
+
export const agentLoopActions = new Set([
|
|
45
|
+
'coding-agent-ask', 'arbitrary-modification', 'fix-agent', 'architect', 'declaration-lookup',
|
|
46
|
+
'source-extract',
|
|
47
|
+
])
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
}
|
package/src/agent/index.ts
CHANGED
|
@@ -1,135 +1,8 @@
|
|
|
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
1
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
}
|
|
2
|
+
import { agentLoopActions, codeActions, documentActions, structuredActions } from './consts.local.js'
|
|
3
|
+
import { AgentCodeLanguage, AgentMarkdownKind, AgentMessageCategory, AgentMessageRole, AgentStructuredKind } from './consts.js'
|
|
4
|
+
import type { RecordValue } from './types.local.js'
|
|
5
|
+
import type { AgentMessageClassificationInput, AgentMessagePresentation } from './types.js'
|
|
133
6
|
|
|
134
7
|
const asRecord = (value: unknown): RecordValue | undefined =>
|
|
135
8
|
value != null && typeof value === 'object' && !Array.isArray(value)
|
|
@@ -274,22 +147,6 @@ const markdownKindOf = (text: string): AgentMarkdownKind | undefined => {
|
|
|
274
147
|
return listItems >= 2 ? AgentMarkdownKind.Documentation : undefined
|
|
275
148
|
}
|
|
276
149
|
|
|
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
150
|
const isGenericStructure = (kind: AgentStructuredKind | undefined): boolean =>
|
|
294
151
|
kind == null || kind === AgentStructuredKind.GenericRecord || kind === AgentStructuredKind.GenericList ||
|
|
295
152
|
kind === AgentStructuredKind.GenericValue
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RecordValue = Record<string, unknown>
|
package/src/agent/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LlmPurpose } from '@owlmeans/llm-common'
|
|
2
|
+
import { AgentCodeLanguage, AgentMarkdownKind, AgentMessageCategory, AgentMessageRole, AgentStructuredKind } from './consts.js'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Observability metadata attached to every model call. Extends the generic
|
|
@@ -8,3 +9,42 @@ export interface PurposeMetadata extends LlmPurpose {
|
|
|
8
9
|
viableAgent?: string
|
|
9
10
|
viableHelper?: string
|
|
10
11
|
}
|
|
12
|
+
|
|
13
|
+
export interface AgentCodePresentation {
|
|
14
|
+
category: AgentMessageCategory.Code | AgentMessageCategory.Diff
|
|
15
|
+
language: AgentCodeLanguage
|
|
16
|
+
role: AgentMessageRole
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface AgentStructuredPresentation {
|
|
20
|
+
category: AgentMessageCategory.Structured
|
|
21
|
+
structure: AgentStructuredKind
|
|
22
|
+
role: AgentMessageRole
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface AgentMarkdownPresentation {
|
|
26
|
+
category: AgentMessageCategory.Markdown
|
|
27
|
+
document: AgentMarkdownKind
|
|
28
|
+
role: AgentMessageRole
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface AgentPlainPresentation {
|
|
32
|
+
category: AgentMessageCategory.Plain
|
|
33
|
+
role: AgentMessageRole
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type AgentMessagePresentation =
|
|
37
|
+
| AgentCodePresentation
|
|
38
|
+
| AgentStructuredPresentation
|
|
39
|
+
| AgentMarkdownPresentation
|
|
40
|
+
| AgentPlainPresentation
|
|
41
|
+
|
|
42
|
+
/** The attribution and content available to either side of a thinking event. */
|
|
43
|
+
export interface AgentMessageClassificationInput {
|
|
44
|
+
agent?: string
|
|
45
|
+
helper?: string
|
|
46
|
+
action?: string
|
|
47
|
+
outputType?: string
|
|
48
|
+
text?: string
|
|
49
|
+
value?: unknown
|
|
50
|
+
}
|
package/src/areas/consts.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AccessLevel } from '../dev/consts.js'
|
|
2
|
+
import type { ProjectTenancy } from './types.js'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The audiences a generated application serves.
|
|
@@ -110,3 +111,9 @@ export const AREA_TIER: Record<ProjectArea, string | null> = {
|
|
|
110
111
|
[ProjectArea.Admin]: null,
|
|
111
112
|
[ProjectArea.Operator]: ProjectArea.Operator,
|
|
112
113
|
}
|
|
114
|
+
|
|
115
|
+
/** The longest requester sentence a tenancy decision quotes — a card refuses a longer one. */
|
|
116
|
+
export const TENANCY_QUOTE_MAX = 1024
|
|
117
|
+
|
|
118
|
+
/** A single-organization application — what every project is until a decision says otherwise. */
|
|
119
|
+
export const NO_TENANCY: ProjectTenancy = Object.freeze({ operators: false, users: false })
|
package/src/areas/tenancy.ts
CHANGED
|
@@ -1,42 +1,6 @@
|
|
|
1
1
|
import type { Blueprint } from '../blueprint/types.js'
|
|
2
|
-
import { ProjectArea } from './consts.js'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Whether a generated application splits its audiences into tenant ORGANIZATIONS.
|
|
6
|
-
*
|
|
7
|
-
* Two flags rather than one, because the two audiences split independently: one back office can
|
|
8
|
-
* serve end users who each belong to their own company (`users` only), every reseller can run its
|
|
9
|
-
* own staff over one shared public (`operators` only), and a B2B tool usually does both. An
|
|
10
|
-
* organization is an IAM-managed tenant — never a table the target keeps for itself.
|
|
11
|
-
*
|
|
12
|
-
* Both false is today's application: one organization, the project owner's, that every person acts in.
|
|
13
|
-
*/
|
|
14
|
-
export interface ProjectTenancy {
|
|
15
|
-
/** The staff of the back office are split into tenant organizations. */
|
|
16
|
-
operators: boolean
|
|
17
|
-
/** The end users of the front office are distributed across tenant organizations. */
|
|
18
|
-
users: boolean
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A tenancy decision as the project card records it (`fields.tenancy`).
|
|
23
|
-
*
|
|
24
|
-
* The flags plus where they came from. `quotes` are the requester's OWN sentences, verbatim — the
|
|
25
|
-
* evidence a later reader (a person reviewing the board, a run asked to reconsider) checks the
|
|
26
|
-
* decision against, which a paraphrase would quietly replace with the model's reading of it.
|
|
27
|
-
* `by` says whether a model inferred it or the owner set it; `at` is when, an ISO timestamp.
|
|
28
|
-
*/
|
|
29
|
-
export interface ViableTenancyDecision extends ProjectTenancy {
|
|
30
|
-
quotes?: { operators?: string; users?: string }
|
|
31
|
-
by: 'model' | 'owner'
|
|
32
|
-
at: string
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** The longest requester sentence a tenancy decision quotes — a card refuses a longer one. */
|
|
36
|
-
export const TENANCY_QUOTE_MAX = 1024
|
|
37
|
-
|
|
38
|
-
/** A single-organization application — what every project is until a decision says otherwise. */
|
|
39
|
-
export const NO_TENANCY: ProjectTenancy = Object.freeze({ operators: false, users: false })
|
|
2
|
+
import { ProjectArea, NO_TENANCY } from './consts.js'
|
|
3
|
+
import type { ProjectTenancy } from './types.js'
|
|
40
4
|
|
|
41
5
|
/**
|
|
42
6
|
* The tenancy of a resolved blueprint.
|
package/src/areas/types.ts
CHANGED
|
@@ -27,3 +27,34 @@ export interface NavEntry {
|
|
|
27
27
|
alias: string
|
|
28
28
|
label: string
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether a generated application splits its audiences into tenant ORGANIZATIONS.
|
|
33
|
+
*
|
|
34
|
+
* Two flags rather than one, because the two audiences split independently: one back office can
|
|
35
|
+
* serve end users who each belong to their own company (`users` only), every reseller can run its
|
|
36
|
+
* own staff over one shared public (`operators` only), and a B2B tool usually does both. An
|
|
37
|
+
* organization is an IAM-managed tenant — never a table the target keeps for itself.
|
|
38
|
+
*
|
|
39
|
+
* Both false is today's application: one organization, the project owner's, that every person acts in.
|
|
40
|
+
*/
|
|
41
|
+
export interface ProjectTenancy {
|
|
42
|
+
/** The staff of the back office are split into tenant organizations. */
|
|
43
|
+
operators: boolean
|
|
44
|
+
/** The end users of the front office are distributed across tenant organizations. */
|
|
45
|
+
users: boolean
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A tenancy decision as the project card records it (`fields.tenancy`).
|
|
50
|
+
*
|
|
51
|
+
* The flags plus where they came from. `quotes` are the requester's OWN sentences, verbatim — the
|
|
52
|
+
* evidence a later reader (a person reviewing the board, a run asked to reconsider) checks the
|
|
53
|
+
* decision against, which a paraphrase would quietly replace with the model's reading of it.
|
|
54
|
+
* `by` says whether a model inferred it or the owner set it; `at` is when, an ISO timestamp.
|
|
55
|
+
*/
|
|
56
|
+
export interface ViableTenancyDecision extends ProjectTenancy {
|
|
57
|
+
quotes?: { operators?: string; users?: string }
|
|
58
|
+
by: 'model' | 'owner'
|
|
59
|
+
at: string
|
|
60
|
+
}
|
package/src/ba/types.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { SpecCategory } from "./consts"
|
|
|
2
2
|
import type { ConnectingStoryKind, StoryKind } from "./consts.js"
|
|
3
3
|
import type { ProjectArea } from "../areas/consts.js"
|
|
4
4
|
import type { StoryDraft } from "../areas/types.js"
|
|
5
|
-
import type { StoryActor } from "../design/
|
|
5
|
+
import type { StoryActor } from "../design/consts.js"
|
|
6
6
|
|
|
7
7
|
export interface EntityList {
|
|
8
8
|
entities: string[]
|
package/src/blueprint/consts.ts
CHANGED
|
@@ -85,3 +85,55 @@ export enum WorkKind {
|
|
|
85
85
|
|
|
86
86
|
/** The longest case quote a project card keeps (`fields.caseQuote`) — one sentence, generously. */
|
|
87
87
|
export const CASE_QUOTE_MAX = 1024
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The layers, lowest first. A higher layer's value replaces the same key from a lower one.
|
|
91
|
+
*
|
|
92
|
+
* The ordering is the point: `technology` overrides everything, because a change of language
|
|
93
|
+
* invalidates every template, prompt and package below it. Nothing today has more than one
|
|
94
|
+
* technology — the ladder exists so that adding one is a data change. `experience` is last and
|
|
95
|
+
* optional: it shares no key with the five build layers, so its place decides nothing today.
|
|
96
|
+
*/
|
|
97
|
+
export enum BlueprintLayer {
|
|
98
|
+
Technology = 'technology',
|
|
99
|
+
Stack = 'stack',
|
|
100
|
+
Template = 'template',
|
|
101
|
+
CreateApp = 'create-app',
|
|
102
|
+
Packages = 'packages',
|
|
103
|
+
Experience = 'experience',
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export const BLUEPRINT_LAYER_ORDER: BlueprintLayer[] = [
|
|
107
|
+
BlueprintLayer.Technology,
|
|
108
|
+
BlueprintLayer.Stack,
|
|
109
|
+
BlueprintLayer.Template,
|
|
110
|
+
BlueprintLayer.CreateApp,
|
|
111
|
+
BlueprintLayer.Packages,
|
|
112
|
+
BlueprintLayer.Experience,
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* How strongly a product of this kind wants a LANDING GATE — the working entry into the key
|
|
117
|
+
* end-user workflow drawn on the guest home, where a guest starts before signing in.
|
|
118
|
+
*
|
|
119
|
+
* A PRIOR handed to the model that decides, never the decision itself: `Encourage` still lets it
|
|
120
|
+
* answer "no gate" for a product with no end-user step a guest could begin, and `Discourage` still
|
|
121
|
+
* lets it choose one when the specification plainly describes such a step.
|
|
122
|
+
*/
|
|
123
|
+
export enum LandingGatePreference {
|
|
124
|
+
/** Most products of this kind have a first-value step a guest can begin — look for it. */
|
|
125
|
+
Encourage = 'encourage',
|
|
126
|
+
/** Neutral: decide from the specification alone. */
|
|
127
|
+
Allow = 'allow',
|
|
128
|
+
/** Products of this kind rarely have one — choose a gate only when the specification asks. */
|
|
129
|
+
Discourage = 'discourage',
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export enum BlueprintPatchKind {
|
|
133
|
+
/** Deep-merge a JSON document — the manifests, the tsconfigs. */
|
|
134
|
+
JsonMerge = 'json-merge',
|
|
135
|
+
/** Rewrite the `<head>` of an HTML document from the project's identity. */
|
|
136
|
+
HtmlHead = 'html-head',
|
|
137
|
+
/** Write a document composed from the project's identity. */
|
|
138
|
+
Compose = 'compose',
|
|
139
|
+
}
|
package/src/blueprint/index.ts
CHANGED
package/src/blueprint/types.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ProjectTenancy } from '../areas/
|
|
1
|
+
import type { ProjectTenancy } from '../areas/types.js'
|
|
2
2
|
import type { SubProject } from '../slot/consts.js'
|
|
3
3
|
import type { ViableSkill } from '../skills/consts.js'
|
|
4
4
|
import type { ViablePersona } from '../skills/roles.js'
|
|
5
5
|
import type { TopologyDescriptor } from '../topology/types.js'
|
|
6
|
+
import { BlueprintPatchKind, LandingGatePreference } from './consts.js'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* A BLUEPRINT is everything that decides what kind of project the pipeline is building — the
|
|
@@ -35,49 +36,6 @@ export interface Blueprint {
|
|
|
35
36
|
experience?: ExperienceLayer
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
/**
|
|
39
|
-
* The layers, lowest first. A higher layer's value replaces the same key from a lower one.
|
|
40
|
-
*
|
|
41
|
-
* The ordering is the point: `technology` overrides everything, because a change of language
|
|
42
|
-
* invalidates every template, prompt and package below it. Nothing today has more than one
|
|
43
|
-
* technology — the ladder exists so that adding one is a data change. `experience` is last and
|
|
44
|
-
* optional: it shares no key with the five build layers, so its place decides nothing today.
|
|
45
|
-
*/
|
|
46
|
-
export enum BlueprintLayer {
|
|
47
|
-
Technology = 'technology',
|
|
48
|
-
Stack = 'stack',
|
|
49
|
-
Template = 'template',
|
|
50
|
-
CreateApp = 'create-app',
|
|
51
|
-
Packages = 'packages',
|
|
52
|
-
Experience = 'experience',
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const BLUEPRINT_LAYER_ORDER: BlueprintLayer[] = [
|
|
56
|
-
BlueprintLayer.Technology,
|
|
57
|
-
BlueprintLayer.Stack,
|
|
58
|
-
BlueprintLayer.Template,
|
|
59
|
-
BlueprintLayer.CreateApp,
|
|
60
|
-
BlueprintLayer.Packages,
|
|
61
|
-
BlueprintLayer.Experience,
|
|
62
|
-
]
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* How strongly a product of this kind wants a LANDING GATE — the working entry into the key
|
|
66
|
-
* end-user workflow drawn on the guest home, where a guest starts before signing in.
|
|
67
|
-
*
|
|
68
|
-
* A PRIOR handed to the model that decides, never the decision itself: `Encourage` still lets it
|
|
69
|
-
* answer "no gate" for a product with no end-user step a guest could begin, and `Discourage` still
|
|
70
|
-
* lets it choose one when the specification plainly describes such a step.
|
|
71
|
-
*/
|
|
72
|
-
export enum LandingGatePreference {
|
|
73
|
-
/** Most products of this kind have a first-value step a guest can begin — look for it. */
|
|
74
|
-
Encourage = 'encourage',
|
|
75
|
-
/** Neutral: decide from the specification alone. */
|
|
76
|
-
Allow = 'allow',
|
|
77
|
-
/** Products of this kind rarely have one — choose a gate only when the specification asks. */
|
|
78
|
-
Discourage = 'discourage',
|
|
79
|
-
}
|
|
80
|
-
|
|
81
39
|
/**
|
|
82
40
|
* What the product should do for the people using it, independent of the stack it is built on.
|
|
83
41
|
*
|
|
@@ -96,25 +54,6 @@ export interface ExperienceLayer {
|
|
|
96
54
|
tenancy?: ProjectTenancy
|
|
97
55
|
}
|
|
98
56
|
|
|
99
|
-
const LANDING_GATE_PREFERENCES = new Set<string>(Object.values(LandingGatePreference))
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* The landing-gate preference of a resolved blueprint.
|
|
103
|
-
*
|
|
104
|
-
* Total: an absent layer, an absent key and a value this deploy does not know (a patch serialized
|
|
105
|
-
* by a newer one) all answer `Allow` — the neutral prior, which leaves the decision to the
|
|
106
|
-
* specification rather than tilting it either way on a value nobody set.
|
|
107
|
-
*/
|
|
108
|
-
export const landingGatePreferenceOf = (
|
|
109
|
-
blueprint?: Pick<Blueprint, 'experience'> | null
|
|
110
|
-
): LandingGatePreference => {
|
|
111
|
-
const value = blueprint?.experience?.landingGate
|
|
112
|
-
|
|
113
|
-
return value != null && LANDING_GATE_PREFERENCES.has(value)
|
|
114
|
-
? value
|
|
115
|
-
: LandingGatePreference.Allow
|
|
116
|
-
}
|
|
117
|
-
|
|
118
57
|
/** Language and toolchain. Overrides everything below it. */
|
|
119
58
|
export interface TechnologyLayer {
|
|
120
59
|
id: string
|
|
@@ -181,15 +120,6 @@ export interface BlueprintPatchSpec {
|
|
|
181
120
|
kind: BlueprintPatchKind
|
|
182
121
|
}
|
|
183
122
|
|
|
184
|
-
export enum BlueprintPatchKind {
|
|
185
|
-
/** Deep-merge a JSON document — the manifests, the tsconfigs. */
|
|
186
|
-
JsonMerge = 'json-merge',
|
|
187
|
-
/** Rewrite the `<head>` of an HTML document from the project's identity. */
|
|
188
|
-
HtmlHead = 'html-head',
|
|
189
|
-
/** Write a document composed from the project's identity. */
|
|
190
|
-
Compose = 'compose',
|
|
191
|
-
}
|
|
192
|
-
|
|
193
123
|
/** Which scaffolder runs first, and how. */
|
|
194
124
|
export interface CreateAppLayer {
|
|
195
125
|
id: string
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LANDING_GATE_PREFERENCES } from './consts.local.js'
|
|
2
|
+
import { LandingGatePreference } from './consts.js'
|
|
3
|
+
import type { Blueprint } from './types.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The landing-gate preference of a resolved blueprint.
|
|
7
|
+
*
|
|
8
|
+
* Total: an absent layer, an absent key and a value this deploy does not know (a patch serialized
|
|
9
|
+
* by a newer one) all answer `Allow` — the neutral prior, which leaves the decision to the
|
|
10
|
+
* specification rather than tilting it either way on a value nobody set.
|
|
11
|
+
*/
|
|
12
|
+
export const landingGatePreferenceOf = (
|
|
13
|
+
blueprint?: Pick<Blueprint, 'experience'> | null
|
|
14
|
+
): LandingGatePreference => {
|
|
15
|
+
const value = blueprint?.experience?.landingGate
|
|
16
|
+
|
|
17
|
+
return value != null && LANDING_GATE_PREFERENCES.has(value)
|
|
18
|
+
? value
|
|
19
|
+
: LandingGatePreference.Allow
|
|
20
|
+
}
|