@onlyflows/servicenow-mcp 2.3.0-dev.3 → 2.3.0-dev.5

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.
Files changed (173) hide show
  1. package/CHANGELOG.md +165 -0
  2. package/README.md +177 -29
  3. package/dist/atf-policy.d.ts +1 -1
  4. package/dist/atf-policy.d.ts.map +1 -1
  5. package/dist/atf-policy.js +2 -0
  6. package/dist/atf-policy.js.map +1 -1
  7. package/dist/config.d.ts +1 -1
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/credential-tables.d.ts +32 -0
  10. package/dist/credential-tables.d.ts.map +1 -0
  11. package/dist/credential-tables.js +58 -0
  12. package/dist/credential-tables.js.map +1 -0
  13. package/dist/encoded-query-policy.d.ts.map +1 -1
  14. package/dist/encoded-query-policy.js +8 -1
  15. package/dist/encoded-query-policy.js.map +1 -1
  16. package/dist/execution-context.d.ts +14 -0
  17. package/dist/execution-context.d.ts.map +1 -1
  18. package/dist/execution-context.js +8 -0
  19. package/dist/execution-context.js.map +1 -1
  20. package/dist/field-policy.d.ts +34 -1
  21. package/dist/field-policy.d.ts.map +1 -1
  22. package/dist/field-policy.js +308 -25
  23. package/dist/field-policy.js.map +1 -1
  24. package/dist/hidden-values.d.ts +225 -0
  25. package/dist/hidden-values.d.ts.map +1 -0
  26. package/dist/hidden-values.js +748 -0
  27. package/dist/hidden-values.js.map +1 -0
  28. package/dist/http-entrypoint.d.ts.map +1 -1
  29. package/dist/http-entrypoint.js +7 -0
  30. package/dist/http-entrypoint.js.map +1 -1
  31. package/dist/index.js +7 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/metadata-cache.d.ts +38 -0
  34. package/dist/metadata-cache.d.ts.map +1 -1
  35. package/dist/metadata-cache.js +76 -3
  36. package/dist/metadata-cache.js.map +1 -1
  37. package/dist/policy-card.d.ts +16 -1
  38. package/dist/policy-card.d.ts.map +1 -1
  39. package/dist/policy-card.js +13 -2
  40. package/dist/policy-card.js.map +1 -1
  41. package/dist/profile-admin.d.ts +18 -0
  42. package/dist/profile-admin.d.ts.map +1 -1
  43. package/dist/profile-admin.js +26 -1
  44. package/dist/profile-admin.js.map +1 -1
  45. package/dist/profile-manager.d.ts +13 -1
  46. package/dist/profile-manager.d.ts.map +1 -1
  47. package/dist/profile-manager.js +23 -1
  48. package/dist/profile-manager.js.map +1 -1
  49. package/dist/setup.d.ts +4 -0
  50. package/dist/setup.d.ts.map +1 -1
  51. package/dist/setup.js +150 -66
  52. package/dist/setup.js.map +1 -1
  53. package/dist/structured-query.d.ts.map +1 -1
  54. package/dist/structured-query.js +6 -1
  55. package/dist/structured-query.js.map +1 -1
  56. package/dist/table-policy.d.ts +34 -1
  57. package/dist/table-policy.d.ts.map +1 -1
  58. package/dist/table-policy.js +95 -10
  59. package/dist/table-policy.js.map +1 -1
  60. package/dist/tool-error.d.ts +8 -1
  61. package/dist/tool-error.d.ts.map +1 -1
  62. package/dist/tool-error.js +23 -0
  63. package/dist/tool-error.js.map +1 -1
  64. package/dist/tool-table-access.d.ts.map +1 -1
  65. package/dist/tool-table-access.js +25 -6
  66. package/dist/tool-table-access.js.map +1 -1
  67. package/dist/tools/aggregate.js +2 -2
  68. package/dist/tools/aggregate.js.map +1 -1
  69. package/dist/tools/all-fields-cap.d.ts.map +1 -1
  70. package/dist/tools/all-fields-cap.js +29 -7
  71. package/dist/tools/all-fields-cap.js.map +1 -1
  72. package/dist/tools/atf-author-module.d.ts +1 -7
  73. package/dist/tools/atf-author-module.d.ts.map +1 -1
  74. package/dist/tools/atf-author-module.js +16 -7
  75. package/dist/tools/atf-author-module.js.map +1 -1
  76. package/dist/tools/atf-contracts.d.ts +69 -4
  77. package/dist/tools/atf-contracts.d.ts.map +1 -1
  78. package/dist/tools/atf-contracts.js +32 -2
  79. package/dist/tools/atf-contracts.js.map +1 -1
  80. package/dist/tools/atf-renderers.js +2 -1
  81. package/dist/tools/atf-renderers.js.map +1 -1
  82. package/dist/tools/atf-results-module.d.ts.map +1 -1
  83. package/dist/tools/atf-results-module.js +5 -3
  84. package/dist/tools/atf-results-module.js.map +1 -1
  85. package/dist/tools/atf-run-module.js +3 -2
  86. package/dist/tools/atf-run-module.js.map +1 -1
  87. package/dist/tools/atf-shared.d.ts +6 -0
  88. package/dist/tools/atf-shared.d.ts.map +1 -1
  89. package/dist/tools/atf-shared.js +49 -10
  90. package/dist/tools/atf-shared.js.map +1 -1
  91. package/dist/tools/atf-step-catalog.d.ts +13 -8
  92. package/dist/tools/atf-step-catalog.d.ts.map +1 -1
  93. package/dist/tools/atf-step-catalog.js +169 -5
  94. package/dist/tools/atf-step-catalog.js.map +1 -1
  95. package/dist/tools/batch.d.ts.map +1 -1
  96. package/dist/tools/batch.js +4 -2
  97. package/dist/tools/batch.js.map +1 -1
  98. package/dist/tools/flow-view-contracts.d.ts +57 -1
  99. package/dist/tools/flow-view-contracts.d.ts.map +1 -1
  100. package/dist/tools/flow-view-contracts.js +34 -2
  101. package/dist/tools/flow-view-contracts.js.map +1 -1
  102. package/dist/tools/flow-view-graph.d.ts +14 -0
  103. package/dist/tools/flow-view-graph.d.ts.map +1 -1
  104. package/dist/tools/flow-view-graph.js +43 -1
  105. package/dist/tools/flow-view-graph.js.map +1 -1
  106. package/dist/tools/flow-view-module.js +1 -1
  107. package/dist/tools/flow-view-module.js.map +1 -1
  108. package/dist/tools/flow-view-policy.d.ts +3 -3
  109. package/dist/tools/flow-view-policy.d.ts.map +1 -1
  110. package/dist/tools/flow-view-policy.js +5 -4
  111. package/dist/tools/flow-view-policy.js.map +1 -1
  112. package/dist/tools/flow-view-renderers.d.ts.map +1 -1
  113. package/dist/tools/flow-view-renderers.js +9 -21
  114. package/dist/tools/flow-view-renderers.js.map +1 -1
  115. package/dist/tools/index.d.ts.map +1 -1
  116. package/dist/tools/index.js +80 -13
  117. package/dist/tools/index.js.map +1 -1
  118. package/dist/tools/platform-view-contracts.d.ts +189 -0
  119. package/dist/tools/platform-view-contracts.d.ts.map +1 -0
  120. package/dist/tools/platform-view-contracts.js +353 -0
  121. package/dist/tools/platform-view-contracts.js.map +1 -0
  122. package/dist/tools/platform-view-evaluate.d.ts +11 -0
  123. package/dist/tools/platform-view-evaluate.d.ts.map +1 -0
  124. package/dist/tools/platform-view-evaluate.js +19 -0
  125. package/dist/tools/platform-view-evaluate.js.map +1 -0
  126. package/dist/tools/platform-view-module.d.ts +28 -0
  127. package/dist/tools/platform-view-module.d.ts.map +1 -0
  128. package/dist/tools/platform-view-module.js +111 -0
  129. package/dist/tools/platform-view-module.js.map +1 -0
  130. package/dist/tools/platform-view-scan.d.ts +57 -0
  131. package/dist/tools/platform-view-scan.d.ts.map +1 -0
  132. package/dist/tools/platform-view-scan.js +375 -0
  133. package/dist/tools/platform-view-scan.js.map +1 -0
  134. package/dist/tools/platform-view-upgrades.d.ts +152 -0
  135. package/dist/tools/platform-view-upgrades.d.ts.map +1 -0
  136. package/dist/tools/platform-view-upgrades.js +545 -0
  137. package/dist/tools/platform-view-upgrades.js.map +1 -0
  138. package/dist/tools/profile.d.ts.map +1 -1
  139. package/dist/tools/profile.js +1 -0
  140. package/dist/tools/profile.js.map +1 -1
  141. package/dist/tools/query-module.js +1 -1
  142. package/dist/tools/query-module.js.map +1 -1
  143. package/dist/tools/record-write-shared.d.ts.map +1 -1
  144. package/dist/tools/record-write-shared.js +4 -3
  145. package/dist/tools/record-write-shared.js.map +1 -1
  146. package/dist/tools/result-envelope.d.ts +116 -36
  147. package/dist/tools/result-envelope.d.ts.map +1 -1
  148. package/dist/tools/result-envelope.js +38 -3
  149. package/dist/tools/result-envelope.js.map +1 -1
  150. package/dist/tools/syslog-cursor.d.ts +61 -0
  151. package/dist/tools/syslog-cursor.d.ts.map +1 -0
  152. package/dist/tools/syslog-cursor.js +146 -0
  153. package/dist/tools/syslog-cursor.js.map +1 -0
  154. package/dist/tools/syslog.d.ts +2 -0
  155. package/dist/tools/syslog.d.ts.map +1 -1
  156. package/dist/tools/syslog.js +126 -2
  157. package/dist/tools/syslog.js.map +1 -1
  158. package/dist/update-set-eval/secret-patterns.d.ts +75 -0
  159. package/dist/update-set-eval/secret-patterns.d.ts.map +1 -0
  160. package/dist/update-set-eval/secret-patterns.js +570 -0
  161. package/dist/update-set-eval/secret-patterns.js.map +1 -0
  162. package/dist/update-set-eval/xml-reader.d.ts +117 -0
  163. package/dist/update-set-eval/xml-reader.d.ts.map +1 -0
  164. package/dist/update-set-eval/xml-reader.js +561 -0
  165. package/dist/update-set-eval/xml-reader.js.map +1 -0
  166. package/dist/version.d.ts +1 -1
  167. package/dist/version.js +1 -1
  168. package/docs/CLIENT-SETUP.md +8 -6
  169. package/docs/FLOW-VIEW.md +14 -5
  170. package/docs/PRODUCTION-SECURITY.md +63 -0
  171. package/docs/PROFILE-CREDENTIALS.md +10 -4
  172. package/package.json +1 -1
  173. package/server.json +2 -2
package/dist/setup.js CHANGED
@@ -41,6 +41,7 @@ const profile_admin_js_1 = require("./profile-admin.js");
41
41
  const profile_credentials_js_1 = require("./profile-credentials.js");
42
42
  const profile_manager_js_1 = require("./profile-manager.js");
43
43
  const policy_card_js_1 = require("./policy-card.js");
44
+ const hidden_values_js_1 = require("./hidden-values.js");
44
45
  const risky_grants_js_1 = require("./risky-grants.js");
45
46
  const tool_error_js_1 = require("./tool-error.js");
46
47
  const table_policy_js_1 = require("./table-policy.js");
@@ -238,66 +239,16 @@ async function runWizard(options, home, env, dependencies, out) {
238
239
  }
239
240
  const name = await askProfileName(prompter, existing);
240
241
  const instance = await askInstance(prompter);
241
- const authType = await askAuthType(prompter);
242
- const grantType = authType === "oauth"
243
- ? (await prompter.ask("OAuth grant type", {
244
- default: "client_credentials",
245
- choices: ["client_credentials", "password"],
246
- }))
247
- : "client_credentials";
248
- // Asked here, before any secret is in hand. A mistyped answer to a
249
- // question adjacent to a credential prompt echoes the credential, so the
250
- // last thing before the hidden prompts is deliberately not this question.
251
- const mode = (await prompter.ask("How should the credential be stored?", {
252
- default: "encrypted",
253
- choices: ["encrypted", "reference"],
254
- }));
255
- const provider = mode === "reference"
256
- ? await prompter.ask("Secret provider", { default: "env", choices: ["env"] })
257
- : undefined;
258
- const profile = { instance, authType };
259
- if (authType === "basic" || grantType === "password") {
260
- profile.username = await prompter.ask("ServiceNow username", {
261
- validate: (value) => value.trim() === "" ? "A username is required for this auth mode." : undefined,
262
- });
263
- }
264
- if (authType === "oauth") {
265
- profile.grantType = grantType;
266
- profile.clientId = await prompter.ask("OAuth client id (not a secret)", {
267
- validate: (value) => value.trim() === "" ? "A client id is required for OAuth." : undefined,
268
- });
269
- }
270
- if (authType === "apikey") {
271
- profile.apiKeyHeader = await prompter.ask("API key header", {
272
- default: "x-sn-apikey",
273
- });
274
- }
275
- const fields = (0, profile_admin_js_1.requiredSecretFields)(authType, grantType);
276
- (0, profile_admin_js_1.validateCreateMetadata)(profile, fields);
277
- // 3. Capture the secrets. Never echoed, never in argv, never logged.
278
- prompter.note(mode === "reference"
279
- ? "\nEnter the NAME of the environment variable holding each secret.\n" +
280
- "Input is hidden."
281
- : "\nEnter each secret now. Input is hidden — nothing you type from here\n" +
282
- "is displayed.");
283
- const captured = [];
284
- for (const field of fields) {
285
- captured.push(Object.freeze({ field, mode, value: await prompter.secret(field) }));
286
- }
287
- // 4. Verify against the live instance before anything is persisted.
288
- const config = wizardConfig(profile, captured, mode, env);
289
- const verify = dependencies.verifyCredential ?? verifyCredentialAgainstInstance;
290
- prompter.note("\nVerifying against the instance...");
291
- let verification = await verify(config);
292
- while (!verification.ok) {
293
- prompter.note(`\n FAILED ${verification.detail}`);
294
- if (verification.remedy)
295
- prompter.note(` -> ${verification.remedy}`);
296
- if (!(await prompter.confirm("\nRetry with the same settings?", true))) {
297
- throw new WizardAbort();
298
- }
299
- verification = await verify(config);
242
+ // 3-4. Authentication, the credential, and its verification. Collected in
243
+ // one place so a Basic 401 can send the operator back to OAuth
244
+ // without re-asking the profile name or the instance.
245
+ let forcedAuthType;
246
+ let collected;
247
+ while (collected === undefined) {
248
+ collected = await collectVerifiedCredential(prompter, instance, env, dependencies, forcedAuthType);
249
+ forcedAuthType = "oauth";
300
250
  }
251
+ const { profile, captured, mode, provider, config, verification } = collected;
301
252
  prompter.note(` ok ${verification.detail}`);
302
253
  if (verification.authenticatedButDenied) {
303
254
  prompter.note(` note this account cannot read ${WIZARD_PROBE_TABLE}, so metadata\n` +
@@ -347,6 +298,99 @@ async function runWizard(options, home, env, dependencies, out) {
347
298
  prompter.close();
348
299
  }
349
300
  }
301
+ /**
302
+ * Ask for the authentication type and its credential, then verify it against
303
+ * the instance. Returns `undefined` when the operator, after a 401 on a Basic
304
+ * credential, chose to switch to OAuth: the caller asks again with OAuth
305
+ * forced. Nothing is persisted here, and a discarded Basic credential is not
306
+ * kept anywhere.
307
+ */
308
+ async function collectVerifiedCredential(prompter, instance, env, dependencies, forcedAuthType) {
309
+ const authType = forcedAuthType ?? (await askAuthType(prompter));
310
+ if (authType === "oauth")
311
+ prompter.note(OAUTH_REQUIREMENTS_NOTE);
312
+ const grantType = authType === "oauth"
313
+ ? (await prompter.ask("OAuth grant type", {
314
+ default: "client_credentials",
315
+ choices: ["client_credentials", "password"],
316
+ }))
317
+ : "client_credentials";
318
+ // Asked here, before any secret is in hand. A mistyped answer to a
319
+ // question adjacent to a credential prompt echoes the credential, so the
320
+ // last thing before the hidden prompts is deliberately not this question.
321
+ const mode = (await prompter.ask("How should the credential be stored?", {
322
+ default: "encrypted",
323
+ choices: ["encrypted", "reference"],
324
+ }));
325
+ const provider = mode === "reference"
326
+ ? await prompter.ask("Secret provider", { default: "env", choices: ["env"] })
327
+ : undefined;
328
+ const profile = { instance, authType };
329
+ if (authType === "basic" || grantType === "password") {
330
+ profile.username = await prompter.ask("ServiceNow username", {
331
+ validate: (value) => value.trim() === "" ? "A username is required for this auth mode." : undefined,
332
+ });
333
+ }
334
+ if (authType === "oauth") {
335
+ profile.grantType = grantType;
336
+ profile.clientId = await prompter.ask("OAuth client id (not a secret)", {
337
+ validate: (value) => value.trim() === "" ? "A client id is required for OAuth." : undefined,
338
+ });
339
+ }
340
+ if (authType === "apikey") {
341
+ profile.apiKeyHeader = await prompter.ask("API key header", {
342
+ default: "x-sn-apikey",
343
+ });
344
+ }
345
+ const fields = (0, profile_admin_js_1.requiredSecretFields)(authType, grantType);
346
+ (0, profile_admin_js_1.validateCreateMetadata)(profile, fields);
347
+ // Capture the secrets. Never echoed, never in argv, never logged.
348
+ prompter.note(mode === "reference"
349
+ ? "\nEnter the NAME of the environment variable holding each secret.\n" +
350
+ "Input is hidden."
351
+ : "\nEnter each secret now. Input is hidden — nothing you type from here\n" +
352
+ "is displayed.");
353
+ const captured = [];
354
+ for (const field of fields) {
355
+ captured.push(Object.freeze({ field, mode, value: await prompter.secret(field) }));
356
+ }
357
+ // Verify against the live instance before anything is persisted.
358
+ const config = wizardConfig(profile, captured, mode, env);
359
+ const verify = dependencies.verifyCredential ?? verifyCredentialAgainstInstance;
360
+ prompter.note("\nVerifying against the instance...");
361
+ let verification = await verify(config);
362
+ while (!verification.ok) {
363
+ prompter.note(`\n FAILED ${verification.detail}`);
364
+ const offersSwitch = authType === "basic" && verification.authenticationRejected === true;
365
+ if (verification.remedy) {
366
+ prompter.note(` -> ${verification.remedy}${offersSwitch ? BASIC_AUTH_SWITCH_IN_WIZARD : ""}`);
367
+ }
368
+ if (offersSwitch) {
369
+ // A 401 on Basic often means the instance no longer accepts Basic for
370
+ // REST, which retrying cannot fix. Offer the way out next to the retry.
371
+ const next = await prompter.ask("\nWhat next?", {
372
+ default: "retry",
373
+ choices: ["retry", "oauth", "stop"],
374
+ hints: {
375
+ retry: "try the same settings again",
376
+ oauth: "discard this credential and set up OAuth client credentials",
377
+ stop: "cancel; nothing is saved",
378
+ },
379
+ });
380
+ if (next === "stop")
381
+ throw new WizardAbort();
382
+ if (next === "oauth") {
383
+ prompter.note("\nSwitching to OAuth. The Basic credential is discarded.");
384
+ return undefined;
385
+ }
386
+ }
387
+ else if (!(await prompter.confirm("\nRetry with the same settings?", true))) {
388
+ throw new WizardAbort();
389
+ }
390
+ verification = await verify(config);
391
+ }
392
+ return { profile, captured, mode, provider, config, verification };
393
+ }
350
394
  /**
351
395
  * The checks that decide whether this install actually works.
352
396
  *
@@ -433,10 +477,30 @@ function instanceProblem(value) {
433
477
  "*.servicenowservices.com. For a self-hosted or custom-domain instance, set " +
434
478
  "SN_ALLOWED_INSTANCE_HOSTS before running setup.");
435
479
  }
480
+ /**
481
+ * OAuth client credentials is the default and listed first. Basic stays
482
+ * available for an instance that still accepts it, and is listed last and
483
+ * marked legacy: ServiceNow is retiring it for REST calls (KB3096078).
484
+ */
485
+ const AUTH_TYPE_CHOICES = Object.freeze(["oauth", "apikey", "basic"]);
486
+ const AUTH_TYPE_HINTS = Object.freeze({
487
+ oauth: "client credentials, recommended",
488
+ apikey: "inbound API key",
489
+ basic: "legacy, not recommended: ServiceNow is retiring it",
490
+ });
491
+ /** What OAuth client credentials need on the instance. Fixed text, no secret. */
492
+ const OAUTH_REQUIREMENTS_NOTE = "\nOAuth client credentials need these on the instance:\n" +
493
+ " - an Application Registry entry (System OAuth > Application Registry)\n" +
494
+ " with a client ID and client secret\n" +
495
+ " - the client credentials grant enabled for it\n" +
496
+ " - an OAuth Application User: the integration user this server acts as,\n" +
497
+ " with only the roles it needs, not an administrator\n" +
498
+ "Steps: README, section Authentication > OAuth 2.0.\n";
436
499
  async function askAuthType(prompter) {
437
500
  return (await prompter.ask("Authentication", {
438
- default: "basic",
439
- choices: ["basic", "oauth", "apikey"],
501
+ default: "oauth",
502
+ choices: AUTH_TYPE_CHOICES,
503
+ hints: AUTH_TYPE_HINTS,
440
504
  }));
441
505
  }
442
506
  /** Build a throwaway config for verification. Never persisted. */
@@ -502,8 +566,20 @@ const BASIC_AUTH_401_REMEDY = "Check the username and password. A ServiceNow acc
502
566
  "instance may be rejecting Basic Auth for REST API calls (KB3096078): " +
503
567
  "current instances require the role snc_basic_auth_api_access for REST " +
504
568
  "Basic auth, or a Web-Service-Access-Only account. ServiceNow is retiring " +
505
- "Basic auth, so OAuth client credentials are recommended: re-run setup " +
506
- "and choose oauth.";
569
+ "Basic auth, so OAuth client credentials are recommended.";
570
+ /**
571
+ * How to act on the OAuth recommendation, which depends on where the advice is
572
+ * read. The wizard has a menu right below it; `doctor` has none, so it names
573
+ * the command instead. Kept out of the shared remedy so neither points at a
574
+ * choice that is not on the screen.
575
+ */
576
+ const BASIC_AUTH_SWITCH_IN_WIZARD = " Choose oauth below to switch this profile.";
577
+ const BASIC_AUTH_SWITCH_IN_DOCTOR = " To switch this profile, re-run servicenow-mcp-setup and choose oauth.";
578
+ /** True for a 401 on a Basic credential, the case the OAuth advice is for. */
579
+ function isBasicAuthRejection(verification, config) {
580
+ return (verification.authenticationRejected === true &&
581
+ (config.authType === undefined || config.authType === "basic"));
582
+ }
507
583
  /** Map a probe failure onto the thing the operator must actually change. */
508
584
  function classifyVerificationFailure(error, config) {
509
585
  const descriptor = (0, tool_error_js_1.trustedToolErrorDescriptor)(error);
@@ -539,6 +615,7 @@ function classifyVerificationFailure(error, config) {
539
615
  if (descriptor?.category === "authentication") {
540
616
  return Object.freeze({
541
617
  ok: false,
618
+ authenticationRejected: true,
542
619
  detail: `${host} rejected the credential (HTTP 401).`,
543
620
  remedy: config.authType === "oauth"
544
621
  ? "Check the OAuth client id and secret, and that the client is active on the instance."
@@ -673,7 +750,9 @@ async function askTableSelection(prompter, operation, fallback) {
673
750
  prompter.note(`\n "*" grants every table for ${operation.toLowerCase()}. ServiceNow's own\n` +
674
751
  " per-user ACLs are then the only remaining boundary, so the integration\n" +
675
752
  " account's roles become the whole control. It also skips the per-tool\n" +
676
- " binding and the related-table closure check.\n");
753
+ " binding and the related-table closure check. It does not cover\n" +
754
+ ` ${table_policy_js_1.NAMED_ONLY_TABLES.join(", ")};\n` +
755
+ " name them to allow them.\n");
677
756
  return Object.freeze(["*"]);
678
757
  }
679
758
  return askCustomTableList(prompter, operation);
@@ -895,7 +974,8 @@ function renderQuestion(question, options) {
895
974
  const lines = [`${question}:`];
896
975
  options.choices.forEach((choice, index) => {
897
976
  const marker = choice === options.default ? " (default)" : "";
898
- lines.push(` ${index + 1}) ${choice}${marker}`);
977
+ const hint = options.hints?.[choice];
978
+ lines.push(` ${index + 1}) ${choice}${marker}${hint ? ` - ${hint}` : ""}`);
899
979
  });
900
980
  const defaultIndex = options.default ? options.choices.indexOf(options.default) + 1 : 0;
901
981
  lines.push(defaultIndex > 0 ? `Choice [${defaultIndex}]: ` : "Choice: ");
@@ -1338,6 +1418,7 @@ function runPolicy(options, home, env, dependencies, out) {
1338
1418
  },
1339
1419
  encodedQueryAccess,
1340
1420
  atf: manager.getAtfConfig(options.profile),
1421
+ fieldTypes: { dictionary: (0, hidden_values_js_1.dictionaryNotRequired)(profile.fieldTypes) ? "not_required" : "required" },
1341
1422
  });
1342
1423
  out(options.json
1343
1424
  ? `${JSON.stringify({ policy: card, note: encodedNote }, null, 2)}\n`
@@ -1392,11 +1473,14 @@ async function runLiveChecks(paths, home, dependencies, only) {
1392
1473
  }
1393
1474
  try {
1394
1475
  const result = await verify(config);
1476
+ const remedy = result.remedy !== undefined && isBasicAuthRejection(result, config)
1477
+ ? `${result.remedy}${BASIC_AUTH_SWITCH_IN_DOCTOR}`
1478
+ : result.remedy;
1395
1479
  return {
1396
1480
  name: `profile ${name}: live instance`,
1397
1481
  ok: result.ok,
1398
1482
  detail: result.detail,
1399
- ...(result.remedy === undefined ? {} : { remedy: result.remedy }),
1483
+ ...(remedy === undefined ? {} : { remedy }),
1400
1484
  };
1401
1485
  }
1402
1486
  catch {