@h-rig/contracts 0.0.6-alpha.156 → 0.0.6-alpha.158

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.
Files changed (126) hide show
  1. package/dist/index.cjs +2340 -6832
  2. package/dist/index.mjs +2116 -6608
  3. package/dist/src/agent-roles.d.ts +8 -0
  4. package/dist/src/browser.d.ts +34 -4
  5. package/dist/src/browser.js +8 -1
  6. package/dist/src/capability-id.d.ts +22 -0
  7. package/dist/src/capability-id.js +8 -0
  8. package/dist/src/cli-output.d.ts +24 -0
  9. package/dist/src/cli-runner.d.ts +43 -0
  10. package/dist/src/cli-runner.js +13 -0
  11. package/dist/src/collab-session-viewer.d.ts +36 -0
  12. package/dist/src/collab-session-viewer.js +13 -0
  13. package/dist/src/config.d.ts +11 -0
  14. package/dist/src/config.js +279 -1098
  15. package/dist/src/control-plane-types.d.ts +41 -1
  16. package/dist/src/control-plane-types.js +9 -25
  17. package/dist/src/dependency-preflight.d.ts +43 -0
  18. package/dist/src/dependency-preflight.js +13 -0
  19. package/dist/src/doctor.d.ts +67 -4
  20. package/dist/src/doctor.js +8 -9
  21. package/dist/src/errors.d.ts +13 -0
  22. package/dist/src/errors.js +17 -0
  23. package/dist/src/github.d.ts +43 -0
  24. package/dist/src/github.js +12 -1
  25. package/dist/src/graph.d.ts +37 -0
  26. package/dist/src/graph.js +13 -0
  27. package/dist/src/guard.d.ts +111 -0
  28. package/dist/src/guard.js +6 -0
  29. package/dist/src/harness-events.d.ts +8 -0
  30. package/dist/src/harness-events.js +1 -0
  31. package/dist/src/help-catalog.d.ts +17 -10
  32. package/dist/src/help-catalog.js +9 -651
  33. package/dist/src/host.d.ts +41 -0
  34. package/dist/src/host.js +13 -0
  35. package/dist/src/identity.d.ts +44 -0
  36. package/dist/src/identity.js +1 -0
  37. package/dist/src/index.d.ts +27 -7
  38. package/dist/src/index.js +2116 -6608
  39. package/dist/src/isolation.d.ts +207 -15
  40. package/dist/src/isolation.js +8 -1
  41. package/dist/src/kernel.d.ts +11 -0
  42. package/dist/src/kernel.js +7 -0
  43. package/dist/src/layout.d.ts +49 -0
  44. package/dist/src/layout.js +10 -0
  45. package/dist/src/lifecycle-capabilities.d.ts +99 -0
  46. package/dist/src/lifecycle-capabilities.js +18 -1
  47. package/dist/src/managed-repos.d.ts +79 -16
  48. package/dist/src/managed-repos.js +12 -1
  49. package/dist/src/memory.d.ts +52 -4
  50. package/dist/src/memory.js +8 -1
  51. package/dist/src/notify.d.ts +46 -0
  52. package/dist/src/notify.js +13 -0
  53. package/dist/src/orchestration.d.ts +0 -3652
  54. package/dist/src/orchestration.js +28 -964
  55. package/dist/src/plugin-hooks.js +22 -3
  56. package/dist/src/plugin.d.ts +47 -0
  57. package/dist/src/plugin.js +24 -3
  58. package/dist/src/prompt.d.ts +29 -0
  59. package/dist/src/prompt.js +13 -0
  60. package/dist/src/provider-instructions.d.ts +26 -4
  61. package/dist/src/provider-instructions.js +8 -1
  62. package/dist/src/provider.js +1 -824
  63. package/dist/src/remote.d.ts +0 -8
  64. package/dist/src/remote.js +229 -1075
  65. package/dist/src/run-discovery.d.ts +79 -0
  66. package/dist/src/run-discovery.js +13 -0
  67. package/dist/src/run-dispatch.d.ts +34 -0
  68. package/dist/src/run-dispatch.js +13 -0
  69. package/dist/src/run-identity.d.ts +47 -0
  70. package/dist/src/run-identity.js +13 -0
  71. package/dist/src/run-journal.d.ts +0 -236
  72. package/dist/src/run-journal.js +249 -1321
  73. package/dist/src/run-read-model.d.ts +234 -0
  74. package/dist/src/run-read-model.js +13 -0
  75. package/dist/src/run-record.d.ts +0 -11
  76. package/dist/src/run-record.js +0 -16
  77. package/dist/src/run-registry-backbone.d.ts +56 -0
  78. package/dist/src/run-registry-backbone.js +13 -0
  79. package/dist/src/run-session-journal.d.ts +1 -25
  80. package/dist/src/run-session-journal.js +0 -1731
  81. package/dist/src/run-status.d.ts +0 -2
  82. package/dist/src/run-status.js +0 -11
  83. package/dist/src/run-timeline.d.ts +0 -3
  84. package/dist/src/run-timeline.js +0 -1498
  85. package/dist/src/runtime-task-context.d.ts +82 -0
  86. package/dist/src/runtime-task-context.js +1 -0
  87. package/dist/src/runtime.js +66 -904
  88. package/dist/src/session-asset-materializer.d.ts +35 -0
  89. package/dist/src/session-asset-materializer.js +13 -0
  90. package/dist/src/setup.d.ts +47 -0
  91. package/dist/src/setup.js +13 -0
  92. package/dist/src/supervisor-journal.js +117 -955
  93. package/dist/src/task-data.d.ts +239 -0
  94. package/dist/src/task-data.js +13 -0
  95. package/dist/src/task-graph-primitives.d.ts +0 -21
  96. package/dist/src/task-graph-primitives.js +0 -318
  97. package/dist/src/task-source.d.ts +65 -0
  98. package/dist/src/task-source.js +12 -0
  99. package/dist/src/task-state-metadata.d.ts +21 -0
  100. package/dist/src/task-state-metadata.js +1 -0
  101. package/dist/src/tool-materializer.d.ts +36 -0
  102. package/dist/src/tool-materializer.js +13 -0
  103. package/dist/src/tool-registry.d.ts +3 -0
  104. package/dist/src/tool-registry.js +58 -0
  105. package/dist/src/toolchain-sources.d.ts +54 -0
  106. package/dist/src/toolchain-sources.js +17 -0
  107. package/dist/src/workflow-journal.d.ts +0 -32
  108. package/dist/src/workflow-journal.js +0 -371
  109. package/dist/src/workspace-config.d.ts +18 -0
  110. package/dist/src/workspace-config.js +13 -0
  111. package/dist/src/workspace.js +73 -911
  112. package/package.json +1 -1
  113. package/dist/src/engine.d.ts +0 -2789
  114. package/dist/src/engine.js +0 -2392
  115. package/dist/src/ipc.d.ts +0 -248
  116. package/dist/src/providerRuntime.d.ts +0 -3949
  117. package/dist/src/providerRuntime.js +0 -1633
  118. package/dist/src/rig.d.ts +0 -783
  119. package/dist/src/rig.js +0 -2537
  120. package/dist/src/server.d.ts +0 -106
  121. package/dist/src/server.js +0 -1056
  122. package/dist/src/serviceFabric.d.ts +0 -62
  123. package/dist/src/serviceFabric.js +0 -1069
  124. package/dist/src/ws.d.ts +0 -747
  125. package/dist/src/ws.js +0 -3126
  126. /package/dist/src/{ipc.js → agent-roles.js} +0 -0
package/dist/src/ipc.d.ts DELETED
@@ -1,248 +0,0 @@
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, RigQueueRunSteeringInput, RigQueueRunSteeringResult, 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
- queueRunSteering: (input: RigQueueRunSteeringInput) => Promise<RigQueueRunSteeringResult>;
169
- interruptRun: (input: RigInterruptRunInput) => Promise<RigMutationResult>;
170
- stopRun: (input: RigStopRunInput) => Promise<RigMutationResult>;
171
- resolveApproval: (input: RigResolveApprovalInput) => Promise<RigMutationResult>;
172
- resolveUserInput: (input: RigResolveUserInputInput) => Promise<RigMutationResult>;
173
- getTaskArtifacts: (taskId: string) => Promise<RigGetTaskArtifactsResult>;
174
- onEvent: (callback: (event: EngineEvent) => void) => () => void;
175
- onRunLogAppended: (callback: (payload: RigRunLogAppendedPayload) => void) => () => void;
176
- };
177
- orchestration: {
178
- getSnapshot: () => Promise<OrchestrationReadModel>;
179
- dispatchCommand: (command: ClientOrchestrationCommand) => Promise<{
180
- sequence: number;
181
- }>;
182
- getTurnDiff: (input: OrchestrationGetTurnDiffInput) => Promise<OrchestrationGetTurnDiffResult>;
183
- getFullThreadDiff: (input: OrchestrationGetFullThreadDiffInput) => Promise<OrchestrationGetFullThreadDiffResult>;
184
- replayEvents: (fromSequenceExclusive: number) => Promise<OrchestrationEvent[]>;
185
- onDomainEvent: (callback: (event: OrchestrationEvent) => void) => () => void;
186
- };
187
- remote: {
188
- testEndpoint: (input: {
189
- host: string;
190
- port: number;
191
- token?: string;
192
- }) => Promise<{
193
- latencyMs: number;
194
- }>;
195
- listEndpoints: () => Promise<unknown[]>;
196
- registerEndpoint: (input: {
197
- alias: string;
198
- host: string;
199
- port: number;
200
- token?: string;
201
- autoConnect?: boolean;
202
- }) => Promise<unknown>;
203
- removeEndpoint: (input: {
204
- endpointId: string;
205
- }) => Promise<void>;
206
- connect: (input: {
207
- endpointId: string;
208
- }) => Promise<void>;
209
- disconnect: (input: {
210
- endpointId: string;
211
- }) => Promise<void>;
212
- createRunForTask: (input: {
213
- endpointId: string;
214
- taskId: string;
215
- runId: string;
216
- workspaceId: string;
217
- runtimeMode?: string;
218
- interactionMode?: string;
219
- }) => Promise<{
220
- ok: boolean;
221
- }>;
222
- terminalOpen: (input: {
223
- endpointId: string;
224
- threadId: string;
225
- terminalId: string;
226
- cwd?: string;
227
- env?: Record<string, string>;
228
- }) => Promise<unknown>;
229
- terminalWrite: (input: {
230
- endpointId: string;
231
- threadId: string;
232
- terminalId: string;
233
- data: string;
234
- }) => Promise<void>;
235
- terminalResize: (input: {
236
- endpointId: string;
237
- threadId: string;
238
- terminalId: string;
239
- cols: number;
240
- rows: number;
241
- }) => Promise<void>;
242
- terminalClose: (input: {
243
- endpointId: string;
244
- threadId: string;
245
- terminalId: string;
246
- }) => Promise<void>;
247
- };
248
- }