@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,144 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const GitStackedAction: Schema.Literals<readonly ["commit", "commit_push", "commit_push_pr"]>;
|
|
3
|
+
export type GitStackedAction = typeof GitStackedAction.Type;
|
|
4
|
+
export declare const GitBranch: Schema.Struct<{
|
|
5
|
+
readonly name: Schema.Trim;
|
|
6
|
+
readonly isRemote: Schema.optional<Schema.Boolean>;
|
|
7
|
+
readonly remoteName: Schema.optional<Schema.Trim>;
|
|
8
|
+
readonly current: Schema.Boolean;
|
|
9
|
+
readonly isDefault: Schema.Boolean;
|
|
10
|
+
readonly worktreePath: Schema.NullOr<Schema.Trim>;
|
|
11
|
+
}>;
|
|
12
|
+
export type GitBranch = typeof GitBranch.Type;
|
|
13
|
+
export declare const GitStatusInput: Schema.Struct<{
|
|
14
|
+
readonly cwd: Schema.Trim;
|
|
15
|
+
}>;
|
|
16
|
+
export type GitStatusInput = typeof GitStatusInput.Type;
|
|
17
|
+
export declare const GitPullInput: Schema.Struct<{
|
|
18
|
+
readonly cwd: Schema.Trim;
|
|
19
|
+
}>;
|
|
20
|
+
export type GitPullInput = typeof GitPullInput.Type;
|
|
21
|
+
export declare const GitReadWorkingTreePatchInput: Schema.Struct<{
|
|
22
|
+
readonly cwd: Schema.Trim;
|
|
23
|
+
readonly relativePath: Schema.optional<Schema.Trim>;
|
|
24
|
+
}>;
|
|
25
|
+
export type GitReadWorkingTreePatchInput = typeof GitReadWorkingTreePatchInput.Type;
|
|
26
|
+
export declare const GitRunStackedActionInput: Schema.Struct<{
|
|
27
|
+
readonly cwd: Schema.Trim;
|
|
28
|
+
readonly action: Schema.Literals<readonly ["commit", "commit_push", "commit_push_pr"]>;
|
|
29
|
+
readonly commitMessage: Schema.optional<Schema.Trim>;
|
|
30
|
+
readonly featureBranch: Schema.optional<Schema.Boolean>;
|
|
31
|
+
}>;
|
|
32
|
+
export type GitRunStackedActionInput = typeof GitRunStackedActionInput.Type;
|
|
33
|
+
export declare const GitListBranchesInput: Schema.Struct<{
|
|
34
|
+
readonly cwd: Schema.Trim;
|
|
35
|
+
}>;
|
|
36
|
+
export type GitListBranchesInput = typeof GitListBranchesInput.Type;
|
|
37
|
+
export declare const GitCreateWorktreeInput: Schema.Struct<{
|
|
38
|
+
readonly cwd: Schema.Trim;
|
|
39
|
+
readonly branch: Schema.Trim;
|
|
40
|
+
readonly newBranch: Schema.Trim;
|
|
41
|
+
readonly path: Schema.NullOr<Schema.Trim>;
|
|
42
|
+
}>;
|
|
43
|
+
export type GitCreateWorktreeInput = typeof GitCreateWorktreeInput.Type;
|
|
44
|
+
export declare const GitRemoveWorktreeInput: Schema.Struct<{
|
|
45
|
+
readonly cwd: Schema.Trim;
|
|
46
|
+
readonly path: Schema.Trim;
|
|
47
|
+
readonly force: Schema.optional<Schema.Boolean>;
|
|
48
|
+
}>;
|
|
49
|
+
export type GitRemoveWorktreeInput = typeof GitRemoveWorktreeInput.Type;
|
|
50
|
+
export declare const GitCreateBranchInput: Schema.Struct<{
|
|
51
|
+
readonly cwd: Schema.Trim;
|
|
52
|
+
readonly branch: Schema.Trim;
|
|
53
|
+
}>;
|
|
54
|
+
export type GitCreateBranchInput = typeof GitCreateBranchInput.Type;
|
|
55
|
+
export declare const GitCheckoutInput: Schema.Struct<{
|
|
56
|
+
readonly cwd: Schema.Trim;
|
|
57
|
+
readonly branch: Schema.Trim;
|
|
58
|
+
}>;
|
|
59
|
+
export type GitCheckoutInput = typeof GitCheckoutInput.Type;
|
|
60
|
+
export declare const GitInitInput: Schema.Struct<{
|
|
61
|
+
readonly cwd: Schema.Trim;
|
|
62
|
+
}>;
|
|
63
|
+
export type GitInitInput = typeof GitInitInput.Type;
|
|
64
|
+
export declare const GitStatusResult: Schema.Struct<{
|
|
65
|
+
readonly branch: Schema.NullOr<Schema.Trim>;
|
|
66
|
+
readonly hasWorkingTreeChanges: Schema.Boolean;
|
|
67
|
+
readonly workingTree: Schema.Struct<{
|
|
68
|
+
readonly files: Schema.$Array<Schema.Struct<{
|
|
69
|
+
readonly path: Schema.Trim;
|
|
70
|
+
readonly insertions: Schema.Int;
|
|
71
|
+
readonly deletions: Schema.Int;
|
|
72
|
+
}>>;
|
|
73
|
+
readonly insertions: Schema.Int;
|
|
74
|
+
readonly deletions: Schema.Int;
|
|
75
|
+
}>;
|
|
76
|
+
readonly hasUpstream: Schema.Boolean;
|
|
77
|
+
readonly aheadCount: Schema.Int;
|
|
78
|
+
readonly behindCount: Schema.Int;
|
|
79
|
+
readonly pr: Schema.NullOr<Schema.Struct<{
|
|
80
|
+
readonly number: Schema.Int;
|
|
81
|
+
readonly title: Schema.Trim;
|
|
82
|
+
readonly url: Schema.String;
|
|
83
|
+
readonly baseBranch: Schema.Trim;
|
|
84
|
+
readonly headBranch: Schema.Trim;
|
|
85
|
+
readonly state: Schema.Literals<readonly ["open", "closed", "merged"]>;
|
|
86
|
+
}>>;
|
|
87
|
+
}>;
|
|
88
|
+
export type GitStatusResult = typeof GitStatusResult.Type;
|
|
89
|
+
export declare const GitListBranchesResult: Schema.Struct<{
|
|
90
|
+
readonly branches: Schema.$Array<Schema.Struct<{
|
|
91
|
+
readonly name: Schema.Trim;
|
|
92
|
+
readonly isRemote: Schema.optional<Schema.Boolean>;
|
|
93
|
+
readonly remoteName: Schema.optional<Schema.Trim>;
|
|
94
|
+
readonly current: Schema.Boolean;
|
|
95
|
+
readonly isDefault: Schema.Boolean;
|
|
96
|
+
readonly worktreePath: Schema.NullOr<Schema.Trim>;
|
|
97
|
+
}>>;
|
|
98
|
+
readonly isRepo: Schema.Boolean;
|
|
99
|
+
}>;
|
|
100
|
+
export type GitListBranchesResult = typeof GitListBranchesResult.Type;
|
|
101
|
+
export declare const GitCreateWorktreeResult: Schema.Struct<{
|
|
102
|
+
readonly worktree: Schema.Struct<{
|
|
103
|
+
readonly path: Schema.Trim;
|
|
104
|
+
readonly branch: Schema.Trim;
|
|
105
|
+
}>;
|
|
106
|
+
}>;
|
|
107
|
+
export type GitCreateWorktreeResult = typeof GitCreateWorktreeResult.Type;
|
|
108
|
+
export declare const GitRunStackedActionResult: Schema.Struct<{
|
|
109
|
+
readonly action: Schema.Literals<readonly ["commit", "commit_push", "commit_push_pr"]>;
|
|
110
|
+
readonly branch: Schema.Struct<{
|
|
111
|
+
readonly status: Schema.Literals<readonly ["created", "skipped_not_requested"]>;
|
|
112
|
+
readonly name: Schema.optional<Schema.Trim>;
|
|
113
|
+
}>;
|
|
114
|
+
readonly commit: Schema.Struct<{
|
|
115
|
+
readonly status: Schema.Literals<readonly ["created", "skipped_no_changes"]>;
|
|
116
|
+
readonly commitSha: Schema.optional<Schema.Trim>;
|
|
117
|
+
readonly subject: Schema.optional<Schema.Trim>;
|
|
118
|
+
}>;
|
|
119
|
+
readonly push: Schema.Struct<{
|
|
120
|
+
readonly status: Schema.Literals<readonly ["pushed", "skipped_not_requested", "skipped_up_to_date"]>;
|
|
121
|
+
readonly branch: Schema.optional<Schema.Trim>;
|
|
122
|
+
readonly upstreamBranch: Schema.optional<Schema.Trim>;
|
|
123
|
+
readonly setUpstream: Schema.optional<Schema.Boolean>;
|
|
124
|
+
}>;
|
|
125
|
+
readonly pr: Schema.Struct<{
|
|
126
|
+
readonly status: Schema.Literals<readonly ["created", "opened_existing", "skipped_not_requested"]>;
|
|
127
|
+
readonly url: Schema.optional<Schema.String>;
|
|
128
|
+
readonly number: Schema.optional<Schema.Int>;
|
|
129
|
+
readonly baseBranch: Schema.optional<Schema.Trim>;
|
|
130
|
+
readonly headBranch: Schema.optional<Schema.Trim>;
|
|
131
|
+
readonly title: Schema.optional<Schema.Trim>;
|
|
132
|
+
}>;
|
|
133
|
+
}>;
|
|
134
|
+
export type GitRunStackedActionResult = typeof GitRunStackedActionResult.Type;
|
|
135
|
+
export declare const GitPullResult: Schema.Struct<{
|
|
136
|
+
readonly status: Schema.Literals<readonly ["pulled", "skipped_up_to_date"]>;
|
|
137
|
+
readonly branch: Schema.Trim;
|
|
138
|
+
readonly upstreamBranch: Schema.NullOr<Schema.Trim>;
|
|
139
|
+
}>;
|
|
140
|
+
export type GitPullResult = typeof GitPullResult.Type;
|
|
141
|
+
export declare const GitReadWorkingTreePatchResult: Schema.Struct<{
|
|
142
|
+
readonly diff: Schema.String;
|
|
143
|
+
}>;
|
|
144
|
+
export type GitReadWorkingTreePatchResult = typeof GitReadWorkingTreePatchResult.Type;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const TaskStatus: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
3
|
+
export type TaskStatus = typeof TaskStatus.Type;
|
|
4
|
+
export declare const GraphSummary: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.brand<Schema.Trim, "GraphId">;
|
|
6
|
+
readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
7
|
+
readonly title: Schema.Trim;
|
|
8
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
9
|
+
readonly createdAt: Schema.String;
|
|
10
|
+
readonly updatedAt: Schema.String;
|
|
11
|
+
}>;
|
|
12
|
+
export type GraphSummary = typeof GraphSummary.Type;
|
|
13
|
+
export declare const TaskSummary: Schema.Struct<{
|
|
14
|
+
readonly id: Schema.brand<Schema.Trim, "TaskId">;
|
|
15
|
+
readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
16
|
+
readonly graphId: Schema.NullOr<Schema.brand<Schema.Trim, "GraphId">>;
|
|
17
|
+
readonly externalId: Schema.NullOr<Schema.Trim>;
|
|
18
|
+
readonly title: Schema.Trim;
|
|
19
|
+
readonly description: Schema.String;
|
|
20
|
+
readonly status: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
21
|
+
readonly priority: Schema.NullOr<Schema.Int>;
|
|
22
|
+
readonly role: Schema.NullOr<Schema.Trim>;
|
|
23
|
+
readonly scope: Schema.$Array<Schema.Trim>;
|
|
24
|
+
readonly validationKeys: Schema.$Array<Schema.Trim>;
|
|
25
|
+
readonly sourceIssueId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
26
|
+
readonly dependencies: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
27
|
+
readonly parentChildDeps: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
28
|
+
readonly metadata: Schema.Unknown;
|
|
29
|
+
readonly createdAt: Schema.String;
|
|
30
|
+
readonly updatedAt: Schema.String;
|
|
31
|
+
}>;
|
|
32
|
+
export type TaskSummary = typeof TaskSummary.Type;
|
|
33
|
+
export declare const QueueEntry: Schema.Struct<{
|
|
34
|
+
readonly taskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
35
|
+
readonly score: Schema.Int;
|
|
36
|
+
readonly unblockCount: Schema.Int;
|
|
37
|
+
readonly position: Schema.Int;
|
|
38
|
+
}>;
|
|
39
|
+
export type QueueEntry = typeof QueueEntry.Type;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export * from "./baseSchemas";
|
|
2
|
+
export * from "./workspace";
|
|
3
|
+
export * from "./graph";
|
|
4
|
+
export * from "./runtime";
|
|
5
|
+
export * from "./run-journal";
|
|
6
|
+
export * from "./conversation";
|
|
7
|
+
export * from "./plugin";
|
|
8
|
+
export * from "./plugin-hooks";
|
|
9
|
+
export * from "./config";
|
|
10
|
+
export * from "./policy";
|
|
11
|
+
export * from "./validation";
|
|
12
|
+
export * from "./review";
|
|
13
|
+
export * from "./artifact";
|
|
14
|
+
export * from "./engine";
|
|
15
|
+
export * from "./rig";
|
|
16
|
+
export * from "./remote";
|
|
17
|
+
export * from "./ipc";
|
|
18
|
+
export * from "./terminal";
|
|
19
|
+
export * from "./provider";
|
|
20
|
+
export * from "./providerRuntime";
|
|
21
|
+
export * from "./model";
|
|
22
|
+
export * from "./ws";
|
|
23
|
+
export * from "./keybindings";
|
|
24
|
+
export * from "./server";
|
|
25
|
+
export * from "./serviceFabric";
|
|
26
|
+
export * from "./git";
|
|
27
|
+
export * from "./orchestration";
|
|
28
|
+
export * from "./editor";
|
|
29
|
+
export * from "./project";
|
|
30
|
+
export * from "./task-source";
|
|
31
|
+
export * from "./cli-output";
|
|
32
|
+
export * from "./pi-session";
|
|
33
|
+
export * from "./protocol-version";
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import type { GitCheckoutInput, GitCreateBranchInput, GitCreateWorktreeInput, GitCreateWorktreeResult, GitInitInput, GitListBranchesInput, GitListBranchesResult, GitPullInput, GitPullResult, GitReadWorkingTreePatchInput, GitReadWorkingTreePatchResult, GitRemoveWorktreeInput, GitRunStackedActionInput, GitRunStackedActionResult, GitStatusInput, GitStatusResult } from "./git";
|
|
2
|
+
import type { ProjectListDirectoryInput, ProjectListDirectoryResult, ProjectSearchEntriesInput, ProjectSearchEntriesResult, ProjectReadFileInput, ProjectReadFileResult, ProjectWriteFileInput, ProjectWriteFileResult } from "./project";
|
|
3
|
+
import type { ServerConfig } from "./server";
|
|
4
|
+
import type { RigCreateAdhocRunInput, RigCreateTaskRunInput, RigDeleteRunInput, RigEnqueueTaskInput, RigGetRunLogsInput, RigGetRunLogsResult, RigGetTaskArtifactsResult, RigRunLogAppendedPayload, RigGetWorkspaceInput, RigGetWorkspaceResult, RigListWorkspacesResult, RigMutationResult, RigInterruptRunInput, RigResumeRunInput, RigResolveApprovalInput, RigResolveUserInputInput, RigSnapshot, RigStopRunInput, RigSubmitRunMessageInput } from "./rig";
|
|
5
|
+
import type { TerminalClearInput, TerminalCloseInput, TerminalEvent, TerminalOpenInput, TerminalResizeInput, TerminalSessionSnapshot, TerminalWriteInput } from "./terminal";
|
|
6
|
+
import type { ServerUpsertKeybindingInput, ServerUpsertKeybindingResult } from "./server";
|
|
7
|
+
import type { ClientOrchestrationCommand, OrchestrationGetFullThreadDiffInput, OrchestrationGetFullThreadDiffResult, OrchestrationGetTurnDiffInput, OrchestrationGetTurnDiffResult, OrchestrationEvent, OrchestrationReadModel } from "./orchestration";
|
|
8
|
+
import type { EngineEvent } from "./engine";
|
|
9
|
+
import { EditorId } from "./editor";
|
|
10
|
+
export interface ContextMenuItem<T extends string = string> {
|
|
11
|
+
id: T;
|
|
12
|
+
label: string;
|
|
13
|
+
destructive?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type DesktopUpdateStatus = "disabled" | "idle" | "checking" | "up-to-date" | "available" | "downloading" | "downloaded" | "error";
|
|
16
|
+
export interface DesktopUpdateState {
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
status: DesktopUpdateStatus;
|
|
19
|
+
currentVersion: string;
|
|
20
|
+
availableVersion: string | null;
|
|
21
|
+
downloadedVersion: string | null;
|
|
22
|
+
downloadPercent: number | null;
|
|
23
|
+
checkedAt: string | null;
|
|
24
|
+
message: string | null;
|
|
25
|
+
errorContext: "check" | "download" | "install" | null;
|
|
26
|
+
canRetry: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface DesktopUpdateActionResult {
|
|
29
|
+
accepted: boolean;
|
|
30
|
+
completed: boolean;
|
|
31
|
+
state: DesktopUpdateState;
|
|
32
|
+
}
|
|
33
|
+
export type RigProjectConfigStatus = "rig-config-ts" | "rig-config-json" | "legacy-task-config" | "missing";
|
|
34
|
+
export interface DesktopRigSetupState {
|
|
35
|
+
rootPath: string | null;
|
|
36
|
+
ready: boolean;
|
|
37
|
+
wsUrl: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* What kind of Rig configuration the project at `rootPath` has. The
|
|
40
|
+
* desktop main process probes the filesystem at boot and on
|
|
41
|
+
* `setRigRoot`; the renderer reads this to decide whether to show an
|
|
42
|
+
* onboarding banner ("Run `rig init`") or the normal dashboard.
|
|
43
|
+
*/
|
|
44
|
+
configStatus: RigProjectConfigStatus;
|
|
45
|
+
}
|
|
46
|
+
export interface RigConfigWriteResult {
|
|
47
|
+
ok: boolean;
|
|
48
|
+
/** Absolute path to the file that was written. */
|
|
49
|
+
configPath: string;
|
|
50
|
+
/** Filesystem error message when `ok === false`. */
|
|
51
|
+
error?: string;
|
|
52
|
+
/** Updated setup state — `configStatus` reflects the post-write probe. */
|
|
53
|
+
setup: DesktopRigSetupState;
|
|
54
|
+
}
|
|
55
|
+
export interface RigConfigReadResult {
|
|
56
|
+
/** The raw rig.config.{ts,json} source, or null if none exists. */
|
|
57
|
+
source: string | null;
|
|
58
|
+
/** Which file was read; null when no config exists. */
|
|
59
|
+
configPath: string | null;
|
|
60
|
+
}
|
|
61
|
+
export interface ProjectGitRemoteInfo {
|
|
62
|
+
/** The raw origin URL, e.g. `git@github.com:humanity-org/humanwork.git`. */
|
|
63
|
+
url: string;
|
|
64
|
+
/** Parsed host, e.g. `github.com`. */
|
|
65
|
+
host: string | null;
|
|
66
|
+
/** Parsed owner/org, e.g. `humanity-org`. */
|
|
67
|
+
owner: string | null;
|
|
68
|
+
/** Parsed repository name (no `.git` suffix), e.g. `humanwork`. */
|
|
69
|
+
repo: string | null;
|
|
70
|
+
}
|
|
71
|
+
export interface DesktopBridge {
|
|
72
|
+
getWsUrl: () => string | null;
|
|
73
|
+
getRigSetup: () => Promise<DesktopRigSetupState>;
|
|
74
|
+
setRigRoot: (rootPath: string) => Promise<DesktopRigSetupState>;
|
|
75
|
+
/**
|
|
76
|
+
* Read the raw rig.config.{ts,json} from the project at `rootPath`.
|
|
77
|
+
* Returns `{ source: null }` when no config exists. Used by the in-app
|
|
78
|
+
* Settings screen to populate the form from the existing file.
|
|
79
|
+
*/
|
|
80
|
+
readRigConfigRaw: (rootPath: string) => Promise<RigConfigReadResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Write rig.config.ts to the project root atomically (temp-file + rename).
|
|
83
|
+
* Refreshes the cached setup state and returns it post-write so callers
|
|
84
|
+
* can route past the setup gate. Used by both the in-app setup wizard
|
|
85
|
+
* and the Settings → Project section.
|
|
86
|
+
*/
|
|
87
|
+
writeRigConfig: (rootPath: string, source: string) => Promise<RigConfigWriteResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Inspect the project's git origin to auto-fill setup wizard fields.
|
|
90
|
+
* Runs `git -C <rootPath> remote get-url origin` and parses owner/repo.
|
|
91
|
+
* Returns null when the project isn't a git repo, has no origin, or the
|
|
92
|
+
* URL doesn't match a recognized GitHub-style pattern. The wizard uses
|
|
93
|
+
* this to prefill the GitHub owner/repo step instead of making the
|
|
94
|
+
* operator type values that are already in `.git/config`.
|
|
95
|
+
*/
|
|
96
|
+
getProjectGitRemote: (rootPath: string) => Promise<ProjectGitRemoteInfo | null>;
|
|
97
|
+
pickFolder: () => Promise<string | null>;
|
|
98
|
+
confirm: (message: string) => Promise<boolean>;
|
|
99
|
+
showContextMenu: <T extends string>(items: readonly ContextMenuItem<T>[], position?: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
}) => Promise<T | null>;
|
|
103
|
+
openExternal: (url: string) => Promise<boolean>;
|
|
104
|
+
onMenuAction: (listener: (action: string) => void) => () => void;
|
|
105
|
+
getUpdateState: () => Promise<DesktopUpdateState>;
|
|
106
|
+
downloadUpdate: () => Promise<DesktopUpdateActionResult>;
|
|
107
|
+
installUpdate: () => Promise<DesktopUpdateActionResult>;
|
|
108
|
+
onUpdateState: (listener: (state: DesktopUpdateState) => void) => () => void;
|
|
109
|
+
}
|
|
110
|
+
export interface NativeApi {
|
|
111
|
+
dialogs: {
|
|
112
|
+
pickFolder: () => Promise<string | null>;
|
|
113
|
+
confirm: (message: string) => Promise<boolean>;
|
|
114
|
+
};
|
|
115
|
+
terminal: {
|
|
116
|
+
open: (input: TerminalOpenInput) => Promise<TerminalSessionSnapshot>;
|
|
117
|
+
write: (input: TerminalWriteInput) => Promise<void>;
|
|
118
|
+
resize: (input: TerminalResizeInput) => Promise<void>;
|
|
119
|
+
clear: (input: TerminalClearInput) => Promise<void>;
|
|
120
|
+
restart: (input: TerminalOpenInput) => Promise<TerminalSessionSnapshot>;
|
|
121
|
+
close: (input: TerminalCloseInput) => Promise<void>;
|
|
122
|
+
onEvent: (callback: (event: TerminalEvent) => void) => () => void;
|
|
123
|
+
};
|
|
124
|
+
projects: {
|
|
125
|
+
listDirectory: (input: ProjectListDirectoryInput) => Promise<ProjectListDirectoryResult>;
|
|
126
|
+
searchEntries: (input: ProjectSearchEntriesInput) => Promise<ProjectSearchEntriesResult>;
|
|
127
|
+
readFile: (input: ProjectReadFileInput) => Promise<ProjectReadFileResult>;
|
|
128
|
+
writeFile: (input: ProjectWriteFileInput) => Promise<ProjectWriteFileResult>;
|
|
129
|
+
};
|
|
130
|
+
shell: {
|
|
131
|
+
openInEditor: (cwd: string, editor: EditorId) => Promise<void>;
|
|
132
|
+
openExternal: (url: string) => Promise<void>;
|
|
133
|
+
};
|
|
134
|
+
git: {
|
|
135
|
+
listBranches: (input: GitListBranchesInput) => Promise<GitListBranchesResult>;
|
|
136
|
+
createWorktree: (input: GitCreateWorktreeInput) => Promise<GitCreateWorktreeResult>;
|
|
137
|
+
removeWorktree: (input: GitRemoveWorktreeInput) => Promise<void>;
|
|
138
|
+
createBranch: (input: GitCreateBranchInput) => Promise<void>;
|
|
139
|
+
checkout: (input: GitCheckoutInput) => Promise<void>;
|
|
140
|
+
init: (input: GitInitInput) => Promise<void>;
|
|
141
|
+
pull: (input: GitPullInput) => Promise<GitPullResult>;
|
|
142
|
+
status: (input: GitStatusInput) => Promise<GitStatusResult>;
|
|
143
|
+
readWorkingTreePatch: (input: GitReadWorkingTreePatchInput) => Promise<GitReadWorkingTreePatchResult>;
|
|
144
|
+
runStackedAction: (input: GitRunStackedActionInput) => Promise<GitRunStackedActionResult>;
|
|
145
|
+
};
|
|
146
|
+
contextMenu: {
|
|
147
|
+
show: <T extends string>(items: readonly ContextMenuItem<T>[], position?: {
|
|
148
|
+
x: number;
|
|
149
|
+
y: number;
|
|
150
|
+
}) => Promise<T | null>;
|
|
151
|
+
};
|
|
152
|
+
server: {
|
|
153
|
+
getConfig: () => Promise<ServerConfig>;
|
|
154
|
+
upsertKeybinding: (input: ServerUpsertKeybindingInput) => Promise<ServerUpsertKeybindingResult>;
|
|
155
|
+
};
|
|
156
|
+
rig: {
|
|
157
|
+
getSnapshot: () => Promise<RigSnapshot>;
|
|
158
|
+
listWorkspaces: () => Promise<RigListWorkspacesResult>;
|
|
159
|
+
getWorkspace: (input: RigGetWorkspaceInput) => Promise<RigGetWorkspaceResult>;
|
|
160
|
+
getRunLogs: (input: RigGetRunLogsInput) => Promise<RigGetRunLogsResult>;
|
|
161
|
+
replayEvents: (fromSequenceExclusive: number) => Promise<EngineEvent[]>;
|
|
162
|
+
createAdhocRun: (input: RigCreateAdhocRunInput) => Promise<RigMutationResult>;
|
|
163
|
+
createTaskRun: (input: RigCreateTaskRunInput) => Promise<RigMutationResult>;
|
|
164
|
+
deleteRun: (input: RigDeleteRunInput) => Promise<RigMutationResult>;
|
|
165
|
+
enqueueTask: (input: RigEnqueueTaskInput) => Promise<RigMutationResult>;
|
|
166
|
+
resumeRun: (input: RigResumeRunInput) => Promise<RigMutationResult>;
|
|
167
|
+
submitRunMessage: (input: RigSubmitRunMessageInput) => Promise<RigMutationResult>;
|
|
168
|
+
interruptRun: (input: RigInterruptRunInput) => Promise<RigMutationResult>;
|
|
169
|
+
stopRun: (input: RigStopRunInput) => Promise<RigMutationResult>;
|
|
170
|
+
resolveApproval: (input: RigResolveApprovalInput) => Promise<RigMutationResult>;
|
|
171
|
+
resolveUserInput: (input: RigResolveUserInputInput) => Promise<RigMutationResult>;
|
|
172
|
+
getTaskArtifacts: (taskId: string) => Promise<RigGetTaskArtifactsResult>;
|
|
173
|
+
onEvent: (callback: (event: EngineEvent) => void) => () => void;
|
|
174
|
+
onRunLogAppended: (callback: (payload: RigRunLogAppendedPayload) => void) => () => void;
|
|
175
|
+
};
|
|
176
|
+
orchestration: {
|
|
177
|
+
getSnapshot: () => Promise<OrchestrationReadModel>;
|
|
178
|
+
dispatchCommand: (command: ClientOrchestrationCommand) => Promise<{
|
|
179
|
+
sequence: number;
|
|
180
|
+
}>;
|
|
181
|
+
getTurnDiff: (input: OrchestrationGetTurnDiffInput) => Promise<OrchestrationGetTurnDiffResult>;
|
|
182
|
+
getFullThreadDiff: (input: OrchestrationGetFullThreadDiffInput) => Promise<OrchestrationGetFullThreadDiffResult>;
|
|
183
|
+
replayEvents: (fromSequenceExclusive: number) => Promise<OrchestrationEvent[]>;
|
|
184
|
+
onDomainEvent: (callback: (event: OrchestrationEvent) => void) => () => void;
|
|
185
|
+
};
|
|
186
|
+
remote: {
|
|
187
|
+
testEndpoint: (input: {
|
|
188
|
+
host: string;
|
|
189
|
+
port: number;
|
|
190
|
+
token?: string;
|
|
191
|
+
}) => Promise<{
|
|
192
|
+
latencyMs: number;
|
|
193
|
+
}>;
|
|
194
|
+
listEndpoints: () => Promise<unknown[]>;
|
|
195
|
+
registerEndpoint: (input: {
|
|
196
|
+
alias: string;
|
|
197
|
+
host: string;
|
|
198
|
+
port: number;
|
|
199
|
+
token?: string;
|
|
200
|
+
autoConnect?: boolean;
|
|
201
|
+
}) => Promise<unknown>;
|
|
202
|
+
removeEndpoint: (input: {
|
|
203
|
+
endpointId: string;
|
|
204
|
+
}) => Promise<void>;
|
|
205
|
+
connect: (input: {
|
|
206
|
+
endpointId: string;
|
|
207
|
+
}) => Promise<void>;
|
|
208
|
+
disconnect: (input: {
|
|
209
|
+
endpointId: string;
|
|
210
|
+
}) => Promise<void>;
|
|
211
|
+
createRunForTask: (input: {
|
|
212
|
+
endpointId: string;
|
|
213
|
+
taskId: string;
|
|
214
|
+
runId: string;
|
|
215
|
+
workspaceId: string;
|
|
216
|
+
runtimeMode?: string;
|
|
217
|
+
interactionMode?: string;
|
|
218
|
+
}) => Promise<{
|
|
219
|
+
ok: boolean;
|
|
220
|
+
}>;
|
|
221
|
+
terminalOpen: (input: {
|
|
222
|
+
endpointId: string;
|
|
223
|
+
threadId: string;
|
|
224
|
+
terminalId: string;
|
|
225
|
+
cwd?: string;
|
|
226
|
+
env?: Record<string, string>;
|
|
227
|
+
}) => Promise<unknown>;
|
|
228
|
+
terminalWrite: (input: {
|
|
229
|
+
endpointId: string;
|
|
230
|
+
threadId: string;
|
|
231
|
+
terminalId: string;
|
|
232
|
+
data: string;
|
|
233
|
+
}) => Promise<void>;
|
|
234
|
+
terminalResize: (input: {
|
|
235
|
+
endpointId: string;
|
|
236
|
+
threadId: string;
|
|
237
|
+
terminalId: string;
|
|
238
|
+
cols: number;
|
|
239
|
+
rows: number;
|
|
240
|
+
}) => Promise<void>;
|
|
241
|
+
terminalClose: (input: {
|
|
242
|
+
endpointId: string;
|
|
243
|
+
threadId: string;
|
|
244
|
+
terminalId: string;
|
|
245
|
+
}) => Promise<void>;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const MAX_KEYBINDING_VALUE_LENGTH = 64;
|
|
3
|
+
export declare const MAX_WHEN_EXPRESSION_DEPTH = 64;
|
|
4
|
+
export declare const MAX_SCRIPT_ID_LENGTH = 24;
|
|
5
|
+
export declare const MAX_KEYBINDINGS_COUNT = 256;
|
|
6
|
+
export declare const SCRIPT_RUN_COMMAND_PATTERN: Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>;
|
|
7
|
+
export declare const KeybindingCommand: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
8
|
+
export type KeybindingCommand = typeof KeybindingCommand.Type;
|
|
9
|
+
export declare const KeybindingRule: Schema.Struct<{
|
|
10
|
+
readonly key: Schema.Trim;
|
|
11
|
+
readonly command: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
12
|
+
readonly when: Schema.optional<Schema.Trim>;
|
|
13
|
+
}>;
|
|
14
|
+
export type KeybindingRule = typeof KeybindingRule.Type;
|
|
15
|
+
export declare const KeybindingsConfig: Schema.$Array<Schema.Struct<{
|
|
16
|
+
readonly key: Schema.Trim;
|
|
17
|
+
readonly command: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
18
|
+
readonly when: Schema.optional<Schema.Trim>;
|
|
19
|
+
}>>;
|
|
20
|
+
export type KeybindingsConfig = typeof KeybindingsConfig.Type;
|
|
21
|
+
export declare const KeybindingShortcut: Schema.Struct<{
|
|
22
|
+
readonly key: Schema.Trim;
|
|
23
|
+
readonly metaKey: Schema.Boolean;
|
|
24
|
+
readonly ctrlKey: Schema.Boolean;
|
|
25
|
+
readonly shiftKey: Schema.Boolean;
|
|
26
|
+
readonly altKey: Schema.Boolean;
|
|
27
|
+
readonly modKey: Schema.Boolean;
|
|
28
|
+
}>;
|
|
29
|
+
export type KeybindingShortcut = typeof KeybindingShortcut.Type;
|
|
30
|
+
export declare const KeybindingWhenNode: Schema.Schema<KeybindingWhenNode>;
|
|
31
|
+
export type KeybindingWhenNode = {
|
|
32
|
+
type: "identifier";
|
|
33
|
+
name: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: "not";
|
|
36
|
+
node: KeybindingWhenNode;
|
|
37
|
+
} | {
|
|
38
|
+
type: "and";
|
|
39
|
+
left: KeybindingWhenNode;
|
|
40
|
+
right: KeybindingWhenNode;
|
|
41
|
+
} | {
|
|
42
|
+
type: "or";
|
|
43
|
+
left: KeybindingWhenNode;
|
|
44
|
+
right: KeybindingWhenNode;
|
|
45
|
+
};
|
|
46
|
+
export declare const ResolvedKeybindingRule: Schema.Struct<{
|
|
47
|
+
readonly command: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
48
|
+
readonly shortcut: Schema.Struct<{
|
|
49
|
+
readonly key: Schema.Trim;
|
|
50
|
+
readonly metaKey: Schema.Boolean;
|
|
51
|
+
readonly ctrlKey: Schema.Boolean;
|
|
52
|
+
readonly shiftKey: Schema.Boolean;
|
|
53
|
+
readonly altKey: Schema.Boolean;
|
|
54
|
+
readonly modKey: Schema.Boolean;
|
|
55
|
+
}>;
|
|
56
|
+
readonly whenAst: Schema.optional<Schema.Schema<KeybindingWhenNode>>;
|
|
57
|
+
}>;
|
|
58
|
+
export type ResolvedKeybindingRule = typeof ResolvedKeybindingRule.Type;
|
|
59
|
+
export declare const ResolvedKeybindingsConfig: Schema.$Array<Schema.Struct<{
|
|
60
|
+
readonly command: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
61
|
+
readonly shortcut: Schema.Struct<{
|
|
62
|
+
readonly key: Schema.Trim;
|
|
63
|
+
readonly metaKey: Schema.Boolean;
|
|
64
|
+
readonly ctrlKey: Schema.Boolean;
|
|
65
|
+
readonly shiftKey: Schema.Boolean;
|
|
66
|
+
readonly altKey: Schema.Boolean;
|
|
67
|
+
readonly modKey: Schema.Boolean;
|
|
68
|
+
}>;
|
|
69
|
+
readonly whenAst: Schema.optional<Schema.Schema<KeybindingWhenNode>>;
|
|
70
|
+
}>>;
|
|
71
|
+
export type ResolvedKeybindingsConfig = typeof ResolvedKeybindingsConfig.Type;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { ProviderKind } from "./orchestration";
|
|
3
|
+
export declare const CODEX_REASONING_EFFORT_OPTIONS: readonly ["xhigh", "high", "medium", "low"];
|
|
4
|
+
export type CodexReasoningEffort = (typeof CODEX_REASONING_EFFORT_OPTIONS)[number];
|
|
5
|
+
export declare const CodexModelOptions: Schema.Struct<{
|
|
6
|
+
readonly reasoningEffort: Schema.optional<Schema.Literals<readonly ["xhigh", "high", "medium", "low"]>>;
|
|
7
|
+
readonly fastMode: Schema.optional<Schema.Boolean>;
|
|
8
|
+
}>;
|
|
9
|
+
export type CodexModelOptions = typeof CodexModelOptions.Type;
|
|
10
|
+
export declare const ClaudeModelOptions: Schema.Struct<{}>;
|
|
11
|
+
export type ClaudeModelOptions = typeof ClaudeModelOptions.Type;
|
|
12
|
+
export declare const ProviderModelOptions: Schema.Struct<{
|
|
13
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
14
|
+
readonly reasoningEffort: Schema.optional<Schema.Literals<readonly ["xhigh", "high", "medium", "low"]>>;
|
|
15
|
+
readonly fastMode: Schema.optional<Schema.Boolean>;
|
|
16
|
+
}>>;
|
|
17
|
+
readonly claude: Schema.optional<Schema.Struct<{}>>;
|
|
18
|
+
}>;
|
|
19
|
+
export type ProviderModelOptions = typeof ProviderModelOptions.Type;
|
|
20
|
+
export declare const MODEL_OPTIONS_BY_PROVIDER: {
|
|
21
|
+
readonly codex: readonly [{
|
|
22
|
+
readonly slug: "gpt-5.4";
|
|
23
|
+
readonly name: "GPT-5.4";
|
|
24
|
+
}, {
|
|
25
|
+
readonly slug: "gpt-5.3-codex";
|
|
26
|
+
readonly name: "GPT-5.3 Codex";
|
|
27
|
+
}, {
|
|
28
|
+
readonly slug: "gpt-5.3-codex-spark";
|
|
29
|
+
readonly name: "GPT-5.3 Codex Spark";
|
|
30
|
+
}, {
|
|
31
|
+
readonly slug: "gpt-5.2-codex";
|
|
32
|
+
readonly name: "GPT-5.2 Codex";
|
|
33
|
+
}, {
|
|
34
|
+
readonly slug: "gpt-5.2";
|
|
35
|
+
readonly name: "GPT-5.2";
|
|
36
|
+
}];
|
|
37
|
+
readonly claude: readonly [{
|
|
38
|
+
readonly slug: "claude-sonnet-4-6";
|
|
39
|
+
readonly name: "Claude Sonnet 4.6";
|
|
40
|
+
}, {
|
|
41
|
+
readonly slug: "claude-opus-4-1";
|
|
42
|
+
readonly name: "Claude Opus 4.1";
|
|
43
|
+
}, {
|
|
44
|
+
readonly slug: "claude-3-7-sonnet-latest";
|
|
45
|
+
readonly name: "Claude 3.7 Sonnet";
|
|
46
|
+
}];
|
|
47
|
+
};
|
|
48
|
+
export type ModelOptionsByProvider = typeof MODEL_OPTIONS_BY_PROVIDER;
|
|
49
|
+
type BuiltInModelSlug = ModelOptionsByProvider[ProviderKind][number]["slug"];
|
|
50
|
+
export type ModelSlug = BuiltInModelSlug | (string & {});
|
|
51
|
+
export declare const DEFAULT_MODEL_BY_PROVIDER: {
|
|
52
|
+
readonly codex: "gpt-5.4";
|
|
53
|
+
readonly claude: "claude-sonnet-4-6";
|
|
54
|
+
};
|
|
55
|
+
export declare const MODEL_SLUG_ALIASES_BY_PROVIDER: {
|
|
56
|
+
readonly codex: {
|
|
57
|
+
readonly "5.4": "gpt-5.4";
|
|
58
|
+
readonly "5.3": "gpt-5.3-codex";
|
|
59
|
+
readonly "gpt-5.3": "gpt-5.3-codex";
|
|
60
|
+
readonly "5.3-spark": "gpt-5.3-codex-spark";
|
|
61
|
+
readonly "gpt-5.3-spark": "gpt-5.3-codex-spark";
|
|
62
|
+
};
|
|
63
|
+
readonly claude: {
|
|
64
|
+
readonly sonnet: "claude-sonnet-4-6";
|
|
65
|
+
readonly opus: "claude-opus-4-1";
|
|
66
|
+
readonly "3.7-sonnet": "claude-3-7-sonnet-latest";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export declare const REASONING_EFFORT_OPTIONS_BY_PROVIDER: {
|
|
70
|
+
readonly codex: readonly ["xhigh", "high", "medium", "low"];
|
|
71
|
+
readonly claude: readonly [];
|
|
72
|
+
};
|
|
73
|
+
export declare const DEFAULT_REASONING_EFFORT_BY_PROVIDER: {
|
|
74
|
+
readonly codex: "high";
|
|
75
|
+
readonly claude: null;
|
|
76
|
+
};
|
|
77
|
+
export {};
|