testchimp-runner-core 0.0.33 → 0.0.35
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/execution-service.d.ts +1 -4
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/execution-service.js +155 -468
- package/dist/execution-service.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/llm-facade.d.ts.map +1 -1
- package/dist/llm-facade.js +7 -7
- package/dist/llm-facade.js.map +1 -1
- package/dist/llm-provider.d.ts +9 -0
- package/dist/llm-provider.d.ts.map +1 -1
- package/dist/model-constants.d.ts +16 -5
- package/dist/model-constants.d.ts.map +1 -1
- package/dist/model-constants.js +17 -6
- package/dist/model-constants.js.map +1 -1
- package/dist/orchestrator/decision-parser.d.ts +18 -0
- package/dist/orchestrator/decision-parser.d.ts.map +1 -0
- package/dist/orchestrator/decision-parser.js +127 -0
- package/dist/orchestrator/decision-parser.js.map +1 -0
- package/dist/orchestrator/index.d.ts +4 -2
- package/dist/orchestrator/index.d.ts.map +1 -1
- package/dist/orchestrator/index.js +15 -2
- package/dist/orchestrator/index.js.map +1 -1
- package/dist/orchestrator/orchestrator-agent.d.ts +17 -22
- package/dist/orchestrator/orchestrator-agent.d.ts.map +1 -1
- package/dist/orchestrator/orchestrator-agent.js +708 -577
- package/dist/orchestrator/orchestrator-agent.js.map +1 -1
- package/dist/orchestrator/orchestrator-prompts.d.ts +32 -0
- package/dist/orchestrator/orchestrator-prompts.d.ts.map +1 -0
- package/dist/orchestrator/orchestrator-prompts.js +737 -0
- package/dist/orchestrator/orchestrator-prompts.js.map +1 -0
- package/dist/orchestrator/page-som-handler.d.ts +106 -0
- package/dist/orchestrator/page-som-handler.d.ts.map +1 -0
- package/dist/orchestrator/page-som-handler.js +1353 -0
- package/dist/orchestrator/page-som-handler.js.map +1 -0
- package/dist/orchestrator/som-types.d.ts +149 -0
- package/dist/orchestrator/som-types.d.ts.map +1 -0
- package/dist/orchestrator/som-types.js +87 -0
- package/dist/orchestrator/som-types.js.map +1 -0
- package/dist/orchestrator/tool-registry.d.ts +2 -0
- package/dist/orchestrator/tool-registry.d.ts.map +1 -1
- package/dist/orchestrator/tool-registry.js.map +1 -1
- package/dist/orchestrator/tools/index.d.ts +5 -1
- package/dist/orchestrator/tools/index.d.ts.map +1 -1
- package/dist/orchestrator/tools/index.js +9 -2
- package/dist/orchestrator/tools/index.js.map +1 -1
- package/dist/orchestrator/tools/refresh-som-markers.d.ts +12 -0
- package/dist/orchestrator/tools/refresh-som-markers.d.ts.map +1 -0
- package/dist/orchestrator/tools/refresh-som-markers.js +64 -0
- package/dist/orchestrator/tools/refresh-som-markers.js.map +1 -0
- package/dist/orchestrator/tools/verify-action-result.d.ts +17 -0
- package/dist/orchestrator/tools/verify-action-result.d.ts.map +1 -0
- package/dist/orchestrator/tools/verify-action-result.js +140 -0
- package/dist/orchestrator/tools/verify-action-result.js.map +1 -0
- package/dist/orchestrator/tools/view-previous-screenshot.d.ts +15 -0
- package/dist/orchestrator/tools/view-previous-screenshot.d.ts.map +1 -0
- package/dist/orchestrator/tools/view-previous-screenshot.js +92 -0
- package/dist/orchestrator/tools/view-previous-screenshot.js.map +1 -0
- package/dist/orchestrator/types.d.ts +49 -1
- package/dist/orchestrator/types.d.ts.map +1 -1
- package/dist/orchestrator/types.js +11 -1
- package/dist/orchestrator/types.js.map +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +40 -34
- package/dist/prompts.js.map +1 -1
- package/dist/scenario-service.d.ts +5 -0
- package/dist/scenario-service.d.ts.map +1 -1
- package/dist/scenario-service.js +17 -0
- package/dist/scenario-service.js.map +1 -1
- package/dist/scenario-worker-class.d.ts +4 -0
- package/dist/scenario-worker-class.d.ts.map +1 -1
- package/dist/scenario-worker-class.js +21 -3
- package/dist/scenario-worker-class.js.map +1 -1
- package/dist/testing/agent-tester.d.ts +35 -0
- package/dist/testing/agent-tester.d.ts.map +1 -0
- package/dist/testing/agent-tester.js +84 -0
- package/dist/testing/agent-tester.js.map +1 -0
- package/dist/testing/ref-translator-tester.d.ts +44 -0
- package/dist/testing/ref-translator-tester.d.ts.map +1 -0
- package/dist/testing/ref-translator-tester.js +104 -0
- package/dist/testing/ref-translator-tester.js.map +1 -0
- package/dist/utils/coordinate-converter.d.ts +32 -0
- package/dist/utils/coordinate-converter.d.ts.map +1 -0
- package/dist/utils/coordinate-converter.js +130 -0
- package/dist/utils/coordinate-converter.js.map +1 -0
- package/dist/utils/hierarchical-selector.d.ts +47 -0
- package/dist/utils/hierarchical-selector.d.ts.map +1 -0
- package/dist/utils/hierarchical-selector.js +212 -0
- package/dist/utils/hierarchical-selector.js.map +1 -0
- package/dist/utils/page-info-retry.d.ts +14 -0
- package/dist/utils/page-info-retry.d.ts.map +1 -0
- package/dist/utils/page-info-retry.js +60 -0
- package/dist/utils/page-info-retry.js.map +1 -0
- package/dist/utils/page-info-utils.d.ts +1 -0
- package/dist/utils/page-info-utils.d.ts.map +1 -1
- package/dist/utils/page-info-utils.js +46 -18
- package/dist/utils/page-info-utils.js.map +1 -1
- package/dist/utils/ref-attacher.d.ts +21 -0
- package/dist/utils/ref-attacher.d.ts.map +1 -0
- package/dist/utils/ref-attacher.js +149 -0
- package/dist/utils/ref-attacher.js.map +1 -0
- package/dist/utils/ref-translator.d.ts +49 -0
- package/dist/utils/ref-translator.d.ts.map +1 -0
- package/dist/utils/ref-translator.js +276 -0
- package/dist/utils/ref-translator.js.map +1 -0
- package/package.json +1 -1
- package/plandocs/BEFORE_AFTER_VERIFICATION.md +148 -0
- package/plandocs/COORDINATE_MODE_DIAGNOSIS.md +144 -0
- package/plandocs/IMPLEMENTATION_STATUS.md +108 -0
- package/plandocs/PHASE_1_COMPLETE.md +165 -0
- package/plandocs/PHASE_1_SUMMARY.md +184 -0
- package/plandocs/PROMPT_OPTIMIZATION_ANALYSIS.md +120 -0
- package/plandocs/PROMPT_SANITY_CHECK.md +120 -0
- package/plandocs/SESSION_SUMMARY_v0.0.33.md +151 -0
- package/plandocs/TROUBLESHOOTING_SESSION.md +72 -0
- package/plandocs/VISUAL_AGENT_EVOLUTION_PLAN.md +396 -0
- package/plandocs/WHATS_NEW_v0.0.33.md +183 -0
- package/plandocs/exploratory-mode-support-v2.plan.md +953 -0
- package/plandocs/exploratory-mode-support.plan.md +928 -0
- package/plandocs/journey-id-tracking-addendum.md +227 -0
- package/src/execution-service.ts +179 -596
- package/src/index.ts +10 -0
- package/src/llm-facade.ts +8 -8
- package/src/llm-provider.ts +11 -1
- package/src/model-constants.ts +17 -5
- package/src/orchestrator/decision-parser.ts +139 -0
- package/src/orchestrator/index.ts +27 -2
- package/src/orchestrator/orchestrator-agent.ts +868 -623
- package/src/orchestrator/orchestrator-prompts.ts +786 -0
- package/src/orchestrator/page-som-handler.ts +1565 -0
- package/src/orchestrator/som-types.ts +188 -0
- package/src/orchestrator/tool-registry.ts +2 -0
- package/src/orchestrator/tools/index.ts +5 -1
- package/src/orchestrator/tools/refresh-som-markers.ts +69 -0
- package/src/orchestrator/tools/verify-action-result.ts +159 -0
- package/src/orchestrator/tools/view-previous-screenshot.ts +103 -0
- package/src/orchestrator/types.ts +95 -4
- package/src/prompts.ts +40 -34
- package/src/scenario-service.ts +20 -0
- package/src/scenario-worker-class.ts +30 -4
- package/src/utils/coordinate-converter.ts +162 -0
- package/src/utils/page-info-retry.ts +65 -0
- package/src/utils/page-info-utils.ts +53 -18
- package/testchimp-runner-core-0.0.35.tgz +0 -0
- /package/{CREDIT_CALLBACK_ARCHITECTURE.md → plandocs/CREDIT_CALLBACK_ARCHITECTURE.md} +0 -0
- /package/{INTEGRATION_COMPLETE.md → plandocs/INTEGRATION_COMPLETE.md} +0 -0
- /package/{VISION_DIAGNOSTICS_IMPROVEMENTS.md → plandocs/VISION_DIAGNOSTICS_IMPROVEMENTS.md} +0 -0
- /package/{RELEASE_0.0.26.md → releasenotes/RELEASE_0.0.26.md} +0 -0
- /package/{RELEASE_0.0.27.md → releasenotes/RELEASE_0.0.27.md} +0 -0
- /package/{RELEASE_0.0.28.md → releasenotes/RELEASE_0.0.28.md} +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
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)
|