usecomputer 0.1.1 → 0.1.2
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/CHANGELOG.md +5 -0
- package/dist/bridge-contract.test.js +3 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +0 -60
- package/dist/darwin-arm64/usecomputer.node +0 -0
- package/dist/darwin-x64/usecomputer.node +0 -0
- package/dist/linux-x64/usecomputer.node +0 -0
- package/package.json +1 -1
- package/src/bridge-contract.test.ts +3 -3
- package/src/cli.ts +0 -62
- package/zig/src/lib.zig +2 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
All notable changes to `usecomputer` will be documented in this file.
|
|
6
6
|
|
|
7
|
+
## 0.1.2
|
|
8
|
+
|
|
9
|
+
1. **Removed all unimplemented command stubs** — 18 placeholder commands (`snapshot`, `get text/title/value/bounds/focused`, `window focus/resize/move/minimize/maximize/close`, `app list/launch/quit`, `wait`, `find`, `diff snapshot/screenshot`) that only threw "TODO not implemented" have been removed. The CLI now only exposes commands that actually work.
|
|
10
|
+
2. **Clipboard errors clarified** — clipboard commands now return "not supported on this platform" instead of "TODO not implemented".
|
|
11
|
+
|
|
7
12
|
## 0.1.1
|
|
8
13
|
|
|
9
14
|
1. **Fixed Linux native builds** — standalone executable now links libc correctly on Linux, fixing "C allocator is only available when linking against libc" errors.
|
|
@@ -61,8 +61,8 @@ describe('native bridge contract', () => {
|
|
|
61
61
|
expect(typeof firstWindow.ownerName).toBe('string');
|
|
62
62
|
expect(typeof firstWindow.desktopIndex).toBe('number');
|
|
63
63
|
}
|
|
64
|
-
// -- Clipboard (
|
|
65
|
-
await expect(bridge.clipboardSet({ text: 'bridge-contract-test' })).rejects.toThrow(
|
|
66
|
-
await expect(bridge.clipboardGet()).rejects.toThrow(
|
|
64
|
+
// -- Clipboard (not supported on this platform yet) --
|
|
65
|
+
await expect(bridge.clipboardSet({ text: 'bridge-contract-test' })).rejects.toThrow(/not (supported|implemented)/);
|
|
66
|
+
await expect(bridge.clipboardGet()).rejects.toThrow(/not (supported|implemented)/);
|
|
67
67
|
});
|
|
68
68
|
});
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAmC,iBAAiB,EAAc,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAmC,iBAAiB,EAAc,MAAM,YAAY,CAAA;AA6NhG,wBAAgB,SAAS,CAAC,EAAE,MAAuB,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAO,2BAqYzF;AAED,wBAAgB,MAAM,IAAI,IAAI,CAG7B"}
|
package/dist/cli.js
CHANGED
|
@@ -172,9 +172,6 @@ function printWindowList({ windows }) {
|
|
|
172
172
|
printLine(line);
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
-
function notImplemented({ command }) {
|
|
176
|
-
throw new Error(`TODO not implemented: ${command}`);
|
|
177
|
-
}
|
|
178
175
|
export function createCli({ bridge = createBridge() } = {}) {
|
|
179
176
|
const cli = goke('usecomputer');
|
|
180
177
|
cli
|
|
@@ -511,24 +508,6 @@ export function createCli({ bridge = createBridge() } = {}) {
|
|
|
511
508
|
.action(async (text) => {
|
|
512
509
|
await bridge.clipboardSet({ text });
|
|
513
510
|
});
|
|
514
|
-
cli.command('snapshot').action(() => {
|
|
515
|
-
notImplemented({ command: 'snapshot' });
|
|
516
|
-
});
|
|
517
|
-
cli.command('get text <target>').action(() => {
|
|
518
|
-
notImplemented({ command: 'get text' });
|
|
519
|
-
});
|
|
520
|
-
cli.command('get title <target>').action(() => {
|
|
521
|
-
notImplemented({ command: 'get title' });
|
|
522
|
-
});
|
|
523
|
-
cli.command('get value <target>').action(() => {
|
|
524
|
-
notImplemented({ command: 'get value' });
|
|
525
|
-
});
|
|
526
|
-
cli.command('get bounds <target>').action(() => {
|
|
527
|
-
notImplemented({ command: 'get bounds' });
|
|
528
|
-
});
|
|
529
|
-
cli.command('get focused').action(() => {
|
|
530
|
-
notImplemented({ command: 'get focused' });
|
|
531
|
-
});
|
|
532
511
|
cli.command('window list').option('--json', 'Output as JSON').action(async (options) => {
|
|
533
512
|
const windows = await bridge.windowList();
|
|
534
513
|
if (options.json) {
|
|
@@ -537,45 +516,6 @@ export function createCli({ bridge = createBridge() } = {}) {
|
|
|
537
516
|
}
|
|
538
517
|
printWindowList({ windows });
|
|
539
518
|
});
|
|
540
|
-
cli.command('window focus <target>').action(() => {
|
|
541
|
-
notImplemented({ command: 'window focus' });
|
|
542
|
-
});
|
|
543
|
-
cli.command('window resize <target> <width> <height>').action(() => {
|
|
544
|
-
notImplemented({ command: 'window resize' });
|
|
545
|
-
});
|
|
546
|
-
cli.command('window move <target> <x> <y>').action(() => {
|
|
547
|
-
notImplemented({ command: 'window move' });
|
|
548
|
-
});
|
|
549
|
-
cli.command('window minimize <target>').action(() => {
|
|
550
|
-
notImplemented({ command: 'window minimize' });
|
|
551
|
-
});
|
|
552
|
-
cli.command('window maximize <target>').action(() => {
|
|
553
|
-
notImplemented({ command: 'window maximize' });
|
|
554
|
-
});
|
|
555
|
-
cli.command('window close <target>').action(() => {
|
|
556
|
-
notImplemented({ command: 'window close' });
|
|
557
|
-
});
|
|
558
|
-
cli.command('app list').action(() => {
|
|
559
|
-
notImplemented({ command: 'app list' });
|
|
560
|
-
});
|
|
561
|
-
cli.command('app launch <name>').action(() => {
|
|
562
|
-
notImplemented({ command: 'app launch' });
|
|
563
|
-
});
|
|
564
|
-
cli.command('app quit <name>').action(() => {
|
|
565
|
-
notImplemented({ command: 'app quit' });
|
|
566
|
-
});
|
|
567
|
-
cli.command('wait <target>').action(() => {
|
|
568
|
-
notImplemented({ command: 'wait' });
|
|
569
|
-
});
|
|
570
|
-
cli.command('find <query>').action(() => {
|
|
571
|
-
notImplemented({ command: 'find' });
|
|
572
|
-
});
|
|
573
|
-
cli.command('diff snapshot').action(() => {
|
|
574
|
-
notImplemented({ command: 'diff snapshot' });
|
|
575
|
-
});
|
|
576
|
-
cli.command('diff screenshot').action(() => {
|
|
577
|
-
notImplemented({ command: 'diff screenshot' });
|
|
578
|
-
});
|
|
579
519
|
cli.help();
|
|
580
520
|
cli.version(packageJson.version);
|
|
581
521
|
return cli;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -73,8 +73,8 @@ describe('native bridge contract', () => {
|
|
|
73
73
|
expect(typeof firstWindow.desktopIndex).toBe('number')
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// -- Clipboard (
|
|
77
|
-
await expect(bridge.clipboardSet({ text: 'bridge-contract-test' })).rejects.toThrow(
|
|
78
|
-
await expect(bridge.clipboardGet()).rejects.toThrow(
|
|
76
|
+
// -- Clipboard (not supported on this platform yet) --
|
|
77
|
+
await expect(bridge.clipboardSet({ text: 'bridge-contract-test' })).rejects.toThrow(/not (supported|implemented)/)
|
|
78
|
+
await expect(bridge.clipboardGet()).rejects.toThrow(/not (supported|implemented)/)
|
|
79
79
|
})
|
|
80
80
|
})
|
package/src/cli.ts
CHANGED
|
@@ -239,10 +239,6 @@ function printWindowList({ windows }: { windows: WindowInfo[] }) {
|
|
|
239
239
|
})
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
function notImplemented({ command }: { command: string }): never {
|
|
243
|
-
throw new Error(`TODO not implemented: ${command}`)
|
|
244
|
-
}
|
|
245
|
-
|
|
246
242
|
export function createCli({ bridge = createBridge() }: { bridge?: UseComputerBridge } = {}) {
|
|
247
243
|
const cli = goke('usecomputer')
|
|
248
244
|
|
|
@@ -621,24 +617,6 @@ export function createCli({ bridge = createBridge() }: { bridge?: UseComputerBri
|
|
|
621
617
|
await bridge.clipboardSet({ text })
|
|
622
618
|
})
|
|
623
619
|
|
|
624
|
-
cli.command('snapshot').action(() => {
|
|
625
|
-
notImplemented({ command: 'snapshot' })
|
|
626
|
-
})
|
|
627
|
-
cli.command('get text <target>').action(() => {
|
|
628
|
-
notImplemented({ command: 'get text' })
|
|
629
|
-
})
|
|
630
|
-
cli.command('get title <target>').action(() => {
|
|
631
|
-
notImplemented({ command: 'get title' })
|
|
632
|
-
})
|
|
633
|
-
cli.command('get value <target>').action(() => {
|
|
634
|
-
notImplemented({ command: 'get value' })
|
|
635
|
-
})
|
|
636
|
-
cli.command('get bounds <target>').action(() => {
|
|
637
|
-
notImplemented({ command: 'get bounds' })
|
|
638
|
-
})
|
|
639
|
-
cli.command('get focused').action(() => {
|
|
640
|
-
notImplemented({ command: 'get focused' })
|
|
641
|
-
})
|
|
642
620
|
cli.command('window list').option('--json', 'Output as JSON').action(async (options) => {
|
|
643
621
|
const windows = await bridge.windowList()
|
|
644
622
|
if (options.json) {
|
|
@@ -647,46 +625,6 @@ export function createCli({ bridge = createBridge() }: { bridge?: UseComputerBri
|
|
|
647
625
|
}
|
|
648
626
|
printWindowList({ windows })
|
|
649
627
|
})
|
|
650
|
-
cli.command('window focus <target>').action(() => {
|
|
651
|
-
notImplemented({ command: 'window focus' })
|
|
652
|
-
})
|
|
653
|
-
cli.command('window resize <target> <width> <height>').action(() => {
|
|
654
|
-
notImplemented({ command: 'window resize' })
|
|
655
|
-
})
|
|
656
|
-
cli.command('window move <target> <x> <y>').action(() => {
|
|
657
|
-
notImplemented({ command: 'window move' })
|
|
658
|
-
})
|
|
659
|
-
cli.command('window minimize <target>').action(() => {
|
|
660
|
-
notImplemented({ command: 'window minimize' })
|
|
661
|
-
})
|
|
662
|
-
cli.command('window maximize <target>').action(() => {
|
|
663
|
-
notImplemented({ command: 'window maximize' })
|
|
664
|
-
})
|
|
665
|
-
cli.command('window close <target>').action(() => {
|
|
666
|
-
notImplemented({ command: 'window close' })
|
|
667
|
-
})
|
|
668
|
-
cli.command('app list').action(() => {
|
|
669
|
-
notImplemented({ command: 'app list' })
|
|
670
|
-
})
|
|
671
|
-
cli.command('app launch <name>').action(() => {
|
|
672
|
-
notImplemented({ command: 'app launch' })
|
|
673
|
-
})
|
|
674
|
-
cli.command('app quit <name>').action(() => {
|
|
675
|
-
notImplemented({ command: 'app quit' })
|
|
676
|
-
})
|
|
677
|
-
cli.command('wait <target>').action(() => {
|
|
678
|
-
notImplemented({ command: 'wait' })
|
|
679
|
-
})
|
|
680
|
-
cli.command('find <query>').action(() => {
|
|
681
|
-
notImplemented({ command: 'find' })
|
|
682
|
-
})
|
|
683
|
-
cli.command('diff snapshot').action(() => {
|
|
684
|
-
notImplemented({ command: 'diff snapshot' })
|
|
685
|
-
})
|
|
686
|
-
cli.command('diff screenshot').action(() => {
|
|
687
|
-
notImplemented({ command: 'diff screenshot' })
|
|
688
|
-
})
|
|
689
|
-
|
|
690
628
|
cli.help()
|
|
691
629
|
cli.version(packageJson.version)
|
|
692
630
|
return cli
|
package/zig/src/lib.zig
CHANGED
|
@@ -197,10 +197,6 @@ fn failData(comptime T: type, command: []const u8, code: []const u8, message: []
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
fn todoNotImplemented(command: []const u8) CommandResult {
|
|
201
|
-
return failCommand(command, "TODO_NOT_IMPLEMENTED", "TODO not implemented");
|
|
202
|
-
}
|
|
203
|
-
|
|
204
200
|
pub const Point = struct {
|
|
205
201
|
x: f64,
|
|
206
202
|
y: f64,
|
|
@@ -1187,12 +1183,12 @@ pub fn windowList() DataResult([]const u8) {
|
|
|
1187
1183
|
}
|
|
1188
1184
|
|
|
1189
1185
|
pub fn clipboardGet() DataResult([]const u8) {
|
|
1190
|
-
return failData([]const u8, "clipboard-get", "
|
|
1186
|
+
return failData([]const u8, "clipboard-get", "NOT_SUPPORTED", "clipboard-get is not supported on this platform");
|
|
1191
1187
|
}
|
|
1192
1188
|
|
|
1193
1189
|
pub fn clipboardSet(input: ClipboardSetInput) CommandResult {
|
|
1194
1190
|
_ = input;
|
|
1195
|
-
return
|
|
1191
|
+
return failCommand("clipboard-set", "NOT_SUPPORTED", "clipboard-set is not supported on this platform");
|
|
1196
1192
|
}
|
|
1197
1193
|
|
|
1198
1194
|
pub fn typeText(input: TypeTextInput) CommandResult {
|