@owlmeans/viable-sdk 0.1.18-rc.8 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -11
- package/agent-meta/manifest.json +16 -0
- package/agent-meta/skills/viable-sdk/SKILL.md +1033 -0
- package/build/api/collect/types.d.ts +30 -0
- package/build/api/collect/types.d.ts.map +1 -0
- package/build/api/collect/types.js +2 -0
- package/build/api/collect/types.js.map +1 -0
- package/build/api/collect.d.ts +14 -0
- package/build/api/collect.d.ts.map +1 -0
- package/build/api/collect.js +132 -0
- package/build/api/collect.js.map +1 -0
- package/build/api/consts.local.d.ts +21 -0
- package/build/api/consts.local.d.ts.map +1 -0
- package/build/api/consts.local.js +25 -0
- package/build/api/consts.local.js.map +1 -0
- package/build/api/index.d.ts +5 -0
- package/build/api/index.d.ts.map +1 -1
- package/build/api/index.js +2 -0
- package/build/api/index.js.map +1 -1
- package/build/api/remote.d.ts +13 -6
- package/build/api/remote.d.ts.map +1 -1
- package/build/api/remote.js +302 -35
- package/build/api/remote.js.map +1 -1
- package/build/api/transport/types.d.ts +14 -0
- package/build/api/transport/types.d.ts.map +1 -0
- package/build/api/transport/types.js +2 -0
- package/build/api/transport/types.js.map +1 -0
- package/build/api/transport.d.ts +4 -0
- package/build/api/transport.d.ts.map +1 -0
- package/build/api/transport.js +32 -0
- package/build/api/transport.js.map +1 -0
- package/build/api/types.d.ts +9 -0
- package/build/api/types.d.ts.map +1 -0
- package/build/api/types.js +2 -0
- package/build/api/types.js.map +1 -0
- package/build/api/types.local.d.ts +3 -0
- package/build/api/types.local.d.ts.map +1 -0
- package/build/api/types.local.js +2 -0
- package/build/api/types.local.js.map +1 -0
- package/build/consts.d.ts +29 -14
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +30 -14
- package/build/consts.js.map +1 -1
- package/build/context/consts.local.d.ts +18 -0
- package/build/context/consts.local.d.ts.map +1 -0
- package/build/context/consts.local.js +18 -0
- package/build/context/consts.local.js.map +1 -0
- package/build/context/index.d.ts +3 -7
- package/build/context/index.d.ts.map +1 -1
- package/build/context/index.js +58 -25
- package/build/context/index.js.map +1 -1
- package/build/context/types.d.ts +26 -0
- package/build/context/types.d.ts.map +1 -0
- package/build/context/types.js +2 -0
- package/build/context/types.js.map +1 -0
- package/build/executor/boot-check.d.ts +1 -40
- package/build/executor/boot-check.d.ts.map +1 -1
- package/build/executor/boot-check.js +22 -19
- package/build/executor/boot-check.js.map +1 -1
- package/build/executor/consts.d.ts +55 -0
- package/build/executor/consts.d.ts.map +1 -0
- package/build/executor/consts.js +66 -0
- package/build/executor/consts.js.map +1 -0
- package/build/executor/consts.local.d.ts +63 -0
- package/build/executor/consts.local.d.ts.map +1 -0
- package/build/executor/consts.local.js +69 -0
- package/build/executor/consts.local.js.map +1 -0
- package/build/executor/env/types.d.ts +40 -0
- package/build/executor/env/types.d.ts.map +1 -0
- package/build/executor/env/types.js +2 -0
- package/build/executor/env/types.js.map +1 -0
- package/build/executor/env.d.ts +11 -20
- package/build/executor/env.d.ts.map +1 -1
- package/build/executor/env.js +39 -59
- package/build/executor/env.js.map +1 -1
- package/build/executor/errors.d.ts +15 -0
- package/build/executor/errors.d.ts.map +1 -1
- package/build/executor/errors.js +19 -2
- package/build/executor/errors.js.map +1 -1
- package/build/executor/files/types.d.ts +106 -0
- package/build/executor/files/types.d.ts.map +1 -0
- package/build/executor/files/types.js +2 -0
- package/build/executor/files/types.js.map +1 -0
- package/build/executor/files.d.ts +2 -50
- package/build/executor/files.d.ts.map +1 -1
- package/build/executor/files.js +225 -68
- package/build/executor/files.js.map +1 -1
- package/build/executor/git/types.d.ts +19 -0
- package/build/executor/git/types.d.ts.map +1 -0
- package/build/executor/git/types.js +2 -0
- package/build/executor/git/types.js.map +1 -0
- package/build/executor/git.d.ts +4 -36
- package/build/executor/git.d.ts.map +1 -1
- package/build/executor/git.js +206 -241
- package/build/executor/git.js.map +1 -1
- package/build/executor/glob/types.d.ts +12 -0
- package/build/executor/glob/types.d.ts.map +1 -0
- package/build/executor/glob/types.js +2 -0
- package/build/executor/glob/types.js.map +1 -0
- package/build/executor/glob.d.ts +4 -0
- package/build/executor/glob.d.ts.map +1 -0
- package/build/executor/glob.js +11 -0
- package/build/executor/glob.js.map +1 -0
- package/build/executor/health/types.d.ts +39 -0
- package/build/executor/health/types.d.ts.map +1 -0
- package/build/executor/health/types.js +2 -0
- package/build/executor/health/types.js.map +1 -0
- package/build/executor/health.d.ts +3 -83
- package/build/executor/health.d.ts.map +1 -1
- package/build/executor/health.js +76 -91
- package/build/executor/health.js.map +1 -1
- package/build/executor/index.d.ts +14 -15
- package/build/executor/index.d.ts.map +1 -1
- package/build/executor/index.js +36 -18
- package/build/executor/index.js.map +1 -1
- package/build/executor/integrity/types.d.ts +25 -0
- package/build/executor/integrity/types.d.ts.map +1 -0
- package/build/executor/integrity/types.js +2 -0
- package/build/executor/integrity/types.js.map +1 -0
- package/build/executor/integrity.d.ts +5 -15
- package/build/executor/integrity.d.ts.map +1 -1
- package/build/executor/integrity.js +28 -39
- package/build/executor/integrity.js.map +1 -1
- package/build/executor/layout/types.d.ts +69 -0
- package/build/executor/layout/types.d.ts.map +1 -0
- package/build/executor/layout/types.js +2 -0
- package/build/executor/layout/types.js.map +1 -0
- package/build/executor/layout.d.ts +9 -56
- package/build/executor/layout.d.ts.map +1 -1
- package/build/executor/layout.js +35 -82
- package/build/executor/layout.js.map +1 -1
- package/build/executor/shell/types.d.ts +76 -0
- package/build/executor/shell/types.d.ts.map +1 -0
- package/build/executor/shell/types.js +2 -0
- package/build/executor/shell/types.js.map +1 -0
- package/build/executor/shell.d.ts +3 -78
- package/build/executor/shell.d.ts.map +1 -1
- package/build/executor/shell.js +61 -91
- package/build/executor/shell.js.map +1 -1
- package/build/executor/spawn/types.d.ts +98 -0
- package/build/executor/spawn/types.d.ts.map +1 -0
- package/build/executor/spawn/types.js +2 -0
- package/build/executor/spawn/types.js.map +1 -0
- package/build/executor/spawn.d.ts +3 -103
- package/build/executor/spawn.d.ts.map +1 -1
- package/build/executor/spawn.js +192 -274
- package/build/executor/spawn.js.map +1 -1
- package/build/executor/types.d.ts +123 -0
- package/build/executor/types.d.ts.map +1 -0
- package/build/executor/types.js +2 -0
- package/build/executor/types.js.map +1 -0
- package/build/executor/types.local.d.ts +6 -0
- package/build/executor/types.local.d.ts.map +1 -0
- package/build/executor/types.local.js +2 -0
- package/build/executor/types.local.js.map +1 -0
- package/build/index.d.ts +14 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -1
- package/build/index.js.map +1 -1
- package/build/project/consts.d.ts +17 -0
- package/build/project/consts.d.ts.map +1 -0
- package/build/project/consts.js +17 -0
- package/build/project/consts.js.map +1 -0
- package/build/project/consts.local.d.ts +4 -0
- package/build/project/consts.local.d.ts.map +1 -0
- package/build/project/consts.local.js +4 -0
- package/build/project/consts.local.js.map +1 -0
- package/build/project/dotenv/types.d.ts +39 -0
- package/build/project/dotenv/types.d.ts.map +1 -0
- package/build/project/dotenv/types.js +2 -0
- package/build/project/dotenv/types.js.map +1 -0
- package/build/project/dotenv.d.ts +4 -0
- package/build/project/dotenv.d.ts.map +1 -0
- package/build/project/dotenv.js +56 -0
- package/build/project/dotenv.js.map +1 -0
- package/build/project/env/types.d.ts +40 -0
- package/build/project/env/types.d.ts.map +1 -0
- package/build/project/env/types.js +2 -0
- package/build/project/env/types.js.map +1 -0
- package/build/project/env.d.ts +2 -98
- package/build/project/env.d.ts.map +1 -1
- package/build/project/env.js +63 -215
- package/build/project/env.js.map +1 -1
- package/build/project/marker/types.d.ts +33 -0
- package/build/project/marker/types.d.ts.map +1 -0
- package/build/project/marker/types.js +2 -0
- package/build/project/marker/types.js.map +1 -0
- package/build/project/marker.d.ts +4 -25
- package/build/project/marker.d.ts.map +1 -1
- package/build/project/marker.js +40 -43
- package/build/project/marker.js.map +1 -1
- package/build/project/probe/types.d.ts +22 -0
- package/build/project/probe/types.d.ts.map +1 -0
- package/build/project/probe/types.js +2 -0
- package/build/project/probe/types.js.map +1 -0
- package/build/project/probe.d.ts +4 -0
- package/build/project/probe.d.ts.map +1 -0
- package/build/project/probe.js +39 -0
- package/build/project/probe.js.map +1 -0
- package/build/project/report/types.d.ts +18 -0
- package/build/project/report/types.d.ts.map +1 -0
- package/build/project/report/types.js +2 -0
- package/build/project/report/types.js.map +1 -0
- package/build/project/report.d.ts +7 -0
- package/build/project/report.d.ts.map +1 -0
- package/build/project/report.js +68 -0
- package/build/project/report.js.map +1 -0
- package/build/project/setup/types.d.ts +32 -0
- package/build/project/setup/types.d.ts.map +1 -0
- package/build/project/setup/types.js +2 -0
- package/build/project/setup/types.js.map +1 -0
- package/build/project/setup.d.ts +4 -53
- package/build/project/setup.d.ts.map +1 -1
- package/build/project/setup.js +112 -175
- package/build/project/setup.js.map +1 -1
- package/build/project/types.d.ts +37 -0
- package/build/project/types.d.ts.map +1 -0
- package/build/project/types.js +2 -0
- package/build/project/types.js.map +1 -0
- package/build/run/consts.local.d.ts +3 -0
- package/build/run/consts.local.d.ts.map +1 -0
- package/build/run/consts.local.js +26 -0
- package/build/run/consts.local.js.map +1 -0
- package/build/run/index.d.ts +11 -69
- package/build/run/index.d.ts.map +1 -1
- package/build/run/index.js +9 -147
- package/build/run/index.js.map +1 -1
- package/build/run/local/types.d.ts +39 -0
- package/build/run/local/types.d.ts.map +1 -0
- package/build/run/local/types.js +2 -0
- package/build/run/local/types.js.map +1 -0
- package/build/run/local.d.ts +3 -0
- package/build/run/local.d.ts.map +1 -0
- package/build/run/local.js +130 -0
- package/build/run/local.js.map +1 -0
- package/build/run/process/types.d.ts +15 -0
- package/build/run/process/types.d.ts.map +1 -0
- package/build/run/process/types.js +2 -0
- package/build/run/process/types.js.map +1 -0
- package/build/run/process.d.ts +4 -0
- package/build/run/process.d.ts.map +1 -0
- package/build/run/process.js +20 -0
- package/build/run/process.js.map +1 -0
- package/build/run/serve.d.ts +14 -9
- package/build/run/serve.d.ts.map +1 -1
- package/build/run/serve.js +1 -25
- package/build/run/serve.js.map +1 -1
- package/build/run/state/types.d.ts +35 -0
- package/build/run/state/types.d.ts.map +1 -0
- package/build/run/state/types.js +2 -0
- package/build/run/state/types.js.map +1 -0
- package/build/run/state.d.ts +3 -62
- package/build/run/state.d.ts.map +1 -1
- package/build/run/state.js +96 -123
- package/build/run/state.js.map +1 -1
- package/build/run/types.d.ts +78 -0
- package/build/run/types.d.ts.map +1 -0
- package/build/run/types.js +2 -0
- package/build/run/types.js.map +1 -0
- package/build/session/consts.local.d.ts +5 -0
- package/build/session/consts.local.d.ts.map +1 -0
- package/build/session/consts.local.js +5 -0
- package/build/session/consts.local.js.map +1 -0
- package/build/session/index.d.ts +5 -10
- package/build/session/index.d.ts.map +1 -1
- package/build/session/index.js +84 -15
- package/build/session/index.js.map +1 -1
- package/build/session/questions.d.ts +16 -0
- package/build/session/questions.d.ts.map +1 -0
- package/build/session/questions.js +17 -0
- package/build/session/questions.js.map +1 -0
- package/build/session/queue.d.ts +61 -0
- package/build/session/queue.d.ts.map +1 -0
- package/build/session/queue.js +156 -0
- package/build/session/queue.js.map +1 -0
- package/build/session/tasks.d.ts +11 -30
- package/build/session/tasks.d.ts.map +1 -1
- package/build/session/tasks.js +18 -78
- package/build/session/tasks.js.map +1 -1
- package/build/session/types.d.ts +20 -0
- package/build/session/types.d.ts.map +1 -0
- package/build/session/types.js +2 -0
- package/build/session/types.js.map +1 -0
- package/build/task/consts.d.ts +12 -0
- package/build/task/consts.d.ts.map +1 -0
- package/build/task/consts.js +12 -0
- package/build/task/consts.js.map +1 -0
- package/build/task/consts.local.d.ts +19 -0
- package/build/task/consts.local.d.ts.map +1 -0
- package/build/task/consts.local.js +72 -0
- package/build/task/consts.local.js.map +1 -0
- package/build/task/driver.d.ts +1 -28
- package/build/task/driver.d.ts.map +1 -1
- package/build/task/driver.js +2 -9
- package/build/task/driver.js.map +1 -1
- package/build/task/envelope/types.d.ts +29 -0
- package/build/task/envelope/types.d.ts.map +1 -0
- package/build/task/envelope/types.js +2 -0
- package/build/task/envelope/types.js.map +1 -0
- package/build/task/envelope.d.ts +4 -34
- package/build/task/envelope.d.ts.map +1 -1
- package/build/task/envelope.js +103 -165
- package/build/task/envelope.js.map +1 -1
- package/build/task/index.d.ts +5 -0
- package/build/task/index.d.ts.map +1 -1
- package/build/task/index.js +2 -0
- package/build/task/index.js.map +1 -1
- package/build/task/inquiry/types.d.ts +38 -0
- package/build/task/inquiry/types.d.ts.map +1 -0
- package/build/task/inquiry/types.js +2 -0
- package/build/task/inquiry/types.js.map +1 -0
- package/build/task/inquiry.d.ts +5 -0
- package/build/task/inquiry.d.ts.map +1 -0
- package/build/task/inquiry.js +188 -0
- package/build/task/inquiry.js.map +1 -0
- package/build/task/types.d.ts +48 -0
- package/build/task/types.d.ts.map +1 -0
- package/build/task/types.js +2 -0
- package/build/task/types.js.map +1 -0
- package/build/tools/account/types.d.ts +24 -0
- package/build/tools/account/types.d.ts.map +1 -0
- package/build/tools/account/types.js +2 -0
- package/build/tools/account/types.js.map +1 -0
- package/build/tools/account.d.ts +4 -0
- package/build/tools/account.d.ts.map +1 -0
- package/build/tools/account.js +72 -0
- package/build/tools/account.js.map +1 -0
- package/build/tools/blueprints/types.d.ts +5 -0
- package/build/tools/blueprints/types.d.ts.map +1 -0
- package/build/tools/blueprints/types.js +2 -0
- package/build/tools/blueprints/types.js.map +1 -0
- package/build/tools/blueprints.d.ts +4 -0
- package/build/tools/blueprints.d.ts.map +1 -0
- package/build/tools/blueprints.js +23 -0
- package/build/tools/blueprints.js.map +1 -0
- package/build/tools/catalogue/types.d.ts +8 -0
- package/build/tools/catalogue/types.d.ts.map +1 -0
- package/build/tools/catalogue/types.js +2 -0
- package/build/tools/catalogue/types.js.map +1 -0
- package/build/tools/catalogue.d.ts +8 -6
- package/build/tools/catalogue.d.ts.map +1 -1
- package/build/tools/catalogue.js +2565 -213
- package/build/tools/catalogue.js.map +1 -1
- package/build/tools/config/types.d.ts +19 -0
- package/build/tools/config/types.d.ts.map +1 -0
- package/build/tools/config/types.js +2 -0
- package/build/tools/config/types.js.map +1 -0
- package/build/tools/config.d.ts +4 -0
- package/build/tools/config.d.ts.map +1 -0
- package/build/tools/config.js +42 -0
- package/build/tools/config.js.map +1 -0
- package/build/tools/consts.d.ts +61 -0
- package/build/tools/consts.d.ts.map +1 -0
- package/build/tools/consts.js +515 -0
- package/build/tools/consts.js.map +1 -0
- package/build/tools/consts.local.d.ts +131 -0
- package/build/tools/consts.local.d.ts.map +1 -0
- package/build/tools/consts.local.js +236 -0
- package/build/tools/consts.local.js.map +1 -0
- package/build/tools/control/types.d.ts +17 -0
- package/build/tools/control/types.d.ts.map +1 -0
- package/build/tools/control/types.js +2 -0
- package/build/tools/control/types.js.map +1 -0
- package/build/tools/control.d.ts +4 -0
- package/build/tools/control.d.ts.map +1 -0
- package/build/tools/control.js +44 -0
- package/build/tools/control.js.map +1 -0
- package/build/tools/feed/types.d.ts +21 -0
- package/build/tools/feed/types.d.ts.map +1 -0
- package/build/tools/feed/types.js +2 -0
- package/build/tools/feed/types.js.map +1 -0
- package/build/tools/feed.d.ts +4 -0
- package/build/tools/feed.d.ts.map +1 -0
- package/build/tools/feed.js +75 -0
- package/build/tools/feed.js.map +1 -0
- package/build/tools/git/types.d.ts +25 -0
- package/build/tools/git/types.d.ts.map +1 -0
- package/build/tools/git/types.js +2 -0
- package/build/tools/git/types.js.map +1 -0
- package/build/tools/git.d.ts +4 -0
- package/build/tools/git.d.ts.map +1 -0
- package/build/tools/git.js +83 -0
- package/build/tools/git.js.map +1 -0
- package/build/tools/handover/types.d.ts +49 -0
- package/build/tools/handover/types.d.ts.map +1 -0
- package/build/tools/handover/types.js +2 -0
- package/build/tools/handover/types.js.map +1 -0
- package/build/tools/handover.d.ts +8 -0
- package/build/tools/handover.d.ts.map +1 -0
- package/build/tools/handover.js +138 -0
- package/build/tools/handover.js.map +1 -0
- package/build/tools/host/types.d.ts +34 -0
- package/build/tools/host/types.d.ts.map +1 -0
- package/build/tools/host/types.js +2 -0
- package/build/tools/host/types.js.map +1 -0
- package/build/tools/host.d.ts +4 -0
- package/build/tools/host.d.ts.map +1 -0
- package/build/tools/host.js +13 -0
- package/build/tools/host.js.map +1 -0
- package/build/tools/iam/types.d.ts +44 -0
- package/build/tools/iam/types.d.ts.map +1 -0
- package/build/tools/iam/types.js +2 -0
- package/build/tools/iam/types.js.map +1 -0
- package/build/tools/iam.d.ts +4 -0
- package/build/tools/iam.d.ts.map +1 -0
- package/build/tools/iam.js +229 -0
- package/build/tools/iam.js.map +1 -0
- package/build/tools/index.d.ts +27 -1
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +14 -1
- package/build/tools/index.js.map +1 -1
- package/build/tools/inflight/types.d.ts +47 -0
- package/build/tools/inflight/types.d.ts.map +1 -0
- package/build/tools/inflight/types.js +2 -0
- package/build/tools/inflight/types.js.map +1 -0
- package/build/tools/inflight.d.ts +3 -0
- package/build/tools/inflight.d.ts.map +1 -0
- package/build/tools/inflight.js +88 -0
- package/build/tools/inflight.js.map +1 -0
- package/build/tools/kits/types.d.ts +12 -0
- package/build/tools/kits/types.d.ts.map +1 -0
- package/build/tools/kits/types.js +2 -0
- package/build/tools/kits/types.js.map +1 -0
- package/build/tools/kits.d.ts +4 -0
- package/build/tools/kits.d.ts.map +1 -0
- package/build/tools/kits.js +33 -0
- package/build/tools/kits.js.map +1 -0
- package/build/tools/mcp.d.ts +13 -19
- package/build/tools/mcp.d.ts.map +1 -1
- package/build/tools/mcp.js +117 -38
- package/build/tools/mcp.js.map +1 -1
- package/build/tools/platform.d.ts +14 -0
- package/build/tools/platform.d.ts.map +1 -0
- package/build/tools/platform.js +90 -0
- package/build/tools/platform.js.map +1 -0
- package/build/tools/production/types.d.ts +22 -0
- package/build/tools/production/types.d.ts.map +1 -0
- package/build/tools/production/types.js +2 -0
- package/build/tools/production/types.js.map +1 -0
- package/build/tools/production.d.ts +4 -0
- package/build/tools/production.d.ts.map +1 -0
- package/build/tools/production.js +80 -0
- package/build/tools/production.js.map +1 -0
- package/build/tools/refusal/types.d.ts +95 -0
- package/build/tools/refusal/types.d.ts.map +1 -0
- package/build/tools/refusal/types.js +2 -0
- package/build/tools/refusal/types.js.map +1 -0
- package/build/tools/refusal.d.ts +4 -0
- package/build/tools/refusal.d.ts.map +1 -0
- package/build/tools/refusal.js +663 -0
- package/build/tools/refusal.js.map +1 -0
- package/build/tools/settings/types.d.ts +42 -0
- package/build/tools/settings/types.d.ts.map +1 -0
- package/build/tools/settings/types.js +2 -0
- package/build/tools/settings/types.js.map +1 -0
- package/build/tools/settings.d.ts +4 -0
- package/build/tools/settings.d.ts.map +1 -0
- package/build/tools/settings.js +71 -0
- package/build/tools/settings.js.map +1 -0
- package/build/tools/status/types.d.ts +25 -0
- package/build/tools/status/types.d.ts.map +1 -0
- package/build/tools/status/types.js +2 -0
- package/build/tools/status/types.js.map +1 -0
- package/build/tools/status.d.ts +4 -0
- package/build/tools/status.d.ts.map +1 -0
- package/build/tools/status.js +183 -0
- package/build/tools/status.js.map +1 -0
- package/build/tools/stories/types.d.ts +48 -0
- package/build/tools/stories/types.d.ts.map +1 -0
- package/build/tools/stories/types.js +2 -0
- package/build/tools/stories/types.js.map +1 -0
- package/build/tools/stories.d.ts +8 -0
- package/build/tools/stories.d.ts.map +1 -0
- package/build/tools/stories.js +79 -0
- package/build/tools/stories.js.map +1 -0
- package/build/tools/types.d.ts +177 -26
- package/build/tools/types.d.ts.map +1 -1
- package/build/tools/types.js +1 -32
- package/build/tools/types.js.map +1 -1
- package/build/types.d.ts +391 -26
- package/build/types.d.ts.map +1 -1
- package/build/utils.d.ts +8 -0
- package/build/utils.d.ts.map +1 -0
- package/build/utils.js +12 -0
- package/build/utils.js.map +1 -0
- package/package.json +30 -34
- package/build/harness/index.d.ts +0 -28
- package/build/harness/index.d.ts.map +0 -1
- package/build/harness/index.js +0 -83
- package/build/harness/index.js.map +0 -1
- package/build/harness/templates.d.ts +0 -30
- package/build/harness/templates.d.ts.map +0 -1
- package/build/harness/templates.js +0 -154
- package/build/harness/templates.js.map +0 -1
- package/build/tools/jobs.d.ts +0 -12
- package/build/tools/jobs.d.ts.map +0 -1
- package/build/tools/jobs.js +0 -47
- package/build/tools/jobs.js.map +0 -1
package/build/run/serve.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { LocalServer, LocalServerOptions } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Serve the target's built browser app, and put its `/api` behind the same origin.
|
|
4
|
+
*
|
|
5
|
+
* The slot does this with an HTTPRoute in front of two processes; a local run has no edge, so the
|
|
6
|
+
* proxy is what replaces it. It is not a convenience: the app and its API sharing one origin is
|
|
7
|
+
* what the generated app's own configuration assumes, and splitting them across two loopback ports
|
|
8
|
+
* would put the target's CORS setup in the path of a developer's first page load.
|
|
9
|
+
*
|
|
10
|
+
* Everything else the publisher's static server does — the crawler policy, the CSP, the preview
|
|
11
|
+
* error reporter, the build-state header — is about a PUBLIC hostname on a domain every customer
|
|
12
|
+
* shares. A loopback address has no reputation to spend and no crawler to answer, so none of it is
|
|
13
|
+
* reproduced here.
|
|
14
|
+
*/
|
|
10
15
|
/**
|
|
11
16
|
* The static server, reading its directory per request.
|
|
12
17
|
*
|
package/build/run/serve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/run/serve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/run/serve.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEjE;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,cACjB,MAAM,MAAM,YAAW,kBAAkB,KACnD,WAiHF,CAAA"}
|
package/build/run/serve.js
CHANGED
|
@@ -3,6 +3,7 @@ import fsp from 'node:fs/promises';
|
|
|
3
3
|
import http from 'node:http';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { TARGET_API_BASE, TARGET_API_PORT, TARGET_WEB_PORT } from '@owlmeans/viable-common';
|
|
6
|
+
import { MIME, PLACEHOLDER } from './consts.local.js';
|
|
6
7
|
/**
|
|
7
8
|
* Serve the target's built browser app, and put its `/api` behind the same origin.
|
|
8
9
|
*
|
|
@@ -16,31 +17,6 @@ import { TARGET_API_BASE, TARGET_API_PORT, TARGET_WEB_PORT } from '@owlmeans/via
|
|
|
16
17
|
* shares. A loopback address has no reputation to spend and no crawler to answer, so none of it is
|
|
17
18
|
* reproduced here.
|
|
18
19
|
*/
|
|
19
|
-
const MIME = {
|
|
20
|
-
'.html': 'text/html; charset=utf-8',
|
|
21
|
-
'.js': 'application/javascript; charset=utf-8',
|
|
22
|
-
'.mjs': 'application/javascript; charset=utf-8',
|
|
23
|
-
'.css': 'text/css; charset=utf-8',
|
|
24
|
-
'.json': 'application/json; charset=utf-8',
|
|
25
|
-
'.map': 'application/json; charset=utf-8',
|
|
26
|
-
'.webmanifest': 'application/manifest+json',
|
|
27
|
-
'.svg': 'image/svg+xml',
|
|
28
|
-
'.png': 'image/png',
|
|
29
|
-
'.jpg': 'image/jpeg',
|
|
30
|
-
'.jpeg': 'image/jpeg',
|
|
31
|
-
'.gif': 'image/gif',
|
|
32
|
-
'.webp': 'image/webp',
|
|
33
|
-
'.ico': 'image/x-icon',
|
|
34
|
-
'.woff': 'font/woff',
|
|
35
|
-
'.woff2': 'font/woff2',
|
|
36
|
-
'.ttf': 'font/ttf',
|
|
37
|
-
'.txt': 'text/plain; charset=utf-8',
|
|
38
|
-
};
|
|
39
|
-
const PLACEHOLDER = '<!doctype html><html lang="en"><head><meta charset="UTF-8"/>'
|
|
40
|
-
+ '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>'
|
|
41
|
-
+ '<title>Not built yet</title></head><body style="font-family:sans-serif">'
|
|
42
|
-
+ '<p style="padding:2rem">This project has not been built yet. Run a build and reload.</p>'
|
|
43
|
-
+ '</body></html>';
|
|
44
20
|
/**
|
|
45
21
|
* The static server, reading its directory per request.
|
|
46
22
|
*
|
package/build/run/serve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/run/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,GAAG,MAAM,kBAAkB,CAAA;AAClC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/run/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,GAAG,MAAM,kBAAkB,CAAA;AAClC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAGrD;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,SAAuB,EAAE,OAAO,GAAuB,EAAE,EAC5C,EAAE;IACf,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,eAAe,CAAA;IAClD,MAAM,SAAS,GAAG,IAAI,eAAe,EAAE,CAAA;IACvC,IAAI,MAAM,GAAuB,IAAI,CAAA;IACrC,IAAI,IAAI,GAAG,eAAe,CAAA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AE,EAAE;gBAC1C,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBAC7B,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;YACnD,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,MAAM,OAAO,GAAG,MAAM,CAAA;YACtB,MAAM,GAAG,IAAI,CAAA;YACb,IAAI,OAAO,IAAI,IAAI;gBAAE,OAAM;YAE3B,MAAM,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QACpE,CAAC;QAED,IAAI,IAAI,KAAK,OAAO,IAAI,CAAA,CAAC,CAAC;KAC3B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LocalProcessRecord, LocalRunRecord } from '../types.js';
|
|
2
|
+
/** What a local run of ONE project directory is, written down, and the children it starts. */
|
|
3
|
+
export interface RunStateHelper {
|
|
4
|
+
/** The run record of the directory, or `null` when there is none or it cannot be read. */
|
|
5
|
+
readRun: () => Promise<LocalRunRecord | null>;
|
|
6
|
+
writeRun: (record: LocalRunRecord) => Promise<void>;
|
|
7
|
+
clearRun: () => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Start the target's HTTP server as a detached child.
|
|
10
|
+
*
|
|
11
|
+
* Detached so the whole group can be signalled later — the child is a shell wrapping `bun`, and a
|
|
12
|
+
* signal aimed at the shell alone leaves `bun` holding the port.
|
|
13
|
+
*/
|
|
14
|
+
startApi: (env?: Record<string, string>) => Promise<LocalProcessRecord>;
|
|
15
|
+
/**
|
|
16
|
+
* Start the target's queue worker, when this tree has one.
|
|
17
|
+
*
|
|
18
|
+
* The SAME `dist/index.js` as the api, out of the same package tree — the argv marker is the only
|
|
19
|
+
* thing separating the two processes, which is why nothing may reclaim a port without excluding
|
|
20
|
+
* the other's marker. Most generated applications declare no queues, and their absence is not a
|
|
21
|
+
* degraded state.
|
|
22
|
+
*/
|
|
23
|
+
startWorker: () => Promise<LocalProcessRecord | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Bounce the api child so it reconciles the target's tables against its code.
|
|
26
|
+
*
|
|
27
|
+
* What `DbSync` means for a target that owns its own structure: every `@owlmeans/postgres`
|
|
28
|
+
* resource creates and updates its table while the context initializes, so there is nothing to
|
|
29
|
+
* generate and no migration file to apply — the sync IS the restart. A tree with no run in front
|
|
30
|
+
* of it answers `null`: there is no process to bounce, and reporting that as a failure would send
|
|
31
|
+
* a caller after a repair that does not apply.
|
|
32
|
+
*/
|
|
33
|
+
restartApi: () => Promise<string | null>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/run/state/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAErE,8FAA8F;AAC9F,MAAM,WAAW,cAAc;IAC7B,0FAA0F;IAC1F,OAAO,EAAE,MAAM,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnD,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACvE;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;IACrD;;;;;;;;OAQG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/run/state/types.ts"],"names":[],"mappings":""}
|
package/build/run/state.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT } from '@owlmeans/viable-common';
|
|
2
|
+
import type { RunStateHelper } from './state/types.js';
|
|
3
|
+
export { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT };
|
|
2
4
|
/**
|
|
3
5
|
* What a local run is, written down.
|
|
4
6
|
*
|
|
@@ -10,66 +12,5 @@ import { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT } from '@owlmeans/
|
|
|
10
12
|
* The record is a file rather than memory because the processes outlive the call that started
|
|
11
13
|
* them and, on a restarted connector, outlive the process that started them too.
|
|
12
14
|
*/
|
|
13
|
-
export
|
|
14
|
-
pid: number;
|
|
15
|
-
port: number;
|
|
16
|
-
/**
|
|
17
|
-
* The id this instance answers `/api/healtz` with.
|
|
18
|
-
*
|
|
19
|
-
* Port ownership is a restart's only proof: the child is a shell wrapping `bun`, so a signal
|
|
20
|
-
* the shell dies from and `bun` survives leaves an orphan holding the port while the exit
|
|
21
|
-
* handler says "gone". A replacement then loses the bind and exits — and since a failed
|
|
22
|
-
* `listen` announces nothing on its own, everything keeps reporting healthy while the older
|
|
23
|
-
* build is what is being served.
|
|
24
|
-
*/
|
|
25
|
-
bootId?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface LocalRunRecord {
|
|
28
|
-
dir: string;
|
|
29
|
-
startedAt: string;
|
|
30
|
-
api?: LocalProcessRecord;
|
|
31
|
-
worker?: LocalProcessRecord;
|
|
32
|
-
/** The process serving the built browser app — this connector itself, not a child. */
|
|
33
|
-
web?: LocalProcessRecord;
|
|
34
|
-
}
|
|
35
|
-
export declare const readRun: (dir: string) => Promise<LocalRunRecord | null>;
|
|
36
|
-
export declare const writeRun: (dir: string, record: LocalRunRecord) => Promise<void>;
|
|
37
|
-
export declare const clearRun: (dir: string) => Promise<void>;
|
|
38
|
-
/** Whether the api recorded here is still a live process. */
|
|
39
|
-
export declare const apiRunning: (record: LocalRunRecord | null) => boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Start the target's HTTP server as a detached child.
|
|
42
|
-
*
|
|
43
|
-
* Detached so the whole group can be signalled later — the child is a shell wrapping `bun`, and a
|
|
44
|
-
* signal aimed at the shell alone leaves `bun` holding the port.
|
|
45
|
-
*/
|
|
46
|
-
export declare const startApi: (dir: string, env?: Record<string, string>) => Promise<LocalProcessRecord>;
|
|
47
|
-
/**
|
|
48
|
-
* Start the target's queue worker, when this tree has one.
|
|
49
|
-
*
|
|
50
|
-
* The SAME `dist/index.js` as the api, out of the same package tree — the argv marker is the only
|
|
51
|
-
* thing separating the two processes, which is why nothing may reclaim a port without excluding
|
|
52
|
-
* the other's marker. Most generated applications declare no queues, and their absence is not a
|
|
53
|
-
* degraded state.
|
|
54
|
-
*/
|
|
55
|
-
export declare const startWorker: (dir: string) => Promise<LocalProcessRecord | null>;
|
|
56
|
-
/**
|
|
57
|
-
* Stop a recorded process and wait for its port to actually free.
|
|
58
|
-
*
|
|
59
|
-
* The port and not the pid is what a replacement needs, so that is what is waited on.
|
|
60
|
-
*/
|
|
61
|
-
export declare const stopProcess: (record: LocalProcessRecord | undefined) => Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Bounce the api child so it reconciles the target's tables against its code.
|
|
64
|
-
*
|
|
65
|
-
* What `DbSync` means for a target that owns its own structure: every `@owlmeans/postgres`
|
|
66
|
-
* resource creates and updates its table while the context initializes, so there is nothing to
|
|
67
|
-
* generate and no migration file to apply — the sync IS the restart. A tree with no run in front
|
|
68
|
-
* of it answers `null`: there is no process to bounce, and reporting that as a failure would send
|
|
69
|
-
* a caller after a repair that does not apply.
|
|
70
|
-
*/
|
|
71
|
-
export declare const restartApi: (dir: string) => Promise<string | null>;
|
|
72
|
-
/** Whether anything is answering on the api's port right now. */
|
|
73
|
-
export declare const apiListening: (port?: number) => Promise<boolean>;
|
|
74
|
-
export { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT };
|
|
15
|
+
export declare const makeRunStateHelper: (dir: string) => RunStateHelper;
|
|
75
16
|
//# sourceMappingURL=state.d.ts.map
|
package/build/run/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/run/state.ts"],"names":[],"mappings":"AAKA,OAAO,EACoD,eAAe,EAAE,eAAe,EAEzF,kBAAkB,EACnB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/run/state.ts"],"names":[],"mappings":"AAKA,OAAO,EACoD,eAAe,EAAE,eAAe,EAEzF,kBAAkB,EACnB,MAAM,yBAAyB,CAAA;AAQhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA;AAE/D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,QAAS,MAAM,KAAG,cAkGhD,CAAA"}
|
package/build/run/state.js
CHANGED
|
@@ -3,134 +3,107 @@ import { spawn } from 'node:child_process';
|
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
4
|
import p from 'node:path';
|
|
5
5
|
import { CONNECT_MARKER_DIR, CONNECT_RUN_FILE, TARGET_API_MARKER, TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_MARKER, TARGET_WORKER_PORT } from '@owlmeans/viable-common';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
const content = await fs.readFile(runFile(dir), 'utf-8').catch(() => null);
|
|
13
|
-
if (content == null)
|
|
14
|
-
return null;
|
|
15
|
-
try {
|
|
16
|
-
const parsed = JSON.parse(content);
|
|
17
|
-
return typeof parsed === 'object' && parsed !== null ? parsed : null;
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
export const writeRun = async (dir, record) => {
|
|
24
|
-
await fs.ensureDir(p.join(dir, CONNECT_MARKER_DIR));
|
|
25
|
-
await fs.writeFile(runFile(dir), `${JSON.stringify(record, null, 2)}\n`);
|
|
26
|
-
};
|
|
27
|
-
export const clearRun = async (dir) => {
|
|
28
|
-
await fs.rm(runFile(dir), { force: true }).catch(() => undefined);
|
|
29
|
-
};
|
|
30
|
-
/** Whether the api recorded here is still a live process. */
|
|
31
|
-
export const apiRunning = (record) => record != null && isAlive(record.api?.pid);
|
|
32
|
-
/**
|
|
33
|
-
* Start the target's HTTP server as a detached child.
|
|
34
|
-
*
|
|
35
|
-
* Detached so the whole group can be signalled later — the child is a shell wrapping `bun`, and a
|
|
36
|
-
* signal aimed at the shell alone leaves `bun` holding the port.
|
|
37
|
-
*/
|
|
38
|
-
export const startApi = async (dir, env = {}) => {
|
|
39
|
-
const bootId = randomUUID();
|
|
40
|
-
const cwd = apiPath(dir);
|
|
41
|
-
// A run killed without a stop leaves this child alive — detaching it is what keeps it
|
|
42
|
-
// running after the tool that started it exits. What survives holds the port, and the
|
|
43
|
-
// replacement then loses the bind and exits without announcing it.
|
|
44
|
-
if (!await waitForPortFree(TARGET_API_PORT, 2_000)) {
|
|
45
|
-
await reclaimPort(TARGET_API_PORT, TARGET_API_MARKER);
|
|
46
|
-
}
|
|
47
|
-
const child = spawn('bun', ['dist/index.js', TARGET_API_MARKER], {
|
|
48
|
-
cwd,
|
|
49
|
-
detached: true,
|
|
50
|
-
shell: true,
|
|
51
|
-
stdio: 'ignore',
|
|
52
|
-
env: {
|
|
53
|
-
...process.env,
|
|
54
|
-
...await backendEnv(dir),
|
|
55
|
-
BACKEND_PORT: `${TARGET_API_PORT}`,
|
|
56
|
-
BACKEND_BOOT_ID: bootId,
|
|
57
|
-
...env,
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
child.unref();
|
|
61
|
-
return { pid: child.pid ?? -1, port: TARGET_API_PORT, bootId };
|
|
62
|
-
};
|
|
6
|
+
import { makeTargetEnvHelper } from '../executor/env.js';
|
|
7
|
+
import { makeLayoutHelper } from '../executor/layout.js';
|
|
8
|
+
import { integrityHelper } from '../executor/integrity.js';
|
|
9
|
+
import { spawnHelper } from '../executor/spawn.js';
|
|
10
|
+
import { runProcessHelper } from './process.js';
|
|
11
|
+
export { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT };
|
|
63
12
|
/**
|
|
64
|
-
*
|
|
13
|
+
* What a local run is, written down.
|
|
65
14
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* the
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
export const startWorker = async (dir) => {
|
|
72
|
-
if (!hasWorker(dir))
|
|
73
|
-
return null;
|
|
74
|
-
const cwd = workerPath(dir);
|
|
75
|
-
if (cwd == null)
|
|
76
|
-
return null;
|
|
77
|
-
const bootId = randomUUID();
|
|
78
|
-
const child = spawn('bun', ['dist/index.js', TARGET_WORKER_MARKER], {
|
|
79
|
-
cwd,
|
|
80
|
-
detached: true,
|
|
81
|
-
shell: true,
|
|
82
|
-
stdio: 'ignore',
|
|
83
|
-
env: {
|
|
84
|
-
...process.env,
|
|
85
|
-
...await backendEnv(dir),
|
|
86
|
-
// The target reads one "port I bind" variable and the worker binds its health port with it;
|
|
87
|
-
// `WORKER_PORT` travels beside it so a worker that grew its own variable finds it.
|
|
88
|
-
BACKEND_PORT: `${TARGET_WORKER_PORT}`,
|
|
89
|
-
WORKER_PORT: `${TARGET_WORKER_PORT}`,
|
|
90
|
-
BACKEND_BOOT_ID: bootId,
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
|
-
child.unref();
|
|
94
|
-
return { pid: child.pid ?? -1, port: TARGET_WORKER_PORT, bootId };
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Stop a recorded process and wait for its port to actually free.
|
|
15
|
+
* A separate module from the run itself, and the separation is load-bearing: `DbSync` has to
|
|
16
|
+
* bounce the api child, `DbSync` lives in the shell commands, and the shell commands are reached
|
|
17
|
+
* through the executor the run is built on. Everything that touches a child process therefore
|
|
18
|
+
* lives here, below both of them, instead of making the three import each other in a circle.
|
|
98
19
|
*
|
|
99
|
-
* The
|
|
20
|
+
* The record is a file rather than memory because the processes outlive the call that started
|
|
21
|
+
* them and, on a restarted connector, outlive the process that started them too.
|
|
100
22
|
*/
|
|
101
|
-
export const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
23
|
+
export const makeRunStateHelper = (dir) => {
|
|
24
|
+
const runFile = () => p.join(dir, CONNECT_RUN_FILE);
|
|
25
|
+
const readRun = async () => {
|
|
26
|
+
const content = await fs.readFile(runFile(), 'utf-8').catch(() => null);
|
|
27
|
+
if (content == null)
|
|
28
|
+
return null;
|
|
29
|
+
try {
|
|
30
|
+
const parsed = JSON.parse(content);
|
|
31
|
+
return typeof parsed === 'object' && parsed !== null ? parsed : null;
|
|
108
32
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
33
|
+
catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const writeRun = async (record) => {
|
|
38
|
+
await fs.ensureDir(p.join(dir, CONNECT_MARKER_DIR));
|
|
39
|
+
await fs.writeFile(runFile(), `${JSON.stringify(record, null, 2)}\n`);
|
|
40
|
+
};
|
|
41
|
+
const clearRun = async () => {
|
|
42
|
+
await fs.rm(runFile(), { force: true }).catch(() => undefined);
|
|
43
|
+
};
|
|
44
|
+
const startApi = async (env = {}) => {
|
|
45
|
+
const bootId = randomUUID();
|
|
46
|
+
const cwd = makeLayoutHelper(dir).apiPath();
|
|
47
|
+
// A run killed without a stop leaves this child alive — detaching it is what keeps it
|
|
48
|
+
// running after the tool that started it exits. What survives holds the port, and the
|
|
49
|
+
// replacement then loses the bind and exits without announcing it.
|
|
50
|
+
if (!await spawnHelper.waitForPortFree(TARGET_API_PORT, 2_000)) {
|
|
51
|
+
await spawnHelper.reclaimPort(TARGET_API_PORT, TARGET_API_MARKER);
|
|
52
|
+
}
|
|
53
|
+
const child = spawn('bun', ['dist/index.js', TARGET_API_MARKER], {
|
|
54
|
+
cwd,
|
|
55
|
+
detached: true,
|
|
56
|
+
shell: true,
|
|
57
|
+
stdio: 'ignore',
|
|
58
|
+
env: {
|
|
59
|
+
...process.env,
|
|
60
|
+
...await makeTargetEnvHelper(dir).backendEnv(),
|
|
61
|
+
BACKEND_PORT: `${TARGET_API_PORT}`,
|
|
62
|
+
BACKEND_BOOT_ID: bootId,
|
|
63
|
+
...env,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
child.unref();
|
|
67
|
+
return { pid: child.pid ?? -1, port: TARGET_API_PORT, bootId };
|
|
68
|
+
};
|
|
69
|
+
const startWorker = async () => {
|
|
70
|
+
const layout = makeLayoutHelper(dir);
|
|
71
|
+
if (!layout.hasWorker())
|
|
72
|
+
return null;
|
|
73
|
+
const cwd = layout.workerPath();
|
|
74
|
+
if (cwd == null)
|
|
75
|
+
return null;
|
|
76
|
+
const bootId = randomUUID();
|
|
77
|
+
const child = spawn('bun', ['dist/index.js', TARGET_WORKER_MARKER], {
|
|
78
|
+
cwd,
|
|
79
|
+
detached: true,
|
|
80
|
+
shell: true,
|
|
81
|
+
stdio: 'ignore',
|
|
82
|
+
env: {
|
|
83
|
+
...process.env,
|
|
84
|
+
...await makeTargetEnvHelper(dir).backendEnv(),
|
|
85
|
+
// The target reads one "port I bind" variable and the worker binds its health port with it;
|
|
86
|
+
// `WORKER_PORT` travels beside it so a worker that grew its own variable finds it.
|
|
87
|
+
BACKEND_PORT: `${TARGET_WORKER_PORT}`,
|
|
88
|
+
WORKER_PORT: `${TARGET_WORKER_PORT}`,
|
|
89
|
+
BACKEND_BOOT_ID: bootId,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
child.unref();
|
|
93
|
+
return { pid: child.pid ?? -1, port: TARGET_WORKER_PORT, bootId };
|
|
94
|
+
};
|
|
95
|
+
const restartApi = async () => {
|
|
96
|
+
const record = await readRun();
|
|
97
|
+
if (record == null || record.api == null)
|
|
98
|
+
return null;
|
|
99
|
+
const refused = await integrityHelper.integrityRefusal(dir, 'Refused to restart');
|
|
100
|
+
if (refused != null)
|
|
101
|
+
return refused;
|
|
102
|
+
await runProcessHelper.stopProcess(record.api);
|
|
103
|
+
const api = await startApi();
|
|
104
|
+
await writeRun({ ...record, api });
|
|
124
105
|
return null;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return refused;
|
|
128
|
-
await stopProcess(record.api);
|
|
129
|
-
const api = await startApi(dir);
|
|
130
|
-
await writeRun(dir, { ...record, api });
|
|
131
|
-
return null;
|
|
106
|
+
};
|
|
107
|
+
return { readRun, writeRun, clearRun, startApi, startWorker, restartApi };
|
|
132
108
|
};
|
|
133
|
-
/** Whether anything is answering on the api's port right now. */
|
|
134
|
-
export const apiListening = async (port = TARGET_API_PORT) => await probeListening(port);
|
|
135
|
-
export { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT };
|
|
136
109
|
//# sourceMappingURL=state.js.map
|
package/build/run/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/run/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MA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AG,OAAO,CAAC,GAAG;gBACd,GAAG,MAAM,mBAAmB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE;gBAC9C,4FAA4F;gBAC5F,mFAAmF;gBACnF,YAAY,EAAE,GAAG,kBAAkB,EAAE;gBACrC,WAAW,EAAE,GAAG,kBAAkB,EAAE;gBACpC,eAAe,EAAE,MAAM;aACxB;SACF,CAAC,CAAA;QACF,KAAK,CAAC,KAAK,EAAE,CAAA;QAEb,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAA;IACnE,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,KAAK,IAA4B,EAAE;QACpD,MAAM,MAAM,GAAG,MAAM,OAAO,EAAE,CAAA;QAC9B,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,GAAG,IAAI,IAAI;YAAE,OAAO,IAAI,CAAA;QAErD,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;QACjF,IAAI,OAAO,IAAI,IAAI;YAAE,OAAO,OAAO,CAAA;QAEnC,MAAM,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9C,MAAM,GAAG,GAAG,MAAM,QAAQ,EAAE,CAAA;QAC5B,MAAM,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;QAElC,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,CAAA;AAC3E,CAAC,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface RunLocalOptions {
|
|
2
|
+
/** Build before starting. On by default — starting a stale `dist/` is the confusing failure. */
|
|
3
|
+
build?: boolean;
|
|
4
|
+
log?: (line: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface LocalProcessRecord {
|
|
7
|
+
pid: number;
|
|
8
|
+
port: number;
|
|
9
|
+
/**
|
|
10
|
+
* The id this instance answers `/api/healtz` with.
|
|
11
|
+
*
|
|
12
|
+
* Port ownership is a restart's only proof: the child is a shell wrapping `bun`, so a signal
|
|
13
|
+
* the shell dies from and `bun` survives leaves an orphan holding the port while the exit
|
|
14
|
+
* handler says "gone". A replacement then loses the bind and exits — and since a failed
|
|
15
|
+
* `listen` announces nothing on its own, everything keeps reporting healthy while the older
|
|
16
|
+
* build is what is being served.
|
|
17
|
+
*/
|
|
18
|
+
bootId?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface LocalRunRecord {
|
|
21
|
+
dir: string;
|
|
22
|
+
startedAt: string;
|
|
23
|
+
api?: LocalProcessRecord;
|
|
24
|
+
worker?: LocalProcessRecord;
|
|
25
|
+
/** The process serving the built browser app — this connector itself, not a child. */
|
|
26
|
+
web?: LocalProcessRecord;
|
|
27
|
+
}
|
|
28
|
+
export interface RunLocalResult {
|
|
29
|
+
record: LocalRunRecord | null;
|
|
30
|
+
/**
|
|
31
|
+
* The ports the run uses, so a caller can print an address without composing one.
|
|
32
|
+
*
|
|
33
|
+
* Stated even when a process did not come up: they are where the app WILL answer, and whether
|
|
34
|
+
* it does yet is what `error`, `buildError` and `localStatus` are for.
|
|
35
|
+
*/
|
|
36
|
+
api: number;
|
|
37
|
+
web: number;
|
|
38
|
+
worker?: number;
|
|
39
|
+
/** The reason nothing was started, or the tree was refused. */
|
|
40
|
+
error?: string;
|
|
41
|
+
/** A build ran and failed. The web server still comes up so the state is visible. */
|
|
42
|
+
buildError?: string;
|
|
43
|
+
}
|
|
44
|
+
/** One supervised process, as a status read finds it. */
|
|
45
|
+
export interface LocalProcessStatus {
|
|
46
|
+
pid: number;
|
|
47
|
+
port: number;
|
|
48
|
+
alive: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface LocalRunStatus {
|
|
51
|
+
running: boolean;
|
|
52
|
+
startedAt?: string;
|
|
53
|
+
/** Ports, flat, for a caller composing an address or a one-line report. */
|
|
54
|
+
api?: number;
|
|
55
|
+
worker?: number;
|
|
56
|
+
web?: number;
|
|
57
|
+
/** The target's own boot phase, when it got far enough to report one. */
|
|
58
|
+
phase?: string;
|
|
59
|
+
/** Whether the target says it is serving — never the same question as "the pid is alive". */
|
|
60
|
+
ready?: boolean;
|
|
61
|
+
/** Why it is not ready. Absent when it is. */
|
|
62
|
+
reason?: string;
|
|
63
|
+
processes: {
|
|
64
|
+
api?: LocalProcessStatus;
|
|
65
|
+
worker?: LocalProcessStatus;
|
|
66
|
+
web?: LocalProcessStatus;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface LocalServer {
|
|
70
|
+
listen: (port?: number, host?: string) => Promise<void>;
|
|
71
|
+
close: () => Promise<void>;
|
|
72
|
+
port: number;
|
|
73
|
+
}
|
|
74
|
+
export interface LocalServerOptions {
|
|
75
|
+
/** Where the target's api answers. The proxy target, not something the browser ever sees. */
|
|
76
|
+
apiPort?: number;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/run/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,gGAAgG;IAChG,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAA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CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/run/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** A pull that came back empty faster than this held nothing open. */
|
|
2
|
+
export declare const FAST_PULL_MS = 1000;
|
|
3
|
+
/** How long the pull loop rests after such a pull before asking again. */
|
|
4
|
+
export declare const EMPTY_PULL_PAUSE_MS = 1500;
|
|
5
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/session/consts.local.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,eAAO,MAAM,YAAY,OAAQ,CAAA;AAEjC,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,OAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/session/consts.local.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAA;AAEjC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAA"}
|
package/build/session/index.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { ConnectSessionStatus } from '@owlmeans/viable-common';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
api: ConnectorApi;
|
|
5
|
-
open: OpenSessionArgs;
|
|
6
|
-
/** Absent for a cloud target: the platform's own pod executes its commands. */
|
|
7
|
-
executor?: LocalExecutor;
|
|
8
|
-
/** Which deployment this is, recorded in the project's marker so a later connector finds it. */
|
|
9
|
-
apiUrl?: string;
|
|
10
|
-
log?: (line: string) => void;
|
|
11
|
-
}
|
|
2
|
+
import type { SessionRuntime } from '../types.js';
|
|
3
|
+
import type { SessionOptions } from './types.js';
|
|
12
4
|
export declare const openSession: (opts: SessionOptions) => Promise<SessionRuntime>;
|
|
13
5
|
export { ConnectSessionStatus };
|
|
6
|
+
export * from './queue.js';
|
|
14
7
|
export * from './tasks.js';
|
|
8
|
+
export * from './questions.js';
|
|
9
|
+
export type { SessionOptions } from './types.js';
|
|
15
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,oBAAoB,EAAsJ,MAAM,yBAAyB,CAAA;AAErP,OAAO,KAAK,EAAiB,cAAc,EAAgB,MAAM,aAAa,CAAA;AAK9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAoDhD,eAAO,MAAM,WAAW,SAAgB,cAAc,KAAG,OAAO,CAAC,cAAc,CAuN9E,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAE9B,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA"}
|