@rendotdev/rig 0.0.18 → 0.0.19

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 (28) hide show
  1. package/dist/{cli-yahk2r84.js → cli-113n7c3t.js} +2 -2
  2. package/dist/{cli-vkw9rcke.js → cli-13q90bjr.js} +6 -0
  3. package/dist/{cli-ggk7t6dg.js → cli-1hm5dxfw.js} +2 -2
  4. package/dist/{cli-f4k31gtc.js → cli-884hpkjc.js} +1 -1
  5. package/dist/{cli-0p4wnh3p.js → cli-es8j6mma.js} +3 -3
  6. package/dist/{cli-c6y9p8v9.js → cli-f7p31fzm.js} +3 -3
  7. package/dist/{cli-jbscjyqq.js → cli-nk194xv0.js} +109 -10
  8. package/dist/{cli-96n231pn.js → cli-zgw1jbeg.js} +3 -3
  9. package/dist/{config-8mr59m0q.js → config-20f90shh.js} +2 -2
  10. package/dist/{create-9frp1c7g.js → create-pvym2abv.js} +4 -4
  11. package/dist/cron-aw908dzn.js +18 -0
  12. package/dist/{dev-link-x3hjyy3j.js → dev-link-e1mj8w17.js} +1 -1
  13. package/dist/{discover-9n7b9ra2.js → discover-95bpzy46.js} +3 -3
  14. package/dist/{help-17a9ywd9.js → help-qj75r0x3.js} +5 -5
  15. package/dist/{inspect-k2g3dt1g.js → inspect-0ckw7bs5.js} +5 -5
  16. package/dist/list-reekhy3q.js +13 -0
  17. package/dist/{paths-cxq6fvhp.js → paths-3vxw7dek.js} +1 -1
  18. package/dist/{registry-e68a7b4v.js → registry-fzc3aeb8.js} +2 -2
  19. package/dist/rig.js +63 -40
  20. package/dist/run-thx15p83.js +13 -0
  21. package/dist/{runtime-comment-3yq1pmaf.js → runtime-comment-07cpchsr.js} +3 -3
  22. package/dist/{sync-3362wne1.js → sync-kkqh3axx.js} +6 -6
  23. package/dist/{typecheck-5325aspe.js → typecheck-971tmqbp.js} +4 -4
  24. package/dist/{update-check-a02ydxdb.js → update-check-dpkh7hc6.js} +1 -1
  25. package/package.json +1 -1
  26. package/dist/cron-e6whgdf7.js +0 -18
  27. package/dist/list-pahq60sp.js +0 -13
  28. package/dist/run-apb4mx5d.js +0 -13
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  SchemaRenderer
3
- } from "./cli-f4k31gtc.js";
3
+ } from "./cli-884hpkjc.js";
4
4
  import {
5
5
  CommandIds,
6
6
  ToolLoader,
7
7
  createRigToolKit
8
- } from "./cli-c6y9p8v9.js";
8
+ } from "./cli-f7p31fzm.js";
9
9
  import {
10
10
  RigError,
11
11
  RigErrors
@@ -24,6 +24,9 @@ class RigPaths {
24
24
  get rigDir() {
25
25
  return join(this.homeDir, "rig");
26
26
  }
27
+ get legacyRigDir() {
28
+ return join(this.homeDir, ".rig");
29
+ }
27
30
  get configPath() {
28
31
  return join(this.rigDir, "rig.json");
29
32
  }
@@ -54,6 +57,9 @@ class RigPaths {
54
57
  get defaultBaseRegistryDir() {
55
58
  return "~/rig/tools";
56
59
  }
60
+ get legacyDefaultBaseRegistryDir() {
61
+ return "~/.rig/tools";
62
+ }
57
63
  parentDir(pathValue) {
58
64
  return dirname(pathValue);
59
65
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  RigConfigStore
3
- } from "./cli-jbscjyqq.js";
3
+ } from "./cli-nk194xv0.js";
4
4
  import {
5
5
  RigError
6
6
  } from "./cli-1c7te5cg.js";
7
7
  import {
8
8
  RigPaths
9
- } from "./cli-vkw9rcke.js";
9
+ } from "./cli-13q90bjr.js";
10
10
 
11
11
  // src/registry/discover.ts
12
12
  import { existsSync, statSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  exports_external
3
- } from "./cli-jbscjyqq.js";
3
+ } from "./cli-nk194xv0.js";
4
4
 
5
5
  // src/tools/schema.ts
6
6
  class SchemaRenderer {
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  ToolRunner
3
- } from "./cli-yahk2r84.js";
3
+ } from "./cli-113n7c3t.js";
4
4
  import {
5
5
  RigConfigStore
6
- } from "./cli-jbscjyqq.js";
6
+ } from "./cli-nk194xv0.js";
7
7
  import {
8
8
  RigError
9
9
  } from "./cli-1c7te5cg.js";
10
10
  import {
11
11
  RigPaths
12
- } from "./cli-vkw9rcke.js";
12
+ } from "./cli-13q90bjr.js";
13
13
 
14
14
  // src/tools/cron.ts
15
15
  import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ToolDiscoveryService
3
- } from "./cli-ggk7t6dg.js";
3
+ } from "./cli-1hm5dxfw.js";
4
4
  import {
5
5
  exports_external
6
- } from "./cli-jbscjyqq.js";
6
+ } from "./cli-nk194xv0.js";
7
7
  import {
8
8
  RigError
9
9
  } from "./cli-1c7te5cg.js";
@@ -236,7 +236,7 @@ class RigCommandRunnerRuntime {
236
236
  }
237
237
  async run(options) {
238
238
  const target = this.commandTarget(options);
239
- const { ToolRunner } = await import("./run-apb4mx5d.js");
239
+ const { ToolRunner } = await import("./run-thx15p83.js");
240
240
  const result = await new ToolRunner(this.options).run(target.tool, target.command, {
241
241
  ...this.options,
242
242
  args: options.args,
@@ -3,14 +3,14 @@ import {
3
3
  } from "./cli-1c7te5cg.js";
4
4
  import {
5
5
  RigPaths
6
- } from "./cli-vkw9rcke.js";
6
+ } from "./cli-13q90bjr.js";
7
7
  import {
8
8
  __export
9
9
  } from "./cli-b7jgjgy7.js";
10
10
 
11
11
  // src/config/config.ts
12
- import { mkdir as mkdir2, readFile as readFile2, rename, writeFile as writeFile2 } from "node:fs/promises";
13
- import { existsSync as existsSync3 } from "node:fs";
12
+ import { mkdir as mkdir3, readFile as readFile3, rename as rename2, writeFile as writeFile3 } from "node:fs/promises";
13
+ import { existsSync as existsSync4 } from "node:fs";
14
14
  import { dirname as dirname2 } from "node:path";
15
15
 
16
16
  // src/runtime/support.ts
@@ -417,6 +417,100 @@ ${JSON.stringify({
417
417
  }
418
418
  }
419
419
 
420
+ // src/config/migration.ts
421
+ import { existsSync as existsSync3 } from "node:fs";
422
+ import { mkdir as mkdir2, readdir, readFile as readFile2, rename, rm, stat, writeFile as writeFile2 } from "node:fs/promises";
423
+ import { join as join3 } from "node:path";
424
+
425
+ class RigDirectoryMigrationService {
426
+ paths;
427
+ constructor(paths) {
428
+ this.paths = paths;
429
+ }
430
+ async migrateIfNeeded() {
431
+ const legacyDir = this.paths.legacyRigDir;
432
+ const currentDir = this.paths.rigDir;
433
+ if (!await this.hasLegacyState(legacyDir))
434
+ return;
435
+ const currentExists = existsSync3(currentDir);
436
+ if (currentExists && !await this.canReplaceCurrentDirectory(currentDir)) {
437
+ return {
438
+ status: "manual",
439
+ legacyDir,
440
+ currentDir,
441
+ configUpdated: false,
442
+ reason: "Rig found data in both the old and new folders."
443
+ };
444
+ }
445
+ if (currentExists)
446
+ await rm(currentDir, { recursive: true, force: true });
447
+ await mkdir2(this.paths.homeDir, { recursive: true });
448
+ await rename(legacyDir, currentDir);
449
+ return {
450
+ status: "migrated",
451
+ legacyDir,
452
+ currentDir,
453
+ configUpdated: await this.rewriteMigratedConfig()
454
+ };
455
+ }
456
+ async hasLegacyState(legacyDir) {
457
+ return await this.directoryExists(legacyDir) && (existsSync3(join3(legacyDir, "rig.json")) || existsSync3(join3(legacyDir, "tools")));
458
+ }
459
+ async canReplaceCurrentDirectory(currentDir) {
460
+ return await this.hasDefaultCurrentConfig(currentDir) && await this.hasEmptyGeneratedRegistry(currentDir) && await this.hasEmptyCronDirectory(currentDir) && await this.hasOnlyGeneratedCurrentEntries(currentDir);
461
+ }
462
+ async hasDefaultCurrentConfig(currentDir) {
463
+ try {
464
+ const parsed = JSON.parse(await readFile2(join3(currentDir, "rig.json"), "utf8"));
465
+ return parsed.version === 1 && parsed.baseRegistryDir === this.paths.defaultBaseRegistryDir && Array.isArray(parsed.customRegistries) && parsed.customRegistries.length === 0 && (parsed.cronJobs === undefined || Array.isArray(parsed.cronJobs) && parsed.cronJobs.length === 0);
466
+ } catch {
467
+ return false;
468
+ }
469
+ }
470
+ async hasEmptyGeneratedRegistry(currentDir) {
471
+ const toolsDir = join3(currentDir, "tools");
472
+ if (!await this.directoryExists(toolsDir))
473
+ return true;
474
+ const entries = await this.visibleEntries(toolsDir);
475
+ return entries.every((entry) => entry === "tsconfig.json");
476
+ }
477
+ async hasEmptyCronDirectory(currentDir) {
478
+ const cronDir = join3(currentDir, "cron");
479
+ if (!await this.directoryExists(cronDir))
480
+ return true;
481
+ return (await this.visibleEntries(cronDir)).length === 0;
482
+ }
483
+ async hasOnlyGeneratedCurrentEntries(currentDir) {
484
+ const entries = await this.visibleEntries(currentDir);
485
+ return entries.every((entry) => ["rig.json", "runtime", "tools", "update-check.json", "cron"].includes(entry));
486
+ }
487
+ async rewriteMigratedConfig() {
488
+ const configPath = this.paths.configPath;
489
+ if (!existsSync3(configPath))
490
+ return false;
491
+ const parsed = JSON.parse(await readFile2(configPath, "utf8"));
492
+ if (!this.isLegacyBaseRegistry(parsed.baseRegistryDir))
493
+ return false;
494
+ parsed.baseRegistryDir = this.paths.defaultBaseRegistryDir;
495
+ await writeFile2(configPath, `${JSON.stringify(parsed, null, 2)}
496
+ `, "utf8");
497
+ return true;
498
+ }
499
+ isLegacyBaseRegistry(value) {
500
+ return typeof value === "string" && (value === this.paths.legacyDefaultBaseRegistryDir || this.paths.resolve(value) === join3(this.paths.legacyRigDir, "tools"));
501
+ }
502
+ async visibleEntries(path) {
503
+ return (await readdir(path)).filter((entry) => entry !== ".DS_Store");
504
+ }
505
+ async directoryExists(path) {
506
+ try {
507
+ return (await stat(path)).isDirectory();
508
+ } catch {
509
+ return false;
510
+ }
511
+ }
512
+ }
513
+
420
514
  // node_modules/zod/v4/classic/external.js
421
515
  var exports_external = {};
422
516
  __export(exports_external, {
@@ -14722,25 +14816,30 @@ class RigConfigDefaults {
14722
14816
  class RigConfigStore {
14723
14817
  paths;
14724
14818
  runtimeSupport;
14819
+ migration;
14725
14820
  constructor(options = {}) {
14726
14821
  this.paths = new RigPaths(options);
14727
14822
  this.runtimeSupport = new RuntimeSupport(options);
14728
14823
  }
14824
+ migrationResult() {
14825
+ return this.migration;
14826
+ }
14729
14827
  async ensure() {
14730
- await mkdir2(this.paths.rigDir, { recursive: true });
14731
- if (!existsSync3(this.paths.configPath)) {
14828
+ this.migration = await new RigDirectoryMigrationService(this.paths).migrateIfNeeded();
14829
+ await mkdir3(this.paths.rigDir, { recursive: true });
14830
+ if (!existsSync4(this.paths.configPath)) {
14732
14831
  await this.write(RigConfigDefaults.create());
14733
14832
  }
14734
14833
  const config2 = await this.read();
14735
14834
  const registries2 = this.registryEntries(config2);
14736
- await mkdir2(this.resolvedBaseRegistry(config2), { recursive: true });
14835
+ await mkdir3(this.resolvedBaseRegistry(config2), { recursive: true });
14737
14836
  await this.runtimeSupport.ensure(registries2.map((registry2) => registry2.path));
14738
14837
  return config2;
14739
14838
  }
14740
14839
  async read() {
14741
14840
  let raw;
14742
14841
  try {
14743
- raw = await readFile2(this.paths.configPath, "utf8");
14842
+ raw = await readFile3(this.paths.configPath, "utf8");
14744
14843
  } catch (error51) {
14745
14844
  throw new RigError("CONFIG_INVALID", `Could not read config at ${this.paths.configPath}.`, {
14746
14845
  error: error51
@@ -14765,11 +14864,11 @@ class RigConfigStore {
14765
14864
  if (!result.success) {
14766
14865
  throw new RigError("CONFIG_INVALID", "Rig config is invalid.", result.error.flatten());
14767
14866
  }
14768
- await mkdir2(dirname2(this.paths.configPath), { recursive: true });
14867
+ await mkdir3(dirname2(this.paths.configPath), { recursive: true });
14769
14868
  const tmpPath = `${this.paths.configPath}.tmp-${process.pid}`;
14770
- await writeFile2(tmpPath, `${JSON.stringify(result.data, null, 2)}
14869
+ await writeFile3(tmpPath, `${JSON.stringify(result.data, null, 2)}
14771
14870
  `, "utf8");
14772
- await rename(tmpPath, this.paths.configPath);
14871
+ await rename2(tmpPath, this.paths.configPath);
14773
14872
  }
14774
14873
  resolvedBaseRegistry(config2) {
14775
14874
  return this.paths.resolve(config2.baseRegistryDir || this.paths.defaultBaseRegistryDir);
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  SchemaRenderer
3
- } from "./cli-f4k31gtc.js";
3
+ } from "./cli-884hpkjc.js";
4
4
  import {
5
5
  CommandIds,
6
6
  ToolLoader
7
- } from "./cli-c6y9p8v9.js";
7
+ } from "./cli-f7p31fzm.js";
8
8
  import {
9
9
  ToolDiscoveryService
10
- } from "./cli-ggk7t6dg.js";
10
+ } from "./cli-1hm5dxfw.js";
11
11
 
12
12
  // src/tools/list.ts
13
13
  class CommandRunExampleRenderer {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RigConfigStore
3
- } from "./cli-jbscjyqq.js";
3
+ } from "./cli-nk194xv0.js";
4
4
  import"./cli-1c7te5cg.js";
5
- import"./cli-vkw9rcke.js";
5
+ import"./cli-13q90bjr.js";
6
6
  import"./cli-b7jgjgy7.js";
7
7
  export {
8
8
  RigConfigStore
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  ToolLoader
3
- } from "./cli-c6y9p8v9.js";
3
+ } from "./cli-f7p31fzm.js";
4
4
  import {
5
5
  RigToolEntryFiles,
6
6
  ToolDiscoveryService
7
- } from "./cli-ggk7t6dg.js";
7
+ } from "./cli-1hm5dxfw.js";
8
8
  import {
9
9
  RigConfigStore
10
- } from "./cli-jbscjyqq.js";
10
+ } from "./cli-nk194xv0.js";
11
11
  import {
12
12
  RigError
13
13
  } from "./cli-1c7te5cg.js";
14
- import"./cli-vkw9rcke.js";
14
+ import"./cli-13q90bjr.js";
15
15
  import"./cli-b7jgjgy7.js";
16
16
 
17
17
  // src/tools/create.ts
@@ -0,0 +1,18 @@
1
+ import {
2
+ RigCronService,
3
+ RigCronWorker,
4
+ cronModuleUrl
5
+ } from "./cli-es8j6mma.js";
6
+ import"./cli-113n7c3t.js";
7
+ import"./cli-884hpkjc.js";
8
+ import"./cli-f7p31fzm.js";
9
+ import"./cli-1hm5dxfw.js";
10
+ import"./cli-nk194xv0.js";
11
+ import"./cli-1c7te5cg.js";
12
+ import"./cli-13q90bjr.js";
13
+ import"./cli-b7jgjgy7.js";
14
+ export {
15
+ cronModuleUrl,
16
+ RigCronWorker,
17
+ RigCronService
18
+ };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./cli-1c7te5cg.js";
4
4
  import {
5
5
  RigPaths
6
- } from "./cli-vkw9rcke.js";
6
+ } from "./cli-13q90bjr.js";
7
7
  import"./cli-b7jgjgy7.js";
8
8
 
9
9
  // src/dev/dev-link.ts
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  RigToolEntryFiles,
3
3
  ToolDiscoveryService
4
- } from "./cli-ggk7t6dg.js";
5
- import"./cli-jbscjyqq.js";
4
+ } from "./cli-1hm5dxfw.js";
5
+ import"./cli-nk194xv0.js";
6
6
  import"./cli-1c7te5cg.js";
7
- import"./cli-vkw9rcke.js";
7
+ import"./cli-13q90bjr.js";
8
8
  import"./cli-b7jgjgy7.js";
9
9
  export {
10
10
  ToolDiscoveryService,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  SchemaRenderer
3
- } from "./cli-f4k31gtc.js";
3
+ } from "./cli-884hpkjc.js";
4
4
  import {
5
5
  CommandIds,
6
6
  ToolLoader
7
- } from "./cli-c6y9p8v9.js";
8
- import"./cli-ggk7t6dg.js";
9
- import"./cli-jbscjyqq.js";
7
+ } from "./cli-f7p31fzm.js";
8
+ import"./cli-1hm5dxfw.js";
9
+ import"./cli-nk194xv0.js";
10
10
  import {
11
11
  RigError
12
12
  } from "./cli-1c7te5cg.js";
13
- import"./cli-vkw9rcke.js";
13
+ import"./cli-13q90bjr.js";
14
14
  import"./cli-b7jgjgy7.js";
15
15
 
16
16
  // src/tools/help.ts
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  SchemaRenderer
3
- } from "./cli-f4k31gtc.js";
3
+ } from "./cli-884hpkjc.js";
4
4
  import {
5
5
  CommandIds,
6
6
  ToolLoader
7
- } from "./cli-c6y9p8v9.js";
8
- import"./cli-ggk7t6dg.js";
9
- import"./cli-jbscjyqq.js";
7
+ } from "./cli-f7p31fzm.js";
8
+ import"./cli-1hm5dxfw.js";
9
+ import"./cli-nk194xv0.js";
10
10
  import {
11
11
  RigError
12
12
  } from "./cli-1c7te5cg.js";
13
- import"./cli-vkw9rcke.js";
13
+ import"./cli-13q90bjr.js";
14
14
  import"./cli-b7jgjgy7.js";
15
15
 
16
16
  // src/tools/inspect.ts
@@ -0,0 +1,13 @@
1
+ import {
2
+ ToolListService
3
+ } from "./cli-zgw1jbeg.js";
4
+ import"./cli-884hpkjc.js";
5
+ import"./cli-f7p31fzm.js";
6
+ import"./cli-1hm5dxfw.js";
7
+ import"./cli-nk194xv0.js";
8
+ import"./cli-1c7te5cg.js";
9
+ import"./cli-13q90bjr.js";
10
+ import"./cli-b7jgjgy7.js";
11
+ export {
12
+ ToolListService
13
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RigPaths
3
- } from "./cli-vkw9rcke.js";
3
+ } from "./cli-13q90bjr.js";
4
4
  import"./cli-b7jgjgy7.js";
5
5
  export {
6
6
  RigPaths
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  RigConfigStore
3
- } from "./cli-jbscjyqq.js";
3
+ } from "./cli-nk194xv0.js";
4
4
  import {
5
5
  RigError
6
6
  } from "./cli-1c7te5cg.js";
7
7
  import {
8
8
  RigPaths
9
- } from "./cli-vkw9rcke.js";
9
+ } from "./cli-13q90bjr.js";
10
10
  import"./cli-b7jgjgy7.js";
11
11
 
12
12
  // src/registry/registry.ts
package/dist/rig.js CHANGED
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  RigCronWorker
4
- } from "./cli-0p4wnh3p.js";
5
- import"./cli-yahk2r84.js";
6
- import"./cli-f4k31gtc.js";
7
- import"./cli-c6y9p8v9.js";
8
- import"./cli-ggk7t6dg.js";
4
+ } from "./cli-es8j6mma.js";
5
+ import"./cli-113n7c3t.js";
6
+ import"./cli-884hpkjc.js";
7
+ import"./cli-f7p31fzm.js";
8
+ import"./cli-1hm5dxfw.js";
9
9
  import {
10
10
  RigPackageRoot
11
- } from "./cli-jbscjyqq.js";
11
+ } from "./cli-nk194xv0.js";
12
12
  import {
13
13
  RigError,
14
14
  RigErrors
15
15
  } from "./cli-1c7te5cg.js";
16
- import"./cli-vkw9rcke.js";
16
+ import"./cli-13q90bjr.js";
17
17
  import {
18
18
  __require
19
19
  } from "./cli-b7jgjgy7.js";
@@ -110,7 +110,7 @@ class CliApplication {
110
110
  return;
111
111
  }
112
112
  this.requestGeneratedSync();
113
- const { ToolHelpService } = await import("./help-17a9ywd9.js");
113
+ const { ToolHelpService } = await import("./help-qj75r0x3.js");
114
114
  console.log(await new ToolHelpService(this.pathOptions()).render(target));
115
115
  });
116
116
  }
@@ -127,37 +127,37 @@ class CliApplication {
127
127
  configureConfigCommands() {
128
128
  const configCommand = this.program.command("config").description("Manage Rig config.");
129
129
  configCommand.command("show").description("Print config JSON.").action(async () => {
130
- const { RigConfigStore } = await import("./config-8mr59m0q.js");
130
+ const { RigConfigStore } = await import("./config-20f90shh.js");
131
131
  const configStore = new RigConfigStore(this.pathOptions());
132
132
  await configStore.ensure();
133
133
  this.printJson(await configStore.read());
134
134
  });
135
135
  configCommand.command("path").description("Print absolute config path.").action(async () => {
136
- const { RigPaths } = await import("./paths-cxq6fvhp.js");
136
+ const { RigPaths } = await import("./paths-3vxw7dek.js");
137
137
  console.log(new RigPaths(this.pathOptions()).configPath);
138
138
  });
139
139
  }
140
140
  configureRegistryCommands() {
141
141
  const registryCommand = this.program.command("registry").description("Manage tool registries.");
142
142
  registryCommand.command("list").description("List registries as JSON.").action(async () => {
143
- const { RegistryConfigService } = await import("./registry-e68a7b4v.js");
143
+ const { RegistryConfigService } = await import("./registry-fzc3aeb8.js");
144
144
  this.printJson(await new RegistryConfigService(this.pathOptions()).list());
145
145
  });
146
146
  registryCommand.command("create").argument("[path]").description("Add a custom registry. Defaults to the current directory.").action(async (pathValue) => {
147
147
  this.requestGeneratedSync();
148
- const { RegistryConfigService } = await import("./registry-e68a7b4v.js");
148
+ const { RegistryConfigService } = await import("./registry-fzc3aeb8.js");
149
149
  this.printJson(await new RegistryConfigService(this.pathOptions()).add(pathValue ?? process.cwd()));
150
150
  });
151
151
  registryCommand.command("remove").argument("<path>").description("Remove a custom registry.").action(async (pathValue) => {
152
152
  this.requestGeneratedSync();
153
- const { RegistryConfigService } = await import("./registry-e68a7b4v.js");
153
+ const { RegistryConfigService } = await import("./registry-fzc3aeb8.js");
154
154
  this.printJson(await new RegistryConfigService(this.pathOptions()).remove(pathValue));
155
155
  });
156
156
  }
157
157
  configureListCommand() {
158
158
  this.program.command("list").alias("ls").description("List discovered tools and commands.").option("--json", "Print full JSON metadata.").option("--plain", "Print a compact plain text command list.").option("--for-path <path>", "Only list tools from registries visible from a path.").action(async (commandOptions) => {
159
159
  this.requestGeneratedSync();
160
- const { ToolListService } = await import("./list-pahq60sp.js");
160
+ const { ToolListService } = await import("./list-reekhy3q.js");
161
161
  const service = new ToolListService(this.pathOptions());
162
162
  const data = await service.list({ visibleFromPath: commandOptions.forPath });
163
163
  if (commandOptions.json)
@@ -169,7 +169,7 @@ class CliApplication {
169
169
  configureInspectCommand() {
170
170
  this.program.command("inspect").argument("<target>", "Tool name or command id (<tool>.<command>.)").description("Print tool or command metadata as JSON.").action(async (target) => {
171
171
  this.requestGeneratedSync();
172
- const { ToolInspector } = await import("./inspect-k2g3dt1g.js");
172
+ const { ToolInspector } = await import("./inspect-0ckw7bs5.js");
173
173
  this.printJson(await new ToolInspector(this.pathOptions()).inspect(target));
174
174
  });
175
175
  }
@@ -182,7 +182,7 @@ class CliApplication {
182
182
  configureEditCommand() {
183
183
  this.program.command("edit").argument("<tool>").description("Print the TypeScript file path for a tool.").action(async (name) => {
184
184
  this.requestGeneratedSync();
185
- const { ToolFileService } = await import("./create-9frp1c7g.js");
185
+ const { ToolFileService } = await import("./create-pvym2abv.js");
186
186
  const result = await new ToolFileService(this.pathOptions()).path(name);
187
187
  console.log(result.toolPath);
188
188
  });
@@ -190,7 +190,7 @@ class CliApplication {
190
190
  configureRemoveCommand() {
191
191
  this.program.command("remove").argument("<tool>").description("Remove a local tool directory.").action(async (name) => {
192
192
  this.requestGeneratedSync();
193
- const { ToolRemover } = await import("./create-9frp1c7g.js");
193
+ const { ToolRemover } = await import("./create-pvym2abv.js");
194
194
  const result = await new ToolRemover(this.pathOptions()).remove(name);
195
195
  console.log(`Removed tool ${result.name}`);
196
196
  console.log(`Tool directory: ${result.toolDir}`);
@@ -205,11 +205,11 @@ class CliApplication {
205
205
  configureCronCommands() {
206
206
  const cronCommand = this.program.command("cron").description("Manage scheduled Rig tool commands.");
207
207
  cronCommand.command("list").description("List scheduled Rig tool commands as JSON.").action(async () => {
208
- const { RigCronService } = await import("./cron-e6whgdf7.js");
208
+ const { RigCronService } = await import("./cron-aw908dzn.js");
209
209
  this.printJson(await new RigCronService(this.pathOptions()).list());
210
210
  });
211
211
  cronCommand.command("add").argument("<name>", "Unique job name, using letters, numbers, hyphens, or underscores.").argument("<command>", "Command id, formatted as <tool>.<command>.").argument("<schedule>", "Cron expression or nickname, such as @weekly.").description("Schedule a Rig tool command with fixed JSON input.").option("--input <json>", "JSON input string.").option("--input-file <path>", "Read JSON input from a file.").action(async (name, commandId, schedule, commandOptions) => {
212
- const { cronModuleUrl, RigCronService } = await import("./cron-e6whgdf7.js");
212
+ const { cronModuleUrl, RigCronService } = await import("./cron-aw908dzn.js");
213
213
  const result = await new RigCronService(this.pathOptions()).add({
214
214
  name,
215
215
  command: commandId,
@@ -221,11 +221,11 @@ class CliApplication {
221
221
  this.printJson(result);
222
222
  });
223
223
  cronCommand.command("remove").argument("<name>", "Cron job name.").description("Remove a scheduled Rig tool command.").action(async (name) => {
224
- const { RigCronService } = await import("./cron-e6whgdf7.js");
224
+ const { RigCronService } = await import("./cron-aw908dzn.js");
225
225
  this.printJson(await new RigCronService(this.pathOptions()).remove(name));
226
226
  });
227
227
  cronCommand.command("run").argument("<name>", "Cron job name.").description("Run a scheduled Rig tool command now.").action(async (name) => {
228
- const { RigCronService } = await import("./cron-e6whgdf7.js");
228
+ const { RigCronService } = await import("./cron-aw908dzn.js");
229
229
  const result = await new RigCronService(this.pathOptions()).run(name);
230
230
  this.printJson(result.envelope);
231
231
  process.exitCode = result.exitCode;
@@ -234,7 +234,7 @@ class CliApplication {
234
234
  configureTypecheckCommand() {
235
235
  this.program.command("typecheck").argument("[tool]").description("Type-check local tool files with the injected Rig tool runtime types.").action(async (tool) => {
236
236
  this.requestGeneratedSync();
237
- const { ToolTypecheckService } = await import("./typecheck-5325aspe.js");
237
+ const { ToolTypecheckService } = await import("./typecheck-971tmqbp.js");
238
238
  const result = await new ToolTypecheckService(this.pathOptions()).typecheck(tool);
239
239
  this.printJson(result);
240
240
  process.exitCode = result.exitCode;
@@ -264,7 +264,7 @@ class CliApplication {
264
264
  configureDevCommands() {
265
265
  const devCommand = this.program.command("dev").description("Local development helpers.");
266
266
  devCommand.command("link").description("Link this checkout as the local rig command for development.").option("--bin-dir <path>", "Directory where the rig shim should be written.").option("--force", "Overwrite an existing non-Rig shim.").action(async (commandOptions) => {
267
- const { DevLinkService } = await import("./dev-link-x3hjyy3j.js");
267
+ const { DevLinkService } = await import("./dev-link-e1mj8w17.js");
268
268
  const service = new DevLinkService(this.pathOptions());
269
269
  const status = await service.link({
270
270
  binDir: commandOptions.binDir,
@@ -273,7 +273,7 @@ class CliApplication {
273
273
  console.log(service.renderLinkResult(status));
274
274
  });
275
275
  devCommand.command("unlink").description("Remove the local rig development shim.").option("--bin-dir <path>", "Directory where the rig shim was written.").option("--force", "Remove even if the file is not a Rig dev shim.").action(async (commandOptions) => {
276
- const { DevLinkService } = await import("./dev-link-x3hjyy3j.js");
276
+ const { DevLinkService } = await import("./dev-link-e1mj8w17.js");
277
277
  const service = new DevLinkService(this.pathOptions());
278
278
  const status = await service.unlink({
279
279
  binDir: commandOptions.binDir,
@@ -282,12 +282,12 @@ class CliApplication {
282
282
  console.log(service.renderUnlinkResult(status));
283
283
  });
284
284
  devCommand.command("status").description("Show local rig development shim status as JSON.").option("--bin-dir <path>", "Directory where the rig shim should be checked.").action(async (commandOptions) => {
285
- const { DevLinkService } = await import("./dev-link-x3hjyy3j.js");
285
+ const { DevLinkService } = await import("./dev-link-e1mj8w17.js");
286
286
  this.printJson(await new DevLinkService(this.pathOptions()).status(commandOptions));
287
287
  });
288
288
  }
289
289
  async runToolCommand(commandId, args, commandOptions) {
290
- const { ToolRunner } = await import("./run-apb4mx5d.js");
290
+ const { ToolRunner } = await import("./run-thx15p83.js");
291
291
  const commandTarget = this.commandTarget(commandId);
292
292
  const result = await new ToolRunner(this.pathOptions()).run(commandTarget.tool, commandTarget.command, {
293
293
  ...this.pathOptions(),
@@ -301,9 +301,9 @@ class CliApplication {
301
301
  }
302
302
  async showDefaultStatus() {
303
303
  const [{ RigConfigStore }, { RigPaths }, { ToolDiscoveryService }] = await Promise.all([
304
- import("./config-8mr59m0q.js"),
305
- import("./paths-cxq6fvhp.js"),
306
- import("./discover-9n7b9ra2.js")
304
+ import("./config-20f90shh.js"),
305
+ import("./paths-3vxw7dek.js"),
306
+ import("./discover-95bpzy46.js")
307
307
  ]);
308
308
  const options = this.pathOptions();
309
309
  const paths = new RigPaths(options);
@@ -311,8 +311,11 @@ class CliApplication {
311
311
  const config = await configStore.ensure();
312
312
  const tools = await new ToolDiscoveryService(options).discover();
313
313
  const registries = configStore.registryEntries(config);
314
+ const currentVersion = this.version();
315
+ this.printMigrationNotice(configStore.migrationResult());
314
316
  console.log(`Rig is ready.
315
317
  `);
318
+ console.log(`Version: ${currentVersion}`);
316
319
  console.log(`Config: ${paths.configPath}`);
317
320
  console.log(`Base registry: ${registries[0]?.path}`);
318
321
  console.log(`Tools found: ${tools.length}`);
@@ -321,10 +324,10 @@ Next steps:`);
321
324
  console.log(" rig list");
322
325
  console.log(`
323
326
  Run "rig doctor" if you want to verify your setup.`);
324
- await this.printUpdateNotice();
327
+ await this.printUpdateNotice(currentVersion);
325
328
  }
326
329
  async createTool(name) {
327
- const { ToolCreator } = await import("./create-9frp1c7g.js");
330
+ const { ToolCreator } = await import("./create-pvym2abv.js");
328
331
  const result = await new ToolCreator(this.pathOptions()).create(name);
329
332
  console.log(`Created tool ${result.name}`);
330
333
  console.log(`
@@ -344,14 +347,15 @@ Try:`);
344
347
  }
345
348
  async doctor() {
346
349
  const [{ RigConfigStore }, { RigPaths }, { ToolDiscoveryService }] = await Promise.all([
347
- import("./config-8mr59m0q.js"),
348
- import("./paths-cxq6fvhp.js"),
349
- import("./discover-9n7b9ra2.js")
350
+ import("./config-20f90shh.js"),
351
+ import("./paths-3vxw7dek.js"),
352
+ import("./discover-95bpzy46.js")
350
353
  ]);
351
354
  const options = this.pathOptions();
352
355
  const paths = new RigPaths(options);
353
356
  const configStore = new RigConfigStore(options);
354
357
  const config = await configStore.ensure();
358
+ this.printMigrationNotice(configStore.migrationResult());
355
359
  const registries = configStore.registryEntries(config);
356
360
  const tools = await new ToolDiscoveryService(options).discover();
357
361
  console.log(`Rig doctor
@@ -365,12 +369,31 @@ Try:`);
365
369
  console.log(`Tools: ${tools.length}`);
366
370
  console.log(`
367
371
  Status: OK`);
368
- await this.printUpdateNotice();
372
+ await this.printUpdateNotice(this.version());
369
373
  }
370
- async printUpdateNotice() {
374
+ printMigrationNotice(migration) {
375
+ if (!migration)
376
+ return;
377
+ if (migration.status === "migrated") {
378
+ console.log("Rig moved its home folder:");
379
+ console.log(` From: ${migration.legacyDir}`);
380
+ console.log(` To: ${migration.currentDir}`);
381
+ if (migration.configUpdated)
382
+ console.log(" Updated base registry: ~/rig/tools");
383
+ console.log("");
384
+ return;
385
+ }
386
+ console.log("Rig home folder migration needs your attention:");
387
+ console.log(` Old folder: ${migration.legacyDir}`);
388
+ console.log(` New folder: ${migration.currentDir}`);
389
+ console.log(` Reason: ${migration.reason}`);
390
+ console.log("Move the files you want to keep into the new folder, then remove the old folder.");
391
+ console.log("");
392
+ }
393
+ async printUpdateNotice(currentVersion) {
371
394
  await this.ignoreSyncErrors(async () => {
372
- const { NpmUpdateCheckService } = await import("./update-check-a02ydxdb.js");
373
- const notice = await new NpmUpdateCheckService(this.pathOptions()).check(this.version());
395
+ const { NpmUpdateCheckService } = await import("./update-check-dpkh7hc6.js");
396
+ const notice = await new NpmUpdateCheckService(this.pathOptions()).check(currentVersion);
374
397
  if (notice)
375
398
  console.log(`
376
399
  ${notice.message}`);
@@ -381,13 +404,13 @@ ${notice.message}`);
381
404
  }
382
405
  async syncGeneratedFiles() {
383
406
  await this.ignoreSyncErrors(async () => {
384
- const { ToolRuntimeCommentSyncService } = await import("./runtime-comment-3yq1pmaf.js");
407
+ const { ToolRuntimeCommentSyncService } = await import("./runtime-comment-07cpchsr.js");
385
408
  await new ToolRuntimeCommentSyncService(this.pathOptions()).sync();
386
409
  });
387
410
  if (process.env.RIG_AGENT_SYNC === "0")
388
411
  return;
389
412
  await this.ignoreSyncErrors(async () => {
390
- const { AgentInstructionSyncService } = await import("./sync-3362wne1.js");
413
+ const { AgentInstructionSyncService } = await import("./sync-kkqh3axx.js");
391
414
  await new AgentInstructionSyncService(this.pathOptions()).sync();
392
415
  });
393
416
  }
@@ -0,0 +1,13 @@
1
+ import {
2
+ ToolRunner
3
+ } from "./cli-113n7c3t.js";
4
+ import"./cli-884hpkjc.js";
5
+ import"./cli-f7p31fzm.js";
6
+ import"./cli-1hm5dxfw.js";
7
+ import"./cli-nk194xv0.js";
8
+ import"./cli-1c7te5cg.js";
9
+ import"./cli-13q90bjr.js";
10
+ import"./cli-b7jgjgy7.js";
11
+ export {
12
+ ToolRunner
13
+ };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ToolDiscoveryService
3
- } from "./cli-ggk7t6dg.js";
4
- import"./cli-jbscjyqq.js";
3
+ } from "./cli-1hm5dxfw.js";
4
+ import"./cli-nk194xv0.js";
5
5
  import"./cli-1c7te5cg.js";
6
- import"./cli-vkw9rcke.js";
6
+ import"./cli-13q90bjr.js";
7
7
  import"./cli-b7jgjgy7.js";
8
8
 
9
9
  // src/tools/runtime-comment.ts
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  ToolListService
3
- } from "./cli-96n231pn.js";
4
- import"./cli-f4k31gtc.js";
5
- import"./cli-c6y9p8v9.js";
6
- import"./cli-ggk7t6dg.js";
7
- import"./cli-jbscjyqq.js";
3
+ } from "./cli-zgw1jbeg.js";
4
+ import"./cli-884hpkjc.js";
5
+ import"./cli-f7p31fzm.js";
6
+ import"./cli-1hm5dxfw.js";
7
+ import"./cli-nk194xv0.js";
8
8
  import"./cli-1c7te5cg.js";
9
9
  import {
10
10
  RigPaths
11
- } from "./cli-vkw9rcke.js";
11
+ } from "./cli-13q90bjr.js";
12
12
  import"./cli-b7jgjgy7.js";
13
13
 
14
14
  // src/agents/sync.ts
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  ToolLoader
3
- } from "./cli-c6y9p8v9.js";
3
+ } from "./cli-f7p31fzm.js";
4
4
  import {
5
5
  ToolDiscoveryService
6
- } from "./cli-ggk7t6dg.js";
6
+ } from "./cli-1hm5dxfw.js";
7
7
  import {
8
8
  RigConfigStore,
9
9
  RigPackageRoot
10
- } from "./cli-jbscjyqq.js";
10
+ } from "./cli-nk194xv0.js";
11
11
  import {
12
12
  RigError
13
13
  } from "./cli-1c7te5cg.js";
14
14
  import {
15
15
  RigPaths
16
- } from "./cli-vkw9rcke.js";
16
+ } from "./cli-13q90bjr.js";
17
17
  import {
18
18
  __commonJS,
19
19
  __require,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RigPaths
3
- } from "./cli-vkw9rcke.js";
3
+ } from "./cli-13q90bjr.js";
4
4
  import"./cli-b7jgjgy7.js";
5
5
 
6
6
  // src/runtime/update-check.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rendotdev/rig",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Local typed command runtime for agents.",
5
5
  "homepage": "https://github.com/rendotdev/rig#readme",
6
6
  "bugs": {
@@ -1,18 +0,0 @@
1
- import {
2
- RigCronService,
3
- RigCronWorker,
4
- cronModuleUrl
5
- } from "./cli-0p4wnh3p.js";
6
- import"./cli-yahk2r84.js";
7
- import"./cli-f4k31gtc.js";
8
- import"./cli-c6y9p8v9.js";
9
- import"./cli-ggk7t6dg.js";
10
- import"./cli-jbscjyqq.js";
11
- import"./cli-1c7te5cg.js";
12
- import"./cli-vkw9rcke.js";
13
- import"./cli-b7jgjgy7.js";
14
- export {
15
- cronModuleUrl,
16
- RigCronWorker,
17
- RigCronService
18
- };
@@ -1,13 +0,0 @@
1
- import {
2
- ToolListService
3
- } from "./cli-96n231pn.js";
4
- import"./cli-f4k31gtc.js";
5
- import"./cli-c6y9p8v9.js";
6
- import"./cli-ggk7t6dg.js";
7
- import"./cli-jbscjyqq.js";
8
- import"./cli-1c7te5cg.js";
9
- import"./cli-vkw9rcke.js";
10
- import"./cli-b7jgjgy7.js";
11
- export {
12
- ToolListService
13
- };
@@ -1,13 +0,0 @@
1
- import {
2
- ToolRunner
3
- } from "./cli-yahk2r84.js";
4
- import"./cli-f4k31gtc.js";
5
- import"./cli-c6y9p8v9.js";
6
- import"./cli-ggk7t6dg.js";
7
- import"./cli-jbscjyqq.js";
8
- import"./cli-1c7te5cg.js";
9
- import"./cli-vkw9rcke.js";
10
- import"./cli-b7jgjgy7.js";
11
- export {
12
- ToolRunner
13
- };