@vibesdotdev/integrations-anthropic 0.0.0-stage → 1.0.0-rc.1

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 (150) hide show
  1. package/LICENSE +126 -0
  2. package/README.md +57 -2
  3. package/dist/ai/anthropic-router-codec.d.ts +32 -0
  4. package/dist/ai/anthropic-router-codec.d.ts.map +1 -0
  5. package/dist/ai/anthropic-router-codec.js +321 -0
  6. package/dist/ai/anthropic-router-codec.js.map +1 -0
  7. package/dist/ai/anthropic.plugin.d.ts +6 -0
  8. package/dist/ai/anthropic.plugin.d.ts.map +1 -0
  9. package/dist/ai/anthropic.plugin.js +116 -0
  10. package/dist/ai/anthropic.plugin.js.map +1 -0
  11. package/dist/ai/catalog.d.ts +87 -0
  12. package/dist/ai/catalog.d.ts.map +1 -0
  13. package/dist/ai/catalog.js +64 -0
  14. package/dist/ai/catalog.js.map +1 -0
  15. package/dist/ai/claude-code-session.d.ts +56 -0
  16. package/dist/ai/claude-code-session.d.ts.map +1 -0
  17. package/dist/ai/claude-code-session.js +75 -0
  18. package/dist/ai/claude-code-session.js.map +1 -0
  19. package/dist/ai/claude-code-turn-env.d.ts +10 -0
  20. package/dist/ai/claude-code-turn-env.d.ts.map +1 -0
  21. package/dist/ai/claude-code-turn-env.js +19 -0
  22. package/dist/ai/claude-code-turn-env.js.map +1 -0
  23. package/dist/ai/hostile.d.ts +23 -0
  24. package/dist/ai/hostile.d.ts.map +1 -0
  25. package/dist/ai/hostile.js +22 -0
  26. package/dist/ai/hostile.js.map +1 -0
  27. package/dist/ai/index.d.ts +4 -0
  28. package/dist/ai/index.d.ts.map +1 -0
  29. package/dist/ai/index.js +4 -0
  30. package/dist/ai/index.js.map +1 -0
  31. package/dist/ai/metadata/assets/logos/providers/anthropic.svg +1 -0
  32. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-3-5-haiku-20241022.json +77 -0
  33. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-3-5-sonnet-20241022.json +42 -0
  34. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-4-opus-20250514.json +79 -0
  35. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-4-sonnet-20250514.json +79 -0
  36. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-haiku-4-5.json +80 -0
  37. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-haiku-5-5.json +39 -0
  38. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-opus-4-1.json +78 -0
  39. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-opus-4-5.json +80 -0
  40. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-opus-4-6.json +80 -0
  41. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-opus-4-7.json +81 -0
  42. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-sonnet-4-5.json +80 -0
  43. package/dist/ai/metadata/provider-models/anthropic/anthropic-claude-sonnet-4-6.json +80 -0
  44. package/dist/ai/metadata/providers/anthropic.json +22 -0
  45. package/dist/ai/providers/anthropic/anthropic.provider.impl.d.ts +62 -0
  46. package/dist/ai/providers/anthropic/anthropic.provider.impl.d.ts.map +1 -0
  47. package/dist/ai/providers/anthropic/anthropic.provider.impl.js +430 -0
  48. package/dist/ai/providers/anthropic/anthropic.provider.impl.js.map +1 -0
  49. package/dist/ai/providers/anthropic/detection/index.d.ts +8 -0
  50. package/dist/ai/providers/anthropic/detection/index.d.ts.map +1 -0
  51. package/dist/ai/providers/anthropic/detection/index.js +8 -0
  52. package/dist/ai/providers/anthropic/detection/index.js.map +1 -0
  53. package/dist/ai/providers/anthropic/detection/system.d.ts +12 -0
  54. package/dist/ai/providers/anthropic/detection/system.d.ts.map +1 -0
  55. package/dist/ai/providers/anthropic/detection/system.js +34 -0
  56. package/dist/ai/providers/anthropic/detection/system.js.map +1 -0
  57. package/dist/ai/providers/anthropic/docs/ai.providers.anthropic.docs.descriptor.d.ts +4 -0
  58. package/dist/ai/providers/anthropic/docs/ai.providers.anthropic.docs.descriptor.d.ts.map +1 -0
  59. package/dist/ai/providers/anthropic/docs/ai.providers.anthropic.docs.descriptor.js +212 -0
  60. package/dist/ai/providers/anthropic/docs/ai.providers.anthropic.docs.descriptor.js.map +1 -0
  61. package/dist/ai/providers/anthropic/index.d.ts +4 -0
  62. package/dist/ai/providers/anthropic/index.d.ts.map +1 -0
  63. package/dist/ai/providers/anthropic/index.js +4 -0
  64. package/dist/ai/providers/anthropic/index.js.map +1 -0
  65. package/dist/ai/providers/anthropic/recommendations.d.ts +24 -0
  66. package/dist/ai/providers/anthropic/recommendations.d.ts.map +1 -0
  67. package/dist/ai/providers/anthropic/recommendations.js +192 -0
  68. package/dist/ai/providers/anthropic/recommendations.js.map +1 -0
  69. package/dist/ai/providers/cloud/frontier/anthropic/config/config.anthropic.descriptor.d.ts +4194 -0
  70. package/dist/ai/providers/cloud/frontier/anthropic/config/config.anthropic.descriptor.d.ts.map +1 -0
  71. package/dist/ai/providers/cloud/frontier/anthropic/config/config.anthropic.descriptor.js +52 -0
  72. package/dist/ai/providers/cloud/frontier/anthropic/config/config.anthropic.descriptor.js.map +1 -0
  73. package/dist/ai/providers/cloud/frontier/anthropic/config/schemas/index.d.ts +46 -0
  74. package/dist/ai/providers/cloud/frontier/anthropic/config/schemas/index.d.ts.map +1 -0
  75. package/dist/ai/providers/cloud/frontier/anthropic/config/schemas/index.js +22 -0
  76. package/dist/ai/providers/cloud/frontier/anthropic/config/schemas/index.js.map +1 -0
  77. package/dist/ai/providers/cloud/frontier/anthropic/index.d.ts +5 -0
  78. package/dist/ai/providers/cloud/frontier/anthropic/index.d.ts.map +1 -0
  79. package/dist/ai/providers/cloud/frontier/anthropic/index.js +4 -0
  80. package/dist/ai/providers/cloud/frontier/anthropic/index.js.map +1 -0
  81. package/dist/ai/providers/cloud/frontier/anthropic/provider.anthropic.descriptor.d.ts +183 -0
  82. package/dist/ai/providers/cloud/frontier/anthropic/provider.anthropic.descriptor.d.ts.map +1 -0
  83. package/dist/ai/providers/cloud/frontier/anthropic/provider.anthropic.descriptor.js +115 -0
  84. package/dist/ai/providers/cloud/frontier/anthropic/provider.anthropic.descriptor.js.map +1 -0
  85. package/dist/ai/specs/anthropic-messages/anthropic-messages.failures.d.ts +46 -0
  86. package/dist/ai/specs/anthropic-messages/anthropic-messages.failures.d.ts.map +1 -0
  87. package/dist/ai/specs/anthropic-messages/anthropic-messages.failures.js +183 -0
  88. package/dist/ai/specs/anthropic-messages/anthropic-messages.failures.js.map +1 -0
  89. package/dist/ai/specs/anthropic-messages/anthropic-messages.spec.descriptor.d.ts +34 -0
  90. package/dist/ai/specs/anthropic-messages/anthropic-messages.spec.descriptor.d.ts.map +1 -0
  91. package/dist/ai/specs/anthropic-messages/anthropic-messages.spec.descriptor.js +29 -0
  92. package/dist/ai/specs/anthropic-messages/anthropic-messages.spec.descriptor.js.map +1 -0
  93. package/dist/ai/specs/anthropic-messages/anthropic-messages.spec.impl.d.ts +48 -0
  94. package/dist/ai/specs/anthropic-messages/anthropic-messages.spec.impl.d.ts.map +1 -0
  95. package/dist/ai/specs/anthropic-messages/anthropic-messages.spec.impl.js +557 -0
  96. package/dist/ai/specs/anthropic-messages/anthropic-messages.spec.impl.js.map +1 -0
  97. package/dist/ai/specs/claude-code-exec/claude-code-exec.spec.descriptor.d.ts +26 -0
  98. package/dist/ai/specs/claude-code-exec/claude-code-exec.spec.descriptor.d.ts.map +1 -0
  99. package/dist/ai/specs/claude-code-exec/claude-code-exec.spec.descriptor.js +15 -0
  100. package/dist/ai/specs/claude-code-exec/claude-code-exec.spec.descriptor.js.map +1 -0
  101. package/dist/ai/specs/claude-code-exec/claude-code-exec.spec.impl.d.ts +35 -0
  102. package/dist/ai/specs/claude-code-exec/claude-code-exec.spec.impl.d.ts.map +1 -0
  103. package/dist/ai/specs/claude-code-exec/claude-code-exec.spec.impl.js +210 -0
  104. package/dist/ai/specs/claude-code-exec/claude-code-exec.spec.impl.js.map +1 -0
  105. package/dist/external/acp-server.consumer.plugin.d.ts +3 -0
  106. package/dist/external/acp-server.consumer.plugin.d.ts.map +1 -0
  107. package/dist/external/acp-server.consumer.plugin.js +29 -0
  108. package/dist/external/acp-server.consumer.plugin.js.map +1 -0
  109. package/dist/external/acp-server.d.ts +19 -0
  110. package/dist/external/acp-server.d.ts.map +1 -0
  111. package/dist/external/acp-server.js +198 -0
  112. package/dist/external/acp-server.js.map +1 -0
  113. package/dist/external/claude-code-hooks.d.ts +51 -0
  114. package/dist/external/claude-code-hooks.d.ts.map +1 -0
  115. package/dist/external/claude-code-hooks.js +252 -0
  116. package/dist/external/claude-code-hooks.js.map +1 -0
  117. package/dist/external/claude-code-installer.d.ts +10 -0
  118. package/dist/external/claude-code-installer.d.ts.map +1 -0
  119. package/dist/external/claude-code-installer.js +604 -0
  120. package/dist/external/claude-code-installer.js.map +1 -0
  121. package/dist/external/claude-code-operations.d.ts +217 -0
  122. package/dist/external/claude-code-operations.d.ts.map +1 -0
  123. package/dist/external/claude-code-operations.js +101 -0
  124. package/dist/external/claude-code-operations.js.map +1 -0
  125. package/dist/external/claude-code-plugin.json +7 -0
  126. package/dist/external/claude-code-presets.d.ts +813 -0
  127. package/dist/external/claude-code-presets.d.ts.map +1 -0
  128. package/dist/external/claude-code-presets.js +157 -0
  129. package/dist/external/claude-code-presets.js.map +1 -0
  130. package/dist/external/claude-code.descriptor.d.ts +160 -0
  131. package/dist/external/claude-code.descriptor.d.ts.map +1 -0
  132. package/dist/external/claude-code.descriptor.js +5 -0
  133. package/dist/external/claude-code.descriptor.js.map +1 -0
  134. package/dist/external/claude-code.manifest.d.ts +5 -0
  135. package/dist/external/claude-code.manifest.d.ts.map +1 -0
  136. package/dist/external/claude-code.manifest.js +205 -0
  137. package/dist/external/claude-code.manifest.js.map +1 -0
  138. package/dist/external/external.plugin.d.ts +6 -0
  139. package/dist/external/external.plugin.d.ts.map +1 -0
  140. package/dist/external/external.plugin.js +56 -0
  141. package/dist/external/external.plugin.js.map +1 -0
  142. package/dist/external/index.d.ts +6 -0
  143. package/dist/external/index.d.ts.map +1 -0
  144. package/dist/external/index.js +6 -0
  145. package/dist/external/index.js.map +1 -0
  146. package/dist/index.d.ts +4 -0
  147. package/dist/index.d.ts.map +1 -0
  148. package/dist/index.js +4 -0
  149. package/dist/index.js.map +1 -0
  150. package/package.json +108 -4
@@ -0,0 +1,430 @@
1
+ import * as z from 'zod/v4';
2
+ import { detectAnthropicSystem } from "./detection/system.js";
3
+ import { assertNoPlaintextCredentials } from '@vibesdotdev/ai/providers-runtime';
4
+ import { probeProviderHealth } from '@vibesdotdev/ai/providers-runtime/client';
5
+ import { getRuntimeExecution } from '@vibesdotdev/kernel/execution';
6
+ import { CapabilityError } from '@vibesdotdev/kernel';
7
+ import { readHostile } from "../../hostile.js";
8
+ import { catalogLimits, catalogModel, catalogName } from "../../catalog.js";
9
+ import { executeGeneration } from '@vibesdotdev/ai/providers-runtime/utils/provider-type-helpers';
10
+ import { composeChildEnv } from '@vibesdotdev/kernel';
11
+ import { CredentialReferenceSchema, resolveProviderConfiguration } from '@vibesdotdev/ai/providers-runtime';
12
+ import { CLAUDE_CODE_LOGIN_INHERIT_ENV, CLAUDE_CODE_SUBSCRIPTION_ENV, CLAUDE_CODE_SUBSCRIPTION_INHERIT_ENV, withClaudeCodeSubscriptionPolicy } from "../../claude-code-session.js";
13
+ import { CLAUDE_CODE_TURN_INHERIT_ENV } from "../../claude-code-turn-env.js";
14
+ /** What `claude auth status --json` reports; a member of another type reads as absent. */
15
+ const ClaudeAuthStatusSchema = z.looseObject({
16
+ loggedIn: z.boolean().optional().catch(undefined),
17
+ authMethod: z.string().optional().catch(undefined),
18
+ apiProvider: z.string().optional().catch(undefined),
19
+ subscriptionType: z.string().optional().catch(undefined)
20
+ });
21
+ const AuthMethodSchema = z.string();
22
+ const BaseUrlSchema = z.string();
23
+ const CredentialValueSchema = z.string().trim().min(1);
24
+ const TimeoutSchema = z.number().positive();
25
+ /** A connection's members, copied once: reading a hostile object (a trapping Proxy, a throwing getter) happens here and nowhere else. */
26
+ const ConnectionRecordSchema = z.record(z.string(), z.unknown());
27
+ /** The default API origin: where a key goes when the connection names no other. */
28
+ const DEFAULT_BASE_URL = 'https://api.anthropic.com';
29
+ /** The health deadline when the caller names none, and its bounds (`probeProviderHealth` accepts 1 to 600000). */
30
+ const DEFAULT_PROBE_TIMEOUT_MS = 5_000;
31
+ const MAX_PROBE_TIMEOUT_MS = 600_000;
32
+ /** The method an authMethod value that is not a string selects, so validation reports it. */
33
+ const UNSUPPORTED_AUTH_METHOD = 'unsupported';
34
+ /** The health result code each probe failure reports. */
35
+ const PROBE_FAILURE_CODES = {
36
+ AUTH_FAILED: 'AUTH_FAILED',
37
+ API_ERROR: 'API_ERROR',
38
+ CONNECTION_ERROR: 'CONNECTION_ERROR',
39
+ TIMEOUT: 'CONNECTION_ERROR',
40
+ CANCELLED: 'AUTH_CANCELLED',
41
+ INVALID_URL: 'CONNECTION_ERROR',
42
+ INVALID_HEADERS: 'CONNECTION_ERROR'
43
+ };
44
+ export class AnthropicProviderType {
45
+ descriptor;
46
+ context;
47
+ fetchOwner;
48
+ /** `options.fetch` is the HTTP owner of the API-key health check; absent, the runtime's request host, else the global fetch. */
49
+ constructor(descriptor, context, options = {}) {
50
+ this.descriptor = descriptor;
51
+ this.context = context;
52
+ this.fetchOwner = options.fetch;
53
+ }
54
+ /**
55
+ * Generate using this provider (delegates to ai/generation)
56
+ */
57
+ async generate(providerInstance, model, request, options) {
58
+ if (readConnection(providerInstance.configuration).method === 'claude-code') {
59
+ // The check runs with the environment the turn runs in (see CLAUDE_CODE_TURN_INHERIT_ENV).
60
+ const health = await this.checkSubscriptionRoute(5_000, CLAUDE_CODE_TURN_INHERIT_ENV);
61
+ if (!health.healthy) {
62
+ const code = health.error?.code ?? 'SUBSCRIPTION_REQUIRED';
63
+ throw new CapabilityError(`Claude subscription execution blocked (${code})`, 'AUTH_REQUIRED', {
64
+ reason: 'subscription-required',
65
+ retryable: false,
66
+ details: { health: code }
67
+ });
68
+ }
69
+ }
70
+ return executeGeneration(this.context, providerInstance, model, request, options);
71
+ }
72
+ async detectInstalled() {
73
+ const instances = [];
74
+ const detected = await detectAnthropicSystem(this.context.runtime);
75
+ if (detected) {
76
+ instances.push({ name: detected.name, source: 'system', config: { ...detected.configuration, baseUrl: this.descriptor.defaults?.baseUrl || 'https://api.anthropic.com' } });
77
+ }
78
+ const execution = await this.resolveExecution();
79
+ if (execution && (await execution.resolveCommand('claude'))) {
80
+ const status = await this.checkClaudeSubscription(execution, 5_000);
81
+ if (status.healthy) {
82
+ instances.push({
83
+ name: 'Claude subscription (Claude Code)',
84
+ source: 'system',
85
+ config: {
86
+ authMethod: 'claude-code',
87
+ authType: 'oauth',
88
+ tokenSource: 'oauth-browser'
89
+ }
90
+ });
91
+ }
92
+ }
93
+ return instances;
94
+ }
95
+ /**
96
+ * Recommend models for a use case
97
+ */
98
+ async recommendModels(useCase) {
99
+ const recommendations = [];
100
+ // A recommendation names a catalogue model; its id, name and limits are the catalogue's.
101
+ const recommend = (providerModelId, fit) => {
102
+ const model = catalogModel(providerModelId);
103
+ const limits = catalogLimits(model);
104
+ return {
105
+ modelId: model.providerModelId,
106
+ modelName: catalogName(model),
107
+ score: fit.score,
108
+ reason: fit.reason,
109
+ capabilities: fit.capabilities,
110
+ contextWindow: limits.contextWindow,
111
+ maxOutputTokens: limits.maxOutputTokens,
112
+ useCaseFit: fit.score
113
+ };
114
+ };
115
+ // Text models for chat and development
116
+ if (useCase === 'chat' || useCase === 'development' || useCase === 'research') {
117
+ recommendations.push(recommend('claude-sonnet-4-6', {
118
+ score: 95,
119
+ reason: 'Best balance of intelligence, speed, and cost for most tasks',
120
+ capabilities: ['chat', 'vision', 'tools']
121
+ }), recommend('claude-opus-4-7', {
122
+ score: 90,
123
+ reason: 'Most capable model for complex reasoning and long conversations',
124
+ capabilities: ['chat', 'vision', 'tools']
125
+ }), recommend('claude-haiku-4-5', {
126
+ score: 80,
127
+ reason: 'Fast and cost-effective for simpler tasks',
128
+ capabilities: ['chat', 'vision']
129
+ }));
130
+ }
131
+ // Vision tasks
132
+ if (useCase === 'vision' || useCase === 'multimodal') {
133
+ recommendations.push(recommend('claude-sonnet-4-6', {
134
+ score: 95,
135
+ reason: 'Excellent vision capabilities with strong reasoning',
136
+ capabilities: ['chat', 'vision', 'tools']
137
+ }), recommend('claude-opus-4-7', {
138
+ score: 90,
139
+ reason: 'Best-in-class vision understanding for complex visual tasks',
140
+ capabilities: ['chat', 'vision', 'tools']
141
+ }));
142
+ }
143
+ return recommendations.sort((a, b) => b.score - a.score);
144
+ }
145
+ /**
146
+ * Check health of an Anthropic instance
147
+ */
148
+ async checkHealth(instanceConfig, options) {
149
+ const connection = readConnection(instanceConfig);
150
+ if (connection.method === 'claude-code') {
151
+ return this.checkSubscriptionRoute(options?.timeout ?? 5_000, CLAUDE_CODE_SUBSCRIPTION_INHERIT_ENV, options?.signal);
152
+ }
153
+ return this.checkApiCredential(connection, options);
154
+ }
155
+ /** The subscription route's health: the consumer host, the CLI, and a status that proves a claude.ai subscription. */
156
+ async checkSubscriptionRoute(timeout, inheritEnv, signal) {
157
+ if (this.isCloudRuntime()) {
158
+ return this.unhealthy('CONSUMER_RUNTIME_REQUIRED', 'Claude subscription execution requires a connected consumer host');
159
+ }
160
+ const execution = await this.resolveExecution();
161
+ if (!execution || !(await execution.resolveCommand('claude'))) {
162
+ return this.unhealthy('CLI_UNAVAILABLE', 'Claude Code CLI is unavailable');
163
+ }
164
+ return this.checkClaudeSubscription(execution, timeout, signal, inheritEnv);
165
+ }
166
+ async authenticate(instanceConfig, options) {
167
+ if (readConnection(instanceConfig).method !== 'claude-code') {
168
+ return this.checkHealth(instanceConfig, options);
169
+ }
170
+ if (options?.signal?.aborted)
171
+ return this.unhealthy('AUTH_CANCELLED', 'Authentication cancelled');
172
+ if (this.isCloudRuntime()) {
173
+ return this.unhealthy('CONSUMER_RUNTIME_REQUIRED', 'Claude subscription authentication requires a connected consumer host');
174
+ }
175
+ const execution = await this.resolveExecution();
176
+ if (!execution || !(await execution.resolveCommand('claude'))) {
177
+ return this.unhealthy('CLI_UNAVAILABLE', 'Claude Code CLI is unavailable');
178
+ }
179
+ const current = await this.checkClaudeSubscription(execution, 5_000, options?.signal);
180
+ if (current.healthy)
181
+ return current;
182
+ // The caller's signal reaches the child: a cancelled sign-in stops `claude auth login`
183
+ // instead of leaving it waiting for the browser for the whole deadline.
184
+ const login = await execution.execute({
185
+ command: 'claude',
186
+ args: withClaudeCodeSubscriptionPolicy(['auth', 'login']),
187
+ env: composeChildEnv(this.context.runtime, {
188
+ env: CLAUDE_CODE_SUBSCRIPTION_ENV,
189
+ inheritEnv: CLAUDE_CODE_LOGIN_INHERIT_ENV
190
+ }),
191
+ envMode: 'replace',
192
+ timeout: options?.timeout ?? 10 * 60_000,
193
+ signal: options?.signal
194
+ });
195
+ if (options?.signal?.aborted || login.aborted === true)
196
+ return this.unhealthy('AUTH_CANCELLED', 'Authentication cancelled');
197
+ if (login.timedOut)
198
+ return this.unhealthy('AUTH_TIMEOUT', 'Claude subscription login timed out');
199
+ if (login.exitCode !== 0)
200
+ return this.unhealthy('AUTH_FAILED', 'Claude subscription login failed');
201
+ return this.checkClaudeSubscription(execution, 5_000, options?.signal);
202
+ }
203
+ /**
204
+ * Validate connection configuration. Each problem is one message (the framework result type
205
+ * has no code slot); a configuration that cannot be read at all is a typed refusal.
206
+ */
207
+ async validateConnection(config) {
208
+ const errors = [];
209
+ const warnings = [];
210
+ const connection = readConnection(config);
211
+ const method = connection.method;
212
+ if (method !== 'claude-code' && method !== 'api-key') {
213
+ errors.push('authMethod must be claude-code or api-key');
214
+ }
215
+ if (method === 'api-key') {
216
+ if (connection.reference === undefined || connection.reference.source === 'inline') {
217
+ errors.push('apiKey must be a CredentialReference');
218
+ }
219
+ }
220
+ if (connection.baseUrlInvalid) {
221
+ errors.push('Invalid base URL format');
222
+ }
223
+ else if (connection.baseUrl) {
224
+ if (!URL.canParse(connection.baseUrl)) {
225
+ errors.push('Invalid base URL format');
226
+ }
227
+ else {
228
+ const url = new URL(connection.baseUrl);
229
+ if (url.username || url.password)
230
+ warnings.push('Base URL carries credentials: an API key is never sent to it');
231
+ else if (url.protocol !== 'https:')
232
+ warnings.push('Base URL is not https: an API key is sent only to https URLs (loopback http on a development host)');
233
+ }
234
+ }
235
+ if (connection.timeoutInvalid)
236
+ errors.push('Timeout must be a positive number');
237
+ const result = {
238
+ valid: errors.length === 0,
239
+ errors: errors.length > 0 ? errors : undefined
240
+ };
241
+ if (warnings.length > 0)
242
+ result.warnings = warnings;
243
+ return result;
244
+ }
245
+ /**
246
+ * A host that composes no execution kind (a cloud host, or a consumer host
247
+ * without one) runs no Claude Code. A composed execution provider that is
248
+ * unavailable or fails is an owner failure and propagates typed.
249
+ */
250
+ async resolveExecution() {
251
+ if (this.isCloudRuntime() || !this.context.runtime.hasKind('runtime/execution'))
252
+ return null;
253
+ return getRuntimeExecution(this.context.runtime);
254
+ }
255
+ isCloudRuntime() {
256
+ return this.context.runtime.scope?.hardware === 'cloud';
257
+ }
258
+ async checkClaudeSubscription(execution, timeout, signal, inheritEnv = CLAUDE_CODE_SUBSCRIPTION_INHERIT_ENV) {
259
+ const startedAt = Date.now();
260
+ const result = await execution.execute({
261
+ command: 'claude',
262
+ args: withClaudeCodeSubscriptionPolicy(['auth', 'status']),
263
+ env: composeChildEnv(this.context.runtime, {
264
+ env: CLAUDE_CODE_SUBSCRIPTION_ENV,
265
+ inheritEnv
266
+ }),
267
+ envMode: 'replace',
268
+ timeout,
269
+ signal
270
+ });
271
+ const latencyMs = Date.now() - startedAt;
272
+ if (signal?.aborted || result.aborted === true) {
273
+ return this.unhealthy('AUTH_CANCELLED', 'Authentication cancelled', latencyMs);
274
+ }
275
+ if (result.timedOut) {
276
+ return this.unhealthy('AUTH_TIMEOUT', 'Claude authentication check timed out', latencyMs);
277
+ }
278
+ const { status, failure } = parseClaudeAuthStatus(result.stdout);
279
+ if (result.exitCode === 0 &&
280
+ status?.loggedIn === true &&
281
+ status.authMethod === 'claude.ai' &&
282
+ status.apiProvider === 'firstParty' &&
283
+ Boolean(status.subscriptionType?.trim())) {
284
+ return {
285
+ healthy: true,
286
+ message: 'Claude subscription is authenticated',
287
+ checkedAt: new Date(),
288
+ latencyMs,
289
+ availableModalities: ['text']
290
+ };
291
+ }
292
+ const notSubscribed = this.unhealthy('SUBSCRIPTION_REQUIRED', 'Claude Code is not authenticated with a claude.ai subscription', latencyMs);
293
+ if (failure !== undefined)
294
+ notSubscribed.cause = failure;
295
+ return notSubscribed;
296
+ }
297
+ async checkApiCredential(connection, options) {
298
+ assertNoPlaintextCredentials({ apiKey: connection.apiKey });
299
+ const startedAt = Date.now();
300
+ const reference = connection.reference;
301
+ if (reference === undefined || reference.source === 'inline')
302
+ return this.missingApiKey();
303
+ // The credential owner's failure (a typed CapabilityError such as
304
+ // `credential-not-set`, or the callback's refusal) is not an unusable
305
+ // credential: it reaches the caller whole.
306
+ const resolved = options?.resolveCredential
307
+ ? { apiKey: await options.resolveCredential(reference) }
308
+ : await resolveProviderConfiguration({ apiKey: reference }, {
309
+ runtime: this.context.runtime
310
+ });
311
+ const value = CredentialValueSchema.safeParse(resolved.apiKey);
312
+ if (!value.success)
313
+ return this.missingApiKey();
314
+ const apiKey = value.data;
315
+ // The shared probe sends the key only to an `https` URL without userinfo (loopback `http` on a
316
+ // development host), never follows a redirect, cancels the body, and reports a fixed message per
317
+ // code: no text the network produced (a reason phrase, a fetch error quoting the URL) comes back.
318
+ const result = await probeProviderHealth({
319
+ fetch: this.fetchOwner,
320
+ url: modelsUrl(connection.baseUrl),
321
+ headers: { 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' },
322
+ signal: options?.signal,
323
+ timeoutMs: probeTimeoutMs(options?.timeout),
324
+ runtime: this.context.runtime
325
+ });
326
+ const latencyMs = Date.now() - startedAt;
327
+ if (result.ok) {
328
+ return {
329
+ healthy: true,
330
+ message: 'Anthropic API credential is valid',
331
+ checkedAt: new Date(),
332
+ latencyMs,
333
+ availableModalities: ['text', 'image']
334
+ };
335
+ }
336
+ const message = result.status === undefined ? result.message : `Anthropic API answered HTTP ${result.status}.`;
337
+ const unhealthy = this.unhealthy(PROBE_FAILURE_CODES[result.code], message, latencyMs);
338
+ // Only the failure's value-free facts (class name, code, reason) travel with the result.
339
+ if (result.cause !== undefined)
340
+ unhealthy.cause = result.cause;
341
+ return unhealthy;
342
+ }
343
+ missingApiKey() {
344
+ return this.unhealthy('MISSING_API_KEY', 'Resolve apiKey through the runtime credential boundary');
345
+ }
346
+ unhealthy(code, message, latencyMs) {
347
+ return { healthy: false, message, error: { code, message }, checkedAt: new Date(), latencyMs };
348
+ }
349
+ /**
350
+ * Cleanup resources
351
+ */
352
+ async dispose() {
353
+ // No resources to cleanup for Anthropic provider type
354
+ }
355
+ }
356
+ function parseClaudeAuthStatus(stdout) {
357
+ let decoded;
358
+ try {
359
+ decoded = JSON.parse(stdout);
360
+ }
361
+ catch (error) {
362
+ if (!(error instanceof SyntaxError))
363
+ throw error;
364
+ return { status: null, failure: error };
365
+ }
366
+ const parsed = ClaudeAuthStatusSchema.safeParse(decoded);
367
+ return { status: parsed.success ? parsed.data : null };
368
+ }
369
+ /** The models endpoint of `baseUrl` (the default origin when it is not a string). The probe refuses a URL a key may not go to. */
370
+ function modelsUrl(baseUrl) {
371
+ const base = baseUrl !== undefined && baseUrl.trim() !== '' ? baseUrl.trim() : DEFAULT_BASE_URL;
372
+ // A base that is not a URL is passed on as it is, so the probe refuses it: appending a path could make it parse as another host.
373
+ if (!URL.canParse(base))
374
+ return base;
375
+ const url = new URL(base);
376
+ url.pathname = `${url.pathname.replace(/\/+$/, '')}/v1/models`;
377
+ url.search = '?limit=1';
378
+ url.hash = '';
379
+ return url.href;
380
+ }
381
+ function unreadableConfiguration(failure) {
382
+ return new CapabilityError('The Anthropic connection configuration cannot be read.', 'INVALID_INPUT', {
383
+ reason: 'invalid-connection-config',
384
+ retryable: false,
385
+ details: failure ? { failure: failure.name } : undefined
386
+ });
387
+ }
388
+ /** A deadline `probeProviderHealth` accepts: whole milliseconds from 1 to 600000, else the default. */
389
+ function probeTimeoutMs(timeout) {
390
+ if (timeout === undefined || !Number.isFinite(timeout) || timeout < 1)
391
+ return DEFAULT_PROBE_TIMEOUT_MS;
392
+ return Math.min(Math.floor(timeout), MAX_PROBE_TIMEOUT_MS);
393
+ }
394
+ /**
395
+ * What a connection configuration says, read once into a plain copy. A configuration that cannot
396
+ * be read (a trapping or revoked Proxy, a throwing getter, a non-object) is a typed refusal that
397
+ * names no value; an authMethod that is not a string selects `unsupported`, so validation reports it.
398
+ */
399
+ function readConnection(config) {
400
+ const record = readHostile(ConnectionRecordSchema, config);
401
+ if (!record.ok)
402
+ throw unreadableConfiguration(record.failure);
403
+ const values = record.data;
404
+ const hasApiKey = Object.hasOwn(values, 'apiKey');
405
+ const authMethod = values.authMethod;
406
+ let method;
407
+ if (authMethod === undefined || authMethod === null) {
408
+ method = hasApiKey ? 'api-key' : 'claude-code';
409
+ }
410
+ else {
411
+ const named = AuthMethodSchema.safeParse(authMethod);
412
+ method = named.success ? named.data : UNSUPPORTED_AUTH_METHOD;
413
+ }
414
+ // The apiKey value itself can be a hostile object: it is read once, here.
415
+ const key = readHostile(CredentialReferenceSchema, values.apiKey);
416
+ if (!key.ok && key.threw)
417
+ throw unreadableConfiguration(key.failure);
418
+ const baseUrl = BaseUrlSchema.safeParse(values.baseUrl);
419
+ const timeout = TimeoutSchema.safeParse(values.timeout);
420
+ return {
421
+ method,
422
+ apiKey: values.apiKey,
423
+ reference: key.ok ? key.data : undefined,
424
+ baseUrl: baseUrl.success ? baseUrl.data : undefined,
425
+ baseUrlInvalid: values.baseUrl !== undefined && values.baseUrl !== null && !baseUrl.success,
426
+ timeout: timeout.success ? timeout.data : undefined,
427
+ timeoutInvalid: values.timeout !== undefined && !timeout.success
428
+ };
429
+ }
430
+ //# sourceMappingURL=anthropic.provider.impl.js.map
@@ -0,0 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KAAK;QAAE,MAAM,uBAAuB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxD,OAAO;QACN,MAAM;QACN,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QACxC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QACnD,cAAc,EAAE,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO;QAC3F,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QACnD,cAAc,EAAE,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,OAAO;KAChE,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Anthropic Detection
3
+ *
4
+ * System-level detection for Anthropic provider.
5
+ * User-level detection is handled by the unified user-detection module.
6
+ */
7
+ export { detectAnthropicSystem } from './system.ts';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/providers/anthropic/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Anthropic Detection
3
+ *
4
+ * System-level detection for Anthropic provider.
5
+ * User-level detection is handled by the unified user-detection module.
6
+ */
7
+ export { detectAnthropicSystem } from "./system.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/providers/anthropic/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Anthropic System Detection
3
+ *
4
+ * Detects Anthropic API key through the runtime credential authority
5
+ */
6
+ import type { DetectedProvider } from '@vibesdotdev/ai/providers-runtime/client/types';
7
+ import type { RuntimeRef } from '@vibesdotdev/kernel';
8
+ /**
9
+ * Detect Anthropic API key through the runtime credential authority
10
+ */
11
+ export declare function detectAnthropicSystem(runtime: RuntimeRef): Promise<DetectedProvider | null>;
12
+ //# sourceMappingURL=system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../../src/ai/providers/anthropic/detection/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAuBjG"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Anthropic System Detection
3
+ *
4
+ * Detects Anthropic API key through the runtime credential authority
5
+ */
6
+ /**
7
+ * Detect Anthropic API key through the runtime credential authority
8
+ */
9
+ export async function detectAnthropicSystem(runtime) {
10
+ const credential = await runtime.resolveCredential({ source: 'secret', key: 'ANTHROPIC_API_KEY' });
11
+ if (!credential.ok) {
12
+ if (credential.error.reason === 'credential-not-set')
13
+ return null;
14
+ throw credential.error;
15
+ }
16
+ if (!credential.value.trim())
17
+ return null;
18
+ return {
19
+ providerType: 'anthropic',
20
+ name: 'Anthropic',
21
+ description: 'API key detected through the runtime credential authority (ANTHROPIC_API_KEY)',
22
+ status: 'available',
23
+ models: [],
24
+ configuration: {
25
+ authMethod: 'api-key',
26
+ authType: 'bearer',
27
+ tokenSource: 'credential',
28
+ apiKey: { source: 'secret', key: 'ANTHROPIC_API_KEY' },
29
+ baseUrl: 'https://api.anthropic.com',
30
+ timeout: 30000
31
+ }
32
+ };
33
+ }
34
+ //# sourceMappingURL=system.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.js","sourceRoot":"","sources":["../../../../../src/ai/providers/anthropic/detection/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAAmB;IAC9D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC,CAAC;IACnG,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACpB,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,KAAK,oBAAoB;YAAE,OAAO,IAAI,CAAC;QAClE,MAAM,UAAU,CAAC,KAAK,CAAC;IACxB,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;IAE1C,OAAO;QACN,YAAY,EAAE,WAAW;QACzB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,+EAA+E;QAC5F,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,EAAE;QACV,aAAa,EAAE;YACd,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,YAAY;YACzB,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,mBAAmB,EAAE;YACtD,OAAO,EAAE,2BAA2B;YACpC,OAAO,EAAE,KAAK;SACd;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DocsTopicDescriptor } from '@vibesdotdev/docs-contracts';
2
+ declare const descriptor: DocsTopicDescriptor;
3
+ export default descriptor;
4
+ //# sourceMappingURL=ai.providers.anthropic.docs.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.providers.anthropic.docs.descriptor.d.ts","sourceRoot":"","sources":["../../../../../src/ai/providers/anthropic/docs/ai.providers.anthropic.docs.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA+KvE,QAAA,MAAM,UAAU,EAAE,mBAuCjB,CAAC;AAEF,eAAe,UAAU,CAAC"}