waterplane 0.1.24 → 0.1.26
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 +49 -0
- package/SECURITY.md +25 -5
- package/node_modules/@waterplane/shared/dist/agentseries/compare.d.ts +8 -0
- package/node_modules/@waterplane/shared/dist/agentseries/compare.js +103 -0
- package/node_modules/@waterplane/shared/dist/agentseries/compare.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/agentseries/markers.d.ts +17 -0
- package/node_modules/@waterplane/shared/dist/agentseries/markers.js +125 -0
- package/node_modules/@waterplane/shared/dist/agentseries/markers.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/agentseries/series.d.ts +16 -0
- package/node_modules/@waterplane/shared/dist/agentseries/series.js +93 -0
- package/node_modules/@waterplane/shared/dist/agentseries/series.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/agentseries/stats.d.ts +8 -0
- package/node_modules/@waterplane/shared/dist/agentseries/stats.js +33 -0
- package/node_modules/@waterplane/shared/dist/agentseries/stats.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/agentseries/types.d.ts +103 -0
- package/node_modules/@waterplane/shared/dist/agentseries/types.js +11 -0
- package/node_modules/@waterplane/shared/dist/agentseries/types.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/agentseries.d.ts +10 -0
- package/node_modules/@waterplane/shared/dist/agentseries.js +11 -0
- package/node_modules/@waterplane/shared/dist/agentseries.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/calday.d.ts +5 -0
- package/node_modules/@waterplane/shared/dist/calday.js +10 -0
- package/node_modules/@waterplane/shared/dist/calday.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/clihealth/healthfixture.d.ts +13 -1
- package/node_modules/@waterplane/shared/dist/clihealth/healthfixture.js +22 -4
- package/node_modules/@waterplane/shared/dist/clihealth/healthfixture.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/clihealth.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/clihealth.js +1 -1
- package/node_modules/@waterplane/shared/dist/clihealth.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/dictate.d.ts +6 -0
- package/node_modules/@waterplane/shared/dist/dictate.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/dictatemodels.d.ts +23 -0
- package/node_modules/@waterplane/shared/dist/dictatemodels.js +31 -0
- package/node_modules/@waterplane/shared/dist/dictatemodels.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/commits.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/healthindex/commits.js +2 -2
- package/node_modules/@waterplane/shared/dist/healthindex/commits.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/healthindex/coverage.d.ts +128 -0
- package/node_modules/@waterplane/shared/dist/healthindex/coverage.js +343 -0
- package/node_modules/@waterplane/shared/dist/healthindex/coverage.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/readings.d.ts +9 -1
- package/node_modules/@waterplane/shared/dist/healthindex/readings.js +122 -4
- package/node_modules/@waterplane/shared/dist/healthindex/readings.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.d.ts +5 -0
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js +2 -0
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/healthindex/score.d.ts +3 -0
- package/node_modules/@waterplane/shared/dist/healthindex/score.js +52 -16
- package/node_modules/@waterplane/shared/dist/healthindex/score.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/healthindex/types.d.ts +82 -6
- package/node_modules/@waterplane/shared/dist/healthindex/types.js +35 -2
- package/node_modules/@waterplane/shared/dist/healthindex/types.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/healthindex/words.js +65 -6
- package/node_modules/@waterplane/shared/dist/healthindex/words.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/healthindex.d.ts +21 -7
- package/node_modules/@waterplane/shared/dist/healthindex.js +20 -7
- package/node_modules/@waterplane/shared/dist/healthindex.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/healthindexresponse.js +3 -2
- package/node_modules/@waterplane/shared/dist/healthindexresponse.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/healthspend.d.ts +23 -0
- package/node_modules/@waterplane/shared/dist/healthspend.js +32 -1
- package/node_modules/@waterplane/shared/dist/healthspend.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/hints.js +9 -0
- package/node_modules/@waterplane/shared/dist/hints.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/index.d.ts +9 -0
- package/node_modules/@waterplane/shared/dist/index.js +9 -0
- package/node_modules/@waterplane/shared/dist/index.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/installrow.js +10 -0
- package/node_modules/@waterplane/shared/dist/installrow.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent/kind.d.ts +45 -1
- package/node_modules/@waterplane/shared/dist/intent/kind.js +60 -2
- 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/itempaths.d.ts +23 -0
- package/node_modules/@waterplane/shared/dist/itempaths.js +38 -0
- package/node_modules/@waterplane/shared/dist/itempaths.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/pluginlaunch.d.ts +3 -2
- package/node_modules/@waterplane/shared/dist/pluginlaunch.js +1 -1
- package/node_modules/@waterplane/shared/dist/pluginlaunch.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/pricelist.d.ts +57 -0
- package/node_modules/@waterplane/shared/dist/pricelist.js +128 -0
- package/node_modules/@waterplane/shared/dist/pricelist.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/pricing.d.ts +86 -9
- package/node_modules/@waterplane/shared/dist/pricing.js +140 -20
- package/node_modules/@waterplane/shared/dist/pricing.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/queue/queuelanestate.d.ts +14 -0
- package/node_modules/@waterplane/shared/dist/queue/queuelanestate.js +25 -0
- package/node_modules/@waterplane/shared/dist/queue/queuelanestate.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/queue/queueplan.d.ts +4 -0
- package/node_modules/@waterplane/shared/dist/queue/queueplan.js +21 -0
- package/node_modules/@waterplane/shared/dist/queue/queueplan.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/queue/queuewords.js +2 -1
- package/node_modules/@waterplane/shared/dist/queue/queuewords.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/queue.d.ts +2 -0
- package/node_modules/@waterplane/shared/dist/queue.js +1 -0
- package/node_modules/@waterplane/shared/dist/queue.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/repohealth.d.ts +178 -0
- package/node_modules/@waterplane/shared/dist/repohealth.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/repohealthhabits.d.ts +15 -0
- package/node_modules/@waterplane/shared/dist/repohealthhabits.js +117 -0
- package/node_modules/@waterplane/shared/dist/repohealthhabits.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/repohealthnative.d.ts +10 -0
- package/node_modules/@waterplane/shared/dist/repohealthnative.js +94 -0
- package/node_modules/@waterplane/shared/dist/repohealthnative.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/repohealthread.js +23 -1
- package/node_modules/@waterplane/shared/dist/repohealthread.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/skillstate.d.ts +51 -0
- package/node_modules/@waterplane/shared/dist/skillstate.js +176 -0
- package/node_modules/@waterplane/shared/dist/skillstate.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/skillwords.d.ts +10 -0
- package/node_modules/@waterplane/shared/dist/skillwords.js +18 -0
- package/node_modules/@waterplane/shared/dist/skillwords.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/agentreadings.d.ts +248 -0
- package/node_modules/@waterplane/shared/dist/wire/agentreadings.js +36 -0
- package/node_modules/@waterplane/shared/dist/wire/agentreadings.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/backend.d.ts +2 -0
- package/node_modules/@waterplane/shared/dist/wire/costwindow.d.ts +4 -0
- package/node_modules/@waterplane/shared/dist/wire/dictatesetup.d.ts +42 -0
- package/node_modules/@waterplane/shared/dist/wire/dictatesetup.js +9 -0
- package/node_modules/@waterplane/shared/dist/wire/dictatesetup.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/messages/hostcore.d.ts +22 -1
- package/node_modules/@waterplane/shared/dist/wire/notify.d.ts +6 -1
- package/node_modules/@waterplane/shared/dist/wire/notify.js +6 -1
- package/node_modules/@waterplane/shared/dist/wire/notify.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/repo.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/wire/skills.d.ts +142 -0
- package/node_modules/@waterplane/shared/dist/wire/skills.js +6 -0
- package/node_modules/@waterplane/shared/dist/wire/skills.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/sysstat.d.ts +17 -0
- package/node_modules/@waterplane/shared/dist/wire/telemetry.d.ts +4 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/packages/extensions/diskspace/waterplane-plugin.json +16 -0
- package/packages/extensions/links/waterplane-plugin.json +18 -0
- package/packages/host/dist/agentclass.d.ts +116 -0
- package/packages/host/dist/agentclass.js +339 -0
- package/packages/host/dist/agentclass.js.map +1 -0
- package/packages/host/dist/agentintents.d.ts +18 -0
- package/packages/host/dist/agentintents.js +40 -7
- package/packages/host/dist/agentintents.js.map +1 -1
- package/packages/host/dist/agentmarkers.d.ts +49 -0
- package/packages/host/dist/agentmarkers.js +255 -0
- package/packages/host/dist/agentmarkers.js.map +1 -0
- package/packages/host/dist/agentreadings.d.ts +68 -0
- package/packages/host/dist/agentreadings.js +336 -0
- package/packages/host/dist/agentreadings.js.map +1 -0
- package/packages/host/dist/agentscan.d.ts +8 -0
- package/packages/host/dist/agentscan.js +427 -0
- package/packages/host/dist/agentscan.js.map +1 -0
- package/packages/host/dist/archive.js +9 -3
- package/packages/host/dist/archive.js.map +1 -1
- package/packages/host/dist/artifacts.js +4 -7
- package/packages/host/dist/artifacts.js.map +1 -1
- package/packages/host/dist/askrules.js +12 -4
- package/packages/host/dist/askrules.js.map +1 -1
- package/packages/host/dist/auth.d.ts +1 -0
- package/packages/host/dist/auth.js +5 -3
- package/packages/host/dist/auth.js.map +1 -1
- package/packages/host/dist/autopull.js +4 -8
- package/packages/host/dist/autopull.js.map +1 -1
- package/packages/host/dist/backends/claude.js +1 -0
- package/packages/host/dist/backends/claude.js.map +1 -1
- package/packages/host/dist/backends/derive.js +3 -1
- package/packages/host/dist/backends/derive.js.map +1 -1
- package/packages/host/dist/binguard.js +19 -2
- package/packages/host/dist/binguard.js.map +1 -1
- package/packages/host/dist/capture.js +7 -10
- package/packages/host/dist/capture.js.map +1 -1
- package/packages/host/dist/clifixtures.d.ts +24 -4
- package/packages/host/dist/clifixtures.js +50 -10
- package/packages/host/dist/clifixtures.js.map +1 -1
- package/packages/host/dist/clihealth.d.ts +8 -2
- package/packages/host/dist/clihealth.js +11 -3
- package/packages/host/dist/clihealth.js.map +1 -1
- package/packages/host/dist/costwindow.js +4 -2
- package/packages/host/dist/costwindow.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxagents.d.ts +2 -0
- package/packages/host/dist/ctxlog/ctxagents.js +5 -5
- package/packages/host/dist/ctxlog/ctxagents.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxcursor.d.ts +2 -0
- package/packages/host/dist/ctxlog/ctxcursor.js +2 -2
- package/packages/host/dist/ctxlog/ctxcursor.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxupdate.js +11 -6
- package/packages/host/dist/ctxlog/ctxupdate.js.map +1 -1
- package/packages/host/dist/deliver/deliverknobs.d.ts +0 -2
- package/packages/host/dist/deliver/deliverknobs.js +0 -2
- package/packages/host/dist/deliver/deliverknobs.js.map +1 -1
- package/packages/host/dist/deliver/deliverproof.d.ts +3 -2
- package/packages/host/dist/deliver/deliverproof.js +9 -8
- package/packages/host/dist/deliver/deliverproof.js.map +1 -1
- package/packages/host/dist/deliver/deliverreturn.d.ts +3 -2
- package/packages/host/dist/deliver/deliverreturn.js +13 -12
- package/packages/host/dist/deliver/deliverreturn.js.map +1 -1
- package/packages/host/dist/deliver/deliverrun.js +20 -18
- package/packages/host/dist/deliver/deliverrun.js.map +1 -1
- package/packages/host/dist/deliver/deliverscreen.d.ts +2 -1
- package/packages/host/dist/deliver/deliverscreen.js +9 -8
- package/packages/host/dist/deliver/deliverscreen.js.map +1 -1
- package/packages/host/dist/deliver/delivertypes.d.ts +4 -0
- package/packages/host/dist/deliver.js +2 -1
- package/packages/host/dist/deliver.js.map +1 -1
- package/packages/host/dist/dictate.d.ts +11 -0
- package/packages/host/dist/dictate.js +20 -10
- package/packages/host/dist/dictate.js.map +1 -1
- package/packages/host/dist/dictatesetup.d.ts +54 -0
- package/packages/host/dist/dictatesetup.js +261 -0
- package/packages/host/dist/dictatesetup.js.map +1 -0
- package/packages/host/dist/doctor.js +1 -1
- package/packages/host/dist/doctor.js.map +1 -1
- package/packages/host/dist/exposure.d.ts +10 -0
- package/packages/host/dist/exposure.js +25 -0
- package/packages/host/dist/exposure.js.map +1 -1
- package/packages/host/dist/exposurepush.js +2 -2
- package/packages/host/dist/exposurepush.js.map +1 -1
- package/packages/host/dist/extensions/diskspace/host/candidates.d.mts +180 -0
- package/packages/host/dist/extensions/diskspace/host/candidates.mjs +716 -0
- package/packages/host/dist/extensions/diskspace/host/candidates.mjs.map +1 -0
- package/packages/host/dist/extensions/diskspace/host/engine.d.mts +21 -0
- package/packages/host/dist/extensions/diskspace/host/engine.mjs +498 -0
- package/packages/host/dist/extensions/diskspace/host/engine.mjs.map +1 -0
- package/packages/host/dist/extensions/diskspace/host/index.d.mts +25 -0
- package/packages/host/dist/extensions/diskspace/host/index.mjs +135 -0
- package/packages/host/dist/extensions/diskspace/host/index.mjs.map +1 -0
- package/packages/host/dist/extensions/diskspace/host/large.d.mts +11 -0
- package/packages/host/dist/extensions/diskspace/host/large.mjs +56 -0
- package/packages/host/dist/extensions/diskspace/host/large.mjs.map +1 -0
- package/packages/host/dist/extensions/diskspace/host/run.d.mts +94 -0
- package/packages/host/dist/extensions/diskspace/host/run.mjs +200 -0
- package/packages/host/dist/extensions/diskspace/host/run.mjs.map +1 -0
- package/packages/host/dist/extensions/diskspace/shared/wire.d.mts +197 -0
- package/packages/host/dist/extensions/diskspace/shared/wire.mjs +23 -0
- package/packages/host/dist/extensions/diskspace/shared/wire.mjs.map +1 -0
- package/packages/host/dist/extensions/links/host/engine.d.mts +39 -0
- package/packages/host/dist/extensions/links/host/engine.mjs +285 -0
- package/packages/host/dist/extensions/links/host/engine.mjs.map +1 -0
- package/packages/host/dist/extensions/links/host/index.d.mts +10 -0
- package/packages/host/dist/extensions/links/host/index.mjs +72 -0
- package/packages/host/dist/extensions/links/host/index.mjs.map +1 -0
- package/packages/host/dist/extensions/links/host/parse.d.mts +61 -0
- package/packages/host/dist/extensions/links/host/parse.mjs +225 -0
- package/packages/host/dist/extensions/links/host/parse.mjs.map +1 -0
- package/packages/host/dist/extensions/links/host/run.d.mts +15 -0
- package/packages/host/dist/extensions/links/host/run.mjs +32 -0
- package/packages/host/dist/extensions/links/host/run.mjs.map +1 -0
- package/packages/host/dist/extensions/links/host/store.d.mts +11 -0
- package/packages/host/dist/extensions/links/host/store.mjs +76 -0
- package/packages/host/dist/extensions/links/host/store.mjs.map +1 -0
- package/packages/host/dist/extensions/links/shared/wire.d.mts +141 -0
- package/packages/host/dist/extensions/links/shared/wire.mjs +20 -0
- package/packages/host/dist/extensions/links/shared/wire.mjs.map +1 -0
- package/packages/host/dist/git.d.ts +5 -3
- package/packages/host/dist/git.js +16 -28
- package/packages/host/dist/git.js.map +1 -1
- package/packages/host/dist/halt.js +16 -3
- package/packages/host/dist/halt.js.map +1 -1
- package/packages/host/dist/jsonstore.d.ts +16 -4
- package/packages/host/dist/jsonstore.js +32 -8
- package/packages/host/dist/jsonstore.js.map +1 -1
- package/packages/host/dist/landedbase.d.ts +41 -0
- package/packages/host/dist/landedbase.js +59 -0
- package/packages/host/dist/landedbase.js.map +1 -0
- package/packages/host/dist/lantls.js +2 -2
- package/packages/host/dist/lantls.js.map +1 -1
- package/packages/host/dist/limitretry.js +2 -3
- package/packages/host/dist/limitretry.js.map +1 -1
- package/packages/host/dist/localledger.js +9 -12
- package/packages/host/dist/localledger.js.map +1 -1
- package/packages/host/dist/main.js +2 -0
- package/packages/host/dist/main.js.map +1 -1
- package/packages/host/dist/opendeliveries.d.ts +4 -0
- package/packages/host/dist/opendeliveries.js +27 -1
- package/packages/host/dist/opendeliveries.js.map +1 -1
- package/packages/host/dist/plugins/setupcontrib.js +3 -2
- package/packages/host/dist/plugins/setupcontrib.js.map +1 -1
- package/packages/host/dist/pricefetch.d.ts +80 -0
- package/packages/host/dist/pricefetch.js +289 -0
- package/packages/host/dist/pricefetch.js.map +1 -0
- package/packages/host/dist/pricegap.d.ts +11 -0
- package/packages/host/dist/pricegap.js +30 -0
- package/packages/host/dist/pricegap.js.map +1 -0
- package/packages/host/dist/repohealthscopes.js +16 -24
- package/packages/host/dist/repohealthscopes.js.map +1 -1
- package/packages/host/dist/repos.d.ts +4 -0
- package/packages/host/dist/repos.js +1 -1
- package/packages/host/dist/repos.js.map +1 -1
- package/packages/host/dist/reposkilltext.d.ts +2 -0
- package/packages/host/dist/reposkilltext.js +8 -2
- package/packages/host/dist/reposkilltext.js.map +1 -1
- package/packages/host/dist/routes/apiagentpoints.d.ts +5 -0
- package/packages/host/dist/routes/apiagentpoints.js +48 -0
- package/packages/host/dist/routes/apiagentpoints.js.map +1 -0
- package/packages/host/dist/routes/apidictate.d.ts +2 -0
- package/packages/host/dist/routes/apidictate.js +27 -0
- package/packages/host/dist/routes/apidictate.js.map +1 -0
- package/packages/host/dist/routes/apihost.js +3 -2
- package/packages/host/dist/routes/apihost.js.map +1 -1
- package/packages/host/dist/routes/apirepofiles.js +3 -1
- package/packages/host/dist/routes/apirepofiles.js.map +1 -1
- package/packages/host/dist/routes/apirepowork.js +14 -0
- package/packages/host/dist/routes/apirepowork.js.map +1 -1
- package/packages/host/dist/routes/apiroutes.js +4 -1
- package/packages/host/dist/routes/apiroutes.js.map +1 -1
- package/packages/host/dist/routes/apiskills.d.ts +3 -0
- package/packages/host/dist/routes/apiskills.js +81 -0
- package/packages/host/dist/routes/apiskills.js.map +1 -0
- package/packages/host/dist/routes/apistats.js +2 -2
- package/packages/host/dist/routes/apistats.js.map +1 -1
- package/packages/host/dist/routes/apisystem.js +3 -1
- package/packages/host/dist/routes/apisystem.js.map +1 -1
- package/packages/host/dist/routes/apitable.d.ts +2 -0
- package/packages/host/dist/routes/apitable.js.map +1 -1
- package/packages/host/dist/server/billingwire.js +5 -0
- package/packages/host/dist/server/billingwire.js.map +1 -1
- package/packages/host/dist/server/deliveries.d.ts +4 -1
- package/packages/host/dist/server/deliveries.js +38 -6
- package/packages/host/dist/server/deliveries.js.map +1 -1
- package/packages/host/dist/server/http.js +1 -1
- package/packages/host/dist/server/http.js.map +1 -1
- package/packages/host/dist/server/intentDeps.js +20 -6
- package/packages/host/dist/server/intentDeps.js.map +1 -1
- package/packages/host/dist/server/wsops.js +2 -1
- package/packages/host/dist/server/wsops.js.map +1 -1
- package/packages/host/dist/sessions/core.d.ts +1 -0
- package/packages/host/dist/sessions/ctxseries.js +7 -5
- package/packages/host/dist/sessions/ctxseries.js.map +1 -1
- package/packages/host/dist/sessions/drive.d.ts +6 -1
- package/packages/host/dist/sessions/drive.js +13 -10
- package/packages/host/dist/sessions/drive.js.map +1 -1
- package/packages/host/dist/sessions/record.js +16 -17
- package/packages/host/dist/sessions/record.js.map +1 -1
- package/packages/host/dist/sessions/sidechannel.js +1 -1
- package/packages/host/dist/sessions/sidechannel.js.map +1 -1
- package/packages/host/dist/sessions/tmux.js +6 -1
- package/packages/host/dist/sessions/tmux.js.map +1 -1
- package/packages/host/dist/sessions/turn.js +5 -0
- package/packages/host/dist/sessions/turn.js.map +1 -1
- package/packages/host/dist/sessions.d.ts +2 -1
- package/packages/host/dist/sessions.js +1 -1
- package/packages/host/dist/sessions.js.map +1 -1
- package/packages/host/dist/settle.d.ts +3 -2
- package/packages/host/dist/settle.js +13 -13
- package/packages/host/dist/settle.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/skills/skillinventory.d.ts +23 -0
- package/packages/host/dist/skills/skillinventory.js +275 -0
- package/packages/host/dist/skills/skillinventory.js.map +1 -0
- package/packages/host/dist/skills/skilllayers.d.ts +28 -0
- package/packages/host/dist/skills/skilllayers.js +73 -0
- package/packages/host/dist/skills/skilllayers.js.map +1 -0
- package/packages/host/dist/skills/skillrecommend.d.ts +42 -0
- package/packages/host/dist/skills/skillrecommend.js +171 -0
- package/packages/host/dist/skills/skillrecommend.js.map +1 -0
- package/packages/host/dist/skills/skillrefs.d.ts +2 -0
- package/packages/host/dist/skills/skillrefs.js +50 -0
- package/packages/host/dist/skills/skillrefs.js.map +1 -0
- package/packages/host/dist/skills/skilluse.d.ts +57 -0
- package/packages/host/dist/skills/skilluse.js +242 -0
- package/packages/host/dist/skills/skilluse.js.map +1 -0
- package/packages/host/dist/skills/skillweight.d.ts +18 -0
- package/packages/host/dist/skills/skillweight.js +69 -0
- package/packages/host/dist/skills/skillweight.js.map +1 -0
- package/packages/host/dist/skills/skillwrite.d.ts +56 -0
- package/packages/host/dist/skills/skillwrite.js +183 -0
- package/packages/host/dist/skills/skillwrite.js.map +1 -0
- package/packages/host/dist/sysstat.d.ts +34 -1
- package/packages/host/dist/sysstat.js +82 -14
- package/packages/host/dist/sysstat.js.map +1 -1
- package/packages/host/dist/tokenscan.js +5 -2
- package/packages/host/dist/tokenscan.js.map +1 -1
- package/packages/host/dist/tokenstats.js +7 -4
- package/packages/host/dist/tokenstats.js.map +1 -1
- package/packages/host/dist/transcript/transcriptparse.js +2 -2
- package/packages/host/dist/transcript/transcriptparse.js.map +1 -1
- package/packages/host/dist/waitclock.d.ts +12 -0
- package/packages/host/dist/waitclock.js +23 -0
- package/packages/host/dist/waitclock.js.map +1 -0
- package/packages/host/dist/weekburn.js +7 -5
- package/packages/host/dist/weekburn.js.map +1 -1
- package/packages/host/dist/worktreeleftover.js +13 -15
- package/packages/host/dist/worktreeleftover.js.map +1 -1
- package/packages/web/dist/assets/demo-DHkwSmU5.js +26 -0
- package/packages/web/dist/assets/{icons-D8RlmSLR.js → icons-5lVTFNUU.js} +1 -1
- package/packages/web/dist/assets/index-Bh4cH6X8.js +170 -0
- package/packages/web/dist/assets/index-F7VHtsLI.css +1 -0
- package/packages/web/dist/assets/shared-BvQMg9ra.js +51 -0
- package/packages/web/dist/assets/sheets-Cwi72V02.js +257 -0
- package/packages/web/dist/assets/sheets-DjU2XiUd.css +1 -0
- package/packages/web/dist/build-id.txt +1 -1
- package/packages/web/dist/buildstamp.json +1 -1
- package/packages/web/dist/index.html +7 -7
- package/packages/web/dist/sw.js +2 -2
- package/release.json +11 -3
- package/tools/repohealth/constants.mjs +34 -1
- package/tools/repohealth/fixture.json +5374 -38
- package/tools/repohealth/git.mjs +77 -0
- package/tools/repohealth/lang/dart-analyze.mjs +181 -0
- package/tools/repohealth/lang/dart-lex.mjs +494 -0
- package/tools/repohealth/lang/dart-resolve.mjs +95 -0
- package/tools/repohealth/lang/python-ast.mjs +602 -0
- package/tools/repohealth/lang/python-resolve.mjs +228 -0
- package/tools/repohealth/metrics/habits.mjs +286 -0
- package/tools/repohealth/metrics/native.mjs +542 -0
- package/tools/repohealth/metrics/untested.mjs +20 -8
- package/tools/repohealth/metrics/workspace.mjs +256 -0
- package/tools/repohealth/own.mjs +67 -5
- package/tools/repohealth/packs/dart.mjs +153 -85
- package/tools/repohealth/packs/python.mjs +51 -14
- package/tools/repohealth/plot.mjs +143 -1
- package/tools/repohealth/reach.mjs +98 -0
- package/tools/repohealth/scope.mjs +14 -1
- package/tools/repohealth/series.mjs +5 -0
- package/tools/repohealth/types.mjs +4 -0
- package/tools/repohealth.mjs +39 -5
- package/packages/web/dist/assets/demo-ad3g3HDa.js +0 -26
- package/packages/web/dist/assets/index-Csb7jynu.js +0 -170
- package/packages/web/dist/assets/index-Cz9Haocy.css +0 -1
- package/packages/web/dist/assets/shared-DBaaGttP.js +0 -51
- package/packages/web/dist/assets/sheets-CqsP9w1V.js +0 -256
- package/packages/web/dist/assets/sheets-DoUhPGK0.css +0 -1
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent readings: per-repo weekly figures only this desktop can take, because
|
|
3
|
+
* it keeps every claude conversation that ran in the repo
|
|
4
|
+
* (`GET /api/repos/:id/agentreadings`; DTO `shared/wire/agentreadings.ts`).
|
|
5
|
+
* The rules are `agentclass.ts`'s, the disk reading `agentscan.ts`'s.
|
|
6
|
+
*
|
|
7
|
+
* ── Bounded cost ────────────────────────────────────────────────────────────
|
|
8
|
+
*
|
|
9
|
+
* `tokenstats.ts`'s store pattern, cut to ONE repo at a time: the store is
|
|
10
|
+
* per-LOG summaries keyed by project directory and relative path, persisted
|
|
11
|
+
* through `jsonstore.ts` (`writeJsonAtomic`, debounced, flushed on demand;
|
|
12
|
+
* `readJsonGuarded`, a corrupt file moved aside and rebuilt from the logs),
|
|
13
|
+
* and the weekly readings are DERIVED on every answer — no running aggregate
|
|
14
|
+
* to drift. A request walks only the project directories whose slug is the
|
|
15
|
+
* repo's (or one of its worktrees'), `stat`s each log and re-reads only the
|
|
16
|
+
* ones whose size or mtime moved; within `MAX_AGE_MS` of the last sweep it
|
|
17
|
+
* walks nothing at all. So the first open of a repo reads its logs once, and
|
|
18
|
+
* every later open costs a stat sweep of that repo's logs only — never a
|
|
19
|
+
* re-scan of every transcript on the machine.
|
|
20
|
+
*
|
|
21
|
+
* Every reading degrades to ABSENT with its sentence: an unreadable project
|
|
22
|
+
* directory is an error answer, never a week of zeros.
|
|
23
|
+
*/
|
|
24
|
+
import { existsSync, mkdirSync, realpathSync } from "node:fs";
|
|
25
|
+
import { readdir, stat } from "node:fs/promises";
|
|
26
|
+
import { join } from "node:path";
|
|
27
|
+
import { AGENT_POINTS_CAP, AGENT_POINT_WEEKS, AGENT_SUB_POINTS_CAP, AGENT_READING_WEEKS, LOOK_RULE_TEXT, isAgentAbsent, repoSpendByWeek, seriesOf, transcriptDirName, } from "@waterplane/shared";
|
|
28
|
+
import { RULES, countByWeek, foldAgentWeeks, lastWeeks } from "./agentclass.js";
|
|
29
|
+
import { summarizeAgentLog, summarizeConv } from "./agentscan.js";
|
|
30
|
+
import { hostStateDir } from "./branddirs.js";
|
|
31
|
+
import { claudeConfigDir } from "./claudeconfig.js";
|
|
32
|
+
import { repoOfWorktree } from "./costwindow.js";
|
|
33
|
+
import { exposureCrashMarks } from "./exposure.js";
|
|
34
|
+
import { readJsonGuarded, writeJsonAtomic } from "./jsonstore.js";
|
|
35
|
+
import { walkLogs } from "./tokenscan.js";
|
|
36
|
+
/** Bump when a summary's shape or a classification rule changes: the store then rebuilds from the logs. */
|
|
37
|
+
const VERSION = 3;
|
|
38
|
+
const MAX_FILE = 256 * 1024 * 1024;
|
|
39
|
+
const FLUSH_MS = 5_000;
|
|
40
|
+
const YIELD_EVERY = 32;
|
|
41
|
+
/** A repo swept this recently is answered from the store without touching the disk. */
|
|
42
|
+
export const MAX_AGE_MS = 10 * 60_000;
|
|
43
|
+
/** How long an answer waits for a sweep before saying it is still reading. */
|
|
44
|
+
export const SWEEP_WAIT_MS = 8_000;
|
|
45
|
+
const isAgent = (e) => e.sub === 1;
|
|
46
|
+
/** Whether a project directory slug can hold this repo's logs: the repo's own, or a worktree's under it. */
|
|
47
|
+
export function slugBelongs(slug, repoSlug) {
|
|
48
|
+
return slug === repoSlug || slug.startsWith(`${repoSlug}-`);
|
|
49
|
+
}
|
|
50
|
+
export class AgentReadingsStore {
|
|
51
|
+
birthOf;
|
|
52
|
+
path;
|
|
53
|
+
store = {};
|
|
54
|
+
timer = null;
|
|
55
|
+
dirty = false;
|
|
56
|
+
swept = new Map();
|
|
57
|
+
inFlight = new Map();
|
|
58
|
+
/** `birthOf` is the file's creation time for the fork test; a test with dated fixtures passes `() => undefined`. */
|
|
59
|
+
constructor(stateDir, birthOf = (st) => (st.birthtimeMs > 0 ? Math.round(st.birthtimeMs) : undefined)) {
|
|
60
|
+
this.birthOf = birthOf;
|
|
61
|
+
mkdirSync(stateDir, { recursive: true });
|
|
62
|
+
this.path = join(stateDir, "agentreadings.json");
|
|
63
|
+
try {
|
|
64
|
+
if (existsSync(this.path)) {
|
|
65
|
+
const raw = readJsonGuarded(this.path, null);
|
|
66
|
+
if (raw?.v === VERSION && raw.store && typeof raw.store === "object")
|
|
67
|
+
this.store = raw.store;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch { /* rebuilt from the logs, which are the source anyway */ }
|
|
71
|
+
}
|
|
72
|
+
/** Bring this repo's summaries up to date (unless swept within `maxAgeMs`). Throws only on an unreadable projects directory. */
|
|
73
|
+
async sweep(repos, maxAgeMs = MAX_AGE_MS) {
|
|
74
|
+
const key = repos.join("\0");
|
|
75
|
+
const last = this.swept.get(key);
|
|
76
|
+
if (last && Date.now() - last.at < maxAgeMs)
|
|
77
|
+
return last;
|
|
78
|
+
let p = this.inFlight.get(key);
|
|
79
|
+
if (!p) {
|
|
80
|
+
p = this.refresh(key, repos).finally(() => this.inFlight.delete(key));
|
|
81
|
+
this.inFlight.set(key, p);
|
|
82
|
+
}
|
|
83
|
+
await p;
|
|
84
|
+
return this.swept.get(key);
|
|
85
|
+
}
|
|
86
|
+
async refresh(key, repos) {
|
|
87
|
+
const root = join(claudeConfigDir(), "projects");
|
|
88
|
+
let slugs;
|
|
89
|
+
try {
|
|
90
|
+
slugs = (await readdir(root, { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
if (e?.code === "ENOENT")
|
|
94
|
+
slugs = [];
|
|
95
|
+
else
|
|
96
|
+
throw new Error(`The claude projects directory could not be read: ${e.message}`);
|
|
97
|
+
}
|
|
98
|
+
const repoSlugs = repos.map(transcriptDirName);
|
|
99
|
+
const mine = slugs.filter((s) => repoSlugs.some((r) => slugBelongs(s, r)));
|
|
100
|
+
let logs = 0;
|
|
101
|
+
let reread = 0;
|
|
102
|
+
for (const slug of mine) {
|
|
103
|
+
const prev = this.store[slug] ?? {};
|
|
104
|
+
const next = {};
|
|
105
|
+
const rels = await walkLogs(join(root, slug));
|
|
106
|
+
const stats = await Promise.all(rels.map((rel) => stat(join(root, slug, rel)).catch(() => null)));
|
|
107
|
+
for (let i = 0; i < rels.length; i++) {
|
|
108
|
+
const rel = rels[i];
|
|
109
|
+
const st = stats[i];
|
|
110
|
+
if (!st || st.size === 0 || st.size > MAX_FILE)
|
|
111
|
+
continue;
|
|
112
|
+
const parts = rel.split("/");
|
|
113
|
+
const top = parts.length === 1;
|
|
114
|
+
// Only conversations and their agents: `<id>.jsonl` and `<id>/subagents/…/agent-*.jsonl`.
|
|
115
|
+
if (!top && !(parts[1] === "subagents" && parts[parts.length - 1].startsWith("agent-")))
|
|
116
|
+
continue;
|
|
117
|
+
logs++;
|
|
118
|
+
const k = rel.replace(/\.jsonl$/, "");
|
|
119
|
+
const was = prev[k];
|
|
120
|
+
const mtime = Math.round(st.mtimeMs);
|
|
121
|
+
if (was && was.s === st.size && was.m === mtime) {
|
|
122
|
+
next[k] = was;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
const path = join(root, slug, rel);
|
|
126
|
+
const sum = top
|
|
127
|
+
? await summarizeConv(path, k, st.size, mtime, undefined, this.birthOf(st))
|
|
128
|
+
: await summarizeAgentLog(path, rel, st.size, mtime).then((s) => (s ? { ...s, sub: 1 } : null));
|
|
129
|
+
reread++;
|
|
130
|
+
if (reread % YIELD_EVERY === 0)
|
|
131
|
+
await new Promise((r) => setImmediate(r));
|
|
132
|
+
if (sum)
|
|
133
|
+
next[k] = sum;
|
|
134
|
+
}
|
|
135
|
+
this.store[slug] = next;
|
|
136
|
+
}
|
|
137
|
+
// A slug of this repo that is gone from disk is gone from the fold.
|
|
138
|
+
for (const slug of Object.keys(this.store)) {
|
|
139
|
+
if (repoSlugs.some((r) => slugBelongs(slug, r)) && !mine.includes(slug))
|
|
140
|
+
delete this.store[slug];
|
|
141
|
+
}
|
|
142
|
+
this.swept.set(key, { at: Date.now(), logs, reread });
|
|
143
|
+
this.dirty = true;
|
|
144
|
+
this.schedule();
|
|
145
|
+
}
|
|
146
|
+
/** This repo's conversations with their agents. `repos` are the repo's path spellings (as given, realpath). */
|
|
147
|
+
conversations(repos) {
|
|
148
|
+
return this.resolve(repos).map((r) => ({ conv: r.conv, agents: r.subs.map((x) => x.e) }));
|
|
149
|
+
}
|
|
150
|
+
resolve(repos) {
|
|
151
|
+
const want = new Set(repos);
|
|
152
|
+
const repoSlugs = repos.map(transcriptDirName);
|
|
153
|
+
const out = [];
|
|
154
|
+
for (const [slug, files] of Object.entries(this.store)) {
|
|
155
|
+
if (!repoSlugs.some((r) => slugBelongs(slug, r)))
|
|
156
|
+
continue;
|
|
157
|
+
const agents = new Map();
|
|
158
|
+
for (const [k, e] of Object.entries(files)) {
|
|
159
|
+
if (!isAgent(e))
|
|
160
|
+
continue;
|
|
161
|
+
const conv = k.split("/")[0];
|
|
162
|
+
(agents.get(conv) ?? agents.set(conv, []).get(conv)).push({ id: k, e });
|
|
163
|
+
}
|
|
164
|
+
for (const [k, e] of Object.entries(files)) {
|
|
165
|
+
if (isAgent(e))
|
|
166
|
+
continue;
|
|
167
|
+
// The record's own cwd decides, so `app-other` never lands in `app`
|
|
168
|
+
// through the slug prefix; a log with no cwd counts only in the repo's own slug.
|
|
169
|
+
const repo = e.w ? repoOfWorktree(e.w) : undefined;
|
|
170
|
+
const belongs = repo !== undefined ? want.has(repo) : repoSlugs.includes(slug);
|
|
171
|
+
if (belongs)
|
|
172
|
+
out.push({ id: k, repo: repo ?? repos[0], conv: e, subs: agents.get(k) ?? [] });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return out;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Session points for these repos: one per conversation and one per subagent log that began inside
|
|
179
|
+
* the last `AGENT_POINT_WEEKS` weeks, newest first, each kind cut to its own cap (the capped list holds fresh conversations only) (the oldest go; `cut`
|
|
180
|
+
* says how many). A log with no dated record has no start time and is left out, not placed.
|
|
181
|
+
* `capped: false` keeps every point (the weekly region folds them on the host, so a busy repo's
|
|
182
|
+
* older weeks are medians over ALL their sessions; only the wire to the phone needs the caps).
|
|
183
|
+
*/
|
|
184
|
+
points(repos, now, capped = true) {
|
|
185
|
+
const since = Date.parse(`${lastWeeks(now, AGENT_POINT_WEEKS)[0]}T00:00:00Z`);
|
|
186
|
+
const all = [];
|
|
187
|
+
for (const { id, repo, conv, subs } of this.resolve(repos)) {
|
|
188
|
+
if (conv.t0 !== undefined && conv.t0 >= since)
|
|
189
|
+
all.push(pointOf(id, repo, conv.t0, conv.sr, { fresh: !conv.nf, headless: conv.nf === "headless", commit: !!conv.cm }));
|
|
190
|
+
for (const { id: sid, e } of subs) {
|
|
191
|
+
if (e.t0 !== undefined && e.t0 >= since)
|
|
192
|
+
all.push(pointOf(sid, repo, e.t0, e.sr, { fresh: true, headless: false, sub: true }));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
all.sort((a, b) => b.t0 - a.t0);
|
|
196
|
+
if (!capped)
|
|
197
|
+
return { points: all, cut: 0 };
|
|
198
|
+
// A headless, forked or continued conversation is no reading's session (`seriesReadingOf`, `derivedMarkers`
|
|
199
|
+
// want `fresh`): it stays off the wire, so it neither spends the conversation cap nor moves `coverFrom`
|
|
200
|
+
// (the axis start) for readings that never read it. `cut` counts only points a reading could have used.
|
|
201
|
+
const convs = all.filter((p) => !p.sub && p.fresh), subs = all.filter((p) => p.sub);
|
|
202
|
+
const keep = [...convs.slice(0, AGENT_POINTS_CAP), ...subs.slice(0, AGENT_SUB_POINTS_CAP)].sort((a, b) => b.t0 - a.t0);
|
|
203
|
+
return { points: keep, cut: convs.length + subs.length - keep.length };
|
|
204
|
+
}
|
|
205
|
+
schedule() {
|
|
206
|
+
if (this.timer || !this.dirty)
|
|
207
|
+
return;
|
|
208
|
+
this.timer = setTimeout(() => { this.timer = null; this.flush(); }, FLUSH_MS);
|
|
209
|
+
this.timer.unref?.();
|
|
210
|
+
}
|
|
211
|
+
flush() {
|
|
212
|
+
if (this.timer) {
|
|
213
|
+
clearTimeout(this.timer);
|
|
214
|
+
this.timer = null;
|
|
215
|
+
}
|
|
216
|
+
if (!this.dirty)
|
|
217
|
+
return;
|
|
218
|
+
try {
|
|
219
|
+
writeJsonAtomic(this.path, { v: VERSION, store: this.store });
|
|
220
|
+
this.dirty = false;
|
|
221
|
+
}
|
|
222
|
+
catch { /* a readings cache is not worth taking the daemon down for */ }
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function pointOf(id, repo, t0, sr, f) {
|
|
226
|
+
return {
|
|
227
|
+
id, t0, repo, fresh: f.fresh, headless: f.headless,
|
|
228
|
+
...(f.sub ? { sub: true } : {}),
|
|
229
|
+
...(sr?.md ? { model: sr.md } : {}), ...(sr?.cli ? { cli: sr.cli } : {}),
|
|
230
|
+
...(sr?.st !== undefined ? { start: sr.st } : {}),
|
|
231
|
+
...(sr?.pt ? { parts: sr.pt } : {}),
|
|
232
|
+
...(sr?.lk !== undefined ? { look: sr.lk } : {}),
|
|
233
|
+
req: sr?.rq ?? 0,
|
|
234
|
+
...(f.commit !== undefined ? { commit: f.commit } : {}),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/** The backlog's bug items for this repo, by the week they were added — or why there is no count. */
|
|
238
|
+
export function bugsByWeek(items, repos) {
|
|
239
|
+
if (!items)
|
|
240
|
+
return { absent: "The backlog could not be read." };
|
|
241
|
+
const want = new Set(repos);
|
|
242
|
+
const mine = items.filter((i) => want.has(repoOfWorktree(i.repoDir)));
|
|
243
|
+
if (!mine.length)
|
|
244
|
+
return { absent: "This repo has nothing on the backlog." };
|
|
245
|
+
if (!mine.some((i) => i.category))
|
|
246
|
+
return { absent: "No backlog item in this repo has a category yet, so bugs cannot be told apart." };
|
|
247
|
+
return countByWeek(mine.filter((i) => i.category === "bug").map((i) => i.createdAt));
|
|
248
|
+
}
|
|
249
|
+
/** The repo's path spellings: as given, and its realpath (the CLI records the realpath). */
|
|
250
|
+
export function repoSpellings(worktree) {
|
|
251
|
+
const repo = repoOfWorktree(worktree);
|
|
252
|
+
let real = repo;
|
|
253
|
+
try {
|
|
254
|
+
real = realpathSync(repo);
|
|
255
|
+
}
|
|
256
|
+
catch { /* as given */ }
|
|
257
|
+
return [...new Set([repo, real])];
|
|
258
|
+
}
|
|
259
|
+
let shared = null;
|
|
260
|
+
/** The one store for this host (created on first use, in the host's state dir). */
|
|
261
|
+
export function agentReadingsStore(root) {
|
|
262
|
+
return (shared ??= new AgentReadingsStore(hostStateDir(root)));
|
|
263
|
+
}
|
|
264
|
+
/** The token ledger's day rows for the spend reading — a warm read, as the health line's;
|
|
265
|
+
* a ledger that fails is a sentence on that reading, never the answer's error. */
|
|
266
|
+
export async function agentLedger(read) {
|
|
267
|
+
try {
|
|
268
|
+
return { days: (await read()).days };
|
|
269
|
+
}
|
|
270
|
+
catch (e) {
|
|
271
|
+
return { absent: `The token ledger could not be read: ${e instanceof Error ? e.message : String(e)}` };
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/** The route's whole answer. */
|
|
275
|
+
export async function agentReadingsFor(store, worktree, backlog, now = Date.now(), waitMs = SWEEP_WAIT_MS,
|
|
276
|
+
/** The token ledger's day rows, or why they could not be read; omitted = no spend reading at all. */
|
|
277
|
+
ledger) {
|
|
278
|
+
const repos = repoSpellings(worktree);
|
|
279
|
+
let swept;
|
|
280
|
+
try {
|
|
281
|
+
// A repo's FIRST sweep reads every one of its logs (measured: 33 s for
|
|
282
|
+
// 16,000 logs on the owner's desktop). The answer does not wait past
|
|
283
|
+
// `waitMs`; the sweep carries on and the next ask is answered from the store.
|
|
284
|
+
const sweep = store.sweep(repos);
|
|
285
|
+
sweep.catch(() => { });
|
|
286
|
+
let timer;
|
|
287
|
+
const late = new Promise((r) => { timer = setTimeout(() => r(null), waitMs); });
|
|
288
|
+
swept = await Promise.race([sweep, late]).finally(() => clearTimeout(timer));
|
|
289
|
+
}
|
|
290
|
+
catch (e) {
|
|
291
|
+
return { ok: false, error: e instanceof Error ? e.message : String(e) };
|
|
292
|
+
}
|
|
293
|
+
if (!swept) {
|
|
294
|
+
return { ok: false, pending: true, error: "This desktop is reading this repo's conversation logs for the first time. It carries on in the background; read again in a minute." };
|
|
295
|
+
}
|
|
296
|
+
const crash = exposureCrashMarks(worktree);
|
|
297
|
+
const escaped = {
|
|
298
|
+
crash: "why" in crash ? { absent: crash.why } : countByWeek(crash.at),
|
|
299
|
+
bugs: bugsByWeek(backlog, repos),
|
|
300
|
+
...(ledger ? { spend: isAgentAbsent(ledger) ? ledger : repoSpendByWeek(ledger.days, repos) } : {}),
|
|
301
|
+
};
|
|
302
|
+
const doc = {
|
|
303
|
+
ok: true,
|
|
304
|
+
repo: repos[0],
|
|
305
|
+
// Start, looks and requests are the agent series' weekly buckets (the token-stats card's
|
|
306
|
+
// function), over EVERY point, not the capped list the points route sends the phone: a cap
|
|
307
|
+
// would leave an old week with a median over its newest sessions, or none at all.
|
|
308
|
+
weeks: foldAgentWeeks(store.conversations(repos), lastWeeks(now, AGENT_READING_WEEKS), escaped, seriesOf(store.points(repos, now, false).points, { grain: "week" })),
|
|
309
|
+
rules: RULES,
|
|
310
|
+
scannedAt: swept.at, logs: swept.logs, reread: swept.reread,
|
|
311
|
+
};
|
|
312
|
+
return doc;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* The points route's whole answer, for one repo (`worktrees` = its one worktree) or every repo the
|
|
316
|
+
* host knows (`worktrees` = each repo's primary path). Same sweep-with-a-wait as the readings.
|
|
317
|
+
*/
|
|
318
|
+
export async function agentPointsFor(store, worktrees, now = Date.now(), waitMs = SWEEP_WAIT_MS) {
|
|
319
|
+
const repos = [...new Set(worktrees.flatMap(repoSpellings))];
|
|
320
|
+
let swept;
|
|
321
|
+
try {
|
|
322
|
+
const sweep = store.sweep(repos);
|
|
323
|
+
sweep.catch(() => { });
|
|
324
|
+
let timer;
|
|
325
|
+
const late = new Promise((r) => { timer = setTimeout(() => r(null), waitMs); });
|
|
326
|
+
swept = await Promise.race([sweep, late]).finally(() => clearTimeout(timer));
|
|
327
|
+
}
|
|
328
|
+
catch (e) {
|
|
329
|
+
return { ok: false, error: e instanceof Error ? e.message : String(e) };
|
|
330
|
+
}
|
|
331
|
+
if (!swept)
|
|
332
|
+
return { ok: false, pending: true, error: "This desktop is reading its conversation logs for the first time. It carries on in the background; read again in a minute." };
|
|
333
|
+
const { points, cut } = store.points(repos, now);
|
|
334
|
+
return { ok: true, points, cut, repos, rules: { look: LOOK_RULE_TEXT }, scannedAt: swept.at, logs: swept.logs, reread: swept.reread };
|
|
335
|
+
}
|
|
336
|
+
//# sourceMappingURL=agentreadings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentreadings.js","sourceRoot":"","sources":["../src/agentreadings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM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AE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;AACxI,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AgentLogSummary, type ConvSummary } from "./agentclass.js";
|
|
2
|
+
/**
|
|
3
|
+
* Summarise one top-level conversation log. `id` is the file's own session id
|
|
4
|
+
* (its basename). Null when it holds nothing countable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function summarizeConv(path: string, id: string, size: number, mtime: number, chunkBytes?: number, birth?: number): Promise<ConvSummary | null>;
|
|
7
|
+
/** Summarise one subagent log: its tokens by week, its workflow run directory and its start readings. */
|
|
8
|
+
export declare function summarizeAgentLog(path: string, rel: string, size: number, mtime: number, chunkBytes?: number): Promise<AgentLogSummary | null>;
|