@ai-matrx/desktop-protocol 0.21.2 → 0.21.4
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 +20 -0
- package/dist/client.cjs +752 -597
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +752 -597
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +544 -312
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +326 -11
- package/dist/index.d.ts +326 -11
- package/dist/index.js +544 -312
- package/dist/index.js.map +1 -1
- package/dist/{models-C98SDul-.d.cts → models-i7KQcuyA.d.cts} +648 -8
- package/dist/{models-C98SDul-.d.ts → models-i7KQcuyA.d.ts} +648 -8
- package/dist/react.d.cts +276 -0
- package/dist/react.d.ts +276 -0
- package/generated/desktop-protocol.schema.json +1168 -2
- package/package.json +14 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
|
|
4
4
|
var PROTOCOL_MAJOR = 1;
|
|
5
|
-
var PROTOCOL_MINOR =
|
|
5
|
+
var PROTOCOL_MINOR = 22;
|
|
6
6
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
7
7
|
var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
8
8
|
var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -1311,7 +1311,7 @@ var AppsWindowsSaveNamesParams = z13.strictObject({ app_key: AppKey });
|
|
|
1311
1311
|
// src/schema/service.ts
|
|
1312
1312
|
import { z as z14 } from "zod";
|
|
1313
1313
|
var SERVICE_MAX_FRAME_BYTES = 16777216;
|
|
1314
|
-
var ServiceName = z14.enum(["ml", "coding"]);
|
|
1314
|
+
var ServiceName = z14.enum(["ml", "coding", "tools"]);
|
|
1315
1315
|
var ContractHash = z14.string().regex(/^[0-9a-f]{64}$/);
|
|
1316
1316
|
var ServiceToken = z14.string().regex(/^[A-Za-z0-9_-]{43}$/);
|
|
1317
1317
|
var ServiceRequestId = u32;
|
|
@@ -1446,112 +1446,251 @@ var ClipboardReadResult = z17.strictObject({
|
|
|
1446
1446
|
var ClipboardWriteParams = z17.strictObject({ text: z17.string().max(1048576) });
|
|
1447
1447
|
var ClipboardWriteResult = z17.strictObject({ bytes: nonNegInt });
|
|
1448
1448
|
|
|
1449
|
-
// src/schema/
|
|
1449
|
+
// src/schema/git.ts
|
|
1450
1450
|
import { z as z18 } from "zod";
|
|
1451
|
-
var
|
|
1451
|
+
var GIT_MAX_OUTPUT_CHARS = 262144;
|
|
1452
|
+
var GitText = z18.string().max(GIT_MAX_OUTPUT_CHARS);
|
|
1453
|
+
var GitName = z18.string().min(1).max(255).regex(/^[^-\s][^\s]*$/);
|
|
1454
|
+
var GitOutputResult = z18.strictObject({ output: GitText, truncated: z18.boolean() });
|
|
1455
|
+
var GitStatusParams = z18.strictObject({ cwd: AbsPath });
|
|
1456
|
+
var GitStatusFile = z18.strictObject({
|
|
1457
|
+
path: z18.string(),
|
|
1458
|
+
/** Porcelain v1 status letters: index (staged) and worktree; "?" for untracked. */
|
|
1459
|
+
index: z18.string().length(1),
|
|
1460
|
+
worktree: z18.string().length(1)
|
|
1461
|
+
});
|
|
1462
|
+
var GitStatusResult = z18.strictObject({
|
|
1463
|
+
/** The checked-out branch; null when HEAD is detached. */
|
|
1464
|
+
branch: z18.string().nullable(),
|
|
1465
|
+
upstream: z18.string().nullable(),
|
|
1466
|
+
ahead: nonNegInt,
|
|
1467
|
+
behind: nonNegInt,
|
|
1468
|
+
files: z18.array(GitStatusFile).max(5e3),
|
|
1469
|
+
clean: z18.boolean(),
|
|
1470
|
+
/** More than 5000 changed files: the list is cut. */
|
|
1471
|
+
truncated: z18.boolean()
|
|
1472
|
+
});
|
|
1473
|
+
var GitDiffParams = z18.strictObject({ cwd: AbsPath, path: z18.string().max(4096).optional(), staged: z18.boolean().default(false) });
|
|
1474
|
+
var GitDiffResult = z18.strictObject({ diff: GitText, truncated: z18.boolean() });
|
|
1475
|
+
var GitLogParams = z18.strictObject({ cwd: AbsPath, limit: z18.int().min(1).max(500).default(50) });
|
|
1476
|
+
var GitLogCommit = z18.strictObject({ sha: z18.string(), short: z18.string(), author: z18.string(), date: z18.string(), subject: z18.string() });
|
|
1477
|
+
var GitLogResult = z18.strictObject({ commits: z18.array(GitLogCommit).max(500) });
|
|
1478
|
+
var GitAddParams = z18.strictObject({ cwd: AbsPath, paths: z18.array(z18.string().min(1).max(4096)).min(1).max(1e3) });
|
|
1479
|
+
var GitCommitParams = z18.strictObject({
|
|
1480
|
+
cwd: AbsPath,
|
|
1481
|
+
message: z18.string().min(1).max(65536),
|
|
1482
|
+
amend: z18.boolean().default(false),
|
|
1483
|
+
/** "Name <email>"; absent = the computer's own git identity. */
|
|
1484
|
+
author: z18.string().max(512).optional()
|
|
1485
|
+
});
|
|
1486
|
+
var GitCommitResult = z18.strictObject({ sha: z18.string(), output: GitText, truncated: z18.boolean() });
|
|
1487
|
+
var GitPushParams = z18.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), force_with_lease: z18.boolean().default(false) });
|
|
1488
|
+
var GitPullParams = z18.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), rebase: z18.boolean().default(false) });
|
|
1489
|
+
var GitBranchParams = z18.strictObject({ cwd: AbsPath, action: z18.enum(["list", "create", "delete", "switch"]), name: GitName.optional() });
|
|
1490
|
+
var GitBranchResult = z18.strictObject({
|
|
1491
|
+
/** The branch checked out after the action; null when detached. */
|
|
1492
|
+
current: z18.string().nullable(),
|
|
1493
|
+
/** Local branches (filled by `list`; empty otherwise). */
|
|
1494
|
+
branches: z18.array(z18.string()).max(5e3),
|
|
1495
|
+
output: GitText,
|
|
1496
|
+
truncated: z18.boolean()
|
|
1497
|
+
});
|
|
1498
|
+
var GitStashParams = z18.strictObject({ cwd: AbsPath, action: z18.enum(["push", "pop", "list", "drop"]), message: z18.string().max(4096).optional() });
|
|
1499
|
+
var GitCloneParams = z18.strictObject({
|
|
1500
|
+
url: z18.string().min(1).max(4096).regex(/^[^-]/),
|
|
1501
|
+
/** The folder to create; must not exist yet (or be empty). */
|
|
1502
|
+
dest: AbsPath,
|
|
1503
|
+
branch: GitName.optional(),
|
|
1504
|
+
depth: z18.int().min(1).max(1e6).optional()
|
|
1505
|
+
});
|
|
1506
|
+
|
|
1507
|
+
// src/schema/web.ts
|
|
1508
|
+
import { z as z19 } from "zod";
|
|
1509
|
+
var WEB_MAX_TEXT_CHARS = 524288;
|
|
1510
|
+
var WebUrl = z19.string().min(1).max(8192).regex(/^https?:\/\//);
|
|
1511
|
+
var WebText = z19.string().max(WEB_MAX_TEXT_CHARS);
|
|
1512
|
+
var WebHeader = z19.strictObject({ name: z19.string().min(1).max(256), value: z19.string().max(8192) });
|
|
1513
|
+
var WebFetchParams = z19.strictObject({
|
|
1514
|
+
url: WebUrl,
|
|
1515
|
+
method: z19.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("GET"),
|
|
1516
|
+
headers: z19.array(WebHeader).max(64).default([]),
|
|
1517
|
+
body: z19.string().max(1048576).optional(),
|
|
1518
|
+
follow_redirects: z19.boolean().default(true),
|
|
1519
|
+
timeout_s: z19.int().min(1).max(300).default(30)
|
|
1520
|
+
});
|
|
1521
|
+
var WebFetchResult = z19.strictObject({
|
|
1522
|
+
status: z19.int().min(100).max(999),
|
|
1523
|
+
reason: z19.string(),
|
|
1524
|
+
/** The final URL after redirects. */
|
|
1525
|
+
url: z19.string(),
|
|
1526
|
+
content_type: z19.string().nullable(),
|
|
1527
|
+
headers: z19.array(WebHeader),
|
|
1528
|
+
body: WebText,
|
|
1529
|
+
truncated: z19.boolean(),
|
|
1530
|
+
bytes: nonNegInt,
|
|
1531
|
+
elapsed_ms: nonNegInt
|
|
1532
|
+
});
|
|
1533
|
+
var WebScrapeParams = z19.strictObject({
|
|
1534
|
+
urls: z19.array(WebUrl).min(1).max(20),
|
|
1535
|
+
use_cache: z19.boolean().default(true),
|
|
1536
|
+
get_links: z19.boolean().default(false)
|
|
1537
|
+
});
|
|
1538
|
+
var WebScrapePage = z19.strictObject({
|
|
1539
|
+
url: z19.string(),
|
|
1540
|
+
ok: z19.boolean(),
|
|
1541
|
+
status: z19.int().min(0).max(999).nullable(),
|
|
1542
|
+
title: z19.string().nullable(),
|
|
1543
|
+
/** The page's readable content (markdown-like text from the scraper's parse). */
|
|
1544
|
+
text: WebText,
|
|
1545
|
+
truncated: z19.boolean(),
|
|
1546
|
+
/** Links found on the page (only with get_links). */
|
|
1547
|
+
links: z19.array(z19.string()).max(2e3),
|
|
1548
|
+
/** Why the page failed (blocked, timeout, not found…), in the scraper's words; null when ok. */
|
|
1549
|
+
error: z19.string().nullable(),
|
|
1550
|
+
/** How the page was fetched (http, browser, cache). */
|
|
1551
|
+
via: z19.string().nullable()
|
|
1552
|
+
});
|
|
1553
|
+
var WebScrapeResult = z19.strictObject({ pages: z19.array(WebScrapePage), elapsed_ms: nonNegInt });
|
|
1554
|
+
var WebSearchParams = z19.strictObject({
|
|
1555
|
+
keywords: z19.array(z19.string().min(1).max(400)).min(1).max(5),
|
|
1556
|
+
country: z19.string().min(2).max(2).default("us"),
|
|
1557
|
+
count: z19.int().min(1).max(20).default(10),
|
|
1558
|
+
freshness: z19.enum(["pd", "pw", "pm", "py"]).optional()
|
|
1559
|
+
});
|
|
1560
|
+
var WebSearchHit = z19.strictObject({ title: z19.string(), url: z19.string(), description: z19.string() });
|
|
1561
|
+
var WebSearchQueryResult = z19.strictObject({ keyword: z19.string(), hits: z19.array(WebSearchHit), error: z19.string().nullable() });
|
|
1562
|
+
var WebSearchResult = z19.strictObject({ queries: z19.array(WebSearchQueryResult), elapsed_ms: nonNegInt });
|
|
1563
|
+
var ToolsWebSearchParams = z19.strictObject({
|
|
1564
|
+
keywords: z19.array(z19.string().min(1).max(400)).min(1).max(5),
|
|
1565
|
+
country: z19.string().min(2).max(2).default("us"),
|
|
1566
|
+
count: z19.int().min(1).max(20).default(10),
|
|
1567
|
+
freshness: z19.enum(["pd", "pw", "pm", "py"]).optional(),
|
|
1568
|
+
brave_api_key: z19.string().min(1).max(512).nullable()
|
|
1569
|
+
});
|
|
1570
|
+
var WebBrowserFetchParams = z19.strictObject({
|
|
1571
|
+
url: WebUrl,
|
|
1572
|
+
/** A CSS selector to wait for before reading the page. */
|
|
1573
|
+
wait_for: z19.string().max(1024).optional(),
|
|
1574
|
+
wait_timeout_ms: z19.int().min(100).max(12e4).default(3e4),
|
|
1575
|
+
/** true: readable text; false: the rendered HTML. */
|
|
1576
|
+
extract_text: z19.boolean().default(true)
|
|
1577
|
+
});
|
|
1578
|
+
var WebBrowserFetchResult = z19.strictObject({
|
|
1579
|
+
url: z19.string(),
|
|
1580
|
+
status: z19.int().min(0).max(999).nullable(),
|
|
1581
|
+
title: z19.string().nullable(),
|
|
1582
|
+
content: WebText,
|
|
1583
|
+
truncated: z19.boolean(),
|
|
1584
|
+
elapsed_ms: nonNegInt
|
|
1585
|
+
});
|
|
1586
|
+
var ToolsServiceProgress = z19.strictObject({ phase: z19.enum(["fetching", "installing"]), done: nonNegInt, total: nonNegInt });
|
|
1587
|
+
|
|
1588
|
+
// src/schema/system.ts
|
|
1589
|
+
import { z as z20 } from "zod";
|
|
1590
|
+
var SystemOpenUrlParams = z20.strictObject({
|
|
1452
1591
|
/** http, https or mailto; opened in the person's default app for it. */
|
|
1453
|
-
url:
|
|
1592
|
+
url: z20.string().min(1).max(4096)
|
|
1454
1593
|
});
|
|
1455
|
-
var SystemOpenUrlResult =
|
|
1456
|
-
var SystemOpenPathParams =
|
|
1594
|
+
var SystemOpenUrlResult = z20.strictObject({ url: z20.string().max(4096) });
|
|
1595
|
+
var SystemOpenPathParams = z20.strictObject({
|
|
1457
1596
|
path: AbsPath,
|
|
1458
1597
|
/** Show it in the file manager (Finder, Explorer) instead of opening it. */
|
|
1459
|
-
reveal:
|
|
1598
|
+
reveal: z20.boolean().default(false)
|
|
1460
1599
|
});
|
|
1461
|
-
var SystemOpenPathResult =
|
|
1462
|
-
var SystemNotifyParams =
|
|
1463
|
-
title:
|
|
1464
|
-
body:
|
|
1600
|
+
var SystemOpenPathResult = z20.strictObject({ path: AbsPath, revealed: z20.boolean() });
|
|
1601
|
+
var SystemNotifyParams = z20.strictObject({
|
|
1602
|
+
title: z20.string().min(1).max(128),
|
|
1603
|
+
body: z20.string().max(1024).default("")
|
|
1465
1604
|
});
|
|
1466
|
-
var SystemNotifyResult =
|
|
1605
|
+
var SystemNotifyResult = z20.strictObject({
|
|
1467
1606
|
/** False when this computer has no notification service to show it (a bare Linux box). */
|
|
1468
|
-
shown:
|
|
1607
|
+
shown: z20.boolean()
|
|
1469
1608
|
});
|
|
1470
1609
|
|
|
1471
1610
|
// src/schema/screen.ts
|
|
1472
|
-
import { z as
|
|
1473
|
-
var ScreenDisplay =
|
|
1611
|
+
import { z as z21 } from "zod";
|
|
1612
|
+
var ScreenDisplay = z21.strictObject({
|
|
1474
1613
|
/** The OS's display id; pass it to screen.capture. */
|
|
1475
1614
|
id: nonNegInt,
|
|
1476
|
-
name:
|
|
1615
|
+
name: z21.string().max(128),
|
|
1477
1616
|
/** Position and size in the OS's logical points (x and y may be negative left of or above the main display). */
|
|
1478
|
-
x:
|
|
1479
|
-
y:
|
|
1480
|
-
width:
|
|
1481
|
-
height:
|
|
1617
|
+
x: z21.int(),
|
|
1618
|
+
y: z21.int(),
|
|
1619
|
+
width: z21.int().min(1),
|
|
1620
|
+
height: z21.int().min(1),
|
|
1482
1621
|
/** Pixels per point (2 on a Retina display). */
|
|
1483
|
-
scale:
|
|
1484
|
-
primary:
|
|
1622
|
+
scale: z21.number().min(0.1).max(8),
|
|
1623
|
+
primary: z21.boolean()
|
|
1485
1624
|
});
|
|
1486
|
-
var ScreenListParams =
|
|
1487
|
-
var ScreenListResult =
|
|
1488
|
-
var ScreenCaptureParams =
|
|
1625
|
+
var ScreenListParams = z21.strictObject({});
|
|
1626
|
+
var ScreenListResult = z21.strictObject({ displays: z21.array(ScreenDisplay).max(32) });
|
|
1627
|
+
var ScreenCaptureParams = z21.strictObject({
|
|
1489
1628
|
/** The display (from screen.list); the primary display when absent. */
|
|
1490
1629
|
display_id: nonNegInt.optional(),
|
|
1491
|
-
format:
|
|
1630
|
+
format: z21.enum(["jpeg", "png"]).default("jpeg"),
|
|
1492
1631
|
/** Scale the picture down to at most this width in pixels (kept when already smaller). */
|
|
1493
|
-
max_width:
|
|
1632
|
+
max_width: z21.int().min(160).max(7680).default(1600)
|
|
1494
1633
|
});
|
|
1495
|
-
var ScreenCaptureResult =
|
|
1634
|
+
var ScreenCaptureResult = z21.strictObject({
|
|
1496
1635
|
display_id: nonNegInt,
|
|
1497
|
-
mime_type:
|
|
1498
|
-
width:
|
|
1499
|
-
height:
|
|
1636
|
+
mime_type: z21.enum(["image/jpeg", "image/png"]),
|
|
1637
|
+
width: z21.int().min(1),
|
|
1638
|
+
height: z21.int().min(1),
|
|
1500
1639
|
/** The display's full resolution in pixels, before scaling. */
|
|
1501
|
-
source_width:
|
|
1502
|
-
source_height:
|
|
1640
|
+
source_width: z21.int().min(1),
|
|
1641
|
+
source_height: z21.int().min(1),
|
|
1503
1642
|
/** The image, base64 (at most 6 MiB of text). */
|
|
1504
|
-
data_base64:
|
|
1643
|
+
data_base64: z21.string().max(6291456)
|
|
1505
1644
|
});
|
|
1506
1645
|
|
|
1507
1646
|
// src/schema/window.ts
|
|
1508
|
-
import { z as
|
|
1509
|
-
var WindowInfo =
|
|
1647
|
+
import { z as z22 } from "zod";
|
|
1648
|
+
var WindowInfo = z22.strictObject({
|
|
1510
1649
|
/** The OS's window handle (macOS window number, Windows HWND, X11 window id). */
|
|
1511
1650
|
id: nonNegInt,
|
|
1512
|
-
title:
|
|
1651
|
+
title: z22.string().max(512),
|
|
1513
1652
|
/** Position and size in logical points. */
|
|
1514
|
-
x:
|
|
1515
|
-
y:
|
|
1516
|
-
width:
|
|
1517
|
-
height:
|
|
1653
|
+
x: z22.int(),
|
|
1654
|
+
y: z22.int(),
|
|
1655
|
+
width: z22.int().min(0),
|
|
1656
|
+
height: z22.int().min(0),
|
|
1518
1657
|
/**
|
|
1519
1658
|
* The application that owns the window, by the name the OS shows people; absent when the OS does
|
|
1520
1659
|
* not say. Optional (never null, the schema rule) because it was added in protocol 1.7: an older
|
|
1521
1660
|
* app's answer has no such field (FIELDS_SINCE).
|
|
1522
1661
|
*/
|
|
1523
|
-
app:
|
|
1662
|
+
app: z22.string().max(256).optional(),
|
|
1524
1663
|
/** The owning process id; absent when the OS does not say. Added in protocol 1.7. */
|
|
1525
|
-
pid:
|
|
1664
|
+
pid: z22.int().min(0).optional()
|
|
1526
1665
|
});
|
|
1527
|
-
var WindowListParams =
|
|
1666
|
+
var WindowListParams = z22.strictObject({
|
|
1528
1667
|
/** Case-insensitive substring of the window title. */
|
|
1529
|
-
title:
|
|
1530
|
-
limit:
|
|
1668
|
+
title: z22.string().min(1).max(256).optional(),
|
|
1669
|
+
limit: z22.int().min(1).max(500).default(100)
|
|
1531
1670
|
});
|
|
1532
|
-
var WindowListResult =
|
|
1533
|
-
windows:
|
|
1671
|
+
var WindowListResult = z22.strictObject({
|
|
1672
|
+
windows: z22.array(WindowInfo).max(500),
|
|
1534
1673
|
total: nonNegInt,
|
|
1535
|
-
truncated:
|
|
1674
|
+
truncated: z22.boolean()
|
|
1536
1675
|
});
|
|
1537
|
-
var WindowFocusParams =
|
|
1538
|
-
var WindowFocusResult =
|
|
1539
|
-
var WindowMoveParams =
|
|
1676
|
+
var WindowFocusParams = z22.strictObject({ id: nonNegInt });
|
|
1677
|
+
var WindowFocusResult = z22.strictObject({ window: WindowInfo });
|
|
1678
|
+
var WindowMoveParams = z22.strictObject({
|
|
1540
1679
|
id: nonNegInt,
|
|
1541
1680
|
/** New top-left corner; unchanged when absent. */
|
|
1542
|
-
x:
|
|
1543
|
-
y:
|
|
1681
|
+
x: z22.int().optional(),
|
|
1682
|
+
y: z22.int().optional(),
|
|
1544
1683
|
/** New size; unchanged when absent. */
|
|
1545
|
-
width:
|
|
1546
|
-
height:
|
|
1684
|
+
width: z22.int().min(50).max(16384).optional(),
|
|
1685
|
+
height: z22.int().min(50).max(16384).optional()
|
|
1547
1686
|
});
|
|
1548
|
-
var WindowMoveResult =
|
|
1549
|
-
var WindowMinimizeParams =
|
|
1550
|
-
var WindowMinimizeResult =
|
|
1687
|
+
var WindowMoveResult = z22.strictObject({ window: WindowInfo });
|
|
1688
|
+
var WindowMinimizeParams = z22.strictObject({ id: nonNegInt });
|
|
1689
|
+
var WindowMinimizeResult = z22.strictObject({ id: nonNegInt });
|
|
1551
1690
|
|
|
1552
1691
|
// src/schema/input.ts
|
|
1553
|
-
import { z as
|
|
1554
|
-
var InputKey =
|
|
1692
|
+
import { z as z23 } from "zod";
|
|
1693
|
+
var InputKey = z23.enum([
|
|
1555
1694
|
"cmd",
|
|
1556
1695
|
"ctrl",
|
|
1557
1696
|
"alt",
|
|
@@ -1631,65 +1770,65 @@ var InputKey = z21.enum([
|
|
|
1631
1770
|
"backslash",
|
|
1632
1771
|
"grave"
|
|
1633
1772
|
]);
|
|
1634
|
-
var InputTypeTextParams =
|
|
1635
|
-
var InputTypeTextResult =
|
|
1636
|
-
var InputHotkeyParams =
|
|
1773
|
+
var InputTypeTextParams = z23.strictObject({ text: z23.string().min(1).max(1e4) });
|
|
1774
|
+
var InputTypeTextResult = z23.strictObject({ characters: z23.int().min(1) });
|
|
1775
|
+
var InputHotkeyParams = z23.strictObject({
|
|
1637
1776
|
/** Pressed together in order and released in reverse: ["cmd", "shift", "t"]. */
|
|
1638
|
-
keys:
|
|
1777
|
+
keys: z23.array(InputKey).min(1).max(6)
|
|
1639
1778
|
});
|
|
1640
|
-
var InputHotkeyResult =
|
|
1641
|
-
var InputPoint =
|
|
1642
|
-
var InputMouseMoveParams =
|
|
1779
|
+
var InputHotkeyResult = z23.strictObject({ keys: z23.array(InputKey) });
|
|
1780
|
+
var InputPoint = z23.strictObject({ x: z23.int(), y: z23.int() });
|
|
1781
|
+
var InputMouseMoveParams = z23.strictObject({
|
|
1643
1782
|
/** Screen position in logical points (the coordinates screen.list and window.list report). */
|
|
1644
|
-
x:
|
|
1645
|
-
y:
|
|
1783
|
+
x: z23.int(),
|
|
1784
|
+
y: z23.int()
|
|
1646
1785
|
});
|
|
1647
|
-
var InputMouseMoveResult =
|
|
1786
|
+
var InputMouseMoveResult = z23.strictObject({
|
|
1648
1787
|
/** Where the pointer is now, read back from the OS. */
|
|
1649
1788
|
position: InputPoint
|
|
1650
1789
|
});
|
|
1651
|
-
var InputMouseClickParams =
|
|
1790
|
+
var InputMouseClickParams = z23.strictObject({
|
|
1652
1791
|
/** Move here first; clicks where the pointer is when absent. */
|
|
1653
|
-
x:
|
|
1654
|
-
y:
|
|
1655
|
-
button:
|
|
1656
|
-
double:
|
|
1792
|
+
x: z23.int().optional(),
|
|
1793
|
+
y: z23.int().optional(),
|
|
1794
|
+
button: z23.enum(["left", "right", "middle"]).default("left"),
|
|
1795
|
+
double: z23.boolean().default(false)
|
|
1657
1796
|
});
|
|
1658
|
-
var InputMouseClickResult =
|
|
1797
|
+
var InputMouseClickResult = z23.strictObject({
|
|
1659
1798
|
position: InputPoint,
|
|
1660
|
-
button:
|
|
1661
|
-
double:
|
|
1799
|
+
button: z23.enum(["left", "right", "middle"]),
|
|
1800
|
+
double: z23.boolean()
|
|
1662
1801
|
});
|
|
1663
1802
|
|
|
1664
1803
|
// src/schema/power.ts
|
|
1665
|
-
import { z as
|
|
1666
|
-
var PowerStatusParams =
|
|
1667
|
-
var PowerStatusResult =
|
|
1668
|
-
has_battery:
|
|
1804
|
+
import { z as z24 } from "zod";
|
|
1805
|
+
var PowerStatusParams = z24.strictObject({});
|
|
1806
|
+
var PowerStatusResult = z24.strictObject({
|
|
1807
|
+
has_battery: z24.boolean(),
|
|
1669
1808
|
/** 0–100; null without a battery. */
|
|
1670
|
-
percent:
|
|
1671
|
-
charging:
|
|
1809
|
+
percent: z24.number().min(0).max(100).nullable(),
|
|
1810
|
+
charging: z24.boolean().nullable(),
|
|
1672
1811
|
/** On wall power; null where the OS does not say. */
|
|
1673
|
-
plugged_in:
|
|
1812
|
+
plugged_in: z24.boolean().nullable(),
|
|
1674
1813
|
/** Minutes of battery left; null when charging, unknown or without a battery. */
|
|
1675
1814
|
minutes_left: nonNegInt.nullable(),
|
|
1676
1815
|
/** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
|
|
1677
1816
|
awake_until_ms: epochMs.nullable()
|
|
1678
1817
|
});
|
|
1679
|
-
var PowerPreventSleepParams =
|
|
1818
|
+
var PowerPreventSleepParams = z24.strictObject({
|
|
1680
1819
|
/** Keep the computer awake this long; 0 lets it sleep again now. */
|
|
1681
|
-
seconds:
|
|
1820
|
+
seconds: z24.int().min(0).max(86400),
|
|
1682
1821
|
/** Shown where the OS lists what keeps it awake. */
|
|
1683
|
-
reason:
|
|
1822
|
+
reason: z24.string().min(1).max(128).default("Matrx 2 is working")
|
|
1684
1823
|
});
|
|
1685
|
-
var PowerPreventSleepResult =
|
|
1824
|
+
var PowerPreventSleepResult = z24.strictObject({
|
|
1686
1825
|
/** When it may sleep again; null after seconds 0. */
|
|
1687
1826
|
awake_until_ms: epochMs.nullable()
|
|
1688
1827
|
});
|
|
1689
1828
|
|
|
1690
1829
|
// src/schema/diag.ts
|
|
1691
|
-
import { z as
|
|
1692
|
-
var DiagProcess =
|
|
1830
|
+
import { z as z25 } from "zod";
|
|
1831
|
+
var DiagProcess = z25.enum([
|
|
1693
1832
|
"main",
|
|
1694
1833
|
"renderer",
|
|
1695
1834
|
"hosted_page",
|
|
@@ -1702,7 +1841,7 @@ var DiagProcess = z23.enum([
|
|
|
1702
1841
|
"coding_sessions",
|
|
1703
1842
|
"claude_accounts"
|
|
1704
1843
|
]);
|
|
1705
|
-
var DiagErrorKind =
|
|
1844
|
+
var DiagErrorKind = z25.enum([
|
|
1706
1845
|
"uncaught_exception",
|
|
1707
1846
|
"unhandled_rejection",
|
|
1708
1847
|
"renderer_crash",
|
|
@@ -1714,148 +1853,148 @@ var DiagErrorKind = z23.enum([
|
|
|
1714
1853
|
"banner",
|
|
1715
1854
|
"logged_error"
|
|
1716
1855
|
]);
|
|
1717
|
-
var DiagErrorStatus =
|
|
1718
|
-
var DiagErrorEntry =
|
|
1856
|
+
var DiagErrorStatus = z25.enum(["waiting", "sent", "resolved"]);
|
|
1857
|
+
var DiagErrorEntry = z25.strictObject({
|
|
1719
1858
|
/** sha256 prefix over process, kind, source, code and the normalized message. */
|
|
1720
|
-
signature:
|
|
1859
|
+
signature: z25.string().regex(/^[0-9a-f]{32}$/),
|
|
1721
1860
|
process: DiagProcess,
|
|
1722
1861
|
kind: DiagErrorKind,
|
|
1723
1862
|
/** Where: a cap.op, a log event, a screen or page name. */
|
|
1724
|
-
source:
|
|
1863
|
+
source: z25.string().min(1).max(128),
|
|
1725
1864
|
/** An ErrorCode, an exit code or signal, an error class; null when there is none. */
|
|
1726
|
-
code:
|
|
1865
|
+
code: z25.string().max(64).nullable(),
|
|
1727
1866
|
/** The first occurrence's message, personal data removed. */
|
|
1728
|
-
message:
|
|
1867
|
+
message: z25.string().max(500),
|
|
1729
1868
|
count: nonNegInt,
|
|
1730
1869
|
first_seen_ms: epochMs,
|
|
1731
1870
|
last_seen_ms: epochMs,
|
|
1732
1871
|
status: DiagErrorStatus,
|
|
1733
1872
|
/** What the agent who resolved it wrote; null until resolved. */
|
|
1734
|
-
resolution_note:
|
|
1735
|
-
app_version:
|
|
1873
|
+
resolution_note: z25.string().max(500).nullable(),
|
|
1874
|
+
app_version: z25.string().max(64)
|
|
1736
1875
|
});
|
|
1737
|
-
var DiagErrorsListParams =
|
|
1876
|
+
var DiagErrorsListParams = z25.strictObject({
|
|
1738
1877
|
/** open = waiting or sent; all includes resolved. */
|
|
1739
|
-
status:
|
|
1740
|
-
limit:
|
|
1878
|
+
status: z25.enum(["open", "all"]).default("open"),
|
|
1879
|
+
limit: z25.int().min(1).max(500).default(200)
|
|
1741
1880
|
});
|
|
1742
|
-
var DiagErrorsListResult =
|
|
1881
|
+
var DiagErrorsListResult = z25.strictObject({
|
|
1743
1882
|
/** Newest last_seen first. */
|
|
1744
|
-
entries:
|
|
1883
|
+
entries: z25.array(DiagErrorEntry).max(500),
|
|
1745
1884
|
total_signatures: nonNegInt,
|
|
1746
1885
|
total_occurrences: nonNegInt,
|
|
1747
1886
|
/** Signatures with occurrences not yet delivered. */
|
|
1748
1887
|
waiting: nonNegInt,
|
|
1749
1888
|
/** signed_out = kept until sign-in; ok = the last delivery worked; failing = the last delivery failed (kept, retried). */
|
|
1750
|
-
delivery:
|
|
1889
|
+
delivery: z25.enum(["signed_out", "ok", "failing"]),
|
|
1751
1890
|
last_delivery_ms: epochMs.nullable()
|
|
1752
1891
|
});
|
|
1753
|
-
var DiagErrorsReportParams =
|
|
1754
|
-
process:
|
|
1755
|
-
kind:
|
|
1892
|
+
var DiagErrorsReportParams = z25.strictObject({
|
|
1893
|
+
process: z25.enum(["renderer", "hosted_page"]),
|
|
1894
|
+
kind: z25.enum(["uncaught_exception", "unhandled_rejection", "console_error", "banner"]),
|
|
1756
1895
|
/** The screen or page, e.g. "code.chats". */
|
|
1757
|
-
source:
|
|
1758
|
-
message:
|
|
1759
|
-
code:
|
|
1760
|
-
stack:
|
|
1896
|
+
source: z25.string().min(1).max(128),
|
|
1897
|
+
message: z25.string().min(1).max(2e3),
|
|
1898
|
+
code: z25.string().max(64).optional(),
|
|
1899
|
+
stack: z25.string().max(8e3).optional()
|
|
1761
1900
|
});
|
|
1762
|
-
var DiagErrorsReportResult =
|
|
1763
|
-
signature:
|
|
1901
|
+
var DiagErrorsReportResult = z25.strictObject({
|
|
1902
|
+
signature: z25.string().regex(/^[0-9a-f]{32}$/)
|
|
1764
1903
|
});
|
|
1765
|
-
var DiagErrorsChangedEvent =
|
|
1904
|
+
var DiagErrorsChangedEvent = z25.strictObject({
|
|
1766
1905
|
total_signatures: nonNegInt,
|
|
1767
1906
|
waiting: nonNegInt
|
|
1768
1907
|
});
|
|
1769
1908
|
|
|
1770
1909
|
// src/schema/resources.ts
|
|
1771
|
-
import { z as
|
|
1772
|
-
var ResourcesDisk =
|
|
1910
|
+
import { z as z26 } from "zod";
|
|
1911
|
+
var ResourcesDisk = z26.strictObject({
|
|
1773
1912
|
/** Where it is mounted ("/", "C:"). */
|
|
1774
|
-
mount:
|
|
1913
|
+
mount: z26.string().max(512),
|
|
1775
1914
|
/** The volume's name as the file manager shows it ("Macintosh HD", "Local Disk (C:)"). Since 1.17. */
|
|
1776
|
-
name:
|
|
1915
|
+
name: z26.string().max(256).optional(),
|
|
1777
1916
|
/** The file system ("apfs", "NTFS", "ext4"). */
|
|
1778
|
-
fs:
|
|
1917
|
+
fs: z26.string().max(64),
|
|
1779
1918
|
size_bytes: nonNegInt,
|
|
1780
1919
|
used_bytes: nonNegInt,
|
|
1781
1920
|
available_bytes: nonNegInt
|
|
1782
1921
|
});
|
|
1783
|
-
var ResourcesSnapshotParams =
|
|
1784
|
-
var ResourcesSnapshotResult =
|
|
1785
|
-
cpu:
|
|
1922
|
+
var ResourcesSnapshotParams = z26.strictObject({});
|
|
1923
|
+
var ResourcesSnapshotResult = z26.strictObject({
|
|
1924
|
+
cpu: z26.strictObject({
|
|
1786
1925
|
/** Busy share of all cores, 0–100, measured now. */
|
|
1787
|
-
percent:
|
|
1788
|
-
cores:
|
|
1926
|
+
percent: z26.number().min(0).max(100),
|
|
1927
|
+
cores: z26.int().min(1),
|
|
1789
1928
|
/** 1, 5 and 15 minute load averages; null on Windows. */
|
|
1790
|
-
load:
|
|
1929
|
+
load: z26.array(z26.number().min(0)).length(3).nullable()
|
|
1791
1930
|
}),
|
|
1792
|
-
memory:
|
|
1793
|
-
swap:
|
|
1794
|
-
disks:
|
|
1931
|
+
memory: z26.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
|
|
1932
|
+
swap: z26.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
|
|
1933
|
+
disks: z26.array(ResourcesDisk).max(64),
|
|
1795
1934
|
uptime_seconds: nonNegInt
|
|
1796
1935
|
});
|
|
1797
|
-
var ResourcesJobKind =
|
|
1798
|
-
var ResourcesStrain =
|
|
1799
|
-
var ResourcesPressure =
|
|
1800
|
-
var ResourcesJob =
|
|
1936
|
+
var ResourcesJobKind = z26.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
|
|
1937
|
+
var ResourcesStrain = z26.enum(["good", "strain", "overloaded"]);
|
|
1938
|
+
var ResourcesPressure = z26.enum(["normal", "warning", "critical"]);
|
|
1939
|
+
var ResourcesJob = z26.strictObject({
|
|
1801
1940
|
/** The job's root process (Stop takes its whole tree). */
|
|
1802
|
-
pid:
|
|
1941
|
+
pid: z26.int().min(0),
|
|
1803
1942
|
kind: ResourcesJobKind,
|
|
1804
1943
|
/** Its heaviest process's command line, shortened ("…/lib/tsc --noEmit -p tsconfig.json"). */
|
|
1805
|
-
command:
|
|
1944
|
+
command: z26.string().max(256),
|
|
1806
1945
|
/** Who started it: "Claude Code", "Codex", "Cursor", "VS Code", "Terminal", "local stack", "detached"; null when unknown. */
|
|
1807
|
-
started_by:
|
|
1946
|
+
started_by: z26.string().max(64).nullable(),
|
|
1808
1947
|
/** Whatever started it is gone and nothing waits for it. */
|
|
1809
|
-
orphan:
|
|
1948
|
+
orphan: z26.boolean(),
|
|
1810
1949
|
/** A type-check queued for its turn (no compiler running yet). */
|
|
1811
|
-
waiting:
|
|
1950
|
+
waiting: z26.boolean(),
|
|
1812
1951
|
/** The project folder it runs in ("matrx-frontend"); null when not in one. */
|
|
1813
|
-
folder:
|
|
1952
|
+
folder: z26.string().max(256).nullable(),
|
|
1814
1953
|
/** The same command in the same folder, running this many times (1 = no duplicate). */
|
|
1815
|
-
duplicates:
|
|
1816
|
-
processes:
|
|
1954
|
+
duplicates: z26.int().min(1),
|
|
1955
|
+
processes: z26.int().min(1),
|
|
1817
1956
|
/** Sum over the tree, as `ps` reports it: 100 = one full core. */
|
|
1818
|
-
cpu_percent:
|
|
1957
|
+
cpu_percent: z26.number().min(0),
|
|
1819
1958
|
/** Real memory (macOS: the physical footprint Activity Monitor shows, compressed included). */
|
|
1820
1959
|
memory_bytes: nonNegInt,
|
|
1821
1960
|
started_at_ms: epochMs.nullable(),
|
|
1822
1961
|
/** False for an app, an agent session, a terminal, a system process, the local stack or Matrx 2 itself. */
|
|
1823
|
-
stoppable:
|
|
1962
|
+
stoppable: z26.boolean()
|
|
1824
1963
|
});
|
|
1825
|
-
var ResourcesProcess =
|
|
1826
|
-
pid:
|
|
1964
|
+
var ResourcesProcess = z26.strictObject({
|
|
1965
|
+
pid: z26.int().min(0),
|
|
1827
1966
|
/** The command line, shortened. */
|
|
1828
|
-
name:
|
|
1829
|
-
cpu_percent:
|
|
1967
|
+
name: z26.string().max(256),
|
|
1968
|
+
cpu_percent: z26.number().min(0),
|
|
1830
1969
|
memory_bytes: nonNegInt,
|
|
1831
|
-
started_by:
|
|
1970
|
+
started_by: z26.string().max(64).nullable(),
|
|
1832
1971
|
/** The job it belongs to ("type-check in aidream"); null when none. */
|
|
1833
|
-
job:
|
|
1972
|
+
job: z26.string().max(256).nullable(),
|
|
1834
1973
|
started_at_ms: epochMs.nullable()
|
|
1835
1974
|
});
|
|
1836
|
-
var ResourcesVerdict =
|
|
1975
|
+
var ResourcesVerdict = z26.strictObject({
|
|
1837
1976
|
level: ResourcesStrain,
|
|
1838
1977
|
/** One sentence ("Your Mac is under strain. 3 type-checks are running at once."). */
|
|
1839
|
-
text:
|
|
1978
|
+
text: z26.string().max(256),
|
|
1840
1979
|
/** The biggest jobs behind it; null when all is well. */
|
|
1841
|
-
cause:
|
|
1980
|
+
cause: z26.string().max(1024).nullable()
|
|
1842
1981
|
});
|
|
1843
|
-
var ResourcesSample =
|
|
1982
|
+
var ResourcesSample = z26.strictObject({
|
|
1844
1983
|
at_ms: epochMs,
|
|
1845
1984
|
/** The 1-minute load average. */
|
|
1846
|
-
load:
|
|
1985
|
+
load: z26.number().min(0),
|
|
1847
1986
|
memory_used_bytes: nonNegInt,
|
|
1848
1987
|
typechecks: nonNegInt
|
|
1849
1988
|
});
|
|
1850
|
-
var ResourcesActivityParams =
|
|
1851
|
-
var ResourcesActivityResult =
|
|
1989
|
+
var ResourcesActivityParams = z26.strictObject({});
|
|
1990
|
+
var ResourcesActivityResult = z26.strictObject({
|
|
1852
1991
|
/** False until the first reading (a second or two after start). */
|
|
1853
|
-
ready:
|
|
1992
|
+
ready: z26.boolean(),
|
|
1854
1993
|
sampled_at_ms: epochMs.nullable(),
|
|
1855
|
-
cores:
|
|
1994
|
+
cores: z26.int().min(1),
|
|
1856
1995
|
/** 1, 5 and 15 minute load averages. */
|
|
1857
|
-
load:
|
|
1858
|
-
memory:
|
|
1996
|
+
load: z26.array(z26.number().min(0)).length(3),
|
|
1997
|
+
memory: z26.strictObject({
|
|
1859
1998
|
total_bytes: nonNegInt,
|
|
1860
1999
|
/** Activity Monitor's Memory Used: app memory + wired + compressed. */
|
|
1861
2000
|
used_bytes: nonNegInt,
|
|
@@ -1866,252 +2005,252 @@ var ResourcesActivityResult = z24.strictObject({
|
|
|
1866
2005
|
pressure: ResourcesPressure.nullable()
|
|
1867
2006
|
}),
|
|
1868
2007
|
verdict: ResourcesVerdict,
|
|
1869
|
-
typechecks:
|
|
2008
|
+
typechecks: z26.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
|
|
1870
2009
|
/** Heaviest first (1 GB weighs as much as 16 % of a core). */
|
|
1871
|
-
jobs:
|
|
2010
|
+
jobs: z26.array(ResourcesJob).max(200),
|
|
1872
2011
|
/** The 15 heaviest by memory and the 15 busiest by CPU, together. */
|
|
1873
|
-
top:
|
|
2012
|
+
top: z26.array(ResourcesProcess).max(30),
|
|
1874
2013
|
/** The last hour, oldest first. */
|
|
1875
|
-
history:
|
|
2014
|
+
history: z26.array(ResourcesSample).max(1200)
|
|
1876
2015
|
});
|
|
1877
|
-
var ResourcesStopJobParams =
|
|
1878
|
-
var ResourcesStopJobResult =
|
|
2016
|
+
var ResourcesStopJobParams = z26.strictObject({ pid: z26.int().min(1) });
|
|
2017
|
+
var ResourcesStopJobResult = z26.strictObject({
|
|
1879
2018
|
/** Processes signalled; whatever is still running 5 seconds later is force-stopped. */
|
|
1880
2019
|
processes: nonNegInt,
|
|
1881
2020
|
/** It had finished before the request arrived. */
|
|
1882
|
-
already_finished:
|
|
2021
|
+
already_finished: z26.boolean()
|
|
1883
2022
|
});
|
|
1884
|
-
var ResourcesIncident =
|
|
2023
|
+
var ResourcesIncident = z26.strictObject({
|
|
1885
2024
|
at_ms: epochMs,
|
|
1886
2025
|
verdict: ResourcesVerdict,
|
|
1887
|
-
load:
|
|
2026
|
+
load: z26.number().min(0),
|
|
1888
2027
|
memory_used_bytes: nonNegInt,
|
|
1889
2028
|
compressed_bytes: nonNegInt,
|
|
1890
2029
|
pressure: ResourcesPressure.nullable(),
|
|
1891
|
-
jobs:
|
|
1892
|
-
|
|
2030
|
+
jobs: z26.array(
|
|
2031
|
+
z26.strictObject({
|
|
1893
2032
|
kind: ResourcesJobKind,
|
|
1894
|
-
started_by:
|
|
1895
|
-
folder:
|
|
1896
|
-
command:
|
|
1897
|
-
cpu_percent:
|
|
2033
|
+
started_by: z26.string().max(64).nullable(),
|
|
2034
|
+
folder: z26.string().max(256).nullable(),
|
|
2035
|
+
command: z26.string().max(256),
|
|
2036
|
+
cpu_percent: z26.number().min(0),
|
|
1898
2037
|
memory_bytes: nonNegInt,
|
|
1899
|
-
duplicates:
|
|
2038
|
+
duplicates: z26.int().min(1)
|
|
1900
2039
|
})
|
|
1901
2040
|
).max(8)
|
|
1902
2041
|
});
|
|
1903
|
-
var ResourcesIncidentsParams =
|
|
1904
|
-
var ResourcesIncidentsResult =
|
|
2042
|
+
var ResourcesIncidentsParams = z26.strictObject({ limit: z26.int().min(1).max(200).default(50) });
|
|
2043
|
+
var ResourcesIncidentsResult = z26.strictObject({
|
|
1905
2044
|
/** Newest first; at most one a minute is written. */
|
|
1906
|
-
incidents:
|
|
2045
|
+
incidents: z26.array(ResourcesIncident).max(200)
|
|
1907
2046
|
});
|
|
1908
2047
|
|
|
1909
2048
|
// src/schema/stack.ts
|
|
1910
|
-
import { z as
|
|
1911
|
-
var StackServerName =
|
|
1912
|
-
var StackTone =
|
|
1913
|
-
var StackServer =
|
|
2049
|
+
import { z as z27 } from "zod";
|
|
2050
|
+
var StackServerName = z27.string().regex(/^[a-z0-9_-]{1,64}$/);
|
|
2051
|
+
var StackTone = z27.enum(["good", "wait", "bad", "off"]);
|
|
2052
|
+
var StackServer = z27.strictObject({
|
|
1914
2053
|
name: StackServerName,
|
|
1915
2054
|
/** One word: Healthy, Starting, Unhealthy, Restarting, Stopping, Waiting, Stopped, Crashed, Off. */
|
|
1916
|
-
label:
|
|
2055
|
+
label: z27.string().max(32),
|
|
1917
2056
|
tone: StackTone,
|
|
1918
2057
|
/** What is going on, in one or two plain sentences. */
|
|
1919
|
-
sentence:
|
|
2058
|
+
sentence: z27.string().max(2e3),
|
|
1920
2059
|
/** The config's own description of the server. */
|
|
1921
|
-
description:
|
|
2060
|
+
description: z27.string().max(512),
|
|
1922
2061
|
/** Where the server answers, when its description names an address. */
|
|
1923
|
-
open_url:
|
|
1924
|
-
log_file:
|
|
2062
|
+
open_url: z27.string().max(2048).nullable(),
|
|
2063
|
+
log_file: z27.string().max(4096),
|
|
1925
2064
|
/** When its log file was last written. */
|
|
1926
2065
|
last_output_at_ms: epochMs.nullable(),
|
|
1927
2066
|
started_at_ms: epochMs.nullable(),
|
|
1928
2067
|
restarts: nonNegInt,
|
|
1929
|
-
exit_code:
|
|
1930
|
-
pid:
|
|
2068
|
+
exit_code: z27.int().nullable(),
|
|
2069
|
+
pid: z27.int().nullable(),
|
|
1931
2070
|
/** (1.18) CPU of the server's process and everything under it, in percent of one core; absent when it is not running. */
|
|
1932
|
-
cpu_percent:
|
|
2071
|
+
cpu_percent: z27.number().min(0).optional(),
|
|
1933
2072
|
/** (1.18) Memory of the same processes: the physical footprint (Activity Monitor's Memory) summed; absent when it is not running. */
|
|
1934
2073
|
memory_bytes: nonNegInt.optional()
|
|
1935
2074
|
});
|
|
1936
|
-
var StackEvent =
|
|
2075
|
+
var StackEvent = z27.strictObject({
|
|
1937
2076
|
at_ms: epochMs,
|
|
1938
2077
|
/** A server name, or "stack" for the stack as a whole. */
|
|
1939
|
-
server:
|
|
2078
|
+
server: z27.string().max(64),
|
|
1940
2079
|
/** started · stopped · healthy · unhealthy · crashed · exited · restarting · stopping · action · action-done · action-failed · setup · error */
|
|
1941
|
-
kind:
|
|
1942
|
-
text:
|
|
2080
|
+
kind: z27.string().max(32),
|
|
2081
|
+
text: z27.string().max(4e3)
|
|
1943
2082
|
});
|
|
1944
|
-
var StackStateParams =
|
|
1945
|
-
var StackStateResult =
|
|
2083
|
+
var StackStateParams = z27.strictObject({});
|
|
2084
|
+
var StackStateResult = z27.strictObject({
|
|
1946
2085
|
/** The stack's config file, when found. */
|
|
1947
|
-
config_path:
|
|
2086
|
+
config_path: z27.string().max(4096).nullable(),
|
|
1948
2087
|
/** Why the stack cannot be run from here (no config, no process-compose), else null. */
|
|
1949
|
-
problem:
|
|
1950
|
-
stack_up:
|
|
2088
|
+
problem: z27.string().max(1e3).nullable(),
|
|
2089
|
+
stack_up: z27.boolean(),
|
|
1951
2090
|
stack_started_at_ms: epochMs.nullable(),
|
|
1952
|
-
servers:
|
|
2091
|
+
servers: z27.array(StackServer).max(64),
|
|
1953
2092
|
/** One line about the one-shot setup steps ("Docker Desktop: running."), or null. */
|
|
1954
|
-
setup_note:
|
|
2093
|
+
setup_note: z27.string().max(500).nullable(),
|
|
1955
2094
|
/** Start everything / Stop everything in flight. */
|
|
1956
|
-
pending:
|
|
2095
|
+
pending: z27.strictObject({ verb: z27.enum(["start", "stop"]), label: z27.string().max(64), since_ms: epochMs }).nullable(),
|
|
1957
2096
|
/** The newest entries last. */
|
|
1958
|
-
events:
|
|
2097
|
+
events: z27.array(StackEvent).max(300)
|
|
1959
2098
|
});
|
|
1960
|
-
var StackStartParams =
|
|
1961
|
-
var StackStopParams =
|
|
1962
|
-
var StackRunResult =
|
|
1963
|
-
var StackServerActionParams =
|
|
2099
|
+
var StackStartParams = z27.strictObject({});
|
|
2100
|
+
var StackStopParams = z27.strictObject({});
|
|
2101
|
+
var StackRunResult = z27.strictObject({ accepted: z27.boolean() });
|
|
2102
|
+
var StackServerActionParams = z27.strictObject({
|
|
1964
2103
|
name: StackServerName,
|
|
1965
|
-
verb:
|
|
2104
|
+
verb: z27.enum(["start", "stop", "restart"])
|
|
1966
2105
|
});
|
|
1967
|
-
var StackServerActionResult =
|
|
1968
|
-
var StackLogsParams =
|
|
2106
|
+
var StackServerActionResult = z27.strictObject({ message: z27.string().max(1e3) });
|
|
2107
|
+
var StackLogsParams = z27.strictObject({
|
|
1969
2108
|
name: StackServerName,
|
|
1970
2109
|
/** Without `offset`: the last this-many complete lines. With it: new lines after it, at most this many. */
|
|
1971
|
-
lines:
|
|
2110
|
+
lines: z27.int().min(1).max(2e5).default(2e3),
|
|
1972
2111
|
/** Byte offset the last read ended at: answer only what was written after it (follow). */
|
|
1973
2112
|
offset: nonNegInt.optional(),
|
|
1974
2113
|
/** A "Clear" point: the lines written after this byte offset (no `offset`). */
|
|
1975
2114
|
since: nonNegInt.optional(),
|
|
1976
2115
|
/** With `offset`: wait up to this long for a new line when none is waiting (0 answers at once). */
|
|
1977
|
-
wait_ms:
|
|
2116
|
+
wait_ms: z27.int().min(0).max(25e3).default(0)
|
|
1978
2117
|
});
|
|
1979
|
-
var StackLogsResult =
|
|
2118
|
+
var StackLogsResult = z27.strictObject({
|
|
1980
2119
|
/** Complete lines, colour codes removed. */
|
|
1981
|
-
lines:
|
|
2120
|
+
lines: z27.array(z27.string().max(65536)).max(2e5),
|
|
1982
2121
|
/** Where these lines end: pass it back as `offset` to follow. */
|
|
1983
2122
|
offset: nonNegInt,
|
|
1984
2123
|
/** False when `since` no longer exists (the log rotated): the lines are the plain tail instead. */
|
|
1985
|
-
since_valid:
|
|
2124
|
+
since_valid: z27.boolean(),
|
|
1986
2125
|
/** The log was rotated or truncated since `offset`: these lines start the file again. */
|
|
1987
|
-
reset:
|
|
1988
|
-
log_file:
|
|
2126
|
+
reset: z27.boolean(),
|
|
2127
|
+
log_file: z27.string().max(4096)
|
|
1989
2128
|
});
|
|
1990
|
-
var StackErrorsParams =
|
|
1991
|
-
window_minutes:
|
|
2129
|
+
var StackErrorsParams = z27.strictObject({
|
|
2130
|
+
window_minutes: z27.int().min(1).max(1440).default(60)
|
|
1992
2131
|
});
|
|
1993
|
-
var StackErrorsResult =
|
|
2132
|
+
var StackErrorsResult = z27.strictObject({
|
|
1994
2133
|
/** Per server: a heading line ("=== aidream — errors in the last 60 minutes (<file>) ===") and each error with the 10 lines after it. */
|
|
1995
|
-
sections:
|
|
1996
|
-
window_minutes:
|
|
2134
|
+
sections: z27.array(z27.strictObject({ name: StackServerName, heading: z27.string().max(4096), lines: z27.array(z27.string().max(65536)).max(5e3) })).max(64),
|
|
2135
|
+
window_minutes: z27.int().min(1).max(1440)
|
|
1997
2136
|
});
|
|
1998
2137
|
|
|
1999
2138
|
// src/schema/audio.ts
|
|
2000
|
-
import { z as
|
|
2001
|
-
var AudioDevice =
|
|
2139
|
+
import { z as z28 } from "zod";
|
|
2140
|
+
var AudioDevice = z28.strictObject({
|
|
2002
2141
|
/** The OS's name for it, as audio.record takes it. */
|
|
2003
|
-
id:
|
|
2004
|
-
name:
|
|
2005
|
-
default:
|
|
2142
|
+
id: z28.string().min(1).max(256),
|
|
2143
|
+
name: z28.string().max(256),
|
|
2144
|
+
default: z28.boolean()
|
|
2006
2145
|
});
|
|
2007
|
-
var AudioDevicesParams =
|
|
2008
|
-
var AudioDevicesResult =
|
|
2009
|
-
inputs:
|
|
2010
|
-
outputs:
|
|
2146
|
+
var AudioDevicesParams = z28.strictObject({});
|
|
2147
|
+
var AudioDevicesResult = z28.strictObject({
|
|
2148
|
+
inputs: z28.array(AudioDevice).max(64),
|
|
2149
|
+
outputs: z28.array(AudioDevice).max(64)
|
|
2011
2150
|
});
|
|
2012
|
-
var AudioRecordParams =
|
|
2013
|
-
seconds:
|
|
2151
|
+
var AudioRecordParams = z28.strictObject({
|
|
2152
|
+
seconds: z28.number().min(0.5).max(600),
|
|
2014
2153
|
/** The microphone (from audio.devices); the default input when absent. */
|
|
2015
|
-
device_id:
|
|
2154
|
+
device_id: z28.string().min(1).max(256).optional(),
|
|
2016
2155
|
/** Where the WAV file goes; a new file in the temp folder when absent. */
|
|
2017
2156
|
path: AbsPath.optional()
|
|
2018
2157
|
});
|
|
2019
|
-
var AudioRecordResult =
|
|
2158
|
+
var AudioRecordResult = z28.strictObject({
|
|
2020
2159
|
path: AbsPath,
|
|
2021
|
-
seconds:
|
|
2160
|
+
seconds: z28.number().min(0),
|
|
2022
2161
|
bytes: nonNegInt,
|
|
2023
2162
|
/** Loudest sample, 0–1: 0 means the device gave silence. */
|
|
2024
|
-
peak:
|
|
2163
|
+
peak: z28.number().min(0).max(1)
|
|
2025
2164
|
});
|
|
2026
|
-
var AudioPlayParams =
|
|
2027
|
-
var AudioPlayResult =
|
|
2165
|
+
var AudioPlayParams = z28.strictObject({ path: AbsPath });
|
|
2166
|
+
var AudioPlayResult = z28.strictObject({ path: AbsPath, seconds: z28.number().min(0) });
|
|
2028
2167
|
|
|
2029
2168
|
// src/schema/fs-watch.ts
|
|
2030
|
-
import { z as
|
|
2031
|
-
var FsWatchId =
|
|
2032
|
-
var FsWatchStartParams =
|
|
2169
|
+
import { z as z29 } from "zod";
|
|
2170
|
+
var FsWatchId = z29.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
|
|
2171
|
+
var FsWatchStartParams = z29.strictObject({
|
|
2033
2172
|
path: AbsPath,
|
|
2034
|
-
recursive:
|
|
2173
|
+
recursive: z29.boolean().default(true),
|
|
2035
2174
|
/** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
|
|
2036
|
-
ignore:
|
|
2175
|
+
ignore: z29.array(z29.string().max(256)).max(64).default([])
|
|
2037
2176
|
});
|
|
2038
|
-
var FsWatchStartResult =
|
|
2177
|
+
var FsWatchStartResult = z29.strictObject({
|
|
2039
2178
|
watch_id: FsWatchId,
|
|
2040
2179
|
path: AbsPath,
|
|
2041
2180
|
/** The watch ends by itself if nobody reads it for 30 minutes. */
|
|
2042
2181
|
expires_at_ms: epochMs
|
|
2043
2182
|
});
|
|
2044
|
-
var FsWatchEventsParams =
|
|
2183
|
+
var FsWatchEventsParams = z29.strictObject({
|
|
2045
2184
|
watch_id: FsWatchId,
|
|
2046
2185
|
/** Wait up to this long for a first change when none is waiting (0 answers at once). */
|
|
2047
|
-
wait_ms:
|
|
2186
|
+
wait_ms: z29.int().min(0).max(25e3).default(0)
|
|
2048
2187
|
});
|
|
2049
|
-
var FsWatchEventsResult =
|
|
2188
|
+
var FsWatchEventsResult = z29.strictObject({
|
|
2050
2189
|
/** What changed since the last read, oldest first; re-checked against the disk when read. */
|
|
2051
|
-
changes:
|
|
2190
|
+
changes: z29.array(FsChange).max(1e3),
|
|
2052
2191
|
/** Changes were dropped (more than 1000 waited): list the folder again. */
|
|
2053
|
-
overflow:
|
|
2192
|
+
overflow: z29.boolean(),
|
|
2054
2193
|
expires_at_ms: epochMs
|
|
2055
2194
|
});
|
|
2056
|
-
var FsWatchStopParams =
|
|
2057
|
-
var FsWatchStopResult =
|
|
2195
|
+
var FsWatchStopParams = z29.strictObject({ watch_id: FsWatchId });
|
|
2196
|
+
var FsWatchStopResult = z29.strictObject({ watch_id: FsWatchId });
|
|
2058
2197
|
|
|
2059
2198
|
// src/schema/exec-job.ts
|
|
2060
|
-
import { z as
|
|
2061
|
-
var ExecJobId =
|
|
2062
|
-
var ExecJobStartParams =
|
|
2063
|
-
command:
|
|
2199
|
+
import { z as z30 } from "zod";
|
|
2200
|
+
var ExecJobId = z30.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
|
|
2201
|
+
var ExecJobStartParams = z30.strictObject({
|
|
2202
|
+
command: z30.string().min(1).max(131072),
|
|
2064
2203
|
/** The folder it runs in; the home folder when absent. */
|
|
2065
2204
|
cwd: AbsPath.optional(),
|
|
2066
|
-
env:
|
|
2205
|
+
env: z30.record(z30.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z30.string().max(32768)).optional()
|
|
2067
2206
|
});
|
|
2068
|
-
var ExecJobStartResult =
|
|
2069
|
-
var ExecJobOutputParams =
|
|
2207
|
+
var ExecJobStartResult = z30.strictObject({ job_id: ExecJobId, pid: z30.int().min(1), cwd: AbsPath });
|
|
2208
|
+
var ExecJobOutputParams = z30.strictObject({
|
|
2070
2209
|
job_id: ExecJobId,
|
|
2071
2210
|
/** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
|
|
2072
2211
|
offset: nonNegInt.default(0),
|
|
2073
2212
|
/** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
|
|
2074
|
-
wait_ms:
|
|
2075
|
-
max_bytes:
|
|
2213
|
+
wait_ms: z30.int().min(0).max(25e3).default(0),
|
|
2214
|
+
max_bytes: z30.int().min(1024).max(1048576).default(65536)
|
|
2076
2215
|
});
|
|
2077
|
-
var ExecJobOutputResult =
|
|
2216
|
+
var ExecJobOutputResult = z30.strictObject({
|
|
2078
2217
|
/** stdout and stderr interleaved as they arrived (UTF-8). */
|
|
2079
|
-
output:
|
|
2218
|
+
output: z30.string(),
|
|
2080
2219
|
next_offset: nonNegInt,
|
|
2081
2220
|
/** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
|
|
2082
2221
|
dropped_bytes: nonNegInt,
|
|
2083
|
-
running:
|
|
2084
|
-
exit_code:
|
|
2222
|
+
running: z30.boolean(),
|
|
2223
|
+
exit_code: z30.int().nullable()
|
|
2085
2224
|
});
|
|
2086
|
-
var ExecJobStopParams =
|
|
2225
|
+
var ExecJobStopParams = z30.strictObject({
|
|
2087
2226
|
job_id: ExecJobId,
|
|
2088
2227
|
/** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
|
|
2089
|
-
force:
|
|
2228
|
+
force: z30.boolean().default(false)
|
|
2090
2229
|
});
|
|
2091
|
-
var ExecJobStopResult =
|
|
2092
|
-
var ExecJobInfo =
|
|
2230
|
+
var ExecJobStopResult = z30.strictObject({ job_id: ExecJobId, exited: z30.boolean(), exit_code: z30.int().nullable() });
|
|
2231
|
+
var ExecJobInfo = z30.strictObject({
|
|
2093
2232
|
job_id: ExecJobId,
|
|
2094
|
-
command:
|
|
2095
|
-
pid:
|
|
2233
|
+
command: z30.string().max(1024),
|
|
2234
|
+
pid: z30.int().min(1),
|
|
2096
2235
|
cwd: AbsPath,
|
|
2097
|
-
running:
|
|
2098
|
-
exit_code:
|
|
2236
|
+
running: z30.boolean(),
|
|
2237
|
+
exit_code: z30.int().nullable(),
|
|
2099
2238
|
started_at_ms: epochMs,
|
|
2100
2239
|
output_bytes: nonNegInt
|
|
2101
2240
|
});
|
|
2102
|
-
var ExecJobListParams =
|
|
2103
|
-
var ExecJobListResult =
|
|
2241
|
+
var ExecJobListParams = z30.strictObject({});
|
|
2242
|
+
var ExecJobListResult = z30.strictObject({ jobs: z30.array(ExecJobInfo).max(64) });
|
|
2104
2243
|
|
|
2105
2244
|
// src/schema/coding.ts
|
|
2106
|
-
import { z as
|
|
2245
|
+
import { z as z31 } from "zod";
|
|
2107
2246
|
import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN3 } from "@ai-matrx/kit/uuid";
|
|
2108
|
-
var CodingServiceCredentials =
|
|
2109
|
-
access_token:
|
|
2110
|
-
user_id:
|
|
2247
|
+
var CodingServiceCredentials = z31.strictObject({
|
|
2248
|
+
access_token: z31.string().min(16).max(16384),
|
|
2249
|
+
user_id: z31.string().regex(UUID_SHAPE_PATTERN3),
|
|
2111
2250
|
/** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
|
|
2112
|
-
server_url:
|
|
2251
|
+
server_url: z31.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
|
|
2113
2252
|
});
|
|
2114
|
-
var CodingHistoryBlocked =
|
|
2253
|
+
var CodingHistoryBlocked = z31.enum([
|
|
2115
2254
|
"signed_out",
|
|
2116
2255
|
"offline",
|
|
2117
2256
|
"organization_required",
|
|
@@ -2119,11 +2258,11 @@ var CodingHistoryBlocked = z29.enum([
|
|
|
2119
2258
|
"cloud_list_unavailable",
|
|
2120
2259
|
"history_too_large"
|
|
2121
2260
|
]);
|
|
2122
|
-
var CodingHistoryFailure =
|
|
2123
|
-
session_id:
|
|
2124
|
-
reason:
|
|
2261
|
+
var CodingHistoryFailure = z31.strictObject({
|
|
2262
|
+
session_id: z31.string().max(64),
|
|
2263
|
+
reason: z31.string().max(300)
|
|
2125
2264
|
});
|
|
2126
|
-
var CodingHistoryRun =
|
|
2265
|
+
var CodingHistoryRun = z31.strictObject({
|
|
2127
2266
|
/** Claude Code sessions found on this computer. */
|
|
2128
2267
|
local_sessions: nonNegInt,
|
|
2129
2268
|
/** Of those, already complete in AI Matrx. */
|
|
@@ -2138,39 +2277,39 @@ var CodingHistoryRun = z29.strictObject({
|
|
|
2138
2277
|
/** Changed while being read; a later run takes them. */
|
|
2139
2278
|
changed: nonNegInt,
|
|
2140
2279
|
failed: nonNegInt,
|
|
2141
|
-
failures:
|
|
2280
|
+
failures: z31.array(CodingHistoryFailure).max(20),
|
|
2142
2281
|
/** Candidates not reached yet. */
|
|
2143
2282
|
remaining: nonNegInt,
|
|
2144
2283
|
/** The one line a person reads, e.g. "Imported 12 of 14 sessions. 140 already in AI Matrx." */
|
|
2145
|
-
summary:
|
|
2284
|
+
summary: z31.string().max(400)
|
|
2146
2285
|
});
|
|
2147
|
-
var CodingHistoryStep =
|
|
2286
|
+
var CodingHistoryStep = z31.strictObject({
|
|
2148
2287
|
/** Null when the run could not start (blocked before a plan existed). */
|
|
2149
|
-
plan_id:
|
|
2150
|
-
finished:
|
|
2288
|
+
plan_id: z31.string().regex(/^[0-9a-f]{32}$/).nullable(),
|
|
2289
|
+
finished: z31.boolean(),
|
|
2151
2290
|
blocked: CodingHistoryBlocked.nullable(),
|
|
2152
2291
|
run: CodingHistoryRun
|
|
2153
2292
|
});
|
|
2154
|
-
var CodingPlanMissingParams =
|
|
2155
|
-
var CodingImportNextParams =
|
|
2156
|
-
plan_id:
|
|
2293
|
+
var CodingPlanMissingParams = z31.strictObject({ credentials: CodingServiceCredentials.nullable() });
|
|
2294
|
+
var CodingImportNextParams = z31.strictObject({
|
|
2295
|
+
plan_id: z31.string().regex(/^[0-9a-f]{32}$/),
|
|
2157
2296
|
credentials: CodingServiceCredentials.nullable()
|
|
2158
2297
|
});
|
|
2159
|
-
var CodingServiceProgress =
|
|
2160
|
-
phase:
|
|
2298
|
+
var CodingServiceProgress = z31.strictObject({
|
|
2299
|
+
phase: z31.enum(["checking", "importing"]),
|
|
2161
2300
|
done: nonNegInt,
|
|
2162
2301
|
total: nonNegInt
|
|
2163
2302
|
});
|
|
2164
|
-
var CodingHistoryImportMissingParams =
|
|
2165
|
-
var CodingHistoryImportMissingResult =
|
|
2166
|
-
state:
|
|
2303
|
+
var CodingHistoryImportMissingParams = z31.strictObject({});
|
|
2304
|
+
var CodingHistoryImportMissingResult = z31.strictObject({
|
|
2305
|
+
state: z31.enum(["done", "blocked", "cancelled"]),
|
|
2167
2306
|
blocked: CodingHistoryBlocked.nullable(),
|
|
2168
2307
|
run: CodingHistoryRun,
|
|
2169
2308
|
elapsed_ms: nonNegInt
|
|
2170
2309
|
});
|
|
2171
|
-
var CodingHistoryProgressEvent =
|
|
2310
|
+
var CodingHistoryProgressEvent = z31.strictObject({
|
|
2172
2311
|
request_id: RequestId,
|
|
2173
|
-
phase:
|
|
2312
|
+
phase: z31.enum(["checking", "importing"]),
|
|
2174
2313
|
/** Sessions settled so far, of `total` candidates (0 of 0 while checking). */
|
|
2175
2314
|
done: nonNegInt,
|
|
2176
2315
|
total: nonNegInt,
|
|
@@ -2292,7 +2431,23 @@ var OPS = {
|
|
|
2292
2431
|
// 1.21: what a window's sidebar draws (the Move-all grouping check).
|
|
2293
2432
|
"apps.windows.shown": { params: AppsWindowsShownParams, result: AppsWindowsShownResult, kind: "unary", since: "1.21", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2294
2433
|
// Claude Code history (SPEC §6 coding): served by the `coding` Python service through SERVICES below.
|
|
2295
|
-
"coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] }
|
|
2434
|
+
"coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] },
|
|
2435
|
+
// 1.22: git for agents (core `git`, the system git; the cloud sandbox's /git/* set, SPEC 6.1).
|
|
2436
|
+
"git.status": { params: GitStatusParams, result: GitStatusResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2437
|
+
"git.diff": { params: GitDiffParams, result: GitDiffResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2438
|
+
"git.log": { params: GitLogParams, result: GitLogResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2439
|
+
"git.add": { params: GitAddParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2440
|
+
"git.commit": { params: GitCommitParams, result: GitCommitResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2441
|
+
"git.push": { params: GitPushParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2442
|
+
"git.pull": { params: GitPullParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2443
|
+
"git.branch": { params: GitBranchParams, result: GitBranchResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2444
|
+
"git.stash": { params: GitStashParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2445
|
+
"git.clone": { params: GitCloneParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
|
|
2446
|
+
// 1.22: the web from this computer (the `tools` Python service: matrx_scraper's local lane).
|
|
2447
|
+
"web.fetch": { params: WebFetchParams, result: WebFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
2448
|
+
"web.scrape": { params: WebScrapeParams, result: WebScrapeResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
2449
|
+
"web.search": { params: WebSearchParams, result: WebSearchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
2450
|
+
"web.fetch_with_browser": { params: WebBrowserFetchParams, result: WebBrowserFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] }
|
|
2296
2451
|
};
|
|
2297
2452
|
var EVENTS = {
|
|
2298
2453
|
"fs.changed": FsChangedEvent,
|
|
@@ -2323,6 +2478,15 @@ var SERVICES = {
|
|
|
2323
2478
|
"coding.plan_missing": { params: CodingPlanMissingParams, result: CodingHistoryStep },
|
|
2324
2479
|
"coding.import_next": { params: CodingImportNextParams, result: CodingHistoryStep }
|
|
2325
2480
|
}
|
|
2481
|
+
},
|
|
2482
|
+
tools: {
|
|
2483
|
+
progress: ToolsServiceProgress,
|
|
2484
|
+
ops: {
|
|
2485
|
+
"tools.web_fetch": { params: WebFetchParams, result: WebFetchResult },
|
|
2486
|
+
"tools.web_scrape": { params: WebScrapeParams, result: WebScrapeResult },
|
|
2487
|
+
"tools.web_search": { params: ToolsWebSearchParams, result: WebSearchResult },
|
|
2488
|
+
"tools.web_browser_fetch": { params: WebBrowserFetchParams, result: WebBrowserFetchResult }
|
|
2489
|
+
}
|
|
2326
2490
|
}
|
|
2327
2491
|
};
|
|
2328
2492
|
var NAMED_SCHEMAS = {
|
|
@@ -2684,7 +2848,39 @@ var NAMED_SCHEMAS = {
|
|
|
2684
2848
|
AppsWindowsProcessesParams,
|
|
2685
2849
|
AppsWindowsProcessesResult,
|
|
2686
2850
|
AppsWindowsAddParams,
|
|
2687
|
-
AppsWindowsSaveNamesParams
|
|
2851
|
+
AppsWindowsSaveNamesParams,
|
|
2852
|
+
GitOutputResult,
|
|
2853
|
+
GitStatusParams,
|
|
2854
|
+
GitStatusFile,
|
|
2855
|
+
GitStatusResult,
|
|
2856
|
+
GitDiffParams,
|
|
2857
|
+
GitDiffResult,
|
|
2858
|
+
GitLogParams,
|
|
2859
|
+
GitLogCommit,
|
|
2860
|
+
GitLogResult,
|
|
2861
|
+
GitAddParams,
|
|
2862
|
+
GitCommitParams,
|
|
2863
|
+
GitCommitResult,
|
|
2864
|
+
GitPushParams,
|
|
2865
|
+
GitPullParams,
|
|
2866
|
+
GitBranchParams,
|
|
2867
|
+
GitBranchResult,
|
|
2868
|
+
GitStashParams,
|
|
2869
|
+
GitCloneParams,
|
|
2870
|
+
WebHeader,
|
|
2871
|
+
WebFetchParams,
|
|
2872
|
+
WebFetchResult,
|
|
2873
|
+
WebScrapeParams,
|
|
2874
|
+
WebScrapePage,
|
|
2875
|
+
WebScrapeResult,
|
|
2876
|
+
WebSearchParams,
|
|
2877
|
+
WebSearchHit,
|
|
2878
|
+
WebSearchQueryResult,
|
|
2879
|
+
WebSearchResult,
|
|
2880
|
+
ToolsWebSearchParams,
|
|
2881
|
+
WebBrowserFetchParams,
|
|
2882
|
+
WebBrowserFetchResult,
|
|
2883
|
+
ToolsServiceProgress
|
|
2688
2884
|
};
|
|
2689
2885
|
|
|
2690
2886
|
// src/versioning.ts
|
|
@@ -2830,7 +3026,7 @@ function forPeer(op, part, value, version) {
|
|
|
2830
3026
|
var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
|
|
2831
3027
|
|
|
2832
3028
|
// src/contract.ts
|
|
2833
|
-
var CONTRACT_SHA256 = "
|
|
3029
|
+
var CONTRACT_SHA256 = "ac2b599f9511abd871a7374e298fab94a25972512797689c8022da288a5f2e06";
|
|
2834
3030
|
|
|
2835
3031
|
// src/close-policy.ts
|
|
2836
3032
|
var CLOSE_RULES = {
|
|
@@ -2863,7 +3059,7 @@ var TOOL_GROUPS = [
|
|
|
2863
3059
|
{ id: "files_shell", order: 1, title: "Files and shell", owner: "core" },
|
|
2864
3060
|
{ id: "os_control", order: 2, title: "Computer control", owner: "core" },
|
|
2865
3061
|
{ id: "personal_automation", order: 3, title: "Personal apps and automation", owner: "core" },
|
|
2866
|
-
{ id: "tools_service", order: 4, title: "
|
|
3062
|
+
{ id: "tools_service", order: 4, title: "Web, documents, OCR and entities", owner: "python_tools" },
|
|
2867
3063
|
{ id: "ml_service", order: 5, title: "Speech", owner: "python_ml" },
|
|
2868
3064
|
{ id: "windows_admin", order: 6, title: "Windows administration", owner: "core" }
|
|
2869
3065
|
];
|
|
@@ -2879,6 +3075,7 @@ var TOOL_CATALOG = [
|
|
|
2879
3075
|
{ name: "fs_search", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["fs.search_paths", "fs.search_content"], platforms: ALL, summary: "Find files by name or content" },
|
|
2880
3076
|
{ name: "shell_execute", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["exec.run"], platforms: ALL, summary: "Run a command; cd carries over" },
|
|
2881
3077
|
{ name: "shell_python", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["exec.run"], platforms: ALL, summary: "Run a Python script" },
|
|
3078
|
+
{ name: "desktop_git", group: "files_shell", state: "planned", path: "device_op", ops: ["git.status", "git.diff", "git.log", "git.add", "git.commit", "git.push", "git.pull", "git.branch", "git.stash", "git.clone"], platforms: ALL, summary: "Git: status, diff, log, commit, branches, push and pull" },
|
|
2882
3079
|
{ name: "shell_job", group: "files_shell", state: "built", path: "device_op", ops: ["exec.job.start", "exec.job.output", "exec.job.stop", "exec.job.list"], platforms: ALL, summary: "Background commands: start, read output, stop" },
|
|
2883
3080
|
// ── 2. Computer control (TS owners) ──────────────────────────────────────────────────────────
|
|
2884
3081
|
{ name: "desktop_process", group: "os_control", state: "built", path: "device_op", ops: ["proc.list", "proc.ports", "proc.kill"], platforms: ALL, summary: "Running processes and ports; stop one" },
|
|
@@ -2903,6 +3100,7 @@ var TOOL_CATALOG = [
|
|
|
2903
3100
|
{ name: "desktop_net", group: "personal_automation", state: "planned", path: "device_op", ops: ["net.info", "net.wifi", "net.bluetooth", "net.devices", "net.mdns", "net.scan", "net.download"], platforms: ALL, summary: "Local network and downloads" },
|
|
2904
3101
|
// ── 4. Python `tools` service ────────────────────────────────────────────────────────────────
|
|
2905
3102
|
{ name: "desktop_documents", group: "tools_service", state: "planned", path: "device_op", ops: ["tools.pdf_extract", "tools.office_generate", "tools.ocr", "tools.image_resize"], platforms: ALL, summary: "PDF text, Office files, OCR, images" },
|
|
3103
|
+
{ name: "desktop_web", group: "tools_service", state: "planned", path: "device_op", ops: ["web.fetch", "web.scrape", "web.search", "web.fetch_with_browser"], platforms: ALL, summary: "Fetch, scrape and search the web from this computer's own connection" },
|
|
2906
3104
|
{ name: "desktop_entities", group: "tools_service", state: "planned", path: "device_op", ops: ["tools.ner", "tools.pii"], platforms: ALL, summary: "Names and private data, found on the device" },
|
|
2907
3105
|
// ── 5. Python `ml` service ───────────────────────────────────────────────────────────────────
|
|
2908
3106
|
// Built: models.transcribe through local_proxy's POST /op/{cap.op} (matrx-ai implementations/desktop.py).
|
|
@@ -2975,10 +3173,10 @@ var LEGACY_ACTIONS = {
|
|
|
2975
3173
|
"local_browser.eval": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
|
|
2976
3174
|
"local_browser.tabs": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
|
|
2977
3175
|
"local_browser.close": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
|
|
2978
|
-
"local_web.fetch":
|
|
2979
|
-
"local_web.fetch_with_browser":
|
|
2980
|
-
"local_web.scrape":
|
|
2981
|
-
"local_web.search":
|
|
3176
|
+
"local_web.fetch": tool("desktop_web"),
|
|
3177
|
+
"local_web.fetch_with_browser": tool("desktop_web"),
|
|
3178
|
+
"local_web.scrape": tool("desktop_web"),
|
|
3179
|
+
"local_web.search": tool("desktop_web"),
|
|
2982
3180
|
"local_web.research": dropped(CLOUD_SCRAPER),
|
|
2983
3181
|
"local_web.download": tool("desktop_net"),
|
|
2984
3182
|
"local_web.upload": dropped("Uploads are cloud files (matrx-files) and file sync, one upload path"),
|
|
@@ -3388,6 +3586,25 @@ export {
|
|
|
3388
3586
|
FsWatchStopResult,
|
|
3389
3587
|
FsWriteParams,
|
|
3390
3588
|
FsWriteResult,
|
|
3589
|
+
GIT_MAX_OUTPUT_CHARS,
|
|
3590
|
+
GitAddParams,
|
|
3591
|
+
GitBranchParams,
|
|
3592
|
+
GitBranchResult,
|
|
3593
|
+
GitCloneParams,
|
|
3594
|
+
GitCommitParams,
|
|
3595
|
+
GitCommitResult,
|
|
3596
|
+
GitDiffParams,
|
|
3597
|
+
GitDiffResult,
|
|
3598
|
+
GitLogCommit,
|
|
3599
|
+
GitLogParams,
|
|
3600
|
+
GitLogResult,
|
|
3601
|
+
GitOutputResult,
|
|
3602
|
+
GitPullParams,
|
|
3603
|
+
GitPushParams,
|
|
3604
|
+
GitStashParams,
|
|
3605
|
+
GitStatusFile,
|
|
3606
|
+
GitStatusParams,
|
|
3607
|
+
GitStatusResult,
|
|
3391
3608
|
HelloMsg,
|
|
3392
3609
|
InputHotkeyParams,
|
|
3393
3610
|
InputHotkeyResult,
|
|
@@ -3560,10 +3777,25 @@ export {
|
|
|
3560
3777
|
ToolPlatform,
|
|
3561
3778
|
ToolResultsFile,
|
|
3562
3779
|
ToolTransport,
|
|
3780
|
+
ToolsServiceProgress,
|
|
3781
|
+
ToolsWebSearchParams,
|
|
3563
3782
|
TranscriptSegment,
|
|
3564
3783
|
TranscriptionModelId,
|
|
3565
3784
|
TranscriptionModelInfo,
|
|
3566
3785
|
VERSIONED_RESULT_OPS,
|
|
3786
|
+
WEB_MAX_TEXT_CHARS,
|
|
3787
|
+
WebBrowserFetchParams,
|
|
3788
|
+
WebBrowserFetchResult,
|
|
3789
|
+
WebFetchParams,
|
|
3790
|
+
WebFetchResult,
|
|
3791
|
+
WebHeader,
|
|
3792
|
+
WebScrapePage,
|
|
3793
|
+
WebScrapeParams,
|
|
3794
|
+
WebScrapeResult,
|
|
3795
|
+
WebSearchHit,
|
|
3796
|
+
WebSearchParams,
|
|
3797
|
+
WebSearchQueryResult,
|
|
3798
|
+
WebSearchResult,
|
|
3567
3799
|
Welcome,
|
|
3568
3800
|
WindowFocusParams,
|
|
3569
3801
|
WindowFocusResult,
|