@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,672 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The conversion vocabulary — what the platform says about an ORIGIN project it did not generate.
|
|
3
|
+
*
|
|
4
|
+
* A converted project has two histories on one volume: the tree somebody else wrote, and the
|
|
5
|
+
* Viable target grown around it. Every layer of the conversion — the library that reads the
|
|
6
|
+
* origin, the agent that runs the stages, the manager API that prices them and the browser that
|
|
7
|
+
* shows the dialog — has to name the same things the same way, so the names live here rather than
|
|
8
|
+
* in whichever package happened to need them first. That is the same reason the slot command
|
|
9
|
+
* vocabulary and the connector protocol sit beside this file: three or four independent runtimes
|
|
10
|
+
* answer them and none of them owns the words.
|
|
11
|
+
*
|
|
12
|
+
* Nothing here is a heuristic and nothing here reads a file. These are enumerations, path layouts
|
|
13
|
+
* and budgets — the parts that must be identical everywhere or the conversion means different
|
|
14
|
+
* things at each hop.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { StoryKind } from '../ba/consts.js'
|
|
18
|
+
import { HISTORY_FILE, METADATA_DIRS } from '../metadata/consts.js'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The four stages of a conversion, in order.
|
|
22
|
+
*
|
|
23
|
+
* Each is ONE platform pipeline run and ends at a decision the user makes: intake establishes what
|
|
24
|
+
* the origin IS, analysis restores the specification Viable would have written for it, extraction
|
|
25
|
+
* restores the story list with proofs from the code, and implementation re-implements those
|
|
26
|
+
* stories with the ordinary Viable helpers. A stage is never entered by skipping the one before
|
|
27
|
+
* it ({@link canEnter}) — every stage reads the documents the previous stage wrote.
|
|
28
|
+
*/
|
|
29
|
+
export enum ConversionStage {
|
|
30
|
+
Intake = 'intake',
|
|
31
|
+
Analysis = 'analysis',
|
|
32
|
+
Extraction = 'extraction',
|
|
33
|
+
Implementation = 'implementation',
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Where a conversion stands.
|
|
38
|
+
*
|
|
39
|
+
* `Awaiting` and `Waiting` are deliberately different words for deliberately different things:
|
|
40
|
+
* `Awaiting` means the platform has finished a stage and is waiting for the USER to decide what
|
|
41
|
+
* happens next, `Waiting` means a run is parked mid-step on an inquiry and will continue by
|
|
42
|
+
* itself the moment somebody answers it. A UI that collapses the two offers a decision button for
|
|
43
|
+
* a run that is not asking for one, and shows a spinner for a run that will never move again.
|
|
44
|
+
*/
|
|
45
|
+
export enum ConversionStatus {
|
|
46
|
+
Pending = 'pending',
|
|
47
|
+
Running = 'running',
|
|
48
|
+
/** A stage finished; the next one starts only on a {@link ConversionDecision}. */
|
|
49
|
+
Awaiting = 'awaiting',
|
|
50
|
+
/** A run is parked on an inquiry — see the connector's inquiry payload. */
|
|
51
|
+
Waiting = 'waiting',
|
|
52
|
+
Failed = 'failed',
|
|
53
|
+
Cancelled = 'cancelled',
|
|
54
|
+
Done = 'done',
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* What the user decides at a stage boundary.
|
|
59
|
+
*
|
|
60
|
+
* `Leave` is the deliberate terminal of a conversion that keeps the analysis and never
|
|
61
|
+
* re-implements anything — a perfectly ordinary outcome, not a failure. `Retry` re-runs the stage
|
|
62
|
+
* that failed or stalled, and `Cancel` ends the conversion without destroying the project.
|
|
63
|
+
*/
|
|
64
|
+
export enum ConversionDecision {
|
|
65
|
+
Analyze = 'analyze',
|
|
66
|
+
Extract = 'extract',
|
|
67
|
+
Implement = 'implement',
|
|
68
|
+
Leave = 'leave',
|
|
69
|
+
Retry = 'retry',
|
|
70
|
+
Cancel = 'cancel',
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Where the origin code came from. Never what the tree IS — that is {@link OriginShape}. */
|
|
74
|
+
export enum OriginKind {
|
|
75
|
+
Github = 'github',
|
|
76
|
+
Local = 'local',
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* What the origin tree turned out to be.
|
|
81
|
+
*
|
|
82
|
+
* Separate from {@link OriginKind} because the two answer different questions and a single word
|
|
83
|
+
* for both is how a GitHub clone of a Viable project came to be treated as foreign code. `Viable`
|
|
84
|
+
* means the integrity manifest recognises it and the conversion is a REPAIR; `CreateApp` is an
|
|
85
|
+
* OwlMeans scaffold that never became a Viable target; `Foreign` is everything else; `Empty` is a
|
|
86
|
+
* tree with no sources in it at all.
|
|
87
|
+
*/
|
|
88
|
+
export enum OriginShape {
|
|
89
|
+
Viable = 'viable',
|
|
90
|
+
CreateApp = 'create-app',
|
|
91
|
+
Foreign = 'foreign',
|
|
92
|
+
Empty = 'empty',
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Whether the origin sources are still on the volume.
|
|
97
|
+
*
|
|
98
|
+
* `Purged` is not `Absent`: a purged conversion has had its origin deleted on request AND its
|
|
99
|
+
* documents rewritten to stop quoting it, and that is irreversible. `Absent` is simply "not there
|
|
100
|
+
* yet" — the ordinary state before intake clones anything.
|
|
101
|
+
*/
|
|
102
|
+
export enum OriginState {
|
|
103
|
+
Absent = 'absent',
|
|
104
|
+
Present = 'present',
|
|
105
|
+
Purged = 'purged',
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The shape of the application, as one of five cases.
|
|
110
|
+
*
|
|
111
|
+
* ONE layer of sub-pipelines and no more. A case decides which taxonomy pipeline reads the origin
|
|
112
|
+
* and which role plan prices it; the STACK decides only which skill pack is loaded as data. Cases
|
|
113
|
+
* multiply the code, stacks multiply a table — which is why there are five of the first and
|
|
114
|
+
* twenty-odd of the second.
|
|
115
|
+
*/
|
|
116
|
+
export enum ArchitectureCase {
|
|
117
|
+
SpaApi = 'spa-api',
|
|
118
|
+
SsrMonolith = 'ssr-monolith',
|
|
119
|
+
ApiOnly = 'api-only',
|
|
120
|
+
CliPipeline = 'cli-pipeline',
|
|
121
|
+
/** The origin already IS a Viable target; the conversion repairs it rather than re-deriving it. */
|
|
122
|
+
ViableRepair = 'viable-repair',
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** The language ecosystem a stack belongs to. */
|
|
126
|
+
export enum StackFamily {
|
|
127
|
+
Js = 'js',
|
|
128
|
+
Java = 'java',
|
|
129
|
+
Kotlin = 'kotlin',
|
|
130
|
+
Go = 'go',
|
|
131
|
+
Python = 'python',
|
|
132
|
+
Php = 'php',
|
|
133
|
+
Csharp = 'csharp',
|
|
134
|
+
Elixir = 'elixir',
|
|
135
|
+
Ruby = 'ruby',
|
|
136
|
+
OwlMeans = 'owlmeans',
|
|
137
|
+
Unknown = 'unknown',
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The frameworks the converter carries a skill pack for.
|
|
142
|
+
*
|
|
143
|
+
* DATA, not code: a stack contributes signatures to detection and a short pack of conventions to
|
|
144
|
+
* the prompts, and nothing else branches on it. Adding one is a table entry plus a pack; adding an
|
|
145
|
+
* {@link ArchitectureCase} is a pipeline.
|
|
146
|
+
*/
|
|
147
|
+
export enum StackId {
|
|
148
|
+
NextJs = 'next',
|
|
149
|
+
Nuxt = 'nuxt',
|
|
150
|
+
ReactSpa = 'react-spa',
|
|
151
|
+
VueSpa = 'vue-spa',
|
|
152
|
+
AngularSpa = 'angular-spa',
|
|
153
|
+
Express = 'express',
|
|
154
|
+
Fastify = 'fastify',
|
|
155
|
+
NestJs = 'nest',
|
|
156
|
+
LangchainJs = 'langchain-js',
|
|
157
|
+
SpringBoot = 'spring-boot',
|
|
158
|
+
Ktor = 'ktor',
|
|
159
|
+
KotlinSpring = 'kotlin-spring',
|
|
160
|
+
GoNetHttp = 'go-net-http',
|
|
161
|
+
Gin = 'gin',
|
|
162
|
+
Echo = 'echo',
|
|
163
|
+
Django = 'django',
|
|
164
|
+
FastApi = 'fastapi',
|
|
165
|
+
Flask = 'flask',
|
|
166
|
+
LangchainPy = 'langchain-py',
|
|
167
|
+
Laravel = 'laravel',
|
|
168
|
+
Symfony = 'symfony',
|
|
169
|
+
AspNetCore = 'aspnet-core',
|
|
170
|
+
Phoenix = 'phoenix',
|
|
171
|
+
Rails = 'rails',
|
|
172
|
+
OwlMeansCreateApp = 'owlmeans-create-app',
|
|
173
|
+
Viable = 'viable',
|
|
174
|
+
Unknown = 'unknown',
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Stack → family. TOTAL over {@link StackId}, and a test pins it.
|
|
179
|
+
*
|
|
180
|
+
* A partial map with a fall-through default is the same bug the target-role vocabulary carried:
|
|
181
|
+
* every unlisted member answers with whatever the default is, nothing fails, and the answers are
|
|
182
|
+
* simply about another language.
|
|
183
|
+
*/
|
|
184
|
+
export const STACK_FAMILY: Record<StackId, StackFamily> = {
|
|
185
|
+
[StackId.NextJs]: StackFamily.Js,
|
|
186
|
+
[StackId.Nuxt]: StackFamily.Js,
|
|
187
|
+
[StackId.ReactSpa]: StackFamily.Js,
|
|
188
|
+
[StackId.VueSpa]: StackFamily.Js,
|
|
189
|
+
[StackId.AngularSpa]: StackFamily.Js,
|
|
190
|
+
[StackId.Express]: StackFamily.Js,
|
|
191
|
+
[StackId.Fastify]: StackFamily.Js,
|
|
192
|
+
[StackId.NestJs]: StackFamily.Js,
|
|
193
|
+
[StackId.LangchainJs]: StackFamily.Js,
|
|
194
|
+
[StackId.SpringBoot]: StackFamily.Java,
|
|
195
|
+
[StackId.Ktor]: StackFamily.Kotlin,
|
|
196
|
+
[StackId.KotlinSpring]: StackFamily.Kotlin,
|
|
197
|
+
[StackId.GoNetHttp]: StackFamily.Go,
|
|
198
|
+
[StackId.Gin]: StackFamily.Go,
|
|
199
|
+
[StackId.Echo]: StackFamily.Go,
|
|
200
|
+
[StackId.Django]: StackFamily.Python,
|
|
201
|
+
[StackId.FastApi]: StackFamily.Python,
|
|
202
|
+
[StackId.Flask]: StackFamily.Python,
|
|
203
|
+
[StackId.LangchainPy]: StackFamily.Python,
|
|
204
|
+
[StackId.Laravel]: StackFamily.Php,
|
|
205
|
+
[StackId.Symfony]: StackFamily.Php,
|
|
206
|
+
[StackId.AspNetCore]: StackFamily.Csharp,
|
|
207
|
+
[StackId.Phoenix]: StackFamily.Elixir,
|
|
208
|
+
[StackId.Rails]: StackFamily.Ruby,
|
|
209
|
+
[StackId.OwlMeansCreateApp]: StackFamily.OwlMeans,
|
|
210
|
+
[StackId.Viable]: StackFamily.OwlMeans,
|
|
211
|
+
[StackId.Unknown]: StackFamily.Unknown,
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Whether the platform will convert this origin at all.
|
|
216
|
+
*
|
|
217
|
+
* `Limited` is not a refusal — it is a conversion that will produce less than a whole one, and the
|
|
218
|
+
* user is told which parts before they pay for it.
|
|
219
|
+
*/
|
|
220
|
+
export enum ConvertibilityVerdict {
|
|
221
|
+
Ready = 'ready',
|
|
222
|
+
Limited = 'limited',
|
|
223
|
+
Refused = 'refused',
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** Why a {@link ConvertibilityVerdict} is not `Ready`. Every one of them is shown to the user. */
|
|
227
|
+
export enum ConvertibilityReason {
|
|
228
|
+
Empty = 'empty',
|
|
229
|
+
NoSources = 'no-sources',
|
|
230
|
+
TooLarge = 'too-large',
|
|
231
|
+
UnknownStack = 'unknown-stack',
|
|
232
|
+
/** A workspace member or a directory nothing declares — its code would be read as orphaned. */
|
|
233
|
+
UnlinkedSubproject = 'unlinked-subproject',
|
|
234
|
+
MissingSubmodule = 'missing-submodule',
|
|
235
|
+
BinaryOnly = 'binary-only',
|
|
236
|
+
Encrypted = 'encrypted',
|
|
237
|
+
AlreadyConverted = 'already-converted',
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** What a file in the origin is, as far as the census can tell from its path and its head. */
|
|
241
|
+
export enum FileClass {
|
|
242
|
+
Source = 'source',
|
|
243
|
+
Config = 'config',
|
|
244
|
+
Manifest = 'manifest',
|
|
245
|
+
Doc = 'doc',
|
|
246
|
+
Style = 'style',
|
|
247
|
+
Template = 'template',
|
|
248
|
+
Test = 'test',
|
|
249
|
+
Data = 'data',
|
|
250
|
+
Binary = 'binary',
|
|
251
|
+
Lock = 'lock',
|
|
252
|
+
Generated = 'generated',
|
|
253
|
+
Unknown = 'unknown',
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** Size bands: `< 2 KB`, `< 32 KB`, `< 256 KB`, `< 2 MB`, `>= 2 MB`. See {@link SIZE_CLASS_BOUNDS}. */
|
|
257
|
+
export enum SizeClass {
|
|
258
|
+
Tiny = 'tiny',
|
|
259
|
+
Small = 'small',
|
|
260
|
+
Medium = 'medium',
|
|
261
|
+
Large = 'large',
|
|
262
|
+
Huge = 'huge',
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** How readable a file's head is — the cheap stand-in for "is this text a model can use". */
|
|
266
|
+
export enum EntropyClass {
|
|
267
|
+
Text = 'text',
|
|
268
|
+
/** Printable, but minified, base64-ish or otherwise not prose the model can reason over. */
|
|
269
|
+
Dense = 'dense',
|
|
270
|
+
Opaque = 'opaque',
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** What a data file in the origin is for. */
|
|
274
|
+
export enum DumpKind {
|
|
275
|
+
/** Small and referenced by the code — the data the app needs to make sense. Carried over. */
|
|
276
|
+
Seed = 'seed',
|
|
277
|
+
/** A large export. Sampled, described, never carried. */
|
|
278
|
+
Bulk = 'bulk',
|
|
279
|
+
Fixture = 'fixture',
|
|
280
|
+
Migration = 'migration',
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** How the origin declares its packages, when it has more than one. */
|
|
284
|
+
export enum WorkspaceKind {
|
|
285
|
+
Single = 'single',
|
|
286
|
+
BunWorkspaces = 'bun',
|
|
287
|
+
PnpmWorkspaces = 'pnpm',
|
|
288
|
+
YarnWorkspaces = 'yarn',
|
|
289
|
+
Lerna = 'lerna',
|
|
290
|
+
Nx = 'nx',
|
|
291
|
+
Turbo = 'turbo',
|
|
292
|
+
GoWork = 'go-work',
|
|
293
|
+
Maven = 'maven',
|
|
294
|
+
Gradle = 'gradle',
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The layers a taxonomy pass reads out of the origin, one model call each.
|
|
299
|
+
*
|
|
300
|
+
* Ordered by what a later layer needs from an earlier one ({@link TAXONOMY_ORDER}): types before
|
|
301
|
+
* the resources that store them, resources before the models that compose them, screens before
|
|
302
|
+
* the navigation that addresses them.
|
|
303
|
+
*/
|
|
304
|
+
export enum TaxonomyKind {
|
|
305
|
+
Type = 'type',
|
|
306
|
+
Resource = 'resource',
|
|
307
|
+
Model = 'model',
|
|
308
|
+
Service = 'service',
|
|
309
|
+
ViewModel = 'view-model',
|
|
310
|
+
Component = 'component',
|
|
311
|
+
Layout = 'layout',
|
|
312
|
+
Screen = 'screen',
|
|
313
|
+
Navigation = 'navigation',
|
|
314
|
+
Endpoint = 'endpoint',
|
|
315
|
+
Job = 'job',
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** The order the taxonomy layers are read in. A permutation of {@link TaxonomyKind}; a test pins it. */
|
|
319
|
+
export const TAXONOMY_ORDER: TaxonomyKind[] = [
|
|
320
|
+
TaxonomyKind.Type,
|
|
321
|
+
TaxonomyKind.Resource,
|
|
322
|
+
TaxonomyKind.Model,
|
|
323
|
+
TaxonomyKind.Service,
|
|
324
|
+
TaxonomyKind.ViewModel,
|
|
325
|
+
TaxonomyKind.Component,
|
|
326
|
+
TaxonomyKind.Layout,
|
|
327
|
+
TaxonomyKind.Screen,
|
|
328
|
+
TaxonomyKind.Navigation,
|
|
329
|
+
TaxonomyKind.Endpoint,
|
|
330
|
+
TaxonomyKind.Job,
|
|
331
|
+
]
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Where the answer to "what is this application for" came from, best first.
|
|
335
|
+
*
|
|
336
|
+
* It is recorded because the confidence of the whole analysis follows from it: a purpose read out
|
|
337
|
+
* of a written harness is a statement of intent, one inferred from screen labels is a guess.
|
|
338
|
+
*/
|
|
339
|
+
export enum PurposeEvidenceSource {
|
|
340
|
+
Harness = 'harness',
|
|
341
|
+
Checks = 'checks',
|
|
342
|
+
Ui = 'ui',
|
|
343
|
+
Jobs = 'jobs',
|
|
344
|
+
Manifest = 'manifest',
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/** The input slices a cost estimate projects a stage's token spend from. */
|
|
348
|
+
export enum EstimateSlice {
|
|
349
|
+
Manifests = 'manifests',
|
|
350
|
+
Harness = 'harness',
|
|
351
|
+
Sources = 'sources',
|
|
352
|
+
Styles = 'styles',
|
|
353
|
+
Config = 'config',
|
|
354
|
+
Taxonomy = 'taxonomy',
|
|
355
|
+
Spec = 'spec',
|
|
356
|
+
StoryList = 'story-list',
|
|
357
|
+
OriginCard = 'origin-card',
|
|
358
|
+
/** A fixed per-call overhead that does not scale with the origin. */
|
|
359
|
+
Fixed = 'fixed',
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* What KIND of story a conversion produced.
|
|
364
|
+
*
|
|
365
|
+
* The analysis half of a conversion produces exactly the two kinds an ordinary initialization
|
|
366
|
+
* does; a conversion adds one more — a `coverage` story, written so an area the origin serves but
|
|
367
|
+
* the flow never reaches still has something in it.
|
|
368
|
+
*/
|
|
369
|
+
export type ConversionStoryKind = StoryKind | 'coverage'
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Where the origin's own sources live inside the target's volume.
|
|
373
|
+
*
|
|
374
|
+
* One directory, at the sandbox root, named so nothing a generator writes can collide with it.
|
|
375
|
+
* Everything that walks the tree must skip it — the source listing, the file watcher, every build,
|
|
376
|
+
* and the placeholder walk an initialization does — or the origin is compiled, watched and
|
|
377
|
+
* type-checked as if it were the generated application.
|
|
378
|
+
*/
|
|
379
|
+
export const CONVERTED_ORIGIN_DIR = '__viable_converted'
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Directories excluded from every source listing of a target project.
|
|
383
|
+
*
|
|
384
|
+
* ONE constant, spread by the library-local helper, the publisher and the connector SDK executor.
|
|
385
|
+
* Three copies of this list is three chances for one of them to keep listing the origin, and the
|
|
386
|
+
* symptom is a coder helper reading a foreign framework's files as if they were the target's.
|
|
387
|
+
*/
|
|
388
|
+
export const SOURCE_LIST_EXCLUSIONS: readonly string[] = [...METADATA_DIRS, CONVERTED_ORIGIN_DIR]
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* What stays at the project root through a relocation AND through an initialization, whatever
|
|
392
|
+
* the caller names.
|
|
393
|
+
*
|
|
394
|
+
* These three belong to the SLOT, not to the project inside it: the git repository every rollback
|
|
395
|
+
* works through, the metadata file the publisher configures itself from, and the project's own
|
|
396
|
+
* rolling history — which is NESTED, and therefore the reason both operations run through a prune
|
|
397
|
+
* walk rather than over a `readdir`.
|
|
398
|
+
*
|
|
399
|
+
* ONE list, for the same reason as {@link SOURCE_LIST_EXCLUSIONS}: the publisher and the library
|
|
400
|
+
* helper act on the SAME volume, and two hand-synced copies is two chances for them to disagree
|
|
401
|
+
* about the same three paths. They did — a conversion's `relocate` carefully preserved the
|
|
402
|
+
* developer's `.git` and the `initializeProject` one step later deleted it, removing the only
|
|
403
|
+
* rollback path with nothing failing.
|
|
404
|
+
*
|
|
405
|
+
* The connector's local helper deliberately keeps a DIFFERENT set: it empties a directory the
|
|
406
|
+
* developer owns rather than a volume the platform owns, so `.viable/` and the `.env` files the
|
|
407
|
+
* platform cannot re-derive are in it and `sandbox-meta.json`, which no local project has, is not.
|
|
408
|
+
*/
|
|
409
|
+
export const RELOCATE_ALWAYS_KEEP: readonly string[] = ['.git', 'sandbox-meta.json', HISTORY_FILE]
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* The pipeline alias prefixes a conversion run carries.
|
|
413
|
+
*
|
|
414
|
+
* Two, because a conversion is a platform pipeline that composes library pipelines as steps: the
|
|
415
|
+
* platform's own runs are `vib:project:convert:<stage>` and the library's are `vib:convert:<name>`.
|
|
416
|
+
* Anything filtering progress by pipeline — the browser's thinking journal, the reconciler's run
|
|
417
|
+
* lookup — must match on BOTH, or half of a conversion's progress is invisible.
|
|
418
|
+
*/
|
|
419
|
+
export const CONVERSION_PIPELINE_PREFIXES = ['vib:project:convert:', 'vib:convert:'] as const
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Where a conversion's documents live inside the target project.
|
|
423
|
+
*
|
|
424
|
+
* Under `docs/`, beside the metadata an ordinary project carries, because they are the same kind
|
|
425
|
+
* of thing: markdown the pipeline writes and the next pipeline reads back. They are the ONLY
|
|
426
|
+
* durable record of what the origin was — a purge deletes the origin sources, and after it these
|
|
427
|
+
* documents are what remains.
|
|
428
|
+
*/
|
|
429
|
+
export const CONVERSION_DIR = 'docs/conversion'
|
|
430
|
+
export const CONVERSION_INDEX_FILE = `${CONVERSION_DIR}/README.md`
|
|
431
|
+
export const CONVERSION_INVENTORY_FILE = `${CONVERSION_DIR}/inventory.md`
|
|
432
|
+
export const CONVERSION_STACK_FILE = `${CONVERSION_DIR}/stack.md`
|
|
433
|
+
export const CONVERSION_ARCHITECTURE_FILE = `${CONVERSION_DIR}/architecture.md`
|
|
434
|
+
export const CONVERSION_HARNESS_FILE = `${CONVERSION_DIR}/harness.md`
|
|
435
|
+
export const CONVERSION_TAXONOMY_FILE = `${CONVERSION_DIR}/taxonomy.md`
|
|
436
|
+
export const CONVERSION_PURPOSE_FILE = `${CONVERSION_DIR}/purpose.md`
|
|
437
|
+
export const CONVERSION_DESIGN_FILE = `${CONVERSION_DIR}/design.md`
|
|
438
|
+
export const CONVERSION_ANALYSIS_FILE = `${CONVERSION_DIR}/analysis.md`
|
|
439
|
+
export const CONVERSION_STORY_LIST_FILE = `${CONVERSION_DIR}/story-list.md`
|
|
440
|
+
export const CONVERSION_FLOWS_FILE = `${CONVERSION_DIR}/flows.md`
|
|
441
|
+
export const CONVERSION_AREAS_FILE = `${CONVERSION_DIR}/areas.md`
|
|
442
|
+
export const CONVERSION_SCAFFOLD_FILE = `${CONVERSION_DIR}/scaffold.md`
|
|
443
|
+
export const CONVERSION_STRUCTURE_FILE = `${CONVERSION_DIR}/structure.md`
|
|
444
|
+
export const CONVERSION_ESTIMATE_FILE = `${CONVERSION_DIR}/estimate.md`
|
|
445
|
+
export const CONVERSION_ASSUMPTIONS_FILE = `${CONVERSION_DIR}/assumptions.md`
|
|
446
|
+
export const CONVERSION_INQUIRIES_FILE = `${CONVERSION_DIR}/inquiries.md`
|
|
447
|
+
export const CONVERSION_DUMPS_FILE = `${CONVERSION_DIR}/dumps.md`
|
|
448
|
+
export const CONVERSION_ORIGIN_CARD_FILE = `${CONVERSION_DIR}/origin.md`
|
|
449
|
+
|
|
450
|
+
/** One document per extracted story, named by the platform's story code. */
|
|
451
|
+
export const CONVERSION_STORY_DIR = `${CONVERSION_DIR}/stories`
|
|
452
|
+
/** One document per carried seed file, describing what it is and how to load it. */
|
|
453
|
+
export const CONVERSION_SEED_DIR = `${CONVERSION_DIR}/seed`
|
|
454
|
+
/** The carried seed data itself, beside its description. */
|
|
455
|
+
export const CONVERSION_SEED_DATA_DIR = `${CONVERSION_SEED_DIR}/data`
|
|
456
|
+
|
|
457
|
+
export const conversionStoryDoc = (code: string): string => `${CONVERSION_STORY_DIR}/${code}.md`
|
|
458
|
+
export const conversionSeedDoc = (name: string): string => `${CONVERSION_SEED_DIR}/${name}.md`
|
|
459
|
+
export const conversionSeedData = (name: string, ext: string): string =>
|
|
460
|
+
`${CONVERSION_SEED_DATA_DIR}/${name}.${ext}`
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* The two agent-memory nodes a conversion writes into the TARGET's own harness.
|
|
464
|
+
*
|
|
465
|
+
* Flat files, not a directory: the target's agent-memory harness states that the graph structure
|
|
466
|
+
* lives in scopes and wiki-links rather than in subdirectories, and that harness is read by the
|
|
467
|
+
* user's own agents inside the slot.
|
|
468
|
+
*/
|
|
469
|
+
export const CONVERSION_MEMORY_FILE = '.agents/memory/conversion.md'
|
|
470
|
+
export const CONVERSION_ORIGIN_MAP_FILE = '.agents/memory/conversion-origin.md'
|
|
471
|
+
|
|
472
|
+
/** Every FIXED conversion document. The per-story and per-seed ones are named by their helpers. */
|
|
473
|
+
export const CONVERSION_DOCS: readonly string[] = [
|
|
474
|
+
CONVERSION_INDEX_FILE,
|
|
475
|
+
CONVERSION_INVENTORY_FILE,
|
|
476
|
+
CONVERSION_STACK_FILE,
|
|
477
|
+
CONVERSION_ARCHITECTURE_FILE,
|
|
478
|
+
CONVERSION_HARNESS_FILE,
|
|
479
|
+
CONVERSION_TAXONOMY_FILE,
|
|
480
|
+
CONVERSION_PURPOSE_FILE,
|
|
481
|
+
CONVERSION_DESIGN_FILE,
|
|
482
|
+
CONVERSION_ANALYSIS_FILE,
|
|
483
|
+
CONVERSION_STORY_LIST_FILE,
|
|
484
|
+
CONVERSION_FLOWS_FILE,
|
|
485
|
+
CONVERSION_AREAS_FILE,
|
|
486
|
+
CONVERSION_SCAFFOLD_FILE,
|
|
487
|
+
CONVERSION_STRUCTURE_FILE,
|
|
488
|
+
CONVERSION_ESTIMATE_FILE,
|
|
489
|
+
CONVERSION_ASSUMPTIONS_FILE,
|
|
490
|
+
CONVERSION_INQUIRIES_FILE,
|
|
491
|
+
CONVERSION_DUMPS_FILE,
|
|
492
|
+
CONVERSION_ORIGIN_CARD_FILE,
|
|
493
|
+
]
|
|
494
|
+
|
|
495
|
+
/** The memory nodes a conversion owns in the target's harness. */
|
|
496
|
+
export const CONVERSION_MEMORY: readonly string[] = [
|
|
497
|
+
CONVERSION_MEMORY_FILE, CONVERSION_ORIGIN_MAP_FILE,
|
|
498
|
+
]
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Everything a conversion OWNS on the volume — the documents and the two memory nodes.
|
|
502
|
+
*
|
|
503
|
+
* One list, because two consumers must agree about it and each of them is a wipe: the relocation
|
|
504
|
+
* keeps these at the root when it files the origin away, and the initialization one step later
|
|
505
|
+
* must leave the same set alone. A conversion writes its taxonomy, its restored specification and
|
|
506
|
+
* its per-story proofs BEFORE the target exists — the analysis is what decides there is a target
|
|
507
|
+
* worth laying down — so a second, hand-kept copy of this list is a document that survives the
|
|
508
|
+
* relocation and not the install, which is hours of model calls thrown away with nothing failing.
|
|
509
|
+
*/
|
|
510
|
+
export const CONVERSION_ARTIFACTS: readonly string[] = [
|
|
511
|
+
CONVERSION_DIR, ...CONVERSION_MEMORY,
|
|
512
|
+
]
|
|
513
|
+
|
|
514
|
+
/** The frontmatter version every conversion document carries, so a reader can refuse an old one. */
|
|
515
|
+
export const CONVERSION_DOC_VERSION = 1
|
|
516
|
+
|
|
517
|
+
// --- budgets ------------------------------------------------------------------------------
|
|
518
|
+
//
|
|
519
|
+
// Every one of these bounds something an origin controls the size of. An origin is a repository a
|
|
520
|
+
// stranger wrote: it may hold a hundred thousand files, a gigabyte of exports, or one minified
|
|
521
|
+
// bundle. A pass with no ceiling is a pass whose cost and duration are set by the input rather
|
|
522
|
+
// than by the platform, which is how a conversion of a large monorepo becomes an unbounded bill.
|
|
523
|
+
|
|
524
|
+
/** Entries the census walks before it stops and reports itself truncated. */
|
|
525
|
+
export const CENSUS_MAX_ENTRIES = 20_000
|
|
526
|
+
/** Files the census opens. Everything else is classified from its path and its size alone. */
|
|
527
|
+
export const CENSUS_READ_FILES = 400
|
|
528
|
+
/** Total bytes the census reads across those files. */
|
|
529
|
+
export const CENSUS_READ_BYTES = 6_000_000
|
|
530
|
+
/** Bytes read from the head of one file — enough to classify it, never enough to hold it. */
|
|
531
|
+
export const CENSUS_HEAD_BYTES = 4096
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* The most one `readHead` may allocate, whatever the caller asked for.
|
|
535
|
+
*
|
|
536
|
+
* A head is read to CLASSIFY a file — the census reads {@link CENSUS_HEAD_BYTES} of it, a dump
|
|
537
|
+
* sample four times that — so a caller asking for megabytes has misunderstood the command rather
|
|
538
|
+
* than needed them, and honouring it would allocate that much before the read, inside a slot pod
|
|
539
|
+
* or on a developer's machine, for a file that may be shorter than the request.
|
|
540
|
+
*/
|
|
541
|
+
export const CENSUS_MAX_HEAD_BYTES = 1_048_576
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* How much of a file is read to decide whether it is binary.
|
|
545
|
+
*
|
|
546
|
+
* Smaller than {@link CENSUS_HEAD_BYTES} because the question is smaller: a NUL byte near the
|
|
547
|
+
* beginning, which is git's own heuristic and the one signal that separates bytes a model can be
|
|
548
|
+
* handed from bytes that would arrive as replacement characters.
|
|
549
|
+
*/
|
|
550
|
+
export const BINARY_PROBE_BYTES = 512
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Directories a census walk never descends into.
|
|
554
|
+
*
|
|
555
|
+
* ONE constant, spread by the library-local helper, the publisher and the connector SDK executor,
|
|
556
|
+
* because the three of them answer the SAME question about the same tree and a caller cannot tell
|
|
557
|
+
* which one produced the listing it is holding — so a directory skipped by one and walked by
|
|
558
|
+
* another means one repository has two different `total`s.
|
|
559
|
+
*
|
|
560
|
+
* Deliberately not {@link SOURCE_LIST_EXCLUSIONS}: a census is asked what the tree HOLDS, so it
|
|
561
|
+
* reports the metadata and the converted origin that a coder's source listing hides. What it must
|
|
562
|
+
* never walk is what a package manager or a build put there, and only `node_modules` and `.git`
|
|
563
|
+
* are that in every repository — `dist`, `build` and `.next` are ordinary directory names an
|
|
564
|
+
* origin may keep sources in, and skipping them silently subtracted files from the census of a
|
|
565
|
+
* repository nobody here wrote.
|
|
566
|
+
*/
|
|
567
|
+
export const CENSUS_SKIP_DIRS: readonly string[] = ['node_modules', '.git']
|
|
568
|
+
|
|
569
|
+
/** The upper bounds of every {@link SizeClass} but `Huge`, which is everything above the last. */
|
|
570
|
+
export const SIZE_CLASS_BOUNDS: Record<Exclude<SizeClass, SizeClass.Huge>, number> = {
|
|
571
|
+
[SizeClass.Tiny]: 2_048,
|
|
572
|
+
[SizeClass.Small]: 32_768,
|
|
573
|
+
[SizeClass.Medium]: 262_144,
|
|
574
|
+
[SizeClass.Large]: 2_097_152,
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/** Above this a data file is a {@link DumpKind.Bulk} export, never a seed the target carries. */
|
|
578
|
+
export const SEED_MAX_BYTES = 262_144
|
|
579
|
+
/** Bytes read from a dump to describe it. */
|
|
580
|
+
export const DUMP_SAMPLE_BYTES = 16_384
|
|
581
|
+
/** Lines of that sample kept in the document. */
|
|
582
|
+
export const DUMP_SAMPLE_LINES = 20
|
|
583
|
+
/** At or above this, a data file is reported as a bulk export even where its path looks like seed. */
|
|
584
|
+
export const BULK_DUMP_MIN_BYTES = 1_000_000
|
|
585
|
+
/** Distinct extensions reported in the inventory document. */
|
|
586
|
+
export const TOP_EXTENSIONS = 30
|
|
587
|
+
|
|
588
|
+
/** Files one taxonomy layer samples, and the characters those samples may total. */
|
|
589
|
+
export const TAXONOMY_SAMPLE_FILES = 60
|
|
590
|
+
export const TAXONOMY_SAMPLE_CHARS = 120_000
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* The ceiling on the origin card — the standing description of the origin every coder prompt
|
|
594
|
+
* carries once a conversion has produced one.
|
|
595
|
+
*
|
|
596
|
+
* It rides on EVERY generation call of the implementation stage, so its size is multiplied by the
|
|
597
|
+
* number of calls a conversion makes. Enforced by truncation after the card is composed, never by
|
|
598
|
+
* asking a model to obey a limit.
|
|
599
|
+
*/
|
|
600
|
+
export const ORIGIN_CARD_MAX_CHARS = 6000
|
|
601
|
+
/** The ceiling on one stack's skill pack, for the same reason. */
|
|
602
|
+
export const STACK_PACK_MAX_CHARS = 2400
|
|
603
|
+
|
|
604
|
+
/** The estimator's crude token conversion, and the input it assumes it reads of a source tree. */
|
|
605
|
+
export const CHARS_PER_TOKEN = 4
|
|
606
|
+
export const SOURCE_SAMPLE_RATIO = 0.35
|
|
607
|
+
/** What the estimator adds for the retries a model pass normally makes. */
|
|
608
|
+
export const RETRY_FACTOR = 1.15
|
|
609
|
+
export const ESTIMATE_VERSION = 1
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* The per-story price band shown before the implementation stage starts.
|
|
613
|
+
*
|
|
614
|
+
* A BAND and not a number: a story's cost is set by how much code it turns out to need, which is
|
|
615
|
+
* exactly what nothing knows before it is written. Shown with a disclaimer saying so.
|
|
616
|
+
*/
|
|
617
|
+
export const STORY_BAND_MIN_USD = 2
|
|
618
|
+
export const STORY_BAND_MAX_USD = 5
|
|
619
|
+
|
|
620
|
+
/** Below this, a purpose inference is reported as a guess and the user is asked to confirm it. */
|
|
621
|
+
export const PURPOSE_CONFIDENCE_FLOOR = 0.4
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* The ceiling on an inquiry answer stored in a PIPELINE STATE.
|
|
625
|
+
*
|
|
626
|
+
* Pipeline state is keys, not content: a run's state is written back at every step boundary and a
|
|
627
|
+
* couple of long free-text answers is all it takes to stop that being true. The answer's full text
|
|
628
|
+
* goes to `docs/conversion/inquiries.md`, keyed by the inquiry id, and the state keeps a scalar.
|
|
629
|
+
*
|
|
630
|
+
* ONE ceiling for the whole stack, exactly as {@link CONNECT_INQUIRY_MAX_TEXT} is: the twin is
|
|
631
|
+
* `INQUIRY_STATE_TEXT_CHARS` in `@owlmeans/llm-common`, and the two must stay equal. The runtime
|
|
632
|
+
* truncates with its own copy and this package's documents are written against this one, so a
|
|
633
|
+
* disagreement means a state saying one thing and the document beside it saying another.
|
|
634
|
+
*/
|
|
635
|
+
export const INQUIRY_STATE_TEXT_CHARS = 200
|
|
636
|
+
|
|
637
|
+
/** The ceiling on an error message recorded on the conversion record. */
|
|
638
|
+
export const CONVERSION_ERROR_CAP = 500
|
|
639
|
+
/** Assumptions kept on the conversion record; the rest live in `docs/conversion/assumptions.md`. */
|
|
640
|
+
export const CONVERSION_ASSUMPTION_CAP = 40
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* How deep intake clones an origin repository.
|
|
644
|
+
*
|
|
645
|
+
* One commit. A conversion reads the tree as it is now and has no use for its history, and a full
|
|
646
|
+
* clone of a long-lived repository is minutes of network and a volume's worth of pack files.
|
|
647
|
+
*/
|
|
648
|
+
export const CONVERT_CLONE_DEPTH = 1
|
|
649
|
+
|
|
650
|
+
/** The stages in order. The single source for {@link canEnter} and the stage ladder. */
|
|
651
|
+
export const CONVERSION_STAGE_ORDER: ConversionStage[] = [
|
|
652
|
+
ConversionStage.Intake,
|
|
653
|
+
ConversionStage.Analysis,
|
|
654
|
+
ConversionStage.Extraction,
|
|
655
|
+
ConversionStage.Implementation,
|
|
656
|
+
]
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* The inquiry ids a conversion can ask under.
|
|
660
|
+
*
|
|
661
|
+
* Stable strings, because an answer is recorded against one and re-read on a resume: renaming an
|
|
662
|
+
* id orphans every answer already given under it.
|
|
663
|
+
*/
|
|
664
|
+
export const CONVERSION_INQUIRY = {
|
|
665
|
+
workspaceUnlinked: 'convert.workspace.unlinked',
|
|
666
|
+
seedCarry: 'convert.seed.carry',
|
|
667
|
+
verdictLimited: 'convert.verdict.limited',
|
|
668
|
+
purposeConfirm: 'convert.purpose.confirm',
|
|
669
|
+
caseConfirm: 'convert.case.confirm',
|
|
670
|
+
areasMap: 'convert.areas.map',
|
|
671
|
+
originRelocate: 'convert.origin.relocate',
|
|
672
|
+
} as const
|