@camstack/types 1.2.345 → 1.2.347
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/capabilities/training-provider.cap.d.ts +15 -9
- package/dist/index.js +23 -11
- package/dist/index.mjs +23 -11
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { ConfigUISchema } from '../interfaces/config-ui.js';
|
|
2
3
|
import { type InferProvider } from './capability-definition.js';
|
|
3
4
|
/**
|
|
4
5
|
* `training-provider` — ONE cloud that can run the CamStack trainer.
|
|
@@ -56,8 +57,11 @@ export declare const TrainingProviderTypeSchema: z.ZodObject<{
|
|
|
56
57
|
label: z.ZodString;
|
|
57
58
|
iconAsset: z.ZodString;
|
|
58
59
|
addonId: z.ZodString;
|
|
60
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
59
61
|
}, z.core.$strip>;
|
|
60
|
-
export type TrainingProviderType = z.infer<typeof TrainingProviderTypeSchema
|
|
62
|
+
export type TrainingProviderType = Omit<z.infer<typeof TrainingProviderTypeSchema>, 'configSchema'> & {
|
|
63
|
+
readonly configSchema?: ConfigUISchema;
|
|
64
|
+
};
|
|
61
65
|
/** One configured account / workspace under a provider type. */
|
|
62
66
|
export declare const TrainingProviderEntrySchema: z.ZodObject<{
|
|
63
67
|
entryId: z.ZodString;
|
|
@@ -98,20 +102,21 @@ export declare const TrainingProviderDescriptorSchema: z.ZodObject<{
|
|
|
98
102
|
maxRuntimeSec: z.ZodNumber;
|
|
99
103
|
failedDatasetGraceHours: z.ZodNumber;
|
|
100
104
|
}, z.core.$strip>;
|
|
101
|
-
|
|
102
|
-
environment: z.ZodOptional<z.ZodString>;
|
|
103
|
-
hasTokenSecret: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
formValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
104
106
|
}, z.core.$strip>;
|
|
105
107
|
export type TrainingProviderDescriptor = z.infer<typeof TrainingProviderDescriptorSchema>;
|
|
106
108
|
/**
|
|
107
109
|
* Patch one entry's name, credentials and defaults. Pin with owning `{ addonId }`.
|
|
108
110
|
* An omitted or empty `tokenSecret` means KEEP the stored secret (D787).
|
|
111
|
+
* `{ $secretClear: true }` clears it.
|
|
109
112
|
*/
|
|
110
113
|
export declare const TrainingProviderUpdateEntryInputSchema: z.ZodObject<{
|
|
111
114
|
entryId: z.ZodString;
|
|
112
115
|
name: z.ZodString;
|
|
113
116
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
114
|
-
tokenSecret: z.ZodOptional<z.ZodString
|
|
117
|
+
tokenSecret: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
118
|
+
$secretClear: z.ZodLiteral<true>;
|
|
119
|
+
}, z.core.$strip>]>>;
|
|
115
120
|
environment: z.ZodOptional<z.ZodString>;
|
|
116
121
|
gpuType: z.ZodOptional<z.ZodString>;
|
|
117
122
|
region: z.ZodOptional<z.ZodString>;
|
|
@@ -221,9 +226,7 @@ export declare const trainingProviderCapability: {
|
|
|
221
226
|
maxRuntimeSec: z.ZodNumber;
|
|
222
227
|
failedDatasetGraceHours: z.ZodNumber;
|
|
223
228
|
}, z.core.$strip>;
|
|
224
|
-
|
|
225
|
-
environment: z.ZodOptional<z.ZodString>;
|
|
226
|
-
hasTokenSecret: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
+
formValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
227
230
|
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
228
231
|
/** Creatable types for the Add-entry dialog. Concat-fans. */
|
|
229
232
|
readonly describeTypes: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -231,6 +234,7 @@ export declare const trainingProviderCapability: {
|
|
|
231
234
|
label: z.ZodString;
|
|
232
235
|
iconAsset: z.ZodString;
|
|
233
236
|
addonId: z.ZodString;
|
|
237
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
234
238
|
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
235
239
|
/** Configured entries (pills). Concat-fans. */
|
|
236
240
|
readonly listEntries: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -264,7 +268,9 @@ export declare const trainingProviderCapability: {
|
|
|
264
268
|
entryId: z.ZodString;
|
|
265
269
|
name: z.ZodString;
|
|
266
270
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
267
|
-
tokenSecret: z.ZodOptional<z.ZodString
|
|
271
|
+
tokenSecret: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
272
|
+
$secretClear: z.ZodLiteral<true>;
|
|
273
|
+
}, z.core.$strip>]>>;
|
|
268
274
|
environment: z.ZodOptional<z.ZodString>;
|
|
269
275
|
gpuType: z.ZodOptional<z.ZodString>;
|
|
270
276
|
region: z.ZodOptional<z.ZodString>;
|
package/dist/index.js
CHANGED
|
@@ -17814,14 +17814,14 @@ var LlmProfileSchema = zod.z.object({
|
|
|
17814
17814
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
17815
17815
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
17816
17816
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
17817
|
-
var ConfigSchemaPassthrough$
|
|
17817
|
+
var ConfigSchemaPassthrough$2 = zod.z.unknown();
|
|
17818
17818
|
var LlmProfileKindDescriptorSchema = zod.z.object({
|
|
17819
17819
|
kind: LlmProfileKindSchema,
|
|
17820
17820
|
label: zod.z.string(),
|
|
17821
17821
|
icon: zod.z.string(),
|
|
17822
17822
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
17823
17823
|
addonId: zod.z.string(),
|
|
17824
|
-
configSchema: ConfigSchemaPassthrough$
|
|
17824
|
+
configSchema: ConfigSchemaPassthrough$2
|
|
17825
17825
|
});
|
|
17826
17826
|
var LlmDefaultSelectorSchema = zod.z.union([zod.z.object({ consumer: zod.z.string() }), zod.z.object({ purpose: zod.z.enum(["text", "vision"]) })]);
|
|
17827
17827
|
var LlmDefaultSchema = zod.z.object({
|
|
@@ -19321,7 +19321,7 @@ var TargetKindCapsSchema = zod.z.object({
|
|
|
19321
19321
|
* the union is large and not meant for runtime validation here; the exported
|
|
19322
19322
|
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
19323
19323
|
*/
|
|
19324
|
-
var ConfigSchemaPassthrough = zod.z.unknown();
|
|
19324
|
+
var ConfigSchemaPassthrough$1 = zod.z.unknown();
|
|
19325
19325
|
var TargetKindSchema = zod.z.object({
|
|
19326
19326
|
kind: zod.z.string(),
|
|
19327
19327
|
label: zod.z.string(),
|
|
@@ -19358,7 +19358,7 @@ var TargetKindSchema = zod.z.object({
|
|
|
19358
19358
|
* its raster path, which is the safe default for an unknown image.
|
|
19359
19359
|
*/
|
|
19360
19360
|
iconMediaType: zod.z.string().optional(),
|
|
19361
|
-
configSchema: ConfigSchemaPassthrough,
|
|
19361
|
+
configSchema: ConfigSchemaPassthrough$1,
|
|
19362
19362
|
/**
|
|
19363
19363
|
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
19364
19364
|
* base URL, instance, chat, recipient). A save that changes any of them
|
|
@@ -49972,6 +49972,12 @@ var TrainingProviderDefaultsSchema = zod.z.object({
|
|
|
49972
49972
|
/** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
|
|
49973
49973
|
failedDatasetGraceHours: zod.z.number().nonnegative()
|
|
49974
49974
|
});
|
|
49975
|
+
/**
|
|
49976
|
+
* Entry form schema for a provider type — same seam as notification
|
|
49977
|
+
* `TargetKind.configSchema` (`z.unknown()` at the wire; callers tighten to
|
|
49978
|
+
* {@link ConfigUISchema}). Drives `ConfigFormBuilder` on Training → Providers.
|
|
49979
|
+
*/
|
|
49980
|
+
var ConfigSchemaPassthrough = zod.z.unknown();
|
|
49975
49981
|
/** One creatable provider type, for the Add-entry dialog. */
|
|
49976
49982
|
var TrainingProviderTypeSchema = zod.z.object({
|
|
49977
49983
|
typeId: zod.z.string(),
|
|
@@ -49979,7 +49985,13 @@ var TrainingProviderTypeSchema = zod.z.object({
|
|
|
49979
49985
|
/** Path under the addon package (e.g. `assets/training-modal/icon.svg`). */
|
|
49980
49986
|
iconAsset: zod.z.string(),
|
|
49981
49987
|
/** Owning `training-provider` addon — collection selector for createEntry. */
|
|
49982
|
-
addonId: zod.z.string()
|
|
49988
|
+
addonId: zod.z.string(),
|
|
49989
|
+
/**
|
|
49990
|
+
* Fields for one entry of this type (credentials + defaults). Absent on a
|
|
49991
|
+
* type that only needs a name. Password fields are keychain-backed on the
|
|
49992
|
+
* provider addon (`secretStatePaths`), not D634 plaintext.
|
|
49993
|
+
*/
|
|
49994
|
+
configSchema: ConfigSchemaPassthrough.optional()
|
|
49983
49995
|
});
|
|
49984
49996
|
/** One configured account / workspace under a provider type. */
|
|
49985
49997
|
var TrainingProviderEntrySchema = zod.z.object({
|
|
@@ -50011,22 +50023,22 @@ var TrainingProviderDescriptorSchema = zod.z.object({
|
|
|
50011
50023
|
configured: zod.z.boolean(),
|
|
50012
50024
|
defaults: TrainingProviderDefaultsSchema,
|
|
50013
50025
|
/**
|
|
50014
|
-
*
|
|
50015
|
-
*
|
|
50026
|
+
* Values for {@link TrainingProviderTypeSchema}'s `configSchema` — password
|
|
50027
|
+
* fields are keychain {@link SecretFieldView} or `null` / `''` (create),
|
|
50028
|
+
* never plaintext. Same hydrate contract as settings forms (D789).
|
|
50016
50029
|
*/
|
|
50017
|
-
|
|
50018
|
-
environment: zod.z.string().optional(),
|
|
50019
|
-
hasTokenSecret: zod.z.boolean().optional()
|
|
50030
|
+
formValues: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
50020
50031
|
});
|
|
50021
50032
|
/**
|
|
50022
50033
|
* Patch one entry's name, credentials and defaults. Pin with owning `{ addonId }`.
|
|
50023
50034
|
* An omitted or empty `tokenSecret` means KEEP the stored secret (D787).
|
|
50035
|
+
* `{ $secretClear: true }` clears it.
|
|
50024
50036
|
*/
|
|
50025
50037
|
var TrainingProviderUpdateEntryInputSchema = zod.z.object({
|
|
50026
50038
|
entryId: zod.z.string().min(1),
|
|
50027
50039
|
name: zod.z.string().min(1),
|
|
50028
50040
|
tokenId: zod.z.string().optional(),
|
|
50029
|
-
tokenSecret: zod.z.string().optional(),
|
|
50041
|
+
tokenSecret: zod.z.union([zod.z.string(), zod.z.object({ $secretClear: zod.z.literal(true) })]).optional(),
|
|
50030
50042
|
environment: zod.z.string().optional(),
|
|
50031
50043
|
gpuType: zod.z.string().optional(),
|
|
50032
50044
|
region: zod.z.string().optional(),
|
package/dist/index.mjs
CHANGED
|
@@ -17813,14 +17813,14 @@ var LlmProfileSchema = z.object({
|
|
|
17813
17813
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
17814
17814
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
17815
17815
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
17816
|
-
var ConfigSchemaPassthrough$
|
|
17816
|
+
var ConfigSchemaPassthrough$2 = z.unknown();
|
|
17817
17817
|
var LlmProfileKindDescriptorSchema = z.object({
|
|
17818
17818
|
kind: LlmProfileKindSchema,
|
|
17819
17819
|
label: z.string(),
|
|
17820
17820
|
icon: z.string(),
|
|
17821
17821
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
17822
17822
|
addonId: z.string(),
|
|
17823
|
-
configSchema: ConfigSchemaPassthrough$
|
|
17823
|
+
configSchema: ConfigSchemaPassthrough$2
|
|
17824
17824
|
});
|
|
17825
17825
|
var LlmDefaultSelectorSchema = z.union([z.object({ consumer: z.string() }), z.object({ purpose: z.enum(["text", "vision"]) })]);
|
|
17826
17826
|
var LlmDefaultSchema = z.object({
|
|
@@ -19320,7 +19320,7 @@ var TargetKindCapsSchema = z.object({
|
|
|
19320
19320
|
* the union is large and not meant for runtime validation here; the exported
|
|
19321
19321
|
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
19322
19322
|
*/
|
|
19323
|
-
var ConfigSchemaPassthrough = z.unknown();
|
|
19323
|
+
var ConfigSchemaPassthrough$1 = z.unknown();
|
|
19324
19324
|
var TargetKindSchema = z.object({
|
|
19325
19325
|
kind: z.string(),
|
|
19326
19326
|
label: z.string(),
|
|
@@ -19357,7 +19357,7 @@ var TargetKindSchema = z.object({
|
|
|
19357
19357
|
* its raster path, which is the safe default for an unknown image.
|
|
19358
19358
|
*/
|
|
19359
19359
|
iconMediaType: z.string().optional(),
|
|
19360
|
-
configSchema: ConfigSchemaPassthrough,
|
|
19360
|
+
configSchema: ConfigSchemaPassthrough$1,
|
|
19361
19361
|
/**
|
|
19362
19362
|
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
19363
19363
|
* base URL, instance, chat, recipient). A save that changes any of them
|
|
@@ -49971,6 +49971,12 @@ var TrainingProviderDefaultsSchema = z.object({
|
|
|
49971
49971
|
/** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
|
|
49972
49972
|
failedDatasetGraceHours: z.number().nonnegative()
|
|
49973
49973
|
});
|
|
49974
|
+
/**
|
|
49975
|
+
* Entry form schema for a provider type — same seam as notification
|
|
49976
|
+
* `TargetKind.configSchema` (`z.unknown()` at the wire; callers tighten to
|
|
49977
|
+
* {@link ConfigUISchema}). Drives `ConfigFormBuilder` on Training → Providers.
|
|
49978
|
+
*/
|
|
49979
|
+
var ConfigSchemaPassthrough = z.unknown();
|
|
49974
49980
|
/** One creatable provider type, for the Add-entry dialog. */
|
|
49975
49981
|
var TrainingProviderTypeSchema = z.object({
|
|
49976
49982
|
typeId: z.string(),
|
|
@@ -49978,7 +49984,13 @@ var TrainingProviderTypeSchema = z.object({
|
|
|
49978
49984
|
/** Path under the addon package (e.g. `assets/training-modal/icon.svg`). */
|
|
49979
49985
|
iconAsset: z.string(),
|
|
49980
49986
|
/** Owning `training-provider` addon — collection selector for createEntry. */
|
|
49981
|
-
addonId: z.string()
|
|
49987
|
+
addonId: z.string(),
|
|
49988
|
+
/**
|
|
49989
|
+
* Fields for one entry of this type (credentials + defaults). Absent on a
|
|
49990
|
+
* type that only needs a name. Password fields are keychain-backed on the
|
|
49991
|
+
* provider addon (`secretStatePaths`), not D634 plaintext.
|
|
49992
|
+
*/
|
|
49993
|
+
configSchema: ConfigSchemaPassthrough.optional()
|
|
49982
49994
|
});
|
|
49983
49995
|
/** One configured account / workspace under a provider type. */
|
|
49984
49996
|
var TrainingProviderEntrySchema = z.object({
|
|
@@ -50010,22 +50022,22 @@ var TrainingProviderDescriptorSchema = z.object({
|
|
|
50010
50022
|
configured: z.boolean(),
|
|
50011
50023
|
defaults: TrainingProviderDefaultsSchema,
|
|
50012
50024
|
/**
|
|
50013
|
-
*
|
|
50014
|
-
*
|
|
50025
|
+
* Values for {@link TrainingProviderTypeSchema}'s `configSchema` — password
|
|
50026
|
+
* fields are keychain {@link SecretFieldView} or `null` / `''` (create),
|
|
50027
|
+
* never plaintext. Same hydrate contract as settings forms (D789).
|
|
50015
50028
|
*/
|
|
50016
|
-
|
|
50017
|
-
environment: z.string().optional(),
|
|
50018
|
-
hasTokenSecret: z.boolean().optional()
|
|
50029
|
+
formValues: z.record(z.string(), z.unknown()).optional()
|
|
50019
50030
|
});
|
|
50020
50031
|
/**
|
|
50021
50032
|
* Patch one entry's name, credentials and defaults. Pin with owning `{ addonId }`.
|
|
50022
50033
|
* An omitted or empty `tokenSecret` means KEEP the stored secret (D787).
|
|
50034
|
+
* `{ $secretClear: true }` clears it.
|
|
50023
50035
|
*/
|
|
50024
50036
|
var TrainingProviderUpdateEntryInputSchema = z.object({
|
|
50025
50037
|
entryId: z.string().min(1),
|
|
50026
50038
|
name: z.string().min(1),
|
|
50027
50039
|
tokenId: z.string().optional(),
|
|
50028
|
-
tokenSecret: z.string().optional(),
|
|
50040
|
+
tokenSecret: z.union([z.string(), z.object({ $secretClear: z.literal(true) })]).optional(),
|
|
50029
50041
|
environment: z.string().optional(),
|
|
50030
50042
|
gpuType: z.string().optional(),
|
|
50031
50043
|
region: z.string().optional(),
|