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,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exposure watch as the phone and the CLI both read it (`tools/exposure.mjs` writes the rows,
|
|
3
|
+
* the host serves them as setup-checklist rows, the phone draws them). What a person has accepted
|
|
4
|
+
* is decided HERE and nowhere else: if the CLI and the phone each carried a copy of "is this accept
|
|
5
|
+
* still live", one would call a finding accepted while the other pages about it.
|
|
6
|
+
*
|
|
7
|
+
* Pure, no clock (the caller passes `now`), no file reads. A source the CLI could not read is
|
|
8
|
+
* `absent` and stays visible as such: absent is never a pass and never a zero.
|
|
9
|
+
*/
|
|
10
|
+
import type { ComplianceAcceptRequest, ComplianceCheck } from "./wire/repo.js";
|
|
11
|
+
export type Severity = "critical" | "high" | "moderate" | "low" | "info";
|
|
12
|
+
/** An accept lasts until a newer version / a date / the reading changes (`change` = the finding's
|
|
13
|
+
* text at accept time). Every condition it names must hold; none means forever. */
|
|
14
|
+
export type ExposureUntil = {
|
|
15
|
+
version?: string;
|
|
16
|
+
} | {
|
|
17
|
+
date?: string;
|
|
18
|
+
} | {
|
|
19
|
+
change?: string;
|
|
20
|
+
};
|
|
21
|
+
export interface ExposureAccept {
|
|
22
|
+
reason: string;
|
|
23
|
+
at: string;
|
|
24
|
+
until?: ExposureUntil;
|
|
25
|
+
}
|
|
26
|
+
export interface ExposureFinding {
|
|
27
|
+
key: string;
|
|
28
|
+
measure: string;
|
|
29
|
+
subject: string;
|
|
30
|
+
version?: string;
|
|
31
|
+
level: "alert" | "digest";
|
|
32
|
+
severity?: Severity;
|
|
33
|
+
direct?: boolean;
|
|
34
|
+
text: string;
|
|
35
|
+
sources: string[];
|
|
36
|
+
advisory?: string;
|
|
37
|
+
since?: string;
|
|
38
|
+
accepted?: ExposureAccept & {
|
|
39
|
+
byMark?: true;
|
|
40
|
+
};
|
|
41
|
+
/** D3: the crash group without version or growth bucket (`app/channel/type/location`): what a triage mark sticks to. */
|
|
42
|
+
group?: string;
|
|
43
|
+
/** D3: the app version the crashes were reported from. */
|
|
44
|
+
appVersion?: string;
|
|
45
|
+
/** Set by `applyTriage` when a mark applies to this finding. */
|
|
46
|
+
triage?: ExposureTriage;
|
|
47
|
+
}
|
|
48
|
+
export type ExposureTriageState = "seen" | "investigating" | "fixed";
|
|
49
|
+
/** A mark on a finding (or crash group): who set it and when. Nothing is hidden by it; see `applyTriage`. */
|
|
50
|
+
export interface ExposureTriage {
|
|
51
|
+
state: ExposureTriageState;
|
|
52
|
+
fixedIn?: string;
|
|
53
|
+
commit?: string;
|
|
54
|
+
note?: string;
|
|
55
|
+
at: string;
|
|
56
|
+
by: {
|
|
57
|
+
kind: "person";
|
|
58
|
+
} | {
|
|
59
|
+
kind: "agent";
|
|
60
|
+
session?: string;
|
|
61
|
+
repo?: string;
|
|
62
|
+
};
|
|
63
|
+
/** The finding's `appVersion` when the mark was set: a seen / investigating mark stops holding back the push once a different app version reports the group. */
|
|
64
|
+
markedVersion?: string;
|
|
65
|
+
}
|
|
66
|
+
/** The triage file: triage id (`exposureTriageId`) to its mark. */
|
|
67
|
+
export type ExposureTriageFile = Record<string, ExposureTriage>;
|
|
68
|
+
/** A measure the run could not read: never a pass, never a zero. */
|
|
69
|
+
export interface ExposureAbsent {
|
|
70
|
+
measure: string;
|
|
71
|
+
why: string;
|
|
72
|
+
unreachable: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface ExposureRow {
|
|
75
|
+
v: 1;
|
|
76
|
+
at: string;
|
|
77
|
+
repo: string;
|
|
78
|
+
dir: string;
|
|
79
|
+
head?: string;
|
|
80
|
+
findings: ExposureFinding[];
|
|
81
|
+
absent: ExposureAbsent[];
|
|
82
|
+
readings: {
|
|
83
|
+
installScripts?: string[];
|
|
84
|
+
settings?: Record<string, string>;
|
|
85
|
+
licences?: string[];
|
|
86
|
+
stores?: Record<string, string>;
|
|
87
|
+
};
|
|
88
|
+
only?: string[];
|
|
89
|
+
firstRun?: true;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* `POST /api/repos/:id/exposure/run`'s answer (host `exposurerun.ts`): the collector's exit code
|
|
93
|
+
* (`null` = never started, refused or killed) and the ONE sentence the phone shows for it. `ok` is a
|
|
94
|
+
* run that wrote a reading (exit 0 or 10). `refused` = nothing was run (not on the watch, no
|
|
95
|
+
* collector on this desktop); `joined` = this tap joined a run already in flight.
|
|
96
|
+
*/
|
|
97
|
+
export interface ExposureRunResult {
|
|
98
|
+
ok: boolean;
|
|
99
|
+
exit: number | null;
|
|
100
|
+
sentence: string;
|
|
101
|
+
refused?: true;
|
|
102
|
+
joined?: true;
|
|
103
|
+
}
|
|
104
|
+
/** Built-in accepts, merged UNDER the accepts file's (the file wins). Keys are what parse.mjs emits. */
|
|
105
|
+
export declare const PRE_ACCEPTED: Record<string, ExposureAccept>;
|
|
106
|
+
/** Semver-ish compare (-1/0/1); a pre-release sorts below its release, `v` and `+build` ignored. */
|
|
107
|
+
export declare function semverCmp(a: string, b: string): number;
|
|
108
|
+
/** What a triage mark sticks to: the crash group when there is one, else the finding key. */
|
|
109
|
+
export declare const exposureTriageId: (f: Pick<ExposureFinding, "key" | "group">) => string;
|
|
110
|
+
/** Is this accept still live for this finding? Every condition it names must hold; none => forever. */
|
|
111
|
+
export declare function acceptLive(f: ExposureFinding, a: ExposureAccept, now: Date | string): boolean;
|
|
112
|
+
/** Set `accepted` on every finding with a live accept; PRE_ACCEPTED sits under the file's (file wins). */
|
|
113
|
+
export declare function applyAccepts(findings: ExposureFinding[], accepts: Record<string, ExposureAccept> | null | undefined, now: Date | string): ExposureFinding[];
|
|
114
|
+
/**
|
|
115
|
+
* Clean a parsed triage file: keep the entries that are well-formed marks, drop the rest (a hand edit, a shape from
|
|
116
|
+
* another version). Never throws; a dropped entry reads as "no mark", never as a thrown checklist or sweep.
|
|
117
|
+
*/
|
|
118
|
+
export declare function cleanTriageFile(v: unknown): ExposureTriageFile;
|
|
119
|
+
/** The sentence a seen / investigating / fixed mark adds to a finding's row. */
|
|
120
|
+
export declare function triageWords(t: ExposureTriage): string;
|
|
121
|
+
/**
|
|
122
|
+
* Apply triage marks (pure). seen / investigating: still open, carries `triage`. fixed + `appVersion` older than
|
|
123
|
+
* `fixedIn`: listed as `accepted` (not counted, never pushed) with words saying installs still report it. fixed with
|
|
124
|
+
* no `appVersion` or no `fixedIn`: not counted while the triage id matches (a finding whose key changes is a new one).
|
|
125
|
+
* fixed + `appVersion` >= `fixedIn`: a REGRESSION, stays an alert with its text prefixed. An existing accept is kept.
|
|
126
|
+
*/
|
|
127
|
+
export declare function applyTriage(findings: ExposureFinding[], triage: ExposureTriageFile | null | undefined): ExposureFinding[];
|
|
128
|
+
/** `<measure>:<subject>@<version>` without its `@<version>`; null for `adv:` keys and keys with no version. */
|
|
129
|
+
export declare function exposureVersionStem(key: string): string | null;
|
|
130
|
+
/** The last parseable JSON line of a JSONL string; a torn last line (a crash mid-append) is skipped. */
|
|
131
|
+
export declare function readLastRow(text: string | null | undefined): ExposureRow | null;
|
|
132
|
+
/**
|
|
133
|
+
* The line each measure crosses, in words, for the row's detail. Code defaults, one phrase per
|
|
134
|
+
* measure id the collector emits; a measure not listed has NO threshold text (absent, never made up).
|
|
135
|
+
*/
|
|
136
|
+
export declare const EXPOSURE_THRESHOLD: Record<string, string>;
|
|
137
|
+
export declare const EXPOSURE_SUMMARY_ID = "exposure";
|
|
138
|
+
/**
|
|
139
|
+
* The fix the `B4:default-branch` finding (no ruleset, no protection) offers: the host creates the
|
|
140
|
+
* owner's two standard rulesets on GitHub (`protectmain.ts`). Confirm-gated — it changes the remote.
|
|
141
|
+
*/
|
|
142
|
+
export declare const PROTECT_MAIN_FIX = "protect-main";
|
|
143
|
+
/**
|
|
144
|
+
* The fix every open D3 (Connect IQ crash group) finding offers: the host runs the daily runner's
|
|
145
|
+
* `era-seen`, which has the ERA checker record EVERY group it lists as seen (its own `--mark-seen`;
|
|
146
|
+
* a group that grows or recurs comes back) and then reads again. One button per row, one effect for
|
|
147
|
+
* all of them — the confirm words say "every". Confirm-gated: it marks findings handled in bulk.
|
|
148
|
+
*/
|
|
149
|
+
export declare const ERA_SEEN_FIX = "era-seen";
|
|
150
|
+
/**
|
|
151
|
+
* Whether a checklist row belongs to the readings sheet's `watch` region (the daily outside view:
|
|
152
|
+
* advisories, stores, Scorecard) rather than the set-up conventions. The ONE spelling of the split —
|
|
153
|
+
* both regions, their counts and their bulk buttons cut on it.
|
|
154
|
+
*/
|
|
155
|
+
export declare const isWatchCheck: (c: ComplianceCheck) => boolean;
|
|
156
|
+
/** The finding key inside a check id (inverse of `exposureCheckId`); null when the id is not one. */
|
|
157
|
+
export declare const exposureKeyOf: (id: string) => string | null;
|
|
158
|
+
/** The checklist row id of one finding: the prefix is how the host knows an accept request is ours. */
|
|
159
|
+
export declare const exposureCheckId: (key: string) => string;
|
|
160
|
+
/**
|
|
161
|
+
* One exposure row as setup-checklist rows: a summary first, then one per finding. Accepted
|
|
162
|
+
* findings are still sent (marked `accepted`); the phone draws them folded, so "stop accepting"
|
|
163
|
+
* never has to guess what the row would have said.
|
|
164
|
+
*/
|
|
165
|
+
export declare function exposureChecks(row: ExposureRow, name: string, accepts: Record<string, ExposureAccept> | null, now: Date | string, opts?: {
|
|
166
|
+
staleMs?: number;
|
|
167
|
+
}, triage?: ExposureTriageFile | null): ComplianceCheck[];
|
|
168
|
+
/** Validate one accept request body: ours, with words for why not. Nothing is stored here. */
|
|
169
|
+
export declare function cleanAcceptRequest(body: unknown, now?: Date | string): {
|
|
170
|
+
ok: true;
|
|
171
|
+
value: ComplianceAcceptRequest;
|
|
172
|
+
} | {
|
|
173
|
+
ok: false;
|
|
174
|
+
error: string;
|
|
175
|
+
};
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/** Built-in accepts, merged UNDER the accepts file's (the file wins). Keys are what parse.mjs emits. */
|
|
2
|
+
export const PRE_ACCEPTED = {
|
|
3
|
+
"A2:node-pty": { reason: "node-pty is pinned to a pre-release on purpose (SECURITY.md)", at: "2026-10-26" },
|
|
4
|
+
"A5:web-push": { reason: "MPL-2.0, accepted on purpose", at: "2026-10-26" },
|
|
5
|
+
};
|
|
6
|
+
/** Semver-ish compare (-1/0/1); a pre-release sorts below its release, `v` and `+build` ignored. */
|
|
7
|
+
export function semverCmp(a, b) {
|
|
8
|
+
const split = (s) => {
|
|
9
|
+
const [core = "", ...rest] = String(s).trim().replace(/^v/, "").split("+")[0].split("-");
|
|
10
|
+
return { nums: core.split(".").map((n) => parseInt(n, 10) || 0), pre: rest.length ? rest.join("-").split(".") : null };
|
|
11
|
+
};
|
|
12
|
+
const x = split(a), y = split(b);
|
|
13
|
+
for (let i = 0; i < Math.max(x.nums.length, y.nums.length); i++) {
|
|
14
|
+
const d = (x.nums[i] ?? 0) - (y.nums[i] ?? 0);
|
|
15
|
+
if (d)
|
|
16
|
+
return d < 0 ? -1 : 1;
|
|
17
|
+
}
|
|
18
|
+
if (!x.pre && !y.pre)
|
|
19
|
+
return 0;
|
|
20
|
+
if (!x.pre)
|
|
21
|
+
return 1;
|
|
22
|
+
if (!y.pre)
|
|
23
|
+
return -1;
|
|
24
|
+
for (let i = 0; i < Math.max(x.pre.length, y.pre.length); i++) {
|
|
25
|
+
const p = x.pre[i], q = y.pre[i];
|
|
26
|
+
if (p === undefined)
|
|
27
|
+
return -1;
|
|
28
|
+
if (q === undefined)
|
|
29
|
+
return 1;
|
|
30
|
+
const pn = /^\d+$/.test(p), qn = /^\d+$/.test(q);
|
|
31
|
+
if (pn && qn) {
|
|
32
|
+
if (+p !== +q)
|
|
33
|
+
return +p < +q ? -1 : 1;
|
|
34
|
+
}
|
|
35
|
+
else if (pn !== qn)
|
|
36
|
+
return pn ? -1 : 1;
|
|
37
|
+
else if (p !== q)
|
|
38
|
+
return p < q ? -1 : 1;
|
|
39
|
+
}
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
/** What a triage mark sticks to: the crash group when there is one, else the finding key. */
|
|
43
|
+
export const exposureTriageId = (f) => f.group ?? f.key;
|
|
44
|
+
const toMs = (d) => (d instanceof Date ? d.getTime() : Date.parse(d));
|
|
45
|
+
/** Is this accept still live for this finding? Every condition it names must hold; none => forever. */
|
|
46
|
+
export function acceptLive(f, a, now) {
|
|
47
|
+
const u = a.until;
|
|
48
|
+
if (!u)
|
|
49
|
+
return true;
|
|
50
|
+
if (u.version !== undefined && f.version && semverCmp(f.version, u.version) > 0)
|
|
51
|
+
return false;
|
|
52
|
+
if (u.date !== undefined && !(toMs(u.date) > toMs(now)))
|
|
53
|
+
return false;
|
|
54
|
+
if (u.change !== undefined && u.change !== f.text)
|
|
55
|
+
return false;
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
/** Set `accepted` on every finding with a live accept; PRE_ACCEPTED sits under the file's (file wins). */
|
|
59
|
+
export function applyAccepts(findings, accepts, now) {
|
|
60
|
+
const all = { ...PRE_ACCEPTED, ...(accepts ?? {}) };
|
|
61
|
+
// A key that embeds its version (`A3:left-pad@1.2.3`) changes on every patch release, so an
|
|
62
|
+
// accept "until a version newer than X" is also found by its stem, `A3:left-pad`.
|
|
63
|
+
const byStem = new Map();
|
|
64
|
+
for (const [k, a] of Object.entries(all)) {
|
|
65
|
+
const stem = exposureVersionStem(k);
|
|
66
|
+
if (stem && a.until?.version !== undefined)
|
|
67
|
+
byStem.set(stem, a);
|
|
68
|
+
}
|
|
69
|
+
return findings.map((f) => {
|
|
70
|
+
let a = Object.hasOwn(all, f.key) ? all[f.key] : undefined;
|
|
71
|
+
if (!a) {
|
|
72
|
+
const stem = exposureVersionStem(f.key);
|
|
73
|
+
a = stem ? byStem.get(stem) : undefined;
|
|
74
|
+
}
|
|
75
|
+
if (!a || !acceptLive(f, a, now)) {
|
|
76
|
+
const { accepted: _x, ...rest } = f;
|
|
77
|
+
return rest;
|
|
78
|
+
}
|
|
79
|
+
return { ...f, accepted: { reason: a.reason, at: a.at, ...(a.until ? { until: a.until } : {}) } };
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const dayOf = (at) => (/^\d{4}-\d{2}-\d{2}/.exec(String(at)) ?? [String(at)])[0];
|
|
83
|
+
const whoWords = (t) => t.by?.kind === "agent" ? `agent session${t.by.repo ? ` in ${t.by.repo}` : ""}` : "you";
|
|
84
|
+
const str = (v, max = 200) => typeof v === "string" && v.length > 0 && v.length <= max;
|
|
85
|
+
/**
|
|
86
|
+
* Clean a parsed triage file: keep the entries that are well-formed marks, drop the rest (a hand edit, a shape from
|
|
87
|
+
* another version). Never throws; a dropped entry reads as "no mark", never as a thrown checklist or sweep.
|
|
88
|
+
*/
|
|
89
|
+
export function cleanTriageFile(v) {
|
|
90
|
+
const out = {};
|
|
91
|
+
if (!v || typeof v !== "object" || Array.isArray(v))
|
|
92
|
+
return out;
|
|
93
|
+
for (const [id, raw] of Object.entries(v)) {
|
|
94
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
95
|
+
continue;
|
|
96
|
+
const t = raw;
|
|
97
|
+
if (t.state !== "seen" && t.state !== "investigating" && t.state !== "fixed")
|
|
98
|
+
continue;
|
|
99
|
+
if (!str(t.at, 64))
|
|
100
|
+
continue;
|
|
101
|
+
const by = t.by;
|
|
102
|
+
let who;
|
|
103
|
+
if (by && typeof by === "object" && by.kind === "person")
|
|
104
|
+
who = { kind: "person" };
|
|
105
|
+
else if (by && typeof by === "object" && by.kind === "agent") {
|
|
106
|
+
who = { kind: "agent", ...(str(by.session) ? { session: by.session } : {}), ...(str(by.repo) ? { repo: by.repo } : {}) };
|
|
107
|
+
}
|
|
108
|
+
else
|
|
109
|
+
continue;
|
|
110
|
+
if (t.state === "fixed" && !str(t.fixedIn, 32))
|
|
111
|
+
continue;
|
|
112
|
+
out[id] = {
|
|
113
|
+
state: t.state, at: t.at, by: who,
|
|
114
|
+
...(t.state === "fixed" ? { fixedIn: t.fixedIn } : {}),
|
|
115
|
+
...(str(t.commit, 40) ? { commit: t.commit } : {}),
|
|
116
|
+
...(str(t.note, 280) ? { note: t.note } : {}),
|
|
117
|
+
...(str(t.markedVersion, 64) ? { markedVersion: t.markedVersion } : {}),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return out;
|
|
121
|
+
}
|
|
122
|
+
/** The sentence a seen / investigating / fixed mark adds to a finding's row. */
|
|
123
|
+
export function triageWords(t) {
|
|
124
|
+
if (t.state === "fixed") {
|
|
125
|
+
return `fixed${t.fixedIn ? ` in ${t.fixedIn}` : ""}${t.commit ? ` (commit ${t.commit})` : ""}, ${whoWords(t)}, ${dayOf(t.at)}${t.note ? `: ${t.note}` : ""}`;
|
|
126
|
+
}
|
|
127
|
+
return `${t.state} \u2014 ${whoWords(t)}, ${dayOf(t.at)}${t.note ? `: ${t.note}` : ""}`;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Apply triage marks (pure). seen / investigating: still open, carries `triage`. fixed + `appVersion` older than
|
|
131
|
+
* `fixedIn`: listed as `accepted` (not counted, never pushed) with words saying installs still report it. fixed with
|
|
132
|
+
* no `appVersion` or no `fixedIn`: not counted while the triage id matches (a finding whose key changes is a new one).
|
|
133
|
+
* fixed + `appVersion` >= `fixedIn`: a REGRESSION, stays an alert with its text prefixed. An existing accept is kept.
|
|
134
|
+
*/
|
|
135
|
+
export function applyTriage(findings, triage) {
|
|
136
|
+
if (!triage)
|
|
137
|
+
return findings;
|
|
138
|
+
return findings.map((f) => {
|
|
139
|
+
const id = exposureTriageId(f);
|
|
140
|
+
const t = Object.hasOwn(triage, id) ? triage[id] : undefined;
|
|
141
|
+
if (!t || (t.state !== "seen" && t.state !== "investigating" && t.state !== "fixed"))
|
|
142
|
+
return f;
|
|
143
|
+
if (t.state !== "fixed")
|
|
144
|
+
return { ...f, triage: t };
|
|
145
|
+
const older = !!f.appVersion && !!t.fixedIn && semverCmp(f.appVersion, t.fixedIn) < 0;
|
|
146
|
+
if (f.appVersion && t.fixedIn && !older) {
|
|
147
|
+
return { ...f, triage: t, text: `crashes again in ${f.appVersion} after the fix in ${t.fixedIn}: ${f.text}` };
|
|
148
|
+
}
|
|
149
|
+
if (f.accepted)
|
|
150
|
+
return { ...f, triage: t };
|
|
151
|
+
const reason = older
|
|
152
|
+
? `${triageWords(t)}; installs on ${f.appVersion} still report it`
|
|
153
|
+
: `${triageWords(t)}; not counted until the reading changes`;
|
|
154
|
+
return { ...f, triage: t, accepted: { reason, at: t.at, byMark: true } };
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/** `<measure>:<subject>@<version>` without its `@<version>`; null for `adv:` keys and keys with no version. */
|
|
158
|
+
export function exposureVersionStem(key) {
|
|
159
|
+
if (key.startsWith("adv:"))
|
|
160
|
+
return null;
|
|
161
|
+
const colon = key.indexOf(":");
|
|
162
|
+
const at = key.lastIndexOf("@");
|
|
163
|
+
return colon > 0 && at > colon + 1 ? key.slice(0, at) : null;
|
|
164
|
+
}
|
|
165
|
+
/** The last parseable JSON line of a JSONL string; a torn last line (a crash mid-append) is skipped. */
|
|
166
|
+
export function readLastRow(text) {
|
|
167
|
+
const lines = String(text ?? "").split("\n");
|
|
168
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
169
|
+
if (!lines[i].trim())
|
|
170
|
+
continue;
|
|
171
|
+
try {
|
|
172
|
+
const v = JSON.parse(lines[i]);
|
|
173
|
+
if (v && typeof v === "object")
|
|
174
|
+
return v;
|
|
175
|
+
}
|
|
176
|
+
catch { /* torn line: try the one before */ }
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The line each measure crosses, in words, for the row's detail. Code defaults, one phrase per
|
|
182
|
+
* measure id the collector emits; a measure not listed has NO threshold text (absent, never made up).
|
|
183
|
+
*/
|
|
184
|
+
export const EXPOSURE_THRESHOLD = {
|
|
185
|
+
A1: "a published advisory against an installed version",
|
|
186
|
+
A2: "a stable release newer than a pre-release pin",
|
|
187
|
+
A3: "a direct dependency marked deprecated",
|
|
188
|
+
A4: "a package that gained an install script",
|
|
189
|
+
A5: "a licence off the allow-list",
|
|
190
|
+
A6: "a dependency a major version behind",
|
|
191
|
+
A7: "a runtime within 90 days of end of life",
|
|
192
|
+
B1: "an open Dependabot alert (high or critical, or open over 14 days)",
|
|
193
|
+
B2: "secret scanning or push protection changed, or a new alert",
|
|
194
|
+
B3: "Dependabot security updates changed",
|
|
195
|
+
B4: "branch protection on main changed",
|
|
196
|
+
B5: "the workflow token default became write",
|
|
197
|
+
B6: "the organisation's 2FA requirement changed",
|
|
198
|
+
B7: "a repo with dependency manifests and no Dependabot config",
|
|
199
|
+
C1: "the published npm package no longer verifies",
|
|
200
|
+
C2: "a release asset or the APK signer does not match",
|
|
201
|
+
C3: "the Marketplace listing is behind the latest release or unlisted",
|
|
202
|
+
C5: "a privacy-policy URL does not answer 200",
|
|
203
|
+
C6: "the domain expires within 45 days",
|
|
204
|
+
C7: "npm 2FA and the trusted publisher not confirmed by hand for 12 months",
|
|
205
|
+
D1: "targetSdk below the API Play requires within 60 days",
|
|
206
|
+
D2: "a user-perceived crash rate over 1.09% or ANR rate over 0.47%",
|
|
207
|
+
D3: "a Connect IQ crash group the ERA check reports, or one that grew tenfold",
|
|
208
|
+
};
|
|
209
|
+
export const EXPOSURE_SUMMARY_ID = "exposure";
|
|
210
|
+
/**
|
|
211
|
+
* The fix the `B4:default-branch` finding (no ruleset, no protection) offers: the host creates the
|
|
212
|
+
* owner's two standard rulesets on GitHub (`protectmain.ts`). Confirm-gated — it changes the remote.
|
|
213
|
+
*/
|
|
214
|
+
export const PROTECT_MAIN_FIX = "protect-main";
|
|
215
|
+
const PROTECT_MAIN_KEY = "B4:default-branch";
|
|
216
|
+
/**
|
|
217
|
+
* The fix every open D3 (Connect IQ crash group) finding offers: the host runs the daily runner's
|
|
218
|
+
* `era-seen`, which has the ERA checker record EVERY group it lists as seen (its own `--mark-seen`;
|
|
219
|
+
* a group that grows or recurs comes back) and then reads again. One button per row, one effect for
|
|
220
|
+
* all of them — the confirm words say "every". Confirm-gated: it marks findings handled in bulk.
|
|
221
|
+
*/
|
|
222
|
+
export const ERA_SEEN_FIX = "era-seen";
|
|
223
|
+
const CHECK_PREFIX = "exposure:";
|
|
224
|
+
/**
|
|
225
|
+
* Whether a checklist row belongs to the readings sheet's `watch` region (the daily outside view:
|
|
226
|
+
* advisories, stores, Scorecard) rather than the set-up conventions. The ONE spelling of the split —
|
|
227
|
+
* both regions, their counts and their bulk buttons cut on it.
|
|
228
|
+
*/
|
|
229
|
+
export const isWatchCheck = (c) => c.watch === true || !!c.exposure || c.id === EXPOSURE_SUMMARY_ID;
|
|
230
|
+
/** The finding key inside a check id (inverse of `exposureCheckId`); null when the id is not one. */
|
|
231
|
+
export const exposureKeyOf = (id) => id.startsWith(CHECK_PREFIX) && id.length > CHECK_PREFIX.length ? id.slice(CHECK_PREFIX.length) : null;
|
|
232
|
+
/** The checklist row id of one finding: the prefix is how the host knows an accept request is ours. */
|
|
233
|
+
export const exposureCheckId = (key) => CHECK_PREFIX + key;
|
|
234
|
+
const DAY_MS = 86_400_000;
|
|
235
|
+
/** "3 hours ago" / "2 days ago": plain words, no precision a daily job cannot back up. */
|
|
236
|
+
function ageWords(ms) {
|
|
237
|
+
if (ms < 90 * 60_000)
|
|
238
|
+
return `${Math.max(1, Math.round(ms / 60_000))} minutes ago`;
|
|
239
|
+
if (ms < 36 * 3_600_000)
|
|
240
|
+
return `${Math.round(ms / 3_600_000)} hours ago`;
|
|
241
|
+
return `${Math.round(ms / DAY_MS)} days ago`;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* One exposure row as setup-checklist rows: a summary first, then one per finding. Accepted
|
|
245
|
+
* findings are still sent (marked `accepted`); the phone draws them folded, so "stop accepting"
|
|
246
|
+
* never has to guess what the row would have said.
|
|
247
|
+
*/
|
|
248
|
+
export function exposureChecks(row, name, accepts, now, opts, triage) {
|
|
249
|
+
const staleMs = opts?.staleMs ?? 2 * DAY_MS;
|
|
250
|
+
const findings = applyTriage(applyAccepts(row.findings ?? [], accepts, now), triage);
|
|
251
|
+
const open = findings.filter((f) => !f.accepted);
|
|
252
|
+
const alerts = open.filter((f) => f.level === "alert").length;
|
|
253
|
+
const digest = open.length - alerts;
|
|
254
|
+
const accepted = findings.length - open.length;
|
|
255
|
+
const absent = row.absent ?? [];
|
|
256
|
+
// Marks whose group is not in this reading: kept (the group may return), listed so a person can clear them.
|
|
257
|
+
const here = new Set((row.findings ?? []).map(exposureTriageId));
|
|
258
|
+
const staleMarks = Object.entries(triage ?? {}).filter(([id]) => !here.has(id)).map(([triageId, t]) => ({ triageId, triage: t }));
|
|
259
|
+
const age = toMs(now) - Date.parse(row.at);
|
|
260
|
+
const known = Number.isFinite(age);
|
|
261
|
+
const fresh = known && age <= staleMs;
|
|
262
|
+
const parts = [
|
|
263
|
+
known ? `Read ${ageWords(Math.max(0, age))}${fresh ? "" : " (older than the daily reading should be)"}.` : "When this was read is unknown.",
|
|
264
|
+
`${alerts} open alert${alerts === 1 ? "" : "s"}, ${digest} to consider, ${accepted} accepted.`,
|
|
265
|
+
...absent.map((a) => `Not measured, ${a.measure}: ${a.why}.`),
|
|
266
|
+
];
|
|
267
|
+
const out = [{
|
|
268
|
+
id: EXPOSURE_SUMMARY_ID, label: "Exposure watch", status: fresh && !absent.length ? "pass" : "warn",
|
|
269
|
+
detail: parts.join(" "), fix: null, advisory: true,
|
|
270
|
+
...(staleMarks.length ? { staleMarks } : {}),
|
|
271
|
+
}];
|
|
272
|
+
for (const f of findings) {
|
|
273
|
+
const check = {
|
|
274
|
+
id: exposureCheckId(f.key),
|
|
275
|
+
label: `${f.measure} ${f.subject}${f.version ? "@" + f.version : ""}`,
|
|
276
|
+
status: f.level === "alert" ? (f.severity === "critical" || f.severity === "high" ? "fail" : "warn") : "warn",
|
|
277
|
+
detail: f.triage && f.triage.state !== "fixed" ? `${f.text} (${triageWords(f.triage)})` : f.text,
|
|
278
|
+
fix: f.accepted ? null : f.key === PROTECT_MAIN_KEY ? PROTECT_MAIN_FIX : f.measure === "D3" ? ERA_SEEN_FIX : null,
|
|
279
|
+
...(f.level === "digest" ? { advisory: true } : {}),
|
|
280
|
+
};
|
|
281
|
+
if (f.accepted) {
|
|
282
|
+
const builtIn = Object.hasOwn(PRE_ACCEPTED, f.key) && !(accepts && Object.hasOwn(accepts, f.key));
|
|
283
|
+
check.accepted = { ...f.accepted, ...(builtIn ? { builtIn: true } : {}) };
|
|
284
|
+
}
|
|
285
|
+
const threshold = Object.hasOwn(EXPOSURE_THRESHOLD, f.measure) ? EXPOSURE_THRESHOLD[f.measure] : undefined;
|
|
286
|
+
check.exposure = {
|
|
287
|
+
key: f.key, name, measure: f.measure, subject: f.subject,
|
|
288
|
+
...(f.version ? { version: f.version } : {}),
|
|
289
|
+
...(f.severity ? { severity: f.severity } : {}),
|
|
290
|
+
level: f.level, sources: f.sources,
|
|
291
|
+
...(f.since ? { since: f.since } : {}),
|
|
292
|
+
...(f.group ? { group: f.group } : {}),
|
|
293
|
+
...(f.appVersion ? { appVersion: f.appVersion } : {}),
|
|
294
|
+
...(f.triage ? { triage: f.triage } : {}),
|
|
295
|
+
...(threshold ? { threshold } : {}),
|
|
296
|
+
};
|
|
297
|
+
out.push(check);
|
|
298
|
+
}
|
|
299
|
+
return out;
|
|
300
|
+
}
|
|
301
|
+
/** Validate one accept request body: ours, with words for why not. Nothing is stored here. */
|
|
302
|
+
export function cleanAcceptRequest(body, now = new Date()) {
|
|
303
|
+
const no = (error) => ({ ok: false, error });
|
|
304
|
+
if (!body || typeof body !== "object" || Array.isArray(body))
|
|
305
|
+
return no("Send an object with an id and accept.");
|
|
306
|
+
const b = body;
|
|
307
|
+
const id = b.id;
|
|
308
|
+
if (typeof id !== "string" || !id.startsWith(CHECK_PREFIX) || id.length === CHECK_PREFIX.length) {
|
|
309
|
+
return no("That row is not an exposure finding; only those can be accepted.");
|
|
310
|
+
}
|
|
311
|
+
if (typeof b.accept !== "boolean")
|
|
312
|
+
return no("Say whether to accept (true) or stop accepting (false).");
|
|
313
|
+
if (!b.accept)
|
|
314
|
+
return { ok: true, value: { id, accept: false } };
|
|
315
|
+
const reason = typeof b.reason === "string" ? b.reason.trim() : "";
|
|
316
|
+
if (!reason)
|
|
317
|
+
return no("Say why you accept it: a reason is required.");
|
|
318
|
+
if (reason.length > 500)
|
|
319
|
+
return no("Keep the reason under 500 characters.");
|
|
320
|
+
const value = { id, accept: true, reason };
|
|
321
|
+
if (b.until !== undefined && b.until !== null) {
|
|
322
|
+
const u = b.until;
|
|
323
|
+
if (typeof u !== "object" || Array.isArray(u))
|
|
324
|
+
return no("until must be a version, a date or a change.");
|
|
325
|
+
const keys = Object.keys(u);
|
|
326
|
+
if (keys.length !== 1)
|
|
327
|
+
return no("Give exactly one end for the accept: a version, a date or a change.");
|
|
328
|
+
const [k] = keys;
|
|
329
|
+
const v = u[k];
|
|
330
|
+
if (k === "version") {
|
|
331
|
+
if (typeof v !== "string" || !v.trim())
|
|
332
|
+
return no("The version to accept up to is empty.");
|
|
333
|
+
const ver = v.trim();
|
|
334
|
+
if (ver.length > 64 || !/^v?\d+(\.\d+){0,3}([-+][0-9A-Za-z.-]+)?$/.test(ver)) {
|
|
335
|
+
return no("That does not read as a version (like 2.0.0, at most 64 characters).");
|
|
336
|
+
}
|
|
337
|
+
value.until = { version: ver };
|
|
338
|
+
}
|
|
339
|
+
else if (k === "date") {
|
|
340
|
+
const ms = typeof v === "string" ? Date.parse(v) : NaN;
|
|
341
|
+
if (!Number.isFinite(ms))
|
|
342
|
+
return no("That date does not read as a date.");
|
|
343
|
+
if (!(ms > toMs(now)))
|
|
344
|
+
return no("That date is already past; pick one in the future.");
|
|
345
|
+
value.until = { date: v };
|
|
346
|
+
}
|
|
347
|
+
else if (k === "change") {
|
|
348
|
+
if (v !== true)
|
|
349
|
+
return no("change must be true.");
|
|
350
|
+
value.until = { change: true };
|
|
351
|
+
}
|
|
352
|
+
else
|
|
353
|
+
return no("until must be a version, a date or a change.");
|
|
354
|
+
}
|
|
355
|
+
return { ok: true, value };
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=exposure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exposure.js","sourceRoot":"","sources":["../src/exposure.ts"],"names":[],"mappings":"AAyEA,wGAAwG;AACxG,MAAM,CAAC,MAAM,YAAY,GAAmC;IAC1D,aAAa,EAAE,EAAE,MAAM,EAAE,8DAA8D,EAAE,EAAE,EAAE,YAAY,EAAE;IAC3G,aAAa,EAAE,EAAE,MAAM,EAAE,8BAA8B,EAAE,EAAE,EAAE,YAAY,EAAE;CAC5E,CAAC;AAEF,oGAAoG;AACpG,MAAM,UAAU,SAAS,CAAC,CAAS,EAAE,CAAS;IAC5C,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE;QAC1B,MAAM,CAAC,IAAI,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1F,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;I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ALERT is a push the same day, one per new finding, keyed
|
|
4
|
+
* (repo, measure, subject, version). Pure, no clock but the `now` handed in, no file reads — the
|
|
5
|
+
* host (`exposurepush.ts`) owns the store and the sending.
|
|
6
|
+
*
|
|
7
|
+
* - **Pushed once FOREVER.** The remembered set is never pruned: an accept that lapses, or a
|
|
8
|
+
* finding that clears and comes back with the same key, does not push a second time.
|
|
9
|
+
* - **Seeding is silent, per repo.** The store carries a `repos` marker: the first time the sweep
|
|
10
|
+
* sees a repo as WATCHED (first run, late add, re-add, missed runs, no store at all) it remembers
|
|
11
|
+
* that repo's alert keys, pushes none, and marks the repo. Only a marked repo pushes new keys.
|
|
12
|
+
* - **Only open alerts.** `digest` findings and accepted ones (`applyAccepts`, the one reader of an
|
|
13
|
+
* accept) are neither pushed nor remembered, so a digest finding is never "spent".
|
|
14
|
+
* - **Up to {@link EXPOSURE_PUSH_CAP} pushes per repo per sweep**, one per finding; more than that
|
|
15
|
+
* is ONE push naming the count, and every key is remembered.
|
|
16
|
+
*/
|
|
17
|
+
import { type ExposureTriageFile, type ExposureAccept, type ExposureFinding, type ExposureRow } from "./exposure.js";
|
|
18
|
+
export declare const EXPOSURE_PUSH_CAP = 3;
|
|
19
|
+
/** One push to send. `attention` = critical/high severity (a person is asked to look today). */
|
|
20
|
+
export interface ExposurePush {
|
|
21
|
+
repo: string;
|
|
22
|
+
dir: string;
|
|
23
|
+
title: string;
|
|
24
|
+
body: string;
|
|
25
|
+
/** The stable tag: a later push for the same finding replaces it in the OS tray. */
|
|
26
|
+
tag: string;
|
|
27
|
+
/** The attention key (same spelling as the tag) so the cause can resolve the item. */
|
|
28
|
+
key: string;
|
|
29
|
+
attention: boolean;
|
|
30
|
+
/** The finding keys this push stands for (all of them remembered by the caller). */
|
|
31
|
+
keys: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface ExposurePushPlan {
|
|
34
|
+
push: ExposurePush[];
|
|
35
|
+
/** Keys to add to the store (never already in it). */
|
|
36
|
+
remember: string[];
|
|
37
|
+
/** Repos seen as watched for the first time: to add to the store's marker. */
|
|
38
|
+
seenRepos: string[];
|
|
39
|
+
/** Attention keys whose finding is no longer open (or whose repo has none left): to resolve. */
|
|
40
|
+
resolve: string[];
|
|
41
|
+
}
|
|
42
|
+
/** What the store holds: pushed keys, and the repos whose first sight has been seeded. */
|
|
43
|
+
export interface ExposurePushed {
|
|
44
|
+
keys: ReadonlySet<string>;
|
|
45
|
+
repos: ReadonlySet<string>;
|
|
46
|
+
}
|
|
47
|
+
/** `unreadable`: the accepts file exists but cannot be read, so nothing is known about this row. */
|
|
48
|
+
export interface ExposureSeries {
|
|
49
|
+
row: ExposureRow;
|
|
50
|
+
accepts: Record<string, ExposureAccept> | null;
|
|
51
|
+
triage?: ExposureTriageFile | null;
|
|
52
|
+
unreadable?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** The dedupe key: (repo, finding.key, version), `\u0000`-joined so no field can fake another.
|
|
55
|
+
* `finding.key` already carries the advisory id and the subject. */
|
|
56
|
+
export declare const exposurePushKey: (repo: string, f: Pick<ExposureFinding, "key" | "version">) => string;
|
|
57
|
+
/** The attention key of one finding's push, and of a repo's summary push. */
|
|
58
|
+
export declare const exposureAttentionKey: (repo: string, findingKey: string) => string;
|
|
59
|
+
export declare const exposureSummaryKey: (repo: string) => string;
|
|
60
|
+
export declare function exposurePushes(series: readonly ExposureSeries[], watched: (dir: string) => boolean, pushed: ExposurePushed, now: Date | string): ExposurePushPlan;
|