@zenalexa/unicli 0.223.4 → 0.224.1
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/AGENTS.md +5 -5
- package/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/adapters/marxists-cn/archive.d.ts +61 -0
- package/dist/adapters/marxists-cn/archive.d.ts.map +1 -0
- package/dist/adapters/marxists-cn/archive.js +861 -0
- package/dist/adapters/marxists-cn/archive.js.map +1 -0
- package/dist/adapters/twitter/lists-extra.d.ts +17 -1
- package/dist/adapters/twitter/lists-extra.d.ts.map +1 -1
- package/dist/adapters/twitter/lists-extra.js +123 -21
- package/dist/adapters/twitter/lists-extra.js.map +1 -1
- package/dist/adapters/twitter/post.js +1 -0
- package/dist/adapters/twitter/post.js.map +1 -1
- package/dist/adapters/twitter/thread.d.ts +13 -1
- package/dist/adapters/twitter/thread.d.ts.map +1 -1
- package/dist/adapters/twitter/thread.js +76 -33
- package/dist/adapters/twitter/thread.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/architecture.d.ts +21 -0
- package/dist/commands/architecture.d.ts.map +1 -0
- package/dist/commands/architecture.js +47 -0
- package/dist/commands/architecture.js.map +1 -0
- package/dist/commands/compute.d.ts.map +1 -1
- package/dist/commands/compute.js +31 -6
- package/dist/commands/compute.js.map +1 -1
- package/dist/commands/doctor-compute.d.ts.map +1 -1
- package/dist/commands/doctor-compute.js +88 -1
- package/dist/commands/doctor-compute.js.map +1 -1
- package/dist/compute/action-execution.d.ts +30 -0
- package/dist/compute/action-execution.d.ts.map +1 -0
- package/dist/compute/action-execution.js +112 -0
- package/dist/compute/action-execution.js.map +1 -0
- package/dist/compute/capture-reference.d.ts.map +1 -1
- package/dist/compute/capture-reference.js +6 -1
- package/dist/compute/capture-reference.js.map +1 -1
- package/dist/compute/capture.d.ts +2 -0
- package/dist/compute/capture.d.ts.map +1 -1
- package/dist/compute/capture.js +6 -1
- package/dist/compute/capture.js.map +1 -1
- package/dist/compute/cursor-visual-style.d.ts +35 -0
- package/dist/compute/cursor-visual-style.d.ts.map +1 -0
- package/dist/compute/cursor-visual-style.js +39 -0
- package/dist/compute/cursor-visual-style.js.map +1 -0
- package/dist/compute/linux-overlay.d.ts +38 -0
- package/dist/compute/linux-overlay.d.ts.map +1 -0
- package/dist/compute/linux-overlay.js +274 -0
- package/dist/compute/linux-overlay.js.map +1 -0
- package/dist/compute/macos-overlay.d.ts +64 -0
- package/dist/compute/macos-overlay.d.ts.map +1 -0
- package/dist/compute/macos-overlay.js +590 -0
- package/dist/compute/macos-overlay.js.map +1 -0
- package/dist/compute/overlay-daemon.d.ts +47 -0
- package/dist/compute/overlay-daemon.d.ts.map +1 -0
- package/dist/compute/overlay-daemon.js +206 -0
- package/dist/compute/overlay-daemon.js.map +1 -0
- package/dist/compute/overlay.d.ts +42 -0
- package/dist/compute/overlay.d.ts.map +1 -0
- package/dist/compute/overlay.js +111 -0
- package/dist/compute/overlay.js.map +1 -0
- package/dist/compute/platform-overlays.d.ts +20 -0
- package/dist/compute/platform-overlays.d.ts.map +1 -0
- package/dist/compute/platform-overlays.js +31 -0
- package/dist/compute/platform-overlays.js.map +1 -0
- package/dist/compute/visual-timeline.d.ts +132 -0
- package/dist/compute/visual-timeline.d.ts.map +1 -0
- package/dist/compute/visual-timeline.js +431 -0
- package/dist/compute/visual-timeline.js.map +1 -0
- package/dist/compute/windows-overlay.d.ts +38 -0
- package/dist/compute/windows-overlay.d.ts.map +1 -0
- package/dist/compute/windows-overlay.js +282 -0
- package/dist/compute/windows-overlay.js.map +1 -0
- package/dist/core/architecture-tree.d.ts +68 -0
- package/dist/core/architecture-tree.d.ts.map +1 -0
- package/dist/core/architecture-tree.js +215 -0
- package/dist/core/architecture-tree.js.map +1 -0
- package/dist/discovery/aliases.d.ts.map +1 -1
- package/dist/discovery/aliases.js +93 -0
- package/dist/discovery/aliases.js.map +1 -1
- package/dist/discovery/core-catalog.d.ts.map +1 -1
- package/dist/discovery/core-catalog.js +14 -0
- package/dist/discovery/core-catalog.js.map +1 -1
- package/dist/discovery/intents.d.ts.map +1 -1
- package/dist/discovery/intents.js +124 -0
- package/dist/discovery/intents.js.map +1 -1
- package/dist/discovery/loader.d.ts +12 -6
- package/dist/discovery/loader.d.ts.map +1 -1
- package/dist/discovery/loader.js +37 -10
- package/dist/discovery/loader.js.map +1 -1
- package/dist/discovery/search.d.ts +27 -28
- package/dist/discovery/search.d.ts.map +1 -1
- package/dist/discovery/search.js +118 -120
- package/dist/discovery/search.js.map +1 -1
- package/dist/engine/text-normalize.d.ts +14 -0
- package/dist/engine/text-normalize.d.ts.map +1 -1
- package/dist/engine/text-normalize.js +64 -0
- package/dist/engine/text-normalize.js.map +1 -1
- package/dist/fast-path/handlers/discovery.d.ts +12 -5
- package/dist/fast-path/handlers/discovery.d.ts.map +1 -1
- package/dist/fast-path/handlers/discovery.js +42 -7
- package/dist/fast-path/handlers/discovery.js.map +1 -1
- package/dist/manifest-compact.txt +2 -2
- package/dist/manifest.json +352 -3
- package/dist/mcp/profiles/computer-use.d.ts.map +1 -1
- package/dist/mcp/profiles/computer-use.js +76 -8
- package/dist/mcp/profiles/computer-use.js.map +1 -1
- package/dist/registry.d.ts +14 -5
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +33 -6
- package/dist/registry.js.map +1 -1
- package/dist/transport/cascade.d.ts +1 -0
- package/dist/transport/cascade.d.ts.map +1 -1
- package/dist/transport/cascade.js +2 -2
- package/dist/transport/cascade.js.map +1 -1
- package/docs/operate/compute.md +66 -1
- package/docs/operate/troubleshooting.md +42 -0
- package/package.json +9 -5
- package/server.json +3 -3
- package/skills/unicli/SKILL.md +1 -1
- package/skills/unicli-claude-code/SKILL.md +1 -1
- package/skills/unicli-hermes/SKILL.md +1 -1
- package/src/adapters/marxists-cn/archive.test.ts +173 -0
- package/src/adapters/marxists-cn/archive.ts +1049 -0
- package/src/adapters/twitter/lists-extra.test.ts +115 -0
- package/src/adapters/twitter/lists-extra.ts +146 -26
- package/src/adapters/twitter/post.ts +1 -0
- package/src/adapters/twitter/thread.test.ts +25 -1
- package/src/adapters/twitter/thread.ts +99 -47
- package/dist/manifest-search.json +0 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @owner src/compute/windows-overlay.ts
|
|
3
|
+
* @does Render compute visual_action evidence through a Windows Win32 full-screen HUD.
|
|
4
|
+
* @needs PowerShell, .NET Windows Forms, src/compute/overlay-daemon.ts
|
|
5
|
+
* @feeds platform compute overlay selection, doctor compute, computer-use HUD rendering
|
|
6
|
+
* @breaks A non-click-through or activating HUD window can steal focus from UIA dispatch.
|
|
7
|
+
* @invariants The HUD is visual-only, topmost, click-through, and driven by visual_action pointer samples.
|
|
8
|
+
* @side-effects launches a PowerShell helper process on Windows.
|
|
9
|
+
* @perf one persistent PowerShell process per provider instance.
|
|
10
|
+
* @concurrency daemon session serializes render requests.
|
|
11
|
+
* @test tests/unit/compute-windows-overlay.test.ts
|
|
12
|
+
* @stability experimental
|
|
13
|
+
* @since 0.224.0
|
|
14
|
+
*/
|
|
15
|
+
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
16
|
+
import { tmpdir } from "node:os";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
import { computeOverlayRequestFromAction, } from "./overlay.js";
|
|
19
|
+
import { StdioComputeOverlayDaemonSession, } from "./overlay-daemon.js";
|
|
20
|
+
export class WindowsWin32OverlayDaemonProvider {
|
|
21
|
+
provider = "windows-win32";
|
|
22
|
+
platform;
|
|
23
|
+
scriptPath;
|
|
24
|
+
sessionFactory;
|
|
25
|
+
session;
|
|
26
|
+
tmpRoot;
|
|
27
|
+
lastPoint;
|
|
28
|
+
constructor(opts = {}) {
|
|
29
|
+
this.platform = opts.platform ?? process.platform;
|
|
30
|
+
this.scriptPath = opts.scriptPath;
|
|
31
|
+
this.sessionFactory = opts.sessionFactory;
|
|
32
|
+
}
|
|
33
|
+
currentPoint() {
|
|
34
|
+
return this.lastPoint;
|
|
35
|
+
}
|
|
36
|
+
async render(action) {
|
|
37
|
+
const request = computeOverlayRequestFromAction(action);
|
|
38
|
+
if (!request)
|
|
39
|
+
return { provider: this.provider, status: "not_requested" };
|
|
40
|
+
if (this.platform !== "win32") {
|
|
41
|
+
return { provider: this.provider, status: "unavailable" };
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const session = await this.ensureSession();
|
|
45
|
+
const status = await session.render(request, Math.max(1_000, request.duration_ms + 1_500));
|
|
46
|
+
if (status.status === "arrived") {
|
|
47
|
+
this.lastPoint = pointFromOverlayTarget(request);
|
|
48
|
+
}
|
|
49
|
+
return status;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return {
|
|
53
|
+
provider: this.provider,
|
|
54
|
+
status: "failed",
|
|
55
|
+
error: errorMessage(error),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async close() {
|
|
60
|
+
await this.session?.close();
|
|
61
|
+
this.session = undefined;
|
|
62
|
+
if (this.tmpRoot) {
|
|
63
|
+
await rm(this.tmpRoot, { recursive: true, force: true });
|
|
64
|
+
this.tmpRoot = undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async ensureSession() {
|
|
68
|
+
if (this.session)
|
|
69
|
+
return this.session;
|
|
70
|
+
if (this.sessionFactory) {
|
|
71
|
+
this.session = await this.sessionFactory();
|
|
72
|
+
return this.session;
|
|
73
|
+
}
|
|
74
|
+
const scriptPath = this.scriptPath ??
|
|
75
|
+
join((this.tmpRoot = await mkdtemp(join(tmpdir(), "unicli-overlay-win-"))), "overlay.ps1");
|
|
76
|
+
if (!this.scriptPath) {
|
|
77
|
+
await writeFile(scriptPath, buildWindowsOverlayPowerShellScript(), "utf8");
|
|
78
|
+
}
|
|
79
|
+
this.session = new StdioComputeOverlayDaemonSession("powershell.exe", [
|
|
80
|
+
"-NoProfile",
|
|
81
|
+
"-ExecutionPolicy",
|
|
82
|
+
"Bypass",
|
|
83
|
+
"-File",
|
|
84
|
+
scriptPath,
|
|
85
|
+
]);
|
|
86
|
+
return this.session;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export function buildWindowsOverlayPowerShellScript() {
|
|
90
|
+
return String.raw `
|
|
91
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
92
|
+
Add-Type -AssemblyName System.Drawing
|
|
93
|
+
Add-Type @"
|
|
94
|
+
using System;
|
|
95
|
+
using System.Runtime.InteropServices;
|
|
96
|
+
public static class UniCliOverlayNative {
|
|
97
|
+
public const int GWL_EXSTYLE = -20;
|
|
98
|
+
public const int WS_EX_TRANSPARENT = 0x00000020;
|
|
99
|
+
public const int WS_EX_LAYERED = 0x00080000;
|
|
100
|
+
public const int WS_EX_NOACTIVATE = 0x08000000;
|
|
101
|
+
[DllImport("user32.dll")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
|
102
|
+
[DllImport("user32.dll")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
|
|
103
|
+
}
|
|
104
|
+
"@
|
|
105
|
+
|
|
106
|
+
$script:CursorVisualStyle = "mac-glass-pointer-v1"
|
|
107
|
+
$script:CursorSkin = "mac-pointer"
|
|
108
|
+
$script:Request = $null
|
|
109
|
+
$script:StartedAt = [DateTime]::UtcNow
|
|
110
|
+
$script:Trail = New-Object System.Collections.ArrayList
|
|
111
|
+
$script:Timer = New-Object System.Windows.Forms.Timer
|
|
112
|
+
$script:Timer.Interval = 16
|
|
113
|
+
$script:Forms = New-Object System.Collections.ArrayList
|
|
114
|
+
|
|
115
|
+
function Write-Protocol($payload) {
|
|
116
|
+
[Console]::Out.WriteLine(($payload | ConvertTo-Json -Compress -Depth 8))
|
|
117
|
+
[Console]::Out.Flush()
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function Convert-Sample($sample) {
|
|
121
|
+
[pscustomobject]@{
|
|
122
|
+
at_ms = [double]$sample.at_ms
|
|
123
|
+
x = [double]$sample.x
|
|
124
|
+
y = [double]$sample.y
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function Get-SampleAt([double]$elapsedMs) {
|
|
129
|
+
$samples = @($script:Request.samples)
|
|
130
|
+
if ($samples.Count -eq 0) { return (Convert-Sample $script:Request.target) }
|
|
131
|
+
$previous = $samples[0]
|
|
132
|
+
foreach ($sample in $samples[1..($samples.Count - 1)]) {
|
|
133
|
+
if ([double]$sample.at_ms -ge $elapsedMs) {
|
|
134
|
+
$span = [Math]::Max(1, [double]$sample.at_ms - [double]$previous.at_ms)
|
|
135
|
+
$t = [Math]::Min(1, [Math]::Max(0, ($elapsedMs - [double]$previous.at_ms) / $span))
|
|
136
|
+
return [pscustomobject]@{
|
|
137
|
+
at_ms = $elapsedMs
|
|
138
|
+
x = [double]$previous.x + (([double]$sample.x - [double]$previous.x) * $t)
|
|
139
|
+
y = [double]$previous.y + (([double]$sample.y - [double]$previous.y) * $t)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
$previous = $sample
|
|
143
|
+
}
|
|
144
|
+
return (Convert-Sample $script:Request.target)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function New-OverlayForm($screen) {
|
|
148
|
+
$form = New-Object System.Windows.Forms.Form
|
|
149
|
+
$form.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::None
|
|
150
|
+
$form.ShowInTaskbar = $false
|
|
151
|
+
$form.TopMost = $true
|
|
152
|
+
$form.StartPosition = [System.Windows.Forms.FormStartPosition]::Manual
|
|
153
|
+
$form.Bounds = $screen.Bounds
|
|
154
|
+
$form.BackColor = [System.Drawing.Color]::Black
|
|
155
|
+
$form.TransparencyKey = [System.Drawing.Color]::Black
|
|
156
|
+
$form.Opacity = 0.96
|
|
157
|
+
$form.Add_Shown({
|
|
158
|
+
$style = [UniCliOverlayNative]::GetWindowLong($this.Handle, [UniCliOverlayNative]::GWL_EXSTYLE)
|
|
159
|
+
[void][UniCliOverlayNative]::SetWindowLong($this.Handle, [UniCliOverlayNative]::GWL_EXSTYLE, $style -bor [UniCliOverlayNative]::WS_EX_TRANSPARENT -bor [UniCliOverlayNative]::WS_EX_LAYERED -bor [UniCliOverlayNative]::WS_EX_NOACTIVATE)
|
|
160
|
+
})
|
|
161
|
+
$form.Add_Paint({
|
|
162
|
+
param($sender, $event)
|
|
163
|
+
if ($null -eq $script:Request) { return }
|
|
164
|
+
$elapsedMs = ([DateTime]::UtcNow - $script:StartedAt).TotalMilliseconds
|
|
165
|
+
$durationMs = [Math]::Max(120, [double]$script:Request.duration_ms)
|
|
166
|
+
$pressProgress = $elapsedMs / $durationMs
|
|
167
|
+
$point = Get-SampleAt $elapsedMs
|
|
168
|
+
$bounds = $sender.Bounds
|
|
169
|
+
$x = [float]($point.x - $bounds.X)
|
|
170
|
+
$y = [float]($point.y - $bounds.Y)
|
|
171
|
+
$g = $event.Graphics
|
|
172
|
+
$g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias
|
|
173
|
+
$outlinePen = New-Object System.Drawing.Pen ([System.Drawing.Color]::FromArgb(245, 23, 19, 15)), 2.2
|
|
174
|
+
$highlightPen = New-Object System.Drawing.Pen ([System.Drawing.Color]::FromArgb(190, 255, 255, 255)), 1
|
|
175
|
+
$fillBrush = New-Object System.Drawing.SolidBrush ([System.Drawing.Color]::FromArgb(250, 246, 240, 227))
|
|
176
|
+
$statePen = New-Object System.Drawing.Pen ([System.Drawing.Color]::FromArgb(198, 193, 154, 82)), 1.5
|
|
177
|
+
$trailPen = New-Object System.Drawing.Pen ([System.Drawing.Color]::FromArgb(120, 193, 154, 82)), 2
|
|
178
|
+
$trailPen.StartCap = [System.Drawing.Drawing2D.LineCap]::Round
|
|
179
|
+
$trailPen.EndCap = [System.Drawing.Drawing2D.LineCap]::Round
|
|
180
|
+
if ($script:Trail.Count -gt 1) {
|
|
181
|
+
for ($i = 1; $i -lt $script:Trail.Count; $i++) {
|
|
182
|
+
$a = $script:Trail[$i - 1]
|
|
183
|
+
$b = $script:Trail[$i]
|
|
184
|
+
$g.DrawLine($trailPen, [float]($a.x - $bounds.X), [float]($a.y - $bounds.Y), [float]($b.x - $bounds.X), [float]($b.y - $bounds.Y))
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
$hotspot = [System.Drawing.PointF]::new($x, $y)
|
|
188
|
+
$pointerPath = New-Object System.Drawing.Drawing2D.GraphicsPath
|
|
189
|
+
[void]$pointerPath.AddPolygon([System.Drawing.PointF[]]@(
|
|
190
|
+
[System.Drawing.PointF]::new($x, $y),
|
|
191
|
+
[System.Drawing.PointF]::new($x, $y + 45),
|
|
192
|
+
[System.Drawing.PointF]::new($x + 13, $y + 32),
|
|
193
|
+
[System.Drawing.PointF]::new($x + 21, $y + 55),
|
|
194
|
+
[System.Drawing.PointF]::new($x + 31, $y + 51),
|
|
195
|
+
[System.Drawing.PointF]::new($x + 23, $y + 29),
|
|
196
|
+
[System.Drawing.PointF]::new($x + 43, $y + 29)
|
|
197
|
+
))
|
|
198
|
+
$g.FillPath($fillBrush, $pointerPath)
|
|
199
|
+
$g.DrawPath($outlinePen, $pointerPath)
|
|
200
|
+
$g.DrawLine($highlightPen, $x + 6, $y + 8, $x + 6, $y + 34)
|
|
201
|
+
$state = [string]$script:Request.state
|
|
202
|
+
$halo = ""
|
|
203
|
+
$clickRipple = $false
|
|
204
|
+
if ($null -ne $script:Request.affordance) {
|
|
205
|
+
$halo = [string]$script:Request.affordance.halo
|
|
206
|
+
$clickRipple = [bool]$script:Request.affordance.click_ripple
|
|
207
|
+
}
|
|
208
|
+
$isPressure = ($state -eq "press" -or $halo -eq "pressure-bloom" -or $clickRipple) -and $pressProgress -ge 0.78
|
|
209
|
+
$isOrbit = $state -eq "wait" -or $halo -eq "busy-orbit"
|
|
210
|
+
if ($isOrbit) {
|
|
211
|
+
$statePen.DashPattern = @(4, 5)
|
|
212
|
+
$g.DrawEllipse($statePen, $hotspot.X - 14, $hotspot.Y - 14, 30, 30)
|
|
213
|
+
} elseif ($isPressure) {
|
|
214
|
+
$g.DrawEllipse($statePen, $hotspot.X - 14, $hotspot.Y - 14, 30, 30)
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
return $form
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function Start-Render($request) {
|
|
221
|
+
$script:Request = $request
|
|
222
|
+
$script:StartedAt = [DateTime]::UtcNow
|
|
223
|
+
[void]$script:Trail.Clear()
|
|
224
|
+
$script:Timer.Stop()
|
|
225
|
+
$script:Timer.Start()
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
$script:Timer.Add_Tick({
|
|
229
|
+
if ($null -eq $script:Request) { return }
|
|
230
|
+
$elapsed = ([DateTime]::UtcNow - $script:StartedAt).TotalMilliseconds
|
|
231
|
+
$duration = [Math]::Max(120, [double]$script:Request.duration_ms)
|
|
232
|
+
$point = Get-SampleAt $elapsed
|
|
233
|
+
[void]$script:Trail.Add($point)
|
|
234
|
+
while ($script:Trail.Count -gt 10) { $script:Trail.RemoveAt(0) }
|
|
235
|
+
foreach ($form in $script:Forms) { $form.Invalidate() }
|
|
236
|
+
if ($elapsed -ge $duration) {
|
|
237
|
+
$script:Timer.Stop()
|
|
238
|
+
Write-Protocol @{ provider = "windows-win32"; status = "arrived"; acknowledged_at_ms = [int]$duration }
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
foreach ($screen in [System.Windows.Forms.Screen]::AllScreens) {
|
|
243
|
+
[void]$script:Forms.Add((New-OverlayForm $screen))
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
foreach ($form in $script:Forms) { $form.Show() }
|
|
247
|
+
|
|
248
|
+
Write-Protocol @{ provider = "windows-win32"; status = "ready" }
|
|
249
|
+
'{"provider":"windows-win32","status":"ready"}' | Out-Null
|
|
250
|
+
|
|
251
|
+
[System.Threading.ThreadPool]::QueueUserWorkItem({
|
|
252
|
+
while (($line = [Console]::In.ReadLine()) -ne $null) {
|
|
253
|
+
try {
|
|
254
|
+
$request = $line | ConvertFrom-Json
|
|
255
|
+
[void][System.Windows.Forms.Application]::OpenForms[0].BeginInvoke([Action[object]]{ param($r) Start-Render $r }, $request)
|
|
256
|
+
} catch {
|
|
257
|
+
Write-Protocol @{ provider = "windows-win32"; status = "failed"; error = "invalid request" }
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
[System.Windows.Forms.Application]::Exit()
|
|
261
|
+
}) | Out-Null
|
|
262
|
+
|
|
263
|
+
[System.Windows.Forms.Application]::Run()
|
|
264
|
+
`;
|
|
265
|
+
}
|
|
266
|
+
function pointFromOverlayTarget(request) {
|
|
267
|
+
return {
|
|
268
|
+
x: request.target.x,
|
|
269
|
+
y: request.target.y,
|
|
270
|
+
coordinate_space: {
|
|
271
|
+
kind: "screen-pixels",
|
|
272
|
+
origin: "top-left",
|
|
273
|
+
...(request.target.screenIndex !== undefined
|
|
274
|
+
? { screenIndex: request.target.screenIndex }
|
|
275
|
+
: {}),
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function errorMessage(error) {
|
|
280
|
+
return error instanceof Error ? error.message : String(error);
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=windows-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-overlay.js","sourceRoot":"","sources":["../../src/compute/windows-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,+BAA+B,GAGhC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gCAAgC,GAEjC,MAAM,q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ACH,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAED,MAAM,UAAU,mCAAmC;IACjD,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8KlB,CAAC;AACF,CAAC;AAED,SAAS,sBAAsB,CAC7B,OAA8B;IAE9B,OAAO;QACL,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACnB,gBAAgB,EAAE;YAChB,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,UAAU;YAClB,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,KAAK,SAAS;gBAC1C,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;gBAC7C,CAAC,CAAC,EAAE,CAAC;SACR;KACF,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @owner src/core/architecture-tree.ts
|
|
3
|
+
* @does Builds the callable Uni-CLI architecture tree and lifecycle audit from registered command contracts.
|
|
4
|
+
* @needs src/core/command-contract, src/types
|
|
5
|
+
* @feeds src/commands/architecture.ts, tests/unit/core/architecture-tree.test.ts
|
|
6
|
+
* @breaks Propagates command-contract construction errors when adapter metadata is malformed.
|
|
7
|
+
* @invariants Command lifecycle order is stable: create, discover, invoke, observe, repair, publish.
|
|
8
|
+
* @side-effects none
|
|
9
|
+
* @perf O(commands) over the loaded adapter registry; allocates one inventory entry per command.
|
|
10
|
+
* @concurrency Pure and reentrant; no shared mutable state.
|
|
11
|
+
* @test tests/unit/core/architecture-tree.test.ts
|
|
12
|
+
* @stability experimental
|
|
13
|
+
* @since 2026-05-26
|
|
14
|
+
*/
|
|
15
|
+
import type { AdapterManifest, TargetSurface } from "../types.js";
|
|
16
|
+
export declare const COMMAND_LIFECYCLE_STEPS: readonly ["create", "discover", "invoke", "observe", "repair", "publish"];
|
|
17
|
+
export type CommandLifecycleStep = (typeof COMMAND_LIFECYCLE_STEPS)[number];
|
|
18
|
+
export type ArchitecturePriority = "P0" | "P1" | "P2";
|
|
19
|
+
export type ArchitectureNodeKind = "root" | "group" | "surface" | "runtime" | "lifecycle" | "verification";
|
|
20
|
+
export interface ArchitectureTreeNode {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
kind: ArchitectureNodeKind;
|
|
24
|
+
priority?: ArchitecturePriority;
|
|
25
|
+
description: string;
|
|
26
|
+
command_count?: number;
|
|
27
|
+
children: ArchitectureTreeNode[];
|
|
28
|
+
}
|
|
29
|
+
export interface ArchitectureCommandInventoryEntry {
|
|
30
|
+
ref: string;
|
|
31
|
+
site: string;
|
|
32
|
+
command: string;
|
|
33
|
+
adapter_type: string;
|
|
34
|
+
target_surface: TargetSurface;
|
|
35
|
+
source_path?: string;
|
|
36
|
+
safety_class: string;
|
|
37
|
+
minimum_capability?: string;
|
|
38
|
+
is_local_computer_use: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface ArchitectureTreeSummary {
|
|
41
|
+
total_sites: number;
|
|
42
|
+
total_commands: number;
|
|
43
|
+
local_computer_use_commands: number;
|
|
44
|
+
missing_source_path_commands: number;
|
|
45
|
+
}
|
|
46
|
+
export interface ArchitectureTree {
|
|
47
|
+
schema_version: "architecture-tree.v1";
|
|
48
|
+
lifecycle_steps: readonly CommandLifecycleStep[];
|
|
49
|
+
summary: ArchitectureTreeSummary;
|
|
50
|
+
root: ArchitectureTreeNode;
|
|
51
|
+
command_inventory: ArchitectureCommandInventoryEntry[];
|
|
52
|
+
}
|
|
53
|
+
export interface ArchitectureTreeAudit {
|
|
54
|
+
schema_version: "architecture-audit.v1";
|
|
55
|
+
total_sites: number;
|
|
56
|
+
total_commands: number;
|
|
57
|
+
local_computer_use_commands: number;
|
|
58
|
+
lifecycle_steps: readonly CommandLifecycleStep[];
|
|
59
|
+
missing_source_paths: string[];
|
|
60
|
+
second_class_surfaces: string[];
|
|
61
|
+
ready_for_full_rewrite: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface BuildArchitectureTreeInput {
|
|
64
|
+
adapters: readonly AdapterManifest[];
|
|
65
|
+
}
|
|
66
|
+
export declare function buildArchitectureTree(input: BuildArchitectureTreeInput): ArchitectureTree;
|
|
67
|
+
export declare function auditArchitectureTree(input: BuildArchitectureTreeInput): ArchitectureTreeAudit;
|
|
68
|
+
//# sourceMappingURL=architecture-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architecture-tree.d.ts","sourceRoot":"","sources":["../../src/core/architecture-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAEV,eAAe,EACf,aAAa,EACd,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,uBAAuB,2EAO1B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5E,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACtD,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,GACT,WAAW,GACX,cAAc,CAAC;AAEnB,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,I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,eAAe,EAAE,CAAC;CACtC;AAiMD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,0BAA0B,GAChC,gBAAgB,CAsBlB;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,0BAA0B,GAChC,qBAAqB,CAqBvB"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @owner src/core/architecture-tree.ts
|
|
3
|
+
* @does Builds the callable Uni-CLI architecture tree and lifecycle audit from registered command contracts.
|
|
4
|
+
* @needs src/core/command-contract, src/types
|
|
5
|
+
* @feeds src/commands/architecture.ts, tests/unit/core/architecture-tree.test.ts
|
|
6
|
+
* @breaks Propagates command-contract construction errors when adapter metadata is malformed.
|
|
7
|
+
* @invariants Command lifecycle order is stable: create, discover, invoke, observe, repair, publish.
|
|
8
|
+
* @side-effects none
|
|
9
|
+
* @perf O(commands) over the loaded adapter registry; allocates one inventory entry per command.
|
|
10
|
+
* @concurrency Pure and reentrant; no shared mutable state.
|
|
11
|
+
* @test tests/unit/core/architecture-tree.test.ts
|
|
12
|
+
* @stability experimental
|
|
13
|
+
* @since 2026-05-26
|
|
14
|
+
*/
|
|
15
|
+
import { buildCommandContract } from "./command-contract.js";
|
|
16
|
+
import { AdapterType } from "../types.js";
|
|
17
|
+
export const COMMAND_LIFECYCLE_STEPS = [
|
|
18
|
+
"create",
|
|
19
|
+
"discover",
|
|
20
|
+
"invoke",
|
|
21
|
+
"observe",
|
|
22
|
+
"repair",
|
|
23
|
+
"publish",
|
|
24
|
+
];
|
|
25
|
+
function commandRef(adapter, commandName) {
|
|
26
|
+
return `${adapter.name}.${commandName}`;
|
|
27
|
+
}
|
|
28
|
+
function isLocalComputerUseCommand(adapter, command, targetSurface) {
|
|
29
|
+
if (targetSurface === "desktop" || targetSurface === "system")
|
|
30
|
+
return true;
|
|
31
|
+
if (adapter.type === AdapterType.DESKTOP)
|
|
32
|
+
return true;
|
|
33
|
+
return (command.capabilities ?? []).some((capability) => capability.startsWith("desktop-") ||
|
|
34
|
+
capability.startsWith("compute.") ||
|
|
35
|
+
capability.startsWith("visual."));
|
|
36
|
+
}
|
|
37
|
+
function collectCommandInventory(adapters) {
|
|
38
|
+
const entries = [];
|
|
39
|
+
for (const adapter of adapters) {
|
|
40
|
+
for (const [commandName, command] of Object.entries(adapter.commands)) {
|
|
41
|
+
const contract = buildCommandContract({
|
|
42
|
+
adapter,
|
|
43
|
+
commandName,
|
|
44
|
+
command,
|
|
45
|
+
});
|
|
46
|
+
const targetSurface = contract.effect.target_surface;
|
|
47
|
+
entries.push({
|
|
48
|
+
ref: commandRef(adapter, commandName),
|
|
49
|
+
site: adapter.name,
|
|
50
|
+
command: commandName,
|
|
51
|
+
adapter_type: adapter.type,
|
|
52
|
+
target_surface: targetSurface,
|
|
53
|
+
...(contract.identity.source_path
|
|
54
|
+
? { source_path: contract.identity.source_path }
|
|
55
|
+
: {}),
|
|
56
|
+
safety_class: contract.effect.safety_class,
|
|
57
|
+
...(command.minimum_capability
|
|
58
|
+
? { minimum_capability: command.minimum_capability }
|
|
59
|
+
: {}),
|
|
60
|
+
is_local_computer_use: isLocalComputerUseCommand(adapter, command, targetSurface),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return entries.sort((leftEntry, rightEntry) => leftEntry.ref.localeCompare(rightEntry.ref));
|
|
65
|
+
}
|
|
66
|
+
function node(input) {
|
|
67
|
+
return { ...input, children: input.children ?? [] };
|
|
68
|
+
}
|
|
69
|
+
function lifecycleNodes() {
|
|
70
|
+
return COMMAND_LIFECYCLE_STEPS.map((step) => node({
|
|
71
|
+
id: `lifecycle-${step}`,
|
|
72
|
+
label: step,
|
|
73
|
+
kind: "lifecycle",
|
|
74
|
+
priority: "P0",
|
|
75
|
+
description: `Command lifecycle step: ${step}.`,
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
function buildRootNode(summary) {
|
|
79
|
+
return node({
|
|
80
|
+
id: "unicli",
|
|
81
|
+
label: "Uni-CLI",
|
|
82
|
+
kind: "root",
|
|
83
|
+
priority: "P0",
|
|
84
|
+
description: "Bridge between agents and websites, browsers, desktop apps, local tools, system capabilities, and protocol servers.",
|
|
85
|
+
command_count: summary.total_commands,
|
|
86
|
+
children: [
|
|
87
|
+
node({
|
|
88
|
+
id: "first-class-citizens",
|
|
89
|
+
label: "First-class citizens",
|
|
90
|
+
kind: "group",
|
|
91
|
+
priority: "P0",
|
|
92
|
+
description: "Product roots that define Uni-CLI semantics across every wrapper.",
|
|
93
|
+
children: [
|
|
94
|
+
node({
|
|
95
|
+
id: "command-contract",
|
|
96
|
+
label: "Command contract",
|
|
97
|
+
kind: "runtime",
|
|
98
|
+
priority: "P0",
|
|
99
|
+
description: "Site, command, args, output, auth, safety, capability, source path, and repair path.",
|
|
100
|
+
command_count: summary.total_commands,
|
|
101
|
+
}),
|
|
102
|
+
node({
|
|
103
|
+
id: "invocation-kernel",
|
|
104
|
+
label: "Invocation kernel",
|
|
105
|
+
kind: "runtime",
|
|
106
|
+
priority: "P0",
|
|
107
|
+
description: "Validate, harden, authorize, execute, observe, and envelope.",
|
|
108
|
+
command_count: summary.total_commands,
|
|
109
|
+
}),
|
|
110
|
+
node({
|
|
111
|
+
id: "local-computer-use",
|
|
112
|
+
label: "Local computer use",
|
|
113
|
+
kind: "surface",
|
|
114
|
+
priority: "P0",
|
|
115
|
+
description: "Native accessibility, CDP, subprocess, and visual cascade for installed software.",
|
|
116
|
+
command_count: summary.local_computer_use_commands,
|
|
117
|
+
}),
|
|
118
|
+
node({
|
|
119
|
+
id: "evidence-loop",
|
|
120
|
+
label: "Evidence loop",
|
|
121
|
+
kind: "runtime",
|
|
122
|
+
priority: "P0",
|
|
123
|
+
description: "AgentEnvelope, run traces, post-state evidence, and delivery trajectory.",
|
|
124
|
+
command_count: summary.total_commands,
|
|
125
|
+
}),
|
|
126
|
+
],
|
|
127
|
+
}),
|
|
128
|
+
node({
|
|
129
|
+
id: "command-lifecycle",
|
|
130
|
+
label: "Command lifecycle",
|
|
131
|
+
kind: "group",
|
|
132
|
+
priority: "P0",
|
|
133
|
+
description: "Create, discover, invoke, observe, repair, and publish operations.",
|
|
134
|
+
command_count: summary.total_commands,
|
|
135
|
+
children: lifecycleNodes(),
|
|
136
|
+
}),
|
|
137
|
+
node({
|
|
138
|
+
id: "second-class-surfaces",
|
|
139
|
+
label: "Second-class surfaces",
|
|
140
|
+
kind: "group",
|
|
141
|
+
priority: "P2",
|
|
142
|
+
description: "Important wrappers and fallbacks that must not fork command semantics.",
|
|
143
|
+
children: [
|
|
144
|
+
node({
|
|
145
|
+
id: "expanded-mcp",
|
|
146
|
+
label: "Expanded MCP",
|
|
147
|
+
kind: "surface",
|
|
148
|
+
priority: "P2",
|
|
149
|
+
description: "Opt-in broad tool exposure; compact MCP remains default.",
|
|
150
|
+
}),
|
|
151
|
+
node({
|
|
152
|
+
id: "visual-fallback",
|
|
153
|
+
label: "Visual fallback",
|
|
154
|
+
kind: "surface",
|
|
155
|
+
priority: "P2",
|
|
156
|
+
description: "Valid only when it can see, act, and verify post-state evidence.",
|
|
157
|
+
}),
|
|
158
|
+
node({
|
|
159
|
+
id: "typescript-adapters",
|
|
160
|
+
label: "TypeScript adapters",
|
|
161
|
+
kind: "runtime",
|
|
162
|
+
priority: "P2",
|
|
163
|
+
description: "Escape hatch when finite YAML pipeline primitives are insufficient.",
|
|
164
|
+
}),
|
|
165
|
+
],
|
|
166
|
+
}),
|
|
167
|
+
node({
|
|
168
|
+
id: "verification",
|
|
169
|
+
label: "Verification",
|
|
170
|
+
kind: "verification",
|
|
171
|
+
priority: "P0",
|
|
172
|
+
description: "Typecheck, lint, unit tests, adapter tests, docs build, boundary guard, and release verify.",
|
|
173
|
+
}),
|
|
174
|
+
],
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
export function buildArchitectureTree(input) {
|
|
178
|
+
const commandInventory = collectCommandInventory(input.adapters);
|
|
179
|
+
const localComputerUseCommands = commandInventory.filter((entry) => entry.is_local_computer_use).length;
|
|
180
|
+
const missingSourcePathCommands = commandInventory.filter((entry) => entry.source_path === undefined).length;
|
|
181
|
+
const summary = {
|
|
182
|
+
total_sites: input.adapters.length,
|
|
183
|
+
total_commands: commandInventory.length,
|
|
184
|
+
local_computer_use_commands: localComputerUseCommands,
|
|
185
|
+
missing_source_path_commands: missingSourcePathCommands,
|
|
186
|
+
};
|
|
187
|
+
return {
|
|
188
|
+
schema_version: "architecture-tree.v1",
|
|
189
|
+
lifecycle_steps: COMMAND_LIFECYCLE_STEPS,
|
|
190
|
+
summary,
|
|
191
|
+
root: buildRootNode(summary),
|
|
192
|
+
command_inventory: commandInventory,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export function auditArchitectureTree(input) {
|
|
196
|
+
const tree = buildArchitectureTree(input);
|
|
197
|
+
const missingSourcePaths = tree.command_inventory
|
|
198
|
+
.filter((entry) => entry.source_path === undefined)
|
|
199
|
+
.map((entry) => entry.ref);
|
|
200
|
+
return {
|
|
201
|
+
schema_version: "architecture-audit.v1",
|
|
202
|
+
total_sites: tree.summary.total_sites,
|
|
203
|
+
total_commands: tree.summary.total_commands,
|
|
204
|
+
local_computer_use_commands: tree.summary.local_computer_use_commands,
|
|
205
|
+
lifecycle_steps: COMMAND_LIFECYCLE_STEPS,
|
|
206
|
+
missing_source_paths: missingSourcePaths,
|
|
207
|
+
second_class_surfaces: [
|
|
208
|
+
"expanded-mcp",
|
|
209
|
+
"visual-fallback",
|
|
210
|
+
"typescript-adapters",
|
|
211
|
+
],
|
|
212
|
+
ready_for_full_rewrite: tree.summary.total_commands > 0 && missingSourcePaths.length === 0,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=architecture-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architecture-tree.js","sourceRoot":"","sources":["../../src/core/architecture-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE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AAK,CAAC;KACrE,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aliases.d.ts","sourceRoot":"","sources":["../../src/discovery/aliases.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"aliases.d.ts","sourceRoot":"","sources":["../../src/discovery/aliases.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAyLnD,CAAC;AAKH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAuIhE,CAAC;AAKH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAgnBhE,CAAC;AAKH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAqStD,CAAC;AAKH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAiEvD,CAAC;AAIH;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBnD;AASD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/C;AAiCD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAiErD"}
|