@wenathlan/devthink 2.0.15 → 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 +45 -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
@@ -1,649 +0,0 @@
1
- /**
2
- * The workflow module of the 1.1.90 consolidation: every correlated variation of the workflow engine, its control constructs, its triggers and its editor interned in this one file, so the module family carries one surface without duplicate variations — the workflow and controlflow modules import each other today, and the merge resolves that circular import by making the engine base and its control constructs one module.
3
- * The correlation is the workflow family: workflow holds the engine base (the step, block and template normalizers, the composition that validates and freezes a step list, the block expansion that hides no step from review, the typed scope stack with shadowing, the variable bindings, the expression arithmetic with coercion refusals, the regex extraction, the seeded delay jitter, the run loop with per step checkpoints, the pause, resume and cancel transitions and the pure dry run); controlflow holds the control constructs the engine executes (the condition, branch, loop, repeatuntil, while, foreach, parallel and trycatch steps with their bounds, the retry policy with its backoff, the timeout aborts and the seeded control random); trigger holds the rule kinds that arm, schedule, match and fire the reviewed workflows (the cooldowns, the cron and calendar parts, the webhook verification and the manual run confirmation); and workfloweditor holds the editor surface (the palette and step library, the canvas layout with snap, reorder and group select, the undo and redo history, the minimap, the breakpoints, the version diff, the import and export in the reviewed file format and the site overrides).
4
- * No loop bound, retry policy, cooldown or cron field is ever hardcoded beyond the documented grammar: every bound stays the user's choice, and no workflow, trigger or editor path ever bypasses the human review.
5
- */
6
- import type { actionrisk, blockinvocation, delaystep, expressiontype, nestedparam, regexrule, runlogentry, steptemplate, variablebinding, variablekind, variablescope, variablevalue, watchdogconfig, workflowblock, workflowrecord, workflowrun, workflowstep, stepoutcome, branchoutcome, branchstep, conditionstep, controlflowdecision, errorhandler, foreachstep, joinrecord, loopstep, parallelstep, repeatuntilstep, retrypolicy, retryattempt, timeoutabort, trystep, whilestep, manualrun, rulestats, triggerfamily, triggerfire, triggerstate, triggerule, editoredge, editormodel, editorlayout, exportformat, minimapstate, palettecategory, palettenode, siteoverride, steplibraryentry, versiondiff, workflowfile } from "./types.js";
7
- /**
8
- * Workflow engine for the 1.1.50 family.
9
- * Every correlated rule for the reviewed step composition lives in this file: the workflow kind list, the step, block and template normalizers, the composition that validates and freezes a step list, the block expansion that hides no step from review, the pre-run validation of kinds, scopes and bindings, the typed scope stack with shadowing, the variable bindings that link step outputs to names, the expression arithmetic with coercion refusals, the regex extraction with honest no match outcomes, the seeded delay jitter, the run loop with per step checkpoints, the single step execution, the pause, resume and cancel transitions and the pure dry run with read only projections.
10
- * The engine stays pure: every page, browser and storage effect flows through the injected executor so tests run on plain fixtures, and the risk grading flows through the injected risk callback so the policy table stays the single source of truth.
11
- */
12
- /** The workflow kinds of the 1.1.50 family: composition, templates, runs, dry runs, jittered delays, element waits, expressions and variable extraction. */
13
- export declare const workflowkinds: string[];
14
- /** The outcome the injected executor returns for one workflow step: control flow executors also return the merged scopes and the iteration runlog entries so the run loop adopts them. */
15
- export type stepexecution = {
16
- ok: boolean;
17
- summary: string;
18
- details?: Record<string, unknown>;
19
- scopes?: variablescope[];
20
- log?: runlogentry[];
21
- };
22
- /** Normalizes one workflow step: id, kind, label, the optional target, value and JSON options, the output bindings, the inline expression, the inline regex rule, the breakpoint marker and the nested block parameters. */
23
- export declare function workflowstepof(value: unknown): workflowstep | undefined;
24
- /** Normalizes one block invocation: the referenced block name and the human readable label. */
25
- export declare function blockinvocationof(value: unknown): blockinvocation | undefined;
26
- /** Normalizes one reusable workflow block: the unique name, the label and the child steps with nested block invocations. */
27
- export declare function workflowblockof(value: unknown): workflowblock | undefined;
28
- /** Normalizes one shareable step template: the id, the unique name, the origin, the step and the share time. */
29
- export declare function steptemplateof(value: unknown): steptemplate | undefined;
30
- /** The reviewed expression operators of the workflow grammar. */
31
- export declare const expressionoperators: string[];
32
- /** Normalizes one reviewed expression: the operands, the operator and the result variable with its result kind. */
33
- export declare function expressionof(value: unknown): expressiontype | undefined;
34
- /** Normalizes one reviewed regex rule: the pattern, the flag set and the named capture group list. */
35
- export declare function regexruleof(value: unknown): regexrule | undefined;
36
- /** Flattens nested blocks into one executable step list; every flattened step carries the innermost block name so runs highlight the active block, and the nested parameters of an invocation stamp onto the first step of its region so the run binds them into the block scope. Unknown or cyclic block references are refused. */
37
- export declare function expandblocks(steps: Array<workflowstep | blockinvocation>, blocks: workflowblock[]): workflowstep[];
38
- /** Composes one workflow record: validates the name, version, origin grants, steps and blocks, expands every block so no step stays hidden, grades the review risk through the injected risk table and freezes the result. */
39
- export declare function composeworkflow(input: {
40
- id?: string;
41
- name: string;
42
- version: number;
43
- origins: string[];
44
- steps: Array<workflowstep | blockinvocation>;
45
- blocks?: workflowblock[];
46
- now: number;
47
- kindallowed?: (kind: string) => boolean;
48
- riskof?: (kind: string) => actionrisk;
49
- }): workflowrecord;
50
- /** Validates a composed workflow before any run: the expanded step list, every step kind against the injected allowlist, the bindings against earlier steps and every variable reference against the bindings, the inputs and the root scope. */
51
- export declare function validateworkflow(record: workflowrecord, options?: {
52
- kindallowed?: (kind: string) => boolean;
53
- inputs?: string[];
54
- }): {
55
- allowed: boolean;
56
- reason?: string;
57
- };
58
- /** Opens one child scope for a block invocation; the parent chain stays intact so resolution walks outward. */
59
- export declare function pushscope(scopes: variablescope[], name: string, parent?: string): variablescope[];
60
- /** Closes the newest scope and keeps every parent scope intact. */
61
- export declare function popscope(scopes: variablescope[]): variablescope[];
62
- /** Resolves one variable from the nearest scope outward through the parent chain; shadowing follows the newest scope first. */
63
- export declare function resolvevariable(scopes: variablescope[], name: string): variablevalue | undefined;
64
- /** Writes one variable into the newest scope, replacing a same named value of that scope only. */
65
- export declare function setvariable(scopes: variablescope[], name: string, kind: variablekind, value: string | number | boolean | string[], now: number): variablescope[];
66
- /** Resolves every binding whose source step already produced an outcome into the newest scope; the engine runs this before each step so following steps read fresh values. */
67
- export declare function bindvariables(scopes: variablescope[], bindings: variablebinding[], outputs: Record<string, stepoutcome>, now: number): {
68
- scopes: variablescope[];
69
- produced: string[];
70
- };
71
- /** Evaluates one reviewed expression between variables: arithmetic, comparison and logic operators with operand coercion and mismatched operator refusals, resolving references from the nearest scope outward; list operands join only the contains and length operators while every other operator refuses them at coercion. */
72
- export declare function expressioneval(expression: expressiontype, scopes: variablescope[]): string | number | boolean;
73
- /** Applies one reviewed regex rule to text and stores the named capture groups as string variables; the no match case is an honest outcome instead of a crash. */
74
- export declare function regexextract(rule: regexrule, text: string, now: number): {
75
- matched: boolean;
76
- variables: variablevalue[];
77
- };
78
- /** Plans the element wait polling: how many probe passes fit inside the reviewed timeout window at the reviewed poll interval; a zero timeout or a zero poll interval runs a single immediate probe. */
79
- export declare function waitelementplan(wait: {
80
- timeout: number;
81
- poll: number;
82
- }): {
83
- probes: number;
84
- lastwait: number;
85
- };
86
- /** Samples one delay inside the reviewed jitter window from a seeded random source: the window spans base minus half the jitter to base plus half the jitter and never dips below zero. */
87
- export declare function delayjitter(delay: delaystep, seed: number): number;
88
- /** Deterministic random source of the delay jitter so reviewed windows replay exactly during tests and audits; the seed passes an avalanche mix before the xorshift steps so nearby seeds spread across the whole window. */
89
- export declare function seededrandom(seed: number): number;
90
- /** Builds one new workflow run: pending state, a zero step cursor and the optional dry run flag. */
91
- export declare function newworkflowrun(input: {
92
- id?: string;
93
- workflowid: string;
94
- dryrun?: boolean;
95
- now: number;
96
- }): workflowrun;
97
- /** Pauses one running workflow run at its last checkpoint; the cursor keeps the completed steps so a resume continues exactly there. */
98
- export declare function pauserun(run: workflowrun, now: number): workflowrun;
99
- /** Cancels one workflow run and records the reviewed reason; done and already cancelled runs stay untouched. */
100
- export declare function cancelrun(run: workflowrun, reason: string, now: number): workflowrun;
101
- /** Executes exactly one workflow step outside the run loop: resolves the bindings of earlier steps, evaluates the inline expression and regex rule, interpolates the variable references, dispatches through the injected executor and binds the outcome into the newest scope; a control flow executor returns the merged scopes and its iteration runlog so the step adopts them before its own entry. */
102
- export declare function runstep(input: {
103
- step: workflowstep;
104
- scopes: variablescope[];
105
- outputs: Record<string, stepoutcome>;
106
- execute: (step: workflowstep, context: {
107
- scopes: variablescope[];
108
- block?: string;
109
- outputs?: Record<string, stepoutcome>;
110
- }) => Promise<stepexecution>;
111
- now: number;
112
- block?: string;
113
- }): Promise<{
114
- scopes: variablescope[];
115
- log: runlogentry;
116
- childlog?: runlogentry[];
117
- output: stepexecution;
118
- }>;
119
- /** Advances one workflow run one step at a time: gates the run behind the active session, the approved plan and the origin grants, opens a child scope per block region, checkpoints after every completed step and resumes a paused run from its last checkpoint. */
120
- export declare function runworkflow(input: {
121
- record: workflowrecord;
122
- run: workflowrun;
123
- scopes?: variablescope[];
124
- log?: runlogentry[];
125
- outputs?: Record<string, stepoutcome>;
126
- execute: (step: workflowstep, context: {
127
- scopes: variablescope[];
128
- block?: string;
129
- outputs?: Record<string, stepoutcome>;
130
- }) => Promise<stepexecution>;
131
- now: number;
132
- gates?: {
133
- sessionactive: boolean;
134
- planapproved: boolean;
135
- origingranted: (origin: string) => boolean;
136
- };
137
- oncheckpoint?: (state: {
138
- run: workflowrun;
139
- scopes: variablescope[];
140
- log: runlogentry[];
141
- }) => Promise<void> | void;
142
- }): Promise<{
143
- run: workflowrun;
144
- scopes: variablescope[];
145
- log: runlogentry[];
146
- outputs: Record<string, stepoutcome>;
147
- }>;
148
- /** Evaluates every step of a workflow with no page mutation and no storage write: steps with a read only projection record their would be outcome and every other step is refused in the runlog. */
149
- export declare function dryrunworkflow(input: {
150
- record: workflowrecord;
151
- run: workflowrun;
152
- scopes?: variablescope[];
153
- log?: runlogentry[];
154
- now: number;
155
- projection: (step: workflowstep) => string | undefined;
156
- }): {
157
- run: workflowrun;
158
- scopes: variablescope[];
159
- log: runlogentry[];
160
- };
161
- /** One watchdog verdict of a running workflow run: the verdict, the recovery action the configuration picks and the honest reason. */
162
- export type watchdogverdict = {
163
- runid: string;
164
- verdict: "stalled" | "zombie" | "healthy";
165
- action: "retry" | "pause" | "cancel" | "reap" | "none";
166
- reason: string;
167
- lastcompletedat?: number;
168
- };
169
- /** Scans the running workflow runs for stalled steps and zombie runs: a run grades stalled when no step completed inside the configured threshold and it grades zombie when its executor is gone — a browser shutdown left it running — and the window elapsed; the recovery action stays the reviewed user configuration of retry, pause or cancel while a zombie always reaps. */
170
- export declare function watchdogpass(input: {
171
- runs: workflowrun[];
172
- lastcompletedat: Record<string, number>;
173
- liveexecutors: string[];
174
- config: watchdogconfig;
175
- now: number;
176
- }): watchdogverdict[];
177
- /**
178
- * Control flow engine for the 1.1.51 workflow family.
179
- * Every correlated rule of the second workflow phase lives in this file: the control flow kind list, the condition, branch, loop, repeat until, while, foreach, parallel, join, try and retry payload normalizers, the condition evaluation over extracted values, the branch selection by page state, the loop runners that rebind the item and index per iteration inside the reviewed safety bounds, the parallel runner with isolated branch scopes and the join that merges branch outcomes under the reviewed strategy, the try runner with its catch handler and rerun option, the retry runner with fixed and exponential backoff shapes, the step and run timeout aborts with the cancelled error class, and the control summaries the review panel renders.
180
- * The engine stays pure: child steps dispatch through the injected executor seam, element resolution flows through the injected resolver and page state flows through the injected snapshot accessor, so tests run on plain fixtures and no control construct bypasses the consent gates.
181
- */
182
- /** The control flow kinds of the 1.1.51 family: conditionals, branching, loops, parallel branches with joins and try catch with retries and timeouts. */
183
- export declare const controlflowkinds: string[];
184
- /** The documented default safety bound of the loop family when the review configures none; it is a documented default, never a cap, and any user configured bound wins. */
185
- export declare const defaultloopbound = 1000;
186
- /** The executor seam of the control flow engine: the same seam the run loop uses, extended with the outputs of the earlier steps so child bindings resolve. */
187
- export type controlexecute = (step: workflowstep, context: {
188
- scopes: variablescope[];
189
- block?: string;
190
- outputs?: Record<string, stepoutcome>;
191
- }) => Promise<stepexecution>;
192
- /** True when the kind belongs to the control flow family of the 1.1.51 release. */
193
- export declare function iscontrolflowkind(kind: string): boolean;
194
- /** The cancelled error class of timeout aborts: a step or a whole run cancelled because it exceeded its reviewed budget. */
195
- export declare class cancellederror extends Error {
196
- constructor(message: string);
197
- }
198
- /** Normalizes one condition payload: the reviewed boolean expression tested over the extracted values. */
199
- export declare function conditionof(value: unknown): conditionstep | undefined;
200
- /** Normalizes one branch payload: the unique named paths with their boolean match expressions and the mandatory else path that terminates every branch. */
201
- export declare function branchof(value: unknown): branchstep | undefined;
202
- /** Normalizes one loop payload: the list variable, the item and index variables, the optional safety bound and the non-empty body. */
203
- export declare function loopof(value: unknown): loopstep | undefined;
204
- /** Normalizes one repeat until payload: the convergence expression, the optional safety bound and the non-empty body. */
205
- export declare function repeatuntilof(value: unknown): repeatuntilstep | undefined;
206
- /** Normalizes one while payload: the loop condition, the mandatory safety bound and the non-empty body; a while loop without a bound is refused. */
207
- export declare function whileof(value: unknown): whilestep | undefined;
208
- /** Normalizes one foreach payload: the non-empty selector, the item and index variables and the non-empty body. */
209
- export declare function foreachof(value: unknown): foreachstep | undefined;
210
- /** Normalizes one parallel payload: the uniquely identified branches with non-empty bodies and the join policy. */
211
- export declare function parallelof(value: unknown): parallelstep | undefined;
212
- /** Normalizes one try payload: the fragile body, the error handler with its rerun option, the optional retry policy and the optional timeout policy. */
213
- export declare function tryof(value: unknown): trystep | undefined;
214
- /** Validates the control payload of one composed step; throws with the kind specific rule when the payload is malformed so composition refuses it before any review. */
215
- export declare function validatecontrolpayload(step: workflowstep): void;
216
- /** Returns every child step of one control payload recursively so composition grades the risk of the whole construct and review hides no step; malformed payloads yield no hidden steps because composition refuses them first. */
217
- export declare function controlsteps(step: workflowstep): workflowstep[];
218
- /** Builds the review summary of one control step: the path names with the else path, the loop bounds and bodies, the parallel branches with the join policy and the try retry and timeout policies. */
219
- export declare function controlsummary(step: workflowstep): {
220
- kind: string;
221
- paths?: string[];
222
- elsepath?: string;
223
- list?: string;
224
- item?: string;
225
- index?: string;
226
- bound?: number;
227
- selector?: string;
228
- branches?: string[];
229
- strategy?: string;
230
- onfail?: string;
231
- attempts?: number;
232
- backoff?: string;
233
- rerun?: boolean;
234
- stepms?: number;
235
- runms?: number;
236
- expression?: string;
237
- } | undefined;
238
- /** Evaluates one condition payload over the extracted values of the scopes; the expression must resolve to a boolean and the step keeps no page side effect. */
239
- export declare function evaluatecondition(condition: conditionstep, scopes: variablescope[]): boolean;
240
- /** Chooses one branch path by page state and extracted values: the first path whose condition holds wins, an unconditional path matches always and the else path terminates every branch when no condition holds. */
241
- export declare function choosebranch(input: {
242
- stepid: string;
243
- branch: branchstep;
244
- scopes: variablescope[];
245
- pagestate?: {
246
- url?: string;
247
- title?: string;
248
- ready?: boolean;
249
- };
250
- now: number;
251
- }): {
252
- outcome: branchoutcome;
253
- steps: workflowstep[];
254
- };
255
- /** The result shape every control runner returns: the outcome flag, the merged scopes, the runlog entries, the summary and the control flow decision for the audit stores. */
256
- interface controlresult {
257
- ok: boolean;
258
- scopes: variablescope[];
259
- log: runlogentry[];
260
- summary: string;
261
- decision?: controlflowdecision;
262
- }
263
- /** The context every control runner shares with the dispatcher: the optional iteration path carries the outer index trail of nested loops for the audit counters. */
264
- interface controlcontextbase {
265
- step: workflowstep;
266
- scopes: variablescope[];
267
- outputs: Record<string, stepoutcome>;
268
- execute: controlexecute;
269
- now: number;
270
- path?: string;
271
- }
272
- /** Runs one loop over a data list variable: each iteration deep copies the item, rebinds the item and index variables, runs the body and records the loop counter with its iteration path for the audit stores. */
273
- export declare function runloop(input: controlcontextbase & {
274
- loop: loopstep;
275
- }): Promise<controlresult>;
276
- /** Runs one repeat until block: the body reruns until the convergence expression holds, the safety bound refuses a block that never converges and every pass records its loop counter. */
277
- export declare function runrepeatuntil(input: controlcontextbase & {
278
- repeat: repeatuntilstep;
279
- }): Promise<controlresult>;
280
- /** Runs one while block: the condition gates every pass, the mandatory safety bound refuses an endless loop and the overflow is reported with the loop counters. */
281
- export declare function runwhile(input: controlcontextbase & {
282
- condition: whilestep;
283
- }): Promise<controlresult>;
284
- /** Runs one foreach block: the injected resolver turns the selector into element references, every reference binds as the element item with its index and the empty match is an honest zero iteration outcome. */
285
- export declare function runforeach(input: controlcontextbase & {
286
- foreach: foreachstep;
287
- resolveelements?: (selector: string) => Promise<string[]>;
288
- }): Promise<controlresult>;
289
- /** Merges the variable writes of the parallel branches under the reviewed join strategy: first or last wins by branch order and fail refuses any conflicting write; cancelled branches never contribute. */
290
- export declare function joinbranches(input: {
291
- stepid: string;
292
- branches: Array<{
293
- id: string;
294
- order: number;
295
- ok: boolean;
296
- cancelled: boolean;
297
- variables: variablevalue[];
298
- }>;
299
- strategy: "first" | "last" | "fail";
300
- now: number;
301
- }): {
302
- ok: boolean;
303
- conflicts: string[];
304
- merged: variablevalue[];
305
- record: joinrecord;
306
- summary: string;
307
- };
308
- /** Runs one parallel block: every branch launches concurrently inside its own isolated scope, the join policy decides whether sibling branches cancel or continue on branch failure and the join merges the branch writes under the reviewed strategy. */
309
- export declare function runparallel(input: controlcontextbase & {
310
- parallel: parallelstep;
311
- }): Promise<controlresult>;
312
- /** Computes one retry backoff delay under the reviewed shape: fixed keeps the base and exponential doubles it per failed attempt, and the seeded jitter window spans half the jitter around it. */
313
- export declare function backoffdelay(policy: retrypolicy, attempt: number, seed: number): number;
314
- /** Retries one failed step under the reviewed retry policy: the attempts stay user configured with no code ceiling, the backoff shape is fixed or exponential with seeded jitter and only the reviewed error classes retry; the attempts and their backoff durations are recorded for the audit stores. */
315
- export declare function applyretry<T extends {
316
- ok: boolean;
317
- }>(input: {
318
- stepid: string;
319
- policy: retrypolicy;
320
- run: () => Promise<T>;
321
- errorclass: (value: T) => string;
322
- now: number;
323
- seed?: number;
324
- }): Promise<{
325
- value: T;
326
- attempts: retryattempt[];
327
- exhausted: boolean;
328
- }>;
329
- /** Races one step against its reviewed millisecond budget: an exceeded budget cancels the wait through the executor seam and returns the cancelled outcome with the timeout error class and the exceeded budget. */
330
- export declare function applytimeout<T extends {
331
- ok: boolean;
332
- }>(input: {
333
- stepid: string;
334
- budgetms: number;
335
- run: () => Promise<T>;
336
- }): Promise<{
337
- aborted: boolean;
338
- value?: T;
339
- output?: stepexecution;
340
- abort?: timeoutabort;
341
- }>;
342
- /** Races a whole run against its reviewed millisecond budget: an exceeded budget aborts the run with the cancelled error class carrying the exceeded budget. */
343
- export declare function applyruntimeout<T>(input: {
344
- budgetms: number;
345
- run: () => Promise<T>;
346
- }): Promise<{
347
- cancelled: true;
348
- error: cancellederror;
349
- } | {
350
- cancelled: false;
351
- value: T;
352
- }>;
353
- /** Executes the error handler steps of a try block on failure; the handler steps run through the same step machinery and their outcome decides the handler result. */
354
- export declare function runcatch(input: {
355
- handler: errorhandler;
356
- scopes: variablescope[];
357
- outputs: Record<string, stepoutcome>;
358
- execute: controlexecute;
359
- now: number;
360
- }): Promise<{
361
- ok: boolean;
362
- scopes: variablescope[];
363
- log: runlogentry[];
364
- }>;
365
- /** Runs one try block: the fragile body steps run under the reviewed retry policy and the per step timeout budgets, a failure runs the error handler and the rerun option executes the body once more after the handler. */
366
- export declare function runtry(input: controlcontextbase & {
367
- fragile: trystep;
368
- }): Promise<controlresult>;
369
- /** Executes exactly one control flow step: parses the reviewed payload, dispatches to the matching runner, returns the merged scopes, the iteration runlog and the outcome whose details carry the control flow decision for the audit stores. */
370
- export declare function runcontrolstep(input: controlcontextbase & {
371
- runid?: string;
372
- pagestate?: {
373
- url?: string;
374
- title?: string;
375
- ready?: boolean;
376
- };
377
- resolveelements?: (selector: string) => Promise<string[]>;
378
- }): Promise<{
379
- scopes: variablescope[];
380
- log: runlogentry[];
381
- output: stepexecution;
382
- }>;
383
- /** Wraps one executor seam so control flow kinds dispatch to the control engine while every other kind keeps its executor: the wrapper carries the isolated run id, the page state accessor and the element resolver of the background executors, and the control outcome returns the merged scopes with its iteration runlog so the run loop adopts them. */
384
- export declare function controlexecutor(execute: controlexecute, extras?: {
385
- runid?: string;
386
- pagestate?: {
387
- url?: string;
388
- title?: string;
389
- ready?: boolean;
390
- };
391
- resolveelements?: (selector: string) => Promise<string[]>;
392
- }): controlexecute;
393
- /**
394
- * Trigger and scheduling engine for the 1.1.52 family.
395
- * Every correlated rule of the trigger phase lives in this file: the trigger family and kind lists, the family payload normalizers, the five field cron parser with named weekdays and months and its timezone aware next fire computation, the interval scheduler that spreads repeated fires with the configured seeded jitter, the glob url matcher with ports, the visit origin matcher, the cooldown suppressor, the dedupe and queue discipline that keeps one pending fire per rule while a run is active, the url list planner that starts one run per url, the webhook verifier of the shared secret and payload schema, the observed event catalog matcher, the pause and resume suspension with the resume drain, the trigger evaluation that skips disabled, paused, unreviewed or cooled down rules, the manual run step preview with its confirmation outcome and the rule summaries the review panel renders.
396
- * The engine stays pure: the launch of a run flows through the injected launch seam so tests run on plain fixtures, and no trigger fires outside the consent gates — every rule is reviewed before it arms and every launch re-passes the session, plan and origin gates.
397
- */
398
- /** The trigger kinds of the 1.1.52 family: one kind per trigger rule family, each arming its rule behind the explicit arm review. */
399
- export declare const triggerkinds: string[];
400
- /** The trigger rule families the engine matches, schedules and observes. */
401
- export declare const triggerfamilies: triggerfamily[];
402
- /** The observed page event catalog event rules subscribe to: the mutation, focus, banner, console, error and navigation observations the extension already watches. */
403
- export declare const triggereventcatalog: string[];
404
- /** The documented default cooldown window of the webhook and event families when the review configures none; it is a documented default, never a cap, and any user configured window wins. */
405
- export declare const defaulttriggercooldown = 10000;
406
- /** True when the kind belongs to the trigger family of the 1.1.52 release. */
407
- export declare function istriggerkind(kind: string): boolean;
408
- /** Maps one trigger action kind to its rule family. */
409
- export declare function triggerfamilyof(kind: string): triggerfamily | undefined;
410
- /** Normalizes one family payload of a trigger rule and returns the family specific fields; the shared workflowid, cooldown and review flag stay with the caller. */
411
- export declare function triggerpayloadof(family: triggerfamily, value: unknown): Partial<triggerule> | undefined;
412
- /** True when a webhook shared secret clears the documented entropy floor: at least twenty four characters mixing letters and digits; the floor is a floor, not a cap, and any longer secret wins. */
413
- export declare function webhooksecretok(secret: string): boolean;
414
- /** True when the timezone name resolves through the runtime timezone database. */
415
- export declare function timezonevalid(timezone: string): boolean;
416
- /** Builds one armed trigger rule from the reviewed arm payload: the family normalizer validates the match fields, the effective cooldown applies the documented default of the webhook and event families and the rule starts enabled with zeroed counters. */
417
- export declare function armrule(input: {
418
- id?: string;
419
- family: triggerfamily;
420
- workflowid: string;
421
- label?: string;
422
- payload: unknown;
423
- cooldown?: number;
424
- now: number;
425
- }): triggerule | undefined;
426
- /** The shared state of one rule update so enable, disable, pause, resume and fire bookkeeping stay immutable. */
427
- export declare function updaterule(rule: triggerule, patch: {
428
- state?: Partial<triggerstate>;
429
- stats?: Partial<rulestats>;
430
- }): triggerule;
431
- /** Matches one glob url pattern against one navigation url: the schemes and hostnames must agree, an explicit pattern port must match while an absent port matches any port, and the path plus query glob accepts `*` inside one segment and `**` across segments. */
432
- export declare function matchurl(pattern: string, url: string): boolean;
433
- /** True when a navigation url lands on one of the reviewed origins of a visit rule. */
434
- export declare function visitmatch(origins: string[], url: string): boolean;
435
- /** The five field cron parser: minute, hour, day of month, month and day of week accept `*`, lists, ranges and steps, and named weekdays (sun to sat) and months (jan to dec); day of week accepts zero and seven as sunday. */
436
- export declare function cronparse(expression: string): {
437
- minutes: number[];
438
- hours: number[];
439
- daysofmonth: number[];
440
- months: number[];
441
- daysofweek: number[];
442
- } | undefined;
443
- /** Computes the next fire time of a five field cron expression strictly after the given time: minute boundaries in UTC or the reviewed timezone; a schedule that never fires inside the four year horizon returns undefined so the honest no fire outcome travels on. */
444
- export declare function cronnext(expression: string, from: number, timezone?: string): number | undefined;
445
- /** Computes the next fire time of a cron rule strictly after the given time. */
446
- export declare function schedulecron(rule: {
447
- cron: string;
448
- timezone?: string;
449
- }, from: number): number | undefined;
450
- /** Computes the next fire time of an interval rule: the reviewed period after the last fire (or the arm time of the first pass) spread with the seeded jitter window so repeated fires never bunch at the minimum. */
451
- export declare function scheduleinterval(rule: {
452
- period: number;
453
- jitter?: number;
454
- }, lastfire: number | undefined, armedat: number, seed: number): number;
455
- /** Returns every scheduled rule whose next fire time has passed; the alarm wake and the opportunistic service worker wakes drain this list. */
456
- export declare function listdue(rules: triggerule[], now: number): Array<{
457
- rule: triggerule;
458
- overdueby: number;
459
- }>;
460
- /** Applies the cooldown window of one rule: a fire inside the window after the last fire is suppressed with the remaining window, a fire at or after it passes. */
461
- export declare function applycooldown(rule: triggerule, now: number): {
462
- suppressed: boolean;
463
- remaining: number;
464
- };
465
- /** The outcome of one trigger evaluation: the launch plan when the rule fires or the honest suppression reason. */
466
- export interface triggerdecision {
467
- fired: boolean;
468
- suppressed?: string;
469
- remaining?: number;
470
- fire?: triggerfire;
471
- }
472
- /** Evaluates one armed rule against one observation: disabled, paused and rules whose workflow lost its approved review never fire, a run of the same workflow already active dedupes, the cooldown window suppresses and every passing fire carries the triggering url, title and payload into the run context. */
473
- export declare function evaluatetrigger(input: {
474
- rule: triggerule;
475
- now: number;
476
- cause: string;
477
- url?: string;
478
- title?: string;
479
- payload?: Record<string, unknown>;
480
- runactive: boolean;
481
- workflowreviewed: boolean;
482
- }): triggerdecision;
483
- /** Queues one fire that arrived while the target run or tab was busy; the queue keeps one pending fire per rule so repeated observations dedupe instead of piling up. */
484
- export declare function queuefire(queue: triggerfire[], fire: triggerfire): {
485
- queue: triggerfire[];
486
- queued: boolean;
487
- deduped: boolean;
488
- };
489
- /** Drains the queued fires in arrival order through the injected launch seam; a launch that throws leaves the failed fire and the remaining queue intact so the next wake retries it. */
490
- export declare function drainqueue(queue: triggerfire[], launch: (fire: triggerfire) => Promise<void>): Promise<{
491
- launched: number;
492
- remaining: triggerfire[];
493
- }>;
494
- /** Plans one run per url of a url list rule: every url becomes its own trigger fire carrying the url into the run context; nothing is capped in code. */
495
- export declare function runurllist(rule: triggerule, now: number): triggerfire[];
496
- /** Verifies one webhook delivery: the shared secret must equal the reviewed secret compared character by character without early exit and the payload must satisfy every required schema field of its reviewed kind; only verified payloads persist. */
497
- export declare function verifywebhook(input: {
498
- rule: triggerule;
499
- secret: string;
500
- payload: unknown;
501
- }): {
502
- verified: boolean;
503
- reason?: string;
504
- };
505
- /** True when one observed page event name matches an event rule subscription of the observed event catalog. */
506
- export declare function eventrulematches(rule: triggerule, event: string): boolean;
507
- /** Subscribes the armed event rules to one observed page event: returns every enabled, unpaused event rule whose subscription list names the event of the observed catalog, so the page observation seam (watched mutations, focus shifts, banners, console output, captured errors and navigations) can fire exactly those rules. */
508
- export declare function observeevents(rules: triggerule[], event: string): triggerule[];
509
- /** Suspends every enabled rule by setting its pause marker so session pauses hold fires instead of losing them. */
510
- export declare function pauseall(rules: triggerule[], now: number): triggerule[];
511
- /** Clears the pause marker of every rule so the resume drains the queued fires through the same gates. */
512
- export declare function resumeall(rules: triggerule[]): triggerule[];
513
- /** Builds the manual run step preview of one composed workflow: every expanded step with its kind, label, block and control summary so a human always sees what a run will do before confirming it. */
514
- export declare function manualpreview(record: workflowrecord, now: number): manualrun;
515
- /** Records the confirmation outcome of one manual run preview; an undecided preview keeps its confirmation open. */
516
- export declare function confirmmanualrun(preview: manualrun, confirmed: boolean, now: number): manualrun;
517
- /** Builds the review summary of one armed rule for the trigger list: the family, the match fields, the workflow reference, the effective cooldown and the schedule. */
518
- export declare function triggersummary(rule: triggerule): {
519
- kind: triggerfamily;
520
- workflowid: string;
521
- label: string;
522
- origins?: string[];
523
- pattern?: string;
524
- title?: string;
525
- command?: string;
526
- key?: string;
527
- cron?: string;
528
- timezone?: string;
529
- period?: number;
530
- jitter?: number;
531
- urls?: string[];
532
- events?: string[];
533
- fields?: number;
534
- cooldown: number;
535
- enabled: boolean;
536
- nextfireat?: number;
537
- };
538
- /** Returns every origin a rule touches so the arm review and the fire gates can check them against the workflow grants: visit origins, the url pattern origin, the url list origins and the webhook delivery origin stay inside the workflow grant list. */
539
- export declare function ruleorigins(rule: triggerule): string[];
540
- /** True when every origin a rule touches stays inside the granted origin list of its workflow. */
541
- export declare function ruleoriginsgranted(rule: triggerule, workfloworigins: string[]): boolean;
542
- /**
543
- * Workflow editor of the 1.1.53 family.
544
- * Every pure rule of the visual builder lives in this file: the canvas model with nodes, typed binding edges and layout state, the load and save round trips against the composed workflow grammar, the drag and drop snapping to block boundaries, the reorder persistence, the grouping of a selection into a new block, the template insertion with nested parameters, the mini map projection and viewport math, the zoom that keeps step labels readable, the step search, the breakpoint markers with the debug run segmentation, the version diffing, the json and yaml file format for import, export and template sharing, the per site override application and the undo and redo stacks.
545
- * The module stays pure: the sidepanel renders the model and the background validates saves through the same composeworkflow grammar every other path uses, so no editor artifact bypasses review.
546
- */
547
- /** The five categories of the block palette: actions, control flow, waits, variables and triggers. */
548
- export declare const palettecategories: palettecategory[];
549
- /** The curated drop blocks of the palette: one descriptor per canonical block of every category. */
550
- export declare const palettenodes: palettenode[];
551
- /** Builds the step library over every reviewed action kind the policy table knows, grouped by category with the documented option schema of the kinds that carry one. */
552
- export declare function buildsteplibrary(kinds: string[]): steplibraryentry[];
553
- /** Converts one composed workflow record into the canvas model: one node per top level step, one invocation node per contiguous block region of the expanded step list with a unique id even when one block is invoked many times, the bindings of every step lifted into typed edges and the layout stacked top to bottom with the block columns side by side. */
554
- export declare function loadworkflow(record: workflowrecord, layout?: editorlayout): editormodel;
555
- /** Validates the canvas model and converts it back into one composed workflow record: every node is a step or a block invocation, every edge links the output of an earlier node into a later node so no cycle forms, block child bindings stay inside their block and the composed record passes the full workflow grammar. */
556
- export declare function saveworkflow(model: editormodel, input: {
557
- now: number;
558
- kindallowed?: (kind: string) => boolean;
559
- riskof?: (kind: string) => actionrisk;
560
- }): workflowrecord;
561
- /** Attaches one step to a block boundary: the dragged position snaps onto the reviewed grid and the nearest block column attaches the step into that block while the main column detaches it. */
562
- export declare function snapnode(model: editormodel, nodeid: string, x: number, y: number, grid?: number): editormodel;
563
- /** Persists one drag and drop ordering: the node moves to the reviewed index of the top level list while the edges stay attached to their step ids. */
564
- export declare function reordersteps(model: editormodel, nodeid: string, index: number): editormodel;
565
- /** Moves many selected steps into a new block: the definition collects the selected steps in their current order and one invocation node replaces the first selected position. */
566
- export declare function groupselect(model: editormodel, nodeids: string[], blockname: string): editormodel;
567
- /** Inserts one shared step template with its nested parameters: the template step becomes a canvas node at the reviewed index and the parameters ride with the step into its block scope. */
568
- export declare function expandtemplate(model: editormodel, template: steptemplate, params?: nestedparam[], index?: number): editormodel;
569
- /** Inserts one new step node onto the canvas at the reviewed index: the palette and the step library drop their kinds through here so every insertion rides the undo stack. */
570
- export declare function addnode(model: editormodel, step: workflowstep, index?: number): editormodel;
571
- /** Replaces the payload of one step node of the canvas: the step inspector edits its target, value, options, expression and extract fields through here so every edit rides the undo stack. */
572
- export declare function editstep(model: editormodel, step: workflowstep): editormodel;
573
- /** Projects the full canvas into the mini map: the projection scale fits every node into the mini size and the viewport rectangle follows the layout viewport and zoom. */
574
- export declare function renderminimap(model: editormodel, width?: number, height?: number): {
575
- minimap: minimapstate;
576
- nodes: Array<{
577
- id: string;
578
- x: number;
579
- y: number;
580
- }>;
581
- };
582
- /** Jumps the canvas to a clicked mini map region: the click converts back into canvas coordinates and the viewport centers on it inside the canvas bounds. */
583
- export declare function minimapfocus(model: editormodel, x: number, y: number, width?: number, height?: number): editormodel;
584
- /** Sets the canvas zoom to any positive user value with no ceiling while the step labels compensate so they stay readable at every zoom level: the returned label scale grows the labels relative to the canvas once the zoom shrinks below the readable floor. */
585
- export declare function zoomcanvas(model: editormodel, zoom: number): {
586
- model: editormodel;
587
- labelscale: number;
588
- };
589
- /** Finds steps by label, kind or variable name: the search answers the matching nodes with the reasons they matched, case insensitive. */
590
- export declare function searchsteps(model: editormodel, query: string): Array<{
591
- id: string;
592
- label: string;
593
- kind: string;
594
- matched: string[];
595
- }>;
596
- /** Toggles the breakpoint marker of one step for editor debugging; a debug run pauses right before a marked step, and the marker rides the steps inside block definitions too. */
597
- export declare function markbreakpoint(model: editormodel, stepid: string): editormodel;
598
- /** Plans one debug run segment: the run executes the steps from the cursor up to the step before the next breakpoint, pauses at the breakpoint step id and reports the steps remaining after it; a run without breakpoints runs to the end. */
599
- export declare function runtobreakpoint(input: {
600
- record: workflowrecord;
601
- cursor?: number;
602
- breakpoints: string[];
603
- }): {
604
- until: number;
605
- pausat: string | undefined;
606
- remaining: number;
607
- };
608
- /** Compares two workflow versions: the steps the newer version added, removed and changed with the field names that changed. */
609
- export declare function diffversions(from: workflowrecord, to: workflowrecord, now: number): versiondiff;
610
- /** Serializes one workflow record with its version metadata into a workflow file of the reviewed json or yaml format. */
611
- export declare function exportworkflow(record: workflowrecord, format: exportformat, note?: string, now?: number): {
612
- format: exportformat;
613
- contents: string;
614
- file: workflowfile;
615
- };
616
- /** Packs one workflow with its shared step templates into a single shareable file so a whole library travels together. */
617
- export declare function shareworkflow(record: workflowrecord, templates: steptemplate[], format: exportformat, note?: string, now?: number): {
618
- format: exportformat;
619
- contents: string;
620
- file: workflowfile;
621
- };
622
- /** Validates and loads one workflow file: the format version must match, the workflow must compose through the full grammar and every packed template must normalize; the loaded record grades unreviewed until the user approves it. */
623
- export declare function importworkflow(input: {
624
- contents: string;
625
- format?: exportformat;
626
- now?: number;
627
- kindallowed?: (kind: string) => boolean;
628
- riskof?: (kind: string) => actionrisk;
629
- }): {
630
- record: workflowrecord;
631
- templates: steptemplate[];
632
- file: workflowfile;
633
- };
634
- /** Wires one nested parameter into a block invocation of the canvas: the parameter replaces a same named one and the default binds into the block scope once the run opens it. */
635
- export declare function bindparam(model: editormodel, blockname: string, param: nestedparam): editormodel;
636
- /** Applies one per site policy override to a workflow: the deltas adjust only the reviewed knobs — loop bounds, step and run timeouts, element wait timeouts and delay bases — of the steps whose workflow origins match the override pattern. */
637
- export declare function applyoverride(record: workflowrecord, override: siteoverride): workflowrecord;
638
- /** Wires one typed binding edge from the output socket of an earlier step into the input socket of a later step; a backwards edge refuses so no cycle forms. */
639
- export declare function addedge(model: editormodel, edge: editoredge): editormodel;
640
- /** Removes one typed binding edge of the canvas by its source, target and variable. */
641
- export declare function removeedge(model: editormodel, from: string, to: string, variable: string): editormodel;
642
- /** Removes one canvas node with every edge attached to it; the undo stack keeps the removal reversible. */
643
- export declare function removenode(model: editormodel, nodeid: string): editormodel;
644
- /** Steps one canvas edit back: the last undo snapshot becomes the current model and the edited model waits on the redo stack. */
645
- export declare function undoedit(model: editormodel): editormodel;
646
- /** Steps one canvas edit forward again after an undo: the newest redo snapshot returns as the current model. */
647
- export declare function redoedit(model: editormodel): editormodel;
648
- export {};
649
- //# sourceMappingURL=workflow.d.ts.map