@jr2/orchestrator 0.6.0 → 0.7.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/console/components/app.ts +55 -15
- package/console/components/bottom-drawer.ts +259 -0
- package/console/components/drawer.ts +14 -6
- package/console/components/fleet.ts +36 -13
- package/console/components/machine-pane.ts +61 -5
- package/console/components/nav.ts +54 -8
- package/console/conversation.ts +161 -0
- package/console/login.ts +123 -0
- package/console/main.ts +600 -60
- package/console/store.ts +611 -64
- package/console/style.css +231 -0
- package/docs/agents-block.md +2 -2
- package/docs/concepts/agents-and-turns.md +86 -9
- package/docs/concepts/architecture.md +41 -28
- package/docs/concepts/callers-and-hooks.md +205 -0
- package/docs/concepts/charts.md +7 -5
- package/docs/concepts/composition.md +10 -1
- package/docs/concepts/converge.md +4 -2
- package/docs/concepts/durable-runs.md +43 -16
- package/docs/concepts/effects.md +50 -22
- package/docs/concepts/gates.md +95 -25
- package/docs/concepts/machines-and-workflows.md +5 -4
- package/docs/concepts/pools-and-sources.md +187 -11
- package/docs/concepts/secrets-and-trust.md +73 -33
- package/docs/concepts/the-menu.md +11 -0
- package/docs/concepts/workspaces.md +6 -5
- package/docs/get-started/a-model-decides.md +14 -13
- package/docs/get-started/an-agent-in-a-sandbox.md +43 -34
- package/docs/get-started/connect-a-model.md +1 -1
- package/docs/get-started/create-an-instance.md +17 -14
- package/docs/guides/add-tools-to-the-sandbox.md +55 -11
- package/docs/guides/answer-a-gate-from-a-forge.md +304 -0
- package/docs/guides/answer-a-gate.md +74 -37
- package/docs/guides/bind-open-parts.md +24 -8
- package/docs/guides/call-an-mcp-tool-from-a-machine.md +572 -0
- package/docs/guides/cancel-a-run.md +26 -16
- package/docs/guides/fix-a-failed-converge.md +18 -6
- package/docs/guides/give-a-caller-a-scope.md +203 -0
- package/docs/guides/give-an-agent-mcp-tools.md +422 -0
- package/docs/guides/iterate-on-a-machine-on-kind.md +10 -9
- package/docs/guides/let-an-agent-write-a-chart.md +9 -6
- package/docs/guides/look-inside-a-sandbox.md +101 -31
- package/docs/guides/open-the-console.md +63 -14
- package/docs/guides/read-a-conversation.md +225 -0
- package/docs/guides/run-a-chart-by-name.md +17 -16
- package/docs/guides/run-one-worker-per-item.md +15 -9
- package/docs/guides/set-an-agents-access-and-dials.md +2 -0
- package/docs/guides/start-a-run-for-each-alert.md +290 -0
- package/docs/guides/start-a-run-from-a-run.md +18 -16
- package/docs/guides/start-a-run.md +24 -18
- package/docs/guides/steer-an-agent.md +332 -0
- package/docs/guides/use-a-hosted-provider.md +1 -1
- package/docs/guides/watch-a-run.md +127 -121
- package/docs/guides/write-a-hook-kind.md +238 -0
- package/docs/guides/write-a-tool-as-an-mcp-server.md +351 -0
- package/docs/guides/write-a-workflow.md +17 -7
- package/docs/llms.txt +81 -15
- package/docs/reference/authoring-surface/agent.md +1 -1
- package/docs/reference/authoring-surface/answer.md +1 -1
- package/docs/reference/authoring-surface/arg.md +1 -1
- package/docs/reference/authoring-surface/basic.md +1 -1
- package/docs/reference/authoring-surface/bearer.md +1 -1
- package/docs/reference/authoring-surface/branchname.md +1 -1
- package/docs/reference/authoring-surface/carry.md +23 -0
- package/docs/reference/authoring-surface/chartschema.md +1 -1
- package/docs/reference/authoring-surface/chartschemafor.md +1 -1
- package/docs/reference/authoring-surface/command.md +1 -1
- package/docs/reference/authoring-surface/customize.md +4 -1
- package/docs/reference/authoring-surface/defineconfig.md +1 -1
- package/docs/reference/authoring-surface/defineevent.md +1 -1
- package/docs/reference/authoring-surface/dispatch.md +5 -4
- package/docs/reference/authoring-surface/fail.md +1 -1
- package/docs/reference/authoring-surface/file.md +1 -1
- package/docs/reference/authoring-surface/frompick.md +1 -1
- package/docs/reference/authoring-surface/gate.md +118 -0
- package/docs/reference/authoring-surface/group-agents.md +15 -0
- package/docs/reference/authoring-surface/group-charts.md +16 -0
- package/docs/reference/authoring-surface/group-composition.md +25 -0
- package/docs/reference/authoring-surface/group-config.md +17 -0
- package/docs/reference/authoring-surface/group-effects.md +48 -0
- package/docs/reference/authoring-surface/group-failure.md +13 -0
- package/docs/reference/authoring-surface/group-gates.md +16 -0
- package/docs/reference/authoring-surface/group-machine-and-events.md +15 -0
- package/docs/reference/authoring-surface/group-steering.md +12 -0
- package/docs/reference/authoring-surface/group-types-these-signatures-name.md +137 -0
- package/docs/reference/authoring-surface/group-workspaces-and-repos.md +15 -0
- package/docs/reference/authoring-surface/http.md +1 -1
- package/docs/reference/authoring-surface/isfailure.md +1 -1
- package/docs/reference/authoring-surface/isready.md +1 -1
- package/docs/reference/authoring-surface/jr2setup.md +13 -3
- package/docs/reference/authoring-surface/mcp.md +107 -0
- package/docs/reference/authoring-surface/open.md +5 -3
- package/docs/reference/authoring-surface/openbody.md +1 -1
- package/docs/reference/authoring-surface/paramsof.md +1 -1
- package/docs/reference/authoring-surface/pool.md +77 -9
- package/docs/reference/authoring-surface/push.md +1 -1
- package/docs/reference/authoring-surface/readyof.md +1 -1
- package/docs/reference/authoring-surface/reread.md +19 -0
- package/docs/reference/authoring-surface/secret.md +1 -1
- package/docs/reference/authoring-surface/sentby.md +1 -1
- package/docs/reference/authoring-surface/skip.md +22 -0
- package/docs/reference/authoring-surface/source.md +56 -1
- package/docs/reference/authoring-surface/steer.md +93 -0
- package/docs/reference/authoring-surface/text.md +1 -1
- package/docs/reference/authoring-surface/type-agentdefinition.md +14 -1
- package/docs/reference/authoring-surface/type-agentmcpserver.md +54 -0
- package/docs/reference/authoring-surface/type-anyframepath.md +1 -1
- package/docs/reference/authoring-surface/type-anyworktreepath.md +1 -1
- package/docs/reference/authoring-surface/type-binding.md +1 -1
- package/docs/reference/authoring-surface/type-caller.md +40 -0
- package/docs/reference/authoring-surface/type-callerrecord.md +32 -0
- package/docs/reference/authoring-surface/type-carry.md +19 -0
- package/docs/reference/authoring-surface/type-chainlink.md +3 -3
- package/docs/reference/authoring-surface/type-commandoutput.md +1 -1
- package/docs/reference/authoring-surface/type-customize.md +16 -1
- package/docs/reference/authoring-surface/type-delivered.md +17 -0
- package/docs/reference/authoring-surface/type-deliveredevent.md +18 -0
- package/docs/reference/authoring-surface/type-dispatchdefinition.md +4 -3
- package/docs/reference/authoring-surface/type-dispatchoutput.md +1 -1
- package/docs/reference/authoring-surface/type-effectbinding.md +12 -2
- package/docs/reference/authoring-surface/type-framepath.md +1 -1
- package/docs/reference/authoring-surface/type-gatebinding.md +15 -0
- package/docs/reference/authoring-surface/type-gatehooks.md +12 -0
- package/docs/reference/authoring-surface/type-gatelook.md +37 -0
- package/docs/reference/authoring-surface/type-gateoutcome.md +32 -0
- package/docs/reference/authoring-surface/type-gatereply.md +19 -0
- package/docs/reference/authoring-surface/type-gateslot.md +21 -0
- package/docs/reference/authoring-surface/type-gateslotinput.md +13 -0
- package/docs/reference/authoring-surface/type-gateslotparts.md +18 -0
- package/docs/reference/authoring-surface/type-gateslots.md +12 -0
- package/docs/reference/authoring-surface/type-gatetypesat.md +13 -0
- package/docs/reference/authoring-surface/type-hostinjectedinput.md +1 -1
- package/docs/reference/authoring-surface/type-httpoutput.md +1 -1
- package/docs/reference/authoring-surface/type-jr2config.md +37 -2
- package/docs/reference/authoring-surface/type-lateroutcome.md +1 -1
- package/docs/reference/authoring-surface/type-lends.md +5 -1
- package/docs/reference/authoring-surface/type-lookoutput.md +14 -0
- package/docs/reference/authoring-surface/type-mcpcalloutput.md +78 -0
- package/docs/reference/authoring-surface/type-mcpnotreturned.md +42 -0
- package/docs/reference/authoring-surface/type-mcpoptions.md +47 -0
- package/docs/reference/authoring-surface/type-mcpoutput.md +50 -0
- package/docs/reference/authoring-surface/type-mcpreadoutput.md +53 -0
- package/docs/reference/authoring-surface/type-mcpremoteserver.md +50 -0
- package/docs/reference/authoring-surface/type-mcpserver.md +41 -0
- package/docs/reference/authoring-surface/type-mcpstdioserver.md +42 -0
- package/docs/reference/authoring-surface/type-namedsecret.md +4 -4
- package/docs/reference/authoring-surface/type-openbodydeclaration.md +1 -1
- package/docs/reference/authoring-surface/type-openbodyoutput.md +1 -1
- package/docs/reference/authoring-surface/type-poolnextinput.md +1 -1
- package/docs/reference/authoring-surface/type-poolspec.md +11 -6
- package/docs/reference/authoring-surface/type-pushoutput.md +1 -1
- package/docs/reference/authoring-surface/type-pushsourcespec.md +38 -0
- package/docs/reference/authoring-surface/type-readsourcespec.md +47 -0
- package/docs/reference/authoring-surface/type-reposlot.md +1 -1
- package/docs/reference/authoring-surface/type-reread.md +18 -0
- package/docs/reference/authoring-surface/type-runsconfig.md +41 -0
- package/docs/reference/authoring-surface/type-sender.md +26 -1
- package/docs/reference/authoring-surface/type-sendercallerfield.md +14 -0
- package/docs/reference/authoring-surface/type-size.md +1 -1
- package/docs/reference/authoring-surface/type-skip.md +19 -0
- package/docs/reference/authoring-surface/type-sourcehooks.md +23 -0
- package/docs/reference/authoring-surface/type-sourcein.md +25 -0
- package/docs/reference/authoring-surface/type-sourcereply.md +18 -0
- package/docs/reference/authoring-surface/type-sourcespec.md +16 -7
- package/docs/reference/authoring-surface/type-sourceverdict.md +49 -0
- package/docs/reference/authoring-surface/type-standingpoolmachine.md +12 -0
- package/docs/reference/authoring-surface/type-standingpoolspec.md +51 -0
- package/docs/reference/authoring-surface/type-steerargs.md +20 -0
- package/docs/reference/authoring-surface/type-thinkinglevel.md +1 -1
- package/docs/reference/authoring-surface/type-usercontainer.md +1 -1
- package/docs/reference/authoring-surface/type-workspaced.md +1 -1
- package/docs/reference/authoring-surface/type-worktreefound.md +3 -3
- package/docs/reference/authoring-surface/type-worktreeinput.md +1 -1
- package/docs/reference/authoring-surface/type-worktreeoptions.md +1 -1
- package/docs/reference/authoring-surface/type-worktreeoutput.md +1 -1
- package/docs/reference/authoring-surface/type-worktreepath.md +1 -1
- package/docs/reference/authoring-surface/type-worktreeready.md +1 -1
- package/docs/reference/authoring-surface/type-worktreerefused.md +4 -4
- package/docs/reference/authoring-surface/workspace.md +1 -1
- package/docs/reference/authoring-surface/worktree.md +1 -1
- package/docs/reference/authoring-surface.md +88 -167
- package/docs/reference/cli.md +413 -74
- package/docs/reference/config.md +235 -2
- package/docs/reference/decisions/0002-duplex-streaming-actor.md +71 -11
- package/docs/reference/decisions/0005-sandbox-pod-composition.md +14 -10
- package/docs/reference/decisions/0006-agent-control-surface.md +4 -4
- package/docs/reference/decisions/0007-durable-machine-state.md +1 -1
- package/docs/reference/decisions/0009-cli-and-instance-interface.md +150 -49
- package/docs/reference/decisions/0010-bdd-acceptance-tests.md +5 -3
- package/docs/reference/decisions/0011-workflow-defined-events.md +256 -12
- package/docs/reference/decisions/0012-workspace-wrapper-machine.md +9 -2
- package/docs/reference/decisions/0013-the-agent-reaches-its-machine-through-a-container-it-cannot-read.md +20 -14
- package/docs/reference/decisions/0014-observation-is-open-run-state-is-not.md +53 -27
- package/docs/reference/decisions/0015-authoring-surface-absorbs-the-mechanism.md +18 -14
- package/docs/reference/decisions/0017-pool-over-a-source-port.md +226 -12
- package/docs/reference/decisions/0018-instance-agents-are-definitions-jr2-assembles-the-harness.md +15 -7
- package/docs/reference/decisions/0019-one-converging-command-against-the-current-context.md +32 -18
- package/docs/reference/decisions/0021-workspace-continuity-is-a-lease-that-answers-back.md +14 -1
- package/docs/reference/decisions/0022-observation-is-a-level-triggered-feed.md +4 -4
- package/docs/reference/decisions/0023-the-harness-prints-the-conversation.md +116 -34
- package/docs/reference/decisions/0024-an-agents-turn-ends-with-the-state-that-asked-for-it.md +38 -37
- package/docs/reference/decisions/0025-cancel-ends-a-run-stop-parks-it.md +10 -5
- package/docs/reference/decisions/0027-the-harness-is-jr2s-own-server-flue-retires-the-wire-stays.md +7 -6
- package/docs/reference/decisions/0028-what-an-agent-may-do-to-the-workspace-is-part-of-its-definition.md +23 -7
- package/docs/reference/decisions/0029-a-menu-is-fixed-for-a-conversation-and-a-turn-is-told-its-allowed-picks.md +18 -10
- package/docs/reference/decisions/0030-a-snapshot-names-the-machine-it-was-written-under.md +3 -2
- package/docs/reference/decisions/0031-menu-only-agents-run-on-the-instance-harness.md +23 -18
- package/docs/reference/decisions/0032-the-console-unlocks-with-a-callers-credential.md +101 -0
- package/docs/reference/decisions/0033-a-machine-declares-the-input-that-starts-it.md +4 -3
- package/docs/reference/decisions/0034-the-console-renders-with-preact-and-the-server-erases-the-types.md +6 -6
- package/docs/reference/decisions/0037-an-instance-builds-its-sandbox-images-jr2-injects-the-harness.md +5 -4
- package/docs/reference/decisions/0049-a-machine-carries-its-parts-and-composes-by-invoke.md +19 -19
- package/docs/reference/decisions/0050-what-code-names-config-declares-what-the-cli-names-discovery-finds.md +6 -1
- package/docs/reference/decisions/0054-the-kit-ships-machines-and-a-shipped-machine-leaves-its-parts-open.md +55 -40
- package/docs/reference/decisions/0055-a-release-is-a-pushed-tag-and-the-publish-guard-is-the-credential.md +14 -13
- package/docs/reference/decisions/0057-a-turn-is-its-frame-its-dials-and-whether-it-continues.md +7 -0
- package/docs/reference/decisions/0058-a-harness-answers-the-orchestrator-alone.md +13 -7
- package/docs/reference/decisions/0059-a-harness-holds-stand-ins-and-the-custodian-holds-the-keys.md +38 -30
- package/docs/reference/decisions/0062-jr2-briefs-the-agent-on-its-seat-never-on-its-task.md +64 -17
- package/docs/reference/decisions/0063-the-orchestrator-watches-the-cluster.md +2 -1
- package/docs/reference/decisions/0064-a-workspace-waits-for-capacity.md +2 -2
- package/docs/reference/decisions/0065-a-persist-survives-a-crash-and-history-is-kept-for-a-set-time.md +109 -0
- package/docs/reference/decisions/0066-a-model-tier-runs-a-real-model-and-a-change-to-what-it-reads-runs-the-tier.md +51 -23
- package/docs/reference/decisions/0067-an-effect-is-an-actor-slot-and-runs-at-most-once-unless-marked-idempotent.md +94 -54
- package/docs/reference/decisions/0068-an-effector-holds-an-effects-secrets-and-signs-its-wire.md +101 -47
- package/docs/reference/decisions/0069-the-orchestrator-is-a-kit-image-and-an-instance-publishes-its-assembly.md +32 -9
- package/docs/reference/decisions/0070-a-machine-lends-its-parts-to-a-chart.md +17 -13
- package/docs/reference/decisions/0071-a-run-starts-a-run-through-a-dispatch-effect.md +56 -30
- package/docs/reference/decisions/0072-the-docs-ship-inside-the-kit-and-an-instances-agents-md-indexes-them.md +35 -25
- package/docs/reference/decisions/0075-a-machine-cuts-a-worktree-and-the-workspace-only-clones.md +4 -3
- package/docs/reference/decisions/0076-an-agents-control-credential-lives-only-where-no-workspace-code-runs.md +37 -10
- package/docs/reference/decisions/0078-a-caller-comes-from-one-authenticator-seam-and-acts-within-its-scopes.md +285 -0
- package/docs/reference/decisions/0079-an-agent-holds-mcp-tools-a-machine-calls-them-as-an-effect-and-the-machine-is-the-approval.md +198 -0
- package/docs/reference/decisions.md +6 -4
- package/docs/reference/glossary.md +96 -42
- package/docs/reference/hooks.md +1077 -0
- package/docs/reference/http-api.md +976 -149
- package/docs/why.md +2 -1
- package/package.json +10 -3
- package/src/actor.ts +36 -10
- package/src/agent.ts +50 -0
- package/src/assembly-checks.ts +530 -4
- package/src/callers.ts +245 -0
- package/src/chart.ts +52 -7
- package/src/config.ts +550 -1
- package/src/conversations.ts +453 -0
- package/src/custodian.ts +8 -2
- package/src/customize.ts +143 -4
- package/src/dispatch-effect.ts +142 -26
- package/src/durability.ts +2 -0
- package/src/duration.ts +20 -0
- package/src/effect-checks.ts +2 -1
- package/src/effect.ts +60 -7
- package/src/effector-wire.ts +272 -27
- package/src/gate-brand.ts +16 -0
- package/src/gate.ts +634 -48
- package/src/harness-client.ts +10 -4
- package/src/held-secrets.ts +72 -23
- package/src/holds.ts +2 -2
- package/src/hook-kinds/discord.ts +92 -0
- package/src/hook-kinds/door.ts +107 -0
- package/src/hook-kinds/github.ts +89 -0
- package/src/hook-kinds/gitlab.ts +72 -0
- package/src/hook-kinds/hook.ts +7 -0
- package/src/hook-kinds/index.ts +465 -0
- package/src/hook-kinds/slack.ts +151 -0
- package/src/hook-kinds/webhook.ts +113 -0
- package/src/hooks.ts +506 -0
- package/src/http-effect.ts +76 -38
- package/src/http.ts +889 -94
- package/src/index.ts +16 -5
- package/src/instance.ts +196 -26
- package/src/internal.ts +22 -3
- package/src/machine-doc.ts +26 -1
- package/src/mcp-effect.ts +424 -0
- package/src/mount-digest.ts +41 -7
- package/src/names.ts +64 -2
- package/src/notices.ts +138 -10
- package/src/open-body.ts +25 -11
- package/src/open-effect.ts +17 -4
- package/src/open.ts +4 -2
- package/src/parts.ts +87 -9
- package/src/party.ts +2 -1
- package/src/pick.ts +2 -2
- package/src/pool.ts +1142 -163
- package/src/registration.ts +203 -13
- package/src/run-host.ts +1509 -171
- package/src/run-list.ts +191 -0
- package/src/sandbox-kube.ts +53 -5
- package/src/secret-placement.ts +239 -33
- package/src/server.ts +53 -4
- package/src/setup.ts +72 -32
- package/src/snapshot-store.ts +565 -48
- package/src/steer.ts +111 -0
- package/src/stub-harness.ts +6 -2
- package/src/tokens.ts +263 -22
- package/src/wire.ts +17 -0
- package/src/workspace.ts +50 -6
- package/src/worktree.ts +3 -3
- package/docs/reference/decisions/0032-the-console-unlocks-with-the-instance-token.md +0 -61
- package/docs/reference/decisions/0065-a-persist-survives-a-crash-and-history-is-a-week.md +0 -65
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# jr2
|
|
2
2
|
|
|
3
|
-
> A kit for agentic workflows as xstate Machines, run on Kubernetes. These are the docs of Kit version 0.
|
|
3
|
+
> A kit for agentic workflows as xstate Machines, run on Kubernetes. These are the docs of Kit version 0.7.0, as plain Markdown.
|
|
4
4
|
|
|
5
5
|
## Home
|
|
6
6
|
|
|
@@ -24,14 +24,15 @@
|
|
|
24
24
|
- [Machines and Workflows](concepts/machines-and-workflows.md): What a Machine and a Workflow are, the door of a run, the Vocabulary, and Emits.
|
|
25
25
|
- [Agents and Turns](concepts/agents-and-turns.md): What an Agent is, what one Turn of an Agent holds, how a Turn ends, and what jr2 does when a Turn fails.
|
|
26
26
|
- [The Menu](concepts/the-menu.md): How an Agent picks from the events that its Machine takes, and how the Machine decides what each pick does.
|
|
27
|
-
- [Gates](concepts/gates.md): How a run waits for an event from a person, the CLI, the Console, a
|
|
28
|
-
- [Effects](concepts/effects.md): How a Machine runs a command, calls a URL, pushes a branch or starts a run
|
|
27
|
+
- [Gates](concepts/gates.md): How a run waits for an event from a person, the CLI, the Console, a Hook or a CI job.
|
|
28
|
+
- [Effects](concepts/effects.md): How a Machine runs a command, calls a URL or an MCP tool, pushes a branch or starts a run.
|
|
29
29
|
- [Workspaces](concepts/workspaces.md): How a Workflow gets a Sandbox with a git Worktree or a shared folder, and how long it keeps it.
|
|
30
30
|
- [Composition](concepts/composition.md): How a Machine composes Machines that you import, and how you bind the parts that they leave Open.
|
|
31
31
|
- [Charts](concepts/charts.md): How an Agent writes a Machine as data at run time, which cannot reach the process of the Orchestrator.
|
|
32
|
-
- [Pools and Sources](concepts/pools-and-sources.md): How a Pool runs one worker
|
|
32
|
+
- [Pools and Sources](concepts/pools-and-sources.md): How a Pool runs one worker for each item of a Source, how a Hook brings items, and how its run ends.
|
|
33
33
|
- [Architecture](concepts/architecture.md): What runs on your computer, in the cluster and in a Sandbox, and which part does what.
|
|
34
34
|
- [Secrets and trust](concepts/secrets-and-trust.md): Where jr2 keeps each credential, which tokens it makes, and what a caller can see and do without one.
|
|
35
|
+
- [Callers and Hooks](concepts/callers-and-hooks.md): Who acts on an Instance from outside its Machines, what each one may do, and what a Hook does.
|
|
35
36
|
- [Converge](concepts/converge.md): What jr2 up makes in the cluster from your Instance folder, and the Assembly that it publishes.
|
|
36
37
|
- [Durable runs](concepts/durable-runs.md): How a run survives a restart of the Orchestrator, what ends it, and how long jr2 keeps a run that ended.
|
|
37
38
|
|
|
@@ -39,13 +40,17 @@
|
|
|
39
40
|
|
|
40
41
|
- [Start a run](guides/start-a-run.md): Start a run of a Workflow from the CLI, from the Console, or with a call to the HTTP API.
|
|
41
42
|
- [Answer a Gate](guides/answer-a-gate.md): Send an event to an open Gate of a run, from the CLI, the Console, a webhook handler or a CI job.
|
|
43
|
+
- [Answer a Gate from a forge](guides/answer-a-gate-from-a-forge.md): Make a Gate that a review on GitHub or GitLab answers, and that looks for the review it waits for.
|
|
44
|
+
- [Steer an Agent](guides/steer-an-agent.md): Send free text to one Agent of a live run, from the CLI, from HTTP, or from the Machine itself.
|
|
42
45
|
- [Watch a run](guides/watch-a-run.md): See where a run is and what its Agents do: in the CLI, in the Console, and in the pod log.
|
|
46
|
+
- [Read a conversation](guides/read-a-conversation.md): Read what an Agent said and did in a run, live or after the run ended, with jr2 logs or the Console.
|
|
43
47
|
- [Look inside a Sandbox](guides/look-inside-a-sandbox.md): Open a shell in the Sandbox of a run, and read the branch that its Agent works on.
|
|
44
48
|
- [Cancel a run](guides/cancel-a-run.md): End a live run with CANCEL, and delete its Sandboxes or keep them to look inside.
|
|
45
|
-
- [Open the Console](guides/open-the-console.md): Forward the port of the Orchestrator, open the Console, and unlock it with
|
|
49
|
+
- [Open the Console](guides/open-the-console.md): Forward the port of the Orchestrator, open the Console, and unlock it with a token or a login.
|
|
46
50
|
- [Use a local model](guides/use-a-local-model.md): Connect your Agents to a model on an OpenAI-compatible endpoint, with or without TLS and a key.
|
|
47
51
|
- [Use a hosted provider or a gateway](guides/use-a-hosted-provider.md): Give your Agents a model from a hosted provider, directly or through a gateway.
|
|
48
52
|
- [Give the cluster git credentials](guides/give-the-cluster-git-credentials.md): Give the cluster a token or an ssh key to clone and push your Repos, and choose which Repos a run can name.
|
|
53
|
+
- [Give a Caller a scope](guides/give-a-caller-a-scope.md): Make a named token for a CI job or a bridge, give it only the scopes that it needs, and rotate it.
|
|
49
54
|
- [Move from kind to a shared cluster](guides/move-from-kind-to-a-shared-cluster.md): Converge an Instance into a shared cluster, with a registry, Sandbox nodes, priority classes and a quota.
|
|
50
55
|
- [Mirror the Kit images](guides/mirror-the-kit-images.md): Copy the Kit images and the Pinned image into your own registry, and make the cluster pull them from there.
|
|
51
56
|
- [Upgrade the Kit version](guides/upgrade-the-kit-version.md): Move an Instance to a new Kit version. jr2 up converges it and updates the jr2 block in AGENTS.md.
|
|
@@ -55,13 +60,18 @@
|
|
|
55
60
|
- [Write a Workflow](guides/write-a-workflow.md): Write a module in workflows/ that exports a Machine, with the input that starts a run and its Vocabulary.
|
|
56
61
|
- [Bind a shipped Machine's Open parts](guides/bind-open-parts.md): Register a Machine from a package as a Workflow, and bind the parts that it leaves Open with customize().
|
|
57
62
|
- [Set an Agent's access and Dials](guides/set-an-agents-access-and-dials.md): Choose what an Agent can do to the Workspace, and set the Dials and continue of one Turn.
|
|
63
|
+
- [Give an Agent MCP tools](guides/give-an-agent-mcp-tools.md): Declare MCP servers in jr2.config.ts, and give an Agent the tools that it can call on each server.
|
|
58
64
|
- [Cut a Worktree](guides/cut-a-worktree.md): Make a Worktree with worktree(), choose what a cut refuses, and remove a Worktree.
|
|
59
65
|
- [Run a command or call a URL with an Effect](guides/run-a-command-or-call-a-url.md): Run a program or call a URL as an Effect, give it input from a pick, and route on its output.
|
|
66
|
+
- [Call an MCP tool from a Machine](guides/call-an-mcp-tool-from-a-machine.md): Call a tool of an MCP server as an Effect, after the approval of a person, and route on its output.
|
|
60
67
|
- [Push and sign a branch](guides/push-and-sign-a-branch.md): Push the branch of a Worktree, and sign its commits with a key that the Agent never reads.
|
|
61
68
|
- [Start a run from a run](guides/start-a-run-from-a-run.md): Use a dispatch Effect to start a run of a Workflow from a Machine, in this Instance or in a different one.
|
|
62
69
|
- [Add tools to the Sandbox](guides/add-tools-to-the-sandbox.md): Put the programs that your Agents use into the Sandbox Image, or run a service in a User Container.
|
|
70
|
+
- [Write a tool as an MCP server](guides/write-a-tool-as-an-mcp-server.md): Write a small MCP server in TypeScript, put it in the Sandbox Image, and give its tool to an Agent.
|
|
63
71
|
- [Size a Workspace](guides/size-a-workspace.md): Give a Workspace the memory and cpu that its Sandbox needs, and see how jr2 divides them in the pod.
|
|
64
72
|
- [Run one worker per item](guides/run-one-worker-per-item.md): Make a Pool that runs one worker Machine for each item that a Source gives, and run it.
|
|
73
|
+
- [Start a run for each alert](guides/start-a-run-for-each-alert.md): Make a standing Pool that starts one run for each alert that an outside service sends to a Hook.
|
|
74
|
+
- [Write a Hook kind](guides/write-a-hook-kind.md): Write the kind of a service that jr2 ships no kind for, declare a Hook of it, and hear it at a Gate.
|
|
65
75
|
- [Publish a Machine as an npm package](guides/publish-a-machine-as-an-npm-package.md): Ship a Machine in an npm package that names the Kit as a peer, and register it in an Instance.
|
|
66
76
|
- [Let an Agent write a Chart](guides/let-an-agent-write-a-chart.md): Write a Chart wrapper whose planner Agent writes a Chart, runs it, and corrects it.
|
|
67
77
|
- [Run a Chart by name](guides/run-a-chart-by-name.md): Keep a Chart under a name, as a Chart file or a runtime Chart, and run it with jr2 run.
|
|
@@ -69,14 +79,31 @@
|
|
|
69
79
|
## Reference
|
|
70
80
|
|
|
71
81
|
- [Authoring surface](reference/authoring-surface.md): Every name that @jr2/orchestrator exports from its root, by group, with a link to its page: its signature, its TSDoc, and an example.
|
|
82
|
+
- [Authoring surface: Machine and events](reference/authoring-surface/group-machine-and-events.md): The setup a workflow writes its Machine with, the events its parties send, and the guard that makes a writing decline other senders (ADR-0011, ADR-0015).
|
|
83
|
+
- [Authoring surface: Gates](reference/authoring-surface/group-gates.md): A Gate slot hears a Hook (ADR-0011).
|
|
84
|
+
- [Authoring surface: Failure](reference/authoring-surface/group-failure.md): The Part a Machine invokes to fail its run, and the guard that tells a Failure from a defect in an `onError` (ADR-0073).
|
|
85
|
+
- [Authoring surface: Agents](reference/authoring-surface/group-agents.md): An Agent slot and the definition it carries (ADR-0028, ADR-0049).
|
|
86
|
+
- [Authoring surface: Workspaces and Repos](reference/authoring-surface/group-workspaces-and-repos.md): A Sandbox and the Repo Slots it binds (ADR-0012, ADR-0051).
|
|
87
|
+
- [Authoring surface: Effects](reference/authoring-surface/group-effects.md): Work a Machine does outside itself, as an actor slot (ADR-0067, ADR-0068, ADR-0071, ADR-0079), and what an author writes between a pick and that work.
|
|
88
|
+
- [Authoring surface: Steering](reference/authoring-surface/group-steering.md): The Machine's free text to one of its Agents, which the Agent hears once (ADR-0002).
|
|
89
|
+
- [Authoring surface: Composition](reference/authoring-surface/group-composition.md): A part left Open, a Machine's parts retuned, a Pool over a Source (ADR-0017, ADR-0049, ADR-0054, ADR-0060).
|
|
90
|
+
- [Authoring surface: Charts](reference/authoring-surface/group-charts.md): The Open body a Chart wrapper places in `actors`, and the grammar a planner's pick declares, whole or narrowed to one wrapper (ADR-0070).
|
|
91
|
+
- [Authoring surface: Config](reference/authoring-surface/group-config.md): `jr2.config.ts`, the deployment facts a Machine cannot carry (ADR-0050).
|
|
92
|
+
- [Authoring surface: Types these signatures name](reference/authoring-surface/group-types-these-signatures-name.md): The signature of an export, or a type here, names each of these types.
|
|
72
93
|
- [`defineEvent`](reference/authoring-surface/defineevent.md): Define one workflow event: an event that an Agent or the caller of a Gate may send into your Machine.
|
|
73
94
|
- [`jr2Setup`](reference/authoring-surface/jr2setup.md): Set up a Machine that takes workflow events: the jr2 form of xstate's `setup()`.
|
|
74
95
|
- [`sentBy`](reference/authoring-surface/sentby.md): A guard that is true for an event that one party sent, and false for an event that another party sent: `guard: sentBy("coder")`.
|
|
75
96
|
- [`HostInjectedInput`](reference/authoring-surface/type-hostinjectedinput.md): The fields that jr2 adds to the input of the Machine that a run starts, beside the input that the caller sent.
|
|
97
|
+
- [`gate`](reference/authoring-surface/gate.md): The Gate: an input that a run waits for from outside the run (ADR-0011).
|
|
98
|
+
- [`Delivered`](reference/authoring-surface/type-delivered.md): One plain event of a list of defs: `{ type: "approve", by }`.
|
|
99
|
+
- [`GateLook`](reference/authoring-surface/type-gatelook.md): A Gate's read of the fact that it waits for (ADR-0011).
|
|
100
|
+
- [`GateOutcome`](reference/authoring-surface/type-gateoutcome.md): What a delivery did at one open Gate.
|
|
101
|
+
- [`GateReply`](reference/authoring-surface/type-gatereply.md): The text that the person who acted reads.
|
|
76
102
|
- [`fail`](reference/authoring-surface/fail.md): Fail the run: the Part a Machine invokes to end work that did not succeed.
|
|
77
103
|
- [`isFailure`](reference/authoring-surface/isfailure.md): Is this error a Failure, which a state invoked `fail` to make?
|
|
78
104
|
- [`agent`](reference/authoring-surface/agent.md): Make an Agent: an actor slot that runs one Turn of a model each time a state invokes it.
|
|
79
105
|
- [`AgentDefinition`](reference/authoring-surface/type-agentdefinition.md): An Agent's definition: which model it runs, its instructions, and what it may do to the Workspace.
|
|
106
|
+
- [`AgentMcpServer`](reference/authoring-surface/type-agentmcpserver.md): One MCP server that an Agent uses, and the tools that it may call there.
|
|
80
107
|
- [`ThinkingLevel`](reference/authoring-surface/type-thinkinglevel.md): How hard the model thinks before it answers: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"` or `"xhigh"`.
|
|
81
108
|
- [`workspace`](reference/authoring-surface/workspace.md): Run a body Machine in a Sandbox: a pod of its own, with a clone of each Repo Slot.
|
|
82
109
|
- [`Workspaced`](reference/authoring-surface/type-workspaced.md): The input of a `workspace()` body: the run input, plus `workspace`, the handles that the Workspace adds (`workspace.repos`, the folder of each Repo Slot).
|
|
@@ -102,27 +129,38 @@
|
|
|
102
129
|
- [`AnyFramePath`](reference/authoring-surface/type-anyframepath.md): A Turn's Frame: a Worktree, or `/work`, stated.
|
|
103
130
|
- [`AnyWorktreePath`](reference/authoring-surface/type-anyworktreepath.md): A Worktree of any Repo Slot: what a kit factory states, before `jr2Setup` narrows it to the slots of the body.
|
|
104
131
|
- [`FramePath`](reference/authoring-surface/type-framepath.md): A Turn's Frame in a Workspace with the Repo Slots `S`.
|
|
105
|
-
- [`WorktreeFound`](reference/authoring-surface/type-worktreefound.md): What a cut found
|
|
132
|
+
- [`WorktreeFound`](reference/authoring-surface/type-worktreefound.md): What a cut found.
|
|
106
133
|
- [`WorktreeInput`](reference/authoring-surface/type-worktreeinput.md): The input of a `worktree()`: a branch Worktree, or a detached one.
|
|
107
134
|
- [`WorktreeOptions`](reference/authoring-surface/type-worktreeoptions.md): The options of `worktree()`.
|
|
108
135
|
- [`WorktreeOutput`](reference/authoring-surface/type-worktreeoutput.md): The output of a `worktree()`.
|
|
109
136
|
- [`WorktreePath`](reference/authoring-surface/type-worktreepath.md): A Worktree of the Repo Slots `S`.
|
|
110
137
|
- [`WorktreeReady`](reference/authoring-surface/type-worktreeready.md): Type, an export of @jr2/orchestrator.
|
|
111
|
-
- [`WorktreeRefused`](reference/authoring-surface/type-worktreerefused.md): No Worktree, and nothing changed
|
|
138
|
+
- [`WorktreeRefused`](reference/authoring-surface/type-worktreerefused.md): No Worktree, and nothing changed.
|
|
112
139
|
- [`dispatch`](reference/authoring-surface/dispatch.md): Make a `dispatch` Effect: it starts a run of a Workflow.
|
|
113
140
|
- [`DispatchOutput`](reference/authoring-surface/type-dispatchoutput.md): The output of a `dispatch` Effect.
|
|
141
|
+
- [`mcp`](reference/authoring-surface/mcp.md): The `mcp` Effects (ADR-0067, ADR-0079): `mcp.call(server, tool, { input })` calls a tool, `mcp.read(server, uri)` reads a resource, and `mcp.prompt(server, name, { input })` gets a prompt.
|
|
142
|
+
- [`McpOptions`](reference/authoring-surface/type-mcpoptions.md): The options of an `mcp` Effect.
|
|
143
|
+
- [`McpCallOutput`](reference/authoring-surface/type-mcpcalloutput.md): The output of an `mcp.call` Effect: what the `onDone` of its state gets as `event.output`.
|
|
144
|
+
- [`McpOutput`](reference/authoring-surface/type-mcpoutput.md): The output of any `mcp` Effect: a call's, a read's or a prompt's.
|
|
145
|
+
- [`McpReadOutput`](reference/authoring-surface/type-mcpreadoutput.md): The output of an `mcp.read` or an `mcp.prompt` Effect.
|
|
114
146
|
- [`answer`](reference/authoring-surface/answer.md): Set what the Agent reads when jr2 answers its pick.
|
|
115
147
|
- [`fromPick`](reference/authoring-surface/frompick.md): Make the `input` of the invoke of a state that a pick enters: the params of the pick go to the input of the invoked actor by name.
|
|
116
148
|
- [`paramsOf`](reference/authoring-surface/paramsof.md): Read the params of a pick from the event that entered the state.
|
|
149
|
+
- [`steer`](reference/authoring-surface/steer.md): Send a Steering message to one Agent of this Machine: an action for a transition.
|
|
117
150
|
- [`open`](reference/authoring-surface/open.md): Leave a part of a Machine Open: for the Instance that registers the Machine to bind with `customize()`.
|
|
118
151
|
- [`customize`](reference/authoring-surface/customize.md): Retune the parts that a Machine carries, without a change to the module that exports it.
|
|
119
152
|
- [`Customize`](reference/authoring-surface/type-customize.md): The parts of one Machine that `customize()` can retune: its Agents, its Open Effects, the Machines it composes, and the Sandbox of its `workspace()`.
|
|
120
153
|
- [`EffectBinding`](reference/authoring-surface/type-effectbinding.md): The values that bind the Open parts of one Effect.
|
|
121
154
|
- [`Size`](reference/authoring-surface/type-size.md): The Size of a Workspace: the most memory and cpu that its whole Sandbox can use.
|
|
122
155
|
- [`UserContainer`](reference/authoring-surface/type-usercontainer.md): The User Container in its object form: its image, and its part of the Workspace's Size.
|
|
123
|
-
- [`
|
|
156
|
+
- [`carry`](reference/authoring-surface/carry.md): Give the item itself.
|
|
157
|
+
- [`pool`](reference/authoring-surface/pool.md): Make a Pool: a Machine that runs one worker for each item that a Source gives, with at most `cap` workers at once.
|
|
158
|
+
- [`reread`](reference/authoring-surface/reread.md): Read the Source again.
|
|
159
|
+
- [`skip`](reference/authoring-surface/skip.md): Bring nothing, and say why.
|
|
124
160
|
- [`source`](reference/authoring-surface/source.md): Declare a Source: where a `pool()` gets its work items, one at a time.
|
|
125
161
|
- [`PoolNextInput`](reference/authoring-surface/type-poolnextinput.md): The input of a Source's `next`: the ids of the items that workers have now, the ids of the items that settled, and the Pool's input.
|
|
162
|
+
- [`SourceReply`](reference/authoring-surface/type-sourcereply.md): The text that the person who acted reads, from this Source's verdict (ADR-0011, ADR-0017).
|
|
163
|
+
- [`SourceVerdict`](reference/authoring-surface/type-sourceverdict.md): A Source's verdict on one delivery, as its `reply` reads it (ADR-0017).
|
|
126
164
|
- [`openBody`](reference/authoring-surface/openbody.md): Make an Open body: the actor slot that a Chart binds.
|
|
127
165
|
- [`OpenBodyDeclaration`](reference/authoring-surface/type-openbodydeclaration.md): What an Open body declares: the parts that it lends a Chart, what the Agents of a Chart can have, and the limits of a Chart.
|
|
128
166
|
- [`OpenBodyOutput`](reference/authoring-surface/type-openbodyoutput.md): The output of an Open body.
|
|
@@ -130,10 +168,17 @@
|
|
|
130
168
|
- [`chartSchemaFor`](reference/authoring-surface/chartschemafor.md): The Chart grammar for one Open body, as a zod schema.
|
|
131
169
|
- [`defineConfig`](reference/authoring-surface/defineconfig.md): Declare the config of an Instance: the default export of `jr2.config.ts`.
|
|
132
170
|
- [`JR2Config`](reference/authoring-surface/type-jr2config.md): The shape of `jr2.config.ts`: the deployment facts of an Instance, which a Machine cannot carry.
|
|
171
|
+
- [`McpRemoteServer`](reference/authoring-surface/type-mcpremoteserver.md): A remote MCP server, which the Harness reaches over Streamable HTTP.
|
|
172
|
+
- [`McpServer`](reference/authoring-surface/type-mcpserver.md): One MCP server of the Instance: a `McpRemoteServer` (`url`) or a `McpStdioServer` (`command`).
|
|
173
|
+
- [`McpStdioServer`](reference/authoring-surface/type-mcpstdioserver.md): A stdio MCP server: a program of the Sandbox Image that the Harness starts for each Agent conversation, through jr2's spawner, inside the Agent's confinement.
|
|
174
|
+
- [`RunsConfig`](reference/authoring-surface/type-runsconfig.md): How long jr2 keeps an ended run, and the volume that keeps it (ADR-0065).
|
|
133
175
|
- [`EventSemantics`](reference/authoring-surface/type-eventsemantics.md): How the party that sends an event gets its answer.
|
|
134
176
|
- [`EventAudience`](reference/authoring-surface/type-eventaudience.md): Who may send an event: `"agent"` (an Agent, as a pick from its Menu), `"external"` (the caller of a Gate), or `"any"` (both).
|
|
135
177
|
- [`EventDef`](reference/authoring-surface/type-eventdef.md): A workflow event, as `defineEvent` gives it back: plain, frozen data and a zod schema, safe to import anywhere.
|
|
136
178
|
- [`WorkflowEvent`](reference/authoring-surface/type-workflowevent.md): The type of `event` in a Machine that `jr2Setup` makes: each workflow event in its `events`, and each Mechanism event.
|
|
179
|
+
- [`GateSlot`](reference/authoring-surface/type-gateslot.md): A Gate with parts that the Machine carries.
|
|
180
|
+
- [`Duration`](reference/authoring-surface/type-duration.md): A length of time: a positive number and a unit, `s`, `m` or `h`.
|
|
181
|
+
- [`CallerRecord`](reference/authoring-surface/type-callerrecord.md): A Caller as a run records it (ADR-0078): who acted, and the party it says it acted for.
|
|
137
182
|
- [`FailSlot`](reference/authoring-surface/type-failslot.md): The logic `fail()` returns: `failLogic` with the brand the walk reads.
|
|
138
183
|
- [`Failure`](reference/authoring-surface/type-failure.md): A Failure as `isFailure` narrows an error to it: the payload's fields, on the error itself.
|
|
139
184
|
- [`AgentDeclaration`](reference/authoring-surface/type-agentdeclaration.md): What `agent()` takes: an `AgentDefinition`, except that `model` can also be `open`.
|
|
@@ -159,20 +204,30 @@
|
|
|
159
204
|
- [`OpenSecret`](reference/authoring-surface/type-opensecret.md): `secret(open)`: a secret a packaged Machine names in its auth, a header or a command's env, and leaves for its composer to name (ADR-0054).
|
|
160
205
|
- [`PushOptions`](reference/authoring-surface/type-pushoptions.md): The options of `push()`.
|
|
161
206
|
- [`PushInput`](reference/authoring-surface/type-pushinput.md): The input of a `push` Effect: the Worktree that a cut made, `{ sha }` with `pin`, and `{ message }` with `squash`.
|
|
162
|
-
- [`Duration`](reference/authoring-surface/type-duration.md): A length of time: a positive number and a unit, `s`, `m` or `h`.
|
|
163
207
|
- [`NameStart`](reference/authoring-surface/type-namestart.md): What a Worktree's name may start with: neither `.` nor `-`, and not the end of the path.
|
|
164
208
|
- [`DispatchDefinition`](reference/authoring-surface/type-dispatchdefinition.md): The definition of a `dispatch` Effect (ADR-0071).
|
|
165
209
|
- [`DispatchInput`](reference/authoring-surface/type-dispatchinput.md): A dispatch's input: the run's body — the slot's schema's type, or any JSON object.
|
|
166
210
|
- [`DispatchOpenParts`](reference/authoring-surface/type-dispatchopenparts.md): The Open part a dispatch definition states: its target, when it is `open`.
|
|
167
|
-
- [`
|
|
211
|
+
- [`McpNotReturned`](reference/authoring-surface/type-mcpnotreturned.md): The outcomes that an `mcp` Effect gives besides `returned`.
|
|
212
|
+
- [`ChainLink`](reference/authoring-surface/type-chainlink.md): One reply since the pick, as the author reads it.
|
|
213
|
+
- [`SteerArgs`](reference/authoring-surface/type-steerargs.md): The arguments a `steer` text or `from` function gets: the Machine's context and the event that the transition takes.
|
|
214
|
+
- [`Sender`](reference/authoring-surface/type-sender.md): Who delivered an event: an Agent by its slot, or a Gate by its invoke id (ADR-0015).
|
|
168
215
|
- [`Quantity`](reference/authoring-surface/type-quantity.md): A Kubernetes quantity: `"2Gi"`, `"1500m"`, `"2"`, or a plain number (`2` cpus, bytes of memory).
|
|
169
|
-
- [`
|
|
170
|
-
- [`
|
|
216
|
+
- [`Carry`](reference/authoring-surface/type-carry.md): What `carry(item)` gives.
|
|
217
|
+
- [`PoolSpec`](reference/authoring-surface/type-poolspec.md): What you pass to `pool()` with a child Machine as its worker.
|
|
218
|
+
- [`StandingPoolSpec`](reference/authoring-surface/type-standingpoolspec.md): What you pass to `pool()` for a Pool of runs.
|
|
219
|
+
- [`Reread`](reference/authoring-surface/type-reread.md): What `reread()` gives.
|
|
220
|
+
- [`Skip`](reference/authoring-surface/type-skip.md): What `skip(reason)` gives: the delivery brings nothing, and the reason says why.
|
|
221
|
+
- [`SourceSpec`](reference/authoring-surface/type-sourcespec.md): A pull Source.
|
|
222
|
+
- [`SourceHooks`](reference/authoring-surface/type-sourcehooks.md): A Source's handlers, by Hook kind and event key.
|
|
223
|
+
- [`PushSourceSpec`](reference/authoring-surface/type-pushsourcespec.md): A push Source.
|
|
224
|
+
- [`ReadSourceSpec`](reference/authoring-surface/type-readsourcespec.md): A read Source.
|
|
171
225
|
- [`OpenBodyLogic`](reference/authoring-surface/type-openbodylogic.md): The logic `openBody()` returns: actor logic that carries the brand.
|
|
172
226
|
- [`Lends`](reference/authoring-surface/type-lends.md): The parts of the Chart wrapper that a Chart can use, by their keys in `actors`, `guards`, `actions` and `delays`.
|
|
173
227
|
- [`Ceilings`](reference/authoring-surface/type-ceilings.md): The limits that an Open body sets on its Chart.
|
|
174
228
|
- [`ChartText`](reference/authoring-surface/type-charttext.md): The Chart text (ADR-0070).
|
|
175
|
-
- [`
|
|
229
|
+
- [`DeliveredEvent`](reference/authoring-surface/type-deliveredevent.md): A workflow event as delivered into a Machine: the def's name as `type`, plus its payload.
|
|
230
|
+
- [`Caller`](reference/authoring-surface/type-caller.md): A request's Caller (ADR-0078): who acts, through which authenticator, and what it may do.
|
|
176
231
|
- [`FailureInput`](reference/authoring-surface/type-failureinput.md): What a Failure carries: `reason`, text for a person, and `detail`, optional JSON for a machine reader.
|
|
177
232
|
- [`SandboxOptions`](reference/authoring-surface/type-sandboxoptions.md): The options of a `workspace()` that say what its Sandbox is made of and which Repos it clones.
|
|
178
233
|
- [`SlotHandles`](reference/authoring-surface/type-slothandles.md): The handles of a Workspace that declares Repo Slots.
|
|
@@ -180,8 +235,10 @@
|
|
|
180
235
|
- [`TextPart`](reference/authoring-surface/type-textpart.md): One part of a `Text`: `{ text }`, literal text, or `{ secret }`, the name of an Effect secret.
|
|
181
236
|
- [`HttpMethod`](reference/authoring-surface/type-httpmethod.md): The method of an `http` Effect: `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` or `OPTIONS`.
|
|
182
237
|
- [`HttpRequestParts`](reference/authoring-surface/type-httprequestparts.md): What the `request` of an `http` definition returns: the part of the request that changes for each run.
|
|
183
|
-
- [`NamedSecret`](reference/authoring-surface/type-namedsecret.md): A
|
|
238
|
+
- [`NamedSecret`](reference/authoring-surface/type-namedsecret.md): A secret bound to a name, never `secret(open)`.
|
|
239
|
+
- [`SenderCallerField`](reference/authoring-surface/type-sendercallerfield.md): A field of a `Sender`'s Caller that jr2 can verify.
|
|
184
240
|
- [`SourceNextResult`](reference/authoring-surface/type-sourcenextresult.md): What the `next` of a Source resolves to: an item, to claim it; `null`, when no item is ready now; or `{ item, open }`, where `open` is the number of items that exist but are not ready.
|
|
241
|
+
- [`SourceIn`](reference/authoring-surface/type-sourcein.md): What a Source's handler reads beside `payload`.
|
|
185
242
|
- [`OpenBodySlot`](reference/authoring-surface/type-openbodyslot.md): The brand an Open body slot carries, as `definition` marks an Agent slot (ADR-0049).
|
|
186
243
|
- [`ChartJson`](reference/authoring-surface/type-chartjson.md): Plain JSON.
|
|
187
244
|
- [`ChartEvent`](reference/authoring-surface/type-chartevent.md): An event a Chart mints: its payload is a JSON Schema object, built into zod at admission.
|
|
@@ -198,6 +255,9 @@
|
|
|
198
255
|
- [`ToParameterizedObject`](reference/authoring-surface/type-toparameterizedobject.md): A type that the Authoring surface names.
|
|
199
256
|
- [`BindActors`](reference/authoring-surface/type-bindactors.md): A type that the Authoring surface names.
|
|
200
257
|
- [`SentByGuards`](reference/authoring-surface/type-sentbyguards.md): A type that the Authoring surface names.
|
|
258
|
+
- [`GateHooks`](reference/authoring-surface/type-gatehooks.md): A type that the Authoring surface names.
|
|
259
|
+
- [`EventFrom`](reference/authoring-surface/type-eventfrom.md): A type that the Authoring surface names.
|
|
260
|
+
- [`LookOutput`](reference/authoring-surface/type-lookoutput.md): A type that the Authoring surface names.
|
|
201
261
|
- [`AgentLogic`](reference/authoring-surface/type-agentlogic.md): A type that the Authoring surface names.
|
|
202
262
|
- [`BodyAcceptsDoor`](reference/authoring-surface/type-bodyacceptsdoor.md): A type that the Authoring surface names.
|
|
203
263
|
- [`WorkspaceMachine`](reference/authoring-surface/type-workspacemachine.md): A type that the Authoring surface names.
|
|
@@ -218,17 +278,23 @@
|
|
|
218
278
|
- [`OpenEffectSlots`](reference/authoring-surface/type-openeffectslots.md): A type that the Authoring surface names.
|
|
219
279
|
- [`BindingOf`](reference/authoring-surface/type-bindingof.md): A type that the Authoring surface names.
|
|
220
280
|
- [`LogicAt`](reference/authoring-surface/type-logicat.md): A type that the Authoring surface names.
|
|
281
|
+
- [`GateSlots`](reference/authoring-surface/type-gateslots.md): A type that the Authoring surface names.
|
|
282
|
+
- [`GateBinding`](reference/authoring-surface/type-gatebinding.md): A type that the Authoring surface names.
|
|
283
|
+
- [`GateTypesAt`](reference/authoring-surface/type-gatetypesat.md): A type that the Authoring surface names.
|
|
221
284
|
- [`ChildSlots`](reference/authoring-surface/type-childslots.md): A type that the Authoring surface names.
|
|
222
285
|
- [`ChildAt`](reference/authoring-surface/type-childat.md): A type that the Authoring surface names.
|
|
223
286
|
- [`RepoSlotsOf`](reference/authoring-surface/type-reposlotsof.md): A type that the Authoring surface names.
|
|
224
287
|
- [`WorkspaceOf`](reference/authoring-surface/type-workspaceof.md): A type that the Authoring surface names.
|
|
225
288
|
- [`PoolMachine`](reference/authoring-surface/type-poolmachine.md): A type that the Authoring surface names.
|
|
226
|
-
- [`
|
|
289
|
+
- [`StandingPoolMachine`](reference/authoring-surface/type-standingpoolmachine.md): A type that the Authoring surface names.
|
|
290
|
+
- [`GateSlotInput`](reference/authoring-surface/type-gateslotinput.md): A type that the Authoring surface names.
|
|
291
|
+
- [`GateSlotParts`](reference/authoring-surface/type-gateslotparts.md): A type that the Authoring surface names.
|
|
227
292
|
- [`ArgNames`](reference/authoring-surface/type-argnames.md): A type that the Authoring surface names.
|
|
228
293
|
- [`WorktreeKey`](reference/authoring-surface/type-worktreekey.md): A type that the Authoring surface names.
|
|
229
294
|
- [`NotWorktreeKeys`](reference/authoring-surface/type-notworktreekeys.md): A type that the Authoring surface names.
|
|
230
295
|
- [`OpenSecretMark`](reference/authoring-surface/type-opensecretmark.md): A type that the Authoring surface names.
|
|
231
296
|
- [@jr2/machines](reference/machines.md): The Machines that @jr2/machines ships: their input, their output, and their Open parts.
|
|
297
|
+
- [Hook kinds](reference/hooks.md): Every name that @jr2/orchestrator/hooks exports: the interface of a Hook kind, the kinds that jr2 ships, and webhook().
|
|
232
298
|
- [jr2.config.ts](reference/config.md): Every field of jr2.config.ts: its type, whether it is required, its default, and what it does.
|
|
233
299
|
- [CLI](reference/cli.md): Every jr2 command: its synopsis, its arguments, flags and env vars, and what it prints.
|
|
234
300
|
- [HTTP API](reference/http-api.md): Every route of the Orchestrator's HTTP API, by access band, and the types of its bodies and answers.
|
|
@@ -5,7 +5,7 @@ description: "Make an Agent: an actor slot that runs one Turn of a model each ti
|
|
|
5
5
|
|
|
6
6
|
# `agent`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/harness-client.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/harness-client.ts`. It is an export of `@jr2/orchestrator`, in the [Agents](group-agents.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function agent<
|
|
@@ -5,7 +5,7 @@ description: Set what the Agent reads when jr2 answers its pick.
|
|
|
5
5
|
|
|
6
6
|
# `answer`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/pick.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/pick.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function answer<
|
|
@@ -5,7 +5,7 @@ description: Mark one argv entry of a `command` that the input of the Effect fil
|
|
|
5
5
|
|
|
6
6
|
# `arg`
|
|
7
7
|
|
|
8
|
-
Constant, in `@jr2/orchestrator/src/effect.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Constant, in `@jr2/orchestrator/src/effect.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
const arg: <const N extends string>(name: N) => Arg<N>
|
|
@@ -5,7 +5,7 @@ description: "Make the `auth` of an `http` Effect that sends `Authorization: Bas
|
|
|
5
5
|
|
|
6
6
|
# `basic`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/http-effect.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/http-effect.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function basic<
|
|
@@ -5,7 +5,7 @@ description: "Make the `auth` of an `http` Effect that sends `Authorization: Bea
|
|
|
5
5
|
|
|
6
6
|
# `bearer`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/http-effect.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/http-effect.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function bearer<const S extends Secret>(s: S): MarkedIf<S, { readonly bearer: Secret }>
|
|
@@ -5,7 +5,7 @@ description: A kit schema for a pick param that names a branch.
|
|
|
5
5
|
|
|
6
6
|
# `branchName`
|
|
7
7
|
|
|
8
|
-
Constant, in `@jr2/orchestrator/src/worktree.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Constant, in `@jr2/orchestrator/src/worktree.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
const branchName: ZodString
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: carry
|
|
3
|
+
description: Give the item itself.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `carry`
|
|
7
|
+
|
|
8
|
+
Function, in `@jr2/orchestrator/src/pool.ts`. It is an export of `@jr2/orchestrator`, in the [Composition](group-composition.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
function carry<T>(item: T): Carry<T>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Give the item itself. The Pool holds it, in its run's blob, until it claims it. Only a push
|
|
15
|
+
Source gives it.
|
|
16
|
+
|
|
17
|
+
**Parameters**
|
|
18
|
+
|
|
19
|
+
- `item`: The item, of the type of the Source's `item` schema.
|
|
20
|
+
|
|
21
|
+
**See also**
|
|
22
|
+
|
|
23
|
+
- [Pools and Sources](../../concepts/pools-and-sources.md)
|
|
@@ -5,7 +5,7 @@ description: The Chart grammar, as a zod schema.
|
|
|
5
5
|
|
|
6
6
|
# `chartSchema`
|
|
7
7
|
|
|
8
|
-
Constant, in `@jr2/orchestrator/src/chart.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Constant, in `@jr2/orchestrator/src/chart.ts`. It is an export of `@jr2/orchestrator`, in the [Charts](group-charts.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
const chartSchema: z.ZodType<ChartText>
|
|
@@ -5,7 +5,7 @@ description: The Chart grammar for one Open body, as a zod schema.
|
|
|
5
5
|
|
|
6
6
|
# `chartSchemaFor`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/chart.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/chart.ts`. It is an export of `@jr2/orchestrator`, in the [Charts](group-charts.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function chartSchemaFor(decl: OpenBodyDeclaration): z.ZodType<ChartText>
|
|
@@ -5,7 +5,7 @@ description: "Make a `command` Effect: an actor slot that runs one program in th
|
|
|
5
5
|
|
|
6
6
|
# `command`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/harness-client.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/harness-client.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
## Overload 1
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ description: Retune the parts that a Machine carries, without a change to the mo
|
|
|
5
5
|
|
|
6
6
|
# `customize`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/customize.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/customize.ts`. It is an export of `@jr2/orchestrator`, in the [Composition](group-composition.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function customize<M extends AnyStateMachine>(machine: M, parts: Customize<M>): M
|
|
@@ -24,6 +24,9 @@ refuse most mistakes when you compile. At run time, `customize()` also throws:
|
|
|
24
24
|
- `customize(): machine "<id>" carries no Agent slot "<slot>" — its Agents are: <slots>`
|
|
25
25
|
- `customize(): machine "<id>" composes no Machine under "<slot>" — the Machines it composes are: <slots>`
|
|
26
26
|
- `customize(): machine "<id>" carries no Effect slot "<slot>" — its Effects are: <slots>`
|
|
27
|
+
- `customize(): machine "<id>" carries no Gate slot "<slot>" — its Gate slots are: <slots>`
|
|
28
|
+
- `` customize(): Gate slot "<slot>"'s look is bound once, to a look or "none" — not `open` again ``, and the
|
|
29
|
+
refusals of a look that `gate()` makes
|
|
27
30
|
- `customize(): machine "<id>" declares no Repo Slot "<slot>" — its slots are: <slots>`
|
|
28
31
|
- `customize(): machine "<id>" declares its Repo Slots open as a map — name at least one`
|
|
29
32
|
- `` customize(): `repos` say what a SANDBOX is made of, how big it is and which Repos it
|
|
@@ -5,7 +5,7 @@ description: "Declare the config of an Instance: the default export of `jr2.conf
|
|
|
5
5
|
|
|
6
6
|
# `defineConfig`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/config.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/config.ts`. It is an export of `@jr2/orchestrator`, in the [Config](group-config.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function defineConfig(c: JR2Config): JR2Config
|
|
@@ -5,7 +5,7 @@ description: "Define one workflow event: an event that an Agent or the caller of
|
|
|
5
5
|
|
|
6
6
|
# `defineEvent`
|
|
7
7
|
|
|
8
|
-
Function, in `src/define-event.ts` of `@jr2/agent-protocol`, a dependency of `@jr2/orchestrator`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `src/define-event.ts` of `@jr2/agent-protocol`, a dependency of `@jr2/orchestrator`. It is an export of `@jr2/orchestrator`, in the [Machine and events](group-machine-and-events.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function defineEvent<const Name extends string, Input extends z.ZodObject>(def: {
|
|
@@ -5,7 +5,7 @@ description: "Make a `dispatch` Effect: it starts a run of a Workflow."
|
|
|
5
5
|
|
|
6
6
|
# `dispatch`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/dispatch-effect.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/dispatch-effect.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function dispatch<
|
|
@@ -69,9 +69,10 @@ It refuses:
|
|
|
69
69
|
How long the Effect waits: by default 30s for the start, and 10m with `wait`.
|
|
70
70
|
- `target` (optional): `{ url: string; token: NamedSecret; } | typeof open`
|
|
71
71
|
|
|
72
|
-
A different Orchestrator: `url` is its origin, and `token` is the secret that holds
|
|
73
|
-
|
|
74
|
-
<slot>: { target: { url, token
|
|
72
|
+
A different Orchestrator: `url` is its origin, and `token` is the secret that holds the token
|
|
73
|
+
of a Caller of it with `start` for the Workflow, and `read` too when `wait` is true. Or `open`,
|
|
74
|
+
which the composer binds with `customize(<import>, { effects: { <slot>: { target: { url, token
|
|
75
|
+
} } } })`. Without it, the run starts in this Orchestrator.
|
|
75
76
|
|
|
76
77
|
**Returns**: An Effect, for `actors`.
|
|
77
78
|
|
|
@@ -5,7 +5,7 @@ description: "Fail the run: the Part a Machine invokes to end work that did not
|
|
|
5
5
|
|
|
6
6
|
# `fail`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/fail.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/fail.ts`. It is an export of `@jr2/orchestrator`, in the [Failure](group-failure.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function fail(): FailSlot
|
|
@@ -5,7 +5,7 @@ description: "Make a Worktree file the body of an `http` Effect: `body: file(\"d
|
|
|
5
5
|
|
|
6
6
|
# `file`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/http-effect.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/http-effect.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
function file<S extends z.ZodType | undefined = undefined>(path: FromInput<S, string>, options: {
|
|
@@ -5,7 +5,7 @@ description: "Make the `input` of the invoke of a state that a pick enters: the
|
|
|
5
5
|
|
|
6
6
|
# `fromPick`
|
|
7
7
|
|
|
8
|
-
Function, in `@jr2/orchestrator/src/pick.ts`. It is an export of `@jr2/orchestrator`,
|
|
8
|
+
Function, in `@jr2/orchestrator/src/pick.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
9
|
|
|
10
10
|
## Overload 1
|
|
11
11
|
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: gate
|
|
3
|
+
description: "The Gate: an input that a run waits for from outside the run (ADR-0011)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `gate`
|
|
7
|
+
|
|
8
|
+
Function, in `@jr2/orchestrator/src/gate.ts`. It is an export of `@jr2/orchestrator`, in the [Gates](group-gates.md) group of the [Authoring surface](../authoring-surface.md) page.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
function gate<
|
|
12
|
+
const D extends readonly EventDef[],
|
|
13
|
+
M extends z.ZodObject = z.ZodObject<{}>,
|
|
14
|
+
R extends AnyActorLogic = never,
|
|
15
|
+
>(
|
|
16
|
+
spec: {
|
|
17
|
+
readonly meta?: M;
|
|
18
|
+
readonly delivers: D;
|
|
19
|
+
readonly hooks?: GateHooks<z.output<NoInfer<M>>, Delivered<D>>;
|
|
20
|
+
readonly look?: GateLook<z.output<NoInfer<M>>, Delivered<D>, R> | typeof open | "none";
|
|
21
|
+
readonly reply?: GateReply<z.output<NoInfer<M>>, Delivered<D>>;
|
|
22
|
+
},
|
|
23
|
+
): GateSlot<z.output<M>, Delivered<D>>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The Gate: an input that a run waits for from outside the run ([ADR-0011](../decisions/0011-workflow-defined-events.md)).
|
|
27
|
+
|
|
28
|
+
`gate({ … })` declares a GATE SLOT that also hears a Hook: put it in `actors` and invoke it by
|
|
29
|
+
its key. A plain Gate needs no value: jr2Setup puts it in each Machine as `invoke: { src: "gate" }`.
|
|
30
|
+
Its accepted set derives from the invoking state's transitions, and a Caller answers it with
|
|
31
|
+
`jr2 send`, the Console or `POST /runs/:runId/gates/:gate/events`.
|
|
32
|
+
|
|
33
|
+
- `meta`: a zod object of the meta that the invoking state sets. The Gate checks it when it
|
|
34
|
+
opens, and the handlers, the look and `reply` read it typed.
|
|
35
|
+
- `delivers`: the events that the handlers and the look can give. An event whose def leaves the
|
|
36
|
+
audience unset reads as `audience: "external"`, so no Agent below the Gate has it on its Menu.
|
|
37
|
+
`createMachine` refuses an entry that the Gate's derived accepted set does not hold.
|
|
38
|
+
- `hooks`: a handler for each Hook kind id and event key. A handler reads `{ payload, meta,
|
|
39
|
+
caller }` and gives one event of `delivers`, or `undefined` to ignore the delivery. It is pure
|
|
40
|
+
and synchronous. A throw is a refusal that the hook log keeps; it never faults the run.
|
|
41
|
+
- `look`: the Gate's read of the fact that it waits for (see [`GateLook`](type-gatelook.md)), `"none"` for a
|
|
42
|
+
Gate that hears a command, or `open` for the composer to bind with
|
|
43
|
+
`customize(m, { gates: { <slot>: { look } } })`. With no look and no `after` on the invoking
|
|
44
|
+
state, or with an Open look, `jr2 up` warns.
|
|
45
|
+
- `reply`: the text that the person who acted reads, for a Hook kind whose answer a person reads.
|
|
46
|
+
|
|
47
|
+
It throws on a spec that it cannot run: an unknown key, a `delivers` that is empty or that holds an
|
|
48
|
+
entry `defineEvent` did not make, a handler that is not a function, or a look whose read is not an
|
|
49
|
+
`http` Effect marked `idempotent: true` or a promise.
|
|
50
|
+
|
|
51
|
+
**Parameters**
|
|
52
|
+
|
|
53
|
+
- `spec`
|
|
54
|
+
|
|
55
|
+
- `meta` (optional): `M`
|
|
56
|
+
|
|
57
|
+
A zod object for the meta that the invoking state sets. The Gate checks it when it opens.
|
|
58
|
+
- `delivers`: `D`
|
|
59
|
+
|
|
60
|
+
The events that the handlers and the look can give.
|
|
61
|
+
- `hooks` (optional): `GateHooks<z.output<NoInfer<M>>, Delivered<D>>`
|
|
62
|
+
|
|
63
|
+
The handlers, by Hook kind id and event key.
|
|
64
|
+
- `look` (optional): `GateLook<z.output<NoInfer<M>>, Delivered<D>, R> | typeof open | "none"`
|
|
65
|
+
|
|
66
|
+
The look, `"none"` for a Gate that hears a command, or `open` for its composer to bind.
|
|
67
|
+
- `reply` (optional): `GateReply<z.output<NoInfer<M>>, Delivered<D>>`
|
|
68
|
+
|
|
69
|
+
The text that the person who acted reads.
|
|
70
|
+
|
|
71
|
+
**Example**
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
import { z } from "zod";
|
|
75
|
+
import type {} from "@jr2/orchestrator/hooks/github";
|
|
76
|
+
import { defineEvent, gate, jr2Setup } from "@jr2/orchestrator";
|
|
77
|
+
|
|
78
|
+
const approve = defineEvent({ name: "approve", input: z.object({ by: z.string() }) });
|
|
79
|
+
|
|
80
|
+
const review = gate({
|
|
81
|
+
meta: z.object({ pr: z.string(), sha: z.string() }),
|
|
82
|
+
delivers: [approve],
|
|
83
|
+
hooks: {
|
|
84
|
+
github: {
|
|
85
|
+
"pull_request_review.submitted": ({ payload, meta }) =>
|
|
86
|
+
payload.pull_request.html_url === meta.pr &&
|
|
87
|
+
payload.review.commit_id === meta.sha &&
|
|
88
|
+
payload.review.state === "approved"
|
|
89
|
+
? { type: "approve", by: payload.review.user.login }
|
|
90
|
+
: undefined,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
look: "none",
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
export const machine = jr2Setup({
|
|
97
|
+
types: {} as { context: { pr: string; sha: string }; input: { pr: string; sha: string } },
|
|
98
|
+
events: [approve],
|
|
99
|
+
actors: { review },
|
|
100
|
+
}).createMachine({
|
|
101
|
+
id: "pr",
|
|
102
|
+
context: ({ input }) => input,
|
|
103
|
+
initial: "inReview",
|
|
104
|
+
states: {
|
|
105
|
+
inReview: {
|
|
106
|
+
invoke: { src: "review", input: ({ context }) => ({ meta: { pr: context.pr, sha: context.sha } }) },
|
|
107
|
+
on: { approve: "merged" },
|
|
108
|
+
},
|
|
109
|
+
merged: { type: "final" },
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**See also**
|
|
115
|
+
|
|
116
|
+
- [Gates](../../concepts/gates.md)
|
|
117
|
+
- [Answer a Gate from a forge](../../guides/answer-a-gate-from-a-forge.md)
|
|
118
|
+
- [ADR-0011: Control events are workflow-defined and delivered by closure, not routed](../decisions/0011-workflow-defined-events.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Authoring surface: Agents"
|
|
3
|
+
description: An Agent slot and the definition it carries (ADR-0028, ADR-0049).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Authoring surface: Agents
|
|
7
|
+
|
|
8
|
+
This page is one group of the names that `@jr2/orchestrator` exports from its root, on the [Authoring surface](../authoring-surface.md) page. It gives each name its kind and the first sentence of its TSDoc. Each name has a page of its own, in this folder.
|
|
9
|
+
|
|
10
|
+
An Agent slot and the definition it carries ([ADR-0028](../decisions/0028-what-an-agent-may-do-to-the-workspace-is-part-of-its-definition.md), [ADR-0049](../decisions/0049-a-machine-carries-its-parts-and-composes-by-invoke.md)).
|
|
11
|
+
|
|
12
|
+
- [`agent`](agent.md) (function): Make an Agent: an actor slot that runs one Turn of a model each time a state invokes it.
|
|
13
|
+
- [`AgentDefinition`](type-agentdefinition.md) (type): An Agent's definition: which model it runs, its instructions, and what it may do to the Workspace.
|
|
14
|
+
- [`AgentMcpServer`](type-agentmcpserver.md) (type): One MCP server that an Agent uses, and the tools that it may call there.
|
|
15
|
+
- [`ThinkingLevel`](type-thinkinglevel.md) (type): How hard the model thinks before it answers: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"` or `"xhigh"`.
|