@polpo-ai/core 0.5.20 → 0.5.23
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/model-spec.d.ts +2 -2
- package/dist/model-spec.js +5 -5
- package/dist/types.d.ts +4 -4
- package/package.json +1 -1
package/dist/model-spec.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Model spec parsing — pure logic, no runtime dependencies.
|
|
3
3
|
*
|
|
4
|
-
* Parses "provider
|
|
4
|
+
* Parses "provider/model" or "provider/model" strings into { provider, modelId }.
|
|
5
5
|
* Auto-infers provider from well-known model prefixes.
|
|
6
6
|
* Used by any runtime.
|
|
7
7
|
*/
|
|
@@ -13,7 +13,7 @@ export interface ParsedModelSpec {
|
|
|
13
13
|
* Parse a model spec string into { provider, modelId }.
|
|
14
14
|
*
|
|
15
15
|
* Supported formats:
|
|
16
|
-
* "provider
|
|
16
|
+
* "provider/model" — explicit (e.g. "anthropic/claude-opus-4-6")
|
|
17
17
|
* "provider/model" — slash format (e.g. "anthropic/claude-opus-4-6")
|
|
18
18
|
* "model-id" — auto-inferred from prefix map
|
|
19
19
|
*
|
package/dist/model-spec.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Model spec parsing — pure logic, no runtime dependencies.
|
|
3
3
|
*
|
|
4
|
-
* Parses "provider
|
|
4
|
+
* Parses "provider/model" or "provider/model" strings into { provider, modelId }.
|
|
5
5
|
* Auto-infers provider from well-known model prefixes.
|
|
6
6
|
* Used by any runtime.
|
|
7
7
|
*/
|
|
@@ -35,7 +35,7 @@ const PREFIX_MAP = [
|
|
|
35
35
|
* Parse a model spec string into { provider, modelId }.
|
|
36
36
|
*
|
|
37
37
|
* Supported formats:
|
|
38
|
-
* "provider
|
|
38
|
+
* "provider/model" — explicit (e.g. "anthropic/claude-opus-4-6")
|
|
39
39
|
* "provider/model" — slash format (e.g. "anthropic/claude-opus-4-6")
|
|
40
40
|
* "model-id" — auto-inferred from prefix map
|
|
41
41
|
*
|
|
@@ -46,9 +46,9 @@ const PREFIX_MAP = [
|
|
|
46
46
|
export function parseModelSpec(spec, fallback) {
|
|
47
47
|
const s = spec || fallback;
|
|
48
48
|
if (!s) {
|
|
49
|
-
throw new Error('No model configured. Use "provider
|
|
49
|
+
throw new Error('No model configured. Use "provider/model" format (e.g. "anthropic/claude-sonnet-4-5").');
|
|
50
50
|
}
|
|
51
|
-
// Explicit "provider
|
|
51
|
+
// Explicit "provider/model" format
|
|
52
52
|
const colonIdx = s.indexOf(":");
|
|
53
53
|
if (colonIdx > 0) {
|
|
54
54
|
const provider = s.slice(0, colonIdx);
|
|
@@ -73,7 +73,7 @@ export function parseModelSpec(spec, fallback) {
|
|
|
73
73
|
return { provider, modelId: s };
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
throw new Error(`Cannot infer provider for model "${s}". Use "provider
|
|
76
|
+
throw new Error(`Cannot infer provider for model "${s}". Use "provider/model" format (e.g. "anthropic:${s}").`);
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Map of known providers → environment variable name for API keys.
|
package/dist/types.d.ts
CHANGED
|
@@ -199,7 +199,7 @@ export interface AgentConfig {
|
|
|
199
199
|
/** ISO timestamp of when this agent was created / added to the team. Auto-set by addAgent(). */
|
|
200
200
|
createdAt?: string;
|
|
201
201
|
role?: string;
|
|
202
|
-
/** Model to use. Format: "provider
|
|
202
|
+
/** Model to use. Format: "provider/model" (e.g. "anthropic/claude-sonnet-4-5-20250929") or bare model ID (auto-inferred). */
|
|
203
203
|
model?: string;
|
|
204
204
|
/** Allowed tools for the agent (e.g. ["read", "write", "edit", "bash", "glob", "grep", "browser_*", "email_*", "image_*", "video_*", "audio_*", "excel_*", "pdf_*", "docx_*"]).
|
|
205
205
|
* Core tools (always available): read, write, edit, bash, glob, grep, ls, http_fetch, http_download, register_outcome, vault_get, vault_list. */
|
|
@@ -526,7 +526,7 @@ export interface CustomModelDef {
|
|
|
526
526
|
maxTokens?: number;
|
|
527
527
|
}
|
|
528
528
|
export interface ModelConfig {
|
|
529
|
-
/** Primary model spec (e.g. "anthropic
|
|
529
|
+
/** Primary model spec (e.g. "anthropic/claude-opus-4-6"). */
|
|
530
530
|
primary?: string;
|
|
531
531
|
/** Ordered fallback models — tried when primary fails. */
|
|
532
532
|
fallbacks?: string[];
|
|
@@ -571,12 +571,12 @@ export interface PolpoSettings {
|
|
|
571
571
|
* Skill names are resolved against the pool (project + global). */
|
|
572
572
|
orchestratorSkills?: string[];
|
|
573
573
|
/** Model for orchestrator LLM calls (question detection, deadlock, missions).
|
|
574
|
-
* Can be a simple string ("anthropic
|
|
574
|
+
* Can be a simple string ("anthropic/claude-opus-4-6") or a ModelConfig with fallbacks. */
|
|
575
575
|
orchestratorModel?: string | ModelConfig;
|
|
576
576
|
/** Image-capable model for tasks that need vision (falls back to orchestratorModel). */
|
|
577
577
|
imageModel?: string;
|
|
578
578
|
/** Model allowlist — when set, only these models can be used.
|
|
579
|
-
* Keys are model specs (e.g. "anthropic
|
|
579
|
+
* Keys are model specs (e.g. "anthropic/claude-opus-4-6"), values are aliases/params. */
|
|
580
580
|
modelAllowlist?: Record<string, ModelAllowlistEntry>;
|
|
581
581
|
/** Global reasoning / deep thinking level for orchestrator LLM calls (chat, plan generation, assessment).
|
|
582
582
|
* "off" disables thinking (default). Can be overridden per-agent via AgentConfig.reasoning.
|
package/package.json
CHANGED