| name | cucp-computer-use |
| description | Use the local CUCP (Computer Use Control Plane) CLI from any Codex / Claude / Electron app project to observe, ground, and operate the user's Windows desktop at Claude Computer Use grade. Single entry point is scripts/cucp.ps1. Trigger on cucp, CUP, computer use, computer-use, Windows control, desktop control, appshot, snapshot, live benchmark, desktop benchmark, screen control, GUI automation, PC/app control, or whenever the user asks Codex to inspect, click, type, drag, scroll, switch apps, follow a goal, or autonomously operate the local Windows desktop. v2.3.0 macros include version, daemon, mouse-verify, cdp-prosemirror-insert, cdp-deep-find, modal-detect, recovery-plan, recovery-run, precision-validate, benchmark, release-notes, ime-paste, safe-type-ime, recorder, audit-summary, and policy-check.
|
CUCP Computer Use (Claude-grade)
CUCP wrapper:
powershell -NoProfile -ExecutionPolicy Bypass -File C:\Users\K\.codex\skills\cucp-computer-use\scripts\cucp.ps1 [-AllowLiveControl] [-Brief] [-Quiet] [-CacheSeconds <n>] [-InvokeTimeoutMs <n>] <args>
ํต์ฌ 4๊ฐ์ง:
- Unified observation envelope (
cucp.observation/v1) โ windows/find-label/list-affordances/health-quick/log-tail๊ฐ ๊ฐ์ schema/sources/provenance/cache/recoverable_errors ๋ฐํ
- Win32 deterministic fallback โ helper๊ฐ ๋น ๊ฒฐ๊ณผ์ฌ๋
macro windows๋ EnumWindows๋ก ํญ์ ๋ตํจ
- Selector ranking + ambiguity โ find-label์ exact / substring / role / source-confidence ์ ์ ์ ๋ ฌ, ๋๋ฅ (ยฑ10) ์ partial(2).
--explain ์ผ๋ก ๊ทผ๊ฑฐ ๋
ธ์ถ
- Composite macros โ ๋ผ๋ฒจ ๋งค์นญ, ์๊ฐ ๊ฒ์ฆ, ์์จ ๋ชฉํ, working memory
์์ธ ๋ช
๋ น์ references/command-reference.md, ์ง๋จยท๋ณต๊ตฌยท์
๋ ํฐ ์ ์ํยทperf ํด์์ references/troubleshooting.md.
When to Activate
- ๊ด์ฐฐ: "์ง๊ธ ํ๋ฉด ๋ญ์ผ", "์ด ์ฑ ์ํ ๋ด์ค", "appshot ์ฐ์ด์ค", "์๋์ฐ ๋ชฉ๋ก"
- ์กฐ์: "ํ์ธ ๋ฒํผ ํด๋ฆญ", "์ด๋ฆ ํ๋์ ์
๋ ฅ", "๋ฉ๋ชจ์ฅ ์ผ๊ณ hello ์จ์ค"
- ์์จ: "Notepad ์ด๊ณ ์ ์ฅ๊น์ง ํด์ค", "X ๋ฉ๋ด ๋ค์ด๊ฐ์ Y ์ค์ ๋ฐ๊ฟ์ค"
Operating Loop
Observe โ Think โ Act โ Verify. ๋ชจ๋ ๋ผ์ด๋ธ ์์
์ ์ด 4๋จ๊ณ๋ก:
- Observe:
macro windows (Win32) ๋๋ macro find-label --explain
- Think: envelope์
foreground, windows[], top ํ๋ณด, ambiguous ํ๋๊ทธ๋ก ๊ฒฐ์
- Act:
macro click-label / fill-label / shortcut ์ฐ์ , ์ขํ๋ fallback (--after ํ์)
- Verify: ์งํ
macro windows ๋๋ find-label. focus ๋์์ macro focus-verify
๋ณต๊ตฌ: recoverable_errors[].recommended_action ๊ทธ๋๋ก ๋ฐ๋ผ๊ฐ๊ธฐ. helper ๋น ์๋ต โ win32 fallback (degraded_helper_empty=true).
Safety Defaults
- ๊ธฐ๋ณธ read-only:
observe *, macro windows / find-label / list-affordances / health-quick / health-detail / metrics / perf / log-tail / trajectory / wait-window / wait-label
- ๋ผ์ด๋ธ ์ปจํธ๋กค์ ๋ชจ๋
-AllowLiveControl ํ์: act *, app switch, plan run, scenario run --execute, desktop benchmark *, l5 run/resume, ๋ชจ๋ actuation ๋งคํฌ๋ก (click-label, fill-label, focus-window, focus-verify, shortcut, goal, app-launch/close/with-app, auto-do, vision-click, click-and-verify)
- ์ขํ ๊ธฐ๋ฐ act์
--after <observation-id> ๊ฐ์
- UAC, ๋น๋ฐ๋ฒํธ, ๊ฒฐ์ , ์๊ฒฉ์ฆ๋ช
์ ์ฌ์ฉ์ ๋ช
์ ํ๋ฝ ํ๋ง
- helper ๋ฉ์ถค ๋ณดํธ ์ต์
์ Wrapper Flags ์ฐธ๊ณ
Low-lag operating pattern (Codex + Electron app ๋์ ์ฌ์ฉ)
๊ธด ์ธ์
์์ Codex/Electron app ๋ฐ์คํฌํฑ ์ฑ์ด ๋๋ ค์ง ์ ์์ด์. ๊ถ์ฅ:
- ์์ฃผ ์ฐ๋ read-only๋
macro windows, macro health-quick (helper ์ ๋ถ๋ฆ)
- ๋ฐ๋ณต screenshot/vision-click ํผํ๊ธฐ, ํ์ํ๋ฉด
--no-vision
- ๊ธด ์ธ์
์์ ์
macro cleanup --dry-run ์ผ๋ก wrapper-cache ์ ๊ฒ โ ํ์์ --execute
macro perf --iters 1 (full) ์ ์ ์ฒด Pester ๋ ์ธํฐ๋ํฐ๋ธ ์์
์ค์ ํผํ๊ธฐ (validate ์์ ์๋ง)
- ์ค์ lag ๋ฐ์ ์
macro diagnose-lag --sample-ms 3000 ์ผ๋ก evidence ์์ง ํ ์๋ ์กฐ์น
- ์์ธํ ๊ฐ์ด๋:
references/troubleshooting.md
Quickstart Macros
& <wrapper> macro windows # Win32 fallback, brief
& <wrapper> macro windows --rich --json-only # helper ํตํฉ envelope JSON
& <wrapper> macro find-label --label "ํ์ธ" --explain # ํ๋ณด + ์ ์
& <wrapper> macro smart-plan --label "Save" --allow-cdp # read-only route planner (CDP/UIA/OCR)
& <wrapper> macro smart-plan --label "Save" --match "Electron app" --precision-points # planner can recommend micro-refined click-point route
& <wrapper> macro smart-plan --label "Message" --type-text "hello" --allow-cdp # read-only input planner
& <wrapper> macro app-profile --match "Chrome" --label "Send" --label "Subject" --auto-probe # read-only app profile and capability probes
& <wrapper> macro workflow-plan --step "macro hit-test --x 1200 --y 720 --fast" --step "macro form-plan --field Message=hello" # read-only multi-step workflow plan
& <wrapper> macro workflow-run --step "macro hit-test --x 1200 --y 720 --fast" --step "macro windows" # run read-only workflow without live control
& <wrapper> macro workflow-run --observe-after-step --step "macro hit-test --x 1200 --y 720 --fast" # execute read-only step, then capture a cheap window observation
& <wrapper> macro workflow-run --verify-label-after-step "Saved" --verify-label-timeout-ms 1000 --step "macro windows" # verify a UI label after each step
& <wrapper> macro workflow-run --retry-failed-step 2 --retry-delay-ms 100 --step "macro windows --match Notepad" # bounded retry for flaky read-only step
& <wrapper> macro workflow-run --dry-run --step "macro hit-test --x 1200 --y 720 --fast" --step "macro click-point --x 1200 --y 720 --target-match Electron app" # gated macro sequence dry-run
& <wrapper> macro task-preset --kind document --text "meeting notes" --replace --save # read-only document preset, emits task-plan/task-run commands
& <wrapper> macro task-preset --kind mail --to "a@example.com" --subject "Report" --body "Done" --send-label "Send" --match Gmail # read-only mail preset
& <wrapper> macro task-plan --app chrome --wait-title Chrome --field "To=a@example.com" --field "Subject=Report" --send-label "Send" --allow-cdp --precision-points # read-only app/form workflow planner
& <wrapper> macro task-plan --app notepad --wait-title Notepad --type-text "meeting notes" --shortcut "ctrl+s" # app + free text + keyboard workflow planner
& <wrapper> macro task-run --dry-run --app chrome --wait-title Chrome --field "To=a@example.com" --field "Subject=Report" --send-label "Send" --allow-cdp --precision-points --settle-ms 150 --verify-after-step --verify-match Chrome --retry-failed-step 1 # validate task-plan with per-step verification/retry options
& <wrapper> macro task-run --dry-run --pre-shortcut "ctrl+a" --type-text "draft" --match Notepad --enter # validate guarded text workflow before live control
& <wrapper> macro form-plan --field "To=a@example.com" --field "Subject=Report" --field "Body=Done" --send-label "Send" --allow-cdp # read-only mail/document workflow planner
& <wrapper> -AllowLiveControl macro form-run --field "To=a@example.com" --field "Subject=Report" --field "Body=Done" --send-label "Send" --allow-cdp # execute only if form-plan is fully safe
& <wrapper> macro hit-test --x 1200 --y 720 --target-match Electron app --fast # fast Win32-only point guard
& <wrapper> macro hit-test-batch --points "1200,720;1210,720;1220,720" --target-match Electron app # fast multi-point guard
& <wrapper> macro hit-scan --x 1200 --y 720 --radius 4 --step 2 --target-match Electron app # read-only micro coordinate scan
& <wrapper> macro coord-profile --x 1200 --y 720 --target-match Electron app # read-only DPI/monitor/window coordinate profile
& <wrapper> macro coord-map --from window --x 40 --y 24 --target-match Electron app # read-only window/screen/normalized coordinate transform
& <wrapper> macro coord-anchor --x 1200 --y 720 --target-match Electron app # read-only reusable layout-relative coordinate anchor
& <wrapper> macro coord-anchor --x 1200 --y 720 --target-match Electron app --record-history # optionally remember verified anchors for reuse scoring
& <wrapper> macro point-plan --x 1200 --y 720 --radius 6 --step 2 --target-match Electron app --cache-ttl 2 # read-only precision click plan with short TTL cache
& <wrapper> macro target-validate --x 1200 --y 720 --target-match Electron app --min-confidence medium # read-only pre-click small target safety check
& <wrapper> macro find-label --label "X" --match "App" --fast # Win32 fast no-match
& <wrapper> macro icon-find --label "send" --max-size 64 # ์์ toolbar ์์ด์ฝ ์ ์ฉ (synonym mining)
& <wrapper> macro list-affordances --window "์ค์ " --limit 20
& <wrapper> -AllowLiveControl macro click-label --label "Save" # icon-find โ vision ์๋ fallback
& <wrapper> -AllowLiveControl macro smart-click --label "Save" --match "Electron app" --allow-mouse-fallback --precision-points # cascade click with micro-refined UIA coordinate fallback
& <wrapper> -AllowLiveControl macro click-point --x 1200 --y 720 --target-match Electron app --refine uia-safe # guarded raw coordinate click
& <wrapper> -AllowLiveControl macro click-point --x 1200 --y 720 --target-match Electron app --micro-refine --precision-radius 6 --precision-step 2 # live click with pre-click micro scan
& <wrapper> -AllowLiveControl macro icon-click --label "send" --max-size 64
& <wrapper> -AllowLiveControl macro vision-click-precise --describe "purple send arrow" --crop-size 320
& <wrapper> -AllowLiveControl macro fill-label --label "Name" --text "Alice" --clear --enter
& <wrapper> -AllowLiveControl macro shortcut --keys "ctrl+s"
& <wrapper> -AllowLiveControl macro focus-verify --name "Notepad"
& <wrapper> -AllowLiveControl macro with-app --name "๋ฉ๋ชจ์ฅ" --wait-title "๋ฉ๋ชจ์ฅ" --hold-ms 2000 --close-after
& <wrapper> -AllowLiveControl macro auto-do --label "Save" --max-attempts 3 --verify-label "Saved"
์์ ์์ด์ฝ ์ ํ๋: click-label ์ fusion ์คํจ ์ ์๋์ผ๋ก icon-find (UIA tooltip/AutomationId/AccessKey ๊ธฐ๋ฐ) โ vision ์์๋ก fallback. toolbar ์์ด์ฝ (16~32px) ๋ ํ ๋ฒ์ ์กํ. vision-click-precise ๋ crop-and-refine 2๋จ๊ณ๋ก ๋ ์ ํ.
OCR (Windows.Media.Ocr โ ๋ธ๋ผ์ฐ์ ์บ๋ฒ์ค / ์ด๋ฏธ์ง ํ๋ฉด์ฉ): macro ocr-image --path <png> / macro ocr-screen --region x,y,w,h / macro ocr-find-text --text "Send" --match contains|fuzzy --target-match <window> / -AllowLiveControl macro ocr-click --text "Send" --min-score 70. OCR candidates include line/word/2~3-word n-grams, but single-word searches skip n-grams for lower lag and tie-break toward smaller word/ngram boxes for steadier click coordinates. smart-click keeps fast UIA paths ahead of OCR history by default (--prefer-history to override, --no-ocr to disable). references/command-reference.md ์ OCR ์น์
์ฐธ๊ณ .
OCR+UIA fusion + screen verify + history: macro ocr-uia-fuse --text "Send" (fusion ๊ฐ์ด๋, read-only) / -AllowLiveControl macro ocr-uia-invoke --text "Send" (Name ๋น์ด๋ AutomationId ๋ก invoke) / macro screenshot-diff --before a.png --after b.png [--ignore-region "x,y,w,h"] / smart-click --verify-screen-changed --retry-on-no-change 2 / macro history stats / show / clear (--no-history ๋ก ๋นํ์ฑ). OCR/icon fallback clicks use ClickRefine uia-safe: just before the physical click, CUCP checks the UIA element under the point and may shift to Windows UIA's native ClickablePoint first, then a safe rect center fallback, while preserving target-window hit-test guards.
hit-test guard + Electron/Chrome CDP: macro hit-test --x N --y N --target-match Electron app (์ขํ ๊ฒ์ฆ + UIA ๋ณด์ ํ๋ณด ํ์) / safe-type (Win32 ์ฑ์ฉ). CDP/DOM: macro cdp-detect / cdp-eval --expr / -AllowLiveControl macro cdp-type --selector "textarea" --text "msg" --press-enter / cdp-smart-click --text "Send" / cdp-smart-type --label "Message" --text "msg" (DOM ์ง์ ). smart-click --allow-cdp ๋๋ --cdp-page-match๋ก Stage 0 opt-in. ํ์ฑํ: --remote-debugging-port=9222 (references/cdp-setup.md).
DOM bridge v2 + IME + recovery + benchmark + packaging:
# DOM bridge v2 traversal report (Shadow DOM + iframe)
& <wrapper> macro cdp-deep-find --text "Send" --page-match Electron app
# ํ๊ตญ์ด IME-safe paste (live)
& <wrapper> -AllowLiveControl macro ime-paste --text "์๋
" --target-match Notepad --press-enter
& <wrapper> -AllowLiveControl macro safe-type-ime --text "ํ์๋ก" --target-match Notepad --verify-title Notepad
# UI recovery loop (์คํจ ํ ์ฌ๊ด์ฐฐ + retry ์ถ์ฒ)
& <wrapper> macro modal-detect
& <wrapper> macro recovery-plan --failed-step "macro click-label --label Save"
& <wrapper> macro recovery-run --dry-run # plan only, no actuation
& <wrapper> -AllowLiveControl macro recovery-run --confirm-sensitive # actuate (sensitive gate)
# Coordinate precision validation (read-only)
& <wrapper> macro precision-validate --x 1200 --y 720 --target-match Electron app --samples 5
# Benchmark suite (read-only, PII ๋ฏธ์์ง)
& <wrapper> macro benchmark --iters 3
# Release notes (CHANGELOG ์๋ split + secret redact)
& <wrapper> macro release-notes
& <wrapper> macro release-notes --version 1.4.0 --json-only
& <wrapper> macro release-notes --since 1.3.0 --json-only
๋ณด์ ๋ณด์: release-notes ์ถ๋ ฅ ์ง์ GitHub PAT / OpenAI sk- / AWS AKIA / Bearer / JWT / PEM 6์ข
์๋ redact ([REDACTED:tag]). recovery-run ์ live action ์ --confirm-sensitive ๊ฐ์ . benchmark ์ธก์ ๊ฒฐ๊ณผ์ ์
๋ ฅ ํ
์คํธ/PII ๋ฏธํฌํจ.
Diagnostics & Performance
& <wrapper> macro self-test --deep
& <wrapper> macro health-quick # ~500ms, helper ์ ๋ถ๋ฆ + temp/log ์๋ ฅ + recent timeouts
& <wrapper> macro health-detail # 7-component, helper HTTP ํฌํจ
& <wrapper> macro metrics
& <wrapper> macro perf --iters 1 --quick # 7 cheap targets, ~3์ด, slo[]/budgets ํฌํจ
& <wrapper> macro perf --iters 1 # 12 targets, helper ํฌํจ (๋๋ฆผ, validate ์ฉ)
& <wrapper> macro log-tail --lines 50 --max-bytes 65536 --errors-only # bounded read + secret redact
& <wrapper> macro diagnose-lag --sample-ms 3000 # Codex/Electron app/Chrome/node ํ๋ก์ธ์ค + ๊ฒฝ๊ณ
& <wrapper> macro cleanup --dry-run # CUCP temp ์ ๋ฆฌ ๋ฏธ๋ฆฌ๋ณด๊ธฐ
& <wrapper> macro cleanup --execute --older-than-minutes 30 --keep-latest 50
& <wrapper> macro trajectory show --last 20
& <wrapper> macro session info
& <wrapper> macro session clear-cache
& <wrapper> macro ensure-helper
Wrapper Flags
-AllowLiveControl: ๋ผ์ด๋ธ actuation ํ์ฉ
-Brief: ํ ์ค ๊ฒฐ๊ณผ (๋ชจ๋ธ ๋ฃจํ์ฉ)
-Quiet: ์ง๋จ ๋ฉ์์ง ์ต์
-CacheSeconds <n> (๊ธฐ๋ณธ 2): appshot ์บ์ TTL, 0=๋นํ์ฑ
-InvokeTimeoutMs <n> (๊ธฐ๋ณธ 30000): ๋จ์ผ CLI ํธ์ถ ํ์์์, ๋ง๋ฃ ์ exit 124. envelope์ command_id/elapsed_ms/recommended_action ํฌํจ
Plans / Scenarios / Benchmarks
์ํ: plans/notepad-hello-world.json. ํ๋ฆ: plan validate โ dry-run โ readiness --strict โ preflight โ run --readiness --strict-readiness --preflight. ๋ชจ๋ ์ต์
์ references/command-reference.md.
Standardized Exit Codes
0=ok, 1=generic/not_found, 2=partial/ambiguous/appshot_failed/no_window, 3=safety blocked (live-control gate, missing --after, label not found), 124=timeout. CI/CD: 0๋ง ํต๊ณผ, 2๋ ๊ฒํ , 3์ ์งํ ๊ธ์ง, 124๋ helper restart ํ ์ฌ์๋.
Regression Tests
Invoke-Pester C:\Users\K\.codex\skills\cucp-computer-use\tests\cucp.Tests.ps1
Audit Trail
%TEMP%\computer-use-control-plane\ ์๋ (cucp-wrapper.log, wrapper-cache/, trajectory.ndjson, screenshots/). ์์ ์ด๋: macro log-tail (token/password/Bearer/JWT ์๋ ๋ง์คํน).
Response Style
์๋ต ํ๊ตญ์ด, ๋ช
๋ น ์ค๋ํซ ์์ด ์๋ฌธ. ๋ผ์ด๋ธ ์ read-only/live ์ฌ๋ถ ๋ช
์. ๋งคํฌ๋ก ์ฐ์ . ๋ผ์ด๋ธ ํ trajectory/observation_id๋ก ๊ฒ์ฆ.