refactor: trim command helper exports · openclaw/openclaw@3967683
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,11 +5,7 @@ import {
|
5 | 5 | resolveDefaultAgentId, |
6 | 6 | } from "../agents/agent-scope.js"; |
7 | 7 | import type { AgentIdentityFile } from "../agents/identity-file.js"; |
8 | | -import { |
9 | | -identityHasValues, |
10 | | -loadAgentIdentityFromWorkspace, |
11 | | -parseIdentityMarkdown as parseIdentityMarkdownFile, |
12 | | -} from "../agents/identity-file.js"; |
| 8 | +import { identityHasValues, loadAgentIdentityFromWorkspace } from "../agents/identity-file.js"; |
13 | 9 | import { listRouteBindings } from "../config/bindings.js"; |
14 | 10 | import type { IdentityConfig } from "../config/types.base.js"; |
15 | 11 | import type { OpenClawConfig } from "../config/types.openclaw.js"; |
@@ -53,10 +49,6 @@ function resolveAgentModel(cfg: OpenClawConfig, agentId: string) {
|
53 | 49 | return resolvePrimaryStringValue(cfg.agents?.defaults?.model); |
54 | 50 | } |
55 | 51 | |
56 | | -export function parseIdentityMarkdown(content: string): AgentIdentity { |
57 | | -return parseIdentityMarkdownFile(content); |
58 | | -} |
59 | | - |
60 | 52 | export function loadAgentIdentity(workspace: string): AgentIdentity | null { |
61 | 53 | const parsed = loadAgentIdentityFromWorkspace(workspace); |
62 | 54 | if (!parsed) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -37,7 +37,7 @@ export async function requireValidConfig(
|
37 | 37 | return effectiveConfig; |
38 | 38 | } |
39 | 39 | |
40 | | -export function formatAccountLabel(params: { accountId: string; name?: string }) { |
| 40 | +function formatAccountLabel(params: { accountId: string; name?: string }) { |
41 | 41 | const base = params.accountId || DEFAULT_ACCOUNT_ID; |
42 | 42 | if (params.name?.trim()) { |
43 | 43 | return `${base} (${params.name.trim()})`; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { getLoadedChannelPlugin } from "../channels/plugins/index.js"; |
2 | | -import type { ChannelId, ChannelMessageActionName } from "../channels/plugins/types.public.js"; |
| 2 | +import type { ChannelId } from "../channels/plugins/types.public.js"; |
3 | 3 | import type { OutboundDeliveryResult } from "../infra/outbound/deliver.js"; |
4 | 4 | import { formatGatewaySummary, formatOutboundDeliverySummary } from "../infra/outbound/format.js"; |
5 | 5 | import type { MessageActionRunResult } from "../infra/outbound/message-action-runner.js"; |
@@ -33,24 +33,6 @@ function extractMessageId(payload: unknown): string | null {
|
33 | 33 | return null; |
34 | 34 | } |
35 | 35 | |
36 | | -export type MessageCliJsonEnvelope = { |
37 | | -action: ChannelMessageActionName; |
38 | | -channel: ChannelId; |
39 | | -dryRun: boolean; |
40 | | -handledBy: "plugin" | "core" | "dry-run"; |
41 | | -payload: unknown; |
42 | | -}; |
43 | | - |
44 | | -export function buildMessageCliJson(result: MessageActionRunResult): MessageCliJsonEnvelope { |
45 | | -return { |
46 | | -action: result.action, |
47 | | -channel: result.channel, |
48 | | -dryRun: result.dryRun, |
49 | | -handledBy: result.handledBy, |
50 | | -payload: result.payload, |
51 | | -}; |
52 | | -} |
53 | | - |
54 | 36 | type FormatOpts = { |
55 | 37 | width: number; |
56 | 38 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -37,7 +37,7 @@ export function appendStatusSectionHeading(params: {
|
37 | 37 | params.lines.push(params.heading(params.title)); |
38 | 38 | } |
39 | 39 | |
40 | | -export function appendStatusLinesSection(params: { |
| 40 | +function appendStatusLinesSection(params: { |
41 | 41 | lines: string[]; |
42 | 42 | heading: HeadingFn; |
43 | 43 | title: string; |
@@ -47,7 +47,7 @@ export function appendStatusLinesSection(params: {
|
47 | 47 | params.lines.push(...params.body); |
48 | 48 | } |
49 | 49 | |
50 | | -export function appendStatusTableSection<Row extends Record<string, string>>(params: { |
| 50 | +function appendStatusTableSection<Row extends Record<string, string>>(params: { |
51 | 51 | lines: string[]; |
52 | 52 | heading: HeadingFn; |
53 | 53 | title: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -122,7 +122,7 @@ function toSystemAuditFindings(params: {
|
122 | 122 | }; |
123 | 123 | } |
124 | 124 | |
125 | | -export function buildTasksListJsonPayload(opts: TasksListJsonArgs) { |
| 125 | +function buildTasksListJsonPayload(opts: TasksListJsonArgs) { |
126 | 126 | const runtimeFilter = opts.runtime?.trim(); |
127 | 127 | const statusFilter = opts.status?.trim(); |
128 | 128 | const tasks = listTaskJsonRecords().filter((task) => { |
@@ -142,7 +142,7 @@ export function buildTasksListJsonPayload(opts: TasksListJsonArgs) {
|
142 | 142 | }; |
143 | 143 | } |
144 | 144 | |
145 | | -export function buildTasksAuditJsonPayload(opts: TasksAuditJsonArgs) { |
| 145 | +function buildTasksAuditJsonPayload(opts: TasksAuditJsonArgs) { |
146 | 146 | const severityFilter = opts.severity?.trim() as TaskSystemAuditSeverity | undefined; |
147 | 147 | const codeFilter = opts.code?.trim() as TaskSystemAuditCode | undefined; |
148 | 148 | const { allFindings, filteredFindings, taskFindings, summary } = toSystemAuditFindings({ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。