@owlmeans/viable-common 0.0.44 → 0.0.45
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 +4 -4
- package/agent-meta/skills/viable-common/SKILL.md +40 -28
- package/build/agent/index.d.ts +1 -0
- package/build/agent/index.d.ts.map +1 -1
- package/build/agent/index.js.map +1 -1
- package/build/agent/presentation/types.d.ts +21 -0
- package/build/agent/presentation/types.d.ts.map +1 -0
- package/build/agent/presentation/types.js.map +1 -0
- package/build/agent/presentation.d.ts +10 -8
- package/build/agent/presentation.d.ts.map +1 -1
- package/build/agent/presentation.js +216 -195
- package/build/agent/presentation.js.map +1 -1
- package/build/agent/types.local.d.ts +3 -1
- package/build/agent/types.local.d.ts.map +1 -1
- package/build/areas/index.d.ts +1 -0
- package/build/areas/index.d.ts.map +1 -1
- package/build/areas/index.js.map +1 -1
- package/build/areas/tenancy/types.d.ts +23 -0
- package/build/areas/tenancy/types.d.ts.map +1 -0
- package/build/areas/tenancy/types.js +2 -0
- package/build/areas/tenancy/types.js.map +1 -0
- package/build/areas/tenancy.d.ts +5 -14
- package/build/areas/tenancy.d.ts.map +1 -1
- package/build/areas/tenancy.js +20 -26
- package/build/areas/tenancy.js.map +1 -1
- package/build/ba/connecting/types.d.ts +45 -0
- package/build/ba/connecting/types.d.ts.map +1 -0
- package/build/ba/connecting/types.js +2 -0
- package/build/ba/connecting/types.js.map +1 -0
- package/build/ba/connecting.d.ts +4 -0
- package/build/ba/connecting.d.ts.map +1 -0
- package/build/ba/connecting.js +47 -0
- package/build/ba/connecting.js.map +1 -0
- package/build/ba/helpers.d.ts +4 -39
- package/build/ba/helpers.d.ts.map +1 -1
- package/build/ba/helpers.js +5 -79
- package/build/ba/helpers.js.map +1 -1
- package/build/ba/index.d.ts +2 -0
- package/build/ba/index.d.ts.map +1 -1
- package/build/ba/index.js +1 -0
- package/build/ba/index.js.map +1 -1
- package/build/blueprint/types.d.ts +1 -2
- package/build/blueprint/types.d.ts.map +1 -1
- package/build/connect/branding/types.d.ts +28 -0
- package/build/connect/branding/types.d.ts.map +1 -0
- package/build/connect/branding/types.js +2 -0
- package/build/connect/branding/types.js.map +1 -0
- package/build/connect/consts.d.ts +2 -0
- package/build/connect/consts.d.ts.map +1 -1
- package/build/connect/consts.js +2 -0
- package/build/connect/consts.js.map +1 -1
- package/build/connect/conversion/types.d.ts +93 -0
- package/build/connect/conversion/types.d.ts.map +1 -0
- package/build/connect/conversion/types.js +2 -0
- package/build/connect/conversion/types.js.map +1 -0
- package/build/connect/entrypoints/types.d.ts +30 -0
- package/build/connect/entrypoints/types.d.ts.map +1 -0
- package/build/connect/entrypoints/types.js +2 -0
- package/build/connect/entrypoints/types.js.map +1 -0
- package/build/connect/entrypoints.d.ts +17 -11
- package/build/connect/entrypoints.d.ts.map +1 -1
- package/build/connect/entrypoints.js.map +1 -1
- package/build/connect/errors/types.d.ts +20 -0
- package/build/connect/errors/types.d.ts.map +1 -0
- package/build/connect/errors/types.js +2 -0
- package/build/connect/errors/types.js.map +1 -0
- package/build/connect/errors.d.ts +1 -1
- package/build/connect/errors.d.ts.map +1 -1
- package/build/connect/index.d.ts +13 -3
- package/build/connect/index.d.ts.map +1 -1
- package/build/connect/index.js +1 -1
- package/build/connect/index.js.map +1 -1
- package/build/connect/kit/types.d.ts +52 -0
- package/build/connect/kit/types.d.ts.map +1 -0
- package/build/connect/kit/types.js +2 -0
- package/build/connect/{types.js.map → kit/types.js.map} +1 -1
- package/build/connect/model-tier/types.d.ts +16 -0
- package/build/connect/model-tier/types.d.ts.map +1 -0
- package/build/connect/model-tier/types.js +2 -0
- package/build/connect/model-tier/types.js.map +1 -0
- package/build/connect/model-tier.d.ts +4 -0
- package/build/connect/model-tier.d.ts.map +1 -0
- package/build/connect/model-tier.js +21 -0
- package/build/connect/model-tier.js.map +1 -0
- package/build/connect/{ops.d.ts → ops/types.d.ts} +13 -4
- package/build/connect/ops/types.d.ts.map +1 -0
- package/build/connect/ops/types.js +2 -0
- package/build/connect/ops/types.js.map +1 -0
- package/build/connect/pipeline/types.d.ts +39 -0
- package/build/connect/pipeline/types.d.ts.map +1 -0
- package/build/connect/pipeline/types.js +2 -0
- package/build/connect/pipeline/types.js.map +1 -0
- package/build/connect/project/types.d.ts +127 -0
- package/build/connect/project/types.d.ts.map +1 -0
- package/build/connect/project/types.js +2 -0
- package/build/connect/project/types.js.map +1 -0
- package/build/connect/references/types.d.ts +157 -0
- package/build/connect/references/types.d.ts.map +1 -0
- package/build/connect/references/types.js +2 -0
- package/build/connect/references/types.js.map +1 -0
- package/build/connect/references/types.local.d.ts +5 -0
- package/build/connect/references/types.local.d.ts.map +1 -0
- package/build/connect/references/types.local.js.map +1 -0
- package/build/connect/references.d.ts +1 -1
- package/build/connect/references.d.ts.map +1 -1
- package/build/connect/references.js.map +1 -1
- package/build/connect/schemas.d.ts +8 -5
- package/build/connect/schemas.d.ts.map +1 -1
- package/build/connect/schemas.js +1 -3
- package/build/connect/schemas.js.map +1 -1
- package/build/connect/session/types.d.ts +73 -0
- package/build/connect/session/types.d.ts.map +1 -0
- package/build/connect/session/types.js +2 -0
- package/build/connect/session/types.js.map +1 -0
- package/build/connect/settings/types.d.ts +48 -0
- package/build/connect/settings/types.d.ts.map +1 -0
- package/build/connect/settings/types.js +2 -0
- package/build/connect/settings/types.js.map +1 -0
- package/build/convert/analysis/types.d.ts +93 -0
- package/build/convert/analysis/types.d.ts.map +1 -0
- package/build/convert/analysis/types.js +2 -0
- package/build/convert/analysis/types.js.map +1 -0
- package/build/convert/{consts.local.d.ts → census/consts.local.d.ts} +1 -1
- package/build/convert/census/consts.local.d.ts.map +1 -0
- package/build/convert/{consts.local.js → census/consts.local.js} +1 -1
- package/build/convert/census/consts.local.js.map +1 -0
- package/build/convert/census/types.d.ts +176 -0
- package/build/convert/census/types.d.ts.map +1 -0
- package/build/convert/census/types.js +2 -0
- package/build/convert/census/types.js.map +1 -0
- package/build/convert/census.d.ts +4 -0
- package/build/convert/census.d.ts.map +1 -0
- package/build/convert/census.js +83 -0
- package/build/convert/census.js.map +1 -0
- package/build/convert/consts.d.ts +4 -0
- package/build/convert/consts.d.ts.map +1 -1
- package/build/convert/consts.js +4 -0
- package/build/convert/consts.js.map +1 -1
- package/build/convert/detection/types.d.ts +67 -0
- package/build/convert/detection/types.d.ts.map +1 -0
- package/build/convert/detection/types.js +2 -0
- package/build/convert/detection/types.js.map +1 -0
- package/build/convert/docs/types.d.ts +129 -0
- package/build/convert/docs/types.d.ts.map +1 -0
- package/build/convert/docs/types.js +2 -0
- package/build/convert/docs/types.js.map +1 -0
- package/build/convert/docs.d.ts +4 -0
- package/build/convert/docs.d.ts.map +1 -0
- package/build/convert/docs.js +9 -0
- package/build/convert/docs.js.map +1 -0
- package/build/convert/estimate/types.d.ts +77 -0
- package/build/convert/estimate/types.d.ts.map +1 -0
- package/build/convert/estimate/types.js +2 -0
- package/build/convert/estimate/types.js.map +1 -0
- package/build/convert/estimate.d.ts +11 -0
- package/build/convert/estimate.d.ts.map +1 -0
- package/build/convert/estimate.js +18 -0
- package/build/convert/estimate.js.map +1 -0
- package/build/convert/helpers.d.ts +14 -78
- package/build/convert/helpers.d.ts.map +1 -1
- package/build/convert/helpers.js +27 -199
- package/build/convert/helpers.js.map +1 -1
- package/build/convert/index.d.ts +14 -0
- package/build/convert/index.d.ts.map +1 -1
- package/build/convert/index.js +5 -0
- package/build/convert/index.js.map +1 -1
- package/build/convert/origin/types.d.ts +41 -0
- package/build/convert/origin/types.d.ts.map +1 -0
- package/build/convert/origin/types.js +2 -0
- package/build/convert/origin/types.js.map +1 -0
- package/build/convert/origin.d.ts +4 -0
- package/build/convert/origin.d.ts.map +1 -0
- package/build/convert/origin.js +25 -0
- package/build/convert/origin.js.map +1 -0
- package/build/convert/record/types.d.ts +98 -0
- package/build/convert/record/types.d.ts.map +1 -0
- package/build/convert/record/types.js +2 -0
- package/build/convert/record/types.js.map +1 -0
- package/build/convert/schemas.d.ts +7 -6
- package/build/convert/schemas.d.ts.map +1 -1
- package/build/convert/schemas.js +1 -5
- package/build/convert/schemas.js.map +1 -1
- package/build/convert/stage/types.d.ts +27 -0
- package/build/convert/stage/types.d.ts.map +1 -0
- package/build/convert/stage/types.js +2 -0
- package/build/convert/stage/types.js.map +1 -0
- package/build/convert/stage.d.ts +4 -0
- package/build/convert/stage.d.ts.map +1 -0
- package/build/convert/stage.js +25 -0
- package/build/convert/stage.js.map +1 -0
- package/build/convert/taxonomy/types.d.ts +71 -0
- package/build/convert/taxonomy/types.d.ts.map +1 -0
- package/build/convert/taxonomy/types.js +2 -0
- package/build/convert/taxonomy/types.js.map +1 -0
- package/build/convert/types.d.ts +1 -657
- package/build/convert/types.d.ts.map +1 -1
- package/build/convert/utils.d.ts +2 -1
- package/build/convert/utils.d.ts.map +1 -1
- package/build/convert/utils.js +5 -4
- package/build/convert/utils.js.map +1 -1
- package/build/design/helpers.d.ts +9 -49
- package/build/design/helpers.d.ts.map +1 -1
- package/build/design/helpers.js +17 -224
- package/build/design/helpers.js.map +1 -1
- package/build/design/index.d.ts +3 -0
- package/build/design/index.d.ts.map +1 -1
- package/build/design/index.js +1 -0
- package/build/design/index.js.map +1 -1
- package/build/design/runtime/types.d.ts +16 -0
- package/build/design/runtime/types.d.ts.map +1 -0
- package/build/design/runtime/types.js +2 -0
- package/build/design/runtime/types.js.map +1 -0
- package/build/design/runtime.d.ts +6 -2
- package/build/design/runtime.d.ts.map +1 -1
- package/build/design/runtime.js +13 -5
- package/build/design/runtime.js.map +1 -1
- package/build/design/story/types.d.ts +67 -0
- package/build/design/story/types.d.ts.map +1 -0
- package/build/design/story/types.js +2 -0
- package/build/design/story/types.js.map +1 -0
- package/build/design/story.d.ts +4 -0
- package/build/design/story.d.ts.map +1 -0
- package/build/design/story.js +184 -0
- package/build/design/story.js.map +1 -0
- package/build/dev/types.local.d.ts +2 -1
- package/build/dev/types.local.d.ts.map +1 -1
- package/build/integrity/index.d.ts +4 -0
- package/build/integrity/index.d.ts.map +1 -1
- package/build/integrity/index.js +2 -0
- package/build/integrity/index.js.map +1 -1
- package/build/integrity/layout/consts.d.ts +59 -0
- package/build/integrity/layout/consts.d.ts.map +1 -0
- package/build/integrity/layout/consts.js +66 -0
- package/build/integrity/layout/consts.js.map +1 -0
- package/build/integrity/layout/consts.local.d.ts +18 -0
- package/build/integrity/layout/consts.local.d.ts.map +1 -0
- package/build/integrity/layout/consts.local.js +176 -0
- package/build/integrity/layout/consts.local.js.map +1 -0
- package/build/integrity/layout/types.d.ts +35 -0
- package/build/integrity/layout/types.d.ts.map +1 -0
- package/build/integrity/layout/types.js +2 -0
- package/build/integrity/layout/types.js.map +1 -0
- package/build/integrity/layout.d.ts +4 -0
- package/build/integrity/layout.d.ts.map +1 -0
- package/build/integrity/layout.js +25 -0
- package/build/integrity/layout.js.map +1 -0
- package/build/integrity/types.d.ts +3 -1
- package/build/integrity/types.d.ts.map +1 -1
- package/build/integrity/utils.d.ts +6 -81
- package/build/integrity/utils.d.ts.map +1 -1
- package/build/integrity/utils.js +11 -279
- package/build/integrity/utils.js.map +1 -1
- package/build/integrity/verify/types.d.ts +26 -0
- package/build/integrity/verify/types.d.ts.map +1 -0
- package/build/integrity/verify/types.js +2 -0
- package/build/integrity/verify/types.js.map +1 -0
- package/build/integrity/verify.d.ts +5 -19
- package/build/integrity/verify.d.ts.map +1 -1
- package/build/integrity/verify.js +164 -175
- package/build/integrity/verify.js.map +1 -1
- package/build/intent/consts.d.ts +16 -0
- package/build/intent/consts.d.ts.map +1 -1
- package/build/intent/consts.js +63 -0
- package/build/intent/consts.js.map +1 -1
- package/build/intent/entrypoints.d.ts +2 -11
- package/build/intent/entrypoints.d.ts.map +1 -1
- package/build/intent/entrypoints.js.map +1 -1
- package/build/intent/index.d.ts +0 -1
- package/build/intent/index.d.ts.map +1 -1
- package/build/intent/index.js +0 -1
- package/build/intent/index.js.map +1 -1
- package/build/intent/types.d.ts +13 -2
- package/build/intent/types.d.ts.map +1 -1
- package/build/moderation/index.d.ts +2 -0
- package/build/moderation/index.d.ts.map +1 -1
- package/build/moderation/index.js +1 -0
- package/build/moderation/index.js.map +1 -1
- package/build/moderation/utils.d.ts +3 -15
- package/build/moderation/utils.d.ts.map +1 -1
- package/build/moderation/utils.js +5 -30
- package/build/moderation/utils.js.map +1 -1
- package/build/moderation/verdict/types.d.ts +24 -0
- package/build/moderation/verdict/types.d.ts.map +1 -0
- package/build/moderation/verdict/types.js +2 -0
- package/build/moderation/verdict/types.js.map +1 -0
- package/build/moderation/verdict.d.ts +4 -0
- package/build/moderation/verdict.d.ts.map +1 -0
- package/build/moderation/verdict.js +21 -0
- package/build/moderation/verdict.js.map +1 -0
- package/build/planning/card/types.d.ts +42 -0
- package/build/planning/card/types.d.ts.map +1 -0
- package/build/planning/card/types.js +2 -0
- package/build/planning/card/types.js.map +1 -0
- package/build/planning/card.d.ts +4 -0
- package/build/planning/card.d.ts.map +1 -0
- package/build/planning/card.js +51 -0
- package/build/planning/card.js.map +1 -0
- package/build/planning/helpers.d.ts +11 -37
- package/build/planning/helpers.d.ts.map +1 -1
- package/build/planning/helpers.js +24 -103
- package/build/planning/helpers.js.map +1 -1
- package/build/planning/index.d.ts +5 -0
- package/build/planning/index.d.ts.map +1 -1
- package/build/planning/index.js +2 -0
- package/build/planning/index.js.map +1 -1
- package/build/planning/landing/types.d.ts +16 -0
- package/build/planning/landing/types.d.ts.map +1 -0
- package/build/planning/landing/types.js +2 -0
- package/build/planning/landing/types.js.map +1 -0
- package/build/planning/landing.d.ts +5 -10
- package/build/planning/landing.d.ts.map +1 -1
- package/build/planning/landing.js +20 -22
- package/build/planning/landing.js.map +1 -1
- package/build/planning/schemas.d.ts +1 -5
- package/build/planning/schemas.d.ts.map +1 -1
- package/build/planning/schemas.js +3 -3
- package/build/planning/schemas.js.map +1 -1
- package/build/planning/spec/types.d.ts +22 -0
- package/build/planning/spec/types.d.ts.map +1 -0
- package/build/planning/spec/types.js +2 -0
- package/build/planning/spec/types.js.map +1 -0
- package/build/planning/spec.d.ts +4 -0
- package/build/planning/spec.d.ts.map +1 -0
- package/build/planning/spec.js +30 -0
- package/build/planning/spec.js.map +1 -0
- package/build/planning/types.d.ts +4 -3
- package/build/planning/types.d.ts.map +1 -1
- package/build/scaffold/consts.d.ts +40 -1
- package/build/scaffold/consts.d.ts.map +1 -1
- package/build/scaffold/consts.js +52 -0
- package/build/scaffold/consts.js.map +1 -1
- package/build/scaffold/helpers.d.ts +4 -16
- package/build/scaffold/helpers.d.ts.map +1 -1
- package/build/scaffold/helpers.js +9 -64
- package/build/scaffold/helpers.js.map +1 -1
- package/build/scaffold/index.d.ts +4 -0
- package/build/scaffold/index.d.ts.map +1 -1
- package/build/scaffold/index.js +2 -0
- package/build/scaffold/index.js.map +1 -1
- package/build/scaffold/landing/types.d.ts +48 -0
- package/build/scaffold/landing/types.d.ts.map +1 -0
- package/build/scaffold/landing/types.js +2 -0
- package/build/scaffold/landing/types.js.map +1 -0
- package/build/scaffold/landing.d.ts +4 -0
- package/build/scaffold/landing.d.ts.map +1 -0
- package/build/scaffold/landing.js +95 -0
- package/build/scaffold/landing.js.map +1 -0
- package/build/scaffold/schemas.d.ts +3 -2
- package/build/scaffold/schemas.d.ts.map +1 -1
- package/build/scaffold/schemas.js +177 -7
- package/build/scaffold/schemas.js.map +1 -1
- package/build/scaffold/share/types.d.ts +35 -0
- package/build/scaffold/share/types.d.ts.map +1 -0
- package/build/scaffold/share/types.js +2 -0
- package/build/scaffold/share/types.js.map +1 -0
- package/build/scaffold/share.d.ts +4 -0
- package/build/scaffold/share.d.ts.map +1 -0
- package/build/scaffold/share.js +42 -0
- package/build/scaffold/share.js.map +1 -0
- package/build/scaffold/types.d.ts +112 -2
- package/build/scaffold/types.d.ts.map +1 -1
- package/build/skills/consts.d.ts +42 -0
- package/build/skills/consts.d.ts.map +1 -1
- package/build/skills/consts.js +43 -0
- package/build/skills/consts.js.map +1 -1
- package/build/skills/index.d.ts +0 -1
- package/build/skills/index.d.ts.map +1 -1
- package/build/skills/index.js +0 -1
- package/build/skills/index.js.map +1 -1
- package/build/slot/command/types.d.ts +21 -0
- package/build/slot/command/types.d.ts.map +1 -0
- package/build/slot/command/types.js +2 -0
- package/build/slot/command/types.js.map +1 -0
- package/build/slot/command.d.ts +4 -0
- package/build/slot/command.d.ts.map +1 -0
- package/build/slot/command.js +31 -0
- package/build/slot/command.js.map +1 -0
- package/build/slot/helpers.d.ts +2 -16
- package/build/slot/helpers.d.ts.map +1 -1
- package/build/slot/helpers.js +5 -26
- package/build/slot/helpers.js.map +1 -1
- package/build/slot/index.d.ts +5 -0
- package/build/slot/index.d.ts.map +1 -1
- package/build/slot/index.js +2 -0
- package/build/slot/index.js.map +1 -1
- package/build/slot/layout/types.d.ts +17 -0
- package/build/slot/layout/types.d.ts.map +1 -0
- package/build/slot/layout/types.js +2 -0
- package/build/slot/layout/types.js.map +1 -0
- package/build/slot/layout.d.ts +4 -9
- package/build/slot/layout.d.ts.map +1 -1
- package/build/slot/layout.js +13 -15
- package/build/slot/layout.js.map +1 -1
- package/build/slot/origin/types.d.ts +23 -0
- package/build/slot/origin/types.d.ts.map +1 -0
- package/build/slot/origin/types.js +2 -0
- package/build/slot/origin/types.js.map +1 -0
- package/build/slot/origin.d.ts +4 -0
- package/build/slot/origin.d.ts.map +1 -0
- package/build/slot/origin.js +15 -0
- package/build/slot/origin.js.map +1 -0
- package/build/slot/types.d.ts.map +1 -1
- package/build/slot/utils.d.ts +3 -15
- package/build/slot/utils.d.ts.map +1 -1
- package/build/slot/utils.js +5 -40
- package/build/slot/utils.js.map +1 -1
- package/build/topology/card/types.d.ts +21 -0
- package/build/topology/card/types.d.ts.map +1 -0
- package/build/topology/card/types.js +2 -0
- package/build/topology/card/types.js.map +1 -0
- package/build/topology/card.d.ts +6 -13
- package/build/topology/card.d.ts.map +1 -1
- package/build/topology/card.js +83 -86
- package/build/topology/card.js.map +1 -1
- package/build/topology/helpers.d.ts +7 -33
- package/build/topology/helpers.d.ts.map +1 -1
- package/build/topology/helpers.js +15 -111
- package/build/topology/helpers.js.map +1 -1
- package/build/topology/index.d.ts +3 -0
- package/build/topology/index.d.ts.map +1 -1
- package/build/topology/index.js +1 -0
- package/build/topology/index.js.map +1 -1
- package/build/topology/resolve/types.d.ts +47 -0
- package/build/topology/resolve/types.d.ts.map +1 -0
- package/build/topology/resolve/types.js +2 -0
- package/build/topology/resolve/types.js.map +1 -0
- package/build/topology/resolve.d.ts +4 -0
- package/build/topology/resolve.d.ts.map +1 -0
- package/build/topology/resolve.js +89 -0
- package/build/topology/resolve.js.map +1 -0
- package/package.json +11 -11
- package/src/agent/index.ts +1 -0
- package/src/agent/presentation/types.ts +21 -0
- package/src/agent/presentation.ts +199 -165
- package/src/agent/types.local.ts +3 -1
- package/src/areas/index.ts +1 -0
- package/src/areas/tenancy/types.ts +23 -0
- package/src/areas/tenancy.ts +26 -25
- package/src/ba/connecting/types.ts +45 -0
- package/src/ba/connecting.ts +64 -0
- package/src/ba/helpers.ts +8 -92
- package/src/ba/index.ts +2 -0
- package/src/blueprint/types.ts +2 -2
- package/src/connect/branding/types.ts +29 -0
- package/src/connect/consts.ts +3 -0
- package/src/connect/conversion/types.ts +96 -0
- package/src/connect/entrypoints/types.ts +25 -0
- package/src/connect/entrypoints.ts +13 -2
- package/src/connect/errors/types.ts +22 -0
- package/src/connect/errors.ts +1 -1
- package/src/connect/index.ts +13 -3
- package/src/connect/kit/types.ts +56 -0
- package/src/connect/model-tier/types.ts +16 -0
- package/src/connect/model-tier.ts +22 -0
- package/src/connect/{ops.ts → ops/types.ts} +13 -3
- package/src/connect/pipeline/types.ts +41 -0
- package/src/connect/project/types.ts +127 -0
- package/src/connect/references/types.local.ts +5 -0
- package/src/connect/references/types.ts +73 -0
- package/src/connect/references.ts +13 -2
- package/src/connect/schemas.ts +9 -13
- package/src/connect/session/types.ts +81 -0
- package/src/connect/settings/types.ts +52 -0
- package/src/convert/analysis/types.ts +89 -0
- package/src/convert/{consts.local.ts → census/consts.local.ts} +1 -1
- package/src/convert/census/types.ts +181 -0
- package/src/convert/census.ts +95 -0
- package/src/convert/consts.ts +5 -0
- package/src/convert/detection/types.ts +74 -0
- package/src/convert/docs/types.ts +151 -0
- package/src/convert/docs.ts +15 -0
- package/src/convert/estimate/types.ts +75 -0
- package/src/convert/estimate.ts +19 -0
- package/src/convert/helpers.ts +29 -210
- package/src/convert/index.ts +14 -0
- package/src/convert/origin/types.ts +43 -0
- package/src/convert/origin.ts +33 -0
- package/src/convert/record/types.ts +105 -0
- package/src/convert/schemas.ts +13 -12
- package/src/convert/stage/types.ts +27 -0
- package/src/convert/stage.ts +31 -0
- package/src/convert/taxonomy/types.ts +74 -0
- package/src/convert/types.ts +5 -709
- package/src/convert/utils.ts +5 -6
- package/src/design/helpers.ts +20 -245
- package/src/design/index.ts +3 -0
- package/src/design/runtime/types.ts +14 -0
- package/src/design/runtime.ts +22 -7
- package/src/design/story/types.ts +67 -0
- package/src/design/story.ts +221 -0
- package/src/dev/types.local.ts +1 -1
- package/src/integrity/index.ts +4 -0
- package/src/integrity/layout/consts.local.ts +188 -0
- package/src/integrity/layout/consts.ts +79 -0
- package/src/integrity/layout/types.ts +35 -0
- package/src/integrity/layout.ts +39 -0
- package/src/integrity/types.ts +3 -1
- package/src/integrity/utils.ts +14 -313
- package/src/integrity/verify/types.ts +26 -0
- package/src/integrity/verify.ts +177 -181
- package/src/intent/consts.ts +67 -0
- package/src/intent/entrypoints.ts +2 -2
- package/src/intent/index.ts +0 -1
- package/src/intent/types.ts +9 -2
- package/src/moderation/index.ts +2 -0
- package/src/moderation/utils.ts +7 -30
- package/src/moderation/verdict/types.ts +22 -0
- package/src/moderation/verdict.ts +28 -0
- package/src/planning/card/types.ts +44 -0
- package/src/planning/card.ts +77 -0
- package/src/planning/helpers.ts +28 -116
- package/src/planning/index.ts +5 -0
- package/src/planning/landing/types.ts +15 -0
- package/src/planning/landing.ts +27 -24
- package/src/planning/schemas.ts +3 -3
- package/src/planning/spec/types.ts +22 -0
- package/src/planning/spec.ts +41 -0
- package/src/planning/types.ts +4 -4
- package/src/scaffold/consts.ts +65 -1
- package/src/scaffold/helpers.ts +14 -77
- package/src/scaffold/index.ts +4 -0
- package/src/scaffold/landing/types.ts +48 -0
- package/src/scaffold/landing.ts +120 -0
- package/src/scaffold/schemas.ts +183 -7
- package/src/scaffold/share/types.ts +35 -0
- package/src/scaffold/share.ts +60 -0
- package/src/scaffold/types.ts +120 -1
- package/src/skills/consts.ts +46 -0
- package/src/skills/index.ts +0 -1
- package/src/slot/command/types.ts +21 -0
- package/src/slot/command.ts +38 -0
- package/src/slot/helpers.ts +5 -25
- package/src/slot/index.ts +5 -0
- package/src/slot/layout/types.ts +17 -0
- package/src/slot/layout.ts +19 -16
- package/src/slot/origin/types.ts +23 -0
- package/src/slot/origin.ts +20 -0
- package/src/slot/types.ts +1 -0
- package/src/slot/utils.ts +8 -43
- package/src/topology/card/types.ts +21 -0
- package/src/topology/card.ts +84 -82
- package/src/topology/helpers.ts +20 -125
- package/src/topology/index.ts +3 -0
- package/src/topology/resolve/types.ts +47 -0
- package/src/topology/resolve.ts +118 -0
- package/tests/blueprint.spec.ts +1 -2
- package/tests/connect-errors.spec.ts +1 -1
- package/tests/convert.spec.ts +50 -50
- package/tests/design.spec.ts +13 -16
- package/tests/planning.spec.ts +57 -59
- package/tests/presentation.spec.ts +20 -20
- package/tests/scaffold.spec.ts +286 -6
- package/tests/tenancy.spec.ts +21 -21
- package/build/connect/ops.d.ts.map +0 -1
- package/build/connect/ops.js +0 -2
- package/build/connect/ops.js.map +0 -1
- package/build/connect/types.d.ts +0 -650
- package/build/connect/types.d.ts.map +0 -1
- package/build/connect/types.local.d.ts +0 -4
- package/build/connect/types.local.d.ts.map +0 -1
- package/build/connect/types.local.js.map +0 -1
- package/build/connect/utils.d.ts +0 -12
- package/build/connect/utils.d.ts.map +0 -1
- package/build/connect/utils.js +0 -25
- package/build/connect/utils.js.map +0 -1
- package/build/convert/consts.local.d.ts.map +0 -1
- package/build/convert/consts.local.js.map +0 -1
- package/build/intent/consts.local.d.ts +0 -4
- package/build/intent/consts.local.d.ts.map +0 -1
- package/build/intent/consts.local.js +0 -3
- package/build/intent/consts.local.js.map +0 -1
- package/build/intent/flow.d.ts +0 -17
- package/build/intent/flow.d.ts.map +0 -1
- package/build/intent/flow.js +0 -65
- package/build/intent/flow.js.map +0 -1
- package/build/skills/roles.d.ts +0 -43
- package/build/skills/roles.d.ts.map +0 -1
- package/build/skills/roles.js +0 -44
- package/build/skills/roles.js.map +0 -1
- package/src/connect/types.local.ts +0 -5
- package/src/connect/types.ts +0 -589
- package/src/connect/utils.ts +0 -23
- package/src/intent/consts.local.ts +0 -3
- package/src/intent/flow.ts +0 -66
- package/src/skills/roles.ts +0 -46
- /package/build/{connect → agent/presentation}/types.js +0 -0
- /package/build/connect/{types.local.js → references/types.local.js} +0 -0
package/tests/convert.spec.ts
CHANGED
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
CONVERSION_ARTIFACTS, CONVERSION_DIR, CONVERSION_DOCS, CONVERSION_MEMORY, ConversionStage,
|
|
8
8
|
EntropyClass, FileClass, SizeClass, STACK_FAMILY, StackId, TAXONOMY_ORDER, TaxonomyKind
|
|
9
9
|
} from '../src/convert/index.js'
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from '../src/convert/
|
|
10
|
+
import { censusHelper } from '../src/convert/census.js'
|
|
11
|
+
import { conversionStageHelper } from '../src/convert/stage.js'
|
|
12
|
+
import { storyComplexity } from '../src/convert/estimate.js'
|
|
13
|
+
import { conversionOriginHelper } from '../src/convert/origin.js'
|
|
14
14
|
import { HISTORY_FILE } from '../src/metadata/consts.js'
|
|
15
15
|
import { CONVERTED_ORIGIN_DIR, ConversionDecision } from '../src/convert/consts.js'
|
|
16
|
-
import {
|
|
16
|
+
import { conversionDocHelper } from '../src/convert/docs.js'
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Every `*Schema` a module exports.
|
|
@@ -176,26 +176,26 @@ describe('viable-common - the conversion contracts', () => {
|
|
|
176
176
|
})
|
|
177
177
|
|
|
178
178
|
test('canEnter allows a retry and the next stage, and refuses a skip', () => {
|
|
179
|
-
expect(canEnter(ConversionStage.Intake, ConversionStage.Intake)).toBe(true)
|
|
180
|
-
expect(canEnter(ConversionStage.Intake, ConversionStage.Analysis)).toBe(true)
|
|
179
|
+
expect(conversionStageHelper.canEnter(ConversionStage.Intake, ConversionStage.Intake)).toBe(true)
|
|
180
|
+
expect(conversionStageHelper.canEnter(ConversionStage.Intake, ConversionStage.Analysis)).toBe(true)
|
|
181
181
|
// Extraction reads the documents analysis wrote; entering it from intake runs it against
|
|
182
182
|
// documents that were never produced.
|
|
183
|
-
expect(canEnter(ConversionStage.Intake, ConversionStage.Extraction)).toBe(false)
|
|
184
|
-
expect(canEnter(ConversionStage.Extraction, ConversionStage.Analysis)).toBe(false)
|
|
183
|
+
expect(conversionStageHelper.canEnter(ConversionStage.Intake, ConversionStage.Extraction)).toBe(false)
|
|
184
|
+
expect(conversionStageHelper.canEnter(ConversionStage.Extraction, ConversionStage.Analysis)).toBe(false)
|
|
185
185
|
})
|
|
186
186
|
|
|
187
187
|
test('the stage ladder ends at implementation rather than falling off it', () => {
|
|
188
|
-
expect(stageAfter(ConversionStage.Intake)).toBe(ConversionStage.Analysis)
|
|
189
|
-
expect(stageAfter(ConversionStage.Implementation)).toBe(ConversionStage.Implementation)
|
|
190
|
-
expect(decisionFor(ConversionStage.Extraction)).toBe(ConversionDecision.Implement)
|
|
191
|
-
expect(decisionFor(ConversionStage.Implementation)).toBe(ConversionDecision.Leave)
|
|
188
|
+
expect(conversionStageHelper.stageAfter(ConversionStage.Intake)).toBe(ConversionStage.Analysis)
|
|
189
|
+
expect(conversionStageHelper.stageAfter(ConversionStage.Implementation)).toBe(ConversionStage.Implementation)
|
|
190
|
+
expect(conversionStageHelper.decisionFor(ConversionStage.Extraction)).toBe(ConversionDecision.Implement)
|
|
191
|
+
expect(conversionStageHelper.decisionFor(ConversionStage.Implementation)).toBe(ConversionDecision.Leave)
|
|
192
192
|
})
|
|
193
193
|
|
|
194
194
|
test('every conversion document lives under the conversion directory', () => {
|
|
195
195
|
for (const doc of CONVERSION_DOCS) {
|
|
196
196
|
expect(doc.startsWith(`${CONVERSION_DIR}/`), doc).toBe(true)
|
|
197
197
|
}
|
|
198
|
-
expect(conversionStoryDoc('US-ABC12').startsWith(`${CONVERSION_DIR}/`)).toBe(true)
|
|
198
|
+
expect(conversionDocHelper.conversionStoryDoc('US-ABC12').startsWith(`${CONVERSION_DIR}/`)).toBe(true)
|
|
199
199
|
for (const node of CONVERSION_MEMORY) {
|
|
200
200
|
expect(node.startsWith('.agents/memory/'), node).toBe(true)
|
|
201
201
|
}
|
|
@@ -209,54 +209,54 @@ describe('viable-common - the conversion contracts', () => {
|
|
|
209
209
|
})
|
|
210
210
|
|
|
211
211
|
test('origin paths round-trip and never nest', () => {
|
|
212
|
-
expect(originPath('src/index.ts')).toBe(`${CONVERTED_ORIGIN_DIR}/src/index.ts`)
|
|
213
|
-
expect(isOriginPath(originPath('src/index.ts'))).toBe(true)
|
|
214
|
-
expect(isOriginPath(CONVERTED_ORIGIN_DIR)).toBe(true)
|
|
215
|
-
expect(isOriginPath('sources/web/src/index.ts')).toBe(false)
|
|
212
|
+
expect(conversionOriginHelper.originPath('src/index.ts')).toBe(`${CONVERTED_ORIGIN_DIR}/src/index.ts`)
|
|
213
|
+
expect(conversionOriginHelper.isOriginPath(conversionOriginHelper.originPath('src/index.ts'))).toBe(true)
|
|
214
|
+
expect(conversionOriginHelper.isOriginPath(CONVERTED_ORIGIN_DIR)).toBe(true)
|
|
215
|
+
expect(conversionOriginHelper.isOriginPath('sources/web/src/index.ts')).toBe(false)
|
|
216
216
|
// A caller that has lost track of which side of the move it holds must not be able to produce
|
|
217
217
|
// `__viable_converted/__viable_converted/`.
|
|
218
|
-
expect(originPath(originPath('src/index.ts'))).toBe(`${CONVERTED_ORIGIN_DIR}/src/index.ts`)
|
|
218
|
+
expect(conversionOriginHelper.originPath(conversionOriginHelper.originPath('src/index.ts'))).toBe(`${CONVERTED_ORIGIN_DIR}/src/index.ts`)
|
|
219
219
|
})
|
|
220
220
|
|
|
221
221
|
test('sizeClassOf splits on the declared bounds', () => {
|
|
222
|
-
expect(sizeClassOf(0)).toBe(SizeClass.Tiny)
|
|
223
|
-
expect(sizeClassOf(2_047)).toBe(SizeClass.Tiny)
|
|
224
|
-
expect(sizeClassOf(2_048)).toBe(SizeClass.Small)
|
|
225
|
-
expect(sizeClassOf(32_767)).toBe(SizeClass.Small)
|
|
226
|
-
expect(sizeClassOf(32_768)).toBe(SizeClass.Medium)
|
|
227
|
-
expect(sizeClassOf(262_144)).toBe(SizeClass.Large)
|
|
228
|
-
expect(sizeClassOf(2_097_152)).toBe(SizeClass.Huge)
|
|
222
|
+
expect(censusHelper.sizeClassOf(0)).toBe(SizeClass.Tiny)
|
|
223
|
+
expect(censusHelper.sizeClassOf(2_047)).toBe(SizeClass.Tiny)
|
|
224
|
+
expect(censusHelper.sizeClassOf(2_048)).toBe(SizeClass.Small)
|
|
225
|
+
expect(censusHelper.sizeClassOf(32_767)).toBe(SizeClass.Small)
|
|
226
|
+
expect(censusHelper.sizeClassOf(32_768)).toBe(SizeClass.Medium)
|
|
227
|
+
expect(censusHelper.sizeClassOf(262_144)).toBe(SizeClass.Large)
|
|
228
|
+
expect(censusHelper.sizeClassOf(2_097_152)).toBe(SizeClass.Huge)
|
|
229
229
|
})
|
|
230
230
|
|
|
231
231
|
test('entropyClassOf tells prose from a minified bundle from binary', () => {
|
|
232
|
-
expect(entropyClassOf('export const answer = 42\nconsole.log(answer)\n'))
|
|
232
|
+
expect(censusHelper.entropyClassOf('export const answer = 42\nconsole.log(answer)\n'))
|
|
233
233
|
.toBe(EntropyClass.Text)
|
|
234
234
|
// Printable throughout, and not something a model can reason over: no line breaks, no indent.
|
|
235
|
-
expect(entropyClassOf(`const a=1,b=2,c=3;${'x'.repeat(400)}`)).toBe(EntropyClass.Dense)
|
|
236
|
-
expect(entropyClassOf(`PNG${'ÿ'.repeat(40)}`))
|
|
235
|
+
expect(censusHelper.entropyClassOf(`const a=1,b=2,c=3;${'x'.repeat(400)}`)).toBe(EntropyClass.Dense)
|
|
236
|
+
expect(censusHelper.entropyClassOf(`PNG${'ÿ'.repeat(40)}`))
|
|
237
237
|
.toBe(EntropyClass.Opaque)
|
|
238
238
|
})
|
|
239
239
|
|
|
240
240
|
test('fileClassOf reads the path before the extension', () => {
|
|
241
|
-
expect(fileClassOf('sources/api/src/index.ts', 'ts')).toBe(FileClass.Source)
|
|
242
|
-
expect(fileClassOf('node_modules/left-pad/index.js', 'js')).toBe(FileClass.Generated)
|
|
243
|
-
expect(fileClassOf('tests/api.spec.ts', 'ts')).toBe(FileClass.Test)
|
|
244
|
-
expect(fileClassOf('seed/users.json', 'json')).toBe(FileClass.Data)
|
|
245
|
-
expect(fileClassOf('package.json', 'json')).toBe(FileClass.Manifest)
|
|
246
|
-
expect(fileClassOf('bun.lock', 'lock')).toBe(FileClass.Lock)
|
|
241
|
+
expect(censusHelper.fileClassOf('sources/api/src/index.ts', 'ts')).toBe(FileClass.Source)
|
|
242
|
+
expect(censusHelper.fileClassOf('node_modules/left-pad/index.js', 'js')).toBe(FileClass.Generated)
|
|
243
|
+
expect(censusHelper.fileClassOf('tests/api.spec.ts', 'ts')).toBe(FileClass.Test)
|
|
244
|
+
expect(censusHelper.fileClassOf('seed/users.json', 'json')).toBe(FileClass.Data)
|
|
245
|
+
expect(censusHelper.fileClassOf('package.json', 'json')).toBe(FileClass.Manifest)
|
|
246
|
+
expect(censusHelper.fileClassOf('bun.lock', 'lock')).toBe(FileClass.Lock)
|
|
247
247
|
})
|
|
248
248
|
|
|
249
249
|
test('a seed or dump location reclassifies a payload and never a program', () => {
|
|
250
250
|
// Asked before the test check and the extension table, the seed/dump rule answered `Data` for
|
|
251
251
|
// all four of these — real source, out of the census's source budget on a word in its path.
|
|
252
|
-
expect(fileClassOf('tests/fixtures/user.ts', 'ts')).toBe(FileClass.Test)
|
|
253
|
-
expect(fileClassOf('src/seedUsers.ts', 'ts')).toBe(FileClass.Source)
|
|
254
|
-
expect(fileClassOf('src/exportReport.ts', 'ts')).toBe(FileClass.Source)
|
|
255
|
-
expect(fileClassOf('bin/cli.ts', 'ts')).toBe(FileClass.Source)
|
|
252
|
+
expect(censusHelper.fileClassOf('tests/fixtures/user.ts', 'ts')).toBe(FileClass.Test)
|
|
253
|
+
expect(censusHelper.fileClassOf('src/seedUsers.ts', 'ts')).toBe(FileClass.Source)
|
|
254
|
+
expect(censusHelper.fileClassOf('src/exportReport.ts', 'ts')).toBe(FileClass.Source)
|
|
255
|
+
expect(censusHelper.fileClassOf('bin/cli.ts', 'ts')).toBe(FileClass.Source)
|
|
256
256
|
// What the rule is for: a payload, and the one language that is a dump as often as it is code.
|
|
257
|
-
expect(fileClassOf('fixtures/orders.csv', 'csv')).toBe(FileClass.Data)
|
|
258
|
-
expect(fileClassOf('db/dumps/2024.sql', 'sql')).toBe(FileClass.Data)
|
|
259
|
-
expect(fileClassOf('db/migrations/0001_init.sql', 'sql')).toBe(FileClass.Source)
|
|
257
|
+
expect(censusHelper.fileClassOf('fixtures/orders.csv', 'csv')).toBe(FileClass.Data)
|
|
258
|
+
expect(censusHelper.fileClassOf('db/dumps/2024.sql', 'sql')).toBe(FileClass.Data)
|
|
259
|
+
expect(censusHelper.fileClassOf('db/migrations/0001_init.sql', 'sql')).toBe(FileClass.Source)
|
|
260
260
|
})
|
|
261
261
|
|
|
262
262
|
test('storyComplexity scales on what the extraction actually found', () => {
|
|
@@ -297,17 +297,17 @@ describe('viable-common - the conversion contracts', () => {
|
|
|
297
297
|
test('binaryByExtension answers a tail it knows and defers on one it does not', () => {
|
|
298
298
|
// The verdict a probe alone gets wrong: a small `.ico` with no NUL in its first bytes reads as
|
|
299
299
|
// text, which is how a census on a laptop and the same census in the slot disagreed.
|
|
300
|
-
expect(binaryByExtension('assets/logo.ico')).toBe(true)
|
|
301
|
-
expect(binaryByExtension('assets/logo.PNG')).toBe(true)
|
|
302
|
-
expect(binaryByExtension('sources/web/src/app.tsx')).toBe(false)
|
|
303
|
-
expect(binaryByExtension('archive.tar.gz')).toBe(true)
|
|
300
|
+
expect(censusHelper.binaryByExtension('assets/logo.ico')).toBe(true)
|
|
301
|
+
expect(censusHelper.binaryByExtension('assets/logo.PNG')).toBe(true)
|
|
302
|
+
expect(censusHelper.binaryByExtension('sources/web/src/app.tsx')).toBe(false)
|
|
303
|
+
expect(censusHelper.binaryByExtension('archive.tar.gz')).toBe(true)
|
|
304
304
|
// Nothing to go on, so the caller has to read it: no tail at all, a dotfile (which
|
|
305
305
|
// `path.extname` also answers nothing for), and a tail neither list carries.
|
|
306
|
-
expect(binaryByExtension('Makefile')).toBeNull()
|
|
307
|
-
expect(binaryByExtension('.env')).toBeNull()
|
|
308
|
-
expect(binaryByExtension('data.parquet')).toBeNull()
|
|
306
|
+
expect(censusHelper.binaryByExtension('Makefile')).toBeNull()
|
|
307
|
+
expect(censusHelper.binaryByExtension('.env')).toBeNull()
|
|
308
|
+
expect(censusHelper.binaryByExtension('data.parquet')).toBeNull()
|
|
309
309
|
// The tail of the last SEGMENT, never of the path.
|
|
310
|
-
expect(binaryByExtension('release.d/manifest')).toBeNull()
|
|
310
|
+
expect(censusHelper.binaryByExtension('release.d/manifest')).toBeNull()
|
|
311
311
|
})
|
|
312
312
|
|
|
313
313
|
test('a head read is bounded, and the binary probe is smaller than the head', () => {
|
package/tests/design.spec.ts
CHANGED
|
@@ -2,13 +2,10 @@ import { describe, expect, test } from 'bun:test'
|
|
|
2
2
|
import Ajv from 'ajv'
|
|
3
3
|
import { ProjectArea } from '../src/areas/consts.js'
|
|
4
4
|
import { SpecCategory } from '../src/ba/consts.js'
|
|
5
|
-
import {
|
|
6
|
-
DesignStaleness, STORY_DESIGN_VERSION, StoryDesignSchema, designHash, designStaleness,
|
|
7
|
-
emptyStoryDesign, screenMapOf, userStoryOfDesign,
|
|
8
|
-
} from '../src/design/index.js'
|
|
5
|
+
import { DesignStaleness, STORY_DESIGN_VERSION, StoryDesignSchema, storyDesignHelper } from '../src/design/index.js'
|
|
9
6
|
import type { StoryDesign } from '../src/design/index.js'
|
|
10
7
|
|
|
11
|
-
const design = (extra: Partial<StoryDesign> = {}): StoryDesign => emptyStoryDesign({
|
|
8
|
+
const design = (extra: Partial<StoryDesign> = {}): StoryDesign => storyDesignHelper.emptyStoryDesign({
|
|
12
9
|
code: 'US-ABC12',
|
|
13
10
|
narrative: 'A visitor books a slot.',
|
|
14
11
|
area: ProjectArea.User,
|
|
@@ -45,7 +42,7 @@ describe('viable-common - the design aggregate', () => {
|
|
|
45
42
|
test('derives the UserStory the coders take, carrying the story code', () => {
|
|
46
43
|
// The scaffold stamps every placeholder it draws with the code, so a run keyed by anything
|
|
47
44
|
// else cannot recognise its own reservation.
|
|
48
|
-
const story = userStoryOfDesign(withScreens())
|
|
45
|
+
const story = storyDesignHelper.userStoryOfDesign(withScreens())
|
|
49
46
|
|
|
50
47
|
expect(story.code).toBe('US-ABC12')
|
|
51
48
|
expect(story.area).toBe(ProjectArea.User)
|
|
@@ -60,11 +57,11 @@ describe('viable-common - the design aggregate', () => {
|
|
|
60
57
|
const broken = withScreens()
|
|
61
58
|
broken.screens[0].components = ['BookingList', 'Ghost']
|
|
62
59
|
|
|
63
|
-
expect(userStoryOfDesign(broken).screens[0].components.map(entry => entry.name)).toEqual(['BookingList'])
|
|
60
|
+
expect(storyDesignHelper.userStoryOfDesign(broken).screens[0].components.map(entry => entry.name)).toEqual(['BookingList'])
|
|
64
61
|
})
|
|
65
62
|
|
|
66
63
|
test('screenMapOf is the shape every UX and UI prompt takes', () => {
|
|
67
|
-
expect(screenMapOf(withScreens())).toEqual({ 'booking/list/overview': ['BookingList'] })
|
|
64
|
+
expect(storyDesignHelper.screenMapOf(withScreens())).toEqual({ 'booking/list/overview': ['BookingList'] })
|
|
68
65
|
})
|
|
69
66
|
})
|
|
70
67
|
|
|
@@ -78,7 +75,7 @@ describe('viable-common - design staleness', () => {
|
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
test('answers fresh when nothing moved', () => {
|
|
81
|
-
expect(designStaleness(fresh(), now)).toBe(DesignStaleness.Fresh)
|
|
78
|
+
expect(storyDesignHelper.designStaleness(fresh(), now)).toBe(DesignStaleness.Fresh)
|
|
82
79
|
})
|
|
83
80
|
|
|
84
81
|
test('ranks by severity: version, then narrative, then project, then tree', () => {
|
|
@@ -86,17 +83,17 @@ describe('viable-common - design staleness', () => {
|
|
|
86
83
|
// them the most expensive of the four.
|
|
87
84
|
const versioned = fresh()
|
|
88
85
|
versioned.version = STORY_DESIGN_VERSION + 1
|
|
89
|
-
expect(designStaleness(versioned, now)).toBe(DesignStaleness.Version)
|
|
86
|
+
expect(storyDesignHelper.designStaleness(versioned, now)).toBe(DesignStaleness.Version)
|
|
90
87
|
|
|
91
|
-
expect(designStaleness(fresh(), { ...now, narrativeHash: 'x' })).toBe(DesignStaleness.Narrative)
|
|
92
|
-
expect(designStaleness(fresh(), { ...now, projectHash: 'x' })).toBe(DesignStaleness.Project)
|
|
93
|
-
expect(designStaleness(fresh(), { ...now, registryHash: 'x' })).toBe(DesignStaleness.Tree)
|
|
88
|
+
expect(storyDesignHelper.designStaleness(fresh(), { ...now, narrativeHash: 'x' })).toBe(DesignStaleness.Narrative)
|
|
89
|
+
expect(storyDesignHelper.designStaleness(fresh(), { ...now, projectHash: 'x' })).toBe(DesignStaleness.Project)
|
|
90
|
+
expect(storyDesignHelper.designStaleness(fresh(), { ...now, registryHash: 'x' })).toBe(DesignStaleness.Tree)
|
|
94
91
|
})
|
|
95
92
|
|
|
96
93
|
test('the hash is stable and distinguishes its inputs', () => {
|
|
97
|
-
expect(designHash('a', 'b')).toBe(designHash('a', 'b'))
|
|
98
|
-
expect(designHash('a', 'b')).not.toBe(designHash('a', 'c'))
|
|
99
|
-
expect(designHash('a', undefined)).toBe(designHash('a'))
|
|
94
|
+
expect(storyDesignHelper.designHash('a', 'b')).toBe(storyDesignHelper.designHash('a', 'b'))
|
|
95
|
+
expect(storyDesignHelper.designHash('a', 'b')).not.toBe(storyDesignHelper.designHash('a', 'c'))
|
|
96
|
+
expect(storyDesignHelper.designHash('a', undefined)).toBe(storyDesignHelper.designHash('a'))
|
|
100
97
|
})
|
|
101
98
|
})
|
|
102
99
|
|
package/tests/planning.spec.ts
CHANGED
|
@@ -2,17 +2,15 @@ import { describe, expect, test } from 'bun:test'
|
|
|
2
2
|
import Ajv from 'ajv'
|
|
3
3
|
import addFormats from 'ajv-formats'
|
|
4
4
|
import { ResilientError } from '@owlmeans/error'
|
|
5
|
-
import {
|
|
5
|
+
import { CodeScope, CodeStyle, IntrinsicStatus, makeSchemaRegistry, SpecificationFormat, TITLE_MAX, WorkcardKind, type Specification, statusHelper } from '@owlmeans/planning'
|
|
6
6
|
import { ProjectArea } from '../src/areas/consts.js'
|
|
7
7
|
import { ConnectingStoryKind, SpecCategory, StoryKind } from '../src/ba/consts.js'
|
|
8
|
-
import {
|
|
8
|
+
import { connectingStoryHelper } from '../src/ba/connecting.js'
|
|
9
9
|
import { STORY_DESIGN_VERSION, StoryActor } from '../src/design/consts.js'
|
|
10
|
-
import {
|
|
10
|
+
import { storyDesignHelper } from '../src/design/story.js'
|
|
11
11
|
import type { StoryDesign } from '../src/design/types.js'
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
} from '../src/index.js'
|
|
15
|
-
import { isUserChannel, isViableProject, isViableStory, ProjectAgentOccupied, ProjectNotFound, ProjectStoryMissconfigured, projectBriefOf, storyDraftOf, storyWriteInputOf, userStoryOf, VIABLE_FLOW_SCHEMAS, VIABLE_PROJECT_FLOW, VIABLE_PROJECT_FLOW_SCHEMA, VIABLE_PROJECT_TYPE, VIABLE_PROJECT_TYPE_SCHEMA, VIABLE_RESERVED_TYPE_SCHEMAS, VIABLE_SPEC_TYPE, VIABLE_STORY_FLOW, VIABLE_STORY_FLOW_SCHEMA, VIABLE_STORY_TYPE, VIABLE_STORY_TYPE_SCHEMA, VIABLE_TYPE_SCHEMAS, ViableChannel, ViableProjectFieldsSchema, ViableProjectStatus, ViableProjectTransition, ViableRelationship, ViableSpecCategory, ViableStoryFieldsSchema, ViableStoryStatus, ViableStoryTransition, type ViableProjectCard, type ViableStoryCard } from '../src/planning/index.js'
|
|
12
|
+
import { LANDING_STORY_SENTENCE, landingSentenceHelper } from '../src/index.js'
|
|
13
|
+
import { ProjectAgentOccupied, ProjectNotFound, ProjectStoryMissconfigured, VIABLE_FLOW_SCHEMAS, VIABLE_PROJECT_FLOW, VIABLE_PROJECT_FLOW_SCHEMA, VIABLE_PROJECT_TYPE, VIABLE_PROJECT_TYPE_SCHEMA, VIABLE_RESERVED_TYPE_SCHEMAS, VIABLE_SPEC_TYPE, VIABLE_STORY_FLOW, VIABLE_STORY_FLOW_SCHEMA, VIABLE_STORY_TYPE, VIABLE_STORY_TYPE_SCHEMA, VIABLE_TYPE_SCHEMAS, ViableChannel, ViableProjectFieldsSchema, ViableProjectStatus, ViableProjectTransition, ViableRelationship, ViableSpecCategory, ViableStoryFieldsSchema, ViableStoryStatus, ViableStoryTransition, type ViableProjectCard, type ViableStoryCard, viableCardHelper, viableSpecHelper } from '../src/planning/index.js'
|
|
16
14
|
|
|
17
15
|
const at = '2026-09-16T10:00:00.000Z'
|
|
18
16
|
|
|
@@ -76,7 +74,7 @@ const spec = (category: string, body: string, revision?: number): Specification
|
|
|
76
74
|
...(revision != null ? { revision } : {}),
|
|
77
75
|
})
|
|
78
76
|
|
|
79
|
-
const designed = (): StoryDesign => emptyStoryDesign({
|
|
77
|
+
const designed = (): StoryDesign => storyDesignHelper.emptyStoryDesign({
|
|
80
78
|
code: 'US-OLD00',
|
|
81
79
|
narrative: 'The narrative the design was written against.',
|
|
82
80
|
area: ProjectArea.Guest,
|
|
@@ -106,30 +104,30 @@ describe('viable-common - the story flow', () => {
|
|
|
106
104
|
test('maps a failed story onto PLANNED, so done is the closed count and a retry is a start', () => {
|
|
107
105
|
const flow = VIABLE_STORY_FLOW_SCHEMA
|
|
108
106
|
|
|
109
|
-
expect(intrinsicOf(flow, ViableStoryStatus.Planned)).toBe(IntrinsicStatus.Planned)
|
|
110
|
-
expect(intrinsicOf(flow, ViableStoryStatus.InProgress)).toBe(IntrinsicStatus.InProgress)
|
|
111
|
-
expect(intrinsicOf(flow, ViableStoryStatus.Completed)).toBe(IntrinsicStatus.Closed)
|
|
112
|
-
expect(intrinsicOf(flow, ViableStoryStatus.Failed)).toBe(IntrinsicStatus.Planned)
|
|
107
|
+
expect(statusHelper.intrinsicOf(flow, ViableStoryStatus.Planned)).toBe(IntrinsicStatus.Planned)
|
|
108
|
+
expect(statusHelper.intrinsicOf(flow, ViableStoryStatus.InProgress)).toBe(IntrinsicStatus.InProgress)
|
|
109
|
+
expect(statusHelper.intrinsicOf(flow, ViableStoryStatus.Completed)).toBe(IntrinsicStatus.Closed)
|
|
110
|
+
expect(statusHelper.intrinsicOf(flow, ViableStoryStatus.Failed)).toBe(IntrinsicStatus.Planned)
|
|
113
111
|
})
|
|
114
112
|
|
|
115
113
|
test('starts from planned or failed only, and resets from anywhere', () => {
|
|
116
114
|
const flow = VIABLE_STORY_FLOW_SCHEMA
|
|
117
115
|
const { Planned, InProgress, Completed, Failed } = ViableStoryStatus
|
|
118
116
|
|
|
119
|
-
expect(canTransit(flow, ViableStoryTransition.Start, Planned)).toBe(true)
|
|
120
|
-
expect(canTransit(flow, ViableStoryTransition.Start, Failed)).toBe(true)
|
|
121
|
-
expect(canTransit(flow, ViableStoryTransition.Start, InProgress)).toBe(false)
|
|
122
|
-
expect(canTransit(flow, ViableStoryTransition.Start, Completed)).toBe(false)
|
|
123
|
-
expect(canTransit(flow, ViableStoryTransition.Complete, InProgress)).toBe(true)
|
|
124
|
-
expect(canTransit(flow, ViableStoryTransition.Fail, InProgress)).toBe(true)
|
|
125
|
-
expect(canTransit(flow, ViableStoryTransition.Fail, Planned)).toBe(false)
|
|
117
|
+
expect(statusHelper.canTransit(flow, ViableStoryTransition.Start, Planned)).toBe(true)
|
|
118
|
+
expect(statusHelper.canTransit(flow, ViableStoryTransition.Start, Failed)).toBe(true)
|
|
119
|
+
expect(statusHelper.canTransit(flow, ViableStoryTransition.Start, InProgress)).toBe(false)
|
|
120
|
+
expect(statusHelper.canTransit(flow, ViableStoryTransition.Start, Completed)).toBe(false)
|
|
121
|
+
expect(statusHelper.canTransit(flow, ViableStoryTransition.Complete, InProgress)).toBe(true)
|
|
122
|
+
expect(statusHelper.canTransit(flow, ViableStoryTransition.Fail, InProgress)).toBe(true)
|
|
123
|
+
expect(statusHelper.canTransit(flow, ViableStoryTransition.Fail, Planned)).toBe(false)
|
|
126
124
|
for (const status of Object.values(ViableStoryStatus)) {
|
|
127
|
-
expect(canTransit(flow, ViableStoryTransition.Reset, status)).toBe(true)
|
|
125
|
+
expect(statusHelper.canTransit(flow, ViableStoryTransition.Reset, status)).toBe(true)
|
|
128
126
|
}
|
|
129
127
|
})
|
|
130
128
|
|
|
131
129
|
test('offers a completed story nothing but a reset', () => {
|
|
132
|
-
expect(transitionsFrom(VIABLE_STORY_FLOW_SCHEMA, ViableStoryStatus.Completed).map(rule => rule.name))
|
|
130
|
+
expect(statusHelper.transitionsFrom(VIABLE_STORY_FLOW_SCHEMA, ViableStoryStatus.Completed).map(rule => rule.name))
|
|
133
131
|
.toEqual([ViableStoryTransition.Reset])
|
|
134
132
|
})
|
|
135
133
|
})
|
|
@@ -140,15 +138,15 @@ describe('viable-common - the project flow', () => {
|
|
|
140
138
|
const { Draft, Confirmed, Active, Archived } = ViableProjectStatus
|
|
141
139
|
|
|
142
140
|
expect(flow.statuses.find(status => status.initial === true)?.key).toBe(Draft)
|
|
143
|
-
expect(intrinsicOf(flow, Draft)).toBe(IntrinsicStatus.Planned)
|
|
144
|
-
expect(intrinsicOf(flow, Confirmed)).toBe(IntrinsicStatus.InProgress)
|
|
145
|
-
expect(intrinsicOf(flow, Active)).toBe(IntrinsicStatus.InProgress)
|
|
146
|
-
expect(intrinsicOf(flow, Archived)).toBe(IntrinsicStatus.Closed)
|
|
147
|
-
expect(canTransit(flow, ViableProjectTransition.Confirm, Draft)).toBe(true)
|
|
148
|
-
expect(canTransit(flow, ViableProjectTransition.Confirm, Active)).toBe(false)
|
|
149
|
-
expect(canTransit(flow, ViableProjectTransition.Activate, Confirmed)).toBe(true)
|
|
150
|
-
expect(canTransit(flow, ViableProjectTransition.Archive, Active)).toBe(true)
|
|
151
|
-
expect(canTransit(flow, ViableProjectTransition.Reopen, Archived)).toBe(true)
|
|
141
|
+
expect(statusHelper.intrinsicOf(flow, Draft)).toBe(IntrinsicStatus.Planned)
|
|
142
|
+
expect(statusHelper.intrinsicOf(flow, Confirmed)).toBe(IntrinsicStatus.InProgress)
|
|
143
|
+
expect(statusHelper.intrinsicOf(flow, Active)).toBe(IntrinsicStatus.InProgress)
|
|
144
|
+
expect(statusHelper.intrinsicOf(flow, Archived)).toBe(IntrinsicStatus.Closed)
|
|
145
|
+
expect(statusHelper.canTransit(flow, ViableProjectTransition.Confirm, Draft)).toBe(true)
|
|
146
|
+
expect(statusHelper.canTransit(flow, ViableProjectTransition.Confirm, Active)).toBe(false)
|
|
147
|
+
expect(statusHelper.canTransit(flow, ViableProjectTransition.Activate, Confirmed)).toBe(true)
|
|
148
|
+
expect(statusHelper.canTransit(flow, ViableProjectTransition.Archive, Active)).toBe(true)
|
|
149
|
+
expect(statusHelper.canTransit(flow, ViableProjectTransition.Reopen, Archived)).toBe(true)
|
|
152
150
|
})
|
|
153
151
|
})
|
|
154
152
|
|
|
@@ -299,15 +297,15 @@ describe('viable-common - the viable field schemas', () => {
|
|
|
299
297
|
|
|
300
298
|
describe('viable-common - the viable card helpers', () => {
|
|
301
299
|
test('recognises a card by kind AND type', () => {
|
|
302
|
-
expect(isViableStory(storyCard())).toBe(true)
|
|
303
|
-
expect(isViableStory(storyCard({ type: 'notion:task' }))).toBe(false)
|
|
304
|
-
expect(isViableProject(projectCard())).toBe(true)
|
|
305
|
-
expect(isViableProject(storyCard())).toBe(false)
|
|
300
|
+
expect(viableCardHelper.isViableStory(storyCard())).toBe(true)
|
|
301
|
+
expect(viableCardHelper.isViableStory(storyCard({ type: 'notion:task' }))).toBe(false)
|
|
302
|
+
expect(viableCardHelper.isViableProject(projectCard())).toBe(true)
|
|
303
|
+
expect(viableCardHelper.isViableProject(storyCard())).toBe(false)
|
|
306
304
|
})
|
|
307
305
|
|
|
308
306
|
test('userStoryOf lets the card win on narrative, code, area and actor, and takes screens from the design', () => {
|
|
309
307
|
const card = storyCard({ fields: { area: ProjectArea.User, primary: true, actor: StoryActor.Worker } })
|
|
310
|
-
const story = userStoryOf(card, designed())
|
|
308
|
+
const story = viableCardHelper.userStoryOf(card, designed())
|
|
311
309
|
|
|
312
310
|
expect(story.story).toBe(card.title)
|
|
313
311
|
expect(story.code).toBe('US-ABC12')
|
|
@@ -315,12 +313,12 @@ describe('viable-common - the viable card helpers', () => {
|
|
|
315
313
|
expect(story.actor).toBe(StoryActor.Worker)
|
|
316
314
|
expect(story.screens.map(screen => screen.name)).toEqual(['booking/list/overview'])
|
|
317
315
|
expect(story.entities.map(entity => entity.name)).toEqual(['Booking'])
|
|
318
|
-
expect(userStoryOf(card).screens).toEqual([])
|
|
319
|
-
expect(storyDraftOf(card)).toEqual({ story: card.title, area: ProjectArea.User })
|
|
316
|
+
expect(viableCardHelper.userStoryOf(card).screens).toEqual([])
|
|
317
|
+
expect(viableCardHelper.storyDraftOf(card)).toEqual({ story: card.title, area: ProjectArea.User })
|
|
320
318
|
})
|
|
321
319
|
|
|
322
320
|
test('projectBriefOf reads the highest revision per part and answers an unwritten part empty', () => {
|
|
323
|
-
const brief = projectBriefOf(projectCard(), [
|
|
321
|
+
const brief = viableSpecHelper.projectBriefOf(projectCard(), [
|
|
324
322
|
spec(ViableSpecCategory.Specification, 'first', 1),
|
|
325
323
|
spec(ViableSpecCategory.Specification, 'second', 2),
|
|
326
324
|
spec(ViableSpecCategory.Vision, 'the vision'),
|
|
@@ -334,62 +332,62 @@ describe('viable-common - the viable card helpers', () => {
|
|
|
334
332
|
|
|
335
333
|
test('storyWriteInputOf takes code, narrative and primary from the card, and refuses a card with no code', () => {
|
|
336
334
|
const content = {
|
|
337
|
-
userStory: userStoryOf(storyCard()), screenPaths: {}, componentPaths: {}, transitions: [],
|
|
335
|
+
userStory: viableCardHelper.userStoryOf(storyCard()), screenPaths: {}, componentPaths: {}, transitions: [],
|
|
338
336
|
section: 'Booking',
|
|
339
337
|
}
|
|
340
338
|
|
|
341
|
-
expect(storyWriteInputOf(storyCard(), content)).toEqual(expect.objectContaining({
|
|
339
|
+
expect(viableCardHelper.storyWriteInputOf(storyCard(), content)).toEqual(expect.objectContaining({
|
|
342
340
|
code: 'US-ABC12', narrative: 'A member books a slot.', primary: true,
|
|
343
341
|
status: ViableStoryStatus.Planned, section: 'Booking',
|
|
344
342
|
}))
|
|
345
|
-
expect(storyWriteInputOf(storyCard(), { ...content, status: ViableStoryStatus.Completed }).status)
|
|
343
|
+
expect(viableCardHelper.storyWriteInputOf(storyCard(), { ...content, status: ViableStoryStatus.Completed }).status)
|
|
346
344
|
.toBe(ViableStoryStatus.Completed)
|
|
347
|
-
expect(() => storyWriteInputOf(storyCard({ code: undefined }), content))
|
|
345
|
+
expect(() => viableCardHelper.storyWriteInputOf(storyCard({ code: undefined }), content))
|
|
348
346
|
.toThrow(ProjectStoryMissconfigured)
|
|
349
347
|
})
|
|
350
348
|
|
|
351
349
|
test('storyWriteInputOf copies the landing flag from the card, and only when it is set', () => {
|
|
352
350
|
const content = {
|
|
353
|
-
userStory: userStoryOf(storyCard()), screenPaths: {}, componentPaths: {}, transitions: [],
|
|
351
|
+
userStory: viableCardHelper.userStoryOf(storyCard()), screenPaths: {}, componentPaths: {}, transitions: [],
|
|
354
352
|
}
|
|
355
353
|
const landing = storyCard({ fields: { area: ProjectArea.User, primary: false, landing: true } })
|
|
356
354
|
|
|
357
|
-
expect(storyWriteInputOf(landing, content).landing).toBe(true)
|
|
358
|
-
expect('landing' in storyWriteInputOf(storyCard(), content)).toBe(false)
|
|
355
|
+
expect(viableCardHelper.storyWriteInputOf(landing, content).landing).toBe(true)
|
|
356
|
+
expect('landing' in viableCardHelper.storyWriteInputOf(storyCard(), content)).toBe(false)
|
|
359
357
|
})
|
|
360
358
|
|
|
361
359
|
test('only a person writes through the web and connect channels', () => {
|
|
362
|
-
expect(isUserChannel(ViableChannel.Web)).toBe(true)
|
|
363
|
-
expect(isUserChannel(ViableChannel.Connect)).toBe(true)
|
|
364
|
-
expect(isUserChannel(ViableChannel.Pipeline)).toBe(false)
|
|
365
|
-
expect(isUserChannel(undefined)).toBe(false)
|
|
360
|
+
expect(viableCardHelper.isUserChannel(ViableChannel.Web)).toBe(true)
|
|
361
|
+
expect(viableCardHelper.isUserChannel(ViableChannel.Connect)).toBe(true)
|
|
362
|
+
expect(viableCardHelper.isUserChannel(ViableChannel.Pipeline)).toBe(false)
|
|
363
|
+
expect(viableCardHelper.isUserChannel(undefined)).toBe(false)
|
|
366
364
|
})
|
|
367
365
|
})
|
|
368
366
|
|
|
369
367
|
describe('viable-common - the landing sentence', () => {
|
|
370
368
|
test('is appended once, with one space, and a resumed step never adds a second copy', () => {
|
|
371
|
-
const once = withLandingSentence('A member books a slot.')
|
|
369
|
+
const once = landingSentenceHelper.withLandingSentence('A member books a slot.')
|
|
372
370
|
|
|
373
371
|
expect(once).toBe(`A member books a slot. ${LANDING_STORY_SENTENCE}`)
|
|
374
|
-
expect(withLandingSentence(once)).toBe(once)
|
|
375
|
-
expect(hasLandingSentence(once)).toBe(true)
|
|
376
|
-
expect(hasLandingSentence('A member books a slot.')).toBe(false)
|
|
372
|
+
expect(landingSentenceHelper.withLandingSentence(once)).toBe(once)
|
|
373
|
+
expect(landingSentenceHelper.hasLandingSentence(once)).toBe(true)
|
|
374
|
+
expect(landingSentenceHelper.hasLandingSentence('A member books a slot.')).toBe(false)
|
|
377
375
|
})
|
|
378
376
|
|
|
379
377
|
test('is recognised whatever whitespace a person left around it', () => {
|
|
380
378
|
const rewrapped = `A member books a slot.\n${LANDING_STORY_SENTENCE.replace('; after', ';\n after')}`
|
|
381
379
|
|
|
382
|
-
expect(hasLandingSentence(rewrapped)).toBe(true)
|
|
383
|
-
expect(withLandingSentence(rewrapped)).toBe(rewrapped)
|
|
380
|
+
expect(landingSentenceHelper.hasLandingSentence(rewrapped)).toBe(true)
|
|
381
|
+
expect(landingSentenceHelper.withLandingSentence(rewrapped)).toBe(rewrapped)
|
|
384
382
|
})
|
|
385
383
|
|
|
386
384
|
test('never makes a title longer than a card accepts, and never cuts the narrative', () => {
|
|
387
385
|
const long = 'x'.repeat(TITLE_MAX - 10)
|
|
388
386
|
|
|
389
|
-
expect(withLandingSentence(long)).toBe(long)
|
|
390
|
-
expect(withLandingSentence('x'.repeat(TITLE_MAX - LANDING_STORY_SENTENCE.length - 1)).length)
|
|
387
|
+
expect(landingSentenceHelper.withLandingSentence(long)).toBe(long)
|
|
388
|
+
expect(landingSentenceHelper.withLandingSentence('x'.repeat(TITLE_MAX - LANDING_STORY_SENTENCE.length - 1)).length)
|
|
391
389
|
.toBe(TITLE_MAX)
|
|
392
|
-
expect(withLandingSentence(' ')).toBe(LANDING_STORY_SENTENCE)
|
|
390
|
+
expect(landingSentenceHelper.withLandingSentence(' ')).toBe(LANDING_STORY_SENTENCE)
|
|
393
391
|
})
|
|
394
392
|
})
|
|
395
393
|
|
|
@@ -400,7 +398,7 @@ describe('viable-common - the follows anchor', () => {
|
|
|
400
398
|
{ story: 'Two', area: ProjectArea.User },
|
|
401
399
|
{ story: 'Three', area: ProjectArea.Admin },
|
|
402
400
|
]
|
|
403
|
-
const merged = mergeConnectingStories(flow, [
|
|
401
|
+
const merged = connectingStoryHelper.mergeConnectingStories(flow, [
|
|
404
402
|
{ story: 'Queue', area: ProjectArea.Admin, kind: ConnectingStoryKind.Queue, after: 9 },
|
|
405
403
|
{ story: 'Tracker', area: ProjectArea.User, kind: ConnectingStoryKind.Tracker, after: 1 },
|
|
406
404
|
])
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test'
|
|
2
|
-
import {
|
|
2
|
+
import { agentPresentationHelper } from '../src/agent/presentation.js'
|
|
3
3
|
import { AgentCodeLanguage, AgentMarkdownKind, AgentMessageCategory, AgentMessageRole, AgentStructuredKind } from '../src/agent/consts.js'
|
|
4
4
|
|
|
5
5
|
describe('@owlmeans/viable-common — agent message presentation', () => {
|
|
6
6
|
test('classifies source and unified diffs with their display language', () => {
|
|
7
|
-
expect(classifyAgentMessage({ action: 'code', text: 'export const App = () => <main />' }))
|
|
7
|
+
expect(agentPresentationHelper.classifyAgentMessage({ action: 'code', text: 'export const App = () => <main />' }))
|
|
8
8
|
.toMatchObject({ category: AgentMessageCategory.Code, language: AgentCodeLanguage.ReactTsx })
|
|
9
|
-
expect(classifyAgentMessage({ action: 'update-code', text: '--- a/app.css\n+++ b/app.css\n@@ -1 +1 @@\n-.old {}\n+.new {}' }))
|
|
9
|
+
expect(agentPresentationHelper.classifyAgentMessage({ action: 'update-code', text: '--- a/app.css\n+++ b/app.css\n@@ -1 +1 @@\n-.old {}\n+.new {}' }))
|
|
10
10
|
.toMatchObject({ category: AgentMessageCategory.Diff, language: AgentCodeLanguage.Css })
|
|
11
|
-
expect(classifyAgentMessage({ text: '{"ready": true}' }))
|
|
11
|
+
expect(agentPresentationHelper.classifyAgentMessage({ text: '{"ready": true}' }))
|
|
12
12
|
.toMatchObject({ category: AgentMessageCategory.Code, language: AgentCodeLanguage.Json })
|
|
13
13
|
})
|
|
14
14
|
|
|
15
15
|
test('unwraps schema tool calls into semantic cards instead of a JSON fallback', () => {
|
|
16
|
-
expect(classifyAgentMessage({
|
|
16
|
+
expect(agentPresentationHelper.classifyAgentMessage({
|
|
17
17
|
outputType: 'tool_calls',
|
|
18
18
|
action: 'choose-files-for-fix',
|
|
19
19
|
value: [{ name: 'answer', args: { files: ['src/app.tsx'], why: 'screen entrypoint' } }],
|
|
20
20
|
})).toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.ArtifactSelection })
|
|
21
|
-
expect(classifyAgentMessage({ value: { actor: 'human', worker: false, jobs: [], agents: [], kv: false } }))
|
|
21
|
+
expect(agentPresentationHelper.classifyAgentMessage({ value: { actor: 'human', worker: false, jobs: [], agents: [], kv: false } }))
|
|
22
22
|
.toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.RuntimeDecision })
|
|
23
23
|
// The model's own runtime-decision call never carries `actor`/`worker` — those are added only
|
|
24
24
|
// once the decision is persisted onto a StoryDesign.
|
|
25
|
-
expect(classifyAgentMessage({ value: { kv: true, feedback: null, jobs: [], agents: [] } }))
|
|
25
|
+
expect(agentPresentationHelper.classifyAgentMessage({ value: { kv: true, feedback: null, jobs: [], agents: [] } }))
|
|
26
26
|
.toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.RuntimeDecision })
|
|
27
27
|
// A scaffold plan carries its own `stories` array — checked ahead of StoryPlan's bare check.
|
|
28
|
-
expect(classifyAgentMessage({
|
|
28
|
+
expect(agentPresentationHelper.classifyAgentMessage({
|
|
29
29
|
value: { identity: { name: 'App', description: '' }, guestHome: {}, areas: [], stories: [], motifs: '' },
|
|
30
30
|
})).toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.ScaffoldPlan })
|
|
31
|
-
expect(classifyAgentMessage({ value: { unknown: ['still', 'readable'] } }))
|
|
31
|
+
expect(agentPresentationHelper.classifyAgentMessage({ value: { unknown: ['still', 'readable'] } }))
|
|
32
32
|
.toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.GenericRecord })
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
test('routes unconstrained tool-calling loops to ToolCalls even when args shape-match a schema', () => {
|
|
36
36
|
// A single free-flight file read whose args happen to carry `files` — without the action
|
|
37
37
|
// check this reads as an ArtifactSelection card instead of a tool call.
|
|
38
|
-
expect(classifyAgentMessage({
|
|
38
|
+
expect(agentPresentationHelper.classifyAgentMessage({
|
|
39
39
|
outputType: 'tool_calls',
|
|
40
40
|
action: 'coding-agent-ask',
|
|
41
41
|
value: [{ name: 'read_sources', args: { files: ['src/app.tsx'] } }],
|
|
42
42
|
})).toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.ToolCalls })
|
|
43
43
|
// Several calls in the same turn are always ToolCalls, regardless of action.
|
|
44
|
-
expect(classifyAgentMessage({
|
|
44
|
+
expect(agentPresentationHelper.classifyAgentMessage({
|
|
45
45
|
outputType: 'tool_calls',
|
|
46
46
|
value: [
|
|
47
47
|
{ name: 'read_file', args: { path: 'a.ts' } },
|
|
@@ -50,34 +50,34 @@ describe('@owlmeans/viable-common — agent message presentation', () => {
|
|
|
50
50
|
})).toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.ToolCalls })
|
|
51
51
|
// A single call whose args shape-match nothing known stays ToolCalls rather than falling
|
|
52
52
|
// through to a generic JSON dump.
|
|
53
|
-
expect(classifyAgentMessage({
|
|
53
|
+
expect(agentPresentationHelper.classifyAgentMessage({
|
|
54
54
|
outputType: 'tool_calls',
|
|
55
55
|
value: [{ name: 'run_bun', args: { args: 'install' } }],
|
|
56
56
|
})).toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.ToolCalls })
|
|
57
57
|
})
|
|
58
58
|
|
|
59
59
|
test('uses producer metadata for roles and action metadata for documents and decisions', () => {
|
|
60
|
-
expect(classifyAgentMessage({ agent: 'ba-service', helper: 'ba-helper', action: 'write-specification', text: '# Brief' }))
|
|
60
|
+
expect(agentPresentationHelper.classifyAgentMessage({ agent: 'ba-service', helper: 'ba-helper', action: 'write-specification', text: '# Brief' }))
|
|
61
61
|
.toMatchObject({ category: AgentMessageCategory.Markdown, document: AgentMarkdownKind.Specification, role: AgentMessageRole.Analytical })
|
|
62
|
-
expect(classifyAgentMessage({ agent: 'ui-helper', action: 'describe-ui-screen', text: '## Layout' }))
|
|
62
|
+
expect(agentPresentationHelper.classifyAgentMessage({ agent: 'ui-helper', action: 'describe-ui-screen', text: '## Layout' }))
|
|
63
63
|
.toMatchObject({ role: AgentMessageRole.VisualDesign })
|
|
64
|
-
expect(classifyAgentMessage({ agent: 'api-helper', action: 'should-update-handler', text: 'true' }))
|
|
64
|
+
expect(agentPresentationHelper.classifyAgentMessage({ agent: 'api-helper', action: 'should-update-handler', text: 'true' }))
|
|
65
65
|
.toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.Decision, role: AgentMessageRole.Architect })
|
|
66
|
-
expect(classifyAgentMessage({ agent: 'runtime-architect', action: 'runtime-gate' }))
|
|
66
|
+
expect(agentPresentationHelper.classifyAgentMessage({ agent: 'runtime-architect', action: 'runtime-gate' }))
|
|
67
67
|
.toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.RuntimeDecision, role: AgentMessageRole.Architect })
|
|
68
|
-
expect(classifyAgentMessage({ helper: 'navigation-analyst', action: 'detect-story-with-home-screen' }))
|
|
68
|
+
expect(agentPresentationHelper.classifyAgentMessage({ helper: 'navigation-analyst', action: 'detect-story-with-home-screen' }))
|
|
69
69
|
.toMatchObject({ category: AgentMessageCategory.Structured, structure: AgentStructuredKind.CandidateRanking, role: AgentMessageRole.Analytical })
|
|
70
70
|
})
|
|
71
71
|
|
|
72
72
|
test('keeps ordinary conversation as plain text', () => {
|
|
73
|
-
expect(classifyAgentMessage({ agent: 'client', action: 'prompt', text: 'Please add a dashboard.' }))
|
|
73
|
+
expect(agentPresentationHelper.classifyAgentMessage({ agent: 'client', action: 'prompt', text: 'Please add a dashboard.' }))
|
|
74
74
|
.toEqual({ category: AgentMessageCategory.Plain, role: AgentMessageRole.Technical })
|
|
75
75
|
})
|
|
76
76
|
|
|
77
77
|
test('hides source-extractor range selections from the user-facing journal', () => {
|
|
78
|
-
expect(isAgentMessageHidden({ action: 'source-extract', value: [{
|
|
78
|
+
expect(agentPresentationHelper.isAgentMessageHidden({ action: 'source-extract', value: [{
|
|
79
79
|
name: 'select_ranges', args: { ranges: [{ start: 12, end: 18 }] },
|
|
80
80
|
}] })).toBe(true)
|
|
81
|
-
expect(isAgentMessageHidden({ action: 'declaration-lookup' })).toBe(false)
|
|
81
|
+
expect(agentPresentationHelper.isAgentMessageHidden({ action: 'declaration-lookup' })).toBe(false)
|
|
82
82
|
})
|
|
83
83
|
})
|