@wayai/cli 0.3.247 → 0.3.248

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4888,6 +4888,208 @@ var init_fs_safety = __esm({
4888
4888
  }
4889
4889
  });
4890
4890
 
4891
+ // ../../packages/core/dist/chunk-HZ6CADSY.js
4892
+ function optionalTrimmedText(max) {
4893
+ return external_exports.string().trim().max(max).optional().transform((value) => value ? value : void 0);
4894
+ }
4895
+ function jsonLengthOrNull(value) {
4896
+ try {
4897
+ const json = JSON.stringify(value);
4898
+ return typeof json === "string" ? json.length : null;
4899
+ } catch {
4900
+ return null;
4901
+ }
4902
+ }
4903
+ function withinJsonLength(value, max) {
4904
+ const length = jsonLengthOrNull(value);
4905
+ return length !== null && length <= max;
4906
+ }
4907
+ function isAudioAttachmentFileName(fileName) {
4908
+ return /\.(mp3|ogg|oga|wav|m4a|webm)$/i.test(fileName);
4909
+ }
4910
+ var uuidSchema, USER_ID_REGEX, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MESSAGE_ENVELOPE_HEADROOM_BYTES, MAX_AUDIO_FILE_BASE64_BYTES;
4911
+ var init_chunk_HZ6CADSY = __esm({
4912
+ "../../packages/core/dist/chunk-HZ6CADSY.js"() {
4913
+ "use strict";
4914
+ init_zod();
4915
+ uuidSchema = external_exports.string().uuid();
4916
+ USER_ID_REGEX = /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|user_[A-Za-z0-9]+)$/i;
4917
+ timestampSchema = external_exports.string().datetime();
4918
+ idParamSchema = external_exports.object({
4919
+ id: uuidSchema
4920
+ });
4921
+ clientOptionalString = external_exports.string().nullish().transform((v) => v ?? void 0);
4922
+ clientOptionalBoolean = external_exports.boolean().nullish().transform((v) => v ?? void 0);
4923
+ clientOptionalNumber = external_exports.number().nullish().transform((v) => v ?? void 0);
4924
+ messageAttachment = external_exports.object({
4925
+ /**
4926
+ * Capped at the same 255 the storage layer already truncates names to, so nothing
4927
+ * legitimate is lost — every filesystem caps there, and `sanitizeFileName` sliced
4928
+ * longer names anyway.
4929
+ *
4930
+ * The bound is load-bearing, not hygiene: the RAW name is written to R2
4931
+ * `customMetadata.originalFileName`, and R2 rejects oversized metadata. An unbounded
4932
+ * name let a client make the R2 write throw a generic storage error — indistinguishable
4933
+ * from a real outage — which pages us via `logger.error` and, on the app channel, is
4934
+ * read as "we lost the file" and escalates the user to a human. Client input must not
4935
+ * be able to impersonate an infrastructure failure (gh #3365).
4936
+ */
4937
+ file_name: external_exports.string().max(255),
4938
+ /** Base64. Bounded by the route's bodyLimit, not by this schema. */
4939
+ file_binary: external_exports.string(),
4940
+ file_size: clientOptionalNumber,
4941
+ file_extension: clientOptionalString
4942
+ });
4943
+ MAX_MESSAGE_BODY_BYTES = 10 * 1024 * 1024;
4944
+ MAX_ATTACHMENTS_PER_MESSAGE = 20;
4945
+ MESSAGE_ENVELOPE_HEADROOM_BYTES = 64 * 1024;
4946
+ MAX_AUDIO_FILE_BASE64_BYTES = 8 * 1024 * 1024;
4947
+ }
4948
+ });
4949
+
4950
+ // ../../packages/core/dist/chunk-RACEDHG6.js
4951
+ var resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery;
4952
+ var init_chunk_RACEDHG6 = __esm({
4953
+ "../../packages/core/dist/chunk-RACEDHG6.js"() {
4954
+ "use strict";
4955
+ init_chunk_HZ6CADSY();
4956
+ init_zod();
4957
+ resourceIdParam = external_exports.object({ id: uuidSchema });
4958
+ listResourcesQuery = external_exports.object({
4959
+ hub_id: uuidSchema,
4960
+ enabled: external_exports.enum(["true", "false"]).optional(),
4961
+ search: external_exports.string().optional(),
4962
+ limit: external_exports.string().regex(/^\d+$/).optional(),
4963
+ offset: external_exports.string().regex(/^\d+$/).optional()
4964
+ });
4965
+ createResourceBody = external_exports.object({
4966
+ hub_id: uuidSchema,
4967
+ resource_name: external_exports.string().min(1),
4968
+ resource_description: external_exports.string().optional(),
4969
+ enabled: external_exports.boolean().optional(),
4970
+ skill_name: external_exports.string().optional(),
4971
+ skill_version: external_exports.string().optional()
4972
+ });
4973
+ updateResourceBody = external_exports.object({
4974
+ resource_name: external_exports.string().min(1).optional(),
4975
+ resource_description: external_exports.string().optional(),
4976
+ enabled: external_exports.boolean().optional(),
4977
+ skill_name: external_exports.string().optional(),
4978
+ skill_version: external_exports.string().optional()
4979
+ // No `anthropic_skill_id`/`anthropic_version`: `resource` has neither column.
4980
+ // The provider link lives on `resource_provider_sync.provider_skill_id`,
4981
+ // written by `skillSync.ts` — never through this body.
4982
+ });
4983
+ syncSkillsBody = external_exports.object({
4984
+ hub_id: uuidSchema,
4985
+ connection_id: uuidSchema.optional()
4986
+ });
4987
+ resourceFileIdParam = external_exports.object({ id: uuidSchema });
4988
+ listResourceFilesQuery = external_exports.object({
4989
+ hub_id: uuidSchema,
4990
+ resource_id: uuidSchema.optional(),
4991
+ folder_id: external_exports.string().optional(),
4992
+ // 'null' for root, UUID for specific folder
4993
+ search: external_exports.string().optional(),
4994
+ tags: external_exports.string().optional(),
4995
+ // comma-separated
4996
+ enabled: external_exports.enum(["true", "false"]).optional(),
4997
+ limit: external_exports.string().regex(/^\d+$/).optional(),
4998
+ offset: external_exports.string().regex(/^\d+$/).optional(),
4999
+ include_root_files: external_exports.enum(["true", "false"]).optional()
5000
+ });
5001
+ createResourceFileBody = external_exports.object({
5002
+ hub_id: uuidSchema,
5003
+ resource_id: uuidSchema,
5004
+ file_id: uuidSchema,
5005
+ folder_id: uuidSchema.nullable().optional(),
5006
+ resource_file_title: external_exports.string().optional(),
5007
+ resource_file_tags: external_exports.array(external_exports.string()).optional(),
5008
+ order_index: external_exports.number().optional(),
5009
+ enabled: external_exports.boolean().optional(),
5010
+ metadata: external_exports.record(external_exports.unknown()).optional()
5011
+ });
5012
+ updateResourceFileBody = external_exports.object({
5013
+ resource_file_title: external_exports.string().optional(),
5014
+ resource_file_tags: external_exports.array(external_exports.string()).optional(),
5015
+ folder_id: uuidSchema.nullable().optional(),
5016
+ order_index: external_exports.number().optional(),
5017
+ enabled: external_exports.boolean().optional(),
5018
+ metadata: external_exports.record(external_exports.unknown()).optional()
5019
+ });
5020
+ uploadResourceFileBody = external_exports.object({
5021
+ hub_id: uuidSchema,
5022
+ resource_id: uuidSchema,
5023
+ folder_id: uuidSchema.nullable().optional(),
5024
+ file_name: external_exports.string().min(1),
5025
+ file_data: external_exports.string().min(1),
5026
+ mime_type: external_exports.string().optional(),
5027
+ file_size: external_exports.number().optional(),
5028
+ tags: external_exports.array(external_exports.string()).optional()
5029
+ });
5030
+ uploadSkillZipBody = external_exports.object({
5031
+ hub_id: uuidSchema,
5032
+ resource_id: uuidSchema,
5033
+ zip_data: external_exports.string().min(1),
5034
+ replace_existing: external_exports.boolean().optional()
5035
+ });
5036
+ resourceFolderIdParam = external_exports.object({ id: uuidSchema });
5037
+ listResourceFoldersQuery = external_exports.object({
5038
+ hub_id: uuidSchema,
5039
+ resource_id: uuidSchema,
5040
+ parent_folder_id: external_exports.string().optional(),
5041
+ // 'null' for root folders
5042
+ enabled: external_exports.enum(["true", "false"]).optional()
5043
+ });
5044
+ createResourceFolderBody = external_exports.object({
5045
+ hub_id: uuidSchema,
5046
+ resource_id: uuidSchema,
5047
+ folder_name: external_exports.string().min(1),
5048
+ folder_description: external_exports.string().optional(),
5049
+ parent_folder_id: uuidSchema.nullable().optional(),
5050
+ order_index: external_exports.number().optional(),
5051
+ enabled: external_exports.boolean().optional(),
5052
+ metadata: external_exports.record(external_exports.unknown()).optional()
5053
+ });
5054
+ updateResourceFolderBody = external_exports.object({
5055
+ folder_name: external_exports.string().min(1).optional(),
5056
+ folder_description: external_exports.string().optional(),
5057
+ parent_folder_id: uuidSchema.nullable().optional(),
5058
+ order_index: external_exports.number().optional(),
5059
+ enabled: external_exports.boolean().optional(),
5060
+ metadata: external_exports.record(external_exports.unknown()).optional()
5061
+ });
5062
+ agentResourceQuery = external_exports.object({
5063
+ hub_id: uuidSchema,
5064
+ agent_id: uuidSchema.optional(),
5065
+ resource_id: uuidSchema.optional()
5066
+ }).refine((data) => data.agent_id || data.resource_id, {
5067
+ message: "Either agent_id or resource_id is required"
5068
+ });
5069
+ hubResourceQuery = external_exports.object({ hub_id: uuidSchema });
5070
+ linkAgentResourceBody = external_exports.object({
5071
+ hub_id: uuidSchema,
5072
+ resource_id: uuidSchema,
5073
+ agent_id: uuidSchema,
5074
+ priority: external_exports.number().optional(),
5075
+ use_native_integration: external_exports.boolean().optional()
5076
+ });
5077
+ updateAgentResourceBody = external_exports.object({
5078
+ hub_id: uuidSchema,
5079
+ resource_id: uuidSchema,
5080
+ agent_id: uuidSchema,
5081
+ use_native_integration: external_exports.boolean().optional(),
5082
+ enabled: external_exports.boolean().optional(),
5083
+ priority: external_exports.number().optional()
5084
+ });
5085
+ unlinkAgentResourceQuery = external_exports.object({
5086
+ hub_id: uuidSchema,
5087
+ resource_id: uuidSchema,
5088
+ agent_id: uuidSchema
5089
+ });
5090
+ }
5091
+ });
5092
+
4891
5093
  // ../../packages/core/dist/chunk-Q7KIQHAZ.js
4892
5094
  var initialValueCreateSchema, initialValueUpdateSchema, stateIdParam, listStatesQuery, stateNameSchema, createStateBody, updateStateBody, reorderStatesBody;
4893
5095
  var init_chunk_Q7KIQHAZ = __esm({
@@ -4967,14 +5169,44 @@ var init_chunk_NKLVUTFO = __esm({
4967
5169
  }
4968
5170
  });
4969
5171
 
4970
- // ../../packages/core/dist/chunk-WNLWNFHH.js
5172
+ // ../../packages/core/dist/chunk-MIWZOSPI.js
5173
+ function toIso(epochMs) {
5174
+ return new Date(epochMs).toISOString();
5175
+ }
5176
+ function fromIso(iso) {
5177
+ return new Date(iso).getTime();
5178
+ }
5179
+ function isIsoTimestamp(value) {
5180
+ return typeof value === "string" && ISO_UTC_RE.test(value);
5181
+ }
5182
+ var ISO_UTC_RE;
5183
+ var init_chunk_MIWZOSPI = __esm({
5184
+ "../../packages/core/dist/chunk-MIWZOSPI.js"() {
5185
+ "use strict";
5186
+ ISO_UTC_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
5187
+ }
5188
+ });
5189
+
5190
+ // ../../packages/core/dist/chunk-MF2VVXBR.js
5191
+ var credentialExpiresAtSchema, LINKED_EXPIRY_REFUSAL;
5192
+ var init_chunk_MF2VVXBR = __esm({
5193
+ "../../packages/core/dist/chunk-MF2VVXBR.js"() {
5194
+ "use strict";
5195
+ init_chunk_HZ6CADSY();
5196
+ init_chunk_MIWZOSPI();
5197
+ credentialExpiresAtSchema = timestampSchema.refine(isIsoTimestamp, "Expected a canonical ISO timestamp").nullable();
5198
+ LINKED_EXPIRY_REFUSAL = "A linked organization credential's expiry is set on the credential";
5199
+ }
5200
+ });
5201
+
5202
+ // ../../packages/core/dist/chunk-PTYXZZTE.js
4971
5203
  function normalizeAuthType(raw) {
4972
5204
  if (VALID_AUTH_TYPES.has(raw)) return raw;
4973
5205
  return LEGACY_AUTH_TYPE_MAP[raw] ?? raw;
4974
5206
  }
4975
5207
  var AUTH_TYPE, ORG_CREDENTIAL_AUTH_TYPES, AUTH_TYPE_DISPLAY, LEGACY_AUTH_TYPE_MAP, VALID_AUTH_TYPES, AGENT_ROLES, PILOT_TRACK_ROLES, COPILOT_TRACK_ROLES, CUSTOMER_FACING_AGENT_ROLES, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SKILL_INSTALL_COMMAND;
4976
- var init_chunk_WNLWNFHH = __esm({
4977
- "../../packages/core/dist/chunk-WNLWNFHH.js"() {
5208
+ var init_chunk_PTYXZZTE = __esm({
5209
+ "../../packages/core/dist/chunk-PTYXZZTE.js"() {
4978
5210
  "use strict";
4979
5211
  AUTH_TYPE = {
4980
5212
  OAUTH: "oauth",
@@ -5028,12 +5260,13 @@ var init_chunk_WNLWNFHH = __esm({
5028
5260
  }
5029
5261
  });
5030
5262
 
5031
- // ../../packages/core/dist/chunk-GLJSJX5R.js
5263
+ // ../../packages/core/dist/chunk-ILW3RFGU.js
5032
5264
  var orgCredentialIdParam, listOrgCredentialsQuery, createOrgCredentialBody, updateOrgCredentialBody;
5033
- var init_chunk_GLJSJX5R = __esm({
5034
- "../../packages/core/dist/chunk-GLJSJX5R.js"() {
5265
+ var init_chunk_ILW3RFGU = __esm({
5266
+ "../../packages/core/dist/chunk-ILW3RFGU.js"() {
5035
5267
  "use strict";
5036
- init_chunk_WNLWNFHH();
5268
+ init_chunk_MF2VVXBR();
5269
+ init_chunk_PTYXZZTE();
5037
5270
  init_zod();
5038
5271
  orgCredentialIdParam = external_exports.object({
5039
5272
  id: external_exports.string().uuid()
@@ -5054,7 +5287,8 @@ var init_chunk_GLJSJX5R = __esm({
5054
5287
  username: external_exports.string().optional(),
5055
5288
  password: external_exports.string().optional(),
5056
5289
  tags: external_exports.array(external_exports.string().uuid()).optional(),
5057
- environment: external_exports.enum(["preview", "production", "all"]).optional()
5290
+ environment: external_exports.enum(["preview", "production", "all"]).optional(),
5291
+ expires_at: credentialExpiresAtSchema.optional()
5058
5292
  });
5059
5293
  updateOrgCredentialBody = external_exports.object({
5060
5294
  credential_display_name: external_exports.string().min(1).max(255).optional(),
@@ -5064,7 +5298,9 @@ var init_chunk_GLJSJX5R = __esm({
5064
5298
  username: external_exports.string().optional(),
5065
5299
  password: external_exports.string().optional(),
5066
5300
  tags: external_exports.array(external_exports.string().uuid()).optional(),
5067
- environment: external_exports.enum(["preview", "production", "all"]).optional()
5301
+ environment: external_exports.enum(["preview", "production", "all"]).optional(),
5302
+ // Absent keeps the stored date, unless the request stores a new secret, which clears it.
5303
+ expires_at: credentialExpiresAtSchema.optional()
5068
5304
  });
5069
5305
  }
5070
5306
  });
@@ -5194,208 +5430,6 @@ var init_chunk_VXEAR36B = __esm({
5194
5430
  }
5195
5431
  });
5196
5432
 
5197
- // ../../packages/core/dist/chunk-HZ6CADSY.js
5198
- function optionalTrimmedText(max) {
5199
- return external_exports.string().trim().max(max).optional().transform((value) => value ? value : void 0);
5200
- }
5201
- function jsonLengthOrNull(value) {
5202
- try {
5203
- const json = JSON.stringify(value);
5204
- return typeof json === "string" ? json.length : null;
5205
- } catch {
5206
- return null;
5207
- }
5208
- }
5209
- function withinJsonLength(value, max) {
5210
- const length = jsonLengthOrNull(value);
5211
- return length !== null && length <= max;
5212
- }
5213
- function isAudioAttachmentFileName(fileName) {
5214
- return /\.(mp3|ogg|oga|wav|m4a|webm)$/i.test(fileName);
5215
- }
5216
- var uuidSchema, USER_ID_REGEX, timestampSchema, idParamSchema, clientOptionalString, clientOptionalBoolean, clientOptionalNumber, messageAttachment, MAX_MESSAGE_BODY_BYTES, MAX_ATTACHMENTS_PER_MESSAGE, MESSAGE_ENVELOPE_HEADROOM_BYTES, MAX_AUDIO_FILE_BASE64_BYTES;
5217
- var init_chunk_HZ6CADSY = __esm({
5218
- "../../packages/core/dist/chunk-HZ6CADSY.js"() {
5219
- "use strict";
5220
- init_zod();
5221
- uuidSchema = external_exports.string().uuid();
5222
- USER_ID_REGEX = /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|user_[A-Za-z0-9]+)$/i;
5223
- timestampSchema = external_exports.string().datetime();
5224
- idParamSchema = external_exports.object({
5225
- id: uuidSchema
5226
- });
5227
- clientOptionalString = external_exports.string().nullish().transform((v) => v ?? void 0);
5228
- clientOptionalBoolean = external_exports.boolean().nullish().transform((v) => v ?? void 0);
5229
- clientOptionalNumber = external_exports.number().nullish().transform((v) => v ?? void 0);
5230
- messageAttachment = external_exports.object({
5231
- /**
5232
- * Capped at the same 255 the storage layer already truncates names to, so nothing
5233
- * legitimate is lost — every filesystem caps there, and `sanitizeFileName` sliced
5234
- * longer names anyway.
5235
- *
5236
- * The bound is load-bearing, not hygiene: the RAW name is written to R2
5237
- * `customMetadata.originalFileName`, and R2 rejects oversized metadata. An unbounded
5238
- * name let a client make the R2 write throw a generic storage error — indistinguishable
5239
- * from a real outage — which pages us via `logger.error` and, on the app channel, is
5240
- * read as "we lost the file" and escalates the user to a human. Client input must not
5241
- * be able to impersonate an infrastructure failure (gh #3365).
5242
- */
5243
- file_name: external_exports.string().max(255),
5244
- /** Base64. Bounded by the route's bodyLimit, not by this schema. */
5245
- file_binary: external_exports.string(),
5246
- file_size: clientOptionalNumber,
5247
- file_extension: clientOptionalString
5248
- });
5249
- MAX_MESSAGE_BODY_BYTES = 10 * 1024 * 1024;
5250
- MAX_ATTACHMENTS_PER_MESSAGE = 20;
5251
- MESSAGE_ENVELOPE_HEADROOM_BYTES = 64 * 1024;
5252
- MAX_AUDIO_FILE_BASE64_BYTES = 8 * 1024 * 1024;
5253
- }
5254
- });
5255
-
5256
- // ../../packages/core/dist/chunk-RACEDHG6.js
5257
- var resourceIdParam, listResourcesQuery, createResourceBody, updateResourceBody, syncSkillsBody, resourceFileIdParam, listResourceFilesQuery, createResourceFileBody, updateResourceFileBody, uploadResourceFileBody, uploadSkillZipBody, resourceFolderIdParam, listResourceFoldersQuery, createResourceFolderBody, updateResourceFolderBody, agentResourceQuery, hubResourceQuery, linkAgentResourceBody, updateAgentResourceBody, unlinkAgentResourceQuery;
5258
- var init_chunk_RACEDHG6 = __esm({
5259
- "../../packages/core/dist/chunk-RACEDHG6.js"() {
5260
- "use strict";
5261
- init_chunk_HZ6CADSY();
5262
- init_zod();
5263
- resourceIdParam = external_exports.object({ id: uuidSchema });
5264
- listResourcesQuery = external_exports.object({
5265
- hub_id: uuidSchema,
5266
- enabled: external_exports.enum(["true", "false"]).optional(),
5267
- search: external_exports.string().optional(),
5268
- limit: external_exports.string().regex(/^\d+$/).optional(),
5269
- offset: external_exports.string().regex(/^\d+$/).optional()
5270
- });
5271
- createResourceBody = external_exports.object({
5272
- hub_id: uuidSchema,
5273
- resource_name: external_exports.string().min(1),
5274
- resource_description: external_exports.string().optional(),
5275
- enabled: external_exports.boolean().optional(),
5276
- skill_name: external_exports.string().optional(),
5277
- skill_version: external_exports.string().optional()
5278
- });
5279
- updateResourceBody = external_exports.object({
5280
- resource_name: external_exports.string().min(1).optional(),
5281
- resource_description: external_exports.string().optional(),
5282
- enabled: external_exports.boolean().optional(),
5283
- skill_name: external_exports.string().optional(),
5284
- skill_version: external_exports.string().optional()
5285
- // No `anthropic_skill_id`/`anthropic_version`: `resource` has neither column.
5286
- // The provider link lives on `resource_provider_sync.provider_skill_id`,
5287
- // written by `skillSync.ts` — never through this body.
5288
- });
5289
- syncSkillsBody = external_exports.object({
5290
- hub_id: uuidSchema,
5291
- connection_id: uuidSchema.optional()
5292
- });
5293
- resourceFileIdParam = external_exports.object({ id: uuidSchema });
5294
- listResourceFilesQuery = external_exports.object({
5295
- hub_id: uuidSchema,
5296
- resource_id: uuidSchema.optional(),
5297
- folder_id: external_exports.string().optional(),
5298
- // 'null' for root, UUID for specific folder
5299
- search: external_exports.string().optional(),
5300
- tags: external_exports.string().optional(),
5301
- // comma-separated
5302
- enabled: external_exports.enum(["true", "false"]).optional(),
5303
- limit: external_exports.string().regex(/^\d+$/).optional(),
5304
- offset: external_exports.string().regex(/^\d+$/).optional(),
5305
- include_root_files: external_exports.enum(["true", "false"]).optional()
5306
- });
5307
- createResourceFileBody = external_exports.object({
5308
- hub_id: uuidSchema,
5309
- resource_id: uuidSchema,
5310
- file_id: uuidSchema,
5311
- folder_id: uuidSchema.nullable().optional(),
5312
- resource_file_title: external_exports.string().optional(),
5313
- resource_file_tags: external_exports.array(external_exports.string()).optional(),
5314
- order_index: external_exports.number().optional(),
5315
- enabled: external_exports.boolean().optional(),
5316
- metadata: external_exports.record(external_exports.unknown()).optional()
5317
- });
5318
- updateResourceFileBody = external_exports.object({
5319
- resource_file_title: external_exports.string().optional(),
5320
- resource_file_tags: external_exports.array(external_exports.string()).optional(),
5321
- folder_id: uuidSchema.nullable().optional(),
5322
- order_index: external_exports.number().optional(),
5323
- enabled: external_exports.boolean().optional(),
5324
- metadata: external_exports.record(external_exports.unknown()).optional()
5325
- });
5326
- uploadResourceFileBody = external_exports.object({
5327
- hub_id: uuidSchema,
5328
- resource_id: uuidSchema,
5329
- folder_id: uuidSchema.nullable().optional(),
5330
- file_name: external_exports.string().min(1),
5331
- file_data: external_exports.string().min(1),
5332
- mime_type: external_exports.string().optional(),
5333
- file_size: external_exports.number().optional(),
5334
- tags: external_exports.array(external_exports.string()).optional()
5335
- });
5336
- uploadSkillZipBody = external_exports.object({
5337
- hub_id: uuidSchema,
5338
- resource_id: uuidSchema,
5339
- zip_data: external_exports.string().min(1),
5340
- replace_existing: external_exports.boolean().optional()
5341
- });
5342
- resourceFolderIdParam = external_exports.object({ id: uuidSchema });
5343
- listResourceFoldersQuery = external_exports.object({
5344
- hub_id: uuidSchema,
5345
- resource_id: uuidSchema,
5346
- parent_folder_id: external_exports.string().optional(),
5347
- // 'null' for root folders
5348
- enabled: external_exports.enum(["true", "false"]).optional()
5349
- });
5350
- createResourceFolderBody = external_exports.object({
5351
- hub_id: uuidSchema,
5352
- resource_id: uuidSchema,
5353
- folder_name: external_exports.string().min(1),
5354
- folder_description: external_exports.string().optional(),
5355
- parent_folder_id: uuidSchema.nullable().optional(),
5356
- order_index: external_exports.number().optional(),
5357
- enabled: external_exports.boolean().optional(),
5358
- metadata: external_exports.record(external_exports.unknown()).optional()
5359
- });
5360
- updateResourceFolderBody = external_exports.object({
5361
- folder_name: external_exports.string().min(1).optional(),
5362
- folder_description: external_exports.string().optional(),
5363
- parent_folder_id: uuidSchema.nullable().optional(),
5364
- order_index: external_exports.number().optional(),
5365
- enabled: external_exports.boolean().optional(),
5366
- metadata: external_exports.record(external_exports.unknown()).optional()
5367
- });
5368
- agentResourceQuery = external_exports.object({
5369
- hub_id: uuidSchema,
5370
- agent_id: uuidSchema.optional(),
5371
- resource_id: uuidSchema.optional()
5372
- }).refine((data) => data.agent_id || data.resource_id, {
5373
- message: "Either agent_id or resource_id is required"
5374
- });
5375
- hubResourceQuery = external_exports.object({ hub_id: uuidSchema });
5376
- linkAgentResourceBody = external_exports.object({
5377
- hub_id: uuidSchema,
5378
- resource_id: uuidSchema,
5379
- agent_id: uuidSchema,
5380
- priority: external_exports.number().optional(),
5381
- use_native_integration: external_exports.boolean().optional()
5382
- });
5383
- updateAgentResourceBody = external_exports.object({
5384
- hub_id: uuidSchema,
5385
- resource_id: uuidSchema,
5386
- agent_id: uuidSchema,
5387
- use_native_integration: external_exports.boolean().optional(),
5388
- enabled: external_exports.boolean().optional(),
5389
- priority: external_exports.number().optional()
5390
- });
5391
- unlinkAgentResourceQuery = external_exports.object({
5392
- hub_id: uuidSchema,
5393
- resource_id: uuidSchema,
5394
- agent_id: uuidSchema
5395
- });
5396
- }
5397
- });
5398
-
5399
5433
  // ../../packages/core/dist/chunk-K2UY4M4E.js
5400
5434
  var accessExplainQuery;
5401
5435
  var init_chunk_K2UY4M4E = __esm({
@@ -5409,11 +5443,12 @@ var init_chunk_K2UY4M4E = __esm({
5409
5443
  }
5410
5444
  });
5411
5445
 
5412
- // ../../packages/core/dist/chunk-WBFLPPDI.js
5446
+ // ../../packages/core/dist/chunk-HA7CRZMX.js
5413
5447
  var connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, BESIDE_LINK_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery;
5414
- var init_chunk_WBFLPPDI = __esm({
5415
- "../../packages/core/dist/chunk-WBFLPPDI.js"() {
5448
+ var init_chunk_HA7CRZMX = __esm({
5449
+ "../../packages/core/dist/chunk-HA7CRZMX.js"() {
5416
5450
  "use strict";
5451
+ init_chunk_MF2VVXBR();
5417
5452
  init_chunk_HZ6CADSY();
5418
5453
  init_zod();
5419
5454
  connectionIdParam = external_exports.object({ id: uuidSchema });
@@ -5428,7 +5463,9 @@ var init_chunk_WBFLPPDI = __esm({
5428
5463
  inbound_address: external_exports.string().email().optional(),
5429
5464
  // Opt out of copying this connection's credentials into production on publish/sync.
5430
5465
  // Defaults to true at the DB layer.
5431
- sync_credentials_to_production: external_exports.boolean().optional()
5466
+ sync_credentials_to_production: external_exports.boolean().optional(),
5467
+ // When the connection's own secret expires; null for none (`credential-expiry.ts`).
5468
+ expires_at: credentialExpiresAtSchema.optional()
5432
5469
  }).passthrough().superRefine((data, ctx) => {
5433
5470
  if (data.inbound_mode === "resend" && !data.inbound_address) {
5434
5471
  ctx.addIssue({
@@ -5440,7 +5477,8 @@ var init_chunk_WBFLPPDI = __esm({
5440
5477
  });
5441
5478
  editConnectionBody = external_exports.object({
5442
5479
  hub_id: uuidSchema,
5443
- sync_credentials_to_production: external_exports.boolean().optional()
5480
+ sync_credentials_to_production: external_exports.boolean().optional(),
5481
+ expires_at: credentialExpiresAtSchema.optional()
5444
5482
  }).passthrough();
5445
5483
  PRODUCTION_DIRECT_FIELDS = ["username", "api_key", "access_token", "password", "refresh_token", "webhook_secret_token", "webhook_signing_secret", "github_app_id", "github_app_private_key"];
5446
5484
  BESIDE_LINK_FIELDS = /* @__PURE__ */ new Set(["webhook_secret_token", "github_app_id", "github_app_private_key"]);
@@ -5456,7 +5494,8 @@ var init_chunk_WBFLPPDI = __esm({
5456
5494
  webhook_secret_token: external_exports.string().optional(),
5457
5495
  webhook_signing_secret: external_exports.string().optional(),
5458
5496
  github_app_id: external_exports.string().optional(),
5459
- github_app_private_key: external_exports.string().optional()
5497
+ github_app_private_key: external_exports.string().optional(),
5498
+ expires_at: credentialExpiresAtSchema.optional()
5460
5499
  }).strict().superRefine((data, ctx) => {
5461
5500
  const hasOrgLink = !!data.organization_credential_id || !!data.organization_credential_token_id;
5462
5501
  const sets = (f) => data[f] != null && data[f] !== `__USE_EXISTING_${f.toUpperCase()}__`;
@@ -5465,7 +5504,10 @@ var init_chunk_WBFLPPDI = __esm({
5465
5504
  if (hasOrgLink && hasDirectBesideLink) {
5466
5505
  ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "Provide either an organization credential link or direct credential fields, not both" });
5467
5506
  }
5468
- if (!hasOrgLink && !hasDirect) {
5507
+ if (hasOrgLink && data.expires_at != null) {
5508
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: LINKED_EXPIRY_REFUSAL, path: ["expires_at"] });
5509
+ }
5510
+ if (!hasOrgLink && !hasDirect && data.expires_at === void 0) {
5469
5511
  ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "A credential is required: link an organization credential or provide a credential field" });
5470
5512
  }
5471
5513
  });
@@ -6595,14 +6637,14 @@ var init_chunk_OEDDM5YN = __esm({
6595
6637
  }
6596
6638
  });
6597
6639
 
6598
- // ../../packages/core/dist/chunk-7DA4MW5T.js
6640
+ // ../../packages/core/dist/chunk-QIY3NIYY.js
6599
6641
  var TOOLSET_SLUG_PATTERN, REKOR_STRUCTURAL_ID_PATTERN, baseEnvironmentSchema, toolsetFileToolSchema, toolsetSurfaceSchema, toolsetConnectionBindingSchema, rekorToolsetToolsSchema, rekorBoundAttestation, rekorResolvedToolsetSchema, resolvedRecordTypeSchema, reviewWritersSchema, sharedScopeSchema, resolvedFileToolSchema, rekorToolsetFileSchema, rekorToolsetFileUrlAnswerSchema, rekorToolsetFileListSchema, rekorToolsetFileGetSchema, rekorToolsetFilePutSchema, TOOLSET_CUSTOMER_FACING_REFUSAL_MARK, TOOLSET_CUSTOMER_FACING_REFUSAL;
6600
- var init_chunk_7DA4MW5T = __esm({
6601
- "../../packages/core/dist/chunk-7DA4MW5T.js"() {
6642
+ var init_chunk_QIY3NIYY = __esm({
6643
+ "../../packages/core/dist/chunk-QIY3NIYY.js"() {
6602
6644
  "use strict";
6603
6645
  init_chunk_OEDDM5YN();
6604
6646
  init_chunk_TANTZFI3();
6605
- init_chunk_WNLWNFHH();
6647
+ init_chunk_PTYXZZTE();
6606
6648
  init_zod();
6607
6649
  TOOLSET_SLUG_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
6608
6650
  REKOR_STRUCTURAL_ID_PATTERN = TOOLSET_SLUG_PATTERN;
@@ -7083,24 +7125,6 @@ var init_chunk_FPSDNS2E = __esm({
7083
7125
  }
7084
7126
  });
7085
7127
 
7086
- // ../../packages/core/dist/chunk-MIWZOSPI.js
7087
- function toIso(epochMs) {
7088
- return new Date(epochMs).toISOString();
7089
- }
7090
- function fromIso(iso) {
7091
- return new Date(iso).getTime();
7092
- }
7093
- function isIsoTimestamp(value) {
7094
- return typeof value === "string" && ISO_UTC_RE.test(value);
7095
- }
7096
- var ISO_UTC_RE;
7097
- var init_chunk_MIWZOSPI = __esm({
7098
- "../../packages/core/dist/chunk-MIWZOSPI.js"() {
7099
- "use strict";
7100
- ISO_UTC_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
7101
- }
7102
- });
7103
-
7104
7128
  // ../../packages/core/dist/chunk-E4DIIOOE.js
7105
7129
  var CALL_STATUSES, callStatus, CALL_END_REASONS, callEndReason, CALL_TRANSPORTS, callTransport, CALL_PARTICIPANT_TYPES, callParticipantType, callInstant, MAX_SDP_OFFER_LENGTH, sdpDescription, sdpOffer, MAX_CALL_REQUEST_BODY_BYTES, hubScoped, callSummaryFields, callSummary, callIdParam, createCallBody, createCallResponse, callReadyBody, callHangupBody, callStatusQuery, MAX_REPORTED_DELEGATION_IDS, callDelegationId, callDelegationsBody, callResponse, MAX_CALL_RECORDING_GAPS, callRecordingGap, callRecordingNoteMetadata;
7106
7130
  var init_chunk_E4DIIOOE = __esm({
@@ -8418,10 +8442,10 @@ var init_chunk_IR2NOSI3 = __esm({
8418
8442
  }
8419
8443
  });
8420
8444
 
8421
- // ../../packages/core/dist/chunk-EA23LSDS.js
8445
+ // ../../packages/core/dist/chunk-OPETF4GS.js
8422
8446
  var hubAlertsParam, hubAlertSeverity, hubAlert, hubAlertsListResponse;
8423
- var init_chunk_EA23LSDS = __esm({
8424
- "../../packages/core/dist/chunk-EA23LSDS.js"() {
8447
+ var init_chunk_OPETF4GS = __esm({
8448
+ "../../packages/core/dist/chunk-OPETF4GS.js"() {
8425
8449
  "use strict";
8426
8450
  init_zod();
8427
8451
  hubAlertsParam = external_exports.object({
@@ -8574,17 +8598,17 @@ var init_chunk_MH4O3YEX = __esm({
8574
8598
  }
8575
8599
  });
8576
8600
 
8577
- // ../../packages/core/dist/chunk-SAQNCSQ6.js
8601
+ // ../../packages/core/dist/chunk-RHGPANBN.js
8578
8602
  function catalogToolSideEffects(toolName) {
8579
8603
  const sideEffects = CATALOG_SIDE_EFFECTS.get(toolName);
8580
8604
  if (sideEffects === void 0) return "unknown";
8581
8605
  return sideEffects ? "side_effects" : "none";
8582
8606
  }
8583
8607
  var NATIVE_TOOL_SCHEMAS, WAYAI_CONNECTOR, SANDBOX_AGENT_ROLES, BASE_NATIVE_TOOLS, NATIVE_TOOLS, CATALOG_SIDE_EFFECTS;
8584
- var init_chunk_SAQNCSQ6 = __esm({
8585
- "../../packages/core/dist/chunk-SAQNCSQ6.js"() {
8608
+ var init_chunk_RHGPANBN = __esm({
8609
+ "../../packages/core/dist/chunk-RHGPANBN.js"() {
8586
8610
  "use strict";
8587
- init_chunk_WNLWNFHH();
8611
+ init_chunk_PTYXZZTE();
8588
8612
  NATIVE_TOOL_SCHEMAS = {
8589
8613
  "close_conversation": {
8590
8614
  "tool_config": {
@@ -9754,7 +9778,7 @@ var init_chunk_T7KQKDET = __esm({
9754
9778
  }
9755
9779
  });
9756
9780
 
9757
- // ../../packages/core/dist/chunk-VU7E2RFY.js
9781
+ // ../../packages/core/dist/chunk-TL7IF5CR.js
9758
9782
  function resolveMonitorTrigger(monitorConfig) {
9759
9783
  if (!monitorConfig || typeof monitorConfig !== "object") return "idle";
9760
9784
  const raw = monitorConfig.trigger;
@@ -10060,15 +10084,15 @@ function refineMonitorRulesStructuredOutput(body, ctx) {
10060
10084
  if (refusal2) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["response_format"], message: refusal2 });
10061
10085
  }
10062
10086
  var NATIVE_TOOL_NAMES, previousConversationsCountField, summarizationThresholdField, flagConditionSchema, MONITOR_TRIGGERS, monitorTriggerSchema, AUTOMATION_GATE_TRIGGERS, NON_FIRING_TRIGGERS, MONITOR_FIRING_TRIGGERS, MONITOR_DELAY_SECONDS_MIN, MONITOR_IDLE_DELAY_REQUIRED_MESSAGE, MONITOR_HISTORY_MESSAGES_MAX, monitorHistoryMessagesSchema, monitorIncludeToolResultsSchema, MONITOR_INPUT_SHAPING_KEYS, MONITOR_INPUT_SHAPING_SCHEMAS, MONITOR_INPUT_SHAPING_IDLE_MESSAGE, monitorArgumentSourceSchema, MONITOR_NOTE_TEMPLATE_MAX, MONITOR_STEER_NOTE_MAX, MONITOR_GATE_AGENT_NAME_MAX, monitorActionSchema, monitorRuleSchema, MONITOR_RULE_KEYS, MONITOR_RULE_SCHEMAS, MONITOR_RULE_TRIGGERS, MONITOR_RULE_TRIGGER_MESSAGE, CALL_UTTERANCE_SPEAKERS, callUtteranceSpeakerSchema, MONITOR_CALL_KEYS, MONITOR_CALL_SCHEMAS, MONITOR_CALL_KEY_MESSAGE, CALL_STEERING_MIN_CONFIDENCE, CALL_UTTERANCE_RULE_NOT_CONFIDENT_MESSAGE, CALL_UTTERANCE_FALLBACK_MESSAGE, CALL_UTTERANCE_FLAG_CONDITIONS_MESSAGE, CALL_STEER_NOTE_BLANK_MESSAGE, MONITOR_USER_MESSAGE_ACTION_KINDS, MONITOR_ASSISTANT_REPLY_ACTION_KINDS, MONITOR_CALL_UTTERANCE_ACTION_KINDS, MONITOR_AUTOMATION_FIRE_ACTION_KINDS, MONITOR_AUTOMATION_ITEM_ACTION_KINDS, INSERT_NOTE_TOOL_NAME, RUN_MONITOR_TOOL_NAME, MONITOR_RULE_ALLOWED_NATIVE_TOOLS, MONITOR_RULE_REENTRY_TOOLS, MONITOR_RULE_REENTRY_TRACKS, AUTOMATION_FIRE_FLAG_CONDITIONS_MESSAGE, AUTOMATION_FIRE_INPUT_SHAPING_MESSAGE, AUTOMATION_ITEM_FLAG_CONDITIONS_MESSAGE, AUTOMATION_ITEM_INPUT_SHAPING_MESSAGE, AUTOMATION_GATE_KEY_MESSAGES, monitorConfigField, flagConditionsField, agentIdParam, listAgentsQuery, agentConnectionsQuery, createAgentBody, updateAgentBody, AGENT_PARAMETER_TYPES, AGENT_PARAMETER_NAME_REGEX, agentParameterCreateSchema, MAX_AGENT_PARAMETERS_PER_REQUEST, createAgentParametersBody;
10063
- var init_chunk_VU7E2RFY = __esm({
10064
- "../../packages/core/dist/chunk-VU7E2RFY.js"() {
10087
+ var init_chunk_TL7IF5CR = __esm({
10088
+ "../../packages/core/dist/chunk-TL7IF5CR.js"() {
10065
10089
  "use strict";
10066
- init_chunk_SAQNCSQ6();
10090
+ init_chunk_RHGPANBN();
10067
10091
  init_chunk_IBL7FANV();
10068
10092
  init_chunk_HZ6CADSY();
10069
10093
  init_chunk_C2UEA2KW();
10070
10094
  init_chunk_LD6U3CDG();
10071
- init_chunk_WNLWNFHH();
10095
+ init_chunk_PTYXZZTE();
10072
10096
  init_chunk_T7KQKDET();
10073
10097
  init_chunk_L5F7ZOUJ();
10074
10098
  init_zod();
@@ -10286,14 +10310,14 @@ var init_chunk_VU7E2RFY = __esm({
10286
10310
  }
10287
10311
  });
10288
10312
 
10289
- // ../../packages/core/dist/chunk-FKBQSXOY.js
10313
+ // ../../packages/core/dist/chunk-HZEQA7CK.js
10290
10314
  var conversationIdParam, conversationHubQuery, claimBody, releaseBody, transferBody, closeBody, additionalContextPayloadSchema, kanbanUpdateBody, annotateConversationBody, observabilityParams, observabilityListParams, deleteUserConversationsBody, deleteUserConversationsResponse, sendMessageBody, listConversationsQuery, flagSourceSchema, getConversationsResponse, getConversationDetailParams, getConversationDetailQuery, getConversationDetailResponse, listWhatsAppTemplatesQuery, sendWhatsAppTemplateBody;
10291
- var init_chunk_FKBQSXOY = __esm({
10292
- "../../packages/core/dist/chunk-FKBQSXOY.js"() {
10315
+ var init_chunk_HZEQA7CK = __esm({
10316
+ "../../packages/core/dist/chunk-HZEQA7CK.js"() {
10293
10317
  "use strict";
10294
- init_chunk_VU7E2RFY();
10318
+ init_chunk_TL7IF5CR();
10295
10319
  init_chunk_HZ6CADSY();
10296
- init_chunk_WNLWNFHH();
10320
+ init_chunk_PTYXZZTE();
10297
10321
  init_zod();
10298
10322
  conversationIdParam = external_exports.object({
10299
10323
  id: external_exports.string().uuid()
@@ -10747,7 +10771,7 @@ var init_chunk_BPCNB5RT = __esm({
10747
10771
  }
10748
10772
  });
10749
10773
 
10750
- // ../../packages/core/dist/chunk-5HA6FIE7.js
10774
+ // ../../packages/core/dist/chunk-JJWKZHF3.js
10751
10775
  function idempotencyHeaderRefusal(value) {
10752
10776
  if (typeof value !== "string" || !/^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/.test(value)) {
10753
10777
  return "idempotency_header must be a header name: letters, digits and dashes, at most 64";
@@ -10758,10 +10782,10 @@ function idempotencyHeaderRefusal(value) {
10758
10782
  return null;
10759
10783
  }
10760
10784
  var CATALOG_REPLAY, REPLAY_OVERRIDES, RESERVED_HEADERS;
10761
- var init_chunk_5HA6FIE7 = __esm({
10762
- "../../packages/core/dist/chunk-5HA6FIE7.js"() {
10785
+ var init_chunk_JJWKZHF3 = __esm({
10786
+ "../../packages/core/dist/chunk-JJWKZHF3.js"() {
10763
10787
  "use strict";
10764
- init_chunk_SAQNCSQ6();
10788
+ init_chunk_RHGPANBN();
10765
10789
  CATALOG_REPLAY = new Map(
10766
10790
  NATIVE_TOOLS.map((tool) => [tool.tool_name, tool.replay])
10767
10791
  );
@@ -10994,7 +11018,7 @@ var init_chunk_WEXVYJ5H = __esm({
10994
11018
  }
10995
11019
  });
10996
11020
 
10997
- // ../../packages/core/dist/chunk-HCE5YOBD.js
11021
+ // ../../packages/core/dist/chunk-I6T2KTYE.js
10998
11022
  function refineToolConfig(value, ctx) {
10999
11023
  const raw = value.tool_config;
11000
11024
  if (raw == null) return;
@@ -11030,10 +11054,10 @@ function refineToolConfig(value, ctx) {
11030
11054
  }
11031
11055
  }
11032
11056
  var toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, toolReplaySettingsFields, toolReplaySettingsSchema, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody;
11033
- var init_chunk_HCE5YOBD = __esm({
11034
- "../../packages/core/dist/chunk-HCE5YOBD.js"() {
11057
+ var init_chunk_I6T2KTYE = __esm({
11058
+ "../../packages/core/dist/chunk-I6T2KTYE.js"() {
11035
11059
  "use strict";
11036
- init_chunk_5HA6FIE7();
11060
+ init_chunk_JJWKZHF3();
11037
11061
  init_chunk_WEXVYJ5H();
11038
11062
  init_chunk_HZ6CADSY();
11039
11063
  init_zod();
@@ -11102,7 +11126,7 @@ var init_chunk_4LXDRTO4 = __esm({
11102
11126
  }
11103
11127
  });
11104
11128
 
11105
- // ../../packages/core/dist/chunk-C552TQHI.js
11129
+ // ../../packages/core/dist/chunk-II4M7TXT.js
11106
11130
  function isIanaTimezone(timezone) {
11107
11131
  try {
11108
11132
  new Intl.DateTimeFormat("en-US", { timeZone: timezone }).format(0);
@@ -11112,13 +11136,13 @@ function isIanaTimezone(timezone) {
11112
11136
  }
11113
11137
  }
11114
11138
  var evalDateContextSchema;
11115
- var init_chunk_C552TQHI = __esm({
11116
- "../../packages/core/dist/chunk-C552TQHI.js"() {
11139
+ var init_chunk_II4M7TXT = __esm({
11140
+ "../../packages/core/dist/chunk-II4M7TXT.js"() {
11117
11141
  "use strict";
11118
11142
  init_chunk_HZ6CADSY();
11119
11143
  init_chunk_MIWZOSPI();
11120
11144
  init_chunk_LD6U3CDG();
11121
- init_chunk_WNLWNFHH();
11145
+ init_chunk_PTYXZZTE();
11122
11146
  init_zod();
11123
11147
  evalDateContextSchema = external_exports.object({
11124
11148
  base_time: timestampSchema.refine(isIsoTimestamp, "Expected a canonical ISO timestamp"),
@@ -11142,7 +11166,7 @@ var init_chunk_2ISUBJG7 = __esm({
11142
11166
  }
11143
11167
  });
11144
11168
 
11145
- // ../../packages/core/dist/chunk-VQIITUAJ.js
11169
+ // ../../packages/core/dist/chunk-EKWR7732.js
11146
11170
  function describeRole(role) {
11147
11171
  if (typeof role === "string") {
11148
11172
  return JSON.stringify(role.length > ROLE_ECHO_MAX ? `${role.slice(0, ROLE_ECHO_MAX)}\u2026` : role);
@@ -11316,11 +11340,11 @@ function terminalRunCount(counts) {
11316
11340
  return counts.successful_runs + counts.failed_runs;
11317
11341
  }
11318
11342
  var evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, EVAL_FIXTURE_NAME_MAX_LENGTH, evalFixtureOverrideSchema, runSessionQuery, runJourneyQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, evalCustomerContactIdSchema, evalBody, EVAL_LIST_MAX_LIMIT, evalListLimit, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, EVAL_MAX_SELECTED_SCENARIOS, evalScenarioSelectionEntrySchema, evalScenarioSelectionSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, evalAttachmentRef, turnMayCarryAttachments, ATTACHMENTS_USER_ONLY_MESSAGE, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, evalSessionConfigResponseSchema, evalSessionResponseSchema, evalSessionListConfigSchema, evalSessionListItemSchema, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT;
11319
- var init_chunk_VQIITUAJ = __esm({
11320
- "../../packages/core/dist/chunk-VQIITUAJ.js"() {
11343
+ var init_chunk_EKWR7732 = __esm({
11344
+ "../../packages/core/dist/chunk-EKWR7732.js"() {
11321
11345
  "use strict";
11322
11346
  init_chunk_4LXDRTO4();
11323
- init_chunk_C552TQHI();
11347
+ init_chunk_II4M7TXT();
11324
11348
  init_chunk_HZ6CADSY();
11325
11349
  init_chunk_2ISUBJG7();
11326
11350
  init_zod();
@@ -12122,7 +12146,7 @@ var init_chunk_3VHMUK4W = __esm({
12122
12146
  }
12123
12147
  });
12124
12148
 
12125
- // ../../packages/core/dist/chunk-XQBFXSYS.js
12149
+ // ../../packages/core/dist/chunk-5BOYRUX2.js
12126
12150
  function byLocale(entry) {
12127
12151
  const shape = Object.fromEntries(SUPPORTED_LOCALES.map((locale) => [locale, entry.optional()]));
12128
12152
  return external_exports.object(shape).strict();
@@ -12133,10 +12157,10 @@ function writeField(map) {
12133
12157
  );
12134
12158
  }
12135
12159
  var HUB_DISPLAY_NAME_MAX_CHARS, HUB_WELCOME_MESSAGE_MAX_CHARS, HUB_STARTER_QUESTIONS_MAX, HUB_STARTER_QUESTION_MAX_CHARS, displayName, welcomeMessage, starterQuestions, hubDisplayNamesSchema, hubWelcomeMessagesSchema, hubStarterQuestionsSchema, hubDisplayNamesField, hubWelcomeMessagesField, hubStarterQuestionsField, HUB_PRESENTATION_FIELDS, HUB_PRESENTATION_SCHEMAS;
12136
- var init_chunk_XQBFXSYS = __esm({
12137
- "../../packages/core/dist/chunk-XQBFXSYS.js"() {
12160
+ var init_chunk_5BOYRUX2 = __esm({
12161
+ "../../packages/core/dist/chunk-5BOYRUX2.js"() {
12138
12162
  "use strict";
12139
- init_chunk_WNLWNFHH();
12163
+ init_chunk_PTYXZZTE();
12140
12164
  init_zod();
12141
12165
  HUB_DISPLAY_NAME_MAX_CHARS = 120;
12142
12166
  HUB_WELCOME_MESSAGE_MAX_CHARS = 1e3;
@@ -12160,7 +12184,7 @@ var init_chunk_XQBFXSYS = __esm({
12160
12184
  }
12161
12185
  });
12162
12186
 
12163
- // ../../packages/core/dist/chunk-C4EMATJL.js
12187
+ // ../../packages/core/dist/chunk-O7IPFQTZ.js
12164
12188
  function refineLaneReferences(val, ctx) {
12165
12189
  const lanes = val.lanes;
12166
12190
  const statuses = val.kanban_statuses;
@@ -12184,12 +12208,12 @@ function describeSyncWarning(warning) {
12184
12208
  return `${label}: ${parts.join("; ")}. Promote the base so production's tools match the preview's.`;
12185
12209
  }
12186
12210
  var hubIdParam, hubAdminIdParam, hubUserIdParam, hubAgentIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, HUB_USERS_PAGE_SIZE_MAX, HUB_USERS_SEARCH_MAX, HUB_USERS_CHANNEL_TYPES, getHubUsersQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_RETENTION_DAYS, MAX_END_USER_DAILY_MESSAGE_LIMIT, endUserDailyMessageLimitField, previewLabelField, hubTagsField, createHubBody, updateHubBody, HUB_TAG_CHANGE_REFUSED, hubTagChangeRefusalSchema, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, CONTACT_ACCESS_PAGE_SIZE_MAX, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, HUB_DIFF_SECTION_SET, HUB_DIFF_SECTIONS, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam;
12187
- var init_chunk_C4EMATJL = __esm({
12188
- "../../packages/core/dist/chunk-C4EMATJL.js"() {
12211
+ var init_chunk_O7IPFQTZ = __esm({
12212
+ "../../packages/core/dist/chunk-O7IPFQTZ.js"() {
12189
12213
  "use strict";
12190
12214
  init_chunk_AMG6HKUQ();
12191
12215
  init_chunk_3VHMUK4W();
12192
- init_chunk_XQBFXSYS();
12216
+ init_chunk_5BOYRUX2();
12193
12217
  init_chunk_HZ6CADSY();
12194
12218
  init_zod();
12195
12219
  hubIdParam = external_exports.object({ id: uuidSchema });
@@ -12383,7 +12407,7 @@ var init_chunk_C4EMATJL = __esm({
12383
12407
  }
12384
12408
  });
12385
12409
 
12386
- // ../../packages/core/dist/chunk-7NGYX3UI.js
12410
+ // ../../packages/core/dist/chunk-VD5QA4ZZ.js
12387
12411
  function refineHubAsCodeCustomTools(config, ctx) {
12388
12412
  const agents = config.agents;
12389
12413
  if (!Array.isArray(agents)) return;
@@ -12983,18 +13007,18 @@ function skillSectionsAsResources(scope) {
12983
13007
  };
12984
13008
  }
12985
13009
  var MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema;
12986
- var init_chunk_7NGYX3UI = __esm({
12987
- "../../packages/core/dist/chunk-7NGYX3UI.js"() {
13010
+ var init_chunk_VD5QA4ZZ = __esm({
13011
+ "../../packages/core/dist/chunk-VD5QA4ZZ.js"() {
12988
13012
  "use strict";
12989
- init_chunk_HCE5YOBD();
13013
+ init_chunk_I6T2KTYE();
12990
13014
  init_chunk_OEDDM5YN();
12991
- init_chunk_VQIITUAJ();
12992
- init_chunk_VU7E2RFY();
13015
+ init_chunk_EKWR7732();
13016
+ init_chunk_TL7IF5CR();
12993
13017
  init_chunk_LBDH7LCG();
12994
13018
  init_chunk_4LXDRTO4();
12995
- init_chunk_C4EMATJL();
13019
+ init_chunk_O7IPFQTZ();
12996
13020
  init_chunk_AMG6HKUQ();
12997
- init_chunk_XQBFXSYS();
13021
+ init_chunk_5BOYRUX2();
12998
13022
  init_chunk_WEXVYJ5H();
12999
13023
  init_chunk_C2UEA2KW();
13000
13024
  init_chunk_S4VDZ7PZ();
@@ -13999,16 +14023,16 @@ var init_chunk_LQY2OCQL = __esm({
13999
14023
  }
14000
14024
  });
14001
14025
 
14002
- // ../../packages/core/dist/chunk-3TKJNWDS.js
14026
+ // ../../packages/core/dist/chunk-JHMNJCRT.js
14003
14027
  var AUTOMATION_TRIGGER_TYPES, AUTOMATION_EVENT_TYPES, AUTOMATION_TARGET_TYPES, AUTOMATION_ACTION_TYPES, AUTOMATION_CHANNEL_TYPES, AUTOMATION_PURPOSES, AUTOMATION_NAME_MAX, AUTOMATION_DESCRIPTION_MAX, AUTOMATION_INSTRUCTIONS_MAX, AUTOMATION_TEXT_MAX, AUTOMATION_CRON_MAX, AUTOMATION_WEBHOOK_AUTHS, AUTOMATION_WEBHOOK_HEADERS, AUTOMATION_WEBHOOK_BODY_MAX_BYTES, AUTOMATION_WEBHOOK_HEADER_NAME_MAX, WEBHOOK_RESERVED_HEADERS, automationTriggerSchema, automationTargetSchema, automationActionSchema, automationGateSchema, automationName, automationDescription, automationIdParam, automationHubQuery, automationWebhookParams, AUTOMATION_RUNS_PAGE_MAX, listAutomationRunsQuery, createAutomationBody, updateAutomationBody, AUTOMATION_ALERT_CATEGORIES, AUTOMATION_BLOCKED_ALERT_CATEGORY, automationEventSubscriberParam;
14004
- var init_chunk_3TKJNWDS = __esm({
14005
- "../../packages/core/dist/chunk-3TKJNWDS.js"() {
14028
+ var init_chunk_JHMNJCRT = __esm({
14029
+ "../../packages/core/dist/chunk-JHMNJCRT.js"() {
14006
14030
  "use strict";
14007
14031
  init_chunk_LQY2OCQL();
14008
- init_chunk_VU7E2RFY();
14032
+ init_chunk_TL7IF5CR();
14009
14033
  init_chunk_3HSB6J4J();
14010
14034
  init_chunk_5XEJSR22();
14011
- init_chunk_WNLWNFHH();
14035
+ init_chunk_PTYXZZTE();
14012
14036
  init_chunk_T7KQKDET();
14013
14037
  init_zod();
14014
14038
  AUTOMATION_TRIGGER_TYPES = ["schedule", "event", "webhook"];
@@ -14531,7 +14555,7 @@ var init_chunk_OMPT4ZHR = __esm({
14531
14555
  }
14532
14556
  });
14533
14557
 
14534
- // ../../packages/core/dist/chunk-AIHVFCWQ.js
14558
+ // ../../packages/core/dist/chunk-5MZZUQPD.js
14535
14559
  function refineScopedTarget(data, ctx) {
14536
14560
  if (data.scope === "org") {
14537
14561
  if (!data.org_id) {
@@ -14557,13 +14581,13 @@ function refineScopedTarget(data, ctx) {
14557
14581
  }
14558
14582
  }
14559
14583
  var adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND, automationGateEvaluationsPerOperation, AUTOMATION_RUN_RETENTION_DAYS_MAX, automationRunRetentionDays, turnDeadlineSeconds, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetShape, adminScopedTargetBody, adminRepairKnowledgeBlobsBody, BRANCHING_ORPHAN_ENTITY_TYPES, BRANCHING_ORPHAN_MAX_TARGETS, adminRepairBranchingOrphansBody, adminRepairLegacyOrgGrantsBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, dataExplorerDebugCountsDoType, dataExplorerDebugCountsParam, debugHubConvParam, debugMessageIdQuery;
14560
- var init_chunk_AIHVFCWQ = __esm({
14561
- "../../packages/core/dist/chunk-AIHVFCWQ.js"() {
14584
+ var init_chunk_5MZZUQPD = __esm({
14585
+ "../../packages/core/dist/chunk-5MZZUQPD.js"() {
14562
14586
  "use strict";
14563
14587
  init_chunk_FECLIZTY();
14564
14588
  init_chunk_BFG4ZWR4();
14565
14589
  init_chunk_YZAIZJTO();
14566
- init_chunk_C4EMATJL();
14590
+ init_chunk_O7IPFQTZ();
14567
14591
  init_chunk_OMPT4ZHR();
14568
14592
  init_chunk_HZ6CADSY();
14569
14593
  init_chunk_MIWZOSPI();
@@ -15257,14 +15281,15 @@ var init_chunk_Y66JOKZI = __esm({
15257
15281
  var init_contracts = __esm({
15258
15282
  "../../packages/core/dist/contracts/index.js"() {
15259
15283
  "use strict";
15284
+ init_chunk_RACEDHG6();
15260
15285
  init_chunk_Q7KIQHAZ();
15261
15286
  init_chunk_NKLVUTFO();
15262
- init_chunk_GLJSJX5R();
15287
+ init_chunk_ILW3RFGU();
15263
15288
  init_chunk_YVY2TZK2();
15264
15289
  init_chunk_VXEAR36B();
15265
- init_chunk_RACEDHG6();
15266
15290
  init_chunk_K2UY4M4E();
15267
- init_chunk_WBFLPPDI();
15291
+ init_chunk_HA7CRZMX();
15292
+ init_chunk_MF2VVXBR();
15268
15293
  init_chunk_IPXBFWUU();
15269
15294
  init_chunk_GPM7PE44();
15270
15295
  init_chunk_VEERWOZ6();
@@ -15274,7 +15299,7 @@ var init_contracts = __esm({
15274
15299
  init_chunk_Y7CFCYX4();
15275
15300
  init_chunk_5DGHIY7L();
15276
15301
  init_chunk_TUHJ5PQH();
15277
- init_chunk_7DA4MW5T();
15302
+ init_chunk_QIY3NIYY();
15278
15303
  init_chunk_IPDOHAZ5();
15279
15304
  init_chunk_YUZFHVB2();
15280
15305
  init_chunk_I3O2RACG();
@@ -15283,20 +15308,20 @@ var init_contracts = __esm({
15283
15308
  init_chunk_SGYHEHIO();
15284
15309
  init_chunk_C4HEZ7ZI();
15285
15310
  init_chunk_IR2NOSI3();
15286
- init_chunk_EA23LSDS();
15311
+ init_chunk_OPETF4GS();
15287
15312
  init_chunk_SY6PLCPK();
15288
15313
  init_chunk_LWMLR2WI();
15289
15314
  init_chunk_ACGAI25T();
15290
15315
  init_chunk_MH4O3YEX();
15291
- init_chunk_FKBQSXOY();
15316
+ init_chunk_HZEQA7CK();
15292
15317
  init_chunk_KSTYTQ7I();
15293
15318
  init_chunk_LKBSHANA();
15294
15319
  init_chunk_BPCNB5RT();
15295
- init_chunk_7NGYX3UI();
15296
- init_chunk_HCE5YOBD();
15320
+ init_chunk_VD5QA4ZZ();
15321
+ init_chunk_I6T2KTYE();
15297
15322
  init_chunk_OEDDM5YN();
15298
15323
  init_chunk_TANTZFI3();
15299
- init_chunk_VQIITUAJ();
15324
+ init_chunk_EKWR7732();
15300
15325
  init_chunk_JDJ4EUOL();
15301
15326
  init_chunk_ZLJP22IA();
15302
15327
  init_chunk_6IKFJ3GW();
@@ -15305,9 +15330,9 @@ var init_contracts = __esm({
15305
15330
  init_chunk_YULHXJ5M();
15306
15331
  init_chunk_V4FRPRH5();
15307
15332
  init_chunk_JO53JB35();
15308
- init_chunk_3TKJNWDS();
15333
+ init_chunk_JHMNJCRT();
15309
15334
  init_chunk_LQY2OCQL();
15310
- init_chunk_VU7E2RFY();
15335
+ init_chunk_TL7IF5CR();
15311
15336
  init_chunk_3HSB6J4J();
15312
15337
  init_chunk_IG6QBZMA();
15313
15338
  init_chunk_YWZFB34T();
@@ -15317,24 +15342,24 @@ var init_contracts = __esm({
15317
15342
  init_chunk_E4DIIOOE();
15318
15343
  init_chunk_7CYHPF35();
15319
15344
  init_chunk_ILGGO4PT();
15320
- init_chunk_5HA6FIE7();
15321
- init_chunk_SAQNCSQ6();
15345
+ init_chunk_JJWKZHF3();
15346
+ init_chunk_RHGPANBN();
15322
15347
  init_chunk_NVKU5PPQ();
15323
- init_chunk_AIHVFCWQ();
15348
+ init_chunk_5MZZUQPD();
15324
15349
  init_chunk_FECLIZTY();
15325
15350
  init_chunk_BFG4ZWR4();
15326
15351
  init_chunk_YZAIZJTO();
15327
- init_chunk_C4EMATJL();
15352
+ init_chunk_O7IPFQTZ();
15328
15353
  init_chunk_AMG6HKUQ();
15329
15354
  init_chunk_3VHMUK4W();
15330
- init_chunk_XQBFXSYS();
15355
+ init_chunk_5BOYRUX2();
15331
15356
  init_chunk_OMPT4ZHR();
15332
15357
  init_chunk_2PZIF56U();
15333
15358
  init_chunk_UEJOG2Q7();
15334
15359
  init_chunk_KKA642DR();
15335
15360
  init_chunk_SOJMWM63();
15336
15361
  init_chunk_WEXVYJ5H();
15337
- init_chunk_C552TQHI();
15362
+ init_chunk_II4M7TXT();
15338
15363
  init_chunk_5XEJSR22();
15339
15364
  init_chunk_IBL7FANV();
15340
15365
  init_chunk_5VL6LBFD();
@@ -15347,7 +15372,7 @@ var init_contracts = __esm({
15347
15372
  init_chunk_LD6U3CDG();
15348
15373
  init_chunk_CJ3L46X6();
15349
15374
  init_chunk_6TSQ5HXC();
15350
- init_chunk_WNLWNFHH();
15375
+ init_chunk_PTYXZZTE();
15351
15376
  init_chunk_T7KQKDET();
15352
15377
  init_chunk_L5F7ZOUJ();
15353
15378
  init_chunk_Y66JOKZI();
@@ -15487,7 +15512,7 @@ var init_dist = __esm({
15487
15512
  init_chunk_KKA642DR();
15488
15513
  init_chunk_SOJMWM63();
15489
15514
  init_chunk_WEXVYJ5H();
15490
- init_chunk_C552TQHI();
15515
+ init_chunk_II4M7TXT();
15491
15516
  init_chunk_5XEJSR22();
15492
15517
  init_chunk_IBL7FANV();
15493
15518
  init_chunk_R2F7OLXZ();
@@ -15504,7 +15529,7 @@ var init_dist = __esm({
15504
15529
  init_chunk_LD6U3CDG();
15505
15530
  init_chunk_CJ3L46X6();
15506
15531
  init_chunk_6TSQ5HXC();
15507
- init_chunk_WNLWNFHH();
15532
+ init_chunk_PTYXZZTE();
15508
15533
  init_chunk_BF4WRSOQ();
15509
15534
  init_chunk_T7KQKDET();
15510
15535
  init_chunk_L5F7ZOUJ();
@@ -15576,6 +15601,9 @@ function sanitizeTerminalText(value) {
15576
15601
  ""
15577
15602
  );
15578
15603
  }
15604
+ function shownArgument(value) {
15605
+ return value === "" ? '""' : sanitizeTerminalText(value);
15606
+ }
15579
15607
  var init_terminal_output = __esm({
15580
15608
  "src/lib/terminal-output.ts"() {
15581
15609
  "use strict";
@@ -16458,8 +16486,7 @@ function isDryRunToken(arg) {
16458
16486
  return /^--dry-run(=\S*)?$/.test(arg);
16459
16487
  }
16460
16488
  function unreadRefusal(invocation, token, why) {
16461
- const shown2 = token === "" ? '""' : sanitizeTerminalText(token);
16462
- return `\`${invocation}\` does not read \`${shown2}\`${why}, so it is refused rather than run without it.`;
16489
+ return `\`${invocation}\` does not read \`${shownArgument(token)}\`${why}, so it is refused rather than run without it.`;
16463
16490
  }
16464
16491
  function unreadDryRunRefusal(invocation, token, readsBare) {
16465
16492
  return unreadRefusal(invocation, token, readsBare ? " (only a bare `--dry-run`)" : "");
@@ -19947,7 +19974,7 @@ var init_whoami = __esm({
19947
19974
  var init_constants = __esm({
19948
19975
  "../../packages/core/dist/constants.js"() {
19949
19976
  "use strict";
19950
- init_chunk_WNLWNFHH();
19977
+ init_chunk_PTYXZZTE();
19951
19978
  }
19952
19979
  });
19953
19980
 
@@ -21606,9 +21633,9 @@ function parseRoutingTokens(args2) {
21606
21633
  if (VALUE_FLAGS.has(name)) {
21607
21634
  const value = eq === -1 ? args2[i + 1] : arg.slice(eq + 1);
21608
21635
  if (value !== void 0) {
21609
- if (name === "--hub") tokens2.hubFlag ??= value;
21610
- if (name === "--base") tokens2.baseFlag ??= value;
21611
- if (name === "--community") tokens2.communityFlag ??= value;
21636
+ const subtreeFlag = SUBTREE_FLAGS.find(({ flag }) => flag === name);
21637
+ if (subtreeFlag && tokens2[subtreeFlag.token] !== void 0) (tokens2.extraFlags ??= []).push({ flag: name, value });
21638
+ else if (subtreeFlag) tokens2[subtreeFlag.token] = value;
21612
21639
  if (name === "--org") tokens2.orgFlag ??= value;
21613
21640
  if (eq === -1) {
21614
21641
  const taken = value.split("=")[0];
@@ -21621,10 +21648,29 @@ function parseRoutingTokens(args2) {
21621
21648
  continue;
21622
21649
  }
21623
21650
  if (arg.startsWith("-")) continue;
21624
- tokens2.positional ??= arg;
21651
+ if (tokens2.positional === void 0) tokens2.positional = arg;
21652
+ else (tokens2.extraPositionals ??= []).push(arg);
21625
21653
  }
21626
21654
  return tokens2;
21627
21655
  }
21656
+ function repeatedFlagWithNoTargetRefusal(verb, tokens2) {
21657
+ const repeated = SUBTREE_FLAGS.find(
21658
+ ({ flag, token }) => tokens2.trailingFlag === flag && tokens2[token] !== void 0 || tokens2.extraFlags?.some((extra) => extra.flag === flag && (extra.value === "" || extra.value.startsWith("-"))) === true
21659
+ );
21660
+ return repeated ? `\`wayai ${verb} ${repeated.flag}\` was typed again with no target after it, so it is refused rather than run on the first one alone: name one target per run.` : null;
21661
+ }
21662
+ function extraTargetRefusal(verb, tokens2) {
21663
+ const flag = SUBTREE_FLAGS.find(({ token }) => tokens2[token] !== void 0);
21664
+ const named = [
21665
+ ...flag ? [`${flag.flag} ${shownArgument(tokens2[flag.token])}`] : [],
21666
+ ...(tokens2.extraFlags ?? []).map(({ flag: extra, value }) => `${extra} ${shownArgument(value)}`),
21667
+ ...tokens2.positional !== void 0 ? [shownArgument(tokens2.positional)] : [],
21668
+ ...(tokens2.extraPositionals ?? []).map(shownArgument)
21669
+ ];
21670
+ if (named.length < 2) return null;
21671
+ const listed2 = `${named.slice(0, -1).map((t) => `\`${t}\``).join(", ")} and \`${named[named.length - 1]}\``;
21672
+ return `\`wayai ${verb}\` acts on one target, and was given ${named.length}: ${listed2}. It is refused rather than run on one of them alone: name one target per run.`;
21673
+ }
21628
21674
  function firstSegment(p) {
21629
21675
  const normalized = p.split(path20.sep).join("/");
21630
21676
  const [head] = normalized.split("/").filter(Boolean);
@@ -21744,6 +21790,8 @@ function routeToSubtree(options) {
21744
21790
  refusal: `\`wayai ${verb} ${by}\` took \`${flag2}\` as its value, so \`${flag2}\` is not read. Give ${by} a value, or leave it out.`
21745
21791
  };
21746
21792
  }
21793
+ const repeated = repeatedFlagWithNoTargetRefusal(verb, tokens2);
21794
+ if (repeated) return { ok: false, refusal: repeated };
21747
21795
  const empty = SUBTREE_FLAGS.find(({ flag: flag2, token }) => tokens2[token] === "" || tokens2.trailingFlag === flag2);
21748
21796
  if (empty) {
21749
21797
  return {
@@ -21781,15 +21829,15 @@ function routeToSubtree(options) {
21781
21829
  };
21782
21830
  }
21783
21831
  const [flag] = flagged;
21784
- if (flag) {
21785
- if (fromPositional && fromPositional.kind !== "unknown" && fromPositional.kind !== flag.subtree) {
21786
- return {
21787
- ok: false,
21788
- refusal: mixedInvocationRefusal(verb, [flag, { subtree: fromPositional.kind, target: fromPositional.target }])
21789
- };
21790
- }
21791
- return { ok: true, subtree: flag.subtree, selector: flag.target };
21832
+ if (flag && fromPositional && fromPositional.kind !== "unknown" && fromPositional.kind !== flag.subtree) {
21833
+ return {
21834
+ ok: false,
21835
+ refusal: mixedInvocationRefusal(verb, [flag, { subtree: fromPositional.kind, target: fromPositional.target }])
21836
+ };
21792
21837
  }
21838
+ const extra = extraTargetRefusal(verb, tokens2);
21839
+ if (extra) return { ok: false, refusal: extra };
21840
+ if (flag) return { ok: true, subtree: flag.subtree, selector: flag.target };
21793
21841
  if (fromPositional && fromPositional.kind !== "unknown") {
21794
21842
  return { ok: true, subtree: fromPositional.kind, selector: fromPositional.target };
21795
21843
  }
@@ -26665,18 +26713,24 @@ import * as fs23 from "fs";
26665
26713
  import * as path31 from "path";
26666
26714
  function parseArgs10(args2) {
26667
26715
  let label;
26668
- let hubSelector;
26716
+ let hubFlag;
26717
+ let positional;
26669
26718
  for (let i = 0; i < args2.length; i++) {
26670
26719
  const arg = args2[i];
26671
26720
  if (arg === "--label") {
26672
26721
  label = args2[++i];
26673
26722
  } else if (arg === "--hub" && args2[i + 1]) {
26674
- hubSelector = args2[++i];
26675
- } else if (!arg.startsWith("-") && hubSelector === void 0) {
26676
- hubSelector = arg;
26723
+ hubFlag = args2[++i];
26724
+ } else if (!arg.startsWith("-") && positional === void 0) {
26725
+ positional = arg;
26677
26726
  }
26678
26727
  }
26679
- return { label, hubSelector };
26728
+ if (hubFlag !== void 0 && positional !== void 0) {
26729
+ throw expected(
26730
+ `\`wayai replicate\` clones one hub, and was given 2: \`--hub ${shownArgument(hubFlag)}\` and \`${shownArgument(positional)}\`. It is refused rather than clone one of them alone: name the source hub once.`
26731
+ );
26732
+ }
26733
+ return { label, hubSelector: hubFlag ?? positional };
26680
26734
  }
26681
26735
  async function replicateCommand(args2) {
26682
26736
  const { label, hubSelector } = parseArgs10(args2);
@@ -26737,6 +26791,8 @@ var init_replicate = __esm({
26737
26791
  "src/commands/replicate.ts"() {
26738
26792
  "use strict";
26739
26793
  init_auth();
26794
+ init_expected();
26795
+ init_terminal_output();
26740
26796
  init_api_client();
26741
26797
  init_hub_materializer();
26742
26798
  init_resource_files();
@@ -26753,6 +26809,7 @@ var init_replicate = __esm({
26753
26809
  // src/commands/relabel.ts
26754
26810
  var relabel_exports = {};
26755
26811
  __export(relabel_exports, {
26812
+ parseArgs: () => parseArgs11,
26756
26813
  relabelCommand: () => relabelCommand
26757
26814
  });
26758
26815
  import * as path32 from "path";
@@ -26770,6 +26827,11 @@ function parseArgs11(args2) {
26770
26827
  label = arg;
26771
26828
  }
26772
26829
  }
26830
+ if (clear && label !== void 0) {
26831
+ throw expected(
26832
+ `\`wayai relabel\` was given both a label (\`${shownArgument(label)}\`) and \`--clear\`, which removes the label. It is refused rather than run on one of them alone: give the label or \`--clear\`, not both.`
26833
+ );
26834
+ }
26773
26835
  return { label, clear, hubSelector };
26774
26836
  }
26775
26837
  async function relabelCommand(args2) {
@@ -26831,6 +26893,8 @@ var init_relabel = __esm({
26831
26893
  "src/commands/relabel.ts"() {
26832
26894
  "use strict";
26833
26895
  init_auth();
26896
+ init_expected();
26897
+ init_terminal_output();
26834
26898
  init_api_client();
26835
26899
  init_yaml_writer();
26836
26900
  init_push();
@@ -27017,7 +27081,8 @@ function isValuedFlag(token) {
27017
27081
  return token.includes("=");
27018
27082
  }
27019
27083
  function resolveScopeSelector(verb, args2) {
27020
- const { hubFlag, baseFlag, communityFlag, positional } = parseRoutingTokens(args2);
27084
+ const tokens2 = parseRoutingTokens(args2);
27085
+ const { hubFlag, baseFlag, communityFlag, positional } = tokens2;
27021
27086
  const flagged = subtreeFlags({ hubFlag, baseFlag, communityFlag });
27022
27087
  if (flagged.length > 1) {
27023
27088
  throw expected(mixedInvocationRefusal(verb, flagged));
@@ -27028,6 +27093,12 @@ function resolveScopeSelector(verb, args2) {
27028
27093
  assertFlagWasGivenAValue(verb, "--hub", args2, hubFlag);
27029
27094
  assertFlagWasGivenAValue(verb, "--base", args2, baseFlag);
27030
27095
  assertFlagWasGivenAValue(verb, "--community", args2, communityFlag);
27096
+ const repeated = repeatedFlagWithNoTargetRefusal(verb, tokens2);
27097
+ if (repeated) throw expected(repeated);
27098
+ const extra = extraTargetRefusal(verb, tokens2);
27099
+ if (extra) {
27100
+ throw expected(verb === "use" ? `${extra} To scope several, add each with \`wayai use --add <selector>\`.` : extra);
27101
+ }
27031
27102
  const [flag] = flagged;
27032
27103
  if (flag) return { axis: flag.subtree, target: flag.target, gitRoot: findGitRoot() };
27033
27104
  if (positional === void 0) return null;
@@ -28772,6 +28843,9 @@ var init_sync_mcp = __esm({
28772
28843
  });
28773
28844
 
28774
28845
  // src/lib/sql-output.ts
28846
+ function queryWithSchemaRefusal(invocation) {
28847
+ return `\`${invocation}\` was given both a query and \`--schema\`, which lists the columns instead of running one. It is refused rather than run on one of them alone: give the query or \`--schema\`, not both.`;
28848
+ }
28775
28849
  function printQueryRows(rows) {
28776
28850
  if (rows.length === 0) {
28777
28851
  console.log("(no rows)");
@@ -28865,8 +28939,6 @@ async function evalsListCommand(args2) {
28865
28939
  }
28866
28940
  async function evalsSqlSubcommand(args2) {
28867
28941
  const hubId = resolveActiveHubId(args2);
28868
- const { config, accessToken } = await requireAuth();
28869
- requireRepoConfig();
28870
28942
  let sql;
28871
28943
  let limit;
28872
28944
  let jsonOutput = false;
@@ -28886,6 +28958,12 @@ async function evalsSqlSubcommand(args2) {
28886
28958
  process.exit(1);
28887
28959
  }
28888
28960
  }
28961
+ if (schemaOnly && sql !== void 0) {
28962
+ console.error(queryWithSchemaRefusal("wayai evals sql"));
28963
+ process.exit(1);
28964
+ }
28965
+ const { config, accessToken } = await requireAuth();
28966
+ requireRepoConfig();
28889
28967
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
28890
28968
  if (schemaOnly) {
28891
28969
  const schema = await client.getEvalsSqlSchema(hubId);
@@ -32173,8 +32251,6 @@ async function analyticsQuerySubcommand(args2) {
32173
32251
  }
32174
32252
  async function analyticsSqlSubcommand(args2) {
32175
32253
  const hubId = resolveActiveHubId(args2);
32176
- const { config, accessToken } = await requireAuth();
32177
- requireRepoConfig();
32178
32254
  let sql;
32179
32255
  let limit;
32180
32256
  let jsonOutput = false;
@@ -32194,6 +32270,12 @@ async function analyticsSqlSubcommand(args2) {
32194
32270
  process.exit(1);
32195
32271
  }
32196
32272
  }
32273
+ if (schemaOnly && sql !== void 0) {
32274
+ console.error(queryWithSchemaRefusal("wayai analytics sql"));
32275
+ process.exit(1);
32276
+ }
32277
+ const { config, accessToken } = await requireAuth();
32278
+ requireRepoConfig();
32197
32279
  const client = new ApiClient({ apiUrl: config.api_url, accessToken });
32198
32280
  if (schemaOnly) {
32199
32281
  const [conversation, message] = await Promise.all([