@wayai/cli 0.3.327 → 0.3.329

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
@@ -5104,99 +5104,6 @@ var init_fs_safety = __esm({
5104
5104
  }
5105
5105
  });
5106
5106
 
5107
- // ../../packages/core/dist/chunk-YVY2TZK2.js
5108
- var orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody;
5109
- var init_chunk_YVY2TZK2 = __esm({
5110
- "../../packages/core/dist/chunk-YVY2TZK2.js"() {
5111
- "use strict";
5112
- init_zod();
5113
- orgResourceIdParam = external_exports.object({
5114
- id: external_exports.string().uuid()
5115
- });
5116
- orgResourceFileIdParam = external_exports.object({
5117
- file_id: external_exports.string().uuid()
5118
- });
5119
- orgResourceFolderIdParam = external_exports.object({
5120
- folder_id: external_exports.string().uuid()
5121
- });
5122
- hubOrgResourceParam = external_exports.object({
5123
- id: external_exports.string().uuid(),
5124
- org_resource_id: external_exports.string().uuid()
5125
- });
5126
- listOrgResourcesQuery = external_exports.object({
5127
- organization_id: external_exports.string().uuid(),
5128
- hub_id: external_exports.string().uuid().optional()
5129
- });
5130
- orgIdQuery = external_exports.object({
5131
- organization_id: external_exports.string().uuid()
5132
- });
5133
- createOrgResourceBody = external_exports.object({
5134
- organization_id: external_exports.string().uuid(),
5135
- resource_name: external_exports.string().min(1).max(255),
5136
- resource_description: external_exports.string().max(1e3).nullish(),
5137
- // Required (validated in the route layer, which names the field, since a refinement here
5138
- // complicates the inferred input type for callers).
5139
- skill_name: external_exports.string().min(1).max(255).nullish(),
5140
- skill_version: external_exports.string().max(50).nullish(),
5141
- enabled: external_exports.boolean().optional(),
5142
- tags: external_exports.array(external_exports.string().uuid()).optional(),
5143
- environment: external_exports.enum(["preview", "production", "all"]).optional()
5144
- });
5145
- updateOrgResourceBody = external_exports.object({
5146
- resource_name: external_exports.string().min(1).max(255).optional(),
5147
- resource_description: external_exports.string().max(1e3).nullish(),
5148
- skill_name: external_exports.string().min(1).max(255).nullish(),
5149
- skill_version: external_exports.string().max(50).nullish(),
5150
- enabled: external_exports.boolean().optional(),
5151
- tags: external_exports.array(external_exports.string().uuid()).optional(),
5152
- environment: external_exports.enum(["preview", "production", "all"]).optional()
5153
- });
5154
- createOrgResourceFolderBody = external_exports.object({
5155
- org_resource_id: external_exports.string().uuid(),
5156
- folder_name: external_exports.string().min(1).max(255),
5157
- folder_description: external_exports.string().max(1e3).nullish(),
5158
- parent_folder_id: external_exports.string().uuid().nullish(),
5159
- order_index: external_exports.number().int().nonnegative().optional(),
5160
- enabled: external_exports.boolean().optional(),
5161
- metadata: external_exports.record(external_exports.unknown()).optional()
5162
- });
5163
- updateOrgResourceFolderBody = external_exports.object({
5164
- folder_name: external_exports.string().min(1).max(255).optional(),
5165
- folder_description: external_exports.string().max(1e3).nullish(),
5166
- parent_folder_id: external_exports.string().uuid().nullish(),
5167
- order_index: external_exports.number().int().nonnegative().optional(),
5168
- enabled: external_exports.boolean().optional(),
5169
- metadata: external_exports.record(external_exports.unknown()).optional()
5170
- });
5171
- uploadOrgResourceFileBody = external_exports.object({
5172
- org_resource_id: external_exports.string().uuid(),
5173
- folder_id: external_exports.string().uuid().nullish(),
5174
- file_name: external_exports.string().min(1).max(255),
5175
- file_data: external_exports.string(),
5176
- // base64
5177
- mime_type: external_exports.string().optional(),
5178
- file_size: external_exports.number().int().nonnegative().optional(),
5179
- resource_file_tags: external_exports.array(external_exports.string()).optional(),
5180
- metadata: external_exports.record(external_exports.unknown()).optional()
5181
- });
5182
- updateOrgResourceFileBody = external_exports.object({
5183
- resource_file_title: external_exports.string().min(1).max(255).optional(),
5184
- folder_id: external_exports.string().uuid().nullish(),
5185
- order_index: external_exports.number().int().nonnegative().optional(),
5186
- enabled: external_exports.boolean().optional(),
5187
- resource_file_tags: external_exports.array(external_exports.string()).optional(),
5188
- metadata: external_exports.record(external_exports.unknown()).optional()
5189
- });
5190
- uploadOrgSkillZipBody = external_exports.object({
5191
- zip_data: external_exports.string().min(1),
5192
- replace_existing: external_exports.boolean().optional()
5193
- });
5194
- linkOrgResourceBody = external_exports.object({
5195
- org_resource_id: external_exports.string().uuid()
5196
- });
5197
- }
5198
- });
5199
-
5200
5107
  // ../../packages/core/dist/chunk-VXEAR36B.js
5201
5108
  var orgTagIdParam, listOrgTagsQuery, ORG_TAG_NAME_REGEX, ORG_TAG_NAME_MAX_LENGTH, createOrgTagBody, updateOrgTagBody;
5202
5109
  var init_chunk_VXEAR36B = __esm({
@@ -5479,6 +5386,93 @@ var init_chunk_Q7KIQHAZ = __esm({
5479
5386
  }
5480
5387
  });
5481
5388
 
5389
+ // ../../packages/core/dist/chunk-IPXBFWUU.js
5390
+ var variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody;
5391
+ var init_chunk_IPXBFWUU = __esm({
5392
+ "../../packages/core/dist/chunk-IPXBFWUU.js"() {
5393
+ "use strict";
5394
+ init_chunk_6TSQ5HXC();
5395
+ init_zod();
5396
+ variantAiModeSchema = external_exports.enum(["pilot+copilot", "pilot", "copilot", "turned_off"]);
5397
+ experimentStatusSchema = external_exports.enum(["draft", "running", "stopped"]);
5398
+ overlayUpdateSchema = external_exports.record(external_exports.unknown()).nullish().transform((v) => v === void 0 ? void 0 : v && Object.keys(v).length > 0 ? v : null);
5399
+ experimentIdParam = external_exports.object({
5400
+ id: external_exports.string().uuid()
5401
+ });
5402
+ variantIdParam = external_exports.object({
5403
+ id: external_exports.string().uuid()
5404
+ });
5405
+ listExperimentsQuery = external_exports.object({
5406
+ hub_id: external_exports.string().uuid()
5407
+ });
5408
+ listVariantsQuery = external_exports.object({
5409
+ hub_id: external_exports.string().uuid(),
5410
+ experiment_id: external_exports.string().uuid().optional()
5411
+ });
5412
+ listOverridesQuery = external_exports.object({
5413
+ hub_id: external_exports.string().uuid(),
5414
+ variant_id: external_exports.string().uuid()
5415
+ });
5416
+ deleteOverrideQuery = external_exports.object({
5417
+ hub_id: external_exports.string().uuid(),
5418
+ variant_id: external_exports.string().uuid(),
5419
+ agent_id: external_exports.string().uuid()
5420
+ });
5421
+ createExperimentBody = external_exports.object({
5422
+ hub_id: external_exports.string().uuid(),
5423
+ experiment_slug: slugSchema.optional(),
5424
+ experiment_name: external_exports.string().min(1, "experiment_name is required").max(100, "experiment_name must be 100 characters or fewer"),
5425
+ primary_metric: external_exports.string().max(200).nullish(),
5426
+ status: experimentStatusSchema.default("draft")
5427
+ });
5428
+ updateExperimentBody = external_exports.object({
5429
+ // experiment_slug is immutable after first persist — not accepted here.
5430
+ experiment_name: external_exports.string().min(1).max(100).optional(),
5431
+ primary_metric: external_exports.string().max(200).nullish(),
5432
+ control_variant_id: external_exports.string().uuid().nullish()
5433
+ });
5434
+ setExperimentStatusBody = external_exports.object({
5435
+ status: experimentStatusSchema
5436
+ });
5437
+ createVariantBody = external_exports.object({
5438
+ hub_id: external_exports.string().uuid(),
5439
+ experiment_id: external_exports.string().uuid(),
5440
+ label: external_exports.string().min(1, "label is required").max(100, "label must be 100 characters or fewer"),
5441
+ weight: external_exports.number().positive().default(1),
5442
+ ai_mode: variantAiModeSchema.nullish(),
5443
+ is_control: external_exports.boolean().default(false)
5444
+ });
5445
+ updateVariantBody = external_exports.object({
5446
+ label: external_exports.string().min(1).max(100).optional(),
5447
+ weight: external_exports.number().positive().optional(),
5448
+ ai_mode: variantAiModeSchema.nullish(),
5449
+ is_control: external_exports.boolean().optional()
5450
+ });
5451
+ upsertOverrideBody = external_exports.object({
5452
+ hub_id: external_exports.string().uuid(),
5453
+ variant_id: external_exports.string().uuid(),
5454
+ agent_id: external_exports.string().uuid(),
5455
+ instructions: external_exports.string().nullish(),
5456
+ additional_context_template: external_exports.string().nullish(),
5457
+ connection_id: external_exports.string().uuid().nullish(),
5458
+ agent_settings_overlay: overlayUpdateSchema
5459
+ });
5460
+ }
5461
+ });
5462
+
5463
+ // ../../packages/core/dist/chunk-AYLAGFAD.js
5464
+ var BASE_CREDENTIAL_NAME_MAX, BASE_CREDENTIAL_NAME_PATTERN, BASE_CREDENTIAL_NAME_CHARSET, baseCredentialNameSchema;
5465
+ var init_chunk_AYLAGFAD = __esm({
5466
+ "../../packages/core/dist/chunk-AYLAGFAD.js"() {
5467
+ "use strict";
5468
+ init_zod();
5469
+ BASE_CREDENTIAL_NAME_MAX = 100;
5470
+ BASE_CREDENTIAL_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:@+~=-]*$/;
5471
+ BASE_CREDENTIAL_NAME_CHARSET = "letters, digits and '. _ : @ + ~ = -', starting with a letter or digit";
5472
+ baseCredentialNameSchema = external_exports.string().min(1).max(BASE_CREDENTIAL_NAME_MAX).regex(BASE_CREDENTIAL_NAME_PATTERN, `name must use ${BASE_CREDENTIAL_NAME_CHARSET}`);
5473
+ }
5474
+ });
5475
+
5482
5476
  // ../../packages/core/dist/chunk-MIWZOSPI.js
5483
5477
  function toIso(epochMs) {
5484
5478
  return new Date(epochMs).toISOString();
@@ -5509,10 +5503,249 @@ var init_chunk_MF2VVXBR = __esm({
5509
5503
  }
5510
5504
  });
5511
5505
 
5512
- // ../../packages/core/dist/chunk-LHTWT6HS.js
5513
- var REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, REKOR_V1_PREFIX, REKOR_LIFECYCLE_PREFIX, REKOR_BASE_VAULT_DRY_RUN_PATH, REKOR_S3_CREDENTIAL_COUNT_PATH, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, REKOR_BOUND_BASE_HEADER, REKOR_BOUND_TOOLSET_HEADER, REKOR_BOUND_TOKEN_HEADER, REKOR_BOUND_ACCESS_HEADER, REKOR_BOUND_PAGE_HEADER, REKOR_BOUND_PERSON_HEADER, REKOR_BOUND_CAPABILITY_HEADER, REKOR_BOUND_CAPABILITY_SEED, REKOR_PERSON_AUDIENCE_STAFF, REKOR_PERSON_AUDIENCE_CUSTOMER, REKOR_PERSON_ALL, DATA_BASE_GENERATION_HEADER, REKOR_MAX_ACTOR_ID_LENGTH, REKOR_MAX_ACTOR_LABEL_LENGTH, REKOR_MAX_ACCESS_DIMENSIONS, REKOR_MAX_ACCESS_VALUES, REKOR_MAX_ACCESS_ID_LENGTH, REKOR_MAX_ACCESS_HEADER_LENGTH, REKOR_MAX_PERSON_PARTIES, REKOR_MAX_PERSON_IDS, REKOR_MAX_PERSON_ID_LENGTH, REKOR_MAX_PERSON_HEADER_LENGTH;
5514
- var init_chunk_LHTWT6HS = __esm({
5515
- "../../packages/core/dist/chunk-LHTWT6HS.js"() {
5506
+ // ../../packages/core/dist/chunk-ZTNFLGW5.js
5507
+ function normalizeAuthType(raw) {
5508
+ if (VALID_AUTH_TYPES.has(raw)) return raw;
5509
+ return LEGACY_AUTH_TYPE_MAP[raw] ?? raw;
5510
+ }
5511
+ function isCustomerFacingAgentRole(role) {
5512
+ return typeof role === "string" && CUSTOMER_FACING_AGENT_ROLES.includes(role);
5513
+ }
5514
+ 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, AGENT_ROLE_DISPLAY, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SKILL_INSTALL_COMMAND, CASE_TYPE_ABBREVIATION_PATTERN;
5515
+ var init_chunk_ZTNFLGW5 = __esm({
5516
+ "../../packages/core/dist/chunk-ZTNFLGW5.js"() {
5517
+ "use strict";
5518
+ AUTH_TYPE = {
5519
+ OAUTH: "oauth",
5520
+ API_KEY: "api_key",
5521
+ BASIC_AUTH: "basic_auth",
5522
+ BEARER: "bearer",
5523
+ NONE: "none"
5524
+ };
5525
+ ORG_CREDENTIAL_AUTH_TYPES = [
5526
+ AUTH_TYPE.API_KEY,
5527
+ AUTH_TYPE.BEARER,
5528
+ AUTH_TYPE.BASIC_AUTH
5529
+ ];
5530
+ AUTH_TYPE_DISPLAY = {
5531
+ [AUTH_TYPE.OAUTH]: "OAuth",
5532
+ [AUTH_TYPE.API_KEY]: "API Key",
5533
+ [AUTH_TYPE.BASIC_AUTH]: "Basic Auth",
5534
+ [AUTH_TYPE.BEARER]: "Bearer Token",
5535
+ [AUTH_TYPE.NONE]: "No Authentication"
5536
+ };
5537
+ LEGACY_AUTH_TYPE_MAP = {
5538
+ "OAuth": AUTH_TYPE.OAUTH,
5539
+ "API Key": AUTH_TYPE.API_KEY,
5540
+ "Basic Auth": AUTH_TYPE.BASIC_AUTH,
5541
+ "Bearer Token": AUTH_TYPE.BEARER,
5542
+ "No authentication": AUTH_TYPE.NONE,
5543
+ // Also handle the old DISPLAY_TO_CODE bug where 'basic' was used instead of 'basic_auth'
5544
+ "basic": AUTH_TYPE.BASIC_AUTH
5545
+ };
5546
+ VALID_AUTH_TYPES = new Set(Object.values(AUTH_TYPE));
5547
+ AGENT_ROLES = [
5548
+ "pilot",
5549
+ "copilot",
5550
+ "pilot_specialist",
5551
+ "copilot_specialist",
5552
+ "pilot_advisor",
5553
+ "copilot_advisor",
5554
+ "monitor",
5555
+ "conversation_evaluator",
5556
+ "message_evaluator",
5557
+ "summarizer",
5558
+ "consultant",
5559
+ "pilot_voice"
5560
+ ];
5561
+ PILOT_TRACK_ROLES = ["pilot", "pilot_specialist"];
5562
+ COPILOT_TRACK_ROLES = ["copilot", "copilot_specialist"];
5563
+ CUSTOMER_FACING_AGENT_ROLES = [...PILOT_TRACK_ROLES, "pilot_advisor"];
5564
+ AGENT_ROLE_DISPLAY = {
5565
+ pilot: "Pilot",
5566
+ copilot: "Copilot",
5567
+ pilot_specialist: "Pilot Specialist",
5568
+ copilot_specialist: "Copilot Specialist",
5569
+ pilot_advisor: "Pilot Advisor",
5570
+ copilot_advisor: "Copilot Advisor",
5571
+ monitor: "Monitor",
5572
+ conversation_evaluator: "Conversation Evaluator",
5573
+ message_evaluator: "Message Evaluator",
5574
+ summarizer: "Summarizer",
5575
+ consultant: "Consultant",
5576
+ pilot_voice: "Pilot Voice"
5577
+ };
5578
+ SAFE_USER_ID_REGEX = /^[A-Za-z0-9_-]{1,64}$/;
5579
+ SUPPORTED_LOCALES = ["en", "pt", "es"];
5580
+ SKILL_INSTALL_COMMAND = "mkdir -p .claude && npx skills add wayai-pro/wayai-skill -y";
5581
+ CASE_TYPE_ABBREVIATION_PATTERN = /^[A-Z]{2,6}$/;
5582
+ }
5583
+ });
5584
+
5585
+ // ../../packages/core/dist/chunk-DSKOMKRY.js
5586
+ var orgCredentialIdParam, listOrgCredentialsQuery, ORG_CREDENTIAL_SERVICE_REQUIRED, createOrgCredentialBody, updateOrgCredentialBody;
5587
+ var init_chunk_DSKOMKRY = __esm({
5588
+ "../../packages/core/dist/chunk-DSKOMKRY.js"() {
5589
+ "use strict";
5590
+ init_chunk_MF2VVXBR();
5591
+ init_chunk_ZTNFLGW5();
5592
+ init_zod();
5593
+ orgCredentialIdParam = external_exports.object({
5594
+ id: external_exports.string().uuid()
5595
+ });
5596
+ listOrgCredentialsQuery = external_exports.object({
5597
+ organization_id: external_exports.string().uuid(),
5598
+ hub_id: external_exports.string().uuid().optional()
5599
+ });
5600
+ ORG_CREDENTIAL_SERVICE_REQUIRED = "An organization credential must name the service it is for (connector_id): pick its Service in the console, or run `wayai create-credential --service <name>`, updating the WayAI CLI first if it has no --service. Nothing was created.";
5601
+ createOrgCredentialBody = external_exports.object({
5602
+ organization_id: external_exports.string().uuid(),
5603
+ credential_display_name: external_exports.string().min(1).max(255),
5604
+ credential_description: external_exports.string().max(1e3).nullish(),
5605
+ authentication_type: external_exports.enum(["api_key", "bearer", "basic_auth"]).or(
5606
+ external_exports.enum(["API Key", "Bearer Token", "Basic Auth"]).transform((v) => normalizeAuthType(v))
5607
+ ),
5608
+ api_key: external_exports.string().optional(),
5609
+ access_token: external_exports.string().optional(),
5610
+ username: external_exports.string().optional(),
5611
+ password: external_exports.string().optional(),
5612
+ tags: external_exports.array(external_exports.string().uuid()).optional(),
5613
+ environment: external_exports.enum(["preview", "production", "all"]).optional(),
5614
+ expires_at: credentialExpiresAtSchema.optional(),
5615
+ /**
5616
+ * The service the credential is for: a catalog `connector_id` (wayai#5644). Required (owner decision Q2): its value goes
5617
+ * to the credentials vault under that connector, and a credential naming none had nowhere there to go. It links only to
5618
+ * connections of that service, and is fixed for the credential's life. A connector whose host the customer types (REST
5619
+ * API, External Resources, MCP Server) is refused: its value is entered on the connection. A client that sends none (a
5620
+ * CLI from before `--service`) is refused with {@link ORG_CREDENTIAL_SERVICE_REQUIRED}.
5621
+ */
5622
+ connector_id: external_exports.string({ required_error: ORG_CREDENTIAL_SERVICE_REQUIRED }).uuid()
5623
+ });
5624
+ updateOrgCredentialBody = external_exports.object({
5625
+ credential_display_name: external_exports.string().min(1).max(255).optional(),
5626
+ credential_description: external_exports.string().max(1e3).nullish(),
5627
+ api_key: external_exports.string().optional(),
5628
+ access_token: external_exports.string().optional(),
5629
+ username: external_exports.string().optional(),
5630
+ password: external_exports.string().optional(),
5631
+ tags: external_exports.array(external_exports.string().uuid()).optional(),
5632
+ environment: external_exports.enum(["preview", "production", "all"]).optional(),
5633
+ // Absent keeps the stored date, unless the request stores a new secret, which clears it.
5634
+ expires_at: credentialExpiresAtSchema.optional()
5635
+ });
5636
+ }
5637
+ });
5638
+
5639
+ // ../../packages/core/dist/chunk-YVY2TZK2.js
5640
+ var orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody;
5641
+ var init_chunk_YVY2TZK2 = __esm({
5642
+ "../../packages/core/dist/chunk-YVY2TZK2.js"() {
5643
+ "use strict";
5644
+ init_zod();
5645
+ orgResourceIdParam = external_exports.object({
5646
+ id: external_exports.string().uuid()
5647
+ });
5648
+ orgResourceFileIdParam = external_exports.object({
5649
+ file_id: external_exports.string().uuid()
5650
+ });
5651
+ orgResourceFolderIdParam = external_exports.object({
5652
+ folder_id: external_exports.string().uuid()
5653
+ });
5654
+ hubOrgResourceParam = external_exports.object({
5655
+ id: external_exports.string().uuid(),
5656
+ org_resource_id: external_exports.string().uuid()
5657
+ });
5658
+ listOrgResourcesQuery = external_exports.object({
5659
+ organization_id: external_exports.string().uuid(),
5660
+ hub_id: external_exports.string().uuid().optional()
5661
+ });
5662
+ orgIdQuery = external_exports.object({
5663
+ organization_id: external_exports.string().uuid()
5664
+ });
5665
+ createOrgResourceBody = external_exports.object({
5666
+ organization_id: external_exports.string().uuid(),
5667
+ resource_name: external_exports.string().min(1).max(255),
5668
+ resource_description: external_exports.string().max(1e3).nullish(),
5669
+ // Required (validated in the route layer, which names the field, since a refinement here
5670
+ // complicates the inferred input type for callers).
5671
+ skill_name: external_exports.string().min(1).max(255).nullish(),
5672
+ skill_version: external_exports.string().max(50).nullish(),
5673
+ enabled: external_exports.boolean().optional(),
5674
+ tags: external_exports.array(external_exports.string().uuid()).optional(),
5675
+ environment: external_exports.enum(["preview", "production", "all"]).optional()
5676
+ });
5677
+ updateOrgResourceBody = external_exports.object({
5678
+ resource_name: external_exports.string().min(1).max(255).optional(),
5679
+ resource_description: external_exports.string().max(1e3).nullish(),
5680
+ skill_name: external_exports.string().min(1).max(255).nullish(),
5681
+ skill_version: external_exports.string().max(50).nullish(),
5682
+ enabled: external_exports.boolean().optional(),
5683
+ tags: external_exports.array(external_exports.string().uuid()).optional(),
5684
+ environment: external_exports.enum(["preview", "production", "all"]).optional()
5685
+ });
5686
+ createOrgResourceFolderBody = external_exports.object({
5687
+ org_resource_id: external_exports.string().uuid(),
5688
+ folder_name: external_exports.string().min(1).max(255),
5689
+ folder_description: external_exports.string().max(1e3).nullish(),
5690
+ parent_folder_id: external_exports.string().uuid().nullish(),
5691
+ order_index: external_exports.number().int().nonnegative().optional(),
5692
+ enabled: external_exports.boolean().optional(),
5693
+ metadata: external_exports.record(external_exports.unknown()).optional()
5694
+ });
5695
+ updateOrgResourceFolderBody = external_exports.object({
5696
+ folder_name: external_exports.string().min(1).max(255).optional(),
5697
+ folder_description: external_exports.string().max(1e3).nullish(),
5698
+ parent_folder_id: external_exports.string().uuid().nullish(),
5699
+ order_index: external_exports.number().int().nonnegative().optional(),
5700
+ enabled: external_exports.boolean().optional(),
5701
+ metadata: external_exports.record(external_exports.unknown()).optional()
5702
+ });
5703
+ uploadOrgResourceFileBody = external_exports.object({
5704
+ org_resource_id: external_exports.string().uuid(),
5705
+ folder_id: external_exports.string().uuid().nullish(),
5706
+ file_name: external_exports.string().min(1).max(255),
5707
+ file_data: external_exports.string(),
5708
+ // base64
5709
+ mime_type: external_exports.string().optional(),
5710
+ file_size: external_exports.number().int().nonnegative().optional(),
5711
+ resource_file_tags: external_exports.array(external_exports.string()).optional(),
5712
+ metadata: external_exports.record(external_exports.unknown()).optional()
5713
+ });
5714
+ updateOrgResourceFileBody = external_exports.object({
5715
+ resource_file_title: external_exports.string().min(1).max(255).optional(),
5716
+ folder_id: external_exports.string().uuid().nullish(),
5717
+ order_index: external_exports.number().int().nonnegative().optional(),
5718
+ enabled: external_exports.boolean().optional(),
5719
+ resource_file_tags: external_exports.array(external_exports.string()).optional(),
5720
+ metadata: external_exports.record(external_exports.unknown()).optional()
5721
+ });
5722
+ uploadOrgSkillZipBody = external_exports.object({
5723
+ zip_data: external_exports.string().min(1),
5724
+ replace_existing: external_exports.boolean().optional()
5725
+ });
5726
+ linkOrgResourceBody = external_exports.object({
5727
+ org_resource_id: external_exports.string().uuid()
5728
+ });
5729
+ }
5730
+ });
5731
+
5732
+ // ../../packages/core/dist/chunk-HIGKBEPF.js
5733
+ var accessExplainQuery;
5734
+ var init_chunk_HIGKBEPF = __esm({
5735
+ "../../packages/core/dist/chunk-HIGKBEPF.js"() {
5736
+ "use strict";
5737
+ init_chunk_HZ6CADSY();
5738
+ init_zod();
5739
+ accessExplainQuery = external_exports.object({
5740
+ user_id: external_exports.string().regex(USER_ID_REGEX).optional()
5741
+ });
5742
+ }
5743
+ });
5744
+
5745
+ // ../../packages/core/dist/chunk-AHISKXHA.js
5746
+ var REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, REKOR_BOUND_BASE_HEADER, REKOR_BOUND_TOOLSET_HEADER, REKOR_BOUND_TOKEN_HEADER, REKOR_BOUND_ACCESS_HEADER, REKOR_BOUND_PAGE_HEADER, REKOR_BOUND_PERSON_HEADER, REKOR_BOUND_CAPABILITY_HEADER, REKOR_BOUND_CAPABILITY_SEED, REKOR_PERSON_AUDIENCE_STAFF, REKOR_PERSON_AUDIENCE_CUSTOMER, REKOR_PERSON_ALL, DATA_BASE_GENERATION_HEADER, REKOR_MAX_ACTOR_ID_LENGTH, REKOR_MAX_ACTOR_LABEL_LENGTH, REKOR_MAX_ACCESS_DIMENSIONS, REKOR_MAX_ACCESS_VALUES, REKOR_MAX_ACCESS_ID_LENGTH, REKOR_MAX_ACCESS_HEADER_LENGTH, REKOR_MAX_PERSON_PARTIES, REKOR_MAX_PERSON_IDS, REKOR_MAX_PERSON_ID_LENGTH, REKOR_MAX_PERSON_HEADER_LENGTH;
5747
+ var init_chunk_AHISKXHA = __esm({
5748
+ "../../packages/core/dist/chunk-AHISKXHA.js"() {
5516
5749
  "use strict";
5517
5750
  init_zod();
5518
5751
  REKOR_ACTOR_TYPE_HEADER = "X-Rekor-Actor-Type";
@@ -5527,9 +5760,6 @@ var init_chunk_LHTWT6HS = __esm({
5527
5760
  MAX_REKOR_TOOL_ID_LENGTH = 128;
5528
5761
  rekorToolIdSchema = external_exports.string().trim().min(1).max(MAX_REKOR_TOOL_ID_LENGTH);
5529
5762
  REKOR_V1_PREFIX = "/v1";
5530
- REKOR_LIFECYCLE_PREFIX = "/lifecycle";
5531
- REKOR_BASE_VAULT_DRY_RUN_PATH = `${REKOR_LIFECYCLE_PREFIX}/vault-dry-run`;
5532
- REKOR_S3_CREDENTIAL_COUNT_PATH = `${REKOR_LIFECYCLE_PREFIX}/s3-credential-count`;
5533
5763
  DATA_PROXY_ORG_QUERY_PARAM = "org_id";
5534
5764
  MAX_PROVISIONING_BODY_BYTES = 256 * 1024;
5535
5765
  dataProxyQuery = external_exports.object({
@@ -5570,86 +5800,7 @@ var init_chunk_LHTWT6HS = __esm({
5570
5800
  }
5571
5801
  });
5572
5802
 
5573
- // ../../packages/core/dist/chunk-ZTNFLGW5.js
5574
- function normalizeAuthType(raw) {
5575
- if (VALID_AUTH_TYPES.has(raw)) return raw;
5576
- return LEGACY_AUTH_TYPE_MAP[raw] ?? raw;
5577
- }
5578
- function isCustomerFacingAgentRole(role) {
5579
- return typeof role === "string" && CUSTOMER_FACING_AGENT_ROLES.includes(role);
5580
- }
5581
- 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, AGENT_ROLE_DISPLAY, SAFE_USER_ID_REGEX, SUPPORTED_LOCALES, SKILL_INSTALL_COMMAND, CASE_TYPE_ABBREVIATION_PATTERN;
5582
- var init_chunk_ZTNFLGW5 = __esm({
5583
- "../../packages/core/dist/chunk-ZTNFLGW5.js"() {
5584
- "use strict";
5585
- AUTH_TYPE = {
5586
- OAUTH: "oauth",
5587
- API_KEY: "api_key",
5588
- BASIC_AUTH: "basic_auth",
5589
- BEARER: "bearer",
5590
- NONE: "none"
5591
- };
5592
- ORG_CREDENTIAL_AUTH_TYPES = [
5593
- AUTH_TYPE.API_KEY,
5594
- AUTH_TYPE.BEARER,
5595
- AUTH_TYPE.BASIC_AUTH
5596
- ];
5597
- AUTH_TYPE_DISPLAY = {
5598
- [AUTH_TYPE.OAUTH]: "OAuth",
5599
- [AUTH_TYPE.API_KEY]: "API Key",
5600
- [AUTH_TYPE.BASIC_AUTH]: "Basic Auth",
5601
- [AUTH_TYPE.BEARER]: "Bearer Token",
5602
- [AUTH_TYPE.NONE]: "No Authentication"
5603
- };
5604
- LEGACY_AUTH_TYPE_MAP = {
5605
- "OAuth": AUTH_TYPE.OAUTH,
5606
- "API Key": AUTH_TYPE.API_KEY,
5607
- "Basic Auth": AUTH_TYPE.BASIC_AUTH,
5608
- "Bearer Token": AUTH_TYPE.BEARER,
5609
- "No authentication": AUTH_TYPE.NONE,
5610
- // Also handle the old DISPLAY_TO_CODE bug where 'basic' was used instead of 'basic_auth'
5611
- "basic": AUTH_TYPE.BASIC_AUTH
5612
- };
5613
- VALID_AUTH_TYPES = new Set(Object.values(AUTH_TYPE));
5614
- AGENT_ROLES = [
5615
- "pilot",
5616
- "copilot",
5617
- "pilot_specialist",
5618
- "copilot_specialist",
5619
- "pilot_advisor",
5620
- "copilot_advisor",
5621
- "monitor",
5622
- "conversation_evaluator",
5623
- "message_evaluator",
5624
- "summarizer",
5625
- "consultant",
5626
- "pilot_voice"
5627
- ];
5628
- PILOT_TRACK_ROLES = ["pilot", "pilot_specialist"];
5629
- COPILOT_TRACK_ROLES = ["copilot", "copilot_specialist"];
5630
- CUSTOMER_FACING_AGENT_ROLES = [...PILOT_TRACK_ROLES, "pilot_advisor"];
5631
- AGENT_ROLE_DISPLAY = {
5632
- pilot: "Pilot",
5633
- copilot: "Copilot",
5634
- pilot_specialist: "Pilot Specialist",
5635
- copilot_specialist: "Copilot Specialist",
5636
- pilot_advisor: "Pilot Advisor",
5637
- copilot_advisor: "Copilot Advisor",
5638
- monitor: "Monitor",
5639
- conversation_evaluator: "Conversation Evaluator",
5640
- message_evaluator: "Message Evaluator",
5641
- summarizer: "Summarizer",
5642
- consultant: "Consultant",
5643
- pilot_voice: "Pilot Voice"
5644
- };
5645
- SAFE_USER_ID_REGEX = /^[A-Za-z0-9_-]{1,64}$/;
5646
- SUPPORTED_LOCALES = ["en", "pt", "es"];
5647
- SKILL_INSTALL_COMMAND = "mkdir -p .claude && npx skills add wayai-pro/wayai-skill -y";
5648
- CASE_TYPE_ABBREVIATION_PATTERN = /^[A-Z]{2,6}$/;
5649
- }
5650
- });
5651
-
5652
- // ../../packages/core/dist/chunk-2PQCTEDW.js
5803
+ // ../../packages/core/dist/chunk-EBUWHIFV.js
5653
5804
  function isPersonAccessAll(lists) {
5654
5805
  return lists !== void 0 && lists.read.length === 1 && lists.read[0] === ACCESS_UNRESTRICTED && lists.write.length === 1 && lists.write[0] === ACCESS_UNRESTRICTED;
5655
5806
  }
@@ -5687,10 +5838,10 @@ function assignmentHasUnrestricted(assignment) {
5687
5838
  return Object.values(assignment).some((lists) => lists.read.includes(ACCESS_UNRESTRICTED) || lists.write.includes(ACCESS_UNRESTRICTED));
5688
5839
  }
5689
5840
  var ACCESS_UNRESTRICTED, ACCESS_ID_REGEX, ACCESS_ID_MAX_LENGTH, MAX_ACCESS_DIMENSIONS_PER_ORG, MAX_ACCESS_VALUES_PER_DIMENSION, ACCESS_LABEL_MAX_LENGTH, accessIdSchema, accessLabelSchema, accessValueListSchema, accessListsSchema, accessAssignmentSchema, PERSON_ACCESS_KEY, heldAccessKeySchema, heldAccessAssignmentSchema, AGENT_PERSON_ACCESS_REFUSAL, accessSetSchema, accessDimensionParam, accessValueParam, orgMemberParam, orgHubParam, createAccessDimensionBody, updateAccessDimensionBody, createAccessValueBody, updateAccessValueBody, setMemberAccessValuesBody, HUB_PERSON_KINDS, ACCESS_PERSON_KINDS, setHubUserAccessValuesBody, setHubAccessValuesBody, setAgentAccessValuesBody;
5690
- var init_chunk_2PQCTEDW = __esm({
5691
- "../../packages/core/dist/chunk-2PQCTEDW.js"() {
5841
+ var init_chunk_EBUWHIFV = __esm({
5842
+ "../../packages/core/dist/chunk-EBUWHIFV.js"() {
5692
5843
  "use strict";
5693
- init_chunk_LHTWT6HS();
5844
+ init_chunk_AHISKXHA();
5694
5845
  init_chunk_HZ6CADSY();
5695
5846
  init_chunk_ZTNFLGW5();
5696
5847
  init_zod();
@@ -5781,7 +5932,7 @@ var init_chunk_2PQCTEDW = __esm({
5781
5932
  }
5782
5933
  });
5783
5934
 
5784
- // ../../packages/core/dist/chunk-HVCJ2WAL.js
5935
+ // ../../packages/core/dist/chunk-SSPK6ISL.js
5785
5936
  function boundCustomerPartyIsValid(audience, parties, customer) {
5786
5937
  return audience !== REKOR_PERSON_AUDIENCE_STAFF && customer < parties.length && Array.isArray(parties[customer]);
5787
5938
  }
@@ -5795,11 +5946,11 @@ function isEncodedBoundPerson(raw) {
5795
5946
  return rekorBoundPersonSchema.safeParse(parsed).success;
5796
5947
  }
5797
5948
  var TOOLSET_SLUG_PATTERN, REKOR_STRUCTURAL_ID_PATTERN, baseEnvironmentSchema, toolsetFileToolSchema, toolsetSurfaceSchema, toolsetConnectionBindingSchema, seedConnectionBindingSchema, rekorSeedBindingSchema, rekorToolsetToolsSchema, rekorPersonIdSchema, rekorPersonAudienceSchema, rekorBoundPersonSchema, STATED_GENERATION_PATTERN, rekorBoundAttestation, rekorSeedAttestation, rekorResolvedToolsetSchema, REKOR_TOOL_KINDS_PARAM, REKOR_TOOL_KINDS_RESOLVE_SEARCH, resolvedRecordTypeSchema, reviewWritersSchema, sharedScopeSchema, resolvedFileToolSchema, rekorToolsetFileSchema, rekorToolsetFileUrlAnswerSchema, rekorToolsetFileListSchema, rekorToolsetFileGetSchema, rekorToolsetFilePutSchema, TOOLSET_CUSTOMER_FACING_REFUSAL_MARK, TOOLSET_CUSTOMER_FACING_REFUSAL, BASE_TOOLSET_ONLY_FOR_CUSTOMER_FACING, GENERIC_DATA_MCP_CUSTOMER_FACING_REFUSAL, GENERIC_DATA_API_CUSTOMER_FACING_REFUSAL;
5798
- var init_chunk_HVCJ2WAL = __esm({
5799
- "../../packages/core/dist/chunk-HVCJ2WAL.js"() {
5949
+ var init_chunk_SSPK6ISL = __esm({
5950
+ "../../packages/core/dist/chunk-SSPK6ISL.js"() {
5800
5951
  "use strict";
5801
- init_chunk_2PQCTEDW();
5802
- init_chunk_LHTWT6HS();
5952
+ init_chunk_EBUWHIFV();
5953
+ init_chunk_AHISKXHA();
5803
5954
  init_zod();
5804
5955
  TOOLSET_SLUG_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
5805
5956
  REKOR_STRUCTURAL_ID_PATTERN = TOOLSET_SLUG_PATTERN;
@@ -6086,13 +6237,13 @@ var init_chunk_HVCJ2WAL = __esm({
6086
6237
  }
6087
6238
  });
6088
6239
 
6089
- // ../../packages/core/dist/chunk-6KMVY2W7.js
6240
+ // ../../packages/core/dist/chunk-ZYDKHHJ2.js
6090
6241
  var connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, BESIDE_LINK_FIELDS, setProductionCredentialBody, bindSeedConnectionBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery;
6091
- var init_chunk_6KMVY2W7 = __esm({
6092
- "../../packages/core/dist/chunk-6KMVY2W7.js"() {
6242
+ var init_chunk_ZYDKHHJ2 = __esm({
6243
+ "../../packages/core/dist/chunk-ZYDKHHJ2.js"() {
6093
6244
  "use strict";
6094
6245
  init_chunk_MF2VVXBR();
6095
- init_chunk_HVCJ2WAL();
6246
+ init_chunk_SSPK6ISL();
6096
6247
  init_chunk_HZ6CADSY();
6097
6248
  init_zod();
6098
6249
  connectionIdParam = external_exports.object({ id: uuidSchema });
@@ -6169,160 +6320,6 @@ var init_chunk_6KMVY2W7 = __esm({
6169
6320
  }
6170
6321
  });
6171
6322
 
6172
- // ../../packages/core/dist/chunk-IPXBFWUU.js
6173
- var variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody;
6174
- var init_chunk_IPXBFWUU = __esm({
6175
- "../../packages/core/dist/chunk-IPXBFWUU.js"() {
6176
- "use strict";
6177
- init_chunk_6TSQ5HXC();
6178
- init_zod();
6179
- variantAiModeSchema = external_exports.enum(["pilot+copilot", "pilot", "copilot", "turned_off"]);
6180
- experimentStatusSchema = external_exports.enum(["draft", "running", "stopped"]);
6181
- overlayUpdateSchema = external_exports.record(external_exports.unknown()).nullish().transform((v) => v === void 0 ? void 0 : v && Object.keys(v).length > 0 ? v : null);
6182
- experimentIdParam = external_exports.object({
6183
- id: external_exports.string().uuid()
6184
- });
6185
- variantIdParam = external_exports.object({
6186
- id: external_exports.string().uuid()
6187
- });
6188
- listExperimentsQuery = external_exports.object({
6189
- hub_id: external_exports.string().uuid()
6190
- });
6191
- listVariantsQuery = external_exports.object({
6192
- hub_id: external_exports.string().uuid(),
6193
- experiment_id: external_exports.string().uuid().optional()
6194
- });
6195
- listOverridesQuery = external_exports.object({
6196
- hub_id: external_exports.string().uuid(),
6197
- variant_id: external_exports.string().uuid()
6198
- });
6199
- deleteOverrideQuery = external_exports.object({
6200
- hub_id: external_exports.string().uuid(),
6201
- variant_id: external_exports.string().uuid(),
6202
- agent_id: external_exports.string().uuid()
6203
- });
6204
- createExperimentBody = external_exports.object({
6205
- hub_id: external_exports.string().uuid(),
6206
- experiment_slug: slugSchema.optional(),
6207
- experiment_name: external_exports.string().min(1, "experiment_name is required").max(100, "experiment_name must be 100 characters or fewer"),
6208
- primary_metric: external_exports.string().max(200).nullish(),
6209
- status: experimentStatusSchema.default("draft")
6210
- });
6211
- updateExperimentBody = external_exports.object({
6212
- // experiment_slug is immutable after first persist — not accepted here.
6213
- experiment_name: external_exports.string().min(1).max(100).optional(),
6214
- primary_metric: external_exports.string().max(200).nullish(),
6215
- control_variant_id: external_exports.string().uuid().nullish()
6216
- });
6217
- setExperimentStatusBody = external_exports.object({
6218
- status: experimentStatusSchema
6219
- });
6220
- createVariantBody = external_exports.object({
6221
- hub_id: external_exports.string().uuid(),
6222
- experiment_id: external_exports.string().uuid(),
6223
- label: external_exports.string().min(1, "label is required").max(100, "label must be 100 characters or fewer"),
6224
- weight: external_exports.number().positive().default(1),
6225
- ai_mode: variantAiModeSchema.nullish(),
6226
- is_control: external_exports.boolean().default(false)
6227
- });
6228
- updateVariantBody = external_exports.object({
6229
- label: external_exports.string().min(1).max(100).optional(),
6230
- weight: external_exports.number().positive().optional(),
6231
- ai_mode: variantAiModeSchema.nullish(),
6232
- is_control: external_exports.boolean().optional()
6233
- });
6234
- upsertOverrideBody = external_exports.object({
6235
- hub_id: external_exports.string().uuid(),
6236
- variant_id: external_exports.string().uuid(),
6237
- agent_id: external_exports.string().uuid(),
6238
- instructions: external_exports.string().nullish(),
6239
- additional_context_template: external_exports.string().nullish(),
6240
- connection_id: external_exports.string().uuid().nullish(),
6241
- agent_settings_overlay: overlayUpdateSchema
6242
- });
6243
- }
6244
- });
6245
-
6246
- // ../../packages/core/dist/chunk-AYLAGFAD.js
6247
- var BASE_CREDENTIAL_NAME_MAX, BASE_CREDENTIAL_NAME_PATTERN, BASE_CREDENTIAL_NAME_CHARSET, baseCredentialNameSchema;
6248
- var init_chunk_AYLAGFAD = __esm({
6249
- "../../packages/core/dist/chunk-AYLAGFAD.js"() {
6250
- "use strict";
6251
- init_zod();
6252
- BASE_CREDENTIAL_NAME_MAX = 100;
6253
- BASE_CREDENTIAL_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:@+~=-]*$/;
6254
- BASE_CREDENTIAL_NAME_CHARSET = "letters, digits and '. _ : @ + ~ = -', starting with a letter or digit";
6255
- baseCredentialNameSchema = external_exports.string().min(1).max(BASE_CREDENTIAL_NAME_MAX).regex(BASE_CREDENTIAL_NAME_PATTERN, `name must use ${BASE_CREDENTIAL_NAME_CHARSET}`);
6256
- }
6257
- });
6258
-
6259
- // ../../packages/core/dist/chunk-DSKOMKRY.js
6260
- var orgCredentialIdParam, listOrgCredentialsQuery, ORG_CREDENTIAL_SERVICE_REQUIRED, createOrgCredentialBody, updateOrgCredentialBody;
6261
- var init_chunk_DSKOMKRY = __esm({
6262
- "../../packages/core/dist/chunk-DSKOMKRY.js"() {
6263
- "use strict";
6264
- init_chunk_MF2VVXBR();
6265
- init_chunk_ZTNFLGW5();
6266
- init_zod();
6267
- orgCredentialIdParam = external_exports.object({
6268
- id: external_exports.string().uuid()
6269
- });
6270
- listOrgCredentialsQuery = external_exports.object({
6271
- organization_id: external_exports.string().uuid(),
6272
- hub_id: external_exports.string().uuid().optional()
6273
- });
6274
- ORG_CREDENTIAL_SERVICE_REQUIRED = "An organization credential must name the service it is for (connector_id): pick its Service in the console, or run `wayai create-credential --service <name>`, updating the WayAI CLI first if it has no --service. Nothing was created.";
6275
- createOrgCredentialBody = external_exports.object({
6276
- organization_id: external_exports.string().uuid(),
6277
- credential_display_name: external_exports.string().min(1).max(255),
6278
- credential_description: external_exports.string().max(1e3).nullish(),
6279
- authentication_type: external_exports.enum(["api_key", "bearer", "basic_auth"]).or(
6280
- external_exports.enum(["API Key", "Bearer Token", "Basic Auth"]).transform((v) => normalizeAuthType(v))
6281
- ),
6282
- api_key: external_exports.string().optional(),
6283
- access_token: external_exports.string().optional(),
6284
- username: external_exports.string().optional(),
6285
- password: external_exports.string().optional(),
6286
- tags: external_exports.array(external_exports.string().uuid()).optional(),
6287
- environment: external_exports.enum(["preview", "production", "all"]).optional(),
6288
- expires_at: credentialExpiresAtSchema.optional(),
6289
- /**
6290
- * The service the credential is for: a catalog `connector_id` (wayai#5644). Required (owner decision Q2): its value goes
6291
- * to the credentials vault under that connector, and a credential naming none had nowhere there to go. It links only to
6292
- * connections of that service, and is fixed for the credential's life. A connector whose host the customer types (REST
6293
- * API, External Resources, MCP Server) is refused: its value is entered on the connection. A client that sends none (a
6294
- * CLI from before `--service`) is refused with {@link ORG_CREDENTIAL_SERVICE_REQUIRED}.
6295
- */
6296
- connector_id: external_exports.string({ required_error: ORG_CREDENTIAL_SERVICE_REQUIRED }).uuid()
6297
- });
6298
- updateOrgCredentialBody = external_exports.object({
6299
- credential_display_name: external_exports.string().min(1).max(255).optional(),
6300
- credential_description: external_exports.string().max(1e3).nullish(),
6301
- api_key: external_exports.string().optional(),
6302
- access_token: external_exports.string().optional(),
6303
- username: external_exports.string().optional(),
6304
- password: external_exports.string().optional(),
6305
- tags: external_exports.array(external_exports.string().uuid()).optional(),
6306
- environment: external_exports.enum(["preview", "production", "all"]).optional(),
6307
- // Absent keeps the stored date, unless the request stores a new secret, which clears it.
6308
- expires_at: credentialExpiresAtSchema.optional()
6309
- });
6310
- }
6311
- });
6312
-
6313
- // ../../packages/core/dist/chunk-HIGKBEPF.js
6314
- var accessExplainQuery;
6315
- var init_chunk_HIGKBEPF = __esm({
6316
- "../../packages/core/dist/chunk-HIGKBEPF.js"() {
6317
- "use strict";
6318
- init_chunk_HZ6CADSY();
6319
- init_zod();
6320
- accessExplainQuery = external_exports.object({
6321
- user_id: external_exports.string().regex(USER_ID_REGEX).optional()
6322
- });
6323
- }
6324
- });
6325
-
6326
6323
  // ../../packages/core/dist/chunk-KEN2DASI.js
6327
6324
  var SECOND_FACTOR_TIERS, secondFactorTier, META_ENTITY_ID_PATTERN, metaEntityId, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, normalizeEmail, REVIEW_ACCOUNT_EMAILS;
6328
6325
  var init_chunk_KEN2DASI = __esm({
@@ -6502,13 +6499,13 @@ var init_chunk_P5GJNS5R = __esm({
6502
6499
  }
6503
6500
  });
6504
6501
 
6505
- // ../../packages/core/dist/chunk-OSWY3GQY.js
6502
+ // ../../packages/core/dist/chunk-WDAXZDJO.js
6506
6503
  var TOOLSET_ANSWER_PERSON_PARTIES, toolsetAnswerPersonSchema, toolsetAnswerPersonsSchema;
6507
- var init_chunk_OSWY3GQY = __esm({
6508
- "../../packages/core/dist/chunk-OSWY3GQY.js"() {
6504
+ var init_chunk_WDAXZDJO = __esm({
6505
+ "../../packages/core/dist/chunk-WDAXZDJO.js"() {
6509
6506
  "use strict";
6510
- init_chunk_HVCJ2WAL();
6511
- init_chunk_LHTWT6HS();
6507
+ init_chunk_SSPK6ISL();
6508
+ init_chunk_AHISKXHA();
6512
6509
  init_zod();
6513
6510
  TOOLSET_ANSWER_PERSON_PARTIES = ["requester", "originator", "initiator", "delegator"];
6514
6511
  toolsetAnswerPersonSchema = external_exports.object({
@@ -6859,7 +6856,7 @@ var init_chunk_5FO3GNKP = __esm({
6859
6856
  }
6860
6857
  });
6861
6858
 
6862
- // ../../packages/core/dist/chunk-763PRRIT.js
6859
+ // ../../packages/core/dist/chunk-GSHLIV7C.js
6863
6860
  function matchPath(pattern, path45) {
6864
6861
  const pathSegments2 = path45.replace(/\/$/, "").split("/");
6865
6862
  const isPrefix = pattern.endsWith("/*");
@@ -6888,8 +6885,8 @@ function getEndpointConfig(path45) {
6888
6885
  return { tier: "STANDARD" };
6889
6886
  }
6890
6887
  var ENDPOINT_CONFIGS, EXCLUDED_PATHS;
6891
- var init_chunk_763PRRIT = __esm({
6892
- "../../packages/core/dist/chunk-763PRRIT.js"() {
6888
+ var init_chunk_GSHLIV7C = __esm({
6889
+ "../../packages/core/dist/chunk-GSHLIV7C.js"() {
6893
6890
  "use strict";
6894
6891
  init_chunk_5FO3GNKP();
6895
6892
  ENDPOINT_CONFIGS = {
@@ -7344,7 +7341,7 @@ var init_chunk_763PRRIT = __esm({
7344
7341
  // many members' clicks share, and STRICT's 5/min bucket is shared with sign-in. An exact key, so
7345
7342
  // it wins over the wildcard above.
7346
7343
  [COMMUNITY_EMAIL_UNSUBSCRIBE_PATH]: { tier: "MODERATE" },
7347
- // Case spaces (wayai#5921, `cases/routes.ts`): every route under the mount (the upload below excepted) shares
7344
+ // Case spaces (wayai#5921, `cases/routes.ts`): every route under the mount (the upload and compare below excepted) shares
7348
7345
  // one per-user budget. Each is one person's page or write, at most a few hundred Durable Object reads (the
7349
7346
  // list of their spaces); a space's own limits are counted in its CaseDO. Every caller is a web
7350
7347
  // session, so the per-IP tier is skipped; the key is pinned because the paths carry org, space,
@@ -7363,6 +7360,15 @@ var init_chunk_763PRRIT = __esm({
7363
7360
  skipAuthenticatedUsers: true,
7364
7361
  userLimitKey: "/api/cases/*/*/cases/*/uploads"
7365
7362
  },
7363
+ // A compare of two versions of a case file (`GET …/cases/:code/files/compare`): each reads up to 8 MiB from the
7364
+ // bucket into the Worker and runs the block compare (under a second of CPU at its limits), so it takes its own
7365
+ // budget, keyed once for every case.
7366
+ "/api/cases/*/*/cases/*/files/compare": {
7367
+ tier: "STANDARD",
7368
+ userLimit: 30,
7369
+ skipAuthenticatedUsers: true,
7370
+ userLimitKey: "/api/cases/*/*/cases/*/files/compare"
7371
+ },
7366
7372
  // The WayAI Guide's help entry (wayai#4948, `routes/api/guide.ts`): one POST per click by a viewer
7367
7373
  // the snapshot does not show enrolled, which reads the person's row on the Guide hub and writes only
7368
7374
  // what is missing (an enrolled viewer's click opens the hub without a request). Every caller is
@@ -7399,7 +7405,7 @@ var init_chunk_763PRRIT = __esm({
7399
7405
  }
7400
7406
  });
7401
7407
 
7402
- // ../../packages/core/dist/chunk-THZG62YP.js
7408
+ // ../../packages/core/dist/chunk-4EYS7CVA.js
7403
7409
  function fileSnapshotChanged(run) {
7404
7410
  return run.written + run.removed > 0;
7405
7411
  }
@@ -7440,10 +7446,10 @@ async function sendWithRetry(opts, cursor) {
7440
7446
  }
7441
7447
  }
7442
7448
  var rekorFileSnapshotAnswerSchema, FILE_SNAPSHOT_MAX_PAGES, FILE_SNAPSHOT_CONFLICT_ATTEMPTS, FILE_SNAPSHOT_PAGE_SPACING_MS, FILE_SNAPSHOT_CONFLICT_STATUS;
7443
- var init_chunk_THZG62YP = __esm({
7444
- "../../packages/core/dist/chunk-THZG62YP.js"() {
7449
+ var init_chunk_4EYS7CVA = __esm({
7450
+ "../../packages/core/dist/chunk-4EYS7CVA.js"() {
7445
7451
  "use strict";
7446
- init_chunk_763PRRIT();
7452
+ init_chunk_GSHLIV7C();
7447
7453
  init_chunk_5FO3GNKP();
7448
7454
  init_zod();
7449
7455
  rekorFileSnapshotAnswerSchema = external_exports.object({
@@ -8069,12 +8075,12 @@ var init_chunk_FBV7NLKO = __esm({
8069
8075
  }
8070
8076
  });
8071
8077
 
8072
- // ../../packages/core/dist/chunk-TBQYMMC2.js
8078
+ // ../../packages/core/dist/chunk-TZH6DKKJ.js
8073
8079
  var hubPageWatchParam, pageWatchedBaseSchema, hubPageWatchResponseSchema;
8074
- var init_chunk_TBQYMMC2 = __esm({
8075
- "../../packages/core/dist/chunk-TBQYMMC2.js"() {
8080
+ var init_chunk_TZH6DKKJ = __esm({
8081
+ "../../packages/core/dist/chunk-TZH6DKKJ.js"() {
8076
8082
  "use strict";
8077
- init_chunk_HVCJ2WAL();
8083
+ init_chunk_SSPK6ISL();
8078
8084
  init_chunk_FBV7NLKO();
8079
8085
  init_chunk_HZ6CADSY();
8080
8086
  init_zod();
@@ -12891,7 +12897,7 @@ var init_chunk_2ISUBJG7 = __esm({
12891
12897
  }
12892
12898
  });
12893
12899
 
12894
- // ../../packages/core/dist/chunk-LIE6DQT2.js
12900
+ // ../../packages/core/dist/chunk-I5ZZTW7B.js
12895
12901
  function describeRole(role) {
12896
12902
  if (typeof role === "string") {
12897
12903
  return JSON.stringify(role.length > ROLE_ECHO_MAX ? `${role.slice(0, ROLE_ECHO_MAX)}\u2026` : role);
@@ -13070,11 +13076,11 @@ function terminalRunCount(counts) {
13070
13076
  return counts.successful_runs + counts.failed_runs;
13071
13077
  }
13072
13078
  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, EVAL_PERSON_MAX, evalPersonSchema, EVAL_PERSON_ALIAS_RETIRED, EVAL_PERSON_ALIAS_REFUSED, 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;
13073
- var init_chunk_LIE6DQT2 = __esm({
13074
- "../../packages/core/dist/chunk-LIE6DQT2.js"() {
13079
+ var init_chunk_I5ZZTW7B = __esm({
13080
+ "../../packages/core/dist/chunk-I5ZZTW7B.js"() {
13075
13081
  "use strict";
13076
13082
  init_chunk_2YEGUQR7();
13077
- init_chunk_LHTWT6HS();
13083
+ init_chunk_AHISKXHA();
13078
13084
  init_chunk_4LXDRTO4();
13079
13085
  init_chunk_XKMRLZKH();
13080
13086
  init_chunk_HZ6CADSY();
@@ -14148,7 +14154,7 @@ var init_chunk_XEG3QEIZ = __esm({
14148
14154
  }
14149
14155
  });
14150
14156
 
14151
- // ../../packages/core/dist/chunk-3LM6A6Y3.js
14157
+ // ../../packages/core/dist/chunk-FYFFX3KJ.js
14152
14158
  function declaresNoConnection(agent) {
14153
14159
  return agent.connection === null && !agent.connection_id;
14154
14160
  }
@@ -14880,12 +14886,12 @@ function skillSectionsAsResources(scope) {
14880
14886
  };
14881
14887
  }
14882
14888
  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_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, HUB_AS_CODE_AGENT_TOOL_KEYS, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, 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;
14883
- var init_chunk_3LM6A6Y3 = __esm({
14884
- "../../packages/core/dist/chunk-3LM6A6Y3.js"() {
14889
+ var init_chunk_FYFFX3KJ = __esm({
14890
+ "../../packages/core/dist/chunk-FYFFX3KJ.js"() {
14885
14891
  "use strict";
14886
14892
  init_chunk_JSPSTJH4();
14887
- init_chunk_2PQCTEDW();
14888
- init_chunk_LIE6DQT2();
14893
+ init_chunk_EBUWHIFV();
14894
+ init_chunk_I5ZZTW7B();
14889
14895
  init_chunk_WRLPUYS3();
14890
14896
  init_chunk_LBDH7LCG();
14891
14897
  init_chunk_4LXDRTO4();
@@ -15616,16 +15622,18 @@ var init_chunk_SNJVNJAM = __esm({
15616
15622
  }
15617
15623
  });
15618
15624
 
15619
- // ../../packages/core/dist/chunk-DFQA4OMG.js
15625
+ // ../../packages/core/dist/chunk-UT7R6YJH.js
15620
15626
  var CASE_TIMELINE_PAGE_MAX, caseTimelineQuery;
15621
- var init_chunk_DFQA4OMG = __esm({
15622
- "../../packages/core/dist/chunk-DFQA4OMG.js"() {
15627
+ var init_chunk_UT7R6YJH = __esm({
15628
+ "../../packages/core/dist/chunk-UT7R6YJH.js"() {
15623
15629
  "use strict";
15624
15630
  init_chunk_IZPR5A6I();
15625
15631
  init_zod();
15626
15632
  CASE_TIMELINE_PAGE_MAX = 100;
15627
15633
  caseTimelineQuery = casePageQuery.extend({
15628
- limit: external_exports.coerce.number().int().min(1).max(CASE_TIMELINE_PAGE_MAX).optional()
15634
+ limit: external_exports.coerce.number().int().min(1).max(CASE_TIMELINE_PAGE_MAX).optional(),
15635
+ /** An entry's `id`: the page after it (the header's IDS AND THE OPAQUE CURSOR). */
15636
+ after: external_exports.string().min(1).max(CASE_PAGE_CURSOR_MAX_LENGTH).optional()
15629
15637
  });
15630
15638
  }
15631
15639
  });
@@ -15961,10 +15969,10 @@ var init_chunk_N7TIWXUC = __esm({
15961
15969
  }
15962
15970
  });
15963
15971
 
15964
- // ../../packages/core/dist/chunk-VMWWH3YC.js
15965
- var CASE_FILE_SHA_PATTERN, caseFileShaSchema, CASE_REVISION_MESSAGE_MAX_LENGTH, CASE_REVISION_SESSION_MAX_LENGTH, CASE_REVISION_ENTRIES_MAX, caseRevisionEntryShape, caseRevisionShape, CASE_UPLOAD_BODY_MAX_BYTES, CASE_UPLOAD_REVISION_FIELD, isBlob, caseUploadForm, CASE_FILES_PAGE_MAX, caseFilesQuery, caseFileReadPath, CASE_FILE_VERSIONS_PAGE_MAX, caseFileVersionsQuery, caseFileContentQuery;
15966
- var init_chunk_VMWWH3YC = __esm({
15967
- "../../packages/core/dist/chunk-VMWWH3YC.js"() {
15972
+ // ../../packages/core/dist/chunk-AFFR56UV.js
15973
+ var CASE_FILE_SHA_PATTERN, caseFileShaSchema, CASE_REVISION_MESSAGE_MAX_LENGTH, CASE_REVISION_SESSION_MAX_LENGTH, CASE_REVISION_ENTRIES_MAX, caseRevisionEntryShape, caseRevisionShape, CASE_UPLOAD_BODY_MAX_BYTES, CASE_UPLOAD_REVISION_FIELD, isBlob, caseUploadForm, CASE_FILES_PAGE_MAX, caseFilesQuery, caseFileReadPath, CASE_FILE_VERSIONS_PAGE_MAX, caseFileVersionsQuery, caseFileContentQuery, CASE_REVISIONS_PAGE_MAX, caseRevisionsQuery, CASE_FILE_COMPARE_MAX_BYTES, caseFileCompareQuery;
15974
+ var init_chunk_AFFR56UV = __esm({
15975
+ "../../packages/core/dist/chunk-AFFR56UV.js"() {
15968
15976
  "use strict";
15969
15977
  init_chunk_N7TIWXUC();
15970
15978
  init_chunk_IZPR5A6I();
@@ -16031,6 +16039,16 @@ var init_chunk_VMWWH3YC = __esm({
16031
16039
  path: caseFileReadPath,
16032
16040
  revision_id: uuidSchema.optional()
16033
16041
  });
16042
+ CASE_REVISIONS_PAGE_MAX = 50;
16043
+ caseRevisionsQuery = casePageQuery.extend({
16044
+ limit: external_exports.coerce.number().int().min(1).max(CASE_REVISIONS_PAGE_MAX).optional()
16045
+ });
16046
+ CASE_FILE_COMPARE_MAX_BYTES = 4 * 1024 * 1024;
16047
+ caseFileCompareQuery = external_exports.object({
16048
+ path: caseFileReadPath,
16049
+ from: uuidSchema,
16050
+ to: uuidSchema
16051
+ });
16034
16052
  }
16035
16053
  });
16036
16054
 
@@ -17017,10 +17035,10 @@ var init_chunk_BFG4ZWR4 = __esm({
17017
17035
  }
17018
17036
  });
17019
17037
 
17020
- // ../../packages/core/dist/chunk-IACPUEC3.js
17038
+ // ../../packages/core/dist/chunk-UY32MQHG.js
17021
17039
  var dataExplorerDebugDoType, DEBUG_READ_MAX_LIMIT, DEBUG_READ_DEFAULT_LIMIT;
17022
- var init_chunk_IACPUEC3 = __esm({
17023
- "../../packages/core/dist/chunk-IACPUEC3.js"() {
17040
+ var init_chunk_UY32MQHG = __esm({
17041
+ "../../packages/core/dist/chunk-UY32MQHG.js"() {
17024
17042
  "use strict";
17025
17043
  init_zod();
17026
17044
  dataExplorerDebugDoType = external_exports.enum(["hub", "org", "conversation", "user", "platform", "thread", "community", "contact_book", "batch"]);
@@ -17131,7 +17149,7 @@ var init_chunk_OMPT4ZHR = __esm({
17131
17149
  }
17132
17150
  });
17133
17151
 
17134
- // ../../packages/core/dist/chunk-N3AIIDID.js
17152
+ // ../../packages/core/dist/chunk-HHVS7IP4.js
17135
17153
  function refineScopedTarget(data, ctx) {
17136
17154
  if (data.scope === "org") {
17137
17155
  if (!data.org_id) {
@@ -17157,12 +17175,12 @@ function refineScopedTarget(data, ctx) {
17157
17175
  }
17158
17176
  }
17159
17177
  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, casesLimit, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetShape, adminScopedTargetBody, adminDryRunByDefaultTargetBody, WAYAI_HOST_TOKEN_TARGET_KINDS, WAYAI_HOST_TOKEN_MAX_TARGETS, adminClearWayaiHostTokensBody, BRANCHING_ORPHAN_ENTITY_TYPES, BRANCHING_ORPHAN_MAX_TARGETS, adminRepairBranchingOrphansBody, adminRepairLegacyOrgGrantsBody, adminRepairCredentialServicesBody, 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;
17160
- var init_chunk_N3AIIDID = __esm({
17161
- "../../packages/core/dist/chunk-N3AIIDID.js"() {
17178
+ var init_chunk_HHVS7IP4 = __esm({
17179
+ "../../packages/core/dist/chunk-HHVS7IP4.js"() {
17162
17180
  "use strict";
17163
17181
  init_chunk_FECLIZTY();
17164
17182
  init_chunk_BFG4ZWR4();
17165
- init_chunk_IACPUEC3();
17183
+ init_chunk_UY32MQHG();
17166
17184
  init_chunk_XEG3QEIZ();
17167
17185
  init_chunk_OMPT4ZHR();
17168
17186
  init_chunk_HZ6CADSY();
@@ -17733,29 +17751,29 @@ var init_chunk_SOJMWM63 = __esm({
17733
17751
  var init_contracts = __esm({
17734
17752
  "../../packages/core/dist/contracts/index.js"() {
17735
17753
  "use strict";
17736
- init_chunk_YVY2TZK2();
17737
17754
  init_chunk_VXEAR36B();
17738
17755
  init_chunk_RACEDHG6();
17739
17756
  init_chunk_Q7KIQHAZ();
17740
- init_chunk_6KMVY2W7();
17741
17757
  init_chunk_IPXBFWUU();
17742
17758
  init_chunk_AYLAGFAD();
17743
17759
  init_chunk_DSKOMKRY();
17744
- init_chunk_MF2VVXBR();
17760
+ init_chunk_YVY2TZK2();
17745
17761
  init_chunk_HIGKBEPF();
17762
+ init_chunk_ZYDKHHJ2();
17763
+ init_chunk_MF2VVXBR();
17746
17764
  init_chunk_PFGVH2CX();
17747
17765
  init_chunk_WE4KMHZK();
17748
17766
  init_chunk_P5GJNS5R();
17749
- init_chunk_OSWY3GQY();
17767
+ init_chunk_WDAXZDJO();
17750
17768
  init_chunk_ZC6YGHNX();
17751
17769
  init_chunk_MGBAXT5Y();
17752
17770
  init_chunk_5DGHIY7L();
17753
- init_chunk_THZG62YP();
17771
+ init_chunk_4EYS7CVA();
17754
17772
  init_chunk_IPDOHAZ5();
17755
17773
  init_chunk_34LE6P7E();
17756
17774
  init_chunk_FPSDNS2E();
17757
- init_chunk_TBQYMMC2();
17758
- init_chunk_HVCJ2WAL();
17775
+ init_chunk_TZH6DKKJ();
17776
+ init_chunk_SSPK6ISL();
17759
17777
  init_chunk_ZXK6N2HN();
17760
17778
  init_chunk_Y7CFCYX4();
17761
17779
  init_chunk_OABSWQ6P();
@@ -17773,12 +17791,12 @@ var init_contracts = __esm({
17773
17791
  init_chunk_KSTYTQ7I();
17774
17792
  init_chunk_LKBSHANA();
17775
17793
  init_chunk_FMB4KA3N();
17776
- init_chunk_3LM6A6Y3();
17794
+ init_chunk_FYFFX3KJ();
17777
17795
  init_chunk_JSPSTJH4();
17778
- init_chunk_2PQCTEDW();
17779
- init_chunk_LIE6DQT2();
17796
+ init_chunk_EBUWHIFV();
17797
+ init_chunk_I5ZZTW7B();
17780
17798
  init_chunk_2YEGUQR7();
17781
- init_chunk_LHTWT6HS();
17799
+ init_chunk_AHISKXHA();
17782
17800
  init_chunk_JDJ4EUOL();
17783
17801
  init_chunk_UCYWGWQT();
17784
17802
  init_chunk_6AYIXGDT();
@@ -17787,11 +17805,11 @@ var init_contracts = __esm({
17787
17805
  init_chunk_S2K64B6S();
17788
17806
  init_chunk_IGLHT6YP();
17789
17807
  init_chunk_SNJVNJAM();
17790
- init_chunk_DFQA4OMG();
17808
+ init_chunk_UT7R6YJH();
17791
17809
  init_chunk_7CYHPF35();
17792
17810
  init_chunk_NETRUHZF();
17793
17811
  init_chunk_KHL7NZSL();
17794
- init_chunk_VMWWH3YC();
17812
+ init_chunk_AFFR56UV();
17795
17813
  init_chunk_QVZPT7ZX();
17796
17814
  init_chunk_E4AVT2QI();
17797
17815
  init_chunk_B2AXWIKU();
@@ -17813,10 +17831,10 @@ var init_contracts = __esm({
17813
17831
  init_chunk_N7TIWXUC();
17814
17832
  init_chunk_IZPR5A6I();
17815
17833
  init_chunk_NVKU5PPQ();
17816
- init_chunk_N3AIIDID();
17834
+ init_chunk_HHVS7IP4();
17817
17835
  init_chunk_FECLIZTY();
17818
17836
  init_chunk_BFG4ZWR4();
17819
- init_chunk_IACPUEC3();
17837
+ init_chunk_UY32MQHG();
17820
17838
  init_chunk_XEG3QEIZ();
17821
17839
  init_chunk_D3EP4TDU();
17822
17840
  init_chunk_YZHCIGDZ();
@@ -17832,7 +17850,7 @@ var init_contracts = __esm({
17832
17850
  init_chunk_ZIGA5RCU();
17833
17851
  init_chunk_FBV7NLKO();
17834
17852
  init_chunk_VYINA6YP();
17835
- init_chunk_763PRRIT();
17853
+ init_chunk_GSHLIV7C();
17836
17854
  init_chunk_XKMRLZKH();
17837
17855
  init_chunk_SOJMWM63();
17838
17856
  init_chunk_5FO3GNKP();
@@ -17990,7 +18008,7 @@ var UUID_RE2, WAYAI_WORKSPACE_LAYOUT;
17990
18008
  var init_dist = __esm({
17991
18009
  "../../packages/core/dist/index.js"() {
17992
18010
  "use strict";
17993
- init_chunk_763PRRIT();
18011
+ init_chunk_GSHLIV7C();
17994
18012
  init_chunk_XKMRLZKH();
17995
18013
  init_chunk_SOJMWM63();
17996
18014
  init_chunk_5FO3GNKP();
@@ -19035,9 +19053,9 @@ function entryFlagRefusal(command2, args2, dataNamespaces) {
19035
19053
  if (reads === void 0 || reads === "selectors") return null;
19036
19054
  return unreadArgumentRefusal(invocation, args2.slice(named - 1), reads, SPLITS_AT_FIRST_LONG_FLAG.has(command2));
19037
19055
  }
19038
- function isNewerVersion(latest2, current) {
19056
+ function isNewerVersion(latest, current) {
19039
19057
  const strip = (v) => v.replace(/[-+].*$/, "");
19040
- const l = strip(latest2).split(".").map(Number);
19058
+ const l = strip(latest).split(".").map(Number);
19041
19059
  const c = strip(current).split(".").map(Number);
19042
19060
  for (let i = 0; i < Math.max(l.length, c.length); i++) {
19043
19061
  const lv = l[i] ?? 0;
@@ -19239,8 +19257,6 @@ var init_utils = __esm({
19239
19257
  ["admin hubs clear-wayai-host-tokens", { positionals: 0, values: ["--org", "--hub", "--id"], dryRun: true }],
19240
19258
  ["admin orgs repair-legacy-grants", { positionals: 0, values: ["--org"], dryRun: true }],
19241
19259
  ["admin orgs repair-credential-services", { positionals: 0, values: ["--org"], dryRun: true }],
19242
- ["admin vault base-dry-run", { positionals: 0, values: ["--org", "--base", "--after"] }],
19243
- ["admin vault mount-credential-count", { positionals: 0, values: ["--org", "--cursor"] }],
19244
19260
  ["admin harness mass-destroy", { positionals: 0, values: ["--org", "--hub"], dryRun: true }],
19245
19261
  ["admin harness disable", { positionals: 0 }],
19246
19262
  ["admin harness enable", { positionals: 0 }],
@@ -20470,19 +20486,6 @@ var init_api_client = __esm({
20470
20486
  async debugCounts(doType, doId) {
20471
20487
  return this.request("GET", `/api/admin/data-explorer/debug/do/${doType}/${encodeURIComponent(doId)}/counts`);
20472
20488
  }
20473
- /** One page of an org's base-secrets dry run, or one base's: numbers, reason codes and ids. */
20474
- async debugBaseVaultDryRun(query) {
20475
- const params = new URLSearchParams({ org_id: query.org_id });
20476
- if (query.base_id) params.set("base_id", query.base_id);
20477
- if (query.after) params.set("after", query.after);
20478
- return this.request("GET", `/api/admin/data-explorer/debug/base-vault-dry-run?${params.toString()}`);
20479
- }
20480
- /** One page of the platform's S3 mount credential count: numbers per org, never a key. */
20481
- async debugS3CredentialCount(query) {
20482
- const params = new URLSearchParams({ org_id: query.org_id });
20483
- if (query.cursor) params.set("cursor", query.cursor);
20484
- return this.request("GET", `/api/admin/data-explorer/debug/s3-credential-count?${params.toString()}`);
20485
- }
20486
20489
  async debugListAnalyticsTables() {
20487
20490
  return this.request("GET", "/api/admin/data-explorer/debug/analytics/tables");
20488
20491
  }
@@ -22365,11 +22368,11 @@ function buildSkillState() {
22365
22368
  }
22366
22369
  const version = lowestInstalledVersion(installs);
22367
22370
  const cached = readCachedLatest(SKILL_CACHE_FILE);
22368
- const latest2 = cached && version && isNewerVersion(cached, version) ? cached : null;
22371
+ const latest = cached && version && isNewerVersion(cached, version) ? cached : null;
22369
22372
  return {
22370
22373
  installed: true,
22371
22374
  version,
22372
- latest: latest2,
22375
+ latest,
22373
22376
  paths: installs.map((i) => i.path)
22374
22377
  };
22375
22378
  }
@@ -23215,9 +23218,9 @@ var init_pages2 = __esm({
23215
23218
  var init_evals = __esm({
23216
23219
  "../../packages/core/dist/contracts/evals.js"() {
23217
23220
  "use strict";
23218
- init_chunk_LIE6DQT2();
23221
+ init_chunk_I5ZZTW7B();
23219
23222
  init_chunk_2YEGUQR7();
23220
- init_chunk_LHTWT6HS();
23223
+ init_chunk_AHISKXHA();
23221
23224
  init_chunk_4LXDRTO4();
23222
23225
  init_chunk_XKMRLZKH();
23223
23226
  init_chunk_HZ6CADSY();
@@ -24243,12 +24246,12 @@ var init_hub_materializer = __esm({
24243
24246
  var init_ci = __esm({
24244
24247
  "../../packages/core/dist/contracts/ci.js"() {
24245
24248
  "use strict";
24246
- init_chunk_3LM6A6Y3();
24249
+ init_chunk_FYFFX3KJ();
24247
24250
  init_chunk_JSPSTJH4();
24248
- init_chunk_2PQCTEDW();
24249
- init_chunk_LIE6DQT2();
24251
+ init_chunk_EBUWHIFV();
24252
+ init_chunk_I5ZZTW7B();
24250
24253
  init_chunk_2YEGUQR7();
24251
- init_chunk_LHTWT6HS();
24254
+ init_chunk_AHISKXHA();
24252
24255
  init_chunk_WRLPUYS3();
24253
24256
  init_chunk_LBDH7LCG();
24254
24257
  init_chunk_4LXDRTO4();
@@ -24923,12 +24926,12 @@ function routeToSubtree(options) {
24923
24926
  }
24924
24927
  const repeated = repeatedFlagWithNoTargetRefusal(verb, tokens2);
24925
24928
  if (repeated) return { ok: false, refusal: repeated };
24926
- const empty2 = SUBTREE_FLAGS.find(({ flag: flag2, token }) => tokens2[token] === "" || tokens2.trailingFlag === flag2);
24927
- if (empty2) {
24929
+ const empty = SUBTREE_FLAGS.find(({ flag: flag2, token }) => tokens2[token] === "" || tokens2.trailingFlag === flag2);
24930
+ if (empty) {
24928
24931
  return {
24929
24932
  ok: false,
24930
- refusal: `\`wayai ${verb} ${empty2.flag}\` needs ${empty2.target}, and none followed it.
24931
- wayai ${verb} ${empty2.flag} ${empty2.value}`
24933
+ refusal: `\`wayai ${verb} ${empty.flag}\` needs ${empty.target}, and none followed it.
24934
+ wayai ${verb} ${empty.flag} ${empty.value}`
24932
24935
  };
24933
24936
  }
24934
24937
  const layout = gitRoot ? resolveLayout(gitRoot) : null;
@@ -31087,12 +31090,12 @@ async function useCommand(args2) {
31087
31090
  ].join("\n")
31088
31091
  );
31089
31092
  }
31090
- const add2 = addFlag !== void 0;
31093
+ const add = addFlag !== void 0;
31091
31094
  const selector = resolveScopeSelector("use", args2);
31092
31095
  if (!selector) throw expected(USAGE2);
31093
31096
  const { axis, id } = resolveScopeTarget(selector);
31094
31097
  const noun = axisNoun(axis);
31095
- if (add2) {
31098
+ if (add) {
31096
31099
  const widened = addToScope(axis, id);
31097
31100
  console.log(
31098
31101
  widened ? `Worktree scope widened \u2014 now ${describeAxis(axis, widened)}.` : `Worktree scope already includes ${noun} ${id}.`
@@ -39255,69 +39258,6 @@ var init_file_map = __esm({
39255
39258
  }
39256
39259
  });
39257
39260
 
39258
- // ../../packages/core/dist/contracts/vault-import.js
39259
- var dryRunKey, dryRunCount, dryRunCounts, dryRunTable, baseVaultDryRunReport, BASE_VAULT_DRY_RUN_UNREADABLE, dryRunBaseId, baseVaultDryRunBase, BASE_VAULT_DRY_RUN_LISTINGS, baseVaultDryRunPage, baseVaultDryRunQuery, S3_CREDENTIAL_COUNT_PAGE_KEYS, s3CountInstant, s3CountCursor, s3CredentialCountOrg, s3CredentialCountPage, s3CredentialCountQuery;
39260
- var init_vault_import = __esm({
39261
- "../../packages/core/dist/contracts/vault-import.js"() {
39262
- "use strict";
39263
- init_chunk_HZ6CADSY();
39264
- init_chunk_MIWZOSPI();
39265
- init_zod();
39266
- dryRunKey = external_exports.string().regex(/^[a-z][a-z0-9_]{0,63}$/);
39267
- dryRunCount = external_exports.number().int().nonnegative();
39268
- dryRunCounts = external_exports.record(dryRunKey, dryRunCount);
39269
- dryRunTable = external_exports.record(dryRunKey, dryRunCounts);
39270
- baseVaultDryRunReport = external_exports.strictObject({
39271
- stores: dryRunTable,
39272
- would_move: dryRunCounts,
39273
- would_refuse: dryRunTable
39274
- });
39275
- BASE_VAULT_DRY_RUN_UNREADABLE = ["overloaded", "timeout", "error"];
39276
- dryRunBaseId = external_exports.string().min(1).max(512);
39277
- baseVaultDryRunBase = external_exports.discriminatedUnion("status", [
39278
- external_exports.strictObject({ base_id: dryRunBaseId, status: external_exports.literal("read"), report: baseVaultDryRunReport }),
39279
- external_exports.strictObject({ base_id: dryRunBaseId, status: external_exports.literal("absent") }),
39280
- external_exports.strictObject({ base_id: dryRunBaseId, status: external_exports.literal("unreadable"), reason: external_exports.enum(BASE_VAULT_DRY_RUN_UNREADABLE) })
39281
- ]);
39282
- BASE_VAULT_DRY_RUN_LISTINGS = ["named", "registry", "registry_not_seeded"];
39283
- baseVaultDryRunPage = external_exports.strictObject({
39284
- org_id: external_exports.string().min(1).max(128),
39285
- listing: external_exports.enum(BASE_VAULT_DRY_RUN_LISTINGS),
39286
- bases: external_exports.array(baseVaultDryRunBase).max(50),
39287
- next_after: dryRunBaseId.nullable()
39288
- });
39289
- baseVaultDryRunQuery = external_exports.object({
39290
- org_id: uuidSchema,
39291
- /** A base id as the CLI sends one: it names a Durable Object and nothing else. */
39292
- base_id: external_exports.string().regex(/^(?!\.\.?$)[A-Za-z0-9._-]{1,256}$/).optional(),
39293
- after: dryRunBaseId.optional()
39294
- }).refine((query) => !(query.base_id && query.after), { message: "base_id and after cannot be combined" });
39295
- S3_CREDENTIAL_COUNT_PAGE_KEYS = 500;
39296
- s3CountInstant = timestampSchema.refine(isIsoTimestamp).nullable();
39297
- s3CountCursor = external_exports.string().min(1).max(4096);
39298
- s3CredentialCountOrg = external_exports.strictObject({
39299
- org_id: external_exports.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
39300
- live: dryRunCount,
39301
- expired: dryRunCount,
39302
- no_expiry: dryRunCount,
39303
- oldest_created_at: s3CountInstant,
39304
- newest_created_at: s3CountInstant,
39305
- last_expires_at: s3CountInstant
39306
- });
39307
- s3CredentialCountPage = external_exports.strictObject({
39308
- listed: dryRunCount.max(S3_CREDENTIAL_COUNT_PAGE_KEYS),
39309
- vanished: dryRunCount,
39310
- unreadable: dryRunCount,
39311
- orgs: external_exports.array(s3CredentialCountOrg).max(S3_CREDENTIAL_COUNT_PAGE_KEYS),
39312
- next_cursor: s3CountCursor.nullable()
39313
- });
39314
- s3CredentialCountQuery = external_exports.object({
39315
- org_id: uuidSchema,
39316
- cursor: s3CountCursor.optional()
39317
- });
39318
- }
39319
- });
39320
-
39321
39261
  // ../../packages/core/dist/contracts/vault.js
39322
39262
  var vaultIdSchema, vaultFailureOutcomeSchema, vaultRefreshCategorySchema, vaultFailureBodySchema, vaultSendEnvelopeSchema, vaultVerifyEnvelopeSchema, vaultAutomationHmacEnvelopeSchema, vaultAutomationStaticEnvelopeSchema, AUTOMATION_WEBHOOK_VAULT_GATE_ID, GITHUB_APP_VAULT_GATE_ID, vaultVerifyResponseSchema, vaultVersionSchema, vaultPutResponseSchema, vaultMetaResponseSchema, vaultDeleteResponseSchema, vaultInstantSchema, vaultRefreshResponseSchema, vaultMintResponseSchema, vaultSignEnvelopeSchema, VAULT_SIGN_MAX_BODY_BYTES, vaultSignResponseSchema;
39323
39263
  var init_vault = __esm({
@@ -39392,99 +39332,6 @@ var init_vault = __esm({
39392
39332
  }
39393
39333
  });
39394
39334
 
39395
- // src/lib/base-vault-dry-run.ts
39396
- function addCounts(into, from) {
39397
- for (const [key, value] of Object.entries(from)) {
39398
- if (typeof value === "number") {
39399
- into[key] = (into[key] ?? 0) + value;
39400
- } else {
39401
- into[key] ??= {};
39402
- addCounts(into[key], value);
39403
- }
39404
- }
39405
- }
39406
- function summarizeBaseVaultDryRun(input) {
39407
- const bases = input.pages.flatMap((page) => page.bases);
39408
- const totals = { stores: {}, would_move: {}, would_refuse: {} };
39409
- for (const base of bases) {
39410
- if (base.status === "read") addCounts(totals, base.report);
39411
- }
39412
- const count = (status) => bases.filter((base) => base.status === status).length;
39413
- const nextAfter = input.pages.at(-1)?.next_after ?? null;
39414
- const reasons = [];
39415
- if (input.resumedAfter) reasons.push("resumed_from_cursor");
39416
- if (input.pages.some((page) => page.listing === "named")) reasons.push("single_base");
39417
- if (nextAfter !== null) reasons.push("listing_truncated");
39418
- if (count("unreadable") > 0) reasons.push("base_unreadable");
39419
- if (input.pages.some((page) => page.listing === "registry_not_seeded")) reasons.push("registry_not_seeded");
39420
- if (input.stop) reasons.push(input.stop);
39421
- return {
39422
- org_id: input.orgId,
39423
- complete: reasons.length === 0,
39424
- incomplete_reasons: reasons,
39425
- reads: input.pages.length,
39426
- bases_listed: bases.length,
39427
- bases_read: count("read"),
39428
- bases_absent: count("absent"),
39429
- bases_unreadable: count("unreadable"),
39430
- totals,
39431
- next_after: nextAfter,
39432
- bases
39433
- };
39434
- }
39435
- var init_base_vault_dry_run = __esm({
39436
- "src/lib/base-vault-dry-run.ts"() {
39437
- "use strict";
39438
- }
39439
- });
39440
-
39441
- // src/lib/s3-credential-count.ts
39442
- function add(into, from) {
39443
- into.live += from.live;
39444
- into.expired += from.expired;
39445
- into.no_expiry += from.no_expiry;
39446
- into.oldest_created_at = earliest(into.oldest_created_at, from.oldest_created_at);
39447
- into.newest_created_at = latest(into.newest_created_at, from.newest_created_at);
39448
- into.last_expires_at = latest(into.last_expires_at, from.last_expires_at);
39449
- }
39450
- function summarizeS3CredentialCount(input) {
39451
- const orgs = /* @__PURE__ */ new Map();
39452
- const total = { ...empty(), orgs: 0 };
39453
- for (const row of input.pages.flatMap((page) => page.orgs)) {
39454
- const into = orgs.get(row.org_id) ?? { org_id: row.org_id, ...empty() };
39455
- orgs.set(row.org_id, into);
39456
- add(into, row);
39457
- add(total, row);
39458
- }
39459
- total.orgs = orgs.size;
39460
- const nextCursor = input.pages.length === 0 ? input.resumedFrom ?? null : input.pages.at(-1).next_cursor;
39461
- const sum = (field) => input.pages.reduce((n, page) => n + page[field], 0);
39462
- const reasons = [];
39463
- if (input.resumedFrom) reasons.push("resumed_from_cursor");
39464
- if (nextCursor !== null) reasons.push("listing_truncated");
39465
- if (input.stop) reasons.push(input.stop);
39466
- return {
39467
- complete: reasons.length === 0,
39468
- incomplete_reasons: reasons,
39469
- reads: input.pages.length,
39470
- listed: sum("listed"),
39471
- vanished: sum("vanished"),
39472
- unreadable: sum("unreadable"),
39473
- total,
39474
- next_cursor: nextCursor,
39475
- orgs: [...orgs.values()].sort((a, b) => a.org_id < b.org_id ? -1 : 1)
39476
- };
39477
- }
39478
- var earliest, latest, empty;
39479
- var init_s3_credential_count = __esm({
39480
- "src/lib/s3-credential-count.ts"() {
39481
- "use strict";
39482
- earliest = (a, b) => a === null || b !== null && b < a ? b : a;
39483
- latest = (a, b) => a === null || b !== null && b > a ? b : a;
39484
- empty = () => ({ live: 0, expired: 0, no_expiry: 0, oldest_created_at: null, newest_created_at: null, last_expires_at: null });
39485
- }
39486
- });
39487
-
39488
39335
  // src/commands/admin.ts
39489
39336
  var admin_exports = {};
39490
39337
  __export(admin_exports, {
@@ -39701,23 +39548,6 @@ async function adminCommand(args2) {
39701
39548
  process.exit(1);
39702
39549
  }
39703
39550
  }
39704
- if (group === "vault") {
39705
- if (!sub) {
39706
- printHelp2();
39707
- process.exit(1);
39708
- }
39709
- switch (sub) {
39710
- case "base-dry-run":
39711
- await runVaultBaseDryRun(flagArgs);
39712
- return;
39713
- case "mount-credential-count":
39714
- await runVaultS3CredentialCount(flagArgs);
39715
- return;
39716
- default:
39717
- printHelp2();
39718
- process.exit(1);
39719
- }
39720
- }
39721
39551
  if (group === "harness") {
39722
39552
  if (!sub) {
39723
39553
  printHelp2();
@@ -40447,130 +40277,6 @@ async function runClearWayaiHostTokens(flagArgs) {
40447
40277
  console.log(` ${r.outcome.padEnd(12)} ${r.kind}:${r.id}${why}`);
40448
40278
  }
40449
40279
  }
40450
- async function readAdminPages(read, nextOf, start, paceMs = 0) {
40451
- const pages = [];
40452
- let cursor = start;
40453
- do {
40454
- if (pages.length > 0 && paceMs > 0) await new Promise((resolve13) => setTimeout(resolve13, paceMs));
40455
- try {
40456
- const page = await read(cursor);
40457
- pages.push(page);
40458
- cursor = nextOf(page) ?? void 0;
40459
- } catch (err) {
40460
- const limited = err instanceof ApiError && err.status === 429;
40461
- if (pages.length === 0 && !limited) {
40462
- exitOnApiError(err);
40463
- throw err;
40464
- }
40465
- return { pages, stop: limited ? "rate_limited" : "request_failed" };
40466
- }
40467
- } while (cursor);
40468
- return { pages };
40469
- }
40470
- async function runVaultBaseDryRun(flagArgs) {
40471
- const USAGE8 = "wayai admin vault base-dry-run --org <org_id> [--base <base_id>] [--after <base_id>] [--json]";
40472
- let orgId;
40473
- let baseId;
40474
- let after;
40475
- let jsonOutput = false;
40476
- for (let i = 0; i < flagArgs.length; i++) {
40477
- const flag = flagArgs[i];
40478
- if (flag === "--org") orgId = requireFlagValue(flagArgs, ++i, "--org");
40479
- else if (flag === "--base") baseId = requireFlagValue(flagArgs, ++i, "--base");
40480
- else if (flag === "--after") after = requireFlagValue(flagArgs, ++i, "--after");
40481
- else if (flag === "--json") jsonOutput = true;
40482
- else {
40483
- console.error(`Unknown flag: ${flag}`);
40484
- console.error(USAGE8);
40485
- process.exit(1);
40486
- }
40487
- }
40488
- const query = baseVaultDryRunQuery.safeParse({ org_id: orgId, base_id: baseId, after });
40489
- if (!query.success) {
40490
- console.error("--org must be an organization id, --base a base id, and --base and --after cannot be combined.");
40491
- console.error(USAGE8);
40492
- process.exit(1);
40493
- }
40494
- const { config, accessToken } = await requireAuth();
40495
- const client = new ApiClient({ apiUrl: config.api_url, accessToken });
40496
- const { pages, stop } = await readAdminPages(
40497
- async (cursor) => (await client.debugBaseVaultDryRun({ ...query.data, after: cursor })).data,
40498
- (page) => page.next_after,
40499
- after
40500
- );
40501
- const summary = summarizeBaseVaultDryRun({ orgId: query.data.org_id, pages, resumedAfter: after, stop });
40502
- const gotItsBase = summary.bases_read === 1 && summary.incomplete_reasons.every((reason2) => reason2 === "single_base");
40503
- if (!summary.complete && !gotItsBase) process.exitCode = 1;
40504
- if (jsonOutput) {
40505
- console.log(JSON.stringify(summary, null, 2));
40506
- return;
40507
- }
40508
- const notSeeded = summary.incomplete_reasons.includes("registry_not_seeded");
40509
- console.log(`base vault dry run \u2014 org ${summary.org_id} \u2014 ${summary.complete ? "complete" : `INCOMPLETE, not the org's total (${summary.incomplete_reasons.join(", ")})`}`);
40510
- console.log(`reads: ${summary.reads} of the 120/hour cap`);
40511
- console.log(`bases: listed ${summary.bases_listed}, read ${summary.bases_read}, absent ${summary.bases_absent}, unreadable ${summary.bases_unreadable}`);
40512
- if (notSeeded) console.log("This org's base registry has never been filled; listing its bases once fills it. Re-run after.");
40513
- if (stop || summary.next_after) {
40514
- console.log(summary.next_after ? `To continue: --after ${summary.next_after}` : "Nothing read past the start; re-run later.");
40515
- }
40516
- const nonZero = (value) => flattenCounts(value).filter((line) => !line.endsWith(": 0"));
40517
- console.log("totals (non-zero):");
40518
- for (const line of nonZero(summary.totals)) console.log(` ${line}`);
40519
- for (const base of summary.bases) {
40520
- console.log(`${base.base_id}: ${base.status === "unreadable" ? `unreadable (${base.reason})` : base.status}`);
40521
- if (base.status === "read") for (const line of nonZero(base.report)) console.log(` ${line}`);
40522
- }
40523
- }
40524
- async function runVaultS3CredentialCount(flagArgs) {
40525
- const USAGE8 = "wayai admin vault mount-credential-count --org <org_id> [--cursor <cursor>] [--json]";
40526
- let orgId;
40527
- let cursor;
40528
- let jsonOutput = false;
40529
- for (let i = 0; i < flagArgs.length; i++) {
40530
- const flag = flagArgs[i];
40531
- if (flag === "--org") orgId = requireFlagValue(flagArgs, ++i, "--org");
40532
- else if (flag === "--cursor") cursor = requireFlagValue(flagArgs, ++i, "--cursor");
40533
- else if (flag === "--json") jsonOutput = true;
40534
- else {
40535
- console.error(`Unknown flag: ${flag}`);
40536
- console.error(USAGE8);
40537
- process.exit(1);
40538
- }
40539
- }
40540
- const query = s3CredentialCountQuery.safeParse({ org_id: orgId, cursor });
40541
- if (!query.success) {
40542
- console.error("--org must be an organization id, and --cursor the cursor a run printed.");
40543
- console.error(USAGE8);
40544
- process.exit(1);
40545
- }
40546
- const { config, accessToken } = await requireAuth();
40547
- const client = new ApiClient({ apiUrl: config.api_url, accessToken });
40548
- const { pages, stop } = await readAdminPages(
40549
- async (next) => (await client.debugS3CredentialCount({ org_id: query.data.org_id, cursor: next })).data,
40550
- (page) => page.next_cursor,
40551
- cursor,
40552
- MOUNT_CREDENTIAL_COUNT_PACE_MS
40553
- );
40554
- const summary = summarizeS3CredentialCount({ pages, resumedFrom: cursor, stop });
40555
- if (!summary.complete) process.exitCode = 1;
40556
- if (jsonOutput) {
40557
- console.log(JSON.stringify(summary, null, 2));
40558
- return;
40559
- }
40560
- const { total } = summary;
40561
- console.log(`S3 credential count \u2014 every org \u2014 ${summary.complete ? "complete" : `INCOMPLETE, not the platform's total (${summary.incomplete_reasons.join(", ")})`}`);
40562
- console.log(`reads: ${summary.reads} of the 120/hour cap`);
40563
- console.log(`keys: listed ${summary.listed}, gone by their read ${summary.vanished}, with no org ${summary.unreadable}`);
40564
- console.log(`live: ${total.live} in ${total.orgs} org(s); expired, not yet evicted: ${total.expired}; with no expiry: ${total.no_expiry}`);
40565
- const lastExpiry = (counts) => counts.no_expiry > 0 ? `never: ${counts.no_expiry} hold no expiry` : counts.last_expires_at ?? "never";
40566
- if (total.live > 0) console.log(`created ${total.oldest_created_at ?? "?"} to ${total.newest_created_at ?? "?"}; the last expires ${lastExpiry(total)}`);
40567
- if (stop || summary.next_cursor) {
40568
- console.log(summary.next_cursor ? `To continue: --cursor ${summary.next_cursor}` : "Nothing read past the start; re-run later.");
40569
- }
40570
- for (const row of summary.orgs) {
40571
- console.log(`${row.org_id}: live ${row.live}, expired ${row.expired}, no expiry ${row.no_expiry}, created ${row.oldest_created_at ?? "?"} to ${row.newest_created_at ?? "?"}, last expires ${lastExpiry(row)}`);
40572
- }
40573
- }
40574
40280
  async function runRepairBranchingOrphans(flagArgs) {
40575
40281
  const USAGE8 = "wayai admin hubs repair-branching-orphans --all | --org <org_id> | --hub <hub_id> [--id <type>:<id> ...] [--dry-run] [--yes] [--json]";
40576
40282
  const targets = [];
@@ -41871,10 +41577,9 @@ Usage:
41871
41577
  wayai admin do tables <type> <id>
41872
41578
  wayai admin do read <type> <id> <table> [--limit N] [--id X] [--json]
41873
41579
  wayai admin do counts <hub|org> <id> [--json] Numbers, no text: a hub's toolset connections, knowledge placeholders per stored
41874
- text, summary and kanban context schemas' verdicts, secret columns' shapes,
41875
- (production) publish state and stored_credentials, its values still
41876
- ciphertext or held by the vault, per store; an org's
41877
- skills, hub links, moved-knowledge registry, credentials' shapes and stored_credentials
41580
+ text, summary and kanban context schemas' verdicts, secret columns' shapes and
41581
+ (production) publish state; an org's skills, hub links, moved-knowledge
41582
+ registry and credentials' shapes
41878
41583
 
41879
41584
  wayai admin analytics tables
41880
41585
  wayai admin analytics read <table> [--conversation-id X] [--hub-id Y] [--message-id Z] [--limit N] [--json]
@@ -41967,11 +41672,6 @@ Usage:
41967
41672
  wayai admin guide clear [--json] Turn the Guide off: nobody new is enrolled and the help entry is hidden
41968
41673
  wayai admin guide status [--json] Print which hub is the Guide, and its facts
41969
41674
 
41970
- wayai admin vault base-dry-run --org <org_id> [--base <base_id>] [--after <base_id>] [--json]
41971
- What moving an org's base secrets to the vault would do: counts and reason codes per base, and the sum over the bases read. Reads only. One read per 50 bases (or one for --base), one sleeping base woken per base read: by hand, never scheduled. Marks and exits non-zero on any partial result (a base unreadable, the budget hit, a resumed run)
41972
- wayai admin vault mount-credential-count --org <org_id> [--cursor <cursor>] [--json]
41973
- How many S3 mount credentials every org holds: live, expired, with no expiry, and when created. Counts only, never a key. --org is the org the read is attested under. One read per 500 credentials: by hand, never scheduled. Marks and exits non-zero on any partial result
41974
-
41975
41675
  wayai admin vault-gate status [--json] Print the vault_connector_ids list (on production it decides only Instagram's gate: the backend's vault-gate.ts)
41976
41676
  wayai admin vault-gate add <connector> [--yes] [--json]
41977
41677
  List a connector: a vault connector's name (e.g. telegram, whatsapp, instagram, or openai for its LLM, STT and TTS ids, never GPT-Live's) or one catalog id (GPT-Live's only so); prints before and after, confirms unless --yes
@@ -42144,7 +41844,7 @@ Audit + rate limit:
42144
41844
  across all sources. Platform-admin grant required.
42145
41845
  `.trim());
42146
41846
  }
42147
- var VALID_TYPES, VALID_ANALYTICS_TABLES, MOUNT_CREDENTIAL_COUNT_PACE_MS, HARNESS_GATE, VOICE_CALLS_GATE, THREADS_GATE, COMMUNITIES_GATE, CASES_GATE, PLATFORM_CONFIG_PROPAGATION_NOTE, VAULT_GATE_CONNECTORS, VAULT_GATE_BY_ID_ONLY, VALID_NOTICE_SEVERITIES;
41847
+ var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE, VOICE_CALLS_GATE, THREADS_GATE, COMMUNITIES_GATE, CASES_GATE, PLATFORM_CONFIG_PROPAGATION_NOTE, VAULT_GATE_CONNECTORS, VAULT_GATE_BY_ID_ONLY, VALID_NOTICE_SEVERITIES;
42148
41848
  var init_admin = __esm({
42149
41849
  "src/commands/admin.ts"() {
42150
41850
  "use strict";
@@ -42158,13 +41858,9 @@ var init_admin = __esm({
42158
41858
  init_file_map();
42159
41859
  init_errors3();
42160
41860
  init_contracts();
42161
- init_vault_import();
42162
41861
  init_vault();
42163
- init_base_vault_dry_run();
42164
- init_s3_credential_count();
42165
41862
  VALID_TYPES = dataExplorerDebugDoType.options;
42166
41863
  VALID_ANALYTICS_TABLES = dataExplorerDebugAnalyticsTable.options;
42167
- MOUNT_CREDENTIAL_COUNT_PACE_MS = 12500;
42168
41864
  HARNESS_GATE = {
42169
41865
  group: "harness",
42170
41866
  key: "harness_enabled",
@@ -42238,8 +41934,8 @@ var init_admin = __esm({
42238
41934
  });
42239
41935
 
42240
41936
  // src/lib/version-status.ts
42241
- function componentStatus(current, latest2) {
42242
- return { current, latest: latest2, behind: Boolean(current && latest2 && isNewerVersion(latest2, current)) };
41937
+ function componentStatus(current, latest) {
41938
+ return { current, latest, behind: Boolean(current && latest && isNewerVersion(latest, current)) };
42243
41939
  }
42244
41940
  function resolveVersionStatus(cliVersion) {
42245
41941
  const cliLatest = readVersionCache(CLI_CACHE_FILE)?.latest ?? null;
@@ -42671,18 +42367,18 @@ async function updateCommand(pkg2) {
42671
42367
  console.log(`Current version: ${pkg2.version}`);
42672
42368
  console.log("Checking for updates...");
42673
42369
  try {
42674
- const latest2 = execSync("npm view @wayai/cli version", {
42370
+ const latest = execSync("npm view @wayai/cli version", {
42675
42371
  timeout: 1e4
42676
42372
  }).toString().trim();
42677
- if (latest2 === pkg2.version) {
42373
+ if (latest === pkg2.version) {
42678
42374
  console.log(`Already on the latest version (${pkg2.version}).`);
42679
42375
  } else {
42680
- console.log(`Updating ${pkg2.version} \u2192 ${latest2}...`);
42376
+ console.log(`Updating ${pkg2.version} \u2192 ${latest}...`);
42681
42377
  execSync("npm install -g @wayai/cli@latest", {
42682
42378
  timeout: 6e4,
42683
42379
  stdio: "inherit"
42684
42380
  });
42685
- console.log(`Updated to ${latest2}.`);
42381
+ console.log(`Updated to ${latest}.`);
42686
42382
  }
42687
42383
  } catch (err) {
42688
42384
  captureException2(err);
@@ -45106,10 +44802,10 @@ function refreshCliCache() {
45106
44802
  return new Promise((resolve13) => {
45107
44803
  exec("npm view @wayai/cli version", { timeout: REFRESH_TIMEOUT_MS }, (err, stdout) => {
45108
44804
  if (!err) {
45109
- const latest2 = stdout.trim();
45110
- if (latest2) {
44805
+ const latest = stdout.trim();
44806
+ if (latest) {
45111
44807
  try {
45112
- writeVersionCache(CLI_CACHE_FILE, { lastCheck: Date.now(), latest: latest2 });
44808
+ writeVersionCache(CLI_CACHE_FILE, { lastCheck: Date.now(), latest });
45113
44809
  } catch {
45114
44810
  }
45115
44811
  }
@@ -45125,10 +44821,10 @@ async function refreshSkillCache() {
45125
44821
  try {
45126
44822
  const res = await fetch(url, { signal: controller.signal });
45127
44823
  if (res.ok) {
45128
- const latest2 = parseFrontmatterVersion(await res.text());
45129
- if (latest2) {
44824
+ const latest = parseFrontmatterVersion(await res.text());
44825
+ if (latest) {
45130
44826
  try {
45131
- writeVersionCache(SKILL_CACHE_FILE, { lastCheck: Date.now(), latest: latest2 });
44827
+ writeVersionCache(SKILL_CACHE_FILE, { lastCheck: Date.now(), latest });
45132
44828
  } catch {
45133
44829
  }
45134
44830
  }
@@ -45158,10 +44854,10 @@ async function fetchAndCacheAdminSkillVersion() {
45158
44854
  const accessToken = await getAccessToken2(config);
45159
44855
  const client = new ApiClient2({ apiUrl: config.api_url, accessToken });
45160
44856
  const res = await client.adminSkillInstall(ADMIN_SKILL_NAME);
45161
- const latest2 = parseFrontmatterVersion(res.files[SKILL_FILENAME] ?? "");
45162
- if (latest2) {
44857
+ const latest = parseFrontmatterVersion(res.files[SKILL_FILENAME] ?? "");
44858
+ if (latest) {
45163
44859
  try {
45164
- writeVersionCache(ADMIN_SKILL_CACHE_FILE, { lastCheck: Date.now(), latest: latest2 });
44860
+ writeVersionCache(ADMIN_SKILL_CACHE_FILE, { lastCheck: Date.now(), latest });
45165
44861
  } catch {
45166
44862
  }
45167
44863
  }