@opengeni/contracts 0.30.0 → 0.31.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ConnectionMetadata
3
- } from "./chunk-YWKPXSLB.js";
3
+ } from "./chunk-H4NRLOOX.js";
4
4
  import "./chunk-KGL5BVGF.js";
5
5
 
6
6
  // src/google-drive.ts
package/dist/index.d.ts CHANGED
@@ -6305,6 +6305,11 @@ export declare const CapabilityPack: z.ZodPreprocess<z.ZodObject<{
6305
6305
  category: z.ZodString;
6306
6306
  version: z.ZodString;
6307
6307
  sandboxImage: z.ZodOptional<z.ZodString>;
6308
+ sandboxProviderImages: z.ZodOptional<z.ZodObject<{
6309
+ modal: z.ZodOptional<z.ZodObject<{
6310
+ imageId: z.ZodString;
6311
+ }, z.core.$strict>>;
6312
+ }, z.core.$strict>>;
6308
6313
  skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
6309
6314
  name: z.ZodString;
6310
6315
  description: z.ZodOptional<z.ZodString>;
@@ -6395,6 +6400,11 @@ export declare const RegisterCapabilityPackRequest: z.ZodPreprocess<z.ZodObject<
6395
6400
  category: z.ZodString;
6396
6401
  version: z.ZodString;
6397
6402
  sandboxImage: z.ZodOptional<z.ZodString>;
6403
+ sandboxProviderImages: z.ZodOptional<z.ZodObject<{
6404
+ modal: z.ZodOptional<z.ZodObject<{
6405
+ imageId: z.ZodString;
6406
+ }, z.core.$strict>>;
6407
+ }, z.core.$strict>>;
6398
6408
  skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
6399
6409
  name: z.ZodString;
6400
6410
  description: z.ZodOptional<z.ZodString>;
@@ -6488,6 +6498,11 @@ export declare const WorkspaceRegisteredPack: z.ZodObject<{
6488
6498
  category: z.ZodString;
6489
6499
  version: z.ZodString;
6490
6500
  sandboxImage: z.ZodOptional<z.ZodString>;
6501
+ sandboxProviderImages: z.ZodOptional<z.ZodObject<{
6502
+ modal: z.ZodOptional<z.ZodObject<{
6503
+ imageId: z.ZodString;
6504
+ }, z.core.$strict>>;
6505
+ }, z.core.$strict>>;
6491
6506
  skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
6492
6507
  name: z.ZodString;
6493
6508
  description: z.ZodOptional<z.ZodString>;
package/dist/index.js CHANGED
@@ -703,7 +703,7 @@ import {
703
703
  verifyRelayToken,
704
704
  verifyStreamToken,
705
705
  workspaceControlUtf8Bytes
706
- } from "./chunk-YWKPXSLB.js";
706
+ } from "./chunk-H4NRLOOX.js";
707
707
  import {
708
708
  OPENGENI_SLACK_BOT_FORBIDDEN_SCOPES,
709
709
  OPENGENI_SLACK_BOT_REQUIRED_SCOPES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/contracts",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Shared zod schemas and wire-contract types for the OpenGeni API.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/index.ts CHANGED
@@ -5165,43 +5165,83 @@ export const CapabilityPack = z.preprocess(
5165
5165
  }
5166
5166
  return record;
5167
5167
  },
5168
- z.object({
5169
- id: z.string().min(1),
5170
- name: z.string().min(1),
5171
- description: z.string().min(1),
5172
- role: z.string().min(1),
5173
- category: z.string().min(1),
5174
- version: z.string().min(1),
5175
- // Container image ref (digest-pinned recommended) the pack's sessions run
5176
- // in. At most one enabled pack per workspace may declare one; with none,
5177
- // sessions use the deployment-wide image settings.
5178
- sandboxImage: z.string().trim().min(1).max(512).optional(),
5179
- // Skills delivered into the sandbox skill index when the pack is enabled.
5180
- skills: z
5181
- .array(CapabilityPackSkill)
5182
- .max(32)
5183
- .superRefine((skills, ctx) => {
5184
- const seen = new Set<string>();
5185
- skills.forEach((skill, index) => {
5186
- const key = skill.name.toLowerCase();
5187
- if (seen.has(key)) {
5188
- ctx.addIssue({
5189
- code: "custom",
5190
- message: `duplicate pack skill name: ${skill.name}`,
5191
- path: [index, "name"],
5192
- });
5193
- }
5194
- seen.add(key);
5168
+ z
5169
+ .object({
5170
+ id: z.string().min(1),
5171
+ name: z.string().min(1),
5172
+ description: z.string().min(1),
5173
+ role: z.string().min(1),
5174
+ category: z.string().min(1),
5175
+ version: z.string().min(1),
5176
+ // Container image ref (digest-pinned recommended) the pack's sessions run
5177
+ // in. At most one enabled pack per workspace may declare one; with none,
5178
+ // sessions use the deployment-wide image settings.
5179
+ sandboxImage: z.string().trim().min(1).max(512).optional(),
5180
+ // Optional provider-native immutable identities for the exact logical
5181
+ // sandboxImage above. These avoid re-importing a private registry image on
5182
+ // every provider while preserving sandboxImage as the cross-provider image
5183
+ // provenance and lease-conflict identity.
5184
+ sandboxProviderImages: z
5185
+ .object({
5186
+ modal: z
5187
+ .object({
5188
+ imageId: z
5189
+ .string()
5190
+ .trim()
5191
+ .regex(/^im-[A-Za-z0-9]{22}$/),
5192
+ })
5193
+ .strict()
5194
+ .optional(),
5195
+ })
5196
+ .strict()
5197
+ .optional(),
5198
+ // Skills delivered into the sandbox skill index when the pack is enabled.
5199
+ skills: z
5200
+ .array(CapabilityPackSkill)
5201
+ .max(32)
5202
+ .superRefine((skills, ctx) => {
5203
+ const seen = new Set<string>();
5204
+ skills.forEach((skill, index) => {
5205
+ const key = skill.name.toLowerCase();
5206
+ if (seen.has(key)) {
5207
+ ctx.addIssue({
5208
+ code: "custom",
5209
+ message: `duplicate pack skill name: ${skill.name}`,
5210
+ path: [index, "name"],
5211
+ });
5212
+ }
5213
+ seen.add(key);
5214
+ });
5215
+ })
5216
+ .default([]),
5217
+ tools: z.array(ToolRef).default([]),
5218
+ connectors: z.array(CapabilityPackConnector).default([]),
5219
+ knowledge: z.array(CapabilityPackKnowledge).default([]),
5220
+ scheduledTaskTemplates: z.array(CapabilityPackScheduledTaskTemplate).default([]),
5221
+ variableSet: CapabilityPackVariableSet.optional(),
5222
+ metadata: z.record(z.string(), z.unknown()).default({}),
5223
+ })
5224
+ .superRefine((pack, ctx) => {
5225
+ if (!pack.sandboxProviderImages?.modal) {
5226
+ return;
5227
+ }
5228
+ if (!pack.sandboxImage) {
5229
+ ctx.addIssue({
5230
+ code: "custom",
5231
+ message: "sandboxProviderImages.modal requires sandboxImage",
5232
+ path: ["sandboxProviderImages", "modal"],
5195
5233
  });
5196
- })
5197
- .default([]),
5198
- tools: z.array(ToolRef).default([]),
5199
- connectors: z.array(CapabilityPackConnector).default([]),
5200
- knowledge: z.array(CapabilityPackKnowledge).default([]),
5201
- scheduledTaskTemplates: z.array(CapabilityPackScheduledTaskTemplate).default([]),
5202
- variableSet: CapabilityPackVariableSet.optional(),
5203
- metadata: z.record(z.string(), z.unknown()).default({}),
5204
- }),
5234
+ return;
5235
+ }
5236
+ if (!/@sha256:[0-9a-f]{64}$/i.test(pack.sandboxImage)) {
5237
+ ctx.addIssue({
5238
+ code: "custom",
5239
+ message:
5240
+ "sandboxProviderImages.modal requires sandboxImage to be pinned by an OCI sha256 digest",
5241
+ path: ["sandboxImage"],
5242
+ });
5243
+ }
5244
+ }),
5205
5245
  );
5206
5246
  export type CapabilityPack = z.infer<typeof CapabilityPack>;
5207
5247