Skip to content

Commit c222a44

Browse files
committed
refactor: add retry runtime sdk seam
1 parent d42c2f6 commit c222a44

16 files changed

Lines changed: 185 additions & 155 deletions

File tree

‎docs/.generated/plugin-sdk-api-baseline.json‎

Lines changed: 78 additions & 69 deletions
Large diffs are not rendered by default.

‎docs/.generated/plugin-sdk-api-baseline.jsonl‎

Lines changed: 70 additions & 69 deletions
Large diffs are not rendered by default.

‎docs/plugins/sdk-migration.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ is a small, self-contained module with a clear purpose and documented contract.
128128
| `plugin-sdk/channel-send-result` | Send result types | Reply result types |
129129
| `plugin-sdk/runtime-store` | Persistent plugin storage | `createPluginRuntimeStore` |
130130
| `plugin-sdk/fetch-runtime` | Wrapped fetch/proxy helpers | `resolveFetch`, proxy helpers |
131+
| `plugin-sdk/retry-runtime` | Retry helpers | `RetryConfig`, `retryAsync`, policy runners |
131132
| `plugin-sdk/allow-from` | Allowlist formatting | `formatAllowFromLowercase` |
132133
| `plugin-sdk/allowlist-resolution` | Allowlist input mapping | `mapAllowlistResolutionInputs` |
133134
| `plugin-sdk/command-auth` | Command gating | `resolveControlCommandGate` |

‎docs/plugins/sdk-overview.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ subpaths is in `scripts/lib/plugin-sdk-entrypoints.json`.
9595
| `plugin-sdk/config-runtime` | Config load/write helpers |
9696
| `plugin-sdk/infra-runtime` | System event/heartbeat helpers |
9797
| `plugin-sdk/fetch-runtime` | Wrapped fetch, proxy, and pinned lookup helpers |
98+
| `plugin-sdk/retry-runtime` | Retry config and retry runner helpers |
9899
| `plugin-sdk/agent-runtime` | Agent dir/identity/workspace helpers |
99100
| `plugin-sdk/directory-runtime` | Config-backed directory query/dedup |
100101
| `plugin-sdk/keyed-async-queue` | `KeyedAsyncQueue` |

‎extensions/discord/src/api.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { resolveFetch } from "openclaw/plugin-sdk/infra-runtime";
1+
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
22
import {
33
resolveRetryConfig,
44
retryAsync,
55
type RetryConfig,
6-
} from "openclaw/plugin-sdk/infra-runtime";
6+
} from "openclaw/plugin-sdk/retry-runtime";
77

88
const DISCORD_API_BASE = "https://discord.com/api/v10";
99
const DISCORD_API_RETRY_DEFAULTS = {

‎extensions/discord/src/client.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { RequestClient } from "@buape/carbon";
22
import { loadConfig } from "openclaw/plugin-sdk/config-runtime";
3-
import type { RetryConfig } from "openclaw/plugin-sdk/infra-runtime";
4-
import type { RetryRunner } from "openclaw/plugin-sdk/infra-runtime";
3+
import type { RetryConfig, RetryRunner } from "openclaw/plugin-sdk/retry-runtime";
54
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
65
import {
76
mergeDiscordAccountConfig,

‎extensions/discord/src/monitor/reply-delivery.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import type { RequestClient } from "@buape/carbon";
22
import { resolveAgentAvatar } from "openclaw/plugin-sdk/agent-runtime";
33
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
44
import type { MarkdownTableMode, ReplyToMode } from "openclaw/plugin-sdk/config-runtime";
5-
import {
6-
resolveRetryConfig,
7-
retryAsync,
8-
type RetryConfig,
9-
type RetryRunner,
10-
} from "openclaw/plugin-sdk/infra-runtime";
115
import {
126
resolveSendableOutboundReplyParts,
137
resolveTextChunksWithFallback,
148
sendMediaWithLeadingCaption,
159
} from "openclaw/plugin-sdk/reply-payload";
1610
import type { ChunkMode } from "openclaw/plugin-sdk/reply-runtime";
1711
import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
12+
import {
13+
resolveRetryConfig,
14+
retryAsync,
15+
type RetryConfig,
16+
type RetryRunner,
17+
} from "openclaw/plugin-sdk/retry-runtime";
1818
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
1919
import { convertMarkdownTables } from "openclaw/plugin-sdk/text-runtime";
2020
import { resolveDiscordAccount } from "../accounts.js";

‎extensions/discord/src/retry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
createRateLimitRetryRunner,
44
type RetryConfig,
55
type RetryRunner,
6-
} from "openclaw/plugin-sdk/infra-runtime";
6+
} from "openclaw/plugin-sdk/retry-runtime";
77

88
export const DISCORD_RETRY_DEFAULTS = {
99
attempts: 3,

‎extensions/discord/src/send.outbound.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { ChannelType, Routes } from "discord-api-types/v10";
66
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-runtime";
77
import { loadConfig, type OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
88
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/config-runtime";
9-
import type { RetryConfig } from "openclaw/plugin-sdk/infra-runtime";
109
import { maxBytesForKind } from "openclaw/plugin-sdk/media-runtime";
1110
import { extensionForMime } from "openclaw/plugin-sdk/media-runtime";
1211
import { unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
1312
import type { PollInput } from "openclaw/plugin-sdk/media-runtime";
1413
import { resolveChunkMode } from "openclaw/plugin-sdk/reply-runtime";
14+
import type { RetryConfig } from "openclaw/plugin-sdk/retry-runtime";
1515
import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
1616
import { convertMarkdownTables } from "openclaw/plugin-sdk/text-runtime";
1717
import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";

‎extensions/discord/src/send.shared.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { PollLayoutType } from "discord-api-types/payloads/v10";
1010
import type { RESTAPIPoll } from "discord-api-types/rest/v10";
1111
import { Routes, type APIChannel, type APIEmbed } from "discord-api-types/v10";
1212
import { loadConfig, type OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
13-
import type { RetryRunner } from "openclaw/plugin-sdk/infra-runtime";
1413
import { buildOutboundMediaLoadOptions } from "openclaw/plugin-sdk/media-runtime";
1514
import { extensionForMime } from "openclaw/plugin-sdk/media-runtime";
1615
import {
@@ -20,6 +19,7 @@ import {
2019
} from "openclaw/plugin-sdk/media-runtime";
2120
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
2221
import type { ChunkMode } from "openclaw/plugin-sdk/reply-runtime";
22+
import type { RetryRunner } from "openclaw/plugin-sdk/retry-runtime";
2323
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
2424
import { resolveDiscordAccount } from "./accounts.js";
2525
import { chunkDiscordTextWithMode } from "./chunk.js";

0 commit comments

Comments
 (0)