Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openclaw/src/gateway/server-methods/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 2 kB image not shown  

Quelle  restart-request.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import { normalizeOptionalString } from "../../shared/string-coerce.js";

type RestartDeliveryContext = {
  channel?: string;
  to?: string;
  accountId?: string;
};

function parseRestartDeliveryContext(params: unknown): {
  deliveryContext: RestartDeliveryContext | undefined;
  threadId: string | undefined;
} {
  const raw = (params as { deliveryContext?: unknown }).deliveryContext;
  if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
    return { deliveryContext: undefined, threadId: undefined };
  }
  const context = raw as {
    channel?: unknown;
    to?: unknown;
    accountId?: unknown;
    threadId?: unknown;
  };
  const deliveryContext: RestartDeliveryContext = {
    channel: normalizeOptionalString(context.channel),
    to: normalizeOptionalString(context.to),
    accountId: normalizeOptionalString(context.accountId),
  };
  const normalizedContext =
    deliveryContext.channel || deliveryContext.to || deliveryContext.accountId
      ? deliveryContext
      : undefined;
  const threadId =
    typeof context.threadId === "number" && Number.isFinite(context.threadId)
      ? String(Math.trunc(context.threadId))
      : normalizeOptionalString(context.threadId);
  return { deliveryContext: normalizedContext, threadId };
}

export function parseRestartRequestParams(params: unknown): {
  sessionKey: string | undefined;
  deliveryContext: RestartDeliveryContext | undefined;
  threadId: string | undefined;
  note: string | undefined;
  restartDelayMs: number | undefined;
} {
  const sessionKey = normalizeOptionalString((params as { sessionKey?: unknown }).sessionKey);
  const { deliveryContext, threadId } = parseRestartDeliveryContext(params);
  const note = normalizeOptionalString((params as { note?: unknown }).note);
  const restartDelayMsRaw = (params as { restartDelayMs?: unknown }).restartDelayMs;
  const restartDelayMs =
    typeof restartDelayMsRaw === "number" && Number.isFinite(restartDelayMsRaw)
      ? Math.max(0, Math.floor(restartDelayMsRaw))
      : undefined;
  return { sessionKey, deliveryContext, threadId, note, restartDelayMs };
}

¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.