@owlmeans/viable-common 0.0.18 → 0.0.20
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 +2 -0
- package/agent-meta/skills/viable-common/SKILL.md +195 -10
- package/build/ba/consts.d.ts +2 -3
- package/build/ba/consts.d.ts.map +1 -1
- package/build/ba/consts.js +2 -3
- package/build/ba/consts.js.map +1 -1
- package/build/ba/helpers.d.ts +2 -1
- package/build/ba/helpers.d.ts.map +1 -1
- package/build/ba/helpers.js +3 -2
- package/build/ba/helpers.js.map +1 -1
- package/build/ba/types.d.ts +17 -2
- package/build/ba/types.d.ts.map +1 -1
- package/build/blueprint/case.js +3 -3
- package/build/connect/consts.d.ts +5 -8
- package/build/connect/consts.d.ts.map +1 -1
- package/build/connect/consts.js +5 -8
- package/build/connect/consts.js.map +1 -1
- package/build/connect/entrypoints.d.ts +1 -43
- package/build/connect/entrypoints.d.ts.map +1 -1
- package/build/connect/entrypoints.js +1 -18
- package/build/connect/entrypoints.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/jobs.d.ts +25 -0
- package/build/connect/jobs.d.ts.map +1 -0
- package/build/connect/jobs.js +29 -0
- package/build/connect/jobs.js.map +1 -0
- package/build/connect/references.d.ts +1 -40
- package/build/connect/references.d.ts.map +1 -1
- package/build/connect/references.js +0 -8
- package/build/connect/references.js.map +1 -1
- package/build/connect/schemas.d.ts +1 -7
- package/build/connect/schemas.d.ts.map +1 -1
- package/build/connect/schemas.js +1 -25
- package/build/connect/schemas.js.map +1 -1
- package/build/connect/types.d.ts +30 -45
- package/build/connect/types.d.ts.map +1 -1
- package/build/design/consts.d.ts +0 -2
- package/build/design/consts.d.ts.map +1 -1
- package/build/design/consts.js +0 -2
- package/build/design/consts.js.map +1 -1
- package/build/design/helpers.d.ts +6 -2
- package/build/design/helpers.d.ts.map +1 -1
- package/build/design/helpers.js +6 -2
- package/build/design/helpers.js.map +1 -1
- package/build/design/types.d.ts +12 -11
- package/build/design/types.d.ts.map +1 -1
- package/build/execution/types.d.ts +11 -0
- package/build/execution/types.d.ts.map +1 -1
- 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/planning/consts.d.ts +141 -0
- package/build/planning/consts.d.ts.map +1 -0
- package/build/planning/consts.js +170 -0
- package/build/planning/consts.js.map +1 -0
- package/build/planning/errors.d.ts +64 -0
- package/build/planning/errors.d.ts.map +1 -0
- package/build/planning/errors.js +99 -0
- package/build/planning/errors.js.map +1 -0
- package/build/planning/flows.d.ts +34 -0
- package/build/planning/flows.d.ts.map +1 -0
- package/build/planning/flows.js +174 -0
- package/build/planning/flows.js.map +1 -0
- package/build/planning/helpers.d.ts +54 -0
- package/build/planning/helpers.d.ts.map +1 -0
- package/build/planning/helpers.js +101 -0
- package/build/planning/helpers.js.map +1 -0
- package/build/planning/index.d.ts +7 -0
- package/build/planning/index.d.ts.map +1 -0
- package/build/planning/index.js +6 -0
- package/build/planning/index.js.map +1 -0
- package/build/planning/schemas.d.ts +23 -0
- package/build/planning/schemas.d.ts.map +1 -0
- package/build/planning/schemas.js +65 -0
- package/build/planning/schemas.js.map +1 -0
- package/build/planning/types.d.ts +70 -0
- package/build/planning/types.d.ts.map +1 -0
- package/build/planning/types.js +2 -0
- package/build/planning/types.js.map +1 -0
- package/build/scaffold/schemas.d.ts.map +1 -1
- package/build/scaffold/schemas.js +7 -2
- package/build/scaffold/schemas.js.map +1 -1
- package/build/scaffold/types.d.ts +5 -1
- package/build/scaffold/types.d.ts.map +1 -1
- package/package.json +8 -6
- package/src/ba/consts.ts +2 -3
- package/src/ba/helpers.ts +3 -2
- package/src/ba/types.ts +17 -2
- package/src/blueprint/case.ts +3 -3
- package/src/connect/consts.ts +5 -8
- package/src/connect/entrypoints.ts +2 -41
- package/src/connect/index.ts +1 -0
- package/src/connect/jobs.ts +40 -0
- package/src/connect/references.ts +1 -22
- package/src/connect/schemas.ts +2 -29
- package/src/connect/types.ts +30 -51
- package/src/design/consts.ts +0 -3
- package/src/design/helpers.ts +6 -2
- package/src/design/types.ts +12 -11
- package/src/execution/types.ts +11 -0
- package/src/index.ts +1 -0
- package/src/planning/consts.ts +182 -0
- package/src/planning/errors.ts +117 -0
- package/src/planning/flows.ts +204 -0
- package/src/planning/helpers.ts +133 -0
- package/src/planning/index.ts +6 -0
- package/src/planning/schemas.ts +70 -0
- package/src/planning/types.ts +75 -0
- package/src/scaffold/schemas.ts +7 -2
- package/src/scaffold/types.ts +10 -1
- package/tests/branding.spec.ts +37 -0
- package/tests/connect-entrypoints.spec.ts +35 -3
- package/tests/design.spec.ts +3 -3
- package/tests/planning.spec.ts +356 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { CodeScope, CodeStyle } from '@owlmeans/planning';
|
|
2
|
+
/**
|
|
3
|
+
* The OwlMeans Viable vocabulary over `@owlmeans/planning`.
|
|
4
|
+
*
|
|
5
|
+
* A project, a user story and the documents behind them are planning WORKCARDS of the types
|
|
6
|
+
* declared here. Everything generic — the record, the transition, the fold, the store, the protocol
|
|
7
|
+
* tree — belongs to the planning packages; what a Viable project or story IS, which statuses it
|
|
8
|
+
* moves through and which documents it carries, is declared once in this module and read by every
|
|
9
|
+
* runtime that writes one.
|
|
10
|
+
*/
|
|
11
|
+
/** A Viable project — the card every story, document and platform record of a product hangs under. */
|
|
12
|
+
export const VIABLE_PROJECT_TYPE = 'viable:project';
|
|
13
|
+
/** A user story — the unit of development a person starts. */
|
|
14
|
+
export const VIABLE_STORY_TYPE = 'viable:user-story';
|
|
15
|
+
/** Every document a project or story card carries (specification, vision, design system, plans). */
|
|
16
|
+
export const VIABLE_SPEC_TYPE = 'viable:spec';
|
|
17
|
+
/**
|
|
18
|
+
* Reserved card types. Declared in full so their code prefix and flow are decided once, and
|
|
19
|
+
* deliberately absent from the project type's `cardTypes`: nothing may create one yet.
|
|
20
|
+
*/
|
|
21
|
+
export const VIABLE_BUG_TYPE = 'viable:bug';
|
|
22
|
+
export const VIABLE_IMPROVEMENT_TYPE = 'viable:improvement';
|
|
23
|
+
export const VIABLE_REQUIREMENT_TYPE = 'viable:requirement';
|
|
24
|
+
export const VIABLE_PROJECT_FLOW = 'viable:project';
|
|
25
|
+
export const VIABLE_STORY_FLOW = 'viable:user-story';
|
|
26
|
+
/** The one-status flow a document runs — a specification has no lifecycle of its own. */
|
|
27
|
+
export const VIABLE_SPEC_FLOW = 'viable:spec';
|
|
28
|
+
/**
|
|
29
|
+
* The story flow's status keys.
|
|
30
|
+
*
|
|
31
|
+
* Byte-identical to the strings a story has always carried — the frontmatter of
|
|
32
|
+
* `docs/stories/<code>.md`, the connector's job status mapping, the board's columns, their i18n
|
|
33
|
+
* keys and every end-to-end selector read these exact values. A key is a wire contract and is
|
|
34
|
+
* never renamed.
|
|
35
|
+
*/
|
|
36
|
+
export var ViableStoryStatus;
|
|
37
|
+
(function (ViableStoryStatus) {
|
|
38
|
+
ViableStoryStatus["Planned"] = "planned";
|
|
39
|
+
ViableStoryStatus["InProgress"] = "in-progress";
|
|
40
|
+
ViableStoryStatus["Completed"] = "completed";
|
|
41
|
+
/** Intrinsically PLANNED: a failed story is work still to do, and retrying it is `start`. */
|
|
42
|
+
ViableStoryStatus["Failed"] = "failed";
|
|
43
|
+
})(ViableStoryStatus || (ViableStoryStatus = {}));
|
|
44
|
+
export var ViableStoryTransition;
|
|
45
|
+
(function (ViableStoryTransition) {
|
|
46
|
+
/** `planned | failed → in-progress` — the only move that asks for development. */
|
|
47
|
+
ViableStoryTransition["Start"] = "start";
|
|
48
|
+
ViableStoryTransition["Complete"] = "complete";
|
|
49
|
+
ViableStoryTransition["Fail"] = "fail";
|
|
50
|
+
/** `* → planned` — the manual recovery, and the one move a completed story still accepts. */
|
|
51
|
+
ViableStoryTransition["Reset"] = "reset";
|
|
52
|
+
})(ViableStoryTransition || (ViableStoryTransition = {}));
|
|
53
|
+
export var ViableProjectStatus;
|
|
54
|
+
(function (ViableProjectStatus) {
|
|
55
|
+
/** Created from a prompt, specification drafted, nothing provisioned. */
|
|
56
|
+
ViableProjectStatus["Draft"] = "draft";
|
|
57
|
+
/** The owner confirmed the brief; initialization is running or has run. */
|
|
58
|
+
ViableProjectStatus["Confirmed"] = "confirmed";
|
|
59
|
+
/** Initialization finished at least once. */
|
|
60
|
+
ViableProjectStatus["Active"] = "active";
|
|
61
|
+
ViableProjectStatus["Archived"] = "archived";
|
|
62
|
+
})(ViableProjectStatus || (ViableProjectStatus = {}));
|
|
63
|
+
export var ViableProjectTransition;
|
|
64
|
+
(function (ViableProjectTransition) {
|
|
65
|
+
ViableProjectTransition["Confirm"] = "confirm";
|
|
66
|
+
ViableProjectTransition["Activate"] = "activate";
|
|
67
|
+
ViableProjectTransition["Archive"] = "archive";
|
|
68
|
+
ViableProjectTransition["Reopen"] = "reopen";
|
|
69
|
+
})(ViableProjectTransition || (ViableProjectTransition = {}));
|
|
70
|
+
/** The single status a document holds. */
|
|
71
|
+
export var ViableSpecStatus;
|
|
72
|
+
(function (ViableSpecStatus) {
|
|
73
|
+
ViableSpecStatus["Current"] = "current";
|
|
74
|
+
})(ViableSpecStatus || (ViableSpecStatus = {}));
|
|
75
|
+
/** The palette key a board renders a status with. Presentation data, carried on the flow. */
|
|
76
|
+
export var ViableTone;
|
|
77
|
+
(function (ViableTone) {
|
|
78
|
+
ViableTone["Blue"] = "blue";
|
|
79
|
+
ViableTone["Yellow"] = "yellow";
|
|
80
|
+
ViableTone["Green"] = "green";
|
|
81
|
+
ViableTone["Red"] = "red";
|
|
82
|
+
ViableTone["Neutral"] = "neutral";
|
|
83
|
+
})(ViableTone || (ViableTone = {}));
|
|
84
|
+
/**
|
|
85
|
+
* The specification slots Viable cards carry.
|
|
86
|
+
*
|
|
87
|
+
* Project: `specification`, `vision`, `design-system` (the brief) and `scaffold` (the drawn plan).
|
|
88
|
+
* Story: `design`. The co-located `*.spec/.ux/.ui.md` files of a target are FILES, not slots — that
|
|
89
|
+
* prose already lives inside the `design` payload — so `SpecCategory` is not a slot vocabulary.
|
|
90
|
+
*/
|
|
91
|
+
export var ViableSpecCategory;
|
|
92
|
+
(function (ViableSpecCategory) {
|
|
93
|
+
ViableSpecCategory["Specification"] = "specification";
|
|
94
|
+
ViableSpecCategory["Vision"] = "vision";
|
|
95
|
+
ViableSpecCategory["DesignSystem"] = "design-system";
|
|
96
|
+
ViableSpecCategory["Scaffold"] = "scaffold";
|
|
97
|
+
ViableSpecCategory["Design"] = "design";
|
|
98
|
+
})(ViableSpecCategory || (ViableSpecCategory = {}));
|
|
99
|
+
/** How many revisions of a `design` or `scaffold` document the history must be able to answer. */
|
|
100
|
+
export const VIABLE_DESIGN_REVISIONS_KEPT = 3;
|
|
101
|
+
/**
|
|
102
|
+
* Relationship types between story cards.
|
|
103
|
+
*
|
|
104
|
+
* `follows` is WRITTEN: a connective story follows the flow story it was anchored after, created in
|
|
105
|
+
* the same transition as the card. `shares-widget` and `shares-screen` are DECLARED ONLY — the
|
|
106
|
+
* `scaffold` specification is their single authority, and a second copy as links would be a second
|
|
107
|
+
* answer that can disagree with it.
|
|
108
|
+
*/
|
|
109
|
+
export var ViableRelationship;
|
|
110
|
+
(function (ViableRelationship) {
|
|
111
|
+
ViableRelationship["Follows"] = "follows";
|
|
112
|
+
ViableRelationship["SharesWidget"] = "shares-widget";
|
|
113
|
+
ViableRelationship["SharesScreen"] = "shares-screen";
|
|
114
|
+
})(ViableRelationship || (ViableRelationship = {}));
|
|
115
|
+
/**
|
|
116
|
+
* Where a write came from, carried on `PlanningScope.channel` and recorded on the transition's
|
|
117
|
+
* `actor.channel`.
|
|
118
|
+
*
|
|
119
|
+
* It is never read from the wire: the manager API derives `Connect` from an access-token request
|
|
120
|
+
* and `Web` from everything else; the agent writes as `Agent` or `Pipeline`. Three rules key on it
|
|
121
|
+
* — the balance refusal class (`ConnectOutOfCredits` for `Connect`), re-formatting a narrative
|
|
122
|
+
* (`Web`/`Connect` only), and the develop trigger (a committed `start` by `Web`/`Connect` only).
|
|
123
|
+
*/
|
|
124
|
+
export var ViableChannel;
|
|
125
|
+
(function (ViableChannel) {
|
|
126
|
+
ViableChannel["Web"] = "web";
|
|
127
|
+
ViableChannel["Connect"] = "connect";
|
|
128
|
+
ViableChannel["Agent"] = "agent";
|
|
129
|
+
ViableChannel["Pipeline"] = "pipeline";
|
|
130
|
+
})(ViableChannel || (ViableChannel = {}));
|
|
131
|
+
/** The channels a PERSON writes through. */
|
|
132
|
+
export const VIABLE_USER_CHANNELS = Object.freeze([
|
|
133
|
+
ViableChannel.Web, ViableChannel.Connect,
|
|
134
|
+
]);
|
|
135
|
+
export const VIABLE_STORY_CODE_PREFIX = 'US-';
|
|
136
|
+
export const VIABLE_BUG_CODE_PREFIX = 'BUG-';
|
|
137
|
+
export const VIABLE_IMPROVEMENT_CODE_PREFIX = 'IMP-';
|
|
138
|
+
export const VIABLE_REQUIREMENT_CODE_PREFIX = 'REQ-';
|
|
139
|
+
export const VIABLE_CARD_CODE_LENGTH = 5;
|
|
140
|
+
/** `US-` + five uppercase characters, unique within the project. The code a target is keyed by. */
|
|
141
|
+
export const VIABLE_STORY_CODE = Object.freeze({
|
|
142
|
+
prefix: VIABLE_STORY_CODE_PREFIX,
|
|
143
|
+
style: CodeStyle.Random,
|
|
144
|
+
length: VIABLE_CARD_CODE_LENGTH,
|
|
145
|
+
uppercase: true,
|
|
146
|
+
uniqueWithin: CodeScope.Parent,
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* A project's code is its alias — a slug unique within the organization.
|
|
150
|
+
*
|
|
151
|
+
* Minted by the platform's name ladder, which knows about retired aliases and refused hostnames;
|
|
152
|
+
* a code policy only guards uniqueness, so a create always supplies the code.
|
|
153
|
+
*/
|
|
154
|
+
export const VIABLE_PROJECT_CODE = Object.freeze({
|
|
155
|
+
style: CodeStyle.Slug,
|
|
156
|
+
uniqueWithin: CodeScope.Entity,
|
|
157
|
+
// The alias moves: a rename changes it, and a refused preview certificate walks it to `alias-2`.
|
|
158
|
+
// A story code never moves — the target's files are named after it.
|
|
159
|
+
mutable: true,
|
|
160
|
+
});
|
|
161
|
+
export const VIABLE_BUG_CODE = Object.freeze({
|
|
162
|
+
...VIABLE_STORY_CODE, prefix: VIABLE_BUG_CODE_PREFIX,
|
|
163
|
+
});
|
|
164
|
+
export const VIABLE_IMPROVEMENT_CODE = Object.freeze({
|
|
165
|
+
...VIABLE_STORY_CODE, prefix: VIABLE_IMPROVEMENT_CODE_PREFIX,
|
|
166
|
+
});
|
|
167
|
+
export const VIABLE_REQUIREMENT_CODE = Object.freeze({
|
|
168
|
+
...VIABLE_STORY_CODE, prefix: VIABLE_REQUIREMENT_CODE_PREFIX,
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/planning/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAGzD;;;;;;;;GAQG;AAEH,sGAAsG;AACtG,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAA;AACnD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AACpD,oGAAoG;AACpG,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAA;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAA;AAC3C,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAA;AAC3D,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAA;AAE3D,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAA;AACnD,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M;IACvB,MAAM,EAAE,uBAAuB;IAC/B,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,SAAS,CAAC,MAAM;CAC/B,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAe,MAAM,CAAC,MAAM,CAAC;IAC3D,KAAK,EAAE,SAAS,CAAC,IAAI;IACrB,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,iGAAiG;IACjG,oEAAoE;IACpE,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,eAAe,GAAe,MAAM,CAAC,MAAM,CAAC;IACvD,GAAG,iBAAiB,EAAE,MAAM,EAAE,sBAAsB;CACrD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAe,MAAM,CAAC,MAAM,CAAC;IAC/D,GAAG,iBAAiB,EAAE,MAAM,EAAE,8BAA8B;CAC7D,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAe,MAAM,CAAC,MAAM,CAAC;IAC/D,GAAG,iBAAiB,EAAE,MAAM,EAAE,8BAA8B;CAC7D,CAAC,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ResilientError } from '@owlmeans/error';
|
|
2
|
+
import { ResourceError } from '@owlmeans/resource';
|
|
3
|
+
/**
|
|
4
|
+
* The project and story refusals every process that writes a planning card can raise.
|
|
5
|
+
*
|
|
6
|
+
* Declared HERE rather than by the platform because the viable planning plugin throws them from a
|
|
7
|
+
* process-neutral package, and a refusal class that exists only on one side of a hop cannot be
|
|
8
|
+
* `instanceof`-matched on the other. Type names and markers are wire contracts: the browser
|
|
9
|
+
* phrases a refusal by marker (`viable-project:…`), so neither may change. The bases are declared
|
|
10
|
+
* with them because an error class is unmarshalled by type name with the LAST registration
|
|
11
|
+
* winning — a second declaration of a base anywhere else would replace this one.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ProjectResourceError extends ResourceError {
|
|
14
|
+
static typeName: string;
|
|
15
|
+
constructor(message?: string);
|
|
16
|
+
}
|
|
17
|
+
/** No project card with that id in the caller's organization. */
|
|
18
|
+
export declare class ProjectNotFound extends ProjectResourceError {
|
|
19
|
+
static typeName: string;
|
|
20
|
+
constructor(message?: string);
|
|
21
|
+
}
|
|
22
|
+
/** The project exists, and the caller may not act on it. */
|
|
23
|
+
export declare class ProjectPermissionError extends ProjectResourceError {
|
|
24
|
+
static typeName: string;
|
|
25
|
+
constructor(message?: string);
|
|
26
|
+
}
|
|
27
|
+
export declare class ProjectStoryError extends ProjectResourceError {
|
|
28
|
+
static typeName: string;
|
|
29
|
+
constructor(message?: string);
|
|
30
|
+
}
|
|
31
|
+
/** No story card with that id or code under the project. */
|
|
32
|
+
export declare class ProjectStoryNotFound extends ProjectStoryError {
|
|
33
|
+
static typeName: string;
|
|
34
|
+
constructor(message?: string);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The story is in a state the requested write does not apply to.
|
|
38
|
+
*
|
|
39
|
+
* `wrong-status` is the marker a completed story's refusal carries — the manager matches the whole
|
|
40
|
+
* `viable-project:story:missconfigured:` prefix, so the reason after it is free to grow.
|
|
41
|
+
*/
|
|
42
|
+
export declare class ProjectStoryMissconfigured extends ProjectStoryError {
|
|
43
|
+
static typeName: string;
|
|
44
|
+
constructor(message?: string);
|
|
45
|
+
}
|
|
46
|
+
export declare class ProjectError extends ResilientError {
|
|
47
|
+
static typeName: string;
|
|
48
|
+
constructor(message?: string);
|
|
49
|
+
}
|
|
50
|
+
export declare class ProjectAgentError extends ProjectError {
|
|
51
|
+
static typeName: string;
|
|
52
|
+
constructor(message?: string);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The project's agent is already busy with what was asked for.
|
|
56
|
+
*
|
|
57
|
+
* `story` is the reason a second story start carries: one story of a project is in progress at a
|
|
58
|
+
* time, because a develop run holds the project's sandbox for its whole length.
|
|
59
|
+
*/
|
|
60
|
+
export declare class ProjectAgentOccupied extends ProjectAgentError {
|
|
61
|
+
static typeName: string;
|
|
62
|
+
constructor(message?: string);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/planning/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD;;;;;;;;;GASG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,OAAuB,QAAQ,SAA2C;IAE1E,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,iEAAiE;AACjE,qBAAa,eAAgB,SAAQ,oBAAoB;IACvD,OAAuB,QAAQ,SAA6C;IAE5E,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,4DAA4D;AAC5D,qBAAa,sBAAuB,SAAQ,oBAAoB;IAC9D,OAAuB,QAAQ,SAA+C;IAE9E,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,qBAAa,iBAAkB,SAAQ,oBAAoB;IACzD,OAAuB,QAAQ,SAA0C;IAEzE,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,4DAA4D;AAC5D,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,OAAuB,QAAQ,SAA0C;IAEzE,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,iBAAiB;IAC/D,OAAuB,QAAQ,SAAgD;IAE/E,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,qBAAa,YAAa,SAAQ,cAAc;IAC9C,OAAuB,QAAQ,SAA4C;IAE3E,YAAY,OAAO,GAAE,MAAgB,EAEpC;CACF;AAED,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAuB,QAAQ,SAAkC;IAEjE,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,OAAuB,QAAQ,SAA0C;IAEzE,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ResilientError } from '@owlmeans/error';
|
|
2
|
+
import { ResourceError } from '@owlmeans/resource';
|
|
3
|
+
/**
|
|
4
|
+
* The project and story refusals every process that writes a planning card can raise.
|
|
5
|
+
*
|
|
6
|
+
* Declared HERE rather than by the platform because the viable planning plugin throws them from a
|
|
7
|
+
* process-neutral package, and a refusal class that exists only on one side of a hop cannot be
|
|
8
|
+
* `instanceof`-matched on the other. Type names and markers are wire contracts: the browser
|
|
9
|
+
* phrases a refusal by marker (`viable-project:…`), so neither may change. The bases are declared
|
|
10
|
+
* with them because an error class is unmarshalled by type name with the LAST registration
|
|
11
|
+
* winning — a second declaration of a base anywhere else would replace this one.
|
|
12
|
+
*/
|
|
13
|
+
export class ProjectResourceError extends ResourceError {
|
|
14
|
+
static typeName = `ViableProject${ResourceError.typeName}`;
|
|
15
|
+
constructor(message = 'error') {
|
|
16
|
+
super(`viable-project:${message}`);
|
|
17
|
+
this.type = ProjectResourceError.typeName;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** No project card with that id in the caller's organization. */
|
|
21
|
+
export class ProjectNotFound extends ProjectResourceError {
|
|
22
|
+
static typeName = `NotFound${ProjectResourceError.typeName}`;
|
|
23
|
+
constructor(message = 'error') {
|
|
24
|
+
super(`not-found:${message}`);
|
|
25
|
+
this.type = ProjectNotFound.typeName;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** The project exists, and the caller may not act on it. */
|
|
29
|
+
export class ProjectPermissionError extends ProjectResourceError {
|
|
30
|
+
static typeName = `Permission${ProjectResourceError.typeName}`;
|
|
31
|
+
constructor(message = 'error') {
|
|
32
|
+
super(`permission:${message}`);
|
|
33
|
+
this.type = ProjectPermissionError.typeName;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class ProjectStoryError extends ProjectResourceError {
|
|
37
|
+
static typeName = `Story${ProjectResourceError.typeName}`;
|
|
38
|
+
constructor(message = 'error') {
|
|
39
|
+
super(`story:${message}`);
|
|
40
|
+
this.type = ProjectStoryError.typeName;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** No story card with that id or code under the project. */
|
|
44
|
+
export class ProjectStoryNotFound extends ProjectStoryError {
|
|
45
|
+
static typeName = `NotFound${ProjectStoryError.typeName}`;
|
|
46
|
+
constructor(message = 'error') {
|
|
47
|
+
super(`not-found:${message}`);
|
|
48
|
+
this.type = ProjectStoryNotFound.typeName;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The story is in a state the requested write does not apply to.
|
|
53
|
+
*
|
|
54
|
+
* `wrong-status` is the marker a completed story's refusal carries — the manager matches the whole
|
|
55
|
+
* `viable-project:story:missconfigured:` prefix, so the reason after it is free to grow.
|
|
56
|
+
*/
|
|
57
|
+
export class ProjectStoryMissconfigured extends ProjectStoryError {
|
|
58
|
+
static typeName = `Missconfigured${ProjectStoryError.typeName}`;
|
|
59
|
+
constructor(message = 'error') {
|
|
60
|
+
super(`missconfigured:${message}`);
|
|
61
|
+
this.type = ProjectStoryMissconfigured.typeName;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export class ProjectError extends ResilientError {
|
|
65
|
+
static typeName = `ViableProject${ResilientError.typeName}`;
|
|
66
|
+
constructor(message = 'error') {
|
|
67
|
+
super(ProjectError.typeName, `viable-project:${message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export class ProjectAgentError extends ProjectError {
|
|
71
|
+
static typeName = `Agent${ProjectError.typeName}`;
|
|
72
|
+
constructor(message = 'error') {
|
|
73
|
+
super(`agent:${message}`);
|
|
74
|
+
this.type = ProjectAgentError.typeName;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The project's agent is already busy with what was asked for.
|
|
79
|
+
*
|
|
80
|
+
* `story` is the reason a second story start carries: one story of a project is in progress at a
|
|
81
|
+
* time, because a develop run holds the project's sandbox for its whole length.
|
|
82
|
+
*/
|
|
83
|
+
export class ProjectAgentOccupied extends ProjectAgentError {
|
|
84
|
+
static typeName = `Occupied${ProjectAgentError.typeName}`;
|
|
85
|
+
constructor(message = 'error') {
|
|
86
|
+
super(`occupied:${message}`);
|
|
87
|
+
this.type = ProjectAgentOccupied.typeName;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
ResilientError.registerErrorClass(ProjectResourceError);
|
|
91
|
+
ResilientError.registerErrorClass(ProjectNotFound);
|
|
92
|
+
ResilientError.registerErrorClass(ProjectPermissionError);
|
|
93
|
+
ResilientError.registerErrorClass(ProjectStoryError);
|
|
94
|
+
ResilientError.registerErrorClass(ProjectStoryNotFound);
|
|
95
|
+
ResilientError.registerErrorClass(ProjectStoryMissconfigured);
|
|
96
|
+
ResilientError.registerErrorClass(ProjectError);
|
|
97
|
+
ResilientError.registerErrorClass(ProjectAgentError);
|
|
98
|
+
ResilientError.registerErrorClass(ProjectAgentOccupied);
|
|
99
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/planning/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IAC9C,MAAM,CAAU,QAAQ,GAAG,gBAAgB,aAAa,CAAC,QAAQ,EAAE,CAAA;IAE1E,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAA;QAClC,IAAI,CAAC,IAAI,GAA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AC,oBAAoB,CAAC,CAAA;AACvD,cAAc,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;AAC7D,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;AAC/C,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AnyTypeSchema, ProjectTypeSchema, RelationshipType, SpecificationSlot, StatusFlowSchema, WorkcardTypeSchema } from '@owlmeans/planning';
|
|
2
|
+
/**
|
|
3
|
+
* The story flow.
|
|
4
|
+
*
|
|
5
|
+
* `failed` maps to PLANNED: a failed story is work still to do, so "done" is the closed count and
|
|
6
|
+
* a retry is simply `start` again. `reset` from anywhere is the manual recovery — the one move a
|
|
7
|
+
* completed story still accepts.
|
|
8
|
+
*/
|
|
9
|
+
export declare const VIABLE_STORY_FLOW_SCHEMA: StatusFlowSchema;
|
|
10
|
+
/**
|
|
11
|
+
* The project flow.
|
|
12
|
+
*
|
|
13
|
+
* A create lands at `draft`; confirming the brief is `confirm`; the end of an initialization is
|
|
14
|
+
* `activate`. A reinitialization and a failed initialization are SLOT facts, not transitions, and
|
|
15
|
+
* destroying a project is a `delete` plus the platform's cascade — never `archive`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const VIABLE_PROJECT_FLOW_SCHEMA: StatusFlowSchema;
|
|
18
|
+
/** A document is written or revised; it has no lifecycle to move through. */
|
|
19
|
+
export declare const VIABLE_SPEC_FLOW_SCHEMA: StatusFlowSchema;
|
|
20
|
+
/** The brief a person confirms, and the plan the scaffold draws from it. */
|
|
21
|
+
export declare const VIABLE_PROJECT_SLOTS: SpecificationSlot[];
|
|
22
|
+
/** A story's design — the payload the implementation stage consumes. */
|
|
23
|
+
export declare const VIABLE_STORY_SLOTS: SpecificationSlot[];
|
|
24
|
+
export declare const VIABLE_STORY_RELATIONSHIPS: RelationshipType[];
|
|
25
|
+
export declare const VIABLE_PROJECT_TYPE_SCHEMA: ProjectTypeSchema;
|
|
26
|
+
export declare const VIABLE_STORY_TYPE_SCHEMA: WorkcardTypeSchema;
|
|
27
|
+
export declare const VIABLE_SPEC_TYPE_SCHEMA: WorkcardTypeSchema;
|
|
28
|
+
/** Registered so their prefixes and flow are decided once; not creatable under a project yet. */
|
|
29
|
+
export declare const VIABLE_RESERVED_TYPE_SCHEMAS: WorkcardTypeSchema[];
|
|
30
|
+
/** Every Viable type — what a planning plugin registers. */
|
|
31
|
+
export declare const VIABLE_TYPE_SCHEMAS: AnyTypeSchema[];
|
|
32
|
+
/** Every Viable flow — registered beside the types. */
|
|
33
|
+
export declare const VIABLE_FLOW_SCHEMAS: StatusFlowSchema[];
|
|
34
|
+
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/planning/flows.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EACvF,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAgB3B;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBA6BtC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,gBA6BxC,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,EAAE,gBAOrC,CAAA;AAMD,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAOnD,CAAA;AAED,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,EAOjD,CAAA;AAKD,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,EAIxD,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,iBAUxC,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,kBAUtC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,kBAOrC,CAAA;AAaD,iGAAiG;AACjG,eAAO,MAAM,4BAA4B,EAAE,kBAAkB,EAI5D,CAAA;AAED,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,EAAE,aAAa,EAK9C,CAAA;AAED,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,EAIjD,CAAA"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { IntrinsicPolicy, IntrinsicStatus, SpecificationFormat, WorkcardKind } from '@owlmeans/planning';
|
|
2
|
+
import { STORY_DESIGN_VERSION } from '../design/consts.js';
|
|
3
|
+
import { StoryDesignSchema } from '../design/schemas.js';
|
|
4
|
+
import { ScaffoldPlanSchema } from '../scaffold/schemas.js';
|
|
5
|
+
import { VIABLE_BUG_CODE, VIABLE_BUG_TYPE, VIABLE_DESIGN_REVISIONS_KEPT, VIABLE_IMPROVEMENT_CODE, VIABLE_IMPROVEMENT_TYPE, VIABLE_PROJECT_CODE, VIABLE_PROJECT_FLOW, VIABLE_PROJECT_TYPE, VIABLE_REQUIREMENT_CODE, VIABLE_REQUIREMENT_TYPE, VIABLE_SPEC_FLOW, VIABLE_SPEC_TYPE, VIABLE_STORY_CODE, VIABLE_STORY_FLOW, VIABLE_STORY_TYPE, ViableProjectStatus, ViableProjectTransition, ViableRelationship, ViableSpecCategory, ViableSpecStatus, ViableStoryStatus, ViableStoryTransition, ViableTone, } from './consts.js';
|
|
6
|
+
import { ViableOpenFieldsSchema, ViableProjectFieldsSchema, ViableSpecFieldsSchema, ViableStoryFieldsSchema, } from './schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* The story flow.
|
|
9
|
+
*
|
|
10
|
+
* `failed` maps to PLANNED: a failed story is work still to do, so "done" is the closed count and
|
|
11
|
+
* a retry is simply `start` again. `reset` from anywhere is the manual recovery — the one move a
|
|
12
|
+
* completed story still accepts.
|
|
13
|
+
*/
|
|
14
|
+
export const VIABLE_STORY_FLOW_SCHEMA = {
|
|
15
|
+
id: VIABLE_STORY_FLOW,
|
|
16
|
+
version: 1,
|
|
17
|
+
statuses: [
|
|
18
|
+
{ key: ViableStoryStatus.Planned, intrinsic: IntrinsicStatus.Planned, initial: true, tone: ViableTone.Blue },
|
|
19
|
+
{ key: ViableStoryStatus.InProgress, intrinsic: IntrinsicStatus.InProgress, tone: ViableTone.Yellow },
|
|
20
|
+
{ key: ViableStoryStatus.Completed, intrinsic: IntrinsicStatus.Closed, tone: ViableTone.Green },
|
|
21
|
+
{ key: ViableStoryStatus.Failed, intrinsic: IntrinsicStatus.Planned, tone: ViableTone.Red },
|
|
22
|
+
],
|
|
23
|
+
transitions: [
|
|
24
|
+
{
|
|
25
|
+
name: ViableStoryTransition.Start,
|
|
26
|
+
from: [ViableStoryStatus.Planned, ViableStoryStatus.Failed],
|
|
27
|
+
to: ViableStoryStatus.InProgress,
|
|
28
|
+
explicit: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: ViableStoryTransition.Complete,
|
|
32
|
+
from: [ViableStoryStatus.InProgress],
|
|
33
|
+
to: ViableStoryStatus.Completed,
|
|
34
|
+
explicit: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: ViableStoryTransition.Fail,
|
|
38
|
+
from: [ViableStoryStatus.InProgress],
|
|
39
|
+
to: ViableStoryStatus.Failed,
|
|
40
|
+
},
|
|
41
|
+
{ name: ViableStoryTransition.Reset, from: '*', to: ViableStoryStatus.Planned, explicit: true },
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The project flow.
|
|
46
|
+
*
|
|
47
|
+
* A create lands at `draft`; confirming the brief is `confirm`; the end of an initialization is
|
|
48
|
+
* `activate`. A reinitialization and a failed initialization are SLOT facts, not transitions, and
|
|
49
|
+
* destroying a project is a `delete` plus the platform's cascade — never `archive`.
|
|
50
|
+
*/
|
|
51
|
+
export const VIABLE_PROJECT_FLOW_SCHEMA = {
|
|
52
|
+
id: VIABLE_PROJECT_FLOW,
|
|
53
|
+
version: 1,
|
|
54
|
+
statuses: [
|
|
55
|
+
{ key: ViableProjectStatus.Draft, intrinsic: IntrinsicStatus.Planned, initial: true, tone: ViableTone.Blue },
|
|
56
|
+
{ key: ViableProjectStatus.Confirmed, intrinsic: IntrinsicStatus.InProgress, tone: ViableTone.Yellow },
|
|
57
|
+
{ key: ViableProjectStatus.Active, intrinsic: IntrinsicStatus.InProgress, tone: ViableTone.Green },
|
|
58
|
+
{ key: ViableProjectStatus.Archived, intrinsic: IntrinsicStatus.Closed, tone: ViableTone.Neutral },
|
|
59
|
+
],
|
|
60
|
+
transitions: [
|
|
61
|
+
{
|
|
62
|
+
name: ViableProjectTransition.Confirm,
|
|
63
|
+
from: [ViableProjectStatus.Draft],
|
|
64
|
+
to: ViableProjectStatus.Confirmed,
|
|
65
|
+
explicit: true,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: ViableProjectTransition.Activate,
|
|
69
|
+
from: [ViableProjectStatus.Confirmed],
|
|
70
|
+
to: ViableProjectStatus.Active,
|
|
71
|
+
},
|
|
72
|
+
{ name: ViableProjectTransition.Archive, from: '*', to: ViableProjectStatus.Archived, explicit: true },
|
|
73
|
+
{
|
|
74
|
+
name: ViableProjectTransition.Reopen,
|
|
75
|
+
from: [ViableProjectStatus.Archived],
|
|
76
|
+
to: ViableProjectStatus.Active,
|
|
77
|
+
explicit: true,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
/** A document is written or revised; it has no lifecycle to move through. */
|
|
82
|
+
export const VIABLE_SPEC_FLOW_SCHEMA = {
|
|
83
|
+
id: VIABLE_SPEC_FLOW,
|
|
84
|
+
version: 1,
|
|
85
|
+
statuses: [
|
|
86
|
+
{ key: ViableSpecStatus.Current, intrinsic: IntrinsicStatus.Closed, initial: true, tone: ViableTone.Neutral },
|
|
87
|
+
],
|
|
88
|
+
transitions: [],
|
|
89
|
+
};
|
|
90
|
+
const slot = (category, format, extra = {}) => ({ category, format, type: VIABLE_SPEC_TYPE, ...extra });
|
|
91
|
+
/** The brief a person confirms, and the plan the scaffold draws from it. */
|
|
92
|
+
export const VIABLE_PROJECT_SLOTS = [
|
|
93
|
+
slot(ViableSpecCategory.Specification, SpecificationFormat.Markdown, { required: true }),
|
|
94
|
+
slot(ViableSpecCategory.Vision, SpecificationFormat.Markdown),
|
|
95
|
+
slot(ViableSpecCategory.DesignSystem, SpecificationFormat.Markdown),
|
|
96
|
+
slot(ViableSpecCategory.Scaffold, SpecificationFormat.Json, {
|
|
97
|
+
revisioned: true, keepRevisions: VIABLE_DESIGN_REVISIONS_KEPT, schema: ScaffoldPlanSchema,
|
|
98
|
+
}),
|
|
99
|
+
];
|
|
100
|
+
/** A story's design — the payload the implementation stage consumes. */
|
|
101
|
+
export const VIABLE_STORY_SLOTS = [
|
|
102
|
+
slot(ViableSpecCategory.Design, SpecificationFormat.Json, {
|
|
103
|
+
revisioned: true,
|
|
104
|
+
keepRevisions: VIABLE_DESIGN_REVISIONS_KEPT,
|
|
105
|
+
schema: StoryDesignSchema,
|
|
106
|
+
version: STORY_DESIGN_VERSION,
|
|
107
|
+
}),
|
|
108
|
+
];
|
|
109
|
+
const storyLink = (name) => ({ name, from: [VIABLE_STORY_TYPE], to: [VIABLE_STORY_TYPE], single: true });
|
|
110
|
+
export const VIABLE_STORY_RELATIONSHIPS = [
|
|
111
|
+
storyLink(ViableRelationship.Follows),
|
|
112
|
+
storyLink(ViableRelationship.SharesWidget),
|
|
113
|
+
storyLink(ViableRelationship.SharesScreen),
|
|
114
|
+
];
|
|
115
|
+
export const VIABLE_PROJECT_TYPE_SCHEMA = {
|
|
116
|
+
type: VIABLE_PROJECT_TYPE,
|
|
117
|
+
kind: WorkcardKind.Project,
|
|
118
|
+
version: 1,
|
|
119
|
+
fields: ViableProjectFieldsSchema,
|
|
120
|
+
flows: [VIABLE_PROJECT_FLOW],
|
|
121
|
+
intrinsic: IntrinsicPolicy.Primary,
|
|
122
|
+
specifications: VIABLE_PROJECT_SLOTS,
|
|
123
|
+
code: VIABLE_PROJECT_CODE,
|
|
124
|
+
cardTypes: [VIABLE_STORY_TYPE],
|
|
125
|
+
};
|
|
126
|
+
export const VIABLE_STORY_TYPE_SCHEMA = {
|
|
127
|
+
type: VIABLE_STORY_TYPE,
|
|
128
|
+
kind: WorkcardKind.Card,
|
|
129
|
+
version: 1,
|
|
130
|
+
fields: ViableStoryFieldsSchema,
|
|
131
|
+
flows: [VIABLE_STORY_FLOW],
|
|
132
|
+
intrinsic: IntrinsicPolicy.Primary,
|
|
133
|
+
specifications: VIABLE_STORY_SLOTS,
|
|
134
|
+
relationships: VIABLE_STORY_RELATIONSHIPS,
|
|
135
|
+
code: VIABLE_STORY_CODE,
|
|
136
|
+
};
|
|
137
|
+
export const VIABLE_SPEC_TYPE_SCHEMA = {
|
|
138
|
+
type: VIABLE_SPEC_TYPE,
|
|
139
|
+
kind: WorkcardKind.Specification,
|
|
140
|
+
version: 1,
|
|
141
|
+
fields: ViableSpecFieldsSchema,
|
|
142
|
+
flows: [VIABLE_SPEC_FLOW],
|
|
143
|
+
specifications: [],
|
|
144
|
+
};
|
|
145
|
+
const reserved = (type, code) => ({
|
|
146
|
+
type,
|
|
147
|
+
kind: WorkcardKind.Card,
|
|
148
|
+
version: 1,
|
|
149
|
+
fields: ViableOpenFieldsSchema,
|
|
150
|
+
flows: [VIABLE_STORY_FLOW],
|
|
151
|
+
intrinsic: IntrinsicPolicy.Primary,
|
|
152
|
+
specifications: [],
|
|
153
|
+
code,
|
|
154
|
+
});
|
|
155
|
+
/** Registered so their prefixes and flow are decided once; not creatable under a project yet. */
|
|
156
|
+
export const VIABLE_RESERVED_TYPE_SCHEMAS = [
|
|
157
|
+
reserved(VIABLE_BUG_TYPE, VIABLE_BUG_CODE),
|
|
158
|
+
reserved(VIABLE_IMPROVEMENT_TYPE, VIABLE_IMPROVEMENT_CODE),
|
|
159
|
+
reserved(VIABLE_REQUIREMENT_TYPE, VIABLE_REQUIREMENT_CODE),
|
|
160
|
+
];
|
|
161
|
+
/** Every Viable type — what a planning plugin registers. */
|
|
162
|
+
export const VIABLE_TYPE_SCHEMAS = [
|
|
163
|
+
VIABLE_PROJECT_TYPE_SCHEMA,
|
|
164
|
+
VIABLE_STORY_TYPE_SCHEMA,
|
|
165
|
+
VIABLE_SPEC_TYPE_SCHEMA,
|
|
166
|
+
...VIABLE_RESERVED_TYPE_SCHEMAS,
|
|
167
|
+
];
|
|
168
|
+
/** Every Viable flow — registered beside the types. */
|
|
169
|
+
export const VIABLE_FLOW_SCHEMAS = [
|
|
170
|
+
VIABLE_PROJECT_FLOW_SCHEMA,
|
|
171
|
+
VIABLE_STORY_FLOW_SCHEMA,
|
|
172
|
+
VIABLE_SPEC_FLOW_SCHEMA,
|
|
173
|
+
];
|
|
174
|
+
//# sourceMappingURL=flows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../src/planning/flows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAKxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EACL,eAAe,EAAE,eAAe,EAAE,4BAA4B,EAAE,uBAAuB,EACvF,uBAAuB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EACtF,uBAAuB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,gBAAgB,EACpF,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAC5E,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EACjF,iBAAiB,EAAE,qBAAqB,EAAE,UAAU,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a,EAAE,0BAA0B;IACzC,IAAI,EAAE,iBAAiB;CACxB,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAuB;IACzD,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,YAAY,CAAC,aAAa;IAChC,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,sBAAsB;IAC9B,KAAK,EAAE,CAAC,gBAAgB,CAAC;IACzB,cAAc,EAAE,EAAE;CACnB,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,IAAgC,EAAsB,EAAE,CAAC,CAAC;IACxF,IAAI;IACJ,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,sBAAsB;IAC9B,KAAK,EAAE,CAAC,iBAAiB,CAAC;IAC1B,SAAS,EAAE,eAAe,CAAC,OAAO;IAClC,cAAc,EAAE,EAAE;IAClB,IAAI;CACL,CAAC,CAAA;AAEF,iGAAiG;AACjG,MAAM,CAAC,MAAM,4BAA4B,GAAyB;IAChE,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAC1D,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;CAC3D,CAAA;AAED,4DAA4D;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAoB;IAClD,0BAA0B;IAC1B,wBAAwB;IACxB,uBAAuB;IACvB,GAAG,4BAA4B;CAChC,CAAA;AAED,uDAAuD;AACvD,MAAM,CAAC,MAAM,mBAAmB,GAAuB;IACrD,0BAA0B;IAC1B,wBAAwB;IACxB,uBAAuB;CACxB,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Specification, Workcard } from '@owlmeans/planning';
|
|
2
|
+
import type { StoryDraft } from '../areas/types.js';
|
|
3
|
+
import type { AgentProject, UserStory } from '../ba/types.js';
|
|
4
|
+
import type { StoryDesign } from '../design/types.js';
|
|
5
|
+
import type { StoryWriteInput } from '../metadata/types.js';
|
|
6
|
+
import type { StoryWriteContent, ViableProjectCard, ViableProjectFields, ViableStoryCard, ViableStoryFields } from './types.js';
|
|
7
|
+
/** A `viable:project` card — kind AND type, since a foreign provider may share either alone. */
|
|
8
|
+
export declare const isViableProject: (card?: Workcard | null) => card is ViableProjectCard;
|
|
9
|
+
/** A `viable:user-story` card. */
|
|
10
|
+
export declare const isViableStory: (card?: Workcard | null) => card is ViableStoryCard;
|
|
11
|
+
/** Whether a write came from a person (`web`, `connect`) rather than the platform's own runs. */
|
|
12
|
+
export declare const isUserChannel: (channel?: string | null) => boolean;
|
|
13
|
+
export declare const projectFieldsOf: (card: Workcard) => ViableProjectFields;
|
|
14
|
+
/**
|
|
15
|
+
* A story card's fields, with the two required ones always answered.
|
|
16
|
+
*
|
|
17
|
+
* An absent area reads as `guest` — the area that guards nothing — and an absent primary flag as
|
|
18
|
+
* `false`, so a reader never branches on a card written by a store that dropped them.
|
|
19
|
+
*/
|
|
20
|
+
export declare const storyFieldsOf: (card: Workcard) => ViableStoryFields;
|
|
21
|
+
/** The draft shape the analysis prompts and moderation take, from a card. */
|
|
22
|
+
export declare const storyDraftOf: (card: Workcard) => StoryDraft;
|
|
23
|
+
/**
|
|
24
|
+
* The aggregate the coders take, for a story CARD.
|
|
25
|
+
*
|
|
26
|
+
* The card wins on the narrative, the code, the area and the actor — a person may have changed any
|
|
27
|
+
* of them since the design was written. The design supplies what only it knows: the entities and
|
|
28
|
+
* the screens. Without a design the aggregate has no screens yet.
|
|
29
|
+
*/
|
|
30
|
+
export declare const userStoryOf: (card: Workcard, design?: StoryDesign | null) => UserStory;
|
|
31
|
+
/**
|
|
32
|
+
* The current document of one category among a card's specifications.
|
|
33
|
+
*
|
|
34
|
+
* The highest revision wins, then the most recently updated; a category nobody wrote answers
|
|
35
|
+
* `null`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const currentSpecOf: (specs: readonly Specification[], category: string) => Specification | null;
|
|
38
|
+
/** The body of a category's current document, `''` when there is none. */
|
|
39
|
+
export declare const currentSpecBody: (specs: readonly Specification[], category: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
* The brief a generator reads, assembled from the project card and its specifications.
|
|
42
|
+
*
|
|
43
|
+
* `name` is the card's title and `alias` its code; a brief part nobody wrote is `''`, which is
|
|
44
|
+
* what every prompt already treats as "not stated".
|
|
45
|
+
*/
|
|
46
|
+
export declare const projectBriefOf: (project: Workcard, specs: readonly Specification[]) => AgentProject;
|
|
47
|
+
/**
|
|
48
|
+
* What the metadata store writes to `docs/stories/<code>.md`, from the card and a run's content.
|
|
49
|
+
*
|
|
50
|
+
* The CODE is the target's only story identifier — a card id never reaches a target file — so a
|
|
51
|
+
* story card without one is refused rather than filed under its id.
|
|
52
|
+
*/
|
|
53
|
+
export declare const storyWriteInputOf: (card: Workcard, content: StoryWriteContent) => StoryWriteInput;
|
|
54
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/planning/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAK3D,OAAO,KAAK,EACV,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAC9F,MAAM,YAAY,CAAA;AAEnB,gGAAgG;AAChG,eAAO,MAAM,eAAe,UAAW,QAAQ,GAAG,IAAI,KAAG,IAAI,IAAI,iBACwB,CAAA;AAEzF,kCAAkC;AA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