@wayai/cli 0.3.367 → 0.3.369
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 +1345 -996
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -239,8 +239,8 @@ var init_mask_secrets = __esm({
|
|
|
239
239
|
FULLY_MASKED_VALUE_RE = /^(?:(?:Bearer|Basic)\s+)?(?:way_|wst_|rec_)?\[REDACTED(?:_JWT|_BASE64)?\]$/;
|
|
240
240
|
isCredentialKey = (key) => CREDENTIAL_KEY_RE.test(key);
|
|
241
241
|
isBase64UrlChar = (char) => {
|
|
242
|
-
const
|
|
243
|
-
return
|
|
242
|
+
const code3 = char.charCodeAt(0);
|
|
243
|
+
return code3 >= 48 && code3 <= 57 || code3 >= 65 && code3 <= 90 || code3 >= 97 && code3 <= 122 || char === "-" || char === "_";
|
|
244
244
|
};
|
|
245
245
|
SHAPE_PATTERNS = [
|
|
246
246
|
// way_ scoped API tokens (keyring/CI credentials). Leading \b avoids
|
|
@@ -328,16 +328,16 @@ var init_mask_secrets = __esm({
|
|
|
328
328
|
// src/lib/network-error.ts
|
|
329
329
|
function errorCode(value) {
|
|
330
330
|
if (value && typeof value === "object" && "code" in value) {
|
|
331
|
-
const
|
|
332
|
-
if (typeof
|
|
331
|
+
const code3 = value.code;
|
|
332
|
+
if (typeof code3 === "string") return code3;
|
|
333
333
|
}
|
|
334
334
|
return void 0;
|
|
335
335
|
}
|
|
336
336
|
function isNetworkError(err) {
|
|
337
337
|
if (err instanceof TypeError && err.message === "fetch failed") return true;
|
|
338
338
|
if (!err || typeof err !== "object") return false;
|
|
339
|
-
const
|
|
340
|
-
return
|
|
339
|
+
const code3 = errorCode(err) ?? errorCode(err.cause);
|
|
340
|
+
return code3 !== void 0 && NETWORK_ERROR_CODES.has(code3);
|
|
341
341
|
}
|
|
342
342
|
var NETWORK_ERROR_CODES;
|
|
343
343
|
var init_network_error = __esm({
|
|
@@ -588,9 +588,9 @@ var init_chunk_ICYO56QW = __esm({
|
|
|
588
588
|
init_chunk_WFQDSQJK();
|
|
589
589
|
APP_ERROR_BRAND = /* @__PURE__ */ Symbol.for("wayai.AppError");
|
|
590
590
|
AppError = class extends Error {
|
|
591
|
-
constructor(message,
|
|
591
|
+
constructor(message, code3, statusCode = 500, details) {
|
|
592
592
|
super(message);
|
|
593
|
-
this.code =
|
|
593
|
+
this.code = code3;
|
|
594
594
|
this.statusCode = statusCode;
|
|
595
595
|
this.details = details;
|
|
596
596
|
this.name = "AppError";
|
|
@@ -5113,6 +5113,19 @@ var init_fs_safety = __esm({
|
|
|
5113
5113
|
}
|
|
5114
5114
|
});
|
|
5115
5115
|
|
|
5116
|
+
// ../../packages/core/dist/chunk-AYLAGFAD.js
|
|
5117
|
+
var BASE_CREDENTIAL_NAME_MAX, BASE_CREDENTIAL_NAME_PATTERN, BASE_CREDENTIAL_NAME_CHARSET, baseCredentialNameSchema;
|
|
5118
|
+
var init_chunk_AYLAGFAD = __esm({
|
|
5119
|
+
"../../packages/core/dist/chunk-AYLAGFAD.js"() {
|
|
5120
|
+
"use strict";
|
|
5121
|
+
init_zod();
|
|
5122
|
+
BASE_CREDENTIAL_NAME_MAX = 100;
|
|
5123
|
+
BASE_CREDENTIAL_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:@+~=-]*$/;
|
|
5124
|
+
BASE_CREDENTIAL_NAME_CHARSET = "letters, digits and '. _ : @ + ~ = -', starting with a letter or digit";
|
|
5125
|
+
baseCredentialNameSchema = external_exports.string().min(1).max(BASE_CREDENTIAL_NAME_MAX).regex(BASE_CREDENTIAL_NAME_PATTERN, `name must use ${BASE_CREDENTIAL_NAME_CHARSET}`);
|
|
5126
|
+
}
|
|
5127
|
+
});
|
|
5128
|
+
|
|
5116
5129
|
// ../../packages/core/dist/chunk-MIWZOSPI.js
|
|
5117
5130
|
function toIso(epochMs) {
|
|
5118
5131
|
return new Date(epochMs).toISOString();
|
|
@@ -6326,19 +6339,6 @@ var init_chunk_63UWXV4T = __esm({
|
|
|
6326
6339
|
}
|
|
6327
6340
|
});
|
|
6328
6341
|
|
|
6329
|
-
// ../../packages/core/dist/chunk-AYLAGFAD.js
|
|
6330
|
-
var BASE_CREDENTIAL_NAME_MAX, BASE_CREDENTIAL_NAME_PATTERN, BASE_CREDENTIAL_NAME_CHARSET, baseCredentialNameSchema;
|
|
6331
|
-
var init_chunk_AYLAGFAD = __esm({
|
|
6332
|
-
"../../packages/core/dist/chunk-AYLAGFAD.js"() {
|
|
6333
|
-
"use strict";
|
|
6334
|
-
init_zod();
|
|
6335
|
-
BASE_CREDENTIAL_NAME_MAX = 100;
|
|
6336
|
-
BASE_CREDENTIAL_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:@+~=-]*$/;
|
|
6337
|
-
BASE_CREDENTIAL_NAME_CHARSET = "letters, digits and '. _ : @ + ~ = -', starting with a letter or digit";
|
|
6338
|
-
baseCredentialNameSchema = external_exports.string().min(1).max(BASE_CREDENTIAL_NAME_MAX).regex(BASE_CREDENTIAL_NAME_PATTERN, `name must use ${BASE_CREDENTIAL_NAME_CHARSET}`);
|
|
6339
|
-
}
|
|
6340
|
-
});
|
|
6341
|
-
|
|
6342
6342
|
// ../../packages/core/dist/chunk-ZC6YGHNX.js
|
|
6343
6343
|
var updateUserBody, updateProfileBody, pathnameRegex, updatePreferencesBody, registerPushTokenBody, deletePushTokenQuery, recordAiDisclosureAcceptanceBody, activityQuery, deletionModeSchema, deletionRequestBody;
|
|
6344
6344
|
var init_chunk_ZC6YGHNX = __esm({
|
|
@@ -6809,6 +6809,34 @@ var init_chunk_ZVXO3XL6 = __esm({
|
|
|
6809
6809
|
}
|
|
6810
6810
|
});
|
|
6811
6811
|
|
|
6812
|
+
// ../../packages/core/dist/chunk-ZXK6N2HN.js
|
|
6813
|
+
var PEOPLE_MODERATION_NOTE_MAX_LENGTH, ADMIN_PEOPLE_REPORTS_PAGE_MAX, ADMIN_PEOPLE_REPORTS_PAGE_DEFAULT, PEOPLE_SUSPENDED_REASON, peopleModerationActionSchema, moderationNoteSchema, adminPeopleReportListQuery, adminPeopleReportIdParam, adminPeopleMessageRemovalBody, adminPeopleSuspendBody, adminPeopleNoteBody;
|
|
6814
|
+
var init_chunk_ZXK6N2HN = __esm({
|
|
6815
|
+
"../../packages/core/dist/chunk-ZXK6N2HN.js"() {
|
|
6816
|
+
"use strict";
|
|
6817
|
+
init_chunk_ZVXO3XL6();
|
|
6818
|
+
init_chunk_HZ6CADSY();
|
|
6819
|
+
init_zod();
|
|
6820
|
+
PEOPLE_MODERATION_NOTE_MAX_LENGTH = 500;
|
|
6821
|
+
ADMIN_PEOPLE_REPORTS_PAGE_MAX = 100;
|
|
6822
|
+
ADMIN_PEOPLE_REPORTS_PAGE_DEFAULT = 50;
|
|
6823
|
+
PEOPLE_SUSPENDED_REASON = "suspended";
|
|
6824
|
+
peopleModerationActionSchema = external_exports.enum(["remove_message", "suspend", "unsuspend", "dismiss"]);
|
|
6825
|
+
moderationNoteSchema = optionalTrimmedText(PEOPLE_MODERATION_NOTE_MAX_LENGTH);
|
|
6826
|
+
adminPeopleReportListQuery = external_exports.object({
|
|
6827
|
+
pending: external_exports.enum(["true", "false"]).optional().transform((value) => value === "true"),
|
|
6828
|
+
/** Lower bound on `created_at`. */
|
|
6829
|
+
since: timestampSchema.optional(),
|
|
6830
|
+
limit: external_exports.coerce.number().int().min(1).max(ADMIN_PEOPLE_REPORTS_PAGE_MAX).default(ADMIN_PEOPLE_REPORTS_PAGE_DEFAULT),
|
|
6831
|
+
offset: external_exports.coerce.number().int().min(0).default(0)
|
|
6832
|
+
});
|
|
6833
|
+
adminPeopleReportIdParam = external_exports.object({ reportId: uuidSchema });
|
|
6834
|
+
adminPeopleMessageRemovalBody = external_exports.object({ report_id: uuidSchema, message_id: uuidSchema.optional(), note: moderationNoteSchema }).strict();
|
|
6835
|
+
adminPeopleSuspendBody = external_exports.object({ report_id: uuidSchema.optional(), note: moderationNoteSchema }).strict();
|
|
6836
|
+
adminPeopleNoteBody = external_exports.object({ note: moderationNoteSchema }).strict();
|
|
6837
|
+
}
|
|
6838
|
+
});
|
|
6839
|
+
|
|
6812
6840
|
// ../../packages/core/dist/chunk-Y7CFCYX4.js
|
|
6813
6841
|
var PEOPLE_REPORT_DETAILS_MAX_LENGTH, peopleReportReasonSchema, reportDetailsSchema, reportFields, peopleReportBody;
|
|
6814
6842
|
var init_chunk_Y7CFCYX4 = __esm({
|
|
@@ -7792,6 +7820,20 @@ var init_chunk_2IPHTFV5 = __esm({
|
|
|
7792
7820
|
}
|
|
7793
7821
|
});
|
|
7794
7822
|
|
|
7823
|
+
// ../../packages/core/dist/chunk-I3O2RACG.js
|
|
7824
|
+
var managedAgentsWebhookParams, MANAGED_AGENTS_WEBHOOK_BODY_MAX_BYTES;
|
|
7825
|
+
var init_chunk_I3O2RACG = __esm({
|
|
7826
|
+
"../../packages/core/dist/chunk-I3O2RACG.js"() {
|
|
7827
|
+
"use strict";
|
|
7828
|
+
init_zod();
|
|
7829
|
+
managedAgentsWebhookParams = external_exports.object({
|
|
7830
|
+
hub_id: external_exports.string().uuid(),
|
|
7831
|
+
connection_id: external_exports.string().uuid()
|
|
7832
|
+
});
|
|
7833
|
+
MANAGED_AGENTS_WEBHOOK_BODY_MAX_BYTES = 16 * 1024;
|
|
7834
|
+
}
|
|
7835
|
+
});
|
|
7836
|
+
|
|
7795
7837
|
// ../../packages/core/dist/chunk-6J742GLA.js
|
|
7796
7838
|
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;
|
|
7797
7839
|
var init_chunk_6J742GLA = __esm({
|
|
@@ -8450,10 +8492,10 @@ var init_chunk_WEXVYJ5H = __esm({
|
|
|
8450
8492
|
function utf8ByteLength(text5) {
|
|
8451
8493
|
let bytes = 0;
|
|
8452
8494
|
for (let i = 0; i < text5.length; i++) {
|
|
8453
|
-
const
|
|
8454
|
-
if (
|
|
8455
|
-
else if (
|
|
8456
|
-
else if (
|
|
8495
|
+
const code3 = text5.charCodeAt(i);
|
|
8496
|
+
if (code3 < 128) bytes += 1;
|
|
8497
|
+
else if (code3 < 2048) bytes += 2;
|
|
8498
|
+
else if (code3 >= 55296 && code3 <= 56319 && i + 1 < text5.length) {
|
|
8457
8499
|
const next = text5.charCodeAt(i + 1);
|
|
8458
8500
|
if (next >= 56320 && next <= 57343) {
|
|
8459
8501
|
bytes += 4;
|
|
@@ -8635,31 +8677,58 @@ var init_chunk_TZH6DKKJ = __esm({
|
|
|
8635
8677
|
}
|
|
8636
8678
|
});
|
|
8637
8679
|
|
|
8638
|
-
// ../../packages/core/dist/chunk-
|
|
8639
|
-
var
|
|
8640
|
-
var
|
|
8641
|
-
"../../packages/core/dist/chunk-
|
|
8680
|
+
// ../../packages/core/dist/chunk-SY6PLCPK.js
|
|
8681
|
+
var jsonSchemaSchema, hubUserIdentity, stateValueEntry, getHubUserContextResponse, updateHubUserBody, updateHubUserResponse, unlockHubUserNameResponse, stateResetParams, stateResetResponse;
|
|
8682
|
+
var init_chunk_SY6PLCPK = __esm({
|
|
8683
|
+
"../../packages/core/dist/chunk-SY6PLCPK.js"() {
|
|
8642
8684
|
"use strict";
|
|
8643
|
-
|
|
8644
|
-
init_chunk_HZ6CADSY();
|
|
8685
|
+
init_chunk_6TSQ5HXC();
|
|
8645
8686
|
init_zod();
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8687
|
+
jsonSchemaSchema = external_exports.record(external_exports.unknown());
|
|
8688
|
+
hubUserIdentity = external_exports.object({
|
|
8689
|
+
user_id: external_exports.string().nullable(),
|
|
8690
|
+
user_name: external_exports.string().nullable(),
|
|
8691
|
+
user_email: external_exports.string().nullable(),
|
|
8692
|
+
user_name_locked: external_exports.boolean(),
|
|
8693
|
+
created_at: external_exports.string(),
|
|
8694
|
+
updated_at: external_exports.string().nullable(),
|
|
8695
|
+
hub_user_id: external_exports.string().optional(),
|
|
8696
|
+
enabled: external_exports.boolean().optional(),
|
|
8697
|
+
hub_team_id: external_exports.string().nullable().optional(),
|
|
8698
|
+
source: external_exports.enum(["grant", "auto"]).optional()
|
|
8699
|
+
});
|
|
8700
|
+
stateValueEntry = external_exports.object({
|
|
8701
|
+
state_slug: external_exports.string(),
|
|
8702
|
+
state_name: external_exports.string(),
|
|
8703
|
+
state_description: external_exports.string().nullable().optional(),
|
|
8704
|
+
scope: external_exports.enum(["user", "conversation"]),
|
|
8705
|
+
json_schema: jsonSchemaSchema,
|
|
8706
|
+
initial_value: external_exports.unknown(),
|
|
8707
|
+
value: external_exports.unknown(),
|
|
8708
|
+
is_reserved: external_exports.boolean()
|
|
8709
|
+
});
|
|
8710
|
+
getHubUserContextResponse = external_exports.object({
|
|
8711
|
+
user: hubUserIdentity,
|
|
8712
|
+
user_states: external_exports.array(stateValueEntry),
|
|
8713
|
+
conversation_states: external_exports.array(stateValueEntry)
|
|
8714
|
+
});
|
|
8715
|
+
updateHubUserBody = external_exports.object({
|
|
8716
|
+
// Non-empty, non-null. `.nullable()` here would bypass `.min(1)` and let an
|
|
8717
|
+
// admin arm the lock on a null name — see hub-do.ts updateHubUser null-guard.
|
|
8718
|
+
user_name: external_exports.string().min(1).max(120)
|
|
8719
|
+
});
|
|
8720
|
+
updateHubUserResponse = external_exports.object({
|
|
8721
|
+
user: hubUserIdentity
|
|
8722
|
+
});
|
|
8723
|
+
unlockHubUserNameResponse = external_exports.object({
|
|
8724
|
+
user: hubUserIdentity
|
|
8725
|
+
});
|
|
8726
|
+
stateResetParams = external_exports.object({
|
|
8727
|
+
stateSlug: slugSchema
|
|
8728
|
+
});
|
|
8729
|
+
stateResetResponse = external_exports.object({
|
|
8730
|
+
ok: external_exports.literal(true)
|
|
8658
8731
|
});
|
|
8659
|
-
adminPeopleReportIdParam = external_exports.object({ reportId: uuidSchema });
|
|
8660
|
-
adminPeopleMessageRemovalBody = external_exports.object({ report_id: uuidSchema, message_id: uuidSchema.optional(), note: moderationNoteSchema }).strict();
|
|
8661
|
-
adminPeopleSuspendBody = external_exports.object({ report_id: uuidSchema.optional(), note: moderationNoteSchema }).strict();
|
|
8662
|
-
adminPeopleNoteBody = external_exports.object({ note: moderationNoteSchema }).strict();
|
|
8663
8732
|
}
|
|
8664
8733
|
});
|
|
8665
8734
|
|
|
@@ -9056,17 +9125,98 @@ var init_chunk_YUZFHVB2 = __esm({
|
|
|
9056
9125
|
}
|
|
9057
9126
|
});
|
|
9058
9127
|
|
|
9059
|
-
// ../../packages/core/dist/chunk-
|
|
9060
|
-
var
|
|
9061
|
-
var
|
|
9062
|
-
"../../packages/core/dist/chunk-
|
|
9128
|
+
// ../../packages/core/dist/chunk-LKBSHANA.js
|
|
9129
|
+
var DESKTOP_SHELL_VERSION_RE, DESKTOP_PLATFORMS, DESKTOP_FLAVORS, desktopShellInfoSchema, DESKTOP_PRESENCE_STATES, desktopPresenceSchema, desktopUpdateSchema, DESKTOP_SIGN_IN_URL_MAX_LENGTH, DESKTOP_APP_PATH_MAX_LENGTH, desktopAppPathSchema, DESKTOP_NOTIFICATION_KINDS, DESKTOP_NOTIFICATION_TITLE_MAX_LENGTH, DESKTOP_NOTIFICATION_BODY_MAX_LENGTH, notificationTitleSchema, notificationBodySchema, desktopNotificationSchema, DESKTOP_BADGE_MAX_COUNT, DESKTOP_BADGE_LABEL_MAX_LENGTH, desktopBadgeSchema, desktopNavigateSchema, desktopSettingsSchema, desktopSettingsChangeSchema, desktopBridgeArgsSchemas;
|
|
9130
|
+
var init_chunk_LKBSHANA = __esm({
|
|
9131
|
+
"../../packages/core/dist/chunk-LKBSHANA.js"() {
|
|
9063
9132
|
"use strict";
|
|
9064
9133
|
init_zod();
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9134
|
+
DESKTOP_SHELL_VERSION_RE = /^(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})(-[0-9A-Za-z.-]{1,32})?$/;
|
|
9135
|
+
DESKTOP_PLATFORMS = ["darwin", "win32"];
|
|
9136
|
+
DESKTOP_FLAVORS = ["production", "development"];
|
|
9137
|
+
desktopShellInfoSchema = external_exports.object({
|
|
9138
|
+
/** The shell's own release version, independent of the web deploy. */
|
|
9139
|
+
shellVersion: external_exports.string().regex(DESKTOP_SHELL_VERSION_RE),
|
|
9140
|
+
/** The Electron runtime the shell was built with. */
|
|
9141
|
+
electronVersion: external_exports.string().regex(/^\d{1,4}\.\d{1,4}\.\d{1,4}(-[0-9A-Za-z.-]{1,32})?$/),
|
|
9142
|
+
platform: external_exports.enum(DESKTOP_PLATFORMS),
|
|
9143
|
+
/** CPU architecture as Node reports it (`arm64`, `x64`). */
|
|
9144
|
+
arch: external_exports.string().regex(/^[a-z0-9_]{1,16}$/),
|
|
9145
|
+
flavor: external_exports.enum(DESKTOP_FLAVORS),
|
|
9146
|
+
/**
|
|
9147
|
+
* Present, and true, when the shell runs from the Microsoft Store's package: the Store updates it,
|
|
9148
|
+
* and Windows alone opens it at login (the package's startup task, which the person turns on in
|
|
9149
|
+
* Windows' settings). An optional field, so no new `bridgeVersion`: an older page ignores it, and
|
|
9150
|
+
* its absence is every other shell.
|
|
9151
|
+
*/
|
|
9152
|
+
store: external_exports.literal(true).optional()
|
|
9068
9153
|
});
|
|
9069
|
-
|
|
9154
|
+
DESKTOP_PRESENCE_STATES = ["present", "away"];
|
|
9155
|
+
desktopPresenceSchema = external_exports.object({
|
|
9156
|
+
presence: external_exports.enum(DESKTOP_PRESENCE_STATES),
|
|
9157
|
+
mainWindow: external_exports.object({
|
|
9158
|
+
shown: external_exports.boolean(),
|
|
9159
|
+
focused: external_exports.boolean()
|
|
9160
|
+
})
|
|
9161
|
+
});
|
|
9162
|
+
desktopUpdateSchema = external_exports.object({
|
|
9163
|
+
ready: external_exports.object({
|
|
9164
|
+
version: external_exports.string().regex(DESKTOP_SHELL_VERSION_RE),
|
|
9165
|
+
offerRestart: external_exports.boolean()
|
|
9166
|
+
}).nullable()
|
|
9167
|
+
});
|
|
9168
|
+
DESKTOP_SIGN_IN_URL_MAX_LENGTH = 4096;
|
|
9169
|
+
DESKTOP_APP_PATH_MAX_LENGTH = 512;
|
|
9170
|
+
desktopAppPathSchema = external_exports.string().max(DESKTOP_APP_PATH_MAX_LENGTH).regex(/^\/(?![/\\])[^\s\\]*$/);
|
|
9171
|
+
DESKTOP_NOTIFICATION_KINDS = ["handoff", "message", "summary"];
|
|
9172
|
+
DESKTOP_NOTIFICATION_TITLE_MAX_LENGTH = 200;
|
|
9173
|
+
DESKTOP_NOTIFICATION_BODY_MAX_LENGTH = 500;
|
|
9174
|
+
notificationTitleSchema = external_exports.string().min(1).max(DESKTOP_NOTIFICATION_TITLE_MAX_LENGTH);
|
|
9175
|
+
notificationBodySchema = external_exports.string().max(DESKTOP_NOTIFICATION_BODY_MAX_LENGTH);
|
|
9176
|
+
desktopNotificationSchema = external_exports.object({
|
|
9177
|
+
kind: external_exports.enum(DESKTOP_NOTIFICATION_KINDS),
|
|
9178
|
+
title: notificationTitleSchema,
|
|
9179
|
+
body: notificationBodySchema,
|
|
9180
|
+
path: desktopAppPathSchema,
|
|
9181
|
+
withoutPreview: external_exports.object({ title: notificationTitleSchema, body: notificationBodySchema }).optional()
|
|
9182
|
+
});
|
|
9183
|
+
DESKTOP_BADGE_MAX_COUNT = 1e6;
|
|
9184
|
+
DESKTOP_BADGE_LABEL_MAX_LENGTH = 200;
|
|
9185
|
+
desktopBadgeSchema = external_exports.object({
|
|
9186
|
+
count: external_exports.number().int().min(0).max(DESKTOP_BADGE_MAX_COUNT),
|
|
9187
|
+
label: external_exports.string().max(DESKTOP_BADGE_LABEL_MAX_LENGTH)
|
|
9188
|
+
});
|
|
9189
|
+
desktopNavigateSchema = external_exports.object({
|
|
9190
|
+
path: desktopAppPathSchema
|
|
9191
|
+
});
|
|
9192
|
+
desktopSettingsSchema = external_exports.object({
|
|
9193
|
+
/** The app opens when the person logs in to the computer: the operating system's own login item. */
|
|
9194
|
+
openAtLogin: external_exports.boolean(),
|
|
9195
|
+
/** Closing the window keeps the app running in the tray (true), or quits it (false). */
|
|
9196
|
+
closeToTray: external_exports.boolean(),
|
|
9197
|
+
/** The shell shows notifications (true), or none (false). The badge is not a notification. */
|
|
9198
|
+
notifications: external_exports.boolean(),
|
|
9199
|
+
/**
|
|
9200
|
+
* A customer message's notification shows the customer's name and words, where the platform
|
|
9201
|
+
* allows them at all (`desktopShowsCustomerWords`: macOS); elsewhere the shell never shows them.
|
|
9202
|
+
*/
|
|
9203
|
+
messagePreview: external_exports.boolean()
|
|
9204
|
+
});
|
|
9205
|
+
desktopSettingsChangeSchema = desktopSettingsSchema.partial().strict().refine((change) => Object.values(change).every((value) => typeof value === "boolean"), {
|
|
9206
|
+
message: "each setting changed is true or false"
|
|
9207
|
+
});
|
|
9208
|
+
desktopBridgeArgsSchemas = {
|
|
9209
|
+
getShellInfo: external_exports.tuple([]),
|
|
9210
|
+
getPresence: external_exports.tuple([]),
|
|
9211
|
+
openSignIn: external_exports.tuple([external_exports.string().max(DESKTOP_SIGN_IN_URL_MAX_LENGTH)]),
|
|
9212
|
+
getUpdate: external_exports.tuple([]),
|
|
9213
|
+
restartToUpdate: external_exports.tuple([]),
|
|
9214
|
+
notify: external_exports.tuple([desktopNotificationSchema]),
|
|
9215
|
+
setBadge: external_exports.tuple([desktopBadgeSchema]),
|
|
9216
|
+
clearAll: external_exports.tuple([]),
|
|
9217
|
+
getSettings: external_exports.tuple([]),
|
|
9218
|
+
setSettings: external_exports.tuple([desktopSettingsChangeSchema])
|
|
9219
|
+
};
|
|
9070
9220
|
}
|
|
9071
9221
|
});
|
|
9072
9222
|
|
|
@@ -10469,58 +10619,58 @@ var init_chunk_OPETF4GS = __esm({
|
|
|
10469
10619
|
}
|
|
10470
10620
|
});
|
|
10471
10621
|
|
|
10472
|
-
// ../../packages/core/dist/chunk-
|
|
10473
|
-
var
|
|
10474
|
-
var
|
|
10475
|
-
"../../packages/core/dist/chunk-
|
|
10622
|
+
// ../../packages/core/dist/chunk-V4FRPRH5.js
|
|
10623
|
+
var CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS;
|
|
10624
|
+
var init_chunk_V4FRPRH5 = __esm({
|
|
10625
|
+
"../../packages/core/dist/chunk-V4FRPRH5.js"() {
|
|
10476
10626
|
"use strict";
|
|
10477
|
-
init_chunk_6TSQ5HXC();
|
|
10478
10627
|
init_zod();
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
|
|
10628
|
+
CONSULT_THREAD_STATUSES = ["open", "awaiting", "resolved", "cancelled_at_close"];
|
|
10629
|
+
consultThreadStatus = external_exports.enum(CONSULT_THREAD_STATUSES);
|
|
10630
|
+
CONSULT_THREAD_TITLE_MAX = 120;
|
|
10631
|
+
consultThreadTitle = external_exports.string().trim().min(1).max(CONSULT_THREAD_TITLE_MAX);
|
|
10632
|
+
consultThreadSummary = external_exports.object({
|
|
10633
|
+
consult_thread_id: external_exports.string(),
|
|
10634
|
+
conversation_id: external_exports.string(),
|
|
10635
|
+
initiator_type: external_exports.enum(["team", "agent"]),
|
|
10636
|
+
initiator_id: external_exports.string(),
|
|
10637
|
+
engaged_agent_id: external_exports.string().nullable(),
|
|
10638
|
+
engaged_agent_name: external_exports.string().nullable(),
|
|
10639
|
+
title: external_exports.string().nullable(),
|
|
10640
|
+
status: consultThreadStatus,
|
|
10641
|
+
created_at: external_exports.string()
|
|
10491
10642
|
});
|
|
10492
|
-
|
|
10493
|
-
|
|
10494
|
-
state_name: external_exports.string(),
|
|
10495
|
-
state_description: external_exports.string().nullable().optional(),
|
|
10496
|
-
scope: external_exports.enum(["user", "conversation"]),
|
|
10497
|
-
json_schema: jsonSchemaSchema,
|
|
10498
|
-
initial_value: external_exports.unknown(),
|
|
10499
|
-
value: external_exports.unknown(),
|
|
10500
|
-
is_reserved: external_exports.boolean()
|
|
10643
|
+
listConsultThreadsQuery = external_exports.object({
|
|
10644
|
+
hub_id: external_exports.string().uuid()
|
|
10501
10645
|
});
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
user_states: external_exports.array(stateValueEntry),
|
|
10505
|
-
conversation_states: external_exports.array(stateValueEntry)
|
|
10646
|
+
listConsultThreadsResponse = external_exports.object({
|
|
10647
|
+
threads: external_exports.array(consultThreadSummary)
|
|
10506
10648
|
});
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10649
|
+
createConsultThreadBody = external_exports.object({
|
|
10650
|
+
hub_id: external_exports.string().uuid(),
|
|
10651
|
+
title: consultThreadTitle.optional(),
|
|
10652
|
+
// Optionally engage a consultant on creation. Validated server-side against the
|
|
10653
|
+
// hub's `consultant`-role agents; a non-consultant / unknown id is rejected.
|
|
10654
|
+
engaged_agent_id: external_exports.string().uuid().optional()
|
|
10511
10655
|
});
|
|
10512
|
-
|
|
10513
|
-
|
|
10656
|
+
createConsultThreadResponse = external_exports.object({
|
|
10657
|
+
thread: consultThreadSummary
|
|
10514
10658
|
});
|
|
10515
|
-
|
|
10516
|
-
|
|
10659
|
+
consultThreadIdParam = external_exports.object({
|
|
10660
|
+
id: external_exports.string().uuid(),
|
|
10661
|
+
threadId: external_exports.string().uuid()
|
|
10517
10662
|
});
|
|
10518
|
-
|
|
10519
|
-
|
|
10663
|
+
updateConsultThreadBody = external_exports.object({
|
|
10664
|
+
hub_id: external_exports.string().uuid(),
|
|
10665
|
+
title: consultThreadTitle.optional(),
|
|
10666
|
+
engaged_agent_id: external_exports.string().uuid().optional()
|
|
10667
|
+
}).refine((v) => v.title !== void 0 || v.engaged_agent_id !== void 0, {
|
|
10668
|
+
message: "Provide a title and/or an engaged_agent_id to update"
|
|
10520
10669
|
});
|
|
10521
|
-
|
|
10522
|
-
|
|
10670
|
+
updateConsultThreadResponse = external_exports.object({
|
|
10671
|
+
thread: consultThreadSummary
|
|
10523
10672
|
});
|
|
10673
|
+
CONSULT_AWAIT_TIMEOUT_MS = 15 * 6e4;
|
|
10524
10674
|
}
|
|
10525
10675
|
});
|
|
10526
10676
|
|
|
@@ -12731,98 +12881,115 @@ var init_chunk_KSTYTQ7I = __esm({
|
|
|
12731
12881
|
}
|
|
12732
12882
|
});
|
|
12733
12883
|
|
|
12734
|
-
// ../../packages/core/dist/chunk-
|
|
12735
|
-
var
|
|
12736
|
-
var
|
|
12737
|
-
"../../packages/core/dist/chunk-
|
|
12884
|
+
// ../../packages/core/dist/chunk-7CYHPF35.js
|
|
12885
|
+
var appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse;
|
|
12886
|
+
var init_chunk_7CYHPF35 = __esm({
|
|
12887
|
+
"../../packages/core/dist/chunk-7CYHPF35.js"() {
|
|
12738
12888
|
"use strict";
|
|
12889
|
+
init_chunk_HZ6CADSY();
|
|
12739
12890
|
init_zod();
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
electronVersion: external_exports.string().regex(/^\d{1,4}\.\d{1,4}\.\d{1,4}(-[0-9A-Za-z.-]{1,32})?$/),
|
|
12748
|
-
platform: external_exports.enum(DESKTOP_PLATFORMS),
|
|
12749
|
-
/** CPU architecture as Node reports it (`arm64`, `x64`). */
|
|
12750
|
-
arch: external_exports.string().regex(/^[a-z0-9_]{1,16}$/),
|
|
12751
|
-
flavor: external_exports.enum(DESKTOP_FLAVORS),
|
|
12752
|
-
/**
|
|
12753
|
-
* Present, and true, when the shell runs from the Microsoft Store's package: the Store updates it,
|
|
12754
|
-
* and Windows alone opens it at login (the package's startup task, which the person turns on in
|
|
12755
|
-
* Windows' settings). An optional field, so no new `bridgeVersion`: an older page ignores it, and
|
|
12756
|
-
* its absence is every other shell.
|
|
12757
|
-
*/
|
|
12758
|
-
store: external_exports.literal(true).optional()
|
|
12759
|
-
});
|
|
12760
|
-
DESKTOP_PRESENCE_STATES = ["present", "away"];
|
|
12761
|
-
desktopPresenceSchema = external_exports.object({
|
|
12762
|
-
presence: external_exports.enum(DESKTOP_PRESENCE_STATES),
|
|
12763
|
-
mainWindow: external_exports.object({
|
|
12764
|
-
shown: external_exports.boolean(),
|
|
12765
|
-
focused: external_exports.boolean()
|
|
12766
|
-
})
|
|
12767
|
-
});
|
|
12768
|
-
desktopUpdateSchema = external_exports.object({
|
|
12769
|
-
ready: external_exports.object({
|
|
12770
|
-
version: external_exports.string().regex(DESKTOP_SHELL_VERSION_RE),
|
|
12771
|
-
offerRestart: external_exports.boolean()
|
|
12772
|
-
}).nullable()
|
|
12773
|
-
});
|
|
12774
|
-
DESKTOP_SIGN_IN_URL_MAX_LENGTH = 4096;
|
|
12775
|
-
DESKTOP_APP_PATH_MAX_LENGTH = 512;
|
|
12776
|
-
desktopAppPathSchema = external_exports.string().max(DESKTOP_APP_PATH_MAX_LENGTH).regex(/^\/(?![/\\])[^\s\\]*$/);
|
|
12777
|
-
DESKTOP_NOTIFICATION_KINDS = ["handoff", "message", "summary"];
|
|
12778
|
-
DESKTOP_NOTIFICATION_TITLE_MAX_LENGTH = 200;
|
|
12779
|
-
DESKTOP_NOTIFICATION_BODY_MAX_LENGTH = 500;
|
|
12780
|
-
notificationTitleSchema = external_exports.string().min(1).max(DESKTOP_NOTIFICATION_TITLE_MAX_LENGTH);
|
|
12781
|
-
notificationBodySchema = external_exports.string().max(DESKTOP_NOTIFICATION_BODY_MAX_LENGTH);
|
|
12782
|
-
desktopNotificationSchema = external_exports.object({
|
|
12783
|
-
kind: external_exports.enum(DESKTOP_NOTIFICATION_KINDS),
|
|
12784
|
-
title: notificationTitleSchema,
|
|
12785
|
-
body: notificationBodySchema,
|
|
12786
|
-
path: desktopAppPathSchema,
|
|
12787
|
-
withoutPreview: external_exports.object({ title: notificationTitleSchema, body: notificationBodySchema }).optional()
|
|
12788
|
-
});
|
|
12789
|
-
DESKTOP_BADGE_MAX_COUNT = 1e6;
|
|
12790
|
-
DESKTOP_BADGE_LABEL_MAX_LENGTH = 200;
|
|
12791
|
-
desktopBadgeSchema = external_exports.object({
|
|
12792
|
-
count: external_exports.number().int().min(0).max(DESKTOP_BADGE_MAX_COUNT),
|
|
12793
|
-
label: external_exports.string().max(DESKTOP_BADGE_LABEL_MAX_LENGTH)
|
|
12891
|
+
appMessageSenderType = external_exports.enum(["user", "team"]);
|
|
12892
|
+
appMessageReceiverType = external_exports.enum(["user", "team", "agent", "assistant"]).transform((v) => v === "assistant" ? "agent" : v);
|
|
12893
|
+
apiChannelMessage = external_exports.object({
|
|
12894
|
+
text: clientOptionalString,
|
|
12895
|
+
attachments: external_exports.array(messageAttachment).max(MAX_ATTACHMENTS_PER_MESSAGE).nullish().transform((v) => v ?? void 0)
|
|
12896
|
+
}).refine((m) => m.text && m.text.length > 0 || m.attachments && m.attachments.length > 0, {
|
|
12897
|
+
message: "message must have text or at least one attachment"
|
|
12794
12898
|
});
|
|
12795
|
-
|
|
12796
|
-
|
|
12899
|
+
apiChannelMessageBody = external_exports.object({
|
|
12900
|
+
// Correlation id (task hubs): new → new conversation, repeat → continue. min 1 so an
|
|
12901
|
+
// empty string can't masquerade as a ref. Mutually exclusive with conversation_id.
|
|
12902
|
+
external_ref: external_exports.string().min(1).max(256).optional(),
|
|
12903
|
+
// Continue a specific WayAI conversation (authorized against the hub/channel + owner).
|
|
12904
|
+
// UUID-validated here (unlike the app channel, whose client we control): allocation
|
|
12905
|
+
// only treats a UUID-shaped id as a provided conversation, so a malformed id would
|
|
12906
|
+
// otherwise skip the owner guard and silently MINT a new conversation instead of
|
|
12907
|
+
// rejecting. A format 400 is shape-only — not an existence oracle (a valid-but-unknown
|
|
12908
|
+
// UUID still collapses to the opaque authorization error downstream).
|
|
12909
|
+
conversation_id: external_exports.string().uuid().optional(),
|
|
12910
|
+
// On-behalf-of end-user identity. Absent → per-connection service principal (task-hub
|
|
12911
|
+
// only; chat hub rejects with 422 in the route).
|
|
12912
|
+
user: external_exports.object({
|
|
12913
|
+
id: external_exports.string().min(1),
|
|
12914
|
+
email: clientOptionalString,
|
|
12915
|
+
name: clientOptionalString
|
|
12916
|
+
}).optional(),
|
|
12917
|
+
message: apiChannelMessage,
|
|
12918
|
+
// Idempotency key: maps to channel_message_sid, deduped within one conversation
|
|
12919
|
+
// (ConversationDO.storeMessage). A retried POST resolves to the same conversation (a chat
|
|
12920
|
+
// hub's user, the external_ref, the conversation_id, or on a task hub with neither, this key
|
|
12921
|
+
// scoped by the sender), so it echoes the original message_id and skips billing / turn
|
|
12922
|
+
// dispatch. A failed store answers a retryable 503 only when this key is set; without it a
|
|
12923
|
+
// retry could store the message twice, so it answers 400.
|
|
12924
|
+
client_message_id: external_exports.string().min(1).max(256).optional()
|
|
12925
|
+
}).refine((b) => !(b.external_ref && b.conversation_id), {
|
|
12926
|
+
message: "provide external_ref or conversation_id, not both",
|
|
12927
|
+
path: ["external_ref"]
|
|
12797
12928
|
});
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12808
|
-
|
|
12809
|
-
|
|
12929
|
+
appMessageBody = external_exports.object({
|
|
12930
|
+
// Message content — three historical aliases. All optional: an attachment-only
|
|
12931
|
+
// or voice-only message carries no text.
|
|
12932
|
+
content: clientOptionalString,
|
|
12933
|
+
message_text: clientOptionalString,
|
|
12934
|
+
message_body: clientOptionalString,
|
|
12935
|
+
// Conversation context. Ids are plain strings rather than `.uuid()` on purpose:
|
|
12936
|
+
// they are AUTHORIZED downstream, which is the stronger guarantee — a well-formed
|
|
12937
|
+
// uuid belonging to another tenant must fail just as hard as junk. `hub_id` is
|
|
12938
|
+
// gated by `assertHubEndUserAccess` (gh #3286) and `conversation_id` by HubDO's
|
|
12939
|
+
// conversation_index owner check (gh #2781, #3281). The route's own falsy guards
|
|
12940
|
+
// ('hub_id is required') still reject an empty one.
|
|
12941
|
+
hub_id: clientOptionalString,
|
|
12942
|
+
channel_id: clientOptionalString,
|
|
12943
|
+
conversation_id: clientOptionalString,
|
|
12944
|
+
hub_type: external_exports.enum(["chat", "task"]).nullish().transform((v) => v ?? void 0),
|
|
12945
|
+
// Stable idempotency key for one explicit task-hub launcher. HubDO scopes it
|
|
12946
|
+
// to the authenticated user and resolves retries/tabs to one conversation.
|
|
12947
|
+
task_start_id: external_exports.string().uuid().nullish().transform((v) => v ?? void 0),
|
|
12948
|
+
// Routing.
|
|
12949
|
+
sender_type: appMessageSenderType.nullish().transform((v) => v ?? void 0),
|
|
12950
|
+
receiver_type: appMessageReceiverType.nullish().transform((v) => v ?? void 0),
|
|
12951
|
+
// Only meaningful on a team send, where `validateAppTeamSendContext` proves the
|
|
12952
|
+
// caller may send to this receiver. Absent on a team send to a conversation with no
|
|
12953
|
+
// person, which names its `conversation_id` instead. The end-user branch ignores it —
|
|
12954
|
+
// see the receiver derivation in the route.
|
|
12955
|
+
user_receiver_id: clientOptionalString,
|
|
12956
|
+
// ── Internal consult (consultant-agents PR 2 — H1.0) ──────────────────────
|
|
12957
|
+
// A team member handling a customer conversation can tag a `consultant`-role
|
|
12958
|
+
// agent for a PRIVATE, team-only exchange that never reaches the customer. A
|
|
12959
|
+
// consult send is a team send with `receiver_type: 'agent'` targeting the
|
|
12960
|
+
// consultant; `user_receiver_id` identifies the customer whose conversation this is
|
|
12961
|
+
// (and is authorized by `validateAppTeamSendContext`, exactly as a team→user send is),
|
|
12962
|
+
// and is absent, as on a team→user send, when the conversation has no person. The consultant is resolved from `agent_receiver_id`
|
|
12963
|
+
// when supplied, else from an `@mention` parsed out of the message text against
|
|
12964
|
+
// the hub's consultant agents. `consult_thread_id` continues an existing thread;
|
|
12965
|
+
// absent, the route creates/reuses the single implicit thread. These fields are
|
|
12966
|
+
// inert on every non-consult send (end-user send, team→user send).
|
|
12967
|
+
agent_receiver_id: clientOptionalString,
|
|
12968
|
+
consult_thread_id: clientOptionalString,
|
|
12969
|
+
is_first_message: clientOptionalBoolean,
|
|
12970
|
+
end_conversation: clientOptionalBoolean,
|
|
12971
|
+
// Pre-generated by the client so the optimistic bubble and the stored row share
|
|
12972
|
+
// a key (transcription live-updates land on the same row instead of duplicating).
|
|
12973
|
+
message_id: clientOptionalString,
|
|
12974
|
+
attachments: external_exports.array(messageAttachment).max(MAX_ATTACHMENTS_PER_MESSAGE).nullish().transform((v) => v ?? void 0),
|
|
12975
|
+
// Base64-encoded audio for STT. Size-capped in the route (the cap is a byte
|
|
12976
|
+
// budget tied to the /channels/* bodyLimit, not a shape rule).
|
|
12977
|
+
audio_file: clientOptionalString
|
|
12810
12978
|
});
|
|
12811
|
-
|
|
12812
|
-
|
|
12979
|
+
appMessageResponse = external_exports.object({
|
|
12980
|
+
success: external_exports.boolean(),
|
|
12981
|
+
message: external_exports.string(),
|
|
12982
|
+
result: external_exports.object({
|
|
12983
|
+
conversation_id: external_exports.string().optional(),
|
|
12984
|
+
message_id: external_exports.string().optional(),
|
|
12985
|
+
status: external_exports.string().optional(),
|
|
12986
|
+
files: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
|
|
12987
|
+
// True when this request reused a task-start/message id already accepted by
|
|
12988
|
+
// the server. Clients must replace their optimistic payload with a fresh
|
|
12989
|
+
// authoritative read because another tab may have won with different text.
|
|
12990
|
+
deduped: external_exports.boolean().optional()
|
|
12991
|
+
}).optional()
|
|
12813
12992
|
});
|
|
12814
|
-
desktopBridgeArgsSchemas = {
|
|
12815
|
-
getShellInfo: external_exports.tuple([]),
|
|
12816
|
-
getPresence: external_exports.tuple([]),
|
|
12817
|
-
openSignIn: external_exports.tuple([external_exports.string().max(DESKTOP_SIGN_IN_URL_MAX_LENGTH)]),
|
|
12818
|
-
getUpdate: external_exports.tuple([]),
|
|
12819
|
-
restartToUpdate: external_exports.tuple([]),
|
|
12820
|
-
notify: external_exports.tuple([desktopNotificationSchema]),
|
|
12821
|
-
setBadge: external_exports.tuple([desktopBadgeSchema]),
|
|
12822
|
-
clearAll: external_exports.tuple([]),
|
|
12823
|
-
getSettings: external_exports.tuple([]),
|
|
12824
|
-
setSettings: external_exports.tuple([desktopSettingsChangeSchema])
|
|
12825
|
-
};
|
|
12826
12993
|
}
|
|
12827
12994
|
});
|
|
12828
12995
|
|
|
@@ -12916,61 +13083,6 @@ var init_chunk_YULHXJ5M = __esm({
|
|
|
12916
13083
|
}
|
|
12917
13084
|
});
|
|
12918
13085
|
|
|
12919
|
-
// ../../packages/core/dist/chunk-V4FRPRH5.js
|
|
12920
|
-
var CONSULT_THREAD_STATUSES, consultThreadStatus, CONSULT_THREAD_TITLE_MAX, consultThreadTitle, consultThreadSummary, listConsultThreadsQuery, listConsultThreadsResponse, createConsultThreadBody, createConsultThreadResponse, consultThreadIdParam, updateConsultThreadBody, updateConsultThreadResponse, CONSULT_AWAIT_TIMEOUT_MS;
|
|
12921
|
-
var init_chunk_V4FRPRH5 = __esm({
|
|
12922
|
-
"../../packages/core/dist/chunk-V4FRPRH5.js"() {
|
|
12923
|
-
"use strict";
|
|
12924
|
-
init_zod();
|
|
12925
|
-
CONSULT_THREAD_STATUSES = ["open", "awaiting", "resolved", "cancelled_at_close"];
|
|
12926
|
-
consultThreadStatus = external_exports.enum(CONSULT_THREAD_STATUSES);
|
|
12927
|
-
CONSULT_THREAD_TITLE_MAX = 120;
|
|
12928
|
-
consultThreadTitle = external_exports.string().trim().min(1).max(CONSULT_THREAD_TITLE_MAX);
|
|
12929
|
-
consultThreadSummary = external_exports.object({
|
|
12930
|
-
consult_thread_id: external_exports.string(),
|
|
12931
|
-
conversation_id: external_exports.string(),
|
|
12932
|
-
initiator_type: external_exports.enum(["team", "agent"]),
|
|
12933
|
-
initiator_id: external_exports.string(),
|
|
12934
|
-
engaged_agent_id: external_exports.string().nullable(),
|
|
12935
|
-
engaged_agent_name: external_exports.string().nullable(),
|
|
12936
|
-
title: external_exports.string().nullable(),
|
|
12937
|
-
status: consultThreadStatus,
|
|
12938
|
-
created_at: external_exports.string()
|
|
12939
|
-
});
|
|
12940
|
-
listConsultThreadsQuery = external_exports.object({
|
|
12941
|
-
hub_id: external_exports.string().uuid()
|
|
12942
|
-
});
|
|
12943
|
-
listConsultThreadsResponse = external_exports.object({
|
|
12944
|
-
threads: external_exports.array(consultThreadSummary)
|
|
12945
|
-
});
|
|
12946
|
-
createConsultThreadBody = external_exports.object({
|
|
12947
|
-
hub_id: external_exports.string().uuid(),
|
|
12948
|
-
title: consultThreadTitle.optional(),
|
|
12949
|
-
// Optionally engage a consultant on creation. Validated server-side against the
|
|
12950
|
-
// hub's `consultant`-role agents; a non-consultant / unknown id is rejected.
|
|
12951
|
-
engaged_agent_id: external_exports.string().uuid().optional()
|
|
12952
|
-
});
|
|
12953
|
-
createConsultThreadResponse = external_exports.object({
|
|
12954
|
-
thread: consultThreadSummary
|
|
12955
|
-
});
|
|
12956
|
-
consultThreadIdParam = external_exports.object({
|
|
12957
|
-
id: external_exports.string().uuid(),
|
|
12958
|
-
threadId: external_exports.string().uuid()
|
|
12959
|
-
});
|
|
12960
|
-
updateConsultThreadBody = external_exports.object({
|
|
12961
|
-
hub_id: external_exports.string().uuid(),
|
|
12962
|
-
title: consultThreadTitle.optional(),
|
|
12963
|
-
engaged_agent_id: external_exports.string().uuid().optional()
|
|
12964
|
-
}).refine((v) => v.title !== void 0 || v.engaged_agent_id !== void 0, {
|
|
12965
|
-
message: "Provide a title and/or an engaged_agent_id to update"
|
|
12966
|
-
});
|
|
12967
|
-
updateConsultThreadResponse = external_exports.object({
|
|
12968
|
-
thread: consultThreadSummary
|
|
12969
|
-
});
|
|
12970
|
-
CONSULT_AWAIT_TIMEOUT_MS = 15 * 6e4;
|
|
12971
|
-
}
|
|
12972
|
-
});
|
|
12973
|
-
|
|
12974
13086
|
// ../../packages/core/dist/chunk-VYINA6YP.js
|
|
12975
13087
|
function formatterOf(zone) {
|
|
12976
13088
|
const held = formatters.get(zone);
|
|
@@ -13132,118 +13244,6 @@ var init_chunk_X4IDZLLS = __esm({
|
|
|
13132
13244
|
}
|
|
13133
13245
|
});
|
|
13134
13246
|
|
|
13135
|
-
// ../../packages/core/dist/chunk-7CYHPF35.js
|
|
13136
|
-
var appMessageSenderType, appMessageReceiverType, apiChannelMessage, apiChannelMessageBody, appMessageBody, appMessageResponse;
|
|
13137
|
-
var init_chunk_7CYHPF35 = __esm({
|
|
13138
|
-
"../../packages/core/dist/chunk-7CYHPF35.js"() {
|
|
13139
|
-
"use strict";
|
|
13140
|
-
init_chunk_HZ6CADSY();
|
|
13141
|
-
init_zod();
|
|
13142
|
-
appMessageSenderType = external_exports.enum(["user", "team"]);
|
|
13143
|
-
appMessageReceiverType = external_exports.enum(["user", "team", "agent", "assistant"]).transform((v) => v === "assistant" ? "agent" : v);
|
|
13144
|
-
apiChannelMessage = external_exports.object({
|
|
13145
|
-
text: clientOptionalString,
|
|
13146
|
-
attachments: external_exports.array(messageAttachment).max(MAX_ATTACHMENTS_PER_MESSAGE).nullish().transform((v) => v ?? void 0)
|
|
13147
|
-
}).refine((m) => m.text && m.text.length > 0 || m.attachments && m.attachments.length > 0, {
|
|
13148
|
-
message: "message must have text or at least one attachment"
|
|
13149
|
-
});
|
|
13150
|
-
apiChannelMessageBody = external_exports.object({
|
|
13151
|
-
// Correlation id (task hubs): new → new conversation, repeat → continue. min 1 so an
|
|
13152
|
-
// empty string can't masquerade as a ref. Mutually exclusive with conversation_id.
|
|
13153
|
-
external_ref: external_exports.string().min(1).max(256).optional(),
|
|
13154
|
-
// Continue a specific WayAI conversation (authorized against the hub/channel + owner).
|
|
13155
|
-
// UUID-validated here (unlike the app channel, whose client we control): allocation
|
|
13156
|
-
// only treats a UUID-shaped id as a provided conversation, so a malformed id would
|
|
13157
|
-
// otherwise skip the owner guard and silently MINT a new conversation instead of
|
|
13158
|
-
// rejecting. A format 400 is shape-only — not an existence oracle (a valid-but-unknown
|
|
13159
|
-
// UUID still collapses to the opaque authorization error downstream).
|
|
13160
|
-
conversation_id: external_exports.string().uuid().optional(),
|
|
13161
|
-
// On-behalf-of end-user identity. Absent → per-connection service principal (task-hub
|
|
13162
|
-
// only; chat hub rejects with 422 in the route).
|
|
13163
|
-
user: external_exports.object({
|
|
13164
|
-
id: external_exports.string().min(1),
|
|
13165
|
-
email: clientOptionalString,
|
|
13166
|
-
name: clientOptionalString
|
|
13167
|
-
}).optional(),
|
|
13168
|
-
message: apiChannelMessage,
|
|
13169
|
-
// Idempotency key: maps to channel_message_sid, deduped within one conversation
|
|
13170
|
-
// (ConversationDO.storeMessage). A retried POST resolves to the same conversation (a chat
|
|
13171
|
-
// hub's user, the external_ref, the conversation_id, or on a task hub with neither, this key
|
|
13172
|
-
// scoped by the sender), so it echoes the original message_id and skips billing / turn
|
|
13173
|
-
// dispatch. A failed store answers a retryable 503 only when this key is set; without it a
|
|
13174
|
-
// retry could store the message twice, so it answers 400.
|
|
13175
|
-
client_message_id: external_exports.string().min(1).max(256).optional()
|
|
13176
|
-
}).refine((b) => !(b.external_ref && b.conversation_id), {
|
|
13177
|
-
message: "provide external_ref or conversation_id, not both",
|
|
13178
|
-
path: ["external_ref"]
|
|
13179
|
-
});
|
|
13180
|
-
appMessageBody = external_exports.object({
|
|
13181
|
-
// Message content — three historical aliases. All optional: an attachment-only
|
|
13182
|
-
// or voice-only message carries no text.
|
|
13183
|
-
content: clientOptionalString,
|
|
13184
|
-
message_text: clientOptionalString,
|
|
13185
|
-
message_body: clientOptionalString,
|
|
13186
|
-
// Conversation context. Ids are plain strings rather than `.uuid()` on purpose:
|
|
13187
|
-
// they are AUTHORIZED downstream, which is the stronger guarantee — a well-formed
|
|
13188
|
-
// uuid belonging to another tenant must fail just as hard as junk. `hub_id` is
|
|
13189
|
-
// gated by `assertHubEndUserAccess` (gh #3286) and `conversation_id` by HubDO's
|
|
13190
|
-
// conversation_index owner check (gh #2781, #3281). The route's own falsy guards
|
|
13191
|
-
// ('hub_id is required') still reject an empty one.
|
|
13192
|
-
hub_id: clientOptionalString,
|
|
13193
|
-
channel_id: clientOptionalString,
|
|
13194
|
-
conversation_id: clientOptionalString,
|
|
13195
|
-
hub_type: external_exports.enum(["chat", "task"]).nullish().transform((v) => v ?? void 0),
|
|
13196
|
-
// Stable idempotency key for one explicit task-hub launcher. HubDO scopes it
|
|
13197
|
-
// to the authenticated user and resolves retries/tabs to one conversation.
|
|
13198
|
-
task_start_id: external_exports.string().uuid().nullish().transform((v) => v ?? void 0),
|
|
13199
|
-
// Routing.
|
|
13200
|
-
sender_type: appMessageSenderType.nullish().transform((v) => v ?? void 0),
|
|
13201
|
-
receiver_type: appMessageReceiverType.nullish().transform((v) => v ?? void 0),
|
|
13202
|
-
// Only meaningful on a team send, where `validateAppTeamSendContext` proves the
|
|
13203
|
-
// caller may send to this receiver. Absent on a team send to a conversation with no
|
|
13204
|
-
// person, which names its `conversation_id` instead. The end-user branch ignores it —
|
|
13205
|
-
// see the receiver derivation in the route.
|
|
13206
|
-
user_receiver_id: clientOptionalString,
|
|
13207
|
-
// ── Internal consult (consultant-agents PR 2 — H1.0) ──────────────────────
|
|
13208
|
-
// A team member handling a customer conversation can tag a `consultant`-role
|
|
13209
|
-
// agent for a PRIVATE, team-only exchange that never reaches the customer. A
|
|
13210
|
-
// consult send is a team send with `receiver_type: 'agent'` targeting the
|
|
13211
|
-
// consultant; `user_receiver_id` identifies the customer whose conversation this is
|
|
13212
|
-
// (and is authorized by `validateAppTeamSendContext`, exactly as a team→user send is),
|
|
13213
|
-
// and is absent, as on a team→user send, when the conversation has no person. The consultant is resolved from `agent_receiver_id`
|
|
13214
|
-
// when supplied, else from an `@mention` parsed out of the message text against
|
|
13215
|
-
// the hub's consultant agents. `consult_thread_id` continues an existing thread;
|
|
13216
|
-
// absent, the route creates/reuses the single implicit thread. These fields are
|
|
13217
|
-
// inert on every non-consult send (end-user send, team→user send).
|
|
13218
|
-
agent_receiver_id: clientOptionalString,
|
|
13219
|
-
consult_thread_id: clientOptionalString,
|
|
13220
|
-
is_first_message: clientOptionalBoolean,
|
|
13221
|
-
end_conversation: clientOptionalBoolean,
|
|
13222
|
-
// Pre-generated by the client so the optimistic bubble and the stored row share
|
|
13223
|
-
// a key (transcription live-updates land on the same row instead of duplicating).
|
|
13224
|
-
message_id: clientOptionalString,
|
|
13225
|
-
attachments: external_exports.array(messageAttachment).max(MAX_ATTACHMENTS_PER_MESSAGE).nullish().transform((v) => v ?? void 0),
|
|
13226
|
-
// Base64-encoded audio for STT. Size-capped in the route (the cap is a byte
|
|
13227
|
-
// budget tied to the /channels/* bodyLimit, not a shape rule).
|
|
13228
|
-
audio_file: clientOptionalString
|
|
13229
|
-
});
|
|
13230
|
-
appMessageResponse = external_exports.object({
|
|
13231
|
-
success: external_exports.boolean(),
|
|
13232
|
-
message: external_exports.string(),
|
|
13233
|
-
result: external_exports.object({
|
|
13234
|
-
conversation_id: external_exports.string().optional(),
|
|
13235
|
-
message_id: external_exports.string().optional(),
|
|
13236
|
-
status: external_exports.string().optional(),
|
|
13237
|
-
files: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
|
|
13238
|
-
// True when this request reused a task-start/message id already accepted by
|
|
13239
|
-
// the server. Clients must replace their optimistic payload with a fresh
|
|
13240
|
-
// authoritative read because another tab may have won with different text.
|
|
13241
|
-
deduped: external_exports.boolean().optional()
|
|
13242
|
-
}).optional()
|
|
13243
|
-
});
|
|
13244
|
-
}
|
|
13245
|
-
});
|
|
13246
|
-
|
|
13247
13247
|
// ../../packages/core/dist/chunk-M2T55BV6.js
|
|
13248
13248
|
function isCaseAttributeDate(text5) {
|
|
13249
13249
|
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(text5);
|
|
@@ -13326,7 +13326,7 @@ var init_chunk_M2T55BV6 = __esm({
|
|
|
13326
13326
|
}
|
|
13327
13327
|
});
|
|
13328
13328
|
|
|
13329
|
-
// ../../packages/core/dist/chunk-
|
|
13329
|
+
// ../../packages/core/dist/chunk-J3HQTL6M.js
|
|
13330
13330
|
function withProblem(shape, problemOf) {
|
|
13331
13331
|
return shape.superRefine((value, ctx) => {
|
|
13332
13332
|
const found = problemOf(value);
|
|
@@ -13363,11 +13363,11 @@ ${party.role}`);
|
|
|
13363
13363
|
return new Set(keys).size === keys.length ? null : { reason: "instrument_party_repeated", at: "parties" };
|
|
13364
13364
|
}
|
|
13365
13365
|
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;
|
|
13366
|
-
var
|
|
13367
|
-
"../../packages/core/dist/chunk-
|
|
13366
|
+
var init_chunk_J3HQTL6M = __esm({
|
|
13367
|
+
"../../packages/core/dist/chunk-J3HQTL6M.js"() {
|
|
13368
13368
|
"use strict";
|
|
13369
|
-
init_chunk_CLGTGGVN();
|
|
13370
13369
|
init_chunk_M2T55BV6();
|
|
13370
|
+
init_chunk_CLGTGGVN();
|
|
13371
13371
|
init_chunk_HZ6CADSY();
|
|
13372
13372
|
init_zod();
|
|
13373
13373
|
CASE_REGISTRY_TYPE_CODE_PATTERN = /^[a-z0-9]+(_[a-z0-9]+)*$/;
|
|
@@ -13682,7 +13682,7 @@ var init_chunk_ZJA3UZMG = __esm({
|
|
|
13682
13682
|
}
|
|
13683
13683
|
});
|
|
13684
13684
|
|
|
13685
|
-
// ../../packages/core/dist/chunk-
|
|
13685
|
+
// ../../packages/core/dist/chunk-YMFTFCT5.js
|
|
13686
13686
|
function collectionUploadForm(field, shape) {
|
|
13687
13687
|
return external_exports.record(external_exports.string(), external_exports.unknown()).transform((form2, ctx) => {
|
|
13688
13688
|
const refuse2 = (message, path55) => {
|
|
@@ -13722,14 +13722,14 @@ function caseCollectionFileName(sent) {
|
|
|
13722
13722
|
return name || "document";
|
|
13723
13723
|
}
|
|
13724
13724
|
var CASE_COLLECTION_FOLDERS, CASE_COLLECTION_PARTS, isCaseCollectionPart, CASE_COLLECTION_TITLE_MAX_LENGTH, CASE_COLLECTION_TYPE_MAX_LENGTH, CASE_COLLECTION_REASON_MAX_LENGTH, CASE_COLLECTION_FILE_NAME_MAX_LENGTH, caseCollectionDocumentParam, dateOnly, title, registerCaseCollectionDocumentShape, addCaseCollectionVersionShape, CASE_COLLECTION_UPLOAD_BODY_MAX_BYTES, CASE_COLLECTION_DOCUMENT_FIELD, CASE_COLLECTION_VERSION_FIELD, caseCollectionDocumentUploadForm, caseCollectionVersionUploadForm, CASE_COLLECTION_PAGE_MAX, CASE_COLLECTION_CURSOR_MAX_LENGTH, caseCollectionQuery, CASE_COLLECTION_VERSIONS_PAGE_MAX, caseCollectionVersionsQuery, caseCollectionContentQuery;
|
|
13725
|
-
var
|
|
13726
|
-
"../../packages/core/dist/chunk-
|
|
13725
|
+
var init_chunk_YMFTFCT5 = __esm({
|
|
13726
|
+
"../../packages/core/dist/chunk-YMFTFCT5.js"() {
|
|
13727
13727
|
"use strict";
|
|
13728
|
-
|
|
13728
|
+
init_chunk_J3HQTL6M();
|
|
13729
13729
|
init_chunk_ZJA3UZMG();
|
|
13730
13730
|
init_chunk_HPZOVPVT();
|
|
13731
|
-
init_chunk_CLGTGGVN();
|
|
13732
13731
|
init_chunk_M2T55BV6();
|
|
13732
|
+
init_chunk_CLGTGGVN();
|
|
13733
13733
|
init_chunk_HZ6CADSY();
|
|
13734
13734
|
init_zod();
|
|
13735
13735
|
CASE_COLLECTION_FOLDERS = ["norms", "internal_norms", "instruments", "data"];
|
|
@@ -13788,12 +13788,12 @@ var init_chunk_5D4QFV76 = __esm({
|
|
|
13788
13788
|
}
|
|
13789
13789
|
});
|
|
13790
13790
|
|
|
13791
|
-
// ../../packages/core/dist/chunk-
|
|
13791
|
+
// ../../packages/core/dist/chunk-MCLSEATL.js
|
|
13792
13792
|
function resolveItemLink(phaseFolder, target) {
|
|
13793
13793
|
const slash = target.lastIndexOf("/");
|
|
13794
13794
|
const folder = slash < 0 ? phaseFolder : target.slice(0, slash);
|
|
13795
|
-
const
|
|
13796
|
-
return { folder, code:
|
|
13795
|
+
const code22 = target.slice(slash + 1);
|
|
13796
|
+
return { folder, code: code22, key: `${folder}/${code22}` };
|
|
13797
13797
|
}
|
|
13798
13798
|
function caseTypeDefinitionRows(definition) {
|
|
13799
13799
|
let rows = 1 + definition.type_party_roles.length + definition.type_outcomes.length;
|
|
@@ -14013,12 +14013,12 @@ function caseTypeDefinitionReasonOf(error) {
|
|
|
14013
14013
|
return first && reason3 ? { reason: reason3, at: first.path.join(".") } : null;
|
|
14014
14014
|
}
|
|
14015
14015
|
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_TASK_NAME_MAX_LENGTH, CASE_TASK_DEPENDENCIES_MAX, 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, caseAgendaGroupCodeSchema, caseDecisionCodeSchema, decisionCode, label2, optionalText, itemLinkTarget, filePath, caseTypePartyRoleSchema, caseTypeOutcomeSchema, caseItemRequirementsSchema, caseItemLinksSchema, caseOutputItemSchema, casePhaseOutputSchema, casePhaseInputSchema, caseDecisionOptionSchema, decisionBound, caseAgendaDecisionSchema, caseAgendaGroupSchema, caseTypeTaskSchema, caseTypePhaseSchema, caseTypeDefinitionShape, caseValuesRepeated, CHAPTER_PROBE, caseTypeDefinitionSchema, caseTypeAbbreviationSchema, caseTypeNameSchema, createCaseTypeBody, publishCaseTypeVersionBody, setCaseTypeActiveBody, caseTypeParam, caseTypesPageQuery, caseTypeVersionQuery, CASE_TYPE_VERSION_CONFLICT_REASON;
|
|
14016
|
-
var
|
|
14017
|
-
"../../packages/core/dist/chunk-
|
|
14016
|
+
var init_chunk_MCLSEATL = __esm({
|
|
14017
|
+
"../../packages/core/dist/chunk-MCLSEATL.js"() {
|
|
14018
14018
|
"use strict";
|
|
14019
|
+
init_chunk_M2T55BV6();
|
|
14019
14020
|
init_chunk_CLGTGGVN();
|
|
14020
14021
|
init_chunk_KWRHZBGU();
|
|
14021
|
-
init_chunk_M2T55BV6();
|
|
14022
14022
|
init_chunk_HZ6CADSY();
|
|
14023
14023
|
init_chunk_ZTNFLGW5();
|
|
14024
14024
|
init_zod();
|
|
@@ -14229,7 +14229,7 @@ var init_chunk_LYVJU46L = __esm({
|
|
|
14229
14229
|
}
|
|
14230
14230
|
});
|
|
14231
14231
|
|
|
14232
|
-
// ../../packages/core/dist/chunk-
|
|
14232
|
+
// ../../packages/core/dist/chunk-UGKJPB2J.js
|
|
14233
14233
|
function openCaseProblem(body) {
|
|
14234
14234
|
const pairs = /* @__PURE__ */ new Set();
|
|
14235
14235
|
for (const [index, party] of body.parties.entries()) {
|
|
@@ -14242,10 +14242,10 @@ ${party.role}`;
|
|
|
14242
14242
|
return null;
|
|
14243
14243
|
}
|
|
14244
14244
|
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, previewOpenCaseShape, caseRecordParam, CASE_RECORD_STATUSES, caseRecordsQuery, CASE_STATE_SUMMARIES_MAX, caseStatesQuery, CASE_CLOSED_REASON, CASE_CLOSURE_REASON_MAX_LENGTH, closeCaseBody, setCaseConfidentialityBody;
|
|
14245
|
-
var
|
|
14246
|
-
"../../packages/core/dist/chunk-
|
|
14245
|
+
var init_chunk_UGKJPB2J = __esm({
|
|
14246
|
+
"../../packages/core/dist/chunk-UGKJPB2J.js"() {
|
|
14247
14247
|
"use strict";
|
|
14248
|
-
|
|
14248
|
+
init_chunk_MCLSEATL();
|
|
14249
14249
|
init_chunk_CLGTGGVN();
|
|
14250
14250
|
init_chunk_HZ6CADSY();
|
|
14251
14251
|
init_chunk_ZTNFLGW5();
|
|
@@ -14306,7 +14306,7 @@ var init_chunk_4EHHQFKV = __esm({
|
|
|
14306
14306
|
}
|
|
14307
14307
|
});
|
|
14308
14308
|
|
|
14309
|
-
// ../../packages/core/dist/chunk-
|
|
14309
|
+
// ../../packages/core/dist/chunk-BE4ATZB7.js
|
|
14310
14310
|
function caseReceivedFormat(fileName) {
|
|
14311
14311
|
const dot = fileName.lastIndexOf(".");
|
|
14312
14312
|
if (dot < 0) return null;
|
|
@@ -14314,13 +14314,13 @@ function caseReceivedFormat(fileName) {
|
|
|
14314
14314
|
return isCaseReceivedFormat(extension) ? extension : null;
|
|
14315
14315
|
}
|
|
14316
14316
|
var ZIP_SIGNATURE, CASE_RECEIVED_FORMATS, isCaseReceivedFormat, CASE_RECEIVED_PARTS, CASE_RECEIVED_TITLE_MAX_LENGTH, CASE_RECEIVED_TYPE_MAX_LENGTH, CASE_RECEIVED_TEXT_MAX_BYTES, CASE_RECEIVED_UPLOAD_BODY_MAX_BYTES, CASE_RECEIVED_DOCUMENT_FIELD, caseReceivedParam, registerCaseReceivedDocumentShape, caseReceivedUploadForm, caseReceivedFileName, ZIP_DIRECTORY_MAX_BYTES, CONTENT_TYPES_MAX_BYTES, CONTENT_TYPES_INFLATED_MAX_BYTES, CASE_RECEIVED_PAGE_MAX, caseReceivedQuery, caseReceivedContentQuery;
|
|
14317
|
-
var
|
|
14318
|
-
"../../packages/core/dist/chunk-
|
|
14317
|
+
var init_chunk_BE4ATZB7 = __esm({
|
|
14318
|
+
"../../packages/core/dist/chunk-BE4ATZB7.js"() {
|
|
14319
14319
|
"use strict";
|
|
14320
|
-
|
|
14320
|
+
init_chunk_YMFTFCT5();
|
|
14321
14321
|
init_chunk_ZJA3UZMG();
|
|
14322
14322
|
init_chunk_HPZOVPVT();
|
|
14323
|
-
|
|
14323
|
+
init_chunk_UGKJPB2J();
|
|
14324
14324
|
init_chunk_CLGTGGVN();
|
|
14325
14325
|
init_chunk_HZ6CADSY();
|
|
14326
14326
|
init_zod();
|
|
@@ -14395,14 +14395,25 @@ var init_chunk_4GVO7ZLI = __esm({
|
|
|
14395
14395
|
}
|
|
14396
14396
|
});
|
|
14397
14397
|
|
|
14398
|
-
// ../../packages/core/dist/chunk-
|
|
14398
|
+
// ../../packages/core/dist/chunk-COZBA6Z4.js
|
|
14399
|
+
var casePhaseParam;
|
|
14400
|
+
var init_chunk_COZBA6Z4 = __esm({
|
|
14401
|
+
"../../packages/core/dist/chunk-COZBA6Z4.js"() {
|
|
14402
|
+
"use strict";
|
|
14403
|
+
init_chunk_UGKJPB2J();
|
|
14404
|
+
init_chunk_HZ6CADSY();
|
|
14405
|
+
casePhaseParam = caseRecordParam.extend({ phase_id: uuidSchema });
|
|
14406
|
+
}
|
|
14407
|
+
});
|
|
14408
|
+
|
|
14409
|
+
// ../../packages/core/dist/chunk-6ITRMGLQ.js
|
|
14399
14410
|
var CASE_OFFICIAL_FILE_KINDS, CASE_OFFICIAL_FILE_NAME_PATTERN, publishCaseSubmissionBody, caseOfficialVersionParam, caseOfficialFileQuery;
|
|
14400
|
-
var
|
|
14401
|
-
"../../packages/core/dist/chunk-
|
|
14411
|
+
var init_chunk_6ITRMGLQ = __esm({
|
|
14412
|
+
"../../packages/core/dist/chunk-6ITRMGLQ.js"() {
|
|
14402
14413
|
"use strict";
|
|
14403
14414
|
init_chunk_YR7QALGP();
|
|
14404
14415
|
init_chunk_HPZOVPVT();
|
|
14405
|
-
|
|
14416
|
+
init_chunk_UGKJPB2J();
|
|
14406
14417
|
init_chunk_HZ6CADSY();
|
|
14407
14418
|
init_zod();
|
|
14408
14419
|
CASE_OFFICIAL_FILE_KINDS = [...CASE_SUBMISSION_ISSUED_KINDS, "file"];
|
|
@@ -14416,17 +14427,6 @@ var init_chunk_EFX3OU2G = __esm({
|
|
|
14416
14427
|
}
|
|
14417
14428
|
});
|
|
14418
14429
|
|
|
14419
|
-
// ../../packages/core/dist/chunk-3BFHRPHD.js
|
|
14420
|
-
var casePhaseParam;
|
|
14421
|
-
var init_chunk_3BFHRPHD = __esm({
|
|
14422
|
-
"../../packages/core/dist/chunk-3BFHRPHD.js"() {
|
|
14423
|
-
"use strict";
|
|
14424
|
-
init_chunk_4EHHQFKV();
|
|
14425
|
-
init_chunk_HZ6CADSY();
|
|
14426
|
-
casePhaseParam = caseRecordParam.extend({ phase_id: uuidSchema });
|
|
14427
|
-
}
|
|
14428
|
-
});
|
|
14429
|
-
|
|
14430
14430
|
// ../../packages/core/dist/chunk-64HCHXKB.js
|
|
14431
14431
|
var CASE_CHECK_CSV_MAX_BYTES, CASE_DECISIONS_CSV_PATH, CASE_CONFIDENTIAL_DECISIONS_CSV_PATH, caseChecksQuery;
|
|
14432
14432
|
var init_chunk_64HCHXKB = __esm({
|
|
@@ -14444,17 +14444,17 @@ var init_chunk_64HCHXKB = __esm({
|
|
|
14444
14444
|
}
|
|
14445
14445
|
});
|
|
14446
14446
|
|
|
14447
|
-
// ../../packages/core/dist/chunk-
|
|
14447
|
+
// ../../packages/core/dist/chunk-3SYJ5V22.js
|
|
14448
14448
|
var CASE_REVIEW_DECISIONS, CASE_ISSUED_FORMATS, CASE_REVIEW_COMMENT_MAX_LENGTH, CASE_REVIEW_JUSTIFICATION_MAX_LENGTH, text2, caseSubmissionParam, decideCaseSubmissionBody, caseIssuedQuery, CASE_APPROVALS_STATES, caseApprovalsQuery, caseCompareDefaultQuery, caseApprovalsAgendaQuery;
|
|
14449
|
-
var
|
|
14450
|
-
"../../packages/core/dist/chunk-
|
|
14449
|
+
var init_chunk_3SYJ5V22 = __esm({
|
|
14450
|
+
"../../packages/core/dist/chunk-3SYJ5V22.js"() {
|
|
14451
14451
|
"use strict";
|
|
14452
|
-
|
|
14453
|
-
|
|
14452
|
+
init_chunk_COZBA6Z4();
|
|
14453
|
+
init_chunk_6ITRMGLQ();
|
|
14454
14454
|
init_chunk_64HCHXKB();
|
|
14455
14455
|
init_chunk_YR7QALGP();
|
|
14456
14456
|
init_chunk_HPZOVPVT();
|
|
14457
|
-
|
|
14457
|
+
init_chunk_UGKJPB2J();
|
|
14458
14458
|
init_chunk_CLGTGGVN();
|
|
14459
14459
|
init_chunk_HZ6CADSY();
|
|
14460
14460
|
init_zod();
|
|
@@ -14524,15 +14524,15 @@ var init_chunk_26PIYACX = __esm({
|
|
|
14524
14524
|
}
|
|
14525
14525
|
});
|
|
14526
14526
|
|
|
14527
|
-
// ../../packages/core/dist/chunk-
|
|
14527
|
+
// ../../packages/core/dist/chunk-7JYZW5BH.js
|
|
14528
14528
|
function addCaseNoteProblem(note) {
|
|
14529
14529
|
return note.origin !== null && note.kind !== "contribution" ? { reason: "origin_not_contribution", at: "origin" } : null;
|
|
14530
14530
|
}
|
|
14531
14531
|
var CASE_NOTE_KINDS, CASE_NOTE_TEXT_MAX_LENGTH, CASE_NOTE_ORIGIN_MAX_LENGTH, CASE_NOTES_PAGE_MAX, addCaseNoteShape, addCaseNoteBody, caseNoteParam, caseTaskParam, caseNotesQuery;
|
|
14532
|
-
var
|
|
14533
|
-
"../../packages/core/dist/chunk-
|
|
14532
|
+
var init_chunk_7JYZW5BH = __esm({
|
|
14533
|
+
"../../packages/core/dist/chunk-7JYZW5BH.js"() {
|
|
14534
14534
|
"use strict";
|
|
14535
|
-
|
|
14535
|
+
init_chunk_UGKJPB2J();
|
|
14536
14536
|
init_chunk_CLGTGGVN();
|
|
14537
14537
|
init_chunk_HZ6CADSY();
|
|
14538
14538
|
init_zod();
|
|
@@ -14562,17 +14562,17 @@ var init_chunk_AVSVFP3W = __esm({
|
|
|
14562
14562
|
}
|
|
14563
14563
|
});
|
|
14564
14564
|
|
|
14565
|
-
// ../../packages/core/dist/chunk-
|
|
14565
|
+
// ../../packages/core/dist/chunk-BN7WSDWC.js
|
|
14566
14566
|
function casePassageLines(text5) {
|
|
14567
14567
|
const lines2 = text5.replace(/\r\n/g, "\n").split("\n");
|
|
14568
14568
|
if (lines2.at(-1) === "") lines2.pop();
|
|
14569
14569
|
return lines2;
|
|
14570
14570
|
}
|
|
14571
14571
|
var CASE_COMMENT_TEXT_MAX_LENGTH, CASE_COMMENTS_PAGE_MAX, CASE_COMMENT_LINE_MAX, casePassageLineSchema, lineNumber, addCaseCommentShape, CASE_COMMENT_REVERSED_REASON, addCaseCommentBody, caseCommentsQuery, CASE_COMMENT_OUT_OF_RANGE_REASON, CASE_COMMENT_NOT_TEXT_REASON, CASE_COMMENT_DOCUMENT_TOO_LARGE_REASON;
|
|
14572
|
-
var
|
|
14573
|
-
"../../packages/core/dist/chunk-
|
|
14572
|
+
var init_chunk_BN7WSDWC = __esm({
|
|
14573
|
+
"../../packages/core/dist/chunk-BN7WSDWC.js"() {
|
|
14574
14574
|
"use strict";
|
|
14575
|
-
|
|
14575
|
+
init_chunk_7JYZW5BH();
|
|
14576
14576
|
init_chunk_HPZOVPVT();
|
|
14577
14577
|
init_chunk_CLGTGGVN();
|
|
14578
14578
|
init_chunk_HZ6CADSY();
|
|
@@ -14611,12 +14611,12 @@ var init_chunk_OFJI6SZT = __esm({
|
|
|
14611
14611
|
}
|
|
14612
14612
|
});
|
|
14613
14613
|
|
|
14614
|
-
// ../../packages/core/dist/chunk-
|
|
14614
|
+
// ../../packages/core/dist/chunk-CSHU2GN3.js
|
|
14615
14615
|
var CASE_VERSION_DECISION_REASON_MAX_LENGTH, CASE_VERSION_DECISIONS, caseVersionDecisionReason, reason, lineNumber2, recordCaseReferenceBody, CASE_PASSAGE_REVERSED_REASON, citeCasePassageBody, decideCaseVersionBody, CASE_PASSAGE_LINK_REQUIRED_REASON, CASE_PASSAGE_LINK_CHANGED_REASON, CASE_PASSAGE_NO_TEXT_REASON, CASE_PASSAGE_TEXT_TOO_LARGE_REASON, CASE_PASSAGE_NOT_TEXT_REASON, CASE_PASSAGE_OUT_OF_RANGE_REASON;
|
|
14616
|
-
var
|
|
14617
|
-
"../../packages/core/dist/chunk-
|
|
14616
|
+
var init_chunk_CSHU2GN3 = __esm({
|
|
14617
|
+
"../../packages/core/dist/chunk-CSHU2GN3.js"() {
|
|
14618
14618
|
"use strict";
|
|
14619
|
-
|
|
14619
|
+
init_chunk_BN7WSDWC();
|
|
14620
14620
|
init_chunk_HZ6CADSY();
|
|
14621
14621
|
init_zod();
|
|
14622
14622
|
CASE_VERSION_DECISION_REASON_MAX_LENGTH = 2e3;
|
|
@@ -14655,13 +14655,13 @@ var init_chunk_FT63I5NG = __esm({
|
|
|
14655
14655
|
}
|
|
14656
14656
|
});
|
|
14657
14657
|
|
|
14658
|
-
// ../../packages/core/dist/chunk-
|
|
14658
|
+
// ../../packages/core/dist/chunk-YCVI6W6V.js
|
|
14659
14659
|
var lines, ordered, citeCaseOfficialVersionPassageBody, citeCaseReceivedPassageBody, citeCaseSourcePassageBody, citeCaseInputPassageBody, caseSourceRefSchema;
|
|
14660
|
-
var
|
|
14661
|
-
"../../packages/core/dist/chunk-
|
|
14660
|
+
var init_chunk_YCVI6W6V = __esm({
|
|
14661
|
+
"../../packages/core/dist/chunk-YCVI6W6V.js"() {
|
|
14662
14662
|
"use strict";
|
|
14663
|
-
|
|
14664
|
-
|
|
14663
|
+
init_chunk_CSHU2GN3();
|
|
14664
|
+
init_chunk_BN7WSDWC();
|
|
14665
14665
|
init_chunk_HZ6CADSY();
|
|
14666
14666
|
init_zod();
|
|
14667
14667
|
lines = { line_start: casePassageLineSchema, line_end: casePassageLineSchema };
|
|
@@ -14679,12 +14679,12 @@ var init_chunk_5MNWTL44 = __esm({
|
|
|
14679
14679
|
}
|
|
14680
14680
|
});
|
|
14681
14681
|
|
|
14682
|
-
// ../../packages/core/dist/chunk-
|
|
14682
|
+
// ../../packages/core/dist/chunk-4MH4X3D4.js
|
|
14683
14683
|
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;
|
|
14684
|
-
var
|
|
14685
|
-
"../../packages/core/dist/chunk-
|
|
14684
|
+
var init_chunk_4MH4X3D4 = __esm({
|
|
14685
|
+
"../../packages/core/dist/chunk-4MH4X3D4.js"() {
|
|
14686
14686
|
"use strict";
|
|
14687
|
-
|
|
14687
|
+
init_chunk_UGKJPB2J();
|
|
14688
14688
|
init_chunk_CLGTGGVN();
|
|
14689
14689
|
init_chunk_HZ6CADSY();
|
|
14690
14690
|
init_zod();
|
|
@@ -14725,12 +14725,12 @@ var init_chunk_CQERU52D = __esm({
|
|
|
14725
14725
|
}
|
|
14726
14726
|
});
|
|
14727
14727
|
|
|
14728
|
-
// ../../packages/core/dist/chunk-
|
|
14728
|
+
// ../../packages/core/dist/chunk-B5Y3JXHS.js
|
|
14729
14729
|
var CASE_CHANGE_TOPICS, caseChangedFrameSchema;
|
|
14730
|
-
var
|
|
14731
|
-
"../../packages/core/dist/chunk-
|
|
14730
|
+
var init_chunk_B5Y3JXHS = __esm({
|
|
14731
|
+
"../../packages/core/dist/chunk-B5Y3JXHS.js"() {
|
|
14732
14732
|
"use strict";
|
|
14733
|
-
|
|
14733
|
+
init_chunk_UGKJPB2J();
|
|
14734
14734
|
init_chunk_HZ6CADSY();
|
|
14735
14735
|
init_zod();
|
|
14736
14736
|
CASE_CHANGE_TOPICS = ["submission", "agenda", "review", "access"];
|
|
@@ -14758,14 +14758,14 @@ var init_chunk_PSY4BJ7E = __esm({
|
|
|
14758
14758
|
}
|
|
14759
14759
|
});
|
|
14760
14760
|
|
|
14761
|
-
// ../../packages/core/dist/chunk-
|
|
14761
|
+
// ../../packages/core/dist/chunk-VGNNAETO.js
|
|
14762
14762
|
var caseInputLinkParam, caseCollectionDocumentOfCaseParam, linkCaseCollectionInputBody, linkCasePreviousOutputInputBody, linkCaseReceivedInputBody, linkCaseInputBody, CASE_LINK_OFFICIAL_VERSION_UNKNOWN_REASON, CASE_LINK_OUTPUT_NOT_PRIOR_REASON, CASE_LINK_RECEIVED_UNKNOWN_REASON, CASE_LINK_DOCUMENT_TYPE_MISMATCH_REASON, CASE_LINK_VERSION_NOT_CURRENT_REASON, CASE_COLLECTION_CASES_PAGE_MAX, caseCollectionCasesQuery, CASE_REFERENCES_PAGE_MAX, caseReferencesQuery;
|
|
14763
|
-
var
|
|
14764
|
-
"../../packages/core/dist/chunk-
|
|
14763
|
+
var init_chunk_VGNNAETO = __esm({
|
|
14764
|
+
"../../packages/core/dist/chunk-VGNNAETO.js"() {
|
|
14765
14765
|
"use strict";
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14766
|
+
init_chunk_CSHU2GN3();
|
|
14767
|
+
init_chunk_YMFTFCT5();
|
|
14768
|
+
init_chunk_UGKJPB2J();
|
|
14769
14769
|
init_chunk_CLGTGGVN();
|
|
14770
14770
|
init_chunk_HZ6CADSY();
|
|
14771
14771
|
init_zod();
|
|
@@ -14928,12 +14928,12 @@ var init_chunk_GCPFVAXX = __esm({
|
|
|
14928
14928
|
}
|
|
14929
14929
|
});
|
|
14930
14930
|
|
|
14931
|
-
// ../../packages/core/dist/chunk-
|
|
14931
|
+
// ../../packages/core/dist/chunk-UMM5CTTH.js
|
|
14932
14932
|
var CASE_ADJUSTMENT_REASON_MAX_LENGTH, CASE_ADJUSTMENT_DISPENSATION_KINDS, reason2, activateCasePhaseBody, dispenseCaseBody, addCaseTaskBody, addCaseInputBody, caseOwnItemSchema, addCaseItemBody;
|
|
14933
|
-
var
|
|
14934
|
-
"../../packages/core/dist/chunk-
|
|
14933
|
+
var init_chunk_UMM5CTTH = __esm({
|
|
14934
|
+
"../../packages/core/dist/chunk-UMM5CTTH.js"() {
|
|
14935
14935
|
"use strict";
|
|
14936
|
-
|
|
14936
|
+
init_chunk_MCLSEATL();
|
|
14937
14937
|
init_chunk_HZ6CADSY();
|
|
14938
14938
|
init_zod();
|
|
14939
14939
|
CASE_ADJUSTMENT_REASON_MAX_LENGTH = 2e3;
|
|
@@ -14964,15 +14964,15 @@ var init_chunk_ONZPYX5Y = __esm({
|
|
|
14964
14964
|
}
|
|
14965
14965
|
});
|
|
14966
14966
|
|
|
14967
|
-
// ../../packages/core/dist/chunk-
|
|
14967
|
+
// ../../packages/core/dist/chunk-IRY6N2QR.js
|
|
14968
14968
|
var CASE_AGENDA_VALUE_MAX_LENGTH, CASE_AGENDA_JUSTIFICATION_MAX_LENGTH, CASE_AGENDA_EVIDENCE_MAX_LENGTH, CASE_AGENDA_COMMENT_MAX_LENGTH, CASE_AGENDA_VERDICTS, comment, caseAgendaGroupParam, caseAgendaDecisionParam, caseAgendaQuery, caseApprovedDecisionsQuery, proposeCaseAgendaValueBody, decideCaseAgendaBody, dispenseCaseAgendaBody, addCaseDecisionBody;
|
|
14969
|
-
var
|
|
14970
|
-
"../../packages/core/dist/chunk-
|
|
14969
|
+
var init_chunk_IRY6N2QR = __esm({
|
|
14970
|
+
"../../packages/core/dist/chunk-IRY6N2QR.js"() {
|
|
14971
14971
|
"use strict";
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
init_chunk_CLGTGGVN();
|
|
14972
|
+
init_chunk_UGKJPB2J();
|
|
14973
|
+
init_chunk_MCLSEATL();
|
|
14975
14974
|
init_chunk_M2T55BV6();
|
|
14975
|
+
init_chunk_CLGTGGVN();
|
|
14976
14976
|
init_chunk_HZ6CADSY();
|
|
14977
14977
|
init_zod();
|
|
14978
14978
|
CASE_AGENDA_VALUE_MAX_LENGTH = 2e3;
|
|
@@ -15011,6 +15011,19 @@ var init_chunk_QNVB4W63 = __esm({
|
|
|
15011
15011
|
}
|
|
15012
15012
|
});
|
|
15013
15013
|
|
|
15014
|
+
// ../../packages/core/dist/chunk-NVKU5PPQ.js
|
|
15015
|
+
var ADMIN_SKILL_NAME_REGEX, adminSkillNameParam;
|
|
15016
|
+
var init_chunk_NVKU5PPQ = __esm({
|
|
15017
|
+
"../../packages/core/dist/chunk-NVKU5PPQ.js"() {
|
|
15018
|
+
"use strict";
|
|
15019
|
+
init_zod();
|
|
15020
|
+
ADMIN_SKILL_NAME_REGEX = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
15021
|
+
adminSkillNameParam = external_exports.object({
|
|
15022
|
+
name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX, "invalid skill name")
|
|
15023
|
+
});
|
|
15024
|
+
}
|
|
15025
|
+
});
|
|
15026
|
+
|
|
15014
15027
|
// ../../packages/core/dist/chunk-FECLIZTY.js
|
|
15015
15028
|
var TURN_DEADLINE_SECONDS_FLOOR, TURN_DEADLINE_SECONDS_MAX;
|
|
15016
15029
|
var init_chunk_FECLIZTY = __esm({
|
|
@@ -16457,10 +16470,10 @@ var init_chunk_UM2UFZAQ = __esm({
|
|
|
16457
16470
|
}
|
|
16458
16471
|
});
|
|
16459
16472
|
|
|
16460
|
-
// ../../packages/core/dist/chunk-
|
|
16461
|
-
var analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlTable, analyticsSqlSchemaQuery, analyticsCategoryInfoSchema, analyticsVariableTypeSchema, analyticsConversationVariableSchema, analyticsVariablesByHubResponseSchema, analyticsStructuredQueryResponseSchema, analyticsSqlResponseSchema, analyticsSqlSchemaPathSchema, analyticsSqlSchemaResponseSchema;
|
|
16462
|
-
var
|
|
16463
|
-
"../../packages/core/dist/chunk-
|
|
16473
|
+
// ../../packages/core/dist/chunk-5QVZHYHM.js
|
|
16474
|
+
var analyticsHubIdParam, analyticsVariableIdParam, updateVariablePinBody, updateAnalyticsViewBody, NUMERIC_FILTER_OPS, TEXT_FILTER_OPS, CATEGORICAL_FILTER_OPS, VARIABLE_FILTER_OPS, STRUCTURED_QUERY_OPS, STRUCTURED_QUERY_AGGREGATIONS, filterValueSchema, conversationsBody, analyticsConversationIdParam, messagesQuery, conversationDetailDataQuery, analyticsDataBody, structuredQueryBody, analyticsSqlBody, analyticsSqlTable, analyticsSqlSchemaQuery, analyticsCategoryInfoSchema, analyticsVariableTypeSchema, analyticsConversationVariableSchema, analyticsVariablesByHubResponseSchema, analyticsConversationListItemSchema, analyticsConversationsListResponseSchema, analyticsDataItemFields, analyticsMetricsSchema, analyticsTrendDataPointSchema, analyticsCategoryShareSchema, analyticsDataItemSchema, analyticsSummaryFormatSchema, analyticsSummaryFigureSchema, analyticsSummaryFigures, analyticsSummaryTrendDataSchema, analyticsSummaryDataSchema, analyticsDataVariableSchema, analyticsVariablesOnlyResponseSchema, analyticsDataResponseSchema, analyticsStructuredQueryResponseSchema, analyticsSqlResponseSchema, analyticsSqlSchemaPathSchema, analyticsSqlSchemaResponseSchema;
|
|
16475
|
+
var init_chunk_5QVZHYHM = __esm({
|
|
16476
|
+
"../../packages/core/dist/chunk-5QVZHYHM.js"() {
|
|
16464
16477
|
"use strict";
|
|
16465
16478
|
init_zod();
|
|
16466
16479
|
analyticsHubIdParam = external_exports.object({
|
|
@@ -16592,6 +16605,166 @@ var init_chunk_7A3D5AN6 = __esm({
|
|
|
16592
16605
|
variablesByCategory: external_exports.record(external_exports.string(), external_exports.array(analyticsConversationVariableSchema))
|
|
16593
16606
|
})
|
|
16594
16607
|
});
|
|
16608
|
+
analyticsConversationListItemSchema = external_exports.object({
|
|
16609
|
+
conversation_id: external_exports.string().min(1),
|
|
16610
|
+
/** `ended` for a row with none. */
|
|
16611
|
+
conversation_status: external_exports.string(),
|
|
16612
|
+
/** When the conversation began. */
|
|
16613
|
+
timestamp: external_exports.string(),
|
|
16614
|
+
ended_at: external_exports.string().nullable(),
|
|
16615
|
+
hub_id: external_exports.string().min(1),
|
|
16616
|
+
/** Empty when the hub's name could not be read. */
|
|
16617
|
+
hub_name: external_exports.string(),
|
|
16618
|
+
hub_type: external_exports.string().nullable(),
|
|
16619
|
+
user_id: external_exports.string(),
|
|
16620
|
+
/** The hub user's name; absent when the hub has none for `user_id`. */
|
|
16621
|
+
user_name: external_exports.string().optional(),
|
|
16622
|
+
/** `user_name`, else the conversation's subject, else empty. */
|
|
16623
|
+
name: external_exports.string(),
|
|
16624
|
+
/** The conversation's summary variable, empty when it has none. */
|
|
16625
|
+
message_text: external_exports.string(),
|
|
16626
|
+
is_flagged: external_exports.boolean(),
|
|
16627
|
+
flag_source: external_exports.string().nullable(),
|
|
16628
|
+
kanban_status: external_exports.string().nullable(),
|
|
16629
|
+
/** Absent when the row has no value (or an empty one). */
|
|
16630
|
+
user_sentiment: external_exports.string().optional(),
|
|
16631
|
+
goal_achieved: external_exports.string().optional()
|
|
16632
|
+
});
|
|
16633
|
+
analyticsConversationsListResponseSchema = external_exports.object({
|
|
16634
|
+
success: external_exports.literal(true),
|
|
16635
|
+
/** One page, newest first. */
|
|
16636
|
+
conversations: external_exports.array(analyticsConversationListItemSchema),
|
|
16637
|
+
/** Every conversation the filters match. */
|
|
16638
|
+
total: external_exports.number().int(),
|
|
16639
|
+
offset: external_exports.number().int(),
|
|
16640
|
+
limit: external_exports.number().int(),
|
|
16641
|
+
/**
|
|
16642
|
+
* Present, and `true`, only when ClickHouse was cold and the answer is a provisional empty result —
|
|
16643
|
+
* the client should keep polling until this flag disappears.
|
|
16644
|
+
*/
|
|
16645
|
+
cold: external_exports.literal(true).optional()
|
|
16646
|
+
});
|
|
16647
|
+
analyticsDataItemFields = {
|
|
16648
|
+
/** The variable's name. */
|
|
16649
|
+
variable: external_exports.string(),
|
|
16650
|
+
/** The id it was selected by: a `conversation_variable` row's, or `sys:{name}`. */
|
|
16651
|
+
variable_id: external_exports.string().min(1)
|
|
16652
|
+
};
|
|
16653
|
+
analyticsMetricsSchema = external_exports.object({
|
|
16654
|
+
average: external_exports.number().nullable(),
|
|
16655
|
+
median: external_exports.number().nullable(),
|
|
16656
|
+
sum: external_exports.number().nullable(),
|
|
16657
|
+
minimum: external_exports.number().nullable(),
|
|
16658
|
+
maximum: external_exports.number().nullable(),
|
|
16659
|
+
count: external_exports.number(),
|
|
16660
|
+
deciles: external_exports.array(external_exports.number().nullable())
|
|
16661
|
+
});
|
|
16662
|
+
analyticsTrendDataPointSchema = external_exports.object({
|
|
16663
|
+
period: external_exports.string(),
|
|
16664
|
+
aggregations: external_exports.object({
|
|
16665
|
+
avg: external_exports.number().nullable(),
|
|
16666
|
+
median: external_exports.number().nullable(),
|
|
16667
|
+
min: external_exports.number().nullable(),
|
|
16668
|
+
max: external_exports.number().nullable(),
|
|
16669
|
+
sum: external_exports.number().nullable(),
|
|
16670
|
+
count: external_exports.number()
|
|
16671
|
+
})
|
|
16672
|
+
});
|
|
16673
|
+
analyticsCategoryShareSchema = external_exports.object({ count: external_exports.number(), percentage: external_exports.number() });
|
|
16674
|
+
analyticsDataItemSchema = external_exports.union([
|
|
16675
|
+
external_exports.object({ ...analyticsDataItemFields, type: external_exports.literal("numeric"), metrics: analyticsMetricsSchema }),
|
|
16676
|
+
external_exports.object({ ...analyticsDataItemFields, type: external_exports.literal("numeric"), data: external_exports.array(analyticsTrendDataPointSchema) }),
|
|
16677
|
+
external_exports.object({
|
|
16678
|
+
...analyticsDataItemFields,
|
|
16679
|
+
type: external_exports.literal("categorical"),
|
|
16680
|
+
metrics: external_exports.object({
|
|
16681
|
+
/** Most frequent first. */
|
|
16682
|
+
distribution: external_exports.array(analyticsCategoryShareSchema.extend({ category: external_exports.string() })),
|
|
16683
|
+
total_count: external_exports.number(),
|
|
16684
|
+
unique_categories: external_exports.number()
|
|
16685
|
+
})
|
|
16686
|
+
}),
|
|
16687
|
+
external_exports.object({
|
|
16688
|
+
...analyticsDataItemFields,
|
|
16689
|
+
type: external_exports.literal("categorical"),
|
|
16690
|
+
/** `value` keyed by category; `{}` for a bucket with none. */
|
|
16691
|
+
data: external_exports.array(external_exports.object({ period: external_exports.string(), value: external_exports.record(external_exports.string(), analyticsCategoryShareSchema) }))
|
|
16692
|
+
}),
|
|
16693
|
+
external_exports.object({
|
|
16694
|
+
...analyticsDataItemFields,
|
|
16695
|
+
type: external_exports.literal("text"),
|
|
16696
|
+
metrics: external_exports.object({
|
|
16697
|
+
/** The most frequent words, most frequent first: `value` is the word's count. */
|
|
16698
|
+
words: external_exports.array(external_exports.object({ text: external_exports.string(), value: external_exports.number(), percentage: external_exports.number() })),
|
|
16699
|
+
total_words: external_exports.number(),
|
|
16700
|
+
unique_words: external_exports.number()
|
|
16701
|
+
})
|
|
16702
|
+
}),
|
|
16703
|
+
external_exports.object({
|
|
16704
|
+
...analyticsDataItemFields,
|
|
16705
|
+
type: external_exports.literal("text"),
|
|
16706
|
+
/** `value` maps each of the bucket's most frequent words to its percentage, as text. */
|
|
16707
|
+
data: external_exports.array(external_exports.object({ period: external_exports.string(), value: external_exports.record(external_exports.string(), external_exports.string()) }))
|
|
16708
|
+
})
|
|
16709
|
+
]);
|
|
16710
|
+
analyticsSummaryFormatSchema = external_exports.enum(["number", "percentage", "time"]);
|
|
16711
|
+
analyticsSummaryFigureSchema = external_exports.object({
|
|
16712
|
+
value: external_exports.number().nullable(),
|
|
16713
|
+
label: external_exports.string(),
|
|
16714
|
+
format: analyticsSummaryFormatSchema
|
|
16715
|
+
});
|
|
16716
|
+
analyticsSummaryFigures = {
|
|
16717
|
+
conversations: analyticsSummaryFigureSchema,
|
|
16718
|
+
users: analyticsSummaryFigureSchema,
|
|
16719
|
+
/** The share of conversations whose `escalation_occurred` is `false`, as a percentage (0–100). */
|
|
16720
|
+
"ai_only_%": analyticsSummaryFigureSchema,
|
|
16721
|
+
avg_agent_response: analyticsSummaryFigureSchema,
|
|
16722
|
+
avg_team_response: analyticsSummaryFigureSchema,
|
|
16723
|
+
first_team_response: analyticsSummaryFigureSchema,
|
|
16724
|
+
input_tokens: analyticsSummaryFigureSchema,
|
|
16725
|
+
cached_tokens: analyticsSummaryFigureSchema,
|
|
16726
|
+
output_tokens: analyticsSummaryFigureSchema
|
|
16727
|
+
};
|
|
16728
|
+
analyticsSummaryTrendDataSchema = external_exports.object({ period: external_exports.string(), ...analyticsSummaryFigures });
|
|
16729
|
+
analyticsSummaryDataSchema = external_exports.union([
|
|
16730
|
+
external_exports.object({
|
|
16731
|
+
data: external_exports.array(analyticsSummaryTrendDataSchema),
|
|
16732
|
+
metadata: external_exports.object({
|
|
16733
|
+
fields: external_exports.array(external_exports.object({ key: external_exports.string(), label: external_exports.string(), format: analyticsSummaryFormatSchema }))
|
|
16734
|
+
}).optional()
|
|
16735
|
+
}),
|
|
16736
|
+
external_exports.object(analyticsSummaryFigures),
|
|
16737
|
+
external_exports.object({})
|
|
16738
|
+
]);
|
|
16739
|
+
analyticsDataVariableSchema = external_exports.object({
|
|
16740
|
+
variable_id: external_exports.string().min(1),
|
|
16741
|
+
variable_name: external_exports.string(),
|
|
16742
|
+
variable_description: external_exports.string().nullable().optional(),
|
|
16743
|
+
variable_label: external_exports.string().nullable().optional(),
|
|
16744
|
+
variable_type: external_exports.string(),
|
|
16745
|
+
variable_origin: external_exports.string(),
|
|
16746
|
+
variable_category: external_exports.string().nullable().optional(),
|
|
16747
|
+
variable_enum: external_exports.array(external_exports.unknown()),
|
|
16748
|
+
pin: external_exports.boolean(),
|
|
16749
|
+
agent_parameter: external_exports.null()
|
|
16750
|
+
});
|
|
16751
|
+
analyticsVariablesOnlyResponseSchema = external_exports.object({
|
|
16752
|
+
variables: external_exports.array(analyticsDataVariableSchema)
|
|
16753
|
+
});
|
|
16754
|
+
analyticsDataResponseSchema = external_exports.object({
|
|
16755
|
+
/** The numeric, then categorical, then text variables. */
|
|
16756
|
+
analytics: external_exports.array(analyticsDataItemSchema),
|
|
16757
|
+
/** Present only with `include_summary`. */
|
|
16758
|
+
summary: analyticsSummaryDataSchema.optional(),
|
|
16759
|
+
/** Present only with `include_variables`. */
|
|
16760
|
+
variables: external_exports.array(analyticsDataVariableSchema).optional(),
|
|
16761
|
+
/**
|
|
16762
|
+
* Present, and `true`, when any of the parallel fan-out queries (numeric / categorical / text /
|
|
16763
|
+
* summary) met a ClickHouse cold start, whose part of the answer is then empty. The frontend uses
|
|
16764
|
+
* this single flag to flip the cold store and show the cold-start banner.
|
|
16765
|
+
*/
|
|
16766
|
+
cold: external_exports.literal(true).optional()
|
|
16767
|
+
});
|
|
16595
16768
|
analyticsStructuredQueryResponseSchema = external_exports.object({
|
|
16596
16769
|
success: external_exports.literal(true),
|
|
16597
16770
|
data: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())),
|
|
@@ -17591,7 +17764,7 @@ var init_chunk_LBDH7LCG = __esm({
|
|
|
17591
17764
|
}
|
|
17592
17765
|
});
|
|
17593
17766
|
|
|
17594
|
-
// ../../packages/core/dist/chunk-
|
|
17767
|
+
// ../../packages/core/dist/chunk-6KWTXHFE.js
|
|
17595
17768
|
function declaresNoConnection(agent) {
|
|
17596
17769
|
return agent.connection === null && !agent.connection_id;
|
|
17597
17770
|
}
|
|
@@ -17942,10 +18115,10 @@ function refineHubAsCodeCallOpenings(config, ctx) {
|
|
|
17942
18115
|
function utf8ByteLength2(value) {
|
|
17943
18116
|
let bytes = 0;
|
|
17944
18117
|
for (let i = 0; i < value.length; i++) {
|
|
17945
|
-
const
|
|
17946
|
-
if (
|
|
17947
|
-
else if (
|
|
17948
|
-
else if (
|
|
18118
|
+
const code3 = value.charCodeAt(i);
|
|
18119
|
+
if (code3 < 128) bytes += 1;
|
|
18120
|
+
else if (code3 < 2048) bytes += 2;
|
|
18121
|
+
else if (code3 >= 55296 && code3 <= 56319 && i + 1 < value.length && value.charCodeAt(i + 1) >= 56320 && value.charCodeAt(i + 1) <= 57343) {
|
|
17949
18122
|
bytes += 4;
|
|
17950
18123
|
i++;
|
|
17951
18124
|
} else bytes += 3;
|
|
@@ -18322,9 +18495,9 @@ function skillSectionsAsResources(scope) {
|
|
|
18322
18495
|
return out;
|
|
18323
18496
|
};
|
|
18324
18497
|
}
|
|
18325
|
-
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, hubAsCodeKanbanFollowupSchema, hubAsCodeKanbanOutcomeSchema, hubAsCodeKanbanStatusSchema, hubAsCodeLaneSchema, hubAsCodePageSchema, MAX_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, hubAsCodeCallOpeningSchema, hubAsCodeCallOpeningFileSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeEvaluationVariableSchema, hubAsCodeNativeToolSchema, hubAsCodeMcpToolSchema, hubAsCodeCustomToolSchema, hubAsCodeStateSchema, hubAsCodeTeamSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, hubAsCodeAgentResourceSchema, hubAsCodeDelegationToolSchema, hubAsCodeAgentSchema, HUB_AS_CODE_AGENT_KEYS, HUB_AS_CODE_AGENT_TOOL_KEYS, orgAsCodeResourceFolderSchema, orgAsCodeResourceSchema, orgResourcesPayloadSchema, hubAsCodeAutomationSchema, HUB_AS_CODE_AUTOMATION_KEYS, HUB_AS_CODE_AUTOMATION_TRIGGER_KEYS, HUB_AS_CODE_AUTOMATION_TARGET_KEYS, HUB_AS_CODE_AUTOMATION_ACTION_KEYS, HUB_AS_CODE_AUTOMATION_GATE_KEYS, hubAsCodeContactListSchema, HUB_AS_CODE_CONTACT_LIST_KEYS, HUB_AS_CODE_CONTACT_LIST_FILTER_KEYS, hubAsCodeEvalMessageFields, hubAsCodeHistoryTurnSchema, hubAsCodeEvalSchema, hubAsCodeEvalAttachmentFileSchema, hubAsCodeJourneyTurnSchema, hubAsCodeJourneyStepOverrideSchema, hubAsCodeJourneySchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, hubAsCodeConfigObjectSchema, hubAsCodeConfigSchema, hubAsCodeConnectionSchema, hubAsCodePayloadSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciDiffDirectionSchema, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, ciDiffHunkSectionSchema, ciDiffHunkSchema, ciDiffResponseFields, ciDiffResponseSchema, ciOrgSkillsDiffResponseSchema, ciHubIdentitySchema, ciLookupResponseSchema, ciOrganizationsResponseSchema, ciCreateOrganizationResponseSchema, ciHubListItemSchema, ciHubListResponseSchema, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, CI_SKIPPABLE_TOOL_GROUPS, ciSkippedEntrySchema, ciSyncResponseSchema, ciPublishResponseSchema, ciMcpDriftEntrySchema, ciSyncMcpResponseSchema, ciPublishPreviewResponseSchema, ciBranchInfoSchema, ciBranchListResponseSchema, ciBranchDeleteResponseSchema, ciOrgResourcesPullFileSchema, ciOrgResourcesPullFolderSchema, ciOrgResourcesPullResourceSchema, ciOrgResourcesPullResponseSchema, ciOrgResourcesPushResponseSchema;
|
|
18326
|
-
var
|
|
18327
|
-
"../../packages/core/dist/chunk-
|
|
18498
|
+
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, hubAsCodeKanbanFollowupSchema, hubAsCodeKanbanOutcomeSchema, hubAsCodeKanbanStatusSchema, hubAsCodeLaneSchema, hubAsCodePageSchema, MAX_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, hubAsCodeCallOpeningSchema, hubAsCodeCallOpeningFileSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeEvaluationVariableSchema, hubAsCodeNativeToolSchema, hubAsCodeMcpToolSchema, hubAsCodeCustomToolSchema, hubAsCodeStateSchema, hubAsCodeTeamSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, hubAsCodeAgentResourceSchema, hubAsCodeDelegationToolSchema, hubAsCodeAgentSchema, HUB_AS_CODE_AGENT_KEYS, HUB_AS_CODE_AGENT_TOOL_KEYS, orgAsCodeResourceFolderSchema, orgAsCodeResourceSchema, orgResourcesPayloadSchema, hubAsCodeAutomationSchema, HUB_AS_CODE_AUTOMATION_KEYS, HUB_AS_CODE_AUTOMATION_TRIGGER_KEYS, HUB_AS_CODE_AUTOMATION_TARGET_KEYS, HUB_AS_CODE_AUTOMATION_ACTION_KEYS, HUB_AS_CODE_AUTOMATION_GATE_KEYS, hubAsCodeContactListSchema, HUB_AS_CODE_CONTACT_LIST_KEYS, HUB_AS_CODE_CONTACT_LIST_FILTER_KEYS, hubAsCodeEvalMessageFields, hubAsCodeHistoryTurnSchema, hubAsCodeEvalSchema, hubAsCodeEvalAttachmentFileSchema, hubAsCodeJourneyTurnSchema, hubAsCodeJourneyStepOverrideSchema, hubAsCodeJourneySchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, hubAsCodeConfigObjectSchema, hubAsCodeConfigSchema, hubAsCodeConnectionSchema, hubAsCodePayloadSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciDiffDirectionSchema, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, ciDiffHunkSectionSchema, ciDiffHunkSchema, PAGE_DESIGN_RULES, ciPageDesignFindingSchema, ciDiffResponseFields, ciDiffResponseSchema, ciOrgSkillsDiffResponseSchema, ciHubIdentitySchema, ciLookupResponseSchema, ciOrganizationsResponseSchema, ciCreateOrganizationResponseSchema, ciHubListItemSchema, ciHubListResponseSchema, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, CI_SKIPPABLE_TOOL_GROUPS, ciSkippedEntrySchema, ciSyncResponseSchema, ciPublishResponseSchema, ciMcpDriftEntrySchema, ciSyncMcpResponseSchema, ciPublishPreviewResponseSchema, ciBranchInfoSchema, ciBranchListResponseSchema, ciBranchDeleteResponseSchema, ciOrgResourcesPullFileSchema, ciOrgResourcesPullFolderSchema, ciOrgResourcesPullResourceSchema, ciOrgResourcesPullResponseSchema, ciOrgResourcesPushResponseSchema;
|
|
18499
|
+
var init_chunk_6KWTXHFE = __esm({
|
|
18500
|
+
"../../packages/core/dist/chunk-6KWTXHFE.js"() {
|
|
18328
18501
|
"use strict";
|
|
18329
18502
|
init_chunk_QG3XMUEN();
|
|
18330
18503
|
init_chunk_EBUWHIFV();
|
|
@@ -19288,6 +19461,20 @@ var init_chunk_NOVD6LKY = __esm({
|
|
|
19288
19461
|
name: external_exports.string().nullable(),
|
|
19289
19462
|
fields: external_exports.array(external_exports.string())
|
|
19290
19463
|
});
|
|
19464
|
+
PAGE_DESIGN_RULES = [
|
|
19465
|
+
"hard-coded-color",
|
|
19466
|
+
"no-theme",
|
|
19467
|
+
"fixed-width",
|
|
19468
|
+
"table-overflow",
|
|
19469
|
+
"remote-load",
|
|
19470
|
+
"list-empty-state",
|
|
19471
|
+
"list-error-state"
|
|
19472
|
+
];
|
|
19473
|
+
ciPageDesignFindingSchema = external_exports.object({
|
|
19474
|
+
page: external_exports.string(),
|
|
19475
|
+
rule: external_exports.enum(PAGE_DESIGN_RULES),
|
|
19476
|
+
message: external_exports.string()
|
|
19477
|
+
});
|
|
19291
19478
|
ciDiffResponseFields = {
|
|
19292
19479
|
has_changes: external_exports.boolean(),
|
|
19293
19480
|
direction: ciDiffDirectionSchema,
|
|
@@ -19321,7 +19508,15 @@ var init_chunk_NOVD6LKY = __esm({
|
|
|
19321
19508
|
* without this the silent no-op is invisible. Optional for back-compat with
|
|
19322
19509
|
* older backends. See gh hub-branching.
|
|
19323
19510
|
*/
|
|
19324
|
-
preview_label: external_exports.string().nullable().optional()
|
|
19511
|
+
preview_label: external_exports.string().nullable().optional(),
|
|
19512
|
+
/**
|
|
19513
|
+
* The design lint's findings for the pages a push diff carries, in their order
|
|
19514
|
+
* (`pageDesignFindings`); empty for a pull diff, which writes no page. Never in `warnings`, so a
|
|
19515
|
+
* CLI that lints its own pages, as every CLI before this field did, prints each finding once.
|
|
19516
|
+
* Absent from a server older than the field; a client then lints its own pages with the same
|
|
19517
|
+
* function.
|
|
19518
|
+
*/
|
|
19519
|
+
page_design: external_exports.array(ciPageDesignFindingSchema).optional()
|
|
19325
19520
|
});
|
|
19326
19521
|
ciOrgSkillsDiffResponseSchema = external_exports.object({
|
|
19327
19522
|
...ciDiffResponseFields,
|
|
@@ -19537,19 +19732,6 @@ var init_chunk_NOVD6LKY = __esm({
|
|
|
19537
19732
|
}
|
|
19538
19733
|
});
|
|
19539
19734
|
|
|
19540
|
-
// ../../packages/core/dist/chunk-NVKU5PPQ.js
|
|
19541
|
-
var ADMIN_SKILL_NAME_REGEX, adminSkillNameParam;
|
|
19542
|
-
var init_chunk_NVKU5PPQ = __esm({
|
|
19543
|
-
"../../packages/core/dist/chunk-NVKU5PPQ.js"() {
|
|
19544
|
-
"use strict";
|
|
19545
|
-
init_zod();
|
|
19546
|
-
ADMIN_SKILL_NAME_REGEX = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
19547
|
-
adminSkillNameParam = external_exports.object({
|
|
19548
|
-
name: external_exports.string().regex(ADMIN_SKILL_NAME_REGEX, "invalid skill name")
|
|
19549
|
-
});
|
|
19550
|
-
}
|
|
19551
|
-
});
|
|
19552
|
-
|
|
19553
19735
|
// ../../packages/core/dist/chunk-SOJMWM63.js
|
|
19554
19736
|
var init_chunk_SOJMWM63 = __esm({
|
|
19555
19737
|
"../../packages/core/dist/chunk-SOJMWM63.js"() {
|
|
@@ -19600,6 +19782,7 @@ var init_chunk_ZRXP6OOJ = __esm({
|
|
|
19600
19782
|
var init_contracts = __esm({
|
|
19601
19783
|
"../../packages/core/dist/contracts/index.js"() {
|
|
19602
19784
|
"use strict";
|
|
19785
|
+
init_chunk_AYLAGFAD();
|
|
19603
19786
|
init_chunk_OPJ5OACS();
|
|
19604
19787
|
init_chunk_YVY2TZK2();
|
|
19605
19788
|
init_chunk_VXEAR36B();
|
|
@@ -19609,7 +19792,6 @@ var init_contracts = __esm({
|
|
|
19609
19792
|
init_chunk_C7UAGRXF();
|
|
19610
19793
|
init_chunk_IPXBFWUU();
|
|
19611
19794
|
init_chunk_63UWXV4T();
|
|
19612
|
-
init_chunk_AYLAGFAD();
|
|
19613
19795
|
init_chunk_ZC6YGHNX();
|
|
19614
19796
|
init_chunk_HIGKBEPF();
|
|
19615
19797
|
init_chunk_IPDOHAZ5();
|
|
@@ -19617,75 +19799,76 @@ var init_contracts = __esm({
|
|
|
19617
19799
|
init_chunk_TVUDMGWV();
|
|
19618
19800
|
init_chunk_WTIGECE5();
|
|
19619
19801
|
init_chunk_WDAXZDJO();
|
|
19802
|
+
init_chunk_ZXK6N2HN();
|
|
19620
19803
|
init_chunk_Y7CFCYX4();
|
|
19621
19804
|
init_chunk_OS6EKEP4();
|
|
19622
19805
|
init_chunk_5DGHIY7L();
|
|
19623
19806
|
init_chunk_2IPHTFV5();
|
|
19807
|
+
init_chunk_I3O2RACG();
|
|
19624
19808
|
init_chunk_CMRECH67();
|
|
19625
19809
|
init_chunk_34LE6P7E();
|
|
19626
19810
|
init_chunk_FPSDNS2E();
|
|
19627
19811
|
init_chunk_TZH6DKKJ();
|
|
19628
19812
|
init_chunk_SSPK6ISL();
|
|
19629
|
-
|
|
19813
|
+
init_chunk_SY6PLCPK();
|
|
19630
19814
|
init_chunk_2ZZZHXZR();
|
|
19631
19815
|
init_chunk_YUZFHVB2();
|
|
19632
|
-
|
|
19816
|
+
init_chunk_LKBSHANA();
|
|
19633
19817
|
init_chunk_LX3D5LCB();
|
|
19634
19818
|
init_chunk_C4HEZ7ZI();
|
|
19635
19819
|
init_chunk_IR2NOSI3();
|
|
19636
19820
|
init_chunk_OPETF4GS();
|
|
19637
|
-
|
|
19821
|
+
init_chunk_V4FRPRH5();
|
|
19638
19822
|
init_chunk_LWMLR2WI();
|
|
19639
19823
|
init_chunk_ACGAI25T();
|
|
19640
19824
|
init_chunk_MH4O3YEX();
|
|
19641
19825
|
init_chunk_V2CXEU5X();
|
|
19642
19826
|
init_chunk_KSTYTQ7I();
|
|
19643
|
-
|
|
19827
|
+
init_chunk_7CYHPF35();
|
|
19644
19828
|
init_chunk_NETRUHZF();
|
|
19645
19829
|
init_chunk_JDJ4EUOL();
|
|
19646
19830
|
init_chunk_UCYWGWQT();
|
|
19647
19831
|
init_chunk_6AYIXGDT();
|
|
19648
19832
|
init_chunk_YULHXJ5M();
|
|
19649
|
-
init_chunk_V4FRPRH5();
|
|
19650
19833
|
init_chunk_ME7AKVSP();
|
|
19651
19834
|
init_chunk_KY3ZNL3E();
|
|
19652
19835
|
init_chunk_X4IDZLLS();
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19836
|
+
init_chunk_BE4ATZB7();
|
|
19837
|
+
init_chunk_3SYJ5V22();
|
|
19838
|
+
init_chunk_COZBA6Z4();
|
|
19656
19839
|
init_chunk_2WVZOVEF();
|
|
19657
19840
|
init_chunk_26PIYACX();
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19841
|
+
init_chunk_YCVI6W6V();
|
|
19842
|
+
init_chunk_4MH4X3D4();
|
|
19843
|
+
init_chunk_B5Y3JXHS();
|
|
19661
19844
|
init_chunk_PSY4BJ7E();
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
init_chunk_3SZD2H6D();
|
|
19845
|
+
init_chunk_6ITRMGLQ();
|
|
19846
|
+
init_chunk_VGNNAETO();
|
|
19847
|
+
init_chunk_CSHU2GN3();
|
|
19848
|
+
init_chunk_YMFTFCT5();
|
|
19849
|
+
init_chunk_J3HQTL6M();
|
|
19668
19850
|
init_chunk_ZJA3UZMG();
|
|
19669
19851
|
init_chunk_4GJFEMVI();
|
|
19670
19852
|
init_chunk_YWZFB34T();
|
|
19671
19853
|
init_chunk_PZPOUXJR();
|
|
19672
19854
|
init_chunk_5PKKFSSF();
|
|
19673
19855
|
init_chunk_GCPFVAXX();
|
|
19674
|
-
|
|
19675
|
-
|
|
19856
|
+
init_chunk_UMM5CTTH();
|
|
19857
|
+
init_chunk_IRY6N2QR();
|
|
19858
|
+
init_chunk_NVKU5PPQ();
|
|
19676
19859
|
init_chunk_UM2UFZAQ();
|
|
19677
19860
|
init_chunk_FECLIZTY();
|
|
19678
19861
|
init_chunk_BFG4ZWR4();
|
|
19679
19862
|
init_chunk_UY32MQHG();
|
|
19680
|
-
|
|
19863
|
+
init_chunk_AZOWABU5();
|
|
19864
|
+
init_chunk_5QVZHYHM();
|
|
19681
19865
|
init_chunk_UEJOG2Q7();
|
|
19682
19866
|
init_chunk_KEN2DASI();
|
|
19683
19867
|
init_chunk_JQRL355P();
|
|
19684
19868
|
init_chunk_R6Y377AW();
|
|
19685
19869
|
init_chunk_UAOHHCW5();
|
|
19686
19870
|
init_chunk_ULQGJUXZ();
|
|
19687
|
-
|
|
19688
|
-
init_chunk_NOVD6LKY();
|
|
19871
|
+
init_chunk_6KWTXHFE();
|
|
19689
19872
|
init_chunk_QG3XMUEN();
|
|
19690
19873
|
init_chunk_EBUWHIFV();
|
|
19691
19874
|
init_chunk_5YZ3R7KF();
|
|
@@ -19698,18 +19881,17 @@ var init_contracts = __esm({
|
|
|
19698
19881
|
init_chunk_ZANBA4K4();
|
|
19699
19882
|
init_chunk_QT7R3TGR();
|
|
19700
19883
|
init_chunk_OLBDDBKV();
|
|
19701
|
-
init_chunk_NVKU5PPQ();
|
|
19702
19884
|
init_chunk_AUD5MVHU();
|
|
19703
19885
|
init_chunk_SOJMWM63();
|
|
19704
19886
|
init_chunk_5FO3GNKP();
|
|
19705
19887
|
init_chunk_AMMLEB4T();
|
|
19706
19888
|
init_chunk_IBL7FANV();
|
|
19889
|
+
init_chunk_KB5RK3RP();
|
|
19707
19890
|
init_chunk_S4HVRNEQ();
|
|
19708
19891
|
init_chunk_6J742GLA();
|
|
19709
19892
|
init_chunk_ZRXP6OOJ();
|
|
19710
19893
|
init_chunk_BGNWWR6B();
|
|
19711
19894
|
init_chunk_ZIGA5RCU();
|
|
19712
|
-
init_chunk_KB5RK3RP();
|
|
19713
19895
|
init_chunk_ZDTX3DG5();
|
|
19714
19896
|
init_chunk_3MF6FWS5();
|
|
19715
19897
|
init_chunk_JP7XIMUA();
|
|
@@ -19722,14 +19904,14 @@ var init_contracts = __esm({
|
|
|
19722
19904
|
init_chunk_6TSQ5HXC();
|
|
19723
19905
|
init_chunk_64HCHXKB();
|
|
19724
19906
|
init_chunk_YR7QALGP();
|
|
19725
|
-
|
|
19726
|
-
|
|
19907
|
+
init_chunk_BN7WSDWC();
|
|
19908
|
+
init_chunk_7JYZW5BH();
|
|
19727
19909
|
init_chunk_HPZOVPVT();
|
|
19728
|
-
|
|
19729
|
-
|
|
19910
|
+
init_chunk_UGKJPB2J();
|
|
19911
|
+
init_chunk_MCLSEATL();
|
|
19912
|
+
init_chunk_M2T55BV6();
|
|
19730
19913
|
init_chunk_CLGTGGVN();
|
|
19731
19914
|
init_chunk_KWRHZBGU();
|
|
19732
|
-
init_chunk_M2T55BV6();
|
|
19733
19915
|
init_chunk_VYINA6YP();
|
|
19734
19916
|
init_chunk_ZVXO3XL6();
|
|
19735
19917
|
init_chunk_FBV7NLKO();
|
|
@@ -19879,10 +20061,10 @@ var init_dist = __esm({
|
|
|
19879
20061
|
init_chunk_5FO3GNKP();
|
|
19880
20062
|
init_chunk_AMMLEB4T();
|
|
19881
20063
|
init_chunk_IBL7FANV();
|
|
20064
|
+
init_chunk_KB5RK3RP();
|
|
19882
20065
|
init_chunk_SKP67RXU();
|
|
19883
20066
|
init_chunk_S4HVRNEQ();
|
|
19884
20067
|
init_chunk_RPGBR5IN();
|
|
19885
|
-
init_chunk_KB5RK3RP();
|
|
19886
20068
|
init_chunk_ZDTX3DG5();
|
|
19887
20069
|
init_chunk_3MF6FWS5();
|
|
19888
20070
|
init_chunk_JP7XIMUA();
|
|
@@ -21535,10 +21717,10 @@ var init_case_type_drafts = __esm({
|
|
|
21535
21717
|
"../../packages/core/dist/contracts/case-type-drafts.js"() {
|
|
21536
21718
|
"use strict";
|
|
21537
21719
|
init_chunk_HPZOVPVT();
|
|
21538
|
-
|
|
21720
|
+
init_chunk_MCLSEATL();
|
|
21721
|
+
init_chunk_M2T55BV6();
|
|
21539
21722
|
init_chunk_CLGTGGVN();
|
|
21540
21723
|
init_chunk_KWRHZBGU();
|
|
21541
|
-
init_chunk_M2T55BV6();
|
|
21542
21724
|
init_chunk_VYINA6YP();
|
|
21543
21725
|
init_chunk_ZVXO3XL6();
|
|
21544
21726
|
init_chunk_FBV7NLKO();
|
|
@@ -21610,16 +21792,16 @@ var init_case_type_drafts = __esm({
|
|
|
21610
21792
|
var init_case_received_documents = __esm({
|
|
21611
21793
|
"../../packages/core/dist/contracts/case-received-documents.js"() {
|
|
21612
21794
|
"use strict";
|
|
21613
|
-
|
|
21614
|
-
|
|
21615
|
-
|
|
21795
|
+
init_chunk_BE4ATZB7();
|
|
21796
|
+
init_chunk_YMFTFCT5();
|
|
21797
|
+
init_chunk_J3HQTL6M();
|
|
21616
21798
|
init_chunk_ZJA3UZMG();
|
|
21617
21799
|
init_chunk_HPZOVPVT();
|
|
21618
|
-
|
|
21619
|
-
|
|
21800
|
+
init_chunk_UGKJPB2J();
|
|
21801
|
+
init_chunk_MCLSEATL();
|
|
21802
|
+
init_chunk_M2T55BV6();
|
|
21620
21803
|
init_chunk_CLGTGGVN();
|
|
21621
21804
|
init_chunk_KWRHZBGU();
|
|
21622
|
-
init_chunk_M2T55BV6();
|
|
21623
21805
|
init_chunk_VYINA6YP();
|
|
21624
21806
|
init_chunk_ZVXO3XL6();
|
|
21625
21807
|
init_chunk_FBV7NLKO();
|
|
@@ -22241,8 +22423,8 @@ var init_api_client = __esm({
|
|
|
22241
22423
|
async me() {
|
|
22242
22424
|
return this.request("GET", "/api/auth/me");
|
|
22243
22425
|
}
|
|
22244
|
-
async verifySecondFactor(
|
|
22245
|
-
return this.request("POST", "/api/auth/second-factor/verify", { code:
|
|
22426
|
+
async verifySecondFactor(code3) {
|
|
22427
|
+
return this.request("POST", "/api/auth/second-factor/verify", { code: code3 });
|
|
22246
22428
|
}
|
|
22247
22429
|
async useSecondFactorRecoveryCode(recoveryCode) {
|
|
22248
22430
|
return this.request("POST", "/api/auth/second-factor/recovery", { recovery_code: recoveryCode });
|
|
@@ -22967,11 +23149,11 @@ function friendlyHint(err) {
|
|
|
22967
23149
|
return "Couldn't reach WayAI \u2014 check your network connection and try again.";
|
|
22968
23150
|
}
|
|
22969
23151
|
if (!(err instanceof ApiError)) return null;
|
|
22970
|
-
const
|
|
22971
|
-
if (
|
|
23152
|
+
const code3 = extractApiErrorCode(err);
|
|
23153
|
+
if (code3 === SECOND_FACTOR_REQUIRED_CODE) {
|
|
22972
23154
|
return "This action needs a two-step verification code. Run `wayai 2fa verify`, then try again.";
|
|
22973
23155
|
}
|
|
22974
|
-
if (
|
|
23156
|
+
if (code3 === SECOND_FACTOR_ENROLLMENT_REQUIRED_CODE) {
|
|
22975
23157
|
return "This organization requires two-step verification. Turn it on in your WayAI account settings, then try again.";
|
|
22976
23158
|
}
|
|
22977
23159
|
if (err.body.includes("FREE_PLAN_RESTRICTION")) {
|
|
@@ -23807,13 +23989,13 @@ function generateState() {
|
|
|
23807
23989
|
function expiresInToIso(expiresInSeconds) {
|
|
23808
23990
|
return new Date(Date.now() + expiresInSeconds * 1e3).toISOString();
|
|
23809
23991
|
}
|
|
23810
|
-
async function exchangeCodeForTokens(authkitDomain, clientId,
|
|
23992
|
+
async function exchangeCodeForTokens(authkitDomain, clientId, code3, codeVerifier, redirectUri) {
|
|
23811
23993
|
const response = await fetch(`${authkitDomain}/oauth2/token`, {
|
|
23812
23994
|
method: "POST",
|
|
23813
23995
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
23814
23996
|
body: new URLSearchParams({
|
|
23815
23997
|
grant_type: "authorization_code",
|
|
23816
|
-
code:
|
|
23998
|
+
code: code3,
|
|
23817
23999
|
code_verifier: codeVerifier,
|
|
23818
24000
|
redirect_uri: redirectUri,
|
|
23819
24001
|
client_id: clientId
|
|
@@ -23864,7 +24046,7 @@ function startCallbackServer(port, expectedState, timeoutMs = 12e4) {
|
|
|
23864
24046
|
const server = http.createServer((req, res) => {
|
|
23865
24047
|
const url = new URL(req.url || "/", `http://127.0.0.1:${port}`);
|
|
23866
24048
|
if (url.pathname === "/callback") {
|
|
23867
|
-
const
|
|
24049
|
+
const code3 = url.searchParams.get("code");
|
|
23868
24050
|
const state = url.searchParams.get("state");
|
|
23869
24051
|
const error = url.searchParams.get("error");
|
|
23870
24052
|
const errorDescription = url.searchParams.get("error_description");
|
|
@@ -23882,11 +24064,11 @@ function startCallbackServer(port, expectedState, timeoutMs = 12e4) {
|
|
|
23882
24064
|
reject(new Error("OAuth state mismatch \u2014 possible CSRF attack"));
|
|
23883
24065
|
return;
|
|
23884
24066
|
}
|
|
23885
|
-
if (
|
|
24067
|
+
if (code3) {
|
|
23886
24068
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
23887
24069
|
res.end("<html><body><h2>Login successful!</h2><p>You can close this tab and return to your terminal.</p></body></html>");
|
|
23888
24070
|
server.close();
|
|
23889
|
-
resolve19({ code:
|
|
24071
|
+
resolve19({ code: code3, port });
|
|
23890
24072
|
} else {
|
|
23891
24073
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
23892
24074
|
res.end("<html><body><h2>Login failed</h2><p>No authorization code received</p></body></html>");
|
|
@@ -24198,12 +24380,12 @@ Open this URL in your browser to log in:
|
|
|
24198
24380
|
} else {
|
|
24199
24381
|
console.log("Opening browser for login...");
|
|
24200
24382
|
}
|
|
24201
|
-
const { code:
|
|
24383
|
+
const { code: code3 } = await callbackPromise;
|
|
24202
24384
|
console.log("Exchanging authorization code...");
|
|
24203
24385
|
const tokens2 = await exchangeCodeForTokens(
|
|
24204
24386
|
authkitDomain,
|
|
24205
24387
|
clientId,
|
|
24206
|
-
|
|
24388
|
+
code3,
|
|
24207
24389
|
codeVerifier,
|
|
24208
24390
|
redirectUri
|
|
24209
24391
|
);
|
|
@@ -26526,7 +26708,7 @@ var init_hub_materializer = __esm({
|
|
|
26526
26708
|
var init_ci = __esm({
|
|
26527
26709
|
"../../packages/core/dist/contracts/ci.js"() {
|
|
26528
26710
|
"use strict";
|
|
26529
|
-
|
|
26711
|
+
init_chunk_6KWTXHFE();
|
|
26530
26712
|
init_chunk_QG3XMUEN();
|
|
26531
26713
|
init_chunk_EBUWHIFV();
|
|
26532
26714
|
init_chunk_5YZ3R7KF();
|
|
@@ -26562,343 +26744,6 @@ var init_ci = __esm({
|
|
|
26562
26744
|
}
|
|
26563
26745
|
});
|
|
26564
26746
|
|
|
26565
|
-
// src/lib/eval-format.ts
|
|
26566
|
-
function runNotes(unproven, inProgress) {
|
|
26567
|
-
return [
|
|
26568
|
-
unproven > 0 ? `${unproven} unproven` : "",
|
|
26569
|
-
inProgress > 0 ? `${inProgress} in progress` : ""
|
|
26570
|
-
].filter(Boolean);
|
|
26571
|
-
}
|
|
26572
|
-
function printResultsTable(results, mode) {
|
|
26573
|
-
let totalPassed = 0;
|
|
26574
|
-
let totalEvaluated = 0;
|
|
26575
|
-
let totalUnproven = 0;
|
|
26576
|
-
let totalInProgress = 0;
|
|
26577
|
-
for (const r of results) {
|
|
26578
|
-
const evalName = r.eval?.eval_name || r.eval_id.slice(0, 8);
|
|
26579
|
-
const evaluatedRuns = evaluatedRunCount(r);
|
|
26580
|
-
const unproven = unprovenRunCount(r);
|
|
26581
|
-
const inProgress = (r.running_runs ?? 0) + (r.pending_runs ?? 0);
|
|
26582
|
-
const notes2 = runNotes(unproven, inProgress);
|
|
26583
|
-
const passed = notes2.length > 0 ? `${r.successful_runs}/${evaluatedRuns} passed (${notes2.join(", ")})` : `${r.successful_runs}/${evaluatedRuns} passed`;
|
|
26584
|
-
const avgTime = r.avg_execution_time_ms != null ? `avg ${(r.avg_execution_time_ms / 1e3).toFixed(1)}s` : "";
|
|
26585
|
-
let scoresStr = "";
|
|
26586
|
-
if (r.aggregated_scores) {
|
|
26587
|
-
const parts = Object.entries(r.aggregated_scores).map(
|
|
26588
|
-
([key, val]) => mode === "compact" ? `${key}: ${Math.round(val.avg * 100)}%` : `${key}: avg ${Math.round(val.avg * 100)}%, min ${Math.round(val.min * 100)}%, max ${Math.round(val.max * 100)}%`
|
|
26589
|
-
);
|
|
26590
|
-
if (parts.length > 0) scoresStr = " " + parts.join(" ");
|
|
26591
|
-
}
|
|
26592
|
-
console.log(` ${evalName.padEnd(20)} ${passed.padEnd(14)} ${avgTime}${scoresStr}`);
|
|
26593
|
-
totalPassed += r.successful_runs;
|
|
26594
|
-
totalEvaluated += evaluatedRuns;
|
|
26595
|
-
totalUnproven += unproven;
|
|
26596
|
-
totalInProgress += inProgress;
|
|
26597
|
-
}
|
|
26598
|
-
const pct = totalEvaluated > 0 ? (totalPassed / totalEvaluated * 100).toFixed(1) : "0.0";
|
|
26599
|
-
const notes = runNotes(totalUnproven, totalInProgress);
|
|
26600
|
-
const note = notes.length > 0 ? ` \u2014 ${notes.join(", ")}` : "";
|
|
26601
|
-
console.log(`
|
|
26602
|
-
Overall: ${totalPassed}/${totalEvaluated} passed (${pct}%)${note}`);
|
|
26603
|
-
}
|
|
26604
|
-
function truncate(str, maxLen) {
|
|
26605
|
-
if (str.length <= maxLen) return str;
|
|
26606
|
-
return str.slice(0, maxLen - 3) + "...";
|
|
26607
|
-
}
|
|
26608
|
-
function summarizeResponse(resp, maxLen = 80) {
|
|
26609
|
-
if (!resp) return "(none)";
|
|
26610
|
-
const parts = [];
|
|
26611
|
-
const content = typeof resp.content === "string" ? resp.content.trim() : "";
|
|
26612
|
-
if (content) parts.push(`"${truncate(content, maxLen)}"`);
|
|
26613
|
-
if (resp.tool_calls && resp.tool_calls.length > 0) {
|
|
26614
|
-
parts.push(
|
|
26615
|
-
resp.tool_calls.map((tc) => `${tc.function.name}(${truncate(tc.function.arguments, maxLen)})`).join(", ")
|
|
26616
|
-
);
|
|
26617
|
-
}
|
|
26618
|
-
return parts.length > 0 ? parts.join(" + ") : "(empty)";
|
|
26619
|
-
}
|
|
26620
|
-
function isFailingRun(run) {
|
|
26621
|
-
if (run.run_status && !TERMINAL_RUN_STATUSES.has(run.run_status)) return false;
|
|
26622
|
-
return run.response_match !== true;
|
|
26623
|
-
}
|
|
26624
|
-
function failureTag(run) {
|
|
26625
|
-
switch (run.outcome_kind) {
|
|
26626
|
-
case "execution_error":
|
|
26627
|
-
return "ERROR";
|
|
26628
|
-
case "evaluation_invalid":
|
|
26629
|
-
return "INVALID";
|
|
26630
|
-
// `assertion_failure`, and any pre-taxonomy payload.
|
|
26631
|
-
default:
|
|
26632
|
-
return "FAIL";
|
|
26633
|
-
}
|
|
26634
|
-
}
|
|
26635
|
-
function printFailingRuns(runs) {
|
|
26636
|
-
const failing = runs.filter(isFailingRun);
|
|
26637
|
-
if (failing.length === 0) return;
|
|
26638
|
-
console.log(`
|
|
26639
|
-
Failures (${failing.length}):`);
|
|
26640
|
-
let anyComment = false;
|
|
26641
|
-
for (const run of failing) {
|
|
26642
|
-
const evalName = run.eval?.eval_name || run.eval_id?.slice(0, 8) || "eval";
|
|
26643
|
-
console.log(` ${evalName} \u2014 Run #${run.run_number} [${failureTag(run)}]`);
|
|
26644
|
-
if (run.error_message) {
|
|
26645
|
-
console.log(` Error: ${run.error_message}`);
|
|
26646
|
-
}
|
|
26647
|
-
if (run.response_comment) {
|
|
26648
|
-
anyComment = true;
|
|
26649
|
-
console.log(` Why: ${run.response_comment}`);
|
|
26650
|
-
}
|
|
26651
|
-
if (run.expected_response) {
|
|
26652
|
-
console.log(` Expected: ${summarizeResponse(run.expected_response)}`);
|
|
26653
|
-
console.log(` Actual: ${summarizeResponse(run.eval_response)}`);
|
|
26654
|
-
}
|
|
26655
|
-
}
|
|
26656
|
-
if (!anyComment) {
|
|
26657
|
-
console.log(`
|
|
26658
|
-
${NO_EVALUATOR_NOTES_HINT}`);
|
|
26659
|
-
}
|
|
26660
|
-
}
|
|
26661
|
-
var NO_EVALUATOR_NOTES_HINT, TERMINAL_RUN_STATUSES;
|
|
26662
|
-
var init_eval_format = __esm({
|
|
26663
|
-
"src/lib/eval-format.ts"() {
|
|
26664
|
-
"use strict";
|
|
26665
|
-
init_contracts();
|
|
26666
|
-
NO_EVALUATOR_NOTES_HINT = "No evaluator notes found \u2014 add a `notes` evaluation variable to the message_evaluator agent to surface its reasoning here.";
|
|
26667
|
-
TERMINAL_RUN_STATUSES = /* @__PURE__ */ new Set(["completed", "failed"]);
|
|
26668
|
-
}
|
|
26669
|
-
});
|
|
26670
|
-
|
|
26671
|
-
// src/lib/page-design-lint.ts
|
|
26672
|
-
function attributesOf(tag) {
|
|
26673
|
-
const out = /* @__PURE__ */ new Map();
|
|
26674
|
-
for (const m of tag.matchAll(ATTRIBUTE)) out.set(m[1].toLowerCase(), (m[2] ?? m[3] ?? m[4] ?? "").trim());
|
|
26675
|
-
return out;
|
|
26676
|
-
}
|
|
26677
|
-
function splitPage(html) {
|
|
26678
|
-
const scripts = [];
|
|
26679
|
-
const withoutScripts = html.replace(SCRIPT_ELEMENT, (_m, attrs, body) => {
|
|
26680
|
-
scripts.push(body);
|
|
26681
|
-
return `<script${attrs}></script>`;
|
|
26682
|
-
});
|
|
26683
|
-
const withoutComments = withoutScripts.replace(/<!--[\s\S]*?-->/g, "");
|
|
26684
|
-
const css = [];
|
|
26685
|
-
const markup = withoutComments.replace(STYLE_ELEMENT, (_m, body) => {
|
|
26686
|
-
css.push({ text: body, attribute: false });
|
|
26687
|
-
return "<style></style>";
|
|
26688
|
-
});
|
|
26689
|
-
for (const tag of markup.matchAll(TAG)) {
|
|
26690
|
-
const style = attributesOf(tag[2]).get("style");
|
|
26691
|
-
if (style) css.push({ text: style, attribute: true });
|
|
26692
|
-
}
|
|
26693
|
-
return { markup, css, scripts: scripts.join("\n") };
|
|
26694
|
-
}
|
|
26695
|
-
function removeCalls(value, name, keep = () => false) {
|
|
26696
|
-
const lower = value.toLowerCase();
|
|
26697
|
-
const open = `${name}(`;
|
|
26698
|
-
let out = "";
|
|
26699
|
-
let from = 0;
|
|
26700
|
-
for (let at = lower.indexOf(open); at !== -1; at = lower.indexOf(open, from)) {
|
|
26701
|
-
let depth = 0;
|
|
26702
|
-
let end = at + name.length;
|
|
26703
|
-
for (; end < value.length; end++) {
|
|
26704
|
-
if (value[end] === "(") depth++;
|
|
26705
|
-
else if (value[end] === ")" && --depth === 0) break;
|
|
26706
|
-
}
|
|
26707
|
-
const inner = value.slice(at + open.length, end);
|
|
26708
|
-
out += value.slice(from, at) + (keep(inner) ? value.slice(at, end + 1) : "");
|
|
26709
|
-
from = end + 1;
|
|
26710
|
-
}
|
|
26711
|
-
return out + value.slice(from);
|
|
26712
|
-
}
|
|
26713
|
-
function readCss(source, attribute) {
|
|
26714
|
-
const loads = [];
|
|
26715
|
-
let css = source.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
26716
|
-
css = css.replace(IMPORT_RULE, (_m, url) => {
|
|
26717
|
-
loads.push(url || "@import");
|
|
26718
|
-
return "";
|
|
26719
|
-
});
|
|
26720
|
-
css = css.replace(URL_CALL, (_m, a, b, c) => {
|
|
26721
|
-
loads.push((a ?? b ?? c ?? "").trim());
|
|
26722
|
-
return "url()";
|
|
26723
|
-
});
|
|
26724
|
-
css = css.replace(/"[^"]*"|'[^']*'/g, '""');
|
|
26725
|
-
const declarations = [];
|
|
26726
|
-
const declare = (body, context) => {
|
|
26727
|
-
for (const piece of body.split(";")) {
|
|
26728
|
-
const colon = piece.indexOf(":");
|
|
26729
|
-
if (colon === -1) continue;
|
|
26730
|
-
const prop = piece.slice(0, colon).trim().toLowerCase();
|
|
26731
|
-
const value = piece.slice(colon + 1).replace(/\s+/g, " ").trim();
|
|
26732
|
-
if (/^-?-?[a-z][a-z0-9-]*$/.test(prop) && value) declarations.push({ prop, value, context });
|
|
26733
|
-
}
|
|
26734
|
-
};
|
|
26735
|
-
if (attribute) {
|
|
26736
|
-
declare(css, []);
|
|
26737
|
-
return { declarations, loads };
|
|
26738
|
-
}
|
|
26739
|
-
const stack = [];
|
|
26740
|
-
let text5 = "";
|
|
26741
|
-
for (const ch of css) {
|
|
26742
|
-
if (ch === "{") {
|
|
26743
|
-
stack.push({ prelude: text5.trim(), body: "" });
|
|
26744
|
-
text5 = "";
|
|
26745
|
-
} else if (ch === "}") {
|
|
26746
|
-
const block2 = stack.pop();
|
|
26747
|
-
if (block2) declare(block2.body + text5, [...stack.map((b) => b.prelude), block2.prelude]);
|
|
26748
|
-
text5 = "";
|
|
26749
|
-
} else if (ch === ";") {
|
|
26750
|
-
if (stack.length > 0) stack[stack.length - 1].body += `${text5};`;
|
|
26751
|
-
text5 = "";
|
|
26752
|
-
} else {
|
|
26753
|
-
text5 += ch;
|
|
26754
|
-
}
|
|
26755
|
-
}
|
|
26756
|
-
return { declarations, loads };
|
|
26757
|
-
}
|
|
26758
|
-
function hardCodedColor(d) {
|
|
26759
|
-
if (!COLOR_PROPERTY.test(d.prop)) return false;
|
|
26760
|
-
const tokenMixesGone = removeCalls(d.value, "color-mix", (inner) => !/var\(/i.test(inner));
|
|
26761
|
-
const literal = removeCalls(tokenMixesGone, "var");
|
|
26762
|
-
return HEX_COLOR.test(literal) || COLOR_FUNCTION.test(literal);
|
|
26763
|
-
}
|
|
26764
|
-
function fixedWidth(d) {
|
|
26765
|
-
if (d.prop !== "width" && d.prop !== "inline-size") return false;
|
|
26766
|
-
const px = /^(\d+(?:\.\d+)?)px$/i.exec(d.value.replace(/\s*!important$/i, ""));
|
|
26767
|
-
return px !== null && Number(px[1]) > PHONE_WIDTH_MAX_PX && !inQuery(d);
|
|
26768
|
-
}
|
|
26769
|
-
function tableFits(html, declarations) {
|
|
26770
|
-
if (html.includes("wayai-table-wrap")) return true;
|
|
26771
|
-
return declarations.some((d) => /^overflow(?:-x|-inline)?$/.test(d.prop) && /\b(?:auto|scroll)\b/.test(d.value) || inQuery(d) && d.context.some((p) => !p.startsWith("@") && TABLE_SELECTOR.test(p)));
|
|
26772
|
-
}
|
|
26773
|
-
function markupLoads(markup) {
|
|
26774
|
-
const loads = [];
|
|
26775
|
-
for (const tag of markup.matchAll(TAG)) {
|
|
26776
|
-
const name = tag[1].toLowerCase();
|
|
26777
|
-
const attrs = attributesOf(tag[2]);
|
|
26778
|
-
if (name === "script") {
|
|
26779
|
-
const src = attrs.get("src");
|
|
26780
|
-
if (src) loads.push(src);
|
|
26781
|
-
} else if (name === "link") {
|
|
26782
|
-
const href = attrs.get("href");
|
|
26783
|
-
const rel = attrs.get("rel") ?? "";
|
|
26784
|
-
if (href && (/\bstylesheet\b/i.test(rel) || /icon|preload|prefetch|manifest/i.test(rel) && !LOCAL_URL.test(href))) {
|
|
26785
|
-
loads.push(href);
|
|
26786
|
-
}
|
|
26787
|
-
} else if (name === "source") {
|
|
26788
|
-
const src = attrs.get("src");
|
|
26789
|
-
const srcset = attrs.get("srcset");
|
|
26790
|
-
if (src) loads.push(src);
|
|
26791
|
-
if (srcset && !LOCAL_URL.test(srcset)) loads.push(srcset);
|
|
26792
|
-
} else if (IMAGE_ELEMENTS.has(name)) {
|
|
26793
|
-
for (const key of ["src", "srcset", "href"]) {
|
|
26794
|
-
const url = attrs.get(key);
|
|
26795
|
-
if (url && !LOCAL_URL.test(url)) loads.push(url);
|
|
26796
|
-
}
|
|
26797
|
-
} else if (MEDIA_ELEMENTS.has(name)) {
|
|
26798
|
-
for (const key of ["src", "poster"]) {
|
|
26799
|
-
const url = attrs.get(key);
|
|
26800
|
-
if (url) loads.push(url);
|
|
26801
|
-
}
|
|
26802
|
-
} else if (name === "object") {
|
|
26803
|
-
const data = attrs.get("data");
|
|
26804
|
-
if (data) loads.push(data);
|
|
26805
|
-
}
|
|
26806
|
-
}
|
|
26807
|
-
return loads;
|
|
26808
|
-
}
|
|
26809
|
-
function lintPageDesign(page) {
|
|
26810
|
-
const { html } = page;
|
|
26811
|
-
const parts = splitPage(html);
|
|
26812
|
-
const read = parts.css.map((c) => readCss(c.text, c.attribute));
|
|
26813
|
-
const declarations = read.flatMap((r) => r.declarations);
|
|
26814
|
-
const findings = [];
|
|
26815
|
-
const colors = declarations.filter(hardCodedColor);
|
|
26816
|
-
if (colors.length > 0) {
|
|
26817
|
-
findings.push({
|
|
26818
|
-
rule: "hard-coded-color",
|
|
26819
|
-
message: `${plural(colors.length, "hard-coded color")} in its CSS, e.g. \`${shown(`${colors[0].prop}: ${colors[0].value}`)}\`: style with the tokens (var(--color-...), var(--wayai-...)) so the page follows the viewer's light or dark theme`
|
|
26820
|
-
});
|
|
26821
|
-
}
|
|
26822
|
-
if (!/data-theme|applyDocumentTheme/.test(html)) {
|
|
26823
|
-
findings.push({
|
|
26824
|
-
rule: "no-theme",
|
|
26825
|
-
message: "never sets data-theme on <html> from the host context's theme, so it keeps the theme it opened in when the viewer switches between light and dark"
|
|
26826
|
-
});
|
|
26827
|
-
}
|
|
26828
|
-
const widths = declarations.filter(fixedWidth);
|
|
26829
|
-
if (widths.length > 0) {
|
|
26830
|
-
findings.push({
|
|
26831
|
-
rule: "fixed-width",
|
|
26832
|
-
message: `${plural(widths.length, "fixed width")} wider than a phone (${PHONE_WIDTH_MAX_PX}px) outside a media or container query, e.g. \`${widths[0].prop}: ${widths[0].value}\`: lay the page out mobile-first and widen it inside a media or container query`
|
|
26833
|
-
});
|
|
26834
|
-
}
|
|
26835
|
-
if ((/<table\b/i.test(html) || /createElement\(\s*['"`]table['"`]/.test(html)) && !tableFits(html, declarations)) {
|
|
26836
|
-
findings.push({
|
|
26837
|
-
rule: "table-overflow",
|
|
26838
|
-
message: "has a table with no sideways scroll or narrow layout: wrap it in a wayai-table-wrap element, or turn its rows into cards inside a media or container query"
|
|
26839
|
-
});
|
|
26840
|
-
}
|
|
26841
|
-
const loads = [
|
|
26842
|
-
...markupLoads(parts.markup),
|
|
26843
|
-
...read.flatMap((r) => r.loads).filter((url) => url !== "" && !LOCAL_URL.test(url)),
|
|
26844
|
-
...[...parts.scripts.matchAll(SCRIPT_LOAD)].map((m) => m[2])
|
|
26845
|
-
];
|
|
26846
|
-
if (loads.length > 0) {
|
|
26847
|
-
findings.push({
|
|
26848
|
-
rule: "remote-load",
|
|
26849
|
-
message: `${plural(loads.length, "load")} the page's sandbox refuses, e.g. \`${shown(loads[0])}\`: a page has no network, so inline scripts and styles, and give images and fonts as data: URLs`
|
|
26850
|
-
});
|
|
26851
|
-
}
|
|
26852
|
-
const tools = page.manifest.tools;
|
|
26853
|
-
if (Array.isArray(tools) && tools.length > 0 && LIST_MARKUP.test(html)) {
|
|
26854
|
-
if (!html.includes("wayai-empty") && !ZERO_ROWS_CHECK.test(html)) {
|
|
26855
|
-
findings.push({
|
|
26856
|
-
rule: "list-empty-state",
|
|
26857
|
-
message: "fills a list from its tools but shows no empty state (no wayai-empty element and no check for zero rows): say what is missing when a list comes back empty"
|
|
26858
|
-
});
|
|
26859
|
-
}
|
|
26860
|
-
if (!/\bisError\b/.test(html) && !html.includes("wayai-alert")) {
|
|
26861
|
-
findings.push({
|
|
26862
|
-
rule: "list-error-state",
|
|
26863
|
-
message: "calls its tools but never reads a result's isError or shows a wayai-alert: show the viewer why a call failed"
|
|
26864
|
-
});
|
|
26865
|
-
}
|
|
26866
|
-
}
|
|
26867
|
-
return findings;
|
|
26868
|
-
}
|
|
26869
|
-
function pageDesignWarnings(pages) {
|
|
26870
|
-
if (!pages) return [];
|
|
26871
|
-
return pages.flatMap((page) => lintPageDesign(page).map((f) => `page "${String(page.manifest.slug)}" (design): ${f.message}`));
|
|
26872
|
-
}
|
|
26873
|
-
var PHONE_WIDTH_MAX_PX, SCRIPT_ELEMENT, STYLE_ELEMENT, TAG, ATTRIBUTE, URL_CALL, IMPORT_RULE, inQuery, COLOR_PROPERTY, HEX_COLOR, COLOR_FUNCTION, TABLE_SELECTOR, LOCAL_URL, IMAGE_ELEMENTS, MEDIA_ELEMENTS, SCRIPT_LOAD, LIST_MARKUP, ZERO_ROWS_CHECK, plural, shown;
|
|
26874
|
-
var init_page_design_lint = __esm({
|
|
26875
|
-
"src/lib/page-design-lint.ts"() {
|
|
26876
|
-
"use strict";
|
|
26877
|
-
init_eval_format();
|
|
26878
|
-
init_terminal_output();
|
|
26879
|
-
PHONE_WIDTH_MAX_PX = 430;
|
|
26880
|
-
SCRIPT_ELEMENT = /<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi;
|
|
26881
|
-
STYLE_ELEMENT = /<style\b[^>]*>([\s\S]*?)<\/style\s*>/gi;
|
|
26882
|
-
TAG = /<([a-z][a-z0-9-]*)\b([^>]*)>/gi;
|
|
26883
|
-
ATTRIBUTE = /([a-z][a-z0-9:-]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/gi;
|
|
26884
|
-
URL_CALL = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*?))\s*\)/gi;
|
|
26885
|
-
IMPORT_RULE = /@import\s+(?:url\(\s*)?["']?([^"')\s;]*)[^;]*;?/gi;
|
|
26886
|
-
inQuery = (d) => d.context.some((p) => /^@(?:media|container)\b/i.test(p));
|
|
26887
|
-
COLOR_PROPERTY = /^(?:color|background|background-color|fill|stroke|caret-color|accent-color|text-decoration|text-decoration-color|outline|outline-color|column-rule|column-rule-color)$|^border(?:-(?:top|right|bottom|left|block|inline|block-start|block-end|inline-start|inline-end))?(?:-color)?$/;
|
|
26888
|
-
HEX_COLOR = /#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3,4})(?![\w-])/i;
|
|
26889
|
-
COLOR_FUNCTION = /\b(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch)\(/i;
|
|
26890
|
-
TABLE_SELECTOR = /\b(?:table|thead|tbody|tr|th|td)\b/i;
|
|
26891
|
-
LOCAL_URL = /^(?:data:|blob:|#)/i;
|
|
26892
|
-
IMAGE_ELEMENTS = /* @__PURE__ */ new Set(["img", "input", "image"]);
|
|
26893
|
-
MEDIA_ELEMENTS = /* @__PURE__ */ new Set(["video", "audio", "track", "iframe", "embed", "frame"]);
|
|
26894
|
-
SCRIPT_LOAD = /\b(?:fetch|WebSocket|EventSource)\s*\(\s*(['"`])((?:https?:|wss?:|\/\/)[^'"`]*)\1/g;
|
|
26895
|
-
LIST_MARKUP = /<(?:ul|ol|table)\b|wayai-list|createElement\(\s*['"`](?:li|tr|ul|ol|table)['"`]/i;
|
|
26896
|
-
ZERO_ROWS_CHECK = /\.length\s*(?:===?|<=)\s*0\b|\.length\s*<\s*1\b|!\s*[\w$.[\]]+\.length\b/;
|
|
26897
|
-
plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
|
|
26898
|
-
shown = (text5) => truncate(sanitizeTerminalText(text5).replace(/\s+/g, " "), 60);
|
|
26899
|
-
}
|
|
26900
|
-
});
|
|
26901
|
-
|
|
26902
26747
|
// src/lib/base-workspace.ts
|
|
26903
26748
|
import * as fs16 from "fs";
|
|
26904
26749
|
import * as path21 from "path";
|
|
@@ -27394,7 +27239,7 @@ var nativeEntryName, SKIPPABLE_ENTRY_IDENTITY;
|
|
|
27394
27239
|
var init_skipped_tool_entries = __esm({
|
|
27395
27240
|
"../../packages/core/dist/skipped-tool-entries.js"() {
|
|
27396
27241
|
"use strict";
|
|
27397
|
-
|
|
27242
|
+
init_chunk_6KWTXHFE();
|
|
27398
27243
|
init_chunk_QG3XMUEN();
|
|
27399
27244
|
init_chunk_EBUWHIFV();
|
|
27400
27245
|
init_chunk_5YZ3R7KF();
|
|
@@ -27455,6 +27300,389 @@ var init_skipped_tool_entries = __esm({
|
|
|
27455
27300
|
}
|
|
27456
27301
|
});
|
|
27457
27302
|
|
|
27303
|
+
// ../../packages/core/dist/page-design-lint.js
|
|
27304
|
+
function skipSpace(text5, at) {
|
|
27305
|
+
while (isSpace(text5[at])) at++;
|
|
27306
|
+
return at;
|
|
27307
|
+
}
|
|
27308
|
+
function findClose(lower, name, from) {
|
|
27309
|
+
const open = `</${name}`;
|
|
27310
|
+
for (let at = lower.indexOf(open, from); at !== -1; at = lower.indexOf(open, at + 1)) {
|
|
27311
|
+
const gt = skipSpace(lower, at + open.length);
|
|
27312
|
+
if (lower[gt] === ">") return { start: at, end: gt + 1 };
|
|
27313
|
+
}
|
|
27314
|
+
return null;
|
|
27315
|
+
}
|
|
27316
|
+
function replaceElements(text5, name, replace) {
|
|
27317
|
+
const lower = asciiLower(text5);
|
|
27318
|
+
const open = `<${name}`;
|
|
27319
|
+
let out = "";
|
|
27320
|
+
let from = 0;
|
|
27321
|
+
let at = lower.indexOf(open);
|
|
27322
|
+
while (at !== -1) {
|
|
27323
|
+
const afterName = at + open.length;
|
|
27324
|
+
if (isWordChar(lower[afterName])) {
|
|
27325
|
+
at = lower.indexOf(open, at + 1);
|
|
27326
|
+
continue;
|
|
27327
|
+
}
|
|
27328
|
+
const gt = lower.indexOf(">", afterName);
|
|
27329
|
+
if (gt === -1) break;
|
|
27330
|
+
const close3 = findClose(lower, name, gt + 1);
|
|
27331
|
+
if (!close3) break;
|
|
27332
|
+
out += text5.slice(from, at) + replace(text5.slice(afterName, gt), text5.slice(gt + 1, close3.start));
|
|
27333
|
+
from = close3.end;
|
|
27334
|
+
at = lower.indexOf(open, from);
|
|
27335
|
+
}
|
|
27336
|
+
return out + text5.slice(from);
|
|
27337
|
+
}
|
|
27338
|
+
function removeSpans(text5, open, close3) {
|
|
27339
|
+
let out = "";
|
|
27340
|
+
let from = 0;
|
|
27341
|
+
for (let at = text5.indexOf(open); at !== -1; at = text5.indexOf(open, from)) {
|
|
27342
|
+
const end = text5.indexOf(close3, at + open.length);
|
|
27343
|
+
if (end === -1) break;
|
|
27344
|
+
out += text5.slice(from, at);
|
|
27345
|
+
from = end + close3.length;
|
|
27346
|
+
}
|
|
27347
|
+
return out + text5.slice(from);
|
|
27348
|
+
}
|
|
27349
|
+
function quotedAt(text5, at, lastQuote) {
|
|
27350
|
+
const quote = text5[at];
|
|
27351
|
+
if (quote !== '"' && quote !== "'" || lastQuote[quote] <= at) return null;
|
|
27352
|
+
const close3 = text5.indexOf(quote, at + 1);
|
|
27353
|
+
return { value: text5.slice(at + 1, close3), end: close3 + 1 };
|
|
27354
|
+
}
|
|
27355
|
+
function tagsOf(markup) {
|
|
27356
|
+
const tags = [];
|
|
27357
|
+
for (let lt = markup.indexOf("<"); lt !== -1; lt = markup.indexOf("<", lt + 1)) {
|
|
27358
|
+
if (!isLetter(markup[lt + 1])) continue;
|
|
27359
|
+
let end = lt + 2;
|
|
27360
|
+
while (end < markup.length && isTagNameChar(markup[end])) end++;
|
|
27361
|
+
while (end > lt + 2 && isWordChar(markup[end - 1]) === isWordChar(markup[end])) end--;
|
|
27362
|
+
if (isWordChar(markup[end - 1]) === isWordChar(markup[end])) continue;
|
|
27363
|
+
const gt = markup.indexOf(">", end);
|
|
27364
|
+
if (gt === -1) break;
|
|
27365
|
+
tags.push({ name: markup.slice(lt + 1, end), attrs: attributesOf(markup.slice(end, gt)) });
|
|
27366
|
+
lt = gt;
|
|
27367
|
+
}
|
|
27368
|
+
return tags;
|
|
27369
|
+
}
|
|
27370
|
+
function attributesOf(attrs) {
|
|
27371
|
+
const out = /* @__PURE__ */ new Map();
|
|
27372
|
+
const lastQuote = lastQuotesOf(attrs);
|
|
27373
|
+
let at = 0;
|
|
27374
|
+
while (at < attrs.length) {
|
|
27375
|
+
if (!isLetter(attrs[at])) {
|
|
27376
|
+
at++;
|
|
27377
|
+
continue;
|
|
27378
|
+
}
|
|
27379
|
+
let nameEnd = at + 1;
|
|
27380
|
+
while (nameEnd < attrs.length && isAttributeNameChar(attrs[nameEnd])) nameEnd++;
|
|
27381
|
+
const eq = skipSpace(attrs, nameEnd);
|
|
27382
|
+
if (attrs[eq] !== "=") {
|
|
27383
|
+
at = nameEnd;
|
|
27384
|
+
continue;
|
|
27385
|
+
}
|
|
27386
|
+
const valueAt = skipSpace(attrs, eq + 1);
|
|
27387
|
+
const quote = attrs[valueAt];
|
|
27388
|
+
let value = null;
|
|
27389
|
+
let next = nameEnd;
|
|
27390
|
+
if (quote === '"' || quote === "'") {
|
|
27391
|
+
const quoted = quotedAt(attrs, valueAt, lastQuote);
|
|
27392
|
+
if (quoted) {
|
|
27393
|
+
value = quoted.value;
|
|
27394
|
+
next = quoted.end;
|
|
27395
|
+
}
|
|
27396
|
+
} else {
|
|
27397
|
+
let valueEnd2 = valueAt;
|
|
27398
|
+
while (valueEnd2 < attrs.length && !isSpace(attrs[valueEnd2]) && !`"'>`.includes(attrs[valueEnd2])) valueEnd2++;
|
|
27399
|
+
if (valueEnd2 > valueAt) {
|
|
27400
|
+
value = attrs.slice(valueAt, valueEnd2);
|
|
27401
|
+
next = valueEnd2;
|
|
27402
|
+
}
|
|
27403
|
+
}
|
|
27404
|
+
if (value !== null) out.set(attrs.slice(at, nameEnd).toLowerCase(), value.trim());
|
|
27405
|
+
at = next;
|
|
27406
|
+
}
|
|
27407
|
+
return out;
|
|
27408
|
+
}
|
|
27409
|
+
function splitPage(html) {
|
|
27410
|
+
const scripts = [];
|
|
27411
|
+
const withoutScripts = replaceElements(html, "script", (attrs, body) => {
|
|
27412
|
+
scripts.push(body);
|
|
27413
|
+
return `<script${attrs}></script>`;
|
|
27414
|
+
});
|
|
27415
|
+
const withoutComments = removeSpans(withoutScripts, "<!--", "-->");
|
|
27416
|
+
const css = [];
|
|
27417
|
+
const markup = replaceElements(withoutComments, "style", (_attrs, body) => {
|
|
27418
|
+
css.push({ text: body, attribute: false });
|
|
27419
|
+
return "<style></style>";
|
|
27420
|
+
});
|
|
27421
|
+
const tags = tagsOf(markup);
|
|
27422
|
+
for (const tag of tags) {
|
|
27423
|
+
const style = tag.attrs.get("style");
|
|
27424
|
+
if (style) css.push({ text: style, attribute: true });
|
|
27425
|
+
}
|
|
27426
|
+
return { markup, tags, css, scripts: scripts.join("\n") };
|
|
27427
|
+
}
|
|
27428
|
+
function removeCalls(value, name, keep = () => false) {
|
|
27429
|
+
const lower = asciiLower(value);
|
|
27430
|
+
const open = `${name}(`;
|
|
27431
|
+
let out = "";
|
|
27432
|
+
let from = 0;
|
|
27433
|
+
for (let at = lower.indexOf(open); at !== -1; at = lower.indexOf(open, from)) {
|
|
27434
|
+
let depth = 0;
|
|
27435
|
+
let end = at + name.length;
|
|
27436
|
+
for (; end < value.length; end++) {
|
|
27437
|
+
if (value[end] === "(") depth++;
|
|
27438
|
+
else if (value[end] === ")" && --depth === 0) break;
|
|
27439
|
+
}
|
|
27440
|
+
const inner = value.slice(at + open.length, end);
|
|
27441
|
+
out += value.slice(from, at) + (keep(inner) ? value.slice(at, end + 1) : "");
|
|
27442
|
+
from = end + 1;
|
|
27443
|
+
}
|
|
27444
|
+
return out + value.slice(from);
|
|
27445
|
+
}
|
|
27446
|
+
function replaceUrlCalls(css, loads) {
|
|
27447
|
+
const lower = asciiLower(css);
|
|
27448
|
+
const lastQuote = lastQuotesOf(css);
|
|
27449
|
+
let out = "";
|
|
27450
|
+
let from = 0;
|
|
27451
|
+
for (let at = lower.indexOf("url("); at !== -1; at = lower.indexOf("url(", from)) {
|
|
27452
|
+
const inner = skipSpace(css, at + 4);
|
|
27453
|
+
const quoted = quotedAt(css, inner, lastQuote);
|
|
27454
|
+
let url = null;
|
|
27455
|
+
let end = -1;
|
|
27456
|
+
if (quoted) {
|
|
27457
|
+
const paren = skipSpace(css, quoted.end);
|
|
27458
|
+
if (css[paren] === ")") {
|
|
27459
|
+
url = quoted.value;
|
|
27460
|
+
end = paren + 1;
|
|
27461
|
+
}
|
|
27462
|
+
}
|
|
27463
|
+
if (url === null) {
|
|
27464
|
+
const paren = css.indexOf(")", inner);
|
|
27465
|
+
if (paren === -1) break;
|
|
27466
|
+
url = css.slice(inner, paren);
|
|
27467
|
+
end = paren + 1;
|
|
27468
|
+
}
|
|
27469
|
+
loads.push(url.trim());
|
|
27470
|
+
out += `${css.slice(from, at)}url()`;
|
|
27471
|
+
from = end;
|
|
27472
|
+
}
|
|
27473
|
+
return out + css.slice(from);
|
|
27474
|
+
}
|
|
27475
|
+
function readCss(source, attribute) {
|
|
27476
|
+
const loads = [];
|
|
27477
|
+
let css = removeSpans(source, "/*", "*/");
|
|
27478
|
+
css = css.replace(IMPORT_RULE, (_m, url) => {
|
|
27479
|
+
loads.push(url || "@import");
|
|
27480
|
+
return "";
|
|
27481
|
+
});
|
|
27482
|
+
css = replaceUrlCalls(css, loads);
|
|
27483
|
+
css = css.replace(/"[^"]*"|'[^']*'/g, '""');
|
|
27484
|
+
const declarations = [];
|
|
27485
|
+
const declare = (body, inQuery, underTableSelector) => {
|
|
27486
|
+
for (const piece of body.split(";")) {
|
|
27487
|
+
const colon = piece.indexOf(":");
|
|
27488
|
+
if (colon === -1) continue;
|
|
27489
|
+
const prop = piece.slice(0, colon).trim().toLowerCase();
|
|
27490
|
+
const value = piece.slice(colon + 1).replace(/\s+/g, " ").trim();
|
|
27491
|
+
if (/^-?-?[a-z][a-z0-9-]*$/.test(prop) && value) declarations.push({ prop, value, inQuery, underTableSelector });
|
|
27492
|
+
}
|
|
27493
|
+
};
|
|
27494
|
+
if (attribute) {
|
|
27495
|
+
declare(css, false, false);
|
|
27496
|
+
return { declarations, loads };
|
|
27497
|
+
}
|
|
27498
|
+
const stack = [];
|
|
27499
|
+
let text5 = "";
|
|
27500
|
+
for (const ch of css) {
|
|
27501
|
+
if (ch === "{") {
|
|
27502
|
+
const prelude = text5.trim();
|
|
27503
|
+
const outer = stack[stack.length - 1];
|
|
27504
|
+
stack.push({
|
|
27505
|
+
body: "",
|
|
27506
|
+
inQuery: (outer?.inQuery ?? false) || QUERY_PRELUDE.test(prelude),
|
|
27507
|
+
underTableSelector: (outer?.underTableSelector ?? false) || !prelude.startsWith("@") && TABLE_SELECTOR.test(prelude)
|
|
27508
|
+
});
|
|
27509
|
+
text5 = "";
|
|
27510
|
+
} else if (ch === "}") {
|
|
27511
|
+
const block2 = stack.pop();
|
|
27512
|
+
if (block2) declare(block2.body + text5, block2.inQuery, block2.underTableSelector);
|
|
27513
|
+
text5 = "";
|
|
27514
|
+
} else if (ch === ";") {
|
|
27515
|
+
if (stack.length > 0) stack[stack.length - 1].body += `${text5};`;
|
|
27516
|
+
text5 = "";
|
|
27517
|
+
} else {
|
|
27518
|
+
text5 += ch;
|
|
27519
|
+
}
|
|
27520
|
+
}
|
|
27521
|
+
return { declarations, loads };
|
|
27522
|
+
}
|
|
27523
|
+
function hardCodedColor(d) {
|
|
27524
|
+
if (!COLOR_PROPERTY.test(d.prop)) return false;
|
|
27525
|
+
const tokenMixesGone = removeCalls(d.value, "color-mix", (inner) => !/var\(/i.test(inner));
|
|
27526
|
+
const literal = removeCalls(tokenMixesGone, "var");
|
|
27527
|
+
return HEX_COLOR.test(literal) || COLOR_FUNCTION.test(literal);
|
|
27528
|
+
}
|
|
27529
|
+
function fixedWidth(d) {
|
|
27530
|
+
if (d.prop !== "width" && d.prop !== "inline-size") return false;
|
|
27531
|
+
const px = /^(\d+(?:\.\d+)?)px$/i.exec(d.value.replace(/\s*!important$/i, ""));
|
|
27532
|
+
return px !== null && Number(px[1]) > PHONE_WIDTH_MAX_PX && !d.inQuery;
|
|
27533
|
+
}
|
|
27534
|
+
function tableFits(html, declarations) {
|
|
27535
|
+
if (html.includes("wayai-table-wrap")) return true;
|
|
27536
|
+
return declarations.some((d) => /^overflow(?:-x|-inline)?$/.test(d.prop) && /\b(?:auto|scroll)\b/.test(d.value) || d.inQuery && d.underTableSelector);
|
|
27537
|
+
}
|
|
27538
|
+
function markupLoads(tags) {
|
|
27539
|
+
const loads = [];
|
|
27540
|
+
for (const tag of tags) {
|
|
27541
|
+
const name = tag.name.toLowerCase();
|
|
27542
|
+
const { attrs } = tag;
|
|
27543
|
+
if (name === "script") {
|
|
27544
|
+
const src = attrs.get("src");
|
|
27545
|
+
if (src) loads.push(src);
|
|
27546
|
+
} else if (name === "link") {
|
|
27547
|
+
const href = attrs.get("href");
|
|
27548
|
+
const rel = attrs.get("rel") ?? "";
|
|
27549
|
+
if (href && (/\bstylesheet\b/i.test(rel) || /icon|preload|prefetch|manifest/i.test(rel) && !LOCAL_URL.test(href))) {
|
|
27550
|
+
loads.push(href);
|
|
27551
|
+
}
|
|
27552
|
+
} else if (name === "source") {
|
|
27553
|
+
const src = attrs.get("src");
|
|
27554
|
+
const srcset = attrs.get("srcset");
|
|
27555
|
+
if (src) loads.push(src);
|
|
27556
|
+
if (srcset && !LOCAL_URL.test(srcset)) loads.push(srcset);
|
|
27557
|
+
} else if (IMAGE_ELEMENTS.has(name)) {
|
|
27558
|
+
for (const key of ["src", "srcset", "href"]) {
|
|
27559
|
+
const url = attrs.get(key);
|
|
27560
|
+
if (url && !LOCAL_URL.test(url)) loads.push(url);
|
|
27561
|
+
}
|
|
27562
|
+
} else if (MEDIA_ELEMENTS.has(name)) {
|
|
27563
|
+
for (const key of ["src", "poster"]) {
|
|
27564
|
+
const url = attrs.get(key);
|
|
27565
|
+
if (url) loads.push(url);
|
|
27566
|
+
}
|
|
27567
|
+
} else if (name === "object") {
|
|
27568
|
+
const data = attrs.get("data");
|
|
27569
|
+
if (data) loads.push(data);
|
|
27570
|
+
}
|
|
27571
|
+
}
|
|
27572
|
+
return loads;
|
|
27573
|
+
}
|
|
27574
|
+
function shown(text5) {
|
|
27575
|
+
const line = text5.replace(/[\u0000-\u0008\u000e-\u001f\u007f-\u009f]/g, "").replace(/\s+/g, " ");
|
|
27576
|
+
return line.length <= SNIPPET_MAX_CHARS ? line : `${line.slice(0, SNIPPET_MAX_CHARS - 3)}...`;
|
|
27577
|
+
}
|
|
27578
|
+
function lintPageDesign(page) {
|
|
27579
|
+
const { html } = page;
|
|
27580
|
+
const parts = splitPage(html);
|
|
27581
|
+
const read = parts.css.map((c) => readCss(c.text, c.attribute));
|
|
27582
|
+
const declarations = read.flatMap((r) => r.declarations);
|
|
27583
|
+
const findings = [];
|
|
27584
|
+
const colors = declarations.filter(hardCodedColor);
|
|
27585
|
+
if (colors.length > 0) {
|
|
27586
|
+
findings.push({
|
|
27587
|
+
rule: "hard-coded-color",
|
|
27588
|
+
message: `${plural(colors.length, "hard-coded color")} in its CSS, e.g. \`${shown(`${colors[0].prop}: ${colors[0].value}`)}\`: style with the tokens (var(--color-...), var(--wayai-...)) so the page follows the viewer's light or dark theme`
|
|
27589
|
+
});
|
|
27590
|
+
}
|
|
27591
|
+
if (!/data-theme|applyDocumentTheme/.test(html)) {
|
|
27592
|
+
findings.push({
|
|
27593
|
+
rule: "no-theme",
|
|
27594
|
+
message: "never sets data-theme on <html> from the host context's theme, so it keeps the theme it opened in when the viewer switches between light and dark"
|
|
27595
|
+
});
|
|
27596
|
+
}
|
|
27597
|
+
const widths = declarations.filter(fixedWidth);
|
|
27598
|
+
if (widths.length > 0) {
|
|
27599
|
+
findings.push({
|
|
27600
|
+
rule: "fixed-width",
|
|
27601
|
+
message: `${plural(widths.length, "fixed width")} wider than a phone (${PHONE_WIDTH_MAX_PX}px) outside a media or container query, e.g. \`${shown(`${widths[0].prop}: ${widths[0].value}`)}\`: lay the page out mobile-first and widen it inside a media or container query`
|
|
27602
|
+
});
|
|
27603
|
+
}
|
|
27604
|
+
if ((/<table\b/i.test(html) || /createElement\(\s*['"`]table['"`]/.test(html)) && !tableFits(html, declarations)) {
|
|
27605
|
+
findings.push({
|
|
27606
|
+
rule: "table-overflow",
|
|
27607
|
+
message: "has a table with no sideways scroll or narrow layout: wrap it in a wayai-table-wrap element, or turn its rows into cards inside a media or container query"
|
|
27608
|
+
});
|
|
27609
|
+
}
|
|
27610
|
+
const loads = [
|
|
27611
|
+
...markupLoads(parts.tags),
|
|
27612
|
+
...read.flatMap((r) => r.loads).filter((url) => url !== "" && !LOCAL_URL.test(url)),
|
|
27613
|
+
...[...parts.scripts.matchAll(SCRIPT_LOAD)].map((m) => m[2])
|
|
27614
|
+
];
|
|
27615
|
+
if (loads.length > 0) {
|
|
27616
|
+
findings.push({
|
|
27617
|
+
rule: "remote-load",
|
|
27618
|
+
message: `${plural(loads.length, "load")} the page's sandbox refuses, e.g. \`${shown(loads[0])}\`: a page has no network, so inline scripts and styles, and give images and fonts as data: URLs`
|
|
27619
|
+
});
|
|
27620
|
+
}
|
|
27621
|
+
const tools = page.manifest.tools;
|
|
27622
|
+
if (Array.isArray(tools) && tools.length > 0 && LIST_MARKUP.test(html)) {
|
|
27623
|
+
if (!html.includes("wayai-empty") && !ZERO_ROWS_CHECK.test(html)) {
|
|
27624
|
+
findings.push({
|
|
27625
|
+
rule: "list-empty-state",
|
|
27626
|
+
message: "fills a list from its tools but shows no empty state (no wayai-empty element and no check for zero rows): say what is missing when a list comes back empty"
|
|
27627
|
+
});
|
|
27628
|
+
}
|
|
27629
|
+
if (!/\bisError\b/.test(html) && !html.includes("wayai-alert")) {
|
|
27630
|
+
findings.push({
|
|
27631
|
+
rule: "list-error-state",
|
|
27632
|
+
message: "calls its tools but never reads a result's isError or shows a wayai-alert: show the viewer why a call failed"
|
|
27633
|
+
});
|
|
27634
|
+
}
|
|
27635
|
+
}
|
|
27636
|
+
return findings;
|
|
27637
|
+
}
|
|
27638
|
+
function pageDesignFindings(pages) {
|
|
27639
|
+
if (!pages) return [];
|
|
27640
|
+
return pages.flatMap((page) => {
|
|
27641
|
+
const slug = page.manifest.slug;
|
|
27642
|
+
if (typeof slug !== "string") return [];
|
|
27643
|
+
return lintPageDesign(page).map((f) => ({ page: slug, rule: f.rule, message: f.message }));
|
|
27644
|
+
});
|
|
27645
|
+
}
|
|
27646
|
+
var PHONE_WIDTH_MAX_PX, code2, isLetter, isDigit, isWordChar, isTagNameChar, isAttributeNameChar, isSpace, asciiLower, lastQuotesOf, IMPORT_RULE, QUERY_PRELUDE, TABLE_SELECTOR, COLOR_PROPERTY, HEX_COLOR, COLOR_FUNCTION, LOCAL_URL, IMAGE_ELEMENTS, MEDIA_ELEMENTS, SCRIPT_LOAD, LIST_MARKUP, ZERO_ROWS_CHECK, plural, SNIPPET_MAX_CHARS;
|
|
27647
|
+
var init_page_design_lint = __esm({
|
|
27648
|
+
"../../packages/core/dist/page-design-lint.js"() {
|
|
27649
|
+
"use strict";
|
|
27650
|
+
PHONE_WIDTH_MAX_PX = 430;
|
|
27651
|
+
code2 = (ch) => ch === void 0 ? -1 : ch.charCodeAt(0);
|
|
27652
|
+
isLetter = (ch) => {
|
|
27653
|
+
const c = code2(ch) | 32;
|
|
27654
|
+
return c >= 97 && c <= 122;
|
|
27655
|
+
};
|
|
27656
|
+
isDigit = (ch) => {
|
|
27657
|
+
const c = code2(ch);
|
|
27658
|
+
return c >= 48 && c <= 57;
|
|
27659
|
+
};
|
|
27660
|
+
isWordChar = (ch) => isLetter(ch) || isDigit(ch) || ch === "_";
|
|
27661
|
+
isTagNameChar = (ch) => isLetter(ch) || isDigit(ch) || ch === "-";
|
|
27662
|
+
isAttributeNameChar = (ch) => isTagNameChar(ch) || ch === ":";
|
|
27663
|
+
isSpace = (ch) => {
|
|
27664
|
+
const c = code2(ch);
|
|
27665
|
+
return c === 32 || c >= 9 && c <= 13 || c > 127 && /\s/.test(ch);
|
|
27666
|
+
};
|
|
27667
|
+
asciiLower = (text5) => text5.replace(/[A-Z]+/g, (run) => run.toLowerCase());
|
|
27668
|
+
lastQuotesOf = (text5) => ({ '"': text5.lastIndexOf('"'), "'": text5.lastIndexOf("'") });
|
|
27669
|
+
IMPORT_RULE = /@import\s+(?:url\(\s*)?["']?([^"')\s;]*)[^;]*;?/gi;
|
|
27670
|
+
QUERY_PRELUDE = /^@(?:media|container)\b/i;
|
|
27671
|
+
TABLE_SELECTOR = /\b(?:table|thead|tbody|tr|th|td)\b/i;
|
|
27672
|
+
COLOR_PROPERTY = /^(?:color|background|background-color|fill|stroke|caret-color|accent-color|text-decoration|text-decoration-color|outline|outline-color|column-rule|column-rule-color)$|^border(?:-(?:top|right|bottom|left|block|inline|block-start|block-end|inline-start|inline-end))?(?:-color)?$/;
|
|
27673
|
+
HEX_COLOR = /#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3,4})(?![\w-])/i;
|
|
27674
|
+
COLOR_FUNCTION = /\b(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch)\(/i;
|
|
27675
|
+
LOCAL_URL = /^(?:data:|blob:|#)/i;
|
|
27676
|
+
IMAGE_ELEMENTS = /* @__PURE__ */ new Set(["img", "input", "image"]);
|
|
27677
|
+
MEDIA_ELEMENTS = /* @__PURE__ */ new Set(["video", "audio", "track", "iframe", "embed", "frame"]);
|
|
27678
|
+
SCRIPT_LOAD = /\b(?:fetch|WebSocket|EventSource)\s*\(\s*(['"`])((?:https?:|wss?:|\/\/)[^'"`]*)\1/g;
|
|
27679
|
+
LIST_MARKUP = /<(?:ul|ol|table)\b|wayai-list|createElement\(\s*['"`](?:li|tr|ul|ol|table)['"`]/i;
|
|
27680
|
+
ZERO_ROWS_CHECK = /\.length\s*(?:===?|<=)\s*0\b|\.length\s*<\s*1\b|!\s*[\w$.[\]]+\.length\b/;
|
|
27681
|
+
plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
|
|
27682
|
+
SNIPPET_MAX_CHARS = 60;
|
|
27683
|
+
}
|
|
27684
|
+
});
|
|
27685
|
+
|
|
27458
27686
|
// src/data/org-context.ts
|
|
27459
27687
|
function setDataOrgOverride(orgId) {
|
|
27460
27688
|
override = orgId;
|
|
@@ -27539,8 +27767,8 @@ function dataErrorEnvelope(err) {
|
|
|
27539
27767
|
}
|
|
27540
27768
|
}
|
|
27541
27769
|
function dataErrorCode(err) {
|
|
27542
|
-
const
|
|
27543
|
-
return typeof
|
|
27770
|
+
const code3 = dataErrorEnvelope(err)?.code;
|
|
27771
|
+
return typeof code3 === "string" && code3 ? code3 : null;
|
|
27544
27772
|
}
|
|
27545
27773
|
function dataErrorDetails(err) {
|
|
27546
27774
|
const details = dataErrorEnvelope(err)?.details;
|
|
@@ -28874,7 +29102,7 @@ async function stopEvalSessionWithRetries(stop, opts = {}) {
|
|
|
28874
29102
|
throw lastError;
|
|
28875
29103
|
}
|
|
28876
29104
|
function installEvalSignalHandlers(input) {
|
|
28877
|
-
const exit = input.exit ?? ((
|
|
29105
|
+
const exit = input.exit ?? ((code3) => process.exit(code3));
|
|
28878
29106
|
const manualStopCommand = formatEvalSessionStopCommand(input.sessionId, input.hubId);
|
|
28879
29107
|
let signalCount = 0;
|
|
28880
29108
|
let disposed = false;
|
|
@@ -32036,9 +32264,9 @@ function casePackageProblems(read, archiveBytes, definition) {
|
|
|
32036
32264
|
}
|
|
32037
32265
|
if (textBytes > CASE_PACKAGE_LIMITS.text_bytes) problems2.push({ path: null, reason: "package_text_too_large" });
|
|
32038
32266
|
for (const [folder, phase] of phases) {
|
|
32039
|
-
for (const [
|
|
32040
|
-
if (item.required && !item.grouping && !itemInstructions.has(`${folder}/${
|
|
32041
|
-
problems2.push({ path: `instructions/${folder}/items/${
|
|
32267
|
+
for (const [code3, item] of phase.items) {
|
|
32268
|
+
if (item.required && !item.grouping && !itemInstructions.has(`${folder}/${code3}`)) {
|
|
32269
|
+
problems2.push({ path: `instructions/${folder}/items/${code3}.md`, reason: "package_item_instruction_missing" });
|
|
32042
32270
|
}
|
|
32043
32271
|
}
|
|
32044
32272
|
}
|
|
@@ -32114,10 +32342,10 @@ var init_case_type_packages = __esm({
|
|
|
32114
32342
|
var init_case_types = __esm({
|
|
32115
32343
|
"../../packages/core/dist/contracts/case-types.js"() {
|
|
32116
32344
|
"use strict";
|
|
32117
|
-
|
|
32345
|
+
init_chunk_MCLSEATL();
|
|
32346
|
+
init_chunk_M2T55BV6();
|
|
32118
32347
|
init_chunk_CLGTGGVN();
|
|
32119
32348
|
init_chunk_KWRHZBGU();
|
|
32120
|
-
init_chunk_M2T55BV6();
|
|
32121
32349
|
init_chunk_VYINA6YP();
|
|
32122
32350
|
init_chunk_ZVXO3XL6();
|
|
32123
32351
|
init_chunk_FBV7NLKO();
|
|
@@ -34193,6 +34421,7 @@ var push_exports = {};
|
|
|
34193
34421
|
__export(push_exports, {
|
|
34194
34422
|
autoRenameAgentFiles: () => autoRenameAgentFiles,
|
|
34195
34423
|
createAndPushNewHub: () => createAndPushNewHub,
|
|
34424
|
+
diffWarnings: () => diffWarnings,
|
|
34196
34425
|
keepSkippedToolEntries: () => keepSkippedToolEntries,
|
|
34197
34426
|
printErrors: () => printErrors,
|
|
34198
34427
|
printLocalFileChanges: () => printLocalFileChanges,
|
|
@@ -34287,6 +34516,13 @@ function printWarnings(warnings) {
|
|
|
34287
34516
|
console.log(` \x1B[33m! ${w}\x1B[0m`);
|
|
34288
34517
|
}
|
|
34289
34518
|
}
|
|
34519
|
+
function diffWarnings(result, pages) {
|
|
34520
|
+
const findings = result.page_design ?? pageDesignFindings(pages);
|
|
34521
|
+
return [
|
|
34522
|
+
...result.warnings,
|
|
34523
|
+
...findings.map((f) => `page "${sanitizeTerminalText(f.page)}" (design): ${sanitizeTerminalText(f.message)}`)
|
|
34524
|
+
];
|
|
34525
|
+
}
|
|
34290
34526
|
function printErrors(errors) {
|
|
34291
34527
|
if (errors.length === 0) return;
|
|
34292
34528
|
console.error(`
|
|
@@ -34508,7 +34744,7 @@ async function pushSingleHub(client, hubId, hubFolder, autoConfirm, organization
|
|
|
34508
34744
|
const wireConfig = remoteConfig ? prepareResourcePayload(localConfig, remoteConfig) : localConfig;
|
|
34509
34745
|
console.log("Computing diff...");
|
|
34510
34746
|
const diffResult = await client.diff(hubId, wireConfig, "push", organizationId);
|
|
34511
|
-
printWarnings(
|
|
34747
|
+
printWarnings(diffWarnings(diffResult, localConfig.pages));
|
|
34512
34748
|
if (shouldWarnIgnoredPreviewLabel(localConfig.preview_label, diffResult.preview_label)) {
|
|
34513
34749
|
console.warn(
|
|
34514
34750
|
`Note: preview_label "${localConfig.preview_label}" in hub.yaml is server-owned and ignored on push (server value: ${diffResult.preview_label ?? "none"}). Use \`wayai relabel\` to change it.`
|
|
@@ -34726,7 +34962,7 @@ var init_push = __esm({
|
|
|
34726
34962
|
init_hub_materializer();
|
|
34727
34963
|
init_resource_files();
|
|
34728
34964
|
init_diff_display();
|
|
34729
|
-
|
|
34965
|
+
init_terminal_output();
|
|
34730
34966
|
init_utils();
|
|
34731
34967
|
init_workspace();
|
|
34732
34968
|
init_layout();
|
|
@@ -34735,6 +34971,7 @@ var init_push = __esm({
|
|
|
34735
34971
|
init_subtree_routing();
|
|
34736
34972
|
init_community_workspace();
|
|
34737
34973
|
init_skipped_tool_entries();
|
|
34974
|
+
init_page_design_lint();
|
|
34738
34975
|
init_fs_safety();
|
|
34739
34976
|
LOCAL_CHANGE_LIST_CAP = 20;
|
|
34740
34977
|
entryId = (entry) => typeof entry === "object" && entry !== null ? entry.id : void 0;
|
|
@@ -35115,7 +35352,7 @@ async function diffCommand(args2) {
|
|
|
35115
35352
|
assertResourcePayloadFitsWithoutPruning(localConfig, err);
|
|
35116
35353
|
}
|
|
35117
35354
|
const result = await client.diff(targetHubId, diffPayload, "push", organizationId);
|
|
35118
|
-
printWarnings(
|
|
35355
|
+
printWarnings(diffWarnings(result, localConfig.pages));
|
|
35119
35356
|
if (!result.has_changes) {
|
|
35120
35357
|
console.log(`
|
|
35121
35358
|
No differences \u2014 local files match ${label3}.`);
|
|
@@ -35131,7 +35368,6 @@ var init_diff = __esm({
|
|
|
35131
35368
|
init_auth();
|
|
35132
35369
|
init_api_client();
|
|
35133
35370
|
init_parser();
|
|
35134
|
-
init_page_design_lint();
|
|
35135
35371
|
init_diff_display();
|
|
35136
35372
|
init_push();
|
|
35137
35373
|
init_pull();
|
|
@@ -36476,6 +36712,112 @@ var init_send_message = __esm({
|
|
|
36476
36712
|
}
|
|
36477
36713
|
});
|
|
36478
36714
|
|
|
36715
|
+
// src/lib/eval-format.ts
|
|
36716
|
+
function runNotes(unproven, inProgress) {
|
|
36717
|
+
return [
|
|
36718
|
+
unproven > 0 ? `${unproven} unproven` : "",
|
|
36719
|
+
inProgress > 0 ? `${inProgress} in progress` : ""
|
|
36720
|
+
].filter(Boolean);
|
|
36721
|
+
}
|
|
36722
|
+
function printResultsTable(results, mode) {
|
|
36723
|
+
let totalPassed = 0;
|
|
36724
|
+
let totalEvaluated = 0;
|
|
36725
|
+
let totalUnproven = 0;
|
|
36726
|
+
let totalInProgress = 0;
|
|
36727
|
+
for (const r of results) {
|
|
36728
|
+
const evalName = r.eval?.eval_name || r.eval_id.slice(0, 8);
|
|
36729
|
+
const evaluatedRuns = evaluatedRunCount(r);
|
|
36730
|
+
const unproven = unprovenRunCount(r);
|
|
36731
|
+
const inProgress = (r.running_runs ?? 0) + (r.pending_runs ?? 0);
|
|
36732
|
+
const notes2 = runNotes(unproven, inProgress);
|
|
36733
|
+
const passed = notes2.length > 0 ? `${r.successful_runs}/${evaluatedRuns} passed (${notes2.join(", ")})` : `${r.successful_runs}/${evaluatedRuns} passed`;
|
|
36734
|
+
const avgTime = r.avg_execution_time_ms != null ? `avg ${(r.avg_execution_time_ms / 1e3).toFixed(1)}s` : "";
|
|
36735
|
+
let scoresStr = "";
|
|
36736
|
+
if (r.aggregated_scores) {
|
|
36737
|
+
const parts = Object.entries(r.aggregated_scores).map(
|
|
36738
|
+
([key, val]) => mode === "compact" ? `${key}: ${Math.round(val.avg * 100)}%` : `${key}: avg ${Math.round(val.avg * 100)}%, min ${Math.round(val.min * 100)}%, max ${Math.round(val.max * 100)}%`
|
|
36739
|
+
);
|
|
36740
|
+
if (parts.length > 0) scoresStr = " " + parts.join(" ");
|
|
36741
|
+
}
|
|
36742
|
+
console.log(` ${evalName.padEnd(20)} ${passed.padEnd(14)} ${avgTime}${scoresStr}`);
|
|
36743
|
+
totalPassed += r.successful_runs;
|
|
36744
|
+
totalEvaluated += evaluatedRuns;
|
|
36745
|
+
totalUnproven += unproven;
|
|
36746
|
+
totalInProgress += inProgress;
|
|
36747
|
+
}
|
|
36748
|
+
const pct = totalEvaluated > 0 ? (totalPassed / totalEvaluated * 100).toFixed(1) : "0.0";
|
|
36749
|
+
const notes = runNotes(totalUnproven, totalInProgress);
|
|
36750
|
+
const note = notes.length > 0 ? ` \u2014 ${notes.join(", ")}` : "";
|
|
36751
|
+
console.log(`
|
|
36752
|
+
Overall: ${totalPassed}/${totalEvaluated} passed (${pct}%)${note}`);
|
|
36753
|
+
}
|
|
36754
|
+
function truncate(str, maxLen) {
|
|
36755
|
+
if (str.length <= maxLen) return str;
|
|
36756
|
+
return str.slice(0, maxLen - 3) + "...";
|
|
36757
|
+
}
|
|
36758
|
+
function summarizeResponse(resp, maxLen = 80) {
|
|
36759
|
+
if (!resp) return "(none)";
|
|
36760
|
+
const parts = [];
|
|
36761
|
+
const content = typeof resp.content === "string" ? resp.content.trim() : "";
|
|
36762
|
+
if (content) parts.push(`"${truncate(content, maxLen)}"`);
|
|
36763
|
+
if (resp.tool_calls && resp.tool_calls.length > 0) {
|
|
36764
|
+
parts.push(
|
|
36765
|
+
resp.tool_calls.map((tc) => `${tc.function.name}(${truncate(tc.function.arguments, maxLen)})`).join(", ")
|
|
36766
|
+
);
|
|
36767
|
+
}
|
|
36768
|
+
return parts.length > 0 ? parts.join(" + ") : "(empty)";
|
|
36769
|
+
}
|
|
36770
|
+
function isFailingRun(run) {
|
|
36771
|
+
if (run.run_status && !TERMINAL_RUN_STATUSES.has(run.run_status)) return false;
|
|
36772
|
+
return run.response_match !== true;
|
|
36773
|
+
}
|
|
36774
|
+
function failureTag(run) {
|
|
36775
|
+
switch (run.outcome_kind) {
|
|
36776
|
+
case "execution_error":
|
|
36777
|
+
return "ERROR";
|
|
36778
|
+
case "evaluation_invalid":
|
|
36779
|
+
return "INVALID";
|
|
36780
|
+
// `assertion_failure`, and any pre-taxonomy payload.
|
|
36781
|
+
default:
|
|
36782
|
+
return "FAIL";
|
|
36783
|
+
}
|
|
36784
|
+
}
|
|
36785
|
+
function printFailingRuns(runs) {
|
|
36786
|
+
const failing = runs.filter(isFailingRun);
|
|
36787
|
+
if (failing.length === 0) return;
|
|
36788
|
+
console.log(`
|
|
36789
|
+
Failures (${failing.length}):`);
|
|
36790
|
+
let anyComment = false;
|
|
36791
|
+
for (const run of failing) {
|
|
36792
|
+
const evalName = run.eval?.eval_name || run.eval_id?.slice(0, 8) || "eval";
|
|
36793
|
+
console.log(` ${evalName} \u2014 Run #${run.run_number} [${failureTag(run)}]`);
|
|
36794
|
+
if (run.error_message) {
|
|
36795
|
+
console.log(` Error: ${run.error_message}`);
|
|
36796
|
+
}
|
|
36797
|
+
if (run.response_comment) {
|
|
36798
|
+
anyComment = true;
|
|
36799
|
+
console.log(` Why: ${run.response_comment}`);
|
|
36800
|
+
}
|
|
36801
|
+
if (run.expected_response) {
|
|
36802
|
+
console.log(` Expected: ${summarizeResponse(run.expected_response)}`);
|
|
36803
|
+
console.log(` Actual: ${summarizeResponse(run.eval_response)}`);
|
|
36804
|
+
}
|
|
36805
|
+
}
|
|
36806
|
+
if (!anyComment) {
|
|
36807
|
+
console.log(`
|
|
36808
|
+
${NO_EVALUATOR_NOTES_HINT}`);
|
|
36809
|
+
}
|
|
36810
|
+
}
|
|
36811
|
+
var NO_EVALUATOR_NOTES_HINT, TERMINAL_RUN_STATUSES;
|
|
36812
|
+
var init_eval_format = __esm({
|
|
36813
|
+
"src/lib/eval-format.ts"() {
|
|
36814
|
+
"use strict";
|
|
36815
|
+
init_contracts();
|
|
36816
|
+
NO_EVALUATOR_NOTES_HINT = "No evaluator notes found \u2014 add a `notes` evaluation variable to the message_evaluator agent to surface its reasoning here.";
|
|
36817
|
+
TERMINAL_RUN_STATUSES = /* @__PURE__ */ new Set(["completed", "failed"]);
|
|
36818
|
+
}
|
|
36819
|
+
});
|
|
36820
|
+
|
|
36479
36821
|
// src/lib/cross-hub-conversations.ts
|
|
36480
36822
|
async function mapWithConcurrency(items, concurrency, worker) {
|
|
36481
36823
|
const results = new Array(items.length);
|
|
@@ -37156,10 +37498,9 @@ Partial listing: ${result.scopes_failed} of ${result.scopes_total} scope(s) coul
|
|
|
37156
37498
|
console.log(`Conversations (${result.conversations.length} of ${result.total}):
|
|
37157
37499
|
`);
|
|
37158
37500
|
for (const conv of result.conversations) {
|
|
37159
|
-
const participant = conv.
|
|
37160
|
-
const
|
|
37161
|
-
|
|
37162
|
-
console.log(` ${conv.conversation_id} ${participant.padEnd(20)} ${msgs.padEnd(10)} ${updated}`);
|
|
37501
|
+
const participant = conv.name || "unknown";
|
|
37502
|
+
const when = (/* @__PURE__ */ new Date(`${(conv.ended_at ?? conv.timestamp).replace(" ", "T")}Z`)).toLocaleString();
|
|
37503
|
+
console.log(` ${conv.conversation_id} ${participant.padEnd(20)} ${conv.conversation_status.padEnd(10)} ${when}`);
|
|
37163
37504
|
}
|
|
37164
37505
|
} else {
|
|
37165
37506
|
const result = await client.getConversations(hubId, { status, limit, offset });
|
|
@@ -37794,8 +38135,8 @@ var init_evals2 = __esm({
|
|
|
37794
38135
|
|
|
37795
38136
|
// src/lib/eval-fixture-queue.ts
|
|
37796
38137
|
function isQueueableLaunchError(err) {
|
|
37797
|
-
const
|
|
37798
|
-
return
|
|
38138
|
+
const code3 = extractApiErrorCode(err);
|
|
38139
|
+
return code3 !== null && QUEUEABLE_LAUNCH_ERRORS.has(code3);
|
|
37799
38140
|
}
|
|
37800
38141
|
async function runWithFixtureQueue(opts) {
|
|
37801
38142
|
let delay3 = FIXTURE_QUEUE_INITIAL_DELAY_MS;
|
|
@@ -39156,8 +39497,8 @@ function readbackCandidate(text5, kind) {
|
|
|
39156
39497
|
return digitRuns(text5).find((r) => r.length >= 9 && r.length <= 13) ?? null;
|
|
39157
39498
|
}
|
|
39158
39499
|
if (kind === "digits") {
|
|
39159
|
-
const
|
|
39160
|
-
if (
|
|
39500
|
+
const code3 = extractFacts(text5).find((f) => (f.kind === "digits" || f.kind === "cpf") && f.key.length >= 5);
|
|
39501
|
+
if (code3) return code3.key;
|
|
39161
39502
|
return digitRuns(text5).find((r) => r.length >= 5) ?? null;
|
|
39162
39503
|
}
|
|
39163
39504
|
return extractFacts(text5).find((f) => f.kind === kind)?.key ?? null;
|
|
@@ -40109,7 +40450,7 @@ function chooseAudioSource(options, plan, env = process.env) {
|
|
|
40109
40450
|
}
|
|
40110
40451
|
return new OpenAiTtsSource({ apiKey, voice: options.ttsVoice, model: options.ttsModel });
|
|
40111
40452
|
}
|
|
40112
|
-
function installInterruptHandlers(exit = (
|
|
40453
|
+
function installInterruptHandlers(exit = (code3) => process.exit(code3)) {
|
|
40113
40454
|
let first = null;
|
|
40114
40455
|
const listeners = /* @__PURE__ */ new Map();
|
|
40115
40456
|
const dispose = () => {
|
|
@@ -40822,7 +41163,7 @@ async function analyticsSummaryCommand(args2) {
|
|
|
40822
41163
|
console.error("--metric requires a value");
|
|
40823
41164
|
process.exit(1);
|
|
40824
41165
|
}
|
|
40825
|
-
metricNames = args2[++i].split(",").map((
|
|
41166
|
+
metricNames = args2[++i].split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
40826
41167
|
} else if (arg === "--filter") {
|
|
40827
41168
|
if (i + 1 >= args2.length) {
|
|
40828
41169
|
console.error("--filter requires a value");
|
|
@@ -40916,37 +41257,44 @@ Available metrics:
|
|
|
40916
41257
|
});
|
|
40917
41258
|
if (jsonOutput) {
|
|
40918
41259
|
console.log(JSON.stringify(result, null, 2));
|
|
41260
|
+
if (result.cold) process.exit(1);
|
|
40919
41261
|
return;
|
|
40920
41262
|
}
|
|
41263
|
+
if (result.cold) {
|
|
41264
|
+
console.error("ClickHouse is warming up (cold start); the analytics are temporarily unavailable. Retry in a few seconds.");
|
|
41265
|
+
process.exit(1);
|
|
41266
|
+
}
|
|
40921
41267
|
const label3 = from && to ? `${from} to ${to}` : `last ${period || "7d"}`;
|
|
40922
41268
|
console.log(`Hub Analytics (${label3})
|
|
40923
41269
|
`);
|
|
40924
|
-
|
|
40925
|
-
|
|
41270
|
+
const s = result.summary;
|
|
41271
|
+
if (s && "conversations" in s) {
|
|
40926
41272
|
console.log("Summary:");
|
|
40927
|
-
console.log(` Total conversations: ${s.
|
|
40928
|
-
console.log(`
|
|
40929
|
-
console.log(`
|
|
40930
|
-
console.log(`
|
|
40931
|
-
console.log(`
|
|
41273
|
+
console.log(` Total conversations: ${fmt(s.conversations.value)}`);
|
|
41274
|
+
console.log(` Users: ${fmt(s.users.value)}`);
|
|
41275
|
+
console.log(` AI-only rate: ${s["ai_only_%"].value == null ? "N/A" : `${s["ai_only_%"].value.toFixed(1)}%`}`);
|
|
41276
|
+
console.log(` Avg agent response: ${formatSeconds(s.avg_agent_response.value)}`);
|
|
41277
|
+
console.log(` Avg team response: ${formatSeconds(s.avg_team_response.value)}`);
|
|
41278
|
+
console.log(` First team response: ${formatSeconds(s.first_team_response.value)}`);
|
|
40932
41279
|
}
|
|
40933
41280
|
if (result.analytics && result.analytics.length > 0) {
|
|
40934
41281
|
console.log("\nMetrics:");
|
|
40935
41282
|
for (const item of result.analytics) {
|
|
40936
41283
|
const name = variableNameMap?.get(item.variable_id) || item.variable;
|
|
40937
41284
|
console.log(` ${name}:`);
|
|
40938
|
-
if (
|
|
41285
|
+
if (!("metrics" in item)) continue;
|
|
41286
|
+
if (item.type === "numeric") {
|
|
40939
41287
|
const m = item.metrics;
|
|
40940
41288
|
const parts = [];
|
|
40941
41289
|
parts.push(`Average: ${fmt(m.average)}`);
|
|
40942
|
-
|
|
41290
|
+
parts.push(`Median: ${fmt(m.median)}`);
|
|
40943
41291
|
parts.push(`Min: ${fmt(m.minimum)}`);
|
|
40944
41292
|
parts.push(`Max: ${fmt(m.maximum)}`);
|
|
40945
|
-
|
|
41293
|
+
parts.push(`Count: ${m.count}`);
|
|
40946
41294
|
console.log(` ${parts.join(" ")}`);
|
|
40947
|
-
} else if (item.type === "categorical"
|
|
40948
|
-
for (const
|
|
40949
|
-
console.log(` ${
|
|
41295
|
+
} else if (item.type === "categorical") {
|
|
41296
|
+
for (const { category, count, percentage } of item.metrics.distribution) {
|
|
41297
|
+
console.log(` ${category}: ${count} (${percentage}%)`);
|
|
40950
41298
|
}
|
|
40951
41299
|
}
|
|
40952
41300
|
}
|
|
@@ -41317,10 +41665,11 @@ function printVariablesByCategory(data) {
|
|
|
41317
41665
|
console.log("");
|
|
41318
41666
|
}
|
|
41319
41667
|
}
|
|
41320
|
-
function
|
|
41321
|
-
if (
|
|
41322
|
-
|
|
41323
|
-
return `${
|
|
41668
|
+
function formatSeconds(seconds2) {
|
|
41669
|
+
if (seconds2 == null) return "N/A";
|
|
41670
|
+
const rounded = Math.round(seconds2);
|
|
41671
|
+
if (rounded < 60) return `${rounded}s`;
|
|
41672
|
+
return `${Math.floor(rounded / 60)}m ${rounded % 60}s`;
|
|
41324
41673
|
}
|
|
41325
41674
|
function fmt(n) {
|
|
41326
41675
|
if (n == null) return "N/A";
|
|
@@ -42845,11 +43194,11 @@ var CASE_AGENT_REQUEST_TTL_MS, CASE_AGENT_REQUESTS_PER_PERSON_MAX, CASE_AGENT_MA
|
|
|
42845
43194
|
var init_case_agents = __esm({
|
|
42846
43195
|
"../../packages/core/dist/contracts/case-agents.js"() {
|
|
42847
43196
|
"use strict";
|
|
42848
|
-
|
|
42849
|
-
|
|
43197
|
+
init_chunk_UGKJPB2J();
|
|
43198
|
+
init_chunk_MCLSEATL();
|
|
43199
|
+
init_chunk_M2T55BV6();
|
|
42850
43200
|
init_chunk_CLGTGGVN();
|
|
42851
43201
|
init_chunk_KWRHZBGU();
|
|
42852
|
-
init_chunk_M2T55BV6();
|
|
42853
43202
|
init_chunk_VYINA6YP();
|
|
42854
43203
|
init_chunk_ZVXO3XL6();
|
|
42855
43204
|
init_chunk_FBV7NLKO();
|
|
@@ -42883,11 +43232,11 @@ var init_case_agents = __esm({
|
|
|
42883
43232
|
var init_case_records = __esm({
|
|
42884
43233
|
"../../packages/core/dist/contracts/case-records.js"() {
|
|
42885
43234
|
"use strict";
|
|
42886
|
-
|
|
42887
|
-
|
|
43235
|
+
init_chunk_UGKJPB2J();
|
|
43236
|
+
init_chunk_MCLSEATL();
|
|
43237
|
+
init_chunk_M2T55BV6();
|
|
42888
43238
|
init_chunk_CLGTGGVN();
|
|
42889
43239
|
init_chunk_KWRHZBGU();
|
|
42890
|
-
init_chunk_M2T55BV6();
|
|
42891
43240
|
init_chunk_VYINA6YP();
|
|
42892
43241
|
init_chunk_ZVXO3XL6();
|
|
42893
43242
|
init_chunk_FBV7NLKO();
|
|
@@ -42905,10 +43254,10 @@ var init_case_review = __esm({
|
|
|
42905
43254
|
"../../packages/core/dist/contracts/case-review.js"() {
|
|
42906
43255
|
"use strict";
|
|
42907
43256
|
init_chunk_HPZOVPVT();
|
|
42908
|
-
|
|
43257
|
+
init_chunk_MCLSEATL();
|
|
43258
|
+
init_chunk_M2T55BV6();
|
|
42909
43259
|
init_chunk_CLGTGGVN();
|
|
42910
43260
|
init_chunk_KWRHZBGU();
|
|
42911
|
-
init_chunk_M2T55BV6();
|
|
42912
43261
|
init_chunk_VYINA6YP();
|
|
42913
43262
|
init_chunk_ZVXO3XL6();
|
|
42914
43263
|
init_chunk_FBV7NLKO();
|
|
@@ -43038,14 +43387,14 @@ var init_case_session = __esm({
|
|
|
43038
43387
|
var init_case_comments = __esm({
|
|
43039
43388
|
"../../packages/core/dist/contracts/case-comments.js"() {
|
|
43040
43389
|
"use strict";
|
|
43041
|
-
|
|
43042
|
-
|
|
43390
|
+
init_chunk_BN7WSDWC();
|
|
43391
|
+
init_chunk_7JYZW5BH();
|
|
43043
43392
|
init_chunk_HPZOVPVT();
|
|
43044
|
-
|
|
43045
|
-
|
|
43393
|
+
init_chunk_UGKJPB2J();
|
|
43394
|
+
init_chunk_MCLSEATL();
|
|
43395
|
+
init_chunk_M2T55BV6();
|
|
43046
43396
|
init_chunk_CLGTGGVN();
|
|
43047
43397
|
init_chunk_KWRHZBGU();
|
|
43048
|
-
init_chunk_M2T55BV6();
|
|
43049
43398
|
init_chunk_VYINA6YP();
|
|
43050
43399
|
init_chunk_ZVXO3XL6();
|
|
43051
43400
|
init_chunk_FBV7NLKO();
|
|
@@ -43061,15 +43410,15 @@ var init_case_comments = __esm({
|
|
|
43061
43410
|
var init_case_collection_citations = __esm({
|
|
43062
43411
|
"../../packages/core/dist/contracts/case-collection-citations.js"() {
|
|
43063
43412
|
"use strict";
|
|
43064
|
-
|
|
43065
|
-
|
|
43066
|
-
|
|
43413
|
+
init_chunk_CSHU2GN3();
|
|
43414
|
+
init_chunk_BN7WSDWC();
|
|
43415
|
+
init_chunk_7JYZW5BH();
|
|
43067
43416
|
init_chunk_HPZOVPVT();
|
|
43068
|
-
|
|
43069
|
-
|
|
43417
|
+
init_chunk_UGKJPB2J();
|
|
43418
|
+
init_chunk_MCLSEATL();
|
|
43419
|
+
init_chunk_M2T55BV6();
|
|
43070
43420
|
init_chunk_CLGTGGVN();
|
|
43071
43421
|
init_chunk_KWRHZBGU();
|
|
43072
|
-
init_chunk_M2T55BV6();
|
|
43073
43422
|
init_chunk_VYINA6YP();
|
|
43074
43423
|
init_chunk_ZVXO3XL6();
|
|
43075
43424
|
init_chunk_FBV7NLKO();
|
|
@@ -43085,19 +43434,19 @@ var init_case_collection_citations = __esm({
|
|
|
43085
43434
|
var init_case_collection_links = __esm({
|
|
43086
43435
|
"../../packages/core/dist/contracts/case-collection-links.js"() {
|
|
43087
43436
|
"use strict";
|
|
43088
|
-
|
|
43089
|
-
|
|
43090
|
-
|
|
43091
|
-
|
|
43437
|
+
init_chunk_VGNNAETO();
|
|
43438
|
+
init_chunk_CSHU2GN3();
|
|
43439
|
+
init_chunk_YMFTFCT5();
|
|
43440
|
+
init_chunk_J3HQTL6M();
|
|
43092
43441
|
init_chunk_ZJA3UZMG();
|
|
43093
|
-
|
|
43094
|
-
|
|
43442
|
+
init_chunk_BN7WSDWC();
|
|
43443
|
+
init_chunk_7JYZW5BH();
|
|
43095
43444
|
init_chunk_HPZOVPVT();
|
|
43096
|
-
|
|
43097
|
-
|
|
43445
|
+
init_chunk_UGKJPB2J();
|
|
43446
|
+
init_chunk_MCLSEATL();
|
|
43447
|
+
init_chunk_M2T55BV6();
|
|
43098
43448
|
init_chunk_CLGTGGVN();
|
|
43099
43449
|
init_chunk_KWRHZBGU();
|
|
43100
|
-
init_chunk_M2T55BV6();
|
|
43101
43450
|
init_chunk_VYINA6YP();
|
|
43102
43451
|
init_chunk_ZVXO3XL6();
|
|
43103
43452
|
init_chunk_FBV7NLKO();
|
|
@@ -43613,8 +43962,8 @@ async function lockMirror(root) {
|
|
|
43613
43962
|
}
|
|
43614
43963
|
};
|
|
43615
43964
|
const refusal2 = (err) => {
|
|
43616
|
-
const
|
|
43617
|
-
return
|
|
43965
|
+
const code3 = err.code;
|
|
43966
|
+
return code3 === "EACCES" || code3 === "EPERM" || code3 === "EROFS" ? expected(`The mirror's folder ${safe6(dir)} cannot be written (${code3}). Make it writable by you (it is the CLI's to write), then pull again.`) : err;
|
|
43618
43967
|
};
|
|
43619
43968
|
const deadline = Date.now() + LOCK_WAIT_MS;
|
|
43620
43969
|
for (; ; ) {
|
|
@@ -43864,7 +44213,7 @@ exec wayai cases pull --mirror-only --dir "$(dirname "$0")/.."
|
|
|
43864
44213
|
}
|
|
43865
44214
|
});
|
|
43866
44215
|
|
|
43867
|
-
// ../../packages/core/dist/chunk-
|
|
44216
|
+
// ../../packages/core/dist/chunk-QF3ISWMG.js
|
|
43868
44217
|
function firstAtOrAfter(sorted, from) {
|
|
43869
44218
|
let lo = 0;
|
|
43870
44219
|
let hi = sorted.length;
|
|
@@ -44005,7 +44354,7 @@ function lineImages(line) {
|
|
|
44005
44354
|
const targets = [];
|
|
44006
44355
|
const targetFrom = (from) => {
|
|
44007
44356
|
let k = from;
|
|
44008
|
-
while (k < line.length && !
|
|
44357
|
+
while (k < line.length && !isSpace2(line[k]) && line[k] !== ")" && line[k] !== ">") k++;
|
|
44009
44358
|
return line.slice(from, k);
|
|
44010
44359
|
};
|
|
44011
44360
|
let bracket = -2;
|
|
@@ -44016,7 +44365,7 @@ function lineImages(line) {
|
|
|
44016
44365
|
after = null;
|
|
44017
44366
|
if (bracket >= 0 && line[bracket + 1] === "(") {
|
|
44018
44367
|
let j = bracket + 2;
|
|
44019
|
-
while (
|
|
44368
|
+
while (isSpace2(line[j])) j++;
|
|
44020
44369
|
const angled = line[j] === "<" ? targetFrom(j + 1) : "";
|
|
44021
44370
|
const target = angled || targetFrom(j);
|
|
44022
44371
|
if (target) after = { target, end: (angled ? j + 1 : j) + target.length };
|
|
@@ -44033,11 +44382,11 @@ function fillsOf(text5) {
|
|
|
44033
44382
|
let close3 = -2;
|
|
44034
44383
|
for (let open = text5.indexOf("{{"); open >= 0; ) {
|
|
44035
44384
|
let j = open + 2;
|
|
44036
|
-
while (
|
|
44385
|
+
while (isSpace2(text5[j])) j++;
|
|
44037
44386
|
let next = open + 1;
|
|
44038
44387
|
if (text5.startsWith("fill", j)) {
|
|
44039
44388
|
j += 4;
|
|
44040
|
-
while (
|
|
44389
|
+
while (isSpace2(text5[j])) j++;
|
|
44041
44390
|
if (text5[j] === ":") {
|
|
44042
44391
|
j++;
|
|
44043
44392
|
if (close3 !== -1 && close3 < j) close3 = text5.indexOf("}}", j);
|
|
@@ -44080,7 +44429,7 @@ function anchorOf(text5) {
|
|
|
44080
44429
|
for (let k = attributes.length - 1; k >= 0; k--) {
|
|
44081
44430
|
if (attributes[k] !== "#" || k > 0 && !isTabOrSpace(attributes[k - 1])) continue;
|
|
44082
44431
|
let stop = k + 1;
|
|
44083
|
-
while (stop < attributes.length && !
|
|
44432
|
+
while (stop < attributes.length && !isSpace2(attributes[stop])) stop++;
|
|
44084
44433
|
if (stop === k + 1) continue;
|
|
44085
44434
|
let titleEnd = open;
|
|
44086
44435
|
while (titleEnd > 0 && isTabOrSpace(text5[titleEnd - 1])) titleEnd--;
|
|
@@ -44278,12 +44627,12 @@ function readItems(text5, state) {
|
|
|
44278
44627
|
malformed_markers: malformed
|
|
44279
44628
|
};
|
|
44280
44629
|
}
|
|
44281
|
-
var CASE_COMPOSED_COVER, CASE_ITEM_READER_MAX_CHARS, FENCE_OPEN, BLANK_AFTER, CASE_FRONT_MATTER, FRONT_MATTER_OPENING, withoutBom, FENCE, SETEXT_UNDERLINE, DASHES, COLUMNS, patternBody, CALCULATION_MARKER, DECISION_MARKER, DOCUMENT_MARKER, INPUT_MARKER,
|
|
44282
|
-
var
|
|
44283
|
-
"../../packages/core/dist/chunk-
|
|
44630
|
+
var CASE_COMPOSED_COVER, CASE_ITEM_READER_MAX_CHARS, FENCE_OPEN, BLANK_AFTER, CASE_FRONT_MATTER, FRONT_MATTER_OPENING, withoutBom, FENCE, SETEXT_UNDERLINE, DASHES, COLUMNS, patternBody, CALCULATION_MARKER, DECISION_MARKER, DOCUMENT_MARKER, INPUT_MARKER, isSpace2, isTabOrSpace, once, OPENS_FRONT_MATTER;
|
|
44631
|
+
var init_chunk_QF3ISWMG = __esm({
|
|
44632
|
+
"../../packages/core/dist/chunk-QF3ISWMG.js"() {
|
|
44284
44633
|
"use strict";
|
|
44285
|
-
|
|
44286
|
-
|
|
44634
|
+
init_chunk_BN7WSDWC();
|
|
44635
|
+
init_chunk_MCLSEATL();
|
|
44287
44636
|
CASE_COMPOSED_COVER = "00-cover.md";
|
|
44288
44637
|
CASE_ITEM_READER_MAX_CHARS = 4 * 1024 * 1024;
|
|
44289
44638
|
FENCE_OPEN = / {0,3}(`{3,}|~{3,})([^\n]*)(?:\n|$)/y;
|
|
@@ -44302,7 +44651,7 @@ var init_chunk_7ASBGO5Y = __esm({
|
|
|
44302
44651
|
INPUT_MARKER = new RegExp(
|
|
44303
44652
|
`^(?<key>${patternBody(CASE_INPUT_KEY_PATTERN)})@v(?<version>[1-9]\\d*)(?:#L(?<start>[1-9]\\d*)(?:-L(?<end>[1-9]\\d*))?)?(?:\\|(?<label>.*))?$`
|
|
44304
44653
|
);
|
|
44305
|
-
|
|
44654
|
+
isSpace2 = (c) => c !== void 0 && /\s/.test(c);
|
|
44306
44655
|
isTabOrSpace = (c) => c === " " || c === " ";
|
|
44307
44656
|
once = (values) => [...new Set(values)];
|
|
44308
44657
|
OPENS_FRONT_MATTER = new RegExp(FRONT_MATTER_OPENING);
|
|
@@ -44313,15 +44662,15 @@ var init_chunk_7ASBGO5Y = __esm({
|
|
|
44313
44662
|
var init_case_item_reader = __esm({
|
|
44314
44663
|
"../../packages/core/dist/case-item-reader.js"() {
|
|
44315
44664
|
"use strict";
|
|
44316
|
-
|
|
44317
|
-
|
|
44318
|
-
|
|
44665
|
+
init_chunk_QF3ISWMG();
|
|
44666
|
+
init_chunk_BN7WSDWC();
|
|
44667
|
+
init_chunk_7JYZW5BH();
|
|
44319
44668
|
init_chunk_HPZOVPVT();
|
|
44320
|
-
|
|
44321
|
-
|
|
44669
|
+
init_chunk_UGKJPB2J();
|
|
44670
|
+
init_chunk_MCLSEATL();
|
|
44671
|
+
init_chunk_M2T55BV6();
|
|
44322
44672
|
init_chunk_CLGTGGVN();
|
|
44323
44673
|
init_chunk_KWRHZBGU();
|
|
44324
|
-
init_chunk_M2T55BV6();
|
|
44325
44674
|
init_chunk_VYINA6YP();
|
|
44326
44675
|
init_chunk_ZVXO3XL6();
|
|
44327
44676
|
init_chunk_FBV7NLKO();
|
|
@@ -44533,14 +44882,14 @@ function linkMismatch(input, label3, target) {
|
|
|
44533
44882
|
if (input.origin === "previous_output") return `The ${label3} links an earlier phase's official version: pass --official-version <id or output code>, or --list.`;
|
|
44534
44883
|
return target.kind === "list" ? `The ${label3} links a received document of the case, which no read lists here: pass --received <id> (the id is in its files' names under a phase's received/).` : `The ${label3} links a received document of the case: pass --received <id>.`;
|
|
44535
44884
|
}
|
|
44536
|
-
function chooseByOutput(linkable,
|
|
44537
|
-
const chosen = linkable.filter((v) => v.output.code ===
|
|
44885
|
+
function chooseByOutput(linkable, code3, named, folders) {
|
|
44886
|
+
const chosen = linkable.filter((v) => v.output.code === code3);
|
|
44538
44887
|
if (chosen.length === 1) return chosen[0];
|
|
44539
44888
|
if (chosen.length > 1) {
|
|
44540
|
-
throw expected(`Several outputs of code ${
|
|
44889
|
+
throw expected(`Several outputs of code ${code3} have an official version the ${named.label} may link, one per phase: name it by its id.` + candidateBlock(chosen, named.key, named.folder, folders, " "));
|
|
44541
44890
|
}
|
|
44542
44891
|
if (linkable.length === 0) throw expected(noneLinkable(named.label));
|
|
44543
|
-
throw expected(`No output of code ${
|
|
44892
|
+
throw expected(`No output of code ${code3} has an official version the ${named.label} may link. Those it may link:` + candidateBlock(linkable, named.key, named.folder, folders, " "));
|
|
44544
44893
|
}
|
|
44545
44894
|
function linkableLines(linkable, named, folders) {
|
|
44546
44895
|
if (linkable.length === 0) return [noneLinkable(named.label)];
|
|
@@ -44660,16 +45009,16 @@ ${line}`).join("");
|
|
|
44660
45009
|
var init_case_input_sources = __esm({
|
|
44661
45010
|
"../../packages/core/dist/contracts/case-input-sources.js"() {
|
|
44662
45011
|
"use strict";
|
|
44663
|
-
|
|
44664
|
-
|
|
44665
|
-
|
|
44666
|
-
|
|
45012
|
+
init_chunk_YCVI6W6V();
|
|
45013
|
+
init_chunk_CSHU2GN3();
|
|
45014
|
+
init_chunk_BN7WSDWC();
|
|
45015
|
+
init_chunk_7JYZW5BH();
|
|
44667
45016
|
init_chunk_HPZOVPVT();
|
|
44668
|
-
|
|
44669
|
-
|
|
45017
|
+
init_chunk_UGKJPB2J();
|
|
45018
|
+
init_chunk_MCLSEATL();
|
|
45019
|
+
init_chunk_M2T55BV6();
|
|
44670
45020
|
init_chunk_CLGTGGVN();
|
|
44671
45021
|
init_chunk_KWRHZBGU();
|
|
44672
|
-
init_chunk_M2T55BV6();
|
|
44673
45022
|
init_chunk_VYINA6YP();
|
|
44674
45023
|
init_chunk_ZVXO3XL6();
|
|
44675
45024
|
init_chunk_FBV7NLKO();
|
|
@@ -44685,12 +45034,12 @@ var init_case_input_sources = __esm({
|
|
|
44685
45034
|
var init_case_notes = __esm({
|
|
44686
45035
|
"../../packages/core/dist/contracts/case-notes.js"() {
|
|
44687
45036
|
"use strict";
|
|
44688
|
-
|
|
44689
|
-
|
|
44690
|
-
|
|
45037
|
+
init_chunk_7JYZW5BH();
|
|
45038
|
+
init_chunk_UGKJPB2J();
|
|
45039
|
+
init_chunk_MCLSEATL();
|
|
45040
|
+
init_chunk_M2T55BV6();
|
|
44691
45041
|
init_chunk_CLGTGGVN();
|
|
44692
45042
|
init_chunk_KWRHZBGU();
|
|
44693
|
-
init_chunk_M2T55BV6();
|
|
44694
45043
|
init_chunk_VYINA6YP();
|
|
44695
45044
|
init_chunk_ZVXO3XL6();
|
|
44696
45045
|
init_chunk_FBV7NLKO();
|
|
@@ -45184,28 +45533,28 @@ async function caseSkeleton(session, clone, opts) {
|
|
|
45184
45533
|
};
|
|
45185
45534
|
if (!CASE_PHASE_FOLDER_PATTERN.test(phase.folder)) problems2.push(`the phase's folder ${JSON.stringify(sanitizeTerminalText(phase.folder))} is no phase folder`);
|
|
45186
45535
|
const planned = outputs.map((output) => {
|
|
45187
|
-
const
|
|
45536
|
+
const code3 = one3(output.code);
|
|
45188
45537
|
const bad = output.file_paths.filter((p) => !casePath2(p.endsWith("/") ? `${p}${CASE_COMPOSED_COVER}` : p, false));
|
|
45189
|
-
for (const p of bad) problems2.push(`output ${
|
|
45538
|
+
for (const p of bad) problems2.push(`output ${code3}: ${JSON.stringify(sanitizeTerminalText(p))} is no path of this phase a document can be written at`);
|
|
45190
45539
|
if (bad.length) return null;
|
|
45191
|
-
if (output.format === "file") return { code:
|
|
45192
|
-
if (output.dispensation) return { code:
|
|
45540
|
+
if (output.format === "file") return { code: code3, skipped: "a file piece, sent as it comes: it has no items to start from" };
|
|
45541
|
+
if (output.dispensation) return { code: code3, skipped: "dispensed" };
|
|
45193
45542
|
const items = workItems.filter((i) => i.output_id === output.id && !i.dispensation);
|
|
45194
45543
|
const malformed = items.filter((i) => !CASE_CODE_PATTERN.test(i.code));
|
|
45195
|
-
for (const i of malformed) problems2.push(`output ${
|
|
45544
|
+
for (const i of malformed) problems2.push(`output ${code3}: ${JSON.stringify(sanitizeTerminalText(i.code))} is no item code`);
|
|
45196
45545
|
if (malformed.length) return null;
|
|
45197
|
-
if (items.length === 0) return { code:
|
|
45546
|
+
if (items.length === 0) return { code: code3, skipped: "no item to start from" };
|
|
45198
45547
|
const bound = output.file_paths.find((p) => p.endsWith(".md") || p.endsWith("/"));
|
|
45199
|
-
if (bound === void 0) return { code:
|
|
45548
|
+
if (bound === void 0) return { code: code3, skipped: "it binds no Markdown file or folder of chapters" };
|
|
45200
45549
|
const held = output.file_paths.flatMap((p) => opts.confidential ? [p, `conf/${p}`] : [p]).find((p) => documentHere(clone.root, clone.record, p));
|
|
45201
|
-
if (held !== void 0) return { code:
|
|
45550
|
+
if (held !== void 0) return { code: code3, skipped: `its document is already here, at ${sanitizeTerminalText(held)}` };
|
|
45202
45551
|
const skeletonItems = items.map((item) => {
|
|
45203
45552
|
let template = null;
|
|
45204
45553
|
if (item.own === null && !item.grouping && item.template_mode !== "fixed") {
|
|
45205
45554
|
const rel = `templates/${phase.folder}/${item.code}.md`;
|
|
45206
45555
|
const file = pkg2.file(rel);
|
|
45207
45556
|
if (file.state !== "unlisted" && file.confidential && !opts.confidential) {
|
|
45208
|
-
problems2.push(`item ${one3(item.code)} of output ${
|
|
45557
|
+
problems2.push(`item ${one3(item.code)} of output ${code3}: its template is confidential, used only with --confidential`);
|
|
45209
45558
|
} else if (file.state === "ok") {
|
|
45210
45559
|
template = file.bytes.toString("utf-8");
|
|
45211
45560
|
} else if (file.state !== "unlisted") {
|
|
@@ -45219,9 +45568,9 @@ async function caseSkeleton(session, clone, opts) {
|
|
|
45219
45568
|
const base = opts.confidential ? `conf/${bound}` : bound;
|
|
45220
45569
|
const made = skeletonFiles(input, base);
|
|
45221
45570
|
for (const f of made.files.filter((f2) => !casePath2(f2.rel, opts.confidential))) {
|
|
45222
|
-
problems2.push(`output ${
|
|
45571
|
+
problems2.push(`output ${code3}: ${JSON.stringify(sanitizeTerminalText(f.rel))} is no path a document can be written at`);
|
|
45223
45572
|
}
|
|
45224
|
-
return { code:
|
|
45573
|
+
return { code: code3, path: base, files: made.files, items: items.length, missing: made.missing };
|
|
45225
45574
|
});
|
|
45226
45575
|
if (problems2.length) {
|
|
45227
45576
|
throw expected(`Nothing was written:
|
|
@@ -46051,10 +46400,10 @@ var init_case_files2 = __esm({
|
|
|
46051
46400
|
// src/cases/case-review.ts
|
|
46052
46401
|
function reviewFailure(err, session) {
|
|
46053
46402
|
if (err instanceof ApiError && err.status >= 400 && err.status < 500) {
|
|
46054
|
-
const
|
|
46403
|
+
const code3 = session.connection.code;
|
|
46055
46404
|
switch (extractApiErrorReason(err)) {
|
|
46056
46405
|
case CASE_REVIEW_TOO_LARGE_REASON:
|
|
46057
|
-
return expected(`Case ${
|
|
46406
|
+
return expected(`Case ${code3}'s review is larger than one review may read, so it cannot be computed.`);
|
|
46058
46407
|
case CASE_REVIEW_PAIR_UNKNOWN_REASON:
|
|
46059
46408
|
return expected(
|
|
46060
46409
|
"The case's review holds no pair of those items with those hashes at that revision (a value not copied as the review printed it, or --confidential not as the review was read). Nothing was recorded. Run the command `wayai cases review` prints for the pair."
|
|
@@ -46062,11 +46411,11 @@ function reviewFailure(err, session) {
|
|
|
46062
46411
|
case CASE_REVIEW_CHAIN_STOPPED_REASON:
|
|
46063
46412
|
return expected(`This pair's chain stopped after ${CASE_REVIEW_ROUNDS_MAX} rounds, so it takes no verdict. ${WEB_ONLY_NOTICE}`);
|
|
46064
46413
|
case CASE_REVIEW_VERDICTS_FULL_REASON:
|
|
46065
|
-
return expected(`Case ${
|
|
46414
|
+
return expected(`Case ${code3} holds as many verdicts as it may: nothing was recorded.`);
|
|
46066
46415
|
case CASE_CLOSED_REASON:
|
|
46067
|
-
return expected(`Case ${
|
|
46416
|
+
return expected(`Case ${code3} is closed: it takes no verdict.`);
|
|
46068
46417
|
case "revision_unknown":
|
|
46069
|
-
return expected(`Case ${
|
|
46418
|
+
return expected(`Case ${code3} has no revision of that id you may read. Read the review again: \`wayai cases review\`.`);
|
|
46070
46419
|
case "reason_too_long":
|
|
46071
46420
|
return expected("The reason is longer than the case takes.");
|
|
46072
46421
|
}
|
|
@@ -46110,17 +46459,17 @@ async function caseReview(session, opts) {
|
|
|
46110
46459
|
printReview(session.connection, graph);
|
|
46111
46460
|
}
|
|
46112
46461
|
function printReview(connection, graph) {
|
|
46113
|
-
const { code:
|
|
46462
|
+
const { code: code3 } = connection;
|
|
46114
46463
|
const omitted = graph.warnings.some((w) => w.code === CASE_REVIEW_CONFIDENTIAL_OMITTED);
|
|
46115
46464
|
const notice = () => {
|
|
46116
46465
|
if (omitted) console.log("\nConfidential content is left out of this review unless you pass --confidential.");
|
|
46117
46466
|
};
|
|
46118
46467
|
if (graph.revision_id === null) {
|
|
46119
|
-
console.log(`Case ${
|
|
46468
|
+
console.log(`Case ${code3} has no revision you read here: nothing to review.`);
|
|
46120
46469
|
notice();
|
|
46121
46470
|
return;
|
|
46122
46471
|
}
|
|
46123
|
-
console.log(`Review of case ${
|
|
46472
|
+
console.log(`Review of case ${code3} at revision ${one5(graph.revision_id)}${graph.confidential ? ", with confidential content" : ""}.`);
|
|
46124
46473
|
console.log(graph.base_revision_id ? `Base: revision ${one5(graph.base_revision_id)}. Nothing you read here is pending.` : "Base: each item's own, below. Something you read here is pending.");
|
|
46125
46474
|
const titles = new Map(graph.items.map((item) => [item.key, item.title]));
|
|
46126
46475
|
if (graph.items.length) {
|
|
@@ -46288,8 +46637,8 @@ async function casesCommand(args2) {
|
|
|
46288
46637
|
if (extra.length) throw usageError4(`${name} does not take ${extra.map((key) => `--${key}`).join(", ")}.`);
|
|
46289
46638
|
if (name === "connect") {
|
|
46290
46639
|
if (operands.length !== 3) throw usageError4("connect takes <org_id> <space_id> <code>.");
|
|
46291
|
-
const [orgId, spaceId,
|
|
46292
|
-
return connect(caseRef(orgId, spaceId,
|
|
46640
|
+
const [orgId, spaceId, code3] = operands;
|
|
46641
|
+
return connect(caseRef(orgId, spaceId, code3), machineLabel2(values.label));
|
|
46293
46642
|
}
|
|
46294
46643
|
if (name === "type pull") {
|
|
46295
46644
|
if (operands.length !== 3) throw usageError4("type pull takes <org_id> <space_id> <type_id>.");
|
|
@@ -46432,8 +46781,8 @@ async function casesCommand(args2) {
|
|
|
46432
46781
|
throw usageError4(`Unknown subcommand ${JSON.stringify(sanitizeTerminalText(name))}.`);
|
|
46433
46782
|
}
|
|
46434
46783
|
}
|
|
46435
|
-
function caseRef(orgId, spaceId,
|
|
46436
|
-
const parsed = caseRecordParam.safeParse({ org_id: orgId, space_id: spaceId, code:
|
|
46784
|
+
function caseRef(orgId, spaceId, code3) {
|
|
46785
|
+
const parsed = caseRecordParam.safeParse({ org_id: orgId, space_id: spaceId, code: code3 });
|
|
46437
46786
|
if (!parsed.success) {
|
|
46438
46787
|
throw usageError4("Expected an organization id and a space id (UUIDs) and a case code (TYPE-YEAR-SEQ, as the web app shows it).");
|
|
46439
46788
|
}
|
|
@@ -46555,12 +46904,12 @@ async function selfRevoke(connection, token) {
|
|
|
46555
46904
|
return "unreachable";
|
|
46556
46905
|
}
|
|
46557
46906
|
}
|
|
46558
|
-
async function disconnect(
|
|
46559
|
-
const matches = listCaseConnections().filter((c) => c.code ===
|
|
46560
|
-
if (matches.length === 0) throw expected(`This machine is not connected to case ${sanitizeTerminalText(
|
|
46907
|
+
async function disconnect(code3, filter) {
|
|
46908
|
+
const matches = listCaseConnections().filter((c) => c.code === code3 && (filter.org === void 0 || c.org_id === filter.org) && (filter.space === void 0 || c.space_id === filter.space));
|
|
46909
|
+
if (matches.length === 0) throw expected(`This machine is not connected to case ${sanitizeTerminalText(code3)}.`);
|
|
46561
46910
|
if (matches.length > 1) {
|
|
46562
46911
|
throw expected(
|
|
46563
|
-
`This machine is connected to ${matches.length} cases coded ${
|
|
46912
|
+
`This machine is connected to ${matches.length} cases coded ${code3}; pick one with --org and --space:
|
|
46564
46913
|
` + matches.map((c) => ` --org ${c.org_id} --space ${c.space_id}`).join("\n")
|
|
46565
46914
|
);
|
|
46566
46915
|
}
|
|
@@ -46571,18 +46920,18 @@ async function disconnect(code2, filter) {
|
|
|
46571
46920
|
token = await readCaseToken(connection);
|
|
46572
46921
|
} catch (err) {
|
|
46573
46922
|
throw expected(
|
|
46574
|
-
`This machine's keyring could not read the token for case ${
|
|
46923
|
+
`This machine's keyring could not read the token for case ${code3} (${err instanceof Error ? err.message : String(err)}). Nothing was revoked or removed: run disconnect again once the keyring can be read.`
|
|
46575
46924
|
);
|
|
46576
46925
|
}
|
|
46577
46926
|
let outcome = "no_token";
|
|
46578
46927
|
if (token) outcome = await selfRevoke(connection, token);
|
|
46579
46928
|
const { keyringCleared } = await removeCaseConnection(connection);
|
|
46580
|
-
if (outcome === "revoked") console.log(`Revoked this machine's authorization on case ${
|
|
46581
|
-
else if (outcome === "dead") console.log(`The authorization on case ${
|
|
46929
|
+
if (outcome === "revoked") console.log(`Revoked this machine's authorization on case ${code3}.`);
|
|
46930
|
+
else if (outcome === "dead") console.log(`The authorization on case ${code3} was already revoked or expired.`);
|
|
46582
46931
|
else if (outcome === "unreachable") {
|
|
46583
|
-
console.error(`The server could not be reached, so the authorization on case ${
|
|
46932
|
+
console.error(`The server could not be reached, so the authorization on case ${code3} may still be live: revoke it in the web app, at ${agentsPage}.`);
|
|
46584
46933
|
} else {
|
|
46585
|
-
console.error(`This machine's keyring held no token for case ${
|
|
46934
|
+
console.error(`This machine's keyring held no token for case ${code3}. If the web app still lists its authorization, revoke it there, at ${agentsPage}.`);
|
|
46586
46935
|
}
|
|
46587
46936
|
if (keyringCleared) {
|
|
46588
46937
|
console.log("The case token is removed from this machine.");
|
|
@@ -49379,8 +49728,8 @@ function requireFlagValue(flagArgs, index, flag) {
|
|
|
49379
49728
|
}
|
|
49380
49729
|
function errorCodeOf(body) {
|
|
49381
49730
|
try {
|
|
49382
|
-
const
|
|
49383
|
-
return typeof
|
|
49731
|
+
const code3 = JSON.parse(body)?.error;
|
|
49732
|
+
return typeof code3 === "string" ? code3 : null;
|
|
49384
49733
|
} catch {
|
|
49385
49734
|
return null;
|
|
49386
49735
|
}
|
|
@@ -50993,8 +51342,8 @@ import { Command as Command5 } from "commander";
|
|
|
50993
51342
|
function isRetryable(err) {
|
|
50994
51343
|
if (isNetworkError(err)) return true;
|
|
50995
51344
|
if (!(err instanceof ApiError)) return false;
|
|
50996
|
-
const
|
|
50997
|
-
if (
|
|
51345
|
+
const code3 = dataErrorCode(err);
|
|
51346
|
+
if (code3 && RETRYABLE_CODES.has(code3)) return true;
|
|
50998
51347
|
return err.status >= 500 && err.status !== 501;
|
|
50999
51348
|
}
|
|
51000
51349
|
function isExpiredSession(err) {
|
|
@@ -51010,8 +51359,8 @@ async function withRetry(state, fn, what) {
|
|
|
51010
51359
|
} catch (err) {
|
|
51011
51360
|
lastErr = err;
|
|
51012
51361
|
if (!isRetryable(err) || attempt === MAX_ATTEMPTS) throw err;
|
|
51013
|
-
const
|
|
51014
|
-
if (!
|
|
51362
|
+
const code3 = err instanceof ApiError ? dataErrorCode(err) : null;
|
|
51363
|
+
if (!code3 || !RETRYABLE_CODES.has(code3)) state.sawAmbiguous = true;
|
|
51015
51364
|
const delay3 = BASE_BACKOFF_MS * 2 ** (attempt - 1);
|
|
51016
51365
|
console.error(
|
|
51017
51366
|
` ${what}: ${err.message} \u2014 retrying in ${delay3}ms (${attempt}/${MAX_ATTEMPTS - 1})`
|
|
@@ -53127,13 +53476,13 @@ function routeErrorsToCli(command2) {
|
|
|
53127
53476
|
return command2;
|
|
53128
53477
|
}
|
|
53129
53478
|
function handleParserExit(err) {
|
|
53130
|
-
const { code:
|
|
53131
|
-
if (
|
|
53132
|
-
if (
|
|
53479
|
+
const { code: code3, exitCode } = err ?? {};
|
|
53480
|
+
if (code3 === "commander.helpDisplayed" || code3 === "commander.version") return;
|
|
53481
|
+
if (code3 === "commander.help") {
|
|
53133
53482
|
process.exitCode = exitCode || 1;
|
|
53134
53483
|
return;
|
|
53135
53484
|
}
|
|
53136
|
-
if (typeof
|
|
53485
|
+
if (typeof code3 === "string" && code3.startsWith("commander.")) {
|
|
53137
53486
|
throw expected(err instanceof Error ? err.message : String(err));
|
|
53138
53487
|
}
|
|
53139
53488
|
throw err;
|