@inixiative/foundry-core 0.3.0 → 0.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inixiative/foundry-core",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,8 +1,8 @@
1
1
  /** Credential references belong in configuration; secrets stay behind the resolver. */
2
- /** `kingdom-runtime` names the paired Kingdom by the destination's origin plus the owner it was paired as. */
2
+ /** `kingdom-signet` names the Signet a paired Kingdom granted, by the destination's origin plus the owner it was paired as. */
3
3
  export type CredentialReference =
4
4
  | { type: 'managed'; id: string }
5
- | { type: 'kingdom-runtime'; owner: string };
5
+ | { type: 'kingdom-signet'; owner: string };
6
6
 
7
7
  export interface CredentialScope {
8
8
  service: string;
package/src/index.ts CHANGED
@@ -184,13 +184,17 @@ export {
184
184
  type DecisionModelDefaults,
185
185
  type FoundryModelInfo,
186
186
  type FoundryProviderInfo,
187
+ MAIN_THREAD_LABS,
188
+ type MainThreadLab,
187
189
  MODEL_CAPABILITIES,
188
190
  MODEL_REGISTRY,
189
191
  MODEL_REGISTRY_UPDATED_AT,
190
192
  type ModelCapability,
193
+ type ModelLab,
191
194
  type ModelReasoning,
192
195
  type ModelSweepOption,
193
196
  type ModelTier,
197
+ mainThreadLab,
194
198
  modelCapabilities,
195
199
  modelHasCapability,
196
200
  modelOptionsByCapability,
@@ -23,6 +23,30 @@ export type ProviderType =
23
23
  | 'custom';
24
24
  export type RuntimeKind = 'api' | 'native-harness' | 'typed-decision';
25
25
 
26
+ /** Who trains the models a provider serves. Gateways and local hosts serve many labs and carry none. */
27
+ export type ModelLab =
28
+ | 'anthropic'
29
+ | 'openai'
30
+ | 'google'
31
+ | 'meta'
32
+ | 'xai'
33
+ | 'deepseek'
34
+ | 'moonshot'
35
+ | 'zhipu'
36
+ | 'alibaba'
37
+ | 'mistral'
38
+ | 'typesafe';
39
+
40
+ /** Labs whose models may run a main thread (the Artificer), on whatever transport reaches them. */
41
+ export const MAIN_THREAD_LABS = [
42
+ 'anthropic',
43
+ 'openai',
44
+ 'google',
45
+ 'meta',
46
+ 'xai',
47
+ ] as const satisfies readonly ModelLab[];
48
+ export type MainThreadLab = (typeof MAIN_THREAD_LABS)[number];
49
+
26
50
  /**
27
51
  * What a model is worth using for. Every model is a judgment client — that is
28
52
  * not a provider category, it is a tag every entry carries. The other tags name
@@ -175,6 +199,8 @@ const MUSE_REASONING: ModelReasoning = {
175
199
  export interface FoundryProviderInfo {
176
200
  id: string;
177
201
  type: ProviderType;
202
+ /** Absent for gateways and local hosts. */
203
+ lab?: ModelLab;
178
204
  label: string;
179
205
  description: string;
180
206
  envKey?: string;
@@ -222,6 +248,7 @@ const POWERFUL_REASONING = [...POWERFUL, 'reasoning'] as ModelCapability[];
222
248
  export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
223
249
  'claude-code': {
224
250
  id: 'claude-code',
251
+ lab: 'anthropic',
225
252
  type: 'claude-code',
226
253
  label: 'Claude Code (CLI subscription)',
227
254
  description: "Native Claude Code harness using the user's authenticated subscription.",
@@ -265,10 +292,10 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
265
292
  },
266
293
  {
267
294
  id: 'haiku',
268
- label: 'Haiku 4.5',
295
+ label: 'Haiku 5.5',
269
296
  tier: 'fast',
270
297
  costTier: 'low',
271
- contextWindow: 200_000,
298
+ contextWindow: 1_000_000,
272
299
  runtimeKind: 'native-harness',
273
300
  nativeAlias: true,
274
301
  capabilities: FAST_REASONING,
@@ -278,6 +305,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
278
305
  },
279
306
  anthropic: {
280
307
  id: 'anthropic',
308
+ lab: 'anthropic',
281
309
  type: 'anthropic',
282
310
  label: 'Anthropic (API key)',
283
311
  description: 'Direct Anthropic API access without the Claude Code native harness.',
@@ -319,6 +347,18 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
319
347
  capabilities: STANDARD_REASONING,
320
348
  reasoning: CLAUDE_REASONING,
321
349
  },
350
+ {
351
+ id: 'claude-haiku-5-5',
352
+ label: 'Claude Haiku 5.5',
353
+ tier: 'fast',
354
+ costTier: 'low',
355
+ contextWindow: 1_000_000,
356
+ maxOutputTokens: 128_000,
357
+ runtimeKind: 'api',
358
+ capabilities: FAST_REASONING,
359
+ reasoning: { ...CLAUDE_REASONING, efforts: ['low', 'medium', 'high'] },
360
+ },
361
+ // Previous generation, still served.
322
362
  {
323
363
  id: 'claude-haiku-4-5',
324
364
  label: 'Claude Haiku 4.5',
@@ -330,7 +370,6 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
330
370
  reasoning: { ...CLAUDE_REASONING, efforts: ['low', 'medium', 'high'] },
331
371
  notes: 'Takes a thinking budget, not an effort ladder.',
332
372
  },
333
- // Previous generation, still served.
334
373
  {
335
374
  id: 'claude-fable-5',
336
375
  label: 'Claude Fable 5',
@@ -390,6 +429,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
390
429
  },
391
430
  codex: {
392
431
  id: 'codex',
432
+ lab: 'openai',
393
433
  type: 'codex',
394
434
  label: 'Codex CLI (OpenAI subscription)',
395
435
  description: "Native Codex harness using the user's authenticated OpenAI/Codex subscription.",
@@ -480,6 +520,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
480
520
  },
481
521
  openai: {
482
522
  id: 'openai',
523
+ lab: 'openai',
483
524
  type: 'openai',
484
525
  label: 'OpenAI',
485
526
  description: 'OpenAI API models for classification, routing, and execution.',
@@ -575,6 +616,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
575
616
  },
576
617
  gemini: {
577
618
  id: 'gemini',
619
+ lab: 'google',
578
620
  type: 'gemini',
579
621
  label: 'Google Gemini',
580
622
  description: 'Gemini API models for high-volume agent work.',
@@ -641,6 +683,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
641
683
  },
642
684
  meta: {
643
685
  id: 'meta',
686
+ lab: 'meta',
644
687
  type: 'openai-compatible',
645
688
  // Llama is not Meta's frontier line any more; Muse Spark replaced it in April 2026
646
689
  // and there is no "Llama 5". The open-weight Llama entries under openrouter,
@@ -721,6 +764,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
721
764
  },
722
765
  xai: {
723
766
  id: 'xai',
767
+ lab: 'xai',
724
768
  type: 'xai',
725
769
  label: 'xAI (Grok)',
726
770
  description:
@@ -803,6 +847,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
803
847
  },
804
848
  deepseek: {
805
849
  id: 'deepseek',
850
+ lab: 'deepseek',
806
851
  type: 'openai-compatible',
807
852
  label: 'DeepSeek',
808
853
  description:
@@ -839,6 +884,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
839
884
  },
840
885
  kimi: {
841
886
  id: 'kimi',
887
+ lab: 'moonshot',
842
888
  type: 'openai-compatible',
843
889
  label: 'Kimi (Moonshot AI)',
844
890
  description: 'Moonshot Kimi models. OpenAI-compatible; temperature range is 0-1, not 0-2.',
@@ -893,6 +939,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
893
939
  },
894
940
  glm: {
895
941
  id: 'glm',
942
+ lab: 'zhipu',
896
943
  type: 'openai-compatible',
897
944
  label: 'GLM (Z.ai / Zhipu)',
898
945
  description:
@@ -1030,6 +1077,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
1030
1077
  },
1031
1078
  qwen: {
1032
1079
  id: 'qwen',
1080
+ lab: 'alibaba',
1033
1081
  type: 'openai-compatible',
1034
1082
  label: 'Qwen (Alibaba Model Studio)',
1035
1083
  // The legacy static domain still works; Alibaba now recommends the per-workspace
@@ -1439,6 +1487,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
1439
1487
  },
1440
1488
  mistral: {
1441
1489
  id: 'mistral',
1490
+ lab: 'mistral',
1442
1491
  type: 'openai-compatible',
1443
1492
  label: 'Mistral AI',
1444
1493
  description:
@@ -1507,6 +1556,7 @@ export const MODEL_REGISTRY: Record<string, FoundryProviderInfo> = {
1507
1556
  },
1508
1557
  typesafe: {
1509
1558
  id: 'typesafe',
1559
+ lab: 'typesafe',
1510
1560
  type: 'typesafe',
1511
1561
  label: 'TypeSafe (Jev)',
1512
1562
  description:
@@ -1565,6 +1615,14 @@ export function providersWithCapability(capability: ModelCapability): FoundryPro
1565
1615
  );
1566
1616
  }
1567
1617
 
1618
+ /** The main-thread lab a provider serves, or undefined when it serves none (or many). */
1619
+ export function mainThreadLab(providerId: string): MainThreadLab | undefined {
1620
+ const lab = MODEL_REGISTRY[providerId]?.lab;
1621
+ return (MAIN_THREAD_LABS as readonly string[]).includes(lab ?? '')
1622
+ ? (lab as MainThreadLab)
1623
+ : undefined;
1624
+ }
1625
+
1568
1626
  /** The part of a Foundry configuration `resolveDecisionModel` reads. */
1569
1627
  export interface DecisionModelDefaults {
1570
1628
  defaults: {