@ai-matrx/desktop-protocol 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ SPEC 6.1 sandbox parity: every search and list op now answers exactly what the cloud sandbox
6
+ daemon answers (fd 8.3.1 / ripgrep 13 run in `cwd`), verified against answers recorded from a live
7
+ sandbox (matrx-desktop `test/fixtures/sandbox-daemon/observed.json`).
8
+
9
+ - `fs.search_content`: `results[].path` is RELATIVE to `cwd` (no `./`), `submatches[].match` is
10
+ ripgrep's `{ text }`, and there is no `truncated` (`max_results` caps matching lines per file,
11
+ as `rg -m`).
12
+ - `fs.search_paths`: `paths` are RELATIVE to `cwd` and prefixed `./` (fd), sorted, cut to
13
+ `max_results`; no `truncated`.
14
+ - `FsEntry` (`fs.stat`, `fs.list` entries) is the daemon's `get_stat_dict` field for field:
15
+ `mtime_ms` and `hidden` are gone (take a write guard from `fs.read`'s `mtime_ms`).
16
+ - `fs.list` defaults are the daemon's behaviour: `limit` 1000, dotfiles listed (`show_hidden`
17
+ true), siblings in byte order of name (`sort` "name"). Page tokens are single-use.
18
+
19
+ Consumer action: join a search path to `cwd` yourself when you need an absolute one; read
20
+ `match.text` instead of `match`; drop any use of `truncated` on search results and of `mtime_ms` /
21
+ `hidden` on entries.
22
+
3
23
  ## 0.2.0
4
24
 
5
25
  The phone console (lane E) needs a client that comes back the instant the person does.
package/dist/client.cjs CHANGED
@@ -125,6 +125,7 @@ var import_zod2 = require("zod");
125
125
  var import_zod = require("zod");
126
126
  var PROTOCOL_MAJOR = 1;
127
127
  var PROTOCOL_MINOR = 0;
128
+ var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
128
129
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
129
130
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
130
131
  var ResourceId = import_zod.z.string().regex(/^(pty|watch)_[A-Za-z0-9]{16,40}$/);
@@ -396,12 +397,9 @@ var FsEntry = import_zod6.z.strictObject({
396
397
  kind: FsKind,
397
398
  size: nonNegInt,
398
399
  mtime: import_zod6.z.number().min(0),
399
- // seconds, float — daemon parity
400
- mtime_ms: epochMs,
400
+ // seconds, float
401
401
  mode: import_zod6.z.int().min(0).max(4095),
402
- target: AbsPath.nullable(),
403
- // symlink target, never followed
404
- hidden: import_zod6.z.boolean()
402
+ target: AbsPath.nullable()
405
403
  });
406
404
  var FsListParams = import_zod6.z.strictObject({
407
405
  path: AbsPath,
@@ -409,10 +407,12 @@ var FsListParams = import_zod6.z.strictObject({
409
407
  depth: import_zod6.z.int().min(1).max(32).default(1),
410
408
  pattern: import_zod6.z.string().max(256).optional(),
411
409
  // glob on name
412
- limit: import_zod6.z.int().min(1).max(5e3).default(500),
410
+ limit: import_zod6.z.int().min(1).max(5e3).default(1e3),
413
411
  page_token: import_zod6.z.string().max(256).optional(),
414
- show_hidden: import_zod6.z.boolean().default(false),
415
- sort: import_zod6.z.enum(["name", "mtime", "size", "kind"]).default("kind")
412
+ // Desktop additions; their defaults ARE the daemon's behaviour: dotfiles listed, siblings in
413
+ // binary (byte) order of name, depth-first.
414
+ show_hidden: import_zod6.z.boolean().default(true),
415
+ sort: import_zod6.z.enum(["name", "mtime", "size", "kind"]).default("name")
416
416
  });
417
417
  var FsListResult = import_zod6.z.strictObject({
418
418
  entries: import_zod6.z.array(FsEntry),
@@ -496,7 +496,7 @@ var FsSearchPathsParams = import_zod6.z.strictObject({
496
496
  hidden: import_zod6.z.boolean().default(false),
497
497
  max_results: import_zod6.z.int().min(1).max(5e3).default(100)
498
498
  });
499
- var FsSearchPathsResult = import_zod6.z.strictObject({ paths: import_zod6.z.array(AbsPath), truncated: import_zod6.z.boolean() });
499
+ var FsSearchPathsResult = import_zod6.z.strictObject({ paths: import_zod6.z.array(import_zod6.z.string().min(3).max(4096).regex(/^\.\/[^\\\u0000]+$/)) });
500
500
  var FsSearchContentParams = import_zod6.z.strictObject({
501
501
  query: import_zod6.z.string().min(1).max(1024),
502
502
  cwd: AbsPath,
@@ -509,13 +509,14 @@ var FsSearchContentParams = import_zod6.z.strictObject({
509
509
  var FsSearchContentResult = import_zod6.z.strictObject({
510
510
  results: import_zod6.z.array(
511
511
  import_zod6.z.strictObject({
512
- path: AbsPath,
512
+ path: import_zod6.z.string().min(1).max(4096).regex(/^[^/\\\u0000][^\\\u0000]*$/),
513
513
  lines: import_zod6.z.string(),
514
514
  line_number: import_zod6.z.int().min(1),
515
- submatches: import_zod6.z.array(import_zod6.z.strictObject({ match: import_zod6.z.string(), start: nonNegInt, end: nonNegInt }))
515
+ submatches: import_zod6.z.array(
516
+ import_zod6.z.strictObject({ match: import_zod6.z.strictObject({ text: import_zod6.z.string() }), start: nonNegInt, end: nonNegInt })
517
+ )
516
518
  })
517
- ),
518
- truncated: import_zod6.z.boolean()
519
+ )
519
520
  });
520
521
  var FsChange = import_zod6.z.strictObject({
521
522
  type: import_zod6.z.enum(["created", "modified", "deleted", "moved"]),