@crewx/sdk 0.9.0-rc.197 → 0.9.0-rc.199
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/esm/index.js +304 -301
- package/dist/esm/plugins/index.js +87 -87
- package/dist/esm/repository/index.js +143 -143
- package/dist/facade/Crewx.d.ts +4 -0
- package/dist/index.browser.js +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +312 -309
- package/dist/migrations/0048_smart_gertrude_yorkes.sql +47 -0
- package/dist/migrations/meta/0048_snapshot.json +5128 -0
- package/dist/migrations/meta/_journal.json +7 -0
- package/dist/plugins/index.js +88 -88
- package/dist/repository/index.js +143 -143
- package/dist/route/decide.d.ts +54 -0
- package/dist/route/eligibility.d.ts +11 -0
- package/dist/route/errors.d.ts +11 -0
- package/dist/route/index.d.ts +14 -0
- package/dist/route/runner.d.ts +15 -0
- package/dist/route/sqlite-store.d.ts +17 -0
- package/dist/route/store.d.ts +45 -0
- package/dist/route/strategies.d.ts +4 -0
- package/dist/route/types.d.ts +212 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/model-routes.d.ts +581 -0
- package/dist/types/index.d.ts +1781 -3
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { RouteObservationSource } from './eligibility.js';
|
|
2
|
+
import type { RouteCandidate, RouteConfig, RouteDecision, RouteLinkError, RouteRequest, RouteRunner } from './types.js';
|
|
3
|
+
import type { RouteDecisionStore } from './store.js';
|
|
4
|
+
export interface RouteDecisionServiceOptions {
|
|
5
|
+
store: RouteDecisionStore;
|
|
6
|
+
observationSource?: RouteObservationSource;
|
|
7
|
+
workspaceRoot?: string;
|
|
8
|
+
clock?: () => number;
|
|
9
|
+
chainTimeoutMs?: number;
|
|
10
|
+
maxCasRetries?: number;
|
|
11
|
+
customRunners?: Readonly<Record<string, RouteRunner>>;
|
|
12
|
+
linkRunnerOverrides?: Readonly<Record<string, RouteRunner>>;
|
|
13
|
+
}
|
|
14
|
+
export interface RecordRouteQuotaFailureInput {
|
|
15
|
+
decision: RouteDecision;
|
|
16
|
+
accountRef?: string;
|
|
17
|
+
resetAt?: number | string;
|
|
18
|
+
now?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface RoutePreviewItem {
|
|
21
|
+
candidateId: string;
|
|
22
|
+
provider: string;
|
|
23
|
+
model: string;
|
|
24
|
+
reason: string;
|
|
25
|
+
eligibleIds: string[];
|
|
26
|
+
blockedCauses: RouteDecision['blockedCauses'];
|
|
27
|
+
linkErrors: RouteLinkError[];
|
|
28
|
+
}
|
|
29
|
+
export declare function routeConfigRevision(route: RouteConfig): string;
|
|
30
|
+
export declare class RouteDecisionService {
|
|
31
|
+
private readonly store;
|
|
32
|
+
private readonly observationSource?;
|
|
33
|
+
private readonly workspaceRoot;
|
|
34
|
+
private readonly clock;
|
|
35
|
+
private readonly chainTimeoutMs;
|
|
36
|
+
private readonly maxCasRetries;
|
|
37
|
+
private readonly customRunners;
|
|
38
|
+
private readonly linkRunnerOverrides;
|
|
39
|
+
private readonly routeLocks;
|
|
40
|
+
constructor(options: RouteDecisionServiceOptions);
|
|
41
|
+
private links;
|
|
42
|
+
private withRouteLock;
|
|
43
|
+
private decideSerial;
|
|
44
|
+
decide(routeId: string, route: RouteConfig, request: RouteRequest): Promise<RouteDecision>;
|
|
45
|
+
previewRoute(routeId: string, route: RouteConfig, request: RouteRequest, count?: number): Promise<RoutePreviewItem[]>;
|
|
46
|
+
recordQuotaFailure(input: RecordRouteQuotaFailureInput): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
export declare function previewRoute(route: RouteConfig, count: number, options?: {
|
|
49
|
+
routeId?: string;
|
|
50
|
+
candidates?: RouteCandidate[];
|
|
51
|
+
now?: number;
|
|
52
|
+
agentId?: string;
|
|
53
|
+
mode?: RouteRequest['mode'];
|
|
54
|
+
}): RoutePreviewItem[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RouteBlockedCause, RouteCandidate, RouteCandidateConfig, RouteQuotaObservation } from './types.js';
|
|
2
|
+
export declare const ROUTE_QUOTA_COOLDOWN_MS: number;
|
|
3
|
+
export interface RouteObservationSource {
|
|
4
|
+
getObservations(candidates: readonly RouteCandidateConfig[], now: number): Promise<RouteQuotaObservation[]> | RouteQuotaObservation[];
|
|
5
|
+
}
|
|
6
|
+
export interface RouteEligibilityResult {
|
|
7
|
+
candidates: RouteCandidate[];
|
|
8
|
+
blockedCauses: RouteBlockedCause[];
|
|
9
|
+
}
|
|
10
|
+
export declare function evaluateRouteEligibility(candidates: readonly RouteCandidateConfig[], observations: readonly RouteQuotaObservation[], now: number): RouteEligibilityResult;
|
|
11
|
+
export declare function quotaResetAt(resetAt: number | string | undefined, now: number): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type RouteErrorCode = 'route_no_eligible_candidate' | 'route_state_contention' | 'sticky_unavailable' | 'route_observation_unavailable' | 'invalid_route_config';
|
|
2
|
+
export declare class RouteError extends Error {
|
|
3
|
+
readonly code: RouteErrorCode;
|
|
4
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
5
|
+
constructor(code: RouteErrorCode, message: string, details?: Record<string, unknown> | undefined);
|
|
6
|
+
}
|
|
7
|
+
export type RouteRunnerErrorCode = 'invalid_json' | 'input_too_large' | 'output_too_large' | 'outside_workspace' | 'module_not_found' | 'timeout' | 'process_failed';
|
|
8
|
+
export declare class RouteRunnerError extends Error {
|
|
9
|
+
readonly code: RouteRunnerErrorCode;
|
|
10
|
+
constructor(code: RouteRunnerErrorCode, message: string);
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { RouteConfigSchema, RouteCandidateConfigSchema, RouteLinkConfigSchema } from './types.js';
|
|
2
|
+
export type { JsonPrimitive, JsonValue, RouteBlockedCause, RouteCandidate, RouteCandidateConfig, RouteConfig, RouteContext, RouteDecision, RouteFunction, RouteHealth, RouteLinkConfig, RouteLinkError, RouteMode, RouteOutput, RoutePassOutput, RouteQuotaObservation, RouteRequest, RouteRunner, RouteSelectOutput, } from './types.js';
|
|
3
|
+
export { RouteError, RouteRunnerError } from './errors.js';
|
|
4
|
+
export type { RouteErrorCode, RouteRunnerErrorCode } from './errors.js';
|
|
5
|
+
export { builtInStrategy, roundRobin, smoothWeighted } from './strategies.js';
|
|
6
|
+
export { fnRunner, procRunner, resolveRouteModulePath, ROUTE_CHAIN_TIMEOUT_MS, ROUTE_JSON_MAX_BYTES, ROUTE_PROCESS_INPUT_MAX_BYTES, ROUTE_PROCESS_OUTPUT_MAX_BYTES, } from './runner.js';
|
|
7
|
+
export type { ProcRunnerOptions } from './runner.js';
|
|
8
|
+
export { evaluateRouteEligibility, quotaResetAt, ROUTE_QUOTA_COOLDOWN_MS } from './eligibility.js';
|
|
9
|
+
export type { RouteEligibilityResult, RouteObservationSource } from './eligibility.js';
|
|
10
|
+
export { MemoryRouteStore } from './store.js';
|
|
11
|
+
export type { RouteCommitResult, RouteDecisionCommit, RouteDecisionStore, RouteObservationStore, RouteStateSnapshot, } from './store.js';
|
|
12
|
+
export { RouteSqliteStore } from './sqlite-store.js';
|
|
13
|
+
export { RouteDecisionService, previewRoute, routeConfigRevision } from './decide.js';
|
|
14
|
+
export type { RecordRouteQuotaFailureInput, RouteDecisionServiceOptions, RoutePreviewItem, } from './decide.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RouteFunction, RouteRunner } from './types.js';
|
|
2
|
+
export declare const ROUTE_JSON_MAX_BYTES: number;
|
|
3
|
+
export declare const ROUTE_PROCESS_INPUT_MAX_BYTES: number;
|
|
4
|
+
export declare const ROUTE_PROCESS_OUTPUT_MAX_BYTES: number;
|
|
5
|
+
export declare const ROUTE_CHAIN_TIMEOUT_MS = 2000;
|
|
6
|
+
export interface ProcRunnerOptions {
|
|
7
|
+
workspaceRoot: string;
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
maxInputBytes?: number;
|
|
10
|
+
maxOutputBytes?: number;
|
|
11
|
+
onSpawn?: (processGroupId: number | undefined) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function fnRunner(fn: RouteFunction): RouteRunner;
|
|
14
|
+
export declare function procRunner(file: string, options: ProcRunnerOptions): RouteRunner;
|
|
15
|
+
export declare function resolveRouteModulePath(file: string, workspaceRoot: string): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from '../repository/base-sqlite-repository.js';
|
|
2
|
+
import type { RouteDecision, RouteQuotaObservation, RouteCandidateConfig } from './types.js';
|
|
3
|
+
import type { RouteDecisionCommit, RouteDecisionStore, RouteObservationStore, RouteStateSnapshot, RouteCommitResult } from './store.js';
|
|
4
|
+
export declare class RouteSqliteStore extends BaseSqliteRepository implements RouteDecisionStore, RouteObservationStore {
|
|
5
|
+
private readonly configuredDbPath?;
|
|
6
|
+
constructor(options?: {
|
|
7
|
+
dbPath?: string;
|
|
8
|
+
dbRoot?: string;
|
|
9
|
+
});
|
|
10
|
+
resolveDbPath(): string;
|
|
11
|
+
private openHandle;
|
|
12
|
+
getDecision(routeId: string, taskId: string): Promise<RouteDecision | undefined>;
|
|
13
|
+
loadState(routeId: string, threadId: string | null, configRevision: string): Promise<RouteStateSnapshot>;
|
|
14
|
+
commitDecision(input: RouteDecisionCommit): Promise<RouteCommitResult>;
|
|
15
|
+
recordQuotaObservation(observation: RouteQuotaObservation, observedAt: number): Promise<void>;
|
|
16
|
+
getObservations(candidates: readonly RouteCandidateConfig[], _now: number): Promise<RouteQuotaObservation[]>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { JsonValue, RouteDecision, RouteQuotaObservation, RouteCandidateConfig } from './types.js';
|
|
2
|
+
export interface RouteStateSnapshot {
|
|
3
|
+
revision: number;
|
|
4
|
+
storedConfigRevision: string | null;
|
|
5
|
+
states: Record<string, JsonValue>;
|
|
6
|
+
stickyCandidateId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RouteDecisionCommit {
|
|
9
|
+
decision: RouteDecision;
|
|
10
|
+
expectedRevision: number;
|
|
11
|
+
expectedStoredConfigRevision: string | null;
|
|
12
|
+
configRevision: string;
|
|
13
|
+
states: Record<string, JsonValue>;
|
|
14
|
+
threadId: string | null;
|
|
15
|
+
stickyCandidateId?: string;
|
|
16
|
+
}
|
|
17
|
+
export type RouteCommitResult = {
|
|
18
|
+
status: 'saved';
|
|
19
|
+
decision: RouteDecision;
|
|
20
|
+
} | {
|
|
21
|
+
status: 'conflict';
|
|
22
|
+
} | {
|
|
23
|
+
status: 'existing';
|
|
24
|
+
decision: RouteDecision;
|
|
25
|
+
};
|
|
26
|
+
export interface RouteDecisionStore {
|
|
27
|
+
getDecision(routeId: string, taskId: string): Promise<RouteDecision | undefined>;
|
|
28
|
+
loadState(routeId: string, threadId: string | null, configRevision: string): Promise<RouteStateSnapshot>;
|
|
29
|
+
commitDecision(input: RouteDecisionCommit): Promise<RouteCommitResult>;
|
|
30
|
+
recordQuotaObservation(observation: RouteQuotaObservation, observedAt: number): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export interface RouteObservationStore {
|
|
33
|
+
getObservations(candidates: readonly RouteCandidateConfig[], now: number): Promise<RouteQuotaObservation[]>;
|
|
34
|
+
}
|
|
35
|
+
export declare class MemoryRouteStore implements RouteDecisionStore, RouteObservationStore {
|
|
36
|
+
private readonly states;
|
|
37
|
+
private readonly sticky;
|
|
38
|
+
private readonly decisions;
|
|
39
|
+
private readonly observations;
|
|
40
|
+
getDecision(routeId: string, taskId: string): Promise<RouteDecision | undefined>;
|
|
41
|
+
loadState(routeId: string, threadId: string | null, configRevision: string): Promise<RouteStateSnapshot>;
|
|
42
|
+
commitDecision(input: RouteDecisionCommit): Promise<RouteCommitResult>;
|
|
43
|
+
recordQuotaObservation(observation: RouteQuotaObservation, observedAt: number): Promise<void>;
|
|
44
|
+
getObservations(candidates: readonly RouteCandidateConfig[], _now: number): Promise<RouteQuotaObservation[]>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RouteContext, RouteOutput } from './types.js';
|
|
2
|
+
export declare function roundRobin(ctx: Readonly<RouteContext>): RouteOutput;
|
|
3
|
+
export declare function smoothWeighted(ctx: Readonly<RouteContext>): RouteOutput;
|
|
4
|
+
export declare function builtInStrategy(strategy: 'round-robin' | 'weighted'): typeof roundRobin;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RouteCandidateConfigSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
provider: z.ZodString;
|
|
5
|
+
model: z.ZodString;
|
|
6
|
+
weight: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
account: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
id: string;
|
|
10
|
+
model: string;
|
|
11
|
+
provider: string;
|
|
12
|
+
weight: number;
|
|
13
|
+
account?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
id: string;
|
|
16
|
+
model: string;
|
|
17
|
+
provider: string;
|
|
18
|
+
weight?: number | undefined;
|
|
19
|
+
account?: string | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const RouteLinkConfigSchema: z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"custom">;
|
|
23
|
+
run: z.ZodString;
|
|
24
|
+
}, "strict", z.ZodTypeAny, {
|
|
25
|
+
kind: "custom";
|
|
26
|
+
run: string;
|
|
27
|
+
}, {
|
|
28
|
+
kind: "custom";
|
|
29
|
+
run: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const RouteConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
32
|
+
strategy: z.ZodEnum<["round-robin", "weighted"]>;
|
|
33
|
+
chain: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
34
|
+
kind: z.ZodLiteral<"custom">;
|
|
35
|
+
run: z.ZodString;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
kind: "custom";
|
|
38
|
+
run: string;
|
|
39
|
+
}, {
|
|
40
|
+
kind: "custom";
|
|
41
|
+
run: string;
|
|
42
|
+
}>, "many">>;
|
|
43
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
provider: z.ZodString;
|
|
46
|
+
model: z.ZodString;
|
|
47
|
+
weight: z.ZodDefault<z.ZodNumber>;
|
|
48
|
+
account: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, "strict", z.ZodTypeAny, {
|
|
50
|
+
id: string;
|
|
51
|
+
model: string;
|
|
52
|
+
provider: string;
|
|
53
|
+
weight: number;
|
|
54
|
+
account?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
id: string;
|
|
57
|
+
model: string;
|
|
58
|
+
provider: string;
|
|
59
|
+
weight?: number | undefined;
|
|
60
|
+
account?: string | undefined;
|
|
61
|
+
}>, "many">;
|
|
62
|
+
sticky: z.ZodDefault<z.ZodEnum<["conversation", "none"]>>;
|
|
63
|
+
defaultCandidate: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, "strict", z.ZodTypeAny, {
|
|
65
|
+
strategy: "round-robin" | "weighted";
|
|
66
|
+
candidates: {
|
|
67
|
+
id: string;
|
|
68
|
+
model: string;
|
|
69
|
+
provider: string;
|
|
70
|
+
weight: number;
|
|
71
|
+
account?: string | undefined;
|
|
72
|
+
}[];
|
|
73
|
+
sticky: "none" | "conversation";
|
|
74
|
+
chain?: {
|
|
75
|
+
kind: "custom";
|
|
76
|
+
run: string;
|
|
77
|
+
}[] | undefined;
|
|
78
|
+
defaultCandidate?: string | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
strategy: "round-robin" | "weighted";
|
|
81
|
+
candidates: {
|
|
82
|
+
id: string;
|
|
83
|
+
model: string;
|
|
84
|
+
provider: string;
|
|
85
|
+
weight?: number | undefined;
|
|
86
|
+
account?: string | undefined;
|
|
87
|
+
}[];
|
|
88
|
+
chain?: {
|
|
89
|
+
kind: "custom";
|
|
90
|
+
run: string;
|
|
91
|
+
}[] | undefined;
|
|
92
|
+
sticky?: "none" | "conversation" | undefined;
|
|
93
|
+
defaultCandidate?: string | undefined;
|
|
94
|
+
}>, {
|
|
95
|
+
strategy: "round-robin" | "weighted";
|
|
96
|
+
candidates: {
|
|
97
|
+
id: string;
|
|
98
|
+
model: string;
|
|
99
|
+
provider: string;
|
|
100
|
+
weight: number;
|
|
101
|
+
account?: string | undefined;
|
|
102
|
+
}[];
|
|
103
|
+
sticky: "none" | "conversation";
|
|
104
|
+
chain?: {
|
|
105
|
+
kind: "custom";
|
|
106
|
+
run: string;
|
|
107
|
+
}[] | undefined;
|
|
108
|
+
defaultCandidate?: string | undefined;
|
|
109
|
+
}, {
|
|
110
|
+
strategy: "round-robin" | "weighted";
|
|
111
|
+
candidates: {
|
|
112
|
+
id: string;
|
|
113
|
+
model: string;
|
|
114
|
+
provider: string;
|
|
115
|
+
weight?: number | undefined;
|
|
116
|
+
account?: string | undefined;
|
|
117
|
+
}[];
|
|
118
|
+
chain?: {
|
|
119
|
+
kind: "custom";
|
|
120
|
+
run: string;
|
|
121
|
+
}[] | undefined;
|
|
122
|
+
sticky?: "none" | "conversation" | undefined;
|
|
123
|
+
defaultCandidate?: string | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
export type RouteCandidateConfig = z.infer<typeof RouteCandidateConfigSchema>;
|
|
126
|
+
export type RouteLinkConfig = z.infer<typeof RouteLinkConfigSchema>;
|
|
127
|
+
export type RouteConfig = z.infer<typeof RouteConfigSchema>;
|
|
128
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
129
|
+
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
130
|
+
[key: string]: JsonValue;
|
|
131
|
+
};
|
|
132
|
+
export type RouteHealth = 'ok' | 'unknown' | 'blocked';
|
|
133
|
+
export type RouteMode = 'query' | 'execute';
|
|
134
|
+
export interface RouteCandidate {
|
|
135
|
+
id: string;
|
|
136
|
+
provider: string;
|
|
137
|
+
model: string;
|
|
138
|
+
weight: number;
|
|
139
|
+
eligible: boolean;
|
|
140
|
+
health: RouteHealth;
|
|
141
|
+
resetAt?: number;
|
|
142
|
+
}
|
|
143
|
+
export interface RouteContext {
|
|
144
|
+
v: 1;
|
|
145
|
+
route: {
|
|
146
|
+
id: string;
|
|
147
|
+
revision: string;
|
|
148
|
+
};
|
|
149
|
+
request: {
|
|
150
|
+
taskId: string;
|
|
151
|
+
threadId: string | null;
|
|
152
|
+
agentId: string;
|
|
153
|
+
mode: RouteMode;
|
|
154
|
+
};
|
|
155
|
+
now: number;
|
|
156
|
+
candidates: RouteCandidate[];
|
|
157
|
+
state: JsonValue;
|
|
158
|
+
}
|
|
159
|
+
export interface RouteSelectOutput {
|
|
160
|
+
type: 'select';
|
|
161
|
+
candidateId: string;
|
|
162
|
+
nextState: JsonValue;
|
|
163
|
+
reason: string;
|
|
164
|
+
}
|
|
165
|
+
export interface RoutePassOutput {
|
|
166
|
+
type: 'pass';
|
|
167
|
+
}
|
|
168
|
+
export type RouteOutput = RouteSelectOutput | RoutePassOutput;
|
|
169
|
+
export type RouteFunction = (ctx: Readonly<RouteContext>) => RouteOutput | unknown | Promise<RouteOutput | unknown>;
|
|
170
|
+
export type RouteRunner = (ctx: RouteContext, timeoutMs?: number) => Promise<unknown>;
|
|
171
|
+
export interface RouteBlockedCause {
|
|
172
|
+
candidateId: string;
|
|
173
|
+
provider: string;
|
|
174
|
+
accountRef: string;
|
|
175
|
+
model?: string;
|
|
176
|
+
source: string;
|
|
177
|
+
scope: 'account' | 'account-model';
|
|
178
|
+
resetAt: number;
|
|
179
|
+
}
|
|
180
|
+
export interface RouteLinkError {
|
|
181
|
+
link: string;
|
|
182
|
+
code: string;
|
|
183
|
+
message: string;
|
|
184
|
+
}
|
|
185
|
+
export interface RouteDecision {
|
|
186
|
+
routeId: string;
|
|
187
|
+
taskId: string;
|
|
188
|
+
configRevision: string;
|
|
189
|
+
candidateId: string;
|
|
190
|
+
provider: string;
|
|
191
|
+
model: string;
|
|
192
|
+
reason: string;
|
|
193
|
+
eligibleIds: string[];
|
|
194
|
+
blockedCauses: RouteBlockedCause[];
|
|
195
|
+
linkErrors: RouteLinkError[];
|
|
196
|
+
createdAt: number;
|
|
197
|
+
}
|
|
198
|
+
export interface RouteQuotaObservation {
|
|
199
|
+
provider: string;
|
|
200
|
+
accountRef: string;
|
|
201
|
+
model?: string;
|
|
202
|
+
status: 'ok' | 'blocked';
|
|
203
|
+
source: string;
|
|
204
|
+
resetAt?: number;
|
|
205
|
+
}
|
|
206
|
+
export interface RouteRequest {
|
|
207
|
+
taskId: string;
|
|
208
|
+
threadId: string | null;
|
|
209
|
+
agentId: string;
|
|
210
|
+
mode: RouteMode;
|
|
211
|
+
namedAcpSession?: boolean;
|
|
212
|
+
}
|
package/dist/schema/index.d.ts
CHANGED