@adhdev/daemon-core 0.6.76 → 0.6.77
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.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/daemon/dev-server.ts +10 -8
package/package.json
CHANGED
package/src/daemon/dev-server.ts
CHANGED
|
@@ -2536,14 +2536,16 @@ export class DevServer {
|
|
|
2536
2536
|
lines.push('| Status | When to use | How to detect |');
|
|
2537
2537
|
lines.push('|---|---|---|');
|
|
2538
2538
|
lines.push('| `idle` | AI is NOT generating, no approval needed | Default state. No stop button, no spinners, no approval pills/buttons |');
|
|
2539
|
-
lines.push('| `generating` | AI is actively streaming/thinking | ANY of: (1) Stop/Cancel button visible, (
|
|
2539
|
+
lines.push('| `generating` | AI is actively streaming/thinking | ANY of: (1) Submit button icon SVG changes (e.g. arrow→stop square, fill="none"→fill="currentColor"), (2) Stop/Cancel button visible, (3) CSS animation, (4) Structural markers (aria-labels that only appear during generation) |');
|
|
2540
2540
|
lines.push('| `waiting_approval` | AI stopped and needs user action | Actionable buttons like Run/Skip/Accept/Reject are visible AND clickable |');
|
|
2541
2541
|
lines.push('');
|
|
2542
2542
|
lines.push('### ⚠️ Status Detection Gotchas (MUST READ!)');
|
|
2543
|
-
lines.push('1. **
|
|
2544
|
-
lines.push('2. **
|
|
2545
|
-
lines.push('3. **
|
|
2546
|
-
lines.push('4. **
|
|
2543
|
+
lines.push('1. **DO NOT rely on button text/labels in the user\'s language.** OS locale may be Korean, Japanese, etc. Button text like "Cancel" or "Stop" will be localized. Instead, detect STRUCTURAL indicators: SVG icon changes, CSS classes, aria-labels from the extension\'s own React/Radix UI (which stay in English regardless of OS locale).');
|
|
2544
|
+
lines.push('2. **Use sendMessage to CREATE a generating state, then CAPTURE the DOM.** Send a LONG prompt (e.g. "Write an extremely detailed 5000-word essay...") so the AI takes 10+ seconds. Then periodically capture the DOM during generation to find which elements appear/change. Compare idle vs generating DOM snapshots to find reliable structural markers.');
|
|
2545
|
+
lines.push('3. **Look for SVG icon changes in the submit button.** Many IDEs change the submit button icon from an arrow (send) to a square (stop) during generation. Check the SVG `fill` attribute or path data.');
|
|
2546
|
+
lines.push('4. **FALSE POSITIVES from old messages**: Chat history may contain text like "Command Awaiting Approval" from PAST turns. ONLY match small leaf elements (under 80 chars) or use explicit button/pill selectors.');
|
|
2547
|
+
lines.push('5. **Awaiting Approval pill without actions**: Some IDEs show a floating pill/banner that is just a scroll-to indicator. If NO actionable buttons exist, the status should be `idle`, NOT `waiting_approval`.');
|
|
2548
|
+
lines.push('6. **activeModal must include actions**: When `status` is `waiting_approval`, the `activeModal` object MUST include a non-empty `actions` array.');
|
|
2547
2549
|
lines.push('');
|
|
2548
2550
|
|
|
2549
2551
|
lines.push('## Action');
|
|
@@ -2606,10 +2608,10 @@ export class DevServer {
|
|
|
2606
2608
|
lines.push(`echo "$RESULT" | python3 -c "import sys,json; d=json.load(sys.stdin); r=d.get('result',d); r=json.loads(r) if isinstance(r,str) else r; assert r.get('status')=='idle', f'Expected idle, got {r.get(chr(34)+chr(115)+chr(116)+chr(97)+chr(116)+chr(117)+chr(115)+chr(34))}'; print('Step 1 PASS: status=idle')"`);
|
|
2607
2609
|
lines.push('```');
|
|
2608
2610
|
lines.push('');
|
|
2609
|
-
lines.push('### Step 2: Send a message that triggers generation');
|
|
2611
|
+
lines.push('### Step 2: Send a LONG message that triggers extended generation (10+ seconds)');
|
|
2610
2612
|
lines.push('```bash');
|
|
2611
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/scripts/run -H "Content-Type: application/json" -d '{"script": "sendMessage", "type": "${type}", "ideType": "${type}", "args": {"message": "
|
|
2612
|
-
lines.push('sleep
|
|
2613
|
+
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/scripts/run -H "Content-Type: application/json" -d '{"script": "sendMessage", "type": "${type}", "ideType": "${type}", "args": {"message": "Write an extremely detailed 5000-word essay about the history of artificial intelligence from Alan Turing to 2025. Be very thorough and verbose."}}'`);
|
|
2614
|
+
lines.push('sleep 3');
|
|
2613
2615
|
lines.push('```');
|
|
2614
2616
|
lines.push('');
|
|
2615
2617
|
lines.push('### Step 3: Check generating OR completed');
|