@oh-my-pi/pi-catalog 18.2.11 → 18.3.0

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.
@@ -77,7 +77,8 @@ export function openaiCodexModelManagerOptions(
77
77
 
78
78
  /**
79
79
  * Merge complete per-account Codex catalogs into one authoritative list,
80
- * deduped by model id (first account to expose an id wins).
80
+ * deduped by model id. The first account to expose an id supplies its spec;
81
+ * account access is merged from every account whose catalog lists that id.
81
82
  *
82
83
  * Returns `null` when any account's fetch failed transiently, so a partial list
83
84
  * cannot replace the previous or bundled authoritative catalog. An account
@@ -102,7 +103,15 @@ function unionCodexModels(
102
103
  }
103
104
  catalogs++;
104
105
  for (const model of result.models) {
105
- if (!byId.has(model.id)) byId.set(model.id, model);
106
+ const existing = byId.get(model.id);
107
+ if (!existing) {
108
+ byId.set(model.id, model);
109
+ } else if (model.accountAccess) {
110
+ byId.set(model.id, {
111
+ ...existing,
112
+ accountAccess: { ...existing.accountAccess, ...model.accountAccess },
113
+ });
114
+ }
106
115
  }
107
116
  }
108
117
  return catalogs > 0 ? [...byId.values()] : null;
package/src/types.ts CHANGED
@@ -20,7 +20,8 @@ export type KnownApi =
20
20
  | "ollama-chat"
21
21
  | "cursor-agent"
22
22
  | "gitlab-duo-agent"
23
- | "devin-agent";
23
+ | "devin-agent"
24
+ | "apple-foundation-models";
24
25
  export type Api = KnownApi | (string & {});
25
26
 
26
27
  /** Catalog kinds used to isolate role-specific runners from session chat models. */
@@ -519,17 +520,17 @@ export interface AnthropicCompat {
519
520
  /** Whether thinking requests may include `context_management` and its beta header. Default: true. */
520
521
  supportsContextManagement?: boolean;
521
522
  /**
522
- * Whether the model lineage supports Anthropic server-side compaction
523
- * (`compact-2026-01-12`: the `compact_20260112` edit and replayed
524
- * `compaction` blocks). Rule-owned per model line; the beta covers the
525
- * adaptive-thinking generation onward and rejects older lines. Default: false.
523
+ * Whether the model and host support Anthropic on-demand compaction
524
+ * (`compact-2026-09-04` requests and signed replay). Enabled on Opus 4.6+,
525
+ * Sonnet 4.6+, Fable/Mythos 5+ on supported hosts. Default: false.
526
526
  */
527
527
  supportsServerCompaction?: boolean;
528
528
  /**
529
529
  * Whether the model is served by the first-party Anthropic provider (its
530
530
  * default route is the official API). Rule-owned on the provider; the
531
531
  * compaction transport pairs it with a per-request effective-URL check
532
- * because reroutes leave it stale-true. Default: false.
532
+ * because reroutes leave it stale-true. Vertex is selected by its provider
533
+ * contract instead. Default: false.
533
534
  */
534
535
  firstPartyProvider?: boolean;
535
536
  /**
@@ -1163,6 +1164,16 @@ export type ModelTokenizer =
1163
1164
  | "kimi-k2"
1164
1165
  | "glm5";
1165
1166
 
1167
+ /** One account's discovered entitlements on a model; see {@link Model.accountAccess}. */
1168
+ export interface ModelAccountAccess {
1169
+ /**
1170
+ * Codex `available_access_programs.cyber`: cyber access programs this account
1171
+ * may request on the model (`standard`, `daybreak_blue`, `daybreak_red`).
1172
+ * Absent when the backend reported no program metadata.
1173
+ */
1174
+ cyberPrograms?: readonly string[];
1175
+ }
1176
+
1166
1177
  // Model interface for the unified model system
1167
1178
  export interface Model<TApi extends Api = Api> {
1168
1179
  id: string;
@@ -1257,6 +1268,15 @@ export interface Model<TApi extends Api = Api> {
1257
1268
  * their single wire id) and on bundled snapshots that predate discovery.
1258
1269
  */
1259
1270
  cursorMaxModeRoutes?: Readonly<Record<string, boolean>>;
1271
+ /**
1272
+ * Per-account availability recorded by multi-account discovery: provider
1273
+ * account id (Codex: ChatGPT `chatgpt_account_id`) → that account's
1274
+ * entitlements on this model. An account appears only when its own catalog
1275
+ * lists the model, so credential selection can route account-gated models
1276
+ * (e.g. `gpt-daybreak-blue-latest`) straight to eligible accounts. Absent on
1277
+ * bundled/config rows and on single-account discovery.
1278
+ */
1279
+ accountAccess?: Readonly<Record<string, ModelAccountAccess>>;
1260
1280
  cost: ModelCost;
1261
1281
  /** Premium Copilot requests charged per user-initiated request (defaults to 1). */
1262
1282
  premiumMultiplier?: number;