waterplane 0.1.6 → 0.1.11
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/CHANGELOG.md +92 -1
- package/README.md +1 -1
- package/SECURITY.md +11 -3
- package/deploy/node-version +1 -1
- package/node_modules/@waterplane/shared/dist/agentfiles.d.ts +17 -0
- package/node_modules/@waterplane/shared/dist/agentfiles.js +58 -4
- package/node_modules/@waterplane/shared/dist/agentfiles.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/alwaysonwords.d.ts +83 -0
- package/node_modules/@waterplane/shared/dist/alwaysonwords.js +209 -0
- package/node_modules/@waterplane/shared/dist/alwaysonwords.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/autocompact.js +1 -1
- package/node_modules/@waterplane/shared/dist/autocompact.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/backendsources.d.ts +11 -1
- package/node_modules/@waterplane/shared/dist/backendsources.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/branchmode.d.ts +27 -0
- package/node_modules/@waterplane/shared/dist/branchmode.js +80 -0
- package/node_modules/@waterplane/shared/dist/branchmode.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/buildstamp.d.ts +37 -0
- package/node_modules/@waterplane/shared/dist/buildstamp.js +95 -0
- package/node_modules/@waterplane/shared/dist/buildstamp.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/burn.d.ts +16 -1
- package/node_modules/@waterplane/shared/dist/burn.js +30 -0
- package/node_modules/@waterplane/shared/dist/burn.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/changebrief.d.ts +61 -0
- package/node_modules/@waterplane/shared/dist/changebrief.js +70 -0
- package/node_modules/@waterplane/shared/dist/changebrief.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/desktopfiles.d.ts +100 -0
- package/node_modules/@waterplane/shared/dist/desktopfiles.js +192 -0
- package/node_modules/@waterplane/shared/dist/desktopfiles.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/exposure.d.ts +175 -0
- package/node_modules/@waterplane/shared/dist/exposure.js +357 -0
- package/node_modules/@waterplane/shared/dist/exposure.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/exposurepush.d.ts +60 -0
- package/node_modules/@waterplane/shared/dist/exposurepush.js +103 -0
- package/node_modules/@waterplane/shared/dist/exposurepush.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/commits.d.ts +26 -0
- package/node_modules/@waterplane/shared/dist/healthindex/commits.js +57 -0
- package/node_modules/@waterplane/shared/dist/healthindex/commits.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/move.d.ts +25 -0
- package/node_modules/@waterplane/shared/dist/healthindex/move.js +79 -0
- package/node_modules/@waterplane/shared/dist/healthindex/move.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/readings.d.ts +53 -0
- package/node_modules/@waterplane/shared/dist/healthindex/readings.js +154 -0
- package/node_modules/@waterplane/shared/dist/healthindex/readings.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.d.ts +41 -0
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js +19 -0
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/score.d.ts +26 -0
- package/node_modules/@waterplane/shared/dist/healthindex/score.js +154 -0
- package/node_modules/@waterplane/shared/dist/healthindex/score.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/types.d.ts +206 -0
- package/node_modules/@waterplane/shared/dist/healthindex/types.js +58 -0
- package/node_modules/@waterplane/shared/dist/healthindex/types.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/vs.d.ts +26 -0
- package/node_modules/@waterplane/shared/dist/healthindex/vs.js +38 -0
- package/node_modules/@waterplane/shared/dist/healthindex/vs.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/words.d.ts +28 -0
- package/node_modules/@waterplane/shared/dist/healthindex/words.js +69 -0
- package/node_modules/@waterplane/shared/dist/healthindex/words.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex.d.ts +15 -411
- package/node_modules/@waterplane/shared/dist/healthindex.js +8 -602
- package/node_modules/@waterplane/shared/dist/healthindex.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/hints.js +5 -0
- package/node_modules/@waterplane/shared/dist/hints.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/index.d.ts +29 -0
- package/node_modules/@waterplane/shared/dist/index.js +29 -0
- package/node_modules/@waterplane/shared/dist/index.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent/kind.d.ts +31 -1
- package/node_modules/@waterplane/shared/dist/intent/kind.js +27 -3
- package/node_modules/@waterplane/shared/dist/intent/kind.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/intent.js +1 -1
- package/node_modules/@waterplane/shared/dist/intent.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/launchmodes.d.ts +2 -0
- package/node_modules/@waterplane/shared/dist/launchmodes.js +12 -0
- package/node_modules/@waterplane/shared/dist/launchmodes.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/ledgerspan.d.ts +59 -0
- package/node_modules/@waterplane/shared/dist/ledgerspan.js +99 -0
- package/node_modules/@waterplane/shared/dist/ledgerspan.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/netretry.d.ts +38 -0
- package/node_modules/@waterplane/shared/dist/netretry.js +31 -0
- package/node_modules/@waterplane/shared/dist/netretry.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/netretrycfg.d.ts +12 -0
- package/node_modules/@waterplane/shared/dist/netretrycfg.js +27 -0
- package/node_modules/@waterplane/shared/dist/netretrycfg.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/nodemin.d.ts +6 -4
- package/node_modules/@waterplane/shared/dist/nodemin.js +6 -4
- package/node_modules/@waterplane/shared/dist/nodemin.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/optins.d.ts +35 -1
- package/node_modules/@waterplane/shared/dist/optins.js +39 -1
- package/node_modules/@waterplane/shared/dist/optins.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/plugin/api.d.ts +364 -0
- package/node_modules/@waterplane/shared/dist/plugin/api.js +2 -0
- package/node_modules/@waterplane/shared/dist/plugin/api.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin/backend.d.ts +197 -0
- package/node_modules/@waterplane/shared/dist/plugin/backend.js +9 -0
- package/node_modules/@waterplane/shared/dist/plugin/backend.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.d.ts +160 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.js +98 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin/module.d.ts +98 -0
- package/node_modules/@waterplane/shared/dist/plugin/module.js +13 -0
- package/node_modules/@waterplane/shared/dist/plugin/module.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin/version.d.ts +64 -0
- package/node_modules/@waterplane/shared/dist/plugin/version.js +84 -0
- package/node_modules/@waterplane/shared/dist/plugin/version.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin.d.ts +5 -867
- package/node_modules/@waterplane/shared/dist/plugin.js +27 -186
- package/node_modules/@waterplane/shared/dist/plugin.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/pluginlaunch.d.ts +7 -0
- package/node_modules/@waterplane/shared/dist/prview.d.ts +23 -0
- package/node_modules/@waterplane/shared/dist/prview.js +107 -0
- package/node_modules/@waterplane/shared/dist/prview.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/repohealth.d.ts +4 -0
- package/node_modules/@waterplane/shared/dist/repohealth.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/schedule/schedaction.d.ts +29 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedaction.js +22 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedaction.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/schedule/schedclean.js +26 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedclean.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/schedule.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/schedule.js +1 -1
- package/node_modules/@waterplane/shared/dist/schedule.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/sessionbudget.d.ts +20 -5
- package/node_modules/@waterplane/shared/dist/sessionbudget.js +42 -16
- package/node_modules/@waterplane/shared/dist/sessionbudget.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/weekburn.d.ts +114 -0
- package/node_modules/@waterplane/shared/dist/weekburn.js +205 -0
- package/node_modules/@waterplane/shared/dist/weekburn.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/alwayson.d.ts +64 -0
- package/node_modules/@waterplane/shared/dist/wire/alwayson.js +7 -0
- package/node_modules/@waterplane/shared/dist/wire/alwayson.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/backend.d.ts +4 -0
- package/node_modules/@waterplane/shared/dist/wire/backendtokens.d.ts +6 -0
- package/node_modules/@waterplane/shared/dist/wire/backendtokens.js +0 -9
- package/node_modules/@waterplane/shared/dist/wire/backendtokens.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/costwindow.d.ts +20 -0
- package/node_modules/@waterplane/shared/dist/wire/messages/clienthost.d.ts +15 -1
- package/node_modules/@waterplane/shared/dist/wire/messages/clientsession.d.ts +10 -0
- package/node_modules/@waterplane/shared/dist/wire/messages/hosttools.d.ts +12 -2
- package/node_modules/@waterplane/shared/dist/wire/notify.d.ts +129 -1
- package/node_modules/@waterplane/shared/dist/wire/notify.js +79 -1
- package/node_modules/@waterplane/shared/dist/wire/notify.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/pullrequest.d.ts +42 -0
- package/node_modules/@waterplane/shared/dist/wire/pullrequest.js +2 -0
- package/node_modules/@waterplane/shared/dist/wire/pullrequest.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/repo.d.ts +119 -0
- package/node_modules/@waterplane/shared/dist/wire/repo.js +8 -3
- package/node_modules/@waterplane/shared/dist/wire/repo.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/sent.d.ts +3 -1
- package/node_modules/@waterplane/shared/dist/wire/session/contextspark.d.ts +7 -0
- package/node_modules/@waterplane/shared/dist/wire/session/info.d.ts +4 -1
- package/node_modules/@waterplane/shared/dist/wire/session/launch.d.ts +25 -0
- package/node_modules/@waterplane/shared/dist/wire/session.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/wire/telemetry.d.ts +4 -0
- package/node_modules/@waterplane/shared/dist/wire/work.d.ts +13 -0
- package/node_modules/@waterplane/shared/dist/wire/work.js.map +1 -1
- package/npm-shrinkwrap.json +3 -3
- package/package.json +2 -2
- package/packages/extensions/scorecard/waterplane-plugin.json +10 -0
- package/packages/host/dist/agentexposure.d.ts +13 -0
- package/packages/host/dist/agentexposure.js +90 -0
- package/packages/host/dist/agentexposure.js.map +1 -0
- package/packages/host/dist/agentintents.js +2 -2
- package/packages/host/dist/agentintents.js.map +1 -1
- package/packages/host/dist/agentwatch.d.ts +3 -7
- package/packages/host/dist/agentwatch.js.map +1 -1
- package/packages/host/dist/alwayson.d.ts +18 -0
- package/packages/host/dist/alwayson.js +159 -0
- package/packages/host/dist/alwayson.js.map +1 -0
- package/packages/host/dist/answergate.d.ts +3 -7
- package/packages/host/dist/answergate.js.map +1 -1
- package/packages/host/dist/attentionstore.d.ts +61 -0
- package/packages/host/dist/attentionstore.js +162 -0
- package/packages/host/dist/attentionstore.js.map +1 -0
- package/packages/host/dist/backends/claude.js +1 -1
- package/packages/host/dist/backends/claude.js.map +1 -1
- package/packages/host/dist/backends/derive.js +1 -0
- package/packages/host/dist/backends/derive.js.map +1 -1
- package/packages/host/dist/backends/registry.js +4 -1
- package/packages/host/dist/backends/registry.js.map +1 -1
- package/packages/host/dist/backends/types.d.ts +2 -0
- package/packages/host/dist/besidespend.d.ts +22 -0
- package/packages/host/dist/besidespend.js +65 -0
- package/packages/host/dist/besidespend.js.map +1 -0
- package/packages/host/dist/boxkit.d.ts +19 -0
- package/packages/host/dist/boxkit.js +38 -0
- package/packages/host/dist/boxkit.js.map +1 -0
- package/packages/host/dist/branchrules.d.ts +14 -0
- package/packages/host/dist/branchrules.js +47 -0
- package/packages/host/dist/branchrules.js.map +1 -0
- package/packages/host/dist/builds.d.ts +31 -1
- package/packages/host/dist/builds.js +55 -3
- package/packages/host/dist/builds.js.map +1 -1
- package/packages/host/dist/buildversions.d.ts +2 -0
- package/packages/host/dist/buildversions.js +36 -0
- package/packages/host/dist/buildversions.js.map +1 -0
- package/packages/host/dist/burnwatch.d.ts +23 -11
- package/packages/host/dist/burnwatch.js +51 -2
- package/packages/host/dist/burnwatch.js.map +1 -1
- package/packages/host/dist/changebrief.d.ts +37 -0
- package/packages/host/dist/changebrief.js +157 -0
- package/packages/host/dist/changebrief.js.map +1 -0
- package/packages/host/dist/cli/index.js +1 -1
- package/packages/host/dist/cli/index.js.map +1 -1
- package/packages/host/dist/clihealth.d.ts +2 -0
- package/packages/host/dist/clihealth.js +11 -2
- package/packages/host/dist/clihealth.js.map +1 -1
- package/packages/host/dist/compliance.d.ts +5 -1
- package/packages/host/dist/compliance.js +70 -31
- package/packages/host/dist/compliance.js.map +1 -1
- package/packages/host/dist/composer.d.ts +3 -1
- package/packages/host/dist/composer.js +3 -1
- package/packages/host/dist/composer.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxcursor.d.ts +36 -1
- package/packages/host/dist/ctxlog/ctxcursor.js +96 -2
- package/packages/host/dist/ctxlog/ctxcursor.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxproject.js +2 -1
- package/packages/host/dist/ctxlog/ctxproject.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxupdate.js +13 -2
- package/packages/host/dist/ctxlog/ctxupdate.js.map +1 -1
- package/packages/host/dist/diskwatch.d.ts +4 -6
- package/packages/host/dist/diskwatch.js +3 -1
- package/packages/host/dist/diskwatch.js.map +1 -1
- package/packages/host/dist/eraseen.d.ts +6 -0
- package/packages/host/dist/eraseen.js +100 -0
- package/packages/host/dist/eraseen.js.map +1 -0
- package/packages/host/dist/exposure.d.ts +56 -0
- package/packages/host/dist/exposure.js +371 -0
- package/packages/host/dist/exposure.js.map +1 -0
- package/packages/host/dist/exposurepush.d.ts +28 -0
- package/packages/host/dist/exposurepush.js +136 -0
- package/packages/host/dist/exposurepush.js.map +1 -0
- package/packages/host/dist/exposurerun.d.ts +18 -0
- package/packages/host/dist/exposurerun.js +126 -0
- package/packages/host/dist/exposurerun.js.map +1 -0
- package/packages/host/dist/exposurewatch.d.ts +29 -0
- package/packages/host/dist/exposurewatch.js +127 -0
- package/packages/host/dist/exposurewatch.js.map +1 -0
- package/packages/host/dist/extensions/scorecard/host/engine.d.mts +54 -0
- package/packages/host/dist/extensions/scorecard/host/engine.mjs +303 -0
- package/packages/host/dist/extensions/scorecard/host/engine.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/host/gitslug.d.mts +5 -0
- package/packages/host/dist/extensions/scorecard/host/gitslug.mjs +45 -0
- package/packages/host/dist/extensions/scorecard/host/gitslug.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/host/index.d.mts +15 -0
- package/packages/host/dist/extensions/scorecard/host/index.mjs +47 -0
- package/packages/host/dist/extensions/scorecard/host/index.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/host/store.d.mts +12 -0
- package/packages/host/dist/extensions/scorecard/host/store.mjs +91 -0
- package/packages/host/dist/extensions/scorecard/host/store.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/shared/logic.d.mts +42 -0
- package/packages/host/dist/extensions/scorecard/shared/logic.mjs +170 -0
- package/packages/host/dist/extensions/scorecard/shared/logic.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/shared/wire.d.mts +140 -0
- package/packages/host/dist/extensions/scorecard/shared/wire.mjs +29 -0
- package/packages/host/dist/extensions/scorecard/shared/wire.mjs.map +1 -0
- package/packages/host/dist/forge/github.d.ts +3 -0
- package/packages/host/dist/forge/github.js +82 -0
- package/packages/host/dist/forge/github.js.map +1 -0
- package/packages/host/dist/forge/index.d.ts +14 -0
- package/packages/host/dist/forge/index.js +32 -0
- package/packages/host/dist/forge/index.js.map +1 -0
- package/packages/host/dist/forge/types.d.ts +52 -0
- package/packages/host/dist/forge/types.js +2 -0
- package/packages/host/dist/forge/types.js.map +1 -0
- package/packages/host/dist/git.d.ts +36 -3
- package/packages/host/dist/git.js +119 -41
- package/packages/host/dist/git.js.map +1 -1
- package/packages/host/dist/gitnotify.d.ts +24 -0
- package/packages/host/dist/gitnotify.js +60 -0
- package/packages/host/dist/gitnotify.js.map +1 -0
- package/packages/host/dist/healthwatch.d.ts +2 -1
- package/packages/host/dist/healthwatch.js +4 -2
- package/packages/host/dist/healthwatch.js.map +1 -1
- package/packages/host/dist/intents/adapters.js +45 -14
- package/packages/host/dist/intents/adapters.js.map +1 -1
- package/packages/host/dist/intents/contract.d.ts +4 -0
- package/packages/host/dist/intents/contract.js.map +1 -1
- package/packages/host/dist/intents/fire.js +7 -1
- package/packages/host/dist/intents/fire.js.map +1 -1
- package/packages/host/dist/intents/manager.d.ts +3 -3
- package/packages/host/dist/intents/manager.js +2 -2
- package/packages/host/dist/intents/manager.js.map +1 -1
- package/packages/host/dist/intents/watch.d.ts +10 -2
- package/packages/host/dist/intents/watch.js +27 -2
- package/packages/host/dist/intents/watch.js.map +1 -1
- package/packages/host/dist/localcistatus.d.ts +22 -0
- package/packages/host/dist/localcistatus.js +105 -0
- package/packages/host/dist/localcistatus.js.map +1 -0
- package/packages/host/dist/main.js +40 -10
- package/packages/host/dist/main.js.map +1 -1
- package/packages/host/dist/net.d.ts +2 -0
- package/packages/host/dist/net.js +11 -2
- package/packages/host/dist/net.js.map +1 -1
- package/packages/host/dist/netlog.d.ts +40 -0
- package/packages/host/dist/netlog.js +165 -0
- package/packages/host/dist/netlog.js.map +1 -0
- package/packages/host/dist/netretrycfg.d.ts +7 -0
- package/packages/host/dist/netretrycfg.js +51 -0
- package/packages/host/dist/netretrycfg.js.map +1 -0
- package/packages/host/dist/notifyprefs.d.ts +6 -2
- package/packages/host/dist/notifyprefs.js +20 -5
- package/packages/host/dist/notifyprefs.js.map +1 -1
- package/packages/host/dist/notifytypes.d.ts +58 -0
- package/packages/host/dist/notifytypes.js +2 -0
- package/packages/host/dist/notifytypes.js.map +1 -0
- package/packages/host/dist/opendeliveries.js +24 -0
- package/packages/host/dist/opendeliveries.js.map +1 -1
- package/packages/host/dist/optins.d.ts +28 -1
- package/packages/host/dist/optins.js +96 -4
- package/packages/host/dist/optins.js.map +1 -1
- package/packages/host/dist/peers/agentpeer.js +1 -1
- package/packages/host/dist/peers/agentpeer.js.map +1 -1
- package/packages/host/dist/peers/jobs.d.ts +2 -4
- package/packages/host/dist/peers/jobs.js +6 -1
- package/packages/host/dist/peers/jobs.js.map +1 -1
- package/packages/host/dist/plugins/pluginapi.js +2 -0
- package/packages/host/dist/plugins/pluginapi.js.map +1 -1
- package/packages/host/dist/plugins/pluginregistry.d.ts +3 -8
- package/packages/host/dist/plugins/pluginregistry.js +1 -1
- package/packages/host/dist/plugins/pluginregistry.js.map +1 -1
- package/packages/host/dist/protectmain.d.ts +35 -0
- package/packages/host/dist/protectmain.js +73 -0
- package/packages/host/dist/protectmain.js.map +1 -0
- package/packages/host/dist/prpush.d.ts +30 -0
- package/packages/host/dist/prpush.js +171 -0
- package/packages/host/dist/prpush.js.map +1 -0
- package/packages/host/dist/prs.d.ts +70 -0
- package/packages/host/dist/prs.js +328 -0
- package/packages/host/dist/prs.js.map +1 -0
- package/packages/host/dist/push.d.ts +19 -0
- package/packages/host/dist/push.js.map +1 -1
- package/packages/host/dist/render.d.ts +57 -0
- package/packages/host/dist/render.js +57 -39
- package/packages/host/dist/render.js.map +1 -1
- package/packages/host/dist/repohealth.js +5 -2
- package/packages/host/dist/repohealth.js.map +1 -1
- package/packages/host/dist/repohealthapproval.d.ts +3 -0
- package/packages/host/dist/repohealthapproval.js +92 -2
- package/packages/host/dist/repohealthapproval.js.map +1 -1
- package/packages/host/dist/repos.js +7 -1
- package/packages/host/dist/repos.js.map +1 -1
- package/packages/host/dist/reposkill.d.ts +8 -5
- package/packages/host/dist/reposkill.js +16 -11
- package/packages/host/dist/reposkill.js.map +1 -1
- package/packages/host/dist/reposkilltext.d.ts +8 -1
- package/packages/host/dist/reposkilltext.js +72 -3
- package/packages/host/dist/reposkilltext.js.map +1 -1
- package/packages/host/dist/routes/apihost.js +26 -2
- package/packages/host/dist/routes/apihost.js.map +1 -1
- package/packages/host/dist/routes/apiprs.d.ts +2 -0
- package/packages/host/dist/routes/apiprs.js +45 -0
- package/packages/host/dist/routes/apiprs.js.map +1 -0
- package/packages/host/dist/routes/apirepofiles.js +12 -1
- package/packages/host/dist/routes/apirepofiles.js.map +1 -1
- package/packages/host/dist/routes/apirepowork.js +48 -24
- package/packages/host/dist/routes/apirepowork.js.map +1 -1
- package/packages/host/dist/routes/apiroutes.js +2 -1
- package/packages/host/dist/routes/apiroutes.js.map +1 -1
- package/packages/host/dist/routes/apisession.js +24 -0
- package/packages/host/dist/routes/apisession.js.map +1 -1
- package/packages/host/dist/routes/apistats.js +12 -7
- package/packages/host/dist/routes/apistats.js.map +1 -1
- package/packages/host/dist/routes/apisystem.js +23 -1
- package/packages/host/dist/routes/apisystem.js.map +1 -1
- package/packages/host/dist/routes/apitable.d.ts +10 -0
- package/packages/host/dist/routes/apitable.js.map +1 -1
- package/packages/host/dist/routes/apiweekburn.d.ts +2 -0
- package/packages/host/dist/routes/apiweekburn.js +30 -0
- package/packages/host/dist/routes/apiweekburn.js.map +1 -0
- package/packages/host/dist/routes/session.js +4 -0
- package/packages/host/dist/routes/session.js.map +1 -1
- package/packages/host/dist/routes/system.js +33 -6
- package/packages/host/dist/routes/system.js.map +1 -1
- package/packages/host/dist/routes/types.d.ts +29 -21
- package/packages/host/dist/routes/work/workbuild.js +3 -2
- package/packages/host/dist/routes/work/workbuild.js.map +1 -1
- package/packages/host/dist/routes/work/workschedule.js +33 -3
- package/packages/host/dist/routes/work/workschedule.js.map +1 -1
- package/packages/host/dist/screenlog.d.ts +20 -0
- package/packages/host/dist/screenlog.js +40 -0
- package/packages/host/dist/screenlog.js.map +1 -1
- package/packages/host/dist/server/clients.d.ts +14 -24
- package/packages/host/dist/server/clients.js +77 -11
- package/packages/host/dist/server/clients.js.map +1 -1
- package/packages/host/dist/server/ctx.d.ts +2 -0
- package/packages/host/dist/server/ctxseal.d.ts +1 -1
- package/packages/host/dist/server/ctxseal.js +6 -6
- package/packages/host/dist/server/ctxseal.js.map +1 -1
- package/packages/host/dist/server/deliveries.js +4 -2
- package/packages/host/dist/server/deliveries.js.map +1 -1
- package/packages/host/dist/server/http.js +2 -2
- package/packages/host/dist/server/http.js.map +1 -1
- package/packages/host/dist/server/intentDeps.js +4 -1
- package/packages/host/dist/server/intentDeps.js.map +1 -1
- package/packages/host/dist/server/intentEvents.js +9 -4
- package/packages/host/dist/server/intentEvents.js.map +1 -1
- package/packages/host/dist/server/scan.js +23 -1
- package/packages/host/dist/server/scan.js.map +1 -1
- package/packages/host/dist/server/sessionEvents.js +37 -10
- package/packages/host/dist/server/sessionEvents.js.map +1 -1
- package/packages/host/dist/sessions/agentpoll.d.ts +31 -0
- package/packages/host/dist/sessions/agentpoll.js +176 -0
- package/packages/host/dist/sessions/agentpoll.js.map +1 -0
- package/packages/host/dist/sessions/apiretry.d.ts +59 -0
- package/packages/host/dist/sessions/apiretry.js +240 -0
- package/packages/host/dist/sessions/apiretry.js.map +1 -0
- package/packages/host/dist/sessions/askwatch.d.ts +62 -0
- package/packages/host/dist/sessions/askwatch.js +169 -0
- package/packages/host/dist/sessions/askwatch.js.map +1 -0
- package/packages/host/dist/sessions/boxes.d.ts +2 -23
- package/packages/host/dist/sessions/boxes.js +10 -664
- package/packages/host/dist/sessions/boxes.js.map +1 -1
- package/packages/host/dist/sessions/boxread.d.ts +47 -0
- package/packages/host/dist/sessions/boxread.js +628 -0
- package/packages/host/dist/sessions/boxread.js.map +1 -0
- package/packages/host/dist/sessions/core.d.ts +16 -1
- package/packages/host/dist/sessions/ctxseries.js +3 -0
- package/packages/host/dist/sessions/ctxseries.js.map +1 -1
- package/packages/host/dist/sessions/drive.d.ts +20 -6
- package/packages/host/dist/sessions/drive.js +43 -8
- package/packages/host/dist/sessions/drive.js.map +1 -1
- package/packages/host/dist/sessions/knobs.d.ts +8 -0
- package/packages/host/dist/sessions/knobs.js +9 -0
- package/packages/host/dist/sessions/knobs.js.map +1 -1
- package/packages/host/dist/sessions/record.js +7 -2
- package/packages/host/dist/sessions/record.js.map +1 -1
- package/packages/host/dist/sessions/resume.d.ts +17 -0
- package/packages/host/dist/sessions/resume.js +65 -11
- package/packages/host/dist/sessions/resume.js.map +1 -1
- package/packages/host/dist/sessions/roster.js +3 -0
- package/packages/host/dist/sessions/roster.js.map +1 -1
- package/packages/host/dist/sessions/sidechannel.d.ts +1 -1
- package/packages/host/dist/sessions/sidechannel.js +2 -2
- package/packages/host/dist/sessions/turn.d.ts +15 -58
- package/packages/host/dist/sessions/turn.js +17 -356
- package/packages/host/dist/sessions/turn.js.map +1 -1
- package/packages/host/dist/sessions.d.ts +7 -1
- package/packages/host/dist/sessions.js +22 -13
- package/packages/host/dist/sessions.js.map +1 -1
- package/packages/host/dist/settle.d.ts +6 -0
- package/packages/host/dist/settle.js +26 -21
- package/packages/host/dist/settle.js.map +1 -1
- package/packages/host/dist/setupprefs.d.ts +26 -1
- package/packages/host/dist/setupprefs.js +49 -1
- package/packages/host/dist/setupprefs.js.map +1 -1
- package/packages/host/dist/sidecar/sidecarname.d.ts +2 -0
- package/packages/host/dist/sidecar/sidecarname.js +5 -1
- package/packages/host/dist/sidecar/sidecarname.js.map +1 -1
- package/packages/host/dist/sidecar/sidecarroute.d.ts +1 -1
- package/packages/host/dist/sidecar/sidecarroute.js +5 -0
- package/packages/host/dist/sidecar/sidecarroute.js.map +1 -1
- package/packages/host/dist/sidecar.d.ts +1 -1
- package/packages/host/dist/sidecar.js +1 -1
- package/packages/host/dist/sidecar.js.map +1 -1
- package/packages/host/dist/tokenscan.d.ts +4 -0
- package/packages/host/dist/tokenscan.js +6 -1
- package/packages/host/dist/tokenscan.js.map +1 -1
- package/packages/host/dist/tokenstats.js +3 -1
- package/packages/host/dist/tokenstats.js.map +1 -1
- package/packages/host/dist/transcript/transcriptparse.js +6 -1
- package/packages/host/dist/transcript/transcriptparse.js.map +1 -1
- package/packages/host/dist/transcript/transcriptturns.d.ts +29 -0
- package/packages/host/dist/transcript/transcriptturns.js +27 -0
- package/packages/host/dist/transcript/transcriptturns.js.map +1 -1
- package/packages/host/dist/transcript.d.ts +1 -1
- package/packages/host/dist/transcript.js +1 -1
- package/packages/host/dist/transcript.js.map +1 -1
- package/packages/host/dist/usagesources.d.ts +1 -1
- package/packages/host/dist/usagesources.js +7 -2
- package/packages/host/dist/usagesources.js.map +1 -1
- package/packages/host/dist/weekburn.d.ts +75 -0
- package/packages/host/dist/weekburn.js +251 -0
- package/packages/host/dist/weekburn.js.map +1 -0
- package/packages/host/dist/worktreeleftover.d.ts +9 -0
- package/packages/host/dist/worktreeleftover.js +17 -1
- package/packages/host/dist/worktreeleftover.js.map +1 -1
- package/packages/web/dist/assets/demo-C1GHaeTv.js +23 -0
- package/packages/web/dist/assets/icons-DlcvcZoo.js +1 -0
- package/packages/web/dist/assets/index-BBc6xwDA.css +1 -0
- package/packages/web/dist/assets/index-DzQKnksZ.js +169 -0
- package/packages/web/dist/assets/shared-Cl34umPA.js +47 -0
- package/packages/web/dist/assets/{sheets-Bjv2L-cG.css → sheets-DoUhPGK0.css} +1 -1
- package/packages/web/dist/assets/sheets-_3_SvXAx.js +220 -0
- package/packages/web/dist/build-id.txt +1 -1
- package/packages/web/dist/buildstamp.json +1 -0
- package/packages/web/dist/index.html +7 -7
- package/packages/web/dist/sw.js +14 -3
- package/release.json +7 -4
- package/packages/web/dist/assets/demo-CXlqlYE4.js +0 -23
- package/packages/web/dist/assets/icons-BbqDBVjw.js +0 -1
- package/packages/web/dist/assets/index-CgPoyb3Y.css +0 -1
- package/packages/web/dist/assets/index-D5JKj8DK.js +0 -169
- package/packages/web/dist/assets/shared-eyaskl5l.js +0 -47
- package/packages/web/dist/assets/sheets-BzzL2re1.js +0 -204
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The person's open pull requests, and the actions on them (the PR card, P3).
|
|
3
|
+
*
|
|
4
|
+
* EVERY forge call of this module goes through `forge/` (`forgeOrGh`), never `gh`
|
|
5
|
+
* directly. Git calls are `git()`.
|
|
6
|
+
*
|
|
7
|
+
* The list is polled ONLY while a client holds a LEASE on the repo
|
|
8
|
+
* (`localrt.ts`'s model: no socket-close hook here, so a watcher that stops
|
|
9
|
+
* renewing lapses by itself — the phone renews every ~30 s, a lease lasts 60 s,
|
|
10
|
+
* the poll stops with the last watcher). A request never runs `gh pr list`: it is
|
|
11
|
+
* answered from the cache the poll keeps. The actions (merge, auto-merge, close,
|
|
12
|
+
* failing log) are one explicit POST each, from a tap, and run `gh` once.
|
|
13
|
+
*
|
|
14
|
+
* Notifications (checks failed / changes requested / merged or closed off the
|
|
15
|
+
* phone) are raised from the poll, so they exist ONLY while somebody is looking
|
|
16
|
+
* at the card — by design: a background poller per repo is a cost nobody asked for.
|
|
17
|
+
* They go through the same `notify("git", …)` path, so the push prefs gate them.
|
|
18
|
+
*/
|
|
19
|
+
import { actionsRunId, prChanges, prViewsFrom } from "@waterplane/shared";
|
|
20
|
+
import { branchRules, cachedBranchRules } from "./branchrules.js";
|
|
21
|
+
import { env } from "./env.js";
|
|
22
|
+
import { gitDeleteBranch, gitPull } from "./git.js";
|
|
23
|
+
import { dueWatchers } from "./localrt.js";
|
|
24
|
+
import { execFileP } from "./proc.js";
|
|
25
|
+
import { forgeOrGh } from "./forge/index.js";
|
|
26
|
+
const NO_PROMPT = { ...process.env, GIT_TERMINAL_PROMPT: "0", GH_PROMPT_DISABLED: "1" };
|
|
27
|
+
const git = (wt, args) => execFileP("git", args, { cwd: wt, timeout: 60_000, env: NO_PROMPT, maxBuffer: 4 * 1024 * 1024 });
|
|
28
|
+
const msg = (e) => String(e.stderr || e?.message || e).trim().split("\n").slice(-3).join(" ");
|
|
29
|
+
// ── timing ───────────────────────────────────────────────────────────────
|
|
30
|
+
export let LEASE_MS = 60_000;
|
|
31
|
+
let pollMs = (() => { const n = Number(env("PRS_POLL_MS")); return Number.isFinite(n) && n > 0 ? Math.max(5_000, n) : 20_000; })();
|
|
32
|
+
/** Test seam: shorten the lease / poll period (no floor). */
|
|
33
|
+
export function setPrTiming(t) {
|
|
34
|
+
if (t.leaseMs !== undefined)
|
|
35
|
+
LEASE_MS = t.leaseMs;
|
|
36
|
+
if (t.pollMs !== undefined)
|
|
37
|
+
pollMs = t.pollMs;
|
|
38
|
+
}
|
|
39
|
+
let rulesLookup = null;
|
|
40
|
+
export function setPrRules(fn) { rulesLookup = fn; }
|
|
41
|
+
const rulesOf = (wt) => (rulesLookup ? rulesLookup(wt) : branchRules(wt));
|
|
42
|
+
let deps = null;
|
|
43
|
+
export function setPrNotify(d) { deps = d; }
|
|
44
|
+
const prKey = (repoId, n) => `pr:${repoId}:${n}`;
|
|
45
|
+
const watches = new Map();
|
|
46
|
+
const watchOf = (wt) => {
|
|
47
|
+
let w = watches.get(wt);
|
|
48
|
+
if (!w) {
|
|
49
|
+
w = { holders: new Map(), doc: {}, ours: new Set() };
|
|
50
|
+
watches.set(wt, w);
|
|
51
|
+
}
|
|
52
|
+
return w;
|
|
53
|
+
};
|
|
54
|
+
/** Is anything polling this worktree right now? (tests, diagnostics) */
|
|
55
|
+
export function prsPolling(wt) { return !!watches.get(wt)?.timer; }
|
|
56
|
+
/** The cached reading: never runs `gh`. */
|
|
57
|
+
export function cachedPrs(wt) { return watches.get(wt)?.doc ?? {}; }
|
|
58
|
+
/** One `gh pr list`. Failure of any kind is ABSENT (undefined) with a sentence. */
|
|
59
|
+
export async function listPrs(wt, rules) {
|
|
60
|
+
try {
|
|
61
|
+
const raw = await (await forgeOrGh(wt)).listPrs();
|
|
62
|
+
return { prs: prViewsFrom(raw, rules ?? (rulesLookup ? await rulesLookup(wt) : cachedBranchRules(wt))) };
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
const t = msg(e);
|
|
66
|
+
return { why: /ENOENT/.test(t) ? "gh is not installed on this desktop" : `gh could not list pull requests: ${t.slice(0, 160)}` };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function pollOnce(wt, w) {
|
|
70
|
+
// Direct or unread rules: no `gh` call at all — a direct repo's git view costs nothing new.
|
|
71
|
+
const rules = rulesLookup ? await rulesLookup(wt) : cachedBranchRules(wt);
|
|
72
|
+
if (!rules || rules.mode === "direct") {
|
|
73
|
+
w.doc = {};
|
|
74
|
+
w.prev = undefined;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const r = await listPrs(wt, rules);
|
|
78
|
+
if (!r.prs) {
|
|
79
|
+
// Keep the last good list (it says when it is from); say why the refresh failed.
|
|
80
|
+
w.doc = w.doc.prs ? { ...w.doc, why: r.why } : { why: r.why };
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const changes = prChanges(w.prev, r.prs);
|
|
84
|
+
w.prev = r.prs;
|
|
85
|
+
w.doc = { prs: r.prs, at: Date.now() };
|
|
86
|
+
for (const c of changes) {
|
|
87
|
+
if (c.kind === "gone") {
|
|
88
|
+
if (w.ours.delete(c.number))
|
|
89
|
+
continue;
|
|
90
|
+
await goneNews(wt, w, c.number, c.title);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (!deps || !w.ref)
|
|
94
|
+
continue;
|
|
95
|
+
const key = prKey(w.ref.id, c.number);
|
|
96
|
+
deps.notify("git", {
|
|
97
|
+
title: `${c.kind === "checks-failed" ? "Check failed" : "Changes requested"} · PR #${c.number}`,
|
|
98
|
+
body: c.kind === "checks-failed" ? `${c.detail ?? "A check"} failed on ${c.title}` : `A reviewer asked for changes on ${c.title}`,
|
|
99
|
+
outcome: "failed", key, tag: `pr-${w.ref.id}-${c.number}`, open: { to: "git", repoId: w.ref.id },
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function goneNews(wt, w, number, title) {
|
|
104
|
+
if (!deps || !w.ref)
|
|
105
|
+
return;
|
|
106
|
+
let state = "";
|
|
107
|
+
try {
|
|
108
|
+
state = await (await forgeOrGh(wt)).prState(number);
|
|
109
|
+
}
|
|
110
|
+
catch { /* worded below */ }
|
|
111
|
+
const word = state === "MERGED" ? "merged" : state === "CLOSED" ? "closed" : "no longer open";
|
|
112
|
+
const key = prKey(w.ref.id, number);
|
|
113
|
+
deps.resolveAttention(key, `PR #${number} was ${word}`);
|
|
114
|
+
deps.notify("git", {
|
|
115
|
+
title: `PR #${number} ${word} · ${w.ref.name}`, body: title,
|
|
116
|
+
outcome: "ok", tag: `pr-${w.ref.id}-${number}`, open: { to: "git", repoId: w.ref.id },
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function tick(wt) {
|
|
120
|
+
const w = watches.get(wt);
|
|
121
|
+
if (!w)
|
|
122
|
+
return;
|
|
123
|
+
w.timer = undefined;
|
|
124
|
+
const { live, lapsed } = dueWatchers([...w.holders].map(([h, until]) => [h, { until, open: true }]), Date.now());
|
|
125
|
+
for (const h of lapsed)
|
|
126
|
+
w.holders.delete(h);
|
|
127
|
+
if (live.length === 0) {
|
|
128
|
+
w.prev = undefined;
|
|
129
|
+
return;
|
|
130
|
+
} // stops with its last watcher
|
|
131
|
+
w.running = pollOnce(wt, w).catch(() => undefined).finally(() => {
|
|
132
|
+
w.running = undefined;
|
|
133
|
+
if (w.holders.size > 0 && !w.timer) {
|
|
134
|
+
w.timer = setTimeout(() => tick(wt), pollMs);
|
|
135
|
+
w.timer.unref?.();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Take (or renew) a lease. The first lease of a worktree polls at once; the
|
|
141
|
+
* answer is whatever is cached NOW (the phone asks again, or the next frame of
|
|
142
|
+
* its renewal carries the fresh list) — a request never waits on `gh`.
|
|
143
|
+
*/
|
|
144
|
+
export function leasePrs(wt, holder, ref) {
|
|
145
|
+
const w = watchOf(wt);
|
|
146
|
+
if (ref)
|
|
147
|
+
w.ref = ref;
|
|
148
|
+
w.holders.set(holder, Date.now() + LEASE_MS);
|
|
149
|
+
if (!w.timer && !w.running)
|
|
150
|
+
tick(wt);
|
|
151
|
+
return w.doc;
|
|
152
|
+
}
|
|
153
|
+
/** Drop everything (tests). */
|
|
154
|
+
export function stopAllPrs() {
|
|
155
|
+
for (const w of watches.values())
|
|
156
|
+
if (w.timer)
|
|
157
|
+
clearTimeout(w.timer);
|
|
158
|
+
watches.clear();
|
|
159
|
+
}
|
|
160
|
+
// ── actions ──────────────────────────────────────────────────────────────
|
|
161
|
+
const isNum = (n) => typeof n === "number" && Number.isInteger(n) && n > 0;
|
|
162
|
+
const METHOD_FLAG = { merge: 1, squash: 1, rebase: 1 };
|
|
163
|
+
const bad = (error) => ({ ok: false, error });
|
|
164
|
+
const afterAction = (wt, n, ours) => {
|
|
165
|
+
const w = watches.get(wt);
|
|
166
|
+
if (w && ours && w.holders.size > 0)
|
|
167
|
+
w.ours.add(n);
|
|
168
|
+
// Refresh now so the card is not a poll behind the tap (only while somebody watches).
|
|
169
|
+
if (w && w.holders.size > 0 && !w.running) {
|
|
170
|
+
w.running = pollOnce(wt, w).catch(() => undefined).finally(() => { w.running = undefined; });
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
export async function mergePr(wt, body) {
|
|
174
|
+
if (!isNum(body.number))
|
|
175
|
+
return bad("Which pull request? (number missing)");
|
|
176
|
+
const n = body.number;
|
|
177
|
+
const rules = await rulesOf(wt);
|
|
178
|
+
let method;
|
|
179
|
+
if (body.method !== undefined) {
|
|
180
|
+
if (typeof body.method !== "string" || !Object.hasOwn(METHOD_FLAG, body.method))
|
|
181
|
+
return bad("Merge method must be merge, squash or rebase.");
|
|
182
|
+
method = body.method;
|
|
183
|
+
if (rules?.allowedMerge.length && !rules.allowedMerge.includes(method))
|
|
184
|
+
return bad(`This repo does not allow a ${method} merge — it allows ${rules.allowedMerge.join(", ")}.`);
|
|
185
|
+
}
|
|
186
|
+
else
|
|
187
|
+
method = rules?.allowedMerge[0];
|
|
188
|
+
let head = "", base = "";
|
|
189
|
+
try {
|
|
190
|
+
const v = await (await forgeOrGh(wt)).prInfo(n);
|
|
191
|
+
head = String(v?.headRefName ?? "");
|
|
192
|
+
base = String(v?.baseRefName ?? "");
|
|
193
|
+
if (v?.state && v.state !== "OPEN")
|
|
194
|
+
return bad(`PR #${n} is ${String(v.state).toLowerCase()}, not open.`);
|
|
195
|
+
}
|
|
196
|
+
catch (e) {
|
|
197
|
+
return bad(`Could not read PR #${n}: ${msg(e)}`);
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
await (await forgeOrGh(wt)).merge(n, method);
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
return bad(`GitHub did not merge PR #${n}: ${msg(e)}`);
|
|
204
|
+
}
|
|
205
|
+
afterAction(wt, n, true);
|
|
206
|
+
return { ok: true, output: await tidyAfterMerge(wt, n, method ?? "merge", head, base) };
|
|
207
|
+
}
|
|
208
|
+
/** Pull the base branch if checked out, delete the head branch locally and on origin; say what was and was not done. */
|
|
209
|
+
async function tidyAfterMerge(wt, n, method, head, base) {
|
|
210
|
+
const did = [`Merged PR #${n} (${method}).`];
|
|
211
|
+
const not = [];
|
|
212
|
+
let cur = "";
|
|
213
|
+
try {
|
|
214
|
+
cur = (await git(wt, ["rev-parse", "--abbrev-ref", "HEAD"])).stdout.trim();
|
|
215
|
+
}
|
|
216
|
+
catch { /* unknown */ }
|
|
217
|
+
if (!base)
|
|
218
|
+
not.push("did not pull (the base branch is unknown)");
|
|
219
|
+
else if (cur !== base)
|
|
220
|
+
not.push(`did not pull ${base} (this checkout is on ${cur || "no branch"})`);
|
|
221
|
+
else {
|
|
222
|
+
const p = await gitPull(wt);
|
|
223
|
+
if (p.ok)
|
|
224
|
+
did.push(`Pulled ${base}.`);
|
|
225
|
+
else
|
|
226
|
+
not.push(`did not pull ${base}: ${(p.error ?? "").split("\n")[0]}`);
|
|
227
|
+
}
|
|
228
|
+
const safeRef = head && head !== base && /^[A-Za-z0-9._][A-Za-z0-9._/-]*$/.test(head) && !head.includes("..");
|
|
229
|
+
if (!safeRef) {
|
|
230
|
+
not.push(head ? `kept branch ${head}` : "did not delete the branch (its name is unknown)");
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
if (cur === head)
|
|
234
|
+
not.push(`kept local branch ${head} (it is checked out)`);
|
|
235
|
+
else {
|
|
236
|
+
const d = await gitDeleteBranch(wt, head);
|
|
237
|
+
if (d.ok)
|
|
238
|
+
did.push(`Deleted local branch ${head}.`);
|
|
239
|
+
else if (/not found|did not match/i.test(d.error ?? ""))
|
|
240
|
+
did.push(`Local branch ${head} was already gone.`);
|
|
241
|
+
else
|
|
242
|
+
not.push(`kept local branch ${head} (git says it is not fully merged here — a squash merge looks like that; delete it yourself if you are sure)`);
|
|
243
|
+
}
|
|
244
|
+
try {
|
|
245
|
+
await git(wt, ["push", "origin", "--delete", `refs/heads/${head}`]);
|
|
246
|
+
did.push(`Deleted ${head} on origin.`);
|
|
247
|
+
}
|
|
248
|
+
catch (e) {
|
|
249
|
+
if (/remote ref does not exist|unable to delete|already|not found/i.test(msg(e)))
|
|
250
|
+
did.push(`${head} was already gone on origin.`);
|
|
251
|
+
else
|
|
252
|
+
not.push(`kept ${head} on origin: ${msg(e).slice(0, 120)}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return not.length ? `${did.join(" ")} Not done: ${not.join("; ")}.` : did.join(" ");
|
|
256
|
+
}
|
|
257
|
+
export async function autoMergePr(wt, body) {
|
|
258
|
+
if (!isNum(body.number))
|
|
259
|
+
return bad("Which pull request? (number missing)");
|
|
260
|
+
if (typeof body.on !== "boolean")
|
|
261
|
+
return bad("Say whether auto-merge goes on or off.");
|
|
262
|
+
const n = body.number;
|
|
263
|
+
if (!body.on) {
|
|
264
|
+
try {
|
|
265
|
+
await (await forgeOrGh(wt)).autoMerge(n, false);
|
|
266
|
+
}
|
|
267
|
+
catch (e) {
|
|
268
|
+
return bad(`Could not switch auto-merge off for PR #${n}: ${msg(e)}`);
|
|
269
|
+
}
|
|
270
|
+
afterAction(wt, n, false);
|
|
271
|
+
return { ok: true, output: `Auto-merge is off for PR #${n}.` };
|
|
272
|
+
}
|
|
273
|
+
const rules = await rulesOf(wt);
|
|
274
|
+
if (rules && !rules.autoMerge)
|
|
275
|
+
return bad("This repo does not allow auto-merge. Turn on \"Allow auto-merge\" in the repo's GitHub settings, or merge by hand when the checks are green.");
|
|
276
|
+
const method = typeof body.method === "string" && body.method in METHOD_FLAG ? body.method : rules?.allowedMerge[0];
|
|
277
|
+
try {
|
|
278
|
+
await (await forgeOrGh(wt)).autoMerge(n, true, method);
|
|
279
|
+
}
|
|
280
|
+
catch (e) {
|
|
281
|
+
return bad(`Could not switch auto-merge on for PR #${n}: ${msg(e)}`);
|
|
282
|
+
}
|
|
283
|
+
afterAction(wt, n, false);
|
|
284
|
+
return { ok: true, output: `Auto-merge is on for PR #${n}: it merges once its checks and reviews allow. Nothing else changes until then.` };
|
|
285
|
+
}
|
|
286
|
+
export async function closePr(wt, body) {
|
|
287
|
+
if (!isNum(body.number))
|
|
288
|
+
return bad("Which pull request? (number missing)");
|
|
289
|
+
try {
|
|
290
|
+
await (await forgeOrGh(wt)).close(body.number);
|
|
291
|
+
}
|
|
292
|
+
catch (e) {
|
|
293
|
+
return bad(`Could not close PR #${body.number}: ${msg(e)}`);
|
|
294
|
+
}
|
|
295
|
+
afterAction(wt, body.number, true);
|
|
296
|
+
return { ok: true, output: `Closed PR #${body.number}. Its branch was left alone.` };
|
|
297
|
+
}
|
|
298
|
+
const TAIL_LINES = 80;
|
|
299
|
+
const ANSI = /\u001b\[[0-9;?]*[ -/]*[@-~]/g;
|
|
300
|
+
/** The tail of the failing check's Actions log, or the check's own page when it is not an Actions run. */
|
|
301
|
+
export async function failingLog(wt, body) {
|
|
302
|
+
if (!isNum(body.number))
|
|
303
|
+
return bad("Which pull request? (number missing)");
|
|
304
|
+
const n = body.number;
|
|
305
|
+
let pr = (watches.get(wt)?.doc.prs ?? []).find((p) => p.number === n);
|
|
306
|
+
if (!pr)
|
|
307
|
+
pr = (await listPrs(wt)).prs?.find((p) => p.number === n);
|
|
308
|
+
if (!pr)
|
|
309
|
+
return bad(`PR #${n} is not in your open list.`);
|
|
310
|
+
const failed = pr.checks.filter((c) => c.state === "failed");
|
|
311
|
+
const check = (typeof body.check === "string" ? failed.find((c) => c.name === body.check) : undefined) ?? failed[0];
|
|
312
|
+
if (!check)
|
|
313
|
+
return bad(`No check has failed on PR #${n}.`);
|
|
314
|
+
const runId = actionsRunId(check.url);
|
|
315
|
+
if (!runId)
|
|
316
|
+
return { ok: true, url: check.url, output: `${check.name} is not a GitHub Actions run, so there is no log to show here.${check.url ? " Open its page." : ""}` };
|
|
317
|
+
try {
|
|
318
|
+
const stdout = await (await forgeOrGh(wt)).checksLog(runId);
|
|
319
|
+
const lines = stdout.replace(ANSI, "").split("\n").filter((l, i, a) => l.trim() || i < a.length - 1);
|
|
320
|
+
if (!lines.length)
|
|
321
|
+
return { ok: true, url: check.url, output: `${check.name}: the run has no failed-step log yet.` };
|
|
322
|
+
return { ok: true, url: check.url, output: lines.slice(-TAIL_LINES).join("\n") };
|
|
323
|
+
}
|
|
324
|
+
catch (e) {
|
|
325
|
+
return { ok: true, url: check.url, output: `${check.name}: gh could not fetch the log (${msg(e).slice(0, 120)}).${check.url ? " Open its page." : ""}` };
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
//# sourceMappingURL=prs.js.map
|
|
@@ -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EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,uCAAuC,EAAE,CAAC;QACrH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACnF,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,iCAAiC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;IAC3J,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type PushSubscription } from "web-push";
|
|
2
|
+
import { type NotifyLevel, type NotifyOpen } from "@waterplane/shared";
|
|
2
3
|
export interface PushPayload {
|
|
3
4
|
title: string;
|
|
4
5
|
body: string;
|
|
@@ -27,6 +28,24 @@ export interface PushPayload {
|
|
|
27
28
|
pull?: string;
|
|
28
29
|
/** Id of the plugin that posted this; a tap opens that plugin's screen. */
|
|
29
30
|
plugin?: string;
|
|
31
|
+
/** The feed item's own id, kind and stamp, so the service worker can hand a
|
|
32
|
+
* tapped alert back to the page whole (`openNotif`). */
|
|
33
|
+
id?: string;
|
|
34
|
+
kind?: string;
|
|
35
|
+
ts?: number;
|
|
36
|
+
/** A backlog cut to open (`NotificationItem.backlog`). */
|
|
37
|
+
backlog?: {
|
|
38
|
+
cwd: string;
|
|
39
|
+
ids: string[];
|
|
40
|
+
};
|
|
41
|
+
/** The screen a tap opens (`NotificationItem.open`). */
|
|
42
|
+
open?: NotifyOpen;
|
|
43
|
+
/** `attention` or `info` (`notifyLevel`), so the service worker can word or
|
|
44
|
+
* channel the two apart. Only attention is pushed unless the person asked for
|
|
45
|
+
* information too (`notify.prefs`' `pushInfo`) or the payload carries `pull`. */
|
|
46
|
+
level?: NotifyLevel;
|
|
47
|
+
/** The attention item's cause key (`NotificationItem.key`). */
|
|
48
|
+
key?: string;
|
|
30
49
|
}
|
|
31
50
|
export declare class PushManager {
|
|
32
51
|
private subs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,OAAkC,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,OAAkC,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAqC,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAsC9C,MAAM,OAAO,WAAW;IACd,IAAI,GAAuB,EAAE,CAAC;IAC9B,IAAI,C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E,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC;IAC5F,CAAC;CACF"}
|
|
@@ -1,4 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE headless VT replay: raw PTY bytes → the text that was on screen.
|
|
3
|
+
*
|
|
4
|
+
* The claude TUI positions characters with absolute cursor moves and full-screen
|
|
5
|
+
* repaints rather than printing linearly, so simply stripping ANSI leaves
|
|
6
|
+
* shuffled fragments ("· ← ···") — and, worse, fragments with the spaces GONE,
|
|
7
|
+
* because a gap drawn by a cursor jump is not a space in the byte stream.
|
|
8
|
+
* `Current session` arrives as `Currentsession`. Feeding the bytes to a real VT
|
|
9
|
+
* and reading back the buffer yields what a user would see. The width must match
|
|
10
|
+
* the live PTY or lines wrap wrong. Best-effort — a usable record of what the
|
|
11
|
+
* turn printed, not a true chat transcript.
|
|
12
|
+
*
|
|
13
|
+
* It lives here rather than in `sessions.ts` because it has two callers with no
|
|
14
|
+
* session between them: `screenText()` (a live PTY's scrollback, outside the
|
|
15
|
+
* alternate screen) and `usage.ts`
|
|
16
|
+
* (a short-lived probe's capture). The second one is why the extraction happened
|
|
17
|
+
* — `/usage` prints each window's reset instant as WORDS under its heading
|
|
18
|
+
* ("Resets Sep 10 at 7pm (Europe/Berlin)"), and a scraper reading stripped bytes
|
|
19
|
+
* could match neither the heading nor the sentence, so both resets were null on
|
|
20
|
+
* a screen that named them both.
|
|
21
|
+
*
|
|
22
|
+
* Cost is a full VT replay, so this is for rare paths, not per-frame checks.
|
|
23
|
+
*
|
|
24
|
+
* ## Two readbacks, one replay
|
|
25
|
+
*
|
|
26
|
+
* `renderCapture()` answers "what did it say"; `renderCells()` answers "what did
|
|
27
|
+
* it say, and how was it painted". They share `replay()` and differ only in what
|
|
28
|
+
* they read out of the same buffer, because the alternative was a second VT — a
|
|
29
|
+
* second opinion about what is on a screen, which is exactly the thing CLAUDE.md
|
|
30
|
+
* names this file to prevent.
|
|
31
|
+
*
|
|
32
|
+
* The attributed readback exists because of a measured fact about a second
|
|
33
|
+
* backend: opencode's permission dialog marks the ARMED option with a background
|
|
34
|
+
* colour and nothing else — no number, no `❯`, no bold. Flattening to text
|
|
35
|
+
* throws away the one bit that says which option a Return would press, so the
|
|
36
|
+
* dialog was unanswerable from the phone and `caps.promptBoxes` was false. See
|
|
37
|
+
* `ocprompt.ts` for the reader and `docs/notes/host.md` for the byte-level
|
|
38
|
+
* measurement. The colours themselves are never named here: this file reports
|
|
39
|
+
* what the VT holds, and every judgement about it is the reader's.
|
|
40
|
+
*/
|
|
41
|
+
import xtermHeadless from "@xterm/headless";
|
|
42
|
+
declare const Terminal: typeof xtermHeadless.Terminal;
|
|
1
43
|
export declare function renderCapture(raw: string, cols: number): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Rendered rows as `renderCapture()` hands them out: trailing spaces trimmed and
|
|
46
|
+
* 3+ blank lines squeezed to one gap. Shared with the recorder's grid read
|
|
47
|
+
* (`drive.ts`'s `screenText`), whose callers measure distance from the LAST
|
|
48
|
+
* row — an untrimmed grid's blank tail would push every echo out of reach.
|
|
49
|
+
*/
|
|
50
|
+
export declare function screenTextOf(lines: readonly string[]): string;
|
|
2
51
|
/**
|
|
3
52
|
* A run of adjacent cells that agree on every attribute this app reads back.
|
|
4
53
|
*
|
|
@@ -48,3 +97,11 @@ export interface RenderRow {
|
|
|
48
97
|
* bottom of a live screen. 0 means the whole buffer.
|
|
49
98
|
*/
|
|
50
99
|
export declare function renderCells(raw: string, cols: number, tailRows?: number): Promise<RenderRow[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Rows `start` (inclusive) to `end` (exclusive) of a terminal's ACTIVE buffer,
|
|
102
|
+
* read as `RenderRow`s. The cell walk behind `renderCells()`, shared with
|
|
103
|
+
* `screenlog.ts`'s `gridCells()` so a replay and the recorder's live grid can
|
|
104
|
+
* never disagree about what a row's text, runs or dim cells are.
|
|
105
|
+
*/
|
|
106
|
+
export declare function cellRows(term: InstanceType<typeof Terminal>, start: number, end: number): RenderRow[];
|
|
107
|
+
export {};
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* turn printed, not a true chat transcript.
|
|
12
12
|
*
|
|
13
13
|
* It lives here rather than in `sessions.ts` because it has two callers with no
|
|
14
|
-
* session between them: `screenText()` (a live PTY's scrollback
|
|
14
|
+
* session between them: `screenText()` (a live PTY's scrollback, outside the
|
|
15
|
+
* alternate screen) and `usage.ts`
|
|
15
16
|
* (a short-lived probe's capture). The second one is why the extraction happened
|
|
16
17
|
* — `/usage` prints each window's reset instant as WORDS under its heading
|
|
17
18
|
* ("Resets Sep 10 at 7pm (Europe/Berlin)"), and a scraper reading stripped bytes
|
|
@@ -71,10 +72,18 @@ export function renderCapture(raw, cols) {
|
|
|
71
72
|
const line = buf.getLine(i);
|
|
72
73
|
lines.push(line ? line.translateToString(true) : "");
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
return lines.join("\n").replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
75
|
+
return screenTextOf(lines);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Rendered rows as `renderCapture()` hands them out: trailing spaces trimmed and
|
|
80
|
+
* 3+ blank lines squeezed to one gap. Shared with the recorder's grid read
|
|
81
|
+
* (`drive.ts`'s `screenText`), whose callers measure distance from the LAST
|
|
82
|
+
* row — an untrimmed grid's blank tail would push every echo out of reach.
|
|
83
|
+
*/
|
|
84
|
+
export function screenTextOf(lines) {
|
|
85
|
+
return lines.join("\n").replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
86
|
+
}
|
|
78
87
|
/** The attribute key for one cell, in the shape `RenderSpan` documents. */
|
|
79
88
|
function bgKey(c) {
|
|
80
89
|
return c.isBgRGB() ? `rgb:${c.getBgColor()}` : c.isBgPalette() ? `pal:${c.getBgColor()}` : "def";
|
|
@@ -95,44 +104,53 @@ export function renderCells(raw, cols, tailRows = 0) {
|
|
|
95
104
|
if (!raw)
|
|
96
105
|
return Promise.resolve([]);
|
|
97
106
|
return replay(raw, cols, (term) => {
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
const len = term.buffer.active.length;
|
|
108
|
+
return cellRows(term, tailRows > 0 ? Math.max(0, len - tailRows) : 0, len);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Rows `start` (inclusive) to `end` (exclusive) of a terminal's ACTIVE buffer,
|
|
113
|
+
* read as `RenderRow`s. The cell walk behind `renderCells()`, shared with
|
|
114
|
+
* `screenlog.ts`'s `gridCells()` so a replay and the recorder's live grid can
|
|
115
|
+
* never disagree about what a row's text, runs or dim cells are.
|
|
116
|
+
*/
|
|
117
|
+
export function cellRows(term, start, end) {
|
|
118
|
+
const buf = term.buffer.active;
|
|
119
|
+
const width = term.cols;
|
|
120
|
+
const rows = [];
|
|
121
|
+
// One reusable cell for the whole walk: `getCell(x)` allocates a fresh
|
|
122
|
+
// object per call, and this loop makes one call per cell on screen.
|
|
123
|
+
const scratch = buf.getNullCell?.();
|
|
124
|
+
for (let i = start; i < end; i++) {
|
|
125
|
+
const line = buf.getLine(i);
|
|
126
|
+
if (!line) {
|
|
127
|
+
rows.push({ text: "", spans: [], undimmed: "" });
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const spans = [];
|
|
131
|
+
let lit = "";
|
|
132
|
+
let cur = null;
|
|
133
|
+
for (let x = 0; x < width; x++) {
|
|
134
|
+
const cell = line.getCell(x, scratch);
|
|
135
|
+
if (!cell)
|
|
109
136
|
continue;
|
|
137
|
+
const bg = bgKey(cell);
|
|
138
|
+
const fg = fgKey(cell);
|
|
139
|
+
if (!cur || cur.bg !== bg || cur.fg !== fg) {
|
|
140
|
+
cur = { from: x, to: x, text: "", bg, fg };
|
|
141
|
+
spans.push(cur);
|
|
110
142
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const fg = fgKey(cell);
|
|
120
|
-
if (!cur || cur.bg !== bg || cur.fg !== fg) {
|
|
121
|
-
cur = { from: x, to: x, text: "", bg, fg };
|
|
122
|
-
spans.push(cur);
|
|
123
|
-
}
|
|
124
|
-
cur.to = x;
|
|
125
|
-
// A cell the VT left empty reads as "", and a row of those must still
|
|
126
|
-
// occupy its columns — a span's text is one character per cell or the
|
|
127
|
-
// column arithmetic every reader does on top of it is wrong.
|
|
128
|
-
cur.text += cell.getChars() || " ";
|
|
129
|
-
// The second cell of a wide character has width 0 and no text of its own.
|
|
130
|
-
if (cell.getWidth() > 0)
|
|
131
|
-
lit += cell.isDim() ? " " : cell.getChars() || " ";
|
|
132
|
-
}
|
|
133
|
-
rows.push({ text: line.translateToString(true), spans, undimmed: lit.trimEnd() });
|
|
143
|
+
cur.to = x;
|
|
144
|
+
// A cell the VT left empty reads as "", and a row of those must still
|
|
145
|
+
// occupy its columns — a span's text is one character per cell or the
|
|
146
|
+
// column arithmetic every reader does on top of it is wrong.
|
|
147
|
+
cur.text += cell.getChars() || " ";
|
|
148
|
+
// The second cell of a wide character has width 0 and no text of its own.
|
|
149
|
+
if (cell.getWidth() > 0)
|
|
150
|
+
lit += cell.isDim() ? " " : cell.getChars() || " ";
|
|
134
151
|
}
|
|
135
|
-
|
|
136
|
-
}
|
|
152
|
+
rows.push({ text: line.translateToString(true), spans, undimmed: lit.trimEnd() });
|
|
153
|
+
}
|
|
154
|
+
return rows;
|
|
137
155
|
}
|
|
138
156
|
//# sourceMappingURL=render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mapp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AAC;YAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACtC,IAAI,CAAC,IAAI;gBAAE,SAAS;YACpB,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YACvB,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YACvB,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;gBAC3C,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;gBAC3C,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAClB,CAAC;YACD,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;YACX,sEAAsE;YACtE,sEAAsE;YACtE,6DAA6D;YAC7D,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC;YACnC,0EAA0E;YAC1E,IAAI,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;gBAAE,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC;QAC9E,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -98,7 +98,10 @@
|
|
|
98
98
|
* is also what keeps waterplane self-hosting and every test written against that
|
|
99
99
|
* shape green. (The flag was designed as ONE argv token precisely so an
|
|
100
100
|
* old parser ignores it rather than reading it as a subcommand, so the
|
|
101
|
-
* omission is not a compatibility crutch — it is who decides.)
|
|
101
|
+
* omission is not a compatibility crutch — it is who decides.) **Unless it
|
|
102
|
+
* cannot load**: a bare package it imports is not installed or not built
|
|
103
|
+
* (a fresh clone) ⇒ the bundled engine reads instead, with `ownSkipped`
|
|
104
|
+
* saying why; the copy wins again the moment the clone is installed.
|
|
102
105
|
* 2. **The bundled engine** — `WATERPLANE_REPOHEALTH_ENGINE` when set, else this
|
|
103
106
|
* checkout's own `tools/repohealth.mjs`, three hops up from this module
|
|
104
107
|
* (the rule `main.ts` uses for `.env` and `webbundle.ts` for the web
|
|
@@ -594,7 +597,7 @@ scope = null) {
|
|
|
594
597
|
// the one where nothing ran: a phone saying how long a backfill may take
|
|
595
598
|
// must not hold its own copy of a number this desktop can change.
|
|
596
599
|
stepTimeoutMs: REPOHEALTH_TIMEOUT_MS,
|
|
597
|
-
engine: engine ? { kind: engine.kind, bundled: bundledEngine() } : null,
|
|
600
|
+
engine: engine ? { kind: engine.kind, bundled: bundledEngine(), ...(engine.ownSkipped ? { ownSkipped: engine.ownSkipped } : {}) } : null,
|
|
598
601
|
// WHICH reading this is, and which others exist. Both ride on every answer
|
|
599
602
|
// including the one where nothing ran: a client that cannot see the list
|
|
600
603
|
// cannot offer the subtrees, and one that cannot see which it is holding
|