@jr2/orchestrator 0.5.1 → 0.6.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/docs/agents-block.md +2 -2
- package/docs/concepts/agents-and-turns.md +56 -20
- package/docs/concepts/architecture.md +30 -17
- package/docs/concepts/charts.md +6 -3
- package/docs/concepts/converge.md +3 -0
- package/docs/concepts/effects.md +86 -31
- package/docs/concepts/machines-and-workflows.md +9 -0
- package/docs/concepts/pools-and-sources.md +6 -6
- package/docs/concepts/secrets-and-trust.md +126 -42
- package/docs/concepts/the-menu.md +3 -0
- package/docs/concepts/workspaces.md +129 -51
- package/docs/get-started/an-agent-in-a-sandbox.md +21 -19
- package/docs/get-started/have-your-assistant-write-a-machine.md +111 -40
- package/docs/get-started/install.md +4 -0
- package/docs/guides/add-tools-to-the-sandbox.md +17 -4
- package/docs/guides/bind-open-parts.md +5 -4
- package/docs/guides/cut-a-worktree.md +560 -0
- package/docs/guides/fix-a-failed-converge.md +1 -1
- package/docs/guides/let-an-agent-write-a-chart.md +5 -1
- package/docs/guides/look-inside-a-sandbox.md +18 -15
- package/docs/guides/move-from-kind-to-a-shared-cluster.md +16 -0
- package/docs/guides/push-and-sign-a-branch.md +67 -21
- package/docs/guides/run-a-command-or-call-a-url.md +84 -41
- package/docs/guides/run-one-worker-per-item.md +19 -18
- package/docs/guides/set-an-agents-access-and-dials.md +67 -22
- package/docs/guides/size-a-workspace.md +19 -6
- package/docs/guides/use-a-hosted-provider.md +6 -0
- package/docs/guides/watch-a-run.md +47 -24
- package/docs/guides/write-a-workflow.md +1 -1
- package/docs/llms.txt +33 -12
- package/docs/reference/authoring-surface/agent.md +34 -11
- package/docs/reference/authoring-surface/answer.md +19 -3
- package/docs/reference/authoring-surface/arg.md +27 -5
- package/docs/reference/authoring-surface/branchname.md +15 -0
- package/docs/reference/authoring-surface/command.md +36 -21
- package/docs/reference/authoring-surface/fail.md +17 -4
- package/docs/reference/authoring-surface/file.md +36 -16
- package/docs/reference/authoring-surface/http.md +108 -8
- package/docs/reference/authoring-surface/isready.md +14 -0
- package/docs/reference/authoring-surface/jr2setup.md +1 -1
- package/docs/reference/authoring-surface/open.md +36 -5
- package/docs/reference/authoring-surface/paramsof.md +22 -4
- package/docs/reference/authoring-surface/pool.md +4 -4
- package/docs/reference/authoring-surface/push.md +30 -12
- package/docs/reference/authoring-surface/readyof.md +21 -0
- package/docs/reference/authoring-surface/secret.md +25 -4
- package/docs/reference/authoring-surface/source.md +3 -3
- package/docs/reference/authoring-surface/type-agentdefinition.md +2 -2
- package/docs/reference/authoring-surface/type-agentslots.md +4 -1
- package/docs/reference/authoring-surface/type-anyframepath.md +14 -0
- package/docs/reference/authoring-surface/type-anyworktreepath.md +15 -0
- package/docs/reference/authoring-surface/type-bindactors.md +14 -0
- package/docs/reference/authoring-surface/type-binding.md +5 -6
- package/docs/reference/authoring-surface/type-commandinput.md +4 -3
- package/docs/reference/authoring-surface/type-commandoptions.md +0 -22
- package/docs/reference/authoring-surface/type-commandoutput.md +22 -4
- package/docs/reference/authoring-surface/type-customize.md +4 -2
- package/docs/reference/authoring-surface/type-dispatchoutput.md +8 -1
- package/docs/reference/authoring-surface/type-doorlessinput.md +19 -0
- package/docs/reference/authoring-surface/type-filebody.md +4 -8
- package/docs/reference/authoring-surface/type-framepath.md +14 -0
- package/docs/reference/authoring-surface/type-hostinjectedinput.md +2 -4
- package/docs/reference/authoring-surface/type-httpdefinition.md +6 -3
- package/docs/reference/authoring-surface/type-httpfileinput.md +20 -0
- package/docs/reference/authoring-surface/type-httpoutput.md +7 -1
- package/docs/reference/authoring-surface/type-lateroutcome.md +21 -0
- package/docs/reference/authoring-surface/type-namestart.md +77 -0
- package/docs/reference/authoring-surface/type-noslotworkspaceoptions.md +1 -6
- package/docs/reference/authoring-surface/type-notworktreekeys.md +12 -0
- package/docs/reference/authoring-surface/type-opencommandinput.md +7 -2
- package/docs/reference/authoring-surface/type-permissivenoslotworkspaceoptions.md +1 -6
- package/docs/reference/authoring-surface/type-permissiveworkspaceoptions.md +5 -10
- package/docs/reference/authoring-surface/type-poolnextinput.md +22 -0
- package/docs/reference/authoring-surface/type-poolspec.md +2 -2
- package/docs/reference/authoring-surface/type-pushinput.md +22 -3
- package/docs/reference/authoring-surface/type-pushoutput.md +32 -7
- package/docs/reference/authoring-surface/type-reposlot.md +5 -5
- package/docs/reference/authoring-surface/type-sandboxoptions.md +11 -4
- package/docs/reference/authoring-surface/type-slothandles.md +5 -13
- package/docs/reference/authoring-surface/type-sourcespec.md +10 -10
- package/docs/reference/authoring-surface/type-workspaced.md +29 -8
- package/docs/reference/authoring-surface/type-workspacehandles.md +5 -6
- package/docs/reference/authoring-surface/type-workspaceoptions.md +1 -13
- package/docs/reference/authoring-surface/type-worktreefound.md +16 -0
- package/docs/reference/authoring-surface/type-worktreeinput.md +56 -0
- package/docs/reference/authoring-surface/type-worktreekey.md +14 -0
- package/docs/reference/authoring-surface/type-worktreeoptions.md +29 -0
- package/docs/reference/authoring-surface/type-worktreeoutput.md +45 -0
- package/docs/reference/authoring-surface/type-worktreepath.md +16 -0
- package/docs/reference/authoring-surface/type-worktreeready.md +37 -0
- package/docs/reference/authoring-surface/type-worktreerefused.md +21 -0
- package/docs/reference/authoring-surface/workspace.md +65 -37
- package/docs/reference/authoring-surface/worktree.md +71 -0
- package/docs/reference/authoring-surface.md +30 -10
- package/docs/reference/cli.md +1 -1
- package/docs/reference/config.md +13 -4
- package/docs/reference/decisions/0001-operator-owned-generic-sandbox.md +10 -9
- package/docs/reference/decisions/0002-duplex-streaming-actor.md +17 -10
- package/docs/reference/decisions/0004-worktree-provisioning-model.md +27 -21
- package/docs/reference/decisions/0005-sandbox-pod-composition.md +29 -19
- package/docs/reference/decisions/0006-agent-control-surface.md +6 -3
- package/docs/reference/decisions/0012-workspace-wrapper-machine.md +30 -30
- package/docs/reference/decisions/0013-the-agent-reaches-its-machine-through-a-container-it-cannot-read.md +35 -17
- package/docs/reference/decisions/0015-authoring-surface-absorbs-the-mechanism.md +8 -2
- package/docs/reference/decisions/0016-agent-turn-mechanics-are-internal.md +9 -7
- package/docs/reference/decisions/0017-pool-over-a-source-port.md +6 -4
- package/docs/reference/decisions/0019-one-converging-command-against-the-current-context.md +21 -9
- package/docs/reference/decisions/0021-workspace-continuity-is-a-lease-that-answers-back.md +2 -1
- package/docs/reference/decisions/0023-the-harness-prints-the-conversation.md +8 -9
- package/docs/reference/decisions/0024-an-agents-turn-ends-with-the-state-that-asked-for-it.md +62 -65
- package/docs/reference/decisions/0027-the-harness-is-jr2s-own-server-flue-retires-the-wire-stays.md +9 -1
- package/docs/reference/decisions/0028-what-an-agent-may-do-to-the-workspace-is-part-of-its-definition.md +13 -12
- package/docs/reference/decisions/0031-menu-only-agents-run-on-the-instance-harness.md +4 -1
- package/docs/reference/decisions/0033-a-machine-declares-the-input-that-starts-it.md +18 -19
- package/docs/reference/decisions/0037-an-instance-builds-its-sandbox-images-jr2-injects-the-harness.md +8 -8
- package/docs/reference/decisions/0049-a-machine-carries-its-parts-and-composes-by-invoke.md +4 -4
- package/docs/reference/decisions/0051-a-repo-is-a-slot-on-the-workspace-and-a-cache-on-the-node.md +57 -46
- package/docs/reference/decisions/0052-a-sandbox-lands-where-an-ordinary-pod-lands-and-the-cache-follows-it.md +5 -0
- package/docs/reference/decisions/0053-a-fetch-inside-the-pod-asks-the-node-cache-and-the-cache-asks-the-remote.md +20 -8
- package/docs/reference/decisions/0057-a-turn-is-its-frame-its-dials-and-whether-it-continues.md +24 -24
- package/docs/reference/decisions/0058-a-harness-answers-the-orchestrator-alone.md +5 -3
- package/docs/reference/decisions/0059-a-harness-holds-stand-ins-and-the-custodian-holds-the-keys.md +110 -67
- package/docs/reference/decisions/0062-jr2-briefs-the-agent-on-its-seat-never-on-its-task.md +101 -74
- package/docs/reference/decisions/0063-the-orchestrator-watches-the-cluster.md +5 -6
- package/docs/reference/decisions/0066-a-model-tier-runs-a-real-model-and-a-change-to-what-it-reads-runs-the-tier.md +2 -0
- package/docs/reference/decisions/0067-an-effect-is-an-actor-slot-and-runs-at-most-once-unless-marked-idempotent.md +181 -153
- package/docs/reference/decisions/0068-an-effector-holds-an-effects-secrets-and-signs-its-wire.md +74 -63
- package/docs/reference/decisions/0070-a-machine-lends-its-parts-to-a-chart.md +31 -20
- package/docs/reference/decisions/0073-a-machine-fails-a-run-with-fail-and-an-uncaught-failure-ends-it-failed.md +1 -1
- package/docs/reference/decisions/0075-a-machine-cuts-a-worktree-and-the-workspace-only-clones.md +295 -0
- package/docs/reference/decisions/0076-an-agents-control-credential-lives-only-where-no-workspace-code-runs.md +320 -0
- package/docs/reference/decisions/0077-jr2-requires-landlock-on-every-sandbox-node.md +79 -0
- package/docs/reference/decisions.md +3 -0
- package/docs/reference/glossary.md +51 -12
- package/docs/reference/http-api.md +45 -7
- package/docs/reference/machines.md +0 -1
- package/docs/why.md +5 -4
- package/package.json +3 -3
- package/src/actor.ts +161 -35
- package/src/agent.ts +6 -6
- package/src/ambient.ts +3 -5
- package/src/chart.ts +186 -19
- package/src/charts.ts +9 -2
- package/src/config.ts +16 -6
- package/src/custodian.lua +17 -5
- package/src/custodian.ts +251 -77
- package/src/customize.ts +11 -3
- package/src/effect-checks.ts +50 -3
- package/src/effect.ts +343 -127
- package/src/effector-wire.ts +6 -3
- package/src/fail.ts +17 -4
- package/src/harness-client.ts +74 -31
- package/src/harness-env.ts +33 -0
- package/src/held-secrets.ts +125 -16
- package/src/holds.ts +3 -0
- package/src/http-effect.ts +88 -32
- package/src/http.ts +56 -17
- package/src/index.ts +15 -1
- package/src/internal.ts +1 -0
- package/src/kube-client.ts +6 -3
- package/src/machine-doc.ts +3 -4
- package/src/model-keys.ts +24 -0
- package/src/names.ts +19 -6
- package/src/notices.ts +443 -54
- package/src/open-body.ts +85 -19
- package/src/open.ts +36 -5
- package/src/parts.ts +40 -28
- package/src/party.ts +33 -0
- package/src/pick.ts +41 -7
- package/src/pool.ts +44 -23
- package/src/registration.ts +53 -11
- package/src/repo-identity.ts +7 -3
- package/src/repos.ts +20 -2
- package/src/run-host.ts +106 -20
- package/src/sandbox-effect.ts +217 -66
- package/src/sandbox-kube.ts +63 -16
- package/src/secret-placement.ts +9 -2
- package/src/setup.ts +86 -6
- package/src/tokens.ts +107 -32
- package/src/vocabulary.ts +23 -4
- package/src/wire.ts +10 -10
- package/src/workspace.ts +264 -253
- package/src/worktree.ts +249 -0
- package/docs/reference/authoring-surface/type-noslotspec.md +0 -26
- package/docs/reference/authoring-surface/type-workspacespec.md +0 -37
|
@@ -8,7 +8,7 @@ description: "Declare a Source: where a `pool()` gets its work items, one at a t
|
|
|
8
8
|
Function, in `@jr2/orchestrator/src/pool.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Composition.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
function source<T>(spec: SourceSpec<T>): SourceSpec<T>
|
|
11
|
+
function source<T, TInput = unknown>(spec: SourceSpec<T, TInput>): SourceSpec<T, TInput>
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Declare a Source: where a `pool()` gets its work items, one at a time. It gives back the spec
|
|
@@ -25,7 +25,7 @@ that you pass. The item type `T` types what `next` gives. `pool()` does not carr
|
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
27
|
import { fromPromise } from "xstate";
|
|
28
|
-
import { source } from "@jr2/orchestrator";
|
|
28
|
+
import { source, type PoolNextInput } from "@jr2/orchestrator";
|
|
29
29
|
|
|
30
30
|
type Issue = { id: string; title: string };
|
|
31
31
|
|
|
@@ -35,7 +35,7 @@ const backlog: Issue[] = [
|
|
|
35
35
|
];
|
|
36
36
|
|
|
37
37
|
export const issues = source<Issue>({
|
|
38
|
-
next: fromPromise(async ({ input }: { input:
|
|
38
|
+
next: fromPromise(async ({ input }: { input: PoolNextInput }) => {
|
|
39
39
|
const issue = backlog.find((i) => !input.active.includes(i.id)) ?? null;
|
|
40
40
|
if (issue) backlog.splice(backlog.indexOf(issue), 1);
|
|
41
41
|
return issue;
|
|
@@ -51,8 +51,8 @@ cannot change `instructions` or `workspace`.
|
|
|
51
51
|
What the Agent may do to the Workspace. Default: `"write"`.
|
|
52
52
|
- `"write"`: all the Working tools (read, write, edit, bash, grep, glob).
|
|
53
53
|
- `"read"`: no write or edit tool. The Agent keeps bash, so `"read"` does not stop a command
|
|
54
|
-
that writes. To keep the Agent from changing the branch, frame its Turn in
|
|
55
|
-
Worktree:
|
|
54
|
+
that writes. To keep the Agent from changing the branch, frame its Turn in a detached
|
|
55
|
+
Worktree: cut it with `{ path, detach: sha }`, then give that `path` as `cwd`.
|
|
56
56
|
- `"none"`: no Working tools. The Agent only reads its prompt and picks from its Menu. Its Turn
|
|
57
57
|
runs on the Instance Harness, not in a Sandbox, so it needs no `workspace()` around it.
|
|
58
58
|
|
|
@@ -8,5 +8,8 @@ description: A type that the Authoring surface names.
|
|
|
8
8
|
Type, in `@jr2/orchestrator/src/customize.ts`. It is type plumbing: it computes a type from the types of a Machine or of its parts, and a workflow module does not write it. The signature of an export, or a type that it names, names this type, so its declaration is here. The [Authoring surface](../authoring-surface.md) page lists each export.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
type AgentSlots<M extends AnyStateMachine> = Extract<
|
|
11
|
+
type AgentSlots<M extends AnyStateMachine> = Extract<
|
|
12
|
+
SlotsOf<M>,
|
|
13
|
+
{ logic: CallbackActorLogic<AgentRunReceiveEvent, any> }
|
|
14
|
+
>["src"];
|
|
12
15
|
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: AnyFramePath
|
|
3
|
+
description: "A Turn's Frame: a Worktree, or `/work`, stated."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `AnyFramePath`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/worktree.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Effects.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type AnyFramePath = "/work" | `/work/${string}`;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
A Turn's Frame: a Worktree, or `/work`, stated. `jr2Setup` narrows it to the body's slots.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: AnyWorktreePath
|
|
3
|
+
description: "A Worktree of any Repo Slot: what a kit factory states, before `jr2Setup` narrows it to the slots of the body."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `AnyWorktreePath`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/worktree.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Effects.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type AnyWorktreePath = `/work/${string}/${string}`;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
A Worktree of any Repo Slot: what a kit factory states, before `jr2Setup` narrows it to the
|
|
15
|
+
slots of the body.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: BindActors
|
|
3
|
+
description: A type that the Authoring surface names.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `BindActors`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/setup.ts`. It is type plumbing: it computes a type from the types of a Machine or of its parts, and a workflow module does not write it. The signature of an export, or a type that it names, names this type, so its declaration is here. The [Authoring surface](../authoring-surface.md) page lists each export.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type BindActors<A extends Record<string, UnknownActorLogic>, TInput, TContext> = {
|
|
12
|
+
[K in keyof A]: BindLogic<A[K], RepoSlotsOf<TInput, TContext>>;
|
|
13
|
+
};
|
|
14
|
+
```
|
|
@@ -14,9 +14,9 @@ type Binding = {
|
|
|
14
14
|
};
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
The repository of a Repo Slot: `{ url, ref }`. `url` is the Repo's git url. `ref` is the branch
|
|
18
|
-
or commit that the branch
|
|
19
|
-
url is needed, a string is enough.
|
|
17
|
+
The repository of a Repo Slot: `{ url, ref }`. `url` is the Repo's git url. `ref` is the branch,
|
|
18
|
+
the tag or the commit that the clone stays on, and that a new branch starts from; absent, the
|
|
19
|
+
Repo's default branch. Where only a url is needed, a string is enough.
|
|
20
20
|
|
|
21
21
|
`workspace()` and `customize()` refuse:
|
|
22
22
|
- an empty `url`: ``<where>: Repo Slot "<slot>" is bound to an empty url (got <value>) — a slot
|
|
@@ -34,8 +34,8 @@ url is needed, a string is enough.
|
|
|
34
34
|
The Repo's git url.
|
|
35
35
|
- `ref` (optional): `string`
|
|
36
36
|
|
|
37
|
-
The branch or commit that the branch
|
|
38
|
-
branch.
|
|
37
|
+
The branch, tag or commit that the clone stays on, and that a new branch starts from. Default:
|
|
38
|
+
the Repo's default branch.
|
|
39
39
|
|
|
40
40
|
**Example**
|
|
41
41
|
|
|
@@ -52,7 +52,6 @@ const body = jr2Setup().createMachine({
|
|
|
52
52
|
|
|
53
53
|
export const machine = workspace(body, {
|
|
54
54
|
repos: { app },
|
|
55
|
-
spec: () => ({ branch: "jr2/hotfix" }),
|
|
56
55
|
});
|
|
57
56
|
```
|
|
58
57
|
|
|
@@ -8,11 +8,12 @@ description: "A command's input: one string per argv slot, and with `pin` the ap
|
|
|
8
8
|
Type, in `@jr2/orchestrator/src/effect.ts`. The signature of an export, or a type that it names, names this type. The [Authoring surface](../authoring-surface.md) page lists each export. This type is not an export of `@jr2/orchestrator`, so a workflow module does not import it by name.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
type CommandInput<A extends readonly unknown[], P = false> = [
|
|
11
|
+
type CommandInput<A extends readonly unknown[], P = false, Opt = unknown> = [
|
|
12
12
|
ArgNames<A> | ([P] extends [true] ? "sha" : never),
|
|
13
13
|
] extends [never]
|
|
14
|
-
? void
|
|
15
|
-
: { [K in ArgNames<A> | ([P] extends [true] ? "sha" : never)]: string }
|
|
14
|
+
? (WorktreeKey<Opt> & NotWorktreeKeys) | ([Opt] extends [{ readonly env: object }] ? never : void)
|
|
15
|
+
: { [K in ArgNames<A> | ([P] extends [true] ? "sha" : never)]: string } & WorktreeKey<Opt> &
|
|
16
|
+
Omit<NotWorktreeKeys, ArgNames<A>>;
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
A command's input: one string per argv slot, and with `pin` the approved commit (`{ sha }`);
|
|
@@ -9,7 +9,6 @@ Type, in `@jr2/orchestrator/src/effect.ts`. The signature of an export, or a typ
|
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
type CommandOptions = {
|
|
12
|
-
slot?: string;
|
|
13
12
|
timeout?: Duration;
|
|
14
13
|
tail?: number;
|
|
15
14
|
env?: CommandEnv;
|
|
@@ -22,27 +21,6 @@ output it keeps, its Effect secrets, and the commit it runs against.
|
|
|
22
21
|
|
|
23
22
|
**Fields**
|
|
24
23
|
|
|
25
|
-
- `slot` (optional): `string`
|
|
26
|
-
|
|
27
|
-
The Repo Slot whose Worktree is the working directory of the command. Write it only when the
|
|
28
|
-
Workspace has more than one Repo Slot. In a Workspace with no Repo Slot, the command starts in
|
|
29
|
-
`/work`, the folder that the steps of the Workspace share.
|
|
30
|
-
|
|
31
|
-
The command starts in the root of that Worktree. To run it in a subfolder, give the path as an
|
|
32
|
-
argument, or write `["sh", "-c", "cd <dir> && <program>"]`.
|
|
33
|
-
|
|
34
|
-
When it starts, it refuses:
|
|
35
|
-
- no `slot` under a Workspace with more than one Repo Slot: `command "<slot>" runs under a
|
|
36
|
-
Workspace carrying more than one Repo Slot (<slots>) and names none — say which Worktree it
|
|
37
|
-
runs in: command(argv, { slot: "<slot>" }) (ADR-0051)`. When `env` names an Effect secret,
|
|
38
|
-
the text is `command "<slot>" runs under a Workspace carrying more than one Repo Slot
|
|
39
|
-
(<slots>) — say which: { slot: "<slot>" } (ADR-0051)`.
|
|
40
|
-
- with an Effect secret in `env`, a Workspace with no Repo Slot: `command "<slot>" runs under
|
|
41
|
-
a Workspace with no Repo Slot: a command with an Effect secret runs against one commit of a
|
|
42
|
-
Repo Slot's branch, and there is none — declare a Repo Slot, or name no secret in its env, and
|
|
43
|
-
it runs in /work beside the Agent (ADR-0051)`.
|
|
44
|
-
- a `slot` that the Workspace does not have: `command "<slot>" names Repo Slot "<name>", which
|
|
45
|
-
its Workspace does not carry (<slots>)`.
|
|
46
24
|
- `timeout` (optional): [`Duration`](type-duration.md)
|
|
47
25
|
|
|
48
26
|
How long the command can run: a number and a unit, such as `"90s"`, `"10m"` or `"1h"`.
|
|
@@ -8,7 +8,7 @@ description: "The output of a `command` Effect: what the `onDone` of its state g
|
|
|
8
8
|
Type, in `@jr2/orchestrator/src/effect.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Effects.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
type CommandOutput = (ExecOutcome & { dirty?: boolean }) | Unknown;
|
|
11
|
+
type CommandOutput = (ExecOutcome & { dirty?: boolean }) | Unknown | LaterOutcome;
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
The output of a `command` Effect: what the `onDone` of its state gets as `event.output`. Every
|
|
@@ -25,6 +25,8 @@ outcome is output. A failed program is output too. Route on `outcome`:
|
|
|
25
25
|
characters. `dirty` is `true` when a command that names an Effect secret ran against a commit,
|
|
26
26
|
and the Worktree held changes that it did not see.
|
|
27
27
|
|
|
28
|
+
The union is open ([`LaterOutcome`](type-lateroutcome.md)): give the rest a last arm with no guard.
|
|
29
|
+
|
|
28
30
|
**Forms**: it is one of these objects.
|
|
29
31
|
|
|
30
32
|
- Form 1: `outcome`, `code`, `tail`, `dirty`
|
|
@@ -48,6 +50,10 @@ and the Worktree held changes that it did not see.
|
|
|
48
50
|
|
|
49
51
|
- `outcome`: `"unknown"`
|
|
50
52
|
- `reason`: `string`
|
|
53
|
+
- Form 5: `outcome`, `reason`
|
|
54
|
+
|
|
55
|
+
- `outcome`: `"(a later outcome)"`
|
|
56
|
+
- `reason` (optional): `string`
|
|
51
57
|
|
|
52
58
|
**Example**
|
|
53
59
|
|
|
@@ -56,28 +62,40 @@ import {
|
|
|
56
62
|
command,
|
|
57
63
|
type CommandOutput,
|
|
58
64
|
fail,
|
|
65
|
+
isReady,
|
|
59
66
|
jr2Setup,
|
|
60
67
|
workspace,
|
|
68
|
+
worktree,
|
|
61
69
|
type Workspaced,
|
|
62
70
|
} from "@jr2/orchestrator";
|
|
63
71
|
|
|
64
72
|
type Input = Workspaced<{}, "app">;
|
|
65
73
|
|
|
74
|
+
const testTree = (context: Input) => `${context.workspace.repos.app}/test` as const;
|
|
75
|
+
|
|
66
76
|
const passed = (output: CommandOutput): boolean =>
|
|
67
77
|
output.outcome === "exited" && output.code === 0;
|
|
68
78
|
|
|
69
79
|
const body = jr2Setup({
|
|
70
80
|
types: {} as { context: Input; input: Input },
|
|
71
|
-
actors: { tests: command(["npm", "test"], { timeout: "15m" }), fail: fail() },
|
|
81
|
+
actors: { cut: worktree(), tests: command(["npm", "test"], { timeout: "15m" }), fail: fail() },
|
|
72
82
|
}).createMachine({
|
|
73
83
|
id: "tests",
|
|
74
84
|
context: ({ input }) => input,
|
|
75
85
|
on: { "workspace.lost": ".lost" },
|
|
76
|
-
initial: "
|
|
86
|
+
initial: "cutting",
|
|
77
87
|
states: {
|
|
88
|
+
cutting: {
|
|
89
|
+
invoke: {
|
|
90
|
+
src: "cut",
|
|
91
|
+
input: ({ context }) => ({ path: testTree(context), branch: "tests" }),
|
|
92
|
+
onDone: [{ guard: ({ event }) => isReady(event.output), target: "testing" }, { target: "notCut" }],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
78
95
|
testing: {
|
|
79
96
|
invoke: {
|
|
80
97
|
src: "tests",
|
|
98
|
+
input: ({ context }) => ({ worktree: testTree(context) }),
|
|
81
99
|
onDone: [
|
|
82
100
|
{ guard: ({ event }) => passed(event.output), target: "green" },
|
|
83
101
|
{ target: "red" },
|
|
@@ -87,13 +105,13 @@ const body = jr2Setup({
|
|
|
87
105
|
green: { type: "final" },
|
|
88
106
|
// Not a final state: a final state means `done`, and the run ends `failed` here.
|
|
89
107
|
red: { invoke: { src: "fail", input: { reason: "npm test did not pass" } } },
|
|
108
|
+
notCut: { invoke: { src: "fail", input: { reason: "the Worktree was not cut" } } },
|
|
90
109
|
lost: { invoke: { src: "fail", input: { reason: "the Sandbox is gone" } } },
|
|
91
110
|
},
|
|
92
111
|
});
|
|
93
112
|
|
|
94
113
|
export const machine = workspace(body, {
|
|
95
114
|
repos: { app: { url: "https://github.com/you/app.git" } },
|
|
96
|
-
spec: () => ({ branch: "tests" }),
|
|
97
115
|
});
|
|
98
116
|
```
|
|
99
117
|
|
|
@@ -21,7 +21,9 @@ type Customize<M extends AnyStateMachine> = {
|
|
|
21
21
|
image?: string;
|
|
22
22
|
user?: string | UserContainer;
|
|
23
23
|
resources?: Size;
|
|
24
|
-
repos?: [RepoSlotsOf<M>] extends [never]
|
|
24
|
+
repos?: [RepoSlotsOf<M>] extends [never]
|
|
25
|
+
? never
|
|
26
|
+
: { [K in RepoSlotsOf<M>]?: RepoSlot<Exclude<InputFrom<WorkspaceOf<M>>, undefined>> };
|
|
25
27
|
};
|
|
26
28
|
```
|
|
27
29
|
|
|
@@ -74,7 +76,7 @@ Every key is optional. Write only what you change.
|
|
|
74
76
|
The Size, layered field by field over the Size of the `workspace()`: `{ limits: { memory } }`
|
|
75
77
|
keeps the author's cpu. Only `limits.memory` and `limits.cpu`. See [`Size`](type-size.md). Only for a
|
|
76
78
|
Machine that composes a `workspace()`.
|
|
77
|
-
- `repos` (optional): `[ RepoSlotsOf<M> ] extends [ never ] ? never : { [K in RepoSlotsOf<M>]?: RepoSlot<InputFrom<WorkspaceOf<M
|
|
79
|
+
- `repos` (optional): `[ RepoSlotsOf<M> ] extends [ never ] ? never : { [K in RepoSlotsOf<M>]?: RepoSlot<Exclude<InputFrom<WorkspaceOf<M>>, undefined>>; }`
|
|
78
80
|
|
|
79
81
|
Bind the Repo Slots of the `workspace()`, by slot name. Each value is one of these:
|
|
80
82
|
|
|
@@ -18,7 +18,8 @@ type DispatchOutput =
|
|
|
18
18
|
}
|
|
19
19
|
| { outcome: "refused"; status: number; report: string[] }
|
|
20
20
|
| { outcome: "unreachable"; reason: string }
|
|
21
|
-
| Unknown
|
|
21
|
+
| Unknown
|
|
22
|
+
| LaterOutcome;
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
The output of a `dispatch` Effect. Route on `outcome`:
|
|
@@ -34,6 +35,8 @@ The output of a `dispatch` Effect. Route on `outcome`:
|
|
|
34
35
|
- `unreachable`: the Orchestrator of the target did not answer. No run started.
|
|
35
36
|
- `unknown`: jr2 cannot tell if a run started.
|
|
36
37
|
|
|
38
|
+
The union is open ([`LaterOutcome`](type-lateroutcome.md)): give the rest a last arm with no guard.
|
|
39
|
+
|
|
37
40
|
**Forms**: it is one of these objects.
|
|
38
41
|
|
|
39
42
|
- Form 1: `outcome`, `reason`
|
|
@@ -59,6 +62,10 @@ The output of a `dispatch` Effect. Route on `outcome`:
|
|
|
59
62
|
|
|
60
63
|
- `outcome`: `"unreachable"`
|
|
61
64
|
- `reason`: `string`
|
|
65
|
+
- Form 6: `outcome`, `reason`
|
|
66
|
+
|
|
67
|
+
- `outcome`: `"(a later outcome)"`
|
|
68
|
+
- `reason` (optional): `string`
|
|
62
69
|
|
|
63
70
|
**See also**
|
|
64
71
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: DoorlessInput
|
|
3
|
+
description: A type that the Authoring surface names.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `DoorlessInput`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/workspace.ts`. It is type plumbing: it computes a type from the types of a Machine or of its parts, and a workflow module does not write it. The signature of an export, or a type that it names, names this type, so its declaration is here. The [Authoring surface](../authoring-surface.md) page lists each export.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type DoorlessInput<TBody extends AnyStateMachine> =
|
|
12
|
+
unknown extends InputFrom<TBody>
|
|
13
|
+
? unknown
|
|
14
|
+
: [keyof Omit<InputFrom<TBody>, "workspace">] extends [never]
|
|
15
|
+
? unknown
|
|
16
|
+
: {} extends Omit<InputFrom<TBody>, "workspace">
|
|
17
|
+
? Omit<InputFrom<TBody>, "workspace"> | undefined
|
|
18
|
+
: Omit<InputFrom<TBody>, "workspace">;
|
|
19
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: FileBody
|
|
3
|
-
description: "`file(path, {
|
|
3
|
+
description: "`file(path, { segments?, contentType? })`: a Worktree file as an `http` body."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# `FileBody`
|
|
@@ -11,14 +11,13 @@ Type, in `@jr2/orchestrator/src/http-effect.ts`. The signature of an export, or
|
|
|
11
11
|
type FileBody<S extends z.ZodType | undefined = undefined> = {
|
|
12
12
|
readonly file: {
|
|
13
13
|
readonly path: FromInput<S, string>;
|
|
14
|
-
readonly slot?: string;
|
|
15
14
|
readonly segments?: FromInput<S, readonly string[]>;
|
|
16
15
|
readonly contentType?: string;
|
|
17
16
|
};
|
|
18
17
|
};
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
`file(path, {
|
|
20
|
+
`file(path, { segments?, contentType? })`: a Worktree file as an `http` body.
|
|
22
21
|
|
|
23
22
|
**Fields**
|
|
24
23
|
|
|
@@ -26,11 +25,8 @@ type FileBody<S extends z.ZodType | undefined = undefined> = {
|
|
|
26
25
|
|
|
27
26
|
- `path`: `FromInput<S, string>`
|
|
28
27
|
|
|
29
|
-
The file, relative to the
|
|
30
|
-
Slot.
|
|
31
|
-
- `slot` (optional): `string`
|
|
32
|
-
|
|
33
|
-
The Repo Slot whose Worktree holds it. Write it only when the Workspace has more than one.
|
|
28
|
+
The file, relative to the Worktree that `worktree` of the Effect's input names, or to `/work`
|
|
29
|
+
in a Workspace with no Repo Slot.
|
|
34
30
|
- `segments` (optional): `FromInput<S, readonly string[]>`
|
|
35
31
|
|
|
36
32
|
Path segments that jr2 adds to the end of the url, as `path` of `request` does for a json
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: FramePath
|
|
3
|
+
description: "A Turn's Frame in a Workspace with the Repo Slots `S`."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `FramePath`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/worktree.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Effects.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type FramePath<S extends string> = WorktreePath<S> | "/work";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
A Turn's Frame in a Workspace with the Repo Slots `S`.
|
|
@@ -20,10 +20,8 @@ caller sends it. jr2 writes it over any value that a caller sends.
|
|
|
20
20
|
|
|
21
21
|
Only the root Machine of a run gets it. A Machine that another Machine invokes gets the input
|
|
22
22
|
that its parent gives it. A `workspace()` passes its input to its body, so the body of a root
|
|
23
|
-
`workspace()` gets it too: `Workspaced<HostInjectedInput & RunInput, "app">`.
|
|
24
|
-
|
|
25
|
-
The `spec` of a root `workspace()` also gets it, and the type of its input shows it:
|
|
26
|
-
``spec: ({ input }) => ({ branch: `fix/${input.instanceId}` })``.
|
|
23
|
+
`workspace()` gets it too: `Workspaced<HostInjectedInput & RunInput, "app">`. For example, a cut
|
|
24
|
+
can name a branch for each run: `` branch: `fix/${context.instanceId}` ``.
|
|
27
25
|
|
|
28
26
|
It is not the run id. Use it, for example, to give each run a branch of its own.
|
|
29
27
|
|
|
@@ -79,10 +79,13 @@ An `http` Effect's definition.
|
|
|
79
79
|
Effect secret. Do not write it beside `body`.
|
|
80
80
|
- `body` (optional): `FileBody<S>`
|
|
81
81
|
|
|
82
|
-
A Worktree file as the body: `file(path, {
|
|
83
|
-
runs in the Sandbox Effector of its Workspace.
|
|
82
|
+
A Worktree file as the body: `file(path, { segments?, contentType? })`. The Effect then
|
|
83
|
+
runs in the Sandbox Effector of its Workspace. Under a Workspace with Repo Slots, the invoke's
|
|
84
|
+
input names a Worktree that a cut of this run made, in `worktree`; with none, it refuses when
|
|
85
|
+
it starts: ``http "<slot>" reads a Worktree file, under a Workspace with Repo Slots, and its
|
|
86
|
+
input names no `worktree` ``. Do not write `request` beside it: the `segments`
|
|
84
87
|
of `file` are the path. It refuses another body: ``http({ body }): a body is file(path, {
|
|
85
|
-
|
|
88
|
+
segments?, contentType? }) — json and text come from `request` ``.
|
|
86
89
|
- `timeout` (optional): [`Duration`](type-duration.md)
|
|
87
90
|
|
|
88
91
|
How long jr2 waits for the answer: a number and a unit, such as `"30s"` or `"2m"`. Default
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: HttpFileInput
|
|
3
|
+
description: The input of an `http` Effect with a Worktree file as its body.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `HttpFileInput`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/http-effect.ts`. The signature of an export, or a type that it names, names this type. The [Authoring surface](../authoring-surface.md) page lists each export. This type is not an export of `@jr2/orchestrator`, so a workflow module does not import it by name.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type HttpFileInput<S> = (S extends z.ZodType ? z.infer<S> : unknown) & { worktree?: AnyWorktreePath };
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The input of an `http` Effect with a Worktree file as its body. Under a Workspace with Repo
|
|
15
|
+
Slots, `worktree` names the Worktree. In a Workspace with no Repo Slot, the input has no
|
|
16
|
+
`worktree`, and the path is relative to `/work`.
|
|
17
|
+
|
|
18
|
+
**Fields**
|
|
19
|
+
|
|
20
|
+
- `worktree` (optional): [`AnyWorktreePath`](type-anyworktreepath.md)
|
|
@@ -8,7 +8,7 @@ description: "The output of an `http` Effect: what the `onDone` of its state get
|
|
|
8
8
|
Type, in `@jr2/orchestrator/src/effector-wire.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Effects.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
type HttpOutput = {
|
|
11
|
+
type HttpOutput = LaterOutcome | {
|
|
12
12
|
outcome: "response";
|
|
13
13
|
status: number;
|
|
14
14
|
headers: Record<string, string>;
|
|
@@ -37,6 +37,8 @@ outcome is output. A 4xx or 5xx status is output too. Route on `outcome`:
|
|
|
37
37
|
- `unknown`: the call can have gone out, but no answer came, or jr2 cannot tell after a restart.
|
|
38
38
|
`reason` tells why. jr2 does not send it again unless it is marked `idempotent`.
|
|
39
39
|
|
|
40
|
+
The union is open (`LaterOutcome`): give the rest a last arm with no guard.
|
|
41
|
+
|
|
40
42
|
**Forms**: it is one of these objects.
|
|
41
43
|
|
|
42
44
|
- Form 1: `outcome`, `status`, `headers`, `contentType`, `size`, `body`, `truncated`
|
|
@@ -52,6 +54,10 @@ outcome is output. A 4xx or 5xx status is output too. Route on `outcome`:
|
|
|
52
54
|
|
|
53
55
|
- `outcome`: `"unknown" | "unreachable" | "refused"`
|
|
54
56
|
- `reason`: `string`
|
|
57
|
+
- Form 3: `outcome`, `reason`
|
|
58
|
+
|
|
59
|
+
- `outcome`: `"(a later outcome)"`
|
|
60
|
+
- `reason` (optional): `string`
|
|
55
61
|
|
|
56
62
|
**Example**
|
|
57
63
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: LaterOutcome
|
|
3
|
+
description: A value of `outcome` that this kit does not give.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `LaterOutcome`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/effect.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Effects.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type LaterOutcome = { outcome: "(a later outcome)"; reason?: string };
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
A value of `outcome` that this kit does not give. It stands in the union so that no author can
|
|
15
|
+
write an exhaustive check, so that a later outcome is no break: route on what you know, and give
|
|
16
|
+
the rest a last arm.
|
|
17
|
+
|
|
18
|
+
**Fields**
|
|
19
|
+
|
|
20
|
+
- `outcome`: `"(a later outcome)"`
|
|
21
|
+
- `reason` (optional): `string`
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: NameStart
|
|
3
|
+
description: "What a Worktree's name may start with: neither `.` nor `-`, and not the end of the path."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `NameStart`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/worktree.ts`. The signature of an export, or a type that it names, names this type. The [Authoring surface](../authoring-surface.md) page lists each export. This type is not an export of `@jr2/orchestrator`, so a workflow module does not import it by name.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type NameStart =
|
|
12
|
+
| "a"
|
|
13
|
+
| "b"
|
|
14
|
+
| "c"
|
|
15
|
+
| "d"
|
|
16
|
+
| "e"
|
|
17
|
+
| "f"
|
|
18
|
+
| "g"
|
|
19
|
+
| "h"
|
|
20
|
+
| "i"
|
|
21
|
+
| "j"
|
|
22
|
+
| "k"
|
|
23
|
+
| "l"
|
|
24
|
+
| "m"
|
|
25
|
+
| "n"
|
|
26
|
+
| "o"
|
|
27
|
+
| "p"
|
|
28
|
+
| "q"
|
|
29
|
+
| "r"
|
|
30
|
+
| "s"
|
|
31
|
+
| "t"
|
|
32
|
+
| "u"
|
|
33
|
+
| "v"
|
|
34
|
+
| "w"
|
|
35
|
+
| "x"
|
|
36
|
+
| "y"
|
|
37
|
+
| "z"
|
|
38
|
+
| "A"
|
|
39
|
+
| "B"
|
|
40
|
+
| "C"
|
|
41
|
+
| "D"
|
|
42
|
+
| "E"
|
|
43
|
+
| "F"
|
|
44
|
+
| "G"
|
|
45
|
+
| "H"
|
|
46
|
+
| "I"
|
|
47
|
+
| "J"
|
|
48
|
+
| "K"
|
|
49
|
+
| "L"
|
|
50
|
+
| "M"
|
|
51
|
+
| "N"
|
|
52
|
+
| "O"
|
|
53
|
+
| "P"
|
|
54
|
+
| "Q"
|
|
55
|
+
| "R"
|
|
56
|
+
| "S"
|
|
57
|
+
| "T"
|
|
58
|
+
| "U"
|
|
59
|
+
| "V"
|
|
60
|
+
| "W"
|
|
61
|
+
| "X"
|
|
62
|
+
| "Y"
|
|
63
|
+
| "Z"
|
|
64
|
+
| "0"
|
|
65
|
+
| "1"
|
|
66
|
+
| "2"
|
|
67
|
+
| "3"
|
|
68
|
+
| "4"
|
|
69
|
+
| "5"
|
|
70
|
+
| "6"
|
|
71
|
+
| "7"
|
|
72
|
+
| "8"
|
|
73
|
+
| "9"
|
|
74
|
+
| "_";
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
What a Worktree's name may start with: neither `.` nor `-`, and not the end of the path.
|
|
@@ -11,12 +11,11 @@ Type, in `@jr2/orchestrator/src/workspace.ts`. The signature of an export, or a
|
|
|
11
11
|
type NoSlotWorkspaceOptions<TSchema extends z.ZodObject> = Omit<SandboxOptions<never>, "repos"> & {
|
|
12
12
|
repos?: never;
|
|
13
13
|
input: TSchema;
|
|
14
|
-
spec?: (args: { input: WithoutEmptyIndex<z.infer<TSchema>> & HostInjectedInput }) => NoSlotSpec;
|
|
15
14
|
};
|
|
16
15
|
```
|
|
17
16
|
|
|
18
17
|
The options of a `workspace()` with no Repo Slot that declares the input that starts a run.
|
|
19
|
-
`repos` is left out
|
|
18
|
+
`repos` is left out.
|
|
20
19
|
|
|
21
20
|
**Fields**: each field of [`SandboxOptions`](type-sandboxoptions.md), except `repos`, and these:
|
|
22
21
|
|
|
@@ -26,7 +25,3 @@ The options of a `workspace()` with no Repo Slot that declares the input that st
|
|
|
26
25
|
- `input`: `TSchema`
|
|
27
26
|
|
|
28
27
|
The input that starts a run, as a `z.object`, as in [`WorkspaceOptions`](type-workspaceoptions.md).
|
|
29
|
-
- `spec` (optional): `(args: { input: WithoutEmptyIndex<z.infer<TSchema>> & HostInjectedInput; }) => NoSlotSpec`
|
|
30
|
-
|
|
31
|
-
A function from the run input to the Workspace's [`NoSlotSpec`](type-noslotspec.md): only `workGroup`.
|
|
32
|
-
Default: no `workGroup`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: NotWorktreeKeys
|
|
3
|
+
description: A type that the Authoring surface names.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `NotWorktreeKeys`
|
|
7
|
+
|
|
8
|
+
Type, in `@jr2/orchestrator/src/effect.ts`. It is type plumbing: it computes a type from the types of a Machine or of its parts, and a workflow module does not write it. The signature of an export, or a type that it names, names this type, so its declaration is here. The [Authoring surface](../authoring-surface.md) page lists each export.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
type NotWorktreeKeys = { cwd?: never; path?: never; branch?: never };
|
|
12
|
+
```
|
|
@@ -8,10 +8,15 @@ description: "The input of a `command(open)`: a string for each `arg()` of the a
|
|
|
8
8
|
Type, in `@jr2/orchestrator/src/effect.ts`. The signature of an export, or a type that it names, names this type. The [Authoring surface](../authoring-surface.md) page lists each export. This type is not an export of `@jr2/orchestrator`, so a workflow module does not import it by name.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
type OpenCommandInput<P = false> = Readonly<Record<string, string>> &
|
|
12
|
-
([P] extends [true] ? { sha: string } : unknown)
|
|
11
|
+
type OpenCommandInput<P = false, Opt = unknown> = Readonly<Record<string, string>> &
|
|
12
|
+
([P] extends [true] ? { sha: string } : unknown) &
|
|
13
|
+
WorktreeKey<Opt>;
|
|
13
14
|
```
|
|
14
15
|
|
|
15
16
|
The input of a `command(open)`: a string for each `arg()` of the argv that the Instance binds,
|
|
16
17
|
and with `pin`, the commit (`{ sha }`). The compiler cannot check the names. When the input has
|
|
17
18
|
no string for an `arg()`, the Effect fails when it starts.
|
|
19
|
+
|
|
20
|
+
**Fields**
|
|
21
|
+
|
|
22
|
+
- `worktree` (optional): [`AnyWorktreePath`](type-anyworktreepath.md)
|
|
@@ -8,10 +8,9 @@ description: "The options of a `workspace()` with no Repo Slot and no `input`: i
|
|
|
8
8
|
Type, in `@jr2/orchestrator/src/workspace.ts`. The signature of an export, or a type that it names, names this type. The [Authoring surface](../authoring-surface.md) page lists each export. This type is not an export of `@jr2/orchestrator`, so a workflow module does not import it by name.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
type PermissiveNoSlotWorkspaceOptions
|
|
11
|
+
type PermissiveNoSlotWorkspaceOptions = Omit<SandboxOptions<never>, "repos"> & {
|
|
12
12
|
repos?: never;
|
|
13
13
|
input?: never;
|
|
14
|
-
spec?: (args: { input: TInput }) => NoSlotSpec;
|
|
15
14
|
};
|
|
16
15
|
```
|
|
17
16
|
|
|
@@ -25,7 +24,3 @@ The options of a `workspace()` with no Repo Slot and no `input`: it starts with
|
|
|
25
24
|
- `input` (optional): `never`
|
|
26
25
|
|
|
27
26
|
Not present: a `workspace()` without `input` starts with any input.
|
|
28
|
-
- `spec` (optional): `(args: { input: TInput; }) => NoSlotSpec`
|
|
29
|
-
|
|
30
|
-
A function from the input to the Workspace's [`NoSlotSpec`](type-noslotspec.md): only `workGroup`. Default:
|
|
31
|
-
no `workGroup`.
|