@desplega.ai/agent-swarm 2.13.0 → 2.13.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-xtj40wd8.js +17 -0
- package/dist/{acp-targets-86f0sh6g.js → acp-targets-n7vm5atw.js} +10 -10
- package/dist/{actions-zv8vcxvr.js → actions-hq6wp9xv.js} +27 -27
- package/dist/{agent-fs-provision-jqshb33y.js → agent-fs-provision-y0qc1rdd.js} +4 -4
- package/dist/{amp-adapter-gt503ywc.js → amp-adapter-1qqs6h91.js} +3 -3
- package/dist/{app-6t4k5rh1.js → app-7m4z44rv.js} +10 -10
- package/dist/{approval-notifications-fcfw063h.js → approval-notifications-8sr41gjx.js} +11 -11
- package/dist/{assistant-9dzybh12.js → assistant-hkczwfv6.js} +28 -28
- package/dist/{boot-args-schema-xzfp2feg.js → boot-args-schema-8025snev.js} +1 -1
- package/dist/{boot-reembed-r88wngfg.js → boot-reembed-15m87nr1.js} +1 -1
- package/dist/{boot-reembed-3jz0p2jk.js → boot-reembed-4bbpxjh1.js} +1 -1
- package/dist/{boot-scrub-sweep-scrqhw48.js → boot-scrub-sweep-eajr97e9.js} +2 -2
- package/dist/{boot-seeds-vb2dcrrb.js → boot-seeds-9cwy39jx.js} +4 -4
- package/dist/{boxd-68n75y1s.js → boxd-hr8rsxzq.js} +1 -1
- package/dist/{claude-adapter-h3mp9hgs.js → claude-adapter-g61wa4rt.js} +9 -9
- package/dist/{claude-managed-adapter-kpbyj2vb.js → claude-managed-adapter-znkk0prm.js} +3 -3
- package/dist/{claude-managed-setup-0efr3wkg.js → claude-managed-setup-f1wndkr2.js} +2 -2
- package/dist/{claude-sdk-session-03dw669q.js → claude-sdk-session-687xzf21.js} +20763 -19381
- package/dist/{cli-gfcv679k.js → cli-04103ryh.js} +1 -1
- package/dist/{cli-hbq0kwxz.js → cli-0a336ze7.js} +4 -4
- package/dist/{cli-1v82d2w6.js → cli-0fx95c06.js} +4 -4
- package/dist/{cli-wxwv3t11.js → cli-0m77n7ej.js} +3 -3
- package/dist/{cli-j53hpbsm.js → cli-0xwb7zpt.js} +2 -2
- package/dist/{cli-0dg7ytxm.js → cli-13t0smbk.js} +917 -23
- package/dist/{cli-0pazkmd4.js → cli-1b5axkt1.js} +4 -4
- package/dist/{cli-6h88mn9q.js → cli-1carhg8g.js} +4 -4
- package/dist/{cli-hgsxnjyg.js → cli-1dr5at77.js} +10 -10
- package/dist/{cli-0jkenasr.js → cli-2v4xxnx2.js} +1 -1
- package/dist/{cli-dnh64e8e.js → cli-32xndx6b.js} +6 -6
- package/dist/{cli-hpb9x72z.js → cli-3m8vqehw.js} +9 -9
- package/dist/{cli-ercwc8xn.js → cli-3mf04tkh.js} +1 -1
- package/dist/{cli-7dbhnsj9.js → cli-3zyme1wt.js} +4 -4
- package/dist/{cli-s6zk31gr.js → cli-43dsqhcp.js} +4 -4
- package/dist/{cli-t35hx078.js → cli-4h90xaet.js} +2 -2
- package/dist/{cli-117g15t4.js → cli-4mj5g29m.js} +8 -8
- package/dist/{cli-47hz21se.js → cli-4tbvndmm.js} +4 -5
- package/dist/{cli-tn91wc6e.js → cli-50whymxq.js} +1 -1
- package/dist/{cli-js10kdk7.js → cli-5basv0e7.js} +19 -5
- package/dist/{cli-xfjn2kyq.js → cli-5v6b2am8.js} +5 -5
- package/dist/{cli-49f5jyhh.js → cli-6r1dwegd.js} +3 -3
- package/dist/{cli-kspxjftk.js → cli-7ewre3dm.js} +15 -6
- package/dist/{cli-n3qe7tyr.js → cli-84xtgbn6.js} +35 -2
- package/dist/{cli-w14j2z4k.js → cli-8cmjkbvj.js} +2 -2
- package/dist/{cli-2m6yaq6b.js → cli-8fj8yfmk.js} +1 -1
- package/dist/{cli-9m9kyw77.js → cli-8rbkw18r.js} +2 -2
- package/dist/{cli-x05p2d05.js → cli-9tevdxyf.js} +1 -1
- package/dist/{cli-f1952kjy.js → cli-9xx36trj.js} +4 -4
- package/dist/{cli-hc6e4tac.js → cli-a8ts6x1n.js} +6 -6
- package/dist/{cli-mh7pdxe0.js → cli-aebswqmz.js} +12 -12
- package/dist/{cli-ex1y88j3.js → cli-at67kvnp.js} +1 -1
- package/dist/{cli-b2jh3dyb.js → cli-bjmq14k9.js} +4 -4
- package/dist/{cli-mz34pxbk.js → cli-byxsctca.js} +11 -11
- package/dist/{cli-dka73bak.js → cli-c0tyzt73.js} +152 -12
- package/dist/{cli-wv20kbr3.js → cli-c8kqmzzf.js} +5 -5
- package/dist/{cli-qhhb30e8.js → cli-cd9acnvd.js} +9 -9
- package/dist/{cli-wndegmns.js → cli-cmgdptmx.js} +3 -3
- package/dist/{cli-1dbv9mj9.js → cli-cn6fpa1p.js} +1 -1
- package/dist/{cli-wrhbym01.js → cli-cp0m07wb.js} +6 -6
- package/dist/{cli-3p288654.js → cli-cpkxh68d.js} +2 -2
- package/dist/{cli-g6j6ac3h.js → cli-cqxwjb93.js} +2 -2
- package/dist/{cli-8hp56wat.js → cli-d2epqm0y.js} +1 -1
- package/dist/{cli-qm3ntjqs.js → cli-dd57p1gd.js} +13 -13
- package/dist/{cli-tstj6e8e.js → cli-fn8aj7gb.js} +250 -55
- package/dist/{cli-bpje8n65.js → cli-fp65jdp2.js} +31 -6
- package/dist/{cli-2skf1mdf.js → cli-gedf48yw.js} +4 -4
- package/dist/{cli-c8v2yvej.js → cli-gq6qhmrr.js} +2 -2
- package/dist/{cli-sq913bh1.js → cli-grcc2h2g.js} +8 -8
- package/dist/{cli-qec9bynj.js → cli-h03j6je3.js} +3 -3
- package/dist/{cli-mbwmqb5w.js → cli-h0ewec3d.js} +1 -1
- package/dist/{cli-jj3c5nyb.js → cli-h9bejmkf.js} +76 -39
- package/dist/{cli-ct8sz3np.js → cli-hs3mqswp.js} +6 -6
- package/dist/{cli-tdk7jtka.js → cli-hv3820ez.js} +1 -1
- package/dist/{cli-pqfecppn.js → cli-je587f74.js} +1 -1
- package/dist/{cli-y4a4458j.js → cli-jhtvt7gn.js} +3 -3
- package/dist/{cli-dkejt425.js → cli-mmw2sjaf.js} +7 -7
- package/dist/{cli-50w82h6m.js → cli-mwxez0pz.js} +1 -0
- package/dist/{cli-avxh26pd.js → cli-nk8swfpx.js} +4 -4
- package/dist/{cli-fhvk2nvp.js → cli-p7g7wd9n.js} +9 -9
- package/dist/{cli-bhgrhedp.js → cli-q8aq48v1.js} +1 -1
- package/dist/{cli-6a40p4kv.js → cli-qn79645p.js} +1 -1
- package/dist/{cli-nc6a8b5b.js → cli-qx1dwrr5.js} +2 -2
- package/dist/{cli-sdh61g52.js → cli-s6fhqbz1.js} +2 -2
- package/dist/{cli-eb279wn3.js → cli-sfajkbd7.js} +2 -2
- package/dist/{cli-z64t9pe6.js → cli-snypfjgj.js} +1 -1
- package/dist/{cli-ytc7fpza.js → cli-t25rq8mg.js} +4 -4
- package/dist/{cli-zqmmy073.js → cli-t90k0phh.js} +18 -18
- package/dist/{cli-fz9pcjsw.js → cli-tzzas8rb.js} +4 -4
- package/dist/{cli-rtmqzat7.js → cli-vdfngx2g.js} +2 -2
- package/dist/{cli-9w8712tq.js → cli-vr4eyq6p.js} +43 -14
- package/dist/{cli-z4f346g5.js → cli-vx9acp12.js} +1 -1
- package/dist/{cli-y518qkjg.js → cli-w24f3j49.js} +10 -10
- package/dist/{cli-yn4kt85g.js → cli-w41bvvms.js} +1 -1
- package/dist/{cli-9fsagra4.js → cli-w6c6dj91.js} +1 -1
- package/dist/{cli-kde4ky90.js → cli-x5yb8zc8.js} +2 -2
- package/dist/{cli-48nvk6sb.js → cli-xhkek467.js} +2 -2
- package/dist/{cli-avqkr20b.js → cli-y6qqbpwc.js} +2 -2
- package/dist/{cli-7wy8gbwb.js → cli-ya1cj689.js} +1 -1
- package/dist/{cli-prf7kz78.js → cli-yeh3g1q6.js} +603 -78
- package/dist/{cli-ajjvqhf3.js → cli-z6m6xzxt.js} +2 -2
- package/dist/{cli-2jk4s7z1.js → cli-zaate0rd.js} +3 -3
- package/dist/{cli-n85m2wkq.js → cli-zkbz8m2q.js} +3 -2
- package/dist/{cli-0b655smz.js → cli-zvpkrgsc.js} +5 -5
- package/dist/cli.js +27 -27
- package/dist/{codex-adapter-f3yp0kaj.js → codex-adapter-ysfg6ty3.js} +8 -8
- package/dist/{codex-hook-262cekfp.js → codex-hook-c0nvm30r.js} +2 -2
- package/dist/{codex-login-1ven7yje.js → codex-login-ven5cz5j.js} +1 -1
- package/dist/{codex-session-runner-ns4mv70p.js → codex-session-runner-823scr6g.js} +9 -9
- package/dist/{commands-5bzf2tfw.js → commands-5rbm07fz.js} +3 -3
- package/dist/{controller-5xt7kvfm.js → controller-wn3vd217.js} +3 -3
- package/dist/{controllers-connect-0gg13mzp.js → controllers-connect-34jzhfft.js} +28 -28
- package/dist/core-kdehq26g.js +42 -0
- package/dist/{cursor-adapter-p0c5zv6r.js → cursor-adapter-w1681kp1.js} +2 -2
- package/dist/{db-2s68ycq7.js → db-6bkgbfwk.js} +3 -3
- package/dist/{db-q7q639k5.js → db-hcj16x7z.js} +2 -2
- package/dist/{devin-adapter-t8d86q9x.js → devin-adapter-fs90ab4v.js} +1 -1
- package/dist/{dispatcher-j2y1q7ae.js → dispatcher-jgjqrfzv.js} +25 -25
- package/dist/{docker-1b41eysj.js → docker-1h33jvh9.js} +2 -2
- package/dist/{dsh-adapter-pgnkf4st.js → dsh-adapter-g9yqv09y.js} +2 -2
- package/dist/{e2b-xm60c8ad.js → e2b-jnk0yeva.js} +2 -2
- package/dist/{e2b-ew8c5j5v.js → e2b-y7e5kmzf.js} +2 -2
- package/dist/{easter-egg-3d-0kea97jf.js → easter-egg-3d-w17nsny6.js} +1 -1
- package/dist/{embedding-space-3n6mhhmy.js → embedding-space-v06fwy7b.js} +6 -6
- package/dist/{embeddings-jfmj6yme.js → embeddings-g50dxea4.js} +1 -1
- package/dist/{event-bus-v4ywhc2p.js → event-bus-08t2b4y2.js} +1 -1
- package/dist/{execute-tjrej979.js → execute-1n36haw1.js} +1 -1
- package/dist/{external-channel-jy8w2gg3.js → external-channel-43tv8pg6.js} +2 -2
- package/dist/fx-adapter-bvh05t4a.js +20 -0
- package/dist/grok-adapter-my5j8mdf.js +20 -0
- package/dist/handlers-wyymeeqh.js +41 -0
- package/dist/heartbeat-sf3nk937.js +50 -0
- package/dist/{hook-bpnncsec.js → hook-dqph1e05.js} +8 -8
- package/dist/{hook-fv1jwrv7.js → hook-m1m9dm6w.js} +6 -6
- package/dist/{http-bpa26czn.js → http-w0th1cz9.js} +160 -102
- package/dist/index-22khdtby.js +44 -0
- package/dist/{index-mpj0z9e0.js → index-c0e8en64.js} +1 -1
- package/dist/{index-620y7jzq.js → index-e8pz8qdg.js} +3 -3
- package/dist/{index-8p0j4h4j.js → index-ez823q84.js} +94 -89
- package/dist/{index-w216g9y9.js → index-ffba0z8q.js} +35 -21
- package/dist/{index-s8re7mvq.js → index-gkpfgpg7.js} +1 -1
- package/dist/{index-4k7m5dgj.js → index-k8ajc0g0.js} +143 -103
- package/dist/index-np0582ac.js +40 -0
- package/dist/{index-52tgbhrw.js → index-pb03vans.js} +28 -28
- package/dist/index-vgkrj1jt.js +39 -0
- package/dist/{index-pe3d8jfy.js → index-whysn1wf.js} +1 -1
- package/dist/{index-0h6qd4p1.js → index-y4vd4mhn.js} +3 -4
- package/dist/{k8s-fy8hbhkg.js → k8s-8326q0rq.js} +2 -2
- package/dist/{keepalive-d6z12s04.js → keepalive-2v06q2e8.js} +5 -4
- package/dist/lead-55z813ng.js +79 -0
- package/dist/{maintenance-7kac6g2g.js → maintenance-vx7vjhhy.js} +1 -1
- package/dist/{oauth-refresh-sweep-t1xjetbh.js → oauth-refresh-sweep-g06k4bza.js} +4 -3
- package/dist/{object-webhooks-6rdagg0r.js → object-webhooks-3dzdq4fm.js} +7 -7
- package/dist/{onboard-32y1cfxy.js → onboard-232pazny.js} +4 -4
- package/dist/{opencode-adapter-enp3v31n.js → opencode-adapter-t0paqbh8.js} +8 -8
- package/dist/{otel-impl-k0tm5ptj.js → otel-impl-kmpkyp4y.js} +2 -2
- package/dist/{pending-24zebgvs.js → pending-x0z3vx1x.js} +26 -26
- package/dist/{pi-mono-adapter-yj72xxxe.js → pi-mono-adapter-7pmypn6d.js} +17 -15
- package/dist/{pricing-refresh-cf25x38j.js → pricing-refresh-ytjmtyd7.js} +2 -2
- package/dist/{rbac-roles-0wydd22m.js → rbac-roles-fgm5mxr2.js} +3 -3
- package/dist/{rbac-roles-at6crb3r.js → rbac-roles-xyaxekh3.js} +2 -2
- package/dist/{render-v2-nvcw0jd7.js → render-v2-ws972g4r.js} +10 -10
- package/dist/{resume-y4w0k5v3.js → resume-m6mjzhkp.js} +13 -13
- package/dist/{runtime-vpe43hx0.js → runtime-zzpc0c8a.js} +1 -1
- package/dist/{session-access-gkyvnfye.js → session-access-vp35xs91.js} +5 -5
- package/dist/{session-source-backfill-3w2st4m2.js → session-source-backfill-p73e8zbe.js} +2 -2
- package/dist/{setup-axxvqtys.js → setup-r4kd7rxg.js} +1 -1
- package/dist/thread-buffer-cm2nzq6t.js +42 -0
- package/dist/{tree-visibility-y4fqvab5.js → tree-visibility-07h2tbs2.js} +2 -2
- package/dist/{user-merge-jobs-kcmwvrc6.js → user-merge-jobs-96vg9rpe.js} +3 -3
- package/dist/{virtual-modules-7d92dct1.js → virtual-modules-vgn3f2x4.js} +3 -3
- package/dist/{work-objects-f708e069.js → work-objects-74hbcx3e.js} +28 -28
- package/dist/worker-5pn2vzx6.js +79 -0
- package/dist/{worker-follow-up-0by8wztc.js → worker-follow-up-ezavwn5d.js} +25 -25
- package/dist/{x-3dtaf2r9.js → x-asbrnafg.js} +2 -2
- package/openapi.json +1793 -1622
- package/package.json +10 -10
- package/src/apps/catalog.generated.json +726 -0
- package/src/apps/definition.ts +24 -7
- package/src/apps/page-validator.ts +225 -3
- package/src/be/db.ts +38 -10
- package/src/be/mcp-proxy.ts +5 -4
- package/src/be/migrations/340_api_key_spend_cap.sql +5 -0
- package/src/be/schedules/validate.ts +26 -0
- package/src/be/swarm-config-guard.ts +4 -0
- package/src/commands/credential-outcome-report.ts +5 -2
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/provider-credentials.ts +19 -0
- package/src/commands/provider-error-class.ts +4 -1
- package/src/commands/rate-limit-outcome.ts +48 -3
- package/src/commands/runner.ts +113 -55
- package/src/commands/worktree-reaper.ts +600 -0
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/http/agents.ts +4 -0
- package/src/http/api-keys.ts +27 -3
- package/src/http/pages-public.ts +40 -4
- package/src/http/pool-keys.ts +21 -2
- package/src/http/schedules.ts +28 -3
- package/src/http/script-connections.ts +12 -4
- package/src/http/script-runs.ts +12 -3
- package/src/http/tasks.ts +6 -10
- package/src/mcp-client/http-client.ts +3 -1
- package/src/oauth/identity-capture.ts +6 -1
- package/src/oauth/mcp-wrapper.ts +10 -3
- package/src/oauth/wrapper.ts +15 -3
- package/src/prompts/session-templates.ts +1 -0
- package/src/providers/acp-targets.ts +2 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/pi-mono-adapter.ts +4 -2
- package/src/providers/runtime-dependencies.ts +1 -1
- package/src/rbac/legacy-policy.ts +2 -0
- package/src/rbac/permissions.ts +5 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +7 -7
- package/src/slack/enrich.ts +14 -11
- package/src/tests/agents-list-model-display.test.ts +23 -0
- package/src/tests/apps-spike2.test.ts +35 -0
- package/src/tests/base-prompt.test.ts +1 -0
- package/src/tests/deploy-guard.test.ts +24 -0
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/ensure-token.test.ts +2 -2
- package/src/tests/entrypoint-repo-autoclone-args.test.ts +202 -0
- package/src/tests/fake-dns.ts +47 -0
- package/src/tests/fixtures/base-prompt-baseline.json +12 -12
- package/src/tests/latest-model-report.test.ts +138 -0
- package/src/tests/mcp-oauth-dcr-reuse.test.ts +5 -2
- package/src/tests/mcp-oauth-ensure-token.test.ts +3 -2
- package/src/tests/mcp-oauth-manual-client.test.ts +6 -1
- package/src/tests/mcp-oauth-wrapper.test.ts +20 -4
- package/src/tests/mcp-outbound-fetch-guard.test.ts +169 -0
- package/src/tests/mcp-server-ssrf.test.ts +2 -0
- package/src/tests/memory-search-stall.test.ts +5 -0
- package/src/tests/oauth-connection-fetch-guard.test.ts +162 -0
- package/src/tests/oauth-token-endpoint-fetch-guard.test.ts +121 -0
- package/src/tests/oauth-wrapper.test.ts +1 -2
- package/src/tests/pages-head-v2.test.ts +2 -1
- package/src/tests/script-connections-http.test.ts +8 -3
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/slack-thread-participants.test.ts +14 -3
- package/src/tests/spend-cap-credentials.test.ts +34 -0
- package/src/tests/spend-cap-outcome.test.ts +67 -0
- package/src/tests/subscription-first.test.ts +119 -0
- package/src/tests/worktree-reaper.test.ts +424 -0
- package/src/tools/get-task-details.ts +247 -5
- package/src/tools/schedules/patch-schedule.ts +26 -1
- package/src/tools/schedules/update-schedule.ts +28 -2
- package/src/utils/credentials.ts +36 -1
- package/src/utils/egress-guard.ts +40 -10
- package/src/utils/error-tracker.ts +17 -0
- package/templates/skills/apps/SKILL.md +191 -2
- package/templates/skills/apps/content.md +191 -2
- package/templates/skills/boards-and-sheets/content.md +11 -0
- package/templates/skills/pages/content.md +11 -0
- package/templates/skills/swarm-docs/content.md +2 -0
- package/templates/skills/swarm-scripts/SKILL.md +1 -0
- package/templates/skills/swarm-scripts/content.md +1 -0
- package/templates/workflows/ralph-loop/content.md +6 -6
- package/dist/acp-adapter-cn53011z.js +0 -17
- package/dist/cli-pr0eze3x.js +0 -149
- package/dist/core-0fqtbrxa.js +0 -42
- package/dist/fx-adapter-k6w3jvz9.js +0 -20
- package/dist/grok-adapter-4q5tssw0.js +0 -20
- package/dist/handlers-qxgfvvsf.js +0 -41
- package/dist/heartbeat-6tr2w2da.js +0 -50
- package/dist/index-0mcxjdsa.js +0 -44
- package/dist/index-dz4q23ag.js +0 -40
- package/dist/index-s175jckx.js +0 -39
- package/dist/lead-p3hx7h35.js +0 -79
- package/dist/thread-buffer-rwa7d4dx.js +0 -42
- package/dist/worker-8rg9gz74.js +0 -79
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
CredentialBroker,
|
|
4
4
|
defaultCredentialBindings,
|
|
5
5
|
assertUrlSafe,
|
|
6
|
+
createSsrfGuardedFetch,
|
|
6
7
|
parseEgressAllowlist,
|
|
7
8
|
init_egress_guard,
|
|
8
9
|
init_credential_broker,
|
|
@@ -45,11 +46,11 @@ import {
|
|
|
45
46
|
getWorkflowVersions2,
|
|
46
47
|
getMcpServerById2,
|
|
47
48
|
init_db4
|
|
48
|
-
} from "./cli-
|
|
49
|
+
} from "./cli-h9bejmkf.js";
|
|
49
50
|
import {
|
|
50
51
|
McpHttpClient,
|
|
51
52
|
init_http_client
|
|
52
|
-
} from "./cli-
|
|
53
|
+
} from "./cli-9tevdxyf.js";
|
|
53
54
|
import {
|
|
54
55
|
detachedProcessGroup,
|
|
55
56
|
registerProcessGroup,
|
|
@@ -60,17 +61,17 @@ import {
|
|
|
60
61
|
oauthAppRowToProviderConfig,
|
|
61
62
|
ensureAuthorizationTokenOrThrow,
|
|
62
63
|
init_ensure_token
|
|
63
|
-
} from "./cli-
|
|
64
|
+
} from "./cli-7ewre3dm.js";
|
|
64
65
|
import {
|
|
65
66
|
AGENT_FS_API_KEY_CONFIG,
|
|
66
67
|
init_script_fs,
|
|
67
68
|
resolveAgentFsIdentity,
|
|
68
69
|
init_agent_fs_identity
|
|
69
|
-
} from "./cli-
|
|
70
|
+
} from "./cli-y6qqbpwc.js";
|
|
70
71
|
import {
|
|
71
72
|
validateDefinition,
|
|
72
73
|
init_definition2
|
|
73
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-1dr5at77.js";
|
|
74
75
|
import {
|
|
75
76
|
getApiKey,
|
|
76
77
|
init_api_key
|
|
@@ -82,12 +83,12 @@ import {
|
|
|
82
83
|
refreshMcpToken,
|
|
83
84
|
computeExpiresAt,
|
|
84
85
|
init_mcp_wrapper
|
|
85
|
-
} from "./cli-
|
|
86
|
+
} from "./cli-c0tyzt73.js";
|
|
86
87
|
import {
|
|
87
88
|
mintScriptRunToken,
|
|
88
89
|
revokeSessionToken,
|
|
89
90
|
init_users
|
|
90
|
-
} from "./cli-
|
|
91
|
+
} from "./cli-z6m6xzxt.js";
|
|
91
92
|
import {
|
|
92
93
|
defaultAssetKey,
|
|
93
94
|
init_key,
|
|
@@ -126,7 +127,7 @@ import {
|
|
|
126
127
|
refreshSecretScrubberCache,
|
|
127
128
|
registerVolatileSecret,
|
|
128
129
|
init_secret_scrubber
|
|
129
|
-
} from "./cli-
|
|
130
|
+
} from "./cli-fp65jdp2.js";
|
|
130
131
|
import {
|
|
131
132
|
__toESM,
|
|
132
133
|
__commonJS,
|
|
@@ -7073,7 +7074,7 @@ async function createMcpServerClient(serverId, context = {}) {
|
|
|
7073
7074
|
clientInfo: { name: "agent-swarm-script-mcp-proxy", version: "1.0.0" },
|
|
7074
7075
|
omitEmptyAuthHeaders: true,
|
|
7075
7076
|
timeoutMs: context.timeoutMs ?? MCP_PROXY_TIMEOUT_MS,
|
|
7076
|
-
|
|
7077
|
+
fetch: createSsrfGuardedFetch(publicEndpointSsrfOptions())
|
|
7077
7078
|
});
|
|
7078
7079
|
client.useRawUrl = true;
|
|
7079
7080
|
client.customHeaders = await resolveMcpHeaders(server2, context);
|
|
@@ -7095,6 +7096,7 @@ var init_mcp_proxy = __esm(() => {
|
|
|
7095
7096
|
init_http_client();
|
|
7096
7097
|
init_ensure_mcp_token();
|
|
7097
7098
|
init_mcp_wrapper();
|
|
7099
|
+
init_egress_guard();
|
|
7098
7100
|
init_secret_scrubber();
|
|
7099
7101
|
});
|
|
7100
7102
|
|
|
@@ -178769,7 +178771,7 @@ var content_default11 = `# Iterative Review Loop
|
|
|
178769
178771
|
|
|
178770
178772
|
Template parameter: {{REPO_URL}}
|
|
178771
178773
|
|
|
178772
|
-
A
|
|
178774
|
+
A single implement → review pass. A coder agent implements the task and reports the diff; a reviewer agent checks it and returns PASS or a blocking fix list. Use this when you want automated quality control with a clear exit condition rather than open-ended implementation.
|
|
178773
178775
|
|
|
178774
178776
|
## Configuration
|
|
178775
178777
|
|
|
@@ -178779,15 +178781,15 @@ A bounded implement → review loop. A coder agent implements the task and repor
|
|
|
178779
178781
|
|
|
178780
178782
|
## What It Does
|
|
178781
178783
|
|
|
178782
|
-
A two-node implement → review
|
|
178784
|
+
A two-node implement → review pass:
|
|
178783
178785
|
|
|
178784
178786
|
1. **Implement node (coder):** Takes the \`task\` description and \`repoUrl\`, produces a working implementation, runs focused checks (lint, types, relevant tests), and reports the diff.
|
|
178785
178787
|
|
|
178786
178788
|
2. **Review node (reviewer):** Reads the implementation output, checks correctness and quality, and returns either \`PASS\` (implementation is accepted) or a list of blocking fixes only (no nitpicks — only what must change before this can ship).
|
|
178787
178789
|
|
|
178788
|
-
The \`maxIterations\`
|
|
178790
|
+
The trigger’s \`maxIterations\` is only a hint to the agents, not an engine-enforced ceiling. The global engine limits are \`WORKFLOW_MAX_ITERATIONS\` (default 100 node executions per graph walk, reset on resume) and \`WORKFLOW_MAX_STEPS_PER_RUN\` (default 500 total steps per run).
|
|
178789
178791
|
|
|
178790
|
-
**Note:**
|
|
178792
|
+
**Note:** The shipped definition has no back-edge, so it runs once. The engine supports native loops through port back-edges: add a separate entry node before \`implement\`, then a \`property-match\` node after review whose \`false\` port routes back to \`implement\` when the verdict is FAIL.
|
|
178791
178793
|
|
|
178792
178794
|
## When to Use
|
|
178793
178795
|
|
|
@@ -178798,14 +178800,14 @@ The \`maxIterations\` parameter is declarative: the reviewer signals PASS when d
|
|
|
178798
178800
|
|
|
178799
178801
|
## Customization Notes
|
|
178800
178802
|
|
|
178801
|
-
- **\`maxIterations\`** is
|
|
178803
|
+
- **\`maxIterations\`** is declared in the trigger schema but is not enforced by the engine. It's a hint to the agents — include it in the implement node's task prompt if you want the coder to self-limit attempts.
|
|
178802
178804
|
- **Pin \`agentId\`** on the implement node to a coder-capable agent with repo access. Pin the review node to a reviewer-capable agent that can reason about code quality.
|
|
178803
178805
|
- **Add a PR creation node:** Extend with a third agent-task node that takes the reviewer's PASS output and creates a pull request via \`gh pr create\`.
|
|
178804
178806
|
- **Add structured output to the review node:** Use \`outputSchema: { "type": "object", "properties": { "verdict": { "type": "string", "enum": ["PASS", "FAIL"] }, "fixes": { "type": "array" } } }\` to make the verdict machine-readable for downstream automation.
|
|
178805
178807
|
|
|
178806
178808
|
## Trade-offs
|
|
178807
178809
|
|
|
178808
|
-
**
|
|
178810
|
+
**Single pass as shipped:** Native iteration requires adding a port back-edge and an explicit budget check if you want to enforce the trigger’s \`maxIterations\`. The global engine limits are safety backstops, not a review-round budget.
|
|
178809
178811
|
|
|
178810
178812
|
**Reviewer quality matters:** The review node's output is only as good as the reviewer agent's judgment. For high-stakes code, add a second reviewer node or route to a human-in-the-loop step before the PASS verdict is accepted.
|
|
178811
178813
|
|
|
@@ -179547,6 +179549,7 @@ var init_catalog_generated = __esm(() => {
|
|
|
179547
179549
|
"SearchInput",
|
|
179548
179550
|
"Select",
|
|
179549
179551
|
"NumberInput",
|
|
179552
|
+
"Input",
|
|
179550
179553
|
"Button",
|
|
179551
179554
|
"Metric",
|
|
179552
179555
|
"Chart",
|
|
@@ -179582,12 +179585,21 @@ var init_catalog_generated = __esm(() => {
|
|
|
179582
179585
|
"SessionThread",
|
|
179583
179586
|
"PageFrame",
|
|
179584
179587
|
"ElementRef",
|
|
179588
|
+
"Svg",
|
|
179589
|
+
"Rect",
|
|
179590
|
+
"Line",
|
|
179591
|
+
"Path",
|
|
179592
|
+
"Circle",
|
|
179593
|
+
"SvgText",
|
|
179585
179594
|
"ElementSlot"
|
|
179586
179595
|
],
|
|
179587
179596
|
actionTypes: [
|
|
179588
179597
|
"swarm.sdk",
|
|
179589
179598
|
"swarm.call",
|
|
179590
179599
|
"ui.toast",
|
|
179600
|
+
"ui.set",
|
|
179601
|
+
"ui.focus",
|
|
179602
|
+
"ui.when",
|
|
179591
179603
|
"app.mutate",
|
|
179592
179604
|
"app.refresh",
|
|
179593
179605
|
"app.action",
|
|
@@ -180164,6 +180176,315 @@ var init_catalog_generated = __esm(() => {
|
|
|
180164
180176
|
additionalProperties: false
|
|
180165
180177
|
}
|
|
180166
180178
|
},
|
|
180179
|
+
Input: {
|
|
180180
|
+
description: 'Low-level text field. `value` binds two-way to page-local state: `{ "$bindState": "/local/<name>/..." }`, or `{ "$bindItem": "" }` inside a `repeat` over a `/local` list. `onInput` runs after every edit (`{ "$chain": "value" }` is the new text); `onPaste` replaces the browser paste (`{ "$chain": "text" }` is the clipboard text); `onKeyDown:<Key>` (Backspace, Delete, Enter, Escape, Tab, ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Home, End) replaces that key\'s default. `id` is what `ui.focus` targets. `size: "cell"` is a square one-character box; `selectOnFocus` selects the value so typing replaces it.',
|
|
180181
|
+
props: {
|
|
180182
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
180183
|
+
type: "object",
|
|
180184
|
+
properties: {
|
|
180185
|
+
id: {
|
|
180186
|
+
type: "string"
|
|
180187
|
+
},
|
|
180188
|
+
value: {
|
|
180189
|
+
type: "string"
|
|
180190
|
+
},
|
|
180191
|
+
label: {
|
|
180192
|
+
type: "string"
|
|
180193
|
+
},
|
|
180194
|
+
placeholder: {
|
|
180195
|
+
type: "string"
|
|
180196
|
+
},
|
|
180197
|
+
type: {
|
|
180198
|
+
type: "string",
|
|
180199
|
+
enum: ["text", "password"]
|
|
180200
|
+
},
|
|
180201
|
+
inputMode: {
|
|
180202
|
+
type: "string",
|
|
180203
|
+
enum: ["text", "numeric", "tel", "email", "url", "search"]
|
|
180204
|
+
},
|
|
180205
|
+
autoComplete: {
|
|
180206
|
+
type: "string",
|
|
180207
|
+
enum: ["off", "one-time-code"]
|
|
180208
|
+
},
|
|
180209
|
+
maxLength: {
|
|
180210
|
+
type: "integer",
|
|
180211
|
+
minimum: 1,
|
|
180212
|
+
maximum: 1e4
|
|
180213
|
+
},
|
|
180214
|
+
size: {
|
|
180215
|
+
type: "string",
|
|
180216
|
+
enum: ["default", "cell"]
|
|
180217
|
+
},
|
|
180218
|
+
selectOnFocus: {
|
|
180219
|
+
type: "boolean"
|
|
180220
|
+
},
|
|
180221
|
+
disabled: {
|
|
180222
|
+
type: "boolean"
|
|
180223
|
+
},
|
|
180224
|
+
onInput: {
|
|
180225
|
+
type: "array",
|
|
180226
|
+
items: {
|
|
180227
|
+
type: "object",
|
|
180228
|
+
properties: {
|
|
180229
|
+
action: {
|
|
180230
|
+
type: "string"
|
|
180231
|
+
},
|
|
180232
|
+
params: {
|
|
180233
|
+
type: "object",
|
|
180234
|
+
propertyNames: {
|
|
180235
|
+
type: "string"
|
|
180236
|
+
},
|
|
180237
|
+
additionalProperties: {}
|
|
180238
|
+
}
|
|
180239
|
+
},
|
|
180240
|
+
required: ["action"],
|
|
180241
|
+
additionalProperties: false
|
|
180242
|
+
}
|
|
180243
|
+
},
|
|
180244
|
+
onPaste: {
|
|
180245
|
+
type: "array",
|
|
180246
|
+
items: {
|
|
180247
|
+
type: "object",
|
|
180248
|
+
properties: {
|
|
180249
|
+
action: {
|
|
180250
|
+
type: "string"
|
|
180251
|
+
},
|
|
180252
|
+
params: {
|
|
180253
|
+
type: "object",
|
|
180254
|
+
propertyNames: {
|
|
180255
|
+
type: "string"
|
|
180256
|
+
},
|
|
180257
|
+
additionalProperties: {}
|
|
180258
|
+
}
|
|
180259
|
+
},
|
|
180260
|
+
required: ["action"],
|
|
180261
|
+
additionalProperties: false
|
|
180262
|
+
}
|
|
180263
|
+
},
|
|
180264
|
+
"onKeyDown:Backspace": {
|
|
180265
|
+
type: "array",
|
|
180266
|
+
items: {
|
|
180267
|
+
type: "object",
|
|
180268
|
+
properties: {
|
|
180269
|
+
action: {
|
|
180270
|
+
type: "string"
|
|
180271
|
+
},
|
|
180272
|
+
params: {
|
|
180273
|
+
type: "object",
|
|
180274
|
+
propertyNames: {
|
|
180275
|
+
type: "string"
|
|
180276
|
+
},
|
|
180277
|
+
additionalProperties: {}
|
|
180278
|
+
}
|
|
180279
|
+
},
|
|
180280
|
+
required: ["action"],
|
|
180281
|
+
additionalProperties: false
|
|
180282
|
+
}
|
|
180283
|
+
},
|
|
180284
|
+
"onKeyDown:Delete": {
|
|
180285
|
+
type: "array",
|
|
180286
|
+
items: {
|
|
180287
|
+
type: "object",
|
|
180288
|
+
properties: {
|
|
180289
|
+
action: {
|
|
180290
|
+
type: "string"
|
|
180291
|
+
},
|
|
180292
|
+
params: {
|
|
180293
|
+
type: "object",
|
|
180294
|
+
propertyNames: {
|
|
180295
|
+
type: "string"
|
|
180296
|
+
},
|
|
180297
|
+
additionalProperties: {}
|
|
180298
|
+
}
|
|
180299
|
+
},
|
|
180300
|
+
required: ["action"],
|
|
180301
|
+
additionalProperties: false
|
|
180302
|
+
}
|
|
180303
|
+
},
|
|
180304
|
+
"onKeyDown:Enter": {
|
|
180305
|
+
type: "array",
|
|
180306
|
+
items: {
|
|
180307
|
+
type: "object",
|
|
180308
|
+
properties: {
|
|
180309
|
+
action: {
|
|
180310
|
+
type: "string"
|
|
180311
|
+
},
|
|
180312
|
+
params: {
|
|
180313
|
+
type: "object",
|
|
180314
|
+
propertyNames: {
|
|
180315
|
+
type: "string"
|
|
180316
|
+
},
|
|
180317
|
+
additionalProperties: {}
|
|
180318
|
+
}
|
|
180319
|
+
},
|
|
180320
|
+
required: ["action"],
|
|
180321
|
+
additionalProperties: false
|
|
180322
|
+
}
|
|
180323
|
+
},
|
|
180324
|
+
"onKeyDown:Escape": {
|
|
180325
|
+
type: "array",
|
|
180326
|
+
items: {
|
|
180327
|
+
type: "object",
|
|
180328
|
+
properties: {
|
|
180329
|
+
action: {
|
|
180330
|
+
type: "string"
|
|
180331
|
+
},
|
|
180332
|
+
params: {
|
|
180333
|
+
type: "object",
|
|
180334
|
+
propertyNames: {
|
|
180335
|
+
type: "string"
|
|
180336
|
+
},
|
|
180337
|
+
additionalProperties: {}
|
|
180338
|
+
}
|
|
180339
|
+
},
|
|
180340
|
+
required: ["action"],
|
|
180341
|
+
additionalProperties: false
|
|
180342
|
+
}
|
|
180343
|
+
},
|
|
180344
|
+
"onKeyDown:Tab": {
|
|
180345
|
+
type: "array",
|
|
180346
|
+
items: {
|
|
180347
|
+
type: "object",
|
|
180348
|
+
properties: {
|
|
180349
|
+
action: {
|
|
180350
|
+
type: "string"
|
|
180351
|
+
},
|
|
180352
|
+
params: {
|
|
180353
|
+
type: "object",
|
|
180354
|
+
propertyNames: {
|
|
180355
|
+
type: "string"
|
|
180356
|
+
},
|
|
180357
|
+
additionalProperties: {}
|
|
180358
|
+
}
|
|
180359
|
+
},
|
|
180360
|
+
required: ["action"],
|
|
180361
|
+
additionalProperties: false
|
|
180362
|
+
}
|
|
180363
|
+
},
|
|
180364
|
+
"onKeyDown:ArrowLeft": {
|
|
180365
|
+
type: "array",
|
|
180366
|
+
items: {
|
|
180367
|
+
type: "object",
|
|
180368
|
+
properties: {
|
|
180369
|
+
action: {
|
|
180370
|
+
type: "string"
|
|
180371
|
+
},
|
|
180372
|
+
params: {
|
|
180373
|
+
type: "object",
|
|
180374
|
+
propertyNames: {
|
|
180375
|
+
type: "string"
|
|
180376
|
+
},
|
|
180377
|
+
additionalProperties: {}
|
|
180378
|
+
}
|
|
180379
|
+
},
|
|
180380
|
+
required: ["action"],
|
|
180381
|
+
additionalProperties: false
|
|
180382
|
+
}
|
|
180383
|
+
},
|
|
180384
|
+
"onKeyDown:ArrowRight": {
|
|
180385
|
+
type: "array",
|
|
180386
|
+
items: {
|
|
180387
|
+
type: "object",
|
|
180388
|
+
properties: {
|
|
180389
|
+
action: {
|
|
180390
|
+
type: "string"
|
|
180391
|
+
},
|
|
180392
|
+
params: {
|
|
180393
|
+
type: "object",
|
|
180394
|
+
propertyNames: {
|
|
180395
|
+
type: "string"
|
|
180396
|
+
},
|
|
180397
|
+
additionalProperties: {}
|
|
180398
|
+
}
|
|
180399
|
+
},
|
|
180400
|
+
required: ["action"],
|
|
180401
|
+
additionalProperties: false
|
|
180402
|
+
}
|
|
180403
|
+
},
|
|
180404
|
+
"onKeyDown:ArrowUp": {
|
|
180405
|
+
type: "array",
|
|
180406
|
+
items: {
|
|
180407
|
+
type: "object",
|
|
180408
|
+
properties: {
|
|
180409
|
+
action: {
|
|
180410
|
+
type: "string"
|
|
180411
|
+
},
|
|
180412
|
+
params: {
|
|
180413
|
+
type: "object",
|
|
180414
|
+
propertyNames: {
|
|
180415
|
+
type: "string"
|
|
180416
|
+
},
|
|
180417
|
+
additionalProperties: {}
|
|
180418
|
+
}
|
|
180419
|
+
},
|
|
180420
|
+
required: ["action"],
|
|
180421
|
+
additionalProperties: false
|
|
180422
|
+
}
|
|
180423
|
+
},
|
|
180424
|
+
"onKeyDown:ArrowDown": {
|
|
180425
|
+
type: "array",
|
|
180426
|
+
items: {
|
|
180427
|
+
type: "object",
|
|
180428
|
+
properties: {
|
|
180429
|
+
action: {
|
|
180430
|
+
type: "string"
|
|
180431
|
+
},
|
|
180432
|
+
params: {
|
|
180433
|
+
type: "object",
|
|
180434
|
+
propertyNames: {
|
|
180435
|
+
type: "string"
|
|
180436
|
+
},
|
|
180437
|
+
additionalProperties: {}
|
|
180438
|
+
}
|
|
180439
|
+
},
|
|
180440
|
+
required: ["action"],
|
|
180441
|
+
additionalProperties: false
|
|
180442
|
+
}
|
|
180443
|
+
},
|
|
180444
|
+
"onKeyDown:Home": {
|
|
180445
|
+
type: "array",
|
|
180446
|
+
items: {
|
|
180447
|
+
type: "object",
|
|
180448
|
+
properties: {
|
|
180449
|
+
action: {
|
|
180450
|
+
type: "string"
|
|
180451
|
+
},
|
|
180452
|
+
params: {
|
|
180453
|
+
type: "object",
|
|
180454
|
+
propertyNames: {
|
|
180455
|
+
type: "string"
|
|
180456
|
+
},
|
|
180457
|
+
additionalProperties: {}
|
|
180458
|
+
}
|
|
180459
|
+
},
|
|
180460
|
+
required: ["action"],
|
|
180461
|
+
additionalProperties: false
|
|
180462
|
+
}
|
|
180463
|
+
},
|
|
180464
|
+
"onKeyDown:End": {
|
|
180465
|
+
type: "array",
|
|
180466
|
+
items: {
|
|
180467
|
+
type: "object",
|
|
180468
|
+
properties: {
|
|
180469
|
+
action: {
|
|
180470
|
+
type: "string"
|
|
180471
|
+
},
|
|
180472
|
+
params: {
|
|
180473
|
+
type: "object",
|
|
180474
|
+
propertyNames: {
|
|
180475
|
+
type: "string"
|
|
180476
|
+
},
|
|
180477
|
+
additionalProperties: {}
|
|
180478
|
+
}
|
|
180479
|
+
},
|
|
180480
|
+
required: ["action"],
|
|
180481
|
+
additionalProperties: false
|
|
180482
|
+
}
|
|
180483
|
+
}
|
|
180484
|
+
},
|
|
180485
|
+
additionalProperties: false
|
|
180486
|
+
}
|
|
180487
|
+
},
|
|
180167
180488
|
Button: {
|
|
180168
180489
|
description: 'Interactive button. Wire to actions via `on.press`. `variant: "destructive-outline"` is the canonical red-outlined destructive look (standalone deletes should use it, not solid red). `disabled` accepts a constant or a bound boolean; `busyWith: "<actionName>"` swaps the label for a spinner (presses ignored) while that custom action is running, then shows a check plus `successLabel` for ~1.5s when it finishes ok. `icon` + `iconPosition` (start|end) add an icon from the curated set; `size` sm|default|lg. `shortcut` (one key, e.g. `"n"`) shows a keycap inside the button and presses it from anywhere on the page (not while typing in a field, not with Ctrl/Cmd/Alt). `hint` is a hover tooltip.',
|
|
180169
180490
|
props: {
|
|
@@ -183105,6 +183426,364 @@ var init_catalog_generated = __esm(() => {
|
|
|
183105
183426
|
additionalProperties: false
|
|
183106
183427
|
}
|
|
183107
183428
|
},
|
|
183429
|
+
Svg: {
|
|
183430
|
+
description: 'Vector drawing, `width` x `height` user units, scaled to its container width. Children are Rect, Line, Path, Circle, SvgText or a nested Svg (a group: put `repeat` on it to draw one set of shapes per item, offset by `x`/`y`). Every numeric attribute accepts an expression, e.g. a Gantt bar `x: { "$mul": [{ "$item": "start" }, 20] }`. Colors are palette tokens only.',
|
|
183431
|
+
slots: ["default"],
|
|
183432
|
+
props: {
|
|
183433
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183434
|
+
type: "object",
|
|
183435
|
+
properties: {
|
|
183436
|
+
width: {
|
|
183437
|
+
type: "number",
|
|
183438
|
+
exclusiveMinimum: 0,
|
|
183439
|
+
maximum: 1e4
|
|
183440
|
+
},
|
|
183441
|
+
height: {
|
|
183442
|
+
type: "number",
|
|
183443
|
+
exclusiveMinimum: 0,
|
|
183444
|
+
maximum: 1e4
|
|
183445
|
+
},
|
|
183446
|
+
x: {
|
|
183447
|
+
type: "number"
|
|
183448
|
+
},
|
|
183449
|
+
y: {
|
|
183450
|
+
type: "number"
|
|
183451
|
+
},
|
|
183452
|
+
label: {
|
|
183453
|
+
type: "string"
|
|
183454
|
+
}
|
|
183455
|
+
},
|
|
183456
|
+
additionalProperties: false
|
|
183457
|
+
}
|
|
183458
|
+
},
|
|
183459
|
+
Rect: {
|
|
183460
|
+
description: "Rectangle inside an Svg. `rx` rounds corners; `title` is a hover tooltip.",
|
|
183461
|
+
props: {
|
|
183462
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183463
|
+
type: "object",
|
|
183464
|
+
properties: {
|
|
183465
|
+
x: {
|
|
183466
|
+
type: "number"
|
|
183467
|
+
},
|
|
183468
|
+
y: {
|
|
183469
|
+
type: "number"
|
|
183470
|
+
},
|
|
183471
|
+
width: {
|
|
183472
|
+
type: "number"
|
|
183473
|
+
},
|
|
183474
|
+
height: {
|
|
183475
|
+
type: "number"
|
|
183476
|
+
},
|
|
183477
|
+
rx: {
|
|
183478
|
+
type: "number",
|
|
183479
|
+
minimum: 0
|
|
183480
|
+
},
|
|
183481
|
+
fill: {
|
|
183482
|
+
type: "string",
|
|
183483
|
+
enum: [
|
|
183484
|
+
"chart-1",
|
|
183485
|
+
"chart-2",
|
|
183486
|
+
"chart-3",
|
|
183487
|
+
"chart-4",
|
|
183488
|
+
"chart-5",
|
|
183489
|
+
"primary",
|
|
183490
|
+
"success",
|
|
183491
|
+
"warning",
|
|
183492
|
+
"error",
|
|
183493
|
+
"info",
|
|
183494
|
+
"muted",
|
|
183495
|
+
"foreground",
|
|
183496
|
+
"background",
|
|
183497
|
+
"border",
|
|
183498
|
+
"none"
|
|
183499
|
+
]
|
|
183500
|
+
},
|
|
183501
|
+
stroke: {
|
|
183502
|
+
type: "string",
|
|
183503
|
+
enum: [
|
|
183504
|
+
"chart-1",
|
|
183505
|
+
"chart-2",
|
|
183506
|
+
"chart-3",
|
|
183507
|
+
"chart-4",
|
|
183508
|
+
"chart-5",
|
|
183509
|
+
"primary",
|
|
183510
|
+
"success",
|
|
183511
|
+
"warning",
|
|
183512
|
+
"error",
|
|
183513
|
+
"info",
|
|
183514
|
+
"muted",
|
|
183515
|
+
"foreground",
|
|
183516
|
+
"background",
|
|
183517
|
+
"border",
|
|
183518
|
+
"none"
|
|
183519
|
+
]
|
|
183520
|
+
},
|
|
183521
|
+
strokeWidth: {
|
|
183522
|
+
type: "number",
|
|
183523
|
+
minimum: 0,
|
|
183524
|
+
maximum: 100
|
|
183525
|
+
},
|
|
183526
|
+
opacity: {
|
|
183527
|
+
type: "number",
|
|
183528
|
+
minimum: 0,
|
|
183529
|
+
maximum: 1
|
|
183530
|
+
},
|
|
183531
|
+
title: {
|
|
183532
|
+
type: "string"
|
|
183533
|
+
}
|
|
183534
|
+
},
|
|
183535
|
+
required: ["x", "y", "width", "height"],
|
|
183536
|
+
additionalProperties: false
|
|
183537
|
+
}
|
|
183538
|
+
},
|
|
183539
|
+
Line: {
|
|
183540
|
+
description: "Line inside an Svg, from (x1, y1) to (x2, y2). `dashed` draws it dashed.",
|
|
183541
|
+
props: {
|
|
183542
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183543
|
+
type: "object",
|
|
183544
|
+
properties: {
|
|
183545
|
+
x1: {
|
|
183546
|
+
type: "number"
|
|
183547
|
+
},
|
|
183548
|
+
y1: {
|
|
183549
|
+
type: "number"
|
|
183550
|
+
},
|
|
183551
|
+
x2: {
|
|
183552
|
+
type: "number"
|
|
183553
|
+
},
|
|
183554
|
+
y2: {
|
|
183555
|
+
type: "number"
|
|
183556
|
+
},
|
|
183557
|
+
dashed: {
|
|
183558
|
+
type: "boolean"
|
|
183559
|
+
},
|
|
183560
|
+
stroke: {
|
|
183561
|
+
type: "string",
|
|
183562
|
+
enum: [
|
|
183563
|
+
"chart-1",
|
|
183564
|
+
"chart-2",
|
|
183565
|
+
"chart-3",
|
|
183566
|
+
"chart-4",
|
|
183567
|
+
"chart-5",
|
|
183568
|
+
"primary",
|
|
183569
|
+
"success",
|
|
183570
|
+
"warning",
|
|
183571
|
+
"error",
|
|
183572
|
+
"info",
|
|
183573
|
+
"muted",
|
|
183574
|
+
"foreground",
|
|
183575
|
+
"background",
|
|
183576
|
+
"border",
|
|
183577
|
+
"none"
|
|
183578
|
+
]
|
|
183579
|
+
},
|
|
183580
|
+
strokeWidth: {
|
|
183581
|
+
type: "number",
|
|
183582
|
+
minimum: 0,
|
|
183583
|
+
maximum: 100
|
|
183584
|
+
},
|
|
183585
|
+
opacity: {
|
|
183586
|
+
type: "number",
|
|
183587
|
+
minimum: 0,
|
|
183588
|
+
maximum: 1
|
|
183589
|
+
}
|
|
183590
|
+
},
|
|
183591
|
+
required: ["x1", "y1", "x2", "y2"],
|
|
183592
|
+
additionalProperties: false
|
|
183593
|
+
}
|
|
183594
|
+
},
|
|
183595
|
+
Path: {
|
|
183596
|
+
description: "SVG path inside an Svg. `d` holds path commands and numbers only.",
|
|
183597
|
+
props: {
|
|
183598
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183599
|
+
type: "object",
|
|
183600
|
+
properties: {
|
|
183601
|
+
d: {
|
|
183602
|
+
type: "string",
|
|
183603
|
+
maxLength: 1e4
|
|
183604
|
+
},
|
|
183605
|
+
fill: {
|
|
183606
|
+
type: "string",
|
|
183607
|
+
enum: [
|
|
183608
|
+
"chart-1",
|
|
183609
|
+
"chart-2",
|
|
183610
|
+
"chart-3",
|
|
183611
|
+
"chart-4",
|
|
183612
|
+
"chart-5",
|
|
183613
|
+
"primary",
|
|
183614
|
+
"success",
|
|
183615
|
+
"warning",
|
|
183616
|
+
"error",
|
|
183617
|
+
"info",
|
|
183618
|
+
"muted",
|
|
183619
|
+
"foreground",
|
|
183620
|
+
"background",
|
|
183621
|
+
"border",
|
|
183622
|
+
"none"
|
|
183623
|
+
]
|
|
183624
|
+
},
|
|
183625
|
+
stroke: {
|
|
183626
|
+
type: "string",
|
|
183627
|
+
enum: [
|
|
183628
|
+
"chart-1",
|
|
183629
|
+
"chart-2",
|
|
183630
|
+
"chart-3",
|
|
183631
|
+
"chart-4",
|
|
183632
|
+
"chart-5",
|
|
183633
|
+
"primary",
|
|
183634
|
+
"success",
|
|
183635
|
+
"warning",
|
|
183636
|
+
"error",
|
|
183637
|
+
"info",
|
|
183638
|
+
"muted",
|
|
183639
|
+
"foreground",
|
|
183640
|
+
"background",
|
|
183641
|
+
"border",
|
|
183642
|
+
"none"
|
|
183643
|
+
]
|
|
183644
|
+
},
|
|
183645
|
+
strokeWidth: {
|
|
183646
|
+
type: "number",
|
|
183647
|
+
minimum: 0,
|
|
183648
|
+
maximum: 100
|
|
183649
|
+
},
|
|
183650
|
+
opacity: {
|
|
183651
|
+
type: "number",
|
|
183652
|
+
minimum: 0,
|
|
183653
|
+
maximum: 1
|
|
183654
|
+
}
|
|
183655
|
+
},
|
|
183656
|
+
required: ["d"],
|
|
183657
|
+
additionalProperties: false
|
|
183658
|
+
}
|
|
183659
|
+
},
|
|
183660
|
+
Circle: {
|
|
183661
|
+
description: "Circle inside an Svg, centered at (cx, cy) with radius `r`.",
|
|
183662
|
+
props: {
|
|
183663
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183664
|
+
type: "object",
|
|
183665
|
+
properties: {
|
|
183666
|
+
cx: {
|
|
183667
|
+
type: "number"
|
|
183668
|
+
},
|
|
183669
|
+
cy: {
|
|
183670
|
+
type: "number"
|
|
183671
|
+
},
|
|
183672
|
+
r: {
|
|
183673
|
+
type: "number",
|
|
183674
|
+
minimum: 0
|
|
183675
|
+
},
|
|
183676
|
+
fill: {
|
|
183677
|
+
type: "string",
|
|
183678
|
+
enum: [
|
|
183679
|
+
"chart-1",
|
|
183680
|
+
"chart-2",
|
|
183681
|
+
"chart-3",
|
|
183682
|
+
"chart-4",
|
|
183683
|
+
"chart-5",
|
|
183684
|
+
"primary",
|
|
183685
|
+
"success",
|
|
183686
|
+
"warning",
|
|
183687
|
+
"error",
|
|
183688
|
+
"info",
|
|
183689
|
+
"muted",
|
|
183690
|
+
"foreground",
|
|
183691
|
+
"background",
|
|
183692
|
+
"border",
|
|
183693
|
+
"none"
|
|
183694
|
+
]
|
|
183695
|
+
},
|
|
183696
|
+
stroke: {
|
|
183697
|
+
type: "string",
|
|
183698
|
+
enum: [
|
|
183699
|
+
"chart-1",
|
|
183700
|
+
"chart-2",
|
|
183701
|
+
"chart-3",
|
|
183702
|
+
"chart-4",
|
|
183703
|
+
"chart-5",
|
|
183704
|
+
"primary",
|
|
183705
|
+
"success",
|
|
183706
|
+
"warning",
|
|
183707
|
+
"error",
|
|
183708
|
+
"info",
|
|
183709
|
+
"muted",
|
|
183710
|
+
"foreground",
|
|
183711
|
+
"background",
|
|
183712
|
+
"border",
|
|
183713
|
+
"none"
|
|
183714
|
+
]
|
|
183715
|
+
},
|
|
183716
|
+
strokeWidth: {
|
|
183717
|
+
type: "number",
|
|
183718
|
+
minimum: 0,
|
|
183719
|
+
maximum: 100
|
|
183720
|
+
},
|
|
183721
|
+
opacity: {
|
|
183722
|
+
type: "number",
|
|
183723
|
+
minimum: 0,
|
|
183724
|
+
maximum: 1
|
|
183725
|
+
},
|
|
183726
|
+
title: {
|
|
183727
|
+
type: "string"
|
|
183728
|
+
}
|
|
183729
|
+
},
|
|
183730
|
+
required: ["cx", "cy", "r"],
|
|
183731
|
+
additionalProperties: false
|
|
183732
|
+
}
|
|
183733
|
+
},
|
|
183734
|
+
SvgText: {
|
|
183735
|
+
description: "Text label inside an Svg at (x, y). `anchor` start|middle|end aligns it horizontally; `size` is the font size in user units.",
|
|
183736
|
+
props: {
|
|
183737
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183738
|
+
type: "object",
|
|
183739
|
+
properties: {
|
|
183740
|
+
x: {
|
|
183741
|
+
type: "number"
|
|
183742
|
+
},
|
|
183743
|
+
y: {
|
|
183744
|
+
type: "number"
|
|
183745
|
+
},
|
|
183746
|
+
text: {
|
|
183747
|
+
type: "string"
|
|
183748
|
+
},
|
|
183749
|
+
anchor: {
|
|
183750
|
+
type: "string",
|
|
183751
|
+
enum: ["start", "middle", "end"]
|
|
183752
|
+
},
|
|
183753
|
+
size: {
|
|
183754
|
+
type: "number",
|
|
183755
|
+
minimum: 6,
|
|
183756
|
+
maximum: 96
|
|
183757
|
+
},
|
|
183758
|
+
weight: {
|
|
183759
|
+
type: "string",
|
|
183760
|
+
enum: ["normal", "bold"]
|
|
183761
|
+
},
|
|
183762
|
+
fill: {
|
|
183763
|
+
type: "string",
|
|
183764
|
+
enum: [
|
|
183765
|
+
"chart-1",
|
|
183766
|
+
"chart-2",
|
|
183767
|
+
"chart-3",
|
|
183768
|
+
"chart-4",
|
|
183769
|
+
"chart-5",
|
|
183770
|
+
"primary",
|
|
183771
|
+
"success",
|
|
183772
|
+
"warning",
|
|
183773
|
+
"error",
|
|
183774
|
+
"info",
|
|
183775
|
+
"muted",
|
|
183776
|
+
"foreground",
|
|
183777
|
+
"background",
|
|
183778
|
+
"border",
|
|
183779
|
+
"none"
|
|
183780
|
+
]
|
|
183781
|
+
}
|
|
183782
|
+
},
|
|
183783
|
+
required: ["x", "y", "text"],
|
|
183784
|
+
additionalProperties: false
|
|
183785
|
+
}
|
|
183786
|
+
},
|
|
183108
183787
|
ElementSlot: {
|
|
183109
183788
|
description: "Leaf insertion point for children supplied by an ElementRef consumer.",
|
|
183110
183789
|
props: {
|
|
@@ -183248,6 +183927,55 @@ var init_catalog_generated = __esm(() => {
|
|
|
183248
183927
|
additionalProperties: false
|
|
183249
183928
|
}
|
|
183250
183929
|
},
|
|
183930
|
+
"ui.set": {
|
|
183931
|
+
description: 'Write `value` to a page-local state path (`/local/<name>/...`, declared in the page `state`). `path` may be an expression, e.g. `{ "$join": [["/local/otp", { "$index": true }], "/"] }`.',
|
|
183932
|
+
params: {
|
|
183933
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183934
|
+
type: "object",
|
|
183935
|
+
properties: {
|
|
183936
|
+
path: {
|
|
183937
|
+
type: "string"
|
|
183938
|
+
},
|
|
183939
|
+
value: {}
|
|
183940
|
+
},
|
|
183941
|
+
required: ["path", "value"],
|
|
183942
|
+
additionalProperties: false
|
|
183943
|
+
}
|
|
183944
|
+
},
|
|
183945
|
+
"ui.focus": {
|
|
183946
|
+
description: 'Focus the Input whose `id` matches. Inside a `repeat`, pass the item `index` (an expression such as `{ "$add": [{ "$index": true }, 1] }` moves to the next cell); a missing target is a no-op.',
|
|
183947
|
+
params: {
|
|
183948
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183949
|
+
type: "object",
|
|
183950
|
+
properties: {
|
|
183951
|
+
id: {
|
|
183952
|
+
type: "string"
|
|
183953
|
+
},
|
|
183954
|
+
index: {
|
|
183955
|
+
type: "integer",
|
|
183956
|
+
minimum: -9007199254740991,
|
|
183957
|
+
maximum: 9007199254740991
|
|
183958
|
+
}
|
|
183959
|
+
},
|
|
183960
|
+
required: ["id"],
|
|
183961
|
+
additionalProperties: false
|
|
183962
|
+
}
|
|
183963
|
+
},
|
|
183964
|
+
"ui.when": {
|
|
183965
|
+
description: "Guard: the chain continues only when `value` equals `eq` (or is truthy when `eq` is omitted); otherwise the rest of the chain is skipped quietly.",
|
|
183966
|
+
params: {
|
|
183967
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
183968
|
+
type: "object",
|
|
183969
|
+
properties: {
|
|
183970
|
+
value: {},
|
|
183971
|
+
eq: {
|
|
183972
|
+
type: ["string", "number", "boolean", "null"]
|
|
183973
|
+
}
|
|
183974
|
+
},
|
|
183975
|
+
required: ["value"],
|
|
183976
|
+
additionalProperties: false
|
|
183977
|
+
}
|
|
183978
|
+
},
|
|
183251
183979
|
"app.mutate": {
|
|
183252
183980
|
description: "Create / update / delete a swarm-app row, then refetch every named query on the same model.",
|
|
183253
183981
|
params: {
|
|
@@ -183461,6 +184189,18 @@ function collectRepeatBindingPaths(value, path, paths) {
|
|
|
183461
184189
|
collectRepeatBindingPaths(child, appendPath(path, key), paths);
|
|
183462
184190
|
}
|
|
183463
184191
|
}
|
|
184192
|
+
function expressionOp(value) {
|
|
184193
|
+
if (!isPlainObject(value))
|
|
184194
|
+
return null;
|
|
184195
|
+
const keys = Object.keys(value);
|
|
184196
|
+
return keys.length === 1 && Object.hasOwn(EXPRESSION_ARITY, keys[0]) ? keys[0] : null;
|
|
184197
|
+
}
|
|
184198
|
+
function isBindStateBinding(value) {
|
|
184199
|
+
return isPlainObject(value) && Object.keys(value).length === 1 && typeof value.$bindState === "string";
|
|
184200
|
+
}
|
|
184201
|
+
function isBindItemBinding(value) {
|
|
184202
|
+
return isPlainObject(value) && Object.keys(value).length === 1 && typeof value.$bindItem === "string";
|
|
184203
|
+
}
|
|
183464
184204
|
function isActionSentinel(value) {
|
|
183465
184205
|
if (!isPlainObject(value) || Object.keys(value).length !== 1)
|
|
183466
184206
|
return false;
|
|
@@ -183522,6 +184262,31 @@ function validateSchema(value, schema, path, allowActionSentinels, skipPath) {
|
|
|
183522
184262
|
}
|
|
183523
184263
|
if (isRepeatBinding(value))
|
|
183524
184264
|
return { issues: [], stateRefs: [] };
|
|
184265
|
+
if (isBindStateBinding(value) || isBindItemBinding(value)) {
|
|
184266
|
+
return {
|
|
184267
|
+
issues: [issue(path, "$bindState and $bindItem are only allowed on Input.value")],
|
|
184268
|
+
stateRefs: []
|
|
184269
|
+
};
|
|
184270
|
+
}
|
|
184271
|
+
const op = expressionOp(value);
|
|
184272
|
+
if (op) {
|
|
184273
|
+
const operands = value[op];
|
|
184274
|
+
const [min, max] = EXPRESSION_ARITY[op];
|
|
184275
|
+
if (!Array.isArray(operands) || operands.length < min || operands.length > max) {
|
|
184276
|
+
const count = min === max ? `${min}` : max === Infinity ? `at least ${min}` : `${min}-${max}`;
|
|
184277
|
+
return {
|
|
184278
|
+
issues: [issue(appendPath(path, op), `must be an array of ${count} operand(s)`)],
|
|
184279
|
+
stateRefs: []
|
|
184280
|
+
};
|
|
184281
|
+
}
|
|
184282
|
+
const result = { issues: [], stateRefs: [] };
|
|
184283
|
+
for (const [index, operand] of operands.entries()) {
|
|
184284
|
+
const operandResult = validateSchema(operand, {}, appendPath(appendPath(path, op), index), allowActionSentinels);
|
|
184285
|
+
result.issues.push(...operandResult.issues);
|
|
184286
|
+
result.stateRefs.push(...operandResult.stateRefs);
|
|
184287
|
+
}
|
|
184288
|
+
return result;
|
|
184289
|
+
}
|
|
183525
184290
|
if (isActionSentinel(value)) {
|
|
183526
184291
|
return allowActionSentinels ? { issues: [], stateRefs: [] } : {
|
|
183527
184292
|
issues: [
|
|
@@ -183684,6 +184449,16 @@ function actionParams(step, path, definition, catalog, validateNavigation = fals
|
|
|
183684
184449
|
result.issues.push(issue(appendPath(sessionPath, "scope"), 'scope "shared" is not supported yet'));
|
|
183685
184450
|
}
|
|
183686
184451
|
}
|
|
184452
|
+
} else if (step.action === "ui.set") {
|
|
184453
|
+
if (typeof params.path === "string") {
|
|
184454
|
+
result.stateRefs.push({
|
|
184455
|
+
path: appendPath(paramsPath, "path"),
|
|
184456
|
+
value: params.path,
|
|
184457
|
+
write: true
|
|
184458
|
+
});
|
|
184459
|
+
} else if (!expressionOp(params.path)) {
|
|
184460
|
+
result.issues.push(issue(appendPath(paramsPath, "path"), "must be a /local/<name> path or an expression"));
|
|
184461
|
+
}
|
|
183687
184462
|
} else if (step.action === "ui.toast") {
|
|
183688
184463
|
const undo = toastUndoChain(step);
|
|
183689
184464
|
if (Array.isArray(undo)) {
|
|
@@ -183727,7 +184502,18 @@ function validateActionMap(value, path, definition, catalog, allowSingle) {
|
|
|
183727
184502
|
}
|
|
183728
184503
|
return result;
|
|
183729
184504
|
}
|
|
183730
|
-
function validateStateRef(ref, definition, formIds, uiIds, pageParams) {
|
|
184505
|
+
function validateStateRef(ref, definition, formIds, uiIds, pageParams, pageState) {
|
|
184506
|
+
const localMatch = /^\/local\/([^/]+)(?:\/.*)?$/.exec(ref.value);
|
|
184507
|
+
if (localMatch) {
|
|
184508
|
+
const name = localMatch[1];
|
|
184509
|
+
if (!Object.hasOwn(pageState, name)) {
|
|
184510
|
+
return issue(ref.path, `state reference targets undeclared page state "${name}"; declare it in the page's \`state\``);
|
|
184511
|
+
}
|
|
184512
|
+
return ref.value.split("/").some((segment) => RESERVED_UI_IDS.has(segment)) ? issue(ref.path, `invalid state reference "${ref.value}"`) : null;
|
|
184513
|
+
}
|
|
184514
|
+
if (ref.write) {
|
|
184515
|
+
return issue(ref.path, `only page-local /local/<name> state is writable (got "${ref.value}")`);
|
|
184516
|
+
}
|
|
183731
184517
|
if (ref.value === "/route/page")
|
|
183732
184518
|
return null;
|
|
183733
184519
|
const routeParam = /^\/route\/params\/([^/]+)$/.exec(ref.value);
|
|
@@ -184388,6 +185174,9 @@ function validatePage(definition, catalog, target) {
|
|
|
184388
185174
|
const page = options?.tree ?? definition.pages[pageName];
|
|
184389
185175
|
const pagePath = options?.path ?? appendPath("pages", pageName);
|
|
184390
185176
|
const pageParams = pageName ? definition.pages[pageName]?.params ?? {} : {};
|
|
185177
|
+
const pageState = pageName ? definition.pages[pageName]?.state ?? {} : {};
|
|
185178
|
+
const inputIds = new Set;
|
|
185179
|
+
const bindItemPaths = [];
|
|
184391
185180
|
const elementsPath = appendPath(pagePath, "elements");
|
|
184392
185181
|
const root = page.root;
|
|
184393
185182
|
const elements = page.elements;
|
|
@@ -184433,7 +185222,17 @@ function validatePage(definition, catalog, target) {
|
|
|
184433
185222
|
if (component) {
|
|
184434
185223
|
const propsPath = appendPath(elementPath, "props");
|
|
184435
185224
|
const itemChainPaths = new Set(isPlainObject(rawElement.props) ? itemActionChains(type, rawElement.props, propsPath).map(({ path }) => path) : []);
|
|
184436
|
-
const
|
|
185225
|
+
const inputValue = type === "Input" && isPlainObject(rawElement.props) ? rawElement.props.value : undefined;
|
|
185226
|
+
const boundInputValue = isBindStateBinding(inputValue) || isBindItemBinding(inputValue);
|
|
185227
|
+
const actionChainPath = (path) => (PROP_ACTION_CHAINS[String(type)] ?? []).some((prop) => path === `${propsPath}.${prop}`) || itemChainPaths.has(path) || boundInputValue && path === `${propsPath}.value`;
|
|
185228
|
+
if (isBindStateBinding(inputValue)) {
|
|
185229
|
+
stateRefs.push({ path: `${propsPath}.value`, value: inputValue.$bindState, write: true });
|
|
185230
|
+
} else if (isBindItemBinding(inputValue)) {
|
|
185231
|
+
bindItemPaths.push({ elementId, path: `${propsPath}.value` });
|
|
185232
|
+
}
|
|
185233
|
+
if (type === "Input" && isPlainObject(rawElement.props) && typeof rawElement.props.id === "string") {
|
|
185234
|
+
inputIds.add(rawElement.props.id);
|
|
185235
|
+
}
|
|
184437
185236
|
const propsResult = validateSchema(Object.hasOwn(rawElement, "props") ? rawElement.props : {}, component.props, propsPath, false, actionChainPath);
|
|
184438
185237
|
issues.push(...propsResult.issues);
|
|
184439
185238
|
stateRefs.push(...propsResult.stateRefs);
|
|
@@ -184688,6 +185487,64 @@ function validatePage(definition, catalog, target) {
|
|
|
184688
185487
|
}
|
|
184689
185488
|
}
|
|
184690
185489
|
}
|
|
185490
|
+
for (const { elementId, path } of bindItemPaths) {
|
|
185491
|
+
let parentId = parentByChild.get(elementId);
|
|
185492
|
+
const seen = new Set;
|
|
185493
|
+
let repeatPath;
|
|
185494
|
+
while (parentId && !seen.has(parentId)) {
|
|
185495
|
+
seen.add(parentId);
|
|
185496
|
+
const parent = elements[parentId];
|
|
185497
|
+
if (isPlainObject(parent) && isPlainObject(parent.repeat)) {
|
|
185498
|
+
repeatPath = parent.repeat.statePath;
|
|
185499
|
+
break;
|
|
185500
|
+
}
|
|
185501
|
+
parentId = parentByChild.get(parentId);
|
|
185502
|
+
}
|
|
185503
|
+
if (typeof repeatPath !== "string") {
|
|
185504
|
+
issues.push(issue(path, "$bindItem is only allowed inside a repeated element"));
|
|
185505
|
+
} else {
|
|
185506
|
+
stateRefs.push({ path, value: repeatPath, write: true });
|
|
185507
|
+
}
|
|
185508
|
+
}
|
|
185509
|
+
for (const [elementId, rawElement] of elementEntries) {
|
|
185510
|
+
if (!isPlainObject(rawElement))
|
|
185511
|
+
continue;
|
|
185512
|
+
const elementPath = `${elementsPath}.${elementId}`;
|
|
185513
|
+
const parent = elements[parentByChild.get(elementId) ?? ""];
|
|
185514
|
+
const parentType = isPlainObject(parent) ? parent.type : undefined;
|
|
185515
|
+
if (typeof rawElement.type === "string" && SVG_SHAPES.has(rawElement.type)) {
|
|
185516
|
+
if (parentType !== "Svg") {
|
|
185517
|
+
issues.push(issue(appendPath(elementPath, "type"), `${rawElement.type} must be a child of an Svg`));
|
|
185518
|
+
}
|
|
185519
|
+
}
|
|
185520
|
+
if (rawElement.type === "Svg" && parentType !== "Svg") {
|
|
185521
|
+
const props = isPlainObject(rawElement.props) ? rawElement.props : {};
|
|
185522
|
+
for (const key of ["width", "height"]) {
|
|
185523
|
+
if (props[key] === undefined) {
|
|
185524
|
+
issues.push(issue(`${elementPath}.props.${key}`, "is required on an outer Svg"));
|
|
185525
|
+
}
|
|
185526
|
+
}
|
|
185527
|
+
}
|
|
185528
|
+
if (rawElement.type === "Svg" && Array.isArray(rawElement.children)) {
|
|
185529
|
+
for (const [index, child] of rawElement.children.entries()) {
|
|
185530
|
+
const childType = isPlainObject(elements[String(child)]) ? elements[String(child)].type : undefined;
|
|
185531
|
+
if (typeof childType === "string" && childType !== "Svg" && !SVG_SHAPES.has(childType)) {
|
|
185532
|
+
issues.push(issue(`${elementPath}.children.${index}`, `Svg children must be Rect, Line, Path, Circle, SvgText or Svg (got ${childType})`));
|
|
185533
|
+
}
|
|
185534
|
+
}
|
|
185535
|
+
}
|
|
185536
|
+
if (rawElement.type === "Path" && isPlainObject(rawElement.props) && typeof rawElement.props.d === "string" && !SVG_PATH_DATA.test(rawElement.props.d)) {
|
|
185537
|
+
issues.push(issue(`${elementPath}.props.d`, "must hold SVG path commands and numbers only"));
|
|
185538
|
+
}
|
|
185539
|
+
}
|
|
185540
|
+
visitPageActionSteps(page, pagePath, (step, path) => {
|
|
185541
|
+
if (step.action !== "ui.focus" || !isPlainObject(step.params))
|
|
185542
|
+
return;
|
|
185543
|
+
const id = step.params.id;
|
|
185544
|
+
if (typeof id === "string" && !inputIds.has(id)) {
|
|
185545
|
+
issues.push(issue(`${path}.params.id`, `no Input with id "${id}" on this page`));
|
|
185546
|
+
}
|
|
185547
|
+
});
|
|
184691
185548
|
const visited = new Set;
|
|
184692
185549
|
const visiting = new Set;
|
|
184693
185550
|
const visit = (elementId) => {
|
|
@@ -184746,21 +185603,23 @@ function validatePage(definition, catalog, target) {
|
|
|
184746
185603
|
const propMatch = /^\/props\/([^/]+)(?:\/.*)?$/.exec(ref.value);
|
|
184747
185604
|
const userConfigRef = ref.value === "/user" || ref.value.startsWith("/user/");
|
|
184748
185605
|
let stateIssue;
|
|
184749
|
-
if (options?.elementMode &&
|
|
185606
|
+
if (options?.elementMode && ref.write) {
|
|
185607
|
+
stateIssue = issue(ref.path, `${options.elementMode} elements cannot write state; bind page-local state at page level`);
|
|
185608
|
+
} else if (options?.elementMode && userConfigRef) {
|
|
184750
185609
|
stateIssue = issue(ref.path, `${options.elementMode} elements cannot read /user state; read userConfig via a prop or bind it at page level`);
|
|
184751
185610
|
} else if (options?.elementMode && propMatch) {
|
|
184752
185611
|
stateIssue = Object.hasOwn(options.elementProps ?? {}, propMatch[1]) ? null : issue(ref.path, `state reference targets unknown element prop "${propMatch[1]}"`);
|
|
184753
185612
|
} else if (options?.elementMode === "pure") {
|
|
184754
185613
|
stateIssue = issue(ref.path, `pure element state reference "${ref.value}" escapes /props/<declared>; use a declared prop or switch the element to bound mode`);
|
|
184755
185614
|
} else {
|
|
184756
|
-
stateIssue = validateStateRef(ref, definition, formIds, uiIds, pageParams);
|
|
185615
|
+
stateIssue = validateStateRef(ref, definition, formIds, uiIds, pageParams, pageState);
|
|
184757
185616
|
}
|
|
184758
185617
|
if (stateIssue)
|
|
184759
185618
|
issues.push(stateIssue);
|
|
184760
185619
|
}
|
|
184761
185620
|
return dedupeIssues(issues);
|
|
184762
185621
|
}
|
|
184763
|
-
var ELEMENT_KEYS, UI_STATE_COMPONENTS, SCHEMA_FORM_ID, PLAIN_TOKEN_ID_COMPONENTS, SESSION_KEY, RESERVED_UI_IDS, PROP_ACTION_CHAINS, ITEM_ACTION_CHAINS, ROUTE_PANEL_TYPES, APPROVAL_CHAIN_KEYS, DATA_FIELD_PROPS, CONDITION_KEYS, COMPARISON_KEYS, POPOVER_MAX_FIELDS = 12, LINK_FIELD_PROPS, MAX_ELEMENT_REF_DEPTH = 5, MAX_ELEMENT_REF_EXPANSION_WORK = 100, MAX_ELEMENT_REF_EXPANSION_ISSUES = 100, CHART_MAX_SERIES = 8, CURRENCY_CODE, FILE_ROW_FIELDS, PAGE_FRAME_ID;
|
|
185622
|
+
var ELEMENT_KEYS, UI_STATE_COMPONENTS, SCHEMA_FORM_ID, PLAIN_TOKEN_ID_COMPONENTS, SESSION_KEY, RESERVED_UI_IDS, INPUT_KEYS, PROP_ACTION_CHAINS, ITEM_ACTION_CHAINS, ROUTE_PANEL_TYPES, APPROVAL_CHAIN_KEYS, DATA_FIELD_PROPS, CONDITION_KEYS, EXPRESSION_ARITY, SVG_SHAPES, SVG_PATH_DATA, COMPARISON_KEYS, POPOVER_MAX_FIELDS = 12, LINK_FIELD_PROPS, MAX_ELEMENT_REF_DEPTH = 5, MAX_ELEMENT_REF_EXPANSION_WORK = 100, MAX_ELEMENT_REF_EXPANSION_ISSUES = 100, CHART_MAX_SERIES = 8, CURRENCY_CODE, FILE_ROW_FIELDS, PAGE_FRAME_ID;
|
|
184764
185623
|
var init_page_validator = __esm(() => {
|
|
184765
185624
|
init_definition();
|
|
184766
185625
|
ELEMENT_KEYS = new Set([
|
|
@@ -184789,7 +185648,21 @@ var init_page_validator = __esm(() => {
|
|
|
184789
185648
|
PLAIN_TOKEN_ID_COMPONENTS = new Set(["SchemaForm", "SessionThread"]);
|
|
184790
185649
|
SESSION_KEY = /^[A-Za-z0-9_-]{1,128}$/;
|
|
184791
185650
|
RESERVED_UI_IDS = new Set(["__proto__", "constructor", "prototype"]);
|
|
185651
|
+
INPUT_KEYS = [
|
|
185652
|
+
"Backspace",
|
|
185653
|
+
"Delete",
|
|
185654
|
+
"Enter",
|
|
185655
|
+
"Escape",
|
|
185656
|
+
"Tab",
|
|
185657
|
+
"ArrowLeft",
|
|
185658
|
+
"ArrowRight",
|
|
185659
|
+
"ArrowUp",
|
|
185660
|
+
"ArrowDown",
|
|
185661
|
+
"Home",
|
|
185662
|
+
"End"
|
|
185663
|
+
];
|
|
184792
185664
|
PROP_ACTION_CHAINS = {
|
|
185665
|
+
Input: ["onInput", "onPaste", ...INPUT_KEYS.map((key) => `onKeyDown:${key}`)],
|
|
184793
185666
|
Table: ["onRowClick", "onRetry"],
|
|
184794
185667
|
Form: ["onSubmit"],
|
|
184795
185668
|
Kanban: ["onMove", "onCardClick"],
|
|
@@ -184819,6 +185692,19 @@ var init_page_validator = __esm(() => {
|
|
|
184819
185692
|
Chart: ["x"]
|
|
184820
185693
|
};
|
|
184821
185694
|
CONDITION_KEYS = new Set(["eq", "neq", "gt", "gte", "lt", "lte", "not"]);
|
|
185695
|
+
EXPRESSION_ARITY = {
|
|
185696
|
+
$add: [1, Infinity],
|
|
185697
|
+
$sub: [2, 2],
|
|
185698
|
+
$mul: [1, Infinity],
|
|
185699
|
+
$div: [2, 2],
|
|
185700
|
+
$min: [1, Infinity],
|
|
185701
|
+
$max: [1, Infinity],
|
|
185702
|
+
$split: [1, 3],
|
|
185703
|
+
$join: [1, 2],
|
|
185704
|
+
$length: [1, 1]
|
|
185705
|
+
};
|
|
185706
|
+
SVG_SHAPES = new Set(["Rect", "Line", "Path", "Circle", "SvgText"]);
|
|
185707
|
+
SVG_PATH_DATA = /^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/;
|
|
184822
185708
|
COMPARISON_KEYS = ["eq", "neq", "gt", "gte", "lt", "lte"];
|
|
184823
185709
|
LINK_FIELD_PROPS = {
|
|
184824
185710
|
Table: "columns",
|
|
@@ -185182,11 +186068,18 @@ async function parseAppDefinition(input, elementContext = {}) {
|
|
|
185182
186068
|
});
|
|
185183
186069
|
continue;
|
|
185184
186070
|
}
|
|
185185
|
-
|
|
186071
|
+
const grandfatheredRef = grandfatheredScriptRefs.get(`actions.${name}`) === scriptRefKey(action.scriptId, action.args, undefined);
|
|
186072
|
+
const owner = getSavedScriptOwnerAgentId(script);
|
|
186073
|
+
if (foreignScriptForWriter(elementContext, script) && !grandfatheredRef) {
|
|
185186
186074
|
issues.push({
|
|
185187
186075
|
path: `actions.${name}.scriptId`,
|
|
185188
186076
|
message: `script "${action.scriptId}" is agent-scoped to another agent — reference a script you own or a global script`
|
|
185189
186077
|
});
|
|
186078
|
+
} else if (script.scope !== "agent" && owner !== null && (elementContext.writerIsUser === true || typeof elementContext.writerAgentId === "string") && elementContext.writerAgentId !== owner && !grandfatheredRef) {
|
|
186079
|
+
issues.push({
|
|
186080
|
+
path: `actions.${name}.scriptId`,
|
|
186081
|
+
message: `script "${action.scriptId}" runs with agent "${owner}"'s credentials — only that agent or the operator may wire or alter this action`
|
|
186082
|
+
});
|
|
185190
186083
|
}
|
|
185191
186084
|
}
|
|
185192
186085
|
if (issues.length > 0)
|
|
@@ -185270,7 +186163,7 @@ function applyMergePatch(target, patch, path) {
|
|
|
185270
186163
|
if (!isMergePatchObject(patch))
|
|
185271
186164
|
return patch;
|
|
185272
186165
|
const result = isMergePatchObject(target) ? { ...target } : {};
|
|
185273
|
-
const entriesAreAtomic = path.length === 1 && path[0] === "actions" || path.length === 1 && path[0] === "elements" || path.length === 1 && path[0] === "userConfig" || path.length === 3 && path[0] === "models" && path[2] === "columns" || path.length === 3 && path[0] === "models" && path[2] === "sources" || path.length === 3 && path[0] === "elements" && path[2] === "elements" || path.length === 3 && path[0] === "pages" && (path[2] === "elements" || path[2] === "params");
|
|
186166
|
+
const entriesAreAtomic = path.length === 1 && path[0] === "actions" || path.length === 1 && path[0] === "elements" || path.length === 1 && path[0] === "userConfig" || path.length === 3 && path[0] === "models" && path[2] === "columns" || path.length === 3 && path[0] === "models" && path[2] === "sources" || path.length === 3 && path[0] === "elements" && path[2] === "elements" || path.length === 3 && path[0] === "pages" && (path[2] === "elements" || path[2] === "params" || path[2] === "state");
|
|
185274
186167
|
for (const [key, value] of Object.entries(patch)) {
|
|
185275
186168
|
if (value === null) {
|
|
185276
186169
|
delete result[key];
|
|
@@ -185504,7 +186397,8 @@ var init_definition = __esm(() => {
|
|
|
185504
186397
|
icon: string2().optional(),
|
|
185505
186398
|
description: string2().max(280).optional(),
|
|
185506
186399
|
headerActions: string2().optional(),
|
|
185507
|
-
nav: boolean().optional()
|
|
186400
|
+
nav: boolean().optional(),
|
|
186401
|
+
state: record2(AppNameSchema, unknown()).optional()
|
|
185508
186402
|
}).strict();
|
|
185509
186403
|
ElementPropDefSchema = object2({
|
|
185510
186404
|
kind: ScalarColumnKindSchema,
|