@wenathlan/devthink 2.0.12 → 2.0.14
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 +20 -0
- package/accounts.ts +2087 -0
- package/agent.ts +2331 -0
- package/antigravity.ts +2139 -0
- package/apifreeze.ts +4146 -0
- package/auth.ts +642 -0
- package/background.ts +16837 -0
- package/bridge.ts +2080 -0
- package/build.ts +54 -0
- package/bun.ts +26 -0
- package/capture.ts +1614 -0
- package/checksecrets.ts +72 -0
- package/cjs.ts +9 -0
- package/cli.ts +3500 -0
- package/commands.ts +1101 -0
- package/companion.ts +450 -0
- package/compatibility.ts +37 -0
- package/config.ts +3137 -0
- package/constants.ts +943 -0
- package/core.ts +1473 -0
- package/crossbrowser.ts +1359 -0
- package/dashdone.ts +605 -0
- package/data.ts +943 -0
- package/database.ts +133 -0
- package/debug.ts +850 -0
- package/deno.ts +27 -0
- package/devthink.ts +707 -0
- package/dist/accounts.d.ts +409 -0
- package/dist/agent.d.ts +837 -0
- package/dist/antigravity.d.ts +380 -0
- package/dist/apifreeze.d.ts +113 -0
- package/dist/auth.d.ts +224 -0
- package/{bridge.d.ts → dist/bridge.d.ts} +1 -1
- package/dist/capture.d.ts +595 -0
- package/dist/cjs.d.ts +6 -0
- package/{cli.js → dist/cli.js} +2 -2
- package/dist/commands.d.ts +310 -0
- package/dist/compatibility.d.ts +17 -0
- package/dist/config.d.ts +1853 -0
- package/dist/constants.d.ts +637 -0
- package/dist/core.d.ts +361 -0
- package/dist/data.d.ts +330 -0
- package/dist/database.d.ts +24 -0
- package/dist/debug.d.ts +270 -0
- package/dist/engine.d.ts +74 -0
- package/dist/environments.d.ts +244 -0
- package/dist/evidence.d.ts +277 -0
- package/dist/export.d.ts +311 -0
- package/dist/fingerprint.d.ts +594 -0
- package/dist/flow.d.ts +300 -0
- package/dist/gates.d.ts +103 -0
- package/dist/identity.d.ts +51 -0
- package/dist/ids.d.ts +7 -0
- package/dist/llm.d.ts +652 -0
- package/dist/models.d.ts +1807 -0
- package/dist/net.d.ts +325 -0
- package/dist/neutral.d.ts +41 -0
- package/dist/oauth.d.ts +703 -0
- package/dist/page.d.ts +1166 -0
- package/dist/perf.d.ts +481 -0
- package/dist/plan.d.ts +134 -0
- package/dist/project.d.ts +395 -0
- package/dist/providers.d.ts +37 -0
- package/dist/quota.d.ts +453 -0
- package/dist/recovery.d.ts +621 -0
- package/dist/request.d.ts +1492 -0
- package/dist/run.d.ts +779 -0
- package/dist/runtime.d.ts +212 -0
- package/dist/search.d.ts +375 -0
- package/dist/security.d.ts +534 -0
- package/dist/serve.d.ts +136 -0
- package/dist/session.d.ts +296 -0
- package/dist/storage.d.ts +53 -0
- package/dist/streaming.d.ts +1119 -0
- package/dist/swarm.d.ts +328 -0
- package/dist/tools.d.ts +170 -0
- package/dist/types.d.ts +8357 -0
- package/dist/utils.d.ts +82 -0
- package/dist/version.d.ts +7 -0
- package/dist/versionregistry.d.ts +406 -0
- package/dist/views.d.ts +579 -0
- package/dist/workbenchsession.d.ts +69 -0
- package/dist/workflow.d.ts +649 -0
- package/docs/readme.md +92 -0
- package/docs/schemas/antigravity.json +192 -0
- package/engine.ts +1524 -0
- package/environments.ts +1005 -0
- package/evidence.ts +643 -0
- package/export.ts +889 -0
- package/fingerprint.ts +1458 -0
- package/flow.ts +1190 -0
- package/gates.ts +307 -0
- package/gateway.ts +34 -0
- package/hardening.ts +191 -0
- package/headless.ts +369 -0
- package/http.ts +2110 -0
- package/identity.ts +246 -0
- package/ids.ts +26 -0
- package/index.ts +369 -0
- package/llm.ts +2682 -0
- package/mcp.ts +1835 -0
- package/{memory.js → memory.ts} +3834 -2310
- package/models.ts +3805 -0
- package/modes.ts +43 -0
- package/net.ts +1214 -0
- package/neutral.ts +362 -0
- package/node.ts +26 -0
- package/oauth.ts +2216 -0
- package/offscreen.ts +170 -0
- package/pack.ts +956 -0
- package/package.json +175 -82
- package/page.ts +7824 -0
- package/pagebridge.ts +1116 -0
- package/perf.ts +957 -0
- package/plan.ts +672 -0
- package/plugin.ts +76 -0
- package/{policy.js → policy.ts} +5073 -4679
- package/prisma.config.ts +27 -0
- package/progress.ts +1308 -0
- package/project.ts +1291 -0
- package/protocol.ts +4187 -0
- package/providers.ts +246 -0
- package/quota.ts +1887 -0
- package/recovery.ts +2433 -0
- package/request.ts +4482 -0
- package/run.ts +2135 -0
- package/runtime.ts +526 -0
- package/search.ts +1760 -0
- package/security.ts +1673 -0
- package/serve.ts +419 -0
- package/server.ts +5538 -0
- package/session.ts +1162 -0
- package/storage.ts +182 -0
- package/streaming.ts +4101 -0
- package/swarm.ts +884 -0
- package/sync.ts +56 -0
- package/tests/agentcert.test.ts +128 -0
- package/tests/agentfleet.test.ts +214 -0
- package/tests/agentreview.test.ts +241 -0
- package/tests/agentstream.test.ts +335 -0
- package/tests/agentwork.test.ts +356 -0
- package/tests/apifreeze.test.ts +290 -0
- package/tests/apimap.test.ts +112 -0
- package/tests/approvalgate.test.ts +175 -0
- package/tests/artifactmanifest.test.ts +204 -0
- package/tests/attentionfeed.test.ts +163 -0
- package/tests/backgroundruns.test.ts +100 -0
- package/tests/batchscheduling.test.ts +131 -0
- package/tests/blackboard.test.ts +238 -0
- package/tests/bridge.test.ts +1088 -0
- package/tests/browsercoverage.test.ts +134 -0
- package/tests/browserpolyfills.test.ts +124 -0
- package/tests/build.mjs +1260 -0
- package/tests/clientauth.test.ts +223 -0
- package/tests/clitools.test.ts +578 -0
- package/tests/confirmgates.test.ts +190 -0
- package/tests/containerpack.test.ts +143 -0
- package/tests/controlflow.test.ts +2120 -0
- package/tests/coordination.test.ts +345 -0
- package/tests/copyscreen.test.ts +139 -0
- package/tests/core.test.ts +417 -0
- package/tests/costcert.test.ts +95 -0
- package/tests/crossbrowser.test.ts +115 -0
- package/tests/cspaudit.test.ts +79 -0
- package/tests/dashdone.test.ts +615 -0
- package/tests/datagrid.test.ts +137 -0
- package/tests/doccheck.test.ts +107 -0
- package/tests/dombatch.test.ts +109 -0
- package/tests/emulation.test.ts +282 -0
- package/tests/environments.test.ts +259 -0
- package/tests/evidenceviews.test.ts +88 -0
- package/tests/exporttools.test.ts +185 -0
- package/tests/firefoxprep.test.ts +134 -0
- package/tests/flowlibrary.test.ts +242 -0
- package/tests/flowrun.test.ts +303 -0
- package/tests/forensics.test.ts +439 -0
- package/tests/gateway.test.ts +939 -0
- package/tests/headlesslib.test.ts +171 -0
- package/tests/httpstream.test.ts +277 -0
- package/tests/immutablelog.test.ts +157 -0
- package/tests/inboundguard.test.ts +177 -0
- package/tests/lazyload.test.ts +72 -0
- package/tests/librarymodes.test.ts +623 -0
- package/tests/llm.test.ts +696 -0
- package/tests/manifest.test.ts +226 -0
- package/tests/maskinputs.test.ts +150 -0
- package/tests/matrixverify.test.ts +111 -0
- package/tests/mavenpack.test.ts +75 -0
- package/tests/mcpserver.test.ts +704 -0
- package/tests/memory.test.ts +4155 -0
- package/tests/memorycare.test.ts +230 -0
- package/tests/migrateplan.test.ts +349 -0
- package/tests/minimization.test.ts +414 -0
- package/tests/modelroute.test.ts +112 -0
- package/tests/multiagent.test.ts +440 -0
- package/tests/nativebridge.test.ts +807 -0
- package/tests/navigation.test.ts +284 -0
- package/tests/nugetpack.test.ts +83 -0
- package/tests/orchestration.test.ts +449 -0
- package/tests/originpolicy.test.ts +405 -0
- package/tests/outputcompare.test.ts +97 -0
- package/tests/package.test.ts +91 -0
- package/tests/pagebridge.test.ts +5909 -0
- package/tests/pentest.test.ts +75 -0
- package/tests/perfrecords.test.ts +257 -0
- package/tests/permdiff.test.ts +85 -0
- package/tests/phishguard.test.ts +128 -0
- package/tests/pickerviews.test.ts +155 -0
- package/tests/pipelines.test.ts +381 -0
- package/tests/planlint.test.ts +240 -0
- package/tests/planreview.test.ts +383 -0
- package/tests/platformtargets.test.ts +56 -0
- package/tests/policy.test.ts +8284 -0
- package/tests/portability.test.ts +96 -0
- package/tests/progress.test.ts +1036 -0
- package/tests/promptlibrary.test.ts +116 -0
- package/tests/protocol.test.ts +4793 -0
- package/tests/publishingpipeline.test.ts +314 -0
- package/tests/quickactions.test.ts +164 -0
- package/tests/readiness.test.ts +78 -0
- package/tests/recipes.test.ts +163 -0
- package/tests/redactshots.test.ts +216 -0
- package/tests/registernvidiakeys.ts +51 -0
- package/tests/relayserve.test.ts +304 -0
- package/tests/releasenotes.test.ts +276 -0
- package/tests/resilience.test.ts +467 -0
- package/tests/resourceaware.test.ts +187 -0
- package/tests/runbudget.test.ts +125 -0
- package/tests/runhistory.test.ts +299 -0
- package/tests/runreplay.test.ts +113 -0
- package/tests/runresume.test.ts +184 -0
- package/tests/runstate.test.ts +288 -0
- package/tests/runtimeadapters.test.ts +251 -0
- package/tests/safariskeleton.test.ts +115 -0
- package/tests/sandboxframe.test.ts +196 -0
- package/tests/sbom.test.ts +105 -0
- package/tests/secretvault.test.ts +188 -0
- package/tests/selcache.test.ts +111 -0
- package/tests/sessioninterface.test.ts +791 -0
- package/tests/sessions.test.ts +591 -0
- package/tests/siteprefs.test.ts +228 -0
- package/tests/snapshotdelta.test.ts +165 -0
- package/tests/statusviews.test.ts +237 -0
- package/tests/stepmeter.test.ts +200 -0
- package/tests/streamparse.test.ts +163 -0
- package/tests/stylepruning.test.ts +90 -0
- package/tests/surfaces.test.ts +282 -0
- package/tests/sweep.test.ts +78 -0
- package/tests/syncbridge.test.ts +164 -0
- package/tests/taskqueue.test.ts +206 -0
- package/tests/toolcalls.test.ts +336 -0
- package/tests/toolcatalog.test.ts +201 -0
- package/tests/torture-agent.test.ts +706 -0
- package/tests/torture-auth.test.ts +461 -0
- package/tests/torture-commands.test.ts +895 -0
- package/tests/torture-data.test.ts +923 -0
- package/tests/torture-environments.test.ts +285 -0
- package/tests/torture-export.test.ts +263 -0
- package/tests/torture-http.test.ts +1379 -0
- package/tests/torture-llm.test.ts +808 -0
- package/tests/torture-memory.test.ts +1084 -0
- package/tests/torture-plan.test.ts +829 -0
- package/tests/torture-run.test.ts +626 -0
- package/tests/torture-session.test.ts +928 -0
- package/tests/torture-swarm.test.ts +1245 -0
- package/tests/torture-tools.test.ts +964 -0
- package/tests/torture-workflow.test.ts +2354 -0
- package/tests/tourviews.test.ts +52 -0
- package/tests/transparency.test.ts +147 -0
- package/tests/trigger.test.ts +941 -0
- package/tests/v1sunset.test.ts +428 -0
- package/tests/virtlist.test.ts +94 -0
- package/tests/vision.test.ts +540 -0
- package/tests/vsixpack.test.ts +145 -0
- package/tests/webapi.test.ts +523 -0
- package/tests/workflow.test.ts +1785 -0
- package/tests/workfloweditor.test.ts +759 -0
- package/tests/xpipack.test.ts +128 -0
- package/tools.ts +734 -0
- package/types.ts +9908 -0
- package/umd.ts +9 -0
- package/utils.ts +249 -0
- package/version.ts +8 -0
- package/versionregistry.ts +1310 -0
- package/views.ts +2153 -0
- package/vitest.config.ts +12 -0
- package/web/App.tsx +78 -0
- package/web/README.md +47 -0
- package/web/capacitor.config.ts +46 -0
- package/web/const.ts +19 -0
- package/web/control.shell.tsx +66 -0
- package/web/dashboardpage.ts +554 -0
- package/web/db.ts +493 -0
- package/web/design.html +541 -0
- package/web/gatewayview/Gateway.tsx +345 -0
- package/web/gatewayview/config.ts +1042 -0
- package/web/gatewayview/definition.ts +174 -0
- package/web/icons.ts +15 -0
- package/{manifest.json → web/manifest.json} +1 -1
- package/web/optionspage.ts +691 -0
- package/web/popup.ts +1651 -0
- package/web/schema.prisma +176 -0
- package/web/sidepanel.ts +7941 -0
- package/web/sitemanifest.json +13 -0
- package/web/terminal-ui.tsx +622 -0
- package/web/transparencypage.ts +541 -0
- package/web/vite.config.ts +39 -0
- package/web/workspace.ts +23 -0
- package/workbenchmemory.ts +104 -0
- package/workbenchsession.ts +304 -0
- package/workflow.ts +4495 -0
- package/bridge.d.ts.map +0 -1
- package/bridge.js +0 -1877
- package/bun.d.ts.map +0 -1
- package/bun.js +0 -52329
- package/caps/background.json +0 -712
- package/caps/cli.json +0 -360
- package/caps/library.json +0 -3611
- package/caps/mcp.json +0 -126
- package/caps/pagebridge.json +0 -377
- package/caps/popup.json +0 -51
- package/caps/sidepanel.json +0 -522
- package/checksums.txt +0 -142
- package/cli.d.ts.map +0 -1
- package/companion.d.ts.map +0 -1
- package/companion.js +0 -389
- package/crossbrowser.d.ts.map +0 -1
- package/crossbrowser.js +0 -1191
- package/dashdone.d.ts.map +0 -1
- package/dashdone.js +0 -368
- package/deno.d.ts.map +0 -1
- package/deno.js +0 -52325
- package/devthink.umd.js +0 -52346
- package/fixtures/bun.ts +0 -7
- package/fixtures/cjs.js +0 -6
- package/fixtures/deno.ts +0 -6
- package/fixtures/example-org-pagestate.json +0 -22
- package/fixtures/importers/automa-workflow.json +0 -18
- package/fixtures/importers/selenium-side.json +0 -20
- package/fixtures/importers/tabular-plan.csv +0 -7
- package/fixtures/importers/uivision-macro.json +0 -10
- package/fixtures/importers/v1-plan.json +0 -13
- package/fixtures/mcp-client.mjs +0 -14
- package/fixtures/pages/checkout.html +0 -192
- package/fixtures/pages/dashboard.html +0 -110
- package/fixtures/pages/feed.html +0 -113
- package/fixtures/pages/product-grid.html +0 -150
- package/fixtures/plans/form-inventory-plan.json +0 -11
- package/fixtures/plans/release-notes-plan.json +0 -11
- package/fixtures/recipes/agentscompete.json +0 -11
- package/fixtures/recipes/agentsforms.json +0 -11
- package/fixtures/recipes/agentsmonitor.json +0 -11
- package/fixtures/recipes/agentsreview.json +0 -29
- package/fixtures/recipes/agentswarm.json +0 -11
- package/fixtures/recipes/fillcalendar.json +0 -12
- package/fixtures/recipes/fillcheckout.json +0 -13
- package/fixtures/recipes/filldependentdropdowns.json +0 -12
- package/fixtures/recipes/fillfromcsv.json +0 -13
- package/fixtures/recipes/fillloginform.json +0 -12
- package/fixtures/recipes/fillmultistepwizard.json +0 -13
- package/fixtures/recipes/fillregistration.json +0 -12
- package/fixtures/recipes/fillsearchfilters.json +0 -12
- package/fixtures/recipes/filltypeahead.json +0 -11
- package/fixtures/recipes/monitoralerts.json +0 -12
- package/fixtures/recipes/monitoravailability.json +0 -11
- package/fixtures/recipes/monitornetworkquiet.json +0 -12
- package/fixtures/recipes/monitorpagechanges.json +0 -11
- package/fixtures/recipes/monitorpricechange.json +0 -11
- package/fixtures/recipes/monitorschedule.json +0 -12
- package/fixtures/recipes/scrapedynamicprices.json +0 -13
- package/fixtures/recipes/scrapeimagegallery.json +0 -12
- package/fixtures/recipes/scrapeinfinitefeed.json +0 -13
- package/fixtures/recipes/scrapenestedlists.json +0 -12
- package/fixtures/recipes/scrapeproductgrid.json +0 -12
- package/fixtures/recipes/scrapereviews.json +0 -12
- package/fixtures/recipes/scrapesearchresults.json +0 -12
- package/fixtures/recipes/scrapetablepagination.json +0 -12
- package/fixtures/recipes/testaccessibility.json +0 -34
- package/fixtures/recipes/testconsoleerrors.json +0 -12
- package/fixtures/recipes/testdeeplinks.json +0 -12
- package/fixtures/recipes/testformvalidation.json +0 -13
- package/fixtures/recipes/testlayoutshift.json +0 -12
- package/fixtures/recipes/testlinkcheck.json +0 -12
- package/fixtures/recipes/testloadtiming.json +0 -12
- package/fixtures/recipes/testvisualdiff.json +0 -12
- package/fixtures/workflows/changelog-digest-workflow.json +0 -13
- package/fixtures/workflows/form-survey-workflow.json +0 -13
- package/gallery.json +0 -706
- package/hardening.d.ts.map +0 -1
- package/hardening.js +0 -188
- package/headless.d.ts.map +0 -1
- package/headless.js +0 -11522
- package/http.d.ts.map +0 -1
- package/http.js +0 -2165
- package/index.cjs +0 -54682
- package/index.d.ts.map +0 -1
- package/index.js +0 -52310
- package/index.neutral.js +0 -46343
- package/mcp.d.ts.map +0 -1
- package/mcp.js +0 -20515
- package/memory.d.ts.map +0 -1
- package/nativehost.template.json +0 -10
- package/node.cjs +0 -54686
- package/node.d.ts.map +0 -1
- package/pack.d.ts.map +0 -1
- package/pack.js +0 -805
- package/policy.d.ts.map +0 -1
- package/progress.d.ts.map +0 -1
- package/progress.js +0 -645
- package/protocol.d.ts.map +0 -1
- package/protocol.js +0 -8334
- package/schemas/audit.schema.json +0 -226
- package/schemas/capability.schema.json +0 -113
- package/schemas/envelope.schema.json +0 -162
- package/schemas/memory.schema.json +0 -51
- package/schemas/observation.schema.json +0 -113
- package/schemas/plan.schema.json +0 -208
- package/schemas/progress.schema.json +0 -126
- package/schemas/proposal.schema.json +0 -68
- package/schemas/session.schema.json +0 -82
- package/schemas/tool.schema.json +0 -94
- package/server.d.ts.map +0 -1
- package/server.js +0 -28877
- package/umd-example.html +0 -18
- package/umd.d.ts.map +0 -1
- /package/{bun.d.ts → dist/bun.d.ts} +0 -0
- /package/{cli.d.ts → dist/cli.d.ts} +0 -0
- /package/{companion.d.ts → dist/companion.d.ts} +0 -0
- /package/{crossbrowser.d.ts → dist/crossbrowser.d.ts} +0 -0
- /package/{dashdone.d.ts → dist/dashdone.d.ts} +0 -0
- /package/{deno.d.ts → dist/deno.d.ts} +0 -0
- /package/{hardening.d.ts → dist/hardening.d.ts} +0 -0
- /package/{headless.d.ts → dist/headless.d.ts} +0 -0
- /package/{http.d.ts → dist/http.d.ts} +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{mcp.d.ts → dist/mcp.d.ts} +0 -0
- /package/{memory.d.ts → dist/memory.d.ts} +0 -0
- /package/{node.d.ts → dist/node.d.ts} +0 -0
- /package/{pack.d.ts → dist/pack.d.ts} +0 -0
- /package/{policy.d.ts → dist/policy.d.ts} +0 -0
- /package/{progress.d.ts → dist/progress.d.ts} +0 -0
- /package/{protocol.d.ts → dist/protocol.d.ts} +0 -0
- /package/{server.d.ts → dist/server.d.ts} +0 -0
- /package/{umd.d.ts → dist/umd.d.ts} +0 -0
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run module of the 1.1.90 consolidation: every correlated variation of the run logic interned in this one file, so the module family carries one surface without duplicate variations.
|
|
3
|
+
* The correlation is the run lifecycle itself, ordered from the base outward: runstate holds the typed run state every other variation builds on (the keepalive heartbeat trail, the url history, the environment and turnaround provenance, the restart recovery, the zombie reaping, the storage level run lock, the integrity sealing and the quota pruning); resilience continues the same lifecycle at the runrecord level (the legal state machine, the offline queue with its replay, the checkpoints, the heartbeat staleness window, the zombie check beside the reap audit event and the rollback compensation the user chooses); runhistory keeps the per run url visits, the merged runtimeline stream, the tab isolation namespace and the session lock that serializes concurrent runs; runtimeline deepens the observation side of the same runs (console, error, rejection, long task and network failure capture with redaction, spam collapse, rotation and the console diff between two runs); runbudget guards the step and memory ceilings with the timeoutcancel bound; runresume, runreplay and runparallel optimize the identical lifecycle (the checkpoint resume with fingerprint revalidation, the audit walk replay of a sealed run and the parallel read lanes with carried selectors); and backgroundruns closes the family with the queue that keeps reviewed workflows executing with no open surface, holding the same keepalive signal of the base lifecycle.
|
|
4
|
+
* No window, depth, retention or ceiling is ever hardcoded anywhere in the family: every interval, tolerance, budget and bound stays the user's choice, and no recovery, replay, rollback or queue path ever bypasses the human review.
|
|
5
|
+
*/
|
|
6
|
+
import type { environmentkind, runlock, runstaterecord, sealedrunstate } from "./types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Run state logic of the 1.1.60 family.
|
|
9
|
+
* Correlated rules for the typed run state live here: the keepalive lifecycle with its start and stop events, its heartbeat trail and its reattach after a service worker restart, the url history of every navigation inside the run, the environment and worker turnaround of every step, the restart recovery of the pending step, the zombie reaping of runs whose heartbeat fell silent, the storage level run lock that holds a session against concurrent runs, the serialization of steps that share one tab across parallel branches, the integrity sealing of persisted run state and the quota pruning under storage pressure.
|
|
10
|
+
* No interval, window or lock expiry is ever hardcoded: the heartbeat interval, the zombie tolerance and the lock expiry stay user choices, the run state persists on every heartbeat, and no recovery path ever bypasses the human review.
|
|
11
|
+
*/
|
|
12
|
+
/** Opens one run state: the keepalive port opens, the start event records and the run waits for its first heartbeat. */
|
|
13
|
+
export declare function openrun(input: {
|
|
14
|
+
runid: string;
|
|
15
|
+
sessionid: string;
|
|
16
|
+
planid: string;
|
|
17
|
+
profileid: string;
|
|
18
|
+
interval: number;
|
|
19
|
+
now: number;
|
|
20
|
+
}): runstaterecord;
|
|
21
|
+
/** Emits one keepalive heartbeat: the beat counter grows, the last beat time moves and the event trail records the beat so the persisted state carries it into any restart recovery. */
|
|
22
|
+
export declare function beatrun(state: runstaterecord, now: number): runstaterecord;
|
|
23
|
+
/** Closes one run at its terminal state: the keepalive port closes, the stop event records and the run state freezes for the audit trail. */
|
|
24
|
+
export declare function closerun(state: runstaterecord, now: number): runstaterecord;
|
|
25
|
+
/** Reattaches the keepalive port after a service worker restart: the persisted state rehydrates, the reattach event records and the pending step stays exactly where the run stopped. */
|
|
26
|
+
export declare function reattachrun(state: runstaterecord, now: number): runstaterecord;
|
|
27
|
+
/** Records one navigation inside the run: every url the run visits lands its history entry so the audit reads the full route of the run. */
|
|
28
|
+
export declare function recordurl(state: runstaterecord, entry: {
|
|
29
|
+
url: string;
|
|
30
|
+
stepid: string;
|
|
31
|
+
now: number;
|
|
32
|
+
}): runstaterecord;
|
|
33
|
+
/** Records the environment of one executed step with its provenance: the step id, the environment and the origin land in the run state beside the outcome. */
|
|
34
|
+
export declare function recordenvironment(state: runstaterecord, input: {
|
|
35
|
+
stepid: string;
|
|
36
|
+
environment: environmentkind;
|
|
37
|
+
origin: string;
|
|
38
|
+
now: number;
|
|
39
|
+
}): runstaterecord;
|
|
40
|
+
/** Records the worker turnaround of one offloaded step: the milliseconds between the worker request and its answer land in the run state for later profiling. */
|
|
41
|
+
export declare function recordturnaround(state: runstaterecord, input: {
|
|
42
|
+
stepid: string;
|
|
43
|
+
milliseconds: number;
|
|
44
|
+
now: number;
|
|
45
|
+
}): runstaterecord;
|
|
46
|
+
/** Marks the pending step of one run for restart recovery: the executor resumes exactly this step after the service worker restart, and no other step ever moves. */
|
|
47
|
+
export declare function markpending(state: runstaterecord, stepid: string | undefined, now: number): runstaterecord;
|
|
48
|
+
/** Reads the recovery plan of one interrupted run: the pending step names the single step the executor resumes, and a run without a pending step starts over through the same review instead of guessing. */
|
|
49
|
+
export declare function recoveryplan(state: runstaterecord): {
|
|
50
|
+
runid: string;
|
|
51
|
+
pendingstepid?: string;
|
|
52
|
+
recoverable: boolean;
|
|
53
|
+
reason: string;
|
|
54
|
+
};
|
|
55
|
+
/** Sweeps the zombie runs whose heartbeat fell silent: a run whose last beat sits past the tolerated silent intervals reaps, while a live run keeps its state; the tolerance stays the user configured number of intervals. */
|
|
56
|
+
export declare function zombiesweep(input: {
|
|
57
|
+
states: runstaterecord[];
|
|
58
|
+
now: number;
|
|
59
|
+
interval: number;
|
|
60
|
+
missedlimit: number;
|
|
61
|
+
}): {
|
|
62
|
+
states: runstaterecord[];
|
|
63
|
+
reaped: string[];
|
|
64
|
+
};
|
|
65
|
+
/** Acquires the storage level run lock of one session: a session with no live lock gains its run lock while a concurrent run of the same session refuses, so one session never carries two runs at once. */
|
|
66
|
+
export declare function acquirerunlock(input: {
|
|
67
|
+
locks: runlock[];
|
|
68
|
+
sessionid: string;
|
|
69
|
+
runid: string;
|
|
70
|
+
holder: string;
|
|
71
|
+
expiresat?: number;
|
|
72
|
+
now: number;
|
|
73
|
+
}): {
|
|
74
|
+
locks: runlock[];
|
|
75
|
+
acquired: boolean;
|
|
76
|
+
reason: string;
|
|
77
|
+
};
|
|
78
|
+
/** Releases the storage level run lock of one session: the run that holds the lock frees it while another holder refuses. */
|
|
79
|
+
export declare function releaserunlock(input: {
|
|
80
|
+
locks: runlock[];
|
|
81
|
+
sessionid: string;
|
|
82
|
+
runid: string;
|
|
83
|
+
now: number;
|
|
84
|
+
}): {
|
|
85
|
+
locks: runlock[];
|
|
86
|
+
released: boolean;
|
|
87
|
+
reason: string;
|
|
88
|
+
};
|
|
89
|
+
/** Expires the run locks past their user configured expiry: an expired lock frees its session while a lock without an expiry keeps holding until its run releases it. */
|
|
90
|
+
export declare function expirerunlocks(locks: runlock[], now: number): {
|
|
91
|
+
locks: runlock[];
|
|
92
|
+
expired: string[];
|
|
93
|
+
};
|
|
94
|
+
/** Serializes the steps that share one tab across parallel branches: every branch keeps its inner order while the shared tab receives one deterministic lane, so two branches never touch one tab inside the same beat. */
|
|
95
|
+
export declare function serializesteps(input: {
|
|
96
|
+
branches: Array<{
|
|
97
|
+
branchid: string;
|
|
98
|
+
steps: Array<{
|
|
99
|
+
stepid: string;
|
|
100
|
+
tabid: number;
|
|
101
|
+
}>;
|
|
102
|
+
}>;
|
|
103
|
+
}): Array<{
|
|
104
|
+
branchid: string;
|
|
105
|
+
stepid: string;
|
|
106
|
+
tabid: number;
|
|
107
|
+
order: number;
|
|
108
|
+
}>;
|
|
109
|
+
/** Seals one persisted run state with its sha-256 integrity digest: the payload and its digest travel together so a tampered run state at rest stays detectable before any recovery uses it. */
|
|
110
|
+
export declare function sealrunstate(state: runstaterecord): Promise<sealedrunstate>;
|
|
111
|
+
/** Opens one sealed run state: the digest must match the payload before the recovery reads it, and a tampered or malformed seal refuses. */
|
|
112
|
+
export declare function openseal(sealed: sealedrunstate): Promise<runstaterecord>;
|
|
113
|
+
/** Prunes the stored run states under storage pressure: the oldest completed run states leave first while every active or recovered run keeps its state, and the pruned ids name what left. */
|
|
114
|
+
export declare function prunerunstates(input: {
|
|
115
|
+
states: runstaterecord[];
|
|
116
|
+
used: number;
|
|
117
|
+
ceiling: number;
|
|
118
|
+
}): {
|
|
119
|
+
states: runstaterecord[];
|
|
120
|
+
pruned: string[];
|
|
121
|
+
reason: string;
|
|
122
|
+
};
|
|
123
|
+
/** Exports the run states as one single audit record: every run, its url history, its environments, its turnarounds and its keepalive trail in one envelope the auditor reads at once. */
|
|
124
|
+
export declare function exportrunstate(states: runstaterecord[], now: number): {
|
|
125
|
+
runs: number;
|
|
126
|
+
urls: number;
|
|
127
|
+
environments: number;
|
|
128
|
+
offloaded: number;
|
|
129
|
+
beats: number;
|
|
130
|
+
exportedat: number;
|
|
131
|
+
};
|
|
132
|
+
import type { agentplan, auditevent, checkpointrecord, heartbeatrecord, planprogress, rollbackitem, runrecord, runsettings, runstate, runtransition, queuedtask, toolstep } from "./types.js";
|
|
133
|
+
/**
|
|
134
|
+
* Run lifecycle logic of the 1.1.70 family.
|
|
135
|
+
* The runstatemachine tracks every legal transition of a run so a service worker restart or a lost connection never loses work: approved plans queue offline with monotonic sequences, steps carry deterministic idempotencykeys so replays deduplicate, checkpoints capture the completed steps with their page digest, heartbeats time the live runs, zombies reap through the audit trail, and failed runs roll back through compensating steps the user explicitly chooses.
|
|
136
|
+
* No window, depth or retention is ever hardcoded: the heartbeat staleness window, the offline queue depth and the failed run retention stay user choices, and no recovery, replay or rollback path ever bypasses the human review.
|
|
137
|
+
*/
|
|
138
|
+
/** The documented heartbeat staleness window the roadmap names while the configured window stays the user's choice with no code ceiling. */
|
|
139
|
+
export declare const roadmapheartbeatwindow = 60000;
|
|
140
|
+
/** The legal transitions of each runstate: queued runs start or cancel, running runs pause, complete, fail or cancel, paused and awaitingapproval runs resume or stop, and only a failed or cancelled run rolls back. */
|
|
141
|
+
export declare function runstatemachine(): Record<runstate, runstate[]>;
|
|
142
|
+
/** Reads whether one run transition stays legal inside the state machine: every state allows only the pairs its lifecycle defines. */
|
|
143
|
+
export declare function transitionislegal(transition: runtransition): boolean;
|
|
144
|
+
/** Moves one runrecord through a single legal transition or throws: an illegal transition never silently mutates the run state. */
|
|
145
|
+
export declare function advancerun(run: runrecord, to: runstate, now: number): runrecord;
|
|
146
|
+
/** Creates one runrecord in the queued state for an approved plan: the run waits in the offlinequeue or the executor before it ever runs. */
|
|
147
|
+
export declare function initialrun(input: {
|
|
148
|
+
planid: string;
|
|
149
|
+
sessionid: string;
|
|
150
|
+
now: number;
|
|
151
|
+
runid?: string;
|
|
152
|
+
}): runrecord;
|
|
153
|
+
/** Derives the deterministic idempotencykey of one step from its plan and step identity so a replay of the same step deduplicates on the same key. */
|
|
154
|
+
export declare function stepkey(input: {
|
|
155
|
+
planid: string;
|
|
156
|
+
stepid: string;
|
|
157
|
+
kind: string;
|
|
158
|
+
}): string;
|
|
159
|
+
/** Returns the count of tasks waiting in the offlinequeue. */
|
|
160
|
+
export declare function queuesize(queue: queuedtask[]): number;
|
|
161
|
+
/** Appends one approved plan to the offlinequeue with a monotonic sequence number so the replay drains the tasks in their enqueue order. */
|
|
162
|
+
export declare function enqueueoffline(queue: queuedtask[], input: {
|
|
163
|
+
plan: agentplan;
|
|
164
|
+
sessionid: string;
|
|
165
|
+
now: number;
|
|
166
|
+
}): queuedtask[];
|
|
167
|
+
/** Returns the next queuedtask in sequence order and the queue without it; an empty queue returns no task. */
|
|
168
|
+
export declare function dequeueoffline(queue: queuedtask[]): {
|
|
169
|
+
queue: queuedtask[];
|
|
170
|
+
task?: queuedtask;
|
|
171
|
+
};
|
|
172
|
+
/** Reads the replay plan of the offlinequeue once connectivity returns: every task drains in sequence order while the tasks whose plan window passed offline expire and fail instead of running. */
|
|
173
|
+
export declare function replayqueue(queue: queuedtask[], now: number): {
|
|
174
|
+
ready: queuedtask[];
|
|
175
|
+
expired: queuedtask[];
|
|
176
|
+
};
|
|
177
|
+
/** Captures one checkpoint of a run: the completed step ids, the step boundary, the page digest a resume revalidates and the timestamp. */
|
|
178
|
+
export declare function makecheckpoint(input: {
|
|
179
|
+
runid: string;
|
|
180
|
+
stepid: string;
|
|
181
|
+
completed: string[];
|
|
182
|
+
digest: string;
|
|
183
|
+
now: number;
|
|
184
|
+
}): checkpointrecord;
|
|
185
|
+
/** Returns the steps that follow the last stored checkpoint so the resume continues at the first open step instead of repeating completed work. */
|
|
186
|
+
export declare function resumecheckpoint(input: {
|
|
187
|
+
checkpoint: checkpointrecord | undefined;
|
|
188
|
+
steps: string[];
|
|
189
|
+
}): string[];
|
|
190
|
+
/** Verifies one checkpointrecord against its run and page digest: a checkpoint of another run or a page that changed since the capture never validates. */
|
|
191
|
+
export declare function checkpointisvalid(input: {
|
|
192
|
+
checkpoint: checkpointrecord;
|
|
193
|
+
runid: string;
|
|
194
|
+
digest: string;
|
|
195
|
+
}): boolean;
|
|
196
|
+
/** Refreshes the heartbeatrecord of a running run: the beat counter grows and the last beat time moves so the zombiecheck sees the run alive. */
|
|
197
|
+
export declare function runheartbeat(input: {
|
|
198
|
+
runid: string;
|
|
199
|
+
beat?: number;
|
|
200
|
+
now: number;
|
|
201
|
+
}): heartbeatrecord;
|
|
202
|
+
/** Reads whether the last heartbeat of a run sits older than the configured window: a stale heartbeat turns a running run into a zombie candidate. */
|
|
203
|
+
export declare function heartbeatisstale(input: {
|
|
204
|
+
heartbeat: heartbeatrecord | undefined;
|
|
205
|
+
now: number;
|
|
206
|
+
window: number;
|
|
207
|
+
}): boolean;
|
|
208
|
+
/** Loads the user configured heartbeat staleness window without a hard cap: an absent setting keeps the documented roadmap window while every configured value stays the user's choice. */
|
|
209
|
+
export declare function heartbeatwindowof(settings: runsettings | undefined): number;
|
|
210
|
+
/** Lists the running runs whose heartbeat is stale: every run past its staleness window names a zombie candidate the reaper may reap. */
|
|
211
|
+
export declare function zombiecheck(input: {
|
|
212
|
+
runs: runrecord[];
|
|
213
|
+
heartbeats: Record<string, heartbeatrecord>;
|
|
214
|
+
now: number;
|
|
215
|
+
window: number;
|
|
216
|
+
}): runrecord[];
|
|
217
|
+
/** Transitions one zombie run to failed and records its reap audit event: the reaped run keeps its record for the audit trail while it never executes again. */
|
|
218
|
+
export declare function reaprun(run: runrecord, now: number): {
|
|
219
|
+
run: runrecord;
|
|
220
|
+
event: auditevent;
|
|
221
|
+
};
|
|
222
|
+
/** Lists the mutating steps a run already executed: every executed step that is not read only names a side effect the rollback must compensate. */
|
|
223
|
+
export declare function sideeffects(steps: toolstep[], executedstepids: string[]): toolstep[];
|
|
224
|
+
/** Builds the compensating steps of a failed run for its executed side effects; read only steps carry no compensation at all because they changed nothing. */
|
|
225
|
+
export declare function rollbackrun(input: {
|
|
226
|
+
runid: string;
|
|
227
|
+
steps: toolstep[];
|
|
228
|
+
executedstepids: string[];
|
|
229
|
+
origin: string;
|
|
230
|
+
now: number;
|
|
231
|
+
}): rollbackitem[];
|
|
232
|
+
/** Moves one run to cancelled and returns the rollback choice the cancel pairs with: the cancel itself never executes a compensation without the explicit user choice. */
|
|
233
|
+
export declare function cancelrunrecord(run: runrecord, now: number): runrecord;
|
|
234
|
+
/** Pairs one cancellation with its optional rollback execution: the choice rollback builds the compensating steps while the choice none stops the run with its state frozen for the audit trail. */
|
|
235
|
+
export declare function cancelrollback(input: {
|
|
236
|
+
run: runrecord;
|
|
237
|
+
steps: toolstep[];
|
|
238
|
+
executedstepids: string[];
|
|
239
|
+
origin: string;
|
|
240
|
+
choice: "rollback" | "none";
|
|
241
|
+
now: number;
|
|
242
|
+
}): {
|
|
243
|
+
run: runrecord;
|
|
244
|
+
compensations: rollbackitem[];
|
|
245
|
+
reason: string;
|
|
246
|
+
};
|
|
247
|
+
/** Transitions one run to failed and freezes its progress snapshot so the failure keeps exactly the state it failed at. */
|
|
248
|
+
export declare function runfail(input: {
|
|
249
|
+
run: runrecord;
|
|
250
|
+
progress?: planprogress;
|
|
251
|
+
now: number;
|
|
252
|
+
}): {
|
|
253
|
+
run: runrecord;
|
|
254
|
+
frozen?: planprogress;
|
|
255
|
+
};
|
|
256
|
+
/** Transitions one run to completed only when iscomplete reports the plan finished; an unfinished run never completes. */
|
|
257
|
+
export declare function runcomplete(input: {
|
|
258
|
+
run: runrecord;
|
|
259
|
+
plan: agentplan;
|
|
260
|
+
progress?: planprogress;
|
|
261
|
+
now: number;
|
|
262
|
+
}): runrecord;
|
|
263
|
+
/** Rebuilds one runrecord after a service worker restart: the persisted plan restores its run with its original timestamps while an expired or unapproved plan rebuilds as failed because it never resumes. */
|
|
264
|
+
export declare function runfromplan(plan: agentplan, sessionid: string, now: number): runrecord;
|
|
265
|
+
/** Returns the summary of one run: its state, its step counts against its plan, its checkpoint position and its last update. */
|
|
266
|
+
export declare function runsummaryof(input: {
|
|
267
|
+
run: runrecord;
|
|
268
|
+
plan: agentplan;
|
|
269
|
+
progress?: planprogress;
|
|
270
|
+
checkpoint?: checkpointrecord;
|
|
271
|
+
}): {
|
|
272
|
+
runid: string;
|
|
273
|
+
state: runstate;
|
|
274
|
+
steps: number;
|
|
275
|
+
completed: number;
|
|
276
|
+
checkpointstep?: string;
|
|
277
|
+
updatedat: number;
|
|
278
|
+
};
|
|
279
|
+
import type { agentsession, lockrecord, runtimelineevent, tabstate, urlvisit } from "./types.js";
|
|
280
|
+
/**
|
|
281
|
+
* Run history logic of the 1.1.71 state depth family.
|
|
282
|
+
* Every run keeps its own urlhistory and timeline: urlvisit entries append per navigation with consecutive duplicates folded, the runtimeline merges step results, audit events and url visits into one ordered stream with phase buckets, tabisolate namespaces the memory keys per tab so runs never share state, and the sessionlock serializes concurrent runs on one session while it names its holder and expires its abandoned locks.
|
|
283
|
+
* No window stays hardcoded: the lock expiry window reads the user setting with no code ceiling, urlhistory stays scoped per run and never merges runs, and no lock, visit or timeline path ever bypasses the review.
|
|
284
|
+
*/
|
|
285
|
+
/** The documented lock expiry window the roadmap names while the configured window stays the user's choice with no code ceiling. */
|
|
286
|
+
export declare const roadmaplockwindow = 120000;
|
|
287
|
+
/** Builds one urlvisit of a navigation inside a run: the url, the page title, the time and the run it belongs to. */
|
|
288
|
+
export declare function visitof(input: {
|
|
289
|
+
url: string;
|
|
290
|
+
title?: string;
|
|
291
|
+
runid: string;
|
|
292
|
+
now: number;
|
|
293
|
+
}): urlvisit;
|
|
294
|
+
/** Appends one urlvisit to the urlhistory of a run: consecutive visits to the same url fold into one entry so the history reads as the real route, and the visits of one run never merge with another run. */
|
|
295
|
+
export declare function appendvisit(visits: urlvisit[], visit: urlvisit): urlvisit[];
|
|
296
|
+
/** Builds one runtimeline event of a step result: the step identity, its outcome summary and its timestamp inside the run. */
|
|
297
|
+
export declare function stepeventof(input: {
|
|
298
|
+
runid: string;
|
|
299
|
+
stepid: string;
|
|
300
|
+
summary: string;
|
|
301
|
+
ok: boolean;
|
|
302
|
+
now: number;
|
|
303
|
+
}): runtimelineevent;
|
|
304
|
+
/** Builds one runtimeline event of an audit event so the timeline carries the audit trail beside the steps. */
|
|
305
|
+
export declare function auditeventof(event: auditevent): runtimelineevent;
|
|
306
|
+
/** Builds one runtimeline event of a url visit so the timeline carries the route beside the steps. */
|
|
307
|
+
export declare function visiteventof(visit: urlvisit): runtimelineevent;
|
|
308
|
+
/** Merges step results, audit events and url visits into one ordered runtimeline stream: every event sorts by its timestamp, the audit events carry their kind and the visits carry their route. */
|
|
309
|
+
export declare function runtimelineof(input: {
|
|
310
|
+
steps: runtimelineevent[];
|
|
311
|
+
audits: runtimelineevent[];
|
|
312
|
+
visits: urlvisit[];
|
|
313
|
+
runid: string;
|
|
314
|
+
}): runtimelineevent[];
|
|
315
|
+
/** Buckets one runtimeline stream by phase for the timeline view: every event lands in the phase its timestamp names while the order inside a phase stays the stream order. */
|
|
316
|
+
export declare function buckettimeline(events: runtimelineevent[]): Array<{
|
|
317
|
+
phase: string;
|
|
318
|
+
events: runtimelineevent[];
|
|
319
|
+
}>;
|
|
320
|
+
/** Derives the isolated namespace id of one tab: every memory key of the run lives under its tab namespace so runs never share state. */
|
|
321
|
+
export declare function tabnamespace(tabid: number): string;
|
|
322
|
+
/** Names one memory key inside the isolated namespace of its tab; the shared key stays readable beside the namespace copy. */
|
|
323
|
+
export declare function tabkey(tabid: number, key: string): string;
|
|
324
|
+
/** Copies the shared config into the tab namespace on demand: the tabstate carries its namespace id, its isolated run id and the copied config snapshot. */
|
|
325
|
+
export declare function tabisolate(input: {
|
|
326
|
+
tabid: number;
|
|
327
|
+
config: Record<string, unknown>;
|
|
328
|
+
runid?: string;
|
|
329
|
+
now: number;
|
|
330
|
+
}): tabstate;
|
|
331
|
+
/** Acquires one lockrecord for a run on a session: the holder names the run, the acquisition time stamps it and the expiry window stays the user choice. */
|
|
332
|
+
export declare function acquiresessionlock(input: {
|
|
333
|
+
runid: string;
|
|
334
|
+
sessionid: string;
|
|
335
|
+
window: number;
|
|
336
|
+
now: number;
|
|
337
|
+
}): lockrecord;
|
|
338
|
+
/** Reads whether one lock blocks a run: a lock of the same run never blocks itself, a live foreign lock blocks and names its holder while an expired lock blocks nothing because its window passed. */
|
|
339
|
+
export declare function lockblocks(lock: lockrecord | undefined, runid: string, now: number): {
|
|
340
|
+
blocked: boolean;
|
|
341
|
+
reason: string;
|
|
342
|
+
};
|
|
343
|
+
/** Reads whether one lock belongs to a run so the release path only clears its own lock. */
|
|
344
|
+
export declare function lockheldby(lock: lockrecord | undefined, runid: string): boolean;
|
|
345
|
+
/** Releases the lock of a completed, failed or cancelled run: the sessionlock clears so the next reviewed run may acquire it. */
|
|
346
|
+
export declare function releasesessionlock(lock: lockrecord | undefined, runid: string): boolean;
|
|
347
|
+
/** Loads the user configured lock expiry window without a hard cap: an absent setting keeps the documented roadmap window while every configured value stays the user's choice. */
|
|
348
|
+
export declare function lockwindowof(settings: runsettings | undefined): number;
|
|
349
|
+
/** Lists the locks whose expiry window passed: every abandoned lock names an expiry candidate the startup pass clears before the zombiecheck runs. */
|
|
350
|
+
export declare function stalelocks(locks: lockrecord[], now: number): lockrecord[];
|
|
351
|
+
/** Attaches the acquired lockid to one agentsession so concurrent run protection travels with the session record. */
|
|
352
|
+
export declare function sessionwithlock(session: agentsession, lockid: string | undefined): agentsession;
|
|
353
|
+
/** Summarizes the urlhistory of one run: the visit count, its distinct origins and its first and last visit times; a run without visits carries none. */
|
|
354
|
+
export declare function visitsummary(visits: urlvisit[]): {
|
|
355
|
+
count: number;
|
|
356
|
+
origins: string[];
|
|
357
|
+
first?: number;
|
|
358
|
+
last?: number;
|
|
359
|
+
};
|
|
360
|
+
/** Reads the final url of a completed navigation step result so the urlhistory records the url the redirect chain landed on; a result without a final url reports the planned url unchanged. */
|
|
361
|
+
export declare function finalurlof(input: {
|
|
362
|
+
plannedurl: string;
|
|
363
|
+
finalurl?: string;
|
|
364
|
+
}): string;
|
|
365
|
+
/** Lists the navigation steps of a plan in their reviewed order: the urlhistory records one urlvisit for each completed navigation step. */
|
|
366
|
+
export declare function navigationsteps(steps: toolstep[]): toolstep[];
|
|
367
|
+
/** Reads the runrecord of a run with its visits attached so the record carries its urlhistory beside its lifecycle state. */
|
|
368
|
+
export declare function runwithvisits(run: runrecord, visits: urlvisit[]): runrecord;
|
|
369
|
+
import type { consolediff, consoleentry, errorrecord, exchangerecord, loglevel, loglevelset, longtaskentry, netfailureentry, rejectionrecord, rotationrule, spamrule, stackframe, timelineentry, timelinesource } from "./types.js";
|
|
370
|
+
/**
|
|
371
|
+
* Run timeline logics for the 1.1.45 debugging family.
|
|
372
|
+
* Every correlated rule for console capture with reviewed depth bounds and secret redaction, stack frame parsing, error, rejection and resource failure capture, long task attribution windows, the timeline binding to one run and its step ids, spam collapse with reviewed thresholds, log rotation without entry loss, level and source filters, the blocking duration per step window and the console diff between two runs lives in this file.
|
|
373
|
+
* Console, error and task watching derives from page-injected listeners installed through the scripting api and the performance buffers, so no debugger permission exists anywhere in the manifest; redaction runs before any entry leaves the page bridge and captured text never carries reviewed secret patterns.
|
|
374
|
+
*/
|
|
375
|
+
/** The debugging kinds, listed among the available capabilities of every proposal request. */
|
|
376
|
+
export declare const timelinekinds: string[];
|
|
377
|
+
/** The reviewed level set, ordered from the most severe to the most verbose level. */
|
|
378
|
+
export declare const loglevels: loglevel[];
|
|
379
|
+
/** The reviewed timeline source grammar: page console output, script errors, promise rejections, resource failures, long tasks, failed network requests and instrumented devtools protocol events. */
|
|
380
|
+
export declare const timelinesources: timelinesource[];
|
|
381
|
+
/** Ranks one level inside the reviewed level set; lower ranks are more severe. */
|
|
382
|
+
export declare function levelrank(level: loglevel): number;
|
|
383
|
+
/** Redacts reviewed secret patterns from console text before any entry leaves the page bridge; matched patterns never survive into a stored entry. */
|
|
384
|
+
export declare function redactconsoletext(text: string, patterns: string[]): string;
|
|
385
|
+
/** Classifies the kind tag of one console argument for the consoleentry argument kinds. */
|
|
386
|
+
export declare function argkind(value: unknown): string;
|
|
387
|
+
/** Serializes one console argument through the reviewed depth bound; deeper objects collapse to their constructor tag so the bound stays a user choice with no code ceiling. */
|
|
388
|
+
export declare function serializearg(value: unknown, depth: number): string;
|
|
389
|
+
/** Builds one captured console entry from a forwarded console call: the level, the redacted text of every serialized argument and the argument kinds, with redaction applied before the entry exists. */
|
|
390
|
+
export declare function consolecapture(input: {
|
|
391
|
+
level: loglevel;
|
|
392
|
+
args: unknown[];
|
|
393
|
+
depth: number;
|
|
394
|
+
redact: string[];
|
|
395
|
+
}): consoleentry;
|
|
396
|
+
/** Parses one stack trace text into stack frames with function names, urls, lines and columns; unparseable lines are skipped instead of crashing capture. */
|
|
397
|
+
export declare function stackframes(stacktext: string): stackframe[];
|
|
398
|
+
/** Builds one captured javascript error record body from an error event: the redacted message, the parsed stack frames, the source url and the line. */
|
|
399
|
+
export declare function errorcapture(input: {
|
|
400
|
+
message: string;
|
|
401
|
+
sourceurl: string;
|
|
402
|
+
line: number;
|
|
403
|
+
stacktext?: string;
|
|
404
|
+
redact: string[];
|
|
405
|
+
}): Pick<errorrecord, "message" | "frames" | "sourceurl" | "line">;
|
|
406
|
+
/** Builds one captured unhandled rejection record body from the rejection reason text and its stack frames, with the reason redacted before capture. */
|
|
407
|
+
export declare function rejectioncapture(input: {
|
|
408
|
+
reason: string;
|
|
409
|
+
stacktext?: string;
|
|
410
|
+
redact: string[];
|
|
411
|
+
}): Pick<rejectionrecord, "reason" | "frames">;
|
|
412
|
+
/** Builds the long task entry bodies of one watch window from performance longtask entries with their attribution names; the reviewed threshold filters entries below the user configured duration. */
|
|
413
|
+
export declare function longtaskcapture(input: {
|
|
414
|
+
entries: Array<{
|
|
415
|
+
starttime: number;
|
|
416
|
+
duration: number;
|
|
417
|
+
attributions: string[];
|
|
418
|
+
}>;
|
|
419
|
+
threshold: number;
|
|
420
|
+
}): Array<Pick<longtaskentry, "duration" | "starttime" | "attributions">>;
|
|
421
|
+
/** One run timeline bound to its run and step ids. */
|
|
422
|
+
export interface timeline {
|
|
423
|
+
runid: string;
|
|
424
|
+
origin: string;
|
|
425
|
+
stepids: string[];
|
|
426
|
+
attachedat: number;
|
|
427
|
+
entries: timelineentry[];
|
|
428
|
+
}
|
|
429
|
+
/** Binds one timeline to the run and its step ids; capture stays scoped to that run and every entry carries the run correlation id of its step. */
|
|
430
|
+
export declare function attachtimeline(input: {
|
|
431
|
+
runid: string;
|
|
432
|
+
origin: string;
|
|
433
|
+
stepids: string[];
|
|
434
|
+
now: number;
|
|
435
|
+
}): timeline;
|
|
436
|
+
/** Applies the reviewed level set to timeline entries: per step level floors drop entries more verbose than the floor and source filters drop entries from unreviewed sources. */
|
|
437
|
+
export declare function filterentries(entries: timelineentry[], levelset: loglevelset): timelineentry[];
|
|
438
|
+
/** Collapses repeated identical messages inside the reviewed spam window into counts and flags the patterns that exceed the reviewed collapse threshold. */
|
|
439
|
+
export declare function spamdetect(entries: timelineentry[], rule: spamrule): {
|
|
440
|
+
entries: Array<timelineentry & {
|
|
441
|
+
repeat: number;
|
|
442
|
+
}>;
|
|
443
|
+
flagged: Array<{
|
|
444
|
+
message: string;
|
|
445
|
+
count: number;
|
|
446
|
+
}>;
|
|
447
|
+
};
|
|
448
|
+
/** Rotates the timeline of one run: the newest entries stay inside the reviewed max entries window while every overflow entry moves to the rotation target store without data loss. */
|
|
449
|
+
export declare function rotatelogs(entries: timelineentry[], rule: rotationrule): {
|
|
450
|
+
kept: timelineentry[];
|
|
451
|
+
overflow: timelineentry[];
|
|
452
|
+
};
|
|
453
|
+
/** Counts the timeline entries per level for the response envelope timeline block. */
|
|
454
|
+
export declare function timelinecounts(entries: timelineentry[]): Record<string, number>;
|
|
455
|
+
/** Sums the blocking duration of long task entries inside one step window; the window stays a reviewed value with no code ceiling. */
|
|
456
|
+
export declare function blockingduration(tasks: Array<{
|
|
457
|
+
starttime: number;
|
|
458
|
+
duration: number;
|
|
459
|
+
}>, stepid: string, window: {
|
|
460
|
+
startedat: number;
|
|
461
|
+
endedat: number;
|
|
462
|
+
}): {
|
|
463
|
+
stepid: string;
|
|
464
|
+
blocking: number;
|
|
465
|
+
tasks: number;
|
|
466
|
+
};
|
|
467
|
+
/** Marks one failed request of the run in the timeline from its observed exchange: the url, status, error class and correlation id. */
|
|
468
|
+
export declare function netfailureentryof(input: {
|
|
469
|
+
id: string;
|
|
470
|
+
exchange: exchangerecord;
|
|
471
|
+
at: number;
|
|
472
|
+
}): netfailureentry | null;
|
|
473
|
+
/** Decides whether a watcher detached early because the run tab navigated inside its watch window: navigation timestamps inside the window detach the watcher at the navigation time. */
|
|
474
|
+
export declare function watcherdetached(input: {
|
|
475
|
+
startedat: number;
|
|
476
|
+
lifetime: number;
|
|
477
|
+
navigations: number[];
|
|
478
|
+
}): {
|
|
479
|
+
detached: boolean;
|
|
480
|
+
at?: number;
|
|
481
|
+
};
|
|
482
|
+
/** Compares the console output of two runs and classifies every line as added, removed or repeated; repeated lines carry their repeat counts. */
|
|
483
|
+
export declare function consolediff(input: {
|
|
484
|
+
baseid: string;
|
|
485
|
+
targetid: string;
|
|
486
|
+
baselines: string[];
|
|
487
|
+
targetlines: string[];
|
|
488
|
+
now: number;
|
|
489
|
+
}): consolediff;
|
|
490
|
+
import type { budgetalert, runbudgetrecord, timeoutcancelevent, timeoutcancelpolicy } from "./types.js";
|
|
491
|
+
/**
|
|
492
|
+
* Runbudget logic of the 1.1.69 family.
|
|
493
|
+
* Every run tracks its step usage against the user chosen step budget and its memory pressure through the worker telemetry, the budgetalerts fire at the user chosen thresholds with their severity levels while the critical threshold pauses the run pending a user choice instead of refusing it, and the timeoutcancel aborts a slow step at the user chosen bound with the cancel event recorded in the immutable log beside the step outcome.
|
|
494
|
+
* Every budget, threshold and bound stays a user choice: the tracker measures and never caps, and the pause waits for the user instead of dropping work.
|
|
495
|
+
*/
|
|
496
|
+
/** Builds one runbudget record of a run: the step usage against the user chosen step budget beside the memory pressure the worker telemetry reported. */
|
|
497
|
+
export declare function runbudgetof(input: {
|
|
498
|
+
runid: string;
|
|
499
|
+
steps: number;
|
|
500
|
+
stepbudget?: number;
|
|
501
|
+
pressure: number;
|
|
502
|
+
memorybudget?: number;
|
|
503
|
+
now: number;
|
|
504
|
+
}): runbudgetrecord;
|
|
505
|
+
/** Reads the budgetalerts of one runbudget record: the warning threshold fires its warning while the critical threshold fires its critical alert that pauses the run pending a user choice; an absent threshold keeps the alert informational only. */
|
|
506
|
+
export declare function budgetalertstate(input: {
|
|
507
|
+
budget: runbudgetrecord;
|
|
508
|
+
thresholds?: {
|
|
509
|
+
warning?: number;
|
|
510
|
+
critical?: number;
|
|
511
|
+
};
|
|
512
|
+
}): budgetalert[];
|
|
513
|
+
/** Reads whether one run pauses for its budgetalerts: only a critical alert pauses the run pending a user choice while every warning stays informational. */
|
|
514
|
+
export declare function runpausesforalerts(alerts: budgetalert[]): boolean;
|
|
515
|
+
/** Reads the timeoutcancel decision of one step: the step aborts at the user chosen bound while an absent bound never aborts a step because the bound stays a user choice. */
|
|
516
|
+
export declare function timeoutcanceldecision(input: {
|
|
517
|
+
elapsed: number;
|
|
518
|
+
bound?: number;
|
|
519
|
+
}): {
|
|
520
|
+
abort: boolean;
|
|
521
|
+
reason: string;
|
|
522
|
+
};
|
|
523
|
+
/** Builds one timeoutcancel event: the aborted step, its bound, its elapsed time and the immutable log entry the cancel wrote beside the step outcome. */
|
|
524
|
+
export declare function timeoutcanceleventof(input: {
|
|
525
|
+
runid: string;
|
|
526
|
+
stepid: string;
|
|
527
|
+
bound: number;
|
|
528
|
+
elapsed: number;
|
|
529
|
+
now: number;
|
|
530
|
+
logged: boolean;
|
|
531
|
+
}): timeoutcancelevent;
|
|
532
|
+
/** Reads the timeoutcancel policies of one plan: one policy per step carrying the user chosen bound, and an absent bound keeps every policy unbounded. */
|
|
533
|
+
export declare function timeoutcancelpolicies(input: {
|
|
534
|
+
steps: string[];
|
|
535
|
+
bound?: number;
|
|
536
|
+
}): timeoutcancelpolicy[];
|
|
537
|
+
import type { navdedupeentry, resumepoint, runcacheentry, stepprefetchhint } from "./types.js";
|
|
538
|
+
/**
|
|
539
|
+
* Runresume logic of the 1.1.69 family.
|
|
540
|
+
* The efficientresume checkpoints every step boundary with its cursor and its page digest, skips the completed steps after a restart and revalidates the page fingerprint before it resumes, the navdedupe skips navigations to the already active url and folds repeated planned visits into one navigation, the runcache stores fetched resources per run keyed by their digest, serves the repeat fetches of the same run and clears at the run end unless the user pins the profile cache, and the stepprefetch derives its likely next pages and likely next selectors from the plan structure alone.
|
|
541
|
+
* The resume, the dedupe and the prefetch optimize the run only: they never skip a review and never fetch a page the reviewed plan never named.
|
|
542
|
+
*/
|
|
543
|
+
/** Builds one efficientresume checkpoint: the step boundary with its cursor and the digest of the page fingerprint the resume revalidates. */
|
|
544
|
+
export declare function resumepointof(input: {
|
|
545
|
+
runid: string;
|
|
546
|
+
stepid: string;
|
|
547
|
+
cursor: number;
|
|
548
|
+
digest: string;
|
|
549
|
+
now: number;
|
|
550
|
+
}): resumepoint;
|
|
551
|
+
/** Reads the skip plan after a restart: the steps with a checkpoint skip while the resume continues at the first step without one. */
|
|
552
|
+
export declare function skipcompletedsteps(input: {
|
|
553
|
+
checkpoints: resumepoint[];
|
|
554
|
+
steps: string[];
|
|
555
|
+
}): {
|
|
556
|
+
skip: string[];
|
|
557
|
+
resumeat?: string;
|
|
558
|
+
};
|
|
559
|
+
/** Revalidates the page fingerprint before one resume: a matching digest resumes while a changed fingerprint refuses so the resume never continues against a different page. */
|
|
560
|
+
export declare function revalidatefingerprint(input: {
|
|
561
|
+
checkpoint: resumepoint;
|
|
562
|
+
fingerprint: string;
|
|
563
|
+
}): {
|
|
564
|
+
ok: boolean;
|
|
565
|
+
reason: string;
|
|
566
|
+
};
|
|
567
|
+
/** Reads the navdedupe verdict of one planned navigation: a navigation to the already active url skips while every other navigation runs. */
|
|
568
|
+
export declare function navdedupeverdict(input: {
|
|
569
|
+
url: string;
|
|
570
|
+
activeurl: string;
|
|
571
|
+
}): {
|
|
572
|
+
skip: boolean;
|
|
573
|
+
reason: string;
|
|
574
|
+
};
|
|
575
|
+
/** Folds repeated planned visits into one navigation per url: every step that plans the same url merges into one navdedupe entry. */
|
|
576
|
+
export declare function foldplannedvisits(steps: Array<{
|
|
577
|
+
id: string;
|
|
578
|
+
url?: string;
|
|
579
|
+
}>): navdedupeentry[];
|
|
580
|
+
/** Reads the digest key of one fetched resource within one run so the runcache stores and serves it by digest. */
|
|
581
|
+
export declare function runcachedigest(input: {
|
|
582
|
+
runid: string;
|
|
583
|
+
resource: string;
|
|
584
|
+
}): string;
|
|
585
|
+
/** Serves one repeat fetch from the runcache: a stored entry of the same run and the same resource answers the fetch while no stored entry keeps the fetch running. */
|
|
586
|
+
export declare function runcachehit(entries: runcacheentry[], input: {
|
|
587
|
+
runid: string;
|
|
588
|
+
resource: string;
|
|
589
|
+
}): runcacheentry | undefined;
|
|
590
|
+
/** Reads the runcache sweep of one run end: the entries clear at the run end while the pinned entries of the user profile cache survive. */
|
|
591
|
+
export declare function runcachesweep(entries: runcacheentry[], input: {
|
|
592
|
+
runid: string;
|
|
593
|
+
pin: boolean;
|
|
594
|
+
}): {
|
|
595
|
+
kept: runcacheentry[];
|
|
596
|
+
cleared: number;
|
|
597
|
+
};
|
|
598
|
+
/** Derives the stepprefetch hints from the plan structure alone: every step names its likely next page from the next planned navigation and its likely next selectors from the targets of the steps that follow, so the warming never reaches a page the reviewed plan never named. */
|
|
599
|
+
export declare function stepprefetchhints(plan: {
|
|
600
|
+
steps: Array<{
|
|
601
|
+
id: string;
|
|
602
|
+
kind: string;
|
|
603
|
+
value?: string;
|
|
604
|
+
target?: string;
|
|
605
|
+
}>;
|
|
606
|
+
}): stepprefetchhint[];
|
|
607
|
+
import type { immutablelogentry, runreplaysession, runreplaystep } from "./types.js";
|
|
608
|
+
/** Builds one replay step of a log entry with its gate resolutions: the step annotates the gate the run waited at when the entry carries one. */
|
|
609
|
+
export declare function replaystepof(entry: immutablelogentry, index: number, gates: Array<{
|
|
610
|
+
gateid: string;
|
|
611
|
+
kind: string;
|
|
612
|
+
resolution: string;
|
|
613
|
+
at: number;
|
|
614
|
+
}>): runreplaystep;
|
|
615
|
+
/** Builds one runreplay session of a sealed run: one replay step per verified log entry in order, the cursor starts before the first step and the viewer actions start empty. */
|
|
616
|
+
export declare function runreplaysessionof(input: {
|
|
617
|
+
runid: string;
|
|
618
|
+
entries: immutablelogentry[];
|
|
619
|
+
gates?: Array<{
|
|
620
|
+
gateid: string;
|
|
621
|
+
kind: string;
|
|
622
|
+
resolution: string;
|
|
623
|
+
at: number;
|
|
624
|
+
}>;
|
|
625
|
+
now: number;
|
|
626
|
+
}): runreplaysession;
|
|
627
|
+
/** Moves the replay cursor one step forward or backward; the cursor stays inside the step list because a replay walks its recorded chain only. */
|
|
628
|
+
export declare function replaymove(session: runreplaysession, direction: "forward" | "backward", now: number): runreplaysession;
|
|
629
|
+
/** Jumps the replay cursor to one chosen step of the recorded chain; a step outside the chain refuses the jump. */
|
|
630
|
+
export declare function replayjump(session: runreplaysession, stepid: string, now: number): runreplaysession;
|
|
631
|
+
/** Toggles the replay play state: playing advances the viewer through the recorded steps while the pause holds the cursor exactly where it stands. */
|
|
632
|
+
export declare function replayplay(session: runreplaysession, playing: boolean, now: number): runreplaysession;
|
|
633
|
+
/** Records one viewer action of the replay session for the audit trail: every play, pause, step and jump keeps its time. */
|
|
634
|
+
export declare function replayviewaction(session: runreplaysession, action: {
|
|
635
|
+
kind: "play" | "pause" | "step" | "jump";
|
|
636
|
+
stepid?: string;
|
|
637
|
+
at: number;
|
|
638
|
+
}): runreplaysession;
|
|
639
|
+
/** Reads the restored view of the replayed step: the log summary it stands on beside the observation and the capture the step restored from the stored captures of the run. */
|
|
640
|
+
export declare function replayrestoredview(step: runreplaystep): {
|
|
641
|
+
stepid: string;
|
|
642
|
+
index: number;
|
|
643
|
+
summary: string;
|
|
644
|
+
observationversion?: number;
|
|
645
|
+
captureid?: string;
|
|
646
|
+
gateresolutions: Array<{
|
|
647
|
+
gateid: string;
|
|
648
|
+
kind: string;
|
|
649
|
+
resolution: string;
|
|
650
|
+
at: number;
|
|
651
|
+
}>;
|
|
652
|
+
};
|
|
653
|
+
/** Reads the replay cursor of one viewed run the memory keeps per run, so a reopened replay stands where the viewer left it. */
|
|
654
|
+
export declare function replaycursorof(session: runreplaysession): {
|
|
655
|
+
runid: string;
|
|
656
|
+
cursor: number;
|
|
657
|
+
playing: boolean;
|
|
658
|
+
};
|
|
659
|
+
import type { readparallelgroup, sessionreusegrant, warmselectorrecord } from "./types.js";
|
|
660
|
+
/**
|
|
661
|
+
* Runparallel logic of the 1.1.69 family.
|
|
662
|
+
* The readparallel groups the independent page reads of one run into parallel lanes and joins the lanes before the dependent steps, the warmselectors carry the validated selectors between adjacent steps and revalidate on a fingerprint change only, and the sessionreuse attaches an authenticated profile to a run on its explicit per profile consent while it isolates the cookies per task through separate containers.
|
|
663
|
+
* The parallel lanes, the carried selectors and the reused sessions optimize the run only: every read, every resolution and every attached profile stays inside the reviewed plan and its consent gates.
|
|
664
|
+
*/
|
|
665
|
+
/** Groups the independent page reads of one run into parallel lanes: every read runs in its own lane while the user chosen lane ceiling keeps the waves bounded, and an absent ceiling keeps every lane open. */
|
|
666
|
+
export declare function readparallelgroupof(input: {
|
|
667
|
+
runid: string;
|
|
668
|
+
reads: Array<{
|
|
669
|
+
stepid: string;
|
|
670
|
+
origin: string;
|
|
671
|
+
}>;
|
|
672
|
+
lanes?: number;
|
|
673
|
+
}): readparallelgroup;
|
|
674
|
+
/** Joins one readparallel group before its dependent steps: every lane completes before the dependent step runs. */
|
|
675
|
+
export declare function joinlanes(group: readparallelgroup): readparallelgroup;
|
|
676
|
+
/** Reads the lanes of one readparallel group that still run, so the join waits on the open lanes alone. */
|
|
677
|
+
export declare function openlanes(group: readparallelgroup): Array<{
|
|
678
|
+
stepid: string;
|
|
679
|
+
origin: string;
|
|
680
|
+
}>;
|
|
681
|
+
/** Carries one validated selector to the adjacent step: the record holds the resolution and the page fingerprint the resolution stays valid under. */
|
|
682
|
+
export declare function carrywarmselector(input: {
|
|
683
|
+
selector: string;
|
|
684
|
+
resolution: string;
|
|
685
|
+
fingerprint: string;
|
|
686
|
+
from: string;
|
|
687
|
+
}): warmselectorrecord;
|
|
688
|
+
/** Reads whether one carried selector stays valid: the carry holds while the page fingerprint stays unchanged, and only a fingerprint change revalidates the selector. */
|
|
689
|
+
export declare function warmselectorcarryvalid(input: {
|
|
690
|
+
record: warmselectorrecord;
|
|
691
|
+
fingerprint: string;
|
|
692
|
+
}): {
|
|
693
|
+
carry: boolean;
|
|
694
|
+
reason: string;
|
|
695
|
+
};
|
|
696
|
+
/** Builds one sessionreuse grant: the authenticated profile attaches to a run only through its explicit per profile consent prompt. */
|
|
697
|
+
export declare function sessionreusegrantof(input: {
|
|
698
|
+
profile: string;
|
|
699
|
+
container: string;
|
|
700
|
+
promptid: string;
|
|
701
|
+
consentedat: number;
|
|
702
|
+
runid?: string;
|
|
703
|
+
}): sessionreusegrant;
|
|
704
|
+
/** Reads the container name of one task under one profile so the sessionreuse isolates the cookies per task through separate containers. */
|
|
705
|
+
export declare function sessioncontainerof(input: {
|
|
706
|
+
profile: string;
|
|
707
|
+
taskid: string;
|
|
708
|
+
}): string;
|
|
709
|
+
import type { backgroundqueueentry } from "./types.js";
|
|
710
|
+
/**
|
|
711
|
+
* Background run queue logic of the 1.1.66 family.
|
|
712
|
+
* The queue that keeps workflows executing with no open surface lives here: each entry holds one reviewed workflow the user queued, the queue hands the entries to the executor one at a time in their queued order, a running entry holds the keepalive signal of 1.1.60 for its whole duration, the interrupted entries of a restart requeue for the recovery, and every state transition feeds the attentionfeed through the statusbadge.
|
|
713
|
+
* The queue never starts an unreviewed workflow: a queued entry needs its approved review state exactly like a foreground run.
|
|
714
|
+
*/
|
|
715
|
+
/** Builds one background queue entry: the workflow stays queued until the executor picks it while no keepalive signal is held yet. */
|
|
716
|
+
export declare function backgroundqueueentryof(input: {
|
|
717
|
+
workflowid: string;
|
|
718
|
+
summary: string;
|
|
719
|
+
now: number;
|
|
720
|
+
}): backgroundqueueentry;
|
|
721
|
+
/** Enqueues one workflow for a background run: the queue keeps its order and one workflow may wait more than once. */
|
|
722
|
+
export declare function enqueuebackgroundrun(input: {
|
|
723
|
+
queue: backgroundqueueentry[];
|
|
724
|
+
workflowid: string;
|
|
725
|
+
summary: string;
|
|
726
|
+
now: number;
|
|
727
|
+
}): backgroundqueueentry[];
|
|
728
|
+
/** Reads the next queued entry of the queue in its queued order; an empty queue returns undefined. */
|
|
729
|
+
export declare function nextbackgroundrun(queue: backgroundqueueentry[]): backgroundqueueentry | undefined;
|
|
730
|
+
/** Begins one background run: the entry moves to running and holds the keepalive signal for its whole duration behind the background run gate. */
|
|
731
|
+
export declare function beginbackgroundrun(entry: backgroundqueueentry, now: number, reviewed: boolean): {
|
|
732
|
+
entry: backgroundqueueentry;
|
|
733
|
+
gate: {
|
|
734
|
+
allowed: boolean;
|
|
735
|
+
reason: string;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
/** Finishes one background run: the entry reaches its terminal state and releases the keepalive hold it carried. */
|
|
739
|
+
export declare function finishbackgroundrun(entry: backgroundqueueentry, state: "done" | "failed", now: number): backgroundqueueentry;
|
|
740
|
+
/** Reads the restart recovery state of the queue: every running entry of an interrupted worker requeues while the terminal entries keep their state for the audit. */
|
|
741
|
+
export declare function resumebackgroundqueue(queue: backgroundqueueentry[], now: number): {
|
|
742
|
+
queue: backgroundqueueentry[];
|
|
743
|
+
requeued: string[];
|
|
744
|
+
};
|
|
745
|
+
/** Reads the attention descriptor of one background queue entry: a failed entry feeds the attentionfeed while a queued entry defers until the executor turn frees. */
|
|
746
|
+
export declare function backgroundrunattention(entry: backgroundqueueentry, origin: string): {
|
|
747
|
+
cause: "failure" | "deferral";
|
|
748
|
+
runid: string;
|
|
749
|
+
origin: string;
|
|
750
|
+
summary: string;
|
|
751
|
+
} | undefined;
|
|
752
|
+
/** Reads the dashboard view of the background queue: one row per entry with its state and its progress by the workflow step count. */
|
|
753
|
+
export declare function backgroundrunsview(queue: backgroundqueueentry[]): Array<{
|
|
754
|
+
id: string;
|
|
755
|
+
workflowid: string;
|
|
756
|
+
state: string;
|
|
757
|
+
keepaliveheld: boolean;
|
|
758
|
+
queuedat: number;
|
|
759
|
+
startedat?: number;
|
|
760
|
+
endedat?: number;
|
|
761
|
+
summary: string;
|
|
762
|
+
progress: string;
|
|
763
|
+
}>;
|
|
764
|
+
/** Reads the recenttray rows of the finished background runs: the tray grows its background section from the terminal entries of the queue. */
|
|
765
|
+
export declare function backgroundtrayrows(queue: backgroundqueueentry[], origin: string): Array<{
|
|
766
|
+
runid: string;
|
|
767
|
+
origin: string;
|
|
768
|
+
outcome: "running" | "completed" | "halted" | "failed";
|
|
769
|
+
title: string;
|
|
770
|
+
at: number;
|
|
771
|
+
resumable: boolean;
|
|
772
|
+
reopenable: boolean;
|
|
773
|
+
}>;
|
|
774
|
+
/** Cancels one queued entry of the background queue: a running entry keeps its executor path and only a queued entry leaves through the queue. */
|
|
775
|
+
export declare function cancelbackgroundentry(queue: backgroundqueueentry[], id: string): {
|
|
776
|
+
queue: backgroundqueueentry[];
|
|
777
|
+
cancelled: string[];
|
|
778
|
+
};
|
|
779
|
+
//# sourceMappingURL=run.d.ts.map
|