@jacebenson/jsn 4.3.9-dev.65 → 4.3.10-dev.66

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jacebenson/jsn",
3
- "version": "4.3.9-dev.65",
3
+ "version": "4.3.10-dev.66",
4
4
  "description": "A command-line interface for ServiceNow that follows the Unix philosophy: simple, composable, and scriptable.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import process from 'node:process';
4
- import { input, password as passwordPrompt, select } from '@inquirer/prompts';
4
+ import { input, password as passwordPrompt, select } from '../prompts.js';
5
5
  import { confirmDelete, formatRecordForDisplay, getStringField, interactiveList, canPrompt, assertSafeExactMatch } from '../helpers.js';
6
6
  import { FormatAuto } from '../output.js';
7
7
  import { declareCapabilities } from '../capabilities.js';
@@ -333,7 +333,7 @@ export function skillCmd(wrap) {
333
333
  ? `Where should the jsn skill be installed? (${outdated.length} outdated)`
334
334
  : 'Where should the jsn skill be installed?';
335
335
 
336
- const { checkbox } = await import('@inquirer/prompts');
336
+ const { checkbox } = await import('../prompts.js');
337
337
  const choices = Object.entries(TARGET_NAMES).map(([key, label]) => {
338
338
  const dir = AGENT_SKILL_DIRS[key];
339
339
  const targetPath = key === 'cursor'
@@ -1,4 +1,4 @@
1
- import { checkbox, select, confirm } from '@inquirer/prompts';
1
+ import { checkbox, select, confirm } from '../prompts.js';
2
2
  import { canUsePicker, interactiveList, getStringField } from '../helpers.js';
3
3
  import { declareCapabilities } from '../capabilities.js';
4
4
  import { errUsage } from '../errors.js';
@@ -1,5 +1,5 @@
1
1
  import fs from 'node:fs';
2
- import { editor, confirm } from '@inquirer/prompts';
2
+ import { editor, confirm } from '../prompts.js';
3
3
  import { formatRecordForDisplay, getStringField, interactiveList, assertSafeExactMatch, canPrompt, buildRerunCommand, verifyWriteBack } from '../helpers.js';
4
4
  import { getActiveProfile } from '../config.js';
5
5
  import { FormatAuto } from '../output.js';
@@ -1,7 +1,7 @@
1
1
  // Terminal orchestration only. Persistence and lifecycle remain in the SDK.
2
2
  import fs from 'node:fs';
3
3
  import { randomUUID, randomBytes } from 'node:crypto';
4
- import { input, select, confirm, editor } from '@inquirer/prompts';
4
+ import { input, select, confirm, editor } from './prompts.js';
5
5
  import { canPrompt, interactiveList, getStringField } from './helpers.js';
6
6
  import { FormatAuto } from './output.js';
7
7
  import { errUsage, errConfirmationRequired } from './errors.js';
@@ -35,7 +35,7 @@ export function interactiveDesigner(argv, app) {
35
35
  export async function cancelled(operation) {
36
36
  try { return await operation(); }
37
37
  catch (error) {
38
- if (error === CANCEL || ['ExitPromptError', 'AbortPromptError'].includes(error.name)) return undefined;
38
+ if (error === CANCEL || ['ExitPromptError', 'AbortPromptError', 'PromptCancelled'].includes(error.name)) return undefined;
39
39
  // Keep direct handler errors throwable; opt into the shared JSON renderer at the CLI boundary.
40
40
  if (error.code === 'usage_error') error.jsonEnvelope = true;
41
41
  throw error;
@@ -182,8 +182,8 @@ export const paginatedSearch = createPrompt((config, done) => {
182
182
  });
183
183
 
184
184
  const helpText = loaded < totalCount && !searchMode
185
- ? '(scroll to load more, type to search)'
186
- : '(type to search)';
185
+ ? '(scroll to load more, type to search, Esc to cancel)'
186
+ : '(type to search, Esc to cancel)';
187
187
 
188
188
  return [
189
189
  `${fullMessage} Search: ${searchTerm}${status === 'loading' ? ' ...' : ''}`,
package/src/prompts.js CHANGED
@@ -35,3 +35,9 @@ export const password = cancellablePrompt(prompts.password);
35
35
  export const select = cancellablePrompt(prompts.select);
36
36
  export const search = cancellablePrompt(prompts.search);
37
37
  export const confirm = cancellablePrompt(prompts.confirm);
38
+ export const checkbox = cancellablePrompt(prompts.checkbox);
39
+
40
+ // The editor prompt hands the keyboard to $EDITOR, so Escape belongs to that
41
+ // editor. It lives here so every command imports prompts from one module;
42
+ // cancelling an editor still uses Inquirer's Ctrl+C abort.
43
+ export const editor = prompts.editor;