@johnhenry/mallory-cli 0.0.0-stage → 0.1.0
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/README.md +60 -2
- package/bin/mallory.mjs +51 -0
- package/package.json +51 -4
- package/src/a2a/client.js +511 -0
- package/src/a2a/demo-agent.js +396 -0
- package/src/a2a/hub.js +578 -0
- package/src/a2a/settings.js +88 -0
- package/src/a2a/task.js +358 -0
- package/src/acp/client.js +573 -0
- package/src/acp/demo-agent.js +332 -0
- package/src/acp/hub.js +632 -0
- package/src/acp/settings.js +78 -0
- package/src/actions/map.js +524 -0
- package/src/agent/cloud.js +77 -0
- package/src/agent/compact.js +84 -0
- package/src/agent/constants.js +39 -0
- package/src/agent/diff.js +101 -0
- package/src/agent/fork.js +159 -0
- package/src/agent/grounding.js +73 -0
- package/src/agent/guards.js +129 -0
- package/src/agent/local-transport.js +152 -0
- package/src/agent/loop.js +479 -0
- package/src/agent/park-store.js +77 -0
- package/src/agent/park.js +76 -0
- package/src/agent/ports.js +28 -0
- package/src/agent/providers.js +591 -0
- package/src/agent/restart.js +51 -0
- package/src/agent/router.js +380 -0
- package/src/agent/run.js +861 -0
- package/src/agent/tools.js +247 -0
- package/src/agent-library/engine.js +43 -0
- package/src/ai/bridge.js +155 -0
- package/src/ai/policy.js +131 -0
- package/src/aimatey/vendor.js +18 -0
- package/src/audio/container-duration.js +35 -0
- package/src/audio/instruments.js +776 -0
- package/src/audio/lanes.js +230 -0
- package/src/audio/patch.js +1410 -0
- package/src/audio/plan.js +276 -0
- package/src/audio/rack.js +1006 -0
- package/src/audio/sample-trim.js +293 -0
- package/src/audio/soundfont.js +243 -0
- package/src/audio/take-store.js +87 -0
- package/src/audio/takes.js +129 -0
- package/src/audio/wav.js +170 -0
- package/src/audio/zzfx.js +333 -0
- package/src/autonomy/bundle.js +207 -0
- package/src/autonomy/confine.js +61 -0
- package/src/autonomy/enforce.js +155 -0
- package/src/autonomy/file-kv.js +88 -0
- package/src/autonomy/ledger.js +203 -0
- package/src/autonomy/pins.js +50 -0
- package/src/autonomy/psl/index.js +32 -0
- package/src/autonomy/psl/suffixes.json +1 -0
- package/src/autonomy/record.js +28 -0
- package/src/autonomy/routines.js +107 -0
- package/src/autonomy/server.js +175 -0
- package/src/autonomy/signer-node.js +167 -0
- package/src/autonomy/store.js +43 -0
- package/src/autonomy/unattended.js +13 -0
- package/src/bytes/bytes.js +378 -0
- package/src/calc/syntax.js +125 -0
- package/src/calc/tex.js +28 -0
- package/src/calendar/vendor.js +2 -0
- package/src/clipboard.js +130 -0
- package/src/clsh/clsh.js +3417 -0
- package/src/codec/capnp.js +1804 -0
- package/src/codec/core.js +2043 -0
- package/src/codec/vendor/avro.js +136 -0
- package/src/codec/vendor/cbor.js +25 -0
- package/src/codec/vendor/flatbuffers.js +206 -0
- package/src/codec/vendor/msgpack.js +9 -0
- package/src/codec/vendor/protobuf.js +53 -0
- package/src/delegation/caps.js +60 -0
- package/src/delegation/config.js +32 -0
- package/src/device/model.js +246 -0
- package/src/device/recording.js +198 -0
- package/src/device/stream-model.js +151 -0
- package/src/documents/documents.js +1224 -0
- package/src/effects/catalog.js +63 -0
- package/src/effects/extras.js +133 -0
- package/src/effects/parse.js +339 -0
- package/src/embed/protocol.js +131 -0
- package/src/env/env.js +159 -0
- package/src/exact/vendor.js +45 -0
- package/src/example-meta.js +164 -0
- package/src/examples.js +94 -0
- package/src/export/canvas-image.js +217 -0
- package/src/export/expr-latex-lazy.js +8 -0
- package/src/export/formats.js +322 -0
- package/src/export/latex.js +183 -0
- package/src/export/pane.js +184 -0
- package/src/export/value.js +452 -0
- package/src/export/zip.js +214 -0
- package/src/ext/access.js +58 -0
- package/src/ext/btasks.js +225 -0
- package/src/ext/client.js +209 -0
- package/src/ext/tools.js +69 -0
- package/src/ext/view.js +105 -0
- package/src/ext/webmcp-tabs.js +299 -0
- package/src/files/archive.js +232 -0
- package/src/files/files.js +317 -0
- package/src/formats/json.js +24 -0
- package/src/formats/jupyter.js +188 -0
- package/src/formats/markdown.js +254 -0
- package/src/formats/n8n.js +276 -0
- package/src/formats/node-red.js +363 -0
- package/src/formats/registry.js +177 -0
- package/src/formats/rivet.js +259 -0
- package/src/formats/shared.js +98 -0
- package/src/formats/structure.js +182 -0
- package/src/formats/yaml.js +127 -0
- package/src/frame/frame.js +962 -0
- package/src/frame/vendor.js +1484 -0
- package/src/gate/audit.js +116 -0
- package/src/gate/gate.js +365 -0
- package/src/gate/policy.js +295 -0
- package/src/gate/scripted.js +110 -0
- package/src/gate/seams.js +32 -0
- package/src/gate/store.js +66 -0
- package/src/geometry/model.js +533 -0
- package/src/grant-key.js +149 -0
- package/src/graph/model.js +381 -0
- package/src/headless/a2a-push.js +123 -0
- package/src/headless/channels/config.js +142 -0
- package/src/headless/channels/connectors.js +283 -0
- package/src/headless/channels/index.js +257 -0
- package/src/headless/channels/mail.js +197 -0
- package/src/headless/channels/mailnet.js +223 -0
- package/src/headless/channels/platforms.js +194 -0
- package/src/headless/channels/replay.js +49 -0
- package/src/headless/cli.js +1397 -0
- package/src/headless/companion-client.js +182 -0
- package/src/headless/cost-cli.js +177 -0
- package/src/headless/deprecations-cli.js +102 -0
- package/src/headless/examples.js +48 -0
- package/src/headless/ffmpeg-exec.js +217 -0
- package/src/headless/gateways/config.js +213 -0
- package/src/headless/gateways/homeassistant.js +159 -0
- package/src/headless/gateways/index.js +121 -0
- package/src/headless/gateways/matter.js +150 -0
- package/src/headless/gateways/mqtt-client.js +177 -0
- package/src/headless/gateways/mqtt.js +70 -0
- package/src/headless/gateways/netway.js +226 -0
- package/src/headless/gateways/serverpod-worker.mjs +16 -0
- package/src/headless/gateways/serverpod.js +71 -0
- package/src/headless/gateways/util.js +27 -0
- package/src/headless/grant-cli.js +208 -0
- package/src/headless/guard.js +125 -0
- package/src/headless/guards.js +124 -0
- package/src/headless/machine-cli.js +853 -0
- package/src/headless/mcp-endpoint.js +287 -0
- package/src/headless/mcp-roots.js +38 -0
- package/src/headless/model-endpoint.js +88 -0
- package/src/headless/net.js +151 -0
- package/src/headless/node.js +263 -0
- package/src/headless/npm-tarball.js +29 -0
- package/src/headless/operator-page.js +112 -0
- package/src/headless/operator.js +242 -0
- package/src/headless/people.js +34 -0
- package/src/headless/pkg-cli.js +1103 -0
- package/src/headless/pkg-serve.js +138 -0
- package/src/headless/process-worker.js +88 -0
- package/src/headless/runner-remote.js +477 -0
- package/src/headless/sandbox-child.mjs +21 -0
- package/src/headless/scheduled.js +557 -0
- package/src/headless/serve-stream.js +97 -0
- package/src/headless/serve.js +2238 -0
- package/src/headless/short-links.js +158 -0
- package/src/headless/static-dirs.js +207 -0
- package/src/headless/trust-file.js +51 -0
- package/src/headless/watch.js +291 -0
- package/src/headless/ws-connect.js +65 -0
- package/src/headless/ws-connections.js +44 -0
- package/src/headless/ws-echo.js +150 -0
- package/src/headless/ws-proxy.js +354 -0
- package/src/headless/ws-ticket.js +48 -0
- package/src/hooks/config.js +50 -0
- package/src/hooks/engine.js +189 -0
- package/src/input/log.js +613 -0
- package/src/input/player.js +217 -0
- package/src/input/replay.js +209 -0
- package/src/jth/vendor.js +28 -0
- package/src/ledger/tx.js +94 -0
- package/src/machine/apply.js +193 -0
- package/src/machine/diff.js +168 -0
- package/src/machine/drive.js +296 -0
- package/src/machine/engine.js +478 -0
- package/src/machine/files-tool.js +76 -0
- package/src/machine/lint.js +139 -0
- package/src/machine/llmtm-trace.js +117 -0
- package/src/machine/llmtm.js +475 -0
- package/src/machine/otel.js +80 -0
- package/src/machine/pane-provider.js +51 -0
- package/src/machine/propose.js +159 -0
- package/src/machine/random.js +52 -0
- package/src/machine/risk.js +107 -0
- package/src/machine/session.js +1017 -0
- package/src/machine/shell-tool.js +45 -0
- package/src/machine/tape.js +349 -0
- package/src/machine/templates.js +104 -0
- package/src/machine/trace.js +664 -0
- package/src/machine/view.js +73 -0
- package/src/machine/vm-tool.js +47 -0
- package/src/machine/watchdog.js +46 -0
- package/src/mcp/app-args.js +51 -0
- package/src/mcp/app-run.js +56 -0
- package/src/mcp/apps.js +468 -0
- package/src/mcp/cache.js +232 -0
- package/src/mcp/client.js +507 -0
- package/src/mcp/demo-app.js +183 -0
- package/src/mcp/demo-server.js +602 -0
- package/src/mcp/elicitation.js +116 -0
- package/src/mcp/hub.js +1326 -0
- package/src/mcp/roots.js +139 -0
- package/src/mcp/sampling.js +105 -0
- package/src/mcp/settings.js +125 -0
- package/src/mcp/tape.js +292 -0
- package/src/mcp/uri-template.js +156 -0
- package/src/mcp/wsh-client.js +164 -0
- package/src/media/animated-codec.js +7 -0
- package/src/media/animated.js +623 -0
- package/src/media/compare-agent.js +70 -0
- package/src/media/compare-job.js +63 -0
- package/src/media/compare-page.js +296 -0
- package/src/media/compare-worker.js +14 -0
- package/src/media/compare.js +600 -0
- package/src/media/contract.js +62 -0
- package/src/media/decode-frame.js +57 -0
- package/src/media/decode-pool.js +188 -0
- package/src/media/ffmpeg-edit.js +344 -0
- package/src/media/ffmpeg-wasm-client.js +121 -0
- package/src/media/ffmpeg-wasm-session.js +79 -0
- package/src/media/ffmpeg-wasm.js +139 -0
- package/src/media/ffmpeg-worker.js +23 -0
- package/src/media/ffmpeg.js +903 -0
- package/src/media/helpers.js +419 -0
- package/src/media/keep.js +108 -0
- package/src/media/metadata-worker.js +16 -0
- package/src/media/metadata.js +2518 -0
- package/src/media/mime.js +102 -0
- package/src/media/page-decode.js +74 -0
- package/src/media/persist.js +114 -0
- package/src/media/png.js +226 -0
- package/src/media/sample-input.js +67 -0
- package/src/media/store.js +86 -0
- package/src/media/wav.js +109 -0
- package/src/midi/mappings.js +250 -0
- package/src/midi/message.js +125 -0
- package/src/model/action-hub.js +143 -0
- package/src/model/adapters.js +284 -0
- package/src/model/agent-runs.js +12 -0
- package/src/model/arrange.js +308 -0
- package/src/model/automation-clock.js +494 -0
- package/src/model/automation.js +653 -0
- package/src/model/batches.js +78 -0
- package/src/model/binary-view.js +195 -0
- package/src/model/breakpoints.js +392 -0
- package/src/model/calc-settings.js +65 -0
- package/src/model/calendar.js +254 -0
- package/src/model/canvas-id.js +5 -0
- package/src/model/canvas.js +5048 -0
- package/src/model/channel-names.js +29 -0
- package/src/model/channels.js +692 -0
- package/src/model/chart-clock.js +631 -0
- package/src/model/chart-code.js +69 -0
- package/src/model/codecs.js +60 -0
- package/src/model/companion-access.js +271 -0
- package/src/model/companion-pane.js +50 -0
- package/src/model/composite.js +324 -0
- package/src/model/context.js +380 -0
- package/src/model/controls.js +231 -0
- package/src/model/converter-presets.js +368 -0
- package/src/model/cost.js +580 -0
- package/src/model/curve-transform.js +122 -0
- package/src/model/cycles.js +176 -0
- package/src/model/debug-log.js +168 -0
- package/src/model/decision-clock.js +100 -0
- package/src/model/decisions.js +265 -0
- package/src/model/desk.js +87 -0
- package/src/model/device-hub.js +400 -0
- package/src/model/diff.js +445 -0
- package/src/model/emit-events.js +179 -0
- package/src/model/errors.js +238 -0
- package/src/model/event-presets.js +297 -0
- package/src/model/events.js +1303 -0
- package/src/model/explicit-setters.js +139 -0
- package/src/model/field-mapping.js +623 -0
- package/src/model/files-pane.js +263 -0
- package/src/model/flow-idle.js +89 -0
- package/src/model/foreach.js +549 -0
- package/src/model/frame-loop.js +71 -0
- package/src/model/frame-pressure.js +180 -0
- package/src/model/function-scaffold.js +1000 -0
- package/src/model/geometry-settings.js +54 -0
- package/src/model/goals.js +176 -0
- package/src/model/graph-settings.js +76 -0
- package/src/model/grid-widget.js +175 -0
- package/src/model/groups.js +332 -0
- package/src/model/hash.js +21 -0
- package/src/model/history.js +259 -0
- package/src/model/http-copy.js +88 -0
- package/src/model/http-send-companion.js +110 -0
- package/src/model/http-send.js +163 -0
- package/src/model/http-tap.js +521 -0
- package/src/model/http-tools.js +1138 -0
- package/src/model/import-lock.js +78 -0
- package/src/model/imports.js +258 -0
- package/src/model/infer-outputs.js +822 -0
- package/src/model/ink-connect.js +150 -0
- package/src/model/ink-diff.js +75 -0
- package/src/model/ink-gone.js +71 -0
- package/src/model/ink-route.js +120 -0
- package/src/model/ink-svg.js +206 -0
- package/src/model/ink.js +739 -0
- package/src/model/input-log-hub.js +456 -0
- package/src/model/input-split.js +69 -0
- package/src/model/json-schema-host.js +9 -0
- package/src/model/json-schema.js +368 -0
- package/src/model/jth.js +78 -0
- package/src/model/latex-expr.js +528 -0
- package/src/model/layout-history.js +120 -0
- package/src/model/lazy-map.js +88 -0
- package/src/model/ledger-pane.js +101 -0
- package/src/model/legacy-viaframe.js +90 -0
- package/src/model/lessons.js +448 -0
- package/src/model/links.js +981 -0
- package/src/model/live.js +411 -0
- package/src/model/math-widget.js +53 -0
- package/src/model/memory-settings.js +33 -0
- package/src/model/midi-controls.js +350 -0
- package/src/model/nl-time.js +408 -0
- package/src/model/notebook.js +137 -0
- package/src/model/pane-view-store.js +15 -0
- package/src/model/partial.js +115 -0
- package/src/model/pause-clock.js +53 -0
- package/src/model/peer-pane.js +32 -0
- package/src/model/persist-state.js +290 -0
- package/src/model/person-only.js +122 -0
- package/src/model/pin.js +209 -0
- package/src/model/plot-3d.js +213 -0
- package/src/model/plot-series.js +157 -0
- package/src/model/plot-settings.js +531 -0
- package/src/model/ports.js +312 -0
- package/src/model/presentation.js +222 -0
- package/src/model/preset-apply.js +316 -0
- package/src/model/preset-banks.js +335 -0
- package/src/model/preset-morph.js +263 -0
- package/src/model/preset-ops.js +205 -0
- package/src/model/preset-player.js +283 -0
- package/src/model/preset-states.js +172 -0
- package/src/model/profile-settings.js +109 -0
- package/src/model/promote.js +103 -0
- package/src/model/protected.js +10 -0
- package/src/model/proxy-log.js +230 -0
- package/src/model/proxy.js +367 -0
- package/src/model/quantity-widget.js +61 -0
- package/src/model/queue-book.js +359 -0
- package/src/model/quick-add.js +224 -0
- package/src/model/rate-limit.js +313 -0
- package/src/model/rate.js +95 -0
- package/src/model/recovery.js +216 -0
- package/src/model/rename-follow.js +113 -0
- package/src/model/repeater.js +1126 -0
- package/src/model/retention.js +664 -0
- package/src/model/route-edit.js +132 -0
- package/src/model/router.js +155 -0
- package/src/model/runaway.js +232 -0
- package/src/model/runlog.js +1033 -0
- package/src/model/runners/a2a.js +2 -0
- package/src/model/runners/acp.js +2 -0
- package/src/model/runners/actions.js +4 -0
- package/src/model/runners/agent.js +4 -0
- package/src/model/runners/audio.js +21 -0
- package/src/model/runners/automation.js +2 -0
- package/src/model/runners/calc.js +23 -0
- package/src/model/runners/catch.js +10 -0
- package/src/model/runners/codec.js +24 -0
- package/src/model/runners/companion-run.js +2 -0
- package/src/model/runners/device.js +7 -0
- package/src/model/runners/dom.js +13 -0
- package/src/model/runners/effects.js +2 -0
- package/src/model/runners/embed.js +11 -0
- package/src/model/runners/eval.js +2 -0
- package/src/model/runners/files.js +19 -0
- package/src/model/runners/geometry.js +23 -0
- package/src/model/runners/goals.js +18 -0
- package/src/model/runners/graph.js +23 -0
- package/src/model/runners/html.js +2 -0
- package/src/model/runners/http-proxy.js +185 -0
- package/src/model/runners/http-send.js +61 -0
- package/src/model/runners/http-static.js +83 -0
- package/src/model/runners/http-tap.js +26 -0
- package/src/model/runners/http.js +40 -0
- package/src/model/runners/import.js +2 -0
- package/src/model/runners/index.js +74 -0
- package/src/model/runners/input.js +14 -0
- package/src/model/runners/inputlog.js +7 -0
- package/src/model/runners/ledger.js +15 -0
- package/src/model/runners/machine.js +4 -0
- package/src/model/runners/mcp.js +2 -0
- package/src/model/runners/mcpapp.js +2 -0
- package/src/model/runners/media.js +18 -0
- package/src/model/runners/memory.js +28 -0
- package/src/model/runners/mesh-inspect.js +13 -0
- package/src/model/runners/peer.js +14 -0
- package/src/model/runners/plot.js +22 -0
- package/src/model/runners/render.js +14 -0
- package/src/model/runners/respond.js +2 -0
- package/src/model/runners/sample-soundfont.js +85 -0
- package/src/model/runners/sample.js +159 -0
- package/src/model/runners/scene.js +8 -0
- package/src/model/runners/score.js +24 -0
- package/src/model/runners/secret.js +10 -0
- package/src/model/runners/select.js +2 -0
- package/src/model/runners/shared.js +4 -0
- package/src/model/runners/shares.js +15 -0
- package/src/model/runners/shell.js +7 -0
- package/src/model/runners/skill.js +26 -0
- package/src/model/runners/state.js +2 -0
- package/src/model/runners/statechart.js +4 -0
- package/src/model/runners/subgraph.js +9 -0
- package/src/model/runners/tabs.js +25 -0
- package/src/model/runners/terminal.js +5 -0
- package/src/model/runners/text.js +4 -0
- package/src/model/runners/timer.js +7 -0
- package/src/model/runners/traffic.js +65 -0
- package/src/model/runners/trigger.js +2 -0
- package/src/model/runners/verdict.js +29 -0
- package/src/model/runners/vm.js +7 -0
- package/src/model/runners/wait.js +4 -0
- package/src/model/runners/ws-client.js +57 -0
- package/src/model/safe-regex.js +719 -0
- package/src/model/sample-settings.js +43 -0
- package/src/model/sample-source.js +47 -0
- package/src/model/saved-mapping.js +153 -0
- package/src/model/score-controllers.js +87 -0
- package/src/model/score-edit.js +399 -0
- package/src/model/score-instruments.js +300 -0
- package/src/model/score-library.js +407 -0
- package/src/model/score-markup.js +235 -0
- package/src/model/score-mix.js +248 -0
- package/src/model/score-patterns.js +276 -0
- package/src/model/score-selection.js +34 -0
- package/src/model/score-time.js +139 -0
- package/src/model/score-transforms.js +336 -0
- package/src/model/score-transport.js +192 -0
- package/src/model/selection.js +351 -0
- package/src/model/serial-controls.js +328 -0
- package/src/model/shares-pane.js +17 -0
- package/src/model/shell-pane.js +106 -0
- package/src/model/signature.js +1122 -0
- package/src/model/size-hints.js +106 -0
- package/src/model/size-ratio.js +12 -0
- package/src/model/skill-settings.js +23 -0
- package/src/model/snapping.js +466 -0
- package/src/model/split.js +375 -0
- package/src/model/spring-player.js +222 -0
- package/src/model/statecharts.js +1369 -0
- package/src/model/states-preset.js +208 -0
- package/src/model/static-route.js +100 -0
- package/src/model/step-words.js +45 -0
- package/src/model/subgraph.js +1042 -0
- package/src/model/switch.js +98 -0
- package/src/model/tabs-store.js +10 -0
- package/src/model/tensor-view.js +146 -0
- package/src/model/timer-clock.js +361 -0
- package/src/model/timers.js +422 -0
- package/src/model/timing.js +212 -0
- package/src/model/traffic-agent.js +111 -0
- package/src/model/traffic-store.js +20 -0
- package/src/model/traffic.js +665 -0
- package/src/model/transport.js +364 -0
- package/src/model/turns.js +86 -0
- package/src/model/types.js +425 -0
- package/src/model/value-path.js +138 -0
- package/src/model/versions.js +535 -0
- package/src/model/view-outputs.js +144 -0
- package/src/model/viewport-bookmarks.js +194 -0
- package/src/model/virtual-clock.js +85 -0
- package/src/model/vm-pane.js +258 -0
- package/src/model/wait-clock.js +715 -0
- package/src/model/wait-persist.js +248 -0
- package/src/model/waits.js +431 -0
- package/src/model/watch.js +80 -0
- package/src/model/webhook.js +496 -0
- package/src/model/when.js +48 -0
- package/src/model/widget-values.js +392 -0
- package/src/model/window-commands.js +278 -0
- package/src/model/windows.js +348 -0
- package/src/model/wire-inspect.js +343 -0
- package/src/model/wire-ops.js +324 -0
- package/src/model/wire-pipeline.js +378 -0
- package/src/model/wire-route.js +637 -0
- package/src/model/workspaces.js +122 -0
- package/src/model/ws-client.js +155 -0
- package/src/model/ws-demo.js +31 -0
- package/src/model/ws-frames.js +141 -0
- package/src/model/ws-hub.js +219 -0
- package/src/model/ws-served.js +13 -0
- package/src/model/xstate.js +374 -0
- package/src/narrative/narrative.js +1557 -0
- package/src/network/auth.js +224 -0
- package/src/network/csp-frame.js +197 -0
- package/src/network/declarative-shadow.js +27 -0
- package/src/network/frame-net-shim.js +962 -0
- package/src/network/hosts.js +157 -0
- package/src/network/policy.js +520 -0
- package/src/network/rtc-shim.js +418 -0
- package/src/network/secret-gate.js +78 -0
- package/src/network/secrets.js +261 -0
- package/src/network/sockets.js +287 -0
- package/src/network/store.js +186 -0
- package/src/network/streams.js +99 -0
- package/src/packages/asset-values.js +50 -0
- package/src/packages/assets.js +99 -0
- package/src/packages/deprecation.js +203 -0
- package/src/packages/fetch.js +152 -0
- package/src/packages/function-canvas.js +73 -0
- package/src/packages/module.js +120 -0
- package/src/packages/package.js +474 -0
- package/src/packages/published.js +27 -0
- package/src/packages/requires.js +83 -0
- package/src/packages/signing.js +145 -0
- package/src/packages/trust.js +107 -0
- package/src/panes/a2a.js +51 -0
- package/src/panes/acp.js +60 -0
- package/src/panes/actions.js +54 -0
- package/src/panes/agent.js +83 -0
- package/src/panes/audio.js +103 -0
- package/src/panes/automation.js +112 -0
- package/src/panes/calc.js +67 -0
- package/src/panes/catch.js +52 -0
- package/src/panes/codec.js +59 -0
- package/src/panes/colors.js +12 -0
- package/src/panes/companion.js +54 -0
- package/src/panes/decision.js +65 -0
- package/src/panes/device.js +56 -0
- package/src/panes/dom.js +37 -0
- package/src/panes/effects.js +118 -0
- package/src/panes/embed.js +30 -0
- package/src/panes/eval.js +186 -0
- package/src/panes/fields.js +299 -0
- package/src/panes/files.js +45 -0
- package/src/panes/gate.js +70 -0
- package/src/panes/geometry.js +64 -0
- package/src/panes/goals.js +75 -0
- package/src/panes/graph.js +66 -0
- package/src/panes/html.js +54 -0
- package/src/panes/http.js +82 -0
- package/src/panes/import.js +38 -0
- package/src/panes/input.js +124 -0
- package/src/panes/inputlog.js +66 -0
- package/src/panes/ledger.js +56 -0
- package/src/panes/machine.js +138 -0
- package/src/panes/mcp.js +85 -0
- package/src/panes/mcpapp.js +64 -0
- package/src/panes/media.js +38 -0
- package/src/panes/memory.js +46 -0
- package/src/panes/mesh-inspect.js +49 -0
- package/src/panes/note.js +38 -0
- package/src/panes/peer.js +44 -0
- package/src/panes/plot.js +196 -0
- package/src/panes/registry.js +475 -0
- package/src/panes/render.js +87 -0
- package/src/panes/respond.js +44 -0
- package/src/panes/router.js +84 -0
- package/src/panes/sample.js +75 -0
- package/src/panes/scene.js +55 -0
- package/src/panes/score.js +87 -0
- package/src/panes/secret.js +38 -0
- package/src/panes/select.js +67 -0
- package/src/panes/shader.js +166 -0
- package/src/panes/shared.js +33 -0
- package/src/panes/shares.js +43 -0
- package/src/panes/shell.js +47 -0
- package/src/panes/skill.js +44 -0
- package/src/panes/state.js +91 -0
- package/src/panes/statechart.js +63 -0
- package/src/panes/story.js +33 -0
- package/src/panes/subgraph.js +94 -0
- package/src/panes/tabs.js +52 -0
- package/src/panes/terminal.js +57 -0
- package/src/panes/text.js +36 -0
- package/src/panes/timer.js +55 -0
- package/src/panes/traffic.js +59 -0
- package/src/panes/verdict.js +62 -0
- package/src/panes/vm.js +46 -0
- package/src/panes/wait.js +61 -0
- package/src/panes/watch.js +57 -0
- package/src/panes/webhook.js +67 -0
- package/src/panes/ws-client.js +67 -0
- package/src/persist.js +281 -0
- package/src/plot/tex.js +19 -0
- package/src/plot/vendor.js +59 -0
- package/src/plot/view-vendor.js +5 -0
- package/src/privacy/levels.js +108 -0
- package/src/protocol/devtools.js +116 -0
- package/src/protocol/inspector.js +368 -0
- package/src/render/time.js +381 -0
- package/src/rooms/mesh-metrics.js +162 -0
- package/src/run/companion.js +355 -0
- package/src/run/describe.js +114 -0
- package/src/run/local-model.js +150 -0
- package/src/run/monitor.js +208 -0
- package/src/run/publish.js +360 -0
- package/src/run/respond-outcome.js +12 -0
- package/src/run/run.js +820 -0
- package/src/run/runner-pairing.js +243 -0
- package/src/run/values.js +122 -0
- package/src/runtime/compile.js +122 -0
- package/src/runtime/console-tag.js +64 -0
- package/src/runtime/frame-signals.js +126 -0
- package/src/runtime/iteration-push.js +19 -0
- package/src/runtime/keys.js +474 -0
- package/src/runtime/midi-input.js +170 -0
- package/src/runtime/person-waits.js +140 -0
- package/src/runtime/resource-timing.js +56 -0
- package/src/runtime/runtime.js +2150 -0
- package/src/runtime/sandbox-modules.js +163 -0
- package/src/runtime/spring.js +246 -0
- package/src/runtime/strict.js +215 -0
- package/src/runtime/transfer.js +75 -0
- package/src/runtime/tween.js +158 -0
- package/src/runtime/wasm-fuel.js +596 -0
- package/src/runtime/worker/00-prelude.js +88 -0
- package/src/runtime/worker/10-helpers.js +295 -0
- package/src/runtime/worker/20-io.js +645 -0
- package/src/runtime/worker/30-previews.js +210 -0
- package/src/runtime/worker/40-profile-lineage.js +278 -0
- package/src/runtime/worker/50-own-worker.js +233 -0
- package/src/runtime/worker/60-timers.js +172 -0
- package/src/runtime/worker/70-state-keyed.js +193 -0
- package/src/runtime/worker/80-each-compile-generators.js +619 -0
- package/src/runtime/worker/90-events-operators.js +655 -0
- package/src/runtime/worker/95-agents-batches.js +1820 -0
- package/src/runtime/worker/96-plot.js +47 -0
- package/src/runtime/worker/97-calc.js +28 -0
- package/src/runtime/worker/98-geometry.js +24 -0
- package/src/runtime/worker/99-graph.js +30 -0
- package/src/runtime/worker/99-shell.js +30 -0
- package/src/safety/config.js +57 -0
- package/src/safety/engine.js +324 -0
- package/src/scene/pixi-scene.js +806 -0
- package/src/scene/scene-assets.js +241 -0
- package/src/scene/scene-edit.js +319 -0
- package/src/secret/settings.js +41 -0
- package/src/security/multipart.js +257 -0
- package/src/security/redact.js +261 -0
- package/src/serial/broker.js +473 -0
- package/src/serial/config.js +185 -0
- package/src/serial/framers.js +389 -0
- package/src/serial/packets.js +64 -0
- package/src/shader/audio-texture.js +87 -0
- package/src/shader/channels.js +496 -0
- package/src/shader/common.js +90 -0
- package/src/shader/model.js +867 -0
- package/src/shader/passes.js +150 -0
- package/src/shader/shadertoy.js +198 -0
- package/src/shell/hub.js +287 -0
- package/src/sim/checkpoints.js +850 -0
- package/src/sim/compile.js +37 -0
- package/src/sim/fixed.js +377 -0
- package/src/sim/headless.js +205 -0
- package/src/sim/physics.js +399 -0
- package/src/smf-helper/vendor.js +2 -0
- package/src/sources/config.js +435 -0
- package/src/storage.js +153 -0
- package/src/table/table-geo.js +2344 -0
- package/src/table/table-lineage.js +808 -0
- package/src/table/table-quality.js +355 -0
- package/src/table/table-schema.js +392 -0
- package/src/table/table-sql.js +1650 -0
- package/src/table/table-stats.js +480 -0
- package/src/table/table.js +2102 -0
- package/src/tensor/tensor.js +1153 -0
- package/src/terminal/hub.js +715 -0
- package/src/terminal/screen.js +516 -0
- package/src/tests/capture.js +88 -0
- package/src/tests/compare.js +480 -0
- package/src/tests/dataset.js +170 -0
- package/src/tests/evaluate.js +286 -0
- package/src/tests/from-runs.js +99 -0
- package/src/tests/judge.js +134 -0
- package/src/tests/matchers.js +263 -0
- package/src/tests/matrix-spec.js +87 -0
- package/src/tests/matrix.js +397 -0
- package/src/tests/metrics.js +369 -0
- package/src/tests/no-value.js +42 -0
- package/src/tests/pane-check.js +45 -0
- package/src/tests/report.js +124 -0
- package/src/tests/reporters.js +140 -0
- package/src/tests/run.js +155 -0
- package/src/tilemap/tilemap.js +1122 -0
- package/src/units/units.js +3 -0
- package/src/util/bytes-text.js +21 -0
- package/src/util/num.js +10 -0
- package/src/util/regexp.js +2 -0
- package/src/util/text.js +38 -0
- package/src/verdict/engine.js +154 -0
- package/src/vm/guest-wsh.js +108 -0
- package/src/vm/hub.js +457 -0
- package/src/vm/image-files.js +4 -0
- package/src/vm/image.js +33 -0
- package/src/vm/image.lock.json +13 -0
- package/src/vm/link.js +266 -0
- package/src/vm/mount.js +212 -0
- package/src/vm/net.js +85 -0
- package/src/vm/pipe-ws.js +187 -0
- package/src/vm/v86-loader.js +11 -0
- package/src/webmcp/args.js +212 -0
- package/src/webmcp/hidden.js +218 -0
- package/src/webmcp/text.js +250 -0
- package/src/webmcp/tools/bookmark-tools.js +106 -0
- package/src/webmcp/tools/breakpoint-tools.js +48 -0
- package/src/webmcp/tools/canvases.js +208 -0
- package/src/webmcp/tools/context-tools.js +84 -0
- package/src/webmcp/tools/core.js +170 -0
- package/src/webmcp/tools/devices.js +41 -0
- package/src/webmcp/tools/edit.js +357 -0
- package/src/webmcp/tools/event-tools.js +145 -0
- package/src/webmcp/tools/image-tools.js +173 -0
- package/src/webmcp/tools/ink-tools.js +247 -0
- package/src/webmcp/tools/input-log-tools.js +163 -0
- package/src/webmcp/tools/live.js +166 -0
- package/src/webmcp/tools/machine-tools.js +74 -0
- package/src/webmcp/tools/media.js +161 -0
- package/src/webmcp/tools/midi-tools.js +32 -0
- package/src/webmcp/tools/preset-tools.js +184 -0
- package/src/webmcp/tools/quick-add-tools.js +95 -0
- package/src/webmcp/tools/reshape.js +152 -0
- package/src/webmcp/tools/run-tools.js +309 -0
- package/src/webmcp/tools/runs.js +101 -0
- package/src/webmcp/tools/scaffold-tools.js +161 -0
- package/src/webmcp/tools/serial-tools.js +36 -0
- package/src/webmcp/tools/shared.js +338 -0
- package/src/webmcp/tools/subgraphs.js +360 -0
- package/src/webmcp/tools/tests.js +170 -0
- package/src/webmcp/tools/traffic-tools.js +70 -0
- package/src/webmcp/tools/transport-tools.js +65 -0
- package/src/webmcp/tools/version-tools.js +126 -0
- package/src/webmcp/tools/versions.js +11 -0
- package/src/webmcp/tools/wire-tools.js +90 -0
- package/src/webmcp/tools/workspace-tools.js +93 -0
- package/src/webmcp/tools.js +1323 -0
- package/src/wsh/connect.js +347 -0
- package/src/wsh/demo-host.js +361 -0
- package/src/wsh/e2e.js +27 -0
- package/src/wsh/keys.js +154 -0
- package/src/wsh/known-hosts.js +39 -0
- package/src/wsh/private-key.js +95 -0
- package/src/wsh/reverse.js +34 -0
- package/src/wsh/settings.js +118 -0
- package/src/wsh/transfer.js +62 -0
- package/src/wsh/vendor.js +5 -0
- package/src/x402/challenge.js +171 -0
- package/src/x402/demo-server.js +127 -0
- package/src/x402/pay.js +125 -0
- package/src/x402/retry.js +95 -0
- package/src/x402/store.js +76 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
// Rivet projects (.rivet-project, YAML) as a mallory canvas: the main graph is
|
|
2
|
+
// the canvas, and every graph a Subgraph node calls becomes a subgraph pane
|
|
3
|
+
// holding a copy of it (mallory's subgraphs come from Rivet's). Best effort:
|
|
4
|
+
//
|
|
5
|
+
// Text, Prompt eval panes building the text (or the chat message) from
|
|
6
|
+
// their {{interpolations}}, which become inputs
|
|
7
|
+
// Code an eval pane running the node's code with Rivet's typed
|
|
8
|
+
// `inputs` ({ type, value }); its value is the outputs' values
|
|
9
|
+
// Chat an eval pane that asks Chrome's on-device model when this
|
|
10
|
+
// browser has one, and skips otherwise (edit it to call
|
|
11
|
+
// another model); the model settings stay in a comment
|
|
12
|
+
// Subgraph a subgraph pane; Graph Input / Graph Output nodes become
|
|
13
|
+
// its ports (input panes, and the panes it returns)
|
|
14
|
+
// Comment a text pane
|
|
15
|
+
// Split a node set to split runs for each item (mallory's for-each)
|
|
16
|
+
// anything else a stand-in that passes its input through, its settings in
|
|
17
|
+
// a comment
|
|
18
|
+
//
|
|
19
|
+
// Rivet's ports: an input port is an input named after it; a node with
|
|
20
|
+
// several outputs (Code, Subgraph) has their values as one object and a named
|
|
21
|
+
// output for each (format 3, src/model/ports.js), and a wire from one of them
|
|
22
|
+
// reads that output. (Output names mallory can't use, with spaces or "#", fall
|
|
23
|
+
// back to reading the object's field in code.)
|
|
24
|
+
import { readYaml } from "./yaml.js";
|
|
25
|
+
import { evalPane, textPane, idMaker, uniqueNamer, jsString, templateText, indent, standInCode, layoutPanes, newDoc, isObject, jsonComment } from "./shared.js";
|
|
26
|
+
import { sanitizeName } from "../model/canvas.js";
|
|
27
|
+
import { outputNameProblem } from "../model/ports.js";
|
|
28
|
+
|
|
29
|
+
const NODE_KEY = /^\[([^\]]+)\]:(\S+) "(.*)"$/;
|
|
30
|
+
const CONNECTION = /^(.*?)->"(.*)" ([^ /]+)\/(.+)$/;
|
|
31
|
+
const MAX_DEPTH = 8;
|
|
32
|
+
const RESERVED = ["outputs", "asText", "system", "session", "availability"];
|
|
33
|
+
|
|
34
|
+
function detect(sniff) {
|
|
35
|
+
const d = sniff.yaml;
|
|
36
|
+
return isObject(d) && isObject(d.data) && isObject(d.data.graphs) && (typeof d.version === "number" || isObject(d.data.metadata));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** A graph's nodes: [{ id, type, title, data, x, y, connections: [{ output, to, input }], split… }]. */
|
|
40
|
+
function nodesOf(graph) {
|
|
41
|
+
const out = [];
|
|
42
|
+
for (const [key, node] of Object.entries(isObject(graph?.nodes) ? graph.nodes : {})) {
|
|
43
|
+
const m = NODE_KEY.exec(key);
|
|
44
|
+
if (!m || !isObject(node)) continue;
|
|
45
|
+
const [x, y] = String(node.visualData ?? "").split("/").map(Number);
|
|
46
|
+
const connections = (Array.isArray(node.outgoingConnections) ? node.outgoingConnections : [])
|
|
47
|
+
.map((c) => CONNECTION.exec(String(c)))
|
|
48
|
+
.filter(Boolean)
|
|
49
|
+
.map((c) => ({ output: c[1], to: c[3], input: c[4] }));
|
|
50
|
+
out.push({ id: m[1], type: m[2], title: m[3], data: isObject(node.data) ? node.data : {}, x: Number.isFinite(x) ? x : 0, y: Number.isFinite(y) ? y : 0, connections, node });
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** {{name}} interpolations in a Rivet template. */
|
|
56
|
+
const interpolations = (text) => [...new Set([...String(text ?? "").matchAll(/\{\{([^}]+?)\}\}/g)].map((m) => m[1].trim()))];
|
|
57
|
+
|
|
58
|
+
/** A Rivet template as a JavaScript template literal, with the wired names substituted. */
|
|
59
|
+
function template(text, vars) {
|
|
60
|
+
return `\`${templateText(text).replace(/\{\{([^}]+?)\}\}/g, (whole, name) => (vars.has(name.trim()) ? "${" + vars.get(name.trim()) + "}" : whole))}\``;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const listOf = (v) => (Array.isArray(v) ? v.map(String) : typeof v === "string" ? v.split(",").map((s) => s.trim()).filter(Boolean) : []);
|
|
64
|
+
|
|
65
|
+
const WIDGET = {
|
|
66
|
+
number: (v) => ({ kind: "number", value: Number(v) || 0 }),
|
|
67
|
+
boolean: (v) => ({ kind: "checkbox", value: Boolean(v) }),
|
|
68
|
+
string: (v) => ({ kind: "text", value: v === undefined ? "" : String(v) }),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
function parse(text, { note }) {
|
|
72
|
+
const project = readYaml(text, "Rivet project");
|
|
73
|
+
const data = project.data;
|
|
74
|
+
const graphs = data.graphs;
|
|
75
|
+
const mainId = data.metadata?.mainGraphId && graphs[data.metadata.mainGraphId] ? data.metadata.mainGraphId : Object.keys(graphs)[0];
|
|
76
|
+
if (!mainId) throw new Error("That Rivet project has no graphs.");
|
|
77
|
+
if (project.version !== undefined && project.version !== 4) note(`This Rivet project is format version ${project.version}; mallory reads version 4, so parts may be missing.`);
|
|
78
|
+
const newId = idMaker("rv");
|
|
79
|
+
const used = new Set([mainId]);
|
|
80
|
+
const standIns = new Set();
|
|
81
|
+
|
|
82
|
+
/** A Rivet graph as panes (laid out). */
|
|
83
|
+
function convert(graphId, stack) {
|
|
84
|
+
const nodes = nodesOf(graphs[graphId]);
|
|
85
|
+
const name = uniqueNamer(RESERVED);
|
|
86
|
+
const ids = new Map(nodes.map((n) => [n.id, newId()]));
|
|
87
|
+
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
88
|
+
const subgraphs = new Map(); // node id -> { panes, outputs: [names] }
|
|
89
|
+
for (const n of nodes) {
|
|
90
|
+
if (n.type !== "subGraph") continue;
|
|
91
|
+
const target = n.data.graphId;
|
|
92
|
+
if (!graphs[target] || stack.includes(target) || stack.length >= MAX_DEPTH) continue;
|
|
93
|
+
used.add(target);
|
|
94
|
+
subgraphs.set(n.id, convert(target, [...stack, target]));
|
|
95
|
+
}
|
|
96
|
+
// A node's output names, for multi-output nodes (their value is an object of them).
|
|
97
|
+
const outputsOf = (n) => (n.type === "code" ? listOf(n.data.outputNames) : n.type === "subGraph" ? subgraphs.get(n.id)?.outputs ?? [] : []);
|
|
98
|
+
const multi = (n) => outputsOf(n).length > 1;
|
|
99
|
+
// Several outputs, all with names mallory can use as named outputs: wires read them directly.
|
|
100
|
+
const named = (n) => multi(n) && outputsOf(n).every((o) => !outputNameProblem(o));
|
|
101
|
+
// Names: Graph Input / Output nodes keep their port id (it's the subgraph's port), the others their title.
|
|
102
|
+
const names = new Map();
|
|
103
|
+
for (const n of nodes) if (n.type === "graphInput" || n.type === "graphOutput") names.set(n.id, name(n.data.id || n.title, "port"));
|
|
104
|
+
for (const n of nodes) if (!names.has(n.id)) names.set(n.id, n.type === "comment" ? "" : name(n.title || n.type, "node"));
|
|
105
|
+
|
|
106
|
+
const incoming = new Map();
|
|
107
|
+
for (const n of nodes) {
|
|
108
|
+
for (const c of n.connections) {
|
|
109
|
+
if (!byId.has(c.to)) continue;
|
|
110
|
+
if (!incoming.has(c.to)) incoming.set(c.to, []);
|
|
111
|
+
incoming.get(c.to).push({ from: n, output: c.output, input: c.input });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const panes = [];
|
|
116
|
+
const extra = []; // panes that pick one output of a multi-output node for a subgraph
|
|
117
|
+
const at = new Map();
|
|
118
|
+
const outputs = [];
|
|
119
|
+
for (const n of nodes) {
|
|
120
|
+
const id = ids.get(n.id);
|
|
121
|
+
const wires = incoming.get(n.id) ?? [];
|
|
122
|
+
// Each wired port: an input named after it, and the expression for its value.
|
|
123
|
+
const inputs = [];
|
|
124
|
+
const vars = new Map(); // port -> expression
|
|
125
|
+
const prelude = [];
|
|
126
|
+
for (const w of wires) {
|
|
127
|
+
const port = sanitizeName(w.input, "input");
|
|
128
|
+
const src = ids.get(w.from.id);
|
|
129
|
+
if (named(w.from)) {
|
|
130
|
+
if (!inputs.some((i) => i.name === port)) inputs.push({ name: port, source: src, output: w.output });
|
|
131
|
+
} else if (multi(w.from) && n.type === "subGraph") {
|
|
132
|
+
// A subgraph's ports are its inputs, so one output of a multi-output node goes in through a small pane that picks it.
|
|
133
|
+
const pick = evalPane({ id: newId(), name: name(`${names.get(w.from.id)} ${w.output}`, "output"), mode: "expression", code: `${names.get(w.from.id)}?.[${jsString(w.output)}]`, inputs: [{ name: names.get(w.from.id), source: src }], width: 240 });
|
|
134
|
+
extra.push(pick);
|
|
135
|
+
at.set(pick.id, { x: (w.from.x + n.x) * 0.6, y: n.y * 1.2 });
|
|
136
|
+
inputs.push({ name: port, source: pick.id });
|
|
137
|
+
} else if (multi(w.from)) {
|
|
138
|
+
const holder = `${port}From${names.get(w.from.id).replace(/^./, (c) => c.toUpperCase())}`;
|
|
139
|
+
if (!inputs.some((i) => i.name === holder)) inputs.push({ name: holder, source: src });
|
|
140
|
+
prelude.push(`const ${port} = ${holder}?.[${jsString(w.output)}];`);
|
|
141
|
+
} else if (!inputs.some((i) => i.name === port)) inputs.push({ name: port, source: src });
|
|
142
|
+
vars.set(w.input, port);
|
|
143
|
+
}
|
|
144
|
+
const first = wires.length ? sanitizeName(wires[0].input, "input") : null;
|
|
145
|
+
const base = { id, name: names.get(n.id), inputs };
|
|
146
|
+
const fn = (lines, extra = {}) => evalPane({ ...base, code: [...prelude, ...lines].join("\n"), ...extra });
|
|
147
|
+
const title = n.title || n.type;
|
|
148
|
+
let pane;
|
|
149
|
+
switch (n.type) {
|
|
150
|
+
case "text":
|
|
151
|
+
pane = prelude.length ? fn([`// Rivet Text node "${title}".`, `return ${template(n.data.text, vars)};`]) : evalPane({ ...base, mode: "expression", code: `// Rivet Text node "${title}".\n${template(n.data.text, vars)}` });
|
|
152
|
+
break;
|
|
153
|
+
case "prompt": {
|
|
154
|
+
const message = `({ type: ${jsString(n.data.type ?? "user")}, message: ${template(n.data.promptText, vars)}${n.data.name ? `, name: ${jsString(n.data.name)}` : ""} })`;
|
|
155
|
+
pane = prelude.length ? fn([`// Rivet Prompt node "${title}": a chat message.`, `return ${message};`]) : evalPane({ ...base, mode: "expression", code: `// Rivet Prompt node "${title}": a chat message.\n${message}` });
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
case "code": {
|
|
159
|
+
const ins = listOf(n.data.inputNames);
|
|
160
|
+
const outs = listOf(n.data.outputNames);
|
|
161
|
+
const typed = ins.map((i) => ` ${jsString(i)}: { type: "any", value: ${vars.has(i) ? vars.get(i) : "undefined"} },`);
|
|
162
|
+
const result = outs.length === 1 ? `return outputs?.[${jsString(outs[0])}]?.value;` : "return Object.fromEntries(Object.entries(outputs ?? {}).map(([name, output]) => [name, output?.value]));";
|
|
163
|
+
pane = fn([`// Rivet Code node "${title}": \`inputs\` holds typed values ({ type, value }), and it returns typed outputs.`, "const outputs = await (async (inputs) => {", indent(n.data.code ?? ""), "})({", ...typed, "});", result], { width: 380 });
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
case "chat": {
|
|
167
|
+
const { prompt: _p, ...settings } = n.data;
|
|
168
|
+
const promptVar = vars.get("prompt") ?? "undefined";
|
|
169
|
+
const system = vars.get("systemPrompt") ?? (typeof n.data.systemPrompt === "string" && n.data.systemPrompt ? jsString(n.data.systemPrompt) : "undefined");
|
|
170
|
+
pane = fn(
|
|
171
|
+
[
|
|
172
|
+
`// Rivet Chat node "${title}". Here it asks Chrome's on-device model when this browser has one, and`,
|
|
173
|
+
"// skips otherwise: edit it to call another model. Rivet's settings for it:",
|
|
174
|
+
jsonComment("chat", settings),
|
|
175
|
+
'const asText = (m) => (Array.isArray(m) ? m.map(asText).join("\\n\\n") : m && typeof m === "object" ? String(m.message ?? m.content ?? JSON.stringify(m)) : String(m ?? ""));',
|
|
176
|
+
'if (typeof LanguageModel === "undefined") return skip("no on-device model here: edit this pane to call a model");',
|
|
177
|
+
"const availability = await LanguageModel.availability();",
|
|
178
|
+
'if (availability !== "available") return skip(`the on-device model is ${availability}: edit this pane to call a model`);',
|
|
179
|
+
`const system = ${system};`,
|
|
180
|
+
'const session = await LanguageModel.create(system === undefined ? {} : { initialPrompts: [{ role: "system", content: asText(system) }] });',
|
|
181
|
+
"try {",
|
|
182
|
+
` return await session.prompt(asText(${promptVar}));`,
|
|
183
|
+
"} finally {",
|
|
184
|
+
" session.destroy();",
|
|
185
|
+
"}",
|
|
186
|
+
],
|
|
187
|
+
{ width: 380 },
|
|
188
|
+
);
|
|
189
|
+
note("Chat nodes ask Chrome's on-device model (when it's there) instead of the model Rivet used; their settings are in a comment.");
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
case "graphInput": {
|
|
193
|
+
const make = WIDGET[n.data.dataType] ?? ((v) => ({ kind: "json", value: JSON.stringify(v ?? null) }));
|
|
194
|
+
pane = { id, type: "input", name: names.get(n.id), widget: make(n.data.defaultValue), inputs: [], rect: { x: 0, y: 0, width: 260 } };
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
case "graphOutput":
|
|
198
|
+
outputs.push(id);
|
|
199
|
+
pane = evalPane({ ...base, mode: prelude.length ? "function" : "expression", code: prelude.length ? [...prelude, `return ${first};`].join("\n") : `// Rivet Graph Output "${n.data.id ?? title}".\n${first ?? "undefined"}` });
|
|
200
|
+
break;
|
|
201
|
+
case "comment":
|
|
202
|
+
pane = textPane({ id, text: String(n.data.text ?? "").trim() || "(comment)", width: Number(n.node.visualData?.split?.("/")[2]) || 300 });
|
|
203
|
+
break;
|
|
204
|
+
case "subGraph": {
|
|
205
|
+
const inner = subgraphs.get(n.id);
|
|
206
|
+
if (!inner) {
|
|
207
|
+
if (n.data.graphId && !graphs[n.data.graphId]) note("A Subgraph node calls a graph that isn't in the project: it became a stand-in.");
|
|
208
|
+
else if (n.data.graphId) note("A graph that calls itself (directly or through others) became a stand-in where it recurses.");
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
const [only] = inner.outputs.length === 1 ? inner.outputIds : [];
|
|
212
|
+
pane = { id, type: "subgraph", name: names.get(n.id), inputs, graph: { panes: inner.panes, viewport: { x: 60, y: 80, zoom: 1 } }, output: only ?? null, rect: { x: 0, y: 0, width: 280 } };
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (!pane) {
|
|
217
|
+
standIns.add(n.type);
|
|
218
|
+
pane = evalPane({ ...base, code: [...prelude, standInCode({ tool: "Rivet", kind: n.type, title, settings: n.data, input: first })].join("\n") });
|
|
219
|
+
}
|
|
220
|
+
if (named(n) && (pane.type === "eval" || pane.type === "subgraph")) pane.outputs = outputsOf(n).map((o) => ({ name: o }));
|
|
221
|
+
if (n.node.isSplitRun && pane.type === "eval") {
|
|
222
|
+
pane.each = { on: true, input: "*", parallel: !n.node.isSplitSequential, max: Number(n.node.splitRunMax) || 0 };
|
|
223
|
+
} else if (n.node.isSplitRun) note("Split runs on nodes that aren't code in mallory (subgraphs, inputs) were turned off.");
|
|
224
|
+
if (n.node.disabled) note("Disabled nodes were imported as ordinary panes.");
|
|
225
|
+
panes.push(pane);
|
|
226
|
+
at.set(id, { x: n.x * 1.2, y: n.y * 1.2 });
|
|
227
|
+
}
|
|
228
|
+
panes.push(...extra);
|
|
229
|
+
layoutPanes(panes, at);
|
|
230
|
+
return { panes, outputIds: outputs, outputs: outputs.map((oid) => panes.find((p) => p.id === oid).name) };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const main = convert(mainId, [mainId]);
|
|
234
|
+
// Graphs the main graph never calls: kept, as subgraph panes below it.
|
|
235
|
+
const others = Object.keys(graphs).filter((g) => !used.has(g));
|
|
236
|
+
if (others.length) {
|
|
237
|
+
note(`${others.length} graph${others.length === 1 ? "" : "s"} the main graph doesn't call ${others.length === 1 ? "is" : "are"} below it, as subgraph pane${others.length === 1 ? "" : "s"}.`);
|
|
238
|
+
const bottom = Math.max(0, ...main.panes.map((p) => p.rect.y + 200));
|
|
239
|
+
const name = uniqueNamer(main.panes.map((p) => p.name));
|
|
240
|
+
others.forEach((g, i) => {
|
|
241
|
+
const inner = convert(g, [g]);
|
|
242
|
+
main.panes.push({ id: newId(), type: "subgraph", name: name(graphs[g]?.metadata?.name || "graph", "graph"), inputs: [], graph: { panes: inner.panes, viewport: { x: 60, y: 80, zoom: 1 } }, output: inner.outputIds.length === 1 ? inner.outputIds[0] : null, rect: { x: i * 320, y: bottom + 80, width: 280 } });
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
if (standIns.size) note(`Rivet nodes mallory has no counterpart for became stand-ins that pass their input through (their settings are in a comment): ${[...standIns].join(", ")}.`);
|
|
246
|
+
return newDoc(data.metadata?.title || graphs[mainId]?.metadata?.name || "Rivet project", main.panes);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export default {
|
|
250
|
+
id: "rivet",
|
|
251
|
+
title: "Rivet project",
|
|
252
|
+
description: "A .rivet-project: graphs become a canvas and its subgraphs; Text, Prompt, Code and Chat nodes become panes.",
|
|
253
|
+
extensions: [".rivet-project"],
|
|
254
|
+
mime: "application/yaml",
|
|
255
|
+
roundTrip: false,
|
|
256
|
+
lossy: ["Chat nodes ask Chrome's on-device model instead of Rivet's model", "only Text, Prompt, Code, Chat, Subgraph, Graph Input / Output and Comment nodes keep their behaviour; others (loops, matching, extraction…) become stand-ins", "attached data (Trivet tests), plugins and node colors"],
|
|
257
|
+
detect,
|
|
258
|
+
parse,
|
|
259
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Helpers the canvas formats share: a new canvas doc, pane builders, unique
|
|
2
|
+
// pane names, code-safe quoting, and a tidy layout for imported graphs.
|
|
3
|
+
// Pure: no DOM, so the formats load under Node (the headless runner, `mallory
|
|
4
|
+
// convert`) as well as on the page. Nothing here runs imported code.
|
|
5
|
+
import { FORMAT, VERSION, sanitizeName } from "../model/canvas.js";
|
|
6
|
+
import { tidy } from "../model/arrange.js";
|
|
7
|
+
|
|
8
|
+
/** The most text an import reads (a canvas or a workflow is far smaller). */
|
|
9
|
+
export const MAX_TEXT = 20 * 1024 * 1024;
|
|
10
|
+
|
|
11
|
+
/** An empty canvas doc to fill: no id (opening it gives it one), untrusted. */
|
|
12
|
+
export const newDoc = (name, panes = [], extra = {}) => ({ format: FORMAT, version: VERSION, name: String(name || "imported"), trusted: false, viewport: { x: 60, y: 80, zoom: 1 }, ...extra, panes });
|
|
13
|
+
|
|
14
|
+
/** Names every pane's code already has (src/runtime/worker-runtime.js; code may declare its own, which hides them, #724): panes aren't named them, so an import keeps them reachable. */
|
|
15
|
+
export const PANE_PARAMS = ["inputs", "console", "fetch", "secret", "html", "skip", "firstOf", "skipped", "env", "requireEnv"];
|
|
16
|
+
|
|
17
|
+
/** Unique pane names: `namer("my node")` -> "myNode", then "myNode2", … */
|
|
18
|
+
export function uniqueNamer(taken = []) {
|
|
19
|
+
const used = new Set([...PANE_PARAMS, ...taken]);
|
|
20
|
+
return (name, fallback = "value") => {
|
|
21
|
+
const base = sanitizeName(name, fallback);
|
|
22
|
+
let out = base;
|
|
23
|
+
for (let i = 2; used.has(out); i++) out = `${base}${i}`;
|
|
24
|
+
used.add(out);
|
|
25
|
+
return out;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Sequential pane ids with a prefix ("nr1", "nr2", …): deterministic, so an import is repeatable. */
|
|
30
|
+
export function idMaker(prefix) {
|
|
31
|
+
let n = 0;
|
|
32
|
+
return () => `${prefix}${++n}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** A JavaScript string literal. */
|
|
36
|
+
export const jsString = (s) => JSON.stringify(String(s ?? ""));
|
|
37
|
+
|
|
38
|
+
/** Text safe inside a JavaScript template literal (no `, no ${, no stray \). */
|
|
39
|
+
export const templateText = (s) => String(s ?? "").replace(/[\\`]/g, "\\$&").replace(/\$\{/g, "\\${");
|
|
40
|
+
|
|
41
|
+
/** A value as a JavaScript block comment (the original node's settings), safe to close. */
|
|
42
|
+
export function jsonComment(label, value) {
|
|
43
|
+
const json = JSON.stringify(value, null, 2) ?? "undefined";
|
|
44
|
+
return `/* ${label}\n${json.replace(/\*\//g, "*\\/")}\n*/`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Lines indented by two spaces (code wrapped in a function). */
|
|
48
|
+
export const indent = (code, pad = " ") => String(code ?? "").split("\n").map((l) => (l ? pad + l : l)).join("\n");
|
|
49
|
+
|
|
50
|
+
export const evalPane = ({ id, name, code, mode = "function", inputs = [], width = 320, ...extra }) => ({ id, type: "eval", name, code, mode, autorun: true, view: "auto", inputs, rect: { x: 0, y: 0, width }, ...extra });
|
|
51
|
+
export const textPane = ({ id, name = "", text, inputs = [], width = 300, ...extra }) => ({ id, type: "text", name, text: String(text ?? ""), inputs, rect: { x: 0, y: 0, width }, ...extra });
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Lay imported panes out with mallory's tidy arrangement (columns by wire
|
|
55
|
+
* depth), seeded with the source tool's positions (`at`: id -> { x, y }) so
|
|
56
|
+
* panes without wires keep their order. Heights are estimated from the code.
|
|
57
|
+
*/
|
|
58
|
+
export function layoutPanes(panes, at = new Map()) {
|
|
59
|
+
const height = (p) => Math.min(420, 70 + 18 * String(p.code ?? p.text ?? "").split("\n").length);
|
|
60
|
+
const rects = panes.map((p) => ({ id: p.id, x: at.get(p.id)?.x ?? 0, y: at.get(p.id)?.y ?? 0, width: p.rect?.width ?? 300, height: height(p), leftPad: 12 + 7 * Math.max(0, ...(p.inputs ?? []).map((i) => i.name.length)) }));
|
|
61
|
+
const ids = new Set(panes.map((p) => p.id));
|
|
62
|
+
const edges = panes.flatMap((p) => (p.inputs ?? []).filter((i) => ids.has(i.source)).map((i) => [i.source, p.id]));
|
|
63
|
+
const placed = tidy(rects, edges, { gapX: 80, gapY: 40 });
|
|
64
|
+
const left = Math.min(...[...placed.values()].map((p) => p.x));
|
|
65
|
+
const top = Math.min(...[...placed.values()].map((p) => p.y));
|
|
66
|
+
for (const p of panes) {
|
|
67
|
+
const xy = placed.get(p.id);
|
|
68
|
+
if (xy) p.rect = { ...p.rect, x: xy.x - left, y: xy.y - top };
|
|
69
|
+
}
|
|
70
|
+
return panes;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** A plain object (not an array, not null). */
|
|
74
|
+
export const isObject = (v) => Boolean(v) && typeof v === "object" && !Array.isArray(v);
|
|
75
|
+
|
|
76
|
+
/** Throw a readable error when `text` is too big to be a canvas. */
|
|
77
|
+
export function checkSize(text) {
|
|
78
|
+
if (typeof text !== "string") throw new Error("A canvas file is text.");
|
|
79
|
+
if (text.length > MAX_TEXT) throw new Error(`That file is too big to import (${Math.round(text.length / 1048576)} MB; the limit is ${MAX_TEXT / 1048576} MB).`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A stand-in for a node mallory has no counterpart for: an eval pane that passes
|
|
84
|
+
* its input through (`input`, a JavaScript expression), or skips when it has
|
|
85
|
+
* none, with the node's settings in a comment so nothing is lost.
|
|
86
|
+
*/
|
|
87
|
+
export function standInCode({ tool, kind, title, settings, input }) {
|
|
88
|
+
const what = `${tool}'s ${kind} node${title ? ` "${title}"` : ""}`;
|
|
89
|
+
return [
|
|
90
|
+
`// Stand-in for ${what}: mallory has no counterpart, so ${input ? "it passes its input through" : "it skips"}.`,
|
|
91
|
+
"// Replace this with code that does what the node did. Its settings:",
|
|
92
|
+
jsonComment("node", settings),
|
|
93
|
+
input ? `return ${input};` : `return skip(${jsString(`stand-in for ${what}`)});`,
|
|
94
|
+
].join("\n");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Literal JSON-able data as a JavaScript expression. */
|
|
98
|
+
export const literal = (value) => (value === undefined ? "undefined" : JSON.stringify(value, null, 2));
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// Where a canvas doc is mallory's own structure, and where it is the person's
|
|
2
|
+
// data. Mallory YAML (src/formats/yaml.js) sorts the keys of mallory's own
|
|
3
|
+
// objects, so a file diffs well whatever order a canvas was built in; every
|
|
4
|
+
// other object is copied exactly as it is, because its key order can mean
|
|
5
|
+
// something: a dataset's columns, a pinned reply, a form's fields, a
|
|
6
|
+
// subgraph's parameters, a JSON Schema's properties, a fallback value.
|
|
7
|
+
//
|
|
8
|
+
// A shape says what an object is:
|
|
9
|
+
// fields(children, order?) one of mallory's objects: its keys are sorted (by
|
|
10
|
+
// `order`, else the writer's rank); `children`
|
|
11
|
+
// names the keys whose values are mallory's objects too
|
|
12
|
+
// list(item) an array of `item`s
|
|
13
|
+
// map(entry, { sorted }) an object of keys -> `entry`s: mallory's ids (the
|
|
14
|
+
// library, the import lock) are sorted; the
|
|
15
|
+
// person's own keys (a repeater's templates) aren't
|
|
16
|
+
// Anything a shape doesn't name is data: copied as it is, nested objects
|
|
17
|
+
// included. So a field mallory adds later stays in its own order until it is
|
|
18
|
+
// listed here (test/formats.test.mjs checks that every object setting in
|
|
19
|
+
// the pane records' agent schemas is).
|
|
20
|
+
//
|
|
21
|
+
// Sources: Canvas#toJSON (src/model/canvas.js), validate() (src/persist.js)
|
|
22
|
+
// and the validators it calls, and the pane records' settings
|
|
23
|
+
// (src/panes/*.js agent.fields, src/panes/fields.js).
|
|
24
|
+
import { GALLERY_FIELDS } from "../example-meta.js";
|
|
25
|
+
|
|
26
|
+
/** One of mallory's objects: keys sorted; `children` are the keys holding mallory's objects. */
|
|
27
|
+
export const fields = (children = {}, order) => ({ kind: "fields", children, ...(order ? { order } : {}) });
|
|
28
|
+
/** An array of `item`s. */
|
|
29
|
+
export const list = (item) => ({ kind: "list", item });
|
|
30
|
+
/** An object of keys -> `entry`s; `sorted`: its keys are mallory's ids, written in order. */
|
|
31
|
+
export const map = (entry, { sorted = false } = {}) => ({ kind: "map", entry, sorted });
|
|
32
|
+
|
|
33
|
+
const plain = () => fields(); // mallory's object with only scalars, lists of scalars or data in it
|
|
34
|
+
// A presentation docking tree: pane IDs or recursive row/column/tabs containers.
|
|
35
|
+
const docking = fields();
|
|
36
|
+
docking.children.children = list(docking);
|
|
37
|
+
// A presentation layout's binary-split tree (the "bsp" layout): leaves and splits.
|
|
38
|
+
const split = fields();
|
|
39
|
+
split.children.first = split;
|
|
40
|
+
split.children.second = split;
|
|
41
|
+
|
|
42
|
+
// A wire: name, source, output, type (a type name or a JSON Schema: data), convert, description, operators, route.
|
|
43
|
+
const operator = plain(); // { op, expr, initial, n, ms, leading, trailing } (src/model/wire-ops.js)
|
|
44
|
+
const route = fields({ waypoints: list(plain()) }); // { style, waypoints: [{ x, y }], clearance } (src/model/wire-route.js)
|
|
45
|
+
const wire = fields({ operators: list(operator), route });
|
|
46
|
+
// A named output: name, type (data, as above), description (src/model/ports.js).
|
|
47
|
+
const output = plain();
|
|
48
|
+
// A media value's description (src/media/persist.js): kind, type, name, size, data, …
|
|
49
|
+
const media = plain();
|
|
50
|
+
// an agent or machine pane's router (src/agent/router.js): its chain of members, retry and cache
|
|
51
|
+
const routing = fields({ chain: list(fields({ price: plain() })), retry: plain(), cache: plain() });
|
|
52
|
+
// A linked subgraph's ref (src/model/links.js): canvas, name, hash, tag, package, version, pane, integrity.
|
|
53
|
+
const ref = plain();
|
|
54
|
+
|
|
55
|
+
// A test (src/tests/matchers.js, src/tests/metrics.js). Its `inputs`, `expect`
|
|
56
|
+
// and `pass` are maps of the person's names (panes, metrics) and values; a
|
|
57
|
+
// dataset's `rows`, a metric's `against` and an event's `payload` are data.
|
|
58
|
+
const test = fields({
|
|
59
|
+
dataset: plain(), // { rows | pane, parallel }
|
|
60
|
+
metrics: list(plain()), // { name, kind, pane, path, against, rubric, agent, … }
|
|
61
|
+
events: list(plain()), // { to, name, payload } or { channel, payload, scope, from }
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// A pane's settings (Canvas#toJSON spreads the content; the records' agent fields).
|
|
65
|
+
// A scalar setting needs no entry: `retain` ("summary": the run log keeps summaries of the pane and of its direct readers) is one.
|
|
66
|
+
// Not listed, so data: widget.value, pin.value, params, typed, valueType,
|
|
67
|
+
// outputSchema, recorded, onError.fallback, and any field mallory doesn't know.
|
|
68
|
+
const pane = fields({
|
|
69
|
+
rect: plain(),
|
|
70
|
+
inputs: list(wire),
|
|
71
|
+
outputs: list(output),
|
|
72
|
+
widget: fields({ spring: plain() }), // { kind, value, min, max, step, options, fields, spring }: value, options and fields are the person's; spring is { stiffness, damping, mass }
|
|
73
|
+
module: plain(),
|
|
74
|
+
rate: plain(),
|
|
75
|
+
profile: fields({ numberFormat: fields({}) }), // the profile view's settings (src/model/profile-settings.js); types and units are the person's column names, so they stay as written
|
|
76
|
+
plot: plain(), // the plot view's settings (src/model/plot-series.js): series and secondary are lists of the person's column names
|
|
77
|
+
mappings: list(fields({ mapping: fields({ parts: list(fields({ field: fields({ steps: list(plain()) }) })) }) })), // field mappings the field picker saved (src/model/saved-mapping.js): text, field paths, fallbacks
|
|
78
|
+
control: plain(), // an input pane's control metadata (src/model/controls.js): group, order, label, help, unit, advanced, hidden
|
|
79
|
+
onError: fields({ retry: plain() }),
|
|
80
|
+
each: fields({
|
|
81
|
+
batch: plain(),
|
|
82
|
+
removal: plain(),
|
|
83
|
+
expose: list(plain()),
|
|
84
|
+
templates: map(fields({ ref /* graph: below */ })), // keys: the person's template names
|
|
85
|
+
}),
|
|
86
|
+
receive: plain(),
|
|
87
|
+
strict: plain(), // an eval pane's strict settings (src/runtime/strict.js)
|
|
88
|
+
curves: list(fields({ transform: plain(), ivps: list(plain()) })), // a plot pane's curves (src/model/plot-settings.js): { id, kind, expr, expr2, min, max, label, color, visible, transform: { of, dx, dy, sx, sy, reflect } (W2), center, order, ivps: [{ x, y, v }] (W6) }
|
|
89
|
+
overlays: list(plain()), // a plot pane's overlays (src/model/plot-settings.js): { id, kind, curve, curve2, from, to, op, steps, label, color, visible }
|
|
90
|
+
points: list(plain()), // a plot pane's points on its curves (src/model/plot-settings.js): { id, curve, x }
|
|
91
|
+
annotations: list(plain()), // a plot pane's notes (src/model/plot-settings.js): { id, text } and an anchor: { x, y }, { curve, x } or { point }
|
|
92
|
+
range: plain(), // a plot pane's window: xMin, xMax, yMin, yMax
|
|
93
|
+
sliders: plain(), // a plot pane's sliders by variable name: { value, min, max, step }
|
|
94
|
+
http: plain(), // an http pane settings (src/model/http-tools.js): mode, to, compose, rules, send; a literal credential is refused, so none is saved
|
|
95
|
+
traffic: plain(), // a traffic pane's settings (src/model/traffic.js): max, how many entries it keeps; the entries, filters, selection and pins are never in the document
|
|
96
|
+
sample: plain(), // a sample pane's settings (src/model/sample-settings.js): source, name, font, and the numbers a take is cut by; the recording itself is never in the document
|
|
97
|
+
goals: fields({ proposals: list(fields({ set: fields({ addArtifact: plain() }) })) }), // a goals pane's settings (src/panes/goals.js): proposals, an agent's pending proposals; the goals themselves are the person's and are never in the document
|
|
98
|
+
verdict: fields({ routes: plain(), argChars: plain() }), // a verdict pane's settings (src/panes/verdict.js): routes, risky words and tools, argument limits
|
|
99
|
+
vm: plain(), // a vm pane's settings (src/model/vm-pane.js): memory, bridge; the image, the console and the shared folder are never in the document
|
|
100
|
+
peer: plain(), // a peer pane's settings (src/panes/peer.js): view; who is in the room is never in the document
|
|
101
|
+
ledger: fields({ proposals: list(fields({ draft: plain() })) }), // a ledger pane's settings (src/panes/ledger.js): view and the transactions an agent proposed (a draft: who, how much); balances and blocks are in this browser's own store, never here
|
|
102
|
+
meshInspect: plain(), // a mesh-inspect pane's settings (src/panes/mesh-inspect.js): view and alert rules
|
|
103
|
+
shares: plain(), // a shares pane's settings (src/panes/shares.js): view; the shares, their CIDs and grants are never in the document
|
|
104
|
+
tabs: plain(), // a tabs pane's settings (src/panes/tabs.js): view, "tabs" or "audit"; what the extension answered is never in the document
|
|
105
|
+
ws: plain(), // a ws-client pane's settings (src/model/ws-client.js): mode, url, protocols, keep, bytes, auto, proxy; a key is a secret placeholder, so none is saved. Frames and the send box are never in the document
|
|
106
|
+
score: plain(), // a score pane's Score (schemas/score.schema.json): data, its tracks and notes are the person's
|
|
107
|
+
selection: plain(), // a select pane's settings: by, pick, send, missing, show, x, y
|
|
108
|
+
persist: plain(),
|
|
109
|
+
switch: fields({ rules: list(plain()) }),
|
|
110
|
+
split: fields({ branches: list(plain()) }), // a weighted split (src/model/split.js)
|
|
111
|
+
timer: plain(),
|
|
112
|
+
device: plain(), // a device pane's kind, target pane, flipY, gamepad slot and dead zone (src/device/model.js)
|
|
113
|
+
inputLog: plain(), // an input log pane's mode, fps, loop and log (src/input/player.js): a log's entries are in frame order
|
|
114
|
+
actionMap: fields({ actions: list(plain()) }), // an action map pane's actions and their bindings, in the person's order (src/actions/map.js)
|
|
115
|
+
automation: fields({ lanes: list(fields({ curve: fields({ points: list(plain()) }) })), cues: list(plain()) }), // an automation pane's timeline (src/model/automation.js): a cue's value and notes are the person's data
|
|
116
|
+
waitFor: fields({ already: list(plain()), paths: list(fields({ where: list(plain()) })) }), // src/model/waits.js: conditions are { path, op, value | startPath }
|
|
117
|
+
// chart (src/model/statecharts.js) is not listed on purpose: a statechart machine is the person's data, and the order of its states, events and transitions can mean something (the first state, the first guard to hold)
|
|
118
|
+
codec: plain(), // a codec pane's format, schema (.proto text), message type, binary form and limits (src/codec/core.js)
|
|
119
|
+
gate: plain(), // a time-window gate (src/model/windows.js): zone, days, start, end, jitterMs, seed
|
|
120
|
+
decide: fields({ show: list(plain()), fields: list(fields({ options: list(plain()), on: list(plain()) })) }), // src/model/decisions.js
|
|
121
|
+
webhook: fields({ test: plain() }),
|
|
122
|
+
respond: plain(), // a respond pane's settings: stream, event
|
|
123
|
+
router: fields({ routes: list(plain()), test: plain() }), // a router's route table (src/model/router.js): the order of the routes is the person's
|
|
124
|
+
files: fields({ test: plain() }),
|
|
125
|
+
companion: plain(), // a companion pane's call and stand-in (src/model/companion-pane.js)
|
|
126
|
+
render: fields({ sim: plain(), engine: plain(), input: plain() }), // its transport settings; sim: a simulation's seed and checkpoint limits; engine: a driven engine's seed and checkpoint limits; input: keyboard and pointer (game)
|
|
127
|
+
uniforms: list(plain()), // a shader pane's typed uniforms (src/shader/model.js)
|
|
128
|
+
sprite: plain(), // an effects pane's pixel-art source: art (lines are the person's), colors, fps
|
|
129
|
+
gif: plain(), // an effects pane's GIF export settings: duration, fps, loop
|
|
130
|
+
channels: list(plain()), // a shader pane's named texture inputs (src/shader/channels.js)
|
|
131
|
+
buffers: list(fields({ channels: list(plain()) })), // a shader pane's Buffer A-D passes: { name, code, channels, format } (src/shader/passes.js)
|
|
132
|
+
shader: fields({ checkpoint: plain() }), // its size, clock and options; checkpoint: feedback's checkpoint limits
|
|
133
|
+
audio: fields({ record: plain() }), // render and transport settings; record: the live recording limits (src/audio/plan.js recordSettings)
|
|
134
|
+
dsp: fields({ modules: list(plain()), connections: list(plain()), controls: list(plain()), meters: list(plain()), voices: plain() }), // an audio pane's DSP patch (src/audio/patch.js): modules' params, options and ports are data
|
|
135
|
+
budget: plain(),
|
|
136
|
+
routing,
|
|
137
|
+
cloud: fields({}), // an agent pane's cloud provider settings (src/agent/cloud.js): plain strings, in the order the schema lists them
|
|
138
|
+
llm: fields({ routing }), // a machine pane's model (src/panes/machine.js): provider, model, seed, ...; routing is the router above
|
|
139
|
+
media,
|
|
140
|
+
pin: fields({ media }), // { value | skip | media, source, at }
|
|
141
|
+
ref,
|
|
142
|
+
// graph: a canvas (below)
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// A pane package's note (src/model/links.js, src/packages/package.js).
|
|
146
|
+
const packageNote = fields({ tests: list(test) });
|
|
147
|
+
|
|
148
|
+
// A group (src/model/groups.js): id, name, description, color, collapsed, disabled, panes.
|
|
149
|
+
const group = plain();
|
|
150
|
+
|
|
151
|
+
/** A canvas: the doc itself, a subgraph's graph, a library entry's graph, a repeater template's graph. */
|
|
152
|
+
export const canvas = fields({
|
|
153
|
+
viewport: plain(),
|
|
154
|
+
presentation: fields({ tree: docking, layout: fields({ tree: split, modifiers: list(plain()) }) }), // layout: { type, ratio, sizes, min, tree, modifiers, … } (src/model/presentation.js)
|
|
155
|
+
notebook: fields({ order: list(plain()) }), // the notebook view's pane order (src/model/notebook.js): { order: [pane ids] }
|
|
156
|
+
bookmarks: list(plain()), // viewport bookmarks (src/model/viewport-bookmarks.js): name, then x/y/zoom or target, slot
|
|
157
|
+
ink: list(fields({ anchor: plain() }, ["id", "kind", "tool", "layer", "color", "size", "pts", "text", "anchor", "note", "group", "agent", "locked"])), // freehand ink, shapes and text drawn on the canvas (src/model/ink.js): id, kind, color, size, pts (a string of points), …
|
|
158
|
+
inkGone: map(plain(), { sorted: true }), // the boxes of panes an agent deleted that the ink still names (src/model/ink-gone.js): { paneId: { x, y, width, height } }
|
|
159
|
+
presetBanks: list(plain()), // preset banks (src/model/preset-banks.js): name, targets, presets, morph
|
|
160
|
+
midi: plain(), // MIDI learn mappings (src/midi/mappings.js): { mappings, channel? }
|
|
161
|
+
serial: plain(), // serial settings and recorded fixtures (src/serial/config.js)
|
|
162
|
+
lesson: fields({ steps: list(fields({ check: plain() })) }), // a guided lesson (src/model/lessons.js): title, steps { id, target, check, text }
|
|
163
|
+
example: plain(), // { slug, version }
|
|
164
|
+
gallery: fields({}, GALLERY_FIELDS), // a built-in example's metadata (src/example-meta.js), in its documented order
|
|
165
|
+
panes: list(pane),
|
|
166
|
+
tests: list(test),
|
|
167
|
+
groups: list(group),
|
|
168
|
+
workspaces: list(plain()), // named pane sets (src/model/workspaces.js): name, panes, viewport
|
|
169
|
+
library: map(fields({ graph: undefined, package: packageNote }), { sorted: true }), // keyed by canvas id or pkg:<package>/<pane>
|
|
170
|
+
imports: map(plain(), { sorted: true }), // { "<spec>": { version, build } } (src/model/import-lock.js)
|
|
171
|
+
packageModules: map(plain(), { sorted: true }), // { "<package>@<version>": { name, source, integrity } } (src/packages/module.js)
|
|
172
|
+
runaway: plain(), // { perFrame }
|
|
173
|
+
package: packageNote,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// The canvases inside canvases.
|
|
177
|
+
pane.children.graph = canvas;
|
|
178
|
+
pane.children.each.children.templates.entry.children.graph = canvas;
|
|
179
|
+
canvas.children.library.entry.children.graph = canvas;
|
|
180
|
+
|
|
181
|
+
/** The shapes the formats write with. */
|
|
182
|
+
export const SHAPES = { canvas, pane, test, wire, output, group };
|