import { z } from 'zod';

// src/well-known/models.ts
var BaseCollectionEntitySchema = z.object({
  id: z.string().describe("Unique identifier for the entity"),
  title: z.string().describe("Human-readable title for the entity"),
  created_at: z.string().datetime(),
  updated_at: z.string().datetime(),
  created_by: z.string().optional(),
  updated_by: z.string().optional()
});
var ComparisonExpressionSchema = z.object({
  field: z.array(z.string()),
  operator: z.enum(["eq", "gt", "gte", "lt", "lte", "in", "like", "contains"]),
  value: z.unknown()
});
var WhereExpressionSchema = z.union([
  ComparisonExpressionSchema,
  z.object({
    operator: z.enum(["and", "or", "not"]),
    conditions: z.array(ComparisonExpressionSchema)
  })
]);
var OrderByExpressionSchema = z.object({
  field: z.array(z.string()),
  direction: z.enum(["asc", "desc"]),
  nulls: z.enum(["first", "last"]).optional()
});
var CollectionListInputSchema = z.object({
  where: WhereExpressionSchema.optional().describe("Filter expression"),
  orderBy: z.array(OrderByExpressionSchema).optional().describe("Sort expressions"),
  limit: z.number().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),
  offset: z.number().int().min(0).optional().describe("Number of items to skip")
});
function createCollectionListOutputSchema(entitySchema) {
  return z.object({
    items: z.array(entitySchema).describe("Array of collection items"),
    totalCount: z.number().int().min(0).optional().describe("Total number of matching items (if available)"),
    hasMore: z.boolean().optional().describe("Whether there are more items available")
  });
}
var CollectionGetInputSchema = z.object({
  id: z.string().describe("ID of the entity to retrieve")
});
function createCollectionGetOutputSchema(entitySchema) {
  return z.object({
    item: entitySchema.nullable().describe("The retrieved item, or null if not found")
  });
}
z.object({
  id: z.string().describe("ID of the entity to delete")
});
function createCollectionBindings(collectionName, entitySchema, options) {
  const upperName = collectionName.toUpperCase();
  const bindings = [
    {
      name: `COLLECTION_${upperName}_LIST`,
      inputSchema: CollectionListInputSchema,
      outputSchema: createCollectionListOutputSchema(entitySchema)
    },
    {
      name: `COLLECTION_${upperName}_GET`,
      inputSchema: CollectionGetInputSchema,
      outputSchema: createCollectionGetOutputSchema(entitySchema)
    }
  ];
  return bindings;
}

// src/well-known/models.ts
var ModelSchema = BaseCollectionEntitySchema.extend({
  // Model-specific fields
  logo: z.string().nullable(),
  description: z.string().nullable(),
  capabilities: z.array(z.string()),
  limits: z.object({
    contextWindow: z.number(),
    maxOutputTokens: z.number()
  }).nullable(),
  costs: z.object({
    input: z.number(),
    output: z.number()
  }).nullable(),
  // Provider information
  provider: z.enum([
    "openai",
    "anthropic",
    "google",
    "xai",
    "deepseek",
    "openai-compatible",
    "openrouter"
  ]).nullable(),
  // Streaming endpoint information
  endpoint: z.object({
    url: z.string().url(),
    method: z.string().default("POST"),
    contentType: z.string().default("application/json"),
    stream: z.boolean().default(true)
  }).nullable()
});
var MODELS_COLLECTION_BINDING = createCollectionBindings(
  "models",
  ModelSchema);
var MODELS_BINDING = [
  ...MODELS_COLLECTION_BINDING
];

export { MODELS_BINDING, MODELS_COLLECTION_BINDING, ModelSchema };
//# sourceMappingURL=models.js.map
//# sourceMappingURL=models.js.map