@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/project/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/project/env.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,QAAS,MAAM,KAAG,gBAiFlD,CAAA"}
|
package/build/project/env.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
|
-
import net from 'node:net';
|
|
3
2
|
import p from 'node:path';
|
|
4
|
-
import {
|
|
3
|
+
import { SubProject } from '@owlmeans/viable-common';
|
|
5
4
|
import { confineToProject } from '../executor/files.js';
|
|
6
|
-
import {
|
|
5
|
+
import { makeLayoutHelper } from '../executor/layout.js';
|
|
6
|
+
import { REQUIRED_ENV_KEYS, ROOT_ENV_FILE } from './consts.js';
|
|
7
|
+
import { dotenvHelper } from './dotenv.js';
|
|
8
|
+
import { probeHelper } from './probe.js';
|
|
7
9
|
/**
|
|
8
10
|
* The target's `.env` files — the one thing about a local project the platform does not own.
|
|
9
11
|
*
|
|
@@ -13,221 +15,67 @@ import { subprojectDir, targetPaths } from '../executor/layout.js';
|
|
|
13
15
|
* they added. So a configure push rewrites only what it wrote last time — the block between the
|
|
14
16
|
* two markers — and every line outside it survives untouched.
|
|
15
17
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* anything it understands that this does not is something the target's own runtime would have to
|
|
34
|
-
* understand too.
|
|
35
|
-
*/
|
|
36
|
-
export const parseEnv = (content) => {
|
|
37
|
-
const values = {};
|
|
38
|
-
for (const raw of content.split('\n')) {
|
|
39
|
-
const line = raw.trim();
|
|
40
|
-
if (line === '' || line.startsWith('#'))
|
|
41
|
-
continue;
|
|
42
|
-
const match = /^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/.exec(line);
|
|
43
|
-
if (match == null)
|
|
44
|
-
continue;
|
|
45
|
-
let value = match[2].trim();
|
|
46
|
-
if ((value.startsWith('"') && value.endsWith('"') && value.length > 1)
|
|
47
|
-
|| (value.startsWith("'") && value.endsWith("'") && value.length > 1)) {
|
|
48
|
-
value = value.slice(1, -1);
|
|
49
|
-
}
|
|
50
|
-
values[match[1]] = value;
|
|
51
|
-
}
|
|
52
|
-
return values;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* The api's and the worker's environment — the process side of the target.
|
|
56
|
-
*
|
|
57
|
-
* Everything a server may hold lives here and nowhere else: the database URL, the queue URL, the
|
|
58
|
-
* OIDC secret.
|
|
59
|
-
*/
|
|
60
|
-
export const ROOT_ENV_FILE = '.env';
|
|
61
|
-
/**
|
|
62
|
-
* The browser bundle's environment.
|
|
63
|
-
*
|
|
64
|
-
* A SEPARATE file, and the separation is the whole leak boundary: whatever is in it gets compiled
|
|
65
|
-
* into a bundle anybody can read, so nothing may reach it by merging in the server's file.
|
|
66
|
-
*/
|
|
67
|
-
export const webEnvFile = (dir) => `${targetPaths(dir).dir}/${subprojectDir(dir, SubProject.Web)}/${ROOT_ENV_FILE}`;
|
|
68
|
-
/** The env files a target has, in the order a later one overrides an earlier one. */
|
|
69
|
-
export const envFilePaths = (dir) => [ROOT_ENV_FILE, webEnvFile(dir)];
|
|
70
|
-
/** One env file's values; `{}` for a file that is not there. */
|
|
71
|
-
export const readEnvFile = async (dir, file) => {
|
|
72
|
-
const content = await fs.readFile(confineToProject(dir, file), 'utf-8').catch(() => null);
|
|
73
|
-
return content == null ? {} : parseEnv(content);
|
|
74
|
-
};
|
|
75
|
-
/** Every env file the target has, parsed. */
|
|
76
|
-
export const readEnv = async (dir) => {
|
|
77
|
-
const files = {};
|
|
78
|
-
let values = {};
|
|
79
|
-
for (const file of envFilePaths(dir)) {
|
|
80
|
-
const parsed = await readEnvFile(dir, file);
|
|
81
|
-
files[file] = parsed;
|
|
82
|
-
values = { ...values, ...parsed };
|
|
83
|
-
}
|
|
84
|
-
return { files, values };
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Write the platform's block into each named file, keeping every line the user wrote.
|
|
88
|
-
*
|
|
89
|
-
* The block is delimited rather than diffed because the two writers have no other way to agree on
|
|
90
|
-
* ownership: the platform composes its half whole (it is the only side that knows the OIDC client
|
|
91
|
-
* and its secret) and the user's half is arbitrary. A file with no block yet gets one appended; a
|
|
92
|
-
* file that does not exist is created with the block as its whole content.
|
|
93
|
-
*/
|
|
94
|
-
export const writeEnv = async (dir, payload) => {
|
|
95
|
-
const written = [];
|
|
96
|
-
for (const file of payload.files ?? []) {
|
|
97
|
-
const path = confineToProject(dir, file.path);
|
|
98
|
-
const existing = await fs.readFile(path, 'utf-8').catch(() => '');
|
|
99
|
-
const next = replaceManagedBlock(existing, yieldToUser(existing, file.content ?? ''));
|
|
100
|
-
if (next !== existing) {
|
|
101
|
-
await fs.ensureDir(p.dirname(path));
|
|
102
|
-
await fs.writeFile(path, next);
|
|
18
|
+
export const makeProjectEnvHelper = (dir) => {
|
|
19
|
+
const webEnvFile = () => {
|
|
20
|
+
const layout = makeLayoutHelper(dir);
|
|
21
|
+
return `${layout.targetPaths().dir}/${layout.subprojectDir(SubProject.Web)}/${ROOT_ENV_FILE}`;
|
|
22
|
+
};
|
|
23
|
+
const envFilePaths = () => [ROOT_ENV_FILE, webEnvFile()];
|
|
24
|
+
const readEnvFile = async (file) => {
|
|
25
|
+
const content = await fs.readFile(confineToProject(dir, file), 'utf-8').catch(() => null);
|
|
26
|
+
return content == null ? {} : dotenvHelper.parseEnv(content);
|
|
27
|
+
};
|
|
28
|
+
const readEnv = async () => {
|
|
29
|
+
const files = {};
|
|
30
|
+
let values = {};
|
|
31
|
+
for (const file of envFilePaths()) {
|
|
32
|
+
const parsed = await readEnvFile(file);
|
|
33
|
+
files[file] = parsed;
|
|
34
|
+
values = { ...values, ...parsed };
|
|
103
35
|
}
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
const { values } = await readEnv(dir);
|
|
107
|
-
return {
|
|
108
|
-
written,
|
|
109
|
-
missing: REQUIRED_ENV_KEYS.filter(key => (values[key] ?? '') === ''),
|
|
110
|
-
services: await probeServices(values, payload.probe),
|
|
36
|
+
return { files, values };
|
|
111
37
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
services: await probeServices(values, probe),
|
|
38
|
+
/**
|
|
39
|
+
* What this machine actually provides.
|
|
40
|
+
*
|
|
41
|
+
* Reported, never assumed — the platform provisions nothing here, so the only honest answer comes
|
|
42
|
+
* from a connect attempt. A service the caller did not ask about stays `false` rather than
|
|
43
|
+
* becoming an unrequested round trip.
|
|
44
|
+
*/
|
|
45
|
+
const probeServices = async (values, probe) => {
|
|
46
|
+
const wanted = new Set(probe ?? []);
|
|
47
|
+
return {
|
|
48
|
+
db: wanted.has('db') ? await probeHelper.probeUrl(values.DATABASE_URL) : false,
|
|
49
|
+
valkey: wanted.has('valkey') ? await probeHelper.probeUrl(values.VALKEY_URL) : false,
|
|
50
|
+
};
|
|
126
51
|
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
* application connecting to the placeholder no matter what its owner put in the file.
|
|
146
|
-
*
|
|
147
|
-
* A yielded key is replaced by a comment rather than dropped, so the file says why the platform is
|
|
148
|
-
* not setting something it normally would.
|
|
149
|
-
*/
|
|
150
|
-
export const yieldToUser = (existing, content) => {
|
|
151
|
-
const theirs = parseEnv(outsideManagedBlock(existing));
|
|
152
|
-
if (Object.keys(theirs).length < 1)
|
|
153
|
-
return content;
|
|
154
|
-
return content.split('\n').map(raw => {
|
|
155
|
-
const match = /^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=/.exec(raw.trim());
|
|
156
|
-
if (match == null || !(match[1] in theirs))
|
|
157
|
-
return raw;
|
|
158
|
-
return `# ${match[1]} is set in your own lines, so this block leaves it to you.`;
|
|
159
|
-
}).join('\n');
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* Replace what sits between the markers, and nothing else.
|
|
163
|
-
*
|
|
164
|
-
* A BEGIN with no END — a file truncated mid-write, or hand-edited — is rewritten to the end of
|
|
165
|
-
* the file rather than left alone: the alternative is a block that grows a second copy of itself
|
|
166
|
-
* on every push, and the text after a lost END was the platform's anyway.
|
|
167
|
-
*/
|
|
168
|
-
export const replaceManagedBlock = (existing, content) => {
|
|
169
|
-
const body = content.replace(/^\n+|\n+$/g, '');
|
|
170
|
-
const block = `${CONNECT_ENV_BEGIN}\n${body === '' ? '' : `${body}\n`}${CONNECT_ENV_END}\n`;
|
|
171
|
-
const begin = existing.indexOf(CONNECT_ENV_BEGIN);
|
|
172
|
-
if (begin < 0) {
|
|
173
|
-
const prefix = existing === '' || existing.endsWith('\n') ? existing : `${existing}\n`;
|
|
174
|
-
return `${prefix}${block}`;
|
|
175
|
-
}
|
|
176
|
-
const end = existing.indexOf(CONNECT_ENV_END, begin);
|
|
177
|
-
const after = end < 0 ? existing.length : end + CONNECT_ENV_END.length;
|
|
178
|
-
return `${existing.slice(0, begin)}${block}${existing.slice(after).replace(/^\n/, '')}`;
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* What this machine actually provides.
|
|
182
|
-
*
|
|
183
|
-
* Reported, never assumed — the platform provisions nothing here, so the only honest answer comes
|
|
184
|
-
* from a connect attempt. A service the caller did not ask about stays `false` rather than
|
|
185
|
-
* becoming an unrequested round trip.
|
|
186
|
-
*/
|
|
187
|
-
const probeServices = async (values, probe) => {
|
|
188
|
-
const wanted = new Set(probe ?? []);
|
|
189
|
-
return {
|
|
190
|
-
db: wanted.has('db') ? await probeUrl(values.DATABASE_URL) : false,
|
|
191
|
-
valkey: wanted.has('valkey') ? await probeUrl(values.VALKEY_URL) : false,
|
|
52
|
+
const writeEnv = async (payload) => {
|
|
53
|
+
const written = [];
|
|
54
|
+
for (const file of payload.files ?? []) {
|
|
55
|
+
const path = confineToProject(dir, file.path);
|
|
56
|
+
const existing = await fs.readFile(path, 'utf-8').catch(() => '');
|
|
57
|
+
const next = dotenvHelper.replaceManagedBlock(existing, dotenvHelper.yieldToUser(existing, file.content ?? ''));
|
|
58
|
+
if (next !== existing) {
|
|
59
|
+
await fs.ensureDir(p.dirname(path));
|
|
60
|
+
await fs.writeFile(path, next);
|
|
61
|
+
}
|
|
62
|
+
written.push(file.path);
|
|
63
|
+
}
|
|
64
|
+
const { values } = await readEnv();
|
|
65
|
+
return {
|
|
66
|
+
written,
|
|
67
|
+
missing: REQUIRED_ENV_KEYS.filter(key => (values[key] ?? '') === ''),
|
|
68
|
+
services: await probeServices(values, payload.probe),
|
|
69
|
+
};
|
|
192
70
|
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
export const serviceEndpoint = (url) => {
|
|
201
|
-
if (url == null || url === '')
|
|
202
|
-
return null;
|
|
203
|
-
try {
|
|
204
|
-
const parsed = new URL(url);
|
|
205
|
-
const port = parsed.port !== ''
|
|
206
|
-
? parseInt(parsed.port)
|
|
207
|
-
: DEFAULT_PORTS[parsed.protocol.replace(':', '')];
|
|
208
|
-
if (parsed.hostname === '' || port == null || Number.isNaN(port))
|
|
209
|
-
return null;
|
|
210
|
-
return { host: parsed.hostname, port };
|
|
211
|
-
}
|
|
212
|
-
catch {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
/** Whether something is listening where a connection string points. Exported for the setup flow. */
|
|
217
|
-
export const probeUrl = async (url) => {
|
|
218
|
-
const endpoint = serviceEndpoint(url);
|
|
219
|
-
return endpoint == null ? false : await probePort(endpoint.host, endpoint.port);
|
|
220
|
-
};
|
|
221
|
-
export const probePort = async (host, port, timeoutMs = PROBE_TIMEOUT_MS) => await new Promise(resolve => {
|
|
222
|
-
const socket = net.connect({ host, port });
|
|
223
|
-
const done = (value) => {
|
|
224
|
-
socket.removeAllListeners();
|
|
225
|
-
socket.destroy();
|
|
226
|
-
resolve(value);
|
|
71
|
+
const envStatus = async (probe = ['db', 'valkey']) => {
|
|
72
|
+
const { values } = await readEnv();
|
|
73
|
+
return {
|
|
74
|
+
written: [],
|
|
75
|
+
missing: REQUIRED_ENV_KEYS.filter(key => (values[key] ?? '') === ''),
|
|
76
|
+
services: await probeServices(values, probe),
|
|
77
|
+
};
|
|
227
78
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
socket.once('timeout', () => done(false));
|
|
231
|
-
socket.once('error', () => done(false));
|
|
232
|
-
});
|
|
79
|
+
return { webEnvFile, envFilePaths, readEnvFile, readEnv, writeEnv, envStatus };
|
|
80
|
+
};
|
|
233
81
|
//# sourceMappingURL=env.js.map
|
package/build/project/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src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ACpE,QAAQ,EAAE,MAAM,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC;SAC7C,CAAA;IACH,CAAC,CAAA;IAED,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;AAChF,CAAC,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ConnectMarker } from '@owlmeans/viable-common';
|
|
2
|
+
import type { DiscoveredProject } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* What a local project keeps so a later session knows which platform project it is — read and
|
|
5
|
+
* written for ONE directory.
|
|
6
|
+
*
|
|
7
|
+
* No secrets: an id, a slug and the API it belongs to. A connector attaching to a directory has
|
|
8
|
+
* nothing else to go on — the tree itself is a generated application like any other, and asking
|
|
9
|
+
* the platform "which of my projects is this" needs an id the tree already carries.
|
|
10
|
+
*/
|
|
11
|
+
export interface MarkerHelper {
|
|
12
|
+
/** The marker this directory carries, or `null` when it carries none or an unreadable one. */
|
|
13
|
+
readMarker: () => Promise<ConnectMarker | null>;
|
|
14
|
+
writeMarker: (marker: ConnectMarker) => Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Find the project this directory belongs to, by walking up from it.
|
|
17
|
+
*
|
|
18
|
+
* An agent is started wherever its user happened to be — usually several levels inside the tree —
|
|
19
|
+
* and every tool that acts on "this project" has to mean the same one whichever of those
|
|
20
|
+
* directories it was asked from. The walk stops at the filesystem root; a machine with no marker
|
|
21
|
+
* anywhere above answers `null`, which is how a connector knows to offer attaching rather than
|
|
22
|
+
* assuming.
|
|
23
|
+
*/
|
|
24
|
+
discoverProject: () => Promise<DiscoveredProject | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Whether this directory holds the generated application.
|
|
27
|
+
*
|
|
28
|
+
* Asked before a connector offers to drive a directory, so a person who pointed it at the wrong
|
|
29
|
+
* folder learns that from a sentence rather than from a build that refuses everything.
|
|
30
|
+
*/
|
|
31
|
+
isViableTree: () => Promise<boolean>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/project/marker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,8FAA8F;IAC9F,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAC/C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACrD;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IACxD;;;;;OAKG;IACH,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/project/marker/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DiscoveredProject } from './types.js';
|
|
2
|
+
import type { MarkerHelper } from './marker/types.js';
|
|
2
3
|
/**
|
|
3
4
|
* What a local project keeps so a later session knows which platform project it is.
|
|
4
5
|
*
|
|
@@ -6,29 +7,7 @@ import type { ConnectMarker } from '@owlmeans/viable-common';
|
|
|
6
7
|
* nothing else to go on — the tree itself is a generated application like any other, and asking
|
|
7
8
|
* the platform "which of my projects is this" needs an id the tree already carries.
|
|
8
9
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
dir: string;
|
|
12
|
-
marker: ConnectMarker;
|
|
13
|
-
}
|
|
14
|
-
/** The marker this directory carries, or `null` when it carries none or an unreadable one. */
|
|
15
|
-
export declare const readMarker: (dir: string) => Promise<ConnectMarker | null>;
|
|
16
|
-
export declare const writeMarker: (dir: string, marker: ConnectMarker) => Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Find the project a directory belongs to, by walking up.
|
|
19
|
-
*
|
|
20
|
-
* An agent is started wherever its user happened to be — usually several levels inside the tree —
|
|
21
|
-
* and every tool that acts on "this project" has to mean the same one whichever of those
|
|
22
|
-
* directories it was asked from. The walk stops at the filesystem root; a machine with no marker
|
|
23
|
-
* anywhere above answers `null`, which is how a connector knows to offer attaching rather than
|
|
24
|
-
* assuming.
|
|
25
|
-
*/
|
|
10
|
+
export declare const makeMarkerHelper: (dir: string) => MarkerHelper;
|
|
11
|
+
/** @deprecated compat:factory-refactor — use `makeMarkerHelper(startDir).discoverProject()` */
|
|
26
12
|
export declare const discoverProject: (startDir: string) => Promise<DiscoveredProject | null>;
|
|
27
|
-
/**
|
|
28
|
-
* Whether this directory holds the generated application.
|
|
29
|
-
*
|
|
30
|
-
* Asked before a connector offers to drive a directory, so a person who pointed it at the wrong
|
|
31
|
-
* folder learns that from a sentence rather than from a build that refuses everything.
|
|
32
|
-
*/
|
|
33
|
-
export declare const isViableTree: (dir: string) => Promise<boolean>;
|
|
34
13
|
//# sourceMappingURL=marker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../src/project/marker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../src/project/marker.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,QAAS,MAAM,KAAG,YA6C9C,CAAA;AAED,+FAA+F;AAC/F,eAAO,MAAM,eAAe,aAAoB,MAAM,KAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CACrC,CAAA"}
|
package/build/project/marker.js
CHANGED
|
@@ -1,54 +1,51 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import p from 'node:path';
|
|
3
3
|
import { CONNECT_MARKER_DIR, CONNECT_MARKER_FILE } from '@owlmeans/viable-common';
|
|
4
|
-
import {
|
|
5
|
-
/** The marker this directory carries, or `null` when it carries none or an unreadable one. */
|
|
6
|
-
export const readMarker = async (dir) => {
|
|
7
|
-
const content = await fs.readFile(p.join(dir, CONNECT_MARKER_FILE), 'utf-8').catch(() => null);
|
|
8
|
-
if (content == null)
|
|
9
|
-
return null;
|
|
10
|
-
try {
|
|
11
|
-
const parsed = JSON.parse(content);
|
|
12
|
-
return typeof parsed === 'object' && parsed !== null ? parsed : null;
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
// A half-written or hand-edited marker is the same as none: the connector re-attaches by
|
|
16
|
-
// slug and writes a fresh one, which is strictly better than refusing to open the project.
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export const writeMarker = async (dir, marker) => {
|
|
21
|
-
await fs.ensureDir(p.join(dir, CONNECT_MARKER_DIR));
|
|
22
|
-
await fs.writeFile(p.join(dir, CONNECT_MARKER_FILE), `${JSON.stringify(marker, null, 2)}\n`);
|
|
23
|
-
};
|
|
4
|
+
import { integrityHelper } from '../executor/integrity.js';
|
|
24
5
|
/**
|
|
25
|
-
*
|
|
6
|
+
* What a local project keeps so a later session knows which platform project it is.
|
|
26
7
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* anywhere above answers `null`, which is how a connector knows to offer attaching rather than
|
|
31
|
-
* assuming.
|
|
8
|
+
* No secrets: an id, a slug and the API it belongs to. A connector attaching to a directory has
|
|
9
|
+
* nothing else to go on — the tree itself is a generated application like any other, and asking
|
|
10
|
+
* the platform "which of my projects is this" needs an id the tree already carries.
|
|
32
11
|
*/
|
|
33
|
-
export const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
export const makeMarkerHelper = (dir) => {
|
|
13
|
+
const markerAt = async (at) => {
|
|
14
|
+
const content = await fs.readFile(p.join(at, CONNECT_MARKER_FILE), 'utf-8').catch(() => null);
|
|
15
|
+
if (content == null)
|
|
16
|
+
return null;
|
|
17
|
+
try {
|
|
18
|
+
const parsed = JSON.parse(content);
|
|
19
|
+
return typeof parsed === 'object' && parsed !== null ? parsed : null;
|
|
39
20
|
}
|
|
40
|
-
|
|
41
|
-
|
|
21
|
+
catch {
|
|
22
|
+
// A half-written or hand-edited marker is the same as none: the connector re-attaches by
|
|
23
|
+
// slug and writes a fresh one, which is strictly better than refusing to open the project.
|
|
42
24
|
return null;
|
|
43
25
|
}
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
};
|
|
27
|
+
const readMarker = async () => await markerAt(dir);
|
|
28
|
+
const writeMarker = async (marker) => {
|
|
29
|
+
await fs.ensureDir(p.join(dir, CONNECT_MARKER_DIR));
|
|
30
|
+
await fs.writeFile(p.join(dir, CONNECT_MARKER_FILE), `${JSON.stringify(marker, null, 2)}\n`);
|
|
31
|
+
};
|
|
32
|
+
const discoverProject = async () => {
|
|
33
|
+
let at = p.resolve(dir);
|
|
34
|
+
for (;;) {
|
|
35
|
+
const marker = await markerAt(at);
|
|
36
|
+
if (marker != null) {
|
|
37
|
+
return { dir: at, marker };
|
|
38
|
+
}
|
|
39
|
+
const parent = p.dirname(at);
|
|
40
|
+
if (parent === at) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
at = parent;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const isViableTree = async () => (await integrityHelper.verifyTarget(dir)).ok;
|
|
47
|
+
return { readMarker, writeMarker, discoverProject, isViableTree };
|
|
46
48
|
};
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
*
|
|
50
|
-
* Asked before a connector offers to drive a directory, so a person who pointed it at the wrong
|
|
51
|
-
* folder learns that from a sentence rather than from a build that refuses everything.
|
|
52
|
-
*/
|
|
53
|
-
export const isViableTree = async (dir) => (await verifyTarget(dir)).ok;
|
|
49
|
+
/** @deprecated compat:factory-refactor — use `makeMarkerHelper(startDir).discoverProject()` */
|
|
50
|
+
export const discoverProject = async (startDir) => await makeMarkerHelper(startDir).discoverProject();
|
|
54
51
|
//# sourceMappingURL=marker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marker.js","sourceRoot":"","sources":["../../src/project/marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,CAAC,MAAM,WAAW,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"marker.js","sourceRoot":"","sources":["../../src/project/marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,CAAC,MAAM,WAAW,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAsB,MAAM,yBAAyB,CAAA;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAgB,EAAE;IAC5D,MAAM,QAAQ,GAAG,KAAK,EAAE,EAAU,EAAiC,EAAE;QACnE,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;QAC7F,IAAI,OAAO,IAAI,IAAI;YAAE,OAAO,IAAI,CAAA;QAEhC,IAAI,CAAC;YACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,OAAO,C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,MAAM,eAAe,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IAE9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,CAAA;AACnE,CAAC,CAAA;AAED,+FAA+F;AAC/F,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,QAAgB,EAAqC,EAAE,CAC3F,MAAM,gBAAgB,CAAC,QAAQ,CAAC,CAAC,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ServiceEndpoint {
|
|
2
|
+
host: string;
|
|
3
|
+
port: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* What this machine actually provides, asked by a connect attempt — the platform provisions
|
|
7
|
+
* nothing here, so the only honest answer comes from trying.
|
|
8
|
+
*/
|
|
9
|
+
export interface ProbeHelper {
|
|
10
|
+
/**
|
|
11
|
+
* The host and port a connection URL names.
|
|
12
|
+
*
|
|
13
|
+
* `null` for anything unparseable, so a malformed value degrades to "not reachable" rather than
|
|
14
|
+
* throwing somewhere a caller has no branch for it.
|
|
15
|
+
*/
|
|
16
|
+
serviceEndpoint: (url: string | undefined) => ServiceEndpoint | null;
|
|
17
|
+
/** Whether something is listening where a connection string points. Exported for the setup flow. */
|
|
18
|
+
probeUrl: (url: string | undefined) => Promise<boolean>;
|
|
19
|
+
/** Whether a TCP connect to `host:port` succeeds within the timeout. */
|
|
20
|
+
probePort: (host: string, port: number, timeoutMs?: number) => Promise<boolean>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/project/probe/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,eAAe,GAAG,IAAI,CAAA;IACpE,oGAAoG;IACpG,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACvD,wEAAwE;IACxE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAChF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/project/probe/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../../src/project/probe.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,kBAAkB,CAAA;AAEpE,eAAO,MAAM,iBAAiB,QAAO,WAuCpC,CAAA;AAED,eAAO,MAAM,WAAW,aAAsB,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import net from 'node:net';
|
|
2
|
+
import { DEFAULT_PORTS, PROBE_TIMEOUT_MS } from './consts.local.js';
|
|
3
|
+
export const createProbeHelper = () => {
|
|
4
|
+
const serviceEndpoint = (url) => {
|
|
5
|
+
if (url == null || url === '')
|
|
6
|
+
return null;
|
|
7
|
+
try {
|
|
8
|
+
const parsed = new URL(url);
|
|
9
|
+
const port = parsed.port !== ''
|
|
10
|
+
? parseInt(parsed.port)
|
|
11
|
+
: DEFAULT_PORTS[parsed.protocol.replace(':', '')];
|
|
12
|
+
if (parsed.hostname === '' || port == null || Number.isNaN(port))
|
|
13
|
+
return null;
|
|
14
|
+
return { host: parsed.hostname, port };
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const probePort = async (host, port, timeoutMs = PROBE_TIMEOUT_MS) => await new Promise(resolve => {
|
|
21
|
+
const socket = net.connect({ host, port });
|
|
22
|
+
const done = (value) => {
|
|
23
|
+
socket.removeAllListeners();
|
|
24
|
+
socket.destroy();
|
|
25
|
+
resolve(value);
|
|
26
|
+
};
|
|
27
|
+
socket.setTimeout(timeoutMs);
|
|
28
|
+
socket.once('connect', () => done(true));
|
|
29
|
+
socket.once('timeout', () => done(false));
|
|
30
|
+
socket.once('error', () => done(false));
|
|
31
|
+
});
|
|
32
|
+
const probeUrl = async (url) => {
|
|
33
|
+
const endpoint = serviceEndpoint(url);
|
|
34
|
+
return endpoint == null ? false : await probePort(endpoint.host, endpoint.port);
|
|
35
|
+
};
|
|
36
|
+
return { serviceEndpoint, probeUrl, probePort };
|
|
37
|
+
};
|
|
38
|
+
export const probeHelper = createProbeHelper();
|
|
39
|
+
//# sourceMappingURL=probe.js.map
|