@desplega.ai/agent-swarm 2.14.0 → 2.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp-adapter-q1vz4hh2.js +17 -0
- package/dist/{acp-targets-23exz4z4.js → acp-targets-d44eerh4.js} +10 -10
- package/dist/{actions-zcr25x27.js → actions-z4k4bvss.js} +28 -28
- package/dist/{agent-fs-provision-7fa9e12e.js → agent-fs-provision-aan1cgpx.js} +4 -4
- package/dist/{amp-adapter-s7ytmv6b.js → amp-adapter-wac3py0p.js} +3 -3
- package/dist/{anthropic-messages-vdd1zmha.js → anthropic-messages-njt2r5m4.js} +28 -27
- package/dist/{app-5d3sz1hy.js → app-wax6qz5e.js} +10 -10
- package/dist/{approval-notifications-7qgkzkzx.js → approval-notifications-6fvkhnma.js} +11 -11
- package/dist/{assistant-p2yvhc3j.js → assistant-e8fe08zx.js} +29 -29
- package/dist/{azure-openai-responses-jeaas6x0.js → azure-openai-responses-6ewf9rwp.js} +6 -6
- package/dist/{boot-args-schema-ry6cb0p7.js → boot-args-schema-rv97cmnt.js} +1 -1
- package/dist/{boot-reembed-c9643ms3.js → boot-reembed-bcn7frk9.js} +1 -1
- package/dist/{boot-reembed-2hkm3vz2.js → boot-reembed-xakrdy6y.js} +1 -1
- package/dist/{boot-scrub-sweep-3ycxr51t.js → boot-scrub-sweep-20t8akhf.js} +2 -2
- package/dist/{boot-seeds-2hzvvzg0.js → boot-seeds-48rr6r29.js} +4 -4
- package/dist/{boxd-9py3x0jb.js → boxd-tjpxwecx.js} +3 -3
- package/dist/{claude-adapter-dnkww93e.js → claude-adapter-0wzwntrj.js} +12 -13
- package/dist/{claude-managed-adapter-yk0cr5x6.js → claude-managed-adapter-4xcgt46w.js} +4 -4
- package/dist/{claude-managed-setup-4byxpp47.js → claude-managed-setup-91cyktw7.js} +7 -7
- package/dist/{claude-sdk-session-4wf3dbvs.js → claude-sdk-session-ngj4dce5.js} +11144 -12464
- package/dist/{cli-gcyws2bp.js → cli-021hrewp.js} +2 -2
- package/dist/{cli-wvgg7r4j.js → cli-08gfvs58.js} +2 -2
- package/dist/{cli-2zjxake1.js → cli-0kyjrbaa.js} +4 -4
- package/dist/{cli-rp1n2xpd.js → cli-0nvqg1hb.js} +1 -1
- package/dist/{cli-vxmmttmt.js → cli-0nz04gqv.js} +50 -50
- package/dist/{cli-vr4eyq6p.js → cli-0rrft7s3.js} +538 -410
- package/dist/{cli-mw1tmn3x.js → cli-1d9q7qrn.js} +7 -7
- package/dist/{cli-84xn7bgz.js → cli-1t5vhrpv.js} +1 -1
- package/dist/{cli-hzhv7yac.js → cli-1zbj28py.js} +1 -1
- package/dist/{cli-z8t4485r.js → cli-2ja7eadd.js} +2 -2
- package/dist/{cli-r04ve9xw.js → cli-2r62jy9s.js} +1 -1
- package/dist/{cli-9fwznq4p.js → cli-3ffzr65w.js} +7 -7
- package/dist/{cli-2ckwgs7q.js → cli-3kdgm393.js} +5 -5
- package/dist/{cli-jwnac23b.js → cli-3vc518cw.js} +1 -1
- package/dist/{cli-6p8p2e6r.js → cli-5188hq0a.js} +1286 -31
- package/dist/{cli-zcghfsdg.js → cli-53gt8wfv.js} +1 -1
- package/dist/{cli-930zbczq.js → cli-5njmmmer.js} +3 -3
- package/dist/{cli-dw9rtjm3.js → cli-5rw7nt99.js} +3061 -727
- package/dist/{cli-6c61yjwy.js → cli-5xx353cy.js} +7554 -1534
- package/dist/{cli-2ap1the6.js → cli-65k149j5.js} +2 -2
- package/dist/{cli-v41kn3cd.js → cli-6prwz0zn.js} +4427 -5566
- package/dist/{cli-yd7e590v.js → cli-6zpn5hmp.js} +12 -12
- package/dist/{cli-ty3gha1p.js → cli-7b9bwrfg.js} +2 -2
- package/dist/{cli-2414h5r9.js → cli-7dpdq7yh.js} +11428 -1914
- package/dist/{cli-r9d2tya0.js → cli-7qkbab03.js} +5 -5
- package/dist/{cli-7ca8hczj.js → cli-7svwhw1a.js} +1 -1
- package/dist/cli-7wwewkf4.js +37 -0
- package/dist/{cli-ejnhs815.js → cli-83hynhes.js} +17 -13
- package/dist/{cli-rs1rzwp4.js → cli-8crn0510.js} +1 -1
- package/dist/{cli-f2rwt43y.js → cli-8ee7xt75.js} +13 -13
- package/dist/{cli-9j47sgzy.js → cli-8ef94zm2.js} +2 -2
- package/dist/{cli-9fvk9mv8.js → cli-8gr1bg9t.js} +1 -1
- package/dist/{cli-b0m3bg0f.js → cli-9j1qcs0b.js} +1 -1
- package/dist/{cli-ad00h1st.js → cli-9mvfvggt.js} +7 -7
- package/dist/{cli-xh5fpmg8.js → cli-9txap41q.js} +101 -18
- package/dist/{cli-24wervhz.js → cli-aktk3qt6.js} +3 -3
- package/dist/{cli-6ajyhxh7.js → cli-an8bpy60.js} +2 -2
- package/dist/{cli-meydjstb.js → cli-azptj8xe.js} +5591 -69
- package/dist/cli-c0rt16vk.js +15 -0
- package/dist/{cli-w4bvtxet.js → cli-c6vhcknq.js} +7 -7
- package/dist/{cli-2savn6mm.js → cli-cczffwak.js} +7 -7
- package/dist/{cli-ze1ndjs4.js → cli-cgmka83w.js} +3 -3
- package/dist/{cli-kc7vd07m.js → cli-d13qgcct.js} +3699 -1733
- package/dist/{cli-k3facve0.js → cli-d5nvy1jy.js} +1 -1
- package/dist/{cli-edxfzgah.js → cli-dev6f0px.js} +4 -4
- package/dist/{cli-0e914dp9.js → cli-dzhht0vq.js} +3 -3
- package/dist/{cli-m0ea8ggd.js → cli-e13kbyq0.js} +2 -2
- package/dist/{cli-73rmgm45.js → cli-e2k0ej0d.js} +2 -2
- package/dist/cli-ek8b88kv.js +9740 -0
- package/dist/{cli-0k7ppk9k.js → cli-ertcjw6z.js} +281 -46
- package/dist/{cli-qrwjk4xy.js → cli-f3ta4e67.js} +5 -5
- package/dist/{cli-1nfabrt4.js → cli-f4xv7s0t.js} +7 -7
- package/dist/{cli-phe2vcw5.js → cli-fdam1t9b.js} +171 -104
- package/dist/{cli-gc6b94tj.js → cli-fe8he9cy.js} +2 -2
- package/dist/{cli-spfz393q.js → cli-feh37wgs.js} +598 -219
- package/dist/{cli-ebqx630g.js → cli-fjzjtqna.js} +35 -18
- package/dist/{cli-37p61fcg.js → cli-fs9t2m2k.js} +18 -20
- package/dist/{cli-7w1fs01q.js → cli-g03x26q6.js} +2 -2
- package/dist/{cli-879txsac.js → cli-gnkzh8ed.js} +4 -4
- package/dist/{cli-v4z5v3jd.js → cli-gy0r7gb8.js} +514 -337
- package/dist/{cli-s4pccby1.js → cli-h0edykd1.js} +1 -1
- package/dist/{cli-pq0kv31y.js → cli-h364asjc.js} +9 -9
- package/dist/{cli-69szn7w7.js → cli-h3xcfp4c.js} +93 -54
- package/dist/{cli-jcnc5ret.js → cli-h8k5801a.js} +73 -27
- package/dist/{cli-6yy4fepf.js → cli-h96yp7xv.js} +4 -4
- package/dist/{cli-q5n3deaf.js → cli-hab0bvrh.js} +1 -1
- package/dist/{cli-g6a696c0.js → cli-j3wqt73b.js} +4 -4
- package/dist/{cli-wym6rxgt.js → cli-jfgaz10x.js} +10 -15
- package/dist/{cli-shyhb4t5.js → cli-jrhvywah.js} +53 -52
- package/dist/{cli-qkbevqer.js → cli-jrxt5j0n.js} +3 -3
- package/dist/{cli-7b7rxz22.js → cli-jw7n9pct.js} +5 -2
- package/dist/{cli-8vbxjzk0.js → cli-k9kfck3s.js} +3 -3
- package/dist/{cli-yjb3cddd.js → cli-kkwq5b12.js} +1 -1
- package/dist/{cli-39t9d248.js → cli-kz8rar0g.js} +1 -1
- package/dist/{cli-rzbsh6bw.js → cli-n15fhd43.js} +1 -1
- package/dist/{cli-1jx0srjt.js → cli-nc842kc9.js} +1921 -80
- package/dist/{cli-9j1t3kf6.js → cli-nmj4phcg.js} +2 -2
- package/dist/{cli-t9pzz2eq.js → cli-ntmjzyte.js} +4 -1
- package/dist/{cli-adzmmcvf.js → cli-praaw1wh.js} +2 -2
- package/dist/{cli-f9g96z28.js → cli-q44p4869.js} +11 -11
- package/dist/{cli-fww016hh.js → cli-q58qt9dw.js} +1711 -7287
- package/dist/{cli-njvpngc6.js → cli-qqz5z36e.js} +3 -3
- package/dist/{cli-096aftq6.js → cli-r7rpy2xz.js} +7 -7
- package/dist/cli-rcqgr0hs.js +30 -0
- package/dist/{cli-ph95yejc.js → cli-rjc464jg.js} +2 -2
- package/dist/{cli-md4tn21h.js → cli-rw3m83j4.js} +40 -26
- package/dist/cli-rwcj6wt3.js +1291 -0
- package/dist/{cli-srq69pn1.js → cli-ryn4y478.js} +1 -1
- package/dist/{cli-jgq9xptq.js → cli-s48k2rzx.js} +4 -4
- package/dist/{cli-cbg0j1yt.js → cli-s90wcbk9.js} +3 -3
- package/dist/{cli-2ayk9gn8.js → cli-svcy72s5.js} +2 -2
- package/dist/{cli-4dyzzkfb.js → cli-swtwbg85.js} +944 -170
- package/dist/{cli-mv8ft7b0.js → cli-t1bqpzgz.js} +3 -3
- package/dist/{cli-tc165vrb.js → cli-t5jbjq61.js} +4 -3
- package/dist/{cli-enavhq6r.js → cli-tbrjvrrg.js} +1 -1
- package/dist/{cli-mz7ycqn8.js → cli-td2h8zej.js} +6 -6
- package/dist/{cli-9t7syepg.js → cli-ttatvwn6.js} +1 -1
- package/dist/{cli-ayxxkk3p.js → cli-txxcf9s1.js} +8 -8
- package/dist/{cli-q4z9s6zs.js → cli-v7az4d1g.js} +2 -2
- package/dist/cli-vqt44168.js +14 -0
- package/dist/{cli-q457ga28.js → cli-vs9h3vw2.js} +14 -14
- package/dist/{cli-snxhtehz.js → cli-w2fg8kjc.js} +7 -8
- package/dist/{cli-wd7b5hgc.js → cli-w81s97bn.js} +1 -1
- package/dist/{cli-bqfx72e6.js → cli-wkzrknpt.js} +1 -1
- package/dist/{cli-cg1q8ymp.js → cli-wqpvfq2m.js} +1 -1
- package/dist/{cli-kg63yp1r.js → cli-wz7qj1jy.js} +19 -19
- package/dist/{cli-3wsabyt0.js → cli-x5t54ytt.js} +2 -2
- package/dist/{cli-r495stwd.js → cli-xd6ntv7x.js} +2 -2
- package/dist/{cli-wvbaq052.js → cli-xphbv66z.js} +10 -3
- package/dist/{cli-a49frv85.js → cli-xxgqn93n.js} +3753 -1186
- package/dist/{cli-91amj3md.js → cli-z209g721.js} +111 -87
- package/dist/{cli-3mhdmcd4.js → cli-z5andw8k.js} +1 -1
- package/dist/{cli-7g5qj2ca.js → cli-zcb64xzv.js} +1 -1
- package/dist/{cli-0h6m6z5g.js → cli-zr2sc5tr.js} +1 -1
- package/dist/{cli-krk8y8c7.js → cli-zrm0610v.js} +1833 -518
- package/dist/cli.js +73 -73
- package/dist/{cloudflare-workers-ai-system-one-w3m0fbf8.js → cloudflare-workers-ai-system-one-kb0tq22h.js} +2 -2
- package/dist/{codex-adapter-eq61radw.js → codex-adapter-0c1ynrmt.js} +9 -9
- package/dist/{codex-hook-8nmepvz6.js → codex-hook-w5nmtrn2.js} +2 -2
- package/dist/{codex-login-vbd9707w.js → codex-login-67qarfcg.js} +1 -1
- package/dist/{codex-session-runner-rfx355h4.js → codex-session-runner-z4t9z7yy.js} +10 -10
- package/dist/{commands-d1z0sx62.js → commands-h0jxqdhk.js} +3 -3
- package/dist/{controller-9hz6d8x3.js → controller-4ygy66hv.js} +4 -4
- package/dist/{controllers-connect-tz07d2xr.js → controllers-connect-ynbvv8pv.js} +28 -28
- package/dist/core-mj9fzrcm.js +41 -0
- package/dist/{cursor-adapter-ef22ze3j.js → cursor-adapter-9e4d6658.js} +2 -2
- package/dist/{db-gd81d68c.js → db-bg0hxjq1.js} +3 -3
- package/dist/{db-vrckks6q.js → db-q12gmpns.js} +2 -2
- package/dist/{devin-adapter-kdt6a2bh.js → devin-adapter-tn1twrha.js} +1 -1
- package/dist/{devtools-qxfgbsqz.js → devtools-t8my9az6.js} +1 -1
- package/dist/{dispatcher-76as8w2t.js → dispatcher-v5dbfscq.js} +24 -24
- package/dist/{docker-51ta7jsh.js → docker-6007r2fj.js} +2 -2
- package/dist/{dsh-adapter-ypfvcdyz.js → dsh-adapter-z3fneea1.js} +2 -2
- package/dist/{e2b-05kn3kpq.js → e2b-k3kb8b52.js} +4 -4
- package/dist/{e2b-dm9r8hpy.js → e2b-p269awh6.js} +5 -5
- package/dist/{easter-egg-3d-sg21j15g.js → easter-egg-3d-y49v5z90.js} +1 -1
- package/dist/{embedding-space-zsdw37bb.js → embedding-space-mjt5ksq0.js} +5 -5
- package/dist/{embeddings-p4e3e1m6.js → embeddings-td9hgnc5.js} +1 -1
- package/dist/emscripten-module-Q67P5WYC-3sde6cre.js +2458 -0
- package/dist/{event-bus-tvf2grf4.js → event-bus-pawddp92.js} +1 -1
- package/dist/{execute-nztd0af0.js → execute-z8nc8bba.js} +1 -1
- package/dist/{external-channel-717yzn4d.js → external-channel-pjenc2ag.js} +2 -2
- package/dist/ffi-cbfmmtqk.js +85 -0
- package/dist/fx-adapter-pjeztp0n.js +20 -0
- package/dist/getMachineId-bsd-hjs2tbdp.js +36 -0
- package/dist/getMachineId-darwin-kzbvr8s3.js +40 -0
- package/dist/getMachineId-linux-embmcq2c.js +26 -0
- package/dist/getMachineId-unsupported-jvznc6d4.js +20 -0
- package/dist/getMachineId-win-qr8z0b13.js +36 -0
- package/dist/{google-generative-ai-sw77egmr.js → google-generative-ai-tf3w7557.js} +11 -16
- package/dist/{google-vertex-rrw93g8h.js → google-vertex-9pj87bd8.js} +15 -17
- package/dist/grok-adapter-davbhx8t.js +20 -0
- package/dist/handlers-rf130hnp.js +39 -0
- package/dist/heartbeat-9hmvqxk0.js +49 -0
- package/dist/hook-0b1jqs2t.js +21 -0
- package/dist/{hook-ctz0xmp3.js → hook-1n0sjv8p.js} +10 -11
- package/dist/{http-zregegrx.js → http-vykejyjx.js} +432 -170
- package/dist/{index-7dgxveck.js → index-07d66kdm.js} +3 -3
- package/dist/index-0hgjxqz8.js +10584 -0
- package/dist/{index-rz8ve510.js → index-0nt39qwy.js} +2 -2
- package/dist/{index-ym9fgxad.js → index-2xbxq71g.js} +2 -2
- package/dist/{index-42jq9yy3.js → index-3j8hffkb.js} +12327 -7450
- package/dist/index-8w09aggw.js +43 -0
- package/dist/{index-5kx15d19.js → index-b3wy4jzs.js} +1 -1
- package/dist/{index-kzdqn3dd.js → index-dt9vr7tb.js} +3143 -760
- package/dist/{index-maddg9ys.js → index-ezfas4jj.js} +5858 -15337
- package/dist/index-g2jntx15.js +38 -0
- package/dist/{index-x9qf8dg7.js → index-j6sqtb83.js} +105 -75
- package/dist/{index-m6g8q65g.js → index-na0tczq0.js} +9268 -10220
- package/dist/{index-whysn1wf.js → index-p9dkwhwe.js} +1 -1
- package/dist/{index-126v2d0t.js → index-pe2etczf.js} +6 -2918
- package/dist/{index-mtnbhe12.js → index-q60mhcpd.js} +23631 -19921
- package/dist/index-qffex5k4.js +41 -0
- package/dist/index-qrp11tp9.js +4 -0
- package/dist/{index-kdmkfjt7.js → index-ryyrg0d8.js} +3426 -2333
- package/dist/{index-t17p395x.js → index-sf06w57a.js} +13 -13
- package/dist/{index-evay0xyk.js → index-vybnwd5v.js} +1 -1
- package/dist/{index-fdym6ryb.js → index-wsf1f5pe.js} +28 -28
- package/dist/{k8s-ejkk0aw7.js → k8s-mr1r12th.js} +2 -2
- package/dist/{keepalive-zdqay870.js → keepalive-86z0tzzf.js} +4 -4
- package/dist/lead-edmwagkn.js +81 -0
- package/dist/{llama-cpp-classify-yvb8vh7w.js → llama-cpp-classify-wd7htn1x.js} +2 -2
- package/dist/{maintenance-t5ndg11m.js → maintenance-19h6tfwz.js} +1 -1
- package/dist/{mistral-conversations-w4bncwbt.js → mistral-conversations-txjmc64f.js} +7 -7
- package/dist/module-ES6BEMUI-44w9s1dx.js +1210 -0
- package/dist/{multipart-parser-xevcstye.js → multipart-parser-xqbgwrav.js} +1 -1
- package/dist/{node-0as4n1ef.js → node-q4628t0b.js} +1 -1
- package/dist/{oauth-refresh-sweep-y9zyd7t6.js → oauth-refresh-sweep-6nmyrv32.js} +3 -3
- package/dist/{object-webhooks-mkca91s0.js → object-webhooks-2kynmdf8.js} +7 -7
- package/dist/{onboard-ss995244.js → onboard-zbpm96mn.js} +7 -7
- package/dist/{openai-codex-responses-70g39cgz.js → openai-codex-responses-6ckhys6r.js} +35 -29
- package/dist/{openai-completions-cv3hp4h5.js → openai-completions-c9dsq9jh.js} +15 -15
- package/dist/{openai-decisions-fyq1p9f9.js → openai-decisions-9vzvv10c.js} +2 -2
- package/dist/{openai-responses-trsvnks6.js → openai-responses-bhfmt9sa.js} +6 -6
- package/dist/{opencode-adapter-mwpz0278.js → opencode-adapter-fyqcbdra.js} +8 -8
- package/dist/{openrouter-images-0jj12a2q.js → openrouter-images-hkk5p580.js} +3 -3
- package/dist/otel-impl-txa20w1h.js +11178 -0
- package/dist/{pending-2sxh1t6j.js → pending-4rxawq8y.js} +25 -25
- package/dist/{pi-messages-zk3g4esn.js → pi-messages-py3f96p7.js} +5 -5
- package/dist/{pi-mono-adapter-sfb7zy43.js → pi-mono-adapter-rnsed1xa.js} +24 -27
- package/dist/{pricing-refresh-h79bg4cf.js → pricing-refresh-4314hwtw.js} +2 -2
- package/dist/{rbac-roles-ckq0czp4.js → rbac-roles-fztcm8ky.js} +2 -2
- package/dist/{rbac-roles-jg2e260w.js → rbac-roles-msqt7a3k.js} +3 -3
- package/dist/{render-v2-ymbshmn0.js → render-v2-w49wtecg.js} +10 -10
- package/dist/{resume-jdhnt4jk.js → resume-gwgtp4m3.js} +13 -13
- package/dist/{runtime-y28jhhnf.js → runtime-kkebz8yq.js} +1 -1
- package/dist/{session-access-k4ta5hvp.js → session-access-kjb19m2w.js} +5 -5
- package/dist/{session-source-backfill-528j4s8j.js → session-source-backfill-805p4wqr.js} +3 -3
- package/dist/{setup-d6pj82fr.js → setup-q8y168c8.js} +3 -3
- package/dist/thread-buffer-yqbffd0t.js +40 -0
- package/dist/{token-util-pjgekqxr.js → token-util-hnzceyn9.js} +1 -1
- package/dist/{token-pgr2w4s3.js → token-xnc02n6w.js} +21 -14
- package/dist/{tree-visibility-kjxv3nxk.js → tree-visibility-qj323994.js} +2 -2
- package/dist/{typesafe-system-one-qkvkgrcz.js → typesafe-system-one-avrdb4zm.js} +2 -2
- package/dist/{user-merge-jobs-rabbncf6.js → user-merge-jobs-qfp40f2s.js} +3 -3
- package/dist/{virtual-modules-22k51txd.js → virtual-modules-nzxegw0a.js} +7 -7
- package/dist/{work-objects-xtjbar3r.js → work-objects-hs089w60.js} +26 -26
- package/dist/{worker-follow-up-fg48vk6d.js → worker-follow-up-zwgg20sr.js} +24 -24
- package/dist/worker-kg4g7rnx.js +81 -0
- package/dist/{x-vfsqypht.js → x-k29vmskt.js} +2 -2
- package/openapi.json +59 -3
- package/package.json +53 -52
- package/plugin/commands/create-pr.md +5 -2
- package/plugin/pi-skills/create-pr/SKILL.md +5 -2
- package/src/apps/sync.ts +7 -2
- package/src/be/db/model-profiles.ts +103 -12
- package/src/be/db/tasks/read.ts +5 -0
- package/src/be/db/workflow-runs.ts +12 -8
- package/src/be/db.ts +18 -5
- package/src/be/migrations/367_workflow_run_principal.sql +5 -0
- package/src/be/model-group-resolution.ts +134 -0
- package/src/be/model-tier-resolution.ts +120 -17
- package/src/be/model-validation.ts +9 -1
- package/src/be/runtime-pools/routing.ts +22 -8
- package/src/be/scripts/extract-schema.ts +7 -0
- package/src/be/swarm-config-guard.ts +20 -7
- package/src/be/task-auto-title-listener.ts +2 -2
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/post-bridge.ts +27 -28
- package/src/http/active-sessions.ts +7 -0
- package/src/http/agents.ts +7 -0
- package/src/http/api-keys.ts +7 -0
- package/src/http/approval-requests.ts +4 -0
- package/src/http/budgets.ts +2 -0
- package/src/http/codex-oauth-keep-warm.ts +6 -2
- package/src/http/config.ts +1 -0
- package/src/http/context.ts +4 -0
- package/src/http/db-query.ts +11 -2
- package/src/http/events.ts +2 -0
- package/src/http/fs.ts +1 -0
- package/src/http/integrations.ts +4 -0
- package/src/http/mcp-bridge.ts +1 -0
- package/src/http/memory.ts +3 -0
- package/src/http/metrics.ts +16 -0
- package/src/http/oauth-locks.ts +8 -0
- package/src/http/operator-actor.ts +3 -8
- package/src/http/page-proxy.ts +16 -0
- package/src/http/pages.ts +9 -0
- package/src/http/poll.ts +21 -1
- package/src/http/pricing.ts +2 -0
- package/src/http/prompt-templates.ts +34 -0
- package/src/http/repos.ts +3 -1
- package/src/http/schedules.ts +33 -3
- package/src/http/script-runs.ts +24 -0
- package/src/http/scripts.ts +1 -0
- package/src/http/session-data.ts +2 -0
- package/src/http/status.ts +1 -0
- package/src/http/tasks.ts +28 -1
- package/src/http/trackers/jira.ts +2 -0
- package/src/http/trackers/linear.ts +4 -0
- package/src/http/users.ts +18 -0
- package/src/http/webhooks.ts +12 -0
- package/src/http/workflow-events.ts +26 -6
- package/src/http/workflows.ts +40 -0
- package/src/http/x.ts +4 -0
- package/src/linear/app.ts +3 -2
- package/src/linear/client.ts +5 -1
- package/src/linear/host.ts +40 -0
- package/src/linear/oauth.ts +3 -2
- package/src/linear/sync.ts +4 -3
- package/src/otel-impl.ts +8 -5
- package/src/prompts/base-prompt.ts +10 -6
- package/src/prompts/session-templates.ts +3 -3
- package/src/providers/acp-targets.ts +1 -1
- package/src/providers/amp-adapter.ts +11 -9
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/rbac/legacy-policy.ts +2 -0
- package/src/rbac/permissions.ts +5 -0
- package/src/realtime/browser.generated.txt +1 -1
- package/src/scheduler/schedule-task.ts +1 -0
- package/src/scripts-runtime/quickjs-compat.ts +44 -10
- package/src/scripts-runtime/types/swarm-extension.d.ts +2 -0
- package/src/slack/config.ts +4 -0
- package/src/slack/render-v2.ts +52 -24
- package/src/slack/responses.ts +2 -1
- package/src/slack/reviewed-deliverables.ts +251 -0
- package/src/tasks/follow-up-gate.ts +142 -38
- package/src/tasks/worker-follow-up.ts +126 -37
- package/src/tests/amp-adapter.test.ts +57 -9
- package/src/tests/base-prompt.test.ts +36 -2
- package/src/tests/check-pr-body.test.ts +408 -93
- package/src/tests/compose-dev-object-store.test.ts +13 -0
- package/src/tests/compose-example-object-store.test.ts +67 -0
- package/src/tests/db-query.test.ts +8 -4
- package/src/tests/db-retention-defaults.test.ts +28 -3
- package/src/tests/e2b-dispatch.test.ts +7 -1
- package/src/tests/entrypoint-repo-autoclone-args.test.ts +10 -0
- package/src/tests/follow-up-gate-shadow.test.ts +268 -10
- package/src/tests/linear-outbound-sync.test.ts +59 -25
- package/src/tests/operator-actor-keyless.test.ts +103 -0
- package/src/tests/otel-event-loop-and-logs.test.ts +1 -1
- package/src/tests/profile-tier-alias.test.ts +9 -3
- package/src/tests/quickjs-compat.test.ts +40 -4
- package/src/tests/rbac-route-verbs-e2e.test.ts +142 -0
- package/src/tests/runner-repo-clone-args.test.ts +15 -6
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/slack-render-v2.test.ts +52 -8
- package/src/tests/workflow-definition-pinning.test.ts +2 -0
- package/src/tests/workflow-hitl-routing.test.ts +67 -5
- package/src/tests/workflow-replay.test.ts +13 -1
- package/src/tests/workflow-system-one-extraction.test.ts +21 -0
- package/src/tests/workflow-wait-filter.test.ts +7 -7
- package/src/tests/worktree-reaper.test.ts +15 -4
- package/src/tests/x402-client.test.ts +82 -0
- package/src/tools/memory-rate.ts +2 -2
- package/src/tools/prompt-templates/delete.ts +22 -1
- package/src/tools/prompt-templates/set.ts +15 -1
- package/src/tools/schedules/create-schedule.ts +20 -3
- package/src/tools/schedules/patch-schedule.ts +30 -4
- package/src/tools/schedules/update-schedule.ts +30 -4
- package/src/tools/send-task.ts +17 -3
- package/src/tools/slack-post.ts +7 -2
- package/src/tools/slack-reply.ts +6 -2
- package/src/tools/task-action.ts +16 -3
- package/src/tools/utils.ts +1 -1
- package/src/types.ts +10 -0
- package/src/utils/amp-models.ts +20 -4
- package/src/utils/constants.ts +5 -4
- package/src/utils/secret-scrubber.ts +6 -4
- package/src/utils/task-citations.ts +11 -0
- package/src/workflows/engine.ts +41 -8
- package/src/workflows/executors/agent-task.ts +13 -2
- package/src/workflows/executors/code-match.ts +11 -31
- package/src/workflows/executors/script.ts +13 -0
- package/src/workflows/executors/sub-workflow.ts +5 -7
- package/src/workflows/executors/swarm-script.ts +4 -5
- package/src/workflows/executors/system-one-extraction.ts +9 -6
- package/src/workflows/executors/wait.ts +1 -1
- package/src/workflows/foreach-driver.ts +5 -1
- package/src/workflows/model-validation.ts +13 -1
- package/src/workflows/predicate-sandbox.ts +171 -0
- package/src/workflows/resume.ts +21 -4
- package/src/workflows/retry-poller.ts +1 -1
- package/src/workflows/run-principal.ts +51 -0
- package/src/workflows/wait-filter.ts +14 -192
- package/src/x402/client.ts +38 -17
- package/templates/skills/code-quality/content.md +1 -1
- package/templates/skills/heartbeat-runbook/content.md +1 -0
- package/templates/skills/pages/content.md +36 -12
- package/templates/skills/slack-interaction/content.md +4 -0
- package/templates/skills/swarm-docs/content.md +47 -41
- package/templates/skills/swarm-scripts/SKILL.md +1 -1
- package/templates/skills/swarm-scripts/content.md +1 -1
- package/dist/acp-adapter-99n6z9ky.js +0 -17
- package/dist/cli-5ss6qqt9.js +0 -45
- package/dist/cli-dzzh58sy.js +0 -6996
- package/dist/cli-e8trbfx1.js +0 -15
- package/dist/cli-j9ccfveb.js +0 -1849
- package/dist/cli-mna6pmfx.js +0 -1485
- package/dist/cli-r8ddn0hf.js +0 -25583
- package/dist/core-dynsv289.js +0 -41
- package/dist/fx-adapter-9k0hptnz.js +0 -20
- package/dist/getMachineId-bsd-637a7rbk.js +0 -36
- package/dist/getMachineId-darwin-9vytrcnn.js +0 -36
- package/dist/getMachineId-linux-mkzsvyyz.js +0 -29
- package/dist/getMachineId-unsupported-4cfs2n11.js +0 -19
- package/dist/getMachineId-win-154s3qma.js +0 -38
- package/dist/grok-adapter-skdj2pce.js +0 -20
- package/dist/handlers-5btjqkz6.js +0 -39
- package/dist/heartbeat-vfb1gy84.js +0 -49
- package/dist/hook-eh52p7yd.js +0 -22
- package/dist/index-7w8p6em0.js +0 -41
- package/dist/index-t56y945n.js +0 -4
- package/dist/index-vfemrwwk.js +0 -10002
- package/dist/index-vz4semsx.js +0 -38
- package/dist/index-y3s0xp2v.js +0 -43
- package/dist/lead-6cscw8a5.js +0 -82
- package/dist/otel-impl-6n6vva3x.js +0 -28205
- package/dist/thread-buffer-9w6x5zec.js +0 -40
- package/dist/worker-g4aj93dt.js +0 -82
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
getWorkflowVersions2,
|
|
55
55
|
getMcpServerById2,
|
|
56
56
|
init_db4
|
|
57
|
-
} from "./cli-
|
|
57
|
+
} from "./cli-zrm0610v.js";
|
|
58
58
|
import {
|
|
59
59
|
McpHttpClient,
|
|
60
60
|
init_http_client
|
|
@@ -69,17 +69,17 @@ import {
|
|
|
69
69
|
oauthAppRowToProviderConfig,
|
|
70
70
|
ensureAuthorizationTokenOrThrow,
|
|
71
71
|
init_ensure_token
|
|
72
|
-
} from "./cli-
|
|
72
|
+
} from "./cli-e13kbyq0.js";
|
|
73
73
|
import {
|
|
74
74
|
AGENT_FS_API_KEY_CONFIG,
|
|
75
75
|
init_script_fs,
|
|
76
76
|
resolveAgentFsIdentity,
|
|
77
77
|
init_agent_fs_identity
|
|
78
|
-
} from "./cli-
|
|
78
|
+
} from "./cli-an8bpy60.js";
|
|
79
79
|
import {
|
|
80
80
|
validateDefinition,
|
|
81
81
|
init_definition2
|
|
82
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-h8k5801a.js";
|
|
83
83
|
import {
|
|
84
84
|
getApiKey,
|
|
85
85
|
init_api_key
|
|
@@ -90,13 +90,13 @@ import {
|
|
|
90
90
|
mintScriptRunToken,
|
|
91
91
|
revokeSessionToken,
|
|
92
92
|
init_users
|
|
93
|
-
} from "./cli-
|
|
93
|
+
} from "./cli-praaw1wh.js";
|
|
94
94
|
import {
|
|
95
95
|
defaultAssetKey,
|
|
96
96
|
init_key,
|
|
97
97
|
AppIconSchema,
|
|
98
98
|
init_types5
|
|
99
|
-
} from "./cli-
|
|
99
|
+
} from "./cli-t5jbjq61.js";
|
|
100
100
|
import {
|
|
101
101
|
init_zod
|
|
102
102
|
} from "./cli-96234j5w.js";
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
refreshSecretScrubberCache,
|
|
131
131
|
registerVolatileSecret,
|
|
132
132
|
init_secret_scrubber
|
|
133
|
-
} from "./cli-
|
|
133
|
+
} from "./cli-7qkbab03.js";
|
|
134
134
|
import {
|
|
135
135
|
__toESM,
|
|
136
136
|
__commonJS,
|
|
@@ -163,6 +163,9 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
163
163
|
static get chars() {
|
|
164
164
|
return Object.freeze([]);
|
|
165
165
|
}
|
|
166
|
+
static isValidChar(value) {
|
|
167
|
+
return this.chars.includes(value);
|
|
168
|
+
}
|
|
166
169
|
static get validChars() {
|
|
167
170
|
return /^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/;
|
|
168
171
|
}
|
|
@@ -180,7 +183,7 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
180
183
|
...options,
|
|
181
184
|
rawValue: options.rawValue ?? ""
|
|
182
185
|
};
|
|
183
|
-
this.#values = values.sort(CronField.sorter);
|
|
186
|
+
this.#values = [...values].sort(CronField.sorter);
|
|
184
187
|
this.#wildcard = this.options.wildcard !== undefined ? this.options.wildcard : this.#isWildcardValue();
|
|
185
188
|
this.#hasLastChar = this.options.rawValue.includes("L") || values.includes("L");
|
|
186
189
|
this.#hasQuestionMarkChar = this.options.rawValue.includes("?") || values.includes("?");
|
|
@@ -215,6 +218,23 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
215
218
|
return a.localeCompare(b);
|
|
216
219
|
return aIsNumber ? -1 : 1;
|
|
217
220
|
}
|
|
221
|
+
static findNearestValueInList(values, currentValue, reverse) {
|
|
222
|
+
if (reverse) {
|
|
223
|
+
for (let i = values.length - 1;i >= 0; i--) {
|
|
224
|
+
if (values[i] < currentValue)
|
|
225
|
+
return values[i];
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
for (let i = 0;i < values.length; i++) {
|
|
230
|
+
if (values[i] > currentValue)
|
|
231
|
+
return values[i];
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
findNearestValue(currentValue, reverse) {
|
|
236
|
+
return this.constructor.findNearestValueInList(this.values, currentValue, reverse);
|
|
237
|
+
}
|
|
218
238
|
serialize() {
|
|
219
239
|
return {
|
|
220
240
|
wildcard: this.#wildcard,
|
|
@@ -224,17 +244,17 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
224
244
|
validate() {
|
|
225
245
|
let badValue;
|
|
226
246
|
const charsString = this.chars.length > 0 ? ` or chars ${this.chars.join("")}` : "";
|
|
227
|
-
const
|
|
247
|
+
const field = this.constructor;
|
|
228
248
|
const rangeTest = (value) => {
|
|
229
249
|
badValue = value;
|
|
230
|
-
return typeof value === "number" ? value >= this.min && value <= this.max :
|
|
250
|
+
return typeof value === "number" ? value >= this.min && value <= this.max : field.isValidChar(value);
|
|
231
251
|
};
|
|
232
252
|
const isValidRange = this.#values.every(rangeTest);
|
|
233
253
|
if (!isValidRange) {
|
|
234
254
|
throw new Error(`${this.constructor.name} Validation error, got value ${badValue} expected range ${this.min}-${this.max}${charsString}`);
|
|
235
255
|
}
|
|
236
256
|
const duplicate = this.#values.find((value, index) => this.#values.indexOf(value) !== index);
|
|
237
|
-
if (duplicate) {
|
|
257
|
+
if (duplicate !== undefined) {
|
|
238
258
|
throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${duplicate}`);
|
|
239
259
|
}
|
|
240
260
|
}
|
|
@@ -248,135 +268,6 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
248
268
|
exports.CronField = CronField;
|
|
249
269
|
});
|
|
250
270
|
|
|
251
|
-
// node_modules/cron-parser/dist/fields/CronDayOfMonth.js
|
|
252
|
-
var require_CronDayOfMonth = __commonJS(function(exports) {
|
|
253
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
254
|
-
exports.CronDayOfMonth = undefined;
|
|
255
|
-
var CronField_1 = require_CronField();
|
|
256
|
-
var MIN_DAY = 1;
|
|
257
|
-
var MAX_DAY = 31;
|
|
258
|
-
var DAY_CHARS = Object.freeze(["L"]);
|
|
259
|
-
|
|
260
|
-
class CronDayOfMonth extends CronField_1.CronField {
|
|
261
|
-
static get min() {
|
|
262
|
-
return MIN_DAY;
|
|
263
|
-
}
|
|
264
|
-
static get max() {
|
|
265
|
-
return MAX_DAY;
|
|
266
|
-
}
|
|
267
|
-
static get chars() {
|
|
268
|
-
return DAY_CHARS;
|
|
269
|
-
}
|
|
270
|
-
static get validChars() {
|
|
271
|
-
return /^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/;
|
|
272
|
-
}
|
|
273
|
-
constructor(values, options) {
|
|
274
|
-
super(values, options);
|
|
275
|
-
this.validate();
|
|
276
|
-
}
|
|
277
|
-
get values() {
|
|
278
|
-
return super.values;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
exports.CronDayOfMonth = CronDayOfMonth;
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
// node_modules/cron-parser/dist/fields/CronDayOfWeek.js
|
|
285
|
-
var require_CronDayOfWeek = __commonJS(function(exports) {
|
|
286
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
287
|
-
exports.CronDayOfWeek = undefined;
|
|
288
|
-
var CronField_1 = require_CronField();
|
|
289
|
-
var MIN_DAY = 0;
|
|
290
|
-
var MAX_DAY = 7;
|
|
291
|
-
var DAY_CHARS = Object.freeze(["L"]);
|
|
292
|
-
|
|
293
|
-
class CronDayOfWeek extends CronField_1.CronField {
|
|
294
|
-
static get min() {
|
|
295
|
-
return MIN_DAY;
|
|
296
|
-
}
|
|
297
|
-
static get max() {
|
|
298
|
-
return MAX_DAY;
|
|
299
|
-
}
|
|
300
|
-
static get chars() {
|
|
301
|
-
return DAY_CHARS;
|
|
302
|
-
}
|
|
303
|
-
static get validChars() {
|
|
304
|
-
return /^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/;
|
|
305
|
-
}
|
|
306
|
-
constructor(values, options) {
|
|
307
|
-
super(values, options);
|
|
308
|
-
this.validate();
|
|
309
|
-
}
|
|
310
|
-
get values() {
|
|
311
|
-
return super.values;
|
|
312
|
-
}
|
|
313
|
-
get nthDay() {
|
|
314
|
-
return this.options.nthDayOfWeek ?? 0;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
exports.CronDayOfWeek = CronDayOfWeek;
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
// node_modules/cron-parser/dist/fields/CronHour.js
|
|
321
|
-
var require_CronHour = __commonJS(function(exports) {
|
|
322
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
323
|
-
exports.CronHour = undefined;
|
|
324
|
-
var CronField_1 = require_CronField();
|
|
325
|
-
var MIN_HOUR = 0;
|
|
326
|
-
var MAX_HOUR = 23;
|
|
327
|
-
var HOUR_CHARS = Object.freeze([]);
|
|
328
|
-
|
|
329
|
-
class CronHour extends CronField_1.CronField {
|
|
330
|
-
static get min() {
|
|
331
|
-
return MIN_HOUR;
|
|
332
|
-
}
|
|
333
|
-
static get max() {
|
|
334
|
-
return MAX_HOUR;
|
|
335
|
-
}
|
|
336
|
-
static get chars() {
|
|
337
|
-
return HOUR_CHARS;
|
|
338
|
-
}
|
|
339
|
-
constructor(values, options) {
|
|
340
|
-
super(values, options);
|
|
341
|
-
this.validate();
|
|
342
|
-
}
|
|
343
|
-
get values() {
|
|
344
|
-
return super.values;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
exports.CronHour = CronHour;
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
// node_modules/cron-parser/dist/fields/CronMinute.js
|
|
351
|
-
var require_CronMinute = __commonJS(function(exports) {
|
|
352
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
353
|
-
exports.CronMinute = undefined;
|
|
354
|
-
var CronField_1 = require_CronField();
|
|
355
|
-
var MIN_MINUTE = 0;
|
|
356
|
-
var MAX_MINUTE = 59;
|
|
357
|
-
var MINUTE_CHARS = Object.freeze([]);
|
|
358
|
-
|
|
359
|
-
class CronMinute extends CronField_1.CronField {
|
|
360
|
-
static get min() {
|
|
361
|
-
return MIN_MINUTE;
|
|
362
|
-
}
|
|
363
|
-
static get max() {
|
|
364
|
-
return MAX_MINUTE;
|
|
365
|
-
}
|
|
366
|
-
static get chars() {
|
|
367
|
-
return MINUTE_CHARS;
|
|
368
|
-
}
|
|
369
|
-
constructor(values, options) {
|
|
370
|
-
super(values, options);
|
|
371
|
-
this.validate();
|
|
372
|
-
}
|
|
373
|
-
get values() {
|
|
374
|
-
return super.values;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
exports.CronMinute = CronMinute;
|
|
378
|
-
});
|
|
379
|
-
|
|
380
271
|
// node_modules/luxon/build/node/luxon.js
|
|
381
272
|
var require_luxon = __commonJS(function(exports) {
|
|
382
273
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -5269,32 +5160,16 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5269
5160
|
class CronDate {
|
|
5270
5161
|
#date;
|
|
5271
5162
|
#dstStart = null;
|
|
5163
|
+
#dstStartLandingHour = null;
|
|
5272
5164
|
#dstEnd = null;
|
|
5273
|
-
#verbMap = {
|
|
5274
|
-
add: {
|
|
5275
|
-
[TimeUnit.Year]: this.addYear.bind(this),
|
|
5276
|
-
[TimeUnit.Month]: this.addMonth.bind(this),
|
|
5277
|
-
[TimeUnit.Day]: this.addDay.bind(this),
|
|
5278
|
-
[TimeUnit.Hour]: this.addHour.bind(this),
|
|
5279
|
-
[TimeUnit.Minute]: this.addMinute.bind(this),
|
|
5280
|
-
[TimeUnit.Second]: this.addSecond.bind(this)
|
|
5281
|
-
},
|
|
5282
|
-
subtract: {
|
|
5283
|
-
[TimeUnit.Year]: this.subtractYear.bind(this),
|
|
5284
|
-
[TimeUnit.Month]: this.subtractMonth.bind(this),
|
|
5285
|
-
[TimeUnit.Day]: this.subtractDay.bind(this),
|
|
5286
|
-
[TimeUnit.Hour]: this.subtractHour.bind(this),
|
|
5287
|
-
[TimeUnit.Minute]: this.subtractMinute.bind(this),
|
|
5288
|
-
[TimeUnit.Second]: this.subtractSecond.bind(this)
|
|
5289
|
-
}
|
|
5290
|
-
};
|
|
5291
5165
|
constructor(timestamp, tz) {
|
|
5292
5166
|
const dateOpts = { zone: tz };
|
|
5293
|
-
if (!timestamp) {
|
|
5167
|
+
if (!timestamp && timestamp !== 0) {
|
|
5294
5168
|
this.#date = luxon_1.DateTime.local();
|
|
5295
5169
|
} else if (timestamp instanceof CronDate) {
|
|
5296
5170
|
this.#date = timestamp.#date;
|
|
5297
5171
|
this.#dstStart = timestamp.#dstStart;
|
|
5172
|
+
this.#dstStartLandingHour = timestamp.#dstStartLandingHour;
|
|
5298
5173
|
this.#dstEnd = timestamp.#dstEnd;
|
|
5299
5174
|
} else if (timestamp instanceof Date) {
|
|
5300
5175
|
this.#date = luxon_1.DateTime.fromJSDate(timestamp, dateOpts);
|
|
@@ -5305,6 +5180,7 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5305
5180
|
this.#date.isValid || (this.#date = luxon_1.DateTime.fromRFC2822(timestamp, dateOpts));
|
|
5306
5181
|
this.#date.isValid || (this.#date = luxon_1.DateTime.fromSQL(timestamp, dateOpts));
|
|
5307
5182
|
this.#date.isValid || (this.#date = luxon_1.DateTime.fromFormat(timestamp, "EEE, d MMM yyyy HH:mm:ss", dateOpts));
|
|
5183
|
+
this.#date.isValid || (this.#date = luxon_1.DateTime.fromHTTP(timestamp, dateOpts));
|
|
5308
5184
|
}
|
|
5309
5185
|
if (!this.#date.isValid) {
|
|
5310
5186
|
throw new Error(`CronDate: unhandled timestamp: ${timestamp}`);
|
|
@@ -5319,8 +5195,12 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5319
5195
|
get dstStart() {
|
|
5320
5196
|
return this.#dstStart;
|
|
5321
5197
|
}
|
|
5322
|
-
|
|
5323
|
-
this.#
|
|
5198
|
+
get dstStartLandingHour() {
|
|
5199
|
+
return this.#dstStartLandingHour;
|
|
5200
|
+
}
|
|
5201
|
+
clearDstStart() {
|
|
5202
|
+
this.#dstStart = null;
|
|
5203
|
+
this.#dstStartLandingHour = null;
|
|
5324
5204
|
}
|
|
5325
5205
|
get dstEnd() {
|
|
5326
5206
|
return this.#dstEnd;
|
|
@@ -5365,10 +5245,36 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5365
5245
|
this.#date = this.#date.minus({ seconds: 1 });
|
|
5366
5246
|
}
|
|
5367
5247
|
addUnit(unit) {
|
|
5368
|
-
|
|
5248
|
+
switch (unit) {
|
|
5249
|
+
case TimeUnit.Year:
|
|
5250
|
+
return this.addYear();
|
|
5251
|
+
case TimeUnit.Month:
|
|
5252
|
+
return this.addMonth();
|
|
5253
|
+
case TimeUnit.Day:
|
|
5254
|
+
return this.addDay();
|
|
5255
|
+
case TimeUnit.Hour:
|
|
5256
|
+
return this.addHour();
|
|
5257
|
+
case TimeUnit.Minute:
|
|
5258
|
+
return this.addMinute();
|
|
5259
|
+
case TimeUnit.Second:
|
|
5260
|
+
return this.addSecond();
|
|
5261
|
+
}
|
|
5369
5262
|
}
|
|
5370
5263
|
subtractUnit(unit) {
|
|
5371
|
-
|
|
5264
|
+
switch (unit) {
|
|
5265
|
+
case TimeUnit.Year:
|
|
5266
|
+
return this.subtractYear();
|
|
5267
|
+
case TimeUnit.Month:
|
|
5268
|
+
return this.subtractMonth();
|
|
5269
|
+
case TimeUnit.Day:
|
|
5270
|
+
return this.subtractDay();
|
|
5271
|
+
case TimeUnit.Hour:
|
|
5272
|
+
return this.subtractHour();
|
|
5273
|
+
case TimeUnit.Minute:
|
|
5274
|
+
return this.subtractMinute();
|
|
5275
|
+
case TimeUnit.Second:
|
|
5276
|
+
return this.subtractSecond();
|
|
5277
|
+
}
|
|
5372
5278
|
}
|
|
5373
5279
|
invokeDateOperation(verb, unit) {
|
|
5374
5280
|
if (verb === DateMathOp.Add) {
|
|
@@ -5406,6 +5312,15 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5406
5312
|
getMilliseconds() {
|
|
5407
5313
|
return this.#date.millisecond;
|
|
5408
5314
|
}
|
|
5315
|
+
getUTCOffset() {
|
|
5316
|
+
return this.#date.offset;
|
|
5317
|
+
}
|
|
5318
|
+
setStartOfDay() {
|
|
5319
|
+
this.#date = this.#date.startOf("day");
|
|
5320
|
+
}
|
|
5321
|
+
setEndOfDay() {
|
|
5322
|
+
this.#date = this.#date.endOf("day");
|
|
5323
|
+
}
|
|
5409
5324
|
getTime() {
|
|
5410
5325
|
return this.#date.valueOf();
|
|
5411
5326
|
}
|
|
@@ -5437,29 +5352,34 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5437
5352
|
toJSON() {
|
|
5438
5353
|
return this.#date.toJSON();
|
|
5439
5354
|
}
|
|
5355
|
+
#set(unit, value) {
|
|
5356
|
+
if (this.#date[unit] !== value) {
|
|
5357
|
+
this.#date = this.#date.set({ [unit]: value });
|
|
5358
|
+
}
|
|
5359
|
+
}
|
|
5440
5360
|
setDate(d) {
|
|
5441
|
-
this.#
|
|
5361
|
+
this.#set("day", d);
|
|
5442
5362
|
}
|
|
5443
5363
|
setFullYear(y) {
|
|
5444
|
-
this.#
|
|
5364
|
+
this.#set("year", y);
|
|
5445
5365
|
}
|
|
5446
5366
|
setDay(d) {
|
|
5447
|
-
this.#
|
|
5367
|
+
this.#set("weekday", d);
|
|
5448
5368
|
}
|
|
5449
5369
|
setMonth(m) {
|
|
5450
|
-
this.#
|
|
5370
|
+
this.#set("month", m + 1);
|
|
5451
5371
|
}
|
|
5452
5372
|
setHours(h) {
|
|
5453
|
-
this.#
|
|
5373
|
+
this.#set("hour", h);
|
|
5454
5374
|
}
|
|
5455
5375
|
setMinutes(m) {
|
|
5456
|
-
this.#
|
|
5376
|
+
this.#set("minute", m);
|
|
5457
5377
|
}
|
|
5458
5378
|
setSeconds(s) {
|
|
5459
|
-
this.#
|
|
5379
|
+
this.#set("second", s);
|
|
5460
5380
|
}
|
|
5461
5381
|
setMilliseconds(s) {
|
|
5462
|
-
this.#
|
|
5382
|
+
this.#set("millisecond", s);
|
|
5463
5383
|
}
|
|
5464
5384
|
toString() {
|
|
5465
5385
|
return this.toDate().toString();
|
|
@@ -5488,17 +5408,24 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5488
5408
|
applyDateOperation(op, unit, hoursLength) {
|
|
5489
5409
|
if (unit === TimeUnit.Month || unit === TimeUnit.Day) {
|
|
5490
5410
|
this.invokeDateOperation(op, unit);
|
|
5411
|
+
this.clearDstStart();
|
|
5412
|
+
if (op === DateMathOp.Add && hoursLength !== 24 && this.getHours() > 0) {
|
|
5413
|
+
this.#dstStart = 0;
|
|
5414
|
+
this.#dstStartLandingHour = this.getHours();
|
|
5415
|
+
}
|
|
5491
5416
|
return;
|
|
5492
5417
|
}
|
|
5493
5418
|
const previousHour = this.getHours();
|
|
5419
|
+
const previousOffset = this.getUTCOffset();
|
|
5494
5420
|
this.invokeDateOperation(op, unit);
|
|
5495
5421
|
const currentHour = this.getHours();
|
|
5496
|
-
const
|
|
5497
|
-
if (
|
|
5422
|
+
const advance = (currentHour - previousHour + 24) % 24;
|
|
5423
|
+
if (op === DateMathOp.Add && this.getUTCOffset() > previousOffset && advance >= 2) {
|
|
5498
5424
|
if (hoursLength !== 24) {
|
|
5499
|
-
this
|
|
5425
|
+
this.#dstStart = (previousHour + 1) % 24;
|
|
5426
|
+
this.#dstStartLandingHour = currentHour;
|
|
5500
5427
|
}
|
|
5501
|
-
} else if (
|
|
5428
|
+
} else if (advance === 0 && this.getMinutes() === 0 && this.getSeconds() === 0) {
|
|
5502
5429
|
if (hoursLength !== 24) {
|
|
5503
5430
|
this.dstEnd = currentHour;
|
|
5504
5431
|
}
|
|
@@ -5546,6 +5473,150 @@ var require_CronMonth = __commonJS(function(exports) {
|
|
|
5546
5473
|
exports.CronMonth = CronMonth;
|
|
5547
5474
|
});
|
|
5548
5475
|
|
|
5476
|
+
// node_modules/cron-parser/dist/fields/CronDayOfMonth.js
|
|
5477
|
+
var require_CronDayOfMonth = __commonJS(function(exports) {
|
|
5478
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5479
|
+
exports.CronDayOfMonth = undefined;
|
|
5480
|
+
var CronField_1 = require_CronField();
|
|
5481
|
+
var CronMonth_1 = require_CronMonth();
|
|
5482
|
+
var MIN_DAY = 1;
|
|
5483
|
+
var MAX_DAY = 31;
|
|
5484
|
+
var DAY_CHARS = Object.freeze(["L"]);
|
|
5485
|
+
|
|
5486
|
+
class CronDayOfMonth extends CronField_1.CronField {
|
|
5487
|
+
static fromMonth(month, values, options) {
|
|
5488
|
+
if (month.length !== 1) {
|
|
5489
|
+
return new CronDayOfMonth(values, options);
|
|
5490
|
+
}
|
|
5491
|
+
const daysInMonth = CronMonth_1.CronMonth.daysInMonth[month[0] - 1];
|
|
5492
|
+
const days = values.filter((value) => typeof value !== "number" || value <= daysInMonth);
|
|
5493
|
+
return new CronDayOfMonth(days.length > 0 ? days : values, options);
|
|
5494
|
+
}
|
|
5495
|
+
static get min() {
|
|
5496
|
+
return MIN_DAY;
|
|
5497
|
+
}
|
|
5498
|
+
static get max() {
|
|
5499
|
+
return MAX_DAY;
|
|
5500
|
+
}
|
|
5501
|
+
static get chars() {
|
|
5502
|
+
return DAY_CHARS;
|
|
5503
|
+
}
|
|
5504
|
+
static get validChars() {
|
|
5505
|
+
return /^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/;
|
|
5506
|
+
}
|
|
5507
|
+
constructor(values, options) {
|
|
5508
|
+
super(values, options);
|
|
5509
|
+
this.validate();
|
|
5510
|
+
}
|
|
5511
|
+
get values() {
|
|
5512
|
+
return super.values;
|
|
5513
|
+
}
|
|
5514
|
+
}
|
|
5515
|
+
exports.CronDayOfMonth = CronDayOfMonth;
|
|
5516
|
+
});
|
|
5517
|
+
|
|
5518
|
+
// node_modules/cron-parser/dist/fields/CronDayOfWeek.js
|
|
5519
|
+
var require_CronDayOfWeek = __commonJS(function(exports) {
|
|
5520
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5521
|
+
exports.CronDayOfWeek = undefined;
|
|
5522
|
+
var CronField_1 = require_CronField();
|
|
5523
|
+
var MIN_DAY = 0;
|
|
5524
|
+
var MAX_DAY = 7;
|
|
5525
|
+
var DAY_CHARS = Object.freeze(["L"]);
|
|
5526
|
+
|
|
5527
|
+
class CronDayOfWeek extends CronField_1.CronField {
|
|
5528
|
+
static get min() {
|
|
5529
|
+
return MIN_DAY;
|
|
5530
|
+
}
|
|
5531
|
+
static get max() {
|
|
5532
|
+
return MAX_DAY;
|
|
5533
|
+
}
|
|
5534
|
+
static get chars() {
|
|
5535
|
+
return DAY_CHARS;
|
|
5536
|
+
}
|
|
5537
|
+
static isValidChar(value) {
|
|
5538
|
+
return /^[0-7]?L$/.test(value);
|
|
5539
|
+
}
|
|
5540
|
+
static get validChars() {
|
|
5541
|
+
return /^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/;
|
|
5542
|
+
}
|
|
5543
|
+
constructor(values, options) {
|
|
5544
|
+
super(values, options);
|
|
5545
|
+
this.validate();
|
|
5546
|
+
if (this.values.some((value) => value === "L")) {
|
|
5547
|
+
throw new Error(`${this.constructor.name} Validation error, unexpected standalone L`);
|
|
5548
|
+
}
|
|
5549
|
+
}
|
|
5550
|
+
get values() {
|
|
5551
|
+
return super.values;
|
|
5552
|
+
}
|
|
5553
|
+
get nthDay() {
|
|
5554
|
+
return this.options.nthDayOfWeek ?? 0;
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
exports.CronDayOfWeek = CronDayOfWeek;
|
|
5558
|
+
});
|
|
5559
|
+
|
|
5560
|
+
// node_modules/cron-parser/dist/fields/CronHour.js
|
|
5561
|
+
var require_CronHour = __commonJS(function(exports) {
|
|
5562
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5563
|
+
exports.CronHour = undefined;
|
|
5564
|
+
var CronField_1 = require_CronField();
|
|
5565
|
+
var MIN_HOUR = 0;
|
|
5566
|
+
var MAX_HOUR = 23;
|
|
5567
|
+
var HOUR_CHARS = Object.freeze([]);
|
|
5568
|
+
|
|
5569
|
+
class CronHour extends CronField_1.CronField {
|
|
5570
|
+
static get min() {
|
|
5571
|
+
return MIN_HOUR;
|
|
5572
|
+
}
|
|
5573
|
+
static get max() {
|
|
5574
|
+
return MAX_HOUR;
|
|
5575
|
+
}
|
|
5576
|
+
static get chars() {
|
|
5577
|
+
return HOUR_CHARS;
|
|
5578
|
+
}
|
|
5579
|
+
constructor(values, options) {
|
|
5580
|
+
super(values, options);
|
|
5581
|
+
this.validate();
|
|
5582
|
+
}
|
|
5583
|
+
get values() {
|
|
5584
|
+
return super.values;
|
|
5585
|
+
}
|
|
5586
|
+
}
|
|
5587
|
+
exports.CronHour = CronHour;
|
|
5588
|
+
});
|
|
5589
|
+
|
|
5590
|
+
// node_modules/cron-parser/dist/fields/CronMinute.js
|
|
5591
|
+
var require_CronMinute = __commonJS(function(exports) {
|
|
5592
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5593
|
+
exports.CronMinute = undefined;
|
|
5594
|
+
var CronField_1 = require_CronField();
|
|
5595
|
+
var MIN_MINUTE = 0;
|
|
5596
|
+
var MAX_MINUTE = 59;
|
|
5597
|
+
var MINUTE_CHARS = Object.freeze([]);
|
|
5598
|
+
|
|
5599
|
+
class CronMinute extends CronField_1.CronField {
|
|
5600
|
+
static get min() {
|
|
5601
|
+
return MIN_MINUTE;
|
|
5602
|
+
}
|
|
5603
|
+
static get max() {
|
|
5604
|
+
return MAX_MINUTE;
|
|
5605
|
+
}
|
|
5606
|
+
static get chars() {
|
|
5607
|
+
return MINUTE_CHARS;
|
|
5608
|
+
}
|
|
5609
|
+
constructor(values, options) {
|
|
5610
|
+
super(values, options);
|
|
5611
|
+
this.validate();
|
|
5612
|
+
}
|
|
5613
|
+
get values() {
|
|
5614
|
+
return super.values;
|
|
5615
|
+
}
|
|
5616
|
+
}
|
|
5617
|
+
exports.CronMinute = CronMinute;
|
|
5618
|
+
});
|
|
5619
|
+
|
|
5549
5620
|
// node_modules/cron-parser/dist/fields/CronSecond.js
|
|
5550
5621
|
var require_CronSecond = __commonJS(function(exports) {
|
|
5551
5622
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -5660,8 +5731,9 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5660
5731
|
if (!dayOfWeek) {
|
|
5661
5732
|
throw new Error("Validation error, Field dayOfWeek is missing");
|
|
5662
5733
|
}
|
|
5663
|
-
if (
|
|
5664
|
-
|
|
5734
|
+
if (!dayOfMonth.hasLastChar && dayOfWeek.isWildcard) {
|
|
5735
|
+
const longestMonth = Math.max(...month.values.map((value) => fields_1.CronMonth.daysInMonth[value - 1]));
|
|
5736
|
+
if (!(parseInt(dayOfMonth.values[0], 10) <= longestMonth)) {
|
|
5665
5737
|
throw new Error("Invalid explicit day of month definition");
|
|
5666
5738
|
}
|
|
5667
5739
|
}
|
|
@@ -5747,6 +5819,10 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5747
5819
|
return null;
|
|
5748
5820
|
}
|
|
5749
5821
|
if (step === 1 && range.start === field.min && range.end && range.end >= max) {
|
|
5822
|
+
const isDayField = field instanceof fields_1.CronDayOfMonth || field instanceof fields_1.CronDayOfWeek;
|
|
5823
|
+
if (isDayField && !field.isWildcard) {
|
|
5824
|
+
return null;
|
|
5825
|
+
}
|
|
5750
5826
|
return field.hasQuestionMarkChar ? "?" : "*";
|
|
5751
5827
|
}
|
|
5752
5828
|
if (step !== 1 && range.start === field.min && range.end && range.end >= max - step + 1) {
|
|
@@ -5754,7 +5830,7 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5754
5830
|
}
|
|
5755
5831
|
return null;
|
|
5756
5832
|
}
|
|
5757
|
-
static #handleMultipleRanges(range
|
|
5833
|
+
static #handleMultipleRanges(range) {
|
|
5758
5834
|
const step = range.step;
|
|
5759
5835
|
if (step === 1) {
|
|
5760
5836
|
return `${range.start}-${range.end}`;
|
|
@@ -5779,7 +5855,7 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5779
5855
|
const seed = { length: range.end - range.start + 1 };
|
|
5780
5856
|
return Array.from(seed, mapFn).filter((value) => value !== null).join(",");
|
|
5781
5857
|
}
|
|
5782
|
-
return
|
|
5858
|
+
return `${range.start}-${range.end}/${step}`;
|
|
5783
5859
|
}
|
|
5784
5860
|
stringifyField(field) {
|
|
5785
5861
|
let max = field.max;
|
|
@@ -5800,7 +5876,7 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5800
5876
|
}
|
|
5801
5877
|
}
|
|
5802
5878
|
return ranges.map((range) => {
|
|
5803
|
-
const value = range.count === 1 ? range.start.toString() : CronFieldCollection.#handleMultipleRanges(range
|
|
5879
|
+
const value = range.count === 1 ? range.start.toString() : CronFieldCollection.#handleMultipleRanges(range);
|
|
5804
5880
|
if (field instanceof fields_1.CronDayOfWeek && field.nthDay > 0) {
|
|
5805
5881
|
return `${value}#${field.nthDay}`;
|
|
5806
5882
|
}
|
|
@@ -5841,17 +5917,20 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5841
5917
|
class CronExpression {
|
|
5842
5918
|
#options;
|
|
5843
5919
|
#tz;
|
|
5920
|
+
#initialDate;
|
|
5844
5921
|
#currentDate;
|
|
5845
5922
|
#startDate;
|
|
5846
5923
|
#endDate;
|
|
5847
5924
|
#fields;
|
|
5925
|
+
#dstTransitionDayKey = null;
|
|
5926
|
+
#isDstTransitionDay = false;
|
|
5848
5927
|
constructor(fields, options) {
|
|
5849
5928
|
this.#options = options;
|
|
5850
5929
|
this.#tz = options.tz;
|
|
5851
|
-
this.#startDate = options.startDate ? new CronDate_1.CronDate(options.startDate, this.#tz) : null;
|
|
5852
|
-
this.#endDate = options.endDate ? new CronDate_1.CronDate(options.endDate, this.#tz) : null;
|
|
5930
|
+
this.#startDate = options.startDate != null ? new CronDate_1.CronDate(options.startDate, this.#tz) : null;
|
|
5931
|
+
this.#endDate = options.endDate != null ? new CronDate_1.CronDate(options.endDate, this.#tz) : null;
|
|
5853
5932
|
let currentDateValue = options.currentDate ?? options.startDate;
|
|
5854
|
-
if (currentDateValue) {
|
|
5933
|
+
if (currentDateValue != null) {
|
|
5855
5934
|
const tempCurrentDate = new CronDate_1.CronDate(currentDateValue, this.#tz);
|
|
5856
5935
|
if (this.#startDate && tempCurrentDate.getTime() < this.#startDate.getTime()) {
|
|
5857
5936
|
currentDateValue = this.#startDate;
|
|
@@ -5859,7 +5938,8 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5859
5938
|
currentDateValue = this.#endDate;
|
|
5860
5939
|
}
|
|
5861
5940
|
}
|
|
5862
|
-
this.#
|
|
5941
|
+
this.#initialDate = new CronDate_1.CronDate(currentDateValue, this.#tz);
|
|
5942
|
+
this.#currentDate = this.#initialDate;
|
|
5863
5943
|
this.#fields = fields;
|
|
5864
5944
|
}
|
|
5865
5945
|
get fields() {
|
|
@@ -5871,15 +5951,56 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5871
5951
|
static #matchSchedule(value, sequence) {
|
|
5872
5952
|
return sequence.some((element) => element === value);
|
|
5873
5953
|
}
|
|
5954
|
+
#getMinOrMax(values, reverse) {
|
|
5955
|
+
return values[reverse ? values.length - 1 : 0];
|
|
5956
|
+
}
|
|
5957
|
+
#checkDstTransition(currentDate) {
|
|
5958
|
+
const key = `${currentDate.getFullYear()}-${currentDate.getMonth() + 1}-${currentDate.getDate()}`;
|
|
5959
|
+
if (this.#dstTransitionDayKey === key) {
|
|
5960
|
+
return this.#isDstTransitionDay;
|
|
5961
|
+
}
|
|
5962
|
+
const startOfDay = new CronDate_1.CronDate(currentDate);
|
|
5963
|
+
startOfDay.setStartOfDay();
|
|
5964
|
+
const endOfDay = new CronDate_1.CronDate(currentDate);
|
|
5965
|
+
endOfDay.setEndOfDay();
|
|
5966
|
+
this.#dstTransitionDayKey = key;
|
|
5967
|
+
this.#isDstTransitionDay = startOfDay.getUTCOffset() !== endOfDay.getUTCOffset();
|
|
5968
|
+
return this.#isDstTransitionDay;
|
|
5969
|
+
}
|
|
5970
|
+
#moveToNextSecond(currentDate, dateMathVerb, reverse) {
|
|
5971
|
+
const seconds = this.#fields.second.values;
|
|
5972
|
+
const currentSecond = currentDate.getSeconds();
|
|
5973
|
+
const nextSecond = this.#fields.second.findNearestValue(currentSecond, reverse);
|
|
5974
|
+
if (nextSecond !== null) {
|
|
5975
|
+
currentDate.setSeconds(nextSecond);
|
|
5976
|
+
return;
|
|
5977
|
+
}
|
|
5978
|
+
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Minute, this.#fields.hour.values.length);
|
|
5979
|
+
currentDate.setSeconds(this.#getMinOrMax(seconds, reverse));
|
|
5980
|
+
}
|
|
5981
|
+
#moveToNextMinute(currentDate, dateMathVerb, reverse) {
|
|
5982
|
+
const minutes = this.#fields.minute.values;
|
|
5983
|
+
const seconds = this.#fields.second.values;
|
|
5984
|
+
const currentMinute = currentDate.getMinutes();
|
|
5985
|
+
const nextMinute = this.#fields.minute.findNearestValue(currentMinute, reverse);
|
|
5986
|
+
if (nextMinute !== null) {
|
|
5987
|
+
currentDate.setMinutes(nextMinute);
|
|
5988
|
+
currentDate.setSeconds(this.#getMinOrMax(seconds, reverse));
|
|
5989
|
+
return;
|
|
5990
|
+
}
|
|
5991
|
+
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Hour, this.#fields.hour.values.length);
|
|
5992
|
+
currentDate.setMinutes(this.#getMinOrMax(minutes, reverse));
|
|
5993
|
+
currentDate.setSeconds(this.#getMinOrMax(seconds, reverse));
|
|
5994
|
+
}
|
|
5874
5995
|
static #isLastWeekdayOfMonthMatch(expressions, currentDate) {
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5996
|
+
if (!currentDate.isLastWeekdayOfMonth()) {
|
|
5997
|
+
return false;
|
|
5998
|
+
}
|
|
5999
|
+
const day = currentDate.getDay();
|
|
6000
|
+
return expressions.some((expression) => day === parseInt(expression.toString().charAt(0), 10) % 7);
|
|
6001
|
+
}
|
|
6002
|
+
static #isNthWeekdayOfMonthMatch(nthDay, currentDate) {
|
|
6003
|
+
return nthDay <= 0 || Math.ceil(currentDate.getDate() / 7) === nthDay;
|
|
5883
6004
|
}
|
|
5884
6005
|
next() {
|
|
5885
6006
|
return this.#findSchedule();
|
|
@@ -5931,7 +6052,7 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5931
6052
|
return items;
|
|
5932
6053
|
}
|
|
5933
6054
|
reset(newDate) {
|
|
5934
|
-
this.#currentDate = new CronDate_1.CronDate(newDate
|
|
6055
|
+
this.#currentDate = newDate ? new CronDate_1.CronDate(newDate, this.#tz) : this.#initialDate;
|
|
5935
6056
|
}
|
|
5936
6057
|
stringify(includeSeconds = false) {
|
|
5937
6058
|
return this.#fields.stringify(includeSeconds);
|
|
@@ -5945,12 +6066,6 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5945
6066
|
if (!this.#matchDayOfMonth(dt)) {
|
|
5946
6067
|
return false;
|
|
5947
6068
|
}
|
|
5948
|
-
if (this.#fields.dayOfWeek.nthDay > 0) {
|
|
5949
|
-
const weekInMonth = Math.ceil(dt.getDate() / 7);
|
|
5950
|
-
if (weekInMonth !== this.#fields.dayOfWeek.nthDay) {
|
|
5951
|
-
return false;
|
|
5952
|
-
}
|
|
5953
|
-
}
|
|
5954
6069
|
return true;
|
|
5955
6070
|
}
|
|
5956
6071
|
toString() {
|
|
@@ -5962,7 +6077,8 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5962
6077
|
const isDayOfWeekWildcardMatch = this.#fields.dayOfWeek.isWildcard;
|
|
5963
6078
|
const isRestrictedDayOfWeek = !isDayOfWeekWildcardMatch;
|
|
5964
6079
|
const matchedDOM = CronExpression.#matchSchedule(currentDate.getDate(), this.#fields.dayOfMonth.values) || this.#fields.dayOfMonth.hasLastChar && currentDate.isLastDayOfMonth();
|
|
5965
|
-
const
|
|
6080
|
+
const nthDay = this.#fields.dayOfWeek.nthDay;
|
|
6081
|
+
const matchedDOW = CronExpression.#matchSchedule(currentDate.getDay(), this.#fields.dayOfWeek.values) && CronExpression.#isNthWeekdayOfMonthMatch(nthDay, currentDate) || this.#fields.dayOfWeek.hasLastChar && CronExpression.#isLastWeekdayOfMonthMatch(this.#fields.dayOfWeek.values, currentDate);
|
|
5966
6082
|
if (isRestrictedDayOfMonth && isRestrictedDayOfWeek && (matchedDOM || matchedDOW)) {
|
|
5967
6083
|
return true;
|
|
5968
6084
|
}
|
|
@@ -5975,25 +6091,47 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5975
6091
|
return false;
|
|
5976
6092
|
}
|
|
5977
6093
|
#matchHour(currentDate, dateMathVerb, reverse) {
|
|
6094
|
+
const hourValues = this.#fields.hour.values;
|
|
6095
|
+
const hours = hourValues;
|
|
5978
6096
|
const currentHour = currentDate.getHours();
|
|
5979
|
-
const isMatch = CronExpression.#matchSchedule(currentHour,
|
|
5980
|
-
const isDstStart = currentDate.dstStart === currentHour;
|
|
6097
|
+
const isMatch = CronExpression.#matchSchedule(currentHour, hourValues);
|
|
5981
6098
|
const isDstEnd = currentDate.dstEnd === currentHour;
|
|
5982
|
-
if (
|
|
5983
|
-
currentDate.dstStart =
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
currentDate.invokeDateOperation(dateMathVerb, CronDate_1.TimeUnit.Hour);
|
|
5989
|
-
return false;
|
|
6099
|
+
if (currentDate.dstStart !== null && currentDate.dstStartLandingHour === currentHour) {
|
|
6100
|
+
for (let skipped = currentDate.dstStart;skipped !== currentHour; skipped = (skipped + 1) % 24) {
|
|
6101
|
+
if (CronExpression.#matchSchedule(skipped, hourValues)) {
|
|
6102
|
+
return true;
|
|
6103
|
+
}
|
|
6104
|
+
}
|
|
5990
6105
|
}
|
|
5991
6106
|
if (isDstEnd && !reverse) {
|
|
5992
6107
|
currentDate.dstEnd = null;
|
|
5993
|
-
currentDate.applyDateOperation(CronDate_1.DateMathOp.Add, CronDate_1.TimeUnit.Hour,
|
|
6108
|
+
currentDate.applyDateOperation(CronDate_1.DateMathOp.Add, CronDate_1.TimeUnit.Hour, hours.length);
|
|
5994
6109
|
return false;
|
|
5995
6110
|
}
|
|
5996
|
-
|
|
6111
|
+
if (isMatch) {
|
|
6112
|
+
return true;
|
|
6113
|
+
}
|
|
6114
|
+
currentDate.clearDstStart();
|
|
6115
|
+
const nextHour = this.#fields.hour.findNearestValue(currentHour, reverse);
|
|
6116
|
+
if (nextHour === null) {
|
|
6117
|
+
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Day, hours.length);
|
|
6118
|
+
return false;
|
|
6119
|
+
}
|
|
6120
|
+
if (this.#checkDstTransition(currentDate)) {
|
|
6121
|
+
const steps = reverse ? currentHour - nextHour : nextHour - currentHour;
|
|
6122
|
+
for (let i = 0;i < steps; i++) {
|
|
6123
|
+
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Hour, hours.length);
|
|
6124
|
+
if (!reverse && currentDate.getHours() >= nextHour)
|
|
6125
|
+
break;
|
|
6126
|
+
if (reverse && currentDate.getHours() <= nextHour)
|
|
6127
|
+
break;
|
|
6128
|
+
}
|
|
6129
|
+
} else {
|
|
6130
|
+
currentDate.setHours(nextHour);
|
|
6131
|
+
}
|
|
6132
|
+
currentDate.setMinutes(this.#getMinOrMax(this.#fields.minute.values, reverse));
|
|
6133
|
+
currentDate.setSeconds(this.#getMinOrMax(this.#fields.second.values, reverse));
|
|
6134
|
+
return false;
|
|
5997
6135
|
}
|
|
5998
6136
|
#validateTimeSpan(currentDate) {
|
|
5999
6137
|
if (!this.#startDate && !this.#endDate) {
|
|
@@ -6011,54 +6149,55 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
6011
6149
|
const dateMathVerb = reverse ? CronDate_1.DateMathOp.Subtract : CronDate_1.DateMathOp.Add;
|
|
6012
6150
|
const currentDate = new CronDate_1.CronDate(this.#currentDate);
|
|
6013
6151
|
const startTimestamp = currentDate.getTime();
|
|
6152
|
+
if (currentDate.getMilliseconds() > 0) {
|
|
6153
|
+
currentDate.setMilliseconds(0);
|
|
6154
|
+
if (!reverse) {
|
|
6155
|
+
currentDate.applyDateOperation(CronDate_1.DateMathOp.Add, CronDate_1.TimeUnit.Second, this.#fields.hour.values.length);
|
|
6156
|
+
}
|
|
6157
|
+
}
|
|
6014
6158
|
let stepCount = 0;
|
|
6015
6159
|
while (++stepCount < LOOP_LIMIT) {
|
|
6016
6160
|
this.#validateTimeSpan(currentDate);
|
|
6017
|
-
if (!
|
|
6018
|
-
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.
|
|
6161
|
+
if (!CronExpression.#matchSchedule(currentDate.getMonth() + 1, this.#fields.month.values)) {
|
|
6162
|
+
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Month, this.#fields.hour.values.length);
|
|
6019
6163
|
continue;
|
|
6020
6164
|
}
|
|
6021
|
-
if (!
|
|
6165
|
+
if (!this.#matchDayOfMonth(currentDate)) {
|
|
6022
6166
|
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Day, this.#fields.hour.values.length);
|
|
6023
6167
|
continue;
|
|
6024
6168
|
}
|
|
6025
|
-
if (!CronExpression.#matchSchedule(currentDate.getMonth() + 1, this.#fields.month.values)) {
|
|
6026
|
-
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Month, this.#fields.hour.values.length);
|
|
6027
|
-
continue;
|
|
6028
|
-
}
|
|
6029
6169
|
if (!this.#matchHour(currentDate, dateMathVerb, reverse)) {
|
|
6030
6170
|
continue;
|
|
6031
6171
|
}
|
|
6032
6172
|
if (!CronExpression.#matchSchedule(currentDate.getMinutes(), this.#fields.minute.values)) {
|
|
6033
|
-
currentDate
|
|
6173
|
+
this.#moveToNextMinute(currentDate, dateMathVerb, reverse);
|
|
6034
6174
|
continue;
|
|
6035
6175
|
}
|
|
6036
6176
|
if (!CronExpression.#matchSchedule(currentDate.getSeconds(), this.#fields.second.values)) {
|
|
6037
|
-
currentDate
|
|
6177
|
+
this.#moveToNextSecond(currentDate, dateMathVerb, reverse);
|
|
6038
6178
|
continue;
|
|
6039
6179
|
}
|
|
6040
6180
|
if (startTimestamp === currentDate.getTime()) {
|
|
6041
|
-
|
|
6042
|
-
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Second, this.#fields.hour.values.length);
|
|
6043
|
-
}
|
|
6181
|
+
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Second, this.#fields.hour.values.length);
|
|
6044
6182
|
continue;
|
|
6045
6183
|
}
|
|
6046
6184
|
break;
|
|
6047
6185
|
}
|
|
6048
|
-
if (stepCount
|
|
6186
|
+
if (stepCount >= LOOP_LIMIT) {
|
|
6049
6187
|
throw new Error(exports.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);
|
|
6050
6188
|
}
|
|
6051
|
-
if (currentDate.getMilliseconds() !== 0) {
|
|
6052
|
-
currentDate.setMilliseconds(0);
|
|
6053
|
-
}
|
|
6054
6189
|
this.#currentDate = currentDate;
|
|
6055
6190
|
return currentDate;
|
|
6056
6191
|
}
|
|
6057
6192
|
[Symbol.iterator]() {
|
|
6058
6193
|
return {
|
|
6059
6194
|
next: () => {
|
|
6060
|
-
|
|
6061
|
-
|
|
6195
|
+
try {
|
|
6196
|
+
const schedule = this.#findSchedule();
|
|
6197
|
+
return { value: schedule, done: false };
|
|
6198
|
+
} catch {
|
|
6199
|
+
return { value: undefined, done: true };
|
|
6200
|
+
}
|
|
6062
6201
|
}
|
|
6063
6202
|
};
|
|
6064
6203
|
}
|
|
@@ -6148,28 +6287,32 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6148
6287
|
DayOfWeek[DayOfWeek["fri"] = 5] = "fri";
|
|
6149
6288
|
DayOfWeek[DayOfWeek["sat"] = 6] = "sat";
|
|
6150
6289
|
})(DayOfWeek || (exports.DayOfWeek = DayOfWeek = {}));
|
|
6290
|
+
var MAX_FIELD_VALUES = 256;
|
|
6291
|
+
var MAX_EXPRESSION_LENGTH = 1024;
|
|
6151
6292
|
|
|
6152
6293
|
class CronExpressionParser {
|
|
6153
6294
|
static parse(expression, options = {}) {
|
|
6154
6295
|
const { strict = false, hashSeed } = options;
|
|
6155
6296
|
const rand = (0, random_1.seededRandom)(hashSeed);
|
|
6156
|
-
|
|
6297
|
+
if (Object.hasOwn(PredefinedExpressions, expression)) {
|
|
6298
|
+
expression = PredefinedExpressions[expression];
|
|
6299
|
+
}
|
|
6157
6300
|
const rawFields = CronExpressionParser.#getRawFields(expression, strict);
|
|
6158
6301
|
if (!(rawFields.dayOfMonth === "*" || rawFields.dayOfWeek === "*" || !strict)) {
|
|
6159
6302
|
throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");
|
|
6160
6303
|
}
|
|
6161
|
-
const second = CronExpressionParser.#parseField(CronUnit.Second, rawFields.second, fields_1.CronSecond.constraints, rand);
|
|
6162
|
-
const minute = CronExpressionParser.#parseField(CronUnit.Minute, rawFields.minute, fields_1.CronMinute.constraints, rand);
|
|
6163
|
-
const hour = CronExpressionParser.#parseField(CronUnit.Hour, rawFields.hour, fields_1.CronHour.constraints, rand);
|
|
6164
|
-
const month = CronExpressionParser.#parseField(CronUnit.Month, rawFields.month, fields_1.CronMonth.constraints, rand);
|
|
6165
|
-
const dayOfMonth = CronExpressionParser.#parseField(CronUnit.DayOfMonth, rawFields.dayOfMonth, fields_1.CronDayOfMonth.constraints, rand);
|
|
6304
|
+
const second = CronExpressionParser.#parseField(CronUnit.Second, rawFields.second, fields_1.CronSecond.constraints, rand, strict);
|
|
6305
|
+
const minute = CronExpressionParser.#parseField(CronUnit.Minute, rawFields.minute, fields_1.CronMinute.constraints, rand, strict);
|
|
6306
|
+
const hour = CronExpressionParser.#parseField(CronUnit.Hour, rawFields.hour, fields_1.CronHour.constraints, rand, strict);
|
|
6307
|
+
const month = CronExpressionParser.#parseField(CronUnit.Month, rawFields.month, fields_1.CronMonth.constraints, rand, strict);
|
|
6308
|
+
const dayOfMonth = CronExpressionParser.#parseField(CronUnit.DayOfMonth, rawFields.dayOfMonth, fields_1.CronDayOfMonth.constraints, rand, strict);
|
|
6166
6309
|
const { dayOfWeek: _dayOfWeek, nthDayOfWeek } = CronExpressionParser.#parseNthDay(rawFields.dayOfWeek);
|
|
6167
|
-
const dayOfWeek = CronExpressionParser.#parseField(CronUnit.DayOfWeek, _dayOfWeek, fields_1.CronDayOfWeek.constraints, rand);
|
|
6310
|
+
const dayOfWeek = CronExpressionParser.#parseField(CronUnit.DayOfWeek, _dayOfWeek, fields_1.CronDayOfWeek.constraints, rand, strict);
|
|
6168
6311
|
const fields = new CronFieldCollection_1.CronFieldCollection({
|
|
6169
6312
|
second: new fields_1.CronSecond(second, { rawValue: rawFields.second }),
|
|
6170
6313
|
minute: new fields_1.CronMinute(minute, { rawValue: rawFields.minute }),
|
|
6171
6314
|
hour: new fields_1.CronHour(hour, { rawValue: rawFields.hour }),
|
|
6172
|
-
dayOfMonth:
|
|
6315
|
+
dayOfMonth: fields_1.CronDayOfMonth.fromMonth(month, dayOfMonth, { rawValue: rawFields.dayOfMonth }),
|
|
6173
6316
|
month: new fields_1.CronMonth(month, { rawValue: rawFields.month }),
|
|
6174
6317
|
dayOfWeek: new fields_1.CronDayOfWeek(dayOfWeek, { rawValue: rawFields.dayOfWeek, nthDayOfWeek })
|
|
6175
6318
|
});
|
|
@@ -6180,6 +6323,9 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6180
6323
|
throw new Error("Invalid cron expression");
|
|
6181
6324
|
}
|
|
6182
6325
|
expression = expression || "0 * * * * *";
|
|
6326
|
+
if (expression.length > MAX_EXPRESSION_LENGTH) {
|
|
6327
|
+
throw new Error(`Invalid cron expression, too long, expected at most ${MAX_EXPRESSION_LENGTH} characters`);
|
|
6328
|
+
}
|
|
6183
6329
|
const atoms = expression.trim().split(/\s+/);
|
|
6184
6330
|
if (strict && atoms.length < 6) {
|
|
6185
6331
|
throw new Error("Invalid cron expression, expected 6 fields");
|
|
@@ -6187,18 +6333,19 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6187
6333
|
if (atoms.length > 6) {
|
|
6188
6334
|
throw new Error("Invalid cron expression, too many fields");
|
|
6189
6335
|
}
|
|
6190
|
-
const defaults = ["
|
|
6336
|
+
const defaults = ["0", "*", "*", "*", "*", "*"];
|
|
6191
6337
|
if (atoms.length < defaults.length) {
|
|
6192
|
-
atoms.unshift(...defaults.slice(atoms.length));
|
|
6338
|
+
atoms.unshift(...defaults.slice(0, defaults.length - atoms.length));
|
|
6193
6339
|
}
|
|
6194
6340
|
const [second, minute, hour, dayOfMonth, month, dayOfWeek] = atoms;
|
|
6195
6341
|
return { second, minute, hour, dayOfMonth, month, dayOfWeek };
|
|
6196
6342
|
}
|
|
6197
|
-
static #parseField(field, value, constraints, rand) {
|
|
6343
|
+
static #parseField(field, value, constraints, rand, strict) {
|
|
6198
6344
|
if (field === CronUnit.Month || field === CronUnit.DayOfWeek) {
|
|
6345
|
+
const aliases = field === CronUnit.Month ? Months : DayOfWeek;
|
|
6199
6346
|
value = value.replace(/[a-z]{3}/gi, (match) => {
|
|
6200
6347
|
match = match.toLowerCase();
|
|
6201
|
-
const replacer =
|
|
6348
|
+
const replacer = aliases[match];
|
|
6202
6349
|
if (replacer === undefined) {
|
|
6203
6350
|
throw new Error(`Validation error, cannot resolve alias "${match}"`);
|
|
6204
6351
|
}
|
|
@@ -6209,59 +6356,90 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6209
6356
|
throw new Error(`Invalid characters, got value: ${value}`);
|
|
6210
6357
|
}
|
|
6211
6358
|
value = this.#parseWildcard(value, constraints);
|
|
6212
|
-
value = this.#parseHashed(value, constraints, rand);
|
|
6359
|
+
value = this.#parseHashed(value, constraints, rand, field, strict);
|
|
6213
6360
|
return this.#parseSequence(field, value, constraints);
|
|
6214
6361
|
}
|
|
6215
6362
|
static #parseWildcard(value, constraints) {
|
|
6216
|
-
|
|
6363
|
+
const parsed = value.replace(/(^|,)[*?](?=\/|,|$)/g, (_, separator) => `${separator}${constraints.min}-${constraints.max}`);
|
|
6364
|
+
if (/[*?]/.test(parsed)) {
|
|
6365
|
+
throw new Error(`Invalid wildcard, got value: ${value}`);
|
|
6366
|
+
}
|
|
6367
|
+
return parsed;
|
|
6217
6368
|
}
|
|
6218
|
-
static #parseHashed(value, constraints, rand) {
|
|
6369
|
+
static #parseHashed(value, constraints, rand, field, strict) {
|
|
6219
6370
|
const randomValue = rand();
|
|
6371
|
+
let count = 0;
|
|
6220
6372
|
return value.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g, (_, min, max, step) => {
|
|
6221
6373
|
if (min && max && step) {
|
|
6222
6374
|
const minNum = parseInt(min, 10);
|
|
6223
6375
|
const maxNum = parseInt(max, 10);
|
|
6224
6376
|
const stepNum = parseInt(step, 10);
|
|
6225
|
-
if (minNum > maxNum) {
|
|
6226
|
-
throw new Error(`Invalid range: ${minNum}-${maxNum}, min > max`);
|
|
6227
|
-
}
|
|
6228
6377
|
if (stepNum <= 0) {
|
|
6229
6378
|
throw new Error(`Invalid step: ${stepNum}, must be positive`);
|
|
6230
6379
|
}
|
|
6231
|
-
const
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
if (i >= minStart) {
|
|
6236
|
-
values.push(i);
|
|
6237
|
-
}
|
|
6238
|
-
}
|
|
6239
|
-
return values.join(",");
|
|
6380
|
+
const range = CronExpressionParser.#hashedRange(minNum, maxNum, constraints, field, strict);
|
|
6381
|
+
count += Math.ceil((range.max - range.min + 1) / stepNum);
|
|
6382
|
+
CronExpressionParser.#assertMaxFieldValues(field, count);
|
|
6383
|
+
return CronExpressionParser.#hashedStep(randomValue, range.min, range.max, stepNum, field, strict);
|
|
6240
6384
|
} else if (min && max) {
|
|
6241
6385
|
const minNum = parseInt(min, 10);
|
|
6242
6386
|
const maxNum = parseInt(max, 10);
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
}
|
|
6246
|
-
return String(Math.floor(randomValue * (maxNum - minNum + 1)) + minNum);
|
|
6387
|
+
const range = CronExpressionParser.#hashedRange(minNum, maxNum, constraints, field, strict);
|
|
6388
|
+
return String(CronExpressionParser.#hashedValue(randomValue, range.min, range.max));
|
|
6247
6389
|
} else if (step) {
|
|
6248
6390
|
const stepNum = parseInt(step, 10);
|
|
6249
6391
|
if (stepNum <= 0) {
|
|
6250
6392
|
throw new Error(`Invalid step: ${stepNum}, must be positive`);
|
|
6251
6393
|
}
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
if (i >= constraints.min) {
|
|
6256
|
-
values.push(i);
|
|
6257
|
-
}
|
|
6258
|
-
}
|
|
6259
|
-
return values.join(",");
|
|
6394
|
+
count += Math.ceil((constraints.max - constraints.min + 1) / stepNum);
|
|
6395
|
+
CronExpressionParser.#assertMaxFieldValues(field, count);
|
|
6396
|
+
return CronExpressionParser.#hashedStep(randomValue, constraints.min, constraints.max, stepNum, field, strict);
|
|
6260
6397
|
} else {
|
|
6261
|
-
return String(
|
|
6398
|
+
return String(CronExpressionParser.#hashedValue(randomValue, constraints.min, constraints.max));
|
|
6262
6399
|
}
|
|
6263
6400
|
});
|
|
6264
6401
|
}
|
|
6402
|
+
static #hashedValue(randomValue, min, max) {
|
|
6403
|
+
return Math.floor(randomValue * (max - min + 1)) + min;
|
|
6404
|
+
}
|
|
6405
|
+
static #fieldName(field) {
|
|
6406
|
+
return field.charAt(0).toLowerCase() + field.slice(1);
|
|
6407
|
+
}
|
|
6408
|
+
static #hashedRange(min, max, constraints, field, strict) {
|
|
6409
|
+
if (min > max) {
|
|
6410
|
+
throw new Error(`Invalid range: ${min}-${max}, min > max`);
|
|
6411
|
+
}
|
|
6412
|
+
if (strict && (min < constraints.min || max > constraints.max)) {
|
|
6413
|
+
throw new Error(`Invalid range: ${min}-${max}, outside the ${constraints.min}-${constraints.max} range of the ${CronExpressionParser.#fieldName(field)} field`);
|
|
6414
|
+
}
|
|
6415
|
+
const rangeMin = Math.max(min, constraints.min);
|
|
6416
|
+
const rangeMax = Math.min(max, constraints.max);
|
|
6417
|
+
if (rangeMin > rangeMax) {
|
|
6418
|
+
throw new Error(`Invalid range: ${min}-${max}, no usable value in the ${CronExpressionParser.#fieldName(field)} field`);
|
|
6419
|
+
}
|
|
6420
|
+
return { min: rangeMin, max: rangeMax };
|
|
6421
|
+
}
|
|
6422
|
+
static #hashedStep(randomValue, min, max, step, field, strict) {
|
|
6423
|
+
if (strict && step > max - min + 1) {
|
|
6424
|
+
throw new Error(`Invalid step: ${step}, wider than the ${min}-${max} range of the ${CronExpressionParser.#fieldName(field)} field`);
|
|
6425
|
+
}
|
|
6426
|
+
const offset = Math.floor(randomValue * step);
|
|
6427
|
+
const values = [];
|
|
6428
|
+
for (let i = Math.floor(min / step) * step + offset;i <= max; i += step) {
|
|
6429
|
+
if (i >= min) {
|
|
6430
|
+
values.push(i);
|
|
6431
|
+
}
|
|
6432
|
+
}
|
|
6433
|
+
if (values.length === 0) {
|
|
6434
|
+
return String(CronExpressionParser.#hashedValue(randomValue, min, max));
|
|
6435
|
+
}
|
|
6436
|
+
return values.join(",");
|
|
6437
|
+
}
|
|
6438
|
+
static #assertMaxFieldValues(field, count) {
|
|
6439
|
+
if (count > MAX_FIELD_VALUES) {
|
|
6440
|
+
throw new Error(`Constraint error, too many values in ${field} field, expected at most ${MAX_FIELD_VALUES}`);
|
|
6441
|
+
}
|
|
6442
|
+
}
|
|
6265
6443
|
static #parseSequence(field, val, constraints) {
|
|
6266
6444
|
const stack = [];
|
|
6267
6445
|
function handleResult(result, constraints) {
|
|
@@ -6281,12 +6459,13 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6281
6459
|
}
|
|
6282
6460
|
}
|
|
6283
6461
|
const atoms = val.split(",");
|
|
6284
|
-
|
|
6462
|
+
for (const atom of atoms) {
|
|
6463
|
+
CronExpressionParser.#assertMaxFieldValues(field, stack.length);
|
|
6285
6464
|
if (!(atom.length > 0)) {
|
|
6286
6465
|
throw new Error("Invalid list value format");
|
|
6287
6466
|
}
|
|
6288
6467
|
handleResult(CronExpressionParser.#parseRepeat(field, atom, constraints), constraints);
|
|
6289
|
-
}
|
|
6468
|
+
}
|
|
6290
6469
|
return stack;
|
|
6291
6470
|
}
|
|
6292
6471
|
static #parseRepeat(field, val, constraints) {
|
|
@@ -6295,10 +6474,10 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6295
6474
|
throw new Error(`Invalid repeat: ${val}`);
|
|
6296
6475
|
}
|
|
6297
6476
|
if (atoms.length === 2) {
|
|
6298
|
-
if (!
|
|
6477
|
+
if (!atoms[0].includes("-")) {
|
|
6299
6478
|
atoms[0] = `${atoms[0]}-${constraints.max}`;
|
|
6300
6479
|
}
|
|
6301
|
-
return CronExpressionParser.#parseRange(field, atoms[0],
|
|
6480
|
+
return CronExpressionParser.#parseRange(field, atoms[0], +atoms[1], constraints);
|
|
6302
6481
|
}
|
|
6303
6482
|
return CronExpressionParser.#parseRange(field, val, 1, constraints);
|
|
6304
6483
|
}
|
|
@@ -6318,7 +6497,7 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6318
6497
|
}
|
|
6319
6498
|
static #createRange(field, min, max, repeatInterval) {
|
|
6320
6499
|
const stack = [];
|
|
6321
|
-
if (field === CronUnit.DayOfWeek && max % 7 === 0) {
|
|
6500
|
+
if (field === CronUnit.DayOfWeek && max % 7 === 0 && (max - min) % repeatInterval === 0) {
|
|
6322
6501
|
stack.push(0);
|
|
6323
6502
|
}
|
|
6324
6503
|
for (let index = min;index <= max; index += repeatInterval) {
|
|
@@ -6333,7 +6512,10 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6333
6512
|
if (atoms.length <= 1) {
|
|
6334
6513
|
return isNaN(+val) ? val : +val;
|
|
6335
6514
|
}
|
|
6336
|
-
|
|
6515
|
+
if (atoms.length > 2) {
|
|
6516
|
+
throw new Error(`Invalid range: ${val}`);
|
|
6517
|
+
}
|
|
6518
|
+
const [min, max] = atoms.map((atom) => /^\d+$/.test(atom) ? +atom : NaN);
|
|
6337
6519
|
this.#validateRange(min, max, constraints);
|
|
6338
6520
|
this.#validateRepeatInterval(repeatInterval);
|
|
6339
6521
|
return this.#createRange(field, min, max, repeatInterval);
|
|
@@ -6344,7 +6526,7 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6344
6526
|
return { dayOfWeek: atoms[0] };
|
|
6345
6527
|
}
|
|
6346
6528
|
const nthValue = +atoms[atoms.length - 1];
|
|
6347
|
-
const matches = val.match(/([
|
|
6529
|
+
const matches = val.match(/([,\-/L])/);
|
|
6348
6530
|
if (matches !== null) {
|
|
6349
6531
|
throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${matches?.[0]}\` special characters are incompatible`);
|
|
6350
6532
|
}
|
|
@@ -6362,57 +6544,13 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6362
6544
|
|
|
6363
6545
|
// node_modules/cron-parser/dist/CronFileParser.js
|
|
6364
6546
|
var require_CronFileParser = __commonJS(function(exports) {
|
|
6365
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6366
|
-
if (k2 === undefined)
|
|
6367
|
-
k2 = k;
|
|
6368
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6369
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6370
|
-
desc = { enumerable: true, get: function() {
|
|
6371
|
-
return m[k];
|
|
6372
|
-
} };
|
|
6373
|
-
}
|
|
6374
|
-
Object.defineProperty(o, k2, desc);
|
|
6375
|
-
} : function(o, m, k, k2) {
|
|
6376
|
-
if (k2 === undefined)
|
|
6377
|
-
k2 = k;
|
|
6378
|
-
o[k2] = m[k];
|
|
6379
|
-
});
|
|
6380
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
6381
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6382
|
-
} : function(o, v) {
|
|
6383
|
-
o["default"] = v;
|
|
6384
|
-
});
|
|
6385
|
-
var __importStar = exports && exports.__importStar || function() {
|
|
6386
|
-
var ownKeys = function(o) {
|
|
6387
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
6388
|
-
var ar = [];
|
|
6389
|
-
for (var k in o)
|
|
6390
|
-
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
6391
|
-
ar[ar.length] = k;
|
|
6392
|
-
return ar;
|
|
6393
|
-
};
|
|
6394
|
-
return ownKeys(o);
|
|
6395
|
-
};
|
|
6396
|
-
return function(mod) {
|
|
6397
|
-
if (mod && mod.__esModule)
|
|
6398
|
-
return mod;
|
|
6399
|
-
var result = {};
|
|
6400
|
-
if (mod != null) {
|
|
6401
|
-
for (var k = ownKeys(mod), i = 0;i < k.length; i++)
|
|
6402
|
-
if (k[i] !== "default")
|
|
6403
|
-
__createBinding(result, mod, k[i]);
|
|
6404
|
-
}
|
|
6405
|
-
__setModuleDefault(result, mod);
|
|
6406
|
-
return result;
|
|
6407
|
-
};
|
|
6408
|
-
}();
|
|
6409
6547
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6410
6548
|
exports.CronFileParser = undefined;
|
|
6411
6549
|
var CronExpressionParser_1 = require_CronExpressionParser();
|
|
6412
6550
|
|
|
6413
6551
|
class CronFileParser {
|
|
6414
6552
|
static async parseFile(filePath) {
|
|
6415
|
-
const { readFile } =
|
|
6553
|
+
const { readFile } = __require("fs/promises");
|
|
6416
6554
|
const data = await readFile(filePath, "utf8");
|
|
6417
6555
|
return CronFileParser.#parseContent(data);
|
|
6418
6556
|
}
|
|
@@ -6434,26 +6572,37 @@ var require_CronFileParser = __commonJS(function(exports) {
|
|
|
6434
6572
|
if (entry.length === 0 || entry.startsWith("#")) {
|
|
6435
6573
|
continue;
|
|
6436
6574
|
}
|
|
6437
|
-
const variableMatch = entry.match(/^(
|
|
6575
|
+
const variableMatch = entry.match(/^([^\s=]+)\s*=\s*(.*)$/);
|
|
6438
6576
|
if (variableMatch) {
|
|
6439
6577
|
const [, key, value] = variableMatch;
|
|
6440
|
-
result.variables
|
|
6578
|
+
Object.defineProperty(result.variables, key, {
|
|
6579
|
+
value: value.replace(/^(["'])(.*)\1$/, "$2"),
|
|
6580
|
+
enumerable: true,
|
|
6581
|
+
writable: true,
|
|
6582
|
+
configurable: true
|
|
6583
|
+
});
|
|
6441
6584
|
continue;
|
|
6442
6585
|
}
|
|
6443
6586
|
try {
|
|
6444
6587
|
const parsedEntry = CronFileParser.#parseEntry(entry);
|
|
6445
6588
|
result.expressions.push(parsedEntry.interval);
|
|
6446
6589
|
} catch (err) {
|
|
6447
|
-
result.errors
|
|
6590
|
+
Object.defineProperty(result.errors, entry, {
|
|
6591
|
+
value: err,
|
|
6592
|
+
enumerable: true,
|
|
6593
|
+
writable: true,
|
|
6594
|
+
configurable: true
|
|
6595
|
+
});
|
|
6448
6596
|
}
|
|
6449
6597
|
}
|
|
6450
6598
|
return result;
|
|
6451
6599
|
}
|
|
6452
6600
|
static #parseEntry(entry) {
|
|
6453
|
-
const atoms = entry.split(
|
|
6601
|
+
const atoms = entry.split(/\s+/);
|
|
6602
|
+
const scheduleLength = atoms[0].startsWith("@") ? 1 : 5;
|
|
6454
6603
|
return {
|
|
6455
|
-
interval: CronExpressionParser_1.CronExpressionParser.parse(atoms.slice(0,
|
|
6456
|
-
command: atoms.slice(
|
|
6604
|
+
interval: CronExpressionParser_1.CronExpressionParser.parse(atoms.slice(0, scheduleLength).join(" ")),
|
|
6605
|
+
command: atoms.slice(scheduleLength, atoms.length)
|
|
6457
6606
|
};
|
|
6458
6607
|
}
|
|
6459
6608
|
}
|
|
@@ -179392,6 +179541,8 @@ function extractorPath() {
|
|
|
179392
179541
|
return fileURLToPath2(new URL("../../scripts-runtime/extract-args-schema.ts", import.meta.url));
|
|
179393
179542
|
}
|
|
179394
179543
|
async function extractArgsJsonSchema(source) {
|
|
179544
|
+
if (getDeploymentScriptExecutorName() === "quickjs")
|
|
179545
|
+
return null;
|
|
179395
179546
|
const tmpdir = `${process.env.TMPDIR ?? "/tmp"}/schema-extract-${crypto.randomUUID()}`;
|
|
179396
179547
|
try {
|
|
179397
179548
|
await Bun.$`mkdir -p ${tmpdir}`.quiet();
|
|
@@ -179443,6 +179594,7 @@ async function extractArgsJsonSchema(source) {
|
|
|
179443
179594
|
var TIMEOUT_MS = 5000;
|
|
179444
179595
|
var init_extract_schema = __esm(() => {
|
|
179445
179596
|
init_native();
|
|
179597
|
+
init_registry();
|
|
179446
179598
|
init_sandboxed_process();
|
|
179447
179599
|
});
|
|
179448
179600
|
|
|
@@ -179607,6 +179759,17 @@ function staticHostClass(hostname) {
|
|
|
179607
179759
|
return isPrivateIPv4(v4.slice(1).map(Number)) ? "private" : null;
|
|
179608
179760
|
return host !== "" && !host.includes(".") ? "single-label" : null;
|
|
179609
179761
|
}
|
|
179762
|
+
function calledMethodName(callee) {
|
|
179763
|
+
const inner = unwrap(callee);
|
|
179764
|
+
if (import_typescript3.default.isPropertyAccessExpression(inner))
|
|
179765
|
+
return inner.name.text;
|
|
179766
|
+
if (import_typescript3.default.isElementAccessExpression(inner)) {
|
|
179767
|
+
const key = unwrap(inner.argumentExpression);
|
|
179768
|
+
if (import_typescript3.default.isStringLiteral(key) || import_typescript3.default.isNoSubstitutionTemplateLiteral(key))
|
|
179769
|
+
return key.text;
|
|
179770
|
+
}
|
|
179771
|
+
return null;
|
|
179772
|
+
}
|
|
179610
179773
|
function fetchCallName(callee) {
|
|
179611
179774
|
const inner = unwrap(callee);
|
|
179612
179775
|
if (import_typescript3.default.isIdentifier(inner)) {
|
|
@@ -179673,14 +179836,22 @@ function literalUrl(arg, resolve) {
|
|
|
179673
179836
|
}
|
|
179674
179837
|
function checkQuickJSCompat(source, options = {}) {
|
|
179675
179838
|
const findings = [];
|
|
179676
|
-
const seen = new
|
|
179839
|
+
const seen = new Map;
|
|
179677
179840
|
const { sourceFile, isLocal, constInitializer } = createScope(source);
|
|
179678
179841
|
const add = (rule, message, node) => {
|
|
179679
|
-
if (seen.has(`${rule}:${message}`))
|
|
179680
|
-
return;
|
|
179681
|
-
seen.add(`${rule}:${message}`);
|
|
179682
179842
|
const line = node ? sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1 : undefined;
|
|
179683
|
-
|
|
179843
|
+
const existing = seen.get(`${rule}:${message}`);
|
|
179844
|
+
if (existing) {
|
|
179845
|
+
if (line === undefined || existing.line === undefined)
|
|
179846
|
+
return;
|
|
179847
|
+
const lines = existing.lines ?? [existing.line];
|
|
179848
|
+
if (lines.at(-1) !== line)
|
|
179849
|
+
existing.lines = [...lines, line];
|
|
179850
|
+
return;
|
|
179851
|
+
}
|
|
179852
|
+
const finding = line === undefined ? { rule, message } : { rule, message, line };
|
|
179853
|
+
seen.set(`${rule}:${message}`, finding);
|
|
179854
|
+
findings.push(finding);
|
|
179684
179855
|
};
|
|
179685
179856
|
if (options.fsMode === "workspace-rw") {
|
|
179686
179857
|
add("workspaceRw", "fsMode workspace-rw is not available under quickjs");
|
|
@@ -179741,8 +179912,8 @@ function checkQuickJSCompat(source, options = {}) {
|
|
|
179741
179912
|
if (import_typescript3.default.isIdentifier(callee) && callee.text === "require" && !isLocal(callee)) {
|
|
179742
179913
|
add("require", "require() is not supported; use an import", node);
|
|
179743
179914
|
}
|
|
179744
|
-
|
|
179745
|
-
|
|
179915
|
+
const method = calledMethodName(callee);
|
|
179916
|
+
if (method !== null) {
|
|
179746
179917
|
if (RESPONSE_BODY_METHODS.has(method) && node.arguments.length === 0) {
|
|
179747
179918
|
add("responseBody", `.${method}() on a fetch Response is not available under quickjs (text() and json() are)`, node);
|
|
179748
179919
|
}
|
|
@@ -179758,9 +179929,15 @@ function checkQuickJSCompat(source, options = {}) {
|
|
|
179758
179929
|
}
|
|
179759
179930
|
function quickJSCompatWarnings(report, label) {
|
|
179760
179931
|
const prefix = label ? `${label}: ` : "";
|
|
179761
|
-
return report.findings.map((finding) =>
|
|
179932
|
+
return report.findings.map((finding) => {
|
|
179933
|
+
const lines = finding.lines ?? (finding.line ? [finding.line] : []);
|
|
179934
|
+
const shown = lines.slice(0, MAX_WARNING_LINES).join(", ");
|
|
179935
|
+
const more = lines.length > MAX_WARNING_LINES ? `, +${lines.length - MAX_WARNING_LINES} more` : "";
|
|
179936
|
+
const where = lines.length === 0 ? "" : `, ${lines.length === 1 ? "line" : "lines"} ${shown}${more}`;
|
|
179937
|
+
return `${prefix}quickjs compat (${finding.rule}${where}): ${finding.message}`;
|
|
179938
|
+
});
|
|
179762
179939
|
}
|
|
179763
|
-
var import_typescript3, UNSUPPORTED_GLOBALS, RESPONSE_BODY_METHODS, LOCALE_METHODS, FS_STDLIB, HOST_ONLY_CONFIG, MAX_FINDINGS = 20, SCRIPT_FILE = "user-script.ts", MAX_CONST_DEPTH = 4;
|
|
179940
|
+
var import_typescript3, UNSUPPORTED_GLOBALS, RESPONSE_BODY_METHODS, LOCALE_METHODS, FS_STDLIB, HOST_ONLY_CONFIG, MAX_FINDINGS = 20, MAX_WARNING_LINES = 10, SCRIPT_FILE = "user-script.ts", MAX_CONST_DEPTH = 4;
|
|
179764
179941
|
var init_quickjs_compat = __esm(() => {
|
|
179765
179942
|
import_typescript3 = __toESM(require_typescript2(), 1);
|
|
179766
179943
|
UNSUPPORTED_GLOBALS = new Set([
|