@openclaw/meta-provider 2026.10.5-beta.4 → 2026.10.10-beta.1
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/dist/.setup/{provider-catalog-BNTlqvTm.mjs → provider-catalog-Drud68bm.mjs} +12 -1
- package/dist/api.js +1 -1
- package/dist/index.js +9 -1
- package/dist/muse-login.js +114 -0
- package/dist/onboard.js +1 -1
- package/dist/provider-catalog.js +1 -2
- package/dist/stream.js +1 -1
- package/dist/thinking.js +1 -1
- package/openclaw.plugin.json +14 -1
- package/package.json +4 -4
|
@@ -226,7 +226,7 @@ var openclaw_plugin_default = {
|
|
|
226
226
|
},
|
|
227
227
|
setup: { "providers": [{
|
|
228
228
|
"id": "meta",
|
|
229
|
-
"authMethods": ["api-key"],
|
|
229
|
+
"authMethods": ["api-key", "muse-code"],
|
|
230
230
|
"envVars": ["MODEL_API_KEY"]
|
|
231
231
|
}] },
|
|
232
232
|
providerAuthChoices: [{
|
|
@@ -244,6 +244,17 @@ var openclaw_plugin_default = {
|
|
|
244
244
|
"cliFlag": "--meta-api-key",
|
|
245
245
|
"cliOption": "--meta-api-key <key>",
|
|
246
246
|
"cliDescription": "Meta API key"
|
|
247
|
+
}, {
|
|
248
|
+
"provider": "meta",
|
|
249
|
+
"method": "muse-code",
|
|
250
|
+
"choiceId": "muse-code",
|
|
251
|
+
"appGuidedAuth": "device-code",
|
|
252
|
+
"choiceLabel": "Muse Code",
|
|
253
|
+
"choiceHint": "Sign in with Meta in your browser",
|
|
254
|
+
"groupId": "meta",
|
|
255
|
+
"groupLabel": "Meta",
|
|
256
|
+
"groupHint": "Meta API or Muse Code sign-in",
|
|
257
|
+
"onboardingFeatured": true
|
|
247
258
|
}],
|
|
248
259
|
configSchema: {
|
|
249
260
|
"type": "object",
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as buildMetaProvider, n as META_MODEL_CATALOG, r as buildMetaCatalogModels, t as META_BASE_URL } from "./.setup/provider-catalog-
|
|
1
|
+
import { i as buildMetaProvider, n as META_MODEL_CATALOG, r as buildMetaCatalogModels, t as META_BASE_URL } from "./.setup/provider-catalog-Drud68bm.mjs";
|
|
2
2
|
import { META_DEFAULT_MODEL_REF, applyMetaConfig } from "./onboard.js";
|
|
3
3
|
export { META_BASE_URL, META_DEFAULT_MODEL_REF, META_MODEL_CATALOG, applyMetaConfig, buildMetaCatalogModels, buildMetaProvider };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runMuseLogin } from "./muse-login.js";
|
|
2
|
+
import { a as openclaw_plugin_default } from "./.setup/provider-catalog-Drud68bm.mjs";
|
|
2
3
|
import { applyMetaConnectionConfig } from "./onboard.js";
|
|
3
4
|
import { wrapMetaProviderStream } from "./stream.js";
|
|
4
5
|
import { resolveMetaThinkingProfile } from "./thinking.js";
|
|
@@ -17,6 +18,13 @@ var meta_default = defineSingleProviderPluginEntry({
|
|
|
17
18
|
noteMessage: "Meta provides Responses API inference.",
|
|
18
19
|
noteTitle: "Meta"
|
|
19
20
|
},
|
|
21
|
+
extraAuth: [{
|
|
22
|
+
id: "muse-code",
|
|
23
|
+
label: "Muse Code",
|
|
24
|
+
kind: "device_code",
|
|
25
|
+
starterModel: "meta/muse-spark-1.3",
|
|
26
|
+
run: runMuseLogin
|
|
27
|
+
}],
|
|
20
28
|
catalog: {
|
|
21
29
|
discoveryMode: "strict",
|
|
22
30
|
liveModelDiscovery: true
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { stripVTControlCharacters } from "node:util";
|
|
4
|
+
import { createDeferred } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
5
|
+
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
|
6
|
+
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
+
//#region extensions/meta/muse-login.ts
|
|
8
|
+
const DEFAULT_MODEL = "meta/muse-spark-1.3";
|
|
9
|
+
const INSTALL_COMMAND = "curl -fsSL https://dev.meta.ai/install.sh | bash";
|
|
10
|
+
async function loginAttempt(ctx, binaryPath) {
|
|
11
|
+
ctx.signal?.throwIfAborted();
|
|
12
|
+
ctx.assertCurrent?.();
|
|
13
|
+
const env = {
|
|
14
|
+
...ctx.env ?? process.env,
|
|
15
|
+
MUSE_NO_AUTO_UPDATE: "1",
|
|
16
|
+
TBH_CREDENTIAL_BACKEND: "file"
|
|
17
|
+
};
|
|
18
|
+
env.XDG_CONFIG_HOME = path.join(resolveStateDir(env), "muse");
|
|
19
|
+
delete env.META_API_KEY;
|
|
20
|
+
const { promise, resolve, reject } = createDeferred();
|
|
21
|
+
const child = spawn(binaryPath, ["login"], {
|
|
22
|
+
env,
|
|
23
|
+
stdio: [
|
|
24
|
+
"pipe",
|
|
25
|
+
"pipe",
|
|
26
|
+
"pipe"
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
let output = "";
|
|
30
|
+
let presented = false;
|
|
31
|
+
let presentation = Promise.resolve();
|
|
32
|
+
let failure;
|
|
33
|
+
let killTimer;
|
|
34
|
+
let authorityTimer;
|
|
35
|
+
const stop = (error) => {
|
|
36
|
+
failure ??= error;
|
|
37
|
+
clearInterval(authorityTimer);
|
|
38
|
+
child.kill("SIGTERM");
|
|
39
|
+
killTimer ??= setTimeout(() => child.kill("SIGKILL"), 1e3);
|
|
40
|
+
killTimer.unref();
|
|
41
|
+
};
|
|
42
|
+
const abort = () => stop(ctx.signal?.reason ?? /* @__PURE__ */ new Error("Muse sign-in cancelled."));
|
|
43
|
+
const timer = setTimeout(() => stop(/* @__PURE__ */ new Error("Muse sign-in timed out. Start sign-in again.")), 6e5);
|
|
44
|
+
timer.unref();
|
|
45
|
+
if (ctx.assertCurrent) {
|
|
46
|
+
authorityTimer = setInterval(() => {
|
|
47
|
+
try {
|
|
48
|
+
ctx.assertCurrent?.();
|
|
49
|
+
} catch (error) {
|
|
50
|
+
stop(error);
|
|
51
|
+
}
|
|
52
|
+
}, 100);
|
|
53
|
+
authorityTimer.unref();
|
|
54
|
+
}
|
|
55
|
+
ctx.signal?.addEventListener("abort", abort, { once: true });
|
|
56
|
+
if (ctx.signal?.aborted) abort();
|
|
57
|
+
const observe = (chunk) => {
|
|
58
|
+
output = (output + stripVTControlCharacters(chunk.toString("utf8"))).slice(-32768);
|
|
59
|
+
if (presented || failure) return;
|
|
60
|
+
const match = /https:\/\/auth\.meta\.com\/oauth\/device\/\?code=([A-Z0-9]+(?:-[A-Z0-9]+)*)/.exec(output);
|
|
61
|
+
if (!match?.[1]) return;
|
|
62
|
+
presented = true;
|
|
63
|
+
const url = match[0];
|
|
64
|
+
const code = match[1];
|
|
65
|
+
presentation = (async () => {
|
|
66
|
+
ctx.signal?.throwIfAborted();
|
|
67
|
+
ctx.assertCurrent?.();
|
|
68
|
+
if (ctx.prompter.deviceCode) await ctx.prompter.deviceCode({
|
|
69
|
+
title: "Authorize Muse Code",
|
|
70
|
+
code
|
|
71
|
+
});
|
|
72
|
+
else await ctx.prompter.note(`Open ${url} and confirm code ${code}.`, "Authorize Muse Code");
|
|
73
|
+
ctx.signal?.throwIfAborted();
|
|
74
|
+
ctx.assertCurrent?.();
|
|
75
|
+
await ctx.openUrl(url);
|
|
76
|
+
})();
|
|
77
|
+
presentation.catch(stop);
|
|
78
|
+
};
|
|
79
|
+
child.stdout.on("data", observe);
|
|
80
|
+
child.stderr.on("data", observe);
|
|
81
|
+
child.stdin.end();
|
|
82
|
+
child.once("error", () => {
|
|
83
|
+
failure ??= /* @__PURE__ */ new Error(`Could not start Muse Code. Install it with: ${INSTALL_COMMAND}`);
|
|
84
|
+
});
|
|
85
|
+
child.once("close", (code) => {
|
|
86
|
+
clearTimeout(timer);
|
|
87
|
+
clearTimeout(killTimer);
|
|
88
|
+
clearInterval(authorityTimer);
|
|
89
|
+
ctx.signal?.removeEventListener("abort", abort);
|
|
90
|
+
if (failure) {
|
|
91
|
+
reject(failure);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
presentation.then(() => {
|
|
95
|
+
resolve(code === 0 && presented);
|
|
96
|
+
}, reject);
|
|
97
|
+
});
|
|
98
|
+
return await promise;
|
|
99
|
+
}
|
|
100
|
+
async function runMuseLogin(ctx) {
|
|
101
|
+
const config = ctx.config.plugins?.entries?.muse?.config;
|
|
102
|
+
const pluginConfig = isRecord(config) ? config : {};
|
|
103
|
+
if (!await loginAttempt(ctx, typeof pluginConfig.binaryPath === "string" ? pluginConfig.binaryPath : "muse")) throw new Error("Muse Code sign-in failed. Start sign-in again and approve the code in your browser.");
|
|
104
|
+
ctx.signal?.throwIfAborted();
|
|
105
|
+
ctx.assertCurrent?.();
|
|
106
|
+
return {
|
|
107
|
+
profiles: [],
|
|
108
|
+
defaultModel: DEFAULT_MODEL,
|
|
109
|
+
agentRuntimeId: "muse",
|
|
110
|
+
configPatch: { plugins: { entries: { muse: { enabled: true } } } }
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { runMuseLogin };
|
package/dist/onboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as openclaw_plugin_default, r as buildMetaCatalogModels, t as META_BASE_URL } from "./.setup/provider-catalog-
|
|
1
|
+
import { a as openclaw_plugin_default, r as buildMetaCatalogModels, t as META_BASE_URL } from "./.setup/provider-catalog-Drud68bm.mjs";
|
|
2
2
|
import { readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
3
3
|
import { createModelCatalogPresetAppliers, createProviderConnectionPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
4
4
|
//#region extensions/meta/onboard.ts
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { META_BASE_URL, META_MODEL_CATALOG, buildMetaCatalogModels, buildMetaProvider };
|
|
1
|
+
export { t as META_BASE_URL, n as META_MODEL_CATALOG, r as buildMetaCatalogModels, i as buildMetaProvider } from "./.setup/provider-catalog-Drud68bm.mjs";
|
package/dist/stream.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
2
1
|
import { filterStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
3
3
|
//#region extensions/meta/stream.ts
|
|
4
4
|
const META_REASONING_ENCRYPTED_CONTENT_INCLUDE = "reasoning.encrypted_content";
|
|
5
5
|
function wrapMetaProviderStream(ctx) {
|
package/dist/thinking.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as META_MODEL_CATALOG } from "./.setup/provider-catalog-
|
|
1
|
+
import { n as META_MODEL_CATALOG } from "./.setup/provider-catalog-Drud68bm.mjs";
|
|
2
2
|
//#region extensions/meta/thinking.ts
|
|
3
3
|
const META_REASONING_MODELS = new Map(META_MODEL_CATALOG.filter((model) => model.reasoning).map((model) => [model.id.toLowerCase(), model]));
|
|
4
4
|
const META_THINKING_PROFILE = {
|
package/openclaw.plugin.json
CHANGED
|
@@ -265,7 +265,8 @@
|
|
|
265
265
|
{
|
|
266
266
|
"id": "meta",
|
|
267
267
|
"authMethods": [
|
|
268
|
-
"api-key"
|
|
268
|
+
"api-key",
|
|
269
|
+
"muse-code"
|
|
269
270
|
],
|
|
270
271
|
"envVars": [
|
|
271
272
|
"MODEL_API_KEY"
|
|
@@ -289,6 +290,18 @@
|
|
|
289
290
|
"cliFlag": "--meta-api-key",
|
|
290
291
|
"cliOption": "--meta-api-key <key>",
|
|
291
292
|
"cliDescription": "Meta API key"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"provider": "meta",
|
|
296
|
+
"method": "muse-code",
|
|
297
|
+
"choiceId": "muse-code",
|
|
298
|
+
"appGuidedAuth": "device-code",
|
|
299
|
+
"choiceLabel": "Muse Code",
|
|
300
|
+
"choiceHint": "Sign in with Meta in your browser",
|
|
301
|
+
"groupId": "meta",
|
|
302
|
+
"groupLabel": "Meta",
|
|
303
|
+
"groupHint": "Meta API or Muse Code sign-in",
|
|
304
|
+
"onboardingFeatured": true
|
|
292
305
|
}
|
|
293
306
|
],
|
|
294
307
|
"configSchema": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/meta-provider",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.10-beta.1",
|
|
4
4
|
"description": "OpenClaw Meta provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.11"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.10.
|
|
21
|
+
"pluginApi": ">=2026.10.10-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.10.
|
|
24
|
+
"openclawVersion": "2026.10.10-beta.1",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"assets/activity.svg"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.10.
|
|
43
|
+
"openclaw": ">=2026.10.10-beta.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|