Skip to content

Commit 2028fd5

Browse files
committed
fix(utils): split delivery context shared types
1 parent 00a7439 commit 2028fd5

7 files changed

Lines changed: 27 additions & 27 deletions

File tree

src/config/sessions/runtime-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { MsgContext } from "../../auto-reply/templating.js";
2-
import type { DeliveryContext } from "../../utils/delivery-context.shared.js";
2+
import type { DeliveryContext } from "../../utils/delivery-context.types.js";
33
import type { SessionMaintenanceMode } from "../types.base.js";
44
import type { SessionEntry, GroupKeyResolution } from "./types.js";
55

src/plugins/tool-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ToolFsPolicy } from "../agents/tool-fs-policy.js";
22
import type { AnyAgentTool } from "../agents/tools/common.js";
33
import type { OpenClawConfig } from "../config/types.openclaw.js";
44
import type { HookEntry } from "../hooks/types.js";
5-
import type { DeliveryContext } from "../utils/delivery-context.shared.js";
5+
import type { DeliveryContext } from "../utils/delivery-context.types.js";
66

77
/** Trusted execution context passed to plugin-owned agent tool factories. */
88
export type OpenClawPluginToolContext = {

src/tasks/task-flow-registry.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DeliveryContext } from "../utils/delivery-context.shared.js";
1+
import type { DeliveryContext } from "../utils/delivery-context.types.js";
22
import type { TaskNotifyPolicy } from "./task-registry.types.js";
33

44
export type JsonValue =

src/tasks/task-registry.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DeliveryContext } from "../utils/delivery-context.shared.js";
1+
import type { DeliveryContext } from "../utils/delivery-context.types.js";
22

33
export type TaskRuntime = "subagent" | "acp" | "cli" | "cron";
44

src/utils/delivery-context.shared.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
11
import { normalizeOptionalString } from "../shared/string-coerce.js";
22
import { normalizeAccountId } from "./account-id.js";
3+
import type { DeliveryContext, DeliveryContextSessionSource } from "./delivery-context.types.js";
34
import { normalizeMessageChannel } from "./message-channel.js";
4-
5-
export type DeliveryContext = {
6-
channel?: string;
7-
to?: string;
8-
accountId?: string;
9-
threadId?: string | number;
10-
};
11-
12-
export type DeliveryContextSessionSource = {
13-
channel?: string;
14-
lastChannel?: string;
15-
lastTo?: string;
16-
lastAccountId?: string;
17-
lastThreadId?: string | number;
18-
origin?: {
19-
provider?: string;
20-
accountId?: string;
21-
threadId?: string | number;
22-
};
23-
deliveryContext?: DeliveryContext;
24-
};
5+
export type { DeliveryContext, DeliveryContextSessionSource } from "./delivery-context.types.js";
256

267
export function normalizeDeliveryContext(context?: DeliveryContext): DeliveryContext | undefined {
278
if (!context) {

src/utils/delivery-context.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ export {
77
mergeDeliveryContext,
88
normalizeDeliveryContext,
99
normalizeSessionDeliveryFields,
10-
type DeliveryContext,
11-
type DeliveryContextSessionSource,
1210
} from "./delivery-context.shared.js";
11+
export type { DeliveryContext, DeliveryContextSessionSource } from "./delivery-context.types.js";
1312

1413
export function formatConversationTarget(params: {
1514
channel?: string;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export type DeliveryContext = {
2+
channel?: string;
3+
to?: string;
4+
accountId?: string;
5+
threadId?: string | number;
6+
};
7+
8+
export type DeliveryContextSessionSource = {
9+
channel?: string;
10+
lastChannel?: string;
11+
lastTo?: string;
12+
lastAccountId?: string;
13+
lastThreadId?: string | number;
14+
origin?: {
15+
provider?: string;
16+
accountId?: string;
17+
threadId?: string | number;
18+
};
19+
deliveryContext?: DeliveryContext;
20+
};

0 commit comments

Comments
 (0)