@owlmeans/planning 0.1.18-rc.8 → 0.1.18
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 +122 -29
- package/agent-meta/manifest.json +131 -4
- package/agent-meta/skills/planning/SKILL.md +78 -171
- package/agent-meta/skills/planning/parts/collaboration.md +67 -0
- package/agent-meta/skills/planning/parts/errors.md +51 -0
- package/agent-meta/skills/planning/parts/fold.md +69 -0
- package/agent-meta/skills/planning/parts/mounting.md +64 -0
- package/agent-meta/skills/planning/parts/types.md +141 -0
- package/build/aliases/types.d.ts +72 -0
- package/build/aliases/types.d.ts.map +1 -0
- package/build/aliases/types.js +2 -0
- package/build/aliases/types.js.map +1 -0
- package/build/aliases.d.ts +4 -0
- package/build/aliases.d.ts.map +1 -0
- package/build/aliases.js +28 -0
- package/build/aliases.js.map +1 -0
- package/build/consts.d.ts +43 -34
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +49 -25
- package/build/consts.js.map +1 -1
- package/build/entrypoints/types.d.ts +105 -0
- package/build/entrypoints/types.d.ts.map +1 -0
- package/build/entrypoints/types.js +2 -0
- package/build/entrypoints/types.js.map +1 -0
- package/build/entrypoints.d.ts +5 -1
- package/build/entrypoints.d.ts.map +1 -1
- package/build/entrypoints.js +24 -6
- package/build/entrypoints.js.map +1 -1
- package/build/errors.d.ts +41 -0
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js +61 -0
- package/build/errors.js.map +1 -1
- package/build/helpers/app/consts.local.d.ts +5 -0
- package/build/helpers/app/consts.local.d.ts.map +1 -0
- package/build/helpers/app/consts.local.js +5 -0
- package/build/helpers/app/consts.local.js.map +1 -0
- package/build/helpers/app/types.d.ts +53 -0
- package/build/helpers/app/types.d.ts.map +1 -0
- package/build/helpers/app/types.js +2 -0
- package/build/helpers/app/types.js.map +1 -0
- package/build/helpers/app.d.ts +4 -0
- package/build/helpers/app.d.ts.map +1 -0
- package/build/helpers/app.js +139 -0
- package/build/helpers/app.js.map +1 -0
- package/build/helpers/apply/consts.local.d.ts +7 -0
- package/build/helpers/apply/consts.local.d.ts.map +1 -0
- package/build/helpers/apply/consts.local.js +9 -0
- package/build/helpers/apply/consts.local.js.map +1 -0
- package/build/helpers/apply/types.d.ts +32 -0
- package/build/helpers/apply/types.d.ts.map +1 -0
- package/build/helpers/apply/types.js +2 -0
- package/build/helpers/apply/types.js.map +1 -0
- package/build/helpers/apply.d.ts +5 -23
- package/build/helpers/apply.d.ts.map +1 -1
- package/build/helpers/apply.js +127 -144
- package/build/helpers/apply.js.map +1 -1
- package/build/helpers/card/types.d.ts +20 -0
- package/build/helpers/card/types.d.ts.map +1 -0
- package/build/helpers/card/types.js +2 -0
- package/build/helpers/card/types.js.map +1 -0
- package/build/helpers/card.d.ts +11 -7
- package/build/helpers/card.d.ts.map +1 -1
- package/build/helpers/card.js +41 -28
- package/build/helpers/card.js.map +1 -1
- package/build/helpers/changes/consts.local.d.ts +13 -0
- package/build/helpers/changes/consts.local.d.ts.map +1 -0
- package/build/helpers/changes/consts.local.js +13 -0
- package/build/helpers/changes/consts.local.js.map +1 -0
- package/build/helpers/changes/types.d.ts +58 -0
- package/build/helpers/changes/types.d.ts.map +1 -0
- package/build/helpers/changes/types.js +2 -0
- package/build/helpers/changes/types.js.map +1 -0
- package/build/helpers/changes.d.ts +11 -42
- package/build/helpers/changes.d.ts.map +1 -1
- package/build/helpers/changes.js +237 -251
- package/build/helpers/changes.js.map +1 -1
- package/build/helpers/code/types.d.ts +27 -0
- package/build/helpers/code/types.d.ts.map +1 -0
- package/build/helpers/code/types.js +2 -0
- package/build/helpers/code/types.js.map +1 -0
- package/build/helpers/code.d.ts +6 -17
- package/build/helpers/code.d.ts.map +1 -1
- package/build/helpers/code.js +39 -40
- package/build/helpers/code.js.map +1 -1
- package/build/helpers/index.d.ts +16 -0
- package/build/helpers/index.d.ts.map +1 -1
- package/build/helpers/index.js +4 -0
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/query/types.d.ts +23 -0
- package/build/helpers/query/types.d.ts.map +1 -0
- package/build/helpers/query/types.js +2 -0
- package/build/helpers/query/types.js.map +1 -0
- package/build/helpers/query.d.ts +25 -17
- package/build/helpers/query.d.ts.map +1 -1
- package/build/helpers/query.js +108 -280
- package/build/helpers/query.js.map +1 -1
- package/build/helpers/reply/consts.d.ts +2 -0
- package/build/helpers/reply/consts.d.ts.map +1 -0
- package/build/helpers/reply/consts.js +2 -0
- package/build/helpers/reply/consts.js.map +1 -0
- package/build/helpers/reply/types.d.ts +10 -0
- package/build/helpers/reply/types.d.ts.map +1 -0
- package/build/helpers/reply/types.js +2 -0
- package/build/helpers/reply/types.js.map +1 -0
- package/build/helpers/reply.d.ts +5 -0
- package/build/helpers/reply.d.ts.map +1 -0
- package/build/helpers/reply.js +29 -0
- package/build/helpers/reply.js.map +1 -0
- package/build/helpers/scoped/types.d.ts +73 -0
- package/build/helpers/scoped/types.d.ts.map +1 -0
- package/build/helpers/scoped/types.js +2 -0
- package/build/helpers/scoped/types.js.map +1 -0
- package/build/helpers/scoped.d.ts +25 -0
- package/build/helpers/scoped.d.ts.map +1 -0
- package/build/helpers/scoped.js +223 -0
- package/build/helpers/scoped.js.map +1 -0
- package/build/helpers/specification/types.d.ts +24 -0
- package/build/helpers/specification/types.d.ts.map +1 -0
- package/build/helpers/specification/types.js +2 -0
- package/build/helpers/specification/types.js.map +1 -0
- package/build/helpers/specification.d.ts +9 -13
- package/build/helpers/specification.d.ts.map +1 -1
- package/build/helpers/specification.js +47 -44
- package/build/helpers/specification.js.map +1 -1
- package/build/helpers/status/types.d.ts +48 -0
- package/build/helpers/status/types.d.ts.map +1 -0
- package/build/helpers/status/types.js +2 -0
- package/build/helpers/status/types.js.map +1 -0
- package/build/helpers/status.d.ts +16 -29
- package/build/helpers/status.d.ts.map +1 -1
- package/build/helpers/status.js +77 -73
- package/build/helpers/status.js.map +1 -1
- package/build/helpers/types.local.d.ts +17 -0
- package/build/helpers/types.local.d.ts.map +1 -0
- package/build/helpers/types.local.js +2 -0
- package/build/helpers/types.local.js.map +1 -0
- package/build/helpers/validate/types.d.ts +31 -0
- package/build/helpers/validate/types.d.ts.map +1 -0
- package/build/helpers/validate/types.js +2 -0
- package/build/helpers/validate/types.js.map +1 -0
- package/build/helpers/validate.d.ts +8 -19
- package/build/helpers/validate.d.ts.map +1 -1
- package/build/helpers/validate.js +79 -79
- package/build/helpers/validate.js.map +1 -1
- package/build/helpers/wire/types.d.ts +28 -0
- package/build/helpers/wire/types.d.ts.map +1 -0
- package/build/helpers/wire/types.js +2 -0
- package/build/helpers/wire/types.js.map +1 -0
- package/build/helpers/wire.d.ts +4 -0
- package/build/helpers/wire.d.ts.map +1 -0
- package/build/helpers/wire.js +216 -0
- package/build/helpers/wire.js.map +1 -0
- package/build/i18n/be.json +5 -0
- package/build/i18n/de.json +5 -0
- package/build/i18n/en.json +5 -0
- package/build/i18n/es.json +5 -0
- package/build/i18n/fr.json +5 -0
- package/build/i18n/pl.json +5 -0
- package/build/i18n/ru.json +5 -0
- package/build/i18n/uk.json +5 -0
- package/build/i18n.js +3 -3
- package/build/i18n.js.map +1 -1
- package/build/index.d.ts +7 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -0
- package/build/index.js.map +1 -1
- package/build/models/index.d.ts +2 -3
- package/build/models/index.d.ts.map +1 -1
- package/build/models/index.js +1 -15
- package/build/models/index.js.map +1 -1
- package/build/models/model.d.ts +5 -0
- package/build/models/model.d.ts.map +1 -0
- package/build/models/model.js +16 -0
- package/build/models/model.js.map +1 -0
- package/build/models/project.d.ts +2 -1
- package/build/models/project.d.ts.map +1 -1
- package/build/models/project.js.map +1 -1
- package/build/models/specification.d.ts +2 -1
- package/build/models/specification.d.ts.map +1 -1
- package/build/models/specification.js.map +1 -1
- package/build/models/types.d.ts +69 -0
- package/build/models/types.d.ts.map +1 -0
- package/build/models/types.js +2 -0
- package/build/models/types.js.map +1 -0
- package/build/models/workcard.d.ts +2 -1
- package/build/models/workcard.d.ts.map +1 -1
- package/build/models/workcard.js +12 -12
- package/build/models/workcard.js.map +1 -1
- package/build/registry.d.ts +3 -2
- package/build/registry.d.ts.map +1 -1
- package/build/registry.js +51 -3
- package/build/registry.js.map +1 -1
- package/build/resources/mentions.d.ts +4 -0
- package/build/resources/mentions.d.ts.map +1 -0
- package/build/resources/mentions.js +15 -0
- package/build/resources/mentions.js.map +1 -0
- package/build/resources/protocol/types.d.ts +30 -0
- package/build/resources/protocol/types.d.ts.map +1 -0
- package/build/resources/protocol/types.js +2 -0
- package/build/resources/protocol/types.js.map +1 -0
- package/build/resources/protocol.d.ts +6 -0
- package/build/resources/protocol.d.ts.map +1 -0
- package/build/resources/protocol.js +31 -0
- package/build/resources/protocol.js.map +1 -0
- package/build/resources/types.d.ts +146 -0
- package/build/resources/types.d.ts.map +1 -0
- package/build/resources/types.js +2 -0
- package/build/resources/types.js.map +1 -0
- package/build/resources/types.local.d.ts +6 -0
- package/build/resources/types.local.d.ts.map +1 -0
- package/build/resources/types.local.js +2 -0
- package/build/resources/types.local.js.map +1 -0
- package/build/schemas.d.ts +21 -2
- package/build/schemas.d.ts.map +1 -1
- package/build/schemas.js +164 -2
- package/build/schemas.js.map +1 -1
- package/build/types.d.ts +330 -151
- package/build/types.d.ts.map +1 -1
- package/build/utils.d.ts +6 -0
- package/build/utils.d.ts.map +1 -0
- package/build/utils.js +6 -0
- package/build/utils.js.map +1 -0
- package/package.json +13 -13
- package/src/aliases/types.ts +41 -0
- package/src/aliases.ts +34 -0
- package/src/consts.ts +50 -25
- package/src/entrypoints/types.ts +77 -0
- package/src/entrypoints.ts +53 -24
- package/src/errors.ts +71 -0
- package/src/helpers/app/consts.local.ts +5 -0
- package/src/helpers/app/types.ts +54 -0
- package/src/helpers/app.ts +158 -0
- package/src/helpers/apply/consts.local.ts +10 -0
- package/src/helpers/apply/types.ts +32 -0
- package/src/helpers/apply.ts +141 -153
- package/src/helpers/card/types.ts +20 -0
- package/src/helpers/card.ts +59 -33
- package/src/helpers/changes/consts.local.ts +17 -0
- package/src/helpers/changes/types.ts +66 -0
- package/src/helpers/changes.ts +270 -280
- package/src/helpers/code/types.ts +31 -0
- package/src/helpers/code.ts +52 -48
- package/src/helpers/index.ts +17 -0
- package/src/helpers/query/types.ts +26 -0
- package/src/helpers/query.ts +144 -314
- package/src/helpers/reply/consts.ts +1 -0
- package/src/helpers/reply/types.ts +13 -0
- package/src/helpers/reply.ts +27 -0
- package/src/helpers/scoped/types.ts +78 -0
- package/src/helpers/scoped.ts +281 -0
- package/src/helpers/specification/types.ts +26 -0
- package/src/helpers/specification.ts +69 -51
- package/src/helpers/status/types.ts +46 -0
- package/src/helpers/status.ts +117 -93
- package/src/helpers/types.local.ts +18 -0
- package/src/helpers/validate/types.ts +31 -0
- package/src/helpers/validate.ts +89 -77
- package/src/helpers/wire/types.ts +31 -0
- package/src/helpers/wire.ts +252 -0
- package/src/i18n/be.json +5 -0
- package/src/i18n/de.json +5 -0
- package/src/i18n/en.json +5 -0
- package/src/i18n/es.json +5 -0
- package/src/i18n/fr.json +5 -0
- package/src/i18n/pl.json +5 -0
- package/src/i18n/ru.json +5 -0
- package/src/i18n/uk.json +5 -0
- package/src/i18n.ts +4 -3
- package/src/index.ts +8 -0
- package/src/models/index.ts +2 -17
- package/src/models/model.ts +18 -0
- package/src/models/project.ts +2 -1
- package/src/models/specification.ts +2 -1
- package/src/models/types.ts +70 -0
- package/src/models/workcard.ts +14 -16
- package/src/registry.ts +55 -4
- package/src/resources/mentions.ts +11 -0
- package/src/resources/protocol/types.ts +21 -0
- package/src/resources/protocol.ts +36 -0
- package/src/resources/types.local.ts +5 -0
- package/src/resources/types.ts +148 -0
- package/src/schemas.ts +179 -4
- package/src/types.ts +334 -130
- package/src/utils.ts +9 -0
- package/tests/app.spec.ts +188 -0
- package/tests/apply.spec.ts +95 -31
- package/tests/code.spec.ts +9 -9
- package/tests/csp.spec.ts +122 -0
- package/tests/entrypoints.spec.ts +18 -2
- package/tests/error-status.spec.ts +6 -1
- package/tests/models.spec.ts +24 -16
- package/tests/query.spec.ts +13 -15
- package/tests/schemas.spec.ts +8 -8
- package/tests/scoped.spec.ts +161 -0
- package/tests/status.spec.ts +31 -22
package/README.md
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
# @owlmeans/planning
|
|
2
2
|
|
|
3
3
|
Runtime-free contracts for project planning: workcards (cards, projects, specifications), typed
|
|
4
|
-
relationships,
|
|
5
|
-
pure fold, the schema registry, the protocol tree and the models that behave identically on a
|
|
4
|
+
relationships, assignees, teams, comments and mention caches, shareable status flows over three
|
|
5
|
+
intrinsic states, the transition event and its pure fold, the schema registry, the protocol tree and the models that behave identically on a
|
|
6
6
|
server and in a browser. An application depends on it from its shared contract package; it wires
|
|
7
7
|
the executor with `@owlmeans/server-planning` and reads remotely with `@owlmeans/client-planning`.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
bun add @owlmeans/planning@^0.1.18
|
|
12
|
+
bun add @owlmeans/planning@^0.1.18 ajv ajv-formats
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Concepts
|
|
16
16
|
|
|
17
|
-
- **Transition** — the only way a
|
|
18
|
-
transitions in `seq` order (`applyTransition`).
|
|
17
|
+
- **Transition** — the only way a workcard changes: an append-only event; a card is the fold of its
|
|
18
|
+
transitions in `seq` order (`applyHelper.applyTransition`).
|
|
19
19
|
- **Workcard** — base fields at the top level (`title`, `status`, `parent`, `parents`, `labels`,
|
|
20
20
|
`order`); a type's own fields under `fields`, validated by the type's schema.
|
|
21
21
|
- **Status flow** — shareable data declaring statuses (each mapped to `planned`, `in-progress` or
|
|
22
22
|
`closed`) and named transitions; a type may run several flows.
|
|
23
23
|
- **Specification** — a document workcard held in a slot the parent type declares; a revisioned
|
|
24
24
|
slot revises one record in place.
|
|
25
|
-
- **Wire query** — the scalar form a query travels in over HTTP (`encode*Query` /
|
|
25
|
+
- **Wire query** — the scalar form a query travels in over HTTP (`wireHelper.encode*Query` /
|
|
26
|
+
`wireHelper.decode*Query`).
|
|
27
|
+
- **Auxiliary resources** — assignees, teams, comments and mentions are separate organization
|
|
28
|
+
resources with `version` compare-and-set. They reuse the schema and relationship stores.
|
|
26
29
|
|
|
27
30
|
## Usage
|
|
28
31
|
|
|
@@ -63,19 +66,35 @@ import { makePlanningProtocols } from '@owlmeans/planning'
|
|
|
63
66
|
export const planningProtocols = makePlanningProtocols({
|
|
64
67
|
base: { alias: 'app:api:planning', path: '/planning' },
|
|
65
68
|
guards: 'guard:default',
|
|
69
|
+
resources: true,
|
|
70
|
+
definitions: true,
|
|
66
71
|
})
|
|
67
72
|
```
|
|
68
73
|
|
|
69
74
|
Encode a query on the client, decode it in a handler:
|
|
70
75
|
|
|
71
76
|
```ts
|
|
72
|
-
import {
|
|
77
|
+
import { queryHelper, wireHelper } from '@owlmeans/planning'
|
|
73
78
|
|
|
74
|
-
const query = encodeWorkcardQuery({ parent: projectId, status: ['todo', 'doing'], sort: ['order'] })
|
|
79
|
+
const query = wireHelper.encodeWorkcardQuery({ parent: projectId, status: ['todo', 'doing'], sort: ['order'] })
|
|
75
80
|
const page = await context.entrypoint(planningProtocols.card.list).call({ query })
|
|
76
81
|
|
|
77
82
|
// server side
|
|
78
|
-
const where = criteriaOf(decodeWorkcardQuery(req.query), { entityId })
|
|
83
|
+
const where = queryHelper.criteriaOf(wireHelper.decodeWorkcardQuery(req.query), { entityId })
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Create a card and read it back through a facade — in process the one of `@owlmeans/server-planning`
|
|
87
|
+
(`ctx.service<PlanningHostService>(PLANNING_SERVICE).for({ entityId, profileId })`), remotely the one
|
|
88
|
+
of `@owlmeans/client-planning`:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { TransitionAction, WorkcardKind } from '@owlmeans/planning'
|
|
92
|
+
|
|
93
|
+
const drill = await planning.execute({
|
|
94
|
+
action: TransitionAction.Create,
|
|
95
|
+
card: { kind: WorkcardKind.Card, type: 'shed:tool', parent: shedId, title: 'Cordless drill' },
|
|
96
|
+
}, { wait: true }) // the options are the SECOND argument
|
|
97
|
+
const again = await planning.cards.get(drill.card!.id!)
|
|
79
98
|
```
|
|
80
99
|
|
|
81
100
|
Work through a model — the same code on either side of the wire:
|
|
@@ -93,62 +112,136 @@ await task.update({ title: 'Renamed' }) // expectSeq defaults to the record's he
|
|
|
93
112
|
Fold transitions yourself (a mirror, a test, a store):
|
|
94
113
|
|
|
95
114
|
```ts
|
|
96
|
-
import {
|
|
115
|
+
import { applyHelper } from '@owlmeans/planning'
|
|
97
116
|
|
|
98
|
-
const card = transitions.reduce((current, transition) => applyTransition(current, transition), undefined)
|
|
99
|
-
const links = transitions.reduce(applyRelationship, [])
|
|
117
|
+
const card = transitions.reduce((current, transition) => applyHelper.applyTransition(current, transition), undefined)
|
|
118
|
+
const links = transitions.reduce(applyHelper.applyRelationship, [])
|
|
100
119
|
```
|
|
101
120
|
|
|
121
|
+
## Participants, comments and hierarchy
|
|
122
|
+
|
|
123
|
+
An assignee has a stable id, an organization-unique normalized nickname, `kind: 'human' |
|
|
124
|
+
'non-human'`, a registered `type` and schema-validated `fields`. All links use the id.
|
|
125
|
+
`authentication: { provider, externalId }` may refer to any authentication system. Human types
|
|
126
|
+
require it by default; a type may explicitly declare `authentication: 'optional'`. Non-human
|
|
127
|
+
types default to optional authentication. Register `schemas.assigneeTypes` in a plugin, or use
|
|
128
|
+
`definitions.putAssigneeType` / `definitions.define({ assigneeTypes })` for organization-wide data
|
|
129
|
+
definitions. The optional `@owlmeans/planning-auth` adapter links verified identities and groups.
|
|
130
|
+
|
|
131
|
+
Cards have optional top-level single-choice `reporter` and `assignee` ids. Additional participant
|
|
132
|
+
fields use a type's `relationships` declaration with `field`, `toKind: PlanningResourceKind.Assignee`
|
|
133
|
+
and optional `to` type restrictions, `multiple` and `inverse`. The fields are authoritative;
|
|
134
|
+
planning maintains their derived relationship index. Assignee retirement preserves historical
|
|
135
|
+
attribution and prevents new assignments or memberships.
|
|
136
|
+
|
|
137
|
+
Use `facade.comments.create({ card, body })`; the host resolves the author from trusted
|
|
138
|
+
`PlanningScope.assigneeId`. `mentionHelper.encode(assigneeId, nickname)` embeds a stable mention
|
|
139
|
+
as `[@nickname](assignee:<encoded-id>)`. The separate `mentions` resource caches each mentioned
|
|
140
|
+
id and source comment revision. Comment updates maintain it; reads repair interrupted updates.
|
|
141
|
+
|
|
142
|
+
Teams exist independently of projects. `teams.addMember(teamId, assigneeId)` and
|
|
143
|
+
`teams.attach(teamId, projectId)` use canonical typed relationships. Multiple teams may attach to
|
|
144
|
+
one project, and a team may attach to multiple projects. `teams.assignees(projectId)` returns the
|
|
145
|
+
deduplicated union. An optional team `externalId` links an external permission group; access grants
|
|
146
|
+
and authentication membership remain the host's responsibility. Project `mode` is `opened` or
|
|
147
|
+
`closed`, defaults to `opened`, and is independent of flow status.
|
|
148
|
+
|
|
149
|
+
Hierarchy reuses `parent` and direct `parents`; `parentType` is derived from the primary parent.
|
|
150
|
+
Declare compatible `parents: { types?, required? }` and `children: { types }` on card schemas.
|
|
151
|
+
Planning rejects cycles, cross-organization parents, incompatible reparenting and ordinary-card
|
|
152
|
+
deletion with children. The nearest primary project selects schemas; project ancestry governs
|
|
153
|
+
access. Do not create another hierarchy or participant join store.
|
|
154
|
+
|
|
155
|
+
Enable `resources: true` to mount the assignee/team/comment/mention protocol branches and
|
|
156
|
+
`definitions: true` for writable schemas. Stock wire replies omit native organization `entityId`
|
|
157
|
+
metadata; the authenticated host derives scope from credentials and the organization `entitySlug`.
|
|
158
|
+
Custom fields and schema bodies remain opaque to wire projection.
|
|
159
|
+
|
|
102
160
|
## API
|
|
103
161
|
|
|
104
162
|
- Records and declarations: `Workcard`, `Card`, `Project`, `Specification`, `Relationship`,
|
|
105
163
|
`Transition`, `StatusFlowSchema`, `WorkcardTypeSchema`, `ProjectTypeSchema`, `SpecificationSlot`,
|
|
106
164
|
`CodePolicy`, `RelationshipType`, `PlanningSchemaBundle`.
|
|
165
|
+
- Resources: `Assignee`, `AssigneeAuthentication`, `AssigneeTypeSchema`, `Team`, `Comment`,
|
|
166
|
+
`CommentMention`, `PlanningResourceFacade`, `PlanningRecordStore`, `PlanningWriteOptions`,
|
|
167
|
+
resource drafts and queries; `AssigneeKind`, `ProjectMode`, `PlanningResourceKind`,
|
|
168
|
+
`PLANNING_TEAM_MEMBER`, `PLANNING_PROJECT_TEAM`, `mentionHelper`, `planningReplyHelper`.
|
|
107
169
|
- Write path and feed: `TransitionExecution`, `WorkcardDraft`, `ExecuteRequest`,
|
|
108
170
|
`TransitionReceipt`, `TransitionReceiptView`, `CommitEvent`, `CommitStatus`, `CommitSource`.
|
|
109
171
|
- Ports and seam: `TransitionStore`, `ProjectionStore`, `SpecificationStore`, `RelationshipStore`,
|
|
110
|
-
`PlanningStore`, `PlanningPlugin`, `PlanningScope`, `PlanningFacade`,
|
|
172
|
+
`SchemaStore`, `PlanningStore`, `PlanningPlugin`, `PlanningScope`, `PlanningFacade`,
|
|
173
|
+
`PlanningService`, `PlanningDefinitions`.
|
|
174
|
+
- Data-defined types and flows: `ScopedSchemaRecord`, `ScopedSchemaWhere`, `ScopedSchemaBundle`,
|
|
175
|
+
`ScopedSchemaRegistry`, `SchemaDeclarations`, `SchemaWriteOptions`, `SchemaDefineRequest`,
|
|
176
|
+
`SchemaDefineReply`, and `scopedSchemaHelper` (`resolveScopedBundle`, `scopedRegistryOf`,
|
|
177
|
+
`assertTypeSchema`, `assertFlowSchema`, `assertOverridable`, `flowInUse`, `schemaRecordKey`,
|
|
178
|
+
`schemaKeyOf`).
|
|
111
179
|
- Enums and constants: `WorkcardKind`, `IntrinsicStatus`, `IntrinsicPolicy`, `TransitionAction`,
|
|
112
|
-
`CommitState`, `SpecificationFormat`, `CodeStyle`, `CodeScope`, `
|
|
113
|
-
`
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
`
|
|
121
|
-
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
|
|
180
|
+
`CommitState`, `SpecificationFormat`, `CodeStyle`, `CodeScope`, `PlanningSchemaKind`,
|
|
181
|
+
`SchemaOrigin`, `SchemaWriteMode`, `PLANNING_SERVICE`, `PLANNING_PATH`, `PLANNING_COMMIT_EVENT`,
|
|
182
|
+
limits (`TITLE_MAX`, …); `planningAliasHelper` (`planningAliases`, `planningDefinitionAliases`).
|
|
183
|
+
- Helpers — each a ready object (`xxxHelper`) built by its `createXxxHelper()`, its interface
|
|
184
|
+
exported beside it:
|
|
185
|
+
- `applyHelper` — the fold: `applyTransition`, `applyRelationship`.
|
|
186
|
+
- `changesHelper` — `computeChanges`, `isEmptyChange`, `assertMutable`, `mergeFields`,
|
|
187
|
+
`applyUnset`, `sameValue`.
|
|
188
|
+
- `cardHelper` — `isProject`, `isCard`, `isSpecification`, `normalizeParents`, `cardDefaults`,
|
|
189
|
+
`isPending`, `parentOf`, `projectOf`.
|
|
190
|
+
- `statusHelper` — `intrinsicOf`, `initialStatusOf`, `ruleOf`, `canTransit`, `transitionsFrom`,
|
|
191
|
+
`initialFlowsOf`, `resolveIntrinsic`, `primaryFlowOf`, `flowIdsOf`, `statusDefinitionOf`,
|
|
192
|
+
`isTerminal`.
|
|
193
|
+
- `queryHelper` — `criteriaOf`, `listOptionsOf`, `specCriteriaOf`, `linkWhereOf`,
|
|
194
|
+
`transitionWhereOf`, `summaryOf`.
|
|
195
|
+
- `wireHelper` — `encode/decodeWorkcardQuery`, `encode/decodeSummaryQuery`,
|
|
196
|
+
`encode/decodeTransitionQuery`, `encode/decodeSpecificationQuery`,
|
|
197
|
+
`encode/decodeRelationshipQuery`, `encode/decodeList`, `encode/decodeSort`.
|
|
198
|
+
- `codeHelper` — `mintCode`, `codeScopeOf`, `slugOf`.
|
|
199
|
+
- `specificationHelper` — `slotOf`, `currentSpecification`, `nextRevision`, `isRevisioned`,
|
|
200
|
+
`bodyCharsOf`, `specificationTypeOf`.
|
|
201
|
+
- `validateHelper` — `validateFields`, `validateCard`, `validateSpecificationBody`,
|
|
202
|
+
`invalidFieldKeys`, `ajvErrorText`; and `makeAjv`.
|
|
203
|
+
- The former plain functions (`applyTransition`, `criteriaOf`, `encodeWorkcardQuery`, …) remain as
|
|
204
|
+
deprecated delegates to these helpers.
|
|
125
205
|
- Registry, protocols, models: `makeSchemaRegistry`, `makePlanningProtocols`, `makeWorkcardModel`,
|
|
126
206
|
`makeProjectModel`, `makeSpecificationModel`, `modelOf`.
|
|
127
207
|
- Errors: `PlanningError`, `WorkcardNotFound`, `UnknownWorkcardType`, `UnknownStatusFlow`,
|
|
128
208
|
`ParentNotFound`, `CardTypeNotAllowed`, `PlanningRefused`, `IllegalTransition`, `FieldsInvalid`,
|
|
129
209
|
`LabelNotAllowed`, `SpecificationSlotUnknown`, `SpecificationRevisionConflict`,
|
|
130
210
|
`RelationshipRefused`, `CodeTaken`, `WorkcardConflict`, `CommitTimeout`, `CommitFailed`,
|
|
131
|
-
`PlanningScopeMismatch`, `
|
|
211
|
+
`PlanningScopeMismatch`, `SchemaConflict`, `SchemaInUse`, `SchemaSealed`, `SchemaInvalid`,
|
|
212
|
+
`PlanningForbidden`, `PlanningUnsupported`.
|
|
132
213
|
- Schemas: `WorkcardSchema`, `SpecificationSchema`, `TransitionSchema`, `ExecuteRequestSchema`,
|
|
133
214
|
`WorkcardQuerySchema`, … (every record, declaration, request and view).
|
|
134
215
|
|
|
135
216
|
## Common pitfalls
|
|
136
217
|
|
|
218
|
+
- A create's draft goes under `card` (never `draft`), and `{ wait, timeout }` is the second argument
|
|
219
|
+
of `execute` — inside the execution an in-process facade ignores it.
|
|
220
|
+
- A type or flow declaration has no `name` or `key`: the display name is `label`, the key is `type`
|
|
221
|
+
(a type) or `id` (a flow); a status has `key`, a transition rule `name`. The declaration schemas
|
|
222
|
+
are closed — `definitions.define` refuses an extra key with `SchemaInvalid`.
|
|
137
223
|
- Pass a query through `encode*Query` before an HTTP call — arrays and objects do not survive a
|
|
138
224
|
query string as they are.
|
|
139
225
|
- `status`, `intrinsic` and `flows` move only through `transit`; an `update` naming them is refused.
|
|
226
|
+
- `createdBy` is written once, by a create's draft: `changes` or `unset` naming it is refused on
|
|
227
|
+
every action (`planning:immutable:createdBy`), so an ownership check can trust it.
|
|
140
228
|
- `fields` and `flows` in `changes` merge; every other key replaces. Clear with `null` or `unset`.
|
|
141
229
|
- A model's `expectSeq` is its record's head: a stale model refuses with `WorkcardConflict`.
|
|
142
230
|
- `WorkcardNotFound` is also the answer for another entity's card — never read it as "deleted".
|
|
143
231
|
- `CommitTimeout` leaves the transition pending; it will still commit.
|
|
144
232
|
- Keep schemas `$jsonSchema`-safe: no `integer`, every optional property nullable.
|
|
233
|
+
- Card types, flows and assignee types are data-defined, and a code key needs `overridable: true` to be
|
|
234
|
+
overridden; a data-defined declaration's `version` is its compare-and-set token.
|
|
235
|
+
- Auxiliary updates/removals require the record's current `version`. Their `fields` replace the
|
|
236
|
+
previous fields object; card `changes.fields` merge.
|
|
145
237
|
|
|
146
238
|
## Related packages
|
|
147
239
|
|
|
148
240
|
- `@owlmeans/server-planning` — executor, plugin registry, memory store, handlers
|
|
149
241
|
- `@owlmeans/client-planning` — remote facade, state mirror, commit waiting
|
|
150
242
|
- `@owlmeans/resource` — the criteria language
|
|
151
|
-
- `@owlmeans/
|
|
243
|
+
- `@owlmeans/planning-postgres` — the durable Postgres store
|
|
244
|
+
- `@owlmeans/planning-auth` — optional verified identity and group mapping
|
|
152
245
|
|
|
153
246
|
<!-- owlmeans:agent-guidance:start -->
|
|
154
247
|
## Agent guidance
|
|
@@ -158,7 +251,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
158
251
|
your project's skill store (`.agents/skills/`):
|
|
159
252
|
|
|
160
253
|
```sh
|
|
161
|
-
npx @owlmeans/agent-skills@^0.1.18
|
|
254
|
+
npx @owlmeans/agent-skills@^0.1.18
|
|
162
255
|
```
|
|
163
256
|
|
|
164
257
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
2
|
+
"schemaVersion": 3,
|
|
3
3
|
"package": "@owlmeans/planning",
|
|
4
|
-
"version": "0.1.18
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.18",
|
|
5
|
+
"generatedAt": "2026-10-28T00:31:34.734Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -10,7 +10,134 @@
|
|
|
10
10
|
"name": "planning",
|
|
11
11
|
"category": "package-specific",
|
|
12
12
|
"file": "skills/planning/SKILL.md",
|
|
13
|
-
"canonicalPath": ".agents/skills/planning/SKILL.md"
|
|
13
|
+
"canonicalPath": ".agents/skills/planning/SKILL.md",
|
|
14
|
+
"parts": [
|
|
15
|
+
{
|
|
16
|
+
"name": "collaboration",
|
|
17
|
+
"file": "skills/planning/parts/collaboration.md",
|
|
18
|
+
"description": "Assignees, comments with stable mentions, teams across projects, card hierarchy rules, the resources protocol branches, and PlanningReply's organization-free records.",
|
|
19
|
+
"purposes": [
|
|
20
|
+
"detail",
|
|
21
|
+
"view"
|
|
22
|
+
],
|
|
23
|
+
"mentions": [
|
|
24
|
+
"Assignee",
|
|
25
|
+
"Team",
|
|
26
|
+
"Comment",
|
|
27
|
+
"CommentMention",
|
|
28
|
+
"mentionHelper",
|
|
29
|
+
"PlanningResourceKind",
|
|
30
|
+
"PLANNING_PROJECT_TEAM",
|
|
31
|
+
"planningResourceAliases",
|
|
32
|
+
"planningReplyHelper",
|
|
33
|
+
"PlanningReply",
|
|
34
|
+
"teams.addMember",
|
|
35
|
+
"reporter",
|
|
36
|
+
"assignee"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "errors",
|
|
41
|
+
"file": "skills/planning/parts/errors.md",
|
|
42
|
+
"description": "Every refusal class with its planning marker and HTTP status, the httpStatus rules for a new refusal, and the eight-language i18n the package registers.",
|
|
43
|
+
"purposes": [
|
|
44
|
+
"feedback"
|
|
45
|
+
],
|
|
46
|
+
"mentions": [
|
|
47
|
+
"PlanningError",
|
|
48
|
+
"WorkcardNotFound",
|
|
49
|
+
"IllegalTransition",
|
|
50
|
+
"WorkcardConflict",
|
|
51
|
+
"PlanningRefused",
|
|
52
|
+
"FieldsInvalid",
|
|
53
|
+
"SchemaConflict",
|
|
54
|
+
"SchemaSealed",
|
|
55
|
+
"SchemaInvalid",
|
|
56
|
+
"PlanningForbidden",
|
|
57
|
+
"CommitTimeout",
|
|
58
|
+
"CommitFailed",
|
|
59
|
+
"lib:planning"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "fold",
|
|
64
|
+
"file": "skills/planning/parts/fold.md",
|
|
65
|
+
"description": "The pure fold (applyTransition, applyRelationship), what computeChanges records and assertMutable refuses, and the one query translation with its wire form.",
|
|
66
|
+
"purposes": [
|
|
67
|
+
"query",
|
|
68
|
+
"state"
|
|
69
|
+
],
|
|
70
|
+
"mentions": [
|
|
71
|
+
"applyHelper",
|
|
72
|
+
"applyTransition",
|
|
73
|
+
"applyRelationship",
|
|
74
|
+
"changesHelper",
|
|
75
|
+
"computeChanges",
|
|
76
|
+
"assertMutable",
|
|
77
|
+
"isEmptyChange",
|
|
78
|
+
"queryHelper",
|
|
79
|
+
"criteriaOf",
|
|
80
|
+
"listOptionsOf",
|
|
81
|
+
"summaryOf",
|
|
82
|
+
"wireHelper",
|
|
83
|
+
"encodeWorkcardQuery",
|
|
84
|
+
"decodeWorkcardQuery",
|
|
85
|
+
"WorkcardQuery"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "mounting",
|
|
90
|
+
"file": "skills/planning/parts/mounting.md",
|
|
91
|
+
"description": "The protocol tree makePlanningProtocols declares (leaves, routes, aliases, guards, the commit socket) and how a generated target mounts it.",
|
|
92
|
+
"purposes": [
|
|
93
|
+
"server-api",
|
|
94
|
+
"config"
|
|
95
|
+
],
|
|
96
|
+
"mentions": [
|
|
97
|
+
"makePlanningProtocols",
|
|
98
|
+
"planningAliasHelper",
|
|
99
|
+
"planningAliases",
|
|
100
|
+
"planningDefinitionAliases",
|
|
101
|
+
"PLANNING_PATH",
|
|
102
|
+
"socketBase",
|
|
103
|
+
"ExecuteRequest",
|
|
104
|
+
"CommitQuery",
|
|
105
|
+
"CommitFeedQuery",
|
|
106
|
+
"schema.define"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "types",
|
|
111
|
+
"file": "skills/planning/parts/types.md",
|
|
112
|
+
"description": "Declaring card, project and specification types and status flows as closed data, the application's own definition properties and base card fields (`app`), the data-defined layers (code, entity, project) and retirement, and the rules every record schema keeps.",
|
|
113
|
+
"purposes": [
|
|
114
|
+
"data"
|
|
115
|
+
],
|
|
116
|
+
"mentions": [
|
|
117
|
+
"WorkcardTypeSchema",
|
|
118
|
+
"ProjectTypeSchema",
|
|
119
|
+
"StatusFlowSchema",
|
|
120
|
+
"SpecificationSlot",
|
|
121
|
+
"CodePolicy",
|
|
122
|
+
"makeSchemaRegistry",
|
|
123
|
+
"scopedSchemaHelper",
|
|
124
|
+
"resolveScopedBundle",
|
|
125
|
+
"ScopedSchemaRecord",
|
|
126
|
+
"ScopedSchemaBundle",
|
|
127
|
+
"SchemaStore",
|
|
128
|
+
"putType",
|
|
129
|
+
"putFlow",
|
|
130
|
+
"putAssigneeType",
|
|
131
|
+
"scopedCardTypes",
|
|
132
|
+
"overridable",
|
|
133
|
+
"appSchemaHelper",
|
|
134
|
+
"PlanningAppDeclarations",
|
|
135
|
+
"PlanningAppSchema",
|
|
136
|
+
"registerApp",
|
|
137
|
+
"fieldsSchema"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
]
|
|
14
141
|
}
|
|
15
142
|
]
|
|
16
143
|
}
|