@owlmeans/viable-common 0.0.32 → 0.0.34
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 +109 -57
- package/build/ba/index.d.ts +0 -1
- package/build/ba/index.d.ts.map +1 -1
- package/build/ba/index.js +0 -1
- package/build/ba/index.js.map +1 -1
- package/build/blueprint/case.js +3 -3
- package/build/blueprint/consts.d.ts +38 -0
- package/build/blueprint/consts.d.ts.map +1 -1
- package/build/blueprint/consts.js +40 -0
- package/build/blueprint/consts.js.map +1 -1
- package/build/blueprint/index.d.ts +0 -3
- package/build/blueprint/index.d.ts.map +1 -1
- package/build/blueprint/index.js +0 -3
- package/build/blueprint/index.js.map +1 -1
- package/build/blueprint/types.d.ts +5 -5
- package/build/connect/errors.d.ts +23 -0
- package/build/connect/errors.d.ts.map +1 -1
- package/build/connect/errors.js +50 -0
- package/build/connect/errors.js.map +1 -1
- package/build/intent/consts.d.ts +57 -0
- package/build/intent/consts.d.ts.map +1 -0
- package/build/intent/consts.js +58 -0
- package/build/intent/consts.js.map +1 -0
- package/build/intent/entrypoints.d.ts +27 -0
- package/build/intent/entrypoints.d.ts.map +1 -0
- package/build/intent/entrypoints.js +28 -0
- package/build/intent/entrypoints.js.map +1 -0
- package/build/intent/errors.d.ts +20 -0
- package/build/intent/errors.d.ts.map +1 -0
- package/build/intent/errors.js +28 -0
- package/build/intent/errors.js.map +1 -0
- package/build/intent/flow.d.ts +17 -0
- package/build/intent/flow.d.ts.map +1 -0
- package/build/intent/flow.js +65 -0
- package/build/intent/flow.js.map +1 -0
- package/build/intent/index.d.ts +7 -0
- package/build/intent/index.d.ts.map +1 -0
- package/build/intent/index.js +6 -0
- package/build/intent/index.js.map +1 -0
- package/build/intent/schemas.d.ts +10 -0
- package/build/intent/schemas.d.ts.map +1 -0
- package/build/intent/schemas.js +24 -0
- package/build/intent/schemas.js.map +1 -0
- package/build/intent/types.d.ts +40 -0
- package/build/intent/types.d.ts.map +1 -0
- package/build/intent/types.js +2 -0
- package/build/intent/types.js.map +1 -0
- package/build/skills/catalogue.d.ts.map +1 -1
- package/build/skills/catalogue.js +15 -1
- package/build/skills/catalogue.js.map +1 -1
- package/build/skills/consts.d.ts +0 -34
- package/build/skills/consts.d.ts.map +1 -1
- package/build/skills/consts.js +0 -106
- package/build/skills/consts.js.map +1 -1
- package/build/skills/index.d.ts +0 -1
- package/build/skills/index.d.ts.map +1 -1
- package/build/skills/index.js +0 -1
- package/build/skills/index.js.map +1 -1
- package/build/skills/roles.d.ts +0 -9
- package/build/skills/roles.d.ts.map +1 -1
- package/build/skills/roles.js +0 -226
- package/build/skills/roles.js.map +1 -1
- package/package.json +18 -8
- package/src/ba/index.ts +0 -1
- package/src/blueprint/consts.ts +40 -0
- package/src/blueprint/index.ts +0 -3
- package/src/blueprint/types.ts +5 -5
- package/src/connect/errors.ts +55 -0
- package/src/intent/consts.ts +66 -0
- package/src/intent/entrypoints.ts +43 -0
- package/src/intent/errors.ts +33 -0
- package/src/intent/flow.ts +67 -0
- package/src/intent/index.ts +6 -0
- package/src/intent/schemas.ts +27 -0
- package/src/intent/types.ts +45 -0
- package/src/skills/consts.ts +0 -112
- package/src/skills/index.ts +0 -1
- package/src/skills/roles.ts +0 -267
- package/tests/blueprint.spec.ts +2 -66
- package/tests/connect-errors.spec.ts +31 -1
- package/tests/error-status.spec.ts +6 -1
- package/tests/intent.spec.ts +121 -0
- package/src/ba/schemas.ts +0 -196
- package/src/blueprint/case.ts +0 -320
- package/src/blueprint/resolve.ts +0 -136
- package/src/blueprint/schemas.ts +0 -44
- package/src/skills/catalogue.ts +0 -1850
- package/tests/skills.spec.ts +0 -110
package/build/skills/consts.js
CHANGED
|
@@ -76,110 +76,4 @@ export var ViableSkill;
|
|
|
76
76
|
ViableSkill["LibrariesAi"] = "libraries-ai";
|
|
77
77
|
ViableSkill["LibrariesGame"] = "libraries-game";
|
|
78
78
|
})(ViableSkill || (ViableSkill = {}));
|
|
79
|
-
/**
|
|
80
|
-
* Sort weights. Skills render in this order inside the cached block, so the sequence is
|
|
81
|
-
* part of the cache key — reordering them invalidates every prefix at once. Grouped in
|
|
82
|
-
* tens to leave room for a consumer's own skills between them.
|
|
83
|
-
*/
|
|
84
|
-
export const SKILL_ORDER = {
|
|
85
|
-
[ViableSkill.OutputSourceOnly]: 10,
|
|
86
|
-
[ViableSkill.OutputTextOnly]: 10,
|
|
87
|
-
[ViableSkill.ScopeDiscipline]: 15,
|
|
88
|
-
[ViableSkill.MainFlowFocus]: 12,
|
|
89
|
-
[ViableSkill.NonTypescriptOutput]: 18,
|
|
90
|
-
[ViableSkill.TsStyle]: 20,
|
|
91
|
-
[ViableSkill.TsImports]: 30,
|
|
92
|
-
[ViableSkill.ReactComponents]: 40,
|
|
93
|
-
[ViableSkill.OwlMeansEntrypoints]: 41,
|
|
94
|
-
[ViableSkill.OwlMeansNav]: 42,
|
|
95
|
-
[ViableSkill.PermissionModel]: 43,
|
|
96
|
-
[ViableSkill.ShadcnUi]: 44,
|
|
97
|
-
[ViableSkill.OwlmeansState]: 50,
|
|
98
|
-
[ViableSkill.FormFeedback]: 51,
|
|
99
|
-
[ViableSkill.StoreAccess]: 52,
|
|
100
|
-
[ViableSkill.ViewModelNaming]: 55,
|
|
101
|
-
// After the frontend rules it builds on (entrypoints, nav, shadcn, form feedback, the store), and
|
|
102
|
-
// before the backend block — it is only ever carried by analysis and frontend personas.
|
|
103
|
-
[ViableSkill.LandingGate]: 56,
|
|
104
|
-
// Analysis and frontend read it the same way LandingGate is read — after the frontend rules it
|
|
105
|
-
// references (nav, shadcn) — and a backend coder reads it as a server-side check, so it sits
|
|
106
|
-
// just ahead of the backend block for either audience.
|
|
107
|
-
[ViableSkill.MarketingConsent]: 57,
|
|
108
|
-
[ViableSkill.ResourceLayer]: 60,
|
|
109
|
-
[ViableSkill.ResourceResults]: 62,
|
|
110
|
-
[ViableSkill.ResourceMigrations]: 64,
|
|
111
|
-
[ViableSkill.OwlMeansServer]: 70,
|
|
112
|
-
[ViableSkill.OwlmeansContext]: 65,
|
|
113
|
-
[ViableSkill.OwlMeansServices]: 66,
|
|
114
|
-
[ViableSkill.FixerHeuristics]: 75,
|
|
115
|
-
[ViableSkill.ProjectLayout]: 5,
|
|
116
|
-
[ViableSkill.AgentTooling]: 8,
|
|
117
|
-
[ViableSkill.QueueDiscipline]: 67,
|
|
118
|
-
[ViableSkill.WorkerJobs]: 68,
|
|
119
|
-
[ViableSkill.TargetAgents]: 69,
|
|
120
|
-
[ViableSkill.AgenticChoice]: 71,
|
|
121
|
-
[ViableSkill.TargetLlm]: 72,
|
|
122
|
-
[ViableSkill.TargetAgentTools]: 73,
|
|
123
|
-
[ViableSkill.GameDesign]: 45,
|
|
124
|
-
[ViableSkill.GameScene]: 46,
|
|
125
|
-
[ViableSkill.GameUi]: 47,
|
|
126
|
-
[ViableSkill.GameNetworking]: 48,
|
|
127
|
-
[ViableSkill.LayoutDefinition]: 80,
|
|
128
|
-
[ViableSkill.ScreenDefinition]: 82,
|
|
129
|
-
[ViableSkill.LibrariesCommon]: 90,
|
|
130
|
-
[ViableSkill.LibrariesUiState]: 90,
|
|
131
|
-
[ViableSkill.LibrariesUi]: 90,
|
|
132
|
-
[ViableSkill.LibrariesBackend]: 90,
|
|
133
|
-
[ViableSkill.LibrariesAi]: 90,
|
|
134
|
-
[ViableSkill.LibrariesGame]: 90,
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* The catalogue entries whose subject a PUBLISHED `@owlmeans` package already documents.
|
|
138
|
-
*
|
|
139
|
-
* The catalogue and `agent-meta/skills/*` state the same contract twice — the P1 duplication —
|
|
140
|
-
* and the duplication is not symmetric: a package skill is versioned with the package and reaches
|
|
141
|
-
* a prompt through `owlmeansPackagesPlugin` whenever the request names that package, while a
|
|
142
|
-
* catalogue entry is a constant here that has to be edited by hand every time the framework moves.
|
|
143
|
-
*
|
|
144
|
-
* Naming the overlap is what makes it a DATA decision instead of a code one. A blueprint lists
|
|
145
|
-
* which of these its prompts carry, and a persona's skills are filtered against that list — so
|
|
146
|
-
* dropping one is a line in a blueprint, and restoring it is the same line. Everything NOT in this
|
|
147
|
-
* set is viable's own (output discipline, scope, the view-model convention, the fixer heuristics,
|
|
148
|
-
* where files live) and always loads, because no published package documents it.
|
|
149
|
-
*
|
|
150
|
-
* The default blueprint currently lists every one of them: the reduction is a real change to what
|
|
151
|
-
* a coder is told, and it is measured against a green end-to-end baseline rather than guessed.
|
|
152
|
-
*/
|
|
153
|
-
export const FRAMEWORK_OWNED_SKILLS = [
|
|
154
|
-
ViableSkill.ResourceLayer,
|
|
155
|
-
ViableSkill.ResourceResults,
|
|
156
|
-
ViableSkill.ResourceMigrations,
|
|
157
|
-
ViableSkill.OwlmeansContext,
|
|
158
|
-
ViableSkill.OwlMeansServices,
|
|
159
|
-
ViableSkill.OwlMeansServer,
|
|
160
|
-
ViableSkill.OwlMeansEntrypoints,
|
|
161
|
-
ViableSkill.OwlMeansNav,
|
|
162
|
-
ViableSkill.PermissionModel,
|
|
163
|
-
ViableSkill.OwlmeansState,
|
|
164
|
-
ViableSkill.StoreAccess,
|
|
165
|
-
ViableSkill.ShadcnUi,
|
|
166
|
-
ViableSkill.ReactComponents,
|
|
167
|
-
ViableSkill.FormFeedback,
|
|
168
|
-
];
|
|
169
|
-
const FRAMEWORK_OWNED = new Set(FRAMEWORK_OWNED_SKILLS);
|
|
170
|
-
/**
|
|
171
|
-
* Filter a persona's skills against what a blueprint asks for.
|
|
172
|
-
*
|
|
173
|
-
* A skill nobody owns always survives. A framework-owned one survives only while the blueprint
|
|
174
|
-
* lists it — so a blueprint built on another persistence layer stops teaching the Postgres
|
|
175
|
-
* resource contract without anybody editing a persona, and a blueprint that lists nothing at all
|
|
176
|
-
* (the shape a test builds) is read as "everything", because an empty allow-list almost always
|
|
177
|
-
* means "not stated" rather than "none".
|
|
178
|
-
*/
|
|
179
|
-
export const skillsForBlueprint = (skills, allowed) => {
|
|
180
|
-
if (allowed == null || allowed.length === 0)
|
|
181
|
-
return skills;
|
|
182
|
-
const permitted = new Set(allowed);
|
|
183
|
-
return skills.filter(skill => !FRAMEWORK_OWNED.has(skill) || permitted.has(skill));
|
|
184
|
-
};
|
|
185
79
|
//# sourceMappingURL=consts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/skills/consts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,WA+EX;AA/ED,WAAY,WAAW;IACrB,gDAAgD;IAChD,sDAAuC,CAAA;IACvC,0CAA0C;IAC1C,kDAAmC,CAAA;IACnC,qCAAqC;IACrC,mDAAoC,CAAA;IACpC,kFAAkF;IAClF,gDAAiC,CAAA;IACjC,wEAAwE;IACxE,4DAA6C,CAAA;IAE7C,mCAAoB,CAAA;IACpB,uCAAwB,CAAA;IAExB,mDAAoC,CAAA;IACpC,2DAA4C,CAAA;IAC5C,2CAA4B,CAAA;IAC5B,uFAAuF;IACvF,mDAAoC,CAAA;IACpC,qCAAsB,CAAA;IACtB,+CAAgC,CAAA;IAChC,iGAAiG;IACjG,6CAA8B,CAAA;IAC9B,2CAA4B,CAAA;IAC5B,mDAAoC,CAAA;IACpC;;;OAGG;IACH,2CAA4B,CAAA;IAE5B,+CAAgC,CAAA;IAChC,mDAAoC,CAAA;IACpC,yDAA0C,CAAA;IAC1C,iDAAkC,CAAA;IAClC,mDAAoC,CAAA;IACpC,qDAAsC,CAAA;IACtC,mDAAoC,CAAA;IAEpC,+CAAgC,CAAA;IAChC,6CAA8B,CAAA;IAE9B,sFAAsF;IACtF,mDAAoC,CAAA;IACpC,gFAAgF;IAChF,yCAA0B,CAAA;IAC1B,4EAA4E;IAC5E,6CAA8B,CAAA;IAE9B,uFAAuF;IACvF,+CAAgC,CAAA;IAChC,wEAAwE;IACxE,uCAAwB,CAAA;IACxB,iFAAiF;IACjF,sDAAuC,CAAA;IAEvC,wDAAwD;IACxD,yCAA0B,CAAA;IAC1B,uEAAuE;IACvE,uCAAwB,CAAA;IACxB,sFAAsF;IACtF,iCAAkB,CAAA;IAClB,kFAAkF;IAClF,iDAAkC,CAAA;IAElC,qDAAsC,CAAA;IACtC,qDAAsC,CAAA;IAEtC;qEACiE;IACjE,qDAAsC,CAAA;IAEtC,mDAAoC,CAAA;IACpC,sDAAuC,CAAA;IACvC,2CAA4B,CAAA;IAC5B,qDAAsC,CAAA;IACtC,2CAA4B,CAAA;IAC5B,+CAAgC,CAAA;AAClC,CAAC,EA/EW,WAAW,KAAX,WAAW,QA+EtB
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/skills/consts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,WA+EX;AA/ED,WAAY,WAAW;IACrB,gDAAgD;IAChD,sDAAuC,CAAA;IACvC,0CAA0C;IAC1C,kDAAmC,CAAA;IACnC,qCAAqC;IACrC,mDAAoC,CAAA;IACpC,kFAAkF;IAClF,gDAAiC,CAAA;IACjC,wEAAwE;IACxE,4DAA6C,CAAA;IAE7C,mCAAoB,CAAA;IACpB,uCAAwB,CAAA;IAExB,mDAAoC,CAAA;IACpC,2DAA4C,CAAA;IAC5C,2CAA4B,CAAA;IAC5B,uFAAuF;IACvF,mDAAoC,CAAA;IACpC,qCAAsB,CAAA;IACtB,+CAAgC,CAAA;IAChC,iGAAiG;IACjG,6CAA8B,CAAA;IAC9B,2CAA4B,CAAA;IAC5B,mDAAoC,CAAA;IACpC;;;OAGG;IACH,2CAA4B,CAAA;IAE5B,+CAAgC,CAAA;IAChC,mDAAoC,CAAA;IACpC,yDAA0C,CAAA;IAC1C,iDAAkC,CAAA;IAClC,mDAAoC,CAAA;IACpC,qDAAsC,CAAA;IACtC,mDAAoC,CAAA;IAEpC,+CAAgC,CAAA;IAChC,6CAA8B,CAAA;IAE9B,sFAAsF;IACtF,mDAAoC,CAAA;IACpC,gFAAgF;IAChF,yCAA0B,CAAA;IAC1B,4EAA4E;IAC5E,6CAA8B,CAAA;IAE9B,uFAAuF;IACvF,+CAAgC,CAAA;IAChC,wEAAwE;IACxE,uCAAwB,CAAA;IACxB,iFAAiF;IACjF,sDAAuC,CAAA;IAEvC,wDAAwD;IACxD,yCAA0B,CAAA;IAC1B,uEAAuE;IACvE,uCAAwB,CAAA;IACxB,sFAAsF;IACtF,iCAAkB,CAAA;IAClB,kFAAkF;IAClF,iDAAkC,CAAA;IAElC,qDAAsC,CAAA;IACtC,qDAAsC,CAAA;IAEtC;qEACiE;IACjE,qDAAsC,CAAA;IAEtC,mDAAoC,CAAA;IACpC,sDAAuC,CAAA;IACvC,2CAA4B,CAAA;IAC5B,qDAAsC,CAAA;IACtC,2CAA4B,CAAA;IAC5B,+CAAgC,CAAA;AAClC,CAAC,EA/EW,WAAW,KAAX,WAAW,QA+EtB"}
|
package/build/skills/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/build/skills/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/build/skills/roles.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { PromptPolicy } from '@owlmeans/llm-common';
|
|
2
1
|
/**
|
|
3
2
|
* Who the model is being asked to be.
|
|
4
3
|
*
|
|
@@ -41,12 +40,4 @@ export declare enum ViablePersona {
|
|
|
41
40
|
DeclarationLookup = "declaration-lookup",
|
|
42
41
|
FixAgent = "fix-agent"
|
|
43
42
|
}
|
|
44
|
-
/**
|
|
45
|
-
* The role text and skill set behind every helper.
|
|
46
|
-
*
|
|
47
|
-
* This is the single place a persona is written down. Before it existed the same
|
|
48
|
-
* sentences lived in thirteen helper files and seven near-identical coder factories, and
|
|
49
|
-
* the Express-5, resource-layer and client-state rules were duplicated across three of them.
|
|
50
|
-
*/
|
|
51
|
-
export declare const VIABLE_PERSONAS: Record<ViablePersona, PromptPolicy>;
|
|
52
43
|
//# sourceMappingURL=roles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/skills/roles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/skills/roles.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,oBAAY,aAAa;IACvB,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;IAChC,wFAAwF;IACxF,gBAAgB,sBAAsB;IACtC,UAAU,gBAAgB;IAC1B,cAAc,oBAAoB;IAElC,eAAe,qBAAqB;IACpC,kBAAkB,wBAAwB;IAC1C,cAAc,oBAAoB;IAClC,mBAAmB,yBAAyB;IAC5C,oBAAoB,2BAA2B;IAC/C,eAAe,qBAAqB;IACpC,YAAY,kBAAkB;IAC9B,kBAAkB,wBAAwB;IAC1C,sBAAsB,6BAA6B;IAEnD,WAAW,iBAAiB;IAC5B,YAAY,mBAAmB;IAC/B,WAAW,kBAAkB;IAC7B,UAAU,iBAAiB;IAC3B,cAAc,oBAAoB;IAClC,QAAQ,cAAc;IACtB,iBAAiB,wBAAwB;IACzC,qGAAqG;IACrG,gBAAgB,sBAAsB;IACtC,kFAAkF;IAClF,WAAW,iBAAiB;IAC5B,eAAe,sBAAsB;IAErC,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,eAAe,qBAAqB;IACpC,iBAAiB,uBAAuB;IACxC,QAAQ,cAAc;CACvB"}
|
package/build/skills/roles.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ViableSkill } from './consts.js';
|
|
2
1
|
/**
|
|
3
2
|
* Who the model is being asked to be.
|
|
4
3
|
*
|
|
@@ -42,229 +41,4 @@ export var ViablePersona;
|
|
|
42
41
|
ViablePersona["DeclarationLookup"] = "declaration-lookup";
|
|
43
42
|
ViablePersona["FixAgent"] = "fix-agent";
|
|
44
43
|
})(ViablePersona || (ViablePersona = {}));
|
|
45
|
-
/** Shared by the two helpers that reason about domain models and shared types. */
|
|
46
|
-
const DOMAIN_ARCHITECT = `
|
|
47
|
-
You are a fullstack web developer architect specializing in state management, domain models,
|
|
48
|
-
and typescript.
|
|
49
|
-
`.trim();
|
|
50
|
-
/** The rules every coder and the fixer need, whatever they are writing. */
|
|
51
|
-
const CODING_BASE = [ViableSkill.OutputSourceOnly, ViableSkill.TsStyle, ViableSkill.TsImports];
|
|
52
|
-
/**
|
|
53
|
-
* The frontend stack, in the order a component is built up.
|
|
54
|
-
*
|
|
55
|
-
* `OwlmeansState` is here, not only on the state coder: the view models that READ the stores are
|
|
56
|
-
* written by the view and nav coders and repaired by the fixer, and none of them carried it —
|
|
57
|
-
* the traces show `useStoreList(...)` read as `.list` / `.items` / a plain `T[]` in 18 projects,
|
|
58
|
-
* the second most frequent repair the fixer made.
|
|
59
|
-
*/
|
|
60
|
-
const FRONTEND = [
|
|
61
|
-
ViableSkill.ReactComponents, ViableSkill.OwlMeansEntrypoints, ViableSkill.OwlMeansNav,
|
|
62
|
-
ViableSkill.OwlMeansServices, ViableSkill.ShadcnUi, ViableSkill.FormFeedback,
|
|
63
|
-
ViableSkill.OwlmeansState, ViableSkill.StoreAccess, ViableSkill.ViewModelNaming,
|
|
64
|
-
ViableSkill.LibrariesUi,
|
|
65
|
-
];
|
|
66
|
-
/** The backend stack. */
|
|
67
|
-
const BACKEND = [
|
|
68
|
-
ViableSkill.ProjectLayout,
|
|
69
|
-
ViableSkill.ResourceLayer, ViableSkill.ResourceResults, ViableSkill.ResourceMigrations,
|
|
70
|
-
ViableSkill.OwlMeansEntrypoints, ViableSkill.OwlMeansServer, ViableSkill.OwlmeansContext,
|
|
71
|
-
ViableSkill.OwlMeansServices, ViableSkill.LibrariesBackend,
|
|
72
|
-
];
|
|
73
|
-
const persona = (role, skills) => ({ role: role.trim(), skills });
|
|
74
|
-
/**
|
|
75
|
-
* The role text and skill set behind every helper.
|
|
76
|
-
*
|
|
77
|
-
* This is the single place a persona is written down. Before it existed the same
|
|
78
|
-
* sentences lived in thirteen helper files and seven near-identical coder factories, and
|
|
79
|
-
* the Express-5, resource-layer and client-state rules were duplicated across three of them.
|
|
80
|
-
*/
|
|
81
|
-
export const VIABLE_PERSONAS = {
|
|
82
|
-
// --- Analysis and design ---
|
|
83
|
-
[ViablePersona.BusinessAnalyst]: persona(`
|
|
84
|
-
You are a professional business analyst and product manager specializing in figuring out
|
|
85
|
-
user stories from requirements.
|
|
86
|
-
`, [ViableSkill.OutputTextOnly, ViableSkill.MainFlowFocus]),
|
|
87
|
-
[ViablePersona.ProductArchitect]: persona(`
|
|
88
|
-
You are a product architect. You read what somebody wants built and say which KIND of
|
|
89
|
-
application it is, out of a fixed list. You choose the least capable kind that can deliver
|
|
90
|
-
what was asked for, because every capability above it is machinery a real user pays for.
|
|
91
|
-
You never stretch a description to fit a more interesting answer.
|
|
92
|
-
`, [ViableSkill.OutputTextOnly]),
|
|
93
|
-
[ViablePersona.ProductNaming]: persona(`
|
|
94
|
-
You are a professional product and brand manager specializing in naming.
|
|
95
|
-
`, [ViableSkill.OutputTextOnly, ViableSkill.MainFlowFocus]),
|
|
96
|
-
[ViablePersona.UxDesigner]: persona(`
|
|
97
|
-
You are a professional UX designer specializing in user flow and interaction in web
|
|
98
|
-
applications.
|
|
99
|
-
This application serves four audiences — anonymous visitors, signed-in end users, the owner,
|
|
100
|
-
and staff running the business process. Every screen you design belongs to exactly one of them,
|
|
101
|
-
and you are told which one with each task.
|
|
102
|
-
`, [ViableSkill.OutputTextOnly]),
|
|
103
|
-
[ViablePersona.VisualDesigner]: persona(`
|
|
104
|
-
You are a visual ui designer specializing in writing design guidelines and design systems
|
|
105
|
-
for web applications, and your interfaces are calm, precise and unmistakably the product's own.
|
|
106
|
-
Your house style: a white ground in light mode and a black one in dark mode; colour from ONE
|
|
107
|
-
product accent and never from backgrounds; depth only from hairlines, neutral tiles and a single
|
|
108
|
-
floating shadow; a heavy grotesk display face with tight tracking and generous whitespace carrying
|
|
109
|
-
the brand; motion that is small and belongs to the picture. You never reach for gradients, glass,
|
|
110
|
-
blur or glow, and the older decoration classes a project still defines are painted flat and are
|
|
111
|
-
never your tools. You change any of this only when the customer's specification explicitly asks —
|
|
112
|
-
it names a background colour, a dark-only or coloured theme, a brand palette, or gradients. The
|
|
113
|
-
product's subject matter is not such a request: a bakery is not a warm background, a bank is not a
|
|
114
|
-
blue one. What makes a design this product's is its accent, its type and its illustration — never
|
|
115
|
-
an added effect.
|
|
116
|
-
This application serves four audiences — anonymous visitors, signed-in end users, the owner,
|
|
117
|
-
and staff running the business process. Every screen you style belongs to exactly one of them,
|
|
118
|
-
and you are told which one with each task.
|
|
119
|
-
`, [ViableSkill.OutputTextOnly]),
|
|
120
|
-
// --- Architects ---
|
|
121
|
-
[ViablePersona.LayoutArchitect]: persona(`
|
|
122
|
-
You are a frontend developer architect working with typescript and react.
|
|
123
|
-
You are specializing in screen layouts and their components.
|
|
124
|
-
This application's layouts are the four AREA shells it already ships — guest, user, admin and
|
|
125
|
-
operator — so you compose screens to sit inside one of them and you restyle a shell when it
|
|
126
|
-
needs to look different. You never write a new layout and never rebuild its navigation.
|
|
127
|
-
`, [ViableSkill.LayoutDefinition, ViableSkill.ScreenDefinition, ...FRONTEND]),
|
|
128
|
-
[ViablePersona.ComponentArchitect]: persona(`
|
|
129
|
-
You are a frontend developer architect specializing in typescript react components.
|
|
130
|
-
`, [...FRONTEND]),
|
|
131
|
-
[ViablePersona.StateArchitect]: persona(`
|
|
132
|
-
You are a frontend developer architect specializing in state management and typescript.
|
|
133
|
-
`, [ViableSkill.OwlmeansState, ViableSkill.StoreAccess, ViableSkill.ViewModelNaming,
|
|
134
|
-
ViableSkill.LibrariesUiState]),
|
|
135
|
-
[ViablePersona.NavigationArchitect]: persona(`
|
|
136
|
-
You are a frontend developer architect working with typescript and react.
|
|
137
|
-
You are specializing in UI navigation and transitioning.
|
|
138
|
-
This application has four fixed AREAS — guest, user (front office), admin and operator (back
|
|
139
|
-
office) — and two menu levels inside each: SECTIONS are the top menu, and the screens of the
|
|
140
|
-
active section are the side menu. You place a screen by choosing its area and its section, never
|
|
141
|
-
by editing a menu component and never by changing an address.
|
|
142
|
-
`, [ViableSkill.OwlMeansEntrypoints, ViableSkill.OwlMeansNav, ViableSkill.ScreenDefinition,
|
|
143
|
-
ViableSkill.LibrariesUi]),
|
|
144
|
-
[ViablePersona.DomainTypesArchitect]: persona(DOMAIN_ARCHITECT, [ViableSkill.LibrariesCommon]),
|
|
145
|
-
// Not DOMAIN_ARCHITECT. This helper decides the application's entire authorization model — the
|
|
146
|
-
// least access each surface can be given, and one name per capability — and borrowing the
|
|
147
|
-
// state-management architect's sentence was describing a different job to the model.
|
|
148
|
-
[ViablePersona.AccessArchitect]: persona(`
|
|
149
|
-
You are a web application security architect specializing in authorization.
|
|
150
|
-
You decide the least access an endpoint or a screen can be given and still do its job, and you
|
|
151
|
-
name permissions so that one capability has exactly one name across the whole application.
|
|
152
|
-
`, [ViableSkill.OwlMeansEntrypoints, ViableSkill.PermissionModel, ViableSkill.LibrariesCommon]),
|
|
153
|
-
[ViablePersona.ApiArchitect]: persona(`
|
|
154
|
-
You are an expert backend architect specializing in designing RESTful APIs using
|
|
155
|
-
TypeScript and the OwlMeans entrypoint framework.
|
|
156
|
-
`, [ViableSkill.OwlMeansEntrypoints, ViableSkill.OwlMeansServer, ViableSkill.ResourceLayer,
|
|
157
|
-
ViableSkill.ResourceResults, ViableSkill.OwlmeansContext, ViableSkill.LibrariesBackend]),
|
|
158
|
-
[ViablePersona.DatalayerArchitect]: persona(`
|
|
159
|
-
You are a backend developer architect specializing in TypeScript, PostgreSQL and Node.js,
|
|
160
|
-
working with the OwlMeans resource layer over Postgres (@owlmeans/postgres-resource), which
|
|
161
|
-
owns the schema.
|
|
162
|
-
`, [ViableSkill.ResourceLayer, ViableSkill.ResourceResults, ViableSkill.ResourceMigrations,
|
|
163
|
-
ViableSkill.OwlmeansContext, ViableSkill.LibrariesBackend]),
|
|
164
|
-
[ViablePersona.BackendDomainArchitect]: persona(`
|
|
165
|
-
You are a backend developer architect specializing in business logic development.
|
|
166
|
-
If necessary you describe which integrations to use.
|
|
167
|
-
You prefer to use LLM chats models to solve sophisticated problems.
|
|
168
|
-
You are always specific when consider some integrations.
|
|
169
|
-
You always start from the business logic flow description that needs to be implemented
|
|
170
|
-
and focus on it.
|
|
171
|
-
`, [ViableSkill.ProjectLayout, ViableSkill.OwlmeansContext, ViableSkill.ResourceResults,
|
|
172
|
-
ViableSkill.LibrariesBackend]),
|
|
173
|
-
// --- Coders ---
|
|
174
|
-
// `PermissionModel` because this is the persona that WRITES the gate lines — `applyApiAccess`
|
|
175
|
-
// and `applyScreenAccess` both run on it. Knowing where the `@` may and may not appear has to
|
|
176
|
-
// reach the hand that types it, not only the one that chose the name.
|
|
177
|
-
[ViablePersona.CommonCoder]: persona(`
|
|
178
|
-
You are an expert fullstack developer specializing in typescript and domain models.
|
|
179
|
-
`, [...CODING_BASE, ViableSkill.OwlMeansEntrypoints, ViableSkill.PermissionModel,
|
|
180
|
-
ViableSkill.LibrariesCommon]),
|
|
181
|
-
[ViablePersona.UiStateCoder]: persona(`
|
|
182
|
-
You are an expert frontend developer specializing in typescript and state management.
|
|
183
|
-
`, [...CODING_BASE, ViableSkill.OwlmeansState, ViableSkill.OwlMeansEntrypoints,
|
|
184
|
-
ViableSkill.StoreAccess, ViableSkill.ViewModelNaming, ViableSkill.LibrariesUiState]),
|
|
185
|
-
[ViablePersona.UiViewCoder]: persona(`
|
|
186
|
-
You are an expert frontend developer specializing in typescript, html, css, and react
|
|
187
|
-
development of visual components.
|
|
188
|
-
`, [...CODING_BASE, ...FRONTEND]),
|
|
189
|
-
[ViablePersona.UiNavCoder]: persona(`
|
|
190
|
-
You are an expert frontend developer specializing in typescript, html, css, and react
|
|
191
|
-
development of navigation and transitions.
|
|
192
|
-
`, [...CODING_BASE, ...FRONTEND]),
|
|
193
|
-
[ViablePersona.DatalayerCoder]: persona(`
|
|
194
|
-
You are an expert fullstack developer specializing in typescript, node.js and the OwlMeans
|
|
195
|
-
resource layer over Postgres (@owlmeans/postgres-resource).
|
|
196
|
-
`, [...CODING_BASE, ...BACKEND]),
|
|
197
|
-
[ViablePersona.ApiCoder]: persona(`
|
|
198
|
-
You are an expert fullstack developer specializing in typescript, node.js, the OwlMeans
|
|
199
|
-
entrypoint framework and its resource layer over Postgres (@owlmeans/postgres-resource).
|
|
200
|
-
`, [...CODING_BASE, ...BACKEND]),
|
|
201
|
-
[ViablePersona.BackendModelCoder]: persona(`
|
|
202
|
-
You are an expert backend developer specializing in typescript and node.js.
|
|
203
|
-
You focus on business logic and integrations implementation — you really implement them,
|
|
204
|
-
not just mock them.
|
|
205
|
-
`, [...CODING_BASE, ViableSkill.ProjectLayout, ViableSkill.OwlmeansContext,
|
|
206
|
-
ViableSkill.ResourceResults, ViableSkill.LibrariesBackend]),
|
|
207
|
-
[ViablePersona.RuntimeArchitect]: persona(`
|
|
208
|
-
You are a pragmatic backend architect. You decide what a feature needs to RUN, and your
|
|
209
|
-
default answer is "a request handler and a table". You reach for a queue, a separate worker
|
|
210
|
-
process or an LLM agent only when the work cannot honestly be done inside a request, and you
|
|
211
|
-
say plainly which it is when the answer is none of them.
|
|
212
|
-
`, [ViableSkill.QueueDiscipline, ViableSkill.ProjectLayout, ViableSkill.OwlmeansContext]),
|
|
213
|
-
[ViablePersona.WorkerCoder]: persona(`
|
|
214
|
-
You are an expert backend developer specializing in typescript, queue processing and LLM
|
|
215
|
-
agents. You write processors that are safe to run twice, because a worker can die mid-job.
|
|
216
|
-
`, [...CODING_BASE, ViableSkill.ProjectLayout, ViableSkill.OwlmeansContext,
|
|
217
|
-
ViableSkill.WorkerJobs, ViableSkill.TargetAgents, ViableSkill.ResourceResults,
|
|
218
|
-
ViableSkill.LibrariesBackend]),
|
|
219
|
-
[ViablePersona.FreeFlightCoder]: persona(`
|
|
220
|
-
You are an expert fullstack developer specializing in typescript.
|
|
221
|
-
`, [...CODING_BASE, ...FRONTEND, ...BACKEND, ViableSkill.PermissionModel]),
|
|
222
|
-
// --- Everything else ---
|
|
223
|
-
[ViablePersona.Fixer]: persona(`
|
|
224
|
-
You are an expert typescript fullstack developer specializing in bugfixing of web
|
|
225
|
-
applications. You change as little as the reported error requires.
|
|
226
|
-
`, [...CODING_BASE, ...FRONTEND, ...BACKEND, ViableSkill.FixerHeuristics,
|
|
227
|
-
ViableSkill.PermissionModel]),
|
|
228
|
-
// `OwlMeansEntrypoints` is what makes this persona able to ROUTE a report: the four contract
|
|
229
|
-
// files, and which of them a symptom belongs to. Without it a runtime `entrypoint.call is not a
|
|
230
|
-
// function` reads as a broken component, and the orchestrator sends a coder to rewrite the view
|
|
231
|
-
// model that is already correct.
|
|
232
|
-
//
|
|
233
|
-
// `OwlMeansServices` is here for the same reason one level down: this persona WRITES the
|
|
234
|
-
// instruction the coder follows, so it is the one that decides a `Service not found` is
|
|
235
|
-
// repaired by naming a different alias. It has to know which registry that name comes from
|
|
236
|
-
// before it delegates, or the coder inherits the wrong premise along with the task.
|
|
237
|
-
[ViablePersona.Orchestrator]: persona(`
|
|
238
|
-
You are a senior fullstack typescript coding agent. You are orchestrating the
|
|
239
|
-
development. Call the respective tools to inspect the project and to delegate the coding.
|
|
240
|
-
`, [ViableSkill.ProjectLayout, ViableSkill.AgentTooling, ViableSkill.OwlmeansContext,
|
|
241
|
-
ViableSkill.OwlMeansEntrypoints, ViableSkill.OwlMeansServices, ViableSkill.PermissionModel,
|
|
242
|
-
ViableSkill.LayoutDefinition, ViableSkill.ScreenDefinition, ViableSkill.TsImports]),
|
|
243
|
-
[ViablePersona.SourceExtractor]: persona(`
|
|
244
|
-
You are a code-context extraction agent. You are NOT writing code. Do not summarise.
|
|
245
|
-
Your only deliverable is the tool call selecting the relevant line ranges. Be frugal —
|
|
246
|
-
every extra line costs the coder context.
|
|
247
|
-
`, []),
|
|
248
|
-
[ViablePersona.DeclarationLookup]: persona(`
|
|
249
|
-
You are a TypeScript type-declaration lookup agent. You are NOT writing code and NOT
|
|
250
|
-
fixing anything. Your only deliverable is the report_declarations tool call naming, for
|
|
251
|
-
each requested type, the file that declares it. Be frugal — every tool call costs budget,
|
|
252
|
-
and a wrong path is worse than an unresolved name.
|
|
253
|
-
`, []),
|
|
254
|
-
[ViablePersona.FixAgent]: persona(`
|
|
255
|
-
You are a build-repair agent working on a TypeScript monorepo you can inspect with tools.
|
|
256
|
-
|
|
257
|
-
You are called only after a scripted fix loop has already failed on this error, so the
|
|
258
|
-
obvious edit has been tried and did not work. Investigate before you edit: read the file
|
|
259
|
-
the error points at, look up the authoritative name in the registry, search for the other
|
|
260
|
-
places a name is spelled. A build error that keeps coming back is almost always a name
|
|
261
|
-
that exists in two spellings or one that was never declared — declare or create the
|
|
262
|
-
missing thing at its registered name; renaming a reference to a new guess is what made
|
|
263
|
-
the loop circle.
|
|
264
|
-
|
|
265
|
-
Make the smallest edit that addresses the cause, verify with the build, and finish with
|
|
266
|
-
report_fix. Never delete a feature to silence an error, and never stub a handler to make
|
|
267
|
-
the build pass.
|
|
268
|
-
`, []),
|
|
269
|
-
};
|
|
270
44
|
//# sourceMappingURL=roles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/skills/roles.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/skills/roles.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,aAoCX;AApCD,WAAY,aAAa;IACvB,qDAAoC,CAAA;IACpC,iDAAgC,CAAA;IAChC,wFAAwF;IACxF,uDAAsC,CAAA;IACtC,2CAA0B,CAAA;IAC1B,mDAAkC,CAAA;IAElC,qDAAoC,CAAA;IACpC,2DAA0C,CAAA;IAC1C,mDAAkC,CAAA;IAClC,6DAA4C,CAAA;IAC5C,gEAA+C,CAAA;IAC/C,qDAAoC,CAAA;IACpC,+CAA8B,CAAA;IAC9B,2DAA0C,CAAA;IAC1C,oEAAmD,CAAA;IAEnD,6CAA4B,CAAA;IAC5B,gDAA+B,CAAA;IAC/B,8CAA6B,CAAA;IAC7B,4CAA2B,CAAA;IAC3B,mDAAkC,CAAA;IAClC,uCAAsB,CAAA;IACtB,0DAAyC,CAAA;IACzC,qGAAqG;IACrG,uDAAsC,CAAA;IACtC,kFAAkF;IAClF,6CAA4B,CAAA;IAC5B,sDAAqC,CAAA;IAErC,gCAAe,CAAA;IACf,8CAA6B,CAAA;IAC7B,qDAAoC,CAAA;IACpC,yDAAwC,CAAA;IACxC,uCAAsB,CAAA;AACxB,CAAC,EApCW,aAAa,KAAb,aAAa,QAoCxB"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/viable-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
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, the connector protocol and the conversion vocabulary.",
|
|
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",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -b",
|
|
@@ -48,6 +48,13 @@
|
|
|
48
48
|
"default": "./build/integrity/index.js",
|
|
49
49
|
"module": "./build/integrity/index.js",
|
|
50
50
|
"types": "./build/integrity/index.d.ts"
|
|
51
|
+
},
|
|
52
|
+
"./intent": {
|
|
53
|
+
"import": "./build/intent/index.js",
|
|
54
|
+
"require": "./build/intent/index.js",
|
|
55
|
+
"default": "./build/intent/index.js",
|
|
56
|
+
"module": "./build/intent/index.js",
|
|
57
|
+
"types": "./build/intent/index.d.ts"
|
|
51
58
|
}
|
|
52
59
|
},
|
|
53
60
|
"devDependencies": {
|
|
@@ -59,12 +66,15 @@
|
|
|
59
66
|
"typescript": "^7.0.2"
|
|
60
67
|
},
|
|
61
68
|
"dependencies": {
|
|
62
|
-
"@owlmeans/agent-common": "^0.1.18-rc.
|
|
63
|
-
"@owlmeans/
|
|
64
|
-
"@owlmeans/
|
|
65
|
-
"@owlmeans/
|
|
66
|
-
"@owlmeans/
|
|
67
|
-
"@owlmeans/
|
|
69
|
+
"@owlmeans/agent-common": "^0.1.18-rc.41",
|
|
70
|
+
"@owlmeans/auth": "^0.1.18-rc.36",
|
|
71
|
+
"@owlmeans/context": "^0.1.18-rc.32",
|
|
72
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.37",
|
|
73
|
+
"@owlmeans/error": "^0.1.18-rc.36",
|
|
74
|
+
"@owlmeans/flow": "^0.1.18-rc.39",
|
|
75
|
+
"@owlmeans/llm-common": "^0.1.18-rc.36",
|
|
76
|
+
"@owlmeans/planning": "^0.1.18-rc.10",
|
|
77
|
+
"@owlmeans/resource": "^0.1.18-rc.36",
|
|
68
78
|
"@owlmeans/route": "^0.1.18-rc.33"
|
|
69
79
|
},
|
|
70
80
|
"publishConfig": {
|
package/src/ba/index.ts
CHANGED
package/src/blueprint/consts.ts
CHANGED
|
@@ -9,3 +9,43 @@ export const DEFAULT_BLUEPRINT_ID = 'owlmeans-fullstack-ts'
|
|
|
9
9
|
|
|
10
10
|
/** Recorded on a project so a later run knows which blueprint drew it. */
|
|
11
11
|
export const BLUEPRINT_META_KEY = 'blueprint'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* WHICH KIND of product is being built on a blueprint.
|
|
15
|
+
*
|
|
16
|
+
* A blueprint says what the STACK is — the language, the framework, the topology, the seeds. A
|
|
17
|
+
* case says what is being built ON it, and that is a different question with different consumers:
|
|
18
|
+
* the analyst framing the brief, the architect deciding whether a story needs a queue, the coder
|
|
19
|
+
* choosing which packages it may import.
|
|
20
|
+
*
|
|
21
|
+
* Deliberately NOT a second blueprint. Everything a case has to say is already a blueprint field,
|
|
22
|
+
* so a case is a PATCH and the resolution order stays base → case → per-run overrides. That is
|
|
23
|
+
* also why adding one is a data change: nothing reads `BlueprintCase` except the case table
|
|
24
|
+
* (`BLUEPRINT_CASES` in `@owlmeans/viable`) and the prompt that classifies a project into it.
|
|
25
|
+
*/
|
|
26
|
+
export enum BlueprintCase {
|
|
27
|
+
/** A web application whose every feature fits inside a request. No queue, no worker, no agents. */
|
|
28
|
+
Web = 'web',
|
|
29
|
+
/** A web application with work that genuinely belongs off the request path. */
|
|
30
|
+
Scalable = 'scalable',
|
|
31
|
+
/** The product's value comes from ordered, deterministic model-driven steps. */
|
|
32
|
+
AiPipeline = 'ai-pipeline',
|
|
33
|
+
/** The product's value comes from an agent that decides its own path through tools. */
|
|
34
|
+
AiAgent = 'ai-agent',
|
|
35
|
+
/** A browser game: a three.js scene with an ordinary React interface over it. */
|
|
36
|
+
Game = 'game',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* How a game is played, which decides who owns its state.
|
|
41
|
+
*
|
|
42
|
+
* Recorded beside the case rather than folded into it, because it changes nothing about the
|
|
43
|
+
* dependencies and everything about where the logic goes. `OnlineTurn` is the default for
|
|
44
|
+
* anything multiplayer unless the brief plainly asks for live play — it is the shape that
|
|
45
|
+
* actually builds, and it needs no socket, no tick loop and no reconciliation.
|
|
46
|
+
*/
|
|
47
|
+
export enum GameKind {
|
|
48
|
+
Casual = 'casual',
|
|
49
|
+
OnlineTurn = 'online-turn',
|
|
50
|
+
OnlineLive = 'online-live',
|
|
51
|
+
}
|
package/src/blueprint/index.ts
CHANGED
package/src/blueprint/types.ts
CHANGED
|
@@ -201,11 +201,11 @@ export interface PackagesLayer {
|
|
|
201
201
|
/**
|
|
202
202
|
* Skills added to ONE persona, rather than to every prompt of the blueprint.
|
|
203
203
|
*
|
|
204
|
-
* The additive twin of
|
|
205
|
-
* true of the whole stack; this is what is true of one performer — the analyst
|
|
206
|
-
* that a game brief is a core loop rather than a numbered flow, the architect who
|
|
207
|
-
* when a tool loop is warranted. Without it a case could only change what a CODER is
|
|
208
|
-
* a case changes the product analysis first.
|
|
204
|
+
* The additive twin of `skillsForBlueprint` (in `@owlmeans/viable`), which subtracts. `skills`
|
|
205
|
+
* above is what is true of the whole stack; this is what is true of one performer — the analyst
|
|
206
|
+
* who has to know that a game brief is a core loop rather than a numbered flow, the architect who
|
|
207
|
+
* has to know when a tool loop is warranted. Without it a case could only change what a CODER is
|
|
208
|
+
* told, and a case changes the product analysis first.
|
|
209
209
|
*/
|
|
210
210
|
personaSkills?: Partial<Record<ViablePersona, ViableSkill[]>>
|
|
211
211
|
/** Extra dependencies a role's manifest carries, beyond what the overlay ships. */
|
package/src/connect/errors.ts
CHANGED
|
@@ -137,6 +137,60 @@ export class ConnectOutOfCredits extends ConnectError {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* The action would spend credits bought less than 14 days ago under EU consumer rules, and a person
|
|
142
|
+
* has not yet expressly asked the platform to start using them (the purchase can still be
|
|
143
|
+
* withdrawn from). Only a person can give that request — in the browser, at `consentUrl`.
|
|
144
|
+
*
|
|
145
|
+
* Packed like `ConnectOutOfCredits`, because only `type` and `message` survive a marshal:
|
|
146
|
+
* `consent-required:<gate>:<deadline epoch ms | 0>:<encodeURIComponent(consentUrl)>`. The deadline
|
|
147
|
+
* is epoch milliseconds and the URL goes last, because an ISO date and a URL both contain colons.
|
|
148
|
+
*/
|
|
149
|
+
export class ConnectConsentRequired extends ConnectError {
|
|
150
|
+
public static override typeName = `ConsentRequired${ConnectError.typeName}`
|
|
151
|
+
/** A precondition only a person can meet, not a fault: answered 428. */
|
|
152
|
+
public static httpStatus = 428
|
|
153
|
+
|
|
154
|
+
public gate = ''
|
|
155
|
+
/** The latest withdrawal deadline of the purchases waiting for consent, when known. */
|
|
156
|
+
public deadline?: Date
|
|
157
|
+
public consentUrl = ''
|
|
158
|
+
|
|
159
|
+
/** Build the packed message a caller passes to the constructor. */
|
|
160
|
+
static encode(gate: string, consentUrl: string, deadline?: Date | null): string {
|
|
161
|
+
const at = deadline != null && !Number.isNaN(deadline.getTime()) ? deadline.getTime() : 0
|
|
162
|
+
|
|
163
|
+
return `${gate}:${at}:${encodeURIComponent(consentUrl)}`
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
constructor(message: string = 'error') {
|
|
167
|
+
super(`consent-required:${message}`)
|
|
168
|
+
this.type = ConnectConsentRequired.typeName
|
|
169
|
+
this.applyFields()
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
private applyFields(): void {
|
|
173
|
+
const marker = 'consent-required:'
|
|
174
|
+
const at = this.message.lastIndexOf(marker)
|
|
175
|
+
if (at < 0) return
|
|
176
|
+
const [gate, deadline, encodedUrl] = this.message.slice(at + marker.length).split(':')
|
|
177
|
+
this.gate = gate ?? ''
|
|
178
|
+
const ms = Number(deadline ?? 0)
|
|
179
|
+
this.deadline = Number.isFinite(ms) && ms > 0 ? new Date(ms) : undefined
|
|
180
|
+
let url = ''
|
|
181
|
+
try {
|
|
182
|
+
url = encodedUrl != null && encodedUrl !== '' ? decodeURIComponent(encodedUrl) : ''
|
|
183
|
+
} catch {
|
|
184
|
+
url = encodedUrl ?? ''
|
|
185
|
+
}
|
|
186
|
+
this.consentUrl = url
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
override finalizeUnmarshal(): void {
|
|
190
|
+
this.applyFields()
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
140
194
|
ResilientError.registerErrorClass(ConnectError)
|
|
141
195
|
ResilientError.registerErrorClass(ConnectSessionNotFound)
|
|
142
196
|
ResilientError.registerErrorClass(ConnectSessionGone)
|
|
@@ -145,3 +199,4 @@ ResilientError.registerErrorClass(ConnectOpRefused)
|
|
|
145
199
|
ResilientError.registerErrorClass(LocalSlotUnsupported)
|
|
146
200
|
ResilientError.registerErrorClass(ConnectOpUnknown)
|
|
147
201
|
ResilientError.registerErrorClass(ConnectOutOfCredits)
|
|
202
|
+
ResilientError.registerErrorClass(ConnectConsentRequired)
|