@openclaw/clickclack 2026.7.2-beta.7 → 2026.7.34
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.
- package/README.md +0 -152
- package/dist/.setup/channel-DGqOQ-o2.mjs +1172 -0
- package/dist/api.js +1 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/index.js +1 -3
- package/dist/runtime-api.js +3 -4
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +21 -129
- package/package.json +6 -94
- package/dist/channel-CECIpaS0.js +0 -1852
- package/dist/doctor-contract-api.js +0 -48
- package/dist/runtime-api-CZ1rmHjv.js +0 -1029
- package/dist/secret-contract-BKkzzjBA.js +0 -35
- package/dist/secret-contract-api.js +0 -2
- package/dist/setup-claim-CP-QZ5bt.js +0 -136
- package/dist/setup-entry.js +0 -15
- package/dist/setup-plugin-api.js +0 -19
- package/dist/setup-surface-DAy8vDJK.js +0 -1131
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
import { collectConditionalChannelFieldAssignments, createChannelSecretTargetRegistryEntries, getChannelSurface, hasConfiguredSecretInputValue } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
3
|
-
//#region extensions/clickclack/src/secret-contract.ts
|
|
4
|
-
const secretTargetRegistryEntries = createChannelSecretTargetRegistryEntries({
|
|
5
|
-
channelKey: "clickclack",
|
|
6
|
-
account: ["token"],
|
|
7
|
-
channel: ["token"]
|
|
8
|
-
});
|
|
9
|
-
function collectRuntimeConfigAssignments(params) {
|
|
10
|
-
const resolved = getChannelSurface(params.config, "clickclack");
|
|
11
|
-
if (!resolved) return;
|
|
12
|
-
const { channel: clickclack, surface } = resolved;
|
|
13
|
-
const baseTokenFile = normalizeOptionalString(clickclack.tokenFile) ?? "";
|
|
14
|
-
const accountTokenFile = (account) => normalizeOptionalString(account.tokenFile) ?? "";
|
|
15
|
-
const hasImplicitDefault = Boolean(normalizeOptionalString(clickclack.baseUrl)) && Boolean(normalizeOptionalString(clickclack.workspace));
|
|
16
|
-
collectConditionalChannelFieldAssignments({
|
|
17
|
-
channelKey: "clickclack",
|
|
18
|
-
field: "token",
|
|
19
|
-
channel: clickclack,
|
|
20
|
-
surface,
|
|
21
|
-
defaults: params.defaults,
|
|
22
|
-
context: params.context,
|
|
23
|
-
topLevelActiveWithoutAccounts: baseTokenFile.length === 0,
|
|
24
|
-
topLevelInheritedAccountActive: ({ account, enabled }) => hasImplicitDefault && baseTokenFile.length === 0 || enabled && baseTokenFile.length === 0 && accountTokenFile(account).length === 0 && !hasConfiguredSecretInputValue(account.token, params.defaults),
|
|
25
|
-
accountActive: ({ account, enabled }) => enabled && accountTokenFile(account).length === 0,
|
|
26
|
-
topInactiveReason: "no enabled ClickClack account inherits this top-level token (tokenFile is configured).",
|
|
27
|
-
accountInactiveReason: "ClickClack account is disabled or tokenFile is configured."
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
const channelSecrets = {
|
|
31
|
-
secretTargetRegistryEntries,
|
|
32
|
-
collectRuntimeConfigAssignments
|
|
33
|
-
};
|
|
34
|
-
//#endregion
|
|
35
|
-
export { collectRuntimeConfigAssignments as n, secretTargetRegistryEntries as r, channelSecrets as t };
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { a as buildClickClackSetupClaimUrl, o as isClickClackSetupLoopbackHost, s as requireClickClackSetupApiBaseUrl } from "./setup-surface-DAy8vDJK.js";
|
|
2
|
-
import { createProviderOperationDeadline, readProviderJsonResponse, readResponseTextLimited, resolveProviderOperationTimeoutMs } from "openclaw/plugin-sdk/provider-http";
|
|
3
|
-
import { fetchWithSsrFGuard, resolvePinnedHostnameWithPolicy, ssrfPolicyFromHttpBaseUrlAllowedHostname } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
4
|
-
import { withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
|
-
//#region extensions/clickclack/src/setup-claim.ts
|
|
6
|
-
const CLICKCLACK_ERROR_BODY_LIMIT_BYTES = 8 * 1024;
|
|
7
|
-
const CLICKCLACK_SETUP_CODE_CLAIM_JSON_LIMIT_BYTES = 64 * 1024;
|
|
8
|
-
const CLICKCLACK_SETUP_CODE_CLAIM_TIMEOUT_MS = 3e4;
|
|
9
|
-
var ClickClackSetupCodeClaimError = class extends Error {
|
|
10
|
-
constructor(status, detail) {
|
|
11
|
-
super(`ClickClack setup code claim failed (${status}): ${detail}`);
|
|
12
|
-
this.status = status;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
function requireRecord(value, label) {
|
|
16
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`ClickClack setup code claim returned invalid ${label}`);
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
19
|
-
function requireString(record, key, label) {
|
|
20
|
-
const value = record[key];
|
|
21
|
-
if (typeof value !== "string" || !value.trim()) throw new Error(`ClickClack setup code claim returned invalid ${label}.${key}`);
|
|
22
|
-
return value;
|
|
23
|
-
}
|
|
24
|
-
function parseClickClackSetupCodeClaim(value, expectedClaimUrl) {
|
|
25
|
-
const claim = requireRecord(value, "response");
|
|
26
|
-
const bot = requireRecord(claim.bot, "bot");
|
|
27
|
-
const workspace = requireRecord(claim.workspace, "workspace");
|
|
28
|
-
const defaults = requireRecord(claim.defaults, "defaults");
|
|
29
|
-
const defaultTo = defaults.defaultTo;
|
|
30
|
-
const allowFrom = defaults.allowFrom;
|
|
31
|
-
const agentActivity = defaults.agentActivity;
|
|
32
|
-
if (defaultTo !== void 0 && typeof defaultTo !== "string") throw new Error("ClickClack setup code claim returned invalid defaults.defaultTo");
|
|
33
|
-
if (allowFrom !== void 0 && (!Array.isArray(allowFrom) || !allowFrom.every((entry) => typeof entry === "string"))) throw new Error("ClickClack setup code claim returned invalid defaults.allowFrom");
|
|
34
|
-
if (agentActivity !== void 0 && typeof agentActivity !== "boolean") throw new Error("ClickClack setup code claim returned invalid defaults.agentActivity");
|
|
35
|
-
const contractVersion = claim.contract_version;
|
|
36
|
-
const apiBaseUrlValue = claim.api_base_url;
|
|
37
|
-
const hasContractMetadata = contractVersion !== void 0 || apiBaseUrlValue !== void 0;
|
|
38
|
-
if (expectedClaimUrl && !hasContractMetadata) throw new Error("ClickClack setup code claim returned a legacy response for an exact endpoint");
|
|
39
|
-
let contract = {};
|
|
40
|
-
if (hasContractMetadata) {
|
|
41
|
-
if (contractVersion !== 1 || typeof apiBaseUrlValue !== "string") throw new Error("ClickClack setup code claim returned invalid v1 contract metadata");
|
|
42
|
-
const apiBaseUrl = requireClickClackSetupApiBaseUrl(apiBaseUrlValue, "setup code claim response.api_base_url");
|
|
43
|
-
const canonicalClaimUrl = buildClickClackSetupClaimUrl(apiBaseUrl);
|
|
44
|
-
if (expectedClaimUrl && expectedClaimUrl !== canonicalClaimUrl) throw new Error("ClickClack setup code claim returned an API base that does not match the claim URL");
|
|
45
|
-
contract = {
|
|
46
|
-
contract_version: 1,
|
|
47
|
-
api_base_url: apiBaseUrl
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
...contract,
|
|
52
|
-
token: requireString(claim, "token", "response"),
|
|
53
|
-
bot: {
|
|
54
|
-
id: requireString(bot, "id", "bot"),
|
|
55
|
-
handle: requireString(bot, "handle", "bot"),
|
|
56
|
-
display_name: requireString(bot, "display_name", "bot")
|
|
57
|
-
},
|
|
58
|
-
workspace: {
|
|
59
|
-
id: requireString(workspace, "id", "workspace"),
|
|
60
|
-
route_id: requireString(workspace, "route_id", "workspace"),
|
|
61
|
-
slug: requireString(workspace, "slug", "workspace"),
|
|
62
|
-
name: requireString(workspace, "name", "workspace")
|
|
63
|
-
},
|
|
64
|
-
defaults: {
|
|
65
|
-
...defaultTo !== void 0 ? { defaultTo } : {},
|
|
66
|
-
...allowFrom !== void 0 ? { allowFrom } : {},
|
|
67
|
-
...agentActivity !== void 0 ? { agentActivity } : {}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
/** Claims a one-time setup code without sending any existing bot credential. */
|
|
72
|
-
async function claimClickClackSetupCode(params) {
|
|
73
|
-
let parsedClaimUrl;
|
|
74
|
-
try {
|
|
75
|
-
parsedClaimUrl = new URL(params.claimUrl);
|
|
76
|
-
} catch {
|
|
77
|
-
throw new Error("ClickClack setup code claim URL must be a valid HTTP(S) endpoint.");
|
|
78
|
-
}
|
|
79
|
-
if (parsedClaimUrl.protocol !== "http:" && parsedClaimUrl.protocol !== "https:" || parsedClaimUrl.username || parsedClaimUrl.password || parsedClaimUrl.search || parsedClaimUrl.hash || !parsedClaimUrl.pathname.endsWith("/api/bot-setup-codes/claim")) throw new Error("ClickClack setup code claim URL must be a valid HTTP(S) endpoint.");
|
|
80
|
-
const deadline = createProviderOperationDeadline({
|
|
81
|
-
label: "ClickClack setup code claim",
|
|
82
|
-
timeoutMs: CLICKCLACK_SETUP_CODE_CLAIM_TIMEOUT_MS
|
|
83
|
-
});
|
|
84
|
-
let pinnedHttpTarget;
|
|
85
|
-
if (parsedClaimUrl.protocol === "http:") {
|
|
86
|
-
const resolveTimeoutMs = resolveProviderOperationTimeoutMs({
|
|
87
|
-
deadline,
|
|
88
|
-
defaultTimeoutMs: CLICKCLACK_SETUP_CODE_CLAIM_TIMEOUT_MS
|
|
89
|
-
});
|
|
90
|
-
const pinned = await withTimeout(resolvePinnedHostnameWithPolicy(parsedClaimUrl.hostname, {
|
|
91
|
-
lookupFn: params.lookupFn,
|
|
92
|
-
policy: { dangerouslyAllowPrivateNetwork: true }
|
|
93
|
-
}), resolveTimeoutMs, { message: `ClickClack setup code claim timed out after ${CLICKCLACK_SETUP_CODE_CLAIM_TIMEOUT_MS}ms` });
|
|
94
|
-
if (!pinned.addresses.every((address) => isClickClackSetupLoopbackHost(address))) throw new Error("ClickClack setup codes require HTTPS unless the server is on loopback.");
|
|
95
|
-
pinnedHttpTarget = {
|
|
96
|
-
hostname: pinned.hostname,
|
|
97
|
-
addresses: pinned.addresses
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const { response, release } = await fetchWithSsrFGuard({
|
|
101
|
-
url: params.claimUrl,
|
|
102
|
-
fetchImpl: params.fetch,
|
|
103
|
-
init: {
|
|
104
|
-
method: "POST",
|
|
105
|
-
headers: {
|
|
106
|
-
Accept: "application/json",
|
|
107
|
-
"Content-Type": "application/json"
|
|
108
|
-
},
|
|
109
|
-
body: JSON.stringify({ code: params.code })
|
|
110
|
-
},
|
|
111
|
-
maxRedirects: 0,
|
|
112
|
-
timeoutMs: resolveProviderOperationTimeoutMs({
|
|
113
|
-
deadline,
|
|
114
|
-
defaultTimeoutMs: CLICKCLACK_SETUP_CODE_CLAIM_TIMEOUT_MS
|
|
115
|
-
}),
|
|
116
|
-
requireHttps: parsedClaimUrl.protocol === "https:",
|
|
117
|
-
policy: ssrfPolicyFromHttpBaseUrlAllowedHostname(params.claimUrl),
|
|
118
|
-
lookupFn: params.lookupFn,
|
|
119
|
-
...pinnedHttpTarget ? { dispatcherPolicy: {
|
|
120
|
-
mode: "direct",
|
|
121
|
-
pinnedHostname: pinnedHttpTarget
|
|
122
|
-
} } : {},
|
|
123
|
-
auditContext: "ClickClack setup code claim"
|
|
124
|
-
});
|
|
125
|
-
try {
|
|
126
|
-
if (!response.ok) {
|
|
127
|
-
const detail = await readResponseTextLimited(response, CLICKCLACK_ERROR_BODY_LIMIT_BYTES);
|
|
128
|
-
throw new ClickClackSetupCodeClaimError(response.status, detail);
|
|
129
|
-
}
|
|
130
|
-
return parseClickClackSetupCodeClaim(await readProviderJsonResponse(response, "ClickClack setup code claim", { maxBytes: CLICKCLACK_SETUP_CODE_CLAIM_JSON_LIMIT_BYTES }), params.expectedClaimUrl);
|
|
131
|
-
} finally {
|
|
132
|
-
await release();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
136
|
-
export { claimClickClackSetupCode };
|
package/dist/setup-entry.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
-
//#region extensions/clickclack/setup-entry.ts
|
|
3
|
-
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
4
|
-
importMetaUrl: import.meta.url,
|
|
5
|
-
plugin: {
|
|
6
|
-
specifier: "./setup-plugin-api.js",
|
|
7
|
-
exportName: "clickClackSetupPlugin"
|
|
8
|
-
},
|
|
9
|
-
secrets: {
|
|
10
|
-
specifier: "./secret-contract-api.js",
|
|
11
|
-
exportName: "channelSecrets"
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
//#endregion
|
|
15
|
-
export { setup_entry_default as default };
|
package/dist/setup-plugin-api.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { _ as clickClackMeta, g as clickClackConfigAdapter, m as clickClackConfigSchema, n as clickClackSetupAdapter, r as clickClackSetupContract, t as clickClackSetupWizard } from "./setup-surface-DAy8vDJK.js";
|
|
2
|
-
//#region extensions/clickclack/src/channel.setup.ts
|
|
3
|
-
const clickClackSetupPlugin = {
|
|
4
|
-
id: "clickclack",
|
|
5
|
-
meta: clickClackMeta,
|
|
6
|
-
capabilities: {
|
|
7
|
-
chatTypes: ["direct", "group"],
|
|
8
|
-
threads: true,
|
|
9
|
-
blockStreaming: true
|
|
10
|
-
},
|
|
11
|
-
reload: { configPrefixes: ["channels.clickclack"] },
|
|
12
|
-
configSchema: clickClackConfigSchema,
|
|
13
|
-
config: clickClackConfigAdapter,
|
|
14
|
-
setup: clickClackSetupAdapter,
|
|
15
|
-
setupContract: clickClackSetupContract,
|
|
16
|
-
setupWizard: clickClackSetupWizard
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
|
-
export { clickClackSetupPlugin };
|