@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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ConnectGitCommit, ConnectGitState, ConnectGitSyncResult, ConnectGithubBranchList, ConnectGithubConnection, ConnectGithubRepoList } from '@owlmeans/viable-common';
|
|
2
|
+
/** How the git and GitHub tools put the platform's answers into words. */
|
|
3
|
+
export interface GitToolHelper {
|
|
4
|
+
/** The connection in one line: who connected it, where it publishes, and whether it still works. */
|
|
5
|
+
renderConnection: (connection: ConnectGithubConnection | null) => string;
|
|
6
|
+
/**
|
|
7
|
+
* The whole git state: the GitHub connection, then the working tree — or why it cannot be read now
|
|
8
|
+
* (the preview is not ready) — and what to do next.
|
|
9
|
+
*/
|
|
10
|
+
renderState: (state: ConnectGitState) => string;
|
|
11
|
+
/** The latest commits, newest first, each with the hash a revert names. */
|
|
12
|
+
renderHistory: (commits: ConnectGitCommit[]) => string;
|
|
13
|
+
/** What a push or a pull did, and what to do about a refusal. */
|
|
14
|
+
renderSync: (direction: string, result: ConnectGitSyncResult) => string;
|
|
15
|
+
/** One page of repositories, with how to reach the next. */
|
|
16
|
+
renderRepos: (list: ConnectGithubRepoList, search?: string) => string;
|
|
17
|
+
/** One page of one repository's branches. */
|
|
18
|
+
renderBranches: (fullName: string, list: ConnectGithubBranchList) => string;
|
|
19
|
+
/**
|
|
20
|
+
* The address the user opens to connect GitHub, with what happens there and after it — the
|
|
21
|
+
* authorization ends in their browser, never in a tool.
|
|
22
|
+
*/
|
|
23
|
+
renderAuthorize: (authorizeUrl: string) => string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/git/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,uBAAuB,EACzG,qBAAqB,EACtB,MAAM,yBAAyB,CAAA;AAEhC,0EAA0E;AAC1E,MAAM,WAAW,aAAa;IAC5B,oGAAoG;IACpG,gBAAgB,EAAE,CAAC,UAAU,EAAE,uBAAuB,GAAG,IAAI,KAAK,MAAM,CAAA;IACxE;;;OAGG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,MAAM,CAAA;IAC/C,2EAA2E;IAC3E,aAAa,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,MAAM,CAAA;IACtD,iEAAiE;IACjE,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,KAAK,MAAM,CAAA;IACvE,4DAA4D;IAC5D,WAAW,EAAE,CAAC,IAAI,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACrE,6CAA6C;IAC7C,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,KAAK,MAAM,CAAA;IAC3E;;;OAGG;IACH,eAAe,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tools/git/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/tools/git.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,QAAO,aA4FtC,CAAA;AAED,eAAO,MAAM,aAAa,eAAwB,CAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { GIT_FILES_SHOWN, GIT_SYNC_WORDS, GITHUB_STATUS_WORDS } from './consts.local.js';
|
|
2
|
+
export const createGitToolHelper = () => {
|
|
3
|
+
const day = (iso) => iso.slice(0, 10);
|
|
4
|
+
const commitLine = (commit) => `${commit.shortHash} ${commit.subject} — ${commit.authorName}, ${day(commit.committedAt)}`;
|
|
5
|
+
const renderConnection = (connection) => connection == null
|
|
6
|
+
? 'GitHub: not connected — connect_github gives the user the address to authorize it'
|
|
7
|
+
: `GitHub: ${connection.githubLogin}${connection.repoFullName != null ? ` → ${connection.repoFullName}` : ''}`
|
|
8
|
+
+ ` · ${GITHUB_STATUS_WORDS[connection.status] ?? connection.status}`;
|
|
9
|
+
const renderState = ({ connection, git }) => {
|
|
10
|
+
const lines = [renderConnection(connection)];
|
|
11
|
+
if (git == null) {
|
|
12
|
+
lines.push('working tree: not readable now — git lives in the preview, which is not ready.'
|
|
13
|
+
+ ' preview_control { action: start } starts it; then call git_status again.');
|
|
14
|
+
return lines.join('\n');
|
|
15
|
+
}
|
|
16
|
+
if (!git.initialized) {
|
|
17
|
+
lines.push('working tree: no repository yet — the first commit creates it.');
|
|
18
|
+
return lines.join('\n');
|
|
19
|
+
}
|
|
20
|
+
lines.push(`branch ${git.branch}${git.head != null ? ` · head ${commitLine(git.head)}` : ' · no commits yet'}`);
|
|
21
|
+
if (git.ahead != null || git.behind != null) {
|
|
22
|
+
lines.push(`against GitHub: ${git.ahead ?? 0} ahead, ${git.behind ?? 0} behind`);
|
|
23
|
+
}
|
|
24
|
+
if (git.dirty) {
|
|
25
|
+
lines.push(`${git.changedFiles} uncommitted change(s):`);
|
|
26
|
+
lines.push(...git.files.slice(0, GIT_FILES_SHOWN).map(file => ` ${file.status} ${file.path}`));
|
|
27
|
+
if (git.changedFiles > Math.min(git.files.length, GIT_FILES_SHOWN)) {
|
|
28
|
+
lines.push(` … and ${git.changedFiles - Math.min(git.files.length, GIT_FILES_SHOWN)} more`);
|
|
29
|
+
}
|
|
30
|
+
lines.push('next: git_commit { message } keeps them; git_discard throws them away (confirm: true).');
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
lines.push('working tree: clean');
|
|
34
|
+
}
|
|
35
|
+
return lines.join('\n');
|
|
36
|
+
};
|
|
37
|
+
const renderHistory = commits => commits.length < 1
|
|
38
|
+
? 'No commits yet.'
|
|
39
|
+
: [
|
|
40
|
+
`${commits.length} latest commit(s), newest first:`,
|
|
41
|
+
...commits.map(commit => `- ${commitLine(commit)}`),
|
|
42
|
+
'next: git_revert { hash, confirm: true } brings one commit\'s tree back as a new commit.',
|
|
43
|
+
].join('\n');
|
|
44
|
+
const renderSync = (direction, result) => {
|
|
45
|
+
const words = GIT_SYNC_WORDS[result.status] ?? result.status;
|
|
46
|
+
const position = result.ahead != null || result.behind != null
|
|
47
|
+
? ` (${result.ahead ?? 0} ahead, ${result.behind ?? 0} behind)`
|
|
48
|
+
: '';
|
|
49
|
+
return `${direction}: ${words}${position}.`
|
|
50
|
+
+ (result.message != null && result.message !== '' && result.status !== 'ok' && result.status !== 'up-to-date'
|
|
51
|
+
? `\ngit said: ${result.message}`
|
|
52
|
+
: '')
|
|
53
|
+
+ (direction === 'pull' && result.status === 'ok' ? '\nThe preview was rebuilt from the pulled tree.' : '');
|
|
54
|
+
};
|
|
55
|
+
const renderRepos = (list, search) => list.repos.length < 1
|
|
56
|
+
? `No repositories on page ${list.page}${search != null ? ` matching "${search}"` : ''}.`
|
|
57
|
+
+ (list.hasMore ? ` More on page ${list.page + 1}.` : '')
|
|
58
|
+
: [
|
|
59
|
+
`page ${list.page}${search != null ? ` (matching "${search}" on this page)` : ''}:`,
|
|
60
|
+
...list.repos.map(repo => `- ${repo.fullName}${repo.private ? ' (private)' : ''} · default branch`
|
|
61
|
+
+ ` ${repo.defaultBranch}${repo.archived ? ' · archived' : ''}${repo.fork ? ' · fork' : ''}`
|
|
62
|
+
+ `${repo.language != null ? ` · ${repo.language}` : ''}`),
|
|
63
|
+
...(list.hasMore ? [`More on page ${list.page + 1}.`] : []),
|
|
64
|
+
'next: github_repositories { owner, repo } lists a repository\'s branches.',
|
|
65
|
+
].join('\n');
|
|
66
|
+
const renderBranches = (fullName, list) => list.branches.length < 1
|
|
67
|
+
? `${fullName} has no branches on page ${list.page}.`
|
|
68
|
+
: [
|
|
69
|
+
`${fullName}, page ${list.page}:`,
|
|
70
|
+
...list.branches.map(branch => `- ${branch.name}${branch.protected ? ' (protected)' : ''}`),
|
|
71
|
+
...(list.hasMore ? [`More on page ${list.page + 1}.`] : []),
|
|
72
|
+
].join('\n');
|
|
73
|
+
const renderAuthorize = authorizeUrl => [
|
|
74
|
+
'Ask the user to open this address in the browser where they are signed in to OwlMeans:',
|
|
75
|
+
authorizeUrl,
|
|
76
|
+
'GitHub asks them to authorize access to their repositories; it then returns to the OwlMeans web'
|
|
77
|
+
+ ' application, which finishes connecting this project. The address works once, for ten minutes.',
|
|
78
|
+
'next: once they say it is done, git_status shows the connection.',
|
|
79
|
+
].join('\n');
|
|
80
|
+
return { renderConnection, renderState, renderHistory, renderSync, renderRepos, renderBranches, renderAuthorize };
|
|
81
|
+
};
|
|
82
|
+
export const gitToolHelper = createGitToolHelper();
|
|
83
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/tools/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAGxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAkB,EAAE;IACrD,MAAM,GAAG,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAErD,MAAM,UAAU,GAAG,CAAC,MAAwB,EAAU,EAAE,CACtD,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,OAAO,MAAM,MAAM,CAAC,UAAU,KAAK,GAAG,CAAC,MAAM,CAAC,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,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEd,MAAM,eAAe,GAAqC,YAAY,CAAC,EAAE,CAAC;QACxE,wFAAwF;QACxF,YAAY;QACZ,iGAAiG;cAC/F,gGAAgG;QAClG,kEAAkE;KACnE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEZ,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA;AACnH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ModelTask } from '@owlmeans/viable-common';
|
|
2
|
+
import type { SessionRuntime } from '../../types.js';
|
|
3
|
+
import type { InflightCall } from '../inflight/types.js';
|
|
4
|
+
import type { McpToolAnswer, ToolDefinition, ToolResult } from '../types.js';
|
|
5
|
+
/** What the task loop found once it had done its own work. */
|
|
6
|
+
export interface HandoverCollection {
|
|
7
|
+
/** Detached calls that settled — each reported here and nowhere else. */
|
|
8
|
+
settled: InflightCall[];
|
|
9
|
+
/** The next model task, taken; `null` when none was queued. */
|
|
10
|
+
task: ModelTask | null;
|
|
11
|
+
/** Calls still running on the platform that no tool waits on. */
|
|
12
|
+
running: InflightCall[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The delegated mode's tool calls: a platform call that stops for a model call its own parent must
|
|
16
|
+
* perform is answered with that TASK, and its result is delivered by the task loop afterwards.
|
|
17
|
+
*
|
|
18
|
+
* Bound to the tool deps, whose `inflight` registry outlives every session the connector reopens.
|
|
19
|
+
*/
|
|
20
|
+
export interface HandoverHelper {
|
|
21
|
+
/**
|
|
22
|
+
* Answer one tool call: its result when the call finishes first, the model task it is blocked on
|
|
23
|
+
* when one arrives first, or "still running" at `HANDOVER_WAIT_MS`. The call itself is never
|
|
24
|
+
* abandoned — an identical repeat joins it, and its result is reported by the task loop.
|
|
25
|
+
*/
|
|
26
|
+
run: (tool: ToolDefinition, args: Record<string, unknown>) => Promise<McpToolAnswer>;
|
|
27
|
+
/**
|
|
28
|
+
* A tool's result as the MCP wire carries it; a throw becomes a phrased `isError` answer, logged,
|
|
29
|
+
* and pushed through `notify` when only a person can resolve it. Never rejects.
|
|
30
|
+
*/
|
|
31
|
+
contain: (tool: string, run: () => Promise<ToolResult>) => Promise<McpToolAnswer>;
|
|
32
|
+
/**
|
|
33
|
+
* Wait up to `waitMs` for a detached call to settle or a model task to arrive, then take both
|
|
34
|
+
* what settled and the next queued task.
|
|
35
|
+
*/
|
|
36
|
+
collect: (session: SessionRuntime, waitMs: number) => Promise<HandoverCollection>;
|
|
37
|
+
/**
|
|
38
|
+
* The collection as a tool result led by `lead`; `null` when it holds nothing at all, so the
|
|
39
|
+
* caller answers in its own words. Every settled call is in `structured.settled[]`, a refused one
|
|
40
|
+
* marked `isError` there and never on the result itself.
|
|
41
|
+
*/
|
|
42
|
+
report: (collected: HandoverCollection, lead?: string) => ToolResult | null;
|
|
43
|
+
/**
|
|
44
|
+
* Whether a call no tool waits on is running or settled-and-unreported — what makes the task loop
|
|
45
|
+
* wait for one.
|
|
46
|
+
*/
|
|
47
|
+
pending: () => boolean;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/handover/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE5E,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,+DAA+D;IAC/D,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;IACtB,iEAAiE;IACjE,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,GAAG,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IACpF;;;OAGG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IACjF;;;OAGG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACjF;;;;OAIG;IACH,MAAM,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,UAAU,GAAG,IAAI,CAAA;IAC3E;;;OAGG;IACH,OAAO,EAAE,MAAM,OAAO,CAAA;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tools/handover/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HandoverHelper } from './handover/types.js';
|
|
2
|
+
import type { ToolDeps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @param deps The tool deps; their `inflight` registry is the one every handover of this server
|
|
5
|
+
* shares. A deps bag without one (a test calling a tool directly) gets a private, empty one.
|
|
6
|
+
*/
|
|
7
|
+
export declare const makeHandoverHelper: (deps: ToolDeps) => HandoverHelper;
|
|
8
|
+
//# sourceMappingURL=handover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handover.d.ts","sourceRoot":"","sources":["../../src/tools/handover.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,KAAK,EAAiC,QAAQ,EAAc,MAAM,YAAY,CAAA;AAerF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,SAAU,QAAQ,KAAG,cAuInD,CAAA"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { HANDOVER_WAIT_MS } from '../consts.js';
|
|
2
|
+
import { makeTaskEnvelopeModel } from '../task/envelope.js';
|
|
3
|
+
import { HANDOVER_SLICE_MS, STATUS_TOOL_OF } from './consts.local.js';
|
|
4
|
+
import { createInflightCalls } from './inflight.js';
|
|
5
|
+
import { refusalHelper } from './refusal.js';
|
|
6
|
+
const textOf = (answer) => answer.content.map(part => part.text).join('\n');
|
|
7
|
+
const namesOf = (calls) => [...new Set(calls.map(call => call.tool))].join(', ');
|
|
8
|
+
/** A wait that ends at `ms` or when `signal` aborts, whichever comes first. */
|
|
9
|
+
const pause = async (ms, signal) => await new Promise(resolve => {
|
|
10
|
+
const timer = setTimeout(resolve, ms);
|
|
11
|
+
signal.addEventListener('abort', () => {
|
|
12
|
+
clearTimeout(timer);
|
|
13
|
+
resolve();
|
|
14
|
+
}, { once: true });
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* @param deps The tool deps; their `inflight` registry is the one every handover of this server
|
|
18
|
+
* shares. A deps bag without one (a test calling a tool directly) gets a private, empty one.
|
|
19
|
+
*/
|
|
20
|
+
export const makeHandoverHelper = (deps) => {
|
|
21
|
+
const inflight = deps.inflight ?? createInflightCalls();
|
|
22
|
+
const answerOf = (result) => ({
|
|
23
|
+
content: [{ type: 'text', text: result.text }],
|
|
24
|
+
...(result.structured != null ? { structuredContent: result.structured } : {}),
|
|
25
|
+
...(result.isError === true ? { isError: true } : {}),
|
|
26
|
+
});
|
|
27
|
+
const contain = async (tool, run) => {
|
|
28
|
+
try {
|
|
29
|
+
return answerOf(await run());
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
// The balance, the spend consent and a conversion's confirmation are refusals only a
|
|
33
|
+
// PERSON resolves: phrased from their packed fields (never the raw marker) and pushed out
|
|
34
|
+
// of band as well, where the host has a channel for it.
|
|
35
|
+
const person = refusalHelper.personRefusalPhrase(e);
|
|
36
|
+
const text = person ?? refusalHelper.refusalPhrase(e);
|
|
37
|
+
deps.log(`${tool} failed: ${refusalHelper.refusalMessage(e)}`);
|
|
38
|
+
if (person != null) {
|
|
39
|
+
deps.notify?.('warning', text);
|
|
40
|
+
}
|
|
41
|
+
return { content: [{ type: 'text', text }], isError: true };
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const envelopeOf = (task) => makeTaskEnvelopeModel(task).renderTaskEnvelope({ harness: deps.host.harness });
|
|
45
|
+
const statusToolOf = (tool) => STATUS_TOOL_OF[tool] ?? 'project_status';
|
|
46
|
+
const run = async (tool, args) => {
|
|
47
|
+
const call = inflight.join(tool.name, args, async () => await contain(tool.name, async () => await tool.run(args, deps)));
|
|
48
|
+
const deadline = Date.now() + HANDOVER_WAIT_MS;
|
|
49
|
+
// In slices: the session to watch may not exist yet, or may be replaced while the call runs —
|
|
50
|
+
// a delegated create opens its unattached session from inside the very call waited on here.
|
|
51
|
+
while (Date.now() < deadline) {
|
|
52
|
+
const session = deps.currentSession();
|
|
53
|
+
const stop = new AbortController();
|
|
54
|
+
const slice = Math.min(HANDOVER_SLICE_MS, deadline - Date.now());
|
|
55
|
+
const outcome = await Promise.race([
|
|
56
|
+
call.done.then(() => 'done'),
|
|
57
|
+
session != null
|
|
58
|
+
? session.taskAvailable(slice, stop.signal).then(ready => ready ? 'task' : 'tick')
|
|
59
|
+
: pause(slice, stop.signal).then(() => 'tick'),
|
|
60
|
+
]);
|
|
61
|
+
stop.abort();
|
|
62
|
+
if (outcome === 'done') {
|
|
63
|
+
inflight.forget(call);
|
|
64
|
+
return call.answer;
|
|
65
|
+
}
|
|
66
|
+
if (outcome === 'task' && session != null) {
|
|
67
|
+
const task = await session.nextTask(0);
|
|
68
|
+
// Another caller was quicker — the race goes on.
|
|
69
|
+
if (task == null)
|
|
70
|
+
continue;
|
|
71
|
+
inflight.release(call);
|
|
72
|
+
return answerOf({
|
|
73
|
+
text: `${tool.name} is NOT finished — the platform is waiting on a model call you must`
|
|
74
|
+
+ ` perform. Do not call ${tool.name} again. Run the task below in a clean subagent at LOW`
|
|
75
|
+
+ ' reasoning effort, then call submit_task_result {taskId, result}; its reply is'
|
|
76
|
+
+ ` ${tool.name}'s result, or the next model call it waits on.\n\n`
|
|
77
|
+
+ envelopeOf(task),
|
|
78
|
+
structured: { taskId: task.id, waitingOn: tool.name },
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
inflight.release(call);
|
|
83
|
+
return answerOf({
|
|
84
|
+
text: `${tool.name} is still running on the platform — call next_task (or read`
|
|
85
|
+
+ ` ${statusToolOf(tool.name)}). Calling ${tool.name} again with the same arguments waits on`
|
|
86
|
+
+ ' the same call rather than starting another.',
|
|
87
|
+
structured: { running: tool.name },
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const collect = async (session, waitMs) => {
|
|
91
|
+
const stop = new AbortController();
|
|
92
|
+
await Promise.race([
|
|
93
|
+
inflight.settled(waitMs, stop.signal),
|
|
94
|
+
session.taskAvailable(waitMs, stop.signal),
|
|
95
|
+
]);
|
|
96
|
+
stop.abort();
|
|
97
|
+
return {
|
|
98
|
+
settled: inflight.drainSettled(),
|
|
99
|
+
task: await session.nextTask(0),
|
|
100
|
+
running: inflight.running(),
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
const report = (collected, lead) => {
|
|
104
|
+
const { settled, task, running } = collected;
|
|
105
|
+
if (settled.length < 1 && task == null && running.length < 1)
|
|
106
|
+
return null;
|
|
107
|
+
const parts = lead != null ? [lead] : [];
|
|
108
|
+
for (const call of settled) {
|
|
109
|
+
const answer = call.answer;
|
|
110
|
+
parts.push(`--- ${call.tool} ${answer.isError === true ? 'was refused' : 'finished'} ---\n${textOf(answer)}`);
|
|
111
|
+
}
|
|
112
|
+
if (task != null) {
|
|
113
|
+
parts.push((running.length > 0
|
|
114
|
+
? `The next model call to perform (${namesOf(running)} still running on the platform):`
|
|
115
|
+
: 'The next model call to perform:')
|
|
116
|
+
+ `\n\n${envelopeOf(task)}`);
|
|
117
|
+
}
|
|
118
|
+
else if (running.length > 0) {
|
|
119
|
+
parts.push(`${namesOf(running)} still running on the platform — call next_task (or read`
|
|
120
|
+
+ ` ${statusToolOf(running[0].tool)}).`);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
text: parts.join('\n\n'),
|
|
124
|
+
structured: {
|
|
125
|
+
settled: settled.map(call => ({
|
|
126
|
+
tool: call.tool,
|
|
127
|
+
text: textOf(call.answer),
|
|
128
|
+
...(call.answer.isError === true ? { isError: true } : {}),
|
|
129
|
+
})),
|
|
130
|
+
...(task != null ? { taskId: task.id } : {}),
|
|
131
|
+
...(running.length > 0 ? { running: running.map(call => call.tool) } : {}),
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
const pending = () => inflight.running().length > 0 || inflight.hasSettled();
|
|
136
|
+
return { run, contain, collect, report, pending };
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=handover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handover.js","sourceRoot":"","sources":["../../src/tools/handover.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;A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AAM,EAAE,OAAO,EAAE,CAAA;AACnD,CAAC,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ToolHost } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a tool host can do — the predicates a catalogue entry's `availability` names, and the
|
|
4
|
+
* wording decisions that depend on the same facts.
|
|
5
|
+
*/
|
|
6
|
+
export interface ToolHostHelper {
|
|
7
|
+
anyHost: () => boolean;
|
|
8
|
+
localTarget: (host: ToolHost) => boolean;
|
|
9
|
+
cloudTarget: (host: ToolHost) => boolean;
|
|
10
|
+
withExecutor: (host: ToolHost) => boolean;
|
|
11
|
+
delegatedLlm: (host: ToolHost) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether this host can hold a connector SESSION across calls.
|
|
14
|
+
*
|
|
15
|
+
* A session is a connector ATTACHED: a process that stays, drains the project's operations and
|
|
16
|
+
* keeps the model tasks handed to it until the parent agent answers them. The stdio server is
|
|
17
|
+
* exactly that. The URL-configured host answers one request and forgets — opening a session there
|
|
18
|
+
* would claim the project's single connector slot, supersede the connector legitimately holding
|
|
19
|
+
* it, and be abandoned before the first operation was delivered.
|
|
20
|
+
*/
|
|
21
|
+
sessionCapable: (host: ToolHost) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether this session performs the platform's model calls — every one of them: project drafting,
|
|
24
|
+
* content checks, story formatting, every run's calls and a conversion's.
|
|
25
|
+
*
|
|
26
|
+
* That is the delegated mode and nothing else, and it needs two things at once — the delegated
|
|
27
|
+
* llm, and a connector able to drain the tasks it produces. A host that cannot hold a session can
|
|
28
|
+
* never do the draining, whatever the llm says. In the cloud mode the platform performs all of
|
|
29
|
+
* them, so the task loop (`next_task` / `submit_task_result`) is offered on exactly this predicate,
|
|
30
|
+
* and so is the handover a blocked tool answers with.
|
|
31
|
+
*/
|
|
32
|
+
performsModelTasks: (host: ToolHost) => boolean;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/host/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,OAAO,CAAA;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAA;IACxC,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAA;IACxC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAA;IACzC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAA;IACzC;;;;;;;;OAQG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAA;IAC3C;;;;;;;;;OASG;IACH,kBAAkB,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAA;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tools/host/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/tools/host.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,eAAO,MAAM,oBAAoB,QAAO,cAiBvC,CAAA;AAED,eAAO,MAAM,cAAc,gBAAyB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToolHostKind } from './consts.js';
|
|
2
|
+
export const createToolHostHelper = () => {
|
|
3
|
+
const anyHost = () => true;
|
|
4
|
+
const localTarget = (host) => host.target === 'local';
|
|
5
|
+
const cloudTarget = (host) => host.target === 'cloud';
|
|
6
|
+
const withExecutor = (host) => host.hasExecutor;
|
|
7
|
+
const delegatedLlm = (host) => host.llm === 'local';
|
|
8
|
+
const sessionCapable = (host) => host.kind === ToolHostKind.Stdio;
|
|
9
|
+
const performsModelTasks = (host) => delegatedLlm(host) && sessionCapable(host);
|
|
10
|
+
return { anyHost, localTarget, cloudTarget, withExecutor, delegatedLlm, sessionCapable, performsModelTasks };
|
|
11
|
+
};
|
|
12
|
+
export const toolHostHelper = createToolHostHelper();
|
|
13
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/tools/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAmB,EAAE;IACvD,MAAM,OAAO,GAAG,GAAY,EAAE,CAAC,IAAI,CAAA;IAEnC,MAAM,WAAW,GAAG,CAAC,IAAc,EAAW,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,OAAO,CAAA;IAExE,MAAM,WAAW,GAAG,CAAC,IAAc,EAAW,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,OAAO,CAAA;IAExE,MAAM,YAAY,GAAG,CAAC,IAAc,EAAW,EAAE,CAAC,IAAI,CAAC,WAAW,CAAA;IAElE,MAAM,YAAY,GAAG,CAAC,IAAc,EAAW,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,OAAO,CAAA;IAEtE,MAAM,cAAc,GAAG,CAAC,IAAc,EAAW,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,KAAK,CAAA;IAEpF,MAAM,kBAAkB,GAAG,CAAC,IAAc,EAAW,EAAE,CACrD,YAAY,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAA;IAE5C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAA;AAC9G,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { IamAssignGrant, IamGrant, IamGrantsResponse, IamGroup, IamGroupsResponse, IamMember, IamMembersResponse, IamOrganization, IamOrganizationsResponse, IamPermissionDefinition, IamPermissionsResponse, IamRevokeGrant, IamUser, IamUsersResponse } from '@owlmeans/viable-common';
|
|
2
|
+
/**
|
|
3
|
+
* How the generated app's sign-in tools check what they were asked and put the platform's answers
|
|
4
|
+
* into words.
|
|
5
|
+
*/
|
|
6
|
+
export interface IamToolHelper {
|
|
7
|
+
/**
|
|
8
|
+
* What a tool's action still lacks, said as the refusal — or `null` when it may call. Checked
|
|
9
|
+
* BEFORE any call, so a half-formed write never reaches the platform: an invite without an e-mail,
|
|
10
|
+
* an update that changes nothing, a grant naming no subject or two, an assign with a revoke-only
|
|
11
|
+
* mode (`all`, `inherit`), a group without its organization, a removal or a deletion the user has
|
|
12
|
+
* not agreed to (`confirm: true`).
|
|
13
|
+
*/
|
|
14
|
+
missing: (tool: string, args: Record<string, unknown>) => string | null;
|
|
15
|
+
/**
|
|
16
|
+
* The grant body `manage_app_grant` sends, from its flat input: a person (`profileId`, with
|
|
17
|
+
* `entitySlug` binding an entity-scoped grant to that organization) or a group (`group` key, its
|
|
18
|
+
* organization's `entitySlug`) — never both. Call {@link missing} first.
|
|
19
|
+
*/
|
|
20
|
+
grantBody: (args: Record<string, unknown>) => IamAssignGrant;
|
|
21
|
+
renderUsers: (response: IamUsersResponse, lead: string) => string;
|
|
22
|
+
renderUser: (user: IamUser) => string;
|
|
23
|
+
renderPermissions: (response: IamPermissionsResponse) => string;
|
|
24
|
+
renderDefinition: (definition: IamPermissionDefinition) => string;
|
|
25
|
+
/**
|
|
26
|
+
* The grant rows, counted as held and restricted: a `restricted: true` entry is an inherited grant
|
|
27
|
+
* the subject's own restriction withholds — listed, never held.
|
|
28
|
+
*/
|
|
29
|
+
renderGrants: (response: IamGrantsResponse) => string;
|
|
30
|
+
/** One grant: subject, records, mode, binding, origin (`bundle` in a group's own listing), `restricted`. */
|
|
31
|
+
renderGrant: (grant: IamGrant) => string;
|
|
32
|
+
/**
|
|
33
|
+
* What a revoke did, by its mode: `inherit` took back the subject's own value; a records revoke
|
|
34
|
+
* removed those ids; any other one revoked the permission and restricted a declared one.
|
|
35
|
+
*/
|
|
36
|
+
renderRevoke: (body: IamRevokeGrant) => string;
|
|
37
|
+
renderOrganizations: (response: IamOrganizationsResponse) => string;
|
|
38
|
+
renderOrganization: (organization: IamOrganization) => string;
|
|
39
|
+
renderMembers: (response: IamMembersResponse, lead: string) => string;
|
|
40
|
+
renderMember: (member: IamMember) => string;
|
|
41
|
+
renderGroups: (response: IamGroupsResponse, entitySlug: string) => string;
|
|
42
|
+
renderGroup: (group: IamGroup) => string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/iam/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAAE,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,kBAAkB,EACvG,eAAe,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,cAAc,EAAE,OAAO,EACnH,gBAAgB,EACjB,MAAM,yBAAyB,CAAA;AAEhC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,GAAG,IAAI,CAAA;IACvE;;;;OAIG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,cAAc,CAAA;IAC5D,WAAW,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACjE,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAA;IACrC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,sBAAsB,KAAK,MAAM,CAAA;IAC/D,gBAAgB,EAAE,CAAC,UAAU,EAAE,uBAAuB,KAAK,MAAM,CAAA;IACjE;;;OAGG;IACH,YAAY,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,MAAM,CAAA;IACrD,4GAA4G;IAC5G,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,MAAM,CAAA;IACxC;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,MAAM,CAAA;IAC9C,mBAAmB,EAAE,CAAC,QAAQ,EAAE,wBAAwB,KAAK,MAAM,CAAA;IACnE,kBAAkB,EAAE,CAAC,YAAY,EAAE,eAAe,KAAK,MAAM,CAAA;IAC7D,aAAa,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACrE,YAAY,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,CAAA;IAC3C,YAAY,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,KAAK,MAAM,CAAA;IACzE,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,MAAM,CAAA;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tools/iam/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iam.d.ts","sourceRoot":"","sources":["../../src/tools/iam.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,QAAO,aA0PtC,CAAA;AAED,eAAO,MAAM,aAAa,eAAwB,CAAA"}
|