@cat-factory/contracts 0.33.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-keys.d.ts +17 -0
- package/dist/api-keys.d.ts.map +1 -1
- package/dist/api-keys.js +2 -0
- package/dist/api-keys.js.map +1 -1
- package/dist/entities.d.ts +135 -0
- package/dist/entities.d.ts.map +1 -1
- package/dist/entities.js +46 -0
- package/dist/entities.js.map +1 -1
- package/dist/github.d.ts +14 -0
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +13 -0
- package/dist/github.js.map +1 -1
- package/dist/human-review.d.ts +8 -0
- package/dist/human-review.d.ts.map +1 -0
- package/dist/human-review.js +12 -0
- package/dist/human-review.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/merge.d.ts +9 -0
- package/dist/merge.d.ts.map +1 -1
- package/dist/merge.js +10 -0
- package/dist/merge.js.map +1 -1
- package/dist/notifications.d.ts +2 -2
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +6 -0
- package/dist/notifications.js.map +1 -1
- package/dist/observability.d.ts +63 -0
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +57 -0
- package/dist/observability.js.map +1 -1
- package/dist/requests.d.ts +7 -0
- package/dist/requests.d.ts.map +1 -1
- package/dist/requests.js +2 -0
- package/dist/requests.js.map +1 -1
- package/dist/routes/_shared.d.ts +49 -0
- package/dist/routes/_shared.d.ts.map +1 -0
- package/dist/routes/_shared.js +34 -0
- package/dist/routes/_shared.js.map +1 -0
- package/dist/routes/accounts.d.ts +775 -0
- package/dist/routes/accounts.d.ts.map +1 -0
- package/dist/routes/accounts.js +145 -0
- package/dist/routes/accounts.js.map +1 -0
- package/dist/routes/agent-runs.d.ts +659 -0
- package/dist/routes/agent-runs.d.ts.map +1 -0
- package/dist/routes/agent-runs.js +33 -0
- package/dist/routes/agent-runs.js.map +1 -0
- package/dist/routes/api-keys.d.ts +245 -0
- package/dist/routes/api-keys.d.ts.map +1 -0
- package/dist/routes/api-keys.js +49 -0
- package/dist/routes/api-keys.js.map +1 -0
- package/dist/routes/auth.d.ts +411 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/auth.js +129 -0
- package/dist/routes/auth.js.map +1 -0
- package/dist/routes/board.d.ts +1260 -0
- package/dist/routes/board.d.ts.map +1 -0
- package/dist/routes/board.js +85 -0
- package/dist/routes/board.js.map +1 -0
- package/dist/routes/bootstrap.d.ts +395 -0
- package/dist/routes/bootstrap.d.ts.map +1 -0
- package/dist/routes/bootstrap.js +56 -0
- package/dist/routes/bootstrap.js.map +1 -0
- package/dist/routes/brainstorm.d.ts +482 -0
- package/dist/routes/brainstorm.d.ts.map +1 -0
- package/dist/routes/brainstorm.js +69 -0
- package/dist/routes/brainstorm.js.map +1 -0
- package/dist/routes/clarity.d.ts +462 -0
- package/dist/routes/clarity.d.ts.map +1 -0
- package/dist/routes/clarity.js +67 -0
- package/dist/routes/clarity.js.map +1 -0
- package/dist/routes/consensus.d.ts +71 -0
- package/dist/routes/consensus.d.ts.map +1 -0
- package/dist/routes/consensus.js +23 -0
- package/dist/routes/consensus.js.map +1 -0
- package/dist/routes/documents.d.ts +449 -0
- package/dist/routes/documents.d.ts.map +1 -0
- package/dist/routes/documents.js +89 -0
- package/dist/routes/documents.js.map +1 -0
- package/dist/routes/environments.d.ts +715 -0
- package/dist/routes/environments.d.ts.map +1 -0
- package/dist/routes/environments.js +82 -0
- package/dist/routes/environments.js.map +1 -0
- package/dist/routes/execution.d.ts +2768 -0
- package/dist/routes/execution.d.ts.map +1 -0
- package/dist/routes/execution.js +119 -0
- package/dist/routes/execution.js.map +1 -0
- package/dist/routes/followUp.d.ts +277 -0
- package/dist/routes/followUp.d.ts.map +1 -0
- package/dist/routes/followUp.js +47 -0
- package/dist/routes/followUp.js.map +1 -0
- package/dist/routes/fragment-library.d.ts +594 -0
- package/dist/routes/fragment-library.d.ts.map +1 -0
- package/dist/routes/fragment-library.js +102 -0
- package/dist/routes/fragment-library.js.map +1 -0
- package/dist/routes/github.d.ts +807 -0
- package/dist/routes/github.d.ts.map +1 -0
- package/dist/routes/github.js +157 -0
- package/dist/routes/github.js.map +1 -0
- package/dist/routes/human-review.d.ts +290 -0
- package/dist/routes/human-review.d.ts.map +1 -0
- package/dist/routes/human-review.js +20 -0
- package/dist/routes/human-review.js.map +1 -0
- package/dist/routes/human-test.d.ts +1435 -0
- package/dist/routes/human-test.d.ts.map +1 -0
- package/dist/routes/human-test.js +48 -0
- package/dist/routes/human-test.js.map +1 -0
- package/dist/routes/incident-enrichment.d.ts +110 -0
- package/dist/routes/incident-enrichment.d.ts.map +1 -0
- package/dist/routes/incident-enrichment.js +26 -0
- package/dist/routes/incident-enrichment.js.map +1 -0
- package/dist/routes/index.d.ts +47 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +50 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/kaizen.d.ts +113 -0
- package/dist/routes/kaizen.d.ts.map +1 -0
- package/dist/routes/kaizen.js +22 -0
- package/dist/routes/kaizen.js.map +1 -0
- package/dist/routes/localModels.d.ts +163 -0
- package/dist/routes/localModels.d.ts.map +1 -0
- package/dist/routes/localModels.js +41 -0
- package/dist/routes/localModels.js.map +1 -0
- package/dist/routes/localSettings.d.ts +93 -0
- package/dist/routes/localSettings.d.ts.map +1 -0
- package/dist/routes/localSettings.js +22 -0
- package/dist/routes/localSettings.js.map +1 -0
- package/dist/routes/merge.d.ts +197 -0
- package/dist/routes/merge.d.ts.map +1 -0
- package/dist/routes/merge.js +36 -0
- package/dist/routes/merge.js.map +1 -0
- package/dist/routes/model-presets.d.ts +162 -0
- package/dist/routes/model-presets.d.ts.map +1 -0
- package/dist/routes/model-presets.js +36 -0
- package/dist/routes/model-presets.js.map +1 -0
- package/dist/routes/models.d.ts +123 -0
- package/dist/routes/models.d.ts.map +1 -0
- package/dist/routes/models.js +25 -0
- package/dist/routes/models.js.map +1 -0
- package/dist/routes/notifications.d.ts +213 -0
- package/dist/routes/notifications.d.ts.map +1 -0
- package/dist/routes/notifications.js +31 -0
- package/dist/routes/notifications.js.map +1 -0
- package/dist/routes/openrouter.d.ts +145 -0
- package/dist/routes/openrouter.d.ts.map +1 -0
- package/dist/routes/openrouter.js +32 -0
- package/dist/routes/openrouter.js.map +1 -0
- package/dist/routes/personal-subscriptions.d.ts +124 -0
- package/dist/routes/personal-subscriptions.d.ts.map +1 -0
- package/dist/routes/personal-subscriptions.js +32 -0
- package/dist/routes/personal-subscriptions.js.map +1 -0
- package/dist/routes/pipelines.d.ts +457 -0
- package/dist/routes/pipelines.d.ts.map +1 -0
- package/dist/routes/pipelines.js +51 -0
- package/dist/routes/pipelines.js.map +1 -0
- package/dist/routes/prompt-fragments.d.ts +52 -0
- package/dist/routes/prompt-fragments.d.ts.map +1 -0
- package/dist/routes/prompt-fragments.js +14 -0
- package/dist/routes/prompt-fragments.js.map +1 -0
- package/dist/routes/provisioning-logs.d.ts +45 -0
- package/dist/routes/provisioning-logs.d.ts.map +1 -0
- package/dist/routes/provisioning-logs.js +14 -0
- package/dist/routes/provisioning-logs.js.map +1 -0
- package/dist/routes/recurring.d.ts +309 -0
- package/dist/routes/recurring.d.ts.map +1 -0
- package/dist/routes/recurring.js +50 -0
- package/dist/routes/recurring.js.map +1 -0
- package/dist/routes/release.d.ts +218 -0
- package/dist/routes/release.d.ts.map +1 -0
- package/dist/routes/release.js +47 -0
- package/dist/routes/release.js.map +1 -0
- package/dist/routes/requirements.d.ts +901 -0
- package/dist/routes/requirements.d.ts.map +1 -0
- package/dist/routes/requirements.js +96 -0
- package/dist/routes/requirements.js.map +1 -0
- package/dist/routes/runners.d.ts +442 -0
- package/dist/routes/runners.d.ts.map +1 -0
- package/dist/routes/runners.js +47 -0
- package/dist/routes/runners.js.map +1 -0
- package/dist/routes/sandbox.d.ts +898 -0
- package/dist/routes/sandbox.d.ts.map +1 -0
- package/dist/routes/sandbox.js +119 -0
- package/dist/routes/sandbox.js.map +1 -0
- package/dist/routes/service-fragment-defaults.d.ts +66 -0
- package/dist/routes/service-fragment-defaults.d.ts.map +1 -0
- package/dist/routes/service-fragment-defaults.js +20 -0
- package/dist/routes/service-fragment-defaults.js.map +1 -0
- package/dist/routes/services.d.ts +224 -0
- package/dist/routes/services.d.ts.map +1 -0
- package/dist/routes/services.js +44 -0
- package/dist/routes/services.js.map +1 -0
- package/dist/routes/slack.d.ts +332 -0
- package/dist/routes/slack.d.ts.map +1 -0
- package/dist/routes/slack.js +72 -0
- package/dist/routes/slack.js.map +1 -0
- package/dist/routes/spec.d.ts +76 -0
- package/dist/routes/spec.d.ts.map +1 -0
- package/dist/routes/spec.js +17 -0
- package/dist/routes/spec.js.map +1 -0
- package/dist/routes/tasks.d.ts +723 -0
- package/dist/routes/tasks.d.ts.map +1 -0
- package/dist/routes/tasks.js +108 -0
- package/dist/routes/tasks.js.map +1 -0
- package/dist/routes/tracker.d.ts +77 -0
- package/dist/routes/tracker.d.ts.map +1 -0
- package/dist/routes/tracker.js +20 -0
- package/dist/routes/tracker.js.map +1 -0
- package/dist/routes/user-secret.d.ts +231 -0
- package/dist/routes/user-secret.d.ts.map +1 -0
- package/dist/routes/user-secret.js +49 -0
- package/dist/routes/user-secret.js.map +1 -0
- package/dist/routes/vendor-credentials.d.ts +120 -0
- package/dist/routes/vendor-credentials.d.ts.map +1 -0
- package/dist/routes/vendor-credentials.js +33 -0
- package/dist/routes/vendor-credentials.js.map +1 -0
- package/dist/routes/workspace-settings.d.ts +93 -0
- package/dist/routes/workspace-settings.d.ts.map +1 -0
- package/dist/routes/workspace-settings.js +20 -0
- package/dist/routes/workspace-settings.js.map +1 -0
- package/dist/routes/workspaces.d.ts +1309 -0
- package/dist/routes/workspaces.d.ts.map +1 -0
- package/dist/routes/workspaces.js +45 -0
- package/dist/routes/workspaces.js.map +1 -0
- package/dist/slack.d.ts +2 -2
- package/dist/snapshot.d.ts +11 -1
- package/dist/snapshot.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ContractNoBody, defineApiContract, withObjectKeys } from '@toad-contracts/valibot';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { createModelPresetSchema, modelPresetSchema, updateModelPresetSchema, } from '../model-presets.js';
|
|
4
|
+
import { errorResponses } from './_shared.js';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Model preset route contracts. Mounted under `/workspaces/:workspaceId`, so the
|
|
7
|
+
// paths here are relative to that prefix. See ModelPresetController in
|
|
8
|
+
// @cat-factory/server.
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
const modelPresetListSchema = v.array(modelPresetSchema);
|
|
11
|
+
const presetIdParams = withObjectKeys(v.object({ presetId: v.string() }));
|
|
12
|
+
export const listModelPresetsContract = defineApiContract({
|
|
13
|
+
method: 'get',
|
|
14
|
+
pathResolver: () => '/model-presets',
|
|
15
|
+
responsesByStatusCode: { 200: modelPresetListSchema, ...errorResponses },
|
|
16
|
+
});
|
|
17
|
+
export const createModelPresetContract = defineApiContract({
|
|
18
|
+
method: 'post',
|
|
19
|
+
pathResolver: () => '/model-presets',
|
|
20
|
+
requestBodySchema: createModelPresetSchema,
|
|
21
|
+
responsesByStatusCode: { 201: modelPresetSchema, ...errorResponses },
|
|
22
|
+
});
|
|
23
|
+
export const updateModelPresetContract = defineApiContract({
|
|
24
|
+
method: 'patch',
|
|
25
|
+
requestPathParamsSchema: presetIdParams,
|
|
26
|
+
pathResolver: ({ presetId }) => `/model-presets/${presetId}`,
|
|
27
|
+
requestBodySchema: updateModelPresetSchema,
|
|
28
|
+
responsesByStatusCode: { 200: modelPresetSchema, ...errorResponses },
|
|
29
|
+
});
|
|
30
|
+
export const deleteModelPresetContract = defineApiContract({
|
|
31
|
+
method: 'delete',
|
|
32
|
+
requestPathParamsSchema: presetIdParams,
|
|
33
|
+
pathResolver: ({ presetId }) => `/model-presets/${presetId}`,
|
|
34
|
+
responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=model-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-presets.js","sourceRoot":"","sources":["../../src/routes/model-presets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,8EAA8E;AAC9E,iFAAiF;AACjF,uEAAuE;AACvE,uBAAuB;AACvB,8EAA8E;AAE9E,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACxD,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;AAEzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACxD,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB;IACpC,qBAAqB,EAAE,EAAE,GAAG,EAAE,qBAAqB,EAAE,GAAG,cAAc,EAAE;CACzE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACzD,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB;IACpC,iBAAiB,EAAE,uBAAuB;IAC1C,qBAAqB,EAAE,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,cAAc,EAAE;CACrE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACzD,MAAM,EAAE,OAAO;IACf,uBAAuB,EAAE,cAAc;IACvC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,kBAAkB,QAAQ,EAAE;IAC5D,iBAAiB,EAAE,uBAAuB;IAC1C,qBAAqB,EAAE,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,cAAc,EAAE;CACrE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACzD,MAAM,EAAE,QAAQ;IAChB,uBAAuB,EAAE,cAAc;IACvC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,kBAAkB,QAAQ,EAAE;IAC5D,qBAAqB,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;CAClE,CAAC,CAAA"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const listModelsContract: {
|
|
3
|
+
readonly method: "get";
|
|
4
|
+
readonly pathResolver: () => string;
|
|
5
|
+
readonly responsesByStatusCode: {
|
|
6
|
+
readonly '4xx': v.ObjectSchema<{
|
|
7
|
+
readonly error: v.ObjectSchema<{
|
|
8
|
+
readonly code: v.StringSchema<undefined>;
|
|
9
|
+
readonly message: v.StringSchema<undefined>;
|
|
10
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
11
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
12
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
13
|
+
readonly message: v.StringSchema<undefined>;
|
|
14
|
+
}, undefined>, undefined>, undefined>;
|
|
15
|
+
}, undefined>;
|
|
16
|
+
}, undefined>;
|
|
17
|
+
readonly '5xx': v.ObjectSchema<{
|
|
18
|
+
readonly error: v.ObjectSchema<{
|
|
19
|
+
readonly code: v.StringSchema<undefined>;
|
|
20
|
+
readonly message: v.StringSchema<undefined>;
|
|
21
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
22
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
23
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
24
|
+
readonly message: v.StringSchema<undefined>;
|
|
25
|
+
}, undefined>, undefined>, undefined>;
|
|
26
|
+
}, undefined>;
|
|
27
|
+
}, undefined>;
|
|
28
|
+
readonly 200: v.ArraySchema<v.ObjectSchema<{
|
|
29
|
+
readonly id: v.StringSchema<undefined>;
|
|
30
|
+
readonly label: v.StringSchema<undefined>;
|
|
31
|
+
readonly description: v.StringSchema<undefined>;
|
|
32
|
+
readonly flavor: v.PicklistSchema<["cloudflare", "direct", "openrouter", "subscription"], undefined>;
|
|
33
|
+
readonly available: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
34
|
+
readonly providerLabel: v.StringSchema<undefined>;
|
|
35
|
+
readonly provider: v.StringSchema<undefined>;
|
|
36
|
+
readonly model: v.StringSchema<undefined>;
|
|
37
|
+
readonly vendor: v.OptionalSchema<v.PicklistSchema<["claude", "codex", "glm", "kimi", "deepseek"], undefined>, undefined>;
|
|
38
|
+
readonly cost: v.OptionalSchema<v.ObjectSchema<{
|
|
39
|
+
readonly inputPerMillion: v.NumberSchema<undefined>;
|
|
40
|
+
readonly outputPerMillion: v.NumberSchema<undefined>;
|
|
41
|
+
readonly currency: v.StringSchema<undefined>;
|
|
42
|
+
}, undefined>, undefined>;
|
|
43
|
+
readonly contextTokens: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
44
|
+
readonly quotaBased: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
45
|
+
readonly subscription: v.OptionalSchema<v.ObjectSchema<{
|
|
46
|
+
readonly vendor: v.PicklistSchema<["claude", "codex", "glm", "kimi", "deepseek"], undefined>;
|
|
47
|
+
readonly providerLabel: v.StringSchema<undefined>;
|
|
48
|
+
readonly provider: v.StringSchema<undefined>;
|
|
49
|
+
readonly model: v.StringSchema<undefined>;
|
|
50
|
+
readonly cost: v.OptionalSchema<v.ObjectSchema<{
|
|
51
|
+
readonly inputPerMillion: v.NumberSchema<undefined>;
|
|
52
|
+
readonly outputPerMillion: v.NumberSchema<undefined>;
|
|
53
|
+
readonly currency: v.StringSchema<undefined>;
|
|
54
|
+
}, undefined>, undefined>;
|
|
55
|
+
readonly contextTokens: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
56
|
+
}, undefined>, undefined>;
|
|
57
|
+
}, undefined>, undefined>;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare const listWorkspaceModelsContract: {
|
|
61
|
+
readonly method: "get";
|
|
62
|
+
readonly requestPathParamsSchema: v.ObjectSchema<{
|
|
63
|
+
readonly workspaceId: v.StringSchema<undefined>;
|
|
64
|
+
}, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
|
|
65
|
+
readonly pathResolver: ({ workspaceId }: {
|
|
66
|
+
workspaceId: string;
|
|
67
|
+
}) => string;
|
|
68
|
+
readonly responsesByStatusCode: {
|
|
69
|
+
readonly '4xx': v.ObjectSchema<{
|
|
70
|
+
readonly error: v.ObjectSchema<{
|
|
71
|
+
readonly code: v.StringSchema<undefined>;
|
|
72
|
+
readonly message: v.StringSchema<undefined>;
|
|
73
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
74
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
75
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
76
|
+
readonly message: v.StringSchema<undefined>;
|
|
77
|
+
}, undefined>, undefined>, undefined>;
|
|
78
|
+
}, undefined>;
|
|
79
|
+
}, undefined>;
|
|
80
|
+
readonly '5xx': v.ObjectSchema<{
|
|
81
|
+
readonly error: v.ObjectSchema<{
|
|
82
|
+
readonly code: v.StringSchema<undefined>;
|
|
83
|
+
readonly message: v.StringSchema<undefined>;
|
|
84
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
85
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
86
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
87
|
+
readonly message: v.StringSchema<undefined>;
|
|
88
|
+
}, undefined>, undefined>, undefined>;
|
|
89
|
+
}, undefined>;
|
|
90
|
+
}, undefined>;
|
|
91
|
+
readonly 200: v.ArraySchema<v.ObjectSchema<{
|
|
92
|
+
readonly id: v.StringSchema<undefined>;
|
|
93
|
+
readonly label: v.StringSchema<undefined>;
|
|
94
|
+
readonly description: v.StringSchema<undefined>;
|
|
95
|
+
readonly flavor: v.PicklistSchema<["cloudflare", "direct", "openrouter", "subscription"], undefined>;
|
|
96
|
+
readonly available: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
97
|
+
readonly providerLabel: v.StringSchema<undefined>;
|
|
98
|
+
readonly provider: v.StringSchema<undefined>;
|
|
99
|
+
readonly model: v.StringSchema<undefined>;
|
|
100
|
+
readonly vendor: v.OptionalSchema<v.PicklistSchema<["claude", "codex", "glm", "kimi", "deepseek"], undefined>, undefined>;
|
|
101
|
+
readonly cost: v.OptionalSchema<v.ObjectSchema<{
|
|
102
|
+
readonly inputPerMillion: v.NumberSchema<undefined>;
|
|
103
|
+
readonly outputPerMillion: v.NumberSchema<undefined>;
|
|
104
|
+
readonly currency: v.StringSchema<undefined>;
|
|
105
|
+
}, undefined>, undefined>;
|
|
106
|
+
readonly contextTokens: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
107
|
+
readonly quotaBased: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
108
|
+
readonly subscription: v.OptionalSchema<v.ObjectSchema<{
|
|
109
|
+
readonly vendor: v.PicklistSchema<["claude", "codex", "glm", "kimi", "deepseek"], undefined>;
|
|
110
|
+
readonly providerLabel: v.StringSchema<undefined>;
|
|
111
|
+
readonly provider: v.StringSchema<undefined>;
|
|
112
|
+
readonly model: v.StringSchema<undefined>;
|
|
113
|
+
readonly cost: v.OptionalSchema<v.ObjectSchema<{
|
|
114
|
+
readonly inputPerMillion: v.NumberSchema<undefined>;
|
|
115
|
+
readonly outputPerMillion: v.NumberSchema<undefined>;
|
|
116
|
+
readonly currency: v.StringSchema<undefined>;
|
|
117
|
+
}, undefined>, undefined>;
|
|
118
|
+
readonly contextTokens: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
119
|
+
}, undefined>, undefined>;
|
|
120
|
+
}, undefined>, undefined>;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/routes/models.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAa5B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI7B,CAAA;AAIF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKtC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineApiContract, withObjectKeys } from '@toad-contracts/valibot';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { modelCatalogSchema } from '../entities.js';
|
|
4
|
+
import { errorResponses } from './_shared.js';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Model picker catalog route contracts. The ModelController is mounted at `/`,
|
|
7
|
+
// so both paths are absolute and `workspaceId` IS a path param. See
|
|
8
|
+
// ModelController in @cat-factory/server.
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
const workspaceIdParams = withObjectKeys(v.object({ workspaceId: v.string() }));
|
|
11
|
+
// Deployment-level catalog (no workspace context).
|
|
12
|
+
export const listModelsContract = defineApiContract({
|
|
13
|
+
method: 'get',
|
|
14
|
+
pathResolver: () => '/models',
|
|
15
|
+
responsesByStatusCode: { 200: modelCatalogSchema, ...errorResponses },
|
|
16
|
+
});
|
|
17
|
+
// Per-workspace catalog: selectability reflects the workspace's (+ account's + caller's)
|
|
18
|
+
// configured keys and subscription tokens, plus the caller's local + OpenRouter models.
|
|
19
|
+
export const listWorkspaceModelsContract = defineApiContract({
|
|
20
|
+
method: 'get',
|
|
21
|
+
requestPathParamsSchema: workspaceIdParams,
|
|
22
|
+
pathResolver: ({ workspaceId }) => `/workspaces/${workspaceId}/models`,
|
|
23
|
+
responsesByStatusCode: { 200: modelCatalogSchema, ...errorResponses },
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/routes/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,8EAA8E;AAC9E,+EAA+E;AAC/E,oEAAoE;AACpE,0CAA0C;AAC1C,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;AAE/E,mDAAmD;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IAClD,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS;IAC7B,qBAAqB,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,cAAc,EAAE;CACtE,CAAC,CAAA;AAEF,yFAAyF;AACzF,wFAAwF;AACxF,MAAM,CAAC,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;IAC3D,MAAM,EAAE,KAAK;IACb,uBAAuB,EAAE,iBAAiB;IAC1C,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,eAAe,WAAW,SAAS;IACtE,qBAAqB,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,cAAc,EAAE;CACtE,CAAC,CAAA"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { ContractNoBody } from '@toad-contracts/valibot';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
export declare const listNotificationsContract: {
|
|
4
|
+
readonly method: "get";
|
|
5
|
+
readonly pathResolver: () => string;
|
|
6
|
+
readonly responsesByStatusCode: {
|
|
7
|
+
readonly '4xx': v.ObjectSchema<{
|
|
8
|
+
readonly error: v.ObjectSchema<{
|
|
9
|
+
readonly code: v.StringSchema<undefined>;
|
|
10
|
+
readonly message: v.StringSchema<undefined>;
|
|
11
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
12
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
13
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
14
|
+
readonly message: v.StringSchema<undefined>;
|
|
15
|
+
}, undefined>, undefined>, undefined>;
|
|
16
|
+
}, undefined>;
|
|
17
|
+
}, undefined>;
|
|
18
|
+
readonly '5xx': v.ObjectSchema<{
|
|
19
|
+
readonly error: v.ObjectSchema<{
|
|
20
|
+
readonly code: v.StringSchema<undefined>;
|
|
21
|
+
readonly message: v.StringSchema<undefined>;
|
|
22
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
23
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
24
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
25
|
+
readonly message: v.StringSchema<undefined>;
|
|
26
|
+
}, undefined>, undefined>, undefined>;
|
|
27
|
+
}, undefined>;
|
|
28
|
+
}, undefined>;
|
|
29
|
+
readonly 200: v.ArraySchema<v.ObjectSchema<{
|
|
30
|
+
readonly id: v.StringSchema<undefined>;
|
|
31
|
+
readonly type: v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "human_review", "followup_pending"], undefined>;
|
|
32
|
+
readonly status: v.PicklistSchema<["open", "acted", "dismissed"], undefined>;
|
|
33
|
+
readonly severity: v.OptionalSchema<v.PicklistSchema<["normal", "urgent"], undefined>, undefined>;
|
|
34
|
+
readonly blockId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
35
|
+
readonly executionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
36
|
+
readonly title: v.StringSchema<undefined>;
|
|
37
|
+
readonly body: v.StringSchema<undefined>;
|
|
38
|
+
readonly payload: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
39
|
+
readonly assessment: v.OptionalSchema<v.ObjectSchema<{
|
|
40
|
+
readonly complexity: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
41
|
+
readonly risk: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
42
|
+
readonly impact: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
43
|
+
readonly rationale: v.StringSchema<undefined>;
|
|
44
|
+
}, undefined>, undefined>;
|
|
45
|
+
readonly prUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
46
|
+
readonly pipelineName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
47
|
+
readonly findingCount: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
48
|
+
readonly onCallAssessment: v.OptionalSchema<v.ObjectSchema<{
|
|
49
|
+
readonly culpritConfidence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
50
|
+
readonly recommendation: v.PicklistSchema<["revert", "hold", "monitor"], undefined>;
|
|
51
|
+
readonly rationale: v.StringSchema<undefined>;
|
|
52
|
+
readonly evidence: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
53
|
+
}, undefined>, undefined>;
|
|
54
|
+
readonly releaseSignals: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
55
|
+
readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
|
|
56
|
+
readonly id: v.StringSchema<undefined>;
|
|
57
|
+
readonly name: v.StringSchema<undefined>;
|
|
58
|
+
readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
|
|
59
|
+
readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
60
|
+
}, undefined>, undefined>, undefined>;
|
|
61
|
+
readonly revertUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
62
|
+
readonly targetUserId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
63
|
+
}, undefined>, undefined>, undefined>;
|
|
64
|
+
readonly createdAt: v.NumberSchema<undefined>;
|
|
65
|
+
readonly resolvedAt: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
66
|
+
}, undefined>, undefined>;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export declare const actNotificationContract: {
|
|
70
|
+
readonly method: "post";
|
|
71
|
+
readonly requestPathParamsSchema: v.ObjectSchema<{
|
|
72
|
+
readonly notificationId: v.StringSchema<undefined>;
|
|
73
|
+
}, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
|
|
74
|
+
readonly pathResolver: ({ notificationId }: {
|
|
75
|
+
notificationId: string;
|
|
76
|
+
}) => string;
|
|
77
|
+
readonly requestBodySchema: typeof ContractNoBody;
|
|
78
|
+
readonly responsesByStatusCode: {
|
|
79
|
+
readonly '4xx': v.ObjectSchema<{
|
|
80
|
+
readonly error: v.ObjectSchema<{
|
|
81
|
+
readonly code: v.StringSchema<undefined>;
|
|
82
|
+
readonly message: v.StringSchema<undefined>;
|
|
83
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
84
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
85
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
86
|
+
readonly message: v.StringSchema<undefined>;
|
|
87
|
+
}, undefined>, undefined>, undefined>;
|
|
88
|
+
}, undefined>;
|
|
89
|
+
}, undefined>;
|
|
90
|
+
readonly '5xx': v.ObjectSchema<{
|
|
91
|
+
readonly error: v.ObjectSchema<{
|
|
92
|
+
readonly code: v.StringSchema<undefined>;
|
|
93
|
+
readonly message: v.StringSchema<undefined>;
|
|
94
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
95
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
96
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
97
|
+
readonly message: v.StringSchema<undefined>;
|
|
98
|
+
}, undefined>, undefined>, undefined>;
|
|
99
|
+
}, undefined>;
|
|
100
|
+
}, undefined>;
|
|
101
|
+
readonly 200: v.ObjectSchema<{
|
|
102
|
+
readonly id: v.StringSchema<undefined>;
|
|
103
|
+
readonly type: v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "human_review", "followup_pending"], undefined>;
|
|
104
|
+
readonly status: v.PicklistSchema<["open", "acted", "dismissed"], undefined>;
|
|
105
|
+
readonly severity: v.OptionalSchema<v.PicklistSchema<["normal", "urgent"], undefined>, undefined>;
|
|
106
|
+
readonly blockId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
107
|
+
readonly executionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
108
|
+
readonly title: v.StringSchema<undefined>;
|
|
109
|
+
readonly body: v.StringSchema<undefined>;
|
|
110
|
+
readonly payload: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
111
|
+
readonly assessment: v.OptionalSchema<v.ObjectSchema<{
|
|
112
|
+
readonly complexity: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
113
|
+
readonly risk: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
114
|
+
readonly impact: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
115
|
+
readonly rationale: v.StringSchema<undefined>;
|
|
116
|
+
}, undefined>, undefined>;
|
|
117
|
+
readonly prUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
118
|
+
readonly pipelineName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
119
|
+
readonly findingCount: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
120
|
+
readonly onCallAssessment: v.OptionalSchema<v.ObjectSchema<{
|
|
121
|
+
readonly culpritConfidence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
122
|
+
readonly recommendation: v.PicklistSchema<["revert", "hold", "monitor"], undefined>;
|
|
123
|
+
readonly rationale: v.StringSchema<undefined>;
|
|
124
|
+
readonly evidence: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
125
|
+
}, undefined>, undefined>;
|
|
126
|
+
readonly releaseSignals: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
127
|
+
readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
|
|
128
|
+
readonly id: v.StringSchema<undefined>;
|
|
129
|
+
readonly name: v.StringSchema<undefined>;
|
|
130
|
+
readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
|
|
131
|
+
readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
132
|
+
}, undefined>, undefined>, undefined>;
|
|
133
|
+
readonly revertUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
134
|
+
readonly targetUserId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
135
|
+
}, undefined>, undefined>, undefined>;
|
|
136
|
+
readonly createdAt: v.NumberSchema<undefined>;
|
|
137
|
+
readonly resolvedAt: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
138
|
+
}, undefined>;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
export declare const dismissNotificationContract: {
|
|
142
|
+
readonly method: "post";
|
|
143
|
+
readonly requestPathParamsSchema: v.ObjectSchema<{
|
|
144
|
+
readonly notificationId: v.StringSchema<undefined>;
|
|
145
|
+
}, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
|
|
146
|
+
readonly pathResolver: ({ notificationId }: {
|
|
147
|
+
notificationId: string;
|
|
148
|
+
}) => string;
|
|
149
|
+
readonly requestBodySchema: typeof ContractNoBody;
|
|
150
|
+
readonly responsesByStatusCode: {
|
|
151
|
+
readonly '4xx': v.ObjectSchema<{
|
|
152
|
+
readonly error: v.ObjectSchema<{
|
|
153
|
+
readonly code: v.StringSchema<undefined>;
|
|
154
|
+
readonly message: v.StringSchema<undefined>;
|
|
155
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
156
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
157
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
158
|
+
readonly message: v.StringSchema<undefined>;
|
|
159
|
+
}, undefined>, undefined>, undefined>;
|
|
160
|
+
}, undefined>;
|
|
161
|
+
}, undefined>;
|
|
162
|
+
readonly '5xx': v.ObjectSchema<{
|
|
163
|
+
readonly error: v.ObjectSchema<{
|
|
164
|
+
readonly code: v.StringSchema<undefined>;
|
|
165
|
+
readonly message: v.StringSchema<undefined>;
|
|
166
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
167
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
168
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
169
|
+
readonly message: v.StringSchema<undefined>;
|
|
170
|
+
}, undefined>, undefined>, undefined>;
|
|
171
|
+
}, undefined>;
|
|
172
|
+
}, undefined>;
|
|
173
|
+
readonly 200: v.ObjectSchema<{
|
|
174
|
+
readonly id: v.StringSchema<undefined>;
|
|
175
|
+
readonly type: v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "human_review", "followup_pending"], undefined>;
|
|
176
|
+
readonly status: v.PicklistSchema<["open", "acted", "dismissed"], undefined>;
|
|
177
|
+
readonly severity: v.OptionalSchema<v.PicklistSchema<["normal", "urgent"], undefined>, undefined>;
|
|
178
|
+
readonly blockId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
179
|
+
readonly executionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
180
|
+
readonly title: v.StringSchema<undefined>;
|
|
181
|
+
readonly body: v.StringSchema<undefined>;
|
|
182
|
+
readonly payload: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
183
|
+
readonly assessment: v.OptionalSchema<v.ObjectSchema<{
|
|
184
|
+
readonly complexity: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
185
|
+
readonly risk: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
186
|
+
readonly impact: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
187
|
+
readonly rationale: v.StringSchema<undefined>;
|
|
188
|
+
}, undefined>, undefined>;
|
|
189
|
+
readonly prUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
190
|
+
readonly pipelineName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
191
|
+
readonly findingCount: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
192
|
+
readonly onCallAssessment: v.OptionalSchema<v.ObjectSchema<{
|
|
193
|
+
readonly culpritConfidence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
194
|
+
readonly recommendation: v.PicklistSchema<["revert", "hold", "monitor"], undefined>;
|
|
195
|
+
readonly rationale: v.StringSchema<undefined>;
|
|
196
|
+
readonly evidence: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
197
|
+
}, undefined>, undefined>;
|
|
198
|
+
readonly releaseSignals: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
199
|
+
readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
|
|
200
|
+
readonly id: v.StringSchema<undefined>;
|
|
201
|
+
readonly name: v.StringSchema<undefined>;
|
|
202
|
+
readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
|
|
203
|
+
readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
204
|
+
}, undefined>, undefined>, undefined>;
|
|
205
|
+
readonly revertUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
206
|
+
readonly targetUserId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
207
|
+
}, undefined>, undefined>, undefined>;
|
|
208
|
+
readonly createdAt: v.NumberSchema<undefined>;
|
|
209
|
+
readonly resolvedAt: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
210
|
+
}, undefined>;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/routes/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqC,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAa5B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMlC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMtC,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ContractNoBody, defineApiContract, withObjectKeys } from '@toad-contracts/valibot';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { notificationSchema } from '../notifications.js';
|
|
4
|
+
import { errorResponses } from './_shared.js';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Notification inbox route contracts. Mounted under `/workspaces/:workspaceId`,
|
|
7
|
+
// so the paths here are relative to that prefix (the frontend supplies it via
|
|
8
|
+
// `pathPrefix`, the backend via the controller's mount point).
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
const notificationListSchema = v.array(notificationSchema);
|
|
11
|
+
const notificationIdParams = withObjectKeys(v.object({ notificationId: v.string() }));
|
|
12
|
+
export const listNotificationsContract = defineApiContract({
|
|
13
|
+
method: 'get',
|
|
14
|
+
pathResolver: () => '/notifications',
|
|
15
|
+
responsesByStatusCode: { 200: notificationListSchema, ...errorResponses },
|
|
16
|
+
});
|
|
17
|
+
export const actNotificationContract = defineApiContract({
|
|
18
|
+
method: 'post',
|
|
19
|
+
requestPathParamsSchema: notificationIdParams,
|
|
20
|
+
pathResolver: ({ notificationId }) => `/notifications/${notificationId}/act`,
|
|
21
|
+
requestBodySchema: ContractNoBody,
|
|
22
|
+
responsesByStatusCode: { 200: notificationSchema, ...errorResponses },
|
|
23
|
+
});
|
|
24
|
+
export const dismissNotificationContract = defineApiContract({
|
|
25
|
+
method: 'post',
|
|
26
|
+
requestPathParamsSchema: notificationIdParams,
|
|
27
|
+
pathResolver: ({ notificationId }) => `/notifications/${notificationId}/dismiss`,
|
|
28
|
+
requestBodySchema: ContractNoBody,
|
|
29
|
+
responsesByStatusCode: { 200: notificationSchema, ...errorResponses },
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../src/routes/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAC9E,+DAA+D;AAC/D,8EAA8E;AAE9E,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;AAC1D,MAAM,oBAAoB,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;AAErF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACzD,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB;IACpC,qBAAqB,EAAE,EAAE,GAAG,EAAE,sBAAsB,EAAE,GAAG,cAAc,EAAE;CAC1E,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACvD,MAAM,EAAE,MAAM;IACd,uBAAuB,EAAE,oBAAoB;IAC7C,YAAY,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,kBAAkB,cAAc,MAAM;IAC5E,iBAAiB,EAAE,cAAc;IACjC,qBAAqB,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,cAAc,EAAE;CACtE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;IAC3D,MAAM,EAAE,MAAM;IACd,uBAAuB,EAAE,oBAAoB;IAC7C,YAAY,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,kBAAkB,cAAc,UAAU;IAChF,iBAAiB,EAAE,cAAc;IACjC,qBAAqB,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,cAAc,EAAE;CACtE,CAAC,CAAA"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { ContractNoBody } from '@toad-contracts/valibot';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
export declare const getOpenRouterCatalogContract: {
|
|
4
|
+
readonly method: "get";
|
|
5
|
+
readonly requestPathParamsSchema: v.ObjectSchema<{
|
|
6
|
+
readonly workspaceId: v.StringSchema<undefined>;
|
|
7
|
+
}, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
|
|
8
|
+
readonly pathResolver: ({ workspaceId }: {
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
}) => string;
|
|
11
|
+
readonly responsesByStatusCode: {
|
|
12
|
+
readonly '4xx': v.ObjectSchema<{
|
|
13
|
+
readonly error: v.ObjectSchema<{
|
|
14
|
+
readonly code: v.StringSchema<undefined>;
|
|
15
|
+
readonly message: v.StringSchema<undefined>;
|
|
16
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
17
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
18
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
19
|
+
readonly message: v.StringSchema<undefined>;
|
|
20
|
+
}, undefined>, undefined>, undefined>;
|
|
21
|
+
}, undefined>;
|
|
22
|
+
}, undefined>;
|
|
23
|
+
readonly '5xx': v.ObjectSchema<{
|
|
24
|
+
readonly error: v.ObjectSchema<{
|
|
25
|
+
readonly code: v.StringSchema<undefined>;
|
|
26
|
+
readonly message: v.StringSchema<undefined>;
|
|
27
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
28
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
29
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
30
|
+
readonly message: v.StringSchema<undefined>;
|
|
31
|
+
}, undefined>, undefined>, undefined>;
|
|
32
|
+
}, undefined>;
|
|
33
|
+
}, undefined>;
|
|
34
|
+
readonly 200: v.ObjectSchema<{
|
|
35
|
+
readonly models: v.ArraySchema<v.ObjectSchema<{
|
|
36
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
37
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
38
|
+
readonly contextLength: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
39
|
+
readonly inputPerMillion: v.NumberSchema<undefined>;
|
|
40
|
+
readonly outputPerMillion: v.NumberSchema<undefined>;
|
|
41
|
+
}, undefined>, undefined>;
|
|
42
|
+
readonly createdAt: v.NumberSchema<undefined>;
|
|
43
|
+
readonly updatedAt: v.NumberSchema<undefined>;
|
|
44
|
+
}, undefined>;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare const upsertOpenRouterCatalogContract: {
|
|
48
|
+
readonly method: "put";
|
|
49
|
+
readonly requestPathParamsSchema: v.ObjectSchema<{
|
|
50
|
+
readonly workspaceId: v.StringSchema<undefined>;
|
|
51
|
+
}, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
|
|
52
|
+
readonly pathResolver: ({ workspaceId }: {
|
|
53
|
+
workspaceId: string;
|
|
54
|
+
}) => string;
|
|
55
|
+
readonly requestBodySchema: v.ObjectSchema<{
|
|
56
|
+
readonly models: v.ArraySchema<v.ObjectSchema<{
|
|
57
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
58
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
59
|
+
readonly contextLength: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
60
|
+
readonly inputPerMillion: v.NumberSchema<undefined>;
|
|
61
|
+
readonly outputPerMillion: v.NumberSchema<undefined>;
|
|
62
|
+
}, undefined>, undefined>;
|
|
63
|
+
}, undefined>;
|
|
64
|
+
readonly responsesByStatusCode: {
|
|
65
|
+
readonly '4xx': v.ObjectSchema<{
|
|
66
|
+
readonly error: v.ObjectSchema<{
|
|
67
|
+
readonly code: v.StringSchema<undefined>;
|
|
68
|
+
readonly message: v.StringSchema<undefined>;
|
|
69
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
70
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
71
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
72
|
+
readonly message: v.StringSchema<undefined>;
|
|
73
|
+
}, undefined>, undefined>, undefined>;
|
|
74
|
+
}, undefined>;
|
|
75
|
+
}, undefined>;
|
|
76
|
+
readonly '5xx': v.ObjectSchema<{
|
|
77
|
+
readonly error: v.ObjectSchema<{
|
|
78
|
+
readonly code: v.StringSchema<undefined>;
|
|
79
|
+
readonly message: v.StringSchema<undefined>;
|
|
80
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
81
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
82
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
83
|
+
readonly message: v.StringSchema<undefined>;
|
|
84
|
+
}, undefined>, undefined>, undefined>;
|
|
85
|
+
}, undefined>;
|
|
86
|
+
}, undefined>;
|
|
87
|
+
readonly 200: v.ObjectSchema<{
|
|
88
|
+
readonly models: v.ArraySchema<v.ObjectSchema<{
|
|
89
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
90
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
91
|
+
readonly contextLength: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
92
|
+
readonly inputPerMillion: v.NumberSchema<undefined>;
|
|
93
|
+
readonly outputPerMillion: v.NumberSchema<undefined>;
|
|
94
|
+
}, undefined>, undefined>;
|
|
95
|
+
readonly createdAt: v.NumberSchema<undefined>;
|
|
96
|
+
readonly updatedAt: v.NumberSchema<undefined>;
|
|
97
|
+
}, undefined>;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export declare const refreshOpenRouterCatalogContract: {
|
|
101
|
+
readonly method: "post";
|
|
102
|
+
readonly requestPathParamsSchema: v.ObjectSchema<{
|
|
103
|
+
readonly workspaceId: v.StringSchema<undefined>;
|
|
104
|
+
}, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
|
|
105
|
+
readonly pathResolver: ({ workspaceId }: {
|
|
106
|
+
workspaceId: string;
|
|
107
|
+
}) => string;
|
|
108
|
+
readonly requestBodySchema: typeof ContractNoBody;
|
|
109
|
+
readonly responsesByStatusCode: {
|
|
110
|
+
readonly '4xx': v.ObjectSchema<{
|
|
111
|
+
readonly error: v.ObjectSchema<{
|
|
112
|
+
readonly code: v.StringSchema<undefined>;
|
|
113
|
+
readonly message: v.StringSchema<undefined>;
|
|
114
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
115
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
116
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
117
|
+
readonly message: v.StringSchema<undefined>;
|
|
118
|
+
}, undefined>, undefined>, undefined>;
|
|
119
|
+
}, undefined>;
|
|
120
|
+
}, undefined>;
|
|
121
|
+
readonly '5xx': v.ObjectSchema<{
|
|
122
|
+
readonly error: v.ObjectSchema<{
|
|
123
|
+
readonly code: v.StringSchema<undefined>;
|
|
124
|
+
readonly message: v.StringSchema<undefined>;
|
|
125
|
+
readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
126
|
+
readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
127
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
128
|
+
readonly message: v.StringSchema<undefined>;
|
|
129
|
+
}, undefined>, undefined>, undefined>;
|
|
130
|
+
}, undefined>;
|
|
131
|
+
}, undefined>;
|
|
132
|
+
readonly 200: v.ObjectSchema<{
|
|
133
|
+
readonly reachable: v.BooleanSchema<undefined>;
|
|
134
|
+
readonly models: v.ArraySchema<v.ObjectSchema<{
|
|
135
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
136
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
137
|
+
readonly contextLength: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
138
|
+
readonly inputPerMillion: v.NumberSchema<undefined>;
|
|
139
|
+
readonly outputPerMillion: v.NumberSchema<undefined>;
|
|
140
|
+
}, undefined>, undefined>;
|
|
141
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
142
|
+
}, undefined>;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=openrouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openrouter.d.ts","sourceRoot":"","sources":["../../src/routes/openrouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqC,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAiB5B,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKvC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM1C,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM3C,CAAA"}
|