@noresponse/mcp 0.4.12 → 0.5.1

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/bin/mcp-server.js CHANGED
@@ -48104,9 +48104,9 @@ var init_config = __esm(() => {
48104
48104
  SDK_METADATA = {
48105
48105
  language: "typescript",
48106
48106
  openapiDocVersion: "1",
48107
- sdkVersion: "0.4.12",
48107
+ sdkVersion: "0.5.1",
48108
48108
  genVersion: "internal",
48109
- userAgent: "noresponse-sdk/mcp-typescript 0.4.12 internal 1 @noresponse/mcp"
48109
+ userAgent: "noresponse-sdk/mcp-typescript 0.5.1 internal 1 @noresponse/mcp"
48110
48110
  };
48111
48111
  });
48112
48112
 
@@ -51200,7 +51200,9 @@ var init_conflicterrorcode = __esm(() => {
51200
51200
  "webhook_endpoint_limit_reached",
51201
51201
  "webhook_endpoint_unverified",
51202
51202
  "too_many_integrations",
51203
- "risk_version_ahead"
51203
+ "risk_version_ahead",
51204
+ "key_limit_reached",
51205
+ "self_revocation"
51204
51206
  ]).describe("Machine codes an HTTP 409 answer can carry.");
51205
51207
  });
51206
51208
 
@@ -51254,7 +51256,8 @@ var PermissionDeniedErrorCode$zodSchema;
51254
51256
  var init_permissiondeniederrorcode = __esm(() => {
51255
51257
  init_zod();
51256
51258
  PermissionDeniedErrorCode$zodSchema = _enum([
51257
- "workspace_forbidden"
51259
+ "workspace_forbidden",
51260
+ "role_forbidden"
51258
51261
  ]).describe("Machine codes an HTTP 403 answer can carry.");
51259
51262
  });
51260
51263
 
@@ -52424,7 +52427,7 @@ var init_listaccountsop = __esm(() => {
52424
52427
  ListAccountsRequest$zodSchema = object({
52425
52428
  changed_since: string2().describe("next_cursor from an earlier page, unchanged. Absent, the list starts from the oldest change.").optional(),
52426
52429
  limit: int().default(50).describe("Most accounts per page."),
52427
- unenforced: boolean2().default(false).describe("true lists only accounts with a decision other than allow for some flow and no applied enforcement at their current risk_version.")
52430
+ unenforced: boolean2().default(false).describe("true lists only accounts with no applied enforcement at their current risk_version that have a decision other than allow for some flow or a hold no later applied enforcement resolved.")
52428
52431
  });
52429
52432
  ListAccountsResponseResult$zodSchema = union([
52430
52433
  BadRequestError$zodSchema,
@@ -52579,8 +52582,9 @@ var init_enforcementaction = __esm(() => {
52579
52582
  "unrestrict",
52580
52583
  "fail_onboarding",
52581
52584
  "reject_activation",
52585
+ "activate",
52582
52586
  "none"
52583
- ]).describe("What the workspace did in its identity provider: revoke_sessions (signed the account out everywhere), restrict (limited what the account can do), unrestrict (lifted an earlier restriction), fail_onboarding (stopped an account that was still onboarding), reject_activation (refused to activate a provisional account) or none (decided to take no action).");
52587
+ ]).describe("What the workspace did in its identity provider: revoke_sessions (signed the account out everywhere), restrict (limited what the account can do), unrestrict (lifted an earlier restriction), fail_onboarding (stopped an account that was still onboarding), reject_activation (refused to activate a provisional account), activate (let a held onboarding or provisional account in) or none (decided to take no action).");
52584
52588
  });
52585
52589
 
52586
52590
  // src/models/enforcementprovider.ts
@@ -52629,7 +52633,7 @@ var init_enforcement = __esm(() => {
52629
52633
  init_flow();
52630
52634
  Enforcement$zodSchema = object({
52631
52635
  account_id: string2().describe("The account_id of the request path."),
52632
- action: EnforcementAction$zodSchema.describe("What the workspace did in its identity provider: revoke_sessions (signed the account out everywhere), restrict (limited what the account can do), unrestrict (lifted an earlier restriction), fail_onboarding (stopped an account that was still onboarding), reject_activation (refused to activate a provisional account) or none (decided to take no action)."),
52636
+ action: EnforcementAction$zodSchema.describe("What the workspace did in its identity provider: revoke_sessions (signed the account out everywhere), restrict (limited what the account can do), unrestrict (lifted an earlier restriction), fail_onboarding (stopped an account that was still onboarding), reject_activation (refused to activate a provisional account), activate (let a held onboarding or provisional account in) or none (decided to take no action)."),
52633
52637
  created_at: string2().describe("When NoResponse first recorded this enforcement, in UTC. A failed record that becomes applied keeps it."),
52634
52638
  error_code: string2().optional().describe("Why a failed action failed, as a short code of the workspace's choosing (lower-case letters, digits, '_', '.' and '-'), such as the identity provider's error code. Allowed only with status failed: with status applied it answers 400 invalid_request. Keep personal data out of it."),
52635
52639
  flow: Flow$zodSchema.describe("The event an assessment is made for: account_creation (a user creates an account), login (a user returns to an existing account) or purchase (a payment or a credit grant). The account's risk is reported with the decision for this flow."),
@@ -52651,7 +52655,7 @@ var init_enforcementrequest = __esm(() => {
52651
52655
  init_enforcementstatus();
52652
52656
  init_flow();
52653
52657
  EnforcementRequest$zodSchema = object({
52654
- action: EnforcementAction$zodSchema.describe("What the workspace did in its identity provider: revoke_sessions (signed the account out everywhere), restrict (limited what the account can do), unrestrict (lifted an earlier restriction), fail_onboarding (stopped an account that was still onboarding), reject_activation (refused to activate a provisional account) or none (decided to take no action)."),
52658
+ action: EnforcementAction$zodSchema.describe("What the workspace did in its identity provider: revoke_sessions (signed the account out everywhere), restrict (limited what the account can do), unrestrict (lifted an earlier restriction), fail_onboarding (stopped an account that was still onboarding), reject_activation (refused to activate a provisional account), activate (let a held onboarding or provisional account in) or none (decided to take no action)."),
52655
52659
  error_code: string2().optional().describe("Why a failed action failed, as a short code of the workspace's choosing (lower-case letters, digits, '_', '.' and '-'), such as the identity provider's error code. Allowed only with status failed: with status applied it answers 400 invalid_request. Keep personal data out of it."),
52656
52660
  flow: Flow$zodSchema.describe("The event an assessment is made for: account_creation (a user creates an account), login (a user returns to an existing account) or purchase (a payment or a credit grant). The account's risk is reported with the decision for this flow."),
52657
52661
  provider: EnforcementProvider$zodSchema.describe("The identity provider the action ran in; custom for the workspace's own user store."),
@@ -54231,6 +54235,857 @@ For Auth0, send {} and the answer's secret is the new shared secret, shown once.
54231
54235
  };
54232
54236
  });
54233
54237
 
54238
+ // src/models/keyenvironment.ts
54239
+ var KeyEnvironment$zodSchema;
54240
+ var init_keyenvironment = __esm(() => {
54241
+ init_zod();
54242
+ KeyEnvironment$zodSchema = _enum([
54243
+ "live",
54244
+ "test"
54245
+ ]).describe("The environment the key belongs to. A live key assesses with live sources; a test key answers from the deterministic simulator.");
54246
+ });
54247
+
54248
+ // src/models/keystatus.ts
54249
+ var KeyStatus$zodSchema;
54250
+ var init_keystatus = __esm(() => {
54251
+ init_zod();
54252
+ KeyStatus$zodSchema = _enum([
54253
+ "active",
54254
+ "expired",
54255
+ "revoked"
54256
+ ]).describe("active: the key authenticates. expired: a rotation's overlap window has ended (expires_at). revoked: the key was revoked (revoked_at) and answers 401.");
54257
+ });
54258
+
54259
+ // src/models/key.ts
54260
+ var KeyScope$zodSchema, Key$zodSchema;
54261
+ var init_key = __esm(() => {
54262
+ init_zod();
54263
+ init_keyenvironment();
54264
+ init_keystatus();
54265
+ KeyScope$zodSchema = _enum([
54266
+ "assess",
54267
+ "history",
54268
+ "delete",
54269
+ "webhooks",
54270
+ "detailed",
54271
+ "integrations",
54272
+ "management"
54273
+ ]);
54274
+ Key$zodSchema = object({
54275
+ created_at: string2(),
54276
+ created_by: string2().optional().describe("The external user id of the member who created the key through the console, or the prefix (nrk_<environment>_<key id>) of the management key that created it. Absent for a key NoResponse issued or a rotation made."),
54277
+ environment: KeyEnvironment$zodSchema.describe("The environment the key belongs to. A live key assesses with live sources; a test key answers from the deterministic simulator."),
54278
+ expires_at: string2().optional().describe("When a rotated key stops authenticating (POST /v1/keys/rotate). Absent for a key with no end."),
54279
+ id: string2().describe("The key's public id, a 26-character ULID."),
54280
+ key: string2().optional().describe("The credential, nrk_<environment>_<key id>_<secret>. Present only in the 201 answer that created the key."),
54281
+ prefix: string2().describe("The public start of the credential, nrk_<environment>_<key id>, which identifies the key in logs and secret stores without its secret."),
54282
+ revoked_at: string2().optional(),
54283
+ revoked_by: string2().optional().describe("The external user id of the member who revoked the key through the console, or the prefix of the management key that revoked it. Absent when the key is not revoked or NoResponse revoked it."),
54284
+ scopes: array(KeyScope$zodSchema).describe("The key's scopes, each at most once."),
54285
+ status: KeyStatus$zodSchema.describe("active: the key authenticates. expired: a rotation's overlap window has ended (expires_at). revoked: the key was revoked (revoked_at) and answers 401."),
54286
+ workspace_id: string2().describe("The workspace id, which is also its live environment's workspace id; the test environment's is the same id with :test appended. A workspace created through the API is tnt_ and a 26-character ULID.")
54287
+ }).describe("One API key of your workspace. A key belongs to exactly one environment. key, the secret credential, is present only in the answer that created the key: NoResponse keeps a peppered digest of it, so store it now. Every other field is safe to show.");
54288
+ });
54289
+
54290
+ // src/models/keylist.ts
54291
+ var KeyList$zodSchema;
54292
+ var init_keylist = __esm(() => {
54293
+ init_zod();
54294
+ init_key();
54295
+ KeyList$zodSchema = object({
54296
+ items: array(Key$zodSchema)
54297
+ }).describe("GET /v1/workspaces/{workspace_id}/keys: the keys of both of the workspace's environments, newest first, at most 200 of each, revoked and expired keys included. No item carries a secret.");
54298
+ });
54299
+
54300
+ // src/models/listkeysop.ts
54301
+ var ListKeysRequest$zodSchema, ListKeysResponseResult$zodSchema, ListKeysResponse$zodSchema;
54302
+ var init_listkeysop = __esm(() => {
54303
+ init_zod();
54304
+ init_authenticationerror();
54305
+ init_badrequesterror();
54306
+ init_conflicterror();
54307
+ init_keylist();
54308
+ init_notfounderror();
54309
+ init_permissiondeniederror();
54310
+ init_ratelimiterror();
54311
+ ListKeysRequest$zodSchema = object({
54312
+ workspace_id: string2().describe("Your workspace id, as each key lists it in workspace_id. Another workspace, a malformed id and a test environment's id answer 404.")
54313
+ });
54314
+ ListKeysResponseResult$zodSchema = union([
54315
+ BadRequestError$zodSchema,
54316
+ AuthenticationError$zodSchema,
54317
+ PermissionDeniedError$zodSchema,
54318
+ NotFoundError$zodSchema,
54319
+ ConflictError$zodSchema,
54320
+ RateLimitError$zodSchema,
54321
+ KeyList$zodSchema
54322
+ ]);
54323
+ ListKeysResponse$zodSchema = object({
54324
+ Headers: record(string2(), array(string2())).default({}),
54325
+ Result: union([
54326
+ BadRequestError$zodSchema,
54327
+ AuthenticationError$zodSchema,
54328
+ PermissionDeniedError$zodSchema,
54329
+ NotFoundError$zodSchema,
54330
+ ConflictError$zodSchema,
54331
+ RateLimitError$zodSchema,
54332
+ KeyList$zodSchema
54333
+ ])
54334
+ });
54335
+ });
54336
+
54337
+ // src/funcs/keysList.ts
54338
+ function keysList(client$, request, options) {
54339
+ return new APIPromise($do15(client$, request, options));
54340
+ }
54341
+ async function $do15(client$, request, options) {
54342
+ const parsed$ = safeParse2(request, (value$) => ListKeysRequest$zodSchema.parse(value$), "Input validation failed");
54343
+ if (!parsed$.ok) {
54344
+ return [parsed$, { status: "invalid" }];
54345
+ }
54346
+ const payload$ = parsed$.value;
54347
+ const body$ = null;
54348
+ const pathParams$ = {
54349
+ workspace_id: encodeSimple("workspace_id", payload$.workspace_id, {
54350
+ explode: false,
54351
+ charEncoding: "percent"
54352
+ })
54353
+ };
54354
+ const path$ = pathToFunc("/v1/workspaces/{workspace_id}/keys")(pathParams$);
54355
+ const headers$ = new Headers(compactMap({
54356
+ Accept: options?.acceptHeaderOverride || "application/json;q=1, application/problem+json;q=0"
54357
+ }));
54358
+ const securityInput = await extractSecurity(client$._options.security);
54359
+ const requestSecurity = resolveGlobalSecurity(securityInput);
54360
+ const context = {
54361
+ options: client$._options,
54362
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
54363
+ operationID: "listKeys",
54364
+ oAuth2Scopes: null,
54365
+ resolvedSecurity: requestSecurity,
54366
+ securitySource: client$._options.security,
54367
+ retryConfig: options?.retries || client$._options.retryConfig || {
54368
+ strategy: "backoff",
54369
+ backoff: {
54370
+ initialInterval: 500,
54371
+ maxInterval: 8000,
54372
+ exponent: 2,
54373
+ maxElapsedTime: 30000
54374
+ },
54375
+ retryConnectionErrors: true
54376
+ },
54377
+ retryCodes: options?.retryCodes || [
54378
+ "408",
54379
+ "429",
54380
+ "5XX"
54381
+ ]
54382
+ };
54383
+ const requestRes = client$._createRequest(context, {
54384
+ security: requestSecurity,
54385
+ method: "GET",
54386
+ baseURL: options?.serverURL,
54387
+ path: path$,
54388
+ headers: headers$,
54389
+ body: body$,
54390
+ userAgent: client$._options.userAgent,
54391
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
54392
+ }, options);
54393
+ if (!requestRes.ok) {
54394
+ return [requestRes, { status: "invalid" }];
54395
+ }
54396
+ const req$ = requestRes.value;
54397
+ const doResult = await client$._do(req$, {
54398
+ context,
54399
+ errorCodes: [],
54400
+ retryConfig: context.retryConfig,
54401
+ retryCodes: context.retryCodes
54402
+ });
54403
+ if (!doResult.ok) {
54404
+ return [doResult, { status: "request-error", request: req$ }];
54405
+ }
54406
+ return [doResult, {
54407
+ status: "complete",
54408
+ request: req$,
54409
+ response: doResult.value
54410
+ }];
54411
+ }
54412
+ var init_keysList = __esm(() => {
54413
+ init_encodings();
54414
+ init_primitives();
54415
+ init_schemas3();
54416
+ init_security();
54417
+ init_url();
54418
+ init_listkeysop();
54419
+ init_async();
54420
+ });
54421
+
54422
+ // src/mcp-server/tools/keysList.ts
54423
+ var args15, tool$keysList;
54424
+ var init_keysList2 = __esm(() => {
54425
+ init_keysList();
54426
+ init_listkeysop();
54427
+ init_tools();
54428
+ args15 = {
54429
+ request: ListKeysRequest$zodSchema
54430
+ };
54431
+ tool$keysList = {
54432
+ name: "list_keys",
54433
+ description: `List API keys.
54434
+
54435
+ Lists the keys of the signing key's environment, newest first, at most 200, revoked and expired keys included, without secrets: each key's id, prefix, scopes, status, and who created and revoked it. Requires the management scope. Read-only and safe to retry.`,
54436
+ annotations: {
54437
+ title: "List the API keys of this environment",
54438
+ destructiveHint: false,
54439
+ idempotentHint: true,
54440
+ openWorldHint: false,
54441
+ readOnlyHint: true
54442
+ },
54443
+ args: args15,
54444
+ tool: async (client, args, ctx) => {
54445
+ const [result] = await keysList(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
54446
+ if (!result.ok) {
54447
+ return {
54448
+ content: [{ type: "text", text: result.error.message }],
54449
+ isError: true
54450
+ };
54451
+ }
54452
+ return formatResult(result.value);
54453
+ }
54454
+ };
54455
+ });
54456
+
54457
+ // src/models/revokekeyop.ts
54458
+ var RevokeKeyRequest$zodSchema, RevokeKeyResponseResult$zodSchema, RevokeKeyResponse$zodSchema;
54459
+ var init_revokekeyop = __esm(() => {
54460
+ init_zod();
54461
+ init_authenticationerror();
54462
+ init_badrequesterror();
54463
+ init_conflicterror();
54464
+ init_key();
54465
+ init_notfounderror();
54466
+ init_permissiondeniederror();
54467
+ init_ratelimiterror();
54468
+ RevokeKeyRequest$zodSchema = object({
54469
+ key_id: string2().describe("The key's id. A key of another workspace answers 404, as does a key of the other environment to an API key."),
54470
+ workspace_id: string2().describe("Your workspace id, as each key lists it in workspace_id. Another workspace, a malformed id and a test environment's id answer 404.")
54471
+ });
54472
+ RevokeKeyResponseResult$zodSchema = union([
54473
+ Key$zodSchema,
54474
+ BadRequestError$zodSchema,
54475
+ AuthenticationError$zodSchema,
54476
+ PermissionDeniedError$zodSchema,
54477
+ NotFoundError$zodSchema,
54478
+ ConflictError$zodSchema,
54479
+ RateLimitError$zodSchema
54480
+ ]);
54481
+ RevokeKeyResponse$zodSchema = object({
54482
+ Headers: record(string2(), array(string2())).default({}),
54483
+ Result: union([
54484
+ Key$zodSchema,
54485
+ BadRequestError$zodSchema,
54486
+ AuthenticationError$zodSchema,
54487
+ PermissionDeniedError$zodSchema,
54488
+ NotFoundError$zodSchema,
54489
+ ConflictError$zodSchema,
54490
+ RateLimitError$zodSchema
54491
+ ])
54492
+ });
54493
+ });
54494
+
54495
+ // src/funcs/keysRevoke.ts
54496
+ function keysRevoke(client$, request, options) {
54497
+ return new APIPromise($do16(client$, request, options));
54498
+ }
54499
+ async function $do16(client$, request, options) {
54500
+ const parsed$ = safeParse2(request, (value$) => RevokeKeyRequest$zodSchema.parse(value$), "Input validation failed");
54501
+ if (!parsed$.ok) {
54502
+ return [parsed$, { status: "invalid" }];
54503
+ }
54504
+ const payload$ = parsed$.value;
54505
+ const body$ = null;
54506
+ const pathParams$ = {
54507
+ key_id: encodeSimple("key_id", payload$.key_id, {
54508
+ explode: false,
54509
+ charEncoding: "percent"
54510
+ }),
54511
+ workspace_id: encodeSimple("workspace_id", payload$.workspace_id, {
54512
+ explode: false,
54513
+ charEncoding: "percent"
54514
+ })
54515
+ };
54516
+ const path$ = pathToFunc("/v1/workspaces/{workspace_id}/keys/{key_id}")(pathParams$);
54517
+ const headers$ = new Headers(compactMap({
54518
+ Accept: options?.acceptHeaderOverride || "application/json;q=1, application/problem+json;q=0"
54519
+ }));
54520
+ const securityInput = await extractSecurity(client$._options.security);
54521
+ const requestSecurity = resolveGlobalSecurity(securityInput);
54522
+ const context = {
54523
+ options: client$._options,
54524
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
54525
+ operationID: "revokeKey",
54526
+ oAuth2Scopes: null,
54527
+ resolvedSecurity: requestSecurity,
54528
+ securitySource: client$._options.security,
54529
+ retryConfig: options?.retries || client$._options.retryConfig || {
54530
+ strategy: "backoff",
54531
+ backoff: {
54532
+ initialInterval: 500,
54533
+ maxInterval: 8000,
54534
+ exponent: 2,
54535
+ maxElapsedTime: 30000
54536
+ },
54537
+ retryConnectionErrors: true
54538
+ },
54539
+ retryCodes: options?.retryCodes || [
54540
+ "408",
54541
+ "429",
54542
+ "5XX"
54543
+ ]
54544
+ };
54545
+ const requestRes = client$._createRequest(context, {
54546
+ security: requestSecurity,
54547
+ method: "DELETE",
54548
+ baseURL: options?.serverURL,
54549
+ path: path$,
54550
+ headers: headers$,
54551
+ body: body$,
54552
+ userAgent: client$._options.userAgent,
54553
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
54554
+ }, options);
54555
+ if (!requestRes.ok) {
54556
+ return [requestRes, { status: "invalid" }];
54557
+ }
54558
+ const req$ = requestRes.value;
54559
+ const doResult = await client$._do(req$, {
54560
+ context,
54561
+ errorCodes: [],
54562
+ retryConfig: context.retryConfig,
54563
+ retryCodes: context.retryCodes
54564
+ });
54565
+ if (!doResult.ok) {
54566
+ return [doResult, { status: "request-error", request: req$ }];
54567
+ }
54568
+ return [doResult, {
54569
+ status: "complete",
54570
+ request: req$,
54571
+ response: doResult.value
54572
+ }];
54573
+ }
54574
+ var init_keysRevoke = __esm(() => {
54575
+ init_encodings();
54576
+ init_primitives();
54577
+ init_schemas3();
54578
+ init_security();
54579
+ init_url();
54580
+ init_revokekeyop();
54581
+ init_async();
54582
+ });
54583
+
54584
+ // src/mcp-server/tools/keysRevoke.ts
54585
+ var args16, tool$keysRevoke;
54586
+ var init_keysRevoke2 = __esm(() => {
54587
+ init_keysRevoke();
54588
+ init_revokekeyop();
54589
+ init_tools();
54590
+ args16 = {
54591
+ request: RevokeKeyRequest$zodSchema
54592
+ };
54593
+ tool$keysRevoke = {
54594
+ name: "revoke_key",
54595
+ description: `Revoke an API key.
54596
+
54597
+ Revokes a key of the signing key's environment at once: its next request answers 401. Requires the management scope. A key of the other environment or of another workspace answers 404 not_found. A key cannot revoke itself (409 self_revocation): rotate it with keys.rotate, or revoke it with another management key. Revoking a revoked key changes nothing and answers the key as it was revoked, so a retry is safe.`,
54598
+ annotations: {
54599
+ title: "Revoke an API key of this environment",
54600
+ destructiveHint: true,
54601
+ idempotentHint: true,
54602
+ openWorldHint: false,
54603
+ readOnlyHint: false
54604
+ },
54605
+ args: args16,
54606
+ tool: async (client, args, ctx) => {
54607
+ const [result] = await keysRevoke(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
54608
+ if (!result.ok) {
54609
+ return {
54610
+ content: [{ type: "text", text: result.error.message }],
54611
+ isError: true
54612
+ };
54613
+ }
54614
+ return formatResult(result.value);
54615
+ }
54616
+ };
54617
+ });
54618
+
54619
+ // src/models/admission.ts
54620
+ var Admission$zodSchema;
54621
+ var init_admission = __esm(() => {
54622
+ init_zod();
54623
+ Admission$zodSchema = _enum([
54624
+ "immediate",
54625
+ "held"
54626
+ ]).describe("immediate (the default): an assessment of this flow is decided from the evidence its answer has, and later evidence may change the decision. held: while the account's current assessment of this flow has not completed, the account's decision for the flow is held, and the final decision arrives as account.risk_changed when the investigation completes or hold_seconds pass, whichever is first. Each flow has its own admission.");
54627
+ });
54628
+
54629
+ // src/models/defaultdepth.ts
54630
+ var DefaultDepth$zodSchema;
54631
+ var init_defaultdepth = __esm(() => {
54632
+ init_zod();
54633
+ DefaultDepth$zodSchema = _enum([
54634
+ "quick",
54635
+ "full"
54636
+ ]).describe("The depth a request for this flow that names none is served at. Defaults: full for account_creation and purchase, quick for login.");
54637
+ });
54638
+
54639
+ // src/models/onexpiry.ts
54640
+ var OnExpiry$zodSchema;
54641
+ var init_onexpiry = __esm(() => {
54642
+ init_zod();
54643
+ OnExpiry$zodSchema = _enum([
54644
+ "allow",
54645
+ "review",
54646
+ "block"
54647
+ ]).describe("The decision a held assessment takes when hold_seconds pass before its investigation completes, unless the evidence so far gives a stricter one (default review). It is announced as account.risk_changed like any other change, so an expired hold is always announced. A hosted provider hook, which cannot wait, answers a held account by it at once: deny for block, allow otherwise. Kept while the flow is immediate.");
54648
+ });
54649
+
54650
+ // src/models/flowsettings.ts
54651
+ var FlowSettings$zodSchema;
54652
+ var init_flowsettings = __esm(() => {
54653
+ init_zod();
54654
+ init_admission();
54655
+ init_defaultdepth();
54656
+ init_onexpiry();
54657
+ FlowSettings$zodSchema = object({
54658
+ admission: Admission$zodSchema.describe("immediate (the default): an assessment of this flow is decided from the evidence its answer has, and later evidence may change the decision. held: while the account's current assessment of this flow has not completed, the account's decision for the flow is held, and the final decision arrives as account.risk_changed when the investigation completes or hold_seconds pass, whichever is first. Each flow has its own admission."),
54659
+ block: int().optional().describe("The score from which the decision is block. Absent while blocking is off, the default."),
54660
+ default_depth: DefaultDepth$zodSchema.describe("The depth a request for this flow that names none is served at. Defaults: full for account_creation and purchase, quick for login."),
54661
+ hold_seconds: int().describe("How long a held flow's assessment is held after it was created, 30 to 86400 seconds (default 300). Kept while the flow is immediate."),
54662
+ inherits_account_creation: boolean2().describe("true while this flow has no thresholds of its own and uses account_creation's, the default for login and purchase. Always false for signup."),
54663
+ on_expiry: OnExpiry$zodSchema.describe("The decision a held assessment takes when hold_seconds pass before its investigation completes, unless the evidence so far gives a stricter one (default review). It is announced as account.risk_changed like any other change, so an expired hold is always announced. A hosted provider hook, which cannot wait, answers a held account by it at once: deny for block, allow otherwise. Kept while the flow is immediate."),
54664
+ review: int(),
54665
+ step_up: int()
54666
+ }).describe("One flow's policy in force. A score below step_up is allow, below review step_up, and from review review; from block, when present, the decision is block. admission says when the flow's decision is final.");
54667
+ });
54668
+
54669
+ // src/models/settingsflows.ts
54670
+ var SettingsFlows$zodSchema;
54671
+ var init_settingsflows = __esm(() => {
54672
+ init_zod();
54673
+ init_flowsettings();
54674
+ SettingsFlows$zodSchema = object({
54675
+ account_creation: FlowSettings$zodSchema.describe("One flow's policy in force. A score below step_up is allow, below review step_up, and from review review; from block, when present, the decision is block. admission says when the flow's decision is final."),
54676
+ login: FlowSettings$zodSchema.describe("One flow's policy in force. A score below step_up is allow, below review step_up, and from review review; from block, when present, the decision is block. admission says when the flow's decision is final."),
54677
+ purchase: FlowSettings$zodSchema.describe("One flow's policy in force. A score below step_up is allow, below review step_up, and from review review; from block, when present, the decision is block. admission says when the flow's decision is final.")
54678
+ });
54679
+ });
54680
+
54681
+ // src/models/sourceid.ts
54682
+ var SourceId$zodSchema;
54683
+ var init_sourceid = __esm(() => {
54684
+ init_zod();
54685
+ SourceId$zodSchema = _enum([
54686
+ "github",
54687
+ "phone",
54688
+ "breach",
54689
+ "rdap",
54690
+ "mx",
54691
+ "ipintel"
54692
+ ]).describe("A NoResponse source: github (GitHub accounts), phone (the phone lookup), breach (breach exposure), rdap (the email domain's registration), mx (the email domain's mail servers) or ipintel (IP intelligence).");
54693
+ });
54694
+
54695
+ // src/models/settings.ts
54696
+ var Settings$zodSchema;
54697
+ var init_settings = __esm(() => {
54698
+ init_zod();
54699
+ init_keyenvironment();
54700
+ init_settingsflows();
54701
+ init_sourceid();
54702
+ Settings$zodSchema = object({
54703
+ environment: KeyEnvironment$zodSchema.describe("The environment the key belongs to. A live key assesses with live sources; a test key answers from the deterministic simulator."),
54704
+ flows: SettingsFlows$zodSchema,
54705
+ policy_version: int().describe("How many times this environment's policy has changed; 0 while the defaults apply. A served risk.policy_version ends in +t<policy_version> once it is above 0."),
54706
+ refused_sources: array(SourceId$zodSchema).describe("The sources this environment refuses, sorted; empty, the default, refuses none. An assessment leaves a refused source out: its coverage is missing (an identifier with no other source lists coverage-unavailable as unavailable) rather than not_found, and a stored result of a refused source is not reused."),
54707
+ retention_days: int().describe("Days an assessment is kept after it is created, 1 to 365 (default 365). Shortening hides older assessments at once."),
54708
+ updated_at: string2().optional().describe("When the policy last changed. Absent while the defaults apply."),
54709
+ updated_by: string2().optional().describe("Who last changed the policy: the member's external user id for a change made through the console, the prefix (nrk_<environment>_<key id>) of the management key that made it, or NoResponse. Absent while the defaults apply."),
54710
+ workspace_id: string2().describe("The workspace id, which is also its live environment's workspace id; the test environment's is the same id with :test appended. A workspace created through the API is tnt_ and a 26-character ULID.")
54711
+ }).describe("One environment's settings: how long its assessments are kept, and for each flow the risk thresholds that decide it and the depth a request that names none is served at, and the sources it refuses. Live and test each have their own. A flow without thresholds of its own uses account_creation's (inherits_account_creation). Every change is recorded in the audit log as settings.updated, with who made it.");
54712
+ });
54713
+
54714
+ // src/models/getsettingsop.ts
54715
+ var GetSettingsRequest$zodSchema, GetSettingsResponseResult$zodSchema, GetSettingsResponse$zodSchema;
54716
+ var init_getsettingsop = __esm(() => {
54717
+ init_zod();
54718
+ init_authenticationerror();
54719
+ init_badrequesterror();
54720
+ init_conflicterror();
54721
+ init_keyenvironment();
54722
+ init_notfounderror();
54723
+ init_permissiondeniederror();
54724
+ init_ratelimiterror();
54725
+ init_settings();
54726
+ GetSettingsRequest$zodSchema = object({
54727
+ environment: KeyEnvironment$zodSchema.describe("The environment: live or test. Each has its own settings. Any other value answers 400. An API key reads and changes only its own environment's; the other answers 404."),
54728
+ workspace_id: string2().describe("Your workspace id, as each key lists it in workspace_id. Another workspace, a malformed id and a test environment's id answer 404.")
54729
+ });
54730
+ GetSettingsResponseResult$zodSchema = union([
54731
+ Settings$zodSchema,
54732
+ BadRequestError$zodSchema,
54733
+ AuthenticationError$zodSchema,
54734
+ PermissionDeniedError$zodSchema,
54735
+ NotFoundError$zodSchema,
54736
+ ConflictError$zodSchema,
54737
+ RateLimitError$zodSchema
54738
+ ]);
54739
+ GetSettingsResponse$zodSchema = object({
54740
+ Headers: record(string2(), array(string2())).default({}),
54741
+ Result: union([
54742
+ Settings$zodSchema,
54743
+ BadRequestError$zodSchema,
54744
+ AuthenticationError$zodSchema,
54745
+ PermissionDeniedError$zodSchema,
54746
+ NotFoundError$zodSchema,
54747
+ ConflictError$zodSchema,
54748
+ RateLimitError$zodSchema
54749
+ ])
54750
+ });
54751
+ });
54752
+
54753
+ // src/funcs/settingsGet.ts
54754
+ function settingsGet(client$, request, options) {
54755
+ return new APIPromise($do17(client$, request, options));
54756
+ }
54757
+ async function $do17(client$, request, options) {
54758
+ const parsed$ = safeParse2(request, (value$) => GetSettingsRequest$zodSchema.parse(value$), "Input validation failed");
54759
+ if (!parsed$.ok) {
54760
+ return [parsed$, { status: "invalid" }];
54761
+ }
54762
+ const payload$ = parsed$.value;
54763
+ const body$ = null;
54764
+ const pathParams$ = {
54765
+ environment: encodeSimple("environment", payload$.environment, {
54766
+ explode: false,
54767
+ charEncoding: "percent"
54768
+ }),
54769
+ workspace_id: encodeSimple("workspace_id", payload$.workspace_id, {
54770
+ explode: false,
54771
+ charEncoding: "percent"
54772
+ })
54773
+ };
54774
+ const path$ = pathToFunc("/v1/workspaces/{workspace_id}/settings/{environment}")(pathParams$);
54775
+ const headers$ = new Headers(compactMap({
54776
+ Accept: options?.acceptHeaderOverride || "application/json;q=1, application/problem+json;q=0"
54777
+ }));
54778
+ const securityInput = await extractSecurity(client$._options.security);
54779
+ const requestSecurity = resolveGlobalSecurity(securityInput);
54780
+ const context = {
54781
+ options: client$._options,
54782
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
54783
+ operationID: "getSettings",
54784
+ oAuth2Scopes: null,
54785
+ resolvedSecurity: requestSecurity,
54786
+ securitySource: client$._options.security,
54787
+ retryConfig: options?.retries || client$._options.retryConfig || {
54788
+ strategy: "backoff",
54789
+ backoff: {
54790
+ initialInterval: 500,
54791
+ maxInterval: 8000,
54792
+ exponent: 2,
54793
+ maxElapsedTime: 30000
54794
+ },
54795
+ retryConnectionErrors: true
54796
+ },
54797
+ retryCodes: options?.retryCodes || [
54798
+ "408",
54799
+ "429",
54800
+ "5XX"
54801
+ ]
54802
+ };
54803
+ const requestRes = client$._createRequest(context, {
54804
+ security: requestSecurity,
54805
+ method: "GET",
54806
+ baseURL: options?.serverURL,
54807
+ path: path$,
54808
+ headers: headers$,
54809
+ body: body$,
54810
+ userAgent: client$._options.userAgent,
54811
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
54812
+ }, options);
54813
+ if (!requestRes.ok) {
54814
+ return [requestRes, { status: "invalid" }];
54815
+ }
54816
+ const req$ = requestRes.value;
54817
+ const doResult = await client$._do(req$, {
54818
+ context,
54819
+ errorCodes: [],
54820
+ retryConfig: context.retryConfig,
54821
+ retryCodes: context.retryCodes
54822
+ });
54823
+ if (!doResult.ok) {
54824
+ return [doResult, { status: "request-error", request: req$ }];
54825
+ }
54826
+ return [doResult, {
54827
+ status: "complete",
54828
+ request: req$,
54829
+ response: doResult.value
54830
+ }];
54831
+ }
54832
+ var init_settingsGet = __esm(() => {
54833
+ init_encodings();
54834
+ init_primitives();
54835
+ init_schemas3();
54836
+ init_security();
54837
+ init_url();
54838
+ init_getsettingsop();
54839
+ init_async();
54840
+ });
54841
+
54842
+ // src/mcp-server/tools/settingsGet.ts
54843
+ var args17, tool$settingsGet;
54844
+ var init_settingsGet2 = __esm(() => {
54845
+ init_settingsGet();
54846
+ init_getsettingsop();
54847
+ init_tools();
54848
+ args17 = {
54849
+ request: GetSettingsRequest$zodSchema
54850
+ };
54851
+ tool$settingsGet = {
54852
+ name: "get_settings",
54853
+ description: `Read an environment's settings.
54854
+
54855
+ Reads the settings of the signing key's environment: retention in days; per flow (account_creation, login, purchase) the step_up, review and block thresholds, the default depth and the admission; and the sources the environment refuses. A flow without thresholds of its own shows account_creation's with inherits_account_creation true. Requires the management scope; the other environment answers 404 not_found. Read-only and safe to retry.`,
54856
+ annotations: {
54857
+ title: "Read this environment's settings",
54858
+ destructiveHint: false,
54859
+ idempotentHint: true,
54860
+ openWorldHint: false,
54861
+ readOnlyHint: true
54862
+ },
54863
+ args: args17,
54864
+ tool: async (client, args, ctx) => {
54865
+ const [result] = await settingsGet(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
54866
+ if (!result.ok) {
54867
+ return {
54868
+ content: [{ type: "text", text: result.error.message }],
54869
+ isError: true
54870
+ };
54871
+ }
54872
+ return formatResult(result.value);
54873
+ }
54874
+ };
54875
+ });
54876
+
54877
+ // src/models/flowchange.ts
54878
+ var FlowChange$zodSchema;
54879
+ var init_flowchange = __esm(() => {
54880
+ init_zod();
54881
+ init_admission();
54882
+ init_defaultdepth();
54883
+ init_onexpiry();
54884
+ FlowChange$zodSchema = object({
54885
+ admission: Admission$zodSchema.optional().describe("immediate (the default): an assessment of this flow is decided from the evidence its answer has, and later evidence may change the decision. held: while the account's current assessment of this flow has not completed, the account's decision for the flow is held, and the final decision arrives as account.risk_changed when the investigation completes or hold_seconds pass, whichever is first. Each flow has its own admission."),
54886
+ block: int().nullable().optional().describe("The score from which the decision is block; null turns blocking off."),
54887
+ default_depth: DefaultDepth$zodSchema.optional().describe("The depth a request for this flow that names none is served at. Defaults: full for account_creation and purchase, quick for login."),
54888
+ hold_seconds: int().optional().describe("How long a held flow's assessment is held after it was created, 30 to 86400 seconds (default 300). Kept while the flow is immediate."),
54889
+ inherits_account_creation: boolean2().optional().describe("Login or purchase only: drop the flow's own thresholds so it uses account_creation's again. Not combined with step_up, review or block. Send true; false is refused."),
54890
+ inherits_signup: boolean2().optional().describe("Alias of inherits_account_creation, still accepted. Send true; false is refused."),
54891
+ on_expiry: OnExpiry$zodSchema.optional().describe("The decision a held assessment takes when hold_seconds pass before its investigation completes, unless the evidence so far gives a stricter one (default review). It is announced as account.risk_changed like any other change, so an expired hold is always announced. A hosted provider hook, which cannot wait, answers a held account by it at once: deny for block, allow otherwise. Kept while the flow is immediate."),
54892
+ review: int().optional(),
54893
+ step_up: int().optional()
54894
+ }).describe("A change to one flow. A field left out keeps the value in force. Thresholds set on login or purchase start from the values in force, account_creation's while it inherits them. After the change, 0 < step_up < review <= 100 and block is off or review <= block <= 100.");
54895
+ });
54896
+
54897
+ // src/models/settingsrequestflows.ts
54898
+ var SettingsRequestFlows$zodSchema;
54899
+ var init_settingsrequestflows = __esm(() => {
54900
+ init_zod();
54901
+ init_flowchange();
54902
+ SettingsRequestFlows$zodSchema = object({
54903
+ account_creation: FlowChange$zodSchema.optional().describe("A change to one flow. A field left out keeps the value in force. Thresholds set on login or purchase start from the values in force, account_creation's while it inherits them. After the change, 0 < step_up < review <= 100 and block is off or review <= block <= 100."),
54904
+ login: FlowChange$zodSchema.optional().describe("A change to one flow. A field left out keeps the value in force. Thresholds set on login or purchase start from the values in force, account_creation's while it inherits them. After the change, 0 < step_up < review <= 100 and block is off or review <= block <= 100."),
54905
+ purchase: FlowChange$zodSchema.optional().describe("A change to one flow. A field left out keeps the value in force. Thresholds set on login or purchase start from the values in force, account_creation's while it inherits them. After the change, 0 < step_up < review <= 100 and block is off or review <= block <= 100."),
54906
+ signup: FlowChange$zodSchema.optional().describe("A change to one flow. A field left out keeps the value in force. Thresholds set on login or purchase start from the values in force, account_creation's while it inherits them. After the change, 0 < step_up < review <= 100 and block is off or review <= block <= 100.")
54907
+ }).describe("Use account_creation or its deprecated alias signup, not both.");
54908
+ });
54909
+
54910
+ // src/models/settingsrequest.ts
54911
+ var SettingsRequest$zodSchema;
54912
+ var init_settingsrequest = __esm(() => {
54913
+ init_zod();
54914
+ init_settingsrequestflows();
54915
+ init_sourceid();
54916
+ SettingsRequest$zodSchema = object({
54917
+ flows: SettingsRequestFlows$zodSchema.optional().describe("Use account_creation or its deprecated alias signup, not both."),
54918
+ refused_sources: array(SourceId$zodSchema).optional().describe("Replaces the refused sources; [] refuses none. A change applies to new assessments within a minute."),
54919
+ retention_days: int().optional()
54920
+ }).describe("PATCH /v1/workspaces/{workspace_id}/settings/{environment} body. Changes only what it names, in one transaction; a policy change is one new policy_version. Needs the admin or owner role, or an API key with the management scope for its own environment.");
54921
+ });
54922
+
54923
+ // src/models/updatesettingsop.ts
54924
+ var UpdateSettingsRequest$zodSchema, UpdateSettingsResponseResult$zodSchema, UpdateSettingsResponse$zodSchema;
54925
+ var init_updatesettingsop = __esm(() => {
54926
+ init_zod();
54927
+ init_authenticationerror();
54928
+ init_badrequesterror();
54929
+ init_conflicterror();
54930
+ init_keyenvironment();
54931
+ init_notfounderror();
54932
+ init_permissiondeniederror();
54933
+ init_ratelimiterror();
54934
+ init_settings();
54935
+ init_settingsrequest();
54936
+ UpdateSettingsRequest$zodSchema = object({
54937
+ body: SettingsRequest$zodSchema,
54938
+ environment: KeyEnvironment$zodSchema.describe("The environment: live or test. Each has its own settings. Any other value answers 400. An API key reads and changes only its own environment's; the other answers 404."),
54939
+ workspace_id: string2().describe("Your workspace id, as each key lists it in workspace_id. Another workspace, a malformed id and a test environment's id answer 404.")
54940
+ });
54941
+ UpdateSettingsResponseResult$zodSchema = union([
54942
+ Settings$zodSchema,
54943
+ BadRequestError$zodSchema,
54944
+ AuthenticationError$zodSchema,
54945
+ PermissionDeniedError$zodSchema,
54946
+ NotFoundError$zodSchema,
54947
+ ConflictError$zodSchema,
54948
+ RateLimitError$zodSchema
54949
+ ]);
54950
+ UpdateSettingsResponse$zodSchema = object({
54951
+ Headers: record(string2(), array(string2())).default({}),
54952
+ Result: union([
54953
+ Settings$zodSchema,
54954
+ BadRequestError$zodSchema,
54955
+ AuthenticationError$zodSchema,
54956
+ PermissionDeniedError$zodSchema,
54957
+ NotFoundError$zodSchema,
54958
+ ConflictError$zodSchema,
54959
+ RateLimitError$zodSchema
54960
+ ])
54961
+ });
54962
+ });
54963
+
54964
+ // src/funcs/settingsUpdate.ts
54965
+ function settingsUpdate(client$, request, options) {
54966
+ return new APIPromise($do18(client$, request, options));
54967
+ }
54968
+ async function $do18(client$, request, options) {
54969
+ const parsed$ = safeParse2(request, (value$) => UpdateSettingsRequest$zodSchema.parse(value$), "Input validation failed");
54970
+ if (!parsed$.ok) {
54971
+ return [parsed$, { status: "invalid" }];
54972
+ }
54973
+ const payload$ = parsed$.value;
54974
+ const body$ = encodeJSON("body", payload$.body, { explode: true });
54975
+ const pathParams$ = {
54976
+ environment: encodeSimple("environment", payload$.environment, {
54977
+ explode: false,
54978
+ charEncoding: "percent"
54979
+ }),
54980
+ workspace_id: encodeSimple("workspace_id", payload$.workspace_id, {
54981
+ explode: false,
54982
+ charEncoding: "percent"
54983
+ })
54984
+ };
54985
+ const path$ = pathToFunc("/v1/workspaces/{workspace_id}/settings/{environment}")(pathParams$);
54986
+ const headers$ = new Headers(compactMap({
54987
+ "Content-Type": "application/json",
54988
+ Accept: options?.acceptHeaderOverride || "application/json;q=1, application/problem+json;q=0"
54989
+ }));
54990
+ const securityInput = await extractSecurity(client$._options.security);
54991
+ const requestSecurity = resolveGlobalSecurity(securityInput);
54992
+ const context = {
54993
+ options: client$._options,
54994
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
54995
+ operationID: "updateSettings",
54996
+ oAuth2Scopes: null,
54997
+ resolvedSecurity: requestSecurity,
54998
+ securitySource: client$._options.security,
54999
+ retryConfig: options?.retries || client$._options.retryConfig || {
55000
+ strategy: "backoff",
55001
+ backoff: {
55002
+ initialInterval: 500,
55003
+ maxInterval: 8000,
55004
+ exponent: 2,
55005
+ maxElapsedTime: 30000
55006
+ },
55007
+ retryConnectionErrors: true
55008
+ },
55009
+ retryCodes: options?.retryCodes || [
55010
+ "408",
55011
+ "429",
55012
+ "5XX"
55013
+ ]
55014
+ };
55015
+ const requestRes = client$._createRequest(context, {
55016
+ security: requestSecurity,
55017
+ method: "PATCH",
55018
+ baseURL: options?.serverURL,
55019
+ path: path$,
55020
+ headers: headers$,
55021
+ body: body$,
55022
+ userAgent: client$._options.userAgent,
55023
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
55024
+ }, options);
55025
+ if (!requestRes.ok) {
55026
+ return [requestRes, { status: "invalid" }];
55027
+ }
55028
+ const req$ = requestRes.value;
55029
+ const doResult = await client$._do(req$, {
55030
+ context,
55031
+ errorCodes: [],
55032
+ retryConfig: context.retryConfig,
55033
+ retryCodes: context.retryCodes
55034
+ });
55035
+ if (!doResult.ok) {
55036
+ return [doResult, { status: "request-error", request: req$ }];
55037
+ }
55038
+ return [doResult, {
55039
+ status: "complete",
55040
+ request: req$,
55041
+ response: doResult.value
55042
+ }];
55043
+ }
55044
+ var init_settingsUpdate = __esm(() => {
55045
+ init_encodings();
55046
+ init_primitives();
55047
+ init_schemas3();
55048
+ init_security();
55049
+ init_url();
55050
+ init_updatesettingsop();
55051
+ init_async();
55052
+ });
55053
+
55054
+ // src/mcp-server/tools/settingsUpdate.ts
55055
+ var args18, tool$settingsUpdate;
55056
+ var init_settingsUpdate2 = __esm(() => {
55057
+ init_settingsUpdate();
55058
+ init_updatesettingsop();
55059
+ init_tools();
55060
+ args18 = {
55061
+ request: UpdateSettingsRequest$zodSchema
55062
+ };
55063
+ tool$settingsUpdate = {
55064
+ name: "update_settings",
55065
+ description: `Change an environment's settings.
55066
+
55067
+ Changes only what the body names, in one transaction: retention_days, refused_sources, and per flow step_up, review, block (null turns blocking off), default_depth, admission, hold_seconds, on_expiry, or inherits_account_creation to return login or purchase to account_creation's thresholds. After the change each flow keeps 0 < step_up < review <= 100 and block off or review <= block <= 100; a change that breaks it answers 400 naming the flow. A policy change is one new policy_version with the signing key's prefix as updated_by, and every change is recorded in the workspace's audit log with the key as its actor. Requires the management scope; the other environment answers 404 not_found. A change reaches assessments within a minute.`,
55068
+ annotations: {
55069
+ title: "Change this environment's settings",
55070
+ destructiveHint: false,
55071
+ idempotentHint: false,
55072
+ openWorldHint: false,
55073
+ readOnlyHint: false
55074
+ },
55075
+ args: args18,
55076
+ tool: async (client, args, ctx) => {
55077
+ const [result] = await settingsUpdate(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
55078
+ if (!result.ok) {
55079
+ return {
55080
+ content: [{ type: "text", text: result.error.message }],
55081
+ isError: true
55082
+ };
55083
+ }
55084
+ return formatResult(result.value);
55085
+ }
55086
+ };
55087
+ });
55088
+
54234
55089
  // src/models/webhookendpointrequest.ts
54235
55090
  var WebhookEndpointRequest$zodSchema;
54236
55091
  var init_webhookendpointrequest = __esm(() => {
@@ -54244,9 +55099,9 @@ var init_webhookendpointrequest = __esm(() => {
54244
55099
 
54245
55100
  // src/funcs/webhookEndpointsCreate.ts
54246
55101
  function webhookEndpointsCreate(client$, request, options) {
54247
- return new APIPromise($do15(client$, request, options));
55102
+ return new APIPromise($do19(client$, request, options));
54248
55103
  }
54249
- async function $do15(client$, request, options) {
55104
+ async function $do19(client$, request, options) {
54250
55105
  const parsed$ = safeParse2(request, (value$) => WebhookEndpointRequest$zodSchema.parse(value$), "Input validation failed");
54251
55106
  if (!parsed$.ok) {
54252
55107
  return [parsed$, { status: "invalid" }];
@@ -54310,12 +55165,12 @@ var init_webhookEndpointsCreate = __esm(() => {
54310
55165
  });
54311
55166
 
54312
55167
  // src/mcp-server/tools/webhookEndpointsCreate.ts
54313
- var args15, tool$webhookEndpointsCreate;
55168
+ var args19, tool$webhookEndpointsCreate;
54314
55169
  var init_webhookEndpointsCreate2 = __esm(() => {
54315
55170
  init_webhookEndpointsCreate();
54316
55171
  init_webhookendpointrequest();
54317
55172
  init_tools();
54318
- args15 = {
55173
+ args19 = {
54319
55174
  request: WebhookEndpointRequest$zodSchema
54320
55175
  };
54321
55176
  tool$webhookEndpointsCreate = {
@@ -54330,7 +55185,7 @@ Registers a webhook endpoint and returns it with its first signing secret, shown
54330
55185
  openWorldHint: false,
54331
55186
  readOnlyHint: false
54332
55187
  },
54333
- args: args15,
55188
+ args: args19,
54334
55189
  tool: async (client, args, ctx) => {
54335
55190
  const [result] = await webhookEndpointsCreate(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
54336
55191
  if (!result.ok) {
@@ -54380,9 +55235,9 @@ var init_deletewebhookendpointop = __esm(() => {
54380
55235
 
54381
55236
  // src/funcs/webhookEndpointsDelete.ts
54382
55237
  function webhookEndpointsDelete(client$, request, options) {
54383
- return new APIPromise($do16(client$, request, options));
55238
+ return new APIPromise($do20(client$, request, options));
54384
55239
  }
54385
- async function $do16(client$, request, options) {
55240
+ async function $do20(client$, request, options) {
54386
55241
  const parsed$ = safeParse2(request, (value$) => DeleteWebhookEndpointRequest$zodSchema.parse(value$), "Input validation failed");
54387
55242
  if (!parsed$.ok) {
54388
55243
  return [parsed$, { status: "invalid" }];
@@ -54464,12 +55319,12 @@ var init_webhookEndpointsDelete = __esm(() => {
54464
55319
  });
54465
55320
 
54466
55321
  // src/mcp-server/tools/webhookEndpointsDelete.ts
54467
- var args16, tool$webhookEndpointsDelete;
55322
+ var args20, tool$webhookEndpointsDelete;
54468
55323
  var init_webhookEndpointsDelete2 = __esm(() => {
54469
55324
  init_webhookEndpointsDelete();
54470
55325
  init_deletewebhookendpointop();
54471
55326
  init_tools();
54472
- args16 = {
55327
+ args20 = {
54473
55328
  request: DeleteWebhookEndpointRequest$zodSchema
54474
55329
  };
54475
55330
  tool$webhookEndpointsDelete = {
@@ -54484,7 +55339,7 @@ Deletes the endpoint and its signing keys. Deliveries still queued for it are dr
54484
55339
  openWorldHint: false,
54485
55340
  readOnlyHint: false
54486
55341
  },
54487
- args: args16,
55342
+ args: args20,
54488
55343
  tool: async (client, args, ctx) => {
54489
55344
  const [result] = await webhookEndpointsDelete(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
54490
55345
  if (!result.ok) {
@@ -54500,9 +55355,9 @@ Deletes the endpoint and its signing keys. Deliveries still queued for it are dr
54500
55355
 
54501
55356
  // src/funcs/webhookEndpointsList.ts
54502
55357
  function webhookEndpointsList(client$, options) {
54503
- return new APIPromise($do17(client$, options));
55358
+ return new APIPromise($do21(client$, options));
54504
55359
  }
54505
- async function $do17(client$, options) {
55360
+ async function $do21(client$, options) {
54506
55361
  const path$ = pathToFunc("/v1/webhooks")();
54507
55362
  const headers$ = new Headers(compactMap({
54508
55363
  Accept: options?.acceptHeaderOverride || "application/json;q=1, application/problem+json;q=0"
@@ -54694,9 +55549,9 @@ var init_listwebhookdeliveriesop = __esm(() => {
54694
55549
 
54695
55550
  // src/funcs/webhookEndpointsListDeliveries.ts
54696
55551
  function webhookEndpointsListDeliveries(client$, request, options) {
54697
- return new APIPromise($do18(client$, request, options));
55552
+ return new APIPromise($do22(client$, request, options));
54698
55553
  }
54699
- async function $do18(client$, request, options) {
55554
+ async function $do22(client$, request, options) {
54700
55555
  const parsed$ = safeParse2(request, (value$) => ListWebhookDeliveriesRequest$zodSchema.parse(value$), "Input validation failed");
54701
55556
  if (!parsed$.ok) {
54702
55557
  return [parsed$, { status: "invalid" }];
@@ -54783,12 +55638,12 @@ var init_webhookEndpointsListDeliveries = __esm(() => {
54783
55638
  });
54784
55639
 
54785
55640
  // src/mcp-server/tools/webhookEndpointsListDeliveries.ts
54786
- var args17, tool$webhookEndpointsListDeliveries;
55641
+ var args21, tool$webhookEndpointsListDeliveries;
54787
55642
  var init_webhookEndpointsListDeliveries2 = __esm(() => {
54788
55643
  init_webhookEndpointsListDeliveries();
54789
55644
  init_listwebhookdeliveriesop();
54790
55645
  init_tools();
54791
- args17 = {
55646
+ args21 = {
54792
55647
  request: ListWebhookDeliveriesRequest$zodSchema
54793
55648
  };
54794
55649
  tool$webhookEndpointsListDeliveries = {
@@ -54803,7 +55658,7 @@ Every POST the endpoint received, newest first: the event id and type, which att
54803
55658
  openWorldHint: false,
54804
55659
  readOnlyHint: true
54805
55660
  },
54806
- args: args17,
55661
+ args: args21,
54807
55662
  tool: async (client, args, ctx) => {
54808
55663
  const [result] = await webhookEndpointsListDeliveries(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
54809
55664
  if (!result.ok) {
@@ -54877,9 +55732,9 @@ var init_replaywebhookdeliveryop = __esm(() => {
54877
55732
 
54878
55733
  // src/funcs/webhookEndpointsReplayDelivery.ts
54879
55734
  function webhookEndpointsReplayDelivery(client$, request, options) {
54880
- return new APIPromise($do19(client$, request, options));
55735
+ return new APIPromise($do23(client$, request, options));
54881
55736
  }
54882
- async function $do19(client$, request, options) {
55737
+ async function $do23(client$, request, options) {
54883
55738
  const parsed$ = safeParse2(request, (value$) => ReplayWebhookDeliveryRequest$zodSchema.parse(value$), "Input validation failed");
54884
55739
  if (!parsed$.ok) {
54885
55740
  return [parsed$, { status: "invalid" }];
@@ -54953,12 +55808,12 @@ var init_webhookEndpointsReplayDelivery = __esm(() => {
54953
55808
  });
54954
55809
 
54955
55810
  // src/mcp-server/tools/webhookEndpointsReplayDelivery.ts
54956
- var args18, tool$webhookEndpointsReplayDelivery;
55811
+ var args22, tool$webhookEndpointsReplayDelivery;
54957
55812
  var init_webhookEndpointsReplayDelivery2 = __esm(() => {
54958
55813
  init_webhookEndpointsReplayDelivery();
54959
55814
  init_replaywebhookdeliveryop();
54960
55815
  init_tools();
54961
- args18 = {
55816
+ args22 = {
54962
55817
  request: ReplayWebhookDeliveryRequest$zodSchema
54963
55818
  };
54964
55819
  tool$webhookEndpointsReplayDelivery = {
@@ -54973,7 +55828,7 @@ Queues the event for the endpoint again: the same event id and body it received,
54973
55828
  openWorldHint: false,
54974
55829
  readOnlyHint: false
54975
55830
  },
54976
- args: args18,
55831
+ args: args22,
54977
55832
  tool: async (client, args, ctx) => {
54978
55833
  const [result] = await webhookEndpointsReplayDelivery(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
54979
55834
  if (!result.ok) {
@@ -55059,9 +55914,9 @@ var init_rotatewebhooksigningkeyop = __esm(() => {
55059
55914
 
55060
55915
  // src/funcs/webhookEndpointsRotateSigningKey.ts
55061
55916
  function webhookEndpointsRotateSigningKey(client$, request, options) {
55062
- return new APIPromise($do20(client$, request, options));
55917
+ return new APIPromise($do24(client$, request, options));
55063
55918
  }
55064
- async function $do20(client$, request, options) {
55919
+ async function $do24(client$, request, options) {
55065
55920
  const parsed$ = safeParse2(request, (value$) => RotateWebhookSigningKeyRequest$zodSchema.parse(value$), "Input validation failed");
55066
55921
  if (!parsed$.ok) {
55067
55922
  return [parsed$, { status: "invalid" }];
@@ -55131,12 +55986,12 @@ var init_webhookEndpointsRotateSigningKey = __esm(() => {
55131
55986
  });
55132
55987
 
55133
55988
  // src/mcp-server/tools/webhookEndpointsRotateSigningKey.ts
55134
- var args19, tool$webhookEndpointsRotateSigningKey;
55989
+ var args23, tool$webhookEndpointsRotateSigningKey;
55135
55990
  var init_webhookEndpointsRotateSigningKey2 = __esm(() => {
55136
55991
  init_webhookEndpointsRotateSigningKey();
55137
55992
  init_rotatewebhooksigningkeyop();
55138
55993
  init_tools();
55139
- args19 = {
55994
+ args23 = {
55140
55995
  request: RotateWebhookSigningKeyRequest$zodSchema
55141
55996
  };
55142
55997
  tool$webhookEndpointsRotateSigningKey = {
@@ -55151,7 +56006,7 @@ Issues a new signing key for the endpoint and returns its secret once. Every del
55151
56006
  openWorldHint: false,
55152
56007
  readOnlyHint: false
55153
56008
  },
55154
- args: args19,
56009
+ args: args23,
55155
56010
  tool: async (client, args, ctx) => {
55156
56011
  const [result] = await webhookEndpointsRotateSigningKey(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
55157
56012
  if (!result.ok) {
@@ -55252,9 +56107,9 @@ var init_sendwebhooktesteventop = __esm(() => {
55252
56107
 
55253
56108
  // src/funcs/webhookEndpointsSendTestEvent.ts
55254
56109
  function webhookEndpointsSendTestEvent(client$, request, options) {
55255
- return new APIPromise($do21(client$, request, options));
56110
+ return new APIPromise($do25(client$, request, options));
55256
56111
  }
55257
- async function $do21(client$, request, options) {
56112
+ async function $do25(client$, request, options) {
55258
56113
  const parsed$ = safeParse2(request, (value$) => SendWebhookTestEventRequest$zodSchema.parse(value$), "Input validation failed");
55259
56114
  if (!parsed$.ok) {
55260
56115
  return [parsed$, { status: "invalid" }];
@@ -55324,12 +56179,12 @@ var init_webhookEndpointsSendTestEvent = __esm(() => {
55324
56179
  });
55325
56180
 
55326
56181
  // src/mcp-server/tools/webhookEndpointsSendTestEvent.ts
55327
- var args20, tool$webhookEndpointsSendTestEvent;
56182
+ var args24, tool$webhookEndpointsSendTestEvent;
55328
56183
  var init_webhookEndpointsSendTestEvent2 = __esm(() => {
55329
56184
  init_webhookEndpointsSendTestEvent();
55330
56185
  init_sendwebhooktesteventop();
55331
56186
  init_tools();
55332
- args20 = {
56187
+ args24 = {
55333
56188
  request: SendWebhookTestEventRequest$zodSchema
55334
56189
  };
55335
56190
  tool$webhookEndpointsSendTestEvent = {
@@ -55344,7 +56199,7 @@ endpoint.verification sends a signed challenge now and answers whether the endpo
55344
56199
  openWorldHint: false,
55345
56200
  readOnlyHint: false
55346
56201
  },
55347
- args: args20,
56202
+ args: args24,
55348
56203
  tool: async (client, args, ctx) => {
55349
56204
  const [result] = await webhookEndpointsSendTestEvent(client, args.request, { fetchOptions: { signal: ctx.mcpReq.signal } }).$inspect();
55350
56205
  if (!result.ok) {
@@ -55362,7 +56217,7 @@ endpoint.verification sends a signed challenge now and answers whether the endpo
55362
56217
  function createMCPServer(deps) {
55363
56218
  const server = new McpServer({
55364
56219
  name: "NoResponse",
55365
- version: "0.4.12"
56220
+ version: "0.5.1"
55366
56221
  });
55367
56222
  const getClient = deps.getSDK || (() => new NoResponseCore({
55368
56223
  security: deps.security,
@@ -55391,6 +56246,8 @@ function createMCPServer(deps) {
55391
56246
  tool(tool$accountsDelete);
55392
56247
  tool(tool$accountsListAssessments);
55393
56248
  tool(tool$accountsRecordEnforcement);
56249
+ tool(tool$keysList);
56250
+ tool(tool$keysRevoke);
55394
56251
  tool(tool$integrationsCreate);
55395
56252
  tool(tool$integrationsList);
55396
56253
  tool(tool$integrationsDelete);
@@ -55402,6 +56259,8 @@ function createMCPServer(deps) {
55402
56259
  tool(tool$webhookEndpointsSendTestEvent);
55403
56260
  tool(tool$webhookEndpointsListDeliveries);
55404
56261
  tool(tool$webhookEndpointsReplayDelivery);
56262
+ tool(tool$settingsGet);
56263
+ tool(tool$settingsUpdate);
55405
56264
  if (deps.dynamic) {
55406
56265
  registerDynamicTools(deps.logger, server, getClient, toolMap, scopes);
55407
56266
  }
@@ -55429,6 +56288,10 @@ var init_server = __esm(() => {
55429
56288
  init_integrationsDelete2();
55430
56289
  init_integrationsList2();
55431
56290
  init_integrationsRotate2();
56291
+ init_keysList2();
56292
+ init_keysRevoke2();
56293
+ init_settingsGet2();
56294
+ init_settingsUpdate2();
55432
56295
  init_webhookEndpointsCreate2();
55433
56296
  init_webhookEndpointsDelete2();
55434
56297
  init_webhookEndpointsList2();
@@ -55501,6 +56364,18 @@ The account's history: the same page as POST /v1/assessments/query for this acco
55501
56364
  description: `Record what you did to an account in your identity provider.
55502
56365
 
55503
56366
  Records what you did to the account in your identity provider for one flow's decision at one risk_version: the action (or none), the account's state before it, the provider and whether it was applied or failed. It is your action, not an outcome, and it leaves the account's risk unchanged. A record is kept once per account, risk_version, flow and action: the first report answers 201, and a repeat answers 200 with the stored record unchanged, so retries are safe without an Idempotency-Key. An applied report after a failed one replaces the failed record, keeping its id and created_at, and answers 201. A risk_version older than the account's current one is accepted and stored, but only an applied record at the current risk_version takes the account out of listChanged with unenforced=true; a newer one answers 409 risk_version_ahead. An account with no current risk answers 404 not_found. error_code is allowed only with status failed. Requires the history scope.`
56367
+ },
56368
+ {
56369
+ name: "list_keys",
56370
+ description: `List API keys.
56371
+
56372
+ Lists the keys of the signing key's environment, newest first, at most 200, revoked and expired keys included, without secrets: each key's id, prefix, scopes, status, and who created and revoked it. Requires the management scope. Read-only and safe to retry.`
56373
+ },
56374
+ {
56375
+ name: "revoke_key",
56376
+ description: `Revoke an API key.
56377
+
56378
+ Revokes a key of the signing key's environment at once: its next request answers 401. Requires the management scope. A key of the other environment or of another workspace answers 404 not_found. A key cannot revoke itself (409 self_revocation): rotate it with keys.rotate, or revoke it with another management key. Revoking a revoked key changes nothing and answers the key as it was revoked, so a retry is safe.`
55504
56379
  },
55505
56380
  {
55506
56381
  name: "create_integration",
@@ -55567,6 +56442,18 @@ Every POST the endpoint received, newest first: the event id and type, which att
55567
56442
  description: `Send one delivery again.
55568
56443
 
55569
56444
  Queues the event for the endpoint again: the same event id and body it received, with a new NR-Webhook-Timestamp and a signature from the endpoint's current signing key, retried like any other delivery and listed with replay: true. Your receiver deduplicates on the event id. The endpoint must be verified. Requires the webhooks scope. Not idempotent: each call, a retry included, sends the event again.`
56445
+ },
56446
+ {
56447
+ name: "get_settings",
56448
+ description: `Read an environment's settings.
56449
+
56450
+ Reads the settings of the signing key's environment: retention in days; per flow (account_creation, login, purchase) the step_up, review and block thresholds, the default depth and the admission; and the sources the environment refuses. A flow without thresholds of its own shows account_creation's with inherits_account_creation true. Requires the management scope; the other environment answers 404 not_found. Read-only and safe to retry.`
56451
+ },
56452
+ {
56453
+ name: "update_settings",
56454
+ description: `Change an environment's settings.
56455
+
56456
+ Changes only what the body names, in one transaction: retention_days, refused_sources, and per flow step_up, review, block (null turns blocking off), default_depth, admission, hold_seconds, on_expiry, or inherits_account_creation to return login or purchase to account_creation's thresholds. After the change each flow keeps 0 < step_up < review <= 100 and block off or review <= block <= 100; a change that breaks it answers 400 naming the flow. A policy change is one new policy_version with the signing key's prefix as updated_by, and every change is recorded in the workspace's audit log with the key as its actor. Requires the management scope; the other environment answers 404 not_found. A change reaches assessments within a minute.`
55570
56457
  },
55571
56458
  {
55572
56459
  name: "wait_for_assessment",
@@ -64067,7 +64954,7 @@ var routes = buildRouteMap({
64067
64954
  var app = buildApplication(routes, {
64068
64955
  name: "mcp",
64069
64956
  versionInfo: {
64070
- currentVersion: "0.4.12"
64957
+ currentVersion: "0.5.1"
64071
64958
  }
64072
64959
  });
64073
64960
  run(app, process3.argv.slice(2), buildContext(process3));
@@ -64075,5 +64962,5 @@ export {
64075
64962
  app
64076
64963
  };
64077
64964
 
64078
- //# debugId=AABF80C5EB322F5264756E2164756E21
64965
+ //# debugId=5FA85E752ADB8A5364756E2164756E21
64079
64966
  //# sourceMappingURL=mcp-server.js.map