mise API - v0.0.0
    Preparing search index...

    Function clientMessage_parse

    • Validates a message a surface sent to the daemon.

      Parameters

      • raw: unknown

        The untrusted input (already JSON-parsed).

      Returns ParseResult<
          | {
              capabilities?: {
                  claims?: { subject: string; verbs?: string[] }[];
                  color?: boolean;
                  fileDelivery?: boolean;
                  hiddenInput?: boolean;
                  localFilesystem?: boolean;
                  shellCommands: boolean;
                  terminal?: string;
              };
              protocolVersion: number;
              session?: string;
              token: string;
              type: "attach";
          }
          | {
              id: string;
              instrument?: boolean;
              line: string;
              mirrored?: boolean;
              type: "execute";
          }
          | { id: string; type: "cancel" }
          | { type: "stop" }
          | { password: string; type: "elevate" }
          | { id: string; prefix: string; type: "complete" }
          | { answer: string; promptId: string; type: "promptAnswer" }
          | { promptId: string; reason: string; type: "promptError" }
          | { output: string; pipeId: string; type: "pipeResult" }
          | { pipeId: string; reason: string; type: "pipeError" }
          | { exitCode: number; shellId: string; type: "shellResult" }
          | { reason: string; shellId: string; type: "shellError" }
          | {
              changed: boolean;
              content: string;
              editId: string;
              opened?: boolean;
              type: "editResult";
          }
          | { editId: string; reason: string; type: "editError" }
          | {
              bytes: number;
              deliverId: string;
              location: string;
              type: "deliverResult";
          }
          | { deliverId: string; reason: string; type: "deliverError" }
          | {
              regard: {
                  address: string;
                  groupId: string;
                  modelKind?: string;
                  paneId: string;
              };
              type: "regard";
          }
          | { subject: string; type: "watch" }
          | { subject: string; type: "unwatch" }
          | { cols: number; rows: number; terminalId?: string; type: "terminalOpen" }
          | { data: string; terminalId: string; type: "terminalInput" }
          | {
              cols: number;
              rows: number;
              terminalId: string;
              type: "terminalResize";
          }
          | { terminalId: string; type: "terminalClose" }
          | {
              lineId: string;
              rendered: string;
              status: "error" | "ok";
              type: "surfaceLineResult";
          }
          | { lineId: string; reason: string; type: "surfaceLineError" }
          | { text: string; type: "note" }
          | {
              claims: { subject: string; verbs?: string[] }[];
              type: "surfaceClaims";
          },
      >

      The parse result.