@owlmeans/viable-common 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -0
- package/agent-meta/manifest.json +16 -0
- package/agent-meta/skills/viable-common/SKILL.md +179 -0
- package/build/agent/index.d.ts +4 -0
- package/build/agent/index.d.ts.map +1 -0
- package/build/agent/index.js +3 -0
- package/build/agent/index.js.map +1 -0
- package/build/agent/memory.d.ts +12 -0
- package/build/agent/memory.d.ts.map +1 -0
- package/build/agent/memory.js +11 -0
- package/build/agent/memory.js.map +1 -0
- package/build/agent/spectator/consts.d.ts +9 -0
- package/build/agent/spectator/consts.d.ts.map +1 -0
- package/build/agent/spectator/consts.js +10 -0
- package/build/agent/spectator/consts.js.map +1 -0
- package/build/agent/spectator/index.d.ts +3 -0
- package/build/agent/spectator/index.d.ts.map +1 -0
- package/build/agent/spectator/index.js +2 -0
- package/build/agent/spectator/index.js.map +1 -0
- package/build/agent/spectator/types.d.ts +13 -0
- package/build/agent/spectator/types.d.ts.map +1 -0
- package/build/agent/spectator/types.js +2 -0
- package/build/agent/spectator/types.js.map +1 -0
- package/build/agent/types.d.ts +10 -0
- package/build/agent/types.d.ts.map +1 -0
- package/build/agent/types.js +2 -0
- package/build/agent/types.js.map +1 -0
- package/build/areas/consts.d.ts +88 -0
- package/build/areas/consts.d.ts.map +1 -0
- package/build/areas/consts.js +106 -0
- package/build/areas/consts.js.map +1 -0
- package/build/areas/index.d.ts +3 -0
- package/build/areas/index.d.ts.map +1 -0
- package/build/areas/index.js +2 -0
- package/build/areas/index.js.map +1 -0
- package/build/areas/types.d.ts +28 -0
- package/build/areas/types.d.ts.map +1 -0
- package/build/areas/types.js +2 -0
- package/build/areas/types.js.map +1 -0
- package/build/ba/consts.d.ts +38 -0
- package/build/ba/consts.d.ts.map +1 -0
- package/build/ba/consts.js +41 -0
- package/build/ba/consts.js.map +1 -0
- package/build/ba/helpers.d.ts +41 -0
- package/build/ba/helpers.d.ts.map +1 -0
- package/build/ba/helpers.js +79 -0
- package/build/ba/helpers.js.map +1 -0
- package/build/ba/index.d.ts +5 -0
- package/build/ba/index.d.ts.map +1 -0
- package/build/ba/index.js +4 -0
- package/build/ba/index.js.map +1 -0
- package/build/ba/schemas.d.ts +13 -0
- package/build/ba/schemas.d.ts.map +1 -0
- package/build/ba/schemas.js +181 -0
- package/build/ba/schemas.js.map +1 -0
- package/build/ba/types.d.ts +113 -0
- package/build/ba/types.d.ts.map +1 -0
- package/build/ba/types.js +2 -0
- package/build/ba/types.js.map +1 -0
- package/build/blueprint/case.d.ts +73 -0
- package/build/blueprint/case.d.ts.map +1 -0
- package/build/blueprint/case.js +244 -0
- package/build/blueprint/case.js.map +1 -0
- package/build/blueprint/consts.d.ts +11 -0
- package/build/blueprint/consts.d.ts.map +1 -0
- package/build/blueprint/consts.js +11 -0
- package/build/blueprint/consts.js.map +1 -0
- package/build/blueprint/index.d.ts +6 -0
- package/build/blueprint/index.d.ts.map +1 -0
- package/build/blueprint/index.js +6 -0
- package/build/blueprint/index.js.map +1 -0
- package/build/blueprint/resolve.d.ts +51 -0
- package/build/blueprint/resolve.d.ts.map +1 -0
- package/build/blueprint/resolve.js +108 -0
- package/build/blueprint/resolve.js.map +1 -0
- package/build/blueprint/schemas.d.ts +41 -0
- package/build/blueprint/schemas.d.ts.map +1 -0
- package/build/blueprint/schemas.js +27 -0
- package/build/blueprint/schemas.js.map +1 -0
- package/build/blueprint/types.d.ts +186 -0
- package/build/blueprint/types.d.ts.map +1 -0
- package/build/blueprint/types.js +32 -0
- package/build/blueprint/types.js.map +1 -0
- package/build/branding.d.ts +19 -0
- package/build/branding.d.ts.map +1 -0
- package/build/branding.js +32 -0
- package/build/branding.js.map +1 -0
- package/build/connect/consts.d.ts +378 -0
- package/build/connect/consts.d.ts.map +1 -0
- package/build/connect/consts.js +425 -0
- package/build/connect/consts.js.map +1 -0
- package/build/connect/entrypoints.d.ts +41 -0
- package/build/connect/entrypoints.d.ts.map +1 -0
- package/build/connect/entrypoints.js +141 -0
- package/build/connect/entrypoints.js.map +1 -0
- package/build/connect/errors.d.ts +50 -0
- package/build/connect/errors.d.ts.map +1 -0
- package/build/connect/errors.js +77 -0
- package/build/connect/errors.js.map +1 -0
- package/build/connect/index.d.ts +8 -0
- package/build/connect/index.d.ts.map +1 -0
- package/build/connect/index.js +6 -0
- package/build/connect/index.js.map +1 -0
- package/build/connect/ops.d.ts +192 -0
- package/build/connect/ops.d.ts.map +1 -0
- package/build/connect/ops.js +2 -0
- package/build/connect/ops.js.map +1 -0
- package/build/connect/references.d.ts +194 -0
- package/build/connect/references.d.ts.map +1 -0
- package/build/connect/references.js +62 -0
- package/build/connect/references.js.map +1 -0
- package/build/connect/schemas.d.ts +59 -0
- package/build/connect/schemas.d.ts.map +1 -0
- package/build/connect/schemas.js +346 -0
- package/build/connect/schemas.js.map +1 -0
- package/build/connect/types.d.ts +428 -0
- package/build/connect/types.d.ts.map +1 -0
- package/build/connect/types.js +2 -0
- package/build/connect/types.js.map +1 -0
- package/build/consts.d.ts +9 -0
- package/build/consts.d.ts.map +1 -0
- package/build/consts.js +31 -0
- package/build/consts.js.map +1 -0
- package/build/convert/consts.d.ts +539 -0
- package/build/convert/consts.d.ts.map +1 -0
- package/build/convert/consts.js +630 -0
- package/build/convert/consts.js.map +1 -0
- package/build/convert/helpers.d.ts +91 -0
- package/build/convert/helpers.d.ts.map +1 -0
- package/build/convert/helpers.js +301 -0
- package/build/convert/helpers.js.map +1 -0
- package/build/convert/index.d.ts +11 -0
- package/build/convert/index.d.ts.map +1 -0
- package/build/convert/index.js +4 -0
- package/build/convert/index.js.map +1 -0
- package/build/convert/schemas.d.ts +62 -0
- package/build/convert/schemas.d.ts.map +1 -0
- package/build/convert/schemas.js +626 -0
- package/build/convert/schemas.js.map +1 -0
- package/build/convert/types.d.ts +683 -0
- package/build/convert/types.d.ts.map +1 -0
- package/build/convert/types.js +2 -0
- package/build/convert/types.js.map +1 -0
- package/build/design/consts.d.ts +25 -0
- package/build/design/consts.d.ts.map +1 -0
- package/build/design/consts.js +26 -0
- package/build/design/consts.js.map +1 -0
- package/build/design/helpers.d.ts +60 -0
- package/build/design/helpers.d.ts.map +1 -0
- package/build/design/helpers.js +221 -0
- package/build/design/helpers.js.map +1 -0
- package/build/design/index.d.ts +6 -0
- package/build/design/index.d.ts.map +1 -0
- package/build/design/index.js +5 -0
- package/build/design/index.js.map +1 -0
- package/build/design/runtime.d.ts +126 -0
- package/build/design/runtime.d.ts.map +1 -0
- package/build/design/runtime.js +65 -0
- package/build/design/runtime.js.map +1 -0
- package/build/design/schemas.d.ts +21 -0
- package/build/design/schemas.d.ts.map +1 -0
- package/build/design/schemas.js +369 -0
- package/build/design/schemas.js.map +1 -0
- package/build/design/types.d.ts +199 -0
- package/build/design/types.d.ts.map +1 -0
- package/build/design/types.js +2 -0
- package/build/design/types.js.map +1 -0
- package/build/dev/consts.d.ts +32 -0
- package/build/dev/consts.d.ts.map +1 -0
- package/build/dev/consts.js +33 -0
- package/build/dev/consts.js.map +1 -0
- package/build/dev/index.d.ts +4 -0
- package/build/dev/index.d.ts.map +1 -0
- package/build/dev/index.js +3 -0
- package/build/dev/index.js.map +1 -0
- package/build/dev/schemas.d.ts +15 -0
- package/build/dev/schemas.d.ts.map +1 -0
- package/build/dev/schemas.js +116 -0
- package/build/dev/schemas.js.map +1 -0
- package/build/dev/types.d.ts +42 -0
- package/build/dev/types.d.ts.map +1 -0
- package/build/dev/types.js +2 -0
- package/build/dev/types.js.map +1 -0
- package/build/execution/consts.d.ts +36 -0
- package/build/execution/consts.d.ts.map +1 -0
- package/build/execution/consts.js +37 -0
- package/build/execution/consts.js.map +1 -0
- package/build/execution/index.d.ts +3 -0
- package/build/execution/index.d.ts.map +1 -0
- package/build/execution/index.js +2 -0
- package/build/execution/index.js.map +1 -0
- package/build/execution/types.d.ts +50 -0
- package/build/execution/types.d.ts.map +1 -0
- package/build/execution/types.js +2 -0
- package/build/execution/types.js.map +1 -0
- package/build/index.d.ts +22 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +21 -0
- package/build/index.js.map +1 -0
- package/build/integrity/consts.d.ts +226 -0
- package/build/integrity/consts.d.ts.map +1 -0
- package/build/integrity/consts.js +401 -0
- package/build/integrity/consts.js.map +1 -0
- package/build/integrity/index.d.ts +4 -0
- package/build/integrity/index.d.ts.map +1 -0
- package/build/integrity/index.js +3 -0
- package/build/integrity/index.js.map +1 -0
- package/build/integrity/types.d.ts +35 -0
- package/build/integrity/types.d.ts.map +1 -0
- package/build/integrity/types.js +2 -0
- package/build/integrity/types.js.map +1 -0
- package/build/integrity/verify.d.ts +23 -0
- package/build/integrity/verify.d.ts.map +1 -0
- package/build/integrity/verify.js +198 -0
- package/build/integrity/verify.js.map +1 -0
- package/build/metadata/consts.d.ts +101 -0
- package/build/metadata/consts.d.ts.map +1 -0
- package/build/metadata/consts.js +104 -0
- package/build/metadata/consts.js.map +1 -0
- package/build/metadata/index.d.ts +3 -0
- package/build/metadata/index.d.ts.map +1 -0
- package/build/metadata/index.js +3 -0
- package/build/metadata/index.js.map +1 -0
- package/build/metadata/types.d.ts +286 -0
- package/build/metadata/types.d.ts.map +1 -0
- package/build/metadata/types.js +39 -0
- package/build/metadata/types.js.map +1 -0
- package/build/moderation/consts.d.ts +58 -0
- package/build/moderation/consts.d.ts.map +1 -0
- package/build/moderation/consts.js +60 -0
- package/build/moderation/consts.js.map +1 -0
- package/build/moderation/index.d.ts +5 -0
- package/build/moderation/index.d.ts.map +1 -0
- package/build/moderation/index.js +4 -0
- package/build/moderation/index.js.map +1 -0
- package/build/moderation/schemas.d.ts +19 -0
- package/build/moderation/schemas.d.ts.map +1 -0
- package/build/moderation/schemas.js +26 -0
- package/build/moderation/schemas.js.map +1 -0
- package/build/moderation/types.d.ts +64 -0
- package/build/moderation/types.d.ts.map +1 -0
- package/build/moderation/types.js +2 -0
- package/build/moderation/types.js.map +1 -0
- package/build/moderation/utils.d.ts +21 -0
- package/build/moderation/utils.d.ts.map +1 -0
- package/build/moderation/utils.js +31 -0
- package/build/moderation/utils.js.map +1 -0
- package/build/preview/consts.d.ts +10 -0
- package/build/preview/consts.d.ts.map +1 -0
- package/build/preview/consts.js +11 -0
- package/build/preview/consts.js.map +1 -0
- package/build/preview/index.d.ts +3 -0
- package/build/preview/index.d.ts.map +1 -0
- package/build/preview/index.js +2 -0
- package/build/preview/index.js.map +1 -0
- package/build/preview/types.d.ts +60 -0
- package/build/preview/types.d.ts.map +1 -0
- package/build/preview/types.js +2 -0
- package/build/preview/types.js.map +1 -0
- package/build/scaffold/consts.d.ts +25 -0
- package/build/scaffold/consts.d.ts.map +1 -0
- package/build/scaffold/consts.js +26 -0
- package/build/scaffold/consts.js.map +1 -0
- package/build/scaffold/helpers.d.ts +35 -0
- package/build/scaffold/helpers.d.ts.map +1 -0
- package/build/scaffold/helpers.js +54 -0
- package/build/scaffold/helpers.js.map +1 -0
- package/build/scaffold/index.d.ts +5 -0
- package/build/scaffold/index.d.ts.map +1 -0
- package/build/scaffold/index.js +4 -0
- package/build/scaffold/index.js.map +1 -0
- package/build/scaffold/schemas.d.ts +5 -0
- package/build/scaffold/schemas.d.ts.map +1 -0
- package/build/scaffold/schemas.js +273 -0
- package/build/scaffold/schemas.js.map +1 -0
- package/build/scaffold/types.d.ts +144 -0
- package/build/scaffold/types.d.ts.map +1 -0
- package/build/scaffold/types.js +2 -0
- package/build/scaffold/types.js.map +1 -0
- package/build/skills/catalogue.d.ts +47 -0
- package/build/skills/catalogue.d.ts.map +1 -0
- package/build/skills/catalogue.js +1566 -0
- package/build/skills/catalogue.js.map +1 -0
- package/build/skills/consts.d.ts +104 -0
- package/build/skills/consts.d.ts.map +1 -0
- package/build/skills/consts.js +170 -0
- package/build/skills/consts.js.map +1 -0
- package/build/skills/index.d.ts +4 -0
- package/build/skills/index.d.ts.map +1 -0
- package/build/skills/index.js +4 -0
- package/build/skills/index.js.map +1 -0
- package/build/skills/roles.d.ts +52 -0
- package/build/skills/roles.d.ts.map +1 -0
- package/build/skills/roles.js +256 -0
- package/build/skills/roles.js.map +1 -0
- package/build/slot/consts.d.ts +305 -0
- package/build/slot/consts.d.ts.map +1 -0
- package/build/slot/consts.js +376 -0
- package/build/slot/consts.js.map +1 -0
- package/build/slot/helpers.d.ts +25 -0
- package/build/slot/helpers.d.ts.map +1 -0
- package/build/slot/helpers.js +27 -0
- package/build/slot/helpers.js.map +1 -0
- package/build/slot/index.d.ts +6 -0
- package/build/slot/index.d.ts.map +1 -0
- package/build/slot/index.js +5 -0
- package/build/slot/index.js.map +1 -0
- package/build/slot/layout.d.ts +72 -0
- package/build/slot/layout.d.ts.map +1 -0
- package/build/slot/layout.js +82 -0
- package/build/slot/layout.js.map +1 -0
- package/build/slot/schemas.d.ts +12 -0
- package/build/slot/schemas.d.ts.map +1 -0
- package/build/slot/schemas.js +43 -0
- package/build/slot/schemas.js.map +1 -0
- package/build/slot/types.d.ts +147 -0
- package/build/slot/types.d.ts.map +1 -0
- package/build/slot/types.js +2 -0
- package/build/slot/types.js.map +1 -0
- package/build/topology/card.d.ts +23 -0
- package/build/topology/card.d.ts.map +1 -0
- package/build/topology/card.js +95 -0
- package/build/topology/card.js.map +1 -0
- package/build/topology/consts.d.ts +32 -0
- package/build/topology/consts.d.ts.map +1 -0
- package/build/topology/consts.js +55 -0
- package/build/topology/consts.js.map +1 -0
- package/build/topology/helpers.d.ts +44 -0
- package/build/topology/helpers.d.ts.map +1 -0
- package/build/topology/helpers.js +112 -0
- package/build/topology/helpers.js.map +1 -0
- package/build/topology/index.d.ts +5 -0
- package/build/topology/index.d.ts.map +1 -0
- package/build/topology/index.js +4 -0
- package/build/topology/index.js.map +1 -0
- package/build/topology/types.d.ts +83 -0
- package/build/topology/types.d.ts.map +1 -0
- package/build/topology/types.js +2 -0
- package/build/topology/types.js.map +1 -0
- package/build/types.d.ts +88 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/build/ux/consts.d.ts +5 -0
- package/build/ux/consts.d.ts.map +1 -0
- package/build/ux/consts.js +6 -0
- package/build/ux/consts.js.map +1 -0
- package/build/ux/index.d.ts +4 -0
- package/build/ux/index.d.ts.map +1 -0
- package/build/ux/index.js +3 -0
- package/build/ux/index.js.map +1 -0
- package/build/ux/schemas.d.ts +8 -0
- package/build/ux/schemas.d.ts.map +1 -0
- package/build/ux/schemas.js +91 -0
- package/build/ux/schemas.js.map +1 -0
- package/build/ux/types.d.ts +21 -0
- package/build/ux/types.d.ts.map +1 -0
- package/build/ux/types.js +2 -0
- package/build/ux/types.js.map +1 -0
- package/package.json +71 -0
- package/src/agent/index.ts +4 -0
- package/src/agent/memory.ts +16 -0
- package/src/agent/spectator/consts.ts +10 -0
- package/src/agent/spectator/index.ts +3 -0
- package/src/agent/spectator/types.ts +14 -0
- package/src/agent/types.ts +10 -0
- package/src/areas/consts.ts +112 -0
- package/src/areas/index.ts +3 -0
- package/src/areas/types.ts +29 -0
- package/src/ba/consts.ts +40 -0
- package/src/ba/helpers.ts +93 -0
- package/src/ba/index.ts +5 -0
- package/src/ba/schemas.ts +196 -0
- package/src/ba/types.ts +125 -0
- package/src/blueprint/case.ts +272 -0
- package/src/blueprint/consts.ts +11 -0
- package/src/blueprint/index.ts +6 -0
- package/src/blueprint/resolve.ts +133 -0
- package/src/blueprint/schemas.ts +44 -0
- package/src/blueprint/types.ts +204 -0
- package/src/branding.ts +34 -0
- package/src/connect/consts.ts +441 -0
- package/src/connect/entrypoints.ts +291 -0
- package/src/connect/errors.ts +91 -0
- package/src/connect/index.ts +7 -0
- package/src/connect/ops.ts +208 -0
- package/src/connect/references.ts +89 -0
- package/src/connect/schemas.ts +384 -0
- package/src/connect/types.ts +456 -0
- package/src/consts.ts +34 -0
- package/src/convert/consts.ts +672 -0
- package/src/convert/helpers.ts +340 -0
- package/src/convert/index.ts +10 -0
- package/src/convert/schemas.ts +663 -0
- package/src/convert/types.ts +741 -0
- package/src/design/consts.ts +26 -0
- package/src/design/helpers.ts +255 -0
- package/src/design/index.ts +5 -0
- package/src/design/runtime.ts +142 -0
- package/src/design/schemas.ts +384 -0
- package/src/design/types.ts +191 -0
- package/src/dev/consts.ts +35 -0
- package/src/dev/index.ts +4 -0
- package/src/dev/schemas.ts +124 -0
- package/src/dev/types.ts +47 -0
- package/src/execution/consts.ts +37 -0
- package/src/execution/index.ts +3 -0
- package/src/execution/types.ts +55 -0
- package/src/index.ts +22 -0
- package/src/integrity/consts.ts +477 -0
- package/src/integrity/index.ts +3 -0
- package/src/integrity/types.ts +37 -0
- package/src/integrity/verify.ts +221 -0
- package/src/metadata/consts.ts +118 -0
- package/src/metadata/index.ts +3 -0
- package/src/metadata/types.ts +310 -0
- package/src/moderation/consts.ts +59 -0
- package/src/moderation/index.ts +4 -0
- package/src/moderation/schemas.ts +28 -0
- package/src/moderation/types.ts +68 -0
- package/src/moderation/utils.ts +35 -0
- package/src/preview/consts.ts +9 -0
- package/src/preview/index.ts +3 -0
- package/src/preview/types.ts +79 -0
- package/src/scaffold/consts.ts +26 -0
- package/src/scaffold/helpers.ts +84 -0
- package/src/scaffold/index.ts +4 -0
- package/src/scaffold/schemas.ts +283 -0
- package/src/scaffold/types.ts +118 -0
- package/src/skills/catalogue.ts +1617 -0
- package/src/skills/consts.ts +183 -0
- package/src/skills/index.ts +4 -0
- package/src/skills/roles.ts +299 -0
- package/src/slot/consts.ts +393 -0
- package/src/slot/helpers.ts +34 -0
- package/src/slot/index.ts +5 -0
- package/src/slot/layout.ts +141 -0
- package/src/slot/schemas.ts +46 -0
- package/src/slot/types.ts +164 -0
- package/src/topology/card.ts +106 -0
- package/src/topology/consts.ts +59 -0
- package/src/topology/helpers.ts +138 -0
- package/src/topology/index.ts +5 -0
- package/src/topology/types.ts +86 -0
- package/src/types.ts +104 -0
- package/src/ux/consts.ts +5 -0
- package/src/ux/index.ts +4 -0
- package/src/ux/schemas.ts +97 -0
- package/src/ux/types.ts +25 -0
- package/tests/connect-convert.spec.ts +161 -0
- package/tests/convert.spec.ts +318 -0
- package/tests/design.spec.ts +136 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import type { JSONSchemaType } from 'ajv'
|
|
2
|
+
|
|
3
|
+
import { ProjectArea } from '../areas/consts.js'
|
|
4
|
+
import { StoryActor, StoryAgentKind } from './runtime.js'
|
|
5
|
+
import type { StoryDesignAgent, StoryDesignJob } from './runtime.js'
|
|
6
|
+
import type { StoryDesign } from './types.js'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The design shape, validated where the shape is DEFINED.
|
|
10
|
+
*
|
|
11
|
+
* A record store that carried a strict `$jsonSchema` over this would have to be edited in another
|
|
12
|
+
* repository every time this library added a field - which is exactly how a slot-metadata field
|
|
13
|
+
* once reached the wire, missed the schema, and took out every newly provisioned slot with the
|
|
14
|
+
* spec still green. So the payload is stored as JSON text and validated with THIS, by the store,
|
|
15
|
+
* before the write.
|
|
16
|
+
*
|
|
17
|
+
* `additionalProperties: false` at every level, so a field the library dropped cannot survive in
|
|
18
|
+
* an old revision and be silently read back by code that no longer knows what it meant.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const specs = {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
ux: { type: 'string' },
|
|
25
|
+
ui: { type: 'string' },
|
|
26
|
+
},
|
|
27
|
+
required: ['ux', 'ui'],
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
} as const
|
|
30
|
+
|
|
31
|
+
export const StoryDesignSchema: JSONSchemaType<StoryDesign> = {
|
|
32
|
+
type: 'object',
|
|
33
|
+
title: 'StoryDesign',
|
|
34
|
+
description: 'Everything a user story will be, decided before any of it is written',
|
|
35
|
+
properties: {
|
|
36
|
+
version: { type: 'integer', minimum: 1 },
|
|
37
|
+
code: { type: 'string' },
|
|
38
|
+
narrative: { type: 'string' },
|
|
39
|
+
area: { type: 'string', enum: Object.values(ProjectArea) },
|
|
40
|
+
reserved: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
section: { type: 'string', nullable: true },
|
|
44
|
+
screen: { type: 'string', nullable: true },
|
|
45
|
+
},
|
|
46
|
+
required: [],
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
},
|
|
49
|
+
entities: {
|
|
50
|
+
type: 'array',
|
|
51
|
+
items: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
properties: {
|
|
54
|
+
name: { type: 'string' },
|
|
55
|
+
description: { type: 'string' },
|
|
56
|
+
dir: { type: 'string' },
|
|
57
|
+
},
|
|
58
|
+
required: ['name', 'description', 'dir'],
|
|
59
|
+
additionalProperties: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
screens: {
|
|
63
|
+
type: 'array',
|
|
64
|
+
items: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
name: { type: 'string' },
|
|
68
|
+
definition: { type: 'string' },
|
|
69
|
+
path: { type: 'string' },
|
|
70
|
+
alias: { type: 'string' },
|
|
71
|
+
url: { type: 'string' },
|
|
72
|
+
parent: { type: 'string' },
|
|
73
|
+
section: { type: 'string', nullable: true },
|
|
74
|
+
adopted: { type: 'boolean' },
|
|
75
|
+
specs,
|
|
76
|
+
components: { type: 'array', items: { type: 'string' } },
|
|
77
|
+
},
|
|
78
|
+
required: [
|
|
79
|
+
'name', 'definition', 'path', 'alias', 'url', 'parent', 'adopted', 'specs', 'components',
|
|
80
|
+
],
|
|
81
|
+
additionalProperties: false,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
components: {
|
|
85
|
+
type: 'array',
|
|
86
|
+
items: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: {
|
|
89
|
+
name: { type: 'string' },
|
|
90
|
+
definition: { type: 'string' },
|
|
91
|
+
path: { type: 'string' },
|
|
92
|
+
viewModelPath: { type: 'string' },
|
|
93
|
+
adopted: { type: 'boolean' },
|
|
94
|
+
screen: { type: 'string' },
|
|
95
|
+
entities: { type: 'array', items: { type: 'string' } },
|
|
96
|
+
specs,
|
|
97
|
+
},
|
|
98
|
+
required: [
|
|
99
|
+
'name', 'definition', 'path', 'viewModelPath', 'adopted', 'screen', 'entities', 'specs',
|
|
100
|
+
],
|
|
101
|
+
additionalProperties: false,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
types: {
|
|
105
|
+
type: 'array',
|
|
106
|
+
items: {
|
|
107
|
+
type: 'object',
|
|
108
|
+
properties: {
|
|
109
|
+
path: { type: 'string' },
|
|
110
|
+
entity: { type: 'string' },
|
|
111
|
+
purpose: { type: 'string' },
|
|
112
|
+
components: { type: 'array', items: { type: 'string' } },
|
|
113
|
+
},
|
|
114
|
+
required: ['path', 'entity', 'purpose', 'components'],
|
|
115
|
+
additionalProperties: false,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
resources: {
|
|
119
|
+
type: 'array',
|
|
120
|
+
items: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
properties: {
|
|
123
|
+
path: { type: 'string' },
|
|
124
|
+
entity: { type: 'string' },
|
|
125
|
+
type: { type: 'string' },
|
|
126
|
+
alias: { type: 'string' },
|
|
127
|
+
purpose: { type: 'string' },
|
|
128
|
+
},
|
|
129
|
+
required: ['path', 'entity', 'type', 'alias', 'purpose'],
|
|
130
|
+
additionalProperties: false,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
models: {
|
|
134
|
+
type: 'array',
|
|
135
|
+
items: {
|
|
136
|
+
type: 'object',
|
|
137
|
+
properties: {
|
|
138
|
+
path: { type: 'string' },
|
|
139
|
+
entities: { type: 'array', items: { type: 'string' } },
|
|
140
|
+
solution: { type: 'string', nullable: true },
|
|
141
|
+
},
|
|
142
|
+
required: ['path', 'entities'],
|
|
143
|
+
additionalProperties: false,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
api: {
|
|
147
|
+
type: 'array',
|
|
148
|
+
items: {
|
|
149
|
+
type: 'object',
|
|
150
|
+
properties: {
|
|
151
|
+
path: { type: 'string' },
|
|
152
|
+
entity: { type: 'string' },
|
|
153
|
+
type: { type: 'string' },
|
|
154
|
+
model: { type: 'string' },
|
|
155
|
+
endpoints: {
|
|
156
|
+
type: 'array',
|
|
157
|
+
items: {
|
|
158
|
+
type: 'object',
|
|
159
|
+
properties: {
|
|
160
|
+
alias: { type: 'string' },
|
|
161
|
+
method: { type: 'string' },
|
|
162
|
+
path: { type: 'string' },
|
|
163
|
+
purpose: { type: 'string' },
|
|
164
|
+
},
|
|
165
|
+
required: ['alias', 'method', 'path', 'purpose'],
|
|
166
|
+
additionalProperties: false,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
required: ['path', 'entity', 'type', 'model', 'endpoints'],
|
|
171
|
+
additionalProperties: false,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
stores: {
|
|
175
|
+
type: 'array',
|
|
176
|
+
items: {
|
|
177
|
+
type: 'object',
|
|
178
|
+
properties: {
|
|
179
|
+
path: { type: 'string' },
|
|
180
|
+
entity: { type: 'string' },
|
|
181
|
+
type: { type: 'string' },
|
|
182
|
+
api: { type: 'string' },
|
|
183
|
+
},
|
|
184
|
+
required: ['path', 'entity', 'type', 'api'],
|
|
185
|
+
additionalProperties: false,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
transitions: {
|
|
189
|
+
type: 'array',
|
|
190
|
+
items: {
|
|
191
|
+
type: 'object',
|
|
192
|
+
properties: {
|
|
193
|
+
from: { type: 'string' },
|
|
194
|
+
to: { type: 'string' },
|
|
195
|
+
initiator: { type: 'string' },
|
|
196
|
+
action: { type: 'string' },
|
|
197
|
+
type: { type: 'string' },
|
|
198
|
+
},
|
|
199
|
+
required: ['from', 'to', 'initiator', 'action', 'type'],
|
|
200
|
+
additionalProperties: false,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
access: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
properties: {
|
|
206
|
+
// Keyed by entrypoint ALIAS, and the aliases come back from a model matched against
|
|
207
|
+
// generated code - so the keys cannot be enumerated here, only their shape.
|
|
208
|
+
list: { type: 'object', additionalProperties: true, required: [] },
|
|
209
|
+
resolvedAt: { type: 'object', additionalProperties: { type: 'string' }, required: [] },
|
|
210
|
+
},
|
|
211
|
+
required: ['list', 'resolvedAt'],
|
|
212
|
+
additionalProperties: false,
|
|
213
|
+
},
|
|
214
|
+
// Optional: a design written before the gate existed carries none, and every reader takes
|
|
215
|
+
// "absent" as "none of it" — which is both the safe answer and the true one.
|
|
216
|
+
runtime: {
|
|
217
|
+
type: 'object',
|
|
218
|
+
nullable: true,
|
|
219
|
+
properties: {
|
|
220
|
+
actor: { type: 'string', enum: Object.values(StoryActor) },
|
|
221
|
+
worker: { type: 'boolean' },
|
|
222
|
+
kv: { type: 'boolean' },
|
|
223
|
+
feedback: { type: 'string', nullable: true },
|
|
224
|
+
jobs: {
|
|
225
|
+
type: 'array',
|
|
226
|
+
items: {
|
|
227
|
+
type: 'object',
|
|
228
|
+
properties: {
|
|
229
|
+
queue: { type: 'string' },
|
|
230
|
+
name: { type: 'string' },
|
|
231
|
+
path: { type: 'string' },
|
|
232
|
+
purpose: { type: 'string' },
|
|
233
|
+
reason: { type: 'string' },
|
|
234
|
+
idempotency: { type: 'string' },
|
|
235
|
+
},
|
|
236
|
+
required: ['queue', 'name', 'path', 'purpose', 'reason', 'idempotency'],
|
|
237
|
+
additionalProperties: false,
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
agents: {
|
|
241
|
+
type: 'array',
|
|
242
|
+
items: {
|
|
243
|
+
type: 'object',
|
|
244
|
+
properties: {
|
|
245
|
+
alias: { type: 'string' },
|
|
246
|
+
path: { type: 'string' },
|
|
247
|
+
purpose: { type: 'string' },
|
|
248
|
+
kind: { type: 'string', enum: Object.values(StoryAgentKind) },
|
|
249
|
+
job: { type: 'string', nullable: true },
|
|
250
|
+
},
|
|
251
|
+
required: ['alias', 'path', 'purpose', 'kind'],
|
|
252
|
+
additionalProperties: false,
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
required: ['actor', 'worker', 'kv', 'jobs', 'agents'],
|
|
257
|
+
additionalProperties: false,
|
|
258
|
+
},
|
|
259
|
+
provenance: {
|
|
260
|
+
type: 'object',
|
|
261
|
+
properties: {
|
|
262
|
+
designedAt: { type: 'string' },
|
|
263
|
+
narrativeHash: { type: 'string' },
|
|
264
|
+
projectHash: { type: 'string' },
|
|
265
|
+
registryHash: { type: 'string' },
|
|
266
|
+
paths: {
|
|
267
|
+
type: 'array',
|
|
268
|
+
items: {
|
|
269
|
+
type: 'object',
|
|
270
|
+
properties: {
|
|
271
|
+
path: { type: 'string' },
|
|
272
|
+
hash: { type: 'string' },
|
|
273
|
+
},
|
|
274
|
+
required: ['path', 'hash'],
|
|
275
|
+
additionalProperties: false,
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
required: ['designedAt', 'narrativeHash', 'projectHash', 'registryHash', 'paths'],
|
|
280
|
+
additionalProperties: false,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
required: [
|
|
284
|
+
'version', 'code', 'narrative', 'area', 'reserved', 'entities', 'screens', 'components',
|
|
285
|
+
'types', 'resources', 'models', 'api', 'stores', 'transitions', 'access', 'provenance',
|
|
286
|
+
],
|
|
287
|
+
additionalProperties: false,
|
|
288
|
+
} as unknown as JSONSchemaType<StoryDesign>
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* What the runtime gate answers with.
|
|
292
|
+
*
|
|
293
|
+
* Deliberately NOT `StoryDesignRuntime`: the model is asked what the story NEEDS, and the derived
|
|
294
|
+
* half — whether that adds up to a worker, whether an agent has a job to run in — is the helper's
|
|
295
|
+
* to compute. A model asked for `worker: boolean` beside a job list can answer with the two
|
|
296
|
+
* disagreeing, and there is no honest way to pick a winner.
|
|
297
|
+
*/
|
|
298
|
+
export const RuntimeDecisionSchema = {
|
|
299
|
+
type: 'object',
|
|
300
|
+
properties: {
|
|
301
|
+
kv: {
|
|
302
|
+
type: 'boolean',
|
|
303
|
+
description: 'True only for data with an expiry, a lock, a counter or a fan-out, and a '
|
|
304
|
+
+ 'small bounded key set. Records the product owns and queries belong in Postgres.',
|
|
305
|
+
},
|
|
306
|
+
feedback: {
|
|
307
|
+
type: 'string',
|
|
308
|
+
description: 'Where a person sees the progress of this queued work — the screen or story '
|
|
309
|
+
+ 'that shows it. Empty when nothing is queued.',
|
|
310
|
+
},
|
|
311
|
+
jobs: {
|
|
312
|
+
type: 'array',
|
|
313
|
+
description: 'Empty for almost every story. One entry per unit of work that genuinely '
|
|
314
|
+
+ 'cannot run inside a request.',
|
|
315
|
+
items: {
|
|
316
|
+
type: 'object',
|
|
317
|
+
properties: {
|
|
318
|
+
queue: { type: 'string', description: 'The queue name. Reuse one the project has.' },
|
|
319
|
+
name: {
|
|
320
|
+
type: 'string',
|
|
321
|
+
description: 'What the job DOES, as `<entity>:<action>` — `contract:analyze`, '
|
|
322
|
+
+ '`report:build`. The alias, the route, the processor file name and the handler '
|
|
323
|
+
+ 'symbol are all derived from it, so give the action and not an identifier.',
|
|
324
|
+
},
|
|
325
|
+
path: { type: 'string', description: 'Ignored — the processor file is derived from the '
|
|
326
|
+
+ 'name, so the two can never disagree. Give the name and leave this empty.' },
|
|
327
|
+
purpose: { type: 'string', description: 'What it does, in one sentence.' },
|
|
328
|
+
reason: {
|
|
329
|
+
type: 'string',
|
|
330
|
+
description: 'WHICH of the listed reasons makes this impossible inside a request. '
|
|
331
|
+
+ 'Name the property; do not restate the story.',
|
|
332
|
+
},
|
|
333
|
+
idempotency: {
|
|
334
|
+
type: 'string',
|
|
335
|
+
description: 'Concretely how running it twice is safe. A worker can die mid-job.',
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
required: ['queue', 'name', 'path', 'purpose', 'reason', 'idempotency'],
|
|
339
|
+
additionalProperties: false,
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
agents: {
|
|
343
|
+
type: 'array',
|
|
344
|
+
description: 'Empty unless the work is genuinely a language task the application performs.',
|
|
345
|
+
items: {
|
|
346
|
+
type: 'object',
|
|
347
|
+
properties: {
|
|
348
|
+
alias: { type: 'string', description: 'lowerCamelCase alias in the app agent registry.' },
|
|
349
|
+
path: { type: 'string', description: 'Module file name, without a directory.' },
|
|
350
|
+
purpose: { type: 'string' },
|
|
351
|
+
kind: {
|
|
352
|
+
type: 'string',
|
|
353
|
+
enum: Object.values(StoryAgentKind),
|
|
354
|
+
description: '`call` for one prompt and one answer — the default and almost '
|
|
355
|
+
+ 'always right; `pipeline` for steps this application names in advance; `agent` '
|
|
356
|
+
+ 'only when the number of steps cannot be predicted and tool choice is the '
|
|
357
|
+
+ "model's own judgement.",
|
|
358
|
+
},
|
|
359
|
+
job: {
|
|
360
|
+
type: 'string',
|
|
361
|
+
description: 'The `name` of the job that runs it, copied from the job list above. '
|
|
362
|
+
+ 'An agent never runs on the request path, so a job that calls a model must name '
|
|
363
|
+
+ 'the agent it runs and that agent must name the job back.',
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
required: ['alias', 'path', 'purpose', 'kind', 'job'],
|
|
367
|
+
additionalProperties: false,
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
required: ['kv', 'feedback', 'jobs', 'agents'],
|
|
372
|
+
additionalProperties: false,
|
|
373
|
+
// Structured-output schema rather than a validated record shape: AJV's `JSONSchemaType` would
|
|
374
|
+
// demand `minItems` on every array to prove non-emptiness, and the whole point of these arrays
|
|
375
|
+
// is that they are usually empty.
|
|
376
|
+
} as unknown as JSONSchemaType<RuntimeDecision>
|
|
377
|
+
|
|
378
|
+
/** What the gate answers with — the model's half of {@link StoryDesignRuntime}. */
|
|
379
|
+
export interface RuntimeDecision {
|
|
380
|
+
kv: boolean
|
|
381
|
+
feedback: string
|
|
382
|
+
jobs: StoryDesignJob[]
|
|
383
|
+
agents: StoryDesignAgent[]
|
|
384
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import type { ProjectArea } from '../areas/consts.js'
|
|
2
|
+
import type { StoryDesignRuntime } from './runtime.js'
|
|
3
|
+
import type { AccessList } from '../dev/types.js'
|
|
4
|
+
import type { UXTransition } from '../ux/types.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One screen, as the design decided it.
|
|
8
|
+
*
|
|
9
|
+
* Every name here is ALLOCATED — through the project's name registry — rather than invented by
|
|
10
|
+
* whoever writes the file later. That is the difference between a design and a wish: two runs days
|
|
11
|
+
* apart address the same file because the design named it, not because they guessed alike.
|
|
12
|
+
*/
|
|
13
|
+
export interface StoryDesignScreen {
|
|
14
|
+
/** The UX name, `{section}/{part}/{purpose}`. Not a path. */
|
|
15
|
+
name: string
|
|
16
|
+
/** The path-shaped stem the file and its aliases are derived from. */
|
|
17
|
+
definition: string
|
|
18
|
+
path: string
|
|
19
|
+
/** The entrypoint alias. This is the key access rules and the navigation registry use. */
|
|
20
|
+
alias: string
|
|
21
|
+
url: string
|
|
22
|
+
/** The AREA entrypoint this screen hangs under. Deterministic from the story's area. */
|
|
23
|
+
parent: string
|
|
24
|
+
/**
|
|
25
|
+
* The top-menu group. ALWAYS the scaffold's reservation, never derived from `name`.
|
|
26
|
+
*
|
|
27
|
+
* The menu group is decided once, when the application is drawn, so a story's screens land in
|
|
28
|
+
* the same section as the dashboard that links to them. A name-derived fallback puts them in a
|
|
29
|
+
* group that dashboard is not in, and nothing fails.
|
|
30
|
+
*/
|
|
31
|
+
section?: string
|
|
32
|
+
/** True when the design adopted a file that already existed rather than naming a new one. */
|
|
33
|
+
adopted: boolean
|
|
34
|
+
specs: { ux: string, ui: string }
|
|
35
|
+
/** Keys into `components`, in render order. */
|
|
36
|
+
components: string[]
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface StoryDesignComponent {
|
|
40
|
+
name: string
|
|
41
|
+
definition: string
|
|
42
|
+
path: string
|
|
43
|
+
viewModelPath: string
|
|
44
|
+
adopted: boolean
|
|
45
|
+
/** The screen this component is rendered into. */
|
|
46
|
+
screen: string
|
|
47
|
+
entities: string[]
|
|
48
|
+
specs: { ux: string, ui: string }
|
|
49
|
+
// `outcome` is deliberately ABSENT. Where a successful submit returns the actor is read per call
|
|
50
|
+
// from the live registry, because the registry gains this story's own screens as the run goes;
|
|
51
|
+
// a value decided at design time returns the user to a placeholder.
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface StoryDesignType {
|
|
55
|
+
path: string
|
|
56
|
+
entity: string
|
|
57
|
+
purpose: string
|
|
58
|
+
/** Which components need it — what makes the flat list re-groupable per entity. */
|
|
59
|
+
components: string[]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface StoryDesignResource {
|
|
63
|
+
path: string
|
|
64
|
+
entity: string
|
|
65
|
+
type: string
|
|
66
|
+
alias: string
|
|
67
|
+
purpose: string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface StoryDesignModel {
|
|
71
|
+
path: string
|
|
72
|
+
entities: string[]
|
|
73
|
+
/**
|
|
74
|
+
* WRITE-BACK slot, filled by the implementation stage.
|
|
75
|
+
*
|
|
76
|
+
* `designSolution`'s only honest input is the type and resource CODE, which does not exist until
|
|
77
|
+
* implementation has written it. Designing it earlier means designing it blind — against paths
|
|
78
|
+
* with no content behind them — and the fixer then spends its budget on an API the coder never
|
|
79
|
+
* saw declared. So it is designed late and recorded here, where a re-implementation reads it
|
|
80
|
+
* back instead of paying for it again.
|
|
81
|
+
*/
|
|
82
|
+
solution?: string
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface StoryDesignEndpoint {
|
|
86
|
+
alias: string
|
|
87
|
+
method: string
|
|
88
|
+
path: string
|
|
89
|
+
purpose: string
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface StoryDesignApi {
|
|
93
|
+
path: string
|
|
94
|
+
entity: string
|
|
95
|
+
type: string
|
|
96
|
+
model: string
|
|
97
|
+
endpoints: StoryDesignEndpoint[]
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface StoryDesignStore {
|
|
101
|
+
path: string
|
|
102
|
+
entity: string
|
|
103
|
+
type: string
|
|
104
|
+
api: string
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** What the design was written against, so a reader can tell whether it still applies. */
|
|
108
|
+
export interface StoryDesignProvenance {
|
|
109
|
+
designedAt: string
|
|
110
|
+
narrativeHash: string
|
|
111
|
+
/** Specification + vision + design system, hashed together. */
|
|
112
|
+
projectHash: string
|
|
113
|
+
registryHash: string
|
|
114
|
+
/**
|
|
115
|
+
* Every path the design named, with the content hash it had at the time.
|
|
116
|
+
*
|
|
117
|
+
* An ARRAY, not a map: generated paths carry dots and slashes, and a Mongo key cannot hold them.
|
|
118
|
+
* Advisory in any case — implementation ALWAYS re-reads a path and branches on what is there
|
|
119
|
+
* now, so a tree that moved is a flipped branch rather than a crash.
|
|
120
|
+
*/
|
|
121
|
+
paths: Array<{ path: string, hash: string }>
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Everything a story WILL be, decided before any of it is written.
|
|
126
|
+
*
|
|
127
|
+
* The design stage writes no file into the target; the implementation stage writes nothing that is
|
|
128
|
+
* not named here. That split is what makes a story re-implementable without re-designing it — and
|
|
129
|
+
* what makes a design reviewable, amendable and reusable at all.
|
|
130
|
+
*/
|
|
131
|
+
export interface StoryDesign {
|
|
132
|
+
version: number
|
|
133
|
+
code: string
|
|
134
|
+
narrative: string
|
|
135
|
+
area: ProjectArea
|
|
136
|
+
/**
|
|
137
|
+
* What the scaffold reserved when it drew the application.
|
|
138
|
+
*
|
|
139
|
+
* Read once, at the first design step, and copied in. Implementation never re-reads the story
|
|
140
|
+
* file: one reader, one moment, one answer — otherwise a re-develop can drift out of the menu
|
|
141
|
+
* group its own dashboard sits in.
|
|
142
|
+
*/
|
|
143
|
+
reserved: { section?: string, screen?: string }
|
|
144
|
+
entities: Array<{ name: string, description: string, dir: string }>
|
|
145
|
+
screens: StoryDesignScreen[]
|
|
146
|
+
components: StoryDesignComponent[]
|
|
147
|
+
types: StoryDesignType[]
|
|
148
|
+
resources: StoryDesignResource[]
|
|
149
|
+
models: StoryDesignModel[]
|
|
150
|
+
api: StoryDesignApi[]
|
|
151
|
+
stores: StoryDesignStore[]
|
|
152
|
+
transitions: UXTransition[]
|
|
153
|
+
/**
|
|
154
|
+
* WRITE-BACK slot, filled by the implementation stage.
|
|
155
|
+
*
|
|
156
|
+
* The design cannot even claim the KEYS: `describeApiAccess` reads the generated alias tree and
|
|
157
|
+
* the model answers with the alias strings as written there. What is designed early is the set
|
|
158
|
+
* of endpoints and screens; what they are guarded by is decided against the code that exists.
|
|
159
|
+
*/
|
|
160
|
+
access: { list: AccessList, resolvedAt: Record<string, string> }
|
|
161
|
+
/**
|
|
162
|
+
* What this story needs beyond a screen, an endpoint and a table.
|
|
163
|
+
*
|
|
164
|
+
* Optional, and read through {@link runtimeOf} everywhere: a design written before the gate
|
|
165
|
+
* existed carries none, and "none" is both the safe reading and the true one.
|
|
166
|
+
*/
|
|
167
|
+
runtime?: StoryDesignRuntime
|
|
168
|
+
provenance: StoryDesignProvenance
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** What a caller hands the store; the revision is the store's to allocate. */
|
|
172
|
+
export interface StoryDesignInput {
|
|
173
|
+
projectId: string
|
|
174
|
+
storyId?: string
|
|
175
|
+
code: string
|
|
176
|
+
kind: string
|
|
177
|
+
payload: unknown
|
|
178
|
+
runId?: string
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* How the implementation stage reaches the design, without knowing where it lives.
|
|
183
|
+
*
|
|
184
|
+
* A port rather than a resource for the usual reason: two questions is the whole of what an
|
|
185
|
+
* implementation step needs, and a port that small is satisfiable by a record store, a file, or a
|
|
186
|
+
* test double.
|
|
187
|
+
*/
|
|
188
|
+
export interface StoryDesignPort {
|
|
189
|
+
current: (projectId: string, code: string) => Promise<{ revision: number, design: StoryDesign } | null>
|
|
190
|
+
put: (input: StoryDesignInput) => Promise<number>
|
|
191
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
export enum AccessLevel {
|
|
3
|
+
Guest = 'guest',
|
|
4
|
+
User = 'user',
|
|
5
|
+
Permissioned = 'permissioned',
|
|
6
|
+
/**
|
|
7
|
+
* The project owner. Authenticated and holding the admin marker, which passes every gate —
|
|
8
|
+
* so this level names a marker, never a list of the project's own permissions.
|
|
9
|
+
*/
|
|
10
|
+
Admin = 'admin',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Alias prefixes of the entrypoints a generated project declares.
|
|
15
|
+
*
|
|
16
|
+
* Everything a target app addresses — a screen or an endpoint — is an entrypoint referenced by
|
|
17
|
+
* alias, and the prefix says which side owns it. The pipeline splits access rules by this prefix
|
|
18
|
+
* alone, so it is load-bearing, not decorative.
|
|
19
|
+
*
|
|
20
|
+
* The split is one-sided on purpose: an alias starting with {@link ALIAS_PREFIX_API} is an API
|
|
21
|
+
* entrypoint, and ANYTHING ELSE is a screen. The framework contributes screen aliases of its own
|
|
22
|
+
* (`base`, `home`, `dispatcher`) that carry no prefix at all, so testing for
|
|
23
|
+
* {@link ALIAS_PREFIX_WEB} would silently drop them.
|
|
24
|
+
*/
|
|
25
|
+
export const ALIAS_PREFIX_API = 'api:'
|
|
26
|
+
|
|
27
|
+
/** The prefix every GENERATED screen alias carries — see {@link ALIAS_PREFIX_API} for the split. */
|
|
28
|
+
export const ALIAS_PREFIX_WEB = 'web:'
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The prefix of a LAYOUT entrypoint — the parent a screen hangs under so the layout wraps it.
|
|
32
|
+
* A layout is addressed like a screen and rendered by the same router, so it has to be excluded
|
|
33
|
+
* explicitly wherever "the entrypoint of this screen" is being resolved.
|
|
34
|
+
*/
|
|
35
|
+
export const ALIAS_PREFIX_WEB_LAYOUT = 'web:layout:'
|
package/src/dev/index.ts
ADDED