@zenalexa/unicli 0.223.3 → 0.224.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.
Files changed (98) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +3 -3
  3. package/README.zh-CN.md +3 -3
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +3 -0
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/architecture.d.ts +21 -0
  8. package/dist/commands/architecture.d.ts.map +1 -0
  9. package/dist/commands/architecture.js +47 -0
  10. package/dist/commands/architecture.js.map +1 -0
  11. package/dist/commands/compute.d.ts.map +1 -1
  12. package/dist/commands/compute.js +31 -6
  13. package/dist/commands/compute.js.map +1 -1
  14. package/dist/commands/doctor-compute.d.ts.map +1 -1
  15. package/dist/commands/doctor-compute.js +88 -1
  16. package/dist/commands/doctor-compute.js.map +1 -1
  17. package/dist/compute/action-execution.d.ts +30 -0
  18. package/dist/compute/action-execution.d.ts.map +1 -0
  19. package/dist/compute/action-execution.js +112 -0
  20. package/dist/compute/action-execution.js.map +1 -0
  21. package/dist/compute/capture-reference.d.ts.map +1 -1
  22. package/dist/compute/capture-reference.js +6 -1
  23. package/dist/compute/capture-reference.js.map +1 -1
  24. package/dist/compute/capture.d.ts +2 -0
  25. package/dist/compute/capture.d.ts.map +1 -1
  26. package/dist/compute/capture.js +6 -1
  27. package/dist/compute/capture.js.map +1 -1
  28. package/dist/compute/cursor-visual-style.d.ts +35 -0
  29. package/dist/compute/cursor-visual-style.d.ts.map +1 -0
  30. package/dist/compute/cursor-visual-style.js +39 -0
  31. package/dist/compute/cursor-visual-style.js.map +1 -0
  32. package/dist/compute/linux-overlay.d.ts +38 -0
  33. package/dist/compute/linux-overlay.d.ts.map +1 -0
  34. package/dist/compute/linux-overlay.js +274 -0
  35. package/dist/compute/linux-overlay.js.map +1 -0
  36. package/dist/compute/macos-overlay.d.ts +64 -0
  37. package/dist/compute/macos-overlay.d.ts.map +1 -0
  38. package/dist/compute/macos-overlay.js +590 -0
  39. package/dist/compute/macos-overlay.js.map +1 -0
  40. package/dist/compute/overlay-daemon.d.ts +47 -0
  41. package/dist/compute/overlay-daemon.d.ts.map +1 -0
  42. package/dist/compute/overlay-daemon.js +206 -0
  43. package/dist/compute/overlay-daemon.js.map +1 -0
  44. package/dist/compute/overlay.d.ts +42 -0
  45. package/dist/compute/overlay.d.ts.map +1 -0
  46. package/dist/compute/overlay.js +111 -0
  47. package/dist/compute/overlay.js.map +1 -0
  48. package/dist/compute/platform-overlays.d.ts +20 -0
  49. package/dist/compute/platform-overlays.d.ts.map +1 -0
  50. package/dist/compute/platform-overlays.js +31 -0
  51. package/dist/compute/platform-overlays.js.map +1 -0
  52. package/dist/compute/visual-timeline.d.ts +132 -0
  53. package/dist/compute/visual-timeline.d.ts.map +1 -0
  54. package/dist/compute/visual-timeline.js +431 -0
  55. package/dist/compute/visual-timeline.js.map +1 -0
  56. package/dist/compute/windows-overlay.d.ts +38 -0
  57. package/dist/compute/windows-overlay.d.ts.map +1 -0
  58. package/dist/compute/windows-overlay.js +282 -0
  59. package/dist/compute/windows-overlay.js.map +1 -0
  60. package/dist/core/architecture-tree.d.ts +68 -0
  61. package/dist/core/architecture-tree.d.ts.map +1 -0
  62. package/dist/core/architecture-tree.js +215 -0
  63. package/dist/core/architecture-tree.js.map +1 -0
  64. package/dist/discovery/core-catalog.d.ts.map +1 -1
  65. package/dist/discovery/core-catalog.js +14 -0
  66. package/dist/discovery/core-catalog.js.map +1 -1
  67. package/dist/discovery/loader.d.ts +12 -6
  68. package/dist/discovery/loader.d.ts.map +1 -1
  69. package/dist/discovery/loader.js +37 -10
  70. package/dist/discovery/loader.js.map +1 -1
  71. package/dist/discovery/search.d.ts +27 -28
  72. package/dist/discovery/search.d.ts.map +1 -1
  73. package/dist/discovery/search.js +118 -120
  74. package/dist/discovery/search.js.map +1 -1
  75. package/dist/fast-path/handlers/discovery.d.ts +12 -5
  76. package/dist/fast-path/handlers/discovery.d.ts.map +1 -1
  77. package/dist/fast-path/handlers/discovery.js +42 -7
  78. package/dist/fast-path/handlers/discovery.js.map +1 -1
  79. package/dist/manifest.json +1 -1
  80. package/dist/mcp/profiles/computer-use.d.ts.map +1 -1
  81. package/dist/mcp/profiles/computer-use.js +76 -8
  82. package/dist/mcp/profiles/computer-use.js.map +1 -1
  83. package/dist/registry.d.ts +14 -5
  84. package/dist/registry.d.ts.map +1 -1
  85. package/dist/registry.js +33 -6
  86. package/dist/registry.js.map +1 -1
  87. package/dist/transport/cascade.d.ts +1 -0
  88. package/dist/transport/cascade.d.ts.map +1 -1
  89. package/dist/transport/cascade.js +2 -2
  90. package/dist/transport/cascade.js.map +1 -1
  91. package/docs/operate/compute.md +66 -1
  92. package/docs/operate/troubleshooting.md +42 -0
  93. package/package.json +9 -5
  94. package/server.json +3 -3
  95. package/skills/unicli/SKILL.md +1 -1
  96. package/skills/unicli-claude-code/SKILL.md +1 -1
  97. package/skills/unicli-hermes/SKILL.md +1 -1
  98. package/dist/manifest-search.json +0 -1
@@ -0,0 +1,206 @@
1
+ /**
2
+ * @owner src/compute/overlay-daemon.ts
3
+ * @does Manage JSONL stdio sessions for native compute overlay HUD daemons.
4
+ * @needs child_process spawn, readline, visual overlay status protocol
5
+ * @feeds macOS AppKit, Windows Win32, and Linux GTK overlay providers
6
+ * @breaks Missing ready separation causes cold-start time to consume render animation timeouts.
7
+ * @invariants A daemon must emit provider/status=ready before render requests are written.
8
+ * @side-effects Starts and kills native helper processes.
9
+ * @perf One persistent process per overlay provider instance.
10
+ * @concurrency Render calls are serialized through one active JSONL request.
11
+ * @test tests/unit/compute-macos-overlay-swift.test.ts
12
+ * @stability experimental
13
+ * @since 0.224.0
14
+ */
15
+ import { spawn } from "node:child_process";
16
+ import { createInterface } from "node:readline";
17
+ export class StdioComputeOverlayDaemonSession {
18
+ command;
19
+ args;
20
+ child;
21
+ lines;
22
+ active;
23
+ readiness;
24
+ queue = [];
25
+ closed = false;
26
+ readyTimeoutMs;
27
+ constructor(command, args, opts = {}) {
28
+ this.command = command;
29
+ this.args = args;
30
+ this.readyTimeoutMs = opts.readyTimeoutMs ?? 8_000;
31
+ }
32
+ render(request, timeoutMs) {
33
+ return new Promise((resolve, reject) => {
34
+ this.queue.push({ request, timeoutMs, resolve, reject });
35
+ this.processNext();
36
+ });
37
+ }
38
+ async close() {
39
+ if (this.closed)
40
+ return;
41
+ this.closed = true;
42
+ this.lines?.close();
43
+ this.rejectReadiness(new Error("overlay daemon closed"));
44
+ this.rejectActive(new Error("overlay daemon closed"));
45
+ this.rejectQueue(new Error("overlay daemon closed"));
46
+ this.child?.kill();
47
+ this.child = undefined;
48
+ }
49
+ processNext() {
50
+ if (this.active || this.queue.length === 0 || this.closed)
51
+ return;
52
+ const call = this.queue.shift();
53
+ if (!call)
54
+ return;
55
+ this.active = call;
56
+ void this.ensureReadyChild()
57
+ .then((child) => this.writeActiveCall(child))
58
+ .catch((error) => {
59
+ this.rejectActive(error);
60
+ this.processNext();
61
+ });
62
+ }
63
+ writeActiveCall(child) {
64
+ const call = this.active;
65
+ if (!call || this.closed)
66
+ return;
67
+ call.timeout = setTimeout(() => {
68
+ this.rejectActive(new Error("overlay render timed out"));
69
+ this.processNext();
70
+ }, call.timeoutMs);
71
+ child.stdin.write(`${JSON.stringify(call.request)}\n`, (error) => {
72
+ if (!error)
73
+ return;
74
+ this.rejectActive(error);
75
+ this.processNext();
76
+ });
77
+ }
78
+ async ensureReadyChild() {
79
+ const child = this.ensureChild();
80
+ if (this.readiness?.ready)
81
+ return child;
82
+ await this.readiness?.promise;
83
+ return child;
84
+ }
85
+ ensureChild() {
86
+ if (this.child)
87
+ return this.child;
88
+ if (this.closed)
89
+ throw new Error("overlay daemon session is closed");
90
+ const child = spawn(this.command, [...this.args], {
91
+ stdio: ["pipe", "pipe", "pipe"],
92
+ });
93
+ this.child = child;
94
+ this.readiness = this.createReadiness();
95
+ this.lines = createInterface({ input: child.stdout });
96
+ this.lines.on("line", (line) => this.handleLine(line));
97
+ child.on("error", (error) => {
98
+ this.rejectReadiness(error);
99
+ this.rejectActive(error);
100
+ this.child = undefined;
101
+ this.processNext();
102
+ });
103
+ child.on("close", (code) => {
104
+ const error = new Error(`overlay daemon exited with code ${code ?? "unknown"}`);
105
+ this.rejectReadiness(error);
106
+ this.rejectActive(error);
107
+ this.child = undefined;
108
+ this.processNext();
109
+ });
110
+ child.stderr.on("data", () => {
111
+ // stderr is reserved for native diagnostics; protocol responses stay on stdout.
112
+ });
113
+ return child;
114
+ }
115
+ handleLine(line) {
116
+ if (this.resolveReadinessIfReady(line))
117
+ return;
118
+ let status;
119
+ try {
120
+ status = parseOverlayStatus(line);
121
+ }
122
+ catch (error) {
123
+ this.rejectActive(error);
124
+ this.processNext();
125
+ return;
126
+ }
127
+ const call = this.active;
128
+ if (!call)
129
+ return;
130
+ clearTimeout(call.timeout);
131
+ this.active = undefined;
132
+ call.resolve(status);
133
+ this.processNext();
134
+ }
135
+ createReadiness() {
136
+ const ready = {
137
+ ready: false,
138
+ promise: Promise.resolve(),
139
+ resolve: () => { },
140
+ reject: () => { },
141
+ };
142
+ ready.promise = new Promise((resolve, reject) => {
143
+ ready.resolve = resolve;
144
+ ready.reject = reject;
145
+ });
146
+ ready.timeout = setTimeout(() => {
147
+ if (ready.ready)
148
+ return;
149
+ ready.reject(new Error("overlay daemon did not report ready"));
150
+ }, this.readyTimeoutMs);
151
+ return ready;
152
+ }
153
+ resolveReadinessIfReady(line) {
154
+ let value;
155
+ try {
156
+ value = JSON.parse(line);
157
+ }
158
+ catch {
159
+ return false;
160
+ }
161
+ if (!isRecord(value))
162
+ return false;
163
+ if (value.status !== "ready" || typeof value.provider !== "string") {
164
+ return false;
165
+ }
166
+ const readiness = this.readiness;
167
+ if (!readiness || readiness.ready)
168
+ return true;
169
+ readiness.ready = true;
170
+ if (readiness.timeout)
171
+ clearTimeout(readiness.timeout);
172
+ readiness.resolve();
173
+ return true;
174
+ }
175
+ rejectActive(error) {
176
+ const call = this.active;
177
+ if (!call)
178
+ return;
179
+ clearTimeout(call.timeout);
180
+ this.active = undefined;
181
+ call.reject(error);
182
+ }
183
+ rejectQueue(error) {
184
+ while (this.queue.length > 0)
185
+ this.queue.shift()?.reject(error);
186
+ }
187
+ rejectReadiness(error) {
188
+ const readiness = this.readiness;
189
+ if (!readiness || readiness.ready)
190
+ return;
191
+ if (readiness.timeout)
192
+ clearTimeout(readiness.timeout);
193
+ readiness.reject(error);
194
+ }
195
+ }
196
+ function parseOverlayStatus(stdout) {
197
+ const value = JSON.parse(stdout.trim());
198
+ if (typeof value.provider === "string" && typeof value.status === "string") {
199
+ return value;
200
+ }
201
+ throw new Error("overlay sidecar returned invalid JSON");
202
+ }
203
+ function isRecord(value) {
204
+ return typeof value === "object" && value !== null && !Array.isArray(value);
205
+ }
206
+ //# sourceMappingURL=overlay-daemon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-daemon.js","sourceRoot":"","sources":["../../src/compute/overlay-daemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,KAAK,EAAuC,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAC;AAahE,MAAM,OAAO,gCAAgC;IAUxB;IACA;IAVX,KAAK,CAA6C;IAClD,KAAK,CAAwB;IAC7B,MAAM,CAAiC;IACvC,SAAS,CAAkC;IAClC,KAAK,GAAyB,EAAE,CAAC;IAC1C,MAAM,GAAG,KAAK,CAAC;IACN,cAAc,CAAS;IAExC,YACmB,OAAe,EACf,IAAuB,EACxC,OAAoC,EAAE;QAFrB,YAAO,GAAP,OAAO,CAAQ;QACf,SAAI,GAAJ,IAAI,CAAmB;QAGxC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC;IACrD,CAAC;IAED,MAAM,CACJ,OAA8B,EAC9B,SAAiB;QAEjB,OAAO,IAAI,OAAO,CAAC,CAAC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AM,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF;AAkBD,SAAS,kBAAkB,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CACtB,MAAM,CAAC,IAAI,EAAE,CACyB,CAAC;IACzC,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC3E,OAAO,KAAmC,CAAC;IAC7C,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @owner src/compute/overlay.ts
3
+ * @does Define the provider boundary for system-level compute HUD rendering.
4
+ * @needs src/compute/visual-timeline.ts visual action evidence
5
+ * @feeds macOS AppKit overlay provider, MCP computer-use evidence
6
+ * @breaks Mixing HUD rendering with action dispatch can make evidence lie about what actually ran.
7
+ * @invariants Overlay providers may only acknowledge rendering; transports remain the action executors.
8
+ * @side-effects provider-dependent rendering only
9
+ * @perf O(pointer samples) per render request
10
+ * @concurrency providers serialize their own native process or window state
11
+ * @test tests/unit/compute-overlay.test.ts
12
+ * @stability experimental
13
+ * @since 0.224.0
14
+ */
15
+ import type { ComputeVisualAction, ComputeVisualAffordance, ComputeVisualCursorPoint, ComputeCursorState, ComputeVisualOverlayStatus } from "./visual-timeline.js";
16
+ import { COMPUTE_CURSOR_STYLE_ID } from "./cursor-visual-style.js";
17
+ export interface ComputeOverlaySample {
18
+ at_ms: number;
19
+ x: number;
20
+ y: number;
21
+ screenIndex?: number;
22
+ }
23
+ export interface ComputeOverlayRequest {
24
+ action_id: string;
25
+ action: string;
26
+ visual_style: typeof COMPUTE_CURSOR_STYLE_ID;
27
+ state: ComputeCursorState;
28
+ affordance: ComputeVisualAffordance;
29
+ target: ComputeOverlaySample;
30
+ duration_ms: number;
31
+ samples: ComputeOverlaySample[];
32
+ }
33
+ export interface ComputeOverlayProvider {
34
+ readonly provider: ComputeVisualOverlayStatus["provider"];
35
+ currentPoint?(): ComputeVisualCursorPoint | undefined;
36
+ render(action: ComputeVisualAction): Promise<ComputeVisualOverlayStatus>;
37
+ close?(): Promise<void>;
38
+ }
39
+ export declare const NOOP_COMPUTE_OVERLAY_PROVIDER: ComputeOverlayProvider;
40
+ export declare function computeOverlayRequestFromAction(action: ComputeVisualAction): ComputeOverlayRequest | undefined;
41
+ export declare function attachComputeOverlayStatus(action: ComputeVisualAction, provider: ComputeOverlayProvider): Promise<ComputeVisualAction>;
42
+ //# sourceMappingURL=overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/compute/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAE3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,uBAAuB,CAAC;IAC7C,KAAK,EAAE,kBAAkB,CAAC;IAC1B,UAAU,EAAE,uBAAuB,CAAC;IACpC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC1D,YAAY,CAAC,IAAI,wBAAwB,GAAG,SAAS,CAAC;IACtD,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACzE,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAED,eAAO,MAAM,6BAA6B,EAAE,sBAQ3C,CAAC;AAEF,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,mBAAmB,GAC1B,qBAAqB,GAAG,SAAS,CAenC;AAiDD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,sBAAsB,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAK9B"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @owner src/compute/overlay.ts
3
+ * @does Define the provider boundary for system-level compute HUD rendering.
4
+ * @needs src/compute/visual-timeline.ts visual action evidence
5
+ * @feeds macOS AppKit overlay provider, MCP computer-use evidence
6
+ * @breaks Mixing HUD rendering with action dispatch can make evidence lie about what actually ran.
7
+ * @invariants Overlay providers may only acknowledge rendering; transports remain the action executors.
8
+ * @side-effects provider-dependent rendering only
9
+ * @perf O(pointer samples) per render request
10
+ * @concurrency providers serialize their own native process or window state
11
+ * @test tests/unit/compute-overlay.test.ts
12
+ * @stability experimental
13
+ * @since 0.224.0
14
+ */
15
+ import { COMPUTE_CURSOR_STYLE_ID } from "./cursor-visual-style.js";
16
+ export const NOOP_COMPUTE_OVERLAY_PROVIDER = {
17
+ provider: "none",
18
+ async render() {
19
+ return {
20
+ provider: "none",
21
+ status: "not_requested",
22
+ };
23
+ },
24
+ };
25
+ export function computeOverlayRequestFromAction(action) {
26
+ const target = action.target?.point;
27
+ if (!target)
28
+ return undefined;
29
+ const samples = action.pointer_plan?.samples.length
30
+ ? action.pointer_plan.samples.map(sampleFromPointerSample)
31
+ : [sampleFromPoint(target, 0)];
32
+ return {
33
+ action_id: action.action_id,
34
+ action: action.action,
35
+ visual_style: COMPUTE_CURSOR_STYLE_ID,
36
+ ...overlayAffordanceFromAction(action.action),
37
+ target: sampleFromPoint(target, action.pointer_plan?.duration_ms ?? 0),
38
+ duration_ms: action.pointer_plan?.duration_ms ?? 120,
39
+ samples,
40
+ };
41
+ }
42
+ function overlayAffordanceFromAction(action) {
43
+ switch (action) {
44
+ case "compute_click":
45
+ return {
46
+ state: "press",
47
+ affordance: {
48
+ cursor: "mac-pointer",
49
+ halo: "pressure-bloom",
50
+ click_ripple: true,
51
+ },
52
+ };
53
+ case "compute_wait":
54
+ return {
55
+ state: "wait",
56
+ affordance: { cursor: "mac-pointer", halo: "busy-orbit" },
57
+ };
58
+ case "compute_type":
59
+ return {
60
+ state: "type",
61
+ affordance: { cursor: "mac-pointer", halo: "pressure-bloom" },
62
+ };
63
+ case "compute_scroll":
64
+ return {
65
+ state: "scroll",
66
+ affordance: { cursor: "mac-pointer", halo: "lift-shadow", trail: true },
67
+ };
68
+ case "compute_screenshot":
69
+ case "compute_snapshot":
70
+ case "compute_capture":
71
+ case "compute_find":
72
+ case "compute_observe":
73
+ case "compute_assert":
74
+ return {
75
+ state: "observe",
76
+ affordance: { cursor: "mac-pointer", halo: "lift-shadow" },
77
+ };
78
+ default:
79
+ return {
80
+ state: "target",
81
+ affordance: { cursor: "mac-pointer", halo: "lift-shadow" },
82
+ };
83
+ }
84
+ }
85
+ export async function attachComputeOverlayStatus(action, provider) {
86
+ return {
87
+ ...action,
88
+ overlay: await provider.render(action),
89
+ };
90
+ }
91
+ function sampleFromPointerSample(sample) {
92
+ return {
93
+ at_ms: sample.at_ms,
94
+ x: sample.x,
95
+ y: sample.y,
96
+ ...(sample.coordinate_space.screenIndex !== undefined
97
+ ? { screenIndex: sample.coordinate_space.screenIndex }
98
+ : {}),
99
+ };
100
+ }
101
+ function sampleFromPoint(point, atMs) {
102
+ return {
103
+ at_ms: atMs,
104
+ x: point.x,
105
+ y: point.y,
106
+ ...(point.coordinate_space.screenIndex !== undefined
107
+ ? { screenIndex: point.coordinate_space.screenIndex }
108
+ : {}),
109
+ };
110
+ }
111
+ //# sourceMappingURL=overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.js","sourceRoot":"","sources":["../../src/compute/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AA2BnE,MAAM,CAAC,MAAM,6BAA6B,GAA2B;IACnE,QAAQ,EAAE,MAAM;IAChB,KAAK,CAAC,MAAM;QACV,OAAO;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,eAAe;SACxB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,UAAU,+BAA+B,CAC7C,MAA2B;IAE3B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IACpC,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,MAAM;QACjD,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;QAC1D,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IACjC,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,YAAY,EAAE,uBAAuB;QACrC,GAAG,2BAA2B,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7C,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,WAAW,IAAI,CAAC,CAAC;QACtE,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,WAAW,I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AAG,MAAM;QACT,OAAO,EAAE,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;KACvC,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAC9B,MAAkC;IAElC,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,CAAC,EAAE,MAAM,CAAC,CAAC;QACX,CAAC,EAAE,MAAM,CAAC,CAAC;QACX,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,KAAK,SAAS;YACnD,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE;YACtD,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CACtB,KAA+B,EAC/B,IAAY;IAEZ,OAAO;QACL,KAAK,EAAE,IAAI;QACX,CAAC,EAAE,KAAK,CAAC,CAAC;QACV,CAAC,EAAE,KAAK,CAAC,CAAC;QACV,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,WAAW,KAAK,SAAS;YAClD,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,EAAE;YACrD,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @owner src/compute/platform-overlays.ts
3
+ * @does Select the native compute overlay HUD provider for the host platform.
4
+ * @needs macOS AppKit, Windows Win32, Linux GTK overlay providers
5
+ * @feeds compute CLI, computer-use MCP profile, doctor compute
6
+ * @breaks Platform-specific provider branching in callers causes divergent overlay behavior.
7
+ * @invariants Supported desktop platforms map to exactly one native system HUD provider.
8
+ * @side-effects none at selection time
9
+ * @perf O(1)
10
+ * @concurrency pure factory
11
+ * @test tests/unit/compute-platform-overlays.test.ts
12
+ * @stability experimental
13
+ * @since 0.224.0
14
+ */
15
+ import type { ComputeOverlayProvider } from "./overlay.js";
16
+ export interface PlatformComputeOverlayProviderOptions {
17
+ platform?: NodeJS.Platform;
18
+ }
19
+ export declare function createPlatformComputeOverlayProvider(opts?: PlatformComputeOverlayProviderOptions): ComputeOverlayProvider | undefined;
20
+ //# sourceMappingURL=platform-overlays.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-overlays.d.ts","sourceRoot":"","sources":["../../src/compute/platform-overlays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG3D,MAAM,WAAW,qCAAqC;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC5B;AAED,wBAAgB,oCAAoC,CAClD,IAAI,GAAE,qCAA0C,GAC/C,sBAAsB,GAAG,SAAS,CAYpC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @owner src/compute/platform-overlays.ts
3
+ * @does Select the native compute overlay HUD provider for the host platform.
4
+ * @needs macOS AppKit, Windows Win32, Linux GTK overlay providers
5
+ * @feeds compute CLI, computer-use MCP profile, doctor compute
6
+ * @breaks Platform-specific provider branching in callers causes divergent overlay behavior.
7
+ * @invariants Supported desktop platforms map to exactly one native system HUD provider.
8
+ * @side-effects none at selection time
9
+ * @perf O(1)
10
+ * @concurrency pure factory
11
+ * @test tests/unit/compute-platform-overlays.test.ts
12
+ * @stability experimental
13
+ * @since 0.224.0
14
+ */
15
+ import { LinuxGtkOverlayDaemonProvider } from "./linux-overlay.js";
16
+ import { MacosAppKitOverlayDaemonProvider } from "./macos-overlay.js";
17
+ import { WindowsWin32OverlayDaemonProvider } from "./windows-overlay.js";
18
+ export function createPlatformComputeOverlayProvider(opts = {}) {
19
+ const platform = opts.platform ?? process.platform;
20
+ if (platform === "darwin") {
21
+ return new MacosAppKitOverlayDaemonProvider({ platform });
22
+ }
23
+ if (platform === "win32") {
24
+ return new WindowsWin32OverlayDaemonProvider({ platform });
25
+ }
26
+ if (platform === "linux") {
27
+ return new LinuxGtkOverlayDaemonProvider({ platform });
28
+ }
29
+ return undefined;
30
+ }
31
+ //# sourceMappingURL=platform-overlays.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-overlays.js","sourceRoot":"","sources":["../../src/compute/platform-overlays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAMzE,MAAM,UAAU,oCAAoC,CAClD,OAA8C,EAAE;IAEhD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IACnD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,IAAI,gCAAgC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5D,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,IAAI,iCAAiC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,IAAI,6BAA6B,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * @owner src/compute/visual-timeline.ts
3
+ * @does Convert compute capture and action evidence into ordered visual cursor timelines and action records.
4
+ * @needs src/compute/capture.ts types, src/compute/cursor-visual-style.ts
5
+ * @feeds compute capture packets, computer-use MCP evidence, docs cursor replay demo
6
+ * @breaks Missing, unordered, or drifting evidence makes computer-use frontends misleading.
7
+ * @invariants Timeline events replay UI affordances; visual_action binds target, pointer motion, overlay, and dispatch evidence.
8
+ * @side-effects none
9
+ * @perf O(number of timeline events); no image bytes are copied.
10
+ * @concurrency pure functions
11
+ * @test tests/unit/compute-visual-timeline.test.ts, tests/unit/commands/compute.test.ts
12
+ * @stability beta
13
+ * @since 0.224.0
14
+ */
15
+ import type { ComputeCapturePacket } from "./capture.js";
16
+ import { COMPUTE_CURSOR_STYLE_ID } from "./cursor-visual-style.js";
17
+ export type ComputeCursorState = "idle" | "observe" | "move" | "target" | "press" | "type" | "scroll" | "wait" | "success" | "error";
18
+ export type ComputeCursorGlyph = "mac-pointer";
19
+ export type ComputeCursorHalo = "none" | "lift-shadow" | "pressure-bloom" | "busy-orbit" | "success-spark" | "error-shake";
20
+ export type ComputeCursorTransition = "settle" | "glide" | "pulse" | "press" | "spin" | "snap" | "fade" | "scan";
21
+ export interface ComputeVisualCoordinateSpace {
22
+ kind: "screen-pixels" | "image-pixels";
23
+ origin: "top-left";
24
+ screenIndex?: number;
25
+ width?: number;
26
+ height?: number;
27
+ }
28
+ export interface ComputeVisualCursorPoint {
29
+ x: number;
30
+ y: number;
31
+ coordinate_space: ComputeVisualCoordinateSpace;
32
+ }
33
+ export interface ComputeVisualAffordance {
34
+ cursor: ComputeCursorGlyph;
35
+ halo: ComputeCursorHalo;
36
+ trail?: boolean;
37
+ click_ripple?: boolean;
38
+ }
39
+ export interface ComputeVisualTimelineEvent {
40
+ index: number;
41
+ at_ms: number;
42
+ duration_ms: number;
43
+ state: ComputeCursorState;
44
+ label: string;
45
+ action: string;
46
+ transition: ComputeCursorTransition;
47
+ affordance: ComputeVisualAffordance;
48
+ ok?: boolean;
49
+ transport?: string;
50
+ ref?: string;
51
+ point?: ComputeVisualCursorPoint;
52
+ }
53
+ export interface ComputeVisualTimeline {
54
+ schema_version: 1;
55
+ replayable: true;
56
+ subject?: {
57
+ app?: string;
58
+ tool?: string;
59
+ };
60
+ coordinate_space?: ComputeVisualCoordinateSpace;
61
+ theme: {
62
+ name: typeof COMPUTE_CURSOR_STYLE_ID;
63
+ prefers_reduced_motion: "collapse-durations";
64
+ };
65
+ events: ComputeVisualTimelineEvent[];
66
+ }
67
+ export interface ComputeActionTimelineInput {
68
+ tool: string;
69
+ action: string;
70
+ params?: Record<string, unknown>;
71
+ ok: boolean;
72
+ transport?: string;
73
+ }
74
+ export type ComputeVisualActionStatus = "succeeded" | "failed";
75
+ export interface ComputeVisualActionTarget {
76
+ ref?: string;
77
+ point?: ComputeVisualCursorPoint;
78
+ }
79
+ export interface ComputeVisualPointerSample {
80
+ at_ms: number;
81
+ x: number;
82
+ y: number;
83
+ coordinate_space: ComputeVisualCoordinateSpace;
84
+ }
85
+ export interface ComputeVisualPointerPlan {
86
+ curve: "spring-bezier-v1";
87
+ duration_ms: number;
88
+ from: ComputeVisualCursorPoint;
89
+ to: ComputeVisualCursorPoint;
90
+ samples: ComputeVisualPointerSample[];
91
+ }
92
+ export interface ComputeVisualOverlayStatus {
93
+ provider: "none" | "macos-appkit" | "windows-win32" | "linux-gtk";
94
+ status: "not_requested" | "unavailable" | "scheduled" | "arrived" | "timeout" | "failed";
95
+ acknowledged_at_ms?: number;
96
+ error?: string;
97
+ }
98
+ export interface ComputeVisualActionDispatch {
99
+ status: ComputeVisualActionStatus;
100
+ transport?: string;
101
+ target?: ComputeVisualCursorPoint;
102
+ }
103
+ export interface ComputeVisualActionPostCapture {
104
+ ok: boolean;
105
+ transport?: string;
106
+ data?: unknown;
107
+ error?: {
108
+ reason: string;
109
+ minimum_capability?: string;
110
+ exit_code?: number;
111
+ };
112
+ }
113
+ export interface ComputeVisualAction {
114
+ schema_version: 2;
115
+ action_id: string;
116
+ tool: string;
117
+ action: string;
118
+ target?: ComputeVisualActionTarget;
119
+ pointer_plan?: ComputeVisualPointerPlan;
120
+ overlay: ComputeVisualOverlayStatus;
121
+ dispatch: ComputeVisualActionDispatch;
122
+ post_capture?: ComputeVisualActionPostCapture;
123
+ }
124
+ export interface ComputeActionVisualEvidence {
125
+ visual_timeline: ComputeVisualTimeline;
126
+ visual_action: ComputeVisualAction;
127
+ }
128
+ export declare function buildCaptureVisualTimeline(packet: Omit<ComputeCapturePacket, "visual_timeline">): ComputeVisualTimeline;
129
+ export declare function buildComputeActionVisualTimeline(input: ComputeActionTimelineInput): ComputeVisualTimeline;
130
+ export declare function buildComputeActionVisualEvidence(input: ComputeActionTimelineInput): ComputeActionVisualEvidence;
131
+ export declare function validateComputeVisualAction(action: ComputeVisualAction): string[];
132
+ //# sourceMappingURL=visual-timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visual-timeline.d.ts","sourceRoot":"","sources":["../../src/compute/visual-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,SAAS,GACT,MAAM,GACN,QAAQ,GACR,OAAO,GACP,MAAM,GACN,QAAQ,GACR,MAAM,GACN,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,aAAa,GACb,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,aAAa,CAAC;AAElB,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,CAAC;AAEX,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,eAAe,GAAG,cAAc,CAAC;IACvC,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,gBAAgB,EAAE,4BAA4B,CAAC;CAChD;AAED,MAAM,WAAW,uBAAu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