optio-contracts 0.11.4 → 0.11.5
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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/pools/api-to-frontend.d.ts +647 -0
- package/dist/pools/api-to-frontend.d.ts.map +1 -0
- package/dist/pools/api-to-frontend.js +134 -0
- package/dist/pools/api-to-frontend.js.map +1 -0
- package/dist/pools/optio-pools-to-api.d.ts +606 -0
- package/dist/pools/optio-pools-to-api.d.ts.map +1 -0
- package/dist/pools/optio-pools-to-api.js +91 -0
- package/dist/pools/optio-pools-to-api.js.map +1 -0
- package/dist/pools/schemas.d.ts +1071 -0
- package/dist/pools/schemas.d.ts.map +1 -0
- package/dist/pools/schemas.js +137 -0
- package/dist/pools/schemas.js.map +1 -0
- package/dist/route-error-reasons.d.ts +7 -0
- package/dist/route-error-reasons.d.ts.map +1 -1
- package/dist/route-error-reasons.js +12 -0
- package/dist/route-error-reasons.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/pools/schemas.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,+MAa5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,oFAAkF,CAAC;AACnH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB,kHAO3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,iFAAiF;AACjF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,mGAAmG;AACnG,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,qGAAqG;AACrG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;EAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Login pools: the wire shapes shared by the routes (api-to-frontend.ts) and the
|
|
2
|
+
// engine RPC contract (optio-pools-to-api.ts). Spec:
|
|
3
|
+
// docs/2026-11-29-login-pools-design.md sections 11 and 12. Browser-safe: no
|
|
4
|
+
// clamator import here.
|
|
5
|
+
//
|
|
6
|
+
// Field names are camelCase; times are ISO 8601 UTC strings (plain strings, so
|
|
7
|
+
// codegen keeps them a Python `str`). Objects strip unknown keys, so nothing a
|
|
8
|
+
// newer engine adds (and no stray secret) reaches a client.
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
/** Why a pool operation was refused (optio-agents-all's POOL_FAILURE_REASONS, same order). */
|
|
11
|
+
export const PoolFailureReason = z.enum([
|
|
12
|
+
'unknown-kind',
|
|
13
|
+
'unsupported',
|
|
14
|
+
'invalid-owner',
|
|
15
|
+
'setup-running',
|
|
16
|
+
'launch-refused',
|
|
17
|
+
'no-key',
|
|
18
|
+
'key-rejected',
|
|
19
|
+
'unreachable',
|
|
20
|
+
'no-models',
|
|
21
|
+
'unknown-model',
|
|
22
|
+
'default-not-ticked',
|
|
23
|
+
'unknown-region',
|
|
24
|
+
]);
|
|
25
|
+
/** The pool operations, as the stream's `allowed` lists them. */
|
|
26
|
+
export const PoolOperationSchema = z.enum(['setup', 'configure', 'retest', 'bury-dead', 'remove-all', 'sort-out']);
|
|
27
|
+
/** The same operations as optio-api's `authorize` sees them (with the `pool-` prefix). */
|
|
28
|
+
export const PoolActionSchema = z.enum([
|
|
29
|
+
'pool-setup',
|
|
30
|
+
'pool-configure',
|
|
31
|
+
'pool-retest',
|
|
32
|
+
'pool-bury-dead',
|
|
33
|
+
'pool-remove-all',
|
|
34
|
+
'pool-sort-out',
|
|
35
|
+
]);
|
|
36
|
+
/** What a kind supports (spec section 5). */
|
|
37
|
+
export const PoolCapabilitiesSchema = z.object({
|
|
38
|
+
lease: z.boolean(),
|
|
39
|
+
verify: z.boolean(),
|
|
40
|
+
accounts: z.boolean(),
|
|
41
|
+
usageGating: z.boolean(),
|
|
42
|
+
signature: z.boolean(),
|
|
43
|
+
});
|
|
44
|
+
/** An enabled kind: `name` is the agent's display name; `regions` empty for login kinds. */
|
|
45
|
+
export const PoolKindInfoSchema = z.object({
|
|
46
|
+
kind: z.string(),
|
|
47
|
+
name: z.string(),
|
|
48
|
+
setup: z.enum(['login', 'form']),
|
|
49
|
+
capabilities: PoolCapabilitiesSchema,
|
|
50
|
+
regions: z.array(z.string()),
|
|
51
|
+
});
|
|
52
|
+
/** The RPC's kind: also the seed collection, for optio-api's watch. Never sent to a browser. */
|
|
53
|
+
export const PoolKindInfoWithCollectionSchema = PoolKindInfoSchema.extend({
|
|
54
|
+
seedCollection: z.string(),
|
|
55
|
+
});
|
|
56
|
+
export const PoolSeedRowSchema = z.object({
|
|
57
|
+
label: z.string().nullable(),
|
|
58
|
+
status: z.enum(['pending', 'alive', 'dead']),
|
|
59
|
+
leased: z.boolean(),
|
|
60
|
+
});
|
|
61
|
+
export const PoolAccountRowSchema = z.object({
|
|
62
|
+
accountId: z.string().nullable(),
|
|
63
|
+
summary: z.string().nullable(),
|
|
64
|
+
resetsAt: z.string().nullable(),
|
|
65
|
+
});
|
|
66
|
+
export const PoolGatewayModelRowSchema = z.object({
|
|
67
|
+
id: z.string(),
|
|
68
|
+
label: z.string(),
|
|
69
|
+
status: z.enum(['untested', 'ok', 'failed']),
|
|
70
|
+
reason: z.string().nullable(),
|
|
71
|
+
});
|
|
72
|
+
/** The form kind's configuration. `keyHint`: the key's last characters, null for a short key. */
|
|
73
|
+
export const PoolGatewaySummarySchema = z.object({
|
|
74
|
+
region: z.string(),
|
|
75
|
+
defaultModel: z.string(),
|
|
76
|
+
keyHint: z.string().nullable(),
|
|
77
|
+
testedAt: z.string().nullable(),
|
|
78
|
+
models: z.array(PoolGatewayModelRowSchema),
|
|
79
|
+
});
|
|
80
|
+
const Count = z.number().int().min(0);
|
|
81
|
+
/**
|
|
82
|
+
* A pool's stats. The optional fields hold a value exactly when the kind has the
|
|
83
|
+
* capability: `limited` / `notLimited` usage gating, `divergent` signature,
|
|
84
|
+
* `accounts` accounts, `gateway` the form kind once set up. Without it a field is
|
|
85
|
+
* null or absent, and both mean the same: the engine (clamator's Python server
|
|
86
|
+
* dumps results without leaving out None) sends null, the stream passes the null
|
|
87
|
+
* on, and a reader treats null exactly as absent.
|
|
88
|
+
*/
|
|
89
|
+
export const PoolStatsSchema = z.object({
|
|
90
|
+
total: Count,
|
|
91
|
+
dead: Count,
|
|
92
|
+
inUse: Count,
|
|
93
|
+
free: Count,
|
|
94
|
+
usable: Count,
|
|
95
|
+
seeds: z.array(PoolSeedRowSchema),
|
|
96
|
+
limited: Count.nullish(),
|
|
97
|
+
notLimited: Count.nullish(),
|
|
98
|
+
divergent: Count.nullish(),
|
|
99
|
+
accounts: z.array(PoolAccountRowSchema).nullish(),
|
|
100
|
+
gateway: PoolGatewaySummarySchema.nullish(),
|
|
101
|
+
});
|
|
102
|
+
/** One model a gateway account allows. `efforts` null for none; `euOnly` listed for `eu` only. */
|
|
103
|
+
export const ModelChoiceSchema = z.object({
|
|
104
|
+
id: z.string(),
|
|
105
|
+
label: z.string(),
|
|
106
|
+
group: z.enum(['managed', 'pinned', 'policy']),
|
|
107
|
+
efforts: z.array(z.string()).nullable(),
|
|
108
|
+
euOnly: z.boolean(),
|
|
109
|
+
});
|
|
110
|
+
/** A row of the pools stream: the kind, what the user may do, the stats. */
|
|
111
|
+
export const PoolRowSchema = PoolKindInfoSchema.extend({
|
|
112
|
+
allowed: z.array(PoolOperationSchema),
|
|
113
|
+
stats: PoolStatsSchema,
|
|
114
|
+
});
|
|
115
|
+
/** A frame of GET /api/pools/stream. */
|
|
116
|
+
export const PoolsStreamFrameSchema = z.object({
|
|
117
|
+
type: z.literal('pools'),
|
|
118
|
+
owner: z.string(),
|
|
119
|
+
rows: z.array(PoolRowSchema),
|
|
120
|
+
});
|
|
121
|
+
/** Every pool route's query: the optio instance, and the owner a UI asks for. */
|
|
122
|
+
export const PoolsQuerySchema = z.object({
|
|
123
|
+
database: z.string().optional(),
|
|
124
|
+
prefix: z.string().optional(),
|
|
125
|
+
owner: z.string().optional(),
|
|
126
|
+
});
|
|
127
|
+
/** The gateway model list's body. No `apiKey` (or a blank one): the stored configuration's key. */
|
|
128
|
+
export const GatewayModelsBodySchema = z.object({
|
|
129
|
+
apiKey: z.string().optional(),
|
|
130
|
+
region: z.string(),
|
|
131
|
+
});
|
|
132
|
+
/** The gateway configuration's body: the ticked models (at least one) and the default among them. */
|
|
133
|
+
export const GatewayConfigureBodySchema = GatewayModelsBodySchema.extend({
|
|
134
|
+
models: z.array(z.string()).min(1),
|
|
135
|
+
defaultModel: z.string(),
|
|
136
|
+
});
|
|
137
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/pools/schemas.ts"],"names":[],"mappings":"AAA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C,MAAM,EAAE;CACzB,CAAC,CAAC"}
|
|
@@ -3,6 +3,13 @@ export declare const apiToFrontendRouteErrorReasons: {
|
|
|
3
3
|
readonly 'processes.cancel': ["not-found", "not-cancellable"];
|
|
4
4
|
readonly 'processes.dismiss': ["not-found", "not-dismissable"];
|
|
5
5
|
readonly 'processes.resurrect': ["not-found", "not-resurrectable", "no-resurrect-support", "resurrect-in-progress", "launch-blocked", "shutting-down", "not-launchable"];
|
|
6
|
+
readonly 'pools.setup': readonly ["unknown-kind", "engine-unavailable", "setup-running", "unsupported", "launch-refused"];
|
|
7
|
+
readonly 'pools.retest': readonly ["unknown-kind", "engine-unavailable", "launch-refused"];
|
|
8
|
+
readonly 'pools.bury-dead': readonly ["unknown-kind", "engine-unavailable", "unsupported"];
|
|
9
|
+
readonly 'pools.remove-all': readonly ["unknown-kind", "engine-unavailable"];
|
|
10
|
+
readonly 'pools.sort-out': readonly ["unknown-kind", "engine-unavailable", "unsupported"];
|
|
11
|
+
readonly 'pools.gateway.models': readonly ["unknown-kind", "engine-unavailable", "unsupported", "no-key", "key-rejected", "unreachable", "no-models", "unknown-region"];
|
|
12
|
+
readonly 'pools.gateway.configure': readonly ["unknown-kind", "engine-unavailable", "setup-running", "unsupported", "launch-refused", "no-key", "key-rejected", "unreachable", "no-models", "unknown-region", "unknown-model", "default-not-ticked"];
|
|
6
13
|
};
|
|
7
14
|
export type ApiToFrontendRouteId = keyof typeof apiToFrontendRouteErrorReasons;
|
|
8
15
|
//# sourceMappingURL=route-error-reasons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-error-reasons.d.ts","sourceRoot":"","sources":["../src/route-error-reasons.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route-error-reasons.d.ts","sourceRoot":"","sources":["../src/route-error-reasons.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,8BAA8B;;;;;;;;;;;;CAcjC,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,8BAA8B,CAAC"}
|
|
@@ -7,10 +7,22 @@
|
|
|
7
7
|
// `{reason, message}` body are listed; engine-internal admin RPCs
|
|
8
8
|
// (groupCancel, blockLaunches) are not exposed to the frontend.
|
|
9
9
|
import { LaunchFailureReason, CancelFailureReason, DismissFailureReason, ResurrectFailureReason, } from './engine-failure-reasons.js';
|
|
10
|
+
import { PoolSetupConflictReason, PoolUnsupportedReason, PoolRetestConflictReason, PoolGatewayModelsReason, PoolGatewayConfigureReason, } from './pools/api-to-frontend.js';
|
|
11
|
+
// Every login pool route can answer these two (404 and 503), listed first.
|
|
12
|
+
const POOL_ROUTE_REASONS = ['unknown-kind', 'engine-unavailable'];
|
|
10
13
|
export const apiToFrontendRouteErrorReasons = {
|
|
11
14
|
'processes.launch': LaunchFailureReason.options,
|
|
12
15
|
'processes.cancel': CancelFailureReason.options,
|
|
13
16
|
'processes.dismiss': DismissFailureReason.options,
|
|
14
17
|
'processes.resurrect': ResurrectFailureReason.options,
|
|
18
|
+
'pools.setup': [...POOL_ROUTE_REASONS, ...PoolSetupConflictReason.options],
|
|
19
|
+
'pools.retest': [...POOL_ROUTE_REASONS, ...PoolRetestConflictReason.options],
|
|
20
|
+
'pools.bury-dead': [...POOL_ROUTE_REASONS, ...PoolUnsupportedReason.options],
|
|
21
|
+
'pools.remove-all': [...POOL_ROUTE_REASONS],
|
|
22
|
+
'pools.sort-out': [...POOL_ROUTE_REASONS, ...PoolUnsupportedReason.options],
|
|
23
|
+
'pools.gateway.models': [...POOL_ROUTE_REASONS, ...PoolUnsupportedReason.options,
|
|
24
|
+
...PoolGatewayModelsReason.options],
|
|
25
|
+
'pools.gateway.configure': [...POOL_ROUTE_REASONS, ...PoolSetupConflictReason.options,
|
|
26
|
+
...PoolGatewayConfigureReason.options],
|
|
15
27
|
};
|
|
16
28
|
//# sourceMappingURL=route-error-reasons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-error-reasons.js","sourceRoot":"","sources":["../src/route-error-reasons.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,2DAA2D;AAC3D,EAAE;AACF,4DAA4D;AAC5D,kEAAkE;AAClE,gEAAgE;AAEhE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"route-error-reasons.js","sourceRoot":"","sources":["../src/route-error-reasons.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,2DAA2D;AAC3D,EAAE;AACF,4DAA4D;AAC5D,kEAAkE;AAClE,gEAAgE;AAEhE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AAEpC,2EAA2E;AAC3E,MAAM,kBAAkB,GAAG,CAAC,cAAc,EAAE,oBAAoB,CAAU,CAAC;AAE3E,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,kBAAkB,EAAK,mBAAmB,CAAC,OAAO;IAClD,kBAAkB,EAAK,mBAAmB,CAAC,OAAO;IAClD,mBAAmB,EAAI,oBAAoB,CAAC,OAAO;IACnD,qBAAqB,EAAE,sBAAsB,CAAC,OAAO;IACrD,aAAa,EAAU,CAAC,GAAG,kBAAkB,EAAE,GAAG,uBAAuB,CAAC,OAAO,CAAC;IAClF,cAAc,EAAS,CAAC,GAAG,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,OAAO,CAAC;IACnF,iBAAiB,EAAM,CAAC,GAAG,kBAAkB,EAAE,GAAG,qBAAqB,CAAC,OAAO,CAAC;IAChF,kBAAkB,EAAK,CAAC,GAAG,kBAAkB,CAAC;IAC9C,gBAAgB,EAAO,CAAC,GAAG,kBAAkB,EAAE,GAAG,qBAAqB,CAAC,OAAO,CAAC;IAChF,sBAAsB,EAAE,CAAC,GAAG,kBAAkB,EAAE,GAAG,qBAAqB,CAAC,OAAO;QACvD,GAAG,uBAAuB,CAAC,OAAO,CAAC;IAC5D,yBAAyB,EAAE,CAAC,GAAG,kBAAkB,EAAE,GAAG,uBAAuB,CAAC,OAAO;QACzD,GAAG,0BAA0B,CAAC,OAAO,CAAC;CAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optio-contracts",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Shared wire-protocol types and ts-rest contracts for the optio task runner.",
|
|
6
6
|
"repository": {
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"./optio-engine": {
|
|
30
30
|
"import": "./dist/optio-engine-to-api.js",
|
|
31
31
|
"types": "./dist/optio-engine-to-api.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./optio-pools": {
|
|
34
|
+
"import": "./dist/pools/optio-pools-to-api.js",
|
|
35
|
+
"types": "./dist/pools/optio-pools-to-api.d.ts"
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
38
|
"dependencies": {
|