@h-rig/core 0.0.6-alpha.17 → 0.0.6-alpha.170

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 (107) 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 +6 -0
  6. package/dist/src/baked-secrets.js +121 -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 +758 -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 +82 -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 +18 -0
  33. package/dist/src/harness-paths.js +141 -0
  34. package/dist/src/hook-materializer.d.ts +72 -0
  35. package/dist/src/hook-materializer.js +281 -0
  36. package/dist/src/hook-protocol.d.ts +2 -0
  37. package/dist/src/hook-protocol.js +462 -0
  38. package/dist/src/hook-runner.d.ts +48 -0
  39. package/dist/src/hook-runner.js +756 -0
  40. package/dist/src/hook-runtime.d.ts +52 -0
  41. package/dist/src/hook-runtime.js +462 -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 +125 -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 +548 -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 +144 -0
  56. package/dist/src/load-config.d.ts +2 -0
  57. package/dist/src/load-config.js +423 -30
  58. package/dist/src/placement.d.ts +50 -0
  59. package/dist/src/placement.js +996 -0
  60. package/dist/src/plugin-host-context.d.ts +66 -0
  61. package/dist/src/plugin-host-context.js +1292 -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/profile-ops.d.ts +9 -0
  68. package/dist/src/profile-ops.js +252 -0
  69. package/dist/src/project-plugins.d.ts +63 -0
  70. package/dist/src/project-plugins.js +793 -0
  71. package/dist/src/remote-config.d.ts +183 -0
  72. package/dist/src/remote-config.js +574 -0
  73. package/dist/src/root-resolver.d.ts +5 -0
  74. package/dist/src/root-resolver.js +69 -0
  75. package/dist/src/run-provisioning.d.ts +58 -0
  76. package/dist/src/run-provisioning.js +128 -0
  77. package/dist/src/runtime-context.d.ts +20 -0
  78. package/dist/src/runtime-context.js +257 -0
  79. package/dist/src/runtime-events.d.ts +44 -0
  80. package/dist/src/runtime-events.js +212 -0
  81. package/dist/src/runtime-overlay.d.ts +11 -0
  82. package/dist/src/runtime-overlay.js +71 -0
  83. package/dist/src/runtime-paths.d.ts +21 -0
  84. package/dist/src/runtime-paths.js +181 -0
  85. package/dist/src/runtime-provisioning-env.d.ts +5 -0
  86. package/dist/src/runtime-provisioning-env.js +217 -0
  87. package/dist/src/runtime-runner-context.d.ts +12 -0
  88. package/dist/src/runtime-runner-context.js +1 -0
  89. package/dist/src/safe-identifiers.d.ts +44 -0
  90. package/dist/src/safe-identifiers.js +96 -0
  91. package/dist/src/scope-rules.d.ts +4 -0
  92. package/dist/src/scope-rules.js +21 -0
  93. package/dist/src/server-paths.d.ts +26 -0
  94. package/dist/src/server-paths.js +308 -0
  95. package/dist/src/setup-version.d.ts +3 -0
  96. package/dist/src/setup-version.js +14 -0
  97. package/dist/src/task-record-reader.d.ts +3 -0
  98. package/dist/src/task-record-reader.js +9 -0
  99. package/dist/src/validator-registry.d.ts +27 -0
  100. package/dist/src/validator-registry.js +64 -0
  101. package/package.json +166 -10
  102. package/dist/src/engineReadModelReducer.js +0 -1780
  103. package/dist/src/rig-init-builder.js +0 -57
  104. package/dist/src/rigSelectors.js +0 -293
  105. package/dist/src/taskGraph.js +0 -64
  106. package/dist/src/taskGraphCodes.js +0 -26
  107. package/dist/src/taskGraphLayout.js +0 -374
@@ -0,0 +1,183 @@
1
+ export declare const DEFAULT_REMOTE_PORT = 7890;
2
+ /**
3
+ * Register the transport-owned relay/registry/sshTarget defaults. Called at the
4
+ * transport plugin module's load (plugin → floor). The floor keeps NO product
5
+ * host string or remote-execution target of its own; this is the only way the
6
+ * runtime fallback acquires those defaults. Idempotent and last-write-wins;
7
+ * absent/empty values are ignored so a second caller cannot clear a prior
8
+ * registration.
9
+ */
10
+ export declare function registerBackboneDefaults(defaults: {
11
+ relayUrl?: string;
12
+ registryBaseUrl?: string;
13
+ sshTarget?: string;
14
+ }): void;
15
+ /**
16
+ * The collab relay URL: rig.config.ts (propagated to RIG_COLLAB_RELAY by the CLI)
17
+ * → env → the transport plugin's injected default (see registerBackboneDefaults)
18
+ * → "" (the floor bakes no product host).
19
+ */
20
+ export declare function resolveRelayUrl(env?: NodeJS.ProcessEnv): string;
21
+ /**
22
+ * The remote execution sshTarget: rig.config.ts `runtime.server.sshTarget`
23
+ * (propagated to RIG_SSH_TARGET by the CLI) → env → the transport plugin's
24
+ * injected default (see registerBackboneDefaults) → "" (the floor bakes no
25
+ * product remote target). This is a SEPARATE axis from the backbone server:
26
+ * picking a backbone never changes where runs execute, and vice versa.
27
+ */
28
+ export declare function resolveSshTarget(env?: NodeJS.ProcessEnv): string;
29
+ export declare const REMOTES_CONFIG_PATH: string;
30
+ type JsonRecord = Record<string, unknown>;
31
+ export declare class RemoteCliError extends Error {
32
+ readonly code: string;
33
+ readonly exitCode: number;
34
+ readonly details: JsonRecord | undefined;
35
+ constructor(code: string, message: string, exitCode?: number, details?: JsonRecord);
36
+ }
37
+ export type RemoteConfigEntry = {
38
+ host?: string;
39
+ port?: number;
40
+ token?: string;
41
+ addedAt?: string;
42
+ lastConnected?: string;
43
+ };
44
+ export type RemotesToml = {
45
+ version?: number;
46
+ remotes?: Record<string, RemoteConfigEntry>;
47
+ };
48
+ export type AuthorityRemoteEndpointRecord = {
49
+ id: string;
50
+ alias: string;
51
+ host: string;
52
+ port: number;
53
+ transport: string;
54
+ auto_connect: boolean;
55
+ labels: string[];
56
+ capabilities: string[];
57
+ secret_ref: string;
58
+ created_at: string;
59
+ updated_at: string;
60
+ last_connected_at?: string | null;
61
+ };
62
+ export type AuthorityRemoteEndpointsToml = {
63
+ version?: number;
64
+ endpoints?: Record<string, AuthorityRemoteEndpointRecord>;
65
+ };
66
+ export type AuthorityRemoteSecretsToml = {
67
+ version?: number;
68
+ secrets?: Record<string, string>;
69
+ };
70
+ export type AuthorityMaterializedRemoteEndpoint = {
71
+ id: string;
72
+ alias: string;
73
+ host: string;
74
+ port: number;
75
+ token: string;
76
+ autoConnect: boolean;
77
+ addedAt: string;
78
+ updatedAt: string;
79
+ lastConnectedAt: string | null;
80
+ labels: string[];
81
+ capabilities: string[];
82
+ transport: string;
83
+ secretRef: string;
84
+ };
85
+ export type ManagedRemoteEndpoint = {
86
+ id: string;
87
+ alias: string;
88
+ host: string;
89
+ port: number;
90
+ token: string;
91
+ addedAt: string | null;
92
+ lastConnected: string | null;
93
+ };
94
+ export declare function loadRemotesConfig(configPath?: string): RemotesToml;
95
+ /**
96
+ * GitHub owner namespace key that scopes the relay registry. The run (which
97
+ * registers a room) and the cockpit (which lists rooms) MUST derive the SAME
98
+ * value or `list` returns empty. Order: env override → github-auth.userNamespaceKey
99
+ * → derived `gh:${userId}`.
100
+ */
101
+ export declare function resolveOwnerNamespaceKey(projectRoot: string, env?: NodeJS.ProcessEnv): string | undefined;
102
+ export type SelectedRemote = {
103
+ alias: string;
104
+ host: string;
105
+ port: number;
106
+ sshTarget: string;
107
+ checkout: string | null;
108
+ registryBaseUrl: string | null;
109
+ secretRef: string | null;
110
+ };
111
+ export type DispatchTransportPlacement = {
112
+ readonly kind: "local";
113
+ readonly alias: "local";
114
+ readonly sshTarget: null;
115
+ readonly selected: null;
116
+ } | {
117
+ readonly kind: "remote";
118
+ readonly alias: string;
119
+ readonly sshTarget: string;
120
+ readonly selected: SelectedRemote | null;
121
+ };
122
+ /**
123
+ * Canonical dispatch-time transport placement. Kernel adoption can happen before
124
+ * a CLI has resolved projectRoot or hydrated env, so transport providers call
125
+ * this at dispatch time instead of letting command/capability callers branch.
126
+ */
127
+ export declare function resolveDispatchTransportPlacement(projectRoot: string, env?: NodeJS.ProcessEnv): DispatchTransportPlacement;
128
+ /**
129
+ * Selected remote placement from connection.json.selected matched against
130
+ * endpoints.toml.alias. Returns null => LOCAL placement. RIG_REMOTE_ALIAS overrides
131
+ * the persisted selection.
132
+ */
133
+ export declare function resolveSelectedRemote(projectRoot: string, env?: NodeJS.ProcessEnv): SelectedRemote | null;
134
+ /**
135
+ * Registry base URL for the selected target (remote), else the transport plugin's
136
+ * injected backbone default (see registerBackboneDefaults), else "" — the floor
137
+ * bakes no product host.
138
+ */
139
+ export declare function resolveRegistryBaseUrl(projectRoot: string, env?: NodeJS.ProcessEnv): string;
140
+ /**
141
+ * The OMP `--config` overlay, DERIVED from rig.config.ts-propagated values
142
+ * (relay/registry via the resolvers above: ambient env → rig.config.ts-filled env →
143
+ * computed default) plus cockpit-quiet. Written to a real temp file so OMP's
144
+ * `--config` gets a normal path; memoized per process. Single source for BOTH the
145
+ * CLI launch and the in-pty agent session (rig-host), so rig.config.ts values
146
+ * propagate identically — no checked-in/embedded YAML, so the binary is self-contained.
147
+ */
148
+ export declare function resolveRigOmpConfigOverlayPath(projectRoot?: string): string;
149
+ export declare function listAuthorityRemoteEndpoints(projectRoot: string): AuthorityMaterializedRemoteEndpoint[];
150
+ export declare function updateAuthorityRemoteEndpoint(projectRoot: string, input: {
151
+ endpointId?: string | undefined;
152
+ alias?: string | undefined;
153
+ host?: string | undefined;
154
+ port?: number | undefined;
155
+ token?: string | undefined;
156
+ autoConnect?: boolean | undefined;
157
+ transport?: string | undefined;
158
+ labels?: string[] | undefined;
159
+ capabilities?: string[] | undefined;
160
+ }): AuthorityMaterializedRemoteEndpoint | null;
161
+ export declare function markAuthorityRemoteEndpointConnected(projectRoot: string, endpointId: string, connectedAt?: string): void;
162
+ export declare function importLegacyRemoteEndpoints(projectRoot: string, legacyPath?: string): {
163
+ imported: number;
164
+ skipped: number;
165
+ sourcePath: string;
166
+ };
167
+ export declare function doctorAuthorityRemoteEndpoints(projectRoot: string): {
168
+ manifestPath: string;
169
+ secretsPath: string;
170
+ endpointCount: number;
171
+ missingSecrets: string[];
172
+ warnings: string[];
173
+ };
174
+ export declare function listManagedRemoteEndpoints(configPath?: string, projectRoot?: string): ManagedRemoteEndpoint[];
175
+ export declare function upsertManagedRemoteEndpoint(input: {
176
+ alias: string;
177
+ host: string;
178
+ port: number;
179
+ token?: string;
180
+ }, configPath?: string, projectRoot?: string): ManagedRemoteEndpoint;
181
+ export declare function removeManagedRemoteEndpoint(alias: string, configPath?: string, projectRoot?: string): boolean;
182
+ export declare function normalizeString(value: string | null | undefined): string;
183
+ export {};