waterplane 0.1.14 → 0.1.16
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 +44 -0
- package/README.md +4 -1
- package/node_modules/@waterplane/shared/dist/agentfiles.js +25 -2
- package/node_modules/@waterplane/shared/dist/agentfiles.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/alwaysonwords.d.ts +11 -0
- package/node_modules/@waterplane/shared/dist/alwaysonwords.js +19 -1
- package/node_modules/@waterplane/shared/dist/alwaysonwords.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/artifacts.js +5 -1
- package/node_modules/@waterplane/shared/dist/artifacts.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/askrules.d.ts +0 -13
- package/node_modules/@waterplane/shared/dist/askrules.js +2 -1
- package/node_modules/@waterplane/shared/dist/askrules.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/block.d.ts +114 -0
- package/node_modules/@waterplane/shared/dist/block.js +104 -0
- package/node_modules/@waterplane/shared/dist/block.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/buildscan.d.ts +16 -0
- package/node_modules/@waterplane/shared/dist/buildscan.js +73 -7
- package/node_modules/@waterplane/shared/dist/buildscan.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/claudeconfig.js +2 -1
- package/node_modules/@waterplane/shared/dist/claudeconfig.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/clihealth/healthfixture.js +1 -1
- package/node_modules/@waterplane/shared/dist/clihealth/healthfixture.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/clirestart.js +23 -1
- package/node_modules/@waterplane/shared/dist/clirestart.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/desktopfiles.js +2 -1
- package/node_modules/@waterplane/shared/dist/desktopfiles.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/dictate.js +1 -1
- package/node_modules/@waterplane/shared/dist/dictate.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/exposure.js +1 -0
- package/node_modules/@waterplane/shared/dist/exposure.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/followup.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/followup.js +8 -6
- package/node_modules/@waterplane/shared/dist/followup.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/hints.js +4 -3
- package/node_modules/@waterplane/shared/dist/hints.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/hosturl.d.ts +0 -24
- package/node_modules/@waterplane/shared/dist/hosturl.js +3 -2
- package/node_modules/@waterplane/shared/dist/hosturl.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/index.d.ts +11 -3
- package/node_modules/@waterplane/shared/dist/index.js +11 -3
- package/node_modules/@waterplane/shared/dist/index.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/installrow.d.ts +156 -0
- package/node_modules/@waterplane/shared/dist/installrow.js +261 -0
- package/node_modules/@waterplane/shared/dist/installrow.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/intent/types.d.ts +6 -0
- package/node_modules/@waterplane/shared/dist/intent/types.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent/words.d.ts +2 -1
- package/node_modules/@waterplane/shared/dist/intent/words.js +7 -2
- package/node_modules/@waterplane/shared/dist/intent/words.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/itempaths.d.ts +0 -10
- package/node_modules/@waterplane/shared/dist/itempaths.js +30 -3
- package/node_modules/@waterplane/shared/dist/itempaths.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/lineartrim.d.ts +11 -0
- package/node_modules/@waterplane/shared/dist/lineartrim.js +22 -0
- package/node_modules/@waterplane/shared/dist/lineartrim.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/netretry.d.ts +23 -2
- package/node_modules/@waterplane/shared/dist/netretry.js +24 -5
- package/node_modules/@waterplane/shared/dist/netretry.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/pairing.js +2 -1
- package/node_modules/@waterplane/shared/dist/pairing.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/peer.js +2 -1
- package/node_modules/@waterplane/shared/dist/peer.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/plugin/api.d.ts +8 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.d.ts +23 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.js +8 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/plugin/version.d.ts +5 -1
- package/node_modules/@waterplane/shared/dist/plugin/version.js +5 -1
- package/node_modules/@waterplane/shared/dist/plugin/version.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/queue/queuelane.d.ts +23 -2
- package/node_modules/@waterplane/shared/dist/queue/queuelane.js +16 -4
- package/node_modules/@waterplane/shared/dist/queue/queuelane.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/queue/queueserial.js +5 -3
- package/node_modules/@waterplane/shared/dist/queue/queueserial.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/requirements.js +5 -1
- package/node_modules/@waterplane/shared/dist/requirements.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/schedule/schedrule.d.ts +3 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedrule.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/sessionwindow.d.ts +25 -0
- package/node_modules/@waterplane/shared/dist/sessionwindow.js +24 -0
- package/node_modules/@waterplane/shared/dist/sessionwindow.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/statedir.js +2 -1
- package/node_modules/@waterplane/shared/dist/statedir.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/themeoverlay.js +1 -1
- package/node_modules/@waterplane/shared/dist/themeoverlay.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/urls.js +1 -1
- package/node_modules/@waterplane/shared/dist/urls.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/backend.d.ts +8 -0
- package/node_modules/@waterplane/shared/dist/wire/install.d.ts +5 -110
- package/node_modules/@waterplane/shared/dist/wire/install.js +0 -28
- package/node_modules/@waterplane/shared/dist/wire/install.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/messages/clienthost.d.ts +1 -25
- package/node_modules/@waterplane/shared/dist/wire/messages/clientsession.d.ts +15 -0
- package/node_modules/@waterplane/shared/dist/wire/messages/hosttools.d.ts +0 -10
- package/node_modules/@waterplane/shared/dist/wire/notify.d.ts +13 -1
- package/node_modules/@waterplane/shared/dist/wire/notify.js +9 -2
- package/node_modules/@waterplane/shared/dist/wire/notify.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/repo.js +1 -1
- package/node_modules/@waterplane/shared/dist/wire/repo.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/sent.d.ts +8 -1
- package/node_modules/@waterplane/shared/dist/wire/session/info.d.ts +29 -3
- package/node_modules/@waterplane/shared/dist/wire/session/launch.d.ts +44 -3
- package/node_modules/@waterplane/shared/dist/wire/session.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/wire/telemetry.d.ts +7 -0
- package/node_modules/@waterplane/shared/dist/wire/work.d.ts +4 -2
- package/node_modules/@waterplane/shared/dist/wire/work.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/working.d.ts +30 -0
- package/node_modules/@waterplane/shared/dist/working.js +135 -13
- package/node_modules/@waterplane/shared/dist/working.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/yamlfront.d.ts +13 -0
- package/node_modules/@waterplane/shared/dist/yamlfront.js +119 -0
- package/node_modules/@waterplane/shared/dist/yamlfront.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/packages/extensions/android-apps/waterplane-plugin.json +11 -0
- package/packages/host/dist/agentbuild.d.ts +48 -0
- package/packages/host/dist/agentbuild.js +105 -0
- package/packages/host/dist/agentbuild.js.map +1 -0
- package/packages/host/dist/agents.d.ts +2 -0
- package/packages/host/dist/agents.js +6 -1
- package/packages/host/dist/agents.js.map +1 -1
- package/packages/host/dist/androidenv.d.ts +10 -0
- package/packages/host/dist/androidenv.js +34 -2
- package/packages/host/dist/androidenv.js.map +1 -1
- package/packages/host/dist/apkcheck.d.ts +1 -1
- package/packages/host/dist/apkcheck.js +5 -5
- package/packages/host/dist/apkcheck.js.map +1 -1
- package/packages/host/dist/appready.d.ts +1 -1
- package/packages/host/dist/artifacts.js +6 -2
- package/packages/host/dist/artifacts.js.map +1 -1
- package/packages/host/dist/assess/hassrun.js +4 -1
- package/packages/host/dist/assess/hassrun.js.map +1 -1
- package/packages/host/dist/backends/claude-local.d.ts +34 -3
- package/packages/host/dist/backends/claude-local.js +86 -15
- package/packages/host/dist/backends/claude-local.js.map +1 -1
- package/packages/host/dist/backends/claude-sources.js +13 -7
- package/packages/host/dist/backends/claude-sources.js.map +1 -1
- package/packages/host/dist/backends/index.d.ts +7 -0
- package/packages/host/dist/backends/index.js +12 -1
- package/packages/host/dist/backends/index.js.map +1 -1
- package/packages/host/dist/builds.d.ts +1 -0
- package/packages/host/dist/builds.js +3 -1
- package/packages/host/dist/builds.js.map +1 -1
- package/packages/host/dist/clifixtures.d.ts +3 -0
- package/packages/host/dist/clifixtures.js +9 -1
- package/packages/host/dist/clifixtures.js.map +1 -1
- package/packages/host/dist/compliance.js +34 -1
- package/packages/host/dist/compliance.js.map +1 -1
- package/packages/host/dist/composer.d.ts +22 -0
- package/packages/host/dist/composer.js +23 -0
- package/packages/host/dist/composer.js.map +1 -1
- package/packages/host/dist/context.js +15 -5
- package/packages/host/dist/context.js.map +1 -1
- package/packages/host/dist/deliver/deliverreturn.d.ts +24 -0
- package/packages/host/dist/deliver/deliverreturn.js +37 -0
- package/packages/host/dist/deliver/deliverreturn.js.map +1 -1
- package/packages/host/dist/deliver/deliverrun.js +11 -11
- package/packages/host/dist/deliver/deliverrun.js.map +1 -1
- package/packages/host/dist/deliver/deliverscreen.js +4 -10
- package/packages/host/dist/deliver/deliverscreen.js.map +1 -1
- package/packages/host/dist/doctorclaude.d.ts +5 -1
- package/packages/host/dist/doctorclaude.js +7 -2
- package/packages/host/dist/doctorclaude.js.map +1 -1
- package/packages/host/dist/extensions/android-apps/host/index.d.mts +9 -0
- package/packages/host/dist/extensions/android-apps/host/index.mjs +59 -0
- package/packages/host/dist/extensions/android-apps/host/index.mjs.map +1 -0
- package/packages/host/dist/extensions/android-apps/host/installlog.d.mts +49 -0
- package/packages/host/dist/extensions/android-apps/host/installlog.mjs +196 -0
- package/packages/host/dist/extensions/android-apps/host/installlog.mjs.map +1 -0
- package/packages/host/dist/extensions/android-apps/host/readiness.d.mts +9 -0
- package/packages/host/dist/extensions/android-apps/host/readiness.mjs +5 -0
- package/packages/host/dist/extensions/android-apps/host/readiness.mjs.map +1 -0
- package/packages/host/dist/extensions/android-apps/shared/wire.d.mts +287 -0
- package/{node_modules/@waterplane/shared/dist/installlog.js → packages/host/dist/extensions/android-apps/shared/wire.mjs} +74 -1
- package/packages/host/dist/extensions/android-apps/shared/wire.mjs.map +1 -0
- package/packages/host/dist/headlessauth.d.ts +24 -0
- package/packages/host/dist/headlessauth.js +63 -0
- package/packages/host/dist/headlessauth.js.map +1 -0
- package/packages/host/dist/host.js +21 -2
- package/packages/host/dist/host.js.map +1 -1
- package/packages/host/dist/intents/contract.d.ts +6 -0
- package/packages/host/dist/intents/contract.js.map +1 -1
- package/packages/host/dist/intents/watch.d.ts +2 -0
- package/packages/host/dist/intents/watch.js +8 -0
- package/packages/host/dist/intents/watch.js.map +1 -1
- package/packages/host/dist/limitretry.d.ts +22 -3
- package/packages/host/dist/limitretry.js +20 -0
- package/packages/host/dist/limitretry.js.map +1 -1
- package/packages/host/dist/login.d.ts +1 -0
- package/packages/host/dist/login.js +17 -0
- package/packages/host/dist/login.js.map +1 -1
- package/packages/host/dist/main.js +5 -16
- package/packages/host/dist/main.js.map +1 -1
- package/packages/host/dist/naming.js +6 -0
- package/packages/host/dist/naming.js.map +1 -1
- package/packages/host/dist/netlog.d.ts +9 -0
- package/packages/host/dist/netlog.js +32 -3
- package/packages/host/dist/netlog.js.map +1 -1
- package/packages/host/dist/plugins/pluginapi.js +5 -0
- package/packages/host/dist/plugins/pluginapi.js.map +1 -1
- package/packages/host/dist/plugins/pluginauto.d.ts +21 -0
- package/packages/host/dist/plugins/pluginauto.js +67 -0
- package/packages/host/dist/plugins/pluginauto.js.map +1 -0
- package/packages/host/dist/plugins/pluginregistry.d.ts +50 -1
- package/packages/host/dist/plugins/pluginregistry.js +129 -7
- package/packages/host/dist/plugins/pluginregistry.js.map +1 -1
- package/packages/host/dist/question.js +10 -1
- package/packages/host/dist/question.js.map +1 -1
- package/packages/host/dist/recover/authgate.d.ts +174 -0
- package/packages/host/dist/recover/authgate.js +317 -0
- package/packages/host/dist/recover/authgate.js.map +1 -0
- package/packages/host/dist/recover/blockpush.d.ts +89 -0
- package/packages/host/dist/recover/blockpush.js +119 -0
- package/packages/host/dist/recover/blockpush.js.map +1 -0
- package/packages/host/dist/recover/giveuplatch.d.ts +42 -0
- package/packages/host/dist/recover/giveuplatch.js +48 -0
- package/packages/host/dist/recover/giveuplatch.js.map +1 -0
- package/packages/host/dist/recover/recoverwrite.d.ts +174 -0
- package/packages/host/dist/recover/recoverwrite.js +137 -0
- package/packages/host/dist/recover/recoverwrite.js.map +1 -0
- package/packages/host/dist/recover/wavegate.d.ts +145 -0
- package/packages/host/dist/recover/wavegate.js +277 -0
- package/packages/host/dist/recover/wavegate.js.map +1 -0
- package/packages/host/dist/repohealth.d.ts +8 -2
- package/packages/host/dist/repohealth.js +16 -6
- package/packages/host/dist/repohealth.js.map +1 -1
- package/packages/host/dist/repos.d.ts +13 -0
- package/packages/host/dist/repos.js +50 -0
- package/packages/host/dist/repos.js.map +1 -1
- package/packages/host/dist/reposkill.js +1 -1
- package/packages/host/dist/reposkill.js.map +1 -1
- package/packages/host/dist/reposkilltext.js +56 -10
- package/packages/host/dist/reposkilltext.js.map +1 -1
- package/packages/host/dist/review.js +7 -2
- package/packages/host/dist/review.js.map +1 -1
- package/packages/host/dist/routes/apihost.js +22 -10
- package/packages/host/dist/routes/apihost.js.map +1 -1
- package/packages/host/dist/routes/apirepowork.js +4 -1
- package/packages/host/dist/routes/apirepowork.js.map +1 -1
- package/packages/host/dist/routes/apisystem.js +10 -0
- package/packages/host/dist/routes/apisystem.js.map +1 -1
- package/packages/host/dist/routes/apitable.d.ts +4 -7
- package/packages/host/dist/routes/apitable.js.map +1 -1
- package/packages/host/dist/routes/session.js +14 -0
- package/packages/host/dist/routes/session.js.map +1 -1
- package/packages/host/dist/routes/system.js +0 -37
- package/packages/host/dist/routes/system.js.map +1 -1
- package/packages/host/dist/routes/types.d.ts +0 -3
- package/packages/host/dist/scaffold.d.ts +13 -0
- package/packages/host/dist/scaffold.js +31 -0
- package/packages/host/dist/scaffold.js.map +1 -1
- package/packages/host/dist/server/ctxseal.d.ts +1 -1
- package/packages/host/dist/server/ctxseal.js +1 -1
- package/packages/host/dist/server/ctxseal.js.map +1 -1
- package/packages/host/dist/server/http.js +0 -2
- package/packages/host/dist/server/http.js.map +1 -1
- package/packages/host/dist/server/intentDeps.js +7 -1
- package/packages/host/dist/server/intentDeps.js.map +1 -1
- package/packages/host/dist/server/plugins.d.ts +21 -0
- package/packages/host/dist/server/plugins.js +28 -0
- package/packages/host/dist/server/plugins.js.map +1 -0
- package/packages/host/dist/server/sessionEvents.js +21 -47
- package/packages/host/dist/server/sessionEvents.js.map +1 -1
- package/packages/host/dist/server/shutdown.js +2 -4
- package/packages/host/dist/server/shutdown.js.map +1 -1
- package/packages/host/dist/sessions/agentpoll.js +18 -5
- package/packages/host/dist/sessions/agentpoll.js.map +1 -1
- package/packages/host/dist/sessions/apiretry.d.ts +110 -8
- package/packages/host/dist/sessions/apiretry.js +349 -72
- package/packages/host/dist/sessions/apiretry.js.map +1 -1
- package/packages/host/dist/sessions/boxread.js +9 -3
- package/packages/host/dist/sessions/boxread.js.map +1 -1
- package/packages/host/dist/sessions/core.d.ts +43 -6
- package/packages/host/dist/sessions/drive.js +6 -1
- package/packages/host/dist/sessions/drive.js.map +1 -1
- package/packages/host/dist/sessions/endsession.js +1 -0
- package/packages/host/dist/sessions/endsession.js.map +1 -1
- package/packages/host/dist/sessions/knobs.d.ts +12 -0
- package/packages/host/dist/sessions/knobs.js +12 -0
- package/packages/host/dist/sessions/knobs.js.map +1 -1
- package/packages/host/dist/sessions/loopwatch.d.ts +2 -0
- package/packages/host/dist/sessions/loopwatch.js +73 -0
- package/packages/host/dist/sessions/loopwatch.js.map +1 -0
- package/packages/host/dist/sessions/resume.d.ts +25 -36
- package/packages/host/dist/sessions/resume.js +97 -188
- package/packages/host/dist/sessions/resume.js.map +1 -1
- package/packages/host/dist/sessions/signinwait.d.ts +44 -0
- package/packages/host/dist/sessions/signinwait.js +286 -0
- package/packages/host/dist/sessions/signinwait.js.map +1 -0
- package/packages/host/dist/sessions/tmux.js +5 -0
- package/packages/host/dist/sessions/tmux.js.map +1 -1
- package/packages/host/dist/sessions/turn.js +36 -4
- package/packages/host/dist/sessions/turn.js.map +1 -1
- package/packages/host/dist/sessions/wall.d.ts +8 -5
- package/packages/host/dist/sessions/wall.js +112 -66
- package/packages/host/dist/sessions/wall.js.map +1 -1
- package/packages/host/dist/sessions.d.ts +6 -0
- package/packages/host/dist/sessions.js +14 -7
- package/packages/host/dist/sessions.js.map +1 -1
- package/packages/host/dist/sidecar/sidecarname.d.ts +3 -0
- package/packages/host/dist/sidecar/sidecarname.js +4 -0
- package/packages/host/dist/sidecar/sidecarname.js.map +1 -1
- package/packages/host/dist/toolloop.d.ts +30 -0
- package/packages/host/dist/toolloop.js +117 -0
- package/packages/host/dist/toolloop.js.map +1 -0
- package/packages/host/dist/usage.d.ts +12 -2
- package/packages/host/dist/usage.js +35 -3
- package/packages/host/dist/usage.js.map +1 -1
- package/packages/web/dist/assets/demo-DkCtg-SJ.js +26 -0
- package/packages/web/dist/assets/icons-B48F-4nA.js +1 -0
- package/packages/web/dist/assets/index-CpdyS6Xe.css +1 -0
- package/packages/web/dist/assets/index-EYc28CfH.js +170 -0
- package/packages/web/dist/assets/shared-DjRRLGfw.js +50 -0
- package/packages/web/dist/assets/sheets-ByWNPa9p.js +248 -0
- package/packages/web/dist/build-id.txt +1 -1
- package/packages/web/dist/buildstamp.json +1 -1
- package/packages/web/dist/index.html +6 -6
- package/packages/web/dist/sw.js +2 -2
- package/release.json +6 -3
- package/tools/repohealth/lang/typescript-resolve.mjs +4 -2
- package/tools/repohealth.mjs +35 -6
- package/node_modules/@waterplane/shared/dist/installlog.d.ts +0 -137
- package/node_modules/@waterplane/shared/dist/installlog.js.map +0 -1
- package/packages/host/dist/installlog.d.ts +0 -25
- package/packages/host/dist/installlog.js +0 -137
- package/packages/host/dist/installlog.js.map +0 -1
- package/packages/web/dist/assets/demo-DsZGy-MC.js +0 -24
- package/packages/web/dist/assets/icons-eqlvjswV.js +0 -1
- package/packages/web/dist/assets/index-GHwJuQb3.js +0 -169
- package/packages/web/dist/assets/index-VzDSZwwH.css +0 -1
- package/packages/web/dist/assets/shared-BWk5jXWb.js +0 -49
- package/packages/web/dist/assets/sheets-Dj-0m0DB.js +0 -232
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **The row-level half of "may a downloaded APK install itself"** — what the
|
|
3
|
+
* phone allows (`InstallCaps`), the Play build's refusals, and every sentence
|
|
4
|
+
* about ONE downloaded row. Pure, shared by the Downloads rows (`PullSheet`) and
|
|
5
|
+
* the Android apps surface, so the two never word the same row twice.
|
|
6
|
+
* The app-level half (`InstallBuild`, `appRows`, ...) stays in
|
|
7
|
+
* `web/installPolicy.ts` and imports from here.
|
|
8
|
+
*/
|
|
9
|
+
import { BRAND } from "./brand.js";
|
|
10
|
+
export const NO_INSTALL = { supported: false, canInstall: false, silent: false };
|
|
11
|
+
// ── The Google Play build ────────────────────────────────────────────
|
|
12
|
+
/** The distribution half of `ShellInstall.status()`'s answer. Anything but the
|
|
13
|
+
* two known words is ABSENT — an older shell, or a value this bundle has never
|
|
14
|
+
* heard of, inherits the full behaviour rather than being guessed into one. */
|
|
15
|
+
export function shellDistribution(r) {
|
|
16
|
+
if (!r || typeof r !== "object")
|
|
17
|
+
return {};
|
|
18
|
+
const o = r;
|
|
19
|
+
const out = {};
|
|
20
|
+
if (o.distribution === "dev" || o.distribution === "play")
|
|
21
|
+
out.distribution = o.distribution;
|
|
22
|
+
if (typeof o.self === "string" && o.self)
|
|
23
|
+
out.self = o.self;
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
/** Is this the Google Play build? Only a shell that SAYS so — absent is the
|
|
27
|
+
* full-feature behaviour every shell before the split had. */
|
|
28
|
+
export function isPlayBuild(caps) {
|
|
29
|
+
return caps.distribution === "play";
|
|
30
|
+
}
|
|
31
|
+
/** Is this package the shell itself, in the Play build — the one install that
|
|
32
|
+
* build refuses outright (`Installs.refusal` on the native side). */
|
|
33
|
+
export function isPlaySelf(pkg, caps) {
|
|
34
|
+
return isPlayBuild(caps) && !!pkg && !!caps.self && pkg === caps.self;
|
|
35
|
+
}
|
|
36
|
+
/** Why the Play build will not install a build of itself. Worded as the native
|
|
37
|
+
* refusal is (`Installs.SELF_UPDATE_REFUSED`), so the row and a failed tap read
|
|
38
|
+
* the same. */
|
|
39
|
+
export const PLAY_SELF_TEXT = "this build updates through Google Play — install the new version from the Play Store";
|
|
40
|
+
/** Why the Play build will not install an archive it could not read
|
|
41
|
+
* (`Installs.UNREADABLE_REFUSED`). */
|
|
42
|
+
export const PLAY_UNREAD_TEXT = "could not read which app this file is, and this build installs only an app it can name";
|
|
43
|
+
/** Why auto-install is not offered in the Play build — said where the switch
|
|
44
|
+
* would be, never as a dimmed switch (`Unavailable.tsx`). */
|
|
45
|
+
export function playAutoText(name) {
|
|
46
|
+
return `new builds of ${name} wait for a tap: this ${BRAND.displayName} comes from Google Play, ` +
|
|
47
|
+
"which does not let it install apps by themselves — every install asks";
|
|
48
|
+
}
|
|
49
|
+
/** The Play build's whole install story, in one sentence. */
|
|
50
|
+
export const PLAY_INTRO_TEXT = `A build downloaded here installs with the phone's own confirm dialog, one tap each. This ${BRAND.displayName} ` +
|
|
51
|
+
"comes from Google Play, which does not let it install apps by themselves, and it updates itself only through Play.";
|
|
52
|
+
/** Is this row an app at all? Name or declared type — the host's mime table and
|
|
53
|
+
* a phone's own guess have disagreed, and either saying so is enough. */
|
|
54
|
+
export function isApkRow(row) {
|
|
55
|
+
const n = (row.name ?? "").toLowerCase();
|
|
56
|
+
const m = (row.mime ?? "").toLowerCase();
|
|
57
|
+
return n.endsWith(".apk") || m === "application/vnd.android.package-archive";
|
|
58
|
+
}
|
|
59
|
+
/** What to call the app on screen: its own label, then its package, then the
|
|
60
|
+
* file name — which is the one that says nothing, so it is last. */
|
|
61
|
+
export function appLabel(row) {
|
|
62
|
+
return row.pkgLabel || row.pkg || row.name;
|
|
63
|
+
}
|
|
64
|
+
/** Is this package one the person said may install itself? */
|
|
65
|
+
export function isAllowed(row, allow) {
|
|
66
|
+
return !!row.pkg && allow.includes(row.pkg);
|
|
67
|
+
}
|
|
68
|
+
/** Add or remove a package, keeping the order stable so the sheet does not
|
|
69
|
+
* reshuffle under a tap. */
|
|
70
|
+
export function toggleAllow(allow, pkg) {
|
|
71
|
+
if (!pkg)
|
|
72
|
+
return [...allow];
|
|
73
|
+
return allow.includes(pkg) ? allow.filter((p) => p !== pkg) : [...allow, pkg];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* May this row be tapped to install — and if not, why not, in words.
|
|
77
|
+
*
|
|
78
|
+
* `verb` null with a `reason` is the `Unavailable.tsx` shape: the control is not
|
|
79
|
+
* drawn at all and the row carries the sentence. `verb` null with no reason is
|
|
80
|
+
* a row this subject has nothing to say about (not an app, not downloaded yet,
|
|
81
|
+
* a browser).
|
|
82
|
+
*/
|
|
83
|
+
export function installOffer(row, caps) {
|
|
84
|
+
if (!caps.supported)
|
|
85
|
+
return { verb: null, reason: null };
|
|
86
|
+
if (!isApkRow(row))
|
|
87
|
+
return { verb: null, reason: null };
|
|
88
|
+
if (row.state !== "done")
|
|
89
|
+
return { verb: null, reason: null };
|
|
90
|
+
if (isPlaySelf(row.pkg, caps))
|
|
91
|
+
return { verb: null, reason: PLAY_SELF_TEXT };
|
|
92
|
+
if (isPlayBuild(caps) && !row.pkg)
|
|
93
|
+
return { verb: null, reason: PLAY_UNREAD_TEXT };
|
|
94
|
+
if (row.evicted && row.cleanedAt)
|
|
95
|
+
return { verb: null, reason: cleanedText(row) };
|
|
96
|
+
if (row.evicted) {
|
|
97
|
+
return { verb: null, reason: "the bytes were cleared to save space — fetch it again to install it" };
|
|
98
|
+
}
|
|
99
|
+
if (!caps.canInstall) {
|
|
100
|
+
return {
|
|
101
|
+
verb: null,
|
|
102
|
+
reason: `this phone has not allowed ${BRAND.displayName} to install apps`,
|
|
103
|
+
settings: true,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (row.install === "installing")
|
|
107
|
+
return { verb: null, reason: null };
|
|
108
|
+
return { verb: "install", reason: null };
|
|
109
|
+
}
|
|
110
|
+
/** The install sentence, from the four facts that decide it. One implementation,
|
|
111
|
+
* because a download row and an app row must not word the same outcome two
|
|
112
|
+
* ways — `asked` is the system installer waiting for a tap and is never a
|
|
113
|
+
* failure, which is the distinction worth having in one place. */
|
|
114
|
+
export function stateText(install, error, label, version) {
|
|
115
|
+
switch (install) {
|
|
116
|
+
case "installing": return "installing…";
|
|
117
|
+
case "asked": return "waiting for you to confirm it on this phone";
|
|
118
|
+
case "installed": return `installed${version ? ` · ${label} ${version}` : ""}`;
|
|
119
|
+
case "failed": return `could not install: ${failureText(error)}`;
|
|
120
|
+
default: return null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** A failure in words a person can act on. PackageInstaller's out-of-space refusal reads "Failed to allocate N because
|
|
124
|
+
* only M allocatable" — true, but in bytes and without the one fact that
|
|
125
|
+
* matters: freeing space and retrying fixes it. Anything else keeps the
|
|
126
|
+
* phone's own words.
|
|
127
|
+
*
|
|
128
|
+
* M is NOT the free space Settings shows: "allocatable" is what is left after
|
|
129
|
+
* Android's low-storage reserve (5% of the disk, capped at 500 MB by default).
|
|
130
|
+
* Saying "has 0 MB free" sent a person who had freed space to free a little
|
|
131
|
+
* more, retry, and read the same 0 again — so the sentence names the reserve
|
|
132
|
+
* and the figure Settings has to reach. */
|
|
133
|
+
export function failureText(error) {
|
|
134
|
+
if (!error)
|
|
135
|
+
return "the phone did not say why";
|
|
136
|
+
// Play Protect's package verifier said no. The shell already re-asks OUT LOUD after a
|
|
137
|
+
// refused silent attempt (`installLoudAfterRefusal`), so reaching this means that ask
|
|
138
|
+
// was refused or dismissed too — the platform's words name neither Play Protect nor a remedy.
|
|
139
|
+
if (/VERIFICATION_FAILURE/.test(error)) {
|
|
140
|
+
return "Google Play Protect stopped it — it checks every app from outside the Play Store, and refused this build " +
|
|
141
|
+
"with nobody there to answer it. Retry with the phone in hand: if Play Protect asks, install anyway. If it " +
|
|
142
|
+
"refuses without asking, Play Store › Play Protect says why";
|
|
143
|
+
}
|
|
144
|
+
if (/Session was abandoned/i.test(error)) {
|
|
145
|
+
return "the install was dropped before it finished — Android abandons one when the app is closed mid-install or " +
|
|
146
|
+
"the confirm dialog goes unanswered. A retry starts a fresh one";
|
|
147
|
+
}
|
|
148
|
+
const m = /allocate (\d+) because only (\d+) allocatable/i.exec(error);
|
|
149
|
+
if (!m)
|
|
150
|
+
return error;
|
|
151
|
+
const mb = (n) => `${Math.ceil(n / 1e6)} MB`;
|
|
152
|
+
const need = Number(m[1]);
|
|
153
|
+
const usable = Number(m[2]);
|
|
154
|
+
const have = usable > 0 ? `only ${mb(usable)} of it is usable` : "none of it is usable yet";
|
|
155
|
+
return `this phone is out of space — it needs ${mb(need)} beyond the room Android keeps in reserve (up to 500 MB), and ${have}. `
|
|
156
|
+
+ `Free space until Settings shows about ${mb(need + 500e6 - usable)} free, then retry`;
|
|
157
|
+
}
|
|
158
|
+
/** The word on the install button. After a failure it is a RETRY — the same
|
|
159
|
+
* tap, but "install" beside "could not install" read as the thing that had
|
|
160
|
+
* just not worked rather than the way to try again. */
|
|
161
|
+
export function installVerbText(install) {
|
|
162
|
+
if (install === "failed")
|
|
163
|
+
return "retry install";
|
|
164
|
+
if (install === "installed")
|
|
165
|
+
return "install again";
|
|
166
|
+
return "install";
|
|
167
|
+
}
|
|
168
|
+
/** The install sentence for a DOWNLOAD row, or null where there is nothing to
|
|
169
|
+
* say. */
|
|
170
|
+
export function installStatusText(row) {
|
|
171
|
+
return stateText(row.install, row.installError, appLabel(row), row.pkgVersion);
|
|
172
|
+
}
|
|
173
|
+
/** A build that DECLARES THE SAME VERSION as an older build of the same app
|
|
174
|
+
* still on this phone. Android installs it anyway (an equal versionCode is
|
|
175
|
+
* not a downgrade), so nothing fails — but the installed app, the history and
|
|
176
|
+
* this row can no longer say which build is on the phone. The cure is in the
|
|
177
|
+
* repo, not here: its build must raise the version every time, uncommitted
|
|
178
|
+
* rebuilds included (a commit-count version stays put between commits —
|
|
179
|
+
* Talking-sandwatch, 2026-11-01). Said on the NEWER build only, and only where
|
|
180
|
+
* both creation stamps are known and differ: one file fetched twice is not two
|
|
181
|
+
* builds. Null otherwise — never a guess. */
|
|
182
|
+
export function repeatedVersionText(row, all) {
|
|
183
|
+
const at = row.mtime;
|
|
184
|
+
if (!row.pkg || !row.pkgVersion || !at)
|
|
185
|
+
return null;
|
|
186
|
+
const older = all.some((b) => b.pkg === row.pkg && b.pkgVersion === row.pkgVersion && !!b.mtime && b.mtime < at);
|
|
187
|
+
if (!older)
|
|
188
|
+
return null;
|
|
189
|
+
return `same version (${row.pkgVersion}) as an older build on this phone — its repo does not raise the version `
|
|
190
|
+
+ "on every build, so once installed the two cannot be told apart. Ask the repo's agent to raise it on every build";
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* What happens to the NEXT build of this app, as a promise the row can keep.
|
|
194
|
+
*
|
|
195
|
+
* Null where nothing has been decided — an unread package, a row that is not an
|
|
196
|
+
* app, a browser. The allowed-but-first-time sentence is the important one: it
|
|
197
|
+
* is the difference between "this will be quiet" and "this will be quiet from
|
|
198
|
+
* the build after next".
|
|
199
|
+
*/
|
|
200
|
+
export function autoInstallText(row, caps, allow) {
|
|
201
|
+
if (!caps.supported || !isApkRow(row) || !row.pkg)
|
|
202
|
+
return null;
|
|
203
|
+
const name = appLabel(row);
|
|
204
|
+
if (isPlaySelf(row.pkg, caps))
|
|
205
|
+
return PLAY_SELF_TEXT;
|
|
206
|
+
if (isPlayBuild(caps))
|
|
207
|
+
return playAutoText(name);
|
|
208
|
+
if (!isAllowed(row, allow))
|
|
209
|
+
return `new builds of ${name} wait for a tap`;
|
|
210
|
+
if (!caps.canInstall)
|
|
211
|
+
return `${name} would install itself once this phone allows it`;
|
|
212
|
+
if (!caps.silent)
|
|
213
|
+
return `new builds of ${name} install by themselves, and this Android asks every time`;
|
|
214
|
+
if (row.install === "installed")
|
|
215
|
+
return `new builds of ${name} install by themselves`;
|
|
216
|
+
return `new builds of ${name} install by themselves — the first one asks once`;
|
|
217
|
+
}
|
|
218
|
+
/** The label on the per-app switch. Not drawn at all where the package could
|
|
219
|
+
* not be read: a promise about "this app" needs to know which app. Not drawn
|
|
220
|
+
* in the Play build either — `autoInstallText` says why in its place. */
|
|
221
|
+
export function allowToggle(row, caps, allow) {
|
|
222
|
+
if (!caps.supported || !isApkRow(row) || !row.pkg)
|
|
223
|
+
return null;
|
|
224
|
+
if (isPlayBuild(caps))
|
|
225
|
+
return null;
|
|
226
|
+
const on = isAllowed(row, allow);
|
|
227
|
+
return {
|
|
228
|
+
pkg: row.pkg,
|
|
229
|
+
on,
|
|
230
|
+
label: on ? `stop installing ${appLabel(row)} by itself` : `install ${appLabel(row)} by itself`,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/** What the sheet says about the whole feature, once, above the rows. Null in a
|
|
234
|
+
* browser — there is nothing here to explain. */
|
|
235
|
+
export function installIntroText(caps, allow) {
|
|
236
|
+
if (!caps.supported)
|
|
237
|
+
return null;
|
|
238
|
+
if (!caps.canInstall) {
|
|
239
|
+
return `Allow ${BRAND.displayName} to install apps and a build downloaded here can go straight onto this phone.`;
|
|
240
|
+
}
|
|
241
|
+
if (isPlayBuild(caps))
|
|
242
|
+
return PLAY_INTRO_TEXT;
|
|
243
|
+
if (!allow.length)
|
|
244
|
+
return "No app installs by itself yet — you can turn it on for an app, one at a time.";
|
|
245
|
+
const n = allow.length;
|
|
246
|
+
return n === 1
|
|
247
|
+
? "1 app installs itself when a new build arrives."
|
|
248
|
+
: `${n} apps install themselves when a new build arrives.`;
|
|
249
|
+
}
|
|
250
|
+
// ── Clean-up after an install ────────────────────────────────────────
|
|
251
|
+
function mb(bytes) {
|
|
252
|
+
return bytes >= 1e6 ? `${Math.round(bytes / 1e6)} MB` : `${Math.max(1, Math.round(bytes / 1e3))} kB`;
|
|
253
|
+
}
|
|
254
|
+
/** What a cleaned row says: the APK went because the build installed, how much
|
|
255
|
+
* came back, and — never swallowed — a Downloads copy that stayed. */
|
|
256
|
+
export function cleanedText(row) {
|
|
257
|
+
const freed = row.cleanedBytes ? ` (${mb(row.cleanedBytes)} freed)` : "";
|
|
258
|
+
const base = `APK deleted after it installed${freed} — fetch it again to reinstall`;
|
|
259
|
+
return row.cleanNote ? `${base} · ${row.cleanNote}` : base;
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=installrow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installrow.js","sourceRoot":"","sources":["../src/installrow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAqBnC,MAAM,CAAC,MAAM,UAAU,GAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAE9F,wEAAwE;AAExE;;gFAEgF;AAChF,MAAM,UAAU,iBAAiB,CAAC,CAAU;IAC1C,IAAI,CAAC,CAAC,IAAI,OAAO,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
@@ -50,6 +50,12 @@ export type BlockReason =
|
|
|
50
50
|
| "awaitingAnswer"
|
|
51
51
|
/** The target session is parked on a usage limit, waiting for the reset. */
|
|
52
52
|
| "limit"
|
|
53
|
+
/** The target session is signed out (`blockOf` kind `auth`): nothing runs
|
|
54
|
+
* there until a person signs in. */
|
|
55
|
+
| "auth"
|
|
56
|
+
/** The host is retrying a turn the target gave up on a transient API error,
|
|
57
|
+
* or that turn is stalled (`blockOf` kind `net`). */
|
|
58
|
+
| "net"
|
|
53
59
|
/** The `files` trigger's paths are not all on disk yet. */
|
|
54
60
|
| "filesMissing"
|
|
55
61
|
/** The `at` trigger's instant has not arrived. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/intent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/intent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkZH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC"}
|
|
@@ -114,7 +114,8 @@ export declare function localSlotOverText(f: LocalSlotFacts): string | undefined
|
|
|
114
114
|
* gate is one tap away; `budget` is the only reason here that is about the
|
|
115
115
|
* ACCOUNT rather than one row's position, so when it is true it is the answer
|
|
116
116
|
* for every row at once; `sessionGone` sits above the self-resolving waits
|
|
117
|
-
* because it is the only one that never clears on its own
|
|
117
|
+
* because it is the only one that never clears on its own — and `auth` right
|
|
118
|
+
* after it for the same reason (only a sign-in clears it).
|
|
118
119
|
*/
|
|
119
120
|
export declare const INTENT_BLOCK_ORDER: readonly BlockReason[];
|
|
120
121
|
/**
|
|
@@ -59,6 +59,10 @@ export function intentReasonText(reason, detail) {
|
|
|
59
59
|
return "waiting — the session is waiting for an answer";
|
|
60
60
|
case "limit":
|
|
61
61
|
return "the session is blocked on a usage limit — waiting for it to reopen";
|
|
62
|
+
case "auth":
|
|
63
|
+
return "the session is signed out — send /login there to sign in, and this goes once it is";
|
|
64
|
+
case "net":
|
|
65
|
+
return "the session's last turn hit a network error — waiting for the host's retry to get through";
|
|
62
66
|
case "filesMissing":
|
|
63
67
|
return "waiting for its files to finish uploading";
|
|
64
68
|
case "notYet":
|
|
@@ -155,10 +159,11 @@ export function localSlotOverText(f) {
|
|
|
155
159
|
* gate is one tap away; `budget` is the only reason here that is about the
|
|
156
160
|
* ACCOUNT rather than one row's position, so when it is true it is the answer
|
|
157
161
|
* for every row at once; `sessionGone` sits above the self-resolving waits
|
|
158
|
-
* because it is the only one that never clears on its own
|
|
162
|
+
* because it is the only one that never clears on its own — and `auth` right
|
|
163
|
+
* after it for the same reason (only a sign-in clears it).
|
|
159
164
|
*/
|
|
160
165
|
export const INTENT_BLOCK_ORDER = [
|
|
161
|
-
"offline", "gate", "budget", "sessionBudget", "sessionGone", "limit", "awaitingAnswer", "notYet", "filesMissing", "serial", "hostBusy", "localModel", "noSlot", "sessionBusy",
|
|
166
|
+
"offline", "gate", "budget", "sessionBudget", "sessionGone", "auth", "limit", "net", "awaitingAnswer", "notYet", "filesMissing", "serial", "hostBusy", "localModel", "noSlot", "sessionBusy",
|
|
162
167
|
];
|
|
163
168
|
/**
|
|
164
169
|
* The "no session" sentences. Kept as constants because the whole point of them
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"words.js","sourceRoot":"","sources":["../../src/intent/words.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C,yDAAyD;AACzD,MAAM,UAAU,IAAI,CAAC,MAAmB,EAAE,MAAe;IACvD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CA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AM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAU,EAAE,CACtD,KAAK,CAAC,CAAC,CAAC,cAAc,KAAK,aAAa,CAAC,CAAC,CAAC,wCAAwC,CAAC;AAEtF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAU,EAAE,CACtD,KAAK;IACH,CAAC,CAAC,sCAAsC,KAAK,6EAA6E;IAC1H,CAAC,CAAC,2GAA2G,CAAC;AAElH,MAAM,CAAC,MAAM,wBAAwB,GACnC,uFAAuF,CAAC;AAE1F,MAAM,CAAC,MAAM,0BAA0B,GACrC,kHAAkH,CAAC;AAErH,MAAM,CAAC,MAAM,UAAU,GACrB,qHAAqH,CAAC;AAExH;;;;0DAI0D;AAC1D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC1D,sBAAsB,QAAQ,4EAA4E,CAAC;AAE7G,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAc,EAAU,EAAE,CAC1D,CAAC,KAAK;IACJ,CAAC,CAAC,6BAA6B,KAAK,iDAAiD;IACrF,CAAC,CAAC,sEAAsE,CAAC;MACzE,2DAA2D,CAAC;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAU,EAAE,CAC3D,CAAC,KAAK;IACJ,CAAC,CAAC,8BAA8B,KAAK,8CAA8C;IACnF,CAAC,CAAC,oEAAoE,CAAC;MACvE,0FAA0F,CAAC"}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The files an item's words name: images anywhere, and the phone↔repo
|
|
3
|
-
* transport by full path.
|
|
4
|
-
*
|
|
5
|
-
* Moved out of the smart pick (removed 2026-10-16), where it decided whether
|
|
6
|
-
* a merge kept every file its members named. The backlog row's thumbnails read
|
|
7
|
-
* `imagePaths`; `transportPaths` is the rule anything that ever folds two
|
|
8
|
-
* items into one must keep — a merged text that drops a path is a merge that
|
|
9
|
-
* loses the picture somebody attached.
|
|
10
|
-
*/
|
|
11
1
|
/**
|
|
12
2
|
* An image path as the backlog row's thumbnails find one.
|
|
13
3
|
*
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* items into one must keep — a merged text that drops a path is a merge that
|
|
9
9
|
* loses the picture somebody attached.
|
|
10
10
|
*/
|
|
11
|
+
import { trimEndChars } from "./lineartrim.js";
|
|
11
12
|
/**
|
|
12
13
|
* An image path as the backlog row's thumbnails find one.
|
|
13
14
|
*
|
|
@@ -33,11 +34,37 @@ export const TRANSPORT_RE = /\.claude\/(?:inbox|outbox)\/\S+/gi;
|
|
|
33
34
|
* `TRANSPORT_RE` starts at `.claude/`, so an opening fence falls outside its
|
|
34
35
|
* match, while `IMG_RE` is `\S+` and swallows it.
|
|
35
36
|
*/
|
|
36
|
-
const trimPath = (s) => s.replace(/^[([{'"`*]+/, "")
|
|
37
|
+
const trimPath = (s) => trimEndChars(s.replace(/^[([{'"`*]+/, ""), ")]}.,;:'\"`*");
|
|
38
|
+
/** The image extension alone, for `imgMatches`: no leading quantifier, so linear. */
|
|
39
|
+
const IMG_EXT_RE = /\.(?:png|jpe?g|gif|webp|bmp|heic|heif|svg)\b/gi;
|
|
40
|
+
/**
|
|
41
|
+
* `text.match(IMG_RE)` without the regex's quadratic scan (CodeQL
|
|
42
|
+
* `js/polynomial-redos`: `\S+` retried from every start of a long run with no
|
|
43
|
+
* extension). Same hits: a match never crosses whitespace, and greedy `\S+` makes
|
|
44
|
+
* it run from the START of its whitespace-free run to the end of the LAST
|
|
45
|
+
* extension in that run (an extension holds no `.`, so no later one is hidden
|
|
46
|
+
* inside it) — hence at most one per run, and none when that extension's dot is
|
|
47
|
+
* the run's first character.
|
|
48
|
+
*/
|
|
49
|
+
function imgMatches(text) {
|
|
50
|
+
const out = [];
|
|
51
|
+
for (const run of text.split(/\s+/)) {
|
|
52
|
+
let end = -1;
|
|
53
|
+
let dot = -1;
|
|
54
|
+
IMG_EXT_RE.lastIndex = 0;
|
|
55
|
+
for (let e; (e = IMG_EXT_RE.exec(run));) {
|
|
56
|
+
dot = e.index;
|
|
57
|
+
end = e.index + e[0].length;
|
|
58
|
+
}
|
|
59
|
+
if (dot > 0)
|
|
60
|
+
out.push(run.slice(0, end));
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
37
64
|
/** Every image path in some text, de-duplicated, trailing punctuation stripped. */
|
|
38
65
|
export function imagePaths(text) {
|
|
39
|
-
const m = typeof text === "string" ? text
|
|
40
|
-
return
|
|
66
|
+
const m = typeof text === "string" ? imgMatches(text) : [];
|
|
67
|
+
return [...new Set(m.map(trimPath))];
|
|
41
68
|
}
|
|
42
69
|
/**
|
|
43
70
|
* Every FILE this text tells an agent to look at: transport paths first, then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"itempaths.js","sourceRoot":"","sources":["../src/itempaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"itempaths.js","sourceRoot":"","sources":["../src/itempaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,mDAAmD,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,mCAAmC,CAAC;AAEhE;;;;;;;;GAQG;AACH,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;AAEnG,qFAAqF;AACrF,MAAM,UAAU,GAAG,gDAAgD,CAAC;AAEpE;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,E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CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trimming a run of given characters off a string's end (or start) in LINEAR
|
|
3
|
+
* time. `s.replace(/[\\/]+$/, "")` is quadratic on a string with many runs of
|
|
4
|
+
* the class that do not reach the end (the engine retries the run from every
|
|
5
|
+
* offset), which CodeQL flags as polynomial ReDoS; these loops answer exactly
|
|
6
|
+
* what that regex would, once per character.
|
|
7
|
+
*/
|
|
8
|
+
/** `s` with every trailing character that is in `chars` removed — `s.replace(/[<chars>]+$/, "")`. */
|
|
9
|
+
export declare function trimEndChars(s: string, chars: string): string;
|
|
10
|
+
/** `s` with every leading character that is in `chars` removed — `s.replace(/^[<chars>]+/, "")`. */
|
|
11
|
+
export declare function trimStartChars(s: string, chars: string): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trimming a run of given characters off a string's end (or start) in LINEAR
|
|
3
|
+
* time. `s.replace(/[\\/]+$/, "")` is quadratic on a string with many runs of
|
|
4
|
+
* the class that do not reach the end (the engine retries the run from every
|
|
5
|
+
* offset), which CodeQL flags as polynomial ReDoS; these loops answer exactly
|
|
6
|
+
* what that regex would, once per character.
|
|
7
|
+
*/
|
|
8
|
+
/** `s` with every trailing character that is in `chars` removed — `s.replace(/[<chars>]+$/, "")`. */
|
|
9
|
+
export function trimEndChars(s, chars) {
|
|
10
|
+
let e = s.length;
|
|
11
|
+
while (e > 0 && chars.includes(s[e - 1]))
|
|
12
|
+
e--;
|
|
13
|
+
return e === s.length ? s : s.slice(0, e);
|
|
14
|
+
}
|
|
15
|
+
/** `s` with every leading character that is in `chars` removed — `s.replace(/^[<chars>]+/, "")`. */
|
|
16
|
+
export function trimStartChars(s, chars) {
|
|
17
|
+
let b = 0;
|
|
18
|
+
while (b < s.length && chars.includes(s[b]))
|
|
19
|
+
b++;
|
|
20
|
+
return b === 0 ? s : s.slice(b);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=lineartrim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineartrim.js","sourceRoot":"","sources":["../src/lineartrim.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qGAAqG;AACrG,MAAM,UAAU,YAAY,CAAC,CAAS,EAAE,KAAa;IACnD,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAAE,CAAC,EAAE,CAAC;IAC9C,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,cAAc,CAAC,CAAS,EAAE,KAAa;IACrD,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAE,CAAC,EAAE,CAAC;IACjD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
* same thing. Pure; the clock is the caller's (the phone's, at render).
|
|
5
5
|
*/
|
|
6
6
|
import type { SessionNetRetry } from "./wire/session.js";
|
|
7
|
+
/** What a HELD net retry (`SessionNetRetry.heldBy`) says it waits for. The host also
|
|
8
|
+
* writes it to `why`, for a phone that predates the field. */
|
|
9
|
+
export declare const NET_HELD_WHY = "waiting for another session's retry to get through first";
|
|
10
|
+
/** The reason a `waiting` retry gives, if any: the field (`heldBy`) first, then the
|
|
11
|
+
* host's own sentence (`why`, an older host's way of saying the same). */
|
|
12
|
+
export declare function netRetryWhy(n: SessionNetRetry): string | undefined;
|
|
7
13
|
/** "40s", "2m", "1m 30s" — whole seconds, never negative. */
|
|
8
14
|
export declare function netRetryWait(ms: number): string;
|
|
9
15
|
/**
|
|
@@ -36,6 +42,10 @@ export declare function netRetryStalls(n: SessionNetRetry | null | undefined): b
|
|
|
36
42
|
* - `gaveup`: the API stayed unreachable and the retries ran out (or the halt
|
|
37
43
|
* stopped them) — the work is STALLED: it stays `running` (never failed,
|
|
38
44
|
* never re-fired) until a real turn end; `detail` is the sentence for it.
|
|
45
|
+
* - `signedOut`: the turn ended because the CLI is not signed in (claude's
|
|
46
|
+
* `StopFailure authentication_failed`) — nothing ran, so the work waiting on
|
|
47
|
+
* it stays `running` exactly like `gaveup`, until a real turn end after a
|
|
48
|
+
* sign-in. Not a net give-up: the net retry is not asked about this turn.
|
|
39
49
|
* Absent = an ordinary turn end.
|
|
40
50
|
*/
|
|
41
51
|
export type TurnEndNet = {
|
|
@@ -45,6 +55,8 @@ export type TurnEndNet = {
|
|
|
45
55
|
} | {
|
|
46
56
|
net: "gaveup";
|
|
47
57
|
detail: string;
|
|
58
|
+
} | {
|
|
59
|
+
net: "signedOut";
|
|
48
60
|
};
|
|
49
61
|
/** What became of the turn when the retries ran out, as one sentence (carried on
|
|
50
62
|
* `TurnEndNet.detail`; the work waiting on it is stalled, not failed by it). */
|
|
@@ -69,10 +81,19 @@ export declare function netStalledOf(row: {
|
|
|
69
81
|
/**
|
|
70
82
|
* The note a stalled row wears: "Stalled — API unreachable, 8 retries used ·
|
|
71
83
|
* next try in 23m" (the stall probe, `nextAt` on a `gaveup`), or "… · trying
|
|
72
|
-
* again now" while a probe runs. `
|
|
73
|
-
*
|
|
84
|
+
* again now" while a probe runs. A `waiting` record that says WHY it waits
|
|
85
|
+
* (held behind another session's stalled probe, `SessionNetRetry.why`) says
|
|
86
|
+
* that instead, with the clock it waits for when there is one. `now` is the
|
|
87
|
+
* caller's clock; without it the probe clause is left out rather than guessed.
|
|
74
88
|
*/
|
|
75
89
|
export declare function netStalledText(n: SessionNetRetry, now?: number): string;
|
|
90
|
+
/**
|
|
91
|
+
* The note work wears while its session is SIGNED OUT (`TurnEndNet` `signedOut`,
|
|
92
|
+
* `blockOf(s)?.kind === "auth"`): the row stays `running` — held exactly like a
|
|
93
|
+
* net stall, never failed for its silence (`intents/watch.ts`) — and says why.
|
|
94
|
+
* One sentence for every reader; "continue" is the person's tap after signing in.
|
|
95
|
+
*/
|
|
96
|
+
export declare const SIGNED_OUT_STALL_TEXT = "stopped: the CLI is signed out \u2014 sign in, then continue";
|
|
76
97
|
/** What "Retry now" does, as the line beside it and its receipt. */
|
|
77
98
|
export declare const NET_RETRY_NOW_NOTE = "Retry now types \u201Ccontinue\u201D into that session, the way the automatic retry does; the work completes on the next real reply.";
|
|
78
99
|
export declare const NET_RETRY_NOW_SENT = "retrying now \u2014 \u201Ccontinue\u201D is typed once the session is quiet";
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/** What a HELD net retry (`SessionNetRetry.heldBy`) says it waits for. The host also
|
|
2
|
+
* writes it to `why`, for a phone that predates the field. */
|
|
3
|
+
export const NET_HELD_WHY = "waiting for another session's retry to get through first";
|
|
4
|
+
/** The reason a `waiting` retry gives, if any: the field (`heldBy`) first, then the
|
|
5
|
+
* host's own sentence (`why`, an older host's way of saying the same). */
|
|
6
|
+
export function netRetryWhy(n) {
|
|
7
|
+
return n.heldBy ? NET_HELD_WHY : n.why || undefined;
|
|
8
|
+
}
|
|
1
9
|
/** "40s", "2m", "1m 30s" — whole seconds, never negative. */
|
|
2
10
|
export function netRetryWait(ms) {
|
|
3
11
|
const s = Math.max(0, Math.ceil(ms / 1000));
|
|
@@ -18,7 +26,7 @@ export function netRetryLine(n, now) {
|
|
|
18
26
|
return null;
|
|
19
27
|
if (n.state === "waiting") {
|
|
20
28
|
const when = n.nextAt != null ? `retrying in ${netRetryWait(n.nextAt - now)}` : "retry waiting";
|
|
21
|
-
return `Network error — ${when} (${n.attempt + 1}/${n.max})${n
|
|
29
|
+
return `Network error — ${when} (${n.attempt + 1}/${n.max})${netRetryWhy(n) ? ` · ${netRetryWhy(n)}` : ""}`;
|
|
22
30
|
}
|
|
23
31
|
if (n.state === "sent") {
|
|
24
32
|
return n.probe
|
|
@@ -67,18 +75,29 @@ export function netStalledOf(row, sessions) {
|
|
|
67
75
|
/**
|
|
68
76
|
* The note a stalled row wears: "Stalled — API unreachable, 8 retries used ·
|
|
69
77
|
* next try in 23m" (the stall probe, `nextAt` on a `gaveup`), or "… · trying
|
|
70
|
-
* again now" while a probe runs. `
|
|
71
|
-
*
|
|
78
|
+
* again now" while a probe runs. A `waiting` record that says WHY it waits
|
|
79
|
+
* (held behind another session's stalled probe, `SessionNetRetry.why`) says
|
|
80
|
+
* that instead, with the clock it waits for when there is one. `now` is the
|
|
81
|
+
* caller's clock; without it the probe clause is left out rather than guessed.
|
|
72
82
|
*/
|
|
73
83
|
export function netStalledText(n, now) {
|
|
74
84
|
const used = n.attempt === 1 ? "1 retry used" : `${n.attempt} retries used`;
|
|
75
85
|
// `why` opens with the count ("after 8 tries") the note already says; only
|
|
76
86
|
// what follows it (the halt, the switch being off) is worth a clause.
|
|
77
87
|
const rest = n.state === "gaveup" ? (n.why ?? "").replace(/^after \d+ tr(?:y|ies)(?: — )?/, "").trim() : "";
|
|
78
|
-
const
|
|
79
|
-
|
|
88
|
+
const next = n.nextAt != null && now != null ? ` · next try in ${netStallWait(n.nextAt - now)}` : "";
|
|
89
|
+
const probe = n.state === "gaveup" ? next
|
|
90
|
+
: n.state === "waiting" && netRetryWhy(n) ? ` · ${netRetryWhy(n)}${next}`
|
|
91
|
+
: " · trying again now";
|
|
80
92
|
return `Stalled — API unreachable, ${used}${rest ? ` (${rest})` : ""}${probe}`;
|
|
81
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* The note work wears while its session is SIGNED OUT (`TurnEndNet` `signedOut`,
|
|
96
|
+
* `blockOf(s)?.kind === "auth"`): the row stays `running` — held exactly like a
|
|
97
|
+
* net stall, never failed for its silence (`intents/watch.ts`) — and says why.
|
|
98
|
+
* One sentence for every reader; "continue" is the person's tap after signing in.
|
|
99
|
+
*/
|
|
100
|
+
export const SIGNED_OUT_STALL_TEXT = "stopped: the CLI is signed out — sign in, then continue";
|
|
82
101
|
/** What "Retry now" does, as the line beside it and its receipt. */
|
|
83
102
|
export const NET_RETRY_NOW_NOTE = "Retry now types “continue” into that session, the way the automatic retry does; the work completes on the next real reply.";
|
|
84
103
|
export const NET_RETRY_NOW_SENT = "retrying now — “continue” is typed once the session is quiet";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"netretry.js","sourceRoot":"","sources":["../src/netretry.ts"],"names":[],"mappings":"AAOA,6DAA6D;AAC7D,MAAM,UAAU,YAAY,CAAC,EAAU;IACrC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5C,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC;IAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACzC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;AACrC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,CAAqC,EAAE,GAAW;IAC7E,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,eAAe,YAA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AAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI;QACvC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE;YACzE,CAAC,CAAC,qBAAqB,CAAC;IAC1B,OAAO,8BAA8B,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;AACjF,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,yDAAyD,CAAC;AAE/F,oEAAoE;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,4HAA4H,CAAC;AAC/J,MAAM,CAAC,MAAM,kBAAkB,GAAG,8DAA8D,CAAC"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import { normalizeHostBase } from "./hosturl.js";
|
|
16
16
|
import { BRAND, LEGACY } from "./brand.js";
|
|
17
17
|
import { randomFromAlphabet, defaultRandomBytes } from "./hosts.js";
|
|
18
|
+
import { trimEndChars } from "./lineartrim.js";
|
|
18
19
|
/** 32 characters (a power of two: uniform from a byte), no 0, O, 1 or I. */
|
|
19
20
|
export const PAIR_ALPHABET = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
|
20
21
|
export const PAIR_CODE_LEN = 8;
|
|
@@ -49,7 +50,7 @@ export function pairDeepLink(base, code) {
|
|
|
49
50
|
return `${PAIR_SCHEME}://pair?u=${encodeURIComponent(base)}&c=${encodeURIComponent(code)}`;
|
|
50
51
|
}
|
|
51
52
|
export function pairLandingUrl(base, code) {
|
|
52
|
-
return `${base
|
|
53
|
+
return `${trimEndChars(base, "/")}/pair/${code}`;
|
|
53
54
|
}
|
|
54
55
|
/** Parse `<scheme>://pair?u=<base>&c=<code>` (current or a legacy scheme), or `null`. */
|
|
55
56
|
export function parsePairDeepLink(raw) {
|