@desplega.ai/agent-swarm 2.13.5 → 2.14.1
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-7jv7w8jh.js +17 -0
- package/dist/{acp-targets-w8dbs4nr.js → acp-targets-0ebmg3et.js} +10 -10
- package/dist/{actions-8zrcbjrx.js → actions-0ds9dx6c.js} +63 -42
- package/dist/{agent-fs-provision-cbt2ttds.js → agent-fs-provision-zpbxa9jc.js} +4 -4
- package/dist/{amp-adapter-8x6zp8w4.js → amp-adapter-awh5nn7a.js} +3 -3
- package/dist/{anthropic-messages-vdd1zmha.js → anthropic-messages-gtgp9r85.js} +17 -17
- package/dist/{app-zfa9dwjw.js → app-nzejkvpp.js} +10 -10
- package/dist/{approval-notifications-rv92zmza.js → approval-notifications-hbqtb2w3.js} +11 -11
- package/dist/{assistant-q7s7rm1q.js → assistant-1paft129.js} +42 -37
- package/dist/{boot-args-schema-g27kpzr1.js → boot-args-schema-zs435mfx.js} +1 -1
- package/dist/{boot-reembed-1mjs52nt.js → boot-reembed-7xq2qgg4.js} +1 -1
- package/dist/{boot-reembed-m62dpdkg.js → boot-reembed-91qrd4mz.js} +1 -1
- package/dist/{boot-scrub-sweep-ss1vcamw.js → boot-scrub-sweep-3h5xscw6.js} +2 -2
- package/dist/{boot-seeds-hwnvgbb3.js → boot-seeds-xkxqa8zc.js} +4 -4
- package/dist/{boxd-y0szhp0g.js → boxd-464x3w4m.js} +4 -4
- package/dist/{claude-adapter-0rjmbhjk.js → claude-adapter-6d8eyf2f.js} +12 -13
- package/dist/{claude-managed-adapter-6k032agg.js → claude-managed-adapter-jzxcaf9m.js} +4 -4
- package/dist/{claude-managed-setup-6czvve8q.js → claude-managed-setup-5fcx0qh3.js} +10 -10
- package/dist/{claude-sdk-session-pr0znb81.js → claude-sdk-session-11vhz1hc.js} +12720 -13882
- package/dist/{cli-kr0jpw9c.js → cli-02ba8qx5.js} +1 -1
- package/dist/{cli-ywy8yz6t.js → cli-08gfvs58.js} +2 -2
- package/dist/{cli-0qt3epg4.js → cli-0dkpdvnn.js} +10 -10
- package/dist/{cli-s8dhq7rj.js → cli-0mq8kxfx.js} +5 -5
- package/dist/{cli-ybte1fqc.js → cli-0nvqg1hb.js} +1 -1
- package/dist/{cli-f9xw9pr4.js → cli-0qyfna7a.js} +5 -5
- package/dist/cli-0vxbrxr3.js +1006 -0
- package/dist/{cli-ehg90jd1.js → cli-132h67ps.js} +64 -59
- package/dist/{cli-f7b9nyvk.js → cli-1e13gvfn.js} +17 -17
- package/dist/cli-1hj68b3h.js +30 -0
- package/dist/{cli-srktrbby.js → cli-1zbj28py.js} +1 -1
- package/dist/{cli-q41qar56.js → cli-20mkgwev.js} +173 -46
- package/dist/{cli-v09eza21.js → cli-288k5ep1.js} +15 -15
- package/dist/{cli-abby987g.js → cli-2n7qdqfv.js} +3 -3
- package/dist/{cli-kezzteka.js → cli-2r62jy9s.js} +1 -1
- package/dist/{cli-qmx8bnt4.js → cli-3179w2rz.js} +2 -2
- package/dist/cli-3a3hm1z8.js +15 -0
- package/dist/cli-3bagv8rt.js +37 -0
- package/dist/{cli-zxa1vmx7.js → cli-3bcsc3m7.js} +2 -2
- package/dist/{cli-j69pzrrz.js → cli-3g0vbq46.js} +5 -5
- package/dist/{cli-69szn7w7.js → cli-3ktfe5jx.js} +71 -47
- package/dist/{cli-69zzpjgh.js → cli-44r66df2.js} +1 -1
- package/dist/{cli-grbngev5.js → cli-466jjrwe.js} +11 -2
- package/dist/{cli-1jq2em7b.js → cli-4y2bekkn.js} +10 -9
- package/dist/cli-547fsc36.js +15 -0
- package/dist/{cli-6p8p2e6r.js → cli-5pyes68e.js} +1278 -23
- package/dist/{cli-ewk3sg68.js → cli-5t00r6c9.js} +3 -3
- package/dist/{cli-wzecestt.js → cli-5xjdft4s.js} +4063 -1835
- package/dist/{cli-4dyzzkfb.js → cli-643skca1.js} +954 -180
- package/dist/{cli-vr4eyq6p.js → cli-6a77m17n.js} +540 -412
- package/dist/{cli-v41kn3cd.js → cli-6prwz0zn.js} +4427 -5566
- package/dist/{cli-ks06cd0n.js → cli-6xrbpj5j.js} +8 -8
- package/dist/{cli-meydjstb.js → cli-6yhjqd6k.js} +4965 -69
- package/dist/{cli-bvamr9g0.js → cli-727sq1f9.js} +4 -4
- package/dist/{cli-snxhtehz.js → cli-7abeph0b.js} +7 -8
- package/dist/{cli-ty3gha1p.js → cli-7b9bwrfg.js} +2 -2
- package/dist/{cli-vbge4rsp.js → cli-7dwsn9y5.js} +4 -4
- package/dist/{cli-1kvcsd2f.js → cli-7qkbab03.js} +76 -8
- package/dist/{cli-8b4rpnwj.js → cli-7svwhw1a.js} +1 -1
- package/dist/{cli-jdq3jmny.js → cli-83kf2y60.js} +8 -10
- package/dist/{cli-tgc1kgg3.js → cli-84wxwt3z.js} +1 -1
- package/dist/{cli-sejvnjvw.js → cli-8crn0510.js} +1 -1
- package/dist/{cli-19d6v8er.js → cli-8kemtj1r.js} +172 -18
- package/dist/{cli-qrvk9nka.js → cli-967jrz7j.js} +40 -26
- package/dist/{cli-cp163xga.js → cli-976m0zcw.js} +72 -50
- package/dist/{cli-887vhew6.js → cli-98sea4d9.js} +2716 -2643
- package/dist/{cli-xh5fpmg8.js → cli-9txap41q.js} +101 -18
- package/dist/{cli-nrt048ys.js → cli-aktk3qt6.js} +40 -3
- package/dist/{cli-t0n9svkb.js → cli-b70cpf8f.js} +12 -7
- package/dist/{cli-2ap1the6.js → cli-by7s3n4p.js} +1 -1
- package/dist/{cli-tt7dkwjj.js → cli-byzq8xht.js} +7 -7
- package/dist/{cli-55h8m1x3.js → cli-d1zkys4j.js} +150 -99
- package/dist/cli-dr6x9qdk.js +15 -0
- package/dist/cli-dt931hb8.js +9740 -0
- package/dist/{cli-emdfd8fh.js → cli-dy754erz.js} +9 -1
- package/dist/{cli-2wzkvfgm.js → cli-e1wprqnd.js} +3 -3
- package/dist/{cli-pedm2kht.js → cli-e2wzzw17.js} +2 -2
- package/dist/{cli-1jx0srjt.js → cli-e9p9h14n.js} +1921 -80
- package/dist/{cli-evy3egte.js → cli-eaqxkeq0.js} +14 -103
- package/dist/{cli-he5nxaa8.js → cli-etykr11s.js} +3062 -728
- package/dist/{cli-3vw6dd4g.js → cli-f07sgaax.js} +2 -2
- package/dist/{cli-z1vam71h.js → cli-fe8he9cy.js} +2 -2
- package/dist/{cli-94gx6ze9.js → cli-h0edykd1.js} +1 -1
- package/dist/cli-h5cveb69.js +15 -0
- package/dist/{cli-5tq15aa7.js → cli-hamdfjtx.js} +2 -2
- package/dist/{cli-kwj3131p.js → cli-hh5m39pt.js} +1 -1
- package/dist/{cli-tvyt8w6n.js → cli-j8fmn3wv.js} +11 -11
- package/dist/cli-jngvszex.js +1514 -0
- package/dist/{cli-9n6g14vs.js → cli-k791mabe.js} +6 -6
- package/dist/{cli-6msnpj1z.js → cli-k9m8fckz.js} +10 -10
- package/dist/{cli-2vp0z049.js → cli-kz8rar0g.js} +1 -1
- package/dist/{cli-94mxerrp.js → cli-n15fhd43.js} +1 -1
- package/dist/{cli-htb5bpz2.js → cli-nmdy8bzf.js} +10 -3
- package/dist/{cli-t9pzz2eq.js → cli-ntmjzyte.js} +4 -1
- package/dist/{cli-avax5mp9.js → cli-ny8f5g7t.js} +19 -7
- package/dist/cli-p0g0erm9.js +15 -0
- package/dist/{cli-n79j1vxc.js → cli-pgdqhdkw.js} +4 -4
- package/dist/cli-ph1jce1b.js +16 -0
- package/dist/{cli-ced4azn1.js → cli-phantfg3.js} +771 -401
- package/dist/{cli-ebpq3c5z.js → cli-rb1z91g8.js} +10221 -1397
- package/dist/{cli-a49frv85.js → cli-redtbppc.js} +1 -1
- package/dist/{cli-cmbb2t8a.js → cli-s7bfz1ye.js} +15 -15
- package/dist/{cli-8pd1t17c.js → cli-sf5kp73f.js} +18 -18
- package/dist/{cli-zbbtp02a.js → cli-sq32dgfe.js} +1837 -7206
- package/dist/{cli-k0nebh10.js → cli-tbrjvrrg.js} +1 -1
- package/dist/{cli-4gaf3tx5.js → cli-tdd9dvw6.js} +1 -1
- package/dist/{cli-7ypg8hka.js → cli-tjrrabez.js} +3 -3
- package/dist/{cli-q1h041y8.js → cli-tkrp183j.js} +11 -11
- package/dist/{cli-srre41gb.js → cli-trvtxwzt.js} +2 -2
- package/dist/{cli-ffn0a515.js → cli-v1rhq77v.js} +68 -25
- package/dist/{cli-t879ww0y.js → cli-v3jxx8dv.js} +2 -2
- package/dist/{cli-b42yfn17.js → cli-v84kb7af.js} +14 -14
- package/dist/{cli-sa02jsqt.js → cli-vp2ksaq9.js} +1 -1
- package/dist/{cli-b0m3bg0f.js → cli-vrb8pvrf.js} +6 -6
- package/dist/cli-vxxdf2ma.js +15 -0
- package/dist/{cli-x2adbg4j.js → cli-w81s97bn.js} +1 -1
- package/dist/{cli-4vynxtrb.js → cli-wkzrknpt.js} +10 -3
- package/dist/{cli-fw67mnyc.js → cli-wqpvfq2m.js} +1 -1
- package/dist/{cli-prz1p3ft.js → cli-wsh5vfa7.js} +9 -9
- package/dist/{cli-hd5bm1e1.js → cli-wtwe8vng.js} +45 -45
- package/dist/{cli-34fygf87.js → cli-ww8wxfzx.js} +2 -2
- package/dist/{cli-e8trbfx1.js → cli-x80zagf5.js} +1 -1
- package/dist/{cli-zntvmqmm.js → cli-xd6ntv7x.js} +2 -2
- package/dist/{cli-vcpyttcw.js → cli-xmc2nrtv.js} +1 -1
- package/dist/{cli-z40t85ms.js → cli-ytgtqsy9.js} +1 -1
- package/dist/{cli-r3dxpmyt.js → cli-yvnnyjxm.js} +1 -1
- package/dist/{cli-zzq96q57.js → cli-z0c98h7h.js} +2450 -554
- package/dist/{cli-ryem5cfq.js → cli-z0effej1.js} +217 -27
- package/dist/{cli-0h8skzss.js → cli-zcb64xzv.js} +4 -3
- package/dist/{cli-5web09sb.js → cli-zdkcp8p0.js} +8 -10
- package/dist/{cli-z3x7h79n.js → cli-zgsd2w2k.js} +20 -22
- package/dist/{cli-7r9tvk8v.js → cli-zmfs06hg.js} +15 -9
- package/dist/{cli-3860pmrq.js → cli-zvsy4abb.js} +4 -4
- package/dist/{cli-5n9w2xzx.js → cli-zyf288rw.js} +2 -2
- package/dist/cli.js +64 -65
- package/dist/{codex-adapter-bn7eaxk5.js → codex-adapter-seht4h9t.js} +9 -9
- package/dist/{codex-hook-nnmezjg9.js → codex-hook-w5nmtrn2.js} +3 -3
- package/dist/{codex-login-ktfg1cxk.js → codex-login-67qarfcg.js} +1 -1
- package/dist/{codex-session-runner-j1e9hffc.js → codex-session-runner-tq95x3gq.js} +10 -10
- package/dist/{commands-amhpafrr.js → commands-0awwqxq5.js} +3 -3
- package/dist/{controller-tw7g10j2.js → controller-hgjx521c.js} +4 -4
- package/dist/{controllers-connect-2ssqz7f4.js → controllers-connect-j4kdmhfj.js} +28 -29
- package/dist/core-8fw1gwg7.js +41 -0
- package/dist/{cursor-adapter-d6knjmwa.js → cursor-adapter-0rg8wk6j.js} +2 -2
- package/dist/{db-fd6xxm77.js → db-8xs2js3s.js} +3 -3
- package/dist/{db-sc59379z.js → db-dd6hj211.js} +4 -2
- package/dist/{devin-adapter-3bp6rape.js → devin-adapter-tn1twrha.js} +1 -1
- package/dist/{devtools-qxfgbsqz.js → devtools-b8qts77k.js} +1 -1
- package/dist/{dispatcher-a2gdqz8c.js → dispatcher-v7drd034.js} +24 -25
- package/dist/{docker-a59g3ebm.js → docker-6007r2fj.js} +2 -2
- package/dist/dsh-adapter-ah8npj2x.js +11 -0
- package/dist/{e2b-qnxyfea6.js → e2b-hg80w0qr.js} +3 -3
- package/dist/{e2b-cn7cvjqy.js → e2b-z1g7vpz6.js} +16 -5
- package/dist/{easter-egg-3d-a0pphy71.js → easter-egg-3d-8n4w3s9k.js} +1 -1
- package/dist/{embedding-space-qepzrach.js → embedding-space-0p921zt3.js} +13 -23
- package/dist/{embeddings-d7vr881x.js → embeddings-9s7kbrc6.js} +1 -1
- package/dist/emscripten-module-Q67P5WYC-3sde6cre.js +2458 -0
- package/dist/{event-bus-7gbsr0g4.js → event-bus-pawddp92.js} +1 -1
- package/dist/{execute-6afts2bn.js → execute-x0fy9j0m.js} +1 -1
- package/dist/{external-channel-881zq1x4.js → external-channel-ktfvn29c.js} +2 -2
- package/dist/ffi-cbfmmtqk.js +85 -0
- package/dist/fx-adapter-15vjxvgm.js +20 -0
- package/dist/getMachineId-bsd-2rd3pnz7.js +36 -0
- package/dist/getMachineId-bsd-3p48mkt1.js +36 -0
- package/dist/{getMachineId-bsd-637a7rbk.js → getMachineId-bsd-bk6tmeen.js} +5 -5
- package/dist/getMachineId-bsd-pssqgwmm.js +37 -0
- package/dist/getMachineId-bsd-v218x3xd.js +36 -0
- package/dist/getMachineId-bsd-wbxcazef.js +36 -0
- package/dist/getMachineId-bsd-x0942pbz.js +36 -0
- package/dist/getMachineId-darwin-5qsy4qcg.js +36 -0
- package/dist/getMachineId-darwin-6v7zsshx.js +37 -0
- package/dist/getMachineId-darwin-fcc3fjag.js +36 -0
- package/dist/getMachineId-darwin-pg84hftj.js +36 -0
- package/dist/{getMachineId-darwin-9vytrcnn.js → getMachineId-darwin-tyyevt26.js} +5 -5
- package/dist/getMachineId-darwin-wagmbf0d.js +36 -0
- package/dist/getMachineId-darwin-zvkmwr3y.js +36 -0
- package/dist/{getMachineId-linux-mkzsvyyz.js → getMachineId-linux-2ncg1epd.js} +3 -3
- package/dist/getMachineId-linux-2tmt2ptc.js +29 -0
- package/dist/getMachineId-linux-empwyp2y.js +29 -0
- package/dist/getMachineId-linux-fanqd45b.js +29 -0
- package/dist/getMachineId-linux-h6fyga0x.js +29 -0
- package/dist/getMachineId-linux-tbhgz1k9.js +29 -0
- package/dist/getMachineId-linux-zrbyw7dt.js +29 -0
- package/dist/getMachineId-unsupported-29g9dkgv.js +19 -0
- package/dist/getMachineId-unsupported-8xfq8djv.js +19 -0
- package/dist/getMachineId-unsupported-8y9cag1p.js +19 -0
- package/dist/getMachineId-unsupported-a6sjrm02.js +19 -0
- package/dist/getMachineId-unsupported-bp3w7ds0.js +19 -0
- package/dist/{getMachineId-unsupported-4cfs2n11.js → getMachineId-unsupported-sj6fk8sw.js} +3 -3
- package/dist/getMachineId-unsupported-v0p5gdxp.js +19 -0
- package/dist/getMachineId-win-hc996p0x.js +38 -0
- package/dist/{getMachineId-win-154s3qma.js → getMachineId-win-msq9ad87.js} +6 -6
- package/dist/getMachineId-win-tajyqwd6.js +38 -0
- package/dist/getMachineId-win-tzc163da.js +38 -0
- package/dist/getMachineId-win-xdaa0mgq.js +38 -0
- package/dist/getMachineId-win-xk6p98m5.js +38 -0
- package/dist/getMachineId-win-xtk658fm.js +38 -0
- package/dist/{google-generative-ai-sw77egmr.js → google-generative-ai-nzndg246.js} +1 -1
- package/dist/{google-vertex-rrw93g8h.js → google-vertex-ragh3nnw.js} +1 -1
- package/dist/grok-adapter-77httan0.js +20 -0
- package/dist/handlers-c1jp5b6h.js +39 -0
- package/dist/heartbeat-5yaj6dym.js +49 -0
- package/dist/{hook-a7eh6zty.js → hook-2jttae8s.js} +13 -14
- package/dist/hook-c99nycyh.js +21 -0
- package/dist/{http-6aw5wanc.js → http-7y9dbfrr.js} +870 -219
- package/dist/{index-kzdqn3dd.js → index-6g9rdcrj.js} +3036 -758
- package/dist/index-7dwh9kxh.js +41 -0
- package/dist/{index-ym9fgxad.js → index-8p03vx1h.js} +8 -8
- package/dist/{index-maddg9ys.js → index-cw8nxnba.js} +4330 -15375
- package/dist/{index-yq9hhhhy.js → index-dm7c6hw5.js} +28 -29
- package/dist/index-fqf82sbk.js +10584 -0
- package/dist/{index-126v2d0t.js → index-g7rthzrv.js} +11 -2923
- package/dist/{index-z2g9469g.js → index-h9xnzfhx.js} +114 -33
- package/dist/{index-42jq9yy3.js → index-jvfp0j47.js} +516 -10
- package/dist/{index-3j803vnb.js → index-q60mhcpd.js} +25094 -20637
- package/dist/index-qxcfv8vq.js +17 -0
- package/dist/{index-rz8ve510.js → index-t274qhhs.js} +6 -6
- package/dist/{index-kdmkfjt7.js → index-t4n9z755.js} +3491 -2487
- package/dist/{index-7dgxveck.js → index-tcegcysh.js} +5 -5
- package/dist/{index-whysn1wf.js → index-tn1m3q9b.js} +3 -3
- package/dist/index-wp9tarbt.js +43 -0
- package/dist/{index-xhad0n8m.js → index-xhp7yp3t.js} +1 -1
- package/dist/index-z6np2405.js +38 -0
- package/dist/{k8s-36gfn847.js → k8s-mr1r12th.js} +2 -2
- package/dist/{keepalive-zhbmztqw.js → keepalive-7eyb8y4t.js} +4 -5
- package/dist/lead-50cgn8s1.js +81 -0
- package/dist/{maintenance-rsp0591h.js → maintenance-tdrd8nwv.js} +1 -1
- package/dist/module-ES6BEMUI-6htewwha.js +1210 -0
- package/dist/{node-0as4n1ef.js → node-gbx1t3pa.js} +1 -1
- package/dist/{node-rxte5hc6.js → node-jkdd5w7m.js} +1 -1
- package/dist/{oauth-refresh-sweep-w3cqmxq7.js → oauth-refresh-sweep-f4c7g37h.js} +3 -4
- package/dist/{object-webhooks-331hay92.js → object-webhooks-p190rdxp.js} +7 -7
- package/dist/{onboard-n2w80m2n.js → onboard-56h4sks6.js} +12 -10
- package/dist/{opencode-adapter-z98127cz.js → opencode-adapter-xg3yxfr0.js} +8 -8
- package/dist/{otel-impl-xsk35tvf.js → otel-impl-kepzgm4n.js} +36360 -9179
- package/dist/{pending-2e6trkxd.js → pending-xgv316w0.js} +25 -26
- package/dist/{pi-mono-adapter-wh6yndtm.js → pi-mono-adapter-txe0syzb.js} +19 -22
- package/dist/{pricing-refresh-9355dj1t.js → pricing-refresh-041zpyhf.js} +2 -2
- package/dist/{rbac-roles-8eajw4s6.js → rbac-roles-8f3jbcaf.js} +2 -2
- package/dist/{rbac-roles-58y3m912.js → rbac-roles-cw7rrw5b.js} +3 -3
- package/dist/{render-v2-7gskkmd4.js → render-v2-2ezw4mzt.js} +10 -10
- package/dist/{resume-0drnmpja.js → resume-p14wdx8m.js} +13 -13
- package/dist/{runtime-d2tcmqte.js → runtime-he7c9g1r.js} +1 -1
- package/dist/{session-access-0ztys6bd.js → session-access-8jvq86fj.js} +5 -5
- package/dist/{session-source-backfill-cdm5s046.js → session-source-backfill-6fe3hcgb.js} +3 -3
- package/dist/{setup-pqwb9tcc.js → setup-6v0bn4r1.js} +15 -6
- package/dist/thread-buffer-8860v1ta.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-rwz67mje.js → tree-visibility-g1a8ff4r.js} +2 -2
- package/dist/{user-merge-jobs-mxrhamwt.js → user-merge-jobs-vjsps179.js} +3 -3
- package/dist/{virtual-modules-71y1gsmg.js → virtual-modules-mreda4fp.js} +3 -3
- package/dist/{work-objects-3k4ykt9j.js → work-objects-hfw15e35.js} +29 -33
- package/dist/{worker-follow-up-y0h64xpr.js → worker-follow-up-gbaz2ydz.js} +24 -25
- package/dist/worker-hkm8ftqp.js +81 -0
- package/dist/{x-d27jj7z7.js → x-k29vmskt.js} +2 -2
- package/openapi.json +303 -20
- package/package.json +45 -45
- package/src/apps/definition.ts +76 -24
- package/src/apps/row-store.ts +67 -0
- package/src/apps/script-types.ts +131 -21
- package/src/apps/store.ts +4 -1
- package/src/be/db/model-profiles.ts +103 -12
- package/src/be/db/script-runs.ts +33 -0
- package/src/be/db/slack-card-groups.ts +147 -0
- package/src/be/db/slack-trees.ts +26 -0
- package/src/be/db/task-idempotency.ts +63 -0
- package/src/be/db/tasks/read.ts +7 -0
- package/src/be/db/tasks/write.ts +4 -2
- package/src/be/db/workflow-idempotency.ts +6 -1
- package/src/be/db/workflows/read.ts +79 -0
- package/src/be/db.ts +65 -151
- package/src/be/improvements.ts +24 -2
- package/src/be/mcp-proxy.ts +45 -11
- package/src/be/memory/embedding-space.ts +10 -20
- package/src/be/memory/index.ts +35 -0
- package/src/be/memory/providers/openai-embedding.ts +10 -0
- package/src/be/migrations/348_task_deferred_until.sql +4 -0
- package/src/be/migrations/354_durable_objects.sql +9 -0
- package/src/be/migrations/356_slack_outcome_card_groups.sql +14 -0
- package/src/be/migrations/357_task_idempotency_keys.sql +27 -0
- package/src/be/migrations/362_favorites_app.sql +36 -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/repo-checked-update.ts +58 -5
- package/src/be/requester-timezone.ts +10 -0
- package/src/be/runtime-pools/routing.ts +22 -8
- package/src/be/script-connections.ts +5 -1
- package/src/be/script-credential-broker.ts +29 -2
- package/src/be/scripts/durable.ts +204 -0
- package/src/be/scripts/extract-schema.ts +36 -4
- package/src/be/scripts/run-credential.ts +1 -8
- package/src/be/scripts/typecheck.ts +32 -7
- package/src/be/seed-scripts/catalog/memory-eval.ts +11 -2
- package/src/be/seed-scripts/catalog/tool-usage.ts +27 -8
- package/src/be/swarm-config-guard.ts +104 -14
- package/src/be/users.ts +33 -12
- package/src/comb/review-batch.ts +16 -5
- package/src/commands/context-preamble.ts +237 -0
- package/src/commands/e2b.ts +14 -0
- package/src/commands/entrypoint-mcp-config.ts +231 -0
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/onboard/compose-generator.ts +2 -1
- package/src/commands/onboard/env-generator.ts +16 -7
- package/src/commands/runner.ts +23 -7
- package/src/commands/setup.tsx +17 -3
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/hooks/hook.ts +8 -2
- package/src/hooks/native-tool-hooks.ts +4 -2
- package/src/http/apps.ts +82 -42
- package/src/http/comb.ts +21 -5
- package/src/http/config.ts +8 -4
- package/src/http/db-query.ts +8 -2
- package/src/http/heartbeat.ts +5 -0
- package/src/http/index.ts +12 -6
- package/src/http/kv.ts +7 -5
- package/src/http/mcp-oauth.ts +16 -0
- package/src/http/mcp-servers.ts +43 -3
- package/src/http/memory.ts +28 -1
- package/src/http/metrics.ts +11 -4
- package/src/http/onboarding.ts +12 -1
- package/src/http/operator-actor.ts +3 -8
- package/src/http/poll.ts +20 -1
- package/src/http/repos.ts +30 -12
- package/src/http/request-principal.ts +27 -1
- package/src/http/schedules.ts +59 -11
- package/src/http/script-connection-proxy.ts +3 -1
- package/src/http/script-runs.ts +21 -10
- package/src/http/scripts.ts +177 -26
- package/src/http/session-cost-recompute.ts +9 -4
- package/src/http/skills.ts +70 -0
- package/src/http/status.ts +2 -0
- package/src/http/tasks.ts +103 -15
- package/src/http/trackers/jira.ts +18 -3
- package/src/http/trackers/linear.ts +3 -0
- package/src/kv-limits.ts +2 -0
- package/src/kv-reserved-namespaces.ts +25 -2
- package/src/prompts/base-prompt.ts +10 -6
- package/src/prompts/session-templates.ts +52 -3
- package/src/prompts/session-turns.ts +30 -0
- package/src/providers/acp-targets.ts +1 -1
- package/src/providers/amp-adapter.ts +11 -9
- package/src/providers/claude-managed-adapter.ts +14 -0
- package/src/providers/claude-sdk-session.ts +14 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/opencode-adapter.ts +3 -5
- package/src/providers/runtime-dependencies.ts +11 -8
- package/src/rbac/legacy-policy.ts +7 -0
- package/src/rbac/permissions.ts +27 -0
- package/src/realtime/browser.generated.txt +1 -1
- package/src/scheduler/schedule-task.ts +1 -0
- package/src/scheduler/scheduler.ts +36 -18
- package/src/script-workflows/executor.ts +37 -8
- package/src/script-workflows/supervisor.ts +14 -0
- package/src/scripts-runtime/ctx.ts +5 -1
- package/src/scripts-runtime/durable-object-base.ts +19 -0
- package/src/scripts-runtime/eval-harness.ts +46 -1
- package/src/scripts-runtime/executors/native.ts +13 -1
- package/src/scripts-runtime/executors/quickjs-bundle.ts +20 -1
- package/src/scripts-runtime/executors/quickjs-prelude.ts +40 -1
- package/src/scripts-runtime/executors/quickjs-runner.ts +26 -3
- package/src/scripts-runtime/executors/quickjs-worker.ts +2 -1
- package/src/scripts-runtime/executors/types.ts +26 -0
- package/src/scripts-runtime/extract-signature.ts +96 -1
- package/src/scripts-runtime/loader.ts +11 -5
- package/src/scripts-runtime/mcp-client.ts +1 -1
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/swarm-config.ts +7 -0
- package/src/scripts-runtime/swarm-sdk.ts +4 -1
- package/src/scripts-runtime/types/stdlib.d.ts +19 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +3 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +19 -0
- package/src/slack/actions.ts +24 -0
- package/src/slack/assistant.ts +8 -0
- package/src/slack/blocks.ts +35 -0
- package/src/slack/channel-activity.ts +7 -0
- package/src/slack/config.ts +4 -0
- package/src/slack/enrich.ts +46 -54
- package/src/slack/files.ts +173 -23
- package/src/slack/handlers.test.ts +17 -19
- package/src/slack/handlers.ts +15 -14
- package/src/slack/render-v2.ts +265 -19
- package/src/slack/responses.ts +62 -5
- package/src/slack/session-mirror.ts +10 -5
- package/src/slack/task-output.ts +25 -14
- package/src/slack/templates.ts +9 -0
- package/src/slack/thread-participants.ts +64 -24
- package/src/slack/watcher.ts +4 -4
- package/src/slack/work-objects.ts +1 -1
- package/src/stdio.ts +5 -0
- package/src/tasks/follow-up-gate.ts +142 -38
- package/src/tasks/worker-follow-up.ts +126 -37
- package/src/tests/agents-list-model-display.test.ts +4 -0
- package/src/tests/amp-adapter.test.ts +57 -9
- package/src/tests/apps-script-types.test.ts +63 -16
- package/src/tests/apps-sort-order.test.ts +87 -0
- package/src/tests/base-prompt.test.ts +36 -2
- package/src/tests/bedrock-model-groups.test.ts +4 -0
- package/src/tests/channel-activity.test.ts +9 -0
- package/src/tests/chatgpt-subscription-model-groups.test.ts +4 -0
- package/src/tests/claude-hook-output.test.ts +2 -0
- package/src/tests/claude-managed-adapter.test.ts +15 -3
- package/src/tests/claude-sdk-stderr.test.ts +28 -0
- package/src/tests/codex-gpt6-release.test.ts +4 -0
- package/src/tests/comb-review-batch.test.ts +17 -4
- package/src/tests/comb-status.test.ts +1 -0
- package/src/tests/db-client.test.ts +11 -5
- package/src/tests/db-retention-defaults.test.ts +28 -3
- package/src/tests/db-task-read-contract.test.ts +1 -0
- package/src/tests/db-task-write-contract.test.ts +2 -2
- package/src/tests/defer-task.test.ts +23 -1
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/e2b-dispatch.test.ts +13 -1
- package/src/tests/entrypoint-mcp-config.test.ts +642 -0
- package/src/tests/entrypoint-repo-autoclone-args.test.ts +10 -0
- package/src/tests/fixtures/onboard/content.env.txt +2 -2
- package/src/tests/fixtures/onboard/dev.env.txt +2 -2
- package/src/tests/fixtures/onboard/full-all.env.txt +2 -2
- package/src/tests/fixtures/onboard/full.env.txt +2 -2
- package/src/tests/fixtures/onboard/research.env.txt +2 -2
- package/src/tests/fixtures/onboard/solo.env.txt +2 -2
- package/src/tests/fixtures/runner-missing-dependency.ts +2 -1
- package/src/tests/follow-up-gate-shadow.test.ts +268 -10
- package/src/tests/fx-adapter.test.ts +4 -5
- package/src/tests/hook-mcp-config-precedence.test.ts +59 -0
- package/src/tests/hook-ping-me-order.test.ts +1 -0
- package/src/tests/hook-runtime-close.test.ts +1 -0
- package/src/tests/improvements-payload.test.ts +2 -2
- package/src/tests/linear-outbound-sync.test.ts +59 -25
- package/src/tests/model-groups-live-catalog.test.ts +4 -0
- package/src/tests/oauth-credential-bindings.test.ts +8 -3
- package/src/tests/oauth-refresh-failure.test.ts +15 -3
- package/src/tests/onboard-env.test.ts +1 -1
- package/src/tests/openai-compatible-providers.test.ts +5 -0
- package/src/tests/openapi-route-headers.test.ts +2 -1
- package/src/tests/operator-actor-keyless.test.ts +103 -0
- package/src/tests/opus-5-5-registry.test.ts +4 -0
- package/src/tests/profile-tier-alias.test.ts +9 -3
- package/src/tests/provider-runtime-dependencies.test.ts +26 -15
- package/src/tests/routing-affinity-inventory.test.ts +11 -0
- package/src/tests/runner-context-preamble.test.ts +202 -0
- package/src/tests/runner-repo-clone-args.test.ts +125 -0
- package/src/tests/scheduler-occurrence.test.ts +60 -9
- package/src/tests/script-connections-mcp.test.ts +6 -3
- package/src/tests/script-connections.test.ts +4 -0
- package/src/tests/scripts-namespaces.test.ts +3 -1
- package/src/tests/secret-scrubber.test.ts +8 -2
- package/src/tests/session-cost-recompute-unit.test.ts +39 -0
- package/src/tests/session-costs-recompute-all-providers.test.ts +6 -3
- package/src/tests/session-route-posture.test.ts +7 -1
- package/src/tests/slack-file-tools-attachments.test.ts +14 -9
- package/src/tests/slack-identity-resolution.test.ts +10 -3
- package/src/tests/slack-inline-output.test.ts +10 -8
- package/src/tests/slack-render-v2.test.ts +9 -4
- package/src/tests/slack-steering.test.ts +8 -2
- package/src/tests/slack-thread-participants.test.ts +11 -1
- package/src/tests/sonnet-5-5-registry.test.ts +4 -0
- package/src/tests/swarm-config-encryption.test.ts +5 -8
- package/src/tests/ui-spec-script-actions-config.test.ts +7 -3
- package/src/tests/workflow-system-one-extraction.test.ts +21 -0
- package/src/tests/workflow-triggers-v2.test.ts +35 -11
- package/src/tests/workflow-wait-filter.test.ts +7 -7
- package/src/tests/worktree-reaper.test.ts +15 -4
- package/src/tools/app-patch.ts +6 -2
- package/src/tools/app-upsert.ts +8 -4
- package/src/tools/defer-task.ts +17 -77
- package/src/tools/kv/kv-get.ts +2 -0
- package/src/tools/kv/kv-list.ts +11 -5
- package/src/tools/kv/kv-set.ts +1 -3
- package/src/tools/repos/update-repo.ts +37 -19
- package/src/tools/schedules/create-schedule.ts +20 -3
- package/src/tools/schedules/patch-schedule.ts +30 -4
- package/src/tools/schedules/run-schedule-now.ts +21 -1
- package/src/tools/schedules/update-schedule.ts +30 -4
- package/src/tools/script-apis.ts +9 -4
- package/src/tools/script-common.ts +2 -2
- package/src/tools/script-run.ts +8 -0
- package/src/tools/script-upsert.ts +1 -1
- package/src/tools/send-task.ts +17 -3
- package/src/tools/slack-download-file.ts +15 -12
- package/src/tools/slack-post.ts +14 -3
- package/src/tools/slack-read.ts +3 -1
- package/src/tools/slack-reply.ts +22 -2
- package/src/tools/slack-start-thread.ts +8 -1
- package/src/tools/slack-upload-file.ts +99 -96
- package/src/tools/swarm-config/set-config.ts +3 -1
- package/src/tools/swarm-x.ts +0 -2
- package/src/tools/task-action.ts +16 -3
- package/src/tools/utils.ts +4 -1
- package/src/types.ts +18 -2
- package/src/utils/amp-models.ts +20 -4
- package/src/utils/constants.ts +20 -0
- package/src/utils/deferral-time.ts +61 -0
- package/src/utils/request-auth-context.ts +15 -16
- package/src/utils/secret-scrubber.ts +7 -5
- package/src/workflows/engine.ts +42 -19
- 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/swarm-script.ts +0 -2
- package/src/workflows/executors/system-one-extraction.ts +9 -6
- package/src/workflows/executors/wait.ts +1 -1
- package/src/workflows/foreach-driver.ts +11 -13
- package/src/workflows/input.ts +24 -1
- package/src/workflows/model-validation.ts +13 -1
- package/src/workflows/node-timeout.ts +18 -0
- package/src/workflows/predicate-sandbox.ts +171 -0
- package/src/workflows/retry-poller.ts +3 -2
- package/src/workflows/triggers.ts +21 -11
- package/src/workflows/wait-filter.ts +14 -192
- package/src/x/composio.ts +10 -1
- package/templates/skills/apps/SKILL.md +4 -2
- package/templates/skills/apps/content.md +4 -2
- package/templates/skills/code-quality/content.md +4 -4
- package/templates/skills/heartbeat-runbook/content.md +1 -0
- package/templates/skills/scheduled-task-resilience/SKILL.md +2 -0
- package/templates/skills/scheduled-task-resilience/content.md +2 -0
- package/templates/skills/slack-interaction/content.md +4 -0
- package/templates/skills/swarm-docs/content.md +8 -0
- package/templates/skills/swarm-scripts/SKILL.md +44 -0
- package/templates/skills/swarm-scripts/content.md +44 -0
- package/dist/acp-adapter-tbt61zkm.js +0 -17
- package/dist/cli-5ss6qqt9.js +0 -45
- package/dist/cli-b9ygp1kz.js +0 -459
- package/dist/cli-dzzh58sy.js +0 -6996
- package/dist/cli-j9ccfveb.js +0 -1849
- package/dist/cli-kj0hyr43.js +0 -51
- package/dist/cli-m8f4379k.js +0 -173
- package/dist/cli-mna6pmfx.js +0 -1485
- package/dist/cli-r8ddn0hf.js +0 -25583
- package/dist/core-bwp98v4w.js +0 -42
- package/dist/dsh-adapter-43ygwqn7.js +0 -9
- package/dist/fx-adapter-cr2hq17y.js +0 -20
- package/dist/grok-adapter-ayddnbsc.js +0 -20
- package/dist/handlers-7ghs84x2.js +0 -41
- package/dist/heartbeat-4c022m6a.js +0 -50
- package/dist/hook-4k84x499.js +0 -22
- package/dist/index-dtt0d634.js +0 -44
- package/dist/index-hmszyqkk.js +0 -42
- package/dist/index-j6rm1rtn.js +0 -39
- package/dist/index-rwwhsmjg.js +0 -13
- package/dist/index-t56y945n.js +0 -4
- package/dist/index-vfemrwwk.js +0 -10002
- package/dist/lead-g2j4q39z.js +0 -83
- package/dist/thread-buffer-epx3san4.js +0 -42
- package/dist/worker-09gqn9xy.js +0 -83
- package/dist/{azure-openai-responses-jeaas6x0.js → azure-openai-responses-e76k86gf.js} +4 -4
- package/dist/{openai-codex-responses-70g39cgz.js → openai-codex-responses-z2h941b8.js} +4 -4
- package/dist/{openai-completions-cv3hp4h5.js → openai-completions-5bxdkeg9.js} +4 -4
- package/dist/{openai-responses-trsvnks6.js → openai-responses-dzf3e8r5.js} +4 -4
|
@@ -17,12 +17,20 @@ import {
|
|
|
17
17
|
init_quickjs_pool_config,
|
|
18
18
|
isApiOnlyConfigKey,
|
|
19
19
|
isInternalConfigKey,
|
|
20
|
+
isReservedConfigKey,
|
|
20
21
|
APPS_JSON_COLUMN_MAX_BYTES_BOUNDS,
|
|
22
|
+
APPS_DEFINITION_LIMIT_BOUNDS,
|
|
21
23
|
init_swarm_config_guard,
|
|
22
24
|
normalizeDateRequired,
|
|
23
25
|
init_date_utils,
|
|
24
26
|
getAgentById2,
|
|
25
27
|
getLeadAgent2,
|
|
28
|
+
isInvalidClientError,
|
|
29
|
+
publicEndpointSsrfOptions,
|
|
30
|
+
authMethodForStoredClient,
|
|
31
|
+
refreshMcpToken,
|
|
32
|
+
computeExpiresAt,
|
|
33
|
+
init_mcp_wrapper,
|
|
26
34
|
getScriptById,
|
|
27
35
|
touchScratchScriptLastUsed,
|
|
28
36
|
restoreScratchScriptLastUsedIfUnchanged,
|
|
@@ -46,7 +54,7 @@ import {
|
|
|
46
54
|
getWorkflowVersions2,
|
|
47
55
|
getMcpServerById2,
|
|
48
56
|
init_db4
|
|
49
|
-
} from "./cli-
|
|
57
|
+
} from "./cli-z0c98h7h.js";
|
|
50
58
|
import {
|
|
51
59
|
McpHttpClient,
|
|
52
60
|
init_http_client
|
|
@@ -61,42 +69,34 @@ import {
|
|
|
61
69
|
oauthAppRowToProviderConfig,
|
|
62
70
|
ensureAuthorizationTokenOrThrow,
|
|
63
71
|
init_ensure_token
|
|
64
|
-
} from "./cli-
|
|
72
|
+
} from "./cli-zdkcp8p0.js";
|
|
65
73
|
import {
|
|
66
74
|
AGENT_FS_API_KEY_CONFIG,
|
|
67
75
|
init_script_fs,
|
|
68
76
|
resolveAgentFsIdentity,
|
|
69
77
|
init_agent_fs_identity
|
|
70
|
-
} from "./cli-
|
|
78
|
+
} from "./cli-3bcsc3m7.js";
|
|
71
79
|
import {
|
|
72
80
|
validateDefinition,
|
|
73
81
|
init_definition2
|
|
74
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-976m0zcw.js";
|
|
75
83
|
import {
|
|
76
84
|
getApiKey,
|
|
77
85
|
init_api_key
|
|
78
86
|
} from "./cli-pax9q4ff.js";
|
|
79
|
-
import {
|
|
80
|
-
isInvalidClientError,
|
|
81
|
-
publicEndpointSsrfOptions,
|
|
82
|
-
authMethodForStoredClient,
|
|
83
|
-
refreshMcpToken,
|
|
84
|
-
computeExpiresAt,
|
|
85
|
-
init_mcp_wrapper
|
|
86
|
-
} from "./cli-b9ygp1kz.js";
|
|
87
87
|
import {
|
|
88
88
|
mintUserScriptRunToken,
|
|
89
89
|
revokeUserScriptRunToken,
|
|
90
90
|
mintScriptRunToken,
|
|
91
91
|
revokeSessionToken,
|
|
92
92
|
init_users
|
|
93
|
-
} from "./cli-
|
|
93
|
+
} from "./cli-ny8f5g7t.js";
|
|
94
94
|
import {
|
|
95
95
|
defaultAssetKey,
|
|
96
96
|
init_key,
|
|
97
97
|
AppIconSchema,
|
|
98
98
|
init_types5
|
|
99
|
-
} from "./cli-
|
|
99
|
+
} from "./cli-zmfs06hg.js";
|
|
100
100
|
import {
|
|
101
101
|
init_zod
|
|
102
102
|
} from "./cli-96234j5w.js";
|
|
@@ -116,8 +116,9 @@ import {
|
|
|
116
116
|
} from "./cli-qrzq3hvg.js";
|
|
117
117
|
import {
|
|
118
118
|
getMcpBaseUrl,
|
|
119
|
+
getScriptApiBaseUrl,
|
|
119
120
|
init_constants3
|
|
120
|
-
} from "./cli-
|
|
121
|
+
} from "./cli-466jjrwe.js";
|
|
121
122
|
import {
|
|
122
123
|
isEnvFlagEnabled,
|
|
123
124
|
init_env_flag
|
|
@@ -129,7 +130,7 @@ import {
|
|
|
129
130
|
refreshSecretScrubberCache,
|
|
130
131
|
registerVolatileSecret,
|
|
131
132
|
init_secret_scrubber
|
|
132
|
-
} from "./cli-
|
|
133
|
+
} from "./cli-7qkbab03.js";
|
|
133
134
|
import {
|
|
134
135
|
__toESM,
|
|
135
136
|
__commonJS,
|
|
@@ -162,6 +163,9 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
162
163
|
static get chars() {
|
|
163
164
|
return Object.freeze([]);
|
|
164
165
|
}
|
|
166
|
+
static isValidChar(value) {
|
|
167
|
+
return this.chars.includes(value);
|
|
168
|
+
}
|
|
165
169
|
static get validChars() {
|
|
166
170
|
return /^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/;
|
|
167
171
|
}
|
|
@@ -179,7 +183,7 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
179
183
|
...options,
|
|
180
184
|
rawValue: options.rawValue ?? ""
|
|
181
185
|
};
|
|
182
|
-
this.#values = values.sort(CronField.sorter);
|
|
186
|
+
this.#values = [...values].sort(CronField.sorter);
|
|
183
187
|
this.#wildcard = this.options.wildcard !== undefined ? this.options.wildcard : this.#isWildcardValue();
|
|
184
188
|
this.#hasLastChar = this.options.rawValue.includes("L") || values.includes("L");
|
|
185
189
|
this.#hasQuestionMarkChar = this.options.rawValue.includes("?") || values.includes("?");
|
|
@@ -214,6 +218,23 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
214
218
|
return a.localeCompare(b);
|
|
215
219
|
return aIsNumber ? -1 : 1;
|
|
216
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
|
+
}
|
|
217
238
|
serialize() {
|
|
218
239
|
return {
|
|
219
240
|
wildcard: this.#wildcard,
|
|
@@ -223,17 +244,17 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
223
244
|
validate() {
|
|
224
245
|
let badValue;
|
|
225
246
|
const charsString = this.chars.length > 0 ? ` or chars ${this.chars.join("")}` : "";
|
|
226
|
-
const
|
|
247
|
+
const field = this.constructor;
|
|
227
248
|
const rangeTest = (value) => {
|
|
228
249
|
badValue = value;
|
|
229
|
-
return typeof value === "number" ? value >= this.min && value <= this.max :
|
|
250
|
+
return typeof value === "number" ? value >= this.min && value <= this.max : field.isValidChar(value);
|
|
230
251
|
};
|
|
231
252
|
const isValidRange = this.#values.every(rangeTest);
|
|
232
253
|
if (!isValidRange) {
|
|
233
254
|
throw new Error(`${this.constructor.name} Validation error, got value ${badValue} expected range ${this.min}-${this.max}${charsString}`);
|
|
234
255
|
}
|
|
235
256
|
const duplicate = this.#values.find((value, index) => this.#values.indexOf(value) !== index);
|
|
236
|
-
if (duplicate) {
|
|
257
|
+
if (duplicate !== undefined) {
|
|
237
258
|
throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${duplicate}`);
|
|
238
259
|
}
|
|
239
260
|
}
|
|
@@ -247,135 +268,6 @@ var require_CronField = __commonJS(function(exports) {
|
|
|
247
268
|
exports.CronField = CronField;
|
|
248
269
|
});
|
|
249
270
|
|
|
250
|
-
// node_modules/cron-parser/dist/fields/CronDayOfMonth.js
|
|
251
|
-
var require_CronDayOfMonth = __commonJS(function(exports) {
|
|
252
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
253
|
-
exports.CronDayOfMonth = undefined;
|
|
254
|
-
var CronField_1 = require_CronField();
|
|
255
|
-
var MIN_DAY = 1;
|
|
256
|
-
var MAX_DAY = 31;
|
|
257
|
-
var DAY_CHARS = Object.freeze(["L"]);
|
|
258
|
-
|
|
259
|
-
class CronDayOfMonth extends CronField_1.CronField {
|
|
260
|
-
static get min() {
|
|
261
|
-
return MIN_DAY;
|
|
262
|
-
}
|
|
263
|
-
static get max() {
|
|
264
|
-
return MAX_DAY;
|
|
265
|
-
}
|
|
266
|
-
static get chars() {
|
|
267
|
-
return DAY_CHARS;
|
|
268
|
-
}
|
|
269
|
-
static get validChars() {
|
|
270
|
-
return /^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/;
|
|
271
|
-
}
|
|
272
|
-
constructor(values, options) {
|
|
273
|
-
super(values, options);
|
|
274
|
-
this.validate();
|
|
275
|
-
}
|
|
276
|
-
get values() {
|
|
277
|
-
return super.values;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
exports.CronDayOfMonth = CronDayOfMonth;
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
// node_modules/cron-parser/dist/fields/CronDayOfWeek.js
|
|
284
|
-
var require_CronDayOfWeek = __commonJS(function(exports) {
|
|
285
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
286
|
-
exports.CronDayOfWeek = undefined;
|
|
287
|
-
var CronField_1 = require_CronField();
|
|
288
|
-
var MIN_DAY = 0;
|
|
289
|
-
var MAX_DAY = 7;
|
|
290
|
-
var DAY_CHARS = Object.freeze(["L"]);
|
|
291
|
-
|
|
292
|
-
class CronDayOfWeek extends CronField_1.CronField {
|
|
293
|
-
static get min() {
|
|
294
|
-
return MIN_DAY;
|
|
295
|
-
}
|
|
296
|
-
static get max() {
|
|
297
|
-
return MAX_DAY;
|
|
298
|
-
}
|
|
299
|
-
static get chars() {
|
|
300
|
-
return DAY_CHARS;
|
|
301
|
-
}
|
|
302
|
-
static get validChars() {
|
|
303
|
-
return /^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/;
|
|
304
|
-
}
|
|
305
|
-
constructor(values, options) {
|
|
306
|
-
super(values, options);
|
|
307
|
-
this.validate();
|
|
308
|
-
}
|
|
309
|
-
get values() {
|
|
310
|
-
return super.values;
|
|
311
|
-
}
|
|
312
|
-
get nthDay() {
|
|
313
|
-
return this.options.nthDayOfWeek ?? 0;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
exports.CronDayOfWeek = CronDayOfWeek;
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
// node_modules/cron-parser/dist/fields/CronHour.js
|
|
320
|
-
var require_CronHour = __commonJS(function(exports) {
|
|
321
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
322
|
-
exports.CronHour = undefined;
|
|
323
|
-
var CronField_1 = require_CronField();
|
|
324
|
-
var MIN_HOUR = 0;
|
|
325
|
-
var MAX_HOUR = 23;
|
|
326
|
-
var HOUR_CHARS = Object.freeze([]);
|
|
327
|
-
|
|
328
|
-
class CronHour extends CronField_1.CronField {
|
|
329
|
-
static get min() {
|
|
330
|
-
return MIN_HOUR;
|
|
331
|
-
}
|
|
332
|
-
static get max() {
|
|
333
|
-
return MAX_HOUR;
|
|
334
|
-
}
|
|
335
|
-
static get chars() {
|
|
336
|
-
return HOUR_CHARS;
|
|
337
|
-
}
|
|
338
|
-
constructor(values, options) {
|
|
339
|
-
super(values, options);
|
|
340
|
-
this.validate();
|
|
341
|
-
}
|
|
342
|
-
get values() {
|
|
343
|
-
return super.values;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
exports.CronHour = CronHour;
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
// node_modules/cron-parser/dist/fields/CronMinute.js
|
|
350
|
-
var require_CronMinute = __commonJS(function(exports) {
|
|
351
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
352
|
-
exports.CronMinute = undefined;
|
|
353
|
-
var CronField_1 = require_CronField();
|
|
354
|
-
var MIN_MINUTE = 0;
|
|
355
|
-
var MAX_MINUTE = 59;
|
|
356
|
-
var MINUTE_CHARS = Object.freeze([]);
|
|
357
|
-
|
|
358
|
-
class CronMinute extends CronField_1.CronField {
|
|
359
|
-
static get min() {
|
|
360
|
-
return MIN_MINUTE;
|
|
361
|
-
}
|
|
362
|
-
static get max() {
|
|
363
|
-
return MAX_MINUTE;
|
|
364
|
-
}
|
|
365
|
-
static get chars() {
|
|
366
|
-
return MINUTE_CHARS;
|
|
367
|
-
}
|
|
368
|
-
constructor(values, options) {
|
|
369
|
-
super(values, options);
|
|
370
|
-
this.validate();
|
|
371
|
-
}
|
|
372
|
-
get values() {
|
|
373
|
-
return super.values;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
exports.CronMinute = CronMinute;
|
|
377
|
-
});
|
|
378
|
-
|
|
379
271
|
// node_modules/luxon/build/node/luxon.js
|
|
380
272
|
var require_luxon = __commonJS(function(exports) {
|
|
381
273
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -5268,32 +5160,16 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5268
5160
|
class CronDate {
|
|
5269
5161
|
#date;
|
|
5270
5162
|
#dstStart = null;
|
|
5163
|
+
#dstStartLandingHour = null;
|
|
5271
5164
|
#dstEnd = null;
|
|
5272
|
-
#verbMap = {
|
|
5273
|
-
add: {
|
|
5274
|
-
[TimeUnit.Year]: this.addYear.bind(this),
|
|
5275
|
-
[TimeUnit.Month]: this.addMonth.bind(this),
|
|
5276
|
-
[TimeUnit.Day]: this.addDay.bind(this),
|
|
5277
|
-
[TimeUnit.Hour]: this.addHour.bind(this),
|
|
5278
|
-
[TimeUnit.Minute]: this.addMinute.bind(this),
|
|
5279
|
-
[TimeUnit.Second]: this.addSecond.bind(this)
|
|
5280
|
-
},
|
|
5281
|
-
subtract: {
|
|
5282
|
-
[TimeUnit.Year]: this.subtractYear.bind(this),
|
|
5283
|
-
[TimeUnit.Month]: this.subtractMonth.bind(this),
|
|
5284
|
-
[TimeUnit.Day]: this.subtractDay.bind(this),
|
|
5285
|
-
[TimeUnit.Hour]: this.subtractHour.bind(this),
|
|
5286
|
-
[TimeUnit.Minute]: this.subtractMinute.bind(this),
|
|
5287
|
-
[TimeUnit.Second]: this.subtractSecond.bind(this)
|
|
5288
|
-
}
|
|
5289
|
-
};
|
|
5290
5165
|
constructor(timestamp, tz) {
|
|
5291
5166
|
const dateOpts = { zone: tz };
|
|
5292
|
-
if (!timestamp) {
|
|
5167
|
+
if (!timestamp && timestamp !== 0) {
|
|
5293
5168
|
this.#date = luxon_1.DateTime.local();
|
|
5294
5169
|
} else if (timestamp instanceof CronDate) {
|
|
5295
5170
|
this.#date = timestamp.#date;
|
|
5296
5171
|
this.#dstStart = timestamp.#dstStart;
|
|
5172
|
+
this.#dstStartLandingHour = timestamp.#dstStartLandingHour;
|
|
5297
5173
|
this.#dstEnd = timestamp.#dstEnd;
|
|
5298
5174
|
} else if (timestamp instanceof Date) {
|
|
5299
5175
|
this.#date = luxon_1.DateTime.fromJSDate(timestamp, dateOpts);
|
|
@@ -5304,6 +5180,7 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5304
5180
|
this.#date.isValid || (this.#date = luxon_1.DateTime.fromRFC2822(timestamp, dateOpts));
|
|
5305
5181
|
this.#date.isValid || (this.#date = luxon_1.DateTime.fromSQL(timestamp, dateOpts));
|
|
5306
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));
|
|
5307
5184
|
}
|
|
5308
5185
|
if (!this.#date.isValid) {
|
|
5309
5186
|
throw new Error(`CronDate: unhandled timestamp: ${timestamp}`);
|
|
@@ -5318,8 +5195,12 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5318
5195
|
get dstStart() {
|
|
5319
5196
|
return this.#dstStart;
|
|
5320
5197
|
}
|
|
5321
|
-
|
|
5322
|
-
this.#
|
|
5198
|
+
get dstStartLandingHour() {
|
|
5199
|
+
return this.#dstStartLandingHour;
|
|
5200
|
+
}
|
|
5201
|
+
clearDstStart() {
|
|
5202
|
+
this.#dstStart = null;
|
|
5203
|
+
this.#dstStartLandingHour = null;
|
|
5323
5204
|
}
|
|
5324
5205
|
get dstEnd() {
|
|
5325
5206
|
return this.#dstEnd;
|
|
@@ -5364,10 +5245,36 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5364
5245
|
this.#date = this.#date.minus({ seconds: 1 });
|
|
5365
5246
|
}
|
|
5366
5247
|
addUnit(unit) {
|
|
5367
|
-
|
|
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
|
+
}
|
|
5368
5262
|
}
|
|
5369
5263
|
subtractUnit(unit) {
|
|
5370
|
-
|
|
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
|
+
}
|
|
5371
5278
|
}
|
|
5372
5279
|
invokeDateOperation(verb, unit) {
|
|
5373
5280
|
if (verb === DateMathOp.Add) {
|
|
@@ -5405,6 +5312,15 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5405
5312
|
getMilliseconds() {
|
|
5406
5313
|
return this.#date.millisecond;
|
|
5407
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
|
+
}
|
|
5408
5324
|
getTime() {
|
|
5409
5325
|
return this.#date.valueOf();
|
|
5410
5326
|
}
|
|
@@ -5436,29 +5352,34 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5436
5352
|
toJSON() {
|
|
5437
5353
|
return this.#date.toJSON();
|
|
5438
5354
|
}
|
|
5355
|
+
#set(unit, value) {
|
|
5356
|
+
if (this.#date[unit] !== value) {
|
|
5357
|
+
this.#date = this.#date.set({ [unit]: value });
|
|
5358
|
+
}
|
|
5359
|
+
}
|
|
5439
5360
|
setDate(d) {
|
|
5440
|
-
this.#
|
|
5361
|
+
this.#set("day", d);
|
|
5441
5362
|
}
|
|
5442
5363
|
setFullYear(y) {
|
|
5443
|
-
this.#
|
|
5364
|
+
this.#set("year", y);
|
|
5444
5365
|
}
|
|
5445
5366
|
setDay(d) {
|
|
5446
|
-
this.#
|
|
5367
|
+
this.#set("weekday", d);
|
|
5447
5368
|
}
|
|
5448
5369
|
setMonth(m) {
|
|
5449
|
-
this.#
|
|
5370
|
+
this.#set("month", m + 1);
|
|
5450
5371
|
}
|
|
5451
5372
|
setHours(h) {
|
|
5452
|
-
this.#
|
|
5373
|
+
this.#set("hour", h);
|
|
5453
5374
|
}
|
|
5454
5375
|
setMinutes(m) {
|
|
5455
|
-
this.#
|
|
5376
|
+
this.#set("minute", m);
|
|
5456
5377
|
}
|
|
5457
5378
|
setSeconds(s) {
|
|
5458
|
-
this.#
|
|
5379
|
+
this.#set("second", s);
|
|
5459
5380
|
}
|
|
5460
5381
|
setMilliseconds(s) {
|
|
5461
|
-
this.#
|
|
5382
|
+
this.#set("millisecond", s);
|
|
5462
5383
|
}
|
|
5463
5384
|
toString() {
|
|
5464
5385
|
return this.toDate().toString();
|
|
@@ -5487,17 +5408,24 @@ var require_CronDate = __commonJS(function(exports) {
|
|
|
5487
5408
|
applyDateOperation(op, unit, hoursLength) {
|
|
5488
5409
|
if (unit === TimeUnit.Month || unit === TimeUnit.Day) {
|
|
5489
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
|
+
}
|
|
5490
5416
|
return;
|
|
5491
5417
|
}
|
|
5492
5418
|
const previousHour = this.getHours();
|
|
5419
|
+
const previousOffset = this.getUTCOffset();
|
|
5493
5420
|
this.invokeDateOperation(op, unit);
|
|
5494
5421
|
const currentHour = this.getHours();
|
|
5495
|
-
const
|
|
5496
|
-
if (
|
|
5422
|
+
const advance = (currentHour - previousHour + 24) % 24;
|
|
5423
|
+
if (op === DateMathOp.Add && this.getUTCOffset() > previousOffset && advance >= 2) {
|
|
5497
5424
|
if (hoursLength !== 24) {
|
|
5498
|
-
this
|
|
5425
|
+
this.#dstStart = (previousHour + 1) % 24;
|
|
5426
|
+
this.#dstStartLandingHour = currentHour;
|
|
5499
5427
|
}
|
|
5500
|
-
} else if (
|
|
5428
|
+
} else if (advance === 0 && this.getMinutes() === 0 && this.getSeconds() === 0) {
|
|
5501
5429
|
if (hoursLength !== 24) {
|
|
5502
5430
|
this.dstEnd = currentHour;
|
|
5503
5431
|
}
|
|
@@ -5545,6 +5473,150 @@ var require_CronMonth = __commonJS(function(exports) {
|
|
|
5545
5473
|
exports.CronMonth = CronMonth;
|
|
5546
5474
|
});
|
|
5547
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
|
+
|
|
5548
5620
|
// node_modules/cron-parser/dist/fields/CronSecond.js
|
|
5549
5621
|
var require_CronSecond = __commonJS(function(exports) {
|
|
5550
5622
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -5659,8 +5731,9 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5659
5731
|
if (!dayOfWeek) {
|
|
5660
5732
|
throw new Error("Validation error, Field dayOfWeek is missing");
|
|
5661
5733
|
}
|
|
5662
|
-
if (
|
|
5663
|
-
|
|
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)) {
|
|
5664
5737
|
throw new Error("Invalid explicit day of month definition");
|
|
5665
5738
|
}
|
|
5666
5739
|
}
|
|
@@ -5746,6 +5819,10 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5746
5819
|
return null;
|
|
5747
5820
|
}
|
|
5748
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
|
+
}
|
|
5749
5826
|
return field.hasQuestionMarkChar ? "?" : "*";
|
|
5750
5827
|
}
|
|
5751
5828
|
if (step !== 1 && range.start === field.min && range.end && range.end >= max - step + 1) {
|
|
@@ -5753,7 +5830,7 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5753
5830
|
}
|
|
5754
5831
|
return null;
|
|
5755
5832
|
}
|
|
5756
|
-
static #handleMultipleRanges(range
|
|
5833
|
+
static #handleMultipleRanges(range) {
|
|
5757
5834
|
const step = range.step;
|
|
5758
5835
|
if (step === 1) {
|
|
5759
5836
|
return `${range.start}-${range.end}`;
|
|
@@ -5778,7 +5855,7 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5778
5855
|
const seed = { length: range.end - range.start + 1 };
|
|
5779
5856
|
return Array.from(seed, mapFn).filter((value) => value !== null).join(",");
|
|
5780
5857
|
}
|
|
5781
|
-
return
|
|
5858
|
+
return `${range.start}-${range.end}/${step}`;
|
|
5782
5859
|
}
|
|
5783
5860
|
stringifyField(field) {
|
|
5784
5861
|
let max = field.max;
|
|
@@ -5799,7 +5876,7 @@ var require_CronFieldCollection = __commonJS(function(exports) {
|
|
|
5799
5876
|
}
|
|
5800
5877
|
}
|
|
5801
5878
|
return ranges.map((range) => {
|
|
5802
|
-
const value = range.count === 1 ? range.start.toString() : CronFieldCollection.#handleMultipleRanges(range
|
|
5879
|
+
const value = range.count === 1 ? range.start.toString() : CronFieldCollection.#handleMultipleRanges(range);
|
|
5803
5880
|
if (field instanceof fields_1.CronDayOfWeek && field.nthDay > 0) {
|
|
5804
5881
|
return `${value}#${field.nthDay}`;
|
|
5805
5882
|
}
|
|
@@ -5840,17 +5917,20 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5840
5917
|
class CronExpression {
|
|
5841
5918
|
#options;
|
|
5842
5919
|
#tz;
|
|
5920
|
+
#initialDate;
|
|
5843
5921
|
#currentDate;
|
|
5844
5922
|
#startDate;
|
|
5845
5923
|
#endDate;
|
|
5846
5924
|
#fields;
|
|
5925
|
+
#dstTransitionDayKey = null;
|
|
5926
|
+
#isDstTransitionDay = false;
|
|
5847
5927
|
constructor(fields, options) {
|
|
5848
5928
|
this.#options = options;
|
|
5849
5929
|
this.#tz = options.tz;
|
|
5850
|
-
this.#startDate = options.startDate ? new CronDate_1.CronDate(options.startDate, this.#tz) : null;
|
|
5851
|
-
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;
|
|
5852
5932
|
let currentDateValue = options.currentDate ?? options.startDate;
|
|
5853
|
-
if (currentDateValue) {
|
|
5933
|
+
if (currentDateValue != null) {
|
|
5854
5934
|
const tempCurrentDate = new CronDate_1.CronDate(currentDateValue, this.#tz);
|
|
5855
5935
|
if (this.#startDate && tempCurrentDate.getTime() < this.#startDate.getTime()) {
|
|
5856
5936
|
currentDateValue = this.#startDate;
|
|
@@ -5858,7 +5938,8 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5858
5938
|
currentDateValue = this.#endDate;
|
|
5859
5939
|
}
|
|
5860
5940
|
}
|
|
5861
|
-
this.#
|
|
5941
|
+
this.#initialDate = new CronDate_1.CronDate(currentDateValue, this.#tz);
|
|
5942
|
+
this.#currentDate = this.#initialDate;
|
|
5862
5943
|
this.#fields = fields;
|
|
5863
5944
|
}
|
|
5864
5945
|
get fields() {
|
|
@@ -5870,15 +5951,56 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5870
5951
|
static #matchSchedule(value, sequence) {
|
|
5871
5952
|
return sequence.some((element) => element === value);
|
|
5872
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
|
+
}
|
|
5873
5995
|
static #isLastWeekdayOfMonthMatch(expressions, currentDate) {
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
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;
|
|
5882
6004
|
}
|
|
5883
6005
|
next() {
|
|
5884
6006
|
return this.#findSchedule();
|
|
@@ -5930,7 +6052,7 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5930
6052
|
return items;
|
|
5931
6053
|
}
|
|
5932
6054
|
reset(newDate) {
|
|
5933
|
-
this.#currentDate = new CronDate_1.CronDate(newDate
|
|
6055
|
+
this.#currentDate = newDate ? new CronDate_1.CronDate(newDate, this.#tz) : this.#initialDate;
|
|
5934
6056
|
}
|
|
5935
6057
|
stringify(includeSeconds = false) {
|
|
5936
6058
|
return this.#fields.stringify(includeSeconds);
|
|
@@ -5944,12 +6066,6 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5944
6066
|
if (!this.#matchDayOfMonth(dt)) {
|
|
5945
6067
|
return false;
|
|
5946
6068
|
}
|
|
5947
|
-
if (this.#fields.dayOfWeek.nthDay > 0) {
|
|
5948
|
-
const weekInMonth = Math.ceil(dt.getDate() / 7);
|
|
5949
|
-
if (weekInMonth !== this.#fields.dayOfWeek.nthDay) {
|
|
5950
|
-
return false;
|
|
5951
|
-
}
|
|
5952
|
-
}
|
|
5953
6069
|
return true;
|
|
5954
6070
|
}
|
|
5955
6071
|
toString() {
|
|
@@ -5961,7 +6077,8 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5961
6077
|
const isDayOfWeekWildcardMatch = this.#fields.dayOfWeek.isWildcard;
|
|
5962
6078
|
const isRestrictedDayOfWeek = !isDayOfWeekWildcardMatch;
|
|
5963
6079
|
const matchedDOM = CronExpression.#matchSchedule(currentDate.getDate(), this.#fields.dayOfMonth.values) || this.#fields.dayOfMonth.hasLastChar && currentDate.isLastDayOfMonth();
|
|
5964
|
-
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);
|
|
5965
6082
|
if (isRestrictedDayOfMonth && isRestrictedDayOfWeek && (matchedDOM || matchedDOW)) {
|
|
5966
6083
|
return true;
|
|
5967
6084
|
}
|
|
@@ -5974,25 +6091,47 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
5974
6091
|
return false;
|
|
5975
6092
|
}
|
|
5976
6093
|
#matchHour(currentDate, dateMathVerb, reverse) {
|
|
6094
|
+
const hourValues = this.#fields.hour.values;
|
|
6095
|
+
const hours = hourValues;
|
|
5977
6096
|
const currentHour = currentDate.getHours();
|
|
5978
|
-
const isMatch = CronExpression.#matchSchedule(currentHour,
|
|
5979
|
-
const isDstStart = currentDate.dstStart === currentHour;
|
|
6097
|
+
const isMatch = CronExpression.#matchSchedule(currentHour, hourValues);
|
|
5980
6098
|
const isDstEnd = currentDate.dstEnd === currentHour;
|
|
5981
|
-
if (
|
|
5982
|
-
currentDate.dstStart =
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
currentDate.invokeDateOperation(dateMathVerb, CronDate_1.TimeUnit.Hour);
|
|
5988
|
-
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
|
+
}
|
|
5989
6105
|
}
|
|
5990
6106
|
if (isDstEnd && !reverse) {
|
|
5991
6107
|
currentDate.dstEnd = null;
|
|
5992
|
-
currentDate.applyDateOperation(CronDate_1.DateMathOp.Add, CronDate_1.TimeUnit.Hour,
|
|
6108
|
+
currentDate.applyDateOperation(CronDate_1.DateMathOp.Add, CronDate_1.TimeUnit.Hour, hours.length);
|
|
5993
6109
|
return false;
|
|
5994
6110
|
}
|
|
5995
|
-
|
|
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;
|
|
5996
6135
|
}
|
|
5997
6136
|
#validateTimeSpan(currentDate) {
|
|
5998
6137
|
if (!this.#startDate && !this.#endDate) {
|
|
@@ -6010,54 +6149,55 @@ var require_CronExpression = __commonJS(function(exports) {
|
|
|
6010
6149
|
const dateMathVerb = reverse ? CronDate_1.DateMathOp.Subtract : CronDate_1.DateMathOp.Add;
|
|
6011
6150
|
const currentDate = new CronDate_1.CronDate(this.#currentDate);
|
|
6012
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
|
+
}
|
|
6013
6158
|
let stepCount = 0;
|
|
6014
6159
|
while (++stepCount < LOOP_LIMIT) {
|
|
6015
6160
|
this.#validateTimeSpan(currentDate);
|
|
6016
|
-
if (!
|
|
6017
|
-
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);
|
|
6018
6163
|
continue;
|
|
6019
6164
|
}
|
|
6020
|
-
if (!
|
|
6165
|
+
if (!this.#matchDayOfMonth(currentDate)) {
|
|
6021
6166
|
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Day, this.#fields.hour.values.length);
|
|
6022
6167
|
continue;
|
|
6023
6168
|
}
|
|
6024
|
-
if (!CronExpression.#matchSchedule(currentDate.getMonth() + 1, this.#fields.month.values)) {
|
|
6025
|
-
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Month, this.#fields.hour.values.length);
|
|
6026
|
-
continue;
|
|
6027
|
-
}
|
|
6028
6169
|
if (!this.#matchHour(currentDate, dateMathVerb, reverse)) {
|
|
6029
6170
|
continue;
|
|
6030
6171
|
}
|
|
6031
6172
|
if (!CronExpression.#matchSchedule(currentDate.getMinutes(), this.#fields.minute.values)) {
|
|
6032
|
-
currentDate
|
|
6173
|
+
this.#moveToNextMinute(currentDate, dateMathVerb, reverse);
|
|
6033
6174
|
continue;
|
|
6034
6175
|
}
|
|
6035
6176
|
if (!CronExpression.#matchSchedule(currentDate.getSeconds(), this.#fields.second.values)) {
|
|
6036
|
-
currentDate
|
|
6177
|
+
this.#moveToNextSecond(currentDate, dateMathVerb, reverse);
|
|
6037
6178
|
continue;
|
|
6038
6179
|
}
|
|
6039
6180
|
if (startTimestamp === currentDate.getTime()) {
|
|
6040
|
-
|
|
6041
|
-
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Second, this.#fields.hour.values.length);
|
|
6042
|
-
}
|
|
6181
|
+
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Second, this.#fields.hour.values.length);
|
|
6043
6182
|
continue;
|
|
6044
6183
|
}
|
|
6045
6184
|
break;
|
|
6046
6185
|
}
|
|
6047
|
-
if (stepCount
|
|
6186
|
+
if (stepCount >= LOOP_LIMIT) {
|
|
6048
6187
|
throw new Error(exports.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);
|
|
6049
6188
|
}
|
|
6050
|
-
if (currentDate.getMilliseconds() !== 0) {
|
|
6051
|
-
currentDate.setMilliseconds(0);
|
|
6052
|
-
}
|
|
6053
6189
|
this.#currentDate = currentDate;
|
|
6054
6190
|
return currentDate;
|
|
6055
6191
|
}
|
|
6056
6192
|
[Symbol.iterator]() {
|
|
6057
6193
|
return {
|
|
6058
6194
|
next: () => {
|
|
6059
|
-
|
|
6060
|
-
|
|
6195
|
+
try {
|
|
6196
|
+
const schedule = this.#findSchedule();
|
|
6197
|
+
return { value: schedule, done: false };
|
|
6198
|
+
} catch {
|
|
6199
|
+
return { value: undefined, done: true };
|
|
6200
|
+
}
|
|
6061
6201
|
}
|
|
6062
6202
|
};
|
|
6063
6203
|
}
|
|
@@ -6147,28 +6287,32 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6147
6287
|
DayOfWeek[DayOfWeek["fri"] = 5] = "fri";
|
|
6148
6288
|
DayOfWeek[DayOfWeek["sat"] = 6] = "sat";
|
|
6149
6289
|
})(DayOfWeek || (exports.DayOfWeek = DayOfWeek = {}));
|
|
6290
|
+
var MAX_FIELD_VALUES = 256;
|
|
6291
|
+
var MAX_EXPRESSION_LENGTH = 1024;
|
|
6150
6292
|
|
|
6151
6293
|
class CronExpressionParser {
|
|
6152
6294
|
static parse(expression, options = {}) {
|
|
6153
6295
|
const { strict = false, hashSeed } = options;
|
|
6154
6296
|
const rand = (0, random_1.seededRandom)(hashSeed);
|
|
6155
|
-
|
|
6297
|
+
if (Object.hasOwn(PredefinedExpressions, expression)) {
|
|
6298
|
+
expression = PredefinedExpressions[expression];
|
|
6299
|
+
}
|
|
6156
6300
|
const rawFields = CronExpressionParser.#getRawFields(expression, strict);
|
|
6157
6301
|
if (!(rawFields.dayOfMonth === "*" || rawFields.dayOfWeek === "*" || !strict)) {
|
|
6158
6302
|
throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");
|
|
6159
6303
|
}
|
|
6160
|
-
const second = CronExpressionParser.#parseField(CronUnit.Second, rawFields.second, fields_1.CronSecond.constraints, rand);
|
|
6161
|
-
const minute = CronExpressionParser.#parseField(CronUnit.Minute, rawFields.minute, fields_1.CronMinute.constraints, rand);
|
|
6162
|
-
const hour = CronExpressionParser.#parseField(CronUnit.Hour, rawFields.hour, fields_1.CronHour.constraints, rand);
|
|
6163
|
-
const month = CronExpressionParser.#parseField(CronUnit.Month, rawFields.month, fields_1.CronMonth.constraints, rand);
|
|
6164
|
-
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);
|
|
6165
6309
|
const { dayOfWeek: _dayOfWeek, nthDayOfWeek } = CronExpressionParser.#parseNthDay(rawFields.dayOfWeek);
|
|
6166
|
-
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);
|
|
6167
6311
|
const fields = new CronFieldCollection_1.CronFieldCollection({
|
|
6168
6312
|
second: new fields_1.CronSecond(second, { rawValue: rawFields.second }),
|
|
6169
6313
|
minute: new fields_1.CronMinute(minute, { rawValue: rawFields.minute }),
|
|
6170
6314
|
hour: new fields_1.CronHour(hour, { rawValue: rawFields.hour }),
|
|
6171
|
-
dayOfMonth:
|
|
6315
|
+
dayOfMonth: fields_1.CronDayOfMonth.fromMonth(month, dayOfMonth, { rawValue: rawFields.dayOfMonth }),
|
|
6172
6316
|
month: new fields_1.CronMonth(month, { rawValue: rawFields.month }),
|
|
6173
6317
|
dayOfWeek: new fields_1.CronDayOfWeek(dayOfWeek, { rawValue: rawFields.dayOfWeek, nthDayOfWeek })
|
|
6174
6318
|
});
|
|
@@ -6179,6 +6323,9 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6179
6323
|
throw new Error("Invalid cron expression");
|
|
6180
6324
|
}
|
|
6181
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
|
+
}
|
|
6182
6329
|
const atoms = expression.trim().split(/\s+/);
|
|
6183
6330
|
if (strict && atoms.length < 6) {
|
|
6184
6331
|
throw new Error("Invalid cron expression, expected 6 fields");
|
|
@@ -6186,18 +6333,19 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6186
6333
|
if (atoms.length > 6) {
|
|
6187
6334
|
throw new Error("Invalid cron expression, too many fields");
|
|
6188
6335
|
}
|
|
6189
|
-
const defaults = ["
|
|
6336
|
+
const defaults = ["0", "*", "*", "*", "*", "*"];
|
|
6190
6337
|
if (atoms.length < defaults.length) {
|
|
6191
|
-
atoms.unshift(...defaults.slice(atoms.length));
|
|
6338
|
+
atoms.unshift(...defaults.slice(0, defaults.length - atoms.length));
|
|
6192
6339
|
}
|
|
6193
6340
|
const [second, minute, hour, dayOfMonth, month, dayOfWeek] = atoms;
|
|
6194
6341
|
return { second, minute, hour, dayOfMonth, month, dayOfWeek };
|
|
6195
6342
|
}
|
|
6196
|
-
static #parseField(field, value, constraints, rand) {
|
|
6343
|
+
static #parseField(field, value, constraints, rand, strict) {
|
|
6197
6344
|
if (field === CronUnit.Month || field === CronUnit.DayOfWeek) {
|
|
6345
|
+
const aliases = field === CronUnit.Month ? Months : DayOfWeek;
|
|
6198
6346
|
value = value.replace(/[a-z]{3}/gi, (match) => {
|
|
6199
6347
|
match = match.toLowerCase();
|
|
6200
|
-
const replacer =
|
|
6348
|
+
const replacer = aliases[match];
|
|
6201
6349
|
if (replacer === undefined) {
|
|
6202
6350
|
throw new Error(`Validation error, cannot resolve alias "${match}"`);
|
|
6203
6351
|
}
|
|
@@ -6208,59 +6356,90 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6208
6356
|
throw new Error(`Invalid characters, got value: ${value}`);
|
|
6209
6357
|
}
|
|
6210
6358
|
value = this.#parseWildcard(value, constraints);
|
|
6211
|
-
value = this.#parseHashed(value, constraints, rand);
|
|
6359
|
+
value = this.#parseHashed(value, constraints, rand, field, strict);
|
|
6212
6360
|
return this.#parseSequence(field, value, constraints);
|
|
6213
6361
|
}
|
|
6214
6362
|
static #parseWildcard(value, constraints) {
|
|
6215
|
-
|
|
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;
|
|
6216
6368
|
}
|
|
6217
|
-
static #parseHashed(value, constraints, rand) {
|
|
6369
|
+
static #parseHashed(value, constraints, rand, field, strict) {
|
|
6218
6370
|
const randomValue = rand();
|
|
6371
|
+
let count = 0;
|
|
6219
6372
|
return value.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g, (_, min, max, step) => {
|
|
6220
6373
|
if (min && max && step) {
|
|
6221
6374
|
const minNum = parseInt(min, 10);
|
|
6222
6375
|
const maxNum = parseInt(max, 10);
|
|
6223
6376
|
const stepNum = parseInt(step, 10);
|
|
6224
|
-
if (minNum > maxNum) {
|
|
6225
|
-
throw new Error(`Invalid range: ${minNum}-${maxNum}, min > max`);
|
|
6226
|
-
}
|
|
6227
6377
|
if (stepNum <= 0) {
|
|
6228
6378
|
throw new Error(`Invalid step: ${stepNum}, must be positive`);
|
|
6229
6379
|
}
|
|
6230
|
-
const
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
if (i >= minStart) {
|
|
6235
|
-
values.push(i);
|
|
6236
|
-
}
|
|
6237
|
-
}
|
|
6238
|
-
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);
|
|
6239
6384
|
} else if (min && max) {
|
|
6240
6385
|
const minNum = parseInt(min, 10);
|
|
6241
6386
|
const maxNum = parseInt(max, 10);
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
}
|
|
6245
|
-
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));
|
|
6246
6389
|
} else if (step) {
|
|
6247
6390
|
const stepNum = parseInt(step, 10);
|
|
6248
6391
|
if (stepNum <= 0) {
|
|
6249
6392
|
throw new Error(`Invalid step: ${stepNum}, must be positive`);
|
|
6250
6393
|
}
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
if (i >= constraints.min) {
|
|
6255
|
-
values.push(i);
|
|
6256
|
-
}
|
|
6257
|
-
}
|
|
6258
|
-
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);
|
|
6259
6397
|
} else {
|
|
6260
|
-
return String(
|
|
6398
|
+
return String(CronExpressionParser.#hashedValue(randomValue, constraints.min, constraints.max));
|
|
6261
6399
|
}
|
|
6262
6400
|
});
|
|
6263
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
|
+
}
|
|
6264
6443
|
static #parseSequence(field, val, constraints) {
|
|
6265
6444
|
const stack = [];
|
|
6266
6445
|
function handleResult(result, constraints) {
|
|
@@ -6280,12 +6459,13 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6280
6459
|
}
|
|
6281
6460
|
}
|
|
6282
6461
|
const atoms = val.split(",");
|
|
6283
|
-
|
|
6462
|
+
for (const atom of atoms) {
|
|
6463
|
+
CronExpressionParser.#assertMaxFieldValues(field, stack.length);
|
|
6284
6464
|
if (!(atom.length > 0)) {
|
|
6285
6465
|
throw new Error("Invalid list value format");
|
|
6286
6466
|
}
|
|
6287
6467
|
handleResult(CronExpressionParser.#parseRepeat(field, atom, constraints), constraints);
|
|
6288
|
-
}
|
|
6468
|
+
}
|
|
6289
6469
|
return stack;
|
|
6290
6470
|
}
|
|
6291
6471
|
static #parseRepeat(field, val, constraints) {
|
|
@@ -6294,10 +6474,10 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6294
6474
|
throw new Error(`Invalid repeat: ${val}`);
|
|
6295
6475
|
}
|
|
6296
6476
|
if (atoms.length === 2) {
|
|
6297
|
-
if (!
|
|
6477
|
+
if (!atoms[0].includes("-")) {
|
|
6298
6478
|
atoms[0] = `${atoms[0]}-${constraints.max}`;
|
|
6299
6479
|
}
|
|
6300
|
-
return CronExpressionParser.#parseRange(field, atoms[0],
|
|
6480
|
+
return CronExpressionParser.#parseRange(field, atoms[0], +atoms[1], constraints);
|
|
6301
6481
|
}
|
|
6302
6482
|
return CronExpressionParser.#parseRange(field, val, 1, constraints);
|
|
6303
6483
|
}
|
|
@@ -6317,7 +6497,7 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6317
6497
|
}
|
|
6318
6498
|
static #createRange(field, min, max, repeatInterval) {
|
|
6319
6499
|
const stack = [];
|
|
6320
|
-
if (field === CronUnit.DayOfWeek && max % 7 === 0) {
|
|
6500
|
+
if (field === CronUnit.DayOfWeek && max % 7 === 0 && (max - min) % repeatInterval === 0) {
|
|
6321
6501
|
stack.push(0);
|
|
6322
6502
|
}
|
|
6323
6503
|
for (let index = min;index <= max; index += repeatInterval) {
|
|
@@ -6332,7 +6512,10 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6332
6512
|
if (atoms.length <= 1) {
|
|
6333
6513
|
return isNaN(+val) ? val : +val;
|
|
6334
6514
|
}
|
|
6335
|
-
|
|
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);
|
|
6336
6519
|
this.#validateRange(min, max, constraints);
|
|
6337
6520
|
this.#validateRepeatInterval(repeatInterval);
|
|
6338
6521
|
return this.#createRange(field, min, max, repeatInterval);
|
|
@@ -6343,7 +6526,7 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6343
6526
|
return { dayOfWeek: atoms[0] };
|
|
6344
6527
|
}
|
|
6345
6528
|
const nthValue = +atoms[atoms.length - 1];
|
|
6346
|
-
const matches = val.match(/([
|
|
6529
|
+
const matches = val.match(/([,\-/L])/);
|
|
6347
6530
|
if (matches !== null) {
|
|
6348
6531
|
throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${matches?.[0]}\` special characters are incompatible`);
|
|
6349
6532
|
}
|
|
@@ -6361,57 +6544,13 @@ var require_CronExpressionParser = __commonJS(function(exports) {
|
|
|
6361
6544
|
|
|
6362
6545
|
// node_modules/cron-parser/dist/CronFileParser.js
|
|
6363
6546
|
var require_CronFileParser = __commonJS(function(exports) {
|
|
6364
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6365
|
-
if (k2 === undefined)
|
|
6366
|
-
k2 = k;
|
|
6367
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6368
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6369
|
-
desc = { enumerable: true, get: function() {
|
|
6370
|
-
return m[k];
|
|
6371
|
-
} };
|
|
6372
|
-
}
|
|
6373
|
-
Object.defineProperty(o, k2, desc);
|
|
6374
|
-
} : function(o, m, k, k2) {
|
|
6375
|
-
if (k2 === undefined)
|
|
6376
|
-
k2 = k;
|
|
6377
|
-
o[k2] = m[k];
|
|
6378
|
-
});
|
|
6379
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
6380
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6381
|
-
} : function(o, v) {
|
|
6382
|
-
o["default"] = v;
|
|
6383
|
-
});
|
|
6384
|
-
var __importStar = exports && exports.__importStar || function() {
|
|
6385
|
-
var ownKeys = function(o) {
|
|
6386
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
6387
|
-
var ar = [];
|
|
6388
|
-
for (var k in o)
|
|
6389
|
-
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
6390
|
-
ar[ar.length] = k;
|
|
6391
|
-
return ar;
|
|
6392
|
-
};
|
|
6393
|
-
return ownKeys(o);
|
|
6394
|
-
};
|
|
6395
|
-
return function(mod) {
|
|
6396
|
-
if (mod && mod.__esModule)
|
|
6397
|
-
return mod;
|
|
6398
|
-
var result = {};
|
|
6399
|
-
if (mod != null) {
|
|
6400
|
-
for (var k = ownKeys(mod), i = 0;i < k.length; i++)
|
|
6401
|
-
if (k[i] !== "default")
|
|
6402
|
-
__createBinding(result, mod, k[i]);
|
|
6403
|
-
}
|
|
6404
|
-
__setModuleDefault(result, mod);
|
|
6405
|
-
return result;
|
|
6406
|
-
};
|
|
6407
|
-
}();
|
|
6408
6547
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6409
6548
|
exports.CronFileParser = undefined;
|
|
6410
6549
|
var CronExpressionParser_1 = require_CronExpressionParser();
|
|
6411
6550
|
|
|
6412
6551
|
class CronFileParser {
|
|
6413
6552
|
static async parseFile(filePath) {
|
|
6414
|
-
const { readFile } =
|
|
6553
|
+
const { readFile } = __require("fs/promises");
|
|
6415
6554
|
const data = await readFile(filePath, "utf8");
|
|
6416
6555
|
return CronFileParser.#parseContent(data);
|
|
6417
6556
|
}
|
|
@@ -6433,26 +6572,37 @@ var require_CronFileParser = __commonJS(function(exports) {
|
|
|
6433
6572
|
if (entry.length === 0 || entry.startsWith("#")) {
|
|
6434
6573
|
continue;
|
|
6435
6574
|
}
|
|
6436
|
-
const variableMatch = entry.match(/^(
|
|
6575
|
+
const variableMatch = entry.match(/^([^\s=]+)\s*=\s*(.*)$/);
|
|
6437
6576
|
if (variableMatch) {
|
|
6438
6577
|
const [, key, value] = variableMatch;
|
|
6439
|
-
result.variables
|
|
6578
|
+
Object.defineProperty(result.variables, key, {
|
|
6579
|
+
value: value.replace(/^(["'])(.*)\1$/, "$2"),
|
|
6580
|
+
enumerable: true,
|
|
6581
|
+
writable: true,
|
|
6582
|
+
configurable: true
|
|
6583
|
+
});
|
|
6440
6584
|
continue;
|
|
6441
6585
|
}
|
|
6442
6586
|
try {
|
|
6443
6587
|
const parsedEntry = CronFileParser.#parseEntry(entry);
|
|
6444
6588
|
result.expressions.push(parsedEntry.interval);
|
|
6445
6589
|
} catch (err) {
|
|
6446
|
-
result.errors
|
|
6590
|
+
Object.defineProperty(result.errors, entry, {
|
|
6591
|
+
value: err,
|
|
6592
|
+
enumerable: true,
|
|
6593
|
+
writable: true,
|
|
6594
|
+
configurable: true
|
|
6595
|
+
});
|
|
6447
6596
|
}
|
|
6448
6597
|
}
|
|
6449
6598
|
return result;
|
|
6450
6599
|
}
|
|
6451
6600
|
static #parseEntry(entry) {
|
|
6452
|
-
const atoms = entry.split(
|
|
6601
|
+
const atoms = entry.split(/\s+/);
|
|
6602
|
+
const scheduleLength = atoms[0].startsWith("@") ? 1 : 5;
|
|
6453
6603
|
return {
|
|
6454
|
-
interval: CronExpressionParser_1.CronExpressionParser.parse(atoms.slice(0,
|
|
6455
|
-
command: atoms.slice(
|
|
6604
|
+
interval: CronExpressionParser_1.CronExpressionParser.parse(atoms.slice(0, scheduleLength).join(" ")),
|
|
6605
|
+
command: atoms.slice(scheduleLength, atoms.length)
|
|
6456
6606
|
};
|
|
6457
6607
|
}
|
|
6458
6608
|
}
|
|
@@ -6999,7 +7149,7 @@ function parseHeadersJson(value) {
|
|
|
6999
7149
|
return {};
|
|
7000
7150
|
}
|
|
7001
7151
|
}
|
|
7002
|
-
async function resolveHeaderConfigKeys(headerConfigKeys, context) {
|
|
7152
|
+
async function resolveHeaderConfigKeys(headerConfigKeys, context, secrets) {
|
|
7003
7153
|
if (!headerConfigKeys)
|
|
7004
7154
|
return {};
|
|
7005
7155
|
let parsed;
|
|
@@ -7010,6 +7160,7 @@ async function resolveHeaderConfigKeys(headerConfigKeys, context) {
|
|
|
7010
7160
|
}
|
|
7011
7161
|
const configs = await getResolvedConfig2(context.agentId, context.repoId);
|
|
7012
7162
|
const configMap = new Map(configs.map((config) => [config.key, config.value]));
|
|
7163
|
+
const secretKeys = new Set(configs.filter((config) => config.isSecret).map((c) => c.key));
|
|
7013
7164
|
const resolved = {};
|
|
7014
7165
|
if (Array.isArray(parsed)) {
|
|
7015
7166
|
for (const item of parsed) {
|
|
@@ -7019,6 +7170,8 @@ async function resolveHeaderConfigKeys(headerConfigKeys, context) {
|
|
|
7019
7170
|
if (value === undefined)
|
|
7020
7171
|
continue;
|
|
7021
7172
|
registerVolatileSecret(value, `mcp-header:${item}`);
|
|
7173
|
+
if (secretKeys.has(item))
|
|
7174
|
+
secrets.push({ value, name: `mcp-header:${item}` });
|
|
7022
7175
|
resolved[item] = value;
|
|
7023
7176
|
}
|
|
7024
7177
|
return resolved;
|
|
@@ -7032,14 +7185,16 @@ async function resolveHeaderConfigKeys(headerConfigKeys, context) {
|
|
|
7032
7185
|
if (value === undefined)
|
|
7033
7186
|
continue;
|
|
7034
7187
|
registerVolatileSecret(value, `mcp-header:${configKey}`);
|
|
7188
|
+
if (secretKeys.has(configKey))
|
|
7189
|
+
secrets.push({ value, name: `mcp-header:${configKey}` });
|
|
7035
7190
|
resolved[headerName] = value;
|
|
7036
7191
|
}
|
|
7037
7192
|
return resolved;
|
|
7038
7193
|
}
|
|
7039
|
-
async function resolveMcpHeaders(server2, context) {
|
|
7194
|
+
async function resolveMcpHeaders(server2, context, secrets) {
|
|
7040
7195
|
const headers = {
|
|
7041
7196
|
...parseHeadersJson(server2.headers),
|
|
7042
|
-
...await resolveHeaderConfigKeys(server2.headerConfigKeys, context)
|
|
7197
|
+
...await resolveHeaderConfigKeys(server2.headerConfigKeys, context, secrets)
|
|
7043
7198
|
};
|
|
7044
7199
|
if (server2.authMethod !== "oauth")
|
|
7045
7200
|
return headers;
|
|
@@ -7052,6 +7207,7 @@ async function resolveMcpHeaders(server2, context) {
|
|
|
7052
7207
|
throw new Error(token.lastErrorMessage ?? `OAuth status: ${token.status}`);
|
|
7053
7208
|
}
|
|
7054
7209
|
registerVolatileSecret(token.accessToken, `mcp-oauth:${server2.id}`);
|
|
7210
|
+
secrets.push({ value: token.accessToken, name: `mcp-oauth:${server2.id}` });
|
|
7055
7211
|
const rawType = token.tokenType || "Bearer";
|
|
7056
7212
|
const prefix = rawType.toLowerCase() === "bearer" ? "Bearer" : rawType;
|
|
7057
7213
|
headers.Authorization = `${prefix} ${token.accessToken}`;
|
|
@@ -7079,18 +7235,31 @@ async function createMcpServerClient(serverId, context = {}) {
|
|
|
7079
7235
|
fetch: createSsrfGuardedFetch(publicEndpointSsrfOptions())
|
|
7080
7236
|
});
|
|
7081
7237
|
client.useRawUrl = true;
|
|
7082
|
-
|
|
7083
|
-
|
|
7238
|
+
const secrets = [];
|
|
7239
|
+
client.customHeaders = await resolveMcpHeaders(server2, context, secrets);
|
|
7240
|
+
return { client, scrubber: createValueScrubber(secrets) };
|
|
7241
|
+
}
|
|
7242
|
+
async function withScrubbedResponse(scrubber, run) {
|
|
7243
|
+
try {
|
|
7244
|
+
return scrubber.object(await run());
|
|
7245
|
+
} catch (err) {
|
|
7246
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
7247
|
+
throw new Error(scrubSecrets(scrubber.text(message)));
|
|
7248
|
+
}
|
|
7084
7249
|
}
|
|
7085
7250
|
async function listMcpServerTools(serverId, context = {}) {
|
|
7086
|
-
const client = await createMcpServerClient(serverId, context);
|
|
7087
|
-
|
|
7088
|
-
|
|
7251
|
+
const { client, scrubber } = await createMcpServerClient(serverId, context);
|
|
7252
|
+
return withScrubbedResponse(scrubber, async () => {
|
|
7253
|
+
await client.initialize();
|
|
7254
|
+
return client.listTools();
|
|
7255
|
+
});
|
|
7089
7256
|
}
|
|
7090
7257
|
async function callMcpServerTool(serverId, tool, args, context = {}) {
|
|
7091
|
-
const client = await createMcpServerClient(serverId, context);
|
|
7092
|
-
|
|
7093
|
-
|
|
7258
|
+
const { client, scrubber } = await createMcpServerClient(serverId, context);
|
|
7259
|
+
return withScrubbedResponse(scrubber, async () => {
|
|
7260
|
+
await client.initialize();
|
|
7261
|
+
return client.callToolRaw(tool, args);
|
|
7262
|
+
});
|
|
7094
7263
|
}
|
|
7095
7264
|
var MCP_PROXY_TIMEOUT_MS = 30000;
|
|
7096
7265
|
var init_mcp_proxy = __esm(() => {
|
|
@@ -8022,7 +8191,7 @@ async function fetchOpenapiSpec(url, opts = {}) {
|
|
|
8022
8191
|
});
|
|
8023
8192
|
if (opts.etag)
|
|
8024
8193
|
headers.set("If-None-Match", opts.etag);
|
|
8025
|
-
const fetchImpl = openapiSpecFetchForTesting ?? Bun.fetch;
|
|
8194
|
+
const fetchImpl = openapiSpecFetchForTesting ?? createSsrfGuardedFetch(openapiSpecUrlOptions(), Bun.fetch);
|
|
8026
8195
|
let response = null;
|
|
8027
8196
|
for (let hop = 0;hop <= 5; hop += 1) {
|
|
8028
8197
|
response = await fetchImpl(parsed, {
|
|
@@ -8549,6 +8718,7 @@ var init_script_connections = __esm(() => {
|
|
|
8549
8718
|
init_oauth();
|
|
8550
8719
|
init_mcp_wrapper();
|
|
8551
8720
|
init_credential_broker();
|
|
8721
|
+
init_egress_guard();
|
|
8552
8722
|
init_secret_scrubber();
|
|
8553
8723
|
init_mcp_proxy();
|
|
8554
8724
|
init_sql_connections();
|
|
@@ -8665,6 +8835,16 @@ var init_oauth_credential_bindings = __esm(() => {
|
|
|
8665
8835
|
});
|
|
8666
8836
|
|
|
8667
8837
|
// src/be/script-credential-broker.ts
|
|
8838
|
+
function resolveBindingConfigValue(configMap, configKey) {
|
|
8839
|
+
if (isReservedConfigKey(configKey) || isApiOnlyConfigKey(configKey) || isInternalConfigKey(configKey)) {
|
|
8840
|
+
return;
|
|
8841
|
+
}
|
|
8842
|
+
const value = configMap.get(configKey);
|
|
8843
|
+
if (value !== undefined)
|
|
8844
|
+
return value;
|
|
8845
|
+
return ENV_FALLBACK_CONFIG_KEYS.has(configKey) ? process.env[configKey] : undefined;
|
|
8846
|
+
}
|
|
8847
|
+
|
|
8668
8848
|
class RelationalCredentialBindingStore {
|
|
8669
8849
|
listActiveBindings(context) {
|
|
8670
8850
|
return listRelationalCredentialBindings(context);
|
|
@@ -8704,7 +8884,7 @@ async function buildScriptCredentialBindingsWithFailures(input) {
|
|
|
8704
8884
|
const resolvedConfigs = await getResolvedConfig2(input.agentId, input.repoId);
|
|
8705
8885
|
const userConfig = toScriptUserConfig(resolvedConfigs);
|
|
8706
8886
|
const configMap = new Map(resolvedConfigs.map((config) => [config.key, config.value]));
|
|
8707
|
-
const broker = new CredentialBroker(new RelationalCredentialBindingStore, (configKey) => configMap
|
|
8887
|
+
const broker = new CredentialBroker(new RelationalCredentialBindingStore, (configKey) => resolveBindingConfigValue(configMap, configKey), defaultCredentialBindings(), (oauthAuthorizationId) => resolveOAuthBindingToken(oauthAuthorizationId));
|
|
8708
8888
|
const { resolved, failed } = await broker.resolveBindingsWithFailures({
|
|
8709
8889
|
agentId: input.agentId,
|
|
8710
8890
|
repoId: input.repoId
|
|
@@ -8722,6 +8902,7 @@ async function buildScriptCredentialBindingsWithFailures(input) {
|
|
|
8722
8902
|
...agentFs ? { agentFs: agentFs.descriptor } : {}
|
|
8723
8903
|
};
|
|
8724
8904
|
}
|
|
8905
|
+
var ENV_FALLBACK_CONFIG_KEYS;
|
|
8725
8906
|
var init_script_credential_broker = __esm(() => {
|
|
8726
8907
|
init_credential_broker();
|
|
8727
8908
|
init_script_fs();
|
|
@@ -8731,6 +8912,7 @@ var init_script_credential_broker = __esm(() => {
|
|
|
8731
8912
|
init_oauth_credential_bindings();
|
|
8732
8913
|
init_script_connections();
|
|
8733
8914
|
init_swarm_config_guard();
|
|
8915
|
+
ENV_FALLBACK_CONFIG_KEYS = new Set(["GITHUB_TOKEN"]);
|
|
8734
8916
|
});
|
|
8735
8917
|
|
|
8736
8918
|
// src/scripts-runtime/egress-secrets.ts
|
|
@@ -9223,11 +9405,18 @@ class NativeScriptExecutor {
|
|
|
9223
9405
|
...runAs ? { ownerUid: runAs.uid } : {}
|
|
9224
9406
|
};
|
|
9225
9407
|
const result = exitCode === 0 ? await readResultFile(resultFile, runDirCheck) : undefined;
|
|
9408
|
+
const envelope = result;
|
|
9409
|
+
const durable = input.configPayload.durable && envelope?.__swarmDurable === 1 ? {
|
|
9410
|
+
state: envelope.state,
|
|
9411
|
+
destroyed: envelope.destroyed,
|
|
9412
|
+
idleTtlSec: envelope.idleTtlSec
|
|
9413
|
+
} : undefined;
|
|
9226
9414
|
const runtimeError = exitCode === 0 ? undefined : await readRuntimeError(errorFile, runDirCheck);
|
|
9227
9415
|
const userCodeStarted = await runDirEntryExists(startedFile);
|
|
9228
9416
|
const error = classifyExit(exitCode, timedOut, killed, userCodeStarted);
|
|
9229
9417
|
return {
|
|
9230
|
-
result,
|
|
9418
|
+
result: durable ? envelope.result : result,
|
|
9419
|
+
...durable ? { durable } : {},
|
|
9231
9420
|
stdout: stdout.text,
|
|
9232
9421
|
stderr: stderr.text,
|
|
9233
9422
|
truncated: { stdout: stdout.truncated, stderr: stderr.truncated },
|
|
@@ -178322,14 +178511,14 @@ async function buildConfigPayload(input) {
|
|
|
178322
178511
|
system: {
|
|
178323
178512
|
apiKey: { value: apiKey, isSecret: true },
|
|
178324
178513
|
agentId: { value: input.agentId, isSecret: false },
|
|
178325
|
-
mcpBaseUrl: {
|
|
178326
|
-
|
|
178327
|
-
isSecret: false
|
|
178328
|
-
},
|
|
178514
|
+
mcpBaseUrl: { value: input.mcpBaseUrl ?? getMcpBaseUrl(), isSecret: false },
|
|
178515
|
+
sdkBaseUrl: { value: input.mcpBaseUrl ?? getScriptApiBaseUrl(), isSecret: false },
|
|
178329
178516
|
...input.runtimeInstanceId ? { runtimeInstanceId: { value: input.runtimeInstanceId, isSecret: false } } : {},
|
|
178330
178517
|
...input.sourceTaskId ? { auditSourceTaskId: { value: input.sourceTaskId, isSecret: false } } : {}
|
|
178331
178518
|
},
|
|
178332
178519
|
user: input.userConfig ?? {},
|
|
178520
|
+
durable: input.durable,
|
|
178521
|
+
caller: input.caller,
|
|
178333
178522
|
egressSecrets: input.egressSecrets ?? await buildEgressSecrets(),
|
|
178334
178523
|
failedBindings: input.failedBindings ?? [],
|
|
178335
178524
|
apiConnections: input.apiConnections ?? [],
|
|
@@ -179201,6 +179390,26 @@ var init_workflows_seeder = __esm(() => {
|
|
|
179201
179390
|
workflowsSeeder = createWorkflowsSeeder();
|
|
179202
179391
|
});
|
|
179203
179392
|
|
|
179393
|
+
// src/scripts-runtime/durable-object-base.ts
|
|
179394
|
+
var DURABLE_OBJECT_BASE_JS = `class DurableObject {
|
|
179395
|
+
static __swarmDurable = true;
|
|
179396
|
+
state;
|
|
179397
|
+
constructor(id) {
|
|
179398
|
+
this._id = id;
|
|
179399
|
+
this._destroyed = false;
|
|
179400
|
+
}
|
|
179401
|
+
get id() { return this._id; }
|
|
179402
|
+
destroy() { this._destroyed = true; }
|
|
179403
|
+
}`, DURABLE_OBJECT_RESERVED_METHODS;
|
|
179404
|
+
var init_durable_object_base = __esm(() => {
|
|
179405
|
+
DURABLE_OBJECT_RESERVED_METHODS = new Set([
|
|
179406
|
+
"constructor",
|
|
179407
|
+
"initialState",
|
|
179408
|
+
"migrate",
|
|
179409
|
+
"destroy"
|
|
179410
|
+
]);
|
|
179411
|
+
});
|
|
179412
|
+
|
|
179204
179413
|
// src/scripts-runtime/extract-signature.ts
|
|
179205
179414
|
function getJsDocDescription(node, sourceFile) {
|
|
179206
179415
|
const comments = import_typescript2.default.getJSDocCommentsAndTags(node);
|
|
@@ -179235,7 +179444,67 @@ function extractScriptSignature(source) {
|
|
|
179235
179444
|
const parseDiagnostics = sourceFile.parseDiagnostics;
|
|
179236
179445
|
if (parseDiagnostics && parseDiagnostics.length > 0)
|
|
179237
179446
|
return FALLBACK_SIGNATURE;
|
|
179447
|
+
const durableNames = new Set;
|
|
179448
|
+
const durableNamespaces = new Set;
|
|
179449
|
+
const classes = new Map;
|
|
179450
|
+
for (const statement of sourceFile.statements) {
|
|
179451
|
+
if (import_typescript2.default.isClassDeclaration(statement) && statement.name) {
|
|
179452
|
+
classes.set(statement.name.text, statement);
|
|
179453
|
+
}
|
|
179454
|
+
if (import_typescript2.default.isImportDeclaration(statement) && import_typescript2.default.isStringLiteral(statement.moduleSpecifier) && statement.moduleSpecifier.text === "swarm-sdk") {
|
|
179455
|
+
const bindings = statement.importClause?.namedBindings;
|
|
179456
|
+
if (bindings && import_typescript2.default.isNamespaceImport(bindings)) {
|
|
179457
|
+
durableNamespaces.add(bindings.name.text);
|
|
179458
|
+
}
|
|
179459
|
+
if (bindings && import_typescript2.default.isNamedImports(bindings)) {
|
|
179460
|
+
for (const binding of bindings.elements) {
|
|
179461
|
+
if ((binding.propertyName ?? binding.name).text === "DurableObject") {
|
|
179462
|
+
durableNames.add(binding.name.text);
|
|
179463
|
+
}
|
|
179464
|
+
}
|
|
179465
|
+
}
|
|
179466
|
+
}
|
|
179467
|
+
}
|
|
179238
179468
|
for (const statement of sourceFile.statements) {
|
|
179469
|
+
const exportedClass = import_typescript2.default.isClassDeclaration(statement) && isExportDefault(statement) ? statement : import_typescript2.default.isExportAssignment(statement) && import_typescript2.default.isIdentifier(statement.expression) ? classes.get(statement.expression.text) : undefined;
|
|
179470
|
+
const lineage = [];
|
|
179471
|
+
let current = exportedClass;
|
|
179472
|
+
let durable = false;
|
|
179473
|
+
while (current && !lineage.includes(current)) {
|
|
179474
|
+
lineage.push(current);
|
|
179475
|
+
const base = current.heritageClauses?.find((clause) => clause.token === import_typescript2.default.SyntaxKind.ExtendsKeyword)?.types[0]?.expression;
|
|
179476
|
+
if (base && (import_typescript2.default.isIdentifier(base) && durableNames.has(base.text) || import_typescript2.default.isPropertyAccessExpression(base) && import_typescript2.default.isIdentifier(base.expression) && durableNamespaces.has(base.expression.text) && base.name.text === "DurableObject")) {
|
|
179477
|
+
durable = true;
|
|
179478
|
+
break;
|
|
179479
|
+
}
|
|
179480
|
+
current = base && import_typescript2.default.isIdentifier(base) ? classes.get(base.text) : undefined;
|
|
179481
|
+
}
|
|
179482
|
+
if (durable && exportedClass) {
|
|
179483
|
+
const methods = Object.create(null);
|
|
179484
|
+
const seen = new Set;
|
|
179485
|
+
for (const declaration of lineage) {
|
|
179486
|
+
for (const member of declaration.members) {
|
|
179487
|
+
if (import_typescript2.default.canHaveModifiers(member) && import_typescript2.default.getModifiers(member)?.some((modifier) => modifier.kind === import_typescript2.default.SyntaxKind.StaticKeyword) || !member.name || !(import_typescript2.default.isIdentifier(member.name) || import_typescript2.default.isStringLiteral(member.name))) {
|
|
179488
|
+
continue;
|
|
179489
|
+
}
|
|
179490
|
+
const name = member.name.text;
|
|
179491
|
+
if (seen.has(name))
|
|
179492
|
+
continue;
|
|
179493
|
+
seen.add(name);
|
|
179494
|
+
if (!import_typescript2.default.isMethodDeclaration(member) || name.startsWith("_") || DURABLE_OBJECT_RESERVED_METHODS.has(name)) {
|
|
179495
|
+
continue;
|
|
179496
|
+
}
|
|
179497
|
+
methods[name] = fromFunctionLike(member, sourceFile);
|
|
179498
|
+
}
|
|
179499
|
+
}
|
|
179500
|
+
return {
|
|
179501
|
+
kind: "durable",
|
|
179502
|
+
methods,
|
|
179503
|
+
argsType: "unknown",
|
|
179504
|
+
resultType: "unknown",
|
|
179505
|
+
description: getJsDocDescription(exportedClass, sourceFile)
|
|
179506
|
+
};
|
|
179507
|
+
}
|
|
179239
179508
|
if (import_typescript2.default.isFunctionDeclaration(statement) && isExportDefault(statement)) {
|
|
179240
179509
|
return fromFunctionLike(statement, sourceFile);
|
|
179241
179510
|
}
|
|
@@ -179253,6 +179522,7 @@ function extractScriptSignature(source) {
|
|
|
179253
179522
|
}
|
|
179254
179523
|
var import_typescript2, FALLBACK_SIGNATURE;
|
|
179255
179524
|
var init_extract_signature = __esm(() => {
|
|
179525
|
+
init_durable_object_base();
|
|
179256
179526
|
import_typescript2 = __toESM(require_typescript2(), 1);
|
|
179257
179527
|
FALLBACK_SIGNATURE = {
|
|
179258
179528
|
argsType: "unknown",
|
|
@@ -179262,6 +179532,7 @@ var init_extract_signature = __esm(() => {
|
|
|
179262
179532
|
});
|
|
179263
179533
|
|
|
179264
179534
|
// src/be/scripts/extract-schema.ts
|
|
179535
|
+
import { chown as chown2 } from "node:fs/promises";
|
|
179265
179536
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
179266
179537
|
function extractorPath() {
|
|
179267
179538
|
if (process.env.SCRIPT_RUNTIME_DIR) {
|
|
@@ -179270,15 +179541,21 @@ function extractorPath() {
|
|
|
179270
179541
|
return fileURLToPath2(new URL("../../scripts-runtime/extract-args-schema.ts", import.meta.url));
|
|
179271
179542
|
}
|
|
179272
179543
|
async function extractArgsJsonSchema(source) {
|
|
179544
|
+
if (getDeploymentScriptExecutorName() === "quickjs")
|
|
179545
|
+
return null;
|
|
179273
179546
|
const tmpdir = `${process.env.TMPDIR ?? "/tmp"}/schema-extract-${crypto.randomUUID()}`;
|
|
179274
179547
|
try {
|
|
179275
179548
|
await Bun.$`mkdir -p ${tmpdir}`.quiet();
|
|
179276
179549
|
const sourceFile = `${tmpdir}/source.ts`;
|
|
179277
179550
|
const resultFile = `${tmpdir}/result.json`;
|
|
179278
179551
|
await Bun.write(sourceFile, source);
|
|
179552
|
+
const runAs = resolveSandboxIdentity();
|
|
179553
|
+
if (runAs) {
|
|
179554
|
+
await Promise.all([tmpdir, sourceFile].map((path) => chown2(path, runAs.uid, runAs.gid)));
|
|
179555
|
+
}
|
|
179279
179556
|
const env = {
|
|
179280
179557
|
PATH: process.env.PATH ?? "/usr/bin:/bin",
|
|
179281
|
-
HOME: process.env.HOME ?? "/tmp",
|
|
179558
|
+
HOME: runAs ? tmpdir : process.env.HOME ?? "/tmp",
|
|
179282
179559
|
TMPDIR: tmpdir,
|
|
179283
179560
|
SWARM_SCHEMA_SOURCE_FILE: sourceFile,
|
|
179284
179561
|
SWARM_SCHEMA_RESULT_FILE: resultFile,
|
|
@@ -179286,7 +179563,8 @@ async function extractArgsJsonSchema(source) {
|
|
|
179286
179563
|
};
|
|
179287
179564
|
if (process.env.SCRIPT_RUNTIME_DIR)
|
|
179288
179565
|
env.SCRIPT_RUNTIME_DIR = process.env.SCRIPT_RUNTIME_DIR;
|
|
179289
|
-
const
|
|
179566
|
+
const command = buildSandboxedCommand(["bun", "run", extractorPath()], env, DEFAULT_SANDBOX_LIMITS, "inline", runAs);
|
|
179567
|
+
const proc = Bun.spawn(command, {
|
|
179290
179568
|
env,
|
|
179291
179569
|
cwd: tmpdir,
|
|
179292
179570
|
stdout: "ignore",
|
|
@@ -179297,7 +179575,12 @@ async function extractArgsJsonSchema(source) {
|
|
|
179297
179575
|
clearTimeout(timeout);
|
|
179298
179576
|
if (exitCode !== 0)
|
|
179299
179577
|
return null;
|
|
179300
|
-
const result = await
|
|
179578
|
+
const result = await readRunDirFile(resultFile, {
|
|
179579
|
+
maxBytes: DEFAULT_SANDBOX_LIMITS.maxFileKb * 1024,
|
|
179580
|
+
...runAs ? { ownerUid: runAs.uid } : {}
|
|
179581
|
+
});
|
|
179582
|
+
if (result === undefined)
|
|
179583
|
+
return null;
|
|
179301
179584
|
const parsed = JSON.parse(result);
|
|
179302
179585
|
if (parsed === null)
|
|
179303
179586
|
return null;
|
|
@@ -179310,6 +179593,8 @@ async function extractArgsJsonSchema(source) {
|
|
|
179310
179593
|
}
|
|
179311
179594
|
var TIMEOUT_MS = 5000;
|
|
179312
179595
|
var init_extract_schema = __esm(() => {
|
|
179596
|
+
init_native();
|
|
179597
|
+
init_registry();
|
|
179313
179598
|
init_sandboxed_process();
|
|
179314
179599
|
});
|
|
179315
179600
|
|
|
@@ -185858,12 +186143,22 @@ function isIso8601Date(value) {
|
|
|
185858
186143
|
return ISO_8601_PREFIX.test(value) && !Number.isNaN(Date.parse(value));
|
|
185859
186144
|
}
|
|
185860
186145
|
function jsonColumnMaxBytes(env = process.env) {
|
|
185861
|
-
|
|
186146
|
+
return boundedIntegerKnob(env.APPS_JSON_COLUMN_MAX_BYTES, DEFAULT_JSON_COLUMN_MAX_BYTES, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS);
|
|
186147
|
+
}
|
|
186148
|
+
function boundedIntegerKnob(rawValue, fallback, { min, max }) {
|
|
186149
|
+
const raw = rawValue?.trim();
|
|
185862
186150
|
if (!raw || !/^\d+$/.test(raw))
|
|
185863
|
-
return
|
|
186151
|
+
return fallback;
|
|
185864
186152
|
const value = Number(raw);
|
|
185865
|
-
|
|
185866
|
-
|
|
186153
|
+
return Number.isSafeInteger(value) && value >= min && value <= max ? value : fallback;
|
|
186154
|
+
}
|
|
186155
|
+
function appDefinitionLimits(env = process.env) {
|
|
186156
|
+
const knob = (raw, fallback) => boundedIntegerKnob(raw, fallback, APPS_DEFINITION_LIMIT_BOUNDS);
|
|
186157
|
+
return {
|
|
186158
|
+
maxModels: knob(env.APPS_MAX_MODELS, DEFAULT_APP_DEFINITION_LIMITS.maxModels),
|
|
186159
|
+
maxColumnsPerModel: knob(env.APPS_MAX_COLUMNS_PER_MODEL, DEFAULT_APP_DEFINITION_LIMITS.maxColumnsPerModel),
|
|
186160
|
+
maxActions: knob(env.APPS_MAX_ACTIONS, DEFAULT_APP_DEFINITION_LIMITS.maxActions)
|
|
186161
|
+
};
|
|
185867
186162
|
}
|
|
185868
186163
|
function jsonColumnSizeLabel(bytes = jsonColumnMaxBytes()) {
|
|
185869
186164
|
return bytes % 1024 === 0 ? `${bytes / 1024}KB` : `${bytes} bytes`;
|
|
@@ -186140,6 +186435,25 @@ function jsonColumnDefaultSizeIssues(definition) {
|
|
|
186140
186435
|
}
|
|
186141
186436
|
return issues;
|
|
186142
186437
|
}
|
|
186438
|
+
function definitionLimitIssues(definition) {
|
|
186439
|
+
const limits = appDefinitionLimits();
|
|
186440
|
+
const issues = [];
|
|
186441
|
+
if (Object.keys(definition.models).length > limits.maxModels) {
|
|
186442
|
+
issues.push({ path: "models", message: `must define at most ${limits.maxModels} models` });
|
|
186443
|
+
}
|
|
186444
|
+
for (const [modelName, model] of Object.entries(definition.models)) {
|
|
186445
|
+
if (Object.keys(model.columns).length > limits.maxColumnsPerModel) {
|
|
186446
|
+
issues.push({
|
|
186447
|
+
path: `models.${modelName}.columns`,
|
|
186448
|
+
message: `must define at most ${limits.maxColumnsPerModel} columns`
|
|
186449
|
+
});
|
|
186450
|
+
}
|
|
186451
|
+
}
|
|
186452
|
+
if (Object.keys(definition.actions ?? {}).length > limits.maxActions) {
|
|
186453
|
+
issues.push({ path: "actions", message: `must define at most ${limits.maxActions} actions` });
|
|
186454
|
+
}
|
|
186455
|
+
return issues;
|
|
186456
|
+
}
|
|
186143
186457
|
async function parseAppDefinition(input, elementContext = {}) {
|
|
186144
186458
|
if (isMergePatchObject(input) && Object.hasOwn(input, "page")) {
|
|
186145
186459
|
return {
|
|
@@ -186171,6 +186485,7 @@ async function parseAppDefinition(input, elementContext = {}) {
|
|
|
186171
186485
|
if (!parsed.success)
|
|
186172
186486
|
return { success: false, issues: appDefinitionIssues(parsed.error) };
|
|
186173
186487
|
const issues = [
|
|
186488
|
+
...definitionLimitIssues(parsed.data),
|
|
186174
186489
|
...jsonColumnDefaultSizeIssues(parsed.data),
|
|
186175
186490
|
...Object.keys(parsed.data.pages).flatMap((pageName) => validatePage(parsed.data, catalog_generated_default, pageName)),
|
|
186176
186491
|
...crossPageDefinitionIssues(parsed.data, catalog_generated_default),
|
|
@@ -186310,7 +186625,7 @@ function applyAppDefinitionPatch(stored, patch) {
|
|
|
186310
186625
|
const merged = applyMergePatch(structuredClone(stored), normalizedPatch, []);
|
|
186311
186626
|
return { success: true, definition: structuredClone(merged) };
|
|
186312
186627
|
}
|
|
186313
|
-
var AppNameSchema, ColumnKindSchema, ScalarColumnKindSchema, ISO_8601_PREFIX, DEFAULT_JSON_COLUMN_MAX_BYTES, SourceTransformSchema, TRANSFORM_COLUMN_KIND, ColumnSourceBindingSchema, ColumnDefSchema, UserConfigFieldSchema, UserConfigSchema, SourceDefSchema, ModelDefSchema, AppQueryParamRefSchema, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppQueryDefSchema, AppActionDefSchema, AppPageParamSchema, RESERVED_PAGE_PARAM_NAMES, AppPageSchema, ElementPropDefSchema, AppElementSchema, AppElementsSchema, AppThemeIdSchema, AppDefinitionSchema, APP_DEFINITION_TOP_LEVEL_KEYS, TOP_LEVEL_KEY_SUGGESTIONS, DANGEROUS_PATCH_KEYS;
|
|
186628
|
+
var AppNameSchema, ColumnKindSchema, ScalarColumnKindSchema, ISO_8601_PREFIX, DEFAULT_JSON_COLUMN_MAX_BYTES, DEFAULT_APP_DEFINITION_LIMITS, SourceTransformSchema, TRANSFORM_COLUMN_KIND, ColumnSourceBindingSchema, ColumnDefSchema, UserConfigFieldSchema, UserConfigSchema, SourceDefSchema, ModelDefSchema, AppQueryParamRefSchema, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppQueryDefSchema, AppActionDefSchema, AppPageParamSchema, RESERVED_PAGE_PARAM_NAMES, AppPageSchema, ElementPropDefSchema, AppElementSchema, AppElementsSchema, AppThemeIdSchema, AppDefinitionSchema, APP_DEFINITION_TOP_LEVEL_KEYS, TOP_LEVEL_KEY_SUGGESTIONS, DANGEROUS_PATCH_KEYS;
|
|
186314
186629
|
var init_definition = __esm(() => {
|
|
186315
186630
|
init_zod();
|
|
186316
186631
|
init_script_connections();
|
|
@@ -186329,6 +186644,11 @@ var init_definition = __esm(() => {
|
|
|
186329
186644
|
ScalarColumnKindSchema = ColumnKindSchema.exclude(["json"]);
|
|
186330
186645
|
ISO_8601_PREFIX = /^\d{4}-\d{2}-\d{2}(?:T.*)?$/;
|
|
186331
186646
|
DEFAULT_JSON_COLUMN_MAX_BYTES = 256 * 1024;
|
|
186647
|
+
DEFAULT_APP_DEFINITION_LIMITS = {
|
|
186648
|
+
maxModels: 50,
|
|
186649
|
+
maxColumnsPerModel: 200,
|
|
186650
|
+
maxActions: 100
|
|
186651
|
+
};
|
|
186332
186652
|
SourceTransformSchema = _enum2(["slug", "lower", "upper", "cents", "date-parse"]);
|
|
186333
186653
|
TRANSFORM_COLUMN_KIND = {
|
|
186334
186654
|
slug: "string",
|
|
@@ -186455,9 +186775,8 @@ var init_definition = __esm(() => {
|
|
|
186455
186775
|
columns: record2(AppNameSchema, ColumnDefSchema),
|
|
186456
186776
|
sources: record2(AppNameSchema, SourceDefSchema).optional()
|
|
186457
186777
|
}).superRefine((model, ctx) => {
|
|
186458
|
-
|
|
186459
|
-
|
|
186460
|
-
ctx.addIssue({ code: "custom", path: ["columns"], message: "must define 1 to 40 columns" });
|
|
186778
|
+
if (Object.keys(model.columns).length < 1) {
|
|
186779
|
+
ctx.addIssue({ code: "custom", path: ["columns"], message: "must define at least 1 column" });
|
|
186461
186780
|
}
|
|
186462
186781
|
for (const name of Object.keys(model.columns)) {
|
|
186463
186782
|
if (Object.hasOwn(SYSTEM_COLUMN_KINDS, name)) {
|
|
@@ -186605,18 +186924,6 @@ var init_definition = __esm(() => {
|
|
|
186605
186924
|
}
|
|
186606
186925
|
}
|
|
186607
186926
|
}
|
|
186608
|
-
const modelCount = Object.keys(definition.models).length;
|
|
186609
|
-
if (modelCount > 10) {
|
|
186610
|
-
ctx.addIssue({ code: "custom", path: ["models"], message: "must define at most 10 models" });
|
|
186611
|
-
}
|
|
186612
|
-
const actionCount = Object.keys(definition.actions ?? {}).length;
|
|
186613
|
-
if (actionCount > 20) {
|
|
186614
|
-
ctx.addIssue({
|
|
186615
|
-
code: "custom",
|
|
186616
|
-
path: ["actions"],
|
|
186617
|
-
message: "must define at most 20 actions"
|
|
186618
|
-
});
|
|
186619
|
-
}
|
|
186620
186927
|
const userConfigCount = Object.keys(definition.userConfig ?? {}).length;
|
|
186621
186928
|
if (userConfigCount > 20) {
|
|
186622
186929
|
ctx.addIssue({
|
|
@@ -186914,7 +187221,10 @@ async function updateApp(id, patch) {
|
|
|
186914
187221
|
return row ? decodeApp(row) : null;
|
|
186915
187222
|
}
|
|
186916
187223
|
async function deleteApp(id) {
|
|
186917
|
-
return
|
|
187224
|
+
return getDbClient2().transaction(async (tx) => {
|
|
187225
|
+
await tx.run("DELETE FROM user_favorites WHERE itemType = 'app' AND itemId = ?", [id]);
|
|
187226
|
+
return (await tx.run("DELETE FROM apps WHERE id = ?", [id])).changes > 0;
|
|
187227
|
+
});
|
|
186918
187228
|
}
|
|
186919
187229
|
var init_store2 = __esm(() => {
|
|
186920
187230
|
init_key();
|
|
@@ -187084,50 +187394,88 @@ function omittedAppsComment(apps) {
|
|
|
187084
187394
|
return `// ${apps.length} more app(s) omitted (type budget): ${listed}${rest > 0 ? `, +${rest} more` : ""} — call app-get for their shape.
|
|
187085
187395
|
`;
|
|
187086
187396
|
}
|
|
187087
|
-
function
|
|
187397
|
+
function mib(bytes) {
|
|
187398
|
+
return `${Math.round(bytes / (1024 * 1024) * 10) / 10} MiB`;
|
|
187399
|
+
}
|
|
187400
|
+
function omittedAppTypesWarning(omitted) {
|
|
187401
|
+
const reason = omitted.budget === "per-app" ? `its types (${mib(omitted.bytes)}) exceed the ${mib(MAX_APP_TYPES_BYTES_PER_APP)} per-app budget` : `all apps' types together exceed the ${mib(MAX_APP_TYPES_BYTES)} swarm-wide budget`;
|
|
187402
|
+
return `App "${omitted.name}" (${omitted.id}) has no generated script types: ${reason}. Scripts can still call ctx.swarm.app_query on it, untyped; call app-get for its shape.`;
|
|
187403
|
+
}
|
|
187404
|
+
function renderAppTypesReport(apps, select) {
|
|
187088
187405
|
const renderableApps = apps.filter((app) => !app.definitionError);
|
|
187089
187406
|
if (renderableApps.length === 0)
|
|
187090
|
-
return "";
|
|
187407
|
+
return { source: "", omitted: [] };
|
|
187091
187408
|
const namespaces = new Set;
|
|
187092
|
-
const renderedApps = renderableApps.map((app) => ({
|
|
187093
|
-
app,
|
|
187094
|
-
|
|
187095
|
-
})
|
|
187409
|
+
const renderedApps = renderableApps.map((app) => ({ app, namespace: `App_${dedupe(pascalIdentifier(app.name), namespaces)}` })).filter(({ app, namespace }) => select?.(app, namespace) ?? true).map(({ app, namespace }) => {
|
|
187410
|
+
const source = renderApp(app, namespace);
|
|
187411
|
+
return { app, namespace, source, bytes: byteLength(source) };
|
|
187412
|
+
});
|
|
187096
187413
|
const skipped = skippedAppsComment(apps.filter((app) => app.definitionError));
|
|
187097
187414
|
const kept = [];
|
|
187098
187415
|
const omitted = [];
|
|
187099
187416
|
let result = `${APP_TYPES_PREAMBLE}
|
|
187100
187417
|
${skipped}`;
|
|
187101
187418
|
for (const [index, rendered] of renderedApps.entries()) {
|
|
187102
|
-
if (
|
|
187419
|
+
if (rendered.bytes > MAX_APP_TYPES_BYTES_PER_APP) {
|
|
187420
|
+
omitted.push({ ...rendered, budget: "per-app" });
|
|
187421
|
+
} else if (byteLength(`${result}${rendered.source}
|
|
187103
187422
|
`) <= MAX_APP_TYPES_BYTES) {
|
|
187104
187423
|
kept.push(rendered);
|
|
187105
187424
|
result += `${rendered.source}
|
|
187106
187425
|
`;
|
|
187107
187426
|
} else {
|
|
187108
|
-
omitted.push(...renderedApps.slice(index).map((item) => item
|
|
187427
|
+
omitted.push(...renderedApps.slice(index).map((item) => ({ ...item, budget: "total" })));
|
|
187109
187428
|
break;
|
|
187110
187429
|
}
|
|
187111
187430
|
}
|
|
187112
|
-
|
|
187431
|
+
const omittedComment = () => omittedAppsComment(omitted.map((item) => item.app));
|
|
187432
|
+
while (omitted.length > 0 && byteLength(`${result}${omittedComment()}`) > MAX_APP_TYPES_BYTES) {
|
|
187113
187433
|
const removed = kept.pop();
|
|
187114
187434
|
if (!removed)
|
|
187115
187435
|
break;
|
|
187116
187436
|
result = `${APP_TYPES_PREAMBLE}
|
|
187117
187437
|
${skipped}${kept.map((item) => `${item.source}
|
|
187118
187438
|
`).join("")}`;
|
|
187119
|
-
omitted.unshift(removed
|
|
187439
|
+
omitted.unshift({ ...removed, budget: "total" });
|
|
187120
187440
|
}
|
|
187121
|
-
return
|
|
187441
|
+
return {
|
|
187442
|
+
source: omitted.length > 0 ? `${result}${omittedComment()}` : result,
|
|
187443
|
+
omitted: omitted.map(({ app, namespace, bytes, budget }) => ({
|
|
187444
|
+
id: app.id,
|
|
187445
|
+
name: app.name,
|
|
187446
|
+
namespace,
|
|
187447
|
+
bytes,
|
|
187448
|
+
budget
|
|
187449
|
+
}))
|
|
187450
|
+
};
|
|
187451
|
+
}
|
|
187452
|
+
async function getScriptAppTypes(context = {}) {
|
|
187453
|
+
return (await getScriptAppTypesReport(context)).source;
|
|
187122
187454
|
}
|
|
187123
|
-
async function
|
|
187455
|
+
async function getScriptAppTypesReport(_context = {}, scriptSource) {
|
|
187124
187456
|
try {
|
|
187125
|
-
|
|
187457
|
+
const select = scriptSource === undefined ? undefined : (app, namespace) => namesApp(scriptSource, app.id, namespace);
|
|
187458
|
+
return renderAppTypesReport(await listAppRecords(), select);
|
|
187126
187459
|
} catch {
|
|
187127
|
-
return "";
|
|
187460
|
+
return { source: "", omitted: [] };
|
|
187128
187461
|
}
|
|
187129
187462
|
}
|
|
187130
|
-
|
|
187463
|
+
function namesApp(source, appId, namespace) {
|
|
187464
|
+
return source.includes(appId) || new RegExp(`\\b${namespace}\\b`).test(source);
|
|
187465
|
+
}
|
|
187466
|
+
function scriptAppTypesWarnings(source, omitted) {
|
|
187467
|
+
return omitted.filter((app) => namesApp(source, app.id, app.namespace)).map(omittedAppTypesWarning);
|
|
187468
|
+
}
|
|
187469
|
+
async function appWriteTypesWarnings(appId) {
|
|
187470
|
+
try {
|
|
187471
|
+
const app = await getApp(appId);
|
|
187472
|
+
const omitted = app ? renderAppTypesReport([app]).omitted : [];
|
|
187473
|
+
return omitted.map(omittedAppTypesWarning);
|
|
187474
|
+
} catch {
|
|
187475
|
+
return [];
|
|
187476
|
+
}
|
|
187477
|
+
}
|
|
187478
|
+
var MAX_APP_TYPES_BYTES_PER_APP, MAX_APP_TYPES_BYTES, APP_TYPES_PREAMBLE = `// ── Swarm Apps: generated per-app types (source: apps table) ───────────────
|
|
187131
187479
|
// Rows are the app's declared columns plus the 5 system columns. Query
|
|
187132
187480
|
// overloads narrow only when appId AND query are string literals.
|
|
187133
187481
|
|
|
@@ -187154,7 +187502,8 @@ export interface SwarmAppQueryResult<Row> {
|
|
|
187154
187502
|
var init_script_types = __esm(() => {
|
|
187155
187503
|
init_definition();
|
|
187156
187504
|
init_store2();
|
|
187157
|
-
|
|
187505
|
+
MAX_APP_TYPES_BYTES_PER_APP = 1024 * 1024;
|
|
187506
|
+
MAX_APP_TYPES_BYTES = 4 * 1024 * 1024;
|
|
187158
187507
|
});
|
|
187159
187508
|
|
|
187160
187509
|
// src/be/scripts/typecheck.ts
|
|
@@ -187368,19 +187717,22 @@ async function typecheckWithAmbient(args) {
|
|
|
187368
187717
|
async function typecheckScript(source, context = {}) {
|
|
187369
187718
|
const apiTypes = getScriptApiTypes(context);
|
|
187370
187719
|
const mcpTypes = getScriptMcpTypes(context);
|
|
187371
|
-
const
|
|
187720
|
+
const appTypesReport = await getScriptAppTypesReport(context, source);
|
|
187721
|
+
const appTypes = appTypesReport.source;
|
|
187372
187722
|
const sdkTypes = await scriptSdkTypesWithGeneratedApis(apiTypes, mcpTypes, appTypes);
|
|
187373
187723
|
const stdlibTypes = appTypes ? await scriptStdlibTypesWithGeneratedApis(apiTypes, mcpTypes, appTypes) : SCRIPT_STDLIB_TYPES;
|
|
187374
|
-
|
|
187724
|
+
const result = await typecheckWithAmbient({
|
|
187375
187725
|
source,
|
|
187376
187726
|
modules: { "swarm-sdk": sdkTypes, stdlib: stdlibTypes },
|
|
187377
187727
|
checkFile: `/// <reference path="./runtime-globals.d.ts" />
|
|
187378
187728
|
import run from "./user-script";
|
|
187379
|
-
import type { ScriptMain } from "swarm-sdk";
|
|
187380
|
-
const _scriptMain: ScriptMain = run;
|
|
187729
|
+
import type { ScriptMain, DurableObject } from "swarm-sdk";
|
|
187730
|
+
const _scriptMain: ScriptMain | (abstract new (id: string) => DurableObject<any>) = run;
|
|
187381
187731
|
void _scriptMain;
|
|
187382
187732
|
`
|
|
187383
187733
|
});
|
|
187734
|
+
const warnings = scriptAppTypesWarnings(source, appTypesReport.omitted);
|
|
187735
|
+
return result.ok && warnings.length > 0 ? { ok: true, warnings } : result;
|
|
187384
187736
|
}
|
|
187385
187737
|
var import_typescript4, SCRIPT_SDK_TYPES = `
|
|
187386
187738
|
export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
|
|
@@ -187830,7 +188182,7 @@ export interface SwarmSdk {
|
|
|
187830
188182
|
schedule_list(args?: { enabled?: boolean; name?: string; scheduleType?: "recurring" | "one_time"; targetType?: "agent-task" | "workflow" | "script"; workflowId?: string; scriptName?: string; hideCompleted?: boolean; consecutiveErrorsMin?: number; lastRunStatus?: "failed" | "succeeded"; includeFull?: boolean }): Promise<unknown>;
|
|
187831
188183
|
// --- scripts ---
|
|
187832
188184
|
script_search(args: { query?: string; scope?: ScriptScope; limit?: number }): Promise<unknown>;
|
|
187833
|
-
script_run(args: { name?: string; source?: string; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; executor?: ScriptExecutorName | null; idempotencyKey?: string }): Promise<unknown>;
|
|
188185
|
+
script_run(args: { name?: string; source?: string; object?: { id: string; method: string }; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; executor?: ScriptExecutorName | null; idempotencyKey?: string }): Promise<unknown>;
|
|
187834
188186
|
// --- savings calibration (REST only) ---
|
|
187835
188187
|
/** The savings curve in use (shipped or derived from this deployment) and the stored row's metadata. */
|
|
187836
188188
|
savings_calibrationGet(): Promise<unknown>;
|
|
@@ -188249,7 +188601,25 @@ export interface ScriptShResult {
|
|
|
188249
188601
|
exitCode: number;
|
|
188250
188602
|
}
|
|
188251
188603
|
|
|
188604
|
+
/** The invoking agent, or the saved script that made a nested call. */
|
|
188605
|
+
export type ScriptCaller =
|
|
188606
|
+
| { kind: "agent"; agentId: string }
|
|
188607
|
+
| { kind: "script"; agentId: string; scriptId?: string; objectId?: string }
|
|
188608
|
+
| null;
|
|
188609
|
+
|
|
188610
|
+
export abstract class DurableObject<S> {
|
|
188611
|
+
constructor(id: string);
|
|
188612
|
+
readonly id: string;
|
|
188613
|
+
state: S;
|
|
188614
|
+
abstract initialState(): S | Promise<S>;
|
|
188615
|
+
migrate?(state: unknown, fromVersion: number): S | Promise<S>;
|
|
188616
|
+
destroy(): void;
|
|
188617
|
+
static idleTtlSec?: number;
|
|
188618
|
+
}
|
|
188619
|
+
|
|
188252
188620
|
export interface ScriptContext {
|
|
188621
|
+
/** Frozen caller identity supplied by the host. */
|
|
188622
|
+
caller: ScriptCaller;
|
|
188253
188623
|
run?: ScriptRunContext;
|
|
188254
188624
|
step?: ScriptWorkflowSteps;
|
|
188255
188625
|
swarm: SwarmSdk & { config: SwarmConfig };
|
|
@@ -188717,4 +189087,4 @@ function parseSkillContent(content) {
|
|
|
188717
189087
|
}
|
|
188718
189088
|
var init_skill_parser = () => {};
|
|
188719
189089
|
|
|
188720
|
-
export { require_dist, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, init_mcp_oauth, ensureMcpToken, init_ensure_mcp_token, callMcpServerTool, init_mcp_proxy, resolveSqlDsn, runReadOnlyQuery, init_sql_connections, listVendoredOpenapiEntries, init_vendored_openapi, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, init_script_connections, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, init_oauth_credential_bindings, buildScriptCredentialBindingsWithFailures, init_script_credential_broker, DEFAULT_SANDBOX_LIMITS, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, init_sandboxed_process, writeBareImportShim, init_native, isExecutorAllowedByDeployment, init_registry, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, init_types3, HOST_VALIDATED_ARGS, init_host_validated_args, require_typescript2, checkImportAllowlist, validateScriptImports, init_import_allowlist, runScriptWithRunCredential, runScriptAsUserWithRunCredential, init_run_credential, resolveSeededEnabled, init_automation_toggle, getSeedState, recordSeedState, deleteSeedState, init_state_db, canonicalJson, seededWorkflowState, workflowsSeeder, init_workflows_seeder, extractScriptSignature, init_extract_signature, extractArgsJsonSchema, init_extract_schema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, init_run_saved, checkQuickJSCompat, quickJSCompatWarnings, init_quickjs_compat, resolveSyncRunAs, init_sync_run_as, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, init_definition, upgradeAppDefinition, init_format_upgrades, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, init_store2, getScriptAppTypes, init_script_types, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, init_typecheck, parseSkillContent, init_skill_parser };
|
|
189090
|
+
export { require_dist, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, init_mcp_oauth, ensureMcpToken, init_ensure_mcp_token, callMcpServerTool, init_mcp_proxy, resolveSqlDsn, runReadOnlyQuery, init_sql_connections, listVendoredOpenapiEntries, init_vendored_openapi, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, init_script_connections, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, init_oauth_credential_bindings, buildScriptCredentialBindingsWithFailures, init_script_credential_broker, DEFAULT_SANDBOX_LIMITS, resolveSandboxIdentity, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, init_sandboxed_process, readRunDirFile, writeBareImportShim, init_native, isExecutorAllowedByDeployment, init_registry, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, init_types3, HOST_VALIDATED_ARGS, init_host_validated_args, require_typescript2, checkImportAllowlist, validateScriptImports, init_import_allowlist, runScriptWithRunCredential, runScriptAsUserWithRunCredential, init_run_credential, resolveSeededEnabled, init_automation_toggle, getSeedState, recordSeedState, deleteSeedState, init_state_db, canonicalJson, seededWorkflowState, workflowsSeeder, init_workflows_seeder, DURABLE_OBJECT_BASE_JS, init_durable_object_base, extractScriptSignature, init_extract_signature, extractArgsJsonSchema, init_extract_schema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, init_run_saved, checkQuickJSCompat, quickJSCompatWarnings, init_quickjs_compat, resolveSyncRunAs, init_sync_run_as, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, init_definition, upgradeAppDefinition, init_format_upgrades, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, init_store2, getScriptAppTypes, appWriteTypesWarnings, init_script_types, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, init_typecheck, parseSkillContent, init_skill_parser };
|