@h-rig/contracts 0.0.6-alpha.157 → 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,35 @@
1
+ /**
2
+ * Pure session-asset-materializer contract.
3
+ *
4
+ * Neutral home for the "materialize plugin-contributed session assets into the
5
+ * workspace" seam so the plugin-host assembler (@rig/core/plugin-host-context)
6
+ * can trigger Pi skill + package materialization without importing
7
+ * @rig/provider-plugin (a floor->plugin cycle). The provider plugin owns the
8
+ * concrete impl (it knows the `.pi/skills` + `.pi/settings.json` layout) and
9
+ * registers it under {@link SESSION_ASSET_MATERIALIZER}; the assembler resolves
10
+ * it by id off the project plugin host and calls it. When no provider plugin is
11
+ * loaded the capability is simply absent and materialization is skipped — the
12
+ * same non-fatal default the inline implementation had.
13
+ *
14
+ * Carries no behaviour and imports only sibling contract types.
15
+ */
16
+ import type { CapabilityId } from "./capability-id";
17
+ import type { RigConfig } from "./config";
18
+ /** Capability id the provider plugin registers its session-asset materializer under. */
19
+ export declare const SESSION_ASSET_MATERIALIZER_CAPABILITY_ID = "provider.session-asset-materializer";
20
+ /**
21
+ * Materializes the plugin-contributed session assets (Pi skills declared via
22
+ * `contributes.skills`, and the config-declared Pi extension packages in
23
+ * `runtime.pi.packages`) into the project workspace. Idempotent and non-fatal:
24
+ * implementations log-and-continue on individual write failures so a
25
+ * materialization error can never deadlock harness boot.
26
+ */
27
+ export interface SessionAssetMaterializerService {
28
+ materializeSessionAssets(projectRoot: string, config: RigConfig): Promise<void>;
29
+ }
30
+ /**
31
+ * Typed capability id the provider plugin provides and the plugin-host assembler
32
+ * requires. Phantom-typed with `SessionAssetMaterializerService` so `resolve(host)`
33
+ * returns the service with no cast leaking to callers.
34
+ */
35
+ export declare const SESSION_ASSET_MATERIALIZER: CapabilityId<SessionAssetMaterializerService>;
@@ -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/session-asset-materializer.ts
8
+ var SESSION_ASSET_MATERIALIZER_CAPABILITY_ID = "provider.session-asset-materializer";
9
+ var SESSION_ASSET_MATERIALIZER = makeCapabilityId(SESSION_ASSET_MATERIALIZER_CAPABILITY_ID);
10
+ export {
11
+ SESSION_ASSET_MATERIALIZER_CAPABILITY_ID,
12
+ SESSION_ASSET_MATERIALIZER
13
+ };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * cap:project-setup — cross-plugin seam.
3
+ *
4
+ * `@rig/cli-surface-plugin` (the `rig setup`/onboarding surface) runs project
5
+ * setup WITHOUT importing `@rig/init-plugin`: it requires this capability by id
6
+ * off the host. `@rig/init-plugin` OWNS the impl (`runSetup`) and registers it
7
+ * under this id. This file holds ONLY the pure seam vocabulary — no IO, no
8
+ * function-laden deps (those are the impl's concern, not the cross-plugin seam).
9
+ */
10
+ import type { CapabilityId } from "./capability-id";
11
+ /** Capability id the init/setup plugin registers its setup runner under. */
12
+ export declare const PROJECT_SETUP_CAPABILITY_ID = "cap:project-setup";
13
+ /**
14
+ * Where runs execute for this project. `kind` is the placement discriminator
15
+ * (e.g. "local" | "remote"); kept as a plain string so contracts stays free of
16
+ * the placement-domain enum.
17
+ */
18
+ export type ProjectSetupPlacement = {
19
+ readonly alias: string;
20
+ readonly kind: string;
21
+ readonly host?: string;
22
+ readonly port?: number;
23
+ readonly token?: string | null;
24
+ };
25
+ /** Pure input to a project-setup pass. */
26
+ export type ProjectSetupInput = {
27
+ readonly projectRoot: string;
28
+ readonly slug: string;
29
+ readonly placement: ProjectSetupPlacement;
30
+ readonly rewriteConfig?: boolean;
31
+ readonly ensurePi?: boolean;
32
+ readonly ensureLabels?: boolean;
33
+ readonly githubToken?: string | null;
34
+ readonly importGhToken?: boolean;
35
+ };
36
+ /** Pure summary of a project-setup pass. */
37
+ export type ProjectSetupResult = {
38
+ readonly repoSlug: string;
39
+ readonly placement: string;
40
+ readonly configWritten: boolean;
41
+ };
42
+ /** The cohesive project-setup operation the CLI surface depends on. Async (does IO). */
43
+ export interface ProjectSetupService {
44
+ runSetup(input: ProjectSetupInput): Promise<ProjectSetupResult>;
45
+ }
46
+ /** Typed capability id; string value is {@link PROJECT_SETUP_CAPABILITY_ID}. */
47
+ export declare const PROJECT_SETUP: CapabilityId<ProjectSetupService>;
@@ -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/setup.ts
8
+ var PROJECT_SETUP_CAPABILITY_ID = "cap:project-setup";
9
+ var PROJECT_SETUP = makeCapabilityId(PROJECT_SETUP_CAPABILITY_ID);
10
+ export {
11
+ PROJECT_SETUP_CAPABILITY_ID,
12
+ PROJECT_SETUP
13
+ };