@ai-matrx/desktop-protocol 0.17.11 → 0.17.13
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 +15 -0
- package/dist/client.cjs +507 -298
- 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 +507 -298
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +352 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +395 -8
- package/dist/index.d.ts +395 -8
- package/dist/index.js +352 -83
- package/dist/index.js.map +1 -1
- package/dist/{models-dIUgWoHB.d.cts → models-BOPMXUz-.d.cts} +591 -1
- package/dist/{models-dIUgWoHB.d.ts → models-BOPMXUz-.d.ts} +591 -1
- package/dist/react.d.cts +251 -0
- package/dist/react.d.ts +251 -0
- package/generated/desktop-protocol.schema.json +1215 -97
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/schema/primitives.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
var PROTOCOL_MAJOR = 1;
|
|
4
|
-
var PROTOCOL_MINOR =
|
|
4
|
+
var PROTOCOL_MINOR = 17;
|
|
5
5
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
6
6
|
var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
7
7
|
var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -1640,6 +1640,8 @@ import { z as z23 } from "zod";
|
|
|
1640
1640
|
var ResourcesDisk = z23.strictObject({
|
|
1641
1641
|
/** Where it is mounted ("/", "C:"). */
|
|
1642
1642
|
mount: z23.string().max(512),
|
|
1643
|
+
/** The volume's name as the file manager shows it ("Macintosh HD", "Local Disk (C:)"). Since 1.17. */
|
|
1644
|
+
name: z23.string().max(256).optional(),
|
|
1643
1645
|
/** The file system ("apfs", "NTFS", "ext4"). */
|
|
1644
1646
|
fs: z23.string().max(64),
|
|
1645
1647
|
size_bytes: nonNegInt,
|
|
@@ -1660,122 +1662,319 @@ var ResourcesSnapshotResult = z23.strictObject({
|
|
|
1660
1662
|
disks: z23.array(ResourcesDisk).max(64),
|
|
1661
1663
|
uptime_seconds: nonNegInt
|
|
1662
1664
|
});
|
|
1665
|
+
var ResourcesJobKind = z23.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
|
|
1666
|
+
var ResourcesStrain = z23.enum(["good", "strain", "overloaded"]);
|
|
1667
|
+
var ResourcesPressure = z23.enum(["normal", "warning", "critical"]);
|
|
1668
|
+
var ResourcesJob = z23.strictObject({
|
|
1669
|
+
/** The job's root process (Stop takes its whole tree). */
|
|
1670
|
+
pid: z23.int().min(0),
|
|
1671
|
+
kind: ResourcesJobKind,
|
|
1672
|
+
/** Its heaviest process's command line, shortened ("…/lib/tsc --noEmit -p tsconfig.json"). */
|
|
1673
|
+
command: z23.string().max(256),
|
|
1674
|
+
/** Who started it: "Claude Code", "Codex", "Cursor", "VS Code", "Terminal", "local stack", "detached"; null when unknown. */
|
|
1675
|
+
started_by: z23.string().max(64).nullable(),
|
|
1676
|
+
/** Whatever started it is gone and nothing waits for it. */
|
|
1677
|
+
orphan: z23.boolean(),
|
|
1678
|
+
/** A type-check queued for its turn (no compiler running yet). */
|
|
1679
|
+
waiting: z23.boolean(),
|
|
1680
|
+
/** The project folder it runs in ("matrx-frontend"); null when not in one. */
|
|
1681
|
+
folder: z23.string().max(256).nullable(),
|
|
1682
|
+
/** The same command in the same folder, running this many times (1 = no duplicate). */
|
|
1683
|
+
duplicates: z23.int().min(1),
|
|
1684
|
+
processes: z23.int().min(1),
|
|
1685
|
+
/** Sum over the tree, as `ps` reports it: 100 = one full core. */
|
|
1686
|
+
cpu_percent: z23.number().min(0),
|
|
1687
|
+
/** Real memory (macOS: the physical footprint Activity Monitor shows, compressed included). */
|
|
1688
|
+
memory_bytes: nonNegInt,
|
|
1689
|
+
started_at_ms: epochMs.nullable(),
|
|
1690
|
+
/** False for an app, an agent session, a terminal, a system process, the local stack or Matrx 2 itself. */
|
|
1691
|
+
stoppable: z23.boolean()
|
|
1692
|
+
});
|
|
1693
|
+
var ResourcesProcess = z23.strictObject({
|
|
1694
|
+
pid: z23.int().min(0),
|
|
1695
|
+
/** The command line, shortened. */
|
|
1696
|
+
name: z23.string().max(256),
|
|
1697
|
+
cpu_percent: z23.number().min(0),
|
|
1698
|
+
memory_bytes: nonNegInt,
|
|
1699
|
+
started_by: z23.string().max(64).nullable(),
|
|
1700
|
+
/** The job it belongs to ("type-check in aidream"); null when none. */
|
|
1701
|
+
job: z23.string().max(256).nullable(),
|
|
1702
|
+
started_at_ms: epochMs.nullable()
|
|
1703
|
+
});
|
|
1704
|
+
var ResourcesVerdict = z23.strictObject({
|
|
1705
|
+
level: ResourcesStrain,
|
|
1706
|
+
/** One sentence ("Your Mac is under strain. 3 type-checks are running at once."). */
|
|
1707
|
+
text: z23.string().max(256),
|
|
1708
|
+
/** The biggest jobs behind it; null when all is well. */
|
|
1709
|
+
cause: z23.string().max(1024).nullable()
|
|
1710
|
+
});
|
|
1711
|
+
var ResourcesSample = z23.strictObject({
|
|
1712
|
+
at_ms: epochMs,
|
|
1713
|
+
/** The 1-minute load average. */
|
|
1714
|
+
load: z23.number().min(0),
|
|
1715
|
+
memory_used_bytes: nonNegInt,
|
|
1716
|
+
typechecks: nonNegInt
|
|
1717
|
+
});
|
|
1718
|
+
var ResourcesActivityParams = z23.strictObject({});
|
|
1719
|
+
var ResourcesActivityResult = z23.strictObject({
|
|
1720
|
+
/** False until the first reading (a second or two after start). */
|
|
1721
|
+
ready: z23.boolean(),
|
|
1722
|
+
sampled_at_ms: epochMs.nullable(),
|
|
1723
|
+
cores: z23.int().min(1),
|
|
1724
|
+
/** 1, 5 and 15 minute load averages. */
|
|
1725
|
+
load: z23.array(z23.number().min(0)).length(3),
|
|
1726
|
+
memory: z23.strictObject({
|
|
1727
|
+
total_bytes: nonNegInt,
|
|
1728
|
+
/** Activity Monitor's Memory Used: app memory + wired + compressed. */
|
|
1729
|
+
used_bytes: nonNegInt,
|
|
1730
|
+
/** Data held compressed, and the memory the compressor takes to hold it. */
|
|
1731
|
+
compressed_bytes: nonNegInt,
|
|
1732
|
+
compressor_bytes: nonNegInt,
|
|
1733
|
+
swap_used_bytes: nonNegInt,
|
|
1734
|
+
pressure: ResourcesPressure.nullable()
|
|
1735
|
+
}),
|
|
1736
|
+
verdict: ResourcesVerdict,
|
|
1737
|
+
typechecks: z23.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
|
|
1738
|
+
/** Heaviest first (1 GB weighs as much as 16 % of a core). */
|
|
1739
|
+
jobs: z23.array(ResourcesJob).max(200),
|
|
1740
|
+
/** The 15 heaviest by memory and the 15 busiest by CPU, together. */
|
|
1741
|
+
top: z23.array(ResourcesProcess).max(30),
|
|
1742
|
+
/** The last hour, oldest first. */
|
|
1743
|
+
history: z23.array(ResourcesSample).max(1200)
|
|
1744
|
+
});
|
|
1745
|
+
var ResourcesStopJobParams = z23.strictObject({ pid: z23.int().min(1) });
|
|
1746
|
+
var ResourcesStopJobResult = z23.strictObject({
|
|
1747
|
+
/** Processes signalled; whatever is still running 5 seconds later is force-stopped. */
|
|
1748
|
+
processes: nonNegInt,
|
|
1749
|
+
/** It had finished before the request arrived. */
|
|
1750
|
+
already_finished: z23.boolean()
|
|
1751
|
+
});
|
|
1752
|
+
var ResourcesIncident = z23.strictObject({
|
|
1753
|
+
at_ms: epochMs,
|
|
1754
|
+
verdict: ResourcesVerdict,
|
|
1755
|
+
load: z23.number().min(0),
|
|
1756
|
+
memory_used_bytes: nonNegInt,
|
|
1757
|
+
compressed_bytes: nonNegInt,
|
|
1758
|
+
pressure: ResourcesPressure.nullable(),
|
|
1759
|
+
jobs: z23.array(
|
|
1760
|
+
z23.strictObject({
|
|
1761
|
+
kind: ResourcesJobKind,
|
|
1762
|
+
started_by: z23.string().max(64).nullable(),
|
|
1763
|
+
folder: z23.string().max(256).nullable(),
|
|
1764
|
+
command: z23.string().max(256),
|
|
1765
|
+
cpu_percent: z23.number().min(0),
|
|
1766
|
+
memory_bytes: nonNegInt,
|
|
1767
|
+
duplicates: z23.int().min(1)
|
|
1768
|
+
})
|
|
1769
|
+
).max(8)
|
|
1770
|
+
});
|
|
1771
|
+
var ResourcesIncidentsParams = z23.strictObject({ limit: z23.int().min(1).max(200).default(50) });
|
|
1772
|
+
var ResourcesIncidentsResult = z23.strictObject({
|
|
1773
|
+
/** Newest first; at most one a minute is written. */
|
|
1774
|
+
incidents: z23.array(ResourcesIncident).max(200)
|
|
1775
|
+
});
|
|
1663
1776
|
|
|
1664
|
-
// src/schema/
|
|
1777
|
+
// src/schema/stack.ts
|
|
1665
1778
|
import { z as z24 } from "zod";
|
|
1666
|
-
var
|
|
1779
|
+
var StackServerName = z24.string().regex(/^[a-z0-9_-]{1,64}$/);
|
|
1780
|
+
var StackTone = z24.enum(["good", "wait", "bad", "off"]);
|
|
1781
|
+
var StackServer = z24.strictObject({
|
|
1782
|
+
name: StackServerName,
|
|
1783
|
+
/** One word: Healthy, Starting, Unhealthy, Restarting, Stopping, Waiting, Stopped, Crashed, Off. */
|
|
1784
|
+
label: z24.string().max(32),
|
|
1785
|
+
tone: StackTone,
|
|
1786
|
+
/** What is going on, in one or two plain sentences. */
|
|
1787
|
+
sentence: z24.string().max(2e3),
|
|
1788
|
+
/** The config's own description of the server. */
|
|
1789
|
+
description: z24.string().max(512),
|
|
1790
|
+
/** Where the server answers, when its description names an address. */
|
|
1791
|
+
open_url: z24.string().max(2048).nullable(),
|
|
1792
|
+
log_file: z24.string().max(4096),
|
|
1793
|
+
/** When its log file was last written. */
|
|
1794
|
+
last_output_at_ms: epochMs.nullable(),
|
|
1795
|
+
started_at_ms: epochMs.nullable(),
|
|
1796
|
+
restarts: nonNegInt,
|
|
1797
|
+
exit_code: z24.int().nullable(),
|
|
1798
|
+
pid: z24.int().nullable()
|
|
1799
|
+
});
|
|
1800
|
+
var StackEvent = z24.strictObject({
|
|
1801
|
+
at_ms: epochMs,
|
|
1802
|
+
/** A server name, or "stack" for the stack as a whole. */
|
|
1803
|
+
server: z24.string().max(64),
|
|
1804
|
+
/** started · stopped · healthy · unhealthy · crashed · exited · restarting · stopping · action · action-done · action-failed · setup · error */
|
|
1805
|
+
kind: z24.string().max(32),
|
|
1806
|
+
text: z24.string().max(4e3)
|
|
1807
|
+
});
|
|
1808
|
+
var StackStateParams = z24.strictObject({});
|
|
1809
|
+
var StackStateResult = z24.strictObject({
|
|
1810
|
+
/** The stack's config file, when found. */
|
|
1811
|
+
config_path: z24.string().max(4096).nullable(),
|
|
1812
|
+
/** Why the stack cannot be run from here (no config, no process-compose), else null. */
|
|
1813
|
+
problem: z24.string().max(1e3).nullable(),
|
|
1814
|
+
stack_up: z24.boolean(),
|
|
1815
|
+
stack_started_at_ms: epochMs.nullable(),
|
|
1816
|
+
servers: z24.array(StackServer).max(64),
|
|
1817
|
+
/** One line about the one-shot setup steps ("Docker Desktop: running."), or null. */
|
|
1818
|
+
setup_note: z24.string().max(500).nullable(),
|
|
1819
|
+
/** Start everything / Stop everything in flight. */
|
|
1820
|
+
pending: z24.strictObject({ verb: z24.enum(["start", "stop"]), label: z24.string().max(64), since_ms: epochMs }).nullable(),
|
|
1821
|
+
/** The newest entries last. */
|
|
1822
|
+
events: z24.array(StackEvent).max(300)
|
|
1823
|
+
});
|
|
1824
|
+
var StackStartParams = z24.strictObject({});
|
|
1825
|
+
var StackStopParams = z24.strictObject({});
|
|
1826
|
+
var StackRunResult = z24.strictObject({ accepted: z24.boolean() });
|
|
1827
|
+
var StackServerActionParams = z24.strictObject({
|
|
1828
|
+
name: StackServerName,
|
|
1829
|
+
verb: z24.enum(["start", "stop", "restart"])
|
|
1830
|
+
});
|
|
1831
|
+
var StackServerActionResult = z24.strictObject({ message: z24.string().max(1e3) });
|
|
1832
|
+
var StackLogsParams = z24.strictObject({
|
|
1833
|
+
name: StackServerName,
|
|
1834
|
+
/** Without `offset`: the last this-many complete lines. With it: new lines after it, at most this many. */
|
|
1835
|
+
lines: z24.int().min(1).max(2e5).default(2e3),
|
|
1836
|
+
/** Byte offset the last read ended at: answer only what was written after it (follow). */
|
|
1837
|
+
offset: nonNegInt.optional(),
|
|
1838
|
+
/** A "Clear" point: the lines written after this byte offset (no `offset`). */
|
|
1839
|
+
since: nonNegInt.optional(),
|
|
1840
|
+
/** With `offset`: wait up to this long for a new line when none is waiting (0 answers at once). */
|
|
1841
|
+
wait_ms: z24.int().min(0).max(25e3).default(0)
|
|
1842
|
+
});
|
|
1843
|
+
var StackLogsResult = z24.strictObject({
|
|
1844
|
+
/** Complete lines, colour codes removed. */
|
|
1845
|
+
lines: z24.array(z24.string().max(65536)).max(2e5),
|
|
1846
|
+
/** Where these lines end: pass it back as `offset` to follow. */
|
|
1847
|
+
offset: nonNegInt,
|
|
1848
|
+
/** False when `since` no longer exists (the log rotated): the lines are the plain tail instead. */
|
|
1849
|
+
since_valid: z24.boolean(),
|
|
1850
|
+
/** The log was rotated or truncated since `offset`: these lines start the file again. */
|
|
1851
|
+
reset: z24.boolean(),
|
|
1852
|
+
log_file: z24.string().max(4096)
|
|
1853
|
+
});
|
|
1854
|
+
var StackErrorsParams = z24.strictObject({
|
|
1855
|
+
window_minutes: z24.int().min(1).max(1440).default(60)
|
|
1856
|
+
});
|
|
1857
|
+
var StackErrorsResult = z24.strictObject({
|
|
1858
|
+
/** Per server: a heading line ("=== aidream — errors in the last 60 minutes (<file>) ===") and each error with the 10 lines after it. */
|
|
1859
|
+
sections: z24.array(z24.strictObject({ name: StackServerName, heading: z24.string().max(4096), lines: z24.array(z24.string().max(65536)).max(5e3) })).max(64),
|
|
1860
|
+
window_minutes: z24.int().min(1).max(1440)
|
|
1861
|
+
});
|
|
1862
|
+
|
|
1863
|
+
// src/schema/audio.ts
|
|
1864
|
+
import { z as z25 } from "zod";
|
|
1865
|
+
var AudioDevice = z25.strictObject({
|
|
1667
1866
|
/** The OS's name for it, as audio.record takes it. */
|
|
1668
|
-
id:
|
|
1669
|
-
name:
|
|
1670
|
-
default:
|
|
1867
|
+
id: z25.string().min(1).max(256),
|
|
1868
|
+
name: z25.string().max(256),
|
|
1869
|
+
default: z25.boolean()
|
|
1671
1870
|
});
|
|
1672
|
-
var AudioDevicesParams =
|
|
1673
|
-
var AudioDevicesResult =
|
|
1674
|
-
inputs:
|
|
1675
|
-
outputs:
|
|
1871
|
+
var AudioDevicesParams = z25.strictObject({});
|
|
1872
|
+
var AudioDevicesResult = z25.strictObject({
|
|
1873
|
+
inputs: z25.array(AudioDevice).max(64),
|
|
1874
|
+
outputs: z25.array(AudioDevice).max(64)
|
|
1676
1875
|
});
|
|
1677
|
-
var AudioRecordParams =
|
|
1678
|
-
seconds:
|
|
1876
|
+
var AudioRecordParams = z25.strictObject({
|
|
1877
|
+
seconds: z25.number().min(0.5).max(600),
|
|
1679
1878
|
/** The microphone (from audio.devices); the default input when absent. */
|
|
1680
|
-
device_id:
|
|
1879
|
+
device_id: z25.string().min(1).max(256).optional(),
|
|
1681
1880
|
/** Where the WAV file goes; a new file in the temp folder when absent. */
|
|
1682
1881
|
path: AbsPath.optional()
|
|
1683
1882
|
});
|
|
1684
|
-
var AudioRecordResult =
|
|
1883
|
+
var AudioRecordResult = z25.strictObject({
|
|
1685
1884
|
path: AbsPath,
|
|
1686
|
-
seconds:
|
|
1885
|
+
seconds: z25.number().min(0),
|
|
1687
1886
|
bytes: nonNegInt,
|
|
1688
1887
|
/** Loudest sample, 0–1: 0 means the device gave silence. */
|
|
1689
|
-
peak:
|
|
1888
|
+
peak: z25.number().min(0).max(1)
|
|
1690
1889
|
});
|
|
1691
|
-
var AudioPlayParams =
|
|
1692
|
-
var AudioPlayResult =
|
|
1890
|
+
var AudioPlayParams = z25.strictObject({ path: AbsPath });
|
|
1891
|
+
var AudioPlayResult = z25.strictObject({ path: AbsPath, seconds: z25.number().min(0) });
|
|
1693
1892
|
|
|
1694
1893
|
// src/schema/fs-watch.ts
|
|
1695
|
-
import { z as
|
|
1696
|
-
var FsWatchId =
|
|
1697
|
-
var FsWatchStartParams =
|
|
1894
|
+
import { z as z26 } from "zod";
|
|
1895
|
+
var FsWatchId = z26.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
|
|
1896
|
+
var FsWatchStartParams = z26.strictObject({
|
|
1698
1897
|
path: AbsPath,
|
|
1699
|
-
recursive:
|
|
1898
|
+
recursive: z26.boolean().default(true),
|
|
1700
1899
|
/** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
|
|
1701
|
-
ignore:
|
|
1900
|
+
ignore: z26.array(z26.string().max(256)).max(64).default([])
|
|
1702
1901
|
});
|
|
1703
|
-
var FsWatchStartResult =
|
|
1902
|
+
var FsWatchStartResult = z26.strictObject({
|
|
1704
1903
|
watch_id: FsWatchId,
|
|
1705
1904
|
path: AbsPath,
|
|
1706
1905
|
/** The watch ends by itself if nobody reads it for 30 minutes. */
|
|
1707
1906
|
expires_at_ms: epochMs
|
|
1708
1907
|
});
|
|
1709
|
-
var FsWatchEventsParams =
|
|
1908
|
+
var FsWatchEventsParams = z26.strictObject({
|
|
1710
1909
|
watch_id: FsWatchId,
|
|
1711
1910
|
/** Wait up to this long for a first change when none is waiting (0 answers at once). */
|
|
1712
|
-
wait_ms:
|
|
1911
|
+
wait_ms: z26.int().min(0).max(25e3).default(0)
|
|
1713
1912
|
});
|
|
1714
|
-
var FsWatchEventsResult =
|
|
1913
|
+
var FsWatchEventsResult = z26.strictObject({
|
|
1715
1914
|
/** What changed since the last read, oldest first; re-checked against the disk when read. */
|
|
1716
|
-
changes:
|
|
1915
|
+
changes: z26.array(FsChange).max(1e3),
|
|
1717
1916
|
/** Changes were dropped (more than 1000 waited): list the folder again. */
|
|
1718
|
-
overflow:
|
|
1917
|
+
overflow: z26.boolean(),
|
|
1719
1918
|
expires_at_ms: epochMs
|
|
1720
1919
|
});
|
|
1721
|
-
var FsWatchStopParams =
|
|
1722
|
-
var FsWatchStopResult =
|
|
1920
|
+
var FsWatchStopParams = z26.strictObject({ watch_id: FsWatchId });
|
|
1921
|
+
var FsWatchStopResult = z26.strictObject({ watch_id: FsWatchId });
|
|
1723
1922
|
|
|
1724
1923
|
// src/schema/exec-job.ts
|
|
1725
|
-
import { z as
|
|
1726
|
-
var ExecJobId =
|
|
1727
|
-
var ExecJobStartParams =
|
|
1728
|
-
command:
|
|
1924
|
+
import { z as z27 } from "zod";
|
|
1925
|
+
var ExecJobId = z27.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
|
|
1926
|
+
var ExecJobStartParams = z27.strictObject({
|
|
1927
|
+
command: z27.string().min(1).max(131072),
|
|
1729
1928
|
/** The folder it runs in; the home folder when absent. */
|
|
1730
1929
|
cwd: AbsPath.optional(),
|
|
1731
|
-
env:
|
|
1930
|
+
env: z27.record(z27.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z27.string().max(32768)).optional()
|
|
1732
1931
|
});
|
|
1733
|
-
var ExecJobStartResult =
|
|
1734
|
-
var ExecJobOutputParams =
|
|
1932
|
+
var ExecJobStartResult = z27.strictObject({ job_id: ExecJobId, pid: z27.int().min(1), cwd: AbsPath });
|
|
1933
|
+
var ExecJobOutputParams = z27.strictObject({
|
|
1735
1934
|
job_id: ExecJobId,
|
|
1736
1935
|
/** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
|
|
1737
1936
|
offset: nonNegInt.default(0),
|
|
1738
1937
|
/** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
|
|
1739
|
-
wait_ms:
|
|
1740
|
-
max_bytes:
|
|
1938
|
+
wait_ms: z27.int().min(0).max(25e3).default(0),
|
|
1939
|
+
max_bytes: z27.int().min(1024).max(1048576).default(65536)
|
|
1741
1940
|
});
|
|
1742
|
-
var ExecJobOutputResult =
|
|
1941
|
+
var ExecJobOutputResult = z27.strictObject({
|
|
1743
1942
|
/** stdout and stderr interleaved as they arrived (UTF-8). */
|
|
1744
|
-
output:
|
|
1943
|
+
output: z27.string(),
|
|
1745
1944
|
next_offset: nonNegInt,
|
|
1746
1945
|
/** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
|
|
1747
1946
|
dropped_bytes: nonNegInt,
|
|
1748
|
-
running:
|
|
1749
|
-
exit_code:
|
|
1947
|
+
running: z27.boolean(),
|
|
1948
|
+
exit_code: z27.int().nullable()
|
|
1750
1949
|
});
|
|
1751
|
-
var ExecJobStopParams =
|
|
1950
|
+
var ExecJobStopParams = z27.strictObject({
|
|
1752
1951
|
job_id: ExecJobId,
|
|
1753
1952
|
/** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
|
|
1754
|
-
force:
|
|
1953
|
+
force: z27.boolean().default(false)
|
|
1755
1954
|
});
|
|
1756
|
-
var ExecJobStopResult =
|
|
1757
|
-
var ExecJobInfo =
|
|
1955
|
+
var ExecJobStopResult = z27.strictObject({ job_id: ExecJobId, exited: z27.boolean(), exit_code: z27.int().nullable() });
|
|
1956
|
+
var ExecJobInfo = z27.strictObject({
|
|
1758
1957
|
job_id: ExecJobId,
|
|
1759
|
-
command:
|
|
1760
|
-
pid:
|
|
1958
|
+
command: z27.string().max(1024),
|
|
1959
|
+
pid: z27.int().min(1),
|
|
1761
1960
|
cwd: AbsPath,
|
|
1762
|
-
running:
|
|
1763
|
-
exit_code:
|
|
1961
|
+
running: z27.boolean(),
|
|
1962
|
+
exit_code: z27.int().nullable(),
|
|
1764
1963
|
started_at_ms: epochMs,
|
|
1765
1964
|
output_bytes: nonNegInt
|
|
1766
1965
|
});
|
|
1767
|
-
var ExecJobListParams =
|
|
1768
|
-
var ExecJobListResult =
|
|
1966
|
+
var ExecJobListParams = z27.strictObject({});
|
|
1967
|
+
var ExecJobListResult = z27.strictObject({ jobs: z27.array(ExecJobInfo).max(64) });
|
|
1769
1968
|
|
|
1770
1969
|
// src/schema/coding.ts
|
|
1771
|
-
import { z as
|
|
1772
|
-
var CodingServiceCredentials =
|
|
1773
|
-
access_token:
|
|
1774
|
-
user_id:
|
|
1970
|
+
import { z as z28 } from "zod";
|
|
1971
|
+
var CodingServiceCredentials = z28.strictObject({
|
|
1972
|
+
access_token: z28.string().min(16).max(16384),
|
|
1973
|
+
user_id: z28.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),
|
|
1775
1974
|
/** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
|
|
1776
|
-
server_url:
|
|
1975
|
+
server_url: z28.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
|
|
1777
1976
|
});
|
|
1778
|
-
var CodingHistoryBlocked =
|
|
1977
|
+
var CodingHistoryBlocked = z28.enum([
|
|
1779
1978
|
"signed_out",
|
|
1780
1979
|
"offline",
|
|
1781
1980
|
"organization_required",
|
|
@@ -1783,11 +1982,11 @@ var CodingHistoryBlocked = z27.enum([
|
|
|
1783
1982
|
"cloud_list_unavailable",
|
|
1784
1983
|
"history_too_large"
|
|
1785
1984
|
]);
|
|
1786
|
-
var CodingHistoryFailure =
|
|
1787
|
-
session_id:
|
|
1788
|
-
reason:
|
|
1985
|
+
var CodingHistoryFailure = z28.strictObject({
|
|
1986
|
+
session_id: z28.string().max(64),
|
|
1987
|
+
reason: z28.string().max(300)
|
|
1789
1988
|
});
|
|
1790
|
-
var CodingHistoryRun =
|
|
1989
|
+
var CodingHistoryRun = z28.strictObject({
|
|
1791
1990
|
/** Claude Code sessions found on this computer. */
|
|
1792
1991
|
local_sessions: nonNegInt,
|
|
1793
1992
|
/** Of those, already complete in AI Matrx. */
|
|
@@ -1802,39 +2001,39 @@ var CodingHistoryRun = z27.strictObject({
|
|
|
1802
2001
|
/** Changed while being read; a later run takes them. */
|
|
1803
2002
|
changed: nonNegInt,
|
|
1804
2003
|
failed: nonNegInt,
|
|
1805
|
-
failures:
|
|
2004
|
+
failures: z28.array(CodingHistoryFailure).max(20),
|
|
1806
2005
|
/** Candidates not reached yet. */
|
|
1807
2006
|
remaining: nonNegInt,
|
|
1808
2007
|
/** The one line a person reads, e.g. "Imported 12 of 14 sessions. 140 already in AI Matrx." */
|
|
1809
|
-
summary:
|
|
2008
|
+
summary: z28.string().max(400)
|
|
1810
2009
|
});
|
|
1811
|
-
var CodingHistoryStep =
|
|
2010
|
+
var CodingHistoryStep = z28.strictObject({
|
|
1812
2011
|
/** Null when the run could not start (blocked before a plan existed). */
|
|
1813
|
-
plan_id:
|
|
1814
|
-
finished:
|
|
2012
|
+
plan_id: z28.string().regex(/^[0-9a-f]{32}$/).nullable(),
|
|
2013
|
+
finished: z28.boolean(),
|
|
1815
2014
|
blocked: CodingHistoryBlocked.nullable(),
|
|
1816
2015
|
run: CodingHistoryRun
|
|
1817
2016
|
});
|
|
1818
|
-
var CodingPlanMissingParams =
|
|
1819
|
-
var CodingImportNextParams =
|
|
1820
|
-
plan_id:
|
|
2017
|
+
var CodingPlanMissingParams = z28.strictObject({ credentials: CodingServiceCredentials.nullable() });
|
|
2018
|
+
var CodingImportNextParams = z28.strictObject({
|
|
2019
|
+
plan_id: z28.string().regex(/^[0-9a-f]{32}$/),
|
|
1821
2020
|
credentials: CodingServiceCredentials.nullable()
|
|
1822
2021
|
});
|
|
1823
|
-
var CodingServiceProgress =
|
|
1824
|
-
phase:
|
|
2022
|
+
var CodingServiceProgress = z28.strictObject({
|
|
2023
|
+
phase: z28.enum(["checking", "importing"]),
|
|
1825
2024
|
done: nonNegInt,
|
|
1826
2025
|
total: nonNegInt
|
|
1827
2026
|
});
|
|
1828
|
-
var CodingHistoryImportMissingParams =
|
|
1829
|
-
var CodingHistoryImportMissingResult =
|
|
1830
|
-
state:
|
|
2027
|
+
var CodingHistoryImportMissingParams = z28.strictObject({});
|
|
2028
|
+
var CodingHistoryImportMissingResult = z28.strictObject({
|
|
2029
|
+
state: z28.enum(["done", "blocked", "cancelled"]),
|
|
1831
2030
|
blocked: CodingHistoryBlocked.nullable(),
|
|
1832
2031
|
run: CodingHistoryRun,
|
|
1833
2032
|
elapsed_ms: nonNegInt
|
|
1834
2033
|
});
|
|
1835
|
-
var CodingHistoryProgressEvent =
|
|
2034
|
+
var CodingHistoryProgressEvent = z28.strictObject({
|
|
1836
2035
|
request_id: RequestId,
|
|
1837
|
-
phase:
|
|
2036
|
+
phase: z28.enum(["checking", "importing"]),
|
|
1838
2037
|
/** Sessions settled so far, of `total` candidates (0 of 0 while checking). */
|
|
1839
2038
|
done: nonNegInt,
|
|
1840
2039
|
total: nonNegInt,
|
|
@@ -1936,9 +2135,19 @@ var OPS = {
|
|
|
1936
2135
|
"power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
|
|
1937
2136
|
"power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1938
2137
|
"resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
|
|
2138
|
+
"resources.activity": { params: ResourcesActivityParams, result: ResourcesActivityResult, kind: "unary", since: "1.17", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2139
|
+
"resources.stop_job": { params: ResourcesStopJobParams, result: ResourcesStopJobResult, kind: "unary", since: "1.17", errors: ["NOT_FOUND", "CONFLICT", "AUTH_FORBIDDEN", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2140
|
+
"resources.incidents": { params: ResourcesIncidentsParams, result: ResourcesIncidentsResult, kind: "unary", since: "1.17", errors: ["INTERNAL"] },
|
|
1939
2141
|
"audio.devices": { params: AudioDevicesParams, result: AudioDevicesResult, kind: "unary", since: "1.6", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1940
2142
|
"audio.record": { params: AudioRecordParams, result: AudioRecordResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "RESOURCE_BUSY", "INTERNAL"] },
|
|
1941
2143
|
"audio.play": { params: AudioPlayParams, result: AudioPlayResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2144
|
+
// The local AI Matrx servers (aidream's process-compose stack), supervised from Matrx 2's core.
|
|
2145
|
+
"stack.state": { params: StackStateParams, result: StackStateResult, kind: "unary", since: "1.16", errors: ["INTERNAL"] },
|
|
2146
|
+
"stack.start": { params: StackStartParams, result: StackRunResult, kind: "unary", since: "1.16", errors: ["RESOURCE_BUSY", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2147
|
+
"stack.stop": { params: StackStopParams, result: StackRunResult, kind: "unary", since: "1.16", errors: ["RESOURCE_BUSY", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2148
|
+
"stack.server.action": { params: StackServerActionParams, result: StackServerActionResult, kind: "unary", since: "1.16", errors: ["NOT_FOUND", "CONFLICT", "INTERNAL"] },
|
|
2149
|
+
"stack.logs": { params: StackLogsParams, result: StackLogsResult, kind: "unary", since: "1.16", errors: ["NOT_FOUND", "INTERNAL"] },
|
|
2150
|
+
"stack.errors": { params: StackErrorsParams, result: StackErrorsResult, kind: "unary", since: "1.16", errors: ["INTERNAL"] },
|
|
1942
2151
|
// Claude Code history (SPEC §6 coding): served by the `coding` Python service through SERVICES below.
|
|
1943
2152
|
"coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] }
|
|
1944
2153
|
};
|
|
@@ -2163,6 +2372,20 @@ var NAMED_SCHEMAS = {
|
|
|
2163
2372
|
ResourcesDisk,
|
|
2164
2373
|
ResourcesSnapshotParams,
|
|
2165
2374
|
ResourcesSnapshotResult,
|
|
2375
|
+
ResourcesJobKind,
|
|
2376
|
+
ResourcesStrain,
|
|
2377
|
+
ResourcesPressure,
|
|
2378
|
+
ResourcesVerdict,
|
|
2379
|
+
ResourcesSample,
|
|
2380
|
+
ResourcesJob,
|
|
2381
|
+
ResourcesProcess,
|
|
2382
|
+
ResourcesActivityParams,
|
|
2383
|
+
ResourcesActivityResult,
|
|
2384
|
+
ResourcesStopJobParams,
|
|
2385
|
+
ResourcesStopJobResult,
|
|
2386
|
+
ResourcesIncident,
|
|
2387
|
+
ResourcesIncidentsParams,
|
|
2388
|
+
ResourcesIncidentsResult,
|
|
2166
2389
|
AudioDevice,
|
|
2167
2390
|
AudioDevicesParams,
|
|
2168
2391
|
AudioDevicesResult,
|
|
@@ -2170,6 +2393,21 @@ var NAMED_SCHEMAS = {
|
|
|
2170
2393
|
AudioRecordResult,
|
|
2171
2394
|
AudioPlayParams,
|
|
2172
2395
|
AudioPlayResult,
|
|
2396
|
+
StackServerName,
|
|
2397
|
+
StackTone,
|
|
2398
|
+
StackServer,
|
|
2399
|
+
StackEvent,
|
|
2400
|
+
StackStateParams,
|
|
2401
|
+
StackStateResult,
|
|
2402
|
+
StackStartParams,
|
|
2403
|
+
StackStopParams,
|
|
2404
|
+
StackRunResult,
|
|
2405
|
+
StackServerActionParams,
|
|
2406
|
+
StackServerActionResult,
|
|
2407
|
+
StackLogsParams,
|
|
2408
|
+
StackLogsResult,
|
|
2409
|
+
StackErrorsParams,
|
|
2410
|
+
StackErrorsResult,
|
|
2173
2411
|
FsWatchId,
|
|
2174
2412
|
FsWatchStartParams,
|
|
2175
2413
|
FsWatchStartResult,
|
|
@@ -2299,7 +2537,8 @@ var FIELDS_SINCE = {
|
|
|
2299
2537
|
AppsAccountsUsageResult: { problem: "1.12" },
|
|
2300
2538
|
AppsAccountsResetsResult: { problem: "1.12" },
|
|
2301
2539
|
ChatRow: { app_project: "1.13", tokens: "1.13", original_title: "1.14", title_source: "1.14", title_override: "1.14", archived: "1.15" },
|
|
2302
|
-
AccountUsage: { plan: "1.13", credits: "1.13" }
|
|
2540
|
+
AccountUsage: { plan: "1.13", credits: "1.13" },
|
|
2541
|
+
ResourcesDisk: { name: "1.17" }
|
|
2303
2542
|
};
|
|
2304
2543
|
var NULL_SINCE = {
|
|
2305
2544
|
"RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
|
|
@@ -2366,7 +2605,8 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
|
|
|
2366
2605
|
["apps.projects.move", [["chat", "ChatRow"]]],
|
|
2367
2606
|
["apps.chats.star", [["chat", "ChatRow"]]],
|
|
2368
2607
|
["apps.chats.place", [["chat", "ChatRow"]]],
|
|
2369
|
-
["apps.accounts.usage", [["accounts", "AccountUsage"]]]
|
|
2608
|
+
["apps.accounts.usage", [["accounts", "AccountUsage"]]],
|
|
2609
|
+
["resources.snapshot", [["disks", "ResourcesDisk"]]]
|
|
2370
2610
|
]);
|
|
2371
2611
|
function stripNested(value, nested, version) {
|
|
2372
2612
|
if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
|
|
@@ -2427,7 +2667,7 @@ function forPeer(op, part, value, version) {
|
|
|
2427
2667
|
var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
|
|
2428
2668
|
|
|
2429
2669
|
// src/contract.ts
|
|
2430
|
-
var CONTRACT_SHA256 = "
|
|
2670
|
+
var CONTRACT_SHA256 = "cdfad283c689005856b4161f28a37892d1c3356db077f685a4a659fc2c8fc657";
|
|
2431
2671
|
|
|
2432
2672
|
// src/close-policy.ts
|
|
2433
2673
|
var CLOSE_RULES = {
|
|
@@ -2487,7 +2727,7 @@ var TOOL_CATALOG = [
|
|
|
2487
2727
|
{ name: "desktop_input", group: "os_control", state: "built", path: "device_op", ops: ["input.type_text", "input.hotkey", "input.mouse_click", "input.mouse_move"], platforms: ALL, summary: "Keyboard and mouse" },
|
|
2488
2728
|
{ name: "desktop_audio", group: "os_control", state: "built", path: "device_op", ops: ["audio.devices", "audio.record", "audio.play"], platforms: ALL, summary: "Audio devices, record, play" },
|
|
2489
2729
|
{ name: "desktop_power", group: "os_control", state: "built", path: "device_op", ops: ["power.status", "power.prevent_sleep"], platforms: ALL, summary: "Battery and keep awake" },
|
|
2490
|
-
{ name: "desktop_resources", group: "os_control", state: "built", path: "device_op", ops: ["resources.snapshot"], platforms: ALL, summary: "CPU, memory and disk use" },
|
|
2730
|
+
{ name: "desktop_resources", group: "os_control", state: "built", path: "device_op", ops: ["resources.snapshot", "resources.activity", "resources.stop_job", "resources.incidents"], platforms: ALL, summary: "CPU, memory and disk use; what is using them, grouped into jobs; stop a job; the slowdown log" },
|
|
2491
2731
|
{ name: "fs_watch", group: "os_control", state: "built", path: "device_op", ops: ["fs.watch.start", "fs.watch.events", "fs.watch.stop"], platforms: ALL, summary: "Watch a folder; read what changed" },
|
|
2492
2732
|
// ── 3. Personal apps and automation ──────────────────────────────────────────────────────────
|
|
2493
2733
|
{ name: "desktop_automation", group: "personal_automation", state: "planned", path: "device_op", ops: ["automation.script"], platforms: ["darwin", "win32"], summary: "AppleScript on a Mac, PowerShell on Windows" },
|
|
@@ -3045,9 +3285,23 @@ export {
|
|
|
3045
3285
|
RequestMsg,
|
|
3046
3286
|
ResourceId,
|
|
3047
3287
|
ResourceInfo,
|
|
3288
|
+
ResourcesActivityParams,
|
|
3289
|
+
ResourcesActivityResult,
|
|
3048
3290
|
ResourcesDisk,
|
|
3291
|
+
ResourcesIncident,
|
|
3292
|
+
ResourcesIncidentsParams,
|
|
3293
|
+
ResourcesIncidentsResult,
|
|
3294
|
+
ResourcesJob,
|
|
3295
|
+
ResourcesJobKind,
|
|
3296
|
+
ResourcesPressure,
|
|
3297
|
+
ResourcesProcess,
|
|
3298
|
+
ResourcesSample,
|
|
3049
3299
|
ResourcesSnapshotParams,
|
|
3050
3300
|
ResourcesSnapshotResult,
|
|
3301
|
+
ResourcesStopJobParams,
|
|
3302
|
+
ResourcesStopJobResult,
|
|
3303
|
+
ResourcesStrain,
|
|
3304
|
+
ResourcesVerdict,
|
|
3051
3305
|
ResponseMsg,
|
|
3052
3306
|
SERVICES,
|
|
3053
3307
|
SERVICE_MAX_FRAME_BYTES,
|
|
@@ -3090,6 +3344,21 @@ export {
|
|
|
3090
3344
|
SpendScopes,
|
|
3091
3345
|
SpendSplit,
|
|
3092
3346
|
SpendStart,
|
|
3347
|
+
StackErrorsParams,
|
|
3348
|
+
StackErrorsResult,
|
|
3349
|
+
StackEvent,
|
|
3350
|
+
StackLogsParams,
|
|
3351
|
+
StackLogsResult,
|
|
3352
|
+
StackRunResult,
|
|
3353
|
+
StackServer,
|
|
3354
|
+
StackServerActionParams,
|
|
3355
|
+
StackServerActionResult,
|
|
3356
|
+
StackServerName,
|
|
3357
|
+
StackStartParams,
|
|
3358
|
+
StackStateParams,
|
|
3359
|
+
StackStateResult,
|
|
3360
|
+
StackStopParams,
|
|
3361
|
+
StackTone,
|
|
3093
3362
|
StreamMeta,
|
|
3094
3363
|
StreamMsg,
|
|
3095
3364
|
SysinfoGetParams,
|