@desplega.ai/agent-swarm 2.8.0 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-adapter-t949vbbp.js → acp-adapter-fqzkxyra.js} +3 -3
- package/dist/{actions-7e9czc7s.js → actions-kxek041g.js} +18 -18
- package/dist/{amp-adapter-gv6cbb7d.js → amp-adapter-ce7jjke4.js} +1 -1
- package/dist/{app-b9fbkp9v.js → app-v6zz8yh0.js} +3 -3
- package/dist/{assistant-wjb7v4c7.js → assistant-m0sw9xx2.js} +19 -19
- package/dist/{boot-args-schema-2t37e0fe.js → boot-args-schema-66bk37wv.js} +1 -1
- package/dist/{boot-reembed-gka3zas7.js → boot-reembed-edjpwsc1.js} +1 -1
- package/dist/{boot-reembed-a35nkyr1.js → boot-reembed-y27n09tz.js} +1 -1
- package/dist/{boot-scrub-sweep-65sdnp6c.js → boot-scrub-sweep-1xc35965.js} +3 -3
- package/dist/{boot-seeds-x42tzytw.js → boot-seeds-7hjj91qj.js} +4 -4
- package/dist/{boxd-qbkxy6ap.js → boxd-ent8ch04.js} +1 -1
- package/dist/{claude-adapter-v221b2fd.js → claude-adapter-stw7jdcf.js} +3 -3
- package/dist/{claude-managed-adapter-29eq09wd.js → claude-managed-adapter-jh6c523j.js} +2 -2
- package/dist/{claude-managed-setup-9m6450zk.js → claude-managed-setup-y6z2perp.js} +5 -5
- package/dist/{claude-sdk-session-0q0ptaba.js → claude-sdk-session-vvya8wqk.js} +3 -3
- package/dist/{cli-wk18cm92.js → cli-0cq8y6m7.js} +1 -1
- package/dist/{cli-p1w18yhx.js → cli-1pz0330a.js} +1 -1
- package/dist/{cli-y97qxcfx.js → cli-1qkz151v.js} +3 -3
- package/dist/{cli-qwca7s44.js → cli-26ctbcdp.js} +18 -6
- package/dist/{cli-8fknbnhw.js → cli-2kvhc7x8.js} +7 -7
- package/dist/{cli-rfywm85n.js → cli-3e875j5p.js} +136 -49
- package/dist/{cli-6wxjceza.js → cli-3sy2xags.js} +10 -10
- package/dist/{cli-a7wvp2km.js → cli-3vmb0n58.js} +1 -1
- package/dist/{cli-p1bq50aa.js → cli-4vzgeta4.js} +13 -13
- package/dist/{cli-m28atx8q.js → cli-5y340nzn.js} +4 -4
- package/dist/{cli-7p1kvkck.js → cli-6rc5frdm.js} +1 -1
- package/dist/{cli-tph5wt3y.js → cli-6wj7p986.js} +1 -1
- package/dist/{cli-t73cas91.js → cli-7349va39.js} +8100 -7620
- package/dist/{cli-ee0b971j.js → cli-837vfs2x.js} +2 -2
- package/dist/{cli-abejgen1.js → cli-959kp5h2.js} +12 -11
- package/dist/{cli-8kzasymh.js → cli-97ae65rz.js} +4 -4
- package/dist/{cli-m4dqmnbp.js → cli-9mb2q6pb.js} +1 -1
- package/dist/{cli-p2gfst4m.js → cli-a0z912j7.js} +123 -35
- package/dist/{cli-4txa0ter.js → cli-b98a65ed.js} +3 -3
- package/dist/{cli-k0wwfqbg.js → cli-dns0y538.js} +4 -0
- package/dist/{cli-tk7cjj8h.js → cli-dzpc6en0.js} +1 -1
- package/dist/{cli-qa4wdgsy.js → cli-e1p3n5gq.js} +4 -4
- package/dist/{cli-gxkx0zzp.js → cli-f4e8r23x.js} +1 -1
- package/dist/{cli-qmqk2yc2.js → cli-f4r3g076.js} +1 -1
- package/dist/{cli-wcg8x116.js → cli-f6bahpn5.js} +1 -1
- package/dist/{cli-qsnnd04k.js → cli-fpjmegdb.js} +1 -1
- package/dist/{cli-j790gp2w.js → cli-fwy8kfd6.js} +271 -37
- package/dist/{cli-rmmpt0wm.js → cli-g5mtmf6t.js} +6 -6
- package/dist/{cli-rzsy6nc6.js → cli-gyt3zydq.js} +3 -3
- package/dist/{cli-pasjcnmj.js → cli-j24zbska.js} +3 -3
- package/dist/{cli-qfedvmcr.js → cli-jdknh18m.js} +10 -10
- package/dist/{cli-7b8sbmag.js → cli-kjtwrhea.js} +1 -1
- package/dist/{cli-gpwhbgx0.js → cli-m9s2qff2.js} +57 -25
- package/dist/{cli-2wnq8jkz.js → cli-mxn1qvbn.js} +3 -2
- package/dist/{cli-s7t6p9my.js → cli-n6vtrcht.js} +1 -1
- package/dist/{cli-2zp0et3v.js → cli-pchypa1s.js} +55 -19
- package/dist/{cli-yq3zak69.js → cli-pfs8adn4.js} +1 -1
- package/dist/{cli-c55z5chy.js → cli-q24n86d2.js} +2 -2
- package/dist/{cli-h38x262p.js → cli-rcecc3yq.js} +167 -43
- package/dist/{cli-xae4g51r.js → cli-rh15cakt.js} +1 -1
- package/dist/{cli-sdtt3men.js → cli-rmzsadkf.js} +1 -1
- package/dist/{cli-f3vq58d2.js → cli-t2tma8gb.js} +1 -1
- package/dist/{cli-m23zjcy2.js → cli-tekytdq9.js} +2 -2
- package/dist/{cli-tqegb8eq.js → cli-vdektqgf.js} +1 -1
- package/dist/{cli-ffhtssbp.js → cli-vj75tyaw.js} +1 -1
- package/dist/{cli-deefvewm.js → cli-w401b9tq.js} +1 -1
- package/dist/{cli-n9ftpys4.js → cli-x6t50dmw.js} +7 -7
- package/dist/{cli-6t09sdhy.js → cli-xf3qw745.js} +3 -3
- package/dist/{cli-hxpyc9sn.js → cli-z1w943va.js} +2 -2
- package/dist/{cli-334z18y3.js → cli-zh9rsbqf.js} +3 -3
- package/dist/cli.js +17 -17
- package/dist/{codex-adapter-30j9bpzd.js → codex-adapter-zerf5qsp.js} +1 -1
- package/dist/{codex-hook-h3vk6xzr.js → codex-hook-30gyhzxe.js} +1 -1
- package/dist/{codex-session-runner-8vp57v8w.js → codex-session-runner-89s304py.js} +1 -1
- package/dist/{commands-bngnz9g7.js → commands-jeh1b51j.js} +3 -3
- package/dist/{controller-hxx8wwy1.js → controller-mctfbrse.js} +3 -3
- package/dist/{controllers-connect-e2b4gyxc.js → controllers-connect-nxa1ddwn.js} +19 -19
- package/dist/{cursor-adapter-n5nc3mfe.js → cursor-adapter-qj8vehv6.js} +1 -1
- package/dist/{db-bgm7vkc0.js → db-2dvay0es.js} +3 -3
- package/dist/{db-c6np41ca.js → db-b36qn6k3.js} +2 -2
- package/dist/{dispatcher-jnybck15.js → dispatcher-gndbta01.js} +17 -17
- package/dist/{dsh-adapter-nrhbrjz8.js → dsh-adapter-f75sz821.js} +1 -1
- package/dist/{e2b-jkwfhbcv.js → e2b-3gpc2n3w.js} +1 -1
- package/dist/{e2b-s16txnpx.js → e2b-jbm7mj93.js} +1 -1
- package/dist/{embedding-space-crsm2zp0.js → embedding-space-4p05vb2x.js} +6 -6
- package/dist/{embeddings-e7z3f27f.js → embeddings-m6768mgh.js} +1 -1
- package/dist/{external-channel-m77wf5z3.js → external-channel-gjv3jne3.js} +2 -2
- package/dist/{fx-adapter-b6w0kf56.js → fx-adapter-rpsgb1tw.js} +4 -4
- package/dist/{grok-adapter-4sqtebdk.js → grok-adapter-n2m3zjg1.js} +4 -4
- package/dist/handlers-nv8edn19.js +32 -0
- package/dist/{heartbeat-xgb036sx.js → heartbeat-a1tv60gt.js} +20 -20
- package/dist/{hook-xsk1jbha.js → hook-8h5dzcgq.js} +2 -2
- package/dist/{hook-5h02c9ga.js → hook-cyaps9ba.js} +4 -4
- package/dist/{http-txe7qhvn.js → http-t15mhbd9.js} +1733 -79
- package/dist/{index-0eny15vj.js → index-2skqtd76.js} +2 -2
- package/dist/{index-w7em4ktq.js → index-d6wkh8ar.js} +2 -2
- package/dist/{index-rvccek1w.js → index-gjwaqaq8.js} +5 -5
- package/dist/{index-e5pfbsys.js → index-hjhfk3ra.js} +3 -3
- package/dist/{index-1qw6f2dc.js → index-khe3gp0k.js} +4 -4
- package/dist/index-ksmyd6kc.js +37 -0
- package/dist/{index-vk63emp7.js → index-qav6455f.js} +14 -12
- package/dist/index-rjnrje98.js +32 -0
- package/dist/index-tv3413wy.js +33 -0
- package/dist/{index-ysvbhg5m.js → index-w1zqf680.js} +1 -1
- package/dist/{keepalive-4zsrce78.js → keepalive-91s7hzrb.js} +3 -3
- package/dist/lead-3hmddvrm.js +70 -0
- package/dist/{maintenance-86jvartk.js → maintenance-7pjmy5xy.js} +1 -1
- package/dist/{node-je82wjet.js → node-4c5jqxr3.js} +1 -1
- package/dist/{oauth-refresh-sweep-j52kg9pr.js → oauth-refresh-sweep-rzqfm94j.js} +2 -2
- package/dist/{onboard-c2aj5p8q.js → onboard-74st7pag.js} +3 -3
- package/dist/{opencode-adapter-dsagkhtw.js → opencode-adapter-arn7gm8q.js} +2 -2
- package/dist/{otel-impl-yyy203z8.js → otel-impl-rnzey8cb.js} +1 -1
- package/dist/{pi-mono-adapter-546cd1cc.js → pi-mono-adapter-6mkwq64n.js} +3 -2
- package/dist/{pricing-refresh-1rgzqyzz.js → pricing-refresh-ha21jhk7.js} +2 -2
- package/dist/{rbac-roles-e70xfeyj.js → rbac-roles-59dxachk.js} +2 -2
- package/dist/{rbac-roles-q89qe8er.js → rbac-roles-wqhma4dr.js} +3 -3
- package/dist/{render-v2-k6tt107q.js → render-v2-14kpzx12.js} +3 -3
- package/dist/{resume-cnnrjfxa.js → resume-gsa5fb5f.js} +6 -6
- package/dist/{session-access-xkxkjw3n.js → session-access-skm7bnp6.js} +4 -4
- package/dist/{session-source-backfill-1d5pdwww.js → session-source-backfill-pbqzbncv.js} +2 -2
- package/dist/{setup-se8q7gkc.js → setup-5yermsem.js} +1 -1
- package/dist/{work-objects-1kxnbzy5.js → work-objects-xj0ck0w4.js} +20 -20
- package/dist/{worker-follow-up-zqm8apt4.js → worker-follow-up-911xc0b8.js} +19 -17
- package/dist/worker-qgg0m2gw.js +70 -0
- package/openapi.json +1741 -290
- package/package.json +3 -3
- package/src/apps/catalog.generated.json +120 -1
- package/src/apps/definition.ts +38 -11
- package/src/apps/page-validator.ts +88 -0
- package/src/be/db/model-profiles.ts +110 -11
- package/src/be/db/tasks/read.ts +20 -0
- package/src/be/db/workflow-run-definitions.ts +19 -8
- package/src/be/db-client.ts +43 -5
- package/src/be/db.ts +9 -3
- package/src/be/migrations/284_model_profile_fallbacks.sql +9 -0
- package/src/be/model-profile-check.ts +43 -18
- package/src/be/runtime-pools/routing.ts +1 -0
- package/src/be/savings/calibrate.ts +468 -0
- package/src/be/savings/compute.ts +182 -0
- package/src/be/savings/model.ts +406 -0
- package/src/be/scripts/typecheck.ts +5 -0
- package/src/be/seed/agent-fs-provision.ts +48 -11
- package/src/be/seed/workflows-seeder.ts +67 -23
- package/src/be/skill-parser.ts +19 -7
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/provider-error-class.ts +97 -0
- package/src/commands/runner.ts +99 -17
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/http/all-routes.ts +2 -0
- package/src/http/fs.ts +8 -2
- package/src/http/index.ts +4 -0
- package/src/http/model-profiles.ts +43 -10
- package/src/http/poll.ts +1 -0
- package/src/http/savings-calibration.ts +277 -0
- package/src/http/savings.ts +363 -0
- package/src/http/tasks.ts +46 -4
- package/src/http/trackers/authorize-gate.ts +41 -0
- package/src/http/trackers/jira.ts +26 -4
- package/src/http/trackers/linear.ts +26 -4
- package/src/integrations/chat-sdk/limits.ts +6 -1
- package/src/jira/oauth.ts +7 -1
- package/src/linear/README.md +2 -1
- package/src/linear/oauth.ts +7 -1
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/codex-adapter.ts +3 -0
- package/src/providers/pi-mono-adapter.ts +6 -5
- package/src/providers/types.ts +7 -0
- package/src/scripts-runtime/eval-harness.ts +14 -1
- package/src/scripts-runtime/executors/types.ts +3 -0
- package/src/scripts-runtime/sdk-allowlist.ts +11 -1
- package/src/scripts-runtime/swarm-sdk.ts +6 -0
- package/src/scripts-runtime/types/stdlib.d.ts +9 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +34 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +9 -0
- package/src/tasks/worker-follow-up.ts +142 -3
- package/src/tests/agent-fs-provision-seeder.test.ts +81 -0
- package/src/tests/apps-chart-shell.test.ts +170 -0
- package/src/tests/apps-icon.test.ts +156 -2
- package/src/tests/chat-sdk-relay.test.ts +12 -0
- package/src/tests/codex-adapter.test.ts +11 -0
- package/src/tests/comb-default.test.ts +6 -0
- package/src/tests/core-auth.test.ts +7 -6
- package/src/tests/db-client-busy-retry.test.ts +58 -6
- package/src/tests/deploy-guard.test.ts +154 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/fixtures/app-shell-charts-definition.json.txt +180 -0
- package/src/tests/mcp-tools.test.ts +1 -1
- package/src/tests/model-profile-fallbacks.test.ts +482 -0
- package/src/tests/model-profiles-api.test.ts +1 -0
- package/src/tests/pi-mono-session-cost-on-abort.test.ts +115 -0
- package/src/tests/provider-error-class.test.ts +174 -0
- package/src/tests/runner-provider-fallback.test.ts +197 -0
- package/src/tests/savings-calibration-api.test.ts +264 -0
- package/src/tests/savings-calibration.test.ts +201 -0
- package/src/tests/savings-compute.test.ts +406 -0
- package/src/tests/savings-model.test.ts +287 -0
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/script-native-unawaited-drain.test.ts +167 -0
- package/src/tests/sdk-allowlist.test.ts +40 -0
- package/src/tests/seed-workflows.test.ts +167 -11
- package/src/tests/skill-parser.test.ts +45 -0
- package/src/tests/tracker-oauth-authorize-auth.test.ts +262 -0
- package/src/tests/workflow-definition-pinning.test.ts +128 -3
- package/src/tests/workflow-script-principal.test.ts +94 -4
- package/src/tools/app-upsert.ts +1 -1
- package/src/tools/model-profiles/list-model-profiles.ts +4 -2
- package/src/tools/script-run.ts +1 -1
- package/src/tools/update-profile.ts +1 -1
- package/src/types.ts +115 -33
- package/src/utils/constants.ts +2 -0
- package/templates/skills/apps/SKILL.md +62 -3
- package/templates/skills/apps/content.md +62 -3
- package/templates/skills/swarm-docs/content.md +2 -0
- package/templates/skills/swarm-scripts/SKILL.md +1 -1
- package/templates/skills/swarm-scripts/content.md +1 -1
- package/dist/handlers-kdjcyzdj.js +0 -32
- package/dist/index-835xdgnm.js +0 -33
- package/dist/index-d469300x.js +0 -37
- package/dist/index-rzqwp11g.js +0 -32
- package/dist/lead-yqt47dkr.js +0 -70
- package/dist/worker-j6xxtq7p.js +0 -70
|
@@ -137,7 +137,14 @@ An optional top-level `"theme"` sets the preset the dashboard applies to the app
|
|
|
137
137
|
|
|
138
138
|
Viewers can override the preset per app from the app's settings drawer; the override rides the reserved `$theme` key of the user-config values (accepted on every app, even without a declared `userConfig` schema, and never visible at `/user/...`). A present override always beats the definition's `theme` — even an unrecognized one, which degrades to the dashboard theme — so treat `theme` as the app's default styling, not a guarantee.
|
|
139
139
|
|
|
140
|
-
An optional top-level `"icon"` sets the app's icon on the dashboard Apps page
|
|
140
|
+
An optional top-level `"icon"` sets the app's icon on the dashboard Apps page. It takes one of three shapes:
|
|
141
|
+
|
|
142
|
+
- `{ "type": "lucide", "icon": "<kebab-case lucide name>", "color": "#RRGGBB" }` (`color` optional). The dashboard looks the name up in its curated icon catalog and shows a generic grid icon for an unknown name.
|
|
143
|
+
- `{ "type": "url", "url": "https://..." }`: an https image link, at most 2048 characters, no credentials.
|
|
144
|
+
- `{ "type": "agent-fs", "path": "/apps/<appId>/icon.png" }`: an image on the swarm's agent-fs drive. Add both `orgId` and `driveId` for another drive; never just one.
|
|
145
|
+
|
|
146
|
+
The server validates shape only. The dashboard shows the grid glyph while an image loads, when it fails to load, and when the viewer has no agent-fs connected, so omitting `icon` is always safe. `app-patch` replaces `icon` whole, so switching shapes leaves no keys from the old one.
|
|
147
|
+
|
|
141
148
|
|
|
142
149
|
Distinguish the two rollback 400s. A lossy-migration 400 is fixable: copy the required `migration` entries from the message and retry. A target-snapshot validation 400 explicitly says that directives cannot repair that historical definition; use `app-history` and choose a different version.
|
|
143
150
|
|
|
@@ -168,6 +175,8 @@ When a schema patch reports stale page/query bindings, repair them in that same
|
|
|
168
175
|
}
|
|
169
176
|
```
|
|
170
177
|
|
|
178
|
+
Optional top-level `layout: "sidebar"` turns on the app shell (see Pages, routes, and page trees). Without it every page renders on the plain canvas, exactly as before.
|
|
179
|
+
|
|
171
180
|
Model, reusable-element, element-prop, query, action, column, page, and page-param names start with a lowercase letter, contain only letters, numbers, or underscores, and are at most 40 characters. A definition has 0-10 models and at most 20 reusable elements; each declared model has 1-40 columns. Zero-model apps are valid for pure UI utilities as long as their pages and reusable elements validate.
|
|
172
181
|
|
|
173
182
|
### Reusable elements
|
|
@@ -473,11 +482,58 @@ Saved scripts use the generated SDK name `ctx.swarm.app_query({ appId, query, pa
|
|
|
473
482
|
|
|
474
483
|
Drawer variant: declare a route param on the containing page, set the Drawer `props.param` to that literal param name, and use the same `app.navigate` shape targeting that page with the row id assigned to the Drawer's param. The Drawer then opens from route state without a separate action contract.
|
|
475
484
|
|
|
485
|
+
App shell (`layout: "sidebar"` at the top level of the definition): every page renders inside a left sidebar that lists the app's pages and a sticky page header. Per page:
|
|
486
|
+
|
|
487
|
+
- `title`: the sidebar label and the header heading (defaults to the page name).
|
|
488
|
+
- `icon`: one catalog icon name (the list under Component catalog) before the sidebar label; unknown names are rejected.
|
|
489
|
+
- `description`: one line under the header title (at most 280 characters).
|
|
490
|
+
- `headerActions`: the key of one element of this page, rendered in the header's actions slot (right side), e.g. a Refresh `Button` with `on.press: [{ "action": "app.refresh" }]` or a row `Stack` of buttons. It is a second root: it must exist in the page's `elements` and must NOT also be reachable from `root`. It shares the page's state and actions.
|
|
491
|
+
- `nav: false`: leave the page out of the sidebar. Pages with a `required` param never list (they cannot open without it); open them with `app.navigate`.
|
|
492
|
+
|
|
493
|
+
The sidebar lists pages in definition order and marks the current one. Below 768px it folds into a menu button at the left of the header. Crumbs back to the default page show in the header only on pages the sidebar does not list. The shell renders in every view mode: inside the bordered canvas (default view, under the dashboard header that names the app), under the slim bar in `?mode=full`, and as the whole viewport in `?mode=chromeless`, where the sidebar also shows the app name (it is the only navigation inside an iframe). `headerActions` and `nav` without `layout: "sidebar"` are rejected; `icon` and `description` are accepted and unused.
|
|
494
|
+
|
|
495
|
+
```json
|
|
496
|
+
{
|
|
497
|
+
"layout": "sidebar",
|
|
498
|
+
"defaultPage": "overview",
|
|
499
|
+
"pages": {
|
|
500
|
+
"overview": {
|
|
501
|
+
"title": "Overview",
|
|
502
|
+
"icon": "activity",
|
|
503
|
+
"description": "Deploys and spend, last 14 days.",
|
|
504
|
+
"headerActions": "refresh",
|
|
505
|
+
"root": "root",
|
|
506
|
+
"elements": {
|
|
507
|
+
"root": { "type": "Stack", "props": {}, "children": ["spend"] },
|
|
508
|
+
"spend": {
|
|
509
|
+
"type": "Chart",
|
|
510
|
+
"props": {
|
|
511
|
+
"kind": "area",
|
|
512
|
+
"data": { "$state": "/queries/days/data" },
|
|
513
|
+
"loading": { "$state": "/queries/days/loading" },
|
|
514
|
+
"x": "date",
|
|
515
|
+
"xType": "time",
|
|
516
|
+
"format": "currency",
|
|
517
|
+
"series": [{ "key": "spend", "label": "Spend" }]
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
"refresh": {
|
|
521
|
+
"type": "Button",
|
|
522
|
+
"props": { "label": "Refresh", "icon": "refresh-cw", "variant": "outline", "size": "sm" },
|
|
523
|
+
"on": { "press": [{ "action": "app.refresh" }] }
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
"settings": { "title": "Settings", "icon": "pencil", "root": "root", "elements": { "root": { "type": "Text", "props": { "content": "…" } } } }
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
```
|
|
531
|
+
|
|
476
532
|
Param `kind` is `string` by default, or `number` / `boolean`; `required` defaults to false. The names `mode`, `apiUrl`, `apiKey`, `email`, and `name` are reserved. `/apps/<id>` renders `defaultPage`; `/apps/<id>/p/<page>?issueId=42` is the shareable deep link for another page. Browser navigation is client-side, so app state and polled data stay warm across page changes.
|
|
477
533
|
|
|
478
534
|
Within each page, `root` names one entry in its non-empty `elements` map. Elements are a flat, single-parent tree: ids are map keys, `children` contains ids (not nested elements), all elements must be reachable from `root`, and cycles, missing children, or shared children are invalid. Element and Form/UI ids are page-local. Element keys are `type`, `props`, `children`, `on`, `visible`, `repeat`, and `watch`; only components with a `default` child slot accept `children` (Stack, Grid, Split, Tabs, Container, Card, Section, and Drawer). `watch` maps state paths to an action step or chain.
|
|
479
535
|
|
|
480
|
-
## Component catalog (all
|
|
536
|
+
## Component catalog (all 35)
|
|
481
537
|
|
|
482
538
|
Props reject unknown keys. A `{"$state":"..."}` binding may replace a literal prop value at any depth.
|
|
483
539
|
|
|
@@ -502,7 +558,8 @@ Tones: Badge, Metric and Progress `tone` take `neutral`, `success`, `active`, `e
|
|
|
502
558
|
| `NumberInput` | `id` | `label`, `placeholder`, `min`, `max`; a text field with a decimal keyboard that writes the parsed number to `/ui/<id>/value` on every change (no debounce), or null when the field is empty; non-numeric text (a bare `-` mid-edit, letters) leaves the stored value untouched; `min`/`max` clamp the stored value and the visible text snaps to it when the field loses focus; no children. |
|
|
503
559
|
| `Chips` | `id`, `options` | Toggle chips for quick filters. `options` are strings or `{ value, label?, icon? }`; `multiple`; `label` (group name for screen readers). Writes a string or null to `/ui/<id>/value`, or a string array with `multiple`; pressing the selected chip clears it. |
|
|
504
560
|
| `Button` | `label` | `variant: "default", "secondary", "outline", "ghost", "destructive", or "destructive-outline"` (use `destructive-outline` for standalone deletes); `disabled` (constant or bound boolean); `busyWith: "<actionName>"` swaps the label for a spinner while that custom action's `/actions/<name>/status` is `"running"` (presses are ignored), then shows a check and `successLabel` for about 1.5s when it turns `"ok"`; `icon`, `iconPosition: "start" or "end"`; `size: "sm", "default", or "lg"`; `shortcut` (one key, shown as a keycap, presses the button); `hint` (tooltip); dispatch with element-level `on.press`. |
|
|
505
|
-
| `Metric` | `label`, `value` | The dashboard stat tile. `value` is string or number (empty renders an em dash); bind `loading` to `/queries/<name>/loading` for a skeleton while the query loads; `icon` with `tone` tinting its tile; `detail` (a line under the value); `trend: { direction: "up", "down", or "flat", label }`; `info` (explanation tooltip next to the label). |
|
|
561
|
+
| `Metric` | `label`, `value` | The dashboard stat tile. `value` is string or number (empty renders an em dash); bind `loading` to `/queries/<name>/loading` for a skeleton while the query loads; `icon` with `tone` tinting its tile; `detail` (a line under the value); `trend: { direction: "up", "down", or "flat", label }`; `info` (explanation tooltip next to the label). `sparkline`: a small trend line under the value in the `tone` color, from an array of numbers (`null` is a gap) or from rows (bind `/queries/<name>/data`) read through `sparklineKey`; fewer than two points draws nothing. |
|
|
562
|
+
| `Chart` | `kind`, `x`, `series` | `kind: "line", "area", or "bar"`; bind `data` / `loading` / `error` to a named query like Table. `x` is the row field on the x axis; `xType: "category"` (default, row order) or `"time"` (ISO date or epoch ms, sorted, date ticks; rows whose `x` does not parse are dropped). `series`: 1-8 `{ key, label?, color? }`, `color` one of `chart-1`..`chart-5`, `primary`, `success`, `warning`, `error`, `info`, `muted` (default palette, in order: `primary`, `chart-2`..`chart-5`). `stacked` stacks area and bar series (lines never stack). `format: "number"` (default), `"currency"` (with `currency`, an ISO code, default `USD`) or `"percent"` (values are ratios: 0.42 is 42%). Tooltip on hover; the legend shows with two or more series (`legend` forces it on or off). `height` 120-640 px (default 240); `emptyMessage` (default "No data yet"). `x` and every `series[].key` must be columns of the bound query's model. Wrap it in a `Card` for a title. |
|
|
506
563
|
| `Alert` | `message` | `title`, `tone: "info", "success", "warning", or "error"`, `icon` (overrides the tone icon), `actionLabel` (a button inside the callout that emits `press`; wire it with `on.press`). |
|
|
507
564
|
| `Badge` | `text` | `text` is string or number; `tone`; `icon` replaces the dot; `variant: "tag"` (default uppercase chip), `"status"` (sentence-case pill), `"count"` (numeric pill), or `"beta"` (the BETA tag); `status` (a lifecycle value renders the dashboard status chip); `hint` (tooltip; the beta tag's explanation). |
|
|
508
565
|
| `Icon` | `name` | `size: "sm", "md", or "lg"`, `tone: "default", "muted", "success", "warning", "error", or "info"`, `label` (accessible name; decorative without it). |
|
|
@@ -615,6 +672,8 @@ Shortcut details:
|
|
|
615
672
|
|
|
616
673
|
## Layout & interactivity
|
|
617
674
|
|
|
675
|
+
For a multi-page app that should feel like a product (a sidebar of pages, a sticky title bar with actions), set `layout: "sidebar"` (see Pages, routes, and page trees) instead of building navigation out of Tabs or button rows. Pair `Metric` tiles (with `sparkline`) in a `Grid` with `Chart`s inside `Card`s for dashboards.
|
|
676
|
+
|
|
618
677
|
Use `Stack` as the primary page and section layout; `Container` is the legacy two-prop primitive retained for existing pages. Stack supports vertical or horizontal flow, shared spacing, alignment, justification, wrapping, and padding; row Stacks (filter bars, button rows) should set `collapseBelow: "sm"|"md"|"lg"` so they stack vertically on phones. Use `Grid` for responsive card or metric strips: a bare column count is responsive shorthand (1 column on phones, 2 from `sm`, the count from `md` up), or pin breakpoints explicitly with `{ "base": 1, "md": 2, "lg": 3 }`. `Grid` and `Split` also accept `padding` on the shared spacing scale.
|
|
619
678
|
|
|
620
679
|
`Stack` and `Split` size to their content by default, so a page scrolls as a whole. Set `fill: true` to make one grow to fill the remaining height of a `fill`-aware parent (another `fill` Stack or Split) instead; chain it from the page root down through every container on the path to the element that should scroll, and that element scrolls within whatever height is left while the page itself does not. A non-`fill` sibling (a toolbar, a header) keeps its natural height and the `fill` sibling absorbs the rest. A `fill` Split stretches both panes to the full row height, so nesting a `fill` Split inside one pane of another `fill` Split is the way to build a three-or-more column viewport-height layout (`ratio` is only ever two panes).
|
|
@@ -132,7 +132,14 @@ An optional top-level `"theme"` sets the preset the dashboard applies to the app
|
|
|
132
132
|
|
|
133
133
|
Viewers can override the preset per app from the app's settings drawer; the override rides the reserved `$theme` key of the user-config values (accepted on every app, even without a declared `userConfig` schema, and never visible at `/user/...`). A present override always beats the definition's `theme` — even an unrecognized one, which degrades to the dashboard theme — so treat `theme` as the app's default styling, not a guarantee.
|
|
134
134
|
|
|
135
|
-
An optional top-level `"icon"` sets the app's icon on the dashboard Apps page
|
|
135
|
+
An optional top-level `"icon"` sets the app's icon on the dashboard Apps page. It takes one of three shapes:
|
|
136
|
+
|
|
137
|
+
- `{ "type": "lucide", "icon": "<kebab-case lucide name>", "color": "#RRGGBB" }` (`color` optional). The dashboard looks the name up in its curated icon catalog and shows a generic grid icon for an unknown name.
|
|
138
|
+
- `{ "type": "url", "url": "https://..." }`: an https image link, at most 2048 characters, no credentials.
|
|
139
|
+
- `{ "type": "agent-fs", "path": "/apps/<appId>/icon.png" }`: an image on the swarm's agent-fs drive. Add both `orgId` and `driveId` for another drive; never just one.
|
|
140
|
+
|
|
141
|
+
The server validates shape only. The dashboard shows the grid glyph while an image loads, when it fails to load, and when the viewer has no agent-fs connected, so omitting `icon` is always safe. `app-patch` replaces `icon` whole, so switching shapes leaves no keys from the old one.
|
|
142
|
+
|
|
136
143
|
|
|
137
144
|
Distinguish the two rollback 400s. A lossy-migration 400 is fixable: copy the required `migration` entries from the message and retry. A target-snapshot validation 400 explicitly says that directives cannot repair that historical definition; use `app-history` and choose a different version.
|
|
138
145
|
|
|
@@ -163,6 +170,8 @@ When a schema patch reports stale page/query bindings, repair them in that same
|
|
|
163
170
|
}
|
|
164
171
|
```
|
|
165
172
|
|
|
173
|
+
Optional top-level `layout: "sidebar"` turns on the app shell (see Pages, routes, and page trees). Without it every page renders on the plain canvas, exactly as before.
|
|
174
|
+
|
|
166
175
|
Model, reusable-element, element-prop, query, action, column, page, and page-param names start with a lowercase letter, contain only letters, numbers, or underscores, and are at most 40 characters. A definition has 0-10 models and at most 20 reusable elements; each declared model has 1-40 columns. Zero-model apps are valid for pure UI utilities as long as their pages and reusable elements validate.
|
|
167
176
|
|
|
168
177
|
### Reusable elements
|
|
@@ -468,11 +477,58 @@ Saved scripts use the generated SDK name `ctx.swarm.app_query({ appId, query, pa
|
|
|
468
477
|
|
|
469
478
|
Drawer variant: declare a route param on the containing page, set the Drawer `props.param` to that literal param name, and use the same `app.navigate` shape targeting that page with the row id assigned to the Drawer's param. The Drawer then opens from route state without a separate action contract.
|
|
470
479
|
|
|
480
|
+
App shell (`layout: "sidebar"` at the top level of the definition): every page renders inside a left sidebar that lists the app's pages and a sticky page header. Per page:
|
|
481
|
+
|
|
482
|
+
- `title`: the sidebar label and the header heading (defaults to the page name).
|
|
483
|
+
- `icon`: one catalog icon name (the list under Component catalog) before the sidebar label; unknown names are rejected.
|
|
484
|
+
- `description`: one line under the header title (at most 280 characters).
|
|
485
|
+
- `headerActions`: the key of one element of this page, rendered in the header's actions slot (right side), e.g. a Refresh `Button` with `on.press: [{ "action": "app.refresh" }]` or a row `Stack` of buttons. It is a second root: it must exist in the page's `elements` and must NOT also be reachable from `root`. It shares the page's state and actions.
|
|
486
|
+
- `nav: false`: leave the page out of the sidebar. Pages with a `required` param never list (they cannot open without it); open them with `app.navigate`.
|
|
487
|
+
|
|
488
|
+
The sidebar lists pages in definition order and marks the current one. Below 768px it folds into a menu button at the left of the header. Crumbs back to the default page show in the header only on pages the sidebar does not list. The shell renders in every view mode: inside the bordered canvas (default view, under the dashboard header that names the app), under the slim bar in `?mode=full`, and as the whole viewport in `?mode=chromeless`, where the sidebar also shows the app name (it is the only navigation inside an iframe). `headerActions` and `nav` without `layout: "sidebar"` are rejected; `icon` and `description` are accepted and unused.
|
|
489
|
+
|
|
490
|
+
```json
|
|
491
|
+
{
|
|
492
|
+
"layout": "sidebar",
|
|
493
|
+
"defaultPage": "overview",
|
|
494
|
+
"pages": {
|
|
495
|
+
"overview": {
|
|
496
|
+
"title": "Overview",
|
|
497
|
+
"icon": "activity",
|
|
498
|
+
"description": "Deploys and spend, last 14 days.",
|
|
499
|
+
"headerActions": "refresh",
|
|
500
|
+
"root": "root",
|
|
501
|
+
"elements": {
|
|
502
|
+
"root": { "type": "Stack", "props": {}, "children": ["spend"] },
|
|
503
|
+
"spend": {
|
|
504
|
+
"type": "Chart",
|
|
505
|
+
"props": {
|
|
506
|
+
"kind": "area",
|
|
507
|
+
"data": { "$state": "/queries/days/data" },
|
|
508
|
+
"loading": { "$state": "/queries/days/loading" },
|
|
509
|
+
"x": "date",
|
|
510
|
+
"xType": "time",
|
|
511
|
+
"format": "currency",
|
|
512
|
+
"series": [{ "key": "spend", "label": "Spend" }]
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
"refresh": {
|
|
516
|
+
"type": "Button",
|
|
517
|
+
"props": { "label": "Refresh", "icon": "refresh-cw", "variant": "outline", "size": "sm" },
|
|
518
|
+
"on": { "press": [{ "action": "app.refresh" }] }
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
"settings": { "title": "Settings", "icon": "pencil", "root": "root", "elements": { "root": { "type": "Text", "props": { "content": "…" } } } }
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
```
|
|
526
|
+
|
|
471
527
|
Param `kind` is `string` by default, or `number` / `boolean`; `required` defaults to false. The names `mode`, `apiUrl`, `apiKey`, `email`, and `name` are reserved. `/apps/<id>` renders `defaultPage`; `/apps/<id>/p/<page>?issueId=42` is the shareable deep link for another page. Browser navigation is client-side, so app state and polled data stay warm across page changes.
|
|
472
528
|
|
|
473
529
|
Within each page, `root` names one entry in its non-empty `elements` map. Elements are a flat, single-parent tree: ids are map keys, `children` contains ids (not nested elements), all elements must be reachable from `root`, and cycles, missing children, or shared children are invalid. Element and Form/UI ids are page-local. Element keys are `type`, `props`, `children`, `on`, `visible`, `repeat`, and `watch`; only components with a `default` child slot accept `children` (Stack, Grid, Split, Tabs, Container, Card, Section, and Drawer). `watch` maps state paths to an action step or chain.
|
|
474
530
|
|
|
475
|
-
## Component catalog (all
|
|
531
|
+
## Component catalog (all 35)
|
|
476
532
|
|
|
477
533
|
Props reject unknown keys. A `{"$state":"..."}` binding may replace a literal prop value at any depth.
|
|
478
534
|
|
|
@@ -497,7 +553,8 @@ Tones: Badge, Metric and Progress `tone` take `neutral`, `success`, `active`, `e
|
|
|
497
553
|
| `NumberInput` | `id` | `label`, `placeholder`, `min`, `max`; a text field with a decimal keyboard that writes the parsed number to `/ui/<id>/value` on every change (no debounce), or null when the field is empty; non-numeric text (a bare `-` mid-edit, letters) leaves the stored value untouched; `min`/`max` clamp the stored value and the visible text snaps to it when the field loses focus; no children. |
|
|
498
554
|
| `Chips` | `id`, `options` | Toggle chips for quick filters. `options` are strings or `{ value, label?, icon? }`; `multiple`; `label` (group name for screen readers). Writes a string or null to `/ui/<id>/value`, or a string array with `multiple`; pressing the selected chip clears it. |
|
|
499
555
|
| `Button` | `label` | `variant: "default", "secondary", "outline", "ghost", "destructive", or "destructive-outline"` (use `destructive-outline` for standalone deletes); `disabled` (constant or bound boolean); `busyWith: "<actionName>"` swaps the label for a spinner while that custom action's `/actions/<name>/status` is `"running"` (presses are ignored), then shows a check and `successLabel` for about 1.5s when it turns `"ok"`; `icon`, `iconPosition: "start" or "end"`; `size: "sm", "default", or "lg"`; `shortcut` (one key, shown as a keycap, presses the button); `hint` (tooltip); dispatch with element-level `on.press`. |
|
|
500
|
-
| `Metric` | `label`, `value` | The dashboard stat tile. `value` is string or number (empty renders an em dash); bind `loading` to `/queries/<name>/loading` for a skeleton while the query loads; `icon` with `tone` tinting its tile; `detail` (a line under the value); `trend: { direction: "up", "down", or "flat", label }`; `info` (explanation tooltip next to the label). |
|
|
556
|
+
| `Metric` | `label`, `value` | The dashboard stat tile. `value` is string or number (empty renders an em dash); bind `loading` to `/queries/<name>/loading` for a skeleton while the query loads; `icon` with `tone` tinting its tile; `detail` (a line under the value); `trend: { direction: "up", "down", or "flat", label }`; `info` (explanation tooltip next to the label). `sparkline`: a small trend line under the value in the `tone` color, from an array of numbers (`null` is a gap) or from rows (bind `/queries/<name>/data`) read through `sparklineKey`; fewer than two points draws nothing. |
|
|
557
|
+
| `Chart` | `kind`, `x`, `series` | `kind: "line", "area", or "bar"`; bind `data` / `loading` / `error` to a named query like Table. `x` is the row field on the x axis; `xType: "category"` (default, row order) or `"time"` (ISO date or epoch ms, sorted, date ticks; rows whose `x` does not parse are dropped). `series`: 1-8 `{ key, label?, color? }`, `color` one of `chart-1`..`chart-5`, `primary`, `success`, `warning`, `error`, `info`, `muted` (default palette, in order: `primary`, `chart-2`..`chart-5`). `stacked` stacks area and bar series (lines never stack). `format: "number"` (default), `"currency"` (with `currency`, an ISO code, default `USD`) or `"percent"` (values are ratios: 0.42 is 42%). Tooltip on hover; the legend shows with two or more series (`legend` forces it on or off). `height` 120-640 px (default 240); `emptyMessage` (default "No data yet"). `x` and every `series[].key` must be columns of the bound query's model. Wrap it in a `Card` for a title. |
|
|
501
558
|
| `Alert` | `message` | `title`, `tone: "info", "success", "warning", or "error"`, `icon` (overrides the tone icon), `actionLabel` (a button inside the callout that emits `press`; wire it with `on.press`). |
|
|
502
559
|
| `Badge` | `text` | `text` is string or number; `tone`; `icon` replaces the dot; `variant: "tag"` (default uppercase chip), `"status"` (sentence-case pill), `"count"` (numeric pill), or `"beta"` (the BETA tag); `status` (a lifecycle value renders the dashboard status chip); `hint` (tooltip; the beta tag's explanation). |
|
|
503
560
|
| `Icon` | `name` | `size: "sm", "md", or "lg"`, `tone: "default", "muted", "success", "warning", "error", or "info"`, `label` (accessible name; decorative without it). |
|
|
@@ -610,6 +667,8 @@ Shortcut details:
|
|
|
610
667
|
|
|
611
668
|
## Layout & interactivity
|
|
612
669
|
|
|
670
|
+
For a multi-page app that should feel like a product (a sidebar of pages, a sticky title bar with actions), set `layout: "sidebar"` (see Pages, routes, and page trees) instead of building navigation out of Tabs or button rows. Pair `Metric` tiles (with `sparkline`) in a `Grid` with `Chart`s inside `Card`s for dashboards.
|
|
671
|
+
|
|
613
672
|
Use `Stack` as the primary page and section layout; `Container` is the legacy two-prop primitive retained for existing pages. Stack supports vertical or horizontal flow, shared spacing, alignment, justification, wrapping, and padding; row Stacks (filter bars, button rows) should set `collapseBelow: "sm"|"md"|"lg"` so they stack vertically on phones. Use `Grid` for responsive card or metric strips: a bare column count is responsive shorthand (1 column on phones, 2 from `sm`, the count from `md` up), or pin breakpoints explicitly with `{ "base": 1, "md": 2, "lg": 3 }`. `Grid` and `Split` also accept `padding` on the shared spacing scale.
|
|
614
673
|
|
|
615
674
|
`Stack` and `Split` size to their content by default, so a page scrolls as a whole. Set `fill: true` to make one grow to fill the remaining height of a `fill`-aware parent (another `fill` Stack or Split) instead; chain it from the page root down through every container on the path to the element that should scroll, and that element scrolls within whatever height is left while the page itself does not. A non-`fill` sibling (a toolbar, a header) keeps its natural height and the `fill` sibling absorbs the rest. A `fill` Split stretches both panes to the full row height, so nesting a `fill` Split inside one pane of another `fill` Split is the way to build a three-or-more column viewport-height layout (`ratio` is only ever two panes).
|
|
@@ -61,6 +61,7 @@ Fetch the page as markdown: `curl -fsSL https://docs.agent-swarm.dev/llms.mdx/do
|
|
|
61
61
|
## Guides
|
|
62
62
|
|
|
63
63
|
- [Choosing an AI operating model](https://docs.agent-swarm.dev/docs/guides/choosing-an-ai-operating-model). Reference.
|
|
64
|
+
- [Small tech team operating model](https://docs.agent-swarm.dev/docs/guides/small-tech-team-operating-model). Reference.
|
|
64
65
|
- [Deployment Guide](https://docs.agent-swarm.dev/docs/guides/deployment). When: Someone wants to run Agent Swarm on their own server with Docker Compose.
|
|
65
66
|
- [One-click deploy](https://docs.agent-swarm.dev/docs/guides/one-click-deploy). When: Someone has no server yet and wants Agent Swarm running in the cloud with HTTPS.
|
|
66
67
|
- [Kubernetes and Helm](https://docs.agent-swarm.dev/docs/guides/kubernetes). When: Someone wants to install Agent Swarm on Kubernetes.
|
|
@@ -70,6 +71,7 @@ Fetch the page as markdown: `curl -fsSL https://docs.agent-swarm.dev/llms.mdx/do
|
|
|
70
71
|
- [Asset Namespaces](https://docs.agent-swarm.dev/docs/guides/asset-namespaces). Reference.
|
|
71
72
|
- [agent-fs Co-deployment](https://docs.agent-swarm.dev/docs/guides/agent-fs-co-deployment). When: Someone wants shared persistent files for agents on a self-hosted swarm.
|
|
72
73
|
- [Self-Hosted SSO](https://docs.agent-swarm.dev/docs/guides/self-hosted-sso). When: Someone wants their self-hosted swarm dashboard behind single sign-on.
|
|
74
|
+
- [AI operations governance for small companies](https://docs.agent-swarm.dev/docs/guides/ai-operations-governance). Reference.
|
|
73
75
|
- [E2B Provider Smoke Tests](https://docs.agent-swarm.dev/docs/guides/e2b-provider-smoke-tests). Reference.
|
|
74
76
|
- [Evals Harness](https://docs.agent-swarm.dev/docs/guides/evals-harness). Reference.
|
|
75
77
|
- [Personalization & Status](https://docs.agent-swarm.dev/docs/guides/personalization). Reference.
|
|
@@ -73,7 +73,7 @@ export default async function (args: z.infer<typeof argsSchema>, ctx: ScriptCont
|
|
|
73
73
|
- `agentId` is propagated through the `X-Agent-ID` header, so SDK calls run as you. `taskId` is not ambient: pass it in `args` when the script calls `task_storeProgress`.
|
|
74
74
|
- A script invoked from a workflow node may run under a workflow identity. The node may also supply arguments the script needs: when you run that script directly, pass the same arguments the node maps. A script without a strict `argsSchema` then fails deeper in, often as a not-found or resource error instead of a validation error.
|
|
75
75
|
- Return compact structured data. Raw logs, full HTML, big JSON arrays, and file contents stay inside the script.
|
|
76
|
-
- Limits: about 30 s wall clock (up to 5 minutes where the tool exposes it), 1 MB stdout. Never sleep or loop past about 25 s. Chain `wait-for-task` calls instead. The cap also applies to a script called through `ctx.step.swarmScript`; the step's `timeoutMs` does not extend it. A long LLM call, such as a 2,000-word draft, goes in a `ctx.step.rawLlm` step inside `launch-script-run`, never in a called script. A `targetType: "script"` schedule gets 60 s; a manual `script-run` gets 30 s, so a candidate that finishes well under 30 s by hand has margin on the schedule. A nested `ctx.swarm.script_run` gets its own 30 s but runs inside its caller's remaining time: run slow children as sibling calls from the outer script, not deeper in the chain.
|
|
76
|
+
- Limits: about 30 s wall clock (up to 5 minutes where the tool exposes it), 1 MB stdout. Never sleep or loop past about 25 s. Chain `wait-for-task` calls instead. The cap also applies to a script called through `ctx.step.swarmScript`; the step's `timeoutMs` does not extend it. A long LLM call, such as a 2,000-word draft, goes in a `ctx.step.rawLlm` step inside `launch-script-run`, never in a called script. A `targetType: "script"` schedule gets 60 s; a manual `script-run` gets 30 s, so a candidate that finishes well under 30 s by hand has margin on the schedule. A nested `ctx.swarm.script_run` gets its own 30 s but runs inside its caller's remaining time: run slow children as sibling calls from the outer script, not deeper in the chain. The run ends when your default export resolves. A call you did not await gets about 2 s more and is then stopped (`quickjs` aborts it at once), so await every write that must land. That makes a `Promise.race` deadline bound the run; a nested `script_run` that lost the race keeps running on the server under its own 30 s.
|
|
77
77
|
|
|
78
78
|
### What `ctx` holds
|
|
79
79
|
|
|
@@ -68,7 +68,7 @@ export default async function (args: z.infer<typeof argsSchema>, ctx: ScriptCont
|
|
|
68
68
|
- `agentId` is propagated through the `X-Agent-ID` header, so SDK calls run as you. `taskId` is not ambient: pass it in `args` when the script calls `task_storeProgress`.
|
|
69
69
|
- A script invoked from a workflow node may run under a workflow identity. The node may also supply arguments the script needs: when you run that script directly, pass the same arguments the node maps. A script without a strict `argsSchema` then fails deeper in, often as a not-found or resource error instead of a validation error.
|
|
70
70
|
- Return compact structured data. Raw logs, full HTML, big JSON arrays, and file contents stay inside the script.
|
|
71
|
-
- Limits: about 30 s wall clock (up to 5 minutes where the tool exposes it), 1 MB stdout. Never sleep or loop past about 25 s. Chain `wait-for-task` calls instead. The cap also applies to a script called through `ctx.step.swarmScript`; the step's `timeoutMs` does not extend it. A long LLM call, such as a 2,000-word draft, goes in a `ctx.step.rawLlm` step inside `launch-script-run`, never in a called script. A `targetType: "script"` schedule gets 60 s; a manual `script-run` gets 30 s, so a candidate that finishes well under 30 s by hand has margin on the schedule. A nested `ctx.swarm.script_run` gets its own 30 s but runs inside its caller's remaining time: run slow children as sibling calls from the outer script, not deeper in the chain.
|
|
71
|
+
- Limits: about 30 s wall clock (up to 5 minutes where the tool exposes it), 1 MB stdout. Never sleep or loop past about 25 s. Chain `wait-for-task` calls instead. The cap also applies to a script called through `ctx.step.swarmScript`; the step's `timeoutMs` does not extend it. A long LLM call, such as a 2,000-word draft, goes in a `ctx.step.rawLlm` step inside `launch-script-run`, never in a called script. A `targetType: "script"` schedule gets 60 s; a manual `script-run` gets 30 s, so a candidate that finishes well under 30 s by hand has margin on the schedule. A nested `ctx.swarm.script_run` gets its own 30 s but runs inside its caller's remaining time: run slow children as sibling calls from the outer script, not deeper in the chain. The run ends when your default export resolves. A call you did not await gets about 2 s more and is then stopped (`quickjs` aborts it at once), so await every write that must land. That makes a `Promise.race` deadline bound the run; a nested `script_run` that lost the race keeps running on the server under its own 30 s.
|
|
72
72
|
|
|
73
73
|
### What `ctx` holds
|
|
74
74
|
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isUserAllowed2,
|
|
3
|
-
registerMessageHandler2,
|
|
4
|
-
init_handlers
|
|
5
|
-
} from "./cli-8fknbnhw.js";
|
|
6
|
-
import"./cli-rmmpt0wm.js";
|
|
7
|
-
import"./cli-6t09sdhy.js";
|
|
8
|
-
import"./cli-rfywm85n.js";
|
|
9
|
-
import"./cli-4txa0ter.js";
|
|
10
|
-
import"./cli-f3vq58d2.js";
|
|
11
|
-
import"./cli-j790gp2w.js";
|
|
12
|
-
import"./cli-sdtt3men.js";
|
|
13
|
-
import"./cli-7cp6aa1q.js";
|
|
14
|
-
import"./cli-m28atx8q.js";
|
|
15
|
-
import"./cli-n9ftpys4.js";
|
|
16
|
-
import"./cli-pasjcnmj.js";
|
|
17
|
-
import"./cli-qfedvmcr.js";
|
|
18
|
-
import"./cli-p1bq50aa.js";
|
|
19
|
-
import"./cli-a7wvp2km.js";
|
|
20
|
-
import"./cli-qsnnd04k.js";
|
|
21
|
-
import"./cli-s7t6p9my.js";
|
|
22
|
-
import"./cli-8kzasymh.js";
|
|
23
|
-
import"./cli-c55z5chy.js";
|
|
24
|
-
import"./cli-gxkx0zzp.js";
|
|
25
|
-
import"./cli-h38x262p.js";
|
|
26
|
-
import"./cli-eddnyg3t.js";
|
|
27
|
-
init_handlers();
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
isUserAllowed2 as isUserAllowed,
|
|
31
|
-
registerMessageHandler2 as registerMessageHandler
|
|
32
|
-
};
|
package/dist/index-835xdgnm.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
calculateNextRun2,
|
|
3
|
-
startScheduler2,
|
|
4
|
-
stopScheduler2,
|
|
5
|
-
runScheduleNow2,
|
|
6
|
-
init_scheduler2
|
|
7
|
-
} from "./cli-rfywm85n.js";
|
|
8
|
-
import"./cli-4txa0ter.js";
|
|
9
|
-
import"./cli-f3vq58d2.js";
|
|
10
|
-
import"./cli-j790gp2w.js";
|
|
11
|
-
import"./cli-sdtt3men.js";
|
|
12
|
-
import"./cli-7cp6aa1q.js";
|
|
13
|
-
import"./cli-m28atx8q.js";
|
|
14
|
-
import"./cli-n9ftpys4.js";
|
|
15
|
-
import"./cli-pasjcnmj.js";
|
|
16
|
-
import"./cli-qfedvmcr.js";
|
|
17
|
-
import"./cli-p1bq50aa.js";
|
|
18
|
-
import"./cli-a7wvp2km.js";
|
|
19
|
-
import"./cli-qsnnd04k.js";
|
|
20
|
-
import"./cli-s7t6p9my.js";
|
|
21
|
-
import"./cli-8kzasymh.js";
|
|
22
|
-
import"./cli-c55z5chy.js";
|
|
23
|
-
import"./cli-gxkx0zzp.js";
|
|
24
|
-
import"./cli-h38x262p.js";
|
|
25
|
-
import"./cli-eddnyg3t.js";
|
|
26
|
-
init_scheduler2();
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
calculateNextRun2 as calculateNextRun,
|
|
30
|
-
runScheduleNow2 as runScheduleNow,
|
|
31
|
-
startScheduler2 as startScheduler,
|
|
32
|
-
stopScheduler2 as stopScheduler
|
|
33
|
-
};
|
package/dist/index-d469300x.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getExecutorRegistry2,
|
|
3
|
-
initWorkflows2,
|
|
4
|
-
init_workflows
|
|
5
|
-
} from "./cli-rfywm85n.js";
|
|
6
|
-
import"./cli-4txa0ter.js";
|
|
7
|
-
import"./cli-f3vq58d2.js";
|
|
8
|
-
import"./cli-j790gp2w.js";
|
|
9
|
-
import"./cli-sdtt3men.js";
|
|
10
|
-
import"./cli-7cp6aa1q.js";
|
|
11
|
-
import"./cli-m28atx8q.js";
|
|
12
|
-
import"./cli-n9ftpys4.js";
|
|
13
|
-
import {
|
|
14
|
-
retryFailedRun2,
|
|
15
|
-
cancelWorkflowRun2
|
|
16
|
-
} from "./cli-pasjcnmj.js";
|
|
17
|
-
import {
|
|
18
|
-
startWorkflowExecution2
|
|
19
|
-
} from "./cli-qfedvmcr.js";
|
|
20
|
-
import"./cli-p1bq50aa.js";
|
|
21
|
-
import"./cli-a7wvp2km.js";
|
|
22
|
-
import"./cli-qsnnd04k.js";
|
|
23
|
-
import"./cli-s7t6p9my.js";
|
|
24
|
-
import"./cli-8kzasymh.js";
|
|
25
|
-
import"./cli-c55z5chy.js";
|
|
26
|
-
import"./cli-gxkx0zzp.js";
|
|
27
|
-
import"./cli-h38x262p.js";
|
|
28
|
-
import"./cli-eddnyg3t.js";
|
|
29
|
-
init_workflows();
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
cancelWorkflowRun2 as cancelWorkflowRun,
|
|
33
|
-
getExecutorRegistry2 as getExecutorRegistry,
|
|
34
|
-
initWorkflows2 as initWorkflows,
|
|
35
|
-
retryFailedRun2 as retryFailedRun,
|
|
36
|
-
startWorkflowExecution2 as startWorkflowExecution
|
|
37
|
-
};
|
package/dist/index-rzqwp11g.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import"./cli-ns59dc6r.js";
|
|
2
|
-
import {
|
|
3
|
-
parseHeartbeatIntervalMs2,
|
|
4
|
-
startHeartbeat2,
|
|
5
|
-
stopHeartbeat2
|
|
6
|
-
} from "./cli-abejgen1.js";
|
|
7
|
-
import"./cli-6wxjceza.js";
|
|
8
|
-
import"./cli-m4dqmnbp.js";
|
|
9
|
-
import"./cli-rfywm85n.js";
|
|
10
|
-
import"./cli-4txa0ter.js";
|
|
11
|
-
import"./cli-f3vq58d2.js";
|
|
12
|
-
import"./cli-j790gp2w.js";
|
|
13
|
-
import"./cli-sdtt3men.js";
|
|
14
|
-
import"./cli-7cp6aa1q.js";
|
|
15
|
-
import"./cli-m28atx8q.js";
|
|
16
|
-
import"./cli-n9ftpys4.js";
|
|
17
|
-
import"./cli-pasjcnmj.js";
|
|
18
|
-
import"./cli-qfedvmcr.js";
|
|
19
|
-
import"./cli-p1bq50aa.js";
|
|
20
|
-
import"./cli-a7wvp2km.js";
|
|
21
|
-
import"./cli-qsnnd04k.js";
|
|
22
|
-
import"./cli-s7t6p9my.js";
|
|
23
|
-
import"./cli-8kzasymh.js";
|
|
24
|
-
import"./cli-c55z5chy.js";
|
|
25
|
-
import"./cli-gxkx0zzp.js";
|
|
26
|
-
import"./cli-h38x262p.js";
|
|
27
|
-
import"./cli-eddnyg3t.js";
|
|
28
|
-
export {
|
|
29
|
-
parseHeartbeatIntervalMs2 as parseHeartbeatIntervalMs,
|
|
30
|
-
startHeartbeat2 as startHeartbeat,
|
|
31
|
-
stopHeartbeat2 as stopHeartbeat
|
|
32
|
-
};
|
package/dist/lead-yqt47dkr.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import"./cli-h38x262p.js";
|
|
2
|
-
import"./cli-c55z5chy.js";
|
|
3
|
-
import"./cli-4txa0ter.js";
|
|
4
|
-
import"./cli-f3vq58d2.js";
|
|
5
|
-
import"./cli-eddnyg3t.js";
|
|
6
|
-
import"./cli-qsnnd04k.js";
|
|
7
|
-
import"./cli-p1bq50aa.js";
|
|
8
|
-
import"./cli-pasjcnmj.js";
|
|
9
|
-
import {
|
|
10
|
-
getEnabledCapabilities,
|
|
11
|
-
init_server
|
|
12
|
-
} from "./cli-rfywm85n.js";
|
|
13
|
-
import"./cli-7cp6aa1q.js";
|
|
14
|
-
import"./cli-n9ftpys4.js";
|
|
15
|
-
import"./cli-8kzasymh.js";
|
|
16
|
-
import"./cli-m28atx8q.js";
|
|
17
|
-
import"./cli-ee0b971j.js";
|
|
18
|
-
import"./cli-2gxeg5gr.js";
|
|
19
|
-
import {
|
|
20
|
-
runAgent
|
|
21
|
-
} from "./cli-p2gfst4m.js";
|
|
22
|
-
import"./cli-jrzkw01m.js";
|
|
23
|
-
import"./cli-77cd6gy8.js";
|
|
24
|
-
import"./cli-kc7v1nfv.js";
|
|
25
|
-
import"./cli-d6521kb5.js";
|
|
26
|
-
import"./cli-xzm9vcfg.js";
|
|
27
|
-
import"./cli-m23zjcy2.js";
|
|
28
|
-
import"./cli-qmqk2yc2.js";
|
|
29
|
-
import"./cli-8aes17e4.js";
|
|
30
|
-
import"./cli-g70vxtjh.js";
|
|
31
|
-
import"./cli-d82btycs.js";
|
|
32
|
-
import"./cli-0726awxw.js";
|
|
33
|
-
import"./cli-qa4wdgsy.js";
|
|
34
|
-
import"./cli-y97qxcfx.js";
|
|
35
|
-
import"./cli-4bd1rck6.js";
|
|
36
|
-
import"./cli-98rwmcyc.js";
|
|
37
|
-
import"./cli-t73cas91.js";
|
|
38
|
-
import"./cli-ffhtssbp.js";
|
|
39
|
-
import"./cli-m5akxq8q.js";
|
|
40
|
-
import"./cli-kr5tjjtz.js";
|
|
41
|
-
import"./cli-2wnq8jkz.js";
|
|
42
|
-
import"./cli-7b8sbmag.js";
|
|
43
|
-
import"./cli-mrt48bx7.js";
|
|
44
|
-
import"./cli-wk18cm92.js";
|
|
45
|
-
import"./cli-rzsy6nc6.js";
|
|
46
|
-
import"./cli-tqegb8eq.js";
|
|
47
|
-
import"./cli-7p1kvkck.js";
|
|
48
|
-
import"./cli-yq3zak69.js";
|
|
49
|
-
import"./cli-wcg8x116.js";
|
|
50
|
-
import"./cli-j790gp2w.js";
|
|
51
|
-
import"./cli-sdtt3men.js";
|
|
52
|
-
import"./cli-qfedvmcr.js";
|
|
53
|
-
import"./cli-a7wvp2km.js";
|
|
54
|
-
import"./cli-s7t6p9my.js";
|
|
55
|
-
import"./cli-gxkx0zzp.js";
|
|
56
|
-
|
|
57
|
-
// src/commands/lead.ts
|
|
58
|
-
init_server();
|
|
59
|
-
var leadConfig = {
|
|
60
|
-
role: "lead",
|
|
61
|
-
defaultPrompt: "/start-leader",
|
|
62
|
-
metadataType: "lead_metadata",
|
|
63
|
-
capabilities: getEnabledCapabilities()
|
|
64
|
-
};
|
|
65
|
-
async function runLead(opts) {
|
|
66
|
-
return runAgent(leadConfig, opts);
|
|
67
|
-
}
|
|
68
|
-
export {
|
|
69
|
-
runLead
|
|
70
|
-
};
|
package/dist/worker-j6xxtq7p.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import"./cli-h38x262p.js";
|
|
2
|
-
import"./cli-c55z5chy.js";
|
|
3
|
-
import"./cli-4txa0ter.js";
|
|
4
|
-
import"./cli-f3vq58d2.js";
|
|
5
|
-
import"./cli-eddnyg3t.js";
|
|
6
|
-
import"./cli-qsnnd04k.js";
|
|
7
|
-
import"./cli-p1bq50aa.js";
|
|
8
|
-
import"./cli-pasjcnmj.js";
|
|
9
|
-
import {
|
|
10
|
-
getEnabledCapabilities,
|
|
11
|
-
init_server
|
|
12
|
-
} from "./cli-rfywm85n.js";
|
|
13
|
-
import"./cli-7cp6aa1q.js";
|
|
14
|
-
import"./cli-n9ftpys4.js";
|
|
15
|
-
import"./cli-8kzasymh.js";
|
|
16
|
-
import"./cli-m28atx8q.js";
|
|
17
|
-
import"./cli-ee0b971j.js";
|
|
18
|
-
import"./cli-2gxeg5gr.js";
|
|
19
|
-
import {
|
|
20
|
-
runAgent
|
|
21
|
-
} from "./cli-p2gfst4m.js";
|
|
22
|
-
import"./cli-jrzkw01m.js";
|
|
23
|
-
import"./cli-77cd6gy8.js";
|
|
24
|
-
import"./cli-kc7v1nfv.js";
|
|
25
|
-
import"./cli-d6521kb5.js";
|
|
26
|
-
import"./cli-xzm9vcfg.js";
|
|
27
|
-
import"./cli-m23zjcy2.js";
|
|
28
|
-
import"./cli-qmqk2yc2.js";
|
|
29
|
-
import"./cli-8aes17e4.js";
|
|
30
|
-
import"./cli-g70vxtjh.js";
|
|
31
|
-
import"./cli-d82btycs.js";
|
|
32
|
-
import"./cli-0726awxw.js";
|
|
33
|
-
import"./cli-qa4wdgsy.js";
|
|
34
|
-
import"./cli-y97qxcfx.js";
|
|
35
|
-
import"./cli-4bd1rck6.js";
|
|
36
|
-
import"./cli-98rwmcyc.js";
|
|
37
|
-
import"./cli-t73cas91.js";
|
|
38
|
-
import"./cli-ffhtssbp.js";
|
|
39
|
-
import"./cli-m5akxq8q.js";
|
|
40
|
-
import"./cli-kr5tjjtz.js";
|
|
41
|
-
import"./cli-2wnq8jkz.js";
|
|
42
|
-
import"./cli-7b8sbmag.js";
|
|
43
|
-
import"./cli-mrt48bx7.js";
|
|
44
|
-
import"./cli-wk18cm92.js";
|
|
45
|
-
import"./cli-rzsy6nc6.js";
|
|
46
|
-
import"./cli-tqegb8eq.js";
|
|
47
|
-
import"./cli-7p1kvkck.js";
|
|
48
|
-
import"./cli-yq3zak69.js";
|
|
49
|
-
import"./cli-wcg8x116.js";
|
|
50
|
-
import"./cli-j790gp2w.js";
|
|
51
|
-
import"./cli-sdtt3men.js";
|
|
52
|
-
import"./cli-qfedvmcr.js";
|
|
53
|
-
import"./cli-a7wvp2km.js";
|
|
54
|
-
import"./cli-s7t6p9my.js";
|
|
55
|
-
import"./cli-gxkx0zzp.js";
|
|
56
|
-
|
|
57
|
-
// src/commands/worker.ts
|
|
58
|
-
init_server();
|
|
59
|
-
var workerConfig = {
|
|
60
|
-
role: "worker",
|
|
61
|
-
defaultPrompt: "/start-worker",
|
|
62
|
-
metadataType: "worker_metadata",
|
|
63
|
-
capabilities: getEnabledCapabilities()
|
|
64
|
-
};
|
|
65
|
-
async function runWorker(opts) {
|
|
66
|
-
return runAgent(workerConfig, opts);
|
|
67
|
-
}
|
|
68
|
-
export {
|
|
69
|
-
runWorker
|
|
70
|
-
};
|