pi-meta-oauth 0.7.3 → 0.7.4
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 +2 -2
- package/package.json +5 -5
- package/src/meta/muse-policy.ts +27 -4
- package/src/meta/types.ts +9 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Prefer a static key instead? Set `META_API_KEY` (or `MODEL_API_KEY`) and skip
|
|
|
48
48
|
|
|
49
49
|
## Models
|
|
50
50
|
|
|
51
|
-
Fallback models use a 1,048,576-token context window, up to 256K output tokens, image input, and reasoning levels `minimal`, `low`, `medium`, `high`, and `xhigh` (`muse-spark-1.3` additionally supports `max`; `muse-spark-1.3-contributor` does too when [opted in](#contributor-max-opt-in)).
|
|
51
|
+
Fallback models use a 1,048,576-token context window, up to 256K output tokens, image input, and reasoning levels `minimal`, `low`, `medium`, `high`, and `xhigh` (`muse-spark-1.3` additionally supports `max`; `muse-spark-1.3-contributor` does too when [opted in](#contributor-max-opt-in)). The catalog-discovered `muse-wonder-1.0` and `muse-wonder-full-1.0` also support `max`, as do their `-contributor` variants when opted in.
|
|
52
52
|
|
|
53
53
|
| id | pricing (input/output/cached) $/M |
|
|
54
54
|
| --- | --- |
|
|
@@ -75,7 +75,7 @@ Then open a **new** terminal and restart Pi. Shells that were already open don't
|
|
|
75
75
|
|
|
76
76
|
The header is the same on every OS. The captured string names `linux-x86_64`, but the platform segment doesn't appear to be checked: it was accepted from Windows (2026-09-26), and oh-my-pi sends the same fixed string on every platform.
|
|
77
77
|
|
|
78
|
-
With the flag set, the extension exposes `max` on `muse-spark-1.3-contributor` and sends the captured Muse `User-Agent` on
|
|
78
|
+
With the flag set, the extension exposes `max` on the gated contributor models (`muse-spark-1.3-contributor`, `muse-wonder-1.0-contributor`, and `muse-wonder-full-1.0-contributor`) and sends the captured Muse `User-Agent` on those models' requests to `https://api.meta.ai/v1` only. Other models, proxies and custom `baseUrl`s, and any `User-Agent` you set yourself are left untouched. Without the flag, Contributor `max` is hidden and Pi's own `User-Agent` is sent.
|
|
79
79
|
|
|
80
80
|
> **Warning:** this makes Pi identify as Meta's first-party Muse client. It relies on undocumented server behavior, is not supported by Meta, may stop working without notice, and may conflict with Meta's terms. Enable it only if you accept that risk for your account.
|
|
81
81
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-meta-oauth",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "Meta Model API OAuth provider for pi",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"image": "https://raw.githubusercontent.com/BlockedPath/pi-meta-oauth/main/preview.png"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@earendil-works/pi-ai": ">=0.83.0 <0.
|
|
36
|
-
"@earendil-works/pi-coding-agent": ">=0.83.0 <0.
|
|
35
|
+
"@earendil-works/pi-ai": ">=0.83.0 <2.0.0",
|
|
36
|
+
"@earendil-works/pi-coding-agent": ">=0.83.0 <2.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@biomejs/biome": "2.5.15",
|
|
40
|
-
"@earendil-works/pi-ai": "
|
|
41
|
-
"@earendil-works/pi-coding-agent": "
|
|
40
|
+
"@earendil-works/pi-ai": "1.4.0",
|
|
41
|
+
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
42
42
|
"bun-types": "latest",
|
|
43
43
|
"typescript": "^5.9.0"
|
|
44
44
|
},
|
package/src/meta/muse-policy.ts
CHANGED
|
@@ -4,6 +4,21 @@ import type { MetaEnv, MetaProviderModel } from "./types.ts";
|
|
|
4
4
|
/** Models whose max effort requires the captured Muse client fingerprint. */
|
|
5
5
|
export const MUSE_USER_AGENT_MODEL_IDS: ReadonlySet<string> = new Set([
|
|
6
6
|
"muse-spark-1.3-contributor",
|
|
7
|
+
"muse-wonder-1.0-contributor",
|
|
8
|
+
"muse-wonder-full-1.0-contributor",
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Models known to accept literal max effort with any User-Agent. The Wonder
|
|
13
|
+
* models have no bundled definition in models.ts, so max originates here;
|
|
14
|
+
* muse-spark-1.3 has one, but is listed so the gate — which runs on every
|
|
15
|
+
* model list — is the single authority and a stale cached `max: null`
|
|
16
|
+
* cannot mask its fallback-declared support.
|
|
17
|
+
*/
|
|
18
|
+
export const MAX_EFFORT_MODEL_IDS: ReadonlySet<string> = new Set([
|
|
19
|
+
"muse-spark-1.3",
|
|
20
|
+
"muse-wonder-1.0",
|
|
21
|
+
"muse-wonder-full-1.0",
|
|
7
22
|
]);
|
|
8
23
|
|
|
9
24
|
/** Recognize the documented, explicit Muse fingerprint opt-in values. */
|
|
@@ -15,18 +30,26 @@ export function isMuseUserAgentEnabled(env: MetaEnv = process.env): boolean {
|
|
|
15
30
|
}
|
|
16
31
|
|
|
17
32
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
33
|
+
* Apply known literal-max support: always on MAX_EFFORT_MODEL_IDS, and on
|
|
34
|
+
* fingerprint-dependent models only when opted in. A future server-advertised
|
|
35
|
+
* mapping to a different effort remains authoritative. Runs on every model
|
|
36
|
+
* list (fallbacks, catalog, cached restore) so a stale cached `max: null`
|
|
37
|
+
* cannot mask known support.
|
|
20
38
|
*/
|
|
21
39
|
export function gateMuseMaxEffort(
|
|
22
40
|
model: MetaProviderModel,
|
|
23
41
|
env: MetaEnv = process.env,
|
|
24
42
|
): MetaProviderModel {
|
|
25
43
|
const map = model.thinkingLevelMap;
|
|
26
|
-
if (!map
|
|
44
|
+
if (!map) return model;
|
|
27
45
|
if (map.max != null && map.max !== "max") return model;
|
|
28
46
|
|
|
29
|
-
|
|
47
|
+
let max: string | null;
|
|
48
|
+
if (MAX_EFFORT_MODEL_IDS.has(model.id)) max = "max";
|
|
49
|
+
else if (MUSE_USER_AGENT_MODEL_IDS.has(model.id))
|
|
50
|
+
max = isMuseUserAgentEnabled(env) ? "max" : null;
|
|
51
|
+
else return model;
|
|
52
|
+
|
|
30
53
|
if (map.max === max) return model;
|
|
31
54
|
return { ...model, thinkingLevelMap: { ...map, max } };
|
|
32
55
|
}
|
package/src/meta/types.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { ProviderConfig } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Pi 0.99+ registers chat, image, and classifier model configs as a union; Omit
|
|
5
|
+
* over that union keeps only their shared keys. Narrow to the chat member, which
|
|
6
|
+
* is the whole element type on older Pi versions.
|
|
7
|
+
*/
|
|
8
|
+
type ProviderModel = Extract<
|
|
9
|
+
NonNullable<ProviderConfig["models"]>[number],
|
|
10
|
+
{ reasoning: boolean }
|
|
11
|
+
>;
|
|
4
12
|
|
|
5
13
|
/** Responses hints spanning the supported Pi versions, including newer flags. */
|
|
6
14
|
export interface MetaResponsesCompat {
|