@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,376 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The slot command vocabulary — what one process asks another to do to a target project's tree.
|
|
3
|
+
*
|
|
4
|
+
* It lives here, beside the target-shape manifest and the metadata layout, because THREE
|
|
5
|
+
* independent executors answer it and none of them owns it: the publisher inside an ephemeral or
|
|
6
|
+
* production pod, the agent's remote helper that speaks to that publisher, and the connector SDK
|
|
7
|
+
* that executes the same commands on a developer's own machine. A vocabulary owned by one of them
|
|
8
|
+
* is a vocabulary the other two copy, and a copied enum drifts silently — the last time a role
|
|
9
|
+
* vocabulary was duplicated, one copy answered `common` for every role the other had added and
|
|
10
|
+
* type checks ran against the wrong package with nothing failing.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Which workload a slot record describes.
|
|
14
|
+
*
|
|
15
|
+
* `Ephemeral` is the live-preview pod (publisher + one-shot builds + SSE reload), `Production`
|
|
16
|
+
* the hardened pod that serves real end users from prebuilt artifacts, and `Local` a target
|
|
17
|
+
* project that lives on a developer's own machine and has no pod at all — its file, shell and git
|
|
18
|
+
* commands are executed by the connector on that machine, and nothing about it is provisioned,
|
|
19
|
+
* routed, reconciled or published.
|
|
20
|
+
*/
|
|
21
|
+
export var WorkloadKind;
|
|
22
|
+
(function (WorkloadKind) {
|
|
23
|
+
WorkloadKind["Ephemeral"] = "ephemeral";
|
|
24
|
+
WorkloadKind["Production"] = "production";
|
|
25
|
+
/**
|
|
26
|
+
* The target project is on the user's disk, reached through a connector session.
|
|
27
|
+
*
|
|
28
|
+
* A slot record still exists — it is what carries the project's slug, its OIDC client and its
|
|
29
|
+
* configuration — but it owns no namespace, no volume, no hostname and no certificate. Every
|
|
30
|
+
* cloud-only operation (run/stop/restart the sandbox, publish, push to a remote, watch files)
|
|
31
|
+
* refuses for it rather than half-working.
|
|
32
|
+
*/
|
|
33
|
+
WorkloadKind["Local"] = "local";
|
|
34
|
+
})(WorkloadKind || (WorkloadKind = {}));
|
|
35
|
+
export var SlotCommandType;
|
|
36
|
+
(function (SlotCommandType) {
|
|
37
|
+
SlotCommandType["Files"] = "files";
|
|
38
|
+
SlotCommandType["Shell"] = "shell";
|
|
39
|
+
SlotCommandType["Git"] = "git";
|
|
40
|
+
})(SlotCommandType || (SlotCommandType = {}));
|
|
41
|
+
export var SlotGitCommand;
|
|
42
|
+
(function (SlotGitCommand) {
|
|
43
|
+
SlotGitCommand["Ensure"] = "ensure";
|
|
44
|
+
/**
|
|
45
|
+
* Bring a remote repository's tree onto a volume that already exists.
|
|
46
|
+
*
|
|
47
|
+
* NOT `git clone`: a slot's directory is never empty — provisioning leaves its own metadata
|
|
48
|
+
* there — and `git clone` refuses a non-empty destination. The executor therefore initializes,
|
|
49
|
+
* adds the remote, fetches at a bounded depth and checks the branch out over the tree.
|
|
50
|
+
*/
|
|
51
|
+
SlotGitCommand["Clone"] = "clone";
|
|
52
|
+
SlotGitCommand["Status"] = "status";
|
|
53
|
+
SlotGitCommand["Commit"] = "commit";
|
|
54
|
+
SlotGitCommand["Log"] = "log";
|
|
55
|
+
SlotGitCommand["Discard"] = "discard";
|
|
56
|
+
SlotGitCommand["RevertTo"] = "revertTo";
|
|
57
|
+
SlotGitCommand["SetRemote"] = "setRemote";
|
|
58
|
+
SlotGitCommand["Push"] = "push";
|
|
59
|
+
SlotGitCommand["Pull"] = "pull";
|
|
60
|
+
})(SlotGitCommand || (SlotGitCommand = {}));
|
|
61
|
+
export var SlotFileCommand;
|
|
62
|
+
(function (SlotFileCommand) {
|
|
63
|
+
SlotFileCommand["EmptyProject"] = "emptyProject";
|
|
64
|
+
SlotFileCommand["DeleteProject"] = "deleteProject";
|
|
65
|
+
SlotFileCommand["InitializeProject"] = "initializeProject";
|
|
66
|
+
SlotFileCommand["GetSourceList"] = "getSourceList";
|
|
67
|
+
SlotFileCommand["GetStructuredList"] = "getStructuredList";
|
|
68
|
+
SlotFileCommand["ReadFile"] = "readFile";
|
|
69
|
+
SlotFileCommand["ReadSource"] = "readSource";
|
|
70
|
+
SlotFileCommand["ReadPossibleSource"] = "readPossibleSource";
|
|
71
|
+
SlotFileCommand["ReadSources"] = "readSources";
|
|
72
|
+
SlotFileCommand["WriteFile"] = "writeFile";
|
|
73
|
+
SlotFileCommand["WriteSource"] = "writeSource";
|
|
74
|
+
SlotFileCommand["DeleteFile"] = "deleteFile";
|
|
75
|
+
SlotFileCommand["FindFilesWithEnvVars"] = "findFilesWithEnvVars";
|
|
76
|
+
SlotFileCommand["GetRootPath"] = "getRootPath";
|
|
77
|
+
/**
|
|
78
|
+
* List a tree with a size and a binary flag per entry, bounded by a caller-given limit.
|
|
79
|
+
*
|
|
80
|
+
* The reason it exists rather than being composed out of {@link SlotFileCommand.GetSourceList}
|
|
81
|
+
* plus a read per file: a foreign repository can hold a hundred thousand files, and one round
|
|
82
|
+
* trip each — over a signed HTTP call to a pod, or over a connector on somebody's laptop — is
|
|
83
|
+
* not a slower version of the same thing, it is a walk that never finishes.
|
|
84
|
+
*/
|
|
85
|
+
SlotFileCommand["StatTree"] = "statTree";
|
|
86
|
+
/**
|
|
87
|
+
* Read the first N bytes of one file.
|
|
88
|
+
*
|
|
89
|
+
* A census classifies a file from its head; reading whole files to do it would hold a 1 MB
|
|
90
|
+
* export in memory to look at its first line. The answer is text, so a binary head comes back
|
|
91
|
+
* as whatever decoding produced — which is exactly the signal the entropy classification wants.
|
|
92
|
+
*/
|
|
93
|
+
SlotFileCommand["ReadHead"] = "readHead";
|
|
94
|
+
/**
|
|
95
|
+
* Move everything in the project root into a subdirectory, keeping a named few in place.
|
|
96
|
+
*
|
|
97
|
+
* One command rather than a listing plus a move per file, because it must be ATOMIC from the
|
|
98
|
+
* caller's point of view: a relocation interrupted half way leaves a tree that is neither the
|
|
99
|
+
* origin nor a target, and nothing downstream can tell which files already moved. Binary-safe —
|
|
100
|
+
* it moves paths and never reads contents.
|
|
101
|
+
*/
|
|
102
|
+
SlotFileCommand["Relocate"] = "relocate";
|
|
103
|
+
/** Delete a directory and everything under it. The purge of a relocated origin. */
|
|
104
|
+
SlotFileCommand["RemoveTree"] = "removeTree";
|
|
105
|
+
})(SlotFileCommand || (SlotFileCommand = {}));
|
|
106
|
+
export var SlotShellCommand;
|
|
107
|
+
(function (SlotShellCommand) {
|
|
108
|
+
SlotShellCommand["Bun"] = "bun";
|
|
109
|
+
/**
|
|
110
|
+
* Re-resolve every dependency from scratch, then install.
|
|
111
|
+
*
|
|
112
|
+
* NOT `bun install` — that reproduces the lockfile, which is the whole problem. A target's
|
|
113
|
+
* `@owlmeans/*` ranges are carets, but its lockfile was written once at project init and pins
|
|
114
|
+
* the versions that were current that day; a republished framework fix therefore never reaches
|
|
115
|
+
* a slot that already exists, however many times it is rebuilt. Truncating the lockfile first
|
|
116
|
+
* is what project initialization does, so a reinstalled slot converges on the dependency state
|
|
117
|
+
* a freshly created one would have.
|
|
118
|
+
*
|
|
119
|
+
* It is deliberately NOT part of {@link SlotShellCommand.Build}: that runs after every agent
|
|
120
|
+
* file write and has to stay seconds long. This is minutes, and only a user asking for it.
|
|
121
|
+
*/
|
|
122
|
+
SlotShellCommand["Reinstall"] = "reinstall";
|
|
123
|
+
SlotShellCommand["BuildCommon"] = "buildCommon";
|
|
124
|
+
SlotShellCommand["Validate"] = "validate";
|
|
125
|
+
SlotShellCommand["ValidateWithRenderer"] = "validateWithRenderer";
|
|
126
|
+
SlotShellCommand["Build"] = "build";
|
|
127
|
+
/**
|
|
128
|
+
* Reconcile the target's database with its code.
|
|
129
|
+
*
|
|
130
|
+
* The target owns its own structure: every `@owlmeans/postgres` resource creates and updates its
|
|
131
|
+
* table while the OwlMeans context initializes. So a sync is not a command run against the source
|
|
132
|
+
* tree — it is *bootstrap the role/database if needed, then restart the backend* and report
|
|
133
|
+
* whatever DDL or migration error the boot produced. There is nothing to generate and no
|
|
134
|
+
* migration file to apply.
|
|
135
|
+
*/
|
|
136
|
+
SlotShellCommand["DbSync"] = "dbSync";
|
|
137
|
+
/** Rollup-build the backend only — the type check the frontend renderer build cannot give it. */
|
|
138
|
+
SlotShellCommand["ValidateBackend"] = "validateBackend";
|
|
139
|
+
/**
|
|
140
|
+
* Boot the target backend for real, in isolation, and report why it failed.
|
|
141
|
+
*
|
|
142
|
+
* A foreign key that names a resource nothing registers, a service alias nobody provides, a
|
|
143
|
+
* context that wedges on init — none of it is visible to `tsc`, and all of it kills the app at
|
|
144
|
+
* startup. The check runs a SECOND backend process on its own port against a scratch schema,
|
|
145
|
+
* reads the target's own health verdict and kills it again, so the serving backend and the
|
|
146
|
+
* live preview are untouched.
|
|
147
|
+
*
|
|
148
|
+
* The command STARTS the check and returns immediately (`{ result: null, started: true }`);
|
|
149
|
+
* the verdict is read with {@link SlotShellCommand.BootCheckStatus}. A boot is minutes of
|
|
150
|
+
* build + startup, and holding one HTTP request open for it made a slot fault indistinguishable
|
|
151
|
+
* from a hung agent for the whole of the caller's timeout. A second start while one runs joins
|
|
152
|
+
* the running check rather than spawning another instance onto the port.
|
|
153
|
+
*/
|
|
154
|
+
SlotShellCommand["BootCheck"] = "bootCheck";
|
|
155
|
+
/**
|
|
156
|
+
* Report the boot check started by {@link SlotShellCommand.BootCheck}:
|
|
157
|
+
* `{ running, startedAt, report }`. `report` is the last completed verdict, so a poll that
|
|
158
|
+
* arrives after completion still gets the answer.
|
|
159
|
+
*/
|
|
160
|
+
SlotShellCommand["BootCheckStatus"] = "bootCheckStatus";
|
|
161
|
+
/**
|
|
162
|
+
* Report whether the sandbox still holds the generated application.
|
|
163
|
+
*
|
|
164
|
+
* Structural, cheap and model-free: a handful of file reads checked against
|
|
165
|
+
* `TARGET_INTEGRITY_FILES`. It exists as a command because the publisher is the only process
|
|
166
|
+
* with the volume in front of it, and the agent needs the same answer before it lets a git
|
|
167
|
+
* merge reach a build. The publisher enforces the manifest on its own before every spawn
|
|
168
|
+
* regardless — this command is how a caller asks first rather than finding out from a
|
|
169
|
+
* failed build.
|
|
170
|
+
*/
|
|
171
|
+
SlotShellCommand["Integrity"] = "integrity";
|
|
172
|
+
})(SlotShellCommand || (SlotShellCommand = {}));
|
|
173
|
+
/**
|
|
174
|
+
* A ROLE in the target project, as it travels on the wire.
|
|
175
|
+
*
|
|
176
|
+
* Not a directory name. A role is resolved to a directory per LAYOUT (see `./layout.js`); nothing
|
|
177
|
+
* may join these values onto a path.
|
|
178
|
+
*
|
|
179
|
+
* Two generations of vocabulary live here at once, and both arrive over the wire. `Frontend` and
|
|
180
|
+
* `Backend` are v1's names — "the browser side" and "the server side" — and every already-published
|
|
181
|
+
* slot still speaks them. `Api`, `Web` and `Worker` are what the current agent library sends, and
|
|
182
|
+
* `Backend` means something DIFFERENT to it: v2 split the server in two, so `backend` is the shared
|
|
183
|
+
* library that `api` and `worker` compile against, and `api` is the HTTP server. That is why the
|
|
184
|
+
* mapping is per-layout rather than a rename.
|
|
185
|
+
*
|
|
186
|
+
* Every value any sender can produce must be a member. It was the three v1 names alone while the
|
|
187
|
+
* library had already moved to five, and the role→directory fall-through then answered `common`
|
|
188
|
+
* for `api`, `web` and `worker` alike — so a type check ran against the shared package instead of
|
|
189
|
+
* the one under repair. Nothing failed; the answers were simply about another package.
|
|
190
|
+
*/
|
|
191
|
+
export var SubProject;
|
|
192
|
+
(function (SubProject) {
|
|
193
|
+
SubProject["Common"] = "common";
|
|
194
|
+
/** v1: the browser app. v2 sends {@link Web} instead; kept because old slots still send this. */
|
|
195
|
+
SubProject["Frontend"] = "frontend";
|
|
196
|
+
/** v1: the HTTP server. v2: the shared library `api` and `worker` are built against. */
|
|
197
|
+
SubProject["Backend"] = "backend";
|
|
198
|
+
/** v2: the HTTP server. */
|
|
199
|
+
SubProject["Api"] = "api";
|
|
200
|
+
/** v2: the browser app. */
|
|
201
|
+
SubProject["Web"] = "web";
|
|
202
|
+
/** v2: the queue consumer. */
|
|
203
|
+
SubProject["Worker"] = "worker";
|
|
204
|
+
})(SubProject || (SubProject = {}));
|
|
205
|
+
/**
|
|
206
|
+
* The ports a generated target binds, and the marker that tells its two identical processes apart.
|
|
207
|
+
*
|
|
208
|
+
* They are contract, not preference: the publisher composes the pod's environment from them, the
|
|
209
|
+
* connector composes a local `.env` from the same values, and the target's own configuration reads
|
|
210
|
+
* them back. A local run and a slot run therefore address the app the same way.
|
|
211
|
+
*/
|
|
212
|
+
export const TARGET_API_PORT = 3000;
|
|
213
|
+
export const TARGET_WEB_PORT = 5173;
|
|
214
|
+
export const TARGET_WORKER_PORT = 3003;
|
|
215
|
+
export const TARGET_API_BASE = 'api';
|
|
216
|
+
/** The argv marker separating the worker process from the api's — both run the same `dist/index.js`. */
|
|
217
|
+
export const TARGET_WORKER_MARKER = '--viable-worker';
|
|
218
|
+
/**
|
|
219
|
+
* The api's own marker, so a leftover can be told from the worker and the boot check.
|
|
220
|
+
*
|
|
221
|
+
* All three run `bun dist/index.js`, and reclaiming a port by that alone would kill whichever of
|
|
222
|
+
* them happened to match. Only a LOCAL run passes it — in a pod the process is the container's and
|
|
223
|
+
* a restart is Kubernetes's business.
|
|
224
|
+
*/
|
|
225
|
+
export const TARGET_API_MARKER = '--viable-api';
|
|
226
|
+
/** Port and schema the isolated boot check uses, so it never touches the serving backend. */
|
|
227
|
+
export const TARGET_BOOTCHECK_PORT = 3100;
|
|
228
|
+
export const TARGET_BOOTCHECK_SCHEMA = 'bootcheck';
|
|
229
|
+
export const TARGET_BOOTCHECK_MARKER = '--viable-boot-check';
|
|
230
|
+
/**
|
|
231
|
+
* The address a LOCAL target answers at.
|
|
232
|
+
*
|
|
233
|
+
* Stored on the slot record as `host` at creation and read back from there by everything that
|
|
234
|
+
* routes, redirects or previews — never recomposed. A local slot's origin is `http://` because it
|
|
235
|
+
* is a loopback address; every other slot kind is `https://`.
|
|
236
|
+
*/
|
|
237
|
+
export const LOCAL_SLOT_HOST = `localhost:${TARGET_WEB_PORT}`;
|
|
238
|
+
/**
|
|
239
|
+
* EXECUTOR-side ceilings: how long the process holding the tree may spend on one command.
|
|
240
|
+
*
|
|
241
|
+
* Applied by whoever actually runs the command — the publisher in a pod, the connector on a
|
|
242
|
+
* developer's machine — so a wedged build fails the request instead of holding it open forever.
|
|
243
|
+
*/
|
|
244
|
+
export const COMMAND_DEADLINES = {
|
|
245
|
+
[SlotShellCommand.Build]: 360_000,
|
|
246
|
+
[SlotShellCommand.Validate]: 360_000,
|
|
247
|
+
[SlotShellCommand.ValidateWithRenderer]: 360_000,
|
|
248
|
+
[SlotShellCommand.ValidateBackend]: 360_000,
|
|
249
|
+
[SlotShellCommand.BuildCommon]: 360_000,
|
|
250
|
+
[SlotShellCommand.BootCheck]: 30_000,
|
|
251
|
+
[SlotShellCommand.BootCheckStatus]: 10_000,
|
|
252
|
+
[SlotShellCommand.DbSync]: 120_000,
|
|
253
|
+
[SlotShellCommand.Bun]: 600_000,
|
|
254
|
+
// A full re-resolve fetches every dependency again, with nothing left in the lockfile to
|
|
255
|
+
// shortcut it — measurably longer than the incremental install `Bun` covers.
|
|
256
|
+
[SlotShellCommand.Reinstall]: 900_000,
|
|
257
|
+
// Eighteen file reads and a list of string comparisons. Anything slower than this means the
|
|
258
|
+
// volume itself is not answering, which is not something a longer wait improves.
|
|
259
|
+
[SlotShellCommand.Integrity]: 15_000,
|
|
260
|
+
};
|
|
261
|
+
export const DEFAULT_COMMAND_DEADLINE = 60_000;
|
|
262
|
+
/**
|
|
263
|
+
* EXECUTOR-side ceilings for the git commands whose real duration is not a git command's.
|
|
264
|
+
*
|
|
265
|
+
* Everything git does inside a slot is local and takes seconds — except a clone, which is a
|
|
266
|
+
* network fetch of somebody else's repository and is measured in minutes. Bounding it by the
|
|
267
|
+
* generic git deadline made a conversion's very first step fail on any repository large enough
|
|
268
|
+
* to be worth converting.
|
|
269
|
+
*/
|
|
270
|
+
export const GIT_COMMAND_DEADLINES = {
|
|
271
|
+
[SlotGitCommand.Clone]: 600_000,
|
|
272
|
+
};
|
|
273
|
+
/** What every other git command gets. The value the type-level branch used to hard-code. */
|
|
274
|
+
export const DEFAULT_GIT_COMMAND_DEADLINE = 60_000;
|
|
275
|
+
/**
|
|
276
|
+
* EXECUTOR-side ceilings for the file commands that walk or move a whole tree.
|
|
277
|
+
*
|
|
278
|
+
* The other file commands are one path each and finish in milliseconds; these three are bounded
|
|
279
|
+
* by how big the tree is, which for an origin project is set by whoever wrote it.
|
|
280
|
+
*/
|
|
281
|
+
export const FILE_COMMAND_DEADLINES = {
|
|
282
|
+
[SlotFileCommand.StatTree]: 120_000,
|
|
283
|
+
[SlotFileCommand.Relocate]: 300_000,
|
|
284
|
+
[SlotFileCommand.RemoveTree]: 120_000,
|
|
285
|
+
[SlotFileCommand.ReadHead]: 30_000,
|
|
286
|
+
};
|
|
287
|
+
/** What every other file command gets. The value the type-level branch used to hard-code. */
|
|
288
|
+
export const DEFAULT_FILE_COMMAND_DEADLINE = 30_000;
|
|
289
|
+
/**
|
|
290
|
+
* CALLER-side ceilings per command type: how long the asker waits for an answer.
|
|
291
|
+
*
|
|
292
|
+
* Deliberately separate from {@link COMMAND_DEADLINES} and deliberately larger — the caller's
|
|
293
|
+
* bound must outlast the executor's, or a command that failed cleanly inside its own deadline
|
|
294
|
+
* reaches the caller as a timeout and the real reason is lost.
|
|
295
|
+
*/
|
|
296
|
+
export const COMMAND_TIMEOUTS = {
|
|
297
|
+
[SlotCommandType.Files]: 60_000,
|
|
298
|
+
[SlotCommandType.Git]: 120_000,
|
|
299
|
+
[SlotCommandType.Shell]: 1_200_000,
|
|
300
|
+
};
|
|
301
|
+
export const DEFAULT_COMMAND_TIMEOUT = 60_000;
|
|
302
|
+
/**
|
|
303
|
+
* Per-COMMAND caller ceilings, for the shell commands whose real duration is known.
|
|
304
|
+
*
|
|
305
|
+
* The type-level ceiling has to cover `bun install`, so every shell command inherited twenty
|
|
306
|
+
* minutes — including a boot check the executor itself caps at eight, and a build it caps at
|
|
307
|
+
* five. When one of them wedged, the caller waited out the twenty regardless, and the story it
|
|
308
|
+
* belonged to sat frozen for the whole of it. A command with a known duration gets a bound close
|
|
309
|
+
* to that duration; anything not listed keeps the generous type default, which is what an
|
|
310
|
+
* install still needs.
|
|
311
|
+
*/
|
|
312
|
+
export const SHELL_COMMAND_TIMEOUTS = {
|
|
313
|
+
[SlotShellCommand.BootCheck]: 45_000, // starts the job and returns
|
|
314
|
+
[SlotShellCommand.BootCheckStatus]: 15_000, // one status read
|
|
315
|
+
[SlotShellCommand.Build]: 380_000, // executor BUILD_TIMEOUT (300s) + margin
|
|
316
|
+
[SlotShellCommand.Validate]: 380_000,
|
|
317
|
+
[SlotShellCommand.ValidateWithRenderer]: 380_000,
|
|
318
|
+
[SlotShellCommand.ValidateBackend]: 380_000,
|
|
319
|
+
[SlotShellCommand.BuildCommon]: 380_000,
|
|
320
|
+
[SlotShellCommand.DbSync]: 130_000,
|
|
321
|
+
[SlotShellCommand.Reinstall]: 920_000, // executor deadline (900s) + margin
|
|
322
|
+
[SlotShellCommand.Integrity]: 25_000, // executor deadline (15s) + margin
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Per-COMMAND caller ceilings for git and for files.
|
|
326
|
+
*
|
|
327
|
+
* Each is its executor deadline plus the same 40 s margin: the caller's bound must outlast the
|
|
328
|
+
* executor's, or a command that failed cleanly inside its own deadline reaches the caller as a
|
|
329
|
+
* timeout and the real reason — the one the executor took the trouble to produce — is lost.
|
|
330
|
+
*/
|
|
331
|
+
export const GIT_COMMAND_TIMEOUTS = {
|
|
332
|
+
[SlotGitCommand.Clone]: 640_000,
|
|
333
|
+
};
|
|
334
|
+
export const FILE_COMMAND_TIMEOUTS = {
|
|
335
|
+
[SlotFileCommand.StatTree]: 160_000,
|
|
336
|
+
[SlotFileCommand.Relocate]: 340_000,
|
|
337
|
+
[SlotFileCommand.RemoveTree]: 160_000,
|
|
338
|
+
[SlotFileCommand.ReadHead]: 70_000,
|
|
339
|
+
};
|
|
340
|
+
/** The per-command caller bound for one command, or nothing where its type's default is right. */
|
|
341
|
+
const perCommandTimeout = (type, command) => {
|
|
342
|
+
switch (type) {
|
|
343
|
+
case SlotCommandType.Shell: return SHELL_COMMAND_TIMEOUTS[command];
|
|
344
|
+
case SlotCommandType.Git: return GIT_COMMAND_TIMEOUTS[command];
|
|
345
|
+
default: return FILE_COMMAND_TIMEOUTS[command];
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
/**
|
|
349
|
+
* Resolve the caller-side bound for one command.
|
|
350
|
+
*
|
|
351
|
+
* One function rather than three lookups at each call site: an asker that forgets the per-command
|
|
352
|
+
* table inherits twenty minutes for a fifteen-second command, which is the failure this table was
|
|
353
|
+
* added to stop.
|
|
354
|
+
*/
|
|
355
|
+
export const commandTimeout = (type, command, override) => override
|
|
356
|
+
?? perCommandTimeout(type, command)
|
|
357
|
+
?? COMMAND_TIMEOUTS[type]
|
|
358
|
+
?? DEFAULT_COMMAND_TIMEOUT;
|
|
359
|
+
/**
|
|
360
|
+
* Resolve the executor-side deadline for one command.
|
|
361
|
+
*
|
|
362
|
+
* Per-command first, per-type second. It was per-type only, which is how a clone inherited the
|
|
363
|
+
* bound of a `git status` — the same shape as the shell table above, and added for the same
|
|
364
|
+
* reason.
|
|
365
|
+
*/
|
|
366
|
+
export const commandDeadline = (type, command) => {
|
|
367
|
+
switch (type) {
|
|
368
|
+
case SlotCommandType.Shell:
|
|
369
|
+
return COMMAND_DEADLINES[command] ?? DEFAULT_COMMAND_DEADLINE;
|
|
370
|
+
case SlotCommandType.Git:
|
|
371
|
+
return GIT_COMMAND_DEADLINES[command] ?? DEFAULT_GIT_COMMAND_DEADLINE;
|
|
372
|
+
default:
|
|
373
|
+
return FILE_COMMAND_DEADLINES[command] ?? DEFAULT_FILE_COMMAND_DEADLINE;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/slot/consts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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O;IACnC,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,OAAO;IACnC,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,OAAO;IACrC,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM;CACnC,CAAA;AAED,kGAAkG;AAClG,MAAM,iBAAiB,GAAG,CAAC,IAAqB,EAAE,OAAe,EAAsB,EAAE;IACvF,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,eAAe,CAAC,KAAK,EAAE,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAA;QAClE,KAAK,eAAe,CAAC,GAAG,EAAE,OAAO,oBAAoB,CAAC,OAAyB,CAAC,CAAA;QAChF,SAAS,OAAO,qBAAqB,CAAC,OAA0B,CAAC,CAAA;IACnE,CAAC;AACH,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAqB,EAAE,OAAe,EAAE,QAAiB,EACjD,EAAE,CAAC,QAAQ;OAChB,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC;OAChC,gBAAgB,CAAC,IAAI,CAAC;OACtB,uBAAuB,CAAA;AAE5B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,OAAe,EAAU,EAAE;IAChF,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,eAAe,CAAC,KAAK;YACxB,OAAO,iBAAiB,CAAC,OAAO,CAAC,IAAI,wBAAwB,CAAA;QAC/D,KAAK,eAAe,CAAC,GAAG;YACtB,OAAO,qBAAqB,CAAC,OAAyB,CAAC,IAAI,4BAA4B,CAAA;QACzF;YACE,OAAO,sBAAsB,CAAC,OAA0B,CAAC,IAAI,6BAA6B,CAAA;IAC9F,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WorkloadKind } from './consts.js';
|
|
2
|
+
/** The minimum a caller must know about a slot to address it. */
|
|
3
|
+
export interface AddressableSlot {
|
|
4
|
+
kind?: WorkloadKind;
|
|
5
|
+
host?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The origin a slot's application answers at.
|
|
9
|
+
*
|
|
10
|
+
* Read back from the slot's stored `host`, never recomposed from a slug — a preview host is a
|
|
11
|
+
* CLAIMED resource with a certificate behind it, and the name a slot ended up with is not always
|
|
12
|
+
* the name its project would compose today. What this adds is the scheme, which is the one part
|
|
13
|
+
* that follows from the kind rather than from the record: a local target is a loopback address and
|
|
14
|
+
* therefore `http`, everything else is TLS-terminated at an edge and therefore `https`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const slotOrigin: (slot: AddressableSlot) => string;
|
|
17
|
+
/**
|
|
18
|
+
* The exact redirect URIs a target's OIDC client must carry for one origin.
|
|
19
|
+
*
|
|
20
|
+
* Exact, because a provider matches a redirect URI literally and refuses a wildcard — and both
|
|
21
|
+
* entries are needed: the callback the login round trip returns to, and the bare origin, which is
|
|
22
|
+
* where the application's own logout lands.
|
|
23
|
+
*/
|
|
24
|
+
export declare const targetRedirectUrisForOrigin: (origin: string, callbackPath: string) => string[];
|
|
25
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/slot/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,SAAU,eAAe,KAAG,MAMlD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,WAAY,MAAM,gBAAgB,MAAM,KAAG,MAAM,EAC9B,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WorkloadKind } from './consts.js';
|
|
2
|
+
/**
|
|
3
|
+
* The origin a slot's application answers at.
|
|
4
|
+
*
|
|
5
|
+
* Read back from the slot's stored `host`, never recomposed from a slug — a preview host is a
|
|
6
|
+
* CLAIMED resource with a certificate behind it, and the name a slot ended up with is not always
|
|
7
|
+
* the name its project would compose today. What this adds is the scheme, which is the one part
|
|
8
|
+
* that follows from the kind rather than from the record: a local target is a loopback address and
|
|
9
|
+
* therefore `http`, everything else is TLS-terminated at an edge and therefore `https`.
|
|
10
|
+
*/
|
|
11
|
+
export const slotOrigin = (slot) => {
|
|
12
|
+
const host = slot.host ?? '';
|
|
13
|
+
if (host === '')
|
|
14
|
+
return '';
|
|
15
|
+
if (host.startsWith('http://') || host.startsWith('https://'))
|
|
16
|
+
return host;
|
|
17
|
+
return `${slot.kind === WorkloadKind.Local ? 'http' : 'https'}://${host}`;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The exact redirect URIs a target's OIDC client must carry for one origin.
|
|
21
|
+
*
|
|
22
|
+
* Exact, because a provider matches a redirect URI literally and refuses a wildcard — and both
|
|
23
|
+
* entries are needed: the callback the login round trip returns to, and the bare origin, which is
|
|
24
|
+
* where the application's own logout lands.
|
|
25
|
+
*/
|
|
26
|
+
export const targetRedirectUrisForOrigin = (origin, callbackPath) => origin === '' ? [] : [origin, `${origin}${callbackPath}`];
|
|
27
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/slot/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAQ1C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAqB,EAAU,EAAE;IAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;IAC5B,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,EAAE,CAAA;IAC1B,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAA;IAE1E,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,IAAI,EAAE,CAAA;AAC3E,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAc,EAAE,YAAoB,EAAY,EAAE,CAC5F,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,MAAM,GAAG,YAAY,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slot/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,mBAAmB,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/slot/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { TargetLayout } from '../integrity/index.js';
|
|
2
|
+
import { SubProject } from './consts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Where each role lives, for one layout. Directory names are target-root-relative.
|
|
5
|
+
*
|
|
6
|
+
* The pure half of layout resolution. Whoever holds the tree — the publisher over a pod volume,
|
|
7
|
+
* the connector over a directory on a developer's machine — adds the two filesystem probes that
|
|
8
|
+
* pick the layout and turn these names into absolute paths. The TABLES are shared so the two
|
|
9
|
+
* cannot disagree about what a role means.
|
|
10
|
+
*/
|
|
11
|
+
export interface TargetPaths {
|
|
12
|
+
layout: TargetLayout;
|
|
13
|
+
/** The directory holding the workspace packages — `packages` or `sources`. */
|
|
14
|
+
dir: string;
|
|
15
|
+
/** The package whose `dist/index.js` runs as the target's HTTP server. */
|
|
16
|
+
api: string;
|
|
17
|
+
/** The package whose `dist/` is served to a browser. */
|
|
18
|
+
web: string;
|
|
19
|
+
/** The shared library the other two compile against. */
|
|
20
|
+
common: string;
|
|
21
|
+
/**
|
|
22
|
+
* The package whose `dist/index.js` runs as the target's queue worker, when the target has one.
|
|
23
|
+
*
|
|
24
|
+
* Absent for v1, which had no such package and never will — a target's tree is the one it was
|
|
25
|
+
* initialized with. Present for v2 as a NAME, not as a promise: every caller checks the disk
|
|
26
|
+
* before acting on it.
|
|
27
|
+
*/
|
|
28
|
+
worker?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Every package a full build runs, in dependency order.
|
|
31
|
+
*
|
|
32
|
+
* Longer than the three roles for v2, whose `backend` is a library that both `api` and `worker`
|
|
33
|
+
* import. A caller skips whatever is not on disk — a target need not have a worker.
|
|
34
|
+
*/
|
|
35
|
+
build: string[];
|
|
36
|
+
/**
|
|
37
|
+
* The packages built with `tsc -b` and consumed through their `build/` output, in dependency
|
|
38
|
+
* order — never bundled, so their output has to be on disk at RUN time, not only at build time.
|
|
39
|
+
*
|
|
40
|
+
* The bundled packages keep every dependency external, so `bun dist/index.js` resolves
|
|
41
|
+
* `project-backend` from `node_modules` at startup, follows its `main` to `build/index.js` — and
|
|
42
|
+
* if nothing built it, Bun answers `Cannot find package 'project-backend'` and the target exits 1
|
|
43
|
+
* with a message that names a dependency rather than a missing build.
|
|
44
|
+
*
|
|
45
|
+
* v1 got away without this list: it had ONE library and the template shipped its `build/`
|
|
46
|
+
* prebuilt. v2 deleted those artifacts and added a second library, so every path that builds a
|
|
47
|
+
* target has to build these first or it can never start.
|
|
48
|
+
*/
|
|
49
|
+
libraries: string[];
|
|
50
|
+
}
|
|
51
|
+
export declare const LAYOUTS: Record<TargetLayout, TargetPaths>;
|
|
52
|
+
export declare const ROLE_DIRS: Record<TargetLayout, Record<SubProject, string>>;
|
|
53
|
+
/**
|
|
54
|
+
* The one marker per layout, chosen because it exists in that layout and in no other.
|
|
55
|
+
*
|
|
56
|
+
* `sources/api` cannot appear in a v1 tree and `packages/backend` cannot appear in a v2 one, so a
|
|
57
|
+
* single `stat` settles it. Deliberately not `sources/` alone: v1 packages each have their own
|
|
58
|
+
* `src`, and a directory name that differs by one letter is not something to hang a runtime path
|
|
59
|
+
* resolution on. Ordered — the first marker found wins.
|
|
60
|
+
*/
|
|
61
|
+
export declare const LAYOUT_MARKERS: Array<[TargetLayout, string]>;
|
|
62
|
+
/**
|
|
63
|
+
* Resolve a wire-level role to the directory it names in a given layout.
|
|
64
|
+
*
|
|
65
|
+
* An unknown value — a role from a sender newer than this reader — falls back to the role's own
|
|
66
|
+
* name, which is the honest guess for a layout whose packages are named after their roles, and
|
|
67
|
+
* which fails visibly rather than resolving to some other package's directory.
|
|
68
|
+
*/
|
|
69
|
+
export declare const subprojectDirOf: (layout: TargetLayout, role: SubProject) => string;
|
|
70
|
+
/** Where every role lives, for a layout already decided. */
|
|
71
|
+
export declare const pathsOf: (layout: TargetLayout) => TargetPaths;
|
|
72
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/slot/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,YAAY,CAAA;IACpB,8EAA8E;IAC9E,GAAG,EAAE,MAAM,CAAA;IACX,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAA;IACX,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAA;IACX,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;OAKG;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;IACf;;;;;;;;;;;;OAYG;IACH,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAgCD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,WAAW,CAGrD,CAAA;AAyBD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAGtE,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAGxD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,WAAY,YAAY,QAAQ,UAAU,KAAG,MACxC,CAAA;AAEjC,4DAA4D;AAC5D,eAAO,MAAM,OAAO,WAAY,YAAY,KAAG,WAA8B,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { TargetLayout } from '../integrity/index.js';
|
|
2
|
+
import { packageForRole, resolveTopology, topologyOf } from '../topology/index.js';
|
|
3
|
+
import { SubProject } from './consts.js';
|
|
4
|
+
/**
|
|
5
|
+
* Where every role lives, per layout — DERIVED from that layout's topology.
|
|
6
|
+
*
|
|
7
|
+
* These were two hand-written records, and the pair could disagree with each other and with the
|
|
8
|
+
* tree: `build` listed the packages in an order somebody maintained by hand beside the graph that
|
|
9
|
+
* actually decides it, and `libraries` was a second copy of "which of these are built with
|
|
10
|
+
* `tsc -b`". Both are now read off {@link LAYOUT_TOPOLOGIES}, so a package added to a topology
|
|
11
|
+
* appears in the build order, in the library order and in the role map at once, or in none of them.
|
|
12
|
+
*
|
|
13
|
+
* The VALUES are unchanged, and `topology.spec.ts` pins them against the tables they replaced.
|
|
14
|
+
*/
|
|
15
|
+
const pathsOfTopology = (layout) => {
|
|
16
|
+
const topology = resolveTopology(topologyOf(layout));
|
|
17
|
+
const dirOf = (role) => packageForRole(topology, role)?.name;
|
|
18
|
+
return {
|
|
19
|
+
layout,
|
|
20
|
+
dir: topology.dir,
|
|
21
|
+
// The three roles every arrangement has. A topology without one is not a target, so the
|
|
22
|
+
// fallback is the role's own name rather than a silent `undefined` reaching a path join.
|
|
23
|
+
api: dirOf(SubProject.Api) ?? SubProject.Api,
|
|
24
|
+
web: dirOf(SubProject.Web) ?? SubProject.Web,
|
|
25
|
+
common: dirOf(SubProject.Common) ?? SubProject.Common,
|
|
26
|
+
// A NAME, not a promise — every caller checks the disk before acting on it.
|
|
27
|
+
...(dirOf(SubProject.Worker) != null ? { worker: dirOf(SubProject.Worker) } : {}),
|
|
28
|
+
build: topology.build,
|
|
29
|
+
libraries: topology.libraries,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export const LAYOUTS = {
|
|
33
|
+
[TargetLayout.V1]: pathsOfTopology(TargetLayout.V1),
|
|
34
|
+
[TargetLayout.V2]: pathsOfTopology(TargetLayout.V2),
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Role → directory, per layout. Total over {@link SubProject} in both layouts, deliberately.
|
|
38
|
+
*
|
|
39
|
+
* The v2 role names have v1 equivalents (`api` is v1's `backend`, `web` its `frontend`) and are
|
|
40
|
+
* mapped to them, so a current sender talking to an old tree still reaches the right package. The
|
|
41
|
+
* one role with no v1 equivalent is `worker`, and it maps to a directory that does not exist there
|
|
42
|
+
* rather than to a plausible one: a command aimed at a package this tree does not have must fail
|
|
43
|
+
* where it is issued. Answering `common` instead — which is what the missing entries used to do —
|
|
44
|
+
* runs it somewhere real and wrong.
|
|
45
|
+
*
|
|
46
|
+
* Totality is what a topology cannot give on its own (it maps only the roles its packages hold),
|
|
47
|
+
* so an unmapped role falls back to its own name here, which is that same visible failure.
|
|
48
|
+
*/
|
|
49
|
+
const roleDirsOfTopology = (layout) => {
|
|
50
|
+
const topology = resolveTopology(topologyOf(layout));
|
|
51
|
+
return Object.values(SubProject).reduce((dirs, role) => {
|
|
52
|
+
dirs[role] = packageForRole(topology, role)?.name ?? role;
|
|
53
|
+
return dirs;
|
|
54
|
+
}, {});
|
|
55
|
+
};
|
|
56
|
+
export const ROLE_DIRS = {
|
|
57
|
+
[TargetLayout.V1]: roleDirsOfTopology(TargetLayout.V1),
|
|
58
|
+
[TargetLayout.V2]: roleDirsOfTopology(TargetLayout.V2),
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The one marker per layout, chosen because it exists in that layout and in no other.
|
|
62
|
+
*
|
|
63
|
+
* `sources/api` cannot appear in a v1 tree and `packages/backend` cannot appear in a v2 one, so a
|
|
64
|
+
* single `stat` settles it. Deliberately not `sources/` alone: v1 packages each have their own
|
|
65
|
+
* `src`, and a directory name that differs by one letter is not something to hang a runtime path
|
|
66
|
+
* resolution on. Ordered — the first marker found wins.
|
|
67
|
+
*/
|
|
68
|
+
export const LAYOUT_MARKERS = [
|
|
69
|
+
[TargetLayout.V2, 'sources/api'],
|
|
70
|
+
[TargetLayout.V1, 'packages/backend'],
|
|
71
|
+
];
|
|
72
|
+
/**
|
|
73
|
+
* Resolve a wire-level role to the directory it names in a given layout.
|
|
74
|
+
*
|
|
75
|
+
* An unknown value — a role from a sender newer than this reader — falls back to the role's own
|
|
76
|
+
* name, which is the honest guess for a layout whose packages are named after their roles, and
|
|
77
|
+
* which fails visibly rather than resolving to some other package's directory.
|
|
78
|
+
*/
|
|
79
|
+
export const subprojectDirOf = (layout, role) => ROLE_DIRS[layout][role] ?? role;
|
|
80
|
+
/** Where every role lives, for a layout already decided. */
|
|
81
|
+
export const pathsOf = (layout) => LAYOUTS[layout];
|
|
82
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/slot/layout.ts"],"names":[],"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|
|
3
|
+
export declare const SlotCommandPayloadSchema: JSONSchemaType<SlotCommandPayload>;
|
|
4
|
+
/**
|
|
5
|
+
* The clone command's arguments, as a signed body carries them.
|
|
6
|
+
*
|
|
7
|
+
* `token` is declared because it is SENT — a body field the schema does not declare is stripped
|
|
8
|
+
* by validation and then verified against a signature the sender made over the whole thing, which
|
|
9
|
+
* the guard reports as a 401 rather than as the validation gap it is.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SlotGitCloneArgsSchema: JSONSchemaType<SlotGitCloneArgs>;
|
|
12
|
+
//# sourceMappingURL=schemas.d.ts.map
|