import {
  SYSTEM_BLOCK_KINDS
} from "./chunk-D2QLTPUJ.mjs";
import {
  API_ENDPOINTS,
  buildEndpointURL,
  createRiverbankClient
} from "./chunk-SQMGHEJM.mjs";
import "./chunk-BJTO5JO5.mjs";

// ../api/src/aiPlayground.ts
import { z } from "zod";
var Rfc6902PatchOp = z.discriminatedUnion("op", [
  // Standard RFC-6902 operations
  z.object({
    op: z.literal("add"),
    path: z.string(),
    value: z.unknown()
  }),
  z.object({
    op: z.literal("remove"),
    path: z.string()
  }),
  z.object({
    op: z.literal("replace"),
    path: z.string(),
    value: z.unknown()
  }),
  z.object({
    op: z.literal("move"),
    from: z.string(),
    path: z.string()
  }),
  z.object({
    op: z.literal("copy"),
    from: z.string(),
    path: z.string()
  }),
  // Block-level operations (Phase 2)
  z.object({
    op: z.literal("add_block"),
    blockKind: z.string(),
    afterBlockId: z.string().nullable(),
    content: z.record(z.string(), z.unknown()),
    rationale: z.string()
  }),
  z.object({
    op: z.literal("delete_block"),
    blockId: z.string(),
    rationale: z.string()
  }),
  z.object({
    op: z.literal("reorder_block"),
    blockId: z.string(),
    afterBlockId: z.string().nullable(),
    rationale: z.string()
  })
]);
var PatchEnvelope = z.object({
  blockId: z.string(),
  blockKind: z.string().optional(),
  blockPurpose: z.string().optional().nullable(),
  ops: z.array(Rfc6902PatchOp),
  rationale: z.string(),
  currentContent: z.record(z.string(), z.unknown()).optional()
});
var ContentUpdateResponse = z.object({
  patches: z.array(PatchEnvelope),
  assistantMessage: z.string()
});
var PlaygroundProposeRequest = z.object({
  request: z.string().min(1).max(2e3)
});
var PlaygroundProposeResponse = z.object({
  patches: z.array(PatchEnvelope),
  assistantMessage: z.string(),
  validation: z.object({
    valid: z.boolean(),
    issues: z.array(z.string()),
    filtered: z.number()
  })
});
var MultiPagePatchEnvelope = z.object({
  pageId: z.string(),
  blockId: z.string().optional(),
  // Not present for page-level ops
  blockKind: z.string().optional(),
  blockPurpose: z.string().optional().nullable(),
  ops: z.array(Rfc6902PatchOp),
  rationale: z.string(),
  currentContent: z.record(z.string(), z.unknown()).optional()
});
var MultiPageUpdateResponse = z.object({
  patches: z.array(MultiPagePatchEnvelope),
  assistantMessage: z.string(),
  pagesModified: z.number(),
  toolCallsUsed: z.number()
});
export {
  API_ENDPOINTS,
  SYSTEM_BLOCK_KINDS,
  buildEndpointURL,
  createRiverbankClient
};
//# sourceMappingURL=index.mjs.map