screenhand 0.1.1 → 0.2.0
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 +458 -93
- package/dist/.audit-log.jsonl +55 -0
- package/dist/.screenhand/memory/.lock +1 -0
- package/dist/.screenhand/memory/actions.jsonl +85 -0
- package/dist/.screenhand/memory/errors.jsonl +5 -0
- package/dist/.screenhand/memory/errors.jsonl.bak +4 -0
- package/dist/.screenhand/memory/state.json +35 -0
- package/dist/.screenhand/memory/state.json.bak +35 -0
- package/dist/.screenhand/memory/strategies.jsonl +12 -0
- package/dist/agent/cli.js +73 -0
- package/dist/agent/loop.js +258 -0
- package/dist/config.js +9 -0
- package/dist/index.js +56 -0
- package/dist/logging/timeline-logger.js +29 -0
- package/dist/mcp/mcp-stdio-server.js +448 -0
- package/dist/mcp/server.js +347 -0
- package/dist/mcp-desktop.js +2731 -0
- package/dist/mcp-entry.js +59 -0
- package/dist/memory/recall.js +160 -0
- package/dist/memory/research.js +98 -0
- package/dist/memory/seeds.js +89 -0
- package/dist/memory/session.js +161 -0
- package/dist/memory/store.js +391 -0
- package/dist/memory/types.js +4 -0
- package/dist/monitor/codex-monitor.js +377 -0
- package/dist/monitor/task-queue.js +84 -0
- package/dist/monitor/types.js +49 -0
- package/dist/native/bridge-client.js +174 -0
- package/dist/native/macos-bridge-client.js +5 -0
- package/dist/npm-publish-helper.js +117 -0
- package/dist/npm-token-cdp.js +113 -0
- package/dist/npm-token-create.js +135 -0
- package/dist/npm-token-finish.js +126 -0
- package/dist/playbook/engine.js +193 -0
- package/dist/playbook/index.js +4 -0
- package/dist/playbook/recorder.js +519 -0
- package/dist/playbook/runner.js +392 -0
- package/dist/playbook/store.js +166 -0
- package/dist/playbook/types.js +4 -0
- package/dist/runtime/accessibility-adapter.js +377 -0
- package/dist/runtime/app-adapter.js +48 -0
- package/dist/runtime/applescript-adapter.js +283 -0
- package/dist/runtime/ax-role-map.js +80 -0
- package/dist/runtime/browser-adapter.js +36 -0
- package/dist/runtime/cdp-chrome-adapter.js +505 -0
- package/dist/runtime/composite-adapter.js +205 -0
- package/dist/runtime/executor.js +250 -0
- package/dist/runtime/locator-cache.js +12 -0
- package/dist/runtime/planning-loop.js +47 -0
- package/dist/runtime/service.js +372 -0
- package/dist/runtime/session-manager.js +28 -0
- package/dist/runtime/state-observer.js +105 -0
- package/dist/runtime/vision-adapter.js +208 -0
- package/dist/scripts/codex-monitor-daemon.js +335 -0
- package/dist/scripts/supervisor-daemon.js +272 -0
- package/dist/scripts/worker-daemon.js +228 -0
- package/dist/src/agent/cli.js +82 -0
- package/dist/src/agent/loop.js +274 -0
- package/{src/config.ts → dist/src/config.js} +5 -10
- package/{src/index.ts → dist/src/index.js} +32 -52
- package/dist/src/jobs/manager.js +237 -0
- package/dist/src/jobs/runner.js +683 -0
- package/dist/src/jobs/store.js +102 -0
- package/dist/src/jobs/types.js +30 -0
- package/dist/src/jobs/worker.js +97 -0
- package/dist/src/logging/timeline-logger.js +45 -0
- package/dist/src/mcp/mcp-stdio-server.js +464 -0
- package/dist/src/mcp/server.js +363 -0
- package/dist/src/mcp-entry.js +60 -0
- package/dist/src/memory/recall.js +170 -0
- package/dist/src/memory/research.js +104 -0
- package/dist/src/memory/seeds.js +101 -0
- package/dist/src/memory/service.js +421 -0
- package/dist/src/memory/session.js +169 -0
- package/dist/src/memory/store.js +422 -0
- package/dist/src/memory/types.js +17 -0
- package/dist/src/monitor/codex-monitor.js +382 -0
- package/dist/src/monitor/task-queue.js +97 -0
- package/dist/src/monitor/types.js +62 -0
- package/dist/src/native/bridge-client.js +190 -0
- package/{src/native/macos-bridge-client.ts → dist/src/native/macos-bridge-client.js} +0 -1
- package/dist/src/playbook/engine.js +201 -0
- package/dist/src/playbook/index.js +20 -0
- package/dist/src/playbook/recorder.js +535 -0
- package/dist/src/playbook/runner.js +408 -0
- package/dist/src/playbook/store.js +183 -0
- package/dist/src/playbook/types.js +17 -0
- package/dist/src/runtime/accessibility-adapter.js +393 -0
- package/dist/src/runtime/app-adapter.js +64 -0
- package/dist/src/runtime/applescript-adapter.js +299 -0
- package/dist/src/runtime/ax-role-map.js +96 -0
- package/dist/src/runtime/browser-adapter.js +52 -0
- package/dist/src/runtime/cdp-chrome-adapter.js +521 -0
- package/dist/src/runtime/composite-adapter.js +221 -0
- package/dist/src/runtime/execution-contract.js +159 -0
- package/dist/src/runtime/executor.js +266 -0
- package/{src/runtime/locator-cache.ts → dist/src/runtime/locator-cache.js} +10 -15
- package/dist/src/runtime/planning-loop.js +63 -0
- package/dist/src/runtime/service.js +388 -0
- package/dist/src/runtime/session-manager.js +60 -0
- package/dist/src/runtime/state-observer.js +121 -0
- package/dist/src/runtime/vision-adapter.js +224 -0
- package/dist/src/supervisor/locks.js +186 -0
- package/dist/src/supervisor/supervisor.js +403 -0
- package/dist/src/supervisor/types.js +30 -0
- package/dist/src/test-mcp-protocol.js +154 -0
- package/dist/src/types.js +17 -0
- package/dist/src/util/atomic-write.js +118 -0
- package/dist/test-mcp-protocol.js +138 -0
- package/dist/types.js +1 -0
- package/package.json +18 -4
- package/.claude/commands/automate.md +0 -28
- package/.claude/commands/debug-ui.md +0 -19
- package/.claude/commands/screenshot.md +0 -15
- package/.github/FUNDING.yml +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -27
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.mcp.json +0 -8
- package/DESKTOP_MCP_GUIDE.md +0 -92
- package/SECURITY.md +0 -44
- package/docs/architecture.md +0 -47
- package/install-skills.sh +0 -19
- package/mcp-bridge.ts +0 -271
- package/mcp-desktop.ts +0 -1221
- package/native/macos-bridge/Package.swift +0 -21
- package/native/macos-bridge/Sources/AccessibilityBridge.swift +0 -261
- package/native/macos-bridge/Sources/AppManagement.swift +0 -129
- package/native/macos-bridge/Sources/CoreGraphicsBridge.swift +0 -242
- package/native/macos-bridge/Sources/ObserverBridge.swift +0 -120
- package/native/macos-bridge/Sources/VisionBridge.swift +0 -80
- package/native/macos-bridge/Sources/main.swift +0 -345
- package/native/windows-bridge/AppManagement.cs +0 -234
- package/native/windows-bridge/InputBridge.cs +0 -436
- package/native/windows-bridge/Program.cs +0 -265
- package/native/windows-bridge/ScreenCapture.cs +0 -329
- package/native/windows-bridge/UIAutomationBridge.cs +0 -571
- package/native/windows-bridge/WindowsBridge.csproj +0 -17
- package/playbooks/devpost.json +0 -186
- package/playbooks/instagram.json +0 -41
- package/playbooks/instagram_v2.json +0 -201
- package/playbooks/x_v1.json +0 -211
- package/scripts/devpost-live-loop.mjs +0 -421
- package/src/logging/timeline-logger.ts +0 -55
- package/src/mcp/server.ts +0 -449
- package/src/memory/recall.ts +0 -191
- package/src/memory/research.ts +0 -146
- package/src/memory/seeds.ts +0 -123
- package/src/memory/session.ts +0 -201
- package/src/memory/store.ts +0 -434
- package/src/memory/types.ts +0 -69
- package/src/native/bridge-client.ts +0 -239
- package/src/runtime/accessibility-adapter.ts +0 -487
- package/src/runtime/app-adapter.ts +0 -169
- package/src/runtime/applescript-adapter.ts +0 -376
- package/src/runtime/ax-role-map.ts +0 -102
- package/src/runtime/browser-adapter.ts +0 -129
- package/src/runtime/cdp-chrome-adapter.ts +0 -676
- package/src/runtime/composite-adapter.ts +0 -274
- package/src/runtime/executor.ts +0 -396
- package/src/runtime/planning-loop.ts +0 -81
- package/src/runtime/service.ts +0 -448
- package/src/runtime/session-manager.ts +0 -50
- package/src/runtime/state-observer.ts +0 -136
- package/src/runtime/vision-adapter.ts +0 -297
- package/src/types.ts +0 -297
- package/tests/bridge-client.test.ts +0 -176
- package/tests/browser-stealth.test.ts +0 -210
- package/tests/composite-adapter.test.ts +0 -64
- package/tests/mcp-server.test.ts +0 -151
- package/tests/memory-recall.test.ts +0 -339
- package/tests/memory-research.test.ts +0 -159
- package/tests/memory-seeds.test.ts +0 -120
- package/tests/memory-store.test.ts +0 -392
- package/tests/types.test.ts +0 -92
- package/tsconfig.check.json +0 -17
- package/tsconfig.json +0 -19
- package/vitest.config.ts +0 -8
package/tests/types.test.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, expectTypeOf } from "vitest";
|
|
2
|
-
import type {
|
|
3
|
-
Target,
|
|
4
|
-
WaitCondition,
|
|
5
|
-
ToolName,
|
|
6
|
-
UIEventType,
|
|
7
|
-
SessionInfo,
|
|
8
|
-
AppContext,
|
|
9
|
-
LocatedElement,
|
|
10
|
-
WindowInfo,
|
|
11
|
-
RunningApp,
|
|
12
|
-
} from "../src/types.js";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Type-level tests to ensure the type definitions compile correctly
|
|
16
|
-
* and cover expected shapes. These catch regressions in the public API.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
describe("Type definitions", () => {
|
|
20
|
-
it("Target union covers all locator strategies", () => {
|
|
21
|
-
const selectorTarget: Target = { type: "selector", value: "button.submit" };
|
|
22
|
-
const textTarget: Target = { type: "text", value: "Click me", exact: true };
|
|
23
|
-
const roleTarget: Target = { type: "role", role: "button", name: "Submit" };
|
|
24
|
-
const axPathTarget: Target = { type: "ax_path", path: ["0", "1", "3"] };
|
|
25
|
-
const axAttrTarget: Target = { type: "ax_attribute", attribute: "AXIdentifier", value: "btn1" };
|
|
26
|
-
const coordTarget: Target = { type: "coordinates", x: 100, y: 200 };
|
|
27
|
-
const imageTarget: Target = { type: "image", base64: "abc123", confidence: 0.9 };
|
|
28
|
-
|
|
29
|
-
// All should compile and be assignable
|
|
30
|
-
const targets: Target[] = [
|
|
31
|
-
selectorTarget, textTarget, roleTarget,
|
|
32
|
-
axPathTarget, axAttrTarget, coordTarget, imageTarget,
|
|
33
|
-
];
|
|
34
|
-
expect(targets).toHaveLength(7);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("WaitCondition covers all condition types", () => {
|
|
38
|
-
const conditions: WaitCondition[] = [
|
|
39
|
-
{ type: "selector_visible", selector: ".loaded" },
|
|
40
|
-
{ type: "selector_hidden", selector: ".spinner" },
|
|
41
|
-
{ type: "url_matches", regex: "https://.*" },
|
|
42
|
-
{ type: "text_appears", text: "Success" },
|
|
43
|
-
{ type: "element_exists", target: { type: "text", value: "OK" } },
|
|
44
|
-
{ type: "element_gone", target: { type: "text", value: "Loading" } },
|
|
45
|
-
{ type: "window_title_matches", regex: "Untitled" },
|
|
46
|
-
];
|
|
47
|
-
expect(conditions.length).toBeGreaterThan(0);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it("SessionInfo has required fields", () => {
|
|
51
|
-
const session: SessionInfo = {
|
|
52
|
-
sessionId: "test-123",
|
|
53
|
-
profile: "default",
|
|
54
|
-
createdAt: Date.now(),
|
|
55
|
-
adapterType: "composite",
|
|
56
|
-
};
|
|
57
|
-
expect(session.sessionId).toBe("test-123");
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("AppContext has required fields", () => {
|
|
61
|
-
const ctx: AppContext = {
|
|
62
|
-
bundleId: "com.apple.Notes",
|
|
63
|
-
appName: "Notes",
|
|
64
|
-
pid: 1234,
|
|
65
|
-
windowTitle: "My Note",
|
|
66
|
-
};
|
|
67
|
-
expect(ctx.pid).toBe(1234);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it("WindowInfo has required fields", () => {
|
|
71
|
-
const win: WindowInfo = {
|
|
72
|
-
windowId: 42,
|
|
73
|
-
title: "Test Window",
|
|
74
|
-
appName: "TestApp",
|
|
75
|
-
bundleId: "com.test.app",
|
|
76
|
-
pid: 5678,
|
|
77
|
-
bounds: { x: 0, y: 0, width: 800, height: 600 },
|
|
78
|
-
isOnScreen: true,
|
|
79
|
-
};
|
|
80
|
-
expect(win.windowId).toBe(42);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it("RunningApp has required fields", () => {
|
|
84
|
-
const app: RunningApp = {
|
|
85
|
-
name: "Finder",
|
|
86
|
-
bundleId: "com.apple.finder",
|
|
87
|
-
pid: 100,
|
|
88
|
-
isActive: true,
|
|
89
|
-
};
|
|
90
|
-
expect(app.name).toBe("Finder");
|
|
91
|
-
});
|
|
92
|
-
});
|
package/tsconfig.check.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"lib": ["ES2022"],
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noUncheckedIndexedAccess": true,
|
|
9
|
-
"exactOptionalPropertyTypes": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"noEmit": true
|
|
14
|
-
},
|
|
15
|
-
"include": ["src/**/*.ts", "mcp-desktop.ts", "mcp-bridge.ts"],
|
|
16
|
-
"exclude": ["dist", "node_modules"]
|
|
17
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"lib": ["ES2022"],
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noUncheckedIndexedAccess": true,
|
|
9
|
-
"exactOptionalPropertyTypes": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"rootDir": "src",
|
|
12
|
-
"outDir": "dist",
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"esModuleInterop": true
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*.ts"],
|
|
17
|
-
"exclude": ["dist", "node_modules"]
|
|
18
|
-
}
|
|
19
|
-
|