docs: document session helpers

This commit is contained in:
Peter Steinberger
2026-06-04 20:22:09 -04:00
parent 47bae66415
commit 6d58ff3562
20 changed files with 20 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
// Session kind helpers classify cron, interactive, and channel-backed sessions.
import { isCronSessionKey } from "./session-key-utils.js";
export type SessionKind = "cron" | "direct" | "group" | "global" | "spawn-child" | "unknown";

View File

@@ -1,3 +1,4 @@
// Input provenance tests cover source metadata attached to session inputs.
import { describe, expect, it } from "vitest";
import {
annotateInterSessionPromptText,

View File

@@ -1,3 +1,4 @@
// Input provenance helpers normalize source metadata for session messages.
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
import type { AgentMessage } from "../agents/runtime/index.js";

View File

@@ -1,3 +1,4 @@
// Session level override helpers normalize per-session logging and behavior levels.
import {
normalizeTraceLevel,
normalizeVerboseLevel,

View File

@@ -1,3 +1,4 @@
// Session model override tests cover model override parsing and validation.
import { describe, expect, it } from "vitest";
import type { SessionEntry } from "../config/sessions.js";
import {

View File

@@ -1,3 +1,4 @@
// Session model override helpers normalize per-session provider model choices.
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
import type { SessionEntry } from "../config/sessions.js";

View File

@@ -1,3 +1,4 @@
// Session send policy tests cover message send eligibility decisions.
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import type { SessionEntry } from "../config/sessions.js";

View File

@@ -1,3 +1,4 @@
// Session send policy helpers decide when session output can be sent to targets.
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalLowercaseString,

View File

@@ -1,3 +1,4 @@
// Shared session chat type helpers expose cross-module chat type classification.
import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";
import { parseAgentSessionKey } from "./session-key-utils.js";

View File

@@ -1,3 +1,4 @@
// Session chat type helpers classify chat surfaces from session metadata.
import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";
import { getBootstrapChannelPlugin } from "../channels/plugins/bootstrap-registry.js";
import {

View File

@@ -1,3 +1,4 @@
// Session id resolution tests cover resolving aliases and explicit ids.
import { describe, expect, it } from "vitest";
import type { SessionEntry } from "../config/sessions/types.js";
import {

View File

@@ -1,3 +1,4 @@
// Session id resolution helpers resolve user-provided session references.
import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";
import type { SessionEntry } from "../config/sessions.js";
import { toAgentRequestSessionKey } from "../routing/session-key.js";

View File

@@ -1,3 +1,4 @@
// Session id tests cover session id parsing and generation helpers.
import { describe, expect, it } from "vitest";
import { SESSION_ID_RE, looksLikeSessionId } from "./session-id.js";

View File

@@ -1,3 +1,4 @@
// Session key case tests cover preserving meaningful case in session keys.
import { describe, expect, it } from "vitest";
import { resolveSessionStoreEntry } from "../config/sessions/store-entry.js";
import type { SessionEntry } from "../config/sessions/types.js";

View File

@@ -1,3 +1,4 @@
// Session key utilities normalize and classify persisted session keys.
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalLowercaseString,

View File

@@ -1,3 +1,4 @@
// Session lifecycle event tests cover lifecycle event ordering and serialization.
import { describe, expect, it } from "vitest";
import { emitSessionLifecycleEvent, onSessionLifecycleEvent } from "./session-lifecycle-events.js";

View File

@@ -1,3 +1,4 @@
// Transcript event tests cover transcript event parsing and compaction.
import { afterEach, describe, expect, it, vi } from "vitest";
import { emitSessionTranscriptUpdate, onSessionTranscriptUpdate } from "./transcript-events.js";

View File

@@ -1,3 +1,4 @@
// Transcript event helpers serialize and trim session transcript events.
import { asPositiveSafeInteger } from "@openclaw/normalization-core/number-coercion";
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";

View File

@@ -1,3 +1,4 @@
// User turn transcript tests cover transcript extraction for user turns.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// User turn transcript helpers extract user-turn text from session transcripts.
import path from "node:path";
import { mimeTypeFromFilePath } from "@openclaw/media-core/mime";
import type { AgentMessage } from "../agents/runtime/index.js";