@sentropic/llm-mesh 0.24.0 → 0.25.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 (35) hide show
  1. package/README.md +192 -0
  2. package/dist/enrollment/claude-code.d.ts +27 -5
  3. package/dist/enrollment/claude-code.d.ts.map +1 -1
  4. package/dist/enrollment/claude-code.js +224 -10
  5. package/dist/enrollment/claude-code.js.map +1 -1
  6. package/dist/enrollment/index.d.ts +1 -1
  7. package/dist/enrollment/index.d.ts.map +1 -1
  8. package/dist/enrollment/pkce.js +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/route-planner.d.ts.map +1 -1
  14. package/dist/route-planner.js +7 -64
  15. package/dist/route-planner.js.map +1 -1
  16. package/dist/route-selection.d.ts.map +1 -1
  17. package/dist/route-selection.js +5 -10
  18. package/dist/route-selection.js.map +1 -1
  19. package/dist/routing-targets.d.ts +6 -15
  20. package/dist/routing-targets.d.ts.map +1 -1
  21. package/dist/routing-targets.js +95 -47
  22. package/dist/routing-targets.js.map +1 -1
  23. package/dist/service/facade.d.ts +3 -0
  24. package/dist/service/facade.d.ts.map +1 -1
  25. package/dist/service/facade.js +7 -1
  26. package/dist/service/facade.js.map +1 -1
  27. package/dist/service/local-account-transport-service.d.ts +9 -0
  28. package/dist/service/local-account-transport-service.d.ts.map +1 -1
  29. package/dist/service/local-account-transport-service.js +228 -37
  30. package/dist/service/local-account-transport-service.js.map +1 -1
  31. package/dist/transport/claude-code-runtime-client.d.ts +88 -0
  32. package/dist/transport/claude-code-runtime-client.d.ts.map +1 -0
  33. package/dist/transport/claude-code-runtime-client.js +305 -0
  34. package/dist/transport/claude-code-runtime-client.js.map +1 -0
  35. package/package.json +1 -1
package/README.md CHANGED
@@ -89,6 +89,198 @@ const facade = createLlmMeshFacade({
89
89
  That migration option is only for pre-ownerScope local records. New enrollment
90
90
  always takes ownership from `StartEnrollmentInput.ownerScope`.
91
91
 
92
+ ## Claude subscription enrollment (LOT 1)
93
+
94
+ The facade supports browser PKCE enrollment and renewable Claude CLI credential
95
+ import, durable ordinary seats, and refresh on acquire. Hosts without a qualified
96
+ official CLI runner remain **enrollment only**, execution **`not-covered`**.
97
+ The LOT 2 bridge below provides the host injection seam.
98
+
99
+ ```ts
100
+ import { createLlmMeshFacade } from '@sentropic/llm-mesh/facade';
101
+ import type { EnrollmentCompletion } from '@sentropic/llm-mesh/enrollment';
102
+
103
+ const facade = createLlmMeshFacade({
104
+ mode: 'cli',
105
+ configResolver: { async resolveConfig() { return {}; } },
106
+ });
107
+ const session = await facade.enroll('claude-code', {
108
+ configRef: 'claude-code', mode: 'cli', redirectUri: '', ownerScope: verifiedOwner,
109
+ });
110
+ // A trusted local component opens session.url and captures <code>#<state>.
111
+ // Capability-check optional methods when supporting older mesh versions.
112
+ if (!facade.completeClaudeEnrollment) throw new Error('Claude enrollment unavailable');
113
+ const completion: EnrollmentCompletion = await facade.completeClaudeEnrollment(
114
+ session.enrollmentId, maskedCodeInput, verifiedOwner,
115
+ );
116
+ ```
117
+
118
+ The authenticated host supplies the owner. Code/credential inputs and the
119
+ authorization URL stay inside trusted local UI/provider/storage components:
120
+ never put them in agent or MCP arguments, shell text, argv, environment variables,
121
+ logs, traces, snapshots, history, clipboard diagnostics or exception receipts.
122
+ Completion/list results contain only public account references and labels. A
123
+ browser session expires after 15 minutes; each completion is one-use, with strict
124
+ state, cancellation and a 30-second token-request deadline. Failed/ambiguous
125
+ exchanges require a fresh enrollment; codes are never retried automatically.
126
+
127
+ `{}` selects the provisional A2 profile `claude-code-oauth-2.1.296-v1`, sourced from
128
+ the [official 2.1.296 package](https://registry.npmjs.org/@anthropic-ai/claude-code/2.1.296) and
129
+ live-validated on 2026-10-10 (authorize endpoint `claude.com/cai`, `user:plugins` scope, 32-byte
130
+ nonce states).
131
+ Current provider acceptance remains unverified. Nonempty resolver results must be
132
+ complete profiles: `id`, `authorizationUrl`, `tokenUrl`, `clientId`, `redirectUri`,
133
+ `authorizationScopes`, `refreshScopes`, `requiredScopes`, `source`. URLs use HTTPS;
134
+ required scopes include `user:inference` and must occur in authorization/refresh
135
+ scopes. IDs are immutable; the bundled ID cannot be redefined. Redirect input must
136
+ be empty or exactly the configured manual callback. No client secret is required.
137
+ Custom refresh resolves the stored ID and requires an exact version match; keep
138
+ old profiles available while grants exist. Bundled refresh bypasses the host
139
+ resolver. Unknown IDs and legacy `v1.0.0` require reauthentication before HTTP.
140
+
141
+ For sessionless paste, the trusted component calls the optional
142
+ `facade.completeClaudeCredentialImport(maskedCredentialJson, verifiedOwner)`.
143
+ Accept either the full JSON document containing `claudeAiOauth` or that inner
144
+ object: `accessToken`, `refreshToken`, `expiresAt` (epoch milliseconds), `scopes`.
145
+ The limit is 64 KiB in UTF-8. Access-only strings/setup tokens are refused; missing
146
+ refresh material, blank/CR/LF tokens, invalid expiry or incompatible scopes fail.
147
+ Unknown fields and descriptive identity data are discarded; labels use opaque
148
+ random account IDs. Valid past expiry is accepted offline and refreshed on first
149
+ acquire. Import uses the host's `claude-code` profile, never a profile in the paste.
150
+
151
+ CLI mode defaults to an encrypted file keyring. Portal mode defaults to memory;
152
+ provide a durable keyring with atomic owner claims for restart persistence.
153
+ Both paths save the envelope, public record and index before local eligibility.
154
+ Refresh stays single-flight through validation, save and publication. Local storage
155
+ or preparation outages before a provider request are retryable; terminal errors or
156
+ failures after a request may have been sent require reauthentication. Scope metadata
157
+ records the actual validated grant scopes.
158
+ One grant means one mesh account and one refresh holder. Imports with a refresh
159
+ token already stored for a Claude account of the same owner are refused with
160
+ "This Claude credential is already enrolled"; comparisons stay in process.
161
+ Use one credential-owning service per grant. Before importing, disable/logout the
162
+ source CLI and record transfer evidence; copying a file does not transfer refresh
163
+ ownership or create a new provider device. Local removal does not prove provider
164
+ revocation. Custody-managed access projections belong to the separate custody host,
165
+ not this ordinary local enrollment/refresh path.
166
+
167
+ ### Terms of use
168
+
169
+ This tool demonstrates feasibility. **Owner decision:** “each user assumes”
170
+ responsibility for compliance and the risks of account suspension or refused calls.
171
+ This is the owner's allocation of responsibility, not Anthropic permission.
172
+
173
+ Established distinctions, **verified (source, 2026-09-26)** in
174
+ [Claude Code legal and compliance](https://code.claude.com/docs/en/legal-and-compliance.md):
175
+
176
+ | Account | Publicly established | Unverified for this mesh deployment |
177
+ | --- | --- | --- |
178
+ | Individual Pro/Max | [Consumer Terms](https://www.anthropic.com/legal/consumer-terms); ordinary native-app OAuth use; advertised limits assume ordinary individual Claude Code/Agent SDK use. Developers may not route requests through Free/Pro/Max credentials on users' behalf. General third-party Claude.ai login restrictions are stated generally; developers “may not collect, store, or intermediate Claude.ai credentials or session tokens — sign-in to a Claude account must complete through Anthropic's own flow”. | Applicability of these restrictions to this user-enrolled arrangement is unverified. |
179
+ | Organization Team/Enterprise | [Commercial Terms](https://www.anthropic.com/legal/commercial-terms); ordinary native-app OAuth use. General third-party Claude.ai login and credential/session-token collection, storage and intermediation restrictions are stated generally; sign-in to a Claude account must complete through Anthropic's own flow. | Applicability of these restrictions to this user-enrolled arrangement is unverified, as are organization-specific agreements/exceptions; the individual-plan routing sentence establishes no organizational exemption. |
180
+ | API key / [Console](https://platform.claude.com/) | [Commercial Terms](https://www.anthropic.com/legal/commercial-terms); recommended developer authentication. Customer-managed keys for authorized users are permitted subject to billing to the key owner and the stated no-resale/intermediation conditions. | Compliance of the actual deployment; API-key guidance does not authorize subscription-token substitution. |
181
+
182
+ The credential and sign-in restrictions are stated generally for all subscription
183
+ plans. They are relevant to credential-paste enrollment (M4) and mesh storage of
184
+ grants; user enrollment and the owner's decision do not establish an exception.
185
+
186
+ **Verified (source):** the same page permits hosting the unmodified official binary
187
+ under stated conditions: Commercial Terms, no built-in auth method restricted,
188
+ end-user authentication/direct billing, and no paying/reselling/intermediating their
189
+ usage. It preserves end users' own subscription sign-in to that binary.
190
+ **Unverified:** whether mesh credential projection and runner restrictions meet
191
+ those conditions; executing the official binary alone does not establish permission
192
+ to enroll, store or intermediate subscription credentials.
193
+
194
+ ## Claude official CLI execution (LOT 2 mesh bridge)
195
+
196
+ `ClaudeCodeRuntimeClient` implements the Anthropic client slot and accepts a
197
+ host-provided `ClaudeCodeCliRunner`. The host executes the unmodified official
198
+ `claude` subprocess; llm-mesh imports no process API and provides no runner,
199
+ Messages transport, client headers, runtime refresh or automatic retry.
200
+
201
+ ```ts
202
+ import { ClaudeCodeRuntimeClient, createDefaultProviderAdapters } from '@sentropic/llm-mesh';
203
+ import type { AnthropicAdapterClient, ClaudeCodeCliRunner, ClaudeCodeCliCapabilities } from '@sentropic/llm-mesh';
204
+
205
+ // Trusted host supplies these after qualifying the exact CLI and isolated runner.
206
+ declare const runner: ClaudeCodeCliRunner;
207
+ declare const capabilities: ClaudeCodeCliCapabilities;
208
+ declare const directAnthropicClient: AnthropicAdapterClient;
209
+ const adapters = createDefaultProviderAdapters({
210
+ anthropic: new ClaudeCodeRuntimeClient({ runner, capabilities, fallback: directAnthropicClient }),
211
+ });
212
+ ```
213
+
214
+ Only `account-transport` with provider `claude-code`, and `claude-code-account`,
215
+ reach the runner. Other auth delegates to the supplied direct client, or is
216
+ refused when no fallback exists. Conflicting request auth is removed; the selected
217
+ auth remains in the context. Unresolved auth callbacks without a trusted context
218
+ are refused. A seat failure never falls
219
+ back to metered API authentication. The in-process input contains only access
220
+ token, finite unexpired epoch-millisecond expiry and the actual grant scopes,
221
+ the projected request, and an abort signal. Ordinary scopes come from
222
+ `material.metadata.scopes`; access-only custody uses trusted
223
+ `material.descriptor.metadata.scopes`, filling absent scopes from trusted resolution
224
+ `descriptor.metadata.scopes`; explicit invalid scopes are never replaced.
225
+ No refresh token, headers, account metadata or request auth reaches the runner.
226
+
227
+ The versioned capability profile requires `cliVersion`, `source` and
228
+ `qualificationRef` for protocol `claude-code-stream-json-v1`. These references are
229
+ trusted host attestations, not verification by mesh. Default request support is
230
+ an explicit `modelId` and one user text message. Only this baseline is expected to
231
+ qualify with the official CLI; `history` and `tools` are expected **`not-covered`**
232
+ unless M3 proves otherwise, with separate source/qualification references.
233
+ **Verified (source):** the [SDK input contract](https://platform.claude.com/docs/en/agent-sdk/typescript)
234
+ uses `SDKUserMessage` streams. “All CLI stream-json input is user-only” remains
235
+ **unverified**: the inspected official 2.1.80 parser also accepts assistant/system
236
+ records (spec A7). Neither fact proves history or mesh-owned tool continuation.
237
+ The tool subset accepts JSON function
238
+ schemas, complete call IDs/arguments and matching string results; it rejects
239
+ incomplete histories and unsupported extras. System/developer prompts, media,
240
+ reasoning, sampling/token limits, structured output, forced/parallel tools and
241
+ provider overrides are refused before running. Callers using `createLlmMesh` may
242
+ use its model-selection contract; mesh resolves it to `modelId` and removes `model`
243
+ before delegation. Direct runtime-client calls must supply `modelId` and omit
244
+ `model`; this client does not resolve aliases or choose a default model.
245
+
246
+ The host must prove isolated credential/config files, environment allowlisting,
247
+ tool/hook/MCP confinement, bounded parsing, cross-process serialization,
248
+ descendant reaping/cleanup and zero child refresh. Abort and consumer early-close
249
+ signal cancellation; the trusted host owns process termination. A final runner
250
+ result must certify successful cleanup, followed by EOF.
251
+
252
+ Production must enforce default-deny egress for the runner's **whole process tree**
253
+ using a network namespace or equivalent: allow only qualified inference origins,
254
+ block the OAuth token endpoint and all alternate destinations, and prevent bypass
255
+ by descendants, proxies, direct IPs or inherited host access. Shared inference/token
256
+ origins require enforceable endpoint separation or refusal. The M5 probe is a
257
+ regression check, not this enforcement. Its fixture CA/DNS overrides and fake token
258
+ endpoint are test-only; production denies those overrides and token egress.
259
+
260
+ The host prefers verified tmpfs (e.g. `$XDG_RUNTIME_DIR`); otherwise it uses a
261
+ dedicated 0700 directory, with exclusive 0600 files, `O_EXCL | O_NOFOLLOW` and
262
+ `lstat` checks. SIGKILL/crash can bypass cleanup and leave an access-only file.
263
+ A supervisor reaps descendants; orphan sweeps run at the next runner start **and
264
+ host boot**, using lock/PID/start/boot identity and a configured staleness threshold
265
+ (default five minutes, with retry for younger orphans). Live or ambiguous owners
266
+ prevent deletion. Sweeps delete within the dedicated root without following
267
+ symlinks or reading credential contents; tmpfs/deletion do not guarantee erasure
268
+ from swap, dumps or storage.
269
+
270
+ The projection contains the **real expiry**, never a refresh token. Writing an
271
+ earlier timestamp cannot shorten provider validity. The host can refuse remaining
272
+ TTL above `maxRemainingTtlMs` or below its run deadline. Running immediately after
273
+ refresh improves freshness but usually maximizes remaining TTL and does not reduce
274
+ exposure; it may conflict with that maximum. Cleanup cannot revoke a stolen token.
275
+ These host requirements are **unverified implementations** until qualified in h2a.
276
+ The precise contract,
277
+ proposed h2a tests and fake-credential M5 counting probe are in
278
+ [`spec/SPEC_EVOL_LLM_MESH_CLAUDE_SEAT.md`](../../spec/SPEC_EVOL_LLM_MESH_CLAUDE_SEAT.md).
279
+ No real CLI qualification is claimed by the mesh fake-runner tests. Until the
280
+ host supplies a qualified runner, seats remain **enrollment only** and execution
281
+ is **`not-covered`**. The Terms of use and suspension/refused-call risks above
282
+ apply equally when the official CLI executes requests.
283
+
92
284
  ## Route quote
93
285
 
94
286
  `quoteRoute(input, { council, profiles })` (or `routePlanner.quote(input)`)
@@ -1,9 +1,31 @@
1
+ import type { ConfigResolver } from '../service/facade.js';
1
2
  import type { CompleteEnrollmentInput, EnrollmentProvider, EnrollmentSession, PreparedCredential, RefreshInput, ResolvedProviderMetadata, StartEnrollmentInput } from './contracts.js';
3
+ export declare class ClaudeRefreshPreparationError extends Error {
4
+ constructor();
5
+ }
6
+ export interface ClaudeCodeEnrollmentOptions {
7
+ configResolver?: ConfigResolver;
8
+ fetchFn?: typeof fetch;
9
+ nowFn?: () => number;
10
+ }
2
11
  export declare class ClaudeCodeEnrollmentProvider implements EnrollmentProvider {
3
- start(_input: StartEnrollmentInput): Promise<EnrollmentSession>;
4
- complete(_input: CompleteEnrollmentInput): Promise<PreparedCredential>;
5
- resolve(_credential: PreparedCredential): Promise<ResolvedProviderMetadata>;
6
- refresh(_input: RefreshInput): Promise<PreparedCredential>;
7
- cancel(_enrollmentId: string): Promise<void>;
12
+ private readonly options;
13
+ private readonly fetchFn;
14
+ private readonly now;
15
+ private readonly metadata;
16
+ private readonly sessions;
17
+ constructor(options?: ClaudeCodeEnrollmentOptions);
18
+ private profile;
19
+ start(input: StartEnrollmentInput): Promise<EnrollmentSession>;
20
+ complete(input: CompleteEnrollmentInput): Promise<PreparedCredential>;
21
+ importCredential(credentialJson: string): Promise<PreparedCredential>;
22
+ resolve(credential: PreparedCredential): Promise<ResolvedProviderMetadata>;
23
+ private prepare;
24
+ private grant;
25
+ private exchange;
26
+ refresh(input: RefreshInput & {
27
+ grantedScopes?: unknown;
28
+ }): Promise<PreparedCredential>;
29
+ cancel(enrollmentId: string): Promise<void>;
8
30
  }
9
31
  //# sourceMappingURL=claude-code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/enrollment/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAExB,qBAAa,4BAA6B,YAAW,kBAAkB;IAC/D,KAAK,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAM/D,QAAQ,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMtE,OAAO,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAM3E,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAM1D,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD"}
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/enrollment/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,K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 -1,18 +1,232 @@
1
+ import { generateNonce, generatePkcePair } from './pkce.js';
2
+ // Public constants verified in official Claude Code 2.1.296 (spec ledger A2; live
3
+ // validation 2026-10-10: the legacy claude.ai authorize endpoint leaves the consent
4
+ // button permanently disabled and current grants carry the user:plugins scope).
5
+ const USER_SCOPES = ['user:profile', 'user:inference', 'user:sessions:claude_code',
6
+ 'user:mcp_servers', 'user:plugins', 'user:file_upload'];
7
+ const BUNDLED_PROFILE = {
8
+ id: 'claude-code-oauth-2.1.296-v1',
9
+ authorizationUrl: 'https://claude.com/cai/oauth/authorize',
10
+ tokenUrl: 'https://platform.claude.com/v1/oauth/token',
11
+ clientId: '9d1c250a-e61b-44d9-88ed-5944d1962f5e',
12
+ redirectUri: 'https://platform.claude.com/oauth/code/callback',
13
+ authorizationScopes: ['org:create_api_key', ...USER_SCOPES],
14
+ refreshScopes: [...USER_SCOPES], requiredScopes: ['user:inference'],
15
+ source: 'https://registry.npmjs.org/@anthropic-ai/claude-code/2.1.296',
16
+ };
17
+ const failure = (reason) => new Error(`Claude enrollment: ${reason}; reauthenticate`);
18
+ // Only local preparation failures may permit replaying the same refresh grant.
19
+ export class ClaudeRefreshPreparationError extends Error {
20
+ constructor() { super('Claude refresh preparation failed; retry later'); }
21
+ }
22
+ const object = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
23
+ const token = (value) => typeof value === 'string' && value.trim().length > 0 && !/[\r\n]/.test(value);
24
+ const scopes = (value) => Array.isArray(value)
25
+ && value.length > 0 && value.every((item) => typeof item === 'string' && /^[a-z0-9:_-]+$/.test(item));
26
+ const httpsUrl = (value) => {
27
+ if (typeof value !== 'string')
28
+ return false;
29
+ try {
30
+ const url = new URL(value);
31
+ return url.protocol === 'https:' && !url.username && !url.password && !url.search && !url.hash;
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ };
37
+ function validateProfile(value) {
38
+ if (!object(value) || typeof value.id !== 'string' || !/^[a-z0-9][a-z0-9._-]{2,99}$/.test(value.id)
39
+ || value.id === 'v1.0.0' || !httpsUrl(value.authorizationUrl) || !httpsUrl(value.tokenUrl)
40
+ || !httpsUrl(value.redirectUri) || !httpsUrl(value.source) || !token(value.clientId)
41
+ || !scopes(value.authorizationScopes) || !scopes(value.refreshScopes) || !scopes(value.requiredScopes)
42
+ || !value.requiredScopes.includes('user:inference')
43
+ || !value.requiredScopes.every((scope) => value.authorizationScopes.includes(scope)
44
+ && value.refreshScopes.includes(scope)))
45
+ throw failure('invalid OAuth profile');
46
+ const profile = { id: value.id, authorizationUrl: value.authorizationUrl,
47
+ tokenUrl: value.tokenUrl, redirectUri: value.redirectUri, clientId: value.clientId,
48
+ source: value.source, authorizationScopes: [...value.authorizationScopes],
49
+ refreshScopes: [...value.refreshScopes], requiredScopes: [...value.requiredScopes] };
50
+ if (profile.id === BUNDLED_PROFILE.id && JSON.stringify(profile) !== JSON.stringify({
51
+ ...profile, ...BUNDLED_PROFILE,
52
+ }))
53
+ throw failure('reserved OAuth profile');
54
+ return profile;
55
+ }
1
56
  export class ClaudeCodeEnrollmentProvider {
2
- async start(_input) {
3
- throw new Error('UNSUPPORTED: claude-code account transport enrollment is portal-only and unsupported locally in h2a-runtime.');
57
+ options;
58
+ fetchFn;
59
+ now;
60
+ metadata = new WeakMap();
61
+ sessions = new Map();
62
+ constructor(options = {}) {
63
+ this.options = options;
64
+ this.fetchFn = options.fetchFn ?? fetch;
65
+ this.now = options.nowFn ?? Date.now;
66
+ }
67
+ async profile(configRef, refresh = false) {
68
+ if (refresh && configRef === BUNDLED_PROFILE.id)
69
+ return BUNDLED_PROFILE;
70
+ if (refresh && (!configRef || configRef === 'v1.0.0'))
71
+ throw failure('unknown OAuth profile');
72
+ let value;
73
+ try {
74
+ value = await this.options.configResolver?.resolveConfig(configRef);
75
+ }
76
+ catch {
77
+ if (refresh)
78
+ throw new ClaudeRefreshPreparationError();
79
+ throw failure('OAuth profile resolution failed');
80
+ }
81
+ if (!this.options.configResolver || (object(value) && Object.keys(value).length === 0)) {
82
+ if (refresh)
83
+ throw failure('unknown OAuth profile');
84
+ return BUNDLED_PROFILE;
85
+ }
86
+ const profile = validateProfile(value);
87
+ if (refresh && profile.id !== configRef)
88
+ throw failure('OAuth profile version mismatch');
89
+ return profile;
90
+ }
91
+ async start(input) {
92
+ if (!input.ownerScope?.trim())
93
+ throw failure('ownerScope is required');
94
+ const profile = await this.profile(input.configRef);
95
+ if (input.redirectUri && input.redirectUri !== profile.redirectUri)
96
+ throw failure('redirect mismatch');
97
+ const { codeVerifier, codeChallenge } = generatePkcePair();
98
+ const state = generateNonce();
99
+ const enrollmentId = `enr_claude_${generateNonce()}`;
100
+ const expiresAt = this.now() + 15 * 60_000;
101
+ const url = new URL(profile.authorizationUrl);
102
+ url.search = new URLSearchParams({ code: 'true', response_type: 'code', client_id: profile.clientId,
103
+ redirect_uri: profile.redirectUri, scope: profile.authorizationScopes.join(' '),
104
+ code_challenge: codeChallenge, code_challenge_method: 'S256', state }).toString();
105
+ const timer = setTimeout(() => { void this.cancel(enrollmentId); }, 15 * 60_000);
106
+ timer.unref?.();
107
+ this.sessions.set(enrollmentId, { profile, verifier: codeVerifier, state, expiresAt,
108
+ consumed: false, controller: new AbortController(), timer });
109
+ return { kind: 'authorization-url', enrollmentId, url: url.toString(), expiresAt: new Date(expiresAt).toISOString() };
110
+ }
111
+ async complete(input) {
112
+ const session = this.sessions.get(input.enrollmentId);
113
+ if (!session || session.consumed)
114
+ throw failure('session unavailable');
115
+ session.consumed = true;
116
+ try {
117
+ const parts = typeof input.code === 'string' ? input.code.split('#') : [];
118
+ if (this.now() >= session.expiresAt || parts.length !== 2 || !token(parts[0])
119
+ || parts[1] !== session.state)
120
+ throw failure('invalid code, state or expired session');
121
+ const value = await this.exchange(session.profile, { grant_type: 'authorization_code',
122
+ code: parts[0], state: session.state, code_verifier: session.verifier,
123
+ client_id: session.profile.clientId, redirect_uri: session.profile.redirectUri }, session.controller);
124
+ if (this.sessions.get(input.enrollmentId) !== session || session.controller.signal.aborted
125
+ || this.now() >= session.expiresAt)
126
+ throw failure('session cancelled or expired');
127
+ return this.grant(value, session.profile, `acct_claude_${generateNonce()}`, 'browser');
128
+ }
129
+ finally {
130
+ await this.cancel(input.enrollmentId);
131
+ }
132
+ }
133
+ async importCredential(credentialJson) {
134
+ if (typeof credentialJson !== 'string' || new TextEncoder().encode(credentialJson).length > 65_536) {
135
+ throw failure('invalid credential document');
136
+ }
137
+ let value;
138
+ try {
139
+ value = JSON.parse(credentialJson);
140
+ }
141
+ catch {
142
+ throw failure('Paste the renewable Claude CLI credential or use browser enrollment');
143
+ }
144
+ if (object(value) && Object.hasOwn(value, 'claudeAiOauth'))
145
+ value = value.claudeAiOauth;
146
+ if (!object(value))
147
+ throw failure('invalid credential document');
148
+ const profile = await this.profile('claude-code');
149
+ return this.prepare(value.accessToken, value.refreshToken, value.expiresAt, value.scopes, profile, `acct_claude_${generateNonce()}`, 'credential-import');
150
+ }
151
+ async resolve(credential) {
152
+ const metadata = this.metadata.get(credential);
153
+ return metadata ? { ...metadata, scopes: [...metadata.scopes] } : {};
154
+ }
155
+ prepare(access, refresh, expiry, grantedScopes, profile, accountId, method) {
156
+ if (!token(access) || !token(refresh) || typeof expiry !== 'number' || expiry <= 0
157
+ || !Number.isFinite(expiry) || !Number.isFinite(new Date(expiry).getTime())
158
+ || !scopes(grantedScopes) || !profile.requiredScopes.every((scope) => grantedScopes.includes(scope))
159
+ || !grantedScopes.every((scope) => profile.authorizationScopes.includes(scope))) {
160
+ throw failure('invalid renewable grant');
161
+ }
162
+ const credential = { accountId, accessToken: access, refreshToken: refresh,
163
+ expiresAt: new Date(expiry).toISOString(), authClientConfigVersion: profile.id };
164
+ this.metadata.set(credential, { billing_type: 'seat', enrollmentMethod: method,
165
+ authClientConfigVersion: profile.id, refreshManagement: 'mesh', scopes: [...grantedScopes] });
166
+ return credential;
4
167
  }
5
- async complete(_input) {
6
- throw new Error('UNSUPPORTED: claude-code account transport enrollment is portal-only and unsupported locally in h2a-runtime.');
168
+ grant(value, profile, accountId, method, previousRefresh, previousScopes) {
169
+ if (!object(value) || typeof value.expires_in !== 'number' || !Number.isFinite(value.expires_in)
170
+ || value.expires_in <= 0 || (Object.hasOwn(value, 'scope') && typeof value.scope !== 'string')) {
171
+ throw failure('invalid token response');
172
+ }
173
+ const expiry = this.now() + value.expires_in * 1000;
174
+ if (expiry <= this.now())
175
+ throw failure('invalid token expiry');
176
+ return this.prepare(value.access_token, Object.hasOwn(value, 'refresh_token') ? value.refresh_token : previousRefresh, expiry, typeof value.scope === 'string' ? value.scope.split(' ') : previousScopes, profile, accountId, method);
7
177
  }
8
- async resolve(_credential) {
9
- throw new Error('UNSUPPORTED: claude-code account transport enrollment is portal-only and unsupported locally in h2a-runtime.');
178
+ async exchange(profile, body, controller = new AbortController()) {
179
+ let timer;
180
+ const deadline = new Promise((_, reject) => {
181
+ timer = setTimeout(() => { controller.abort(); reject(failure('token request timed out')); }, 30_000);
182
+ });
183
+ try {
184
+ return await Promise.race([deadline, (async () => {
185
+ let response;
186
+ let value;
187
+ try {
188
+ response = await this.fetchFn(profile.tokenUrl, { method: 'POST', redirect: 'error',
189
+ headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), signal: controller.signal });
190
+ }
191
+ catch {
192
+ throw failure('token request failed');
193
+ }
194
+ try {
195
+ value = await response.json();
196
+ }
197
+ catch {
198
+ throw failure(`HTTP ${response.status} invalid_response`);
199
+ }
200
+ if (!response.ok) {
201
+ const code = object(value) && typeof value.error === 'string'
202
+ && ['invalid_grant', 'invalid_request', 'invalid_client', 'unauthorized_client',
203
+ 'unsupported_grant_type', 'invalid_scope', 'access_denied'].includes(value.error) ? value.error : 'oauth_error';
204
+ throw failure(`HTTP ${response.status} ${code}`);
205
+ }
206
+ return value;
207
+ })()]);
208
+ }
209
+ finally {
210
+ clearTimeout(timer);
211
+ }
10
212
  }
11
- async refresh(_input) {
12
- throw new Error('UNSUPPORTED: claude-code account transport refresh is portal-only and unsupported locally in h2a-runtime.');
213
+ async refresh(input) {
214
+ const profile = await this.profile(input.credentialVersion, true);
215
+ if (!token(input.refreshToken))
216
+ throw failure('missing or invalid refresh token');
217
+ const value = await this.exchange(profile, { grant_type: 'refresh_token',
218
+ refresh_token: input.refreshToken, client_id: profile.clientId, scope: profile.refreshScopes.join(' ') });
219
+ return this.grant(value, profile, input.accountId, 'refresh', input.refreshToken, input.grantedScopes);
13
220
  }
14
- async cancel(_enrollmentId) {
15
- // no-op stub
221
+ async cancel(enrollmentId) {
222
+ const session = this.sessions.get(enrollmentId);
223
+ if (!session)
224
+ return;
225
+ this.sessions.delete(enrollmentId);
226
+ clearTimeout(session.timer);
227
+ session.controller.abort();
228
+ session.verifier = '';
229
+ session.state = '';
16
230
  }
17
231
  }
18
232
  //# sourceMappingURL=claude-code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/enrollment/claude-code.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,4BAA4B;IACvC,KAAK,CAAC,KAAK,CAAC,MAA4B;QACtC,MAAM,IAAI,KAAK,CACb,8GAA8G,CAC/G,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAA+B;QAC5C,MAAM,IAAI,KAAK,CACb,8GAA8G,CAC/G,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,WAA+B;QAC3C,MAAM,IAAI,KAAK,CACb,8GAA8G,CAC/G,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAoB;QAChC,MAAM,IAAI,KAAK,CACb,2GAA2G,CAC5G,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,aAAa;IACf,CAAC;CACF"}
1
+ {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/enrollment/claude-code.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAuB5D,kFAAkF;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O,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACzG,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,YAAoB;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACnC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC5B,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -1,2 +1,2 @@
1
- export type { AccountPublic, CredentialEnvelope, EnrollmentProvider, EnrollmentSession, PreparedCredential, ResolvedProviderMetadata, StartEnrollmentInput, } from './contracts.js';
1
+ export type { AccountPublic, CredentialEnvelope, EnrollmentCompletion, EnrollmentProvider, EnrollmentSession, PreparedCredential, ResolvedProviderMetadata, StartEnrollmentInput, } from './contracts.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enrollment/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enrollment/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
@@ -11,7 +11,7 @@ export function generatePkcePair() {
11
11
  return { codeVerifier, codeChallenge };
12
12
  }
13
13
  export function generateNonce() {
14
- return base64Url(randomBytes(16));
14
+ return base64Url(randomBytes(32));
15
15
  }
16
16
  export async function createLoopbackServer(expectedState, preferredPort = 0) {
17
17
  let server = null;
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ export * from './codex.js';
21
21
  export * from './transport/codex-runtime-client.js';
22
22
  export * from './transport/codex-runtime-wire.js';
23
23
  export * from './transport/cloud-code-runtime-client.js';
24
+ export * from './transport/claude-code-runtime-client.js';
24
25
  export * from './transport/muse-runtime-client.js';
25
26
  export * from './transport/mistral-runtime-client.js';
26
27
  export * from './streaming.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,0BAA0B,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,iBAAiB,GAChF,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,0BAA0B,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,iBAAiB,GAChF,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ export * from './codex.js';
21
21
  export * from './transport/codex-runtime-client.js';
22
22
  export * from './transport/codex-runtime-wire.js';
23
23
  export * from './transport/cloud-code-runtime-client.js';
24
+ export * from './transport/claude-code-runtime-client.js';
24
25
  export * from './transport/muse-runtime-client.js';
25
26
  export * from './transport/mistral-runtime-client.js';
26
27
  export * from './streaming.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,0BAA0B,EAAE,eAAe,EAAE,UAAU,GACxD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,C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