@agentage/extension 0.12.2 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,5 +27,10 @@ false); `file` and `line` are there only when a problem has them:
27
27
  }
28
28
  ```
29
29
 
30
+ Secrets: `agentage.secrets` lists names, never values. A plain name is mounted in every part
31
+ but ui; `{ "name": "github-app-key", "parts": ["worker"] }` only in the parts it names. Any
32
+ other part starts without it, and a read of `ctx.secrets.githubAppKey` there throws. A test
33
+ takes a part's view with `createTestContext({ extension: { part: 'worker' } })`.
34
+
30
35
  See the [platform README](https://github.com/agentage/platform#readme) for every part kind, the
31
36
  manifest, the tool and how a part image runs.
@@ -1,2 +1,4 @@
1
+ import { type ExtensionPackage } from '../manifest/manifest.schema.js';
1
2
  import { type ExtensionInfo } from './context.js';
3
+ export declare const packageManifest: (dir?: string) => ExtensionPackage | undefined;
2
4
  export declare const packageExtension: (dir?: string) => Partial<ExtensionInfo>;
@@ -12,11 +12,12 @@ const readJson = (file) => {
12
12
  }
13
13
  };
14
14
  // The id, version and store kind of the package a test runs in; nothing outside an extension.
15
+ export const packageManifest = (dir = process.cwd()) => PackageSchema.safeParse(readJson(join(dir, 'package.json'))).data;
15
16
  export const packageExtension = (dir = process.cwd()) => {
16
- const parsed = PackageSchema.safeParse(readJson(join(dir, 'package.json')));
17
- if (!parsed.success)
17
+ const pkg = packageManifest(dir);
18
+ if (!pkg)
18
19
  return {};
19
- const { version, agentage } = parsed.data;
20
- const store = storeOf(parsed.data);
20
+ const { version, agentage } = pkg;
21
+ const store = storeOf(pkg);
21
22
  return { id: agentage.id, version, ...(store && { store }) };
22
23
  };
@@ -1,5 +1,7 @@
1
+ import { type ExtensionPackage } from '../manifest/manifest.schema.js';
2
+ import { type ImagePartKind as Part } from '../manifest/primitives.schema.js';
1
3
  export interface Secrets {
2
4
  }
3
5
  export declare const SECRETS_DIR = "/run/secrets";
4
- export declare const camelName: (name: string) => string;
5
- export declare const readSecrets: (names: readonly string[], dir: string, part: string) => Promise<Readonly<Record<string, string>>>;
6
+ export declare const readSecrets: (pkg: ExtensionPackage, part: Part, dir: string) => Promise<Readonly<Record<string, string>>>;
7
+ export declare const withAbsent: (values: Record<string, string>, part: Part, pkg?: ExtensionPackage) => Record<string, string>;
@@ -1,7 +1,9 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
+ import {} from '../manifest/manifest.schema.js';
4
+ import { mountedIn, unmountedIn } from '../manifest/parts.js';
5
+ import { camelName } from '../manifest/primitives.schema.js';
3
6
  export const SECRETS_DIR = '/run/secrets';
4
- export const camelName = (name) => name.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
5
7
  // Only a missing file reads as no value; any other error stops the part with its code.
6
8
  const valueOf = (file, refused) => readFile(file, 'utf8').then((text) => text.replace(/\r?\n$/, ''), (err) => {
7
9
  if (err.code === 'ENOENT')
@@ -9,7 +11,8 @@ const valueOf = (file, refused) => readFile(file, 'utf8').then((text) => text.re
9
11
  throw new Error(`${refused} cannot be read: ${err.code ?? 'unknown'}`);
10
12
  });
11
13
  // Each declared name from its mounted file; a missing or empty file stops the part, named, never valued.
12
- export const readSecrets = async (names, dir, part) => {
14
+ export const readSecrets = async (pkg, part, dir) => {
15
+ const names = mountedIn(pkg, part);
13
16
  const refused = (name) => `${part} refused to start: secret ${name}`;
14
17
  const read = names.map(async (name) => [name, await valueOf(join(dir, name), refused(name))]);
15
18
  const pairs = await Promise.all(read);
@@ -17,5 +20,16 @@ export const readSecrets = async (names, dir, part) => {
17
20
  if (missing)
18
21
  throw new Error(`${refused(missing[0])} has no value`);
19
22
  const secrets = Object.fromEntries(pairs.map(([name, value]) => [camelName(name), value]));
20
- return Object.freeze(secrets);
23
+ return Object.freeze(withAbsent(secrets, part, pkg));
24
+ };
25
+ // A secret of other parts throws on read, never reads empty; spread and keys skip it.
26
+ export const withAbsent = (values, part, pkg) => {
27
+ for (const name of unmountedIn(pkg, part))
28
+ Object.defineProperty(values, camelName(name), {
29
+ enumerable: false,
30
+ get: () => {
31
+ throw new Error(`secret ${name} is not mounted in ${part}`);
32
+ },
33
+ });
34
+ return values;
21
35
  };
@@ -11,7 +11,8 @@ import { memoryRuns } from '../worker/runs.js';
11
11
  import { createScheduler } from '../worker/scheduler.js';
12
12
  import {} from '../manifest/primitives.schema.js';
13
13
  import { NO_PLATFORM, healthRegistrar, NO_STORE, } from './context.js';
14
- import { packageExtension } from './package-extension.js';
14
+ import { packageExtension, packageManifest } from './package-extension.js';
15
+ import { withAbsent } from './secrets.js';
15
16
  import { recordingLog } from './recording-log.js';
16
17
  import { commandContext, } from './test-command-context.js';
17
18
  export {} from './recording-log.js';
@@ -73,7 +74,7 @@ const serverContext = (options) => {
73
74
  spans,
74
75
  settings: { ...options.settings },
75
76
  store: store ?? NO_STORE,
76
- secrets: Object.freeze({ ...options.secrets }),
77
+ secrets: Object.freeze(withAbsent({ ...options.secrets }, extension.part, packageManifest())),
77
78
  platform: Object.freeze({ ...(options.platform ?? NO_PLATFORM) }),
78
79
  exits,
79
80
  exit: () => void exits.push(Date.now()),
@@ -46,6 +46,7 @@ export declare const discoveryDocument: (record: ExtensionRecord, host: string)
46
46
  } | undefined;
47
47
  };
48
48
  secrets?: string[] | undefined;
49
+ secretParts?: Record<string, ("pages" | "api" | "mcp" | "worker")[]> | undefined;
49
50
  openapi?: string | undefined;
50
51
  tools?: {
51
52
  name: string;
@@ -1,6 +1,6 @@
1
1
  import { formatIssues, readJsonIfExists } from '../manifest/read-manifest.js';
2
2
  import {} from '../manifest/manifest.schema.js';
3
- import { normalizeParts } from '../manifest/parts.js';
3
+ import { normalizeParts, scopedSecrets } from '../manifest/parts.js';
4
4
  import {} from '../manifest/primitives.schema.js';
5
5
  import { ExtensionRecordSchema } from './discovery.schema.js';
6
6
  export const DEFAULT_RECORD_FILE = '/run/agentage/agentage-extension.json';
@@ -15,7 +15,8 @@ const partsOf = (pkg, images, migrations) => {
15
15
  };
16
16
  // From the manifest, the build, the images by digest and what the code serves.
17
17
  export const recordOf = (pkg, build, images, extras = {}) => {
18
- const { id, commands, secrets } = pkg.agentage;
18
+ const { id, commands } = pkg.agentage;
19
+ const secrets = (pkg.agentage.secrets ?? []).filter((s) => typeof s === 'string');
19
20
  const { commit, buildTime } = build;
20
21
  const parts = partsOf(pkg, images, extras.migrations);
21
22
  const record = { id, version: pkg.version, commit, buildTime, parts };
@@ -27,8 +28,10 @@ export const recordOf = (pkg, build, images, extras = {}) => {
27
28
  record.commands = commands.map((command) => command.name);
28
29
  if (extras.widgets)
29
30
  record.widgets = extras.widgets;
30
- if (secrets?.length)
31
+ if (secrets.length)
31
32
  record.secrets = secrets;
33
+ if (Object.keys(scopedSecrets(pkg)).length)
34
+ record.secretParts = scopedSecrets(pkg);
32
35
  return record;
33
36
  };
34
37
  export const validateRecord = (value) => {
@@ -45,5 +48,6 @@ export const loadRecord = async (file) => {
45
48
  export const discoveryDocument = (record, host) => {
46
49
  const { id, version, commit, buildTime, ...rest } = record;
47
50
  delete rest.secrets;
51
+ delete rest.secretParts;
48
52
  return { id, version, commit, buildTime, host, ...rest };
49
53
  };
@@ -7,6 +7,12 @@ export declare const WidgetSchema: z.ZodObject<{
7
7
  }, z.core.$strict>;
8
8
  export declare const ExtensionRecordSchema: z.ZodObject<{
9
9
  secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
10
+ secretParts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
11
+ pages: "pages";
12
+ api: "api";
13
+ mcp: "mcp";
14
+ worker: "worker";
15
+ }>>>>;
10
16
  id: z.ZodString;
11
17
  version: z.ZodString;
12
18
  commit: z.ZodString;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { CommandNameSchema, CommitSchema, ExtensionIdSchema, IMAGE_PART_KINDS, PrefixedToolNameSchema, SecretNameSchema, StoreKindSchema, VersionSchema, } from '../manifest/primitives.schema.js';
2
+ import { CommandNameSchema, CommitSchema, ExtensionIdSchema, IMAGE_PART_KINDS, PrefixedToolNameSchema, SecretNameSchema, SecretPartSchema, StoreKindSchema, VersionSchema, } from '../manifest/primitives.schema.js';
3
3
  // registry host[:port]/owner/{id}-{part}@sha256: deployed by digest, a version's images never change.
4
4
  const ImageDigestRefSchema = z
5
5
  .string()
@@ -52,11 +52,22 @@ const imagesNameTheirExtension = (doc) => IMAGE_PART_KINDS.every((kind) => {
52
52
  return image === undefined || image.includes(`/${doc.id}-${kind}@sha256:`);
53
53
  });
54
54
  const IMAGE_RULE = { message: 'every image is {id}-{part}', path: ['parts'] };
55
+ // A scoped name lives only in secretParts, so an estate that does not read it mounts nothing.
56
+ const scoped = (name) => `secret ${name}: one or more parts, none repeated, and never also in secrets`;
55
57
  // The build record: written by `build --push` into the package and the release asset; no host.
56
- // Secret names are for the estate's mounts only; discovery leaves them out.
58
+ // Secret names and scoped parts are for the estate's mounts only; discovery leaves them out.
57
59
  export const ExtensionRecordSchema = z
58
- .strictObject({ ...recordShape, secrets: z.array(SecretNameSchema).min(1).optional() })
59
- .refine(imagesNameTheirExtension, IMAGE_RULE);
60
+ .strictObject({
61
+ ...recordShape,
62
+ secrets: z.array(SecretNameSchema).min(1).optional(),
63
+ secretParts: z.record(SecretNameSchema, z.array(SecretPartSchema)).optional(),
64
+ })
65
+ .refine(imagesNameTheirExtension, IMAGE_RULE)
66
+ .superRefine((doc, ctx) => {
67
+ for (const [name, parts] of Object.entries(doc.secretParts ?? {}))
68
+ if (!parts.length || new Set(parts).size !== parts.length || doc.secrets?.includes(name))
69
+ ctx.addIssue({ code: 'custom', path: ['secretParts', name], message: scoped(name) });
70
+ });
60
71
  // What a deployment serves at /.well-known/agentage-extension.json: the record plus its host.
61
72
  export const DiscoveryDocumentSchema = z
62
73
  .strictObject({ ...recordShape, host: OriginSchema })
@@ -117,7 +117,15 @@ export declare const PackageSchema: z.ZodObject<{
117
117
  enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
118
118
  description: z.ZodOptional<z.ZodString>;
119
119
  }, z.core.$strict>>>;
120
- secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
120
+ secrets: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
121
+ name: z.ZodString;
122
+ parts: z.ZodArray<z.ZodEnum<{
123
+ pages: "pages";
124
+ api: "api";
125
+ mcp: "mcp";
126
+ worker: "worker";
127
+ }>>;
128
+ }, z.core.$strict>]>>>;
121
129
  }, z.core.$strict>;
122
130
  }, z.core.$loose>;
123
131
  export type CodePart = z.infer<typeof CodePartSchema>;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { CommandNameSchema, ExtensionIdSchema, FIRST_PARTY_IDS, PackageNameSchema, PackagePathSchema, SecretNameSchema, SemverRangeSchema, SettingKeySchema, StoreKindSchema, VersionSchema, } from './primitives.schema.js';
2
+ import { camelName, CommandNameSchema, ExtensionIdSchema, FIRST_PARTY_IDS, PackageNameSchema, PackagePathSchema, SecretNameSchema, SecretPartSchema, SemverRangeSchema, SettingKeySchema, StoreKindSchema, VersionSchema, } from './primitives.schema.js';
3
3
  const CodePartSchema = z.union([
4
4
  z.boolean(),
5
5
  z.strictObject({ entry: PackagePathSchema.optional() }),
@@ -47,12 +47,17 @@ const SettingSchema = z
47
47
  .refine((setting) => !setting.enum || setting.enum.includes(String(setting.default)), {
48
48
  message: 'default is not one of enum',
49
49
  });
50
+ // A plain name goes to every part but ui; the object form to the parts it names only.
51
+ const SecretSchema = z.union([
52
+ SecretNameSchema,
53
+ z.strictObject({ name: SecretNameSchema, parts: z.array(SecretPartSchema).min(1) }),
54
+ ]);
50
55
  const AgentageBaseSchema = z.strictObject({
51
56
  id: ExtensionIdSchema,
52
57
  parts: PartsSchema,
53
58
  commands: z.array(CommandSchema).min(1).optional(),
54
59
  settings: z.record(SettingKeySchema, SettingSchema).optional(),
55
- secrets: z.array(SecretNameSchema).optional(),
60
+ secrets: z.array(SecretSchema).optional(),
56
61
  });
57
62
  const AgentageSchema = AgentageBaseSchema.superRefine(crossFieldRules);
58
63
  export const PackageSchema = z
@@ -87,6 +92,12 @@ function crossFieldRules(manifest, ctx) {
87
92
  const names = (manifest.commands ?? []).map((command) => command.name);
88
93
  if (new Set(names).size !== names.length)
89
94
  issue('command names must be unique', ['commands']);
95
+ for (const s of manifest.secrets ?? [])
96
+ if (typeof s === 'object' && s.parts.some((part) => !isOn(manifest.parts[part])))
97
+ issue(`secret ${s.name} names a part the extension does not have`, ['secrets']);
98
+ const ids = (manifest.secrets ?? []).map((s) => camelName(typeof s === 'string' ? s : s.name));
99
+ if (new Set(ids).size !== ids.length)
100
+ issue('secret names must be unique', ['secrets']);
90
101
  if (manifest.settings?.['mcp.listing'] && !isOn(manifest.parts.mcp)) {
91
102
  issue('mcp.listing needs the mcp part', ['settings', 'mcp.listing']);
92
103
  }
@@ -9,6 +9,12 @@ export interface NormalizedParts {
9
9
  export declare const normalizeParts: (parts: Parts) => NormalizedParts;
10
10
  export declare const imageParts: (pkg: ExtensionPackage) => ImagePartKind[];
11
11
  export declare const entryOf: (pkg: ExtensionPackage, part: ImagePartKind | "cli") => string;
12
+ export declare const secretNames: (pkg: ExtensionPackage) => string[];
13
+ export declare const scopedSecrets: (pkg: ExtensionPackage) => {
14
+ [k: string]: ("pages" | "api" | "mcp" | "worker")[];
15
+ };
16
+ export declare const mountedIn: (pkg: ExtensionPackage, part: ImagePartKind, names?: string[]) => string[];
17
+ export declare const unmountedIn: (pkg: ExtensionPackage | undefined, part: ImagePartKind) => string[];
12
18
  export declare const storeOf: (pkg: ExtensionPackage) => StoreKind | undefined;
13
19
  export declare const hasStore: (pkg: ExtensionPackage, kind: StoreKind) => boolean;
14
20
  export declare const migratesStore: (pkg: ExtensionPackage) => boolean;
@@ -22,6 +22,14 @@ export const imageParts = (pkg) => {
22
22
  return IMAGE_PART_KINDS.filter((kind) => code[kind] !== undefined);
23
23
  };
24
24
  export const entryOf = (pkg, part) => normalizeParts(pkg.agentage.parts).code[part]?.entry ?? `./dist/${part}/index.js`;
25
+ export const secretNames = (pkg) => (pkg.agentage.secrets ?? []).map((s) => (typeof s === 'string' ? s : s.name));
26
+ const scopedOf = (pkg) => (pkg.agentage.secrets ?? []).flatMap((s) => (typeof s === 'string' ? [] : [s]));
27
+ export const scopedSecrets = (pkg) => Object.fromEntries(scopedOf(pkg).map((s) => [s.name, s.parts]));
28
+ export const mountedIn = (pkg, part, names = secretNames(pkg)) => {
29
+ const scoped = new Map(scopedOf(pkg).map((s) => [s.name, s.parts]));
30
+ return names.filter((n) => part !== 'ui' && (scoped.get(n)?.includes(part) ?? true));
31
+ };
32
+ export const unmountedIn = (pkg, part) => pkg ? secretNames(pkg).filter((n) => !mountedIn(pkg, part).includes(n)) : [];
25
33
  export const storeOf = (pkg) => normalizeParts(pkg.agentage.parts).store;
26
34
  export const hasStore = (pkg, kind) => storeOf(pkg) === kind;
27
35
  // The migrate rule: the api image carries migrations/ and a migrate job only for such a kind.
@@ -34,4 +34,11 @@ export declare const CommitSchema: z.ZodString;
34
34
  export declare const PrefixedToolNameSchema: z.ZodString;
35
35
  export declare const IMAGE_PART_KINDS: readonly ["pages", "ui", "api", "mcp", "worker"];
36
36
  export type ImagePartKind = (typeof IMAGE_PART_KINDS)[number];
37
+ export declare const camelName: (name: string) => string;
38
+ export declare const SecretPartSchema: z.ZodEnum<{
39
+ pages: "pages";
40
+ api: "api";
41
+ mcp: "mcp";
42
+ worker: "worker";
43
+ }>;
37
44
  export type StoreKind = keyof typeof STORE_KINDS;
@@ -60,3 +60,5 @@ export const PrefixedToolNameSchema = z
60
60
  .max(64)
61
61
  .regex(/^[a-z][a-z0-9-]*__[a-z][a-z0-9_-]*$/);
62
62
  export const IMAGE_PART_KINDS = ['pages', 'ui', 'api', 'mcp', 'worker'];
63
+ export const camelName = (name) => name.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
64
+ export const SecretPartSchema = z.enum(['pages', 'api', 'mcp', 'worker']);
@@ -99,8 +99,7 @@ export const runPart = async (options) => {
99
99
  const part = partOf(pkg, options.part);
100
100
  const log = createLog({ extension: pkg.agentage.id, part, version: pkg.version });
101
101
  running = log;
102
- const names = part === 'ui' ? [] : (pkg.agentage.secrets ?? []);
103
- const secrets = await readSecrets(names, options.secretsDir ?? SECRETS_DIR, part);
102
+ const secrets = await readSecrets(pkg, part, options.secretsDir ?? SECRETS_DIR);
104
103
  const start = { pkg, part, env: options.env, log, secrets };
105
104
  const { app, stop } = await RUNNERS[part](await inputFor(options, start));
106
105
  if (stop)
@@ -1,5 +1,5 @@
1
1
  import {} from '../../manifest/manifest.schema.js';
2
- import { hasStore, imageParts } from '../../manifest/parts.js';
2
+ import { hasStore, imageParts, mountedIn } from '../../manifest/parts.js';
3
3
  import {} from '../../manifest/primitives.schema.js';
4
4
  import { DEV_AUDIENCE, DEV_ISSUER, UP_ISSUER } from './dev-issuer-app.js';
5
5
  import { GATEWAY_PORT, ISSUER_PORT, PART_PORT, TRAEFIK_COMMAND, TRAEFIK_IMAGE } from './gateway.js';
@@ -33,11 +33,12 @@ const dependsOn = (pkg, part) => ({
33
33
  ...(hasStore(pkg, 'postgres') && part !== 'ui' ? { store: HEALTHY } : {}),
34
34
  ...(part === 'api' || part === 'mcp' ? { issuer: HEALTHY } : {}),
35
35
  });
36
+ const withSecrets = (names) => (names.length ? { secrets: names } : {});
36
37
  const partService = (input, part) => ({
37
38
  image: input.tags[part],
38
39
  environment: partEnv(input.pkg, part),
39
40
  volumes: [`${input.recordFile}:${RECORD_TARGET}:ro`],
40
- ...(part !== 'ui' && input.secretFiles ? { secrets: Object.keys(input.secretFiles) } : {}),
41
+ ...withSecrets(mountedIn(input.pkg, part, Object.keys(input.secretFiles ?? {}))),
41
42
  depends_on: dependsOn(input.pkg, part),
42
43
  });
43
44
  const secretsOf = (files) => Object.fromEntries(Object.entries(files).map(([name, file]) => [name, { file }]));
@@ -33,6 +33,7 @@ export declare const writeLocalRecord: (dir: string, pkg: ExtensionPackage, buil
33
33
  } | undefined;
34
34
  };
35
35
  secrets?: string[] | undefined;
36
+ secretParts?: Record<string, ("pages" | "api" | "mcp" | "worker")[]> | undefined;
36
37
  openapi?: string | undefined;
37
38
  tools?: {
38
39
  name: string;
@@ -1,6 +1,7 @@
1
1
  import { chmod, mkdir, writeFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import {} from '../../manifest/manifest.schema.js';
4
+ import { secretNames } from '../../manifest/parts.js';
4
5
  import { readJsonIfExists } from '../../manifest/read-manifest.js';
5
6
  import {} from '../../runtime/build-info.js';
6
7
  import { LOCAL_DIR } from './local-record.js';
@@ -19,7 +20,7 @@ const valueOf = (name, env, file) => {
19
20
  };
20
21
  // Each value as a file compose mounts at /run/secrets/<name>; the env wins over the file.
21
22
  export const writeUpSecrets = async (dir, pkg, env) => {
22
- const names = pkg.agentage.secrets ?? [];
23
+ const names = secretNames(pkg);
23
24
  if (names.length === 0)
24
25
  return undefined;
25
26
  const file = await fileValues(dir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentage/extension",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "The agentage extension kit: create(ctx) per part (pages, ui, api, mcp, worker, cli), the store, /health, discovery, the envelope, and the build tool with up and token",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -288,9 +288,41 @@
288
288
  "secrets": {
289
289
  "type": "array",
290
290
  "items": {
291
- "type": "string",
292
- "maxLength": 48,
293
- "pattern": "^[a-z][a-z0-9-]*$"
291
+ "anyOf": [
292
+ {
293
+ "type": "string",
294
+ "maxLength": 48,
295
+ "pattern": "^[a-z][a-z0-9-]*$"
296
+ },
297
+ {
298
+ "type": "object",
299
+ "properties": {
300
+ "name": {
301
+ "type": "string",
302
+ "maxLength": 48,
303
+ "pattern": "^[a-z][a-z0-9-]*$"
304
+ },
305
+ "parts": {
306
+ "minItems": 1,
307
+ "type": "array",
308
+ "items": {
309
+ "type": "string",
310
+ "enum": [
311
+ "pages",
312
+ "api",
313
+ "mcp",
314
+ "worker"
315
+ ]
316
+ }
317
+ }
318
+ },
319
+ "required": [
320
+ "name",
321
+ "parts"
322
+ ],
323
+ "additionalProperties": false
324
+ }
325
+ ]
294
326
  }
295
327
  }
296
328
  },
@@ -192,6 +192,26 @@
192
192
  "maxLength": 48,
193
193
  "pattern": "^[a-z][a-z0-9-]*$"
194
194
  }
195
+ },
196
+ "secretParts": {
197
+ "type": "object",
198
+ "propertyNames": {
199
+ "type": "string",
200
+ "maxLength": 48,
201
+ "pattern": "^[a-z][a-z0-9-]*$"
202
+ },
203
+ "additionalProperties": {
204
+ "type": "array",
205
+ "items": {
206
+ "type": "string",
207
+ "enum": [
208
+ "pages",
209
+ "api",
210
+ "mcp",
211
+ "worker"
212
+ ]
213
+ }
214
+ }
195
215
  }
196
216
  },
197
217
  "required": [