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

    Function serverMessage_parse

    • Validates a message the daemon sent to a surface.

      Parameters

      • raw: unknown

        The untrusted input (already JSON-parsed).

      Returns ParseResult<
          | {
              backend?: string;
              elevation?: boolean;
              hostControl?: string[];
              protocolVersion: number;
              session: string;
              stack?: {
                  brasa?: string;
                  build: string;
                  calypso: string;
                  chell: string;
                  chili?: string;
                  cumin?: string;
                  salsa?: string;
                  surface?: { built: string; git: string };
              };
              stale?: boolean;
              surface?: string;
              terminals?: boolean;
              type: "attached";
          }
          | { granted: boolean; reason?: string; type: "elevated" }
          | {
              envelopes: {
                  errors?: { message: string; type: "error" | "warning" }[];
                  model?: { data: unknown; kind: string };
                  rendered: string;
                  renderedErr?: string;
                  status: "error" | "ok";
                  trace?: {
                      executed?: string;
                      input: string;
                      proposed: string;
                      validated: boolean;
                  };
              }[];
              id: string;
              type: "result";
          }
          | { candidates: string[]; id: string; prefix: string; type: "complete" }
          | {
              channel: "status" | "data" | "err";
              chunk: string;
              id: string;
              type: "output";
          }
          | {
              current?: number;
              id: string;
              itemId?: string;
              kind?: "workflow"
              | "transfer"
              | "retrieve"
              | "inspection";
              label?: string;
              operation:
                  | "group"
                  | "upload"
                  | "download"
                  | "pull"
                  | "workflow"
                  | "pipeline"
                  | "task";
              path?: string;
              percent?: number;
              phase: | "failed"
              | "complete"
              | "scanning"
              | "transferring"
              | "watching"
              | "retrying"
              | "reading"
              | "working";
              reason?: string;
              status?: | "error"
              | "unknown"
              | "done"
              | "running"
              | "unconfirmed"
              | "stalled"
              | "timeout";
              total?: number;
              type: "progress";
              unit?: "bytes"
              | "jobs"
              | "nodes"
              | "series"
              | "files";
          }
          | { data: unknown; id: string; kind: string; type: "event" }
          | {
              envelope: {
                  errors?: { message: string; type: "error" | "warning" }[];
                  model?: { data: unknown; kind: string };
                  rendered: string;
                  renderedErr?: string;
                  status: "error" | "ok";
                  trace?: {
                      executed?: string;
                      input: string;
                      proposed: string;
                      validated: boolean;
                  };
              };
              surface: string;
              terminal?: string;
              type: "session";
          }
          | { id?: string; reason: string; type: "error" }
          | {
              commit?: string;
              hidden: boolean;
              message: string;
              path?: { anchor?: string; suggest?: string; wantsDirectory: boolean };
              promptId: string;
              type: "prompt";
              wants?: "text" | "path" | "secret" | "confirm";
          }
          | {
              context: {
                  cwd: string;
                  lastCommandDurationMs: number;
                  lastExitCode: number;
                  pacsserver: string
                  | null;
                  physicalMode: boolean;
                  procIndex?: { feeds: number; jobs: number };
                  procWarmup?: {
                      arrived?: number[];
                      feed?: { failed?: string; id: number; loaded: number; total: number };
                      feeds?: { failed?: string; id: number; loaded: number; total: number }[];
                      landed?: {
                          chain: string[];
                          groups: {
                              count: ...;
                              errored: ...;
                              parent: ...;
                              plugin: ...;
                              status: ...;
                          }[];
                          id: number;
                          jobs: number;
                          status: string;
                          title: string;
                      }[];
                      loaded: number;
                      restored?: boolean;
                      roster?: "delta"
                      | "full";
                      state?: "failed" | "cold" | "cached";
                      sweeping?: boolean;
                      total?: number;
                  };
                  questions?: number;
                  segments?: {
                      key: string;
                      label: string;
                      tone: | "path"
                      | "note"
                      | "leader"
                      | "place"
                      | "identity"
                      | "work"
                      | "alert";
                      value: string;
                  }[];
                  uri: string;
                  user: string;
                  warmupFailures?: { label: string; message: string }[];
              };
              type: "promptline";
          }
          | {
              cube?: { msPerPage: number; samples: number };
              index: { feeds: number; jobs: number };
              lane?: {
                  joblets?: { line: string; number: number; waiting: boolean }[];
                  questions?: { message: string; sinceMs: number; surface: string }[];
                  running: { line: string; sinceMs: number; surface: string } | null;
                  waiting: number;
              };
              state?: {
                  errored: number;
                  erroredFeeds: number;
                  running: number;
                  runningFeeds: number;
                  scheduled: number;
              };
              surfaces?: { id: string; kind: "chell"
              | "browser" }[];
              type: "telemetry";
          }
          | { command: string; input: string; pipeId: string; type: "pipe" }
          | { command: string; shellId: string; type: "shell" }
          | {
              content: string;
              editId: string;
              extension?: string;
              path?: string;
              type: "edit";
          }
          | {
              contentType?: string;
              deliverId: string;
              destination?: string;
              filename: string;
              path: string;
              size?: number;
              type: "deliver";
          }
          | {
              regard: {
                  address: string;
                  groupId: string;
                  modelKind?: string;
                  paneId: string;
              };
              type: "regard";
          }
          | { state: "live"
          | "settled"
          | "stale"; subject: string; type: "watched" }
          | { stale: boolean; type: "stale" }
          | { cause: "end" | "stop" | "restart"; type: "closing" }
          | {
              handles: { address: string; kind: string; ordinal: number }[];
              id: number;
              rows: number;
              source: string;
              type: "numbered";
          }
          | {
              refused?: string;
              replay: string;
              terminalId: string;
              type: "terminalOpened";
          }
          | { data: string; terminalId: string; type: "terminalData" }
          | { code: number; terminalId: string; type: "terminalExit" }
          | { line: string; lineId: string; terminal?: string; type: "surfaceLine" }
          | { text: string; type: "consoleNote" },
      >

      The parse result.