@web-auto/camo 0.1.11 → 0.1.12

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/README.md CHANGED
@@ -72,6 +72,25 @@ camo type "#search-input" "hello world" --highlight
72
72
  camo scroll --down --amount 500 --selector ".feed-list"
73
73
  ```
74
74
 
75
+ ## Codex Skill (`camoufox`)
76
+
77
+ This repository includes a Codex skill at `skills/camoufox`.
78
+
79
+ Install or refresh it locally:
80
+
81
+ ```bash
82
+ mkdir -p ~/.codex/skills
83
+ rsync -a ./skills/camoufox/ ~/.codex/skills/camoufox/
84
+ ```
85
+
86
+ Use it in Codex with `$camoufox` (or by asking for camo CLI workflows directly).
87
+
88
+ Layered capability model:
89
+ - Observe/Debug: visible DOM filtering, URL/context checks, devtools eval/logs.
90
+ - User Ops: click/type/scroll/keyboard/tab/window operations with optional highlight.
91
+ - Orchestration: container subscription + autoscript flows.
92
+ - Progress/Recovery: events/status/cleanup for runtime diagnostics.
93
+
75
94
  ## Core Workflows
76
95
 
77
96
  ### 1) Interactive browser session
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web-auto/camo",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Camoufox Browser CLI - Cross-platform browser automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -126,12 +126,23 @@ export function buildSelectorTypeScript({ selector, highlight, text }) {
126
126
  }
127
127
 
128
128
  if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {
129
- el.value = ${textLiteral};
129
+ const prototype = el instanceof HTMLTextAreaElement
130
+ ? window.HTMLTextAreaElement.prototype
131
+ : window.HTMLInputElement.prototype;
132
+ const valueSetter = Object.getOwnPropertyDescriptor(prototype, 'value')?.set;
133
+ if (typeof valueSetter === 'function') {
134
+ valueSetter.call(el, ${textLiteral});
135
+ } else {
136
+ el.value = ${textLiteral};
137
+ }
130
138
  } else if (el instanceof HTMLElement && el.isContentEditable) {
131
139
  el.textContent = ${textLiteral};
132
140
  }
133
141
 
134
- el.dispatchEvent(new Event('input', { bubbles: true }));
142
+ const inputEvent = typeof InputEvent === 'function'
143
+ ? new InputEvent('input', { bubbles: true, cancelable: true, data: ${textLiteral}, inputType: 'insertText' })
144
+ : new Event('input', { bubbles: true, cancelable: true });
145
+ el.dispatchEvent(inputEvent);
135
146
  el.dispatchEvent(new Event('change', { bubbles: true }));
136
147
  if (${highlightLiteral} && el instanceof HTMLElement) {
137
148
  setTimeout(() => { el.style.outline = restoreOutline; }, 260);