orizu 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -13
- package/dist/artifact-archive.js +152 -0
- package/dist/connectors-cli.js +80 -0
- package/dist/credentials.js +4 -1
- package/dist/daytona-slice-rehearsal.js +255 -0
- package/dist/daytona-slice.js +441 -0
- package/dist/egress-allowlist-cli.js +132 -0
- package/dist/egress-policy.js +159 -0
- package/dist/git-credential.js +131 -0
- package/dist/github-setup.js +226 -0
- package/dist/help.js +276 -21
- package/dist/hosted-bootstrap-rehearsal.js +235 -0
- package/dist/hosted-bootstrap.js +365 -0
- package/dist/hosted-broker-server.js +220 -0
- package/dist/hosted-git-http-server.js +136 -0
- package/dist/hosted-harness-claude.js +493 -0
- package/dist/hosted-harness-opencode.js +729 -0
- package/dist/hosted-harness.js +60 -0
- package/dist/hosted-loop.js +477 -0
- package/dist/hosted-run-event-sink.js +499 -0
- package/dist/hosted-runtime-assets.js +216 -0
- package/dist/hosted-session-cli.js +642 -0
- package/dist/index.js +945 -258
- package/dist/kill-switch-cli.js +89 -0
- package/dist/manifests-cli.js +143 -0
- package/dist/preview-runtime.js +4 -1
- package/dist/sandbox-provider.js +238 -0
- package/dist/secret-redaction.js +112 -0
- package/dist/session-timeline.js +103 -0
- package/dist/setup-prompt.js +4 -2
- package/dist/skill-installer.js +9 -1
- package/dist/smoke.js +250 -0
- package/dist/task-assignment-manifest.js +96 -0
- package/dist/vercel-sandbox-provider.js +260 -0
- package/dist/workbench-cli.js +493 -0
- package/dist/workspace-sync.js +924 -0
- package/dist/workspace.js +868 -57
- package/package.json +4 -1
- package/src/artifact-archive.ts +182 -0
- package/src/connectors-cli.ts +115 -0
- package/src/credentials.ts +6 -2
- package/src/daytona-slice-rehearsal.ts +320 -0
- package/src/daytona-slice.ts +598 -0
- package/src/egress-allowlist-cli.ts +147 -0
- package/src/egress-policy.ts +188 -0
- package/src/git-credential.ts +155 -0
- package/src/github-setup.ts +366 -0
- package/src/help.ts +277 -21
- package/src/hosted-bootstrap-rehearsal.ts +312 -0
- package/src/hosted-bootstrap.ts +571 -0
- package/src/hosted-broker-server.ts +278 -0
- package/src/hosted-git-http-server.ts +164 -0
- package/src/hosted-harness-claude.ts +621 -0
- package/src/hosted-harness-opencode.ts +823 -0
- package/src/hosted-harness.ts +124 -0
- package/src/hosted-loop.ts +680 -0
- package/src/hosted-run-event-sink.ts +632 -0
- package/src/hosted-runtime-assets.ts +272 -0
- package/src/hosted-session-cli.ts +844 -0
- package/src/index.ts +1102 -317
- package/src/kill-switch-cli.ts +113 -0
- package/src/manifests-cli.ts +168 -0
- package/src/preview-runtime.ts +14 -9
- package/src/sandbox-provider.ts +440 -0
- package/src/secret-redaction.ts +124 -0
- package/src/session-timeline.ts +152 -0
- package/src/setup-prompt.ts +4 -2
- package/src/skill-installer.ts +13 -1
- package/src/smoke.ts +342 -0
- package/src/task-assignment-manifest.ts +164 -0
- package/src/vercel-sandbox-provider.ts +388 -0
- package/src/workbench-cli.ts +701 -0
- package/src/workspace-sync.ts +1148 -0
- package/src/workspace.ts +1051 -64
- package/vendor/skills/orizu-cli/SKILL.md +8 -4
- package/vendor/skills/orizu-cli/references/cli-reference.md +12 -4
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentHarness seam (ALI-926 / P3.4, interface 1 of ADR-005's swappability
|
|
3
|
+
* contract; sketch in audit §4a).
|
|
4
|
+
*
|
|
5
|
+
* `AgentHarness` abstracts "what starts and steps the agent" so the OpenCode
|
|
6
|
+
* driver (`hosted-harness-opencode.ts`) can be swapped for a Claude-Agent-SDK
|
|
7
|
+
* loop (ALI-929) WITHOUT touching the event bridge (`hosted-run-event-sink.ts`)
|
|
8
|
+
* or the RunAPI. The interface therefore carries ZERO OpenCode types: it speaks
|
|
9
|
+
* only in normalized `HarnessEvent`s whose `kind` is the audit §4b left column.
|
|
10
|
+
*
|
|
11
|
+
* Shape ported (in DESIGN, not code) from OpenInspect's `bridge.py`:
|
|
12
|
+
* create session → send prompt → stream parts → detect idle → stop.
|
|
13
|
+
* The OpenCode-specific SSE part schema, message-id correlation, and localhost
|
|
14
|
+
* HTTP driving live entirely behind this seam.
|
|
15
|
+
*
|
|
16
|
+
* Terminal semantics: `execution_complete` and `error` are emitted as ordinary
|
|
17
|
+
* stream events with `critical: true`. The bridge (§4b) routes those to the
|
|
18
|
+
* RunAPI terminal PATCH — they are NEVER appended as raw run events. The harness
|
|
19
|
+
* does not know about run status; "Orizu records win" (the disagreement rule) is
|
|
20
|
+
* enforced by the sink, not here.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Minimal MCP server descriptor. Kept structural so the seam does not depend on
|
|
24
|
+
* any concrete MCP client type; the driver interprets it. */
|
|
25
|
+
export interface McpServerConfig {
|
|
26
|
+
name: string
|
|
27
|
+
/** Transport hint the driver understands (e.g. 'stdio' | 'http'). */
|
|
28
|
+
transport?: string
|
|
29
|
+
command?: string
|
|
30
|
+
args?: readonly string[]
|
|
31
|
+
url?: string
|
|
32
|
+
env?: Record<string, string>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface HarnessStartOptions {
|
|
36
|
+
/** Absolute or repo-relative working directory the agent operates in. */
|
|
37
|
+
workspaceDir: string
|
|
38
|
+
/** Provider-qualified model, e.g. "anthropic/claude-opus-4-8". */
|
|
39
|
+
model: string
|
|
40
|
+
reasoningEffort?: string
|
|
41
|
+
mcpServers?: readonly McpServerConfig[]
|
|
42
|
+
/** OpenCode session id persisted across restarts (reconnect/resume). */
|
|
43
|
+
resumeAgentSessionId?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface HarnessPrompt {
|
|
47
|
+
runId: string
|
|
48
|
+
/** Idempotency / correlation key handed by the caller. */
|
|
49
|
+
messageId: string
|
|
50
|
+
content: string
|
|
51
|
+
/** Git identity used for commit attribution during the prompt. */
|
|
52
|
+
author: { name: string; email: string }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The normalized event vocabulary — the audit §4b left column. The bridge maps
|
|
57
|
+
* each kind onto a `workbench_run_events.event_type` (or drops it). Kept as a
|
|
58
|
+
* const map (no enums, per project guidelines).
|
|
59
|
+
*
|
|
60
|
+
* `push_complete` / `push_error` are deliberately OMITTED: they belong to the
|
|
61
|
+
* finish-branch / manifest push flow deferred to P3.5. `heartbeat` and
|
|
62
|
+
* `user_message` are not modeled at all — the harness never emits liveness or
|
|
63
|
+
* prompt-echo events (§4b drops both).
|
|
64
|
+
*/
|
|
65
|
+
export const HARNESS_EVENT_KINDS = {
|
|
66
|
+
ready: 'ready',
|
|
67
|
+
token: 'token',
|
|
68
|
+
tool_call: 'tool_call',
|
|
69
|
+
tool_result: 'tool_result',
|
|
70
|
+
step_start: 'step_start',
|
|
71
|
+
step_finish: 'step_finish',
|
|
72
|
+
git_sync: 'git_sync',
|
|
73
|
+
artifact: 'artifact',
|
|
74
|
+
session_title: 'session_title',
|
|
75
|
+
// Egress-canary results (G5 / ALI-1006). NOT produced by a harness — the
|
|
76
|
+
// in-sandbox loop emits these through the SAME single-writer run-event sink
|
|
77
|
+
// right after bootstrap (the startup canary that proves the firewall is live).
|
|
78
|
+
// They are part of the §4b run-event vocabulary (G6 lists "egress attempt")
|
|
79
|
+
// and never terminal, so they append like any structural event.
|
|
80
|
+
egress_blocked: 'egress_blocked',
|
|
81
|
+
egress_allowed: 'egress_allowed',
|
|
82
|
+
error: 'error',
|
|
83
|
+
execution_complete: 'execution_complete',
|
|
84
|
+
} as const
|
|
85
|
+
|
|
86
|
+
export type HarnessEventKind = keyof typeof HARNESS_EVENT_KINDS
|
|
87
|
+
|
|
88
|
+
/** The two kinds that must NEVER be appended as raw events — they drive the
|
|
89
|
+
* terminal PATCH instead (§4b mapping rule). */
|
|
90
|
+
export const HARNESS_TERMINAL_KINDS = {
|
|
91
|
+
execution_complete: 'execution_complete',
|
|
92
|
+
error: 'error',
|
|
93
|
+
} as const
|
|
94
|
+
|
|
95
|
+
export function isHarnessTerminalKind(kind: HarnessEventKind): boolean {
|
|
96
|
+
return kind in HARNESS_TERMINAL_KINDS
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface HarnessEvent {
|
|
100
|
+
kind: HarnessEventKind
|
|
101
|
+
/** Correlation key for coalescing (token snapshots) and attribution. */
|
|
102
|
+
messageId?: string
|
|
103
|
+
payload: Record<string, unknown>
|
|
104
|
+
/** Requires guaranteed delivery (execution_complete / error / push_*). */
|
|
105
|
+
critical?: boolean
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface AgentHarness {
|
|
109
|
+
/** Stable driver name — "opencode" | "claude-agent-sdk". */
|
|
110
|
+
readonly name: string
|
|
111
|
+
/** Boot the agent process/session; returns the resumable agent session id. */
|
|
112
|
+
start(opts: HarnessStartOptions): Promise<{ agentSessionId: string }>
|
|
113
|
+
/**
|
|
114
|
+
* Drive one prompt to completion, yielding normalized events. Cancellable via
|
|
115
|
+
* `signal` (abort → the driver requests the agent to stop and ends the stream
|
|
116
|
+
* with a terminal event). The stream ALWAYS ends with exactly one terminal
|
|
117
|
+
* event (`execution_complete` or `error`).
|
|
118
|
+
*/
|
|
119
|
+
runPrompt(prompt: HarnessPrompt, signal: AbortSignal): AsyncIterable<HarnessEvent>
|
|
120
|
+
/** Abort the in-flight prompt (e.g. OpenCode POST /session/{id}/abort). */
|
|
121
|
+
stop(): Promise<void>
|
|
122
|
+
/** Release all resources; the harness is unusable afterward. */
|
|
123
|
+
shutdown(): Promise<void>
|
|
124
|
+
}
|