@rcrsr/claude-code-runner 0.11.0 → 0.11.1

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 (52) hide show
  1. package/dist/index.js +0 -0
  2. package/dist/output/colors.d.ts +3 -2
  3. package/dist/output/colors.d.ts.map +1 -1
  4. package/dist/output/colors.js +19 -21
  5. package/dist/output/colors.js.map +1 -1
  6. package/dist/output/formatter.js +1 -1
  7. package/dist/output/formatter.js.map +1 -1
  8. package/package.json +2 -2
  9. package/dist/core/index.d.ts +0 -2
  10. package/dist/core/index.d.ts.map +0 -1
  11. package/dist/core/index.js +0 -2
  12. package/dist/core/index.js.map +0 -1
  13. package/dist/core/runner.d.ts +0 -22
  14. package/dist/core/runner.d.ts.map +0 -1
  15. package/dist/core/runner.js +0 -100
  16. package/dist/core/runner.js.map +0 -1
  17. package/dist/output/ui-components.d.ts +0 -34
  18. package/dist/output/ui-components.d.ts.map +0 -1
  19. package/dist/output/ui-components.js +0 -158
  20. package/dist/output/ui-components.js.map +0 -1
  21. package/dist/output/ui-renderer.d.ts +0 -18
  22. package/dist/output/ui-renderer.d.ts.map +0 -1
  23. package/dist/output/ui-renderer.js +0 -75
  24. package/dist/output/ui-renderer.js.map +0 -1
  25. package/dist/output/ui-state.d.ts +0 -71
  26. package/dist/output/ui-state.d.ts.map +0 -1
  27. package/dist/output/ui-state.js +0 -131
  28. package/dist/output/ui-state.js.map +0 -1
  29. package/dist/parsers/signals.d.ts +0 -10
  30. package/dist/parsers/signals.d.ts.map +0 -1
  31. package/dist/parsers/signals.js +0 -21
  32. package/dist/parsers/signals.js.map +0 -1
  33. package/dist/script/index.d.ts +0 -8
  34. package/dist/script/index.d.ts.map +0 -1
  35. package/dist/script/index.js +0 -10
  36. package/dist/script/index.js.map +0 -1
  37. package/dist/script/loader.d.ts +0 -13
  38. package/dist/script/loader.d.ts.map +0 -1
  39. package/dist/script/loader.js +0 -66
  40. package/dist/script/loader.js.map +0 -1
  41. package/dist/script/parser.d.ts +0 -63
  42. package/dist/script/parser.d.ts.map +0 -1
  43. package/dist/script/parser.js +0 -349
  44. package/dist/script/parser.js.map +0 -1
  45. package/dist/script/types.d.ts +0 -49
  46. package/dist/script/types.d.ts.map +0 -1
  47. package/dist/script/types.js +0 -5
  48. package/dist/script/types.js.map +0 -1
  49. package/dist/script/variables.d.ts +0 -27
  50. package/dist/script/variables.d.ts.map +0 -1
  51. package/dist/script/variables.js +0 -74
  52. package/dist/script/variables.js.map +0 -1
@@ -1,75 +0,0 @@
1
- /**
2
- * UI renderer for parallel agent display
3
- * Manages 60fps render loop with terminal clear/redraw
4
- */
5
- import { UI_MAX_BOX_WIDTH, UI_MIN_TERMINAL_WIDTH, UI_RENDER_INTERVAL_MS, UI_SPINNER_INTERVAL_MS, } from '../utils/constants.js';
6
- import { terminalLog } from './colors.js';
7
- import { renderAgentBox, renderMainLog } from './ui-components.js';
8
- /**
9
- * Create a UI renderer with 60fps render loop
10
- * @param state - UI state to render
11
- * @returns UIRenderer interface
12
- * @throws {Error} EC-8: Terminal width < 70
13
- */
14
- export function createUIRenderer(state) {
15
- let intervalId = null;
16
- let frameCount = 0;
17
- return {
18
- start() {
19
- // EC-7: Already started → Error
20
- if (intervalId !== null) {
21
- throw new Error('Renderer already running');
22
- }
23
- // EC-8: Terminal width < 70 → Error
24
- const terminalWidth = process.stdout.columns || 80;
25
- if (terminalWidth < UI_MIN_TERMINAL_WIDTH) {
26
- throw new Error(`Terminal width ${terminalWidth} below minimum ${UI_MIN_TERMINAL_WIDTH}`);
27
- }
28
- // Start 60fps render loop (16ms interval)
29
- intervalId = setInterval(() => {
30
- frameCount++;
31
- // Advance spinner every 96ms (every 6 frames)
32
- if (frameCount % (UI_SPINNER_INTERVAL_MS / UI_RENDER_INTERVAL_MS) ===
33
- 0) {
34
- state.spinnerFrame = (state.spinnerFrame + 1) % 4;
35
- }
36
- // Clear terminal and render current state
37
- this.render();
38
- // Stop when all agents complete
39
- const allComplete = Array.from(state.agents.values()).every((agent) => agent.status === 'complete');
40
- if (allComplete && state.agents.size > 0) {
41
- this.stop();
42
- }
43
- }, UI_RENDER_INTERVAL_MS);
44
- },
45
- stop() {
46
- if (intervalId !== null) {
47
- clearInterval(intervalId);
48
- intervalId = null;
49
- }
50
- },
51
- render() {
52
- // Clear terminal
53
- console.clear();
54
- // Calculate box width (terminal width capped at max)
55
- const terminalWidth = process.stdout.columns || 80;
56
- const boxWidth = Math.min(terminalWidth - 2, UI_MAX_BOX_WIDTH);
57
- // Show running agents with box rendering
58
- const runningAgents = Array.from(state.agents.values()).filter((agent) => agent.status === 'running');
59
- for (const agent of runningAgents) {
60
- const boxLines = renderAgentBox(agent, boxWidth);
61
- for (const line of boxLines) {
62
- terminalLog(line);
63
- }
64
- terminalLog(''); // Spacing between boxes
65
- }
66
- // Show main log
67
- const allComplete = runningAgents.length === 0 && state.agents.size > 0;
68
- const logLines = renderMainLog(state.mainLog, allComplete);
69
- for (const line of logLines) {
70
- terminalLog(line);
71
- }
72
- },
73
- };
74
- }
75
- //# sourceMappingURL=ui-renderer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui-renderer.js","sourceRoot":"","sources":["../../src/output/ui-renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AASnE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,UAAU,GAA0B,IAAI,CAAC;IAC7C,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,OAAO;QACL,KAAK;YACH,gCAAgC;YAChC,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,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AC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;YACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,EAAE,gBAAgB,CAAC,CAAC;YAE/D,yCAAyC;YACzC,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAC5D,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CACtC,CAAC;YAEF,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;gBAClC,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBACjD,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;oBAC5B,WAAW,CAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;gBACD,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAwB;YAC3C,CAAC;YAED,gBAAgB;YAChB,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;YACxE,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YAC3D,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;gBAC5B,WAAW,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,71 +0,0 @@
1
- /**
2
- * UI state management for parallel agent display
3
- */
4
- import type { ActiveTask } from '../types/runner.js';
5
- /**
6
- * Entry in the main execution log
7
- */
8
- export interface LogEntry {
9
- timestamp: Date;
10
- agentLabel: string;
11
- agentName: string;
12
- type: 'invocation' | 'tool' | 'completion';
13
- content: string;
14
- duration?: number;
15
- messageCount?: number;
16
- }
17
- /**
18
- * Individual tool call record
19
- */
20
- export interface ToolCallEntry {
21
- toolName: string;
22
- args: string;
23
- timestamp: Date;
24
- }
25
- /**
26
- * State for a single agent/task
27
- */
28
- export interface AgentState {
29
- id: string;
30
- name: string;
31
- description: string;
32
- label: string;
33
- toolCalls: ToolCallEntry[];
34
- messageCount: number;
35
- startTime: number;
36
- status: 'running' | 'complete';
37
- }
38
- /**
39
- * Overall UI state for parallel agent display
40
- */
41
- export interface UIState {
42
- agents: Map<string, AgentState>;
43
- mainLog: LogEntry[];
44
- renderStartTime: number;
45
- spinnerFrame: number;
46
- /** Callback invoked when first agent is registered */
47
- onFirstAgent?: () => void;
48
- }
49
- /**
50
- * Create initial UI state with empty agents and log
51
- */
52
- export declare function createUIState(): UIState;
53
- /**
54
- * Register a new agent in the UI state
55
- * @throws {Error} if agent count exceeds UI_MAX_AGENTS
56
- * @throws {Error} if agent ID already registered
57
- */
58
- export declare function registerAgent(state: UIState, task: ActiveTask, description: string): void;
59
- /**
60
- * Record a tool call for an agent
61
- * @throws {Error} if agent ID not found
62
- * @throws {Error} if tool name empty
63
- */
64
- export declare function recordToolCall(state: UIState, agentId: string, toolName: string, args: string): void;
65
- /**
66
- * Mark agent complete and add completion entry to main log
67
- * @throws {Error} if agent ID not found
68
- * @throws {Error} if agent already complete
69
- */
70
- export declare function completeAgent(state: UIState, agentId: string): void;
71
- //# sourceMappingURL=ui-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui-state.d.ts","sourceRoot":"","sources":["../../src/output/ui-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,YAAY,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,C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
- import { UI_MAX_AGENTS, UI_MAX_DESCRIPTION_LENGTH, UI_MAX_VISIBLE_TOOLS, } from '../utils/constants.js';
5
- /**
6
- * Create initial UI state with empty agents and log
7
- */
8
- export function createUIState() {
9
- return {
10
- agents: new Map(),
11
- mainLog: [],
12
- renderStartTime: Date.now(),
13
- spinnerFrame: 0,
14
- };
15
- }
16
- /**
17
- * Register a new agent in the UI state
18
- * @throws {Error} if agent count exceeds UI_MAX_AGENTS
19
- * @throws {Error} if agent ID already registered
20
- */
21
- export function registerAgent(state, task, description) {
22
- // EC-1: Check agent count limit
23
- if (state.agents.size >= UI_MAX_AGENTS) {
24
- throw new Error('Maximum 10 concurrent agents exceeded');
25
- }
26
- // EC-2: Check for duplicate agent ID
27
- if (state.agents.has(task.id)) {
28
- throw new Error(`Agent ${task.id} already registered`);
29
- }
30
- // Truncate description to 40 characters
31
- const truncatedDescription = description.length > UI_MAX_DESCRIPTION_LENGTH
32
- ? description.slice(0, UI_MAX_DESCRIPTION_LENGTH)
33
- : description;
34
- // Create agent state
35
- const agentState = {
36
- id: task.id,
37
- name: task.name,
38
- description: truncatedDescription,
39
- label: task.label,
40
- toolCalls: [],
41
- messageCount: 0,
42
- startTime: Date.now(),
43
- status: 'running',
44
- };
45
- // Check if this is the first agent (trigger callback before adding)
46
- const isFirstAgent = state.agents.size === 0;
47
- // Add to agents map
48
- state.agents.set(task.id, agentState);
49
- // Trigger callback for first agent
50
- if (isFirstAgent && state.onFirstAgent) {
51
- state.onFirstAgent();
52
- }
53
- // Add invocation entry to main log
54
- const logEntry = {
55
- timestamp: new Date(),
56
- agentLabel: task.label,
57
- agentName: task.name,
58
- type: 'invocation',
59
- content: truncatedDescription,
60
- };
61
- state.mainLog.push(logEntry);
62
- }
63
- /**
64
- * Record a tool call for an agent
65
- * @throws {Error} if agent ID not found
66
- * @throws {Error} if tool name empty
67
- */
68
- export function recordToolCall(state, agentId, toolName, args) {
69
- // EC-3: Check agent ID exists
70
- const agent = state.agents.get(agentId);
71
- if (!agent) {
72
- throw new Error(`Unknown agent: ${agentId}`);
73
- }
74
- // EC-4: Check tool name not empty
75
- if (!toolName || toolName.trim().length === 0) {
76
- throw new Error('Tool name required');
77
- }
78
- // Create tool call entry
79
- const toolCall = {
80
- toolName,
81
- args,
82
- timestamp: new Date(),
83
- };
84
- // Add to agent's tool calls (FIFO management for max 5 visible)
85
- agent.toolCalls.push(toolCall);
86
- // AC-8: Remove oldest if exceeds max visible tools
87
- if (agent.toolCalls.length > UI_MAX_VISIBLE_TOOLS) {
88
- agent.toolCalls.shift();
89
- }
90
- // Add tool call entry to main log
91
- const logEntry = {
92
- timestamp: new Date(),
93
- agentLabel: agent.label,
94
- agentName: agent.name,
95
- type: 'tool',
96
- content: `${toolName}(${args})`,
97
- };
98
- state.mainLog.push(logEntry);
99
- }
100
- /**
101
- * Mark agent complete and add completion entry to main log
102
- * @throws {Error} if agent ID not found
103
- * @throws {Error} if agent already complete
104
- */
105
- export function completeAgent(state, agentId) {
106
- // EC-5: Check agent ID exists
107
- const agent = state.agents.get(agentId);
108
- if (!agent) {
109
- throw new Error(`Unknown agent: ${agentId}`);
110
- }
111
- // EC-6: Check agent not already complete
112
- if (agent.status === 'complete') {
113
- throw new Error(`Agent ${agentId} already completed`);
114
- }
115
- // Calculate duration from agent start time to current time
116
- const duration = Date.now() - agent.startTime;
117
- // Set agent status to 'complete' for renderer to remove box
118
- agent.status = 'complete';
119
- // Add completion entry to main log with duration and message count
120
- const logEntry = {
121
- timestamp: new Date(),
122
- agentLabel: agent.label,
123
- agentName: agent.name,
124
- type: 'completion',
125
- content: 'Complete',
126
- duration,
127
- messageCount: agent.messageCount,
128
- };
129
- state.mainLog.push(logEntry);
130
- }
131
- //# sourceMappingURL=ui-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../../src/output/ui-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,oB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@@ -1,10 +0,0 @@
1
- /**
2
- * Runner signal detection in Claude output
3
- */
4
- import { type RunnerSignal } from '../types/runner.js';
5
- /**
6
- * Detect loop control signals in Claude's text output
7
- * Returns null if no signal found
8
- */
9
- export declare function detectRunnerSignal(text: string): RunnerSignal | null;
10
- //# sourceMappingURL=signals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/parsers/signals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAWpE"}
@@ -1,21 +0,0 @@
1
- /**
2
- * Runner signal detection in Claude output
3
- */
4
- import { RUNNER_SIGNALS } from '../types/runner.js';
5
- /**
6
- * Detect loop control signals in Claude's text output
7
- * Returns null if no signal found
8
- */
9
- export function detectRunnerSignal(text) {
10
- if (text.includes(RUNNER_SIGNALS.REPEAT_STEP)) {
11
- return 'repeat_step';
12
- }
13
- if (text.includes(RUNNER_SIGNALS.BLOCKED)) {
14
- return 'blocked';
15
- }
16
- if (text.includes(RUNNER_SIGNALS.ERROR)) {
17
- return 'error';
18
- }
19
- return null;
20
- }
21
- //# sourceMappingURL=signals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/parsers/signals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AAEvE;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;QAC9C,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Script module - parsing, loading, and variable management
3
- */
4
- export type { CommandLine, ParsedScript, PromptLine, ScriptFrontmatter, ScriptLine, VariableStore, } from './types.js';
5
- export { loadScript } from './loader.js';
6
- export { extractScriptLines, parseCommandLine, parsePromptLine, parseScriptLine, } from './parser.js';
7
- export { captureOutput, createVariableStore, getCaptureLogMessage, getSubstitutionList, substituteVariables, } from './variables.js';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/script/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,aAAa,GACd,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Script module - parsing, loading, and variable management
3
- */
4
- // Loader
5
- export { loadScript } from './loader.js';
6
- // Parser (for direct use if needed)
7
- export { extractScriptLines, parseCommandLine, parsePromptLine, parseScriptLine, } from './parser.js';
8
- // Variables
9
- export { captureOutput, createVariableStore, getCaptureLogMessage, getSubstitutionList, substituteVariables, } from './variables.js';
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/script/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,SAAS;AACT,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,oCAAoC;AACpC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY;AACZ,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Script file loading with frontmatter and argument validation
3
- */
4
- import type { ParsedScript } from './types.js';
5
- /**
6
- * Load and parse a script file
7
- *
8
- * @param scriptFile - Path to the script file
9
- * @param scriptArgs - Arguments passed to the script (for validation only)
10
- * @returns Parsed script with lines and frontmatter
11
- */
12
- export declare function loadScript(scriptFile: string, scriptArgs?: string[]): ParsedScript;
13
- //# sourceMappingURL=loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/script/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAiC,MAAM,YAAY,CAAC;AA+B9E;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,MAAM,EAAO,GACxB,YAAY,CAmCd"}
@@ -1,66 +0,0 @@
1
- /**
2
- * Script file loading with frontmatter and argument validation
3
- */
4
- import * as fs from 'fs';
5
- import { parseFrontmatter } from '../templates/command.js';
6
- import { parseArgumentHint } from '../utils/arguments.js';
7
- import { extractScriptLines, parseScriptLine } from './parser.js';
8
- /**
9
- * Validate script arguments against argument-hint
10
- */
11
- function validateArguments(frontmatter, args) {
12
- const { requiredCount, optionalPositions } = parseArgumentHint(frontmatter.argumentHint);
13
- if (args.length < requiredCount) {
14
- const missing = [];
15
- for (let i = args.length + 1; i <= requiredCount; i++) {
16
- if (!optionalPositions.has(i)) {
17
- missing.push(`$${i}`);
18
- }
19
- }
20
- if (missing.length > 0) {
21
- const hint = frontmatter.argumentHint
22
- ? ` (usage: ${frontmatter.argumentHint})`
23
- : '';
24
- throw new Error(`Missing required arguments: ${missing.join(', ')}${hint}`);
25
- }
26
- }
27
- }
28
- /**
29
- * Load and parse a script file
30
- *
31
- * @param scriptFile - Path to the script file
32
- * @param scriptArgs - Arguments passed to the script (for validation only)
33
- * @returns Parsed script with lines and frontmatter
34
- */
35
- export function loadScript(scriptFile, scriptArgs = []) {
36
- if (!fs.existsSync(scriptFile)) {
37
- throw new Error(`Script not found: ${scriptFile}`);
38
- }
39
- const content = fs.readFileSync(scriptFile, 'utf-8');
40
- // Parse frontmatter (reuse from templates/command.ts)
41
- const { frontmatter: rawFrontmatter, body } = parseFrontmatter(content);
42
- // Convert to ScriptFrontmatter (handle exactOptionalPropertyTypes)
43
- const frontmatter = {};
44
- if (rawFrontmatter.model)
45
- frontmatter.model = rawFrontmatter.model;
46
- if (rawFrontmatter.description)
47
- frontmatter.description = rawFrontmatter.description;
48
- if (rawFrontmatter.argumentHint)
49
- frontmatter.argumentHint = rawFrontmatter.argumentHint;
50
- // Validate arguments
51
- validateArguments(frontmatter, scriptArgs);
52
- // Extract raw lines (handling heredocs)
53
- const rawLines = extractScriptLines(body);
54
- // Parse each line
55
- const lines = rawLines.map((line, index) => {
56
- try {
57
- return parseScriptLine(line);
58
- }
59
- catch (error) {
60
- const msg = error instanceof Error ? error.message : String(error);
61
- throw new Error(`Script parse error on line ${index + 1}: ${msg}`);
62
- }
63
- });
64
- return { lines, frontmatter };
65
- }
66
- //# sourceMappingURL=loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/script/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC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C;IAErD,sDAAsD;IACtD,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAExE,mEAAmE;IACnE,MAAM,WAAW,GAAsB,EAAE,CAAC;IAC1C,IAAI,cAAc,CAAC,KAAK;QAAE,WAAW,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC;IACnE,IAAI,cAAc,CAAC,WAAW;QAC5B,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC;IACvD,IAAI,cAAc,CAAC,YAAY;QAC7B,WAAW,CAAC,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC;IAEzD,qBAAqB;IACrB,iBAAiB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAE3C,wCAAwC;IACxC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAE1C,kBAAkB;IAClB,MAAM,KAAK,GAAiB,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACvD,IAAI,CAAC;YACH,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnE,MAAM,IAAI,KAAK,CAAC,8BAA8B,KAAK,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC"}
@@ -1,63 +0,0 @@
1
- /**
2
- * Script line parser
3
- *
4
- * Parses the new script syntax:
5
- * - prompt("text") -> $var
6
- * - prompt(<<EOF ... EOF) -> $var
7
- * - command("name", ["arg1", "arg2"]) -> $var
8
- */
9
- import type { CommandLine, PromptLine, ScriptLine } from './types.js';
10
- /**
11
- * Parse a quoted string, handling escape sequences
12
- * Returns the parsed string and the position after the closing quote
13
- */
14
- export declare function parseQuotedString(input: string, startPos: number): {
15
- value: string;
16
- endPos: number;
17
- };
18
- /**
19
- * Parse a heredoc block
20
- * Input should start at << position
21
- * Returns the content and position after the closing delimiter
22
- */
23
- export declare function parseHeredoc(input: string, startPos: number): {
24
- value: string;
25
- endPos: number;
26
- };
27
- /**
28
- * Parse an array of strings: ["arg1", "arg2"]
29
- */
30
- export declare function parseStringArray(input: string, startPos: number): {
31
- values: string[];
32
- endPos: number;
33
- };
34
- /**
35
- * Parse capture syntax: -> $varname
36
- * Returns variable name (without $) or undefined
37
- */
38
- export declare function parseCapture(input: string, startPos: number): {
39
- capture?: string;
40
- endPos: number;
41
- };
42
- /**
43
- * Parse a prompt line: prompt("text") or prompt(<<EOF...EOF)
44
- */
45
- export declare function parsePromptLine(input: string): PromptLine;
46
- /**
47
- * Parse a command line: command("name") or command("name", ["args"])
48
- */
49
- export declare function parseCommandLine(input: string): CommandLine;
50
- /**
51
- * Parse a single script line
52
- */
53
- export declare function parseScriptLine(line: string): ScriptLine;
54
- /**
55
- * Check if a line is a comment or empty
56
- */
57
- export declare function isCommentOrEmpty(line: string): boolean;
58
- /**
59
- * Parse script content into lines, handling multi-line heredocs
60
- * Returns raw line strings (not parsed) for further processing
61
- */
62
- export declare function extractScriptLines(content: string): string[];
63
- //# sourceMappingURL=parser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/script/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAOtE;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,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