@sentropic/llm-mesh 0.25.0 → 0.26.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.
- package/README.md +14 -0
- package/dist/catalog.d.ts +92 -0
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +47 -0
- package/dist/catalog.js.map +1 -1
- package/dist/enrollment/codex.d.ts +7 -0
- package/dist/enrollment/codex.d.ts.map +1 -1
- package/dist/enrollment/codex.js +74 -19
- package/dist/enrollment/codex.js.map +1 -1
- package/dist/enrollment/seat-bundle.d.ts +104 -0
- package/dist/enrollment/seat-bundle.d.ts.map +1 -0
- package/dist/enrollment/seat-bundle.js +304 -0
- package/dist/enrollment/seat-bundle.js.map +1 -0
- package/dist/errors.d.ts +19 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +51 -4
- package/dist/errors.js.map +1 -1
- package/dist/execution-features.d.ts +34 -0
- package/dist/execution-features.d.ts.map +1 -0
- package/dist/execution-features.js +84 -0
- package/dist/execution-features.js.map +1 -0
- package/dist/generated-model-council.d.ts +2 -2
- package/dist/generated-model-council.d.ts.map +1 -1
- package/dist/generated-model-council.js +5 -1
- package/dist/generated-model-council.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/native-messages.d.ts +130 -0
- package/dist/native-messages.d.ts.map +1 -0
- package/dist/native-messages.js +66 -0
- package/dist/native-messages.js.map +1 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/providers.d.ts +5 -5
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +12 -5
- package/dist/providers.js.map +1 -1
- package/dist/responses-wire.d.ts +76 -0
- package/dist/responses-wire.d.ts.map +1 -0
- package/dist/responses-wire.js +35 -0
- package/dist/responses-wire.js.map +1 -0
- package/dist/route-attempt.d.ts +4 -0
- package/dist/route-attempt.d.ts.map +1 -1
- package/dist/route-attempt.js +8 -1
- package/dist/route-attempt.js.map +1 -1
- package/dist/route-health.d.ts +11 -0
- package/dist/route-health.d.ts.map +1 -1
- package/dist/route-health.js +32 -0
- package/dist/route-health.js.map +1 -1
- package/dist/route-planner-state.d.ts +33 -2
- package/dist/route-planner-state.d.ts.map +1 -1
- package/dist/route-planner-state.js +20 -1
- package/dist/route-planner-state.js.map +1 -1
- package/dist/route-planner.d.ts +21 -1
- package/dist/route-planner.d.ts.map +1 -1
- package/dist/route-planner.js +112 -33
- package/dist/route-planner.js.map +1 -1
- package/dist/route-quote.d.ts +16 -2
- package/dist/route-quote.d.ts.map +1 -1
- package/dist/route-quote.js +31 -5
- package/dist/route-quote.js.map +1 -1
- package/dist/route-selection.d.ts +13 -0
- package/dist/route-selection.d.ts.map +1 -1
- package/dist/route-selection.js +30 -5
- package/dist/route-selection.js.map +1 -1
- package/dist/routing-contracts.d.ts +42 -3
- package/dist/routing-contracts.d.ts.map +1 -1
- package/dist/routing-targets.d.ts +26 -0
- package/dist/routing-targets.d.ts.map +1 -1
- package/dist/routing-targets.js +96 -23
- package/dist/routing-targets.js.map +1 -1
- package/dist/service/local-account-transport-service.d.ts +9 -0
- package/dist/service/local-account-transport-service.d.ts.map +1 -1
- package/dist/service/local-account-transport-service.js +56 -9
- package/dist/service/local-account-transport-service.js.map +1 -1
- package/dist/transport/codex-runtime-client.d.ts.map +1 -1
- package/dist/transport/codex-runtime-client.js +24 -4
- package/dist/transport/codex-runtime-client.js.map +1 -1
- package/dist/transport/codex-runtime-wire.d.ts.map +1 -1
- package/dist/transport/codex-runtime-wire.js +131 -27
- package/dist/transport/codex-runtime-wire.js.map +1 -1
- package/dist/transport/mistral-runtime-client.d.ts.map +1 -1
- package/dist/transport/mistral-runtime-client.js +191 -9
- package/dist/transport/mistral-runtime-client.js.map +1 -1
- package/dist/transport/muse-runtime-client.d.ts.map +1 -1
- package/dist/transport/muse-runtime-client.js +221 -10
- package/dist/transport/muse-runtime-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by make refresh-llm-model-equivalences. Do not edit.
|
|
2
2
|
export const GENERATED_MODEL_COUNCIL_SOURCE = {
|
|
3
3
|
revision: "2026-10-07.1",
|
|
4
|
-
digest: "sha256:
|
|
4
|
+
digest: "sha256:7b77e4f444f9ee6cfaf69ac320a6ac264b24bc527a518e9d2e795acdccc6814a",
|
|
5
5
|
expiresAt: "2027-03-03T00:00:00.000Z",
|
|
6
6
|
reason: "No pinned benchmark evidence authorizes automatic substitution.",
|
|
7
7
|
reviewer: "GPT-6.1 Sol catalog owner directive",
|
|
@@ -22,12 +22,16 @@ export const GENERATED_MODEL_COUNCIL_SOURCE = {
|
|
|
22
22
|
"gemini:gemini-3.5-flash",
|
|
23
23
|
"gemini:gemini-3.7-flash",
|
|
24
24
|
"gemini:gemini-3.8-flash",
|
|
25
|
+
"gemini:gemini-4-argon",
|
|
25
26
|
"mistral:magistral-medium-2509",
|
|
26
27
|
"mistral:mistral-large-4",
|
|
28
|
+
"mistral:mistral-medium-3.5",
|
|
27
29
|
"mistral:mistral-small-2603",
|
|
28
30
|
"mistral:zai-glm-5-3",
|
|
29
31
|
"muse:muse-spark-1.3",
|
|
30
32
|
"muse:muse-spark-1.3-contributor",
|
|
33
|
+
"muse:muse-wonder-1.0",
|
|
34
|
+
"muse:muse-wonder-full-1.0",
|
|
31
35
|
"openai:gpt-4.1-nano",
|
|
32
36
|
"openai:gpt-5.4-nano",
|
|
33
37
|
"openai:gpt-5.5",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-model-council.js","sourceRoot":"","sources":["../src/generated-model-council.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,yEAAyE;IACjF,SAAS,EAAE,0BAA0B;IACrC,MAAM,EAAE,iEAAiE;IACzE,QAAQ,EAAE,qCAAqC;IAC/C,UAAU,EAAE,uGAAuG;IACnH,iBAAiB,EAAE;QACjB,0BAA0B;QAC1B,4BAA4B;QAC5B,2BAA2B;QAC3B,yBAAyB;QACzB,2BAA2B;QAC3B,0BAA0B;QAC1B,oCAAoC;QACpC,mCAAmC;QACnC,qCAAqC;QACrC,sCAAsC;QACtC,iCAAiC;QACjC,8BAA8B;QAC9B,yBAAyB;QACzB,yBAAyB;QACzB,yBAAyB;QACzB,+BAA+B;QAC/B,yBAAyB;QACzB,4BAA4B;QAC5B,qBAAqB;QACrB,qBAAqB;QACrB,iCAAiC;QACjC,qBAAqB;QACrB,qBAAqB;QACrB,gBAAgB;QAChB,qBAAqB;QACrB,oBAAoB;QACpB,sBAAsB;QACtB,oBAAoB;QACpB,mBAAmB;QACnB,kBAAkB;QAClB,oBAAoB;KACrB;CACO,CAAC"}
|
|
1
|
+
{"version":3,"file":"generated-model-council.js","sourceRoot":"","sources":["../src/generated-model-council.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,yEAAyE;IACjF,SAAS,EAAE,0BAA0B;IACrC,MAAM,EAAE,iEAAiE;IACzE,QAAQ,EAAE,qCAAqC;IAC/C,UAAU,EAAE,uGAAuG;IACnH,iBAAiB,EAAE;QACjB,0BAA0B;QAC1B,4BAA4B;QAC5B,2BAA2B;QAC3B,yBAAyB;QACzB,2BAA2B;QAC3B,0BAA0B;QAC1B,oCAAoC;QACpC,mCAAmC;QACnC,qCAAqC;QACrC,sCAAsC;QACtC,iCAAiC;QACjC,8BAA8B;QAC9B,yBAAyB;QACzB,yBAAyB;QACzB,yBAAyB;QACzB,uBAAuB;QACvB,+BAA+B;QAC/B,yBAAyB;QACzB,4BAA4B;QAC5B,4BAA4B;QAC5B,qBAAqB;QACrB,qBAAqB;QACrB,iCAAiC;QACjC,sBAAsB;QACtB,2BAA2B;QAC3B,qBAAqB;QACrB,qBAAqB;QACrB,gBAAgB;QAChB,qBAAqB;QACrB,oBAAoB;QACpB,sBAAsB;QACtB,oBAAoB;QACpB,mBAAmB;QACnB,kBAAkB;QAClB,oBAAoB;KACrB;CACO,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,11 +5,14 @@ export * from './capabilities.js';
|
|
|
5
5
|
export * from './catalog.js';
|
|
6
6
|
export * from './errors.js';
|
|
7
7
|
export * from './equivalence-council.js';
|
|
8
|
+
export * from './execution-features.js';
|
|
8
9
|
export * from './generation.js';
|
|
9
10
|
export * from './messages.js';
|
|
11
|
+
export * from './native-messages.js';
|
|
10
12
|
export * from './mesh.js';
|
|
11
13
|
export * from './providers.js';
|
|
12
14
|
export * from './registry.js';
|
|
15
|
+
export * from './responses-wire.js';
|
|
13
16
|
export * from './routing-targets.js';
|
|
14
17
|
export * from './routing-policy.js';
|
|
15
18
|
export * from './routing-contracts.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,EAA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C;AAC1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,14 @@ export * from './capabilities.js';
|
|
|
5
5
|
export * from './catalog.js';
|
|
6
6
|
export * from './errors.js';
|
|
7
7
|
export * from './equivalence-council.js';
|
|
8
|
+
export * from './execution-features.js';
|
|
8
9
|
export * from './generation.js';
|
|
9
10
|
export * from './messages.js';
|
|
11
|
+
export * from './native-messages.js';
|
|
10
12
|
export * from './mesh.js';
|
|
11
13
|
export * from './providers.js';
|
|
12
14
|
export * from './registry.js';
|
|
15
|
+
export * from './responses-wire.js';
|
|
13
16
|
export * from './routing-targets.js';
|
|
14
17
|
export * from './routing-policy.js';
|
|
15
18
|
export * from './routing-contracts.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,YAA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ptUsage } from './routing-contracts.js';
|
|
2
|
+
import { type RequestSizeDetail } from './errors.js';
|
|
3
|
+
export type NativeInputUsageSource = 'json' | 'message_start' | 'message_delta';
|
|
4
|
+
export type NativeUsageUncertainty = 'incomplete_input' | 'invalid_input' | 'cache_write_split_unknown' | 'served_model_unverified' | 'served_model_mismatch' | 'input_breakdown_changed' | 'incomplete_output' | 'invalid_output' | 'missing_usage';
|
|
5
|
+
export type NativeCacheWriteSplitReason = 'cache_write_split_inferred';
|
|
6
|
+
export type NativePricingPolicy = 'anthropic-cache-2026-10-02';
|
|
7
|
+
export type NativeUsageTermination = 'completed' | 'cancelled' | 'upstream_error' | 'commit_failed' | 'missing_message_stop' | 'frame_overflow' | 'timeout' | 'reader_error' | 'protocol_error';
|
|
8
|
+
/** Trusted observer evidence, never populated from caller body/header fields. */
|
|
9
|
+
export interface NativeUsagePricing {
|
|
10
|
+
readonly nativeInputPriceUnits40?: number;
|
|
11
|
+
readonly nativePricingPolicy?: NativePricingPolicy;
|
|
12
|
+
readonly nativeServedModelId?: string;
|
|
13
|
+
readonly nativeInputUsageValidated?: boolean;
|
|
14
|
+
readonly nativeInputUsageSource?: NativeInputUsageSource;
|
|
15
|
+
readonly nativeUsageUncertainty?: NativeUsageUncertainty;
|
|
16
|
+
/** Inferred growth allocation alone does not make a valid clean turn estimated. */
|
|
17
|
+
readonly nativeCacheWriteSplitReason?: NativeCacheWriteSplitReason;
|
|
18
|
+
}
|
|
19
|
+
/** Safe provider-reported categories only; inferred TTL allocation is never raw. */
|
|
20
|
+
export interface NativeUsageRaw {
|
|
21
|
+
readonly input_tokens?: number;
|
|
22
|
+
readonly cache_read_input_tokens?: number;
|
|
23
|
+
readonly cache_creation_input_tokens?: number;
|
|
24
|
+
readonly cache_creation?: {
|
|
25
|
+
readonly ephemeral_5m_input_tokens?: number;
|
|
26
|
+
readonly ephemeral_1h_input_tokens?: number;
|
|
27
|
+
};
|
|
28
|
+
readonly output_tokens?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* One immutable pre-financial-floor snapshot, shared by settlement and observation.
|
|
32
|
+
* Counts are physical and optional: missing evidence never becomes zero/allowance.
|
|
33
|
+
* The gateway freezes the snapshot and nested raw categories at terminal ownership.
|
|
34
|
+
* Malformed/decreasing/conflicting input permanently loses its pricing proof (N5).
|
|
35
|
+
*/
|
|
36
|
+
export interface NativeUsageSnapshot extends NativeUsagePricing {
|
|
37
|
+
readonly inputTokens?: number;
|
|
38
|
+
readonly outputTokens?: number;
|
|
39
|
+
readonly totalTokens?: number;
|
|
40
|
+
readonly rawUsage?: NativeUsageRaw;
|
|
41
|
+
readonly estimated: boolean;
|
|
42
|
+
readonly finalOutputObserved: boolean;
|
|
43
|
+
readonly termination: NativeUsageTermination;
|
|
44
|
+
readonly nativeSelectedModelId: string;
|
|
45
|
+
readonly fallbackPresent: boolean;
|
|
46
|
+
readonly iterationsPresent: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface NativeMessagesFeatureHeaders {
|
|
49
|
+
/** Resolved supported version before execute; never an unresolved caller hint. */
|
|
50
|
+
readonly anthropicVersion: string;
|
|
51
|
+
/** Sanitized end-to-end headers; caller beta values remain opaque. */
|
|
52
|
+
readonly forwarded: Readonly<Record<string, string>>;
|
|
53
|
+
}
|
|
54
|
+
export interface NativeMessagesRequest {
|
|
55
|
+
readonly body: Readonly<Record<string, unknown>>;
|
|
56
|
+
readonly stream: boolean;
|
|
57
|
+
readonly headers: NativeMessagesFeatureHeaders;
|
|
58
|
+
readonly signal: AbortSignal;
|
|
59
|
+
/** Server gateway request ID, distinct from the cost correlation ID. */
|
|
60
|
+
readonly requestId: string;
|
|
61
|
+
/** Bound to the prepared host hook; only the gateway invokes it, once per attempt. */
|
|
62
|
+
readonly finalize?: (snapshot: NativeUsageSnapshot) => void | Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
/** Credential-free advertisement; executable closures remain in the trusted host. */
|
|
65
|
+
export interface NativeMessagesAdvertisement {
|
|
66
|
+
readonly contractVersion: 1;
|
|
67
|
+
readonly protocol: 'anthropic-messages';
|
|
68
|
+
}
|
|
69
|
+
export interface PreparedNativeMessages extends NativeMessagesAdvertisement {
|
|
70
|
+
readonly modelId: string;
|
|
71
|
+
readonly apiVersions: readonly string[];
|
|
72
|
+
readonly requiredBetas: readonly string[];
|
|
73
|
+
/** Trusted, body-free observation hook; settlement/cleanup never await this hook. */
|
|
74
|
+
readonly finalize?: (snapshot: NativeUsageSnapshot) => void | Promise<void>;
|
|
75
|
+
/** Complete/cancel upload and detach request references before exposing a result. */
|
|
76
|
+
execute(request: NativeMessagesRequest): Promise<NativeMessagesResult>;
|
|
77
|
+
}
|
|
78
|
+
export type NativeMessagesResult = ({
|
|
79
|
+
readonly kind: 'json';
|
|
80
|
+
readonly status: 200;
|
|
81
|
+
readonly body: Readonly<Record<string, unknown>>;
|
|
82
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
83
|
+
} | {
|
|
84
|
+
readonly kind: 'stream';
|
|
85
|
+
readonly status: 200;
|
|
86
|
+
readonly body: AsyncIterable<Uint8Array>;
|
|
87
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
88
|
+
}) & {
|
|
89
|
+
/** Host-measured outgoing bytes, retained for numeric pre/late SSE 413 errors. */
|
|
90
|
+
readonly requestSize?: RequestSizeDetail;
|
|
91
|
+
};
|
|
92
|
+
/** Empty until real qualification; trusted hosts may supply a code-only override. */
|
|
93
|
+
export declare const NATIVE_ANTHROPIC_MESSAGES_MODEL_IDS: readonly string[];
|
|
94
|
+
export declare const validateNativeModelAllowlist: (modelIds: readonly string[]) => readonly string[];
|
|
95
|
+
/** Pure provider/model identity check; account advertisement is a separate gate. */
|
|
96
|
+
export declare const isNativeMessagesTarget: (target: {
|
|
97
|
+
readonly providerId: string;
|
|
98
|
+
readonly modelId: string;
|
|
99
|
+
}, modelIds?: readonly string[]) => boolean;
|
|
100
|
+
export declare const isPreparedNativeMessages: (value: unknown) => value is PreparedNativeMessages;
|
|
101
|
+
/** Lot 2 required betas are empty: preserve the caller's parser-retained value exactly. */
|
|
102
|
+
export declare const composeAnthropicBeta: (callerValue: string | undefined, requiredBetas?: readonly string[]) => string | undefined;
|
|
103
|
+
export type NativeMessagesProviderErrorType = 'invalid_request_error' | 'authentication_error' | 'permission_error' | 'not_found_error' | 'request_too_large' | 'rate_limit_error' | 'api_error' | 'overloaded_error';
|
|
104
|
+
export type NativeMessagesTransportCode = 'timeout' | 'account_unavailable' | 'native_protocol_error';
|
|
105
|
+
export interface NativeValidationPublicDetail {
|
|
106
|
+
readonly type: string;
|
|
107
|
+
readonly message: string;
|
|
108
|
+
}
|
|
109
|
+
export interface NativeMessagesUpstreamErrorOptions {
|
|
110
|
+
readonly requestSize?: RequestSizeDetail;
|
|
111
|
+
readonly status: number;
|
|
112
|
+
readonly type?: NativeMessagesProviderErrorType;
|
|
113
|
+
readonly code?: NativeMessagesTransportCode;
|
|
114
|
+
readonly retryAfterMs?: number;
|
|
115
|
+
/** Operational evidence; dispatched pre-fetch zeros do not exempt billing. */
|
|
116
|
+
readonly usage?: RouteAttemptUsage;
|
|
117
|
+
readonly validation?: NativeValidationPublicDetail;
|
|
118
|
+
}
|
|
119
|
+
/** Never place upstream validation prose, payloads or credentials in this error. */
|
|
120
|
+
export declare class NativeMessagesUpstreamError extends Error {
|
|
121
|
+
readonly requestSize?: RequestSizeDetail;
|
|
122
|
+
readonly status: number;
|
|
123
|
+
readonly type?: NativeMessagesProviderErrorType;
|
|
124
|
+
readonly code?: NativeMessagesTransportCode;
|
|
125
|
+
readonly retryAfterMs?: number;
|
|
126
|
+
readonly usage?: RouteAttemptUsage;
|
|
127
|
+
readonly validation?: NativeValidationPublicDetail;
|
|
128
|
+
constructor(options: NativeMessagesUpstreamErrorOptions);
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=native-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-messages.d.ts","sourceRoot":"","sources":["../src/native-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CAAC,EAAE,2BAA2B,CAAC;IAC5C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,4BAA4B,CAAC;CACpD;AAED,oFAAoF;AACpF,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,+BAA+B,CAAC;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,2BAA2B,CAAC;IAC5C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,4BAA4B,CAAC;gBAEvC,OAAO,EAAE,kCAAkC;CAWxD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { readRequestSizeDetail } from './errors.js';
|
|
2
|
+
import { modelProfiles } from './catalog.js';
|
|
3
|
+
import { LAUNCH_ALIAS_ROUTE_MAPPINGS } from './routing-targets.js';
|
|
4
|
+
/** Empty until real qualification; trusted hosts may supply a code-only override. */
|
|
5
|
+
export const NATIVE_ANTHROPIC_MESSAGES_MODEL_IDS = Object.freeze([]);
|
|
6
|
+
const isExactAnthropicCatalogModel = (modelId) => modelProfiles.some((profile) => profile.providerId === 'anthropic' && profile.modelId === modelId);
|
|
7
|
+
export const validateNativeModelAllowlist = (modelIds) => {
|
|
8
|
+
for (const modelId of modelIds) {
|
|
9
|
+
// W port of R's exclusive-alias rejection: R keyed its single-target
|
|
10
|
+
// `EXCLUSIVE_LAUNCH_ALIAS_TARGET_MAPPINGS`; W folds every launch alias
|
|
11
|
+
// into `LAUNCH_ALIAS_ROUTE_MAPPINGS`, so any alias key without its own
|
|
12
|
+
// exact Anthropic catalog entry is rejected. Bare ids that are exact
|
|
13
|
+
// catalog models (e.g. `claude-sonnet-5`) remain accepted.
|
|
14
|
+
if (!isExactAnthropicCatalogModel(modelId)
|
|
15
|
+
|| Object.hasOwn(LAUNCH_ALIAS_ROUTE_MAPPINGS, modelId) && !isExactAnthropicCatalogModel(modelId)) {
|
|
16
|
+
throw new Error('Native Messages allowlist requires exact non-exclusive Anthropic model IDs');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return Object.freeze([...modelIds]);
|
|
20
|
+
};
|
|
21
|
+
/** Pure provider/model identity check; account advertisement is a separate gate. */
|
|
22
|
+
export const isNativeMessagesTarget = (target, modelIds = NATIVE_ANTHROPIC_MESSAGES_MODEL_IDS) => target.providerId === 'anthropic' && modelIds.includes(target.modelId);
|
|
23
|
+
const isNonemptyString = (value) => typeof value === 'string' && value.trim().length > 0;
|
|
24
|
+
export const isPreparedNativeMessages = (value) => {
|
|
25
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
26
|
+
return false;
|
|
27
|
+
const capability = value;
|
|
28
|
+
return capability.contractVersion === 1
|
|
29
|
+
&& capability.protocol === 'anthropic-messages'
|
|
30
|
+
&& isNonemptyString(capability.modelId)
|
|
31
|
+
&& Array.isArray(capability.apiVersions) && capability.apiVersions.length > 0
|
|
32
|
+
&& [...capability.apiVersions].every(isNonemptyString)
|
|
33
|
+
&& Array.isArray(capability.requiredBetas)
|
|
34
|
+
&& [...capability.requiredBetas].every((beta) => typeof beta === 'string')
|
|
35
|
+
&& typeof capability.execute === 'function'
|
|
36
|
+
&& (capability.finalize === undefined || typeof capability.finalize === 'function');
|
|
37
|
+
};
|
|
38
|
+
/** Lot 2 required betas are empty: preserve the caller's parser-retained value exactly. */
|
|
39
|
+
export const composeAnthropicBeta = (callerValue, requiredBetas = []) => {
|
|
40
|
+
if (requiredBetas.length === 0)
|
|
41
|
+
return callerValue;
|
|
42
|
+
const required = requiredBetas.join(',');
|
|
43
|
+
return callerValue === undefined ? required : `${callerValue},${required}`;
|
|
44
|
+
};
|
|
45
|
+
/** Never place upstream validation prose, payloads or credentials in this error. */
|
|
46
|
+
export class NativeMessagesUpstreamError extends Error {
|
|
47
|
+
requestSize;
|
|
48
|
+
status;
|
|
49
|
+
type;
|
|
50
|
+
code;
|
|
51
|
+
retryAfterMs;
|
|
52
|
+
usage;
|
|
53
|
+
validation;
|
|
54
|
+
constructor(options) {
|
|
55
|
+
super('Native Anthropic Messages request failed');
|
|
56
|
+
this.name = 'NativeMessagesUpstreamError';
|
|
57
|
+
this.status = options.status;
|
|
58
|
+
this.type = options.type;
|
|
59
|
+
this.code = options.code;
|
|
60
|
+
this.retryAfterMs = options.retryAfterMs;
|
|
61
|
+
this.usage = options.usage;
|
|
62
|
+
this.validation = options.validation;
|
|
63
|
+
this.requestSize = readRequestSizeDetail(options.requestSize);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=native-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-messages.js","sourceRoot":"","sources":["../src/native-messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAA0B,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAsGnE,qFAAqF;AACrF,MAAM,CAAC,MAAM,mCAAmC,GAAsB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExF,MAAM,4BAA4B,GAAG,CAAC,OAAe,EAAW,EAAE,CAChE,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,KAAK,WAAW,IAAI,OAAO,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;AAErG,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,QAA2B,EACR,EAAE;IAC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AC;QACzB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,qBAAqB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAChE,CAAC;CACF"}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type { KeyringAdapter } from '../service/facade.js';
|
|
2
|
+
export type { SeatAccessProjection, SeatAuthority, SeatBundleIdentity, SeatBundleLifecycle, SeatBundleProvenance, SeatBundleV1, SeatCanonicalMaterial, SeatCli, SeatCredentialClass, SeatLineageTuple, SeatReceipt, SeatRefreshAuthority, SeatTransition, SeatValidationCode, SeatValidationContext, SeatValidationResult, } from '../enrollment/seat-bundle.js';
|
|
3
|
+
export { SEAT_AGY_APPLICATION_TUPLE, SEAT_BUNDLE_MAX_BYTES, SEAT_BUNDLE_SCHEMA_VERSION, SEAT_PACKAGE_PROVIDER_ID, classifyTransition, createReceipt, isIdempotentReimport, isStaleGeneration, resolveEffectiveAuthority, validateSeatBundle, } from '../enrollment/seat-bundle.js';
|
|
2
4
|
export { EncryptedFileKeyring } from './keyring/encrypted-file-keyring.js';
|
|
3
5
|
export { EnvKeyring } from './keyring/env-keyring.js';
|
|
4
6
|
export { InMemoryKeyring } from './keyring/in-memory-keyring.js';
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,OAAO,EACP,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC"}
|
package/dist/node/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { SEAT_AGY_APPLICATION_TUPLE, SEAT_BUNDLE_MAX_BYTES, SEAT_BUNDLE_SCHEMA_VERSION, SEAT_PACKAGE_PROVIDER_ID, classifyTransition, createReceipt, isIdempotentReimport, isStaleGeneration, resolveEffectiveAuthority, validateSeatBundle, } from '../enrollment/seat-bundle.js';
|
|
1
2
|
export { EncryptedFileKeyring } from './keyring/encrypted-file-keyring.js';
|
|
2
3
|
export { EnvKeyring } from './keyring/env-keyring.js';
|
|
3
4
|
export { InMemoryKeyring } from './keyring/in-memory-keyring.js';
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC"}
|
package/dist/providers.d.ts
CHANGED
|
@@ -4,19 +4,19 @@ export type ProviderStatus = 'ready' | 'planned';
|
|
|
4
4
|
export type ProviderFamily = 'openai' | 'google' | 'anthropic' | 'mistral' | 'cohere' | 'meta';
|
|
5
5
|
export type ReasoningTier = 'none' | 'light' | 'standard' | 'advanced';
|
|
6
6
|
export type ModelTaskHint = 'chat' | 'structured' | 'summary' | 'doc';
|
|
7
|
-
export declare const knownModelIds: readonly ["gpt-5.6-sol", "gpt-6-sol", "gpt-6.1-sol", "gpt-6-astra", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-luna", "gpt-5.5", "gpt-5.4-nano", "gpt-4.1-nano", "gemini-3.7-flash", "gemini-3.8-flash", "gemini-3.5-flash", "gemini-3.1-flash-lite", "claude-sonnet-5", "claude-opus-5", "claude-opus-4-8", "claude-fable-5", "claude-fable-5-1", "mistral-small-2603", "magistral-medium-2509", "mistral-large-4", "zai-glm-5-3", "command-a-03-2025", "command-a-reasoning-08-2025", "google/gemini-3.5-flash@gcp", "google/gemini-3.1-flash-lite@gcp", "anthropic/claude-sonnet-4-6@gcp", "anthropic/claude-opus-4-6@gcp", "laneformer-2b-it", "muse-spark-1.3", "muse-spark-1.3-contributor"];
|
|
7
|
+
export declare const knownModelIds: readonly ["gpt-5.6-sol", "gpt-6-sol", "gpt-6.1-sol", "gpt-6-astra", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-luna", "gpt-5.5", "gpt-5.4-nano", "gpt-4.1-nano", "gemini-3.7-flash", "gemini-3.8-flash", "gemini-4-argon", "gemini-3.5-flash", "gemini-3.1-flash-lite", "claude-sonnet-5", "claude-opus-5", "claude-opus-4-8", "claude-fable-5", "claude-fable-5-1", "mistral-small-2603", "magistral-medium-2509", "mistral-large-4", "mistral-medium-3.5", "zai-glm-5-3", "command-a-03-2025", "command-a-reasoning-08-2025", "google/gemini-3.5-flash@gcp", "google/gemini-3.1-flash-lite@gcp", "anthropic/claude-sonnet-4-6@gcp", "anthropic/claude-opus-4-6@gcp", "laneformer-2b-it", "muse-spark-1.3", "muse-spark-1.3-contributor", "muse-wonder-1.0", "muse-wonder-full-1.0"];
|
|
8
8
|
export type KnownModelId = (typeof knownModelIds)[number];
|
|
9
9
|
export type ModelId = KnownModelId | (string & {});
|
|
10
10
|
export type QualifiedModelId = `${ProviderId}:${string}`;
|
|
11
11
|
export declare const knownModelIdsByProvider: {
|
|
12
12
|
readonly openai: readonly ["gpt-5.6-sol", "gpt-6-sol", "gpt-6.1-sol", "gpt-6-astra", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-luna", "gpt-5.5", "gpt-5.4-nano", "gpt-4.1-nano"];
|
|
13
|
-
readonly gemini: readonly ["gemini-3.7-flash", "gemini-3.8-flash", "gemini-3.5-flash", "gemini-3.1-flash-lite"];
|
|
13
|
+
readonly gemini: readonly ["gemini-3.7-flash", "gemini-3.8-flash", "gemini-4-argon", "gemini-3.5-flash", "gemini-3.1-flash-lite"];
|
|
14
14
|
readonly anthropic: readonly ["claude-sonnet-5", "claude-opus-5", "claude-opus-4-8", "claude-fable-5", "claude-fable-5-1"];
|
|
15
|
-
readonly mistral: readonly ["mistral-small-2603", "magistral-medium-2509", "mistral-large-4", "zai-glm-5-3"];
|
|
15
|
+
readonly mistral: readonly ["mistral-small-2603", "magistral-medium-2509", "mistral-large-4", "mistral-medium-3.5", "zai-glm-5-3"];
|
|
16
16
|
readonly cohere: readonly ["command-a-03-2025", "command-a-reasoning-08-2025"];
|
|
17
17
|
readonly gcp: readonly ["google/gemini-3.5-flash@gcp", "google/gemini-3.1-flash-lite@gcp", "anthropic/claude-sonnet-4-6@gcp", "anthropic/claude-opus-4-6@gcp"];
|
|
18
18
|
readonly local: readonly ["laneformer-2b-it"];
|
|
19
|
-
readonly muse: readonly ["muse-spark-1.3", "muse-spark-1.3-contributor"];
|
|
19
|
+
readonly muse: readonly ["muse-spark-1.3", "muse-spark-1.3-contributor", "muse-wonder-1.0", "muse-wonder-full-1.0"];
|
|
20
20
|
};
|
|
21
21
|
export interface ModelReference {
|
|
22
22
|
providerId: ProviderId;
|
|
@@ -26,5 +26,5 @@ export declare const toQualifiedModelId: (model: ModelReference) => QualifiedMod
|
|
|
26
26
|
export declare const antigravityModelFleet: readonly ["claude-sonnet-4-6", "claude-opus-4-6-thinking", "gemini-3-pro-high", "gemini-3-pro-low", "gpt-oss-120b-medium"];
|
|
27
27
|
export type AntigravityFleetModelId = (typeof antigravityModelFleet)[number];
|
|
28
28
|
export declare const isProviderId: (value: string) => value is "openai" | "gemini" | "anthropic" | "mistral" | "cohere" | "gcp" | "local" | "muse";
|
|
29
|
-
export declare const isKnownModelId: (value: string) => value is "gpt-5.6-sol" | "gpt-6-sol" | "gpt-6.1-sol" | "gpt-6-astra" | "gpt-5.6-terra" | "gpt-5.6-luna" | "gpt-6-luna" | "gpt-5.5" | "gpt-5.4-nano" | "gpt-4.1-nano" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-3.5-flash" | "gemini-3.1-flash-lite" | "claude-sonnet-5" | "claude-opus-5" | "claude-opus-4-8" | "claude-fable-5" | "claude-fable-5-1" | "mistral-small-2603" | "magistral-medium-2509" | "mistral-large-4" | "zai-glm-5-3" | "command-a-03-2025" | "command-a-reasoning-08-2025" | "google/gemini-3.5-flash@gcp" | "google/gemini-3.1-flash-lite@gcp" | "anthropic/claude-sonnet-4-6@gcp" | "anthropic/claude-opus-4-6@gcp" | "laneformer-2b-it" | "muse-spark-1.3" | "muse-spark-1.3-contributor";
|
|
29
|
+
export declare const isKnownModelId: (value: string) => value is "gpt-5.6-sol" | "gpt-6-sol" | "gpt-6.1-sol" | "gpt-6-astra" | "gpt-5.6-terra" | "gpt-5.6-luna" | "gpt-6-luna" | "gpt-5.5" | "gpt-5.4-nano" | "gpt-4.1-nano" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-4-argon" | "gemini-3.5-flash" | "gemini-3.1-flash-lite" | "claude-sonnet-5" | "claude-opus-5" | "claude-opus-4-8" | "claude-fable-5" | "claude-fable-5-1" | "mistral-small-2603" | "magistral-medium-2509" | "mistral-large-4" | "mistral-medium-3.5" | "zai-glm-5-3" | "command-a-03-2025" | "command-a-reasoning-08-2025" | "google/gemini-3.5-flash@gcp" | "google/gemini-3.1-flash-lite@gcp" | "anthropic/claude-sonnet-4-6@gcp" | "anthropic/claude-opus-4-6@gcp" | "laneformer-2b-it" | "muse-spark-1.3" | "muse-spark-1.3-contributor" | "muse-wonder-1.0" | "muse-wonder-full-1.0";
|
|
30
30
|
//# sourceMappingURL=providers.d.ts.map
|
package/dist/providers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings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,MAAM,EAAE,CAAC;AAEzD,eAAO,MAAM,uBAAuB;;;;;;;;;CAoB4B,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,kBAAkB,UAAW,cAAc,KAAG,gBAE1D,CAAC;AAUF,eAAO,MAAM,qBAAqB,4HAMxB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,eAAO,MAAM,YAAY,UAAW,MAAM,iGAEzC,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,MAAM,wxBAE3C,CAAC"}
|
package/dist/providers.js
CHANGED
|
@@ -12,6 +12,7 @@ export const knownModelIds = [
|
|
|
12
12
|
'gpt-4.1-nano',
|
|
13
13
|
'gemini-3.7-flash',
|
|
14
14
|
'gemini-3.8-flash',
|
|
15
|
+
'gemini-4-argon',
|
|
15
16
|
'gemini-3.5-flash',
|
|
16
17
|
'gemini-3.1-flash-lite',
|
|
17
18
|
'claude-sonnet-5',
|
|
@@ -25,6 +26,7 @@ export const knownModelIds = [
|
|
|
25
26
|
// active, natively multimodal, 1M context. Served on api.mistral.ai via the
|
|
26
27
|
// `mistral-vibe` account transport (plan-billed key) or MISTRAL_API_KEY.
|
|
27
28
|
'mistral-large-4',
|
|
29
|
+
'mistral-medium-3.5',
|
|
28
30
|
// Z.ai GLM 5.3: third-party open-weight model hosted by Mistral (EU,
|
|
29
31
|
// served without Mistral modifications), long-horizon coding/agentic.
|
|
30
32
|
// Mistral wire id is `zai-glm-5-3` — NOT the bare Z.ai `glm-5.3`, keeping
|
|
@@ -53,10 +55,15 @@ export const knownModelIds = [
|
|
|
53
55
|
// transport-free). Multiple local models can be exposed under this provider.
|
|
54
56
|
'laneformer-2b-it',
|
|
55
57
|
// Meta Muse (Muse Code): `muse-spark-1.3` base + `-contributor` discounted
|
|
56
|
-
// tier option (content may train product)
|
|
57
|
-
//
|
|
58
|
+
// tier option (content may train product), plus `muse-wonder-1.0` /
|
|
59
|
+
// `muse-wonder-full-1.0` (owner request 2026-10-13, id corrected
|
|
60
|
+
// 2026-10-14 against the local Muse provider catalog). invoked via the
|
|
61
|
+
// `muse` account transport (CLI login) or MUSE_API_KEY; wire/transport
|
|
62
|
+
// lives in api/gateway.
|
|
58
63
|
'muse-spark-1.3',
|
|
59
64
|
'muse-spark-1.3-contributor',
|
|
65
|
+
'muse-wonder-1.0',
|
|
66
|
+
'muse-wonder-full-1.0',
|
|
60
67
|
];
|
|
61
68
|
export const knownModelIdsByProvider = {
|
|
62
69
|
openai: [
|
|
@@ -71,13 +78,13 @@ export const knownModelIdsByProvider = {
|
|
|
71
78
|
'gpt-5.4-nano',
|
|
72
79
|
'gpt-4.1-nano',
|
|
73
80
|
],
|
|
74
|
-
gemini: ['gemini-3.7-flash', 'gemini-3.8-flash', 'gemini-3.5-flash', 'gemini-3.1-flash-lite'],
|
|
81
|
+
gemini: ['gemini-3.7-flash', 'gemini-3.8-flash', 'gemini-4-argon', 'gemini-3.5-flash', 'gemini-3.1-flash-lite'],
|
|
75
82
|
anthropic: ['claude-sonnet-5', 'claude-opus-5', 'claude-opus-4-8', 'claude-fable-5', 'claude-fable-5-1'],
|
|
76
|
-
mistral: ['mistral-small-2603', 'magistral-medium-2509', 'mistral-large-4', 'zai-glm-5-3'],
|
|
83
|
+
mistral: ['mistral-small-2603', 'magistral-medium-2509', 'mistral-large-4', 'mistral-medium-3.5', 'zai-glm-5-3'],
|
|
77
84
|
cohere: ['command-a-03-2025', 'command-a-reasoning-08-2025'],
|
|
78
85
|
gcp: ['google/gemini-3.5-flash@gcp', 'google/gemini-3.1-flash-lite@gcp', 'anthropic/claude-sonnet-4-6@gcp', 'anthropic/claude-opus-4-6@gcp'],
|
|
79
86
|
local: ['laneformer-2b-it'],
|
|
80
|
-
muse: ['muse-spark-1.3', 'muse-spark-1.3-contributor'],
|
|
87
|
+
muse: ['muse-spark-1.3', 'muse-spark-1.3-contributor', 'muse-wonder-1.0', 'muse-wonder-full-1.0'],
|
|
81
88
|
};
|
|
82
89
|
export const toQualifiedModelId = (model) => {
|
|
83
90
|
return `${model.providerId}:${model.modelId}`;
|
package/dist/providers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAYnH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,eAAe;IACf,cAAc;IACd,YAAY;IACZ,SAAS;IACT,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,uBAAuB;IACvB,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,oBAAoB;IACpB,uBAAuB;IACvB,0EAA0E;IAC1E,4EAA4E;IAC5E,yEAAyE;IACzE,iBAAiB;IACjB,qEAAqE;IACrE,sEAAsE;IACtE,0EAA0E;IAC1E,uDAAuD;IACvD,aAAa;IACb,mBAAmB;IACnB,6BAA6B;IAC7B,8EAA8E;IAC9E,gFAAgF;IAChF,gFAAgF;IAChF,0EAA0E;IAC1E,8EAA8E;IAC9E,+DAA+D;IAC/D,6EAA6E;IAC7E,qEAAqE;IACrE,6CAA6C;IAC7C,4EAA4E;IAC5E,wCAAwC;IACxC,6BAA6B;IAC7B,kCAAkC;IAClC,iCAAiC;IACjC,+BAA+B;IAC/B,sEAAsE;IACtE,2EAA2E;IAC3E,8EAA8E;IAC9E,6EAA6E;IAC7E,kBAAkB;IAClB,2EAA2E;IAC3E,
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAYnH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,eAAe;IACf,cAAc;IACd,YAAY;IACZ,SAAS;IACT,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,uBAAuB;IACvB,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,oBAAoB;IACpB,uBAAuB;IACvB,0EAA0E;IAC1E,4EAA4E;IAC5E,yEAAyE;IACzE,iBAAiB;IACjB,oBAAoB;IACpB,qEAAqE;IACrE,sEAAsE;IACtE,0EAA0E;IAC1E,uDAAuD;IACvD,aAAa;IACb,mBAAmB;IACnB,6BAA6B;IAC7B,8EAA8E;IAC9E,gFAAgF;IAChF,gFAAgF;IAChF,0EAA0E;IAC1E,8EAA8E;IAC9E,+DAA+D;IAC/D,6EAA6E;IAC7E,qEAAqE;IACrE,6CAA6C;IAC7C,4EAA4E;IAC5E,wCAAwC;IACxC,6BAA6B;IAC7B,kCAAkC;IAClC,iCAAiC;IACjC,+BAA+B;IAC/B,sEAAsE;IACtE,2EAA2E;IAC3E,8EAA8E;IAC9E,6EAA6E;IAC7E,kBAAkB;IAClB,2EAA2E;IAC3E,oEAAoE;IACpE,iEAAiE;IACjE,uEAAuE;IACvE,uEAAuE;IACvE,wBAAwB;IACxB,gBAAgB;IAChB,4BAA4B;IAC5B,iBAAiB;IACjB,sBAAsB;CACd,CAAC;AAQX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,MAAM,EAAE;QACN,aAAa;QACb,WA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AAa,EAAyB,EAAE;IACrE,OAAO,aAAa,CAAC,QAAQ,CAAC,KAAqB,CAAC,CAAC;AACvD,CAAC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed allowlisted native Responses carrier (spec §16.3). Holds validated
|
|
3
|
+
* Responses input/output semantics that have no canonical message
|
|
4
|
+
* equivalent, in `providerOptions` / event metadata / `providerMetadata`,
|
|
5
|
+
* for native input order, item identity, completed reasoning artifacts and
|
|
6
|
+
* terminal output snapshots.
|
|
7
|
+
*
|
|
8
|
+
* Constructed from validated fields only — never copies caller routing or
|
|
9
|
+
* auth controls. Only the matching native adapter consumes it; public
|
|
10
|
+
* responses filter it again (credentials, raw provider errors and internal
|
|
11
|
+
* headers never enter it). No Hono or caller-auth dependency.
|
|
12
|
+
*/
|
|
13
|
+
/** Validated custom/freeform tool, carried opaquely for native execution. */
|
|
14
|
+
export interface ResponsesCustomTool {
|
|
15
|
+
readonly type: 'custom';
|
|
16
|
+
/** Bare tool name as declared (namespace carried separately). */
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly description?: string;
|
|
19
|
+
/** Codex freeform format (string marker or grammar object, carried opaquely). */
|
|
20
|
+
readonly format?: string | Record<string, unknown>;
|
|
21
|
+
/** Declaring namespace, when nested (Codex `additional_tools`). */
|
|
22
|
+
readonly namespace?: string;
|
|
23
|
+
readonly providerMetadata?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
/** Function tool identity preserved through namespace flattening. */
|
|
26
|
+
export interface ResponsesFunctionToolRef {
|
|
27
|
+
readonly qualifiedName: string;
|
|
28
|
+
readonly bareName: string;
|
|
29
|
+
readonly namespace?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Completed reasoning history item, preserved for native replay. */
|
|
32
|
+
export interface ResponsesReasoningArtifact {
|
|
33
|
+
readonly itemId?: string;
|
|
34
|
+
readonly summary?: string;
|
|
35
|
+
/** Opaque encrypted content — never fabricated, never exposed as text. */
|
|
36
|
+
readonly encryptedContent?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Allowlisted native request carrier. Custom tools, reasoning context and
|
|
40
|
+
* verbosity are consumable only by a native Responses adapter (Codex);
|
|
41
|
+
* translated adapters refuse the round trip when these are present via
|
|
42
|
+
* execution-feature eligibility.
|
|
43
|
+
*/
|
|
44
|
+
export interface ResponsesNativeRequestCarrier {
|
|
45
|
+
readonly customTools: readonly ResponsesCustomTool[];
|
|
46
|
+
readonly functionToolRefs: readonly ResponsesFunctionToolRef[];
|
|
47
|
+
readonly reasoningArtifacts: readonly ResponsesReasoningArtifact[];
|
|
48
|
+
/** Codex server-side retention hint; native-only, never routed upon. */
|
|
49
|
+
readonly reasoningContext?: string;
|
|
50
|
+
/** Requested verbosity level; native-only unless an equivalent is proven. */
|
|
51
|
+
readonly verbosity?: string;
|
|
52
|
+
/** Opaque client cache hint; forwarded only to declaring adapters. */
|
|
53
|
+
readonly promptCacheKey?: string;
|
|
54
|
+
readonly safetyIdentifier?: string;
|
|
55
|
+
/** Validated harmless telemetry (object of scalars, bounded). */
|
|
56
|
+
readonly clientMetadata?: Record<string, unknown>;
|
|
57
|
+
/** Validated request metadata echo (bounded, never routing). */
|
|
58
|
+
readonly requestMetadata?: Record<string, unknown>;
|
|
59
|
+
/** Native input item ids in order (identity/order preservation). */
|
|
60
|
+
readonly itemIds: readonly string[];
|
|
61
|
+
}
|
|
62
|
+
export declare const RESPONSES_CARRIER_OPTION_KEY: "responses";
|
|
63
|
+
/**
|
|
64
|
+
* Read the validated Responses carrier off a canonical request's
|
|
65
|
+
* `providerOptions`. Undefined on non-Responses wires; translated adapters
|
|
66
|
+
* other than the Responses path never consult it.
|
|
67
|
+
*/
|
|
68
|
+
export declare const responsesCarrierOf: (providerOptions: Record<string, unknown> | undefined) => ResponsesNativeRequestCarrier | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Requalify returned tool-call names through the ingress refs (spec §16.3):
|
|
71
|
+
* providers echo the bare canonical name the translated/native adapter sent,
|
|
72
|
+
* but the client declared (and awaits) the qualified `namespace.name`.
|
|
73
|
+
* Unknown names pass through untouched — never dropped, never renamed.
|
|
74
|
+
*/
|
|
75
|
+
export declare const requalifyResponseToolName: (bareName: string, carrier: ResponsesNativeRequestCarrier | undefined) => string;
|
|
76
|
+
//# sourceMappingURL=responses-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses-wire.d.ts","sourceRoot":"","sources":["../src/responses-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,mEAAmE;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrD;AAED,qEAAqE;AACrE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,qEAAqE;AACrE,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,0EAA0E;IAC1E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,WAAW,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAC/D,QAAQ,CAAC,kBAAkB,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACnE,wEAAwE;IACxE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,iEAAiE;IACjE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,gEAAgE;IAChE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,4BAA4B,aAAuB,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,oBACZ,OAAO,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,KACnD,6BAA6B,GAAG,SAIlC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,aAC1B,MAAM,WACP,6BAA6B,GAAG,SAAS,KACjD,MAIF,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed allowlisted native Responses carrier (spec §16.3). Holds validated
|
|
3
|
+
* Responses input/output semantics that have no canonical message
|
|
4
|
+
* equivalent, in `providerOptions` / event metadata / `providerMetadata`,
|
|
5
|
+
* for native input order, item identity, completed reasoning artifacts and
|
|
6
|
+
* terminal output snapshots.
|
|
7
|
+
*
|
|
8
|
+
* Constructed from validated fields only — never copies caller routing or
|
|
9
|
+
* auth controls. Only the matching native adapter consumes it; public
|
|
10
|
+
* responses filter it again (credentials, raw provider errors and internal
|
|
11
|
+
* headers never enter it). No Hono or caller-auth dependency.
|
|
12
|
+
*/
|
|
13
|
+
export const RESPONSES_CARRIER_OPTION_KEY = 'responses';
|
|
14
|
+
/**
|
|
15
|
+
* Read the validated Responses carrier off a canonical request's
|
|
16
|
+
* `providerOptions`. Undefined on non-Responses wires; translated adapters
|
|
17
|
+
* other than the Responses path never consult it.
|
|
18
|
+
*/
|
|
19
|
+
export const responsesCarrierOf = (providerOptions) => {
|
|
20
|
+
const carrier = providerOptions?.[RESPONSES_CARRIER_OPTION_KEY];
|
|
21
|
+
return carrier && typeof carrier === 'object' ? carrier : undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Requalify returned tool-call names through the ingress refs (spec §16.3):
|
|
25
|
+
* providers echo the bare canonical name the translated/native adapter sent,
|
|
26
|
+
* but the client declared (and awaits) the qualified `namespace.name`.
|
|
27
|
+
* Unknown names pass through untouched — never dropped, never renamed.
|
|
28
|
+
*/
|
|
29
|
+
export const requalifyResponseToolName = (bareName, carrier) => {
|
|
30
|
+
if (!carrier)
|
|
31
|
+
return bareName;
|
|
32
|
+
const ref = carrier.functionToolRefs.find((entry) => entry.bareName === bareName);
|
|
33
|
+
return ref?.qualifiedName ?? bareName;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=responses-wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses-wire.js","sourceRoot":"","sources":["../src/responses-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuDH,MAAM,CAAC,MAAM,4BAA4B,GAAG,WAAoB,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,eAAoD,EACT,EAAE;IAC7C,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC,4BAA4B,CACjB,CAAC;IAC9C,OAAO,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACtE,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,QAAgB,EAChB,OAAkD,EAC1C,EAAE;IACV,IAAI,CAAC,OAAO;QAAE,OAAO,QAAQ,CAAC;IAC9B,MAAM,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAClF,OAAO,GAAG,EAAE,aAAa,IAAI,QAAQ,CAAC;AACxC,CAAC,CAAC"}
|
package/dist/route-attempt.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ export declare const prepareStoredRouteAttempt: (input: {
|
|
|
10
10
|
readonly attemptIndex: number;
|
|
11
11
|
readonly directory: AccountDirectoryPort;
|
|
12
12
|
readonly clock: Clock;
|
|
13
|
+
readonly isNativeTarget?: (target: {
|
|
14
|
+
readonly providerId: string;
|
|
15
|
+
readonly modelId: string;
|
|
16
|
+
}) => boolean;
|
|
13
17
|
readonly onOutcome: (stored: StoredPlan, candidate: RankedRouteCandidate, classification: RouteFailureClassification) => void;
|
|
14
18
|
readonly onCommitted: (stored: StoredPlan, candidate: RankedRouteCandidate) => void;
|
|
15
19
|
readonly onSuccess: (stored: StoredPlan, candidate: RankedRouteCandidate) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-attempt.d.ts","sourceRoot":"","sources":["../src/route-attempt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"route-attempt.d.ts","sourceRoot":"","sources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AoB,KAAK,IAAI,CAAC;CACrF,KAAG,QAAQ,oBAAoB,CA2E/B,CAAC"}
|
package/dist/route-attempt.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RoutePlanError, subjectRef } from './route-planner-state.js';
|
|
2
|
+
import { isPreparedNativeMessages } from './native-messages.js';
|
|
2
3
|
export const prepareStoredRouteAttempt = async (input) => {
|
|
3
4
|
const { stored } = input;
|
|
4
5
|
if (!stored || stored.plan.planRef !== input.planRef) {
|
|
@@ -31,17 +32,23 @@ export const prepareStoredRouteAttempt = async (input) => {
|
|
|
31
32
|
requestId: input.requestId,
|
|
32
33
|
attemptIndex: input.attemptIndex,
|
|
33
34
|
});
|
|
35
|
+
const nativeMessages = (current.nativeMessages?.contractVersion === 1
|
|
36
|
+
&& current.nativeMessages.protocol === 'anthropic-messages'
|
|
37
|
+
&& input.isNativeTarget?.(candidate.target) === true
|
|
38
|
+
&& isPreparedNativeMessages(attempt.nativeMessages)
|
|
39
|
+
&& attempt.nativeMessages.modelId === candidate.target.modelId) ? attempt.nativeMessages : undefined;
|
|
34
40
|
let committed = false;
|
|
35
41
|
let terminal = false;
|
|
36
42
|
return {
|
|
37
43
|
attemptRef: attempt.attemptRef,
|
|
44
|
+
...(nativeMessages ? { nativeMessages } : {}),
|
|
38
45
|
generate: (request) => attempt.generate(request),
|
|
39
46
|
stream: (request) => attempt.stream(request),
|
|
40
47
|
recordOutcome: async (classification, usage) => {
|
|
41
48
|
if (terminal)
|
|
42
49
|
return;
|
|
43
50
|
terminal = true;
|
|
44
|
-
input.onOutcome(stored, candidate, classification);
|
|
51
|
+
input.onOutcome(stored, candidate, committed ? { ...classification, committed: true } : classification);
|
|
45
52
|
await attempt.recordOutcome(classification, usage);
|
|
46
53
|
},
|
|
47
54
|
markCommitted: async () => {
|