@cortexkit/anthropic-auth-core 2.2.2 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claude-code.d.ts +2 -1
- package/dist/constants.d.ts +5 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1142 -746
- package/dist/internal-types/claustrum/enrollment.d.ts +5 -0
- package/dist/internal-types/fs/private-files.d.ts +2 -0
- package/dist/internal-types/setup/enroll.d.ts +34 -0
- package/dist/internal-types/setup/index.d.ts +1 -0
- package/dist/internal-types/setup/process-fence.d.ts +7 -0
- package/dist/internal-types/setup/types.d.ts +5 -0
- package/dist/mid-conversation-output-config.d.ts +19 -15
- package/dist/model-capabilities.d.ts +136 -0
- package/dist/models.d.ts +28 -59
- package/dist/native-enrollment-authority.d.ts +19 -0
- package/dist/native-ui.d.ts +10 -1
- package/dist/pool-authority.d.ts +16 -1
- package/dist/turn-end-note.d.ts +4 -3
- package/package.json +2 -2
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type ClaustrumClientOptions as ClaustrumEnrollmentClientOptions, type EnrollmentPollOutcome, type EnrollmentTokenFile, writeEnrollmentTokenFile } from '@cortexkit/claustrum-client';
|
|
2
|
+
/**
|
|
3
|
+
* The code a vault without the enrollment ceremony answers a proposal with.
|
|
4
|
+
* Setup reports it as "this vault cannot connect plugins" instead of waiting.
|
|
5
|
+
*/
|
|
6
|
+
export declare const UNSUPPORTED_ENROLLMENT_CODE = "unknown_method";
|
|
2
7
|
/**
|
|
3
8
|
* Codes the vault's closed enrollment-refusal vocabulary marks permanent. The
|
|
4
9
|
* client labels some module error frames transient/retry regardless, so the
|
|
@@ -5,6 +5,8 @@ type Backend = typeof import('@cortexkit/private-files');
|
|
|
5
5
|
type Kind = 'file' | 'directory';
|
|
6
6
|
/** Tests inject a backend here; production always imports the private-files package. */
|
|
7
7
|
export declare function setPrivateFilesBackendForTest(api?: Backend): void;
|
|
8
|
+
/** The fixed `reason` of a refusal because the Windows native addon did not load. */
|
|
9
|
+
export declare const PRIVATE_FILES_UNAVAILABLE_REASON = "native-addon-unavailable";
|
|
8
10
|
export declare class PrivateFileError extends Error {
|
|
9
11
|
readonly path: string;
|
|
10
12
|
readonly stage: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type MenuTerminal } from '../auth-menu/terminal.js';
|
|
2
|
+
import type { SetupHost, SetupIO, SetupPlugin } from './types.js';
|
|
3
|
+
/** Fixed text: no version, host or account detail, so it is safe to print anywhere. */
|
|
4
|
+
export declare const UNSUPPORTED_VAULT_MESSAGE = "This Claustrum vault does not support connecting plugins yet, so setup cannot connect to it. Run setup without --claustrum to use local accounts.";
|
|
5
|
+
/**
|
|
6
|
+
* The longest setup waits, in total, for the vault to create the enrollment
|
|
7
|
+
* request and for an operator to approve it. It matches the wait setup always
|
|
8
|
+
* had (300 one-second polls), but is now measured on the clock: a vault that
|
|
9
|
+
* answers each request slowly can no longer stretch it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ENROLLMENT_WAIT_MS = 300000;
|
|
12
|
+
/** Why a host's enrollment ended without a token. */
|
|
13
|
+
export type HostNotEnrolledReason = 'connection-failed' | 'unsupported-vault' | 'request-not-created' | 'approval-pending' | 'refused' | 'invalid-request' | 'incomplete';
|
|
14
|
+
/**
|
|
15
|
+
* Thrown when the enrollment ended without writing the host's token: the vault
|
|
16
|
+
* could not be reached, it cannot enroll plugins, it refused the request, it
|
|
17
|
+
* never created one, approval never came before setup stopped waiting, or
|
|
18
|
+
* the enrollment failed in some other way (`incomplete`).
|
|
19
|
+
* Setup can then report the host as not connected without reading its files.
|
|
20
|
+
* The message is fixed text built only from vetted values, never from what
|
|
21
|
+
* the vault or client threw. `lastErrorCode` is the last enrollment error code
|
|
22
|
+
* setup saw, from the vault or from the client's transport (for example
|
|
23
|
+
* `transport_error`), for diagnostics; it carries no secret.
|
|
24
|
+
*/
|
|
25
|
+
export declare class HostNotEnrolledError extends Error {
|
|
26
|
+
readonly reason: HostNotEnrolledReason;
|
|
27
|
+
readonly lastErrorCode?: string;
|
|
28
|
+
constructor(message: string, details: {
|
|
29
|
+
reason: HostNotEnrolledReason;
|
|
30
|
+
lastErrorCode?: string;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Enroll an independently revocable host; plugin callbacks choose its credential store and account permissions. */
|
|
34
|
+
export declare function connectSetupHost(plugin: SetupPlugin, host: SetupHost, io: SetupIO, terminal: MenuTerminal, fence: () => Promise<void>): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { AMBIGUOUS_OPENCODE_MESSAGE, runSetup } from './command.js';
|
|
2
2
|
export { SetupCommandError, setupEnrollment } from './command-error.js';
|
|
3
3
|
export { detectHosts, detectOpenCodeGeneration, findExecutableOnPath, openCodeDesktopMarkers, } from './detect.js';
|
|
4
|
+
export { ENROLLMENT_WAIT_MS, HostNotEnrolledError, type HostNotEnrolledReason, UNSUPPORTED_VAULT_MESSAGE, } from './enroll.js';
|
|
4
5
|
export { assertHostsStopped, createProcessFence, listSetupProcesses, ProcessFenceViolationError, ProcessInspectionError, type ProcessInspectionStep, } from './process-fence.js';
|
|
5
6
|
export { type PlannedWrite, planOpenCodeRegistration, registerOpenCode, registerPi, updatePluginConfig, } from './register.js';
|
|
6
7
|
export type { CommandResult, CommandRunner, HostDetection, OpenCodeGeneration, ProcessFence, SetupCallbackContext, SetupDetection, SetupEnrollmentOutcome, SetupEnvironment, SetupFileSystem, SetupHost, SetupHostEnrollment, SetupIO, SetupPlugin, SetupResult, } from './types.js';
|
|
@@ -39,6 +39,13 @@ export declare function listSetupProcesses(runner?: CommandRunner, options?: {
|
|
|
39
39
|
* a container this process can hold any small PID a fixture uses.
|
|
40
40
|
*/
|
|
41
41
|
selfPid?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Windows only: answer with one CIM query for the images a fence cares
|
|
44
|
+
* about (host programs, Node and Bun), returning image name, PID and
|
|
45
|
+
* command line together, instead of `tasklist` followed by a second CIM
|
|
46
|
+
* query. The result lists only those processes.
|
|
47
|
+
*/
|
|
48
|
+
hostImagesOnly?: boolean;
|
|
42
49
|
}): Promise<Array<{
|
|
43
50
|
pid: number;
|
|
44
51
|
command: string;
|
|
@@ -125,6 +125,11 @@ export interface SetupIO {
|
|
|
125
125
|
handshakeTimeoutMs: number;
|
|
126
126
|
}) => Promise<ClaustrumEnrollmentConnection>;
|
|
127
127
|
wait?: (ms: number) => Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Monotonic milliseconds that bound the enrollment wait. Defaults to
|
|
130
|
+
* `performance.now`; tests pair it with `wait` to run a fake clock.
|
|
131
|
+
*/
|
|
132
|
+
now?: () => number;
|
|
128
133
|
}
|
|
129
134
|
export interface HostDetection {
|
|
130
135
|
installed: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { PER_TURN_CONTROL_BETA } from './model-capabilities.ts';
|
|
1
2
|
/**
|
|
2
|
-
* Per-turn control beta that Claude Code sends on
|
|
3
|
-
*
|
|
3
|
+
* Per-turn control beta that Claude Code sends on the models whose
|
|
4
|
+
* capability rows list it. It enables effort changes carried by empty
|
|
4
5
|
* `role: "system"` messages on the eligible models below.
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
+
export { PER_TURN_CONTROL_BETA };
|
|
7
8
|
export type AdaptiveEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
8
9
|
export type MidConversationEffortTransition = {
|
|
9
10
|
/** Number of assistant messages preceding the user boundary for this effort. */
|
|
@@ -12,30 +13,33 @@ export type MidConversationEffortTransition = {
|
|
|
12
13
|
};
|
|
13
14
|
export declare function normalizeAdaptiveEffort(value: unknown): AdaptiveEffort | undefined;
|
|
14
15
|
/**
|
|
15
|
-
* Models that require adaptive thinking for per-message effort
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Models that require adaptive thinking for per-message effort (capability
|
|
17
|
+
* `effortMarkers: "with-adaptive-thinking"`: Opus 5.5 and Sonnet 5.5),
|
|
18
|
+
* including dated and `[1m]` context-window ids. Header eligibility is
|
|
19
|
+
* separate; `sendsPerTurnControlBeta` follows Claude Code.
|
|
18
20
|
*/
|
|
19
21
|
export declare function usesPerTurnControl(model: unknown): boolean;
|
|
20
22
|
/**
|
|
21
|
-
* Models whose OAuth requests carry `PER_TURN_CONTROL_BETA`:
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* effort markers; `supportsPerMessageEffort` decides that.
|
|
23
|
+
* Models whose OAuth requests carry `PER_TURN_CONTROL_BETA`: those whose
|
|
24
|
+
* Claude Code main beta list includes it (Opus 5.5, Sonnet 5.5, Fable 5.1 and
|
|
25
|
+
* Haiku 5.5 in Claude Code 2.1.302). Sending the beta does not by itself make
|
|
26
|
+
* a model eligible for effort markers; `supportsPerMessageEffort` decides that.
|
|
25
27
|
*/
|
|
26
28
|
export declare function sendsPerTurnControlBeta(model: unknown): boolean;
|
|
27
29
|
/**
|
|
28
30
|
* Whether a request may move effort changes into empty system messages.
|
|
29
31
|
*
|
|
30
|
-
* Fable 5.1
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* Models with `effortMarkers: "always"` (Fable 5.1) are always eligible,
|
|
33
|
+
* whatever the thinking field says. Models with `"with-adaptive-thinking"`
|
|
34
|
+
* (Opus 5.5, Sonnet 5.5) qualify only with adaptive thinking: Anthropic
|
|
35
|
+
* rejects a differing per-message effort with HTTP 400 on Sonnet 5.5
|
|
36
|
+
* `between_tools`, and asks callers to use adaptive thinking to vary effort.
|
|
34
37
|
*/
|
|
35
38
|
export declare function supportsPerMessageEffort(body: Record<string, unknown>): boolean;
|
|
36
39
|
/**
|
|
37
40
|
* The effort Anthropic applies when a request sets no `output_config.effort`:
|
|
38
|
-
* `medium` on Opus 5.5 and Haiku 5.5,
|
|
41
|
+
* the capability row's default (`medium` on Opus 5.5 and Haiku 5.5), and
|
|
42
|
+
* `high` on models without a row.
|
|
39
43
|
* A history entry without a recognized effort level uses this value.
|
|
40
44
|
*/
|
|
41
45
|
export declare function defaultAdaptiveEffort(model: unknown): AdaptiveEffort;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { AdaptiveEffort } from './mid-conversation-output-config.ts';
|
|
2
|
+
/**
|
|
3
|
+
* One row per Claude model that this plugin treats differently from an
|
|
4
|
+
* unknown model. Every per-model decision in Core (family checks, effort
|
|
5
|
+
* handling, Claude Code betas, turn-end notes, thinking-binding controls) and
|
|
6
|
+
* the per-model facts OpenCode and Pi read (catalogue entries, fallback
|
|
7
|
+
* eligibility) come from this table, so adding a model is one new row.
|
|
8
|
+
*
|
|
9
|
+
* Ids stay exact. A request model resolves to a row only when it equals the
|
|
10
|
+
* row's id (after removing OpenCode's `[1m]` context-window qualifier) or
|
|
11
|
+
* extends it as the row's `idSuffixes` allows; when several rows match, the
|
|
12
|
+
* longest id wins. A model that matches no row gets the defaults described on
|
|
13
|
+
* each field.
|
|
14
|
+
*/
|
|
15
|
+
/** Per-turn control beta Claude Code sends on the models whose rows list it. */
|
|
16
|
+
export declare const PER_TURN_CONTROL_BETA = "per-turn-control-2026-07-01";
|
|
17
|
+
/** Beta that allows turn-scoped system messages (`clear_at`). */
|
|
18
|
+
export declare const TURN_END_NOTE_BETA = "mid-conversation-system-clear-at-2026-08-21";
|
|
19
|
+
export declare const CLAUDE_CODE_FULL_AGENT_BETAS: readonly ["claude-code-20250219", 'oauth-2025-04-20', 'interleaved-thinking-2025-05-14', 'thinking-token-count-2026-05-13', 'context-management-2025-06-27', "prompt-caching-scope-2026-01-05", 'mid-conversation-tool-changes-2026-07-01', 'advanced-tool-use-2025-11-20', "mid-conversation-system-clear-at-2026-08-21", 'effort-2025-11-24', 'thinking-binding-controls-2026-08-01', 'thinking-display-updates-2026-08-18', 'extended-cache-ttl-2025-04-11', 'cache-diagnosis-2026-04-07'];
|
|
20
|
+
/**
|
|
21
|
+
* Claude Code's `anthropic-beta` list for each request class, before the
|
|
22
|
+
* body-dependent additions (turn-end note, structured outputs, fast mode and
|
|
23
|
+
* caller-supplied betas). `main` is a conversation turn; `title` is any other
|
|
24
|
+
* auxiliary request; `quota` is a one-token auxiliary probe.
|
|
25
|
+
*/
|
|
26
|
+
export type ClaudeCodeBetaLists = {
|
|
27
|
+
main: readonly string[];
|
|
28
|
+
title: readonly string[];
|
|
29
|
+
quota: readonly string[];
|
|
30
|
+
};
|
|
31
|
+
/** The lists for a model without its own row. */
|
|
32
|
+
export declare const CLAUDE_CODE_DEFAULT_BETAS: ClaudeCodeBetaLists;
|
|
33
|
+
export type ClaudeModelFamily = 'fable' | 'mythos' | 'opus' | 'sonnet' | 'haiku';
|
|
34
|
+
/** Per-million-token USD prices. */
|
|
35
|
+
export type ClaudeModelPricing = {
|
|
36
|
+
input: number;
|
|
37
|
+
output: number;
|
|
38
|
+
cacheRead: number;
|
|
39
|
+
cacheWrite5m: number;
|
|
40
|
+
cacheWrite1h: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Catalogue facts for a model the plugin registers itself in OpenCode and Pi,
|
|
44
|
+
* rather than taking from the host's own model list.
|
|
45
|
+
*/
|
|
46
|
+
export type ClaudeModelCatalogue = {
|
|
47
|
+
releaseDate: string;
|
|
48
|
+
contextWindow: number;
|
|
49
|
+
maxOutputTokens: number;
|
|
50
|
+
pricing: ClaudeModelPricing;
|
|
51
|
+
/** Higher prices for every token of a request above `inputTokensAbove` input tokens. */
|
|
52
|
+
longContext?: {
|
|
53
|
+
inputTokensAbove: number;
|
|
54
|
+
pricing: ClaudeModelPricing;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
/** Source-model keys for content-filter recovery to Opus 4.8 in OpenCode. */
|
|
58
|
+
export type ClaudeRefusalRecoveryFamily = 'fable-5' | 'fable-5-1' | 'opus-5' | 'opus-5-5';
|
|
59
|
+
export type ClaudeModelCapabilities = {
|
|
60
|
+
/** Exact Anthropic model id. */
|
|
61
|
+
id: string;
|
|
62
|
+
/** Display name in host model pickers. */
|
|
63
|
+
name: string;
|
|
64
|
+
family: ClaudeModelFamily;
|
|
65
|
+
/**
|
|
66
|
+
* Longer ids that also resolve to this row: `any` accepts the id followed by
|
|
67
|
+
* `-` and anything (a date, `-fast`); `dated` accepts only `-YYYYMMDD`.
|
|
68
|
+
*/
|
|
69
|
+
idSuffixes: 'any' | 'dated';
|
|
70
|
+
/** Shown as limited availability. */
|
|
71
|
+
limited?: true;
|
|
72
|
+
/** Absent when the model comes from the host's own catalogue. */
|
|
73
|
+
catalogue?: ClaudeModelCatalogue;
|
|
74
|
+
/**
|
|
75
|
+
* Thinking settings the API accepts. OpenCode's transform.ts and Pi's
|
|
76
|
+
* convert.ts still normalize thinking with per-family code; a test checks
|
|
77
|
+
* that OpenCode's result agrees with this list.
|
|
78
|
+
*/
|
|
79
|
+
thinkingModes: readonly ('adaptive' | 'disabled' | 'between_tools')[];
|
|
80
|
+
/** The API rejects `tool_choice` of type `any` or `tool`, so it is removed. */
|
|
81
|
+
rejectsForcedToolChoice: boolean;
|
|
82
|
+
efforts: {
|
|
83
|
+
/**
|
|
84
|
+
* Efforts offered as host model variants with adaptive thinking. Absent:
|
|
85
|
+
* the host's own variants are left alone. Unknown models: absent.
|
|
86
|
+
*/
|
|
87
|
+
variants?: readonly AdaptiveEffort[];
|
|
88
|
+
/** Anthropic's effort when a request sets none. Unknown models: `high`. */
|
|
89
|
+
default: AdaptiveEffort;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* When effort changes may be sent as empty `role: "system"` messages:
|
|
93
|
+
* `always` (and top-level effort is then pinned on every request),
|
|
94
|
+
* `with-adaptive-thinking` (only when the request's thinking is adaptive),
|
|
95
|
+
* or `none`. Unknown models: `none`.
|
|
96
|
+
*/
|
|
97
|
+
effortMarkers: 'none' | 'with-adaptive-thinking' | 'always';
|
|
98
|
+
/** Turn-end notes may be inserted. Unknown models: no. */
|
|
99
|
+
turnEndNote: boolean;
|
|
100
|
+
/** `thinking.block_binding` may be set. Unknown models: no. */
|
|
101
|
+
thinkingBindingControls: boolean;
|
|
102
|
+
/** Unknown models: `CLAUDE_CODE_DEFAULT_BETAS`. */
|
|
103
|
+
claudeCodeBetas: ClaudeCodeBetaLists;
|
|
104
|
+
/** OpenCode may ask Anthropic for its server-side safety fallback. */
|
|
105
|
+
serverSideFallback: boolean;
|
|
106
|
+
/** OpenCode recovers from a content-filter refusal on Opus 4.8 under this key. */
|
|
107
|
+
refusalRecoveryFamily?: ClaudeRefusalRecoveryFamily;
|
|
108
|
+
/**
|
|
109
|
+
* Model-scoped weekly quota this model draws from. Quota matching in
|
|
110
|
+
* accounts.ts and native-quota-codec.ts still matches the substrings
|
|
111
|
+
* `fable`/`mythos`; a test checks that they agree with this field.
|
|
112
|
+
*/
|
|
113
|
+
scopedQuota?: 'fable' | 'mythos';
|
|
114
|
+
/**
|
|
115
|
+
* Fast mode (`speed: "fast"`) is offered. `isFastModeSupportedModel` also
|
|
116
|
+
* keeps its older prefix rule for ids outside this table.
|
|
117
|
+
*/
|
|
118
|
+
fastMode: boolean;
|
|
119
|
+
};
|
|
120
|
+
export declare const CLAUDE_MODEL_CAPABILITIES: readonly ClaudeModelCapabilities[];
|
|
121
|
+
/** Remove OpenCode's context-window qualifier before model-family checks. */
|
|
122
|
+
export declare function normalizeAnthropicModelId(model: string): string;
|
|
123
|
+
/**
|
|
124
|
+
* The row for a request model, or `undefined` for a model this plugin does
|
|
125
|
+
* not special-case. See the table's description for how ids match.
|
|
126
|
+
*/
|
|
127
|
+
export declare function resolveClaudeModelCapabilities(model: unknown): ClaudeModelCapabilities | undefined;
|
|
128
|
+
/** The row for an exact model id; throws when the table has no such row. */
|
|
129
|
+
export declare function getClaudeModelCapabilities(id: string): ClaudeModelCapabilities;
|
|
130
|
+
/** Catalogue facts for an exact model id; throws when the row has none. */
|
|
131
|
+
export declare function getClaudeModelCatalogue(id: string): ClaudeModelCatalogue;
|
|
132
|
+
/**
|
|
133
|
+
* Whether effort is pinned in top-level `output_config` on every request,
|
|
134
|
+
* even one without an effort change.
|
|
135
|
+
*/
|
|
136
|
+
export declare function pinsEffortOnEveryRequest(model: unknown): boolean;
|
package/dist/models.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { normalizeAnthropicModelId } from './model-capabilities.ts';
|
|
2
|
+
export { normalizeAnthropicModelId };
|
|
1
3
|
export declare const CLAUDE_FABLE_5_MODEL_ID = "claude-fable-5";
|
|
2
4
|
export declare const CLAUDE_MYTHOS_5_MODEL_ID = "claude-mythos-5";
|
|
3
5
|
export declare const CLAUDE_FABLE_5_1_MODEL_ID = "claude-fable-5-1";
|
|
@@ -9,8 +11,6 @@ export declare const CLAUDE_MYTHOS_5_1_MODEL_ID = "claude-mythos-5-1";
|
|
|
9
11
|
* above so per-million-token cost estimation does not conflate families.
|
|
10
12
|
*/
|
|
11
13
|
export declare const CLAUDE_HAIKU_4_5_MODEL_ID = "claude-haiku-4-5";
|
|
12
|
-
/** Remove OpenCode's context-window qualifier before model-family checks. */
|
|
13
|
-
export declare function normalizeAnthropicModelId(model: string): string;
|
|
14
14
|
/**
|
|
15
15
|
* Per-million-token USD pricing for Haiku 4.5. Used to project the cumulative
|
|
16
16
|
* cost of prime requests from persisted usage counters — never persisted on
|
|
@@ -27,24 +27,13 @@ export declare const CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING: {
|
|
|
27
27
|
readonly type: 'adaptive';
|
|
28
28
|
readonly display: 'summarized';
|
|
29
29
|
};
|
|
30
|
-
export declare const CLAUDE_FABLE_MYTHOS_5_PRICING:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export declare const CLAUDE_FABLE_MYTHOS_5_1_PRICING: {
|
|
38
|
-
readonly input: 10;
|
|
39
|
-
readonly output: 50;
|
|
40
|
-
readonly cacheRead: 0.25;
|
|
41
|
-
readonly cacheWrite5m: 12.5;
|
|
42
|
-
readonly cacheWrite1h: 20;
|
|
43
|
-
};
|
|
44
|
-
export declare const CLAUDE_FABLE_MYTHOS_5_CONTEXT_WINDOW = 1000000;
|
|
45
|
-
export declare const CLAUDE_FABLE_MYTHOS_5_MAX_OUTPUT_TOKENS = 128000;
|
|
46
|
-
export declare const CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE = "2026-06-09";
|
|
47
|
-
export declare const CLAUDE_FABLE_MYTHOS_5_1_RELEASE_DATE = "2026-09-01";
|
|
30
|
+
export declare const CLAUDE_FABLE_MYTHOS_5_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
|
|
31
|
+
export declare const CLAUDE_FABLE_MYTHOS_5_1_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
|
|
32
|
+
export declare const CLAUDE_FABLE_MYTHOS_5_CONTEXT_WINDOW: number;
|
|
33
|
+
export declare const CLAUDE_FABLE_MYTHOS_5_MAX_OUTPUT_TOKENS: number;
|
|
34
|
+
export declare const CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE: string;
|
|
35
|
+
export declare const CLAUDE_FABLE_MYTHOS_5_1_RELEASE_DATE: string;
|
|
36
|
+
/** Name and availability of each Fable and Mythos id, from the capability table. */
|
|
48
37
|
export declare const CLAUDE_FABLE_MYTHOS_5_MODEL_SPECS: Record<ClaudeFableMythos5ModelId, {
|
|
49
38
|
id: ClaudeFableMythos5ModelId;
|
|
50
39
|
name: string;
|
|
@@ -62,10 +51,14 @@ export declare const CLAUDE_FABLE_MYTHOS_5_1_MODEL_SPECS: {
|
|
|
62
51
|
limited?: boolean;
|
|
63
52
|
};
|
|
64
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Any Fable or Mythos row. An unknown id that extends a known Fable or Mythos
|
|
56
|
+
* id with `-` (for example `claude-fable-5-5`) resolves to the shorter row.
|
|
57
|
+
*/
|
|
65
58
|
export declare function isClaudeFableOrMythos5Model(model: unknown): boolean;
|
|
66
59
|
export declare function isClaudeFableOrMythos51Model(model: unknown): boolean;
|
|
67
60
|
export declare function isClaudeFable51Model(model: unknown): boolean;
|
|
68
|
-
export declare function getClaudeFableMythos5ReleaseDate(model: unknown):
|
|
61
|
+
export declare function getClaudeFableMythos5ReleaseDate(model: unknown): string;
|
|
69
62
|
export declare const CLAUDE_SONNET_5_MODEL_ID = "claude-sonnet-5";
|
|
70
63
|
/**
|
|
71
64
|
* Sonnet 5 enables adaptive thinking by default but ships `display: "omitted"`,
|
|
@@ -79,41 +72,23 @@ export declare const CLAUDE_SONNET_5_ADAPTIVE_THINKING: {
|
|
|
79
72
|
};
|
|
80
73
|
export declare function isClaudeSonnet5Model(model: unknown): boolean;
|
|
81
74
|
export declare const CLAUDE_SONNET_5_5_MODEL_ID = "claude-sonnet-5-5";
|
|
82
|
-
export declare const CLAUDE_SONNET_5_5_RELEASE_DATE
|
|
83
|
-
export declare const CLAUDE_SONNET_5_5_CONTEXT_WINDOW
|
|
84
|
-
export declare const CLAUDE_SONNET_5_5_MAX_OUTPUT_TOKENS
|
|
85
|
-
export declare const CLAUDE_SONNET_5_5_PRICING:
|
|
86
|
-
readonly input: 2;
|
|
87
|
-
readonly output: 10;
|
|
88
|
-
readonly cacheRead: 0.2;
|
|
89
|
-
readonly cacheWrite5m: 2.5;
|
|
90
|
-
readonly cacheWrite1h: 4;
|
|
91
|
-
};
|
|
75
|
+
export declare const CLAUDE_SONNET_5_5_RELEASE_DATE: string;
|
|
76
|
+
export declare const CLAUDE_SONNET_5_5_CONTEXT_WINDOW: number;
|
|
77
|
+
export declare const CLAUDE_SONNET_5_5_MAX_OUTPUT_TOKENS: number;
|
|
78
|
+
export declare const CLAUDE_SONNET_5_5_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
|
|
92
79
|
export declare const CLAUDE_SONNET_5_5_ADAPTIVE_THINKING: {
|
|
93
80
|
readonly type: 'adaptive';
|
|
94
81
|
readonly display: 'summarized';
|
|
95
82
|
};
|
|
96
83
|
export declare function isClaudeSonnet55Model(model: unknown): boolean;
|
|
97
84
|
export declare const CLAUDE_HAIKU_5_5_MODEL_ID = "claude-haiku-5-5";
|
|
98
|
-
export declare const CLAUDE_HAIKU_5_5_RELEASE_DATE
|
|
99
|
-
export declare const CLAUDE_HAIKU_5_5_CONTEXT_WINDOW
|
|
100
|
-
export declare const CLAUDE_HAIKU_5_5_MAX_OUTPUT_TOKENS
|
|
101
|
-
export declare const CLAUDE_HAIKU_5_5_LONG_CONTEXT_THRESHOLD
|
|
102
|
-
export declare const CLAUDE_HAIKU_5_5_PRICING:
|
|
103
|
-
readonly input: 0.1;
|
|
104
|
-
readonly output: 0.5;
|
|
105
|
-
readonly cacheRead: 0.01;
|
|
106
|
-
readonly cacheWrite5m: 0.125;
|
|
107
|
-
readonly cacheWrite1h: 0.2;
|
|
108
|
-
};
|
|
85
|
+
export declare const CLAUDE_HAIKU_5_5_RELEASE_DATE: string;
|
|
86
|
+
export declare const CLAUDE_HAIKU_5_5_CONTEXT_WINDOW: number;
|
|
87
|
+
export declare const CLAUDE_HAIKU_5_5_MAX_OUTPUT_TOKENS: number;
|
|
88
|
+
export declare const CLAUDE_HAIKU_5_5_LONG_CONTEXT_THRESHOLD: number;
|
|
89
|
+
export declare const CLAUDE_HAIKU_5_5_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
|
|
109
90
|
/** Haiku 5.5's higher rates apply to every token in requests with more than 100K input tokens, including cached input. */
|
|
110
|
-
export declare const CLAUDE_HAIKU_5_5_LONG_CONTEXT_PRICING:
|
|
111
|
-
readonly input: 0.5;
|
|
112
|
-
readonly output: 2.5;
|
|
113
|
-
readonly cacheRead: 0.05;
|
|
114
|
-
readonly cacheWrite5m: 0.625;
|
|
115
|
-
readonly cacheWrite1h: 1;
|
|
116
|
-
};
|
|
91
|
+
export declare const CLAUDE_HAIKU_5_5_LONG_CONTEXT_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
|
|
117
92
|
export declare const CLAUDE_HAIKU_5_5_ADAPTIVE_THINKING: {
|
|
118
93
|
readonly type: 'adaptive';
|
|
119
94
|
readonly display: 'summarized';
|
|
@@ -134,16 +109,10 @@ export declare const CLAUDE_OPUS_5_ADAPTIVE_THINKING: {
|
|
|
134
109
|
};
|
|
135
110
|
export declare function isClaudeOpus5Model(model: unknown): boolean;
|
|
136
111
|
export declare const CLAUDE_OPUS_5_5_MODEL_ID = "claude-opus-5-5";
|
|
137
|
-
export declare const CLAUDE_OPUS_5_5_RELEASE_DATE
|
|
138
|
-
export declare const CLAUDE_OPUS_5_5_CONTEXT_WINDOW
|
|
139
|
-
export declare const CLAUDE_OPUS_5_5_MAX_OUTPUT_TOKENS
|
|
140
|
-
export declare const CLAUDE_OPUS_5_5_PRICING:
|
|
141
|
-
readonly input: 4;
|
|
142
|
-
readonly output: 20;
|
|
143
|
-
readonly cacheRead: 0.2;
|
|
144
|
-
readonly cacheWrite5m: 5;
|
|
145
|
-
readonly cacheWrite1h: 8;
|
|
146
|
-
};
|
|
112
|
+
export declare const CLAUDE_OPUS_5_5_RELEASE_DATE: string;
|
|
113
|
+
export declare const CLAUDE_OPUS_5_5_CONTEXT_WINDOW: number;
|
|
114
|
+
export declare const CLAUDE_OPUS_5_5_MAX_OUTPUT_TOKENS: number;
|
|
115
|
+
export declare const CLAUDE_OPUS_5_5_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
|
|
147
116
|
export declare const CLAUDE_OPUS_5_5_ADAPTIVE_THINKING: {
|
|
148
117
|
readonly type: 'adaptive';
|
|
149
118
|
readonly display: 'summarized';
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { enrollmentAuthority, readClaustrumEnrollmentStatus } from "./internal-types/claustrum/index.js";
|
|
2
|
+
import { NativeCustodyError } from './native-custody.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Shown instead of `Native custody refused: invalid-token` when the
|
|
5
|
+
* enrollment files could not be read because the private-files backend did
|
|
6
|
+
* not load. Older common-auth passes on the backend's
|
|
7
|
+
* `unsupported-filesystem`, which is what every private-file check returns on
|
|
8
|
+
* Windows when the @cortexkit/private-files native addon did not load; newer
|
|
9
|
+
* common-auth refuses with `ERR_PRIVATE_FILES_UNAVAILABLE`. Either way the
|
|
10
|
+
* enrollment itself may be fine.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PRIVATE_FILES_UNAVAILABLE_MESSAGE = "Private file support didn't load on this machine (@cortexkit/private-files). Reinstall the plugin; if this persists, report it with your OS and Node version.";
|
|
13
|
+
/**
|
|
14
|
+
* The enrollment refusal for a private-files backend that did not load. It
|
|
15
|
+
* keeps the `invalid-token` code, so every caller that branches on the code
|
|
16
|
+
* treats it exactly as before; only the message names the cause and remedy.
|
|
17
|
+
*/
|
|
18
|
+
export declare class NativePrivateFilesUnavailableError extends NativeCustodyError {
|
|
19
|
+
constructor();
|
|
20
|
+
}
|
|
2
21
|
/** Enrollment files, not account settings, choose the host's credential source. */
|
|
3
22
|
export declare function readNativeEnrollmentMode(host: 'opencode' | 'pi', env?: NodeJS.ProcessEnv, dependencies?: {
|
|
4
23
|
enrollmentAuthority: typeof enrollmentAuthority;
|
package/dist/native-ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommandInvocation, type CommandMenu } from "./internal-types/commands/index.js";
|
|
1
|
+
import { type CommandApplyResult, type CommandInvocation, type CommandMenu } from "./internal-types/commands/index.js";
|
|
2
2
|
export type { CommandApplyRequest, CommandApplyResult, CommandDialogPayload, CommandInvocation, CommandMenu, CommandMenuModel, KnobValue, KnobValues, MenuAction, MenuItem, MenuKnob, MenuSection, NotifyKind, SectionSlot, } from "./internal-types/commands/index.js";
|
|
3
3
|
export { parseApplyRequest, runPiCommandMenu, } from "./internal-types/commands/index.js";
|
|
4
4
|
import { type NativeMenuDispatch, type NativeVaultDisconnect } from './native-menu-executor.ts';
|
|
@@ -36,6 +36,15 @@ export interface NativeUiOptions {
|
|
|
36
36
|
/** The host sets this flag; RPC callers cannot declare themselves interactive. */
|
|
37
37
|
readonly interactive: boolean;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* A menu result as Core returns it. After a successful OAuth start,
|
|
41
|
+
* `authorizationUrl` carries the one checked sign-in link from `text` as its
|
|
42
|
+
* own field, so a host can show it in a dialog of its own instead of finding
|
|
43
|
+
* it in the message text. Every other result leaves it out.
|
|
44
|
+
*/
|
|
45
|
+
export type NativeCommandApplyResult = CommandApplyResult & {
|
|
46
|
+
readonly authorizationUrl?: string;
|
|
47
|
+
};
|
|
39
48
|
/**
|
|
40
49
|
* Builds the Claude menu from the supported commands for OpenCode or Pi.
|
|
41
50
|
* Shared renderers display it, but each submitted action still goes through
|
package/dist/pool-authority.d.ts
CHANGED
|
@@ -142,6 +142,16 @@ export declare function readNativeMigrationJournal(paths: NativePoolPaths, owner
|
|
|
142
142
|
* that admits requests from the journal uses this one predicate.
|
|
143
143
|
*/
|
|
144
144
|
export declare function nativeMigrationAuthorityPhase(journal: NativeMigrationJournal | undefined): 'committed' | 'retired' | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Whether a finished legacy import may be replaced by a fresh import of a
|
|
147
|
+
* later OpenCode login. A first OpenCode 1 setup with no login finishes a
|
|
148
|
+
* legacy import of nothing instead of recording empty-init (only OpenCode 2
|
|
149
|
+
* setup records empty-init). Such a journal stands in for empty-init only when
|
|
150
|
+
* it is retired with no requested or completed vault switch; callers must still
|
|
151
|
+
* prove the pool holds no account data, so a pool with accounts is never
|
|
152
|
+
* re-imported.
|
|
153
|
+
*/
|
|
154
|
+
export declare function nativeJournalMayAdoptLaterHostLogin(journal: NativeMigrationJournal | undefined, host: 'opencode' | 'pi'): journal is NativeLegacyMigrationJournal;
|
|
145
155
|
/** An empty or readable store is not proof that the offline authority flip completed. */
|
|
146
156
|
export declare function requireNativePoolAuthority(paths: NativePoolPaths): Promise<NativeMigrationJournal>;
|
|
147
157
|
interface JournalHooks {
|
|
@@ -154,7 +164,12 @@ interface JournalHooks {
|
|
|
154
164
|
onWriteStep?: (step: 'before-write' | 'after-write', journal: NativeMigrationJournal) => Promise<void>;
|
|
155
165
|
}
|
|
156
166
|
/** Migration resume retains the original digests and resolved paths so a retry cannot adopt changed inputs or redirect writes. */
|
|
157
|
-
export declare function beginNativeMigration(paths: NativePoolPaths, input: NativeMigrationInput, hooks?: JournalHooks
|
|
167
|
+
export declare function beginNativeMigration(paths: NativePoolPaths, input: NativeMigrationInput, hooks?: JournalHooks,
|
|
168
|
+
/**
|
|
169
|
+
* The retired journal a fresh v5 import replaces, as read by the caller.
|
|
170
|
+
* The write refuses unless the journal on disk still equals it exactly.
|
|
171
|
+
*/
|
|
172
|
+
replaces?: NativeLegacyMigrationJournal): Promise<NativeLegacyMigrationJournal>;
|
|
158
173
|
/** Save the expected host-auth entry and routing digests together before changing files, so recovery can recognize completed writes. */
|
|
159
174
|
export declare function recordNativeMigrationExpectations(paths: NativePoolPaths, expectations: NativeMigrationExpectations, hooks?: JournalHooks): Promise<NativeLegacyMigrationJournal>;
|
|
160
175
|
/**
|
package/dist/turn-end-note.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { TURN_END_NOTE_BETA } from './model-capabilities.ts';
|
|
2
|
+
export { TURN_END_NOTE_BETA };
|
|
2
3
|
export declare const TURN_END_NOTE_MIN_VISIBLE_CHARACTERS = 350;
|
|
3
4
|
export declare const TURN_END_NOTE_CONTENT = "Your reply above has already reached the user. The tool call after it was housekeeping and changed nothing they need to know. Do not repeat, summarize or rewrite that reply. If no new work remains, end the turn without restating anything.";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
* message (`clear_at: "next_user_message"`), which needs the
|
|
6
|
+
* Models that get turn-end notes (capability `turnEndNote`). The note is a
|
|
7
|
+
* turn-scoped system message (`clear_at: "next_user_message"`), which needs the
|
|
7
8
|
* mid-conversation-system-clear-at beta that Claude Code sends for these models.
|
|
8
9
|
*/
|
|
9
10
|
export declare function supportsTurnEndNote(model: unknown): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/anthropic-auth-core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"prepublishOnly": "bun run build"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@cortexkit/common-auth": "0.
|
|
33
|
+
"@cortexkit/common-auth": "0.24.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@cortexkit/claustrum-client": "0.12.0",
|