open-multi-agent-kit 0.98.5 → 0.99.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.
Files changed (163) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +3 -2
  3. package/dist/cli/help.d.ts.map +1 -1
  4. package/dist/cli/help.js +1 -0
  5. package/dist/cli/help.js.map +1 -1
  6. package/dist/commands/verified-run-cli.d.ts.map +1 -1
  7. package/dist/commands/verified-run-cli.js +2 -2
  8. package/dist/commands/verified-run-cli.js.map +1 -1
  9. package/dist/core/agent-session.d.ts.map +1 -1
  10. package/dist/core/agent-session.js +19 -2
  11. package/dist/core/agent-session.js.map +1 -1
  12. package/dist/core/devin-harness-dispatch.d.ts +12 -0
  13. package/dist/core/devin-harness-dispatch.d.ts.map +1 -0
  14. package/dist/core/devin-harness-dispatch.js +12 -0
  15. package/dist/core/devin-harness-dispatch.js.map +1 -0
  16. package/dist/core/devin-harness.d.ts +53 -0
  17. package/dist/core/devin-harness.d.ts.map +1 -0
  18. package/dist/core/devin-harness.js +112 -0
  19. package/dist/core/devin-harness.js.map +1 -0
  20. package/dist/core/domain-dispatch.d.ts +4 -1
  21. package/dist/core/domain-dispatch.d.ts.map +1 -1
  22. package/dist/core/domain-dispatch.js +5 -0
  23. package/dist/core/domain-dispatch.js.map +1 -1
  24. package/dist/core/domain-loadouts-provider-harness.d.ts +12 -0
  25. package/dist/core/domain-loadouts-provider-harness.d.ts.map +1 -0
  26. package/dist/core/domain-loadouts-provider-harness.js +122 -0
  27. package/dist/core/domain-loadouts-provider-harness.js.map +1 -0
  28. package/dist/core/domain-loadouts.d.ts +2 -33
  29. package/dist/core/domain-loadouts.d.ts.map +1 -1
  30. package/dist/core/domain-loadouts.js +3 -56
  31. package/dist/core/domain-loadouts.js.map +1 -1
  32. package/dist/core/domain-profile.d.ts +40 -0
  33. package/dist/core/domain-profile.d.ts.map +1 -0
  34. package/dist/core/domain-profile.js +7 -0
  35. package/dist/core/domain-profile.js.map +1 -0
  36. package/dist/core/grok-harness-dispatch.d.ts +6 -20
  37. package/dist/core/grok-harness-dispatch.d.ts.map +1 -1
  38. package/dist/core/grok-harness-dispatch.js +6 -55
  39. package/dist/core/grok-harness-dispatch.js.map +1 -1
  40. package/dist/core/grok-harness.d.ts +7 -9
  41. package/dist/core/grok-harness.d.ts.map +1 -1
  42. package/dist/core/grok-harness.js +9 -23
  43. package/dist/core/grok-harness.js.map +1 -1
  44. package/dist/core/harness-skills.d.ts +20 -0
  45. package/dist/core/harness-skills.d.ts.map +1 -0
  46. package/dist/core/harness-skills.js +36 -0
  47. package/dist/core/harness-skills.js.map +1 -0
  48. package/dist/core/loadout-runtime-state.d.ts +25 -0
  49. package/dist/core/loadout-runtime-state.d.ts.map +1 -0
  50. package/dist/core/loadout-runtime-state.js +39 -0
  51. package/dist/core/loadout-runtime-state.js.map +1 -0
  52. package/dist/core/loadout-runtime.d.ts +2 -12
  53. package/dist/core/loadout-runtime.d.ts.map +1 -1
  54. package/dist/core/loadout-runtime.js +6 -13
  55. package/dist/core/loadout-runtime.js.map +1 -1
  56. package/dist/core/model-resolver.d.ts +1 -41
  57. package/dist/core/model-resolver.d.ts.map +1 -1
  58. package/dist/core/model-resolver.js +2 -49
  59. package/dist/core/model-resolver.js.map +1 -1
  60. package/dist/core/provider-default-models.d.ts +42 -0
  61. package/dist/core/provider-default-models.d.ts.map +1 -0
  62. package/dist/core/provider-default-models.js +50 -0
  63. package/dist/core/provider-default-models.js.map +1 -0
  64. package/dist/core/provider-display-names.d.ts.map +1 -1
  65. package/dist/core/provider-display-names.js +1 -0
  66. package/dist/core/provider-display-names.js.map +1 -1
  67. package/dist/core/provider-harness-dispatch.d.ts +63 -0
  68. package/dist/core/provider-harness-dispatch.d.ts.map +1 -0
  69. package/dist/core/provider-harness-dispatch.js +60 -0
  70. package/dist/core/provider-harness-dispatch.js.map +1 -0
  71. package/dist/core/provider-usage-devin.d.ts +16 -0
  72. package/dist/core/provider-usage-devin.d.ts.map +1 -0
  73. package/dist/core/provider-usage-devin.js +61 -0
  74. package/dist/core/provider-usage-devin.js.map +1 -0
  75. package/dist/core/provider-usage-text.d.ts +5 -0
  76. package/dist/core/provider-usage-text.d.ts.map +1 -0
  77. package/dist/core/provider-usage-text.js +15 -0
  78. package/dist/core/provider-usage-text.js.map +1 -0
  79. package/dist/core/provider-usage-types.d.ts +2 -1
  80. package/dist/core/provider-usage-types.d.ts.map +1 -1
  81. package/dist/core/provider-usage-types.js.map +1 -1
  82. package/dist/core/provider-usage.d.ts +1 -2
  83. package/dist/core/provider-usage.d.ts.map +1 -1
  84. package/dist/core/provider-usage.js +12 -7
  85. package/dist/core/provider-usage.js.map +1 -1
  86. package/dist/core/run-execution-api.d.ts +1 -1
  87. package/dist/core/run-execution-api.d.ts.map +1 -1
  88. package/dist/core/run-execution-api.js.map +1 -1
  89. package/dist/core/sdk.d.ts.map +1 -1
  90. package/dist/core/sdk.js +23 -18
  91. package/dist/core/sdk.js.map +1 -1
  92. package/dist/core/verified-run/dag-phase.d.ts +1 -1
  93. package/dist/core/verified-run/dag-phase.d.ts.map +1 -1
  94. package/dist/core/verified-run/dag-phase.js +46 -8
  95. package/dist/core/verified-run/dag-phase.js.map +1 -1
  96. package/dist/core/verified-run/dag-projection.d.ts.map +1 -1
  97. package/dist/core/verified-run/dag-projection.js +25 -12
  98. package/dist/core/verified-run/dag-projection.js.map +1 -1
  99. package/dist/core/verified-run/dag-types.d.ts +11 -0
  100. package/dist/core/verified-run/dag-types.d.ts.map +1 -1
  101. package/dist/core/verified-run/dag-types.js.map +1 -1
  102. package/dist/core/verified-run/event-parser.d.ts.map +1 -1
  103. package/dist/core/verified-run/event-parser.js +1 -0
  104. package/dist/core/verified-run/event-parser.js.map +1 -1
  105. package/dist/core/verified-run/owned-execution.d.ts +1 -0
  106. package/dist/core/verified-run/owned-execution.d.ts.map +1 -1
  107. package/dist/core/verified-run/owned-execution.js +7 -1
  108. package/dist/core/verified-run/owned-execution.js.map +1 -1
  109. package/dist/core/verified-run/process-projection.d.ts +13 -0
  110. package/dist/core/verified-run/process-projection.d.ts.map +1 -0
  111. package/dist/core/verified-run/process-projection.js +82 -0
  112. package/dist/core/verified-run/process-projection.js.map +1 -0
  113. package/dist/core/verified-run/projection.d.ts.map +1 -1
  114. package/dist/core/verified-run/projection.js +11 -55
  115. package/dist/core/verified-run/projection.js.map +1 -1
  116. package/dist/core/verified-run/run-types.d.ts +1 -0
  117. package/dist/core/verified-run/run-types.d.ts.map +1 -1
  118. package/dist/core/verified-run/run-types.js.map +1 -1
  119. package/dist/core/verified-run/task-execution.d.ts +9 -0
  120. package/dist/core/verified-run/task-execution.d.ts.map +1 -0
  121. package/dist/core/verified-run/task-execution.js +29 -0
  122. package/dist/core/verified-run/task-execution.js.map +1 -0
  123. package/dist/core/verified-run/writer-projection.d.ts.map +1 -1
  124. package/dist/core/verified-run/writer-projection.js +6 -5
  125. package/dist/core/verified-run/writer-projection.js.map +1 -1
  126. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  127. package/dist/modes/interactive/interactive-mode.js +2 -5
  128. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  129. package/dist/modes/interactive/resource-description.d.ts +3 -0
  130. package/dist/modes/interactive/resource-description.d.ts.map +1 -0
  131. package/dist/modes/interactive/resource-description.js +15 -0
  132. package/dist/modes/interactive/resource-description.js.map +1 -0
  133. package/docs/devin-harness.md +121 -0
  134. package/docs/docs.json +4 -0
  135. package/docs/environment-variables.md +2 -1
  136. package/docs/index.md +1 -0
  137. package/docs/loadout-domains/README.md +2 -1
  138. package/docs/loadout-domains/devin-harness.md +72 -0
  139. package/docs/metrics.md +57 -16
  140. package/docs/providers.md +76 -0
  141. package/docs/release-audit-0.98.5.md +17 -0
  142. package/docs/release-audit-0.99.0.md +68 -0
  143. package/docs/run-protocol.md +4 -3
  144. package/docs/runtime-algorithms.md +4 -1
  145. package/docs/sdk.md +9 -5
  146. package/docs/settings.md +1 -1
  147. package/docs/startup-resource-labels-testing.md +47 -0
  148. package/docs/tb21-audit.md +18 -4
  149. package/docs/usage.md +5 -0
  150. package/docs/verified-run-remaining-design.md +881 -0
  151. package/docs/verified-run-testing.md +91 -0
  152. package/docs/verified-run.md +30 -9
  153. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  154. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  155. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  156. package/examples/extensions/gondolin/package-lock.json +2 -2
  157. package/examples/extensions/gondolin/package.json +1 -1
  158. package/examples/extensions/sandbox/package-lock.json +2 -2
  159. package/examples/extensions/sandbox/package.json +1 -1
  160. package/examples/extensions/with-deps/package-lock.json +2 -2
  161. package/examples/extensions/with-deps/package.json +1 -1
  162. package/npm-shrinkwrap.json +18 -18
  163. package/package.json +6 -6
@@ -0,0 +1,50 @@
1
+ /** Default model IDs for every built-in provider. */
2
+ const builtInDefaultModelPerProvider = {
3
+ "amazon-bedrock": "us.anthropic.claude-opus-4-6-v1",
4
+ "ant-ling": "Ring-2.6-1T",
5
+ anthropic: "claude-opus-4-8",
6
+ openai: "gpt-5.4",
7
+ "azure-openai-responses": "gpt-5.4",
8
+ "openai-codex": "gpt-5.5",
9
+ nvidia: "nvidia/nemotron-3-super-120b-a12b",
10
+ deepseek: "deepseek-v4-pro",
11
+ devin: "swe-2",
12
+ meta: "muse-spark-1.3",
13
+ google: "gemini-3.1-pro-preview",
14
+ "google-vertex": "gemini-3.1-pro-preview",
15
+ "github-copilot": "gpt-5.4",
16
+ openrouter: "moonshotai/kimi-k2.6",
17
+ "vercel-ai-gateway": "zai/glm-5.1",
18
+ xai: "grok-4.20-0309-reasoning",
19
+ groq: "openai/gpt-oss-120b",
20
+ cerebras: "zai-glm-4.7",
21
+ zai: "glm-5.1",
22
+ "zai-coding-cn": "glm-5.1",
23
+ mistral: "devstral-medium-latest",
24
+ minimax: "MiniMax-M2.7",
25
+ "minimax-cn": "MiniMax-M2.7",
26
+ moonshotai: "kimi-k2.6",
27
+ "moonshotai-cn": "kimi-k2.6",
28
+ huggingface: "moonshotai/Kimi-K2.6",
29
+ fireworks: "accounts/fireworks/models/kimi-k2p6",
30
+ together: "moonshotai/Kimi-K2.6",
31
+ opencode: "kimi-k2.6",
32
+ "opencode-go": "kimi-k2.6",
33
+ "kimi-coding": "k3",
34
+ "cloudflare-workers-ai": "@cf/moonshotai/kimi-k2.6",
35
+ "cloudflare-ai-gateway": "workers-ai/@cf/moonshotai/kimi-k2.6",
36
+ xiaomi: "mimo-v2.5-pro",
37
+ "xiaomi-token-plan-cn": "mimo-v2.5-pro",
38
+ "xiaomi-token-plan-ams": "mimo-v2.5-pro",
39
+ "xiaomi-token-plan-sgp": "mimo-v2.5-pro",
40
+ zyloo: "claude-opus-4-7",
41
+ };
42
+ /** Recommended defaults for providers supplied through models.json or extensions. */
43
+ const customDefaultModelPerProvider = {
44
+ "modelstudio-maas": "qwen3.8-max",
45
+ };
46
+ export const defaultModelPerProvider = {
47
+ ...builtInDefaultModelPerProvider,
48
+ ...customDefaultModelPerProvider,
49
+ };
50
+ //# sourceMappingURL=provider-default-models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-default-models.js","sourceRoot":"","sources":["../../src/core/provider-default-models.ts"],"names":[],"mappings":"AAEA,qDAAqD;AACrD,MAAM,8BAA8B,GAAG;IACtC,gBAAgB,EAAE,iCAAiC;IACnD,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,iBAAiB;IAC5B,MAAM,EAAE,SAAS;IACjB,wBAAwB,EAAE,SAAS;IACnC,cAAc,EAAE,SAAS;IACzB,MAAM,EAAE,mCAAmC;IAC3C,QAAQ,EAAE,iBAAiB;IAC3B,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE,wBAAwB;IAChC,eAAe,EAAE,wBAAwB;IACzC,gBAAgB,EAAE,SAAS;IAC3B,UAAU,EAAE,sBAAsB;IAClC,mBAAmB,EAAE,aAAa;IAClC,GAAG,EAAE,0BAA0B;IAC/B,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,aAAa;IACvB,GAAG,EAAE,SAAS;IACd,eAAe,EAAE,SAAS;IAC1B,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,cAAc;IACvB,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,WAAW;IACvB,eAAe,EAAE,WAAW;IAC5B,WAAW,EAAE,sBAAsB;IACnC,SAAS,EAAE,qCAAqC;IAChD,QAAQ,EAAE,sBAAsB;IAChC,QAAQ,EAAE,WAAW;IACrB,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,IAAI;IACnB,uBAAuB,EAAE,0BAA0B;IACnD,uBAAuB,EAAE,qCAAqC;IAC9D,MAAM,EAAE,eAAe;IACvB,sBAAsB,EAAE,eAAe;IACvC,uBAAuB,EAAE,eAAe;IACxC,uBAAuB,EAAE,eAAe;IACxC,KAAK,EAAE,iBAAiB;CACgB,CAAC;AAE1C,qFAAqF;AACrF,MAAM,6BAA6B,GAAG;IACrC,kBAAkB,EAAE,aAAa;CACmB,CAAC;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,GAAG,8BAA8B;IACjC,GAAG,6BAA6B;CACvB,CAAC","sourcesContent":["import type { KnownProvider } from \"omk-ai\";\n\n/** Default model IDs for every built-in provider. */\nconst builtInDefaultModelPerProvider = {\n\t\"amazon-bedrock\": \"us.anthropic.claude-opus-4-6-v1\",\n\t\"ant-ling\": \"Ring-2.6-1T\",\n\tanthropic: \"claude-opus-4-8\",\n\topenai: \"gpt-5.4\",\n\t\"azure-openai-responses\": \"gpt-5.4\",\n\t\"openai-codex\": \"gpt-5.5\",\n\tnvidia: \"nvidia/nemotron-3-super-120b-a12b\",\n\tdeepseek: \"deepseek-v4-pro\",\n\tdevin: \"swe-2\",\n\tmeta: \"muse-spark-1.3\",\n\tgoogle: \"gemini-3.1-pro-preview\",\n\t\"google-vertex\": \"gemini-3.1-pro-preview\",\n\t\"github-copilot\": \"gpt-5.4\",\n\topenrouter: \"moonshotai/kimi-k2.6\",\n\t\"vercel-ai-gateway\": \"zai/glm-5.1\",\n\txai: \"grok-4.20-0309-reasoning\",\n\tgroq: \"openai/gpt-oss-120b\",\n\tcerebras: \"zai-glm-4.7\",\n\tzai: \"glm-5.1\",\n\t\"zai-coding-cn\": \"glm-5.1\",\n\tmistral: \"devstral-medium-latest\",\n\tminimax: \"MiniMax-M2.7\",\n\t\"minimax-cn\": \"MiniMax-M2.7\",\n\tmoonshotai: \"kimi-k2.6\",\n\t\"moonshotai-cn\": \"kimi-k2.6\",\n\thuggingface: \"moonshotai/Kimi-K2.6\",\n\tfireworks: \"accounts/fireworks/models/kimi-k2p6\",\n\ttogether: \"moonshotai/Kimi-K2.6\",\n\topencode: \"kimi-k2.6\",\n\t\"opencode-go\": \"kimi-k2.6\",\n\t\"kimi-coding\": \"k3\",\n\t\"cloudflare-workers-ai\": \"@cf/moonshotai/kimi-k2.6\",\n\t\"cloudflare-ai-gateway\": \"workers-ai/@cf/moonshotai/kimi-k2.6\",\n\txiaomi: \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-cn\": \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-ams\": \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-sgp\": \"mimo-v2.5-pro\",\n\tzyloo: \"claude-opus-4-7\",\n} satisfies Record<KnownProvider, string>;\n\n/** Recommended defaults for providers supplied through models.json or extensions. */\nconst customDefaultModelPerProvider = {\n\t\"modelstudio-maas\": \"qwen3.8-max\",\n} as const satisfies Readonly<Record<string, string>>;\n\nexport const defaultModelPerProvider = {\n\t...builtInDefaultModelPerProvider,\n\t...customDefaultModelPerProvider,\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"provider-display-names.d.ts","sourceRoot":"","sources":["../../src/core/provider-display-names.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoClE,CAAC","sourcesContent":["export const BUILT_IN_PROVIDER_DISPLAY_NAMES: Record<string, string> = {\n\tanthropic: \"Anthropic\",\n\t\"amazon-bedrock\": \"Amazon Bedrock\",\n\t\"ant-ling\": \"Ant Ling\",\n\t\"azure-openai-responses\": \"Azure OpenAI Responses\",\n\tcerebras: \"Cerebras\",\n\t\"cloudflare-ai-gateway\": \"Cloudflare AI Gateway\",\n\t\"cloudflare-workers-ai\": \"Cloudflare Workers AI\",\n\tdeepseek: \"DeepSeek\",\n\tfireworks: \"Fireworks\",\n\tgoogle: \"Google Gemini\",\n\t\"google-vertex\": \"Google Vertex AI\",\n\tgroq: \"Groq\",\n\thuggingface: \"Hugging Face\",\n\t\"kimi-coding\": \"Kimi For Coding\",\n\tmeta: \"Meta Model API\",\n\tmistral: \"Mistral\",\n\tminimax: \"MiniMax\",\n\t\"minimax-cn\": \"MiniMax (China)\",\n\tmoonshotai: \"Moonshot AI\",\n\t\"moonshotai-cn\": \"Moonshot AI (China)\",\n\tnvidia: \"NVIDIA NIM\",\n\topencode: \"OpenCode Zen\",\n\t\"opencode-go\": \"OpenCode Go\",\n\topenai: \"OpenAI\",\n\topenrouter: \"OpenRouter\",\n\ttogether: \"Together AI\",\n\t\"vercel-ai-gateway\": \"Vercel AI Gateway\",\n\txai: \"xAI\",\n\tzai: \"ZAI\",\n\t\"zai-coding-cn\": \"ZAI Coding Plan (China)\",\n\txiaomi: \"Xiaomi MiMo\",\n\t\"xiaomi-token-plan-cn\": \"Xiaomi MiMo Token Plan (China)\",\n\t\"xiaomi-token-plan-ams\": \"Xiaomi MiMo Token Plan (Amsterdam)\",\n\t\"xiaomi-token-plan-sgp\": \"Xiaomi MiMo Token Plan (Singapore)\",\n\tzyloo: \"Zyloo\",\n};\n"]}
1
+ {"version":3,"file":"provider-display-names.d.ts","sourceRoot":"","sources":["../../src/core/provider-display-names.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqClE,CAAC","sourcesContent":["export const BUILT_IN_PROVIDER_DISPLAY_NAMES: Record<string, string> = {\n\tanthropic: \"Anthropic\",\n\t\"amazon-bedrock\": \"Amazon Bedrock\",\n\t\"ant-ling\": \"Ant Ling\",\n\t\"azure-openai-responses\": \"Azure OpenAI Responses\",\n\tcerebras: \"Cerebras\",\n\t\"cloudflare-ai-gateway\": \"Cloudflare AI Gateway\",\n\t\"cloudflare-workers-ai\": \"Cloudflare Workers AI\",\n\tdeepseek: \"DeepSeek\",\n\tdevin: \"Devin CLI session token\",\n\tfireworks: \"Fireworks\",\n\tgoogle: \"Google Gemini\",\n\t\"google-vertex\": \"Google Vertex AI\",\n\tgroq: \"Groq\",\n\thuggingface: \"Hugging Face\",\n\t\"kimi-coding\": \"Kimi For Coding\",\n\tmeta: \"Meta Model API\",\n\tmistral: \"Mistral\",\n\tminimax: \"MiniMax\",\n\t\"minimax-cn\": \"MiniMax (China)\",\n\tmoonshotai: \"Moonshot AI\",\n\t\"moonshotai-cn\": \"Moonshot AI (China)\",\n\tnvidia: \"NVIDIA NIM\",\n\topencode: \"OpenCode Zen\",\n\t\"opencode-go\": \"OpenCode Go\",\n\topenai: \"OpenAI\",\n\topenrouter: \"OpenRouter\",\n\ttogether: \"Together AI\",\n\t\"vercel-ai-gateway\": \"Vercel AI Gateway\",\n\txai: \"xAI\",\n\tzai: \"ZAI\",\n\t\"zai-coding-cn\": \"ZAI Coding Plan (China)\",\n\txiaomi: \"Xiaomi MiMo\",\n\t\"xiaomi-token-plan-cn\": \"Xiaomi MiMo Token Plan (China)\",\n\t\"xiaomi-token-plan-ams\": \"Xiaomi MiMo Token Plan (Amsterdam)\",\n\t\"xiaomi-token-plan-sgp\": \"Xiaomi MiMo Token Plan (Singapore)\",\n\tzyloo: \"Zyloo\",\n};\n"]}
@@ -7,6 +7,7 @@ export const BUILT_IN_PROVIDER_DISPLAY_NAMES = {
7
7
  "cloudflare-ai-gateway": "Cloudflare AI Gateway",
8
8
  "cloudflare-workers-ai": "Cloudflare Workers AI",
9
9
  deepseek: "DeepSeek",
10
+ devin: "Devin CLI session token",
10
11
  fireworks: "Fireworks",
11
12
  google: "Google Gemini",
12
13
  "google-vertex": "Google Vertex AI",
@@ -1 +1 @@
1
- {"version":3,"file":"provider-display-names.js","sourceRoot":"","sources":["../../src/core/provider-display-names.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,+BAA+B,GAA2B;IACtE,SAAS,EAAE,WAAW;IACtB,gBAAgB,EAAE,gBAAgB;IAClC,UAAU,EAAE,UAAU;IACtB,wBAAwB,EAAE,wBAAwB;IAClD,QAAQ,EAAE,UAAU;IACpB,uBAAuB,EAAE,uBAAuB;IAChD,uBAAuB,EAAE,uBAAuB;IAChD,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,eAAe;IACvB,eAAe,EAAE,kBAAkB;IACnC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,cAAc;IAC3B,aAAa,EAAE,iBAAiB;IAChC,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,iBAAiB;IAC/B,UAAU,EAAE,aAAa;IACzB,eAAe,EAAE,qBAAqB;IACtC,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,cAAc;IACxB,aAAa,EAAE,aAAa;IAC5B,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,aAAa;IACvB,mBAAmB,EAAE,mBAAmB;IACxC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,eAAe,EAAE,yBAAyB;IAC1C,MAAM,EAAE,aAAa;IACrB,sBAAsB,EAAE,gCAAgC;IACxD,uBAAuB,EAAE,oCAAoC;IAC7D,uBAAuB,EAAE,oCAAoC;IAC7D,KAAK,EAAE,OAAO;CACd,CAAC","sourcesContent":["export const BUILT_IN_PROVIDER_DISPLAY_NAMES: Record<string, string> = {\n\tanthropic: \"Anthropic\",\n\t\"amazon-bedrock\": \"Amazon Bedrock\",\n\t\"ant-ling\": \"Ant Ling\",\n\t\"azure-openai-responses\": \"Azure OpenAI Responses\",\n\tcerebras: \"Cerebras\",\n\t\"cloudflare-ai-gateway\": \"Cloudflare AI Gateway\",\n\t\"cloudflare-workers-ai\": \"Cloudflare Workers AI\",\n\tdeepseek: \"DeepSeek\",\n\tfireworks: \"Fireworks\",\n\tgoogle: \"Google Gemini\",\n\t\"google-vertex\": \"Google Vertex AI\",\n\tgroq: \"Groq\",\n\thuggingface: \"Hugging Face\",\n\t\"kimi-coding\": \"Kimi For Coding\",\n\tmeta: \"Meta Model API\",\n\tmistral: \"Mistral\",\n\tminimax: \"MiniMax\",\n\t\"minimax-cn\": \"MiniMax (China)\",\n\tmoonshotai: \"Moonshot AI\",\n\t\"moonshotai-cn\": \"Moonshot AI (China)\",\n\tnvidia: \"NVIDIA NIM\",\n\topencode: \"OpenCode Zen\",\n\t\"opencode-go\": \"OpenCode Go\",\n\topenai: \"OpenAI\",\n\topenrouter: \"OpenRouter\",\n\ttogether: \"Together AI\",\n\t\"vercel-ai-gateway\": \"Vercel AI Gateway\",\n\txai: \"xAI\",\n\tzai: \"ZAI\",\n\t\"zai-coding-cn\": \"ZAI Coding Plan (China)\",\n\txiaomi: \"Xiaomi MiMo\",\n\t\"xiaomi-token-plan-cn\": \"Xiaomi MiMo Token Plan (China)\",\n\t\"xiaomi-token-plan-ams\": \"Xiaomi MiMo Token Plan (Amsterdam)\",\n\t\"xiaomi-token-plan-sgp\": \"Xiaomi MiMo Token Plan (Singapore)\",\n\tzyloo: \"Zyloo\",\n};\n"]}
1
+ {"version":3,"file":"provider-display-names.js","sourceRoot":"","sources":["../../src/core/provider-display-names.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,+BAA+B,GAA2B;IACtE,SAAS,EAAE,WAAW;IACtB,gBAAgB,EAAE,gBAAgB;IAClC,UAAU,EAAE,UAAU;IACtB,wBAAwB,EAAE,wBAAwB;IAClD,QAAQ,EAAE,UAAU;IACpB,uBAAuB,EAAE,uBAAuB;IAChD,uBAAuB,EAAE,uBAAuB;IAChD,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,eAAe;IACvB,eAAe,EAAE,kBAAkB;IACnC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,cAAc;IAC3B,aAAa,EAAE,iBAAiB;IAChC,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,iBAAiB;IAC/B,UAAU,EAAE,aAAa;IACzB,eAAe,EAAE,qBAAqB;IACtC,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,cAAc;IACxB,aAAa,EAAE,aAAa;IAC5B,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,aAAa;IACvB,mBAAmB,EAAE,mBAAmB;IACxC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,eAAe,EAAE,yBAAyB;IAC1C,MAAM,EAAE,aAAa;IACrB,sBAAsB,EAAE,gCAAgC;IACxD,uBAAuB,EAAE,oCAAoC;IAC7D,uBAAuB,EAAE,oCAAoC;IAC7D,KAAK,EAAE,OAAO;CACd,CAAC","sourcesContent":["export const BUILT_IN_PROVIDER_DISPLAY_NAMES: Record<string, string> = {\n\tanthropic: \"Anthropic\",\n\t\"amazon-bedrock\": \"Amazon Bedrock\",\n\t\"ant-ling\": \"Ant Ling\",\n\t\"azure-openai-responses\": \"Azure OpenAI Responses\",\n\tcerebras: \"Cerebras\",\n\t\"cloudflare-ai-gateway\": \"Cloudflare AI Gateway\",\n\t\"cloudflare-workers-ai\": \"Cloudflare Workers AI\",\n\tdeepseek: \"DeepSeek\",\n\tdevin: \"Devin CLI session token\",\n\tfireworks: \"Fireworks\",\n\tgoogle: \"Google Gemini\",\n\t\"google-vertex\": \"Google Vertex AI\",\n\tgroq: \"Groq\",\n\thuggingface: \"Hugging Face\",\n\t\"kimi-coding\": \"Kimi For Coding\",\n\tmeta: \"Meta Model API\",\n\tmistral: \"Mistral\",\n\tminimax: \"MiniMax\",\n\t\"minimax-cn\": \"MiniMax (China)\",\n\tmoonshotai: \"Moonshot AI\",\n\t\"moonshotai-cn\": \"Moonshot AI (China)\",\n\tnvidia: \"NVIDIA NIM\",\n\topencode: \"OpenCode Zen\",\n\t\"opencode-go\": \"OpenCode Go\",\n\topenai: \"OpenAI\",\n\topenrouter: \"OpenRouter\",\n\ttogether: \"Together AI\",\n\t\"vercel-ai-gateway\": \"Vercel AI Gateway\",\n\txai: \"xAI\",\n\tzai: \"ZAI\",\n\t\"zai-coding-cn\": \"ZAI Coding Plan (China)\",\n\txiaomi: \"Xiaomi MiMo\",\n\t\"xiaomi-token-plan-cn\": \"Xiaomi MiMo Token Plan (China)\",\n\t\"xiaomi-token-plan-ams\": \"Xiaomi MiMo Token Plan (Amsterdam)\",\n\t\"xiaomi-token-plan-sgp\": \"Xiaomi MiMo Token Plan (Singapore)\",\n\tzyloo: \"Zyloo\",\n};\n"]}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Shared provider-harness dispatch: apply one provider's domain loadout when
3
+ * that provider is active, without requiring `OMK_DOMAIN_ROUTING=1`.
4
+ *
5
+ * Each provider harness (native `xai` → `grok-harness`, `devin` → `devin-harness`)
6
+ * supplies a {@link ProviderHarnessSpec}; this module owns loadout composition,
7
+ * runtime application, and policy bridging. The loadout runtime functions are
8
+ * injected ({@link ProviderHarnessRuntime}) so this module stays outside the
9
+ * `sdk.ts` ↔ `loadout-runtime.ts` import cycle and can be tested in isolation.
10
+ */
11
+ import type { LoadoutAccessPolicy } from "./loadout-access-policy.ts";
12
+ import type { LoadoutCommands, LoadoutProfile, LoadoutRole } from "./loadouts.ts";
13
+ import type { SkillCandidate } from "./skill-selector.ts";
14
+ export interface ProviderHarnessSkillSource {
15
+ getSkills(): {
16
+ readonly skills: readonly SkillCandidate[];
17
+ };
18
+ }
19
+ export interface ProviderHarnessRuntimeState {
20
+ readonly activeSkills: readonly string[];
21
+ readonly blockers: readonly string[];
22
+ readonly warnings: readonly string[];
23
+ }
24
+ /** Loadout runtime entry points, structurally typed so callers inject the real implementations. */
25
+ export interface ProviderHarnessRuntime<TSession, TLoader extends ProviderHarnessSkillSource, TState extends ProviderHarnessRuntimeState> {
26
+ readonly applyLoadoutToRuntime: (session: TSession, resourceLoader: TLoader, cwd: string, agentDir: string, request: {
27
+ readonly profile: LoadoutProfile;
28
+ readonly role: LoadoutRole;
29
+ }) => TState;
30
+ readonly createLoadoutPolicyFromRuntimeState: (state: TState, options: {
31
+ readonly cwd: string;
32
+ readonly commands?: LoadoutCommands;
33
+ }) => LoadoutAccessPolicy;
34
+ }
35
+ export interface ProviderHarnessDispatchInput<TSession, TLoader extends ProviderHarnessSkillSource> {
36
+ readonly provider: string | undefined;
37
+ readonly session: TSession;
38
+ readonly resourceLoader: TLoader;
39
+ readonly cwd: string;
40
+ readonly agentDir?: string;
41
+ readonly env?: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>;
42
+ /** When set, narrow the harness skill grant to the documented 2–3 subset. */
43
+ readonly task?: string;
44
+ /** Optional path hints scored with the task text. */
45
+ readonly paths?: readonly string[];
46
+ }
47
+ export interface ProviderHarnessDispatchResult<TState extends ProviderHarnessRuntimeState> {
48
+ readonly loadoutAccessPolicy: LoadoutAccessPolicy | undefined;
49
+ readonly warnings: readonly string[];
50
+ readonly runtimeState: TState | undefined;
51
+ }
52
+ export interface ProviderHarnessSpec {
53
+ /** Domain loadout id registered in `domain-loadouts.ts`. */
54
+ readonly domainId: string;
55
+ /** True when `provider` is the harness's provider and its auto-apply flag is on. */
56
+ readonly applies: (provider: string | undefined, env: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>) => boolean;
57
+ /** Smallest skill grant for the task from the live inventory. */
58
+ readonly selectSkills: (task: string, inventory: readonly SkillCandidate[], options: {
59
+ readonly paths?: readonly string[];
60
+ }) => readonly string[];
61
+ }
62
+ export declare function tryProviderHarnessDispatch<TSession, TLoader extends ProviderHarnessSkillSource, TState extends ProviderHarnessRuntimeState>(spec: ProviderHarnessSpec, runtime: ProviderHarnessRuntime<TSession, TLoader, TState>, input: ProviderHarnessDispatchInput<TSession, TLoader>): ProviderHarnessDispatchResult<TState>;
63
+ //# sourceMappingURL=provider-harness-dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-harness-dispatch.d.ts","sourceRoot":"","sources":["../../src/core/provider-harness-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,0BAA0B;IAC1C,SAAS,IAAI;QAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAA;KAAE,CAAC;CAC5D;AAED,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,mGAAmG;AACnG,MAAM,WAAW,sBAAsB,CACtC,QAAQ,EACR,OAAO,SAAS,0BAA0B,EAC1C,MAAM,SAAS,2BAA2B;IAE1C,QAAQ,CAAC,qBAAqB,EAAE,CAC/B,OAAO,EAAE,QAAQ,EACjB,cAAc,EAAE,OAAO,EACvB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM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AAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,CACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,KACjE,OAAO,CAAC;IACb,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,CACtB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,cAAc,EAAE,EACpC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,KAC3C,SAAS,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,0BAA0B,CACzC,QAAQ,EACR,OAAO,SAAS,0BAA0B,EAC1C,MAAM,SAAS,2BAA2B,EAE1C,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,sBAAsB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAC1D,KAAK,EAAE,4BAA4B,CAAC,QAAQ,EAAE,OAAO,CAAC,GACpD,6BAA6B,CAAC,MAAM,CAAC,CAgCvC","sourcesContent":["/**\n * Shared provider-harness dispatch: apply one provider's domain loadout when\n * that provider is active, without requiring `OMK_DOMAIN_ROUTING=1`.\n *\n * Each provider harness (native `xai` → `grok-harness`, `devin` → `devin-harness`)\n * supplies a {@link ProviderHarnessSpec}; this module owns loadout composition,\n * runtime application, and policy bridging. The loadout runtime functions are\n * injected ({@link ProviderHarnessRuntime}) so this module stays outside the\n * `sdk.ts` ↔ `loadout-runtime.ts` import cycle and can be tested in isolation.\n */\n\nimport { getAgentDir } from \"../config.ts\";\nimport type { LoadoutAccessPolicy } from \"./loadout-access-policy.ts\";\nimport { type ComposedLoadout, composeLoadout } from \"./loadout-compose.ts\";\nimport { uniqueSorted } from \"./loadout-safety.ts\";\nimport type { LoadoutCommands, LoadoutProfile, LoadoutRole } from \"./loadouts.ts\";\nimport type { SkillCandidate } from \"./skill-selector.ts\";\n\nexport interface ProviderHarnessSkillSource {\n\tgetSkills(): { readonly skills: readonly SkillCandidate[] };\n}\n\nexport interface ProviderHarnessRuntimeState {\n\treadonly activeSkills: readonly string[];\n\treadonly blockers: readonly string[];\n\treadonly warnings: readonly string[];\n}\n\n/** Loadout runtime entry points, structurally typed so callers inject the real implementations. */\nexport interface ProviderHarnessRuntime<\n\tTSession,\n\tTLoader extends ProviderHarnessSkillSource,\n\tTState extends ProviderHarnessRuntimeState,\n> {\n\treadonly applyLoadoutToRuntime: (\n\t\tsession: TSession,\n\t\tresourceLoader: TLoader,\n\t\tcwd: string,\n\t\tagentDir: string,\n\t\trequest: { readonly profile: LoadoutProfile; readonly role: LoadoutRole },\n\t) => TState;\n\treadonly createLoadoutPolicyFromRuntimeState: (\n\t\tstate: TState,\n\t\toptions: { readonly cwd: string; readonly commands?: LoadoutCommands },\n\t) => LoadoutAccessPolicy;\n}\n\nexport interface ProviderHarnessDispatchInput<TSession, TLoader extends ProviderHarnessSkillSource> {\n\treadonly provider: string | undefined;\n\treadonly session: TSession;\n\treadonly resourceLoader: TLoader;\n\treadonly cwd: string;\n\treadonly agentDir?: string;\n\treadonly env?: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>;\n\t/** When set, narrow the harness skill grant to the documented 2–3 subset. */\n\treadonly task?: string;\n\t/** Optional path hints scored with the task text. */\n\treadonly paths?: readonly string[];\n}\n\nexport interface ProviderHarnessDispatchResult<TState extends ProviderHarnessRuntimeState> {\n\treadonly loadoutAccessPolicy: LoadoutAccessPolicy | undefined;\n\treadonly warnings: readonly string[];\n\treadonly runtimeState: TState | undefined;\n}\n\nexport interface ProviderHarnessSpec {\n\t/** Domain loadout id registered in `domain-loadouts.ts`. */\n\treadonly domainId: string;\n\t/** True when `provider` is the harness's provider and its auto-apply flag is on. */\n\treadonly applies: (\n\t\tprovider: string | undefined,\n\t\tenv: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>,\n\t) => boolean;\n\t/** Smallest skill grant for the task from the live inventory. */\n\treadonly selectSkills: (\n\t\ttask: string,\n\t\tinventory: readonly SkillCandidate[],\n\t\toptions: { readonly paths?: readonly string[] },\n\t) => readonly string[];\n}\n\nexport function tryProviderHarnessDispatch<\n\tTSession,\n\tTLoader extends ProviderHarnessSkillSource,\n\tTState extends ProviderHarnessRuntimeState,\n>(\n\tspec: ProviderHarnessSpec,\n\truntime: ProviderHarnessRuntime<TSession, TLoader, TState>,\n\tinput: ProviderHarnessDispatchInput<TSession, TLoader>,\n): ProviderHarnessDispatchResult<TState> {\n\tconst env = input.env ?? process.env;\n\tif (!spec.applies(input.provider, env)) {\n\t\treturn { loadoutAccessPolicy: undefined, warnings: [], runtimeState: undefined };\n\t}\n\n\tconst agentDir = input.agentDir ?? getAgentDir();\n\ttry {\n\t\tconst profile = composeProviderHarnessProfile(spec, input);\n\t\tconst state = runtime.applyLoadoutToRuntime(input.session, input.resourceLoader, input.cwd, agentDir, {\n\t\t\tprofile,\n\t\t\trole: \"coder\",\n\t\t});\n\t\tif (state.blockers.length > 0) {\n\t\t\treturn { loadoutAccessPolicy: undefined, warnings: state.blockers, runtimeState: state };\n\t\t}\n\t\tconst policy = runtime.createLoadoutPolicyFromRuntimeState(state, {\n\t\t\tcwd: input.cwd,\n\t\t\tcommands: profile.commands,\n\t\t});\n\t\treturn {\n\t\t\tloadoutAccessPolicy: policy,\n\t\t\twarnings: uniqueSorted([\n\t\t\t\t...state.warnings,\n\t\t\t\t...(input.task?.trim() && state.activeSkills.length === 0 ? [`no ${spec.domainId} skill signals`] : []),\n\t\t\t]),\n\t\t\truntimeState: state,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\treturn { loadoutAccessPolicy: undefined, warnings: [message], runtimeState: undefined };\n\t}\n}\n\nfunction composeProviderHarnessProfile(\n\tspec: ProviderHarnessSpec,\n\tinput: ProviderHarnessDispatchInput<unknown, ProviderHarnessSkillSource>,\n): ComposedLoadout {\n\tconst profile = composeLoadout(\"coder\", spec.domainId);\n\tconst task = input.task?.trim();\n\tif (!task) {\n\t\treturn { ...profile, skills: { allow: [{ kind: \"skill\", names: [] }] } };\n\t}\n\n\tconst inventory = input.resourceLoader.getSkills().skills;\n\tconst selected = spec.selectSkills(task, inventory, { paths: input.paths });\n\treturn {\n\t\t...profile,\n\t\tskills: { allow: [{ kind: \"skill\", names: [...selected] }] },\n\t};\n}\n"]}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Shared provider-harness dispatch: apply one provider's domain loadout when
3
+ * that provider is active, without requiring `OMK_DOMAIN_ROUTING=1`.
4
+ *
5
+ * Each provider harness (native `xai` → `grok-harness`, `devin` → `devin-harness`)
6
+ * supplies a {@link ProviderHarnessSpec}; this module owns loadout composition,
7
+ * runtime application, and policy bridging. The loadout runtime functions are
8
+ * injected ({@link ProviderHarnessRuntime}) so this module stays outside the
9
+ * `sdk.ts` ↔ `loadout-runtime.ts` import cycle and can be tested in isolation.
10
+ */
11
+ import { getAgentDir } from "../config.js";
12
+ import { composeLoadout } from "./loadout-compose.js";
13
+ import { uniqueSorted } from "./loadout-safety.js";
14
+ export function tryProviderHarnessDispatch(spec, runtime, input) {
15
+ const env = input.env ?? process.env;
16
+ if (!spec.applies(input.provider, env)) {
17
+ return { loadoutAccessPolicy: undefined, warnings: [], runtimeState: undefined };
18
+ }
19
+ const agentDir = input.agentDir ?? getAgentDir();
20
+ try {
21
+ const profile = composeProviderHarnessProfile(spec, input);
22
+ const state = runtime.applyLoadoutToRuntime(input.session, input.resourceLoader, input.cwd, agentDir, {
23
+ profile,
24
+ role: "coder",
25
+ });
26
+ if (state.blockers.length > 0) {
27
+ return { loadoutAccessPolicy: undefined, warnings: state.blockers, runtimeState: state };
28
+ }
29
+ const policy = runtime.createLoadoutPolicyFromRuntimeState(state, {
30
+ cwd: input.cwd,
31
+ commands: profile.commands,
32
+ });
33
+ return {
34
+ loadoutAccessPolicy: policy,
35
+ warnings: uniqueSorted([
36
+ ...state.warnings,
37
+ ...(input.task?.trim() && state.activeSkills.length === 0 ? [`no ${spec.domainId} skill signals`] : []),
38
+ ]),
39
+ runtimeState: state,
40
+ };
41
+ }
42
+ catch (error) {
43
+ const message = error instanceof Error ? error.message : String(error);
44
+ return { loadoutAccessPolicy: undefined, warnings: [message], runtimeState: undefined };
45
+ }
46
+ }
47
+ function composeProviderHarnessProfile(spec, input) {
48
+ const profile = composeLoadout("coder", spec.domainId);
49
+ const task = input.task?.trim();
50
+ if (!task) {
51
+ return { ...profile, skills: { allow: [{ kind: "skill", names: [] }] } };
52
+ }
53
+ const inventory = input.resourceLoader.getSkills().skills;
54
+ const selected = spec.selectSkills(task, inventory, { paths: input.paths });
55
+ return {
56
+ ...profile,
57
+ skills: { allow: [{ kind: "skill", names: [...selected] }] },
58
+ };
59
+ }
60
+ //# sourceMappingURL=provider-harness-dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-harness-dispatch.js","sourceRoot":"","sources":["../../src/core/provider-harness-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAwB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAoEnD,MAAM,UAAU,0BAA0B,CAKzC,IAAyB,EACzB,OAA0D,EAC1D,KAAsD,EACd;IACxC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACrC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;QACxC,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;IAClF,CAAC;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ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CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;IACzF,CAAC;AAAA,CACD;AAED,SAAS,6BAA6B,CACrC,IAAyB,EACzB,KAAwE,EACtD;IAClB,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;IAChC,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1E,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAC5E,OAAO;QACN,GAAG,OAAO;QACV,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,EAAE;KAC5D,CAAC;AAAA,CACF","sourcesContent":["/**\n * Shared provider-harness dispatch: apply one provider's domain loadout when\n * that provider is active, without requiring `OMK_DOMAIN_ROUTING=1`.\n *\n * Each provider harness (native `xai` → `grok-harness`, `devin` → `devin-harness`)\n * supplies a {@link ProviderHarnessSpec}; this module owns loadout composition,\n * runtime application, and policy bridging. The loadout runtime functions are\n * injected ({@link ProviderHarnessRuntime}) so this module stays outside the\n * `sdk.ts` ↔ `loadout-runtime.ts` import cycle and can be tested in isolation.\n */\n\nimport { getAgentDir } from \"../config.ts\";\nimport type { LoadoutAccessPolicy } from \"./loadout-access-policy.ts\";\nimport { type ComposedLoadout, composeLoadout } from \"./loadout-compose.ts\";\nimport { uniqueSorted } from \"./loadout-safety.ts\";\nimport type { LoadoutCommands, LoadoutProfile, LoadoutRole } from \"./loadouts.ts\";\nimport type { SkillCandidate } from \"./skill-selector.ts\";\n\nexport interface ProviderHarnessSkillSource {\n\tgetSkills(): { readonly skills: readonly SkillCandidate[] };\n}\n\nexport interface ProviderHarnessRuntimeState {\n\treadonly activeSkills: readonly string[];\n\treadonly blockers: readonly string[];\n\treadonly warnings: readonly string[];\n}\n\n/** Loadout runtime entry points, structurally typed so callers inject the real implementations. */\nexport interface ProviderHarnessRuntime<\n\tTSession,\n\tTLoader extends ProviderHarnessSkillSource,\n\tTState extends ProviderHarnessRuntimeState,\n> {\n\treadonly applyLoadoutToRuntime: (\n\t\tsession: TSession,\n\t\tresourceLoader: TLoader,\n\t\tcwd: string,\n\t\tagentDir: string,\n\t\trequest: { readonly profile: LoadoutProfile; readonly role: LoadoutRole },\n\t) => TState;\n\treadonly createLoadoutPolicyFromRuntimeState: (\n\t\tstate: TState,\n\t\toptions: { readonly cwd: string; readonly commands?: LoadoutCommands },\n\t) => LoadoutAccessPolicy;\n}\n\nexport interface ProviderHarnessDispatchInput<TSession, TLoader extends ProviderHarnessSkillSource> {\n\treadonly provider: string | undefined;\n\treadonly session: TSession;\n\treadonly resourceLoader: TLoader;\n\treadonly cwd: string;\n\treadonly agentDir?: string;\n\treadonly env?: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>;\n\t/** When set, narrow the harness skill grant to the documented 2–3 subset. */\n\treadonly task?: string;\n\t/** Optional path hints scored with the task text. */\n\treadonly paths?: readonly string[];\n}\n\nexport interface ProviderHarnessDispatchResult<TState extends ProviderHarnessRuntimeState> {\n\treadonly loadoutAccessPolicy: LoadoutAccessPolicy | undefined;\n\treadonly warnings: readonly string[];\n\treadonly runtimeState: TState | undefined;\n}\n\nexport interface ProviderHarnessSpec {\n\t/** Domain loadout id registered in `domain-loadouts.ts`. */\n\treadonly domainId: string;\n\t/** True when `provider` is the harness's provider and its auto-apply flag is on. */\n\treadonly applies: (\n\t\tprovider: string | undefined,\n\t\tenv: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>,\n\t) => boolean;\n\t/** Smallest skill grant for the task from the live inventory. */\n\treadonly selectSkills: (\n\t\ttask: string,\n\t\tinventory: readonly SkillCandidate[],\n\t\toptions: { readonly paths?: readonly string[] },\n\t) => readonly string[];\n}\n\nexport function tryProviderHarnessDispatch<\n\tTSession,\n\tTLoader extends ProviderHarnessSkillSource,\n\tTState extends ProviderHarnessRuntimeState,\n>(\n\tspec: ProviderHarnessSpec,\n\truntime: ProviderHarnessRuntime<TSession, TLoader, TState>,\n\tinput: ProviderHarnessDispatchInput<TSession, TLoader>,\n): ProviderHarnessDispatchResult<TState> {\n\tconst env = input.env ?? process.env;\n\tif (!spec.applies(input.provider, env)) {\n\t\treturn { loadoutAccessPolicy: undefined, warnings: [], runtimeState: undefined };\n\t}\n\n\tconst agentDir = input.agentDir ?? getAgentDir();\n\ttry {\n\t\tconst profile = composeProviderHarnessProfile(spec, input);\n\t\tconst state = runtime.applyLoadoutToRuntime(input.session, input.resourceLoader, input.cwd, agentDir, {\n\t\t\tprofile,\n\t\t\trole: \"coder\",\n\t\t});\n\t\tif (state.blockers.length > 0) {\n\t\t\treturn { loadoutAccessPolicy: undefined, warnings: state.blockers, runtimeState: state };\n\t\t}\n\t\tconst policy = runtime.createLoadoutPolicyFromRuntimeState(state, {\n\t\t\tcwd: input.cwd,\n\t\t\tcommands: profile.commands,\n\t\t});\n\t\treturn {\n\t\t\tloadoutAccessPolicy: policy,\n\t\t\twarnings: uniqueSorted([\n\t\t\t\t...state.warnings,\n\t\t\t\t...(input.task?.trim() && state.activeSkills.length === 0 ? [`no ${spec.domainId} skill signals`] : []),\n\t\t\t]),\n\t\t\truntimeState: state,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\treturn { loadoutAccessPolicy: undefined, warnings: [message], runtimeState: undefined };\n\t}\n}\n\nfunction composeProviderHarnessProfile(\n\tspec: ProviderHarnessSpec,\n\tinput: ProviderHarnessDispatchInput<unknown, ProviderHarnessSkillSource>,\n): ComposedLoadout {\n\tconst profile = composeLoadout(\"coder\", spec.domainId);\n\tconst task = input.task?.trim();\n\tif (!task) {\n\t\treturn { ...profile, skills: { allow: [{ kind: \"skill\", names: [] }] } };\n\t}\n\n\tconst inventory = input.resourceLoader.getSkills().skills;\n\tconst selected = spec.selectSkills(task, inventory, { paths: input.paths });\n\treturn {\n\t\t...profile,\n\t\tskills: { allow: [{ kind: \"skill\", names: [...selected] }] },\n\t};\n}\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Devin CLI subscription usage: maps the account `GetUserStatus` payload onto
3
+ * the status-rail windows. The token is whatever `/login devin` stored or an
4
+ * already-owned `DEVIN_API_KEY`; this module never reads the environment itself.
5
+ */
6
+ import { type DevinUserStatus } from "omk-ai";
7
+ import type { FetchLike, SubscriptionUsageSnapshot } from "./provider-usage-types.ts";
8
+ /**
9
+ * Map a decoded `GetUserStatus` payload to rail windows. The server reports
10
+ * remaining percents; the rail renders used percents. A quota window is shown
11
+ * when the plan does not hide it and the wire carried either the percent or
12
+ * its reset time — a reset without a percent reads as exhausted.
13
+ */
14
+ export declare function parseDevinUsageSnapshot(status: DevinUserStatus): Pick<SubscriptionUsageSnapshot, "windows" | "message">;
15
+ export declare function fetchDevinUsage(label: string, apiKey: string, fetchImpl: FetchLike): Promise<SubscriptionUsageSnapshot>;
16
+ //# sourceMappingURL=provider-usage-devin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-usage-devin.d.ts","sourceRoot":"","sources":["../../src/core/provider-usage-devin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,QAAQ,CAAC;AAElE,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAyB,EAA2B,MAAM,2BAA2B,CAAC;AAE/G;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,eAAe,GACrB,IAAI,CAAC,yBAAyB,EAAE,SAAS,GAAG,SAAS,CAAC,CA0BxD;AAoBD,wBAAsB,eAAe,CACpC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,GAClB,OAAO,CAAC,yBAAyB,CAAC,CAKpC","sourcesContent":["/**\n * Devin CLI subscription usage: maps the account `GetUserStatus` payload onto\n * the status-rail windows. The token is whatever `/login devin` stored or an\n * already-owned `DEVIN_API_KEY`; this module never reads the environment itself.\n */\n\nimport { type DevinUserStatus, getDevinUserStatus } from \"omk-ai\";\nimport { clampPercent, usageText } from \"./provider-usage-text.ts\";\nimport type { FetchLike, SubscriptionUsageSnapshot, SubscriptionUsageWindow } from \"./provider-usage-types.ts\";\n\n/**\n * Map a decoded `GetUserStatus` payload to rail windows. The server reports\n * remaining percents; the rail renders used percents. A quota window is shown\n * when the plan does not hide it and the wire carried either the percent or\n * its reset time — a reset without a percent reads as exhausted.\n */\nexport function parseDevinUsageSnapshot(\n\tstatus: DevinUserStatus,\n): Pick<SubscriptionUsageSnapshot, \"windows\" | \"message\"> {\n\tconst windows: SubscriptionUsageWindow[] = [];\n\tconst quotaWindow = (\n\t\tlabel: string,\n\t\thidden: boolean | undefined,\n\t\tremainingPercent: number | undefined,\n\t\tresetsAt: number | undefined,\n\t): SubscriptionUsageWindow | undefined => {\n\t\tif (hidden === true || (remainingPercent === undefined && resetsAt === undefined)) return undefined;\n\t\treturn {\n\t\t\tlabel,\n\t\t\tusedPercent: clampPercent(100 - (remainingPercent ?? 0)),\n\t\t\t...(resetsAt === undefined ? {} : { resetsAt }),\n\t\t};\n\t};\n\tconst daily = quotaWindow(\"1D\", status.hideDailyQuota, status.dailyQuotaRemainingPercent, status.dailyQuotaResetAt);\n\tconst weekly = quotaWindow(\n\t\t\"7D\",\n\t\tstatus.hideWeeklyQuota,\n\t\tstatus.weeklyQuotaRemainingPercent,\n\t\tstatus.weeklyQuotaResetAt,\n\t);\n\tif (daily) windows.push(daily);\n\tif (weekly) windows.push(weekly);\n\tconst message = devinUsageMessage(status);\n\treturn { windows, ...(message === undefined ? {} : { message }) };\n}\n\n/** Plan name plus credit balances for plans whose quota windows are not reported. */\nfunction devinUsageMessage(status: DevinUserStatus): string | undefined {\n\tconst parts: string[] = [];\n\tconst plan = usageText(status.planName);\n\tif (plan) parts.push(plan);\n\tconst balances: readonly (readonly [string, number | undefined])[] = [\n\t\t[\"prompt\", status.availablePromptCredits],\n\t\t[\"flow\", status.availableFlowCredits],\n\t\t[\"flex\", status.availableFlexCredits],\n\t];\n\tconst credits: string[] = [];\n\tfor (const [name, amount] of balances) {\n\t\tif (amount !== undefined) credits.push(`${amount} ${name}`);\n\t}\n\tif (credits.length > 0) parts.push(credits.join(\" · \"));\n\treturn parts.length > 0 ? parts.join(\" · \") : undefined;\n}\n\nexport async function fetchDevinUsage(\n\tlabel: string,\n\tapiKey: string,\n\tfetchImpl: FetchLike,\n): Promise<SubscriptionUsageSnapshot> {\n\tconst status = await getDevinUserStatus(apiKey, AbortSignal.timeout(10_000), fetchImpl);\n\tconst { windows, message } = parseDevinUsageSnapshot(status);\n\tif (windows.length > 0) return { label, windows, ...(message === undefined ? {} : { message }) };\n\treturn { label, windows: [], message: message ?? \"usage unavailable\" };\n}\n"]}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Devin CLI subscription usage: maps the account `GetUserStatus` payload onto
3
+ * the status-rail windows. The token is whatever `/login devin` stored or an
4
+ * already-owned `DEVIN_API_KEY`; this module never reads the environment itself.
5
+ */
6
+ import { getDevinUserStatus } from "omk-ai";
7
+ import { clampPercent, usageText } from "./provider-usage-text.js";
8
+ /**
9
+ * Map a decoded `GetUserStatus` payload to rail windows. The server reports
10
+ * remaining percents; the rail renders used percents. A quota window is shown
11
+ * when the plan does not hide it and the wire carried either the percent or
12
+ * its reset time — a reset without a percent reads as exhausted.
13
+ */
14
+ export function parseDevinUsageSnapshot(status) {
15
+ const windows = [];
16
+ const quotaWindow = (label, hidden, remainingPercent, resetsAt) => {
17
+ if (hidden === true || (remainingPercent === undefined && resetsAt === undefined))
18
+ return undefined;
19
+ return {
20
+ label,
21
+ usedPercent: clampPercent(100 - (remainingPercent ?? 0)),
22
+ ...(resetsAt === undefined ? {} : { resetsAt }),
23
+ };
24
+ };
25
+ const daily = quotaWindow("1D", status.hideDailyQuota, status.dailyQuotaRemainingPercent, status.dailyQuotaResetAt);
26
+ const weekly = quotaWindow("7D", status.hideWeeklyQuota, status.weeklyQuotaRemainingPercent, status.weeklyQuotaResetAt);
27
+ if (daily)
28
+ windows.push(daily);
29
+ if (weekly)
30
+ windows.push(weekly);
31
+ const message = devinUsageMessage(status);
32
+ return { windows, ...(message === undefined ? {} : { message }) };
33
+ }
34
+ /** Plan name plus credit balances for plans whose quota windows are not reported. */
35
+ function devinUsageMessage(status) {
36
+ const parts = [];
37
+ const plan = usageText(status.planName);
38
+ if (plan)
39
+ parts.push(plan);
40
+ const balances = [
41
+ ["prompt", status.availablePromptCredits],
42
+ ["flow", status.availableFlowCredits],
43
+ ["flex", status.availableFlexCredits],
44
+ ];
45
+ const credits = [];
46
+ for (const [name, amount] of balances) {
47
+ if (amount !== undefined)
48
+ credits.push(`${amount} ${name}`);
49
+ }
50
+ if (credits.length > 0)
51
+ parts.push(credits.join(" · "));
52
+ return parts.length > 0 ? parts.join(" · ") : undefined;
53
+ }
54
+ export async function fetchDevinUsage(label, apiKey, fetchImpl) {
55
+ const status = await getDevinUserStatus(apiKey, AbortSignal.timeout(10_000), fetchImpl);
56
+ const { windows, message } = parseDevinUsageSnapshot(status);
57
+ if (windows.length > 0)
58
+ return { label, windows, ...(message === undefined ? {} : { message }) };
59
+ return { label, windows: [], message: message ?? "usage unavailable" };
60
+ }
61
+ //# sourceMappingURL=provider-usage-devin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-usage-devin.js","sourceRoot":"","sources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AAuB,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACjG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,CAAC;AAAA,CACvE","sourcesContent":["/**\n * Devin CLI subscription usage: maps the account `GetUserStatus` payload onto\n * the status-rail windows. The token is whatever `/login devin` stored or an\n * already-owned `DEVIN_API_KEY`; this module never reads the environment itself.\n */\n\nimport { type DevinUserStatus, getDevinUserStatus } from \"omk-ai\";\nimport { clampPercent, usageText } from \"./provider-usage-text.ts\";\nimport type { FetchLike, SubscriptionUsageSnapshot, SubscriptionUsageWindow } from \"./provider-usage-types.ts\";\n\n/**\n * Map a decoded `GetUserStatus` payload to rail windows. The server reports\n * remaining percents; the rail renders used percents. A quota window is shown\n * when the plan does not hide it and the wire carried either the percent or\n * its reset time — a reset without a percent reads as exhausted.\n */\nexport function parseDevinUsageSnapshot(\n\tstatus: DevinUserStatus,\n): Pick<SubscriptionUsageSnapshot, \"windows\" | \"message\"> {\n\tconst windows: SubscriptionUsageWindow[] = [];\n\tconst quotaWindow = (\n\t\tlabel: string,\n\t\thidden: boolean | undefined,\n\t\tremainingPercent: number | undefined,\n\t\tresetsAt: number | undefined,\n\t): SubscriptionUsageWindow | undefined => {\n\t\tif (hidden === true || (remainingPercent === undefined && resetsAt === undefined)) return undefined;\n\t\treturn {\n\t\t\tlabel,\n\t\t\tusedPercent: clampPercent(100 - (remainingPercent ?? 0)),\n\t\t\t...(resetsAt === undefined ? {} : { resetsAt }),\n\t\t};\n\t};\n\tconst daily = quotaWindow(\"1D\", status.hideDailyQuota, status.dailyQuotaRemainingPercent, status.dailyQuotaResetAt);\n\tconst weekly = quotaWindow(\n\t\t\"7D\",\n\t\tstatus.hideWeeklyQuota,\n\t\tstatus.weeklyQuotaRemainingPercent,\n\t\tstatus.weeklyQuotaResetAt,\n\t);\n\tif (daily) windows.push(daily);\n\tif (weekly) windows.push(weekly);\n\tconst message = devinUsageMessage(status);\n\treturn { windows, ...(message === undefined ? {} : { message }) };\n}\n\n/** Plan name plus credit balances for plans whose quota windows are not reported. */\nfunction devinUsageMessage(status: DevinUserStatus): string | undefined {\n\tconst parts: string[] = [];\n\tconst plan = usageText(status.planName);\n\tif (plan) parts.push(plan);\n\tconst balances: readonly (readonly [string, number | undefined])[] = [\n\t\t[\"prompt\", status.availablePromptCredits],\n\t\t[\"flow\", status.availableFlowCredits],\n\t\t[\"flex\", status.availableFlexCredits],\n\t];\n\tconst credits: string[] = [];\n\tfor (const [name, amount] of balances) {\n\t\tif (amount !== undefined) credits.push(`${amount} ${name}`);\n\t}\n\tif (credits.length > 0) parts.push(credits.join(\" · \"));\n\treturn parts.length > 0 ? parts.join(\" · \") : undefined;\n}\n\nexport async function fetchDevinUsage(\n\tlabel: string,\n\tapiKey: string,\n\tfetchImpl: FetchLike,\n): Promise<SubscriptionUsageSnapshot> {\n\tconst status = await getDevinUserStatus(apiKey, AbortSignal.timeout(10_000), fetchImpl);\n\tconst { windows, message } = parseDevinUsageSnapshot(status);\n\tif (windows.length > 0) return { label, windows, ...(message === undefined ? {} : { message }) };\n\treturn { label, windows: [], message: message ?? \"usage unavailable\" };\n}\n"]}
@@ -0,0 +1,5 @@
1
+ /** Small value helpers shared by the subscription-usage parsers. */
2
+ /** Strip control/format characters and collapse whitespace in server-supplied text. */
3
+ export declare function usageText(value: string | undefined): string | undefined;
4
+ export declare function clampPercent(value: number): number;
5
+ //# sourceMappingURL=provider-usage-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-usage-text.d.ts","sourceRoot":"","sources":["../../src/core/provider-usage-text.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,uFAAuF;AACvF,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOvE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD","sourcesContent":["/** Small value helpers shared by the subscription-usage parsers. */\n\n/** Strip control/format characters and collapse whitespace in server-supplied text. */\nexport function usageText(value: string | undefined): string | undefined {\n\tif (value === undefined) return undefined;\n\tconst safe = value\n\t\t.replace(/[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u206f]/g, \"\")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n\treturn safe ? safe.slice(0, 40) : undefined;\n}\n\nexport function clampPercent(value: number): number {\n\treturn Number(Math.max(0, Math.min(100, value)).toFixed(2));\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /** Small value helpers shared by the subscription-usage parsers. */
2
+ /** Strip control/format characters and collapse whitespace in server-supplied text. */
3
+ export function usageText(value) {
4
+ if (value === undefined)
5
+ return undefined;
6
+ const safe = value
7
+ .replace(/[\u0000-\u001f\u007f-\u009f\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g, "")
8
+ .replace(/\s+/g, " ")
9
+ .trim();
10
+ return safe ? safe.slice(0, 40) : undefined;
11
+ }
12
+ export function clampPercent(value) {
13
+ return Number(Math.max(0, Math.min(100, value)).toFixed(2));
14
+ }
15
+ //# sourceMappingURL=provider-usage-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-usage-text.js","sourceRoot":"","sources":["../../src/core/provider-usage-text.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,uFAAuF;AACvF,MAAM,UAAU,SAAS,CAAC,KAAyB,EAAsB;IACxE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,IAAI,GAAG,KAAK;SAChB,OAAO,CAAC,sEAAsE,EAAE,EAAE,CAAC;SACnF,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;IACT,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAAA,CAC5C;AAED,MAAM,UAAU,YAAY,CAAC,KAAa,EAAU;IACnD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAAA,CAC5D","sourcesContent":["/** Small value helpers shared by the subscription-usage parsers. */\n\n/** Strip control/format characters and collapse whitespace in server-supplied text. */\nexport function usageText(value: string | undefined): string | undefined {\n\tif (value === undefined) return undefined;\n\tconst safe = value\n\t\t.replace(/[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u206f]/g, \"\")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n\treturn safe ? safe.slice(0, 40) : undefined;\n}\n\nexport function clampPercent(value: number): number {\n\treturn Number(Math.max(0, Math.min(100, value)).toFixed(2));\n}\n"]}
@@ -27,7 +27,7 @@ export type PassiveUsageEntry = {
27
27
  readonly primary?: ObservedCodexWindow;
28
28
  readonly secondary?: ObservedCodexWindow;
29
29
  };
30
- export type UsageKind = "codex" | "claude" | "kimi" | "zai" | "grok" | "qwen-token-plan" | "unavailable";
30
+ export type UsageKind = "codex" | "claude" | "kimi" | "zai" | "grok" | "devin" | "qwen-token-plan" | "unavailable";
31
31
  export type CredentialCandidate = {
32
32
  readonly provider: string;
33
33
  readonly oauthOnly: boolean;
@@ -39,4 +39,5 @@ export type SubscriptionUsageSource = {
39
39
  readonly ttlMs: number;
40
40
  readonly unavailableMessage?: string;
41
41
  };
42
+ export type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
42
43
  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AQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,iBAAiB,GAAG,aAAa,CAAC;AACzG,MAAM,MAAM,mBAAmB,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7F,MAAM,MAAM,uBAAuB,GAAG;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC","sourcesContent":["export type SubscriptionUsageWindow = {\n\treadonly label: string;\n\treadonly usedPercent: number;\n\treadonly resetsAt?: number;\n};\n\nexport type SubscriptionUsageSnapshot = {\n\treadonly label: string;\n\treadonly windows: readonly SubscriptionUsageWindow[];\n\treadonly message?: string;\n};\n\nexport type CodexUsageWindow = { readonly usedPercent: number; readonly resetsAt?: number };\nexport type CodexUsageSnapshot = {\n\treadonly fiveHour?: CodexUsageWindow;\n\treadonly sevenDay?: CodexUsageWindow;\n};\n\nexport type ParsedCodexWindow = CodexUsageWindow & { readonly windowSeconds?: number };\nexport type ObservedCodexWindow = { readonly window: ParsedCodexWindow; readonly observedAt: number };\nexport type PassiveUsageEntry = { readonly primary?: ObservedCodexWindow; readonly secondary?: ObservedCodexWindow };\nexport type UsageKind = \"codex\" | \"claude\" | \"kimi\" | \"zai\" | \"grok\" | \"qwen-token-plan\" | \"unavailable\";\nexport type CredentialCandidate = { readonly provider: string; readonly oauthOnly: boolean };\n\nexport type SubscriptionUsageSource = {\n\treadonly label: string;\n\treadonly kind: UsageKind;\n\treadonly credentials: readonly CredentialCandidate[];\n\treadonly ttlMs: number;\n\treadonly unavailableMessage?: string;\n};\n"]}
1
+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AO,GAAG,iBAAiB,GAAG,aAAa,CAAC;AACnH,MAAM,MAAM,mBAAmB,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7F,MAAM,MAAM,uBAAuB,GAAG;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["export type SubscriptionUsageWindow = {\n\treadonly label: string;\n\treadonly usedPercent: number;\n\treadonly resetsAt?: number;\n};\n\nexport type SubscriptionUsageSnapshot = {\n\treadonly label: string;\n\treadonly windows: readonly SubscriptionUsageWindow[];\n\treadonly message?: string;\n};\n\nexport type CodexUsageWindow = { readonly usedPercent: number; readonly resetsAt?: number };\nexport type CodexUsageSnapshot = {\n\treadonly fiveHour?: CodexUsageWindow;\n\treadonly sevenDay?: CodexUsageWindow;\n};\n\nexport type ParsedCodexWindow = CodexUsageWindow & { readonly windowSeconds?: number };\nexport type ObservedCodexWindow = { readonly window: ParsedCodexWindow; readonly observedAt: number };\nexport type PassiveUsageEntry = { readonly primary?: ObservedCodexWindow; readonly secondary?: ObservedCodexWindow };\nexport type UsageKind = \"codex\" | \"claude\" | \"kimi\" | \"zai\" | \"grok\" | \"devin\" | \"qwen-token-plan\" | \"unavailable\";\nexport type CredentialCandidate = { readonly provider: string; readonly oauthOnly: boolean };\n\nexport type SubscriptionUsageSource = {\n\treadonly label: string;\n\treadonly kind: UsageKind;\n\treadonly credentials: readonly CredentialCandidate[];\n\treadonly ttlMs: number;\n\treadonly unavailableMessage?: string;\n};\n\nexport type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"provider-usage-types.js","sourceRoot":"","sources":["../../src/core/provider-usage-types.ts"],"names":[],"mappings":"","sourcesContent":["export type SubscriptionUsageWindow = {\n\treadonly label: string;\n\treadonly usedPercent: number;\n\treadonly resetsAt?: number;\n};\n\nexport type SubscriptionUsageSnapshot = {\n\treadonly label: string;\n\treadonly windows: readonly SubscriptionUsageWindow[];\n\treadonly message?: string;\n};\n\nexport type CodexUsageWindow = { readonly usedPercent: number; readonly resetsAt?: number };\nexport type CodexUsageSnapshot = {\n\treadonly fiveHour?: CodexUsageWindow;\n\treadonly sevenDay?: CodexUsageWindow;\n};\n\nexport type ParsedCodexWindow = CodexUsageWindow & { readonly windowSeconds?: number };\nexport type ObservedCodexWindow = { readonly window: ParsedCodexWindow; readonly observedAt: number };\nexport type PassiveUsageEntry = { readonly primary?: ObservedCodexWindow; readonly secondary?: ObservedCodexWindow };\nexport type UsageKind = \"codex\" | \"claude\" | \"kimi\" | \"zai\" | \"grok\" | \"qwen-token-plan\" | \"unavailable\";\nexport type CredentialCandidate = { readonly provider: string; readonly oauthOnly: boolean };\n\nexport type SubscriptionUsageSource = {\n\treadonly label: string;\n\treadonly kind: UsageKind;\n\treadonly credentials: readonly CredentialCandidate[];\n\treadonly ttlMs: number;\n\treadonly unavailableMessage?: string;\n};\n"]}
1
+ {"version":3,"file":"provider-usage-types.js","sourceRoot":"","sources":["../../src/core/provider-usage-types.ts"],"names":[],"mappings":"","sourcesContent":["export type SubscriptionUsageWindow = {\n\treadonly label: string;\n\treadonly usedPercent: number;\n\treadonly resetsAt?: number;\n};\n\nexport type SubscriptionUsageSnapshot = {\n\treadonly label: string;\n\treadonly windows: readonly SubscriptionUsageWindow[];\n\treadonly message?: string;\n};\n\nexport type CodexUsageWindow = { readonly usedPercent: number; readonly resetsAt?: number };\nexport type CodexUsageSnapshot = {\n\treadonly fiveHour?: CodexUsageWindow;\n\treadonly sevenDay?: CodexUsageWindow;\n};\n\nexport type ParsedCodexWindow = CodexUsageWindow & { readonly windowSeconds?: number };\nexport type ObservedCodexWindow = { readonly window: ParsedCodexWindow; readonly observedAt: number };\nexport type PassiveUsageEntry = { readonly primary?: ObservedCodexWindow; readonly secondary?: ObservedCodexWindow };\nexport type UsageKind = \"codex\" | \"claude\" | \"kimi\" | \"zai\" | \"grok\" | \"devin\" | \"qwen-token-plan\" | \"unavailable\";\nexport type CredentialCandidate = { readonly provider: string; readonly oauthOnly: boolean };\n\nexport type SubscriptionUsageSource = {\n\treadonly label: string;\n\treadonly kind: UsageKind;\n\treadonly credentials: readonly CredentialCandidate[];\n\treadonly ttlMs: number;\n\treadonly unavailableMessage?: string;\n};\n\nexport type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;\n"]}
@@ -1,9 +1,8 @@
1
1
  import { type ProviderRateLimitSnapshot } from "omk-ai";
2
2
  import type { AgentSession } from "./agent-session.ts";
3
- import type { CodexUsageSnapshot, SubscriptionUsageSnapshot, SubscriptionUsageSource, SubscriptionUsageWindow } from "./provider-usage-types.ts";
3
+ import type { CodexUsageSnapshot, FetchLike, SubscriptionUsageSnapshot, SubscriptionUsageSource, SubscriptionUsageWindow } from "./provider-usage-types.ts";
4
4
  export type { CodexUsageSnapshot, SubscriptionUsageSnapshot, SubscriptionUsageSource, SubscriptionUsageWindow, } from "./provider-usage-types.ts";
5
5
  type UsageSession = Pick<AgentSession, "state" | "modelRegistry">;
6
- type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
7
6
  export declare function getSubscriptionUsageSource(provider: string | undefined): SubscriptionUsageSource | undefined;
8
7
  export declare function getSubscriptionUsageRevision(provider: string): number;
9
8
  export declare function supportsSubscriptionUsage(session: UsageSession, provider?: string): boolean;