@gitpagedocs/tools 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/ai/catalog.ts +13 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitpagedocs/tools",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "description": "Shared business-logic core for Git Page Docs (consumed by frontend, cli and mcp). Ships TypeScript source; consume via tsx or a TS-aware bundler.",
6
6
  "main": "./src/index.ts",
package/src/ai/catalog.ts CHANGED
@@ -38,8 +38,11 @@ const TEXT: ProviderCapabilities = { streaming: true, vision: false, audio: fals
38
38
  const VISION: ProviderCapabilities = { streaming: true, vision: true, audio: false };
39
39
  const VISION_AUDIO: ProviderCapabilities = { streaming: true, vision: true, audio: true };
40
40
 
41
- function models(...ids: string[]): ModelDescriptor[] {
42
- return ids.map((id) => ({ id }));
41
+ type ModelEntry = string | readonly [id: string, label: string];
42
+
43
+ /** Catalog rows: a bare id, or `[id, label]` when a human-readable name exists for menus. */
44
+ function models(...entries: ModelEntry[]): ModelDescriptor[] {
45
+ return entries.map((entry) => (typeof entry === "string" ? { id: entry } : { id: entry[0], label: entry[1] }));
43
46
  }
44
47
 
45
48
  export const PROVIDER_CATALOG: Readonly<Record<AiProviderId, ProviderSpec>> = {
@@ -52,7 +55,7 @@ export const PROVIDER_CATALOG: Readonly<Record<AiProviderId, ProviderSpec>> = {
52
55
  baseUrl: "https://api.openai.com/v1",
53
56
  auth: "bearer",
54
57
  capabilities: VISION,
55
- models: models("gpt-4o", "gpt-4o-mini", "o3-mini", "o1"),
58
+ models: models(["gpt-4o", "GPT-4o"], ["gpt-4o-mini", "GPT-4o mini"], ["o3-mini", "o3-mini"], ["o1", "o1"]),
56
59
  },
57
60
  anthropic: {
58
61
  id: "anthropic",
@@ -64,7 +67,11 @@ export const PROVIDER_CATALOG: Readonly<Record<AiProviderId, ProviderSpec>> = {
64
67
  baseUrl: "https://api.anthropic.com/v1",
65
68
  auth: "x-api-key",
66
69
  capabilities: VISION,
67
- models: models("claude-opus-4-8", "claude-sonnet-4-6", "claude-haiku-4-5-20251001"),
70
+ models: models(
71
+ ["claude-opus-4-8", "Opus 4.8"],
72
+ ["claude-sonnet-4-6", "Sonnet 4.6"],
73
+ ["claude-haiku-4-5-20251001", "Haiku 4.5"],
74
+ ),
68
75
  },
69
76
  gemini: {
70
77
  id: "gemini",
@@ -75,7 +82,7 @@ export const PROVIDER_CATALOG: Readonly<Record<AiProviderId, ProviderSpec>> = {
75
82
  baseUrl: "https://generativelanguage.googleapis.com/v1beta/models",
76
83
  auth: "query-key",
77
84
  capabilities: VISION_AUDIO,
78
- models: models("gemini-2.5-flash", "gemini-2.5-pro", "gemini-2.0-flash"),
85
+ models: models(["gemini-2.5-flash", "2.5 Flash"], ["gemini-2.5-pro", "2.5 Pro"], ["gemini-2.0-flash", "2.0 Flash"]),
79
86
  },
80
87
  openrouter: {
81
88
  id: "openrouter",
@@ -98,7 +105,7 @@ export const PROVIDER_CATALOG: Readonly<Record<AiProviderId, ProviderSpec>> = {
98
105
  requiresBaseUrl: false,
99
106
  auth: "none",
100
107
  capabilities: VISION,
101
- models: models("llama3", "llama3.1", "mistral", "qwen2.5"),
108
+ models: models(["llama3", "Llama 3"], ["llama3.1", "Llama 3.1"], ["mistral", "Mistral"], ["qwen2.5", "Qwen 2.5"]),
102
109
  },
103
110
  "azure-openai": {
104
111
  id: "azure-openai",