@wayai/cli 0.3.244 → 0.3.245
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 +469 -266
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16,44 +16,44 @@ var __export = (target, all) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// src/lib/mask-secrets.ts
|
|
19
|
-
function valueEnd(
|
|
20
|
-
for (let i = from; i <
|
|
21
|
-
if (
|
|
19
|
+
function valueEnd(text2, from, isEnd) {
|
|
20
|
+
for (let i = from; i < text2.length; i++) {
|
|
21
|
+
if (text2[i] === "\\") {
|
|
22
22
|
i++;
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
|
-
if (isEnd(
|
|
25
|
+
if (isEnd(text2[i])) return i;
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return text2.length;
|
|
28
28
|
}
|
|
29
|
-
function maskCredentialValues(
|
|
29
|
+
function maskCredentialValues(text2, keyRe, resolveValueEnd) {
|
|
30
30
|
keyRe.lastIndex = 0;
|
|
31
31
|
let out = "";
|
|
32
32
|
let copied = 0;
|
|
33
33
|
let match;
|
|
34
|
-
while ((match = keyRe.exec(
|
|
34
|
+
while ((match = keyRe.exec(text2)) !== null) {
|
|
35
35
|
const valueStart = match.index + match[0].length;
|
|
36
36
|
keyRe.lastIndex = valueStart;
|
|
37
37
|
if (!isCredentialKey(match[1])) continue;
|
|
38
|
-
const end = resolveValueEnd(
|
|
39
|
-
const value =
|
|
38
|
+
const end = resolveValueEnd(text2, valueStart);
|
|
39
|
+
const value = text2.slice(valueStart, end);
|
|
40
40
|
if (value.length === 0 || FULLY_MASKED_VALUE_RE.test(value)) continue;
|
|
41
|
-
out +=
|
|
41
|
+
out += text2.slice(copied, valueStart) + "[REDACTED]";
|
|
42
42
|
copied = end;
|
|
43
43
|
keyRe.lastIndex = end;
|
|
44
44
|
}
|
|
45
|
-
return out +
|
|
45
|
+
return out + text2.slice(copied);
|
|
46
46
|
}
|
|
47
|
-
function maskJwts(
|
|
47
|
+
function maskJwts(text2) {
|
|
48
48
|
let out = "";
|
|
49
49
|
let copied = 0;
|
|
50
50
|
let cursor = 0;
|
|
51
|
-
while (cursor <
|
|
52
|
-
while (cursor <
|
|
51
|
+
while (cursor < text2.length) {
|
|
52
|
+
while (cursor < text2.length && !isBase64UrlChar(text2[cursor])) cursor++;
|
|
53
53
|
const headerStart = cursor;
|
|
54
54
|
let tokenStart = -1;
|
|
55
|
-
while (cursor <
|
|
56
|
-
if (tokenStart < 0 &&
|
|
55
|
+
while (cursor < text2.length && isBase64UrlChar(text2[cursor])) {
|
|
56
|
+
if (tokenStart < 0 && text2[cursor] === "e" && text2[cursor + 1] === "y" && text2[cursor + 2] === "J") {
|
|
57
57
|
tokenStart = cursor;
|
|
58
58
|
}
|
|
59
59
|
cursor++;
|
|
@@ -61,28 +61,28 @@ function maskJwts(text) {
|
|
|
61
61
|
const headerEnd = cursor;
|
|
62
62
|
if (headerStart === headerEnd) continue;
|
|
63
63
|
const hasJwtHeader = tokenStart >= headerStart && tokenStart + 3 < headerEnd;
|
|
64
|
-
if (!hasJwtHeader ||
|
|
64
|
+
if (!hasJwtHeader || text2[headerEnd] !== ".") continue;
|
|
65
65
|
const payloadStart = headerEnd + 1;
|
|
66
66
|
cursor = payloadStart;
|
|
67
|
-
while (cursor <
|
|
67
|
+
while (cursor < text2.length && isBase64UrlChar(text2[cursor])) cursor++;
|
|
68
68
|
const payloadEnd = cursor;
|
|
69
|
-
if (payloadEnd === payloadStart ||
|
|
69
|
+
if (payloadEnd === payloadStart || text2[payloadEnd] !== ".") continue;
|
|
70
70
|
const signatureStart = payloadEnd + 1;
|
|
71
71
|
cursor = signatureStart;
|
|
72
|
-
while (cursor <
|
|
72
|
+
while (cursor < text2.length && isBase64UrlChar(text2[cursor])) cursor++;
|
|
73
73
|
if (cursor === signatureStart) continue;
|
|
74
|
-
out +=
|
|
74
|
+
out += text2.slice(copied, tokenStart) + "[REDACTED_JWT]";
|
|
75
75
|
copied = cursor;
|
|
76
76
|
}
|
|
77
|
-
return out +
|
|
77
|
+
return out + text2.slice(copied);
|
|
78
78
|
}
|
|
79
|
-
function jsonContainerEnd(
|
|
80
|
-
const opener =
|
|
79
|
+
function jsonContainerEnd(text2, from) {
|
|
80
|
+
const opener = text2[from];
|
|
81
81
|
if (opener !== "{" && opener !== "[") return null;
|
|
82
82
|
const stack = [opener];
|
|
83
83
|
let inString = false;
|
|
84
|
-
for (let i = from + 1; i <
|
|
85
|
-
const char =
|
|
84
|
+
for (let i = from + 1; i < text2.length; i++) {
|
|
85
|
+
const char = text2[i];
|
|
86
86
|
if (inString) {
|
|
87
87
|
if (char === "\\") {
|
|
88
88
|
i++;
|
|
@@ -103,62 +103,62 @@ function jsonContainerEnd(text, from) {
|
|
|
103
103
|
}
|
|
104
104
|
return null;
|
|
105
105
|
}
|
|
106
|
-
function jsonNumberEnd(
|
|
107
|
-
const match = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(
|
|
106
|
+
function jsonNumberEnd(text2, from) {
|
|
107
|
+
const match = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(text2.slice(from));
|
|
108
108
|
if (!match) return null;
|
|
109
109
|
const end = from + match[0].length;
|
|
110
110
|
let next = end;
|
|
111
|
-
while (next <
|
|
112
|
-
return next ===
|
|
111
|
+
while (next < text2.length && /\s/.test(text2[next])) next++;
|
|
112
|
+
return next === text2.length || text2[next] === "," || text2[next] === "}" || text2[next] === "]" ? end : null;
|
|
113
113
|
}
|
|
114
|
-
function maskJsonCredentialValues(
|
|
114
|
+
function maskJsonCredentialValues(text2) {
|
|
115
115
|
JSON_KEY_RE.lastIndex = 0;
|
|
116
116
|
let out = "";
|
|
117
117
|
let copied = 0;
|
|
118
118
|
let match;
|
|
119
|
-
while ((match = JSON_KEY_RE.exec(
|
|
119
|
+
while ((match = JSON_KEY_RE.exec(text2)) !== null) {
|
|
120
120
|
const valueStart = match.index + match[0].length;
|
|
121
121
|
JSON_KEY_RE.lastIndex = valueStart;
|
|
122
122
|
const key = match[1];
|
|
123
123
|
const isNumericCredentialKey = NUMERIC_CREDENTIAL_KEY_RE.test(key);
|
|
124
124
|
if (!isCredentialKey(key) && !isNumericCredentialKey) continue;
|
|
125
|
-
if (
|
|
125
|
+
if (text2[valueStart] === '"') {
|
|
126
126
|
const contentStart = valueStart + 1;
|
|
127
|
-
const end = valueEnd(
|
|
128
|
-
const value =
|
|
127
|
+
const end = valueEnd(text2, contentStart, isJsonValueEnd);
|
|
128
|
+
const value = text2.slice(contentStart, end);
|
|
129
129
|
if (value.length === 0 || FULLY_MASKED_VALUE_RE.test(value)) continue;
|
|
130
|
-
out +=
|
|
130
|
+
out += text2.slice(copied, contentStart) + "[REDACTED]";
|
|
131
131
|
copied = end;
|
|
132
132
|
JSON_KEY_RE.lastIndex = end;
|
|
133
133
|
continue;
|
|
134
134
|
}
|
|
135
|
-
if (
|
|
136
|
-
const end = jsonContainerEnd(
|
|
137
|
-
out +=
|
|
135
|
+
if (text2[valueStart] === "{" || text2[valueStart] === "[") {
|
|
136
|
+
const end = jsonContainerEnd(text2, valueStart) ?? text2.length;
|
|
137
|
+
out += text2.slice(copied, valueStart) + '"[REDACTED]"';
|
|
138
138
|
copied = end;
|
|
139
139
|
JSON_KEY_RE.lastIndex = end;
|
|
140
140
|
continue;
|
|
141
141
|
}
|
|
142
142
|
if (isNumericCredentialKey) {
|
|
143
|
-
const end = jsonNumberEnd(
|
|
143
|
+
const end = jsonNumberEnd(text2, valueStart);
|
|
144
144
|
if (end !== null) {
|
|
145
|
-
out +=
|
|
145
|
+
out += text2.slice(copied, valueStart) + '"[REDACTED]"';
|
|
146
146
|
copied = end;
|
|
147
147
|
JSON_KEY_RE.lastIndex = end;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
return out +
|
|
151
|
+
return out + text2.slice(copied);
|
|
152
152
|
}
|
|
153
|
-
function headerValueEnd(
|
|
154
|
-
for (let i = from; i <
|
|
155
|
-
const char =
|
|
153
|
+
function headerValueEnd(text2, from) {
|
|
154
|
+
for (let i = from; i < text2.length; i++) {
|
|
155
|
+
const char = text2[i];
|
|
156
156
|
if (char === "\r" || char === "\n") return i;
|
|
157
157
|
if (char === "\\") {
|
|
158
158
|
let afterSlashes = i;
|
|
159
|
-
while (
|
|
159
|
+
while (text2[afterSlashes] === "\\") afterSlashes++;
|
|
160
160
|
const slashCount = afterSlashes - i;
|
|
161
|
-
if (slashCount % 2 === 1 && (
|
|
161
|
+
if (slashCount % 2 === 1 && (text2[afterSlashes] === "r" || text2[afterSlashes] === "n")) {
|
|
162
162
|
return i;
|
|
163
163
|
}
|
|
164
164
|
if (slashCount % 2 === 1) afterSlashes++;
|
|
@@ -167,16 +167,16 @@ function headerValueEnd(text, from) {
|
|
|
167
167
|
}
|
|
168
168
|
if (char === '"') {
|
|
169
169
|
let next = i + 1;
|
|
170
|
-
while (next <
|
|
171
|
-
if (next ===
|
|
170
|
+
while (next < text2.length && /\s/.test(text2[next])) next++;
|
|
171
|
+
if (next === text2.length || text2[next] === "," || text2[next] === "}" || text2[next] === "]") {
|
|
172
172
|
return i;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
return
|
|
176
|
+
return text2.length;
|
|
177
177
|
}
|
|
178
|
-
function isSerializedJsonContainer(
|
|
179
|
-
const trimmed =
|
|
178
|
+
function isSerializedJsonContainer(text2) {
|
|
179
|
+
const trimmed = text2.trim();
|
|
180
180
|
if (trimmed[0] !== "{" && trimmed[0] !== "[") return false;
|
|
181
181
|
try {
|
|
182
182
|
const parsed = JSON.parse(trimmed);
|
|
@@ -185,21 +185,21 @@ function isSerializedJsonContainer(text) {
|
|
|
185
185
|
return false;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
function maskNestedJsonStringValues(
|
|
188
|
+
function maskNestedJsonStringValues(text2, depth) {
|
|
189
189
|
let out = "";
|
|
190
190
|
let copied = 0;
|
|
191
|
-
for (let i = 0; i <
|
|
192
|
-
if (
|
|
191
|
+
for (let i = 0; i < text2.length; i++) {
|
|
192
|
+
if (text2[i] !== '"') continue;
|
|
193
193
|
const contentStart = i + 1;
|
|
194
|
-
const end = valueEnd(
|
|
195
|
-
if (end ===
|
|
194
|
+
const end = valueEnd(text2, contentStart, isJsonValueEnd);
|
|
195
|
+
if (end === text2.length) break;
|
|
196
196
|
let next = end + 1;
|
|
197
|
-
while (next <
|
|
198
|
-
if (
|
|
197
|
+
while (next < text2.length && /\s/.test(text2[next])) next++;
|
|
198
|
+
if (text2[next] === ":") {
|
|
199
199
|
i = end;
|
|
200
200
|
continue;
|
|
201
201
|
}
|
|
202
|
-
const encoded =
|
|
202
|
+
const encoded = text2.slice(contentStart, end);
|
|
203
203
|
let decoded;
|
|
204
204
|
try {
|
|
205
205
|
decoded = JSON.parse(`"${encoded}"`);
|
|
@@ -210,15 +210,15 @@ function maskNestedJsonStringValues(text, depth) {
|
|
|
210
210
|
const masked = depth >= MAX_NESTED_JSON_STRING_DEPTH && isSerializedJsonContainer(decoded) ? "[REDACTED]" : maskSecretsInMessageAtDepth(decoded, depth + 1);
|
|
211
211
|
if (masked !== decoded) {
|
|
212
212
|
const reencoded = JSON.stringify(masked).slice(1, -1);
|
|
213
|
-
out +=
|
|
213
|
+
out += text2.slice(copied, contentStart) + reencoded;
|
|
214
214
|
copied = end;
|
|
215
215
|
}
|
|
216
216
|
i = end;
|
|
217
217
|
}
|
|
218
|
-
return out +
|
|
218
|
+
return out + text2.slice(copied);
|
|
219
219
|
}
|
|
220
|
-
function maskSecretsInMessageAtDepth(
|
|
221
|
-
let out = maskJwts(
|
|
220
|
+
function maskSecretsInMessageAtDepth(text2, depth) {
|
|
221
|
+
let out = maskJwts(text2);
|
|
222
222
|
for (const [pattern, replacement] of SHAPE_PATTERNS) out = out.replace(pattern, replacement);
|
|
223
223
|
out = out.replace(BASIC_CREDENTIAL_RE, maskBasicCredential);
|
|
224
224
|
out = maskJsonCredentialValues(out);
|
|
@@ -227,8 +227,8 @@ function maskSecretsInMessageAtDepth(text, depth) {
|
|
|
227
227
|
out = maskCredentialValues(out, HEADER_KEY_RE, headerValueEnd);
|
|
228
228
|
return out.replace(BASE64_RE, maskBase64);
|
|
229
229
|
}
|
|
230
|
-
function maskSecretsInMessage(
|
|
231
|
-
return maskSecretsInMessageAtDepth(
|
|
230
|
+
function maskSecretsInMessage(text2) {
|
|
231
|
+
return maskSecretsInMessageAtDepth(text2, 0);
|
|
232
232
|
}
|
|
233
233
|
var CREDENTIAL_KEY_RE, NUMERIC_CREDENTIAL_KEY_RE, FULLY_MASKED_VALUE_RE, isCredentialKey, isBase64UrlChar, SHAPE_PATTERNS, BASIC_CREDENTIAL_RE, maskBasicCredential, JSON_KEY_RE, isJsonValueEnd, QUERY_KEY_RE, isQueryValueEnd, queryValueEnd, HEADER_KEY_RE, BASE64_RE, maskBase64, MAX_NESTED_JSON_STRING_DEPTH;
|
|
234
234
|
var init_mask_secrets = __esm({
|
|
@@ -287,7 +287,7 @@ var init_mask_secrets = __esm({
|
|
|
287
287
|
isJsonValueEnd = (char) => char === '"';
|
|
288
288
|
QUERY_KEY_RE = /(?:^|[?#&;,\s"'])([A-Za-z0-9_.-]+)=/g;
|
|
289
289
|
isQueryValueEnd = (char) => char === "&" || char === ";" || char === '"' || /\s/.test(char);
|
|
290
|
-
queryValueEnd = (
|
|
290
|
+
queryValueEnd = (text2, from) => valueEnd(text2, from, isQueryValueEnd);
|
|
291
291
|
HEADER_KEY_RE = /(?:^|[^A-Za-z0-9_.\/\\-])([A-Za-z0-9_.-]+):[ \t]*/g;
|
|
292
292
|
BASE64_RE = // Padded base64 bodies (wrapped DEKs, HMAC secrets, service-account material)
|
|
293
293
|
// appearing outside any credential-named key — the shape the rules above miss.
|
|
@@ -5396,6 +5396,19 @@ var init_chunk_RACEDHG6 = __esm({
|
|
|
5396
5396
|
}
|
|
5397
5397
|
});
|
|
5398
5398
|
|
|
5399
|
+
// ../../packages/core/dist/chunk-GXY7XACJ.js
|
|
5400
|
+
var accessExplainQuery;
|
|
5401
|
+
var init_chunk_GXY7XACJ = __esm({
|
|
5402
|
+
"../../packages/core/dist/chunk-GXY7XACJ.js"() {
|
|
5403
|
+
"use strict";
|
|
5404
|
+
init_chunk_HZ6CADSY();
|
|
5405
|
+
init_zod();
|
|
5406
|
+
accessExplainQuery = external_exports.object({
|
|
5407
|
+
user_id: external_exports.string().regex(USER_ID_REGEX).optional()
|
|
5408
|
+
});
|
|
5409
|
+
}
|
|
5410
|
+
});
|
|
5411
|
+
|
|
5399
5412
|
// ../../packages/core/dist/chunk-WBFLPPDI.js
|
|
5400
5413
|
var connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, BESIDE_LINK_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery;
|
|
5401
5414
|
var init_chunk_WBFLPPDI = __esm({
|
|
@@ -6441,10 +6454,10 @@ var init_chunk_TUHJ5PQH = __esm({
|
|
|
6441
6454
|
}
|
|
6442
6455
|
});
|
|
6443
6456
|
|
|
6444
|
-
// ../../packages/core/dist/chunk-
|
|
6445
|
-
var REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, REKOR_BOUND_BASE_HEADER, REKOR_BOUND_TOOLSET_HEADER, REKOR_BOUND_TOKEN_HEADER, REKOR_BOUND_CUSTOMER_HEADER, REKOR_BOUND_ACCESS_HEADER, DATA_BASE_GENERATION_HEADER, REKOR_MAX_ACTOR_ID_LENGTH, REKOR_MAX_ACTOR_LABEL_LENGTH, REKOR_MAX_ACCESS_DIMENSIONS, REKOR_MAX_ACCESS_VALUES, REKOR_MAX_ACCESS_ID_LENGTH, REKOR_MAX_ACCESS_HEADER_LENGTH;
|
|
6446
|
-
var
|
|
6447
|
-
"../../packages/core/dist/chunk-
|
|
6457
|
+
// ../../packages/core/dist/chunk-TANTZFI3.js
|
|
6458
|
+
var REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, REKOR_BOUND_BASE_HEADER, REKOR_BOUND_TOOLSET_HEADER, REKOR_BOUND_TOKEN_HEADER, REKOR_BOUND_CUSTOMER_HEADER, REKOR_BOUND_ACCESS_HEADER, REKOR_BOUND_ACCESS_SCOPE_HEADER, REKOR_ACCESS_SCOPE_CUSTOMER, DATA_BASE_GENERATION_HEADER, REKOR_MAX_ACTOR_ID_LENGTH, REKOR_MAX_ACTOR_LABEL_LENGTH, REKOR_MAX_ACCESS_DIMENSIONS, REKOR_MAX_ACCESS_VALUES, REKOR_MAX_ACCESS_ID_LENGTH, REKOR_MAX_ACCESS_HEADER_LENGTH;
|
|
6459
|
+
var init_chunk_TANTZFI3 = __esm({
|
|
6460
|
+
"../../packages/core/dist/chunk-TANTZFI3.js"() {
|
|
6448
6461
|
"use strict";
|
|
6449
6462
|
init_zod();
|
|
6450
6463
|
REKOR_ACTOR_TYPE_HEADER = "X-Rekor-Actor-Type";
|
|
@@ -6479,6 +6492,8 @@ var init_chunk_3LY5HJUX = __esm({
|
|
|
6479
6492
|
REKOR_BOUND_TOKEN_HEADER = "X-Rekor-Bound-Token";
|
|
6480
6493
|
REKOR_BOUND_CUSTOMER_HEADER = "X-Rekor-Bound-Customer";
|
|
6481
6494
|
REKOR_BOUND_ACCESS_HEADER = "X-Rekor-Bound-Access";
|
|
6495
|
+
REKOR_BOUND_ACCESS_SCOPE_HEADER = "X-Rekor-Bound-Access-Scope";
|
|
6496
|
+
REKOR_ACCESS_SCOPE_CUSTOMER = "customer";
|
|
6482
6497
|
DATA_BASE_GENERATION_HEADER = "X-Data-Base-Generation";
|
|
6483
6498
|
REKOR_MAX_ACTOR_ID_LENGTH = 256;
|
|
6484
6499
|
REKOR_MAX_ACTOR_LABEL_LENGTH = 256;
|
|
@@ -6489,7 +6504,7 @@ var init_chunk_3LY5HJUX = __esm({
|
|
|
6489
6504
|
}
|
|
6490
6505
|
});
|
|
6491
6506
|
|
|
6492
|
-
// ../../packages/core/dist/chunk-
|
|
6507
|
+
// ../../packages/core/dist/chunk-ZLGONLDP.js
|
|
6493
6508
|
function writeWithinRead(assignment) {
|
|
6494
6509
|
return Object.values(assignment).every(({ read, write }) => read.includes(ACCESS_UNRESTRICTED) || !write.includes(ACCESS_UNRESTRICTED) && write.every((id) => read.includes(id)));
|
|
6495
6510
|
}
|
|
@@ -6505,11 +6520,11 @@ function isEncodedAccessSet(raw) {
|
|
|
6505
6520
|
function assignmentHasUnrestricted(assignment) {
|
|
6506
6521
|
return Object.values(assignment).some((lists) => lists.read.includes(ACCESS_UNRESTRICTED) || lists.write.includes(ACCESS_UNRESTRICTED));
|
|
6507
6522
|
}
|
|
6508
|
-
var ACCESS_UNRESTRICTED, ACCESS_ID_REGEX, ACCESS_ID_MAX_LENGTH, MAX_ACCESS_DIMENSIONS_PER_ORG, MAX_ACCESS_VALUES_PER_DIMENSION, ACCESS_LABEL_MAX_LENGTH, accessIdSchema, accessLabelSchema, accessValueListSchema, accessAssignmentSchema, accessSetSchema, accessDimensionParam, accessValueParam, orgMemberParam, orgHubParam, createAccessDimensionBody, updateAccessDimensionBody, createAccessValueBody, updateAccessValueBody, setMemberAccessValuesBody, setHubUserAccessValuesBody, setAgentAccessValuesBody;
|
|
6509
|
-
var
|
|
6510
|
-
"../../packages/core/dist/chunk-
|
|
6523
|
+
var ACCESS_UNRESTRICTED, ACCESS_ID_REGEX, ACCESS_ID_MAX_LENGTH, MAX_ACCESS_DIMENSIONS_PER_ORG, MAX_ACCESS_VALUES_PER_DIMENSION, ACCESS_LABEL_MAX_LENGTH, accessIdSchema, accessLabelSchema, accessValueListSchema, accessAssignmentSchema, accessSetSchema, accessDimensionParam, accessValueParam, orgMemberParam, orgHubParam, createAccessDimensionBody, updateAccessDimensionBody, createAccessValueBody, updateAccessValueBody, setMemberAccessValuesBody, HUB_PERSON_KINDS, ACCESS_PERSON_KINDS, setHubUserAccessValuesBody, setAgentAccessValuesBody;
|
|
6524
|
+
var init_chunk_ZLGONLDP = __esm({
|
|
6525
|
+
"../../packages/core/dist/chunk-ZLGONLDP.js"() {
|
|
6511
6526
|
"use strict";
|
|
6512
|
-
|
|
6527
|
+
init_chunk_TANTZFI3();
|
|
6513
6528
|
init_chunk_HZ6CADSY();
|
|
6514
6529
|
init_zod();
|
|
6515
6530
|
ACCESS_UNRESTRICTED = "*";
|
|
@@ -6520,7 +6535,7 @@ var init_chunk_BCDGY3GH = __esm({
|
|
|
6520
6535
|
ACCESS_LABEL_MAX_LENGTH = 100;
|
|
6521
6536
|
accessIdSchema = external_exports.string().min(1).max(ACCESS_ID_MAX_LENGTH).regex(ACCESS_ID_REGEX, { message: 'Must be ASCII letters, digits, "_" or "-", starting with a letter or digit (e.g. "class", "7A")' });
|
|
6522
6537
|
accessLabelSchema = external_exports.string().trim().min(1).max(ACCESS_LABEL_MAX_LENGTH);
|
|
6523
|
-
accessValueListSchema = external_exports.array(external_exports.union([accessIdSchema, external_exports.literal(ACCESS_UNRESTRICTED)])).max(MAX_ACCESS_VALUES_PER_DIMENSION).refine((
|
|
6538
|
+
accessValueListSchema = external_exports.array(external_exports.union([accessIdSchema, external_exports.literal(ACCESS_UNRESTRICTED)])).max(MAX_ACCESS_VALUES_PER_DIMENSION).refine((list2) => !list2.includes(ACCESS_UNRESTRICTED) || list2.length === 1, {
|
|
6524
6539
|
message: `"${ACCESS_UNRESTRICTED}" reaches the dimension unrestricted, so it stands alone in its list`
|
|
6525
6540
|
});
|
|
6526
6541
|
accessAssignmentSchema = external_exports.record(
|
|
@@ -6567,6 +6582,8 @@ var init_chunk_BCDGY3GH = __esm({
|
|
|
6567
6582
|
setMemberAccessValuesBody = external_exports.object({
|
|
6568
6583
|
values: accessAssignmentSchema
|
|
6569
6584
|
});
|
|
6585
|
+
HUB_PERSON_KINDS = ["hub_admin", "hub_team_member", "hub_user"];
|
|
6586
|
+
ACCESS_PERSON_KINDS = ["org_member", ...HUB_PERSON_KINDS, "public"];
|
|
6570
6587
|
setHubUserAccessValuesBody = external_exports.object({
|
|
6571
6588
|
values: accessAssignmentSchema.refine((assignment) => !assignmentHasUnrestricted(assignment), {
|
|
6572
6589
|
message: `A hub user's values never hold "${ACCESS_UNRESTRICTED}"`
|
|
@@ -6578,13 +6595,13 @@ var init_chunk_BCDGY3GH = __esm({
|
|
|
6578
6595
|
}
|
|
6579
6596
|
});
|
|
6580
6597
|
|
|
6581
|
-
// ../../packages/core/dist/chunk-
|
|
6598
|
+
// ../../packages/core/dist/chunk-7CDVZN6T.js
|
|
6582
6599
|
var TOOLSET_SLUG_PATTERN, REKOR_STRUCTURAL_ID_PATTERN, baseEnvironmentSchema, toolsetFileToolSchema, toolsetSurfaceSchema, toolsetConnectionBindingSchema, rekorToolsetToolsSchema, rekorBoundAttestation, rekorResolvedToolsetSchema, resolvedRecordTypeSchema, reviewWritersSchema, sharedScopeSchema, resolvedFileToolSchema, rekorToolsetFileSchema, rekorToolsetFileUrlAnswerSchema, rekorToolsetFileListSchema, rekorToolsetFileGetSchema, rekorToolsetFilePutSchema, TOOLSET_CUSTOMER_FACING_REFUSAL_MARK, TOOLSET_CUSTOMER_FACING_REFUSAL;
|
|
6583
|
-
var
|
|
6584
|
-
"../../packages/core/dist/chunk-
|
|
6600
|
+
var init_chunk_7CDVZN6T = __esm({
|
|
6601
|
+
"../../packages/core/dist/chunk-7CDVZN6T.js"() {
|
|
6585
6602
|
"use strict";
|
|
6586
|
-
|
|
6587
|
-
|
|
6603
|
+
init_chunk_ZLGONLDP();
|
|
6604
|
+
init_chunk_TANTZFI3();
|
|
6588
6605
|
init_chunk_WNLWNFHH();
|
|
6589
6606
|
init_zod();
|
|
6590
6607
|
TOOLSET_SLUG_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
@@ -6707,7 +6724,16 @@ var init_chunk_QZTGWNFB = __esm({
|
|
|
6707
6724
|
*/
|
|
6708
6725
|
[REKOR_BOUND_ACCESS_HEADER]: external_exports.string().max(REKOR_MAX_ACCESS_HEADER_LENGTH).refine(isEncodedAccessSet, {
|
|
6709
6726
|
message: "Not an access set"
|
|
6710
|
-
}).optional()
|
|
6727
|
+
}).optional(),
|
|
6728
|
+
/**
|
|
6729
|
+
* Where the access set applies (#5358), when only on the call's customer's own records: its one value.
|
|
6730
|
+
* Sent only beside the set, which the far side holds it to (the refinement below).
|
|
6731
|
+
*/
|
|
6732
|
+
[REKOR_BOUND_ACCESS_SCOPE_HEADER]: external_exports.literal(REKOR_ACCESS_SCOPE_CUSTOMER).optional()
|
|
6733
|
+
}).superRefine((bag, ctx) => {
|
|
6734
|
+
if (bag[REKOR_BOUND_ACCESS_SCOPE_HEADER] !== void 0 && bag[REKOR_BOUND_ACCESS_HEADER] === void 0) {
|
|
6735
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: [REKOR_BOUND_ACCESS_SCOPE_HEADER], message: "Accepted only beside an access set" });
|
|
6736
|
+
}
|
|
6711
6737
|
});
|
|
6712
6738
|
rekorResolvedToolsetSchema = external_exports.object({
|
|
6713
6739
|
data: external_exports.object({
|
|
@@ -10884,9 +10910,9 @@ function validateSchema(schema, path42, errors, opts = {}) {
|
|
|
10884
10910
|
}
|
|
10885
10911
|
}
|
|
10886
10912
|
for (const key of SUBSCHEMA_LIST_KEYWORDS) {
|
|
10887
|
-
const
|
|
10888
|
-
if (Array.isArray(
|
|
10889
|
-
|
|
10913
|
+
const list2 = schema[key];
|
|
10914
|
+
if (Array.isArray(list2)) {
|
|
10915
|
+
list2.forEach((sub, i) => validateSchema(sub, `${path42}.${key}[${i}]`, errors, { depth: depth + 1 }));
|
|
10890
10916
|
}
|
|
10891
10917
|
}
|
|
10892
10918
|
for (const key of SUBSCHEMA_MAP_KEYWORDS) {
|
|
@@ -11652,56 +11678,6 @@ var init_chunk_LBDH7LCG = __esm({
|
|
|
11652
11678
|
}
|
|
11653
11679
|
});
|
|
11654
11680
|
|
|
11655
|
-
// ../../packages/core/dist/chunk-3VHMUK4W.js
|
|
11656
|
-
var primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody;
|
|
11657
|
-
var init_chunk_3VHMUK4W = __esm({
|
|
11658
|
-
"../../packages/core/dist/chunk-3VHMUK4W.js"() {
|
|
11659
|
-
"use strict";
|
|
11660
|
-
init_chunk_HZ6CADSY();
|
|
11661
|
-
init_zod();
|
|
11662
|
-
primaryRegionSchema = external_exports.enum([
|
|
11663
|
-
"wnam",
|
|
11664
|
-
"enam",
|
|
11665
|
-
"sam",
|
|
11666
|
-
"weur",
|
|
11667
|
-
"eeur",
|
|
11668
|
-
"apac",
|
|
11669
|
-
"oc",
|
|
11670
|
-
"afr",
|
|
11671
|
-
"me"
|
|
11672
|
-
]);
|
|
11673
|
-
placementSourceSchema = external_exports.enum([
|
|
11674
|
-
"hub_config",
|
|
11675
|
-
"org_config",
|
|
11676
|
-
"parent_cascade",
|
|
11677
|
-
"cf_colo",
|
|
11678
|
-
"country",
|
|
11679
|
-
"fallback"
|
|
11680
|
-
]);
|
|
11681
|
-
orgIdParam = external_exports.object({
|
|
11682
|
-
id: uuidSchema
|
|
11683
|
-
});
|
|
11684
|
-
orgAdminIdParam = external_exports.object({
|
|
11685
|
-
id: uuidSchema,
|
|
11686
|
-
adminId: external_exports.string().min(1)
|
|
11687
|
-
});
|
|
11688
|
-
createOrganizationBody = external_exports.object({
|
|
11689
|
-
organization_name: external_exports.string().min(1, "organization_name is required"),
|
|
11690
|
-
// Write-once at creation; updateOrganizationBody does not accept this.
|
|
11691
|
-
primary_region: primaryRegionSchema.optional()
|
|
11692
|
-
});
|
|
11693
|
-
updateOrganizationBody = external_exports.object({
|
|
11694
|
-
organization_name: external_exports.string().min(1).optional(),
|
|
11695
|
-
organization_avatar_url: external_exports.string().url().nullable().optional(),
|
|
11696
|
-
timezone: external_exports.string().optional(),
|
|
11697
|
-
business_hours: external_exports.unknown().optional()
|
|
11698
|
-
}).passthrough();
|
|
11699
|
-
addOrgAdminBody = external_exports.object({
|
|
11700
|
-
user_email: external_exports.string().email("valid email is required")
|
|
11701
|
-
});
|
|
11702
|
-
}
|
|
11703
|
-
});
|
|
11704
|
-
|
|
11705
11681
|
// ../../packages/core/dist/chunk-AMG6HKUQ.js
|
|
11706
11682
|
function isEventRelativeFollowupType(type) {
|
|
11707
11683
|
return typeof type === "string" && EVENT_RELATIVE_FOLLOWUP_TYPES.includes(type);
|
|
@@ -12096,6 +12072,56 @@ var init_chunk_AMG6HKUQ = __esm({
|
|
|
12096
12072
|
}
|
|
12097
12073
|
});
|
|
12098
12074
|
|
|
12075
|
+
// ../../packages/core/dist/chunk-3VHMUK4W.js
|
|
12076
|
+
var primaryRegionSchema, placementSourceSchema, orgIdParam, orgAdminIdParam, createOrganizationBody, updateOrganizationBody, addOrgAdminBody;
|
|
12077
|
+
var init_chunk_3VHMUK4W = __esm({
|
|
12078
|
+
"../../packages/core/dist/chunk-3VHMUK4W.js"() {
|
|
12079
|
+
"use strict";
|
|
12080
|
+
init_chunk_HZ6CADSY();
|
|
12081
|
+
init_zod();
|
|
12082
|
+
primaryRegionSchema = external_exports.enum([
|
|
12083
|
+
"wnam",
|
|
12084
|
+
"enam",
|
|
12085
|
+
"sam",
|
|
12086
|
+
"weur",
|
|
12087
|
+
"eeur",
|
|
12088
|
+
"apac",
|
|
12089
|
+
"oc",
|
|
12090
|
+
"afr",
|
|
12091
|
+
"me"
|
|
12092
|
+
]);
|
|
12093
|
+
placementSourceSchema = external_exports.enum([
|
|
12094
|
+
"hub_config",
|
|
12095
|
+
"org_config",
|
|
12096
|
+
"parent_cascade",
|
|
12097
|
+
"cf_colo",
|
|
12098
|
+
"country",
|
|
12099
|
+
"fallback"
|
|
12100
|
+
]);
|
|
12101
|
+
orgIdParam = external_exports.object({
|
|
12102
|
+
id: uuidSchema
|
|
12103
|
+
});
|
|
12104
|
+
orgAdminIdParam = external_exports.object({
|
|
12105
|
+
id: uuidSchema,
|
|
12106
|
+
adminId: external_exports.string().min(1)
|
|
12107
|
+
});
|
|
12108
|
+
createOrganizationBody = external_exports.object({
|
|
12109
|
+
organization_name: external_exports.string().min(1, "organization_name is required"),
|
|
12110
|
+
// Write-once at creation; updateOrganizationBody does not accept this.
|
|
12111
|
+
primary_region: primaryRegionSchema.optional()
|
|
12112
|
+
});
|
|
12113
|
+
updateOrganizationBody = external_exports.object({
|
|
12114
|
+
organization_name: external_exports.string().min(1).optional(),
|
|
12115
|
+
organization_avatar_url: external_exports.string().url().nullable().optional(),
|
|
12116
|
+
timezone: external_exports.string().optional(),
|
|
12117
|
+
business_hours: external_exports.unknown().optional()
|
|
12118
|
+
}).passthrough();
|
|
12119
|
+
addOrgAdminBody = external_exports.object({
|
|
12120
|
+
user_email: external_exports.string().email("valid email is required")
|
|
12121
|
+
});
|
|
12122
|
+
}
|
|
12123
|
+
});
|
|
12124
|
+
|
|
12099
12125
|
// ../../packages/core/dist/chunk-XQBFXSYS.js
|
|
12100
12126
|
function byLocale(entry) {
|
|
12101
12127
|
const shape = Object.fromEntries(SUPPORTED_LOCALES.map((locale) => [locale, entry.optional()]));
|
|
@@ -12134,7 +12160,7 @@ var init_chunk_XQBFXSYS = __esm({
|
|
|
12134
12160
|
}
|
|
12135
12161
|
});
|
|
12136
12162
|
|
|
12137
|
-
// ../../packages/core/dist/chunk-
|
|
12163
|
+
// ../../packages/core/dist/chunk-C4EMATJL.js
|
|
12138
12164
|
function refineLaneReferences(val, ctx) {
|
|
12139
12165
|
const lanes = val.lanes;
|
|
12140
12166
|
const statuses = val.kanban_statuses;
|
|
@@ -12158,11 +12184,11 @@ function describeSyncWarning(warning) {
|
|
|
12158
12184
|
return `${label}: ${parts.join("; ")}. Promote the base so production's tools match the preview's.`;
|
|
12159
12185
|
}
|
|
12160
12186
|
var hubIdParam, hubAdminIdParam, hubUserIdParam, hubAgentIdParam, hubIdentityIdParam, hubTeamIdParam, hubTeamUserDeleteParam, hubSchemaQuery, HUB_USERS_PAGE_SIZE_MAX, HUB_USERS_SEARCH_MAX, HUB_USERS_CHANNEL_TYPES, getHubUsersQuery, PREVIEW_LABEL_MAX_LENGTH, MAX_ENDED_INDEX_RETENTION_DAYS, MAX_EVAL_RETENTION_DAYS, MAX_END_USER_DAILY_MESSAGE_LIMIT, endUserDailyMessageLimitField, previewLabelField, hubTagsField, createHubBody, updateHubBody, HUB_TAG_CHANGE_REFUSED, hubTagChangeRefusalSchema, addHubAdminBody, addHubIdentityAuthorizationBody, contactDecisionBody, approveContactBody, CONTACT_ACCESS_PAGE_SIZE_MAX, listContactAccessQuery, createHubTeamBody, updateHubTeamBody, addHubTeamUserBody, reassignHubUserBody, replicatePreviewBody, HUB_DIFF_SECTION_SET, HUB_DIFF_SECTIONS, updateChannelTestIdentitiesBody, claimCodeChannelParam, claimCodeDeleteParam;
|
|
12161
|
-
var
|
|
12162
|
-
"../../packages/core/dist/chunk-
|
|
12187
|
+
var init_chunk_C4EMATJL = __esm({
|
|
12188
|
+
"../../packages/core/dist/chunk-C4EMATJL.js"() {
|
|
12163
12189
|
"use strict";
|
|
12164
|
-
init_chunk_3VHMUK4W();
|
|
12165
12190
|
init_chunk_AMG6HKUQ();
|
|
12191
|
+
init_chunk_3VHMUK4W();
|
|
12166
12192
|
init_chunk_XQBFXSYS();
|
|
12167
12193
|
init_chunk_HZ6CADSY();
|
|
12168
12194
|
init_zod();
|
|
@@ -12357,7 +12383,7 @@ var init_chunk_USFRRP7E = __esm({
|
|
|
12357
12383
|
}
|
|
12358
12384
|
});
|
|
12359
12385
|
|
|
12360
|
-
// ../../packages/core/dist/chunk-
|
|
12386
|
+
// ../../packages/core/dist/chunk-NDCGHRCD.js
|
|
12361
12387
|
function refineHubAsCodeCustomTools(config, ctx) {
|
|
12362
12388
|
const agents = config.agents;
|
|
12363
12389
|
if (!Array.isArray(agents)) return;
|
|
@@ -12775,9 +12801,9 @@ function refineHubAsCodeDelegation(config, ctx) {
|
|
|
12775
12801
|
function refineHubAsCodeFlagConditions(config, ctx) {
|
|
12776
12802
|
const agents = config?.agents;
|
|
12777
12803
|
if (!Array.isArray(agents)) return;
|
|
12778
|
-
const checkList = (
|
|
12779
|
-
if (!Array.isArray(
|
|
12780
|
-
|
|
12804
|
+
const checkList = (list2, basePath) => {
|
|
12805
|
+
if (!Array.isArray(list2)) return;
|
|
12806
|
+
list2.forEach((row, rowIndex) => {
|
|
12781
12807
|
const operator = row?.operator;
|
|
12782
12808
|
if (!FLAG_CONDITION_OPERATORS.includes(operator)) {
|
|
12783
12809
|
ctx.addIssue({
|
|
@@ -12957,16 +12983,16 @@ function skillSectionsAsResources(scope) {
|
|
|
12957
12983
|
};
|
|
12958
12984
|
}
|
|
12959
12985
|
var MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema;
|
|
12960
|
-
var
|
|
12961
|
-
"../../packages/core/dist/chunk-
|
|
12986
|
+
var init_chunk_NDCGHRCD = __esm({
|
|
12987
|
+
"../../packages/core/dist/chunk-NDCGHRCD.js"() {
|
|
12962
12988
|
"use strict";
|
|
12963
12989
|
init_chunk_HCE5YOBD();
|
|
12964
|
-
|
|
12990
|
+
init_chunk_ZLGONLDP();
|
|
12965
12991
|
init_chunk_VQIITUAJ();
|
|
12966
12992
|
init_chunk_VU7E2RFY();
|
|
12967
12993
|
init_chunk_LBDH7LCG();
|
|
12968
12994
|
init_chunk_4LXDRTO4();
|
|
12969
|
-
|
|
12995
|
+
init_chunk_C4EMATJL();
|
|
12970
12996
|
init_chunk_AMG6HKUQ();
|
|
12971
12997
|
init_chunk_XQBFXSYS();
|
|
12972
12998
|
init_chunk_WEXVYJ5H();
|
|
@@ -14505,7 +14531,7 @@ var init_chunk_OMPT4ZHR = __esm({
|
|
|
14505
14531
|
}
|
|
14506
14532
|
});
|
|
14507
14533
|
|
|
14508
|
-
// ../../packages/core/dist/chunk-
|
|
14534
|
+
// ../../packages/core/dist/chunk-AIHVFCWQ.js
|
|
14509
14535
|
function refineScopedTarget(data, ctx) {
|
|
14510
14536
|
if (data.scope === "org") {
|
|
14511
14537
|
if (!data.org_id) {
|
|
@@ -14531,13 +14557,13 @@ function refineScopedTarget(data, ctx) {
|
|
|
14531
14557
|
}
|
|
14532
14558
|
}
|
|
14533
14559
|
var adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND, automationGateEvaluationsPerOperation, AUTOMATION_RUN_RETENTION_DAYS_MAX, automationRunRetentionDays, turnDeadlineSeconds, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetShape, adminScopedTargetBody, adminRepairKnowledgeBlobsBody, BRANCHING_ORPHAN_ENTITY_TYPES, BRANCHING_ORPHAN_MAX_TARGETS, adminRepairBranchingOrphansBody, adminRepairLegacyOrgGrantsBody, adminRepairCompedPlansBody, updatePricingPlanBody, dataExplorerSearchQuery, dataExplorerOrgIdParam, dataExplorerHubIdParam, dataExplorerConvIdParam, dataExplorerDoInstancesQuery, dataExplorerNsIdParam, dataExplorerKvKeysBody, dataExplorerKvKeyBody, uuidOrHexId, dataExplorerDeleteOrgParam, dataExplorerDeleteHubParam, dataExplorerDeleteConvParam, dataExplorerDeleteUserParam, dataExplorerDeleteQuery, dataExplorerKvDeleteBody, pitrDoNamespace, pitrBookmarkParam, pitrRestoreBody, healthSamplingTriggerBody, DEBUG_DO_HEX_PREFIX, debugDoEntityId, debugTableName, dataExplorerDebugTablesParam, dataExplorerDebugRowsParam, dataExplorerDebugRowsQuery, dataExplorerDebugAnalyticsTable, debugUuid, dataExplorerDebugAnalyticsRowsParam, dataExplorerDebugAnalyticsRowsQuery, dataExplorerDebugCountsDoType, dataExplorerDebugCountsParam, debugHubConvParam, debugMessageIdQuery;
|
|
14534
|
-
var
|
|
14535
|
-
"../../packages/core/dist/chunk-
|
|
14560
|
+
var init_chunk_AIHVFCWQ = __esm({
|
|
14561
|
+
"../../packages/core/dist/chunk-AIHVFCWQ.js"() {
|
|
14536
14562
|
"use strict";
|
|
14537
14563
|
init_chunk_FECLIZTY();
|
|
14538
14564
|
init_chunk_BFG4ZWR4();
|
|
14539
14565
|
init_chunk_YZAIZJTO();
|
|
14540
|
-
|
|
14566
|
+
init_chunk_C4EMATJL();
|
|
14541
14567
|
init_chunk_OMPT4ZHR();
|
|
14542
14568
|
init_chunk_HZ6CADSY();
|
|
14543
14569
|
init_chunk_MIWZOSPI();
|
|
@@ -15237,6 +15263,7 @@ var init_contracts = __esm({
|
|
|
15237
15263
|
init_chunk_YVY2TZK2();
|
|
15238
15264
|
init_chunk_VXEAR36B();
|
|
15239
15265
|
init_chunk_RACEDHG6();
|
|
15266
|
+
init_chunk_GXY7XACJ();
|
|
15240
15267
|
init_chunk_WBFLPPDI();
|
|
15241
15268
|
init_chunk_IPXBFWUU();
|
|
15242
15269
|
init_chunk_GPM7PE44();
|
|
@@ -15247,7 +15274,7 @@ var init_contracts = __esm({
|
|
|
15247
15274
|
init_chunk_Y7CFCYX4();
|
|
15248
15275
|
init_chunk_5DGHIY7L();
|
|
15249
15276
|
init_chunk_TUHJ5PQH();
|
|
15250
|
-
|
|
15277
|
+
init_chunk_7CDVZN6T();
|
|
15251
15278
|
init_chunk_IPDOHAZ5();
|
|
15252
15279
|
init_chunk_YUZFHVB2();
|
|
15253
15280
|
init_chunk_I3O2RACG();
|
|
@@ -15265,10 +15292,10 @@ var init_contracts = __esm({
|
|
|
15265
15292
|
init_chunk_KSTYTQ7I();
|
|
15266
15293
|
init_chunk_LKBSHANA();
|
|
15267
15294
|
init_chunk_BPCNB5RT();
|
|
15268
|
-
|
|
15295
|
+
init_chunk_NDCGHRCD();
|
|
15269
15296
|
init_chunk_HCE5YOBD();
|
|
15270
|
-
|
|
15271
|
-
|
|
15297
|
+
init_chunk_ZLGONLDP();
|
|
15298
|
+
init_chunk_TANTZFI3();
|
|
15272
15299
|
init_chunk_VQIITUAJ();
|
|
15273
15300
|
init_chunk_JDJ4EUOL();
|
|
15274
15301
|
init_chunk_ZLJP22IA();
|
|
@@ -15293,13 +15320,13 @@ var init_contracts = __esm({
|
|
|
15293
15320
|
init_chunk_5HA6FIE7();
|
|
15294
15321
|
init_chunk_SAQNCSQ6();
|
|
15295
15322
|
init_chunk_NVKU5PPQ();
|
|
15296
|
-
|
|
15323
|
+
init_chunk_AIHVFCWQ();
|
|
15297
15324
|
init_chunk_FECLIZTY();
|
|
15298
15325
|
init_chunk_BFG4ZWR4();
|
|
15299
15326
|
init_chunk_YZAIZJTO();
|
|
15300
|
-
|
|
15301
|
-
init_chunk_3VHMUK4W();
|
|
15327
|
+
init_chunk_C4EMATJL();
|
|
15302
15328
|
init_chunk_AMG6HKUQ();
|
|
15329
|
+
init_chunk_3VHMUK4W();
|
|
15303
15330
|
init_chunk_XQBFXSYS();
|
|
15304
15331
|
init_chunk_OMPT4ZHR();
|
|
15305
15332
|
init_chunk_2PZIF56U();
|
|
@@ -15437,8 +15464,8 @@ async function uuidV5(namespace, name) {
|
|
|
15437
15464
|
const out = digest.slice(0, 16);
|
|
15438
15465
|
return bytesToUuid(setUuidVersion(out, 5));
|
|
15439
15466
|
}
|
|
15440
|
-
function markdownToPlainText(
|
|
15441
|
-
let result =
|
|
15467
|
+
function markdownToPlainText(text2) {
|
|
15468
|
+
let result = text2;
|
|
15442
15469
|
result = result.replace(/```[\w]*\n?([\s\S]*?)```/g, "$1");
|
|
15443
15470
|
result = result.replace(/`([^`]+)`/g, "$1");
|
|
15444
15471
|
result = result.replace(/\*\*\*(.+?)\*\*\*/g, "$1");
|
|
@@ -16548,6 +16575,7 @@ var init_utils = __esm({
|
|
|
16548
16575
|
"communities",
|
|
16549
16576
|
"contacts",
|
|
16550
16577
|
"dimensions",
|
|
16578
|
+
"access",
|
|
16551
16579
|
"knowledge"
|
|
16552
16580
|
]);
|
|
16553
16581
|
HELP_AND_VERSION = ["help", "--help", "-h", "--version", "-v"];
|
|
@@ -16557,6 +16585,7 @@ var init_utils = __esm({
|
|
|
16557
16585
|
["communities", "all"],
|
|
16558
16586
|
["contacts", "all"],
|
|
16559
16587
|
["dimensions", "all"],
|
|
16588
|
+
["access", "all"],
|
|
16560
16589
|
["knowledge", "all"],
|
|
16561
16590
|
["use", "selectors"],
|
|
16562
16591
|
["unbind", "selectors"],
|
|
@@ -17250,6 +17279,18 @@ var init_api_client = __esm({
|
|
|
17250
17279
|
const qs = new URLSearchParams({ organization_id: orgId, base_id: baseId2 });
|
|
17251
17280
|
return this.request("DELETE", `/api/contact-book/contacts/${encodeURIComponent(contactId)}/customer?${qs}`);
|
|
17252
17281
|
}
|
|
17282
|
+
/**
|
|
17283
|
+
* The access set every hub toolset call of an agent sends for a person, or for none (the hub's ∩ the
|
|
17284
|
+
* agent's), and the layer that removed each value (#5358 PR 15). Another person's takes an org-admin
|
|
17285
|
+
* grant on the hub's org.
|
|
17286
|
+
*/
|
|
17287
|
+
async explainAccess(hubId, agentId, userId) {
|
|
17288
|
+
const qs = userId === void 0 ? "" : `?${new URLSearchParams({ user_id: userId })}`;
|
|
17289
|
+
return this.request(
|
|
17290
|
+
"GET",
|
|
17291
|
+
`/api/setup/hubs/${encodeURIComponent(hubId)}/agents/${encodeURIComponent(agentId)}/access-explain${qs}`
|
|
17292
|
+
);
|
|
17293
|
+
}
|
|
17253
17294
|
/** An organization's access dimensions, each with every value, retired ones included (#5358). */
|
|
17254
17295
|
async listAccessDimensions(orgId) {
|
|
17255
17296
|
return this.request("GET", accessDimensions(orgId));
|
|
@@ -21957,16 +21998,16 @@ function pathSegments(value, label = "path") {
|
|
|
21957
21998
|
function parseData(data, flag) {
|
|
21958
21999
|
const prefix = flag ? `${flag}: ` : "";
|
|
21959
22000
|
const source = data.startsWith("@") ? data.slice(1) : void 0;
|
|
21960
|
-
let
|
|
22001
|
+
let text2 = data;
|
|
21961
22002
|
if (source !== void 0) {
|
|
21962
22003
|
try {
|
|
21963
|
-
|
|
22004
|
+
text2 = readFileSync14(source, "utf-8");
|
|
21964
22005
|
} catch (e) {
|
|
21965
22006
|
throw expected(`${prefix}${source}: ${e instanceof Error ? e.message : "could not be read"}`);
|
|
21966
22007
|
}
|
|
21967
22008
|
}
|
|
21968
22009
|
try {
|
|
21969
|
-
return JSON.parse(
|
|
22010
|
+
return JSON.parse(text2);
|
|
21970
22011
|
} catch (e) {
|
|
21971
22012
|
const where = source !== void 0 ? ` in ${source}` : "";
|
|
21972
22013
|
throw expected(`${prefix}invalid JSON${where}: ${e instanceof Error ? e.message : String(e)}`);
|
|
@@ -22964,8 +23005,8 @@ var init_pacer = __esm({
|
|
|
22964
23005
|
|
|
22965
23006
|
// src/communities/model.ts
|
|
22966
23007
|
import { createHash as createHash3 } from "crypto";
|
|
22967
|
-
function toLf(
|
|
22968
|
-
return
|
|
23008
|
+
function toLf(text2) {
|
|
23009
|
+
return text2.replace(/\r\n?/g, "\n");
|
|
22969
23010
|
}
|
|
22970
23011
|
function normalizeRules(rules) {
|
|
22971
23012
|
if (rules === null || rules === void 0) return null;
|
|
@@ -23140,8 +23181,8 @@ function readCourseSynced(raw, where, problems2) {
|
|
|
23140
23181
|
else {
|
|
23141
23182
|
for (const [moduleId, ids] of Object.entries(raw.lessons)) {
|
|
23142
23183
|
if (!UUID_RE3.test(moduleId)) problems2.push(`${where}: synced.lessons: ${JSON.stringify(moduleId)} is not a module id`);
|
|
23143
|
-
const
|
|
23144
|
-
if (
|
|
23184
|
+
const list2 = readIdList(ids, `${where} synced.lessons.${moduleId}`, problems2);
|
|
23185
|
+
if (list2) lessons[moduleId] = list2;
|
|
23145
23186
|
}
|
|
23146
23187
|
}
|
|
23147
23188
|
}
|
|
@@ -23185,14 +23226,14 @@ function readCourseFolders(communityFolder, slugs, problems2) {
|
|
|
23185
23226
|
}
|
|
23186
23227
|
function readCourseFolder(communityFolder, folder, slug, problems2) {
|
|
23187
23228
|
const where = `${COURSES_DIR}/${slug}/${COURSE_FILE}`;
|
|
23188
|
-
const
|
|
23189
|
-
if (
|
|
23229
|
+
const text2 = readRealFileOrThrow(communityFolder, path24.join(folder, COURSE_FILE));
|
|
23230
|
+
if (text2 === null) {
|
|
23190
23231
|
problems2.push(`${COURSES_DIR}/${slug}/: no ${COURSE_FILE}`);
|
|
23191
23232
|
return null;
|
|
23192
23233
|
}
|
|
23193
23234
|
let doc;
|
|
23194
23235
|
try {
|
|
23195
|
-
doc = yaml12.load(
|
|
23236
|
+
doc = yaml12.load(text2);
|
|
23196
23237
|
} catch (err) {
|
|
23197
23238
|
problems2.push(`${where} is not valid YAML: ${err instanceof Error ? err.message : String(err)}`);
|
|
23198
23239
|
return null;
|
|
@@ -23275,12 +23316,12 @@ function readModules(communityFolder, lessonsDir, raw, courseSlug, courseWhere,
|
|
|
23275
23316
|
});
|
|
23276
23317
|
return modules;
|
|
23277
23318
|
}
|
|
23278
|
-
function splitFrontmatter(
|
|
23279
|
-
if (!
|
|
23280
|
-
const close2 =
|
|
23281
|
-
if (close2 === -1) return
|
|
23282
|
-
const rest =
|
|
23283
|
-
return { front:
|
|
23319
|
+
function splitFrontmatter(text2) {
|
|
23320
|
+
if (!text2.startsWith("---\n")) return null;
|
|
23321
|
+
const close2 = text2.indexOf("\n---\n", 3);
|
|
23322
|
+
if (close2 === -1) return text2.endsWith("\n---") ? { front: text2.slice(4, -3), body: "" } : null;
|
|
23323
|
+
const rest = text2.slice(close2 + 5);
|
|
23324
|
+
return { front: text2.slice(4, close2 + 1), body: rest.endsWith("\n") ? rest.slice(0, -1) : rest };
|
|
23284
23325
|
}
|
|
23285
23326
|
function readLessonFile(communityFolder, lessonsDir, courseSlug, slug, problems2) {
|
|
23286
23327
|
const name = `${slug}${LESSON_FILE_EXT}`;
|
|
@@ -23447,14 +23488,14 @@ import * as yaml13 from "js-yaml";
|
|
|
23447
23488
|
function readCommunityFolder(folder) {
|
|
23448
23489
|
const where = path25.basename(folder);
|
|
23449
23490
|
const yamlPath = path25.join(folder, COMMUNITY_FILE);
|
|
23450
|
-
const
|
|
23451
|
-
if (
|
|
23491
|
+
const text2 = readRealFileOrThrow(folder, yamlPath);
|
|
23492
|
+
if (text2 === null) {
|
|
23452
23493
|
throw expected(`No ${COMMUNITY_FILE} in ${where}/: pull the community first (wayai pull communities/<community_id>).`);
|
|
23453
23494
|
}
|
|
23454
23495
|
const rules = toLf(readRealFileOrThrow(folder, path25.join(folder, RULES_FILE)) ?? "");
|
|
23455
23496
|
let doc;
|
|
23456
23497
|
try {
|
|
23457
|
-
doc = yaml13.load(
|
|
23498
|
+
doc = yaml13.load(text2);
|
|
23458
23499
|
} catch (err) {
|
|
23459
23500
|
throw expected(`${where}/${COMMUNITY_FILE} is not valid YAML: ${err instanceof Error ? err.message : String(err)}`);
|
|
23460
23501
|
}
|
|
@@ -23625,8 +23666,8 @@ function renderCommunityYaml(files) {
|
|
|
23625
23666
|
return yaml13.dump(doc, YAML_DUMP_OPTIONS);
|
|
23626
23667
|
}
|
|
23627
23668
|
function renderRules(rules) {
|
|
23628
|
-
const
|
|
23629
|
-
return
|
|
23669
|
+
const text2 = toLf(rules).replace(/\n+$/, "");
|
|
23670
|
+
return text2 === "" ? "" : `${text2}
|
|
23630
23671
|
`;
|
|
23631
23672
|
}
|
|
23632
23673
|
function renderCommunityFiles(files) {
|
|
@@ -23718,7 +23759,7 @@ var init_listing = __esm({
|
|
|
23718
23759
|
"src/communities/listing.ts"() {
|
|
23719
23760
|
"use strict";
|
|
23720
23761
|
init_terminal_output();
|
|
23721
|
-
show = (
|
|
23762
|
+
show = (text2) => JSON.stringify(sanitizeTerminalText(text2));
|
|
23722
23763
|
emptyListing = () => ({ changes: [], serverChanged: [], conflicts: [], leftAsIs: [], kept: [] });
|
|
23723
23764
|
}
|
|
23724
23765
|
});
|
|
@@ -23758,27 +23799,27 @@ function filesOrder(listed2, server, named) {
|
|
|
23758
23799
|
return id === void 0 ? [] : [id];
|
|
23759
23800
|
});
|
|
23760
23801
|
}
|
|
23761
|
-
function placeAt(
|
|
23762
|
-
const at =
|
|
23763
|
-
if (at >= 0)
|
|
23764
|
-
|
|
23802
|
+
function placeAt(list2, id, position) {
|
|
23803
|
+
const at = list2.indexOf(id);
|
|
23804
|
+
if (at >= 0) list2.splice(at, 1);
|
|
23805
|
+
list2.splice(Math.min(position, list2.length), 0, id);
|
|
23765
23806
|
}
|
|
23766
23807
|
function sameOrder(a, b) {
|
|
23767
23808
|
return a.length === b.length && a.every((id, i) => id === b[i]);
|
|
23768
23809
|
}
|
|
23769
23810
|
function reorderMoves(current, target) {
|
|
23770
|
-
const
|
|
23771
|
-
const present = target.filter((id) =>
|
|
23772
|
-
const stay = longestRising(present, present.map((id) =>
|
|
23811
|
+
const list2 = [...current];
|
|
23812
|
+
const present = target.filter((id) => list2.includes(id));
|
|
23813
|
+
const stay = longestRising(present, present.map((id) => list2.indexOf(id)));
|
|
23773
23814
|
const moves = [];
|
|
23774
23815
|
target.forEach((id, i) => {
|
|
23775
23816
|
if (stay.has(id)) return;
|
|
23776
|
-
const others =
|
|
23817
|
+
const others = list2.filter((other) => other !== id);
|
|
23777
23818
|
const position = i === 0 ? 0 : others.indexOf(target[i - 1]) + 1;
|
|
23778
23819
|
moves.push({ id, position });
|
|
23779
|
-
placeAt(
|
|
23820
|
+
placeAt(list2, id, position);
|
|
23780
23821
|
});
|
|
23781
|
-
const placed =
|
|
23822
|
+
const placed = list2.filter((id) => target.includes(id));
|
|
23782
23823
|
if (!sameOrder(placed, target)) {
|
|
23783
23824
|
throw new Error(`reorderMoves: ${JSON.stringify(current)} \u2192 ${JSON.stringify(target)} left ${JSON.stringify(placed)}`);
|
|
23784
23825
|
}
|
|
@@ -23857,16 +23898,16 @@ function takeCourse(folder, server, fields) {
|
|
|
23857
23898
|
if (take("description", file.description !== side.description)) folder.description = server.description;
|
|
23858
23899
|
if (take("published", file.published !== side.published)) folder.published = side.published;
|
|
23859
23900
|
}
|
|
23860
|
-
function orderVerdict(
|
|
23901
|
+
function orderVerdict(list2, base, server) {
|
|
23861
23902
|
const onServer = new Set(server);
|
|
23862
23903
|
if (base === void 0) {
|
|
23863
|
-
const shared2 =
|
|
23904
|
+
const shared2 = list2.filter((id) => onServer.has(id));
|
|
23864
23905
|
return sameOrder(shared2, restrict(server, shared2)) ? "converged" : "conflict";
|
|
23865
23906
|
}
|
|
23866
23907
|
const inBase = new Set(base);
|
|
23867
|
-
const shared =
|
|
23868
|
-
const added =
|
|
23869
|
-
if (added.length > 0 && !sameGaps(added, shared,
|
|
23908
|
+
const shared = list2.filter((id) => inBase.has(id) && onServer.has(id));
|
|
23909
|
+
const added = list2.filter((id) => !inBase.has(id) && onServer.has(id));
|
|
23910
|
+
if (added.length > 0 && !sameGaps(added, shared, list2, server)) return "conflict";
|
|
23870
23911
|
const was = restrict(base, shared);
|
|
23871
23912
|
const now = restrict(server, shared);
|
|
23872
23913
|
return threeWay(!sameOrder(shared, was), !sameOrder(now, was), sameOrder(shared, now));
|
|
@@ -24000,25 +24041,25 @@ function append(order, id) {
|
|
|
24000
24041
|
order.pinned?.push(id);
|
|
24001
24042
|
order.touched = true;
|
|
24002
24043
|
}
|
|
24003
|
-
function insertAfter(
|
|
24044
|
+
function insertAfter(list2, item, order) {
|
|
24004
24045
|
let at = 0;
|
|
24005
24046
|
for (let i = order.indexOf(item) - 1; i >= 0; i--) {
|
|
24006
|
-
const k =
|
|
24047
|
+
const k = list2.indexOf(order[i]);
|
|
24007
24048
|
if (k >= 0) {
|
|
24008
24049
|
at = k + 1;
|
|
24009
24050
|
break;
|
|
24010
24051
|
}
|
|
24011
24052
|
}
|
|
24012
|
-
|
|
24053
|
+
list2.splice(at, 0, item);
|
|
24013
24054
|
}
|
|
24014
24055
|
function shift(order, id, position) {
|
|
24015
24056
|
placeAt(order.server, id, position);
|
|
24016
24057
|
order.touched = true;
|
|
24017
24058
|
}
|
|
24018
24059
|
function leave(order, id) {
|
|
24019
|
-
for (const
|
|
24020
|
-
const at =
|
|
24021
|
-
if (at >= 0)
|
|
24060
|
+
for (const list2 of [order.server, order.pinned ?? []]) {
|
|
24061
|
+
const at = list2.indexOf(id);
|
|
24062
|
+
if (at >= 0) list2.splice(at, 1);
|
|
24022
24063
|
}
|
|
24023
24064
|
order.touched = true;
|
|
24024
24065
|
}
|
|
@@ -25681,7 +25722,7 @@ var init_sync2 = __esm({
|
|
|
25681
25722
|
this.send(() => this.api.listCommunityRooms(this.communityId)),
|
|
25682
25723
|
this.send(() => this.api.getCommunityJoinLink(this.communityId)),
|
|
25683
25724
|
// Each course whole, as soon as the list names it.
|
|
25684
|
-
this.listCourses().then((
|
|
25725
|
+
this.listCourses().then((list2) => Promise.all(list2.map((course) => this.exportCourse(course.course_id))))
|
|
25685
25726
|
]);
|
|
25686
25727
|
return { community, settings, rooms, joinLink, courses: new ServerCourses(courses) };
|
|
25687
25728
|
}
|
|
@@ -28162,9 +28203,9 @@ async function conversationsCommand(args2) {
|
|
|
28162
28203
|
if (result.partial || result.hubs_queried === 0) process.exit(1);
|
|
28163
28204
|
return;
|
|
28164
28205
|
}
|
|
28165
|
-
for (const
|
|
28166
|
-
const where =
|
|
28167
|
-
console.error(`Could not read ${where}: ${sanitizeTerminalText(
|
|
28206
|
+
for (const failure4 of result.errors) {
|
|
28207
|
+
const where = failure4.scope_kind === "hub" ? `hub ${sanitizeTerminalText(failure4.hub_name || failure4.hub_id || "")} (${failure4.hub_id})` : `organization ${failure4.organization_id}`;
|
|
28208
|
+
console.error(`Could not read ${where}: ${sanitizeTerminalText(failure4.error)}`);
|
|
28168
28209
|
}
|
|
28169
28210
|
if (result.hubs_queried === 0) {
|
|
28170
28211
|
console.error(
|
|
@@ -29554,10 +29595,10 @@ var init_caller_audio = __esm({
|
|
|
29554
29595
|
/** Syntheses in flight, by cache file: two lines with the same words pay for one. */
|
|
29555
29596
|
inFlight = /* @__PURE__ */ new Map();
|
|
29556
29597
|
/** The cache file for a text: one per model, voice and exact text. */
|
|
29557
|
-
cachePath(
|
|
29598
|
+
cachePath(text2) {
|
|
29558
29599
|
const key = createHash4("sha256").update(`${this.model}
|
|
29559
29600
|
${this.voice}
|
|
29560
|
-
${
|
|
29601
|
+
${text2}`).digest("hex");
|
|
29561
29602
|
return join31(this.cacheDir, `${key}.pcm`);
|
|
29562
29603
|
}
|
|
29563
29604
|
clipFor(line) {
|
|
@@ -29909,8 +29950,8 @@ function parseWrittenNumber(raw) {
|
|
|
29909
29950
|
if (m) return { ...base, int: Number(m[1]), frac: m[2] };
|
|
29910
29951
|
return { ...base, int: Number(base.digits || "0"), digitMode: true };
|
|
29911
29952
|
}
|
|
29912
|
-
function tokenize(
|
|
29913
|
-
const norm = normalizeText(
|
|
29953
|
+
function tokenize(text2) {
|
|
29954
|
+
const norm = normalizeText(text2);
|
|
29914
29955
|
const out = [];
|
|
29915
29956
|
const re = /r\$|\d[\d.,/:h-]*\d|\d|%|[a-z]+|[.\-/]/g;
|
|
29916
29957
|
for (const m of norm.matchAll(re)) {
|
|
@@ -30028,8 +30069,8 @@ function num(tk) {
|
|
|
30028
30069
|
function decimalString(n) {
|
|
30029
30070
|
return n.frac ? `${n.int}.${n.frac.padEnd(2, "0")}` : String(n.int);
|
|
30030
30071
|
}
|
|
30031
|
-
function extractFacts(
|
|
30032
|
-
const toks = tokenize(
|
|
30072
|
+
function extractFacts(text2) {
|
|
30073
|
+
const toks = tokenize(text2);
|
|
30033
30074
|
const facts = [];
|
|
30034
30075
|
const used = /* @__PURE__ */ new Set();
|
|
30035
30076
|
const push = (kind, key, from, to) => {
|
|
@@ -30157,10 +30198,10 @@ function extractFacts(text) {
|
|
|
30157
30198
|
}
|
|
30158
30199
|
return facts;
|
|
30159
30200
|
}
|
|
30160
|
-
function digitRuns(
|
|
30201
|
+
function digitRuns(text2) {
|
|
30161
30202
|
const runs = [];
|
|
30162
30203
|
let cur = "";
|
|
30163
|
-
for (const f of extractFacts(
|
|
30204
|
+
for (const f of extractFacts(text2)) {
|
|
30164
30205
|
if (f.kind === "digits" || f.kind === "cpf" || f.kind === "number" && /^\d+$/.test(f.key)) cur += f.key;
|
|
30165
30206
|
else {
|
|
30166
30207
|
if (cur) runs.push(cur);
|
|
@@ -30224,21 +30265,21 @@ function isVetted(fact, vetted) {
|
|
|
30224
30265
|
if (fact.kind === "number") return vetted.derivedNumbers.has(String(Number(fact.key)));
|
|
30225
30266
|
return false;
|
|
30226
30267
|
}
|
|
30227
|
-
function readbackCandidate(
|
|
30268
|
+
function readbackCandidate(text2, kind) {
|
|
30228
30269
|
if (kind === "cpf") {
|
|
30229
|
-
const cpf = extractFacts(
|
|
30270
|
+
const cpf = extractFacts(text2).find((f) => f.kind === "cpf");
|
|
30230
30271
|
if (cpf) return cpf.key;
|
|
30231
|
-
return digitRuns(
|
|
30272
|
+
return digitRuns(text2).find((r) => r.length >= 9 && r.length <= 13) ?? null;
|
|
30232
30273
|
}
|
|
30233
30274
|
if (kind === "digits") {
|
|
30234
|
-
const code = extractFacts(
|
|
30275
|
+
const code = extractFacts(text2).find((f) => (f.kind === "digits" || f.kind === "cpf") && f.key.length >= 5);
|
|
30235
30276
|
if (code) return code.key;
|
|
30236
|
-
return digitRuns(
|
|
30277
|
+
return digitRuns(text2).find((r) => r.length >= 5) ?? null;
|
|
30237
30278
|
}
|
|
30238
|
-
return extractFacts(
|
|
30279
|
+
return extractFacts(text2).find((f) => f.kind === kind)?.key ?? null;
|
|
30239
30280
|
}
|
|
30240
|
-
function claimMarkers(
|
|
30241
|
-
const n = normalizeText(
|
|
30281
|
+
function claimMarkers(text2) {
|
|
30282
|
+
const n = normalizeText(text2);
|
|
30242
30283
|
return {
|
|
30243
30284
|
policy: POLICY_MARKERS.filter((m) => n.includes(m)),
|
|
30244
30285
|
action: ACTION_MARKERS.filter((m) => n.includes(m))
|
|
@@ -30399,10 +30440,10 @@ function parseCallPlan(raw) {
|
|
|
30399
30440
|
}
|
|
30400
30441
|
return { lines: out };
|
|
30401
30442
|
}
|
|
30402
|
-
function dictatedIdentifier(
|
|
30403
|
-
const fact = extractFacts(
|
|
30443
|
+
function dictatedIdentifier(text2) {
|
|
30444
|
+
const fact = extractFacts(text2).find((f) => f.kind === "cpf" || f.kind === "digits" && f.key.length >= 5);
|
|
30404
30445
|
if (fact) return { kind: fact.kind, key: fact.key };
|
|
30405
|
-
const run = digitRuns(
|
|
30446
|
+
const run = digitRuns(text2).find((r) => r.length >= 5);
|
|
30406
30447
|
return run ? { kind: run.length === 11 ? "cpf" : "digits", key: run } : null;
|
|
30407
30448
|
}
|
|
30408
30449
|
function readbackOf(value) {
|
|
@@ -30525,9 +30566,9 @@ var init_cost_cap = __esm({
|
|
|
30525
30566
|
function factLabel(fact) {
|
|
30526
30567
|
return `${fact.kind}:${fact.raw}`;
|
|
30527
30568
|
}
|
|
30528
|
-
function tokens(
|
|
30529
|
-
const words = normalizeText(
|
|
30530
|
-
const facts = extractFacts(
|
|
30569
|
+
function tokens(text2) {
|
|
30570
|
+
const words = normalizeText(text2).split(/[^a-z0-9]+/).filter((w) => w.length > 1 && !/^\d+$/.test(w) && !isNumberWord(w));
|
|
30571
|
+
const facts = extractFacts(text2).map((f) => `#${f.kind}:${f.key}`);
|
|
30531
30572
|
return /* @__PURE__ */ new Set([...words, ...facts]);
|
|
30532
30573
|
}
|
|
30533
30574
|
function similarity(a, b) {
|
|
@@ -31062,7 +31103,7 @@ var init_report = __esm({
|
|
|
31062
31103
|
style: "style",
|
|
31063
31104
|
latency: "latency"
|
|
31064
31105
|
};
|
|
31065
|
-
shown = (
|
|
31106
|
+
shown = (text2) => text2 === null ? "nothing" : sanitizeTerminalText(text2);
|
|
31066
31107
|
}
|
|
31067
31108
|
});
|
|
31068
31109
|
|
|
@@ -32686,11 +32727,11 @@ async function updateCredentialCommand(args2) {
|
|
|
32686
32727
|
const { config, accessToken } = await requireAuth();
|
|
32687
32728
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
32688
32729
|
const { organizationId } = await resolveOrganizationId(client, parsed.orgId);
|
|
32689
|
-
const
|
|
32690
|
-
const matches = (
|
|
32730
|
+
const list2 = await client.listOrgCredentials(organizationId);
|
|
32731
|
+
const matches = (list2.data || []).filter((c) => c.credential_display_name === parsed.name);
|
|
32691
32732
|
if (matches.length === 0) {
|
|
32692
32733
|
console.error(`No credential named "${parsed.name}" found in this organization.`);
|
|
32693
|
-
const available = (
|
|
32734
|
+
const available = (list2.data || []).map((c) => c.credential_display_name);
|
|
32694
32735
|
if (available.length > 0) {
|
|
32695
32736
|
console.error(`Available credentials: ${available.join(", ")}`);
|
|
32696
32737
|
}
|
|
@@ -33967,6 +34008,162 @@ organization admin.
|
|
|
33967
34008
|
}
|
|
33968
34009
|
});
|
|
33969
34010
|
|
|
34011
|
+
// src/commands/access.ts
|
|
34012
|
+
var access_exports = {};
|
|
34013
|
+
__export(access_exports, {
|
|
34014
|
+
accessCommand: () => accessCommand,
|
|
34015
|
+
formatExplanation: () => formatExplanation
|
|
34016
|
+
});
|
|
34017
|
+
import { parseArgs as parseArgs24 } from "util";
|
|
34018
|
+
function usageError4(message) {
|
|
34019
|
+
return expected(`${message}
|
|
34020
|
+
|
|
34021
|
+
${USAGE5}`);
|
|
34022
|
+
}
|
|
34023
|
+
function parse4(args2) {
|
|
34024
|
+
try {
|
|
34025
|
+
return parseArgs24({
|
|
34026
|
+
args: args2,
|
|
34027
|
+
options: {
|
|
34028
|
+
hub: { type: "string" },
|
|
34029
|
+
agent: { type: "string" },
|
|
34030
|
+
user: { type: "string" },
|
|
34031
|
+
json: { type: "boolean" }
|
|
34032
|
+
},
|
|
34033
|
+
allowPositionals: true,
|
|
34034
|
+
strict: true
|
|
34035
|
+
});
|
|
34036
|
+
} catch (err) {
|
|
34037
|
+
throw usageError4(err instanceof Error ? err.message : String(err));
|
|
34038
|
+
}
|
|
34039
|
+
}
|
|
34040
|
+
function layerLines(values) {
|
|
34041
|
+
if (values === null) return ["narrows nothing (no values)"];
|
|
34042
|
+
const dimensions = Object.entries(values);
|
|
34043
|
+
if (dimensions.length === 0) return ["reaches nothing (unset, or no dimension)"];
|
|
34044
|
+
return dimensions.map(([dimension, { read, write }]) => `${text(dimension)}: read ${list(read)}; write ${list(write)}`);
|
|
34045
|
+
}
|
|
34046
|
+
function formatExplanation(data) {
|
|
34047
|
+
const lines = [];
|
|
34048
|
+
const who = data.user_id === null ? "no person: the hub's \u2229 the agent's" : `person ${text(data.user_id)}, ${data.kind ? kindName(data.kind) : "unknown kind"}`;
|
|
34049
|
+
lines.push(`Hub ${text(data.hub_id)}, agent ${text(data.agent_id)}, ${who}`);
|
|
34050
|
+
if (data.values_hub_id === null) lines.push("This preview hub was never published: it has no hub values, so it reaches nothing.");
|
|
34051
|
+
else if (data.values_hub_id !== data.hub_id) lines.push(`Hub values are those of its production hub ${text(data.values_hub_id)}.`);
|
|
34052
|
+
if (data.customer_only) {
|
|
34053
|
+
lines.push("Customer-only: held only on record types customer scope narrows to one customer, on a call naming its customer; every other scoped type reaches nothing.");
|
|
34054
|
+
}
|
|
34055
|
+
if (data.conversations_reach_nothing) {
|
|
34056
|
+
lines.push("This person's own set reaches nothing, whatever the agent: every turn in their conversations, a team member's send or consult there included, reaches nothing either.");
|
|
34057
|
+
}
|
|
34058
|
+
lines.push("", "Layers, intersected in order:");
|
|
34059
|
+
const width = Math.max(...data.layers.map((layer) => LAYER_NAMES[layer.layer].length));
|
|
34060
|
+
for (const layer of data.layers) {
|
|
34061
|
+
const [first, ...rest] = layerLines(layer.values);
|
|
34062
|
+
lines.push(` ${LAYER_NAMES[layer.layer].padEnd(width)} ${first}`);
|
|
34063
|
+
for (const line of rest) lines.push(` ${"".padEnd(width)} ${line}`);
|
|
34064
|
+
}
|
|
34065
|
+
lines.push("", "Effective set:");
|
|
34066
|
+
if (data.dimensions.length === 0) lines.push(" no dimension: the set reaches nothing on any scoped record type");
|
|
34067
|
+
for (const dimension of data.dimensions) {
|
|
34068
|
+
lines.push(` ${text(dimension.dimension_id)}: read ${list(dimension.read)}; write ${list(dimension.write)}`);
|
|
34069
|
+
for (const removal of dimension.read_removed) {
|
|
34070
|
+
lines.push(` ${text(removal.value_id)} not read: removed by ${removal.layers.map((layer) => LAYER_NAMES[layer]).join(", ")}`);
|
|
34071
|
+
}
|
|
34072
|
+
for (const removal of dimension.write_removed) {
|
|
34073
|
+
lines.push(` ${text(removal.value_id)} read, not written: removed by ${removal.layers.map((layer) => LAYER_NAMES[layer]).join(", ")}`);
|
|
34074
|
+
}
|
|
34075
|
+
}
|
|
34076
|
+
lines.push("", "Nothing filters any record by this set yet.");
|
|
34077
|
+
return lines;
|
|
34078
|
+
}
|
|
34079
|
+
function failure3(err) {
|
|
34080
|
+
if (err instanceof ApiError && err.isExpected) return expected(sanitizeTerminalText(extractApiMessage(err)));
|
|
34081
|
+
return err;
|
|
34082
|
+
}
|
|
34083
|
+
async function accessCommand(args2) {
|
|
34084
|
+
if (wantsHelp(args2) || args2.length === 0) {
|
|
34085
|
+
console.log(USAGE5);
|
|
34086
|
+
return;
|
|
34087
|
+
}
|
|
34088
|
+
const { values, positionals } = parse4(args2);
|
|
34089
|
+
const [sub, ...rest] = positionals;
|
|
34090
|
+
if (sub !== "explain") throw usageError4(`Unknown subcommand ${JSON.stringify(sub)}.`);
|
|
34091
|
+
if (rest.length > 0) throw usageError4("explain takes no arguments.");
|
|
34092
|
+
if (values.agent === void 0) throw usageError4("explain needs --agent <agent_id>.");
|
|
34093
|
+
if (!UUID_RE3.test(values.agent)) throw expected(`Invalid --agent ${JSON.stringify(values.agent)}: expected an agent id (a UUID).`);
|
|
34094
|
+
if (values.user !== void 0 && !USER_ID_REGEX.test(values.user)) {
|
|
34095
|
+
throw expected(`Invalid --user ${JSON.stringify(values.user)}: expected a user id.`);
|
|
34096
|
+
}
|
|
34097
|
+
const hubId = resolveActiveHubId(values.hub === void 0 ? [] : ["--hub", values.hub]);
|
|
34098
|
+
const { config, accessToken } = await requireAuth();
|
|
34099
|
+
const api = new ApiClient({ apiUrl: config.api_url, accessToken, onUnauthorized: () => getAccessToken(config) });
|
|
34100
|
+
let data;
|
|
34101
|
+
try {
|
|
34102
|
+
({ data } = await api.explainAccess(hubId, values.agent, values.user));
|
|
34103
|
+
} catch (err) {
|
|
34104
|
+
throw failure3(err);
|
|
34105
|
+
}
|
|
34106
|
+
console.log(values.json ? JSON.stringify(data, null, 2) : formatExplanation(data).join("\n"));
|
|
34107
|
+
}
|
|
34108
|
+
var USAGE5, LAYER_NAMES, kindName, text, list;
|
|
34109
|
+
var init_access = __esm({
|
|
34110
|
+
"src/commands/access.ts"() {
|
|
34111
|
+
"use strict";
|
|
34112
|
+
init_auth();
|
|
34113
|
+
init_api_client();
|
|
34114
|
+
init_errors2();
|
|
34115
|
+
init_expected();
|
|
34116
|
+
init_terminal_output();
|
|
34117
|
+
init_utils();
|
|
34118
|
+
init_workspace();
|
|
34119
|
+
init_contracts();
|
|
34120
|
+
USAGE5 = `
|
|
34121
|
+
wayai access explain \u2014 the access set a hub agent's toolset calls send, and why
|
|
34122
|
+
|
|
34123
|
+
Usage:
|
|
34124
|
+
wayai access explain --agent <agent_id> [--hub <uuid|folder>] [--user <user_id>] [--json]
|
|
34125
|
+
|
|
34126
|
+
Prints the read and write sets, per access dimension, that every hub toolset call of the
|
|
34127
|
+
agent sends, the layers they are the intersection of, and, for each value, the layers that
|
|
34128
|
+
removed it. Every layer only narrows:
|
|
34129
|
+
- with --user, or with no --user when you sign in as a person (yourself): that person's
|
|
34130
|
+
kind on the hub, the first that matches of org member, hub admin, hub team member,
|
|
34131
|
+
hub user and everyone else, then that kind's values \u2229 the hub's \u2229 the agent's. That
|
|
34132
|
+
is what their turn in their own conversation gets on a channel that verifies them (the
|
|
34133
|
+
app, WhatsApp, Instagram, Telegram); on any other they are everyone else.
|
|
34134
|
+
- with a scoped API token and no --user: the hub's \u2229 the agent's, what a hub
|
|
34135
|
+
automation's turn of the agent gets.
|
|
34136
|
+
Everyone else takes the hub's public values, customer-only: held only on record types that
|
|
34137
|
+
customer scope narrows to one customer, on a call naming its customer. A turn in another
|
|
34138
|
+
person's conversation is also cut to that person's set, a delegated task's to its
|
|
34139
|
+
delegation's, and a background agent's side-call's to its host turn's agent's values: those
|
|
34140
|
+
are not shown here. Explaining someone else matches no unredeemed team invite by their
|
|
34141
|
+
email: once they redeem one, its values apply.
|
|
34142
|
+
|
|
34143
|
+
Nothing filters any record by these sets yet.
|
|
34144
|
+
|
|
34145
|
+
The hub is --hub, else this workspace's. --user for anyone but yourself needs an
|
|
34146
|
+
organization admin.
|
|
34147
|
+
`.trim();
|
|
34148
|
+
LAYER_NAMES = {
|
|
34149
|
+
hub: "hub",
|
|
34150
|
+
org_member: "org member",
|
|
34151
|
+
hub_admin: "hub admin",
|
|
34152
|
+
hub_team_member: "hub team member",
|
|
34153
|
+
hub_user: "hub user",
|
|
34154
|
+
hub_public: "hub public values",
|
|
34155
|
+
initiator_agent: "consult initiator agent",
|
|
34156
|
+
delegation: "delegation",
|
|
34157
|
+
originator: "delegation originator",
|
|
34158
|
+
host_agent: "host agent",
|
|
34159
|
+
agent: "agent"
|
|
34160
|
+
};
|
|
34161
|
+
kindName = (kind) => kind === "public" ? "everyone else" : LAYER_NAMES[kind];
|
|
34162
|
+
text = (value) => sanitizeTerminalText(value);
|
|
34163
|
+
list = (ids) => ids.length === 0 ? "nothing" : ids.map(text).join(" ");
|
|
34164
|
+
}
|
|
34165
|
+
});
|
|
34166
|
+
|
|
33970
34167
|
// src/data/files-sync/headers.ts
|
|
33971
34168
|
function ifMatchValue(raw) {
|
|
33972
34169
|
const hash = raw.trim().replace(/^W\//, "").replace(/^"(.*)"$/, "$1");
|
|
@@ -34116,11 +34313,11 @@ function ensureSyncDir(dir) {
|
|
|
34116
34313
|
if (!fs28.lstatSync(dir).isDirectory()) throw symlinkRefusal(dir, "directory");
|
|
34117
34314
|
}
|
|
34118
34315
|
function readRecord(dir) {
|
|
34119
|
-
const
|
|
34120
|
-
if (
|
|
34316
|
+
const text2 = readRealFileOrThrow(dir, path39.join(dir, RECORD_FILE));
|
|
34317
|
+
if (text2 === null) return null;
|
|
34121
34318
|
let parsed;
|
|
34122
34319
|
try {
|
|
34123
|
-
parsed = JSON.parse(
|
|
34320
|
+
parsed = JSON.parse(text2);
|
|
34124
34321
|
} catch {
|
|
34125
34322
|
parsed = void 0;
|
|
34126
34323
|
}
|
|
@@ -34942,20 +35139,20 @@ __export(knowledge_exports, {
|
|
|
34942
35139
|
knowledgeCommand: () => knowledgeCommand,
|
|
34943
35140
|
parseKnowledgeArgs: () => parseKnowledgeArgs
|
|
34944
35141
|
});
|
|
34945
|
-
import { parseArgs as
|
|
34946
|
-
function
|
|
35142
|
+
import { parseArgs as parseArgs25 } from "util";
|
|
35143
|
+
function usageError5(message) {
|
|
34947
35144
|
return expected(`${message}
|
|
34948
|
-
${
|
|
35145
|
+
${USAGE6}`);
|
|
34949
35146
|
}
|
|
34950
35147
|
function readArgs(args2) {
|
|
34951
35148
|
try {
|
|
34952
|
-
return
|
|
35149
|
+
return parseArgs25({ args: args2, options: OPTIONS, allowPositionals: true, strict: true });
|
|
34953
35150
|
} catch (err) {
|
|
34954
|
-
throw
|
|
35151
|
+
throw usageError5(err instanceof Error ? err.message : String(err));
|
|
34955
35152
|
}
|
|
34956
35153
|
}
|
|
34957
35154
|
function parseKnowledgeArgs(args2) {
|
|
34958
|
-
const [retired] =
|
|
35155
|
+
const [retired] = parseArgs25({ args: args2, options: OPTIONS, allowPositionals: true, strict: false }).positionals;
|
|
34959
35156
|
if (retired !== void 0 && RETIRED_VERBS.has(retired)) {
|
|
34960
35157
|
throw expected(
|
|
34961
35158
|
`\`wayai knowledge ${retired}\` is retired: knowledge resources are gone, and an organization's documents live in its knowledge base as files (\`wayai files pull\` and \`push\`).`
|
|
@@ -34964,25 +35161,25 @@ function parseKnowledgeArgs(args2) {
|
|
|
34964
35161
|
const { values, positionals } = readArgs(args2);
|
|
34965
35162
|
const [verb, ...extra] = positionals;
|
|
34966
35163
|
if (verb !== "refresh-preview") {
|
|
34967
|
-
throw
|
|
35164
|
+
throw usageError5(verb === void 0 ? "No subcommand given." : `Unknown subcommand ${JSON.stringify(verb)}.`);
|
|
34968
35165
|
}
|
|
34969
|
-
if (extra.length > 0) throw
|
|
34970
|
-
if (!values.org) throw
|
|
34971
|
-
if (!UUID_RE3.test(values.org)) throw
|
|
34972
|
-
if (!values.base) throw
|
|
35166
|
+
if (extra.length > 0) throw usageError5(`Unexpected argument ${JSON.stringify(extra[0])}.`);
|
|
35167
|
+
if (!values.org) throw usageError5("--org <org_id> is required.");
|
|
35168
|
+
if (!UUID_RE3.test(values.org)) throw usageError5(`Invalid --org ${JSON.stringify(values.org)}: expected an organization id (a UUID).`);
|
|
35169
|
+
if (!values.base) throw usageError5("--base <knowledge base> is required.");
|
|
34973
35170
|
return { verb, orgId: values.org, base: values.base, yes: values.yes === true };
|
|
34974
35171
|
}
|
|
34975
35172
|
async function knowledgeCommand(args2) {
|
|
34976
35173
|
if (wantsHelp(args2) || args2.length === 0) {
|
|
34977
|
-
console.log(
|
|
35174
|
+
console.log(USAGE6);
|
|
34978
35175
|
return;
|
|
34979
35176
|
}
|
|
34980
35177
|
const options = parseKnowledgeArgs(args2);
|
|
34981
|
-
if (!options.yes && !isInteractive()) throw
|
|
35178
|
+
if (!options.yes && !isInteractive()) throw usageError5("It asks before it copies; pass -y when not running in a terminal.");
|
|
34982
35179
|
const data = await createDataClient(options.orgId, { refreshLogin: true });
|
|
34983
35180
|
await refreshPreviewKnowledge(knowledgeBase(data), options, { log: (line) => console.log(line), confirm });
|
|
34984
35181
|
}
|
|
34985
|
-
var
|
|
35182
|
+
var USAGE6, OPTIONS, RETIRED_VERBS;
|
|
34986
35183
|
var init_knowledge = __esm({
|
|
34987
35184
|
"src/commands/knowledge.ts"() {
|
|
34988
35185
|
"use strict";
|
|
@@ -34992,7 +35189,7 @@ var init_knowledge = __esm({
|
|
|
34992
35189
|
init_helpers();
|
|
34993
35190
|
init_remote();
|
|
34994
35191
|
init_refresh_preview();
|
|
34995
|
-
|
|
35192
|
+
USAGE6 = `
|
|
34996
35193
|
wayai knowledge \u2014 the organization's knowledge base
|
|
34997
35194
|
|
|
34998
35195
|
Usage:
|
|
@@ -35528,8 +35725,8 @@ async function runArchiveRead(positional, flagArgs) {
|
|
|
35528
35725
|
const id = String(m.message_id ?? "");
|
|
35529
35726
|
const sender = String(m.sender_type ?? "");
|
|
35530
35727
|
const ts = String(m.created_at ?? "");
|
|
35531
|
-
const
|
|
35532
|
-
console.log(` ${id} | ${sender} | ${ts} | ${
|
|
35728
|
+
const text2 = truncate2(String(m.message_text ?? ""), 80);
|
|
35729
|
+
console.log(` ${id} | ${sender} | ${ts} | ${text2}`);
|
|
35533
35730
|
}
|
|
35534
35731
|
}
|
|
35535
35732
|
}
|
|
@@ -35693,8 +35890,8 @@ function parseScopedTargetFlags(flagArgs, usage3, opts = {}) {
|
|
|
35693
35890
|
return { body: { scope: "hub", hub_id: hubId, dry_run: dryRun }, targetLabel: `hub ${hubId}`, dryRun, yes, jsonOutput };
|
|
35694
35891
|
}
|
|
35695
35892
|
async function runRepairTeamOrphans(flagArgs) {
|
|
35696
|
-
const
|
|
35697
|
-
const { body, targetLabel, dryRun, yes, jsonOutput } = parseScopedTargetFlags(flagArgs,
|
|
35893
|
+
const USAGE7 = "wayai admin hubs repair-team-orphans --all | --org <org_id> | --hub <hub_id> [--dry-run] [--yes] [--json]";
|
|
35894
|
+
const { body, targetLabel, dryRun, yes, jsonOutput } = parseScopedTargetFlags(flagArgs, USAGE7);
|
|
35698
35895
|
if (!dryRun && !yes && !jsonOutput) {
|
|
35699
35896
|
console.log(`About to PURGE dangling team references in: ${targetLabel}.`);
|
|
35700
35897
|
console.log("Memberships pointing at a deleted team are removed (HubDO + UserDO mirror); conversations pinned to one are unassigned.");
|
|
@@ -35740,15 +35937,15 @@ async function runRepairTeamOrphans(flagArgs) {
|
|
|
35740
35937
|
}
|
|
35741
35938
|
}
|
|
35742
35939
|
async function runRepairKnowledgeBlobs(flagArgs) {
|
|
35743
|
-
const
|
|
35940
|
+
const USAGE7 = "wayai admin hubs repair-knowledge-blobs --all | --org <org_id> | --hub <hub_id> [--apply] [--yes] [--json]";
|
|
35744
35941
|
const apply = flagArgs.includes("--apply");
|
|
35745
35942
|
const { body, targetLabel, dryRun, yes, jsonOutput } = parseScopedTargetFlags(
|
|
35746
35943
|
flagArgs.filter((arg) => arg !== "--apply"),
|
|
35747
|
-
|
|
35944
|
+
USAGE7
|
|
35748
35945
|
);
|
|
35749
35946
|
if (apply && dryRun) {
|
|
35750
35947
|
console.error("--apply and --dry-run contradict each other: a run is a dry run unless --apply is given.");
|
|
35751
|
-
console.error(
|
|
35948
|
+
console.error(USAGE7);
|
|
35752
35949
|
process.exit(1);
|
|
35753
35950
|
}
|
|
35754
35951
|
const input = { ...body, dry_run: !apply };
|
|
@@ -35798,7 +35995,7 @@ async function runRepairKnowledgeBlobs(flagArgs) {
|
|
|
35798
35995
|
}
|
|
35799
35996
|
}
|
|
35800
35997
|
async function runRepairBranchingOrphans(flagArgs) {
|
|
35801
|
-
const
|
|
35998
|
+
const USAGE7 = "wayai admin hubs repair-branching-orphans --all | --org <org_id> | --hub <hub_id> [--id <type>:<id> ...] [--dry-run] [--yes] [--json]";
|
|
35802
35999
|
const targets = [];
|
|
35803
36000
|
const scopeArgs = [];
|
|
35804
36001
|
for (let i = 0; i < flagArgs.length; i++) {
|
|
@@ -35816,10 +36013,10 @@ async function runRepairBranchingOrphans(flagArgs) {
|
|
|
35816
36013
|
}
|
|
35817
36014
|
targets.push({ entity_type: entityType, entity_id: entityId });
|
|
35818
36015
|
}
|
|
35819
|
-
const { body, targetLabel, dryRun, yes, jsonOutput } = parseScopedTargetFlags(scopeArgs,
|
|
36016
|
+
const { body, targetLabel, dryRun, yes, jsonOutput } = parseScopedTargetFlags(scopeArgs, USAGE7);
|
|
35820
36017
|
if (targets.length > 0 && body.scope !== "hub") {
|
|
35821
36018
|
console.error("--id deletes rows of ONE production hub: combine it with --hub <hub_id>.");
|
|
35822
|
-
console.error(
|
|
36019
|
+
console.error(USAGE7);
|
|
35823
36020
|
process.exit(1);
|
|
35824
36021
|
}
|
|
35825
36022
|
if (targets.length > 0 && !dryRun && !yes && !jsonOutput) {
|
|
@@ -35881,8 +36078,8 @@ async function runRepairBranchingOrphans(flagArgs) {
|
|
|
35881
36078
|
}
|
|
35882
36079
|
}
|
|
35883
36080
|
async function runRepairLegacyOrgGrants(flagArgs) {
|
|
35884
|
-
const
|
|
35885
|
-
const scoped = parseScopedTargetFlags(flagArgs,
|
|
36081
|
+
const USAGE7 = "wayai admin orgs repair-legacy-grants --all | --org <org_id> [--dry-run] [--yes] [--json]";
|
|
36082
|
+
const scoped = parseScopedTargetFlags(flagArgs, USAGE7, {
|
|
35886
36083
|
scopes: ["all", "org"],
|
|
35887
36084
|
allLabel: "ALL organizations (platform-wide)"
|
|
35888
36085
|
});
|
|
@@ -35934,8 +36131,8 @@ async function runRepairLegacyOrgGrants(flagArgs) {
|
|
|
35934
36131
|
}
|
|
35935
36132
|
}
|
|
35936
36133
|
async function runHarnessMassDestroy(flagArgs) {
|
|
35937
|
-
const
|
|
35938
|
-
const { body, targetLabel, dryRun, yes, jsonOutput } = parseScopedTargetFlags(flagArgs,
|
|
36134
|
+
const USAGE7 = "wayai admin harness mass-destroy --all | --org <org_id> | --hub <hub_id> [--dry-run] [--yes] [--json]";
|
|
36135
|
+
const { body, targetLabel, dryRun, yes, jsonOutput } = parseScopedTargetFlags(flagArgs, USAGE7);
|
|
35939
36136
|
if (!dryRun && !yes && !jsonOutput) {
|
|
35940
36137
|
console.log(`About to REAP every live harness session / token / slot in: ${targetLabel}.`);
|
|
35941
36138
|
console.log("This destroys running harness sessions and revokes their tokens. Run with --dry-run first to see the blast radius.");
|
|
@@ -40526,6 +40723,11 @@ async function main() {
|
|
|
40526
40723
|
await dimensionsCommand2(args);
|
|
40527
40724
|
break;
|
|
40528
40725
|
}
|
|
40726
|
+
case "access": {
|
|
40727
|
+
const { accessCommand: accessCommand2 } = await Promise.resolve().then(() => (init_access(), access_exports));
|
|
40728
|
+
await accessCommand2(args);
|
|
40729
|
+
break;
|
|
40730
|
+
}
|
|
40529
40731
|
case "knowledge": {
|
|
40530
40732
|
const { knowledgeCommand: knowledgeCommand2 } = await Promise.resolve().then(() => (init_knowledge(), knowledge_exports));
|
|
40531
40733
|
await knowledgeCommand2(args);
|
|
@@ -40622,6 +40824,7 @@ Commands:
|
|
|
40622
40824
|
communities An organization's communities: list, join link (get/rotate/off), stats, access list (list/add/remove) \u2014 \`wayai communities --help\`
|
|
40623
40825
|
contacts Link a contact to its customer record in a base, or unlink it (browser sign-in only) \u2014 \`wayai contacts --help\`
|
|
40624
40826
|
dimensions An organization's access dimensions and their values: list, create, relabel, add/retire values \u2014 \`wayai dimensions --help\`
|
|
40827
|
+
access explain The access set a hub agent's toolset calls send for a person, and which layer removed each value \u2014 \`wayai access --help\`
|
|
40625
40828
|
knowledge refresh-preview Make the knowledge base's preview hold its production base's files \u2014 \`wayai knowledge --help\`
|
|
40626
40829
|
report create Report a platform bug (submits to the triage queue)
|
|
40627
40830
|
report edit Amend your own pending report (title/description/error/steps/context)
|