@h-rig/contracts 0.0.6-alpha.77 → 0.0.6-alpha.79
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/dist/index.cjs +5277 -0
- package/dist/index.mjs +5234 -0
- package/dist/src/artifact.d.ts +13 -0
- package/dist/src/baseSchemas.d.ts +57 -0
- package/dist/src/cli-output.d.ts +234 -0
- package/dist/src/config.d.ts +316 -0
- package/dist/src/conversation.d.ts +50 -0
- package/dist/src/editor.d.ts +25 -0
- package/dist/src/engine.d.ts +2789 -0
- package/dist/src/git.d.ts +144 -0
- package/dist/src/graph.d.ts +39 -0
- package/dist/src/index.d.ts +33 -0
- package/dist/src/ipc.d.ts +247 -0
- package/dist/src/keybindings.d.ts +71 -0
- package/dist/src/model.d.ts +77 -0
- package/dist/src/orchestration.d.ts +3695 -0
- package/dist/src/pi-session.d.ts +113 -0
- package/dist/src/plugin-hooks.d.ts +51 -0
- package/dist/src/plugin.d.ts +230 -0
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/project.d.ts +71 -0
- package/dist/src/protocol-version.d.ts +21 -0
- package/dist/src/provider.d.ts +105 -0
- package/dist/src/providerRuntime.d.ts +3949 -0
- package/dist/src/remote.d.ts +326 -0
- package/dist/src/review.d.ts +18 -0
- package/dist/src/rig.d.ts +753 -0
- package/dist/src/run-journal.d.ts +763 -0
- package/dist/src/runtime.d.ts +103 -0
- package/dist/src/server.d.ts +106 -0
- package/dist/src/serviceFabric.d.ts +62 -0
- package/dist/src/task-source.d.ts +28 -0
- package/dist/src/terminal.d.ts +130 -0
- package/dist/src/validation.d.ts +14 -0
- package/dist/src/workspace.d.ts +204 -0
- package/dist/src/ws.d.ts +733 -0
- package/package.json +6 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export type RigPiSessionTransport = "http-control-ws-events";
|
|
2
|
+
export interface RigPiSessionMetadata {
|
|
3
|
+
runId: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
daemonId: string;
|
|
6
|
+
cwd: string;
|
|
7
|
+
agentDir: string;
|
|
8
|
+
sessionDir: string;
|
|
9
|
+
transport: RigPiSessionTransport;
|
|
10
|
+
/**
|
|
11
|
+
* Absolute path of the Pi session jsonl backing this session, when the
|
|
12
|
+
* session persists to disk. Recorded on the run record so a tier-1
|
|
13
|
+
* re-dispatch (deploy-safe runs) can reopen the same session.
|
|
14
|
+
*/
|
|
15
|
+
sessionFile?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Set when the daemon reopened a previous attempt's session file instead
|
|
18
|
+
* of creating a fresh session (tier-1 session resume).
|
|
19
|
+
*/
|
|
20
|
+
resumedFromSessionFile?: string;
|
|
21
|
+
serverBasePath: string;
|
|
22
|
+
eventsPath: string;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
backend: {
|
|
26
|
+
kind: "worker-pi-sessiond";
|
|
27
|
+
version: string;
|
|
28
|
+
pid?: number;
|
|
29
|
+
commit?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export type RigPiDaemonConnection = {
|
|
33
|
+
mode: "unix";
|
|
34
|
+
socketPath: string;
|
|
35
|
+
tokenRef: string;
|
|
36
|
+
endpointId?: string;
|
|
37
|
+
hostId?: string;
|
|
38
|
+
} | {
|
|
39
|
+
mode: "http";
|
|
40
|
+
baseUrl: string;
|
|
41
|
+
tokenRef: string;
|
|
42
|
+
endpointId?: string;
|
|
43
|
+
hostId?: string;
|
|
44
|
+
};
|
|
45
|
+
export interface RigPiSessionPrivateMetadata {
|
|
46
|
+
public: RigPiSessionMetadata;
|
|
47
|
+
daemonConnection: RigPiDaemonConnection;
|
|
48
|
+
}
|
|
49
|
+
export type RigPiControlStreamingBehavior = "steer" | "followUp";
|
|
50
|
+
export interface RigPiPromptRequest {
|
|
51
|
+
text: string;
|
|
52
|
+
streamingBehavior?: RigPiControlStreamingBehavior;
|
|
53
|
+
}
|
|
54
|
+
export interface RigPiShellRequest {
|
|
55
|
+
text: string;
|
|
56
|
+
}
|
|
57
|
+
export interface RigPiCommandRequest {
|
|
58
|
+
text: string;
|
|
59
|
+
}
|
|
60
|
+
export interface RigPiCommandResponseRequest {
|
|
61
|
+
requestId: string;
|
|
62
|
+
value?: unknown;
|
|
63
|
+
cancelled?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface RigPiExtensionUiResponseRequest {
|
|
66
|
+
requestId: string;
|
|
67
|
+
value?: unknown;
|
|
68
|
+
cancelled?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface RigPiReadyPendingResponse {
|
|
71
|
+
ready: false;
|
|
72
|
+
runId: string;
|
|
73
|
+
status?: string;
|
|
74
|
+
retryAfterMs: number;
|
|
75
|
+
}
|
|
76
|
+
export interface RigPiReadyResponse {
|
|
77
|
+
ready: true;
|
|
78
|
+
metadata: RigPiSessionMetadata;
|
|
79
|
+
}
|
|
80
|
+
export type RigPiSessionResponse = RigPiReadyPendingResponse | RigPiReadyResponse;
|
|
81
|
+
export type RigPiEventEnvelope = {
|
|
82
|
+
type: "ready";
|
|
83
|
+
metadata: RigPiSessionMetadata;
|
|
84
|
+
} | {
|
|
85
|
+
type: "pi.event";
|
|
86
|
+
sessionId: string;
|
|
87
|
+
runId?: string;
|
|
88
|
+
event: unknown;
|
|
89
|
+
} | {
|
|
90
|
+
type: "pi.ui_event";
|
|
91
|
+
sessionId: string;
|
|
92
|
+
runId?: string;
|
|
93
|
+
event: unknown;
|
|
94
|
+
} | {
|
|
95
|
+
type: "extension_ui_request";
|
|
96
|
+
sessionId: string;
|
|
97
|
+
runId?: string;
|
|
98
|
+
request: unknown;
|
|
99
|
+
} | {
|
|
100
|
+
type: "status.update";
|
|
101
|
+
sessionId: string;
|
|
102
|
+
runId?: string;
|
|
103
|
+
status: unknown;
|
|
104
|
+
} | {
|
|
105
|
+
type: "activity.update";
|
|
106
|
+
sessionId: string;
|
|
107
|
+
runId?: string;
|
|
108
|
+
activity: unknown;
|
|
109
|
+
} | {
|
|
110
|
+
type: "error";
|
|
111
|
+
message: string;
|
|
112
|
+
detail?: unknown;
|
|
113
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** Tool input payload as delivered on the hook's stdin (`tool_input`). */
|
|
3
|
+
export declare const HookToolInput: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
4
|
+
export type HookToolInput = typeof HookToolInput.Type;
|
|
5
|
+
/**
|
|
6
|
+
* Parsed hook invocation handed to a typed hook implementation.
|
|
7
|
+
*
|
|
8
|
+
* Derived from the Claude Code hook stdin payload (see @rig/hook-kit's
|
|
9
|
+
* `readHookInput`) plus the runner's resolved environment:
|
|
10
|
+
* - `event` — the lifecycle event the hook fired on
|
|
11
|
+
* - `toolName` — `tool_name` from the payload (absent for non-tool events)
|
|
12
|
+
* - `toolInput` — `tool_input` from the payload (`{}` when absent)
|
|
13
|
+
* - `filePaths` — file path candidates extracted from the tool input
|
|
14
|
+
* (@rig/hook-kit's `extractToolFilePaths`)
|
|
15
|
+
* - `projectRoot` — resolved project root (@rig/hook-kit's `resolveProjectRoot`)
|
|
16
|
+
* - `taskId` — current Rig task id, `""` when not running inside a task
|
|
17
|
+
*/
|
|
18
|
+
export declare const HookContext: Schema.Struct<{
|
|
19
|
+
readonly event: Schema.Literals<readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Stop", "SessionStart", "SessionEnd"]>;
|
|
20
|
+
readonly toolName: Schema.optional<Schema.String>;
|
|
21
|
+
readonly toolInput: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
22
|
+
readonly filePaths: Schema.$Array<Schema.String>;
|
|
23
|
+
readonly projectRoot: Schema.String;
|
|
24
|
+
readonly taskId: Schema.String;
|
|
25
|
+
}>;
|
|
26
|
+
export type HookContext = typeof HookContext.Type;
|
|
27
|
+
export declare const HookDecision: Schema.Literals<readonly ["allow", "block"]>;
|
|
28
|
+
export type HookDecision = typeof HookDecision.Type;
|
|
29
|
+
/**
|
|
30
|
+
* Result returned by a typed hook implementation.
|
|
31
|
+
*
|
|
32
|
+
* Serialized to the same stdout/exit-code protocol that @rig/hook-kit's
|
|
33
|
+
* `block()` uses (the contract Claude Code's hook runner expects):
|
|
34
|
+
* - `decision: "block"` → `BLOCKED: <reason>` on stdout, non-zero exit
|
|
35
|
+
* - `decision: "allow"` → exit 0; `systemMessage` (when set) on stdout
|
|
36
|
+
*/
|
|
37
|
+
export declare const HookResult: Schema.Struct<{
|
|
38
|
+
readonly decision: Schema.Literals<readonly ["allow", "block"]>;
|
|
39
|
+
/** Why the action was blocked. Surfaced to the agent on stdout. */
|
|
40
|
+
readonly reason: Schema.optional<Schema.String>;
|
|
41
|
+
/** Extra context printed on stdout for either decision. */
|
|
42
|
+
readonly systemMessage: Schema.optional<Schema.String>;
|
|
43
|
+
}>;
|
|
44
|
+
export type HookResult = typeof HookResult.Type;
|
|
45
|
+
/**
|
|
46
|
+
* A typed hook implementation. Registered per hook id via definePlugin's
|
|
47
|
+
* runtime channel: `definePlugin(meta, { hooks: { [hookId]: impl } })`.
|
|
48
|
+
* Functions can't be represented by Schema, so this is a plain type — the
|
|
49
|
+
* referential-integrity rules are enforced by @rig/core's definePlugin.
|
|
50
|
+
*/
|
|
51
|
+
export type HookImplementation = (input: HookContext) => Promise<HookResult> | HookResult;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const ValidatorCategory: Schema.Literals<readonly ["boundary", "contract", "integration", "regression", "external", "custom"]>;
|
|
3
|
+
export type ValidatorCategory = typeof ValidatorCategory.Type;
|
|
4
|
+
export declare const ValidatorRegistration: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.String;
|
|
6
|
+
readonly category: Schema.Literals<readonly ["boundary", "contract", "integration", "regression", "external", "custom"]>;
|
|
7
|
+
readonly description: Schema.optional<Schema.String>;
|
|
8
|
+
}>;
|
|
9
|
+
export type ValidatorRegistration = typeof ValidatorRegistration.Type;
|
|
10
|
+
export declare const HookEvent: Schema.Literals<readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Stop", "SessionStart", "SessionEnd"]>;
|
|
11
|
+
export type HookEvent = typeof HookEvent.Type;
|
|
12
|
+
export declare const HookMatcher: Schema.Union<readonly [Schema.Struct<{
|
|
13
|
+
readonly kind: Schema.Literal<"all">;
|
|
14
|
+
}>, Schema.Struct<{
|
|
15
|
+
readonly kind: Schema.Literal<"tool">;
|
|
16
|
+
readonly name: Schema.String;
|
|
17
|
+
}>, Schema.Struct<{
|
|
18
|
+
readonly kind: Schema.Literal<"glob">;
|
|
19
|
+
readonly pattern: Schema.String;
|
|
20
|
+
}>]>;
|
|
21
|
+
export type HookMatcher = typeof HookMatcher.Type;
|
|
22
|
+
export declare const HookRegistration: Schema.Struct<{
|
|
23
|
+
readonly id: Schema.String;
|
|
24
|
+
readonly event: Schema.Literals<readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Stop", "SessionStart", "SessionEnd"]>;
|
|
25
|
+
readonly matcher: Schema.Union<readonly [Schema.Struct<{
|
|
26
|
+
readonly kind: Schema.Literal<"all">;
|
|
27
|
+
}>, Schema.Struct<{
|
|
28
|
+
readonly kind: Schema.Literal<"tool">;
|
|
29
|
+
readonly name: Schema.String;
|
|
30
|
+
}>, Schema.Struct<{
|
|
31
|
+
readonly kind: Schema.Literal<"glob">;
|
|
32
|
+
readonly pattern: Schema.String;
|
|
33
|
+
}>]>;
|
|
34
|
+
/**
|
|
35
|
+
* Shell command Claude Code invokes when this hook fires. Resolved as-is by
|
|
36
|
+
* Claude Code's hook runner. Use absolute paths or expand
|
|
37
|
+
* `$CLAUDE_PROJECT_DIR` for project-relative paths.
|
|
38
|
+
*
|
|
39
|
+
* Alternative: leave `command` unset and ship a typed implementation via
|
|
40
|
+
* definePlugin's runtime channel (`{ hooks: { [hookId]: fn } }`) — see
|
|
41
|
+
* `HookContext`/`HookResult`/`HookImplementation` in plugin-hooks.ts. The
|
|
42
|
+
* runtime materializes a shim command for typed hooks automatically. A hook
|
|
43
|
+
* may not have both a `command` and a typed implementation.
|
|
44
|
+
*/
|
|
45
|
+
readonly command: Schema.optional<Schema.String>;
|
|
46
|
+
readonly description: Schema.optional<Schema.String>;
|
|
47
|
+
}>;
|
|
48
|
+
export type HookRegistration = typeof HookRegistration.Type;
|
|
49
|
+
export declare const SkillRegistration: Schema.Struct<{
|
|
50
|
+
readonly id: Schema.String;
|
|
51
|
+
readonly path: Schema.String;
|
|
52
|
+
readonly description: Schema.optional<Schema.String>;
|
|
53
|
+
}>;
|
|
54
|
+
export type SkillRegistration = typeof SkillRegistration.Type;
|
|
55
|
+
export declare const RepoSourceRegistration: Schema.Struct<{
|
|
56
|
+
readonly id: Schema.String;
|
|
57
|
+
readonly url: Schema.String;
|
|
58
|
+
readonly defaultPath: Schema.optional<Schema.String>;
|
|
59
|
+
readonly description: Schema.optional<Schema.String>;
|
|
60
|
+
readonly defaultBranch: Schema.optional<Schema.String>;
|
|
61
|
+
readonly remoteEnvVar: Schema.optional<Schema.String>;
|
|
62
|
+
readonly checkoutEnvVar: Schema.optional<Schema.String>;
|
|
63
|
+
}>;
|
|
64
|
+
export type RepoSourceRegistration = typeof RepoSourceRegistration.Type;
|
|
65
|
+
export declare const AgentRoleRegistration: Schema.Struct<{
|
|
66
|
+
readonly id: Schema.String;
|
|
67
|
+
readonly defaultModel: Schema.optional<Schema.String>;
|
|
68
|
+
readonly description: Schema.optional<Schema.String>;
|
|
69
|
+
}>;
|
|
70
|
+
export type AgentRoleRegistration = typeof AgentRoleRegistration.Type;
|
|
71
|
+
export declare const TaskFieldExtension: Schema.Struct<{
|
|
72
|
+
readonly id: Schema.String;
|
|
73
|
+
readonly fieldName: Schema.String;
|
|
74
|
+
readonly schemaJson: Schema.String;
|
|
75
|
+
}>;
|
|
76
|
+
export type TaskFieldExtension = typeof TaskFieldExtension.Type;
|
|
77
|
+
export declare const TaskSourceKind: Schema.String;
|
|
78
|
+
export type TaskSourceKind = string;
|
|
79
|
+
export declare const TaskSourceRegistration: Schema.Struct<{
|
|
80
|
+
readonly id: Schema.String;
|
|
81
|
+
readonly kind: Schema.String;
|
|
82
|
+
readonly description: Schema.optional<Schema.String>;
|
|
83
|
+
}>;
|
|
84
|
+
export type TaskSourceRegistration = typeof TaskSourceRegistration.Type;
|
|
85
|
+
export declare const CliCommandRegistration: Schema.Struct<{
|
|
86
|
+
readonly id: Schema.String;
|
|
87
|
+
readonly command: Schema.String;
|
|
88
|
+
readonly description: Schema.optional<Schema.String>;
|
|
89
|
+
}>;
|
|
90
|
+
export type CliCommandRegistration = typeof CliCommandRegistration.Type;
|
|
91
|
+
export declare const PluginContributes: Schema.Struct<{
|
|
92
|
+
readonly validators: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
93
|
+
readonly id: Schema.String;
|
|
94
|
+
readonly category: Schema.Literals<readonly ["boundary", "contract", "integration", "regression", "external", "custom"]>;
|
|
95
|
+
readonly description: Schema.optional<Schema.String>;
|
|
96
|
+
}>>>;
|
|
97
|
+
readonly hooks: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
98
|
+
readonly id: Schema.String;
|
|
99
|
+
readonly event: Schema.Literals<readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Stop", "SessionStart", "SessionEnd"]>;
|
|
100
|
+
readonly matcher: Schema.Union<readonly [Schema.Struct<{
|
|
101
|
+
readonly kind: Schema.Literal<"all">;
|
|
102
|
+
}>, Schema.Struct<{
|
|
103
|
+
readonly kind: Schema.Literal<"tool">;
|
|
104
|
+
readonly name: Schema.String;
|
|
105
|
+
}>, Schema.Struct<{
|
|
106
|
+
readonly kind: Schema.Literal<"glob">;
|
|
107
|
+
readonly pattern: Schema.String;
|
|
108
|
+
}>]>;
|
|
109
|
+
/**
|
|
110
|
+
* Shell command Claude Code invokes when this hook fires. Resolved as-is by
|
|
111
|
+
* Claude Code's hook runner. Use absolute paths or expand
|
|
112
|
+
* `$CLAUDE_PROJECT_DIR` for project-relative paths.
|
|
113
|
+
*
|
|
114
|
+
* Alternative: leave `command` unset and ship a typed implementation via
|
|
115
|
+
* definePlugin's runtime channel (`{ hooks: { [hookId]: fn } }`) — see
|
|
116
|
+
* `HookContext`/`HookResult`/`HookImplementation` in plugin-hooks.ts. The
|
|
117
|
+
* runtime materializes a shim command for typed hooks automatically. A hook
|
|
118
|
+
* may not have both a `command` and a typed implementation.
|
|
119
|
+
*/
|
|
120
|
+
readonly command: Schema.optional<Schema.String>;
|
|
121
|
+
readonly description: Schema.optional<Schema.String>;
|
|
122
|
+
}>>>;
|
|
123
|
+
readonly skills: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
124
|
+
readonly id: Schema.String;
|
|
125
|
+
readonly path: Schema.String;
|
|
126
|
+
readonly description: Schema.optional<Schema.String>;
|
|
127
|
+
}>>>;
|
|
128
|
+
readonly repoSources: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
129
|
+
readonly id: Schema.String;
|
|
130
|
+
readonly url: Schema.String;
|
|
131
|
+
readonly defaultPath: Schema.optional<Schema.String>;
|
|
132
|
+
readonly description: Schema.optional<Schema.String>;
|
|
133
|
+
readonly defaultBranch: Schema.optional<Schema.String>;
|
|
134
|
+
readonly remoteEnvVar: Schema.optional<Schema.String>;
|
|
135
|
+
readonly checkoutEnvVar: Schema.optional<Schema.String>;
|
|
136
|
+
}>>>;
|
|
137
|
+
readonly agentRoles: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
138
|
+
readonly id: Schema.String;
|
|
139
|
+
readonly defaultModel: Schema.optional<Schema.String>;
|
|
140
|
+
readonly description: Schema.optional<Schema.String>;
|
|
141
|
+
}>>>;
|
|
142
|
+
readonly taskFieldSchemas: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
143
|
+
readonly id: Schema.String;
|
|
144
|
+
readonly fieldName: Schema.String;
|
|
145
|
+
readonly schemaJson: Schema.String;
|
|
146
|
+
}>>>;
|
|
147
|
+
readonly taskSources: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
148
|
+
readonly id: Schema.String;
|
|
149
|
+
readonly kind: Schema.String;
|
|
150
|
+
readonly description: Schema.optional<Schema.String>;
|
|
151
|
+
}>>>;
|
|
152
|
+
readonly cliCommands: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
153
|
+
readonly id: Schema.String;
|
|
154
|
+
readonly command: Schema.String;
|
|
155
|
+
readonly description: Schema.optional<Schema.String>;
|
|
156
|
+
}>>>;
|
|
157
|
+
}>;
|
|
158
|
+
export type PluginContributes = typeof PluginContributes.Type;
|
|
159
|
+
export declare const RigPlugin: Schema.Struct<{
|
|
160
|
+
readonly name: Schema.String;
|
|
161
|
+
readonly version: Schema.String;
|
|
162
|
+
readonly contributes: Schema.optional<Schema.Struct<{
|
|
163
|
+
readonly validators: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
164
|
+
readonly id: Schema.String;
|
|
165
|
+
readonly category: Schema.Literals<readonly ["boundary", "contract", "integration", "regression", "external", "custom"]>;
|
|
166
|
+
readonly description: Schema.optional<Schema.String>;
|
|
167
|
+
}>>>;
|
|
168
|
+
readonly hooks: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
169
|
+
readonly id: Schema.String;
|
|
170
|
+
readonly event: Schema.Literals<readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Stop", "SessionStart", "SessionEnd"]>;
|
|
171
|
+
readonly matcher: Schema.Union<readonly [Schema.Struct<{
|
|
172
|
+
readonly kind: Schema.Literal<"all">;
|
|
173
|
+
}>, Schema.Struct<{
|
|
174
|
+
readonly kind: Schema.Literal<"tool">;
|
|
175
|
+
readonly name: Schema.String;
|
|
176
|
+
}>, Schema.Struct<{
|
|
177
|
+
readonly kind: Schema.Literal<"glob">;
|
|
178
|
+
readonly pattern: Schema.String;
|
|
179
|
+
}>]>;
|
|
180
|
+
/**
|
|
181
|
+
* Shell command Claude Code invokes when this hook fires. Resolved as-is by
|
|
182
|
+
* Claude Code's hook runner. Use absolute paths or expand
|
|
183
|
+
* `$CLAUDE_PROJECT_DIR` for project-relative paths.
|
|
184
|
+
*
|
|
185
|
+
* Alternative: leave `command` unset and ship a typed implementation via
|
|
186
|
+
* definePlugin's runtime channel (`{ hooks: { [hookId]: fn } }`) — see
|
|
187
|
+
* `HookContext`/`HookResult`/`HookImplementation` in plugin-hooks.ts. The
|
|
188
|
+
* runtime materializes a shim command for typed hooks automatically. A hook
|
|
189
|
+
* may not have both a `command` and a typed implementation.
|
|
190
|
+
*/
|
|
191
|
+
readonly command: Schema.optional<Schema.String>;
|
|
192
|
+
readonly description: Schema.optional<Schema.String>;
|
|
193
|
+
}>>>;
|
|
194
|
+
readonly skills: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
195
|
+
readonly id: Schema.String;
|
|
196
|
+
readonly path: Schema.String;
|
|
197
|
+
readonly description: Schema.optional<Schema.String>;
|
|
198
|
+
}>>>;
|
|
199
|
+
readonly repoSources: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
200
|
+
readonly id: Schema.String;
|
|
201
|
+
readonly url: Schema.String;
|
|
202
|
+
readonly defaultPath: Schema.optional<Schema.String>;
|
|
203
|
+
readonly description: Schema.optional<Schema.String>;
|
|
204
|
+
readonly defaultBranch: Schema.optional<Schema.String>;
|
|
205
|
+
readonly remoteEnvVar: Schema.optional<Schema.String>;
|
|
206
|
+
readonly checkoutEnvVar: Schema.optional<Schema.String>;
|
|
207
|
+
}>>>;
|
|
208
|
+
readonly agentRoles: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
209
|
+
readonly id: Schema.String;
|
|
210
|
+
readonly defaultModel: Schema.optional<Schema.String>;
|
|
211
|
+
readonly description: Schema.optional<Schema.String>;
|
|
212
|
+
}>>>;
|
|
213
|
+
readonly taskFieldSchemas: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
214
|
+
readonly id: Schema.String;
|
|
215
|
+
readonly fieldName: Schema.String;
|
|
216
|
+
readonly schemaJson: Schema.String;
|
|
217
|
+
}>>>;
|
|
218
|
+
readonly taskSources: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
219
|
+
readonly id: Schema.String;
|
|
220
|
+
readonly kind: Schema.String;
|
|
221
|
+
readonly description: Schema.optional<Schema.String>;
|
|
222
|
+
}>>>;
|
|
223
|
+
readonly cliCommands: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
224
|
+
readonly id: Schema.String;
|
|
225
|
+
readonly command: Schema.String;
|
|
226
|
+
readonly description: Schema.optional<Schema.String>;
|
|
227
|
+
}>>>;
|
|
228
|
+
}>>;
|
|
229
|
+
}>;
|
|
230
|
+
export type RigPlugin = typeof RigPlugin.Type;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const PolicyDecision: Schema.Literals<readonly ["allow", "warn", "block"]>;
|
|
3
|
+
export type PolicyDecision = typeof PolicyDecision.Type;
|
|
4
|
+
export declare const PolicyMode: Schema.Literals<readonly ["off", "observe", "enforce"]>;
|
|
5
|
+
export type PolicyMode = typeof PolicyMode.Type;
|
|
6
|
+
export declare const PolicyDecisionSummary: Schema.Struct<{
|
|
7
|
+
readonly id: Schema.Trim;
|
|
8
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
9
|
+
readonly actionId: Schema.NullOr<Schema.brand<Schema.Trim, "ActionId">>;
|
|
10
|
+
readonly decision: Schema.Literals<readonly ["allow", "warn", "block"]>;
|
|
11
|
+
readonly mode: Schema.Literals<readonly ["off", "observe", "enforce"]>;
|
|
12
|
+
readonly matchedRules: Schema.$Array<Schema.Trim>;
|
|
13
|
+
readonly reason: Schema.String;
|
|
14
|
+
readonly createdAt: Schema.String;
|
|
15
|
+
}>;
|
|
16
|
+
export type PolicyDecisionSummary = typeof PolicyDecisionSummary.Type;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const ProjectSearchEntriesInput: Schema.Struct<{
|
|
3
|
+
readonly cwd: Schema.Trim;
|
|
4
|
+
readonly query: Schema.Trim;
|
|
5
|
+
readonly limit: Schema.Int;
|
|
6
|
+
}>;
|
|
7
|
+
export type ProjectSearchEntriesInput = typeof ProjectSearchEntriesInput.Type;
|
|
8
|
+
export declare const ProjectEntry: Schema.Struct<{
|
|
9
|
+
readonly path: Schema.Trim;
|
|
10
|
+
readonly kind: Schema.Literals<readonly ["file", "directory"]>;
|
|
11
|
+
readonly parentPath: Schema.optional<Schema.Trim>;
|
|
12
|
+
}>;
|
|
13
|
+
export type ProjectEntry = typeof ProjectEntry.Type;
|
|
14
|
+
export declare const ProjectSearchEntriesResult: Schema.Struct<{
|
|
15
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
16
|
+
readonly path: Schema.Trim;
|
|
17
|
+
readonly kind: Schema.Literals<readonly ["file", "directory"]>;
|
|
18
|
+
readonly parentPath: Schema.optional<Schema.Trim>;
|
|
19
|
+
}>>;
|
|
20
|
+
readonly truncated: Schema.Boolean;
|
|
21
|
+
}>;
|
|
22
|
+
export type ProjectSearchEntriesResult = typeof ProjectSearchEntriesResult.Type;
|
|
23
|
+
export declare const ProjectListDirectoryInput: Schema.Struct<{
|
|
24
|
+
readonly cwd: Schema.Trim;
|
|
25
|
+
readonly relativePath: Schema.Trim;
|
|
26
|
+
readonly limit: Schema.Int;
|
|
27
|
+
}>;
|
|
28
|
+
export type ProjectListDirectoryInput = typeof ProjectListDirectoryInput.Type;
|
|
29
|
+
export declare const ProjectDirectoryEntry: Schema.Struct<{
|
|
30
|
+
readonly name: Schema.Trim;
|
|
31
|
+
readonly relativePath: Schema.Trim;
|
|
32
|
+
readonly kind: Schema.Literals<readonly ["file", "directory"]>;
|
|
33
|
+
readonly sizeBytes: Schema.optional<Schema.Int>;
|
|
34
|
+
readonly modifiedAt: Schema.optional<Schema.String>;
|
|
35
|
+
}>;
|
|
36
|
+
export type ProjectDirectoryEntry = typeof ProjectDirectoryEntry.Type;
|
|
37
|
+
export declare const ProjectListDirectoryResult: Schema.Struct<{
|
|
38
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
39
|
+
readonly name: Schema.Trim;
|
|
40
|
+
readonly relativePath: Schema.Trim;
|
|
41
|
+
readonly kind: Schema.Literals<readonly ["file", "directory"]>;
|
|
42
|
+
readonly sizeBytes: Schema.optional<Schema.Int>;
|
|
43
|
+
readonly modifiedAt: Schema.optional<Schema.String>;
|
|
44
|
+
}>>;
|
|
45
|
+
readonly truncated: Schema.Boolean;
|
|
46
|
+
}>;
|
|
47
|
+
export type ProjectListDirectoryResult = typeof ProjectListDirectoryResult.Type;
|
|
48
|
+
export declare const ProjectWriteFileInput: Schema.Struct<{
|
|
49
|
+
readonly cwd: Schema.Trim;
|
|
50
|
+
readonly relativePath: Schema.Trim;
|
|
51
|
+
readonly contents: Schema.String;
|
|
52
|
+
}>;
|
|
53
|
+
export type ProjectWriteFileInput = typeof ProjectWriteFileInput.Type;
|
|
54
|
+
export declare const ProjectWriteFileResult: Schema.Struct<{
|
|
55
|
+
readonly relativePath: Schema.Trim;
|
|
56
|
+
}>;
|
|
57
|
+
export type ProjectWriteFileResult = typeof ProjectWriteFileResult.Type;
|
|
58
|
+
export declare const ProjectReadFileInput: Schema.Struct<{
|
|
59
|
+
readonly cwd: Schema.Trim;
|
|
60
|
+
readonly relativePath: Schema.Trim;
|
|
61
|
+
}>;
|
|
62
|
+
export type ProjectReadFileInput = typeof ProjectReadFileInput.Type;
|
|
63
|
+
export declare const ProjectReadFileResult: Schema.Struct<{
|
|
64
|
+
readonly relativePath: Schema.Trim;
|
|
65
|
+
readonly contents: Schema.String;
|
|
66
|
+
readonly truncated: Schema.Boolean;
|
|
67
|
+
readonly sizeBytes: Schema.Int;
|
|
68
|
+
readonly maxBytes: Schema.Int;
|
|
69
|
+
}>;
|
|
70
|
+
export type ProjectReadFileResult = typeof ProjectReadFileResult.Type;
|
|
71
|
+
export declare const PROJECT_READ_FILE_MAX_BYTES_VALUE: number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rig client–server protocol version.
|
|
3
|
+
*
|
|
4
|
+
* A single integer shared by the server (reported in the
|
|
5
|
+
* `GET /api/server/status` bootstrap payload as `protocolVersion`) and by
|
|
6
|
+
* clients that speak the HTTP/WS surface (the pi-rig bridge validates it at
|
|
7
|
+
* extension init and disables itself on mismatch instead of failing on a
|
|
8
|
+
* random later request).
|
|
9
|
+
*
|
|
10
|
+
* Bump rules:
|
|
11
|
+
* - Increment whenever a change to the server API surface would break an
|
|
12
|
+
* older client (removed/renamed routes, changed payload shapes, changed
|
|
13
|
+
* steering/event semantics).
|
|
14
|
+
* - Purely additive changes (new routes, new optional fields) do NOT require
|
|
15
|
+
* a bump.
|
|
16
|
+
*
|
|
17
|
+
* History:
|
|
18
|
+
* - 1: first explicit version (2026-06). Servers older than this do not
|
|
19
|
+
* report `protocolVersion` at all; clients treat the missing field as v0.
|
|
20
|
+
*/
|
|
21
|
+
export declare const RIG_PROTOCOL_VERSION = 1;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const ProviderSession: Schema.Struct<{
|
|
3
|
+
readonly provider: Schema.Literals<readonly ["codex", "claude"]>;
|
|
4
|
+
readonly status: Schema.Literals<readonly ["connecting", "ready", "running", "error", "closed"]>;
|
|
5
|
+
readonly runtimeMode: Schema.Literals<readonly ["approval-required", "full-access"]>;
|
|
6
|
+
readonly cwd: Schema.optional<Schema.Trim>;
|
|
7
|
+
readonly model: Schema.optional<Schema.Trim>;
|
|
8
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
9
|
+
readonly resumeCursor: Schema.optional<Schema.Unknown>;
|
|
10
|
+
readonly activeTurnId: Schema.optional<Schema.brand<Schema.Trim, "TurnId">>;
|
|
11
|
+
readonly createdAt: Schema.String;
|
|
12
|
+
readonly updatedAt: Schema.String;
|
|
13
|
+
readonly lastError: Schema.optional<Schema.Trim>;
|
|
14
|
+
}>;
|
|
15
|
+
export type ProviderSession = typeof ProviderSession.Type;
|
|
16
|
+
export declare const ProviderSessionStartInput: Schema.Struct<{
|
|
17
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
18
|
+
readonly provider: Schema.optional<Schema.Literals<readonly ["codex", "claude"]>>;
|
|
19
|
+
readonly cwd: Schema.optional<Schema.Trim>;
|
|
20
|
+
readonly model: Schema.optional<Schema.Trim>;
|
|
21
|
+
readonly modelOptions: Schema.optional<Schema.Struct<{
|
|
22
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
23
|
+
readonly reasoningEffort: Schema.optional<Schema.Literals<readonly ["xhigh", "high", "medium", "low"]>>;
|
|
24
|
+
readonly fastMode: Schema.optional<Schema.Boolean>;
|
|
25
|
+
}>>;
|
|
26
|
+
readonly claude: Schema.optional<Schema.Struct<{}>>;
|
|
27
|
+
}>>;
|
|
28
|
+
readonly resumeCursor: Schema.optional<Schema.Unknown>;
|
|
29
|
+
readonly serviceTier: Schema.optional<Schema.NullOr<Schema.Literals<readonly ["fast", "flex"]>>>;
|
|
30
|
+
readonly approvalPolicy: Schema.optional<Schema.Literals<readonly ["untrusted", "on-failure", "on-request", "never"]>>;
|
|
31
|
+
readonly sandboxMode: Schema.optional<Schema.Literals<readonly ["read-only", "workspace-write", "danger-full-access"]>>;
|
|
32
|
+
readonly providerOptions: Schema.optional<Schema.Struct<{
|
|
33
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
34
|
+
readonly binaryPath: Schema.optional<Schema.Trim>;
|
|
35
|
+
readonly homePath: Schema.optional<Schema.Trim>;
|
|
36
|
+
}>>;
|
|
37
|
+
}>>;
|
|
38
|
+
readonly runtimeMode: Schema.Literals<readonly ["approval-required", "full-access"]>;
|
|
39
|
+
}>;
|
|
40
|
+
export type ProviderSessionStartInput = typeof ProviderSessionStartInput.Type;
|
|
41
|
+
export declare const ProviderSendTurnInput: Schema.Struct<{
|
|
42
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
43
|
+
readonly input: Schema.optional<Schema.Trim>;
|
|
44
|
+
readonly attachments: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
45
|
+
readonly type: Schema.Literal<"image">;
|
|
46
|
+
readonly id: Schema.Trim;
|
|
47
|
+
readonly name: Schema.Trim;
|
|
48
|
+
readonly mimeType: Schema.Trim;
|
|
49
|
+
readonly sizeBytes: Schema.Int;
|
|
50
|
+
}>]>>>;
|
|
51
|
+
readonly model: Schema.optional<Schema.Trim>;
|
|
52
|
+
readonly serviceTier: Schema.optional<Schema.NullOr<Schema.Literals<readonly ["fast", "flex"]>>>;
|
|
53
|
+
readonly modelOptions: Schema.optional<Schema.Struct<{
|
|
54
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
55
|
+
readonly reasoningEffort: Schema.optional<Schema.Literals<readonly ["xhigh", "high", "medium", "low"]>>;
|
|
56
|
+
readonly fastMode: Schema.optional<Schema.Boolean>;
|
|
57
|
+
}>>;
|
|
58
|
+
readonly claude: Schema.optional<Schema.Struct<{}>>;
|
|
59
|
+
}>>;
|
|
60
|
+
readonly interactionMode: Schema.optional<Schema.Literals<readonly ["default", "plan"]>>;
|
|
61
|
+
}>;
|
|
62
|
+
export type ProviderSendTurnInput = typeof ProviderSendTurnInput.Type;
|
|
63
|
+
export declare const ProviderTurnStartResult: Schema.Struct<{
|
|
64
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
65
|
+
readonly turnId: Schema.brand<Schema.Trim, "TurnId">;
|
|
66
|
+
readonly resumeCursor: Schema.optional<Schema.Unknown>;
|
|
67
|
+
}>;
|
|
68
|
+
export type ProviderTurnStartResult = typeof ProviderTurnStartResult.Type;
|
|
69
|
+
export declare const ProviderInterruptTurnInput: Schema.Struct<{
|
|
70
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
71
|
+
readonly turnId: Schema.optional<Schema.brand<Schema.Trim, "TurnId">>;
|
|
72
|
+
}>;
|
|
73
|
+
export type ProviderInterruptTurnInput = typeof ProviderInterruptTurnInput.Type;
|
|
74
|
+
export declare const ProviderStopSessionInput: Schema.Struct<{
|
|
75
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
76
|
+
}>;
|
|
77
|
+
export type ProviderStopSessionInput = typeof ProviderStopSessionInput.Type;
|
|
78
|
+
export declare const ProviderRespondToRequestInput: Schema.Struct<{
|
|
79
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
80
|
+
readonly requestId: Schema.brand<Schema.Trim, "ApprovalRequestId">;
|
|
81
|
+
readonly decision: Schema.Literals<readonly ["accept", "acceptForSession", "decline", "cancel"]>;
|
|
82
|
+
}>;
|
|
83
|
+
export type ProviderRespondToRequestInput = typeof ProviderRespondToRequestInput.Type;
|
|
84
|
+
export declare const ProviderRespondToUserInputInput: Schema.Struct<{
|
|
85
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
86
|
+
readonly requestId: Schema.brand<Schema.Trim, "ApprovalRequestId">;
|
|
87
|
+
readonly answers: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
88
|
+
}>;
|
|
89
|
+
export type ProviderRespondToUserInputInput = typeof ProviderRespondToUserInputInput.Type;
|
|
90
|
+
export declare const ProviderEvent: Schema.Struct<{
|
|
91
|
+
readonly id: Schema.brand<Schema.Trim, "EventId">;
|
|
92
|
+
readonly kind: Schema.Literals<readonly ["session", "notification", "request", "error"]>;
|
|
93
|
+
readonly provider: Schema.Literals<readonly ["codex", "claude"]>;
|
|
94
|
+
readonly threadId: Schema.brand<Schema.Trim, "ThreadId">;
|
|
95
|
+
readonly createdAt: Schema.String;
|
|
96
|
+
readonly method: Schema.Trim;
|
|
97
|
+
readonly message: Schema.optional<Schema.Trim>;
|
|
98
|
+
readonly turnId: Schema.optional<Schema.brand<Schema.Trim, "TurnId">>;
|
|
99
|
+
readonly itemId: Schema.optional<Schema.brand<Schema.Trim, "ProviderItemId">>;
|
|
100
|
+
readonly requestId: Schema.optional<Schema.brand<Schema.Trim, "ApprovalRequestId">>;
|
|
101
|
+
readonly requestKind: Schema.optional<Schema.Literals<readonly ["command", "file-read", "file-change"]>>;
|
|
102
|
+
readonly textDelta: Schema.optional<Schema.String>;
|
|
103
|
+
readonly payload: Schema.optional<Schema.Unknown>;
|
|
104
|
+
}>;
|
|
105
|
+
export type ProviderEvent = typeof ProviderEvent.Type;
|