@sider-ai/chrome-openclaw-sider 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +75 -0
  2. package/README.zh_CN.md +108 -0
  3. package/dist/account-cW9SLuNu.d.ts +75 -0
  4. package/dist/index.d.ts +12 -0
  5. package/dist/index.js +87 -0
  6. package/dist/setup-entry.d.ts +6 -0
  7. package/dist/setup-entry.js +11 -0
  8. package/dist/setup-plugin-api.d.ts +7 -0
  9. package/dist/setup-plugin-api.js +4 -0
  10. package/dist/src/account.d.ts +6 -0
  11. package/dist/src/account.js +260 -0
  12. package/dist/src/auth.d.ts +30 -0
  13. package/dist/src/auth.js +225 -0
  14. package/dist/src/channel-auto-title.d.ts +6 -0
  15. package/dist/src/channel-auto-title.js +102 -0
  16. package/dist/src/channel-builders.d.ts +105 -0
  17. package/dist/src/channel-builders.js +238 -0
  18. package/dist/src/channel-hooks.d.ts +30 -0
  19. package/dist/src/channel-hooks.js +380 -0
  20. package/dist/src/channel-monitor.d.ts +34 -0
  21. package/dist/src/channel-monitor.js +335 -0
  22. package/dist/src/channel-parts.d.ts +26 -0
  23. package/dist/src/channel-parts.js +32 -0
  24. package/dist/src/channel-relay.d.ts +117 -0
  25. package/dist/src/channel-relay.js +574 -0
  26. package/dist/src/channel-runtime.d.ts +33 -0
  27. package/dist/src/channel-runtime.js +138 -0
  28. package/dist/src/channel-send-result.d.ts +19 -0
  29. package/dist/src/channel-send-result.js +126 -0
  30. package/dist/src/channel-send.d.ts +73 -0
  31. package/dist/src/channel-send.js +291 -0
  32. package/dist/src/channel-session-model.d.ts +19 -0
  33. package/dist/src/channel-session-model.js +244 -0
  34. package/dist/src/channel-shared.d.ts +153 -0
  35. package/dist/src/channel-shared.js +96 -0
  36. package/dist/src/channel-state.d.ts +93 -0
  37. package/dist/src/channel-state.js +475 -0
  38. package/dist/src/channel-streaming.d.ts +117 -0
  39. package/dist/src/channel-streaming.js +681 -0
  40. package/dist/src/channel-types.d.ts +209 -0
  41. package/dist/src/channel-types.js +40 -0
  42. package/dist/src/channel-typing.d.ts +17 -0
  43. package/dist/src/channel-typing.js +79 -0
  44. package/dist/src/channel-util.d.ts +78 -0
  45. package/dist/src/channel-util.js +604 -0
  46. package/dist/src/channel.d.ts +14 -0
  47. package/dist/src/channel.js +834 -0
  48. package/dist/src/channel.setup.d.ts +10 -0
  49. package/dist/src/channel.setup.js +9 -0
  50. package/dist/src/config.d.ts +18 -0
  51. package/dist/src/config.js +38 -0
  52. package/dist/src/inbound-media.d.ts +37 -0
  53. package/dist/src/inbound-media.js +148 -0
  54. package/dist/src/media-upload.d.ts +87 -0
  55. package/dist/src/media-upload.js +1308 -0
  56. package/dist/src/setup-core.d.ts +72 -0
  57. package/dist/src/setup-core.js +343 -0
  58. package/dist/src/user-agent.d.ts +4 -0
  59. package/dist/src/user-agent.js +6 -0
  60. package/openclaw.plugin.json +96 -0
  61. package/package.json +47 -0
@@ -0,0 +1,244 @@
1
+ function normalizeOptionalString(value) {
2
+ if (typeof value !== "string") {
3
+ return void 0;
4
+ }
5
+ const trimmed = value.trim();
6
+ return trimmed.length > 0 ? trimmed : void 0;
7
+ }
8
+ function normalizeKey(value) {
9
+ return normalizeOptionalString(value)?.toLowerCase() ?? "";
10
+ }
11
+ function resolvePrimaryStringValue(value) {
12
+ if (typeof value === "string") {
13
+ return normalizeOptionalString(value);
14
+ }
15
+ if (!value || typeof value !== "object") {
16
+ return void 0;
17
+ }
18
+ return normalizeOptionalString(value.primary);
19
+ }
20
+ function parseModelRef(raw, fallbackProvider) {
21
+ const trimmed = normalizeOptionalString(raw);
22
+ if (!trimmed) {
23
+ return void 0;
24
+ }
25
+ const slashIndex = trimmed.indexOf("/");
26
+ if (slashIndex > 0 && slashIndex < trimmed.length - 1) {
27
+ const provider = trimmed.slice(0, slashIndex).trim();
28
+ const model = trimmed.slice(slashIndex + 1).trim();
29
+ if (provider && model) {
30
+ return { provider, model };
31
+ }
32
+ }
33
+ const fallback = normalizeOptionalString(fallbackProvider);
34
+ if (!fallback) {
35
+ return void 0;
36
+ }
37
+ return { provider: fallback, model: trimmed };
38
+ }
39
+ function resolveConfiguredModelAlias(cfg, raw) {
40
+ const models = cfg.agents?.defaults?.models;
41
+ if (!models || typeof models !== "object") {
42
+ return void 0;
43
+ }
44
+ const wanted = normalizeKey(raw);
45
+ if (!wanted) {
46
+ return void 0;
47
+ }
48
+ const exactAliasMatches = [];
49
+ const bareIdMatches = [];
50
+ for (const [modelRef, entry] of Object.entries(models)) {
51
+ const parsed = parseModelRef(modelRef);
52
+ if (!parsed) {
53
+ continue;
54
+ }
55
+ const alias = normalizeKey(entry?.alias);
56
+ if (alias && alias === wanted) {
57
+ exactAliasMatches.push(parsed);
58
+ continue;
59
+ }
60
+ const bareId = normalizeKey(parsed.model);
61
+ if (bareId && bareId === wanted) {
62
+ bareIdMatches.push(parsed);
63
+ }
64
+ }
65
+ if (exactAliasMatches.length === 1) {
66
+ return exactAliasMatches[0];
67
+ }
68
+ if (exactAliasMatches.length > 1) {
69
+ return void 0;
70
+ }
71
+ return bareIdMatches.length === 1 ? bareIdMatches[0] : void 0;
72
+ }
73
+ function resolveConfiguredDefaultModel(cfg, agentId) {
74
+ const normalizedAgentId = normalizeKey(agentId);
75
+ const agentRaw = cfg.agents?.list?.find((entry) => normalizeKey(entry?.id) === normalizedAgentId)?.model ?? void 0;
76
+ const raw = resolvePrimaryStringValue(agentRaw) ?? resolvePrimaryStringValue(cfg.agents?.defaults?.model);
77
+ if (!raw) {
78
+ return void 0;
79
+ }
80
+ return parseModelRef(raw) ?? resolveConfiguredModelAlias(cfg, raw);
81
+ }
82
+ function normalizeStoredOverride(params) {
83
+ const providerOverride = normalizeOptionalString(params.providerOverride);
84
+ const modelOverrideRaw = normalizeOptionalString(params.modelOverride);
85
+ if (!providerOverride || !modelOverrideRaw) {
86
+ return {
87
+ providerOverride,
88
+ modelOverride: modelOverrideRaw
89
+ };
90
+ }
91
+ const prefix = `${providerOverride.toLowerCase()}/`;
92
+ return {
93
+ providerOverride,
94
+ modelOverride: modelOverrideRaw.toLowerCase().startsWith(prefix) ? modelOverrideRaw.slice(providerOverride.length + 1).trim() || modelOverrideRaw : modelOverrideRaw
95
+ };
96
+ }
97
+ function formatModelRef(model) {
98
+ return `${model.provider}/${model.model}`;
99
+ }
100
+ function sameModelRef(left, right) {
101
+ if (!left || !right) {
102
+ return false;
103
+ }
104
+ return normalizeKey(left.provider) === normalizeKey(right.provider) && left.model === right.model;
105
+ }
106
+ function resolveManagedOverrideModel(entry) {
107
+ const normalized = normalizeStoredOverride({
108
+ providerOverride: entry.providerOverride,
109
+ modelOverride: entry.modelOverride
110
+ });
111
+ if (normalizeKey(entry.modelOverrideSource) !== "auto") {
112
+ return void 0;
113
+ }
114
+ const model = normalized.modelOverride;
115
+ if (!model) {
116
+ return void 0;
117
+ }
118
+ return parseModelRef(model, normalized.providerOverride);
119
+ }
120
+ function resolveRuntimeModel(entry, cfg) {
121
+ const runtimeModel = normalizeOptionalString(entry.model);
122
+ if (!runtimeModel) {
123
+ return void 0;
124
+ }
125
+ const runtimeProvider = normalizeOptionalString(entry.modelProvider);
126
+ return parseModelRef(runtimeModel, runtimeProvider) ?? (runtimeProvider ? { provider: runtimeProvider, model: runtimeModel } : void 0) ?? resolveConfiguredModelAlias(cfg, runtimeModel);
127
+ }
128
+ function hasLegacyOrUserOverride(entry) {
129
+ const hasOverride = Boolean(normalizeOptionalString(entry.providerOverride)) || Boolean(normalizeOptionalString(entry.modelOverride));
130
+ if (!hasOverride) {
131
+ return false;
132
+ }
133
+ return normalizeKey(entry.modelOverrideSource) !== "auto";
134
+ }
135
+ function clearManagedModelState(entry) {
136
+ let changed = false;
137
+ for (const key of [
138
+ "providerOverride",
139
+ "modelOverride",
140
+ "modelOverrideSource",
141
+ "modelProvider",
142
+ "model",
143
+ "contextTokens"
144
+ ]) {
145
+ if (entry[key] !== void 0) {
146
+ delete entry[key];
147
+ changed = true;
148
+ }
149
+ }
150
+ if (changed) {
151
+ entry.updatedAt = Date.now();
152
+ }
153
+ return changed;
154
+ }
155
+ async function mutateSessionEntry(params) {
156
+ const store = params.runtime.agent.session.loadSessionStore(params.storePath, {
157
+ skipCache: true
158
+ });
159
+ const entry = store[params.sessionKey];
160
+ if (!entry) {
161
+ return false;
162
+ }
163
+ const changed = params.mutate(entry);
164
+ if (!changed) {
165
+ return false;
166
+ }
167
+ await params.runtime.agent.session.saveSessionStore(params.storePath, store);
168
+ return true;
169
+ }
170
+ async function maybeResetSiderSessionToCurrentDefaultModel(params) {
171
+ const sessionKey = normalizeOptionalString(params.sessionKey);
172
+ if (!sessionKey) {
173
+ return { changed: false, reason: "missing-session-key" };
174
+ }
175
+ const defaultModel = resolveConfiguredDefaultModel(params.cfg, params.agentId);
176
+ if (!defaultModel) {
177
+ return { changed: false, reason: "default-model-unresolved" };
178
+ }
179
+ const storePath = params.runtime.agent.session.resolveStorePath(params.cfg.session?.store, {
180
+ agentId: params.agentId
181
+ });
182
+ const store = params.runtime.agent.session.loadSessionStore(storePath, {
183
+ skipCache: true
184
+ });
185
+ const entry = store[sessionKey];
186
+ if (!entry) {
187
+ return { changed: false, reason: "session-missing" };
188
+ }
189
+ if (entry.liveModelSwitchPending === true) {
190
+ return { changed: false, reason: "live-switch-pending" };
191
+ }
192
+ if (hasLegacyOrUserOverride(entry)) {
193
+ return { changed: false, reason: "preserve-user-override" };
194
+ }
195
+ const autoOverride = resolveManagedOverrideModel(entry);
196
+ if (autoOverride && !sameModelRef(autoOverride, defaultModel)) {
197
+ const previousModel2 = formatModelRef(autoOverride);
198
+ const changed2 = await mutateSessionEntry({
199
+ runtime: params.runtime,
200
+ storePath,
201
+ sessionKey,
202
+ mutate: (mutableEntry) => {
203
+ if (mutableEntry.liveModelSwitchPending === true || hasLegacyOrUserOverride(mutableEntry)) {
204
+ return false;
205
+ }
206
+ return clearManagedModelState(mutableEntry);
207
+ }
208
+ });
209
+ return changed2 ? {
210
+ changed: true,
211
+ reason: "auto-override",
212
+ previousModel: previousModel2,
213
+ defaultModel: formatModelRef(defaultModel)
214
+ } : { changed: false, reason: "auto-override-noop" };
215
+ }
216
+ const runtimeModel = resolveRuntimeModel(entry, params.cfg);
217
+ if (!runtimeModel || sameModelRef(runtimeModel, defaultModel)) {
218
+ return { changed: false, reason: runtimeModel ? "runtime-aligned" : "runtime-missing" };
219
+ }
220
+ const previousModel = formatModelRef(runtimeModel);
221
+ const changed = await mutateSessionEntry({
222
+ runtime: params.runtime,
223
+ storePath,
224
+ sessionKey,
225
+ mutate: (mutableEntry) => {
226
+ if (mutableEntry.liveModelSwitchPending === true || hasLegacyOrUserOverride(mutableEntry)) {
227
+ return false;
228
+ }
229
+ if (resolveManagedOverrideModel(mutableEntry)) {
230
+ return false;
231
+ }
232
+ return clearManagedModelState(mutableEntry);
233
+ }
234
+ });
235
+ return changed ? {
236
+ changed: true,
237
+ reason: "runtime-model",
238
+ previousModel,
239
+ defaultModel: formatModelRef(defaultModel)
240
+ } : { changed: false, reason: "runtime-noop" };
241
+ }
242
+ export {
243
+ maybeResetSiderSessionToCurrentDefaultModel
244
+ };
@@ -0,0 +1,153 @@
1
+ import * as openclaw_plugin_sdk from 'openclaw/plugin-sdk';
2
+ import { R as ResolvedSiderAccount } from '../account-cW9SLuNu.js';
3
+ import 'openclaw/plugin-sdk/setup';
4
+ import './auth.js';
5
+ import 'openclaw/plugin-sdk/plugin-entry';
6
+ import 'openclaw/plugin-sdk/config-runtime';
7
+
8
+ declare const siderChannelPluginCommon: {
9
+ meta: {
10
+ id: string;
11
+ label: string;
12
+ selectionLabel: string;
13
+ docsPath: string;
14
+ docsLabel: string;
15
+ blurb: string;
16
+ aliases: "sider"[];
17
+ order: number;
18
+ };
19
+ setupWizard: openclaw_plugin_sdk.ChannelSetupWizard;
20
+ setup: openclaw_plugin_sdk.ChannelSetupAdapter;
21
+ capabilities: {
22
+ chatTypes: "direct"[];
23
+ threads: false;
24
+ media: true;
25
+ blockStreaming: true;
26
+ };
27
+ configSchema: {
28
+ schema: {
29
+ type: string;
30
+ additionalProperties: boolean;
31
+ properties: {
32
+ accounts: {
33
+ type: string;
34
+ additionalProperties: {
35
+ type: string;
36
+ additionalProperties: boolean;
37
+ properties: {
38
+ readonly enabled: {
39
+ readonly type: "boolean";
40
+ };
41
+ readonly name: {
42
+ readonly type: "string";
43
+ };
44
+ readonly setupToken: {
45
+ readonly type: "string";
46
+ };
47
+ readonly token: {
48
+ readonly type: "string";
49
+ };
50
+ readonly autoTitle: {
51
+ readonly oneOf: readonly [{
52
+ readonly type: "boolean";
53
+ }, {
54
+ readonly type: "object";
55
+ readonly additionalProperties: false;
56
+ readonly properties: {
57
+ readonly enabled: {
58
+ readonly type: "boolean";
59
+ };
60
+ readonly prompt: {
61
+ readonly type: "string";
62
+ };
63
+ };
64
+ }];
65
+ };
66
+ readonly defaultTo: {
67
+ readonly type: "string";
68
+ };
69
+ readonly connectTimeoutMs: {
70
+ readonly type: "number";
71
+ readonly minimum: 1;
72
+ };
73
+ readonly sendTimeoutMs: {
74
+ readonly type: "number";
75
+ readonly minimum: 1;
76
+ };
77
+ readonly reconnectDelayMs: {
78
+ readonly type: "number";
79
+ readonly minimum: 1;
80
+ };
81
+ };
82
+ };
83
+ };
84
+ enabled: {
85
+ readonly type: "boolean";
86
+ };
87
+ name: {
88
+ readonly type: "string";
89
+ };
90
+ setupToken: {
91
+ readonly type: "string";
92
+ };
93
+ token: {
94
+ readonly type: "string";
95
+ };
96
+ autoTitle: {
97
+ readonly oneOf: readonly [{
98
+ readonly type: "boolean";
99
+ }, {
100
+ readonly type: "object";
101
+ readonly additionalProperties: false;
102
+ readonly properties: {
103
+ readonly enabled: {
104
+ readonly type: "boolean";
105
+ };
106
+ readonly prompt: {
107
+ readonly type: "string";
108
+ };
109
+ };
110
+ }];
111
+ };
112
+ defaultTo: {
113
+ readonly type: "string";
114
+ };
115
+ connectTimeoutMs: {
116
+ readonly type: "number";
117
+ readonly minimum: 1;
118
+ };
119
+ sendTimeoutMs: {
120
+ readonly type: "number";
121
+ readonly minimum: 1;
122
+ };
123
+ reconnectDelayMs: {
124
+ readonly type: "number";
125
+ readonly minimum: 1;
126
+ };
127
+ };
128
+ };
129
+ };
130
+ reload: {
131
+ configPrefixes: string[];
132
+ };
133
+ config: {
134
+ listAccountIds: (cfg: openclaw_plugin_sdk.OpenClawConfig) => string[];
135
+ resolveAccount: (cfg: openclaw_plugin_sdk.OpenClawConfig, accountId: string | null | undefined) => ResolvedSiderAccount;
136
+ defaultAccountId: () => string;
137
+ isConfigured: (account: ResolvedSiderAccount) => boolean;
138
+ describeAccount: (account: ResolvedSiderAccount) => {
139
+ accountId: string;
140
+ enabled: boolean;
141
+ configured: boolean;
142
+ name: string;
143
+ baseUrl: string;
144
+ defaultTo: string | undefined;
145
+ };
146
+ resolveDefaultTo: ({ cfg, accountId }: {
147
+ cfg: openclaw_plugin_sdk.OpenClawConfig;
148
+ accountId?: string | null;
149
+ }) => string | undefined;
150
+ };
151
+ };
152
+
153
+ export { siderChannelPluginCommon };
@@ -0,0 +1,96 @@
1
+ import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
2
+ import {
3
+ isSiderAccountBootstrappable,
4
+ listSiderAccountIds,
5
+ resolveSiderAccount,
6
+ siderSetupWizard
7
+ } from "./account.js";
8
+ import {
9
+ SIDER_CHANNEL_ALIASES,
10
+ SIDER_CHANNEL_BLURB,
11
+ SIDER_CHANNEL_DOCS_LABEL,
12
+ SIDER_CHANNEL_DOCS_PATH,
13
+ SIDER_CHANNEL_ID,
14
+ SIDER_CHANNEL_LABEL,
15
+ SIDER_CHANNEL_SELECTION_LABEL
16
+ } from "./config.js";
17
+ import { siderSetupAdapter } from "./setup-core.js";
18
+ const siderAccountConfigProperties = {
19
+ enabled: { type: "boolean" },
20
+ name: { type: "string" },
21
+ setupToken: { type: "string" },
22
+ token: { type: "string" },
23
+ autoTitle: {
24
+ oneOf: [
25
+ { type: "boolean" },
26
+ {
27
+ type: "object",
28
+ additionalProperties: false,
29
+ properties: {
30
+ enabled: { type: "boolean" },
31
+ prompt: { type: "string" }
32
+ }
33
+ }
34
+ ]
35
+ },
36
+ defaultTo: { type: "string" },
37
+ connectTimeoutMs: { type: "number", minimum: 1 },
38
+ sendTimeoutMs: { type: "number", minimum: 1 },
39
+ reconnectDelayMs: { type: "number", minimum: 1 }
40
+ };
41
+ const siderChannelPluginCommon = {
42
+ meta: {
43
+ id: SIDER_CHANNEL_ID,
44
+ label: SIDER_CHANNEL_LABEL,
45
+ selectionLabel: SIDER_CHANNEL_SELECTION_LABEL,
46
+ docsPath: SIDER_CHANNEL_DOCS_PATH,
47
+ docsLabel: SIDER_CHANNEL_DOCS_LABEL,
48
+ blurb: SIDER_CHANNEL_BLURB,
49
+ aliases: [...SIDER_CHANNEL_ALIASES],
50
+ order: 97
51
+ },
52
+ setupWizard: siderSetupWizard,
53
+ setup: siderSetupAdapter,
54
+ capabilities: {
55
+ chatTypes: ["direct"],
56
+ threads: false,
57
+ media: true,
58
+ blockStreaming: true
59
+ },
60
+ configSchema: {
61
+ schema: {
62
+ type: "object",
63
+ additionalProperties: false,
64
+ properties: {
65
+ ...siderAccountConfigProperties,
66
+ accounts: {
67
+ type: "object",
68
+ additionalProperties: {
69
+ type: "object",
70
+ additionalProperties: false,
71
+ properties: siderAccountConfigProperties
72
+ }
73
+ }
74
+ }
75
+ }
76
+ },
77
+ reload: { configPrefixes: [`channels.${SIDER_CHANNEL_ID}`] },
78
+ config: {
79
+ listAccountIds: (cfg) => listSiderAccountIds(cfg),
80
+ resolveAccount: (cfg, accountId) => resolveSiderAccount(cfg, accountId),
81
+ defaultAccountId: () => DEFAULT_ACCOUNT_ID,
82
+ isConfigured: (account) => account.configured || isSiderAccountBootstrappable(account),
83
+ describeAccount: (account) => ({
84
+ accountId: account.accountId,
85
+ enabled: account.enabled,
86
+ configured: account.configured,
87
+ name: account.name,
88
+ baseUrl: account.gatewayUrl,
89
+ defaultTo: account.defaultTo
90
+ }),
91
+ resolveDefaultTo: ({ cfg, accountId }) => resolveSiderAccount(cfg, accountId).defaultTo
92
+ }
93
+ };
94
+ export {
95
+ siderChannelPluginCommon
96
+ };
@@ -0,0 +1,93 @@
1
+ import { R as ResolvedSiderAccount } from '../account-cW9SLuNu.js';
2
+ import { SiderPart, SiderSessionBinding, SiderRunState } from './channel-types.js';
3
+ import 'openclaw/plugin-sdk/setup';
4
+ import './auth.js';
5
+ import 'openclaw/plugin-sdk';
6
+ import 'openclaw/plugin-sdk/plugin-entry';
7
+ import 'openclaw/plugin-sdk/config-runtime';
8
+ import 'ws';
9
+
10
+ declare function normalizeSessionBindingKey(raw?: string): string | undefined;
11
+ declare function pruneSiderSessionBindings(now?: number): void;
12
+ declare function rememberSiderSessionBinding(params: {
13
+ sessionKey?: string;
14
+ account: ResolvedSiderAccount;
15
+ sessionId: string;
16
+ }): void;
17
+ declare function resolveSiderSessionBinding(sessionKey?: string): SiderSessionBinding | undefined;
18
+ declare function resolveSiderBindingByTarget(params: {
19
+ accountId: string;
20
+ sessionId: string;
21
+ }): {
22
+ sessionKey: string;
23
+ binding: SiderSessionBinding;
24
+ } | undefined;
25
+ declare function pruneSiderRunStates(now?: number): void;
26
+ declare function getOrCreateSiderRunState(runId: string): SiderRunState;
27
+ declare function resolveSiderRunState(runId?: string): SiderRunState | undefined;
28
+ declare function discardSiderRunState(runId?: string): void;
29
+ declare function updateSiderRunStateContext(params: {
30
+ runId: string;
31
+ sessionKey?: string;
32
+ sessionId?: string;
33
+ accountId?: string;
34
+ provider?: string;
35
+ model?: string;
36
+ managedByReplyPipeline?: boolean;
37
+ }): SiderRunState;
38
+ declare function resolveRelayCallIdForToolEvent(params: {
39
+ binding: SiderSessionBinding;
40
+ phase: "start" | "end" | "error";
41
+ toolCallId?: string;
42
+ }): string;
43
+ declare function clearRelayCallIdForToolEvent(params: {
44
+ binding: SiderSessionBinding;
45
+ callId: string;
46
+ toolCallId?: string;
47
+ }): void;
48
+ declare function hasTextParts(parts: readonly SiderPart[]): boolean;
49
+ declare function enqueueCompletedParts(params: {
50
+ runId?: string;
51
+ parts: readonly SiderPart[];
52
+ sessionKey?: string;
53
+ sessionId?: string;
54
+ accountId?: string;
55
+ provider?: string;
56
+ model?: string;
57
+ }): void;
58
+ declare function resolvePendingFinalTextForRun(runId?: string): string;
59
+ declare function buildPendingMessageContextForRun(params: {
60
+ accountId: string;
61
+ runId?: string;
62
+ includeFinalThinking?: boolean;
63
+ }): {
64
+ parts: SiderPart[];
65
+ meta?: Record<string, unknown>;
66
+ runId?: string;
67
+ stopReason?: string;
68
+ };
69
+ declare function consumePendingMessageContextForRun(params: {
70
+ runId?: string;
71
+ consumeFinalThinking?: boolean;
72
+ }): void;
73
+ declare function scheduleQueuedPartFlush(params: {
74
+ runId?: string;
75
+ context: string;
76
+ }): Promise<void>;
77
+ declare function flushQueuedPartsExceptTailForRun(params: {
78
+ runId?: string;
79
+ account: ResolvedSiderAccount;
80
+ sessionId: string;
81
+ context: string;
82
+ }): Promise<void>;
83
+ declare function flushFinalQueuedPartForRun(params: {
84
+ runId?: string;
85
+ account: ResolvedSiderAccount;
86
+ sessionId: string;
87
+ stopReason?: string;
88
+ context: string;
89
+ }): Promise<boolean>;
90
+ declare function dropQueuedTailOnAbort(runId?: string): void;
91
+ declare function clearBindingRunId(sessionKey?: string, runId?: string): void;
92
+
93
+ export { buildPendingMessageContextForRun, clearBindingRunId, clearRelayCallIdForToolEvent, consumePendingMessageContextForRun, discardSiderRunState, dropQueuedTailOnAbort, enqueueCompletedParts, flushFinalQueuedPartForRun, flushQueuedPartsExceptTailForRun, getOrCreateSiderRunState, hasTextParts, normalizeSessionBindingKey, pruneSiderRunStates, pruneSiderSessionBindings, rememberSiderSessionBinding, resolvePendingFinalTextForRun, resolveRelayCallIdForToolEvent, resolveSiderBindingByTarget, resolveSiderRunState, resolveSiderSessionBinding, scheduleQueuedPartFlush, updateSiderRunStateContext };