create-expert 0.0.36 → 0.0.37

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.
@@ -65,22 +65,26 @@ pick = ["readTextFile", "writeTextFile", "listDirectory", "think", "attemptCompl
65
65
 
66
66
  1. First, check if a `perstack.toml` already exists in the current directory using `readTextFile`
67
67
  2. If it exists, read and understand the current configuration
68
- 3. Based on the user's request, create or modify the expert definition
69
- 4. Write the updated perstack.toml using `writeTextFile`
70
- 5. Preserve all existing content when modifying (do not remove existing experts unless asked)
71
- 6. After writing, test-run the expert using `runExpert` to verify it works
72
- 7. Review the activities: check that expected tools were called and the completion text is reasonable
73
- 8. If the test run shows errors or unexpected behavior, fix the perstack.toml and re-test
74
- 9. Use `attemptCompletion` when the expert is created and verified
75
-
76
- ## Testing with runExpert
77
-
78
- After writing a perstack.toml file, always test-run the expert you created:
79
- - Use the absolute path to the perstack.toml you just wrote as `configPath` (use the current working directory path)
80
- - Use the expert key you defined as `expertKey`
81
- - Choose a simple, realistic query that exercises the expert's core functionality
82
- - Review the activities: check that expected tools were called and the completion text is reasonable
83
- - If the run fails or produces errors, fix the perstack.toml and re-test
68
+ 3. Based on the user's request, draft the expert definition
69
+ 4. Create the expert in memory using `createExpert` to validate the definition
70
+ 5. Add it as a delegate using `addDelegate` so you can test it
71
+ 6. Test the expert by calling the delegate tool with a simple, realistic query
72
+ 7. Review the result: check that the expert behaves as expected
73
+ 8. If the test shows errors or unexpected behavior:
74
+ - Use `removeDelegate` to remove the current delegate
75
+ - Modify the definition and call `createExpert` again with the same key
76
+ - Add it as a delegate again with `addDelegate` and re-test
77
+ 9. Once the expert works correctly, write the final `perstack.toml` using `writeTextFile`
78
+ 10. Use `attemptCompletion` when the expert is created and verified
79
+
80
+ ## Testing with createExpert + addDelegate
81
+
82
+ After drafting an expert definition, always test it in memory before writing perstack.toml:
83
+ - Use `createExpert` with the expert key, instruction, description, skills, and other fields
84
+ - Use `addDelegate` with the expert key to make it callable
85
+ - Call the delegate tool with a simple query that exercises the expert's core functionality
86
+ - Review the result to verify correctness
87
+ - If issues arise, iterate: `removeDelegate` -> fix -> `createExpert` -> `addDelegate` -> re-test
84
88
 
85
89
  ## Important Rules
86
90
 
@@ -106,12 +110,7 @@ pick = [
106
110
  "getFileInfo",
107
111
  "think",
108
112
  "attemptCompletion",
113
+ "createExpert",
114
+ "addDelegate",
115
+ "removeDelegate",
109
116
  ]
110
-
111
- [experts."expert".skills."create-expert-skill"]
112
- type = "mcpStdioSkill"
113
- description = "Test-run expert definitions to verify they work correctly"
114
- command = "npx"
115
- packageName = "@perstack/create-expert-skill"
116
- requiredEnv = ["PROVIDER_API_KEY"]
117
- rule = "After creating or modifying an expert in perstack.toml, use runExpert to test it with a simple query. Review the activities to verify correctness."
@@ -1,4 +1,4 @@
1
- import { B as toolMessageSchema, F as usageSchema, H as activityOrGroupSchema, I as toolResultSchema, K as _enum, L as toolCallSchema, Pt as PerstackError, Q as boolean, R as instructionMessageSchema, U as boolean$1, V as userMessageSchema, W as number$1, Y as _undefined, Z as array, et as discriminatedUnion, ft as string, ht as unknown, lt as preprocess, mt as union, ot as number, rt as literal, st as object, ut as record, z as messageSchema } from "./src-DVhxRHrP.js";
1
+ import { $ as boolean, B as messageSchema, Ft as PerstackError, G as number$1, H as userMessageSchema, I as usageSchema, L as toolResultSchema, Q as array, R as toolCallSchema, U as activityOrGroupSchema, V as toolMessageSchema, W as boolean$1, X as _undefined, ct as object, dt as record, gt as unknown, ht as union, it as literal, pt as string, q as _enum, st as number, tt as discriminatedUnion, ut as preprocess, z as instructionMessageSchema } from "./src-D-q0VJ6r.js";
2
2
 
3
3
  //#region ../../node_modules/.pnpm/@perstack+api-client@0.0.55_@perstack+core@packages+core_zod@4.3.6/node_modules/@perstack/api-client/dist/index.mjs
4
4
  function createValidationError(error) {
@@ -1648,4 +1648,4 @@ function toRuntimeExpert(key, expert) {
1648
1648
 
1649
1649
  //#endregion
1650
1650
  export { resolveExpertToRun };
1651
- //# sourceMappingURL=resolve-expert-0uBE0QXU.js.map
1651
+ //# sourceMappingURL=resolve-expert-DsQia0Mr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-expert-0uBE0QXU.js","names":["z.string","z.enum","z.object","z.literal","z.number","z.unknown","z.array","z.preprocess","z.coerce.number","z.boolean","z.record","z.discriminatedUnion","z.coerce.boolean","z.union","z.undefined"],"sources":["../../../node_modules/.pnpm/@perstack+api-client@0.0.55_@perstack+core@packages+core_zod@4.3.6/node_modules/@perstack/api-client/dist/index.mjs","../../../packages/runtime/src/helpers/resolve-expert.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { activityOrGroupSchema, instructionMessageSchema, messageSchema, toolCallSchema, toolMessageSchema, toolResultSchema, usageSchema, userMessageSchema } from \"@perstack/core\";\n\n//#region src/lib/api-key.ts\nfunction matchWildcard(value, pattern) {\n\tif (pattern === \"*\") return true;\n\tif (pattern.endsWith(\"*\")) return value.startsWith(pattern.slice(0, -1));\n\tif (pattern.startsWith(\"*\")) return value.endsWith(pattern.slice(1));\n\treturn value === pattern;\n}\nfunction matchOperations(operations, requiredOperation) {\n\treturn operations.some((pattern) => matchWildcard(requiredOperation, pattern));\n}\nfunction matchExperts(experts, expertId) {\n\tif (experts === void 0 || experts === \"*\") return true;\n\treturn experts.some((pattern) => matchWildcard(expertId, pattern));\n}\nfunction isApiKeyPermissions(parsed) {\n\treturn typeof parsed === \"object\" && parsed !== null && \"operations\" in parsed && Array.isArray(parsed.operations);\n}\nfunction parseApiKeyPermissions(permissionsJson) {\n\tif (!permissionsJson) return null;\n\ttry {\n\t\tconst parsed = JSON.parse(permissionsJson);\n\t\tif (!isApiKeyPermissions(parsed)) return null;\n\t\treturn parsed;\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction stringifyApiKeyPermissions(permissions) {\n\treturn JSON.stringify(permissions);\n}\n\n//#endregion\n//#region src/lib/auth.ts\nfunction buildAuthHeaders(auth) {\n\tif (auth.type === \"apiKey\") return { Authorization: `Bearer ${auth.apiKey}` };\n\treturn { Cookie: auth.cookie };\n}\n\n//#endregion\n//#region src/lib/errors.ts\nfunction createValidationError(error) {\n\treturn {\n\t\terrorType: \"validation\",\n\t\tcode: 400,\n\t\tmessage: `Validation failed: ${error.issues.map((issue) => `${issue.path.join(\".\")}: ${issue.message}`).join(\"; \")}`,\n\t\treason: error.issues\n\t};\n}\nfunction createAbortError() {\n\treturn {\n\t\terrorType: \"abort\",\n\t\tcode: 0,\n\t\tmessage: \"Request aborted\",\n\t\taborted: true\n\t};\n}\nfunction createTimeoutError() {\n\treturn {\n\t\terrorType: \"timeout\",\n\t\tcode: 0,\n\t\tmessage: \"Request timed out\"\n\t};\n}\nfunction createNetworkError(error) {\n\treturn {\n\t\terrorType: \"network\",\n\t\tcode: 0,\n\t\tmessage: error instanceof Error ? error.message : \"Network error\",\n\t\treason: error,\n\t\tcause: error instanceof Error ? error : void 0\n\t};\n}\nasync function handleHttpError(response) {\n\tlet errorBody;\n\ttry {\n\t\terrorBody = await response.json();\n\t} catch {\n\t\terrorBody = void 0;\n\t}\n\treturn {\n\t\tok: false,\n\t\terror: createHttpError(response.status, response.statusText, errorBody)\n\t};\n}\nfunction createHttpError(status, statusText, body) {\n\tif (typeof body === \"object\" && body !== null) {\n\t\tconst hasReason = \"reason\" in body;\n\t\tif (\"error\" in body && typeof body.error === \"string\") return {\n\t\t\terrorType: \"http\",\n\t\t\tcode: status,\n\t\t\tmessage: body.error,\n\t\t\treason: hasReason ? body.reason : void 0\n\t\t};\n\t\tif (hasReason) return {\n\t\t\terrorType: \"http\",\n\t\t\tcode: status,\n\t\t\tmessage: statusText,\n\t\t\treason: body.reason\n\t\t};\n\t}\n\treturn {\n\t\terrorType: \"http\",\n\t\tcode: status,\n\t\tmessage: statusText\n\t};\n}\nfunction isHttpError(error) {\n\treturn error.errorType === \"http\";\n}\nfunction isNetworkError(error) {\n\treturn error.errorType === \"network\";\n}\nfunction isTimeoutError(error) {\n\treturn error.errorType === \"timeout\";\n}\nfunction isValidationError(error) {\n\treturn error.errorType === \"validation\";\n}\nfunction isAbortError(error) {\n\treturn error.errorType === \"abort\";\n}\nfunction isClientError(error) {\n\treturn error.errorType !== \"http\";\n}\n\n//#endregion\n//#region src/lib/fetcher.ts\nconst DEFAULT_BASE_URL = \"https://api.perstack.ai\";\nconst DEFAULT_TIMEOUT = 3e4;\nfunction createFetcher(config) {\n\tconst baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;\n\tconst timeout = config.timeout ?? DEFAULT_TIMEOUT;\n\tconst useCredentials = \"credentials\" in config && config.credentials === \"include\";\n\tconst apiKey = \"apiKey\" in config ? config.apiKey : void 0;\n\tfunction buildUrl(path) {\n\t\treturn `${baseUrl}${path}`;\n\t}\n\tfunction buildHeaders(options) {\n\t\tconst headers = {};\n\t\tif (options?.hasBody) headers[\"Content-Type\"] = \"application/json\";\n\t\tif (apiKey) headers.Authorization = `Bearer ${apiKey}`;\n\t\treturn headers;\n\t}\n\tfunction getCredentials() {\n\t\treturn useCredentials ? \"include\" : void 0;\n\t}\n\tfunction createTimeoutSignal(externalSignal) {\n\t\tconst controller = new AbortController();\n\t\tlet timedOut = false;\n\t\tconst timeoutId = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tcontroller.abort();\n\t\t}, timeout);\n\t\tlet abortHandler;\n\t\tif (externalSignal) if (externalSignal.aborted) controller.abort();\n\t\telse {\n\t\t\tabortHandler = () => controller.abort();\n\t\t\texternalSignal.addEventListener(\"abort\", abortHandler);\n\t\t}\n\t\treturn {\n\t\t\tsignal: controller.signal,\n\t\t\tcleanup: () => {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\tif (abortHandler && externalSignal) externalSignal.removeEventListener(\"abort\", abortHandler);\n\t\t\t},\n\t\t\tisTimeout: () => timedOut\n\t\t};\n\t}\n\tfunction wrapStreamWithIdleTimeout(stream, idleTimeoutMs, externalSignal) {\n\t\tconst reader = stream.getReader();\n\t\tconst controller = new AbortController();\n\t\tlet timeoutId;\n\t\tlet abortHandler;\n\t\tif (externalSignal) if (externalSignal.aborted) controller.abort();\n\t\telse {\n\t\t\tabortHandler = () => controller.abort();\n\t\t\texternalSignal.addEventListener(\"abort\", abortHandler);\n\t\t}\n\t\tfunction resetTimeout() {\n\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\ttimeoutId = setTimeout(() => controller.abort(), idleTimeoutMs);\n\t\t}\n\t\tfunction cleanup() {\n\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\tif (abortHandler && externalSignal) externalSignal.removeEventListener(\"abort\", abortHandler);\n\t\t}\n\t\treturn new ReadableStream({\n\t\t\tstart() {\n\t\t\t\tresetTimeout();\n\t\t\t},\n\t\t\tasync pull(streamController) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await Promise.race([reader.read(), new Promise((_, reject) => {\n\t\t\t\t\t\tif (controller.signal.aborted) reject(new DOMException(\"Stream idle timeout\", \"AbortError\"));\n\t\t\t\t\t\tcontroller.signal.addEventListener(\"abort\", () => {\n\t\t\t\t\t\t\treject(new DOMException(\"Stream idle timeout\", \"AbortError\"));\n\t\t\t\t\t\t});\n\t\t\t\t\t})]);\n\t\t\t\t\tif (result.done) {\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\tstreamController.close();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tresetTimeout();\n\t\t\t\t\tstreamController.enqueue(result.value);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tcleanup();\n\t\t\t\t\treader.cancel().catch(() => {});\n\t\t\t\t\tif (error instanceof DOMException && error.name === \"AbortError\") streamController.error(new DOMException(\"Stream idle timeout\", \"AbortError\"));\n\t\t\t\t\telse streamController.error(error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tcancel(reason) {\n\t\t\t\tcleanup();\n\t\t\t\treader.cancel(reason).catch(() => {});\n\t\t\t}\n\t\t});\n\t}\n\tasync function request(method, path, body, options) {\n\t\tconst { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal);\n\t\ttry {\n\t\t\tconst response = await fetch(buildUrl(path), {\n\t\t\t\tmethod,\n\t\t\t\theaders: buildHeaders(body ? { hasBody: true } : void 0),\n\t\t\t\tbody: body ? JSON.stringify(body) : void 0,\n\t\t\t\tsignal,\n\t\t\t\tcredentials: getCredentials()\n\t\t\t});\n\t\t\tif (!response.ok) return handleHttpError(response);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: await response.json()\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tif (isTimeout()) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createTimeoutError()\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createAbortError()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: createNetworkError(error)\n\t\t\t};\n\t\t} finally {\n\t\t\tcleanup();\n\t\t}\n\t}\n\tasync function requestBlob(path, options) {\n\t\tconst { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal);\n\t\ttry {\n\t\t\tconst response = await fetch(buildUrl(path), {\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: buildHeaders(),\n\t\t\t\tsignal,\n\t\t\t\tcredentials: getCredentials()\n\t\t\t});\n\t\t\tif (!response.ok) return handleHttpError(response);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: await response.blob()\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tif (isTimeout()) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createTimeoutError()\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createAbortError()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: createNetworkError(error)\n\t\t\t};\n\t\t} finally {\n\t\t\tcleanup();\n\t\t}\n\t}\n\tasync function requestStream(path, options) {\n\t\tconst { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal);\n\t\ttry {\n\t\t\tconst response = await fetch(buildUrl(path), {\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: buildHeaders(),\n\t\t\t\tsignal,\n\t\t\t\tcredentials: getCredentials()\n\t\t\t});\n\t\t\tif (!response.ok) {\n\t\t\t\tcleanup();\n\t\t\t\treturn handleHttpError(response);\n\t\t\t}\n\t\t\tif (!response.body) {\n\t\t\t\tcleanup();\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createNetworkError(/* @__PURE__ */ new Error(\"Response body is null\"))\n\t\t\t\t};\n\t\t\t}\n\t\t\tcleanup();\n\t\t\tconst idleTimeout = options?.streamIdleTimeout ?? timeout;\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: wrapStreamWithIdleTimeout(response.body, idleTimeout, options?.signal)\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tcleanup();\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tif (isTimeout()) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createTimeoutError()\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createAbortError()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: createNetworkError(error)\n\t\t\t};\n\t\t}\n\t}\n\tasync function requestNoContent(method, path, options) {\n\t\tconst { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal);\n\t\ttry {\n\t\t\tconst response = await fetch(buildUrl(path), {\n\t\t\t\tmethod,\n\t\t\t\theaders: buildHeaders(),\n\t\t\t\tsignal,\n\t\t\t\tcredentials: getCredentials()\n\t\t\t});\n\t\t\tif (!response.ok) return handleHttpError(response);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: void 0\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tif (isTimeout()) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createTimeoutError()\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createAbortError()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: createNetworkError(error)\n\t\t\t};\n\t\t} finally {\n\t\t\tcleanup();\n\t\t}\n\t}\n\treturn {\n\t\tget: (path, options) => request(\"GET\", path, void 0, options),\n\t\tpost: (path, body, options) => request(\"POST\", path, body, options),\n\t\tput: (path, body, options) => request(\"PUT\", path, body, options),\n\t\tdelete: (path, options) => request(\"DELETE\", path, void 0, options),\n\t\tdeleteNoContent: (path, options) => requestNoContent(\"DELETE\", path, options),\n\t\tgetBlob: (path, options) => requestBlob(path, options),\n\t\tgetStream: (path, options) => requestStream(path, options)\n\t};\n}\n\n//#endregion\n//#region src/lib/query-string.ts\nfunction buildQueryString(params) {\n\tif (!params) return \"\";\n\tconst searchParams = new URLSearchParams();\n\tfor (const [key, value] of Object.entries(params)) if (value !== void 0) searchParams.set(key, String(value));\n\tconst queryString = searchParams.toString();\n\treturn queryString ? `?${queryString}` : \"\";\n}\n\n//#endregion\n//#region src/lib/sse.ts\nasync function* parseSSEEvents(reader) {\n\tconst decoder = new TextDecoder();\n\tlet buffer = \"\";\n\twhile (true) {\n\t\tconst { value, done } = await reader.read();\n\t\tif (done) break;\n\t\tbuffer += decoder.decode(value, { stream: true });\n\t\tconst events = buffer.split(\"\\n\\n\");\n\t\tbuffer = events.pop() || \"\";\n\t\tfor (const event of events) {\n\t\t\tif (event.trim() === \"\") continue;\n\t\t\tconst lines = event.split(\"\\n\");\n\t\t\tconst eventType = lines.find((line) => line.startsWith(\"event:\"))?.slice(6).trim();\n\t\t\tconst data = lines.find((line) => line.startsWith(\"data:\"))?.slice(5).trim();\n\t\t\tif (!eventType || !data) continue;\n\t\t\tif (eventType !== \"message\" && eventType !== \"error\" && eventType !== \"complete\") continue;\n\t\t\ttry {\n\t\t\t\tyield {\n\t\t\t\t\tevent: eventType,\n\t\t\t\t\tdata: JSON.parse(data)\n\t\t\t\t};\n\t\t\t} catch {}\n\t\t}\n\t}\n}\nasync function* parseSSE(reader) {\n\tconst decoder = new TextDecoder();\n\tlet buffer = \"\";\n\twhile (true) {\n\t\tconst { value, done } = await reader.read();\n\t\tif (done) break;\n\t\tbuffer += decoder.decode(value, { stream: true });\n\t\tconst events = buffer.split(\"\\n\\n\");\n\t\tbuffer = events.pop() || \"\";\n\t\tfor (const event of events) {\n\t\t\tif (event.trim() === \"\") continue;\n\t\t\tconst lines = event.split(\"\\n\");\n\t\t\tconst eventType = lines.find((line) => line.startsWith(\"event:\"))?.slice(6).trim();\n\t\t\tconst data = lines.find((line) => line.startsWith(\"data:\"))?.slice(5).trim();\n\t\t\tif (eventType !== \"message\" || !data) continue;\n\t\t\ttry {\n\t\t\t\tyield JSON.parse(data);\n\t\t\t} catch {}\n\t\t}\n\t}\n}\n\n//#endregion\n//#region ../constants/index.ts\nconst organizationNameRegex = /^[a-z0-9][a-z0-9_.-]*$/;\nconst maxOrganizationNameLength = 128;\nconst applicationNameRegex = /^[a-z0-9][a-z0-9_.-]*$/;\nconst maxApplicationNameLength = 255;\nconst maxVariableValueLength = 65536;\nconst maxSecretValueLength = 65536;\nconst expertKeyRegex = /^((?:@[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_.-]*))?$/;\nconst expertNameRegex = /^(@[a-z0-9][a-z0-9_-]*\\/)?[a-z0-9][a-z0-9_-]*$/;\nconst scopeNameRegex = /^[a-z0-9][a-z0-9_-]*$/;\nconst scopeNameRefRegex = /^[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_-]*))?$/;\nconst expertVersionRegex = /^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\w.-]+)?(?:\\+[\\w.-]+)?$/;\nconst tagNameRegex = /^[a-z0-9][a-z0-9_-]*$/;\nconst maxExpertNameLength = 255;\nconst maxExpertVersionTagLength = 255;\nconst maxExpertKeyLength = 511;\nconst maxExpertDescriptionLength = 1024 * 2;\nconst maxExpertInstructionLength = 1024 * 20;\nconst maxExpertDelegateItems = 255;\nconst maxExpertTagItems = 8;\nconst maxExpertJobQueryLength = 1024 * 20;\nconst maxExpertJobFileNameLength = 1024 * 10;\nconst packageWithVersionRegex = /^(?:@[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_.-]*)?$/;\nconst urlSafeRegex = /^[a-z0-9][a-z0-9_-]*$/;\nconst maxSkillNameLength = 255;\nconst maxSkillDescriptionLength = 1024 * 2;\nconst maxSkillRuleLength = 1024 * 2;\nconst maxSkillPickOmitItems = 255;\nconst maxSkillRequiredEnvItems = 255;\nconst maxSkillToolNameLength = 255;\nconst maxSkillEndpointLength = 1024 * 2;\nconst maxSkillInputJsonSchemaLength = 1024 * 20;\nconst maxCheckpointToolCallIdLength = 255;\nconst envNameRegex = /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;\nconst maxEnvNameLength = 255;\nconst maxProviderBaseUrlLength = 2048;\nconst maxProviderHeaderKeyLength = 255;\nconst maxProviderHeaderValueLength = 2048;\nconst maxProviderHeadersCount = 50;\n\n//#endregion\n//#region ../models/src/domain/common.ts\nconst cuidSchema = z.string().cuid2();\nconst cuidRequestSchema = z.string().min(24).cuid2();\nconst runtimeVersionSchema = z.enum([\"v1.0\"]);\nconst providerSchema = z.enum([\n\t\"anthropic\",\n\t\"google\",\n\t\"openai\",\n\t\"deepseek\",\n\t\"azure-openai\",\n\t\"amazon-bedrock\",\n\t\"google-vertex\"\n]);\nconst datetimeSchema = z.string().datetime({ offset: true });\nconst expertKeyFieldSchema = z.string().min(1).max(maxExpertKeyLength).regex(expertKeyRegex);\nconst expertNameFieldSchema = z.string().min(1).max(maxExpertNameLength).regex(expertNameRegex);\nconst expertVersionFieldSchema = z.string().min(1).max(maxExpertVersionTagLength).regex(expertVersionRegex);\nconst expertTagFieldSchema = z.string().min(1).max(maxExpertVersionTagLength).regex(tagNameRegex);\nconst expertCategoryFieldSchema = z.enum([\n\t\"general\",\n\t\"coding\",\n\t\"research\",\n\t\"writing\",\n\t\"data\",\n\t\"automation\"\n]);\nconst scopeNameSchema = z.string().min(1).max(maxExpertNameLength).regex(scopeNameRegex);\nconst scopeNameRefSchema = z.string().min(1).max(maxExpertNameLength + maxExpertVersionTagLength + 1).regex(scopeNameRefRegex);\nconst draftRefFieldSchema = z.string().min(1).max(30);\n\n//#endregion\n//#region ../models/src/domain/organization.ts\nconst organizationStatusSchema = z.enum([\n\t\"active\",\n\t\"inactive\",\n\t\"deleted\"\n]);\nconst organizationTypeSchema = z.enum([\n\t\"personal\",\n\t\"personalPlus\",\n\t\"team\",\n\t\"serviceAdmin\"\n]);\nconst organizationSchema = z.object({\n\ttype: z.literal(\"organization\"),\n\tid: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tname: z.string().min(1).max(maxOrganizationNameLength).regex(organizationNameRegex).optional(),\n\tnameChangedAt: datetimeSchema.optional(),\n\tstatus: organizationStatusSchema,\n\torganizationType: organizationTypeSchema,\n\tmaxApplications: z.number().int().min(0),\n\tmaxApiKeys: z.number().int().min(0),\n\tmaxExperts: z.number().int().min(0)\n});\n\n//#endregion\n//#region ../models/src/lib/dedent.ts\n/**\n* Dedent function for multi-line template strings.\n* Adapted from ts-dedent (MIT License) to provide pure ESM support.\n*\n* Removes leading indentation from multi-line strings while preserving\n* relative indentation between lines.\n*/\nfunction dedent(templ, ...values) {\n\tlet strings = Array.from(typeof templ === \"string\" ? [templ] : templ);\n\tconst lastIndex = strings.length - 1;\n\tstrings[lastIndex] = (strings[lastIndex] ?? \"\").replace(/\\r?\\n([\\t ]*)$/, \"\");\n\tconst indentLengths = strings.reduce((arr, str) => {\n\t\tconst matches = str.match(/\\n([\\t ]+|(?!\\s).)/g);\n\t\tif (matches) return arr.concat(matches.map((match) => match.match(/[\\t ]/g)?.length ?? 0));\n\t\treturn arr;\n\t}, []);\n\tif (indentLengths.length) {\n\t\tconst pattern = new RegExp(`\\n[\\t ]{${Math.min(...indentLengths)}}`, \"g\");\n\t\tstrings = strings.map((str) => str.replace(pattern, \"\\n\"));\n\t}\n\tstrings[0] = (strings[0] ?? \"\").replace(/^\\r?\\n/, \"\");\n\tlet string = strings[0] ?? \"\";\n\tvalues.forEach((value, i) => {\n\t\tconst endentation = string.match(/(?:^|\\n)( *)$/)?.[1] ?? \"\";\n\t\tlet indentedValue = value;\n\t\tif (typeof value === \"string\" && value.includes(\"\\n\")) indentedValue = String(value).split(\"\\n\").map((str, j) => {\n\t\t\treturn j === 0 ? str : `${endentation}${str}`;\n\t\t}).join(\"\\n\");\n\t\tstring += String(indentedValue) + (strings[i + 1] ?? \"\");\n\t});\n\treturn string;\n}\n\n//#endregion\n//#region ../models/src/api/common.ts\nconst errorBadRequest = z.object({\n\tcode: z.literal(400),\n\terror: z.literal(\"Bad Request\"),\n\treason: z.string()\n}).describe(\"Bad Request\");\nconst errorUnauthorized = z.object({\n\tcode: z.literal(401),\n\terror: z.literal(\"Unauthorized\"),\n\treason: z.literal(\"Failed to authenticate\")\n}).describe(dedent`\n Authentication failed. Possible reasons:\n - Authorization header is not provided\n - Invalid API key\n - Session expired\n `);\nconst errorForbidden = z.object({\n\tcode: z.literal(403),\n\terror: z.literal(\"Forbidden\"),\n\treason: z.string()\n}).describe(\"Access denied. The authenticated user does not have permission to perform this action.\");\nconst errorUsageLimitExceeded = z.object({\n\tcode: z.literal(403),\n\terror: z.literal(\"Forbidden\"),\n\treason: z.string(),\n\tdetails: z.object({\n\t\tminutesUsed: z.number(),\n\t\tlimitMinutes: z.number(),\n\t\tupgradeUrl: z.string()\n\t})\n}).describe(\"Usage limit exceeded. Upgrade your plan to continue.\");\nconst errorNotFound = z.object({\n\tcode: z.literal(404),\n\terror: z.literal(\"Not Found\"),\n\treason: z.string()\n}).describe(\"Resource not found.\");\nconst errorConflict = z.object({\n\tcode: z.literal(409),\n\terror: z.literal(\"Conflict\"),\n\treason: z.string()\n}).describe(\"Request conflicts with current state of the resource.\");\nconst errorServiceUnavailable = z.object({\n\tcode: z.literal(503),\n\terror: z.literal(\"Service Unavailable\"),\n\treason: z.string()\n}).describe(\"Service temporarily unavailable. Retry with exponential backoff.\");\nconst errorValidationFailed = z.object({\n\tcode: z.literal(422),\n\terror: z.literal(\"Validation Failed\"),\n\treason: z.unknown()\n}).describe(\"Request validation failed. Check the request body, query parameters, or path parameters.\");\nconst paginationMeta = z.object({\n\ttotal: z.number().int().min(0),\n\ttake: z.number().int().min(1),\n\tskip: z.number().int().min(0)\n});\nconst errorUnauthorizedFlexible = z.object({\n\tcode: z.literal(401),\n\terror: z.literal(\"Unauthorized\"),\n\treason: z.string()\n}).describe(\"Unauthorized\");\n\n//#endregion\n//#region ../models/src/domain/application.ts\nconst applicationNameSchema = z.string().min(1).max(maxApplicationNameLength).regex(applicationNameRegex);\nconst applicationStatusSchema = z.enum([\n\t\"active\",\n\t\"inactive\",\n\t\"deleted\"\n]);\nconst applicationSchema = z.object({\n\ttype: z.literal(\"application\"),\n\tid: cuidSchema,\n\torganizationId: cuidSchema,\n\torganization: organizationSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tname: applicationNameSchema,\n\tstatus: applicationStatusSchema,\n\texpertCount: z.number().describe(\"Number of expert draft scopes associated with this application\").optional(),\n\tproviders: z.array(providerSchema).describe(\"List of configured providers for this application\").optional(),\n\ttotalJobs: z.number().describe(\"Total number of jobs executed for this application\").optional(),\n\tlastJobExecutionAt: z.string().datetime({ offset: true }).nullable().describe(\"Timestamp of the most recent job execution\").optional()\n});\n\n//#endregion\n//#region ../models/src/api/applications/create.ts\nconst request$17 = { body: z.object({\n\tname: applicationNameSchema,\n\tapplicationGroupId: cuidSchema.optional()\n}) };\nconst response$17 = z.object({ data: z.object({ application: applicationSchema }) });\n\n//#endregion\n//#region ../models/src/api/applications/getAll.ts\nconst request$16 = { query: z.object({\n\tname: z.preprocess((val) => Array.isArray(val) ? val.join(\",\") : val, z.string().optional()),\n\tsort: z.enum([\n\t\t\"name\",\n\t\t\"createdAt\",\n\t\t\"updatedAt\"\n\t]).optional(),\n\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\ttake: z.coerce.number().min(1).max(100).default(20),\n\tskip: z.coerce.number().min(0).default(0)\n}) };\nconst response$16 = z.object({\n\tdata: z.object({ applications: z.array(applicationSchema) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../models/src/api/applications/update.ts\nconst request$15 = {\n\tparams: z.object({ applicationId: cuidSchema }),\n\tbody: z.object({\n\t\tname: applicationNameSchema.optional(),\n\t\tstatus: applicationStatusSchema.exclude([\"deleted\"]).optional()\n\t}).refine((data) => data.name !== void 0 || data.status !== void 0, { message: \"At least one field must be provided\" })\n};\nconst response$15 = z.object({ data: z.object({ application: applicationSchema }) });\n\n//#endregion\n//#region ../models/src/domain/secret.ts\nconst secretNameSchema = z.string().min(1, \"Secret name is required\").max(255, \"Secret name must be 255 characters or less\").regex(/^[A-Z][A-Z0-9_]*$/, \"Secret name must start with uppercase letter and contain only uppercase letters, numbers, and underscores\");\nconst secretValueSchema = z.string().min(1, \"Secret value is required\").max(maxSecretValueLength);\nconst secretMetadataSchema = z.object({\n\tname: z.string(),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\nconst secretSchema = z.object({\n\ttype: z.literal(\"secret\"),\n\tid: cuidSchema,\n\tname: secretNameSchema,\n\tapplicationId: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\n\n//#endregion\n//#region ../models/src/api/env/secrets/create.ts\nconst request$14 = { body: z.object({\n\tapplicationId: cuidSchema,\n\tname: secretNameSchema,\n\tvalue: secretValueSchema\n}) };\nconst response$14 = z.object({ data: z.object({ secret: secretMetadataSchema }) });\n\n//#endregion\n//#region ../models/src/api/env/secrets/getAll.ts\nconst request$13 = { query: z.object({ applicationId: cuidSchema.optional() }) };\nconst response$13 = z.object({ data: z.object({ secrets: z.array(secretMetadataSchema) }) });\n\n//#endregion\n//#region ../models/src/api/env/secrets/update.ts\nconst request$12 = {\n\tparams: z.object({ name: z.string().min(1) }),\n\tbody: z.object({\n\t\tapplicationId: cuidSchema,\n\t\tvalue: secretValueSchema\n\t})\n};\nconst response$12 = z.object({ data: z.object({ secret: secretMetadataSchema }) });\n\n//#endregion\n//#region ../models/src/domain/variable.ts\nconst variableNameSchema = z.string().min(1).max(255).regex(/^[A-Z][A-Z0-9_]*$/, \"Variable name must start with uppercase letter and contain only uppercase letters, digits, and underscores\");\nconst variableValueSchema = z.string().max(maxVariableValueLength);\nconst variableSchema = z.object({\n\ttype: z.literal(\"variable\"),\n\tid: cuidSchema,\n\tapplicationId: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tname: variableNameSchema,\n\tvalue: variableValueSchema\n});\nconst variableResponseSchema = z.object({\n\tname: variableNameSchema,\n\tvalue: variableValueSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\n\n//#endregion\n//#region ../models/src/api/env/variables/create.ts\nconst request$11 = { body: z.object({\n\tapplicationId: cuidSchema,\n\tname: variableNameSchema,\n\tvalue: variableValueSchema\n}) };\nconst response$11 = z.object({ data: z.object({ variable: variableResponseSchema }) });\n\n//#endregion\n//#region ../models/src/api/env/variables/getAll.ts\nconst request$10 = { query: z.object({ applicationId: cuidSchema }) };\nconst response$10 = z.object({ data: z.object({ variables: z.array(variableResponseSchema) }) });\n\n//#endregion\n//#region ../models/src/api/env/variables/update.ts\nconst request$9 = {\n\tparams: z.object({ name: z.string().min(1) }),\n\tbody: z.object({\n\t\tapplicationId: cuidSchema,\n\t\tvalue: variableValueSchema\n\t})\n};\nconst response$9 = z.object({ data: z.object({ variable: variableResponseSchema }) });\n\n//#endregion\n//#region ../models/src/domain/expertScope.ts\nconst expertScopeSchema = z.object({\n\tid: cuidSchema,\n\tname: scopeNameSchema,\n\torganizationId: cuidSchema,\n\texpertDraftScopeId: cuidSchema,\n\tpublished: z.boolean(),\n\tpublishedAt: datetimeSchema.nullable(),\n\tcategory: expertCategoryFieldSchema,\n\ttotalRuns: z.number().int().min(0),\n\ttotalJobs: z.number().int().min(0),\n\ttotalStars: z.number().int().min(0),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tcreatedBy: cuidSchema,\n\tupdatedBy: cuidSchema\n});\nconst expertVersionSchema = z.object({\n\tid: cuidSchema,\n\texpertScopeId: cuidSchema,\n\tversion: expertVersionFieldSchema,\n\tpublic: z.boolean(),\n\tyanked: z.boolean(),\n\ttotalRuns: z.number().int().min(0),\n\ttotalJobs: z.number().int().min(0),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tcreatedBy: cuidSchema,\n\tupdatedBy: cuidSchema,\n\ttags: z.array(expertTagFieldSchema),\n\treadmeUrl: z.string().optional()\n});\nconst expertScopeWithVersionsSchema = expertScopeSchema.extend({ versions: z.array(expertVersionSchema) });\n\n//#endregion\n//#region ../models/src/domain/skill.ts\nfunction isPrivateOrLocalIP(hostname) {\n\tif (hostname === \"localhost\" || hostname === \"127.0.0.1\" || hostname === \"::1\" || hostname === \"0.0.0.0\") return true;\n\tconst ipv4Match = hostname.match(/^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/);\n\tif (ipv4Match) {\n\t\tconst a = Number(ipv4Match[1]);\n\t\tconst b = Number(ipv4Match[2]);\n\t\tif (a === 10) return true;\n\t\tif (a === 172 && b >= 16 && b <= 31) return true;\n\t\tif (a === 192 && b === 168) return true;\n\t\tif (a === 169 && b === 254) return true;\n\t\tif (a === 127) return true;\n\t}\n\tif (hostname.includes(\":\")) {\n\t\tif (hostname.startsWith(\"fe80:\") || hostname.startsWith(\"fc\") || hostname.startsWith(\"fd\")) return true;\n\t}\n\tif (hostname.startsWith(\"::ffff:\")) {\n\t\tif (isPrivateOrLocalIP(hostname.slice(7))) return true;\n\t}\n\treturn false;\n}\nconst sseEndpointSchema = z.string().max(maxSkillEndpointLength).url().refine((url) => {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.protocol !== \"https:\") return false;\n\t\tif (isPrivateOrLocalIP(parsed.hostname)) return false;\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}, { message: \"Endpoint must be a public HTTPS URL\" });\nconst skillNameSchema = z.string().min(1).max(maxSkillNameLength).regex(packageWithVersionRegex);\nconst mcpStdioSkillCommandSchema = z.enum([\"npx\", \"uvx\"]);\nconst mcpStdioSkillSchema = z.object({\n\ttype: z.literal(\"mcpStdioSkill\"),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1).max(maxSkillDescriptionLength),\n\trule: z.string().min(1).max(maxSkillRuleLength).optional(),\n\tpick: z.array(z.string().min(1).max(maxSkillToolNameLength)).max(maxSkillPickOmitItems).optional().default([]),\n\tomit: z.array(z.string().min(1).max(maxSkillToolNameLength)).max(maxSkillPickOmitItems).optional().default([]),\n\tcommand: mcpStdioSkillCommandSchema,\n\tpackageName: z.string().min(1).max(maxSkillNameLength).regex(packageWithVersionRegex),\n\trequiredEnv: z.array(z.string().min(1).max(maxEnvNameLength).regex(envNameRegex)).max(maxSkillRequiredEnvItems).optional().default([])\n});\nconst mcpSseSkillSchema = z.object({\n\ttype: z.literal(\"mcpSseSkill\"),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1).max(maxSkillDescriptionLength),\n\trule: z.string().min(1).max(maxSkillRuleLength).optional(),\n\tpick: z.array(z.string().min(1).max(maxSkillToolNameLength)).max(maxSkillPickOmitItems).optional().default([]),\n\tomit: z.array(z.string().min(1).max(maxSkillToolNameLength)).max(maxSkillPickOmitItems).optional().default([]),\n\tendpoint: sseEndpointSchema\n});\nconst interactiveSkillSchema = z.object({\n\ttype: z.literal(\"interactiveSkill\"),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1).max(maxSkillDescriptionLength),\n\trule: z.string().min(1).max(maxSkillRuleLength).optional(),\n\ttools: z.record(z.string().min(1).max(maxSkillToolNameLength).regex(urlSafeRegex), z.object({\n\t\tdescription: z.string().min(1).max(maxSkillDescriptionLength),\n\t\tinputJsonSchema: z.string().min(1).max(maxSkillInputJsonSchemaLength)\n\t}))\n});\nconst skillSchema = z.discriminatedUnion(\"type\", [\n\tmcpStdioSkillSchema,\n\tmcpSseSkillSchema,\n\tinteractiveSkillSchema\n]);\n\n//#endregion\n//#region ../models/src/domain/expert.ts\nconst expertSchema = z.object({\n\tkey: expertKeyFieldSchema,\n\tname: expertNameFieldSchema,\n\tversion: expertVersionFieldSchema,\n\tdescription: z.string().max(maxExpertDescriptionLength).optional(),\n\tinstruction: z.string().min(1).max(maxExpertInstructionLength),\n\tskills: z.record(skillNameSchema, skillSchema).optional().default({}),\n\tdelegates: z.array(expertKeyFieldSchema).min(0).max(maxExpertDelegateItems).optional().default([]),\n\ttags: z.array(expertTagFieldSchema).min(0).max(maxExpertTagItems).optional().default([]),\n\tminRuntimeVersion: runtimeVersionSchema.optional()\n});\nconst expertMetadataSchema = z.object({\n\tscope: expertScopeSchema,\n\tversion: expertVersionSchema\n});\nconst expertWithMetadataSchema = expertSchema.extend({\n\tscope: expertScopeSchema,\n\tversion: expertVersionSchema\n});\n\n//#endregion\n//#region ../models/src/api/experts/getAll.ts\nconst request$8 = { query: z.object({\n\tfilter: z.string().describe(\"Filter by scope name (partial match)\").optional(),\n\tcategory: z.enum([\n\t\t\"general\",\n\t\t\"coding\",\n\t\t\"research\",\n\t\t\"writing\",\n\t\t\"data\",\n\t\t\"automation\"\n\t]).describe(\"Filter by category\").optional(),\n\tincludeDrafts: z.coerce.boolean().default(false).describe(\"Include unpublished scopes (owner only)\").optional(),\n\ttake: z.coerce.number().min(1).max(100).default(20),\n\tskip: z.coerce.number().min(0).default(0)\n}) };\nconst response$8 = z.object({\n\tdata: z.object({ experts: z.array(expertScopeSchema.extend({ currentVersion: expertVersionSchema.nullable() })) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../support-models/src/index.ts\nconst anthropicSupportModels = [\n\t{\n\t\tmodelId: \"claude-opus-4-5\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-opus-4-1\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-opus-4-20250514\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-sonnet-4-5\",\n\t\tdefault: true,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-sonnet-4-20250514\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-3-7-sonnet-20250219\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-haiku-4-5\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-3-5-haiku-latest\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t}\n];\nconst googleSupportModels = [\n\t{\n\t\tmodelId: \"gemini-3-pro-preview\",\n\t\tdefault: false,\n\t\tprovider: \"google\",\n\t\tcontextWindow: 1e6\n\t},\n\t{\n\t\tmodelId: \"gemini-2.5-pro\",\n\t\tdefault: true,\n\t\tprovider: \"google\",\n\t\tcontextWindow: 1e6\n\t},\n\t{\n\t\tmodelId: \"gemini-2.5-flash\",\n\t\tdefault: false,\n\t\tprovider: \"google\",\n\t\tcontextWindow: 1e6\n\t},\n\t{\n\t\tmodelId: \"gemini-2.5-flash-lite\",\n\t\tdefault: false,\n\t\tprovider: \"google\",\n\t\tcontextWindow: 1e6\n\t}\n];\nconst openAiSupportModels = [\n\t{\n\t\tmodelId: \"gpt-5\",\n\t\tdefault: true,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 4e5\n\t},\n\t{\n\t\tmodelId: \"gpt-5-mini\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 4e5\n\t},\n\t{\n\t\tmodelId: \"gpt-5-nano\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 4e5\n\t},\n\t{\n\t\tmodelId: \"gpt-5-chat-latest\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 128e3\n\t},\n\t{\n\t\tmodelId: \"o4-mini\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"o3\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"o3-mini\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"gpt-4.1\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 1e6\n\t}\n];\nconst deepseekSupportModels = [{\n\tmodelId: \"deepseek-chat\",\n\tdefault: true,\n\tprovider: \"deepseek\",\n\tcontextWindow: 128e3\n}, {\n\tmodelId: \"deepseek-reasoner\",\n\tdefault: false,\n\tprovider: \"deepseek\",\n\tcontextWindow: 128e3\n}];\nconst allSupportModels = [\n\t...anthropicSupportModels,\n\t...googleSupportModels,\n\t...openAiSupportModels,\n\t...deepseekSupportModels\n];\nconst supportModels = Object.fromEntries(allSupportModels.map((model) => [model.modelId, model]));\nfunction getSupportModelNames() {\n\treturn Object.keys(supportModels);\n}\n\n//#endregion\n//#region ../models/src/domain/job.ts\nconst reasoningBudgetSchema = z.union([z.enum([\n\t\"none\",\n\t\"minimal\",\n\t\"low\",\n\t\"medium\",\n\t\"high\"\n]), z.number().int().min(0)]);\nconst jobStatusSchema = z.enum([\n\t\"queued\",\n\t\"processing\",\n\t\"completed\",\n\t\"requestInteractiveToolResult\",\n\t\"requestDelegateResult\",\n\t\"exceededMaxSteps\",\n\t\"failed\",\n\t\"canceling\",\n\t\"canceled\",\n\t\"expired\"\n]);\nconst modelNames = getSupportModelNames();\nconst firstModel = modelNames[0];\nif (firstModel === void 0) throw new Error(\"No support models available\");\nconst jobModelSchema = z.enum([firstModel, ...modelNames.slice(1)]);\nconst jobBaseSchema = z.object({\n\ttype: z.literal(\"job\"),\n\tid: cuidSchema,\n\torganizationId: cuidSchema,\n\tapplicationId: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tstatus: jobStatusSchema,\n\tcurrentExecutionId: cuidSchema.optional(),\n\tcoordinatorExpertKey: expertKeyFieldSchema,\n\tquery: z.string().min(1).max(maxExpertJobQueryLength).optional(),\n\texpert: expertWithMetadataSchema,\n\tprovider: providerSchema,\n\tmodel: jobModelSchema,\n\treasoningBudget: reasoningBudgetSchema,\n\truntimeVersion: runtimeVersionSchema,\n\tmaxSteps: z.number().int().min(1),\n\tmaxRetries: z.number().int().min(0),\n\tcurrentStep: z.number().int().min(0),\n\ttotalSteps: z.number().int().min(0),\n\ttotalDuration: z.number().int().min(0),\n\tusage: usageSchema,\n\tlastActivity: activityOrGroupSchema.nullable().optional()\n});\nconst publishedJobSchema = jobBaseSchema.extend({\n\texpertVersionId: cuidSchema,\n\texpertDraftRefId: z.undefined()\n});\nconst draftJobSchema = jobBaseSchema.extend({\n\texpertVersionId: z.undefined(),\n\texpertDraftRefId: cuidSchema\n});\nconst jobSchema = z.union([publishedJobSchema, draftJobSchema]);\n\n//#endregion\n//#region ../models/src/api/jobs/continue.ts\nconst request$7 = {\n\tparams: z.object({ jobId: cuidSchema }),\n\tbody: z.object({\n\t\tquery: z.string().min(1).max(maxExpertJobQueryLength),\n\t\tprovider: providerSchema.optional(),\n\t\tmodel: jobModelSchema.optional(),\n\t\treasoningBudget: reasoningBudgetSchema.optional(),\n\t\tmaxSteps: z.coerce.number().optional(),\n\t\tmaxRetries: z.coerce.number().optional()\n\t})\n};\nconst response$7 = z.object({ data: z.object({ job: jobSchema }) });\n\n//#endregion\n//#region ../models/src/api/jobs/create.ts\nconst baseBodySchema = z.object({\n\tapplicationId: cuidSchema.describe(\"Application ID to create the job in\"),\n\tquery: z.string().min(1).max(maxExpertJobQueryLength),\n\tprovider: providerSchema,\n\tmodel: jobModelSchema.optional(),\n\treasoningBudget: reasoningBudgetSchema.optional(),\n\tmaxSteps: z.coerce.number().optional(),\n\tmaxRetries: z.coerce.number().optional()\n});\nconst request$6 = { body: baseBodySchema.extend({\n\texpertKey: expertKeyFieldSchema.optional(),\n\tdraftRefId: cuidSchema.describe(\"Draft ref ID to run the job with\").optional()\n}).refine((data) => {\n\tconst hasExpertKey = data.expertKey !== void 0;\n\tconst hasDraftRefId = data.draftRefId !== void 0;\n\treturn hasExpertKey && !hasDraftRefId || !hasExpertKey && hasDraftRefId;\n}, { message: \"Either expertKey or draftRefId must be provided, but not both\" }) };\nconst response$6 = z.object({ data: z.object({ job: jobSchema }) });\n\n//#endregion\n//#region ../models/src/api/jobs/getAll.ts\nconst request$5 = { query: z.object({\n\tsort: z.enum([\"createdAt\", \"updatedAt\"]).optional(),\n\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\ttake: z.coerce.number().min(1).max(100).default(20),\n\tskip: z.coerce.number().min(0).default(0),\n\texpertScopeId: cuidSchema.optional(),\n\texpertDraftScopeId: cuidSchema.optional(),\n\tapplicationId: cuidSchema.optional(),\n\tstatuses: z.preprocess((val) => typeof val === \"string\" ? val.split(\",\") : val, z.array(jobStatusSchema).optional()),\n\texpertKeyFilter: z.string().max(100).optional()\n}) };\nconst response$5 = z.object({\n\tdata: z.object({ jobs: z.array(jobSchema) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../models/src/domain/checkpoint.ts\nconst delegationTargetSchema = z.object({\n\texpert: expertSchema,\n\ttoolCallId: z.string().min(1).max(maxCheckpointToolCallIdLength),\n\ttoolName: z.string().min(1).max(maxSkillToolNameLength),\n\tquery: z.string().min(1)\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*/\nconst apiCheckpointSchema = z.object({\n\ttype: z.literal(\"checkpoint\"),\n\tid: cuidSchema,\n\tjobId: cuidSchema,\n\trunId: cuidSchema,\n\tactivities: z.array(activityOrGroupSchema),\n\tstepNumber: z.number().int().min(1),\n\tstatus: z.enum([\n\t\t\"init\",\n\t\t\"proceeding\",\n\t\t\"completed\",\n\t\t\"stoppedByInteractiveTool\",\n\t\t\"stoppedByDelegate\",\n\t\t\"stoppedByExceededMaxSteps\",\n\t\t\"stoppedByError\"\n\t]),\n\texpert: expertSchema,\n\tdelegateTo: z.array(delegationTargetSchema).optional(),\n\tdelegatedBy: z.object({\n\t\texpert: expertSchema,\n\t\ttoolCallId: z.string().min(1).max(maxCheckpointToolCallIdLength),\n\t\ttoolName: z.string().min(1).max(maxSkillToolNameLength),\n\t\tcheckpointId: cuidSchema,\n\t\trunId: cuidSchema\n\t}).optional(),\n\tinputMessages: z.array(z.union([\n\t\tinstructionMessageSchema,\n\t\tuserMessageSchema,\n\t\ttoolMessageSchema\n\t])).optional(),\n\tmessages: z.array(messageSchema),\n\tnewMessages: z.array(messageSchema),\n\ttoolCalls: z.array(toolCallSchema).optional(),\n\ttoolResults: z.array(toolResultSchema).optional(),\n\tpendingToolCalls: z.array(toolCallSchema).optional(),\n\tpartialToolResults: z.array(toolResultSchema).optional(),\n\tusage: usageSchema,\n\tcontextWindow: z.number().int().min(0).optional(),\n\tcontextWindowUsage: z.number().int().min(0).optional(),\n\terror: z.object({\n\t\tname: z.string().min(1),\n\t\tmessage: z.string().min(1),\n\t\tstatusCode: z.number().int().min(100).max(599).optional(),\n\t\tisRetryable: z.boolean()\n\t}).optional(),\n\tretryCount: z.number().int().min(0).optional(),\n\tstartedAt: datetimeSchema,\n\tfinishedAt: datetimeSchema.optional()\n});\n\n//#endregion\n//#region ../models/src/api/jobs/runs/checkpoints/getAll.ts\nconst request$4 = {\n\tparams: z.object({\n\t\tjobId: cuidSchema,\n\t\trunId: cuidSchema\n\t}),\n\tquery: z.object({\n\t\tfilter: z.string().min(1).max(256).optional(),\n\t\tsort: z.enum([\"createdAt\", \"updatedAt\"]).optional(),\n\t\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\t\ttake: z.coerce.number().min(1).max(100).default(20),\n\t\tskip: z.coerce.number().min(0).default(0)\n\t})\n};\nconst response$4 = z.object({\n\tdata: z.object({ checkpoints: z.array(apiCheckpointSchema) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../models/src/domain/run.ts\nconst runStatusSchema = z.enum([\n\t\"queued\",\n\t\"processing\",\n\t\"completed\",\n\t\"stoppedByInteractiveTool\",\n\t\"stoppedByDelegate\",\n\t\"stoppedByExceededMaxSteps\",\n\t\"stoppedByError\"\n]);\nconst runSchema = z.object({\n\ttype: z.literal(\"run\"),\n\tid: cuidSchema,\n\tjobId: cuidSchema,\n\texecutionId: cuidSchema.optional(),\n\tparentRunId: cuidSchema.optional(),\n\torganizationId: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tstatus: runStatusSchema,\n\texpertKey: expertKeyFieldSchema,\n\texpert: expertWithMetadataSchema,\n\tstepNumber: z.number().int().min(0),\n\tusage: usageSchema\n});\n\n//#endregion\n//#region ../models/src/api/jobs/runs/getAll.ts\nconst request$3 = {\n\tparams: z.object({ jobId: cuidSchema }),\n\tquery: z.object({\n\t\tsort: z.enum([\"createdAt\", \"updatedAt\"]).optional(),\n\t\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\t\ttake: z.coerce.number().min(1).max(100).default(20),\n\t\tskip: z.coerce.number().min(0).default(0)\n\t})\n};\nconst response$3 = z.object({\n\tdata: z.object({ runs: z.array(runSchema) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../models/src/domain/providerSetting.ts\nconst baseUrlSchema = z.string().url().max(maxProviderBaseUrlLength).optional();\nconst headersSchema = z.record(z.string().min(1).max(maxProviderHeaderKeyLength), z.string().max(maxProviderHeaderValueLength)).refine((headers) => Object.keys(headers).length <= maxProviderHeadersCount, { message: `Headers must have at most ${maxProviderHeadersCount} entries` }).optional();\nconst anthropicProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema\n});\nconst googleProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema\n});\nconst openaiProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema,\n\torganization: z.string().min(1).optional(),\n\tproject: z.string().min(1).optional(),\n\tname: z.string().min(1).optional()\n});\nconst deepseekProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema\n});\nconst azureOpenaiProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema,\n\tresourceName: z.string().min(1).optional(),\n\tapiVersion: z.string().min(1).optional(),\n\tuseDeploymentBasedUrls: z.boolean().optional()\n});\nconst amazonBedrockProviderSettingsSchema = z.object({ region: z.string().min(1).optional() });\nconst googleVertexProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema,\n\tproject: z.string().min(1).optional(),\n\tlocation: z.string().min(1).optional()\n});\nconst providerSettingsSchema = z.union([\n\tanthropicProviderSettingsSchema,\n\tgoogleProviderSettingsSchema,\n\topenaiProviderSettingsSchema,\n\tdeepseekProviderSettingsSchema,\n\tazureOpenaiProviderSettingsSchema,\n\tamazonBedrockProviderSettingsSchema,\n\tgoogleVertexProviderSettingsSchema\n]);\nconst providerSettingSchema = z.object({\n\ttype: z.literal(\"providerSetting\"),\n\tid: cuidSchema,\n\tapplicationId: cuidSchema,\n\tprovider: providerSchema,\n\tsettings: providerSettingsSchema.optional(),\n\tapplication: applicationSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\nconst providerSettingResponseSchema = z.object({\n\ttype: z.literal(\"providerSetting\"),\n\tid: cuidSchema,\n\tprovider: providerSchema,\n\tsettings: providerSettingsSchema.optional(),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\nconst providerApiKeyMetadataSchema = z.object({\n\tid: cuidSchema,\n\tname: z.string(),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tlastUsedAt: datetimeSchema.nullable(),\n\texpiresAt: datetimeSchema.nullable()\n});\n\n//#endregion\n//#region ../models/src/api/provider-settings/api-keys/create.ts\nconst request$2 = {\n\tparams: z.object({\n\t\tapplicationId: cuidSchema,\n\t\tprovider: providerSchema\n\t}),\n\tbody: z.object({\n\t\tname: z.string().min(1).max(255),\n\t\tvalue: z.string().min(1)\n\t})\n};\nconst response$2 = z.object({ data: z.object({ apiKey: providerApiKeyMetadataSchema }) });\n\n//#endregion\n//#region ../models/src/api/provider-settings/create.ts\nconst request$1 = {\n\tparams: z.object({ applicationId: cuidSchema }),\n\tbody: z.object({\n\t\tprovider: providerSchema,\n\t\tsettings: providerSettingsSchema.optional()\n\t})\n};\nconst response$1 = z.object({ data: z.object({ providerSetting: providerSettingResponseSchema }) });\n\n//#endregion\n//#region ../models/src/api/provider-settings/update.ts\nconst request = {\n\tparams: z.object({\n\t\tapplicationId: cuidSchema,\n\t\tprovider: providerSchema\n\t}),\n\tbody: z.object({ settings: providerSettingsSchema.optional() })\n};\nconst response = z.object({ data: z.object({ providerSetting: providerSettingResponseSchema }) });\n\n//#endregion\n//#region src/endpoints/jobs-runs-checkpoints.ts\nfunction createRunCheckpointsApi(fetcher, basePath) {\n\treturn {\n\t\tasync list(jobId, runId, params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$4.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${basePath}/${jobId}/runs/${runId}/checkpoints${queryString}`, options);\n\t\t},\n\t\tasync get(jobId, runId, checkpointId, options) {\n\t\t\treturn fetcher.get(`${basePath}/${jobId}/runs/${runId}/checkpoints/${checkpointId}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/endpoints/jobs-runs.ts\nfunction createRunsApi(fetcher, basePath) {\n\treturn {\n\t\tasync list(jobId, params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$3.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${basePath}/${jobId}/runs${queryString}`, options);\n\t\t},\n\t\tasync get(jobId, runId, options) {\n\t\t\treturn fetcher.get(`${basePath}/${jobId}/runs/${runId}`, options);\n\t\t},\n\t\tcheckpoints: createRunCheckpointsApi(fetcher, basePath)\n\t};\n}\n\n//#endregion\n//#region src/endpoints/jobs.ts\nconst BASE_PATH$5 = \"/api/v1/jobs\";\n/**\n* Error thrown when stream ends abnormally.\n*/\nvar StreamError = class extends Error {\n\tconstructor(type, jobId, message) {\n\t\tsuper(message ?? `Stream error: ${type}`);\n\t\tthis.type = type;\n\t\tthis.jobId = jobId;\n\t\tthis.name = \"StreamError\";\n\t}\n};\n/**\n* Error thrown when stream connection or reading fails.\n*/\nvar StreamConnectionError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"StreamConnectionError\";\n\t}\n};\nfunction isErrorEventData(data) {\n\treturn typeof data === \"object\" && data !== null && \"type\" in data && typeof data.type === \"string\" && \"jobId\" in data && typeof data.jobId === \"string\";\n}\nfunction isCompleteEventData(data) {\n\treturn typeof data === \"object\" && data !== null && \"status\" in data && typeof data.status === \"string\" && \"jobId\" in data && typeof data.jobId === \"string\";\n}\nfunction createJobsApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$5.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$5}${queryString}`, options);\n\t\t},\n\t\tasync get(id, options) {\n\t\t\treturn fetcher.get(`${BASE_PATH$5}/${id}`, options);\n\t\t},\n\t\tasync start(input, options) {\n\t\t\tconst result = request$6.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(BASE_PATH$5, input, options);\n\t\t},\n\t\tasync continue(id, input, options) {\n\t\t\tconst result = request$7.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(`${BASE_PATH$5}/${id}/continue`, input, options);\n\t\t},\n\t\tasync cancel(id, options) {\n\t\t\treturn fetcher.post(`${BASE_PATH$5}/${id}/cancel`, {}, options);\n\t\t},\n\t\tasync *stream(id, options) {\n\t\t\tconst result = await fetcher.getStream(`${BASE_PATH$5}/${id}/stream`, options);\n\t\t\tif (!result.ok) throw new StreamConnectionError(result.error.message);\n\t\t\tconst reader = result.data.getReader();\n\t\t\ttry {\n\t\t\t\tfor await (const sseEvent of parseSSEEvents(reader)) if (sseEvent.event === \"message\") yield sseEvent.data;\n\t\t\t\telse if (sseEvent.event === \"error\" && isErrorEventData(sseEvent.data)) throw new StreamError(sseEvent.data.type, sseEvent.data.jobId, sseEvent.data.message);\n\t\t\t\telse if (sseEvent.event === \"complete\" && isCompleteEventData(sseEvent.data)) return;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof StreamError || error instanceof StreamConnectionError) throw error;\n\t\t\t\tif (error instanceof DOMException && error.name === \"AbortError\") throw error;\n\t\t\t\tthrow new StreamConnectionError(error instanceof Error ? error.message : \"Stream read error\");\n\t\t\t}\n\t\t},\n\t\truns: createRunsApi(fetcher, BASE_PATH$5)\n\t};\n}\n\n//#endregion\n//#region src/endpoints/applications.ts\nconst BASE_PATH$4 = \"/api/v1/applications\";\nfunction createApplicationsApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$16.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$4}${queryString}`, options);\n\t\t},\n\t\tasync get(id, options) {\n\t\t\treturn fetcher.get(`${BASE_PATH$4}/${id}`, options);\n\t\t},\n\t\tasync create(input, options) {\n\t\t\tconst result = request$17.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(BASE_PATH$4, input, options);\n\t\t},\n\t\tasync update(id, input, options) {\n\t\t\tconst result = request$15.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(`${BASE_PATH$4}/${id}`, input, options);\n\t\t},\n\t\tasync delete(id, options) {\n\t\t\treturn fetcher.delete(`${BASE_PATH$4}/${id}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/endpoints/env-secrets.ts\nconst BASE_PATH$3 = \"/api/v1/env/secrets\";\nfunction createSecretsApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$13.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$3}${queryString}`, options);\n\t\t},\n\t\tasync get(name, options) {\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.get(`${BASE_PATH$3}/${encodedName}`, options);\n\t\t},\n\t\tasync create(input, options) {\n\t\t\tconst result = request$14.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(BASE_PATH$3, input, options);\n\t\t},\n\t\tasync update(name, input, options) {\n\t\t\tconst result = request$12.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.put(`${BASE_PATH$3}/${encodedName}`, input, options);\n\t\t},\n\t\tasync delete(name, options) {\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.deleteNoContent(`${BASE_PATH$3}/${encodedName}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/endpoints/env-variables.ts\nconst BASE_PATH$2 = \"/api/v1/env/variables\";\nfunction createVariablesApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tconst result = request$10.query.safeParse(params);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$2}${queryString}`, options);\n\t\t},\n\t\tasync get(name, options) {\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.get(`${BASE_PATH$2}/${encodedName}`, options);\n\t\t},\n\t\tasync create(input, options) {\n\t\t\tconst result = request$11.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(BASE_PATH$2, input, options);\n\t\t},\n\t\tasync update(name, input, options) {\n\t\t\tconst result = request$9.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.put(`${BASE_PATH$2}/${encodedName}`, input, options);\n\t\t},\n\t\tasync delete(name, options) {\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.deleteNoContent(`${BASE_PATH$2}/${encodedName}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/endpoints/env.ts\nfunction createEnvApi(fetcher) {\n\treturn {\n\t\tsecrets: createSecretsApi(fetcher),\n\t\tvariables: createVariablesApi(fetcher)\n\t};\n}\n\n//#endregion\n//#region src/endpoints/experts-versions.ts\nfunction createVersionsApi(fetcher, basePath) {\n\treturn { async list(scopeName, options) {\n\t\tconst encodedScopeName = encodeURIComponent(scopeName);\n\t\treturn fetcher.get(`${basePath}/${encodedScopeName}/versions`, options);\n\t} };\n}\n\n//#endregion\n//#region src/endpoints/experts.ts\nconst BASE_PATH$1 = \"/api/v1/experts\";\nfunction createExpertsApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$8.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$1}${queryString}`, options);\n\t\t},\n\t\tasync get(key, options) {\n\t\t\tconst encodedKey = encodeURIComponent(key);\n\t\t\treturn fetcher.get(`${BASE_PATH$1}/${encodedKey}`, options);\n\t\t},\n\t\tasync getFeatured(options) {\n\t\t\treturn fetcher.get(`${BASE_PATH$1}/featured`, options);\n\t\t},\n\t\tasync getMeta(key, options) {\n\t\t\tconst encodedKey = encodeURIComponent(key);\n\t\t\treturn fetcher.get(`${BASE_PATH$1}/${encodedKey}/meta`, options);\n\t\t},\n\t\tasync publish(scopeName, options) {\n\t\t\tconst encodedScopeName = encodeURIComponent(scopeName);\n\t\t\treturn fetcher.post(`${BASE_PATH$1}/${encodedScopeName}/publish`, {}, options);\n\t\t},\n\t\tasync unpublish(scopeName, options) {\n\t\t\tconst encodedScopeName = encodeURIComponent(scopeName);\n\t\t\treturn fetcher.post(`${BASE_PATH$1}/${encodedScopeName}/unpublish`, {}, options);\n\t\t},\n\t\tasync yank(key, options) {\n\t\t\tconst encodedKey = encodeURIComponent(key);\n\t\t\treturn fetcher.delete(`${BASE_PATH$1}/${encodedKey}`, options);\n\t\t},\n\t\tversions: createVersionsApi(fetcher, BASE_PATH$1)\n\t};\n}\n\n//#endregion\n//#region src/endpoints/provider-settings.ts\nconst BASE_PATH = \"/api/v1/applications\";\nfunction createProviderSettingsApi(fetcher) {\n\treturn {\n\t\tasync list(applicationId, options) {\n\t\t\treturn fetcher.get(`${BASE_PATH}/${applicationId}/provider_settings`, options);\n\t\t},\n\t\tasync get(applicationId, provider, options) {\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.get(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`, options);\n\t\t},\n\t\tasync create(applicationId, input, options) {\n\t\t\tconst result = request$1.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(`${BASE_PATH}/${applicationId}/provider_settings`, input, options);\n\t\t},\n\t\tasync update(applicationId, provider, input, options) {\n\t\t\tconst result = request.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.post(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`, input, options);\n\t\t},\n\t\tasync delete(applicationId, provider, options) {\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.deleteNoContent(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`, options);\n\t\t},\n\t\tasync listApiKeys(applicationId, provider, options) {\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.get(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys`, options);\n\t\t},\n\t\tasync createApiKey(applicationId, provider, input, options) {\n\t\t\tconst result = request$2.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.post(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys`, input, options);\n\t\t},\n\t\tasync deleteApiKey(applicationId, provider, apiKeyId, options) {\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\tconst encodedApiKeyId = encodeURIComponent(apiKeyId);\n\t\t\treturn fetcher.deleteNoContent(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys/${encodedApiKeyId}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/public/client.ts\nfunction createApiClient(config) {\n\tconst fetcher = createFetcher(config);\n\treturn {\n\t\tapplications: createApplicationsApi(fetcher),\n\t\tenv: createEnvApi(fetcher),\n\t\tjobs: createJobsApi(fetcher),\n\t\texperts: createExpertsApi(fetcher),\n\t\tproviderSettings: createProviderSettingsApi(fetcher)\n\t};\n}\n\n//#endregion\nexport { StreamConnectionError, StreamError, buildAuthHeaders, buildQueryString, createAbortError, createApiClient, createFetcher, createHttpError, createNetworkError, createTimeoutError, createValidationError, handleHttpError, isAbortError, isClientError, isHttpError, isNetworkError, isTimeoutError, isValidationError, matchExperts, matchOperations, matchWildcard, parseApiKeyPermissions, parseSSE, parseSSEEvents, stringifyApiKeyPermissions };\n//# sourceMappingURL=index.mjs.map","import { createApiClient } from \"@perstack/api-client\"\nimport { type Expert, PerstackError, type RuntimeVersion, type Skill } from \"@perstack/core\"\n\nexport async function resolveExpertToRun(\n expertKey: string,\n experts: Record<string, Expert>,\n clientOptions: {\n perstackApiBaseUrl: string\n perstackApiKey?: string\n },\n): Promise<Expert> {\n if (experts[expertKey]) {\n return experts[expertKey]\n }\n if (!clientOptions.perstackApiKey) {\n throw new PerstackError(\n `PERSTACK_API_KEY is required to resolve published expert \"${expertKey}\"`,\n )\n }\n const client = createApiClient({\n baseUrl: clientOptions.perstackApiBaseUrl,\n apiKey: clientOptions.perstackApiKey,\n })\n const result = await client.experts.get(expertKey)\n if (!result.ok) {\n throw new PerstackError(`Failed to resolve expert \"${expertKey}\": ${result.error.message}`)\n }\n const publishedExpert = result.data.data.definition.experts[expertKey]\n if (!publishedExpert) {\n throw new PerstackError(`Expert \"${expertKey}\" not found in API response`)\n }\n return toRuntimeExpert(expertKey, publishedExpert)\n}\n\nfunction toRuntimeExpert(\n key: string,\n expert: {\n name: string\n version: string\n minRuntimeVersion?: RuntimeVersion\n description?: string\n instruction: string\n skills?: Record<\n string,\n | {\n type: \"mcpStdioSkill\"\n name: string\n description: string\n rule?: string\n pick?: string[]\n omit?: string[]\n command: \"npx\" | \"uvx\"\n packageName: string\n requiredEnv?: string[]\n }\n | {\n type: \"mcpSseSkill\"\n name: string\n description: string\n rule?: string\n pick?: string[]\n omit?: string[]\n endpoint: string\n }\n | {\n type: \"interactiveSkill\"\n name: string\n description: string\n rule?: string\n tools: Record<string, { description: string; inputJsonSchema: string }>\n }\n >\n delegates?: string[]\n tags?: string[]\n },\n): Expert {\n const skills: Record<string, Skill> = Object.fromEntries(\n Object.entries(expert.skills ?? {}).map(([name, skill]) => {\n switch (skill.type) {\n case \"mcpStdioSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n pick: skill.pick ?? [],\n omit: skill.omit ?? [],\n command: skill.command,\n packageName: skill.packageName,\n requiredEnv: skill.requiredEnv ?? [],\n },\n ]\n case \"mcpSseSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n pick: skill.pick ?? [],\n omit: skill.omit ?? [],\n endpoint: skill.endpoint,\n },\n ]\n case \"interactiveSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n tools: Object.fromEntries(\n Object.entries(skill.tools).map(([toolName, tool]) => [\n toolName,\n {\n name: toolName,\n description: tool.description,\n inputSchema: JSON.parse(tool.inputJsonSchema),\n },\n ]),\n ),\n },\n ]\n default: {\n throw new PerstackError(`Unknown skill type: ${(skill as { type: string }).type}`)\n }\n }\n }),\n )\n return {\n key,\n name: expert.name,\n version: expert.version,\n minRuntimeVersion: expert.minRuntimeVersion ?? \"v1.0\",\n description: expert.description ?? \"\",\n instruction: expert.instruction,\n skills,\n delegates: expert.delegates ?? [],\n tags: expert.tags ?? [],\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;AA2CA,SAAS,sBAAsB,OAAO;AACrC,QAAO;EACN,WAAW;EACX,MAAM;EACN,SAAS,sBAAsB,MAAM,OAAO,KAAK,UAAU,GAAG,MAAM,KAAK,KAAK,IAAI,CAAC,IAAI,MAAM,UAAU,CAAC,KAAK,KAAK;EAClH,QAAQ,MAAM;EACd;;AAEF,SAAS,mBAAmB;AAC3B,QAAO;EACN,WAAW;EACX,MAAM;EACN,SAAS;EACT,SAAS;EACT;;AAEF,SAAS,qBAAqB;AAC7B,QAAO;EACN,WAAW;EACX,MAAM;EACN,SAAS;EACT;;AAEF,SAAS,mBAAmB,OAAO;AAClC,QAAO;EACN,WAAW;EACX,MAAM;EACN,SAAS,iBAAiB,QAAQ,MAAM,UAAU;EAClD,QAAQ;EACR,OAAO,iBAAiB,QAAQ,QAAQ,KAAK;EAC7C;;AAEF,eAAe,gBAAgB,UAAU;CACxC,IAAI;AACJ,KAAI;AACH,cAAY,MAAM,SAAS,MAAM;SAC1B;AACP,cAAY,KAAK;;AAElB,QAAO;EACN,IAAI;EACJ,OAAO,gBAAgB,SAAS,QAAQ,SAAS,YAAY,UAAU;EACvE;;AAEF,SAAS,gBAAgB,QAAQ,YAAY,MAAM;AAClD,KAAI,OAAO,SAAS,YAAY,SAAS,MAAM;EAC9C,MAAM,YAAY,YAAY;AAC9B,MAAI,WAAW,QAAQ,OAAO,KAAK,UAAU,SAAU,QAAO;GAC7D,WAAW;GACX,MAAM;GACN,SAAS,KAAK;GACd,QAAQ,YAAY,KAAK,SAAS,KAAK;GACvC;AACD,MAAI,UAAW,QAAO;GACrB,WAAW;GACX,MAAM;GACN,SAAS;GACT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S,gBACP,KACA,QAuCQ;CACR,MAAM,SAAgC,OAAO,YAC3C,OAAO,QAAQ,OAAO,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW;AACzD,UAAQ,MAAM,MAAd;GACE,KAAK,gBACH,QAAO,CACL,MACA;IACE,MAAM,MAAM;IACZ;IACA,aAAa,MAAM;IACnB,MAAM,MAAM;IACZ,MAAM,MAAM,QAAQ,EAAE;IACtB,MAAM,MAAM,QAAQ,EAAE;IACtB,SAAS,MAAM;IACf,aAAa,MAAM;IACnB,aAAa,MAAM,eAAe,EAAE;IACrC,CACF;GACH,KAAK,cACH,QAAO,CACL,MACA;IACE,MAAM,MAAM;IACZ;IACA,aAAa,MAAM;IACnB,MAAM,MAAM;IACZ,MAAM,MAAM,QAAQ,EAAE;IACtB,MAAM,MAAM,QAAQ,EAAE;IACtB,UAAU,MAAM;IACjB,CACF;GACH,KAAK,mBACH,QAAO,CACL,MACA;IACE,MAAM,MAAM;IACZ;IACA,aAAa,MAAM;IACnB,MAAM,MAAM;IACZ,OAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,UAAU,CACpD,UACA;KACE,MAAM;KACN,aAAa,KAAK;KAClB,aAAa,KAAK,MAAM,KAAK,gBAAgB;KAC9C,CACF,CAAC,CACH;IACF,CACF;GACH,QACE,OAAM,IAAI,cAAc,uBAAwB,MAA2B,OAAO;;GAGtF,CACH;AACD,QAAO;EACL;EACA,MAAM,OAAO;EACb,SAAS,OAAO;EAChB,mBAAmB,OAAO,qBAAqB;EAC/C,aAAa,OAAO,eAAe;EACnC,aAAa,OAAO;EACpB;EACA,WAAW,OAAO,aAAa,EAAE;EACjC,MAAM,OAAO,QAAQ,EAAE;EACxB"}
1
+ {"version":3,"file":"resolve-expert-DsQia0Mr.js","names":["z.string","z.enum","z.object","z.literal","z.number","z.unknown","z.array","z.preprocess","z.coerce.number","z.boolean","z.record","z.discriminatedUnion","z.coerce.boolean","z.union","z.undefined"],"sources":["../../../node_modules/.pnpm/@perstack+api-client@0.0.55_@perstack+core@packages+core_zod@4.3.6/node_modules/@perstack/api-client/dist/index.mjs","../../../packages/runtime/src/helpers/resolve-expert.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { activityOrGroupSchema, instructionMessageSchema, messageSchema, toolCallSchema, toolMessageSchema, toolResultSchema, usageSchema, userMessageSchema } from \"@perstack/core\";\n\n//#region src/lib/api-key.ts\nfunction matchWildcard(value, pattern) {\n\tif (pattern === \"*\") return true;\n\tif (pattern.endsWith(\"*\")) return value.startsWith(pattern.slice(0, -1));\n\tif (pattern.startsWith(\"*\")) return value.endsWith(pattern.slice(1));\n\treturn value === pattern;\n}\nfunction matchOperations(operations, requiredOperation) {\n\treturn operations.some((pattern) => matchWildcard(requiredOperation, pattern));\n}\nfunction matchExperts(experts, expertId) {\n\tif (experts === void 0 || experts === \"*\") return true;\n\treturn experts.some((pattern) => matchWildcard(expertId, pattern));\n}\nfunction isApiKeyPermissions(parsed) {\n\treturn typeof parsed === \"object\" && parsed !== null && \"operations\" in parsed && Array.isArray(parsed.operations);\n}\nfunction parseApiKeyPermissions(permissionsJson) {\n\tif (!permissionsJson) return null;\n\ttry {\n\t\tconst parsed = JSON.parse(permissionsJson);\n\t\tif (!isApiKeyPermissions(parsed)) return null;\n\t\treturn parsed;\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction stringifyApiKeyPermissions(permissions) {\n\treturn JSON.stringify(permissions);\n}\n\n//#endregion\n//#region src/lib/auth.ts\nfunction buildAuthHeaders(auth) {\n\tif (auth.type === \"apiKey\") return { Authorization: `Bearer ${auth.apiKey}` };\n\treturn { Cookie: auth.cookie };\n}\n\n//#endregion\n//#region src/lib/errors.ts\nfunction createValidationError(error) {\n\treturn {\n\t\terrorType: \"validation\",\n\t\tcode: 400,\n\t\tmessage: `Validation failed: ${error.issues.map((issue) => `${issue.path.join(\".\")}: ${issue.message}`).join(\"; \")}`,\n\t\treason: error.issues\n\t};\n}\nfunction createAbortError() {\n\treturn {\n\t\terrorType: \"abort\",\n\t\tcode: 0,\n\t\tmessage: \"Request aborted\",\n\t\taborted: true\n\t};\n}\nfunction createTimeoutError() {\n\treturn {\n\t\terrorType: \"timeout\",\n\t\tcode: 0,\n\t\tmessage: \"Request timed out\"\n\t};\n}\nfunction createNetworkError(error) {\n\treturn {\n\t\terrorType: \"network\",\n\t\tcode: 0,\n\t\tmessage: error instanceof Error ? error.message : \"Network error\",\n\t\treason: error,\n\t\tcause: error instanceof Error ? error : void 0\n\t};\n}\nasync function handleHttpError(response) {\n\tlet errorBody;\n\ttry {\n\t\terrorBody = await response.json();\n\t} catch {\n\t\terrorBody = void 0;\n\t}\n\treturn {\n\t\tok: false,\n\t\terror: createHttpError(response.status, response.statusText, errorBody)\n\t};\n}\nfunction createHttpError(status, statusText, body) {\n\tif (typeof body === \"object\" && body !== null) {\n\t\tconst hasReason = \"reason\" in body;\n\t\tif (\"error\" in body && typeof body.error === \"string\") return {\n\t\t\terrorType: \"http\",\n\t\t\tcode: status,\n\t\t\tmessage: body.error,\n\t\t\treason: hasReason ? body.reason : void 0\n\t\t};\n\t\tif (hasReason) return {\n\t\t\terrorType: \"http\",\n\t\t\tcode: status,\n\t\t\tmessage: statusText,\n\t\t\treason: body.reason\n\t\t};\n\t}\n\treturn {\n\t\terrorType: \"http\",\n\t\tcode: status,\n\t\tmessage: statusText\n\t};\n}\nfunction isHttpError(error) {\n\treturn error.errorType === \"http\";\n}\nfunction isNetworkError(error) {\n\treturn error.errorType === \"network\";\n}\nfunction isTimeoutError(error) {\n\treturn error.errorType === \"timeout\";\n}\nfunction isValidationError(error) {\n\treturn error.errorType === \"validation\";\n}\nfunction isAbortError(error) {\n\treturn error.errorType === \"abort\";\n}\nfunction isClientError(error) {\n\treturn error.errorType !== \"http\";\n}\n\n//#endregion\n//#region src/lib/fetcher.ts\nconst DEFAULT_BASE_URL = \"https://api.perstack.ai\";\nconst DEFAULT_TIMEOUT = 3e4;\nfunction createFetcher(config) {\n\tconst baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;\n\tconst timeout = config.timeout ?? DEFAULT_TIMEOUT;\n\tconst useCredentials = \"credentials\" in config && config.credentials === \"include\";\n\tconst apiKey = \"apiKey\" in config ? config.apiKey : void 0;\n\tfunction buildUrl(path) {\n\t\treturn `${baseUrl}${path}`;\n\t}\n\tfunction buildHeaders(options) {\n\t\tconst headers = {};\n\t\tif (options?.hasBody) headers[\"Content-Type\"] = \"application/json\";\n\t\tif (apiKey) headers.Authorization = `Bearer ${apiKey}`;\n\t\treturn headers;\n\t}\n\tfunction getCredentials() {\n\t\treturn useCredentials ? \"include\" : void 0;\n\t}\n\tfunction createTimeoutSignal(externalSignal) {\n\t\tconst controller = new AbortController();\n\t\tlet timedOut = false;\n\t\tconst timeoutId = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tcontroller.abort();\n\t\t}, timeout);\n\t\tlet abortHandler;\n\t\tif (externalSignal) if (externalSignal.aborted) controller.abort();\n\t\telse {\n\t\t\tabortHandler = () => controller.abort();\n\t\t\texternalSignal.addEventListener(\"abort\", abortHandler);\n\t\t}\n\t\treturn {\n\t\t\tsignal: controller.signal,\n\t\t\tcleanup: () => {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\tif (abortHandler && externalSignal) externalSignal.removeEventListener(\"abort\", abortHandler);\n\t\t\t},\n\t\t\tisTimeout: () => timedOut\n\t\t};\n\t}\n\tfunction wrapStreamWithIdleTimeout(stream, idleTimeoutMs, externalSignal) {\n\t\tconst reader = stream.getReader();\n\t\tconst controller = new AbortController();\n\t\tlet timeoutId;\n\t\tlet abortHandler;\n\t\tif (externalSignal) if (externalSignal.aborted) controller.abort();\n\t\telse {\n\t\t\tabortHandler = () => controller.abort();\n\t\t\texternalSignal.addEventListener(\"abort\", abortHandler);\n\t\t}\n\t\tfunction resetTimeout() {\n\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\ttimeoutId = setTimeout(() => controller.abort(), idleTimeoutMs);\n\t\t}\n\t\tfunction cleanup() {\n\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\tif (abortHandler && externalSignal) externalSignal.removeEventListener(\"abort\", abortHandler);\n\t\t}\n\t\treturn new ReadableStream({\n\t\t\tstart() {\n\t\t\t\tresetTimeout();\n\t\t\t},\n\t\t\tasync pull(streamController) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await Promise.race([reader.read(), new Promise((_, reject) => {\n\t\t\t\t\t\tif (controller.signal.aborted) reject(new DOMException(\"Stream idle timeout\", \"AbortError\"));\n\t\t\t\t\t\tcontroller.signal.addEventListener(\"abort\", () => {\n\t\t\t\t\t\t\treject(new DOMException(\"Stream idle timeout\", \"AbortError\"));\n\t\t\t\t\t\t});\n\t\t\t\t\t})]);\n\t\t\t\t\tif (result.done) {\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\tstreamController.close();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tresetTimeout();\n\t\t\t\t\tstreamController.enqueue(result.value);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tcleanup();\n\t\t\t\t\treader.cancel().catch(() => {});\n\t\t\t\t\tif (error instanceof DOMException && error.name === \"AbortError\") streamController.error(new DOMException(\"Stream idle timeout\", \"AbortError\"));\n\t\t\t\t\telse streamController.error(error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tcancel(reason) {\n\t\t\t\tcleanup();\n\t\t\t\treader.cancel(reason).catch(() => {});\n\t\t\t}\n\t\t});\n\t}\n\tasync function request(method, path, body, options) {\n\t\tconst { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal);\n\t\ttry {\n\t\t\tconst response = await fetch(buildUrl(path), {\n\t\t\t\tmethod,\n\t\t\t\theaders: buildHeaders(body ? { hasBody: true } : void 0),\n\t\t\t\tbody: body ? JSON.stringify(body) : void 0,\n\t\t\t\tsignal,\n\t\t\t\tcredentials: getCredentials()\n\t\t\t});\n\t\t\tif (!response.ok) return handleHttpError(response);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: await response.json()\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tif (isTimeout()) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createTimeoutError()\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createAbortError()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: createNetworkError(error)\n\t\t\t};\n\t\t} finally {\n\t\t\tcleanup();\n\t\t}\n\t}\n\tasync function requestBlob(path, options) {\n\t\tconst { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal);\n\t\ttry {\n\t\t\tconst response = await fetch(buildUrl(path), {\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: buildHeaders(),\n\t\t\t\tsignal,\n\t\t\t\tcredentials: getCredentials()\n\t\t\t});\n\t\t\tif (!response.ok) return handleHttpError(response);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: await response.blob()\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tif (isTimeout()) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createTimeoutError()\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createAbortError()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: createNetworkError(error)\n\t\t\t};\n\t\t} finally {\n\t\t\tcleanup();\n\t\t}\n\t}\n\tasync function requestStream(path, options) {\n\t\tconst { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal);\n\t\ttry {\n\t\t\tconst response = await fetch(buildUrl(path), {\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: buildHeaders(),\n\t\t\t\tsignal,\n\t\t\t\tcredentials: getCredentials()\n\t\t\t});\n\t\t\tif (!response.ok) {\n\t\t\t\tcleanup();\n\t\t\t\treturn handleHttpError(response);\n\t\t\t}\n\t\t\tif (!response.body) {\n\t\t\t\tcleanup();\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createNetworkError(/* @__PURE__ */ new Error(\"Response body is null\"))\n\t\t\t\t};\n\t\t\t}\n\t\t\tcleanup();\n\t\t\tconst idleTimeout = options?.streamIdleTimeout ?? timeout;\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: wrapStreamWithIdleTimeout(response.body, idleTimeout, options?.signal)\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tcleanup();\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tif (isTimeout()) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createTimeoutError()\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createAbortError()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: createNetworkError(error)\n\t\t\t};\n\t\t}\n\t}\n\tasync function requestNoContent(method, path, options) {\n\t\tconst { signal, cleanup, isTimeout } = createTimeoutSignal(options?.signal);\n\t\ttry {\n\t\t\tconst response = await fetch(buildUrl(path), {\n\t\t\t\tmethod,\n\t\t\t\theaders: buildHeaders(),\n\t\t\t\tsignal,\n\t\t\t\tcredentials: getCredentials()\n\t\t\t});\n\t\t\tif (!response.ok) return handleHttpError(response);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: void 0\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tif (isTimeout()) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createTimeoutError()\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createAbortError()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: createNetworkError(error)\n\t\t\t};\n\t\t} finally {\n\t\t\tcleanup();\n\t\t}\n\t}\n\treturn {\n\t\tget: (path, options) => request(\"GET\", path, void 0, options),\n\t\tpost: (path, body, options) => request(\"POST\", path, body, options),\n\t\tput: (path, body, options) => request(\"PUT\", path, body, options),\n\t\tdelete: (path, options) => request(\"DELETE\", path, void 0, options),\n\t\tdeleteNoContent: (path, options) => requestNoContent(\"DELETE\", path, options),\n\t\tgetBlob: (path, options) => requestBlob(path, options),\n\t\tgetStream: (path, options) => requestStream(path, options)\n\t};\n}\n\n//#endregion\n//#region src/lib/query-string.ts\nfunction buildQueryString(params) {\n\tif (!params) return \"\";\n\tconst searchParams = new URLSearchParams();\n\tfor (const [key, value] of Object.entries(params)) if (value !== void 0) searchParams.set(key, String(value));\n\tconst queryString = searchParams.toString();\n\treturn queryString ? `?${queryString}` : \"\";\n}\n\n//#endregion\n//#region src/lib/sse.ts\nasync function* parseSSEEvents(reader) {\n\tconst decoder = new TextDecoder();\n\tlet buffer = \"\";\n\twhile (true) {\n\t\tconst { value, done } = await reader.read();\n\t\tif (done) break;\n\t\tbuffer += decoder.decode(value, { stream: true });\n\t\tconst events = buffer.split(\"\\n\\n\");\n\t\tbuffer = events.pop() || \"\";\n\t\tfor (const event of events) {\n\t\t\tif (event.trim() === \"\") continue;\n\t\t\tconst lines = event.split(\"\\n\");\n\t\t\tconst eventType = lines.find((line) => line.startsWith(\"event:\"))?.slice(6).trim();\n\t\t\tconst data = lines.find((line) => line.startsWith(\"data:\"))?.slice(5).trim();\n\t\t\tif (!eventType || !data) continue;\n\t\t\tif (eventType !== \"message\" && eventType !== \"error\" && eventType !== \"complete\") continue;\n\t\t\ttry {\n\t\t\t\tyield {\n\t\t\t\t\tevent: eventType,\n\t\t\t\t\tdata: JSON.parse(data)\n\t\t\t\t};\n\t\t\t} catch {}\n\t\t}\n\t}\n}\nasync function* parseSSE(reader) {\n\tconst decoder = new TextDecoder();\n\tlet buffer = \"\";\n\twhile (true) {\n\t\tconst { value, done } = await reader.read();\n\t\tif (done) break;\n\t\tbuffer += decoder.decode(value, { stream: true });\n\t\tconst events = buffer.split(\"\\n\\n\");\n\t\tbuffer = events.pop() || \"\";\n\t\tfor (const event of events) {\n\t\t\tif (event.trim() === \"\") continue;\n\t\t\tconst lines = event.split(\"\\n\");\n\t\t\tconst eventType = lines.find((line) => line.startsWith(\"event:\"))?.slice(6).trim();\n\t\t\tconst data = lines.find((line) => line.startsWith(\"data:\"))?.slice(5).trim();\n\t\t\tif (eventType !== \"message\" || !data) continue;\n\t\t\ttry {\n\t\t\t\tyield JSON.parse(data);\n\t\t\t} catch {}\n\t\t}\n\t}\n}\n\n//#endregion\n//#region ../constants/index.ts\nconst organizationNameRegex = /^[a-z0-9][a-z0-9_.-]*$/;\nconst maxOrganizationNameLength = 128;\nconst applicationNameRegex = /^[a-z0-9][a-z0-9_.-]*$/;\nconst maxApplicationNameLength = 255;\nconst maxVariableValueLength = 65536;\nconst maxSecretValueLength = 65536;\nconst expertKeyRegex = /^((?:@[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_.-]*))?$/;\nconst expertNameRegex = /^(@[a-z0-9][a-z0-9_-]*\\/)?[a-z0-9][a-z0-9_-]*$/;\nconst scopeNameRegex = /^[a-z0-9][a-z0-9_-]*$/;\nconst scopeNameRefRegex = /^[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_-]*))?$/;\nconst expertVersionRegex = /^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\w.-]+)?(?:\\+[\\w.-]+)?$/;\nconst tagNameRegex = /^[a-z0-9][a-z0-9_-]*$/;\nconst maxExpertNameLength = 255;\nconst maxExpertVersionTagLength = 255;\nconst maxExpertKeyLength = 511;\nconst maxExpertDescriptionLength = 1024 * 2;\nconst maxExpertInstructionLength = 1024 * 20;\nconst maxExpertDelegateItems = 255;\nconst maxExpertTagItems = 8;\nconst maxExpertJobQueryLength = 1024 * 20;\nconst maxExpertJobFileNameLength = 1024 * 10;\nconst packageWithVersionRegex = /^(?:@[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_.-]*)?$/;\nconst urlSafeRegex = /^[a-z0-9][a-z0-9_-]*$/;\nconst maxSkillNameLength = 255;\nconst maxSkillDescriptionLength = 1024 * 2;\nconst maxSkillRuleLength = 1024 * 2;\nconst maxSkillPickOmitItems = 255;\nconst maxSkillRequiredEnvItems = 255;\nconst maxSkillToolNameLength = 255;\nconst maxSkillEndpointLength = 1024 * 2;\nconst maxSkillInputJsonSchemaLength = 1024 * 20;\nconst maxCheckpointToolCallIdLength = 255;\nconst envNameRegex = /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;\nconst maxEnvNameLength = 255;\nconst maxProviderBaseUrlLength = 2048;\nconst maxProviderHeaderKeyLength = 255;\nconst maxProviderHeaderValueLength = 2048;\nconst maxProviderHeadersCount = 50;\n\n//#endregion\n//#region ../models/src/domain/common.ts\nconst cuidSchema = z.string().cuid2();\nconst cuidRequestSchema = z.string().min(24).cuid2();\nconst runtimeVersionSchema = z.enum([\"v1.0\"]);\nconst providerSchema = z.enum([\n\t\"anthropic\",\n\t\"google\",\n\t\"openai\",\n\t\"deepseek\",\n\t\"azure-openai\",\n\t\"amazon-bedrock\",\n\t\"google-vertex\"\n]);\nconst datetimeSchema = z.string().datetime({ offset: true });\nconst expertKeyFieldSchema = z.string().min(1).max(maxExpertKeyLength).regex(expertKeyRegex);\nconst expertNameFieldSchema = z.string().min(1).max(maxExpertNameLength).regex(expertNameRegex);\nconst expertVersionFieldSchema = z.string().min(1).max(maxExpertVersionTagLength).regex(expertVersionRegex);\nconst expertTagFieldSchema = z.string().min(1).max(maxExpertVersionTagLength).regex(tagNameRegex);\nconst expertCategoryFieldSchema = z.enum([\n\t\"general\",\n\t\"coding\",\n\t\"research\",\n\t\"writing\",\n\t\"data\",\n\t\"automation\"\n]);\nconst scopeNameSchema = z.string().min(1).max(maxExpertNameLength).regex(scopeNameRegex);\nconst scopeNameRefSchema = z.string().min(1).max(maxExpertNameLength + maxExpertVersionTagLength + 1).regex(scopeNameRefRegex);\nconst draftRefFieldSchema = z.string().min(1).max(30);\n\n//#endregion\n//#region ../models/src/domain/organization.ts\nconst organizationStatusSchema = z.enum([\n\t\"active\",\n\t\"inactive\",\n\t\"deleted\"\n]);\nconst organizationTypeSchema = z.enum([\n\t\"personal\",\n\t\"personalPlus\",\n\t\"team\",\n\t\"serviceAdmin\"\n]);\nconst organizationSchema = z.object({\n\ttype: z.literal(\"organization\"),\n\tid: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tname: z.string().min(1).max(maxOrganizationNameLength).regex(organizationNameRegex).optional(),\n\tnameChangedAt: datetimeSchema.optional(),\n\tstatus: organizationStatusSchema,\n\torganizationType: organizationTypeSchema,\n\tmaxApplications: z.number().int().min(0),\n\tmaxApiKeys: z.number().int().min(0),\n\tmaxExperts: z.number().int().min(0)\n});\n\n//#endregion\n//#region ../models/src/lib/dedent.ts\n/**\n* Dedent function for multi-line template strings.\n* Adapted from ts-dedent (MIT License) to provide pure ESM support.\n*\n* Removes leading indentation from multi-line strings while preserving\n* relative indentation between lines.\n*/\nfunction dedent(templ, ...values) {\n\tlet strings = Array.from(typeof templ === \"string\" ? [templ] : templ);\n\tconst lastIndex = strings.length - 1;\n\tstrings[lastIndex] = (strings[lastIndex] ?? \"\").replace(/\\r?\\n([\\t ]*)$/, \"\");\n\tconst indentLengths = strings.reduce((arr, str) => {\n\t\tconst matches = str.match(/\\n([\\t ]+|(?!\\s).)/g);\n\t\tif (matches) return arr.concat(matches.map((match) => match.match(/[\\t ]/g)?.length ?? 0));\n\t\treturn arr;\n\t}, []);\n\tif (indentLengths.length) {\n\t\tconst pattern = new RegExp(`\\n[\\t ]{${Math.min(...indentLengths)}}`, \"g\");\n\t\tstrings = strings.map((str) => str.replace(pattern, \"\\n\"));\n\t}\n\tstrings[0] = (strings[0] ?? \"\").replace(/^\\r?\\n/, \"\");\n\tlet string = strings[0] ?? \"\";\n\tvalues.forEach((value, i) => {\n\t\tconst endentation = string.match(/(?:^|\\n)( *)$/)?.[1] ?? \"\";\n\t\tlet indentedValue = value;\n\t\tif (typeof value === \"string\" && value.includes(\"\\n\")) indentedValue = String(value).split(\"\\n\").map((str, j) => {\n\t\t\treturn j === 0 ? str : `${endentation}${str}`;\n\t\t}).join(\"\\n\");\n\t\tstring += String(indentedValue) + (strings[i + 1] ?? \"\");\n\t});\n\treturn string;\n}\n\n//#endregion\n//#region ../models/src/api/common.ts\nconst errorBadRequest = z.object({\n\tcode: z.literal(400),\n\terror: z.literal(\"Bad Request\"),\n\treason: z.string()\n}).describe(\"Bad Request\");\nconst errorUnauthorized = z.object({\n\tcode: z.literal(401),\n\terror: z.literal(\"Unauthorized\"),\n\treason: z.literal(\"Failed to authenticate\")\n}).describe(dedent`\n Authentication failed. Possible reasons:\n - Authorization header is not provided\n - Invalid API key\n - Session expired\n `);\nconst errorForbidden = z.object({\n\tcode: z.literal(403),\n\terror: z.literal(\"Forbidden\"),\n\treason: z.string()\n}).describe(\"Access denied. The authenticated user does not have permission to perform this action.\");\nconst errorUsageLimitExceeded = z.object({\n\tcode: z.literal(403),\n\terror: z.literal(\"Forbidden\"),\n\treason: z.string(),\n\tdetails: z.object({\n\t\tminutesUsed: z.number(),\n\t\tlimitMinutes: z.number(),\n\t\tupgradeUrl: z.string()\n\t})\n}).describe(\"Usage limit exceeded. Upgrade your plan to continue.\");\nconst errorNotFound = z.object({\n\tcode: z.literal(404),\n\terror: z.literal(\"Not Found\"),\n\treason: z.string()\n}).describe(\"Resource not found.\");\nconst errorConflict = z.object({\n\tcode: z.literal(409),\n\terror: z.literal(\"Conflict\"),\n\treason: z.string()\n}).describe(\"Request conflicts with current state of the resource.\");\nconst errorServiceUnavailable = z.object({\n\tcode: z.literal(503),\n\terror: z.literal(\"Service Unavailable\"),\n\treason: z.string()\n}).describe(\"Service temporarily unavailable. Retry with exponential backoff.\");\nconst errorValidationFailed = z.object({\n\tcode: z.literal(422),\n\terror: z.literal(\"Validation Failed\"),\n\treason: z.unknown()\n}).describe(\"Request validation failed. Check the request body, query parameters, or path parameters.\");\nconst paginationMeta = z.object({\n\ttotal: z.number().int().min(0),\n\ttake: z.number().int().min(1),\n\tskip: z.number().int().min(0)\n});\nconst errorUnauthorizedFlexible = z.object({\n\tcode: z.literal(401),\n\terror: z.literal(\"Unauthorized\"),\n\treason: z.string()\n}).describe(\"Unauthorized\");\n\n//#endregion\n//#region ../models/src/domain/application.ts\nconst applicationNameSchema = z.string().min(1).max(maxApplicationNameLength).regex(applicationNameRegex);\nconst applicationStatusSchema = z.enum([\n\t\"active\",\n\t\"inactive\",\n\t\"deleted\"\n]);\nconst applicationSchema = z.object({\n\ttype: z.literal(\"application\"),\n\tid: cuidSchema,\n\torganizationId: cuidSchema,\n\torganization: organizationSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tname: applicationNameSchema,\n\tstatus: applicationStatusSchema,\n\texpertCount: z.number().describe(\"Number of expert draft scopes associated with this application\").optional(),\n\tproviders: z.array(providerSchema).describe(\"List of configured providers for this application\").optional(),\n\ttotalJobs: z.number().describe(\"Total number of jobs executed for this application\").optional(),\n\tlastJobExecutionAt: z.string().datetime({ offset: true }).nullable().describe(\"Timestamp of the most recent job execution\").optional()\n});\n\n//#endregion\n//#region ../models/src/api/applications/create.ts\nconst request$17 = { body: z.object({\n\tname: applicationNameSchema,\n\tapplicationGroupId: cuidSchema.optional()\n}) };\nconst response$17 = z.object({ data: z.object({ application: applicationSchema }) });\n\n//#endregion\n//#region ../models/src/api/applications/getAll.ts\nconst request$16 = { query: z.object({\n\tname: z.preprocess((val) => Array.isArray(val) ? val.join(\",\") : val, z.string().optional()),\n\tsort: z.enum([\n\t\t\"name\",\n\t\t\"createdAt\",\n\t\t\"updatedAt\"\n\t]).optional(),\n\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\ttake: z.coerce.number().min(1).max(100).default(20),\n\tskip: z.coerce.number().min(0).default(0)\n}) };\nconst response$16 = z.object({\n\tdata: z.object({ applications: z.array(applicationSchema) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../models/src/api/applications/update.ts\nconst request$15 = {\n\tparams: z.object({ applicationId: cuidSchema }),\n\tbody: z.object({\n\t\tname: applicationNameSchema.optional(),\n\t\tstatus: applicationStatusSchema.exclude([\"deleted\"]).optional()\n\t}).refine((data) => data.name !== void 0 || data.status !== void 0, { message: \"At least one field must be provided\" })\n};\nconst response$15 = z.object({ data: z.object({ application: applicationSchema }) });\n\n//#endregion\n//#region ../models/src/domain/secret.ts\nconst secretNameSchema = z.string().min(1, \"Secret name is required\").max(255, \"Secret name must be 255 characters or less\").regex(/^[A-Z][A-Z0-9_]*$/, \"Secret name must start with uppercase letter and contain only uppercase letters, numbers, and underscores\");\nconst secretValueSchema = z.string().min(1, \"Secret value is required\").max(maxSecretValueLength);\nconst secretMetadataSchema = z.object({\n\tname: z.string(),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\nconst secretSchema = z.object({\n\ttype: z.literal(\"secret\"),\n\tid: cuidSchema,\n\tname: secretNameSchema,\n\tapplicationId: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\n\n//#endregion\n//#region ../models/src/api/env/secrets/create.ts\nconst request$14 = { body: z.object({\n\tapplicationId: cuidSchema,\n\tname: secretNameSchema,\n\tvalue: secretValueSchema\n}) };\nconst response$14 = z.object({ data: z.object({ secret: secretMetadataSchema }) });\n\n//#endregion\n//#region ../models/src/api/env/secrets/getAll.ts\nconst request$13 = { query: z.object({ applicationId: cuidSchema.optional() }) };\nconst response$13 = z.object({ data: z.object({ secrets: z.array(secretMetadataSchema) }) });\n\n//#endregion\n//#region ../models/src/api/env/secrets/update.ts\nconst request$12 = {\n\tparams: z.object({ name: z.string().min(1) }),\n\tbody: z.object({\n\t\tapplicationId: cuidSchema,\n\t\tvalue: secretValueSchema\n\t})\n};\nconst response$12 = z.object({ data: z.object({ secret: secretMetadataSchema }) });\n\n//#endregion\n//#region ../models/src/domain/variable.ts\nconst variableNameSchema = z.string().min(1).max(255).regex(/^[A-Z][A-Z0-9_]*$/, \"Variable name must start with uppercase letter and contain only uppercase letters, digits, and underscores\");\nconst variableValueSchema = z.string().max(maxVariableValueLength);\nconst variableSchema = z.object({\n\ttype: z.literal(\"variable\"),\n\tid: cuidSchema,\n\tapplicationId: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tname: variableNameSchema,\n\tvalue: variableValueSchema\n});\nconst variableResponseSchema = z.object({\n\tname: variableNameSchema,\n\tvalue: variableValueSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\n\n//#endregion\n//#region ../models/src/api/env/variables/create.ts\nconst request$11 = { body: z.object({\n\tapplicationId: cuidSchema,\n\tname: variableNameSchema,\n\tvalue: variableValueSchema\n}) };\nconst response$11 = z.object({ data: z.object({ variable: variableResponseSchema }) });\n\n//#endregion\n//#region ../models/src/api/env/variables/getAll.ts\nconst request$10 = { query: z.object({ applicationId: cuidSchema }) };\nconst response$10 = z.object({ data: z.object({ variables: z.array(variableResponseSchema) }) });\n\n//#endregion\n//#region ../models/src/api/env/variables/update.ts\nconst request$9 = {\n\tparams: z.object({ name: z.string().min(1) }),\n\tbody: z.object({\n\t\tapplicationId: cuidSchema,\n\t\tvalue: variableValueSchema\n\t})\n};\nconst response$9 = z.object({ data: z.object({ variable: variableResponseSchema }) });\n\n//#endregion\n//#region ../models/src/domain/expertScope.ts\nconst expertScopeSchema = z.object({\n\tid: cuidSchema,\n\tname: scopeNameSchema,\n\torganizationId: cuidSchema,\n\texpertDraftScopeId: cuidSchema,\n\tpublished: z.boolean(),\n\tpublishedAt: datetimeSchema.nullable(),\n\tcategory: expertCategoryFieldSchema,\n\ttotalRuns: z.number().int().min(0),\n\ttotalJobs: z.number().int().min(0),\n\ttotalStars: z.number().int().min(0),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tcreatedBy: cuidSchema,\n\tupdatedBy: cuidSchema\n});\nconst expertVersionSchema = z.object({\n\tid: cuidSchema,\n\texpertScopeId: cuidSchema,\n\tversion: expertVersionFieldSchema,\n\tpublic: z.boolean(),\n\tyanked: z.boolean(),\n\ttotalRuns: z.number().int().min(0),\n\ttotalJobs: z.number().int().min(0),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tcreatedBy: cuidSchema,\n\tupdatedBy: cuidSchema,\n\ttags: z.array(expertTagFieldSchema),\n\treadmeUrl: z.string().optional()\n});\nconst expertScopeWithVersionsSchema = expertScopeSchema.extend({ versions: z.array(expertVersionSchema) });\n\n//#endregion\n//#region ../models/src/domain/skill.ts\nfunction isPrivateOrLocalIP(hostname) {\n\tif (hostname === \"localhost\" || hostname === \"127.0.0.1\" || hostname === \"::1\" || hostname === \"0.0.0.0\") return true;\n\tconst ipv4Match = hostname.match(/^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/);\n\tif (ipv4Match) {\n\t\tconst a = Number(ipv4Match[1]);\n\t\tconst b = Number(ipv4Match[2]);\n\t\tif (a === 10) return true;\n\t\tif (a === 172 && b >= 16 && b <= 31) return true;\n\t\tif (a === 192 && b === 168) return true;\n\t\tif (a === 169 && b === 254) return true;\n\t\tif (a === 127) return true;\n\t}\n\tif (hostname.includes(\":\")) {\n\t\tif (hostname.startsWith(\"fe80:\") || hostname.startsWith(\"fc\") || hostname.startsWith(\"fd\")) return true;\n\t}\n\tif (hostname.startsWith(\"::ffff:\")) {\n\t\tif (isPrivateOrLocalIP(hostname.slice(7))) return true;\n\t}\n\treturn false;\n}\nconst sseEndpointSchema = z.string().max(maxSkillEndpointLength).url().refine((url) => {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.protocol !== \"https:\") return false;\n\t\tif (isPrivateOrLocalIP(parsed.hostname)) return false;\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}, { message: \"Endpoint must be a public HTTPS URL\" });\nconst skillNameSchema = z.string().min(1).max(maxSkillNameLength).regex(packageWithVersionRegex);\nconst mcpStdioSkillCommandSchema = z.enum([\"npx\", \"uvx\"]);\nconst mcpStdioSkillSchema = z.object({\n\ttype: z.literal(\"mcpStdioSkill\"),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1).max(maxSkillDescriptionLength),\n\trule: z.string().min(1).max(maxSkillRuleLength).optional(),\n\tpick: z.array(z.string().min(1).max(maxSkillToolNameLength)).max(maxSkillPickOmitItems).optional().default([]),\n\tomit: z.array(z.string().min(1).max(maxSkillToolNameLength)).max(maxSkillPickOmitItems).optional().default([]),\n\tcommand: mcpStdioSkillCommandSchema,\n\tpackageName: z.string().min(1).max(maxSkillNameLength).regex(packageWithVersionRegex),\n\trequiredEnv: z.array(z.string().min(1).max(maxEnvNameLength).regex(envNameRegex)).max(maxSkillRequiredEnvItems).optional().default([])\n});\nconst mcpSseSkillSchema = z.object({\n\ttype: z.literal(\"mcpSseSkill\"),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1).max(maxSkillDescriptionLength),\n\trule: z.string().min(1).max(maxSkillRuleLength).optional(),\n\tpick: z.array(z.string().min(1).max(maxSkillToolNameLength)).max(maxSkillPickOmitItems).optional().default([]),\n\tomit: z.array(z.string().min(1).max(maxSkillToolNameLength)).max(maxSkillPickOmitItems).optional().default([]),\n\tendpoint: sseEndpointSchema\n});\nconst interactiveSkillSchema = z.object({\n\ttype: z.literal(\"interactiveSkill\"),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1).max(maxSkillDescriptionLength),\n\trule: z.string().min(1).max(maxSkillRuleLength).optional(),\n\ttools: z.record(z.string().min(1).max(maxSkillToolNameLength).regex(urlSafeRegex), z.object({\n\t\tdescription: z.string().min(1).max(maxSkillDescriptionLength),\n\t\tinputJsonSchema: z.string().min(1).max(maxSkillInputJsonSchemaLength)\n\t}))\n});\nconst skillSchema = z.discriminatedUnion(\"type\", [\n\tmcpStdioSkillSchema,\n\tmcpSseSkillSchema,\n\tinteractiveSkillSchema\n]);\n\n//#endregion\n//#region ../models/src/domain/expert.ts\nconst expertSchema = z.object({\n\tkey: expertKeyFieldSchema,\n\tname: expertNameFieldSchema,\n\tversion: expertVersionFieldSchema,\n\tdescription: z.string().max(maxExpertDescriptionLength).optional(),\n\tinstruction: z.string().min(1).max(maxExpertInstructionLength),\n\tskills: z.record(skillNameSchema, skillSchema).optional().default({}),\n\tdelegates: z.array(expertKeyFieldSchema).min(0).max(maxExpertDelegateItems).optional().default([]),\n\ttags: z.array(expertTagFieldSchema).min(0).max(maxExpertTagItems).optional().default([]),\n\tminRuntimeVersion: runtimeVersionSchema.optional()\n});\nconst expertMetadataSchema = z.object({\n\tscope: expertScopeSchema,\n\tversion: expertVersionSchema\n});\nconst expertWithMetadataSchema = expertSchema.extend({\n\tscope: expertScopeSchema,\n\tversion: expertVersionSchema\n});\n\n//#endregion\n//#region ../models/src/api/experts/getAll.ts\nconst request$8 = { query: z.object({\n\tfilter: z.string().describe(\"Filter by scope name (partial match)\").optional(),\n\tcategory: z.enum([\n\t\t\"general\",\n\t\t\"coding\",\n\t\t\"research\",\n\t\t\"writing\",\n\t\t\"data\",\n\t\t\"automation\"\n\t]).describe(\"Filter by category\").optional(),\n\tincludeDrafts: z.coerce.boolean().default(false).describe(\"Include unpublished scopes (owner only)\").optional(),\n\ttake: z.coerce.number().min(1).max(100).default(20),\n\tskip: z.coerce.number().min(0).default(0)\n}) };\nconst response$8 = z.object({\n\tdata: z.object({ experts: z.array(expertScopeSchema.extend({ currentVersion: expertVersionSchema.nullable() })) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../support-models/src/index.ts\nconst anthropicSupportModels = [\n\t{\n\t\tmodelId: \"claude-opus-4-5\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-opus-4-1\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-opus-4-20250514\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-sonnet-4-5\",\n\t\tdefault: true,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-sonnet-4-20250514\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-3-7-sonnet-20250219\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-haiku-4-5\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"claude-3-5-haiku-latest\",\n\t\tdefault: false,\n\t\tprovider: \"anthropic\",\n\t\tcontextWindow: 2e5\n\t}\n];\nconst googleSupportModels = [\n\t{\n\t\tmodelId: \"gemini-3-pro-preview\",\n\t\tdefault: false,\n\t\tprovider: \"google\",\n\t\tcontextWindow: 1e6\n\t},\n\t{\n\t\tmodelId: \"gemini-2.5-pro\",\n\t\tdefault: true,\n\t\tprovider: \"google\",\n\t\tcontextWindow: 1e6\n\t},\n\t{\n\t\tmodelId: \"gemini-2.5-flash\",\n\t\tdefault: false,\n\t\tprovider: \"google\",\n\t\tcontextWindow: 1e6\n\t},\n\t{\n\t\tmodelId: \"gemini-2.5-flash-lite\",\n\t\tdefault: false,\n\t\tprovider: \"google\",\n\t\tcontextWindow: 1e6\n\t}\n];\nconst openAiSupportModels = [\n\t{\n\t\tmodelId: \"gpt-5\",\n\t\tdefault: true,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 4e5\n\t},\n\t{\n\t\tmodelId: \"gpt-5-mini\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 4e5\n\t},\n\t{\n\t\tmodelId: \"gpt-5-nano\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 4e5\n\t},\n\t{\n\t\tmodelId: \"gpt-5-chat-latest\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 128e3\n\t},\n\t{\n\t\tmodelId: \"o4-mini\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"o3\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"o3-mini\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 2e5\n\t},\n\t{\n\t\tmodelId: \"gpt-4.1\",\n\t\tdefault: false,\n\t\tprovider: \"openai\",\n\t\tcontextWindow: 1e6\n\t}\n];\nconst deepseekSupportModels = [{\n\tmodelId: \"deepseek-chat\",\n\tdefault: true,\n\tprovider: \"deepseek\",\n\tcontextWindow: 128e3\n}, {\n\tmodelId: \"deepseek-reasoner\",\n\tdefault: false,\n\tprovider: \"deepseek\",\n\tcontextWindow: 128e3\n}];\nconst allSupportModels = [\n\t...anthropicSupportModels,\n\t...googleSupportModels,\n\t...openAiSupportModels,\n\t...deepseekSupportModels\n];\nconst supportModels = Object.fromEntries(allSupportModels.map((model) => [model.modelId, model]));\nfunction getSupportModelNames() {\n\treturn Object.keys(supportModels);\n}\n\n//#endregion\n//#region ../models/src/domain/job.ts\nconst reasoningBudgetSchema = z.union([z.enum([\n\t\"none\",\n\t\"minimal\",\n\t\"low\",\n\t\"medium\",\n\t\"high\"\n]), z.number().int().min(0)]);\nconst jobStatusSchema = z.enum([\n\t\"queued\",\n\t\"processing\",\n\t\"completed\",\n\t\"requestInteractiveToolResult\",\n\t\"requestDelegateResult\",\n\t\"exceededMaxSteps\",\n\t\"failed\",\n\t\"canceling\",\n\t\"canceled\",\n\t\"expired\"\n]);\nconst modelNames = getSupportModelNames();\nconst firstModel = modelNames[0];\nif (firstModel === void 0) throw new Error(\"No support models available\");\nconst jobModelSchema = z.enum([firstModel, ...modelNames.slice(1)]);\nconst jobBaseSchema = z.object({\n\ttype: z.literal(\"job\"),\n\tid: cuidSchema,\n\torganizationId: cuidSchema,\n\tapplicationId: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tstatus: jobStatusSchema,\n\tcurrentExecutionId: cuidSchema.optional(),\n\tcoordinatorExpertKey: expertKeyFieldSchema,\n\tquery: z.string().min(1).max(maxExpertJobQueryLength).optional(),\n\texpert: expertWithMetadataSchema,\n\tprovider: providerSchema,\n\tmodel: jobModelSchema,\n\treasoningBudget: reasoningBudgetSchema,\n\truntimeVersion: runtimeVersionSchema,\n\tmaxSteps: z.number().int().min(1),\n\tmaxRetries: z.number().int().min(0),\n\tcurrentStep: z.number().int().min(0),\n\ttotalSteps: z.number().int().min(0),\n\ttotalDuration: z.number().int().min(0),\n\tusage: usageSchema,\n\tlastActivity: activityOrGroupSchema.nullable().optional()\n});\nconst publishedJobSchema = jobBaseSchema.extend({\n\texpertVersionId: cuidSchema,\n\texpertDraftRefId: z.undefined()\n});\nconst draftJobSchema = jobBaseSchema.extend({\n\texpertVersionId: z.undefined(),\n\texpertDraftRefId: cuidSchema\n});\nconst jobSchema = z.union([publishedJobSchema, draftJobSchema]);\n\n//#endregion\n//#region ../models/src/api/jobs/continue.ts\nconst request$7 = {\n\tparams: z.object({ jobId: cuidSchema }),\n\tbody: z.object({\n\t\tquery: z.string().min(1).max(maxExpertJobQueryLength),\n\t\tprovider: providerSchema.optional(),\n\t\tmodel: jobModelSchema.optional(),\n\t\treasoningBudget: reasoningBudgetSchema.optional(),\n\t\tmaxSteps: z.coerce.number().optional(),\n\t\tmaxRetries: z.coerce.number().optional()\n\t})\n};\nconst response$7 = z.object({ data: z.object({ job: jobSchema }) });\n\n//#endregion\n//#region ../models/src/api/jobs/create.ts\nconst baseBodySchema = z.object({\n\tapplicationId: cuidSchema.describe(\"Application ID to create the job in\"),\n\tquery: z.string().min(1).max(maxExpertJobQueryLength),\n\tprovider: providerSchema,\n\tmodel: jobModelSchema.optional(),\n\treasoningBudget: reasoningBudgetSchema.optional(),\n\tmaxSteps: z.coerce.number().optional(),\n\tmaxRetries: z.coerce.number().optional()\n});\nconst request$6 = { body: baseBodySchema.extend({\n\texpertKey: expertKeyFieldSchema.optional(),\n\tdraftRefId: cuidSchema.describe(\"Draft ref ID to run the job with\").optional()\n}).refine((data) => {\n\tconst hasExpertKey = data.expertKey !== void 0;\n\tconst hasDraftRefId = data.draftRefId !== void 0;\n\treturn hasExpertKey && !hasDraftRefId || !hasExpertKey && hasDraftRefId;\n}, { message: \"Either expertKey or draftRefId must be provided, but not both\" }) };\nconst response$6 = z.object({ data: z.object({ job: jobSchema }) });\n\n//#endregion\n//#region ../models/src/api/jobs/getAll.ts\nconst request$5 = { query: z.object({\n\tsort: z.enum([\"createdAt\", \"updatedAt\"]).optional(),\n\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\ttake: z.coerce.number().min(1).max(100).default(20),\n\tskip: z.coerce.number().min(0).default(0),\n\texpertScopeId: cuidSchema.optional(),\n\texpertDraftScopeId: cuidSchema.optional(),\n\tapplicationId: cuidSchema.optional(),\n\tstatuses: z.preprocess((val) => typeof val === \"string\" ? val.split(\",\") : val, z.array(jobStatusSchema).optional()),\n\texpertKeyFilter: z.string().max(100).optional()\n}) };\nconst response$5 = z.object({\n\tdata: z.object({ jobs: z.array(jobSchema) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../models/src/domain/checkpoint.ts\nconst delegationTargetSchema = z.object({\n\texpert: expertSchema,\n\ttoolCallId: z.string().min(1).max(maxCheckpointToolCallIdLength),\n\ttoolName: z.string().min(1).max(maxSkillToolNameLength),\n\tquery: z.string().min(1)\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*/\nconst apiCheckpointSchema = z.object({\n\ttype: z.literal(\"checkpoint\"),\n\tid: cuidSchema,\n\tjobId: cuidSchema,\n\trunId: cuidSchema,\n\tactivities: z.array(activityOrGroupSchema),\n\tstepNumber: z.number().int().min(1),\n\tstatus: z.enum([\n\t\t\"init\",\n\t\t\"proceeding\",\n\t\t\"completed\",\n\t\t\"stoppedByInteractiveTool\",\n\t\t\"stoppedByDelegate\",\n\t\t\"stoppedByExceededMaxSteps\",\n\t\t\"stoppedByError\"\n\t]),\n\texpert: expertSchema,\n\tdelegateTo: z.array(delegationTargetSchema).optional(),\n\tdelegatedBy: z.object({\n\t\texpert: expertSchema,\n\t\ttoolCallId: z.string().min(1).max(maxCheckpointToolCallIdLength),\n\t\ttoolName: z.string().min(1).max(maxSkillToolNameLength),\n\t\tcheckpointId: cuidSchema,\n\t\trunId: cuidSchema\n\t}).optional(),\n\tinputMessages: z.array(z.union([\n\t\tinstructionMessageSchema,\n\t\tuserMessageSchema,\n\t\ttoolMessageSchema\n\t])).optional(),\n\tmessages: z.array(messageSchema),\n\tnewMessages: z.array(messageSchema),\n\ttoolCalls: z.array(toolCallSchema).optional(),\n\ttoolResults: z.array(toolResultSchema).optional(),\n\tpendingToolCalls: z.array(toolCallSchema).optional(),\n\tpartialToolResults: z.array(toolResultSchema).optional(),\n\tusage: usageSchema,\n\tcontextWindow: z.number().int().min(0).optional(),\n\tcontextWindowUsage: z.number().int().min(0).optional(),\n\terror: z.object({\n\t\tname: z.string().min(1),\n\t\tmessage: z.string().min(1),\n\t\tstatusCode: z.number().int().min(100).max(599).optional(),\n\t\tisRetryable: z.boolean()\n\t}).optional(),\n\tretryCount: z.number().int().min(0).optional(),\n\tstartedAt: datetimeSchema,\n\tfinishedAt: datetimeSchema.optional()\n});\n\n//#endregion\n//#region ../models/src/api/jobs/runs/checkpoints/getAll.ts\nconst request$4 = {\n\tparams: z.object({\n\t\tjobId: cuidSchema,\n\t\trunId: cuidSchema\n\t}),\n\tquery: z.object({\n\t\tfilter: z.string().min(1).max(256).optional(),\n\t\tsort: z.enum([\"createdAt\", \"updatedAt\"]).optional(),\n\t\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\t\ttake: z.coerce.number().min(1).max(100).default(20),\n\t\tskip: z.coerce.number().min(0).default(0)\n\t})\n};\nconst response$4 = z.object({\n\tdata: z.object({ checkpoints: z.array(apiCheckpointSchema) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../models/src/domain/run.ts\nconst runStatusSchema = z.enum([\n\t\"queued\",\n\t\"processing\",\n\t\"completed\",\n\t\"stoppedByInteractiveTool\",\n\t\"stoppedByDelegate\",\n\t\"stoppedByExceededMaxSteps\",\n\t\"stoppedByError\"\n]);\nconst runSchema = z.object({\n\ttype: z.literal(\"run\"),\n\tid: cuidSchema,\n\tjobId: cuidSchema,\n\texecutionId: cuidSchema.optional(),\n\tparentRunId: cuidSchema.optional(),\n\torganizationId: cuidSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tstatus: runStatusSchema,\n\texpertKey: expertKeyFieldSchema,\n\texpert: expertWithMetadataSchema,\n\tstepNumber: z.number().int().min(0),\n\tusage: usageSchema\n});\n\n//#endregion\n//#region ../models/src/api/jobs/runs/getAll.ts\nconst request$3 = {\n\tparams: z.object({ jobId: cuidSchema }),\n\tquery: z.object({\n\t\tsort: z.enum([\"createdAt\", \"updatedAt\"]).optional(),\n\t\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\t\ttake: z.coerce.number().min(1).max(100).default(20),\n\t\tskip: z.coerce.number().min(0).default(0)\n\t})\n};\nconst response$3 = z.object({\n\tdata: z.object({ runs: z.array(runSchema) }),\n\tmeta: paginationMeta\n});\n\n//#endregion\n//#region ../models/src/domain/providerSetting.ts\nconst baseUrlSchema = z.string().url().max(maxProviderBaseUrlLength).optional();\nconst headersSchema = z.record(z.string().min(1).max(maxProviderHeaderKeyLength), z.string().max(maxProviderHeaderValueLength)).refine((headers) => Object.keys(headers).length <= maxProviderHeadersCount, { message: `Headers must have at most ${maxProviderHeadersCount} entries` }).optional();\nconst anthropicProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema\n});\nconst googleProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema\n});\nconst openaiProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema,\n\torganization: z.string().min(1).optional(),\n\tproject: z.string().min(1).optional(),\n\tname: z.string().min(1).optional()\n});\nconst deepseekProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema\n});\nconst azureOpenaiProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema,\n\tresourceName: z.string().min(1).optional(),\n\tapiVersion: z.string().min(1).optional(),\n\tuseDeploymentBasedUrls: z.boolean().optional()\n});\nconst amazonBedrockProviderSettingsSchema = z.object({ region: z.string().min(1).optional() });\nconst googleVertexProviderSettingsSchema = z.object({\n\tbaseUrl: baseUrlSchema,\n\theaders: headersSchema,\n\tproject: z.string().min(1).optional(),\n\tlocation: z.string().min(1).optional()\n});\nconst providerSettingsSchema = z.union([\n\tanthropicProviderSettingsSchema,\n\tgoogleProviderSettingsSchema,\n\topenaiProviderSettingsSchema,\n\tdeepseekProviderSettingsSchema,\n\tazureOpenaiProviderSettingsSchema,\n\tamazonBedrockProviderSettingsSchema,\n\tgoogleVertexProviderSettingsSchema\n]);\nconst providerSettingSchema = z.object({\n\ttype: z.literal(\"providerSetting\"),\n\tid: cuidSchema,\n\tapplicationId: cuidSchema,\n\tprovider: providerSchema,\n\tsettings: providerSettingsSchema.optional(),\n\tapplication: applicationSchema,\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\nconst providerSettingResponseSchema = z.object({\n\ttype: z.literal(\"providerSetting\"),\n\tid: cuidSchema,\n\tprovider: providerSchema,\n\tsettings: providerSettingsSchema.optional(),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema\n});\nconst providerApiKeyMetadataSchema = z.object({\n\tid: cuidSchema,\n\tname: z.string(),\n\tcreatedAt: datetimeSchema,\n\tupdatedAt: datetimeSchema,\n\tlastUsedAt: datetimeSchema.nullable(),\n\texpiresAt: datetimeSchema.nullable()\n});\n\n//#endregion\n//#region ../models/src/api/provider-settings/api-keys/create.ts\nconst request$2 = {\n\tparams: z.object({\n\t\tapplicationId: cuidSchema,\n\t\tprovider: providerSchema\n\t}),\n\tbody: z.object({\n\t\tname: z.string().min(1).max(255),\n\t\tvalue: z.string().min(1)\n\t})\n};\nconst response$2 = z.object({ data: z.object({ apiKey: providerApiKeyMetadataSchema }) });\n\n//#endregion\n//#region ../models/src/api/provider-settings/create.ts\nconst request$1 = {\n\tparams: z.object({ applicationId: cuidSchema }),\n\tbody: z.object({\n\t\tprovider: providerSchema,\n\t\tsettings: providerSettingsSchema.optional()\n\t})\n};\nconst response$1 = z.object({ data: z.object({ providerSetting: providerSettingResponseSchema }) });\n\n//#endregion\n//#region ../models/src/api/provider-settings/update.ts\nconst request = {\n\tparams: z.object({\n\t\tapplicationId: cuidSchema,\n\t\tprovider: providerSchema\n\t}),\n\tbody: z.object({ settings: providerSettingsSchema.optional() })\n};\nconst response = z.object({ data: z.object({ providerSetting: providerSettingResponseSchema }) });\n\n//#endregion\n//#region src/endpoints/jobs-runs-checkpoints.ts\nfunction createRunCheckpointsApi(fetcher, basePath) {\n\treturn {\n\t\tasync list(jobId, runId, params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$4.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${basePath}/${jobId}/runs/${runId}/checkpoints${queryString}`, options);\n\t\t},\n\t\tasync get(jobId, runId, checkpointId, options) {\n\t\t\treturn fetcher.get(`${basePath}/${jobId}/runs/${runId}/checkpoints/${checkpointId}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/endpoints/jobs-runs.ts\nfunction createRunsApi(fetcher, basePath) {\n\treturn {\n\t\tasync list(jobId, params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$3.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${basePath}/${jobId}/runs${queryString}`, options);\n\t\t},\n\t\tasync get(jobId, runId, options) {\n\t\t\treturn fetcher.get(`${basePath}/${jobId}/runs/${runId}`, options);\n\t\t},\n\t\tcheckpoints: createRunCheckpointsApi(fetcher, basePath)\n\t};\n}\n\n//#endregion\n//#region src/endpoints/jobs.ts\nconst BASE_PATH$5 = \"/api/v1/jobs\";\n/**\n* Error thrown when stream ends abnormally.\n*/\nvar StreamError = class extends Error {\n\tconstructor(type, jobId, message) {\n\t\tsuper(message ?? `Stream error: ${type}`);\n\t\tthis.type = type;\n\t\tthis.jobId = jobId;\n\t\tthis.name = \"StreamError\";\n\t}\n};\n/**\n* Error thrown when stream connection or reading fails.\n*/\nvar StreamConnectionError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"StreamConnectionError\";\n\t}\n};\nfunction isErrorEventData(data) {\n\treturn typeof data === \"object\" && data !== null && \"type\" in data && typeof data.type === \"string\" && \"jobId\" in data && typeof data.jobId === \"string\";\n}\nfunction isCompleteEventData(data) {\n\treturn typeof data === \"object\" && data !== null && \"status\" in data && typeof data.status === \"string\" && \"jobId\" in data && typeof data.jobId === \"string\";\n}\nfunction createJobsApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$5.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$5}${queryString}`, options);\n\t\t},\n\t\tasync get(id, options) {\n\t\t\treturn fetcher.get(`${BASE_PATH$5}/${id}`, options);\n\t\t},\n\t\tasync start(input, options) {\n\t\t\tconst result = request$6.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(BASE_PATH$5, input, options);\n\t\t},\n\t\tasync continue(id, input, options) {\n\t\t\tconst result = request$7.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(`${BASE_PATH$5}/${id}/continue`, input, options);\n\t\t},\n\t\tasync cancel(id, options) {\n\t\t\treturn fetcher.post(`${BASE_PATH$5}/${id}/cancel`, {}, options);\n\t\t},\n\t\tasync *stream(id, options) {\n\t\t\tconst result = await fetcher.getStream(`${BASE_PATH$5}/${id}/stream`, options);\n\t\t\tif (!result.ok) throw new StreamConnectionError(result.error.message);\n\t\t\tconst reader = result.data.getReader();\n\t\t\ttry {\n\t\t\t\tfor await (const sseEvent of parseSSEEvents(reader)) if (sseEvent.event === \"message\") yield sseEvent.data;\n\t\t\t\telse if (sseEvent.event === \"error\" && isErrorEventData(sseEvent.data)) throw new StreamError(sseEvent.data.type, sseEvent.data.jobId, sseEvent.data.message);\n\t\t\t\telse if (sseEvent.event === \"complete\" && isCompleteEventData(sseEvent.data)) return;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof StreamError || error instanceof StreamConnectionError) throw error;\n\t\t\t\tif (error instanceof DOMException && error.name === \"AbortError\") throw error;\n\t\t\t\tthrow new StreamConnectionError(error instanceof Error ? error.message : \"Stream read error\");\n\t\t\t}\n\t\t},\n\t\truns: createRunsApi(fetcher, BASE_PATH$5)\n\t};\n}\n\n//#endregion\n//#region src/endpoints/applications.ts\nconst BASE_PATH$4 = \"/api/v1/applications\";\nfunction createApplicationsApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$16.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$4}${queryString}`, options);\n\t\t},\n\t\tasync get(id, options) {\n\t\t\treturn fetcher.get(`${BASE_PATH$4}/${id}`, options);\n\t\t},\n\t\tasync create(input, options) {\n\t\t\tconst result = request$17.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(BASE_PATH$4, input, options);\n\t\t},\n\t\tasync update(id, input, options) {\n\t\t\tconst result = request$15.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(`${BASE_PATH$4}/${id}`, input, options);\n\t\t},\n\t\tasync delete(id, options) {\n\t\t\treturn fetcher.delete(`${BASE_PATH$4}/${id}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/endpoints/env-secrets.ts\nconst BASE_PATH$3 = \"/api/v1/env/secrets\";\nfunction createSecretsApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$13.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$3}${queryString}`, options);\n\t\t},\n\t\tasync get(name, options) {\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.get(`${BASE_PATH$3}/${encodedName}`, options);\n\t\t},\n\t\tasync create(input, options) {\n\t\t\tconst result = request$14.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(BASE_PATH$3, input, options);\n\t\t},\n\t\tasync update(name, input, options) {\n\t\t\tconst result = request$12.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.put(`${BASE_PATH$3}/${encodedName}`, input, options);\n\t\t},\n\t\tasync delete(name, options) {\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.deleteNoContent(`${BASE_PATH$3}/${encodedName}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/endpoints/env-variables.ts\nconst BASE_PATH$2 = \"/api/v1/env/variables\";\nfunction createVariablesApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tconst result = request$10.query.safeParse(params);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$2}${queryString}`, options);\n\t\t},\n\t\tasync get(name, options) {\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.get(`${BASE_PATH$2}/${encodedName}`, options);\n\t\t},\n\t\tasync create(input, options) {\n\t\t\tconst result = request$11.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(BASE_PATH$2, input, options);\n\t\t},\n\t\tasync update(name, input, options) {\n\t\t\tconst result = request$9.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.put(`${BASE_PATH$2}/${encodedName}`, input, options);\n\t\t},\n\t\tasync delete(name, options) {\n\t\t\tconst encodedName = encodeURIComponent(name);\n\t\t\treturn fetcher.deleteNoContent(`${BASE_PATH$2}/${encodedName}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/endpoints/env.ts\nfunction createEnvApi(fetcher) {\n\treturn {\n\t\tsecrets: createSecretsApi(fetcher),\n\t\tvariables: createVariablesApi(fetcher)\n\t};\n}\n\n//#endregion\n//#region src/endpoints/experts-versions.ts\nfunction createVersionsApi(fetcher, basePath) {\n\treturn { async list(scopeName, options) {\n\t\tconst encodedScopeName = encodeURIComponent(scopeName);\n\t\treturn fetcher.get(`${basePath}/${encodedScopeName}/versions`, options);\n\t} };\n}\n\n//#endregion\n//#region src/endpoints/experts.ts\nconst BASE_PATH$1 = \"/api/v1/experts\";\nfunction createExpertsApi(fetcher) {\n\treturn {\n\t\tasync list(params, options) {\n\t\t\tif (params) {\n\t\t\t\tconst result = request$8.query.safeParse(params);\n\t\t\t\tif (!result.success) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: createValidationError(result.error)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst queryString = buildQueryString(params);\n\t\t\treturn fetcher.get(`${BASE_PATH$1}${queryString}`, options);\n\t\t},\n\t\tasync get(key, options) {\n\t\t\tconst encodedKey = encodeURIComponent(key);\n\t\t\treturn fetcher.get(`${BASE_PATH$1}/${encodedKey}`, options);\n\t\t},\n\t\tasync getFeatured(options) {\n\t\t\treturn fetcher.get(`${BASE_PATH$1}/featured`, options);\n\t\t},\n\t\tasync getMeta(key, options) {\n\t\t\tconst encodedKey = encodeURIComponent(key);\n\t\t\treturn fetcher.get(`${BASE_PATH$1}/${encodedKey}/meta`, options);\n\t\t},\n\t\tasync publish(scopeName, options) {\n\t\t\tconst encodedScopeName = encodeURIComponent(scopeName);\n\t\t\treturn fetcher.post(`${BASE_PATH$1}/${encodedScopeName}/publish`, {}, options);\n\t\t},\n\t\tasync unpublish(scopeName, options) {\n\t\t\tconst encodedScopeName = encodeURIComponent(scopeName);\n\t\t\treturn fetcher.post(`${BASE_PATH$1}/${encodedScopeName}/unpublish`, {}, options);\n\t\t},\n\t\tasync yank(key, options) {\n\t\t\tconst encodedKey = encodeURIComponent(key);\n\t\t\treturn fetcher.delete(`${BASE_PATH$1}/${encodedKey}`, options);\n\t\t},\n\t\tversions: createVersionsApi(fetcher, BASE_PATH$1)\n\t};\n}\n\n//#endregion\n//#region src/endpoints/provider-settings.ts\nconst BASE_PATH = \"/api/v1/applications\";\nfunction createProviderSettingsApi(fetcher) {\n\treturn {\n\t\tasync list(applicationId, options) {\n\t\t\treturn fetcher.get(`${BASE_PATH}/${applicationId}/provider_settings`, options);\n\t\t},\n\t\tasync get(applicationId, provider, options) {\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.get(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`, options);\n\t\t},\n\t\tasync create(applicationId, input, options) {\n\t\t\tconst result = request$1.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\treturn fetcher.post(`${BASE_PATH}/${applicationId}/provider_settings`, input, options);\n\t\t},\n\t\tasync update(applicationId, provider, input, options) {\n\t\t\tconst result = request.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.post(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`, input, options);\n\t\t},\n\t\tasync delete(applicationId, provider, options) {\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.deleteNoContent(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}`, options);\n\t\t},\n\t\tasync listApiKeys(applicationId, provider, options) {\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.get(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys`, options);\n\t\t},\n\t\tasync createApiKey(applicationId, provider, input, options) {\n\t\t\tconst result = request$2.body.safeParse(input);\n\t\t\tif (!result.success) return {\n\t\t\t\tok: false,\n\t\t\t\terror: createValidationError(result.error)\n\t\t\t};\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\treturn fetcher.post(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys`, input, options);\n\t\t},\n\t\tasync deleteApiKey(applicationId, provider, apiKeyId, options) {\n\t\t\tconst encodedProvider = encodeURIComponent(provider);\n\t\t\tconst encodedApiKeyId = encodeURIComponent(apiKeyId);\n\t\t\treturn fetcher.deleteNoContent(`${BASE_PATH}/${applicationId}/provider_settings/${encodedProvider}/api_keys/${encodedApiKeyId}`, options);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/public/client.ts\nfunction createApiClient(config) {\n\tconst fetcher = createFetcher(config);\n\treturn {\n\t\tapplications: createApplicationsApi(fetcher),\n\t\tenv: createEnvApi(fetcher),\n\t\tjobs: createJobsApi(fetcher),\n\t\texperts: createExpertsApi(fetcher),\n\t\tproviderSettings: createProviderSettingsApi(fetcher)\n\t};\n}\n\n//#endregion\nexport { StreamConnectionError, StreamError, buildAuthHeaders, buildQueryString, createAbortError, createApiClient, createFetcher, createHttpError, createNetworkError, createTimeoutError, createValidationError, handleHttpError, isAbortError, isClientError, isHttpError, isNetworkError, isTimeoutError, isValidationError, matchExperts, matchOperations, matchWildcard, parseApiKeyPermissions, parseSSE, parseSSEEvents, stringifyApiKeyPermissions };\n//# sourceMappingURL=index.mjs.map","import { createApiClient } from \"@perstack/api-client\"\nimport { type Expert, PerstackError, type RuntimeVersion, type Skill } from \"@perstack/core\"\n\nexport async function resolveExpertToRun(\n expertKey: string,\n experts: Record<string, Expert>,\n clientOptions: {\n perstackApiBaseUrl: string\n perstackApiKey?: string\n },\n): Promise<Expert> {\n if (experts[expertKey]) {\n return experts[expertKey]\n }\n if (!clientOptions.perstackApiKey) {\n throw new PerstackError(\n `PERSTACK_API_KEY is required to resolve published expert \"${expertKey}\"`,\n )\n }\n const client = createApiClient({\n baseUrl: clientOptions.perstackApiBaseUrl,\n apiKey: clientOptions.perstackApiKey,\n })\n const result = await client.experts.get(expertKey)\n if (!result.ok) {\n throw new PerstackError(`Failed to resolve expert \"${expertKey}\": ${result.error.message}`)\n }\n const publishedExpert = result.data.data.definition.experts[expertKey]\n if (!publishedExpert) {\n throw new PerstackError(`Expert \"${expertKey}\" not found in API response`)\n }\n return toRuntimeExpert(expertKey, publishedExpert)\n}\n\nfunction toRuntimeExpert(\n key: string,\n expert: {\n name: string\n version: string\n minRuntimeVersion?: RuntimeVersion\n description?: string\n instruction: string\n skills?: Record<\n string,\n | {\n type: \"mcpStdioSkill\"\n name: string\n description: string\n rule?: string\n pick?: string[]\n omit?: string[]\n command: \"npx\" | \"uvx\"\n packageName: string\n requiredEnv?: string[]\n }\n | {\n type: \"mcpSseSkill\"\n name: string\n description: string\n rule?: string\n pick?: string[]\n omit?: string[]\n endpoint: string\n }\n | {\n type: \"interactiveSkill\"\n name: string\n description: string\n rule?: string\n tools: Record<string, { description: string; inputJsonSchema: string }>\n }\n >\n delegates?: string[]\n tags?: string[]\n },\n): Expert {\n const skills: Record<string, Skill> = Object.fromEntries(\n Object.entries(expert.skills ?? {}).map(([name, skill]) => {\n switch (skill.type) {\n case \"mcpStdioSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n pick: skill.pick ?? [],\n omit: skill.omit ?? [],\n command: skill.command,\n packageName: skill.packageName,\n requiredEnv: skill.requiredEnv ?? [],\n },\n ]\n case \"mcpSseSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n pick: skill.pick ?? [],\n omit: skill.omit ?? [],\n endpoint: skill.endpoint,\n },\n ]\n case \"interactiveSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n tools: Object.fromEntries(\n Object.entries(skill.tools).map(([toolName, tool]) => [\n toolName,\n {\n name: toolName,\n description: tool.description,\n inputSchema: JSON.parse(tool.inputJsonSchema),\n },\n ]),\n ),\n },\n ]\n default: {\n throw new PerstackError(`Unknown skill type: ${(skill as { type: string }).type}`)\n }\n }\n }),\n )\n return {\n key,\n name: expert.name,\n version: expert.version,\n minRuntimeVersion: expert.minRuntimeVersion ?? \"v1.0\",\n description: expert.description ?? \"\",\n instruction: expert.instruction,\n skills,\n delegates: expert.delegates ?? [],\n tags: expert.tags ?? [],\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;AA2CA,SAAS,sBAAsB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,MAAQ,kBAAkB,OAAO,EAAE,gBAAgB,oBAAoB,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC;CAClH,MAAM;CACN,CAAC;AAIF,MAAM,yBAAyB;CAC9B;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;AACD,MAAM,sBAAsB;CAC3B;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;AACD,MAAM,sBAAsB;CAC3B;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAAe;EACf;CACD;EACC,SAAS;EACT,SAAS;EACT,UAAU;EACV,eAA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MAAM,MAAM,QAAQ,EAAE;IACtB,MAAM,MAAM,QAAQ,EAAE;IACtB,SAAS,MAAM;IACf,aAAa,MAAM;IACnB,aAAa,MAAM,eAAe,EAAE;IACrC,CACF;GACH,KAAK,cACH,QAAO,CACL,MACA;IACE,MAAM,MAAM;IACZ;IACA,aAAa,MAAM;IACnB,MAAM,MAAM;IACZ,MAAM,MAAM,QAAQ,EAAE;IACtB,MAAM,MAAM,QAAQ,EAAE;IACtB,UAAU,MAAM;IACjB,CACF;GACH,KAAK,mBACH,QAAO,CACL,MACA;IACE,MAAM,MAAM;IACZ;IACA,aAAa,MAAM;IACnB,MAAM,MAAM;IACZ,OAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,UAAU,CACpD,UACA;KACE,MAAM;KACN,aAAa,KAAK;KAClB,aAAa,KAAK,MAAM,KAAK,gBAAgB;KAC9C,CACF,CAAC,CACH;IACF,CACF;GACH,QACE,OAAM,IAAI,cAAc,uBAAwB,MAA2B,OAAO;;GAGtF,CACH;AACD,QAAO;EACL;EACA,MAAM,OAAO;EACb,SAAS,OAAO;EAChB,mBAAmB,OAAO,qBAAqB;EAC/C,aAAa,OAAO,eAAe;EACnC,aAAa,OAAO;EACpB;EACA,WAAW,OAAO,aAAa,EAAE;EACjC,MAAM,OAAO,QAAQ,EAAE;EACxB"}
@@ -7571,5 +7571,5 @@ function parseWithFriendlyError(schema, data, context) {
7571
7571
  }
7572
7572
 
7573
7573
  //#endregion
7574
- export { custom as $, startCommandInputSchema as A, normalizeParams as At, toolMessageSchema as B, startGeneration as C, $ZodType as Ct, stopRunByExceededMaxSteps as D, safeParseAsync$1 as Dt, stopRunByError as E, safeParse$1 as Et, usageSchema as F, defaultMaxRetries as Ft, ZodOptional as G, activityOrGroupSchema as H, toolResultSchema as I, defaultTimeout as It, _null as J, _enum as K, toolCallSchema as L, createId as Lt, lockfileSchema as M, NEVER as Mt, jobSchema as N, knownModels as Nt, stopRunByInteractiveTool as O, clone as Ot, checkpointSchema as P, PerstackError as Pt, boolean$1 as Q, instructionMessageSchema as R, skipDelegates as S, $ZodObject as St, stopRunByDelegate as T, parseAsync$1 as Tt, boolean as U, userMessageSchema as V, number as W, any as X, _undefined as Y, array as Z, resolveToolResults as _, safeParseAsync as _t, BASE_SKILL_PREFIX as a, never as at, runParamsSchema as b, describe$1 as bt, attemptCompletion as c, optional as ct, continueToNextStep as d, strictObject as dt, discriminatedUnion as et, createRuntimeEvent as f, string as ft, proceedToInteractiveTools as g, url as gt, finishToolCall as h, unknown as ht, getFilteredEnv as i, looseObject as it, perstackConfigSchema as j, $constructor as jt, runCommandInputSchema as k, defineLazy as kt, callTools as l, preprocess as lt, finishMcpTools as m, union as mt, createFilteredEventListener as n, lazy as nt, createBaseToolActivity as o, number$1 as ot, createStreamingEvent as p, tuple as pt, _instanceof as q, validateEventFilter as r, literal as rt, createGeneralToolActivity as s, object as st, parseWithFriendlyError as t, intersection as tt, completeRun as u, record as ut, resumeFromStop as v, datetime as vt, startRun as w, parse$1 as wt, runSettingSchema as x, meta$1 as xt, retry as y, toJSONSchema as yt, messageSchema as z };
7575
- //# sourceMappingURL=src-DVhxRHrP.js.map
7574
+ export { boolean$1 as $, startCommandInputSchema as A, defineLazy as At, messageSchema as B, startGeneration as C, $ZodObject as Ct, stopRunByExceededMaxSteps as D, safeParse$1 as Dt, stopRunByError as E, parseAsync$1 as Et, checkpointSchema as F, PerstackError as Ft, number as G, userMessageSchema as H, usageSchema as I, defaultMaxRetries as It, _instanceof as J, ZodOptional as K, toolResultSchema as L, defaultTimeout as Lt, lockfileSchema as M, $constructor as Mt, jobSchema as N, NEVER as Nt, stopRunByInteractiveTool as O, safeParseAsync$1 as Ot, expertSchema as P, knownModels as Pt, array as Q, toolCallSchema as R, createId as Rt, skipDelegates as S, meta$1 as St, stopRunByDelegate as T, parse$1 as Tt, activityOrGroupSchema as U, toolMessageSchema as V, boolean as W, _undefined as X, _null as Y, any as Z, resolveToolResults as _, url as _t, BASE_SKILL_PREFIX as a, looseObject as at, runParamsSchema as b, toJSONSchema as bt, attemptCompletion as c, object as ct, continueToNextStep as d, record as dt, custom as et, createRuntimeEvent as f, strictObject as ft, proceedToInteractiveTools as g, unknown as gt, finishToolCall as h, union as ht, getFilteredEnv as i, literal as it, perstackConfigSchema as j, normalizeParams as jt, runCommandInputSchema as k, clone as kt, callTools as l, optional as lt, finishMcpTools as m, tuple as mt, createFilteredEventListener as n, intersection as nt, createBaseToolActivity as o, never as ot, createStreamingEvent as p, string as pt, _enum as q, validateEventFilter as r, lazy as rt, createGeneralToolActivity as s, number$1 as st, parseWithFriendlyError as t, discriminatedUnion as tt, completeRun as u, preprocess as ut, resumeFromStop as v, safeParseAsync as vt, startRun as w, $ZodType as wt, runSettingSchema as x, describe$1 as xt, retry as y, datetime as yt, instructionMessageSchema as z };
7575
+ //# sourceMappingURL=src-D-q0VJ6r.js.map