@perstack/api-client 0.0.48 → 0.0.50
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/{bundle.d.mts → index.d.mts} +591 -1040
- package/dist/index.d.mts.map +1 -0
- package/dist/{bundle.mjs → index.mjs} +769 -1159
- package/dist/index.mjs.map +1 -0
- package/package.json +6 -8
- package/dist/bundle.d.mts.map +0 -1
- package/dist/bundle.mjs.map +0 -1
package/dist/bundle.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.mjs","names":["request","response","request","response","i","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","request","response","response","response","BASE_PATH","BASE_PATH","BASE_PATH","BASE_PATH","BASE_PATH","BASE_PATH","request","response"],"sources":["../../constants/index.ts","../../models/src/domain/common.ts","../../models/src/domain/organization.ts","../../models/src/domain/user.ts","../../models/src/domain/apiKey.ts","../../models/src/api/api-keys/create.ts","../../models/src/api/api-keys/get.ts","../../../node_modules/ts-dedent/dist/index.js","../../models/src/api/common.ts","../../models/src/api/api-keys/getAll.ts","../../models/src/api/api-keys/revoke.ts","../../models/src/domain/application.ts","../../models/src/api/applications/create.ts","../../models/src/api/applications/delete.ts","../../models/src/api/applications/get.ts","../../models/src/api/applications/getAll.ts","../../models/src/api/applications/update.ts","../../models/src/domain/secret.ts","../../models/src/api/env/secrets/create.ts","../../models/src/api/env/secrets/delete.ts","../../models/src/api/env/secrets/get.ts","../../models/src/api/env/secrets/getAll.ts","../../models/src/api/env/secrets/update.ts","../../models/src/domain/variable.ts","../../models/src/api/env/variables/create.ts","../../models/src/api/env/variables/delete.ts","../../models/src/api/env/variables/get.ts","../../models/src/api/env/variables/getAll.ts","../../models/src/api/env/variables/update.ts","../../models/src/domain/expertScope.ts","../../models/src/domain/skill.ts","../../models/src/domain/expert.ts","../../models/src/api/experts/definition.ts","../../models/src/api/experts/delete.ts","../../models/src/domain/expertDraftScope.ts","../../models/src/api/experts/drafts/definition.ts","../../models/src/api/experts/drafts/create.ts","../../models/src/api/experts/drafts/delete.ts","../../models/src/api/experts/drafts/get.ts","../../models/src/api/experts/drafts/getAll.ts","../../models/src/api/experts/drafts/update.ts","../../models/src/api/experts/drafts/version.ts","../../models/src/api/experts/featured.ts","../../models/src/api/experts/get.ts","../../models/src/api/experts/getAll.ts","../../models/src/api/experts/meta.ts","../../models/src/api/experts/publish.ts","../../models/src/api/experts/unpublish.ts","../../models/src/api/experts/versions.ts","../../models/src/domain/checkpoint.ts","../../models/src/api/jobs/checkpoints/create.ts","../../models/src/api/jobs/checkpoints/get.ts","../../models/src/api/jobs/checkpoints/getAll.ts","../../models/src/api/jobs/checkpoints/stream.ts","../../support-models/src/index.ts","../../models/src/domain/job.ts","../../models/src/api/jobs/continue.ts","../../models/src/api/jobs/create.ts","../../models/src/api/jobs/get.ts","../../models/src/api/jobs/getAll.ts","../../models/src/api/jobs/update.ts","../../models/src/domain/providerSetting.ts","../../models/src/api/provider-settings/api-keys/create.ts","../../models/src/api/provider-settings/api-keys/delete.ts","../../models/src/api/provider-settings/api-keys/getAll.ts","../../models/src/api/provider-settings/create.ts","../../models/src/api/provider-settings/delete.ts","../../models/src/api/provider-settings/get.ts","../../models/src/api/provider-settings/getAll.ts","../../models/src/api/provider-settings/update.ts","../../models/src/api/session/get.ts","../../models/src/api/session/setApplication.ts","../../models/src/domain/providerApiKey.ts","../../models/src/domain/run.ts","../src/lib/errors.ts","../src/endpoints/api-keys.ts","../src/lib/query-string.ts","../src/endpoints/applications.ts","../src/endpoints/env-secrets.ts","../src/endpoints/env-variables.ts","../src/endpoints/env.ts","../src/endpoints/experts-drafts.ts","../src/endpoints/experts-versions.ts","../src/endpoints/experts.ts","../src/lib/sse.ts","../src/endpoints/jobs-checkpoints.ts","../src/endpoints/jobs.ts","../src/endpoints/provider-settings.ts","../src/lib/fetcher.ts","../src/client-public.ts","../src/lib/api-key.ts","../src/lib/auth.ts"],"sourcesContent":["// Organization\nexport const organizationNameRegex = /^[a-z0-9][a-z0-9_.-]*$/\nexport const maxOrganizationNameLength = 128\n\n// Application\nexport const applicationNameRegex = /^[a-z0-9][a-z0-9_.-]*$/\nexport const maxApplicationNameLength = 255\n\n// Variable/Secret\nexport const maxVariableValueLength = 65536\nexport const maxSecretValueLength = 65536\n\n// Expert\nexport const expertKeyRegex =\n /^((?:@[a-z0-9][a-z0-9_.-]*\\/)?[a-z0-9][a-z0-9_.-]*)(?:@((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\w.-]+)?(?:\\+[\\w.-]+)?)|@([a-z0-9][a-z0-9_.-]*))?$/\nexport const expertNameRegex = /^(@[a-z0-9][a-z0-9_-]*\\/)?[a-z0-9][a-z0-9_-]*$/\nexport const scopeNameRegex = /^[a-z0-9][a-z0-9_-]*$/\nexport const scopeNameRefRegex =\n /^[a-z0-9][a-z0-9_-]*(?:@(?:(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\w.-]+)?(?:\\+[\\w.-]+)?|[a-z0-9][a-z0-9_-]*))?$/\nexport const expertVersionRegex =\n /^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\w.-]+)?(?:\\+[\\w.-]+)?$/\nexport const tagNameRegex = /^[a-z0-9][a-z0-9_-]*$/\nexport const maxExpertNameLength = 255\nexport const maxExpertVersionTagLength = 255\nexport const maxExpertKeyLength = 511\nexport const maxExpertDescriptionLength = 1024 * 2\nexport const maxExpertInstructionLength = 1024 * 20\nexport const maxExpertSkillItems = 255\nexport const maxExpertDelegateItems = 255\nexport const maxExpertTagItems = 8\n\n// ExpertJob\nexport const maxExpertJobQueryLength = 1024 * 20\nexport const maxExpertJobFileNameLength = 1024 * 10\n\n// Skill\nexport const packageWithVersionRegex =\n /^(?:@[a-z0-9][a-z0-9_.-]*\\/)?[a-z0-9][a-z0-9_.-]*(?:@(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\w.-]+)?(?:\\+[\\w.-]+)?|@[a-z0-9][a-z0-9_.-]*)?$/\nexport const urlSafeRegex = /^[a-z0-9][a-z0-9_-]*$/\nexport const maxSkillNameLength = 255\nexport const maxSkillDescriptionLength = 1024 * 2\nexport const maxSkillRuleLength = 1024 * 2\nexport const maxSkillPickOmitItems = 255\nexport const maxSkillRequiredEnvItems = 255\nexport const maxSkillToolNameLength = 255\nexport const maxSkillEndpointLength = 1024 * 2\nexport const maxSkillInputJsonSchemaLength = 1024 * 20\nexport const maxSkillToolItems = 255\n\n// Checkpoint\nexport const maxCheckpointToolCallIdLength = 255\n\n// Workspace\nexport const envNameRegex = /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/\nexport const maxEnvNameLength = 255\n\n// UI\nexport const semverOrTagRegex =\n /^(?:(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\w.-]+)?(?:\\+[\\w.-]+)?|[a-z0-9][a-z0-9_.-]*)$/\n\n// Provider Settings\nexport const maxProviderBaseUrlLength = 2048\nexport const maxProviderHeaderKeyLength = 255\nexport const maxProviderHeaderValueLength = 2048\nexport const maxProviderHeadersCount = 50\n","import {\n expertKeyRegex,\n expertNameRegex,\n expertVersionRegex,\n maxExpertKeyLength,\n maxExpertNameLength,\n maxExpertVersionTagLength,\n scopeNameRefRegex,\n scopeNameRegex,\n tagNameRegex,\n} from \"@repo/constants\"\nimport { z } from \"zod\"\n\n// CUID2 schema\nexport const cuidSchema = z.cuid2()\nexport type Cuid = z.infer<typeof cuidSchema>\n\n// Runtime version\nexport const runtimeVersionSchema = z.enum([\"v1.0\"])\nexport type RuntimeVersion = z.infer<typeof runtimeVersionSchema>\n\n// Provider\nexport const providerSchema = z.enum([\n \"anthropic\",\n \"google\",\n \"openai\",\n \"ollama\",\n \"deepseek\",\n \"azure-openai\",\n \"amazon-bedrock\",\n \"google-vertex\",\n])\nexport type Provider = z.infer<typeof providerSchema>\n\n// Datetime string (ISO 8601 with explicit timezone)\nexport const datetimeSchema = z.string().datetime({ offset: true })\nexport type Datetime = z.infer<typeof datetimeSchema>\n\nexport const expertKeyFieldSchema = z.string().min(1).max(maxExpertKeyLength).regex(expertKeyRegex)\n/** Unique identifier field for an expert (e.g., `@org/expert-name`, `@org/expert-name/delegate`). */\nexport type ExpertKeyField = z.infer<typeof expertKeyFieldSchema>\n\nexport const expertNameFieldSchema = z\n .string()\n .min(1)\n .max(maxExpertNameLength)\n .regex(expertNameRegex)\n/** Name field for an expert (e.g., `my-expert`, `my-expert/helper`). */\nexport type ExpertNameField = z.infer<typeof expertNameFieldSchema>\n\nexport const expertVersionFieldSchema = z\n .string()\n .min(1)\n .max(maxExpertVersionTagLength)\n .regex(expertVersionRegex)\n/** Semantic version string for an expert (e.g., `1.0.0`, `0.1.0-beta`). */\nexport type ExpertVersionField = z.infer<typeof expertVersionFieldSchema>\n\nexport const expertTagFieldSchema = z\n .string()\n .min(1)\n .max(maxExpertVersionTagLength)\n .regex(tagNameRegex)\n/** Alias tag pointing to a specific version (e.g., `latest`, `stable`). */\nexport type ExpertTagField = z.infer<typeof expertTagFieldSchema>\n\nexport const expertCategoryFieldSchema = z.enum([\n \"general\",\n \"coding\",\n \"research\",\n \"writing\",\n \"data\",\n \"automation\",\n])\n/** Category for classifying experts (e.g., `coding`, `research`, `writing`). */\nexport type ExpertCategoryField = z.infer<typeof expertCategoryFieldSchema>\n\nexport const scopeNameSchema = z.string().min(1).max(maxExpertNameLength).regex(scopeNameRegex)\n/** Scope name without delegate prefix (e.g., `my-expert`). */\nexport type ScopeName = z.infer<typeof scopeNameSchema>\n\nexport const scopeNameRefSchema = z\n .string()\n .min(1)\n .max(maxExpertNameLength + maxExpertVersionTagLength + 1)\n .regex(scopeNameRefRegex)\n/** Scope name with optional ref (e.g., `my-expert@1.0.0`, `my-expert@latest`). */\nexport type ScopeNameRef = z.infer<typeof scopeNameRefSchema>\n\nexport const draftRefFieldSchema = z.string().min(1).max(30)\n/** Draft ref identifier (CUID for a draft snapshot). */\nexport type DraftRefField = z.infer<typeof draftRefFieldSchema>\n","import { maxOrganizationNameLength, organizationNameRegex } from \"@repo/constants\"\nimport { z } from \"zod\"\nimport { cuidSchema, datetimeSchema } from \"./common\"\n\nexport const organizationStatusSchema = z.enum([\"active\", \"inactive\", \"deleted\"])\nexport type OrganizationStatus = z.infer<typeof organizationStatusSchema>\n\nexport const organizationTypeSchema = z.enum([\"personal\", \"personalPlus\", \"team\", \"serviceAdmin\"])\nexport type OrganizationType = z.infer<typeof organizationTypeSchema>\n\nexport const organizationSchema = z.object({\n type: z.literal(\"organization\"),\n id: cuidSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n name: z.string().min(1).max(maxOrganizationNameLength).regex(organizationNameRegex).optional(),\n nameChangedAt: datetimeSchema.optional(),\n status: organizationStatusSchema,\n organizationType: organizationTypeSchema,\n maxApplications: z.number().int().min(0),\n maxApiKeys: z.number().int().min(0),\n maxExperts: z.number().int().min(0),\n})\nexport type Organization = z.infer<typeof organizationSchema>\n","import { z } from \"zod\"\nimport { cuidSchema, datetimeSchema } from \"./common\"\nimport { organizationSchema } from \"./organization\"\n\nexport const userStatusSchema = z.enum([\"active\", \"inactive\", \"deleted\"])\nexport type UserStatus = z.infer<typeof userStatusSchema>\n\nexport const userSchema = z.object({\n type: z.literal(\"user\"),\n id: cuidSchema,\n email: z.string().email(),\n emailVerified: z.boolean(),\n name: z.string().min(1).max(255).optional(),\n image: z.string().url().optional(),\n status: userStatusSchema,\n organizations: z.array(organizationSchema),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n})\nexport type User = z.infer<typeof userSchema>\n","import { z } from \"zod\"\nimport { cuidSchema, datetimeSchema } from \"./common\"\nimport { userSchema } from \"./user\"\n\nexport const apiKeyPermissionsSchema = z.object({\n operations: z.array(z.string()),\n experts: z.union([z.array(z.string()), z.literal(\"*\")]).optional(),\n})\nexport type ApiKeyPermissions = z.infer<typeof apiKeyPermissionsSchema>\n\nexport const apiKeySchema = z.object({\n type: z.literal(\"apiKey\"),\n id: cuidSchema,\n name: z.string().min(1).max(255).optional(),\n start: z.string().optional(),\n prefix: z.string().optional(),\n user: userSchema.optional(),\n enabled: z.boolean(),\n expiresAt: datetimeSchema.optional(),\n permissions: apiKeyPermissionsSchema.optional(),\n lastRequest: datetimeSchema.optional(),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n})\nexport type ApiKey = z.infer<typeof apiKeySchema>\n\nexport const createApiKeyInputSchema = z.object({\n name: z.string().min(1).max(255).optional(),\n organizationId: cuidSchema,\n operations: z.array(z.string()).optional(),\n experts: z.union([z.array(z.string()), z.literal(\"*\")]).optional(),\n expiresIn: z.number().min(60).optional(),\n})\nexport type CreateApiKeyInput = z.infer<typeof createApiKeyInputSchema>\n\nexport const createApiKeyResponseSchema = z.object({\n apiKey: apiKeySchema,\n key: z.string(),\n})\nexport type CreateApiKeyResponse = z.infer<typeof createApiKeyResponseSchema>\n","import { z } from \"zod\"\nimport { apiKeyPermissionsSchema, apiKeySchema } from \"../../domain/apiKey\"\nimport { cuidSchema } from \"../../domain/common\"\n\nexport const request = {\n body: z.object({\n name: z.string().min(1).max(255).optional(),\n operations: z.array(z.string()).optional(),\n experts: z.union([z.array(z.string()), z.literal(\"*\")]).optional(),\n wildcardApplicationAccess: z.boolean().optional(),\n applicationIds: z.array(cuidSchema).optional(),\n expiresIn: z.number().min(60).optional(),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n apiKey: apiKeySchema.extend({\n permissions: apiKeyPermissionsSchema.optional(),\n wildcardApplicationAccess: z.boolean(),\n applicationIds: z.array(cuidSchema),\n }),\n key: z.string(),\n }),\n})\n\nexport type RequestBody = z.infer<typeof request.body>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { apiKeyPermissionsSchema, apiKeySchema } from \"../../domain/apiKey\"\nimport { cuidSchema } from \"../../domain/common\"\n\nexport const request = {\n params: z.object({\n apiKeyId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n apiKey: apiKeySchema.extend({\n permissions: apiKeyPermissionsSchema.optional(),\n wildcardApplicationAccess: z.boolean(),\n applicationIds: z.array(cuidSchema),\n }),\n }),\n})\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type Response = z.infer<typeof response>\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.dedent = void 0;\nfunction dedent(templ) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n var strings = Array.from(typeof templ === 'string' ? [templ] : templ);\n strings[strings.length - 1] = strings[strings.length - 1].replace(/\\r?\\n([\\t ]*)$/, '');\n var indentLengths = strings.reduce(function (arr, str) {\n var matches = str.match(/\\n([\\t ]+|(?!\\s).)/g);\n if (matches) {\n return arr.concat(matches.map(function (match) { var _a, _b; return (_b = (_a = match.match(/[\\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; }));\n }\n return arr;\n }, []);\n if (indentLengths.length) {\n var pattern_1 = new RegExp(\"\\n[\\t ]{\" + Math.min.apply(Math, indentLengths) + \"}\", 'g');\n strings = strings.map(function (str) { return str.replace(pattern_1, '\\n'); });\n }\n strings[0] = strings[0].replace(/^\\r?\\n/, '');\n var string = strings[0];\n values.forEach(function (value, i) {\n var endentations = string.match(/(?:^|\\n)( *)$/);\n var endentation = endentations ? endentations[1] : '';\n var indentedValue = value;\n if (typeof value === 'string' && value.includes('\\n')) {\n indentedValue = String(value)\n .split('\\n')\n .map(function (str, i) {\n return i === 0 ? str : \"\" + endentation + str;\n })\n .join('\\n');\n }\n string += indentedValue + strings[i + 1];\n });\n return string;\n}\nexports.dedent = dedent;\nexports.default = dedent;\n//# sourceMappingURL=index.js.map","import dedent from \"ts-dedent\"\nimport { z } from \"zod\"\n\nexport const errorBadRequest = z\n .object({\n code: z.literal(400),\n error: z.literal(\"Bad Request\"),\n reason: z.string(),\n })\n .describe(\"Bad Request\")\n\nexport const errorUnauthorized = z\n .object({\n code: z.literal(401),\n error: z.literal(\"Unauthorized\"),\n reason: z.literal(\"Failed to authenticate\"),\n })\n .describe(dedent`\n Authentication failed. Possible reasons:\n - Authorization header is not provided\n - Invalid API key\n - Session expired\n `)\n\nexport const errorForbidden = z\n .object({\n code: z.literal(403),\n error: z.literal(\"Forbidden\"),\n reason: z.string(),\n })\n .describe(\n \"Access denied. The authenticated user does not have permission to perform this action.\",\n )\n\nexport const errorNotFound = z\n .object({\n code: z.literal(404),\n error: z.literal(\"Not Found\"),\n reason: z.string(),\n })\n .describe(\"Resource not found.\")\n\nexport const errorValidationFailed = z\n .object({\n code: z.literal(422),\n error: z.literal(\"Validation Failed\"),\n reason: z.unknown(),\n })\n .describe(\n \"Request validation failed. Check the request body, query parameters, or path parameters.\",\n )\n\nexport const paginationMeta = z.object({\n total: z.number().int().min(0),\n take: z.number().int().min(1),\n skip: z.number().int().min(0),\n})\n\n// Flexible error response schemas for route handlers (reason is z.string() for custom messages)\nexport const errorUnauthorizedFlexible = z\n .object({\n code: z.literal(401),\n error: z.literal(\"Unauthorized\"),\n reason: z.string(),\n })\n .describe(\"Unauthorized\")\n\n// Common error responses object for route handlers\nexport const commonErrorResponses = {\n 400: errorBadRequest,\n 401: errorUnauthorizedFlexible,\n 403: errorForbidden,\n 404: errorNotFound,\n 422: errorValidationFailed,\n}\n","import { z } from \"zod\"\nimport { apiKeyPermissionsSchema, apiKeySchema } from \"../../domain/apiKey\"\nimport { cuidSchema } from \"../../domain/common\"\nimport { paginationMeta } from \"../common\"\n\nexport const request = {\n query: z.object({\n take: z.coerce.number().min(1).max(100).default(20),\n skip: z.coerce.number().min(0).default(0),\n }),\n}\n\nconst apiKeyWithApplicationsSchema = apiKeySchema.extend({\n permissions: apiKeyPermissionsSchema.optional(),\n wildcardApplicationAccess: z.boolean(),\n applicationIds: z.array(cuidSchema),\n})\n\nexport const response = z.object({\n data: z.object({\n apiKeys: z.array(apiKeyWithApplicationsSchema),\n }),\n meta: paginationMeta,\n})\n\nexport type RequestQuery = z.infer<typeof request.query>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { apiKeyPermissionsSchema, apiKeySchema } from \"../../domain/apiKey\"\nimport { cuidSchema } from \"../../domain/common\"\n\nexport const request = {\n params: z.object({\n apiKeyId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n apiKey: apiKeySchema.extend({\n permissions: apiKeyPermissionsSchema.optional(),\n wildcardApplicationAccess: z.boolean(),\n applicationIds: z.array(cuidSchema),\n }),\n }),\n})\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type Response = z.infer<typeof response>\n","import { applicationNameRegex, maxApplicationNameLength } from \"@repo/constants\"\nimport { z } from \"zod\"\nimport { cuidSchema, datetimeSchema, providerSchema } from \"./common\"\nimport { organizationSchema } from \"./organization\"\n\n// Field schemas for composition\nexport const applicationNameSchema = z\n .string()\n .min(1)\n .max(maxApplicationNameLength)\n .regex(applicationNameRegex)\nexport const applicationStatusSchema = z.enum([\"active\", \"inactive\", \"deleted\"])\nexport type ApplicationStatus = z.infer<typeof applicationStatusSchema>\n\nexport const applicationSchema = z.object({\n type: z.literal(\"application\"),\n id: cuidSchema,\n organizationId: cuidSchema,\n organization: organizationSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n name: applicationNameSchema,\n status: applicationStatusSchema,\n expertCount: z\n .number()\n .describe(\"Number of expert draft scopes associated with this application\")\n .optional(),\n providers: z\n .array(providerSchema)\n .describe(\"List of configured providers for this application\")\n .optional(),\n})\nexport type Application = z.infer<typeof applicationSchema>\n","import { z } from \"zod\"\nimport { applicationNameSchema, applicationSchema } from \"../../domain/application\"\nimport { cuidSchema } from \"../../domain/common\"\n\nexport const request = {\n body: z.object({\n name: applicationNameSchema,\n applicationGroupId: cuidSchema.optional(),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n application: applicationSchema,\n }),\n})\n\n// Request types\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { applicationSchema } from \"../../domain/application\"\nimport { cuidSchema } from \"../../domain/common\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n application: applicationSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { applicationSchema } from \"../../domain/application\"\nimport { cuidSchema } from \"../../domain/common\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n application: applicationSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { applicationSchema } from \"../../domain/application\"\nimport { paginationMeta } from \"../common\"\n\nexport const request = {\n query: z.object({\n name: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .transform((v) => (Array.isArray(v) ? v.join(\",\") : v)),\n sort: z.enum([\"name\", \"createdAt\", \"updatedAt\"]).optional(),\n order: z.enum([\"asc\", \"desc\"]).optional(),\n take: z.coerce.number().min(1).max(100).default(20),\n skip: z.coerce.number().min(0).default(0),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n applications: z.array(applicationSchema),\n }),\n meta: paginationMeta,\n})\n\n// Request types\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport {\n applicationNameSchema,\n applicationSchema,\n applicationStatusSchema,\n} from \"../../domain/application\"\nimport { cuidSchema } from \"../../domain/common\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n }),\n body: z\n .object({\n name: applicationNameSchema.optional(),\n status: applicationStatusSchema.exclude([\"deleted\"]).optional(),\n })\n .refine((data) => data.name !== undefined || data.status !== undefined, {\n message: \"At least one field must be provided\",\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n application: applicationSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { maxSecretValueLength } from \"@repo/constants\"\nimport { z } from \"zod\"\nimport { cuidSchema, datetimeSchema } from \"./common\"\n\n// Secret name validation: uppercase letters, numbers, underscores only\nexport const secretNameSchema = z\n .string()\n .min(1, \"Secret name is required\")\n .max(255, \"Secret name must be 255 characters or less\")\n .regex(\n /^[A-Z][A-Z0-9_]*$/,\n \"Secret name must start with uppercase letter and contain only uppercase letters, numbers, and underscores\",\n )\n\n// Secret value validation\nexport const secretValueSchema = z\n .string()\n .min(1, \"Secret value is required\")\n .max(maxSecretValueLength)\n\n// Secret metadata schema (never includes value for security)\nexport const secretMetadataSchema = z.object({\n name: z.string(),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n})\nexport type SecretMetadata = z.infer<typeof secretMetadataSchema>\n\n// Full secret schema (internal use only - value should never be exposed)\nexport const secretSchema = z.object({\n type: z.literal(\"secret\"),\n id: cuidSchema,\n name: secretNameSchema,\n applicationId: cuidSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n})\nexport type Secret = z.infer<typeof secretSchema>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { secretMetadataSchema, secretNameSchema, secretValueSchema } from \"../../../domain/secret\"\n\nexport const request = {\n body: z.object({\n applicationId: cuidSchema,\n name: secretNameSchema,\n value: secretValueSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n secret: secretMetadataSchema,\n }),\n})\n\n// Request types\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\n\nexport const request = {\n params: z.object({\n name: z.string().min(1),\n }),\n query: z.object({\n applicationId: cuidSchema,\n }),\n}\n\nexport const response = z.null()\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { secretMetadataSchema } from \"../../../domain/secret\"\n\nexport const request = {\n params: z.object({\n name: z.string().min(1),\n }),\n query: z.object({\n applicationId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n secret: secretMetadataSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { secretMetadataSchema } from \"../../../domain/secret\"\n\nexport const request = {\n query: z.object({\n applicationId: cuidSchema.optional(),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n secrets: z.array(secretMetadataSchema),\n }),\n})\n\n// Request types\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { secretMetadataSchema, secretValueSchema } from \"../../../domain/secret\"\n\nexport const request = {\n params: z.object({\n name: z.string().min(1),\n }),\n body: z.object({\n applicationId: cuidSchema,\n value: secretValueSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n secret: secretMetadataSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { maxVariableValueLength } from \"@repo/constants\"\nimport { z } from \"zod\"\nimport { cuidSchema, datetimeSchema } from \"./common\"\n\n// Field-level schemas\nexport const variableNameSchema = z\n .string()\n .min(1)\n .max(255)\n .regex(\n /^[A-Z][A-Z0-9_]*$/,\n \"Variable name must start with uppercase letter and contain only uppercase letters, digits, and underscores\",\n )\n\nexport const variableValueSchema = z.string().max(maxVariableValueLength)\n\n// Main schema (internal representation with id and applicationId)\nexport const variableSchema = z.object({\n type: z.literal(\"variable\"),\n id: cuidSchema,\n applicationId: cuidSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n name: variableNameSchema,\n value: variableValueSchema,\n})\nexport type Variable = z.infer<typeof variableSchema>\n\n// Response schema (API response format without internal fields)\nexport const variableResponseSchema = z.object({\n name: variableNameSchema,\n value: variableValueSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n})\nexport type VariableResponse = z.infer<typeof variableResponseSchema>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport {\n variableNameSchema,\n variableResponseSchema,\n variableValueSchema,\n} from \"../../../domain/variable\"\n\nexport const request = {\n body: z.object({\n applicationId: cuidSchema,\n name: variableNameSchema,\n value: variableValueSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n variable: variableResponseSchema,\n }),\n})\n\n// Request types\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\n\nexport const request = {\n params: z.object({\n name: z.string().min(1),\n }),\n query: z.object({\n applicationId: cuidSchema,\n }),\n}\n\nexport const response = z.null()\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { variableResponseSchema } from \"../../../domain/variable\"\n\nexport const request = {\n params: z.object({\n name: z.string().min(1),\n }),\n query: z.object({\n applicationId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n variable: variableResponseSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { variableResponseSchema } from \"../../../domain/variable\"\n\nexport const request = {\n query: z.object({\n applicationId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n variables: z.array(variableResponseSchema),\n }),\n})\n\n// Request types\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { variableResponseSchema, variableValueSchema } from \"../../../domain/variable\"\n\nexport const request = {\n params: z.object({\n name: z.string().min(1),\n }),\n body: z.object({\n applicationId: cuidSchema,\n value: variableValueSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n variable: variableResponseSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport {\n cuidSchema,\n datetimeSchema,\n expertCategoryFieldSchema,\n expertTagFieldSchema,\n expertVersionFieldSchema,\n scopeNameSchema,\n} from \"./common\"\n\nexport const expertScopeSchema = z.object({\n id: cuidSchema,\n name: scopeNameSchema,\n organizationId: cuidSchema,\n published: z.boolean(),\n publishedAt: datetimeSchema.optional(),\n category: expertCategoryFieldSchema,\n totalRuns: z.number().int().min(0),\n totalJobs: z.number().int().min(0),\n totalStars: z.number().int().min(0),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n createdBy: cuidSchema,\n updatedBy: cuidSchema,\n})\n/** Namespace for versioned experts. Globally unique name owned by an organization. */\nexport type ExpertScope = z.infer<typeof expertScopeSchema>\n\nexport const expertVersionSchema = z.object({\n id: cuidSchema,\n expertScopeId: cuidSchema,\n version: expertVersionFieldSchema,\n public: z.boolean(),\n yanked: z.boolean(),\n totalRuns: z.number().int().min(0),\n totalJobs: z.number().int().min(0),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n createdBy: cuidSchema,\n updatedBy: cuidSchema,\n tags: z.array(expertTagFieldSchema),\n})\n/** Immutable version record in DB. Content stored in R2. See `expert.ts` for version string schema. */\nexport type ExpertVersion = z.infer<typeof expertVersionSchema>\n\nexport const expertScopeWithVersionsSchema = expertScopeSchema.extend({\n versions: z.array(expertVersionSchema),\n})\n/** Scope aggregate with all versions and tags. For detailed scope view. */\nexport type ExpertScopeWithVersions = z.infer<typeof expertScopeWithVersionsSchema>\n","import {\n envNameRegex,\n maxEnvNameLength,\n maxSkillDescriptionLength,\n maxSkillEndpointLength,\n maxSkillInputJsonSchemaLength,\n maxSkillNameLength,\n maxSkillPickOmitItems,\n maxSkillRequiredEnvItems,\n maxSkillRuleLength,\n maxSkillToolNameLength,\n packageWithVersionRegex,\n urlSafeRegex,\n} from \"@repo/constants\"\nimport { z } from \"zod\"\n\nfunction isPrivateOrLocalIP(hostname: string): boolean {\n if (\n hostname === \"localhost\" ||\n hostname === \"127.0.0.1\" ||\n hostname === \"::1\" ||\n hostname === \"0.0.0.0\"\n ) {\n return true\n }\n const ipv4Match = hostname.match(/^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/)\n if (ipv4Match) {\n const a = Number(ipv4Match[1])\n const b = Number(ipv4Match[2])\n if (a === 10) return true\n if (a === 172 && b >= 16 && b <= 31) return true\n if (a === 192 && b === 168) return true\n if (a === 169 && b === 254) return true\n if (a === 127) return true\n }\n if (hostname.includes(\":\")) {\n if (hostname.startsWith(\"fe80:\") || hostname.startsWith(\"fc\") || hostname.startsWith(\"fd\")) {\n return true\n }\n }\n if (hostname.startsWith(\"::ffff:\")) {\n const ipv4Part = hostname.slice(7)\n if (isPrivateOrLocalIP(ipv4Part)) {\n return true\n }\n }\n return false\n}\n\nconst sseEndpointSchema = z\n .string()\n .max(maxSkillEndpointLength)\n .url()\n .refine(\n (url) => {\n try {\n const parsed = new URL(url)\n if (parsed.protocol !== \"https:\") return false\n if (isPrivateOrLocalIP(parsed.hostname)) return false\n return true\n } catch {\n return false\n }\n },\n { message: \"Endpoint must be a public HTTPS URL\" },\n )\n\nexport const skillNameSchema = z\n .string()\n .min(1)\n .max(maxSkillNameLength)\n .regex(packageWithVersionRegex)\nexport type SkillName = z.infer<typeof skillNameSchema>\n\nexport const mcpStdioSkillCommandSchema = z.enum([\"npx\", \"uvx\"])\nexport type McpStdioSkillCommand = z.infer<typeof mcpStdioSkillCommandSchema>\n\nexport const mcpStdioSkillSchema = z.object({\n type: z.literal(\"mcpStdioSkill\"),\n name: z.string(),\n description: z.string().min(1).max(maxSkillDescriptionLength),\n rule: z.string().min(1).max(maxSkillRuleLength).optional(),\n pick: z\n .array(z.string().min(1).max(maxSkillToolNameLength))\n .max(maxSkillPickOmitItems)\n .optional()\n .default([]),\n omit: z\n .array(z.string().min(1).max(maxSkillToolNameLength))\n .max(maxSkillPickOmitItems)\n .optional()\n .default([]),\n command: mcpStdioSkillCommandSchema,\n packageName: z.string().min(1).max(maxSkillNameLength).regex(packageWithVersionRegex),\n requiredEnv: z\n .array(z.string().min(1).max(maxEnvNameLength).regex(envNameRegex))\n .min(0)\n .max(maxSkillRequiredEnvItems)\n .optional(),\n})\nexport type McpStdioSkill = z.infer<typeof mcpStdioSkillSchema>\n\nexport const mcpSseSkillSchema = z.object({\n type: z.literal(\"mcpSseSkill\"),\n name: z.string(),\n description: z.string().min(1).max(maxSkillDescriptionLength),\n rule: z.string().min(1).max(maxSkillRuleLength).optional(),\n pick: z\n .array(z.string().min(1).max(maxSkillToolNameLength))\n .max(maxSkillPickOmitItems)\n .optional()\n .default([]),\n omit: z\n .array(z.string().min(1).max(maxSkillToolNameLength))\n .max(maxSkillPickOmitItems)\n .optional()\n .default([]),\n endpoint: sseEndpointSchema,\n})\nexport type McpSseSkill = z.infer<typeof mcpSseSkillSchema>\n\nexport const interactiveSkillSchema = z.object({\n type: z.literal(\"interactiveSkill\"),\n name: z.string(),\n description: z.string().min(1).max(maxSkillDescriptionLength),\n rule: z.string().min(1).max(maxSkillRuleLength).optional(),\n tools: z.record(\n z.string().min(1).max(maxSkillToolNameLength).regex(urlSafeRegex),\n z.object({\n description: z.string().min(1).max(maxSkillDescriptionLength),\n inputJsonSchema: z.string().min(1).max(maxSkillInputJsonSchemaLength),\n }),\n ),\n})\nexport type InteractiveSkill = z.infer<typeof interactiveSkillSchema>\n\nexport const skillSchema = z.discriminatedUnion(\"type\", [\n mcpStdioSkillSchema,\n mcpSseSkillSchema,\n interactiveSkillSchema,\n])\nexport type Skill = z.infer<typeof skillSchema>\n","import {\n maxExpertDelegateItems,\n maxExpertDescriptionLength,\n maxExpertInstructionLength,\n maxExpertTagItems,\n} from \"@repo/constants\"\nimport { z } from \"zod\"\nimport {\n expertKeyFieldSchema,\n expertNameFieldSchema,\n expertTagFieldSchema,\n expertVersionFieldSchema,\n} from \"./common\"\nimport { expertScopeSchema, expertVersionSchema } from \"./expertScope\"\nimport { skillNameSchema, skillSchema } from \"./skill\"\n\nexport const expertSchema = z.object({\n key: expertKeyFieldSchema,\n name: expertNameFieldSchema,\n version: expertVersionFieldSchema,\n description: z.string().min(1).max(maxExpertDescriptionLength).optional(),\n instruction: z.string().min(1).max(maxExpertInstructionLength),\n skills: z.record(skillNameSchema, skillSchema).optional().default({}),\n delegates: z\n .array(expertKeyFieldSchema)\n .min(0)\n .max(maxExpertDelegateItems)\n .optional()\n .default([]),\n tags: z.array(expertTagFieldSchema).min(0).max(maxExpertTagItems).optional().default([]),\n})\n/** Core expert entity compatible with `@perstack/core`. Executed by the perstack runtime. */\nexport type Expert = z.infer<typeof expertSchema>\n\nexport const expertMetadataSchema = z.object({\n scope: expertScopeSchema,\n version: expertVersionSchema,\n})\n/** Backend metadata for an expert. Used for listings, filtering, and admin operations. */\nexport type ExpertMetadata = z.infer<typeof expertMetadataSchema>\n\nexport const expertWithMetadataSchema = expertSchema.extend({\n scope: expertScopeSchema,\n version: expertVersionSchema,\n})\n/** Full expert entity combining core schema with backend metadata. */\nexport type ExpertWithMetadata = z.infer<typeof expertWithMetadataSchema>\n","import { z } from \"zod\"\nimport {\n cuidSchema,\n datetimeSchema,\n expertKeyFieldSchema,\n expertNameFieldSchema,\n expertVersionFieldSchema,\n} from \"../../domain/common\"\nimport { expertSchema } from \"../../domain/expert\"\n\nexport const expertDefinitionSchema = z.object({\n name: expertNameFieldSchema,\n version: expertVersionFieldSchema,\n organizationId: cuidSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n createdBy: cuidSchema,\n updatedBy: cuidSchema,\n experts: z.record(expertKeyFieldSchema, expertSchema.omit({ key: true })),\n})\n/** Immutable expert definition. Passed to perstack runtime. */\nexport type ExpertDefinition = z.infer<typeof expertDefinitionSchema>\n","import { z } from \"zod\"\nimport { scopeNameRefSchema } from \"../../domain/common\"\nimport { expertMetadataSchema } from \"../../domain/expert\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameRefSchema,\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: expertMetadataSchema.extend({\n yanked: z.literal(true),\n latestTagUpdated: z.boolean(),\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, datetimeSchema, scopeNameSchema } from \"./common\"\n\nexport const expertDraftScopeSchema = z.object({\n id: cuidSchema,\n name: scopeNameSchema,\n organizationId: cuidSchema,\n applicationId: cuidSchema,\n totalRuns: z.number().int().min(0),\n totalJobs: z.number().int().min(0),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n createdBy: cuidSchema,\n updatedBy: cuidSchema,\n})\n/** Mutable workspace for developing experts. Per-application until versioned. */\nexport type ExpertDraftScope = z.infer<typeof expertDraftScopeSchema>\n\nexport const expertDraftRefSchema = z.object({\n id: cuidSchema,\n expertDraftScopeId: cuidSchema,\n totalRuns: z.number().int().min(0),\n totalJobs: z.number().int().min(0),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n createdBy: cuidSchema,\n updatedBy: cuidSchema,\n})\n/** Snapshot of a draft scope. Each update creates a new ref. */\nexport type ExpertDraftRef = z.infer<typeof expertDraftRefSchema>\n\nexport const expertDraftScopeWithRefsSchema = expertDraftScopeSchema.extend({\n draftRefs: z.array(expertDraftRefSchema),\n})\n/** Draft scope aggregate with all refs. For detailed draft view. */\nexport type ExpertDraftScopeWithRefs = z.infer<typeof expertDraftScopeWithRefsSchema>\n","import { z } from \"zod\"\nimport {\n cuidSchema,\n datetimeSchema,\n expertKeyFieldSchema,\n expertNameFieldSchema,\n} from \"../../../domain/common\"\nimport { expertSchema } from \"../../../domain/expert\"\n\nexport const expertDefinitionContentSchema = z.object({\n name: expertNameFieldSchema,\n version: z.literal(\"0.0.0-draft\"),\n applicationId: cuidSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n createdBy: cuidSchema,\n updatedBy: cuidSchema,\n experts: z.record(expertKeyFieldSchema, expertSchema.omit({ key: true })),\n})\n/** Immutable expert definition. Passed to perstack runtime. */\nexport type ExpertDefinitionContent = z.infer<typeof expertDefinitionContentSchema>\n","import { z } from \"zod\"\nimport { cuidSchema, scopeNameSchema } from \"../../../domain/common\"\nimport { expertSchema } from \"../../../domain/expert\"\nimport { expertDraftRefSchema, expertDraftScopeSchema } from \"../../../domain/expertDraftScope\"\nimport { expertDefinitionContentSchema } from \"./definition\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameSchema,\n }),\n body: z.object({\n applicationId: cuidSchema,\n experts: z.array(expertSchema),\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n scope: expertDraftScopeSchema,\n draftRef: expertDraftRefSchema,\n definition: expertDefinitionContentSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { scopeNameSchema } from \"../../../domain/common\"\nimport { expertDraftRefSchema } from \"../../../domain/expertDraftScope\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameSchema,\n draftRef: expertDraftRefSchema.shape.id,\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n deleted: z.boolean(),\n draftRef: z.string(),\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { scopeNameSchema } from \"../../../domain/common\"\nimport { expertDraftRefSchema, expertDraftScopeSchema } from \"../../../domain/expertDraftScope\"\nimport { expertDefinitionContentSchema } from \"./definition\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameSchema,\n draftRef: expertDraftRefSchema.shape.id,\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n scope: expertDraftScopeSchema,\n draftRef: expertDraftRefSchema,\n definition: expertDefinitionContentSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { expertDraftRefSchema, expertDraftScopeSchema } from \"../../../domain/expertDraftScope\"\nimport { paginationMeta } from \"../../common\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: expertDraftScopeSchema.shape.name,\n }),\n query: z.object({\n take: z.coerce.number().int().min(1).max(100).default(20),\n skip: z.coerce.number().int().min(0).default(0),\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n draftRefs: z.array(expertDraftRefSchema),\n }),\n meta: paginationMeta,\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { scopeNameSchema } from \"../../../domain/common\"\nimport { expertSchema } from \"../../../domain/expert\"\nimport { expertDraftRefSchema, expertDraftScopeSchema } from \"../../../domain/expertDraftScope\"\nimport { expertDefinitionContentSchema } from \"./definition\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameSchema,\n draftRef: expertDraftRefSchema.shape.id,\n }),\n body: z.object({\n experts: z.array(expertSchema),\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n scope: expertDraftScopeSchema,\n draftRef: expertDraftRefSchema,\n definition: expertDefinitionContentSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { expertVersionRegex, maxExpertVersionTagLength, tagNameRegex } from \"@repo/constants\"\nimport { z } from \"zod\"\nimport { scopeNameSchema } from \"../../../domain/common\"\nimport { expertScopeSchema, expertVersionSchema } from \"../../../domain/expertScope\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameSchema,\n draftRef: z.string().min(1),\n }),\n body: z.object({\n version: z\n .string()\n .min(1, \"Version is required.\")\n .max(maxExpertVersionTagLength, \"Version is too long.\")\n .regex(expertVersionRegex, \"Invalid version format. (e.g. 1.0.0)\"),\n tag: z\n .string()\n .max(maxExpertVersionTagLength, \"Tag is too long.\")\n .regex(tagNameRegex, \"Invalid tag format. (e.g. latest)\")\n .optional(),\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n scope: expertScopeSchema,\n version: expertVersionSchema,\n definitionUrl: z.string(),\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { expertScopeSchema, expertVersionSchema } from \"../../domain/expertScope\"\n\n// Request schemas (empty - no params or query required)\nexport const request = {}\n\nexport const response = z.object({\n data: z.object({\n featuredExperts: z.array(\n z.object({\n scope: expertScopeSchema,\n currentVersion: expertVersionSchema,\n displayOrder: z.number().int().min(0).max(2),\n featuredAt: z.string().datetime(),\n }),\n ),\n }),\n})\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { scopeNameRefSchema } from \"../../domain/common\"\nimport { expertDefinitionSchema } from \"./definition\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameRefSchema,\n }),\n}\n\n// Response schema (200 only)\nexport const response = z.object({\n data: z.object({\n definition: expertDefinitionSchema,\n yanked: z.boolean().optional(),\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { expertScopeSchema, expertVersionSchema } from \"../../domain/expertScope\"\nimport { paginationMeta } from \"../common\"\n\n// Request schemas\nexport const request = {\n query: z.object({\n filter: z.string().describe(\"Filter by scope name (partial match)\").optional(),\n category: z\n .enum([\"general\", \"coding\", \"research\", \"writing\", \"data\", \"automation\"])\n .describe(\"Filter by category\")\n .optional(),\n includeDrafts: z.coerce\n .boolean()\n .default(false)\n .describe(\"Include unpublished scopes (owner only)\")\n .optional(),\n take: z.coerce.number().min(1).max(100).default(20),\n skip: z.coerce.number().min(0).default(0),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n experts: z.array(\n expertScopeSchema.extend({\n currentVersion: expertVersionSchema,\n }),\n ),\n }),\n meta: paginationMeta,\n})\n\n// Request types\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { scopeNameRefSchema } from \"../../domain/common\"\nimport { expertMetadataSchema } from \"../../domain/expert\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameRefSchema,\n }),\n query: z.object({\n public: z\n .enum([\"true\", \"false\"])\n .transform((val) => val === \"true\")\n .optional()\n .default(false)\n .describe(\"Public access check (no auth)\"),\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: expertMetadataSchema.extend({\n definitionUrl: z.string(),\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { scopeNameSchema } from \"../../domain/common\"\nimport { expertScopeSchema } from \"../../domain/expertScope\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameSchema,\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n scope: expertScopeSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { scopeNameSchema } from \"../../domain/common\"\nimport { expertScopeSchema } from \"../../domain/expertScope\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameSchema,\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n scope: expertScopeSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { scopeNameSchema } from \"../../domain/common\"\nimport { expertVersionSchema } from \"../../domain/expertScope\"\n\n// Request schemas\nexport const request = {\n params: z.object({\n scopeName: scopeNameSchema,\n }),\n}\n\n// Response schemas\nexport const response = z.object({\n data: z.object({\n versions: z.array(expertVersionSchema),\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { activityOrGroupSchema } from \"@perstack/core\"\nimport { maxCheckpointToolCallIdLength, maxSkillToolNameLength } from \"@repo/constants\"\nimport { z } from \"zod\"\nimport { cuidSchema, datetimeSchema } from \"./common\"\nimport { expertSchema } from \"./expert\"\nimport {\n instructionMessageSchema,\n messageSchema,\n toolMessageSchema,\n userMessageSchema,\n} from \"./message\"\nimport { toolCallSchema } from \"./toolCall\"\nimport { toolResultSchema } from \"./toolResult\"\nimport { usageSchema } from \"./usage\"\n\n// Re-export types from @perstack/core\n// Activity types and Checkpoint types for runtime communication\nexport {\n type Activity,\n type ActivityOrGroup,\n type ActivityType,\n activityOrGroupSchema,\n activitySchema,\n type Checkpoint as PerstackCheckpoint,\n type CheckpointStatus,\n checkpointSchema as perstackCheckpointSchema,\n checkpointStatusSchema,\n // Utility function for computing activities from checkpoint and step\n getActivities,\n} from \"@perstack/core\"\n\nconst delegationTargetSchema = z.object({\n expert: expertSchema,\n toolCallId: z.string().min(1).max(maxCheckpointToolCallIdLength),\n toolName: z.string().min(1).max(maxSkillToolNameLength),\n query: z.string(),\n})\n\n/**\n * API Checkpoint schema - extended checkpoint format for API responses.\n * Includes additional fields computed from runtime checkpoint and step data:\n * - activities: computed via getActivities() from @perstack/core\n * - inputMessages, newMessages, toolCalls, toolResults: step-related data\n * - expert: full Expert type (with instruction, skills, etc.)\n * - startedAt/finishedAt: ISO string format (runtime uses Unix timestamps)\n */\nexport const apiCheckpointSchema = z.object({\n type: z.literal(\"checkpoint\"),\n id: cuidSchema,\n jobId: cuidSchema,\n runId: cuidSchema,\n activities: z.array(activityOrGroupSchema),\n stepNumber: z.number().int().min(1),\n status: z.enum([\n \"init\",\n \"proceeding\",\n \"completed\",\n \"stoppedByInteractiveTool\",\n \"stoppedByDelegate\",\n \"stoppedByExceededMaxSteps\",\n \"stoppedByError\",\n ]),\n expert: expertSchema,\n delegateTo: z.array(delegationTargetSchema).optional(),\n delegatedBy: z\n .object({\n expert: expertSchema,\n toolCallId: z.string().min(1).max(maxCheckpointToolCallIdLength),\n toolName: z.string().min(1).max(maxSkillToolNameLength),\n checkpointId: cuidSchema,\n runId: cuidSchema,\n })\n .optional(),\n inputMessages: z\n .array(z.union([instructionMessageSchema, userMessageSchema, toolMessageSchema]))\n .optional(),\n messages: z.array(messageSchema),\n newMessages: z.array(messageSchema),\n toolCalls: z.array(toolCallSchema).optional(),\n toolResults: z.array(toolResultSchema).optional(),\n pendingToolCalls: z.array(toolCallSchema).optional(),\n partialToolResults: z.array(toolResultSchema).optional(),\n usage: usageSchema,\n contextWindow: z.number().int().min(0).optional(),\n contextWindowUsage: z.number().int().min(0).optional(),\n error: z\n .object({\n name: z.string(),\n message: z.string(),\n statusCode: z.number().optional(),\n isRetryable: z.boolean(),\n })\n .optional(),\n retryCount: z.number().optional(),\n startedAt: datetimeSchema,\n finishedAt: datetimeSchema.optional(),\n})\nexport type ApiCheckpoint = z.infer<typeof apiCheckpointSchema>\n","import { z } from \"zod\"\nimport { apiCheckpointSchema, perstackCheckpointSchema } from \"../../../domain/checkpoint\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { stepSchema } from \"../../../domain/step\"\n\n/**\n * Request checkpoint schema - `id` and `runId` are omitted because:\n * - `id` is server-generated (CUID)\n * - `runId` is optional in request, server will use job's run ID\n */\nexport const requestCheckpointSchema = perstackCheckpointSchema\n .omit({ id: true, runId: true })\n .extend({ runId: z.string().optional() })\n\nexport type RequestCheckpoint = z.infer<typeof requestCheckpointSchema>\n\nexport const request = {\n params: z.object({\n jobId: cuidSchema,\n }),\n body: z.object({\n checkpoint: requestCheckpointSchema,\n step: stepSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n checkpoint: apiCheckpointSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { apiCheckpointSchema } from \"../../../domain/checkpoint\"\nimport { cuidSchema } from \"../../../domain/common\"\n\nexport const request = {\n params: z.object({\n jobId: cuidSchema,\n checkpointId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n checkpoint: apiCheckpointSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { apiCheckpointSchema } from \"../../../domain/checkpoint\"\nimport { cuidSchema } from \"../../../domain/common\"\nimport { paginationMeta } from \"../../common\"\n\nexport const request = {\n params: z.object({\n jobId: cuidSchema,\n }),\n query: z.object({\n filter: z.string().min(1).max(256).optional(),\n sort: z.enum([\"createdAt\", \"updatedAt\"]).optional(),\n order: z.enum([\"asc\", \"desc\"]).optional(),\n take: z.coerce.number().min(1).max(100).default(20),\n skip: z.coerce.number().min(0).default(0),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n checkpoints: z.array(apiCheckpointSchema),\n }),\n meta: paginationMeta,\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { apiCheckpointSchema } from \"../../../domain/checkpoint\"\nimport { cuidSchema } from \"../../../domain/common\"\n\nexport const request = {\n params: z.object({\n jobId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: apiCheckpointSchema,\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","// Ollama is excluded from this package because it is designed for local-only usage.\n// Perstack supports Ollama via CLI for local development, but not in cloud environments.\n// See: https://docs.perstack.ai/references/providers-and-models#ollama\n\nexport type Provider =\n | \"anthropic\"\n | \"google\"\n | \"openai\"\n | \"deepseek\"\n | \"azure-openai\"\n | \"amazon-bedrock\"\n | \"google-vertex\"\n\nexport interface SupportModel {\n modelId: string\n default: boolean\n provider: Provider\n contextWindow: number\n}\n\nconst anthropicSupportModels: SupportModel[] = [\n {\n modelId: \"claude-opus-4-5\",\n default: false,\n provider: \"anthropic\",\n contextWindow: 200_000,\n },\n {\n modelId: \"claude-opus-4-1\",\n default: false,\n provider: \"anthropic\",\n contextWindow: 200_000,\n },\n {\n modelId: \"claude-opus-4-20250514\",\n default: false,\n provider: \"anthropic\",\n contextWindow: 200_000,\n },\n {\n modelId: \"claude-sonnet-4-5\",\n default: true,\n provider: \"anthropic\",\n contextWindow: 200_000,\n },\n {\n modelId: \"claude-sonnet-4-20250514\",\n default: false,\n provider: \"anthropic\",\n contextWindow: 200_000,\n },\n {\n modelId: \"claude-3-7-sonnet-20250219\",\n default: false,\n provider: \"anthropic\",\n contextWindow: 200_000,\n },\n {\n modelId: \"claude-haiku-4-5\",\n default: false,\n provider: \"anthropic\",\n contextWindow: 200_000,\n },\n {\n modelId: \"claude-3-5-haiku-latest\",\n default: false,\n provider: \"anthropic\",\n contextWindow: 200_000,\n },\n]\n\nconst googleSupportModels: SupportModel[] = [\n {\n modelId: \"gemini-3-pro-preview\",\n default: false,\n provider: \"google\",\n contextWindow: 1_000_000,\n },\n {\n modelId: \"gemini-2.5-pro\",\n default: true,\n provider: \"google\",\n contextWindow: 1_000_000,\n },\n {\n modelId: \"gemini-2.5-flash\",\n default: false,\n provider: \"google\",\n contextWindow: 1_000_000,\n },\n {\n modelId: \"gemini-2.5-flash-lite\",\n default: false,\n provider: \"google\",\n contextWindow: 1_000_000,\n },\n]\n\nconst openAiSupportModels: SupportModel[] = [\n {\n modelId: \"gpt-5\",\n default: true,\n provider: \"openai\",\n contextWindow: 400_000,\n },\n {\n modelId: \"gpt-5-mini\",\n default: false,\n provider: \"openai\",\n contextWindow: 400_000,\n },\n {\n modelId: \"gpt-5-nano\",\n default: false,\n provider: \"openai\",\n contextWindow: 400_000,\n },\n {\n modelId: \"gpt-5-chat-latest\",\n default: false,\n provider: \"openai\",\n contextWindow: 128_000,\n },\n {\n modelId: \"o4-mini\",\n default: false,\n provider: \"openai\",\n contextWindow: 200_000,\n },\n {\n modelId: \"o3\",\n default: false,\n provider: \"openai\",\n contextWindow: 200_000,\n },\n {\n modelId: \"o3-mini\",\n default: false,\n provider: \"openai\",\n contextWindow: 200_000,\n },\n {\n modelId: \"gpt-4.1\",\n default: false,\n provider: \"openai\",\n contextWindow: 1_000_000,\n },\n]\n\nconst deepseekSupportModels: SupportModel[] = [\n {\n modelId: \"deepseek-chat\",\n default: true,\n provider: \"deepseek\",\n contextWindow: 128_000,\n },\n {\n modelId: \"deepseek-reasoner\",\n default: false,\n provider: \"deepseek\",\n contextWindow: 128_000,\n },\n]\n\nconst allSupportModels: SupportModel[] = [\n ...anthropicSupportModels,\n ...googleSupportModels,\n ...openAiSupportModels,\n ...deepseekSupportModels,\n]\n\nconst supportModels: Record<string, SupportModel> = Object.fromEntries(\n allSupportModels.map((model) => [model.modelId, model]),\n)\n\nexport function getDefaultModelId(): string {\n const model = Object.values(supportModels).find((model) => model.default)\n if (!model) {\n throw new Error(\"No default model found\")\n }\n return model.modelId\n}\n\nexport function getSupportModelNames(): string[] {\n return Object.keys(supportModels)\n}\n\nexport function getSupportModelsByProvider(provider?: Provider): Record<Provider, SupportModel[]> {\n const result: Record<Provider, SupportModel[]> = {\n anthropic: [],\n google: [],\n openai: [],\n deepseek: [],\n \"azure-openai\": [],\n \"amazon-bedrock\": [],\n \"google-vertex\": [],\n }\n if (provider === \"anthropic\" || !provider) {\n result.anthropic = anthropicSupportModels\n }\n if (provider === \"google\" || !provider) {\n result.google = googleSupportModels\n }\n if (provider === \"openai\" || !provider) {\n result.openai = openAiSupportModels\n }\n if (provider === \"deepseek\" || !provider) {\n result.deepseek = deepseekSupportModels\n }\n return result\n}\n\nexport function getProviderByModelId(modelId: string): Provider {\n const model = supportModels[modelId]\n if (!model) {\n throw new Error(`Model ${modelId} not found`)\n }\n return model.provider\n}\n\nconst modelsByProvider: Record<Provider, SupportModel[]> = {\n anthropic: anthropicSupportModels,\n google: googleSupportModels,\n openai: openAiSupportModels,\n deepseek: deepseekSupportModels,\n \"azure-openai\": anthropicSupportModels,\n \"amazon-bedrock\": anthropicSupportModels,\n \"google-vertex\": googleSupportModels,\n}\n\nexport function getDefaultModelByProvider(provider: Provider): string {\n const models = modelsByProvider[provider]\n if (!models || models.length === 0) {\n throw new Error(`No models found for provider ${provider}`)\n }\n const defaultModel = models.find((model) => model.default)\n if (defaultModel) {\n return defaultModel.modelId\n }\n const firstModel = models[0]\n if (!firstModel) {\n throw new Error(`No models found for provider ${provider}`)\n }\n return firstModel.modelId\n}\n\nexport function isModelValidForProvider(modelId: string, provider: Provider): boolean {\n const models = modelsByProvider[provider]\n if (!models) {\n return false\n }\n return models.some((model) => model.modelId === modelId)\n}\n\nexport function getModelsForProvider(provider: Provider): SupportModel[] {\n return modelsByProvider[provider] ?? []\n}\n","import { maxExpertJobFileNameLength, maxExpertJobQueryLength } from \"@repo/constants\"\nimport { getSupportModelNames } from \"@repo/support-models\"\nimport { z } from \"zod\"\nimport { cuidSchema, datetimeSchema, expertKeyFieldSchema, providerSchema } from \"./common\"\nimport { expertWithMetadataSchema } from \"./expert\"\nimport { usageSchema } from \"./usage\"\n\nexport const reasoningBudgetSchema = z.union([\n z.enum([\"none\", \"minimal\", \"low\", \"medium\", \"high\"]),\n z.number().min(0),\n])\nexport type ReasoningBudget = z.infer<typeof reasoningBudgetSchema>\n\nexport const jobStatusSchema = z.enum([\n \"queued\",\n \"processing\",\n \"completed\",\n \"requestInteractiveToolResult\",\n \"requestDelegateResult\",\n \"exceededMaxSteps\",\n \"failed\",\n \"canceling\",\n \"canceled\",\n \"expired\",\n])\nexport type JobStatus = z.infer<typeof jobStatusSchema>\n\n// Build model enum from support models\nconst modelNames = getSupportModelNames()\nconst firstModel = modelNames[0]\nif (firstModel === undefined) {\n throw new Error(\"No support models available\")\n}\nconst modelEnum = z.enum([firstModel, ...modelNames.slice(1)])\n\nexport const jobSchema = z.object({\n type: z.literal(\"job\"),\n id: cuidSchema,\n organizationId: cuidSchema,\n applicationId: cuidSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n status: jobStatusSchema,\n coordinatorExpertKey: expertKeyFieldSchema,\n query: z.string().min(1).max(maxExpertJobQueryLength).optional(),\n files: z.array(z.string().min(1).max(maxExpertJobFileNameLength)),\n expert: expertWithMetadataSchema,\n provider: providerSchema,\n model: modelEnum,\n reasoningBudget: reasoningBudgetSchema,\n maxSteps: z.number().int().min(1),\n maxRetries: z.number().int().min(0),\n currentStep: z.number().int().min(0),\n totalSteps: z.number().int().min(0),\n totalDuration: z.number().min(0),\n usage: usageSchema,\n})\nexport type Job = z.infer<typeof jobSchema>\n","import { z } from \"zod\"\nimport { cuidSchema, providerSchema } from \"../../domain/common\"\nimport { jobSchema, reasoningBudgetSchema } from \"../../domain/job\"\n\nexport const request = {\n params: z.object({\n jobId: cuidSchema,\n }),\n body: z.object({\n query: jobSchema.shape.query.optional(),\n interactiveToolCallResult: z.boolean().optional(),\n files: z.union([z.instanceof(File), z.array(z.instanceof(File))]).optional(),\n provider: providerSchema.optional(),\n model: jobSchema.shape.model.optional(),\n reasoningBudget: reasoningBudgetSchema.optional(),\n maxSteps: z.coerce.number().optional(),\n maxRetries: z.coerce.number().optional(),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n job: jobSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, expertKeyFieldSchema, providerSchema } from \"../../domain/common\"\nimport { jobSchema, reasoningBudgetSchema } from \"../../domain/job\"\n\nexport const request = {\n body: z.object({\n applicationId: cuidSchema.describe(\"Application ID to create the job in\"),\n expertKey: expertKeyFieldSchema,\n query: jobSchema.shape.query.optional(),\n files: z.union([z.instanceof(File), z.array(z.instanceof(File))]).optional(),\n provider: providerSchema,\n model: jobSchema.shape.model.optional(),\n reasoningBudget: reasoningBudgetSchema.optional(),\n maxSteps: z.coerce.number().optional(),\n maxRetries: z.coerce.number().optional(),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n job: jobSchema,\n }),\n})\n\n// Request types\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../domain/common\"\nimport { jobSchema } from \"../../domain/job\"\n\nexport const request = {\n params: z.object({\n jobId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n job: jobSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { jobSchema } from \"../../domain/job\"\nimport { paginationMeta } from \"../common\"\n\nexport const request = {\n query: z.object({\n sort: z.enum([\"createdAt\", \"updatedAt\"]).optional(),\n order: z.enum([\"asc\", \"desc\"]).optional(),\n take: z.coerce.number().min(1).max(100).default(20),\n skip: z.coerce.number().min(0).default(0),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n jobs: z.array(jobSchema),\n }),\n meta: paginationMeta,\n})\n\n// Request types\nexport type RequestQuery = z.infer<typeof request.query>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../domain/common\"\nimport { jobSchema, jobStatusSchema } from \"../../domain/job\"\n\nexport const request = {\n params: z.object({\n jobId: cuidSchema,\n }),\n body: z.object({\n status: jobStatusSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n job: jobSchema,\n }),\n})\n\n// Request types\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\n\n// Response types\nexport type Response = z.infer<typeof response>\n","import {\n maxProviderBaseUrlLength,\n maxProviderHeaderKeyLength,\n maxProviderHeadersCount,\n maxProviderHeaderValueLength,\n} from \"@repo/constants\"\nimport { z } from \"zod\"\nimport { applicationSchema } from \"./application\"\nimport { cuidSchema, datetimeSchema, providerSchema } from \"./common\"\n\nconst baseUrlSchema = z.string().url().max(maxProviderBaseUrlLength).optional()\nconst headersSchema = z\n .record(\n z.string().min(1).max(maxProviderHeaderKeyLength),\n z.string().max(maxProviderHeaderValueLength),\n )\n .refine((headers) => Object.keys(headers).length <= maxProviderHeadersCount, {\n message: `Headers must have at most ${maxProviderHeadersCount} entries`,\n })\n .optional()\n\nexport const anthropicProviderSettingsSchema = z.object({\n baseUrl: baseUrlSchema,\n headers: headersSchema,\n})\nexport type AnthropicProviderSettings = z.infer<typeof anthropicProviderSettingsSchema>\n\nexport const googleProviderSettingsSchema = z.object({\n baseUrl: baseUrlSchema,\n headers: headersSchema,\n})\nexport type GoogleProviderSettings = z.infer<typeof googleProviderSettingsSchema>\n\nexport const openaiProviderSettingsSchema = z.object({\n baseUrl: baseUrlSchema,\n headers: headersSchema,\n organization: z.string().optional(),\n project: z.string().optional(),\n name: z.string().optional(),\n})\nexport type OpenaiProviderSettings = z.infer<typeof openaiProviderSettingsSchema>\n\nexport const deepseekProviderSettingsSchema = z.object({\n baseUrl: baseUrlSchema,\n headers: headersSchema,\n})\nexport type DeepseekProviderSettings = z.infer<typeof deepseekProviderSettingsSchema>\n\nexport const azureOpenaiProviderSettingsSchema = z.object({\n baseUrl: baseUrlSchema,\n headers: headersSchema,\n resourceName: z.string().optional(),\n apiVersion: z.string().optional(),\n useDeploymentBasedUrls: z.boolean().optional(),\n})\nexport type AzureOpenaiProviderSettings = z.infer<typeof azureOpenaiProviderSettingsSchema>\n\nexport const amazonBedrockProviderSettingsSchema = z.object({\n region: z.string().optional(),\n})\nexport type AmazonBedrockProviderSettings = z.infer<typeof amazonBedrockProviderSettingsSchema>\n\nexport const googleVertexProviderSettingsSchema = z.object({\n baseUrl: baseUrlSchema,\n headers: headersSchema,\n project: z.string().optional(),\n location: z.string().optional(),\n})\nexport type GoogleVertexProviderSettings = z.infer<typeof googleVertexProviderSettingsSchema>\n\nexport const providerSettingsSchema = z.union([\n anthropicProviderSettingsSchema,\n googleProviderSettingsSchema,\n openaiProviderSettingsSchema,\n deepseekProviderSettingsSchema,\n azureOpenaiProviderSettingsSchema,\n amazonBedrockProviderSettingsSchema,\n googleVertexProviderSettingsSchema,\n])\nexport type ProviderSettings = z.infer<typeof providerSettingsSchema>\n\nexport const providerSettingSchema = z.object({\n type: z.literal(\"providerSetting\"),\n id: cuidSchema,\n applicationId: cuidSchema,\n provider: providerSchema,\n settings: providerSettingsSchema.optional(),\n application: applicationSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n})\nexport type ProviderSetting = z.infer<typeof providerSettingSchema>\n\nexport const providerSettingResponseSchema = z.object({\n type: z.literal(\"providerSetting\"),\n id: cuidSchema,\n provider: providerSchema,\n settings: providerSettingsSchema.optional(),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n})\nexport type ProviderSettingResponse = z.infer<typeof providerSettingResponseSchema>\n\nexport const providerApiKeyMetadataSchema = z.object({\n id: cuidSchema,\n name: z.string(),\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n lastUsedAt: datetimeSchema.nullable(),\n expiresAt: datetimeSchema.nullable(),\n})\nexport type ProviderApiKeyMetadata = z.infer<typeof providerApiKeyMetadataSchema>\n","import { z } from \"zod\"\nimport { cuidSchema, providerSchema } from \"../../../domain/common\"\nimport { providerApiKeyMetadataSchema } from \"../../../domain/providerSetting\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n provider: providerSchema,\n }),\n body: z.object({\n name: z.string().min(1).max(255),\n value: z.string().min(1),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n apiKey: providerApiKeyMetadataSchema,\n }),\n})\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, providerSchema } from \"../../../domain/common\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n provider: providerSchema,\n apiKeyId: cuidSchema,\n }),\n}\n\nexport const response = z.null()\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, providerSchema } from \"../../../domain/common\"\nimport { providerApiKeyMetadataSchema } from \"../../../domain/providerSetting\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n provider: providerSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n apiKeys: z.array(providerApiKeyMetadataSchema),\n }),\n})\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, providerSchema } from \"../../domain/common\"\nimport { providerSettingResponseSchema, providerSettingsSchema } from \"../../domain/providerSetting\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n }),\n body: z.object({\n provider: providerSchema,\n settings: providerSettingsSchema.optional(),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n providerSetting: providerSettingResponseSchema,\n }),\n})\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, providerSchema } from \"../../domain/common\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n provider: providerSchema,\n }),\n}\n\nexport const response = z.null()\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, providerSchema } from \"../../domain/common\"\nimport {\n providerApiKeyMetadataSchema,\n providerSettingResponseSchema,\n} from \"../../domain/providerSetting\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n provider: providerSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n providerSetting: providerSettingResponseSchema,\n apiKeys: z.array(providerApiKeyMetadataSchema),\n }),\n})\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema } from \"../../domain/common\"\nimport { providerSettingResponseSchema } from \"../../domain/providerSetting\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n providerSettings: z.array(providerSettingResponseSchema),\n }),\n})\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, providerSchema } from \"../../domain/common\"\nimport { providerSettingResponseSchema, providerSettingsSchema } from \"../../domain/providerSetting\"\n\nexport const request = {\n params: z.object({\n applicationId: cuidSchema,\n provider: providerSchema,\n }),\n body: z.object({\n settings: providerSettingsSchema.optional(),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n providerSetting: providerSettingResponseSchema,\n }),\n})\n\nexport type RequestParams = z.infer<typeof request.params>\nexport type RequestBody = z.infer<typeof request.body>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { applicationSchema } from \"../../domain/application\"\nimport { organizationSchema } from \"../../domain/organization\"\nimport { userSchema } from \"../../domain/user\"\n\nexport const request = {}\n\nexport const response = z.object({\n data: z.object({\n user: userSchema,\n organization: organizationSchema,\n application: applicationSchema.nullable(),\n }),\n})\n\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\n\nexport const request = {\n body: z.object({\n applicationId: z.string().min(1, \"Application ID is required\"),\n }),\n}\n\nexport const response = z.object({\n data: z.object({\n success: z.literal(true),\n }),\n})\n\nexport type RequestBody = z.infer<typeof request.body>\nexport type Response = z.infer<typeof response>\n","import { z } from \"zod\"\nimport { cuidSchema, datetimeSchema } from \"./common\"\nimport { providerSettingSchema } from \"./providerSetting\"\n\n// Field schemas for composition\nexport const providerApiKeyNameSchema = z.string().min(1).max(255)\nexport const providerApiKeyValueSchema = z.string().min(1)\n\nexport const providerApiKeySchema = z.object({\n type: z.literal(\"providerApiKey\"),\n id: cuidSchema,\n providerSettingId: cuidSchema,\n name: providerApiKeyNameSchema,\n lastUsedAt: datetimeSchema.optional(),\n expiresAt: datetimeSchema.optional(),\n providerSetting: providerSettingSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n})\nexport type ProviderApiKey = z.infer<typeof providerApiKeySchema>\n","import { z } from \"zod\"\nimport { cuidSchema, datetimeSchema, expertKeyFieldSchema, runtimeVersionSchema } from \"./common\"\nimport { expertWithMetadataSchema } from \"./expert\"\nimport { usageSchema } from \"./usage\"\n\nexport const runStatusSchema = z.enum([\n \"queued\",\n \"processing\",\n \"completed\",\n \"stoppedByInteractiveTool\",\n \"stoppedByDelegate\",\n \"stoppedByExceededMaxSteps\",\n \"stoppedByError\",\n])\nexport type RunStatus = z.infer<typeof runStatusSchema>\n\nexport const runSchema = z.object({\n type: z.literal(\"run\"),\n id: cuidSchema,\n jobId: cuidSchema,\n parentRunId: cuidSchema.optional(),\n organizationId: cuidSchema,\n createdAt: datetimeSchema,\n updatedAt: datetimeSchema,\n status: runStatusSchema,\n runtimeVersion: runtimeVersionSchema,\n expertKey: expertKeyFieldSchema,\n interactiveToolCallResult: z.boolean().optional(),\n expert: expertWithMetadataSchema,\n stepNumber: z.number().int().min(0),\n usage: usageSchema,\n machineId: z.string().optional(),\n})\nexport type Run = z.infer<typeof runSchema>\n","import type { ApiError } from \"./fetcher\"\n\ninterface ValidationError {\n issues: ReadonlyArray<{ path: ReadonlyArray<PropertyKey>; message: string }>\n}\n\nexport function createValidationError(error: ValidationError): ApiError {\n const issues = error.issues.map((issue) => `${issue.path.join(\".\")}: ${issue.message}`).join(\"; \")\n return {\n errorType: \"validation\",\n code: 400,\n message: `Validation failed: ${issues}`,\n reason: error.issues,\n }\n}\n\nexport function createAbortError(): ApiError {\n return {\n errorType: \"abort\",\n code: 0,\n message: \"Request aborted\",\n aborted: true,\n }\n}\n\nexport function createTimeoutError(): ApiError {\n return {\n errorType: \"timeout\",\n code: 0,\n message: \"Request timed out\",\n }\n}\n\nexport function createNetworkError(error: unknown): ApiError {\n return {\n errorType: \"network\",\n code: 0,\n message: error instanceof Error ? error.message : \"Network error\",\n reason: error,\n cause: error instanceof Error ? error : undefined,\n }\n}\n\nexport async function handleHttpError(response: Response): Promise<{ ok: false; error: ApiError }> {\n let errorBody: unknown\n try {\n errorBody = await response.json()\n } catch {\n errorBody = undefined\n }\n return {\n ok: false,\n error: createHttpError(response.status, response.statusText, errorBody),\n }\n}\n\nexport function createHttpError(status: number, statusText: string, body?: unknown): ApiError {\n if (typeof body === \"object\" && body !== null) {\n const hasReason = \"reason\" in body\n if (\"error\" in body && typeof body.error === \"string\") {\n return {\n errorType: \"http\",\n code: status,\n message: body.error,\n reason: hasReason ? body.reason : undefined,\n }\n }\n if (hasReason) {\n return {\n errorType: \"http\",\n code: status,\n message: statusText,\n reason: body.reason,\n }\n }\n }\n return {\n errorType: \"http\",\n code: status,\n message: statusText,\n }\n}\n\n// Type guards\n\nexport function isHttpError(error: ApiError): boolean {\n return error.errorType === \"http\"\n}\n\nexport function isNetworkError(error: ApiError): boolean {\n return error.errorType === \"network\"\n}\n\nexport function isTimeoutError(error: ApiError): boolean {\n return error.errorType === \"timeout\"\n}\n\nexport function isValidationError(error: ApiError): boolean {\n return error.errorType === \"validation\"\n}\n\nexport function isAbortError(error: ApiError): boolean {\n return error.errorType === \"abort\"\n}\n\nexport function isClientError(error: ApiError): boolean {\n return error.errorType !== \"http\"\n}\n","import { ApiKeysAPI } from \"@repo/models\"\nimport { createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\n\nconst BASE_PATH = \"/api/v1/api_keys\"\n\nexport interface ApiKeysApi {\n create(\n input: ApiKeysAPI.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ApiKeysAPI.Create.Response>>\n\n list(\n input?: ApiKeysAPI.GetAll.RequestQuery,\n options?: RequestOptions,\n ): Promise<ApiResult<ApiKeysAPI.GetAll.Response>>\n\n get(id: string, options?: RequestOptions): Promise<ApiResult<ApiKeysAPI.Get.Response>>\n\n revoke(id: string, options?: RequestOptions): Promise<ApiResult<ApiKeysAPI.Revoke.Response>>\n}\n\nexport function createApiKeysApi(fetcher: Fetcher): ApiKeysApi {\n return {\n async create(input, options) {\n const result = ApiKeysAPI.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<ApiKeysAPI.Create.Response>(BASE_PATH, input, options)\n },\n\n async list(input, options) {\n const queryParams = new URLSearchParams()\n if (input?.take !== undefined) queryParams.set(\"take\", String(input.take))\n if (input?.skip !== undefined) queryParams.set(\"skip\", String(input.skip))\n const queryString = queryParams.toString()\n const url = queryString ? `${BASE_PATH}?${queryString}` : BASE_PATH\n return fetcher.get<ApiKeysAPI.GetAll.Response>(url, options)\n },\n\n async get(id, options) {\n const result = ApiKeysAPI.Get.request.params.safeParse({ apiKeyId: id })\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.get<ApiKeysAPI.Get.Response>(`${BASE_PATH}/${id}`, options)\n },\n\n async revoke(id, options) {\n const result = ApiKeysAPI.Revoke.request.params.safeParse({ apiKeyId: id })\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<ApiKeysAPI.Revoke.Response>(`${BASE_PATH}/${id}/revoke`, {}, options)\n },\n }\n}\n","export function buildQueryString<T extends Record<string, unknown>>(params?: T): string {\n if (!params) return \"\"\n const searchParams = new URLSearchParams()\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n searchParams.set(key, String(value))\n }\n }\n const queryString = searchParams.toString()\n return queryString ? `?${queryString}` : \"\"\n}\n","import { ApplicationsAPI } from \"@repo/models\"\nimport { createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\nimport { buildQueryString } from \"../lib/query-string\"\n\nconst BASE_PATH = \"/api/v1/applications\"\n\nexport interface ApplicationsApi {\n list(\n params?: ApplicationsAPI.GetAll.RequestQuery,\n options?: RequestOptions,\n ): Promise<ApiResult<ApplicationsAPI.GetAll.Response>>\n get(id: string, options?: RequestOptions): Promise<ApiResult<ApplicationsAPI.Get.Response>>\n create(\n input: ApplicationsAPI.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ApplicationsAPI.Get.Response>>\n update(\n id: string,\n input: ApplicationsAPI.Update.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ApplicationsAPI.Get.Response>>\n delete(id: string, options?: RequestOptions): Promise<ApiResult<ApplicationsAPI.Get.Response>>\n}\n\nexport function createApplicationsApi(fetcher: Fetcher): ApplicationsApi {\n return {\n async list(params, options) {\n if (params) {\n const result = ApplicationsAPI.GetAll.request.query.safeParse(params)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n }\n const queryString = buildQueryString(params)\n return fetcher.get<ApplicationsAPI.GetAll.Response>(`${BASE_PATH}${queryString}`, options)\n },\n async get(id, options) {\n return fetcher.get<ApplicationsAPI.Get.Response>(`${BASE_PATH}/${id}`, options)\n },\n async create(input, options) {\n const result = ApplicationsAPI.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<ApplicationsAPI.Get.Response>(BASE_PATH, input, options)\n },\n async update(id, input, options) {\n const result = ApplicationsAPI.Update.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<ApplicationsAPI.Get.Response>(`${BASE_PATH}/${id}`, input, options)\n },\n async delete(id, options) {\n return fetcher.delete<ApplicationsAPI.Get.Response>(`${BASE_PATH}/${id}`, options)\n },\n }\n}\n","import { EnvAPI } from \"@repo/models\"\nimport { createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\nimport { buildQueryString } from \"../lib/query-string\"\n\nconst BASE_PATH = \"/api/v1/env/secrets\"\n\nexport interface SecretsApi {\n list(\n params?: { applicationId?: string },\n options?: RequestOptions,\n ): Promise<ApiResult<EnvAPI.Secrets.GetAll.Response>>\n get(name: string, options?: RequestOptions): Promise<ApiResult<EnvAPI.Secrets.Get.Response>>\n create(\n input: EnvAPI.Secrets.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<EnvAPI.Secrets.Get.Response>>\n update(\n name: string,\n input: EnvAPI.Secrets.Update.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<EnvAPI.Secrets.Get.Response>>\n delete(name: string, options?: RequestOptions): Promise<ApiResult<void>>\n}\n\nexport function createSecretsApi(fetcher: Fetcher): SecretsApi {\n return {\n async list(params, options) {\n if (params) {\n const result = EnvAPI.Secrets.GetAll.request.query.safeParse(params)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n }\n const queryString = buildQueryString(params)\n return fetcher.get<EnvAPI.Secrets.GetAll.Response>(`${BASE_PATH}${queryString}`, options)\n },\n async get(name, options) {\n const encodedName = encodeURIComponent(name)\n return fetcher.get<EnvAPI.Secrets.Get.Response>(`${BASE_PATH}/${encodedName}`, options)\n },\n async create(input, options) {\n const result = EnvAPI.Secrets.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<EnvAPI.Secrets.Get.Response>(BASE_PATH, input, options)\n },\n async update(name, input, options) {\n const result = EnvAPI.Secrets.Update.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n const encodedName = encodeURIComponent(name)\n return fetcher.put<EnvAPI.Secrets.Get.Response>(`${BASE_PATH}/${encodedName}`, input, options)\n },\n async delete(name, options) {\n const encodedName = encodeURIComponent(name)\n return fetcher.deleteNoContent(`${BASE_PATH}/${encodedName}`, options)\n },\n }\n}\n","import { EnvAPI } from \"@repo/models\"\nimport { createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\nimport { buildQueryString } from \"../lib/query-string\"\n\nconst BASE_PATH = \"/api/v1/env/variables\"\n\nexport interface VariablesApi {\n list(\n params: { applicationId: string },\n options?: RequestOptions,\n ): Promise<ApiResult<EnvAPI.Variables.GetAll.Response>>\n get(name: string, options?: RequestOptions): Promise<ApiResult<EnvAPI.Variables.Get.Response>>\n create(\n input: EnvAPI.Variables.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<EnvAPI.Variables.Get.Response>>\n update(\n name: string,\n input: EnvAPI.Variables.Update.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<EnvAPI.Variables.Get.Response>>\n delete(name: string, options?: RequestOptions): Promise<ApiResult<void>>\n}\n\nexport function createVariablesApi(fetcher: Fetcher): VariablesApi {\n return {\n async list(params, options) {\n const result = EnvAPI.Variables.GetAll.request.query.safeParse(params)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n const queryString = buildQueryString(params)\n return fetcher.get<EnvAPI.Variables.GetAll.Response>(`${BASE_PATH}${queryString}`, options)\n },\n async get(name, options) {\n const encodedName = encodeURIComponent(name)\n return fetcher.get<EnvAPI.Variables.Get.Response>(`${BASE_PATH}/${encodedName}`, options)\n },\n async create(input, options) {\n const result = EnvAPI.Variables.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<EnvAPI.Variables.Get.Response>(BASE_PATH, input, options)\n },\n async update(name, input, options) {\n const result = EnvAPI.Variables.Update.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n const encodedName = encodeURIComponent(name)\n return fetcher.put<EnvAPI.Variables.Get.Response>(\n `${BASE_PATH}/${encodedName}`,\n input,\n options,\n )\n },\n async delete(name, options) {\n const encodedName = encodeURIComponent(name)\n return fetcher.deleteNoContent(`${BASE_PATH}/${encodedName}`, options)\n },\n }\n}\n","import type { Fetcher } from \"../lib/fetcher\"\nimport { createSecretsApi, type SecretsApi } from \"./env-secrets\"\nimport { createVariablesApi, type VariablesApi } from \"./env-variables\"\n\nexport interface EnvApi {\n secrets: SecretsApi\n variables: VariablesApi\n}\n\nexport function createEnvApi(fetcher: Fetcher): EnvApi {\n return {\n secrets: createSecretsApi(fetcher),\n variables: createVariablesApi(fetcher),\n }\n}\n","import { ExpertsAPI } from \"@repo/models\"\nimport { createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\nimport { buildQueryString } from \"../lib/query-string\"\n\nexport interface DraftsApi {\n list(\n scopeName: string,\n params?: ExpertsAPI.Drafts.GetAll.RequestQuery,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Drafts.GetAll.Response>>\n get(\n scopeName: string,\n draftRef: string,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Drafts.Get.Response>>\n create(\n scopeName: string,\n input: ExpertsAPI.Drafts.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Drafts.Create.Response>>\n update(\n scopeName: string,\n draftRef: string,\n input: ExpertsAPI.Drafts.Update.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Drafts.Update.Response>>\n delete(\n scopeName: string,\n draftRef: string,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Drafts.Delete.Response>>\n assignVersion(\n scopeName: string,\n draftRef: string,\n input: ExpertsAPI.Drafts.Version.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Drafts.Version.Response>>\n}\n\nexport function createDraftsApi(fetcher: Fetcher, basePath: string): DraftsApi {\n return {\n async list(scopeName, params, options) {\n if (params) {\n const result = ExpertsAPI.Drafts.GetAll.request.query.safeParse(params)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n }\n const encodedScopeName = encodeURIComponent(scopeName)\n const queryString = buildQueryString(params)\n return fetcher.get<ExpertsAPI.Drafts.GetAll.Response>(\n `${basePath}/${encodedScopeName}/drafts${queryString}`,\n options,\n )\n },\n\n async get(scopeName, draftRef, options) {\n const encodedScopeName = encodeURIComponent(scopeName)\n const encodedDraftRef = encodeURIComponent(draftRef)\n return fetcher.get<ExpertsAPI.Drafts.Get.Response>(\n `${basePath}/${encodedScopeName}/drafts/${encodedDraftRef}`,\n options,\n )\n },\n\n async create(scopeName, input, options) {\n const result = ExpertsAPI.Drafts.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n const encodedScopeName = encodeURIComponent(scopeName)\n return fetcher.post<ExpertsAPI.Drafts.Create.Response>(\n `${basePath}/${encodedScopeName}/drafts`,\n input,\n options,\n )\n },\n\n async update(scopeName, draftRef, input, options) {\n const result = ExpertsAPI.Drafts.Update.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n const encodedScopeName = encodeURIComponent(scopeName)\n const encodedDraftRef = encodeURIComponent(draftRef)\n return fetcher.post<ExpertsAPI.Drafts.Update.Response>(\n `${basePath}/${encodedScopeName}/drafts/${encodedDraftRef}`,\n input,\n options,\n )\n },\n\n async delete(scopeName, draftRef, options) {\n const encodedScopeName = encodeURIComponent(scopeName)\n const encodedDraftRef = encodeURIComponent(draftRef)\n return fetcher.delete<ExpertsAPI.Drafts.Delete.Response>(\n `${basePath}/${encodedScopeName}/drafts/${encodedDraftRef}`,\n options,\n )\n },\n\n async assignVersion(scopeName, draftRef, input, options) {\n const result = ExpertsAPI.Drafts.Version.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n const encodedScopeName = encodeURIComponent(scopeName)\n const encodedDraftRef = encodeURIComponent(draftRef)\n return fetcher.post<ExpertsAPI.Drafts.Version.Response>(\n `${basePath}/${encodedScopeName}/drafts/${encodedDraftRef}/version`,\n input,\n options,\n )\n },\n }\n}\n","import type { ExpertsAPI } from \"@repo/models\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\n\nexport interface VersionsApi {\n list(\n scopeName: string,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Versions.Response>>\n}\n\nexport function createVersionsApi(fetcher: Fetcher, basePath: string): VersionsApi {\n return {\n async list(scopeName, options) {\n const encodedScopeName = encodeURIComponent(scopeName)\n return fetcher.get<ExpertsAPI.Versions.Response>(\n `${basePath}/${encodedScopeName}/versions`,\n options,\n )\n },\n }\n}\n","import { ExpertsAPI } from \"@repo/models\"\nimport { createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\nimport { buildQueryString } from \"../lib/query-string\"\nimport { createDraftsApi, type DraftsApi } from \"./experts-drafts\"\nimport { createVersionsApi, type VersionsApi } from \"./experts-versions\"\n\nconst BASE_PATH = \"/api/v1/experts\"\n\nexport interface ExpertsApi {\n list(\n params?: ExpertsAPI.GetAll.RequestQuery,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.GetAll.Response>>\n get(key: string, options?: RequestOptions): Promise<ApiResult<ExpertsAPI.Get.Response>>\n getFeatured(options?: RequestOptions): Promise<ApiResult<ExpertsAPI.Featured.Response>>\n getMeta(key: string, options?: RequestOptions): Promise<ApiResult<ExpertsAPI.Meta.Response>>\n publish(\n scopeName: string,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Publish.Response>>\n unpublish(\n scopeName: string,\n options?: RequestOptions,\n ): Promise<ApiResult<ExpertsAPI.Unpublish.Response>>\n yank(key: string, options?: RequestOptions): Promise<ApiResult<ExpertsAPI.Delete.Response>>\n drafts: DraftsApi\n versions: VersionsApi\n}\n\nexport function createExpertsApi(fetcher: Fetcher): ExpertsApi {\n return {\n async list(params, options) {\n if (params) {\n const result = ExpertsAPI.GetAll.request.query.safeParse(params)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n }\n const queryString = buildQueryString(params)\n return fetcher.get<ExpertsAPI.GetAll.Response>(`${BASE_PATH}${queryString}`, options)\n },\n\n async get(key, options) {\n const encodedKey = encodeURIComponent(key)\n return fetcher.get<ExpertsAPI.Get.Response>(`${BASE_PATH}/${encodedKey}`, options)\n },\n\n async getFeatured(options) {\n return fetcher.get<ExpertsAPI.Featured.Response>(`${BASE_PATH}/featured`, options)\n },\n\n async getMeta(key, options) {\n const encodedKey = encodeURIComponent(key)\n return fetcher.get<ExpertsAPI.Meta.Response>(`${BASE_PATH}/${encodedKey}/meta`, options)\n },\n\n async publish(scopeName, options) {\n const encodedScopeName = encodeURIComponent(scopeName)\n return fetcher.post<ExpertsAPI.Publish.Response>(\n `${BASE_PATH}/${encodedScopeName}/publish`,\n {},\n options,\n )\n },\n\n async unpublish(scopeName, options) {\n const encodedScopeName = encodeURIComponent(scopeName)\n return fetcher.post<ExpertsAPI.Unpublish.Response>(\n `${BASE_PATH}/${encodedScopeName}/unpublish`,\n {},\n options,\n )\n },\n\n async yank(key, options) {\n const encodedKey = encodeURIComponent(key)\n return fetcher.delete<ExpertsAPI.Delete.Response>(`${BASE_PATH}/${encodedKey}`, options)\n },\n\n drafts: createDraftsApi(fetcher, BASE_PATH),\n versions: createVersionsApi(fetcher, BASE_PATH),\n }\n}\n","interface StreamReader {\n read(): Promise<{ value: Uint8Array | undefined; done: boolean }>\n}\n\nexport async function* parseSSE<T>(reader: StreamReader): AsyncGenerator<T> {\n const decoder = new TextDecoder()\n let buffer = \"\"\n\n while (true) {\n const { value, done } = await reader.read()\n if (done) break\n\n buffer += decoder.decode(value, { stream: true })\n const events = buffer.split(\"\\n\\n\")\n buffer = events.pop() || \"\"\n\n for (const event of events) {\n if (event.trim() === \"\") continue\n\n const lines = event.split(\"\\n\")\n const eventType = lines\n .find((line) => line.startsWith(\"event:\"))\n ?.slice(6)\n .trim()\n const data = lines\n .find((line) => line.startsWith(\"data:\"))\n ?.slice(5)\n .trim()\n\n if (eventType !== \"message\" || !data) {\n continue\n }\n\n try {\n const parsed = JSON.parse(data) as T\n yield parsed\n } catch {\n // Skip malformed JSON events\n }\n }\n }\n}\n","import { type ApiCheckpoint, JobsAPI } from \"@repo/models\"\nimport { createAbortError, createNetworkError, createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions, StreamRequestOptions } from \"../lib/fetcher\"\nimport { buildQueryString } from \"../lib/query-string\"\nimport { parseSSE } from \"../lib/sse\"\n\nexport interface CheckpointsApi {\n list(\n jobId: string,\n params?: JobsAPI.Checkpoints.GetAll.RequestQuery,\n options?: RequestOptions,\n ): Promise<ApiResult<JobsAPI.Checkpoints.GetAll.Response>>\n get(\n jobId: string,\n checkpointId: string,\n options?: RequestOptions,\n ): Promise<ApiResult<JobsAPI.Checkpoints.Get.Response>>\n create(\n jobId: string,\n input: JobsAPI.Checkpoints.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<JobsAPI.Checkpoints.Get.Response>>\n stream(\n jobId: string,\n options?: StreamRequestOptions,\n ): AsyncGenerator<ApiResult<ApiCheckpoint>, void, unknown>\n}\n\nexport function createCheckpointsApi(fetcher: Fetcher, basePath: string): CheckpointsApi {\n return {\n async list(jobId, params, options) {\n if (params) {\n const result = JobsAPI.Checkpoints.GetAll.request.query.safeParse(params)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n }\n const queryString = buildQueryString(params)\n return fetcher.get<JobsAPI.Checkpoints.GetAll.Response>(\n `${basePath}/${jobId}/checkpoints${queryString}`,\n options,\n )\n },\n\n async get(jobId, checkpointId, options) {\n return fetcher.get<JobsAPI.Checkpoints.Get.Response>(\n `${basePath}/${jobId}/checkpoints/${checkpointId}`,\n options,\n )\n },\n\n async create(jobId, input, options) {\n const result = JobsAPI.Checkpoints.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<JobsAPI.Checkpoints.Get.Response>(\n `${basePath}/${jobId}/checkpoints`,\n input,\n options,\n )\n },\n\n async *stream(jobId, options) {\n const result = await fetcher.getStream(`${basePath}/${jobId}/checkpoints/stream`, options)\n if (!result.ok) {\n yield { ok: false, error: result.error }\n return\n }\n const reader = result.data.getReader()\n try {\n for await (const checkpoint of parseSSE<ApiCheckpoint>(reader)) {\n yield { ok: true, data: checkpoint }\n }\n } catch (error) {\n if (error instanceof DOMException && error.name === \"AbortError\") {\n yield { ok: false, error: createAbortError() }\n } else {\n yield { ok: false, error: createNetworkError(error) }\n }\n }\n },\n }\n}\n","import { JobsAPI } from \"@repo/models\"\nimport { createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\nimport { buildQueryString } from \"../lib/query-string\"\nimport { type CheckpointsApi, createCheckpointsApi } from \"./jobs-checkpoints\"\n\nconst BASE_PATH = \"/api/v1/jobs\"\n\nexport interface JobsApi {\n list(\n params?: JobsAPI.GetAll.RequestQuery,\n options?: RequestOptions,\n ): Promise<ApiResult<JobsAPI.GetAll.Response>>\n get(id: string, options?: RequestOptions): Promise<ApiResult<JobsAPI.Get.Response>>\n start(\n input: JobsAPI.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<JobsAPI.Get.Response>>\n update(\n id: string,\n input: JobsAPI.Update.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<JobsAPI.Get.Response>>\n continue(\n id: string,\n input: JobsAPI.Continue.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<JobsAPI.Get.Response>>\n cancel(id: string, options?: RequestOptions): Promise<ApiResult<JobsAPI.Get.Response>>\n checkpoints: CheckpointsApi\n}\n\nexport function createJobsApi(fetcher: Fetcher): JobsApi {\n return {\n async list(params, options) {\n if (params) {\n const result = JobsAPI.GetAll.request.query.safeParse(params)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n }\n const queryString = buildQueryString(params)\n return fetcher.get<JobsAPI.GetAll.Response>(`${BASE_PATH}${queryString}`, options)\n },\n\n async get(id, options) {\n return fetcher.get<JobsAPI.Get.Response>(`${BASE_PATH}/${id}`, options)\n },\n\n async start(input, options) {\n const result = JobsAPI.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<JobsAPI.Get.Response>(BASE_PATH, input, options)\n },\n\n async update(id, input, options) {\n const result = JobsAPI.Update.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<JobsAPI.Get.Response>(`${BASE_PATH}/${id}`, input, options)\n },\n\n async continue(id, input, options) {\n const result = JobsAPI.Continue.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<JobsAPI.Get.Response>(`${BASE_PATH}/${id}/continue`, input, options)\n },\n\n async cancel(id, options) {\n return fetcher.post<JobsAPI.Get.Response>(`${BASE_PATH}/${id}/cancel`, {}, options)\n },\n\n checkpoints: createCheckpointsApi(fetcher, BASE_PATH),\n }\n}\n","import { ProviderSettingsAPI } from \"@repo/models\"\nimport { createValidationError } from \"../lib/errors\"\nimport type { ApiResult, Fetcher, RequestOptions } from \"../lib/fetcher\"\n\nconst BASE_PATH = \"/api/v1/applications\"\n\nexport interface ProviderSettingsApi {\n list(\n applicationId: string,\n options?: RequestOptions,\n ): Promise<ApiResult<ProviderSettingsAPI.GetAll.Response>>\n get(\n applicationId: string,\n provider: string,\n options?: RequestOptions,\n ): Promise<ApiResult<ProviderSettingsAPI.Get.Response>>\n create(\n applicationId: string,\n input: ProviderSettingsAPI.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ProviderSettingsAPI.Create.Response>>\n update(\n applicationId: string,\n provider: string,\n input: ProviderSettingsAPI.Update.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ProviderSettingsAPI.Update.Response>>\n delete(\n applicationId: string,\n provider: string,\n options?: RequestOptions,\n ): Promise<ApiResult<void>>\n listApiKeys(\n applicationId: string,\n provider: string,\n options?: RequestOptions,\n ): Promise<ApiResult<ProviderSettingsAPI.ApiKeys.GetAll.Response>>\n createApiKey(\n applicationId: string,\n provider: string,\n input: ProviderSettingsAPI.ApiKeys.Create.RequestBody,\n options?: RequestOptions,\n ): Promise<ApiResult<ProviderSettingsAPI.ApiKeys.Create.Response>>\n deleteApiKey(\n applicationId: string,\n provider: string,\n apiKeyId: string,\n options?: RequestOptions,\n ): Promise<ApiResult<void>>\n}\n\nexport function createProviderSettingsApi(fetcher: Fetcher): ProviderSettingsApi {\n return {\n async list(applicationId, options) {\n return fetcher.get<ProviderSettingsAPI.GetAll.Response>(\n `${BASE_PATH}/${applicationId}/provider_settings`,\n options,\n )\n },\n async get(applicationId, provider, options) {\n const encodedProvider = encodeURIComponent(provider)\n return fetcher.get<ProviderSettingsAPI.Get.Response>(\n `${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`,\n options,\n )\n },\n async create(applicationId, input, options) {\n const result = ProviderSettingsAPI.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n return fetcher.post<ProviderSettingsAPI.Create.Response>(\n `${BASE_PATH}/${applicationId}/provider_settings`,\n input,\n options,\n )\n },\n async update(applicationId, provider, input, options) {\n const result = ProviderSettingsAPI.Update.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n const encodedProvider = encodeURIComponent(provider)\n return fetcher.post<ProviderSettingsAPI.Update.Response>(\n `${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`,\n input,\n options,\n )\n },\n async delete(applicationId, provider, options) {\n const encodedProvider = encodeURIComponent(provider)\n return fetcher.deleteNoContent(\n `${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`,\n options,\n )\n },\n async listApiKeys(applicationId, provider, options) {\n const encodedProvider = encodeURIComponent(provider)\n return fetcher.get<ProviderSettingsAPI.ApiKeys.GetAll.Response>(\n `${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys`,\n options,\n )\n },\n async createApiKey(applicationId, provider, input, options) {\n const result = ProviderSettingsAPI.ApiKeys.Create.request.body.safeParse(input)\n if (!result.success) {\n return { ok: false, error: createValidationError(result.error) }\n }\n const encodedProvider = encodeURIComponent(provider)\n return fetcher.post<ProviderSettingsAPI.ApiKeys.Create.Response>(\n `${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys`,\n input,\n options,\n )\n },\n async deleteApiKey(applicationId, provider, apiKeyId, options) {\n const encodedProvider = encodeURIComponent(provider)\n const encodedApiKeyId = encodeURIComponent(apiKeyId)\n return fetcher.deleteNoContent(\n `${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys/${encodedApiKeyId}`,\n options,\n )\n },\n }\n}\n","import { createAbortError, createNetworkError, createTimeoutError, handleHttpError } from \"./errors\"\n\nexport type ApiResult<T> = { ok: true; data: T } | { ok: false; error: ApiError }\n\nexport type ApiErrorType = \"http\" | \"network\" | \"timeout\" | \"validation\" | \"abort\"\n\nexport interface ApiError {\n errorType: ApiErrorType\n code: number\n message: string\n reason?: unknown\n aborted?: boolean\n cause?: Error\n}\n\nexport type ApiClientConfig =\n | {\n apiKey: string\n baseUrl?: string\n timeout?: number\n }\n | {\n credentials: \"include\"\n baseUrl?: string\n timeout?: number\n }\n\nexport interface RequestOptions {\n signal?: AbortSignal\n}\n\nexport interface StreamRequestOptions extends RequestOptions {\n /**\n * Timeout in milliseconds between stream data chunks.\n * If no data is received within this period, the stream will be aborted.\n * Defaults to the client's configured timeout.\n */\n streamIdleTimeout?: number\n}\n\nconst DEFAULT_BASE_URL = \"https://api.perstack.ai\"\nconst DEFAULT_TIMEOUT = 30000\n\nexport interface Fetcher {\n get<T>(path: string, options?: RequestOptions): Promise<ApiResult<T>>\n post<T>(path: string, body: unknown, options?: RequestOptions): Promise<ApiResult<T>>\n put<T>(path: string, body: unknown, options?: RequestOptions): Promise<ApiResult<T>>\n delete<T>(path: string, options?: RequestOptions): Promise<ApiResult<T>>\n deleteNoContent(path: string, options?: RequestOptions): Promise<ApiResult<void>>\n getBlob(path: string, options?: RequestOptions): Promise<ApiResult<Blob>>\n getStream(\n path: string,\n options?: StreamRequestOptions,\n ): Promise<ApiResult<ReadableStream<Uint8Array>>>\n}\n\nexport function createFetcher(config: ApiClientConfig): Fetcher {\n const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL\n const timeout = config.timeout ?? DEFAULT_TIMEOUT\n const useCredentials = \"credentials\" in config && config.credentials === \"include\"\n const apiKey = \"apiKey\" in config ? config.apiKey : undefined\n\n function buildUrl(path: string): string {\n return `${baseUrl}${path}`\n }\n\n function buildHeaders(options?: { hasBody?: boolean }): Record<string, string> {\n const headers: Record<string, string> = {}\n if (options?.hasBody) {\n headers[\"Content-Type\"] = \"application/json\"\n }\n if (apiKey) {\n headers.Authorization = `Bearer ${apiKey}`\n }\n return headers\n }\n\n function getCredentials(): \"include\" | undefined {\n return useCredentials ? \"include\" : undefined\n }\n\n function createTimeoutSignal(externalSignal?: AbortSignal): {\n signal: AbortSignal\n cleanup: () => void\n isTimeout: () => boolean\n } {\n const controller = new AbortController()\n let timedOut = false\n const timeoutId = setTimeout(() => {\n timedOut = true\n controller.abort()\n }, timeout)\n let abortHandler: (() => void) | undefined\n if (externalSignal) {\n if (externalSignal.aborted) {\n controller.abort()\n } else {\n abortHandler = () => controller.abort()\n externalSignal.addEventListener(\"abort\", abortHandler)\n }\n }\n return {\n signal: controller.signal,\n cleanup: () => {\n clearTimeout(timeoutId)\n if (abortHandler && externalSignal) {\n externalSignal.removeEventListener(\"abort\", abortHandler)\n }\n },\n isTimeout: () => timedOut,\n }\n }\n\n function wrapStreamWithIdleTimeout(\n stream: ReadableStream<Uint8Array>,\n idleTimeoutMs: number,\n externalSignal?: AbortSignal,\n ): ReadableStream<Uint8Array> {\n const reader = stream.getReader()\n const controller = new AbortController()\n let timeoutId: ReturnType<typeof setTimeout> | undefined\n let abortHandler: (() => void) | undefined\n\n if (externalSignal) {\n if (externalSignal.aborted) {\n controller.abort()\n } else {\n abortHandler = () => controller.abort()\n externalSignal.addEventListener(\"abort\", abortHandler)\n }\n }\n\n function resetTimeout() {\n if (timeoutId) clearTimeout(timeoutId)\n timeoutId = setTimeout(() => controller.abort(), idleTimeoutMs)\n }\n\n function cleanup() {\n if (timeoutId) clearTimeout(timeoutId)\n if (abortHandler && externalSignal) {\n externalSignal.removeEventListener(\"abort\", abortHandler)\n }\n }\n\n return new ReadableStream<Uint8Array>({\n start() {\n resetTimeout()\n },\n\n async pull(streamController) {\n try {\n const result = await Promise.race([\n reader.read(),\n new Promise<never>((_, reject) => {\n if (controller.signal.aborted) {\n reject(new DOMException(\"Stream idle timeout\", \"AbortError\"))\n }\n controller.signal.addEventListener(\"abort\", () => {\n reject(new DOMException(\"Stream idle timeout\", \"AbortError\"))\n })\n }),\n ])\n\n if (result.done) {\n cleanup()\n streamController.close()\n return\n }\n\n resetTimeout()\n streamController.enqueue(result.value)\n } catch (error) {\n cleanup()\n reader.cancel().catch(() => {})\n\n if (error instanceof DOMException && error.name === \"AbortError\") {\n streamController.error(new DOMException(\"Stream idle timeout\", \"AbortError\"))\n } else {\n streamController.error(error)\n }\n }\n },\n\n cancel(reason) {\n cleanup()\n reader.cancel(reason).catch(() => {})\n },\n })\n }\n\n async function request<T>(\n method: string,\n path: string,\n body?: unknown,\n options?: RequestOptions,\n ): Promise<ApiResult<T>> {\n const { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal)\n try {\n const response = await fetch(buildUrl(path), {\n method,\n headers: buildHeaders(body ? { hasBody: true } : undefined),\n body: body ? JSON.stringify(body) : undefined,\n signal,\n credentials: getCredentials(),\n })\n if (!response.ok) {\n return handleHttpError(response)\n }\n const json = await response.json()\n return { ok: true, data: json as T }\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n if (isTimeout()) {\n return { ok: false, error: createTimeoutError() }\n }\n return { ok: false, error: createAbortError() }\n }\n return { ok: false, error: createNetworkError(error) }\n } finally {\n cleanup()\n }\n }\n\n async function requestBlob(path: string, options?: RequestOptions): Promise<ApiResult<Blob>> {\n const { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal)\n try {\n const response = await fetch(buildUrl(path), {\n method: \"GET\",\n headers: buildHeaders(),\n signal,\n credentials: getCredentials(),\n })\n if (!response.ok) {\n return handleHttpError(response)\n }\n const blob = await response.blob()\n return { ok: true, data: blob }\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n if (isTimeout()) {\n return { ok: false, error: createTimeoutError() }\n }\n return { ok: false, error: createAbortError() }\n }\n return { ok: false, error: createNetworkError(error) }\n } finally {\n cleanup()\n }\n }\n\n async function requestStream(\n path: string,\n options?: StreamRequestOptions,\n ): Promise<ApiResult<ReadableStream<Uint8Array>>> {\n const { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal)\n try {\n const response = await fetch(buildUrl(path), {\n method: \"GET\",\n headers: buildHeaders(),\n signal,\n credentials: getCredentials(),\n })\n if (!response.ok) {\n cleanup()\n return handleHttpError(response)\n }\n if (!response.body) {\n cleanup()\n return {\n ok: false,\n error: createNetworkError(new Error(\"Response body is null\")),\n }\n }\n cleanup()\n\n const idleTimeout = options?.streamIdleTimeout ?? timeout\n const wrappedStream = wrapStreamWithIdleTimeout(response.body, idleTimeout, options?.signal)\n return { ok: true, data: wrappedStream }\n } catch (error) {\n cleanup()\n if (error instanceof Error && error.name === \"AbortError\") {\n if (isTimeout()) {\n return { ok: false, error: createTimeoutError() }\n }\n return { ok: false, error: createAbortError() }\n }\n return { ok: false, error: createNetworkError(error) }\n }\n }\n\n async function requestNoContent(\n method: string,\n path: string,\n options?: RequestOptions,\n ): Promise<ApiResult<void>> {\n const { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal)\n try {\n const response = await fetch(buildUrl(path), {\n method,\n headers: buildHeaders(),\n signal,\n credentials: getCredentials(),\n })\n if (!response.ok) {\n return handleHttpError(response)\n }\n return { ok: true, data: undefined }\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n if (isTimeout()) {\n return { ok: false, error: createTimeoutError() }\n }\n return { ok: false, error: createAbortError() }\n }\n return { ok: false, error: createNetworkError(error) }\n } finally {\n cleanup()\n }\n }\n\n return {\n get: <T>(path: string, options?: RequestOptions) => request<T>(\"GET\", path, undefined, options),\n post: <T>(path: string, body: unknown, options?: RequestOptions) =>\n request<T>(\"POST\", path, body, options),\n put: <T>(path: string, body: unknown, options?: RequestOptions) =>\n request<T>(\"PUT\", path, body, options),\n delete: <T>(path: string, options?: RequestOptions) =>\n request<T>(\"DELETE\", path, undefined, options),\n deleteNoContent: (path: string, options?: RequestOptions) =>\n requestNoContent(\"DELETE\", path, options),\n getBlob: (path: string, options?: RequestOptions) => requestBlob(path, options),\n getStream: (path: string, options?: StreamRequestOptions) => requestStream(path, options),\n }\n}\n","import { type ApiKeysApi, createApiKeysApi } from \"./endpoints/api-keys\"\nimport { type ApplicationsApi, createApplicationsApi } from \"./endpoints/applications\"\nimport { createEnvApi, type EnvApi } from \"./endpoints/env\"\nimport { createExpertsApi, type ExpertsApi } from \"./endpoints/experts\"\nimport { createJobsApi, type JobsApi } from \"./endpoints/jobs\"\nimport { createProviderSettingsApi, type ProviderSettingsApi } from \"./endpoints/provider-settings\"\nimport { type ApiClientConfig, createFetcher } from \"./lib/fetcher\"\n\nexport interface ApiClient {\n apiKeys: ApiKeysApi\n applications: ApplicationsApi\n env: EnvApi\n jobs: JobsApi\n experts: ExpertsApi\n providerSettings: ProviderSettingsApi\n}\n\nexport function createApiClient(config: ApiClientConfig): ApiClient {\n const fetcher = createFetcher(config)\n\n return {\n apiKeys: createApiKeysApi(fetcher),\n applications: createApplicationsApi(fetcher),\n env: createEnvApi(fetcher),\n jobs: createJobsApi(fetcher),\n experts: createExpertsApi(fetcher),\n providerSettings: createProviderSettingsApi(fetcher),\n }\n}\n","import type { ApiKeyPermissions } from \"@repo/models\"\n\nexport function matchWildcard(value: string, pattern: string): boolean {\n if (pattern === \"*\") return true\n if (pattern.endsWith(\"*\")) return value.startsWith(pattern.slice(0, -1))\n if (pattern.startsWith(\"*\")) return value.endsWith(pattern.slice(1))\n return value === pattern\n}\n\nexport function matchOperations(operations: string[], requiredOperation: string): boolean {\n return operations.some((pattern) => matchWildcard(requiredOperation, pattern))\n}\n\nexport function matchExperts(experts: string[] | \"*\" | undefined, expertId: string): boolean {\n if (experts === undefined || experts === \"*\") return true\n return experts.some((pattern) => matchWildcard(expertId, pattern))\n}\n\nfunction isApiKeyPermissions(parsed: unknown): parsed is ApiKeyPermissions {\n return (\n typeof parsed === \"object\" &&\n parsed !== null &&\n \"operations\" in parsed &&\n Array.isArray(parsed.operations)\n )\n}\n\nexport function parseApiKeyPermissions(permissionsJson: string | null): ApiKeyPermissions | null {\n if (!permissionsJson) return null\n try {\n const parsed: unknown = JSON.parse(permissionsJson)\n if (!isApiKeyPermissions(parsed)) return null\n return parsed\n } catch {\n return null\n }\n}\n\nexport function stringifyApiKeyPermissions(permissions: ApiKeyPermissions): string {\n return JSON.stringify(permissions)\n}\n","export type AuthOptions = { type: \"apiKey\"; apiKey: string } | { type: \"cookie\"; cookie: string }\n\nexport function buildAuthHeaders(auth: AuthOptions): Record<string, string> {\n if (auth.type === \"apiKey\") {\n return {\n Authorization: `Bearer ${auth.apiKey}`,\n }\n }\n return { Cookie: auth.cookie }\n}\n"],"x_google_ignoreList":[7],"mappings":";;;;;AACA,MAAa,wBAAwB;AACrC,MAAa,4BAA4B;AAGzC,MAAa,uBAAuB;AACpC,MAAa,2BAA2B;AAGxC,MAAa,yBAAyB;AACtC,MAAa,uBAAuB;AAGpC,MAAa,iBACX;AACF,MAAa,kBAAkB;AAC/B,MAAa,iBAAiB;AAC9B,MAAa,oBACX;AACF,MAAa,qBACX;AACF,MAAa,eAAe;AAC5B,MAAa,sBAAsB;AACnC,MAAa,4BAA4B;AACzC,MAAa,qBAAqB;AAClC,MAAa,6BAA6B,OAAO;AACjD,MAAa,6BAA6B,OAAO;AAEjD,MAAa,yBAAyB;AACtC,MAAa,oBAAoB;AAGjC,MAAa,0BAA0B,OAAO;AAC9C,MAAa,6BAA6B,OAAO;AAGjD,MAAa,0BACX;AACF,MAAa,eAAe;AAC5B,MAAa,qBAAqB;AAClC,MAAa,4BAA4B,OAAO;AAChD,MAAa,qBAAqB,OAAO;AACzC,MAAa,wBAAwB;AACrC,MAAa,2BAA2B;AACxC,MAAa,yBAAyB;AACtC,MAAa,yBAAyB,OAAO;AAC7C,MAAa,gCAAgC,OAAO;AAIpD,MAAa,gCAAgC;AAG7C,MAAa,eAAe;AAC5B,MAAa,mBAAmB;AAOhC,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,M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