@h-rig/contracts 0.0.6-alpha.18 → 0.0.6-alpha.181

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 (205) hide show
  1. package/dist/index.cjs +3442 -0
  2. package/dist/index.mjs +3401 -0
  3. package/dist/src/agent-roles.d.ts +8 -0
  4. package/dist/src/artifact.d.ts +13 -0
  5. package/dist/src/artifact.js +3 -0
  6. package/dist/src/baseSchemas.d.ts +63 -0
  7. package/dist/src/baseSchemas.js +6 -0
  8. package/dist/src/blocker-classifier.d.ts +21 -0
  9. package/dist/src/blocker-classifier.js +13 -0
  10. package/dist/src/browser.d.ts +80 -0
  11. package/dist/src/browser.js +13 -0
  12. package/dist/src/capability-id.d.ts +22 -0
  13. package/dist/src/capability-id.js +8 -0
  14. package/dist/src/cli-output.d.ts +348 -0
  15. package/dist/src/cli-output.js +190 -0
  16. package/dist/src/cli-runner.d.ts +43 -0
  17. package/dist/src/cli-runner.js +13 -0
  18. package/dist/src/cockpit.d.ts +58 -0
  19. package/dist/src/cockpit.js +13 -0
  20. package/dist/src/collab-session-viewer.d.ts +36 -0
  21. package/dist/src/collab-session-viewer.js +13 -0
  22. package/dist/src/config.d.ts +553 -0
  23. package/dist/src/config.js +767 -162
  24. package/dist/src/control-plane-types.d.ts +323 -0
  25. package/dist/src/control-plane-types.js +13 -0
  26. package/dist/src/conversation.d.ts +50 -0
  27. package/dist/src/conversation.js +3 -0
  28. package/dist/src/dependency-preflight.d.ts +43 -0
  29. package/dist/src/dependency-preflight.js +13 -0
  30. package/dist/src/docs-drift.d.ts +10 -0
  31. package/dist/src/docs-drift.js +12 -0
  32. package/dist/src/doctor.d.ts +90 -0
  33. package/dist/src/doctor.js +13 -0
  34. package/dist/src/drift.d.ts +28 -0
  35. package/dist/src/drift.js +69 -0
  36. package/dist/src/editor.d.ts +25 -0
  37. package/dist/src/editor.js +3 -0
  38. package/dist/src/errors.d.ts +13 -0
  39. package/dist/src/errors.js +17 -0
  40. package/dist/src/git.d.ts +152 -0
  41. package/dist/src/git.js +3 -0
  42. package/dist/src/github.d.ts +295 -0
  43. package/dist/src/github.js +17 -0
  44. package/dist/src/graph.d.ts +360 -0
  45. package/dist/src/graph.js +137 -1
  46. package/dist/src/guard.d.ts +118 -0
  47. package/dist/src/guard.js +15 -0
  48. package/dist/src/harness-events.d.ts +8 -0
  49. package/dist/src/harness-events.js +1 -0
  50. package/dist/src/harness-profile-state.d.ts +10 -0
  51. package/dist/src/harness-profile-state.js +13 -0
  52. package/dist/src/help-catalog.d.ts +41 -0
  53. package/dist/src/help-catalog.js +13 -0
  54. package/dist/src/host.d.ts +41 -0
  55. package/dist/src/host.js +13 -0
  56. package/dist/src/identity.d.ts +44 -0
  57. package/dist/src/identity.js +1 -0
  58. package/dist/src/index.d.ts +98 -0
  59. package/dist/src/index.js +2605 -3752
  60. package/dist/src/isolation.d.ts +213 -0
  61. package/dist/src/isolation.js +13 -0
  62. package/dist/src/kernel.d.ts +200 -0
  63. package/dist/src/kernel.js +261 -0
  64. package/dist/src/keybindings.d.ts +71 -0
  65. package/dist/src/keybindings.js +3 -0
  66. package/dist/src/layout.d.ts +44 -0
  67. package/dist/src/layout.js +8 -0
  68. package/dist/src/lifecycle-capabilities.d.ts +224 -0
  69. package/dist/src/lifecycle-capabilities.js +45 -0
  70. package/dist/src/managed-repos.d.ts +339 -0
  71. package/dist/src/managed-repos.js +37 -0
  72. package/dist/src/memory.d.ts +199 -0
  73. package/dist/src/memory.js +15 -0
  74. package/dist/src/model.d.ts +13 -0
  75. package/dist/src/model.js +3 -58
  76. package/dist/src/native-toolchain.d.ts +46 -0
  77. package/dist/src/native-toolchain.js +13 -0
  78. package/dist/src/notify.d.ts +46 -0
  79. package/dist/src/notify.js +13 -0
  80. package/dist/src/orchestration.d.ts +43 -0
  81. package/dist/src/orchestration.js +28 -961
  82. package/dist/src/panel-protocol.d.ts +17 -0
  83. package/dist/src/panel-protocol.js +10 -0
  84. package/dist/src/pi-session.d.ts +113 -0
  85. package/dist/src/pi-session.js +1 -0
  86. package/dist/src/placement.d.ts +47 -0
  87. package/dist/src/placement.js +13 -0
  88. package/dist/src/planning.d.ts +64 -0
  89. package/dist/src/planning.js +90 -0
  90. package/dist/src/plugin-hooks.d.ts +51 -0
  91. package/dist/src/plugin-hooks.js +386 -0
  92. package/dist/src/plugin.d.ts +476 -0
  93. package/dist/src/plugin.js +346 -64
  94. package/dist/src/policy.d.ts +16 -0
  95. package/dist/src/policy.js +3 -0
  96. package/dist/src/product-entrypoint.d.ts +22 -0
  97. package/dist/src/product-entrypoint.js +13 -0
  98. package/dist/src/project.d.ts +71 -0
  99. package/dist/src/project.js +3 -0
  100. package/dist/src/prompt.d.ts +29 -0
  101. package/dist/src/prompt.js +13 -0
  102. package/dist/src/protocol-version.d.ts +21 -0
  103. package/dist/src/protocol-version.js +6 -0
  104. package/dist/src/provider-instructions.d.ts +41 -0
  105. package/dist/src/provider-instructions.js +13 -0
  106. package/dist/src/provider.d.ts +105 -0
  107. package/dist/src/provider.js +16 -835
  108. package/dist/src/remote-control.d.ts +93 -0
  109. package/dist/src/remote-control.js +26 -0
  110. package/dist/src/remote.d.ts +318 -0
  111. package/dist/src/remote.js +238 -1078
  112. package/dist/src/review.d.ts +18 -0
  113. package/dist/src/review.js +3 -0
  114. package/dist/src/rollups.d.ts +41 -0
  115. package/dist/src/rollups.js +70 -0
  116. package/dist/src/run-control.d.ts +164 -0
  117. package/dist/src/run-control.js +13 -0
  118. package/dist/src/run-discovery.d.ts +83 -0
  119. package/dist/src/run-discovery.js +13 -0
  120. package/dist/src/run-dispatch.d.ts +34 -0
  121. package/dist/src/run-dispatch.js +13 -0
  122. package/dist/src/run-identity.d.ts +47 -0
  123. package/dist/src/run-identity.js +13 -0
  124. package/dist/src/run-journal.d.ts +694 -0
  125. package/dist/src/run-journal.js +569 -0
  126. package/dist/src/run-queue.d.ts +36 -0
  127. package/dist/src/run-queue.js +13 -0
  128. package/dist/src/run-read-model.d.ts +200 -0
  129. package/dist/src/run-read-model.js +13 -0
  130. package/dist/src/run-record.d.ts +45 -0
  131. package/dist/src/run-record.js +1 -0
  132. package/dist/src/run-registry-backbone.d.ts +56 -0
  133. package/dist/src/run-registry-backbone.js +13 -0
  134. package/dist/src/run-session-journal.d.ts +154 -0
  135. package/dist/src/run-session-journal.js +87 -0
  136. package/dist/src/run-status.d.ts +10 -0
  137. package/dist/src/run-status.js +27 -0
  138. package/dist/src/run-timeline.d.ts +7 -0
  139. package/dist/src/run-timeline.js +1 -0
  140. package/dist/src/runtime-secrets.d.ts +10 -0
  141. package/dist/src/runtime-secrets.js +13 -0
  142. package/dist/src/runtime-task-context.d.ts +82 -0
  143. package/dist/src/runtime-task-context.js +1 -0
  144. package/dist/src/runtime.d.ts +103 -0
  145. package/dist/src/runtime.js +73 -906
  146. package/dist/src/session-asset-materializer.d.ts +35 -0
  147. package/dist/src/session-asset-materializer.js +13 -0
  148. package/dist/src/session-hook-materializer.d.ts +41 -0
  149. package/dist/src/session-hook-materializer.js +13 -0
  150. package/dist/src/setup.d.ts +154 -0
  151. package/dist/src/setup.js +13 -0
  152. package/dist/src/stage.d.ts +245 -0
  153. package/dist/src/stage.js +169 -0
  154. package/dist/src/supervisor-journal.d.ts +204 -0
  155. package/dist/src/supervisor-journal.js +336 -0
  156. package/dist/src/supervisor-loop.d.ts +40 -0
  157. package/dist/src/supervisor-loop.js +13 -0
  158. package/dist/src/task-artifacts.d.ts +53 -0
  159. package/dist/src/task-artifacts.js +13 -0
  160. package/dist/src/task-config.d.ts +22 -0
  161. package/dist/src/task-config.js +1 -0
  162. package/dist/src/task-context-renderer.d.ts +29 -0
  163. package/dist/src/task-context-renderer.js +13 -0
  164. package/dist/src/task-data.d.ts +196 -0
  165. package/dist/src/task-data.js +13 -0
  166. package/dist/src/task-graph-primitives.d.ts +47 -0
  167. package/dist/src/task-graph-primitives.js +1 -0
  168. package/dist/src/task-source.d.ts +167 -0
  169. package/dist/src/task-source.js +24 -0
  170. package/dist/src/task-state-metadata.d.ts +21 -0
  171. package/dist/src/task-state-metadata.js +1 -0
  172. package/dist/src/task-state-paths.d.ts +14 -0
  173. package/dist/src/task-state-paths.js +13 -0
  174. package/dist/src/task-state-store.d.ts +36 -0
  175. package/dist/src/task-state-store.js +17 -0
  176. package/dist/src/task-tracker-state.d.ts +101 -0
  177. package/dist/src/task-tracker-state.js +39 -0
  178. package/dist/src/terminal.d.ts +130 -0
  179. package/dist/src/terminal.js +3 -0
  180. package/dist/src/tool-materializer.d.ts +36 -0
  181. package/dist/src/tool-materializer.js +13 -0
  182. package/dist/src/tool-registry.d.ts +3 -0
  183. package/dist/src/tool-registry.js +58 -0
  184. package/dist/src/toolchain-sources.d.ts +54 -0
  185. package/dist/src/toolchain-sources.js +17 -0
  186. package/dist/src/transport-config.d.ts +161 -0
  187. package/dist/src/transport-config.js +15 -0
  188. package/dist/src/validation.d.ts +14 -0
  189. package/dist/src/validation.js +3 -0
  190. package/dist/src/workflow-journal.d.ts +125 -0
  191. package/dist/src/workflow-journal.js +27 -0
  192. package/dist/src/workspace-config.d.ts +18 -0
  193. package/dist/src/workspace-config.js +13 -0
  194. package/dist/src/workspace-service.d.ts +16 -0
  195. package/dist/src/workspace-service.js +13 -0
  196. package/dist/src/workspace.d.ts +204 -0
  197. package/dist/src/workspace.js +76 -911
  198. package/package.json +55 -4
  199. package/dist/src/engine.js +0 -2278
  200. package/dist/src/providerRuntime.js +0 -1630
  201. package/dist/src/rig.js +0 -2374
  202. package/dist/src/server.js +0 -1053
  203. package/dist/src/serviceFabric.js +0 -1066
  204. package/dist/src/ws.js +0 -2968
  205. /package/dist/src/{ipc.js → agent-roles.js} +0 -0
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Pure runtime-task-context data shapes.
3
+ *
4
+ * These are behaviour-free data types describing the per-task runtime context
5
+ * the substrate materializes and threads to agents and capabilities. They carry
6
+ * no logic and import nothing but the sibling `RuntimeBrowserContext` contract,
7
+ * so they belong in the neutral contracts layer (exactly like `memory.ts` /
8
+ * `lifecycle-capabilities.ts`).
9
+ *
10
+ * The fs-backed loaders/serializers that PRODUCE and VALIDATE these shapes stay
11
+ * in `@rig/runtime/control-plane/runtime/context.ts`, which re-exports these
12
+ * types for back-compat so existing `import … from ".../runtime/context"` sites
13
+ * are unaffected.
14
+ */
15
+ import type { RuntimeBrowserContext } from "./browser";
16
+ /** Retrieval weighting for shared-memory recall; pure config data. */
17
+ export type RuntimeMemoryRetrievalConfig = {
18
+ topK: number;
19
+ lexicalWeight: number;
20
+ vectorWeight: number;
21
+ recencyWeight: number;
22
+ confidenceWeight: number;
23
+ };
24
+ /** The materialized shared-memory context handed to a runtime task. */
25
+ export type RuntimeMemoryContext = {
26
+ canonicalPath: string;
27
+ canonicalRef: string;
28
+ canonicalBaseOid?: string;
29
+ hydratedPath: string;
30
+ createdFresh: boolean;
31
+ retrieval: RuntimeMemoryRetrievalConfig;
32
+ };
33
+ /** The source-task contract fields a runtime task carries through. */
34
+ export type RuntimeSourceTaskContract = {
35
+ id: string;
36
+ title?: string;
37
+ description?: string;
38
+ body?: string;
39
+ acceptanceCriteria?: string;
40
+ acceptance_criteria?: string;
41
+ sourceIssueId?: string;
42
+ status?: string;
43
+ issueType?: string;
44
+ role?: string;
45
+ externalRef?: string;
46
+ scope?: string[];
47
+ validation?: string[];
48
+ validators?: string[];
49
+ labels?: string[];
50
+ };
51
+ /** The fully-resolved per-task runtime context. */
52
+ export type RuntimeTaskContext = {
53
+ runtimeId: string;
54
+ taskId: string;
55
+ role: string;
56
+ scopes: string[];
57
+ validation: string[];
58
+ sourceTask?: RuntimeSourceTaskContract;
59
+ browser?: RuntimeBrowserContext;
60
+ workspaceDir: string;
61
+ artifactRoot?: string;
62
+ hostProjectRoot?: string;
63
+ monorepoMainRoot?: string;
64
+ monorepoBaseRef?: string;
65
+ monorepoBaseCommit?: string;
66
+ initialHeadCommits?: {
67
+ project?: string;
68
+ monorepo?: string;
69
+ };
70
+ initialDirtyFiles?: {
71
+ project?: string[];
72
+ monorepo?: string[];
73
+ };
74
+ stateDir: string;
75
+ logsDir: string;
76
+ sessionDir: string;
77
+ sessionFile: string;
78
+ policyFile: string;
79
+ binDir: string;
80
+ createdAt: string;
81
+ memory?: RuntimeMemoryContext;
82
+ };
@@ -0,0 +1 @@
1
+ // @bun
@@ -0,0 +1,103 @@
1
+ import { Schema } from "effect";
2
+ export declare const RunKind: Schema.Literals<readonly ["adhoc", "task", "batch", "validation", "review"]>;
3
+ export type RunKind = typeof RunKind.Type;
4
+ export declare const RunMode: Schema.Literals<readonly ["interactive", "autonomous", "supervised"]>;
5
+ export type RunMode = typeof RunMode.Type;
6
+ export declare const RunStatus: Schema.Literals<readonly ["created", "queued", "preparing", "running", "waiting-approval", "waiting-user-input", "paused", "validating", "reviewing", "closing-out", "needs-attention", "completed", "failed", "stopped"]>;
7
+ export type RunStatus = typeof RunStatus.Type;
8
+ export declare const EngineSandboxMode: Schema.Literals<readonly ["read-only", "workspace-write", "danger-full-access"]>;
9
+ export type EngineSandboxMode = typeof EngineSandboxMode.Type;
10
+ export declare const IsolationMode: Schema.Literals<readonly ["none", "env", "worktree"]>;
11
+ export type IsolationMode = typeof IsolationMode.Type;
12
+ export declare const RuntimeStatus: Schema.Literals<readonly ["prepared", "starting", "running", "interrupted", "exited", "failed", "destroyed"]>;
13
+ export type RuntimeStatus = typeof RuntimeStatus.Type;
14
+ export declare const RunExecutionTarget: Schema.Literals<readonly ["local", "remote"]>;
15
+ export type RunExecutionTarget = typeof RunExecutionTarget.Type;
16
+ export declare const RunSummary: Schema.Struct<{
17
+ readonly id: Schema.brand<Schema.Trim, "RunId">;
18
+ readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
19
+ readonly taskId: Schema.NullOr<Schema.brand<Schema.Trim, "TaskId">>;
20
+ readonly title: Schema.Trim;
21
+ readonly runKind: Schema.Literals<readonly ["adhoc", "task", "batch", "validation", "review"]>;
22
+ readonly mode: Schema.Literals<readonly ["interactive", "autonomous", "supervised"]>;
23
+ readonly runtimeMode: Schema.Literals<readonly ["approval-required", "full-access"]>;
24
+ readonly interactionMode: Schema.Literals<readonly ["default", "plan"]>;
25
+ readonly status: Schema.Literals<readonly ["created", "queued", "preparing", "running", "waiting-approval", "waiting-user-input", "paused", "validating", "reviewing", "closing-out", "needs-attention", "completed", "failed", "stopped"]>;
26
+ readonly runtimeAdapter: Schema.Literal<"pi">;
27
+ readonly model: Schema.NullOr<Schema.Trim>;
28
+ readonly initialPrompt: Schema.NullOr<Schema.String>;
29
+ readonly executionTarget: Schema.optional<Schema.Literals<readonly ["local", "remote"]>>;
30
+ readonly remoteHostId: Schema.optional<Schema.NullOr<Schema.Trim>>;
31
+ readonly remoteLeaseId: Schema.optional<Schema.NullOr<Schema.Trim>>;
32
+ readonly remoteLeaseClaimedAt: Schema.optional<Schema.NullOr<Schema.String>>;
33
+ readonly activeRuntimeId: Schema.NullOr<Schema.brand<Schema.Trim, "EngineRuntimeId">>;
34
+ readonly latestMessageId: Schema.NullOr<Schema.Trim>;
35
+ readonly pendingApprovalCount: Schema.Int;
36
+ readonly pendingUserInputCount: Schema.Int;
37
+ readonly branch: Schema.NullOr<Schema.Trim>;
38
+ readonly worktreePath: Schema.NullOr<Schema.Trim>;
39
+ readonly errorText: Schema.NullOr<Schema.String>;
40
+ readonly createdAt: Schema.String;
41
+ readonly updatedAt: Schema.String;
42
+ readonly startedAt: Schema.NullOr<Schema.String>;
43
+ readonly completedAt: Schema.NullOr<Schema.String>;
44
+ }>;
45
+ export type RunSummary = typeof RunSummary.Type;
46
+ export declare const RuntimeSummary: Schema.Struct<{
47
+ readonly id: Schema.brand<Schema.Trim, "EngineRuntimeId">;
48
+ readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
49
+ readonly runId: Schema.brand<Schema.Trim, "RunId">;
50
+ readonly adapterKind: Schema.Literal<"pi">;
51
+ readonly executionTarget: Schema.optional<Schema.Literals<readonly ["local", "remote"]>>;
52
+ readonly remoteHostId: Schema.optional<Schema.NullOr<Schema.Trim>>;
53
+ readonly status: Schema.Literals<readonly ["prepared", "starting", "running", "interrupted", "exited", "failed", "destroyed"]>;
54
+ readonly sandboxMode: Schema.Literals<readonly ["read-only", "workspace-write", "danger-full-access"]>;
55
+ readonly isolationMode: Schema.Literals<readonly ["none", "env", "worktree"]>;
56
+ readonly workspaceDir: Schema.NullOr<Schema.Trim>;
57
+ readonly homeDir: Schema.NullOr<Schema.Trim>;
58
+ readonly tmpDir: Schema.NullOr<Schema.Trim>;
59
+ readonly cacheDir: Schema.NullOr<Schema.Trim>;
60
+ readonly logsDir: Schema.NullOr<Schema.Trim>;
61
+ readonly stateDir: Schema.NullOr<Schema.Trim>;
62
+ readonly sessionDir: Schema.NullOr<Schema.Trim>;
63
+ readonly sessionLogPath: Schema.NullOr<Schema.Trim>;
64
+ readonly pid: Schema.NullOr<Schema.Int>;
65
+ readonly startedAt: Schema.NullOr<Schema.String>;
66
+ readonly updatedAt: Schema.String;
67
+ readonly exitedAt: Schema.NullOr<Schema.String>;
68
+ }>;
69
+ export type RuntimeSummary = typeof RuntimeSummary.Type;
70
+ export declare const ApprovalStatus: Schema.Literals<readonly ["pending", "resolved"]>;
71
+ export type ApprovalStatus = typeof ApprovalStatus.Type;
72
+ export declare const ApprovalSummary: Schema.Struct<{
73
+ readonly id: Schema.Trim;
74
+ readonly runId: Schema.brand<Schema.Trim, "RunId">;
75
+ readonly actionId: Schema.NullOr<Schema.Trim>;
76
+ readonly requestKind: Schema.Trim;
77
+ readonly status: Schema.Literals<readonly ["pending", "resolved"]>;
78
+ readonly payload: Schema.Unknown;
79
+ readonly createdAt: Schema.String;
80
+ readonly resolvedAt: Schema.NullOr<Schema.String>;
81
+ }>;
82
+ export type ApprovalSummary = typeof ApprovalSummary.Type;
83
+ export declare const UserInputRequestSummary: Schema.Struct<{
84
+ readonly id: Schema.Trim;
85
+ readonly runId: Schema.brand<Schema.Trim, "RunId">;
86
+ readonly status: Schema.Literals<readonly ["pending", "resolved"]>;
87
+ readonly payload: Schema.Unknown;
88
+ readonly createdAt: Schema.String;
89
+ readonly resolvedAt: Schema.NullOr<Schema.String>;
90
+ }>;
91
+ export type UserInputRequestSummary = typeof UserInputRequestSummary.Type;
92
+ export declare const WorktreeSummary: Schema.Struct<{
93
+ readonly id: Schema.brand<Schema.Trim, "WorktreeId">;
94
+ readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
95
+ readonly runId: Schema.brand<Schema.Trim, "RunId">;
96
+ readonly taskId: Schema.NullOr<Schema.brand<Schema.Trim, "TaskId">>;
97
+ readonly branchName: Schema.Trim;
98
+ readonly path: Schema.Trim;
99
+ readonly status: Schema.Trim;
100
+ readonly createdAt: Schema.String;
101
+ readonly cleanedAt: Schema.NullOr<Schema.String>;
102
+ }>;
103
+ export type WorktreeSummary = typeof WorktreeSummary.Type;