@wayai/cli 0.3.306 → 0.3.308
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 +313 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5892,10 +5892,10 @@ var init_chunk_P5GJNS5R = __esm({
|
|
|
5892
5892
|
}
|
|
5893
5893
|
});
|
|
5894
5894
|
|
|
5895
|
-
// ../../packages/core/dist/chunk-
|
|
5896
|
-
var REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, REKOR_V1_PREFIX, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, REKOR_BOUND_BASE_HEADER, REKOR_BOUND_TOOLSET_HEADER, REKOR_BOUND_TOKEN_HEADER, REKOR_BOUND_ACCESS_HEADER, REKOR_BOUND_PAGE_HEADER, REKOR_BOUND_PERSON_HEADER, REKOR_PERSON_AUDIENCE_STAFF, REKOR_PERSON_AUDIENCE_CUSTOMER, REKOR_PERSON_ALL, DATA_BASE_GENERATION_HEADER, REKOR_MAX_ACTOR_ID_LENGTH, REKOR_MAX_ACTOR_LABEL_LENGTH, REKOR_MAX_ACCESS_DIMENSIONS, REKOR_MAX_ACCESS_VALUES, REKOR_MAX_ACCESS_ID_LENGTH, REKOR_MAX_ACCESS_HEADER_LENGTH, REKOR_MAX_PERSON_PARTIES, REKOR_MAX_PERSON_IDS, REKOR_MAX_PERSON_ID_LENGTH, REKOR_MAX_PERSON_HEADER_LENGTH;
|
|
5897
|
-
var
|
|
5898
|
-
"../../packages/core/dist/chunk-
|
|
5895
|
+
// ../../packages/core/dist/chunk-SDOG6762.js
|
|
5896
|
+
var REKOR_ACTOR_TYPE_HEADER, REKOR_ACTOR_ID_HEADER, REKOR_ACTOR_LABEL_HEADER, REKOR_ACTOR_ORG_HEADER, REKOR_ACTOR_ADMIN_HEADER, REKOR_CLIENT_HEADER, REKOR_TOOL_ID_HEADER, REKOR_CLIENTS, rekorClientSchema, MAX_REKOR_TOOL_ID_LENGTH, rekorToolIdSchema, REKOR_V1_PREFIX, REKOR_LIFECYCLE_PREFIX, REKOR_BASE_VAULT_DRY_RUN_PATH, DATA_PROXY_ORG_QUERY_PARAM, MAX_PROVISIONING_BODY_BYTES, dataProxyQuery, rekorAttestation, REQUIRED_REKOR_ATTESTATION_HEADERS, REKOR_BOUND_BASE_HEADER, REKOR_BOUND_TOOLSET_HEADER, REKOR_BOUND_TOKEN_HEADER, REKOR_BOUND_ACCESS_HEADER, REKOR_BOUND_PAGE_HEADER, REKOR_BOUND_PERSON_HEADER, REKOR_BOUND_CAPABILITY_HEADER, REKOR_BOUND_CAPABILITY_SEED, REKOR_PERSON_AUDIENCE_STAFF, REKOR_PERSON_AUDIENCE_CUSTOMER, REKOR_PERSON_ALL, DATA_BASE_GENERATION_HEADER, REKOR_MAX_ACTOR_ID_LENGTH, REKOR_MAX_ACTOR_LABEL_LENGTH, REKOR_MAX_ACCESS_DIMENSIONS, REKOR_MAX_ACCESS_VALUES, REKOR_MAX_ACCESS_ID_LENGTH, REKOR_MAX_ACCESS_HEADER_LENGTH, REKOR_MAX_PERSON_PARTIES, REKOR_MAX_PERSON_IDS, REKOR_MAX_PERSON_ID_LENGTH, REKOR_MAX_PERSON_HEADER_LENGTH;
|
|
5897
|
+
var init_chunk_SDOG6762 = __esm({
|
|
5898
|
+
"../../packages/core/dist/chunk-SDOG6762.js"() {
|
|
5899
5899
|
"use strict";
|
|
5900
5900
|
init_zod();
|
|
5901
5901
|
REKOR_ACTOR_TYPE_HEADER = "X-Rekor-Actor-Type";
|
|
@@ -5910,6 +5910,8 @@ var init_chunk_4D6K4P4K = __esm({
|
|
|
5910
5910
|
MAX_REKOR_TOOL_ID_LENGTH = 128;
|
|
5911
5911
|
rekorToolIdSchema = external_exports.string().trim().min(1).max(MAX_REKOR_TOOL_ID_LENGTH);
|
|
5912
5912
|
REKOR_V1_PREFIX = "/v1";
|
|
5913
|
+
REKOR_LIFECYCLE_PREFIX = "/lifecycle";
|
|
5914
|
+
REKOR_BASE_VAULT_DRY_RUN_PATH = `${REKOR_LIFECYCLE_PREFIX}/vault-dry-run`;
|
|
5913
5915
|
DATA_PROXY_ORG_QUERY_PARAM = "org_id";
|
|
5914
5916
|
MAX_PROVISIONING_BODY_BYTES = 256 * 1024;
|
|
5915
5917
|
dataProxyQuery = external_exports.object({
|
|
@@ -5931,6 +5933,8 @@ var init_chunk_4D6K4P4K = __esm({
|
|
|
5931
5933
|
REKOR_BOUND_ACCESS_HEADER = "X-Rekor-Bound-Access";
|
|
5932
5934
|
REKOR_BOUND_PAGE_HEADER = "X-Rekor-Bound-Page";
|
|
5933
5935
|
REKOR_BOUND_PERSON_HEADER = "X-Rekor-Bound-Person";
|
|
5936
|
+
REKOR_BOUND_CAPABILITY_HEADER = "X-Rekor-Bound-Capability";
|
|
5937
|
+
REKOR_BOUND_CAPABILITY_SEED = "seed";
|
|
5934
5938
|
REKOR_PERSON_AUDIENCE_STAFF = "staff";
|
|
5935
5939
|
REKOR_PERSON_AUDIENCE_CUSTOMER = "customer";
|
|
5936
5940
|
REKOR_PERSON_ALL = "*";
|
|
@@ -5948,7 +5952,7 @@ var init_chunk_4D6K4P4K = __esm({
|
|
|
5948
5952
|
}
|
|
5949
5953
|
});
|
|
5950
5954
|
|
|
5951
|
-
// ../../packages/core/dist/chunk-
|
|
5955
|
+
// ../../packages/core/dist/chunk-T6D3YZ6B.js
|
|
5952
5956
|
function isPersonAccessAll(lists) {
|
|
5953
5957
|
return lists !== void 0 && lists.read.length === 1 && lists.read[0] === ACCESS_UNRESTRICTED && lists.write.length === 1 && lists.write[0] === ACCESS_UNRESTRICTED;
|
|
5954
5958
|
}
|
|
@@ -5986,10 +5990,10 @@ function assignmentHasUnrestricted(assignment) {
|
|
|
5986
5990
|
return Object.values(assignment).some((lists) => lists.read.includes(ACCESS_UNRESTRICTED) || lists.write.includes(ACCESS_UNRESTRICTED));
|
|
5987
5991
|
}
|
|
5988
5992
|
var ACCESS_UNRESTRICTED, ACCESS_ID_REGEX, ACCESS_ID_MAX_LENGTH, MAX_ACCESS_DIMENSIONS_PER_ORG, MAX_ACCESS_VALUES_PER_DIMENSION, ACCESS_LABEL_MAX_LENGTH, accessIdSchema, accessLabelSchema, accessValueListSchema, accessListsSchema, accessAssignmentSchema, PERSON_ACCESS_KEY, heldAccessKeySchema, heldAccessAssignmentSchema, AGENT_PERSON_ACCESS_REFUSAL, accessSetSchema, accessDimensionParam, accessValueParam, orgMemberParam, orgHubParam, createAccessDimensionBody, updateAccessDimensionBody, createAccessValueBody, updateAccessValueBody, setMemberAccessValuesBody, HUB_PERSON_KINDS, ACCESS_PERSON_KINDS, setHubUserAccessValuesBody, setHubAccessValuesBody, setAgentAccessValuesBody;
|
|
5989
|
-
var
|
|
5990
|
-
"../../packages/core/dist/chunk-
|
|
5993
|
+
var init_chunk_T6D3YZ6B = __esm({
|
|
5994
|
+
"../../packages/core/dist/chunk-T6D3YZ6B.js"() {
|
|
5991
5995
|
"use strict";
|
|
5992
|
-
|
|
5996
|
+
init_chunk_SDOG6762();
|
|
5993
5997
|
init_chunk_HZ6CADSY();
|
|
5994
5998
|
init_chunk_YROEDMVZ();
|
|
5995
5999
|
init_zod();
|
|
@@ -6080,7 +6084,7 @@ var init_chunk_HRKVCI5A = __esm({
|
|
|
6080
6084
|
}
|
|
6081
6085
|
});
|
|
6082
6086
|
|
|
6083
|
-
// ../../packages/core/dist/chunk-
|
|
6087
|
+
// ../../packages/core/dist/chunk-ADED5YHZ.js
|
|
6084
6088
|
function boundCustomerPartyIsValid(audience, parties, customer) {
|
|
6085
6089
|
return audience !== REKOR_PERSON_AUDIENCE_STAFF && customer < parties.length && Array.isArray(parties[customer]);
|
|
6086
6090
|
}
|
|
@@ -6093,12 +6097,12 @@ function isEncodedBoundPerson(raw) {
|
|
|
6093
6097
|
}
|
|
6094
6098
|
return rekorBoundPersonSchema.safeParse(parsed).success;
|
|
6095
6099
|
}
|
|
6096
|
-
var TOOLSET_SLUG_PATTERN, REKOR_STRUCTURAL_ID_PATTERN, baseEnvironmentSchema, toolsetFileToolSchema, toolsetSurfaceSchema, toolsetConnectionBindingSchema, rekorToolsetToolsSchema, rekorPersonIdSchema, rekorPersonAudienceSchema, rekorBoundPersonSchema, rekorBoundAttestation, rekorResolvedToolsetSchema, REKOR_TOOL_KINDS_PARAM, REKOR_TOOL_KINDS_RESOLVE_SEARCH, resolvedRecordTypeSchema, reviewWritersSchema, sharedScopeSchema, resolvedFileToolSchema, rekorToolsetFileSchema, rekorToolsetFileUrlAnswerSchema, rekorToolsetFileListSchema, rekorToolsetFileGetSchema, rekorToolsetFilePutSchema, TOOLSET_CUSTOMER_FACING_REFUSAL_MARK, TOOLSET_CUSTOMER_FACING_REFUSAL, BASE_TOOLSET_ONLY_FOR_CUSTOMER_FACING, GENERIC_DATA_MCP_CUSTOMER_FACING_REFUSAL, GENERIC_DATA_API_CUSTOMER_FACING_REFUSAL;
|
|
6097
|
-
var
|
|
6098
|
-
"../../packages/core/dist/chunk-
|
|
6100
|
+
var TOOLSET_SLUG_PATTERN, REKOR_STRUCTURAL_ID_PATTERN, baseEnvironmentSchema, toolsetFileToolSchema, toolsetSurfaceSchema, toolsetConnectionBindingSchema, rekorToolsetToolsSchema, rekorPersonIdSchema, rekorPersonAudienceSchema, rekorBoundPersonSchema, STATED_GENERATION_PATTERN, rekorBoundAttestation, rekorSeedAttestation, rekorResolvedToolsetSchema, REKOR_TOOL_KINDS_PARAM, REKOR_TOOL_KINDS_RESOLVE_SEARCH, resolvedRecordTypeSchema, reviewWritersSchema, sharedScopeSchema, resolvedFileToolSchema, rekorToolsetFileSchema, rekorToolsetFileUrlAnswerSchema, rekorToolsetFileListSchema, rekorToolsetFileGetSchema, rekorToolsetFilePutSchema, TOOLSET_CUSTOMER_FACING_REFUSAL_MARK, TOOLSET_CUSTOMER_FACING_REFUSAL, BASE_TOOLSET_ONLY_FOR_CUSTOMER_FACING, GENERIC_DATA_MCP_CUSTOMER_FACING_REFUSAL, GENERIC_DATA_API_CUSTOMER_FACING_REFUSAL;
|
|
6101
|
+
var init_chunk_ADED5YHZ = __esm({
|
|
6102
|
+
"../../packages/core/dist/chunk-ADED5YHZ.js"() {
|
|
6099
6103
|
"use strict";
|
|
6100
|
-
|
|
6101
|
-
|
|
6104
|
+
init_chunk_T6D3YZ6B();
|
|
6105
|
+
init_chunk_SDOG6762();
|
|
6102
6106
|
init_zod();
|
|
6103
6107
|
TOOLSET_SLUG_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
6104
6108
|
REKOR_STRUCTURAL_ID_PATTERN = TOOLSET_SLUG_PATTERN;
|
|
@@ -6209,6 +6213,7 @@ var init_chunk_2DXRB6DR = __esm({
|
|
|
6209
6213
|
message: "The customer party is a listed party of person ids, on a call that is not staff's",
|
|
6210
6214
|
path: ["customer"]
|
|
6211
6215
|
});
|
|
6216
|
+
STATED_GENERATION_PATTERN = /^[1-9]\d{0,14}$/;
|
|
6212
6217
|
rekorBoundAttestation = rekorAttestation.extend({
|
|
6213
6218
|
[REKOR_ACTOR_TYPE_HEADER]: external_exports.enum(["token", "user"]),
|
|
6214
6219
|
/** Trimmed and checked as the far side trims and checks it. */
|
|
@@ -6217,11 +6222,7 @@ var init_chunk_2DXRB6DR = __esm({
|
|
|
6217
6222
|
[REKOR_ACTOR_ADMIN_HEADER]: external_exports.literal("0"),
|
|
6218
6223
|
[REKOR_BOUND_BASE_HEADER]: external_exports.string().regex(REKOR_STRUCTURAL_ID_PATTERN),
|
|
6219
6224
|
[REKOR_BOUND_TOOLSET_HEADER]: external_exports.string().regex(REKOR_STRUCTURAL_ID_PATTERN),
|
|
6220
|
-
|
|
6221
|
-
* Decimal digits only, as the far side parses it, and at most 15 of them: its `Number()` reads
|
|
6222
|
-
* every such value back exactly, where a longer one may round or overflow to `Infinity` (a 400).
|
|
6223
|
-
*/
|
|
6224
|
-
[DATA_BASE_GENERATION_HEADER]: external_exports.string().regex(/^[1-9]\d{0,14}$/),
|
|
6225
|
+
[DATA_BASE_GENERATION_HEADER]: external_exports.string().regex(STATED_GENERATION_PATTERN),
|
|
6225
6226
|
/** The token the binding was resolved from, when the connection records it (owner decision 41). */
|
|
6226
6227
|
[REKOR_BOUND_TOKEN_HEADER]: external_exports.string().regex(REKOR_STRUCTURAL_ID_PATTERN).optional(),
|
|
6227
6228
|
/**
|
|
@@ -6250,6 +6251,21 @@ var init_chunk_2DXRB6DR = __esm({
|
|
|
6250
6251
|
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: [REKOR_ACTOR_TYPE_HEADER], message: "A person is attested only on a team page's call" });
|
|
6251
6252
|
}
|
|
6252
6253
|
});
|
|
6254
|
+
rekorSeedAttestation = rekorAttestation.extend({
|
|
6255
|
+
[REKOR_ACTOR_TYPE_HEADER]: external_exports.literal("token"),
|
|
6256
|
+
/** Trimmed and checked as the far side trims and checks it. */
|
|
6257
|
+
[REKOR_ACTOR_ID_HEADER]: external_exports.string().trim().min(1).max(REKOR_MAX_ACTOR_ID_LENGTH),
|
|
6258
|
+
[REKOR_ACTOR_LABEL_HEADER]: external_exports.string().max(REKOR_MAX_ACTOR_LABEL_LENGTH),
|
|
6259
|
+
[REKOR_ACTOR_ADMIN_HEADER]: external_exports.literal("0"),
|
|
6260
|
+
[REKOR_BOUND_CAPABILITY_HEADER]: external_exports.literal(REKOR_BOUND_CAPABILITY_SEED),
|
|
6261
|
+
[REKOR_BOUND_BASE_HEADER]: external_exports.string().regex(REKOR_STRUCTURAL_ID_PATTERN),
|
|
6262
|
+
[REKOR_BOUND_TOKEN_HEADER]: external_exports.string().regex(REKOR_STRUCTURAL_ID_PATTERN),
|
|
6263
|
+
[DATA_BASE_GENERATION_HEADER]: external_exports.string().regex(STATED_GENERATION_PATTERN)
|
|
6264
|
+
}).strict().superRefine((bag, ctx) => {
|
|
6265
|
+
if (bag[REKOR_ACTOR_ID_HEADER] !== bag[REKOR_BOUND_TOKEN_HEADER]) {
|
|
6266
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: [REKOR_ACTOR_ID_HEADER], message: "The seed form's actor is the token it names" });
|
|
6267
|
+
}
|
|
6268
|
+
});
|
|
6253
6269
|
rekorResolvedToolsetSchema = external_exports.object({
|
|
6254
6270
|
data: external_exports.object({
|
|
6255
6271
|
base_id: external_exports.string().min(1),
|
|
@@ -6357,13 +6373,13 @@ var init_chunk_2DXRB6DR = __esm({
|
|
|
6357
6373
|
}
|
|
6358
6374
|
});
|
|
6359
6375
|
|
|
6360
|
-
// ../../packages/core/dist/chunk-
|
|
6376
|
+
// ../../packages/core/dist/chunk-5A4FBWQS.js
|
|
6361
6377
|
var TOOLSET_ANSWER_PERSON_PARTIES, toolsetAnswerPersonSchema, toolsetAnswerPersonsSchema;
|
|
6362
|
-
var
|
|
6363
|
-
"../../packages/core/dist/chunk-
|
|
6378
|
+
var init_chunk_5A4FBWQS = __esm({
|
|
6379
|
+
"../../packages/core/dist/chunk-5A4FBWQS.js"() {
|
|
6364
6380
|
"use strict";
|
|
6365
|
-
|
|
6366
|
-
|
|
6381
|
+
init_chunk_ADED5YHZ();
|
|
6382
|
+
init_chunk_SDOG6762();
|
|
6367
6383
|
init_zod();
|
|
6368
6384
|
TOOLSET_ANSWER_PERSON_PARTIES = ["requester", "originator", "initiator", "delegator"];
|
|
6369
6385
|
toolsetAnswerPersonSchema = external_exports.object({
|
|
@@ -7717,12 +7733,12 @@ var init_chunk_FBV7NLKO = __esm({
|
|
|
7717
7733
|
}
|
|
7718
7734
|
});
|
|
7719
7735
|
|
|
7720
|
-
// ../../packages/core/dist/chunk-
|
|
7736
|
+
// ../../packages/core/dist/chunk-LMSJYN2R.js
|
|
7721
7737
|
var hubPageWatchParam, pageWatchedBaseSchema, hubPageWatchResponseSchema;
|
|
7722
|
-
var
|
|
7723
|
-
"../../packages/core/dist/chunk-
|
|
7738
|
+
var init_chunk_LMSJYN2R = __esm({
|
|
7739
|
+
"../../packages/core/dist/chunk-LMSJYN2R.js"() {
|
|
7724
7740
|
"use strict";
|
|
7725
|
-
|
|
7741
|
+
init_chunk_ADED5YHZ();
|
|
7726
7742
|
init_chunk_FBV7NLKO();
|
|
7727
7743
|
init_chunk_HZ6CADSY();
|
|
7728
7744
|
init_zod();
|
|
@@ -13106,7 +13122,7 @@ var init_chunk_2ISUBJG7 = __esm({
|
|
|
13106
13122
|
}
|
|
13107
13123
|
});
|
|
13108
13124
|
|
|
13109
|
-
// ../../packages/core/dist/chunk-
|
|
13125
|
+
// ../../packages/core/dist/chunk-66EZQ7Y7.js
|
|
13110
13126
|
function describeRole(role) {
|
|
13111
13127
|
if (typeof role === "string") {
|
|
13112
13128
|
return JSON.stringify(role.length > ROLE_ECHO_MAX ? `${role.slice(0, ROLE_ECHO_MAX)}\u2026` : role);
|
|
@@ -13285,10 +13301,10 @@ function terminalRunCount(counts) {
|
|
|
13285
13301
|
return counts.successful_runs + counts.failed_runs;
|
|
13286
13302
|
}
|
|
13287
13303
|
var evalIdParam, sessionIdParam, scenarioSetIdParam, hubIdQuery, EVAL_FIXTURE_NAME_MAX_LENGTH, evalFixtureOverrideSchema, runSessionQuery, runJourneyQuery, EVAL_INPUT_ROLES, EVAL_INPUT_ROLE_LIST, ROLE_ECHO_MAX, EVAL_INITIAL_STATE_SCOPES, MAX_INITIAL_STATE_ENTRIES, evalInitialStateEntry, EVAL_PERSON_MAX, evalPersonSchema, EVAL_PERSON_ALIAS_RETIRED, EVAL_PERSON_ALIAS_REFUSED, evalBody, EVAL_LIST_MAX_LIMIT, evalListLimit, getEvalsQuery, toggleEvalBody, bulkToggleEvalsBody, pacingConfigSchema, EVAL_MAX_SELECTED_SCENARIOS, evalScenarioSelectionEntrySchema, evalScenarioSelectionSchema, sessionConfigSchema, createSessionBody, getSessionsQuery, getSessionResultsQuery, getSessionRunsQuery, evalAnalyticsQuery, getSessionCostQuery, compareSessionsQuery, evalsSqlBody, evalsSqlSchemaQuery, exportResultsQuery, validateEvalBody, hubAgentsQuery, createScenarioSetBody, updateScenarioSetBody, scenarioSetsHubQuery, createScenarioFromConversationBody, createJourneyFromConversationBody, evalAttachmentRef, turnMayCarryAttachments, ATTACHMENTS_USER_ONLY_MESSAGE, journeyIdParam, journeyToolCallSchema, journeyTurnSchema, journeyStepOverrideSchema, fixtureField, createJourneyBody, updateJourneyBody, evalSessionConfigResponseSchema, evalSessionResponseSchema, evalSessionListConfigSchema, evalSessionListItemSchema, seedReleaseStatusSchema, EVAL_SESSION_NOT_QUIESCENT;
|
|
13288
|
-
var
|
|
13289
|
-
"../../packages/core/dist/chunk-
|
|
13304
|
+
var init_chunk_66EZQ7Y7 = __esm({
|
|
13305
|
+
"../../packages/core/dist/chunk-66EZQ7Y7.js"() {
|
|
13290
13306
|
"use strict";
|
|
13291
|
-
|
|
13307
|
+
init_chunk_SDOG6762();
|
|
13292
13308
|
init_chunk_2YEGUQR7();
|
|
13293
13309
|
init_chunk_4LXDRTO4();
|
|
13294
13310
|
init_chunk_WTOA3ANF();
|
|
@@ -14363,7 +14379,7 @@ var init_chunk_MO23HUAX = __esm({
|
|
|
14363
14379
|
}
|
|
14364
14380
|
});
|
|
14365
14381
|
|
|
14366
|
-
// ../../packages/core/dist/chunk-
|
|
14382
|
+
// ../../packages/core/dist/chunk-KXYJ46BM.js
|
|
14367
14383
|
function declaresNoConnection(agent) {
|
|
14368
14384
|
return agent.connection === null && !agent.connection_id;
|
|
14369
14385
|
}
|
|
@@ -15095,12 +15111,12 @@ function skillSectionsAsResources(scope) {
|
|
|
15095
15111
|
};
|
|
15096
15112
|
}
|
|
15097
15113
|
var MAX_10MB_BASE64_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_ENCODED_BYTES, MAX_EVAL_ATTACHMENT_CARRIERS, MAX_EVAL_ATTACHMENT_AGGREGATE_ENCODED_BYTES, MAX_RESOURCE_ENCODED_BYTES, MAX_HUB_AS_CODE_RESOURCES, MAX_HUB_AS_CODE_RESOURCE_FILES, MAX_RESOURCE_AGGREGATE_ENCODED_BYTES, MAX_CI_CONFIG_BODY_BYTES, MAX_HUB_AS_CODE_PAGE_MANIFEST_CHARS, hubAsCodePagesSchema, MAX_CALL_OPENING_CARRIERS, MAX_CALL_OPENING_AGGREGATE_ENCODED_BYTES, HUB_AS_CODE_AGENT_TOOL_KEYS, hubAsCodeStateSchema, hubAsCodeResourceFileSchema, hubAsCodeResourceSchema, uuidPattern, ciUuidSchema, flagEntriesOf, boundedHubAsCodeResourcesSchema, isPlainObject, MIN_SKILLS_LAYOUT_CLI, MAX_HUB_AS_CODE_DEPTH, NAMED_DEPTH_SEGMENTS, NAMED_DEPTH_KEY_CHARS, fieldName, hubAsCodeConfigSchema, ciPullHubIdParam, ciBranchParam, ciPullQuery, ciHubsQuery, ciLookupQuery, ciBranchesQuery, ciSyncBody, ciPushBody, ciDiffBody, ciPublishBody, ciPublishPreviewBody, ciSyncMcpBody, ciOrgResourcesParam, orgResourcesConfigSchema, ciOrgResourcesPushBody, ciOrgResourcesDiffBody, CI_APPLY_ENTITY_KINDS, CI_APPLY_OPERATIONS, ciApplyErrorBaseSchema, ciApplyErrorSchema, ciSyncCountSchema, ciSyncChangesSchema, ciSyncWarningSchema, ciSyncResponseSchema;
|
|
15098
|
-
var
|
|
15099
|
-
"../../packages/core/dist/chunk-
|
|
15114
|
+
var init_chunk_KXYJ46BM = __esm({
|
|
15115
|
+
"../../packages/core/dist/chunk-KXYJ46BM.js"() {
|
|
15100
15116
|
"use strict";
|
|
15101
15117
|
init_chunk_YI3ORIXJ();
|
|
15102
|
-
|
|
15103
|
-
|
|
15118
|
+
init_chunk_T6D3YZ6B();
|
|
15119
|
+
init_chunk_66EZQ7Y7();
|
|
15104
15120
|
init_chunk_LBDH7LCG();
|
|
15105
15121
|
init_chunk_4LXDRTO4();
|
|
15106
15122
|
init_chunk_MO23HUAX();
|
|
@@ -15593,7 +15609,7 @@ var init_chunk_OMPT4ZHR = __esm({
|
|
|
15593
15609
|
}
|
|
15594
15610
|
});
|
|
15595
15611
|
|
|
15596
|
-
// ../../packages/core/dist/chunk-
|
|
15612
|
+
// ../../packages/core/dist/chunk-I3PBCSF4.js
|
|
15597
15613
|
function refineScopedTarget(data, ctx) {
|
|
15598
15614
|
if (data.scope === "org") {
|
|
15599
15615
|
if (!data.org_id) {
|
|
@@ -15618,9 +15634,9 @@ function refineScopedTarget(data, ctx) {
|
|
|
15618
15634
|
}
|
|
15619
15635
|
}
|
|
15620
15636
|
}
|
|
15621
|
-
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, adminDryRunByDefaultTargetBody, 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;
|
|
15622
|
-
var
|
|
15623
|
-
"../../packages/core/dist/chunk-
|
|
15637
|
+
var adminOrgIdParam, adminOrgAdminIdParam, adminUserIdParam, PRICING_PLAN_ID_RE, adminPlanIdParam, adminOrganizationsQuery, adminUserSearchQuery, kanbanSlugMigrationQuery, adjustQuotaBody, updatePlanBody, addAdminUserBody, MAX_VOICE_CALL_MINUTE_OPS, voiceCallMinuteOps, AUTOMATION_GATE_EVALUATIONS_PER_OPERATION_BOUND, automationGateEvaluationsPerOperation, AUTOMATION_RUN_RETENTION_DAYS_MAX, automationRunRetentionDays, turnDeadlineSeconds, casesLimit, updatePlatformConfigBody, updateFreeOrgLimitBody, adminScopedTargetShape, adminScopedTargetBody, adminDryRunByDefaultTargetBody, 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;
|
|
15638
|
+
var init_chunk_I3PBCSF4 = __esm({
|
|
15639
|
+
"../../packages/core/dist/chunk-I3PBCSF4.js"() {
|
|
15624
15640
|
"use strict";
|
|
15625
15641
|
init_chunk_FECLIZTY();
|
|
15626
15642
|
init_chunk_BFG4ZWR4();
|
|
@@ -15718,6 +15734,7 @@ var init_chunk_7ILN55YW = __esm({
|
|
|
15718
15734
|
AUTOMATION_RUN_RETENTION_DAYS_MAX = 3650;
|
|
15719
15735
|
automationRunRetentionDays = external_exports.number().int().min(1).max(AUTOMATION_RUN_RETENTION_DAYS_MAX);
|
|
15720
15736
|
turnDeadlineSeconds = external_exports.number().int().min(TURN_DEADLINE_SECONDS_FLOOR).max(TURN_DEADLINE_SECONDS_MAX);
|
|
15737
|
+
casesLimit = (bound) => external_exports.number().int().min(1).max(bound);
|
|
15721
15738
|
updatePlatformConfigBody = external_exports.object({
|
|
15722
15739
|
free_plan_max_free_orgs_per_user: external_exports.number().int().min(0).optional(),
|
|
15723
15740
|
/** Kill switch for admin debug-read endpoints. 0 = off, 1 = on. */
|
|
@@ -15757,6 +15774,22 @@ var init_chunk_7ILN55YW = __esm({
|
|
|
15757
15774
|
* `wayai admin communities enable|disable` flips this.
|
|
15758
15775
|
*/
|
|
15759
15776
|
communities_enabled: external_exports.number().int().min(0).max(1).optional(),
|
|
15777
|
+
/**
|
|
15778
|
+
* The cases kill switch (wayai#5921). 0 = off (the default), 1 = on. Not nested in
|
|
15779
|
+
* `threads_enabled`, so a threads shutdown can't stop approvals.
|
|
15780
|
+
* `wayai admin cases enable|disable` flips this.
|
|
15781
|
+
*/
|
|
15782
|
+
cases_enabled: external_exports.number().int().min(0).max(1).optional(),
|
|
15783
|
+
/** The Cases limits (`casesLimit`). */
|
|
15784
|
+
cases_per_space_max: casesLimit(1e4).optional(),
|
|
15785
|
+
cases_spaces_per_org_max: casesLimit(100).optional(),
|
|
15786
|
+
cases_revisions_per_case_max: casesLimit(2e4).optional(),
|
|
15787
|
+
cases_files_per_case_max: casesLimit(2e4).optional(),
|
|
15788
|
+
cases_comments_notes_per_case_max: casesLimit(2e4).optional(),
|
|
15789
|
+
cases_verdicts_per_case_max: casesLimit(5e4).optional(),
|
|
15790
|
+
cases_space_bytes_quota: casesLimit(1024 ** 4).optional(),
|
|
15791
|
+
cases_note_max_bytes: casesLimit(64 * 1024).optional(),
|
|
15792
|
+
cases_verdict_reason_max_bytes: casesLimit(16 * 1024).optional(),
|
|
15760
15793
|
/** How many automation gate evaluations bill one operation (`automationGateEvaluationsPerOperation`). */
|
|
15761
15794
|
automation_gate_evaluations_per_operation: automationGateEvaluationsPerOperation.optional(),
|
|
15762
15795
|
/** How many days a hub keeps an automation's runs (`automationRunRetentionDays`). */
|
|
@@ -16396,15 +16429,15 @@ var init_contracts = __esm({
|
|
|
16396
16429
|
init_chunk_MF2VVXBR();
|
|
16397
16430
|
init_chunk_IPXBFWUU();
|
|
16398
16431
|
init_chunk_P5GJNS5R();
|
|
16399
|
-
|
|
16432
|
+
init_chunk_5A4FBWQS();
|
|
16400
16433
|
init_chunk_ZC6YGHNX();
|
|
16401
16434
|
init_chunk_5DGHIY7L();
|
|
16402
16435
|
init_chunk_UVGO72D6();
|
|
16403
16436
|
init_chunk_IPDOHAZ5();
|
|
16404
16437
|
init_chunk_PFGVH2CX();
|
|
16405
16438
|
init_chunk_GPM7PE44();
|
|
16406
|
-
|
|
16407
|
-
|
|
16439
|
+
init_chunk_LMSJYN2R();
|
|
16440
|
+
init_chunk_ADED5YHZ();
|
|
16408
16441
|
init_chunk_ZXK6N2HN();
|
|
16409
16442
|
init_chunk_Y7CFCYX4();
|
|
16410
16443
|
init_chunk_MGBAXT5Y();
|
|
@@ -16434,17 +16467,17 @@ var init_contracts = __esm({
|
|
|
16434
16467
|
init_chunk_E4DIIOOE();
|
|
16435
16468
|
init_chunk_7CYHPF35();
|
|
16436
16469
|
init_chunk_NETRUHZF();
|
|
16437
|
-
|
|
16470
|
+
init_chunk_KXYJ46BM();
|
|
16438
16471
|
init_chunk_YI3ORIXJ();
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
|
|
16472
|
+
init_chunk_T6D3YZ6B();
|
|
16473
|
+
init_chunk_66EZQ7Y7();
|
|
16474
|
+
init_chunk_SDOG6762();
|
|
16442
16475
|
init_chunk_2YEGUQR7();
|
|
16443
16476
|
init_chunk_LBDH7LCG();
|
|
16444
16477
|
init_chunk_4LXDRTO4();
|
|
16445
16478
|
init_chunk_JDJ4EUOL();
|
|
16446
16479
|
init_chunk_NVKU5PPQ();
|
|
16447
|
-
|
|
16480
|
+
init_chunk_I3PBCSF4();
|
|
16448
16481
|
init_chunk_FECLIZTY();
|
|
16449
16482
|
init_chunk_BFG4ZWR4();
|
|
16450
16483
|
init_chunk_2R5D4TEX();
|
|
@@ -17873,6 +17906,7 @@ var init_utils = __esm({
|
|
|
17873
17906
|
["admin orgs repair-legacy-grants", { positionals: 0, values: ["--org"], dryRun: true }],
|
|
17874
17907
|
["admin vault import", { positionals: 0, values: ["--org", "--connector", "--max-puts", "--approved"] }],
|
|
17875
17908
|
["admin vault revert", { positionals: 0, values: ["--org", "--connector"] }],
|
|
17909
|
+
["admin vault base-dry-run", { positionals: 0, values: ["--org", "--base", "--after"] }],
|
|
17876
17910
|
["admin harness mass-destroy", { positionals: 0, values: ["--org", "--hub"], dryRun: true }],
|
|
17877
17911
|
["admin harness disable", { positionals: 0 }],
|
|
17878
17912
|
["admin harness enable", { positionals: 0 }],
|
|
@@ -17880,6 +17914,9 @@ var init_utils = __esm({
|
|
|
17880
17914
|
["admin threads enable", { positionals: 0 }],
|
|
17881
17915
|
["admin threads disable", { positionals: 0 }],
|
|
17882
17916
|
["admin threads status", { positionals: 0 }],
|
|
17917
|
+
["admin cases enable", { positionals: 0 }],
|
|
17918
|
+
["admin cases disable", { positionals: 0 }],
|
|
17919
|
+
["admin cases status", { positionals: 0 }],
|
|
17883
17920
|
["admin communities enable", { positionals: 0 }],
|
|
17884
17921
|
["admin communities disable", { positionals: 0 }],
|
|
17885
17922
|
["admin communities status", { positionals: 0 }],
|
|
@@ -19107,6 +19144,13 @@ var init_api_client = __esm({
|
|
|
19107
19144
|
async debugCounts(doType, doId) {
|
|
19108
19145
|
return this.request("GET", `/api/admin/data-explorer/debug/do/${doType}/${encodeURIComponent(doId)}/counts`);
|
|
19109
19146
|
}
|
|
19147
|
+
/** One page of an org's base-secrets dry run, or one base's: numbers, reason codes and ids. */
|
|
19148
|
+
async debugBaseVaultDryRun(query) {
|
|
19149
|
+
const params = new URLSearchParams({ org_id: query.org_id });
|
|
19150
|
+
if (query.base_id) params.set("base_id", query.base_id);
|
|
19151
|
+
if (query.after) params.set("after", query.after);
|
|
19152
|
+
return this.request("GET", `/api/admin/data-explorer/debug/base-vault-dry-run?${params.toString()}`);
|
|
19153
|
+
}
|
|
19110
19154
|
async debugListAnalyticsTables() {
|
|
19111
19155
|
return this.request("GET", "/api/admin/data-explorer/debug/analytics/tables");
|
|
19112
19156
|
}
|
|
@@ -21839,8 +21883,8 @@ var init_pages2 = __esm({
|
|
|
21839
21883
|
var init_evals = __esm({
|
|
21840
21884
|
"../../packages/core/dist/contracts/evals.js"() {
|
|
21841
21885
|
"use strict";
|
|
21842
|
-
|
|
21843
|
-
|
|
21886
|
+
init_chunk_66EZQ7Y7();
|
|
21887
|
+
init_chunk_SDOG6762();
|
|
21844
21888
|
init_chunk_2YEGUQR7();
|
|
21845
21889
|
init_chunk_4LXDRTO4();
|
|
21846
21890
|
init_chunk_WTOA3ANF();
|
|
@@ -22867,11 +22911,11 @@ var init_hub_materializer = __esm({
|
|
|
22867
22911
|
var init_ci = __esm({
|
|
22868
22912
|
"../../packages/core/dist/contracts/ci.js"() {
|
|
22869
22913
|
"use strict";
|
|
22870
|
-
|
|
22914
|
+
init_chunk_KXYJ46BM();
|
|
22871
22915
|
init_chunk_YI3ORIXJ();
|
|
22872
|
-
|
|
22873
|
-
|
|
22874
|
-
|
|
22916
|
+
init_chunk_T6D3YZ6B();
|
|
22917
|
+
init_chunk_66EZQ7Y7();
|
|
22918
|
+
init_chunk_SDOG6762();
|
|
22875
22919
|
init_chunk_2YEGUQR7();
|
|
22876
22920
|
init_chunk_LBDH7LCG();
|
|
22877
22921
|
init_chunk_4LXDRTO4();
|
|
@@ -37697,6 +37741,107 @@ var init_file_map = __esm({
|
|
|
37697
37741
|
}
|
|
37698
37742
|
});
|
|
37699
37743
|
|
|
37744
|
+
// ../../packages/core/dist/contracts/vault-import.js
|
|
37745
|
+
var VAULT_IMPORT_DEFAULT_PUTS, VAULT_IMPORT_MAX_PUTS, VAULT_IMPORT_MAX_APPROVED, vaultImportRunBody, vaultImportRevertBody, dryRunKey, dryRunCount, dryRunCounts, dryRunTable, baseVaultDryRunReport, BASE_VAULT_DRY_RUN_UNREADABLE, dryRunBaseId, baseVaultDryRunBase, BASE_VAULT_DRY_RUN_LISTINGS, baseVaultDryRunPage, baseVaultDryRunQuery;
|
|
37746
|
+
var init_vault_import = __esm({
|
|
37747
|
+
"../../packages/core/dist/contracts/vault-import.js"() {
|
|
37748
|
+
"use strict";
|
|
37749
|
+
init_chunk_HZ6CADSY();
|
|
37750
|
+
init_zod();
|
|
37751
|
+
VAULT_IMPORT_DEFAULT_PUTS = 25;
|
|
37752
|
+
VAULT_IMPORT_MAX_PUTS = 100;
|
|
37753
|
+
VAULT_IMPORT_MAX_APPROVED = 1e3;
|
|
37754
|
+
vaultImportRunBody = external_exports.object({
|
|
37755
|
+
org_id: uuidSchema,
|
|
37756
|
+
/** A catalog `connector_id` the vault holds fields of. */
|
|
37757
|
+
connector_id: external_exports.string().min(1).max(128),
|
|
37758
|
+
dry_run: external_exports.boolean().optional().default(true),
|
|
37759
|
+
max_puts: external_exports.number().int().min(1).max(VAULT_IMPORT_MAX_PUTS).optional().default(VAULT_IMPORT_DEFAULT_PUTS),
|
|
37760
|
+
/**
|
|
37761
|
+
* REST API, External Resources and MCP Server only, and required for their real run: the `policy_hash` of each
|
|
37762
|
+
* value a dry run listed that the owner approved (`VaultImportPolicyEntry`). Any other value stays (`not_approved`).
|
|
37763
|
+
*/
|
|
37764
|
+
approved_policies: external_exports.array(external_exports.string().regex(/^[0-9a-f]{64}$/)).max(VAULT_IMPORT_MAX_APPROVED).optional()
|
|
37765
|
+
}).strict();
|
|
37766
|
+
vaultImportRevertBody = vaultImportRunBody.omit({ max_puts: true, approved_policies: true });
|
|
37767
|
+
dryRunKey = external_exports.string().regex(/^[a-z][a-z0-9_]{0,63}$/);
|
|
37768
|
+
dryRunCount = external_exports.number().int().nonnegative();
|
|
37769
|
+
dryRunCounts = external_exports.record(dryRunKey, dryRunCount);
|
|
37770
|
+
dryRunTable = external_exports.record(dryRunKey, dryRunCounts);
|
|
37771
|
+
baseVaultDryRunReport = external_exports.strictObject({
|
|
37772
|
+
stores: dryRunTable,
|
|
37773
|
+
would_move: dryRunCounts,
|
|
37774
|
+
would_refuse: dryRunTable
|
|
37775
|
+
});
|
|
37776
|
+
BASE_VAULT_DRY_RUN_UNREADABLE = ["overloaded", "timeout", "error"];
|
|
37777
|
+
dryRunBaseId = external_exports.string().min(1).max(512);
|
|
37778
|
+
baseVaultDryRunBase = external_exports.discriminatedUnion("status", [
|
|
37779
|
+
external_exports.strictObject({ base_id: dryRunBaseId, status: external_exports.literal("read"), report: baseVaultDryRunReport }),
|
|
37780
|
+
external_exports.strictObject({ base_id: dryRunBaseId, status: external_exports.literal("absent") }),
|
|
37781
|
+
external_exports.strictObject({ base_id: dryRunBaseId, status: external_exports.literal("unreadable"), reason: external_exports.enum(BASE_VAULT_DRY_RUN_UNREADABLE) })
|
|
37782
|
+
]);
|
|
37783
|
+
BASE_VAULT_DRY_RUN_LISTINGS = ["named", "registry", "registry_not_seeded"];
|
|
37784
|
+
baseVaultDryRunPage = external_exports.strictObject({
|
|
37785
|
+
org_id: external_exports.string().min(1).max(128),
|
|
37786
|
+
listing: external_exports.enum(BASE_VAULT_DRY_RUN_LISTINGS),
|
|
37787
|
+
bases: external_exports.array(baseVaultDryRunBase).max(50),
|
|
37788
|
+
next_after: dryRunBaseId.nullable()
|
|
37789
|
+
});
|
|
37790
|
+
baseVaultDryRunQuery = external_exports.object({
|
|
37791
|
+
org_id: uuidSchema,
|
|
37792
|
+
/** A base id as the CLI sends one: it names a Durable Object and nothing else. */
|
|
37793
|
+
base_id: external_exports.string().regex(/^(?!\.\.?$)[A-Za-z0-9._-]{1,256}$/).optional(),
|
|
37794
|
+
after: dryRunBaseId.optional()
|
|
37795
|
+
}).refine((query) => !(query.base_id && query.after), { message: "base_id and after cannot be combined" });
|
|
37796
|
+
}
|
|
37797
|
+
});
|
|
37798
|
+
|
|
37799
|
+
// src/lib/base-vault-dry-run.ts
|
|
37800
|
+
function addCounts(into, from) {
|
|
37801
|
+
for (const [key, value] of Object.entries(from)) {
|
|
37802
|
+
if (typeof value === "number") {
|
|
37803
|
+
into[key] = (into[key] ?? 0) + value;
|
|
37804
|
+
} else {
|
|
37805
|
+
into[key] ??= {};
|
|
37806
|
+
addCounts(into[key], value);
|
|
37807
|
+
}
|
|
37808
|
+
}
|
|
37809
|
+
}
|
|
37810
|
+
function summarizeBaseVaultDryRun(input) {
|
|
37811
|
+
const bases = input.pages.flatMap((page) => page.bases);
|
|
37812
|
+
const totals = { stores: {}, would_move: {}, would_refuse: {} };
|
|
37813
|
+
for (const base of bases) {
|
|
37814
|
+
if (base.status === "read") addCounts(totals, base.report);
|
|
37815
|
+
}
|
|
37816
|
+
const count = (status) => bases.filter((base) => base.status === status).length;
|
|
37817
|
+
const nextAfter = input.pages.at(-1)?.next_after ?? null;
|
|
37818
|
+
const reasons = [];
|
|
37819
|
+
if (input.resumedAfter) reasons.push("resumed_from_cursor");
|
|
37820
|
+
if (input.pages.some((page) => page.listing === "named")) reasons.push("single_base");
|
|
37821
|
+
if (nextAfter !== null) reasons.push("listing_truncated");
|
|
37822
|
+
if (count("unreadable") > 0) reasons.push("base_unreadable");
|
|
37823
|
+
if (input.pages.some((page) => page.listing === "registry_not_seeded")) reasons.push("registry_not_seeded");
|
|
37824
|
+
if (input.stop) reasons.push(input.stop);
|
|
37825
|
+
return {
|
|
37826
|
+
org_id: input.orgId,
|
|
37827
|
+
complete: reasons.length === 0,
|
|
37828
|
+
incomplete_reasons: reasons,
|
|
37829
|
+
reads: input.pages.length,
|
|
37830
|
+
bases_listed: bases.length,
|
|
37831
|
+
bases_read: count("read"),
|
|
37832
|
+
bases_absent: count("absent"),
|
|
37833
|
+
bases_unreadable: count("unreadable"),
|
|
37834
|
+
totals,
|
|
37835
|
+
next_after: nextAfter,
|
|
37836
|
+
bases
|
|
37837
|
+
};
|
|
37838
|
+
}
|
|
37839
|
+
var init_base_vault_dry_run = __esm({
|
|
37840
|
+
"src/lib/base-vault-dry-run.ts"() {
|
|
37841
|
+
"use strict";
|
|
37842
|
+
}
|
|
37843
|
+
});
|
|
37844
|
+
|
|
37700
37845
|
// src/commands/admin.ts
|
|
37701
37846
|
var admin_exports = {};
|
|
37702
37847
|
__export(admin_exports, {
|
|
@@ -37919,6 +38064,9 @@ async function adminCommand(args2) {
|
|
|
37919
38064
|
case "revert":
|
|
37920
38065
|
await runVaultRevert(flagArgs);
|
|
37921
38066
|
return;
|
|
38067
|
+
case "base-dry-run":
|
|
38068
|
+
await runVaultBaseDryRun(flagArgs);
|
|
38069
|
+
return;
|
|
37922
38070
|
default:
|
|
37923
38071
|
printHelp2();
|
|
37924
38072
|
process.exit(1);
|
|
@@ -37967,6 +38115,26 @@ async function adminCommand(args2) {
|
|
|
37967
38115
|
process.exit(1);
|
|
37968
38116
|
}
|
|
37969
38117
|
}
|
|
38118
|
+
if (group === "cases") {
|
|
38119
|
+
if (!sub) {
|
|
38120
|
+
printHelp2();
|
|
38121
|
+
process.exit(1);
|
|
38122
|
+
}
|
|
38123
|
+
switch (sub) {
|
|
38124
|
+
case "enable":
|
|
38125
|
+
await runCasesToggle(true, flagArgs);
|
|
38126
|
+
return;
|
|
38127
|
+
case "disable":
|
|
38128
|
+
await runCasesToggle(false, flagArgs);
|
|
38129
|
+
return;
|
|
38130
|
+
case "status":
|
|
38131
|
+
await runPlatformGateStatus(CASES_GATE, flagArgs);
|
|
38132
|
+
return;
|
|
38133
|
+
default:
|
|
38134
|
+
printHelp2();
|
|
38135
|
+
process.exit(1);
|
|
38136
|
+
}
|
|
38137
|
+
}
|
|
37970
38138
|
if (group === "communities") {
|
|
37971
38139
|
if (!sub) {
|
|
37972
38140
|
printHelp2();
|
|
@@ -38691,6 +38859,73 @@ async function runVaultImport(flagArgs) {
|
|
|
38691
38859
|
}
|
|
38692
38860
|
printVaultReport(data);
|
|
38693
38861
|
}
|
|
38862
|
+
async function runVaultBaseDryRun(flagArgs) {
|
|
38863
|
+
const USAGE8 = "wayai admin vault base-dry-run --org <org_id> [--base <base_id>] [--after <base_id>] [--json]";
|
|
38864
|
+
let orgId;
|
|
38865
|
+
let baseId;
|
|
38866
|
+
let after;
|
|
38867
|
+
let jsonOutput = false;
|
|
38868
|
+
for (let i = 0; i < flagArgs.length; i++) {
|
|
38869
|
+
const flag = flagArgs[i];
|
|
38870
|
+
if (flag === "--org") orgId = requireFlagValue(flagArgs, ++i, "--org");
|
|
38871
|
+
else if (flag === "--base") baseId = requireFlagValue(flagArgs, ++i, "--base");
|
|
38872
|
+
else if (flag === "--after") after = requireFlagValue(flagArgs, ++i, "--after");
|
|
38873
|
+
else if (flag === "--json") jsonOutput = true;
|
|
38874
|
+
else {
|
|
38875
|
+
console.error(`Unknown flag: ${flag}`);
|
|
38876
|
+
console.error(USAGE8);
|
|
38877
|
+
process.exit(1);
|
|
38878
|
+
}
|
|
38879
|
+
}
|
|
38880
|
+
const query = baseVaultDryRunQuery.safeParse({ org_id: orgId, base_id: baseId, after });
|
|
38881
|
+
if (!query.success) {
|
|
38882
|
+
console.error("--org must be an organization id, --base a base id, and --base and --after cannot be combined.");
|
|
38883
|
+
console.error(USAGE8);
|
|
38884
|
+
process.exit(1);
|
|
38885
|
+
}
|
|
38886
|
+
const { config, accessToken } = await requireAuth();
|
|
38887
|
+
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
38888
|
+
const pages = [];
|
|
38889
|
+
let stop;
|
|
38890
|
+
let cursor = after;
|
|
38891
|
+
do {
|
|
38892
|
+
try {
|
|
38893
|
+
const { data } = await client.debugBaseVaultDryRun({ ...query.data, after: cursor });
|
|
38894
|
+
pages.push(data);
|
|
38895
|
+
cursor = data.next_after ?? void 0;
|
|
38896
|
+
} catch (err) {
|
|
38897
|
+
const limited = err instanceof ApiError && err.status === 429;
|
|
38898
|
+
if (pages.length === 0 && !limited) {
|
|
38899
|
+
exitOnApiError(err);
|
|
38900
|
+
throw err;
|
|
38901
|
+
}
|
|
38902
|
+
stop = limited ? "rate_limited" : "request_failed";
|
|
38903
|
+
break;
|
|
38904
|
+
}
|
|
38905
|
+
} while (cursor);
|
|
38906
|
+
const summary = summarizeBaseVaultDryRun({ orgId: query.data.org_id, pages, resumedAfter: after, stop });
|
|
38907
|
+
const gotItsBase = summary.bases_read === 1 && summary.incomplete_reasons.every((reason) => reason === "single_base");
|
|
38908
|
+
if (!summary.complete && !gotItsBase) process.exitCode = 1;
|
|
38909
|
+
if (jsonOutput) {
|
|
38910
|
+
console.log(JSON.stringify(summary, null, 2));
|
|
38911
|
+
return;
|
|
38912
|
+
}
|
|
38913
|
+
const notSeeded = summary.incomplete_reasons.includes("registry_not_seeded");
|
|
38914
|
+
console.log(`base vault dry run \u2014 org ${summary.org_id} \u2014 ${summary.complete ? "complete" : `INCOMPLETE, not the org's total (${summary.incomplete_reasons.join(", ")})`}`);
|
|
38915
|
+
console.log(`reads: ${summary.reads} of the 120/hour cap`);
|
|
38916
|
+
console.log(`bases: listed ${summary.bases_listed}, read ${summary.bases_read}, absent ${summary.bases_absent}, unreadable ${summary.bases_unreadable}`);
|
|
38917
|
+
if (notSeeded) console.log("This org's base registry has never been filled; listing its bases once fills it. Re-run after.");
|
|
38918
|
+
if (stop || summary.next_after) {
|
|
38919
|
+
console.log(summary.next_after ? `To continue: --after ${summary.next_after}` : "Nothing read past the start; re-run later.");
|
|
38920
|
+
}
|
|
38921
|
+
const nonZero = (value) => flattenCounts(value).filter((line) => !line.endsWith(": 0"));
|
|
38922
|
+
console.log("totals (non-zero):");
|
|
38923
|
+
for (const line of nonZero(summary.totals)) console.log(` ${line}`);
|
|
38924
|
+
for (const base of summary.bases) {
|
|
38925
|
+
console.log(`${base.base_id}: ${base.status === "unreadable" ? `unreadable (${base.reason})` : base.status}`);
|
|
38926
|
+
if (base.status === "read") for (const line of nonZero(base.report)) console.log(` ${line}`);
|
|
38927
|
+
}
|
|
38928
|
+
}
|
|
38694
38929
|
async function runVaultRevert(flagArgs) {
|
|
38695
38930
|
const USAGE8 = "wayai admin vault revert --org <org_id> --connector <connector_id> [--apply] [--yes] [--json]";
|
|
38696
38931
|
const { orgId, connectorId, apply, yes, jsonOutput } = parseVaultFlags(flagArgs, USAGE8, false);
|
|
@@ -39021,6 +39256,10 @@ async function runThreadsToggle(enable, flagArgs) {
|
|
|
39021
39256
|
}
|
|
39022
39257
|
console.log(PLATFORM_CONFIG_PROPAGATION_NOTE);
|
|
39023
39258
|
}
|
|
39259
|
+
async function runCasesToggle(enable, flagArgs) {
|
|
39260
|
+
await runPlatformGateToggle(CASES_GATE, enable, flagArgs);
|
|
39261
|
+
console.log(PLATFORM_CONFIG_PROPAGATION_NOTE);
|
|
39262
|
+
}
|
|
39024
39263
|
async function runCommunitiesToggle(enable, flagArgs) {
|
|
39025
39264
|
await runPlatformGateToggle(COMMUNITIES_GATE, enable, flagArgs);
|
|
39026
39265
|
if (enable) {
|
|
@@ -39995,6 +40234,10 @@ Usage:
|
|
|
39995
40234
|
wayai admin threads disable Flip it OFF: every /api/contacts route answers 404
|
|
39996
40235
|
wayai admin threads status Print the kill switch
|
|
39997
40236
|
|
|
40237
|
+
wayai admin cases enable Flip the platform cases_enabled kill switch ON
|
|
40238
|
+
wayai admin cases disable Flip it OFF
|
|
40239
|
+
wayai admin cases status Print the kill switch
|
|
40240
|
+
|
|
39998
40241
|
wayai admin communities enable Flip the platform communities_enabled kill switch ON (members reach communities while threads is ON too)
|
|
39999
40242
|
wayai admin communities disable Flip it OFF: no member reaches a community
|
|
40000
40243
|
wayai admin communities status Print the kill switch
|
|
@@ -40008,6 +40251,9 @@ Usage:
|
|
|
40008
40251
|
wayai admin guide clear [--json] Turn the Guide off: nobody new is enrolled and the help entry is hidden
|
|
40009
40252
|
wayai admin guide status [--json] Print which hub is the Guide, and its facts
|
|
40010
40253
|
|
|
40254
|
+
wayai admin vault base-dry-run --org <org_id> [--base <base_id>] [--after <base_id>] [--json]
|
|
40255
|
+
What moving an org's base secrets to the vault would do: counts and reason codes per base, and the sum over the bases read. Reads only. One read per 50 bases (or one for --base), one sleeping base woken per base read: by hand, never scheduled. Marks and exits non-zero on any partial result (a base unreadable, the budget hit, a resumed run)
|
|
40256
|
+
|
|
40011
40257
|
wayai admin vault-gate status [--json] Print the connectors whose new credentials go to the credentials vault
|
|
40012
40258
|
wayai admin vault-gate add <connector> [--yes] [--json]
|
|
40013
40259
|
List a connector: a vault connector's name (e.g. telegram, whatsapp, instagram, or openai for its LLM, STT and TTS ids, never GPT-Live's) or one catalog id (GPT-Live's only so); prints before and after, confirms unless --yes
|
|
@@ -40101,6 +40347,9 @@ Sources:
|
|
|
40101
40347
|
(\`enable\`/\`disable\`) for contacts, direct messages and groups between
|
|
40102
40348
|
people. Off, every /api/contacts route answers 404. Changes land within
|
|
40103
40349
|
about 60 s.
|
|
40350
|
+
cases The cases gate, default-deny: the PLATFORM-wide cases_enabled switch
|
|
40351
|
+
(\`enable\`/\`disable\`), independent of threads. Changes land within about
|
|
40352
|
+
60 s.
|
|
40104
40353
|
communities Org-owned communities. \`enable\`/\`disable\` flip the PLATFORM-wide
|
|
40105
40354
|
communities_enabled switch, default-deny and nested in threads: members
|
|
40106
40355
|
reach a community only while both switches are on. \`create\` makes a
|
|
@@ -40156,7 +40405,7 @@ Audit + rate limit:
|
|
|
40156
40405
|
across all sources. Platform-admin grant required.
|
|
40157
40406
|
`.trim());
|
|
40158
40407
|
}
|
|
40159
|
-
var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE, VOICE_CALLS_GATE, THREADS_GATE, COMMUNITIES_GATE, PLATFORM_CONFIG_PROPAGATION_NOTE, VAULT_GATE_CONNECTORS, VAULT_GATE_BY_ID_ONLY, VALID_NOTICE_SEVERITIES;
|
|
40408
|
+
var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE, VOICE_CALLS_GATE, THREADS_GATE, COMMUNITIES_GATE, CASES_GATE, PLATFORM_CONFIG_PROPAGATION_NOTE, VAULT_GATE_CONNECTORS, VAULT_GATE_BY_ID_ONLY, VALID_NOTICE_SEVERITIES;
|
|
40160
40409
|
var init_admin = __esm({
|
|
40161
40410
|
"src/commands/admin.ts"() {
|
|
40162
40411
|
"use strict";
|
|
@@ -40170,6 +40419,8 @@ var init_admin = __esm({
|
|
|
40170
40419
|
init_file_map();
|
|
40171
40420
|
init_errors3();
|
|
40172
40421
|
init_contracts();
|
|
40422
|
+
init_vault_import();
|
|
40423
|
+
init_base_vault_dry_run();
|
|
40173
40424
|
VALID_TYPES = dataExplorerDebugDoType.options;
|
|
40174
40425
|
VALID_ANALYTICS_TABLES = dataExplorerDebugAnalyticsTable.options;
|
|
40175
40426
|
HARNESS_GATE = {
|
|
@@ -40196,6 +40447,12 @@ var init_admin = __esm({
|
|
|
40196
40447
|
label: "communities kill switch",
|
|
40197
40448
|
displayName: "Communities"
|
|
40198
40449
|
};
|
|
40450
|
+
CASES_GATE = {
|
|
40451
|
+
group: "cases",
|
|
40452
|
+
key: "cases_enabled",
|
|
40453
|
+
label: "cases kill switch",
|
|
40454
|
+
displayName: "Cases"
|
|
40455
|
+
};
|
|
40199
40456
|
PLATFORM_CONFIG_PROPAGATION_NOTE = "Takes effect within about 60 s (the platform-config cache is dropped; KV deletes propagate eventually).";
|
|
40200
40457
|
VAULT_GATE_CONNECTORS = /* @__PURE__ */ new Map([
|
|
40201
40458
|
["telegram", ["a1b2c3d4-e5f6-4a89-b012-3e5e0d000002"]],
|