You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/rig/references/runtime.md
+26-9Lines changed: 26 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ RIG
16
16
Inline mode:
17
17
18
18
- writes the root result to stdout
19
-
- accepts an agent, string, or prompt builder as the default export
19
+
- accepts an agent, workflow, string, or prompt builder as the default export
20
20
- injects `import { agent, p, s } from "rig"` when omitted
21
-
- accepts a root with no `input`, `input: s.object({})`, or the default `s.string` input invoked with`""`
21
+
- accepts a root with no `input`, `input: s.object({})`, `input: s.object({ text: s.string })`, or the default `s.string` input; omitted values become `{}`, `{ text: "" }`, or`""`
22
22
- falls back to the first `const`/`let`/`var` assigned from `agent(...)` if `export default` is omitted
23
23
24
24
Prefer an explicit default export even though the fallback exists.
@@ -37,7 +37,11 @@ Stdin coercion follows the root schema:
37
37
- object containing `text`: `{ text: "<stdin>" }`
38
38
- any other schema: stdin must be valid JSON
39
39
40
-
Add `--server` in either mode to start the Copilot server over stdio. Without it, `copilotEngine()` connects over HTTP using `COPILOT_SDK_URI`, then `localhost:7777`.
40
+
The launcher writes string results, or the string `text` field of an object result, directly to stdout. It JSON-serializes other results.
41
+
42
+
Add `--server` in either mode to start the Copilot server over stdio and force the Copilot engine. Without it, `copilotEngine()` connects over HTTP using `COPILOT_SDK_URI`, then `localhost:7777`.
43
+
44
+
Use `--help`, `-h`, `help`, `/help`, or `/?` to print launcher usage.
41
45
42
46
## Typechecking
43
47
@@ -74,12 +78,15 @@ Adapters implement the SDK-neutral interface:
Register a factory with `configureAgent(factory)`. Rig creates one adapter instance per invocation and preserves it across repair turns.
89
+
An `AgentFactory` receives the resolved `model`, `systemMessage`, and tools. Register a factory with `configureAgent(factory)`. Rig creates one adapter instance per invocation and preserves it across repair turns.
- `copilotEngine()`uses the Copilot SDK HTTP transport by default; launcher `--server` selects stdio.
112
-
- `piEngine({ provider})`uses `@earendil-works/pi-agent-core` and requires a provider for model lookup.
113
-
- `anthropicEngine()`uses `@anthropic-ai/sdk` and reads `ANTHROPIC_API_KEY`.
114
-
- `codexEngine(options)`uses `@openai/codex-sdk`, accepts thread options under `thread`, preserves the thread across repair turns, and maps Rig system messages to developer instructions. It rejects Rig tools because the SDK does not expose custom tool registration.
118
+
- `copilotEngine(options)`accepts Copilot client options plus `server` and `connection`. It supports Rig tools and uses the Copilot SDK HTTP transport by default; launcher `--server` selects stdio.
119
+
- `piEngine({ provider, models? })`uses `@earendil-works/pi-agent-core`, requires a provider for model lookup, and supports Rig tools.
120
+
- `anthropicEngine(options)`uses `@anthropic-ai/sdk`, reads `ANTHROPIC_API_KEY`, supports Rig tools, and accepts `maxTokens` and `maxIterations`.
121
+
- `codexEngine(options)`uses `@openai/codex-sdk`, accepts thread options under `thread`, preserves the thread across repair turns, maps Rig system messages to developer instructions, and forwards structured output schemas. It rejects Rig tools because the SDK does not expose custom tool registration.
115
122
- `geminiEngine(options)`runs an installed Gemini CLI in headless JSON mode and resumes its session across repair turns. It accepts `command`, `cwd`, CLI `args`, environment variables, and `approvalMode`; it rejects Rig tools because the CLI does not expose registration.
116
123
124
+
## Debug logging
125
+
126
+
Set `RIG_DEBUG` to comma- or whitespace-separated categories. A category includes its descendants, `*` matches all categories, and a leading `-` excludes a match:
0 commit comments