@rendotdev/rig 0.0.20 → 0.0.22

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 (30) hide show
  1. package/README.md +3 -1
  2. package/dist/{cli-nk194xv0.js → cli-043bae8s.js} +85 -3
  3. package/dist/{cli-es8j6mma.js → cli-1ssn3a04.js} +3 -3
  4. package/dist/{cli-13q90bjr.js → cli-32dzwg3p.js} +6 -0
  5. package/dist/{cli-1hm5dxfw.js → cli-ahwyqf1f.js} +2 -2
  6. package/dist/{cli-f7p31fzm.js → cli-dqz4gvqd.js} +3 -3
  7. package/dist/cli-eavzwv49.js +5161 -0
  8. package/dist/{cli-1354fmns.js → cli-q2ajq5qe.js} +3 -3
  9. package/dist/{cli-884hpkjc.js → cli-zbp3334x.js} +1 -1
  10. package/dist/{config-20f90shh.js → config-72dha2z0.js} +2 -2
  11. package/dist/{create-pvym2abv.js → create-pnsj60ym.js} +4 -4
  12. package/dist/cron-zhb9hpbs.js +18 -0
  13. package/dist/{dev-link-e1mj8w17.js → dev-link-znh4mch1.js} +1 -1
  14. package/dist/{discover-95bpzy46.js → discover-549nzamy.js} +3 -3
  15. package/dist/{help-qj75r0x3.js → help-kg1zhj6n.js} +5 -5
  16. package/dist/{inspect-0ckw7bs5.js → inspect-vqtm5htv.js} +5 -5
  17. package/dist/list-2n0p40dn.js +13 -0
  18. package/dist/{paths-3vxw7dek.js → paths-4kzahz8f.js} +1 -1
  19. package/dist/{registry-fzc3aeb8.js → registry-nvnbmws0.js} +2 -2
  20. package/dist/rig.js +50 -40
  21. package/dist/run-mvhmkkfe.js +13 -0
  22. package/dist/{runtime-comment-07cpchsr.js → runtime-comment-n9aft3g5.js} +10 -3
  23. package/dist/{sync-k2spbt3f.js → sync-javg558s.js} +11 -7
  24. package/dist/{typecheck-971tmqbp.js → typecheck-c944bvz2.js} +4 -4
  25. package/dist/{update-check-dpkh7hc6.js → update-check-bqa9ejex.js} +1 -1
  26. package/package.json +2 -1
  27. package/dist/cli-113n7c3t.js +0 -513
  28. package/dist/cron-aw908dzn.js +0 -18
  29. package/dist/list-gqdh0m23.js +0 -13
  30. package/dist/run-thx15p83.js +0 -13
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  SchemaRenderer
3
- } from "./cli-884hpkjc.js";
3
+ } from "./cli-zbp3334x.js";
4
4
  import {
5
5
  CommandIds,
6
6
  ToolLoader
7
- } from "./cli-f7p31fzm.js";
7
+ } from "./cli-dqz4gvqd.js";
8
8
  import {
9
9
  ToolDiscoveryService
10
- } from "./cli-1hm5dxfw.js";
10
+ } from "./cli-ahwyqf1f.js";
11
11
 
12
12
  // src/tools/list.ts
13
13
  class CommandRunExampleRenderer {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  exports_external
3
- } from "./cli-nk194xv0.js";
3
+ } from "./cli-043bae8s.js";
4
4
 
5
5
  // src/tools/schema.ts
6
6
  class SchemaRenderer {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RigConfigStore
3
- } from "./cli-nk194xv0.js";
3
+ } from "./cli-043bae8s.js";
4
4
  import"./cli-1c7te5cg.js";
5
- import"./cli-13q90bjr.js";
5
+ import"./cli-32dzwg3p.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-f7p31fzm.js";
3
+ } from "./cli-dqz4gvqd.js";
4
4
  import {
5
5
  RigToolEntryFiles,
6
6
  ToolDiscoveryService
7
- } from "./cli-1hm5dxfw.js";
7
+ } from "./cli-ahwyqf1f.js";
8
8
  import {
9
9
  RigConfigStore
10
- } from "./cli-nk194xv0.js";
10
+ } from "./cli-043bae8s.js";
11
11
  import {
12
12
  RigError
13
13
  } from "./cli-1c7te5cg.js";
14
- import"./cli-13q90bjr.js";
14
+ import"./cli-32dzwg3p.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-1ssn3a04.js";
6
+ import"./cli-eavzwv49.js";
7
+ import"./cli-zbp3334x.js";
8
+ import"./cli-dqz4gvqd.js";
9
+ import"./cli-ahwyqf1f.js";
10
+ import"./cli-043bae8s.js";
11
+ import"./cli-1c7te5cg.js";
12
+ import"./cli-32dzwg3p.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-13q90bjr.js";
6
+ } from "./cli-32dzwg3p.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-1hm5dxfw.js";
5
- import"./cli-nk194xv0.js";
4
+ } from "./cli-ahwyqf1f.js";
5
+ import"./cli-043bae8s.js";
6
6
  import"./cli-1c7te5cg.js";
7
- import"./cli-13q90bjr.js";
7
+ import"./cli-32dzwg3p.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-884hpkjc.js";
3
+ } from "./cli-zbp3334x.js";
4
4
  import {
5
5
  CommandIds,
6
6
  ToolLoader
7
- } from "./cli-f7p31fzm.js";
8
- import"./cli-1hm5dxfw.js";
9
- import"./cli-nk194xv0.js";
7
+ } from "./cli-dqz4gvqd.js";
8
+ import"./cli-ahwyqf1f.js";
9
+ import"./cli-043bae8s.js";
10
10
  import {
11
11
  RigError
12
12
  } from "./cli-1c7te5cg.js";
13
- import"./cli-13q90bjr.js";
13
+ import"./cli-32dzwg3p.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-884hpkjc.js";
3
+ } from "./cli-zbp3334x.js";
4
4
  import {
5
5
  CommandIds,
6
6
  ToolLoader
7
- } from "./cli-f7p31fzm.js";
8
- import"./cli-1hm5dxfw.js";
9
- import"./cli-nk194xv0.js";
7
+ } from "./cli-dqz4gvqd.js";
8
+ import"./cli-ahwyqf1f.js";
9
+ import"./cli-043bae8s.js";
10
10
  import {
11
11
  RigError
12
12
  } from "./cli-1c7te5cg.js";
13
- import"./cli-13q90bjr.js";
13
+ import"./cli-32dzwg3p.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-q2ajq5qe.js";
4
+ import"./cli-zbp3334x.js";
5
+ import"./cli-dqz4gvqd.js";
6
+ import"./cli-ahwyqf1f.js";
7
+ import"./cli-043bae8s.js";
8
+ import"./cli-1c7te5cg.js";
9
+ import"./cli-32dzwg3p.js";
10
+ import"./cli-b7jgjgy7.js";
11
+ export {
12
+ ToolListService
13
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RigPaths
3
- } from "./cli-13q90bjr.js";
3
+ } from "./cli-32dzwg3p.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-nk194xv0.js";
3
+ } from "./cli-043bae8s.js";
4
4
  import {
5
5
  RigError
6
6
  } from "./cli-1c7te5cg.js";
7
7
  import {
8
8
  RigPaths
9
- } from "./cli-13q90bjr.js";
9
+ } from "./cli-32dzwg3p.js";
10
10
  import"./cli-b7jgjgy7.js";
11
11
 
12
12
  // src/registry/registry.ts
package/dist/rig.js CHANGED
@@ -1,19 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  RigCronWorker
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";
4
+ } from "./cli-1ssn3a04.js";
5
+ import {
6
+ RigLoggerFactory
7
+ } from "./cli-eavzwv49.js";
8
+ import"./cli-zbp3334x.js";
9
+ import"./cli-dqz4gvqd.js";
10
+ import"./cli-ahwyqf1f.js";
9
11
  import {
10
12
  RigPackageRoot
11
- } from "./cli-nk194xv0.js";
13
+ } from "./cli-043bae8s.js";
12
14
  import {
13
15
  RigError,
14
16
  RigErrors
15
17
  } from "./cli-1c7te5cg.js";
16
- import"./cli-13q90bjr.js";
18
+ import"./cli-32dzwg3p.js";
17
19
  import {
18
20
  __require
19
21
  } from "./cli-b7jgjgy7.js";
@@ -110,7 +112,7 @@ class CliApplication {
110
112
  return;
111
113
  }
112
114
  this.requestGeneratedSync();
113
- const { ToolHelpService } = await import("./help-qj75r0x3.js");
115
+ const { ToolHelpService } = await import("./help-kg1zhj6n.js");
114
116
  console.log(await new ToolHelpService(this.pathOptions()).render(target));
115
117
  });
116
118
  }
@@ -127,37 +129,37 @@ class CliApplication {
127
129
  configureConfigCommands() {
128
130
  const configCommand = this.program.command("config").description("Manage Rig config.");
129
131
  configCommand.command("show").description("Print config JSON.").action(async () => {
130
- const { RigConfigStore } = await import("./config-20f90shh.js");
132
+ const { RigConfigStore } = await import("./config-72dha2z0.js");
131
133
  const configStore = new RigConfigStore(this.pathOptions());
132
134
  await configStore.ensure();
133
135
  this.printJson(await configStore.read());
134
136
  });
135
137
  configCommand.command("path").description("Print absolute config path.").action(async () => {
136
- const { RigPaths } = await import("./paths-3vxw7dek.js");
138
+ const { RigPaths } = await import("./paths-4kzahz8f.js");
137
139
  console.log(new RigPaths(this.pathOptions()).configPath);
138
140
  });
139
141
  }
140
142
  configureRegistryCommands() {
141
143
  const registryCommand = this.program.command("registry").description("Manage tool registries.");
142
144
  registryCommand.command("list").description("List registries as JSON.").action(async () => {
143
- const { RegistryConfigService } = await import("./registry-fzc3aeb8.js");
145
+ const { RegistryConfigService } = await import("./registry-nvnbmws0.js");
144
146
  this.printJson(await new RegistryConfigService(this.pathOptions()).list());
145
147
  });
146
148
  registryCommand.command("create").argument("[path]").description("Add a custom registry. Defaults to the current directory.").action(async (pathValue) => {
147
149
  this.requestGeneratedSync();
148
- const { RegistryConfigService } = await import("./registry-fzc3aeb8.js");
150
+ const { RegistryConfigService } = await import("./registry-nvnbmws0.js");
149
151
  this.printJson(await new RegistryConfigService(this.pathOptions()).add(pathValue ?? process.cwd()));
150
152
  });
151
153
  registryCommand.command("remove").argument("<path>").description("Remove a custom registry.").action(async (pathValue) => {
152
154
  this.requestGeneratedSync();
153
- const { RegistryConfigService } = await import("./registry-fzc3aeb8.js");
155
+ const { RegistryConfigService } = await import("./registry-nvnbmws0.js");
154
156
  this.printJson(await new RegistryConfigService(this.pathOptions()).remove(pathValue));
155
157
  });
156
158
  }
157
159
  configureListCommand() {
158
160
  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
161
  this.requestGeneratedSync();
160
- const { ToolListService } = await import("./list-gqdh0m23.js");
162
+ const { ToolListService } = await import("./list-2n0p40dn.js");
161
163
  const service = new ToolListService(this.pathOptions());
162
164
  const data = await service.list({ visibleFromPath: commandOptions.forPath });
163
165
  if (commandOptions.json)
@@ -169,7 +171,7 @@ class CliApplication {
169
171
  configureInspectCommand() {
170
172
  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
173
  this.requestGeneratedSync();
172
- const { ToolInspector } = await import("./inspect-0ckw7bs5.js");
174
+ const { ToolInspector } = await import("./inspect-vqtm5htv.js");
173
175
  this.printJson(await new ToolInspector(this.pathOptions()).inspect(target));
174
176
  });
175
177
  }
@@ -182,7 +184,7 @@ class CliApplication {
182
184
  configureEditCommand() {
183
185
  this.program.command("edit").argument("<tool>").description("Print the TypeScript file path for a tool.").action(async (name) => {
184
186
  this.requestGeneratedSync();
185
- const { ToolFileService } = await import("./create-pvym2abv.js");
187
+ const { ToolFileService } = await import("./create-pnsj60ym.js");
186
188
  const result = await new ToolFileService(this.pathOptions()).path(name);
187
189
  console.log(result.toolPath);
188
190
  });
@@ -190,7 +192,7 @@ class CliApplication {
190
192
  configureRemoveCommand() {
191
193
  this.program.command("remove").argument("<tool>").description("Remove a local tool directory.").action(async (name) => {
192
194
  this.requestGeneratedSync();
193
- const { ToolRemover } = await import("./create-pvym2abv.js");
195
+ const { ToolRemover } = await import("./create-pnsj60ym.js");
194
196
  const result = await new ToolRemover(this.pathOptions()).remove(name);
195
197
  console.log(`Removed tool ${result.name}`);
196
198
  console.log(`Tool directory: ${result.toolDir}`);
@@ -205,11 +207,11 @@ class CliApplication {
205
207
  configureCronCommands() {
206
208
  const cronCommand = this.program.command("cron").description("Manage scheduled Rig tool commands.");
207
209
  cronCommand.command("list").description("List scheduled Rig tool commands as JSON.").action(async () => {
208
- const { RigCronService } = await import("./cron-aw908dzn.js");
210
+ const { RigCronService } = await import("./cron-zhb9hpbs.js");
209
211
  this.printJson(await new RigCronService(this.pathOptions()).list());
210
212
  });
211
213
  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-aw908dzn.js");
214
+ const { cronModuleUrl, RigCronService } = await import("./cron-zhb9hpbs.js");
213
215
  const result = await new RigCronService(this.pathOptions()).add({
214
216
  name,
215
217
  command: commandId,
@@ -221,11 +223,11 @@ class CliApplication {
221
223
  this.printJson(result);
222
224
  });
223
225
  cronCommand.command("remove").argument("<name>", "Cron job name.").description("Remove a scheduled Rig tool command.").action(async (name) => {
224
- const { RigCronService } = await import("./cron-aw908dzn.js");
226
+ const { RigCronService } = await import("./cron-zhb9hpbs.js");
225
227
  this.printJson(await new RigCronService(this.pathOptions()).remove(name));
226
228
  });
227
229
  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-aw908dzn.js");
230
+ const { RigCronService } = await import("./cron-zhb9hpbs.js");
229
231
  const result = await new RigCronService(this.pathOptions()).run(name);
230
232
  this.printJson(result.envelope);
231
233
  process.exitCode = result.exitCode;
@@ -234,7 +236,7 @@ class CliApplication {
234
236
  configureTypecheckCommand() {
235
237
  this.program.command("typecheck").argument("[tool]").description("Type-check local tool files with the injected Rig tool runtime types.").action(async (tool) => {
236
238
  this.requestGeneratedSync();
237
- const { ToolTypecheckService } = await import("./typecheck-971tmqbp.js");
239
+ const { ToolTypecheckService } = await import("./typecheck-c944bvz2.js");
238
240
  const result = await new ToolTypecheckService(this.pathOptions()).typecheck(tool);
239
241
  this.printJson(result);
240
242
  process.exitCode = result.exitCode;
@@ -264,7 +266,7 @@ class CliApplication {
264
266
  configureDevCommands() {
265
267
  const devCommand = this.program.command("dev").description("Local development helpers.");
266
268
  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-e1mj8w17.js");
269
+ const { DevLinkService } = await import("./dev-link-znh4mch1.js");
268
270
  const service = new DevLinkService(this.pathOptions());
269
271
  const status = await service.link({
270
272
  binDir: commandOptions.binDir,
@@ -273,7 +275,7 @@ class CliApplication {
273
275
  console.log(service.renderLinkResult(status));
274
276
  });
275
277
  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-e1mj8w17.js");
278
+ const { DevLinkService } = await import("./dev-link-znh4mch1.js");
277
279
  const service = new DevLinkService(this.pathOptions());
278
280
  const status = await service.unlink({
279
281
  binDir: commandOptions.binDir,
@@ -282,12 +284,12 @@ class CliApplication {
282
284
  console.log(service.renderUnlinkResult(status));
283
285
  });
284
286
  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-e1mj8w17.js");
287
+ const { DevLinkService } = await import("./dev-link-znh4mch1.js");
286
288
  this.printJson(await new DevLinkService(this.pathOptions()).status(commandOptions));
287
289
  });
288
290
  }
289
291
  async runToolCommand(commandId, args, commandOptions) {
290
- const { ToolRunner } = await import("./run-thx15p83.js");
292
+ const { ToolRunner } = await import("./run-mvhmkkfe.js");
291
293
  const commandTarget = this.commandTarget(commandId);
292
294
  const result = await new ToolRunner(this.pathOptions()).run(commandTarget.tool, commandTarget.command, {
293
295
  ...this.pathOptions(),
@@ -301,9 +303,9 @@ class CliApplication {
301
303
  }
302
304
  async showDefaultStatus() {
303
305
  const [{ RigConfigStore }, { RigPaths }, { ToolDiscoveryService }] = await Promise.all([
304
- import("./config-20f90shh.js"),
305
- import("./paths-3vxw7dek.js"),
306
- import("./discover-95bpzy46.js")
306
+ import("./config-72dha2z0.js"),
307
+ import("./paths-4kzahz8f.js"),
308
+ import("./discover-549nzamy.js")
307
309
  ]);
308
310
  const options = this.pathOptions();
309
311
  const paths = new RigPaths(options);
@@ -312,7 +314,10 @@ class CliApplication {
312
314
  const tools = await new ToolDiscoveryService(options).discover();
313
315
  const registries = configStore.registryEntries(config);
314
316
  const currentVersion = this.version();
315
- this.printMigrationNotice(configStore.migrationResult());
317
+ new RigLoggerFactory(options).app("cli").info({ version: currentVersion, tools: tools.length }, "Default status rendered.");
318
+ if (this.printMigrationNotice(configStore.migrationResult())) {
319
+ await configStore.acknowledgeMigrationPrompt();
320
+ }
316
321
  console.log(`Rig is ready.
317
322
  `);
318
323
  console.log(`Version: ${currentVersion}`);
@@ -327,7 +332,7 @@ Run "rig doctor" if you want to verify your setup.`);
327
332
  await this.printUpdateNotice(currentVersion);
328
333
  }
329
334
  async createTool(name) {
330
- const { ToolCreator } = await import("./create-pvym2abv.js");
335
+ const { ToolCreator } = await import("./create-pnsj60ym.js");
331
336
  const result = await new ToolCreator(this.pathOptions()).create(name);
332
337
  console.log(`Created tool ${result.name}`);
333
338
  console.log(`
@@ -347,17 +352,20 @@ Try:`);
347
352
  }
348
353
  async doctor() {
349
354
  const [{ RigConfigStore }, { RigPaths }, { ToolDiscoveryService }] = await Promise.all([
350
- import("./config-20f90shh.js"),
351
- import("./paths-3vxw7dek.js"),
352
- import("./discover-95bpzy46.js")
355
+ import("./config-72dha2z0.js"),
356
+ import("./paths-4kzahz8f.js"),
357
+ import("./discover-549nzamy.js")
353
358
  ]);
354
359
  const options = this.pathOptions();
355
360
  const paths = new RigPaths(options);
356
361
  const configStore = new RigConfigStore(options);
357
362
  const config = await configStore.ensure();
358
- this.printMigrationNotice(configStore.migrationResult());
363
+ if (this.printMigrationNotice(configStore.migrationResult())) {
364
+ await configStore.acknowledgeMigrationPrompt();
365
+ }
359
366
  const registries = configStore.registryEntries(config);
360
367
  const tools = await new ToolDiscoveryService(options).discover();
368
+ new RigLoggerFactory(options).app("doctor").info({ registries: registries.length, tools: tools.length }, "Doctor check completed.");
361
369
  console.log(`Rig doctor
362
370
  `);
363
371
  console.log(`Config: OK ${paths.configPath}`);
@@ -373,7 +381,7 @@ Status: OK`);
373
381
  }
374
382
  printMigrationNotice(migration) {
375
383
  if (!migration)
376
- return;
384
+ return false;
377
385
  if (migration.status === "migrated") {
378
386
  console.log("Rig moved its home folder:");
379
387
  console.log(` From: ${migration.legacyDir}`);
@@ -381,18 +389,20 @@ Status: OK`);
381
389
  if (migration.configUpdated)
382
390
  console.log(" Updated base registry: ~/rig/tools");
383
391
  console.log("");
384
- return;
392
+ return false;
385
393
  }
386
394
  console.log("Rig home folder migration needs your attention:");
387
395
  console.log(` Old folder: ${migration.legacyDir}`);
388
396
  console.log(` New folder: ${migration.currentDir}`);
389
397
  console.log(` Reason: ${migration.reason}`);
390
398
  console.log("Move the files you want to keep into the new folder, then remove the old folder.");
399
+ console.log("This migration prompt is versioned; Rig will not show it again after this run.");
391
400
  console.log("");
401
+ return true;
392
402
  }
393
403
  async printUpdateNotice(currentVersion) {
394
404
  await this.ignoreSyncErrors(async () => {
395
- const { NpmUpdateCheckService } = await import("./update-check-dpkh7hc6.js");
405
+ const { NpmUpdateCheckService } = await import("./update-check-bqa9ejex.js");
396
406
  const notice = await new NpmUpdateCheckService(this.pathOptions()).check(currentVersion);
397
407
  if (notice)
398
408
  console.log(`
@@ -404,13 +414,13 @@ ${notice.message}`);
404
414
  }
405
415
  async syncGeneratedFiles() {
406
416
  await this.ignoreSyncErrors(async () => {
407
- const { ToolRuntimeCommentSyncService } = await import("./runtime-comment-07cpchsr.js");
417
+ const { ToolRuntimeCommentSyncService } = await import("./runtime-comment-n9aft3g5.js");
408
418
  await new ToolRuntimeCommentSyncService(this.pathOptions()).sync();
409
419
  });
410
420
  if (process.env.RIG_AGENT_SYNC === "0")
411
421
  return;
412
422
  await this.ignoreSyncErrors(async () => {
413
- const { AgentInstructionSyncService } = await import("./sync-k2spbt3f.js");
423
+ const { AgentInstructionSyncService } = await import("./sync-javg558s.js");
414
424
  await new AgentInstructionSyncService(this.pathOptions()).sync();
415
425
  });
416
426
  }
@@ -0,0 +1,13 @@
1
+ import {
2
+ ToolRunner
3
+ } from "./cli-eavzwv49.js";
4
+ import"./cli-zbp3334x.js";
5
+ import"./cli-dqz4gvqd.js";
6
+ import"./cli-ahwyqf1f.js";
7
+ import"./cli-043bae8s.js";
8
+ import"./cli-1c7te5cg.js";
9
+ import"./cli-32dzwg3p.js";
10
+ import"./cli-b7jgjgy7.js";
11
+ export {
12
+ ToolRunner
13
+ };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ToolDiscoveryService
3
- } from "./cli-1hm5dxfw.js";
4
- import"./cli-nk194xv0.js";
3
+ } from "./cli-ahwyqf1f.js";
4
+ import"./cli-043bae8s.js";
5
5
  import"./cli-1c7te5cg.js";
6
- import"./cli-13q90bjr.js";
6
+ import"./cli-32dzwg3p.js";
7
7
  import"./cli-b7jgjgy7.js";
8
8
 
9
9
  // src/tools/runtime-comment.ts
@@ -24,6 +24,11 @@ Rig tool runtime:
24
24
  - \`rig.paths.home()\`, \`rig.paths.resolve(cwd, path)\`, \`rig.paths.ensureParent(path)\`, and \`rig.paths.size(path)\` cover common path work.
25
25
  - Add \`env: rig.z.object({ KEY: rig.z.string() })\` to validate a \`.env\` file beside the tool entry file and receive parsed values on \`context.env\`.
26
26
 
27
+ Tool logging and key-value state:
28
+ - Use \`context.log.info(...)\`, \`context.log.warn(...)\`, or another Pino-style method for structured logs with a default \`tool:<tool>.<command>\` prefix.
29
+ - Rig writes app and tool logs to \`~/rig/.logs\`, rolls files by size, and keeps logs for seven days by default.
30
+ - Use \`context.kv.set(key, value)\` and \`context.kv.get(key)\` for lightweight JSON state stored beside the tool entry file as \`kv.sqlite\`.
31
+
27
32
  Tool SQLite database:
28
33
  - Add \`setupDb: (db) => { db.migrate(1, "create table", "create table ..."); }\` when a tool needs persistent state.
29
34
  - Rig stores the database beside the tool entry file as \`index.sqlite\` and runs \`setupDb\` before every command.
@@ -35,6 +40,8 @@ Command run context:
35
40
  - \`context.processEnv\` is the process environment.
36
41
  - \`context.cwd\` is the current working directory.
37
42
  - \`context.db\` is available when the tool defines \`setupDb\`.
43
+ - \`context.kv\` is always available for lightweight JSON key-value state.
44
+ - \`context.log\` is a structured Pino logger for this tool command.
38
45
  - \`context.rig\` is the toolkit (same as the factory \`rig\` arg, useful for nested tool calls).
39
46
  - Return a value that matches the output schema.
40
47
  `;
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  ToolListService
3
- } from "./cli-1354fmns.js";
4
- import"./cli-884hpkjc.js";
5
- import"./cli-f7p31fzm.js";
6
- import"./cli-1hm5dxfw.js";
7
- import"./cli-nk194xv0.js";
3
+ } from "./cli-q2ajq5qe.js";
4
+ import"./cli-zbp3334x.js";
5
+ import"./cli-dqz4gvqd.js";
6
+ import"./cli-ahwyqf1f.js";
7
+ import"./cli-043bae8s.js";
8
8
  import"./cli-1c7te5cg.js";
9
9
  import {
10
10
  RigPaths
11
- } from "./cli-13q90bjr.js";
11
+ } from "./cli-32dzwg3p.js";
12
12
  import"./cli-b7jgjgy7.js";
13
13
 
14
14
  // src/agents/sync.ts
@@ -31,7 +31,9 @@ var RigAgentInstructions = `The \`rig\` CLI is installed on this machine. It all
31
31
  - To remove an existing tool, run \`rig remove <tool>\`.
32
32
  - To list tool registries, run \`rig registry list\`.
33
33
  - To add a registry, run \`rig registry create [path]\` (defaults to current directory).
34
- - If a tool needs persistent state, define \`setupDb\` and use \`context.db\`; Rig stores that SQLite database beside the tool entry file as \`index.sqlite\`.
34
+ - Use \`context.log\` for structured Pino logs with a default tool command prefix; Rig writes logs to \`~/rig/.logs\`, rolls files by size, and keeps seven days.
35
+ - Use \`context.kv.set(key, value)\` and \`context.kv.get(key)\` for lightweight JSON state in \`kv.sqlite\` beside the tool entry file.
36
+ - If a tool needs relational persistent state, define \`setupDb\` and use \`context.db\`; Rig stores that SQLite database beside the tool entry file as \`index.sqlite\`.
35
37
  `;
36
38
 
37
39
  // src/agents/sync.ts
@@ -90,6 +92,7 @@ class AgentInstructionSyncService {
90
92
  }
91
93
  renderBlock(toolList) {
92
94
  return `${StartMarker}
95
+
93
96
  ## Rig local tools
94
97
 
95
98
  ${RigAgentInstructions}
@@ -98,6 +101,7 @@ ${RigAgentInstructions}
98
101
  \`\`\`text
99
102
  ${toolList}
100
103
  \`\`\`
104
+
101
105
  ${EndMarker}`;
102
106
  }
103
107
  async renderToolList(target) {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  ToolLoader
3
- } from "./cli-f7p31fzm.js";
3
+ } from "./cli-dqz4gvqd.js";
4
4
  import {
5
5
  ToolDiscoveryService
6
- } from "./cli-1hm5dxfw.js";
6
+ } from "./cli-ahwyqf1f.js";
7
7
  import {
8
8
  RigConfigStore,
9
9
  RigPackageRoot
10
- } from "./cli-nk194xv0.js";
10
+ } from "./cli-043bae8s.js";
11
11
  import {
12
12
  RigError
13
13
  } from "./cli-1c7te5cg.js";
14
14
  import {
15
15
  RigPaths
16
- } from "./cli-13q90bjr.js";
16
+ } from "./cli-32dzwg3p.js";
17
17
  import {
18
18
  __commonJS,
19
19
  __require,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RigPaths
3
- } from "./cli-13q90bjr.js";
3
+ } from "./cli-32dzwg3p.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.20",
3
+ "version": "0.0.22",
4
4
  "description": "Local typed command runtime for agents.",
5
5
  "homepage": "https://github.com/rendotdev/rig#readme",
6
6
  "bugs": {
@@ -43,6 +43,7 @@
43
43
  "@types/bun": "latest",
44
44
  "bun": "1.3.14",
45
45
  "commander": "latest",
46
+ "pino": "^10.3.1",
46
47
  "typescript": "latest",
47
48
  "zod": "latest"
48
49
  },