@ai-matrx/desktop-protocol 0.17.0 → 0.17.2

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,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { O as OpName } from './models-Dj_B9wHj.cjs';
3
- export { B as BEARER_PREFIX, g as CLOSE_RULES, h as CancelMsg, j as ClientToCoreMsg, e as ClientType, k as CloseAction, l as CloseCode, m as CloseCodeValue, C as CloseOutcome, n as CloseRule, o as CoreToClientMsg, p as CreditMsg, D as DesktopProtocolError, d as EVENTS, q as EndMsg, E as EndReason, r as ErrorCode, s as ErrorCodeName, t as ErrorData, u as ErrorMsg, v as ErrorReason, w as ErrorReasonName, x as EventMsg, y as EventName, F as FsPatchEditFailure, H as HelloMsg, L as Limits, z as MlInstallPhase, A as MlInstallProgress, f as MlProgress, G as MlRuntimeState, I as MlServiceState, J as MlServiceStatus, K as MlStatusParams, N as MlStatusResult, P as ModelsInstallParams, Q as ModelsInstallResult, R as ModelsProgressEvent, U as ModelsStatusParams, V as ModelsStatusResult, X as ModelsTranscribeParams, M as ModelsTranscribeResult, Y as NAMED_SCHEMAS, Z as NamedSchemaId, c as OPS, _ as OpDescriptor, a as OpParams, b as OpResult, $ as OpSpec, a0 as PING_TEXT, a1 as PONG_TEXT, a2 as ProtocolErrorBody, a3 as RelayMsg, a4 as RequestMsg, a5 as ResponseMsg, a6 as SERVICES, a7 as SUBPROTOCOL, a8 as ServiceId, a9 as ServiceOpName, aa as ServiceOpSpec, ab as ServiceSpec, S as StreamMeta, ac as StreamMsg, ad as TranscriptSegment, T as TranscriptionModelId, ae as TranscriptionModelInfo, W as Welcome, af as closeRule, i as isDesktopProtocolError, ag as isTerminalClose } from './models-Dj_B9wHj.cjs';
2
+ import { O as OpName } from './models-QWCUcQuU.cjs';
3
+ export { B as BEARER_PREFIX, g as CLOSE_RULES, h as CancelMsg, j as ClientToCoreMsg, e as ClientType, k as CloseAction, l as CloseCode, m as CloseCodeValue, C as CloseOutcome, n as CloseRule, o as CoreToClientMsg, p as CreditMsg, D as DesktopProtocolError, d as EVENTS, q as EndMsg, E as EndReason, r as ErrorCode, s as ErrorCodeName, t as ErrorData, u as ErrorMsg, v as ErrorReason, w as ErrorReasonName, x as EventMsg, y as EventName, F as FsPatchEditFailure, H as HelloMsg, L as Limits, z as MlInstallPhase, A as MlInstallProgress, f as MlProgress, G as MlRuntimeState, I as MlServiceState, J as MlServiceStatus, K as MlStatusParams, N as MlStatusResult, P as ModelsInstallParams, Q as ModelsInstallResult, R as ModelsProgressEvent, U as ModelsStatusParams, V as ModelsStatusResult, X as ModelsTranscribeParams, M as ModelsTranscribeResult, Y as NAMED_SCHEMAS, Z as NamedSchemaId, c as OPS, _ as OpDescriptor, a as OpParams, b as OpResult, $ as OpSpec, a0 as PING_TEXT, a1 as PONG_TEXT, a2 as ProtocolErrorBody, a3 as RelayMsg, a4 as RequestMsg, a5 as ResponseMsg, a6 as SERVICES, a7 as SUBPROTOCOL, a8 as ServiceId, a9 as ServiceOpName, aa as ServiceOpSpec, ab as ServiceSpec, S as StreamMeta, ac as StreamMsg, ad as TranscriptSegment, T as TranscriptionModelId, ae as TranscriptionModelInfo, W as Welcome, af as closeRule, i as isDesktopProtocolError, ag as isTerminalClose } from './models-QWCUcQuU.cjs';
4
4
  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';
5
5
 
6
6
  /** @ai-matrx/desktop-protocol — version and primitive schemas. Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */
@@ -209,8 +209,8 @@ declare const FsListParams: z.ZodObject<{
209
209
  page_token: z.ZodOptional<z.ZodString>;
210
210
  show_hidden: z.ZodDefault<z.ZodBoolean>;
211
211
  sort: z.ZodDefault<z.ZodEnum<{
212
- kind: "kind";
213
212
  name: "name";
213
+ kind: "kind";
214
214
  size: "size";
215
215
  mtime: "mtime";
216
216
  }>>;
@@ -2807,11 +2807,6 @@ declare function builtOps(): OpName[];
2807
2807
 
2808
2808
  declare const TOOL_LEVELS: readonly ToolLevel[];
2809
2809
  declare const TOOL_PLATFORMS: readonly ToolPlatform[];
2810
- /**
2811
- * `pass`: every required proof passed and none failed. `partial`: passes so far, a required proof
2812
- * missing (`missing` says which). `fail`: the latest run of some proof failed. `untested`: nothing
2813
- * ran. `not_built`: the tool is planned. `unsupported`: the tool does not exist on this platform.
2814
- */
2815
2810
  type CellState = "pass" | "partial" | "fail" | "untested" | "not_built" | "unsupported";
2816
2811
  interface StatusEvidence {
2817
2812
  readonly suite: string;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { O as OpName } from './models-Dj_B9wHj.js';
3
- export { B as BEARER_PREFIX, g as CLOSE_RULES, h as CancelMsg, j as ClientToCoreMsg, e as ClientType, k as CloseAction, l as CloseCode, m as CloseCodeValue, C as CloseOutcome, n as CloseRule, o as CoreToClientMsg, p as CreditMsg, D as DesktopProtocolError, d as EVENTS, q as EndMsg, E as EndReason, r as ErrorCode, s as ErrorCodeName, t as ErrorData, u as ErrorMsg, v as ErrorReason, w as ErrorReasonName, x as EventMsg, y as EventName, F as FsPatchEditFailure, H as HelloMsg, L as Limits, z as MlInstallPhase, A as MlInstallProgress, f as MlProgress, G as MlRuntimeState, I as MlServiceState, J as MlServiceStatus, K as MlStatusParams, N as MlStatusResult, P as ModelsInstallParams, Q as ModelsInstallResult, R as ModelsProgressEvent, U as ModelsStatusParams, V as ModelsStatusResult, X as ModelsTranscribeParams, M as ModelsTranscribeResult, Y as NAMED_SCHEMAS, Z as NamedSchemaId, c as OPS, _ as OpDescriptor, a as OpParams, b as OpResult, $ as OpSpec, a0 as PING_TEXT, a1 as PONG_TEXT, a2 as ProtocolErrorBody, a3 as RelayMsg, a4 as RequestMsg, a5 as ResponseMsg, a6 as SERVICES, a7 as SUBPROTOCOL, a8 as ServiceId, a9 as ServiceOpName, aa as ServiceOpSpec, ab as ServiceSpec, S as StreamMeta, ac as StreamMsg, ad as TranscriptSegment, T as TranscriptionModelId, ae as TranscriptionModelInfo, W as Welcome, af as closeRule, i as isDesktopProtocolError, ag as isTerminalClose } from './models-Dj_B9wHj.js';
2
+ import { O as OpName } from './models-QWCUcQuU.js';
3
+ export { B as BEARER_PREFIX, g as CLOSE_RULES, h as CancelMsg, j as ClientToCoreMsg, e as ClientType, k as CloseAction, l as CloseCode, m as CloseCodeValue, C as CloseOutcome, n as CloseRule, o as CoreToClientMsg, p as CreditMsg, D as DesktopProtocolError, d as EVENTS, q as EndMsg, E as EndReason, r as ErrorCode, s as ErrorCodeName, t as ErrorData, u as ErrorMsg, v as ErrorReason, w as ErrorReasonName, x as EventMsg, y as EventName, F as FsPatchEditFailure, H as HelloMsg, L as Limits, z as MlInstallPhase, A as MlInstallProgress, f as MlProgress, G as MlRuntimeState, I as MlServiceState, J as MlServiceStatus, K as MlStatusParams, N as MlStatusResult, P as ModelsInstallParams, Q as ModelsInstallResult, R as ModelsProgressEvent, U as ModelsStatusParams, V as ModelsStatusResult, X as ModelsTranscribeParams, M as ModelsTranscribeResult, Y as NAMED_SCHEMAS, Z as NamedSchemaId, c as OPS, _ as OpDescriptor, a as OpParams, b as OpResult, $ as OpSpec, a0 as PING_TEXT, a1 as PONG_TEXT, a2 as ProtocolErrorBody, a3 as RelayMsg, a4 as RequestMsg, a5 as ResponseMsg, a6 as SERVICES, a7 as SUBPROTOCOL, a8 as ServiceId, a9 as ServiceOpName, aa as ServiceOpSpec, ab as ServiceSpec, S as StreamMeta, ac as StreamMsg, ad as TranscriptSegment, T as TranscriptionModelId, ae as TranscriptionModelInfo, W as Welcome, af as closeRule, i as isDesktopProtocolError, ag as isTerminalClose } from './models-QWCUcQuU.js';
4
4
  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';
5
5
 
6
6
  /** @ai-matrx/desktop-protocol — version and primitive schemas. Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */
@@ -209,8 +209,8 @@ declare const FsListParams: z.ZodObject<{
209
209
  page_token: z.ZodOptional<z.ZodString>;
210
210
  show_hidden: z.ZodDefault<z.ZodBoolean>;
211
211
  sort: z.ZodDefault<z.ZodEnum<{
212
- kind: "kind";
213
212
  name: "name";
213
+ kind: "kind";
214
214
  size: "size";
215
215
  mtime: "mtime";
216
216
  }>>;
@@ -2807,11 +2807,6 @@ declare function builtOps(): OpName[];
2807
2807
 
2808
2808
  declare const TOOL_LEVELS: readonly ToolLevel[];
2809
2809
  declare const TOOL_PLATFORMS: readonly ToolPlatform[];
2810
- /**
2811
- * `pass`: every required proof passed and none failed. `partial`: passes so far, a required proof
2812
- * missing (`missing` says which). `fail`: the latest run of some proof failed. `untested`: nothing
2813
- * ran. `not_built`: the tool is planned. `unsupported`: the tool does not exist on this platform.
2814
- */
2815
2810
  type CellState = "pass" | "partial" | "fail" | "untested" | "not_built" | "unsupported";
2816
2811
  interface StatusEvidence {
2817
2812
  readonly suite: string;
package/dist/index.js CHANGED
@@ -106,7 +106,7 @@ var ProtocolErrorBody = z2.strictObject({
106
106
  import { z as z3 } from "zod";
107
107
 
108
108
  // src/error.ts
109
- var DesktopProtocolError = class extends Error {
109
+ var DesktopProtocolError = class _DesktopProtocolError extends Error {
110
110
  code;
111
111
  retryable;
112
112
  data;
@@ -117,6 +117,23 @@ var DesktopProtocolError = class extends Error {
117
117
  this.retryable = options.retryable ?? false;
118
118
  this.data = options.data;
119
119
  }
120
+ /**
121
+ * Any thrown value as a DesktopProtocolError, keeping its code, message and data. Each built entry
122
+ * (`.`, `./client`, `./react`) carries its own copy of this class, so `instanceof` alone misses an
123
+ * error thrown by a sibling entry and reports a real NOT_FOUND as INTERNAL; this checks the shape.
124
+ */
125
+ static from(caught) {
126
+ if (caught instanceof _DesktopProtocolError) return caught;
127
+ const e = caught;
128
+ if (e && typeof e === "object" && e.name === "DesktopProtocolError" && typeof e.code === "string") {
129
+ return new _DesktopProtocolError(e.code, typeof e.message === "string" ? e.message : String(e.code), {
130
+ retryable: e.retryable === true,
131
+ ...e.data && typeof e.data === "object" ? { data: e.data } : {},
132
+ cause: caught
133
+ });
134
+ }
135
+ return new _DesktopProtocolError("INTERNAL", caught instanceof Error ? caught.message : String(caught), { cause: caught });
136
+ }
120
137
  /** The wire body (ProtocolErrorBody) — what a core or relay sends for this error. */
121
138
  toBody() {
122
139
  return this.data === void 0 ? { code: this.code, message: this.message, retryable: this.retryable } : { code: this.code, message: this.message, retryable: this.retryable, data: this.data };
@@ -2109,6 +2126,7 @@ function builtOps() {
2109
2126
  // src/tools/status.ts
2110
2127
  var TOOL_LEVELS = ["programmatic", "protocol", "chat"];
2111
2128
  var TOOL_PLATFORMS = ["darwin", "win32", "linux"];
2129
+ var UUID_IN_NAME = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
2112
2130
  var REQUIRED = {
2113
2131
  programmatic: [{ label: "in process", ok: (e) => e.transport === "in_process" }],
2114
2132
  protocol: [
@@ -2122,7 +2140,7 @@ function cellFor(tool2, platform, level, evidence) {
2122
2140
  if (!tool2.platforms.includes(platform)) return { state: "unsupported", missing: [], last_run_at_ms: null, evidence: [] };
2123
2141
  const latest = /* @__PURE__ */ new Map();
2124
2142
  for (const e of evidence) {
2125
- const key = `${e.suite}\0${e.test}\0${e.transport}\0${e.remote_network}`;
2143
+ const key = `${e.suite}\0${e.test.replace(UUID_IN_NAME, "<id>")}\0${e.transport}\0${e.remote_network}`;
2126
2144
  const prev = latest.get(key);
2127
2145
  if (!prev || prev.run_at_ms < e.run_at_ms) latest.set(key, e);
2128
2146
  }