perstack 0.0.98 → 0.0.100

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.
@@ -1591,198 +1591,6 @@ var PerstackError = class extends Error {
1591
1591
  }
1592
1592
  };
1593
1593
 
1594
- //#endregion
1595
- //#region ../../packages/core/src/known-models/index.ts
1596
- const knownModels = [
1597
- {
1598
- provider: "anthropic",
1599
- models: [
1600
- {
1601
- name: "claude-opus-4-6",
1602
- contextWindow: 2e5,
1603
- maxOutputTokens: 128e3
1604
- },
1605
- {
1606
- name: "claude-opus-4-5",
1607
- contextWindow: 2e5,
1608
- maxOutputTokens: 32e3
1609
- },
1610
- {
1611
- name: "claude-opus-4-1",
1612
- contextWindow: 2e5,
1613
- maxOutputTokens: 32e3
1614
- },
1615
- {
1616
- name: "claude-opus-4-20250514",
1617
- contextWindow: 2e5,
1618
- maxOutputTokens: 32e3
1619
- },
1620
- {
1621
- name: "claude-sonnet-4-5",
1622
- contextWindow: 2e5,
1623
- maxOutputTokens: 64e3
1624
- },
1625
- {
1626
- name: "claude-sonnet-4-20250514",
1627
- contextWindow: 2e5,
1628
- maxOutputTokens: 64e3
1629
- },
1630
- {
1631
- name: "claude-3-7-sonnet-20250219",
1632
- contextWindow: 2e5,
1633
- maxOutputTokens: 64e3
1634
- },
1635
- {
1636
- name: "claude-haiku-4-5",
1637
- contextWindow: 2e5,
1638
- maxOutputTokens: 8192
1639
- },
1640
- {
1641
- name: "claude-3-5-haiku-latest",
1642
- contextWindow: 2e5,
1643
- maxOutputTokens: 8192
1644
- }
1645
- ]
1646
- },
1647
- {
1648
- provider: "google",
1649
- models: [
1650
- {
1651
- name: "gemini-3-flash-preview",
1652
- contextWindow: 1048576,
1653
- maxOutputTokens: 65536
1654
- },
1655
- {
1656
- name: "gemini-3-pro-preview",
1657
- contextWindow: 1048576,
1658
- maxOutputTokens: 65536
1659
- },
1660
- {
1661
- name: "gemini-2.5-pro",
1662
- contextWindow: 1048576,
1663
- maxOutputTokens: 65536
1664
- },
1665
- {
1666
- name: "gemini-2.5-flash",
1667
- contextWindow: 1048576,
1668
- maxOutputTokens: 65536
1669
- },
1670
- {
1671
- name: "gemini-2.5-flash-lite",
1672
- contextWindow: 1048576,
1673
- maxOutputTokens: 65536
1674
- }
1675
- ]
1676
- },
1677
- {
1678
- provider: "openai",
1679
- models: [
1680
- {
1681
- name: "gpt-5",
1682
- contextWindow: 4e5,
1683
- maxOutputTokens: 128e3
1684
- },
1685
- {
1686
- name: "gpt-5-mini",
1687
- contextWindow: 4e5,
1688
- maxOutputTokens: 128e3
1689
- },
1690
- {
1691
- name: "gpt-5-nano",
1692
- contextWindow: 4e5,
1693
- maxOutputTokens: 128e3
1694
- },
1695
- {
1696
- name: "gpt-5.2",
1697
- contextWindow: 4e5,
1698
- maxOutputTokens: 128e3
1699
- },
1700
- {
1701
- name: "gpt-5.2-pro",
1702
- contextWindow: 4e5,
1703
- maxOutputTokens: 128e3
1704
- },
1705
- {
1706
- name: "gpt-5.1",
1707
- contextWindow: 4e5,
1708
- maxOutputTokens: 128e3
1709
- },
1710
- {
1711
- name: "gpt-5-chat-latest",
1712
- contextWindow: 128e3,
1713
- maxOutputTokens: 16384
1714
- },
1715
- {
1716
- name: "o4-mini",
1717
- contextWindow: 2e5,
1718
- maxOutputTokens: 1e5
1719
- },
1720
- {
1721
- name: "o3",
1722
- contextWindow: 2e5,
1723
- maxOutputTokens: 1e4
1724
- },
1725
- {
1726
- name: "o3-mini",
1727
- contextWindow: 2e5,
1728
- maxOutputTokens: 1e4
1729
- },
1730
- {
1731
- name: "gpt-4.1",
1732
- contextWindow: 1047576,
1733
- maxOutputTokens: 32768
1734
- }
1735
- ]
1736
- },
1737
- {
1738
- provider: "deepseek",
1739
- models: [{
1740
- name: "deepseek-chat",
1741
- contextWindow: 128e3,
1742
- maxOutputTokens: 8192
1743
- }, {
1744
- name: "deepseek-reasoner",
1745
- contextWindow: 128e3,
1746
- maxOutputTokens: 64e3
1747
- }]
1748
- },
1749
- {
1750
- provider: "ollama",
1751
- models: [
1752
- {
1753
- name: "gpt-oss:20b",
1754
- contextWindow: 131072,
1755
- maxOutputTokens: 131072
1756
- },
1757
- {
1758
- name: "gpt-oss:120b",
1759
- contextWindow: 131072,
1760
- maxOutputTokens: 131072
1761
- },
1762
- {
1763
- name: "gemma3:1b",
1764
- contextWindow: 32e3,
1765
- maxOutputTokens: 32e3
1766
- },
1767
- {
1768
- name: "gemma3:4b",
1769
- contextWindow: 128e3,
1770
- maxOutputTokens: 128e3
1771
- },
1772
- {
1773
- name: "gemma3:12b",
1774
- contextWindow: 128e3,
1775
- maxOutputTokens: 128e3
1776
- },
1777
- {
1778
- name: "gemma3:27b",
1779
- contextWindow: 128e3,
1780
- maxOutputTokens: 128e3
1781
- }
1782
- ]
1783
- }
1784
- ];
1785
-
1786
1594
  //#endregion
1787
1595
  //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/core.js
1788
1596
  /** A special constant with type `never` */
@@ -6275,70 +6083,322 @@ function boolean(params) {
6275
6083
  }
6276
6084
 
6277
6085
  //#endregion
6278
- //#region ../../packages/core/src/schemas/message-part.ts
6279
- const basePartSchema = object({ id: string() });
6280
- const textPartSchema = basePartSchema.extend({
6281
- type: literal("textPart"),
6282
- text: string()
6283
- });
6284
- const imageUrlPartSchema = basePartSchema.extend({
6285
- type: literal("imageUrlPart"),
6286
- url: url(),
6287
- mimeType: string()
6288
- });
6289
- const imageInlinePartSchema = basePartSchema.extend({
6290
- type: literal("imageInlinePart"),
6291
- encodedData: string(),
6292
- mimeType: string()
6293
- });
6294
- const imageBinaryPartSchema = basePartSchema.extend({
6295
- type: literal("imageBinaryPart"),
6296
- data: string(),
6297
- mimeType: string()
6298
- });
6299
- const fileUrlPartSchema = basePartSchema.extend({
6300
- type: literal("fileUrlPart"),
6301
- url: string().url(),
6302
- mimeType: string()
6303
- });
6304
- const fileInlinePartSchema = basePartSchema.extend({
6305
- type: literal("fileInlinePart"),
6306
- encodedData: string(),
6307
- mimeType: string()
6308
- });
6309
- const fileBinaryPartSchema = basePartSchema.extend({
6310
- type: literal("fileBinaryPart"),
6311
- data: string(),
6312
- mimeType: string()
6313
- });
6314
- const toolCallPartSchema = basePartSchema.extend({
6315
- type: literal("toolCallPart"),
6316
- toolCallId: string(),
6317
- toolName: string(),
6318
- args: record(string(), unknown())
6319
- });
6320
- const thinkingPartSchema = basePartSchema.extend({
6321
- type: literal("thinkingPart"),
6322
- thinking: string(),
6323
- signature: string().optional()
6324
- });
6325
- const toolResultPartSchema = basePartSchema.extend({
6326
- type: literal("toolResultPart"),
6327
- toolCallId: string(),
6328
- toolName: string(),
6329
- contents: array(union([
6330
- textPartSchema,
6331
- imageInlinePartSchema,
6332
- fileInlinePartSchema
6333
- ])),
6334
- isError: boolean$1().optional()
6335
- });
6336
- const messagePartSchema = discriminatedUnion("type", [
6337
- textPartSchema,
6338
- imageUrlPartSchema,
6339
- imageInlinePartSchema,
6340
- imageBinaryPartSchema,
6341
- fileUrlPartSchema,
6086
+ //#region ../../packages/core/src/known-models/model-tiers.ts
6087
+ const modelTierSchema$1 = _enum([
6088
+ "low",
6089
+ "middle",
6090
+ "high"
6091
+ ]);
6092
+ /**
6093
+ * Cloud-hosted providers that share model names with a base provider.
6094
+ * Used to fall back when looking up models by tier.
6095
+ */
6096
+ const cloudProviderFallback = {
6097
+ "azure-openai": "openai",
6098
+ "amazon-bedrock": "anthropic",
6099
+ "google-vertex": "google"
6100
+ };
6101
+ /**
6102
+ * Resolve a model tier to a concrete model name for the given provider.
6103
+ * Returns the first model matching the tier in the provider's known models list.
6104
+ * For cloud-hosted providers (azure-openai, amazon-bedrock, google-vertex),
6105
+ * falls back to their base provider's models.
6106
+ */
6107
+ function resolveModelTier(providerName, tier) {
6108
+ const lookupProvider = cloudProviderFallback[providerName] ?? providerName;
6109
+ return knownModels.find((p) => p.provider === lookupProvider)?.models.find((m) => m.tier === tier)?.name;
6110
+ }
6111
+
6112
+ //#endregion
6113
+ //#region ../../packages/core/src/known-models/index.ts
6114
+ const knownModels = [
6115
+ {
6116
+ provider: "anthropic",
6117
+ models: [
6118
+ {
6119
+ name: "claude-opus-4-6",
6120
+ tier: "high",
6121
+ contextWindow: 2e5,
6122
+ maxOutputTokens: 128e3
6123
+ },
6124
+ {
6125
+ name: "claude-opus-4-5",
6126
+ tier: "high",
6127
+ contextWindow: 2e5,
6128
+ maxOutputTokens: 32e3
6129
+ },
6130
+ {
6131
+ name: "claude-opus-4-1",
6132
+ tier: "high",
6133
+ contextWindow: 2e5,
6134
+ maxOutputTokens: 32e3
6135
+ },
6136
+ {
6137
+ name: "claude-opus-4-20250514",
6138
+ tier: "high",
6139
+ contextWindow: 2e5,
6140
+ maxOutputTokens: 32e3
6141
+ },
6142
+ {
6143
+ name: "claude-sonnet-4-5",
6144
+ tier: "middle",
6145
+ contextWindow: 2e5,
6146
+ maxOutputTokens: 64e3
6147
+ },
6148
+ {
6149
+ name: "claude-sonnet-4-20250514",
6150
+ tier: "middle",
6151
+ contextWindow: 2e5,
6152
+ maxOutputTokens: 64e3
6153
+ },
6154
+ {
6155
+ name: "claude-3-7-sonnet-20250219",
6156
+ tier: "middle",
6157
+ contextWindow: 2e5,
6158
+ maxOutputTokens: 64e3
6159
+ },
6160
+ {
6161
+ name: "claude-haiku-4-5",
6162
+ tier: "low",
6163
+ contextWindow: 2e5,
6164
+ maxOutputTokens: 8192
6165
+ },
6166
+ {
6167
+ name: "claude-3-5-haiku-latest",
6168
+ tier: "low",
6169
+ contextWindow: 2e5,
6170
+ maxOutputTokens: 8192
6171
+ }
6172
+ ]
6173
+ },
6174
+ {
6175
+ provider: "google",
6176
+ models: [
6177
+ {
6178
+ name: "gemini-3-flash-preview",
6179
+ tier: "middle",
6180
+ contextWindow: 1048576,
6181
+ maxOutputTokens: 65536
6182
+ },
6183
+ {
6184
+ name: "gemini-3-pro-preview",
6185
+ tier: "high",
6186
+ contextWindow: 1048576,
6187
+ maxOutputTokens: 65536
6188
+ },
6189
+ {
6190
+ name: "gemini-2.5-pro",
6191
+ tier: "high",
6192
+ contextWindow: 1048576,
6193
+ maxOutputTokens: 65536
6194
+ },
6195
+ {
6196
+ name: "gemini-2.5-flash",
6197
+ tier: "middle",
6198
+ contextWindow: 1048576,
6199
+ maxOutputTokens: 65536
6200
+ },
6201
+ {
6202
+ name: "gemini-2.5-flash-lite",
6203
+ tier: "low",
6204
+ contextWindow: 1048576,
6205
+ maxOutputTokens: 65536
6206
+ }
6207
+ ]
6208
+ },
6209
+ {
6210
+ provider: "openai",
6211
+ models: [
6212
+ {
6213
+ name: "gpt-5.2-pro",
6214
+ tier: "high",
6215
+ contextWindow: 4e5,
6216
+ maxOutputTokens: 128e3
6217
+ },
6218
+ {
6219
+ name: "gpt-5",
6220
+ tier: "high",
6221
+ contextWindow: 4e5,
6222
+ maxOutputTokens: 128e3
6223
+ },
6224
+ {
6225
+ name: "gpt-5-mini",
6226
+ tier: "middle",
6227
+ contextWindow: 4e5,
6228
+ maxOutputTokens: 128e3
6229
+ },
6230
+ {
6231
+ name: "gpt-5-nano",
6232
+ tier: "low",
6233
+ contextWindow: 4e5,
6234
+ maxOutputTokens: 128e3
6235
+ },
6236
+ {
6237
+ name: "gpt-5.2",
6238
+ tier: "middle",
6239
+ contextWindow: 4e5,
6240
+ maxOutputTokens: 128e3
6241
+ },
6242
+ {
6243
+ name: "gpt-5.1",
6244
+ tier: "middle",
6245
+ contextWindow: 4e5,
6246
+ maxOutputTokens: 128e3
6247
+ },
6248
+ {
6249
+ name: "gpt-5-chat-latest",
6250
+ tier: "middle",
6251
+ contextWindow: 128e3,
6252
+ maxOutputTokens: 16384
6253
+ },
6254
+ {
6255
+ name: "o4-mini",
6256
+ tier: "middle",
6257
+ contextWindow: 2e5,
6258
+ maxOutputTokens: 1e5
6259
+ },
6260
+ {
6261
+ name: "o3",
6262
+ tier: "high",
6263
+ contextWindow: 2e5,
6264
+ maxOutputTokens: 1e4
6265
+ },
6266
+ {
6267
+ name: "o3-mini",
6268
+ tier: "middle",
6269
+ contextWindow: 2e5,
6270
+ maxOutputTokens: 1e4
6271
+ },
6272
+ {
6273
+ name: "gpt-4.1",
6274
+ tier: "middle",
6275
+ contextWindow: 1047576,
6276
+ maxOutputTokens: 32768
6277
+ }
6278
+ ]
6279
+ },
6280
+ {
6281
+ provider: "deepseek",
6282
+ models: [{
6283
+ name: "deepseek-chat",
6284
+ tier: "middle",
6285
+ contextWindow: 128e3,
6286
+ maxOutputTokens: 8192
6287
+ }, {
6288
+ name: "deepseek-reasoner",
6289
+ tier: "high",
6290
+ contextWindow: 128e3,
6291
+ maxOutputTokens: 64e3
6292
+ }]
6293
+ },
6294
+ {
6295
+ provider: "ollama",
6296
+ models: [
6297
+ {
6298
+ name: "gpt-oss:20b",
6299
+ tier: "middle",
6300
+ contextWindow: 131072,
6301
+ maxOutputTokens: 131072
6302
+ },
6303
+ {
6304
+ name: "gpt-oss:120b",
6305
+ tier: "high",
6306
+ contextWindow: 131072,
6307
+ maxOutputTokens: 131072
6308
+ },
6309
+ {
6310
+ name: "gemma3:1b",
6311
+ tier: "low",
6312
+ contextWindow: 32e3,
6313
+ maxOutputTokens: 32e3
6314
+ },
6315
+ {
6316
+ name: "gemma3:4b",
6317
+ tier: "low",
6318
+ contextWindow: 128e3,
6319
+ maxOutputTokens: 128e3
6320
+ },
6321
+ {
6322
+ name: "gemma3:12b",
6323
+ tier: "middle",
6324
+ contextWindow: 128e3,
6325
+ maxOutputTokens: 128e3
6326
+ },
6327
+ {
6328
+ name: "gemma3:27b",
6329
+ tier: "middle",
6330
+ contextWindow: 128e3,
6331
+ maxOutputTokens: 128e3
6332
+ }
6333
+ ]
6334
+ }
6335
+ ];
6336
+
6337
+ //#endregion
6338
+ //#region ../../packages/core/src/schemas/message-part.ts
6339
+ const basePartSchema = object({ id: string() });
6340
+ const textPartSchema = basePartSchema.extend({
6341
+ type: literal("textPart"),
6342
+ text: string()
6343
+ });
6344
+ const imageUrlPartSchema = basePartSchema.extend({
6345
+ type: literal("imageUrlPart"),
6346
+ url: url(),
6347
+ mimeType: string()
6348
+ });
6349
+ const imageInlinePartSchema = basePartSchema.extend({
6350
+ type: literal("imageInlinePart"),
6351
+ encodedData: string(),
6352
+ mimeType: string()
6353
+ });
6354
+ const imageBinaryPartSchema = basePartSchema.extend({
6355
+ type: literal("imageBinaryPart"),
6356
+ data: string(),
6357
+ mimeType: string()
6358
+ });
6359
+ const fileUrlPartSchema = basePartSchema.extend({
6360
+ type: literal("fileUrlPart"),
6361
+ url: string().url(),
6362
+ mimeType: string()
6363
+ });
6364
+ const fileInlinePartSchema = basePartSchema.extend({
6365
+ type: literal("fileInlinePart"),
6366
+ encodedData: string(),
6367
+ mimeType: string()
6368
+ });
6369
+ const fileBinaryPartSchema = basePartSchema.extend({
6370
+ type: literal("fileBinaryPart"),
6371
+ data: string(),
6372
+ mimeType: string()
6373
+ });
6374
+ const toolCallPartSchema = basePartSchema.extend({
6375
+ type: literal("toolCallPart"),
6376
+ toolCallId: string(),
6377
+ toolName: string(),
6378
+ args: record(string(), unknown())
6379
+ });
6380
+ const thinkingPartSchema = basePartSchema.extend({
6381
+ type: literal("thinkingPart"),
6382
+ thinking: string(),
6383
+ signature: string().optional()
6384
+ });
6385
+ const toolResultPartSchema = basePartSchema.extend({
6386
+ type: literal("toolResultPart"),
6387
+ toolCallId: string(),
6388
+ toolName: string(),
6389
+ contents: array(union([
6390
+ textPartSchema,
6391
+ imageInlinePartSchema,
6392
+ fileInlinePartSchema
6393
+ ])),
6394
+ isError: boolean$1().optional()
6395
+ });
6396
+ const messagePartSchema = discriminatedUnion("type", [
6397
+ textPartSchema,
6398
+ imageUrlPartSchema,
6399
+ imageInlinePartSchema,
6400
+ imageBinaryPartSchema,
6401
+ fileUrlPartSchema,
6342
6402
  fileInlinePartSchema,
6343
6403
  fileBinaryPartSchema,
6344
6404
  toolCallPartSchema,
@@ -6903,6 +6963,7 @@ const expertBaseSchema = object({
6903
6963
  delegates: array(string().regex(expertKeyRegex$1).min(1)).optional().default([]),
6904
6964
  tags: array(string().regex(tagNameRegex$1).min(1)).optional().default([]),
6905
6965
  minRuntimeVersion: runtimeVersionSchema$1.default("v1.0"),
6966
+ defaultModelTier: modelTierSchema$1.optional(),
6906
6967
  providerTools: array(string()).optional(),
6907
6968
  providerSkills: array(anthropicProviderSkillSchema).optional(),
6908
6969
  providerToolOptions: providerToolOptionsSchema
@@ -7152,6 +7213,7 @@ const perstackConfigSchema = object({
7152
7213
  minRuntimeVersion: runtimeVersionSchema$1.optional(),
7153
7214
  description: string().optional(),
7154
7215
  instruction: string(),
7216
+ defaultModelTier: modelTierSchema$1.optional(),
7155
7217
  skills: record(string(), discriminatedUnion("type", [
7156
7218
  object({
7157
7219
  type: literal("mcpStdioSkill"),
@@ -7726,6 +7788,19 @@ function createFilteredEventListener(listener, allowedTypes) {
7726
7788
  };
7727
7789
  }
7728
7790
 
7791
+ //#endregion
7792
+ //#region ../../packages/core/src/utils/truncate.ts
7793
+ const MAX_TOOL_OUTPUT_CHARS = 3e4;
7794
+ function truncateText(text, maxChars = MAX_TOOL_OUTPUT_CHARS) {
7795
+ if (text.length <= maxChars) return text;
7796
+ const marker = `\n\n... [truncated: ${text.length - maxChars} characters removed from middle of ${text.length} total] ...\n\n`;
7797
+ const available = maxChars - marker.length;
7798
+ if (available <= 0) return text.slice(0, maxChars);
7799
+ const head = Math.floor(available * .8);
7800
+ const tail = available - head;
7801
+ return text.slice(0, head) + marker + text.slice(text.length - tail);
7802
+ }
7803
+
7729
7804
  //#endregion
7730
7805
  //#region ../../packages/core/src/utils/zod-error.ts
7731
7806
  function formatZodError(error) {
@@ -7740,7 +7815,7 @@ function parseWithFriendlyError(schema, data, context) {
7740
7815
  }
7741
7816
 
7742
7817
  //#endregion
7743
- //#region ../../node_modules/.bun/@perstack+api-client@0.0.56+de2fe147d1f68d1d/node_modules/@perstack/api-client/dist/index.mjs
7818
+ //#region ../../node_modules/.bun/@perstack+api-client@0.0.57+de2fe147d1f68d1d/node_modules/@perstack/api-client/dist/index.mjs
7744
7819
  function createValidationError(error) {
7745
7820
  return {
7746
7821
  type: "validation",
@@ -8161,7 +8236,7 @@ const maxProviderHeaderKeyLength = 255;
8161
8236
  const maxProviderHeaderValueLength = 2048;
8162
8237
  const maxProviderHeadersCount = 50;
8163
8238
  const cuidSchema = string().cuid2();
8164
- string().min(24).cuid2();
8239
+ const cuidRequestSchema = string().min(24).cuid2();
8165
8240
  const runtimeVersionSchema = _enum(["v1.0"]);
8166
8241
  const providerSchema = _enum([
8167
8242
  "anthropic",
@@ -8324,12 +8399,12 @@ const applicationSchema = object({
8324
8399
  totalJobs: number$1().describe("Total number of jobs executed for this application").optional(),
8325
8400
  lastJobExecutionAt: string().datetime({ offset: true }).nullable().describe("Timestamp of the most recent job execution").optional()
8326
8401
  });
8327
- const request$21 = { body: object({
8402
+ const request$29 = { body: object({
8328
8403
  name: applicationNameSchema,
8329
8404
  applicationGroupId: cuidSchema.optional()
8330
8405
  }) };
8331
8406
  object({ data: object({ application: applicationSchema }) });
8332
- const request$20 = { query: object({
8407
+ const request$28 = { query: object({
8333
8408
  name: preprocess((val) => Array.isArray(val) ? val.join(",") : val, string().optional()),
8334
8409
  sort: _enum([
8335
8410
  "name",
@@ -8344,7 +8419,7 @@ object({
8344
8419
  data: object({ applications: array(applicationSchema) }),
8345
8420
  meta: paginationMeta
8346
8421
  });
8347
- const request$19 = {
8422
+ const request$27 = {
8348
8423
  params: object({ applicationId: cuidSchema }),
8349
8424
  body: object({
8350
8425
  name: applicationNameSchema.optional(),
@@ -8367,25 +8442,25 @@ object({
8367
8442
  createdAt: datetimeSchema,
8368
8443
  updatedAt: datetimeSchema
8369
8444
  });
8370
- const request$18 = { body: object({
8445
+ const request$26 = { body: object({
8371
8446
  applicationId: cuidSchema,
8372
8447
  name: secretNameSchema,
8373
8448
  value: secretValueSchema
8374
8449
  }) };
8375
8450
  object({ data: object({ secret: secretMetadataSchema }) });
8376
- const request$17 = {
8451
+ const request$25 = {
8377
8452
  params: object({ name: string().min(1) }),
8378
8453
  query: object({ applicationId: cuidSchema })
8379
8454
  };
8380
8455
  _null();
8381
- const request$16 = {
8456
+ const request$24 = {
8382
8457
  params: object({ name: string().min(1) }),
8383
8458
  query: object({ applicationId: cuidSchema })
8384
8459
  };
8385
8460
  object({ data: object({ secret: secretMetadataSchema }) });
8386
- const request$15 = { query: object({ applicationId: cuidSchema.optional() }) };
8461
+ const request$23 = { query: object({ applicationId: cuidSchema.optional() }) };
8387
8462
  object({ data: object({ secrets: array(secretMetadataSchema) }) });
8388
- const request$14 = {
8463
+ const request$22 = {
8389
8464
  params: object({ name: string().min(1) }),
8390
8465
  body: object({
8391
8466
  applicationId: cuidSchema,
@@ -8410,25 +8485,25 @@ const variableResponseSchema = object({
8410
8485
  createdAt: datetimeSchema,
8411
8486
  updatedAt: datetimeSchema
8412
8487
  });
8413
- const request$13 = { body: object({
8488
+ const request$21 = { body: object({
8414
8489
  applicationId: cuidSchema,
8415
8490
  name: variableNameSchema,
8416
8491
  value: variableValueSchema
8417
8492
  }) };
8418
8493
  object({ data: object({ variable: variableResponseSchema }) });
8419
- const request$12 = {
8494
+ const request$20 = {
8420
8495
  params: object({ name: string().min(1) }),
8421
8496
  query: object({ applicationId: cuidSchema })
8422
8497
  };
8423
8498
  _null();
8424
- const request$11 = {
8499
+ const request$19 = {
8425
8500
  params: object({ name: string().min(1) }),
8426
8501
  query: object({ applicationId: cuidSchema })
8427
8502
  };
8428
8503
  object({ data: object({ variable: variableResponseSchema }) });
8429
- const request$10 = { query: object({ applicationId: cuidSchema }) };
8504
+ const request$18 = { query: object({ applicationId: cuidSchema }) };
8430
8505
  object({ data: object({ variables: array(variableResponseSchema) }) });
8431
- const request$9 = {
8506
+ const request$17 = {
8432
8507
  params: object({ name: string().min(1) }),
8433
8508
  body: object({
8434
8509
  applicationId: cuidSchema,
@@ -8436,6 +8511,11 @@ const request$9 = {
8436
8511
  })
8437
8512
  };
8438
8513
  object({ data: object({ variable: variableResponseSchema }) });
8514
+ const request$16 = { query: object({
8515
+ scopeName: scopeNameSchema,
8516
+ applicationId: cuidRequestSchema
8517
+ }) };
8518
+ object({ data: object({ available: boolean$1() }) });
8439
8519
  const expertScopeSchema = object({
8440
8520
  id: cuidSchema,
8441
8521
  name: scopeNameSchema,
@@ -8468,6 +8548,49 @@ const expertVersionSchema = object({
8468
8548
  readmeUrl: string().optional()
8469
8549
  });
8470
8550
  expertScopeSchema.extend({ versions: array(expertVersionSchema) });
8551
+ const expertDraftScopeSchema = object({
8552
+ id: cuidSchema,
8553
+ name: scopeNameSchema,
8554
+ organizationId: cuidSchema,
8555
+ applicationId: cuidSchema,
8556
+ totalRuns: number$1().int().min(0),
8557
+ totalJobs: number$1().int().min(0),
8558
+ createdAt: datetimeSchema,
8559
+ updatedAt: datetimeSchema,
8560
+ createdBy: cuidSchema,
8561
+ updatedBy: cuidSchema
8562
+ });
8563
+ const expertDraftRefSchema = object({
8564
+ id: cuidSchema,
8565
+ expertDraftScopeId: cuidSchema,
8566
+ totalRuns: number$1().int().min(0),
8567
+ totalJobs: number$1().int().min(0),
8568
+ createdAt: datetimeSchema,
8569
+ updatedAt: datetimeSchema,
8570
+ createdBy: cuidSchema,
8571
+ updatedBy: cuidSchema
8572
+ });
8573
+ expertDraftScopeSchema.extend({ draftRefs: array(expertDraftRefSchema) }).extend({ scope: expertScopeSchema.nullable() });
8574
+ const expertDraftScopeForListSchema = expertDraftScopeSchema.extend({
8575
+ draftRefs: array(expertDraftRefSchema),
8576
+ scope: expertScopeSchema.nullable(),
8577
+ currentVersion: expertVersionSchema.nullable(),
8578
+ publicVersionCount: number$1().int().min(0)
8579
+ });
8580
+ const request$15 = { body: object({
8581
+ scopeName: scopeNameSchema,
8582
+ applicationId: cuidRequestSchema
8583
+ }) };
8584
+ object({ data: expertDraftScopeSchema });
8585
+ const request$14 = { query: object({
8586
+ filter: string().optional(),
8587
+ take: number().int().min(1).max(100).default(20),
8588
+ skip: number().int().min(0).default(0)
8589
+ }) };
8590
+ object({
8591
+ data: array(expertDraftScopeForListSchema),
8592
+ meta: paginationMeta
8593
+ });
8471
8594
  function isPrivateOrLocalIP(hostname) {
8472
8595
  if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1" || hostname === "0.0.0.0") return true;
8473
8596
  const ipv4Match = hostname.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/);
@@ -8535,6 +8658,11 @@ const skillSchema = discriminatedUnion("type", [
8535
8658
  mcpSseSkillSchema,
8536
8659
  interactiveSkillSchema
8537
8660
  ]);
8661
+ const modelTierSchema = _enum([
8662
+ "low",
8663
+ "middle",
8664
+ "high"
8665
+ ]);
8538
8666
  const expertSchema = object({
8539
8667
  key: expertKeyFieldSchema,
8540
8668
  name: expertNameFieldSchema,
@@ -8544,7 +8672,8 @@ const expertSchema = object({
8544
8672
  skills: record(skillNameSchema, skillSchema).optional().default({}),
8545
8673
  delegates: array(expertKeyFieldSchema).min(0).max(maxExpertDelegateItems).optional().default([]),
8546
8674
  tags: array(expertTagFieldSchema).min(0).max(maxExpertTagItems).optional().default([]),
8547
- minRuntimeVersion: runtimeVersionSchema.optional().default("v1.0")
8675
+ minRuntimeVersion: runtimeVersionSchema.optional().default("v1.0"),
8676
+ defaultModelTier: modelTierSchema.optional()
8548
8677
  });
8549
8678
  object({
8550
8679
  scope: expertScopeSchema,
@@ -8554,6 +8683,70 @@ const expertWithMetadataSchema = expertSchema.extend({
8554
8683
  scope: expertScopeSchema,
8555
8684
  version: expertVersionSchema
8556
8685
  });
8686
+ const expertDefinitionContentSchema = object({
8687
+ name: expertNameFieldSchema,
8688
+ version: literal("0.0.0-draft"),
8689
+ applicationId: cuidSchema,
8690
+ createdAt: datetimeSchema,
8691
+ updatedAt: datetimeSchema,
8692
+ createdBy: cuidSchema,
8693
+ updatedBy: cuidSchema,
8694
+ experts: record(expertKeyFieldSchema, expertSchema.omit({ key: true }))
8695
+ });
8696
+ const request$13 = {
8697
+ params: object({ draftId: cuidRequestSchema }),
8698
+ body: object({ experts: array(expertSchema) })
8699
+ };
8700
+ object({ data: object({
8701
+ scope: expertDraftScopeSchema,
8702
+ draftRef: expertDraftRefSchema,
8703
+ definition: expertDefinitionContentSchema
8704
+ }) });
8705
+ const request$12 = {
8706
+ params: object({ draftId: cuidRequestSchema }),
8707
+ query: object({
8708
+ take: number().int().min(1).max(100).default(20),
8709
+ skip: number().int().min(0).default(0)
8710
+ })
8711
+ };
8712
+ object({
8713
+ data: array(expertDraftRefSchema),
8714
+ meta: paginationMeta
8715
+ });
8716
+ const request$11 = {
8717
+ params: object({
8718
+ draftId: cuidRequestSchema,
8719
+ draftRefId: cuidRequestSchema
8720
+ }),
8721
+ body: object({ experts: array(expertSchema) })
8722
+ };
8723
+ object({ data: object({
8724
+ scope: expertDraftScopeSchema,
8725
+ draftRef: expertDraftRefSchema,
8726
+ definition: expertDefinitionContentSchema
8727
+ }) });
8728
+ const request$10 = {
8729
+ params: object({
8730
+ draftId: cuidRequestSchema,
8731
+ draftRefId: cuidRequestSchema
8732
+ }),
8733
+ body: object({
8734
+ version: string().min(1, "Version is required.").max(maxExpertVersionTagLength, "Version is too long.").regex(expertVersionRegex, "Invalid version format. (e.g. 1.0.0)"),
8735
+ tag: string().max(maxExpertVersionTagLength, "Tag is too long.").regex(tagNameRegex, "Invalid tag format. (e.g. latest)").optional(),
8736
+ readme: string().optional()
8737
+ })
8738
+ };
8739
+ object({ data: object({
8740
+ scope: expertScopeSchema,
8741
+ version: expertVersionSchema,
8742
+ definitionUrl: string(),
8743
+ readmeUrl: string().optional()
8744
+ }) });
8745
+ const request$9 = {
8746
+ params: object({ draftId: cuidRequestSchema }),
8747
+ body: object({ name: scopeNameSchema.optional() })
8748
+ };
8749
+ object({ data: expertDraftScopeSchema });
8557
8750
  const request$8 = { query: object({
8558
8751
  filter: string().describe("Filter by scope name (partial match)").optional(),
8559
8752
  category: expertCategoryFieldSchema.describe("Filter by category").optional(),
@@ -8755,7 +8948,6 @@ const jobStatusSchema = _enum([
8755
8948
  "completed",
8756
8949
  "requestInteractiveToolResult",
8757
8950
  "requestDelegateResult",
8758
- "exceededMaxSteps",
8759
8951
  "failed",
8760
8952
  "canceling",
8761
8953
  "canceled",
@@ -8782,7 +8974,6 @@ const jobBaseSchema = object({
8782
8974
  model: jobModelSchema,
8783
8975
  reasoningBudget: reasoningBudgetSchema,
8784
8976
  runtimeVersion: runtimeVersionSchema,
8785
- maxSteps: number$1().int().min(1),
8786
8977
  maxRetries: number$1().int().min(0),
8787
8978
  currentStep: number$1().int().min(0),
8788
8979
  totalSteps: number$1().int().min(0),
@@ -8806,7 +8997,6 @@ const request$7 = {
8806
8997
  provider: providerSchema.optional(),
8807
8998
  model: jobModelSchema.optional(),
8808
8999
  reasoningBudget: reasoningBudgetSchema.optional(),
8809
- maxSteps: number().optional(),
8810
9000
  maxRetries: number().optional()
8811
9001
  })
8812
9002
  };
@@ -8817,7 +9007,6 @@ const request$6 = { body: object({
8817
9007
  provider: providerSchema,
8818
9008
  model: jobModelSchema.optional(),
8819
9009
  reasoningBudget: reasoningBudgetSchema.optional(),
8820
- maxSteps: number().optional(),
8821
9010
  maxRetries: number().optional()
8822
9011
  }).extend({
8823
9012
  expertKey: expertKeyFieldSchema.optional(),
@@ -8849,14 +9038,6 @@ const delegationTargetSchema = object({
8849
9038
  toolName: string().min(1).max(maxSkillToolNameLength),
8850
9039
  query: string().min(1)
8851
9040
  });
8852
- /**
8853
- * API Checkpoint schema - extended checkpoint format for API responses.
8854
- * Includes additional fields computed from runtime checkpoint and step data:
8855
- * - activities: computed via getActivities() from @perstack/core
8856
- * - inputMessages, newMessages, toolCalls, toolResults: step-related data
8857
- * - expert: full Expert type (with instruction, skills, etc.)
8858
- * - startedAt/finishedAt: ISO string format (runtime uses Unix timestamps)
8859
- */
8860
9041
  const apiCheckpointSchema = object({
8861
9042
  type: literal("checkpoint"),
8862
9043
  id: cuidSchema,
@@ -8870,7 +9051,6 @@ const apiCheckpointSchema = object({
8870
9051
  "completed",
8871
9052
  "stoppedByInteractiveTool",
8872
9053
  "stoppedByDelegate",
8873
- "stoppedByExceededMaxSteps",
8874
9054
  "stoppedByError",
8875
9055
  "stoppedByCancellation"
8876
9056
  ]),
@@ -9087,7 +9267,7 @@ function createRunsApi(fetcher, basePath) {
9087
9267
  checkpoints: createRunCheckpointsApi(fetcher, basePath)
9088
9268
  };
9089
9269
  }
9090
- const BASE_PATH$6 = "/api/v1/jobs";
9270
+ const BASE_PATH$7 = "/api/v1/jobs";
9091
9271
  /**
9092
9272
  * Error thrown when stream ends abnormally.
9093
9273
  */
@@ -9122,26 +9302,26 @@ function createJobsApi(fetcher) {
9122
9302
  if (!result.success) return validationErrorResult(result.error);
9123
9303
  }
9124
9304
  const queryString = buildQueryString(params);
9125
- return fetcher.get(`${BASE_PATH$6}${queryString}`, options);
9305
+ return fetcher.get(`${BASE_PATH$7}${queryString}`, options);
9126
9306
  },
9127
9307
  async get(id, options) {
9128
- return fetcher.get(`${BASE_PATH$6}/${id}`, options);
9308
+ return fetcher.get(`${BASE_PATH$7}/${id}`, options);
9129
9309
  },
9130
9310
  async start(input, options) {
9131
9311
  const result = request$6.body.safeParse(input);
9132
9312
  if (!result.success) return validationErrorResult(result.error);
9133
- return fetcher.post(BASE_PATH$6, input, options);
9313
+ return fetcher.post(BASE_PATH$7, input, options);
9134
9314
  },
9135
9315
  async continue(id, input, options) {
9136
9316
  const result = request$7.body.safeParse(input);
9137
9317
  if (!result.success) return validationErrorResult(result.error);
9138
- return fetcher.post(`${BASE_PATH$6}/${id}/continue`, input, options);
9318
+ return fetcher.post(`${BASE_PATH$7}/${id}/continue`, input, options);
9139
9319
  },
9140
9320
  async cancel(id, options) {
9141
- return fetcher.post(`${BASE_PATH$6}/${id}/cancel`, {}, options);
9321
+ return fetcher.post(`${BASE_PATH$7}/${id}/cancel`, {}, options);
9142
9322
  },
9143
9323
  async stream(id, options) {
9144
- const result = await fetcher.getStream(`${BASE_PATH$6}/${id}/stream`, options);
9324
+ const result = await fetcher.getStream(`${BASE_PATH$7}/${id}/stream`, options);
9145
9325
  if (!result.ok) return result;
9146
9326
  async function* createEventGenerator(reader) {
9147
9327
  try {
@@ -9162,109 +9342,109 @@ function createJobsApi(fetcher) {
9162
9342
  data: { events: createEventGenerator(reader) }
9163
9343
  };
9164
9344
  },
9165
- runs: createRunsApi(fetcher, BASE_PATH$6)
9345
+ runs: createRunsApi(fetcher, BASE_PATH$7)
9166
9346
  };
9167
9347
  }
9168
- const BASE_PATH$5 = "/api/v1/applications";
9348
+ const BASE_PATH$6 = "/api/v1/applications";
9169
9349
  function createApplicationsApi(fetcher) {
9170
9350
  return {
9171
9351
  async list(params, options) {
9172
9352
  if (params) {
9173
- const result = request$20.query.safeParse(params);
9353
+ const result = request$28.query.safeParse(params);
9174
9354
  if (!result.success) return validationErrorResult(result.error);
9175
9355
  }
9176
9356
  const queryString = buildQueryString(params);
9177
- return fetcher.get(`${BASE_PATH$5}${queryString}`, options);
9357
+ return fetcher.get(`${BASE_PATH$6}${queryString}`, options);
9178
9358
  },
9179
9359
  async get(id, options) {
9180
- return fetcher.get(`${BASE_PATH$5}/${id}`, options);
9360
+ return fetcher.get(`${BASE_PATH$6}/${id}`, options);
9181
9361
  },
9182
9362
  async create(input, options) {
9183
- const result = request$21.body.safeParse(input);
9363
+ const result = request$29.body.safeParse(input);
9184
9364
  if (!result.success) return validationErrorResult(result.error);
9185
- return fetcher.post(BASE_PATH$5, input, options);
9365
+ return fetcher.post(BASE_PATH$6, input, options);
9186
9366
  },
9187
9367
  async update(id, input, options) {
9188
- const result = request$19.body.safeParse(input);
9368
+ const result = request$27.body.safeParse(input);
9189
9369
  if (!result.success) return validationErrorResult(result.error);
9190
- return fetcher.post(`${BASE_PATH$5}/${id}`, input, options);
9370
+ return fetcher.post(`${BASE_PATH$6}/${id}`, input, options);
9191
9371
  },
9192
9372
  async delete(id, options) {
9193
- return fetcher.delete(`${BASE_PATH$5}/${id}`, options);
9373
+ return fetcher.delete(`${BASE_PATH$6}/${id}`, options);
9194
9374
  }
9195
9375
  };
9196
9376
  }
9197
- const BASE_PATH$4 = "/api/v1/env/secrets";
9377
+ const BASE_PATH$5 = "/api/v1/env/secrets";
9198
9378
  function createSecretsApi(fetcher) {
9199
9379
  return {
9200
9380
  async list(params, options) {
9201
9381
  if (params) {
9202
- const result = request$15.query.safeParse(params);
9382
+ const result = request$23.query.safeParse(params);
9203
9383
  if (!result.success) return validationErrorResult(result.error);
9204
9384
  }
9205
9385
  const queryString = buildQueryString(params);
9206
- return fetcher.get(`${BASE_PATH$4}${queryString}`, options);
9386
+ return fetcher.get(`${BASE_PATH$5}${queryString}`, options);
9207
9387
  },
9208
9388
  async get(name, params, options) {
9209
- const result = request$16.query.safeParse(params);
9389
+ const result = request$24.query.safeParse(params);
9210
9390
  if (!result.success) return validationErrorResult(result.error);
9211
9391
  const encodedName = encodeURIComponent(name);
9212
9392
  const queryString = buildQueryString(params);
9213
- return fetcher.get(`${BASE_PATH$4}/${encodedName}${queryString}`, options);
9393
+ return fetcher.get(`${BASE_PATH$5}/${encodedName}${queryString}`, options);
9214
9394
  },
9215
9395
  async create(input, options) {
9216
- const result = request$18.body.safeParse(input);
9396
+ const result = request$26.body.safeParse(input);
9217
9397
  if (!result.success) return validationErrorResult(result.error);
9218
- return fetcher.post(BASE_PATH$4, input, options);
9398
+ return fetcher.post(BASE_PATH$5, input, options);
9219
9399
  },
9220
9400
  async update(name, input, options) {
9221
- const result = request$14.body.safeParse(input);
9401
+ const result = request$22.body.safeParse(input);
9222
9402
  if (!result.success) return validationErrorResult(result.error);
9223
9403
  const encodedName = encodeURIComponent(name);
9224
- return fetcher.post(`${BASE_PATH$4}/${encodedName}`, input, options);
9404
+ return fetcher.post(`${BASE_PATH$5}/${encodedName}`, input, options);
9225
9405
  },
9226
9406
  async delete(name, params, options) {
9227
- const result = request$17.query.safeParse(params);
9407
+ const result = request$25.query.safeParse(params);
9228
9408
  if (!result.success) return validationErrorResult(result.error);
9229
9409
  const encodedName = encodeURIComponent(name);
9230
9410
  const queryString = buildQueryString(params);
9231
- return fetcher.deleteNoContent(`${BASE_PATH$4}/${encodedName}${queryString}`, options);
9411
+ return fetcher.deleteNoContent(`${BASE_PATH$5}/${encodedName}${queryString}`, options);
9232
9412
  }
9233
9413
  };
9234
9414
  }
9235
- const BASE_PATH$3 = "/api/v1/env/variables";
9415
+ const BASE_PATH$4 = "/api/v1/env/variables";
9236
9416
  function createVariablesApi(fetcher) {
9237
9417
  return {
9238
9418
  async list(params, options) {
9239
- const result = request$10.query.safeParse(params);
9419
+ const result = request$18.query.safeParse(params);
9240
9420
  if (!result.success) return validationErrorResult(result.error);
9241
9421
  const queryString = buildQueryString(params);
9242
- return fetcher.get(`${BASE_PATH$3}${queryString}`, options);
9422
+ return fetcher.get(`${BASE_PATH$4}${queryString}`, options);
9243
9423
  },
9244
9424
  async get(name, params, options) {
9245
- const result = request$11.query.safeParse(params);
9425
+ const result = request$19.query.safeParse(params);
9246
9426
  if (!result.success) return validationErrorResult(result.error);
9247
9427
  const encodedName = encodeURIComponent(name);
9248
9428
  const queryString = buildQueryString(params);
9249
- return fetcher.get(`${BASE_PATH$3}/${encodedName}${queryString}`, options);
9429
+ return fetcher.get(`${BASE_PATH$4}/${encodedName}${queryString}`, options);
9250
9430
  },
9251
9431
  async create(input, options) {
9252
- const result = request$13.body.safeParse(input);
9432
+ const result = request$21.body.safeParse(input);
9253
9433
  if (!result.success) return validationErrorResult(result.error);
9254
- return fetcher.post(BASE_PATH$3, input, options);
9434
+ return fetcher.post(BASE_PATH$4, input, options);
9255
9435
  },
9256
9436
  async update(name, input, options) {
9257
- const result = request$9.body.safeParse(input);
9437
+ const result = request$17.body.safeParse(input);
9258
9438
  if (!result.success) return validationErrorResult(result.error);
9259
9439
  const encodedName = encodeURIComponent(name);
9260
- return fetcher.post(`${BASE_PATH$3}/${encodedName}`, input, options);
9440
+ return fetcher.post(`${BASE_PATH$4}/${encodedName}`, input, options);
9261
9441
  },
9262
9442
  async delete(name, params, options) {
9263
- const result = request$12.query.safeParse(params);
9443
+ const result = request$20.query.safeParse(params);
9264
9444
  if (!result.success) return validationErrorResult(result.error);
9265
9445
  const encodedName = encodeURIComponent(name);
9266
9446
  const queryString = buildQueryString(params);
9267
- return fetcher.deleteNoContent(`${BASE_PATH$3}/${encodedName}${queryString}`, options);
9447
+ return fetcher.deleteNoContent(`${BASE_PATH$4}/${encodedName}${queryString}`, options);
9268
9448
  }
9269
9449
  };
9270
9450
  }
@@ -9274,6 +9454,88 @@ function createEnvApi(fetcher) {
9274
9454
  variables: createVariablesApi(fetcher)
9275
9455
  };
9276
9456
  }
9457
+ const BASE_PATH$3 = "/api/v1/expert_drafts";
9458
+ function createExpertDraftRefsApi(fetcher) {
9459
+ return {
9460
+ async list(draftId, params, options) {
9461
+ if (params) {
9462
+ const result = request$12.query.safeParse(params);
9463
+ if (!result.success) return validationErrorResult(result.error);
9464
+ }
9465
+ const encodedDraftId = encodeURIComponent(draftId);
9466
+ const queryString = buildQueryString(params);
9467
+ return fetcher.get(`${BASE_PATH$3}/${encodedDraftId}/refs${queryString}`, options);
9468
+ },
9469
+ async get(draftId, draftRefId, options) {
9470
+ const encodedDraftId = encodeURIComponent(draftId);
9471
+ const encodedDraftRefId = encodeURIComponent(draftRefId);
9472
+ return fetcher.get(`${BASE_PATH$3}/${encodedDraftId}/refs/${encodedDraftRefId}`, options);
9473
+ },
9474
+ async create(draftId, input, options) {
9475
+ const result = request$13.body.safeParse(input);
9476
+ if (!result.success) return validationErrorResult(result.error);
9477
+ const encodedDraftId = encodeURIComponent(draftId);
9478
+ return fetcher.post(`${BASE_PATH$3}/${encodedDraftId}/refs`, input, options);
9479
+ },
9480
+ async update(draftId, draftRefId, input, options) {
9481
+ const result = request$11.body.safeParse(input);
9482
+ if (!result.success) return validationErrorResult(result.error);
9483
+ const encodedDraftId = encodeURIComponent(draftId);
9484
+ const encodedDraftRefId = encodeURIComponent(draftRefId);
9485
+ return fetcher.post(`${BASE_PATH$3}/${encodedDraftId}/refs/${encodedDraftRefId}`, input, options);
9486
+ },
9487
+ async delete(draftId, draftRefId, options) {
9488
+ const encodedDraftId = encodeURIComponent(draftId);
9489
+ const encodedDraftRefId = encodeURIComponent(draftRefId);
9490
+ return fetcher.delete(`${BASE_PATH$3}/${encodedDraftId}/refs/${encodedDraftRefId}`, options);
9491
+ },
9492
+ async assignVersion(draftId, draftRefId, input, options) {
9493
+ const result = request$10.body.safeParse(input);
9494
+ if (!result.success) return validationErrorResult(result.error);
9495
+ const encodedDraftId = encodeURIComponent(draftId);
9496
+ const encodedDraftRefId = encodeURIComponent(draftRefId);
9497
+ return fetcher.post(`${BASE_PATH$3}/${encodedDraftId}/refs/${encodedDraftRefId}/version`, input, options);
9498
+ }
9499
+ };
9500
+ }
9501
+ function createExpertDraftsApi(fetcher) {
9502
+ return {
9503
+ async list(params, options) {
9504
+ if (params) {
9505
+ const result = request$14.query.safeParse(params);
9506
+ if (!result.success) return validationErrorResult(result.error);
9507
+ }
9508
+ const queryString = buildQueryString(params);
9509
+ return fetcher.get(`${BASE_PATH$3}${queryString}`, options);
9510
+ },
9511
+ async get(draftId, options) {
9512
+ const encodedDraftId = encodeURIComponent(draftId);
9513
+ return fetcher.get(`${BASE_PATH$3}/${encodedDraftId}`, options);
9514
+ },
9515
+ async checkName(params, options) {
9516
+ const result = request$16.query.safeParse(params);
9517
+ if (!result.success) return validationErrorResult(result.error);
9518
+ const queryString = buildQueryString(params);
9519
+ return fetcher.get(`${BASE_PATH$3}/check_name${queryString}`, options);
9520
+ },
9521
+ async create(input, options) {
9522
+ const result = request$15.body.safeParse(input);
9523
+ if (!result.success) return validationErrorResult(result.error);
9524
+ return fetcher.post(BASE_PATH$3, input, options);
9525
+ },
9526
+ async update(draftId, input, options) {
9527
+ const result = request$9.body.safeParse(input);
9528
+ if (!result.success) return validationErrorResult(result.error);
9529
+ const encodedDraftId = encodeURIComponent(draftId);
9530
+ return fetcher.post(`${BASE_PATH$3}/${encodedDraftId}`, input, options);
9531
+ },
9532
+ async delete(draftId, options) {
9533
+ const encodedDraftId = encodeURIComponent(draftId);
9534
+ return fetcher.delete(`${BASE_PATH$3}/${encodedDraftId}`, options);
9535
+ },
9536
+ refs: createExpertDraftRefsApi(fetcher)
9537
+ };
9538
+ }
9277
9539
  function createVersionsApi(fetcher, basePath) {
9278
9540
  return { async list(scopeName, options) {
9279
9541
  const encodedScopeName = encodeURIComponent(scopeName);
@@ -9370,13 +9632,14 @@ function createApiClient(config) {
9370
9632
  return {
9371
9633
  applications: createApplicationsApi(fetcher),
9372
9634
  env: createEnvApi(fetcher),
9373
- jobs: createJobsApi(fetcher),
9635
+ expertDrafts: createExpertDraftsApi(fetcher),
9374
9636
  experts: createExpertsApi(fetcher),
9637
+ jobs: createJobsApi(fetcher),
9375
9638
  organizations: createOrganizationsApi(fetcher),
9376
9639
  providerSettings: createProviderSettingsApi(fetcher)
9377
9640
  };
9378
9641
  }
9379
9642
 
9380
9643
  //#endregion
9381
- export { never as $, startCommandInputSchema as A, defaultPerstackApiBaseUrl as At, ZodOptional as B, skipDelegates as C, defineLazy as Ct, stopRunByError as D, knownModels as Dt, stopRunByDelegate as E, NEVER as Et, isCoordinatorExpert as F, array as G, _instanceof as H, validateDelegation as I, discriminatedUnion as J, boolean$1 as K, checkpointSchema as L, lockfileSchema as M, createId as Mt, jobSchema$1 as N, stopRunByInteractiveTool as O, PerstackError as Ot, expertSchema$1 as P, looseObject as Q, number as R, runSettingSchema as S, clone as St, startRun as T, $constructor as Tt, _null as U, _enum as V, any as W, lazy as X, intersection as Y, literal as Z, proceedToInteractiveTools as _, $ZodType as _t, getFilteredEnv as a, strictObject as at, retry as b, safeParse$1 as bt, createGeneralToolActivity as c, union as ct, continueToNextStep as d, safeParseAsync as dt, number$1 as et, createRuntimeEvent as f, datetime as ft, parseExpertKey as g, $ZodObject as gt, finishToolCall as h, meta$1 as ht, validateEventFilter as i, record as it, perstackConfigSchema as j, defaultTimeout as jt, runCommandInputSchema as k, defaultMaxRetries as kt, callTools as l, unknown as lt, finishMcpTools as m, describe$1 as mt, parseWithFriendlyError as n, optional as nt, BASE_SKILL_PREFIX as o, string as ot, createStreamingEvent as p, toJSONSchema as pt, custom as q, createFilteredEventListener as r, preprocess as rt, createBaseToolActivity as s, tuple as st, createApiClient as t, object as tt, completeRun as u, url as ut, resolveToolResults as v, parse$1 as vt, startGeneration as w, normalizeParams as wt, runParamsSchema as x, safeParseAsync$1 as xt, resumeFromStop as y, parseAsync$1 as yt, ZodIssueCode as z };
9382
- //# sourceMappingURL=dist-HjVmXsKn.js.map
9644
+ export { lazy as $, runCommandInputSchema as A, PerstackError as At, resolveModelTier as B, runSettingSchema as C, safeParse$1 as Ct, stopRunByDelegate as D, normalizeParams as Dt, startRun as E, defineLazy as Et, expertSchema$1 as F, _instanceof as G, ZodIssueCode as H, isCoordinatorExpert as I, array as J, _null as K, validateDelegation as L, perstackConfigSchema as M, defaultPerstackApiBaseUrl as Mt, lockfileSchema as N, defaultTimeout as Nt, stopRunByError as O, $constructor as Ot, jobSchema$1 as P, createId as Pt, intersection as Q, checkpointSchema as R, runParamsSchema as S, parseAsync$1 as St, startGeneration as T, clone as Tt, ZodOptional as U, number as V, _enum as W, custom as X, boolean$1 as Y, discriminatedUnion as Z, parseExpertKey as _, describe$1 as _t, validateEventFilter as a, optional as at, resumeFromStop as b, $ZodType as bt, createBaseToolActivity as c, strictObject as ct, completeRun as d, union as dt, literal as et, continueToNextStep as f, unknown as ft, finishToolCall as g, toJSONSchema as gt, finishMcpTools as h, datetime as ht, createFilteredEventListener as i, object as it, startCommandInputSchema as j, defaultMaxRetries as jt, stopRunByInteractiveTool as k, NEVER as kt, createGeneralToolActivity as l, string as lt, createStreamingEvent as m, safeParseAsync as mt, parseWithFriendlyError as n, never as nt, getFilteredEnv as o, preprocess as ot, createRuntimeEvent as p, url as pt, any as q, truncateText as r, number$1 as rt, BASE_SKILL_PREFIX as s, record as st, createApiClient as t, looseObject as tt, callTools as u, tuple as ut, proceedToInteractiveTools as v, meta$1 as vt, skipDelegates as w, safeParseAsync$1 as wt, retry as x, parse$1 as xt, resolveToolResults as y, $ZodObject as yt, knownModels as z };
9645
+ //# sourceMappingURL=dist-Bm8UQoRz.js.map