@wayai/cli 0.3.314 → 0.3.316
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 +2317 -1970
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5104,131 +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
|
-
// ../../packages/core/dist/chunk-VXEAR36B.js
|
|
5201
|
-
var orgTagIdParam, listOrgTagsQuery, ORG_TAG_NAME_REGEX, ORG_TAG_NAME_MAX_LENGTH, createOrgTagBody, updateOrgTagBody;
|
|
5202
|
-
var init_chunk_VXEAR36B = __esm({
|
|
5203
|
-
"../../packages/core/dist/chunk-VXEAR36B.js"() {
|
|
5204
|
-
"use strict";
|
|
5205
|
-
init_zod();
|
|
5206
|
-
orgTagIdParam = external_exports.object({
|
|
5207
|
-
id: external_exports.string().uuid()
|
|
5208
|
-
});
|
|
5209
|
-
listOrgTagsQuery = external_exports.object({
|
|
5210
|
-
organization_id: external_exports.string().uuid()
|
|
5211
|
-
});
|
|
5212
|
-
ORG_TAG_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
5213
|
-
ORG_TAG_NAME_MAX_LENGTH = 50;
|
|
5214
|
-
createOrgTagBody = external_exports.object({
|
|
5215
|
-
organization_id: external_exports.string().uuid(),
|
|
5216
|
-
name: external_exports.string().min(1).max(ORG_TAG_NAME_MAX_LENGTH).regex(ORG_TAG_NAME_REGEX, {
|
|
5217
|
-
message: 'Must be lowercase alphanumeric with hyphens (e.g. "my-tag")'
|
|
5218
|
-
}),
|
|
5219
|
-
display_name: external_exports.string().max(100).nullish(),
|
|
5220
|
-
color: external_exports.string().max(20).nullish()
|
|
5221
|
-
});
|
|
5222
|
-
updateOrgTagBody = external_exports.object({
|
|
5223
|
-
// Required so the route targets the org the UI is managing (which may differ
|
|
5224
|
-
// from the token's default `auth.org_id` for multi-org users) — mirrors create/list.
|
|
5225
|
-
organization_id: external_exports.string().uuid(),
|
|
5226
|
-
display_name: external_exports.string().max(100).nullish(),
|
|
5227
|
-
color: external_exports.string().max(20).nullish()
|
|
5228
|
-
});
|
|
5229
|
-
}
|
|
5230
|
-
});
|
|
5231
|
-
|
|
5232
5107
|
// ../../packages/core/dist/chunk-HZ6CADSY.js
|
|
5233
5108
|
function optionalTrimmedText(max) {
|
|
5234
5109
|
return external_exports.string().trim().max(max).optional().transform((value) => value ? value : void 0);
|
|
@@ -5479,113 +5354,6 @@ var init_chunk_Q7KIQHAZ = __esm({
|
|
|
5479
5354
|
}
|
|
5480
5355
|
});
|
|
5481
5356
|
|
|
5482
|
-
// ../../packages/core/dist/chunk-MIWZOSPI.js
|
|
5483
|
-
function toIso(epochMs) {
|
|
5484
|
-
return new Date(epochMs).toISOString();
|
|
5485
|
-
}
|
|
5486
|
-
function fromIso(iso) {
|
|
5487
|
-
return new Date(iso).getTime();
|
|
5488
|
-
}
|
|
5489
|
-
function isIsoTimestamp(value) {
|
|
5490
|
-
return typeof value === "string" && ISO_UTC_RE.test(value);
|
|
5491
|
-
}
|
|
5492
|
-
var ISO_UTC_RE;
|
|
5493
|
-
var init_chunk_MIWZOSPI = __esm({
|
|
5494
|
-
"../../packages/core/dist/chunk-MIWZOSPI.js"() {
|
|
5495
|
-
"use strict";
|
|
5496
|
-
ISO_UTC_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
5497
|
-
}
|
|
5498
|
-
});
|
|
5499
|
-
|
|
5500
|
-
// ../../packages/core/dist/chunk-MF2VVXBR.js
|
|
5501
|
-
var credentialExpiresAtSchema, LINKED_EXPIRY_REFUSAL;
|
|
5502
|
-
var init_chunk_MF2VVXBR = __esm({
|
|
5503
|
-
"../../packages/core/dist/chunk-MF2VVXBR.js"() {
|
|
5504
|
-
"use strict";
|
|
5505
|
-
init_chunk_HZ6CADSY();
|
|
5506
|
-
init_chunk_MIWZOSPI();
|
|
5507
|
-
credentialExpiresAtSchema = timestampSchema.refine(isIsoTimestamp, "Expected a canonical ISO timestamp").nullable();
|
|
5508
|
-
LINKED_EXPIRY_REFUSAL = "A linked organization credential's expiry is set on the credential";
|
|
5509
|
-
}
|
|
5510
|
-
});
|
|
5511
|
-
|
|
5512
|
-
// ../../packages/core/dist/chunk-HA7CRZMX.js
|
|
5513
|
-
var connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, BESIDE_LINK_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery;
|
|
5514
|
-
var init_chunk_HA7CRZMX = __esm({
|
|
5515
|
-
"../../packages/core/dist/chunk-HA7CRZMX.js"() {
|
|
5516
|
-
"use strict";
|
|
5517
|
-
init_chunk_MF2VVXBR();
|
|
5518
|
-
init_chunk_HZ6CADSY();
|
|
5519
|
-
init_zod();
|
|
5520
|
-
connectionIdParam = external_exports.object({ id: uuidSchema });
|
|
5521
|
-
connectorIdParam = external_exports.object({ id: uuidSchema });
|
|
5522
|
-
listConnectionsQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5523
|
-
deleteConnectionQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5524
|
-
addConnectionBody = external_exports.object({
|
|
5525
|
-
hub_id: uuidSchema,
|
|
5526
|
-
connector_id: uuidSchema,
|
|
5527
|
-
authentication_type: external_exports.string().optional(),
|
|
5528
|
-
inbound_mode: external_exports.enum(["wayai", "resend"]).optional(),
|
|
5529
|
-
inbound_address: external_exports.string().email().optional(),
|
|
5530
|
-
// Opt out of copying this connection's credentials into production on publish/sync.
|
|
5531
|
-
// Defaults to true at the DB layer.
|
|
5532
|
-
sync_credentials_to_production: external_exports.boolean().optional(),
|
|
5533
|
-
// When the connection's own secret expires; null for none (`credential-expiry.ts`).
|
|
5534
|
-
expires_at: credentialExpiresAtSchema.optional()
|
|
5535
|
-
}).passthrough().superRefine((data, ctx) => {
|
|
5536
|
-
if (data.inbound_mode === "resend" && !data.inbound_address) {
|
|
5537
|
-
ctx.addIssue({
|
|
5538
|
-
code: external_exports.ZodIssueCode.custom,
|
|
5539
|
-
message: "Receiving email address is required when using Resend inbound mode",
|
|
5540
|
-
path: ["inbound_address"]
|
|
5541
|
-
});
|
|
5542
|
-
}
|
|
5543
|
-
});
|
|
5544
|
-
editConnectionBody = external_exports.object({
|
|
5545
|
-
hub_id: uuidSchema,
|
|
5546
|
-
sync_credentials_to_production: external_exports.boolean().optional(),
|
|
5547
|
-
expires_at: credentialExpiresAtSchema.optional()
|
|
5548
|
-
}).passthrough();
|
|
5549
|
-
PRODUCTION_DIRECT_FIELDS = ["username", "api_key", "access_token", "password", "refresh_token", "webhook_secret_token", "webhook_signing_secret", "github_app_id", "github_app_private_key"];
|
|
5550
|
-
BESIDE_LINK_FIELDS = /* @__PURE__ */ new Set(["webhook_secret_token", "github_app_id", "github_app_private_key"]);
|
|
5551
|
-
setProductionCredentialBody = external_exports.object({
|
|
5552
|
-
hub_id: uuidSchema,
|
|
5553
|
-
organization_credential_id: external_exports.string().nullable().optional(),
|
|
5554
|
-
organization_credential_token_id: external_exports.string().nullable().optional(),
|
|
5555
|
-
username: external_exports.string().optional(),
|
|
5556
|
-
api_key: external_exports.string().optional(),
|
|
5557
|
-
access_token: external_exports.string().optional(),
|
|
5558
|
-
password: external_exports.string().optional(),
|
|
5559
|
-
refresh_token: external_exports.string().optional(),
|
|
5560
|
-
webhook_secret_token: external_exports.string().optional(),
|
|
5561
|
-
webhook_signing_secret: external_exports.string().optional(),
|
|
5562
|
-
github_app_id: external_exports.string().optional(),
|
|
5563
|
-
github_app_private_key: external_exports.string().optional(),
|
|
5564
|
-
expires_at: credentialExpiresAtSchema.optional()
|
|
5565
|
-
}).strict().superRefine((data, ctx) => {
|
|
5566
|
-
const hasOrgLink = !!data.organization_credential_id || !!data.organization_credential_token_id;
|
|
5567
|
-
const sets = (f) => data[f] != null && data[f] !== `__USE_EXISTING_${f.toUpperCase()}__`;
|
|
5568
|
-
const hasDirect = PRODUCTION_DIRECT_FIELDS.some(sets);
|
|
5569
|
-
const hasDirectBesideLink = PRODUCTION_DIRECT_FIELDS.some((f) => !BESIDE_LINK_FIELDS.has(f) && sets(f));
|
|
5570
|
-
if (hasOrgLink && hasDirectBesideLink) {
|
|
5571
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "Provide either an organization credential link or direct credential fields, not both" });
|
|
5572
|
-
}
|
|
5573
|
-
if (hasOrgLink && data.expires_at != null) {
|
|
5574
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: LINKED_EXPIRY_REFUSAL, path: ["expires_at"] });
|
|
5575
|
-
}
|
|
5576
|
-
if (!hasOrgLink && !hasDirect && data.expires_at === void 0) {
|
|
5577
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "A credential is required: link an organization credential or provide a credential field" });
|
|
5578
|
-
}
|
|
5579
|
-
});
|
|
5580
|
-
registerWhatsappQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5581
|
-
registerWhatsappBody = external_exports.object({
|
|
5582
|
-
pin: external_exports.string().optional()
|
|
5583
|
-
});
|
|
5584
|
-
retryProvisioningQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5585
|
-
resendDomainStatusQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5586
|
-
}
|
|
5587
|
-
});
|
|
5588
|
-
|
|
5589
5357
|
// ../../packages/core/dist/chunk-IPXBFWUU.js
|
|
5590
5358
|
var variantAiModeSchema, experimentStatusSchema, overlayUpdateSchema, experimentIdParam, variantIdParam, listExperimentsQuery, listVariantsQuery, listOverridesQuery, deleteOverrideQuery, createExperimentBody, updateExperimentBody, setExperimentStatusBody, createVariantBody, updateVariantBody, upsertOverrideBody;
|
|
5591
5359
|
var init_chunk_IPXBFWUU = __esm({
|
|
@@ -5691,6 +5459,36 @@ var init_chunk_NKLVUTFO = __esm({
|
|
|
5691
5459
|
}
|
|
5692
5460
|
});
|
|
5693
5461
|
|
|
5462
|
+
// ../../packages/core/dist/chunk-MIWZOSPI.js
|
|
5463
|
+
function toIso(epochMs) {
|
|
5464
|
+
return new Date(epochMs).toISOString();
|
|
5465
|
+
}
|
|
5466
|
+
function fromIso(iso) {
|
|
5467
|
+
return new Date(iso).getTime();
|
|
5468
|
+
}
|
|
5469
|
+
function isIsoTimestamp(value) {
|
|
5470
|
+
return typeof value === "string" && ISO_UTC_RE.test(value);
|
|
5471
|
+
}
|
|
5472
|
+
var ISO_UTC_RE;
|
|
5473
|
+
var init_chunk_MIWZOSPI = __esm({
|
|
5474
|
+
"../../packages/core/dist/chunk-MIWZOSPI.js"() {
|
|
5475
|
+
"use strict";
|
|
5476
|
+
ISO_UTC_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
5477
|
+
}
|
|
5478
|
+
});
|
|
5479
|
+
|
|
5480
|
+
// ../../packages/core/dist/chunk-MF2VVXBR.js
|
|
5481
|
+
var credentialExpiresAtSchema, LINKED_EXPIRY_REFUSAL;
|
|
5482
|
+
var init_chunk_MF2VVXBR = __esm({
|
|
5483
|
+
"../../packages/core/dist/chunk-MF2VVXBR.js"() {
|
|
5484
|
+
"use strict";
|
|
5485
|
+
init_chunk_HZ6CADSY();
|
|
5486
|
+
init_chunk_MIWZOSPI();
|
|
5487
|
+
credentialExpiresAtSchema = timestampSchema.refine(isIsoTimestamp, "Expected a canonical ISO timestamp").nullable();
|
|
5488
|
+
LINKED_EXPIRY_REFUSAL = "A linked organization credential's expiry is set on the credential";
|
|
5489
|
+
}
|
|
5490
|
+
});
|
|
5491
|
+
|
|
5694
5492
|
// ../../packages/core/dist/chunk-NYNOISIG.js
|
|
5695
5493
|
function normalizeAuthType(raw) {
|
|
5696
5494
|
if (VALID_AUTH_TYPES.has(raw)) return raw;
|
|
@@ -5815,168 +5613,275 @@ var init_chunk_6JOESMU5 = __esm({
|
|
|
5815
5613
|
}
|
|
5816
5614
|
});
|
|
5817
5615
|
|
|
5818
|
-
// ../../packages/core/dist/chunk-
|
|
5819
|
-
var
|
|
5820
|
-
var
|
|
5821
|
-
"../../packages/core/dist/chunk-
|
|
5616
|
+
// ../../packages/core/dist/chunk-YVY2TZK2.js
|
|
5617
|
+
var orgResourceIdParam, orgResourceFileIdParam, orgResourceFolderIdParam, hubOrgResourceParam, listOrgResourcesQuery, orgIdQuery, createOrgResourceBody, updateOrgResourceBody, createOrgResourceFolderBody, updateOrgResourceFolderBody, uploadOrgResourceFileBody, updateOrgResourceFileBody, uploadOrgSkillZipBody, linkOrgResourceBody;
|
|
5618
|
+
var init_chunk_YVY2TZK2 = __esm({
|
|
5619
|
+
"../../packages/core/dist/chunk-YVY2TZK2.js"() {
|
|
5822
5620
|
"use strict";
|
|
5823
|
-
init_chunk_HZ6CADSY();
|
|
5824
5621
|
init_zod();
|
|
5825
|
-
|
|
5826
|
-
|
|
5622
|
+
orgResourceIdParam = external_exports.object({
|
|
5623
|
+
id: external_exports.string().uuid()
|
|
5827
5624
|
});
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
// ../../packages/core/dist/chunk-KEN2DASI.js
|
|
5832
|
-
var SECOND_FACTOR_TIERS, secondFactorTier, META_ENTITY_ID_PATTERN, metaEntityId, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, normalizeEmail, REVIEW_ACCOUNT_EMAILS;
|
|
5833
|
-
var init_chunk_KEN2DASI = __esm({
|
|
5834
|
-
"../../packages/core/dist/chunk-KEN2DASI.js"() {
|
|
5835
|
-
"use strict";
|
|
5836
|
-
init_zod();
|
|
5837
|
-
SECOND_FACTOR_TIERS = ["off", "settings"];
|
|
5838
|
-
secondFactorTier = external_exports.enum(SECOND_FACTOR_TIERS);
|
|
5839
|
-
META_ENTITY_ID_PATTERN = /^\d{1,32}$/;
|
|
5840
|
-
metaEntityId = external_exports.string().regex(META_ENTITY_ID_PATTERN, "must be a numeric Meta entity id");
|
|
5841
|
-
whatsappCallbackBody = external_exports.object({
|
|
5842
|
-
state: external_exports.string().min(1, "state is required"),
|
|
5843
|
-
code: external_exports.string().optional(),
|
|
5844
|
-
access_token: external_exports.string().optional(),
|
|
5845
|
-
user_id: external_exports.string().optional(),
|
|
5846
|
-
/**
|
|
5847
|
-
* The phone number and WABA the operator actually picked in Meta's Embedded
|
|
5848
|
-
* Signup popup (posted to the opener as `WA_EMBEDDED_SIGNUP`). Optional:
|
|
5849
|
-
* older clients, and the redirect-based flow, never see that event and fall
|
|
5850
|
-
* back to discovery.
|
|
5851
|
-
*/
|
|
5852
|
-
phone_number_id: metaEntityId.optional(),
|
|
5853
|
-
waba_id: metaEntityId.optional()
|
|
5854
|
-
}).refine(
|
|
5855
|
-
(data) => !!data.access_token || !!data.code,
|
|
5856
|
-
{ message: "Missing required parameters: state and either access_token or code" }
|
|
5857
|
-
);
|
|
5858
|
-
authMeResponse = external_exports.object({
|
|
5859
|
-
user_id: external_exports.string(),
|
|
5860
|
-
email: external_exports.string(),
|
|
5861
|
-
org_id: external_exports.string().nullable(),
|
|
5862
|
-
is_platform_admin: external_exports.boolean()
|
|
5625
|
+
orgResourceFileIdParam = external_exports.object({
|
|
5626
|
+
file_id: external_exports.string().uuid()
|
|
5863
5627
|
});
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
/** Seconds until the ticket expires if unconsumed. */
|
|
5867
|
-
expires_in: external_exports.number()
|
|
5628
|
+
orgResourceFolderIdParam = external_exports.object({
|
|
5629
|
+
folder_id: external_exports.string().uuid()
|
|
5868
5630
|
});
|
|
5869
|
-
|
|
5870
|
-
|
|
5631
|
+
hubOrgResourceParam = external_exports.object({
|
|
5632
|
+
id: external_exports.string().uuid(),
|
|
5633
|
+
org_resource_id: external_exports.string().uuid()
|
|
5871
5634
|
});
|
|
5872
|
-
|
|
5873
|
-
|
|
5635
|
+
listOrgResourcesQuery = external_exports.object({
|
|
5636
|
+
organization_id: external_exports.string().uuid(),
|
|
5637
|
+
hub_id: external_exports.string().uuid().optional()
|
|
5874
5638
|
});
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
// RFC 5321 max; bounds the request payload
|
|
5639
|
+
orgIdQuery = external_exports.object({
|
|
5640
|
+
organization_id: external_exports.string().uuid()
|
|
5878
5641
|
});
|
|
5879
|
-
|
|
5880
|
-
|
|
5642
|
+
createOrgResourceBody = external_exports.object({
|
|
5643
|
+
organization_id: external_exports.string().uuid(),
|
|
5644
|
+
resource_name: external_exports.string().min(1).max(255),
|
|
5645
|
+
resource_description: external_exports.string().max(1e3).nullish(),
|
|
5646
|
+
// Required (validated in the route layer, which names the field, since a refinement here
|
|
5647
|
+
// complicates the inferred input type for callers).
|
|
5648
|
+
skill_name: external_exports.string().min(1).max(255).nullish(),
|
|
5649
|
+
skill_version: external_exports.string().max(50).nullish(),
|
|
5650
|
+
enabled: external_exports.boolean().optional(),
|
|
5651
|
+
tags: external_exports.array(external_exports.string().uuid()).optional(),
|
|
5652
|
+
environment: external_exports.enum(["preview", "production", "all"]).optional()
|
|
5881
5653
|
});
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5654
|
+
updateOrgResourceBody = external_exports.object({
|
|
5655
|
+
resource_name: external_exports.string().min(1).max(255).optional(),
|
|
5656
|
+
resource_description: external_exports.string().max(1e3).nullish(),
|
|
5657
|
+
skill_name: external_exports.string().min(1).max(255).nullish(),
|
|
5658
|
+
skill_version: external_exports.string().max(50).nullish(),
|
|
5659
|
+
enabled: external_exports.boolean().optional(),
|
|
5660
|
+
tags: external_exports.array(external_exports.string().uuid()).optional(),
|
|
5661
|
+
environment: external_exports.enum(["preview", "production", "all"]).optional()
|
|
5887
5662
|
});
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5663
|
+
createOrgResourceFolderBody = external_exports.object({
|
|
5664
|
+
org_resource_id: external_exports.string().uuid(),
|
|
5665
|
+
folder_name: external_exports.string().min(1).max(255),
|
|
5666
|
+
folder_description: external_exports.string().max(1e3).nullish(),
|
|
5667
|
+
parent_folder_id: external_exports.string().uuid().nullish(),
|
|
5668
|
+
order_index: external_exports.number().int().nonnegative().optional(),
|
|
5669
|
+
enabled: external_exports.boolean().optional(),
|
|
5670
|
+
metadata: external_exports.record(external_exports.unknown()).optional()
|
|
5891
5671
|
});
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5672
|
+
updateOrgResourceFolderBody = external_exports.object({
|
|
5673
|
+
folder_name: external_exports.string().min(1).max(255).optional(),
|
|
5674
|
+
folder_description: external_exports.string().max(1e3).nullish(),
|
|
5675
|
+
parent_folder_id: external_exports.string().uuid().nullish(),
|
|
5676
|
+
order_index: external_exports.number().int().nonnegative().optional(),
|
|
5677
|
+
enabled: external_exports.boolean().optional(),
|
|
5678
|
+
metadata: external_exports.record(external_exports.unknown()).optional()
|
|
5679
|
+
});
|
|
5680
|
+
uploadOrgResourceFileBody = external_exports.object({
|
|
5681
|
+
org_resource_id: external_exports.string().uuid(),
|
|
5682
|
+
folder_id: external_exports.string().uuid().nullish(),
|
|
5683
|
+
file_name: external_exports.string().min(1).max(255),
|
|
5684
|
+
file_data: external_exports.string(),
|
|
5685
|
+
// base64
|
|
5686
|
+
mime_type: external_exports.string().optional(),
|
|
5687
|
+
file_size: external_exports.number().int().nonnegative().optional(),
|
|
5688
|
+
resource_file_tags: external_exports.array(external_exports.string()).optional(),
|
|
5689
|
+
metadata: external_exports.record(external_exports.unknown()).optional()
|
|
5690
|
+
});
|
|
5691
|
+
updateOrgResourceFileBody = external_exports.object({
|
|
5692
|
+
resource_file_title: external_exports.string().min(1).max(255).optional(),
|
|
5693
|
+
folder_id: external_exports.string().uuid().nullish(),
|
|
5694
|
+
order_index: external_exports.number().int().nonnegative().optional(),
|
|
5695
|
+
enabled: external_exports.boolean().optional(),
|
|
5696
|
+
resource_file_tags: external_exports.array(external_exports.string()).optional(),
|
|
5697
|
+
metadata: external_exports.record(external_exports.unknown()).optional()
|
|
5698
|
+
});
|
|
5699
|
+
uploadOrgSkillZipBody = external_exports.object({
|
|
5700
|
+
zip_data: external_exports.string().min(1),
|
|
5701
|
+
replace_existing: external_exports.boolean().optional()
|
|
5702
|
+
});
|
|
5703
|
+
linkOrgResourceBody = external_exports.object({
|
|
5704
|
+
org_resource_id: external_exports.string().uuid()
|
|
5897
5705
|
});
|
|
5898
|
-
normalizeEmail = (email) => email.trim().toLowerCase();
|
|
5899
|
-
REVIEW_ACCOUNT_EMAILS = new Set(
|
|
5900
|
-
["apple.review@wayai.pro", "play.review@wayai.pro", "microsoft.review@wayai.pro", "meta.review@wayai.pro"].map(
|
|
5901
|
-
normalizeEmail
|
|
5902
|
-
)
|
|
5903
|
-
);
|
|
5904
5706
|
}
|
|
5905
5707
|
});
|
|
5906
5708
|
|
|
5907
|
-
// ../../packages/core/dist/chunk-
|
|
5908
|
-
var
|
|
5909
|
-
var
|
|
5910
|
-
"../../packages/core/dist/chunk-
|
|
5709
|
+
// ../../packages/core/dist/chunk-VXEAR36B.js
|
|
5710
|
+
var orgTagIdParam, listOrgTagsQuery, ORG_TAG_NAME_REGEX, ORG_TAG_NAME_MAX_LENGTH, createOrgTagBody, updateOrgTagBody;
|
|
5711
|
+
var init_chunk_VXEAR36B = __esm({
|
|
5712
|
+
"../../packages/core/dist/chunk-VXEAR36B.js"() {
|
|
5911
5713
|
"use strict";
|
|
5912
|
-
init_chunk_KEN2DASI();
|
|
5913
5714
|
init_zod();
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5715
|
+
orgTagIdParam = external_exports.object({
|
|
5716
|
+
id: external_exports.string().uuid()
|
|
5717
|
+
});
|
|
5718
|
+
listOrgTagsQuery = external_exports.object({
|
|
5719
|
+
organization_id: external_exports.string().uuid()
|
|
5720
|
+
});
|
|
5721
|
+
ORG_TAG_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
5722
|
+
ORG_TAG_NAME_MAX_LENGTH = 50;
|
|
5723
|
+
createOrgTagBody = external_exports.object({
|
|
5724
|
+
organization_id: external_exports.string().uuid(),
|
|
5725
|
+
name: external_exports.string().min(1).max(ORG_TAG_NAME_MAX_LENGTH).regex(ORG_TAG_NAME_REGEX, {
|
|
5726
|
+
message: 'Must be lowercase alphanumeric with hyphens (e.g. "my-tag")'
|
|
5727
|
+
}),
|
|
5728
|
+
display_name: external_exports.string().max(100).nullish(),
|
|
5729
|
+
color: external_exports.string().max(20).nullish()
|
|
5730
|
+
});
|
|
5731
|
+
updateOrgTagBody = external_exports.object({
|
|
5732
|
+
// Required so the route targets the org the UI is managing (which may differ
|
|
5733
|
+
// from the token's default `auth.org_id` for multi-org users) — mirrors create/list.
|
|
5734
|
+
organization_id: external_exports.string().uuid(),
|
|
5735
|
+
display_name: external_exports.string().max(100).nullish(),
|
|
5736
|
+
color: external_exports.string().max(20).nullish()
|
|
5737
|
+
});
|
|
5923
5738
|
}
|
|
5924
5739
|
});
|
|
5925
5740
|
|
|
5926
|
-
// ../../packages/core/dist/chunk-
|
|
5927
|
-
var
|
|
5928
|
-
var
|
|
5929
|
-
"../../packages/core/dist/chunk-
|
|
5741
|
+
// ../../packages/core/dist/chunk-HIGKBEPF.js
|
|
5742
|
+
var accessExplainQuery;
|
|
5743
|
+
var init_chunk_HIGKBEPF = __esm({
|
|
5744
|
+
"../../packages/core/dist/chunk-HIGKBEPF.js"() {
|
|
5930
5745
|
"use strict";
|
|
5746
|
+
init_chunk_HZ6CADSY();
|
|
5931
5747
|
init_zod();
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
active_conversation_id: external_exports.string().uuid().optional(),
|
|
5935
|
-
active_nav: external_exports.enum(["chat", "task", "support"]).optional(),
|
|
5936
|
-
/**
|
|
5937
|
-
* The people thread the URL names (`/chat/threads/:threadId`, gh #4661): the snapshot
|
|
5938
|
-
* preloads it as `people.active_thread` when the viewer is a member.
|
|
5939
|
-
*/
|
|
5940
|
-
active_thread_id: external_exports.string().uuid().optional()
|
|
5748
|
+
accessExplainQuery = external_exports.object({
|
|
5749
|
+
user_id: external_exports.string().regex(USER_ID_REGEX).optional()
|
|
5941
5750
|
});
|
|
5942
5751
|
}
|
|
5943
5752
|
});
|
|
5944
5753
|
|
|
5945
|
-
// ../../packages/core/dist/chunk-
|
|
5946
|
-
var
|
|
5947
|
-
var
|
|
5948
|
-
"../../packages/core/dist/chunk-
|
|
5949
|
-
"use strict";
|
|
5950
|
-
PERMISSIONS = [
|
|
5951
|
-
"hub:read",
|
|
5952
|
-
"hub:write",
|
|
5953
|
-
"hub:admin",
|
|
5954
|
-
"conversation:read",
|
|
5955
|
-
"conversation:write",
|
|
5956
|
-
"analytics:read",
|
|
5957
|
-
"billing:read",
|
|
5958
|
-
"billing:write",
|
|
5959
|
-
"org:read",
|
|
5960
|
-
"org:write",
|
|
5961
|
-
"org:admin",
|
|
5962
|
-
"contacts:write",
|
|
5963
|
-
"platform:admin",
|
|
5964
|
-
"*"
|
|
5965
|
-
];
|
|
5966
|
-
}
|
|
5967
|
-
});
|
|
5968
|
-
|
|
5969
|
-
// ../../packages/core/dist/chunk-P5GJNS5R.js
|
|
5970
|
-
var MAX_NAME_LENGTH, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam;
|
|
5971
|
-
var init_chunk_P5GJNS5R = __esm({
|
|
5972
|
-
"../../packages/core/dist/chunk-P5GJNS5R.js"() {
|
|
5754
|
+
// ../../packages/core/dist/chunk-HA7CRZMX.js
|
|
5755
|
+
var connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, BESIDE_LINK_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery;
|
|
5756
|
+
var init_chunk_HA7CRZMX = __esm({
|
|
5757
|
+
"../../packages/core/dist/chunk-HA7CRZMX.js"() {
|
|
5973
5758
|
"use strict";
|
|
5974
|
-
|
|
5759
|
+
init_chunk_MF2VVXBR();
|
|
5975
5760
|
init_chunk_HZ6CADSY();
|
|
5976
5761
|
init_zod();
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5762
|
+
connectionIdParam = external_exports.object({ id: uuidSchema });
|
|
5763
|
+
connectorIdParam = external_exports.object({ id: uuidSchema });
|
|
5764
|
+
listConnectionsQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5765
|
+
deleteConnectionQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5766
|
+
addConnectionBody = external_exports.object({
|
|
5767
|
+
hub_id: uuidSchema,
|
|
5768
|
+
connector_id: uuidSchema,
|
|
5769
|
+
authentication_type: external_exports.string().optional(),
|
|
5770
|
+
inbound_mode: external_exports.enum(["wayai", "resend"]).optional(),
|
|
5771
|
+
inbound_address: external_exports.string().email().optional(),
|
|
5772
|
+
// Opt out of copying this connection's credentials into production on publish/sync.
|
|
5773
|
+
// Defaults to true at the DB layer.
|
|
5774
|
+
sync_credentials_to_production: external_exports.boolean().optional(),
|
|
5775
|
+
// When the connection's own secret expires; null for none (`credential-expiry.ts`).
|
|
5776
|
+
expires_at: credentialExpiresAtSchema.optional()
|
|
5777
|
+
}).passthrough().superRefine((data, ctx) => {
|
|
5778
|
+
if (data.inbound_mode === "resend" && !data.inbound_address) {
|
|
5779
|
+
ctx.addIssue({
|
|
5780
|
+
code: external_exports.ZodIssueCode.custom,
|
|
5781
|
+
message: "Receiving email address is required when using Resend inbound mode",
|
|
5782
|
+
path: ["inbound_address"]
|
|
5783
|
+
});
|
|
5784
|
+
}
|
|
5785
|
+
});
|
|
5786
|
+
editConnectionBody = external_exports.object({
|
|
5787
|
+
hub_id: uuidSchema,
|
|
5788
|
+
sync_credentials_to_production: external_exports.boolean().optional(),
|
|
5789
|
+
expires_at: credentialExpiresAtSchema.optional()
|
|
5790
|
+
}).passthrough();
|
|
5791
|
+
PRODUCTION_DIRECT_FIELDS = ["username", "api_key", "access_token", "password", "refresh_token", "webhook_secret_token", "webhook_signing_secret", "github_app_id", "github_app_private_key"];
|
|
5792
|
+
BESIDE_LINK_FIELDS = /* @__PURE__ */ new Set(["webhook_secret_token", "github_app_id", "github_app_private_key"]);
|
|
5793
|
+
setProductionCredentialBody = external_exports.object({
|
|
5794
|
+
hub_id: uuidSchema,
|
|
5795
|
+
organization_credential_id: external_exports.string().nullable().optional(),
|
|
5796
|
+
organization_credential_token_id: external_exports.string().nullable().optional(),
|
|
5797
|
+
username: external_exports.string().optional(),
|
|
5798
|
+
api_key: external_exports.string().optional(),
|
|
5799
|
+
access_token: external_exports.string().optional(),
|
|
5800
|
+
password: external_exports.string().optional(),
|
|
5801
|
+
refresh_token: external_exports.string().optional(),
|
|
5802
|
+
webhook_secret_token: external_exports.string().optional(),
|
|
5803
|
+
webhook_signing_secret: external_exports.string().optional(),
|
|
5804
|
+
github_app_id: external_exports.string().optional(),
|
|
5805
|
+
github_app_private_key: external_exports.string().optional(),
|
|
5806
|
+
expires_at: credentialExpiresAtSchema.optional()
|
|
5807
|
+
}).strict().superRefine((data, ctx) => {
|
|
5808
|
+
const hasOrgLink = !!data.organization_credential_id || !!data.organization_credential_token_id;
|
|
5809
|
+
const sets = (f) => data[f] != null && data[f] !== `__USE_EXISTING_${f.toUpperCase()}__`;
|
|
5810
|
+
const hasDirect = PRODUCTION_DIRECT_FIELDS.some(sets);
|
|
5811
|
+
const hasDirectBesideLink = PRODUCTION_DIRECT_FIELDS.some((f) => !BESIDE_LINK_FIELDS.has(f) && sets(f));
|
|
5812
|
+
if (hasOrgLink && hasDirectBesideLink) {
|
|
5813
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "Provide either an organization credential link or direct credential fields, not both" });
|
|
5814
|
+
}
|
|
5815
|
+
if (hasOrgLink && data.expires_at != null) {
|
|
5816
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: LINKED_EXPIRY_REFUSAL, path: ["expires_at"] });
|
|
5817
|
+
}
|
|
5818
|
+
if (!hasOrgLink && !hasDirect && data.expires_at === void 0) {
|
|
5819
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "A credential is required: link an organization credential or provide a credential field" });
|
|
5820
|
+
}
|
|
5821
|
+
});
|
|
5822
|
+
registerWhatsappQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5823
|
+
registerWhatsappBody = external_exports.object({
|
|
5824
|
+
pin: external_exports.string().optional()
|
|
5825
|
+
});
|
|
5826
|
+
retryProvisioningQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5827
|
+
resendDomainStatusQuery = external_exports.object({ hub_id: uuidSchema });
|
|
5828
|
+
}
|
|
5829
|
+
});
|
|
5830
|
+
|
|
5831
|
+
// ../../packages/core/dist/chunk-WE4KMHZK.js
|
|
5832
|
+
var bootstrapQuery;
|
|
5833
|
+
var init_chunk_WE4KMHZK = __esm({
|
|
5834
|
+
"../../packages/core/dist/chunk-WE4KMHZK.js"() {
|
|
5835
|
+
"use strict";
|
|
5836
|
+
init_zod();
|
|
5837
|
+
bootstrapQuery = external_exports.object({
|
|
5838
|
+
active_hub_id: external_exports.string().uuid().optional(),
|
|
5839
|
+
active_conversation_id: external_exports.string().uuid().optional(),
|
|
5840
|
+
active_nav: external_exports.enum(["chat", "task", "support"]).optional(),
|
|
5841
|
+
/**
|
|
5842
|
+
* The people thread the URL names (`/chat/threads/:threadId`, gh #4661): the snapshot
|
|
5843
|
+
* preloads it as `people.active_thread` when the viewer is a member.
|
|
5844
|
+
*/
|
|
5845
|
+
active_thread_id: external_exports.string().uuid().optional()
|
|
5846
|
+
});
|
|
5847
|
+
}
|
|
5848
|
+
});
|
|
5849
|
+
|
|
5850
|
+
// ../../packages/core/dist/chunk-SCC6AVLY.js
|
|
5851
|
+
var PERMISSIONS;
|
|
5852
|
+
var init_chunk_SCC6AVLY = __esm({
|
|
5853
|
+
"../../packages/core/dist/chunk-SCC6AVLY.js"() {
|
|
5854
|
+
"use strict";
|
|
5855
|
+
PERMISSIONS = [
|
|
5856
|
+
"hub:read",
|
|
5857
|
+
"hub:write",
|
|
5858
|
+
"hub:admin",
|
|
5859
|
+
"conversation:read",
|
|
5860
|
+
"conversation:write",
|
|
5861
|
+
"analytics:read",
|
|
5862
|
+
"billing:read",
|
|
5863
|
+
"billing:write",
|
|
5864
|
+
"org:read",
|
|
5865
|
+
"org:write",
|
|
5866
|
+
"org:admin",
|
|
5867
|
+
"contacts:write",
|
|
5868
|
+
"platform:admin",
|
|
5869
|
+
"*"
|
|
5870
|
+
];
|
|
5871
|
+
}
|
|
5872
|
+
});
|
|
5873
|
+
|
|
5874
|
+
// ../../packages/core/dist/chunk-P5GJNS5R.js
|
|
5875
|
+
var MAX_NAME_LENGTH, MAX_HUBS_PER_GRANT, MAX_HUB_TAGS_PER_GRANT, MAX_GRANTS, permissionEnum, grantScopeSchema, grantSchema, createTokenBody, tokenOrgIdParam;
|
|
5876
|
+
var init_chunk_P5GJNS5R = __esm({
|
|
5877
|
+
"../../packages/core/dist/chunk-P5GJNS5R.js"() {
|
|
5878
|
+
"use strict";
|
|
5879
|
+
init_chunk_SCC6AVLY();
|
|
5880
|
+
init_chunk_HZ6CADSY();
|
|
5881
|
+
init_zod();
|
|
5882
|
+
MAX_NAME_LENGTH = 100;
|
|
5883
|
+
MAX_HUBS_PER_GRANT = 50;
|
|
5884
|
+
MAX_HUB_TAGS_PER_GRANT = 20;
|
|
5980
5885
|
MAX_GRANTS = 20;
|
|
5981
5886
|
permissionEnum = external_exports.enum(PERMISSIONS).refine(
|
|
5982
5887
|
(p) => p !== "platform:admin",
|
|
@@ -7604,40 +7509,98 @@ var init_chunk_IPDOHAZ5 = __esm({
|
|
|
7604
7509
|
}
|
|
7605
7510
|
});
|
|
7606
7511
|
|
|
7607
|
-
// ../../packages/core/dist/chunk-
|
|
7608
|
-
var
|
|
7609
|
-
var
|
|
7610
|
-
"../../packages/core/dist/chunk-
|
|
7512
|
+
// ../../packages/core/dist/chunk-KEN2DASI.js
|
|
7513
|
+
var SECOND_FACTOR_TIERS, secondFactorTier, META_ENTITY_ID_PATTERN, metaEntityId, whatsappCallbackBody, authMeResponse, wsTicketResponse, sessionCheckResponse, logoutResponse, magicCodeSendBody, magicCodeSendResponse, magicCodeVerifyBody, magicCodeVerifyResponse, passwordLoginBody, normalizeEmail, REVIEW_ACCOUNT_EMAILS;
|
|
7514
|
+
var init_chunk_KEN2DASI = __esm({
|
|
7515
|
+
"../../packages/core/dist/chunk-KEN2DASI.js"() {
|
|
7611
7516
|
"use strict";
|
|
7612
7517
|
init_zod();
|
|
7613
|
-
|
|
7614
|
-
|
|
7518
|
+
SECOND_FACTOR_TIERS = ["off", "settings"];
|
|
7519
|
+
secondFactorTier = external_exports.enum(SECOND_FACTOR_TIERS);
|
|
7520
|
+
META_ENTITY_ID_PATTERN = /^\d{1,32}$/;
|
|
7521
|
+
metaEntityId = external_exports.string().regex(META_ENTITY_ID_PATTERN, "must be a numeric Meta entity id");
|
|
7522
|
+
whatsappCallbackBody = external_exports.object({
|
|
7523
|
+
state: external_exports.string().min(1, "state is required"),
|
|
7524
|
+
code: external_exports.string().optional(),
|
|
7525
|
+
access_token: external_exports.string().optional(),
|
|
7526
|
+
user_id: external_exports.string().optional(),
|
|
7527
|
+
/**
|
|
7528
|
+
* The phone number and WABA the operator actually picked in Meta's Embedded
|
|
7529
|
+
* Signup popup (posted to the opener as `WA_EMBEDDED_SIGNUP`). Optional:
|
|
7530
|
+
* older clients, and the redirect-based flow, never see that event and fall
|
|
7531
|
+
* back to discovery.
|
|
7532
|
+
*/
|
|
7533
|
+
phone_number_id: metaEntityId.optional(),
|
|
7534
|
+
waba_id: metaEntityId.optional()
|
|
7535
|
+
}).refine(
|
|
7536
|
+
(data) => !!data.access_token || !!data.code,
|
|
7537
|
+
{ message: "Missing required parameters: state and either access_token or code" }
|
|
7538
|
+
);
|
|
7539
|
+
authMeResponse = external_exports.object({
|
|
7540
|
+
user_id: external_exports.string(),
|
|
7541
|
+
email: external_exports.string(),
|
|
7542
|
+
org_id: external_exports.string().nullable(),
|
|
7543
|
+
is_platform_admin: external_exports.boolean()
|
|
7615
7544
|
});
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7545
|
+
wsTicketResponse = external_exports.object({
|
|
7546
|
+
ticket: external_exports.string(),
|
|
7547
|
+
/** Seconds until the ticket expires if unconsumed. */
|
|
7548
|
+
expires_in: external_exports.number()
|
|
7619
7549
|
});
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
connection_id: external_exports.string().uuid()
|
|
7550
|
+
sessionCheckResponse = external_exports.object({
|
|
7551
|
+
valid: external_exports.literal(true)
|
|
7623
7552
|
});
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
connection_id: external_exports.string().uuid()
|
|
7553
|
+
logoutResponse = external_exports.object({
|
|
7554
|
+
success: external_exports.literal(true)
|
|
7627
7555
|
});
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
})
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
})
|
|
7556
|
+
magicCodeSendBody = external_exports.object({
|
|
7557
|
+
email: external_exports.string().email("Invalid email").max(254)
|
|
7558
|
+
// RFC 5321 max; bounds the request payload
|
|
7559
|
+
});
|
|
7560
|
+
magicCodeSendResponse = external_exports.object({
|
|
7561
|
+
success: external_exports.literal(true)
|
|
7562
|
+
});
|
|
7563
|
+
magicCodeVerifyBody = external_exports.object({
|
|
7564
|
+
email: external_exports.string().email("Invalid email").max(254),
|
|
7565
|
+
// RFC 5321 max; bounds the request payload
|
|
7566
|
+
code: external_exports.string().min(1, "Code is required").max(12)
|
|
7567
|
+
// WorkOS sends a 6-digit code; bound the input
|
|
7568
|
+
});
|
|
7569
|
+
magicCodeVerifyResponse = external_exports.object({
|
|
7570
|
+
access_token: external_exports.string(),
|
|
7571
|
+
refresh_token: external_exports.string()
|
|
7572
|
+
});
|
|
7573
|
+
passwordLoginBody = external_exports.object({
|
|
7574
|
+
email: external_exports.string().email("Invalid email").max(254),
|
|
7575
|
+
// RFC 5321 max; bounds the request payload
|
|
7576
|
+
password: external_exports.string().min(1, "Password is required").max(128)
|
|
7577
|
+
// bound the payload; WorkOS validates
|
|
7578
|
+
});
|
|
7579
|
+
normalizeEmail = (email) => email.trim().toLowerCase();
|
|
7580
|
+
REVIEW_ACCOUNT_EMAILS = new Set(
|
|
7581
|
+
["apple.review@wayai.pro", "play.review@wayai.pro", "microsoft.review@wayai.pro", "meta.review@wayai.pro"].map(
|
|
7582
|
+
normalizeEmail
|
|
7583
|
+
)
|
|
7584
|
+
);
|
|
7585
|
+
}
|
|
7586
|
+
});
|
|
7587
|
+
|
|
7588
|
+
// ../../packages/core/dist/chunk-PFGVH2CX.js
|
|
7589
|
+
var secondFactorCode, secondFactorRecoveryCode, secondFactorCodeBody, secondFactorRecoveryBody, secondFactorDisableBody, setOrgSecondFactorBody;
|
|
7590
|
+
var init_chunk_PFGVH2CX = __esm({
|
|
7591
|
+
"../../packages/core/dist/chunk-PFGVH2CX.js"() {
|
|
7592
|
+
"use strict";
|
|
7593
|
+
init_chunk_KEN2DASI();
|
|
7594
|
+
init_zod();
|
|
7595
|
+
secondFactorCode = external_exports.string().regex(/^\d{6}$/, "Enter the 6-digit code");
|
|
7596
|
+
secondFactorRecoveryCode = external_exports.string().min(1, "Enter a recovery code").max(64);
|
|
7597
|
+
secondFactorCodeBody = external_exports.object({ code: secondFactorCode });
|
|
7598
|
+
secondFactorRecoveryBody = external_exports.object({ recovery_code: secondFactorRecoveryCode });
|
|
7599
|
+
secondFactorDisableBody = external_exports.union([
|
|
7600
|
+
external_exports.object({ code: secondFactorCode, recovery_code: external_exports.undefined().optional() }),
|
|
7601
|
+
external_exports.object({ recovery_code: secondFactorRecoveryCode, code: external_exports.undefined().optional() })
|
|
7602
|
+
]);
|
|
7603
|
+
setOrgSecondFactorBody = external_exports.object({ tier: secondFactorTier });
|
|
7641
7604
|
}
|
|
7642
7605
|
});
|
|
7643
7606
|
|
|
@@ -8185,417 +8148,53 @@ var init_chunk_Y7CFCYX4 = __esm({
|
|
|
8185
8148
|
}
|
|
8186
8149
|
});
|
|
8187
8150
|
|
|
8188
|
-
// ../../packages/core/dist/chunk-
|
|
8189
|
-
var
|
|
8190
|
-
var
|
|
8191
|
-
"../../packages/core/dist/chunk-
|
|
8151
|
+
// ../../packages/core/dist/chunk-YUZFHVB2.js
|
|
8152
|
+
var invitePreviewQuery, inviteRolePreviewResponse, inviteContactPreviewResponse, invitePreviewResponse, inviteUnsubscribeBody;
|
|
8153
|
+
var init_chunk_YUZFHVB2 = __esm({
|
|
8154
|
+
"../../packages/core/dist/chunk-YUZFHVB2.js"() {
|
|
8192
8155
|
"use strict";
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8156
|
+
init_zod();
|
|
8157
|
+
invitePreviewQuery = external_exports.object({
|
|
8158
|
+
token: external_exports.string().min(1).max(2048)
|
|
8159
|
+
});
|
|
8160
|
+
inviteRolePreviewResponse = external_exports.object({
|
|
8161
|
+
inviter_name: external_exports.string(),
|
|
8162
|
+
entity_id: external_exports.string().uuid(),
|
|
8163
|
+
entity_name: external_exports.string(),
|
|
8164
|
+
entity_type: external_exports.enum(["org", "hub"]),
|
|
8165
|
+
role: external_exports.enum(["org_admin", "admin", "team_user", "user"]),
|
|
8166
|
+
expires_at: external_exports.string().datetime()
|
|
8167
|
+
});
|
|
8168
|
+
inviteContactPreviewResponse = external_exports.object({
|
|
8169
|
+
inviter_name: external_exports.string().nullable(),
|
|
8170
|
+
entity_id: external_exports.string().uuid(),
|
|
8171
|
+
entity_type: external_exports.literal("contact"),
|
|
8172
|
+
role: external_exports.literal("contact"),
|
|
8173
|
+
expires_at: external_exports.string().datetime()
|
|
8174
|
+
});
|
|
8175
|
+
invitePreviewResponse = external_exports.union([inviteRolePreviewResponse, inviteContactPreviewResponse]);
|
|
8176
|
+
inviteUnsubscribeBody = external_exports.object({ token: external_exports.string().min(1).max(256) }).strict();
|
|
8197
8177
|
}
|
|
8198
8178
|
});
|
|
8199
8179
|
|
|
8200
|
-
// ../../packages/core/dist/chunk-
|
|
8201
|
-
var
|
|
8202
|
-
var
|
|
8203
|
-
"../../packages/core/dist/chunk-
|
|
8180
|
+
// ../../packages/core/dist/chunk-I3O2RACG.js
|
|
8181
|
+
var managedAgentsWebhookParams, MANAGED_AGENTS_WEBHOOK_BODY_MAX_BYTES;
|
|
8182
|
+
var init_chunk_I3O2RACG = __esm({
|
|
8183
|
+
"../../packages/core/dist/chunk-I3O2RACG.js"() {
|
|
8204
8184
|
"use strict";
|
|
8205
|
-
init_chunk_ZIGA5RCU();
|
|
8206
|
-
init_chunk_WEXVYJ5H();
|
|
8207
|
-
init_chunk_6TSQ5HXC();
|
|
8208
|
-
init_chunk_HZ6CADSY();
|
|
8209
8185
|
init_zod();
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
INTERACTIVE_TEMPLATE_TEXT_MAX = 2e3;
|
|
8214
|
-
INTERACTIVE_TEMPLATE_FALLBACK_MAX = 4e3;
|
|
8215
|
-
INTERACTIVE_TEMPLATE_DESCRIPTION_MAX = 500;
|
|
8216
|
-
INTERACTIVE_TEMPLATE_PARAMS_SCHEMA_MAX_CHARS = 16 * 1024;
|
|
8217
|
-
INTERACTIVE_TEMPLATE_VALUE_MAX_CHARS = 4 * 1024;
|
|
8218
|
-
INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX = 20;
|
|
8219
|
-
INTERACTIVE_TEMPLATE_OPTIONS_MAX = 50;
|
|
8220
|
-
PATH_MAX = 256;
|
|
8221
|
-
TOOL_NAME_MAX = 128;
|
|
8222
|
-
interactiveTemplateNameSchema = external_exports.string().regex(SLUG_REGEX, {
|
|
8223
|
-
message: 'a template name is lowercase letters, digits and underscores, starting with a letter (e.g. "menu")'
|
|
8224
|
-
});
|
|
8225
|
-
actionNameSchema = external_exports.string().regex(SLUG_REGEX, {
|
|
8226
|
-
message: "an action name is lowercase letters, digits and underscores, starting with a letter"
|
|
8227
|
-
});
|
|
8228
|
-
INTERACTIVE_TEMPLATE_FIELD_NAME_REGEX = /^[A-Za-z_][A-Za-z0-9_]{0,63}$/;
|
|
8229
|
-
RESERVED_FIELD_NAMES = new Set(BINDING_ROOTS);
|
|
8230
|
-
TEMPLATE_TONES = ["default", "secondary", "success", "danger", "warning", "info"];
|
|
8231
|
-
TEMPLATE_INPUT_TYPES = ["text", "number", "email", "tel", "date"];
|
|
8232
|
-
TEMPLATE_ALIGNS = ["start", "center", "end", "stretch"];
|
|
8233
|
-
TEMPLATE_JUSTIFIES = ["start", "center", "end", "between"];
|
|
8234
|
-
TEMPLATE_TITLE_SIZES = ["sm", "md", "lg"];
|
|
8235
|
-
TEMPLATE_TEXT_SIZES = ["xs", "sm", "md", "lg"];
|
|
8236
|
-
TEMPLATE_TEXT_WEIGHTS = ["normal", "medium", "bold"];
|
|
8237
|
-
TEMPLATE_BADGE_VARIANTS = ["solid", "soft", "outline"];
|
|
8238
|
-
TEMPLATE_BUTTON_STYLES = ["primary", "secondary"];
|
|
8239
|
-
TEMPLATE_LIST_DIRECTIONS = ["vertical", "horizontal"];
|
|
8240
|
-
text = external_exports.string().max(INTERACTIVE_TEMPLATE_TEXT_MAX);
|
|
8241
|
-
label = text.min(1);
|
|
8242
|
-
path2 = external_exports.string().min(1).max(PATH_MAX);
|
|
8243
|
-
binding = external_exports.string().min(1).max(PATH_MAX);
|
|
8244
|
-
common = { if: path2.optional() };
|
|
8245
|
-
fieldCommon = {
|
|
8246
|
-
...common,
|
|
8247
|
-
name: label,
|
|
8248
|
-
label: text.optional(),
|
|
8249
|
-
required: external_exports.union([external_exports.boolean(), binding]).optional(),
|
|
8250
|
-
source: text.optional()
|
|
8251
|
-
};
|
|
8252
|
-
children = () => external_exports.array(blockSchema).min(1).max(INTERACTIVE_TEMPLATE_MAX_BLOCKS);
|
|
8253
|
-
containerProps = () => ({
|
|
8254
|
-
gap: external_exports.number().int().min(0).max(8).optional(),
|
|
8255
|
-
align: external_exports.enum(TEMPLATE_ALIGNS).optional(),
|
|
8256
|
-
justify: external_exports.enum(TEMPLATE_JUSTIFIES).optional()
|
|
8257
|
-
});
|
|
8258
|
-
optionSchema = external_exports.object({ value: text, label }).strict();
|
|
8259
|
-
templateBlockSchema = external_exports.lazy(
|
|
8260
|
-
() => external_exports.discriminatedUnion("type", [
|
|
8261
|
-
external_exports.object({ ...common, type: external_exports.literal("card"), children: children() }).strict(),
|
|
8262
|
-
external_exports.object({ ...common, ...containerProps(), type: external_exports.literal("row"), children: children() }).strict(),
|
|
8263
|
-
external_exports.object({ ...common, ...containerProps(), type: external_exports.literal("col"), children: children() }).strict(),
|
|
8264
|
-
external_exports.object({
|
|
8265
|
-
...common,
|
|
8266
|
-
type: external_exports.literal("list"),
|
|
8267
|
-
each: path2,
|
|
8268
|
-
item: blockSchema,
|
|
8269
|
-
direction: external_exports.enum(TEMPLATE_LIST_DIRECTIONS).optional(),
|
|
8270
|
-
limit: external_exports.number().int().min(1).max(BINDING_EACH_MAX_ITEMS).optional(),
|
|
8271
|
-
key: external_exports.string().max(64).regex(BINDING_NAME_SEGMENT_REGEX).optional(),
|
|
8272
|
-
empty: text.optional()
|
|
8273
|
-
}).strict(),
|
|
8274
|
-
external_exports.object({ ...common, type: external_exports.literal("image"), src: label, alt: text.optional() }).strict(),
|
|
8275
|
-
external_exports.object({ ...common, type: external_exports.literal("title"), text: label, size: external_exports.enum(TEMPLATE_TITLE_SIZES).optional() }).strict(),
|
|
8276
|
-
external_exports.object({
|
|
8277
|
-
...common,
|
|
8278
|
-
type: external_exports.literal("text"),
|
|
8279
|
-
text: label,
|
|
8280
|
-
size: external_exports.enum(TEMPLATE_TEXT_SIZES).optional(),
|
|
8281
|
-
weight: external_exports.enum(TEMPLATE_TEXT_WEIGHTS).optional(),
|
|
8282
|
-
color: external_exports.enum(TEMPLATE_TONES).optional()
|
|
8283
|
-
}).strict(),
|
|
8284
|
-
external_exports.object({
|
|
8285
|
-
...common,
|
|
8286
|
-
type: external_exports.literal("badge"),
|
|
8287
|
-
text: label,
|
|
8288
|
-
color: external_exports.enum(TEMPLATE_TONES).optional(),
|
|
8289
|
-
variant: external_exports.enum(TEMPLATE_BADGE_VARIANTS).optional()
|
|
8290
|
-
}).strict(),
|
|
8291
|
-
external_exports.object({ ...common, type: external_exports.literal("divider") }).strict(),
|
|
8292
|
-
external_exports.object({
|
|
8293
|
-
...common,
|
|
8294
|
-
type: external_exports.literal("button"),
|
|
8295
|
-
label,
|
|
8296
|
-
action: actionNameSchema,
|
|
8297
|
-
style: external_exports.enum(TEMPLATE_BUTTON_STYLES).optional()
|
|
8298
|
-
}).strict(),
|
|
8299
|
-
external_exports.object({
|
|
8300
|
-
...fieldCommon,
|
|
8301
|
-
type: external_exports.literal("select"),
|
|
8302
|
-
options: external_exports.union([external_exports.array(optionSchema).min(1).max(INTERACTIVE_TEMPLATE_OPTIONS_MAX), binding]),
|
|
8303
|
-
placeholder: text.optional(),
|
|
8304
|
-
default_value: text.optional()
|
|
8305
|
-
}).strict(),
|
|
8306
|
-
external_exports.object({
|
|
8307
|
-
...fieldCommon,
|
|
8308
|
-
type: external_exports.literal("input"),
|
|
8309
|
-
input_type: external_exports.union([external_exports.enum(TEMPLATE_INPUT_TYPES), binding]).optional(),
|
|
8310
|
-
placeholder: text.optional(),
|
|
8311
|
-
default_value: text.optional()
|
|
8312
|
-
}).strict(),
|
|
8313
|
-
external_exports.object({
|
|
8314
|
-
...fieldCommon,
|
|
8315
|
-
type: external_exports.literal("checkbox"),
|
|
8316
|
-
label,
|
|
8317
|
-
default_checked: external_exports.union([external_exports.boolean(), binding]).optional()
|
|
8318
|
-
}).strict(),
|
|
8319
|
-
external_exports.object({
|
|
8320
|
-
...common,
|
|
8321
|
-
type: external_exports.literal("form"),
|
|
8322
|
-
children: children(),
|
|
8323
|
-
submit: actionNameSchema,
|
|
8324
|
-
submit_label: text.optional()
|
|
8325
|
-
}).strict()
|
|
8326
|
-
])
|
|
8327
|
-
);
|
|
8328
|
-
blockSchema = templateBlockSchema;
|
|
8329
|
-
unanchored = (regex) => regex.source.replace(/^\^/, "").replace(/\$$/, "");
|
|
8330
|
-
INTERACTIVE_TEMPLATE_STATE_PATH_REGEX = new RegExp(
|
|
8331
|
-
`^state\\.${unanchored(SLUG_REGEX)}(\\.${unanchored(BINDING_NAME_SEGMENT_REGEX)}){0,10}$`
|
|
8332
|
-
);
|
|
8333
|
-
valueTemplate = external_exports.unknown().superRefine((value, ctx) => {
|
|
8334
|
-
if (!withinJsonLength(value, INTERACTIVE_TEMPLATE_VALUE_MAX_CHARS)) {
|
|
8335
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `a value is JSON of at most ${INTERACTIVE_TEMPLATE_VALUE_MAX_CHARS} characters` });
|
|
8336
|
-
}
|
|
8337
|
-
});
|
|
8338
|
-
statePath = external_exports.string().regex(INTERACTIVE_TEMPLATE_STATE_PATH_REGEX, {
|
|
8339
|
-
message: 'a state path is "state.<state slug>" then field names (e.g. "state.order.items")'
|
|
8340
|
-
});
|
|
8341
|
-
templateActionSchema = external_exports.discriminatedUnion("type", [
|
|
8342
|
-
external_exports.object({ type: external_exports.literal("send"), text: label.optional(), values: valueTemplate.optional() }).strict(),
|
|
8343
|
-
external_exports.object({ type: external_exports.literal("set_state"), path: statePath, value: valueTemplate }).strict(),
|
|
8344
|
-
external_exports.object({ type: external_exports.literal("append_state"), path: statePath, value: valueTemplate }).strict(),
|
|
8345
|
-
external_exports.object({ type: external_exports.literal("remove_state"), path: statePath, value: valueTemplate }).strict()
|
|
8346
|
-
]).superRefine((action, ctx) => {
|
|
8347
|
-
if (action.type === "send" && action.text === void 0 && action.values === void 0) {
|
|
8348
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "a send action has text, values, or both" });
|
|
8349
|
-
}
|
|
8350
|
-
});
|
|
8351
|
-
paramsJsonSchema = external_exports.record(external_exports.unknown()).superRefine((schema, ctx) => {
|
|
8352
|
-
if (!withinJsonLength(schema, INTERACTIVE_TEMPLATE_PARAMS_SCHEMA_MAX_CHARS)) {
|
|
8353
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `params is at most ${INTERACTIVE_TEMPLATE_PARAMS_SCHEMA_MAX_CHARS} characters of JSON` });
|
|
8354
|
-
return;
|
|
8355
|
-
}
|
|
8356
|
-
const result = validateToolInputSchema(schema);
|
|
8357
|
-
if (!result.ok) {
|
|
8358
|
-
for (const error of result.errors) {
|
|
8359
|
-
ctx.addIssue({
|
|
8360
|
-
code: external_exports.ZodIssueCode.custom,
|
|
8361
|
-
message: `params is not a valid JSON Schema${error.path ? ` at "${error.path}"` : ""}: ${error.message}`
|
|
8362
|
-
});
|
|
8363
|
-
}
|
|
8364
|
-
}
|
|
8186
|
+
managedAgentsWebhookParams = external_exports.object({
|
|
8187
|
+
hub_id: external_exports.string().uuid(),
|
|
8188
|
+
connection_id: external_exports.string().uuid()
|
|
8365
8189
|
});
|
|
8366
|
-
|
|
8367
|
-
/** The tool's name, as the agent holds it. The backend calls it; the model never types its data. */
|
|
8368
|
-
tool: external_exports.string().trim().min(1).max(TOOL_NAME_MAX),
|
|
8369
|
-
params: external_exports.union([
|
|
8370
|
-
external_exports.array(external_exports.string()).max(INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX),
|
|
8371
|
-
external_exports.record(valueTemplate).refine((r) => Object.keys(r).length <= INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX, {
|
|
8372
|
-
message: `data.params passes at most ${INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX} values`
|
|
8373
|
-
})
|
|
8374
|
-
]).default({}).transform(
|
|
8375
|
-
(params) => Array.isArray(params) ? Object.fromEntries(params.map((name) => [name, `{{params.${name}}}`])) : params
|
|
8376
|
-
),
|
|
8377
|
-
/** The result's top-level fields the template reads: what the message's data snapshot keeps. */
|
|
8378
|
-
fields: external_exports.array(external_exports.string().max(64).regex(BINDING_NAME_SEGMENT_REGEX)).min(1).max(INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX)
|
|
8379
|
-
}).strict();
|
|
8380
|
-
interactiveTemplateDefinitionSchema = external_exports.object({
|
|
8381
|
-
name: interactiveTemplateNameSchema,
|
|
8382
|
-
description: external_exports.string().trim().min(1).max(INTERACTIVE_TEMPLATE_DESCRIPTION_MAX),
|
|
8383
|
-
params: paramsJsonSchema.default({ type: "object", properties: {} }),
|
|
8384
|
-
data: dataSchema.optional(),
|
|
8385
|
-
/** Phase 1: the one view, `main`. Phase 1b adds others beside it. */
|
|
8386
|
-
views: external_exports.object({ main: blockSchema }).strict(),
|
|
8387
|
-
actions: external_exports.record(actionNameSchema, templateActionSchema).default({}).refine((actions) => Object.keys(actions).length <= INTERACTIVE_TEMPLATE_MAX_ACTIONS, {
|
|
8388
|
-
message: `at most ${INTERACTIVE_TEMPLATE_MAX_ACTIONS} actions`
|
|
8389
|
-
}),
|
|
8390
|
-
fallback: external_exports.string().trim().min(1).max(INTERACTIVE_TEMPLATE_FALLBACK_MAX)
|
|
8391
|
-
}).strict();
|
|
8190
|
+
MANAGED_AGENTS_WEBHOOK_BODY_MAX_BYTES = 16 * 1024;
|
|
8392
8191
|
}
|
|
8393
8192
|
});
|
|
8394
8193
|
|
|
8395
|
-
// ../../packages/core/dist/chunk-
|
|
8396
|
-
var
|
|
8397
|
-
var
|
|
8398
|
-
"../../packages/core/dist/chunk-
|
|
8399
|
-
"use strict";
|
|
8400
|
-
init_chunk_VOBDVWNC();
|
|
8401
|
-
OPTION_ITEM = {
|
|
8402
|
-
type: "object",
|
|
8403
|
-
properties: {
|
|
8404
|
-
id: { type: "string", description: "What the agent receives when this one is picked" },
|
|
8405
|
-
label: { type: "string", description: "What the person sees" }
|
|
8406
|
-
},
|
|
8407
|
-
required: ["id", "label"]
|
|
8408
|
-
};
|
|
8409
|
-
choices = {
|
|
8410
|
-
name: "choices",
|
|
8411
|
-
description: "A question with up to 10 options, each with an optional description. The person picks one; the agent receives its id and label.",
|
|
8412
|
-
params: {
|
|
8413
|
-
type: "object",
|
|
8414
|
-
properties: {
|
|
8415
|
-
prompt: { type: "string", description: "The question, shown above the options" },
|
|
8416
|
-
options: {
|
|
8417
|
-
type: "array",
|
|
8418
|
-
minItems: 1,
|
|
8419
|
-
maxItems: 10,
|
|
8420
|
-
items: {
|
|
8421
|
-
...OPTION_ITEM,
|
|
8422
|
-
properties: { ...OPTION_ITEM.properties, description: { type: "string", description: "A line under the label" } }
|
|
8423
|
-
}
|
|
8424
|
-
}
|
|
8425
|
-
},
|
|
8426
|
-
required: ["options"]
|
|
8427
|
-
},
|
|
8428
|
-
views: {
|
|
8429
|
-
main: {
|
|
8430
|
-
type: "card",
|
|
8431
|
-
children: [
|
|
8432
|
-
{ type: "text", if: "params.prompt", text: "{{params.prompt}}" },
|
|
8433
|
-
{
|
|
8434
|
-
type: "list",
|
|
8435
|
-
each: "params.options",
|
|
8436
|
-
item: {
|
|
8437
|
-
type: "col",
|
|
8438
|
-
gap: 1,
|
|
8439
|
-
children: [
|
|
8440
|
-
{ type: "button", label: "{{item.label}}", action: "choose" },
|
|
8441
|
-
{ type: "text", if: "item.description", text: "{{item.description}}", size: "sm", color: "secondary" }
|
|
8442
|
-
]
|
|
8443
|
-
}
|
|
8444
|
-
}
|
|
8445
|
-
]
|
|
8446
|
-
}
|
|
8447
|
-
},
|
|
8448
|
-
actions: {
|
|
8449
|
-
choose: { type: "send", text: "{{item.label}}", values: { id: "{{item.id}}" } }
|
|
8450
|
-
},
|
|
8451
|
-
fallback: "{{#if params.prompt}}{{params.prompt}}\n{{/if}}{{#each params.options}}{{@n}}. {{label}}{{#if description}} \u2014 {{description}}{{/if}}\n{{/each}}"
|
|
8452
|
-
};
|
|
8453
|
-
form = {
|
|
8454
|
-
name: "form",
|
|
8455
|
-
description: "A form of up to 20 fields, each a text input, a select or a checkbox, optionally pre-filled and annotated with where its value came from. The person submits it; the agent receives the values.",
|
|
8456
|
-
params: {
|
|
8457
|
-
type: "object",
|
|
8458
|
-
properties: {
|
|
8459
|
-
title: { type: "string", description: "Shown above the fields" },
|
|
8460
|
-
submit_label: { type: "string", description: "The submit button's label" },
|
|
8461
|
-
fields: {
|
|
8462
|
-
type: "array",
|
|
8463
|
-
minItems: 1,
|
|
8464
|
-
maxItems: 20,
|
|
8465
|
-
items: {
|
|
8466
|
-
type: "object",
|
|
8467
|
-
properties: {
|
|
8468
|
-
name: { type: "string", pattern: INTERACTIVE_TEMPLATE_FIELD_NAME_REGEX.source, description: "The key the value is submitted under" },
|
|
8469
|
-
label: { type: "string" },
|
|
8470
|
-
input: {
|
|
8471
|
-
type: "string",
|
|
8472
|
-
enum: [...TEMPLATE_INPUT_TYPES],
|
|
8473
|
-
description: "A text input of this type. Give exactly one of input, select or checkbox."
|
|
8474
|
-
},
|
|
8475
|
-
select: { type: "array", minItems: 1, maxItems: INTERACTIVE_TEMPLATE_OPTIONS_MAX, items: { type: "object", properties: { value: { type: "string" }, label: { type: "string" } }, required: ["value", "label"] } },
|
|
8476
|
-
checkbox: { type: "boolean", enum: [true] },
|
|
8477
|
-
value: { type: ["string", "number", "boolean"], description: "The pre-filled value (a checkbox: true when checked)" },
|
|
8478
|
-
placeholder: { type: "string" },
|
|
8479
|
-
required: { type: "boolean" },
|
|
8480
|
-
source: { type: "string", description: "Where the pre-filled value came from, shown under the field" }
|
|
8481
|
-
},
|
|
8482
|
-
required: ["name", "label"],
|
|
8483
|
-
oneOf: [{ required: ["input"] }, { required: ["select"] }, { required: ["checkbox"] }]
|
|
8484
|
-
}
|
|
8485
|
-
}
|
|
8486
|
-
},
|
|
8487
|
-
required: ["fields"]
|
|
8488
|
-
},
|
|
8489
|
-
views: {
|
|
8490
|
-
main: {
|
|
8491
|
-
type: "card",
|
|
8492
|
-
children: [
|
|
8493
|
-
{ type: "title", if: "params.title", text: "{{params.title}}" },
|
|
8494
|
-
{
|
|
8495
|
-
type: "form",
|
|
8496
|
-
submit: "submit",
|
|
8497
|
-
submit_label: "{{params.submit_label}}",
|
|
8498
|
-
children: [
|
|
8499
|
-
{
|
|
8500
|
-
type: "list",
|
|
8501
|
-
each: "params.fields",
|
|
8502
|
-
item: {
|
|
8503
|
-
type: "col",
|
|
8504
|
-
children: [
|
|
8505
|
-
{
|
|
8506
|
-
type: "input",
|
|
8507
|
-
if: "item.input",
|
|
8508
|
-
name: "{{item.name}}",
|
|
8509
|
-
label: "{{item.label}}",
|
|
8510
|
-
input_type: "{{item.input}}",
|
|
8511
|
-
placeholder: "{{item.placeholder}}",
|
|
8512
|
-
default_value: "{{item.value}}",
|
|
8513
|
-
required: "{{item.required}}",
|
|
8514
|
-
source: "{{item.source}}"
|
|
8515
|
-
},
|
|
8516
|
-
{
|
|
8517
|
-
type: "select",
|
|
8518
|
-
if: "item.select",
|
|
8519
|
-
name: "{{item.name}}",
|
|
8520
|
-
label: "{{item.label}}",
|
|
8521
|
-
options: "{{item.select}}",
|
|
8522
|
-
placeholder: "{{item.placeholder}}",
|
|
8523
|
-
default_value: "{{item.value}}",
|
|
8524
|
-
required: "{{item.required}}",
|
|
8525
|
-
source: "{{item.source}}"
|
|
8526
|
-
},
|
|
8527
|
-
{
|
|
8528
|
-
type: "checkbox",
|
|
8529
|
-
if: "item.checkbox",
|
|
8530
|
-
name: "{{item.name}}",
|
|
8531
|
-
label: "{{item.label}}",
|
|
8532
|
-
default_checked: "{{item.value}}",
|
|
8533
|
-
required: "{{item.required}}",
|
|
8534
|
-
source: "{{item.source}}"
|
|
8535
|
-
}
|
|
8536
|
-
]
|
|
8537
|
-
}
|
|
8538
|
-
}
|
|
8539
|
-
]
|
|
8540
|
-
}
|
|
8541
|
-
]
|
|
8542
|
-
}
|
|
8543
|
-
},
|
|
8544
|
-
actions: {
|
|
8545
|
-
submit: { type: "send", values: "{{form}}" }
|
|
8546
|
-
},
|
|
8547
|
-
fallback: "{{#if params.title}}{{params.title}}\n{{/if}}{{#each params.fields}}- {{label}}{{#if value}}: {{value}}{{/if}}\n{{/each}}"
|
|
8548
|
-
};
|
|
8549
|
-
}
|
|
8550
|
-
});
|
|
8551
|
-
|
|
8552
|
-
// ../../packages/core/dist/chunk-YUZFHVB2.js
|
|
8553
|
-
var invitePreviewQuery, inviteRolePreviewResponse, inviteContactPreviewResponse, invitePreviewResponse, inviteUnsubscribeBody;
|
|
8554
|
-
var init_chunk_YUZFHVB2 = __esm({
|
|
8555
|
-
"../../packages/core/dist/chunk-YUZFHVB2.js"() {
|
|
8556
|
-
"use strict";
|
|
8557
|
-
init_zod();
|
|
8558
|
-
invitePreviewQuery = external_exports.object({
|
|
8559
|
-
token: external_exports.string().min(1).max(2048)
|
|
8560
|
-
});
|
|
8561
|
-
inviteRolePreviewResponse = external_exports.object({
|
|
8562
|
-
inviter_name: external_exports.string(),
|
|
8563
|
-
entity_id: external_exports.string().uuid(),
|
|
8564
|
-
entity_name: external_exports.string(),
|
|
8565
|
-
entity_type: external_exports.enum(["org", "hub"]),
|
|
8566
|
-
role: external_exports.enum(["org_admin", "admin", "team_user", "user"]),
|
|
8567
|
-
expires_at: external_exports.string().datetime()
|
|
8568
|
-
});
|
|
8569
|
-
inviteContactPreviewResponse = external_exports.object({
|
|
8570
|
-
inviter_name: external_exports.string().nullable(),
|
|
8571
|
-
entity_id: external_exports.string().uuid(),
|
|
8572
|
-
entity_type: external_exports.literal("contact"),
|
|
8573
|
-
role: external_exports.literal("contact"),
|
|
8574
|
-
expires_at: external_exports.string().datetime()
|
|
8575
|
-
});
|
|
8576
|
-
invitePreviewResponse = external_exports.union([inviteRolePreviewResponse, inviteContactPreviewResponse]);
|
|
8577
|
-
inviteUnsubscribeBody = external_exports.object({ token: external_exports.string().min(1).max(256) }).strict();
|
|
8578
|
-
}
|
|
8579
|
-
});
|
|
8580
|
-
|
|
8581
|
-
// ../../packages/core/dist/chunk-I3O2RACG.js
|
|
8582
|
-
var managedAgentsWebhookParams, MANAGED_AGENTS_WEBHOOK_BODY_MAX_BYTES;
|
|
8583
|
-
var init_chunk_I3O2RACG = __esm({
|
|
8584
|
-
"../../packages/core/dist/chunk-I3O2RACG.js"() {
|
|
8585
|
-
"use strict";
|
|
8586
|
-
init_zod();
|
|
8587
|
-
managedAgentsWebhookParams = external_exports.object({
|
|
8588
|
-
hub_id: external_exports.string().uuid(),
|
|
8589
|
-
connection_id: external_exports.string().uuid()
|
|
8590
|
-
});
|
|
8591
|
-
MANAGED_AGENTS_WEBHOOK_BODY_MAX_BYTES = 16 * 1024;
|
|
8592
|
-
}
|
|
8593
|
-
});
|
|
8594
|
-
|
|
8595
|
-
// ../../packages/core/dist/chunk-6J742GLA.js
|
|
8596
|
-
var PEOPLE_THREAD_MESSAGE_MAX_LENGTH, PEOPLE_THREAD_MESSAGES_PAGE_MAX, PEOPLE_THREAD_PAGE_MAX, PEOPLE_THREAD_PAGE_DEFAULT, PEOPLE_GROUP_NAME_MAX_LENGTH, PEOPLE_GROUP_AVATAR_URL_MAX_LENGTH, PEOPLE_THREAD_ATTACHMENT_MAX_BYTES, PEOPLE_THREAD_ATTACHMENT_NAME_MAX_LENGTH, PEOPLE_ATTACHMENT_STORAGE_PER_USER_BYTES, PEOPLE_THREAD_ATTACHMENT_MAX_MB, PEOPLE_THREAD_ATTACHMENT_URL_TTL_SECONDS, PEOPLE_THREAD_ATTACHMENT_URLS_MAX, peopleThreadIdParam, peopleThreadMessageIdParam, peopleThreadListQuery, peopleThreadMessagesQuery, peopleThreadAttachmentUploadSchema, peopleThreadSendBody, peopleThreadAttachmentUrlsBody, peopleThreadReadBody, peopleThreadSettingsBody, peopleGroupNameSchema, peopleGroupAvatarUrlSchema, peopleGroupCreateBody, peopleOrgDirectBody, peopleGroupUpdateBody, peopleGroupInviteBody, peopleOrgErasureBody, peopleGroupLeaveBody, peopleGroupInviteIdParam, peopleGroupIncomingInviteIdParam, peopleGroupMemberParam, peopleThreadKindSchema, peopleThreadMemberSchema, peopleThreadLastMessageSchema, peopleGroupRoleSchema, peopleGroupSummarySchema, peopleThreadSummarySchema, peopleThreadAttachmentSchema, peopleThreadMessageSchema, peopleGroupMemberSchema, peopleGroupSentInviteSchema, peopleGroupIncomingInviteSchema;
|
|
8597
|
-
var init_chunk_6J742GLA = __esm({
|
|
8598
|
-
"../../packages/core/dist/chunk-6J742GLA.js"() {
|
|
8194
|
+
// ../../packages/core/dist/chunk-6J742GLA.js
|
|
8195
|
+
var PEOPLE_THREAD_MESSAGE_MAX_LENGTH, PEOPLE_THREAD_MESSAGES_PAGE_MAX, PEOPLE_THREAD_PAGE_MAX, PEOPLE_THREAD_PAGE_DEFAULT, PEOPLE_GROUP_NAME_MAX_LENGTH, PEOPLE_GROUP_AVATAR_URL_MAX_LENGTH, PEOPLE_THREAD_ATTACHMENT_MAX_BYTES, PEOPLE_THREAD_ATTACHMENT_NAME_MAX_LENGTH, PEOPLE_ATTACHMENT_STORAGE_PER_USER_BYTES, PEOPLE_THREAD_ATTACHMENT_MAX_MB, PEOPLE_THREAD_ATTACHMENT_URL_TTL_SECONDS, PEOPLE_THREAD_ATTACHMENT_URLS_MAX, peopleThreadIdParam, peopleThreadMessageIdParam, peopleThreadListQuery, peopleThreadMessagesQuery, peopleThreadAttachmentUploadSchema, peopleThreadSendBody, peopleThreadAttachmentUrlsBody, peopleThreadReadBody, peopleThreadSettingsBody, peopleGroupNameSchema, peopleGroupAvatarUrlSchema, peopleGroupCreateBody, peopleOrgDirectBody, peopleGroupUpdateBody, peopleGroupInviteBody, peopleOrgErasureBody, peopleGroupLeaveBody, peopleGroupInviteIdParam, peopleGroupIncomingInviteIdParam, peopleGroupMemberParam, peopleThreadKindSchema, peopleThreadMemberSchema, peopleThreadLastMessageSchema, peopleGroupRoleSchema, peopleGroupSummarySchema, peopleThreadSummarySchema, peopleThreadAttachmentSchema, peopleThreadMessageSchema, peopleGroupMemberSchema, peopleGroupSentInviteSchema, peopleGroupIncomingInviteSchema;
|
|
8196
|
+
var init_chunk_6J742GLA = __esm({
|
|
8197
|
+
"../../packages/core/dist/chunk-6J742GLA.js"() {
|
|
8599
8198
|
"use strict";
|
|
8600
8199
|
init_chunk_ZVXO3XL6();
|
|
8601
8200
|
init_chunk_HZ6CADSY();
|
|
@@ -8958,29 +8557,40 @@ var init_chunk_CMRECH67 = __esm({
|
|
|
8958
8557
|
}
|
|
8959
8558
|
});
|
|
8960
8559
|
|
|
8961
|
-
// ../../packages/core/dist/chunk-
|
|
8962
|
-
var
|
|
8963
|
-
var
|
|
8964
|
-
"../../packages/core/dist/chunk-
|
|
8560
|
+
// ../../packages/core/dist/chunk-34LE6P7E.js
|
|
8561
|
+
var templateIdParam, listTemplatesQuery, deleteTemplateQuery, templateStatusQuery, createTemplateBody, updateTemplateBody, submitTemplateBody, testTemplateBody;
|
|
8562
|
+
var init_chunk_34LE6P7E = __esm({
|
|
8563
|
+
"../../packages/core/dist/chunk-34LE6P7E.js"() {
|
|
8965
8564
|
"use strict";
|
|
8966
|
-
init_chunk_CJ3L46X6();
|
|
8967
8565
|
init_zod();
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
agent_id: external_exports.string().uuid().optional(),
|
|
8971
|
-
organization_name: external_exports.string().optional()
|
|
8566
|
+
templateIdParam = external_exports.object({
|
|
8567
|
+
id: external_exports.string().uuid()
|
|
8972
8568
|
});
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
hub_id: external_exports.string().uuid()
|
|
8569
|
+
listTemplatesQuery = external_exports.object({
|
|
8570
|
+
hub_id: external_exports.string().uuid(),
|
|
8571
|
+
connection_id: external_exports.string().uuid()
|
|
8977
8572
|
});
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8573
|
+
deleteTemplateQuery = external_exports.object({
|
|
8574
|
+
hub_id: external_exports.string().uuid(),
|
|
8575
|
+
connection_id: external_exports.string().uuid()
|
|
8576
|
+
});
|
|
8577
|
+
templateStatusQuery = external_exports.object({
|
|
8578
|
+
hub_id: external_exports.string().uuid(),
|
|
8579
|
+
connection_id: external_exports.string().uuid()
|
|
8983
8580
|
});
|
|
8581
|
+
createTemplateBody = external_exports.object({
|
|
8582
|
+
hub_id: external_exports.string().uuid(),
|
|
8583
|
+
connection_id: external_exports.string().uuid()
|
|
8584
|
+
}).passthrough();
|
|
8585
|
+
updateTemplateBody = external_exports.object({}).passthrough();
|
|
8586
|
+
submitTemplateBody = external_exports.object({
|
|
8587
|
+
hub_id: external_exports.string().uuid(),
|
|
8588
|
+
connection_id: external_exports.string().uuid()
|
|
8589
|
+
}).passthrough();
|
|
8590
|
+
testTemplateBody = external_exports.object({
|
|
8591
|
+
hub_id: external_exports.string().uuid(),
|
|
8592
|
+
connection_id: external_exports.string().uuid()
|
|
8593
|
+
}).passthrough();
|
|
8984
8594
|
}
|
|
8985
8595
|
});
|
|
8986
8596
|
|
|
@@ -9098,122 +8708,452 @@ var init_chunk_SY6PLCPK = __esm({
|
|
|
9098
8708
|
}
|
|
9099
8709
|
});
|
|
9100
8710
|
|
|
9101
|
-
// ../../packages/core/dist/chunk-
|
|
9102
|
-
var
|
|
9103
|
-
var
|
|
9104
|
-
"../../packages/core/dist/chunk-
|
|
8711
|
+
// ../../packages/core/dist/chunk-ZIGA5RCU.js
|
|
8712
|
+
var BINDING_EACH_MAX_ITEMS, BINDING_TEXT_MAX_OUTPUT, BINDING_ROOTS, BINDING_NAME_SEGMENT_REGEX;
|
|
8713
|
+
var init_chunk_ZIGA5RCU = __esm({
|
|
8714
|
+
"../../packages/core/dist/chunk-ZIGA5RCU.js"() {
|
|
9105
8715
|
"use strict";
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
});
|
|
9111
|
-
conversationReadResourceQuery = external_exports.object({
|
|
9112
|
-
hub_id: external_exports.string().uuid()
|
|
9113
|
-
});
|
|
8716
|
+
BINDING_EACH_MAX_ITEMS = 100;
|
|
8717
|
+
BINDING_TEXT_MAX_OUTPUT = 16 * 1024;
|
|
8718
|
+
BINDING_ROOTS = ["params", "state", "data", "form", "item", "this"];
|
|
8719
|
+
BINDING_NAME_SEGMENT_REGEX = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
9114
8720
|
}
|
|
9115
8721
|
});
|
|
9116
8722
|
|
|
9117
|
-
// ../../packages/core/dist/chunk-
|
|
9118
|
-
var
|
|
9119
|
-
var
|
|
9120
|
-
"../../packages/core/dist/chunk-
|
|
8723
|
+
// ../../packages/core/dist/chunk-VOBDVWNC.js
|
|
8724
|
+
var INTERACTIVE_TEMPLATE_MAX_CHARS, INTERACTIVE_TEMPLATE_MAX_BLOCKS, INTERACTIVE_TEMPLATE_MAX_ACTIONS, INTERACTIVE_TEMPLATE_TEXT_MAX, INTERACTIVE_TEMPLATE_FALLBACK_MAX, INTERACTIVE_TEMPLATE_DESCRIPTION_MAX, INTERACTIVE_TEMPLATE_PARAMS_SCHEMA_MAX_CHARS, INTERACTIVE_TEMPLATE_VALUE_MAX_CHARS, INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX, INTERACTIVE_TEMPLATE_OPTIONS_MAX, PATH_MAX, TOOL_NAME_MAX, interactiveTemplateNameSchema, actionNameSchema, INTERACTIVE_TEMPLATE_FIELD_NAME_REGEX, RESERVED_FIELD_NAMES, TEMPLATE_TONES, TEMPLATE_INPUT_TYPES, TEMPLATE_ALIGNS, TEMPLATE_JUSTIFIES, TEMPLATE_TITLE_SIZES, TEMPLATE_TEXT_SIZES, TEMPLATE_TEXT_WEIGHTS, TEMPLATE_BADGE_VARIANTS, TEMPLATE_BUTTON_STYLES, TEMPLATE_LIST_DIRECTIONS, text, label, path2, binding, common, fieldCommon, children, containerProps, optionSchema, templateBlockSchema, blockSchema, unanchored, INTERACTIVE_TEMPLATE_STATE_PATH_REGEX, valueTemplate, statePath, templateActionSchema, paramsJsonSchema, dataSchema, interactiveTemplateDefinitionSchema;
|
|
8725
|
+
var init_chunk_VOBDVWNC = __esm({
|
|
8726
|
+
"../../packages/core/dist/chunk-VOBDVWNC.js"() {
|
|
9121
8727
|
"use strict";
|
|
8728
|
+
init_chunk_ZIGA5RCU();
|
|
8729
|
+
init_chunk_WEXVYJ5H();
|
|
8730
|
+
init_chunk_6TSQ5HXC();
|
|
8731
|
+
init_chunk_HZ6CADSY();
|
|
9122
8732
|
init_zod();
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
8733
|
+
INTERACTIVE_TEMPLATE_MAX_CHARS = 64 * 1024;
|
|
8734
|
+
INTERACTIVE_TEMPLATE_MAX_BLOCKS = 200;
|
|
8735
|
+
INTERACTIVE_TEMPLATE_MAX_ACTIONS = 30;
|
|
8736
|
+
INTERACTIVE_TEMPLATE_TEXT_MAX = 2e3;
|
|
8737
|
+
INTERACTIVE_TEMPLATE_FALLBACK_MAX = 4e3;
|
|
8738
|
+
INTERACTIVE_TEMPLATE_DESCRIPTION_MAX = 500;
|
|
8739
|
+
INTERACTIVE_TEMPLATE_PARAMS_SCHEMA_MAX_CHARS = 16 * 1024;
|
|
8740
|
+
INTERACTIVE_TEMPLATE_VALUE_MAX_CHARS = 4 * 1024;
|
|
8741
|
+
INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX = 20;
|
|
8742
|
+
INTERACTIVE_TEMPLATE_OPTIONS_MAX = 50;
|
|
8743
|
+
PATH_MAX = 256;
|
|
8744
|
+
TOOL_NAME_MAX = 128;
|
|
8745
|
+
interactiveTemplateNameSchema = external_exports.string().regex(SLUG_REGEX, {
|
|
8746
|
+
message: 'a template name is lowercase letters, digits and underscores, starting with a letter (e.g. "menu")'
|
|
9127
8747
|
});
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
limit: external_exports.coerce.number().int().min(1).max(1e3).optional()
|
|
8748
|
+
actionNameSchema = external_exports.string().regex(SLUG_REGEX, {
|
|
8749
|
+
message: "an action name is lowercase letters, digits and underscores, starting with a letter"
|
|
9131
8750
|
});
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
"
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
8751
|
+
INTERACTIVE_TEMPLATE_FIELD_NAME_REGEX = /^[A-Za-z_][A-Za-z0-9_]{0,63}$/;
|
|
8752
|
+
RESERVED_FIELD_NAMES = new Set(BINDING_ROOTS);
|
|
8753
|
+
TEMPLATE_TONES = ["default", "secondary", "success", "danger", "warning", "info"];
|
|
8754
|
+
TEMPLATE_INPUT_TYPES = ["text", "number", "email", "tel", "date"];
|
|
8755
|
+
TEMPLATE_ALIGNS = ["start", "center", "end", "stretch"];
|
|
8756
|
+
TEMPLATE_JUSTIFIES = ["start", "center", "end", "between"];
|
|
8757
|
+
TEMPLATE_TITLE_SIZES = ["sm", "md", "lg"];
|
|
8758
|
+
TEMPLATE_TEXT_SIZES = ["xs", "sm", "md", "lg"];
|
|
8759
|
+
TEMPLATE_TEXT_WEIGHTS = ["normal", "medium", "bold"];
|
|
8760
|
+
TEMPLATE_BADGE_VARIANTS = ["solid", "soft", "outline"];
|
|
8761
|
+
TEMPLATE_BUTTON_STYLES = ["primary", "secondary"];
|
|
8762
|
+
TEMPLATE_LIST_DIRECTIONS = ["vertical", "horizontal"];
|
|
8763
|
+
text = external_exports.string().max(INTERACTIVE_TEMPLATE_TEXT_MAX);
|
|
8764
|
+
label = text.min(1);
|
|
8765
|
+
path2 = external_exports.string().min(1).max(PATH_MAX);
|
|
8766
|
+
binding = external_exports.string().min(1).max(PATH_MAX);
|
|
8767
|
+
common = { if: path2.optional() };
|
|
8768
|
+
fieldCommon = {
|
|
8769
|
+
...common,
|
|
8770
|
+
name: label,
|
|
8771
|
+
label: text.optional(),
|
|
8772
|
+
required: external_exports.union([external_exports.boolean(), binding]).optional(),
|
|
8773
|
+
source: text.optional()
|
|
8774
|
+
};
|
|
8775
|
+
children = () => external_exports.array(blockSchema).min(1).max(INTERACTIVE_TEMPLATE_MAX_BLOCKS);
|
|
8776
|
+
containerProps = () => ({
|
|
8777
|
+
gap: external_exports.number().int().min(0).max(8).optional(),
|
|
8778
|
+
align: external_exports.enum(TEMPLATE_ALIGNS).optional(),
|
|
8779
|
+
justify: external_exports.enum(TEMPLATE_JUSTIFIES).optional()
|
|
9154
8780
|
});
|
|
8781
|
+
optionSchema = external_exports.object({ value: text, label }).strict();
|
|
8782
|
+
templateBlockSchema = external_exports.lazy(
|
|
8783
|
+
() => external_exports.discriminatedUnion("type", [
|
|
8784
|
+
external_exports.object({ ...common, type: external_exports.literal("card"), children: children() }).strict(),
|
|
8785
|
+
external_exports.object({ ...common, ...containerProps(), type: external_exports.literal("row"), children: children() }).strict(),
|
|
8786
|
+
external_exports.object({ ...common, ...containerProps(), type: external_exports.literal("col"), children: children() }).strict(),
|
|
8787
|
+
external_exports.object({
|
|
8788
|
+
...common,
|
|
8789
|
+
type: external_exports.literal("list"),
|
|
8790
|
+
each: path2,
|
|
8791
|
+
item: blockSchema,
|
|
8792
|
+
direction: external_exports.enum(TEMPLATE_LIST_DIRECTIONS).optional(),
|
|
8793
|
+
limit: external_exports.number().int().min(1).max(BINDING_EACH_MAX_ITEMS).optional(),
|
|
8794
|
+
key: external_exports.string().max(64).regex(BINDING_NAME_SEGMENT_REGEX).optional(),
|
|
8795
|
+
empty: text.optional()
|
|
8796
|
+
}).strict(),
|
|
8797
|
+
external_exports.object({ ...common, type: external_exports.literal("image"), src: label, alt: text.optional() }).strict(),
|
|
8798
|
+
external_exports.object({ ...common, type: external_exports.literal("title"), text: label, size: external_exports.enum(TEMPLATE_TITLE_SIZES).optional() }).strict(),
|
|
8799
|
+
external_exports.object({
|
|
8800
|
+
...common,
|
|
8801
|
+
type: external_exports.literal("text"),
|
|
8802
|
+
text: label,
|
|
8803
|
+
size: external_exports.enum(TEMPLATE_TEXT_SIZES).optional(),
|
|
8804
|
+
weight: external_exports.enum(TEMPLATE_TEXT_WEIGHTS).optional(),
|
|
8805
|
+
color: external_exports.enum(TEMPLATE_TONES).optional()
|
|
8806
|
+
}).strict(),
|
|
8807
|
+
external_exports.object({
|
|
8808
|
+
...common,
|
|
8809
|
+
type: external_exports.literal("badge"),
|
|
8810
|
+
text: label,
|
|
8811
|
+
color: external_exports.enum(TEMPLATE_TONES).optional(),
|
|
8812
|
+
variant: external_exports.enum(TEMPLATE_BADGE_VARIANTS).optional()
|
|
8813
|
+
}).strict(),
|
|
8814
|
+
external_exports.object({ ...common, type: external_exports.literal("divider") }).strict(),
|
|
8815
|
+
external_exports.object({
|
|
8816
|
+
...common,
|
|
8817
|
+
type: external_exports.literal("button"),
|
|
8818
|
+
label,
|
|
8819
|
+
action: actionNameSchema,
|
|
8820
|
+
style: external_exports.enum(TEMPLATE_BUTTON_STYLES).optional()
|
|
8821
|
+
}).strict(),
|
|
8822
|
+
external_exports.object({
|
|
8823
|
+
...fieldCommon,
|
|
8824
|
+
type: external_exports.literal("select"),
|
|
8825
|
+
options: external_exports.union([external_exports.array(optionSchema).min(1).max(INTERACTIVE_TEMPLATE_OPTIONS_MAX), binding]),
|
|
8826
|
+
placeholder: text.optional(),
|
|
8827
|
+
default_value: text.optional()
|
|
8828
|
+
}).strict(),
|
|
8829
|
+
external_exports.object({
|
|
8830
|
+
...fieldCommon,
|
|
8831
|
+
type: external_exports.literal("input"),
|
|
8832
|
+
input_type: external_exports.union([external_exports.enum(TEMPLATE_INPUT_TYPES), binding]).optional(),
|
|
8833
|
+
placeholder: text.optional(),
|
|
8834
|
+
default_value: text.optional()
|
|
8835
|
+
}).strict(),
|
|
8836
|
+
external_exports.object({
|
|
8837
|
+
...fieldCommon,
|
|
8838
|
+
type: external_exports.literal("checkbox"),
|
|
8839
|
+
label,
|
|
8840
|
+
default_checked: external_exports.union([external_exports.boolean(), binding]).optional()
|
|
8841
|
+
}).strict(),
|
|
8842
|
+
external_exports.object({
|
|
8843
|
+
...common,
|
|
8844
|
+
type: external_exports.literal("form"),
|
|
8845
|
+
children: children(),
|
|
8846
|
+
submit: actionNameSchema,
|
|
8847
|
+
submit_label: text.optional()
|
|
8848
|
+
}).strict()
|
|
8849
|
+
])
|
|
8850
|
+
);
|
|
8851
|
+
blockSchema = templateBlockSchema;
|
|
8852
|
+
unanchored = (regex) => regex.source.replace(/^\^/, "").replace(/\$$/, "");
|
|
8853
|
+
INTERACTIVE_TEMPLATE_STATE_PATH_REGEX = new RegExp(
|
|
8854
|
+
`^state\\.${unanchored(SLUG_REGEX)}(\\.${unanchored(BINDING_NAME_SEGMENT_REGEX)}){0,10}$`
|
|
8855
|
+
);
|
|
8856
|
+
valueTemplate = external_exports.unknown().superRefine((value, ctx) => {
|
|
8857
|
+
if (!withinJsonLength(value, INTERACTIVE_TEMPLATE_VALUE_MAX_CHARS)) {
|
|
8858
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `a value is JSON of at most ${INTERACTIVE_TEMPLATE_VALUE_MAX_CHARS} characters` });
|
|
8859
|
+
}
|
|
8860
|
+
});
|
|
8861
|
+
statePath = external_exports.string().regex(INTERACTIVE_TEMPLATE_STATE_PATH_REGEX, {
|
|
8862
|
+
message: 'a state path is "state.<state slug>" then field names (e.g. "state.order.items")'
|
|
8863
|
+
});
|
|
8864
|
+
templateActionSchema = external_exports.discriminatedUnion("type", [
|
|
8865
|
+
external_exports.object({ type: external_exports.literal("send"), text: label.optional(), values: valueTemplate.optional() }).strict(),
|
|
8866
|
+
external_exports.object({ type: external_exports.literal("set_state"), path: statePath, value: valueTemplate }).strict(),
|
|
8867
|
+
external_exports.object({ type: external_exports.literal("append_state"), path: statePath, value: valueTemplate }).strict(),
|
|
8868
|
+
external_exports.object({ type: external_exports.literal("remove_state"), path: statePath, value: valueTemplate }).strict()
|
|
8869
|
+
]).superRefine((action, ctx) => {
|
|
8870
|
+
if (action.type === "send" && action.text === void 0 && action.values === void 0) {
|
|
8871
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "a send action has text, values, or both" });
|
|
8872
|
+
}
|
|
8873
|
+
});
|
|
8874
|
+
paramsJsonSchema = external_exports.record(external_exports.unknown()).superRefine((schema, ctx) => {
|
|
8875
|
+
if (!withinJsonLength(schema, INTERACTIVE_TEMPLATE_PARAMS_SCHEMA_MAX_CHARS)) {
|
|
8876
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `params is at most ${INTERACTIVE_TEMPLATE_PARAMS_SCHEMA_MAX_CHARS} characters of JSON` });
|
|
8877
|
+
return;
|
|
8878
|
+
}
|
|
8879
|
+
const result = validateToolInputSchema(schema);
|
|
8880
|
+
if (!result.ok) {
|
|
8881
|
+
for (const error of result.errors) {
|
|
8882
|
+
ctx.addIssue({
|
|
8883
|
+
code: external_exports.ZodIssueCode.custom,
|
|
8884
|
+
message: `params is not a valid JSON Schema${error.path ? ` at "${error.path}"` : ""}: ${error.message}`
|
|
8885
|
+
});
|
|
8886
|
+
}
|
|
8887
|
+
}
|
|
8888
|
+
});
|
|
8889
|
+
dataSchema = external_exports.object({
|
|
8890
|
+
/** The tool's name, as the agent holds it. The backend calls it; the model never types its data. */
|
|
8891
|
+
tool: external_exports.string().trim().min(1).max(TOOL_NAME_MAX),
|
|
8892
|
+
params: external_exports.union([
|
|
8893
|
+
external_exports.array(external_exports.string()).max(INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX),
|
|
8894
|
+
external_exports.record(valueTemplate).refine((r) => Object.keys(r).length <= INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX, {
|
|
8895
|
+
message: `data.params passes at most ${INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX} values`
|
|
8896
|
+
})
|
|
8897
|
+
]).default({}).transform(
|
|
8898
|
+
(params) => Array.isArray(params) ? Object.fromEntries(params.map((name) => [name, `{{params.${name}}}`])) : params
|
|
8899
|
+
),
|
|
8900
|
+
/** The result's top-level fields the template reads: what the message's data snapshot keeps. */
|
|
8901
|
+
fields: external_exports.array(external_exports.string().max(64).regex(BINDING_NAME_SEGMENT_REGEX)).min(1).max(INTERACTIVE_TEMPLATE_DATA_FIELDS_MAX)
|
|
8902
|
+
}).strict();
|
|
8903
|
+
interactiveTemplateDefinitionSchema = external_exports.object({
|
|
8904
|
+
name: interactiveTemplateNameSchema,
|
|
8905
|
+
description: external_exports.string().trim().min(1).max(INTERACTIVE_TEMPLATE_DESCRIPTION_MAX),
|
|
8906
|
+
params: paramsJsonSchema.default({ type: "object", properties: {} }),
|
|
8907
|
+
data: dataSchema.optional(),
|
|
8908
|
+
/** Phase 1: the one view, `main`. Phase 1b adds others beside it. */
|
|
8909
|
+
views: external_exports.object({ main: blockSchema }).strict(),
|
|
8910
|
+
actions: external_exports.record(actionNameSchema, templateActionSchema).default({}).refine((actions) => Object.keys(actions).length <= INTERACTIVE_TEMPLATE_MAX_ACTIONS, {
|
|
8911
|
+
message: `at most ${INTERACTIVE_TEMPLATE_MAX_ACTIONS} actions`
|
|
8912
|
+
}),
|
|
8913
|
+
fallback: external_exports.string().trim().min(1).max(INTERACTIVE_TEMPLATE_FALLBACK_MAX)
|
|
8914
|
+
}).strict();
|
|
9155
8915
|
}
|
|
9156
8916
|
});
|
|
9157
8917
|
|
|
9158
|
-
// ../../packages/core/dist/chunk-
|
|
9159
|
-
var
|
|
9160
|
-
var
|
|
9161
|
-
"../../packages/core/dist/chunk-
|
|
9162
|
-
"use strict";
|
|
9163
|
-
SUMMARIZATION_THRESHOLD_MIN = 1e3;
|
|
9164
|
-
SUMMARIZATION_THRESHOLD_MAX = 1e6;
|
|
9165
|
-
}
|
|
9166
|
-
});
|
|
9167
|
-
|
|
9168
|
-
// ../../packages/core/dist/chunk-C2UEA2KW.js
|
|
9169
|
-
var FLAG_CONDITION_OPERATORS;
|
|
9170
|
-
var init_chunk_C2UEA2KW = __esm({
|
|
9171
|
-
"../../packages/core/dist/chunk-C2UEA2KW.js"() {
|
|
9172
|
-
"use strict";
|
|
9173
|
-
FLAG_CONDITION_OPERATORS = ["=", "!=", ">=", "<=", ">", "<"];
|
|
9174
|
-
}
|
|
9175
|
-
});
|
|
9176
|
-
|
|
9177
|
-
// ../../packages/core/dist/chunk-4IXIQQ2A.js
|
|
9178
|
-
function isNativeToolName(name) {
|
|
9179
|
-
return NATIVE_TOOL_NAMES.has(name);
|
|
9180
|
-
}
|
|
9181
|
-
function catalogToolSideEffects(toolName) {
|
|
9182
|
-
const sideEffects = CATALOG_SIDE_EFFECTS.get(toolName);
|
|
9183
|
-
if (sideEffects === void 0) return "unknown";
|
|
9184
|
-
return sideEffects ? "side_effects" : "none";
|
|
9185
|
-
}
|
|
9186
|
-
function idempotencyHeaderRefusal(value) {
|
|
9187
|
-
if (typeof value !== "string" || !/^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/.test(value)) {
|
|
9188
|
-
return "idempotency_header must be a header name: letters, digits and dashes, at most 64";
|
|
9189
|
-
}
|
|
9190
|
-
if (RESERVED_HEADERS.has(value.toLowerCase())) {
|
|
9191
|
-
return `idempotency_header cannot be ${value}: the platform sets that header`;
|
|
9192
|
-
}
|
|
9193
|
-
return null;
|
|
9194
|
-
}
|
|
9195
|
-
var NATIVE_TOOL_SCHEMAS, WAYAI_CONNECTOR, SANDBOX_AGENT_ROLES, BASE_NATIVE_TOOLS, NATIVE_TOOLS, NATIVE_TOOL_NAMES, CATALOG_SIDE_EFFECTS, CATALOG_REPLAY, REPLAY_OVERRIDES, RESERVED_HEADERS;
|
|
9196
|
-
var init_chunk_4IXIQQ2A = __esm({
|
|
9197
|
-
"../../packages/core/dist/chunk-4IXIQQ2A.js"() {
|
|
8918
|
+
// ../../packages/core/dist/chunk-KMAC3O3L.js
|
|
8919
|
+
var OPTION_ITEM, choices, form;
|
|
8920
|
+
var init_chunk_KMAC3O3L = __esm({
|
|
8921
|
+
"../../packages/core/dist/chunk-KMAC3O3L.js"() {
|
|
9198
8922
|
"use strict";
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
"
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
8923
|
+
init_chunk_VOBDVWNC();
|
|
8924
|
+
OPTION_ITEM = {
|
|
8925
|
+
type: "object",
|
|
8926
|
+
properties: {
|
|
8927
|
+
id: { type: "string", description: "What the agent receives when this one is picked" },
|
|
8928
|
+
label: { type: "string", description: "What the person sees" }
|
|
8929
|
+
},
|
|
8930
|
+
required: ["id", "label"]
|
|
8931
|
+
};
|
|
8932
|
+
choices = {
|
|
8933
|
+
name: "choices",
|
|
8934
|
+
description: "A question with up to 10 options, each with an optional description. The person picks one; the agent receives its id and label.",
|
|
8935
|
+
params: {
|
|
8936
|
+
type: "object",
|
|
8937
|
+
properties: {
|
|
8938
|
+
prompt: { type: "string", description: "The question, shown above the options" },
|
|
8939
|
+
options: {
|
|
8940
|
+
type: "array",
|
|
8941
|
+
minItems: 1,
|
|
8942
|
+
maxItems: 10,
|
|
8943
|
+
items: {
|
|
8944
|
+
...OPTION_ITEM,
|
|
8945
|
+
properties: { ...OPTION_ITEM.properties, description: { type: "string", description: "A line under the label" } }
|
|
8946
|
+
}
|
|
8947
|
+
}
|
|
8948
|
+
},
|
|
8949
|
+
required: ["options"]
|
|
8950
|
+
},
|
|
8951
|
+
views: {
|
|
8952
|
+
main: {
|
|
8953
|
+
type: "card",
|
|
8954
|
+
children: [
|
|
8955
|
+
{ type: "text", if: "params.prompt", text: "{{params.prompt}}" },
|
|
8956
|
+
{
|
|
8957
|
+
type: "list",
|
|
8958
|
+
each: "params.options",
|
|
8959
|
+
item: {
|
|
8960
|
+
type: "col",
|
|
8961
|
+
gap: 1,
|
|
8962
|
+
children: [
|
|
8963
|
+
{ type: "button", label: "{{item.label}}", action: "choose" },
|
|
8964
|
+
{ type: "text", if: "item.description", text: "{{item.description}}", size: "sm", color: "secondary" }
|
|
8965
|
+
]
|
|
8966
|
+
}
|
|
8967
|
+
}
|
|
8968
|
+
]
|
|
8969
|
+
}
|
|
8970
|
+
},
|
|
8971
|
+
actions: {
|
|
8972
|
+
choose: { type: "send", text: "{{item.label}}", values: { id: "{{item.id}}" } }
|
|
8973
|
+
},
|
|
8974
|
+
fallback: "{{#if params.prompt}}{{params.prompt}}\n{{/if}}{{#each params.options}}{{@n}}. {{label}}{{#if description}} \u2014 {{description}}{{/if}}\n{{/each}}"
|
|
8975
|
+
};
|
|
8976
|
+
form = {
|
|
8977
|
+
name: "form",
|
|
8978
|
+
description: "A form of up to 20 fields, each a text input, a select or a checkbox, optionally pre-filled and annotated with where its value came from. The person submits it; the agent receives the values.",
|
|
8979
|
+
params: {
|
|
8980
|
+
type: "object",
|
|
8981
|
+
properties: {
|
|
8982
|
+
title: { type: "string", description: "Shown above the fields" },
|
|
8983
|
+
submit_label: { type: "string", description: "The submit button's label" },
|
|
8984
|
+
fields: {
|
|
8985
|
+
type: "array",
|
|
8986
|
+
minItems: 1,
|
|
8987
|
+
maxItems: 20,
|
|
8988
|
+
items: {
|
|
8989
|
+
type: "object",
|
|
8990
|
+
properties: {
|
|
8991
|
+
name: { type: "string", pattern: INTERACTIVE_TEMPLATE_FIELD_NAME_REGEX.source, description: "The key the value is submitted under" },
|
|
8992
|
+
label: { type: "string" },
|
|
8993
|
+
input: {
|
|
8994
|
+
type: "string",
|
|
8995
|
+
enum: [...TEMPLATE_INPUT_TYPES],
|
|
8996
|
+
description: "A text input of this type. Give exactly one of input, select or checkbox."
|
|
8997
|
+
},
|
|
8998
|
+
select: { type: "array", minItems: 1, maxItems: INTERACTIVE_TEMPLATE_OPTIONS_MAX, items: { type: "object", properties: { value: { type: "string" }, label: { type: "string" } }, required: ["value", "label"] } },
|
|
8999
|
+
checkbox: { type: "boolean", enum: [true] },
|
|
9000
|
+
value: { type: ["string", "number", "boolean"], description: "The pre-filled value (a checkbox: true when checked)" },
|
|
9001
|
+
placeholder: { type: "string" },
|
|
9002
|
+
required: { type: "boolean" },
|
|
9003
|
+
source: { type: "string", description: "Where the pre-filled value came from, shown under the field" }
|
|
9004
|
+
},
|
|
9005
|
+
required: ["name", "label"],
|
|
9006
|
+
oneOf: [{ required: ["input"] }, { required: ["select"] }, { required: ["checkbox"] }]
|
|
9007
|
+
}
|
|
9008
|
+
}
|
|
9009
|
+
},
|
|
9010
|
+
required: ["fields"]
|
|
9011
|
+
},
|
|
9012
|
+
views: {
|
|
9013
|
+
main: {
|
|
9014
|
+
type: "card",
|
|
9015
|
+
children: [
|
|
9016
|
+
{ type: "title", if: "params.title", text: "{{params.title}}" },
|
|
9017
|
+
{
|
|
9018
|
+
type: "form",
|
|
9019
|
+
submit: "submit",
|
|
9020
|
+
submit_label: "{{params.submit_label}}",
|
|
9021
|
+
children: [
|
|
9022
|
+
{
|
|
9023
|
+
type: "list",
|
|
9024
|
+
each: "params.fields",
|
|
9025
|
+
item: {
|
|
9026
|
+
type: "col",
|
|
9027
|
+
children: [
|
|
9028
|
+
{
|
|
9029
|
+
type: "input",
|
|
9030
|
+
if: "item.input",
|
|
9031
|
+
name: "{{item.name}}",
|
|
9032
|
+
label: "{{item.label}}",
|
|
9033
|
+
input_type: "{{item.input}}",
|
|
9034
|
+
placeholder: "{{item.placeholder}}",
|
|
9035
|
+
default_value: "{{item.value}}",
|
|
9036
|
+
required: "{{item.required}}",
|
|
9037
|
+
source: "{{item.source}}"
|
|
9038
|
+
},
|
|
9039
|
+
{
|
|
9040
|
+
type: "select",
|
|
9041
|
+
if: "item.select",
|
|
9042
|
+
name: "{{item.name}}",
|
|
9043
|
+
label: "{{item.label}}",
|
|
9044
|
+
options: "{{item.select}}",
|
|
9045
|
+
placeholder: "{{item.placeholder}}",
|
|
9046
|
+
default_value: "{{item.value}}",
|
|
9047
|
+
required: "{{item.required}}",
|
|
9048
|
+
source: "{{item.source}}"
|
|
9049
|
+
},
|
|
9050
|
+
{
|
|
9051
|
+
type: "checkbox",
|
|
9052
|
+
if: "item.checkbox",
|
|
9053
|
+
name: "{{item.name}}",
|
|
9054
|
+
label: "{{item.label}}",
|
|
9055
|
+
default_checked: "{{item.value}}",
|
|
9056
|
+
required: "{{item.required}}",
|
|
9057
|
+
source: "{{item.source}}"
|
|
9058
|
+
}
|
|
9059
|
+
]
|
|
9060
|
+
}
|
|
9061
|
+
}
|
|
9062
|
+
]
|
|
9063
|
+
}
|
|
9064
|
+
]
|
|
9065
|
+
}
|
|
9066
|
+
},
|
|
9067
|
+
actions: {
|
|
9068
|
+
submit: { type: "send", values: "{{form}}" }
|
|
9069
|
+
},
|
|
9070
|
+
fallback: "{{#if params.title}}{{params.title}}\n{{/if}}{{#each params.fields}}- {{label}}{{#if value}}: {{value}}{{/if}}\n{{/each}}"
|
|
9071
|
+
};
|
|
9072
|
+
}
|
|
9073
|
+
});
|
|
9074
|
+
|
|
9075
|
+
// ../../packages/core/dist/chunk-MH4O3YEX.js
|
|
9076
|
+
var stateOperationBody;
|
|
9077
|
+
var init_chunk_MH4O3YEX = __esm({
|
|
9078
|
+
"../../packages/core/dist/chunk-MH4O3YEX.js"() {
|
|
9079
|
+
"use strict";
|
|
9080
|
+
init_chunk_6TSQ5HXC();
|
|
9081
|
+
init_zod();
|
|
9082
|
+
stateOperationBody = external_exports.object({
|
|
9083
|
+
hub_id: external_exports.string().uuid(),
|
|
9084
|
+
operation: external_exports.enum(["get", "update", "set_path", "reset"]),
|
|
9085
|
+
state_slug: slugSchema,
|
|
9086
|
+
/**
|
|
9087
|
+
* Deprecated and ignored. Scope is derived from the hub's state definition.
|
|
9088
|
+
* Kept on the schema so legacy bodies still validate.
|
|
9089
|
+
*/
|
|
9090
|
+
state_scope: external_exports.enum(["conversation", "user"]).optional(),
|
|
9091
|
+
updates: external_exports.record(external_exports.unknown()).optional(),
|
|
9092
|
+
path: external_exports.array(external_exports.string()).optional(),
|
|
9093
|
+
value: external_exports.unknown().optional()
|
|
9094
|
+
});
|
|
9095
|
+
}
|
|
9096
|
+
});
|
|
9097
|
+
|
|
9098
|
+
// ../../packages/core/dist/chunk-IBL7FANV.js
|
|
9099
|
+
var SUMMARIZATION_THRESHOLD_MIN, SUMMARIZATION_THRESHOLD_MAX;
|
|
9100
|
+
var init_chunk_IBL7FANV = __esm({
|
|
9101
|
+
"../../packages/core/dist/chunk-IBL7FANV.js"() {
|
|
9102
|
+
"use strict";
|
|
9103
|
+
SUMMARIZATION_THRESHOLD_MIN = 1e3;
|
|
9104
|
+
SUMMARIZATION_THRESHOLD_MAX = 1e6;
|
|
9105
|
+
}
|
|
9106
|
+
});
|
|
9107
|
+
|
|
9108
|
+
// ../../packages/core/dist/chunk-C2UEA2KW.js
|
|
9109
|
+
var FLAG_CONDITION_OPERATORS;
|
|
9110
|
+
var init_chunk_C2UEA2KW = __esm({
|
|
9111
|
+
"../../packages/core/dist/chunk-C2UEA2KW.js"() {
|
|
9112
|
+
"use strict";
|
|
9113
|
+
FLAG_CONDITION_OPERATORS = ["=", "!=", ">=", "<=", ">", "<"];
|
|
9114
|
+
}
|
|
9115
|
+
});
|
|
9116
|
+
|
|
9117
|
+
// ../../packages/core/dist/chunk-4IXIQQ2A.js
|
|
9118
|
+
function isNativeToolName(name) {
|
|
9119
|
+
return NATIVE_TOOL_NAMES.has(name);
|
|
9120
|
+
}
|
|
9121
|
+
function catalogToolSideEffects(toolName) {
|
|
9122
|
+
const sideEffects = CATALOG_SIDE_EFFECTS.get(toolName);
|
|
9123
|
+
if (sideEffects === void 0) return "unknown";
|
|
9124
|
+
return sideEffects ? "side_effects" : "none";
|
|
9125
|
+
}
|
|
9126
|
+
function idempotencyHeaderRefusal(value) {
|
|
9127
|
+
if (typeof value !== "string" || !/^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/.test(value)) {
|
|
9128
|
+
return "idempotency_header must be a header name: letters, digits and dashes, at most 64";
|
|
9129
|
+
}
|
|
9130
|
+
if (RESERVED_HEADERS.has(value.toLowerCase())) {
|
|
9131
|
+
return `idempotency_header cannot be ${value}: the platform sets that header`;
|
|
9132
|
+
}
|
|
9133
|
+
return null;
|
|
9134
|
+
}
|
|
9135
|
+
var NATIVE_TOOL_SCHEMAS, WAYAI_CONNECTOR, SANDBOX_AGENT_ROLES, BASE_NATIVE_TOOLS, NATIVE_TOOLS, NATIVE_TOOL_NAMES, CATALOG_SIDE_EFFECTS, CATALOG_REPLAY, REPLAY_OVERRIDES, RESERVED_HEADERS;
|
|
9136
|
+
var init_chunk_4IXIQQ2A = __esm({
|
|
9137
|
+
"../../packages/core/dist/chunk-4IXIQQ2A.js"() {
|
|
9138
|
+
"use strict";
|
|
9139
|
+
init_chunk_NYNOISIG();
|
|
9140
|
+
NATIVE_TOOL_SCHEMAS = {
|
|
9141
|
+
"close_conversation": {
|
|
9142
|
+
"tool_config": {
|
|
9143
|
+
"name": "close_conversation",
|
|
9144
|
+
"description": "Closes the current conversation and marks it as resolved",
|
|
9145
|
+
// Non-strict, mirroring the `update_kanban_status` sibling below: under strict
|
|
9146
|
+
// mode there are no optional fields, so `outcome` outside `required` makes the
|
|
9147
|
+
// provider reject the definition and `outcome` inside `required` forces the
|
|
9148
|
+
// model to emit it on every call. Requiredness is enforced SERVER-side instead
|
|
9149
|
+
// (ops `outcomeRequired`) — and it must stay out of `required` here, or
|
|
9150
|
+
// validateAndSanitizeToolParams would refuse the "retry without an outcome"
|
|
9151
|
+
// recovery path a re-close depends on.
|
|
9152
|
+
"strict": false,
|
|
9153
|
+
"parameters": {
|
|
9154
|
+
"type": "object",
|
|
9155
|
+
"properties": {
|
|
9156
|
+
"outcome": {
|
|
9217
9157
|
"type": "string",
|
|
9218
9158
|
"enum": "[KANBAN_OUTCOME_VALUES]",
|
|
9219
9159
|
"description": "Required only when the hub's terminal (conversation-ending) status declares outcomes: the closing outcome. Available outcomes: [KANBAN_OUTCOME_NAMES]"
|
|
@@ -12669,193 +12609,1228 @@ var init_chunk_I2EVH3FR = __esm({
|
|
|
12669
12609
|
}
|
|
12670
12610
|
});
|
|
12671
12611
|
|
|
12672
|
-
// ../../packages/core/dist/chunk-
|
|
12673
|
-
|
|
12674
|
-
|
|
12675
|
-
|
|
12676
|
-
const result = validateToolInputSchema(params);
|
|
12677
|
-
return result.ok ? [] : result.errors;
|
|
12678
|
-
} catch (error) {
|
|
12679
|
-
if (!(error instanceof RangeError)) throw error;
|
|
12680
|
-
return [{ path: "", message: "parameters are nested too deeply to serialize" }];
|
|
12681
|
-
}
|
|
12682
|
-
}
|
|
12683
|
-
function configText(config, key) {
|
|
12684
|
-
return config !== null && typeof config === "object" ? nonBlank(config[key]) : void 0;
|
|
12685
|
-
}
|
|
12686
|
-
function statedToolDescription(text4) {
|
|
12687
|
-
const description2 = nonBlank(text4);
|
|
12688
|
-
return description2 === DEFAULT_TOOL_CONFIG_DESCRIPTION ? void 0 : description2;
|
|
12689
|
-
}
|
|
12690
|
-
function toolConfigDescription(config) {
|
|
12691
|
-
return statedToolDescription(configText(config, "description"));
|
|
12692
|
-
}
|
|
12693
|
-
function offeredToolDescription(config, toolDescription) {
|
|
12694
|
-
return toolConfigDescription(config) ?? nonBlank(toolDescription);
|
|
12695
|
-
}
|
|
12696
|
-
function customToolConfigObject(config) {
|
|
12697
|
-
let read = config;
|
|
12698
|
-
for (let layer = 0; layer < MAX_CUSTOM_TOOL_CONFIG_TEXT_LAYERS && typeof read === "string"; layer++) {
|
|
12699
|
-
try {
|
|
12700
|
-
read = JSON.parse(read);
|
|
12701
|
-
} catch {
|
|
12702
|
-
return read;
|
|
12703
|
-
}
|
|
12704
|
-
}
|
|
12705
|
-
return read;
|
|
12706
|
-
}
|
|
12707
|
-
function refineToolConfig(value, ctx) {
|
|
12708
|
-
if (value.tool_config == null) return;
|
|
12709
|
-
const config = customToolConfigObject(value.tool_config);
|
|
12710
|
-
if (config === null || typeof config !== "object" || Array.isArray(config)) {
|
|
12711
|
-
ctx.addIssue({
|
|
12712
|
-
code: external_exports.ZodIssueCode.custom,
|
|
12713
|
-
path: ["tool_config"],
|
|
12714
|
-
message: "tool_config must be an object"
|
|
12715
|
-
});
|
|
12716
|
-
return;
|
|
12717
|
-
}
|
|
12718
|
-
const params = extractToolParameters(config);
|
|
12719
|
-
if (params === void 0) return;
|
|
12720
|
-
for (const err of toolParametersViolations(params)) {
|
|
12721
|
-
ctx.addIssue({
|
|
12722
|
-
code: external_exports.ZodIssueCode.custom,
|
|
12723
|
-
path: ["tool_config", "parameters", ...err.path.split(".").filter(Boolean)],
|
|
12724
|
-
message: err.suggestion ? `${err.message} \u2014 ${err.suggestion}` : err.message
|
|
12725
|
-
});
|
|
12726
|
-
}
|
|
12727
|
-
}
|
|
12728
|
-
var nonBlank, DEFAULT_TOOL_CONFIG_DESCRIPTION, MAX_CUSTOM_TOOL_CONFIG_TEXT_LAYERS, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, toolReplaySettingsFields, toolReplaySettingsSchema, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody;
|
|
12729
|
-
var init_chunk_CZS5NGTA = __esm({
|
|
12730
|
-
"../../packages/core/dist/chunk-CZS5NGTA.js"() {
|
|
12612
|
+
// ../../packages/core/dist/chunk-C4HEZ7ZI.js
|
|
12613
|
+
var downloadBody, uploadQuery, SIGN_URL_MAX_EXPIRES_IN_SECONDS, signUrlBody;
|
|
12614
|
+
var init_chunk_C4HEZ7ZI = __esm({
|
|
12615
|
+
"../../packages/core/dist/chunk-C4HEZ7ZI.js"() {
|
|
12731
12616
|
"use strict";
|
|
12732
|
-
|
|
12733
|
-
init_chunk_HZ6CADSY();
|
|
12734
|
-
init_chunk_4IXIQQ2A();
|
|
12617
|
+
init_chunk_CJ3L46X6();
|
|
12735
12618
|
init_zod();
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
listToolsQuery = external_exports.object({ agent_id: uuidSchema, hub_id: uuidSchema });
|
|
12741
|
-
toolAgentQuery = external_exports.object({ agent_id: uuidSchema, hub_id: uuidSchema });
|
|
12742
|
-
deleteToolQuery = external_exports.object({ agent_id: uuidSchema.optional(), hub_id: uuidSchema });
|
|
12743
|
-
toolConnectionsQuery = external_exports.object({ hub_id: uuidSchema });
|
|
12744
|
-
nativeToolIdSchema = external_exports.string().regex(/^nt-\d{3,}$/, "Invalid native tool id");
|
|
12745
|
-
CONTEXT_BOUNDARIES = ["instruction", "summary", "transcript"];
|
|
12746
|
-
contextBoundarySchema = external_exports.enum(CONTEXT_BOUNDARIES);
|
|
12747
|
-
addNativeToolBody = external_exports.object({
|
|
12748
|
-
agent_id: uuidSchema,
|
|
12749
|
-
hub_id: uuidSchema,
|
|
12750
|
-
tool_native_id: nativeToolIdSchema,
|
|
12751
|
-
delegation_type: external_exports.enum(["team", "agent", "hub"]).optional(),
|
|
12752
|
-
delegation_id: external_exports.string().optional(),
|
|
12753
|
-
delegation_name: external_exports.string().optional(),
|
|
12754
|
-
/** Only meaningful for a `hub` delegation (`delegate_to_hub`); ignored otherwise.
|
|
12755
|
-
* Defaults to `summary` when omitted. Admin-set — the link and boundary require
|
|
12756
|
-
* hub-admin (`hub:write`), never derived from any end user's grants. */
|
|
12757
|
-
delegation_context_boundary: contextBoundarySchema.optional()
|
|
12758
|
-
// No `resource_config`: retired with knowledge, its column dropped (HubDO v106). A body that still
|
|
12759
|
-
// sends it is accepted, the key stripped.
|
|
12619
|
+
downloadBody = external_exports.object({
|
|
12620
|
+
type: external_exports.enum(["workspace", "agent_instructions"]),
|
|
12621
|
+
agent_id: external_exports.string().uuid().optional(),
|
|
12622
|
+
organization_name: external_exports.string().optional()
|
|
12760
12623
|
});
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12624
|
+
uploadQuery = external_exports.object({
|
|
12625
|
+
type: external_exports.enum(["agent_instructions"]),
|
|
12626
|
+
agent_id: external_exports.string().uuid(),
|
|
12627
|
+
hub_id: external_exports.string().uuid()
|
|
12765
12628
|
});
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
}),
|
|
12772
|
-
irreversible: external_exports.boolean().optional()
|
|
12773
|
-
};
|
|
12774
|
-
toolReplaySettingsSchema = external_exports.object(toolReplaySettingsFields);
|
|
12775
|
-
createCustomToolBody = external_exports.object({
|
|
12776
|
-
agent_id: uuidSchema,
|
|
12777
|
-
hub_id: uuidSchema,
|
|
12778
|
-
...toolReplaySettingsFields
|
|
12779
|
-
}).passthrough().superRefine(refineToolConfig);
|
|
12780
|
-
updateCustomToolBody = external_exports.object({
|
|
12781
|
-
hub_id: uuidSchema.optional(),
|
|
12782
|
-
...toolReplaySettingsFields
|
|
12783
|
-
}).passthrough().superRefine(refineToolConfig);
|
|
12784
|
-
updateToolExecutionConfigBody = external_exports.object({
|
|
12785
|
-
agent_id: uuidSchema,
|
|
12786
|
-
hub_id: uuidSchema,
|
|
12787
|
-
execution_config: external_exports.object({
|
|
12788
|
-
keep_in_history: external_exports.boolean().optional()
|
|
12789
|
-
}).nullable()
|
|
12629
|
+
SIGN_URL_MAX_EXPIRES_IN_SECONDS = 3600;
|
|
12630
|
+
signUrlBody = external_exports.object({
|
|
12631
|
+
bucket: external_exports.string(),
|
|
12632
|
+
filePath: external_exports.string(),
|
|
12633
|
+
expiresIn: external_exports.number().int().positive().max(SIGN_URL_MAX_EXPIRES_IN_SECONDS).optional()
|
|
12790
12634
|
});
|
|
12791
12635
|
}
|
|
12792
12636
|
});
|
|
12793
12637
|
|
|
12794
|
-
// ../../packages/core/dist/chunk-
|
|
12795
|
-
var
|
|
12796
|
-
var
|
|
12797
|
-
"../../packages/core/dist/chunk-
|
|
12638
|
+
// ../../packages/core/dist/chunk-YULHXJ5M.js
|
|
12639
|
+
var COMMUNITY_LESSON_TREE_MAX_BYTES, COMMUNITY_LESSON_LINK_PROTOCOLS, COMMUNITY_LESSON_TREE_TOO_LARGE_REASON, COMMUNITY_LESSON_TREE_TOO_DEEP_REASON, COMMUNITY_LESSON_LINE_PREFIX_TOO_WIDE_REASON, LINK_SCHEME;
|
|
12640
|
+
var init_chunk_YULHXJ5M = __esm({
|
|
12641
|
+
"../../packages/core/dist/chunk-YULHXJ5M.js"() {
|
|
12798
12642
|
"use strict";
|
|
12799
|
-
|
|
12800
|
-
|
|
12643
|
+
COMMUNITY_LESSON_TREE_MAX_BYTES = 512 * 1024;
|
|
12644
|
+
COMMUNITY_LESSON_LINK_PROTOCOLS = ["http", "https", "mailto"];
|
|
12645
|
+
COMMUNITY_LESSON_TREE_TOO_LARGE_REASON = "lesson_tree_too_large";
|
|
12646
|
+
COMMUNITY_LESSON_TREE_TOO_DEEP_REASON = "lesson_tree_too_deep";
|
|
12647
|
+
COMMUNITY_LESSON_LINE_PREFIX_TOO_WIDE_REASON = "lesson_line_prefix_too_wide";
|
|
12648
|
+
LINK_SCHEME = new RegExp(`^(${COMMUNITY_LESSON_LINK_PROTOCOLS.join("|")}):`, "i");
|
|
12801
12649
|
}
|
|
12802
12650
|
});
|
|
12803
12651
|
|
|
12804
|
-
// ../../packages/core/dist/chunk-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12808
|
-
return true;
|
|
12809
|
-
} catch {
|
|
12810
|
-
return false;
|
|
12811
|
-
}
|
|
12812
|
-
}
|
|
12813
|
-
var evalDateContextSchema;
|
|
12814
|
-
var init_chunk_7DLTG7J5 = __esm({
|
|
12815
|
-
"../../packages/core/dist/chunk-7DLTG7J5.js"() {
|
|
12652
|
+
// ../../packages/core/dist/chunk-V4FRPRH5.js
|
|
12653
|
+
var CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS;
|
|
12654
|
+
var init_chunk_V4FRPRH5 = __esm({
|
|
12655
|
+
"../../packages/core/dist/chunk-V4FRPRH5.js"() {
|
|
12816
12656
|
"use strict";
|
|
12817
|
-
init_chunk_KB5RK3RP();
|
|
12818
|
-
init_chunk_HZ6CADSY();
|
|
12819
|
-
init_chunk_MIWZOSPI();
|
|
12820
|
-
init_chunk_NYNOISIG();
|
|
12821
12657
|
init_zod();
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12658
|
+
CONSULT_THREAD_STATUSES = ["open", "awaiting", "resolved", "cancelled_at_close"];
|
|
12659
|
+
consultThreadStatus = external_exports.enum(CONSULT_THREAD_STATUSES);
|
|
12660
|
+
CONSULT_THREAD_TITLE_MAX = 120;
|
|
12661
|
+
consultThreadTitle = external_exports.string().trim().min(1).max(CONSULT_THREAD_TITLE_MAX);
|
|
12662
|
+
consultThreadSummary = external_exports.object({
|
|
12663
|
+
consult_thread_id: external_exports.string(),
|
|
12664
|
+
conversation_id: external_exports.string(),
|
|
12665
|
+
initiator_type: external_exports.enum(["team", "agent"]),
|
|
12666
|
+
initiator_id: external_exports.string(),
|
|
12667
|
+
engaged_agent_id: external_exports.string().nullable(),
|
|
12668
|
+
engaged_agent_name: external_exports.string().nullable(),
|
|
12669
|
+
title: external_exports.string().nullable(),
|
|
12670
|
+
status: consultThreadStatus,
|
|
12671
|
+
created_at: external_exports.string()
|
|
12672
|
+
});
|
|
12673
|
+
listConsultThreadsQuery = external_exports.object({
|
|
12674
|
+
hub_id: external_exports.string().uuid()
|
|
12675
|
+
});
|
|
12676
|
+
listConsultThreadsResponse = external_exports.object({
|
|
12677
|
+
threads: external_exports.array(consultThreadSummary)
|
|
12678
|
+
});
|
|
12679
|
+
createConsultThreadBody = external_exports.object({
|
|
12680
|
+
hub_id: external_exports.string().uuid(),
|
|
12681
|
+
title: consultThreadTitle.optional(),
|
|
12682
|
+
// Optionally engage a consultant on creation. Validated server-side against the
|
|
12683
|
+
// hub's `consultant`-role agents; a non-consultant / unknown id is rejected.
|
|
12684
|
+
engaged_agent_id: external_exports.string().uuid().optional()
|
|
12685
|
+
});
|
|
12686
|
+
createConsultThreadResponse = external_exports.object({
|
|
12687
|
+
thread: consultThreadSummary
|
|
12688
|
+
});
|
|
12689
|
+
consultThreadIdParam = external_exports.object({
|
|
12690
|
+
id: external_exports.string().uuid(),
|
|
12691
|
+
threadId: external_exports.string().uuid()
|
|
12692
|
+
});
|
|
12693
|
+
updateConsultThreadBody = external_exports.object({
|
|
12694
|
+
hub_id: external_exports.string().uuid(),
|
|
12695
|
+
title: consultThreadTitle.optional(),
|
|
12696
|
+
engaged_agent_id: external_exports.string().uuid().optional()
|
|
12697
|
+
}).refine((v) => v.title !== void 0 || v.engaged_agent_id !== void 0, {
|
|
12698
|
+
message: "Provide a title and/or an engaged_agent_id to update"
|
|
12699
|
+
});
|
|
12700
|
+
updateConsultThreadResponse = external_exports.object({
|
|
12701
|
+
thread: consultThreadSummary
|
|
12702
|
+
});
|
|
12703
|
+
CONSULT_AWAIT_TIMEOUT_MS = 15 * 6e4;
|
|
12827
12704
|
}
|
|
12828
12705
|
});
|
|
12829
12706
|
|
|
12830
|
-
// ../../packages/core/dist/chunk-
|
|
12831
|
-
var
|
|
12832
|
-
var
|
|
12833
|
-
"../../packages/core/dist/chunk-
|
|
12707
|
+
// ../../packages/core/dist/chunk-LWMLR2WI.js
|
|
12708
|
+
var conversationListResourcesQuery, conversationReadResourceQuery;
|
|
12709
|
+
var init_chunk_LWMLR2WI = __esm({
|
|
12710
|
+
"../../packages/core/dist/chunk-LWMLR2WI.js"() {
|
|
12834
12711
|
"use strict";
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
12840
|
-
|
|
12712
|
+
init_zod();
|
|
12713
|
+
conversationListResourcesQuery = external_exports.object({
|
|
12714
|
+
hub_id: external_exports.string().uuid(),
|
|
12715
|
+
agent_id: external_exports.string().uuid().optional()
|
|
12716
|
+
});
|
|
12717
|
+
conversationReadResourceQuery = external_exports.object({
|
|
12718
|
+
hub_id: external_exports.string().uuid()
|
|
12719
|
+
});
|
|
12841
12720
|
}
|
|
12842
12721
|
});
|
|
12843
12722
|
|
|
12844
|
-
// ../../packages/core/dist/chunk-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12723
|
+
// ../../packages/core/dist/chunk-ACGAI25T.js
|
|
12724
|
+
var listPendingSchedulesQuery, listHubAggregateSchedulesQuery;
|
|
12725
|
+
var init_chunk_ACGAI25T = __esm({
|
|
12726
|
+
"../../packages/core/dist/chunk-ACGAI25T.js"() {
|
|
12727
|
+
"use strict";
|
|
12728
|
+
init_zod();
|
|
12729
|
+
listPendingSchedulesQuery = external_exports.object({
|
|
12730
|
+
hub_id: external_exports.string().uuid(),
|
|
12731
|
+
conversation_id: external_exports.string().uuid().optional(),
|
|
12732
|
+
user_id: external_exports.string().optional()
|
|
12733
|
+
});
|
|
12734
|
+
listHubAggregateSchedulesQuery = external_exports.object({
|
|
12735
|
+
hub_id: external_exports.string().uuid(),
|
|
12736
|
+
limit: external_exports.coerce.number().int().min(1).max(1e3).optional()
|
|
12737
|
+
});
|
|
12848
12738
|
}
|
|
12849
|
-
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12853
|
-
}
|
|
12854
|
-
|
|
12855
|
-
const
|
|
12856
|
-
|
|
12739
|
+
});
|
|
12740
|
+
|
|
12741
|
+
// ../../packages/core/dist/chunk-FOFCV4SW.js
|
|
12742
|
+
function isCaseAttributeDate(text4) {
|
|
12743
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(text4);
|
|
12744
|
+
if (!match) return false;
|
|
12745
|
+
const [year, month, day] = [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
12746
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
12747
|
+
const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
|
|
12748
|
+
return days !== void 0 && day >= 1 && day <= days;
|
|
12857
12749
|
}
|
|
12858
|
-
function
|
|
12750
|
+
function valueProblem(property, value) {
|
|
12751
|
+
switch (property.type) {
|
|
12752
|
+
case "string":
|
|
12753
|
+
if (typeof value !== "string") return "attribute_wrong_type";
|
|
12754
|
+
break;
|
|
12755
|
+
case "number":
|
|
12756
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return "attribute_wrong_type";
|
|
12757
|
+
break;
|
|
12758
|
+
case "integer":
|
|
12759
|
+
if (typeof value !== "number" || !Number.isInteger(value)) return "attribute_wrong_type";
|
|
12760
|
+
break;
|
|
12761
|
+
case "boolean":
|
|
12762
|
+
if (typeof value !== "boolean") return "attribute_wrong_type";
|
|
12763
|
+
break;
|
|
12764
|
+
default:
|
|
12765
|
+
break;
|
|
12766
|
+
}
|
|
12767
|
+
if (property.format === "date" && typeof value === "string" && !isCaseAttributeDate(value)) return "attribute_not_a_date";
|
|
12768
|
+
return null;
|
|
12769
|
+
}
|
|
12770
|
+
function propertiesOf(schema) {
|
|
12771
|
+
return Object.entries(schema.properties ?? {});
|
|
12772
|
+
}
|
|
12773
|
+
function caseAttributesSchemaProblem(schema) {
|
|
12774
|
+
for (const [key, property] of propertiesOf(schema)) {
|
|
12775
|
+
if (property.type === void 0 && property.enum === void 0) return { reason: "attribute_type_missing", at: key };
|
|
12776
|
+
if (property.format !== void 0 && property.type !== "string") return { reason: "attribute_format_unexpected", at: key };
|
|
12777
|
+
if (property.enum) {
|
|
12778
|
+
if (new Set(property.enum).size !== property.enum.length) return { reason: "attribute_option_repeated", at: key };
|
|
12779
|
+
if (property.enum.some((option) => valueProblem(property, option) !== null)) return { reason: "attribute_option_mismatch", at: key };
|
|
12780
|
+
}
|
|
12781
|
+
}
|
|
12782
|
+
const required = schema.required ?? [];
|
|
12783
|
+
if (new Set(required).size !== required.length) return { reason: "attribute_required_repeated", at: "required" };
|
|
12784
|
+
const unknown = required.find((key) => !Object.hasOwn(schema.properties ?? {}, key));
|
|
12785
|
+
if (unknown !== void 0) return { reason: "attribute_required_unknown", at: unknown };
|
|
12786
|
+
return null;
|
|
12787
|
+
}
|
|
12788
|
+
var CASE_ATTRIBUTE_KEY_PATTERN, CASE_ATTRIBUTE_KEY_MAX_LENGTH, CASE_ATTRIBUTE_TYPES, CASE_ATTRIBUTE_FORMATS, CASE_ATTRIBUTE_PROPERTIES_MAX, CASE_ATTRIBUTE_OPTIONS_MAX, CASE_ATTRIBUTE_TITLE_MAX_LENGTH, CASE_ATTRIBUTE_DESCRIPTION_MAX_LENGTH, CASE_ATTRIBUTE_OPTION_MAX_LENGTH, CASE_ATTRIBUTES_MAX_CHARS, EMPTY_CASE_ATTRIBUTES_SCHEMA, caseAttributePropertySchema, attributeKey, caseAttributesSchemaSchema;
|
|
12789
|
+
var init_chunk_FOFCV4SW = __esm({
|
|
12790
|
+
"../../packages/core/dist/chunk-FOFCV4SW.js"() {
|
|
12791
|
+
"use strict";
|
|
12792
|
+
init_zod();
|
|
12793
|
+
CASE_ATTRIBUTE_KEY_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
12794
|
+
CASE_ATTRIBUTE_KEY_MAX_LENGTH = 64;
|
|
12795
|
+
CASE_ATTRIBUTE_TYPES = ["string", "number", "integer", "boolean"];
|
|
12796
|
+
CASE_ATTRIBUTE_FORMATS = ["date"];
|
|
12797
|
+
CASE_ATTRIBUTE_PROPERTIES_MAX = 100;
|
|
12798
|
+
CASE_ATTRIBUTE_OPTIONS_MAX = 100;
|
|
12799
|
+
CASE_ATTRIBUTE_TITLE_MAX_LENGTH = 200;
|
|
12800
|
+
CASE_ATTRIBUTE_DESCRIPTION_MAX_LENGTH = 2e3;
|
|
12801
|
+
CASE_ATTRIBUTE_OPTION_MAX_LENGTH = 200;
|
|
12802
|
+
CASE_ATTRIBUTES_MAX_CHARS = 16 * 1024;
|
|
12803
|
+
EMPTY_CASE_ATTRIBUTES_SCHEMA = { type: "object" };
|
|
12804
|
+
caseAttributePropertySchema = external_exports.object({
|
|
12805
|
+
type: external_exports.enum(CASE_ATTRIBUTE_TYPES).optional(),
|
|
12806
|
+
title: external_exports.string().min(1).max(CASE_ATTRIBUTE_TITLE_MAX_LENGTH).optional(),
|
|
12807
|
+
description: external_exports.string().max(CASE_ATTRIBUTE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
12808
|
+
/** The values it may take, shown as a list to pick from. */
|
|
12809
|
+
enum: external_exports.array(external_exports.union([external_exports.string().max(CASE_ATTRIBUTE_OPTION_MAX_LENGTH), external_exports.number().finite()])).min(1).max(CASE_ATTRIBUTE_OPTIONS_MAX).optional(),
|
|
12810
|
+
/** `date`: a calendar date, `YYYY-MM-DD`. */
|
|
12811
|
+
format: external_exports.enum(CASE_ATTRIBUTE_FORMATS).optional()
|
|
12812
|
+
}).strict();
|
|
12813
|
+
attributeKey = external_exports.string().max(CASE_ATTRIBUTE_KEY_MAX_LENGTH).regex(CASE_ATTRIBUTE_KEY_PATTERN);
|
|
12814
|
+
caseAttributesSchemaSchema = external_exports.object({
|
|
12815
|
+
type: external_exports.literal("object"),
|
|
12816
|
+
properties: external_exports.record(attributeKey, caseAttributePropertySchema).refine((properties) => Object.keys(properties).length <= CASE_ATTRIBUTE_PROPERTIES_MAX, "Too many properties").optional(),
|
|
12817
|
+
required: external_exports.array(attributeKey).max(CASE_ATTRIBUTE_PROPERTIES_MAX).optional()
|
|
12818
|
+
}).strict();
|
|
12819
|
+
}
|
|
12820
|
+
});
|
|
12821
|
+
|
|
12822
|
+
// ../../packages/core/dist/chunk-VYINA6YP.js
|
|
12823
|
+
function formatterOf(zone) {
|
|
12824
|
+
const held = formatters.get(zone);
|
|
12825
|
+
if (held) return held;
|
|
12826
|
+
if (zone.length === 0 || zone.length > TIME_ZONE_NAME_MAX_LENGTH) return null;
|
|
12827
|
+
let formatter;
|
|
12828
|
+
try {
|
|
12829
|
+
formatter = new Intl.DateTimeFormat("en-US", {
|
|
12830
|
+
timeZone: zone,
|
|
12831
|
+
calendar: "iso8601",
|
|
12832
|
+
numberingSystem: "latn",
|
|
12833
|
+
year: "numeric",
|
|
12834
|
+
month: "2-digit",
|
|
12835
|
+
day: "2-digit"
|
|
12836
|
+
});
|
|
12837
|
+
} catch {
|
|
12838
|
+
return null;
|
|
12839
|
+
}
|
|
12840
|
+
const resolved = formatter.resolvedOptions().timeZone;
|
|
12841
|
+
if (!/^[A-Za-z]/.test(resolved)) return null;
|
|
12842
|
+
if (resolved === zone) formatters.set(zone, formatter);
|
|
12843
|
+
return formatter;
|
|
12844
|
+
}
|
|
12845
|
+
function isTimeZone(zone) {
|
|
12846
|
+
return formatterOf(zone) !== null;
|
|
12847
|
+
}
|
|
12848
|
+
var TIME_ZONE_NAME_MAX_LENGTH, formatters;
|
|
12849
|
+
var init_chunk_VYINA6YP = __esm({
|
|
12850
|
+
"../../packages/core/dist/chunk-VYINA6YP.js"() {
|
|
12851
|
+
"use strict";
|
|
12852
|
+
TIME_ZONE_NAME_MAX_LENGTH = 64;
|
|
12853
|
+
formatters = /* @__PURE__ */ new Map();
|
|
12854
|
+
}
|
|
12855
|
+
});
|
|
12856
|
+
|
|
12857
|
+
// ../../packages/core/dist/chunk-HSHKT7I6.js
|
|
12858
|
+
var CASE_SPACE_NAME_MAX_LENGTH, CASE_SPACE_DEFAULT_TIME_ZONE, CASE_TEAM_NAME_MAX_LENGTH, CASE_TEAM_MEMBERS_MAX, CASE_TEAM_SCOPES_MAX, CASE_MEMBERS_PAGE_MAX, CASE_PAGE_CURSOR_MAX_LENGTH, CASE_LEVELS, CASE_TEAM_TARGET_KINDS, CASE_REGISTRY_CLOSED_REASON, caseSpaceNameSchema, caseSpaceTimeZoneSchema, updateCaseSpaceSettingsBody, adminCreateCaseSpaceBody, caseOrgParam, caseSpaceParam, caseMemberParam, caseAdministratorParam, caseTeamParam, casePageQuery, saveCaseMemberBody, caseTeamScopeSchema, caseTeamMemberInput, caseTeamFields, createCaseTeamBody, updateCaseTeamBody;
|
|
12859
|
+
var init_chunk_HSHKT7I6 = __esm({
|
|
12860
|
+
"../../packages/core/dist/chunk-HSHKT7I6.js"() {
|
|
12861
|
+
"use strict";
|
|
12862
|
+
init_chunk_VYINA6YP();
|
|
12863
|
+
init_chunk_ZVXO3XL6();
|
|
12864
|
+
init_chunk_HZ6CADSY();
|
|
12865
|
+
init_zod();
|
|
12866
|
+
CASE_SPACE_NAME_MAX_LENGTH = 200;
|
|
12867
|
+
CASE_SPACE_DEFAULT_TIME_ZONE = "America/Sao_Paulo";
|
|
12868
|
+
CASE_TEAM_NAME_MAX_LENGTH = 200;
|
|
12869
|
+
CASE_TEAM_MEMBERS_MAX = 1e3;
|
|
12870
|
+
CASE_TEAM_SCOPES_MAX = 200;
|
|
12871
|
+
CASE_MEMBERS_PAGE_MAX = 200;
|
|
12872
|
+
CASE_PAGE_CURSOR_MAX_LENGTH = 2048;
|
|
12873
|
+
CASE_LEVELS = ["read", "edit", "conduct"];
|
|
12874
|
+
CASE_TEAM_TARGET_KINDS = ["party_group", "party", "instrument", "case_type"];
|
|
12875
|
+
CASE_REGISTRY_CLOSED_REASON = "case_registry_closed";
|
|
12876
|
+
caseSpaceNameSchema = external_exports.string().trim().min(1).max(CASE_SPACE_NAME_MAX_LENGTH);
|
|
12877
|
+
caseSpaceTimeZoneSchema = external_exports.string().trim().min(1).max(TIME_ZONE_NAME_MAX_LENGTH).refine(isTimeZone, "Not a time zone (an IANA name such as America/Sao_Paulo)");
|
|
12878
|
+
updateCaseSpaceSettingsBody = external_exports.object({ timezone: caseSpaceTimeZoneSchema }).strict();
|
|
12879
|
+
adminCreateCaseSpaceBody = external_exports.object({
|
|
12880
|
+
org_id: uuidSchema,
|
|
12881
|
+
name: caseSpaceNameSchema,
|
|
12882
|
+
timezone: caseSpaceTimeZoneSchema.optional()
|
|
12883
|
+
}).strict();
|
|
12884
|
+
caseOrgParam = external_exports.object({ org_id: uuidSchema });
|
|
12885
|
+
caseSpaceParam = caseOrgParam.extend({ space_id: uuidSchema });
|
|
12886
|
+
caseMemberParam = caseSpaceParam.extend({ person_id: uuidSchema });
|
|
12887
|
+
caseAdministratorParam = caseSpaceParam.extend({ user_id: peopleUserIdSchema });
|
|
12888
|
+
caseTeamParam = caseSpaceParam.extend({ team_id: uuidSchema });
|
|
12889
|
+
casePageQuery = external_exports.object({
|
|
12890
|
+
limit: external_exports.coerce.number().int().min(1).max(CASE_MEMBERS_PAGE_MAX).optional(),
|
|
12891
|
+
cursor: external_exports.string().min(1).max(CASE_PAGE_CURSOR_MAX_LENGTH).optional()
|
|
12892
|
+
});
|
|
12893
|
+
saveCaseMemberBody = external_exports.object({
|
|
12894
|
+
user_id: peopleUserIdSchema,
|
|
12895
|
+
guest: external_exports.boolean().default(false),
|
|
12896
|
+
registry: external_exports.boolean().default(false),
|
|
12897
|
+
existing: external_exports.boolean().optional()
|
|
12898
|
+
}).strict().refine((body) => !(body.guest && body.registry), { message: "A guest cannot hold the Registry flag", path: ["registry"] });
|
|
12899
|
+
caseTeamScopeSchema = external_exports.discriminatedUnion("kind", [
|
|
12900
|
+
external_exports.object({ kind: external_exports.literal("space"), target_id: external_exports.null() }).strict(),
|
|
12901
|
+
external_exports.object({ kind: external_exports.enum(CASE_TEAM_TARGET_KINDS), target_id: uuidSchema }).strict()
|
|
12902
|
+
]);
|
|
12903
|
+
caseTeamMemberInput = external_exports.object({
|
|
12904
|
+
person_id: uuidSchema,
|
|
12905
|
+
level: external_exports.enum(CASE_LEVELS),
|
|
12906
|
+
approve: external_exports.boolean(),
|
|
12907
|
+
confidential: external_exports.boolean()
|
|
12908
|
+
}).strict();
|
|
12909
|
+
caseTeamFields = {
|
|
12910
|
+
name: external_exports.string().trim().min(1).max(CASE_TEAM_NAME_MAX_LENGTH),
|
|
12911
|
+
active: external_exports.boolean(),
|
|
12912
|
+
scopes: external_exports.array(caseTeamScopeSchema).max(CASE_TEAM_SCOPES_MAX),
|
|
12913
|
+
members: external_exports.array(caseTeamMemberInput).max(CASE_TEAM_MEMBERS_MAX)
|
|
12914
|
+
};
|
|
12915
|
+
createCaseTeamBody = external_exports.object(caseTeamFields).strict();
|
|
12916
|
+
updateCaseTeamBody = external_exports.object({ ...caseTeamFields, expected_updated_at: timestampSchema.optional() }).strict();
|
|
12917
|
+
}
|
|
12918
|
+
});
|
|
12919
|
+
|
|
12920
|
+
// ../../packages/core/dist/chunk-5SLZ72VE.js
|
|
12921
|
+
function withProblem(shape, problemOf) {
|
|
12922
|
+
return shape.superRefine((value, ctx) => {
|
|
12923
|
+
const found = problemOf(value);
|
|
12924
|
+
if (found) {
|
|
12925
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: found.reason, path: found.at.split("."), params: { case_registry_reason: found.reason } });
|
|
12926
|
+
}
|
|
12927
|
+
});
|
|
12928
|
+
}
|
|
12929
|
+
function caseRegistryTypeProblem(type) {
|
|
12930
|
+
const found = caseAttributesSchemaProblem(type.attributes);
|
|
12931
|
+
if (found) return { reason: found.reason, at: `attributes.${found.at}` };
|
|
12932
|
+
if (JSON.stringify(type.attributes).length > CASE_REGISTRY_TYPE_SCHEMA_MAX_CHARS) return { reason: "attributes_schema_too_large", at: "attributes" };
|
|
12933
|
+
return null;
|
|
12934
|
+
}
|
|
12935
|
+
function casePartyProblem(party) {
|
|
12936
|
+
if (party.document_kind === null !== (party.document_number === null)) return { reason: "document_incomplete", at: "document_number" };
|
|
12937
|
+
if (party.document_kind === "cpf" || party.document_kind === "cnpj") {
|
|
12938
|
+
if (party.person_kind !== (party.document_kind === "cpf" ? "natural" : "legal")) return { reason: "document_person_mismatch", at: "document_kind" };
|
|
12939
|
+
if (!(party.document_kind === "cpf" ? /^[0-9]{11}$/ : /^[0-9]{14}$/).test(party.document_number ?? "")) {
|
|
12940
|
+
return { reason: "document_digits", at: "document_number" };
|
|
12941
|
+
}
|
|
12942
|
+
}
|
|
12943
|
+
return null;
|
|
12944
|
+
}
|
|
12945
|
+
function casePartyGroupProblem(group) {
|
|
12946
|
+
return new Set(group.party_ids).size === group.party_ids.length ? null : { reason: "party_repeated", at: "party_ids" };
|
|
12947
|
+
}
|
|
12948
|
+
function caseInstrumentProblem(instrument) {
|
|
12949
|
+
if (instrument.effective_from !== null && instrument.effective_until !== null && instrument.effective_until < instrument.effective_from) {
|
|
12950
|
+
return { reason: "effective_dates_reversed", at: "effective_until" };
|
|
12951
|
+
}
|
|
12952
|
+
const keys = instrument.parties.map((party) => `${party.party_id}
|
|
12953
|
+
${party.role}`);
|
|
12954
|
+
return new Set(keys).size === keys.length ? null : { reason: "instrument_party_repeated", at: "parties" };
|
|
12955
|
+
}
|
|
12956
|
+
var CASE_REGISTRY_TYPE_CODE_PATTERN, CASE_REGISTRY_TYPE_CODE_MAX_LENGTH, CASE_REGISTRY_NAME_MAX_LENGTH, CASE_REGISTRY_TYPE_SCHEMA_MAX_CHARS, CASE_PARTY_ABBREVIATION_PATTERN, CASE_PARTY_PERSON_KINDS, CASE_PARTY_DOCUMENT_KINDS, CASE_PARTY_DOCUMENT_MAX_LENGTH, CASE_PARTY_GROUP_MEMBERS_MAX, CASE_INSTRUMENT_NUMBER_MAX_LENGTH, CASE_INSTRUMENT_ROLE_MAX_LENGTH, CASE_INSTRUMENT_PARTIES_MAX, CASE_REGISTRY_PAGE_MAX, CASE_REGISTRY_QUERY_MAX_LENGTH, trimmedName, dateSchema, attributesValues, registryTypeFields, createCaseRegistryTypeShape, updateCaseRegistryTypeShape, createCaseRegistryTypeBody, updateCaseRegistryTypeBody, saveCasePartyShape, saveCasePartyBody, saveCasePartyGroupShape, saveCasePartyGroupBody, caseInstrumentPartyInput, saveCaseInstrumentShape, saveCaseInstrumentBody, registryPage, searchText, casePartiesQuery, casePartyGroupsQuery, caseInstrumentsQuery, caseRegistryTypeParam, casePartyParam, casePartyGroupParam, caseInstrumentParam;
|
|
12957
|
+
var init_chunk_5SLZ72VE = __esm({
|
|
12958
|
+
"../../packages/core/dist/chunk-5SLZ72VE.js"() {
|
|
12959
|
+
"use strict";
|
|
12960
|
+
init_chunk_FOFCV4SW();
|
|
12961
|
+
init_chunk_HSHKT7I6();
|
|
12962
|
+
init_chunk_HZ6CADSY();
|
|
12963
|
+
init_zod();
|
|
12964
|
+
CASE_REGISTRY_TYPE_CODE_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/;
|
|
12965
|
+
CASE_REGISTRY_TYPE_CODE_MAX_LENGTH = 64;
|
|
12966
|
+
CASE_REGISTRY_NAME_MAX_LENGTH = 200;
|
|
12967
|
+
CASE_REGISTRY_TYPE_SCHEMA_MAX_CHARS = 64 * 1024;
|
|
12968
|
+
CASE_PARTY_ABBREVIATION_PATTERN = /^[A-Z0-9]{2,12}$/;
|
|
12969
|
+
CASE_PARTY_PERSON_KINDS = ["natural", "legal"];
|
|
12970
|
+
CASE_PARTY_DOCUMENT_KINDS = ["cpf", "cnpj", "other"];
|
|
12971
|
+
CASE_PARTY_DOCUMENT_MAX_LENGTH = 64;
|
|
12972
|
+
CASE_PARTY_GROUP_MEMBERS_MAX = 2e3;
|
|
12973
|
+
CASE_INSTRUMENT_NUMBER_MAX_LENGTH = 200;
|
|
12974
|
+
CASE_INSTRUMENT_ROLE_MAX_LENGTH = 200;
|
|
12975
|
+
CASE_INSTRUMENT_PARTIES_MAX = 50;
|
|
12976
|
+
CASE_REGISTRY_PAGE_MAX = 100;
|
|
12977
|
+
CASE_REGISTRY_QUERY_MAX_LENGTH = 200;
|
|
12978
|
+
trimmedName = external_exports.string().trim().min(1).max(CASE_REGISTRY_NAME_MAX_LENGTH);
|
|
12979
|
+
dateSchema = external_exports.string().refine(isCaseAttributeDate, "Not a date (YYYY-MM-DD)");
|
|
12980
|
+
attributesValues = external_exports.record(external_exports.string(), external_exports.unknown()).default({});
|
|
12981
|
+
registryTypeFields = {
|
|
12982
|
+
name: trimmedName,
|
|
12983
|
+
attributes: caseAttributesSchemaSchema.default(EMPTY_CASE_ATTRIBUTES_SCHEMA),
|
|
12984
|
+
active: external_exports.boolean().default(true)
|
|
12985
|
+
};
|
|
12986
|
+
createCaseRegistryTypeShape = external_exports.object({
|
|
12987
|
+
code: external_exports.string().trim().max(CASE_REGISTRY_TYPE_CODE_MAX_LENGTH).regex(CASE_REGISTRY_TYPE_CODE_PATTERN),
|
|
12988
|
+
...registryTypeFields
|
|
12989
|
+
}).strict();
|
|
12990
|
+
updateCaseRegistryTypeShape = external_exports.object({
|
|
12991
|
+
...registryTypeFields,
|
|
12992
|
+
expected_updated_at: timestampSchema.optional()
|
|
12993
|
+
}).strict();
|
|
12994
|
+
createCaseRegistryTypeBody = withProblem(createCaseRegistryTypeShape, caseRegistryTypeProblem);
|
|
12995
|
+
updateCaseRegistryTypeBody = withProblem(updateCaseRegistryTypeShape, caseRegistryTypeProblem);
|
|
12996
|
+
saveCasePartyShape = external_exports.object({
|
|
12997
|
+
type_id: uuidSchema,
|
|
12998
|
+
name: trimmedName,
|
|
12999
|
+
abbreviation: external_exports.string().trim().transform((value) => value.toUpperCase()).pipe(external_exports.string().regex(CASE_PARTY_ABBREVIATION_PATTERN)).nullable().default(null),
|
|
13000
|
+
person_kind: external_exports.enum(CASE_PARTY_PERSON_KINDS),
|
|
13001
|
+
document_kind: external_exports.enum(CASE_PARTY_DOCUMENT_KINDS).nullable().default(null),
|
|
13002
|
+
document_number: external_exports.string().trim().min(1).max(CASE_PARTY_DOCUMENT_MAX_LENGTH).nullable().default(null),
|
|
13003
|
+
attributes: attributesValues,
|
|
13004
|
+
active: external_exports.boolean().default(true),
|
|
13005
|
+
expected_updated_at: timestampSchema.optional()
|
|
13006
|
+
}).strict();
|
|
13007
|
+
saveCasePartyBody = withProblem(saveCasePartyShape, casePartyProblem);
|
|
13008
|
+
saveCasePartyGroupShape = external_exports.object({
|
|
13009
|
+
name: trimmedName,
|
|
13010
|
+
party_ids: external_exports.array(uuidSchema).max(CASE_PARTY_GROUP_MEMBERS_MAX).default([]),
|
|
13011
|
+
expected_updated_at: timestampSchema.optional()
|
|
13012
|
+
}).strict();
|
|
13013
|
+
saveCasePartyGroupBody = withProblem(saveCasePartyGroupShape, casePartyGroupProblem);
|
|
13014
|
+
caseInstrumentPartyInput = external_exports.object({
|
|
13015
|
+
party_id: uuidSchema,
|
|
13016
|
+
role: external_exports.string().trim().min(1).max(CASE_INSTRUMENT_ROLE_MAX_LENGTH)
|
|
13017
|
+
}).strict();
|
|
13018
|
+
saveCaseInstrumentShape = external_exports.object({
|
|
13019
|
+
type_id: uuidSchema,
|
|
13020
|
+
number: external_exports.string().trim().min(1).max(CASE_INSTRUMENT_NUMBER_MAX_LENGTH),
|
|
13021
|
+
signed_on: dateSchema.nullable().default(null),
|
|
13022
|
+
effective_from: dateSchema.nullable().default(null),
|
|
13023
|
+
effective_until: dateSchema.nullable().default(null),
|
|
13024
|
+
attributes: attributesValues,
|
|
13025
|
+
/** Each party in a role; one party may hold several roles. */
|
|
13026
|
+
parties: external_exports.array(caseInstrumentPartyInput).max(CASE_INSTRUMENT_PARTIES_MAX).default([]),
|
|
13027
|
+
expected_updated_at: timestampSchema.optional()
|
|
13028
|
+
}).strict();
|
|
13029
|
+
saveCaseInstrumentBody = withProblem(saveCaseInstrumentShape, caseInstrumentProblem);
|
|
13030
|
+
registryPage = casePageQuery.extend({
|
|
13031
|
+
limit: external_exports.coerce.number().int().min(1).max(CASE_REGISTRY_PAGE_MAX).optional()
|
|
13032
|
+
});
|
|
13033
|
+
searchText = external_exports.string().trim().min(1).max(CASE_REGISTRY_QUERY_MAX_LENGTH).optional();
|
|
13034
|
+
casePartiesQuery = registryPage.extend({
|
|
13035
|
+
q: searchText,
|
|
13036
|
+
type_id: uuidSchema.optional(),
|
|
13037
|
+
active: external_exports.enum(["true", "false"]).transform((value) => value === "true").optional()
|
|
13038
|
+
});
|
|
13039
|
+
casePartyGroupsQuery = registryPage.extend({ q: searchText });
|
|
13040
|
+
caseInstrumentsQuery = registryPage.extend({
|
|
13041
|
+
q: searchText,
|
|
13042
|
+
type_id: uuidSchema.optional(),
|
|
13043
|
+
party_id: uuidSchema.optional()
|
|
13044
|
+
});
|
|
13045
|
+
caseRegistryTypeParam = caseSpaceParam.extend({ type_id: uuidSchema });
|
|
13046
|
+
casePartyParam = caseSpaceParam.extend({ party_id: uuidSchema });
|
|
13047
|
+
casePartyGroupParam = caseSpaceParam.extend({ group_id: uuidSchema });
|
|
13048
|
+
caseInstrumentParam = caseSpaceParam.extend({ instrument_id: uuidSchema });
|
|
13049
|
+
}
|
|
13050
|
+
});
|
|
13051
|
+
|
|
13052
|
+
// ../../packages/core/dist/chunk-CXKQ2DHH.js
|
|
13053
|
+
var NEVER2;
|
|
13054
|
+
var init_chunk_CXKQ2DHH = __esm({
|
|
13055
|
+
"../../packages/core/dist/chunk-CXKQ2DHH.js"() {
|
|
13056
|
+
"use strict";
|
|
13057
|
+
init_chunk_MIWZOSPI();
|
|
13058
|
+
NEVER2 = Number.POSITIVE_INFINITY;
|
|
13059
|
+
}
|
|
13060
|
+
});
|
|
13061
|
+
|
|
13062
|
+
// ../../packages/core/dist/chunk-W2WIKWPX.js
|
|
13063
|
+
function resolveItemLink(phaseFolder, target) {
|
|
13064
|
+
const slash = target.lastIndexOf("/");
|
|
13065
|
+
const folder = slash < 0 ? phaseFolder : target.slice(0, slash);
|
|
13066
|
+
const code2 = target.slice(slash + 1);
|
|
13067
|
+
return { folder, code: code2, key: `${folder}/${code2}` };
|
|
13068
|
+
}
|
|
13069
|
+
function caseTypeDefinitionRows(definition) {
|
|
13070
|
+
let rows = 1 + definition.type_party_roles.length + definition.type_outcomes.length;
|
|
13071
|
+
for (const phase of definition.type_phases) {
|
|
13072
|
+
rows += 1 + phase.depends_on.length + phase.phase_inputs.length;
|
|
13073
|
+
for (const task of phase.type_tasks) rows += 1 + task.depends_on.length;
|
|
13074
|
+
for (const group of phase.agenda_groups) rows += 1 + group.approving_team_ids.length + group.agenda_decisions.length;
|
|
13075
|
+
for (const output of phase.phase_outputs) {
|
|
13076
|
+
rows += 1;
|
|
13077
|
+
for (const item of output.output_items) {
|
|
13078
|
+
const { inputs, calculations, decisions } = item.item_requirements;
|
|
13079
|
+
rows += 1 + inputs.length + calculations.length + decisions.length + item.item_links.depends_on.length + (item.item_links.reflects ? 1 : 0);
|
|
13080
|
+
}
|
|
13081
|
+
}
|
|
13082
|
+
}
|
|
13083
|
+
return rows;
|
|
13084
|
+
}
|
|
13085
|
+
function caseTaskRequired(phase, task) {
|
|
13086
|
+
if (task.output !== null) return phase.phase_outputs.find((output) => output.code === task.output)?.required ?? false;
|
|
13087
|
+
if (task.input !== null) return phase.phase_inputs.find((input) => input.key === task.input)?.required ?? false;
|
|
13088
|
+
if (task.agenda_group !== null) return phase.agenda_groups.find((group) => group.code === task.agenda_group)?.required ?? false;
|
|
13089
|
+
return task.required;
|
|
13090
|
+
}
|
|
13091
|
+
function decisionProblem(decision) {
|
|
13092
|
+
if (decision.type === "choice") {
|
|
13093
|
+
if (decision.options.length < 2) return "decision_options_missing";
|
|
13094
|
+
if (repeated(decision.options.map((option) => option.code))) return "decision_option_code_repeated";
|
|
13095
|
+
} else if (decision.options.length > 0) {
|
|
13096
|
+
return "decision_options_unexpected";
|
|
13097
|
+
}
|
|
13098
|
+
const numeric = CASE_NUMERIC_DECISION_TYPES.includes(decision.type);
|
|
13099
|
+
if (!numeric && (decision.min !== null || decision.max !== null)) return "decision_bounds_unexpected";
|
|
13100
|
+
if (!numeric && decision.decimals !== null) return "decision_decimals_unexpected";
|
|
13101
|
+
if (decision.min !== null && decision.max !== null && decision.min > decision.max) return "decision_bounds_inverted";
|
|
13102
|
+
return null;
|
|
13103
|
+
}
|
|
13104
|
+
function cycleIn(nodes, edges) {
|
|
13105
|
+
const state = /* @__PURE__ */ new Map();
|
|
13106
|
+
const visit = (node) => {
|
|
13107
|
+
if (state.get(node) === "done") return false;
|
|
13108
|
+
if (state.get(node) === "open") return true;
|
|
13109
|
+
state.set(node, "open");
|
|
13110
|
+
for (const next of edges.get(node) ?? []) if (visit(next)) return true;
|
|
13111
|
+
state.set(node, "done");
|
|
13112
|
+
return false;
|
|
13113
|
+
};
|
|
13114
|
+
return nodes.find((node) => visit(node)) ?? null;
|
|
13115
|
+
}
|
|
13116
|
+
function fixedTextProblem(text4) {
|
|
13117
|
+
if (text4.includes("<!--")) return "item_fixed_text_comment";
|
|
13118
|
+
const lines = text4.replace(/\r\n?/g, "\n").split("\n");
|
|
13119
|
+
let fence = null;
|
|
13120
|
+
let closedAt = -1;
|
|
13121
|
+
for (let i = 0; i < lines.length; i++) {
|
|
13122
|
+
const line = lines[i];
|
|
13123
|
+
const mark = /^ {0,3}(`{3,}|~{3,})/.exec(line)?.[1];
|
|
13124
|
+
if (fence !== null) {
|
|
13125
|
+
if (mark && mark[0] === fence[0] && mark.length >= fence.length && line.trim() === mark) {
|
|
13126
|
+
fence = null;
|
|
13127
|
+
closedAt = i;
|
|
13128
|
+
}
|
|
13129
|
+
continue;
|
|
13130
|
+
}
|
|
13131
|
+
if (mark) {
|
|
13132
|
+
fence = mark;
|
|
13133
|
+
continue;
|
|
13134
|
+
}
|
|
13135
|
+
const setext = i > 0 && /^ {0,3}(=+|-+)[ \t]*$/.test(line) && lines[i - 1].trim() !== "" && closedAt !== i - 1 && (i === 1 || lines[i - 2].trim() === "");
|
|
13136
|
+
if (/^ {0,3}#{1,6}([ \t]|$)/.test(line) || setext) return "item_fixed_text_heading";
|
|
13137
|
+
}
|
|
13138
|
+
return null;
|
|
13139
|
+
}
|
|
13140
|
+
function pathsOverlap(a, b) {
|
|
13141
|
+
return a === b || a.endsWith("/") && b.startsWith(a) || b.endsWith("/") && a.startsWith(b);
|
|
13142
|
+
}
|
|
13143
|
+
function caseTypeDefinitionProblem(definition) {
|
|
13144
|
+
const problem = (reason, at) => ({ reason, at });
|
|
13145
|
+
if (JSON.stringify(definition).length > CASE_TYPE_DEFINITION_MAX_CHARS || caseTypeDefinitionRows(definition) > CASE_TYPE_DEFINITION_ROWS_MAX) {
|
|
13146
|
+
return problem("definition_too_large", "definition");
|
|
13147
|
+
}
|
|
13148
|
+
const attributes = caseAttributesSchemaProblem(definition.attributes);
|
|
13149
|
+
if (attributes) return problem(attributes.reason, `attributes.${attributes.at}`);
|
|
13150
|
+
if (repeated(definition.type_party_roles.map((role) => role.code))) return problem("party_role_code_repeated", "type_party_roles");
|
|
13151
|
+
if (repeated(definition.type_outcomes.map((outcome) => outcome.code))) return problem("outcome_code_repeated", "type_outcomes");
|
|
13152
|
+
const phases = definition.type_phases;
|
|
13153
|
+
if (repeated(phases.map((phase) => phase.code))) return problem("phase_code_repeated", "type_phases");
|
|
13154
|
+
if (repeated(phases.map((phase) => phase.folder))) return problem("phase_folder_repeated", "type_phases");
|
|
13155
|
+
if (repeated(phases.map((phase) => phase.folder.slice(0, 2)))) return problem("phase_position_repeated", "type_phases");
|
|
13156
|
+
const phaseCodes = new Set(phases.map((phase) => phase.code));
|
|
13157
|
+
const itemsByFolder = new Map(phases.map((phase) => [
|
|
13158
|
+
phase.folder,
|
|
13159
|
+
new Set(phase.phase_outputs.flatMap((output) => output.output_items.map((item) => item.code)))
|
|
13160
|
+
]));
|
|
13161
|
+
const paths = [];
|
|
13162
|
+
const decisionCodes = phases.flatMap((phase) => phase.agenda_groups.flatMap((group) => group.agenda_decisions.map((decision) => decision.code)));
|
|
13163
|
+
if (repeated(decisionCodes)) return problem("decision_code_repeated", "type_phases");
|
|
13164
|
+
const versionDecisions = new Set(decisionCodes);
|
|
13165
|
+
const caseDecisionsAllowed = phases.some((phase) => phase.agenda_groups.some((group) => group.case_decisions_allowed));
|
|
13166
|
+
for (const phase of phases) {
|
|
13167
|
+
const at = `type_phases.${phase.folder}`;
|
|
13168
|
+
for (const dependency of phase.depends_on) {
|
|
13169
|
+
if (dependency === phase.code) return problem("phase_dependency_self", at);
|
|
13170
|
+
if (!phaseCodes.has(dependency)) return problem("phase_dependency_unknown", at);
|
|
13171
|
+
}
|
|
13172
|
+
if (phase.review_mode === "team" !== (phase.review_team_id !== null)) {
|
|
13173
|
+
return problem(phase.review_mode === "team" ? "review_team_missing" : "review_team_unexpected", at);
|
|
13174
|
+
}
|
|
13175
|
+
const outputs = phase.phase_outputs;
|
|
13176
|
+
if (repeated(outputs.map((output) => output.code))) return problem("output_code_repeated", at);
|
|
13177
|
+
if (repeated(outputs.map((output) => output.document_type.toLowerCase()))) return problem("output_document_type_repeated", at);
|
|
13178
|
+
const inputKeys = new Set(phase.phase_inputs.map((input) => input.key));
|
|
13179
|
+
if (inputKeys.size !== phase.phase_inputs.length) return problem("input_key_repeated", at);
|
|
13180
|
+
const tasks = phase.type_tasks;
|
|
13181
|
+
const taskCodes = new Set(tasks.map((task) => task.code));
|
|
13182
|
+
if (taskCodes.size !== tasks.length) return problem("task_code_repeated", at);
|
|
13183
|
+
const groups = phase.agenda_groups;
|
|
13184
|
+
const groupCodes = new Set(groups.map((group) => group.code));
|
|
13185
|
+
if (groupCodes.size !== groups.length) return problem("agenda_group_code_repeated", at);
|
|
13186
|
+
for (const output of outputs) {
|
|
13187
|
+
const outputAt = `${at}.phase_outputs.${output.code}`;
|
|
13188
|
+
if (output.format === "file" && output.output_items.length > 0) return problem("file_output_with_items", outputAt);
|
|
13189
|
+
if (output.format === "file" && output.case_items_allowed) return problem("file_output_with_case_items", outputAt);
|
|
13190
|
+
if (repeated(output.approving_team_ids)) return problem("approving_team_repeated", outputAt);
|
|
13191
|
+
for (const path45 of output.file_paths) {
|
|
13192
|
+
if (!path45.startsWith(`${phase.folder}/`)) return problem("file_path_outside_phase", outputAt);
|
|
13193
|
+
if (output.format === "file" && path45.endsWith("/")) return problem("file_path_folder_for_file", outputAt);
|
|
13194
|
+
if (paths.some((held) => pathsOverlap(held, path45))) return problem("file_path_overlaps", outputAt);
|
|
13195
|
+
paths.push(path45);
|
|
13196
|
+
}
|
|
13197
|
+
}
|
|
13198
|
+
if (phase.joint_delivery) {
|
|
13199
|
+
const teamsOf = (output) => [...output.approving_team_ids].sort().join(",");
|
|
13200
|
+
if (new Set(outputs.map(teamsOf)).size > 1) return problem("joint_approving_teams_differ", at);
|
|
13201
|
+
}
|
|
13202
|
+
for (const group of groups) {
|
|
13203
|
+
const groupAt = `${at}.agenda_groups.${group.code}`;
|
|
13204
|
+
if (group.approving_team_ids.length === 0) return problem("approving_teams_missing", groupAt);
|
|
13205
|
+
if (repeated(group.approving_team_ids)) return problem("approving_team_repeated", groupAt);
|
|
13206
|
+
if (group.agenda_decisions.length === 0 && !group.case_decisions_allowed) return problem("agenda_group_without_decisions", groupAt);
|
|
13207
|
+
for (const decision of group.agenda_decisions) {
|
|
13208
|
+
const reason = decisionProblem(decision);
|
|
13209
|
+
if (reason) return problem(reason, `${groupAt}.agenda_decisions.${decision.code}`);
|
|
13210
|
+
}
|
|
13211
|
+
if (group.required && !outputs.some((output) => output.required) && !tasks.some((task) => task.agenda_group === group.code)) {
|
|
13212
|
+
return problem("agenda_group_unbound", groupAt);
|
|
13213
|
+
}
|
|
13214
|
+
}
|
|
13215
|
+
const outputCodes = new Set(outputs.map((output) => output.code));
|
|
13216
|
+
for (const task of tasks) {
|
|
13217
|
+
const taskAt = `${at}.type_tasks.${task.code}`;
|
|
13218
|
+
if ([task.output, task.input, task.agenda_group].filter((link) => link !== null).length > 1) return problem("task_link_ambiguous", taskAt);
|
|
13219
|
+
if (task.output !== null && !outputCodes.has(task.output)) return problem("task_output_unknown", taskAt);
|
|
13220
|
+
if (task.input !== null && !inputKeys.has(task.input)) return problem("task_input_unknown", taskAt);
|
|
13221
|
+
if (task.agenda_group !== null && !groupCodes.has(task.agenda_group)) return problem("task_agenda_group_unknown", taskAt);
|
|
13222
|
+
for (const dependency of task.depends_on) {
|
|
13223
|
+
if (dependency === task.code) return problem("task_dependency_self", taskAt);
|
|
13224
|
+
if (!taskCodes.has(dependency)) return problem("task_dependency_unknown", taskAt);
|
|
13225
|
+
}
|
|
13226
|
+
}
|
|
13227
|
+
const taskCycle = cycleIn(tasks.map((task) => task.code), new Map(tasks.map((task) => [task.code, task.depends_on])));
|
|
13228
|
+
if (taskCycle) return problem("task_dependency_cycle", `${at}.type_tasks.${taskCycle}`);
|
|
13229
|
+
const items = outputs.flatMap((output) => output.output_items);
|
|
13230
|
+
if (repeated(items.map((item) => item.code))) return problem("item_code_repeated", at);
|
|
13231
|
+
for (const item of items) {
|
|
13232
|
+
const itemAt = `${at}.output_items.${item.code}`;
|
|
13233
|
+
if (item.task !== null && !taskCodes.has(item.task)) return problem("item_task_unknown", itemAt);
|
|
13234
|
+
if (item.template_mode === "fixed") {
|
|
13235
|
+
if (!item.fixed_text?.trim()) return problem("item_fixed_text_missing", itemAt);
|
|
13236
|
+
if (item.grouping) return problem("item_grouping_fixed", itemAt);
|
|
13237
|
+
const textProblem = fixedTextProblem(item.fixed_text);
|
|
13238
|
+
if (textProblem) return problem(textProblem, itemAt);
|
|
13239
|
+
} else if (item.fixed_text !== null) {
|
|
13240
|
+
return problem("item_fixed_text_unexpected", itemAt);
|
|
13241
|
+
}
|
|
13242
|
+
const { inputs, calculations, decisions } = item.item_requirements;
|
|
13243
|
+
if (repeated(inputs) || repeated(calculations) || repeated(decisions)) return problem("item_requirement_repeated", itemAt);
|
|
13244
|
+
if (inputs.some((key) => !inputKeys.has(key))) return problem("item_input_unknown", itemAt);
|
|
13245
|
+
if (!caseDecisionsAllowed && decisions.some((decision) => !versionDecisions.has(decision))) return problem("item_decision_unknown", itemAt);
|
|
13246
|
+
const targets = item.item_links.depends_on;
|
|
13247
|
+
if (repeated(targets.map((target) => resolveItemLink(phase.folder, target).key))) return problem("item_link_repeated", itemAt);
|
|
13248
|
+
for (const target of targets) {
|
|
13249
|
+
const { folder, code: targetCode } = resolveItemLink(phase.folder, target);
|
|
13250
|
+
if (!itemsByFolder.get(folder)?.has(targetCode)) return problem("item_link_unknown", itemAt);
|
|
13251
|
+
if (folder === phase.folder && targetCode === item.code) return problem("item_link_self", itemAt);
|
|
13252
|
+
}
|
|
13253
|
+
}
|
|
13254
|
+
if (outputs.length === 0 && !tasks.some((task) => caseTaskRequired(phase, task))) return problem("phase_without_work", at);
|
|
13255
|
+
}
|
|
13256
|
+
const phaseCycle = cycleIn(phases.map((phase) => phase.code), new Map(phases.map((phase) => [phase.code, phase.depends_on])));
|
|
13257
|
+
if (phaseCycle) return problem("phase_dependency_cycle", `type_phases.${phaseCycle}`);
|
|
13258
|
+
return null;
|
|
13259
|
+
}
|
|
13260
|
+
var CASE_CODE_PATTERN, CASE_PHASE_CODE_PATTERN, CASE_PHASE_FOLDER_PATTERN, CASE_INPUT_KEY_PATTERN, CASE_CALCULATION_CODE_PATTERN, CASE_AGENDA_GROUP_CODE_PATTERN, CASE_DECISION_CODE_PATTERN, CASE_DECISION_OPTION_CODE_PATTERN, CASE_DECISION_EFFECT_PATTERN, FILE_PATH_SEGMENT_PATTERN, CASE_REVIEW_MODES, CASE_OUTPUT_FORMATS, CASE_INPUT_ORIGINS, CASE_TEMPLATE_MODES, CASE_AGENDA_QUORUMS, CASE_DECISION_TYPES, CASE_NUMERIC_DECISION_TYPES, CASE_TYPE_NAME_MAX_LENGTH, CASE_CODE_MAX_LENGTH, CASE_FILE_PATH_MAX_LENGTH, CASE_FIXED_TEXT_MAX_LENGTH, CASE_TYPE_DEFINITION_MAX_CHARS, CASE_TYPE_DEFINITION_ROWS_MAX, CASE_TYPE_VERSIONS_MAX, CASE_TYPES_PAGE_MAX, code, phaseCode, inputKey, agendaGroupCode, decisionCode, label2, optionalText, itemLinkTarget, filePath, caseTypePartyRoleSchema, caseTypeOutcomeSchema, caseItemRequirementsSchema, caseItemLinksSchema, caseOutputItemSchema, casePhaseOutputSchema, casePhaseInputSchema, caseDecisionOptionSchema, decisionBound, caseAgendaDecisionSchema, caseAgendaGroupSchema, caseTypeTaskSchema, caseTypePhaseSchema, caseTypeDefinitionShape, repeated, caseTypeDefinitionSchema, caseTypeAbbreviationSchema, caseTypeNameSchema, createCaseTypeBody, publishCaseTypeVersionBody, setCaseTypeActiveBody, caseTypeParam, caseTypesPageQuery, caseTypeVersionQuery;
|
|
13261
|
+
var init_chunk_W2WIKWPX = __esm({
|
|
13262
|
+
"../../packages/core/dist/chunk-W2WIKWPX.js"() {
|
|
13263
|
+
"use strict";
|
|
13264
|
+
init_chunk_FOFCV4SW();
|
|
13265
|
+
init_chunk_HSHKT7I6();
|
|
13266
|
+
init_chunk_HZ6CADSY();
|
|
13267
|
+
init_chunk_NYNOISIG();
|
|
13268
|
+
init_zod();
|
|
13269
|
+
CASE_CODE_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/;
|
|
13270
|
+
CASE_PHASE_CODE_PATTERN = /^[a-z0-9_]+$/;
|
|
13271
|
+
CASE_PHASE_FOLDER_PATTERN = /^[0-9]{2}-[a-z0-9-]+$/;
|
|
13272
|
+
CASE_INPUT_KEY_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
13273
|
+
CASE_CALCULATION_CODE_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
13274
|
+
CASE_AGENDA_GROUP_CODE_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
13275
|
+
CASE_DECISION_CODE_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
13276
|
+
CASE_DECISION_OPTION_CODE_PATTERN = /^[a-z0-9]+([_-][a-z0-9]+)*$/;
|
|
13277
|
+
CASE_DECISION_EFFECT_PATTERN = new RegExp(`^calc:${CASE_CALCULATION_CODE_PATTERN.source.slice(1)}`);
|
|
13278
|
+
FILE_PATH_SEGMENT_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;
|
|
13279
|
+
CASE_REVIEW_MODES = ["none", "edit", "conduct", "team"];
|
|
13280
|
+
CASE_OUTPUT_FORMATS = ["document", "file"];
|
|
13281
|
+
CASE_INPUT_ORIGINS = ["collection", "previous_output", "received"];
|
|
13282
|
+
CASE_TEMPLATE_MODES = ["guide", "fixed"];
|
|
13283
|
+
CASE_AGENDA_QUORUMS = ["one", "all"];
|
|
13284
|
+
CASE_DECISION_TYPES = ["percent", "currency", "number", "date", "choice", "yes_no", "text"];
|
|
13285
|
+
CASE_NUMERIC_DECISION_TYPES = ["percent", "currency", "number"];
|
|
13286
|
+
CASE_TYPE_NAME_MAX_LENGTH = 200;
|
|
13287
|
+
CASE_CODE_MAX_LENGTH = 64;
|
|
13288
|
+
CASE_FILE_PATH_MAX_LENGTH = 256;
|
|
13289
|
+
CASE_FIXED_TEXT_MAX_LENGTH = 16 * 1024;
|
|
13290
|
+
CASE_TYPE_DEFINITION_MAX_CHARS = 256 * 1024;
|
|
13291
|
+
CASE_TYPE_DEFINITION_ROWS_MAX = 2e3;
|
|
13292
|
+
CASE_TYPE_VERSIONS_MAX = 200;
|
|
13293
|
+
CASE_TYPES_PAGE_MAX = 100;
|
|
13294
|
+
code = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_CODE_PATTERN);
|
|
13295
|
+
phaseCode = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_PHASE_CODE_PATTERN);
|
|
13296
|
+
inputKey = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_INPUT_KEY_PATTERN);
|
|
13297
|
+
agendaGroupCode = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_AGENDA_GROUP_CODE_PATTERN);
|
|
13298
|
+
decisionCode = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_DECISION_CODE_PATTERN);
|
|
13299
|
+
label2 = (max) => external_exports.string().trim().min(1).max(max);
|
|
13300
|
+
optionalText = (max) => external_exports.string().trim().max(max).nullable().default(null).transform((text4) => text4 || null);
|
|
13301
|
+
itemLinkTarget = external_exports.string().max(CASE_CODE_MAX_LENGTH * 2 + 1).refine((target) => {
|
|
13302
|
+
const { folder, code: targetCode } = resolveItemLink("", target);
|
|
13303
|
+
return (!target.includes("/") || CASE_PHASE_FOLDER_PATTERN.test(folder)) && CASE_CODE_PATTERN.test(targetCode);
|
|
13304
|
+
}, "An item is named by its code, or by its phase folder and code");
|
|
13305
|
+
filePath = external_exports.string().min(1).max(CASE_FILE_PATH_MAX_LENGTH).refine((path45) => {
|
|
13306
|
+
const segments = (path45.endsWith("/") ? path45.slice(0, -1) : path45).split("/");
|
|
13307
|
+
return segments.length >= 2 && segments.length <= 8 && CASE_PHASE_FOLDER_PATTERN.test(segments[0]) && segments.slice(1).every((segment) => FILE_PATH_SEGMENT_PATTERN.test(segment));
|
|
13308
|
+
}, "A file path is the phase folder, then letters, digits, dots, dashes and underscores");
|
|
13309
|
+
caseTypePartyRoleSchema = external_exports.object({
|
|
13310
|
+
code,
|
|
13311
|
+
name: label2(200),
|
|
13312
|
+
required: external_exports.boolean().default(false),
|
|
13313
|
+
multiple: external_exports.boolean().default(false)
|
|
13314
|
+
}).strict();
|
|
13315
|
+
caseTypeOutcomeSchema = external_exports.object({ code, name: label2(200) }).strict();
|
|
13316
|
+
caseItemRequirementsSchema = external_exports.object({
|
|
13317
|
+
/** Keys of the phase's inputs the item must cite. */
|
|
13318
|
+
inputs: external_exports.array(inputKey).max(50).default([]),
|
|
13319
|
+
/** Names in `analysis/results.csv` the item must cite. */
|
|
13320
|
+
calculations: external_exports.array(external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_CALCULATION_CODE_PATTERN)).max(50).default([]),
|
|
13321
|
+
/** Codes of the version's agenda decisions the item must cite. */
|
|
13322
|
+
decisions: external_exports.array(decisionCode).max(50).default([])
|
|
13323
|
+
}).strict();
|
|
13324
|
+
caseItemLinksSchema = external_exports.object({
|
|
13325
|
+
/** Items of this version this one depends on, in any phase. Cycles are allowed: graph review's stop rule closes them. */
|
|
13326
|
+
depends_on: external_exports.array(itemLinkTarget).max(50).default([]),
|
|
13327
|
+
/** `all`: the item reflects every other item of its output (Rito's `reflete: todos`). */
|
|
13328
|
+
reflects: external_exports.literal("all").nullable().default(null)
|
|
13329
|
+
}).strict();
|
|
13330
|
+
caseOutputItemSchema = external_exports.object({
|
|
13331
|
+
code,
|
|
13332
|
+
title: label2(200),
|
|
13333
|
+
/** A heading that holds other items and has no text of its own. */
|
|
13334
|
+
grouping: external_exports.boolean().default(false),
|
|
13335
|
+
required: external_exports.boolean().default(true),
|
|
13336
|
+
waivable: external_exports.boolean().default(true),
|
|
13337
|
+
/** The code of the phase's task that writes it. */
|
|
13338
|
+
task: code.nullable().default(null),
|
|
13339
|
+
legal_basis: optionalText(2e3),
|
|
13340
|
+
template_mode: external_exports.enum(CASE_TEMPLATE_MODES).default("guide"),
|
|
13341
|
+
/** The item's text in `fixed` mode, and only there. */
|
|
13342
|
+
fixed_text: external_exports.string().max(CASE_FIXED_TEXT_MAX_LENGTH).nullable().default(null),
|
|
13343
|
+
item_requirements: caseItemRequirementsSchema.default({}),
|
|
13344
|
+
item_links: caseItemLinksSchema.default({})
|
|
13345
|
+
}).strict();
|
|
13346
|
+
casePhaseOutputSchema = external_exports.object({
|
|
13347
|
+
code,
|
|
13348
|
+
document_type: label2(200),
|
|
13349
|
+
required: external_exports.boolean().default(true),
|
|
13350
|
+
executive_approval: external_exports.boolean().default(false),
|
|
13351
|
+
/** `document` is written in Markdown and rendered; `file` (.xlsx, .pdf, .dwg, .dxf) is hashed as it came. */
|
|
13352
|
+
format: external_exports.enum(CASE_OUTPUT_FORMATS).default("document"),
|
|
13353
|
+
/** The piece's place in its phase's set. */
|
|
13354
|
+
position: external_exports.number().int().min(0).max(9999).default(0),
|
|
13355
|
+
/** How the piece is shown in its set, as `Annex I`. */
|
|
13356
|
+
label: optionalText(100),
|
|
13357
|
+
case_items_allowed: external_exports.boolean().default(false),
|
|
13358
|
+
/** The paths a file must have to be this output (or the same path under `conf/`: F5). */
|
|
13359
|
+
file_paths: external_exports.array(filePath).min(1).max(10),
|
|
13360
|
+
/** The teams whose Approve holders may approve it; none means any Approve holder reaching the case (F8). */
|
|
13361
|
+
approving_team_ids: external_exports.array(uuidSchema).max(20).default([]),
|
|
13362
|
+
output_items: external_exports.array(caseOutputItemSchema).max(200).default([])
|
|
13363
|
+
}).strict();
|
|
13364
|
+
casePhaseInputSchema = external_exports.object({
|
|
13365
|
+
key: inputKey,
|
|
13366
|
+
name: label2(200),
|
|
13367
|
+
origin: external_exports.enum(CASE_INPUT_ORIGINS),
|
|
13368
|
+
document_type: optionalText(200),
|
|
13369
|
+
required: external_exports.boolean().default(true)
|
|
13370
|
+
}).strict();
|
|
13371
|
+
caseDecisionOptionSchema = external_exports.object({
|
|
13372
|
+
code: external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_DECISION_OPTION_CODE_PATTERN),
|
|
13373
|
+
name: label2(200),
|
|
13374
|
+
/** `calc:{name}`: the result the option leads to, shown beside it. */
|
|
13375
|
+
effect: external_exports.string().max(CASE_CODE_MAX_LENGTH + 5).regex(CASE_DECISION_EFFECT_PATTERN).nullable().default(null)
|
|
13376
|
+
}).strict();
|
|
13377
|
+
decisionBound = external_exports.number().finite().min(-1e15).max(1e15).nullable().default(null);
|
|
13378
|
+
caseAgendaDecisionSchema = external_exports.object({
|
|
13379
|
+
code: decisionCode,
|
|
13380
|
+
question: label2(1e3),
|
|
13381
|
+
why: external_exports.string().trim().max(2e3).default(""),
|
|
13382
|
+
type: external_exports.enum(CASE_DECISION_TYPES),
|
|
13383
|
+
decimals: external_exports.number().int().min(0).max(6).nullable().default(null),
|
|
13384
|
+
unit: optionalText(50),
|
|
13385
|
+
min: decisionBound,
|
|
13386
|
+
max: decisionBound,
|
|
13387
|
+
options: external_exports.array(caseDecisionOptionSchema).max(50).default([]),
|
|
13388
|
+
required: external_exports.boolean().default(true)
|
|
13389
|
+
}).strict().transform((decision) => decision.decimals === null && (decision.type === "percent" || decision.type === "currency") ? { ...decision, decimals: 2 } : decision);
|
|
13390
|
+
caseAgendaGroupSchema = external_exports.object({
|
|
13391
|
+
code: agendaGroupCode,
|
|
13392
|
+
name: label2(200),
|
|
13393
|
+
/** The teams whose Approve holders approve the group, and dispense it (the plan keeps that with them). */
|
|
13394
|
+
approving_team_ids: external_exports.array(uuidSchema).max(20).default([]),
|
|
13395
|
+
quorum: external_exports.enum(CASE_AGENDA_QUORUMS).default("one"),
|
|
13396
|
+
required: external_exports.boolean().default(true),
|
|
13397
|
+
confidential: external_exports.boolean().default(false),
|
|
13398
|
+
case_decisions_allowed: external_exports.boolean().default(false),
|
|
13399
|
+
agenda_decisions: external_exports.array(caseAgendaDecisionSchema).max(100).default([])
|
|
13400
|
+
}).strict();
|
|
13401
|
+
caseTypeTaskSchema = external_exports.object({
|
|
13402
|
+
code,
|
|
13403
|
+
name: label2(200),
|
|
13404
|
+
/** A task linked to an output, an input or an agenda group takes that one's `required` instead (Rito). */
|
|
13405
|
+
required: external_exports.boolean().default(false),
|
|
13406
|
+
/** The phase's output it completes with, by code. */
|
|
13407
|
+
output: code.nullable().default(null),
|
|
13408
|
+
/** The phase's input it completes with, by key. */
|
|
13409
|
+
input: inputKey.nullable().default(null),
|
|
13410
|
+
/** The phase's agenda group it completes with, by code: approved or dispensed. */
|
|
13411
|
+
agenda_group: agendaGroupCode.nullable().default(null),
|
|
13412
|
+
/** Tasks of the same phase it waits for, by code. */
|
|
13413
|
+
depends_on: external_exports.array(code).max(50).default([])
|
|
13414
|
+
}).strict();
|
|
13415
|
+
caseTypePhaseSchema = external_exports.object({
|
|
13416
|
+
code: phaseCode,
|
|
13417
|
+
folder: external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_PHASE_FOLDER_PATTERN),
|
|
13418
|
+
name: label2(200),
|
|
13419
|
+
expected_documents: external_exports.string().trim().max(2e3).default(""),
|
|
13420
|
+
/** The phases it waits for, by code: delivered or dispensed. */
|
|
13421
|
+
depends_on: external_exports.array(phaseCode).max(50),
|
|
13422
|
+
optional: external_exports.boolean().default(false),
|
|
13423
|
+
on_demand: external_exports.boolean().default(false),
|
|
13424
|
+
joint_delivery: external_exports.boolean().default(false),
|
|
13425
|
+
review_mode: external_exports.enum(CASE_REVIEW_MODES).default("conduct"),
|
|
13426
|
+
/** The team that signs off, in `team` mode and only there. */
|
|
13427
|
+
review_team_id: uuidSchema.nullable().default(null),
|
|
13428
|
+
case_inputs_allowed: external_exports.boolean().default(false),
|
|
13429
|
+
phase_outputs: external_exports.array(casePhaseOutputSchema).max(30).default([]),
|
|
13430
|
+
phase_inputs: external_exports.array(casePhaseInputSchema).max(50).default([]),
|
|
13431
|
+
type_tasks: external_exports.array(caseTypeTaskSchema).max(100).default([]),
|
|
13432
|
+
agenda_groups: external_exports.array(caseAgendaGroupSchema).max(20).default([])
|
|
13433
|
+
}).strict();
|
|
13434
|
+
caseTypeDefinitionShape = external_exports.object({
|
|
13435
|
+
type_party_roles: external_exports.array(caseTypePartyRoleSchema).max(50).default([]),
|
|
13436
|
+
type_outcomes: external_exports.array(caseTypeOutcomeSchema).max(50).default([]),
|
|
13437
|
+
type_phases: external_exports.array(caseTypePhaseSchema).min(1).max(50),
|
|
13438
|
+
/** The JSON Schema of its cases' `attributes`: their custom fields. Absent, none. */
|
|
13439
|
+
attributes: caseAttributesSchemaSchema.default(() => ({ ...EMPTY_CASE_ATTRIBUTES_SCHEMA }))
|
|
13440
|
+
}).strict();
|
|
13441
|
+
repeated = (values) => new Set(values).size !== values.length;
|
|
13442
|
+
caseTypeDefinitionSchema = caseTypeDefinitionShape.superRefine((definition, ctx) => {
|
|
13443
|
+
const found = caseTypeDefinitionProblem(definition);
|
|
13444
|
+
if (found) {
|
|
13445
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: found.reason, path: found.at.split("."), params: { case_type_reason: found.reason } });
|
|
13446
|
+
}
|
|
13447
|
+
});
|
|
13448
|
+
caseTypeAbbreviationSchema = external_exports.string().trim().transform((value) => value.toUpperCase()).pipe(external_exports.string().regex(CASE_TYPE_ABBREVIATION_PATTERN));
|
|
13449
|
+
caseTypeNameSchema = external_exports.string().trim().min(1).max(CASE_TYPE_NAME_MAX_LENGTH);
|
|
13450
|
+
createCaseTypeBody = external_exports.object({
|
|
13451
|
+
abbreviation: caseTypeAbbreviationSchema,
|
|
13452
|
+
name: caseTypeNameSchema,
|
|
13453
|
+
definition: caseTypeDefinitionSchema
|
|
13454
|
+
}).strict();
|
|
13455
|
+
publishCaseTypeVersionBody = external_exports.object({
|
|
13456
|
+
expected_version: external_exports.number().int().min(1).max(CASE_TYPE_VERSIONS_MAX),
|
|
13457
|
+
name: caseTypeNameSchema,
|
|
13458
|
+
definition: caseTypeDefinitionSchema
|
|
13459
|
+
}).strict();
|
|
13460
|
+
setCaseTypeActiveBody = external_exports.object({ active: external_exports.boolean() }).strict();
|
|
13461
|
+
caseTypeParam = caseSpaceParam.extend({ type_id: uuidSchema });
|
|
13462
|
+
caseTypesPageQuery = casePageQuery.extend({
|
|
13463
|
+
limit: external_exports.coerce.number().int().min(1).max(CASE_TYPES_PAGE_MAX).optional()
|
|
13464
|
+
});
|
|
13465
|
+
caseTypeVersionQuery = external_exports.object({
|
|
13466
|
+
version: external_exports.coerce.number().int().min(1).max(CASE_TYPE_VERSIONS_MAX).optional()
|
|
13467
|
+
});
|
|
13468
|
+
}
|
|
13469
|
+
});
|
|
13470
|
+
|
|
13471
|
+
// ../../packages/core/dist/chunk-7CYHPF35.js
|
|
13472
|
+
var appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse;
|
|
13473
|
+
var init_chunk_7CYHPF35 = __esm({
|
|
13474
|
+
"../../packages/core/dist/chunk-7CYHPF35.js"() {
|
|
13475
|
+
"use strict";
|
|
13476
|
+
init_chunk_HZ6CADSY();
|
|
13477
|
+
init_zod();
|
|
13478
|
+
appMessageSenderType = external_exports.enum(["user", "team"]);
|
|
13479
|
+
appMessageReceiverType = external_exports.enum(["user", "team", "agent", "assistant"]).transform((v) => v === "assistant" ? "agent" : v);
|
|
13480
|
+
apiChannelMessage = external_exports.object({
|
|
13481
|
+
text: clientOptionalString,
|
|
13482
|
+
attachments: external_exports.array(messageAttachment).max(MAX_ATTACHMENTS_PER_MESSAGE).nullish().transform((v) => v ?? void 0)
|
|
13483
|
+
}).refine((m) => m.text && m.text.length > 0 || m.attachments && m.attachments.length > 0, {
|
|
13484
|
+
message: "message must have text or at least one attachment"
|
|
13485
|
+
});
|
|
13486
|
+
apiChannelMessageBody = external_exports.object({
|
|
13487
|
+
// Correlation id (task hubs): new → new conversation, repeat → continue. min 1 so an
|
|
13488
|
+
// empty string can't masquerade as a ref. Mutually exclusive with conversation_id.
|
|
13489
|
+
external_ref: external_exports.string().min(1).max(256).optional(),
|
|
13490
|
+
// Continue a specific WayAI conversation (authorized against the hub/channel + owner).
|
|
13491
|
+
// UUID-validated here (unlike the app channel, whose client we control): allocation
|
|
13492
|
+
// only treats a UUID-shaped id as a provided conversation, so a malformed id would
|
|
13493
|
+
// otherwise skip the owner guard and silently MINT a new conversation instead of
|
|
13494
|
+
// rejecting. A format 400 is shape-only — not an existence oracle (a valid-but-unknown
|
|
13495
|
+
// UUID still collapses to the opaque authorization error downstream).
|
|
13496
|
+
conversation_id: external_exports.string().uuid().optional(),
|
|
13497
|
+
// On-behalf-of end-user identity. Absent → per-connection service principal (task-hub
|
|
13498
|
+
// only; chat hub rejects with 422 in the route).
|
|
13499
|
+
user: external_exports.object({
|
|
13500
|
+
id: external_exports.string().min(1),
|
|
13501
|
+
email: clientOptionalString,
|
|
13502
|
+
name: clientOptionalString
|
|
13503
|
+
}).optional(),
|
|
13504
|
+
message: apiChannelMessage,
|
|
13505
|
+
// Idempotency key: maps to channel_message_sid, deduped within one conversation
|
|
13506
|
+
// (ConversationDO.storeMessage). A retried POST resolves to the same conversation (a chat
|
|
13507
|
+
// hub's user, the external_ref, the conversation_id, or on a task hub with neither, this key
|
|
13508
|
+
// scoped by the sender), so it echoes the original message_id and skips billing / turn
|
|
13509
|
+
// dispatch. A failed store answers a retryable 503 only when this key is set; without it a
|
|
13510
|
+
// retry could store the message twice, so it answers 400.
|
|
13511
|
+
client_message_id: external_exports.string().min(1).max(256).optional()
|
|
13512
|
+
}).refine((b) => !(b.external_ref && b.conversation_id), {
|
|
13513
|
+
message: "provide external_ref or conversation_id, not both",
|
|
13514
|
+
path: ["external_ref"]
|
|
13515
|
+
});
|
|
13516
|
+
appMessageBody = external_exports.object({
|
|
13517
|
+
// Message content — three historical aliases. All optional: an attachment-only
|
|
13518
|
+
// or voice-only message carries no text.
|
|
13519
|
+
content: clientOptionalString,
|
|
13520
|
+
message_text: clientOptionalString,
|
|
13521
|
+
message_body: clientOptionalString,
|
|
13522
|
+
// Conversation context. Ids are plain strings rather than `.uuid()` on purpose:
|
|
13523
|
+
// they are AUTHORIZED downstream, which is the stronger guarantee — a well-formed
|
|
13524
|
+
// uuid belonging to another tenant must fail just as hard as junk. `hub_id` is
|
|
13525
|
+
// gated by `assertHubEndUserAccess` (gh #3286) and `conversation_id` by HubDO's
|
|
13526
|
+
// conversation_index owner check (gh #2781, #3281). The route's own falsy guards
|
|
13527
|
+
// ('hub_id is required') still reject an empty one.
|
|
13528
|
+
hub_id: clientOptionalString,
|
|
13529
|
+
channel_id: clientOptionalString,
|
|
13530
|
+
conversation_id: clientOptionalString,
|
|
13531
|
+
hub_type: external_exports.enum(["chat", "task"]).nullish().transform((v) => v ?? void 0),
|
|
13532
|
+
// Stable idempotency key for one explicit task-hub launcher. HubDO scopes it
|
|
13533
|
+
// to the authenticated user and resolves retries/tabs to one conversation.
|
|
13534
|
+
task_start_id: external_exports.string().uuid().nullish().transform((v) => v ?? void 0),
|
|
13535
|
+
// Routing.
|
|
13536
|
+
sender_type: appMessageSenderType.nullish().transform((v) => v ?? void 0),
|
|
13537
|
+
receiver_type: appMessageReceiverType.nullish().transform((v) => v ?? void 0),
|
|
13538
|
+
// Only meaningful on a team send, where `validateAppTeamSendContext` proves the
|
|
13539
|
+
// caller may send to this receiver. Absent on a team send to a conversation with no
|
|
13540
|
+
// person, which names its `conversation_id` instead. The end-user branch ignores it —
|
|
13541
|
+
// see the receiver derivation in the route.
|
|
13542
|
+
user_receiver_id: clientOptionalString,
|
|
13543
|
+
// ── Internal consult (consultant-agents PR 2 — H1.0) ──────────────────────
|
|
13544
|
+
// A team member handling a customer conversation can tag a `consultant`-role
|
|
13545
|
+
// agent for a PRIVATE, team-only exchange that never reaches the customer. A
|
|
13546
|
+
// consult send is a team send with `receiver_type: 'agent'` targeting the
|
|
13547
|
+
// consultant; `user_receiver_id` identifies the customer whose conversation this is
|
|
13548
|
+
// (and is authorized by `validateAppTeamSendContext`, exactly as a team→user send is),
|
|
13549
|
+
// and is absent, as on a team→user send, when the conversation has no person. The consultant is resolved from `agent_receiver_id`
|
|
13550
|
+
// when supplied, else from an `@mention` parsed out of the message text against
|
|
13551
|
+
// the hub's consultant agents. `consult_thread_id` continues an existing thread;
|
|
13552
|
+
// absent, the route creates/reuses the single implicit thread. These fields are
|
|
13553
|
+
// inert on every non-consult send (end-user send, team→user send).
|
|
13554
|
+
agent_receiver_id: clientOptionalString,
|
|
13555
|
+
consult_thread_id: clientOptionalString,
|
|
13556
|
+
is_first_message: clientOptionalBoolean,
|
|
13557
|
+
end_conversation: clientOptionalBoolean,
|
|
13558
|
+
// Pre-generated by the client so the optimistic bubble and the stored row share
|
|
13559
|
+
// a key (transcription live-updates land on the same row instead of duplicating).
|
|
13560
|
+
message_id: clientOptionalString,
|
|
13561
|
+
attachments: external_exports.array(messageAttachment).max(MAX_ATTACHMENTS_PER_MESSAGE).nullish().transform((v) => v ?? void 0),
|
|
13562
|
+
// Base64-encoded audio for STT. Size-capped in the route (the cap is a byte
|
|
13563
|
+
// budget tied to the /channels/* bodyLimit, not a shape rule).
|
|
13564
|
+
audio_file: clientOptionalString
|
|
13565
|
+
});
|
|
13566
|
+
appMessageResponse = external_exports.object({
|
|
13567
|
+
success: external_exports.boolean(),
|
|
13568
|
+
message: external_exports.string(),
|
|
13569
|
+
result: external_exports.object({
|
|
13570
|
+
conversation_id: external_exports.string().optional(),
|
|
13571
|
+
message_id: external_exports.string().optional(),
|
|
13572
|
+
status: external_exports.string().optional(),
|
|
13573
|
+
files: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
|
|
13574
|
+
// True when this request reused a task-start/message id already accepted by
|
|
13575
|
+
// the server. Clients must replace their optimistic payload with a fresh
|
|
13576
|
+
// authoritative read because another tab may have won with different text.
|
|
13577
|
+
deduped: external_exports.boolean().optional()
|
|
13578
|
+
}).optional()
|
|
13579
|
+
});
|
|
13580
|
+
}
|
|
13581
|
+
});
|
|
13582
|
+
|
|
13583
|
+
// ../../packages/core/dist/chunk-NETRUHZF.js
|
|
13584
|
+
var getConversationsQuery, getMessagesQuery;
|
|
13585
|
+
var init_chunk_NETRUHZF = __esm({
|
|
13586
|
+
"../../packages/core/dist/chunk-NETRUHZF.js"() {
|
|
13587
|
+
"use strict";
|
|
13588
|
+
init_zod();
|
|
13589
|
+
getConversationsQuery = external_exports.object({
|
|
13590
|
+
nav_item: external_exports.enum(["chat", "task", "support", "chat_task"]),
|
|
13591
|
+
hub_team_user_id: external_exports.string().optional(),
|
|
13592
|
+
hub_user_id: external_exports.string().optional(),
|
|
13593
|
+
search_filter: external_exports.string().optional(),
|
|
13594
|
+
hub_id: external_exports.string().uuid().optional(),
|
|
13595
|
+
// NON-authorizing single-hub narrow. Unlike `hub_id` (which runs the
|
|
13596
|
+
// grant-gated `loadHub('hub:read')` and so throws for grant-less end users /
|
|
13597
|
+
// team members), `scope_hub_id` INTERSECTS the caller's already-resolved hub
|
|
13598
|
+
// roster server-side. Intersecting the caller's own roster IS the
|
|
13599
|
+
// authorization — a hub the caller isn't in narrows to empty and leaks
|
|
13600
|
+
// nothing. Continuous history sends it to take the single-hub ended-index
|
|
13601
|
+
// path (one HubDO read, accurate uncapped total) instead of the all-hub
|
|
13602
|
+
// fan-out it would otherwise discard client-side (gh #3319).
|
|
13603
|
+
scope_hub_id: external_exports.string().uuid().optional(),
|
|
13604
|
+
conversation_id: external_exports.string().uuid().optional(),
|
|
13605
|
+
// 'ended' = recently-closed, served warm from the HubDO index (≤ retention
|
|
13606
|
+
// window). 'archived' = the full closed-conversation history from ClickHouse.
|
|
13607
|
+
status: external_exports.enum(["active", "agent", "team", "ended", "archived"]).optional(),
|
|
13608
|
+
page: external_exports.string().regex(/^\d+$/).optional(),
|
|
13609
|
+
page_size: external_exports.string().regex(/^\d+$/).optional()
|
|
13610
|
+
});
|
|
13611
|
+
getMessagesQuery = external_exports.object({
|
|
13612
|
+
hub_id: external_exports.string().uuid(),
|
|
13613
|
+
hub_team_user_id: external_exports.string().optional(),
|
|
13614
|
+
hub_user_id: external_exports.string().optional(),
|
|
13615
|
+
conversation_id: external_exports.string().uuid().optional(),
|
|
13616
|
+
message_id: external_exports.string().uuid().optional(),
|
|
13617
|
+
// `page` = LEGACY oldest-first offset paging (deployed page-based clients).
|
|
13618
|
+
// Its PRESENCE selects the legacy read path server-side; a new client omits it
|
|
13619
|
+
// and instead sends `page_size` + (for older pages) the keyset cursor below.
|
|
13620
|
+
page: external_exports.string().regex(/^\d+$/).optional(),
|
|
13621
|
+
page_size: external_exports.string().regex(/^\d+$/).optional(),
|
|
13622
|
+
// Keyset cursor for the newest-first scroll (`page` absent): return only
|
|
13623
|
+
// messages strictly older than (before_created_at, before_message_id) — the
|
|
13624
|
+
// oldest currently-loaded VISIBLE message. UTC ISO-8601 (Timestamps standard);
|
|
13625
|
+
// `datetime()` hardens it before the parameterized DO predicate.
|
|
13626
|
+
before_created_at: external_exports.string().datetime().optional(),
|
|
13627
|
+
before_message_id: external_exports.string().uuid().optional(),
|
|
13628
|
+
/**
|
|
13629
|
+
* When true AND the caller has support access (hub admin or hub team member),
|
|
13630
|
+
* internal messages (tool calls, tool results) are included in the response.
|
|
13631
|
+
* Silently ignored for non-support callers — it's a view preference, not an
|
|
13632
|
+
* authorization boundary.
|
|
13633
|
+
*/
|
|
13634
|
+
include_internal: external_exports.union([external_exports.literal("true"), external_exports.literal("false"), external_exports.boolean()]).optional().transform((v) => v === true || v === "true")
|
|
13635
|
+
}).superRefine((q, ctx) => {
|
|
13636
|
+
if (q.before_created_at == null !== (q.before_message_id == null)) {
|
|
13637
|
+
ctx.addIssue({
|
|
13638
|
+
code: external_exports.ZodIssueCode.custom,
|
|
13639
|
+
message: "before_created_at and before_message_id must be provided together",
|
|
13640
|
+
path: [q.before_created_at == null ? "before_created_at" : "before_message_id"]
|
|
13641
|
+
});
|
|
13642
|
+
}
|
|
13643
|
+
});
|
|
13644
|
+
}
|
|
13645
|
+
});
|
|
13646
|
+
|
|
13647
|
+
// ../../packages/core/dist/chunk-CZS5NGTA.js
|
|
13648
|
+
function toolParametersViolations(params) {
|
|
13649
|
+
try {
|
|
13650
|
+
if (containsKanbanPlaceholders(params)) return [];
|
|
13651
|
+
const result = validateToolInputSchema(params);
|
|
13652
|
+
return result.ok ? [] : result.errors;
|
|
13653
|
+
} catch (error) {
|
|
13654
|
+
if (!(error instanceof RangeError)) throw error;
|
|
13655
|
+
return [{ path: "", message: "parameters are nested too deeply to serialize" }];
|
|
13656
|
+
}
|
|
13657
|
+
}
|
|
13658
|
+
function configText(config, key) {
|
|
13659
|
+
return config !== null && typeof config === "object" ? nonBlank(config[key]) : void 0;
|
|
13660
|
+
}
|
|
13661
|
+
function statedToolDescription(text4) {
|
|
13662
|
+
const description2 = nonBlank(text4);
|
|
13663
|
+
return description2 === DEFAULT_TOOL_CONFIG_DESCRIPTION ? void 0 : description2;
|
|
13664
|
+
}
|
|
13665
|
+
function toolConfigDescription(config) {
|
|
13666
|
+
return statedToolDescription(configText(config, "description"));
|
|
13667
|
+
}
|
|
13668
|
+
function offeredToolDescription(config, toolDescription) {
|
|
13669
|
+
return toolConfigDescription(config) ?? nonBlank(toolDescription);
|
|
13670
|
+
}
|
|
13671
|
+
function customToolConfigObject(config) {
|
|
13672
|
+
let read = config;
|
|
13673
|
+
for (let layer = 0; layer < MAX_CUSTOM_TOOL_CONFIG_TEXT_LAYERS && typeof read === "string"; layer++) {
|
|
13674
|
+
try {
|
|
13675
|
+
read = JSON.parse(read);
|
|
13676
|
+
} catch {
|
|
13677
|
+
return read;
|
|
13678
|
+
}
|
|
13679
|
+
}
|
|
13680
|
+
return read;
|
|
13681
|
+
}
|
|
13682
|
+
function refineToolConfig(value, ctx) {
|
|
13683
|
+
if (value.tool_config == null) return;
|
|
13684
|
+
const config = customToolConfigObject(value.tool_config);
|
|
13685
|
+
if (config === null || typeof config !== "object" || Array.isArray(config)) {
|
|
13686
|
+
ctx.addIssue({
|
|
13687
|
+
code: external_exports.ZodIssueCode.custom,
|
|
13688
|
+
path: ["tool_config"],
|
|
13689
|
+
message: "tool_config must be an object"
|
|
13690
|
+
});
|
|
13691
|
+
return;
|
|
13692
|
+
}
|
|
13693
|
+
const params = extractToolParameters(config);
|
|
13694
|
+
if (params === void 0) return;
|
|
13695
|
+
for (const err of toolParametersViolations(params)) {
|
|
13696
|
+
ctx.addIssue({
|
|
13697
|
+
code: external_exports.ZodIssueCode.custom,
|
|
13698
|
+
path: ["tool_config", "parameters", ...err.path.split(".").filter(Boolean)],
|
|
13699
|
+
message: err.suggestion ? `${err.message} \u2014 ${err.suggestion}` : err.message
|
|
13700
|
+
});
|
|
13701
|
+
}
|
|
13702
|
+
}
|
|
13703
|
+
var nonBlank, DEFAULT_TOOL_CONFIG_DESCRIPTION, MAX_CUSTOM_TOOL_CONFIG_TEXT_LAYERS, toolIdParam, listToolsQuery, toolAgentQuery, deleteToolQuery, toolConnectionsQuery, nativeToolIdSchema, CONTEXT_BOUNDARIES, contextBoundarySchema, addNativeToolBody, addMcpToolBody, toolReplaySettingsFields, toolReplaySettingsSchema, createCustomToolBody, updateCustomToolBody, updateToolExecutionConfigBody;
|
|
13704
|
+
var init_chunk_CZS5NGTA = __esm({
|
|
13705
|
+
"../../packages/core/dist/chunk-CZS5NGTA.js"() {
|
|
13706
|
+
"use strict";
|
|
13707
|
+
init_chunk_WEXVYJ5H();
|
|
13708
|
+
init_chunk_HZ6CADSY();
|
|
13709
|
+
init_chunk_4IXIQQ2A();
|
|
13710
|
+
init_zod();
|
|
13711
|
+
nonBlank = (text4) => typeof text4 === "string" && text4.trim() !== "" ? text4 : void 0;
|
|
13712
|
+
DEFAULT_TOOL_CONFIG_DESCRIPTION = "Function description";
|
|
13713
|
+
MAX_CUSTOM_TOOL_CONFIG_TEXT_LAYERS = 16;
|
|
13714
|
+
toolIdParam = external_exports.object({ id: uuidSchema });
|
|
13715
|
+
listToolsQuery = external_exports.object({ agent_id: uuidSchema, hub_id: uuidSchema });
|
|
13716
|
+
toolAgentQuery = external_exports.object({ agent_id: uuidSchema, hub_id: uuidSchema });
|
|
13717
|
+
deleteToolQuery = external_exports.object({ agent_id: uuidSchema.optional(), hub_id: uuidSchema });
|
|
13718
|
+
toolConnectionsQuery = external_exports.object({ hub_id: uuidSchema });
|
|
13719
|
+
nativeToolIdSchema = external_exports.string().regex(/^nt-\d{3,}$/, "Invalid native tool id");
|
|
13720
|
+
CONTEXT_BOUNDARIES = ["instruction", "summary", "transcript"];
|
|
13721
|
+
contextBoundarySchema = external_exports.enum(CONTEXT_BOUNDARIES);
|
|
13722
|
+
addNativeToolBody = external_exports.object({
|
|
13723
|
+
agent_id: uuidSchema,
|
|
13724
|
+
hub_id: uuidSchema,
|
|
13725
|
+
tool_native_id: nativeToolIdSchema,
|
|
13726
|
+
delegation_type: external_exports.enum(["team", "agent", "hub"]).optional(),
|
|
13727
|
+
delegation_id: external_exports.string().optional(),
|
|
13728
|
+
delegation_name: external_exports.string().optional(),
|
|
13729
|
+
/** Only meaningful for a `hub` delegation (`delegate_to_hub`); ignored otherwise.
|
|
13730
|
+
* Defaults to `summary` when omitted. Admin-set — the link and boundary require
|
|
13731
|
+
* hub-admin (`hub:write`), never derived from any end user's grants. */
|
|
13732
|
+
delegation_context_boundary: contextBoundarySchema.optional()
|
|
13733
|
+
// No `resource_config`: retired with knowledge, its column dropped (HubDO v106). A body that still
|
|
13734
|
+
// sends it is accepted, the key stripped.
|
|
13735
|
+
});
|
|
13736
|
+
addMcpToolBody = external_exports.object({
|
|
13737
|
+
agent_id: uuidSchema,
|
|
13738
|
+
hub_id: uuidSchema,
|
|
13739
|
+
mcp_tool_id: uuidSchema
|
|
13740
|
+
});
|
|
13741
|
+
toolReplaySettingsFields = {
|
|
13742
|
+
replay_override: external_exports.enum(REPLAY_OVERRIDES).nullable().optional(),
|
|
13743
|
+
idempotency_header: external_exports.string().nullable().optional().superRefine((value, ctx) => {
|
|
13744
|
+
const refusal2 = value == null ? null : idempotencyHeaderRefusal(value);
|
|
13745
|
+
if (refusal2) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: refusal2 });
|
|
13746
|
+
}),
|
|
13747
|
+
irreversible: external_exports.boolean().optional()
|
|
13748
|
+
};
|
|
13749
|
+
toolReplaySettingsSchema = external_exports.object(toolReplaySettingsFields);
|
|
13750
|
+
createCustomToolBody = external_exports.object({
|
|
13751
|
+
agent_id: uuidSchema,
|
|
13752
|
+
hub_id: uuidSchema,
|
|
13753
|
+
...toolReplaySettingsFields
|
|
13754
|
+
}).passthrough().superRefine(refineToolConfig);
|
|
13755
|
+
updateCustomToolBody = external_exports.object({
|
|
13756
|
+
hub_id: uuidSchema.optional(),
|
|
13757
|
+
...toolReplaySettingsFields
|
|
13758
|
+
}).passthrough().superRefine(refineToolConfig);
|
|
13759
|
+
updateToolExecutionConfigBody = external_exports.object({
|
|
13760
|
+
agent_id: uuidSchema,
|
|
13761
|
+
hub_id: uuidSchema,
|
|
13762
|
+
execution_config: external_exports.object({
|
|
13763
|
+
keep_in_history: external_exports.boolean().optional()
|
|
13764
|
+
}).nullable()
|
|
13765
|
+
});
|
|
13766
|
+
}
|
|
13767
|
+
});
|
|
13768
|
+
|
|
13769
|
+
// ../../packages/core/dist/chunk-4LXDRTO4.js
|
|
13770
|
+
var EVAL_ATTACHMENT_HASH_REGEX, CALL_OPENING_HASH_REGEX;
|
|
13771
|
+
var init_chunk_4LXDRTO4 = __esm({
|
|
13772
|
+
"../../packages/core/dist/chunk-4LXDRTO4.js"() {
|
|
13773
|
+
"use strict";
|
|
13774
|
+
EVAL_ATTACHMENT_HASH_REGEX = /^[a-f0-9]{64}$/;
|
|
13775
|
+
CALL_OPENING_HASH_REGEX = EVAL_ATTACHMENT_HASH_REGEX;
|
|
13776
|
+
}
|
|
13777
|
+
});
|
|
13778
|
+
|
|
13779
|
+
// ../../packages/core/dist/chunk-7DLTG7J5.js
|
|
13780
|
+
function isIanaTimezone(timezone) {
|
|
13781
|
+
try {
|
|
13782
|
+
new Intl.DateTimeFormat("en-US", { timeZone: timezone }).format(0);
|
|
13783
|
+
return true;
|
|
13784
|
+
} catch {
|
|
13785
|
+
return false;
|
|
13786
|
+
}
|
|
13787
|
+
}
|
|
13788
|
+
var evalDateContextSchema;
|
|
13789
|
+
var init_chunk_7DLTG7J5 = __esm({
|
|
13790
|
+
"../../packages/core/dist/chunk-7DLTG7J5.js"() {
|
|
13791
|
+
"use strict";
|
|
13792
|
+
init_chunk_KB5RK3RP();
|
|
13793
|
+
init_chunk_HZ6CADSY();
|
|
13794
|
+
init_chunk_MIWZOSPI();
|
|
13795
|
+
init_chunk_NYNOISIG();
|
|
13796
|
+
init_zod();
|
|
13797
|
+
evalDateContextSchema = external_exports.object({
|
|
13798
|
+
base_time: timestampSchema.refine(isIsoTimestamp, "Expected a canonical ISO timestamp"),
|
|
13799
|
+
timezone: external_exports.string().min(1).refine(isIanaTimezone, "Expected an IANA timezone"),
|
|
13800
|
+
locale: external_exports.enum(SUPPORTED_LOCALES)
|
|
13801
|
+
}).strict();
|
|
13802
|
+
}
|
|
13803
|
+
});
|
|
13804
|
+
|
|
13805
|
+
// ../../packages/core/dist/chunk-2ISUBJG7.js
|
|
13806
|
+
var EVAL_PACING_PRESET_NAMES, PACING_INTERVAL_MIN_MS, PACING_INTERVAL_MAX_MS, EVAL_MAX_RUNS_PER_SCENARIO, EVAL_RUN_DEADLINE_MIN_MS, EVAL_RUN_DEADLINE_MAX_MS;
|
|
13807
|
+
var init_chunk_2ISUBJG7 = __esm({
|
|
13808
|
+
"../../packages/core/dist/chunk-2ISUBJG7.js"() {
|
|
13809
|
+
"use strict";
|
|
13810
|
+
EVAL_PACING_PRESET_NAMES = ["conservative", "balanced", "fast", "custom"];
|
|
13811
|
+
PACING_INTERVAL_MIN_MS = 50;
|
|
13812
|
+
PACING_INTERVAL_MAX_MS = 6e4;
|
|
13813
|
+
EVAL_MAX_RUNS_PER_SCENARIO = 100;
|
|
13814
|
+
EVAL_RUN_DEADLINE_MIN_MS = 1e3;
|
|
13815
|
+
EVAL_RUN_DEADLINE_MAX_MS = 18e5;
|
|
13816
|
+
}
|
|
13817
|
+
});
|
|
13818
|
+
|
|
13819
|
+
// ../../packages/core/dist/chunk-JKOMP2G3.js
|
|
13820
|
+
function describeRole(role) {
|
|
13821
|
+
if (typeof role === "string") {
|
|
13822
|
+
return JSON.stringify(role.length > ROLE_ECHO_MAX ? `${role.slice(0, ROLE_ECHO_MAX)}\u2026` : role);
|
|
13823
|
+
}
|
|
13824
|
+
if (role === null) return "null";
|
|
13825
|
+
if (Array.isArray(role)) return "an array";
|
|
13826
|
+
if (typeof role === "object") return "an object";
|
|
13827
|
+
return `a ${typeof role}`;
|
|
13828
|
+
}
|
|
13829
|
+
function asEvalInputRecord(input) {
|
|
13830
|
+
const value = parseMaybeJson(input);
|
|
13831
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
13832
|
+
}
|
|
13833
|
+
function parseMaybeJson(value) {
|
|
12859
13834
|
if (typeof value !== "string") return value;
|
|
12860
13835
|
try {
|
|
12861
13836
|
return JSON.parse(value);
|
|
@@ -13020,11 +13995,11 @@ function terminalRunCount(counts) {
|
|
|
13020
13995
|
return counts.successful_runs + counts.failed_runs;
|
|
13021
13996
|
}
|
|
13022
13997
|
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;
|
|
13023
|
-
var
|
|
13024
|
-
"../../packages/core/dist/chunk-
|
|
13998
|
+
var init_chunk_JKOMP2G3 = __esm({
|
|
13999
|
+
"../../packages/core/dist/chunk-JKOMP2G3.js"() {
|
|
13025
14000
|
"use strict";
|
|
13026
|
-
init_chunk_2YEGUQR7();
|
|
13027
14001
|
init_chunk_SDOG6762();
|
|
14002
|
+
init_chunk_2YEGUQR7();
|
|
13028
14003
|
init_chunk_4LXDRTO4();
|
|
13029
14004
|
init_chunk_7DLTG7J5();
|
|
13030
14005
|
init_chunk_2ISUBJG7();
|
|
@@ -14098,7 +15073,7 @@ var init_chunk_CMCATTHI = __esm({
|
|
|
14098
15073
|
}
|
|
14099
15074
|
});
|
|
14100
15075
|
|
|
14101
|
-
// ../../packages/core/dist/chunk-
|
|
15076
|
+
// ../../packages/core/dist/chunk-BAVTYKY7.js
|
|
14102
15077
|
function declaresNoConnection(agent) {
|
|
14103
15078
|
return agent.connection === null && !agent.connection_id;
|
|
14104
15079
|
}
|
|
@@ -14830,12 +15805,12 @@ function skillSectionsAsResources(scope) {
|
|
|
14830
15805
|
};
|
|
14831
15806
|
}
|
|
14832
15807
|
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;
|
|
14833
|
-
var
|
|
14834
|
-
"../../packages/core/dist/chunk-
|
|
15808
|
+
var init_chunk_BAVTYKY7 = __esm({
|
|
15809
|
+
"../../packages/core/dist/chunk-BAVTYKY7.js"() {
|
|
14835
15810
|
"use strict";
|
|
14836
15811
|
init_chunk_CZS5NGTA();
|
|
14837
15812
|
init_chunk_P74ESVOL();
|
|
14838
|
-
|
|
15813
|
+
init_chunk_JKOMP2G3();
|
|
14839
15814
|
init_chunk_LBDH7LCG();
|
|
14840
15815
|
init_chunk_4LXDRTO4();
|
|
14841
15816
|
init_chunk_CMCATTHI();
|
|
@@ -15142,877 +16117,236 @@ var init_chunk_TMU2GZGY = __esm({
|
|
|
15142
16117
|
name: external_exports.string(),
|
|
15143
16118
|
message: external_exports.string()
|
|
15144
16119
|
});
|
|
15145
|
-
ciSyncResponseSchema = external_exports.object({
|
|
15146
|
-
preview_hub_id: external_exports.string().min(1),
|
|
15147
|
-
created: external_exports.boolean(),
|
|
15148
|
-
changes: ciSyncChangesSchema,
|
|
15149
|
-
errors: external_exports.array(external_exports.string()).optional(),
|
|
15150
|
-
apply_errors: external_exports.array(ciApplyErrorSchema).optional(),
|
|
15151
|
-
warnings: external_exports.array(ciSyncWarningSchema).optional()
|
|
15152
|
-
});
|
|
15153
|
-
}
|
|
15154
|
-
});
|
|
15155
|
-
|
|
15156
|
-
// ../../packages/core/dist/chunk-JDJ4EUOL.js
|
|
15157
|
-
var clickhouseReadyResponse;
|
|
15158
|
-
var init_chunk_JDJ4EUOL = __esm({
|
|
15159
|
-
"../../packages/core/dist/chunk-JDJ4EUOL.js"() {
|
|
15160
|
-
"use strict";
|
|
15161
|
-
init_zod();
|
|
15162
|
-
clickhouseReadyResponse = external_exports.object({
|
|
15163
|
-
ready: external_exports.boolean()
|
|
15164
|
-
});
|
|
15165
|
-
}
|
|
15166
|
-
});
|
|
15167
|
-
|
|
15168
|
-
// ../../packages/core/dist/chunk-
|
|
15169
|
-
var
|
|
15170
|
-
var
|
|
15171
|
-
"../../packages/core/dist/chunk-
|
|
15172
|
-
"use strict";
|
|
15173
|
-
|
|
15174
|
-
|
|
15175
|
-
|
|
15176
|
-
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
|
|
15189
|
-
|
|
15190
|
-
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
|
|
15202
|
-
|
|
15203
|
-
|
|
15204
|
-
|
|
15205
|
-
|
|
15206
|
-
|
|
15207
|
-
|
|
15208
|
-
|
|
15209
|
-
|
|
15210
|
-
|
|
15211
|
-
|
|
15212
|
-
|
|
15213
|
-
|
|
15214
|
-
|
|
15215
|
-
|
|
15216
|
-
|
|
15217
|
-
|
|
15218
|
-
});
|
|
15219
|
-
|
|
15220
|
-
|
|
15221
|
-
|
|
15222
|
-
|
|
15223
|
-
|
|
15224
|
-
|
|
15225
|
-
|
|
15226
|
-
engaged_agent_id: external_exports.string().uuid().optional()
|
|
15227
|
-
}).refine((v) => v.title !== void 0 || v.engaged_agent_id !== void 0, {
|
|
15228
|
-
message: "Provide a title and/or an engaged_agent_id to update"
|
|
15229
|
-
});
|
|
15230
|
-
updateConsultThreadResponse = external_exports.object({
|
|
15231
|
-
thread: consultThreadSummary
|
|
15232
|
-
});
|
|
15233
|
-
CONSULT_AWAIT_TIMEOUT_MS = 15 * 6e4;
|
|
15234
|
-
}
|
|
15235
|
-
});
|
|
15236
|
-
|
|
15237
|
-
// ../../packages/core/dist/chunk-PZPOUXJR.js
|
|
15238
|
-
var navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody;
|
|
15239
|
-
var init_chunk_PZPOUXJR = __esm({
|
|
15240
|
-
"../../packages/core/dist/chunk-PZPOUXJR.js"() {
|
|
15241
|
-
"use strict";
|
|
15242
|
-
init_zod();
|
|
15243
|
-
navItemSchema = external_exports.enum(["chat", "support", "task"]);
|
|
15244
|
-
hubCountResetBody = external_exports.object({
|
|
15245
|
-
hub_id: external_exports.string().uuid(),
|
|
15246
|
-
nav_item: navItemSchema,
|
|
15247
|
-
conversation_id: external_exports.string().uuid().optional(),
|
|
15248
|
-
hub_user_id: external_exports.string().optional(),
|
|
15249
|
-
current_team_user_id: external_exports.string().optional()
|
|
15250
|
-
});
|
|
15251
|
-
navItemCountResetBody = external_exports.object({
|
|
15252
|
-
nav_item: navItemSchema
|
|
15253
|
-
});
|
|
15254
|
-
typingBody = external_exports.object({
|
|
15255
|
-
conversationId: external_exports.string().uuid(),
|
|
15256
|
-
hubId: external_exports.string().uuid(),
|
|
15257
|
-
action: external_exports.enum(["start", "stop"])
|
|
15258
|
-
});
|
|
15259
|
-
}
|
|
15260
|
-
});
|
|
15261
|
-
|
|
15262
|
-
// ../../packages/core/dist/chunk-YWZFB34T.js
|
|
15263
|
-
function cacheReconcileIdCount(body) {
|
|
15264
|
-
return body.conversations.length + body.histories.reduce((n, history) => n + history.conversation_ids.length, 0) + body.threads.length;
|
|
15265
|
-
}
|
|
15266
|
-
var CACHE_RECONCILE_MAX_IDS, CACHE_RECONCILE_MAX_HUBS, cacheReconcileScopeSchema, cachedConversationPageSchema, cachedHistoryThreadSchema, cachedPeopleThreadSchema, cacheReconcileBody;
|
|
15267
|
-
var init_chunk_YWZFB34T = __esm({
|
|
15268
|
-
"../../packages/core/dist/chunk-YWZFB34T.js"() {
|
|
15269
|
-
"use strict";
|
|
15270
|
-
init_chunk_PZPOUXJR();
|
|
15271
|
-
init_chunk_HZ6CADSY();
|
|
15272
|
-
init_zod();
|
|
15273
|
-
CACHE_RECONCILE_MAX_IDS = 300;
|
|
15274
|
-
CACHE_RECONCILE_MAX_HUBS = 15;
|
|
15275
|
-
cacheReconcileScopeSchema = navItemSchema;
|
|
15276
|
-
cachedConversationPageSchema = external_exports.object({
|
|
15277
|
-
conversation_id: uuidSchema,
|
|
15278
|
-
hub_id: uuidSchema,
|
|
15279
|
-
scope: cacheReconcileScopeSchema
|
|
15280
|
-
}).strict();
|
|
15281
|
-
cachedHistoryThreadSchema = external_exports.object({
|
|
15282
|
-
hub_id: uuidSchema,
|
|
15283
|
-
hub_user_id: external_exports.string().min(1).max(128),
|
|
15284
|
-
nav: cacheReconcileScopeSchema,
|
|
15285
|
-
conversation_ids: external_exports.array(uuidSchema).min(1).max(CACHE_RECONCILE_MAX_IDS)
|
|
15286
|
-
}).strict();
|
|
15287
|
-
cachedPeopleThreadSchema = external_exports.object({ thread_id: uuidSchema }).strict();
|
|
15288
|
-
cacheReconcileBody = external_exports.object({
|
|
15289
|
-
conversations: external_exports.array(cachedConversationPageSchema).max(CACHE_RECONCILE_MAX_IDS).default([]),
|
|
15290
|
-
histories: external_exports.array(cachedHistoryThreadSchema).max(CACHE_RECONCILE_MAX_IDS).default([]),
|
|
15291
|
-
threads: external_exports.array(cachedPeopleThreadSchema).max(CACHE_RECONCILE_MAX_IDS).default([])
|
|
15292
|
-
}).strict().superRefine((body, ctx) => {
|
|
15293
|
-
if (cacheReconcileIdCount(body) > CACHE_RECONCILE_MAX_IDS) {
|
|
15294
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `At most ${CACHE_RECONCILE_MAX_IDS} ids in all` });
|
|
15295
|
-
}
|
|
15296
|
-
const hubs = new Set([...body.conversations, ...body.histories].map((entry) => entry.hub_id));
|
|
15297
|
-
if (hubs.size > CACHE_RECONCILE_MAX_HUBS) {
|
|
15298
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `At most ${CACHE_RECONCILE_MAX_HUBS} distinct hubs` });
|
|
15299
|
-
}
|
|
15300
|
-
});
|
|
15301
|
-
}
|
|
15302
|
-
});
|
|
15303
|
-
|
|
15304
|
-
// ../../packages/core/dist/chunk-FOFCV4SW.js
|
|
15305
|
-
function isCaseAttributeDate(text4) {
|
|
15306
|
-
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(text4);
|
|
15307
|
-
if (!match) return false;
|
|
15308
|
-
const [year, month, day] = [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
15309
|
-
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
15310
|
-
const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
|
|
15311
|
-
return days !== void 0 && day >= 1 && day <= days;
|
|
15312
|
-
}
|
|
15313
|
-
function valueProblem(property, value) {
|
|
15314
|
-
switch (property.type) {
|
|
15315
|
-
case "string":
|
|
15316
|
-
if (typeof value !== "string") return "attribute_wrong_type";
|
|
15317
|
-
break;
|
|
15318
|
-
case "number":
|
|
15319
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return "attribute_wrong_type";
|
|
15320
|
-
break;
|
|
15321
|
-
case "integer":
|
|
15322
|
-
if (typeof value !== "number" || !Number.isInteger(value)) return "attribute_wrong_type";
|
|
15323
|
-
break;
|
|
15324
|
-
case "boolean":
|
|
15325
|
-
if (typeof value !== "boolean") return "attribute_wrong_type";
|
|
15326
|
-
break;
|
|
15327
|
-
default:
|
|
15328
|
-
break;
|
|
15329
|
-
}
|
|
15330
|
-
if (property.format === "date" && typeof value === "string" && !isCaseAttributeDate(value)) return "attribute_not_a_date";
|
|
15331
|
-
return null;
|
|
15332
|
-
}
|
|
15333
|
-
function propertiesOf(schema) {
|
|
15334
|
-
return Object.entries(schema.properties ?? {});
|
|
15335
|
-
}
|
|
15336
|
-
function caseAttributesSchemaProblem(schema) {
|
|
15337
|
-
for (const [key, property] of propertiesOf(schema)) {
|
|
15338
|
-
if (property.type === void 0 && property.enum === void 0) return { reason: "attribute_type_missing", at: key };
|
|
15339
|
-
if (property.format !== void 0 && property.type !== "string") return { reason: "attribute_format_unexpected", at: key };
|
|
15340
|
-
if (property.enum) {
|
|
15341
|
-
if (new Set(property.enum).size !== property.enum.length) return { reason: "attribute_option_repeated", at: key };
|
|
15342
|
-
if (property.enum.some((option) => valueProblem(property, option) !== null)) return { reason: "attribute_option_mismatch", at: key };
|
|
15343
|
-
}
|
|
15344
|
-
}
|
|
15345
|
-
const required = schema.required ?? [];
|
|
15346
|
-
if (new Set(required).size !== required.length) return { reason: "attribute_required_repeated", at: "required" };
|
|
15347
|
-
const unknown = required.find((key) => !Object.hasOwn(schema.properties ?? {}, key));
|
|
15348
|
-
if (unknown !== void 0) return { reason: "attribute_required_unknown", at: unknown };
|
|
15349
|
-
return null;
|
|
15350
|
-
}
|
|
15351
|
-
var CASE_ATTRIBUTE_KEY_PATTERN, CASE_ATTRIBUTE_KEY_MAX_LENGTH, CASE_ATTRIBUTE_TYPES, CASE_ATTRIBUTE_FORMATS, CASE_ATTRIBUTE_PROPERTIES_MAX, CASE_ATTRIBUTE_OPTIONS_MAX, CASE_ATTRIBUTE_TITLE_MAX_LENGTH, CASE_ATTRIBUTE_DESCRIPTION_MAX_LENGTH, CASE_ATTRIBUTE_OPTION_MAX_LENGTH, CASE_ATTRIBUTES_MAX_CHARS, EMPTY_CASE_ATTRIBUTES_SCHEMA, caseAttributePropertySchema, attributeKey, caseAttributesSchemaSchema;
|
|
15352
|
-
var init_chunk_FOFCV4SW = __esm({
|
|
15353
|
-
"../../packages/core/dist/chunk-FOFCV4SW.js"() {
|
|
15354
|
-
"use strict";
|
|
15355
|
-
init_zod();
|
|
15356
|
-
CASE_ATTRIBUTE_KEY_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
15357
|
-
CASE_ATTRIBUTE_KEY_MAX_LENGTH = 64;
|
|
15358
|
-
CASE_ATTRIBUTE_TYPES = ["string", "number", "integer", "boolean"];
|
|
15359
|
-
CASE_ATTRIBUTE_FORMATS = ["date"];
|
|
15360
|
-
CASE_ATTRIBUTE_PROPERTIES_MAX = 100;
|
|
15361
|
-
CASE_ATTRIBUTE_OPTIONS_MAX = 100;
|
|
15362
|
-
CASE_ATTRIBUTE_TITLE_MAX_LENGTH = 200;
|
|
15363
|
-
CASE_ATTRIBUTE_DESCRIPTION_MAX_LENGTH = 2e3;
|
|
15364
|
-
CASE_ATTRIBUTE_OPTION_MAX_LENGTH = 200;
|
|
15365
|
-
CASE_ATTRIBUTES_MAX_CHARS = 16 * 1024;
|
|
15366
|
-
EMPTY_CASE_ATTRIBUTES_SCHEMA = { type: "object" };
|
|
15367
|
-
caseAttributePropertySchema = external_exports.object({
|
|
15368
|
-
type: external_exports.enum(CASE_ATTRIBUTE_TYPES).optional(),
|
|
15369
|
-
title: external_exports.string().min(1).max(CASE_ATTRIBUTE_TITLE_MAX_LENGTH).optional(),
|
|
15370
|
-
description: external_exports.string().max(CASE_ATTRIBUTE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15371
|
-
/** The values it may take, shown as a list to pick from. */
|
|
15372
|
-
enum: external_exports.array(external_exports.union([external_exports.string().max(CASE_ATTRIBUTE_OPTION_MAX_LENGTH), external_exports.number().finite()])).min(1).max(CASE_ATTRIBUTE_OPTIONS_MAX).optional(),
|
|
15373
|
-
/** `date`: a calendar date, `YYYY-MM-DD`. */
|
|
15374
|
-
format: external_exports.enum(CASE_ATTRIBUTE_FORMATS).optional()
|
|
15375
|
-
}).strict();
|
|
15376
|
-
attributeKey = external_exports.string().max(CASE_ATTRIBUTE_KEY_MAX_LENGTH).regex(CASE_ATTRIBUTE_KEY_PATTERN);
|
|
15377
|
-
caseAttributesSchemaSchema = external_exports.object({
|
|
15378
|
-
type: external_exports.literal("object"),
|
|
15379
|
-
properties: external_exports.record(attributeKey, caseAttributePropertySchema).refine((properties) => Object.keys(properties).length <= CASE_ATTRIBUTE_PROPERTIES_MAX, "Too many properties").optional(),
|
|
15380
|
-
required: external_exports.array(attributeKey).max(CASE_ATTRIBUTE_PROPERTIES_MAX).optional()
|
|
15381
|
-
}).strict();
|
|
15382
|
-
}
|
|
15383
|
-
});
|
|
15384
|
-
|
|
15385
|
-
// ../../packages/core/dist/chunk-GSNOG25F.js
|
|
15386
|
-
var CASE_SPACE_NAME_MAX_LENGTH, CASE_TEAM_NAME_MAX_LENGTH, CASE_TEAM_MEMBERS_MAX, CASE_MEMBERS_PAGE_MAX, CASE_PAGE_CURSOR_MAX_LENGTH, CASE_LEVELS, CASE_REGISTRY_CLOSED_REASON, caseSpaceNameSchema, adminCreateCaseSpaceBody, caseOrgParam, caseSpaceParam, caseMemberParam, caseAdministratorParam, caseTeamParam, casePageQuery, saveCaseMemberBody, caseTeamScopeSchema, caseTeamMemberInput, caseTeamFields, createCaseTeamBody, updateCaseTeamBody;
|
|
15387
|
-
var init_chunk_GSNOG25F = __esm({
|
|
15388
|
-
"../../packages/core/dist/chunk-GSNOG25F.js"() {
|
|
15389
|
-
"use strict";
|
|
15390
|
-
init_chunk_ZVXO3XL6();
|
|
15391
|
-
init_chunk_HZ6CADSY();
|
|
15392
|
-
init_zod();
|
|
15393
|
-
CASE_SPACE_NAME_MAX_LENGTH = 200;
|
|
15394
|
-
CASE_TEAM_NAME_MAX_LENGTH = 200;
|
|
15395
|
-
CASE_TEAM_MEMBERS_MAX = 1e3;
|
|
15396
|
-
CASE_MEMBERS_PAGE_MAX = 200;
|
|
15397
|
-
CASE_PAGE_CURSOR_MAX_LENGTH = 2048;
|
|
15398
|
-
CASE_LEVELS = ["read", "edit", "conduct"];
|
|
15399
|
-
CASE_REGISTRY_CLOSED_REASON = "case_registry_closed";
|
|
15400
|
-
caseSpaceNameSchema = external_exports.string().trim().min(1).max(CASE_SPACE_NAME_MAX_LENGTH);
|
|
15401
|
-
adminCreateCaseSpaceBody = external_exports.object({ org_id: uuidSchema, name: caseSpaceNameSchema }).strict();
|
|
15402
|
-
caseOrgParam = external_exports.object({ org_id: uuidSchema });
|
|
15403
|
-
caseSpaceParam = caseOrgParam.extend({ space_id: uuidSchema });
|
|
15404
|
-
caseMemberParam = caseSpaceParam.extend({ person_id: uuidSchema });
|
|
15405
|
-
caseAdministratorParam = caseSpaceParam.extend({ user_id: peopleUserIdSchema });
|
|
15406
|
-
caseTeamParam = caseSpaceParam.extend({ team_id: uuidSchema });
|
|
15407
|
-
casePageQuery = external_exports.object({
|
|
15408
|
-
limit: external_exports.coerce.number().int().min(1).max(CASE_MEMBERS_PAGE_MAX).optional(),
|
|
15409
|
-
cursor: external_exports.string().min(1).max(CASE_PAGE_CURSOR_MAX_LENGTH).optional()
|
|
15410
|
-
});
|
|
15411
|
-
saveCaseMemberBody = external_exports.object({
|
|
15412
|
-
user_id: peopleUserIdSchema,
|
|
15413
|
-
guest: external_exports.boolean().default(false),
|
|
15414
|
-
registry: external_exports.boolean().default(false),
|
|
15415
|
-
existing: external_exports.boolean().optional()
|
|
15416
|
-
}).strict().refine((body) => !(body.guest && body.registry), { message: "A guest cannot hold the Registry flag", path: ["registry"] });
|
|
15417
|
-
caseTeamScopeSchema = external_exports.object({ kind: external_exports.literal("space"), target_id: external_exports.null() }).strict();
|
|
15418
|
-
caseTeamMemberInput = external_exports.object({
|
|
15419
|
-
person_id: uuidSchema,
|
|
15420
|
-
level: external_exports.enum(CASE_LEVELS),
|
|
15421
|
-
approve: external_exports.boolean(),
|
|
15422
|
-
confidential: external_exports.boolean()
|
|
15423
|
-
}).strict();
|
|
15424
|
-
caseTeamFields = {
|
|
15425
|
-
name: external_exports.string().trim().min(1).max(CASE_TEAM_NAME_MAX_LENGTH),
|
|
15426
|
-
active: external_exports.boolean(),
|
|
15427
|
-
scopes: external_exports.array(caseTeamScopeSchema).max(1),
|
|
15428
|
-
members: external_exports.array(caseTeamMemberInput).max(CASE_TEAM_MEMBERS_MAX)
|
|
15429
|
-
};
|
|
15430
|
-
createCaseTeamBody = external_exports.object(caseTeamFields).strict();
|
|
15431
|
-
updateCaseTeamBody = external_exports.object({ ...caseTeamFields, expected_updated_at: timestampSchema.optional() }).strict();
|
|
15432
|
-
}
|
|
15433
|
-
});
|
|
15434
|
-
|
|
15435
|
-
// ../../packages/core/dist/chunk-PDN3YARH.js
|
|
15436
|
-
function resolveItemLink(phaseFolder, target) {
|
|
15437
|
-
const slash = target.lastIndexOf("/");
|
|
15438
|
-
const folder = slash < 0 ? phaseFolder : target.slice(0, slash);
|
|
15439
|
-
const code2 = target.slice(slash + 1);
|
|
15440
|
-
return { folder, code: code2, key: `${folder}/${code2}` };
|
|
15441
|
-
}
|
|
15442
|
-
function caseTypeDefinitionRows(definition) {
|
|
15443
|
-
let rows = 1 + definition.type_party_roles.length + definition.type_outcomes.length;
|
|
15444
|
-
for (const phase of definition.type_phases) {
|
|
15445
|
-
rows += 1 + phase.depends_on.length + phase.phase_inputs.length;
|
|
15446
|
-
for (const task of phase.type_tasks) rows += 1 + task.depends_on.length;
|
|
15447
|
-
for (const group of phase.agenda_groups) rows += 1 + group.approving_team_ids.length + group.agenda_decisions.length;
|
|
15448
|
-
for (const output of phase.phase_outputs) {
|
|
15449
|
-
rows += 1;
|
|
15450
|
-
for (const item of output.output_items) {
|
|
15451
|
-
const { inputs, calculations, decisions } = item.item_requirements;
|
|
15452
|
-
rows += 1 + inputs.length + calculations.length + decisions.length + item.item_links.depends_on.length + (item.item_links.reflects ? 1 : 0);
|
|
15453
|
-
}
|
|
15454
|
-
}
|
|
15455
|
-
}
|
|
15456
|
-
return rows;
|
|
15457
|
-
}
|
|
15458
|
-
function caseTaskRequired(phase, task) {
|
|
15459
|
-
if (task.output !== null) return phase.phase_outputs.find((output) => output.code === task.output)?.required ?? false;
|
|
15460
|
-
if (task.input !== null) return phase.phase_inputs.find((input) => input.key === task.input)?.required ?? false;
|
|
15461
|
-
if (task.agenda_group !== null) return phase.agenda_groups.find((group) => group.code === task.agenda_group)?.required ?? false;
|
|
15462
|
-
return task.required;
|
|
15463
|
-
}
|
|
15464
|
-
function decisionProblem(decision) {
|
|
15465
|
-
if (decision.type === "choice") {
|
|
15466
|
-
if (decision.options.length < 2) return "decision_options_missing";
|
|
15467
|
-
if (repeated(decision.options.map((option) => option.code))) return "decision_option_code_repeated";
|
|
15468
|
-
} else if (decision.options.length > 0) {
|
|
15469
|
-
return "decision_options_unexpected";
|
|
15470
|
-
}
|
|
15471
|
-
const numeric = CASE_NUMERIC_DECISION_TYPES.includes(decision.type);
|
|
15472
|
-
if (!numeric && (decision.min !== null || decision.max !== null)) return "decision_bounds_unexpected";
|
|
15473
|
-
if (!numeric && decision.decimals !== null) return "decision_decimals_unexpected";
|
|
15474
|
-
if (decision.min !== null && decision.max !== null && decision.min > decision.max) return "decision_bounds_inverted";
|
|
15475
|
-
return null;
|
|
15476
|
-
}
|
|
15477
|
-
function cycleIn(nodes, edges) {
|
|
15478
|
-
const state = /* @__PURE__ */ new Map();
|
|
15479
|
-
const visit = (node) => {
|
|
15480
|
-
if (state.get(node) === "done") return false;
|
|
15481
|
-
if (state.get(node) === "open") return true;
|
|
15482
|
-
state.set(node, "open");
|
|
15483
|
-
for (const next of edges.get(node) ?? []) if (visit(next)) return true;
|
|
15484
|
-
state.set(node, "done");
|
|
15485
|
-
return false;
|
|
15486
|
-
};
|
|
15487
|
-
return nodes.find((node) => visit(node)) ?? null;
|
|
15488
|
-
}
|
|
15489
|
-
function fixedTextProblem(text4) {
|
|
15490
|
-
if (text4.includes("<!--")) return "item_fixed_text_comment";
|
|
15491
|
-
const lines = text4.replace(/\r\n?/g, "\n").split("\n");
|
|
15492
|
-
let fence = null;
|
|
15493
|
-
let closedAt = -1;
|
|
15494
|
-
for (let i = 0; i < lines.length; i++) {
|
|
15495
|
-
const line = lines[i];
|
|
15496
|
-
const mark = /^ {0,3}(`{3,}|~{3,})/.exec(line)?.[1];
|
|
15497
|
-
if (fence !== null) {
|
|
15498
|
-
if (mark && mark[0] === fence[0] && mark.length >= fence.length && line.trim() === mark) {
|
|
15499
|
-
fence = null;
|
|
15500
|
-
closedAt = i;
|
|
15501
|
-
}
|
|
15502
|
-
continue;
|
|
15503
|
-
}
|
|
15504
|
-
if (mark) {
|
|
15505
|
-
fence = mark;
|
|
15506
|
-
continue;
|
|
15507
|
-
}
|
|
15508
|
-
const setext = i > 0 && /^ {0,3}(=+|-+)[ \t]*$/.test(line) && lines[i - 1].trim() !== "" && closedAt !== i - 1 && (i === 1 || lines[i - 2].trim() === "");
|
|
15509
|
-
if (/^ {0,3}#{1,6}([ \t]|$)/.test(line) || setext) return "item_fixed_text_heading";
|
|
15510
|
-
}
|
|
15511
|
-
return null;
|
|
15512
|
-
}
|
|
15513
|
-
function pathsOverlap(a, b) {
|
|
15514
|
-
return a === b || a.endsWith("/") && b.startsWith(a) || b.endsWith("/") && a.startsWith(b);
|
|
15515
|
-
}
|
|
15516
|
-
function caseTypeDefinitionProblem(definition) {
|
|
15517
|
-
const problem = (reason, at) => ({ reason, at });
|
|
15518
|
-
if (JSON.stringify(definition).length > CASE_TYPE_DEFINITION_MAX_CHARS || caseTypeDefinitionRows(definition) > CASE_TYPE_DEFINITION_ROWS_MAX) {
|
|
15519
|
-
return problem("definition_too_large", "definition");
|
|
15520
|
-
}
|
|
15521
|
-
const attributes = caseAttributesSchemaProblem(definition.attributes);
|
|
15522
|
-
if (attributes) return problem(attributes.reason, `attributes.${attributes.at}`);
|
|
15523
|
-
if (repeated(definition.type_party_roles.map((role) => role.code))) return problem("party_role_code_repeated", "type_party_roles");
|
|
15524
|
-
if (repeated(definition.type_outcomes.map((outcome) => outcome.code))) return problem("outcome_code_repeated", "type_outcomes");
|
|
15525
|
-
const phases = definition.type_phases;
|
|
15526
|
-
if (repeated(phases.map((phase) => phase.code))) return problem("phase_code_repeated", "type_phases");
|
|
15527
|
-
if (repeated(phases.map((phase) => phase.folder))) return problem("phase_folder_repeated", "type_phases");
|
|
15528
|
-
if (repeated(phases.map((phase) => phase.folder.slice(0, 2)))) return problem("phase_position_repeated", "type_phases");
|
|
15529
|
-
const phaseCodes = new Set(phases.map((phase) => phase.code));
|
|
15530
|
-
const itemsByFolder = new Map(phases.map((phase) => [
|
|
15531
|
-
phase.folder,
|
|
15532
|
-
new Set(phase.phase_outputs.flatMap((output) => output.output_items.map((item) => item.code)))
|
|
15533
|
-
]));
|
|
15534
|
-
const paths = [];
|
|
15535
|
-
const decisionCodes = phases.flatMap((phase) => phase.agenda_groups.flatMap((group) => group.agenda_decisions.map((decision) => decision.code)));
|
|
15536
|
-
if (repeated(decisionCodes)) return problem("decision_code_repeated", "type_phases");
|
|
15537
|
-
const versionDecisions = new Set(decisionCodes);
|
|
15538
|
-
const caseDecisionsAllowed = phases.some((phase) => phase.agenda_groups.some((group) => group.case_decisions_allowed));
|
|
15539
|
-
for (const phase of phases) {
|
|
15540
|
-
const at = `type_phases.${phase.folder}`;
|
|
15541
|
-
for (const dependency of phase.depends_on) {
|
|
15542
|
-
if (dependency === phase.code) return problem("phase_dependency_self", at);
|
|
15543
|
-
if (!phaseCodes.has(dependency)) return problem("phase_dependency_unknown", at);
|
|
15544
|
-
}
|
|
15545
|
-
if (phase.review_mode === "team" !== (phase.review_team_id !== null)) {
|
|
15546
|
-
return problem(phase.review_mode === "team" ? "review_team_missing" : "review_team_unexpected", at);
|
|
15547
|
-
}
|
|
15548
|
-
const outputs = phase.phase_outputs;
|
|
15549
|
-
if (repeated(outputs.map((output) => output.code))) return problem("output_code_repeated", at);
|
|
15550
|
-
if (repeated(outputs.map((output) => output.document_type.toLowerCase()))) return problem("output_document_type_repeated", at);
|
|
15551
|
-
const inputKeys = new Set(phase.phase_inputs.map((input) => input.key));
|
|
15552
|
-
if (inputKeys.size !== phase.phase_inputs.length) return problem("input_key_repeated", at);
|
|
15553
|
-
const tasks = phase.type_tasks;
|
|
15554
|
-
const taskCodes = new Set(tasks.map((task) => task.code));
|
|
15555
|
-
if (taskCodes.size !== tasks.length) return problem("task_code_repeated", at);
|
|
15556
|
-
const groups = phase.agenda_groups;
|
|
15557
|
-
const groupCodes = new Set(groups.map((group) => group.code));
|
|
15558
|
-
if (groupCodes.size !== groups.length) return problem("agenda_group_code_repeated", at);
|
|
15559
|
-
for (const output of outputs) {
|
|
15560
|
-
const outputAt = `${at}.phase_outputs.${output.code}`;
|
|
15561
|
-
if (output.format === "file" && output.output_items.length > 0) return problem("file_output_with_items", outputAt);
|
|
15562
|
-
if (output.format === "file" && output.case_items_allowed) return problem("file_output_with_case_items", outputAt);
|
|
15563
|
-
if (repeated(output.approving_team_ids)) return problem("approving_team_repeated", outputAt);
|
|
15564
|
-
for (const path45 of output.file_paths) {
|
|
15565
|
-
if (!path45.startsWith(`${phase.folder}/`)) return problem("file_path_outside_phase", outputAt);
|
|
15566
|
-
if (output.format === "file" && path45.endsWith("/")) return problem("file_path_folder_for_file", outputAt);
|
|
15567
|
-
if (paths.some((held) => pathsOverlap(held, path45))) return problem("file_path_overlaps", outputAt);
|
|
15568
|
-
paths.push(path45);
|
|
15569
|
-
}
|
|
15570
|
-
}
|
|
15571
|
-
if (phase.joint_delivery) {
|
|
15572
|
-
const teamsOf = (output) => [...output.approving_team_ids].sort().join(",");
|
|
15573
|
-
if (new Set(outputs.map(teamsOf)).size > 1) return problem("joint_approving_teams_differ", at);
|
|
15574
|
-
}
|
|
15575
|
-
for (const group of groups) {
|
|
15576
|
-
const groupAt = `${at}.agenda_groups.${group.code}`;
|
|
15577
|
-
if (group.approving_team_ids.length === 0) return problem("approving_teams_missing", groupAt);
|
|
15578
|
-
if (repeated(group.approving_team_ids)) return problem("approving_team_repeated", groupAt);
|
|
15579
|
-
if (group.agenda_decisions.length === 0 && !group.case_decisions_allowed) return problem("agenda_group_without_decisions", groupAt);
|
|
15580
|
-
for (const decision of group.agenda_decisions) {
|
|
15581
|
-
const reason = decisionProblem(decision);
|
|
15582
|
-
if (reason) return problem(reason, `${groupAt}.agenda_decisions.${decision.code}`);
|
|
15583
|
-
}
|
|
15584
|
-
if (group.required && !outputs.some((output) => output.required) && !tasks.some((task) => task.agenda_group === group.code)) {
|
|
15585
|
-
return problem("agenda_group_unbound", groupAt);
|
|
15586
|
-
}
|
|
15587
|
-
}
|
|
15588
|
-
const outputCodes = new Set(outputs.map((output) => output.code));
|
|
15589
|
-
for (const task of tasks) {
|
|
15590
|
-
const taskAt = `${at}.type_tasks.${task.code}`;
|
|
15591
|
-
if ([task.output, task.input, task.agenda_group].filter((link) => link !== null).length > 1) return problem("task_link_ambiguous", taskAt);
|
|
15592
|
-
if (task.output !== null && !outputCodes.has(task.output)) return problem("task_output_unknown", taskAt);
|
|
15593
|
-
if (task.input !== null && !inputKeys.has(task.input)) return problem("task_input_unknown", taskAt);
|
|
15594
|
-
if (task.agenda_group !== null && !groupCodes.has(task.agenda_group)) return problem("task_agenda_group_unknown", taskAt);
|
|
15595
|
-
for (const dependency of task.depends_on) {
|
|
15596
|
-
if (dependency === task.code) return problem("task_dependency_self", taskAt);
|
|
15597
|
-
if (!taskCodes.has(dependency)) return problem("task_dependency_unknown", taskAt);
|
|
15598
|
-
}
|
|
15599
|
-
}
|
|
15600
|
-
const taskCycle = cycleIn(tasks.map((task) => task.code), new Map(tasks.map((task) => [task.code, task.depends_on])));
|
|
15601
|
-
if (taskCycle) return problem("task_dependency_cycle", `${at}.type_tasks.${taskCycle}`);
|
|
15602
|
-
const items = outputs.flatMap((output) => output.output_items);
|
|
15603
|
-
if (repeated(items.map((item) => item.code))) return problem("item_code_repeated", at);
|
|
15604
|
-
for (const item of items) {
|
|
15605
|
-
const itemAt = `${at}.output_items.${item.code}`;
|
|
15606
|
-
if (item.task !== null && !taskCodes.has(item.task)) return problem("item_task_unknown", itemAt);
|
|
15607
|
-
if (item.template_mode === "fixed") {
|
|
15608
|
-
if (!item.fixed_text?.trim()) return problem("item_fixed_text_missing", itemAt);
|
|
15609
|
-
if (item.grouping) return problem("item_grouping_fixed", itemAt);
|
|
15610
|
-
const textProblem = fixedTextProblem(item.fixed_text);
|
|
15611
|
-
if (textProblem) return problem(textProblem, itemAt);
|
|
15612
|
-
} else if (item.fixed_text !== null) {
|
|
15613
|
-
return problem("item_fixed_text_unexpected", itemAt);
|
|
16120
|
+
ciSyncResponseSchema = external_exports.object({
|
|
16121
|
+
preview_hub_id: external_exports.string().min(1),
|
|
16122
|
+
created: external_exports.boolean(),
|
|
16123
|
+
changes: ciSyncChangesSchema,
|
|
16124
|
+
errors: external_exports.array(external_exports.string()).optional(),
|
|
16125
|
+
apply_errors: external_exports.array(ciApplyErrorSchema).optional(),
|
|
16126
|
+
warnings: external_exports.array(ciSyncWarningSchema).optional()
|
|
16127
|
+
});
|
|
16128
|
+
}
|
|
16129
|
+
});
|
|
16130
|
+
|
|
16131
|
+
// ../../packages/core/dist/chunk-JDJ4EUOL.js
|
|
16132
|
+
var clickhouseReadyResponse;
|
|
16133
|
+
var init_chunk_JDJ4EUOL = __esm({
|
|
16134
|
+
"../../packages/core/dist/chunk-JDJ4EUOL.js"() {
|
|
16135
|
+
"use strict";
|
|
16136
|
+
init_zod();
|
|
16137
|
+
clickhouseReadyResponse = external_exports.object({
|
|
16138
|
+
ready: external_exports.boolean()
|
|
16139
|
+
});
|
|
16140
|
+
}
|
|
16141
|
+
});
|
|
16142
|
+
|
|
16143
|
+
// ../../packages/core/dist/chunk-PZPOUXJR.js
|
|
16144
|
+
var navItemSchema, hubCountResetBody, navItemCountResetBody, typingBody;
|
|
16145
|
+
var init_chunk_PZPOUXJR = __esm({
|
|
16146
|
+
"../../packages/core/dist/chunk-PZPOUXJR.js"() {
|
|
16147
|
+
"use strict";
|
|
16148
|
+
init_zod();
|
|
16149
|
+
navItemSchema = external_exports.enum(["chat", "support", "task"]);
|
|
16150
|
+
hubCountResetBody = external_exports.object({
|
|
16151
|
+
hub_id: external_exports.string().uuid(),
|
|
16152
|
+
nav_item: navItemSchema,
|
|
16153
|
+
conversation_id: external_exports.string().uuid().optional(),
|
|
16154
|
+
hub_user_id: external_exports.string().optional(),
|
|
16155
|
+
current_team_user_id: external_exports.string().optional()
|
|
16156
|
+
});
|
|
16157
|
+
navItemCountResetBody = external_exports.object({
|
|
16158
|
+
nav_item: navItemSchema
|
|
16159
|
+
});
|
|
16160
|
+
typingBody = external_exports.object({
|
|
16161
|
+
conversationId: external_exports.string().uuid(),
|
|
16162
|
+
hubId: external_exports.string().uuid(),
|
|
16163
|
+
action: external_exports.enum(["start", "stop"])
|
|
16164
|
+
});
|
|
16165
|
+
}
|
|
16166
|
+
});
|
|
16167
|
+
|
|
16168
|
+
// ../../packages/core/dist/chunk-YWZFB34T.js
|
|
16169
|
+
function cacheReconcileIdCount(body) {
|
|
16170
|
+
return body.conversations.length + body.histories.reduce((n, history) => n + history.conversation_ids.length, 0) + body.threads.length;
|
|
16171
|
+
}
|
|
16172
|
+
var CACHE_RECONCILE_MAX_IDS, CACHE_RECONCILE_MAX_HUBS, cacheReconcileScopeSchema, cachedConversationPageSchema, cachedHistoryThreadSchema, cachedPeopleThreadSchema, cacheReconcileBody;
|
|
16173
|
+
var init_chunk_YWZFB34T = __esm({
|
|
16174
|
+
"../../packages/core/dist/chunk-YWZFB34T.js"() {
|
|
16175
|
+
"use strict";
|
|
16176
|
+
init_chunk_PZPOUXJR();
|
|
16177
|
+
init_chunk_HZ6CADSY();
|
|
16178
|
+
init_zod();
|
|
16179
|
+
CACHE_RECONCILE_MAX_IDS = 300;
|
|
16180
|
+
CACHE_RECONCILE_MAX_HUBS = 15;
|
|
16181
|
+
cacheReconcileScopeSchema = navItemSchema;
|
|
16182
|
+
cachedConversationPageSchema = external_exports.object({
|
|
16183
|
+
conversation_id: uuidSchema,
|
|
16184
|
+
hub_id: uuidSchema,
|
|
16185
|
+
scope: cacheReconcileScopeSchema
|
|
16186
|
+
}).strict();
|
|
16187
|
+
cachedHistoryThreadSchema = external_exports.object({
|
|
16188
|
+
hub_id: uuidSchema,
|
|
16189
|
+
hub_user_id: external_exports.string().min(1).max(128),
|
|
16190
|
+
nav: cacheReconcileScopeSchema,
|
|
16191
|
+
conversation_ids: external_exports.array(uuidSchema).min(1).max(CACHE_RECONCILE_MAX_IDS)
|
|
16192
|
+
}).strict();
|
|
16193
|
+
cachedPeopleThreadSchema = external_exports.object({ thread_id: uuidSchema }).strict();
|
|
16194
|
+
cacheReconcileBody = external_exports.object({
|
|
16195
|
+
conversations: external_exports.array(cachedConversationPageSchema).max(CACHE_RECONCILE_MAX_IDS).default([]),
|
|
16196
|
+
histories: external_exports.array(cachedHistoryThreadSchema).max(CACHE_RECONCILE_MAX_IDS).default([]),
|
|
16197
|
+
threads: external_exports.array(cachedPeopleThreadSchema).max(CACHE_RECONCILE_MAX_IDS).default([])
|
|
16198
|
+
}).strict().superRefine((body, ctx) => {
|
|
16199
|
+
if (cacheReconcileIdCount(body) > CACHE_RECONCILE_MAX_IDS) {
|
|
16200
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `At most ${CACHE_RECONCILE_MAX_IDS} ids in all` });
|
|
15614
16201
|
}
|
|
15615
|
-
const
|
|
15616
|
-
if (
|
|
15617
|
-
|
|
15618
|
-
if (!caseDecisionsAllowed && decisions.some((decision) => !versionDecisions.has(decision))) return problem("item_decision_unknown", itemAt);
|
|
15619
|
-
const targets = item.item_links.depends_on;
|
|
15620
|
-
if (repeated(targets.map((target) => resolveItemLink(phase.folder, target).key))) return problem("item_link_repeated", itemAt);
|
|
15621
|
-
for (const target of targets) {
|
|
15622
|
-
const { folder, code: targetCode } = resolveItemLink(phase.folder, target);
|
|
15623
|
-
if (!itemsByFolder.get(folder)?.has(targetCode)) return problem("item_link_unknown", itemAt);
|
|
15624
|
-
if (folder === phase.folder && targetCode === item.code) return problem("item_link_self", itemAt);
|
|
16202
|
+
const hubs = new Set([...body.conversations, ...body.histories].map((entry) => entry.hub_id));
|
|
16203
|
+
if (hubs.size > CACHE_RECONCILE_MAX_HUBS) {
|
|
16204
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: `At most ${CACHE_RECONCILE_MAX_HUBS} distinct hubs` });
|
|
15625
16205
|
}
|
|
15626
|
-
}
|
|
15627
|
-
if (outputs.length === 0 && !tasks.some((task) => caseTaskRequired(phase, task))) return problem("phase_without_work", at);
|
|
16206
|
+
});
|
|
15628
16207
|
}
|
|
15629
|
-
|
|
15630
|
-
|
|
16208
|
+
});
|
|
16209
|
+
|
|
16210
|
+
// ../../packages/core/dist/chunk-7AFROLQL.js
|
|
16211
|
+
function openCaseProblem(body) {
|
|
16212
|
+
const pairs = /* @__PURE__ */ new Set();
|
|
16213
|
+
for (const [index, party] of body.parties.entries()) {
|
|
16214
|
+
const key = `${party.party_id}
|
|
16215
|
+
${party.role}`;
|
|
16216
|
+
if (pairs.has(key)) return { reason: "party_role_repeated", at: `parties.${index}` };
|
|
16217
|
+
pairs.add(key);
|
|
16218
|
+
}
|
|
16219
|
+
if (new Set(body.instrument_ids).size !== body.instrument_ids.length) return { reason: "instrument_repeated", at: "instrument_ids" };
|
|
15631
16220
|
return null;
|
|
15632
16221
|
}
|
|
15633
|
-
var
|
|
15634
|
-
var
|
|
15635
|
-
"../../packages/core/dist/chunk-
|
|
16222
|
+
var CASE_RECORD_CODE_PATTERN, CASE_RECORD_CODE_MAX_LENGTH, CASE_RECORD_PARTIES_MAX, CASE_RECORD_INSTRUMENTS_MAX, CASE_RECORD_ROLE_MAX_LENGTH, CASE_RECORDS_PAGE_MAX, CASE_RECORDS_QUERY_MAX_LENGTH, caseRecordPartySchema, openCaseShape, openCaseBody, caseRecordParam, caseRecordsQuery;
|
|
16223
|
+
var init_chunk_7AFROLQL = __esm({
|
|
16224
|
+
"../../packages/core/dist/chunk-7AFROLQL.js"() {
|
|
15636
16225
|
"use strict";
|
|
15637
|
-
|
|
15638
|
-
init_chunk_GSNOG25F();
|
|
16226
|
+
init_chunk_HSHKT7I6();
|
|
15639
16227
|
init_chunk_HZ6CADSY();
|
|
15640
16228
|
init_chunk_NYNOISIG();
|
|
15641
16229
|
init_zod();
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
|
|
15648
|
-
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
|
|
15652
|
-
CASE_REVIEW_MODES = ["none", "edit", "conduct", "team"];
|
|
15653
|
-
CASE_OUTPUT_FORMATS = ["document", "file"];
|
|
15654
|
-
CASE_INPUT_ORIGINS = ["collection", "previous_output", "received"];
|
|
15655
|
-
CASE_TEMPLATE_MODES = ["guide", "fixed"];
|
|
15656
|
-
CASE_AGENDA_QUORUMS = ["one", "all"];
|
|
15657
|
-
CASE_DECISION_TYPES = ["percent", "currency", "number", "date", "choice", "yes_no", "text"];
|
|
15658
|
-
CASE_NUMERIC_DECISION_TYPES = ["percent", "currency", "number"];
|
|
15659
|
-
CASE_TYPE_NAME_MAX_LENGTH = 200;
|
|
15660
|
-
CASE_CODE_MAX_LENGTH = 64;
|
|
15661
|
-
CASE_FILE_PATH_MAX_LENGTH = 256;
|
|
15662
|
-
CASE_FIXED_TEXT_MAX_LENGTH = 16 * 1024;
|
|
15663
|
-
CASE_TYPE_DEFINITION_MAX_CHARS = 256 * 1024;
|
|
15664
|
-
CASE_TYPE_DEFINITION_ROWS_MAX = 2e3;
|
|
15665
|
-
CASE_TYPE_VERSIONS_MAX = 200;
|
|
15666
|
-
CASE_TYPES_PAGE_MAX = 100;
|
|
15667
|
-
code = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_CODE_PATTERN);
|
|
15668
|
-
phaseCode = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_PHASE_CODE_PATTERN);
|
|
15669
|
-
inputKey = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_INPUT_KEY_PATTERN);
|
|
15670
|
-
agendaGroupCode = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_AGENDA_GROUP_CODE_PATTERN);
|
|
15671
|
-
decisionCode = external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_DECISION_CODE_PATTERN);
|
|
15672
|
-
label2 = (max) => external_exports.string().trim().min(1).max(max);
|
|
15673
|
-
optionalText = (max) => external_exports.string().trim().max(max).nullable().default(null).transform((text4) => text4 || null);
|
|
15674
|
-
itemLinkTarget = external_exports.string().max(CASE_CODE_MAX_LENGTH * 2 + 1).refine((target) => {
|
|
15675
|
-
const { folder, code: targetCode } = resolveItemLink("", target);
|
|
15676
|
-
return (!target.includes("/") || CASE_PHASE_FOLDER_PATTERN.test(folder)) && CASE_CODE_PATTERN.test(targetCode);
|
|
15677
|
-
}, "An item is named by its code, or by its phase folder and code");
|
|
15678
|
-
filePath = external_exports.string().min(1).max(CASE_FILE_PATH_MAX_LENGTH).refine((path45) => {
|
|
15679
|
-
const segments = (path45.endsWith("/") ? path45.slice(0, -1) : path45).split("/");
|
|
15680
|
-
return segments.length >= 2 && segments.length <= 8 && CASE_PHASE_FOLDER_PATTERN.test(segments[0]) && segments.slice(1).every((segment) => FILE_PATH_SEGMENT_PATTERN.test(segment));
|
|
15681
|
-
}, "A file path is the phase folder, then letters, digits, dots, dashes and underscores");
|
|
15682
|
-
caseTypePartyRoleSchema = external_exports.object({
|
|
15683
|
-
code,
|
|
15684
|
-
name: label2(200),
|
|
15685
|
-
required: external_exports.boolean().default(false),
|
|
15686
|
-
multiple: external_exports.boolean().default(false)
|
|
15687
|
-
}).strict();
|
|
15688
|
-
caseTypeOutcomeSchema = external_exports.object({ code, name: label2(200) }).strict();
|
|
15689
|
-
caseItemRequirementsSchema = external_exports.object({
|
|
15690
|
-
/** Keys of the phase's inputs the item must cite. */
|
|
15691
|
-
inputs: external_exports.array(inputKey).max(50).default([]),
|
|
15692
|
-
/** Names in `analysis/results.csv` the item must cite. */
|
|
15693
|
-
calculations: external_exports.array(external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_CALCULATION_CODE_PATTERN)).max(50).default([]),
|
|
15694
|
-
/** Codes of the version's agenda decisions the item must cite. */
|
|
15695
|
-
decisions: external_exports.array(decisionCode).max(50).default([])
|
|
15696
|
-
}).strict();
|
|
15697
|
-
caseItemLinksSchema = external_exports.object({
|
|
15698
|
-
/** Items of this version this one depends on, in any phase. Cycles are allowed: graph review's stop rule closes them. */
|
|
15699
|
-
depends_on: external_exports.array(itemLinkTarget).max(50).default([]),
|
|
15700
|
-
/** `all`: the item reflects every other item of its output (Rito's `reflete: todos`). */
|
|
15701
|
-
reflects: external_exports.literal("all").nullable().default(null)
|
|
15702
|
-
}).strict();
|
|
15703
|
-
caseOutputItemSchema = external_exports.object({
|
|
15704
|
-
code,
|
|
15705
|
-
title: label2(200),
|
|
15706
|
-
/** A heading that holds other items and has no text of its own. */
|
|
15707
|
-
grouping: external_exports.boolean().default(false),
|
|
15708
|
-
required: external_exports.boolean().default(true),
|
|
15709
|
-
waivable: external_exports.boolean().default(true),
|
|
15710
|
-
/** The code of the phase's task that writes it. */
|
|
15711
|
-
task: code.nullable().default(null),
|
|
15712
|
-
legal_basis: optionalText(2e3),
|
|
15713
|
-
template_mode: external_exports.enum(CASE_TEMPLATE_MODES).default("guide"),
|
|
15714
|
-
/** The item's text in `fixed` mode, and only there. */
|
|
15715
|
-
fixed_text: external_exports.string().max(CASE_FIXED_TEXT_MAX_LENGTH).nullable().default(null),
|
|
15716
|
-
item_requirements: caseItemRequirementsSchema.default({}),
|
|
15717
|
-
item_links: caseItemLinksSchema.default({})
|
|
15718
|
-
}).strict();
|
|
15719
|
-
casePhaseOutputSchema = external_exports.object({
|
|
15720
|
-
code,
|
|
15721
|
-
document_type: label2(200),
|
|
15722
|
-
required: external_exports.boolean().default(true),
|
|
15723
|
-
executive_approval: external_exports.boolean().default(false),
|
|
15724
|
-
/** `document` is written in Markdown and rendered; `file` (.xlsx, .pdf, .dwg, .dxf) is hashed as it came. */
|
|
15725
|
-
format: external_exports.enum(CASE_OUTPUT_FORMATS).default("document"),
|
|
15726
|
-
/** The piece's place in its phase's set. */
|
|
15727
|
-
position: external_exports.number().int().min(0).max(9999).default(0),
|
|
15728
|
-
/** How the piece is shown in its set, as `Annex I`. */
|
|
15729
|
-
label: optionalText(100),
|
|
15730
|
-
case_items_allowed: external_exports.boolean().default(false),
|
|
15731
|
-
/** The paths a file must have to be this output (or the same path under `conf/`: F5). */
|
|
15732
|
-
file_paths: external_exports.array(filePath).min(1).max(10),
|
|
15733
|
-
/** The teams whose Approve holders may approve it; none means any Approve holder reaching the case (F8). */
|
|
15734
|
-
approving_team_ids: external_exports.array(uuidSchema).max(20).default([]),
|
|
15735
|
-
output_items: external_exports.array(caseOutputItemSchema).max(200).default([])
|
|
15736
|
-
}).strict();
|
|
15737
|
-
casePhaseInputSchema = external_exports.object({
|
|
15738
|
-
key: inputKey,
|
|
15739
|
-
name: label2(200),
|
|
15740
|
-
origin: external_exports.enum(CASE_INPUT_ORIGINS),
|
|
15741
|
-
document_type: optionalText(200),
|
|
15742
|
-
required: external_exports.boolean().default(true)
|
|
15743
|
-
}).strict();
|
|
15744
|
-
caseDecisionOptionSchema = external_exports.object({
|
|
15745
|
-
code: external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_DECISION_OPTION_CODE_PATTERN),
|
|
15746
|
-
name: label2(200),
|
|
15747
|
-
/** `calc:{name}`: the result the option leads to, shown beside it. */
|
|
15748
|
-
effect: external_exports.string().max(CASE_CODE_MAX_LENGTH + 5).regex(CASE_DECISION_EFFECT_PATTERN).nullable().default(null)
|
|
16230
|
+
CASE_RECORD_CODE_PATTERN = new RegExp(`^${CASE_TYPE_ABBREVIATION_PATTERN.source.slice(1, -1)}-[0-9]{4}-[0-9]{4,}$`);
|
|
16231
|
+
CASE_RECORD_CODE_MAX_LENGTH = 32;
|
|
16232
|
+
CASE_RECORD_PARTIES_MAX = 50;
|
|
16233
|
+
CASE_RECORD_INSTRUMENTS_MAX = 50;
|
|
16234
|
+
CASE_RECORD_ROLE_MAX_LENGTH = 64;
|
|
16235
|
+
CASE_RECORDS_PAGE_MAX = 100;
|
|
16236
|
+
CASE_RECORDS_QUERY_MAX_LENGTH = 32;
|
|
16237
|
+
caseRecordPartySchema = external_exports.object({
|
|
16238
|
+
party_id: uuidSchema,
|
|
16239
|
+
role: external_exports.string().min(1).max(CASE_RECORD_ROLE_MAX_LENGTH)
|
|
15749
16240
|
}).strict();
|
|
15750
|
-
|
|
15751
|
-
|
|
15752
|
-
code:
|
|
15753
|
-
|
|
15754
|
-
|
|
15755
|
-
|
|
15756
|
-
|
|
15757
|
-
|
|
15758
|
-
min: decisionBound,
|
|
15759
|
-
max: decisionBound,
|
|
15760
|
-
options: external_exports.array(caseDecisionOptionSchema).max(50).default([]),
|
|
15761
|
-
required: external_exports.boolean().default(true)
|
|
15762
|
-
}).strict().transform((decision) => decision.decimals === null && (decision.type === "percent" || decision.type === "currency") ? { ...decision, decimals: 2 } : decision);
|
|
15763
|
-
caseAgendaGroupSchema = external_exports.object({
|
|
15764
|
-
code: agendaGroupCode,
|
|
15765
|
-
name: label2(200),
|
|
15766
|
-
/** The teams whose Approve holders approve the group, and dispense it (the plan keeps that with them). */
|
|
15767
|
-
approving_team_ids: external_exports.array(uuidSchema).max(20).default([]),
|
|
15768
|
-
quorum: external_exports.enum(CASE_AGENDA_QUORUMS).default("one"),
|
|
15769
|
-
required: external_exports.boolean().default(true),
|
|
16241
|
+
openCaseShape = external_exports.object({
|
|
16242
|
+
type_id: uuidSchema,
|
|
16243
|
+
/** The year in its code: within a year of today's year in the space's time zone. */
|
|
16244
|
+
year: external_exports.number().int().min(2e3).max(2100),
|
|
16245
|
+
parties: external_exports.array(caseRecordPartySchema).max(CASE_RECORD_PARTIES_MAX).default([]),
|
|
16246
|
+
instrument_ids: external_exports.array(uuidSchema).max(CASE_RECORD_INSTRUMENTS_MAX).default([]),
|
|
16247
|
+
/** The custom field values, checked against the version's schema in the space. */
|
|
16248
|
+
attributes: external_exports.record(external_exports.string(), external_exports.unknown()).default({}),
|
|
15770
16249
|
confidential: external_exports.boolean().default(false),
|
|
15771
|
-
|
|
15772
|
-
|
|
15773
|
-
}).strict();
|
|
15774
|
-
caseTypeTaskSchema = external_exports.object({
|
|
15775
|
-
code,
|
|
15776
|
-
name: label2(200),
|
|
15777
|
-
/** A task linked to an output, an input or an agenda group takes that one's `required` instead (Rito). */
|
|
15778
|
-
required: external_exports.boolean().default(false),
|
|
15779
|
-
/** The phase's output it completes with, by code. */
|
|
15780
|
-
output: code.nullable().default(null),
|
|
15781
|
-
/** The phase's input it completes with, by key. */
|
|
15782
|
-
input: inputKey.nullable().default(null),
|
|
15783
|
-
/** The phase's agenda group it completes with, by code: approved or dispensed. */
|
|
15784
|
-
agenda_group: agendaGroupCode.nullable().default(null),
|
|
15785
|
-
/** Tasks of the same phase it waits for, by code. */
|
|
15786
|
-
depends_on: external_exports.array(code).max(50).default([])
|
|
15787
|
-
}).strict();
|
|
15788
|
-
caseTypePhaseSchema = external_exports.object({
|
|
15789
|
-
code: phaseCode,
|
|
15790
|
-
folder: external_exports.string().max(CASE_CODE_MAX_LENGTH).regex(CASE_PHASE_FOLDER_PATTERN),
|
|
15791
|
-
name: label2(200),
|
|
15792
|
-
expected_documents: external_exports.string().trim().max(2e3).default(""),
|
|
15793
|
-
/** The phases it waits for, by code: delivered or dispensed. */
|
|
15794
|
-
depends_on: external_exports.array(phaseCode).max(50),
|
|
15795
|
-
optional: external_exports.boolean().default(false),
|
|
15796
|
-
on_demand: external_exports.boolean().default(false),
|
|
15797
|
-
joint_delivery: external_exports.boolean().default(false),
|
|
15798
|
-
review_mode: external_exports.enum(CASE_REVIEW_MODES).default("conduct"),
|
|
15799
|
-
/** The team that signs off, in `team` mode and only there. */
|
|
15800
|
-
review_team_id: uuidSchema.nullable().default(null),
|
|
15801
|
-
case_inputs_allowed: external_exports.boolean().default(false),
|
|
15802
|
-
phase_outputs: external_exports.array(casePhaseOutputSchema).max(30).default([]),
|
|
15803
|
-
phase_inputs: external_exports.array(casePhaseInputSchema).max(50).default([]),
|
|
15804
|
-
type_tasks: external_exports.array(caseTypeTaskSchema).max(100).default([]),
|
|
15805
|
-
agenda_groups: external_exports.array(caseAgendaGroupSchema).max(20).default([])
|
|
15806
|
-
}).strict();
|
|
15807
|
-
caseTypeDefinitionShape = external_exports.object({
|
|
15808
|
-
type_party_roles: external_exports.array(caseTypePartyRoleSchema).max(50).default([]),
|
|
15809
|
-
type_outcomes: external_exports.array(caseTypeOutcomeSchema).max(50).default([]),
|
|
15810
|
-
type_phases: external_exports.array(caseTypePhaseSchema).min(1).max(50),
|
|
15811
|
-
/** The JSON Schema of its cases' `attributes`: their custom fields. Absent, none. */
|
|
15812
|
-
attributes: caseAttributesSchemaSchema.default(() => ({ ...EMPTY_CASE_ATTRIBUTES_SCHEMA }))
|
|
16250
|
+
/** The code the opener was shown: another case holding it opens nothing. */
|
|
16251
|
+
expected_code: external_exports.string().max(CASE_RECORD_CODE_MAX_LENGTH).regex(CASE_RECORD_CODE_PATTERN).optional()
|
|
15813
16252
|
}).strict();
|
|
15814
|
-
|
|
15815
|
-
|
|
15816
|
-
const found = caseTypeDefinitionProblem(definition);
|
|
16253
|
+
openCaseBody = openCaseShape.superRefine((body, ctx) => {
|
|
16254
|
+
const found = openCaseProblem(body);
|
|
15817
16255
|
if (found) {
|
|
15818
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: found.reason, path: found.at.split("."), params: {
|
|
16256
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: found.reason, path: found.at.split("."), params: { case_record_reason: found.reason } });
|
|
15819
16257
|
}
|
|
15820
16258
|
});
|
|
15821
|
-
|
|
15822
|
-
|
|
15823
|
-
createCaseTypeBody = external_exports.object({
|
|
15824
|
-
abbreviation: caseTypeAbbreviationSchema,
|
|
15825
|
-
name: caseTypeNameSchema,
|
|
15826
|
-
definition: caseTypeDefinitionSchema
|
|
15827
|
-
}).strict();
|
|
15828
|
-
publishCaseTypeVersionBody = external_exports.object({
|
|
15829
|
-
expected_version: external_exports.number().int().min(1).max(CASE_TYPE_VERSIONS_MAX),
|
|
15830
|
-
name: caseTypeNameSchema,
|
|
15831
|
-
definition: caseTypeDefinitionSchema
|
|
15832
|
-
}).strict();
|
|
15833
|
-
setCaseTypeActiveBody = external_exports.object({ active: external_exports.boolean() }).strict();
|
|
15834
|
-
caseTypeParam = caseSpaceParam.extend({ type_id: uuidSchema });
|
|
15835
|
-
caseTypesPageQuery = casePageQuery.extend({
|
|
15836
|
-
limit: external_exports.coerce.number().int().min(1).max(CASE_TYPES_PAGE_MAX).optional()
|
|
16259
|
+
caseRecordParam = caseSpaceParam.extend({
|
|
16260
|
+
code: external_exports.string().max(CASE_RECORD_CODE_MAX_LENGTH).regex(CASE_RECORD_CODE_PATTERN)
|
|
15837
16261
|
});
|
|
15838
|
-
|
|
15839
|
-
|
|
16262
|
+
caseRecordsQuery = casePageQuery.extend({
|
|
16263
|
+
limit: external_exports.coerce.number().int().min(1).max(CASE_RECORDS_PAGE_MAX).optional(),
|
|
16264
|
+
type_id: uuidSchema.optional(),
|
|
16265
|
+
q: external_exports.string().trim().min(1).max(CASE_RECORDS_QUERY_MAX_LENGTH).optional()
|
|
15840
16266
|
});
|
|
15841
16267
|
}
|
|
15842
16268
|
});
|
|
15843
16269
|
|
|
15844
|
-
// ../../packages/core/dist/chunk-
|
|
15845
|
-
var
|
|
15846
|
-
var
|
|
15847
|
-
"../../packages/core/dist/chunk-
|
|
16270
|
+
// ../../packages/core/dist/chunk-2UXG7NGN.js
|
|
16271
|
+
var CASE_RELATION_TYPE_CODE_PATTERN, CASE_RELATION_TYPE_CODE_MAX_LENGTH, CASE_RELATION_TYPE_NAME_MAX_LENGTH, CASE_RELATION_TYPES_PER_SPACE_MAX, CASE_RELATION_DESCRIPTION_MAX_LENGTH, CASE_RELATION_SIDES, CASE_EXTERNAL_SYSTEM_PATTERN, CASE_EXTERNAL_NUMBER_MAX_LENGTH, CASE_EXTERNAL_URL_MAX_LENGTH, trimmedName2, relationTypeFields, createCaseRelationTypeBody, updateCaseRelationTypeBody, relateCasesBody, addCaseExternalReferenceBody, caseRelationTypeParam, caseRelationParam, caseExternalReferenceParam, caseRelationTypesQuery;
|
|
16272
|
+
var init_chunk_2UXG7NGN = __esm({
|
|
16273
|
+
"../../packages/core/dist/chunk-2UXG7NGN.js"() {
|
|
15848
16274
|
"use strict";
|
|
16275
|
+
init_chunk_7AFROLQL();
|
|
16276
|
+
init_chunk_HSHKT7I6();
|
|
15849
16277
|
init_chunk_HZ6CADSY();
|
|
15850
16278
|
init_zod();
|
|
15851
|
-
|
|
15852
|
-
|
|
15853
|
-
|
|
15854
|
-
|
|
15855
|
-
|
|
15856
|
-
|
|
15857
|
-
|
|
15858
|
-
|
|
15859
|
-
|
|
15860
|
-
|
|
15861
|
-
|
|
15862
|
-
|
|
15863
|
-
|
|
15864
|
-
|
|
15865
|
-
|
|
15866
|
-
|
|
15867
|
-
|
|
15868
|
-
|
|
15869
|
-
|
|
15870
|
-
|
|
15871
|
-
|
|
15872
|
-
|
|
15873
|
-
|
|
15874
|
-
|
|
15875
|
-
|
|
15876
|
-
|
|
15877
|
-
|
|
15878
|
-
|
|
15879
|
-
|
|
15880
|
-
|
|
15881
|
-
|
|
15882
|
-
|
|
15883
|
-
|
|
15884
|
-
client_message_id: external_exports.string().min(1).max(256).optional()
|
|
15885
|
-
}).refine((b) => !(b.external_ref && b.conversation_id), {
|
|
15886
|
-
message: "provide external_ref or conversation_id, not both",
|
|
15887
|
-
path: ["external_ref"]
|
|
15888
|
-
});
|
|
15889
|
-
appMessageBody = external_exports.object({
|
|
15890
|
-
// Message content — three historical aliases. All optional: an attachment-only
|
|
15891
|
-
// or voice-only message carries no text.
|
|
15892
|
-
content: clientOptionalString,
|
|
15893
|
-
message_text: clientOptionalString,
|
|
15894
|
-
message_body: clientOptionalString,
|
|
15895
|
-
// Conversation context. Ids are plain strings rather than `.uuid()` on purpose:
|
|
15896
|
-
// they are AUTHORIZED downstream, which is the stronger guarantee — a well-formed
|
|
15897
|
-
// uuid belonging to another tenant must fail just as hard as junk. `hub_id` is
|
|
15898
|
-
// gated by `assertHubEndUserAccess` (gh #3286) and `conversation_id` by HubDO's
|
|
15899
|
-
// conversation_index owner check (gh #2781, #3281). The route's own falsy guards
|
|
15900
|
-
// ('hub_id is required') still reject an empty one.
|
|
15901
|
-
hub_id: clientOptionalString,
|
|
15902
|
-
channel_id: clientOptionalString,
|
|
15903
|
-
conversation_id: clientOptionalString,
|
|
15904
|
-
hub_type: external_exports.enum(["chat", "task"]).nullish().transform((v) => v ?? void 0),
|
|
15905
|
-
// Stable idempotency key for one explicit task-hub launcher. HubDO scopes it
|
|
15906
|
-
// to the authenticated user and resolves retries/tabs to one conversation.
|
|
15907
|
-
task_start_id: external_exports.string().uuid().nullish().transform((v) => v ?? void 0),
|
|
15908
|
-
// Routing.
|
|
15909
|
-
sender_type: appMessageSenderType.nullish().transform((v) => v ?? void 0),
|
|
15910
|
-
receiver_type: appMessageReceiverType.nullish().transform((v) => v ?? void 0),
|
|
15911
|
-
// Only meaningful on a team send, where `validateAppTeamSendContext` proves the
|
|
15912
|
-
// caller may send to this receiver. Absent on a team send to a conversation with no
|
|
15913
|
-
// person, which names its `conversation_id` instead. The end-user branch ignores it —
|
|
15914
|
-
// see the receiver derivation in the route.
|
|
15915
|
-
user_receiver_id: clientOptionalString,
|
|
15916
|
-
// ── Internal consult (consultant-agents PR 2 — H1.0) ──────────────────────
|
|
15917
|
-
// A team member handling a customer conversation can tag a `consultant`-role
|
|
15918
|
-
// agent for a PRIVATE, team-only exchange that never reaches the customer. A
|
|
15919
|
-
// consult send is a team send with `receiver_type: 'agent'` targeting the
|
|
15920
|
-
// consultant; `user_receiver_id` identifies the customer whose conversation this is
|
|
15921
|
-
// (and is authorized by `validateAppTeamSendContext`, exactly as a team→user send is),
|
|
15922
|
-
// and is absent, as on a team→user send, when the conversation has no person. The consultant is resolved from `agent_receiver_id`
|
|
15923
|
-
// when supplied, else from an `@mention` parsed out of the message text against
|
|
15924
|
-
// the hub's consultant agents. `consult_thread_id` continues an existing thread;
|
|
15925
|
-
// absent, the route creates/reuses the single implicit thread. These fields are
|
|
15926
|
-
// inert on every non-consult send (end-user send, team→user send).
|
|
15927
|
-
agent_receiver_id: clientOptionalString,
|
|
15928
|
-
consult_thread_id: clientOptionalString,
|
|
15929
|
-
is_first_message: clientOptionalBoolean,
|
|
15930
|
-
end_conversation: clientOptionalBoolean,
|
|
15931
|
-
// Pre-generated by the client so the optimistic bubble and the stored row share
|
|
15932
|
-
// a key (transcription live-updates land on the same row instead of duplicating).
|
|
15933
|
-
message_id: clientOptionalString,
|
|
15934
|
-
attachments: external_exports.array(messageAttachment).max(MAX_ATTACHMENTS_PER_MESSAGE).nullish().transform((v) => v ?? void 0),
|
|
15935
|
-
// Base64-encoded audio for STT. Size-capped in the route (the cap is a byte
|
|
15936
|
-
// budget tied to the /channels/* bodyLimit, not a shape rule).
|
|
15937
|
-
audio_file: clientOptionalString
|
|
15938
|
-
});
|
|
15939
|
-
appMessageResponse = external_exports.object({
|
|
15940
|
-
success: external_exports.boolean(),
|
|
15941
|
-
message: external_exports.string(),
|
|
15942
|
-
result: external_exports.object({
|
|
15943
|
-
conversation_id: external_exports.string().optional(),
|
|
15944
|
-
message_id: external_exports.string().optional(),
|
|
15945
|
-
status: external_exports.string().optional(),
|
|
15946
|
-
files: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
|
|
15947
|
-
// True when this request reused a task-start/message id already accepted by
|
|
15948
|
-
// the server. Clients must replace their optimistic payload with a fresh
|
|
15949
|
-
// authoritative read because another tab may have won with different text.
|
|
15950
|
-
deduped: external_exports.boolean().optional()
|
|
15951
|
-
}).optional()
|
|
16279
|
+
CASE_RELATION_TYPE_CODE_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/;
|
|
16280
|
+
CASE_RELATION_TYPE_CODE_MAX_LENGTH = 64;
|
|
16281
|
+
CASE_RELATION_TYPE_NAME_MAX_LENGTH = 200;
|
|
16282
|
+
CASE_RELATION_TYPES_PER_SPACE_MAX = 100;
|
|
16283
|
+
CASE_RELATION_DESCRIPTION_MAX_LENGTH = 500;
|
|
16284
|
+
CASE_RELATION_SIDES = ["origin", "destination"];
|
|
16285
|
+
CASE_EXTERNAL_SYSTEM_PATTERN = /^[A-Za-z0-9][A-Za-z0-9 ._-]{0,30}$/;
|
|
16286
|
+
CASE_EXTERNAL_NUMBER_MAX_LENGTH = 120;
|
|
16287
|
+
CASE_EXTERNAL_URL_MAX_LENGTH = 2048;
|
|
16288
|
+
trimmedName2 = external_exports.string().trim().min(1).max(CASE_RELATION_TYPE_NAME_MAX_LENGTH);
|
|
16289
|
+
relationTypeFields = { name: trimmedName2, inverse_name: trimmedName2, active: external_exports.boolean().default(true) };
|
|
16290
|
+
createCaseRelationTypeBody = external_exports.object({
|
|
16291
|
+
code: external_exports.string().trim().max(CASE_RELATION_TYPE_CODE_MAX_LENGTH).regex(CASE_RELATION_TYPE_CODE_PATTERN),
|
|
16292
|
+
...relationTypeFields
|
|
16293
|
+
}).strict();
|
|
16294
|
+
updateCaseRelationTypeBody = external_exports.object({ ...relationTypeFields, expected_updated_at: timestampSchema.optional() }).strict();
|
|
16295
|
+
relateCasesBody = external_exports.object({
|
|
16296
|
+
relation_type_id: uuidSchema,
|
|
16297
|
+
other_code: external_exports.string().max(CASE_RECORD_CODE_MAX_LENGTH).regex(CASE_RECORD_CODE_PATTERN),
|
|
16298
|
+
/** This case's side: `origin` reads the type's name ("continues"), `destination` its inverse. */
|
|
16299
|
+
side: external_exports.enum(CASE_RELATION_SIDES).default("origin"),
|
|
16300
|
+
description: external_exports.string().trim().min(1).max(CASE_RELATION_DESCRIPTION_MAX_LENGTH).nullable().default(null)
|
|
16301
|
+
}).strict();
|
|
16302
|
+
addCaseExternalReferenceBody = external_exports.object({
|
|
16303
|
+
system: external_exports.string().trim().regex(CASE_EXTERNAL_SYSTEM_PATTERN),
|
|
16304
|
+
number: external_exports.string().trim().min(1).max(CASE_EXTERNAL_NUMBER_MAX_LENGTH),
|
|
16305
|
+
url: external_exports.string().trim().max(CASE_EXTERNAL_URL_MAX_LENGTH).url().refine((url) => url.startsWith("https://"), "An https link").nullable().default(null)
|
|
16306
|
+
}).strict();
|
|
16307
|
+
caseRelationTypeParam = caseSpaceParam.extend({ relation_type_id: uuidSchema });
|
|
16308
|
+
caseRelationParam = caseRecordParam.extend({ relation_id: uuidSchema });
|
|
16309
|
+
caseExternalReferenceParam = caseRecordParam.extend({ reference_id: uuidSchema });
|
|
16310
|
+
caseRelationTypesQuery = casePageQuery.extend({
|
|
16311
|
+
limit: external_exports.coerce.number().int().min(1).max(CASE_RELATION_TYPES_PER_SPACE_MAX).optional()
|
|
15952
16312
|
});
|
|
15953
16313
|
}
|
|
15954
16314
|
});
|
|
15955
16315
|
|
|
15956
|
-
// ../../packages/core/dist/chunk-
|
|
15957
|
-
|
|
15958
|
-
|
|
15959
|
-
|
|
16316
|
+
// ../../packages/core/dist/chunk-ABTVDD4T.js
|
|
16317
|
+
function addCaseNoteProblem(note) {
|
|
16318
|
+
return note.origin !== null && note.kind !== "contribution" ? { reason: "origin_not_contribution", at: "origin" } : null;
|
|
16319
|
+
}
|
|
16320
|
+
var CASE_NOTE_KINDS, CASE_NOTE_TEXT_MAX_LENGTH, CASE_NOTE_ORIGIN_MAX_LENGTH, CASE_NOTES_PAGE_MAX, addCaseNoteShape, addCaseNoteBody, caseNoteParam, caseTaskParam, caseNotesQuery;
|
|
16321
|
+
var init_chunk_ABTVDD4T = __esm({
|
|
16322
|
+
"../../packages/core/dist/chunk-ABTVDD4T.js"() {
|
|
15960
16323
|
"use strict";
|
|
16324
|
+
init_chunk_7AFROLQL();
|
|
16325
|
+
init_chunk_HSHKT7I6();
|
|
16326
|
+
init_chunk_HZ6CADSY();
|
|
15961
16327
|
init_zod();
|
|
15962
|
-
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
|
|
15967
|
-
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
|
|
15974
|
-
|
|
15975
|
-
|
|
15976
|
-
|
|
15977
|
-
|
|
15978
|
-
|
|
15979
|
-
// window). 'archived' = the full closed-conversation history from ClickHouse.
|
|
15980
|
-
status: external_exports.enum(["active", "agent", "team", "ended", "archived"]).optional(),
|
|
15981
|
-
page: external_exports.string().regex(/^\d+$/).optional(),
|
|
15982
|
-
page_size: external_exports.string().regex(/^\d+$/).optional()
|
|
16328
|
+
CASE_NOTE_KINDS = ["observation", "next_step", "pending", "contribution"];
|
|
16329
|
+
CASE_NOTE_TEXT_MAX_LENGTH = 64 * 1024;
|
|
16330
|
+
CASE_NOTE_ORIGIN_MAX_LENGTH = 200;
|
|
16331
|
+
CASE_NOTES_PAGE_MAX = 100;
|
|
16332
|
+
addCaseNoteShape = external_exports.object({
|
|
16333
|
+
kind: external_exports.enum(CASE_NOTE_KINDS),
|
|
16334
|
+
text: external_exports.string().trim().min(1).max(CASE_NOTE_TEXT_MAX_LENGTH),
|
|
16335
|
+
/** A contribution's external author. */
|
|
16336
|
+
origin: external_exports.string().trim().min(1).max(CASE_NOTE_ORIGIN_MAX_LENGTH).nullable().default(null),
|
|
16337
|
+
/** A phase of the case (its version's phase id). */
|
|
16338
|
+
phase_id: uuidSchema.nullable().default(null),
|
|
16339
|
+
/** A task of the case, whose phase the note takes. */
|
|
16340
|
+
case_task_id: uuidSchema.nullable().default(null)
|
|
16341
|
+
}).strict();
|
|
16342
|
+
addCaseNoteBody = addCaseNoteShape.superRefine((note, ctx) => {
|
|
16343
|
+
const found = addCaseNoteProblem(note);
|
|
16344
|
+
if (found) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: found.reason, path: [found.at], params: { case_note_reason: found.reason } });
|
|
15983
16345
|
});
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
conversation_id: external_exports.string().uuid().optional(),
|
|
15989
|
-
message_id: external_exports.string().uuid().optional(),
|
|
15990
|
-
// `page` = LEGACY oldest-first offset paging (deployed page-based clients).
|
|
15991
|
-
// Its PRESENCE selects the legacy read path server-side; a new client omits it
|
|
15992
|
-
// and instead sends `page_size` + (for older pages) the keyset cursor below.
|
|
15993
|
-
page: external_exports.string().regex(/^\d+$/).optional(),
|
|
15994
|
-
page_size: external_exports.string().regex(/^\d+$/).optional(),
|
|
15995
|
-
// Keyset cursor for the newest-first scroll (`page` absent): return only
|
|
15996
|
-
// messages strictly older than (before_created_at, before_message_id) — the
|
|
15997
|
-
// oldest currently-loaded VISIBLE message. UTC ISO-8601 (Timestamps standard);
|
|
15998
|
-
// `datetime()` hardens it before the parameterized DO predicate.
|
|
15999
|
-
before_created_at: external_exports.string().datetime().optional(),
|
|
16000
|
-
before_message_id: external_exports.string().uuid().optional(),
|
|
16001
|
-
/**
|
|
16002
|
-
* When true AND the caller has support access (hub admin or hub team member),
|
|
16003
|
-
* internal messages (tool calls, tool results) are included in the response.
|
|
16004
|
-
* Silently ignored for non-support callers — it's a view preference, not an
|
|
16005
|
-
* authorization boundary.
|
|
16006
|
-
*/
|
|
16007
|
-
include_internal: external_exports.union([external_exports.literal("true"), external_exports.literal("false"), external_exports.boolean()]).optional().transform((v) => v === true || v === "true")
|
|
16008
|
-
}).superRefine((q, ctx) => {
|
|
16009
|
-
if (q.before_created_at == null !== (q.before_message_id == null)) {
|
|
16010
|
-
ctx.addIssue({
|
|
16011
|
-
code: external_exports.ZodIssueCode.custom,
|
|
16012
|
-
message: "before_created_at and before_message_id must be provided together",
|
|
16013
|
-
path: [q.before_created_at == null ? "before_created_at" : "before_message_id"]
|
|
16014
|
-
});
|
|
16015
|
-
}
|
|
16346
|
+
caseNoteParam = caseRecordParam.extend({ note_id: uuidSchema });
|
|
16347
|
+
caseTaskParam = caseRecordParam.extend({ case_task_id: uuidSchema });
|
|
16348
|
+
caseNotesQuery = casePageQuery.extend({
|
|
16349
|
+
limit: external_exports.coerce.number().int().min(1).max(CASE_NOTES_PAGE_MAX).optional()
|
|
16016
16350
|
});
|
|
16017
16351
|
}
|
|
16018
16352
|
});
|
|
@@ -16760,14 +17094,14 @@ var init_chunk_R6Y377AW = __esm({
|
|
|
16760
17094
|
}
|
|
16761
17095
|
});
|
|
16762
17096
|
|
|
16763
|
-
// ../../packages/core/dist/chunk-
|
|
17097
|
+
// ../../packages/core/dist/chunk-YHQXIL22.js
|
|
16764
17098
|
var AUTOMATION_TRIGGER_TYPES, AUTOMATION_EVENT_TYPES, AUTOMATION_TARGET_TYPES, AUTOMATION_ACTION_TYPES, AUTOMATION_CHANNEL_TYPES, AUTOMATION_PURPOSES, AUTOMATION_NAME_MAX, AUTOMATION_DESCRIPTION_MAX, AUTOMATION_INSTRUCTIONS_MAX, AUTOMATION_TEXT_MAX, AUTOMATION_CRON_MAX, AUTOMATION_WEBHOOK_AUTHS, AUTOMATION_WEBHOOK_HEADERS, AUTOMATION_WEBHOOK_BODY_MAX_BYTES, AUTOMATION_WEBHOOK_HEADER_NAME_MAX, WEBHOOK_RESERVED_HEADERS, automationTriggerSchema, automationTargetSchema, automationActionSchema, automationGateSchema, automationName, automationDescription, automationIdParam, automationHubQuery, automationWebhookParams, AUTOMATION_RUNS_PAGE_MAX, listAutomationRunsQuery, createAutomationBody, updateAutomationBody, AUTOMATION_ALERT_CATEGORIES, AUTOMATION_BLOCKED_ALERT_CATEGORY, automationEventSubscriberParam;
|
|
16765
|
-
var
|
|
16766
|
-
"../../packages/core/dist/chunk-
|
|
17099
|
+
var init_chunk_YHQXIL22 = __esm({
|
|
17100
|
+
"../../packages/core/dist/chunk-YHQXIL22.js"() {
|
|
16767
17101
|
"use strict";
|
|
16768
17102
|
init_chunk_R6Y377AW();
|
|
16769
|
-
init_chunk_LYB5XDDT();
|
|
16770
17103
|
init_chunk_UAOHHCW5();
|
|
17104
|
+
init_chunk_LYB5XDDT();
|
|
16771
17105
|
init_chunk_5FO3GNKP();
|
|
16772
17106
|
init_chunk_JOOVAYGO();
|
|
16773
17107
|
init_chunk_NYNOISIG();
|
|
@@ -17000,17 +17334,16 @@ var init_chunk_B6PT7ZSX = __esm({
|
|
|
17000
17334
|
var init_contracts = __esm({
|
|
17001
17335
|
"../../packages/core/dist/contracts/index.js"() {
|
|
17002
17336
|
"use strict";
|
|
17003
|
-
init_chunk_YVY2TZK2();
|
|
17004
|
-
init_chunk_VXEAR36B();
|
|
17005
17337
|
init_chunk_RACEDHG6();
|
|
17006
17338
|
init_chunk_Q7KIQHAZ();
|
|
17007
|
-
init_chunk_HA7CRZMX();
|
|
17008
17339
|
init_chunk_IPXBFWUU();
|
|
17009
17340
|
init_chunk_NKLVUTFO();
|
|
17010
17341
|
init_chunk_6JOESMU5();
|
|
17011
|
-
|
|
17342
|
+
init_chunk_YVY2TZK2();
|
|
17343
|
+
init_chunk_VXEAR36B();
|
|
17012
17344
|
init_chunk_HIGKBEPF();
|
|
17013
|
-
|
|
17345
|
+
init_chunk_HA7CRZMX();
|
|
17346
|
+
init_chunk_MF2VVXBR();
|
|
17014
17347
|
init_chunk_WE4KMHZK();
|
|
17015
17348
|
init_chunk_P5GJNS5R();
|
|
17016
17349
|
init_chunk_HE5RU7KY();
|
|
@@ -17019,48 +17352,54 @@ var init_contracts = __esm({
|
|
|
17019
17352
|
init_chunk_5DGHIY7L();
|
|
17020
17353
|
init_chunk_2FWVCLBC();
|
|
17021
17354
|
init_chunk_IPDOHAZ5();
|
|
17022
|
-
|
|
17355
|
+
init_chunk_PFGVH2CX();
|
|
17023
17356
|
init_chunk_FPSDNS2E();
|
|
17024
17357
|
init_chunk_MI4UV5EU();
|
|
17025
17358
|
init_chunk_SGQ5NQ5K();
|
|
17026
17359
|
init_chunk_ZXK6N2HN();
|
|
17027
17360
|
init_chunk_Y7CFCYX4();
|
|
17028
|
-
init_chunk_KMAC3O3L();
|
|
17029
17361
|
init_chunk_YUZFHVB2();
|
|
17030
17362
|
init_chunk_I3O2RACG();
|
|
17031
17363
|
init_chunk_CMRECH67();
|
|
17032
|
-
|
|
17364
|
+
init_chunk_34LE6P7E();
|
|
17033
17365
|
init_chunk_IR2NOSI3();
|
|
17034
17366
|
init_chunk_OPETF4GS();
|
|
17035
17367
|
init_chunk_SY6PLCPK();
|
|
17036
|
-
|
|
17037
|
-
init_chunk_ACGAI25T();
|
|
17368
|
+
init_chunk_KMAC3O3L();
|
|
17038
17369
|
init_chunk_MH4O3YEX();
|
|
17039
17370
|
init_chunk_4B7VQDLJ();
|
|
17040
17371
|
init_chunk_KSTYTQ7I();
|
|
17041
17372
|
init_chunk_LKBSHANA();
|
|
17042
17373
|
init_chunk_I2EVH3FR();
|
|
17043
|
-
|
|
17044
|
-
init_chunk_CZS5NGTA();
|
|
17045
|
-
init_chunk_P74ESVOL();
|
|
17046
|
-
init_chunk_FBPEQNEM();
|
|
17047
|
-
init_chunk_2YEGUQR7();
|
|
17048
|
-
init_chunk_SDOG6762();
|
|
17049
|
-
init_chunk_JDJ4EUOL();
|
|
17374
|
+
init_chunk_C4HEZ7ZI();
|
|
17050
17375
|
init_chunk_UCYWGWQT();
|
|
17051
17376
|
init_chunk_6AYIXGDT();
|
|
17052
17377
|
init_chunk_YULHXJ5M();
|
|
17053
17378
|
init_chunk_V4FRPRH5();
|
|
17379
|
+
init_chunk_LWMLR2WI();
|
|
17380
|
+
init_chunk_ACGAI25T();
|
|
17381
|
+
init_chunk_5SLZ72VE();
|
|
17382
|
+
init_chunk_CXKQ2DHH();
|
|
17383
|
+
init_chunk_W2WIKWPX();
|
|
17384
|
+
init_chunk_7CYHPF35();
|
|
17385
|
+
init_chunk_NETRUHZF();
|
|
17386
|
+
init_chunk_BAVTYKY7();
|
|
17387
|
+
init_chunk_CZS5NGTA();
|
|
17388
|
+
init_chunk_P74ESVOL();
|
|
17389
|
+
init_chunk_JKOMP2G3();
|
|
17390
|
+
init_chunk_SDOG6762();
|
|
17391
|
+
init_chunk_2YEGUQR7();
|
|
17392
|
+
init_chunk_JDJ4EUOL();
|
|
17054
17393
|
init_chunk_YWZFB34T();
|
|
17055
17394
|
init_chunk_PZPOUXJR();
|
|
17056
17395
|
init_chunk_LBDH7LCG();
|
|
17057
17396
|
init_chunk_4LXDRTO4();
|
|
17058
17397
|
init_chunk_E4DIIOOE();
|
|
17059
|
-
init_chunk_PDN3YARH();
|
|
17060
17398
|
init_chunk_FOFCV4SW();
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17399
|
+
init_chunk_2UXG7NGN();
|
|
17400
|
+
init_chunk_ABTVDD4T();
|
|
17401
|
+
init_chunk_7AFROLQL();
|
|
17402
|
+
init_chunk_HSHKT7I6();
|
|
17064
17403
|
init_chunk_NVKU5PPQ();
|
|
17065
17404
|
init_chunk_B6GNOJ6J();
|
|
17066
17405
|
init_chunk_FECLIZTY();
|
|
@@ -17070,18 +17409,19 @@ var init_contracts = __esm({
|
|
|
17070
17409
|
init_chunk_D3EP4TDU();
|
|
17071
17410
|
init_chunk_X5PZZVTS();
|
|
17072
17411
|
init_chunk_BCN7SKBT();
|
|
17412
|
+
init_chunk_OMPT4ZHR();
|
|
17073
17413
|
init_chunk_2PZIF56U();
|
|
17074
17414
|
init_chunk_UEJOG2Q7();
|
|
17075
17415
|
init_chunk_KEN2DASI();
|
|
17076
|
-
|
|
17416
|
+
init_chunk_YHQXIL22();
|
|
17077
17417
|
init_chunk_R6Y377AW();
|
|
17078
|
-
init_chunk_LYB5XDDT();
|
|
17079
17418
|
init_chunk_UAOHHCW5();
|
|
17419
|
+
init_chunk_LYB5XDDT();
|
|
17080
17420
|
init_chunk_ULQGJUXZ();
|
|
17081
|
-
|
|
17421
|
+
init_chunk_VYINA6YP();
|
|
17082
17422
|
init_chunk_EJRDF5B6();
|
|
17083
|
-
init_chunk_7DLTG7J5();
|
|
17084
17423
|
init_chunk_SOJMWM63();
|
|
17424
|
+
init_chunk_7DLTG7J5();
|
|
17085
17425
|
init_chunk_5FO3GNKP();
|
|
17086
17426
|
init_chunk_IBL7FANV();
|
|
17087
17427
|
init_chunk_S4VDZ7PZ();
|
|
@@ -17244,8 +17584,8 @@ var init_dist = __esm({
|
|
|
17244
17584
|
"../../packages/core/dist/index.js"() {
|
|
17245
17585
|
"use strict";
|
|
17246
17586
|
init_chunk_EJRDF5B6();
|
|
17247
|
-
init_chunk_7DLTG7J5();
|
|
17248
17587
|
init_chunk_SOJMWM63();
|
|
17588
|
+
init_chunk_7DLTG7J5();
|
|
17249
17589
|
init_chunk_5FO3GNKP();
|
|
17250
17590
|
init_chunk_IBL7FANV();
|
|
17251
17591
|
init_chunk_S4VDZ7PZ();
|
|
@@ -18503,7 +18843,7 @@ var init_utils = __esm({
|
|
|
18503
18843
|
["admin cases enable", { positionals: 0 }],
|
|
18504
18844
|
["admin cases disable", { positionals: 0 }],
|
|
18505
18845
|
["admin cases status", { positionals: 0 }],
|
|
18506
|
-
["admin cases create", { positionals: 0, values: ["--org", "--name"] }],
|
|
18846
|
+
["admin cases create", { positionals: 0, values: ["--org", "--name", "--timezone"] }],
|
|
18507
18847
|
["admin communities enable", { positionals: 0 }],
|
|
18508
18848
|
["admin communities disable", { positionals: 0 }],
|
|
18509
18849
|
["admin communities status", { positionals: 0 }],
|
|
@@ -22479,9 +22819,9 @@ var init_pages2 = __esm({
|
|
|
22479
22819
|
var init_evals = __esm({
|
|
22480
22820
|
"../../packages/core/dist/contracts/evals.js"() {
|
|
22481
22821
|
"use strict";
|
|
22482
|
-
|
|
22483
|
-
init_chunk_2YEGUQR7();
|
|
22822
|
+
init_chunk_JKOMP2G3();
|
|
22484
22823
|
init_chunk_SDOG6762();
|
|
22824
|
+
init_chunk_2YEGUQR7();
|
|
22485
22825
|
init_chunk_4LXDRTO4();
|
|
22486
22826
|
init_chunk_7DLTG7J5();
|
|
22487
22827
|
init_chunk_KB5RK3RP();
|
|
@@ -23507,12 +23847,12 @@ var init_hub_materializer = __esm({
|
|
|
23507
23847
|
var init_ci = __esm({
|
|
23508
23848
|
"../../packages/core/dist/contracts/ci.js"() {
|
|
23509
23849
|
"use strict";
|
|
23510
|
-
|
|
23850
|
+
init_chunk_BAVTYKY7();
|
|
23511
23851
|
init_chunk_CZS5NGTA();
|
|
23512
23852
|
init_chunk_P74ESVOL();
|
|
23513
|
-
|
|
23514
|
-
init_chunk_2YEGUQR7();
|
|
23853
|
+
init_chunk_JKOMP2G3();
|
|
23515
23854
|
init_chunk_SDOG6762();
|
|
23855
|
+
init_chunk_2YEGUQR7();
|
|
23516
23856
|
init_chunk_LBDH7LCG();
|
|
23517
23857
|
init_chunk_4LXDRTO4();
|
|
23518
23858
|
init_chunk_CMCATTHI();
|
|
@@ -38393,7 +38733,7 @@ var init_vault_import = __esm({
|
|
|
38393
38733
|
});
|
|
38394
38734
|
|
|
38395
38735
|
// ../../packages/core/dist/contracts/vault.js
|
|
38396
|
-
var vaultIdSchema, vaultFailureOutcomeSchema, vaultRefreshCategorySchema, vaultFailureBodySchema, vaultSendEnvelopeSchema, vaultVerifyEnvelopeSchema, vaultAutomationHmacEnvelopeSchema, vaultAutomationStaticEnvelopeSchema, AUTOMATION_WEBHOOK_VAULT_GATE_ID, vaultVerifyResponseSchema, vaultVersionSchema, vaultPutResponseSchema, vaultMetaResponseSchema, vaultDeleteResponseSchema, vaultInstantSchema, vaultRefreshResponseSchema;
|
|
38736
|
+
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;
|
|
38397
38737
|
var init_vault = __esm({
|
|
38398
38738
|
"../../packages/core/dist/contracts/vault.js"() {
|
|
38399
38739
|
"use strict";
|
|
@@ -38451,6 +38791,7 @@ var init_vault = __esm({
|
|
|
38451
38791
|
}).strict();
|
|
38452
38792
|
vaultAutomationStaticEnvelopeSchema = external_exports.object({}).strict();
|
|
38453
38793
|
AUTOMATION_WEBHOOK_VAULT_GATE_ID = "c2d6f1a4-7e3b-4f1a-9b8d-6a1f4e7c3b20";
|
|
38794
|
+
GITHUB_APP_VAULT_GATE_ID = "fff3a999-e46a-483d-a50b-ab9d01bcb707";
|
|
38454
38795
|
vaultVerifyResponseSchema = external_exports.object({});
|
|
38455
38796
|
vaultVersionSchema = external_exports.number().int().positive();
|
|
38456
38797
|
vaultPutResponseSchema = external_exports.object({ version: vaultVersionSchema });
|
|
@@ -38458,6 +38799,7 @@ var init_vault = __esm({
|
|
|
38458
38799
|
vaultDeleteResponseSchema = external_exports.object({});
|
|
38459
38800
|
vaultInstantSchema = external_exports.string().regex(ISO_UTC_RE);
|
|
38460
38801
|
vaultRefreshResponseSchema = external_exports.object({ version: vaultVersionSchema, expires_at: vaultInstantSchema.nullable() });
|
|
38802
|
+
vaultMintResponseSchema = external_exports.object({ token: external_exports.string().min(1), expires_at: vaultInstantSchema });
|
|
38461
38803
|
}
|
|
38462
38804
|
});
|
|
38463
38805
|
|
|
@@ -40017,9 +40359,10 @@ async function runCasesToggle(enable, flagArgs) {
|
|
|
40017
40359
|
console.log(PLATFORM_CONFIG_PROPAGATION_NOTE);
|
|
40018
40360
|
}
|
|
40019
40361
|
async function runCasesCreate(flagArgs) {
|
|
40020
|
-
const usage3 = "wayai admin cases create --org <org_id> --name <name> [--json]";
|
|
40362
|
+
const usage3 = "wayai admin cases create --org <org_id> --name <name> [--timezone <zone>] [--json]";
|
|
40021
40363
|
let orgId;
|
|
40022
40364
|
let name;
|
|
40365
|
+
let timezone;
|
|
40023
40366
|
let jsonOutput = false;
|
|
40024
40367
|
for (let i = 0; i < flagArgs.length; i++) {
|
|
40025
40368
|
const flag = flagArgs[i];
|
|
@@ -40029,6 +40372,9 @@ async function runCasesCreate(flagArgs) {
|
|
|
40029
40372
|
} else if (flag === "--name") {
|
|
40030
40373
|
name = requireFlagValue(flagArgs, i + 1, "--name");
|
|
40031
40374
|
i++;
|
|
40375
|
+
} else if (flag === "--timezone") {
|
|
40376
|
+
timezone = requireFlagValue(flagArgs, i + 1, "--timezone");
|
|
40377
|
+
i++;
|
|
40032
40378
|
} else if (flag === "--json") {
|
|
40033
40379
|
jsonOutput = true;
|
|
40034
40380
|
} else {
|
|
@@ -40037,7 +40383,7 @@ async function runCasesCreate(flagArgs) {
|
|
|
40037
40383
|
process.exit(1);
|
|
40038
40384
|
}
|
|
40039
40385
|
}
|
|
40040
|
-
const parsed = adminCreateCaseSpaceBody.safeParse({ org_id: orgId, name });
|
|
40386
|
+
const parsed = adminCreateCaseSpaceBody.safeParse({ org_id: orgId, name, ...timezone !== void 0 ? { timezone } : {} });
|
|
40041
40387
|
if (!parsed.success) {
|
|
40042
40388
|
console.error(parsed.error.issues.map((issue) => `--${issue.path[0] === "org_id" ? "org" : issue.path[0]}: ${issue.message}`).join("\n"));
|
|
40043
40389
|
console.error(usage3);
|
|
@@ -40068,7 +40414,7 @@ async function runCasesCreate(flagArgs) {
|
|
|
40068
40414
|
console.log(JSON.stringify(data, null, 2));
|
|
40069
40415
|
return;
|
|
40070
40416
|
}
|
|
40071
|
-
console.log(`Created case space ${data.space_id} \u2014 "${data.name}", of organization ${data.org_id}. Its owner administers it.`);
|
|
40417
|
+
console.log(`Created case space ${data.space_id} \u2014 "${data.name}", of organization ${data.org_id}, in ${data.timezone}. Its owner administers it.`);
|
|
40072
40418
|
}
|
|
40073
40419
|
async function runCommunitiesToggle(enable, flagArgs) {
|
|
40074
40420
|
await runPlatformGateToggle(COMMUNITIES_GATE, enable, flagArgs);
|
|
@@ -41050,8 +41396,8 @@ Usage:
|
|
|
41050
41396
|
wayai admin cases enable Flip the platform cases_enabled kill switch ON
|
|
41051
41397
|
wayai admin cases disable Flip it OFF
|
|
41052
41398
|
wayai admin cases status Print the kill switch
|
|
41053
|
-
wayai admin cases create --org <org_id> --name <name> [--json]
|
|
41054
|
-
Create a case space of the org, which its owner administers; works while the switch is OFF
|
|
41399
|
+
wayai admin cases create --org <org_id> --name <name> [--timezone <zone>] [--json]
|
|
41400
|
+
Create a case space of the org, which its owner administers, in an IANA zone (default ${CASE_SPACE_DEFAULT_TIME_ZONE}); works while the switch is OFF
|
|
41055
41401
|
|
|
41056
41402
|
wayai admin communities enable Flip the platform communities_enabled kill switch ON (members reach communities while threads is ON too)
|
|
41057
41403
|
wayai admin communities disable Flip it OFF: no member reaches a community
|
|
@@ -41309,7 +41655,8 @@ var init_admin = __esm({
|
|
|
41309
41655
|
["typesafe", ["0da558b0-e4b6-43f4-b945-aeaf432965e2"]],
|
|
41310
41656
|
["automation_webhook", [AUTOMATION_WEBHOOK_VAULT_GATE_ID]],
|
|
41311
41657
|
["resend", ["a1b2c3d4-e5f6-4a89-b012-3e5e0d000001"]],
|
|
41312
|
-
["claude_managed_agents", ["4b8eeecf-a835-444a-abed-516d0a29cee2"]]
|
|
41658
|
+
["claude_managed_agents", ["4b8eeecf-a835-444a-abed-516d0a29cee2"]],
|
|
41659
|
+
["github_app", [GITHUB_APP_VAULT_GATE_ID]]
|
|
41313
41660
|
]);
|
|
41314
41661
|
VAULT_GATE_BY_ID_ONLY = /* @__PURE__ */ new Map([
|
|
41315
41662
|
["01e7b19c-bc94-43f4-a780-ad5a22fb7127", "openai"]
|