{"_id":"@agentine/parley","name":"@agentine/parley","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@agentine/parley","version":"0.1.0","description":"Drop-in replacement for enquirer — interactive CLI prompts for Node.js","repository":{"type":"git","url":"git+https://github.com/agentine/parley.git"},"license":"MIT","type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/esm/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./compat/enquirer":{"types":"./dist/esm/compat/enquirer/index.d.ts","import":"./dist/esm/compat/enquirer/index.js","require":"./dist/cjs/compat/enquirer/index.js"}},"main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc -p tsconfig.json","build:cjs":"tsc -p tsconfig.cjs.json","clean":"rm -rf dist","test":"vitest run"},"devDependencies":{"@types/node":"^22.0.0","typescript":"^5.4.0","vitest":"^3.0.0"},"_id":"@agentine/parley@0.1.0","gitHead":"af3e15d2bf3a046cca3b973b2a768de3341b0491","bugs":{"url":"https://github.com/agentine/parley/issues"},"homepage":"https://github.com/agentine/parley#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-rcqCXh1WeTz0IUFMiox9TY1yKhLctsLn013T/CK4Se870CuUpj2EsjE641I/kFCM8G1uYVjcBJd9ZZBG+ELHMA==","shasum":"01f5ca60d7ae00b0f675ae9b7e13ab8af5d295a0","tarball":"https://registry.npmjs.org/@agentine/parley/-/parley-0.1.0.tgz","fileCount":195,"unpackedSize":420407,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agentine%2fparley@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDMMhPKe2TpXlqPtRpatk+tWGwDy+GD65sk54RPssx1WQIgR5gZkYclna3eH+too15zuvRwTRq/XwIYAPB/ABDIBQs="}]},"_npmUser":{"name":"mtingers","email":"matthingersoll@gmail.com"},"directories":{},"maintainers":[{"name":"mtingers","email":"matthingersoll@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/parley_0.1.0_1773634206339_0.4975917782158674"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-16T04:10:06.229Z","0.1.0":"2026-03-16T04:10:06.492Z","modified":"2026-03-16T04:10:06.920Z"},"maintainers":[{"name":"mtingers","email":"matthingersoll@gmail.com"}],"description":"Drop-in replacement for enquirer — interactive CLI prompts for Node.js","homepage":"https://github.com/agentine/parley#readme","repository":{"type":"git","url":"git+https://github.com/agentine/parley.git"},"bugs":{"url":"https://github.com/agentine/parley/issues"},"license":"MIT","readme":"# parley\n\nDrop-in replacement for [enquirer](https://github.com/enquirer/enquirer) — interactive CLI prompts for Node.js.\n\nZero dependencies. TypeScript-first. ESM + CJS dual package. Node.js 18+.\n\n## Install\n\n```bash\nnpm install @agentine/parley\n```\n\n## Usage\n\n### Functional API\n\n```typescript\nimport { input, select, confirm } from '@agentine/parley';\n\nconst name = await input({ message: 'What is your name?' });\nconst color = await select({ message: 'Favorite color?', choices: ['red', 'green', 'blue'] });\nconst ok = await confirm({ message: 'Continue?' });\n```\n\n### Class API\n\n```typescript\nimport { InputPrompt, SelectPrompt } from '@agentine/parley';\n\nconst prompt = new InputPrompt({ message: 'Username?', initial: 'guest' });\nconst username = await prompt.run();\n```\n\n### Enquirer Compatibility\n\nDrop-in replacement for enquirer:\n\n```typescript\nimport Enquirer from '@agentine/parley/compat/enquirer';\n\nconst response = await Enquirer.prompt([\n  { type: 'input', name: 'username', message: 'Username?' },\n  { type: 'password', name: 'password', message: 'Password?' },\n]);\n```\n\nOr use individual prompt classes:\n\n```typescript\nimport { Input, Select, Confirm } from '@agentine/parley/compat/enquirer';\n\nconst prompt = new Input({ message: 'Name?' });\nconst name = await prompt.run();\n```\n\n## Prompt Types\n\n### Essential (covers ~80% of enquirer usage)\n\n| Prompt | Description | Return Type |\n|--------|-------------|-------------|\n| `input` | Single-line text input | `string` |\n| `password` | Masked text input | `string` |\n| `confirm` | Yes/no boolean | `boolean` |\n| `select` | Single choice from list | `string` |\n| `multiselect` | Multiple choices from list | `string[]` |\n\n### Extended\n\n| Prompt | Description | Return Type |\n|--------|-------------|-------------|\n| `toggle` | Toggle between two values | `boolean` |\n| `number` | Numeric input with min/max/step | `number` |\n| `autocomplete` | Filterable select | `string` |\n| `scale` | Likert scale | `Record<string, number>` |\n| `sort` | Reorder a list | `string[]` |\n| `snippet` | Template multi-field | `{ values, result }` |\n| `list` | Comma-separated list | `string[]` |\n| `form` | Multi-field form | `Record<string, string>` |\n| `editable` | Multiselect with inline edit | `{ selected, values }` |\n| `quiz` | Quiz with correct answer | `{ selected, correct }` |\n\n## Options\n\nAll prompts support:\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `message` | `string` | Prompt message (required) |\n| `initial` | varies | Default value |\n| `hint` | `string` | Hint text shown in gray |\n| `validate` | `(value) => boolean \\| string` | Validation function |\n| `format` | `(value) => string` | Format submitted value for display |\n| `result` | `(value) => any` | Transform return value |\n| `skip` | `boolean \\| () => boolean` | Skip this prompt |\n\n### Select/MultiSelect additional options\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `choices` | `(string \\| Choice)[]` | List of choices |\n| `limit` | `number` | Max visible choices (scrollable) |\n\n### Choice object\n\n```typescript\n{\n  name: string;       // Choice identifier\n  message?: string;   // Display text (defaults to name)\n  value?: string;     // Return value (defaults to name)\n  hint?: string;      // Hint text\n  disabled?: boolean | string;  // Disable with optional reason\n  enabled?: boolean;  // Pre-selected (multiselect)\n}\n```\n\n## Migration from enquirer\n\n1. Install: `npm install @agentine/parley`\n2. Update imports:\n\n```diff\n- const Enquirer = require('enquirer');\n+ const Enquirer = require('@agentine/parley/compat/enquirer');\n```\n\nOr with ES modules:\n\n```diff\n- import Enquirer from 'enquirer';\n+ import Enquirer from '@agentine/parley/compat/enquirer';\n```\n\nThe compat layer supports:\n- `Enquirer.prompt()` static method\n- `new Enquirer().prompt()` instance method\n- `.register()` for custom prompt types\n- `.use()` for plugins\n- Individual prompt class imports (`Input`, `Select`, etc.)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-f9b99c8fe3bcd7823e3e0031a5f57f91"}