@rcrsr/rill-ext-claude-code 0.11.0 → 0.16.0

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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
- import { ExtensionConfigSchema, ExtensionResult } from '@rcrsr/rill';
3
+ import { ExtensionConfigSchema, ExtensionManifest, ExtensionResult } from '@rcrsr/rill';
4
4
  import * as pty from 'node-pty';
5
5
 
6
6
  /**
@@ -255,7 +255,8 @@ export declare function createClaudeCodeExtension(config?: ClaudeCodeConfig): Ex
255
255
  *
256
256
  * Extension for executing Claude Code toolkit operations from rill scripts.
257
257
  */
258
- export declare const VERSION = "0.1.0";
258
+ export declare const VERSION: string;
259
259
  export declare const configSchema: ExtensionConfigSchema;
260
+ export declare const extensionManifest: ExtensionManifest;
260
261
 
261
262
  export {};
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ // src/index.ts
2
+ import { createRequire } from "module";
3
+
1
4
  // src/stream-parser.ts
2
5
  var ANSI_ESCAPE_PATTERN = new RegExp(
3
6
  [
@@ -250,7 +253,8 @@ function spawnClaudeCli(prompt, options = {}) {
250
253
  import which from "which";
251
254
  import {
252
255
  RuntimeError as RuntimeError3,
253
- emitExtensionEvent
256
+ emitExtensionEvent,
257
+ rillTypeToTypeValue
254
258
  } from "@rcrsr/rill";
255
259
 
256
260
  // ../../shared/ext-param/dist/param.js
@@ -326,13 +330,15 @@ var p = {
326
330
  * @param name - Parameter name (must be a valid identifier)
327
331
  * @param desc - Optional description
328
332
  * @param def - Optional default value
329
- * @returns RillParam with type 'dict'
333
+ * @param fields - Optional structural field definitions (RillFieldDef with type and optional defaultValue)
334
+ * @returns RillParam with type 'dict' (with fields if provided)
330
335
  */
331
- dict(name, desc, def) {
336
+ dict(name, desc, def, fields) {
332
337
  validateParamName(name);
338
+ const type = fields !== void 0 ? { type: "dict", fields } : { type: "dict" };
333
339
  return {
334
340
  name,
335
- type: { type: "dict" },
341
+ type,
336
342
  defaultValue: def,
337
343
  annotations: buildAnnotations(desc)
338
344
  };
@@ -440,13 +446,15 @@ function createClaudeCodeExtension(config = {}) {
440
446
  prompt: {
441
447
  params: [
442
448
  p.str("text"),
443
- p.dict("options", void 0, {})
449
+ p.dict("options", void 0, {}, {
450
+ timeout: { type: { type: "number" }, defaultValue: 0 }
451
+ })
444
452
  ],
445
453
  fn: async (args, ctx) => {
446
454
  const startTime = Date.now();
447
455
  try {
448
- const text = args[0];
449
- const options = args[1] ?? {};
456
+ const text = args["text"];
457
+ const options = args["options"] ?? {};
450
458
  if (text.trim().length === 0) {
451
459
  throw new RuntimeError3("RILL-R004", "prompt text cannot be empty");
452
460
  }
@@ -493,20 +501,37 @@ function createClaudeCodeExtension(config = {}) {
493
501
  throw error;
494
502
  }
495
503
  },
496
- description: "Execute Claude Code prompt and return result text and token usage",
497
- returnType: { type: "dict" }
504
+ annotations: { description: "Execute Claude Code prompt and return result text and token usage" },
505
+ returnType: rillTypeToTypeValue({
506
+ type: "dict",
507
+ fields: {
508
+ result: { type: { type: "string" } },
509
+ tokens: { type: { type: "dict", fields: {
510
+ prompt: { type: { type: "number" } },
511
+ cacheWrite5m: { type: { type: "number" } },
512
+ cacheWrite1h: { type: { type: "number" } },
513
+ cacheRead: { type: { type: "number" } },
514
+ output: { type: { type: "number" } }
515
+ } } },
516
+ cost: { type: { type: "number" } },
517
+ exitCode: { type: { type: "number" } },
518
+ duration: { type: { type: "number" } }
519
+ }
520
+ })
498
521
  },
499
522
  // IR-3: claude-code::skill
500
523
  skill: {
501
524
  params: [
502
525
  p.str("name"),
503
- p.dict("args", void 0, {})
526
+ p.dict("args", void 0, {}, {
527
+ timeout: { type: { type: "number" }, defaultValue: 0 }
528
+ })
504
529
  ],
505
530
  fn: async (fnArgs, ctx) => {
506
531
  const startTime = Date.now();
507
532
  try {
508
- const name = fnArgs[0];
509
- const args = fnArgs[1] ?? {};
533
+ const name = fnArgs["name"];
534
+ const args = fnArgs["args"] ?? {};
510
535
  if (name.trim().length === 0) {
511
536
  throw new RuntimeError3("RILL-R004", "skill name cannot be empty");
512
537
  }
@@ -557,20 +582,37 @@ function createClaudeCodeExtension(config = {}) {
557
582
  throw error;
558
583
  }
559
584
  },
560
- description: "Execute Claude Code skill with instruction and return structured result",
561
- returnType: { type: "dict" }
585
+ annotations: { description: "Execute Claude Code skill with instruction and return structured result" },
586
+ returnType: rillTypeToTypeValue({
587
+ type: "dict",
588
+ fields: {
589
+ result: { type: { type: "string" } },
590
+ tokens: { type: { type: "dict", fields: {
591
+ prompt: { type: { type: "number" } },
592
+ cacheWrite5m: { type: { type: "number" } },
593
+ cacheWrite1h: { type: { type: "number" } },
594
+ cacheRead: { type: { type: "number" } },
595
+ output: { type: { type: "number" } }
596
+ } } },
597
+ cost: { type: { type: "number" } },
598
+ exitCode: { type: { type: "number" } },
599
+ duration: { type: { type: "number" } }
600
+ }
601
+ })
562
602
  },
563
603
  // IR-4: claude-code::command
564
604
  command: {
565
605
  params: [
566
606
  p.str("name"),
567
- p.dict("args", void 0, {})
607
+ p.dict("args", void 0, {}, {
608
+ timeout: { type: { type: "number" }, defaultValue: 0 }
609
+ })
568
610
  ],
569
611
  fn: async (fnArgs, ctx) => {
570
612
  const startTime = Date.now();
571
613
  try {
572
- const name = fnArgs[0];
573
- const args = fnArgs[1] ?? {};
614
+ const name = fnArgs["name"];
615
+ const args = fnArgs["args"] ?? {};
574
616
  if (name.trim().length === 0) {
575
617
  throw new RuntimeError3("RILL-R004", "command name cannot be empty");
576
618
  }
@@ -621,8 +663,23 @@ function createClaudeCodeExtension(config = {}) {
621
663
  throw error;
622
664
  }
623
665
  },
624
- description: "Execute Claude Code command with task description and return execution summary",
625
- returnType: { type: "dict" }
666
+ annotations: { description: "Execute Claude Code command with task description and return execution summary" },
667
+ returnType: rillTypeToTypeValue({
668
+ type: "dict",
669
+ fields: {
670
+ result: { type: { type: "string" } },
671
+ tokens: { type: { type: "dict", fields: {
672
+ prompt: { type: { type: "number" } },
673
+ cacheWrite5m: { type: { type: "number" } },
674
+ cacheWrite1h: { type: { type: "number" } },
675
+ cacheRead: { type: { type: "number" } },
676
+ output: { type: { type: "number" } }
677
+ } } },
678
+ cost: { type: { type: "number" } },
679
+ exitCode: { type: { type: "number" } },
680
+ duration: { type: { type: "number" } }
681
+ }
682
+ })
626
683
  }
627
684
  };
628
685
  result.dispose = dispose;
@@ -630,18 +687,26 @@ function createClaudeCodeExtension(config = {}) {
630
687
  }
631
688
 
632
689
  // src/index.ts
633
- var VERSION = "0.1.0";
690
+ var _require = createRequire(import.meta.url);
691
+ var _pkg = _require("../package.json");
692
+ var VERSION = _pkg.version;
634
693
  var configSchema = {
635
694
  binaryPath: { type: "string" },
636
695
  defaultTimeout: { type: "number" },
637
696
  dangerouslySkipPermissions: { type: "boolean" },
638
697
  settingSources: { type: "string" }
639
698
  };
699
+ var extensionManifest = {
700
+ factory: createClaudeCodeExtension,
701
+ configSchema,
702
+ version: VERSION
703
+ };
640
704
  export {
641
705
  VERSION,
642
706
  configSchema,
643
707
  createClaudeCodeExtension,
644
708
  createStreamParser,
709
+ extensionManifest,
645
710
  extractResult,
646
711
  spawnClaudeCli
647
712
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rcrsr/rill-ext-claude-code",
3
- "version": "0.11.0",
3
+ "version": "0.16.0",
4
4
  "description": "rill extension for Claude Code CLI integration",
5
5
  "license": "MIT",
6
6
  "author": "Andre Bremer",
@@ -17,11 +17,11 @@
17
17
  "scripting"
18
18
  ],
19
19
  "peerDependencies": {
20
- "@rcrsr/rill": "^0.11.0",
20
+ "@rcrsr/rill": "~0.16.0",
21
21
  "node-pty": "^1.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@rcrsr/rill": "^0.11.0",
24
+ "@rcrsr/rill": "~0.16.0",
25
25
  "@types/node": "^25.3.0",
26
26
  "@types/which": "^3.0.4",
27
27
  "dts-bundle-generator": "^9.5.1",