pi-harness-runtime 0.9.13 → 0.9.15

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 (84) hide show
  1. package/README.md +54 -45
  2. package/harness/auto-quota-resume.ts +129 -0
  3. package/harness/e2e/minimax-quota-scraper.ts +10 -4
  4. package/harness/index.ts +8 -0
  5. package/harness/loop-runtime.ts +57 -0
  6. package/index.ts +47 -11
  7. package/mirror.ts +40 -18
  8. package/package.json +1 -1
  9. package/packages/a2a-adapter/package.json +1 -1
  10. package/packages/auth/package.json +1 -1
  11. package/packages/autonomous-refactor/package.json +1 -1
  12. package/packages/cache-strategy/package.json +1 -1
  13. package/packages/capability-registry/package.json +1 -1
  14. package/packages/checkpoint/package.json +1 -1
  15. package/packages/cli-plugin-sdk/package.json +1 -1
  16. package/packages/code-generation/package.json +1 -1
  17. package/packages/code-review/package.json +1 -1
  18. package/packages/codex-adapter/package.json +1 -1
  19. package/packages/context-compiler/package.json +1 -1
  20. package/packages/context-manager/package.json +1 -1
  21. package/packages/cookie-sanitizer/package.json +1 -1
  22. package/packages/cost-optimizer/package.json +1 -1
  23. package/packages/django-plugin/package.json +1 -1
  24. package/packages/doc-generator/package.json +1 -1
  25. package/packages/evaluation-engine/package.json +1 -1
  26. package/packages/evaluation-runner/package.json +1 -1
  27. package/packages/experience-replay/package.json +1 -1
  28. package/packages/feedback-collector/package.json +1 -1
  29. package/packages/framework-detector/package.json +1 -1
  30. package/packages/framework-plugin-sdk/package.json +1 -1
  31. package/packages/frappe-plugin/package.json +1 -1
  32. package/packages/generic-web-plugin/package.json +1 -1
  33. package/packages/health-monitor/package.json +1 -1
  34. package/packages/laravel-plugin/package.json +1 -1
  35. package/packages/learning-engine/package.json +1 -1
  36. package/packages/mcp-adapter/package.json +1 -1
  37. package/packages/memory-engine/package.json +1 -1
  38. package/packages/model-registry/package.json +1 -1
  39. package/packages/nextjs-plugin/package.json +1 -1
  40. package/packages/notification/package.json +1 -1
  41. package/packages/observability/package.json +1 -1
  42. package/packages/performance-optimizer/package.json +1 -1
  43. package/packages/project-analyzer/package.json +1 -1
  44. package/packages/prompt-compiler/package.json +1 -1
  45. package/packages/prompt-versioning/package.json +1 -1
  46. package/packages/provider-adapter-sdk/package.json +1 -1
  47. package/packages/provider-router/package.json +1 -1
  48. package/packages/provider-selector/package.json +1 -1
  49. package/packages/providers/dist/provider-id.d.ts +2 -0
  50. package/packages/providers/dist/provider-id.d.ts.map +1 -1
  51. package/packages/providers/dist/provider-id.js +9 -0
  52. package/packages/providers/dist/provider-id.js.map +1 -1
  53. package/packages/providers/package.json +1 -1
  54. package/packages/providers/src/provider-id.ts +12 -0
  55. package/packages/quota-manager/package.json +1 -1
  56. package/packages/rate-limiter/package.json +1 -1
  57. package/packages/react-vite-plugin/package.json +1 -1
  58. package/packages/release-manager/package.json +1 -1
  59. package/packages/requirement-compiler/package.json +1 -1
  60. package/packages/runtime/package.json +1 -1
  61. package/packages/scheduler/package.json +1 -1
  62. package/packages/session/package.json +1 -1
  63. package/packages/shared-context/package.json +1 -1
  64. package/packages/skill-registry/package.json +1 -1
  65. package/packages/sprint-planner/package.json +1 -1
  66. package/packages/task-compiler/package.json +1 -1
  67. package/packages/test-data-generator/package.json +1 -1
  68. package/packages/test-generator/package.json +1 -1
  69. package/packages/token-estimation/package.json +1 -1
  70. package/packages/token-optimizer/package.json +1 -1
  71. package/packages/tui/package.json +1 -1
  72. package/packages/types/dist/ai-providers.d.ts +36 -0
  73. package/packages/types/dist/ai-providers.d.ts.map +1 -0
  74. package/packages/types/dist/ai-providers.js +66 -0
  75. package/packages/types/dist/ai-providers.js.map +1 -0
  76. package/packages/types/dist/runtime-types.d.ts +6 -0
  77. package/packages/types/dist/runtime-types.d.ts.map +1 -1
  78. package/packages/types/dist/runtime-types.js +2 -1
  79. package/packages/types/dist/runtime-types.js.map +1 -1
  80. package/packages/types/package.json +1 -1
  81. package/packages/types/src/ai-providers.ts +73 -0
  82. package/packages/types/src/runtime-types.ts +15 -0
  83. package/packages/types/tsconfig.tsbuildinfo +1 -1
  84. package/packages/worktree/package.json +1 -1
package/mirror.ts CHANGED
@@ -32,6 +32,27 @@
32
32
 
33
33
  import { getMirrorPath, readJson, writeJson } from "./cli.ts";
34
34
 
35
+ /**
36
+ * Canonical lowercase provider ids — mirrors the KNOWN_AI_PROVIDERS from
37
+ * packages/types/src/ai-providers.ts. Duplicated here to avoid import path
38
+ * resolution issues in the root workspace.
39
+ */
40
+ const KNOWN_PROVIDER_IDS = [
41
+ "minimax",
42
+ "openai",
43
+ "anthropic",
44
+ "glm",
45
+ "openrouter",
46
+ "openai-codex",
47
+ "deepseek",
48
+ "gemini",
49
+ "kimi",
50
+ ] as const;
51
+
52
+ function isKnownProvider(id: string): boolean {
53
+ return (KNOWN_PROVIDER_IDS as readonly string[]).includes(id);
54
+ }
55
+
35
56
  /** Where a piece of data came from. */
36
57
  export type MirrorSource = "scrape" | "tui-signal" | "manual";
37
58
 
@@ -49,10 +70,14 @@ export interface ProviderMirrorRecord {
49
70
  h5_used_pct?: number;
50
71
  /** When the 5h window resets — human-readable or ISO. */
51
72
  h5_resets_at?: string;
73
+ /** Epoch ms when the 5h window resets — precise UTC timestamp. */
74
+ h5_resets_at_epoch?: number;
52
75
  /** Weekly used percent. */
53
76
  weekly_used_pct?: number;
54
77
  /** When the weekly window resets. */
55
78
  weekly_resets_at?: string;
79
+ /** Epoch ms when the weekly window resets — precise UTC timestamp. */
80
+ weekly_resets_at_epoch?: number;
56
81
  /** Set when a limit was hit and we have the exhaustion signal. */
57
82
  exhausted?: boolean;
58
83
  /** Limit type from TUI signal: tokens, context_window, rate_limit, unknown. */
@@ -81,15 +106,7 @@ export interface MirrorRecord {
81
106
  weekly_resets_at?: string;
82
107
  }
83
108
 
84
- /** Known provider ids used as keys in the per-provider map. */
85
- export type KnownProviderId =
86
- | "minimax"
87
- | "openai"
88
- | "openai-codex"
89
- | "glm"
90
- | "anthropic"
91
- | "openrouter"
92
- | (string & {}); // allow extension
109
+
93
110
 
94
111
  const STALE_WARN_MS = 30 * 60 * 1000; // 30 min → orange
95
112
  const STALE_ERROR_MS = 2 * 60 * 60 * 1000; // 2 h → red
@@ -112,11 +129,12 @@ function isLegacyShape(raw: unknown): raw is MirrorRecord & {
112
129
  }
113
130
 
114
131
  /** Convert a legacy single-row record to per-provider shape. */
115
- function upgradeLegacyRecord(legacy: MirrorRecord): PerProviderMirror {
132
+ function upgradeLegacyRecord(legacy: MirrorRecord): PerProviderMirror | null {
116
133
  const provider = legacy.provider ?? "minimax";
134
+ const known = isKnownProvider(provider) ? provider : "minimax";
117
135
  const rec: ProviderMirrorRecord = {
118
136
  synced_at: legacy.synced_at ?? new Date().toISOString(),
119
- provider,
137
+ provider: known,
120
138
  source: "scrape", // legacy was always scrape
121
139
  model: legacy.model,
122
140
  h5_used_pct: legacy.h5_used_pct,
@@ -124,7 +142,7 @@ function upgradeLegacyRecord(legacy: MirrorRecord): PerProviderMirror {
124
142
  weekly_used_pct: legacy.weekly_used_pct,
125
143
  weekly_resets_at: legacy.weekly_resets_at,
126
144
  };
127
- return { [provider]: rec };
145
+ return { [known]: rec };
128
146
  }
129
147
 
130
148
  export class MirrorStore {
@@ -152,13 +170,17 @@ export class MirrorStore {
152
170
 
153
171
  if (isLegacyShape(raw)) {
154
172
  const upgraded = upgradeLegacyRecord(raw as MirrorRecord);
155
- // Persist the upgrade so subsequent reads are fast.
156
- try {
157
- writeJson(this.path, upgraded);
158
- } catch {
159
- // best-effort
173
+ if (upgraded) {
174
+ // Persist the upgrade so subsequent reads are fast.
175
+ try {
176
+ writeJson(this.path, upgraded);
177
+ } catch {
178
+ // best-effort
179
+ }
180
+ return upgraded;
160
181
  }
161
- return upgraded;
182
+ // Unknown legacy provider — treat as absent.
183
+ return null;
162
184
  }
163
185
 
164
186
  // Already per-provider shape.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-harness-runtime",
3
- "version": "0.9.13",
3
+ "version": "0.9.15",
4
4
  "description": "[BETA] Codex-style /usage status + autonomous coding harness for pi. Not production ready — expect breaking changes.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/a2a-adapter",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Google Agent-to-Agent (A2A) protocol adapter for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/auth",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "pi-harness-runtime — auth",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/autonomous-refactor",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Autonomous refactoring engine",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/cache-strategy",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Smart caching with TTL and invalidation strategies (RFC-0022)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/capability-registry",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Capability Registry for pi-harness-runtime — tracks model capabilities and enables capability-based routing",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/checkpoint",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Enhanced checkpoint system with incremental snapshots, diff-based storage, and recovery strategies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/cli-plugin-sdk",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "CLI Plugin SDK for pi-harness — install, list, remove, update, invoke plugins",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/code-generation",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Code generation pipeline for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/code-review",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Automated code review engine for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/codex-adapter",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "OpenAI Codex provider adapter for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/context-compiler",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Bounded context selection engine for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/context-manager",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Context Window Manager — prevents model context overflow via compaction and resume prompts (RFC-0010)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cookie-sanitizer",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "pi-harness-runtime — cookie sanitizer (provider-quota cookie file normaliser)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cost-optimizer",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Cost Optimizer for pi-harness-runtime — budget tracking, forecasting, and model selection optimization",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/django-plugin",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Django framework analysis — models, management commands, settings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/doc-generator",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Auto-Doc Generator — generate documentation from source code (RFC-0014)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/evaluation-engine",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Evaluation engine for pi-harness runtime (RFC-0057)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/evaluation-runner",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Framework-agnostic evaluation framework for AI outputs (RFC-0020)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/experience-replay",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Experience replay for debugging and reproducibility (RFC-0059)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/feedback-collector",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Collect and aggregate human/automated feedback (RFC-0021)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/framework-detector",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Framework detection system for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/framework-plugin-sdk",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Framework plugin SDK for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/frappe-plugin",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Frappe/ERPNext framework analysis — DocTypes, hooks, bench sites, site config",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/generic-web-plugin",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Generic web framework analysis — REST/GraphQL endpoints, OpenAPI, auth",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/health-monitor",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Health monitoring and auto-healing",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/laravel-plugin",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Laravel framework analysis — artisan commands, Eloquent models, Blade",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/learning-engine",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Learning engine for extracting lessons from runtime execution (RFC-0058)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/mcp-adapter",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "MCP server adapter for pi-harness — exposes harness capabilities as MCP tools/resources/prompts (RFC-0068)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/memory-engine",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Memory engine with OKF integration for durable knowledge management (RFC-0060)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/model-registry",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Model Registry for pi-harness-runtime — centralized model metadata with pricing",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/nextjs-plugin",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Next.js framework detection and analysis for pi-harness-runtime (RFC-0062)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/notification",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "pi-harness-runtime — notification",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/observability",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Comprehensive observability system with structured logging, tracing, metrics, and alerting",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/performance-optimizer",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Performance optimization analyzer for pi-harness runtime (RFC-0056)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/project-analyzer",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Project analysis system for pi-harness-runtime - detects frameworks, rules, and project structure",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-compiler",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Deterministic prompt compiler for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-versioning",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Version control for prompts with rollback support (RFC-0019)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/provider-adapter-sdk",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "SDK for building, testing, and registering AI provider adapters",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/provider-router",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Enhanced Provider Router for pi-harness-runtime — intelligent routing with capabilities, costs, and quotas",
5
5
  "type": "module",
6
6
  "main": "./dist/provider-router.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/provider-selector",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Multi-Provider Selector — route requests by cost, quality, and latency (RFC-0012)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -27,6 +27,8 @@
27
27
  * wiki/bugs/multi-provider-usage-status.md.
28
28
  */
29
29
  export type KnownProvider = "minimax" | "openai" | "openai-codex" | "glm" | "anthropic" | "openrouter";
30
+ /** True if the given string is a known, canonical provider id. */
31
+ export declare function isKnownAiProvider(value: string): value is KnownProvider;
30
32
  export type ProviderId = KnownProvider | (string & {});
31
33
  /** Return the provider id for a model id, or null if unknown. */
32
34
  export declare function providerFromModelId(modelId: string | null | undefined): ProviderId | null;
@@ -1 +1 @@
1
- {"version":3,"file":"provider-id.d.ts","sourceRoot":"","sources":["../src/provider-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,MAAM,aAAa,GACtB,SAAS,GACT,QAAQ,GACR,cAAc,GACd,KAAK,GACL,WAAW,GACX,YAAY,CAAC;AAE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XES and to the sanitization doc in
27
27
  * wiki/bugs/multi-provider-usage-status.md.
28
28
  */
29
+ /** True if the given string is a known, canonical provider id. */
30
+ export function isKnownAiProvider(value) {
31
+ return (value === "minimax" ||
32
+ value === "openai" ||
33
+ value === "openai-codex" ||
34
+ value === "glm" ||
35
+ value === "anthropic" ||
36
+ value === "openrouter");
37
+ }
29
38
  const MODEL_PREFIXES = [
30
39
  { prefix: "minimax/", provider: "minimax" },
31
40
  { prefix: "openai-codex/", provider: "openai-codex" },
@@ -1 +1 @@
1
- {"version":3,"file":"provider-id.js","sourceRoot":"","sources":["../src/provider-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAYH,MAAM,cAAc,GAAoD;IACvE,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE;IAC3C,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE;IACrD,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE;IACzC,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE;IAC/C,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE;IACjD,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IACnC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;CACrC,CAAC;AAEF,iEAAiE;AACjE,MAAM,UAAU,mBAAmB,CAClC,OAAkC;IAElC,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACpC,KAAK,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,cAAc,EAAE,CAAC;QACnD,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,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QAAoB;IACxD,OAAO,CACN,QAAQ,KAAK,QAAQ;QACrB,QAAQ,KAAK,cAAc;QAC3B,QAAQ,KAAK,KAAK;QAClB,QAAQ,KAAK,WAAW;QACxB,QAAQ,KAAK,YAAY,CACzB,CAAC;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/providers",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "pi-harness-runtime — providers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,6 +35,18 @@ export type KnownProvider =
35
35
  | "anthropic"
36
36
  | "openrouter";
37
37
 
38
+ /** True if the given string is a known, canonical provider id. */
39
+ export function isKnownAiProvider(value: string): value is KnownProvider {
40
+ return (
41
+ value === "minimax" ||
42
+ value === "openai" ||
43
+ value === "openai-codex" ||
44
+ value === "glm" ||
45
+ value === "anthropic" ||
46
+ value === "openrouter"
47
+ );
48
+ }
49
+
38
50
  export type ProviderId = KnownProvider | (string & {});
39
51
 
40
52
  const MODEL_PREFIXES: Array<{ prefix: string; provider: ProviderId }> = [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/quota-manager",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "pi-harness-runtime — quota-manager",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/rate-limiter",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Rate limiting with token bucket algorithm (RFC-0023)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/react-vite-plugin",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "React/Vite framework analysis — components, config, TypeScript setup",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/release-manager",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "Release management for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/requirement-compiler",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "Compiles raw requirements into validated CompiledRequirement with ambiguity detection and risk tagging",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/runtime",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "pi-harness-runtime — runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/scheduler",
3
- "version": "0.9.11",
3
+ "version": "0.9.15",
4
4
  "description": "pi-harness-runtime — scheduler",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",