docs: document channel plugin setup types · openclaw/openclaw@cc73ef8
steipete
·
2026-06-04
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Channel setup wizard helper functions. |
| 3 | + * |
| 4 | + * Prompts account ids, credentials, allowlists, and account-scoped setup config updates. |
| 5 | + */ |
1 | 6 | import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; |
2 | 7 | import { |
3 | 8 | normalizeStringEntries, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Lazy setup wizard proxy helpers. |
| 3 | + * |
| 4 | + * Delegates setup wizard status, credential, allowlist, and finalization hooks to loaded wizards. |
| 5 | + */ |
1 | 6 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
2 | 7 | import { createDelegatedSetupWizardStatusResolvers } from "./setup-wizard-binary.js"; |
3 | 8 | import type { ChannelSetupDmPolicy } from "./setup-wizard-types.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Declarative channel setup wizard contract. |
| 3 | + * |
| 4 | + * Defines status, credentials, prompts, group access, and finalization types for setup flows. |
| 5 | + */ |
1 | 6 | import type { DmPolicy } from "../../config/types.js"; |
2 | 7 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
3 | 8 | import type { RuntimeEnv } from "../../runtime.js"; |
@@ -11,9 +16,6 @@ import type {
|
11 | 16 | ChannelSetupInput, |
12 | 17 | } from "./types.core.js"; |
13 | 18 | |
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. |
17 | 19 | export type ChannelSetupPlugin = { |
18 | 20 | id: ChannelId; |
19 | 21 | meta: ChannelMeta; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Channel setup wizard adapter. |
| 3 | + * |
| 4 | + * Adapts declarative wizard definitions into imperative setup adapters used by onboarding. |
| 5 | + */ |
1 | 6 | import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; |
2 | 7 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
3 | 8 | import { DEFAULT_ACCOUNT_ID } from "../../routing/session-key.js"; |
@@ -19,8 +24,6 @@ import type {
|
19 | 24 | } from "./setup-wizard-types.js"; |
20 | 25 | import type { ChannelSetupInput } from "./types.core.js"; |
21 | 26 | |
22 | | -// Adapts declarative channel setup wizard definitions into the imperative |
23 | | -// setup adapter used by onboarding and channel configuration flows. |
24 | 27 | export type { |
25 | 28 | ChannelSetupWizard, |
26 | 29 | ChannelSetupWizardAllowFrom, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 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 | + */ |
1 | 6 | import { registerStatefulBindingTargetDriver } from "./stateful-target-drivers.js"; |
2 | 7 | |
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. |
5 | 8 | type AcpStatefulTargetDriverModule = typeof import("./acp-stateful-target-driver.js"); |
6 | 9 | |
7 | 10 | let builtinsRegisteredPromise: Promise<void> | null = null; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Stateful binding target driver registry. |
| 3 | + * |
| 4 | + * Stores lifecycle drivers for binding targets that carry mutable external session state. |
| 5 | + */ |
1 | 6 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
2 | 7 | import type { |
3 | 8 | ConfiguredBindingResolution, |
4 | 9 | StatefulBindingTargetDescriptor, |
5 | 10 | } from "./binding-types.js"; |
6 | 11 | |
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. |
9 | 12 | export type StatefulBindingTargetReadyResult = { ok: true } | { ok: false; error: string }; |
10 | 13 | export type StatefulBindingTargetSessionResult = |
11 | 14 | | { ok: true; sessionKey: string } |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Channel status issue helper utilities. |
| 3 | + * |
| 4 | + * Formats status metadata and finds enabled/configured account ids for diagnostics. |
| 5 | + */ |
1 | 6 | import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; |
2 | 7 | import { isRecord } from "../../../utils.js"; |
3 | 8 | import type { ChannelAccountSnapshot, ChannelStatusIssue } from "../types.public.js"; |
4 | 9 | export { isRecord }; |
5 | 10 | |
6 | | -/** |
7 | | - * Shared helpers for channel status issue collectors. |
8 | | - */ |
9 | | - |
10 | 11 | /** |
11 | 12 | * Normalizes optional string metadata in status issue helpers. |
12 | 13 | */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Channel status snapshot builders. |
| 3 | + * |
| 4 | + * Combines plugin status hooks, account inspection, and safe account field projection. |
| 5 | + */ |
1 | 6 | import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; |
2 | 7 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
3 | 8 | import { inspectChannelAccount } from "../account-inspection.js"; |
4 | 9 | import { projectSafeChannelAccountSnapshotFields } from "../account-snapshot-fields.js"; |
5 | 10 | import type { ChannelPlugin } from "./types.plugin.js"; |
6 | 11 | import type { ChannelAccountSnapshot } from "./types.public.js"; |
7 | 12 | |
8 | | -// Channel docking: status snapshots flow through plugin.status hooks here. |
9 | 13 | export async function buildChannelAccountSnapshotFromAccount<ResolvedAccount>(params: { |
10 | 14 | plugin: ChannelPlugin<ResolvedAccount>; |
11 | 15 | cfg: OpenClawConfig; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Loaded-channel target parsing helpers. |
| 3 | + * |
| 4 | + * Bridges deprecated explicit target parsing with modern channel route target helpers. |
| 5 | + */ |
1 | 6 | import { |
2 | 7 | normalizeLowercaseStringOrEmpty, |
3 | 8 | normalizeOptionalString, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import type { ChannelResolveResult } from "./types.adapters.js"; |
2 | | - |
3 | 1 | /** |
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. |
5 | 5 | */ |
| 6 | +import type { ChannelResolveResult } from "./types.adapters.js"; |
6 | 7 | |
7 | 8 | /** |
8 | 9 | * Builds unresolved target results with one common note. |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。