@h-rig/core 0.0.6-alpha.157 → 0.0.6-alpha.159

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 (89) 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/{task-io.js → capability-loaders.js} +237 -195
  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 +1 -1
  19. package/dist/src/config.js +7 -4
  20. package/dist/src/declarative-config.d.ts +14 -0
  21. package/dist/src/declarative-config.js +82 -0
  22. package/dist/src/define-config.d.ts +2 -1
  23. package/dist/src/define-config.js +7 -4
  24. package/dist/src/embedded-plugins.d.ts +59 -0
  25. package/dist/src/embedded-plugins.js +22 -0
  26. package/dist/src/exec.d.ts +13 -0
  27. package/dist/src/exec.js +101 -0
  28. package/dist/src/harness-paths.d.ts +18 -0
  29. package/dist/src/harness-paths.js +141 -0
  30. package/dist/src/hook-materializer.d.ts +72 -0
  31. package/dist/src/hook-materializer.js +274 -0
  32. package/dist/src/hook-runner.d.ts +48 -0
  33. package/dist/src/hook-runner.js +752 -0
  34. package/dist/src/hook-runtime.d.ts +11 -0
  35. package/dist/src/hook-runtime.js +307 -0
  36. package/dist/src/index.d.ts +3 -1
  37. package/dist/src/index.js +119 -5
  38. package/dist/src/json-files.d.ts +9 -0
  39. package/dist/src/json-files.js +125 -0
  40. package/dist/src/kernel-entrypoint.d.ts +22 -0
  41. package/dist/src/kernel-entrypoint.js +537 -0
  42. package/dist/src/layout.d.ts +10 -0
  43. package/dist/src/layout.js +144 -0
  44. package/dist/src/load-config.js +149 -50
  45. package/dist/src/placement.d.ts +50 -0
  46. package/dist/src/placement.js +996 -0
  47. package/dist/src/plugin-host-context.d.ts +66 -0
  48. package/dist/src/plugin-host-context.js +1270 -0
  49. package/dist/src/plugin-host-registries.d.ts +31 -0
  50. package/dist/src/plugin-host-registries.js +79 -0
  51. package/dist/src/plugin-host.d.ts +6 -1
  52. package/dist/src/plugin-host.js +51 -0
  53. package/dist/src/plugin-runtime.d.ts +45 -6
  54. package/dist/src/profile-ops.d.ts +9 -0
  55. package/dist/src/profile-ops.js +252 -0
  56. package/dist/src/project-plugins.d.ts +9 -12
  57. package/dist/src/project-plugins.js +248 -61
  58. package/dist/src/remote-config.d.ts +183 -0
  59. package/dist/src/remote-config.js +574 -0
  60. package/dist/src/root-resolver.d.ts +5 -0
  61. package/dist/src/root-resolver.js +69 -0
  62. package/dist/src/run-provisioning.d.ts +58 -0
  63. package/dist/src/run-provisioning.js +128 -0
  64. package/dist/src/runtime-context.d.ts +20 -0
  65. package/dist/src/runtime-context.js +257 -0
  66. package/dist/src/runtime-events.d.ts +44 -0
  67. package/dist/src/runtime-events.js +212 -0
  68. package/dist/src/runtime-overlay.d.ts +11 -0
  69. package/dist/src/runtime-overlay.js +71 -0
  70. package/dist/src/runtime-paths.d.ts +21 -0
  71. package/dist/src/runtime-paths.js +181 -0
  72. package/dist/src/runtime-provisioning-env.d.ts +5 -0
  73. package/dist/src/runtime-provisioning-env.js +217 -0
  74. package/dist/src/runtime-runner-context.d.ts +12 -0
  75. package/dist/src/runtime-runner-context.js +1 -0
  76. package/dist/src/safe-identifiers.d.ts +44 -0
  77. package/dist/src/safe-identifiers.js +96 -0
  78. package/dist/src/scope-rules.d.ts +4 -0
  79. package/dist/src/scope-rules.js +21 -0
  80. package/dist/src/server-paths.d.ts +26 -0
  81. package/dist/src/server-paths.js +308 -0
  82. package/dist/src/setup-version.d.ts +3 -0
  83. package/dist/src/setup-version.js +14 -0
  84. package/dist/src/task-record-reader.d.ts +3 -0
  85. package/dist/src/task-record-reader.js +9 -0
  86. package/dist/src/validator-registry.d.ts +27 -0
  87. package/dist/src/validator-registry.js +64 -0
  88. package/package.json +136 -6
  89. package/dist/src/task-io.d.ts +0 -54
@@ -1,20 +1,23 @@
1
1
  // @bun
2
2
  // packages/core/src/load-config.ts
3
- import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync } from "fs";
3
+ import { existsSync as existsSync2, mkdirSync, mkdtempSync, readFileSync as readFileSync2, readdirSync, rmSync, statSync } from "fs";
4
4
  import { isBuiltin } from "module";
5
- import { dirname, isAbsolute, join, relative, resolve } from "path";
5
+ import { dirname, isAbsolute, join as join2, relative, resolve } from "path";
6
6
  import { pathToFileURL } from "url";
7
- import { Schema as Schema2 } from "effect";
8
- import { RigConfig as RigConfig2 } from "@rig/contracts";
7
+ import { Schema as Schema3 } from "effect";
8
+ import { RigConfig as RigConfig3 } from "@rig/contracts";
9
9
 
10
10
  // packages/core/src/define-config.ts
11
11
  import { Schema } from "effect";
12
12
  import { RigConfig } from "@rig/contracts";
13
13
  function normalizeWorkspaceConfig(raw) {
14
- const workspace = raw && typeof raw === "object" && !Array.isArray(raw) ? { ...raw } : { mainRepo: "." };
15
- workspace.checkout = workspace.checkout ?? workspace.isolation ?? "worktree";
16
- workspace.isolation = workspace.isolation ?? workspace.checkout;
17
- workspace.sandbox = workspace.sandbox ?? "enforce";
14
+ const workspace = raw && typeof raw === "object" && !Array.isArray(raw) ? { ...raw } : {};
15
+ if (workspace.mainRepo === undefined)
16
+ workspace.mainRepo = ".";
17
+ if (workspace.checkout === undefined && workspace.isolation !== undefined)
18
+ workspace.checkout = workspace.isolation;
19
+ if (workspace.isolation === undefined && workspace.checkout !== undefined)
20
+ workspace.isolation = workspace.checkout;
18
21
  return workspace;
19
22
  }
20
23
  function applyConfigDefaults(raw) {
@@ -28,6 +31,64 @@ function applyConfigDefaults(raw) {
28
31
  };
29
32
  }
30
33
 
34
+ // packages/core/src/declarative-config.ts
35
+ import { existsSync, readFileSync } from "fs";
36
+ import { join } from "path";
37
+ import { parse as parseToml } from "smol-toml";
38
+ import { Schema as Schema2 } from "effect";
39
+ import { RigConfig as RigConfig2 } from "@rig/contracts";
40
+
41
+ // packages/core/src/embedded-plugins.ts
42
+ var registered = null;
43
+ function getStandardPluginsResolver() {
44
+ return registered;
45
+ }
46
+ var bakedProjectConfig = null;
47
+ function getEmbeddedProjectConfig() {
48
+ return bakedProjectConfig;
49
+ }
50
+
51
+ // packages/core/src/declarative-config.ts
52
+ var DECLARATIVE_CONFIG_NAMES = ["rigfig.toml", "rigfig.json"];
53
+ function findDeclarativeConfigPath(cwd) {
54
+ const dir = join(cwd, ".rig");
55
+ for (const name of DECLARATIVE_CONFIG_NAMES) {
56
+ const candidate = join(dir, name);
57
+ if (existsSync(candidate))
58
+ return candidate;
59
+ }
60
+ return null;
61
+ }
62
+ function parseDeclarativeFile(path) {
63
+ const raw = readFileSync(path, "utf8");
64
+ const parsed = path.endsWith(".json") ? JSON.parse(raw) : parseToml(raw);
65
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
66
+ throw new Error(`Declarative config ${path} must parse to an object.`);
67
+ }
68
+ return parsed;
69
+ }
70
+ function loadDeclarativeConfig(path) {
71
+ const data = parseDeclarativeFile(path);
72
+ const standardSection = data.standard && typeof data.standard === "object" && !Array.isArray(data.standard) ? data.standard : {};
73
+ const useStandard = standardSection.enabled !== false;
74
+ let plugins = [];
75
+ if (useStandard) {
76
+ const resolver = getStandardPluginsResolver();
77
+ if (!resolver) {
78
+ throw new Error(`Declarative config ${path} needs the embedded standard plugins, but none were registered. ` + `This is a seed/boot wiring error (the binary entrypoint must import the standard-plugin registration).`);
79
+ }
80
+ plugins = resolver(data);
81
+ }
82
+ const { standard: _standardDirective, ...configFields } = data;
83
+ const withDefaults = applyConfigDefaults({ ...configFields, plugins });
84
+ const explicitPlugins = Array.isArray(withDefaults.plugins) ? [...withDefaults.plugins] : [];
85
+ const decoded = Schema2.decodeUnknownSync(RigConfig2)({
86
+ ...withDefaults,
87
+ plugins: explicitPlugins
88
+ });
89
+ return { ...decoded, plugins: explicitPlugins };
90
+ }
91
+
31
92
  // packages/core/src/load-config.ts
32
93
  var TS_NAMES = ["rig.config.ts", "rig.config.mts"];
33
94
  var JSON_NAMES = ["rig.config.json"];
@@ -89,18 +150,18 @@ function exportTargetFromPackageJson(pkg, subpath) {
89
150
  return subpath === "." && typeof pkg.module === "string" ? pkg.module : subpath === "." && typeof pkg.main === "string" ? pkg.main : null;
90
151
  }
91
152
  function resolvePackageDirFromBunStore(packageName, nodeModulesDir) {
92
- const storeDir = join(nodeModulesDir, ".bun");
93
- if (!existsSync(storeDir))
153
+ const storeDir = join2(nodeModulesDir, ".bun");
154
+ if (!existsSync2(storeDir))
94
155
  return null;
95
156
  const encoded = packageName.replace("/", "+");
96
157
  try {
97
158
  const candidates = readdirSync(storeDir).filter((entry) => entry.startsWith(`${encoded}@`)).map((entry) => {
98
- const candidateDir = join(storeDir, entry, "node_modules", packageName);
99
- const packageJsonPath = join(candidateDir, "package.json");
100
- if (!existsSync(packageJsonPath))
159
+ const candidateDir = join2(storeDir, entry, "node_modules", packageName);
160
+ const packageJsonPath = join2(candidateDir, "package.json");
161
+ if (!existsSync2(packageJsonPath))
101
162
  return null;
102
163
  try {
103
- const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8"));
164
+ const pkg = JSON.parse(readFileSync2(packageJsonPath, "utf8"));
104
165
  return {
105
166
  dir: candidateDir,
106
167
  sortKey: pkg.version?.trim() || entry
@@ -118,30 +179,30 @@ function resolvePackageDirFromBunStore(packageName, nodeModulesDir) {
118
179
  }
119
180
  }
120
181
  function resolveDirectoryModulePath(directoryPath) {
121
- const packageJsonPath = join(directoryPath, "package.json");
122
- if (existsSync(packageJsonPath)) {
182
+ const packageJsonPath = join2(directoryPath, "package.json");
183
+ if (existsSync2(packageJsonPath)) {
123
184
  try {
124
- const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8"));
185
+ const pkg = JSON.parse(readFileSync2(packageJsonPath, "utf8"));
125
186
  const target = exportTargetFromPackageJson(pkg, ".");
126
187
  if (target) {
127
- const resolved = resolveModulePath(join(directoryPath, target));
188
+ const resolved = resolveModulePath(join2(directoryPath, target));
128
189
  if (resolved)
129
190
  return resolved;
130
191
  }
131
192
  } catch {}
132
193
  }
133
194
  for (const candidate of ["index.js", "index.mjs", "index.cjs", "index.ts", "index.json"]) {
134
- const resolved = resolveModulePath(join(directoryPath, candidate));
195
+ const resolved = resolveModulePath(join2(directoryPath, candidate));
135
196
  if (resolved)
136
197
  return resolved;
137
198
  }
138
199
  return null;
139
200
  }
140
201
  function resolveModulePath(candidatePath) {
141
- if (!existsSync(candidatePath)) {
202
+ if (!existsSync2(candidatePath)) {
142
203
  for (const extension of [".ts", ".mts", ".tsx", ".js", ".mjs", ".cjs", ".json"]) {
143
204
  const withExtension = `${candidatePath}${extension}`;
144
- if (existsSync(withExtension))
205
+ if (existsSync2(withExtension))
145
206
  return resolveModulePath(withExtension);
146
207
  }
147
208
  return null;
@@ -158,13 +219,13 @@ function resolveModulePath(candidatePath) {
158
219
  return null;
159
220
  }
160
221
  function resolvePackageExportFromDir(packageDir, subpath) {
161
- const packageJsonPath = join(packageDir, "package.json");
162
- if (existsSync(packageJsonPath)) {
222
+ const packageJsonPath = join2(packageDir, "package.json");
223
+ if (existsSync2(packageJsonPath)) {
163
224
  try {
164
- const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8"));
225
+ const pkg = JSON.parse(readFileSync2(packageJsonPath, "utf8"));
165
226
  const target = exportTargetFromPackageJson(pkg, subpath);
166
227
  if (target) {
167
- const resolved = resolveModulePath(join(packageDir, target));
228
+ const resolved = resolveModulePath(join2(packageDir, target));
168
229
  if (resolved)
169
230
  return resolved;
170
231
  }
@@ -175,12 +236,12 @@ function resolvePackageExportFromDir(packageDir, subpath) {
175
236
  if (subpath !== ".") {
176
237
  const legacySubpath = subpath.replace(/^\.\//, "");
177
238
  for (const candidate of [
178
- join(packageDir, legacySubpath),
179
- join(packageDir, `${legacySubpath}.js`),
180
- join(packageDir, `${legacySubpath}.mjs`),
181
- join(packageDir, `${legacySubpath}.cjs`),
182
- join(packageDir, `${legacySubpath}.ts`),
183
- join(packageDir, `${legacySubpath}.json`)
239
+ join2(packageDir, legacySubpath),
240
+ join2(packageDir, `${legacySubpath}.js`),
241
+ join2(packageDir, `${legacySubpath}.mjs`),
242
+ join2(packageDir, `${legacySubpath}.cjs`),
243
+ join2(packageDir, `${legacySubpath}.ts`),
244
+ join2(packageDir, `${legacySubpath}.json`)
184
245
  ]) {
185
246
  const resolved = resolveModulePath(candidate);
186
247
  if (resolved)
@@ -215,32 +276,62 @@ function resolveProjectPackageImport(specifier, configDir) {
215
276
  const parsed = packageNameAndSubpath(specifier);
216
277
  if (!parsed)
217
278
  return null;
218
- const nodeModulesDir = join(configDir, "node_modules");
219
- const directPackageDir = join(nodeModulesDir, parsed.packageName);
220
- const packageDir = existsSync(join(directPackageDir, "package.json")) ? directPackageDir : resolvePackageDirFromBunStore(parsed.packageName, nodeModulesDir);
279
+ const nodeModulesDir = join2(configDir, "node_modules");
280
+ const directPackageDir = join2(nodeModulesDir, parsed.packageName);
281
+ const packageDir = existsSync2(join2(directPackageDir, "package.json")) ? directPackageDir : resolvePackageDirFromBunStore(parsed.packageName, nodeModulesDir);
221
282
  return packageDir ? resolvePackageExportFromDir(packageDir, parsed.subpath) : null;
222
283
  }
284
+ function canImportRigWorkspacePackagesDirectly(source, configDir) {
285
+ const packageNames = new Set;
286
+ for (const match of source.matchAll(/(?:from\s*|import\s*\(\s*|import\s*)["'](@rig\/[^"']+)["']/g)) {
287
+ const parsed = packageNameAndSubpath(match[1] ?? "");
288
+ if (parsed?.packageName)
289
+ packageNames.add(parsed.packageName);
290
+ }
291
+ if (packageNames.size === 0)
292
+ return false;
293
+ for (const packageName of packageNames) {
294
+ const shortName = packageName.replace(/^@rig\//, "");
295
+ const manifestPath = join2(configDir, "packages", shortName, "package.json");
296
+ if (!existsSync2(manifestPath))
297
+ return false;
298
+ try {
299
+ const parsed = JSON.parse(readFileSync2(manifestPath, "utf8"));
300
+ if (parsed.name !== packageName)
301
+ return false;
302
+ } catch {
303
+ return false;
304
+ }
305
+ }
306
+ return true;
307
+ }
223
308
  async function importConfigViaRuntimeBundleUnserialized(configPath) {
224
309
  const bun = globalThis.Bun;
225
310
  if (!bun?.build) {
226
311
  throw new Error(`Failed to import ${configPath}: bare imports could not be resolved and no Bun.build runtime bundler is available.`);
227
312
  }
228
- const RUNTIME_ONLY_EXTERNAL_PACKAGES = new Set(["mupdf", "fastembed", "onnxruntime-node", "markit-ai"]);
313
+ const RUNTIME_ONLY_EXTERNAL_PACKAGES = new Set(["effect", "mupdf", "fastembed", "onnxruntime-node", "markit-ai"]);
229
314
  const configDir = dirname(configPath);
230
315
  const UNRESOLVED_NAMESPACE = "rig-config-unresolved";
231
316
  const unresolvedLocalPlugin = {
232
317
  name: "rig-config-unresolved-local",
233
318
  setup(build) {
319
+ build.onLoad({ filter: /\.(?:html|txt)$/ }, (args) => ({
320
+ loader: "js",
321
+ contents: `export default ${JSON.stringify(readFileSync2(args.path, "utf8"))};
322
+ `
323
+ }));
234
324
  build.onResolve({ filter: /.*/ }, (args) => {
235
325
  const directFilePath = resolvedFilePath(args.path, configDir);
236
326
  if (directFilePath)
237
327
  return { path: directFilePath };
238
328
  const packageImport = packageNameAndSubpath(args.path);
239
- if (packageImport && RUNTIME_ONLY_EXTERNAL_PACKAGES.has(packageImport.packageName))
329
+ if (packageImport && (packageImport.packageName.startsWith("@rig/") || RUNTIME_ONLY_EXTERNAL_PACKAGES.has(packageImport.packageName))) {
240
330
  return { path: args.path, external: true };
331
+ }
241
332
  const projectPackagePath = resolveProjectPackageImport(args.path, configDir);
242
333
  if (projectPackagePath)
243
- return packageImport?.packageName.startsWith("@oh-my-pi/") ? { path: projectPackagePath, external: true } : { path: projectPackagePath };
334
+ return { path: projectPackagePath };
244
335
  if (/^(?:node|bun):/.test(args.path) || isBuiltin(args.path))
245
336
  return;
246
337
  if (packageImport)
@@ -271,7 +362,7 @@ throw new Error(${JSON.stringify(`Failed to bundle ${configPath}: Could not reso
271
362
  const result = await bun.build({
272
363
  entrypoints: [configPath],
273
364
  target: "bun",
274
- external: ["mupdf", "fastembed", "onnxruntime-node", "markit-ai"],
365
+ external: ["effect", "mupdf", "fastembed", "onnxruntime-node", "markit-ai"],
275
366
  format: "esm",
276
367
  throw: false,
277
368
  packages: "bundle",
@@ -282,11 +373,11 @@ throw new Error(${JSON.stringify(`Failed to bundle ${configPath}: Could not reso
282
373
  `);
283
374
  throw new Error(`Failed to bundle ${configPath}: ${detail || "unknown bundler error"}`);
284
375
  }
285
- const bundleParentDir = join(configDir, ".rig", "tmp");
376
+ const bundleParentDir = join2(configDir, ".rig", "tmp");
286
377
  mkdirSync(bundleParentDir, { recursive: true });
287
- const dir = mkdtempSync(join(bundleParentDir, "rig-config-bundle-"));
378
+ const dir = mkdtempSync(join2(bundleParentDir, "rig-config-bundle-"));
288
379
  try {
289
- const bundledPath = join(dir, "rig.config.bundled.js");
380
+ const bundledPath = join2(dir, "rig.config.bundled.js");
290
381
  await bun.write(bundledPath, await result.outputs[0].text());
291
382
  return await import(pathToFileURL(bundledPath).href);
292
383
  } finally {
@@ -296,16 +387,20 @@ throw new Error(${JSON.stringify(`Failed to bundle ${configPath}: Could not reso
296
387
  }
297
388
  }
298
389
  async function loadConfig(cwd) {
390
+ const baked = getEmbeddedProjectConfig();
391
+ if (baked && resolve(baked.projectRoot) === resolve(cwd)) {
392
+ return decodeExplicitPluginConfig(baked.raw);
393
+ }
299
394
  for (const name of TS_NAMES) {
300
- const p = join(cwd, name);
301
- if (existsSync(p)) {
395
+ const p = join2(cwd, name);
396
+ if (existsSync2(p)) {
302
397
  const mod = await enqueueRuntimeBundle(async () => {
303
398
  if (runningFromCompiledBinary()) {
304
399
  return importConfigViaRuntimeBundleUnserialized(p);
305
400
  }
306
- const source = readFileSync(p, "utf8");
401
+ const source = readFileSync2(p, "utf8");
307
402
  const importsRigHostPackages = /(?:import\s+[^;]*?from\s*|import\s*\()\s*["']@rig\//.test(source);
308
- if (importsRigHostPackages) {
403
+ if (importsRigHostPackages && !canImportRigWorkspacePackagesDirectly(source, cwd)) {
309
404
  return importConfigViaRuntimeBundleUnserialized(p);
310
405
  }
311
406
  try {
@@ -320,19 +415,23 @@ async function loadConfig(cwd) {
320
415
  return decodeExplicitPluginConfig(raw);
321
416
  }
322
417
  }
418
+ const declarativePath = findDeclarativeConfigPath(cwd);
419
+ if (declarativePath) {
420
+ return loadDeclarativeConfig(declarativePath);
421
+ }
323
422
  for (const name of JSON_NAMES) {
324
- const p = join(cwd, name);
325
- if (existsSync(p)) {
326
- const raw = JSON.parse(readFileSync(p, "utf-8"));
423
+ const p = join2(cwd, name);
424
+ if (existsSync2(p)) {
425
+ const raw = JSON.parse(readFileSync2(p, "utf-8"));
327
426
  return decodeExplicitPluginConfig(raw);
328
427
  }
329
428
  }
330
- throw new Error(`no rig.config.{ts,mts,json} found in ${cwd}`);
429
+ throw new Error(`no rig.config.{ts,mts,json} or .rig/rigfig.{toml,json} found in ${cwd}`);
331
430
  }
332
431
  function decodeExplicitPluginConfig(raw) {
333
432
  const withDefaults = applyConfigDefaults(raw);
334
433
  const explicitPlugins = Array.isArray(withDefaults.plugins) ? [...withDefaults.plugins] : [];
335
- const decoded = Schema2.decodeUnknownSync(RigConfig2)({
434
+ const decoded = Schema3.decodeUnknownSync(RigConfig3)({
336
435
  ...withDefaults,
337
436
  plugins: explicitPlugins
338
437
  });
@@ -0,0 +1,50 @@
1
+ export type PlacementKind = "local" | "remote";
2
+ export type Placement = {
3
+ readonly alias: string;
4
+ readonly kind: PlacementKind;
5
+ readonly host?: string | null;
6
+ readonly port?: number | null;
7
+ readonly baseUrl?: string | null;
8
+ readonly projectRoot?: string | null;
9
+ readonly status?: string | null;
10
+ readonly taskSource?: string | null;
11
+ };
12
+ export type RepoConnectionState = {
13
+ selected: string;
14
+ project?: string;
15
+ linkedAt?: string;
16
+ serverProjectRoot?: string;
17
+ serverProjectRootAlias?: string;
18
+ serverProjectRootBaseUrl?: string;
19
+ };
20
+ export type AddPlacementInput = {
21
+ readonly alias: string;
22
+ readonly host: string;
23
+ readonly port?: number;
24
+ readonly token?: string | null;
25
+ readonly select?: boolean;
26
+ };
27
+ export declare function resolveRepoConnectionPath(projectRoot: string): string;
28
+ export declare function readSelection(projectRoot: string): RepoConnectionState | null;
29
+ export declare const readRepoConnection: typeof readSelection;
30
+ export declare function writeSelection(projectRoot: string, state: RepoConnectionState): void;
31
+ export declare const writeRepoConnection: typeof writeSelection;
32
+ export declare function readPlacement(projectRoot: string, env?: NodeJS.ProcessEnv): Promise<Placement>;
33
+ export declare const readSelectedTarget: typeof readPlacement;
34
+ export declare function listPlacements(projectRoot: string): Placement[];
35
+ export declare const listServerTargets: typeof listPlacements;
36
+ export declare function selectPlacement(projectRoot: string, alias: string, options?: {
37
+ dryRun?: boolean;
38
+ }): Placement;
39
+ export declare const selectServerTarget: typeof selectPlacement;
40
+ export declare function addPlacement(projectRoot: string, input: AddPlacementInput, options?: {
41
+ dryRun?: boolean;
42
+ }): Placement;
43
+ export declare const addRemoteTarget: typeof addPlacement;
44
+ export declare function removePlacement(projectRoot: string, alias: string, options?: {
45
+ dryRun?: boolean;
46
+ }): {
47
+ readonly alias: string;
48
+ readonly removed: boolean;
49
+ };
50
+ export declare const removeServerTarget: typeof removePlacement;