Skip to content

Commit cc73ef8

Browse files
committed
docs: document channel plugin setup types
1 parent 67ddda2 commit cc73ef8

19 files changed

Lines changed: 94 additions & 33 deletions

src/channels/plugins/setup-wizard-helpers.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Channel setup wizard helper functions.
3+
*
4+
* Prompts account ids, credentials, allowlists, and account-scoped setup config updates.
5+
*/
16
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
27
import {
38
normalizeStringEntries,

src/channels/plugins/setup-wizard-proxy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Lazy setup wizard proxy helpers.
3+
*
4+
* Delegates setup wizard status, credential, allowlist, and finalization hooks to loaded wizards.
5+
*/
16
import type { OpenClawConfig } from "../../config/types.openclaw.js";
27
import { createDelegatedSetupWizardStatusResolvers } from "./setup-wizard-binary.js";
38
import type { ChannelSetupDmPolicy } from "./setup-wizard-types.js";

src/channels/plugins/setup-wizard-types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Declarative channel setup wizard contract.
3+
*
4+
* Defines status, credentials, prompts, group access, and finalization types for setup flows.
5+
*/
16
import type { DmPolicy } from "../../config/types.js";
27
import type { OpenClawConfig } from "../../config/types.openclaw.js";
38
import type { RuntimeEnv } from "../../runtime.js";
@@ -11,9 +16,6 @@ import type {
1116
ChannelSetupInput,
1217
} from "./types.core.js";
1318

14-
// Public setup wizard contract shared by bundled channel plugins and setup
15-
// orchestration. Keep these types declarative; runtime behavior lives in
16-
// setup-wizard.ts.
1719
export type ChannelSetupPlugin = {
1820
id: ChannelId;
1921
meta: ChannelMeta;

src/channels/plugins/setup-wizard.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Channel setup wizard adapter.
3+
*
4+
* Adapts declarative wizard definitions into imperative setup adapters used by onboarding.
5+
*/
16
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
27
import type { OpenClawConfig } from "../../config/types.openclaw.js";
38
import { DEFAULT_ACCOUNT_ID } from "../../routing/session-key.js";
@@ -19,8 +24,6 @@ import type {
1924
} from "./setup-wizard-types.js";
2025
import type { ChannelSetupInput } from "./types.core.js";
2126

22-
// Adapts declarative channel setup wizard definitions into the imperative
23-
// setup adapter used by onboarding and channel configuration flows.
2427
export type {
2528
ChannelSetupWizard,
2629
ChannelSetupWizardAllowFrom,

src/channels/plugins/stateful-target-builtins.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
/**
2+
* Built-in stateful binding target registration.
3+
*
4+
* Lazily registers ACP target drivers so non-ACP channel flows avoid ACP runtime imports.
5+
*/
16
import { registerStatefulBindingTargetDriver } from "./stateful-target-drivers.js";
27

3-
// Lazily registers built-in stateful binding target drivers. Keep imports
4-
// dynamic so non-ACP channel flows do not load the ACP runtime boundary.
58
type AcpStatefulTargetDriverModule = typeof import("./acp-stateful-target-driver.js");
69

710
let builtinsRegisteredPromise: Promise<void> | null = null;

src/channels/plugins/stateful-target-drivers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
/**
2+
* Stateful binding target driver registry.
3+
*
4+
* Stores lifecycle drivers for binding targets that carry mutable external session state.
5+
*/
16
import type { OpenClawConfig } from "../../config/types.openclaw.js";
27
import type {
38
ConfiguredBindingResolution,
49
StatefulBindingTargetDescriptor,
510
} from "./binding-types.js";
611

7-
// Registry for binding targets that carry external mutable session state, such
8-
// as ACP-backed channels that need per-session reset and lookup behavior.
912
export type StatefulBindingTargetReadyResult = { ok: true } | { ok: false; error: string };
1013
export type StatefulBindingTargetSessionResult =
1114
| { ok: true; sessionKey: string }

src/channels/plugins/status-issues/shared.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
/**
2+
* Channel status issue helper utilities.
3+
*
4+
* Formats status metadata and finds enabled/configured account ids for diagnostics.
5+
*/
16
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
27
import { isRecord } from "../../../utils.js";
38
import type { ChannelAccountSnapshot, ChannelStatusIssue } from "../types.public.js";
49
export { isRecord };
510

6-
/**
7-
* Shared helpers for channel status issue collectors.
8-
*/
9-
1011
/**
1112
* Normalizes optional string metadata in status issue helpers.
1213
*/

src/channels/plugins/status.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
/**
2+
* Channel status snapshot builders.
3+
*
4+
* Combines plugin status hooks, account inspection, and safe account field projection.
5+
*/
16
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
27
import type { OpenClawConfig } from "../../config/types.openclaw.js";
38
import { inspectChannelAccount } from "../account-inspection.js";
49
import { projectSafeChannelAccountSnapshotFields } from "../account-snapshot-fields.js";
510
import type { ChannelPlugin } from "./types.plugin.js";
611
import type { ChannelAccountSnapshot } from "./types.public.js";
712

8-
// Channel docking: status snapshots flow through plugin.status hooks here.
913
export async function buildChannelAccountSnapshotFromAccount<ResolvedAccount>(params: {
1014
plugin: ChannelPlugin<ResolvedAccount>;
1115
cfg: OpenClawConfig;

src/channels/plugins/target-parsing-loaded.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Loaded-channel target parsing helpers.
3+
*
4+
* Bridges deprecated explicit target parsing with modern channel route target helpers.
5+
*/
16
import {
27
normalizeLowercaseStringOrEmpty,
38
normalizeOptionalString,

src/channels/plugins/target-resolvers.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import type { ChannelResolveResult } from "./types.adapters.js";
2-
31
/**
4-
* Shared helpers for channel target resolution flows.
2+
* Channel target resolver helpers.
3+
*
4+
* Builds unresolved rows and token-gated resolution flows for setup/allowlist targets.
55
*/
6+
import type { ChannelResolveResult } from "./types.adapters.js";
67

78
/**
89
* Builds unresolved target results with one common note.

0 commit comments

Comments
 (0)