@wenathlan/devthink 2.0.14 → 2.0.19

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.
Files changed (444) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/{dist/bridge.d.ts → bridge.d.ts} +1 -1
  3. package/bridge.d.ts.map +1 -0
  4. package/bridge.js +1877 -0
  5. package/bun.d.ts.map +1 -0
  6. package/bun.js +52329 -0
  7. package/caps/background.json +712 -0
  8. package/caps/cli.json +360 -0
  9. package/caps/library.json +3611 -0
  10. package/caps/mcp.json +126 -0
  11. package/caps/pagebridge.json +377 -0
  12. package/caps/popup.json +51 -0
  13. package/caps/sidepanel.json +522 -0
  14. package/checksums.txt +142 -0
  15. package/cli.d.ts.map +1 -0
  16. package/{dist/cli.js → cli.js} +2 -2
  17. package/companion.d.ts.map +1 -0
  18. package/companion.js +389 -0
  19. package/crossbrowser.d.ts.map +1 -0
  20. package/crossbrowser.js +1191 -0
  21. package/dashdone.d.ts.map +1 -0
  22. package/dashdone.js +368 -0
  23. package/deno.d.ts.map +1 -0
  24. package/deno.js +52325 -0
  25. package/devthink.umd.js +52346 -0
  26. package/fixtures/bun.ts +7 -0
  27. package/fixtures/cjs.js +6 -0
  28. package/fixtures/deno.ts +6 -0
  29. package/fixtures/example-org-pagestate.json +22 -0
  30. package/fixtures/importers/automa-workflow.json +18 -0
  31. package/fixtures/importers/selenium-side.json +20 -0
  32. package/fixtures/importers/tabular-plan.csv +7 -0
  33. package/fixtures/importers/uivision-macro.json +10 -0
  34. package/fixtures/importers/v1-plan.json +13 -0
  35. package/fixtures/mcp-client.mjs +14 -0
  36. package/fixtures/pages/checkout.html +192 -0
  37. package/fixtures/pages/dashboard.html +110 -0
  38. package/fixtures/pages/feed.html +113 -0
  39. package/fixtures/pages/product-grid.html +150 -0
  40. package/fixtures/plans/form-inventory-plan.json +11 -0
  41. package/fixtures/plans/release-notes-plan.json +11 -0
  42. package/fixtures/recipes/agentscompete.json +11 -0
  43. package/fixtures/recipes/agentsforms.json +11 -0
  44. package/fixtures/recipes/agentsmonitor.json +11 -0
  45. package/fixtures/recipes/agentsreview.json +29 -0
  46. package/fixtures/recipes/agentswarm.json +11 -0
  47. package/fixtures/recipes/fillcalendar.json +12 -0
  48. package/fixtures/recipes/fillcheckout.json +13 -0
  49. package/fixtures/recipes/filldependentdropdowns.json +12 -0
  50. package/fixtures/recipes/fillfromcsv.json +13 -0
  51. package/fixtures/recipes/fillloginform.json +12 -0
  52. package/fixtures/recipes/fillmultistepwizard.json +13 -0
  53. package/fixtures/recipes/fillregistration.json +12 -0
  54. package/fixtures/recipes/fillsearchfilters.json +12 -0
  55. package/fixtures/recipes/filltypeahead.json +11 -0
  56. package/fixtures/recipes/monitoralerts.json +12 -0
  57. package/fixtures/recipes/monitoravailability.json +11 -0
  58. package/fixtures/recipes/monitornetworkquiet.json +12 -0
  59. package/fixtures/recipes/monitorpagechanges.json +11 -0
  60. package/fixtures/recipes/monitorpricechange.json +11 -0
  61. package/fixtures/recipes/monitorschedule.json +12 -0
  62. package/fixtures/recipes/scrapedynamicprices.json +13 -0
  63. package/fixtures/recipes/scrapeimagegallery.json +12 -0
  64. package/fixtures/recipes/scrapeinfinitefeed.json +13 -0
  65. package/fixtures/recipes/scrapenestedlists.json +12 -0
  66. package/fixtures/recipes/scrapeproductgrid.json +12 -0
  67. package/fixtures/recipes/scrapereviews.json +12 -0
  68. package/fixtures/recipes/scrapesearchresults.json +12 -0
  69. package/fixtures/recipes/scrapetablepagination.json +12 -0
  70. package/fixtures/recipes/testaccessibility.json +34 -0
  71. package/fixtures/recipes/testconsoleerrors.json +12 -0
  72. package/fixtures/recipes/testdeeplinks.json +12 -0
  73. package/fixtures/recipes/testformvalidation.json +13 -0
  74. package/fixtures/recipes/testlayoutshift.json +12 -0
  75. package/fixtures/recipes/testlinkcheck.json +12 -0
  76. package/fixtures/recipes/testloadtiming.json +12 -0
  77. package/fixtures/recipes/testvisualdiff.json +12 -0
  78. package/fixtures/workflows/changelog-digest-workflow.json +13 -0
  79. package/fixtures/workflows/form-survey-workflow.json +13 -0
  80. package/gallery.json +706 -0
  81. package/hardening.d.ts.map +1 -0
  82. package/hardening.js +188 -0
  83. package/headless.d.ts.map +1 -0
  84. package/headless.js +11522 -0
  85. package/http.d.ts.map +1 -0
  86. package/http.js +2165 -0
  87. package/index.cjs +54682 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +52310 -0
  90. package/index.neutral.js +46343 -0
  91. package/{web/manifest.json → manifest.json} +1 -1
  92. package/mcp.d.ts.map +1 -0
  93. package/mcp.js +20515 -0
  94. package/memory.d.ts.map +1 -0
  95. package/{memory.ts → memory.js} +2310 -3834
  96. package/nativehost.template.json +10 -0
  97. package/node.cjs +54686 -0
  98. package/node.d.ts.map +1 -0
  99. package/pack.d.ts.map +1 -0
  100. package/pack.js +805 -0
  101. package/package.json +83 -176
  102. package/policy.d.ts.map +1 -0
  103. package/{policy.ts → policy.js} +4679 -5073
  104. package/progress.d.ts.map +1 -0
  105. package/progress.js +645 -0
  106. package/protocol.d.ts.map +1 -0
  107. package/protocol.js +8334 -0
  108. package/schemas/audit.schema.json +226 -0
  109. package/schemas/capability.schema.json +113 -0
  110. package/schemas/envelope.schema.json +162 -0
  111. package/schemas/memory.schema.json +51 -0
  112. package/schemas/observation.schema.json +113 -0
  113. package/schemas/plan.schema.json +208 -0
  114. package/schemas/progress.schema.json +126 -0
  115. package/schemas/proposal.schema.json +68 -0
  116. package/schemas/session.schema.json +82 -0
  117. package/schemas/tool.schema.json +94 -0
  118. package/server.d.ts.map +1 -0
  119. package/server.js +28877 -0
  120. package/umd-example.html +18 -0
  121. package/umd.d.ts.map +1 -0
  122. package/accounts.ts +0 -2087
  123. package/agent.ts +0 -2331
  124. package/antigravity.ts +0 -2139
  125. package/apifreeze.ts +0 -4146
  126. package/auth.ts +0 -642
  127. package/background.ts +0 -16837
  128. package/bridge.ts +0 -2080
  129. package/build.ts +0 -54
  130. package/bun.ts +0 -26
  131. package/capture.ts +0 -1614
  132. package/checksecrets.ts +0 -72
  133. package/cjs.ts +0 -9
  134. package/cli.ts +0 -3500
  135. package/commands.ts +0 -1101
  136. package/companion.ts +0 -450
  137. package/compatibility.ts +0 -37
  138. package/config.ts +0 -3137
  139. package/constants.ts +0 -943
  140. package/core.ts +0 -1473
  141. package/crossbrowser.ts +0 -1359
  142. package/dashdone.ts +0 -605
  143. package/data.ts +0 -943
  144. package/database.ts +0 -133
  145. package/debug.ts +0 -850
  146. package/deno.ts +0 -27
  147. package/devthink.ts +0 -707
  148. package/dist/accounts.d.ts +0 -409
  149. package/dist/agent.d.ts +0 -837
  150. package/dist/antigravity.d.ts +0 -380
  151. package/dist/apifreeze.d.ts +0 -113
  152. package/dist/auth.d.ts +0 -224
  153. package/dist/capture.d.ts +0 -595
  154. package/dist/cjs.d.ts +0 -6
  155. package/dist/commands.d.ts +0 -310
  156. package/dist/compatibility.d.ts +0 -17
  157. package/dist/config.d.ts +0 -1853
  158. package/dist/constants.d.ts +0 -637
  159. package/dist/core.d.ts +0 -361
  160. package/dist/data.d.ts +0 -330
  161. package/dist/database.d.ts +0 -24
  162. package/dist/debug.d.ts +0 -270
  163. package/dist/engine.d.ts +0 -74
  164. package/dist/environments.d.ts +0 -244
  165. package/dist/evidence.d.ts +0 -277
  166. package/dist/export.d.ts +0 -311
  167. package/dist/fingerprint.d.ts +0 -594
  168. package/dist/flow.d.ts +0 -300
  169. package/dist/gates.d.ts +0 -103
  170. package/dist/identity.d.ts +0 -51
  171. package/dist/ids.d.ts +0 -7
  172. package/dist/llm.d.ts +0 -652
  173. package/dist/models.d.ts +0 -1807
  174. package/dist/net.d.ts +0 -325
  175. package/dist/neutral.d.ts +0 -41
  176. package/dist/oauth.d.ts +0 -703
  177. package/dist/page.d.ts +0 -1166
  178. package/dist/perf.d.ts +0 -481
  179. package/dist/plan.d.ts +0 -134
  180. package/dist/project.d.ts +0 -395
  181. package/dist/providers.d.ts +0 -37
  182. package/dist/quota.d.ts +0 -453
  183. package/dist/recovery.d.ts +0 -621
  184. package/dist/request.d.ts +0 -1492
  185. package/dist/run.d.ts +0 -779
  186. package/dist/runtime.d.ts +0 -212
  187. package/dist/search.d.ts +0 -375
  188. package/dist/security.d.ts +0 -534
  189. package/dist/serve.d.ts +0 -136
  190. package/dist/session.d.ts +0 -296
  191. package/dist/storage.d.ts +0 -53
  192. package/dist/streaming.d.ts +0 -1119
  193. package/dist/swarm.d.ts +0 -328
  194. package/dist/tools.d.ts +0 -170
  195. package/dist/types.d.ts +0 -8357
  196. package/dist/utils.d.ts +0 -82
  197. package/dist/version.d.ts +0 -7
  198. package/dist/versionregistry.d.ts +0 -406
  199. package/dist/views.d.ts +0 -579
  200. package/dist/workbenchsession.d.ts +0 -69
  201. package/dist/workflow.d.ts +0 -649
  202. package/docs/readme.md +0 -92
  203. package/docs/schemas/antigravity.json +0 -192
  204. package/engine.ts +0 -1524
  205. package/environments.ts +0 -1005
  206. package/evidence.ts +0 -643
  207. package/export.ts +0 -889
  208. package/fingerprint.ts +0 -1458
  209. package/flow.ts +0 -1190
  210. package/gates.ts +0 -307
  211. package/gateway.ts +0 -34
  212. package/hardening.ts +0 -191
  213. package/headless.ts +0 -369
  214. package/http.ts +0 -2110
  215. package/identity.ts +0 -246
  216. package/ids.ts +0 -26
  217. package/index.ts +0 -369
  218. package/llm.ts +0 -2682
  219. package/mcp.ts +0 -1835
  220. package/models.ts +0 -3805
  221. package/modes.ts +0 -43
  222. package/net.ts +0 -1214
  223. package/neutral.ts +0 -362
  224. package/node.ts +0 -26
  225. package/oauth.ts +0 -2216
  226. package/offscreen.ts +0 -170
  227. package/pack.ts +0 -956
  228. package/page.ts +0 -7824
  229. package/pagebridge.ts +0 -1116
  230. package/perf.ts +0 -957
  231. package/plan.ts +0 -672
  232. package/plugin.ts +0 -76
  233. package/prisma.config.ts +0 -27
  234. package/progress.ts +0 -1308
  235. package/project.ts +0 -1291
  236. package/protocol.ts +0 -4187
  237. package/providers.ts +0 -246
  238. package/quota.ts +0 -1887
  239. package/recovery.ts +0 -2433
  240. package/request.ts +0 -4482
  241. package/run.ts +0 -2135
  242. package/runtime.ts +0 -526
  243. package/search.ts +0 -1760
  244. package/security.ts +0 -1673
  245. package/serve.ts +0 -419
  246. package/server.ts +0 -5538
  247. package/session.ts +0 -1162
  248. package/storage.ts +0 -182
  249. package/streaming.ts +0 -4101
  250. package/swarm.ts +0 -884
  251. package/sync.ts +0 -56
  252. package/tests/agentcert.test.ts +0 -128
  253. package/tests/agentfleet.test.ts +0 -214
  254. package/tests/agentreview.test.ts +0 -241
  255. package/tests/agentstream.test.ts +0 -335
  256. package/tests/agentwork.test.ts +0 -356
  257. package/tests/apifreeze.test.ts +0 -290
  258. package/tests/apimap.test.ts +0 -112
  259. package/tests/approvalgate.test.ts +0 -175
  260. package/tests/artifactmanifest.test.ts +0 -204
  261. package/tests/attentionfeed.test.ts +0 -163
  262. package/tests/backgroundruns.test.ts +0 -100
  263. package/tests/batchscheduling.test.ts +0 -131
  264. package/tests/blackboard.test.ts +0 -238
  265. package/tests/bridge.test.ts +0 -1088
  266. package/tests/browsercoverage.test.ts +0 -134
  267. package/tests/browserpolyfills.test.ts +0 -124
  268. package/tests/build.mjs +0 -1260
  269. package/tests/clientauth.test.ts +0 -223
  270. package/tests/clitools.test.ts +0 -578
  271. package/tests/confirmgates.test.ts +0 -190
  272. package/tests/containerpack.test.ts +0 -143
  273. package/tests/controlflow.test.ts +0 -2120
  274. package/tests/coordination.test.ts +0 -345
  275. package/tests/copyscreen.test.ts +0 -139
  276. package/tests/core.test.ts +0 -417
  277. package/tests/costcert.test.ts +0 -95
  278. package/tests/crossbrowser.test.ts +0 -115
  279. package/tests/cspaudit.test.ts +0 -79
  280. package/tests/dashdone.test.ts +0 -615
  281. package/tests/datagrid.test.ts +0 -137
  282. package/tests/doccheck.test.ts +0 -107
  283. package/tests/dombatch.test.ts +0 -109
  284. package/tests/emulation.test.ts +0 -282
  285. package/tests/environments.test.ts +0 -259
  286. package/tests/evidenceviews.test.ts +0 -88
  287. package/tests/exporttools.test.ts +0 -185
  288. package/tests/firefoxprep.test.ts +0 -134
  289. package/tests/flowlibrary.test.ts +0 -242
  290. package/tests/flowrun.test.ts +0 -303
  291. package/tests/forensics.test.ts +0 -439
  292. package/tests/gateway.test.ts +0 -939
  293. package/tests/headlesslib.test.ts +0 -171
  294. package/tests/httpstream.test.ts +0 -277
  295. package/tests/immutablelog.test.ts +0 -157
  296. package/tests/inboundguard.test.ts +0 -177
  297. package/tests/lazyload.test.ts +0 -72
  298. package/tests/librarymodes.test.ts +0 -623
  299. package/tests/llm.test.ts +0 -696
  300. package/tests/manifest.test.ts +0 -226
  301. package/tests/maskinputs.test.ts +0 -150
  302. package/tests/matrixverify.test.ts +0 -111
  303. package/tests/mavenpack.test.ts +0 -75
  304. package/tests/mcpserver.test.ts +0 -704
  305. package/tests/memory.test.ts +0 -4155
  306. package/tests/memorycare.test.ts +0 -230
  307. package/tests/migrateplan.test.ts +0 -349
  308. package/tests/minimization.test.ts +0 -414
  309. package/tests/modelroute.test.ts +0 -112
  310. package/tests/multiagent.test.ts +0 -440
  311. package/tests/nativebridge.test.ts +0 -807
  312. package/tests/navigation.test.ts +0 -284
  313. package/tests/nugetpack.test.ts +0 -83
  314. package/tests/orchestration.test.ts +0 -449
  315. package/tests/originpolicy.test.ts +0 -405
  316. package/tests/outputcompare.test.ts +0 -97
  317. package/tests/package.test.ts +0 -91
  318. package/tests/pagebridge.test.ts +0 -5909
  319. package/tests/pentest.test.ts +0 -75
  320. package/tests/perfrecords.test.ts +0 -257
  321. package/tests/permdiff.test.ts +0 -85
  322. package/tests/phishguard.test.ts +0 -128
  323. package/tests/pickerviews.test.ts +0 -155
  324. package/tests/pipelines.test.ts +0 -381
  325. package/tests/planlint.test.ts +0 -240
  326. package/tests/planreview.test.ts +0 -383
  327. package/tests/platformtargets.test.ts +0 -56
  328. package/tests/policy.test.ts +0 -8284
  329. package/tests/portability.test.ts +0 -96
  330. package/tests/progress.test.ts +0 -1036
  331. package/tests/promptlibrary.test.ts +0 -116
  332. package/tests/protocol.test.ts +0 -4793
  333. package/tests/publishingpipeline.test.ts +0 -314
  334. package/tests/quickactions.test.ts +0 -164
  335. package/tests/readiness.test.ts +0 -78
  336. package/tests/recipes.test.ts +0 -163
  337. package/tests/redactshots.test.ts +0 -216
  338. package/tests/registernvidiakeys.ts +0 -51
  339. package/tests/relayserve.test.ts +0 -304
  340. package/tests/releasenotes.test.ts +0 -276
  341. package/tests/resilience.test.ts +0 -467
  342. package/tests/resourceaware.test.ts +0 -187
  343. package/tests/runbudget.test.ts +0 -125
  344. package/tests/runhistory.test.ts +0 -299
  345. package/tests/runreplay.test.ts +0 -113
  346. package/tests/runresume.test.ts +0 -184
  347. package/tests/runstate.test.ts +0 -288
  348. package/tests/runtimeadapters.test.ts +0 -251
  349. package/tests/safariskeleton.test.ts +0 -115
  350. package/tests/sandboxframe.test.ts +0 -196
  351. package/tests/sbom.test.ts +0 -105
  352. package/tests/secretvault.test.ts +0 -188
  353. package/tests/selcache.test.ts +0 -111
  354. package/tests/sessioninterface.test.ts +0 -791
  355. package/tests/sessions.test.ts +0 -591
  356. package/tests/siteprefs.test.ts +0 -228
  357. package/tests/snapshotdelta.test.ts +0 -165
  358. package/tests/statusviews.test.ts +0 -237
  359. package/tests/stepmeter.test.ts +0 -200
  360. package/tests/streamparse.test.ts +0 -163
  361. package/tests/stylepruning.test.ts +0 -90
  362. package/tests/surfaces.test.ts +0 -282
  363. package/tests/sweep.test.ts +0 -78
  364. package/tests/syncbridge.test.ts +0 -164
  365. package/tests/taskqueue.test.ts +0 -206
  366. package/tests/toolcalls.test.ts +0 -336
  367. package/tests/toolcatalog.test.ts +0 -201
  368. package/tests/torture-agent.test.ts +0 -706
  369. package/tests/torture-auth.test.ts +0 -461
  370. package/tests/torture-commands.test.ts +0 -895
  371. package/tests/torture-data.test.ts +0 -923
  372. package/tests/torture-environments.test.ts +0 -285
  373. package/tests/torture-export.test.ts +0 -263
  374. package/tests/torture-http.test.ts +0 -1379
  375. package/tests/torture-llm.test.ts +0 -808
  376. package/tests/torture-memory.test.ts +0 -1084
  377. package/tests/torture-plan.test.ts +0 -829
  378. package/tests/torture-run.test.ts +0 -626
  379. package/tests/torture-session.test.ts +0 -928
  380. package/tests/torture-swarm.test.ts +0 -1245
  381. package/tests/torture-tools.test.ts +0 -964
  382. package/tests/torture-workflow.test.ts +0 -2354
  383. package/tests/tourviews.test.ts +0 -52
  384. package/tests/transparency.test.ts +0 -147
  385. package/tests/trigger.test.ts +0 -941
  386. package/tests/v1sunset.test.ts +0 -428
  387. package/tests/virtlist.test.ts +0 -94
  388. package/tests/vision.test.ts +0 -540
  389. package/tests/vsixpack.test.ts +0 -145
  390. package/tests/webapi.test.ts +0 -523
  391. package/tests/workflow.test.ts +0 -1785
  392. package/tests/workfloweditor.test.ts +0 -759
  393. package/tests/xpipack.test.ts +0 -128
  394. package/tools.ts +0 -734
  395. package/types.ts +0 -9908
  396. package/umd.ts +0 -9
  397. package/utils.ts +0 -249
  398. package/version.ts +0 -8
  399. package/versionregistry.ts +0 -1310
  400. package/views.ts +0 -2153
  401. package/vitest.config.ts +0 -12
  402. package/web/App.tsx +0 -78
  403. package/web/README.md +0 -47
  404. package/web/capacitor.config.ts +0 -46
  405. package/web/const.ts +0 -19
  406. package/web/control.shell.tsx +0 -66
  407. package/web/dashboardpage.ts +0 -554
  408. package/web/db.ts +0 -493
  409. package/web/design.html +0 -541
  410. package/web/gatewayview/Gateway.tsx +0 -345
  411. package/web/gatewayview/config.ts +0 -1042
  412. package/web/gatewayview/definition.ts +0 -174
  413. package/web/icons.ts +0 -15
  414. package/web/optionspage.ts +0 -691
  415. package/web/popup.ts +0 -1651
  416. package/web/schema.prisma +0 -176
  417. package/web/sidepanel.ts +0 -7941
  418. package/web/sitemanifest.json +0 -13
  419. package/web/terminal-ui.tsx +0 -622
  420. package/web/transparencypage.ts +0 -541
  421. package/web/vite.config.ts +0 -39
  422. package/web/workspace.ts +0 -23
  423. package/workbenchmemory.ts +0 -104
  424. package/workbenchsession.ts +0 -304
  425. package/workflow.ts +0 -4495
  426. /package/{dist/bun.d.ts → bun.d.ts} +0 -0
  427. /package/{dist/cli.d.ts → cli.d.ts} +0 -0
  428. /package/{dist/companion.d.ts → companion.d.ts} +0 -0
  429. /package/{dist/crossbrowser.d.ts → crossbrowser.d.ts} +0 -0
  430. /package/{dist/dashdone.d.ts → dashdone.d.ts} +0 -0
  431. /package/{dist/deno.d.ts → deno.d.ts} +0 -0
  432. /package/{dist/hardening.d.ts → hardening.d.ts} +0 -0
  433. /package/{dist/headless.d.ts → headless.d.ts} +0 -0
  434. /package/{dist/http.d.ts → http.d.ts} +0 -0
  435. /package/{dist/index.d.ts → index.d.ts} +0 -0
  436. /package/{dist/mcp.d.ts → mcp.d.ts} +0 -0
  437. /package/{dist/memory.d.ts → memory.d.ts} +0 -0
  438. /package/{dist/node.d.ts → node.d.ts} +0 -0
  439. /package/{dist/pack.d.ts → pack.d.ts} +0 -0
  440. /package/{dist/policy.d.ts → policy.d.ts} +0 -0
  441. /package/{dist/progress.d.ts → progress.d.ts} +0 -0
  442. /package/{dist/protocol.d.ts → protocol.d.ts} +0 -0
  443. /package/{dist/server.d.ts → server.d.ts} +0 -0
  444. /package/{dist/umd.d.ts → umd.d.ts} +0 -0
package/dist/run.d.ts DELETED
@@ -1,779 +0,0 @@
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