@openclaw/tlon 2026.5.2 → 2026.5.3-beta.2

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 (75) hide show
  1. package/dist/api.js +4 -0
  2. package/dist/channel-B4LtNGeZ.js +221 -0
  3. package/dist/channel-plugin-api.js +2 -0
  4. package/dist/channel.runtime-v-_0sHkJ.js +3584 -0
  5. package/dist/doctor-contract-W99wMbar.js +7 -0
  6. package/dist/doctor-contract-api.js +2 -0
  7. package/dist/index.js +18 -0
  8. package/dist/runtime-5FiW9E50.js +8 -0
  9. package/dist/runtime-api-C0hr1Rtn.js +4 -0
  10. package/dist/runtime-api.js +2 -0
  11. package/dist/setup-api.js +3 -0
  12. package/dist/setup-core-BUkZJ-MU.js +386 -0
  13. package/dist/setup-entry.js +11 -0
  14. package/dist/setup-surface-FxNMaluC.js +72 -0
  15. package/dist/test-api.js +2 -0
  16. package/package.json +15 -6
  17. package/api.ts +0 -16
  18. package/channel-plugin-api.ts +0 -1
  19. package/doctor-contract-api.ts +0 -1
  20. package/index.ts +0 -183
  21. package/runtime-api.ts +0 -17
  22. package/setup-api.ts +0 -2
  23. package/setup-entry.ts +0 -9
  24. package/src/account-fields.ts +0 -31
  25. package/src/channel.runtime.ts +0 -248
  26. package/src/channel.ts +0 -173
  27. package/src/config-schema.ts +0 -53
  28. package/src/core.test.ts +0 -278
  29. package/src/doctor-contract.ts +0 -9
  30. package/src/doctor.test.ts +0 -40
  31. package/src/doctor.ts +0 -10
  32. package/src/logger-runtime.ts +0 -1
  33. package/src/monitor/approval-runtime.ts +0 -363
  34. package/src/monitor/approval.test.ts +0 -33
  35. package/src/monitor/approval.ts +0 -286
  36. package/src/monitor/authorization.ts +0 -30
  37. package/src/monitor/cites.ts +0 -54
  38. package/src/monitor/discovery.ts +0 -68
  39. package/src/monitor/history.ts +0 -226
  40. package/src/monitor/index.ts +0 -1524
  41. package/src/monitor/media.test.ts +0 -91
  42. package/src/monitor/media.ts +0 -172
  43. package/src/monitor/processed-messages.test.ts +0 -58
  44. package/src/monitor/processed-messages.ts +0 -89
  45. package/src/monitor/settings-helpers.test.ts +0 -113
  46. package/src/monitor/settings-helpers.ts +0 -158
  47. package/src/monitor/utils.ts +0 -372
  48. package/src/runtime.ts +0 -9
  49. package/src/security.test.ts +0 -622
  50. package/src/session-route.ts +0 -40
  51. package/src/settings.ts +0 -391
  52. package/src/setup-core.ts +0 -228
  53. package/src/setup-surface.ts +0 -103
  54. package/src/targets.ts +0 -102
  55. package/src/tlon-api.test.ts +0 -589
  56. package/src/tlon-api.ts +0 -402
  57. package/src/types.ts +0 -160
  58. package/src/urbit/auth.ssrf.test.ts +0 -45
  59. package/src/urbit/auth.ts +0 -48
  60. package/src/urbit/base-url.test.ts +0 -48
  61. package/src/urbit/base-url.ts +0 -61
  62. package/src/urbit/channel-ops.ts +0 -145
  63. package/src/urbit/context.ts +0 -50
  64. package/src/urbit/errors.ts +0 -51
  65. package/src/urbit/fetch.ts +0 -42
  66. package/src/urbit/foreigns.ts +0 -49
  67. package/src/urbit/send.test.ts +0 -38
  68. package/src/urbit/send.ts +0 -176
  69. package/src/urbit/sse-client.test.ts +0 -203
  70. package/src/urbit/sse-client.ts +0 -484
  71. package/src/urbit/story.ts +0 -332
  72. package/src/urbit/upload.test.ts +0 -154
  73. package/src/urbit/upload.ts +0 -60
  74. package/test-api.ts +0 -1
  75. package/tsconfig.json +0 -16
@@ -0,0 +1,7 @@
1
+ import { createLegacyPrivateNetworkDoctorContract } from "openclaw/plugin-sdk/ssrf-runtime";
2
+ //#region extensions/tlon/src/doctor-contract.ts
3
+ const contract = createLegacyPrivateNetworkDoctorContract({ channelKey: "tlon" });
4
+ const legacyConfigRules = contract.legacyConfigRules;
5
+ const normalizeCompatibilityConfig = contract.normalizeCompatibilityConfig;
6
+ //#endregion
7
+ export { normalizeCompatibilityConfig as n, legacyConfigRules as t };
@@ -0,0 +1,2 @@
1
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-W99wMbar.js";
2
+ export { legacyConfigRules, normalizeCompatibilityConfig };
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
+ //#region extensions/tlon/index.ts
3
+ var tlon_default = defineBundledChannelEntry({
4
+ id: "tlon",
5
+ name: "Tlon",
6
+ description: "Tlon/Urbit channel plugin",
7
+ importMetaUrl: import.meta.url,
8
+ plugin: {
9
+ specifier: "./channel-plugin-api.js",
10
+ exportName: "tlonPlugin"
11
+ },
12
+ runtime: {
13
+ specifier: "./api.js",
14
+ exportName: "setTlonRuntime"
15
+ }
16
+ });
17
+ //#endregion
18
+ export { tlon_default as default };
@@ -0,0 +1,8 @@
1
+ import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
2
+ //#region extensions/tlon/src/runtime.ts
3
+ const { setRuntime: setTlonRuntime, getRuntime: getTlonRuntime } = createPluginRuntimeStore({
4
+ pluginId: "tlon",
5
+ errorMessage: "Tlon runtime not initialized"
6
+ });
7
+ //#endregion
8
+ export { setTlonRuntime as n, getTlonRuntime as t };
@@ -0,0 +1,4 @@
1
+ import { createDedupeCache } from "openclaw/plugin-sdk/core";
2
+ import { createLoggerBackedRuntime } from "openclaw/plugin-sdk/runtime-logger";
3
+ import { SsrFBlockedError, fetchWithSsrFGuard as fetchWithSsrFGuard$1, isBlockedHostnameOrIp as isBlockedHostnameOrIp$1, ssrfPolicyFromAllowPrivateNetwork, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
4
+ export { ssrfPolicyFromAllowPrivateNetwork as a, isBlockedHostnameOrIp$1 as i, createDedupeCache as n, ssrfPolicyFromDangerouslyAllowPrivateNetwork as o, fetchWithSsrFGuard$1 as r, createLoggerBackedRuntime as s, SsrFBlockedError as t };
@@ -0,0 +1,2 @@
1
+ import { a as ssrfPolicyFromAllowPrivateNetwork, i as isBlockedHostnameOrIp, n as createDedupeCache, o as ssrfPolicyFromDangerouslyAllowPrivateNetwork, r as fetchWithSsrFGuard, s as createLoggerBackedRuntime, t as SsrFBlockedError } from "./runtime-api-C0hr1Rtn.js";
2
+ export { SsrFBlockedError, createDedupeCache, createLoggerBackedRuntime, fetchWithSsrFGuard, isBlockedHostnameOrIp, ssrfPolicyFromAllowPrivateNetwork, ssrfPolicyFromDangerouslyAllowPrivateNetwork };
@@ -0,0 +1,3 @@
1
+ import { a as tlonSetupAdapter } from "./setup-core-BUkZJ-MU.js";
2
+ import { t as tlonSetupWizard } from "./setup-surface-FxNMaluC.js";
3
+ export { tlonSetupAdapter, tlonSetupWizard };
@@ -0,0 +1,386 @@
1
+ import { hasLegacyFlatAllowPrivateNetworkAlias, isBlockedHostnameOrIp, isPrivateNetworkOptInEnabled } from "openclaw/plugin-sdk/ssrf-runtime";
2
+ import { DEFAULT_ACCOUNT_ID, createSetupInputPresenceValidator, formatDocsLink, normalizeAccountId, patchScopedAccountConfig, prepareScopedSetupConfig } from "openclaw/plugin-sdk/setup";
3
+ import { normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/text-runtime";
4
+ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, listCombinedAccountIds, normalizeAccountId as normalizeAccountId$1, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
5
+ //#region extensions/tlon/src/targets.ts
6
+ const SHIP_RE = /^~?[a-z-]+$/i;
7
+ const NEST_RE = /^chat\/([^/]+)\/([^/]+)$/i;
8
+ function normalizeShip(raw) {
9
+ const trimmed = raw.trim();
10
+ if (!trimmed) return trimmed;
11
+ return trimmed.startsWith("~") ? trimmed : `~${trimmed}`;
12
+ }
13
+ function parseChannelNest(raw) {
14
+ const match = NEST_RE.exec(raw.trim());
15
+ if (!match) return null;
16
+ return {
17
+ hostShip: normalizeShip(match[1]),
18
+ channelName: match[2]
19
+ };
20
+ }
21
+ function makeGroupTarget(parsed) {
22
+ return {
23
+ kind: "group",
24
+ nest: `chat/${parsed.hostShip}/${parsed.channelName}`,
25
+ hostShip: parsed.hostShip,
26
+ channelName: parsed.channelName
27
+ };
28
+ }
29
+ function parseTlonTarget(raw) {
30
+ const trimmed = raw?.trim();
31
+ if (!trimmed) return null;
32
+ const withoutPrefix = trimmed.replace(/^tlon:/i, "");
33
+ const dmPrefix = withoutPrefix.match(/^dm[/:](.+)$/i);
34
+ if (dmPrefix) return {
35
+ kind: "dm",
36
+ ship: normalizeShip(dmPrefix[1])
37
+ };
38
+ const groupPrefix = withoutPrefix.match(/^(group|room)[/:](.+)$/i);
39
+ if (groupPrefix) {
40
+ const groupTarget = groupPrefix[2].trim();
41
+ if (groupTarget.startsWith("chat/")) {
42
+ const parsed = parseChannelNest(groupTarget);
43
+ if (!parsed) return null;
44
+ return makeGroupTarget(parsed);
45
+ }
46
+ const parts = groupTarget.split("/");
47
+ if (parts.length === 2) {
48
+ const hostShip = normalizeShip(parts[0]);
49
+ const channelName = parts[1];
50
+ return {
51
+ kind: "group",
52
+ nest: `chat/${hostShip}/${channelName}`,
53
+ hostShip,
54
+ channelName
55
+ };
56
+ }
57
+ return null;
58
+ }
59
+ if (withoutPrefix.startsWith("chat/")) {
60
+ const parsed = parseChannelNest(withoutPrefix);
61
+ if (!parsed) return null;
62
+ return makeGroupTarget(parsed);
63
+ }
64
+ if (SHIP_RE.test(withoutPrefix)) return {
65
+ kind: "dm",
66
+ ship: normalizeShip(withoutPrefix)
67
+ };
68
+ return null;
69
+ }
70
+ function resolveTlonOutboundTarget(to) {
71
+ const parsed = parseTlonTarget(to ?? "");
72
+ if (!parsed) return {
73
+ ok: false,
74
+ error: /* @__PURE__ */ new Error(`Invalid Tlon target. Use ${formatTargetHint()}`)
75
+ };
76
+ if (parsed.kind === "dm") return {
77
+ ok: true,
78
+ to: parsed.ship
79
+ };
80
+ return {
81
+ ok: true,
82
+ to: parsed.nest
83
+ };
84
+ }
85
+ function formatTargetHint() {
86
+ return "dm/~sampel-palnet | ~sampel-palnet | chat/~host-ship/channel | group:~host-ship/channel";
87
+ }
88
+ //#endregion
89
+ //#region extensions/tlon/src/account-fields.ts
90
+ function buildTlonAccountFields(input) {
91
+ return {
92
+ ...input.ship ? { ship: input.ship } : {},
93
+ ...input.url ? { url: input.url } : {},
94
+ ...input.code ? { code: input.code } : {},
95
+ ...typeof input.dangerouslyAllowPrivateNetwork === "boolean" ? { network: { dangerouslyAllowPrivateNetwork: input.dangerouslyAllowPrivateNetwork } } : {},
96
+ ...input.groupChannels ? { groupChannels: input.groupChannels } : {},
97
+ ...input.dmAllowlist ? { dmAllowlist: input.dmAllowlist } : {},
98
+ ...typeof input.autoDiscoverChannels === "boolean" ? { autoDiscoverChannels: input.autoDiscoverChannels } : {},
99
+ ...input.ownerShip ? { ownerShip: input.ownerShip } : {}
100
+ };
101
+ }
102
+ //#endregion
103
+ //#region extensions/tlon/src/types.ts
104
+ function resolveTlonChannelConfig(cfg) {
105
+ return cfg.channels?.tlon;
106
+ }
107
+ function resolveMergedTlonAccountConfig(cfg, accountId) {
108
+ const channel = resolveTlonChannelConfig(cfg);
109
+ if (accountId === DEFAULT_ACCOUNT_ID$1) return channel ?? {};
110
+ return resolveMergedAccountConfig({
111
+ channelConfig: channel ?? {},
112
+ accounts: channel?.accounts,
113
+ accountId,
114
+ normalizeAccountId: normalizeAccountId$1
115
+ });
116
+ }
117
+ function resolveTlonAccount(cfg, accountId) {
118
+ const resolvedAccountId = normalizeAccountId$1(accountId);
119
+ if (!resolveTlonChannelConfig(cfg)) return {
120
+ accountId: resolvedAccountId,
121
+ name: null,
122
+ enabled: false,
123
+ configured: false,
124
+ ship: null,
125
+ url: null,
126
+ code: null,
127
+ dangerouslyAllowPrivateNetwork: null,
128
+ groupChannels: [],
129
+ dmAllowlist: [],
130
+ groupInviteAllowlist: [],
131
+ autoDiscoverChannels: null,
132
+ showModelSignature: null,
133
+ autoAcceptDmInvites: null,
134
+ autoAcceptGroupInvites: null,
135
+ defaultAuthorizedShips: [],
136
+ ownerShip: null
137
+ };
138
+ const merged = resolveMergedTlonAccountConfig(cfg, resolvedAccountId);
139
+ const ship = merged.ship ?? null;
140
+ const url = merged.url ?? null;
141
+ const code = merged.code ?? null;
142
+ const dangerouslyAllowPrivateNetwork = isPrivateNetworkOptInEnabled(merged) ? true : typeof merged.network?.dangerouslyAllowPrivateNetwork === "boolean" ? merged.network.dangerouslyAllowPrivateNetwork : hasLegacyFlatAllowPrivateNetworkAlias(merged) && typeof merged.allowPrivateNetwork === "boolean" ? merged.allowPrivateNetwork : null;
143
+ const groupChannels = merged.groupChannels ?? [];
144
+ const dmAllowlist = merged.dmAllowlist ?? [];
145
+ const groupInviteAllowlist = merged.groupInviteAllowlist ?? [];
146
+ const autoDiscoverChannels = merged.autoDiscoverChannels ?? null;
147
+ const showModelSignature = merged.showModelSignature ?? null;
148
+ const autoAcceptDmInvites = merged.autoAcceptDmInvites ?? null;
149
+ const autoAcceptGroupInvites = merged.autoAcceptGroupInvites ?? null;
150
+ const ownerShip = merged.ownerShip ?? null;
151
+ const defaultAuthorizedShips = merged.defaultAuthorizedShips ?? [];
152
+ const configured = Boolean(ship && url && code);
153
+ return {
154
+ accountId: resolvedAccountId,
155
+ name: merged.name ?? null,
156
+ enabled: merged.enabled !== false,
157
+ configured,
158
+ ship,
159
+ url,
160
+ code,
161
+ dangerouslyAllowPrivateNetwork,
162
+ groupChannels,
163
+ dmAllowlist,
164
+ groupInviteAllowlist,
165
+ autoDiscoverChannels,
166
+ showModelSignature,
167
+ autoAcceptDmInvites,
168
+ autoAcceptGroupInvites,
169
+ defaultAuthorizedShips,
170
+ ownerShip
171
+ };
172
+ }
173
+ function listTlonAccountIds(cfg) {
174
+ const base = resolveTlonChannelConfig(cfg);
175
+ if (!base) return [];
176
+ return listCombinedAccountIds({
177
+ configuredAccountIds: Object.keys(base.accounts ?? {}).map(normalizeAccountId$1),
178
+ implicitAccountId: base.ship ? DEFAULT_ACCOUNT_ID$1 : void 0
179
+ });
180
+ }
181
+ //#endregion
182
+ //#region extensions/tlon/src/urbit/base-url.ts
183
+ function hasScheme(value) {
184
+ return /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(value);
185
+ }
186
+ function normalizeUrbitHostname(hostname) {
187
+ return (hostname ?? "").trim().toLowerCase().replace(/\.$/, "");
188
+ }
189
+ function validateUrbitBaseUrl(raw) {
190
+ const trimmed = raw.trim();
191
+ if (!trimmed) return {
192
+ ok: false,
193
+ error: "Required"
194
+ };
195
+ const candidate = hasScheme(trimmed) ? trimmed : `https://${trimmed}`;
196
+ let parsed;
197
+ try {
198
+ parsed = new URL(candidate);
199
+ } catch {
200
+ return {
201
+ ok: false,
202
+ error: "Invalid URL"
203
+ };
204
+ }
205
+ if (!["http:", "https:"].includes(parsed.protocol)) return {
206
+ ok: false,
207
+ error: "URL must use http:// or https://"
208
+ };
209
+ if (parsed.username || parsed.password) return {
210
+ ok: false,
211
+ error: "URL must not include credentials"
212
+ };
213
+ const hostname = normalizeUrbitHostname(parsed.hostname);
214
+ if (!hostname) return {
215
+ ok: false,
216
+ error: "Invalid hostname"
217
+ };
218
+ const isIpv6 = hostname.includes(":");
219
+ const host = parsed.port ? `${isIpv6 ? `[${hostname}]` : hostname}:${parsed.port}` : isIpv6 ? `[${hostname}]` : hostname;
220
+ return {
221
+ ok: true,
222
+ baseUrl: `${parsed.protocol}//${host}`,
223
+ hostname
224
+ };
225
+ }
226
+ function isBlockedUrbitHostname(hostname) {
227
+ const normalized = normalizeUrbitHostname(hostname);
228
+ if (!normalized) return false;
229
+ return isBlockedHostnameOrIp(normalized);
230
+ }
231
+ //#endregion
232
+ //#region extensions/tlon/src/setup-core.ts
233
+ function tlonChannelId() {
234
+ return "tlon";
235
+ }
236
+ function isConfigured(account) {
237
+ return Boolean(account.ship && account.url && account.code);
238
+ }
239
+ function createTlonSetupWizardBase(params) {
240
+ return {
241
+ channel: tlonChannelId(),
242
+ status: {
243
+ configuredLabel: "configured",
244
+ unconfiguredLabel: "needs setup",
245
+ configuredHint: "configured",
246
+ unconfiguredHint: "urbit messenger",
247
+ configuredScore: 1,
248
+ unconfiguredScore: 4,
249
+ resolveConfigured: ({ cfg, accountId }) => params.resolveConfigured({
250
+ cfg,
251
+ accountId
252
+ }),
253
+ resolveStatusLines: ({ cfg, accountId, configured }) => params.resolveStatusLines?.({
254
+ cfg,
255
+ accountId,
256
+ configured
257
+ }) ?? []
258
+ },
259
+ introNote: {
260
+ title: "Tlon setup",
261
+ lines: [
262
+ "You need your Urbit ship URL and login code.",
263
+ "Example URL: https://your-ship-host",
264
+ "Example ship: ~sampel-palnet",
265
+ "If your ship URL is on a private network (LAN/localhost), you must explicitly allow it during setup.",
266
+ `Docs: ${formatDocsLink("/channels/tlon", "channels/tlon")}`
267
+ ]
268
+ },
269
+ credentials: [],
270
+ textInputs: [
271
+ {
272
+ inputKey: "ship",
273
+ message: "Ship name",
274
+ placeholder: "~sampel-palnet",
275
+ currentValue: ({ cfg, accountId }) => resolveTlonAccount(cfg, accountId).ship ?? void 0,
276
+ validate: ({ value }) => normalizeStringifiedOptionalString(value) ? void 0 : "Required",
277
+ normalizeValue: ({ value }) => normalizeShip(normalizeStringifiedOptionalString(value) ?? ""),
278
+ applySet: async ({ cfg, accountId, value }) => applyTlonSetupConfig({
279
+ cfg,
280
+ accountId,
281
+ input: { ship: value }
282
+ })
283
+ },
284
+ {
285
+ inputKey: "url",
286
+ message: "Ship URL",
287
+ placeholder: "https://your-ship-host",
288
+ currentValue: ({ cfg, accountId }) => resolveTlonAccount(cfg, accountId).url ?? void 0,
289
+ validate: ({ value }) => {
290
+ const next = validateUrbitBaseUrl(value ?? "");
291
+ if (!next.ok) return next.error;
292
+ },
293
+ normalizeValue: ({ value }) => normalizeStringifiedOptionalString(value) ?? "",
294
+ applySet: async ({ cfg, accountId, value }) => applyTlonSetupConfig({
295
+ cfg,
296
+ accountId,
297
+ input: { url: value }
298
+ })
299
+ },
300
+ {
301
+ inputKey: "code",
302
+ message: "Login code",
303
+ placeholder: "lidlut-tabwed-pillex-ridrup",
304
+ currentValue: ({ cfg, accountId }) => resolveTlonAccount(cfg, accountId).code ?? void 0,
305
+ validate: ({ value }) => normalizeStringifiedOptionalString(value) ? void 0 : "Required",
306
+ normalizeValue: ({ value }) => normalizeStringifiedOptionalString(value) ?? "",
307
+ applySet: async ({ cfg, accountId, value }) => applyTlonSetupConfig({
308
+ cfg,
309
+ accountId,
310
+ input: { code: value }
311
+ })
312
+ }
313
+ ],
314
+ finalize: params.finalize
315
+ };
316
+ }
317
+ async function resolveTlonSetupConfigured(cfg, accountId) {
318
+ if (accountId) return isConfigured(resolveTlonAccount(cfg, accountId));
319
+ const accountIds = listTlonAccountIds(cfg);
320
+ return accountIds.length > 0 ? accountIds.some((resolvedAccountId) => isConfigured(resolveTlonAccount(cfg, resolvedAccountId))) : isConfigured(resolveTlonAccount(cfg, DEFAULT_ACCOUNT_ID));
321
+ }
322
+ async function resolveTlonSetupStatusLines(cfg, accountId) {
323
+ const configured = await resolveTlonSetupConfigured(cfg, accountId);
324
+ return [`${accountId && accountId !== DEFAULT_ACCOUNT_ID ? `Tlon (${accountId})` : "Tlon"}: ${configured ? "configured" : "needs setup"}`];
325
+ }
326
+ function applyTlonSetupConfig(params) {
327
+ const { cfg, accountId, input } = params;
328
+ const useDefault = accountId === DEFAULT_ACCOUNT_ID;
329
+ const namedConfig = prepareScopedSetupConfig({
330
+ cfg,
331
+ channelKey: tlonChannelId(),
332
+ accountId,
333
+ name: input.name
334
+ });
335
+ const base = namedConfig.channels?.tlon ?? {};
336
+ const payload = buildTlonAccountFields(input);
337
+ if (useDefault) return {
338
+ ...namedConfig,
339
+ channels: {
340
+ ...namedConfig.channels,
341
+ tlon: {
342
+ ...base,
343
+ enabled: true,
344
+ ...payload
345
+ }
346
+ }
347
+ };
348
+ return patchScopedAccountConfig({
349
+ cfg: namedConfig,
350
+ channelKey: tlonChannelId(),
351
+ accountId,
352
+ patch: { enabled: base.enabled ?? true },
353
+ accountPatch: {
354
+ enabled: true,
355
+ ...payload
356
+ },
357
+ ensureChannelEnabled: false,
358
+ ensureAccountEnabled: false
359
+ });
360
+ }
361
+ const tlonSetupAdapter = {
362
+ resolveAccountId: ({ accountId }) => normalizeAccountId(accountId),
363
+ applyAccountName: ({ cfg, accountId, name }) => prepareScopedSetupConfig({
364
+ cfg,
365
+ channelKey: tlonChannelId(),
366
+ accountId,
367
+ name
368
+ }),
369
+ validateInput: createSetupInputPresenceValidator({ validate: ({ cfg, accountId, input }) => {
370
+ const resolved = resolveTlonAccount(cfg, accountId ?? void 0);
371
+ const ship = normalizeOptionalString(input.ship) || resolved.ship;
372
+ const url = normalizeOptionalString(input.url) || resolved.url;
373
+ const code = normalizeOptionalString(input.code) || resolved.code;
374
+ if (!ship) return "Tlon requires --ship.";
375
+ if (!url) return "Tlon requires --url.";
376
+ if (!code) return "Tlon requires --code.";
377
+ return null;
378
+ } }),
379
+ applyAccountConfig: ({ cfg, accountId, input }) => applyTlonSetupConfig({
380
+ cfg,
381
+ accountId,
382
+ input
383
+ })
384
+ };
385
+ //#endregion
386
+ export { tlonSetupAdapter as a, validateUrbitBaseUrl as c, formatTargetHint as d, normalizeShip as f, resolveTlonOutboundTarget as h, resolveTlonSetupStatusLines as i, listTlonAccountIds as l, parseTlonTarget as m, createTlonSetupWizardBase as n, isBlockedUrbitHostname as o, parseChannelNest as p, resolveTlonSetupConfigured as r, normalizeUrbitHostname as s, applyTlonSetupConfig as t, resolveTlonAccount as u };
@@ -0,0 +1,11 @@
1
+ import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
+ //#region extensions/tlon/setup-entry.ts
3
+ var setup_entry_default = defineBundledChannelSetupEntry({
4
+ importMetaUrl: import.meta.url,
5
+ plugin: {
6
+ specifier: "./api.js",
7
+ exportName: "tlonPlugin"
8
+ }
9
+ });
10
+ //#endregion
11
+ export { setup_entry_default as default };
@@ -0,0 +1,72 @@
1
+ import { c as validateUrbitBaseUrl, f as normalizeShip, i as resolveTlonSetupStatusLines, n as createTlonSetupWizardBase, o as isBlockedUrbitHostname, r as resolveTlonSetupConfigured, t as applyTlonSetupConfig, u as resolveTlonAccount } from "./setup-core-BUkZJ-MU.js";
2
+ //#region extensions/tlon/src/setup-surface.ts
3
+ function parseList(value) {
4
+ return value.split(/[\n,;]+/g).map((entry) => entry.trim()).filter(Boolean);
5
+ }
6
+ const tlonSetupWizard = createTlonSetupWizardBase({
7
+ resolveConfigured: async ({ cfg, accountId }) => await resolveTlonSetupConfigured(cfg, accountId),
8
+ resolveStatusLines: async ({ cfg, accountId }) => await resolveTlonSetupStatusLines(cfg, accountId),
9
+ finalize: async ({ cfg, accountId, prompter }) => {
10
+ let next = cfg;
11
+ const resolved = resolveTlonAccount(next, accountId);
12
+ const validatedUrl = validateUrbitBaseUrl(resolved.url ?? "");
13
+ if (!validatedUrl.ok) throw new Error(`Invalid URL: ${validatedUrl.error}`);
14
+ let dangerouslyAllowPrivateNetwork = resolved.dangerouslyAllowPrivateNetwork ?? false;
15
+ if (isBlockedUrbitHostname(validatedUrl.hostname)) {
16
+ dangerouslyAllowPrivateNetwork = await prompter.confirm({
17
+ message: "Ship URL looks like a private/internal host. Allow private network access? (SSRF risk)",
18
+ initialValue: dangerouslyAllowPrivateNetwork
19
+ });
20
+ if (!dangerouslyAllowPrivateNetwork) throw new Error("Refusing private/internal ship URL without explicit network opt-in");
21
+ }
22
+ next = applyTlonSetupConfig({
23
+ cfg: next,
24
+ accountId,
25
+ input: { dangerouslyAllowPrivateNetwork }
26
+ });
27
+ const currentGroups = resolved.groupChannels;
28
+ if (await prompter.confirm({
29
+ message: "Add group channels manually? (optional)",
30
+ initialValue: currentGroups.length > 0
31
+ })) {
32
+ const entry = await prompter.text({
33
+ message: "Group channels (comma-separated)",
34
+ placeholder: "chat/~host-ship/general, chat/~host-ship/support",
35
+ initialValue: currentGroups.join(", ") || void 0
36
+ });
37
+ next = applyTlonSetupConfig({
38
+ cfg: next,
39
+ accountId,
40
+ input: { groupChannels: parseList(entry ?? "") }
41
+ });
42
+ }
43
+ const currentAllowlist = resolved.dmAllowlist;
44
+ if (await prompter.confirm({
45
+ message: "Restrict DMs with an allowlist?",
46
+ initialValue: currentAllowlist.length > 0
47
+ })) {
48
+ const entry = await prompter.text({
49
+ message: "DM allowlist (comma-separated ship names)",
50
+ placeholder: "~zod, ~nec",
51
+ initialValue: currentAllowlist.join(", ") || void 0
52
+ });
53
+ next = applyTlonSetupConfig({
54
+ cfg: next,
55
+ accountId,
56
+ input: { dmAllowlist: parseList(entry ?? "").map((ship) => normalizeShip(ship)) }
57
+ });
58
+ }
59
+ const autoDiscoverChannels = await prompter.confirm({
60
+ message: "Enable auto-discovery of group channels?",
61
+ initialValue: resolved.autoDiscoverChannels ?? true
62
+ });
63
+ next = applyTlonSetupConfig({
64
+ cfg: next,
65
+ accountId,
66
+ input: { autoDiscoverChannels }
67
+ });
68
+ return { cfg: next };
69
+ }
70
+ });
71
+ //#endregion
72
+ export { tlonSetupWizard as t };
@@ -0,0 +1,2 @@
1
+ import { t as tlonPlugin } from "./channel-B4LtNGeZ.js";
2
+ export { tlonPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/tlon",
3
- "version": "2026.5.2",
3
+ "version": "2026.5.3-beta.2",
4
4
  "description": "OpenClaw Tlon/Urbit channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  "openclaw": "workspace:*"
19
19
  },
20
20
  "peerDependencies": {
21
- "openclaw": ">=2026.5.2"
21
+ "openclaw": ">=2026.5.3-beta.2"
22
22
  },
23
23
  "peerDependenciesMeta": {
24
24
  "openclaw": {
@@ -72,14 +72,23 @@
72
72
  "minHostVersion": ">=2026.4.10"
73
73
  },
74
74
  "compat": {
75
- "pluginApi": ">=2026.5.2"
75
+ "pluginApi": ">=2026.5.3-beta.2"
76
76
  },
77
77
  "build": {
78
- "openclawVersion": "2026.5.2"
78
+ "openclawVersion": "2026.5.3-beta.2"
79
79
  },
80
80
  "release": {
81
81
  "publishToClawHub": true,
82
82
  "publishToNpm": true
83
- }
84
- }
83
+ },
84
+ "runtimeExtensions": [
85
+ "./dist/index.js"
86
+ ],
87
+ "runtimeSetupEntry": "./dist/setup-entry.js"
88
+ },
89
+ "files": [
90
+ "dist/**",
91
+ "openclaw.plugin.json",
92
+ "README.md"
93
+ ]
85
94
  }
package/api.ts DELETED
@@ -1,16 +0,0 @@
1
- export {
2
- createDedupeCache,
3
- createLoggerBackedRuntime,
4
- fetchWithSsrFGuard,
5
- isBlockedHostnameOrIp,
6
- type LookupFn,
7
- type OpenClawConfig,
8
- type ReplyPayload,
9
- type RuntimeEnv,
10
- SsrFBlockedError,
11
- type SsrFPolicy,
12
- ssrfPolicyFromAllowPrivateNetwork,
13
- ssrfPolicyFromDangerouslyAllowPrivateNetwork,
14
- } from "./runtime-api.js";
15
- export { tlonPlugin } from "./src/channel.js";
16
- export { setTlonRuntime } from "./src/runtime.js";
@@ -1 +0,0 @@
1
- export { tlonPlugin } from "./src/channel.js";
@@ -1 +0,0 @@
1
- export { normalizeCompatibilityConfig, legacyConfigRules } from "./src/doctor-contract.js";