@sixb/core 0.2.2 → 0.2.4
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 +56 -50
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/executor.d.ts +0 -2
- package/dist/actions/run/executor.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +5 -1
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/cancel.d.ts +1 -1
- package/dist/agents/cancel.d.ts.map +1 -1
- package/dist/agents/child-question.d.ts +35 -2
- package/dist/agents/child-question.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +3 -2
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/fork.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 +4 -4
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +91 -76
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/request.d.ts +7 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +73 -10
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-session-children.d.ts +9 -0
- 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 +3 -0
- package/dist/agents/run-session.d.ts.map +1 -1
- package/dist/agents/streams/index.js +2 -2
- package/dist/agents/streams/internal.js +2 -2
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts +1 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/agents/tool-input-coercion.d.ts +20 -0
- package/dist/agents/tool-input-coercion.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/access.d.ts +37 -17
- package/dist/artifacts/access.d.ts.map +1 -1
- package/dist/artifacts/canvas-display.d.ts +65 -0
- package/dist/artifacts/canvas-display.d.ts.map +1 -0
- package/dist/artifacts/canvas.d.ts +6 -1
- package/dist/artifacts/canvas.d.ts.map +1 -1
- package/dist/artifacts/comment-text.d.ts +19 -0
- package/dist/artifacts/comment-text.d.ts.map +1 -0
- package/dist/artifacts/comments.d.ts +52 -0
- package/dist/artifacts/comments.d.ts.map +1 -0
- package/dist/artifacts/errors.d.ts +3 -3
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/events.d.ts +14 -0
- package/dist/artifacts/events.d.ts.map +1 -0
- package/dist/artifacts/execution.d.ts +129 -22
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +12 -1
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/grants.d.ts +8 -5
- package/dist/artifacts/frames/grants.d.ts.map +1 -1
- package/dist/artifacts/frames/index.d.ts +1 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +32 -964
- package/dist/artifacts/frames/index.js.map +4 -8
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +129 -0
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +24 -7
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/holders.d.ts +23 -0
- package/dist/artifacts/holders.d.ts.map +1 -0
- package/dist/artifacts/ids.d.ts +2 -0
- package/dist/artifacts/ids.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +6 -4
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +134 -13
- package/dist/artifacts/index.js.map +5 -4
- package/dist/artifacts/limits.d.ts +24 -3
- package/dist/artifacts/limits.d.ts.map +1 -1
- package/dist/artifacts/live/board.d.ts +103 -0
- package/dist/artifacts/live/board.d.ts.map +1 -0
- package/dist/artifacts/live/diff.d.ts +43 -0
- package/dist/artifacts/live/diff.d.ts.map +1 -0
- package/dist/artifacts/live/document.d.ts +55 -0
- package/dist/artifacts/live/document.d.ts.map +1 -0
- package/dist/artifacts/live/files.d.ts +16 -0
- package/dist/artifacts/live/files.d.ts.map +1 -0
- package/dist/artifacts/live/index.d.ts +9 -0
- package/dist/artifacts/live/index.d.ts.map +1 -0
- package/dist/artifacts/live/index.js +593 -0
- package/dist/artifacts/live/index.js.map +10 -0
- package/dist/artifacts/live/presence.d.ts +55 -0
- package/dist/artifacts/live/presence.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.d.ts +109 -0
- package/dist/artifacts/live/protocol.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.js +21 -0
- package/dist/artifacts/live/protocol.js.map +9 -0
- package/dist/artifacts/live/server.d.ts +10 -0
- package/dist/artifacts/live/server.d.ts.map +1 -0
- package/dist/artifacts/live/server.js +86 -0
- package/dist/artifacts/live/server.js.map +9 -0
- package/dist/artifacts/live/state.d.ts +26 -0
- package/dist/artifacts/live/state.d.ts.map +1 -0
- package/dist/artifacts/outline.d.ts +11 -0
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/publish/index.d.ts +8 -1
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +62 -34
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +75 -0
- package/dist/artifacts/publish/merge.d.ts.map +1 -0
- package/dist/artifacts/publish/previews.d.ts +153 -0
- package/dist/artifacts/publish/previews.d.ts.map +1 -0
- package/dist/artifacts/publish/publish.d.ts +29 -8
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/query-answers.d.ts +20 -0
- package/dist/artifacts/publish/query-answers.d.ts.map +1 -0
- package/dist/artifacts/publish/references.d.ts +4 -3
- package/dist/artifacts/publish/references.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/canvas.d.ts.map +1 -1
- package/dist/artifacts/theme.d.ts +5 -1
- package/dist/artifacts/theme.d.ts.map +1 -1
- package/dist/auth/directory.d.ts +33 -0
- package/dist/auth/directory.d.ts.map +1 -0
- package/dist/auth/index.js +13 -12
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/member-events.d.ts +5 -1
- package/dist/auth/member-events.d.ts.map +1 -1
- package/dist/auth/runtime.d.ts +22 -1
- package/dist/auth/runtime.d.ts.map +1 -1
- package/dist/auth/strategy.d.ts +2 -2
- package/dist/auth/strategy.d.ts.map +1 -1
- package/dist/auth/types.d.ts +42 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/authorization/decision.d.ts +6 -5
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/index.js +7 -6
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/index.js +4 -4
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/bootstrap/index.js +63 -57
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/broker/in-memory.d.ts.map +1 -1
- package/dist/broker/index.js +1 -1
- package/dist/broker/types.d.ts +4 -0
- package/dist/broker/types.d.ts.map +1 -1
- package/dist/{chunk-s7j8ewqv.js → chunk-0k3r5kb3.js} +257 -43
- package/dist/{chunk-s7j8ewqv.js.map → chunk-0k3r5kb3.js.map} +14 -13
- package/dist/{chunk-e5wf5vz0.js → chunk-0kgrghqx.js} +13 -1
- package/dist/chunk-0kgrghqx.js.map +10 -0
- package/dist/{chunk-80gym75n.js → chunk-186k5yz3.js} +1 -1
- package/dist/chunk-191jz8a6.js +61 -0
- package/dist/chunk-191jz8a6.js.map +10 -0
- package/dist/{chunk-mmagke4x.js → chunk-22d3qg4x.js} +2 -2
- package/dist/{chunk-mmagke4x.js.map → chunk-22d3qg4x.js.map} +3 -3
- package/dist/{chunk-ga63a3dz.js → chunk-2bn6813a.js} +3 -3
- package/dist/chunk-2c4j899j.js.map +2 -2
- package/dist/{chunk-e6xgz4h4.js → chunk-3014rfjz.js} +197 -18
- package/dist/chunk-3014rfjz.js.map +21 -0
- package/dist/{chunk-ytzcxtpt.js → chunk-3ba89vm7.js} +1 -1
- package/dist/chunk-3hzhcfsv.js +139 -0
- package/dist/chunk-3hzhcfsv.js.map +10 -0
- package/dist/chunk-3sgvd10b.js +69 -0
- package/dist/chunk-3sgvd10b.js.map +10 -0
- package/dist/chunk-3z1vxzcm.js +234 -0
- package/dist/chunk-3z1vxzcm.js.map +12 -0
- package/dist/{chunk-djs3hw9p.js → chunk-3zagkr6w.js} +73 -6
- package/dist/chunk-3zagkr6w.js.map +21 -0
- package/dist/{chunk-wkq3kvzd.js → chunk-48c1z8nj.js} +6 -6
- package/dist/chunk-48c1z8nj.js.map +10 -0
- package/dist/{chunk-d04g36fw.js → chunk-5qqmndhm.js} +1 -1
- package/dist/{chunk-scyq22td.js → chunk-5rqqp8cr.js} +19 -4
- package/dist/chunk-5rqqp8cr.js.map +12 -0
- package/dist/chunk-6ef4esq4.js +225 -0
- package/dist/chunk-6ef4esq4.js.map +11 -0
- package/dist/{chunk-jspskey0.js → chunk-7j4yydm2.js} +67 -45
- package/dist/chunk-7j4yydm2.js.map +11 -0
- package/dist/chunk-7kpqntgw.js +70 -0
- package/dist/chunk-7kpqntgw.js.map +10 -0
- package/dist/{chunk-5wtnmpze.js → chunk-7qe46788.js} +1 -1
- package/dist/{chunk-31kcqmhf.js → chunk-855w9nvw.js} +1 -1
- package/dist/{chunk-e7v3trpz.js → chunk-8a8k38tz.js} +4 -3
- package/dist/chunk-8a8k38tz.js.map +10 -0
- package/dist/chunk-8bns0y68.js +1322 -0
- package/dist/chunk-8bns0y68.js.map +25 -0
- package/dist/{chunk-jftd33rc.js → chunk-8t2ynwg0.js} +105 -9
- package/dist/chunk-8t2ynwg0.js.map +11 -0
- package/dist/{chunk-9whfmsfk.js → chunk-8tqnsx3q.js} +1 -1
- package/dist/{chunk-s3we74h8.js → chunk-9nsjjd44.js} +38 -5
- package/dist/chunk-9nsjjd44.js.map +12 -0
- package/dist/{chunk-hz5d43gn.js → chunk-9vsc919v.js} +14 -6
- package/dist/chunk-9vsc919v.js.map +10 -0
- package/dist/{chunk-waqk73p1.js → chunk-a6fjkcne.js} +185 -341
- package/dist/{chunk-waqk73p1.js.map → chunk-a6fjkcne.js.map} +6 -7
- package/dist/chunk-az95tsh3.js.map +2 -2
- package/dist/{chunk-s038wa5v.js → chunk-b9qfh2ya.js} +1 -1
- package/dist/{chunk-5taem5aw.js → chunk-bc3y6gff.js} +13 -4
- package/dist/chunk-bc3y6gff.js.map +10 -0
- package/dist/chunk-bz5bnjjt.js +358 -0
- package/dist/chunk-bz5bnjjt.js.map +12 -0
- package/dist/{chunk-w976a4me.js → chunk-czct88ht.js} +28 -4
- package/dist/chunk-czct88ht.js.map +10 -0
- package/dist/{chunk-5kyvrtjh.js → chunk-d9xbwh3h.js} +131 -32
- package/dist/chunk-d9xbwh3h.js.map +13 -0
- package/dist/{chunk-kfee1h52.js → chunk-dfveegqq.js} +28 -8
- package/dist/chunk-dfveegqq.js.map +13 -0
- package/dist/{chunk-2g0r46hy.js → chunk-dhkc9b23.js} +15 -2
- package/dist/chunk-dhkc9b23.js.map +12 -0
- package/dist/chunk-dmnd9ea6.js +106 -0
- package/dist/chunk-dmnd9ea6.js.map +10 -0
- package/dist/{chunk-nz7815t3.js → chunk-e0hnbb1m.js} +27 -2
- package/dist/chunk-e0hnbb1m.js.map +14 -0
- package/dist/chunk-e91fmg6t.js +288 -0
- package/dist/chunk-e91fmg6t.js.map +11 -0
- package/dist/{chunk-3sqqhpr7.js → chunk-evj5jxz3.js} +134 -19
- package/dist/{chunk-3sqqhpr7.js.map → chunk-evj5jxz3.js.map} +11 -10
- package/dist/{chunk-w122ymx4.js → chunk-f6ahf5gf.js} +15 -4
- package/dist/{chunk-w122ymx4.js.map → chunk-f6ahf5gf.js.map} +3 -3
- package/dist/{chunk-jjmggm9a.js → chunk-fe6r7yhg.js} +1 -1
- package/dist/{chunk-165c9wm6.js → chunk-g2ph4873.js} +1 -1
- package/dist/{chunk-dsv783c3.js → chunk-gxwy4c3s.js} +203 -57
- package/dist/chunk-gxwy4c3s.js.map +47 -0
- package/dist/chunk-hgj98cbb.js +22 -0
- package/dist/chunk-hgj98cbb.js.map +10 -0
- package/dist/chunk-hn2r7z41.js.map +3 -3
- package/dist/chunk-hvbvq7p4.js +1553 -0
- package/dist/chunk-hvbvq7p4.js.map +18 -0
- package/dist/chunk-j0wgh8gv.js +250 -0
- package/dist/chunk-j0wgh8gv.js.map +10 -0
- package/dist/{chunk-z8fx5cgb.js → chunk-j2zm215x.js} +37 -3
- package/dist/chunk-j2zm215x.js.map +12 -0
- package/dist/{chunk-j1ny5fwh.js → chunk-k1g14kk3.js} +11 -83
- package/dist/{chunk-j1ny5fwh.js.map → chunk-k1g14kk3.js.map} +4 -5
- package/dist/chunk-kr6dx38r.js +25 -0
- package/dist/chunk-kr6dx38r.js.map +10 -0
- package/dist/chunk-m2jerfef.js +474 -0
- package/dist/chunk-m2jerfef.js.map +11 -0
- package/dist/{chunk-m2vh8gh0.js → chunk-msyevpp3.js} +62 -15
- package/dist/{chunk-m2vh8gh0.js.map → chunk-msyevpp3.js.map} +5 -5
- package/dist/{chunk-escedwyt.js → chunk-mvz89age.js} +6 -1
- package/dist/{chunk-escedwyt.js.map → chunk-mvz89age.js.map} +3 -3
- package/dist/chunk-mwcqz3e3.js +30 -0
- package/dist/chunk-mwcqz3e3.js.map +10 -0
- package/dist/chunk-n2ay51px.js +21 -0
- package/dist/chunk-n2ay51px.js.map +10 -0
- package/dist/chunk-n4zzaf6q.js.map +1 -1
- package/dist/{chunk-gkv8r794.js → chunk-n68vz95m.js} +5 -5
- package/dist/{chunk-gkv8r794.js.map → chunk-n68vz95m.js.map} +3 -3
- package/dist/{chunk-0j3crh1w.js → chunk-p351afzm.js} +14 -14
- package/dist/{chunk-0j3crh1w.js.map → chunk-p351afzm.js.map} +4 -4
- package/dist/{chunk-c7cfe31p.js → chunk-p8pgnq8d.js} +16 -16
- package/dist/{chunk-c7cfe31p.js.map → chunk-p8pgnq8d.js.map} +1 -1
- package/dist/chunk-pk539cwv.js +370 -0
- package/dist/chunk-pk539cwv.js.map +11 -0
- package/dist/{chunk-jbw70d6t.js → chunk-ppxf7gw2.js} +52 -10
- package/dist/chunk-ppxf7gw2.js.map +11 -0
- package/dist/{chunk-9x8dybsb.js → chunk-pvpq483h.js} +10 -2
- package/dist/chunk-pvpq483h.js.map +10 -0
- package/dist/{chunk-4zm1k3xj.js → chunk-r2psmn42.js} +1 -1
- package/dist/{chunk-a7aa0nzj.js → chunk-r9rtavg9.js} +14 -14
- package/dist/{chunk-a7aa0nzj.js.map → chunk-r9rtavg9.js.map} +1 -1
- package/dist/{chunk-w1btn96n.js → chunk-rsrc7vtw.js} +523 -254
- package/dist/chunk-rsrc7vtw.js.map +49 -0
- package/dist/{chunk-2ajw5rz0.js → chunk-rsxb14an.js} +3 -3
- package/dist/{chunk-kkjfve0t.js → chunk-rt9deb92.js} +4 -3
- package/dist/{chunk-kkjfve0t.js.map → chunk-rt9deb92.js.map} +3 -3
- package/dist/{chunk-r1cxq7vv.js → chunk-rtdrm592.js} +2 -2
- package/dist/{chunk-a5v4gjdx.js → chunk-rtm1jq00.js} +460 -227
- package/dist/{chunk-a5v4gjdx.js.map → chunk-rtm1jq00.js.map} +25 -22
- package/dist/{chunk-4bm0caep.js → chunk-smnt672s.js} +1 -1
- package/dist/{chunk-21q0j5f2.js → chunk-stmxh0hv.js} +2 -2
- package/dist/{chunk-nh26e7c5.js → chunk-sysnvjce.js} +5 -5
- package/dist/{chunk-nh26e7c5.js.map → chunk-sysnvjce.js.map} +3 -3
- package/dist/{chunk-7z5rkf0m.js → chunk-t0s7b3d1.js} +4 -3
- package/dist/{chunk-7z5rkf0m.js.map → chunk-t0s7b3d1.js.map} +3 -3
- package/dist/{chunk-57g0215c.js → chunk-t24yktqr.js} +296 -7
- package/dist/{chunk-57g0215c.js.map → chunk-t24yktqr.js.map} +6 -3
- package/dist/{chunk-mbc5hvnj.js → chunk-td26wjr5.js} +18 -7
- package/dist/{chunk-mbc5hvnj.js.map → chunk-td26wjr5.js.map} +3 -3
- package/dist/{chunk-ff5xkv0p.js → chunk-tfzvjdms.js} +1 -1
- package/dist/{chunk-f1h34y3r.js → chunk-vepea5c3.js} +6 -6
- package/dist/{chunk-f1h34y3r.js.map → chunk-vepea5c3.js.map} +1 -1
- package/dist/chunk-vtjzwymr.js +37 -0
- package/dist/chunk-vtjzwymr.js.map +10 -0
- package/dist/{chunk-twfreyxr.js → chunk-vzkxqf8h.js} +23 -13
- package/dist/{chunk-twfreyxr.js.map → chunk-vzkxqf8h.js.map} +6 -6
- package/dist/{chunk-eqgr6nsa.js → chunk-w1wq7gfr.js} +983 -185
- package/dist/chunk-w1wq7gfr.js.map +75 -0
- package/dist/{chunk-6b61s40c.js → chunk-w3t94hm6.js} +1 -1
- package/dist/{chunk-fwsvshr5.js → chunk-wa05txmk.js} +20 -7
- package/dist/{chunk-fwsvshr5.js.map → chunk-wa05txmk.js.map} +3 -3
- package/dist/chunk-whbwf3np.js +12 -0
- package/dist/chunk-whbwf3np.js.map +10 -0
- package/dist/{chunk-t5608tkq.js → chunk-yv8hv4wq.js} +3 -1
- package/dist/{chunk-t5608tkq.js.map → chunk-yv8hv4wq.js.map} +3 -3
- package/dist/{chunk-j8thxj7w.js → chunk-yy914zfr.js} +1218 -101
- package/dist/chunk-yy914zfr.js.map +30 -0
- package/dist/connectors/builders.d.ts +2 -2
- package/dist/connectors/builders.d.ts.map +1 -1
- package/dist/connectors/connections/access.d.ts +11 -0
- package/dist/connectors/connections/access.d.ts.map +1 -0
- package/dist/connectors/connections/contracts.d.ts +6 -1
- package/dist/connectors/connections/contracts.d.ts.map +1 -1
- package/dist/connectors/connections/internal.js +1 -1
- package/dist/connectors/connections/runs.d.ts +6 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/connectors/connections/service.d.ts +25 -0
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/connections/views.d.ts +1 -1
- package/dist/connectors/connections/views.d.ts.map +1 -1
- 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 +3 -0
- package/dist/connectors/service.d.ts.map +1 -1
- package/dist/connectors/types.d.ts +21 -2
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/datasets/execution.d.ts +12 -6
- package/dist/datasets/execution.d.ts.map +1 -1
- package/dist/datasets/ingest-flush-batch.d.ts +59 -0
- package/dist/datasets/ingest-flush-batch.d.ts.map +1 -0
- package/dist/datasets/ingest-flush-job.d.ts +33 -0
- package/dist/datasets/ingest-flush-job.d.ts.map +1 -0
- package/dist/datasets/ingest-flush.d.ts +66 -0
- package/dist/datasets/ingest-flush.d.ts.map +1 -0
- package/dist/datasets/produced-version.d.ts +21 -0
- package/dist/datasets/produced-version.d.ts.map +1 -0
- package/dist/datasets/write.d.ts +22 -1
- package/dist/datasets/write.d.ts.map +1 -1
- package/dist/datasets/write.js +8 -4
- package/dist/datasets/write.js.map +1 -1
- package/dist/deploy/internal.js +5 -4
- package/dist/deploy/internal.js.map +4 -4
- package/dist/deploy/types.d.ts +2 -3
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/error-reporting/capability.d.ts +8 -2
- package/dist/error-reporting/capability.d.ts.map +1 -1
- package/dist/error-reporting/internal.d.ts +1 -1
- package/dist/error-reporting/internal.d.ts.map +1 -1
- package/dist/error-reporting/internal.js +17 -5
- package/dist/error-reporting/internal.js.map +1 -1
- package/dist/error-reporting/reporter.d.ts.map +1 -1
- package/dist/error-reporting/reports.d.ts +55 -0
- package/dist/error-reporting/reports.d.ts.map +1 -1
- package/dist/error-reporting/types.d.ts +82 -1
- package/dist/error-reporting/types.d.ts.map +1 -1
- package/dist/errors/catalog.d.ts +5 -0
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/internal.js +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 +1 -0
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +5 -5
- package/dist/events/scope.d.ts.map +1 -1
- package/dist/events/scope.js +1 -1
- package/dist/events/selectors/index.js +2 -2
- package/dist/events/types/artifacts.d.ts +38 -0
- package/dist/events/types/artifacts.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/users.d.ts +5 -2
- package/dist/events/types/users.d.ts.map +1 -1
- package/dist/execution/agent.js +58 -52
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +10 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/object-reader-clearance.d.ts +6 -0
- package/dist/execution/object-reader-clearance.d.ts.map +1 -1
- package/dist/execution/object-reader-security.d.ts +9 -2
- package/dist/execution/object-reader-security.d.ts.map +1 -1
- package/dist/execution/primitive.js +56 -50
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +50 -44
- package/dist/execution/request.js.map +2 -2
- package/dist/http/api-routes.d.ts +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +96 -88
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/errors.d.ts +15 -0
- package/dist/lake-storage/errors.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +3 -2
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +16 -10
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/maintenance.d.ts +88 -0
- package/dist/lake-storage/maintenance.d.ts.map +1 -0
- package/dist/lake-storage/merge.d.ts +3 -1
- package/dist/lake-storage/merge.d.ts.map +1 -1
- package/dist/lake-storage/source-ordering.d.ts +23 -0
- package/dist/lake-storage/source-ordering.d.ts.map +1 -1
- package/dist/lake-storage/types.d.ts +10 -0
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/maintenance/heartbeat.d.ts +5 -0
- package/dist/maintenance/heartbeat.d.ts.map +1 -0
- package/dist/maintenance/index.d.ts +4 -2
- package/dist/maintenance/index.d.ts.map +1 -1
- package/dist/maintenance/index.js +515 -0
- package/dist/maintenance/index.js.map +16 -0
- package/dist/maintenance/lake-retention-status.d.ts +36 -0
- package/dist/maintenance/lake-retention-status.d.ts.map +1 -0
- package/dist/maintenance/lake-retention.d.ts +84 -0
- package/dist/maintenance/lake-retention.d.ts.map +1 -0
- package/dist/maintenance/loop.d.ts +95 -0
- package/dist/maintenance/loop.d.ts.map +1 -0
- package/dist/maintenance/ontology-maintenance.d.ts +17 -16
- package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
- package/dist/maintenance/passes/cron-pass.d.ts +21 -0
- package/dist/maintenance/passes/cron-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/directory-pass.d.ts +12 -0
- package/dist/maintenance/passes/directory-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/ingest-pass.d.ts +26 -0
- package/dist/maintenance/passes/ingest-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/lake-change-feed.d.ts +38 -0
- package/dist/maintenance/passes/lake-change-feed.d.ts.map +1 -0
- package/dist/maintenance/passes/lake-retention-pass.d.ts +20 -0
- package/dist/maintenance/passes/lake-retention-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/ontology-pass.d.ts +8 -0
- package/dist/maintenance/passes/ontology-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/projections-pass.d.ts +26 -0
- package/dist/maintenance/passes/projections-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/recovery-pass.d.ts +6 -0
- package/dist/maintenance/passes/recovery-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/recovery-passes.d.ts +24 -0
- package/dist/maintenance/passes/recovery-passes.d.ts.map +1 -0
- package/dist/maintenance/passes/runs-pass.d.ts +6 -0
- package/dist/maintenance/passes/runs-pass.d.ts.map +1 -0
- package/dist/maintenance/passes/triggers-pass.d.ts +41 -0
- package/dist/maintenance/passes/triggers-pass.d.ts.map +1 -0
- package/dist/maintenance/status.d.ts +19 -0
- package/dist/maintenance/status.d.ts.map +1 -0
- package/dist/maintenance/types.d.ts +25 -24
- package/dist/maintenance/types.d.ts.map +1 -1
- package/dist/materialization/model.d.ts +11 -2
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/edits/artifact-refs.d.ts +33 -0
- package/dist/materializer/edits/artifact-refs.d.ts.map +1 -0
- package/dist/materializer/edits/commit.d.ts.map +1 -1
- package/dist/materializer/edits/operations.d.ts +7 -1
- package/dist/materializer/edits/operations.d.ts.map +1 -1
- package/dist/materializer/edits/plan.d.ts.map +1 -1
- package/dist/materializer/execution/work-records.d.ts +6 -0
- package/dist/materializer/execution/work-records.d.ts.map +1 -1
- package/dist/materializer/index.js +31 -28
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/materializer/telemetry/plan.d.ts.map +1 -1
- package/dist/models/execution/index.js +30 -27
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/language-model.d.ts +6 -0
- package/dist/models/language-model.d.ts.map +1 -1
- package/dist/models/tools.d.ts +2 -0
- package/dist/models/tools.d.ts.map +1 -1
- package/dist/objects/artifact-refs.d.ts +5 -0
- package/dist/objects/artifact-refs.d.ts.map +1 -0
- package/dist/objects/index.js +59 -54
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/materializer-adapter.d.ts +4 -3
- package/dist/objects/materializer-adapter.d.ts.map +1 -1
- package/dist/objects/object/upsert-batch.d.ts.map +1 -1
- package/dist/objects/object/upsert.d.ts.map +1 -1
- package/dist/objects/query/index.js +29 -26
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/ir.d.ts +3 -1
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/scalar-values.d.ts.map +1 -1
- package/dist/objects/runtime-batch.d.ts +2 -0
- package/dist/objects/runtime-batch.d.ts.map +1 -1
- package/dist/ontology/artifact-ref.d.ts +36 -0
- package/dist/ontology/artifact-ref.d.ts.map +1 -0
- package/dist/ontology/docs-markdown.d.ts.map +1 -1
- package/dist/ontology/index.d.ts +3 -1
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +8 -5
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/inference/index.d.ts +2 -0
- package/dist/ontology/inference/index.d.ts.map +1 -1
- package/dist/ontology/internal.js +7 -6
- package/dist/ontology/internal.js.map +1 -1
- package/dist/ontology/json-schema.d.ts.map +1 -1
- package/dist/ontology/primitives.d.ts.map +1 -1
- package/dist/ontology/reference-values.d.ts +10 -0
- package/dist/ontology/reference-values.d.ts.map +1 -0
- package/dist/ontology/refs.d.ts +6 -1
- package/dist/ontology/refs.d.ts.map +1 -1
- package/dist/ontology/registry.d.ts +9 -1
- package/dist/ontology/registry.d.ts.map +1 -1
- package/dist/ontology/types.d.ts +2 -1
- package/dist/ontology/types.d.ts.map +1 -1
- package/dist/ontology/user-ref.d.ts +16 -0
- package/dist/ontology/user-ref.d.ts.map +1 -1
- package/dist/ontology/validation/normalize.d.ts.map +1 -1
- package/dist/ontology/validation/properties.d.ts.map +1 -1
- package/dist/ontology/validation/schema.d.ts.map +1 -1
- package/dist/pending-tasks.d.ts +17 -0
- package/dist/pending-tasks.d.ts.map +1 -0
- package/dist/pipelines/index.js +37 -34
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/run-dispatch.d.ts +6 -0
- package/dist/pipelines/run-dispatch.d.ts.map +1 -1
- package/dist/predicates/types.d.ts +4 -0
- package/dist/predicates/types.d.ts.map +1 -1
- package/dist/projections/builders.d.ts +13 -11
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/internal.js +30 -27
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/types.d.ts +1 -1
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts +2 -2
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/queues/in-memory.d.ts +6 -1
- 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 +55 -2
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/create.d.ts +3 -0
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +22 -5
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +6 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +52 -31
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/sixb.d.ts +6 -1
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/index.js +8 -7
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +0 -2
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +3 -6
- package/dist/scheduler/index.js.map +1 -1
- package/dist/schedules/index.js +9 -11
- package/dist/schedules/index.js.map +1 -1
- package/dist/security/internal.js +1 -1
- package/dist/shared/backoff.d.ts +12 -0
- package/dist/shared/backoff.d.ts.map +1 -0
- package/dist/shared/duration.d.ts +3 -0
- package/dist/shared/duration.d.ts.map +1 -0
- package/dist/shared/params/artifact-refs.d.ts +19 -0
- package/dist/shared/params/artifact-refs.d.ts.map +1 -0
- package/dist/shares/guest-name.d.ts +8 -0
- package/dist/shares/guest-name.d.ts.map +1 -0
- package/dist/shares/internal.d.ts +1 -0
- package/dist/shares/internal.d.ts.map +1 -1
- package/dist/shares/internal.js +69 -28
- package/dist/shares/internal.js.map +3 -3
- package/dist/shares/session-protocol.d.ts +13 -0
- package/dist/shares/session-protocol.d.ts.map +1 -1
- package/dist/storage/action-runs/failure.js +2 -2
- package/dist/storage/agents/provider.js +1 -1
- package/dist/storage/agents/types.d.ts +1 -1
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +2 -2
- package/dist/storage/artifacts/errors.d.ts +9 -4
- package/dist/storage/artifacts/errors.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +27 -4
- 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 +39 -2
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +328 -39
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts +2 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/identities.d.ts +4 -0
- package/dist/storage/auth/in-memory/identities.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/shared.d.ts +3 -1
- package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/users.d.ts.map +1 -1
- package/dist/storage/auth/index.d.ts +1 -1
- package/dist/storage/auth/index.d.ts.map +1 -1
- package/dist/storage/auth/types.d.ts +39 -0
- package/dist/storage/auth/types.d.ts.map +1 -1
- package/dist/storage/connector-connections/in-memory.d.ts +1 -1
- package/dist/storage/connector-connections/in-memory.d.ts.map +1 -1
- package/dist/storage/connector-connections/index.d.ts +1 -1
- package/dist/storage/connector-connections/index.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/runs.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/shared.d.ts +12 -2
- package/dist/storage/connector-connections/provider/shared.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.d.ts +1 -0
- package/dist/storage/connector-connections/provider.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +21 -5
- package/dist/storage/connector-connections/provider.js.map +5 -5
- package/dist/storage/connector-connections/types.d.ts +1 -1
- package/dist/storage/connector-connections/types.d.ts.map +1 -1
- package/dist/storage/dataset-ingest/codec.d.ts +6 -0
- package/dist/storage/dataset-ingest/codec.d.ts.map +1 -0
- package/dist/storage/dataset-ingest/in-memory.d.ts +28 -0
- package/dist/storage/dataset-ingest/in-memory.d.ts.map +1 -0
- package/dist/storage/dataset-ingest/index.d.ts +4 -0
- package/dist/storage/dataset-ingest/index.d.ts.map +1 -0
- package/dist/storage/dataset-ingest/provider.d.ts +157 -0
- package/dist/storage/dataset-ingest/provider.d.ts.map +1 -0
- package/dist/storage/dataset-ingest/provider.js +17 -0
- package/dist/storage/dataset-ingest/provider.js.map +9 -0
- package/dist/storage/dataset-ingest/types.d.ts +188 -0
- package/dist/storage/dataset-ingest/types.d.ts.map +1 -0
- package/dist/storage/file-upload-sessions/provider.js +12 -11
- package/dist/storage/file-upload-sessions/provider.js.map +1 -1
- package/dist/storage/in-memory/index.d.ts +12 -0
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +18 -11
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +56 -46
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +4 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +81 -5
- package/dist/storage/internal.js.map +4 -3
- package/dist/storage/lake-retention-runs/in-memory.d.ts +11 -0
- package/dist/storage/lake-retention-runs/in-memory.d.ts.map +1 -0
- package/dist/storage/lake-retention-runs/index.d.ts +3 -0
- package/dist/storage/lake-retention-runs/index.d.ts.map +1 -0
- package/dist/storage/lake-retention-runs/types.d.ts +21 -0
- package/dist/storage/lake-retention-runs/types.d.ts.map +1 -0
- package/dist/storage/maintenance-heartbeats/in-memory.d.ts +11 -0
- package/dist/storage/maintenance-heartbeats/in-memory.d.ts.map +1 -0
- package/dist/storage/maintenance-heartbeats/index.d.ts +3 -0
- package/dist/storage/maintenance-heartbeats/index.d.ts.map +1 -0
- package/dist/storage/maintenance-heartbeats/record.d.ts +11 -0
- package/dist/storage/maintenance-heartbeats/record.d.ts.map +1 -0
- package/dist/storage/maintenance-heartbeats/types.d.ts +30 -0
- package/dist/storage/maintenance-heartbeats/types.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
- package/dist/storage/objects/in-memory/storage.d.ts +15 -1
- package/dist/storage/objects/in-memory/storage.d.ts.map +1 -1
- package/dist/storage/objects/read-scope.d.ts.map +1 -1
- package/dist/storage/objects/types.d.ts +18 -1
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
- package/dist/storage/ontology/index.d.ts +1 -1
- package/dist/storage/ontology/index.d.ts.map +1 -1
- package/dist/storage/ontology/materializations.d.ts +20 -0
- package/dist/storage/ontology/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/provider-work.d.ts +7 -1
- package/dist/storage/ontology/provider-work.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/pipeline-runs/in-memory.d.ts +8 -2
- package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/pipeline-runs/index.d.ts +1 -1
- package/dist/storage/pipeline-runs/index.d.ts.map +1 -1
- package/dist/storage/pipeline-runs/provider.js +1 -1
- package/dist/storage/pipeline-runs/transitions.d.ts +2 -2
- package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -1
- package/dist/storage/pipeline-runs/types.d.ts +26 -6
- package/dist/storage/pipeline-runs/types.d.ts.map +1 -1
- package/dist/storage/projection-runs/errors.d.ts +6 -0
- package/dist/storage/projection-runs/errors.d.ts.map +1 -1
- package/dist/storage/projection-runs/in-memory.d.ts +5 -1
- package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/projection-runs/index.d.ts +2 -2
- package/dist/storage/projection-runs/index.d.ts.map +1 -1
- package/dist/storage/projection-runs/lifecycle.d.ts +1 -0
- package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
- package/dist/storage/projection-runs/provider.js +2 -2
- package/dist/storage/projection-runs/types.d.ts +16 -0
- package/dist/storage/projection-runs/types.d.ts.map +1 -1
- package/dist/storage/run-claim.d.ts +132 -0
- package/dist/storage/run-claim.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.js +3 -3
- package/dist/storage/share-sessions/in-memory.d.ts +2 -1
- package/dist/storage/share-sessions/in-memory.d.ts.map +1 -1
- package/dist/storage/share-sessions/index.d.ts +1 -1
- package/dist/storage/share-sessions/index.d.ts.map +1 -1
- package/dist/storage/share-sessions/provider.d.ts +1 -1
- package/dist/storage/share-sessions/provider.d.ts.map +1 -1
- package/dist/storage/share-sessions/provider.js +4 -2
- package/dist/storage/share-sessions/provider.js.map +1 -1
- package/dist/storage/share-sessions/record.d.ts +2 -1
- package/dist/storage/share-sessions/record.d.ts.map +1 -1
- package/dist/storage/share-sessions/types.d.ts +17 -1
- package/dist/storage/share-sessions/types.d.ts.map +1 -1
- package/dist/storage/sync-runs/in-memory.d.ts +10 -2
- 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/transitions.d.ts +2 -2
- package/dist/storage/sync-runs/transitions.d.ts.map +1 -1
- package/dist/storage/sync-runs/types.d.ts +29 -3
- package/dist/storage/sync-runs/types.d.ts.map +1 -1
- package/dist/storage/types.d.ts +12 -6
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/webhook-runs/in-memory.d.ts +2 -1
- package/dist/storage/webhook-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/webhook-runs/index.d.ts +2 -2
- package/dist/storage/webhook-runs/index.d.ts.map +1 -1
- package/dist/storage/webhook-runs/types.d.ts +33 -2
- package/dist/storage/webhook-runs/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/in-memory.d.ts +6 -3
- package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/workflow-runs/index.d.ts +1 -1
- package/dist/storage/workflow-runs/index.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +12 -11
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/storage/workflow-runs/types.d.ts +11 -28
- package/dist/storage/workflow-runs/types.d.ts.map +1 -1
- package/dist/syncs/index.js +38 -35
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/run-dispatch.d.ts +2 -0
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
- package/dist/testing/artifact-holders-contract.d.ts +15 -0
- package/dist/testing/artifact-holders-contract.d.ts.map +1 -0
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/auth-storage-contract.d.ts.map +1 -1
- package/dist/testing/broker-contract.d.ts.map +1 -1
- package/dist/testing/connector-connection-storage-contract.d.ts +1 -1
- package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
- package/dist/testing/dataset-ingest-storage-contract.d.ts +11 -0
- package/dist/testing/dataset-ingest-storage-contract.d.ts.map +1 -0
- package/dist/testing/dataset-sequence-contract.d.ts +1 -1
- package/dist/testing/dataset-sequence-contract.d.ts.map +1 -1
- package/dist/testing/execution.d.ts.map +1 -1
- package/dist/testing/index.d.ts +8 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6245 -3192
- package/dist/testing/index.js.map +28 -19
- package/dist/testing/lake-retention-run-storage-contract.d.ts +9 -0
- package/dist/testing/lake-retention-run-storage-contract.d.ts.map +1 -0
- package/dist/testing/maintenance-heartbeat-storage-contract.d.ts +9 -0
- package/dist/testing/maintenance-heartbeat-storage-contract.d.ts.map +1 -0
- package/dist/testing/object-query-contract.d.ts.map +1 -1
- package/dist/testing/pipeline-execution.d.ts.map +1 -1
- package/dist/testing/pipeline-run-read-contract.d.ts +13 -0
- package/dist/testing/pipeline-run-read-contract.d.ts.map +1 -0
- package/dist/testing/projection-run-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 +12 -0
- package/dist/testing/run-claim-storage-contract.d.ts.map +1 -0
- package/dist/testing/run-claim.d.ts +30 -0
- package/dist/testing/run-claim.d.ts.map +1 -0
- package/dist/testing/run-recovery-contract.d.ts +49 -0
- package/dist/testing/run-recovery-contract.d.ts.map +1 -0
- package/dist/testing/share-session-storage-contract.d.ts.map +1 -1
- package/dist/testing/stored-artifacts.d.ts +10 -0
- package/dist/testing/stored-artifacts.d.ts.map +1 -0
- package/dist/testing/sync-execution.d.ts.map +1 -1
- package/dist/testing/webhook-execution.d.ts +1 -1
- package/dist/testing/webhook-execution.d.ts.map +1 -1
- package/dist/testing/webhook-run-storage-contract.d.ts.map +1 -1
- package/dist/users/execution.d.ts +18 -1
- package/dist/users/execution.d.ts.map +1 -1
- package/dist/users/index.d.ts +1 -1
- package/dist/users/index.d.ts.map +1 -1
- package/dist/webhooks/delivery-lease.d.ts +13 -0
- package/dist/webhooks/delivery-lease.d.ts.map +1 -0
- package/dist/webhooks/internal.d.ts +2 -0
- package/dist/webhooks/internal.d.ts.map +1 -1
- package/dist/webhooks/internal.js +68 -36
- package/dist/webhooks/internal.js.map +5 -4
- package/dist/webhooks/run-admission.d.ts.map +1 -1
- package/dist/workers/index.d.ts +5 -1
- package/dist/workers/index.d.ts.map +1 -1
- package/dist/workers/index.js +193 -58
- package/dist/workers/index.js.map +8 -7
- package/dist/workers/job-ids.d.ts +17 -0
- package/dist/workers/job-ids.d.ts.map +1 -0
- package/dist/workers/lost-projection-runs.d.ts +26 -0
- package/dist/workers/lost-projection-runs.d.ts.map +1 -0
- package/dist/workers/lost-runs.d.ts +51 -0
- package/dist/workers/lost-runs.d.ts.map +1 -0
- package/dist/workers/queue-delivery.d.ts.map +1 -1
- package/dist/workers/queue-worker.d.ts +1 -2
- package/dist/workers/queue-worker.d.ts.map +1 -1
- package/dist/workers/queued-run-dispatch.d.ts +90 -0
- package/dist/workers/queued-run-dispatch.d.ts.map +1 -0
- package/dist/workers/run-lease.d.ts +25 -0
- package/dist/workers/run-lease.d.ts.map +1 -0
- package/dist/workers/run-worker.d.ts +95 -0
- package/dist/workers/run-worker.d.ts.map +1 -0
- package/dist/workflows/index.js +64 -58
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/request.d.ts.map +1 -1
- package/dist/workflows/run-dispatch.d.ts +6 -1
- package/dist/workflows/run-dispatch.d.ts.map +1 -1
- package/package.json +41 -3
- package/src/actions/request.ts +24 -7
- package/src/actions/run/executor.ts +9 -42
- package/src/actions/types/context.ts +8 -3
- package/src/agents/approval-outcome.ts +2 -2
- package/src/agents/cancel.ts +2 -2
- package/src/agents/child-question.ts +76 -8
- package/src/agents/execution.ts +11 -3
- package/src/agents/fork.ts +12 -4
- package/src/agents/ids.ts +4 -1
- package/src/agents/index.ts +16 -3
- package/src/agents/model-loop.ts +3 -1
- package/src/agents/request.ts +42 -31
- package/src/agents/run-artifacts.ts +290 -46
- package/src/agents/run-session-children.ts +33 -0
- package/src/agents/run-session-http.ts +5 -0
- package/src/agents/run-session-serve.ts +11 -0
- package/src/agents/run-session.ts +8 -1
- package/src/agents/streams/protocol.ts +5 -10
- package/src/agents/tool-files.ts +1 -1
- package/src/agents/tool-input-coercion.ts +140 -0
- package/src/agents/validation.ts +12 -1
- package/src/artifacts/access.ts +71 -28
- package/src/artifacts/canvas-display.ts +160 -0
- package/src/artifacts/canvas.ts +26 -1
- package/src/artifacts/comment-text.ts +32 -0
- package/src/artifacts/comments.ts +275 -0
- package/src/artifacts/errors.ts +6 -1
- package/src/artifacts/events.ts +58 -0
- package/src/artifacts/execution.ts +496 -53
- package/src/artifacts/frames/assets.ts +20 -1
- package/src/artifacts/frames/grants.ts +31 -10
- package/src/artifacts/frames/index.ts +2 -0
- package/src/artifacts/frames/kit.ts +8 -5
- package/src/artifacts/frames/protocol.ts +231 -0
- package/src/artifacts/frames/runtime.ts +600 -29
- package/src/artifacts/holders.ts +120 -0
- package/src/artifacts/ids.ts +8 -0
- package/src/artifacts/index.ts +31 -2
- package/src/artifacts/limits.ts +28 -4
- package/src/artifacts/live/board.ts +759 -0
- package/src/artifacts/live/diff.ts +297 -0
- package/src/artifacts/live/document.ts +354 -0
- package/src/artifacts/live/files.ts +82 -0
- package/src/artifacts/live/index.ts +50 -0
- package/src/artifacts/live/presence.ts +144 -0
- package/src/artifacts/live/protocol.ts +134 -0
- package/src/artifacts/live/server.ts +16 -0
- package/src/artifacts/live/state.ts +115 -0
- package/src/artifacts/outline.ts +12 -0
- package/src/artifacts/publish/index.ts +26 -1
- package/src/artifacts/publish/merge.ts +271 -0
- package/src/artifacts/publish/previews.ts +485 -0
- package/src/artifacts/publish/publish.ts +92 -39
- package/src/artifacts/publish/query-answers.ts +85 -0
- package/src/artifacts/publish/references.ts +10 -4
- package/src/artifacts/publish/validate/canvas.ts +133 -1
- package/src/artifacts/theme.ts +9 -1
- package/src/auth/directory.ts +166 -0
- package/src/auth/member-events.ts +10 -3
- package/src/auth/runtime.ts +108 -8
- package/src/auth/strategy.ts +3 -1
- package/src/auth/types.ts +44 -0
- package/src/authorization/decision.ts +6 -5
- package/src/authorization/event-visibility.ts +4 -0
- package/src/broker/in-memory.ts +33 -6
- package/src/broker/types.ts +4 -0
- package/src/connectors/builders.ts +34 -2
- package/src/connectors/connections/access.ts +83 -0
- package/src/connectors/connections/contracts.ts +6 -1
- package/src/connectors/connections/execution.ts +2 -2
- package/src/connectors/connections/runs.ts +51 -2
- package/src/connectors/connections/service.ts +208 -41
- package/src/connectors/connections/views.ts +11 -4
- package/src/connectors/execution.ts +27 -3
- package/src/connectors/index.ts +2 -0
- package/src/connectors/service.ts +12 -0
- package/src/connectors/types.ts +37 -2
- package/src/datasets/execution.ts +74 -37
- package/src/datasets/ingest-flush-batch.ts +289 -0
- package/src/datasets/ingest-flush-job.ts +112 -0
- package/src/datasets/ingest-flush.ts +377 -0
- package/src/datasets/produced-version.ts +55 -0
- package/src/datasets/write.ts +65 -11
- package/src/deploy/services.ts +1 -1
- package/src/deploy/types.ts +2 -3
- package/src/deploy/validation.ts +1 -0
- package/src/error-reporting/capability.ts +66 -0
- package/src/error-reporting/internal.ts +12 -0
- package/src/error-reporting/reporter.ts +11 -35
- package/src/error-reporting/reports.ts +167 -0
- package/src/error-reporting/types.ts +99 -0
- package/src/errors/catalog.ts +6 -0
- package/src/events/definitions.ts +14 -0
- package/src/events/execution.ts +77 -28
- package/src/events/index.ts +3 -0
- package/src/events/scope.ts +2 -0
- package/src/events/types/artifacts.ts +40 -0
- package/src/events/types/index.ts +3 -0
- package/src/events/types/users.ts +5 -2
- package/src/execution/authorized-object-reader.ts +34 -0
- package/src/execution/object-reader-clearance.ts +31 -0
- package/src/execution/object-reader-security.ts +33 -13
- package/src/http/api-routes.ts +106 -5
- package/src/index.ts +22 -4
- package/src/lake-storage/errors.ts +21 -0
- package/src/lake-storage/index.ts +9 -1
- package/src/lake-storage/maintenance.ts +93 -0
- package/src/lake-storage/merge.ts +3 -1
- package/src/lake-storage/source-ordering.ts +28 -2
- package/src/lake-storage/types.ts +14 -0
- package/src/maintenance/heartbeat.ts +14 -0
- package/src/maintenance/index.ts +5 -3
- package/src/maintenance/lake-retention-status.ts +81 -0
- package/src/maintenance/lake-retention.ts +347 -0
- package/src/maintenance/loop.ts +365 -0
- package/src/maintenance/ontology-maintenance.ts +76 -229
- package/src/maintenance/passes/cron-pass.ts +217 -0
- package/src/maintenance/passes/directory-pass.ts +22 -0
- package/src/maintenance/passes/ingest-pass.ts +94 -0
- package/src/maintenance/passes/lake-change-feed.ts +112 -0
- package/src/maintenance/passes/lake-retention-pass.ts +71 -0
- package/src/maintenance/passes/ontology-pass.ts +19 -0
- package/src/maintenance/passes/projections-pass.ts +238 -0
- package/src/maintenance/passes/recovery-pass.ts +17 -0
- package/src/maintenance/passes/recovery-passes.ts +39 -0
- package/src/maintenance/passes/runs-pass.ts +12 -0
- package/src/maintenance/passes/triggers-pass.ts +332 -0
- package/src/maintenance/status.ts +75 -0
- package/src/maintenance/types.ts +27 -25
- package/src/materialization/model.ts +33 -21
- package/src/materializer/README.md +13 -2
- package/src/materializer/edits/artifact-refs.ts +140 -0
- package/src/materializer/edits/commit.ts +20 -7
- package/src/materializer/edits/operations.ts +23 -7
- package/src/materializer/edits/plan.ts +2 -0
- package/src/materializer/execution/work-records.ts +61 -0
- package/src/materializer/projections/replacement-plan.ts +2 -0
- package/src/materializer/shared/normalize.ts +14 -0
- package/src/materializer/telemetry/plan.ts +2 -0
- package/src/models/language-model.ts +6 -0
- package/src/models/tools.ts +2 -0
- package/src/objects/artifact-refs.ts +34 -0
- package/src/objects/materializer-adapter.ts +8 -3
- package/src/objects/object/upsert-batch.ts +7 -0
- package/src/objects/object/upsert.ts +11 -2
- package/src/objects/query/ir.ts +2 -0
- package/src/objects/query/scalar-values.ts +5 -3
- package/src/objects/runtime-batch.ts +8 -1
- package/src/objects/vectors/README.md +4 -4
- package/src/ontology/artifact-ref.ts +83 -0
- package/src/ontology/docs-markdown.ts +17 -0
- package/src/ontology/index.ts +3 -1
- package/src/ontology/inference/index.ts +2 -0
- package/src/ontology/json-schema.ts +13 -0
- package/src/ontology/primitives.ts +14 -0
- package/src/ontology/reference-values.ts +62 -0
- package/src/ontology/refs.ts +7 -1
- package/src/ontology/registry.ts +26 -1
- package/src/ontology/types.ts +2 -0
- package/src/ontology/user-ref.ts +35 -45
- package/src/ontology/validation/normalize.ts +13 -0
- package/src/ontology/validation/properties.ts +9 -0
- package/src/ontology/validation/schema.ts +12 -0
- package/src/pending-tasks.ts +51 -0
- package/src/pipelines/run-dispatch.ts +120 -238
- package/src/predicates/types.ts +2 -1
- package/src/projections/builders.ts +28 -13
- package/src/projections/run-dispatch.ts +1 -1
- package/src/projections/types.ts +1 -1
- package/src/projections/validation.ts +22 -8
- package/src/queues/in-memory.ts +50 -3
- package/src/queues/index.ts +4 -0
- package/src/queues/types.ts +68 -1
- package/src/runtime/create.ts +4 -0
- package/src/runtime/host.ts +118 -13
- package/src/runtime/index.ts +0 -1
- package/src/runtime/internal.ts +13 -0
- package/src/runtime/ontology-mutations.ts +1 -1
- package/src/runtime/sixb.ts +14 -5
- package/src/scheduler/index.ts +0 -2
- package/src/shared/backoff.ts +34 -0
- package/src/shared/duration.ts +15 -0
- package/src/shared/params/artifact-refs.ts +42 -0
- package/src/shares/compiler.ts +1 -1
- package/src/shares/guest-name.ts +20 -0
- package/src/shares/internal.ts +1 -0
- package/src/shares/session-protocol.ts +63 -0
- package/src/storage/agents/types.ts +1 -1
- package/src/storage/artifacts/errors.ts +10 -2
- package/src/storage/artifacts/in-memory.ts +579 -96
- package/src/storage/artifacts/index.ts +22 -1
- package/src/storage/artifacts/record.ts +255 -11
- package/src/storage/artifacts/types.ts +343 -40
- package/src/storage/auth/in-memory/auth-storage.ts +42 -5
- package/src/storage/auth/in-memory/identities.ts +16 -0
- package/src/storage/auth/in-memory/shared.ts +15 -0
- package/src/storage/auth/in-memory/users.ts +17 -16
- package/src/storage/auth/index.ts +3 -0
- package/src/storage/auth/types.ts +38 -0
- package/src/storage/connector-connections/in-memory.ts +4 -1
- package/src/storage/connector-connections/index.ts +1 -0
- package/src/storage/connector-connections/provider/runs.ts +3 -0
- package/src/storage/connector-connections/provider/shared.ts +30 -0
- package/src/storage/connector-connections/provider.ts +4 -0
- package/src/storage/connector-connections/types.ts +1 -0
- package/src/storage/dataset-ingest/codec.ts +90 -0
- package/src/storage/dataset-ingest/in-memory.ts +277 -0
- package/src/storage/dataset-ingest/index.ts +16 -0
- package/src/storage/dataset-ingest/provider.ts +592 -0
- package/src/storage/dataset-ingest/types.ts +191 -0
- package/src/storage/in-memory/index.ts +33 -0
- package/src/storage/index.ts +65 -5
- package/src/storage/internal.ts +20 -0
- package/src/storage/lake-retention-runs/in-memory.ts +22 -0
- package/src/storage/lake-retention-runs/index.ts +2 -0
- package/src/storage/lake-retention-runs/types.ts +19 -0
- package/src/storage/maintenance-heartbeats/in-memory.ts +24 -0
- package/src/storage/maintenance-heartbeats/index.ts +7 -0
- package/src/storage/maintenance-heartbeats/record.ts +50 -0
- package/src/storage/maintenance-heartbeats/types.ts +30 -0
- package/src/storage/objects/in-memory/query.ts +1 -0
- package/src/storage/objects/in-memory/storage.ts +81 -0
- package/src/storage/objects/read-scope.ts +1 -0
- package/src/storage/objects/types.ts +16 -1
- package/src/storage/ontology/in-memory/materializations.ts +8 -0
- package/src/storage/ontology/in-memory/replacement-plans.ts +4 -1
- package/src/storage/ontology/index.ts +2 -0
- package/src/storage/ontology/materializations.ts +18 -0
- package/src/storage/ontology/provider-work.ts +39 -0
- package/src/storage/pipeline-runs/in-memory.ts +97 -24
- package/src/storage/pipeline-runs/index.ts +0 -1
- package/src/storage/pipeline-runs/provider.ts +1 -1
- package/src/storage/pipeline-runs/transitions.ts +7 -4
- package/src/storage/pipeline-runs/types.ts +33 -7
- package/src/storage/projection-runs/errors.ts +10 -0
- package/src/storage/projection-runs/in-memory.ts +56 -1
- package/src/storage/projection-runs/index.ts +2 -1
- package/src/storage/projection-runs/lifecycle.ts +9 -1
- package/src/storage/projection-runs/types.ts +20 -1
- package/src/storage/run-claim.ts +224 -0
- package/src/storage/share-sessions/in-memory.ts +21 -0
- package/src/storage/share-sessions/index.ts +1 -0
- package/src/storage/share-sessions/provider.ts +1 -0
- package/src/storage/share-sessions/record.ts +28 -0
- package/src/storage/share-sessions/types.ts +19 -1
- package/src/storage/sync-runs/in-memory.ts +109 -29
- package/src/storage/sync-runs/index.ts +1 -1
- package/src/storage/sync-runs/transitions.ts +7 -4
- package/src/storage/sync-runs/types.ts +36 -3
- package/src/storage/types.ts +15 -5
- package/src/storage/webhook-runs/in-memory.ts +26 -2
- package/src/storage/webhook-runs/index.ts +3 -1
- package/src/storage/webhook-runs/types.ts +44 -3
- package/src/storage/workflow-runs/in-memory.ts +50 -36
- package/src/storage/workflow-runs/index.ts +0 -2
- package/src/storage/workflow-runs/types.ts +18 -30
- package/src/syncs/run-dispatch.ts +118 -239
- package/src/testing/ai-model-call-groups-contract.ts +2 -1
- package/src/testing/artifact-holders-contract.ts +392 -0
- package/src/testing/artifact-storage-contract.ts +1205 -151
- package/src/testing/auth-storage-contract.ts +228 -1
- package/src/testing/broker-contract.ts +56 -0
- package/src/testing/connector-connection-storage-contract.ts +94 -5
- package/src/testing/dataset-ingest-storage-contract.ts +480 -0
- package/src/testing/dataset-sequence-contract.ts +97 -12
- package/src/testing/execution.ts +23 -0
- package/src/testing/index.ts +31 -0
- package/src/testing/lake-retention-run-storage-contract.ts +75 -0
- package/src/testing/maintenance-heartbeat-storage-contract.ts +99 -0
- package/src/testing/object-query-contract.ts +93 -0
- package/src/testing/pipeline-execution.ts +3 -1
- package/src/testing/pipeline-run-read-contract.ts +123 -0
- package/src/testing/projection-run-storage-contract.ts +113 -0
- package/src/testing/queues-contract.ts +112 -0
- package/src/testing/run-claim-storage-contract.ts +736 -0
- package/src/testing/run-claim.ts +69 -0
- package/src/testing/run-recovery-contract.ts +176 -0
- package/src/testing/share-session-storage-contract.ts +43 -0
- package/src/testing/stored-artifacts.ts +43 -0
- package/src/testing/sync-execution.ts +3 -1
- package/src/testing/webhook-execution.ts +7 -2
- package/src/testing/webhook-run-storage-contract.ts +102 -5
- package/src/users/execution.ts +50 -2
- package/src/users/index.ts +1 -0
- package/src/webhooks/delivery-lease.ts +40 -0
- package/src/webhooks/internal.ts +2 -0
- package/src/webhooks/run-admission.ts +22 -9
- package/src/workers/README.md +169 -0
- package/src/workers/index.ts +9 -1
- package/src/workers/job-ids.ts +31 -0
- package/src/workers/lost-projection-runs.ts +114 -0
- package/src/workers/lost-runs.ts +397 -0
- package/src/workers/queue-delivery.ts +2 -14
- package/src/workers/queue-worker.ts +9 -17
- package/src/workers/queued-run-dispatch.ts +308 -0
- package/src/workers/run-lease.ts +46 -0
- package/src/workers/run-worker.ts +312 -0
- package/src/workers/worker.ts +4 -17
- package/src/workflows/request.ts +2 -0
- package/src/workflows/run-dispatch.ts +22 -4
- package/src/workflows/snapshot.ts +1 -0
- package/dist/chunk-2g0r46hy.js.map +0 -12
- package/dist/chunk-3fqxbn31.js +0 -107
- package/dist/chunk-3fqxbn31.js.map +0 -11
- package/dist/chunk-4s753g3k.js +0 -314
- package/dist/chunk-4s753g3k.js.map +0 -12
- package/dist/chunk-5kyvrtjh.js.map +0 -12
- package/dist/chunk-5taem5aw.js.map +0 -10
- package/dist/chunk-65abf64x.js +0 -13
- package/dist/chunk-65abf64x.js.map +0 -10
- package/dist/chunk-9x8dybsb.js.map +0 -10
- package/dist/chunk-az47zep4.js +0 -41
- package/dist/chunk-az47zep4.js.map +0 -10
- package/dist/chunk-c706qvyc.js +0 -299
- package/dist/chunk-c706qvyc.js.map +0 -11
- package/dist/chunk-djs3hw9p.js.map +0 -20
- package/dist/chunk-dsv783c3.js.map +0 -47
- package/dist/chunk-e5wf5vz0.js.map +0 -10
- package/dist/chunk-e6xgz4h4.js.map +0 -21
- package/dist/chunk-e7v3trpz.js.map +0 -10
- package/dist/chunk-eqgr6nsa.js.map +0 -72
- package/dist/chunk-fb3feg1e.js +0 -298
- package/dist/chunk-fb3feg1e.js.map +0 -12
- package/dist/chunk-hz5d43gn.js.map +0 -10
- package/dist/chunk-j8thxj7w.js.map +0 -22
- package/dist/chunk-jbw70d6t.js.map +0 -10
- package/dist/chunk-jftd33rc.js.map +0 -11
- package/dist/chunk-jspskey0.js.map +0 -10
- package/dist/chunk-kfee1h52.js.map +0 -13
- package/dist/chunk-kwfhd1g0.js +0 -144
- package/dist/chunk-kwfhd1g0.js.map +0 -13
- package/dist/chunk-nz7815t3.js.map +0 -14
- package/dist/chunk-s3we74h8.js.map +0 -12
- package/dist/chunk-scyq22td.js.map +0 -12
- package/dist/chunk-w1btn96n.js.map +0 -44
- package/dist/chunk-w976a4me.js.map +0 -10
- package/dist/chunk-wkq3kvzd.js.map +0 -10
- package/dist/chunk-wrjx1fqz.js +0 -587
- package/dist/chunk-wrjx1fqz.js.map +0 -18
- package/dist/chunk-yw9pyg66.js +0 -143
- package/dist/chunk-yw9pyg66.js.map +0 -11
- package/dist/chunk-z8fx5cgb.js.map +0 -11
- package/dist/scheduler/runtime.d.ts +0 -40
- package/dist/scheduler/runtime.d.ts.map +0 -1
- package/dist/workers/unstarted-run.d.ts +0 -10
- package/dist/workers/unstarted-run.d.ts.map +0 -1
- package/src/scheduler/runtime.ts +0 -214
- package/src/workers/unstarted-run.ts +0 -18
- /package/dist/{chunk-80gym75n.js.map → chunk-186k5yz3.js.map} +0 -0
- /package/dist/{chunk-ga63a3dz.js.map → chunk-2bn6813a.js.map} +0 -0
- /package/dist/{chunk-ytzcxtpt.js.map → chunk-3ba89vm7.js.map} +0 -0
- /package/dist/{chunk-d04g36fw.js.map → chunk-5qqmndhm.js.map} +0 -0
- /package/dist/{chunk-5wtnmpze.js.map → chunk-7qe46788.js.map} +0 -0
- /package/dist/{chunk-31kcqmhf.js.map → chunk-855w9nvw.js.map} +0 -0
- /package/dist/{chunk-9whfmsfk.js.map → chunk-8tqnsx3q.js.map} +0 -0
- /package/dist/{chunk-s038wa5v.js.map → chunk-b9qfh2ya.js.map} +0 -0
- /package/dist/{chunk-jjmggm9a.js.map → chunk-fe6r7yhg.js.map} +0 -0
- /package/dist/{chunk-165c9wm6.js.map → chunk-g2ph4873.js.map} +0 -0
- /package/dist/{chunk-4zm1k3xj.js.map → chunk-r2psmn42.js.map} +0 -0
- /package/dist/{chunk-2ajw5rz0.js.map → chunk-rsxb14an.js.map} +0 -0
- /package/dist/{chunk-r1cxq7vv.js.map → chunk-rtdrm592.js.map} +0 -0
- /package/dist/{chunk-4bm0caep.js.map → chunk-smnt672s.js.map} +0 -0
- /package/dist/{chunk-21q0j5f2.js.map → chunk-stmxh0hv.js.map} +0 -0
- /package/dist/{chunk-ff5xkv0p.js.map → chunk-tfzvjdms.js.map} +0 -0
- /package/dist/{chunk-6b61s40c.js.map → chunk-w3t94hm6.js.map} +0 -0
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test"
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ARTIFACT_COMMENT_LIMITS,
|
|
4
|
+
ARTIFACT_RESTORE_POINTS,
|
|
5
|
+
ARTIFACT_STATE_LIMITS,
|
|
6
|
+
} from "../artifacts/limits"
|
|
3
7
|
import type { Principal } from "../auth"
|
|
4
8
|
import type { FileRef } from "../blob-storage"
|
|
5
9
|
import {
|
|
10
|
+
type ArtifactCommentAuthor,
|
|
6
11
|
type ArtifactFrameGrantRecord,
|
|
7
12
|
type ArtifactStorage,
|
|
8
13
|
ArtifactStorageError,
|
|
9
14
|
type ArtifactStorageErrorCode,
|
|
10
15
|
type ArtifactVersionInput,
|
|
16
|
+
type CreateArtifactCommentInput,
|
|
11
17
|
type CreateArtifactInput,
|
|
18
|
+
type PublishArtifactVersionInput,
|
|
12
19
|
} from "../storage/artifacts"
|
|
13
20
|
import type { Storage } from "../storage/types"
|
|
14
21
|
|
|
@@ -49,7 +56,7 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
describe(label, () => {
|
|
52
|
-
test("creates an artifact with its first version and reads both back", async () => {
|
|
59
|
+
test("creates an artifact with its first version, open, and reads both back", async () => {
|
|
53
60
|
await withStorage(async (artifacts) => {
|
|
54
61
|
const created = await artifacts.create(createInput())
|
|
55
62
|
|
|
@@ -60,6 +67,7 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
60
67
|
title: "Q3 report",
|
|
61
68
|
owner,
|
|
62
69
|
latestVersion: 1,
|
|
70
|
+
revision: 1,
|
|
63
71
|
createdAt: t0,
|
|
64
72
|
updatedAt: t0,
|
|
65
73
|
})
|
|
@@ -67,8 +75,11 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
67
75
|
projectId,
|
|
68
76
|
artifactId: "art_report",
|
|
69
77
|
version: 1,
|
|
78
|
+
revision: 1,
|
|
70
79
|
...versionInput(),
|
|
80
|
+
createdAt: t0,
|
|
71
81
|
})
|
|
82
|
+
expect(created.version).not.toHaveProperty("frozenAt")
|
|
72
83
|
expect(await artifacts.get({ projectId, id: "art_report" })).toEqual(created.artifact)
|
|
73
84
|
expect(
|
|
74
85
|
await artifacts.getVersion({ projectId, artifactId: "art_report", version: 1 })
|
|
@@ -85,23 +96,119 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
85
96
|
})
|
|
86
97
|
})
|
|
87
98
|
|
|
88
|
-
|
|
99
|
+
// Regression proof: append a version on every write in a provider's `publish`; the second
|
|
100
|
+
// write is then version 2.
|
|
101
|
+
test("replaces the open version's content in place, one revision at a time", async () => {
|
|
89
102
|
await withStorage(async (artifacts) => {
|
|
90
103
|
await artifacts.create(createInput())
|
|
91
104
|
const second = await artifacts.publish(
|
|
92
|
-
publishInput({ title: "Q3 report, revised",
|
|
105
|
+
publishInput({ title: "Q3 report, revised", author: otherOwner, updatedAt: at(1) })
|
|
93
106
|
)
|
|
94
|
-
const third = await artifacts.publish(publishInput({
|
|
107
|
+
const third = await artifacts.publish(publishInput({ origin: undefined, updatedAt: at(2) }))
|
|
95
108
|
|
|
96
|
-
expect(second.version
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
109
|
+
expect(second.version).toMatchObject({
|
|
110
|
+
version: 1,
|
|
111
|
+
revision: 2,
|
|
112
|
+
title: "Q3 report, revised",
|
|
113
|
+
author: otherOwner,
|
|
114
|
+
createdAt: t0,
|
|
115
|
+
updatedAt: at(1),
|
|
116
|
+
})
|
|
117
|
+
expect(third.artifact).toMatchObject({
|
|
118
|
+
latestVersion: 1,
|
|
119
|
+
revision: 3,
|
|
120
|
+
title: "Q3 report",
|
|
121
|
+
createdAt: t0,
|
|
122
|
+
updatedAt: at(2),
|
|
123
|
+
})
|
|
124
|
+
// The last write's author and origin are the version's: it had none.
|
|
125
|
+
expect(third.version).toMatchObject({ version: 1, revision: 3, author: owner })
|
|
126
|
+
expect(third.version).not.toHaveProperty("origin")
|
|
127
|
+
expect(
|
|
128
|
+
await artifacts.getVersion({ projectId, artifactId: "art_report", version: 1 })
|
|
129
|
+
).toEqual(third.version)
|
|
130
|
+
expect((await artifacts.listVersions({ projectId, artifactId: "art_report" })).total).toBe(
|
|
131
|
+
1
|
|
132
|
+
)
|
|
101
133
|
})
|
|
102
134
|
})
|
|
103
135
|
|
|
104
|
-
|
|
136
|
+
// Regression proof: write in place whatever the latest version is in a provider's `publish`;
|
|
137
|
+
// the frozen version then changes.
|
|
138
|
+
test("freezes the latest version, and the next write opens the next one", async () => {
|
|
139
|
+
await withStorage(async (artifacts) => {
|
|
140
|
+
await artifacts.create(createInput())
|
|
141
|
+
const frozen = await artifacts.freeze({
|
|
142
|
+
projectId,
|
|
143
|
+
artifactId: "art_report",
|
|
144
|
+
baseRevision: 1,
|
|
145
|
+
frozenAt: at(1),
|
|
146
|
+
frozenBy: otherOwner,
|
|
147
|
+
})
|
|
148
|
+
expect(frozen.artifact).toMatchObject({ latestVersion: 1, revision: 2, updatedAt: at(1) })
|
|
149
|
+
// Who froze it is kept beside who wrote it.
|
|
150
|
+
expect(frozen.version).toMatchObject({
|
|
151
|
+
version: 1,
|
|
152
|
+
revision: 2,
|
|
153
|
+
author: owner,
|
|
154
|
+
frozenAt: at(1),
|
|
155
|
+
frozenBy: otherOwner,
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
// A write made before the freeze is told who created the version since.
|
|
159
|
+
// Reproduce by leaving `frozenBy` out of a provider's `assertBase`.
|
|
160
|
+
const moved = await artifacts
|
|
161
|
+
.publish({ ...publishInput({ updatedAt: at(2) }), baseRevision: 1 })
|
|
162
|
+
.catch((error: unknown) => error)
|
|
163
|
+
expect(moved).toMatchObject({
|
|
164
|
+
code: "artifact_moved",
|
|
165
|
+
latest: { version: 1, revision: 2, author: owner, frozenBy: otherOwner },
|
|
166
|
+
})
|
|
167
|
+
expect((moved as Error).message).toContain("which user 'usr_other' created")
|
|
168
|
+
|
|
169
|
+
// Freezing a frozen version changes nothing, from any base.
|
|
170
|
+
expect(
|
|
171
|
+
await artifacts.freeze({
|
|
172
|
+
projectId,
|
|
173
|
+
artifactId: "art_report",
|
|
174
|
+
baseRevision: 1,
|
|
175
|
+
frozenAt: at(2),
|
|
176
|
+
frozenBy: otherOwner,
|
|
177
|
+
})
|
|
178
|
+
).toEqual(frozen)
|
|
179
|
+
|
|
180
|
+
const opened = await artifacts.publish(publishInput({ title: "Draft", updatedAt: at(3) }))
|
|
181
|
+
expect(opened.version).toMatchObject({
|
|
182
|
+
version: 2,
|
|
183
|
+
revision: 3,
|
|
184
|
+
title: "Draft",
|
|
185
|
+
createdAt: at(3),
|
|
186
|
+
updatedAt: at(3),
|
|
187
|
+
})
|
|
188
|
+
expect(opened.version).not.toHaveProperty("frozenAt")
|
|
189
|
+
expect(opened.version).not.toHaveProperty("frozenBy")
|
|
190
|
+
expect(opened.artifact).toMatchObject({ latestVersion: 2, revision: 3, title: "Draft" })
|
|
191
|
+
|
|
192
|
+
// The next write replaces version 2, and version 1 stays as it was frozen.
|
|
193
|
+
const replaced = await artifacts.publish(publishInput({ title: "Final", updatedAt: at(4) }))
|
|
194
|
+
expect(replaced.version).toMatchObject({ version: 2, revision: 4, title: "Final" })
|
|
195
|
+
expect(
|
|
196
|
+
await artifacts.getVersion({ projectId, artifactId: "art_report", version: 1 })
|
|
197
|
+
).toEqual(frozen.version)
|
|
198
|
+
|
|
199
|
+
await expectArtifactError(
|
|
200
|
+
artifacts.freeze({
|
|
201
|
+
projectId,
|
|
202
|
+
artifactId: "art_missing",
|
|
203
|
+
frozenAt: at(5),
|
|
204
|
+
frozenBy: otherOwner,
|
|
205
|
+
}),
|
|
206
|
+
"artifact_not_found"
|
|
207
|
+
)
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
test("keeps the kind fixed and refuses writes to a missing artifact", async () => {
|
|
105
212
|
await withStorage(async (artifacts) => {
|
|
106
213
|
await artifacts.create(createInput())
|
|
107
214
|
|
|
@@ -117,22 +224,22 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
117
224
|
artifacts.publish({ ...publishInput(), projectId: otherProjectId }),
|
|
118
225
|
"artifact_not_found"
|
|
119
226
|
)
|
|
120
|
-
expect((await artifacts.get({ projectId, id: "art_report" }))?.
|
|
227
|
+
expect((await artifacts.get({ projectId, id: "art_report" }))?.revision).toBe(1)
|
|
121
228
|
})
|
|
122
229
|
})
|
|
123
230
|
|
|
124
|
-
test("
|
|
231
|
+
test("writes from a base revision, and refuses one the artifact has moved past", async () => {
|
|
125
232
|
await withStorage(async (artifacts) => {
|
|
126
233
|
await artifacts.create(createInput())
|
|
127
234
|
const edited = await artifacts.publish({
|
|
128
|
-
...publishInput({ author: otherOwner, origin: undefined,
|
|
129
|
-
|
|
235
|
+
...publishInput({ author: otherOwner, origin: undefined, updatedAt: at(1) }),
|
|
236
|
+
baseRevision: 1,
|
|
130
237
|
})
|
|
131
|
-
expect(edited.
|
|
238
|
+
expect(edited.artifact.revision).toBe(2)
|
|
132
239
|
|
|
133
|
-
// A second save from
|
|
240
|
+
// A second save from revision 1 would replace revision 2's changes unseen.
|
|
134
241
|
const error = await artifacts
|
|
135
|
-
.publish({ ...publishInput({
|
|
242
|
+
.publish({ ...publishInput({ updatedAt: at(2) }), baseRevision: 1 })
|
|
136
243
|
.then(
|
|
137
244
|
() => null,
|
|
138
245
|
(caught: unknown) => caught
|
|
@@ -140,28 +247,40 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
140
247
|
expect(error).toBeInstanceOf(ArtifactStorageError)
|
|
141
248
|
expect(error).toMatchObject({
|
|
142
249
|
code: "artifact_moved",
|
|
143
|
-
latest: { version: 2, author: otherOwner },
|
|
250
|
+
latest: { version: 1, revision: 2, author: otherOwner },
|
|
144
251
|
})
|
|
145
|
-
expect((await artifacts.get({ projectId, id: "art_report" }))?.
|
|
252
|
+
expect((await artifacts.get({ projectId, id: "art_report" }))?.revision).toBe(2)
|
|
253
|
+
|
|
254
|
+
// A freeze moves it too: nobody freezes content they never saw.
|
|
255
|
+
await expectArtifactError(
|
|
256
|
+
artifacts.freeze({
|
|
257
|
+
projectId,
|
|
258
|
+
artifactId: "art_report",
|
|
259
|
+
baseRevision: 1,
|
|
260
|
+
frozenAt: at(2),
|
|
261
|
+
frozenBy: otherOwner,
|
|
262
|
+
}),
|
|
263
|
+
"artifact_moved"
|
|
264
|
+
)
|
|
146
265
|
|
|
147
|
-
// Of two
|
|
266
|
+
// Of two writes racing from one base, one is stored and the other finds it moved. This
|
|
148
267
|
// fixes the outcome only: the in-memory and SQLite storages run each call whole under
|
|
149
268
|
// their own lock, so the race cannot fail there. Postgres proves its row lock in
|
|
150
269
|
// `storage/pg/tests/pg-artifact-storage.e2e.ts`.
|
|
151
270
|
const raced = await Promise.allSettled([
|
|
152
|
-
artifacts.publish({ ...publishInput({
|
|
153
|
-
artifacts.publish({ ...publishInput({
|
|
271
|
+
artifacts.publish({ ...publishInput({ updatedAt: at(3) }), baseRevision: 2 }),
|
|
272
|
+
artifacts.publish({ ...publishInput({ updatedAt: at(4) }), baseRevision: 2 }),
|
|
154
273
|
])
|
|
155
274
|
expect(raced.filter((result) => result.status === "fulfilled")).toHaveLength(1)
|
|
156
275
|
const refused = raced.find((result) => result.status === "rejected")
|
|
157
276
|
expect(refused?.status === "rejected" && refused.reason).toMatchObject({
|
|
158
277
|
code: "artifact_moved",
|
|
159
|
-
latest: {
|
|
278
|
+
latest: { revision: 3 },
|
|
160
279
|
})
|
|
161
|
-
// Without a base, a
|
|
162
|
-
expect(
|
|
163
|
-
|
|
164
|
-
)
|
|
280
|
+
// Without a base, a write is stored over whatever is latest.
|
|
281
|
+
expect(
|
|
282
|
+
(await artifacts.publish(publishInput({ updatedAt: at(5) }))).artifact.revision
|
|
283
|
+
).toBe(4)
|
|
165
284
|
})
|
|
166
285
|
})
|
|
167
286
|
|
|
@@ -190,7 +309,14 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
190
309
|
expect(created.version).not.toHaveProperty("origin")
|
|
191
310
|
expect(
|
|
192
311
|
await artifacts.getVersion({ projectId, artifactId: "art_report", version: 1 })
|
|
193
|
-
).toEqual({
|
|
312
|
+
).toEqual({
|
|
313
|
+
projectId,
|
|
314
|
+
artifactId: "art_report",
|
|
315
|
+
version: 1,
|
|
316
|
+
revision: 1,
|
|
317
|
+
...version,
|
|
318
|
+
createdAt: t0,
|
|
319
|
+
})
|
|
194
320
|
})
|
|
195
321
|
})
|
|
196
322
|
|
|
@@ -233,9 +359,18 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
233
359
|
// A longer id that starts with the same letters is another artifact.
|
|
234
360
|
await create("art_longer", ["artifact:art_numbersx#chart=revenue"])
|
|
235
361
|
await create("art_elsewhere", ["artifact:art_numbers"], otherProjectId)
|
|
236
|
-
// Only the latest version counts: this one dropped its reference.
|
|
362
|
+
// Only the latest version counts: this one dropped its reference, frozen before.
|
|
237
363
|
await create("art_dropped", ["artifact:art_numbers#Summary"])
|
|
238
|
-
await artifacts.
|
|
364
|
+
await artifacts.freeze({
|
|
365
|
+
projectId,
|
|
366
|
+
artifactId: "art_dropped",
|
|
367
|
+
frozenAt: at(1),
|
|
368
|
+
frozenBy: otherOwner,
|
|
369
|
+
})
|
|
370
|
+
await artifacts.publish(publishInput({ updatedAt: at(2) }, "art_dropped"))
|
|
371
|
+
// And this one dropped it from its open version.
|
|
372
|
+
await create("art_rewritten", ["artifact:art_numbers"])
|
|
373
|
+
await artifacts.publish(publishInput({ updatedAt: at(2) }, "art_rewritten"))
|
|
239
374
|
|
|
240
375
|
const referencing = await artifacts.listReferencingVersions({
|
|
241
376
|
projectId,
|
|
@@ -296,19 +431,26 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
296
431
|
await withStorage(async (artifacts) => {
|
|
297
432
|
await artifacts.create(createInput({ id: "art_a" }))
|
|
298
433
|
await artifacts.create(
|
|
299
|
-
createInput({ id: "art_b", version: versionInput({
|
|
434
|
+
createInput({ id: "art_b", version: versionInput({ updatedAt: at(1) }) })
|
|
300
435
|
)
|
|
301
436
|
await artifacts.create(
|
|
302
|
-
createInput({ id: "art_c", version: versionInput({
|
|
437
|
+
createInput({ id: "art_c", version: versionInput({ updatedAt: at(2) }) })
|
|
303
438
|
)
|
|
304
|
-
await artifacts.publish(publishInput({
|
|
439
|
+
await artifacts.publish(publishInput({ updatedAt: at(3) }, "art_a"))
|
|
440
|
+
// A freeze is a change too.
|
|
441
|
+
await artifacts.freeze({
|
|
442
|
+
projectId,
|
|
443
|
+
artifactId: "art_b",
|
|
444
|
+
frozenAt: at(4),
|
|
445
|
+
frozenBy: otherOwner,
|
|
446
|
+
})
|
|
305
447
|
|
|
306
448
|
const all = await artifacts.list({ projectId })
|
|
307
|
-
expect(all.artifacts.map((artifact) => artifact.id)).toEqual(["
|
|
449
|
+
expect(all.artifacts.map((artifact) => artifact.id)).toEqual(["art_b", "art_a", "art_c"])
|
|
308
450
|
expect(all).toMatchObject({ total: 3, hasMore: false })
|
|
309
451
|
|
|
310
452
|
const page = await artifacts.list({ projectId, limit: 2, offset: 1 })
|
|
311
|
-
expect(page.artifacts.map((artifact) => artifact.id)).toEqual(["
|
|
453
|
+
expect(page.artifacts.map((artifact) => artifact.id)).toEqual(["art_a", "art_c"])
|
|
312
454
|
expect(page).toMatchObject({ total: 3, hasMore: false })
|
|
313
455
|
expect((await artifacts.list({ projectId, limit: 1 })).hasMore).toBe(true)
|
|
314
456
|
})
|
|
@@ -322,7 +464,7 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
322
464
|
createInput({
|
|
323
465
|
id: "art_deck_b",
|
|
324
466
|
kind: "slides",
|
|
325
|
-
version: versionInput({
|
|
467
|
+
version: versionInput({ updatedAt: at(1) }),
|
|
326
468
|
})
|
|
327
469
|
)
|
|
328
470
|
const decks = await artifacts.list({ projectId, kind: "slides", limit: 1 })
|
|
@@ -350,7 +492,7 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
350
492
|
)
|
|
351
493
|
await artifacts.publish(
|
|
352
494
|
publishInput(
|
|
353
|
-
{ origin: { threadId: "thr_3", runId: "run_3" },
|
|
495
|
+
{ origin: { threadId: "thr_3", runId: "run_3" }, updatedAt: at(1) },
|
|
354
496
|
"art_api"
|
|
355
497
|
)
|
|
356
498
|
)
|
|
@@ -370,16 +512,16 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
370
512
|
|
|
371
513
|
// Regression proof: drop `sharedIn` from the in-memory publish, or the link insert from a SQL
|
|
372
514
|
// provider's; the revised artifact is then not shared in thr_2.
|
|
373
|
-
test("shares an artifact in each thread a
|
|
515
|
+
test("shares an artifact in each thread a write came from, after the next write too", async () => {
|
|
374
516
|
await withStorage(async (artifacts) => {
|
|
375
517
|
await artifacts.create(createInput({ id: "art_mine" }))
|
|
376
518
|
await artifacts.publish(
|
|
377
519
|
publishInput(
|
|
378
|
-
{ origin: { threadId: "thr_2", runId: "run_2" },
|
|
520
|
+
{ origin: { threadId: "thr_2", runId: "run_2" }, updatedAt: at(1) },
|
|
379
521
|
"art_mine"
|
|
380
522
|
)
|
|
381
523
|
)
|
|
382
|
-
await artifacts.publish(publishInput({ origin: undefined,
|
|
524
|
+
await artifacts.publish(publishInput({ origin: undefined, updatedAt: at(2) }, "art_mine"))
|
|
383
525
|
expect(await artifacts.listThreadIds({ projectId, id: "art_mine" })).toEqual([
|
|
384
526
|
"thr_1",
|
|
385
527
|
"thr_2",
|
|
@@ -399,44 +541,485 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
399
541
|
})
|
|
400
542
|
})
|
|
401
543
|
|
|
402
|
-
// Regression proof:
|
|
403
|
-
//
|
|
404
|
-
test("
|
|
544
|
+
// Regression proof: take a restore point on every write of a turn in a provider's `publish`;
|
|
545
|
+
// the turn then keeps three, the last two of its own content.
|
|
546
|
+
test("keeps a restore point before a turn's first write to an artifact, once per turn", async () => {
|
|
405
547
|
await withStorage(async (artifacts) => {
|
|
406
|
-
await artifacts.create(createInput({
|
|
407
|
-
await artifacts.publish(
|
|
408
|
-
publishInput(
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
548
|
+
await artifacts.create(createInput({ version: versionInput({ origin: undefined }) }))
|
|
549
|
+
await artifacts.publish({
|
|
550
|
+
...publishInput({ title: "First", updatedAt: at(1) }),
|
|
551
|
+
turnRunId: "run_1",
|
|
552
|
+
})
|
|
553
|
+
await artifacts.publish({
|
|
554
|
+
...publishInput({ title: "Second", updatedAt: at(2) }),
|
|
555
|
+
turnRunId: "run_1",
|
|
556
|
+
})
|
|
557
|
+
// A sub-agent of the turn writes as the turn.
|
|
558
|
+
await artifacts.publish({
|
|
559
|
+
...publishInput({
|
|
560
|
+
title: "Third",
|
|
561
|
+
origin: { threadId: "thr_1", runId: "run_child" },
|
|
562
|
+
updatedAt: at(3),
|
|
563
|
+
}),
|
|
564
|
+
turnRunId: "run_1",
|
|
565
|
+
})
|
|
566
|
+
|
|
567
|
+
const points = await artifacts.listRestorePoints({ projectId, id: "art_report" })
|
|
568
|
+
expect(points).toEqual([
|
|
569
|
+
{
|
|
570
|
+
projectId,
|
|
571
|
+
artifactId: "art_report",
|
|
572
|
+
revision: 1,
|
|
573
|
+
version: 1,
|
|
574
|
+
frozen: false,
|
|
575
|
+
...versionInput({ origin: undefined }),
|
|
576
|
+
reason: "turn",
|
|
577
|
+
turnRunId: "run_1",
|
|
578
|
+
createdAt: at(1),
|
|
579
|
+
},
|
|
580
|
+
])
|
|
581
|
+
expect(
|
|
582
|
+
await artifacts.getRestorePoint({ projectId, artifactId: "art_report", revision: 1 })
|
|
583
|
+
).toEqual(points[0] ?? null)
|
|
584
|
+
expect(
|
|
585
|
+
await artifacts.getRestorePoint({ projectId, artifactId: "art_report", revision: 2 })
|
|
586
|
+
).toBeNull()
|
|
587
|
+
|
|
588
|
+
// Writes outside a turn keep none; a created artifact has nothing to go back to.
|
|
589
|
+
await artifacts.publish(publishInput({ updatedAt: at(4) }))
|
|
590
|
+
await artifacts.create({ ...createInput({ id: "art_new" }), turnRunId: "run_2" })
|
|
591
|
+
expect(await artifacts.listRestorePoints({ projectId, id: "art_new" })).toEqual([])
|
|
592
|
+
|
|
593
|
+
// Another turn keeps its own, of the frozen version it opens the next one past.
|
|
594
|
+
await artifacts.freeze({
|
|
595
|
+
projectId,
|
|
596
|
+
artifactId: "art_report",
|
|
597
|
+
frozenAt: at(5),
|
|
598
|
+
frozenBy: otherOwner,
|
|
599
|
+
})
|
|
600
|
+
await artifacts.publish({ ...publishInput({ updatedAt: at(6) }), turnRunId: "run_3" })
|
|
601
|
+
const [newest] = await artifacts.listRestorePoints({ projectId, id: "art_report" })
|
|
602
|
+
expect(newest).toMatchObject({
|
|
603
|
+
revision: 6,
|
|
604
|
+
version: 1,
|
|
605
|
+
frozen: true,
|
|
606
|
+
title: "Q3 report",
|
|
607
|
+
turnRunId: "run_3",
|
|
608
|
+
})
|
|
609
|
+
|
|
610
|
+
expect(await artifacts.listTurnWrites({ projectId, turnRunId: "run_1" })).toEqual([
|
|
611
|
+
{ artifactId: "art_report", created: false, revision: 4, writes: 3 },
|
|
612
|
+
])
|
|
613
|
+
expect(await artifacts.listTurnWrites({ projectId, turnRunId: "run_2" })).toEqual([
|
|
614
|
+
{ artifactId: "art_new", created: true, revision: 1, writes: 1 },
|
|
615
|
+
])
|
|
616
|
+
expect(
|
|
617
|
+
await artifacts.listTurnWrites({ projectId: otherProjectId, turnRunId: "run_1" })
|
|
618
|
+
).toEqual([])
|
|
619
|
+
})
|
|
620
|
+
})
|
|
621
|
+
|
|
622
|
+
// Regression proof: drop the prune after the insert in a provider's restore point; the
|
|
623
|
+
// artifact then keeps one more.
|
|
624
|
+
test(`keeps an artifact's last ${ARTIFACT_RESTORE_POINTS} restore points`, async () => {
|
|
625
|
+
await withStorage(async (artifacts) => {
|
|
626
|
+
await artifacts.create(createInput())
|
|
627
|
+
for (let turn = 1; turn <= ARTIFACT_RESTORE_POINTS + 1; turn++) {
|
|
628
|
+
await artifacts.publish({
|
|
629
|
+
...publishInput({ updatedAt: at(turn) }),
|
|
630
|
+
turnRunId: `run_${turn}`,
|
|
631
|
+
})
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
const points = await artifacts.listRestorePoints({ projectId, id: "art_report" })
|
|
635
|
+
expect(points).toHaveLength(ARTIFACT_RESTORE_POINTS)
|
|
636
|
+
expect(points[0]?.revision).toBe(ARTIFACT_RESTORE_POINTS + 1)
|
|
637
|
+
expect(points.at(-1)?.revision).toBe(2)
|
|
638
|
+
})
|
|
639
|
+
})
|
|
640
|
+
|
|
641
|
+
test("restores a restore point into the latest version, keeping what it replaces", async () => {
|
|
642
|
+
await withStorage(async (artifacts) => {
|
|
643
|
+
await artifacts.create(createInput())
|
|
644
|
+
await artifacts.publish({
|
|
645
|
+
...publishInput({ title: "Agent's", updatedAt: at(1) }),
|
|
646
|
+
turnRunId: "run_1",
|
|
647
|
+
})
|
|
648
|
+
|
|
649
|
+
const restored = await artifacts.restoreTo({
|
|
650
|
+
projectId,
|
|
651
|
+
artifactId: "art_report",
|
|
652
|
+
revision: 1,
|
|
653
|
+
baseRevision: 2,
|
|
654
|
+
author: otherOwner,
|
|
655
|
+
restoredAt: at(2),
|
|
656
|
+
})
|
|
657
|
+
expect(restored.artifact).toMatchObject({
|
|
658
|
+
latestVersion: 1,
|
|
659
|
+
revision: 3,
|
|
660
|
+
title: "Q3 report",
|
|
661
|
+
updatedAt: at(2),
|
|
662
|
+
})
|
|
663
|
+
expect(restored.version).toMatchObject({
|
|
664
|
+
version: 1,
|
|
665
|
+
revision: 3,
|
|
666
|
+
title: "Q3 report",
|
|
667
|
+
author: otherOwner,
|
|
668
|
+
updatedAt: at(2),
|
|
669
|
+
})
|
|
670
|
+
expect(restored.version).not.toHaveProperty("origin")
|
|
671
|
+
|
|
672
|
+
// The restore can be undone: what it replaced is a restore point too.
|
|
673
|
+
const [before] = await artifacts.listRestorePoints({ projectId, id: "art_report" })
|
|
674
|
+
expect(before).toMatchObject({
|
|
675
|
+
revision: 2,
|
|
676
|
+
title: "Agent's",
|
|
677
|
+
reason: "restore",
|
|
678
|
+
createdAt: at(2),
|
|
679
|
+
})
|
|
680
|
+
expect(before).not.toHaveProperty("turnRunId")
|
|
681
|
+
|
|
682
|
+
// A frozen version stays: restoring opens the next one.
|
|
683
|
+
await artifacts.freeze({
|
|
684
|
+
projectId,
|
|
685
|
+
artifactId: "art_report",
|
|
686
|
+
frozenAt: at(3),
|
|
687
|
+
frozenBy: otherOwner,
|
|
688
|
+
})
|
|
689
|
+
const reopened = await artifacts.restoreTo({
|
|
690
|
+
projectId,
|
|
691
|
+
artifactId: "art_report",
|
|
692
|
+
revision: 2,
|
|
693
|
+
author: owner,
|
|
694
|
+
restoredAt: at(4),
|
|
695
|
+
})
|
|
696
|
+
expect(reopened.version).toMatchObject({ version: 2, revision: 5, title: "Agent's" })
|
|
697
|
+
expect(
|
|
698
|
+
(await artifacts.getVersion({ projectId, artifactId: "art_report", version: 1 }))
|
|
699
|
+
?.frozenAt
|
|
700
|
+
).toEqual(at(3))
|
|
701
|
+
|
|
702
|
+
await expectArtifactError(
|
|
703
|
+
artifacts.restoreTo({
|
|
704
|
+
projectId,
|
|
705
|
+
artifactId: "art_report",
|
|
706
|
+
revision: 9,
|
|
707
|
+
author: owner,
|
|
708
|
+
restoredAt: at(5),
|
|
709
|
+
}),
|
|
710
|
+
"restore_point_not_found"
|
|
412
711
|
)
|
|
712
|
+
await expectArtifactError(
|
|
713
|
+
artifacts.restoreTo({
|
|
714
|
+
projectId,
|
|
715
|
+
artifactId: "art_report",
|
|
716
|
+
revision: 1,
|
|
717
|
+
baseRevision: 4,
|
|
718
|
+
author: owner,
|
|
719
|
+
restoredAt: at(5),
|
|
720
|
+
}),
|
|
721
|
+
"artifact_moved"
|
|
722
|
+
)
|
|
723
|
+
await expectArtifactError(
|
|
724
|
+
artifacts.restoreTo({
|
|
725
|
+
projectId,
|
|
726
|
+
artifactId: "art_missing",
|
|
727
|
+
revision: 1,
|
|
728
|
+
author: owner,
|
|
729
|
+
restoredAt: at(5),
|
|
730
|
+
}),
|
|
731
|
+
"artifact_not_found"
|
|
732
|
+
)
|
|
733
|
+
})
|
|
734
|
+
})
|
|
735
|
+
|
|
736
|
+
// Regression proof: skip the revision check in a provider's `undoTurnWrites`; the person's
|
|
737
|
+
// edit to art_edited is then lost.
|
|
738
|
+
test("undoes a retried turn's writes to what nobody changed since", async () => {
|
|
739
|
+
await withStorage(async (artifacts) => {
|
|
740
|
+
const turn = { threadId: "thr_turn", runId: "run_turn" }
|
|
741
|
+
const write = (artifactId: string, overrides: Partial<ArtifactVersionInput> = {}) =>
|
|
742
|
+
artifacts.publish({
|
|
743
|
+
...publishInput(
|
|
744
|
+
{ title: "Turn's", origin: turn, updatedAt: at(1), ...overrides },
|
|
745
|
+
artifactId
|
|
746
|
+
),
|
|
747
|
+
turnRunId: "run_turn",
|
|
748
|
+
})
|
|
749
|
+
|
|
750
|
+
// Replaced in place: back to what it held, by whoever wrote it.
|
|
751
|
+
await artifacts.create(
|
|
752
|
+
createInput({ id: "art_open", version: versionInput({ author: otherOwner }) })
|
|
753
|
+
)
|
|
754
|
+
await write("art_open")
|
|
755
|
+
await write("art_open", { title: "Turn's again", updatedAt: at(2) })
|
|
756
|
+
|
|
757
|
+
// Opened past a frozen version: the version it opened goes.
|
|
758
|
+
await artifacts.create(createInput({ id: "art_frozen" }))
|
|
759
|
+
await artifacts.freeze({
|
|
760
|
+
projectId,
|
|
761
|
+
artifactId: "art_frozen",
|
|
762
|
+
frozenAt: at(1),
|
|
763
|
+
frozenBy: otherOwner,
|
|
764
|
+
})
|
|
765
|
+
await write("art_frozen")
|
|
766
|
+
|
|
767
|
+
// Changed since by someone else: it keeps the change.
|
|
768
|
+
await artifacts.create(createInput({ id: "art_edited" }))
|
|
769
|
+
await write("art_edited")
|
|
413
770
|
await artifacts.publish(
|
|
414
|
-
publishInput(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
771
|
+
publishInput({ title: "Person's", origin: undefined, updatedAt: at(3) }, "art_edited")
|
|
772
|
+
)
|
|
773
|
+
|
|
774
|
+
// Created by the turn: it goes, with its frame grants, unless changed since.
|
|
775
|
+
await artifacts.create({
|
|
776
|
+
...createInput({ id: "art_created", version: versionInput({ origin: turn }) }),
|
|
777
|
+
turnRunId: "run_turn",
|
|
778
|
+
})
|
|
779
|
+
await artifacts.createFrameGrant(frameGrant("a", { artifactId: "art_created" }))
|
|
780
|
+
await artifacts.create({
|
|
781
|
+
...createInput({ id: "art_kept", version: versionInput({ origin: turn }) }),
|
|
782
|
+
turnRunId: "run_turn",
|
|
783
|
+
})
|
|
784
|
+
await artifacts.freeze({
|
|
785
|
+
projectId,
|
|
786
|
+
artifactId: "art_kept",
|
|
787
|
+
frozenAt: at(3),
|
|
788
|
+
frozenBy: otherOwner,
|
|
789
|
+
})
|
|
790
|
+
|
|
791
|
+
expect(
|
|
792
|
+
await artifacts.undoTurnWrites({ projectId: otherProjectId, turnRunId: "run_turn" })
|
|
793
|
+
).toEqual({ restored: [], deleted: [] })
|
|
794
|
+
const undone = await artifacts.undoTurnWrites({ projectId, turnRunId: "run_turn" })
|
|
795
|
+
|
|
796
|
+
expect(undone.deleted).toEqual(["art_created"])
|
|
797
|
+
expect(undone.restored.map(({ artifact }) => artifact.id).sort()).toEqual([
|
|
798
|
+
"art_frozen",
|
|
799
|
+
"art_open",
|
|
800
|
+
])
|
|
801
|
+
|
|
802
|
+
const open = await artifacts.getVersion({ projectId, artifactId: "art_open", version: 1 })
|
|
803
|
+
expect(open).toMatchObject({
|
|
804
|
+
title: "Q3 report",
|
|
805
|
+
author: otherOwner,
|
|
806
|
+
origin: agentRun,
|
|
807
|
+
revision: 4,
|
|
808
|
+
updatedAt: t0,
|
|
809
|
+
createdAt: t0,
|
|
810
|
+
})
|
|
811
|
+
expect(await artifacts.get({ projectId, id: "art_open" })).toMatchObject({
|
|
812
|
+
title: "Q3 report",
|
|
813
|
+
latestVersion: 1,
|
|
814
|
+
revision: 4,
|
|
815
|
+
updatedAt: t0,
|
|
816
|
+
})
|
|
817
|
+
expect(undone.restored.find(({ artifact }) => artifact.id === "art_open")?.version).toEqual(
|
|
818
|
+
open ?? undefined
|
|
418
819
|
)
|
|
820
|
+
|
|
821
|
+
expect(await artifacts.get({ projectId, id: "art_frozen" })).toMatchObject({
|
|
822
|
+
latestVersion: 1,
|
|
823
|
+
revision: 4,
|
|
824
|
+
updatedAt: at(1),
|
|
825
|
+
})
|
|
826
|
+
expect(
|
|
827
|
+
await artifacts.getVersion({ projectId, artifactId: "art_frozen", version: 2 })
|
|
828
|
+
).toBeNull()
|
|
829
|
+
expect(
|
|
830
|
+
await artifacts.getVersion({ projectId, artifactId: "art_frozen", version: 1 })
|
|
831
|
+
).toMatchObject({ revision: 4, frozenAt: at(1) })
|
|
832
|
+
// A version number is never reused: an address that named version 2 never lands on other content.
|
|
833
|
+
expect(
|
|
834
|
+
(await artifacts.publish(publishInput({ updatedAt: at(4) }, "art_frozen"))).version
|
|
835
|
+
.version
|
|
836
|
+
).toBe(3)
|
|
837
|
+
|
|
838
|
+
expect(await artifacts.get({ projectId, id: "art_edited" })).toMatchObject({
|
|
839
|
+
title: "Person's",
|
|
840
|
+
revision: 3,
|
|
841
|
+
})
|
|
842
|
+
expect(await artifacts.get({ projectId, id: "art_created" })).toBeNull()
|
|
843
|
+
expect(await artifacts.findFrameGrant({ projectId, tokenHash: "a".repeat(64) })).toBeNull()
|
|
844
|
+
expect(await artifacts.get({ projectId, id: "art_kept" })).not.toBeNull()
|
|
845
|
+
|
|
846
|
+
// Undone to it, the turn's restore point is gone; one it was not undone to stays.
|
|
847
|
+
expect(await artifacts.listRestorePoints({ projectId, id: "art_open" })).toEqual([])
|
|
848
|
+
expect(
|
|
849
|
+
(await artifacts.listRestorePoints({ projectId, id: "art_edited" })).map(
|
|
850
|
+
(point) => point.turnRunId
|
|
851
|
+
)
|
|
852
|
+
).toEqual(["run_turn"])
|
|
853
|
+
expect(await artifacts.listTurnWrites({ projectId, turnRunId: "run_turn" })).toEqual([])
|
|
854
|
+
// A second retry finds nothing left to undo.
|
|
855
|
+
expect(await artifacts.undoTurnWrites({ projectId, turnRunId: "run_turn" })).toEqual({
|
|
856
|
+
restored: [],
|
|
857
|
+
deleted: [],
|
|
858
|
+
})
|
|
859
|
+
})
|
|
860
|
+
})
|
|
861
|
+
|
|
862
|
+
// Regression proof: compare the artifact's revision with the turn's last write alone, as
|
|
863
|
+
// providers once did; the version created between the turn's writes is rewritten, and the
|
|
864
|
+
// person's save between them is lost with no restore point of it.
|
|
865
|
+
test("keeps what anyone changed between two of a turn's writes", async () => {
|
|
866
|
+
await withStorage(async (artifacts) => {
|
|
867
|
+
const write = (artifactId: string, updatedAt: Date) =>
|
|
868
|
+
artifacts.publish({
|
|
869
|
+
...publishInput(
|
|
870
|
+
{ title: "Turn's", origin: { threadId: "thr_turn", runId: "run_turn" }, updatedAt },
|
|
871
|
+
artifactId
|
|
872
|
+
),
|
|
873
|
+
turnRunId: "run_turn",
|
|
874
|
+
})
|
|
875
|
+
|
|
876
|
+
// Someone created version 1 between the turn's writes: the second opened version 2.
|
|
877
|
+
await artifacts.create(createInput({ id: "art_created_between" }))
|
|
878
|
+
await write("art_created_between", at(1))
|
|
879
|
+
await artifacts.freeze({
|
|
880
|
+
projectId,
|
|
881
|
+
artifactId: "art_created_between",
|
|
882
|
+
frozenAt: at(2),
|
|
883
|
+
frozenBy: otherOwner,
|
|
884
|
+
})
|
|
885
|
+
await write("art_created_between", at(3))
|
|
886
|
+
|
|
887
|
+
// Someone saved between them, and the turn wrote again on top.
|
|
888
|
+
await artifacts.create(createInput({ id: "art_saved_between" }))
|
|
889
|
+
await write("art_saved_between", at(1))
|
|
419
890
|
await artifacts.publish(
|
|
420
891
|
publishInput(
|
|
421
|
-
{
|
|
422
|
-
"
|
|
892
|
+
{ title: "Person's", origin: undefined, updatedAt: at(2) },
|
|
893
|
+
"art_saved_between"
|
|
423
894
|
)
|
|
424
895
|
)
|
|
896
|
+
await write("art_saved_between", at(3))
|
|
897
|
+
|
|
898
|
+
expect(await artifacts.listTurnWrites({ projectId, turnRunId: "run_turn" })).toEqual([
|
|
899
|
+
{ artifactId: "art_created_between", created: false, revision: 4, writes: 2 },
|
|
900
|
+
{ artifactId: "art_saved_between", created: false, revision: 4, writes: 2 },
|
|
901
|
+
])
|
|
902
|
+
expect(await artifacts.undoTurnWrites({ projectId, turnRunId: "run_turn" })).toEqual({
|
|
903
|
+
restored: [],
|
|
904
|
+
deleted: [],
|
|
905
|
+
})
|
|
425
906
|
|
|
426
|
-
//
|
|
427
|
-
|
|
907
|
+
// Version 1 stays as its creator created it, and version 2 stays open.
|
|
908
|
+
expect(
|
|
909
|
+
await artifacts.getVersion({ projectId, artifactId: "art_created_between", version: 1 })
|
|
910
|
+
).toMatchObject({ title: "Turn's", frozenAt: at(2), frozenBy: otherOwner })
|
|
911
|
+
expect(await artifacts.get({ projectId, id: "art_created_between" })).toMatchObject({
|
|
912
|
+
latestVersion: 2,
|
|
913
|
+
revision: 4,
|
|
914
|
+
})
|
|
915
|
+
// The turn's write on top of the save stays, and the turn's restore point with it.
|
|
916
|
+
expect(await artifacts.get({ projectId, id: "art_saved_between" })).toMatchObject({
|
|
917
|
+
title: "Turn's",
|
|
918
|
+
revision: 4,
|
|
919
|
+
})
|
|
920
|
+
expect(
|
|
921
|
+
(await artifacts.listRestorePoints({ projectId, id: "art_saved_between" })).map(
|
|
922
|
+
(point) => point.turnRunId
|
|
923
|
+
)
|
|
924
|
+
).toEqual(["run_turn"])
|
|
925
|
+
})
|
|
926
|
+
})
|
|
927
|
+
|
|
928
|
+
// Regression proofs: keep every link in a provider's `undoTurnWrites`, and thr_5 keeps sharing
|
|
929
|
+
// art_undone with nothing from it left; drop every link the turn made, and art_mine, kept
|
|
930
|
+
// because someone wrote it since, vanishes from thr_2, which made it.
|
|
931
|
+
test("unshares an undone artifact from the threads only a retried turn shared it in", async () => {
|
|
932
|
+
await withStorage(async (artifacts) => {
|
|
933
|
+
await artifacts.create(createInput({ id: "art_mine" }))
|
|
934
|
+
await artifacts.publish({
|
|
935
|
+
...publishInput(
|
|
936
|
+
{ origin: { threadId: "thr_2", runId: "run_2" }, updatedAt: at(1) },
|
|
937
|
+
"art_mine"
|
|
938
|
+
),
|
|
939
|
+
turnRunId: "run_2",
|
|
940
|
+
})
|
|
941
|
+
await artifacts.publish({
|
|
942
|
+
...publishInput(
|
|
943
|
+
{ origin: { threadId: "thr_3", runId: "run_3" }, updatedAt: at(2) },
|
|
944
|
+
"art_mine"
|
|
945
|
+
),
|
|
946
|
+
turnRunId: "run_3",
|
|
947
|
+
})
|
|
948
|
+
await artifacts.publish({
|
|
949
|
+
...publishInput(
|
|
950
|
+
{ origin: { threadId: "thr_3", runId: "run_4" }, updatedAt: at(3) },
|
|
951
|
+
"art_mine"
|
|
952
|
+
),
|
|
953
|
+
turnRunId: "run_4",
|
|
954
|
+
})
|
|
955
|
+
|
|
956
|
+
// Changed since, the artifact keeps the link the retried turn made: it stays in the
|
|
957
|
+
// conversation that made it.
|
|
958
|
+
await artifacts.undoTurnWrites({ projectId, turnRunId: "run_2" })
|
|
428
959
|
expect(await artifacts.listThreadIds({ projectId, id: "art_mine" })).toEqual([
|
|
429
960
|
"thr_1",
|
|
961
|
+
"thr_2",
|
|
430
962
|
"thr_3",
|
|
431
963
|
])
|
|
432
|
-
expect((await artifacts.list({ projectId, threadId: "thr_2" })).total).toBe(0)
|
|
433
964
|
|
|
434
|
-
//
|
|
435
|
-
await artifacts.
|
|
965
|
+
// Undone, it would leave the threads the turn shared it in; this one made no link.
|
|
966
|
+
await artifacts.undoTurnWrites({ projectId, turnRunId: "run_4" })
|
|
436
967
|
expect(await artifacts.listThreadIds({ projectId, id: "art_mine" })).toEqual([
|
|
437
968
|
"thr_1",
|
|
969
|
+
"thr_2",
|
|
438
970
|
"thr_3",
|
|
439
971
|
])
|
|
972
|
+
|
|
973
|
+
// Undone, an artifact the turn alone shared in thr_5 leaves it.
|
|
974
|
+
await artifacts.create(
|
|
975
|
+
createInput({ id: "art_undone", version: versionInput({ origin: undefined }) })
|
|
976
|
+
)
|
|
977
|
+
await artifacts.publish({
|
|
978
|
+
...publishInput(
|
|
979
|
+
{ origin: { threadId: "thr_5", runId: "run_5" }, updatedAt: at(4) },
|
|
980
|
+
"art_undone"
|
|
981
|
+
),
|
|
982
|
+
turnRunId: "run_5",
|
|
983
|
+
})
|
|
984
|
+
expect(await artifacts.listThreadIds({ projectId, id: "art_undone" })).toEqual(["thr_5"])
|
|
985
|
+
await artifacts.undoTurnWrites({ projectId, turnRunId: "run_5" })
|
|
986
|
+
expect(await artifacts.listThreadIds({ projectId, id: "art_undone" })).toEqual([])
|
|
987
|
+
expect((await artifacts.list({ projectId, threadId: "thr_5" })).total).toBe(0)
|
|
988
|
+
})
|
|
989
|
+
})
|
|
990
|
+
|
|
991
|
+
test("gives a copied version the outline the copy asks for, and the source keeps its own", async () => {
|
|
992
|
+
await withStorage(async (artifacts) => {
|
|
993
|
+
await artifacts.create(createInput())
|
|
994
|
+
await artifacts.freeze({
|
|
995
|
+
projectId,
|
|
996
|
+
artifactId: "art_report",
|
|
997
|
+
frozenAt: at(1),
|
|
998
|
+
frozenBy: otherOwner,
|
|
999
|
+
})
|
|
1000
|
+
await artifacts.publish(publishInput({ title: "Second", updatedAt: at(2) }))
|
|
1001
|
+
const renamed = { kind: "document" as const, headings: [] }
|
|
1002
|
+
const seen: string[] = []
|
|
1003
|
+
|
|
1004
|
+
await artifacts.copy({
|
|
1005
|
+
projectId,
|
|
1006
|
+
sourceId: "art_report",
|
|
1007
|
+
id: "art_copy",
|
|
1008
|
+
owner: otherOwner,
|
|
1009
|
+
threadId: "thr_fork",
|
|
1010
|
+
// Asked of each version as the copy holds it: under the copy's id.
|
|
1011
|
+
outlineOf: (version) => {
|
|
1012
|
+
seen.push(`${version.artifactId}@${version.version}`)
|
|
1013
|
+
return version.version === 2 ? renamed : undefined
|
|
1014
|
+
},
|
|
1015
|
+
})
|
|
1016
|
+
|
|
1017
|
+
expect(seen.sort()).toEqual(["art_copy@1", "art_copy@2"])
|
|
1018
|
+
const outline = async (artifactId: string, version: number) =>
|
|
1019
|
+
(await artifacts.getVersion({ projectId, artifactId, version }))?.outline
|
|
1020
|
+
expect(await outline("art_copy", 2)).toEqual(renamed)
|
|
1021
|
+
expect(await outline("art_copy", 1)).toEqual(versionInput().outline)
|
|
1022
|
+
expect(await outline("art_report", 2)).toEqual(versionInput().outline)
|
|
440
1023
|
})
|
|
441
1024
|
})
|
|
442
1025
|
|
|
@@ -445,27 +1028,43 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
445
1028
|
test("copies an artifact with every version under its number, shared in one thread", async () => {
|
|
446
1029
|
await withStorage(async (artifacts) => {
|
|
447
1030
|
await artifacts.create(createInput())
|
|
1031
|
+
await artifacts.freeze({
|
|
1032
|
+
projectId,
|
|
1033
|
+
artifactId: "art_report",
|
|
1034
|
+
frozenAt: at(1),
|
|
1035
|
+
frozenBy: otherOwner,
|
|
1036
|
+
})
|
|
448
1037
|
await artifacts.publish(
|
|
449
|
-
publishInput({ title: "Second", author: otherOwner,
|
|
1038
|
+
publishInput({ title: "Second", author: otherOwner, updatedAt: at(2) })
|
|
450
1039
|
)
|
|
451
|
-
await artifacts.
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
1040
|
+
await artifacts.freeze({
|
|
1041
|
+
projectId,
|
|
1042
|
+
artifactId: "art_report",
|
|
1043
|
+
frozenAt: at(3),
|
|
1044
|
+
frozenBy: otherOwner,
|
|
1045
|
+
})
|
|
1046
|
+
// Version 3 was a retried turn's: the copy numbers its next version 4, as the source does.
|
|
1047
|
+
await artifacts.publish({
|
|
1048
|
+
...publishInput({
|
|
455
1049
|
title: "Retried",
|
|
456
1050
|
origin: { threadId: "thr_1", runId: "run_9" },
|
|
457
|
-
|
|
458
|
-
})
|
|
1051
|
+
updatedAt: at(4),
|
|
1052
|
+
}),
|
|
1053
|
+
turnRunId: "run_9",
|
|
1054
|
+
})
|
|
1055
|
+
await artifacts.undoTurnWrites({ projectId, turnRunId: "run_9" })
|
|
1056
|
+
await artifacts.publish(
|
|
1057
|
+
publishInput({ title: "Third", origin: undefined, updatedAt: at(5) })
|
|
459
1058
|
)
|
|
460
|
-
await artifacts.deleteVersionsByOrigin({ projectId, runId: "run_9" })
|
|
461
1059
|
|
|
1060
|
+
const source = await artifacts.get({ projectId, id: "art_report" })
|
|
462
1061
|
const copy = await artifacts.copy({
|
|
463
1062
|
projectId,
|
|
464
1063
|
sourceId: "art_report",
|
|
465
1064
|
id: "art_copy",
|
|
466
1065
|
owner: otherOwner,
|
|
467
1066
|
threadId: "thr_fork",
|
|
468
|
-
copiedAt: at(
|
|
1067
|
+
copiedAt: at(6),
|
|
469
1068
|
})
|
|
470
1069
|
expect(copy).toEqual({
|
|
471
1070
|
projectId,
|
|
@@ -473,35 +1072,53 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
473
1072
|
kind: "document",
|
|
474
1073
|
title: "Third",
|
|
475
1074
|
owner: otherOwner,
|
|
476
|
-
latestVersion:
|
|
1075
|
+
latestVersion: 4,
|
|
1076
|
+
revision: source?.revision ?? 0,
|
|
477
1077
|
createdAt: t0,
|
|
478
|
-
updatedAt: at(
|
|
1078
|
+
updatedAt: at(5),
|
|
479
1079
|
})
|
|
480
1080
|
|
|
481
1081
|
const { versions } = await artifacts.listVersions({ projectId, artifactId: "art_copy" })
|
|
482
|
-
expect(
|
|
483
|
-
{ version
|
|
484
|
-
|
|
485
|
-
|
|
1082
|
+
expect(
|
|
1083
|
+
versions.map(({ version, title, author, frozenAt }) => ({
|
|
1084
|
+
version,
|
|
1085
|
+
title,
|
|
1086
|
+
author,
|
|
1087
|
+
frozenAt,
|
|
1088
|
+
}))
|
|
1089
|
+
).toEqual([
|
|
1090
|
+
{ version: 4, title: "Third", author: owner, frozenAt: undefined },
|
|
1091
|
+
{ version: 2, title: "Second", author: otherOwner, frozenAt: at(3) },
|
|
1092
|
+
{ version: 1, title: "Q3 report", author: owner, frozenAt: at(1) },
|
|
486
1093
|
])
|
|
487
1094
|
// Without an origin, a retry of the source's turns never takes the copy's versions.
|
|
488
1095
|
expect(versions.every((version) => version.origin === undefined)).toBe(true)
|
|
489
|
-
const
|
|
1096
|
+
const latest = await artifacts.getVersion({
|
|
490
1097
|
projectId,
|
|
491
1098
|
artifactId: "art_report",
|
|
492
|
-
version:
|
|
1099
|
+
version: 4,
|
|
493
1100
|
})
|
|
494
|
-
expect(versions[0]?.files).toEqual(
|
|
1101
|
+
expect(versions[0]?.files).toEqual(latest?.files ?? [])
|
|
1102
|
+
expect(versions[0]?.revision).toBe(latest?.revision ?? 0)
|
|
1103
|
+
// Restore points stay with the source.
|
|
1104
|
+
expect(await artifacts.listRestorePoints({ projectId, id: "art_copy" })).toEqual([])
|
|
495
1105
|
|
|
496
1106
|
expect(await artifacts.listThreadIds({ projectId, id: "art_copy" })).toEqual(["thr_fork"])
|
|
497
1107
|
expect(await artifacts.listThreadIds({ projectId, id: "art_report" })).toEqual(["thr_1"])
|
|
498
1108
|
|
|
499
1109
|
// A turn in the fork revises the copy, and a retry of it keeps the copy shared there.
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
1110
|
+
await artifacts.freeze({
|
|
1111
|
+
projectId,
|
|
1112
|
+
artifactId: "art_copy",
|
|
1113
|
+
frozenAt: at(7),
|
|
1114
|
+
frozenBy: otherOwner,
|
|
1115
|
+
})
|
|
1116
|
+
const revised = await artifacts.publish({
|
|
1117
|
+
...publishInput({ origin: { threadId: "thr_fork", runId: "run_fork" } }, "art_copy"),
|
|
1118
|
+
turnRunId: "run_fork",
|
|
1119
|
+
})
|
|
503
1120
|
expect(revised.version.version).toBe(5)
|
|
504
|
-
await artifacts.
|
|
1121
|
+
await artifacts.undoTurnWrites({ projectId, turnRunId: "run_fork" })
|
|
505
1122
|
expect(await artifacts.listThreadIds({ projectId, id: "art_copy" })).toEqual(["thr_fork"])
|
|
506
1123
|
|
|
507
1124
|
await expectArtifactError(
|
|
@@ -528,11 +1145,389 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
528
1145
|
})
|
|
529
1146
|
})
|
|
530
1147
|
|
|
1148
|
+
// Regression proof: in a provider's write of the latest content, store the document without
|
|
1149
|
+
// its revision, or move the revision without one; a document left behind then reads as the
|
|
1150
|
+
// content's, and its readers miss what the write changed.
|
|
1151
|
+
test("keeps the document each content write stores at its revision, and leaves one behind without", async () => {
|
|
1152
|
+
await withStorage(async (artifacts) => {
|
|
1153
|
+
const first = fileRef("1", "application/octet-stream")
|
|
1154
|
+
const second = fileRef("2", "application/octet-stream")
|
|
1155
|
+
const restored = fileRef("3", "application/octet-stream")
|
|
1156
|
+
const undone = fileRef("4", "application/octet-stream")
|
|
1157
|
+
const get = async (id = "art_report") => artifacts.get({ projectId, id })
|
|
1158
|
+
|
|
1159
|
+
const created = await artifacts.create({ ...createInput(), document: first })
|
|
1160
|
+
expect(created.artifact.document).toEqual({ file: first, revision: 1 })
|
|
1161
|
+
expect((await get())?.document).toEqual({ file: first, revision: 1 })
|
|
1162
|
+
|
|
1163
|
+
// A freeze keeps the content, and the document holds it still; the next write opens a
|
|
1164
|
+
// version and replaces the document.
|
|
1165
|
+
const frozen = await artifacts.freeze({
|
|
1166
|
+
projectId,
|
|
1167
|
+
artifactId: "art_report",
|
|
1168
|
+
frozenAt: at(1),
|
|
1169
|
+
frozenBy: owner,
|
|
1170
|
+
})
|
|
1171
|
+
expect(frozen.artifact.document).toEqual({ file: first, revision: 2 })
|
|
1172
|
+
const published = await artifacts.publish({
|
|
1173
|
+
...publishInput({ updatedAt: at(2) }),
|
|
1174
|
+
turnRunId: "run_turn",
|
|
1175
|
+
document: second,
|
|
1176
|
+
})
|
|
1177
|
+
expect(published.artifact).toMatchObject({
|
|
1178
|
+
latestVersion: 2,
|
|
1179
|
+
revision: 3,
|
|
1180
|
+
document: { file: second, revision: 3 },
|
|
1181
|
+
})
|
|
1182
|
+
|
|
1183
|
+
// A copy shares the document. A write without one leaves it behind, at the revision whose
|
|
1184
|
+
// content it holds, and a freeze does not bring it forward.
|
|
1185
|
+
await artifacts.copy({
|
|
1186
|
+
projectId,
|
|
1187
|
+
sourceId: "art_report",
|
|
1188
|
+
id: "art_copy",
|
|
1189
|
+
owner,
|
|
1190
|
+
threadId: "thr_fork",
|
|
1191
|
+
})
|
|
1192
|
+
expect((await get("art_copy"))?.document).toEqual({ file: second, revision: 3 })
|
|
1193
|
+
await artifacts.publish(publishInput({ updatedAt: at(3) }, "art_copy"))
|
|
1194
|
+
await artifacts.freeze({
|
|
1195
|
+
projectId,
|
|
1196
|
+
artifactId: "art_copy",
|
|
1197
|
+
frozenAt: at(4),
|
|
1198
|
+
frozenBy: owner,
|
|
1199
|
+
})
|
|
1200
|
+
expect(await get("art_copy")).toMatchObject({
|
|
1201
|
+
revision: 5,
|
|
1202
|
+
document: { file: second, revision: 3 },
|
|
1203
|
+
})
|
|
1204
|
+
|
|
1205
|
+
// A restore and an undo store the document given for what they put back, or leave it.
|
|
1206
|
+
const [point] = await artifacts.listRestorePoints({ projectId, id: "art_report" })
|
|
1207
|
+
const back = await artifacts.restoreTo({
|
|
1208
|
+
projectId,
|
|
1209
|
+
artifactId: "art_report",
|
|
1210
|
+
revision: point?.revision ?? 0,
|
|
1211
|
+
author: owner,
|
|
1212
|
+
restoredAt: at(4),
|
|
1213
|
+
document: restored,
|
|
1214
|
+
})
|
|
1215
|
+
expect(back.artifact.document).toEqual({ file: restored, revision: back.artifact.revision })
|
|
1216
|
+
const again = await artifacts.restoreTo({
|
|
1217
|
+
projectId,
|
|
1218
|
+
artifactId: "art_report",
|
|
1219
|
+
revision: back.artifact.revision - 1,
|
|
1220
|
+
author: owner,
|
|
1221
|
+
restoredAt: at(5),
|
|
1222
|
+
})
|
|
1223
|
+
expect(again.artifact.document).toEqual({
|
|
1224
|
+
file: restored,
|
|
1225
|
+
revision: back.artifact.revision,
|
|
1226
|
+
})
|
|
1227
|
+
|
|
1228
|
+
await artifacts.create(createInput({ id: "art_turn" }))
|
|
1229
|
+
await artifacts.publish({
|
|
1230
|
+
...publishInput({ updatedAt: at(6) }, "art_turn"),
|
|
1231
|
+
turnRunId: "run_undo",
|
|
1232
|
+
document: second,
|
|
1233
|
+
})
|
|
1234
|
+
const result = await artifacts.undoTurnWrites({
|
|
1235
|
+
projectId,
|
|
1236
|
+
turnRunId: "run_undo",
|
|
1237
|
+
documents: { art_turn: undone },
|
|
1238
|
+
})
|
|
1239
|
+
expect(result.restored.map(({ artifact }) => artifact.document)).toEqual([
|
|
1240
|
+
{ file: undone, revision: 3 },
|
|
1241
|
+
])
|
|
1242
|
+
expect((await get("art_turn"))?.document).toEqual({ file: undone, revision: 3 })
|
|
1243
|
+
})
|
|
1244
|
+
})
|
|
1245
|
+
|
|
1246
|
+
// Regression proof: drop the `othersCommented` check from a provider's `undoTurnWrites`; the
|
|
1247
|
+
// retry deletes art_reviewed, and the other person's comment goes with it.
|
|
1248
|
+
test("keeps an artifact a retried turn created once anyone but its requester commented on it", async () => {
|
|
1249
|
+
await withStorage(async (artifacts) => {
|
|
1250
|
+
const turn = { threadId: "thr_turn", runId: "run_turn" }
|
|
1251
|
+
const created = (id: string) =>
|
|
1252
|
+
artifacts.create({
|
|
1253
|
+
...createInput({ id, version: versionInput({ origin: turn }) }),
|
|
1254
|
+
turnRunId: "run_turn",
|
|
1255
|
+
})
|
|
1256
|
+
const comment = (
|
|
1257
|
+
artifactId: string,
|
|
1258
|
+
id: string,
|
|
1259
|
+
author: Principal,
|
|
1260
|
+
origin?: { readonly threadId: string; readonly runId: string }
|
|
1261
|
+
) =>
|
|
1262
|
+
artifacts.createComment({
|
|
1263
|
+
projectId,
|
|
1264
|
+
artifactId,
|
|
1265
|
+
id,
|
|
1266
|
+
anchor: { revision: 1 },
|
|
1267
|
+
body: `Comment ${id}`,
|
|
1268
|
+
author,
|
|
1269
|
+
...(origin ? { origin } : {}),
|
|
1270
|
+
createdAt: at(2),
|
|
1271
|
+
})
|
|
1272
|
+
|
|
1273
|
+
// Commented by the requester, and by the turn for them: it goes all the same.
|
|
1274
|
+
await created("art_mine")
|
|
1275
|
+
await comment("art_mine", "cmt_own", owner)
|
|
1276
|
+
await comment("art_mine", "cmt_turn", owner, turn)
|
|
1277
|
+
|
|
1278
|
+
// Commented by someone else: kept, with their comment.
|
|
1279
|
+
await created("art_reviewed")
|
|
1280
|
+
await comment("art_reviewed", "cmt_other", otherOwner)
|
|
1281
|
+
|
|
1282
|
+
const undone = await artifacts.undoTurnWrites({
|
|
1283
|
+
projectId,
|
|
1284
|
+
turnRunId: "run_turn",
|
|
1285
|
+
requester: owner,
|
|
1286
|
+
})
|
|
1287
|
+
|
|
1288
|
+
expect(undone).toEqual({ restored: [], deleted: ["art_mine"] })
|
|
1289
|
+
expect(await artifacts.get({ projectId, id: "art_mine" })).toBeNull()
|
|
1290
|
+
expect(
|
|
1291
|
+
(await artifacts.listComments({ projectId, id: "art_reviewed" })).map(({ id }) => id)
|
|
1292
|
+
).toEqual(["cmt_other"])
|
|
1293
|
+
})
|
|
1294
|
+
})
|
|
1295
|
+
|
|
1296
|
+
test("keeps comments and their replies, oldest first, and resolves and deletes them", async () => {
|
|
1297
|
+
await withStorage(async (artifacts) => {
|
|
1298
|
+
await artifacts.create(createInput())
|
|
1299
|
+
const comment = (id: string, overrides: Partial<CreateArtifactCommentInput> = {}) =>
|
|
1300
|
+
artifacts.createComment({
|
|
1301
|
+
projectId,
|
|
1302
|
+
artifactId: "art_report",
|
|
1303
|
+
id,
|
|
1304
|
+
anchor: {
|
|
1305
|
+
board: "welcome",
|
|
1306
|
+
element: "body>main:0>h1:0",
|
|
1307
|
+
label: "Welcome",
|
|
1308
|
+
point: { x: 0.25, y: 0.5 },
|
|
1309
|
+
revision: 1,
|
|
1310
|
+
},
|
|
1311
|
+
body: `Comment ${id}`,
|
|
1312
|
+
author: otherOwner,
|
|
1313
|
+
createdAt: at(1),
|
|
1314
|
+
...overrides,
|
|
1315
|
+
})
|
|
1316
|
+
|
|
1317
|
+
const first = await comment("cmt_b")
|
|
1318
|
+
expect(first).toEqual({
|
|
1319
|
+
projectId,
|
|
1320
|
+
artifactId: "art_report",
|
|
1321
|
+
id: "cmt_b",
|
|
1322
|
+
anchor: {
|
|
1323
|
+
board: "welcome",
|
|
1324
|
+
element: "body>main:0>h1:0",
|
|
1325
|
+
label: "Welcome",
|
|
1326
|
+
point: { x: 0.25, y: 0.5 },
|
|
1327
|
+
revision: 1,
|
|
1328
|
+
},
|
|
1329
|
+
body: "Comment cmt_b",
|
|
1330
|
+
author: otherOwner,
|
|
1331
|
+
createdAt: at(1),
|
|
1332
|
+
})
|
|
1333
|
+
// At the same time: as they were made. A reply takes its own anchor.
|
|
1334
|
+
await comment("cmt_a", { anchor: { revision: 2 } })
|
|
1335
|
+
await comment("cmt_reply", {
|
|
1336
|
+
parentId: "cmt_b",
|
|
1337
|
+
author: owner,
|
|
1338
|
+
origin: { threadId: "thr_1", runId: "run_1" },
|
|
1339
|
+
createdAt: at(2),
|
|
1340
|
+
})
|
|
1341
|
+
expect(
|
|
1342
|
+
(await artifacts.listComments({ projectId, id: "art_report" })).map((each) => [
|
|
1343
|
+
each.id,
|
|
1344
|
+
each.parentId,
|
|
1345
|
+
each.anchor,
|
|
1346
|
+
])
|
|
1347
|
+
).toEqual([
|
|
1348
|
+
["cmt_b", undefined, first.anchor],
|
|
1349
|
+
["cmt_a", undefined, { revision: 2 }],
|
|
1350
|
+
["cmt_reply", "cmt_b", first.anchor],
|
|
1351
|
+
])
|
|
1352
|
+
// The Agent's run that wrote a comment for its author is kept with it.
|
|
1353
|
+
expect(
|
|
1354
|
+
(await artifacts.getComment({ projectId, artifactId: "art_report", id: "cmt_reply" }))
|
|
1355
|
+
?.origin
|
|
1356
|
+
).toEqual({ threadId: "thr_1", runId: "run_1" })
|
|
1357
|
+
expect(first).not.toHaveProperty("origin")
|
|
1358
|
+
|
|
1359
|
+
// Resolved, then opened again.
|
|
1360
|
+
const resolved = await artifacts.resolveComment({
|
|
1361
|
+
projectId,
|
|
1362
|
+
artifactId: "art_report",
|
|
1363
|
+
id: "cmt_b",
|
|
1364
|
+
resolved: { at: at(3), by: owner },
|
|
1365
|
+
})
|
|
1366
|
+
expect(resolved).toMatchObject({ id: "cmt_b", resolvedAt: at(3), resolvedBy: owner })
|
|
1367
|
+
expect(
|
|
1368
|
+
await artifacts.getComment({ projectId, artifactId: "art_report", id: "cmt_b" })
|
|
1369
|
+
).toEqual(resolved)
|
|
1370
|
+
const reopened = await artifacts.resolveComment({
|
|
1371
|
+
projectId,
|
|
1372
|
+
artifactId: "art_report",
|
|
1373
|
+
id: "cmt_b",
|
|
1374
|
+
resolved: null,
|
|
1375
|
+
})
|
|
1376
|
+
expect(reopened).toEqual(first)
|
|
1377
|
+
expect(
|
|
1378
|
+
await artifacts.resolveComment({
|
|
1379
|
+
projectId,
|
|
1380
|
+
artifactId: "art_report",
|
|
1381
|
+
id: "cmt_missing",
|
|
1382
|
+
resolved: null,
|
|
1383
|
+
})
|
|
1384
|
+
).toBeNull()
|
|
1385
|
+
|
|
1386
|
+
// Deleted with its replies.
|
|
1387
|
+
expect(
|
|
1388
|
+
await artifacts.deleteComment({ projectId, artifactId: "art_report", id: "cmt_b" })
|
|
1389
|
+
).toBe(true)
|
|
1390
|
+
expect(
|
|
1391
|
+
await artifacts.deleteComment({ projectId, artifactId: "art_report", id: "cmt_b" })
|
|
1392
|
+
).toBe(false)
|
|
1393
|
+
expect(
|
|
1394
|
+
(await artifacts.listComments({ projectId, id: "art_report" })).map(({ id }) => id)
|
|
1395
|
+
).toEqual(["cmt_a"])
|
|
1396
|
+
})
|
|
1397
|
+
})
|
|
1398
|
+
|
|
1399
|
+
// Regression proof: let a provider take a reply to a reply; the thread then nests, which the
|
|
1400
|
+
// panel cannot show.
|
|
1401
|
+
test("refuses a reply to no comment or to a reply, and a comment past the limit", async () => {
|
|
1402
|
+
await withStorage(async (artifacts) => {
|
|
1403
|
+
await artifacts.create(createInput())
|
|
1404
|
+
const comment = (id: string, parentId?: string) =>
|
|
1405
|
+
artifacts.createComment({
|
|
1406
|
+
projectId,
|
|
1407
|
+
artifactId: "art_report",
|
|
1408
|
+
id,
|
|
1409
|
+
...(parentId ? { parentId } : {}),
|
|
1410
|
+
anchor: { revision: 1 },
|
|
1411
|
+
body: "Hm",
|
|
1412
|
+
author: owner,
|
|
1413
|
+
createdAt: at(1),
|
|
1414
|
+
})
|
|
1415
|
+
const code = (promise: Promise<unknown>) =>
|
|
1416
|
+
promise.then(
|
|
1417
|
+
() => null,
|
|
1418
|
+
(error: unknown) => (error instanceof ArtifactStorageError ? error.code : error)
|
|
1419
|
+
)
|
|
1420
|
+
|
|
1421
|
+
expect(
|
|
1422
|
+
await code(
|
|
1423
|
+
artifacts.createComment({
|
|
1424
|
+
projectId,
|
|
1425
|
+
artifactId: "art_missing",
|
|
1426
|
+
id: "cmt_x",
|
|
1427
|
+
anchor: { revision: 1 },
|
|
1428
|
+
body: "Hm",
|
|
1429
|
+
author: owner,
|
|
1430
|
+
createdAt: at(1),
|
|
1431
|
+
})
|
|
1432
|
+
)
|
|
1433
|
+
).toBe("artifact_not_found")
|
|
1434
|
+
await comment("cmt_0")
|
|
1435
|
+
await comment("cmt_reply", "cmt_0")
|
|
1436
|
+
expect(await code(comment("cmt_y", "cmt_missing"))).toBe("comment_not_found")
|
|
1437
|
+
expect(await code(comment("cmt_z", "cmt_reply"))).toBe("comment_not_found")
|
|
1438
|
+
|
|
1439
|
+
for (let index = 2; index < ARTIFACT_COMMENT_LIMITS.maxComments; index += 1) {
|
|
1440
|
+
await comment(`cmt_${index}`)
|
|
1441
|
+
}
|
|
1442
|
+
expect(await code(comment("cmt_over"))).toBe("artifact_comments_full")
|
|
1443
|
+
})
|
|
1444
|
+
})
|
|
1445
|
+
|
|
1446
|
+
// Regression proof: drop the guests' count from a provider's createComment; the guest past
|
|
1447
|
+
// the cap is then stored.
|
|
1448
|
+
test("keeps a guest's comment under the name they gave, up to what guests may write", async () => {
|
|
1449
|
+
await withStorage(async (artifacts) => {
|
|
1450
|
+
await artifacts.create(createInput())
|
|
1451
|
+
const guest = { type: "guest" as const, id: "shs_visitor", name: "Ava Martin" }
|
|
1452
|
+
const comment = (id: string, author: ArtifactCommentAuthor) =>
|
|
1453
|
+
artifacts.createComment({
|
|
1454
|
+
projectId,
|
|
1455
|
+
artifactId: "art_report",
|
|
1456
|
+
id,
|
|
1457
|
+
anchor: { revision: 1 },
|
|
1458
|
+
body: "Hm",
|
|
1459
|
+
author,
|
|
1460
|
+
createdAt: at(1),
|
|
1461
|
+
})
|
|
1462
|
+
|
|
1463
|
+
expect((await comment("cmt_guest_0", guest)).author).toEqual(guest)
|
|
1464
|
+
expect(
|
|
1465
|
+
await artifacts.getComment({ projectId, artifactId: "art_report", id: "cmt_guest_0" })
|
|
1466
|
+
).toMatchObject({ author: guest })
|
|
1467
|
+
|
|
1468
|
+
for (let index = 1; index < ARTIFACT_COMMENT_LIMITS.maxGuestComments; index += 1) {
|
|
1469
|
+
await comment(`cmt_guest_${index}`, { ...guest, id: `shs_visitor_${index % 3}` })
|
|
1470
|
+
}
|
|
1471
|
+
const refused = await comment("cmt_guest_over", guest).then(
|
|
1472
|
+
() => null,
|
|
1473
|
+
(error: unknown) => (error instanceof ArtifactStorageError ? error.code : error)
|
|
1474
|
+
)
|
|
1475
|
+
expect(refused).toBe("artifact_comments_full")
|
|
1476
|
+
|
|
1477
|
+
// Members keep their room.
|
|
1478
|
+
expect((await comment("cmt_member", owner)).author).toEqual(owner)
|
|
1479
|
+
expect(await artifacts.listComments({ projectId, id: "art_report" })).toHaveLength(
|
|
1480
|
+
ARTIFACT_COMMENT_LIMITS.maxGuestComments + 1
|
|
1481
|
+
)
|
|
1482
|
+
})
|
|
1483
|
+
})
|
|
1484
|
+
|
|
1485
|
+
test("deletes an artifact's comments with it, and copies none", async () => {
|
|
1486
|
+
await withStorage(async (artifacts) => {
|
|
1487
|
+
await artifacts.create(createInput())
|
|
1488
|
+
await artifacts.createComment({
|
|
1489
|
+
projectId,
|
|
1490
|
+
artifactId: "art_report",
|
|
1491
|
+
id: "cmt_1",
|
|
1492
|
+
anchor: { revision: 1 },
|
|
1493
|
+
body: "Hm",
|
|
1494
|
+
author: owner,
|
|
1495
|
+
createdAt: at(1),
|
|
1496
|
+
})
|
|
1497
|
+
await artifacts.copy({
|
|
1498
|
+
projectId,
|
|
1499
|
+
sourceId: "art_report",
|
|
1500
|
+
id: "art_copy",
|
|
1501
|
+
owner,
|
|
1502
|
+
threadId: "thr_fork",
|
|
1503
|
+
})
|
|
1504
|
+
expect(await artifacts.listComments({ projectId, id: "art_copy" })).toEqual([])
|
|
1505
|
+
|
|
1506
|
+
await artifacts.delete({ projectId, id: "art_report" })
|
|
1507
|
+
expect(await artifacts.listComments({ projectId, id: "art_report" })).toEqual([])
|
|
1508
|
+
expect(
|
|
1509
|
+
await artifacts.getComment({ projectId, artifactId: "art_report", id: "cmt_1" })
|
|
1510
|
+
).toBeNull()
|
|
1511
|
+
})
|
|
1512
|
+
})
|
|
1513
|
+
|
|
531
1514
|
test("lists versions newest first, a page at a time", async () => {
|
|
532
1515
|
await withStorage(async (artifacts) => {
|
|
533
1516
|
await artifacts.create(createInput())
|
|
534
|
-
await artifacts.
|
|
535
|
-
|
|
1517
|
+
await artifacts.freeze({
|
|
1518
|
+
projectId,
|
|
1519
|
+
artifactId: "art_report",
|
|
1520
|
+
frozenAt: at(1),
|
|
1521
|
+
frozenBy: otherOwner,
|
|
1522
|
+
})
|
|
1523
|
+
await artifacts.publish(publishInput({ updatedAt: at(2) }))
|
|
1524
|
+
await artifacts.freeze({
|
|
1525
|
+
projectId,
|
|
1526
|
+
artifactId: "art_report",
|
|
1527
|
+
frozenAt: at(3),
|
|
1528
|
+
frozenBy: otherOwner,
|
|
1529
|
+
})
|
|
1530
|
+
await artifacts.publish(publishInput({ updatedAt: at(4) }))
|
|
536
1531
|
|
|
537
1532
|
const all = await artifacts.listVersions({ projectId, artifactId: "art_report" })
|
|
538
1533
|
expect(all.versions.map((version) => version.version)).toEqual([3, 2, 1])
|
|
@@ -554,10 +1549,10 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
554
1549
|
})
|
|
555
1550
|
})
|
|
556
1551
|
|
|
557
|
-
test("deletes an artifact with every version", async () => {
|
|
1552
|
+
test("deletes an artifact with every version and restore point", async () => {
|
|
558
1553
|
await withStorage(async (artifacts) => {
|
|
559
1554
|
await artifacts.create(createInput())
|
|
560
|
-
await artifacts.publish(publishInput({
|
|
1555
|
+
await artifacts.publish({ ...publishInput({ updatedAt: at(1) }), turnRunId: "run_1" })
|
|
561
1556
|
|
|
562
1557
|
expect(await artifacts.delete({ projectId: otherProjectId, id: "art_report" })).toBe(false)
|
|
563
1558
|
expect(await artifacts.delete({ projectId, id: "art_report" })).toBe(true)
|
|
@@ -569,61 +1564,8 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
569
1564
|
|
|
570
1565
|
// The id is free again, and numbering starts over for the new artifact.
|
|
571
1566
|
expect((await artifacts.create(createInput())).version.version).toBe(1)
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
test("deletes a run's versions, repoints latest, and never reuses a number", async () => {
|
|
576
|
-
await withStorage(async (artifacts) => {
|
|
577
|
-
await artifacts.create(
|
|
578
|
-
createInput({ version: versionInput({ origin: { threadId: "thr_1", runId: "run_0" } }) })
|
|
579
|
-
)
|
|
580
|
-
await artifacts.publish(
|
|
581
|
-
publishInput({
|
|
582
|
-
title: "Kept",
|
|
583
|
-
createdAt: at(1),
|
|
584
|
-
origin: { threadId: "thr_1", runId: "run_0" },
|
|
585
|
-
})
|
|
586
|
-
)
|
|
587
|
-
await artifacts.publish(publishInput({ title: "Retried", createdAt: at(2) }))
|
|
588
|
-
await artifacts.create(
|
|
589
|
-
createInput({ id: "art_new_in_run", version: versionInput({ createdAt: at(2) }) })
|
|
590
|
-
)
|
|
591
|
-
await artifacts.create(
|
|
592
|
-
createInput({
|
|
593
|
-
id: "art_other_run",
|
|
594
|
-
version: versionInput({ origin: { threadId: "thr_1", runId: "run_9" } }),
|
|
595
|
-
})
|
|
596
|
-
)
|
|
597
|
-
await artifacts.createFrameGrant(frameGrant("a"))
|
|
598
|
-
await artifacts.createFrameGrant(frameGrant("b", { artifactId: "art_new_in_run" }))
|
|
599
|
-
|
|
600
|
-
expect(
|
|
601
|
-
await artifacts.deleteVersionsByOrigin({ projectId: otherProjectId, runId: "run_1" })
|
|
602
|
-
).toBe(0)
|
|
603
|
-
expect(await artifacts.deleteVersionsByOrigin({ projectId, runId: "run_1" })).toBe(2)
|
|
604
|
-
|
|
605
|
-
expect(await artifacts.get({ projectId, id: "art_report" })).toMatchObject({
|
|
606
|
-
title: "Kept",
|
|
607
|
-
latestVersion: 2,
|
|
608
|
-
updatedAt: at(1),
|
|
609
|
-
})
|
|
610
|
-
expect(
|
|
611
|
-
await artifacts.getVersion({ projectId, artifactId: "art_report", version: 3 })
|
|
612
|
-
).toBeNull()
|
|
613
|
-
expect(await artifacts.get({ projectId, id: "art_new_in_run" })).toBeNull()
|
|
614
|
-
expect(await artifacts.get({ projectId, id: "art_other_run" })).not.toBeNull()
|
|
615
|
-
// A deleted artifact's frame grants go with it; a kept one's stay. To see this fail, delete
|
|
616
|
-
// the artifact from the map alone in `InMemoryArtifactStorage.deleteVersionsByOrigin`.
|
|
617
|
-
expect(await artifacts.findFrameGrant({ projectId, tokenHash: "b".repeat(64) })).toBeNull()
|
|
618
|
-
expect(
|
|
619
|
-
await artifacts.findFrameGrant({ projectId, tokenHash: "a".repeat(64) })
|
|
620
|
-
).not.toBeNull()
|
|
621
|
-
|
|
622
|
-
// Version 3 belonged to the retried run; the next one is 4, so an address pinned to @3
|
|
623
|
-
// can never land on different content.
|
|
624
|
-
expect((await artifacts.publish(publishInput({ createdAt: at(3) }))).version.version).toBe(
|
|
625
|
-
4
|
|
626
|
-
)
|
|
1567
|
+
expect(await artifacts.listRestorePoints({ projectId, id: "art_report" })).toEqual([])
|
|
1568
|
+
expect(await artifacts.listTurnWrites({ projectId, turnRunId: "run_1" })).toEqual([])
|
|
627
1569
|
})
|
|
628
1570
|
})
|
|
629
1571
|
|
|
@@ -728,6 +1670,82 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
728
1670
|
})
|
|
729
1671
|
})
|
|
730
1672
|
|
|
1673
|
+
test("keeps a board's pictures by render key, mode, and size, the first one kept staying", async () => {
|
|
1674
|
+
await withStorage(async (artifacts) => {
|
|
1675
|
+
const welcome = "a".repeat(64)
|
|
1676
|
+
const region = "b".repeat(64)
|
|
1677
|
+
const picture = (
|
|
1678
|
+
renderKey: string,
|
|
1679
|
+
theme: "light" | "dark",
|
|
1680
|
+
size: "full" | "small",
|
|
1681
|
+
seed: string,
|
|
1682
|
+
createdAt = t0
|
|
1683
|
+
) => ({
|
|
1684
|
+
renderKey,
|
|
1685
|
+
theme,
|
|
1686
|
+
size,
|
|
1687
|
+
file: fileRef(seed, size === "full" ? "image/png" : "image/webp"),
|
|
1688
|
+
createdAt,
|
|
1689
|
+
})
|
|
1690
|
+
await artifacts.putBoardPreviews({
|
|
1691
|
+
projectId,
|
|
1692
|
+
previews: [
|
|
1693
|
+
picture(region, "light", "full", "1"),
|
|
1694
|
+
picture(welcome, "dark", "small", "2"),
|
|
1695
|
+
picture(welcome, "light", "full", "3"),
|
|
1696
|
+
picture(welcome, "light", "small", "5"),
|
|
1697
|
+
],
|
|
1698
|
+
})
|
|
1699
|
+
|
|
1700
|
+
// A key names what the board shows: a second picture of it is of the same page.
|
|
1701
|
+
await artifacts.putBoardPreviews({
|
|
1702
|
+
projectId,
|
|
1703
|
+
previews: [picture(welcome, "light", "full", "4", at(1))],
|
|
1704
|
+
})
|
|
1705
|
+
|
|
1706
|
+
expect(
|
|
1707
|
+
await artifacts.listBoardPreviews({ projectId, renderKeys: [region, welcome, "c"] })
|
|
1708
|
+
).toEqual([
|
|
1709
|
+
{ projectId, ...picture(welcome, "dark", "small", "2") },
|
|
1710
|
+
{ projectId, ...picture(welcome, "light", "full", "3") },
|
|
1711
|
+
{ projectId, ...picture(welcome, "light", "small", "5") },
|
|
1712
|
+
{ projectId, ...picture(region, "light", "full", "1") },
|
|
1713
|
+
])
|
|
1714
|
+
expect(await artifacts.listBoardPreviews({ projectId, renderKeys: [region] })).toHaveLength(
|
|
1715
|
+
1
|
|
1716
|
+
)
|
|
1717
|
+
expect(await artifacts.listBoardPreviews({ projectId, renderKeys: [] })).toEqual([])
|
|
1718
|
+
expect(
|
|
1719
|
+
await artifacts.listBoardPreviews({ projectId: otherProjectId, renderKeys: [welcome] })
|
|
1720
|
+
).toEqual([])
|
|
1721
|
+
})
|
|
1722
|
+
})
|
|
1723
|
+
|
|
1724
|
+
test("keeps a board's pictures when an artifact that showed it is deleted", async () => {
|
|
1725
|
+
await withStorage(async (artifacts) => {
|
|
1726
|
+
// Another version, of this artifact or a copy, may show the same board.
|
|
1727
|
+
await artifacts.create(createInput())
|
|
1728
|
+
const renderKey = "a".repeat(64)
|
|
1729
|
+
await artifacts.putBoardPreviews({
|
|
1730
|
+
projectId,
|
|
1731
|
+
previews: [
|
|
1732
|
+
{
|
|
1733
|
+
renderKey,
|
|
1734
|
+
theme: "light",
|
|
1735
|
+
size: "full",
|
|
1736
|
+
file: fileRef("1", "image/png"),
|
|
1737
|
+
createdAt: t0,
|
|
1738
|
+
},
|
|
1739
|
+
],
|
|
1740
|
+
})
|
|
1741
|
+
|
|
1742
|
+
expect(await artifacts.delete({ projectId, id: "art_report" })).toBe(true)
|
|
1743
|
+
expect(
|
|
1744
|
+
await artifacts.listBoardPreviews({ projectId, renderKeys: [renderKey] })
|
|
1745
|
+
).toHaveLength(1)
|
|
1746
|
+
})
|
|
1747
|
+
})
|
|
1748
|
+
|
|
731
1749
|
test("rolls back with its containing storage transaction", async () => {
|
|
732
1750
|
await withStorage(async (artifacts, storage) => {
|
|
733
1751
|
await artifacts.create(createInput())
|
|
@@ -736,9 +1754,30 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
736
1754
|
await expect(
|
|
737
1755
|
storage.transaction(async (tx) => {
|
|
738
1756
|
if (!tx.artifacts) throw new Error("Expected artifact storage in the transaction.")
|
|
739
|
-
await tx.artifacts.publish(
|
|
1757
|
+
await tx.artifacts.publish({
|
|
1758
|
+
...publishInput({ updatedAt: at(1) }),
|
|
1759
|
+
turnRunId: "run_1",
|
|
1760
|
+
})
|
|
1761
|
+
await tx.artifacts.freeze({
|
|
1762
|
+
projectId,
|
|
1763
|
+
artifactId: "art_report",
|
|
1764
|
+
frozenAt: at(1),
|
|
1765
|
+
frozenBy: otherOwner,
|
|
1766
|
+
})
|
|
740
1767
|
await tx.artifacts.create(createInput({ id: "art_rolled_back" }))
|
|
741
1768
|
await tx.artifacts.createFrameGrant(frameGrant("a"))
|
|
1769
|
+
await tx.artifacts.putBoardPreviews({
|
|
1770
|
+
projectId,
|
|
1771
|
+
previews: [
|
|
1772
|
+
{
|
|
1773
|
+
renderKey: "a".repeat(64),
|
|
1774
|
+
theme: "light",
|
|
1775
|
+
size: "full",
|
|
1776
|
+
file: fileRef("1", "image/png"),
|
|
1777
|
+
createdAt: t0,
|
|
1778
|
+
},
|
|
1779
|
+
],
|
|
1780
|
+
})
|
|
742
1781
|
await tx.artifacts.setState({
|
|
743
1782
|
projectId,
|
|
744
1783
|
artifactId: "art_report",
|
|
@@ -747,21 +1786,27 @@ export function runArtifactStorageContractSuite<TStorage extends ArtifactStorage
|
|
|
747
1786
|
value: "450",
|
|
748
1787
|
updatedAt: at(1),
|
|
749
1788
|
})
|
|
750
|
-
expect((await tx.artifacts.get({ projectId, id: "art_report" }))?.
|
|
1789
|
+
expect((await tx.artifacts.get({ projectId, id: "art_report" }))?.revision).toBe(3)
|
|
751
1790
|
throw rollback
|
|
752
1791
|
})
|
|
753
1792
|
).rejects.toBe(rollback)
|
|
754
1793
|
|
|
755
|
-
expect((await artifacts.get({ projectId, id: "art_report" }))?.
|
|
1794
|
+
expect((await artifacts.get({ projectId, id: "art_report" }))?.revision).toBe(1)
|
|
756
1795
|
expect(await artifacts.get({ projectId, id: "art_rolled_back" })).toBeNull()
|
|
1796
|
+
// To see this fail, leave restore points out of `InMemoryArtifactStorage.restore`.
|
|
1797
|
+
expect(await artifacts.listRestorePoints({ projectId, id: "art_report" })).toEqual([])
|
|
757
1798
|
// To see this fail, leave frame grants out of `InMemoryArtifactStorage.restore`.
|
|
758
1799
|
expect(await artifacts.findFrameGrant({ projectId, tokenHash: "a".repeat(64) })).toBeNull()
|
|
1800
|
+
// To see this fail, leave board previews out of `InMemoryArtifactStorage.restore`.
|
|
1801
|
+
expect(
|
|
1802
|
+
await artifacts.listBoardPreviews({ projectId, renderKeys: ["a".repeat(64)] })
|
|
1803
|
+
).toEqual([])
|
|
759
1804
|
// To see this fail, leave state out of `InMemoryArtifactStorage.restore`.
|
|
760
1805
|
expect(
|
|
761
1806
|
await artifacts.listState({ projectId, artifactId: "art_report", principal: owner })
|
|
762
1807
|
).toEqual([])
|
|
763
|
-
expect((await artifacts.publish(publishInput({
|
|
764
|
-
2
|
|
1808
|
+
expect((await artifacts.publish(publishInput({ updatedAt: at(2) }))).version).toMatchObject(
|
|
1809
|
+
{ version: 1, revision: 2 }
|
|
765
1810
|
)
|
|
766
1811
|
})
|
|
767
1812
|
})
|
|
@@ -791,11 +1836,14 @@ function createInput(overrides: Partial<CreateArtifactInput> = {}): CreateArtifa
|
|
|
791
1836
|
}
|
|
792
1837
|
}
|
|
793
1838
|
|
|
794
|
-
function publishInput(
|
|
1839
|
+
function publishInput(
|
|
1840
|
+
overrides: Partial<ArtifactVersionInput> = {},
|
|
1841
|
+
artifactId = "art_report"
|
|
1842
|
+
): PublishArtifactVersionInput {
|
|
795
1843
|
return {
|
|
796
1844
|
projectId,
|
|
797
1845
|
artifactId,
|
|
798
|
-
kind: "document"
|
|
1846
|
+
kind: "document",
|
|
799
1847
|
version: versionInput({ origin: agentRun, ...overrides }),
|
|
800
1848
|
}
|
|
801
1849
|
}
|
|
@@ -809,7 +1857,7 @@ function versionInput(overrides: Partial<ArtifactVersionInput> = {}): ArtifactVe
|
|
|
809
1857
|
references: [],
|
|
810
1858
|
author: owner,
|
|
811
1859
|
origin: agentRun,
|
|
812
|
-
|
|
1860
|
+
updatedAt: t0,
|
|
813
1861
|
...overrides,
|
|
814
1862
|
}
|
|
815
1863
|
if (input.origin) return input
|
|
@@ -826,8 +1874,14 @@ function frameGrant(
|
|
|
826
1874
|
tokenHash: seed.repeat(64).slice(0, 64),
|
|
827
1875
|
artifactId: "art_report",
|
|
828
1876
|
version: 1,
|
|
1877
|
+
filesDigest: "f".repeat(64),
|
|
829
1878
|
targets: [
|
|
830
|
-
{ address: "artifact:art_other/figures/revenue.svg", artifactId: "art_other", version: 3 },
|
|
1879
|
+
{ address: "artifact:art_other@3/figures/revenue.svg", artifactId: "art_other", version: 3 },
|
|
1880
|
+
{
|
|
1881
|
+
address: "artifact:art_other/figures/cost.svg",
|
|
1882
|
+
artifactId: "art_other",
|
|
1883
|
+
version: "latest",
|
|
1884
|
+
},
|
|
831
1885
|
],
|
|
832
1886
|
createdAt: t0,
|
|
833
1887
|
expiresAt: at(60),
|