@h-rig/core 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 (105) hide show
  1. package/dist/src/agent-role-registry.d.ts +4 -0
  2. package/dist/src/agent-role-registry.js +27 -0
  3. package/dist/src/authority-paths.d.ts +15 -0
  4. package/dist/src/authority-paths.js +80 -0
  5. package/dist/src/baked-secrets.d.ts +3 -0
  6. package/dist/src/baked-secrets.js +63 -0
  7. package/dist/src/build-time-config.d.ts +12 -0
  8. package/dist/src/build-time-config.js +25 -0
  9. package/dist/src/build-time-config.macro.d.ts +1 -0
  10. package/dist/src/capability-loaders.d.ts +51 -0
  11. package/dist/src/capability-loaders.js +870 -0
  12. package/dist/src/capability.d.ts +79 -0
  13. package/dist/src/capability.js +63 -0
  14. package/dist/src/checkout-root.d.ts +1 -0
  15. package/dist/src/checkout-root.js +30 -0
  16. package/dist/src/config-env.d.ts +4 -0
  17. package/dist/src/config-env.js +23 -0
  18. package/dist/src/config.d.ts +3 -0
  19. package/dist/src/config.js +44 -0
  20. package/dist/src/declarative-config.d.ts +14 -0
  21. package/dist/src/declarative-config.js +85 -0
  22. package/dist/src/default-kernel.d.ts +1 -0
  23. package/dist/src/default-kernel.js +12 -0
  24. package/dist/src/define-config.d.ts +20 -0
  25. package/dist/src/define-config.js +28 -15
  26. package/dist/src/define-plugin.d.ts +13 -0
  27. package/dist/src/define-plugin.js +4 -43
  28. package/dist/src/embedded-plugins.d.ts +59 -0
  29. package/dist/src/embedded-plugins.js +22 -0
  30. package/dist/src/exec.d.ts +13 -0
  31. package/dist/src/exec.js +101 -0
  32. package/dist/src/harness-paths.d.ts +9 -0
  33. package/dist/src/harness-paths.js +126 -0
  34. package/dist/src/hook-materializer.d.ts +21 -0
  35. package/dist/src/hook-materializer.js +152 -0
  36. package/dist/src/hook-protocol.d.ts +2 -0
  37. package/dist/src/hook-protocol.js +432 -0
  38. package/dist/src/hook-runner.d.ts +48 -0
  39. package/dist/src/hook-runner.js +868 -0
  40. package/dist/src/hook-runtime.d.ts +52 -0
  41. package/dist/src/hook-runtime.js +432 -0
  42. package/dist/src/index.d.ts +8 -0
  43. package/dist/src/index.js +210 -2499
  44. package/dist/src/json-files.d.ts +9 -0
  45. package/dist/src/json-files.js +124 -0
  46. package/dist/src/kernel-boot.d.ts +2 -0
  47. package/dist/src/kernel-boot.js +10 -0
  48. package/dist/src/kernel-entrypoint.d.ts +22 -0
  49. package/dist/src/kernel-entrypoint.js +660 -0
  50. package/dist/src/kernel-plugin-abi.d.ts +1 -0
  51. package/dist/src/kernel-plugin-abi.js +1 -0
  52. package/dist/src/kernel-resolver.d.ts +2 -0
  53. package/dist/src/kernel-resolver.js +6 -0
  54. package/dist/src/layout.d.ts +10 -0
  55. package/dist/src/layout.js +138 -0
  56. package/dist/src/load-config.d.ts +2 -0
  57. package/dist/src/load-config.js +535 -30
  58. package/dist/src/placement.d.ts +58 -0
  59. package/dist/src/placement.js +53 -0
  60. package/dist/src/plugin-host-context.d.ts +65 -0
  61. package/dist/src/plugin-host-context.js +1171 -0
  62. package/dist/src/plugin-host-registries.d.ts +31 -0
  63. package/dist/src/plugin-host-registries.js +79 -0
  64. package/dist/src/plugin-host.d.ts +77 -0
  65. package/dist/src/plugin-host.js +127 -63
  66. package/dist/src/plugin-runtime.d.ts +173 -0
  67. package/dist/src/project-plugins.d.ts +63 -0
  68. package/dist/src/project-plugins.js +905 -0
  69. package/dist/src/remote-config.d.ts +125 -0
  70. package/dist/src/remote-config.js +85 -0
  71. package/dist/src/root-resolver.d.ts +5 -0
  72. package/dist/src/root-resolver.js +68 -0
  73. package/dist/src/run-provisioning.d.ts +37 -0
  74. package/dist/src/run-provisioning.js +35 -0
  75. package/dist/src/runtime-context.d.ts +20 -0
  76. package/dist/src/runtime-context.js +257 -0
  77. package/dist/src/runtime-events.d.ts +44 -0
  78. package/dist/src/runtime-events.js +208 -0
  79. package/dist/src/runtime-overlay.d.ts +11 -0
  80. package/dist/src/runtime-overlay.js +69 -0
  81. package/dist/src/runtime-paths.d.ts +21 -0
  82. package/dist/src/runtime-paths.js +181 -0
  83. package/dist/src/runtime-provisioning-env.d.ts +5 -0
  84. package/dist/src/runtime-provisioning-env.js +217 -0
  85. package/dist/src/runtime-runner-context.d.ts +12 -0
  86. package/dist/src/runtime-runner-context.js +1 -0
  87. package/dist/src/safe-identifiers.d.ts +44 -0
  88. package/dist/src/safe-identifiers.js +96 -0
  89. package/dist/src/scope-rules.d.ts +4 -0
  90. package/dist/src/scope-rules.js +21 -0
  91. package/dist/src/server-paths.d.ts +22 -0
  92. package/dist/src/server-paths.js +219 -0
  93. package/dist/src/setup-version.d.ts +3 -0
  94. package/dist/src/setup-version.js +14 -0
  95. package/dist/src/task-record-reader.d.ts +3 -0
  96. package/dist/src/task-record-reader.js +9 -0
  97. package/dist/src/validator-registry.d.ts +27 -0
  98. package/dist/src/validator-registry.js +64 -0
  99. package/package.json +162 -10
  100. package/dist/src/engineReadModelReducer.js +0 -1780
  101. package/dist/src/rig-init-builder.js +0 -57
  102. package/dist/src/rigSelectors.js +0 -293
  103. package/dist/src/taskGraph.js +0 -64
  104. package/dist/src/taskGraphCodes.js +0 -26
  105. package/dist/src/taskGraphLayout.js +0 -374
@@ -0,0 +1,27 @@
1
+ import type { ValidatorRegistration } from "@rig/contracts";
2
+ export interface ValidatorResult {
3
+ id: string;
4
+ passed: boolean;
5
+ summary: string;
6
+ details?: string;
7
+ }
8
+ export interface ValidatorContext {
9
+ taskId: string;
10
+ workspaceRoot: string;
11
+ scope: readonly string[];
12
+ /** Absolute path to the monorepo checkout root (MONOREPO_ROOT / MONOREPO_MAIN_ROOT env equiv). */
13
+ monorepoRoot?: string;
14
+ /** Absolute path to the task's artifacts output directory (ARTIFACTS_DIR env equiv). */
15
+ artifactsDir?: string;
16
+ /** The full task config entry for this task — opaque to the registry, but available for advanced validators. */
17
+ taskConfig?: unknown;
18
+ }
19
+ export interface RegisteredValidator extends ValidatorRegistration {
20
+ run(ctx: ValidatorContext): Promise<ValidatorResult>;
21
+ }
22
+ export interface ValidatorRegistry {
23
+ register(v: RegisteredValidator): void;
24
+ resolve(id: string): RegisteredValidator;
25
+ list(): readonly RegisteredValidator[];
26
+ }
27
+ export declare function createValidatorRegistry(): ValidatorRegistry;
@@ -0,0 +1,64 @@
1
+ // @bun
2
+ // packages/core/src/validator-registry.ts
3
+ import { existsSync } from "fs";
4
+ import { join } from "path";
5
+ function createValidatorRegistry() {
6
+ const map = new Map;
7
+ const order = [];
8
+ const registry = {
9
+ register(v) {
10
+ if (map.has(v.id))
11
+ throw new Error(`validator already registered: ${v.id}`);
12
+ map.set(v.id, v);
13
+ order.push(v);
14
+ },
15
+ resolve(id) {
16
+ const v = map.get(id);
17
+ if (!v)
18
+ throw new Error(`validator not registered: ${id}`);
19
+ return v;
20
+ },
21
+ list: () => order
22
+ };
23
+ registerBuiltInValidators(registry);
24
+ return registry;
25
+ }
26
+ function registerBuiltInValidators(registry) {
27
+ registry.register({
28
+ id: "std:typecheck",
29
+ category: "custom",
30
+ description: "Runs the package typecheck script when present.",
31
+ run: async (ctx) => runStdTypecheck(ctx)
32
+ });
33
+ }
34
+ async function runStdTypecheck(ctx) {
35
+ const packageJsonPath = join(ctx.workspaceRoot, "package.json");
36
+ if (!existsSync(packageJsonPath)) {
37
+ return {
38
+ id: "std:typecheck",
39
+ passed: false,
40
+ summary: `package.json not found at ${packageJsonPath}`
41
+ };
42
+ }
43
+ const proc = Bun.spawn(["bun", "run", "typecheck"], {
44
+ cwd: ctx.workspaceRoot,
45
+ env: process.env,
46
+ stdout: "pipe",
47
+ stderr: "pipe"
48
+ });
49
+ const [exitCode, stdout, stderr] = await Promise.all([
50
+ proc.exited,
51
+ new Response(proc.stdout).text(),
52
+ new Response(proc.stderr).text()
53
+ ]);
54
+ const output = `${stdout}${stderr}`.trim();
55
+ return {
56
+ id: "std:typecheck",
57
+ passed: exitCode === 0,
58
+ summary: exitCode === 0 ? "typecheck passed" : "typecheck failed",
59
+ ...output ? { details: output.slice(0, 4000) } : {}
60
+ };
61
+ }
62
+ export {
63
+ createValidatorRegistry
64
+ };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@h-rig/core",
3
- "version": "0.0.6-alpha.18",
3
+ "version": "0.0.6-alpha.181",
4
4
  "type": "module",
5
- "description": "Rig package",
5
+ "description": "Config and plugin composition library for Rig's OMP extension ecosystem; not a product host/runtime.",
6
6
  "license": "UNLICENSED",
7
7
  "files": [
8
8
  "dist",
@@ -10,19 +10,168 @@
10
10
  ],
11
11
  "exports": {
12
12
  ".": {
13
+ "types": "./dist/src/index.d.ts",
13
14
  "import": "./dist/src/index.js"
14
15
  },
15
16
  "./load-config": {
17
+ "types": "./dist/src/load-config.d.ts",
16
18
  "import": "./dist/src/load-config.js"
17
19
  },
18
- "./engineReadModelReducer": {
19
- "import": "./dist/src/engineReadModelReducer.js"
20
+ "./config": {
21
+ "types": "./dist/src/config.d.ts",
22
+ "import": "./dist/src/config.js"
20
23
  },
21
- "./rigSelectors": {
22
- "import": "./dist/src/rigSelectors.js"
24
+ "./project-plugins": {
25
+ "types": "./dist/src/project-plugins.d.ts",
26
+ "import": "./dist/src/project-plugins.js"
23
27
  },
24
- "./taskGraph": {
25
- "import": "./dist/src/taskGraph.js"
28
+ "./task-record-reader": {
29
+ "types": "./dist/src/task-record-reader.d.ts",
30
+ "import": "./dist/src/task-record-reader.js"
31
+ },
32
+ "./embedded-plugins": {
33
+ "types": "./dist/src/embedded-plugins.d.ts",
34
+ "import": "./dist/src/embedded-plugins.js"
35
+ },
36
+ "./capability": {
37
+ "types": "./dist/src/capability.d.ts",
38
+ "import": "./dist/src/capability.js"
39
+ },
40
+ "./capability-loaders": {
41
+ "types": "./dist/src/capability-loaders.d.ts",
42
+ "import": "./dist/src/capability-loaders.js"
43
+ },
44
+ "./layout": {
45
+ "types": "./dist/src/layout.d.ts",
46
+ "import": "./dist/src/layout.js"
47
+ },
48
+ "./config-env": {
49
+ "types": "./dist/src/config-env.d.ts",
50
+ "import": "./dist/src/config-env.js"
51
+ },
52
+ "./kernel-entrypoint": {
53
+ "types": "./dist/src/kernel-entrypoint.d.ts",
54
+ "import": "./dist/src/kernel-entrypoint.js"
55
+ },
56
+ "./kernel-boot": {
57
+ "types": "./dist/src/kernel-boot.d.ts",
58
+ "import": "./dist/src/kernel-boot.js"
59
+ },
60
+ "./default-kernel": {
61
+ "types": "./dist/src/default-kernel.d.ts",
62
+ "import": "./dist/src/default-kernel.js"
63
+ },
64
+ "./kernel-resolver": {
65
+ "types": "./dist/src/kernel-resolver.d.ts",
66
+ "import": "./dist/src/kernel-resolver.js"
67
+ },
68
+ "./kernel-plugin-abi": {
69
+ "types": "./dist/src/kernel-plugin-abi.d.ts",
70
+ "import": "./dist/src/kernel-plugin-abi.js"
71
+ },
72
+ "./setup-version": {
73
+ "types": "./dist/src/setup-version.d.ts",
74
+ "import": "./dist/src/setup-version.js"
75
+ },
76
+ "./baked-secrets": {
77
+ "types": "./dist/src/baked-secrets.d.ts",
78
+ "import": "./dist/src/baked-secrets.js"
79
+ },
80
+ "./runtime-context": {
81
+ "types": "./dist/src/runtime-context.d.ts",
82
+ "import": "./dist/src/runtime-context.js"
83
+ },
84
+ "./runtime-events": {
85
+ "types": "./dist/src/runtime-events.d.ts",
86
+ "import": "./dist/src/runtime-events.js"
87
+ },
88
+ "./runtime-runner-context": {
89
+ "types": "./dist/src/runtime-runner-context.d.ts",
90
+ "import": "./dist/src/runtime-runner-context.js"
91
+ },
92
+ "./build-time-config": {
93
+ "types": "./dist/src/build-time-config.d.ts",
94
+ "import": "./dist/src/build-time-config.js"
95
+ },
96
+ "./build-time-config.macro": {
97
+ "types": "./dist/src/build-time-config.macro.d.ts",
98
+ "import": "./dist/src/build-time-config.macro.js"
99
+ },
100
+ "./server-paths": {
101
+ "types": "./dist/src/server-paths.d.ts",
102
+ "import": "./dist/src/server-paths.js"
103
+ },
104
+ "./harness-paths": {
105
+ "types": "./dist/src/harness-paths.d.ts",
106
+ "import": "./dist/src/harness-paths.js"
107
+ },
108
+ "./root-resolver": {
109
+ "types": "./dist/src/root-resolver.d.ts",
110
+ "import": "./dist/src/root-resolver.js"
111
+ },
112
+ "./json-files": {
113
+ "types": "./dist/src/json-files.d.ts",
114
+ "import": "./dist/src/json-files.js"
115
+ },
116
+ "./exec": {
117
+ "types": "./dist/src/exec.d.ts",
118
+ "import": "./dist/src/exec.js"
119
+ },
120
+ "./hook-materializer": {
121
+ "types": "./dist/src/hook-materializer.d.ts",
122
+ "import": "./dist/src/hook-materializer.js"
123
+ },
124
+ "./hook-runner": {
125
+ "types": "./dist/src/hook-runner.d.ts",
126
+ "import": "./dist/src/hook-runner.js"
127
+ },
128
+ "./hook-protocol": {
129
+ "types": "./dist/src/hook-protocol.d.ts",
130
+ "import": "./dist/src/hook-protocol.js"
131
+ },
132
+ "./plugin-host-registries": {
133
+ "types": "./dist/src/plugin-host-registries.d.ts",
134
+ "import": "./dist/src/plugin-host-registries.js"
135
+ },
136
+ "./plugin-host-context": {
137
+ "types": "./dist/src/plugin-host-context.d.ts",
138
+ "import": "./dist/src/plugin-host-context.js"
139
+ },
140
+ "./safe-identifiers": {
141
+ "types": "./dist/src/safe-identifiers.d.ts",
142
+ "import": "./dist/src/safe-identifiers.js"
143
+ },
144
+ "./checkout-root": {
145
+ "types": "./dist/src/checkout-root.d.ts",
146
+ "import": "./dist/src/checkout-root.js"
147
+ },
148
+ "./scope-rules": {
149
+ "types": "./dist/src/scope-rules.d.ts",
150
+ "import": "./dist/src/scope-rules.js"
151
+ },
152
+ "./remote-config": {
153
+ "types": "./dist/src/remote-config.d.ts",
154
+ "import": "./dist/src/remote-config.js"
155
+ },
156
+ "./placement": {
157
+ "types": "./dist/src/placement.d.ts",
158
+ "import": "./dist/src/placement.js"
159
+ },
160
+ "./runtime-paths": {
161
+ "types": "./dist/src/runtime-paths.d.ts",
162
+ "import": "./dist/src/runtime-paths.js"
163
+ },
164
+ "./runtime-provisioning-env": {
165
+ "types": "./dist/src/runtime-provisioning-env.d.ts",
166
+ "import": "./dist/src/runtime-provisioning-env.js"
167
+ },
168
+ "./runtime-overlay": {
169
+ "types": "./dist/src/runtime-overlay.d.ts",
170
+ "import": "./dist/src/runtime-overlay.js"
171
+ },
172
+ "./run-provisioning": {
173
+ "types": "./dist/src/run-provisioning.d.ts",
174
+ "import": "./dist/src/run-provisioning.js"
26
175
  }
27
176
  },
28
177
  "engines": {
@@ -30,8 +179,11 @@
30
179
  },
31
180
  "main": "./dist/src/index.js",
32
181
  "module": "./dist/src/index.js",
182
+ "types": "./dist/src/index.d.ts",
33
183
  "dependencies": {
34
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.18",
35
- "effect": "4.0.0-beta.78"
184
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.181",
185
+ "@rig/kernel-seed": "npm:@h-rig/kernel-seed@0.0.6-alpha.181",
186
+ "effect": "4.0.0-beta.90",
187
+ "smol-toml": "^1.6.0"
36
188
  }
37
189
  }