testchimp-runner-core 0.0.35 → 0.0.37

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 (81) hide show
  1. package/dist/orchestrator/orchestrator-agent.d.ts.map +1 -1
  2. package/dist/orchestrator/orchestrator-agent.js +7 -4
  3. package/dist/orchestrator/orchestrator-agent.js.map +1 -1
  4. package/dist/orchestrator/orchestrator-prompts.d.ts.map +1 -1
  5. package/dist/orchestrator/orchestrator-prompts.js +73 -15
  6. package/dist/orchestrator/orchestrator-prompts.js.map +1 -1
  7. package/dist/orchestrator/page-som-handler.d.ts +1 -2
  8. package/dist/orchestrator/page-som-handler.d.ts.map +1 -1
  9. package/dist/orchestrator/page-som-handler.js +51 -25
  10. package/dist/orchestrator/page-som-handler.js.map +1 -1
  11. package/package.json +6 -1
  12. package/plandocs/BEFORE_AFTER_VERIFICATION.md +0 -148
  13. package/plandocs/COORDINATE_MODE_DIAGNOSIS.md +0 -144
  14. package/plandocs/CREDIT_CALLBACK_ARCHITECTURE.md +0 -253
  15. package/plandocs/HUMAN_LIKE_IMPROVEMENTS.md +0 -642
  16. package/plandocs/IMPLEMENTATION_STATUS.md +0 -108
  17. package/plandocs/INTEGRATION_COMPLETE.md +0 -322
  18. package/plandocs/MULTI_AGENT_ARCHITECTURE_REVIEW.md +0 -844
  19. package/plandocs/ORCHESTRATOR_MVP_SUMMARY.md +0 -539
  20. package/plandocs/PHASE1_ABSTRACTION_COMPLETE.md +0 -241
  21. package/plandocs/PHASE1_FINAL_STATUS.md +0 -210
  22. package/plandocs/PHASE_1_COMPLETE.md +0 -165
  23. package/plandocs/PHASE_1_SUMMARY.md +0 -184
  24. package/plandocs/PLANNING_SESSION_SUMMARY.md +0 -372
  25. package/plandocs/PROMPT_OPTIMIZATION_ANALYSIS.md +0 -120
  26. package/plandocs/PROMPT_SANITY_CHECK.md +0 -120
  27. package/plandocs/SCRIPT_CLEANUP_FEATURE.md +0 -201
  28. package/plandocs/SCRIPT_GENERATION_ARCHITECTURE.md +0 -364
  29. package/plandocs/SELECTOR_IMPROVEMENTS.md +0 -139
  30. package/plandocs/SESSION_SUMMARY_v0.0.33.md +0 -151
  31. package/plandocs/TROUBLESHOOTING_SESSION.md +0 -72
  32. package/plandocs/VISION_DIAGNOSTICS_IMPROVEMENTS.md +0 -336
  33. package/plandocs/VISUAL_AGENT_EVOLUTION_PLAN.md +0 -396
  34. package/plandocs/WHATS_NEW_v0.0.33.md +0 -183
  35. package/plandocs/exploratory-mode-support-v2.plan.md +0 -953
  36. package/plandocs/exploratory-mode-support.plan.md +0 -928
  37. package/plandocs/journey-id-tracking-addendum.md +0 -227
  38. package/releasenotes/RELEASE_0.0.26.md +0 -165
  39. package/releasenotes/RELEASE_0.0.27.md +0 -236
  40. package/releasenotes/RELEASE_0.0.28.md +0 -286
  41. package/src/auth-config.ts +0 -84
  42. package/src/credit-usage-service.ts +0 -188
  43. package/src/env-loader.ts +0 -103
  44. package/src/execution-service.ts +0 -996
  45. package/src/file-handler.ts +0 -104
  46. package/src/index.ts +0 -432
  47. package/src/llm-facade.ts +0 -821
  48. package/src/llm-provider.ts +0 -53
  49. package/src/model-constants.ts +0 -35
  50. package/src/orchestrator/decision-parser.ts +0 -139
  51. package/src/orchestrator/index.ts +0 -58
  52. package/src/orchestrator/orchestrator-agent.ts +0 -1282
  53. package/src/orchestrator/orchestrator-prompts.ts +0 -786
  54. package/src/orchestrator/page-som-handler.ts +0 -1565
  55. package/src/orchestrator/som-types.ts +0 -188
  56. package/src/orchestrator/tool-registry.ts +0 -184
  57. package/src/orchestrator/tools/check-page-ready.ts +0 -75
  58. package/src/orchestrator/tools/extract-data.ts +0 -92
  59. package/src/orchestrator/tools/index.ts +0 -15
  60. package/src/orchestrator/tools/inspect-page.ts +0 -42
  61. package/src/orchestrator/tools/recall-history.ts +0 -72
  62. package/src/orchestrator/tools/refresh-som-markers.ts +0 -69
  63. package/src/orchestrator/tools/take-screenshot.ts +0 -128
  64. package/src/orchestrator/tools/verify-action-result.ts +0 -159
  65. package/src/orchestrator/tools/view-previous-screenshot.ts +0 -103
  66. package/src/orchestrator/types.ts +0 -291
  67. package/src/playwright-mcp-service.ts +0 -224
  68. package/src/progress-reporter.ts +0 -144
  69. package/src/prompts.ts +0 -842
  70. package/src/providers/backend-proxy-llm-provider.ts +0 -91
  71. package/src/providers/local-llm-provider.ts +0 -38
  72. package/src/scenario-service.ts +0 -252
  73. package/src/scenario-worker-class.ts +0 -1110
  74. package/src/script-utils.ts +0 -203
  75. package/src/types.ts +0 -239
  76. package/src/utils/browser-utils.ts +0 -348
  77. package/src/utils/coordinate-converter.ts +0 -162
  78. package/src/utils/page-info-retry.ts +0 -65
  79. package/src/utils/page-info-utils.ts +0 -285
  80. package/testchimp-runner-core-0.0.35.tgz +0 -0
  81. package/tsconfig.json +0 -19
@@ -1,227 +0,0 @@
1
- # Journey ID Tracking for Prompt-Based Explorations
2
-
3
- ## Journey Identification Strategy
4
-
5
- ### Test-Based Journeys
6
- - **Journey ID**: Test ID (from the test being executed)
7
- - **Journey Name**: Test name (from test metadata)
8
- - Journeys already exist in the database
9
-
10
- ### Prompt-Based Journeys
11
- - **Journey ID**: UUID generated by AppExplorer when creating the journey
12
- - **Journey Name**: Derived from the journey focus prompt
13
- - Journeys must be created and stored before execution
14
-
15
- ---
16
-
17
- ## Implementation Changes to AppExplorer
18
-
19
- ### Add Journey Creation Methods
20
-
21
- **File**: `scriptservice/workers/app-explorer.ts`
22
-
23
- Add helper methods for creating prompt-based journeys:
24
-
25
- ```typescript
26
- /**
27
- * Generate a descriptive journey name from the focus prompt
28
- */
29
- private generateJourneyName(journeyFocusPrompt: string): string {
30
- // Convert prompt to concise journey name
31
- // Examples:
32
- // "Explore Dashboard and test all widgets" → "Dashboard Widgets Exploration"
33
- // "Navigate to Settings and test user profile" → "Settings User Profile Test"
34
-
35
- // Simple implementation: truncate and clean
36
- let name = journeyFocusPrompt
37
- .replace(/^(Explore|Test|Navigate to|Check|Verify)\s+/i, '') // Remove action verbs
38
- .substring(0, 80) // Limit length
39
- .trim();
40
-
41
- // Capitalize first letter
42
- name = name.charAt(0).toUpperCase() + name.slice(1);
43
-
44
- return name;
45
- }
46
-
47
- /**
48
- * Create and store a prompt-based journey in database
49
- * Uses scriptservice's own journey service (ORM/repository layer)
50
- */
51
- private async createPromptBasedJourney(
52
- journeyId: string,
53
- journeyName: string,
54
- journeyFocusPrompt: string
55
- ): Promise<void> {
56
- try {
57
- // Use scriptservice's journey service (ORM/repository)
58
- // Import: import { saveJourney } from '../services/journey-service';
59
- // (or whatever the actual journey service method is called in scriptservice)
60
-
61
- await saveJourney({
62
- id: journeyId,
63
- name: journeyName,
64
- description: journeyFocusPrompt, // Store the full prompt as description
65
- projectId: this.task.projectId,
66
- type: 'PROMPT_BASED_EXPLORATION', // Type already exists in schema
67
- explorationId: this.explorationId, // Link to parent exploration
68
- createdAt: new Date()
69
- });
70
-
71
- logger.info(`Created prompt-based journey: ${journeyId} - ${journeyName}`);
72
- } catch (error) {
73
- logger.error(`Failed to create journey ${journeyId}: ${error}`);
74
- throw error;
75
- }
76
- }
77
- ```
78
-
79
- ### Update runSinglePromptBasedJourney
80
-
81
- ```typescript
82
- /**
83
- * Execute a single prompt-based journey with given focus
84
- */
85
- private async runSinglePromptBasedJourney(
86
- journeyFocusPrompt: string,
87
- testDataPrompt?: string
88
- ): Promise<void> {
89
- // Generate journey ID and name for prompt-based journey
90
- const journeyId = uuidv4(); // NEW: Generate UUID for this journey
91
- const journeyName = this.generateJourneyName(journeyFocusPrompt); // NEW: Derive name from prompt
92
-
93
- logger.info(`Creating prompt-based journey: ${journeyId} - ${journeyName}`);
94
-
95
- // Create and store journey in database via journey service
96
- await this.createPromptBasedJourney(journeyId, journeyName, journeyFocusPrompt);
97
-
98
- // Create journey task
99
- const task: JourneyTask = {
100
- invocationId: uuidv4(),
101
- invocationBatchId: this.explorationId,
102
- projectId: this.task.projectId,
103
- appReleaseId: this.config.webappReleaseVersion ?? "default",
104
- autohealEnabled: false,
105
- sessionRecordApiKey: this.task.sessionRecordApiKey,
106
- ingressEndpoint: await ConfigService.get('test_service_endpoint'),
107
- enableTestchimpSdkOnExec: false,
108
- urlRegexToCapture: ".*",
109
- playwrightConfig: this.config.playwrightConfig,
110
- creditBudget: this.getCreditsForNextJourney(),
111
- bugCaptureSettings: this.config.bugCaptureSettings,
112
- viewportConfig: this.config.viewportConfig,
113
-
114
- // NEW: Journey identification for prompt-based
115
- testId: journeyId, // Use generated journey ID (as testId for compatibility)
116
- testName: { // Use generated journey name
117
- suite: 'Prompt-Based Exploration',
118
- name: journeyName
119
- },
120
-
121
- // Enable journey exploration mode with focused prompt
122
- journeyExplorationMode: {
123
- enabled: true,
124
- journeyFocusPrompt, // Journey-specific focus
125
- testDataPrompt
126
- }
127
- };
128
-
129
- // Use JourneyRunner (handles both test-based and prompt-based)
130
- const runner = new JourneyRunner(
131
- task,
132
- this.onBugsDiscovered.bind(this),
133
- this.onScreenStateVisited.bind(this),
134
- // ... all other callbacks
135
- );
136
-
137
- await runner.run();
138
- }
139
- ```
140
-
141
- ---
142
-
143
- ## Database Schema (No Changes Needed)
144
-
145
- ### Journey Entity
146
-
147
- The journey table **already supports** both test-based and prompt-based journeys (from agentservice implementation). We're simply reusing the existing structure:
148
-
149
- ```typescript
150
- interface Journey {
151
- id: string; // UUID (test ID for test-based, generated for prompt-based)
152
- name: string; // Human-readable name
153
- description?: string; // Full prompt for prompt-based, test description for test-based
154
- projectId: string;
155
- type: 'TEST_BASED' | 'PROMPT_BASED_EXPLORATION'; // Already exists
156
- createdAt: Date;
157
- explorationId?: string; // Link to parent exploration
158
- // ... other existing fields
159
- }
160
- ```
161
-
162
- **No schema changes required** - we'll use existing journey service (ORM/repository) that scriptservice already has.
163
-
164
- ---
165
-
166
- ## Flow Comparison
167
-
168
- ### Test-Based Journey Flow
169
-
170
- ```
171
- AppExplorer (test-based)
172
-
173
- Select test from test tree
174
-
175
- Create JourneyTask with:
176
- - testId: <existing test ID>
177
- - testName: <existing test name>
178
- - journeyExplorationMode: disabled
179
-
180
- JourneyRunner executes test steps
181
- ```
182
-
183
- ### Prompt-Based Journey Flow
184
-
185
- ```
186
- AppExplorer (prompt-based)
187
-
188
- LLM generates journey focus prompt
189
-
190
- Generate journeyId (UUID)
191
- Generate journeyName from prompt
192
-
193
- Create & store journey via journey service (ORM)
194
-
195
- Create JourneyTask with:
196
- - testId: <generated journey ID>
197
- - testName: <generated journey name>
198
- - journeyExplorationMode: enabled
199
- - journeyFocusPrompt: <specific focus>
200
-
201
- JourneyRunner executes autonomously via orchestrator
202
- ```
203
-
204
- ---
205
-
206
- ## Benefits of This Approach
207
-
208
- 1. **Unified Tracking**: Both test-based and prompt-based journeys use the same journey table and reporting infrastructure
209
- 2. **Traceability**: Each prompt-based journey has a unique ID for bug tracking, screen state linking, execution history
210
- 3. **Naming Consistency**: Generated journey names are descriptive and help understand exploration progress
211
- 4. **No Schema Changes**: Reuses existing journey infrastructure - same table, same ORM service
212
- 5. **No Cross-Service Imports**: Uses scriptservice's own journey service (ORM layer) - no dependencies on agentservice (Python)
213
- 6. **Consolidation**: Moves prompt-based exploration from agentservice to scriptservice using runner-core orchestrator
214
- 7. **Code Deduplication**: Removes browser-use dependency, uses same orchestrator for both test-based and prompt-based modes
215
-
216
- ---
217
-
218
- ## Example Journey Names Generated
219
-
220
- | Journey Focus Prompt | Generated Journey Name |
221
- |---------------------|----------------------|
222
- | "Explore Dashboard and test all widgets" | "Dashboard and test all widgets" |
223
- | "Navigate to Settings and test user profile management" | "Settings and test user profile management" |
224
- | "Test all menu options in the navigation bar" | "all menu options in the navigation bar" |
225
- | "Explore admin panel features and permissions" | "admin panel features and permissions" |
226
-
227
- (The `generateJourneyName` method can be enhanced with better NLP to create more concise names)
@@ -1,165 +0,0 @@
1
- # Release 0.0.26 - Fix Orchestrator Reasoning Logs
2
-
3
- ## Summary
4
- Fixed bug where orchestrator reasoning logs (💭 REASONING, 🧠 SELF-REFLECTION, etc.) were not appearing in VS Code output channel due to outputChannel being lost during service recreation.
5
-
6
- ## Bug Fixed
7
-
8
- ### The Problem
9
- Orchestrator reasoning logs were only showing in `console.log()` (debug console), not in:
10
- - ❌ VS Code "TestChimp Agent" output channel
11
- - ❌ Log files
12
-
13
- Users couldn't see what the agent was thinking!
14
-
15
- **Root Cause:**
16
- When `setAuthConfig()` was called, it recreated `ScenarioService`, which lost the `outputChannel` reference. Workers were then created without access to the output channel, causing all orchestrator logs to fall back to `console.log()` only.
17
-
18
- **Call sequence that caused the bug:**
19
- 1. `embeddedService.initialize()` → calls `service.setOutputChannel()` ✅
20
- 2. Then calls `service.setAuthConfig()` which:
21
- - Recreates `ScenarioService` ❌ outputChannel lost!
22
- - Calls `scenarioService.initialize()` → creates workers without outputChannel
23
- 3. Orchestrator logs → `console.log()` only (not visible in output channel)
24
-
25
- ## Solution
26
-
27
- ### Changes in runner-core
28
-
29
- **TestChimpService (`index.ts`):**
30
-
31
- 1. **Store outputChannel** in private field:
32
- ```typescript
33
- private outputChannel?: any; // Store outputChannel to preserve it across service recreations
34
- ```
35
-
36
- 2. **Preserve it in setOutputChannel()**:
37
- ```typescript
38
- setOutputChannel(outputChannel: any): void {
39
- this.outputChannel = outputChannel; // Store for future use
40
- if (typeof this.scenarioService?.setOutputChannel === 'function') {
41
- this.scenarioService.setOutputChannel(outputChannel);
42
- }
43
- }
44
- ```
45
-
46
- 3. **Reapply after service recreation** (in both `setAuthConfig()` and `setBackendUrl()`):
47
- ```typescript
48
- // Reapply outputChannel if we have one (critical for orchestrator logs)
49
- if (this.outputChannel) {
50
- this.scenarioService.setOutputChannel(this.outputChannel);
51
- }
52
- ```
53
-
54
- ### Result
55
-
56
- Now orchestrator logs flow correctly:
57
- ```
58
- Orchestrator (runner-core)
59
- ↓ this.logger?.()
60
- ScenarioWorker.log()
61
- ↓ outputChannel.appendLine()
62
- VS Code Output Channel ✅
63
- ↓ dual-write
64
- Log File ✅
65
- ```
66
-
67
- ## What Now Appears in Output Channel
68
-
69
- **All Environments:**
70
- - ✅ `💭 REASONING: [agent's reasoning]`
71
- - ✅ `🧠 SELF-REFLECTION: [guidance for next iteration]`
72
- - ✅ `💡 Why: [command reasoning]`
73
- - ✅ `🔧 TOOLS: [tool usage]`
74
- - ✅ `🚧 BLOCKER: [blocker detection]`
75
- - ✅ `📝 COMMANDS: [commands to execute]`
76
- - ✅ `✓ [success messages]`
77
- - ✅ `✗ [failure messages]`
78
-
79
- **Development Only:**
80
- - ✅ `💰 Reporting token usage: X + Y`
81
-
82
- **Staging/Production (Suppressed from channel, but in file):**
83
- - ❌ Token usage logs (still tracked, just not displayed)
84
-
85
- ## Testing the Fix
86
-
87
- To verify reasoning logs appear:
88
- 1. Run test generation in VS Code
89
- 2. Check "TestChimp Agent" output channel
90
- 3. Look for `💭 REASONING`, `🧠 SELF-REFLECTION`, etc.
91
- 4. Check log file has complete information
92
-
93
- ## Files Modified
94
-
95
- **runner-core:**
96
- - `/src/index.ts` - Store and reapply outputChannel across service recreations
97
-
98
- **vs-extension:**
99
- - `/package.json` - Updated to use `^0.0.26`
100
-
101
- **github-action:**
102
- - `/package.json` - Updated to use `^0.0.26`
103
-
104
- ## Published to npm
105
-
106
- ```
107
- ✅ Published: testchimp-runner-core@0.0.26
108
- 📦 Package Size: 245.9 kB
109
- 📋 Registry: https://registry.npmjs.org/
110
- 🔢 Files: 166
111
- ```
112
-
113
- ## Verification
114
-
115
- **vs-extension:**
116
- ```
117
- testchimp-vs-extension@0.0.8
118
- └── testchimp-runner-core@0.0.26 ✅
119
- ```
120
-
121
- **github-action:**
122
- ```
123
- testchimp-runner-action@1.0.18
124
- └── testchimp-runner-core@0.0.26 ✅
125
- ```
126
-
127
- ## Build Status
128
-
129
- ✅ **runner-core** - Published to npm
130
- ✅ **vs-extension** - Updated and built (492 KiB)
131
- ✅ **github-action** - Updated and built (1151 KiB)
132
-
133
- ## Backward Compatibility
134
-
135
- ✅ Fully backward compatible
136
- - No API changes
137
- - Only fixes a bug in log routing
138
- - All functionality preserved
139
-
140
- ## Complete Feature Set in 0.0.26
141
-
142
- This version includes all improvements made today:
143
- 1. ✅ Semantic selector preference (getByRole, getByLabel, etc.)
144
- 2. ✅ Playwright expect() assertions instead of manual checks
145
- 3. ✅ Script cleanup feature (removes redundancies)
146
- 4. ✅ Fixed comment placement in generated scripts
147
- 5. ✅ Focused step execution (no extra assertions)
148
- 6. ✅ Environment-aware log filtering (in vs-extension)
149
- 7. ✅ **Orchestrator reasoning logs in output channel** (NEW in 0.0.26)
150
-
151
- ## Next Steps
152
-
153
- For future service recreations, the pattern to follow:
154
- ```typescript
155
- // When recreating a service, reapply stored configuration:
156
- if (this.logger) {
157
- this.newService.setLogger(this.logger);
158
- }
159
- if (this.outputChannel) {
160
- this.newService.setOutputChannel(this.outputChannel);
161
- }
162
- ```
163
-
164
- This ensures configuration persists across service lifecycles.
165
-
@@ -1,236 +0,0 @@
1
- # Release 0.0.27 - Clean Logs and Credit Callback Architecture
2
-
3
- ## Summary
4
- Major cleanup of logging architecture with timestamps moved to consumers, minimal initialization logs, credit callback support for server-side integration, and version read from package.json.
5
-
6
- ## Changes in 0.0.27
7
-
8
- ### 1. Timestamps at Consumer Level
9
- **Architecture Fix:**
10
- - ❌ Before: runner-core added timestamps
11
- - ✅ After: Consumer adds timestamps in their timezone
12
-
13
- **runner-core:**
14
- - Removed all timestamp formatting
15
- - Reports raw messages via callbacks
16
-
17
- **vs-extension:**
18
- - Added `formatLocalTimestamp()` utility function
19
- - Wraps outputChannel to add timestamps automatically
20
- - Format: `HH:MM:SS.mmm` in local timezone
21
-
22
- ### 2. Minimal Initialization Logs
23
- **Before:**
24
- ```
25
- 🤖 Initializing Orchestrator Mode
26
- ✓ Orchestrator initialized with 5 tools (DEBUG MODE)
27
- ═══════════════════════════════════════════════════════
28
- 🚀 RUNNER-CORE VERSION: v1.5.0-vision-preserve-values
29
- ═══════════════════════════════════════════════════════
30
- Initializing Scenario worker...
31
- Scenario worker initialized with session: scenario_worker_XXX
32
- Scenario worker initialized (Orchestrator Mode) with session...
33
- Scenario service initialized
34
- ```
35
-
36
- **After:**
37
- ```
38
- testchimp-runner-core v0.0.27
39
- 📋 Processing scenario: [scenario description]
40
- ```
41
-
42
- **Changes:**
43
- - Single version log (reads from package.json)
44
- - No internal initialization details
45
- - Clean, minimal output
46
-
47
- ### 3. Credit Callback Architecture
48
- **Purpose:** Allow server-side integration to update DB directly without axios calls
49
-
50
- **Implementation:**
51
- ```typescript
52
- export interface CreditUsage {
53
- credits: number;
54
- usageReason: CreditUsageReason;
55
- jobId?: string;
56
- timestamp: number;
57
- }
58
-
59
- export type CreditUsageCallback = (usage: CreditUsage) => void | Promise<void>;
60
- ```
61
-
62
- **Behavior:**
63
- 1. **If callback provided** (server-side):
64
- - ✅ Call callback → Direct DB update
65
- - ❌ NO axios calls made
66
-
67
- 2. **If NO callback but auth configured** (client-side):
68
- - ❌ No callback
69
- - ✅ Makes axios call to backend API
70
-
71
- 3. **If neither** (development):
72
- - Logs warning
73
- - Continues without tracking
74
-
75
- **Usage:**
76
- ```typescript
77
- // Server-side
78
- const service = new TestChimpService(
79
- fileHandler, undefined, backendUrl, maxWorkers,
80
- llmProvider, progressReporter, orchestratorOptions,
81
- async (creditUsage) => {
82
- await db.insertCreditUsage(creditUsage); // Direct DB
83
- }
84
- );
85
-
86
- // Client-side (vs-ext, github-action)
87
- const service = new TestChimpService(
88
- fileHandler, authConfig, backendUrl
89
- // No callback - uses axios
90
- );
91
- ```
92
-
93
- ### 4. Wrapped OutputChannel
94
- **Problem:** runner-core wrote directly to outputChannel without timestamps
95
-
96
- **Solution:** vs-extension wraps the outputChannel:
97
- ```typescript
98
- const wrappedChannel = {
99
- appendLine: (message) => {
100
- const timestamp = formatLocalTimestamp();
101
- const shouldLog = isDev || !isVerboseDebugLog;
102
- if (shouldLog) {
103
- this.outputChannel?.appendLine(`[${timestamp}] ${message}`);
104
- }
105
- }
106
- };
107
- service.setOutputChannel(wrappedChannel);
108
- ```
109
-
110
- **Result:**
111
- - ✅ All logs get timestamps
112
- - ✅ Filtering applied
113
- - ✅ Consumer controls presentation
114
-
115
- ### 5. Dynamic Version in build_local.sh
116
- **Before:**
117
- ```bash
118
- cp testchimp-runner-core-0.0.22.tgz . # Hardcoded!
119
- ```
120
-
121
- **After:**
122
- ```bash
123
- RUNNER_VERSION=$(node -p "require('./package.json').version")
124
- TARBALL_NAME="testchimp-runner-core-${RUNNER_VERSION}.tgz"
125
- cp "$PARENT_DIR/runner-core/${TARBALL_NAME}" .
126
- ```
127
-
128
- **Benefit:** Always uses correct version, no manual updates needed
129
-
130
- ## New Exports
131
-
132
- ```typescript
133
- export {
134
- // Credit usage types
135
- CreditUsageCallback,
136
- CreditUsage,
137
- CreditUsageReason,
138
-
139
- // Existing exports...
140
- TestChimpService,
141
- // ...
142
- }
143
- ```
144
-
145
- ## Files Modified
146
-
147
- ### runner-core
148
- 1. `/src/scenario-worker-class.ts` - Removed timestamps, minimal logs, version from package.json
149
- 2. `/src/scenario-service.ts` - Removed initialization logs
150
- 3. `/src/credit-usage-service.ts` - Added callback architecture, callback-first logic
151
- 4. `/src/index.ts` - Credit callback support, preserve across recreations
152
-
153
- ### vs-extension
154
- 1. `/src/embedded-service.ts` - `formatLocalTimestamp()` utility, wrapped outputChannel, consistent filtering
155
- 2. `/build_local.sh` - Dynamic version detection
156
- 3. `/package.json` - Updated to `^0.0.27`
157
-
158
- ### github-action
159
- 1. `/package.json` - Updated to `^0.0.27`
160
-
161
- ## Published to npm
162
-
163
- ```
164
- ✅ Published: testchimp-runner-core@0.0.27
165
- 📦 Package Size: ~245 kB
166
- 📋 Registry: https://registry.npmjs.org/
167
- ```
168
-
169
- ## Benefits
170
-
171
- ### Logging
172
- 1. **Local Timezone** - Timestamps match user's clock
173
- 2. **Clean Output** - Only essential information
174
- 3. **Consumer Control** - Consumer decides format and filtering
175
- 4. **No Verbose Init** - Single version log instead of 10+ lines
176
-
177
- ### Credit Tracking
178
- 1. **Server-Side** - Direct DB updates, no HTTP overhead
179
- 2. **Client-Side** - Existing axios behavior preserved
180
- 3. **Flexible** - Each consumer decides how to track
181
- 4. **Observable** - Callback provides visibility
182
-
183
- ### Architecture
184
- 1. **Separation of Concerns** - Library reports, consumer presents
185
- 2. **Environment Agnostic** - Library doesn't assume timezone/environment
186
- 3. **Testable** - Easy to mock callbacks
187
- 4. **Maintainable** - Clear boundaries
188
-
189
- ## Migration
190
-
191
- ### For All Consumers
192
- Update package.json:
193
- ```json
194
- {
195
- "dependencies": {
196
- "testchimp-runner-core": "^0.0.27"
197
- }
198
- }
199
- ```
200
-
201
- ### For Server-Side (Optional)
202
- Add credit callback:
203
- ```typescript
204
- const service = new TestChimpService(
205
- fileHandler, undefined, backendUrl, maxWorkers,
206
- llmProvider, progressReporter, orchestratorOptions,
207
- async (creditUsage) => {
208
- await creditRepository.insert(creditUsage);
209
- }
210
- );
211
- ```
212
-
213
- ## Backward Compatibility
214
-
215
- ✅ Fully backward compatible
216
- - All parameters optional
217
- - Existing behavior preserved
218
- - No breaking changes
219
-
220
- ## Complete Feature Set
221
-
222
- All improvements from today are now in 0.0.27:
223
- 1. ✅ Semantic selector preference
224
- 2. ✅ Playwright expect() assertions
225
- 3. ✅ Script cleanup feature
226
- 4. ✅ Fixed comment placement
227
- 5. ✅ Focused step execution
228
- 6. ✅ Orchestrator reasoning logs in output channel
229
- 7. ✅ Environment-aware log filtering (consumer-side)
230
- 8. ✅ Local timezone timestamps
231
- 9. ✅ Clean initialization logs
232
- 10. ✅ Credit callback architecture
233
- 11. ✅ Version from package.json
234
-
235
- Ready for production! 🚀
236
-