@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
@@ -0,0 +1,41 @@
1
+ /**
2
+ * cap:host-run — the OMP run-host seam.
3
+ *
4
+ * `@rig/rig-host` is reclassified MOSTLY floor-neutral-exec (its generic
5
+ * session/pty/protocol/workspace launch plumbing is product-agnostic). The
6
+ * OMP-SPECIFIC runner (provision an isolated workspace + spawn the PTY-hosted
7
+ * OMP run process) is NOT baked into the floor — it is contributed as a host
8
+ * plugin capability under this id. Consumers (a dispatch surface) resolve this
9
+ * capability off the host instead of importing the runner impl.
10
+ *
11
+ * This file holds ONLY the pure seam vocabulary — no IO, no runner deps (those
12
+ * belong to the impl in `@rig/rig-host`, never to the cross-package seam).
13
+ */
14
+ import type { CapabilityId } from "./capability-id";
15
+ /** Capability id the OMP run-host plugin registers its runner under. */
16
+ export declare const HOST_RUN_CAPABILITY_ID = "cap:host-run";
17
+ /** Pure input describing the run to host. */
18
+ export type HostRunProcessInput = {
19
+ readonly projectRoot?: string;
20
+ readonly taskId: string;
21
+ /** Dispatch/worktree handle (historical external name); not the OMP session id. */
22
+ readonly runId?: string;
23
+ readonly title?: string | null;
24
+ readonly model?: string | null;
25
+ readonly prompt?: string | null;
26
+ readonly forceSteerOnce?: boolean;
27
+ /** Optional sink for the bootstrap launcher's stdout. */
28
+ readonly writeStdout?: (text: string) => void;
29
+ };
30
+ /** Pure summary of a hosted run bootstrap (impl-internal runtime handle omitted). */
31
+ export type HostRunProcessResult = {
32
+ readonly dispatchHandle: string;
33
+ readonly pid: number;
34
+ readonly sessionName: string;
35
+ };
36
+ /** The cohesive run-host operation a dispatch surface depends on. Async (does IO). */
37
+ export interface HostRunService {
38
+ runHostProcess(input: HostRunProcessInput): Promise<HostRunProcessResult>;
39
+ }
40
+ /** Typed capability id; string value is {@link HOST_RUN_CAPABILITY_ID}. */
41
+ export declare const HOST_RUN: CapabilityId<HostRunService>;
@@ -0,0 +1,13 @@
1
+ // @bun
2
+ // packages/contracts/src/capability-id.ts
3
+ function makeCapabilityId(id) {
4
+ return id;
5
+ }
6
+
7
+ // packages/contracts/src/host.ts
8
+ var HOST_RUN_CAPABILITY_ID = "cap:host-run";
9
+ var HOST_RUN = makeCapabilityId(HOST_RUN_CAPABILITY_ID);
10
+ export {
11
+ HOST_RUN_CAPABILITY_ID,
12
+ HOST_RUN
13
+ };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * identity.ts — pure structural vocabulary for Rig run identity resolution.
3
+ *
4
+ * The identity resolver implementation (`resolveRigIdentity` /
5
+ * `resolveRigIdentityFilter`) is the GitHub provider's SCM-identity domain and
6
+ * is exposed through the `RUN_IDENTITY_ENV` capability. Only the structural
7
+ * TYPES the resolver reads/returns live here, so any consumer can name the
8
+ * shapes without importing a plugin.
9
+ *
10
+ * The session-manager / auth-storage shapes are deliberately minimal
11
+ * (read-only, structural) so they stay decoupled from the concrete OMP
12
+ * session-manager class — exactly the slice the identity resolver needs.
13
+ */
14
+ import type { RigWorkflowOwner } from "./workflow-journal";
15
+ /** Read-only slice of an OMP session manager the identity resolver reads. */
16
+ export type ReadonlySessionIdentityManager = {
17
+ getCwd(): string;
18
+ getSessionId(): string;
19
+ getBranch(): readonly {
20
+ type: string;
21
+ customType?: string;
22
+ data?: unknown;
23
+ }[];
24
+ };
25
+ /** Read-only slice of OMP auth storage the identity resolver probes for github-copilot identity. */
26
+ export type OmpAuthStorage = {
27
+ getOAuthAccountIdentity?: (provider: string, sessionId?: string) => unknown;
28
+ };
29
+ /** The structural context the Rig identity resolver reads to derive run owner identity. */
30
+ export type RigIdentityContext = {
31
+ sessionManager: ReadonlySessionIdentityManager;
32
+ modelRegistry?: {
33
+ authStorage?: OmpAuthStorage;
34
+ };
35
+ };
36
+ /** A resolved Rig run identity: the selected repo and its github-derived owner. */
37
+ export type RigIdentity = {
38
+ selectedRepo: string;
39
+ owner: RigWorkflowOwner;
40
+ };
41
+ /** A `RigIdentity` annotated with the `+`-joined provenance of the inputs that produced it. */
42
+ export type RigResolvedIdentity = RigIdentity & {
43
+ source: string;
44
+ };
@@ -0,0 +1 @@
1
+ // @bun
@@ -9,31 +9,34 @@ export * from "./workflow-journal";
9
9
  export * from "./run-timeline";
10
10
  export * from "./run-record";
11
11
  export * from "./run-status";
12
+ export * from "./run-read-model";
12
13
  export * from "./conversation";
13
14
  export * from "./plugin";
15
+ export * from "./agent-roles";
14
16
  export * from "./plugin-hooks";
15
17
  export * from "./config";
16
18
  export * from "./policy";
19
+ export * from "./guard";
20
+ export * from "./tool-registry";
17
21
  export * from "./validation";
18
22
  export * from "./review";
19
23
  export * from "./artifact";
20
- export * from "./engine";
21
- export * from "./rig";
22
24
  export * from "./remote";
23
- export * from "./ipc";
24
25
  export * from "./terminal";
25
26
  export * from "./provider";
26
- export * from "./providerRuntime";
27
27
  export * from "./model";
28
- export * from "./ws";
29
28
  export * from "./keybindings";
30
- export * from "./server";
31
- export * from "./serviceFabric";
32
29
  export * from "./git";
33
30
  export * from "./orchestration";
34
31
  export * from "./editor";
35
32
  export * from "./project";
33
+ export * from "./setup";
34
+ export * from "./host";
35
+ export * from "./run-identity";
36
+ export * from "./prompt";
36
37
  export * from "./task-source";
38
+ export * from "./task-state-metadata";
39
+ export * from "./task-data";
37
40
  export * from "./cli-output";
38
41
  export * from "./pi-session";
39
42
  export * from "./protocol-version";
@@ -46,12 +49,29 @@ export * from "./drift";
46
49
  export * from "./rollups";
47
50
  export * from "./panel-protocol";
48
51
  export * from "./control-plane-types";
52
+ export * from "./capability-id";
53
+ export * from "./dependency-preflight";
54
+ export * from "./workspace-config";
55
+ export * from "./runtime-task-context";
56
+ export * from "./layout";
57
+ export * from "./errors";
58
+ export * from "./harness-events";
49
59
  export * from "./lifecycle-capabilities";
50
60
  export * from "./browser";
51
61
  export * from "./memory";
62
+ export * from "./notify";
63
+ export * from "./collab-session-viewer";
52
64
  export * from "./provider-instructions";
65
+ export * from "./session-asset-materializer";
53
66
  export * from "./isolation";
54
67
  export * from "./managed-repos";
55
68
  export * from "./task-graph-primitives";
56
69
  export * from "./github";
57
70
  export * from "./doctor";
71
+ export * from "./run-dispatch";
72
+ export * from "./identity";
73
+ export * from "./run-discovery";
74
+ export * from "./run-registry-backbone";
75
+ export * from "./tool-materializer";
76
+ export * from "./toolchain-sources";
77
+ export * from "./cli-runner";