@sixb/core 0.2.4 → 0.2.6
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/actions/index.js +41 -40
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/validation.d.ts.map +1 -1
- package/dist/agents/errors.d.ts +1 -1
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +50 -3
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +2 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +7 -5
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +74 -50
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-routing.d.ts +5 -2
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/queued-turn.d.ts +16 -0
- package/dist/agents/queued-turn.d.ts.map +1 -0
- package/dist/agents/request.d.ts +120 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-after-finish.d.ts +10 -0
- package/dist/agents/run-after-finish.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +0 -38
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-events.d.ts +10 -1
- package/dist/agents/run-events.d.ts.map +1 -1
- package/dist/agents/run-session-children.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session.d.ts +14 -1
- package/dist/agents/run-session.d.ts.map +1 -1
- package/dist/agents/run-turn.d.ts +9 -1
- package/dist/agents/run-turn.d.ts.map +1 -1
- package/dist/agents/streams/index.d.ts +1 -1
- package/dist/agents/streams/index.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.d.ts +2 -1
- package/dist/agents/streams/internal.d.ts.map +1 -1
- package/dist/agents/streams/internal.js +22 -2
- package/dist/agents/streams/internal.js.map +1 -1
- package/dist/agents/streams/protocol.d.ts +53 -0
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/streams/steps.d.ts +24 -0
- package/dist/agents/streams/steps.d.ts.map +1 -0
- package/dist/agents/thread-access.d.ts +44 -2
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/agents/turn-answered.d.ts +7 -0
- package/dist/agents/turn-answered.d.ts.map +1 -0
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/artifacts/canvas-display.d.ts +3 -5
- package/dist/artifacts/canvas-display.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +14 -3
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/document-fill.d.ts +18 -0
- package/dist/artifacts/document-fill.d.ts.map +1 -0
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/events.d.ts +3 -2
- package/dist/artifacts/events.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +40 -4
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +8 -1
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/document-data.d.ts +98 -0
- package/dist/artifacts/frames/document-data.d.ts.map +1 -0
- package/dist/artifacts/frames/entries.d.ts +12 -7
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/index.d.ts +2 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +22 -13
- package/dist/artifacts/frames/index.js.map +4 -4
- package/dist/artifacts/frames/kit.d.ts +15 -0
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +12 -1
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +24 -4
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +3 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +9 -3
- package/dist/artifacts/index.js.map +3 -3
- package/dist/artifacts/live/blocks.d.ts +62 -0
- package/dist/artifacts/live/blocks.d.ts.map +1 -0
- package/dist/artifacts/live/board.d.ts +6 -0
- package/dist/artifacts/live/board.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts +12 -0
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +2 -0
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +148 -44
- package/dist/artifacts/live/index.js.map +3 -3
- package/dist/artifacts/live/page.d.ts +49 -0
- package/dist/artifacts/live/page.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.d.ts +5 -0
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +2 -2
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +29 -24
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +4 -1
- package/dist/artifacts/live/state.d.ts.map +1 -1
- package/dist/artifacts/outline.d.ts +16 -0
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/paper.d.ts +22 -0
- package/dist/artifacts/paper.d.ts.map +1 -0
- package/dist/artifacts/pdf-job.d.ts +9 -0
- package/dist/artifacts/pdf-job.d.ts.map +1 -0
- package/dist/artifacts/publish/fields.d.ts +25 -0
- package/dist/artifacts/publish/fields.d.ts.map +1 -0
- package/dist/artifacts/publish/index.d.ts +2 -1
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +32 -23
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +7 -6
- package/dist/artifacts/publish/merge.d.ts.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts +28 -0
- package/dist/artifacts/publish/pdf.d.ts.map +1 -0
- package/dist/artifacts/publish/previews.d.ts +12 -20
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/queries.d.ts +6 -1
- package/dist/artifacts/publish/queries.d.ts.map +1 -1
- package/dist/artifacts/publish/query-answers.d.ts +5 -2
- package/dist/artifacts/publish/query-answers.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/document-html.d.ts +24 -0
- package/dist/artifacts/publish/validate/document-html.d.ts.map +1 -0
- package/dist/artifacts/publish/validate/document.d.ts +5 -3
- package/dist/artifacts/publish/validate/document.d.ts.map +1 -1
- package/dist/artifacts/queries.d.ts +16 -2
- package/dist/artifacts/queries.d.ts.map +1 -1
- package/dist/artifacts/run-query.d.ts.map +1 -1
- package/dist/auth/index.js +6 -6
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/index.js +2 -2
- package/dist/blob-storage/index.js +1 -1
- package/dist/bootstrap/index.js +50 -48
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/calendar.d.ts +55 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +19 -0
- package/dist/calendar.js.map +9 -0
- package/dist/{chunk-5a4a52tq.js → chunk-0pmpwn3g.js} +18 -2
- package/dist/chunk-0pmpwn3g.js.map +10 -0
- package/dist/{chunk-0k3r5kb3.js → chunk-394zjzjs.js} +20 -10
- package/dist/{chunk-0k3r5kb3.js.map → chunk-394zjzjs.js.map} +5 -5
- package/dist/{chunk-stmxh0hv.js → chunk-3neam1y5.js} +2 -2
- package/dist/{chunk-zeykm8my.js → chunk-3qtk0070.js} +16 -42
- package/dist/chunk-3qtk0070.js.map +14 -0
- package/dist/{chunk-p8pgnq8d.js → chunk-425ydk65.js} +5 -5
- package/dist/{chunk-p351afzm.js → chunk-5sswe5ej.js} +2 -2
- package/dist/{chunk-a6fjkcne.js → chunk-60662fyv.js} +54 -28
- package/dist/{chunk-a6fjkcne.js.map → chunk-60662fyv.js.map} +7 -6
- package/dist/{chunk-e0hnbb1m.js → chunk-61zptves.js} +1 -1
- package/dist/chunk-6hfbz4d0.js +98 -0
- package/dist/chunk-6hfbz4d0.js.map +10 -0
- package/dist/{chunk-3zagkr6w.js → chunk-7mhbs9yy.js} +4 -4
- package/dist/{chunk-3zagkr6w.js.map → chunk-7mhbs9yy.js.map} +1 -1
- package/dist/{chunk-gxwy4c3s.js → chunk-7r9mqpva.js} +570 -104
- package/dist/chunk-7r9mqpva.js.map +47 -0
- package/dist/{chunk-3014rfjz.js → chunk-88xeh6zx.js} +28 -8
- package/dist/{chunk-3014rfjz.js.map → chunk-88xeh6zx.js.map} +4 -4
- package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
- package/dist/chunk-8tv3qd65.js.map +12 -0
- package/dist/chunk-90nqenq8.js +386 -0
- package/dist/chunk-90nqenq8.js.map +14 -0
- package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
- package/dist/{chunk-w1wq7gfr.js → chunk-9c9yknwt.js} +464 -29
- package/dist/{chunk-w1wq7gfr.js.map → chunk-9c9yknwt.js.map} +7 -7
- package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
- package/dist/chunk-9wr3yajk.js.map +2 -2
- package/dist/{chunk-rtm1jq00.js → chunk-ats8y3d9.js} +1202 -246
- package/dist/{chunk-rtm1jq00.js.map → chunk-ats8y3d9.js.map} +16 -14
- package/dist/{chunk-td26wjr5.js → chunk-bcz9dxtf.js} +17 -47
- package/dist/chunk-bcz9dxtf.js.map +12 -0
- package/dist/chunk-bqr703h4.js +1799 -0
- package/dist/chunk-bqr703h4.js.map +13 -0
- package/dist/{chunk-sysnvjce.js → chunk-brhp9d97.js} +2 -2
- package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
- package/dist/{chunk-rsxb14an.js → chunk-bs1sd0e0.js} +12 -8
- package/dist/chunk-bs1sd0e0.js.map +18 -0
- package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
- package/dist/chunk-c29729me.js.map +12 -0
- package/dist/{chunk-855w9nvw.js → chunk-cg7cygfj.js} +1 -1
- package/dist/chunk-dq3t5sr3.js +114 -0
- package/dist/chunk-dq3t5sr3.js.map +11 -0
- package/dist/{chunk-t24yktqr.js → chunk-dvgc56n2.js} +20 -4
- package/dist/{chunk-t24yktqr.js.map → chunk-dvgc56n2.js.map} +5 -5
- package/dist/{chunk-r2psmn42.js → chunk-eg6xqef7.js} +1 -1
- package/dist/{chunk-7kpqntgw.js → chunk-f05994as.js} +1 -1
- package/dist/{chunk-msyevpp3.js → chunk-fmgf9h5e.js} +38 -14
- package/dist/chunk-fmgf9h5e.js.map +22 -0
- package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
- package/dist/chunk-fzbhybya.js.map +11 -0
- package/dist/{chunk-t0s7b3d1.js → chunk-gaj8djsw.js} +251 -6
- package/dist/chunk-gaj8djsw.js.map +13 -0
- package/dist/{chunk-2bn6813a.js → chunk-grt2j5vp.js} +2 -2
- package/dist/{chunk-s7xqfxs9.js → chunk-hkbks1xm.js} +3 -1
- package/dist/{chunk-s7xqfxs9.js.map → chunk-hkbks1xm.js.map} +3 -3
- package/dist/chunk-hn2r7z41.js.map +1 -1
- package/dist/{chunk-rtdrm592.js → chunk-htdzx40w.js} +2 -2
- package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
- package/dist/{chunk-yy914zfr.js → chunk-jt012fxq.js} +772 -98
- package/dist/chunk-jt012fxq.js.map +34 -0
- package/dist/{chunk-48c1z8nj.js → chunk-kft7mp7z.js} +28 -3
- package/dist/chunk-kft7mp7z.js.map +10 -0
- package/dist/chunk-mbwsgjn7.js +40 -0
- package/dist/chunk-mbwsgjn7.js.map +11 -0
- package/dist/{chunk-wa05txmk.js → chunk-n1hbwc6y.js} +51 -8
- package/dist/chunk-n1hbwc6y.js.map +12 -0
- package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
- package/dist/chunk-nxysqbt0.js.map +10 -0
- package/dist/{chunk-6ef4esq4.js → chunk-pqj8vff9.js} +4 -4
- package/dist/chunk-pvpq483h.js.map +2 -2
- package/dist/{chunk-mzx71snp.js → chunk-q7g9cqwt.js} +7 -2
- package/dist/{chunk-mzx71snp.js.map → chunk-q7g9cqwt.js.map} +3 -3
- package/dist/{chunk-n68vz95m.js → chunk-qbd282aa.js} +2 -2
- package/dist/{chunk-e91fmg6t.js → chunk-qsa7nw6f.js} +2 -1
- package/dist/{chunk-e91fmg6t.js.map → chunk-qsa7nw6f.js.map} +3 -3
- package/dist/{chunk-rsrc7vtw.js → chunk-s8xxef60.js} +240 -46
- package/dist/chunk-s8xxef60.js.map +50 -0
- package/dist/{chunk-r9rtavg9.js → chunk-t19wjmnc.js} +7 -7
- package/dist/{chunk-vzkxqf8h.js → chunk-tapdssb5.js} +50 -6
- package/dist/chunk-tapdssb5.js.map +23 -0
- package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
- package/dist/{chunk-hvbvq7p4.js → chunk-vs2s3p8n.js} +731 -10
- package/dist/chunk-vs2s3p8n.js.map +20 -0
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-8t2ynwg0.js → chunk-wzcjhv54.js} +31 -1
- package/dist/{chunk-8t2ynwg0.js.map → chunk-wzcjhv54.js.map} +3 -3
- package/dist/{chunk-8tqnsx3q.js → chunk-xavet0qs.js} +5 -3
- package/dist/{chunk-8tqnsx3q.js.map → chunk-xavet0qs.js.map} +3 -3
- package/dist/{chunk-8bns0y68.js → chunk-xf76csps.js} +5 -5
- package/dist/{chunk-cwdzcv37.js → chunk-xrmbhap8.js} +2 -2
- package/dist/{chunk-cwdzcv37.js.map → chunk-xrmbhap8.js.map} +2 -2
- package/dist/{chunk-f6ahf5gf.js → chunk-xxfj0rr2.js} +20 -5
- package/dist/chunk-xxfj0rr2.js.map +13 -0
- package/dist/{chunk-3hzhcfsv.js → chunk-y8fwm3z2.js} +2 -2
- package/dist/{chunk-3hzhcfsv.js.map → chunk-y8fwm3z2.js.map} +3 -3
- package/dist/{chunk-smnt672s.js → chunk-ygvay56w.js} +20 -4
- package/dist/chunk-ygvay56w.js.map +10 -0
- package/dist/{chunk-evj5jxz3.js → chunk-ykchk644.js} +63 -15
- package/dist/{chunk-evj5jxz3.js.map → chunk-ykchk644.js.map} +7 -7
- package/dist/{chunk-vepea5c3.js → chunk-ym1bqd98.js} +6 -6
- package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
- package/dist/chunk-z4jqb44a.js.map +10 -0
- package/dist/connectors/connection-handles.d.ts +9 -0
- package/dist/connectors/connection-handles.d.ts.map +1 -0
- package/dist/connectors/connections/authorizations.d.ts +9 -0
- package/dist/connectors/connections/authorizations.d.ts.map +1 -1
- package/dist/connectors/connections/capability.d.ts +11 -0
- package/dist/connectors/connections/capability.d.ts.map +1 -1
- package/dist/connectors/connections/events.d.ts +17 -0
- package/dist/connectors/connections/events.d.ts.map +1 -0
- package/dist/connectors/connections/internal.d.ts +2 -1
- package/dist/connectors/connections/internal.d.ts.map +1 -1
- package/dist/connectors/connections/internal.js +8 -4
- package/dist/connectors/connections/internal.js.map +1 -1
- package/dist/connectors/connections/runs.d.ts +3 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/connectors/connections/service.d.ts +13 -1
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/execution.d.ts +14 -2
- package/dist/connectors/execution.d.ts.map +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/service.d.ts +5 -1
- package/dist/connectors/service.d.ts.map +1 -1
- package/dist/connectors/types.d.ts +22 -1
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/datasets/write.js +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +3 -2
- package/dist/deploy/internal.js.map +3 -3
- package/dist/deploy/services.d.ts.map +1 -1
- package/dist/deploy/types.d.ts +22 -2
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/events/definitions.d.ts +4 -0
- package/dist/events/definitions.d.ts.map +1 -1
- package/dist/events/execution.d.ts +8 -1
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +3 -3
- package/dist/events/outbox-dispatcher.d.ts +7 -0
- package/dist/events/outbox-dispatcher.d.ts.map +1 -1
- package/dist/events/scope.d.ts +1 -0
- package/dist/events/scope.d.ts.map +1 -1
- package/dist/events/scope.js +1 -1
- package/dist/events/selectors/builder.d.ts +9 -1
- package/dist/events/selectors/builder.d.ts.map +1 -1
- package/dist/events/selectors/index.d.ts +2 -2
- package/dist/events/selectors/index.d.ts.map +1 -1
- package/dist/events/selectors/index.js +2 -2
- package/dist/events/selectors/predicate.d.ts.map +1 -1
- package/dist/events/selectors/types.d.ts +18 -3
- package/dist/events/selectors/types.d.ts.map +1 -1
- package/dist/events/types/artifacts.d.ts +7 -1
- package/dist/events/types/artifacts.d.ts.map +1 -1
- package/dist/events/types/connectors.d.ts +32 -0
- package/dist/events/types/connectors.d.ts.map +1 -0
- package/dist/events/types/index.d.ts +3 -1
- package/dist/events/types/index.d.ts.map +1 -1
- package/dist/events/types/syncs.d.ts +4 -0
- package/dist/events/types/syncs.d.ts.map +1 -1
- package/dist/execution/agent.js +43 -42
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts +5 -0
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +4 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/object-reader-ontology.d.ts +3 -0
- package/dist/execution/object-reader-ontology.d.ts.map +1 -1
- package/dist/execution/primitive.js +41 -40
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.d.ts +1 -1
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +39 -38
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/scopes.d.ts +8 -0
- package/dist/execution/scopes.d.ts.map +1 -1
- package/dist/execution/script.d.ts +7 -0
- package/dist/execution/script.d.ts.map +1 -0
- package/dist/execution/types.d.ts +16 -1
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +13 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -70
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +1 -1
- package/dist/lineage/executors.d.ts +1 -1
- package/dist/lineage/executors.d.ts.map +1 -1
- package/dist/maintenance/index.js +2 -2
- package/dist/materialization/event-envelopes.d.ts +3 -3
- package/dist/materialization/event-envelopes.d.ts.map +1 -1
- package/dist/materialization/events.d.ts +6 -0
- package/dist/materialization/events.d.ts.map +1 -1
- package/dist/materialization/index.js +1 -1
- package/dist/materialization/model.d.ts +6 -0
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/index.js +24 -23
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/replace.d.ts.map +1 -1
- package/dist/materializer/projections/replacement-plan.d.ts +2 -0
- package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
- package/dist/materializer/shared/normalize.d.ts +1 -0
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +19 -0
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/execution/index.js +22 -21
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/objects/index.js +41 -40
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/executor.d.ts +3 -1
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/explain.d.ts +3 -1
- package/dist/objects/query/explain.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +1 -1
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +21 -20
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/link-query-clearance.d.ts +3 -0
- package/dist/objects/query/link-query-clearance.d.ts.map +1 -1
- package/dist/objects/query/links.d.ts +1 -1
- package/dist/objects/query/links.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts +17 -0
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
- package/dist/ontology/index.js +3 -3
- package/dist/ontology/internal.js +3 -3
- package/dist/pipelines/index.js +27 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/builders.d.ts +7 -1
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/index.d.ts +1 -1
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/internal.js +22 -21
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/types.d.ts +10 -0
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/queues/in-memory.d.ts +3 -2
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +40 -13
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +13 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +1 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +47 -25
- package/dist/runtime/internal.js.map +4 -3
- package/dist/runtime/locale.d.ts +0 -2
- package/dist/runtime/locale.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +1 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/script.d.ts +39 -0
- package/dist/runtime/script.d.ts.map +1 -0
- package/dist/runtime/sixb.d.ts +2 -2
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/auth.d.ts +26 -4
- package/dist/sandboxes/auth.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +3 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +5 -5
- package/dist/schedules/builders.d.ts.map +1 -1
- package/dist/schedules/index.js +3 -3
- package/dist/schedules/runtime.d.ts.map +1 -1
- package/dist/schedules/validation.d.ts +2 -0
- package/dist/schedules/validation.d.ts.map +1 -1
- package/dist/security/view-conditions.d.ts.map +1 -1
- package/dist/shares/internal.js +19 -18
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/errors.d.ts +1 -1
- package/dist/storage/agents/errors.d.ts.map +1 -1
- package/dist/storage/agents/in-memory.d.ts +43 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +2 -2
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +54 -11
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +41 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +291 -3
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +3 -2
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +4 -3
- package/dist/storage/ai-cost/provider.js.map +1 -1
- package/dist/storage/ai-cost/types.d.ts +5 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +7 -1
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/index.d.ts +1 -1
- package/dist/storage/artifacts/index.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +5 -2
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +41 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +3 -3
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +1 -1
- package/dist/storage/executions/types.d.ts +6 -0
- package/dist/storage/executions/types.d.ts.map +1 -1
- package/dist/storage/executions/validation.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +7 -7
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +30 -25
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +1 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +12 -10
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts +2 -0
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/ontology/replacement-plans.d.ts +8 -0
- package/dist/storage/ontology/replacement-plans.d.ts.map +1 -1
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +1 -1
- package/dist/storage/sync-runs/idempotency.d.ts.map +1 -1
- package/dist/storage/sync-runs/in-memory.d.ts +2 -1
- package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/sync-runs/index.d.ts +1 -1
- package/dist/storage/sync-runs/index.d.ts.map +1 -1
- package/dist/storage/sync-runs/types.d.ts +27 -2
- package/dist/storage/sync-runs/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +7 -7
- package/dist/syncs/accounts.d.ts +36 -0
- package/dist/syncs/accounts.d.ts.map +1 -0
- package/dist/syncs/builders.d.ts.map +1 -1
- package/dist/syncs/connections.d.ts +36 -0
- package/dist/syncs/connections.d.ts.map +1 -0
- package/dist/syncs/execution.d.ts +14 -4
- package/dist/syncs/execution.d.ts.map +1 -1
- package/dist/syncs/index.d.ts +2 -1
- package/dist/syncs/index.d.ts.map +1 -1
- package/dist/syncs/index.js +28 -27
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/request.d.ts +16 -2
- package/dist/syncs/request.d.ts.map +1 -1
- package/dist/syncs/run-dispatch.d.ts +14 -2
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- package/dist/testing/agent-approval-storage-contract.d.ts.map +1 -1
- package/dist/testing/agent-execution.d.ts +3 -0
- package/dist/testing/agent-execution.d.ts.map +1 -1
- package/dist/testing/agent-inbox-storage-contract.d.ts +15 -0
- package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -0
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6589 -4627
- package/dist/testing/index.js.map +13 -12
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/testing/run-claim-storage-contract.d.ts.map +1 -1
- package/dist/webhooks/connections.d.ts +3 -4
- package/dist/webhooks/connections.d.ts.map +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/internal.js +22 -54
- package/dist/webhooks/internal.js.map +3 -3
- package/dist/webhooks/types.d.ts +2 -11
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/workers/index.js +66 -13
- package/dist/workers/index.js.map +4 -4
- package/dist/workers/queue-worker.d.ts +5 -0
- package/dist/workers/queue-worker.d.ts.map +1 -1
- package/dist/workers/queued-run-dispatch.d.ts.map +1 -1
- package/dist/workers/worker.d.ts +8 -0
- package/dist/workers/worker.d.ts.map +1 -1
- package/dist/workflows/index.js +50 -48
- package/dist/workflows/index.js.map +1 -1
- package/package.json +12 -1
- package/src/actions/validation.ts +3 -1
- package/src/agents/README.md +6 -2
- package/src/agents/children.ts +6 -0
- package/src/agents/errors.ts +3 -0
- package/src/agents/execution.ts +331 -43
- package/src/agents/ids.ts +5 -0
- package/src/agents/index.ts +22 -4
- package/src/agents/model-routing.ts +25 -9
- package/src/agents/queued-turn.ts +46 -0
- package/src/agents/request.ts +1444 -210
- package/src/agents/run-after-finish.ts +259 -2
- package/src/agents/run-artifacts.ts +3 -93
- package/src/agents/run-events.ts +256 -34
- package/src/agents/run-session-children.ts +13 -2
- package/src/agents/run-session-http.ts +9 -2
- package/src/agents/run-session-serve.ts +2 -8
- package/src/agents/run-session.ts +142 -3
- package/src/agents/run-turn.ts +148 -23
- package/src/agents/streams/index.ts +3 -0
- package/src/agents/streams/internal.ts +12 -0
- package/src/agents/streams/protocol.ts +109 -1
- package/src/agents/streams/steps.ts +131 -0
- package/src/agents/thread-access.ts +57 -2
- package/src/agents/turn-answered.ts +31 -0
- package/src/agents/validation.ts +2 -0
- package/src/artifacts/canvas-display.ts +4 -6
- package/src/artifacts/comments.ts +70 -17
- package/src/artifacts/document-fill.ts +103 -0
- package/src/artifacts/errors.ts +2 -0
- package/src/artifacts/events.ts +4 -1
- package/src/artifacts/execution.ts +265 -31
- package/src/artifacts/frames/assets.ts +42 -7
- package/src/artifacts/frames/document-data.ts +353 -0
- package/src/artifacts/frames/entries.ts +22 -16
- package/src/artifacts/frames/grants.ts +2 -2
- package/src/artifacts/frames/index.ts +3 -0
- package/src/artifacts/frames/kit.ts +102 -0
- package/src/artifacts/frames/protocol.ts +12 -1
- package/src/artifacts/frames/runtime.ts +413 -6
- package/src/artifacts/index.ts +3 -0
- package/src/artifacts/live/blocks.ts +889 -0
- package/src/artifacts/live/board.ts +195 -42
- package/src/artifacts/live/document.ts +170 -5
- package/src/artifacts/live/index.ts +7 -0
- package/src/artifacts/live/page.ts +807 -0
- package/src/artifacts/live/protocol.ts +5 -0
- package/src/artifacts/live/server.ts +2 -2
- package/src/artifacts/live/state.ts +9 -4
- package/src/artifacts/outline.ts +17 -0
- package/src/artifacts/paper.ts +173 -0
- package/src/artifacts/pdf-job.ts +11 -0
- package/src/artifacts/publish/fields.ts +177 -0
- package/src/artifacts/publish/index.ts +6 -1
- package/src/artifacts/publish/merge.ts +28 -15
- package/src/artifacts/publish/pdf.ts +82 -0
- package/src/artifacts/publish/previews.ts +24 -34
- package/src/artifacts/publish/publish.ts +26 -3
- package/src/artifacts/publish/queries.ts +20 -4
- package/src/artifacts/publish/query-answers.ts +14 -3
- package/src/artifacts/publish/validate/document-html.ts +245 -0
- package/src/artifacts/publish/validate/document.ts +34 -3
- package/src/artifacts/queries.ts +59 -13
- package/src/artifacts/run-query.ts +5 -2
- package/src/authorization/event-visibility.ts +13 -0
- package/src/calendar.ts +195 -0
- package/src/connectors/connection-handles.ts +71 -0
- package/src/connectors/connections/authorizations.ts +50 -2
- package/src/connectors/connections/capability.ts +40 -0
- package/src/connectors/connections/events.ts +57 -0
- package/src/connectors/connections/internal.ts +3 -0
- package/src/connectors/connections/runs.ts +5 -0
- package/src/connectors/connections/service.ts +93 -6
- package/src/connectors/execution.ts +35 -8
- package/src/connectors/index.ts +3 -0
- package/src/connectors/service.ts +23 -0
- package/src/connectors/types.ts +29 -1
- package/src/deploy/index.ts +1 -0
- package/src/deploy/services.ts +1 -0
- package/src/deploy/types.ts +30 -2
- package/src/events/definitions.ts +14 -0
- package/src/events/execution.ts +51 -4
- package/src/events/index.ts +8 -0
- package/src/events/outbox-dispatcher.ts +12 -2
- package/src/events/scope.ts +3 -0
- package/src/events/selectors/builder.ts +49 -0
- package/src/events/selectors/index.ts +5 -0
- package/src/events/selectors/predicate.ts +2 -0
- package/src/events/selectors/types.ts +30 -1
- package/src/events/types/artifacts.ts +7 -1
- package/src/events/types/connectors.ts +36 -0
- package/src/events/types/index.ts +7 -0
- package/src/events/types/syncs.ts +4 -0
- package/src/execution/authorization.ts +45 -0
- package/src/execution/authorized-object-reader.ts +33 -5
- package/src/execution/durable.ts +2 -0
- package/src/execution/object-reader-ontology.ts +6 -0
- package/src/execution/request.ts +1 -0
- package/src/execution/scopes.ts +24 -0
- package/src/execution/script.ts +27 -0
- package/src/execution/types.ts +7 -1
- package/src/http/api-routes.ts +33 -0
- package/src/index.ts +39 -4
- package/src/lineage/executors.ts +3 -1
- package/src/materialization/event-envelopes.ts +10 -5
- package/src/materialization/events.ts +2 -0
- package/src/materialization/model.ts +6 -0
- package/src/materializer/README.md +10 -0
- package/src/materializer/projections/replace.ts +42 -1
- package/src/materializer/projections/replacement-plan.ts +44 -4
- package/src/materializer/shared/normalize.ts +4 -0
- package/src/models/audio/runtime.ts +57 -14
- package/src/models/audio/types.ts +20 -0
- package/src/models/index.ts +1 -0
- package/src/objects/query/executor.ts +4 -0
- package/src/objects/query/explain.ts +5 -0
- package/src/objects/query/index.ts +1 -0
- package/src/objects/query/link-query-clearance.ts +4 -1
- package/src/objects/query/links.ts +5 -1
- package/src/objects/query/validate.ts +33 -1
- package/src/objects/sdk/runtime-query-executor.ts +7 -3
- package/src/projections/builders.ts +20 -0
- package/src/projections/index.ts +1 -0
- package/src/projections/registry.ts +1 -0
- package/src/projections/revision.ts +2 -0
- package/src/projections/types.ts +11 -0
- package/src/projections/validation.ts +6 -0
- package/src/queues/in-memory.ts +5 -0
- package/src/queues/index.ts +3 -1
- package/src/queues/types.ts +45 -14
- package/src/runtime/host.ts +125 -11
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/locale.ts +0 -10
- package/src/runtime/resolve-definitions.ts +4 -1
- package/src/runtime/script.ts +62 -0
- package/src/runtime/sixb.ts +15 -5
- package/src/sandboxes/README.md +3 -1
- package/src/sandboxes/auth.ts +32 -4
- package/src/sandboxes/index.ts +15 -1
- package/src/schedules/builders.ts +4 -1
- package/src/schedules/runtime.ts +3 -0
- package/src/schedules/validation.ts +20 -2
- package/src/security/view-conditions.ts +2 -1
- package/src/storage/agents/errors.ts +1 -0
- package/src/storage/agents/in-memory.ts +500 -7
- package/src/storage/agents/index.ts +26 -0
- package/src/storage/agents/provider.ts +454 -15
- package/src/storage/agents/types.ts +315 -3
- package/src/storage/ai-cost/analytics.ts +22 -43
- package/src/storage/ai-cost/types.ts +5 -1
- package/src/storage/artifacts/in-memory.ts +52 -6
- package/src/storage/artifacts/index.ts +2 -0
- package/src/storage/artifacts/record.ts +33 -4
- package/src/storage/artifacts/types.ts +44 -0
- package/src/storage/executions/provider.ts +22 -2
- package/src/storage/executions/types.ts +2 -0
- package/src/storage/executions/validation.ts +27 -0
- package/src/storage/index.ts +29 -0
- package/src/storage/internal.ts +1 -0
- package/src/storage/ontology/in-memory/replacement-plans.ts +22 -0
- package/src/storage/ontology/replacement-plans.ts +6 -0
- package/src/storage/operation-scope.ts +2 -0
- package/src/storage/sync-runs/idempotency.ts +1 -0
- package/src/storage/sync-runs/in-memory.ts +43 -1
- package/src/storage/sync-runs/index.ts +1 -0
- package/src/storage/sync-runs/types.ts +30 -1
- package/src/syncs/accounts.ts +85 -0
- package/src/syncs/builders.ts +18 -1
- package/src/syncs/connections.ts +123 -0
- package/src/syncs/execution.ts +64 -22
- package/src/syncs/index.ts +3 -0
- package/src/syncs/request.ts +81 -23
- package/src/syncs/run-dispatch.ts +69 -7
- package/src/testing/agent-approval-storage-contract.ts +123 -0
- package/src/testing/agent-execution.ts +45 -2
- package/src/testing/agent-inbox-storage-contract.ts +874 -0
- package/src/testing/agent-storage-contract.ts +965 -103
- package/src/testing/ai-cost-storage-contract.ts +80 -0
- package/src/testing/artifact-storage-contract.ts +201 -4
- package/src/testing/execution-storage-contract.ts +31 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/materializer-storage-contract.ts +139 -1
- package/src/testing/queues-contract.ts +22 -0
- package/src/testing/run-claim-storage-contract.ts +116 -0
- package/src/webhooks/connections.ts +9 -50
- package/src/webhooks/index.ts +0 -2
- package/src/webhooks/types.ts +2 -13
- package/src/workers/README.md +4 -1
- package/src/workers/lost-runs.ts +1 -0
- package/src/workers/queue-worker.ts +16 -5
- package/src/workers/queued-run-dispatch.ts +8 -1
- package/src/workers/worker.ts +67 -7
- package/dist/chunk-3z1vxzcm.js +0 -234
- package/dist/chunk-3z1vxzcm.js.map +0 -12
- package/dist/chunk-48c1z8nj.js.map +0 -10
- package/dist/chunk-58geavnf.js +0 -29
- package/dist/chunk-58geavnf.js.map +0 -10
- package/dist/chunk-5a4a52tq.js.map +0 -10
- package/dist/chunk-9nsjjd44.js.map +0 -12
- package/dist/chunk-b9qfh2ya.js.map +0 -11
- package/dist/chunk-eptrvnby.js.map +0 -12
- package/dist/chunk-f6ahf5gf.js.map +0 -13
- package/dist/chunk-gxwy4c3s.js.map +0 -47
- package/dist/chunk-hvbvq7p4.js.map +0 -18
- package/dist/chunk-m2jerfef.js +0 -474
- package/dist/chunk-m2jerfef.js.map +0 -11
- package/dist/chunk-msyevpp3.js.map +0 -22
- package/dist/chunk-n4zzaf6q.js.map +0 -10
- package/dist/chunk-rsrc7vtw.js.map +0 -49
- package/dist/chunk-rsxb14an.js.map +0 -18
- package/dist/chunk-smnt672s.js.map +0 -10
- package/dist/chunk-t0s7b3d1.js.map +0 -13
- package/dist/chunk-td26wjr5.js.map +0 -13
- package/dist/chunk-vzkxqf8h.js.map +0 -23
- package/dist/chunk-wa05txmk.js.map +0 -11
- package/dist/chunk-yv8hv4wq.js.map +0 -10
- package/dist/chunk-yy914zfr.js.map +0 -30
- package/dist/chunk-zeykm8my.js.map +0 -14
- /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
- /package/dist/{chunk-p8pgnq8d.js.map → chunk-425ydk65.js.map} +0 -0
- /package/dist/{chunk-p351afzm.js.map → chunk-5sswe5ej.js.map} +0 -0
- /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
- /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
- /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
- /package/dist/{chunk-sysnvjce.js.map → chunk-brhp9d97.js.map} +0 -0
- /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
- /package/dist/{chunk-855w9nvw.js.map → chunk-cg7cygfj.js.map} +0 -0
- /package/dist/{chunk-r2psmn42.js.map → chunk-eg6xqef7.js.map} +0 -0
- /package/dist/{chunk-7kpqntgw.js.map → chunk-f05994as.js.map} +0 -0
- /package/dist/{chunk-2bn6813a.js.map → chunk-grt2j5vp.js.map} +0 -0
- /package/dist/{chunk-rtdrm592.js.map → chunk-htdzx40w.js.map} +0 -0
- /package/dist/{chunk-bc3y6gff.js.map → chunk-jka26v8c.js.map} +0 -0
- /package/dist/{chunk-6ef4esq4.js.map → chunk-pqj8vff9.js.map} +0 -0
- /package/dist/{chunk-n68vz95m.js.map → chunk-qbd282aa.js.map} +0 -0
- /package/dist/{chunk-r9rtavg9.js.map → chunk-t19wjmnc.js.map} +0 -0
- /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
- /package/dist/{chunk-8bns0y68.js.map → chunk-xf76csps.js.map} +0 -0
- /package/dist/{chunk-vepea5c3.js.map → chunk-ym1bqd98.js.map} +0 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A designed document's live data: the fields that show a value (`data-sixb-field`) and the
|
|
3
|
+
* elements repeated once per item (`data-sixb-each`), read from the object that holds the document
|
|
4
|
+
* and from its queries, as one reader reads them.
|
|
5
|
+
*
|
|
6
|
+
* It is served as its own source to the frame runtime, `(${frameRuntime})(${documentData})`, and
|
|
7
|
+
* runs on the server too, over parse5, to write the values in when a version is frozen or printed.
|
|
8
|
+
* So it imports nothing and names nothing outside itself, and walks the markup through a `tree`
|
|
9
|
+
* each side gives it.
|
|
10
|
+
*
|
|
11
|
+
* A path is the steps from where it reads: `client.name`, `scope.services[job-flow].amount`. A
|
|
12
|
+
* step names a property of an object, or a link its query expanded, and `[id]` picks the item of
|
|
13
|
+
* a list whose `id`, or object id, is that; a list read without one reads its first item. It reads
|
|
14
|
+
* the holder, or the item of the repeated element it is in; `query:<name>` reads a query instead,
|
|
15
|
+
* its rows to repeat over, `.total` how many it matched, and `.facets.<property>` its facet values,
|
|
16
|
+
* each with `value` and `count`.
|
|
17
|
+
*/
|
|
18
|
+
export function documentData(): DocumentData {
|
|
19
|
+
const FIELD = "data-sixb-field"
|
|
20
|
+
const EACH = "data-sixb-each"
|
|
21
|
+
const FORMAT = "data-format"
|
|
22
|
+
const CURRENCY = "data-currency"
|
|
23
|
+
const CURRENCY_FIELD = "data-currency-field"
|
|
24
|
+
const LOCKED = "data-sixb-locked"
|
|
25
|
+
/** A repeated element kept with no item, as a frozen version keeps a list that was empty. */
|
|
26
|
+
const EMPTY = "data-sixb-empty"
|
|
27
|
+
const QUERY = /^query:([a-z0-9][a-z0-9-]{0,63})(?:\.(.*))?$/
|
|
28
|
+
const STEP = /^([A-Za-z_][\w-]*)(?:\[([^\]]+)\])?$/
|
|
29
|
+
/** A value whose source the reader has none of: the written text stays. */
|
|
30
|
+
const UNREAD = Symbol("unread")
|
|
31
|
+
/** A value the reader is not cleared for. */
|
|
32
|
+
const HIDDEN = Symbol("hidden")
|
|
33
|
+
|
|
34
|
+
const parse = (path: string): DocumentPath | null => {
|
|
35
|
+
const query = QUERY.exec(path.trim())
|
|
36
|
+
const rest = query ? (query[2] ?? "") : path.trim()
|
|
37
|
+
const steps: DocumentStep[] = []
|
|
38
|
+
for (const part of rest === "" ? [] : rest.split(".")) {
|
|
39
|
+
const step = STEP.exec(part)
|
|
40
|
+
if (!step?.[1]) return null
|
|
41
|
+
steps.push(step[2] === undefined ? { key: step[1] } : { key: step[1], id: step[2] })
|
|
42
|
+
}
|
|
43
|
+
if (!query && steps.length === 0) return null
|
|
44
|
+
return query?.[1] ? { query: query[1], steps } : { steps }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const isRow = (value: unknown): value is DocumentRow =>
|
|
48
|
+
typeof value === "object" &&
|
|
49
|
+
value !== null &&
|
|
50
|
+
"properties" in value &&
|
|
51
|
+
typeof (value as DocumentRow).properties === "object"
|
|
52
|
+
|
|
53
|
+
const step = (value: unknown, next: DocumentStep): unknown => {
|
|
54
|
+
// A list read as one value, as a link to many is, reads its first item.
|
|
55
|
+
if (Array.isArray(value)) return value.length > 0 ? step(value[0], next) : undefined
|
|
56
|
+
let found: unknown
|
|
57
|
+
if (isRow(value)) {
|
|
58
|
+
if (Object.hasOwn(value.properties, next.key)) found = value.properties[next.key]
|
|
59
|
+
else if (value.redactions && Object.hasOwn(value.redactions, next.key)) return HIDDEN
|
|
60
|
+
else found = value.links?.[next.key]
|
|
61
|
+
} else if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
62
|
+
found = (value as Record<string, unknown>)[next.key]
|
|
63
|
+
}
|
|
64
|
+
if (next.id === undefined) return found
|
|
65
|
+
if (!Array.isArray(found)) return undefined
|
|
66
|
+
return found.find((item) =>
|
|
67
|
+
isRow(item)
|
|
68
|
+
? item.primaryId === next.id || item.properties.id === next.id
|
|
69
|
+
: typeof item === "object" && item !== null && (item as { id?: unknown }).id === next.id
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** What a path reads in `scope`: a value, or UNREAD when its source is not there. */
|
|
74
|
+
const read = (path: DocumentPath, scope: Scope): unknown => {
|
|
75
|
+
let value: unknown
|
|
76
|
+
if (path.query !== undefined) {
|
|
77
|
+
const result = scope.sources.queries[path.query]
|
|
78
|
+
if (!result) return UNREAD
|
|
79
|
+
const [first, second] = path.steps
|
|
80
|
+
if (first?.key === "total" && path.steps.length === 1) return result.total
|
|
81
|
+
if (first?.key === "facets" && second && path.steps.length === 2) {
|
|
82
|
+
return result.facets?.find((facet) => facet.propertyId === second.key)?.buckets
|
|
83
|
+
}
|
|
84
|
+
if (path.steps.length === 0) return result.objects ?? []
|
|
85
|
+
value = result.objects
|
|
86
|
+
} else if (scope.item !== undefined) {
|
|
87
|
+
value = scope.item
|
|
88
|
+
} else {
|
|
89
|
+
if (!scope.sources.holder) return UNREAD
|
|
90
|
+
value = scope.sources.holder
|
|
91
|
+
}
|
|
92
|
+
for (const next of path.steps) {
|
|
93
|
+
if (value === HIDDEN) return HIDDEN
|
|
94
|
+
value = step(value, next)
|
|
95
|
+
}
|
|
96
|
+
return value
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const format = (value: unknown, as: string | null, currency: string | null, lang: string) => {
|
|
100
|
+
if (value === null || value === undefined) return ""
|
|
101
|
+
// A number, or a string that holds one: never what Number() makes 0 of, such as "" or true.
|
|
102
|
+
const number =
|
|
103
|
+
typeof value === "number"
|
|
104
|
+
? value
|
|
105
|
+
: typeof value === "string" && value.trim() !== ""
|
|
106
|
+
? Number(value)
|
|
107
|
+
: Number.NaN
|
|
108
|
+
try {
|
|
109
|
+
if (as === "money" && Number.isFinite(number)) {
|
|
110
|
+
// A whole amount reads without cents, as a price on a proposal does.
|
|
111
|
+
const cents = Number.isInteger(number) ? { minimumFractionDigits: 0 } : {}
|
|
112
|
+
return currency
|
|
113
|
+
? new Intl.NumberFormat(lang, { style: "currency", currency, ...cents }).format(number)
|
|
114
|
+
: new Intl.NumberFormat(lang, {
|
|
115
|
+
minimumFractionDigits: 2,
|
|
116
|
+
maximumFractionDigits: 2,
|
|
117
|
+
...cents,
|
|
118
|
+
}).format(number)
|
|
119
|
+
}
|
|
120
|
+
if (as === "number" && Number.isFinite(number)) {
|
|
121
|
+
return new Intl.NumberFormat(lang).format(number)
|
|
122
|
+
}
|
|
123
|
+
if (as === "percent" && Number.isFinite(number)) {
|
|
124
|
+
return new Intl.NumberFormat(lang, { style: "percent", maximumFractionDigits: 2 }).format(
|
|
125
|
+
number
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
if (as === "date") {
|
|
129
|
+
const date = new Date(String(value))
|
|
130
|
+
// A date without a time is that day wherever it is read.
|
|
131
|
+
if (!Number.isNaN(date.getTime())) {
|
|
132
|
+
return new Intl.DateTimeFormat(lang, { dateStyle: "long", timeZone: "UTC" }).format(date)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
} catch {
|
|
136
|
+
// A currency or a language Intl does not know: the value as it is.
|
|
137
|
+
}
|
|
138
|
+
if (Array.isArray(value)) {
|
|
139
|
+
return value
|
|
140
|
+
.filter((each) => typeof each !== "object" || each === null)
|
|
141
|
+
.map(String)
|
|
142
|
+
.join(", ")
|
|
143
|
+
}
|
|
144
|
+
return typeof value === "object" ? "" : String(value)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const fill = <TNode>(root: TNode, tree: DocumentTree<TNode>, options: DocumentFill): void => {
|
|
148
|
+
const lang = options.lang || "en"
|
|
149
|
+
const visit = (node: TNode, scope: Scope) => {
|
|
150
|
+
const children = tree.children(node)
|
|
151
|
+
for (let index = 0; index < children.length; index += 1) {
|
|
152
|
+
const child = children[index] as TNode
|
|
153
|
+
const each = tree.attribute(child, EACH)
|
|
154
|
+
if (each !== null) {
|
|
155
|
+
// The copies a frozen version wrote in follow it, marked as it is: the first is copied.
|
|
156
|
+
const written = [child]
|
|
157
|
+
while (index + 1 < children.length) {
|
|
158
|
+
const next = children[index + 1] as TNode
|
|
159
|
+
if (tree.attribute(next, EACH) !== each) break
|
|
160
|
+
written.push(next)
|
|
161
|
+
index += 1
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const path = parse(each)
|
|
165
|
+
const items = path ? read(path, scope) : UNREAD
|
|
166
|
+
if (items === UNREAD || items === HIDDEN) {
|
|
167
|
+
// Its written text stays: plain, as written, never to be filled again.
|
|
168
|
+
if (options.plain) for (const copy of written) unmark(copy)
|
|
169
|
+
continue
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const list = Array.isArray(items) ? items : items == null ? [] : [items]
|
|
173
|
+
const copies = list.map((item) => {
|
|
174
|
+
const copy = tree.clone(child)
|
|
175
|
+
// Kept, each copy is read again from the next version.
|
|
176
|
+
if (!options.keep) tree.removeAttribute(copy, EACH)
|
|
177
|
+
tree.removeAttribute(copy, EMPTY)
|
|
178
|
+
visit(copy, { sources: scope.sources, item })
|
|
179
|
+
return copy
|
|
180
|
+
})
|
|
181
|
+
for (const copy of written.slice(1)) tree.replace(copy, [])
|
|
182
|
+
if (options.keep && copies.length === 0) {
|
|
183
|
+
// Kept for the next version to copy, shown as no item.
|
|
184
|
+
tree.setAttribute(child, EMPTY, "")
|
|
185
|
+
} else {
|
|
186
|
+
tree.replace(child, copies)
|
|
187
|
+
}
|
|
188
|
+
continue
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const field = tree.attribute(child, FIELD)
|
|
192
|
+
if (field === null) {
|
|
193
|
+
visit(child, scope)
|
|
194
|
+
continue
|
|
195
|
+
}
|
|
196
|
+
const path = parse(field)
|
|
197
|
+
const value = path ? read(path, scope) : UNREAD
|
|
198
|
+
// Read before plain HTML unmarks the field, which its currency's path is a mark of.
|
|
199
|
+
const currencyField = tree.attribute(child, CURRENCY_FIELD)
|
|
200
|
+
const currencyPath = currencyField === null ? null : parse(currencyField)
|
|
201
|
+
const currency = currencyPath ? read(currencyPath, scope) : tree.attribute(child, CURRENCY)
|
|
202
|
+
if (options.plain) unmark(child)
|
|
203
|
+
if (value === UNREAD) continue
|
|
204
|
+
if (value === HIDDEN) {
|
|
205
|
+
tree.setText(child, "•••")
|
|
206
|
+
if (!options.plain && !options.keep) tree.setAttribute(child, LOCKED, "")
|
|
207
|
+
continue
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
tree.setText(
|
|
211
|
+
child,
|
|
212
|
+
format(
|
|
213
|
+
value,
|
|
214
|
+
tree.attribute(child, FORMAT),
|
|
215
|
+
typeof currency === "string" && currency !== "" ? currency : null,
|
|
216
|
+
lang
|
|
217
|
+
)
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/** No longer marked, nor anything in it, as plain HTML is; a list that was empty is gone. */
|
|
222
|
+
const unmark = (node: TNode) => {
|
|
223
|
+
if (tree.attribute(node, EMPTY) !== null) return tree.replace(node, [])
|
|
224
|
+
for (const name of [FIELD, EACH, CURRENCY_FIELD]) tree.removeAttribute(node, name)
|
|
225
|
+
for (const child of tree.children(node)) unmark(child)
|
|
226
|
+
}
|
|
227
|
+
visit(root, { sources: options.sources })
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Every field and repeated element under `root`, with the repeated elements each sits in. */
|
|
231
|
+
const marks = <TNode>(root: TNode, tree: DocumentTree<TNode>): DocumentMark[] => {
|
|
232
|
+
const found: DocumentMark[] = []
|
|
233
|
+
const visit = (node: TNode, within: readonly string[]) => {
|
|
234
|
+
for (const child of tree.children(node)) {
|
|
235
|
+
const each = tree.attribute(child, EACH)
|
|
236
|
+
const field = tree.attribute(child, FIELD)
|
|
237
|
+
if (each !== null) found.push({ kind: "each", path: each, within })
|
|
238
|
+
if (field !== null) found.push({ kind: "field", path: field, within })
|
|
239
|
+
const currency = tree.attribute(child, CURRENCY_FIELD)
|
|
240
|
+
if (currency !== null) found.push({ kind: "field", path: currency, within })
|
|
241
|
+
visit(child, each === null ? within : [...within, each])
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
visit(root, [])
|
|
245
|
+
return found
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** What marks read: the holder, and the queries named by the outermost path naming one. */
|
|
249
|
+
const reads = (found: readonly DocumentMark[]): DocumentReads => {
|
|
250
|
+
const queries = new Set<string>()
|
|
251
|
+
let holder = false
|
|
252
|
+
for (const mark of found) {
|
|
253
|
+
const named = [...mark.within, mark.path].map(parse).find((path) => path?.query)
|
|
254
|
+
if (named?.query) queries.add(named.query)
|
|
255
|
+
else holder = true
|
|
256
|
+
}
|
|
257
|
+
return { holder, queries: [...queries] }
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return { parse, fill, marks, reads }
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Where a path reads: the sources, and the item of the repeated element it is in. */
|
|
264
|
+
interface Scope {
|
|
265
|
+
readonly sources: DocumentSources
|
|
266
|
+
readonly item?: unknown
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** One step of a path: a key, and the id of the list item it picks. */
|
|
270
|
+
export interface DocumentStep {
|
|
271
|
+
readonly key: string
|
|
272
|
+
readonly id?: string
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** A field's or a repeated element's path: the query it reads, else the holder or the item. */
|
|
276
|
+
export interface DocumentPath {
|
|
277
|
+
readonly query?: string
|
|
278
|
+
readonly steps: readonly DocumentStep[]
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** A row as a query returns it. */
|
|
282
|
+
export interface DocumentRow {
|
|
283
|
+
readonly primaryId?: string
|
|
284
|
+
readonly properties: Readonly<Record<string, unknown>>
|
|
285
|
+
readonly links?: Readonly<Record<string, unknown>>
|
|
286
|
+
readonly redactions?: Readonly<Record<string, unknown>>
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** A query's result as its route answers, which is all a field reads of it. */
|
|
290
|
+
export interface DocumentQueryResult {
|
|
291
|
+
readonly objects?: readonly DocumentRow[]
|
|
292
|
+
readonly total?: number
|
|
293
|
+
readonly facets?: readonly {
|
|
294
|
+
readonly propertyId: string
|
|
295
|
+
readonly buckets: readonly { readonly value: unknown; readonly count: number }[]
|
|
296
|
+
}[]
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** What a reader read: the holder, and each query by name. One left out keeps its written text. */
|
|
300
|
+
export interface DocumentSources {
|
|
301
|
+
readonly holder?: DocumentRow
|
|
302
|
+
readonly queries: Readonly<Record<string, DocumentQueryResult>>
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface DocumentFill {
|
|
306
|
+
readonly sources: DocumentSources
|
|
307
|
+
/** `<html lang>`, which the values are formatted for. */
|
|
308
|
+
readonly lang?: string
|
|
309
|
+
/** Writes plain HTML, as a version prints and a frozen one shows: no field stays marked. */
|
|
310
|
+
readonly plain?: boolean
|
|
311
|
+
/**
|
|
312
|
+
* Writes the values in and keeps every field marked, as a frozen version keeps them: it shows
|
|
313
|
+
* what is written, and the next version, opened from it, reads them again.
|
|
314
|
+
*/
|
|
315
|
+
readonly keep?: boolean
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** A field or a repeated element, with the paths of the repeated elements around it. */
|
|
319
|
+
export interface DocumentMark {
|
|
320
|
+
readonly kind: "field" | "each"
|
|
321
|
+
readonly path: string
|
|
322
|
+
readonly within: readonly string[]
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/** How the walk reads and changes the markup: the DOM in a frame, parse5 on the server. */
|
|
326
|
+
export interface DocumentTree<TNode> {
|
|
327
|
+
/** Its child elements, in order. */
|
|
328
|
+
children(node: TNode): readonly TNode[]
|
|
329
|
+
attribute(node: TNode, name: string): string | null
|
|
330
|
+
setAttribute(node: TNode, name: string, value: string): void
|
|
331
|
+
removeAttribute(node: TNode, name: string): void
|
|
332
|
+
/** Its content, replaced by this text. */
|
|
333
|
+
setText(node: TNode, text: string): void
|
|
334
|
+
/** A deep copy, not yet anywhere. */
|
|
335
|
+
clone(node: TNode): TNode
|
|
336
|
+
/** Puts these where it is, in its place. */
|
|
337
|
+
replace(node: TNode, nodes: readonly TNode[]): void
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** What a document's fields read. */
|
|
341
|
+
export interface DocumentReads {
|
|
342
|
+
readonly holder: boolean
|
|
343
|
+
readonly queries: readonly string[]
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface DocumentData {
|
|
347
|
+
/** A path, or null when it is not one. */
|
|
348
|
+
parse(path: string): DocumentPath | null
|
|
349
|
+
/** Shows the values the sources hold in the fields and repeated elements under `root`. */
|
|
350
|
+
fill<TNode>(root: TNode, tree: DocumentTree<TNode>, options: DocumentFill): void
|
|
351
|
+
marks<TNode>(root: TNode, tree: DocumentTree<TNode>): DocumentMark[]
|
|
352
|
+
reads(marks: readonly DocumentMark[]): DocumentReads
|
|
353
|
+
}
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
import type { ArtifactKind } from "../kinds"
|
|
2
1
|
import type { ArtifactOutline } from "../outline"
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* How the frame's runtime lays out what it serves: a deck shows 1280×720 slides scaled to fit, one
|
|
6
|
-
* at a time or all at once; a page scrolls like any web page, as a canvas's boards do
|
|
5
|
+
* at a time or all at once; a page scrolls like any web page, as a canvas's boards do; a designed
|
|
6
|
+
* document scrolls as one sheet, or as the pages its paper cuts it into.
|
|
7
7
|
*/
|
|
8
|
-
export type FrameLayout = "deck" | "page"
|
|
8
|
+
export type FrameLayout = "deck" | "page" | "document"
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
/**
|
|
11
|
+
* A version's frame layout, or null for one Sixb draws natively: a Markdown document, a sheet, or
|
|
12
|
+
* a file.
|
|
13
|
+
*/
|
|
14
|
+
export function frameLayout(version: { readonly outline: ArtifactOutline }): FrameLayout | null {
|
|
15
|
+
switch (version.outline.kind) {
|
|
16
|
+
case "slides":
|
|
17
|
+
return "deck"
|
|
18
|
+
case "page":
|
|
19
|
+
case "canvas":
|
|
20
|
+
return "page"
|
|
21
|
+
case "document":
|
|
22
|
+
return version.outline.format === "html" ? "document" : null
|
|
23
|
+
default:
|
|
24
|
+
return null
|
|
25
|
+
}
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
/**
|
|
23
29
|
* The files of a version its frame serves as pages, with the kit and the runtime first in their
|
|
24
|
-
* `<head>`: a deck's or a
|
|
25
|
-
* not open in a frame.
|
|
30
|
+
* `<head>`: a deck's, a page's or a designed document's entry, or each of a canvas's boards; none
|
|
31
|
+
* for a version that does not open in a frame.
|
|
26
32
|
*/
|
|
27
33
|
export function frameEntries(version: {
|
|
28
34
|
readonly entry: string
|
|
@@ -31,5 +37,5 @@ export function frameEntries(version: {
|
|
|
31
37
|
if (version.outline.kind === "canvas") {
|
|
32
38
|
return version.outline.items.flatMap((item) => (item.type === "board" ? [item.file] : []))
|
|
33
39
|
}
|
|
34
|
-
return frameLayout(version
|
|
40
|
+
return frameLayout(version) ? [version.entry] : []
|
|
35
41
|
}
|
|
@@ -43,7 +43,7 @@ export async function createArtifactFrame(input: {
|
|
|
43
43
|
readonly now?: Date
|
|
44
44
|
}): Promise<ArtifactFrame> {
|
|
45
45
|
const { version } = input
|
|
46
|
-
if (!frameLayout(version
|
|
46
|
+
if (!frameLayout(version)) {
|
|
47
47
|
throw new ArtifactRequestError(
|
|
48
48
|
"artifact_kind_mismatch",
|
|
49
49
|
`[Sixb] '${version.artifactId}' is a ${version.outline.kind}, which does not open in a frame. Read its files instead.`
|
|
@@ -125,7 +125,7 @@ export async function resolveArtifactFrame(input: {
|
|
|
125
125
|
})
|
|
126
126
|
if (!version || frameFilesDigest(version) !== grant.filesDigest) return null
|
|
127
127
|
|
|
128
|
-
return frameLayout(version
|
|
128
|
+
return frameLayout(version) ? { version, targets: grant.targets } : null
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* and the Agent's layout check lays a version out in them.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
// A frozen designed document as its frame shows it: the values written in, none read again.
|
|
7
|
+
export { frozenDocumentHtml } from "../document-fill"
|
|
6
8
|
export { HTML_ENTRY } from "../publish/validate/html"
|
|
7
9
|
// What a frame's `sixb.query` reads: the route serves it, and the layout check serves it too.
|
|
8
10
|
export {
|
|
@@ -15,6 +17,7 @@ export {
|
|
|
15
17
|
FRAME_REFERENCE_PATH,
|
|
16
18
|
FRAME_REFERENCE_PREFIX,
|
|
17
19
|
injectFrameAssets,
|
|
20
|
+
markDocumentSections,
|
|
18
21
|
rewriteFrameReferences,
|
|
19
22
|
} from "./assets"
|
|
20
23
|
export { type FrameLayout, frameEntries, frameLayout } from "./entries"
|
|
@@ -570,3 +570,105 @@ export const FRAME_PAGE_CSS = kit(` html { color-scheme: light; }
|
|
|
570
570
|
}
|
|
571
571
|
img[data-sixb-ref="unavailable"] { display: block; min-width: 120px; min-height: 68px; border-radius: var(--radius); background: var(--muted); }
|
|
572
572
|
`)
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* A designed document's kit. Its own stylesheets design it: the kit only sets it on the stage.
|
|
576
|
+
*
|
|
577
|
+
* As one sheet, the body is the sheet: as wide as its paper, with the paper's margins as its
|
|
578
|
+
* padding, so its lines break where they will on paper, on the stage in the app's colors. A
|
|
579
|
+
* document's own CSS, unlayered, overrides any of that.
|
|
580
|
+
*
|
|
581
|
+
* As pages, the runtime moves the body's content into a flow laid out in columns of the paper's
|
|
582
|
+
* content box, and shows each column on a sheet of its own. The body becomes the stage those
|
|
583
|
+
* sheets sit on, so the rules that make it one are important: a document that styles its body as
|
|
584
|
+
* its sheet would otherwise draw the stage as one. So are those that size the sheets, their content
|
|
585
|
+
* boxes and the flow, which are elements a document's own `article` or `div` rules would reach.
|
|
586
|
+
* Its body's inherited styles, its font and its color, still reach every page.
|
|
587
|
+
*/
|
|
588
|
+
export const FRAME_DOCUMENT_CSS = kit(` :root {
|
|
589
|
+
--sixb-stage: ${LIGHT["--muted"]};
|
|
590
|
+
--sixb-stage-border: ${LIGHT["--border"]};
|
|
591
|
+
--sixb-paper-width: 816px;
|
|
592
|
+
--sixb-paper-margin-top: 72px;
|
|
593
|
+
--sixb-paper-margin-right: 72px;
|
|
594
|
+
--sixb-paper-margin-bottom: 72px;
|
|
595
|
+
--sixb-paper-margin-left: 72px;
|
|
596
|
+
}
|
|
597
|
+
html { color-scheme: light; background: var(--sixb-stage); }
|
|
598
|
+
body {
|
|
599
|
+
width: 100%;
|
|
600
|
+
max-width: var(--sixb-paper-width);
|
|
601
|
+
min-height: calc(100vh - 64px);
|
|
602
|
+
margin: 32px auto;
|
|
603
|
+
padding: var(--sixb-paper-margin-top) var(--sixb-paper-margin-right) var(--sixb-paper-margin-bottom) var(--sixb-paper-margin-left);
|
|
604
|
+
background: #fff;
|
|
605
|
+
color: #18181b;
|
|
606
|
+
box-shadow: 0 0 0 1px var(--sixb-stage-border);
|
|
607
|
+
}
|
|
608
|
+
@media (max-width: 720px) {
|
|
609
|
+
body { min-height: 100vh; margin: 0; padding: 28px 20px; box-shadow: none; }
|
|
610
|
+
}
|
|
611
|
+
img, svg { max-width: 100%; }
|
|
612
|
+
/* A page break, as one sheet: the stage shows through, from edge to edge of the sheet. */
|
|
613
|
+
.sixb-page-break {
|
|
614
|
+
display: block;
|
|
615
|
+
height: 24px;
|
|
616
|
+
margin: var(--sixb-paper-margin-bottom) calc(-1 * var(--sixb-paper-margin-right)) var(--sixb-paper-margin-top) calc(-1 * var(--sixb-paper-margin-left));
|
|
617
|
+
background: var(--sixb-stage);
|
|
618
|
+
box-shadow: inset 0 1px 0 var(--sixb-stage-border), inset 0 -1px 0 var(--sixb-stage-border);
|
|
619
|
+
}
|
|
620
|
+
@media (max-width: 720px) {
|
|
621
|
+
.sixb-page-break { height: 0; margin: 32px 0; box-shadow: inset 0 1px 0 var(--sixb-stage-border); }
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
html.sixb-pages, html.sixb-pages body { min-height: 0 !important; }
|
|
625
|
+
html.sixb-pages body {
|
|
626
|
+
width: auto !important;
|
|
627
|
+
max-width: none !important;
|
|
628
|
+
margin: 0 !important;
|
|
629
|
+
padding: 24px 16px !important;
|
|
630
|
+
background: var(--sixb-stage) !important;
|
|
631
|
+
box-shadow: none !important;
|
|
632
|
+
border: 0 !important;
|
|
633
|
+
}
|
|
634
|
+
/* Until the content is cut into pages, it shows as nothing: never as one long column. */
|
|
635
|
+
html.sixb-pages:not([data-sixb-pages]) body { visibility: hidden !important; }
|
|
636
|
+
.sixb-pages, .sixb-paper, .sixb-paper-content, .sixb-flow {
|
|
637
|
+
box-sizing: content-box !important;
|
|
638
|
+
max-width: none !important;
|
|
639
|
+
margin: 0 !important;
|
|
640
|
+
padding: 0 !important;
|
|
641
|
+
border: 0 !important;
|
|
642
|
+
}
|
|
643
|
+
.sixb-pages {
|
|
644
|
+
display: flex !important;
|
|
645
|
+
flex-direction: column !important;
|
|
646
|
+
align-items: center !important;
|
|
647
|
+
gap: 24px !important;
|
|
648
|
+
width: auto !important;
|
|
649
|
+
zoom: var(--sixb-zoom, 1);
|
|
650
|
+
}
|
|
651
|
+
.sixb-paper {
|
|
652
|
+
position: relative !important;
|
|
653
|
+
flex: none !important;
|
|
654
|
+
width: var(--sixb-paper-width) !important;
|
|
655
|
+
height: var(--sixb-paper-height) !important;
|
|
656
|
+
overflow: hidden !important;
|
|
657
|
+
background: #fff;
|
|
658
|
+
box-shadow: 0 0 0 1px var(--sixb-stage-border), 0 1px 3px rgb(0 0 0 / 0.06);
|
|
659
|
+
}
|
|
660
|
+
.sixb-paper-content {
|
|
661
|
+
position: absolute !important;
|
|
662
|
+
inset: var(--sixb-paper-margin-top) var(--sixb-paper-margin-right) var(--sixb-paper-margin-bottom) var(--sixb-paper-margin-left) !important;
|
|
663
|
+
width: auto !important;
|
|
664
|
+
height: auto !important;
|
|
665
|
+
overflow: hidden !important;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/* Printed, the sheet is the paper: its @page rule gives the margins, and nothing is the stage. */
|
|
669
|
+
@media print {
|
|
670
|
+
html { background: none; }
|
|
671
|
+
body { width: auto; max-width: none; min-height: 0; margin: 0; padding: 0; background: none; box-shadow: none; }
|
|
672
|
+
.sixb-page-break { display: none; }
|
|
673
|
+
}
|
|
674
|
+
`)
|
|
@@ -23,14 +23,20 @@ export type DeckMode = "slide" | "overview" | "present"
|
|
|
23
23
|
export interface FrameStart {
|
|
24
24
|
readonly slide?: number
|
|
25
25
|
readonly fill?: boolean
|
|
26
|
+
/** A designed document shown as the pages its paper cuts it into, not as one sheet. */
|
|
27
|
+
readonly pages?: boolean
|
|
28
|
+
/** A designed document opened at a section, by its heading's slug. */
|
|
29
|
+
readonly section?: string
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
/** The fragment that carries a frame's start: `#sixb-slide=3&sixb-fill`. */
|
|
32
|
+
/** The fragment that carries a frame's start: `#sixb-slide=3&sixb-fill`, `#sixb-pages`. */
|
|
29
33
|
export function frameStartHash(start: FrameStart): string {
|
|
30
34
|
const params: string[] = []
|
|
31
35
|
if (start.slide !== undefined && start.slide > 1)
|
|
32
36
|
params.push(`sixb-slide=${Math.round(start.slide)}`)
|
|
33
37
|
if (start.fill) params.push("sixb-fill")
|
|
38
|
+
if (start.pages) params.push("sixb-pages")
|
|
39
|
+
if (start.section) params.push(`sixb-section=${encodeURIComponent(start.section)}`)
|
|
34
40
|
return params.length > 0 ? `#${params.join("&")}` : ""
|
|
35
41
|
}
|
|
36
42
|
|
|
@@ -72,6 +78,11 @@ export type FrameRequest =
|
|
|
72
78
|
* then keeps panning the canvas rather than scrolling itself.
|
|
73
79
|
*/
|
|
74
80
|
| FrameRequestOf<"canvas", { readonly moving: boolean }>
|
|
81
|
+
/**
|
|
82
|
+
* Runs a designed document's editor in its frame, served for editing: `code` is the editor's
|
|
83
|
+
* script, which takes the `MessagePort` the request transfers and edits the body in place.
|
|
84
|
+
*/
|
|
85
|
+
| FrameRequestOf<"editor", { readonly code: string }>
|
|
75
86
|
|
|
76
87
|
interface FrameRequestOf<Method extends string, Params> {
|
|
77
88
|
readonly protocol: typeof FRAME_PROTOCOL
|