@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/dist/index.d.cts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { z } from 'zod';
2
- export { e as CancelMsg, f as ClientToCoreMsg, C as ClientType, g as CloseCode, h as CloseCodeValue, j as CoreToClientMsg, k as CreditMsg, D as DesktopProtocolError, d as EVENTS, l as EndMsg, E as EndReason, m as ErrorCode, n as ErrorCodeName, o as ErrorData, p as ErrorMsg, q as ErrorReason, r as ErrorReasonName, s as EventMsg, t as EventName, H as HelloMsg, L as Limits, N as NAMED_SCHEMAS, u as NamedSchemaId, c as OPS, v as OpDescriptor, O as OpName, a as OpParams, b as OpResult, w as OpSpec, P as PING_TEXT, x as PONG_TEXT, y as ProtocolErrorBody, R as RelayMsg, z as RequestMsg, A as ResponseMsg, S as StreamMeta, B as StreamMsg, W as Welcome, i as isDesktopProtocolError } from './registry-DJbrsZ4u.cjs';
2
+ export { B as BEARER_PREFIX, e as CancelMsg, f as ClientToCoreMsg, C as ClientType, g as CloseCode, h as CloseCodeValue, j as CoreToClientMsg, k as CreditMsg, D as DesktopProtocolError, d as EVENTS, l as EndMsg, E as EndReason, m as ErrorCode, n as ErrorCodeName, o as ErrorData, p as ErrorMsg, q as ErrorReason, r as ErrorReasonName, s as EventMsg, t as EventName, H as HelloMsg, L as Limits, N as NAMED_SCHEMAS, u as NamedSchemaId, c as OPS, v as OpDescriptor, O as OpName, a as OpParams, b as OpResult, w as OpSpec, P as PING_TEXT, x as PONG_TEXT, y as ProtocolErrorBody, R as RelayMsg, z as RequestMsg, A as ResponseMsg, F as SUBPROTOCOL, S as StreamMeta, G as StreamMsg, W as Welcome, i as isDesktopProtocolError } from './registry-DQ5_mP_5.cjs';
3
3
  export { BROADCAST_CID, DecodedFrame, FRAME_HEADER_BYTES, FRAME_STRUCT_FORMAT, FRAME_VERSION, FrameChannel, FrameChannelValue, FrameFlag, assertFrameHeader, connectionEndFrame, decodeFrame, encodeFrame, hasFlag, isConnectionEnd, readCid, stampCid } from './frame.cjs';
4
4
 
5
5
  /** @ai-matrx/desktop-protocol — version and primitive schemas. Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */
6
6
 
7
7
  declare const PROTOCOL_MAJOR: 1;
8
8
  declare const PROTOCOL_MINOR: 0;
9
+ /** This package's version as the wire spells it ("major.minor"): hello, welcome, relay status. */
10
+ declare const PROTOCOL_VERSION: "1.0";
9
11
  /** Internal building blocks — deliberately unnamed in $defs (inlined wherever used). */
10
12
  declare const u32: z.ZodInt;
11
13
  declare const nonNegInt: z.ZodInt;
@@ -165,7 +167,10 @@ declare const FsKind: z.ZodEnum<{
165
167
  symlink: "symlink";
166
168
  }>;
167
169
  type FsKind = z.output<typeof FsKind>;
168
- /** = daemon get_stat_dict(), plus mtime in ms and hidden. */
170
+ /**
171
+ * = daemon get_stat_dict(), field for field (SPEC 6.1): what /fs/stat and every /fs/list entry
172
+ * answer in the cloud sandbox. Never follows symlinks; `target` is the fully resolved target.
173
+ */
169
174
  declare const FsEntry: z.ZodObject<{
170
175
  name: z.ZodString;
171
176
  path: z.ZodString;
@@ -176,10 +181,8 @@ declare const FsEntry: z.ZodObject<{
176
181
  }>;
177
182
  size: z.ZodInt;
178
183
  mtime: z.ZodNumber;
179
- mtime_ms: z.ZodInt;
180
184
  mode: z.ZodInt;
181
185
  target: z.ZodNullable<z.ZodString>;
182
- hidden: z.ZodBoolean;
183
186
  }, z.core.$strict>;
184
187
  type FsEntry = z.output<typeof FsEntry>;
185
188
  declare const FsListParams: z.ZodObject<{
@@ -209,10 +212,8 @@ declare const FsListResult: z.ZodObject<{
209
212
  }>;
210
213
  size: z.ZodInt;
211
214
  mtime: z.ZodNumber;
212
- mtime_ms: z.ZodInt;
213
215
  mode: z.ZodInt;
214
216
  target: z.ZodNullable<z.ZodString>;
215
- hidden: z.ZodBoolean;
216
217
  }, z.core.$strict>>;
217
218
  truncated: z.ZodBoolean;
218
219
  next_page_token: z.ZodNullable<z.ZodString>;
@@ -233,10 +234,8 @@ declare const FsStatResult: z.ZodObject<{
233
234
  }>;
234
235
  size: z.ZodInt;
235
236
  mtime: z.ZodNumber;
236
- mtime_ms: z.ZodInt;
237
237
  mode: z.ZodInt;
238
238
  target: z.ZodNullable<z.ZodString>;
239
- hidden: z.ZodBoolean;
240
239
  }, z.core.$strict>;
241
240
  type FsStatResult = z.output<typeof FsStatResult>;
242
241
  declare const FsEncoding: z.ZodEnum<{
@@ -382,9 +381,12 @@ declare const FsSearchPathsParams: z.ZodObject<{
382
381
  max_results: z.ZodDefault<z.ZodInt>;
383
382
  }, z.core.$strict>;
384
383
  type FsSearchPathsParams = z.output<typeof FsSearchPathsParams>;
384
+ /**
385
+ * = the daemon's /search/paths answer (fd 8.3.1 in the sandbox image): paths RELATIVE to `cwd`, each
386
+ * prefixed "./", sorted, cut to max_results. No truncation flag (the daemon has none).
387
+ */
385
388
  declare const FsSearchPathsResult: z.ZodObject<{
386
389
  paths: z.ZodArray<z.ZodString>;
387
- truncated: z.ZodBoolean;
388
390
  }, z.core.$strict>;
389
391
  type FsSearchPathsResult = z.output<typeof FsSearchPathsResult>;
390
392
  /** = daemon SearchContentRequest (/search/content). */
@@ -398,18 +400,25 @@ declare const FsSearchContentParams: z.ZodObject<{
398
400
  max_results: z.ZodDefault<z.ZodInt>;
399
401
  }, z.core.$strict>;
400
402
  type FsSearchContentParams = z.output<typeof FsSearchContentParams>;
403
+ /**
404
+ * = the daemon's /search/content answer (ripgrep 13 --json run in `cwd`): `path` RELATIVE to `cwd`
405
+ * with no "./"; `lines` is the matching line with its newline; submatches are ripgrep's, byte
406
+ * offsets within the line. max_results is per FILE (rg -m), as the daemon passes it. No truncation
407
+ * flag (the daemon has none).
408
+ */
401
409
  declare const FsSearchContentResult: z.ZodObject<{
402
410
  results: z.ZodArray<z.ZodObject<{
403
411
  path: z.ZodString;
404
412
  lines: z.ZodString;
405
413
  line_number: z.ZodInt;
406
414
  submatches: z.ZodArray<z.ZodObject<{
407
- match: z.ZodString;
415
+ match: z.ZodObject<{
416
+ text: z.ZodString;
417
+ }, z.core.$strict>;
408
418
  start: z.ZodInt;
409
419
  end: z.ZodInt;
410
420
  }, z.core.$strict>>;
411
421
  }, z.core.$strict>>;
412
- truncated: z.ZodBoolean;
413
422
  }, z.core.$strict>;
414
423
  type FsSearchContentResult = z.output<typeof FsSearchContentResult>;
415
424
  declare const FsChange: z.ZodObject<{
@@ -975,4 +984,4 @@ declare const RelayCallEnvelope: z.ZodObject<{
975
984
  }, z.core.$strict>;
976
985
  type RelayCallEnvelope = z.output<typeof RelayCallEnvelope>;
977
986
 
978
- export { AbsPath, DEFAULT_MAX_FRAME_PAYLOAD_BYTES, DEFAULT_MAX_MESSAGE_BYTES, DEFAULT_WINDOW_BYTES, DeviceId, ExecCwdEvent, ExecExitedEvent, ExecListParams, ExecListResult, ExecPtyKillParams, ExecPtyKillResult, ExecPtyResizeParams, ExecPtyResizeResult, ExecPtySignalParams, ExecPtySignalResult, ExecPtyStartParams, ExecPtyStartResult, ExecPtyWriteParams, ExecPtyWriteResult, ExecRunParams, ExecRunResult, ExecTitleEvent, FrameHeader, FsChange, FsChangedEvent, FsDeleteParams, FsDeleteResult, FsEncoding, FsEntry, FsKind, FsListParams, FsListResult, FsMkdirParams, FsMkdirResult, FsMoveParams, FsMoveResult, FsPatchParams, FsPatchResult, FsReadParams, FsReadResult, FsReadStreamParams, FsReadStreamResult, FsSearchContentParams, FsSearchContentResult, FsSearchPathsParams, FsSearchPathsResult, FsStatParams, FsStatResult, FsWatchParams, FsWatchResult, FsWriteParams, FsWriteResult, OsPermissionName, PROTOCOL_MAJOR, PROTOCOL_MINOR, ProtocolVersion, PtyInfo, RELAY_CALL_HELLO_ID, RELAY_CALL_REQUEST_ID, RelayAuthExpiringEvent, RelayCallEnvelope, RelayCallHello, RelayCallRequest, RelayCallResponse, RelayDeviceStatusEvent, RelayHopConnectionEnd, RelayHopEnvelopeHeader, RelayStatusResponse, RequestId, ResourceId, ResourceInfo, SessionAttachParams, SessionAttachResult, SessionControlChangedEvent, SessionDetachParams, SessionDetachResult, SessionListParams, SessionListResult, SessionReleaseParams, SessionReleaseResult, Signal, SysinfoGetParams, SysinfoGetResult, epochMs, nonNegInt, u32 };
987
+ export { AbsPath, DEFAULT_MAX_FRAME_PAYLOAD_BYTES, DEFAULT_MAX_MESSAGE_BYTES, DEFAULT_WINDOW_BYTES, DeviceId, ExecCwdEvent, ExecExitedEvent, ExecListParams, ExecListResult, ExecPtyKillParams, ExecPtyKillResult, ExecPtyResizeParams, ExecPtyResizeResult, ExecPtySignalParams, ExecPtySignalResult, ExecPtyStartParams, ExecPtyStartResult, ExecPtyWriteParams, ExecPtyWriteResult, ExecRunParams, ExecRunResult, ExecTitleEvent, FrameHeader, FsChange, FsChangedEvent, FsDeleteParams, FsDeleteResult, FsEncoding, FsEntry, FsKind, FsListParams, FsListResult, FsMkdirParams, FsMkdirResult, FsMoveParams, FsMoveResult, FsPatchParams, FsPatchResult, FsReadParams, FsReadResult, FsReadStreamParams, FsReadStreamResult, FsSearchContentParams, FsSearchContentResult, FsSearchPathsParams, FsSearchPathsResult, FsStatParams, FsStatResult, FsWatchParams, FsWatchResult, FsWriteParams, FsWriteResult, OsPermissionName, PROTOCOL_MAJOR, PROTOCOL_MINOR, PROTOCOL_VERSION, ProtocolVersion, PtyInfo, RELAY_CALL_HELLO_ID, RELAY_CALL_REQUEST_ID, RelayAuthExpiringEvent, RelayCallEnvelope, RelayCallHello, RelayCallRequest, RelayCallResponse, RelayDeviceStatusEvent, RelayHopConnectionEnd, RelayHopEnvelopeHeader, RelayStatusResponse, RequestId, ResourceId, ResourceInfo, SessionAttachParams, SessionAttachResult, SessionControlChangedEvent, SessionDetachParams, SessionDetachResult, SessionListParams, SessionListResult, SessionReleaseParams, SessionReleaseResult, Signal, SysinfoGetParams, SysinfoGetResult, epochMs, nonNegInt, u32 };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { z } from 'zod';
2
- export { e as CancelMsg, f as ClientToCoreMsg, C as ClientType, g as CloseCode, h as CloseCodeValue, j as CoreToClientMsg, k as CreditMsg, D as DesktopProtocolError, d as EVENTS, l as EndMsg, E as EndReason, m as ErrorCode, n as ErrorCodeName, o as ErrorData, p as ErrorMsg, q as ErrorReason, r as ErrorReasonName, s as EventMsg, t as EventName, H as HelloMsg, L as Limits, N as NAMED_SCHEMAS, u as NamedSchemaId, c as OPS, v as OpDescriptor, O as OpName, a as OpParams, b as OpResult, w as OpSpec, P as PING_TEXT, x as PONG_TEXT, y as ProtocolErrorBody, R as RelayMsg, z as RequestMsg, A as ResponseMsg, S as StreamMeta, B as StreamMsg, W as Welcome, i as isDesktopProtocolError } from './registry-DJbrsZ4u.js';
2
+ export { B as BEARER_PREFIX, e as CancelMsg, f as ClientToCoreMsg, C as ClientType, g as CloseCode, h as CloseCodeValue, j as CoreToClientMsg, k as CreditMsg, D as DesktopProtocolError, d as EVENTS, l as EndMsg, E as EndReason, m as ErrorCode, n as ErrorCodeName, o as ErrorData, p as ErrorMsg, q as ErrorReason, r as ErrorReasonName, s as EventMsg, t as EventName, H as HelloMsg, L as Limits, N as NAMED_SCHEMAS, u as NamedSchemaId, c as OPS, v as OpDescriptor, O as OpName, a as OpParams, b as OpResult, w as OpSpec, P as PING_TEXT, x as PONG_TEXT, y as ProtocolErrorBody, R as RelayMsg, z as RequestMsg, A as ResponseMsg, F as SUBPROTOCOL, S as StreamMeta, G as StreamMsg, W as Welcome, i as isDesktopProtocolError } from './registry-DQ5_mP_5.js';
3
3
  export { BROADCAST_CID, DecodedFrame, FRAME_HEADER_BYTES, FRAME_STRUCT_FORMAT, FRAME_VERSION, FrameChannel, FrameChannelValue, FrameFlag, assertFrameHeader, connectionEndFrame, decodeFrame, encodeFrame, hasFlag, isConnectionEnd, readCid, stampCid } from './frame.js';
4
4
 
5
5
  /** @ai-matrx/desktop-protocol — version and primitive schemas. Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */
6
6
 
7
7
  declare const PROTOCOL_MAJOR: 1;
8
8
  declare const PROTOCOL_MINOR: 0;
9
+ /** This package's version as the wire spells it ("major.minor"): hello, welcome, relay status. */
10
+ declare const PROTOCOL_VERSION: "1.0";
9
11
  /** Internal building blocks — deliberately unnamed in $defs (inlined wherever used). */
10
12
  declare const u32: z.ZodInt;
11
13
  declare const nonNegInt: z.ZodInt;
@@ -165,7 +167,10 @@ declare const FsKind: z.ZodEnum<{
165
167
  symlink: "symlink";
166
168
  }>;
167
169
  type FsKind = z.output<typeof FsKind>;
168
- /** = daemon get_stat_dict(), plus mtime in ms and hidden. */
170
+ /**
171
+ * = daemon get_stat_dict(), field for field (SPEC 6.1): what /fs/stat and every /fs/list entry
172
+ * answer in the cloud sandbox. Never follows symlinks; `target` is the fully resolved target.
173
+ */
169
174
  declare const FsEntry: z.ZodObject<{
170
175
  name: z.ZodString;
171
176
  path: z.ZodString;
@@ -176,10 +181,8 @@ declare const FsEntry: z.ZodObject<{
176
181
  }>;
177
182
  size: z.ZodInt;
178
183
  mtime: z.ZodNumber;
179
- mtime_ms: z.ZodInt;
180
184
  mode: z.ZodInt;
181
185
  target: z.ZodNullable<z.ZodString>;
182
- hidden: z.ZodBoolean;
183
186
  }, z.core.$strict>;
184
187
  type FsEntry = z.output<typeof FsEntry>;
185
188
  declare const FsListParams: z.ZodObject<{
@@ -209,10 +212,8 @@ declare const FsListResult: z.ZodObject<{
209
212
  }>;
210
213
  size: z.ZodInt;
211
214
  mtime: z.ZodNumber;
212
- mtime_ms: z.ZodInt;
213
215
  mode: z.ZodInt;
214
216
  target: z.ZodNullable<z.ZodString>;
215
- hidden: z.ZodBoolean;
216
217
  }, z.core.$strict>>;
217
218
  truncated: z.ZodBoolean;
218
219
  next_page_token: z.ZodNullable<z.ZodString>;
@@ -233,10 +234,8 @@ declare const FsStatResult: z.ZodObject<{
233
234
  }>;
234
235
  size: z.ZodInt;
235
236
  mtime: z.ZodNumber;
236
- mtime_ms: z.ZodInt;
237
237
  mode: z.ZodInt;
238
238
  target: z.ZodNullable<z.ZodString>;
239
- hidden: z.ZodBoolean;
240
239
  }, z.core.$strict>;
241
240
  type FsStatResult = z.output<typeof FsStatResult>;
242
241
  declare const FsEncoding: z.ZodEnum<{
@@ -382,9 +381,12 @@ declare const FsSearchPathsParams: z.ZodObject<{
382
381
  max_results: z.ZodDefault<z.ZodInt>;
383
382
  }, z.core.$strict>;
384
383
  type FsSearchPathsParams = z.output<typeof FsSearchPathsParams>;
384
+ /**
385
+ * = the daemon's /search/paths answer (fd 8.3.1 in the sandbox image): paths RELATIVE to `cwd`, each
386
+ * prefixed "./", sorted, cut to max_results. No truncation flag (the daemon has none).
387
+ */
385
388
  declare const FsSearchPathsResult: z.ZodObject<{
386
389
  paths: z.ZodArray<z.ZodString>;
387
- truncated: z.ZodBoolean;
388
390
  }, z.core.$strict>;
389
391
  type FsSearchPathsResult = z.output<typeof FsSearchPathsResult>;
390
392
  /** = daemon SearchContentRequest (/search/content). */
@@ -398,18 +400,25 @@ declare const FsSearchContentParams: z.ZodObject<{
398
400
  max_results: z.ZodDefault<z.ZodInt>;
399
401
  }, z.core.$strict>;
400
402
  type FsSearchContentParams = z.output<typeof FsSearchContentParams>;
403
+ /**
404
+ * = the daemon's /search/content answer (ripgrep 13 --json run in `cwd`): `path` RELATIVE to `cwd`
405
+ * with no "./"; `lines` is the matching line with its newline; submatches are ripgrep's, byte
406
+ * offsets within the line. max_results is per FILE (rg -m), as the daemon passes it. No truncation
407
+ * flag (the daemon has none).
408
+ */
401
409
  declare const FsSearchContentResult: z.ZodObject<{
402
410
  results: z.ZodArray<z.ZodObject<{
403
411
  path: z.ZodString;
404
412
  lines: z.ZodString;
405
413
  line_number: z.ZodInt;
406
414
  submatches: z.ZodArray<z.ZodObject<{
407
- match: z.ZodString;
415
+ match: z.ZodObject<{
416
+ text: z.ZodString;
417
+ }, z.core.$strict>;
408
418
  start: z.ZodInt;
409
419
  end: z.ZodInt;
410
420
  }, z.core.$strict>>;
411
421
  }, z.core.$strict>>;
412
- truncated: z.ZodBoolean;
413
422
  }, z.core.$strict>;
414
423
  type FsSearchContentResult = z.output<typeof FsSearchContentResult>;
415
424
  declare const FsChange: z.ZodObject<{
@@ -975,4 +984,4 @@ declare const RelayCallEnvelope: z.ZodObject<{
975
984
  }, z.core.$strict>;
976
985
  type RelayCallEnvelope = z.output<typeof RelayCallEnvelope>;
977
986
 
978
- export { AbsPath, DEFAULT_MAX_FRAME_PAYLOAD_BYTES, DEFAULT_MAX_MESSAGE_BYTES, DEFAULT_WINDOW_BYTES, DeviceId, ExecCwdEvent, ExecExitedEvent, ExecListParams, ExecListResult, ExecPtyKillParams, ExecPtyKillResult, ExecPtyResizeParams, ExecPtyResizeResult, ExecPtySignalParams, ExecPtySignalResult, ExecPtyStartParams, ExecPtyStartResult, ExecPtyWriteParams, ExecPtyWriteResult, ExecRunParams, ExecRunResult, ExecTitleEvent, FrameHeader, FsChange, FsChangedEvent, FsDeleteParams, FsDeleteResult, FsEncoding, FsEntry, FsKind, FsListParams, FsListResult, FsMkdirParams, FsMkdirResult, FsMoveParams, FsMoveResult, FsPatchParams, FsPatchResult, FsReadParams, FsReadResult, FsReadStreamParams, FsReadStreamResult, FsSearchContentParams, FsSearchContentResult, FsSearchPathsParams, FsSearchPathsResult, FsStatParams, FsStatResult, FsWatchParams, FsWatchResult, FsWriteParams, FsWriteResult, OsPermissionName, PROTOCOL_MAJOR, PROTOCOL_MINOR, ProtocolVersion, PtyInfo, RELAY_CALL_HELLO_ID, RELAY_CALL_REQUEST_ID, RelayAuthExpiringEvent, RelayCallEnvelope, RelayCallHello, RelayCallRequest, RelayCallResponse, RelayDeviceStatusEvent, RelayHopConnectionEnd, RelayHopEnvelopeHeader, RelayStatusResponse, RequestId, ResourceId, ResourceInfo, SessionAttachParams, SessionAttachResult, SessionControlChangedEvent, SessionDetachParams, SessionDetachResult, SessionListParams, SessionListResult, SessionReleaseParams, SessionReleaseResult, Signal, SysinfoGetParams, SysinfoGetResult, epochMs, nonNegInt, u32 };
987
+ export { AbsPath, DEFAULT_MAX_FRAME_PAYLOAD_BYTES, DEFAULT_MAX_MESSAGE_BYTES, DEFAULT_WINDOW_BYTES, DeviceId, ExecCwdEvent, ExecExitedEvent, ExecListParams, ExecListResult, ExecPtyKillParams, ExecPtyKillResult, ExecPtyResizeParams, ExecPtyResizeResult, ExecPtySignalParams, ExecPtySignalResult, ExecPtyStartParams, ExecPtyStartResult, ExecPtyWriteParams, ExecPtyWriteResult, ExecRunParams, ExecRunResult, ExecTitleEvent, FrameHeader, FsChange, FsChangedEvent, FsDeleteParams, FsDeleteResult, FsEncoding, FsEntry, FsKind, FsListParams, FsListResult, FsMkdirParams, FsMkdirResult, FsMoveParams, FsMoveResult, FsPatchParams, FsPatchResult, FsReadParams, FsReadResult, FsReadStreamParams, FsReadStreamResult, FsSearchContentParams, FsSearchContentResult, FsSearchPathsParams, FsSearchPathsResult, FsStatParams, FsStatResult, FsWatchParams, FsWatchResult, FsWriteParams, FsWriteResult, OsPermissionName, PROTOCOL_MAJOR, PROTOCOL_MINOR, PROTOCOL_VERSION, ProtocolVersion, PtyInfo, RELAY_CALL_HELLO_ID, RELAY_CALL_REQUEST_ID, RelayAuthExpiringEvent, RelayCallEnvelope, RelayCallHello, RelayCallRequest, RelayCallResponse, RelayDeviceStatusEvent, RelayHopConnectionEnd, RelayHopEnvelopeHeader, RelayStatusResponse, RequestId, ResourceId, ResourceInfo, SessionAttachParams, SessionAttachResult, SessionControlChangedEvent, SessionDetachParams, SessionDetachResult, SessionListParams, SessionListResult, SessionReleaseParams, SessionReleaseResult, Signal, SysinfoGetParams, SysinfoGetResult, epochMs, nonNegInt, u32 };
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { z } from "zod";
3
3
  var PROTOCOL_MAJOR = 1;
4
4
  var PROTOCOL_MINOR = 0;
5
+ var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
5
6
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
6
7
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
7
8
  var ResourceId = z.string().regex(/^(pty|watch)_[A-Za-z0-9]{16,40}$/);
@@ -298,6 +299,8 @@ var RelayMsg = z4.discriminatedUnion("op", [
298
299
  ]);
299
300
  var PING_TEXT = '{"type":"ping"}';
300
301
  var PONG_TEXT = '{"type":"pong"}';
302
+ var SUBPROTOCOL = "matrx.v1";
303
+ var BEARER_PREFIX = "bearer.";
301
304
  var ClientToCoreMsg = z4.discriminatedUnion("type", [HelloMsg, RequestMsg, CancelMsg, CreditMsg]);
302
305
  var CoreToClientMsg = z4.discriminatedUnion("type", [ResponseMsg, ErrorMsg, StreamMsg, EndMsg, CreditMsg, EventMsg]);
303
306
  var CloseCode = {
@@ -386,12 +389,9 @@ var FsEntry = z6.strictObject({
386
389
  kind: FsKind,
387
390
  size: nonNegInt,
388
391
  mtime: z6.number().min(0),
389
- // seconds, float — daemon parity
390
- mtime_ms: epochMs,
392
+ // seconds, float
391
393
  mode: z6.int().min(0).max(4095),
392
- target: AbsPath.nullable(),
393
- // symlink target, never followed
394
- hidden: z6.boolean()
394
+ target: AbsPath.nullable()
395
395
  });
396
396
  var FsListParams = z6.strictObject({
397
397
  path: AbsPath,
@@ -399,10 +399,12 @@ var FsListParams = z6.strictObject({
399
399
  depth: z6.int().min(1).max(32).default(1),
400
400
  pattern: z6.string().max(256).optional(),
401
401
  // glob on name
402
- limit: z6.int().min(1).max(5e3).default(500),
402
+ limit: z6.int().min(1).max(5e3).default(1e3),
403
403
  page_token: z6.string().max(256).optional(),
404
- show_hidden: z6.boolean().default(false),
405
- sort: z6.enum(["name", "mtime", "size", "kind"]).default("kind")
404
+ // Desktop additions; their defaults ARE the daemon's behaviour: dotfiles listed, siblings in
405
+ // binary (byte) order of name, depth-first.
406
+ show_hidden: z6.boolean().default(true),
407
+ sort: z6.enum(["name", "mtime", "size", "kind"]).default("name")
406
408
  });
407
409
  var FsListResult = z6.strictObject({
408
410
  entries: z6.array(FsEntry),
@@ -486,7 +488,7 @@ var FsSearchPathsParams = z6.strictObject({
486
488
  hidden: z6.boolean().default(false),
487
489
  max_results: z6.int().min(1).max(5e3).default(100)
488
490
  });
489
- var FsSearchPathsResult = z6.strictObject({ paths: z6.array(AbsPath), truncated: z6.boolean() });
491
+ var FsSearchPathsResult = z6.strictObject({ paths: z6.array(z6.string().min(3).max(4096).regex(/^\.\/[^\\\u0000]+$/)) });
490
492
  var FsSearchContentParams = z6.strictObject({
491
493
  query: z6.string().min(1).max(1024),
492
494
  cwd: AbsPath,
@@ -499,13 +501,14 @@ var FsSearchContentParams = z6.strictObject({
499
501
  var FsSearchContentResult = z6.strictObject({
500
502
  results: z6.array(
501
503
  z6.strictObject({
502
- path: AbsPath,
504
+ path: z6.string().min(1).max(4096).regex(/^[^/\\\u0000][^\\\u0000]*$/),
503
505
  lines: z6.string(),
504
506
  line_number: z6.int().min(1),
505
- submatches: z6.array(z6.strictObject({ match: z6.string(), start: nonNegInt, end: nonNegInt }))
507
+ submatches: z6.array(
508
+ z6.strictObject({ match: z6.strictObject({ text: z6.string() }), start: nonNegInt, end: nonNegInt })
509
+ )
506
510
  })
507
- ),
508
- truncated: z6.boolean()
511
+ )
509
512
  });
510
513
  var FsChange = z6.strictObject({
511
514
  type: z6.enum(["created", "modified", "deleted", "moved"]),
@@ -785,6 +788,7 @@ var NAMED_SCHEMAS = {
785
788
  };
786
789
  export {
787
790
  AbsPath,
791
+ BEARER_PREFIX,
788
792
  BROADCAST_CID,
789
793
  CancelMsg,
790
794
  ClientToCoreMsg,
@@ -867,6 +871,7 @@ export {
867
871
  PONG_TEXT,
868
872
  PROTOCOL_MAJOR,
869
873
  PROTOCOL_MINOR,
874
+ PROTOCOL_VERSION,
870
875
  ProtocolErrorBody,
871
876
  ProtocolVersion,
872
877
  PtyInfo,
@@ -887,6 +892,7 @@ export {
887
892
  ResourceId,
888
893
  ResourceInfo,
889
894
  ResponseMsg,
895
+ SUBPROTOCOL,
890
896
  SessionAttachParams,
891
897
  SessionAttachResult,
892
898
  SessionControlChangedEvent,