@agenzo/merchant-cli 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/core/errors.ts","../src/core/config-manager.ts","../src/core/formatter.ts","../src/core/output.ts","../src/core/version.ts","../src/ride/quote.ts","../src/core/api-client.ts","../src/core/prompt-engine.ts","../src/utils/cli-help.ts","../src/ride/book.ts","../src/utils/idempotency.ts","../src/ride/get.ts","../src/ride/cancel.ts","../src/ride/list-orders.ts","../src/services/list.ts","../src/services/registry.ts","../src/services/get.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { CliError } from './core/errors.js';\nimport { getHost, resetHost, setHost } from './core/config-manager.js';\nimport { Formatter } from './core/formatter.js';\nimport { emit, type OutputFormat } from './core/output.js';\nimport { getCurrentVersion } from './core/version.js';\n\n// Ride command builders\nimport { buildQuoteCommand } from './ride/quote.js';\nimport { buildBookCommand } from './ride/book.js';\nimport { buildRideGetCommand } from './ride/get.js';\nimport { buildCancelCommand } from './ride/cancel.js';\nimport { buildListOrdersCommand } from './ride/list-orders.js';\n\n// Services command builders\nimport { buildServicesListCommand } from './services/list.js';\nimport { buildServiceGetCommand } from './services/get.js';\n\nfunction resolveFormat(cmd: Command): OutputFormat {\n return cmd.optsWithGlobals().format === 'table' ? 'table' : 'json';\n}\n\nasync function main(): Promise<void> {\n const program = new Command();\n program\n .name('agenzo-merchant-cli')\n .description('CLI for ordering rides and querying merchant services')\n .version(getCurrentVersion())\n .option('--format <format>', 'Output format: json|table', 'json')\n .option('--yes', 'Skip confirmation prompts (for automation/AI Agents)', false)\n .option('--api-key <key>', 'API key for runtime requests');\n\n // config group — fully implemented locally (no network)\n const config = program.command('config').description('Local API host configuration');\n config\n .command('set-host <url>')\n .description('Set the API host')\n .action((url: string) => {\n setHost(url);\n console.log(Formatter.status('success', `API host set to ${getHost()}`));\n });\n config\n .command('reset-host')\n .description('Reset the API host to the default')\n .action(() => {\n resetHost();\n console.log(Formatter.status('success', `API host reset to ${getHost()}`));\n });\n config\n .command('show')\n .description('Show the current configuration')\n .action((_options, cmd: Command) => {\n emit({ host: getHost() }, resolveFormat(cmd));\n });\n\n // ride group\n const ride = program\n .command('ride')\n .description('Ride ordering: quote, book, get, cancel, list-orders');\n ride.addCommand(buildQuoteCommand());\n ride.addCommand(buildBookCommand());\n ride.addCommand(buildRideGetCommand());\n ride.addCommand(buildCancelCommand());\n ride.addCommand(buildListOrdersCommand());\n\n // services group\n const services = program.command('services').description('Service registry: list, get');\n services.addCommand(buildServicesListCommand());\n services.addCommand(buildServiceGetCommand());\n\n await program.parseAsync(process.argv);\n}\n\nmain().catch((error: unknown) => {\n if (error instanceof CliError) {\n console.error(Formatter.status('error', error.message));\n if (error.recovery) console.error(Formatter.status('info', error.recovery));\n process.exit(error.exitCode);\n }\n console.error(\n Formatter.status('error', error instanceof Error ? error.message : 'An unexpected error occurred'),\n );\n process.exit(1);\n});\n","/**\n * SCREAMING_SNAKE_CASE error codes shared across the CLI. Server-returned\n * codes are passed through verbatim, so this list is the well-known subset the\n * CLI itself raises or special-cases.\n */\nexport const ErrorCodes = {\n QUOTE_EXPIRED: 'QUOTE_EXPIRED',\n VEHICLE_UNAVAILABLE: 'VEHICLE_UNAVAILABLE',\n BOOKING_FAILED: 'BOOKING_FAILED',\n CANCELLATION_NOT_ALLOWED: 'CANCELLATION_NOT_ALLOWED',\n SERVICE_NOT_FOUND: 'SERVICE_NOT_FOUND',\n PARAM_IDEMPOTENCY_KEY_REQUIRED: 'PARAM_IDEMPOTENCY_KEY_REQUIRED',\n NETWORK_ERROR: 'NETWORK_ERROR',\n TIMEOUT: 'TIMEOUT',\n CLI_OUTDATED: 'CLI_OUTDATED',\n CONFIG_ERROR: 'CONFIG_ERROR',\n NOT_IMPLEMENTED: 'NOT_IMPLEMENTED',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];\n\n/**\n * Single error type for the CLI. `code` identifies the failure class,\n * `recovery` is an optional human-readable next step, and `exitCode` lets\n * specific failures (e.g. CLI_OUTDATED) signal a distinct process exit code.\n */\nexport class CliError extends Error {\n constructor(\n public readonly code: string,\n message: string,\n public readonly recovery?: string,\n public readonly exitCode: number = 1,\n ) {\n super(message);\n this.name = 'CliError';\n }\n}\n","/**\n * Local config persisted at ~/.agenzo-merchant-cli/config.json.\n * Only the API host is stored; everything else is runtime/flag driven.\n */\nimport { mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { CliError, ErrorCodes } from './errors.js';\n\nexport const DEFAULT_HOST = 'https://agent.everonet.com';\n\nconst CONFIG_DIR = join(homedir(), '.agenzo-merchant-cli');\nconst CONFIG_PATH = join(CONFIG_DIR, 'config.json');\n\ninterface Config {\n host: string;\n}\n\nfunction read(): Config {\n let raw: string;\n try {\n raw = readFileSync(CONFIG_PATH, 'utf-8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n return { host: DEFAULT_HOST };\n }\n throw error;\n }\n try {\n const parsed = JSON.parse(raw) as Partial<Config>;\n return { host: parsed.host ?? DEFAULT_HOST };\n } catch {\n throw new CliError(\n ErrorCodes.CONFIG_ERROR,\n `Invalid config file: ${CONFIG_PATH}`,\n 'Delete the file to reset to defaults.',\n );\n }\n}\n\nfunction write(config: Config): void {\n mkdirSync(CONFIG_DIR, { recursive: true });\n writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2), 'utf-8');\n}\n\nexport function getHost(): string {\n return read().host;\n}\n\nexport function setHost(host: string): void {\n write({ host: host.replace(/\\/+$/, '') });\n}\n\nexport function resetHost(): void {\n write({ host: DEFAULT_HOST });\n}\n","export type StatusType = 'success' | 'error' | 'info' | 'warning';\n\nconst ICONS: Record<StatusType, string> = {\n success: '✓',\n error: '✗',\n info: 'ℹ',\n warning: '⚠',\n};\n\nconst SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\n\nexport interface Spinner {\n /** Update the in-progress message. */\n update(message: string): void;\n /** Stop and clear the spinner line (no final status). */\n stop(): void;\n /** Stop and replace the line with a success status. */\n succeed(message?: string): void;\n /** Stop and replace the line with an error status. */\n fail(message?: string): void;\n}\n\n/**\n * TTY-aware progress spinner. Renders to **stderr** so that stdout stays a\n * clean payload stream (agents/scripts piping `| jq` are unaffected).\n *\n * When stderr is not a TTY (piped, redirected, CI, agent-invoked) the animation\n * is suppressed entirely — no control characters leak into logs. The optional\n * final status (`succeed`/`fail`) is still printed in that case so non-TTY\n * callers get a one-line outcome on stderr without the spinning frames.\n */\nexport function createSpinner(message: string): Spinner {\n const isTty = Boolean(process.stderr.isTTY);\n let current = message;\n\n if (!isTty) {\n return {\n update(msg: string) {\n current = msg;\n },\n stop() {},\n succeed(msg?: string) {\n if (msg) process.stderr.write(`${Formatter.status('success', msg)}\\n`);\n },\n fail(msg?: string) {\n process.stderr.write(`${Formatter.status('error', msg ?? current)}\\n`);\n },\n };\n }\n\n let frame = 0;\n const render = (): void => {\n process.stderr.write(`\\r\\x1b[K${SPINNER_FRAMES[frame]} ${current}`);\n frame = (frame + 1) % SPINNER_FRAMES.length;\n };\n render();\n const timer = setInterval(render, 80);\n\n const clear = (): void => {\n clearInterval(timer);\n process.stderr.write('\\r\\x1b[K');\n };\n\n return {\n update(msg: string) {\n current = msg;\n },\n stop() {\n clear();\n },\n succeed(msg?: string) {\n clear();\n if (msg) process.stderr.write(`${Formatter.status('success', msg)}\\n`);\n },\n fail(msg?: string) {\n clear();\n process.stderr.write(`${Formatter.status('error', msg ?? current)}\\n`);\n },\n };\n}\n\nfunction stringify(value: unknown): string {\n if (value === null || value === undefined) return '';\n if (typeof value === 'object') return JSON.stringify(value);\n return String(value);\n}\n\nexport class Formatter {\n /** Status-prefixed line, e.g. \"✓ done\". */\n static status(type: StatusType, message: string): string {\n return `${ICONS[type]} ${message}`;\n }\n\n /** Aligned columnar table for list output. */\n static table(headers: string[], rows: string[][]): string {\n const widths = headers.map((h, i) =>\n Math.max(h.length, ...rows.map((r) => (r[i] ?? '').length)),\n );\n const line = (cells: string[]): string =>\n cells.map((c, i) => (c ?? '').padEnd(widths[i])).join(' ');\n return [\n line(headers),\n widths.map((w) => '-'.repeat(w)).join(' '),\n ...rows.map(line),\n ].join('\\n');\n }\n\n /** Key-value detail output with left-aligned keys. */\n static keyValue(entries: [string, string][]): string {\n const width = Math.max(0, ...entries.map(([k]) => k.length));\n return entries.map(([k, v]) => `${k.padEnd(width)} ${v}`).join('\\n');\n }\n\n /** Best-effort human-readable rendering of arbitrary data. */\n static auto(data: unknown): string {\n if (Array.isArray(data)) {\n return Formatter.arrayTable(data);\n }\n if (data && typeof data === 'object') {\n const obj = data as Record<string, unknown>;\n const scalarEntries: [string, string][] = [];\n const tableSections: string[] = [];\n for (const [k, v] of Object.entries(obj)) {\n // Render an array-of-objects value as its own labelled sub-table\n // instead of dumping raw JSON on a key-value line.\n if (Array.isArray(v) && v.some((i) => i && typeof i === 'object')) {\n tableSections.push(`${k}:\\n${Formatter.arrayTable(v)}`);\n } else {\n scalarEntries.push([k, stringify(v)]);\n }\n }\n const parts: string[] = [];\n if (scalarEntries.length) parts.push(Formatter.keyValue(scalarEntries));\n parts.push(...tableSections);\n return parts.join('\\n\\n');\n }\n return stringify(data);\n }\n\n /** Render an array of objects as an aligned table; falls back gracefully. */\n private static arrayTable(items: unknown[]): string {\n if (items.length === 0) return '(empty)';\n const rows = items.filter(\n (i): i is Record<string, unknown> => Boolean(i) && typeof i === 'object',\n );\n if (rows.length === 0) {\n return items.map((i) => stringify(i)).join(', ');\n }\n const headers = Object.keys(rows[0]);\n return Formatter.table(\n headers,\n rows.map((r) => headers.map((h) => stringify(r[h]))),\n );\n }\n}\n","import { Formatter } from './formatter.js';\n\nexport type OutputFormat = 'json' | 'table';\n\n/** Schema descriptor a verb reserves for `--help --format json`. */\nexport interface VerbSchema {\n description: string;\n params: Record<string, string>;\n response: Record<string, string>;\n}\n\n/** Emit a result payload in the requested format (json default, table via Formatter). */\nexport function emit(data: unknown, format: OutputFormat = 'json'): void {\n if (format === 'table') {\n console.log(Formatter.auto(data));\n } else {\n console.log(JSON.stringify(data, null, 2));\n }\n}\n\n/** Helper for `--help --format json`: print a verb's param/response schema. */\nexport function emitSchema(schema: VerbSchema, format: OutputFormat = 'json'): void {\n if (format === 'table') {\n console.log(Formatter.keyValue(Object.entries(schema.params)));\n } else {\n console.log(JSON.stringify(schema, null, 2));\n }\n}\n","/**\n * CLI version source-of-truth + server-driven min-version negotiation.\n *\n * The running version is read from `package.json` at runtime (it lives outside\n * `rootDir`, so we read it via fs rather than importing it to keep `tsc` happy).\n * The server advertises the floor via the `X-CLI-Min-Version` response header;\n * if the local version is below it we throw CLI_OUTDATED and exit with code 2.\n */\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { CliError, ErrorCodes } from './errors.js';\n\nexport const UPGRADE_COMMAND = 'npm install -g agenzo-merchant-cli@latest';\n\nconst FALLBACK_VERSION = '0.1.0';\n\nlet cached: string | null = null;\n\nexport function getCurrentVersion(): string {\n if (cached !== null) return cached;\n const here = dirname(fileURLToPath(import.meta.url));\n // Both the bundled (dist/index.js) and source layouts resolve to package.json.\n const candidates = [\n join(here, '..', 'package.json'),\n join(here, '..', '..', 'package.json'),\n ];\n for (const p of candidates) {\n try {\n const pkg = JSON.parse(readFileSync(p, 'utf-8')) as { version?: string };\n if (typeof pkg.version === 'string') {\n cached = pkg.version;\n return cached;\n }\n } catch {\n // try the next candidate\n }\n }\n cached = FALLBACK_VERSION;\n return cached;\n}\n\n/** Returns negative / zero / positive comparing `a` against `b` (major.minor.patch). */\nexport function compareVersion(a: string, b: string): number {\n const parse = (v: string): number[] =>\n v\n .trim()\n .replace(/^v/, '')\n .split(/[-+]/)[0]\n .split('.')\n .map((n) => parseInt(n, 10) || 0);\n const pa = parse(a);\n const pb = parse(b);\n for (let i = 0; i < 3; i++) {\n const diff = (pa[i] ?? 0) - (pb[i] ?? 0);\n if (diff !== 0) return diff;\n }\n return 0;\n}\n\n/** Throw CLI_OUTDATED (exit code 2) when the local version is below the header floor. */\nexport function enforceMinVersion(header: string | null): void {\n const min = header?.trim();\n if (!min) return;\n const current = getCurrentVersion();\n if (compareVersion(current, min) < 0) {\n throw new CliError(\n ErrorCodes.CLI_OUTDATED,\n `CLI ${current} is below the required minimum ${min}.`,\n `Upgrade: ${UPGRADE_COMMAND}`,\n 2,\n );\n }\n}\n","import { Command } from 'commander';\nimport { ApiClient } from '../core/api-client.js';\nimport { CliError } from '../core/errors.js';\nimport { emit, type OutputFormat } from '../core/output.js';\nimport { createSpinner } from '../core/formatter.js';\nimport { PromptEngine } from '../core/prompt-engine.js';\nimport { attachSchemaHelp } from '../utils/cli-help.js';\nimport type { QuoteResponse } from '../types/api.js';\n\n/** Reserved for `--help --format json`. */\nexport const quoteSchema = {\n description: 'Request fare quotes for a ride between two points.',\n params: {\n 'pickup-lat': 'number — pickup latitude',\n 'pickup-lng': 'number — pickup longitude',\n 'pickup-name': 'string — pickup location name',\n 'dropoff-lat': 'number — dropoff latitude',\n 'dropoff-lng': 'number — dropoff longitude',\n 'dropoff-name': 'string — dropoff location name',\n 'pickup-time': 'number|string — epoch seconds, or \"now\"',\n 'passenger-name': 'string — lead passenger full name',\n 'passenger-phone': 'string — passenger phone in E.164 format',\n 'passenger-count': 'number — optional passenger count',\n 'luggage-count': 'number — optional luggage count',\n 'passenger-email': 'string — optional passenger email',\n 'children-count': 'number — optional children count',\n },\n response: {\n vehicle_classes:\n 'VehicleClass[] — each: vehicle_class, price{amount,currency,quote_id}, passenger_capacity, luggage_capacity (amount is a decimal in the currency standard unit, e.g. 42.50 = $42.50)',\n meet_and_greet: 'object|null — { available: boolean, price: { amount, currency } } when applicable',\n is_airport_transfer: 'boolean',\n airport_direction: 'string|null — pickup/dropoff direction for airport transfers',\n },\n};\n\nfunction need(value: string | undefined, flag: string): string {\n if (value === undefined) throw new CliError('PARAM_REQUIRED', `Missing required --${flag}.`);\n return value;\n}\n\nfunction num(value: string | undefined, flag: string): number {\n const n = Number(need(value, flag));\n if (!Number.isFinite(n)) throw new CliError('PARAM_INVALID', `--${flag} must be a number.`);\n return n;\n}\n\nexport function buildQuoteCommand(): Command {\n const cmd = new Command('quote')\n .description(quoteSchema.description)\n .option('--pickup-lat <lat>', 'Pickup latitude')\n .option('--pickup-lng <lng>', 'Pickup longitude')\n .option('--pickup-name <name>', 'Pickup location name')\n .option('--dropoff-lat <lat>', 'Dropoff latitude')\n .option('--dropoff-lng <lng>', 'Dropoff longitude')\n .option('--dropoff-name <name>', 'Dropoff location name')\n .option('--pickup-time <time>', 'Pickup time: epoch seconds, or \"now\"')\n .option('--passenger-name <name>', 'Lead passenger full name')\n .option('--passenger-phone <phone>', 'Passenger phone (E.164)')\n .option('--passenger-count <n>', 'Passenger count')\n .option('--luggage-count <n>', 'Luggage count')\n .option('--passenger-email <email>', 'Passenger email')\n .option('--children-count <n>', 'Children count')\n .action(async (_opts, command: Command) => {\n const o = command.optsWithGlobals();\n const format: OutputFormat = o.format === 'table' ? 'table' : 'json';\n const apiKey = await PromptEngine.resolveInput(o.apiKey, {\n message: 'API key:',\n type: 'password',\n });\n\n const body: Record<string, unknown> = {\n pickup: {\n lat: num(o.pickupLat, 'pickup-lat'),\n lng: num(o.pickupLng, 'pickup-lng'),\n name: need(o.pickupName, 'pickup-name'),\n },\n dropoff: {\n lat: num(o.dropoffLat, 'dropoff-lat'),\n lng: num(o.dropoffLng, 'dropoff-lng'),\n name: need(o.dropoffName, 'dropoff-name'),\n },\n pickup_time: o.pickupTime === 'now' ? 'now' : num(o.pickupTime, 'pickup-time'),\n passenger_name: need(o.passengerName, 'passenger-name'),\n passenger_phone: need(o.passengerPhone, 'passenger-phone'),\n };\n if (o.passengerCount !== undefined) body.passenger_count = num(o.passengerCount, 'passenger-count');\n if (o.luggageCount !== undefined) body.luggage_count = num(o.luggageCount, 'luggage-count');\n if (o.childrenCount !== undefined) body.children_count = num(o.childrenCount, 'children-count');\n if (o.passengerEmail !== undefined) body.passenger_email = o.passengerEmail;\n\n const client = new ApiClient({ apiKey });\n const spinner = createSpinner('Fetching quotes...');\n try {\n const data = await client.post<QuoteResponse>('/ride/quote', { body });\n spinner.stop();\n emit(data, format);\n } catch (err) {\n spinner.fail('Quote request failed');\n throw err;\n }\n });\n\n return attachSchemaHelp(cmd, quoteSchema);\n}\n","/**\n * HTTPS client for the ride/services API.\n *\n * - base = configured host; ride endpoints live under the `/api/v3/agent-pay` prefix\n * - auth via `X-Api-Key` header\n * - write operations may carry an `Idempotency-Key` header (never in the body)\n * - unwraps the v3 envelope `{ code, message, data }`: returns `data` on\n * success (code \"0000\"), throws CliError (server code/message) on failure\n * - negotiates the CLI version floor via the `X-CLI-Min-Version` header\n * - maps connection/timeout failures to NETWORK_ERROR / TIMEOUT\n */\nimport { CliError, ErrorCodes } from './errors.js';\nimport { getHost } from './config-manager.js';\nimport { enforceMinVersion, getCurrentVersion } from './version.js';\n\nconst RIDE_PREFIX = '/api/v3/agent-pay';\n\nexport interface ApiClientOptions {\n apiKey: string;\n host?: string;\n timeout?: number;\n}\n\nexport interface RequestOptions {\n body?: Record<string, unknown>;\n idempotencyKey?: string;\n query?: Record<string, string | number | boolean | undefined>;\n}\n\ninterface Envelope<T> {\n code?: string;\n message?: string;\n data?: T;\n}\n\nexport class ApiClient {\n private readonly host: string;\n private readonly apiKey: string;\n private readonly timeout: number;\n\n constructor(options: ApiClientOptions) {\n this.apiKey = options.apiKey;\n this.host = (options.host ?? getHost()).replace(/\\/+$/, '');\n this.timeout = options.timeout ?? 30000;\n }\n\n get<T>(path: string, options: RequestOptions = {}): Promise<T> {\n return this.request<T>('GET', path, options);\n }\n\n post<T>(path: string, options: RequestOptions = {}): Promise<T> {\n return this.request<T>('POST', path, options);\n }\n\n private async request<T>(\n method: string,\n path: string,\n options: RequestOptions,\n ): Promise<T> {\n let url = `${this.host}${RIDE_PREFIX}${path}`;\n if (options.query) {\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(options.query)) {\n if (value !== undefined) params.set(key, String(value));\n }\n const qs = params.toString();\n if (qs) url += `?${qs}`;\n }\n\n const headers: Record<string, string> = {\n 'X-Api-Key': this.apiKey,\n 'User-Agent': `agenzo-merchant-cli/${getCurrentVersion()}`,\n };\n if (options.body) headers['Content-Type'] = 'application/json';\n if (options.idempotencyKey) headers['Idempotency-Key'] = options.idempotencyKey;\n\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeout);\n\n let response: Response;\n try {\n response = await fetch(url, {\n method,\n headers,\n body: options.body ? JSON.stringify(options.body) : undefined,\n signal: controller.signal,\n });\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n throw new CliError(\n ErrorCodes.TIMEOUT,\n `Request timed out after ${this.timeout}ms: ${url}`,\n 'Retry, or check your network connection.',\n );\n }\n throw new CliError(\n ErrorCodes.NETWORK_ERROR,\n `Network request failed: ${url}`,\n 'Check your network connection and the configured API host.',\n );\n } finally {\n clearTimeout(timer);\n }\n\n // Enforce the server-advertised version floor before reading the body.\n enforceMinVersion(response.headers.get('x-cli-min-version'));\n\n const text = await response.text();\n let envelope: Envelope<T>;\n try {\n envelope = JSON.parse(text) as Envelope<T>;\n } catch {\n throw new CliError(\n ErrorCodes.NETWORK_ERROR,\n `Unexpected non-JSON response (HTTP ${response.status}) from ${url}`,\n );\n }\n\n if (envelope.code !== undefined && envelope.code !== '0000') {\n const code = envelope.code;\n const message = envelope.message ?? `Request failed (HTTP ${response.status})`;\n throw new CliError(code, message);\n }\n\n return envelope.data as T;\n }\n}\n","import { confirm, input, password, select } from '@inquirer/prompts';\n\nexport interface ResolveOptions {\n message: string;\n type?: 'input' | 'password' | 'select';\n choices?: { name: string; value: string }[];\n validate?: (value: string) => boolean | string;\n}\n\n/**\n * Interactive resolution for missing required parameters (api-key,\n * idempotency-key, etc.). When a flag value is supplied it is returned as-is.\n */\nexport class PromptEngine {\n static async resolveInput(\n flagValue: string | undefined,\n options: ResolveOptions,\n ): Promise<string> {\n if (flagValue !== undefined) return flagValue;\n if (options.type === 'password') {\n return password({ message: options.message, mask: '*' });\n }\n if (options.type === 'select' && options.choices) {\n return select({ message: options.message, choices: options.choices });\n }\n return input({ message: options.message, validate: options.validate });\n }\n\n /** Confirmation prompt; auto-approves when `--yes` is set. */\n static async confirm(message: string, yes: boolean): Promise<boolean> {\n if (yes) return true;\n return confirm({ message });\n }\n}\n","/**\n * `--help --format <fmt>` support shared by the read-only verbs.\n *\n * Commander processes `--help` before later argv tokens, so the resolved\n * `--format` option is not yet available when help renders. We therefore read\n * the format directly from `process.argv`: when it is explicitly `json`/`table`\n * we print the verb schema (via emitSchema) instead of the usage text, and let\n * commander render the default help otherwise.\n */\nimport type { Command } from 'commander';\nimport { emitSchema, type OutputFormat, type VerbSchema } from '../core/output.js';\n\nfunction explicitFormat(): OutputFormat | undefined {\n const argv = process.argv;\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n if (a === '--format=json' || (a === '--format' && argv[i + 1] === 'json')) return 'json';\n if (a === '--format=table' || (a === '--format' && argv[i + 1] === 'table')) return 'table';\n }\n return undefined;\n}\n\n/** Print `schema` for `--help --format json|table`; otherwise default usage. */\nexport function attachSchemaHelp(cmd: Command, schema: VerbSchema): Command {\n const baseHelp = cmd.helpInformation.bind(cmd);\n cmd.helpInformation = (ctx) => {\n const format = explicitFormat();\n if (!format) return baseHelp(ctx);\n emitSchema(schema, format);\n return '';\n };\n return cmd;\n}\n","/*\n * Booking funding is decided server-side by the developer's billing_mode:\n * - monthly_settlement: no payment handle; fare is deducted from the\n * developer's settlement account (payment_status=ON_ACCOUNT).\n * - pay_per_call: pass --payment-order-id (a PAID order from payment-cli).\n * Reserved — gated server-side until payment-cli ships (BACK-040).\n * The CLI no longer accepts --payment-method-id (the merchant domain never\n * holds a payment credential).\n */\nimport { Command } from 'commander';\nimport { ApiClient } from '../core/api-client.js';\nimport { emit, emitSchema, type OutputFormat, type VerbSchema } from '../core/output.js';\nimport { Formatter, createSpinner } from '../core/formatter.js';\nimport { PromptEngine } from '../core/prompt-engine.js';\nimport { resolveIdempotencyKey } from '../utils/idempotency.js';\n\n/** Reserved for `--help --format json`. */\nexport const bookSchema: VerbSchema = {\n description: 'Book a ride against a previously returned quote.',\n params: {\n 'quote-id': 'string — required, quote id from `ride quote`',\n 'vehicle-class': 'string — required, chosen vehicle class',\n 'price-amount': 'number — required, fare in decimal currency units (not cents)',\n 'price-currency': 'string — currency code (default USD)',\n 'payment-order-id': 'string — conditional. Required for pay_per_call billing (a PAID order from payment-cli); omit for monthly_settlement (deducted from the settlement account)',\n 'passenger-name': 'string — required, passenger full name',\n 'passenger-phone': 'string — required, passenger phone',\n 'passenger-email': 'string — optional passenger email',\n 'luggage-count': 'number — optional luggage count',\n 'special-requests': 'string — optional free-text requests',\n 'pickup-lat': 'number — required, pickup latitude',\n 'pickup-lng': 'number — required, pickup longitude',\n 'pickup-name': 'string — required, pickup location name',\n 'dropoff-lat': 'number — required, dropoff latitude',\n 'dropoff-lng': 'number — required, dropoff longitude',\n 'dropoff-name': 'string — required, dropoff location name',\n 'pickup-time': 'number|string — required, epoch seconds or \"now\" (must match quote)',\n 'meet-and-greet': 'boolean — optional meet & greet service',\n 'meet-and-greet-price': 'number — optional meet & greet surcharge',\n 'welcome-sign': 'string — optional welcome sign text',\n 'arrival-flight-no': 'string — optional arrival flight number',\n 'arrival-airline': 'string — optional arrival airline',\n 'departure-flight-no': 'string — optional departure flight number',\n 'departure-airline': 'string — optional departure airline',\n 'idempotency-key': 'string — required, sent as the Idempotency-Key header (never in body)',\n },\n response: {\n ride_id: 'string — booked ride id, used by `ride get` / `ride cancel`',\n order_id: 'string — internal ride order id (rio_...)',\n status: 'string — initial ride status (e.g. INIT / Pending)',\n price: '{ amount, currency, quote_id } — confirmed fare',\n payment_status: 'string — ON_ACCOUNT (monthly_settlement) or PAID (pay_per_call)',\n billing_entry_id: 'string — settlement ledger entry id (monthly_settlement only)',\n },\n};\n\nexport function buildBookCommand(): Command {\n return new Command('book')\n .description(bookSchema.description)\n .helpOption(false)\n .option('--help', 'Show help (add --format json for the machine-readable schema)')\n .option('--format <format>', 'Output format: json|table')\n .option('--api-key <key>', 'API key for runtime requests')\n .option('--yes', 'Skip confirmation prompts')\n .option('--quote-id <id>', 'Quote id from `ride quote`')\n .option('--vehicle-class <class>', 'Chosen vehicle class')\n .option('--price-amount <amount>', 'Fare in decimal currency units (not cents)')\n .option('--price-currency <currency>', 'Currency code (default USD)')\n .option('--payment-order-id <id>', 'Paid payment order id (pay_per_call mode only)')\n .option('--passenger-name <name>', 'Passenger full name')\n .option('--passenger-phone <phone>', 'Passenger phone')\n .option('--passenger-email <email>', 'Passenger email')\n .option('--luggage-count <n>', 'Luggage count')\n .option('--special-requests <text>', 'Free-text special requests')\n .option('--pickup-lat <lat>', 'Pickup latitude')\n .option('--pickup-lng <lng>', 'Pickup longitude')\n .option('--pickup-name <name>', 'Pickup location name')\n .option('--dropoff-lat <lat>', 'Dropoff latitude')\n .option('--dropoff-lng <lng>', 'Dropoff longitude')\n .option('--dropoff-name <name>', 'Dropoff location name')\n .option('--pickup-time <time>', 'Pickup time: epoch seconds, or \"now\"')\n .option('--meet-and-greet', 'Enable meet & greet service')\n .option('--meet-and-greet-price <amount>', 'Meet & greet surcharge')\n .option('--welcome-sign <text>', 'Welcome sign text')\n .option('--arrival-flight-no <no>', 'Arrival flight number')\n .option('--arrival-airline <airline>', 'Arrival airline')\n .option('--departure-flight-no <no>', 'Departure flight number')\n .option('--departure-airline <airline>', 'Departure airline')\n .option('--idempotency-key <key>', 'Caller-supplied idempotency key')\n .action(async (_options, command: Command) => {\n const merged = command.optsWithGlobals();\n const format: OutputFormat = merged.format === 'table' ? 'table' : 'json';\n\n if (merged.help) {\n const wantsSchema = process.argv.some((a) => a === '--format' || a.startsWith('--format='));\n if (wantsSchema) emitSchema(bookSchema, format);\n else command.outputHelp();\n return;\n }\n\n const yes = merged.yes === true;\n const apiKey = await PromptEngine.resolveInput(merged.apiKey, {\n message: 'API key:',\n type: 'password',\n });\n const quoteId = await PromptEngine.resolveInput(merged.quoteId, { message: 'Quote id:' });\n const vehicleClass = await PromptEngine.resolveInput(merged.vehicleClass, {\n message: 'Vehicle class:',\n });\n const priceAmount = await PromptEngine.resolveInput(merged.priceAmount, {\n message: 'Price amount (decimal):',\n });\n const passengerName = await PromptEngine.resolveInput(merged.passengerName, {\n message: 'Passenger name:',\n });\n const passengerPhone = await PromptEngine.resolveInput(merged.passengerPhone, {\n message: 'Passenger phone:',\n });\n\n const body: Record<string, unknown> = {\n quote_id: quoteId,\n vehicle_class: vehicleClass,\n price_amount: Number(priceAmount),\n price_currency: merged.priceCurrency ?? 'USD',\n passenger_name: passengerName,\n passenger_phone: passengerPhone,\n };\n // Funding is decided server-side by the developer's billing_mode:\n // - monthly_settlement: no payment handle (deducted from the account)\n // - pay_per_call: --payment-order-id (a PAID order from payment-cli)\n // Both flags are optional here; the backend rejects the wrong one.\n if (merged.paymentOrderId) body.payment_order_id = merged.paymentOrderId;\n if (merged.passengerEmail) body.passenger_email = merged.passengerEmail;\n if (merged.luggageCount !== undefined) body.luggage_count = Number(merged.luggageCount);\n if (merged.specialRequests) body.special_requests = merged.specialRequests;\n if (merged.pickupLat || merged.pickupLng || merged.pickupName) {\n body.pickup = { lat: Number(merged.pickupLat), lng: Number(merged.pickupLng), name: merged.pickupName };\n }\n if (merged.dropoffLat || merged.dropoffLng || merged.dropoffName) {\n body.dropoff = { lat: Number(merged.dropoffLat), lng: Number(merged.dropoffLng), name: merged.dropoffName };\n }\n if (merged.pickupTime) body.pickup_time = merged.pickupTime;\n if (merged.meetAndGreet) body.meet_and_greet = true;\n if (merged.meetAndGreetPrice !== undefined) body.meet_and_greet_price = Number(merged.meetAndGreetPrice);\n if (merged.welcomeSign) body.welcome_sign = merged.welcomeSign;\n if (merged.arrivalFlightNo || merged.arrivalAirline) {\n body.arrival_flight = { flight_no: merged.arrivalFlightNo, airline: merged.arrivalAirline };\n }\n if (merged.departureFlightNo || merged.departureAirline) {\n body.departure_flight = { flight_no: merged.departureFlightNo, airline: merged.departureAirline };\n }\n\n if (!(await PromptEngine.confirm(`Book ride with quote ${quoteId}?`, yes))) {\n console.log(Formatter.status('info', 'Booking aborted.'));\n return;\n }\n\n const idempotencyKey = await resolveIdempotencyKey(merged.idempotencyKey, { yes });\n const client = new ApiClient({ apiKey });\n const spinner = createSpinner('Booking ride...');\n try {\n const data = await client.post('/ride/book', { body, idempotencyKey });\n spinner.stop();\n emit(data, format);\n } catch (err) {\n spinner.fail('Booking failed');\n throw err;\n }\n });\n}\n","import { input } from '@inquirer/prompts';\nimport { CliError, ErrorCodes } from '../core/errors.js';\n\nconst KEY_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;\nconst RULE = 'Use 1-128 characters from [A-Za-z0-9_-].';\n\n/** Validate + normalize a caller-supplied idempotency key. */\nexport function normalizeIdempotencyKey(key: string): string {\n const trimmed = key.trim();\n if (!KEY_PATTERN.test(trimmed)) {\n throw new CliError(\n ErrorCodes.PARAM_IDEMPOTENCY_KEY_REQUIRED,\n `Invalid idempotency key: \"${key}\".`,\n RULE,\n );\n }\n return trimmed;\n}\n\n/**\n * Resolve the idempotency key for a write operation. The CLI never generates\n * one: if absent and `--yes` is set it is a hard error, otherwise we prompt.\n */\nexport async function resolveIdempotencyKey(\n flagValue: string | undefined,\n options: { yes?: boolean },\n): Promise<string> {\n if (flagValue !== undefined) return normalizeIdempotencyKey(flagValue);\n if (options.yes) {\n throw new CliError(\n ErrorCodes.PARAM_IDEMPOTENCY_KEY_REQUIRED,\n 'An idempotency key is required for write operations.',\n 'Pass --idempotency-key <key>; the CLI never auto-generates one.',\n );\n }\n const entered = await input({\n message: 'Idempotency key:',\n validate: (v) => KEY_PATTERN.test(v.trim()) || RULE,\n });\n return normalizeIdempotencyKey(entered);\n}\n","import { Command } from 'commander';\nimport { ApiClient } from '../core/api-client.js';\nimport { emit, type OutputFormat } from '../core/output.js';\nimport { createSpinner } from '../core/formatter.js';\nimport { PromptEngine } from '../core/prompt-engine.js';\nimport { attachSchemaHelp } from '../utils/cli-help.js';\nimport type { GetOrderResponse } from '../types/api.js';\n\n/** Reserved for `--help --format json`. */\nexport const rideGetSchema = {\n description: 'Retrieve a single ride order status by id (repeatable for polling).',\n params: {\n 'order-id': 'string — ride order id (the ride_id returned by `ride book`)',\n },\n response: {\n status:\n 'OrderStatus — case-sensitive; terminal states: At destination | Cancelled | Rejected | Customer no show | Driver no show',\n from: 'GeoPoint — pickup',\n to: 'GeoPoint — dropoff',\n pickup_time: 'number|string',\n vehicle_class: 'string',\n price: 'Price{amount,currency} — amount is a decimal in the currency standard unit',\n passenger: 'Passenger',\n driver: 'Driver — present after assignment',\n vehicle: 'Vehicle — present after assignment',\n },\n};\n\nexport function buildRideGetCommand(): Command {\n const cmd = new Command('get')\n .description(rideGetSchema.description)\n .option('--order-id <id>', 'Ride order id (the ride_id returned by `ride book`)')\n .action(async (_opts, command: Command) => {\n const o = command.optsWithGlobals();\n const format: OutputFormat = o.format === 'table' ? 'table' : 'json';\n const apiKey = await PromptEngine.resolveInput(o.apiKey, {\n message: 'API key:',\n type: 'password',\n });\n const orderId = await PromptEngine.resolveInput(o.orderId, { message: 'Order id:' });\n\n const client = new ApiClient({ apiKey });\n const spinner = createSpinner('Fetching ride status...');\n try {\n const data = await client.get<GetOrderResponse>(\n `/ride/${encodeURIComponent(orderId)}/status`,\n );\n spinner.stop();\n emit(data, format);\n } catch (err) {\n spinner.fail('Failed to fetch ride status');\n throw err;\n }\n });\n\n return attachSchemaHelp(cmd, rideGetSchema);\n}\n","import { Command } from 'commander';\nimport { ApiClient } from '../core/api-client.js';\nimport { emit, emitSchema, type OutputFormat, type VerbSchema } from '../core/output.js';\nimport { Formatter, createSpinner } from '../core/formatter.js';\nimport { PromptEngine } from '../core/prompt-engine.js';\nimport { resolveIdempotencyKey } from '../utils/idempotency.js';\n\n/** Reserved for `--help --format json`. */\nexport const cancelSchema: VerbSchema = {\n description: 'Cancel a ride order; may incur a cancellation fee.',\n params: {\n 'order-id': 'string — required, order id (a.k.a. ride id) to cancel',\n 'idempotency-key': 'string — required, sent as the Idempotency-Key header (never in body)',\n },\n response: {\n ride_id: 'string — cancelled ride id',\n ride_stat: 'string — resulting ride status',\n cancellation: '{ cancellation_fee, reversal_amount, currency }',\n },\n};\n\nexport function buildCancelCommand(): Command {\n return new Command('cancel')\n .description(cancelSchema.description)\n .helpOption(false)\n .option('--help', 'Show help (add --format json for the machine-readable schema)')\n .option('--format <format>', 'Output format: json|table')\n .option('--api-key <key>', 'API key for runtime requests')\n .option('--yes', 'Skip confirmation prompts')\n .option('--order-id <id>', 'Order id (a.k.a. ride id) to cancel')\n .option('--idempotency-key <key>', 'Caller-supplied idempotency key')\n .action(async (_options, command: Command) => {\n const merged = command.optsWithGlobals();\n const format: OutputFormat = merged.format === 'table' ? 'table' : 'json';\n\n if (merged.help) {\n const wantsSchema = process.argv.some((a) => a === '--format' || a.startsWith('--format='));\n if (wantsSchema) emitSchema(cancelSchema, format);\n else command.outputHelp();\n return;\n }\n\n const yes = merged.yes === true;\n const apiKey = await PromptEngine.resolveInput(merged.apiKey, {\n message: 'API key:',\n type: 'password',\n });\n const orderId = await PromptEngine.resolveInput(merged.orderId, { message: 'Order id:' });\n\n if (!(await PromptEngine.confirm(`Cancel order ${orderId}? This may incur a fee.`, yes))) {\n console.log(Formatter.status('info', 'Cancellation aborted.'));\n return;\n }\n\n const idempotencyKey = await resolveIdempotencyKey(merged.idempotencyKey, { yes });\n const client = new ApiClient({ apiKey });\n const spinner = createSpinner('Cancelling ride...');\n try {\n const data = await client.post(`/ride/${encodeURIComponent(orderId)}/cancel`, { idempotencyKey });\n spinner.stop();\n emit(data, format);\n } catch (err) {\n spinner.fail('Cancellation failed');\n throw err;\n }\n });\n}\n","import { Command } from 'commander';\nimport { ApiClient } from '../core/api-client.js';\nimport { emit, type OutputFormat } from '../core/output.js';\nimport { createSpinner } from '../core/formatter.js';\nimport { PromptEngine } from '../core/prompt-engine.js';\nimport { attachSchemaHelp } from '../utils/cli-help.js';\nimport type { ListOrdersResponse } from '../types/api.js';\n\n/** Reserved for `--help --format json`. */\nexport const listOrdersSchema = {\n description: 'List ride orders with pagination and optional filters.',\n params: {\n page: 'number — page number (default 1)',\n 'page-size': 'number — page size (default 20)',\n status: 'OrderStatus — optional status filter',\n 'order-type': 'string — optional order type filter',\n },\n response: {\n orders: 'Order[]',\n total: 'number',\n page: 'number',\n page_size: 'number',\n },\n};\n\nexport function buildListOrdersCommand(): Command {\n const cmd = new Command('list-orders')\n .description(listOrdersSchema.description)\n .option('--page <page>', 'Page number', '1')\n .option('--page-size <size>', 'Page size', '20')\n .option('--status <status>', 'Filter by order status')\n .option('--order-type <type>', 'Filter by order type')\n .action(async (_opts, command: Command) => {\n const o = command.optsWithGlobals();\n const format: OutputFormat = o.format === 'table' ? 'table' : 'json';\n const apiKey = await PromptEngine.resolveInput(o.apiKey, {\n message: 'API key:',\n type: 'password',\n });\n\n const client = new ApiClient({ apiKey });\n const spinner = createSpinner('Fetching orders...');\n try {\n const data = await client.get<ListOrdersResponse>('/ride/orders', {\n query: {\n page: Number(o.page),\n page_size: Number(o.pageSize),\n status: o.status,\n order_type: o.orderType,\n },\n });\n spinner.stop();\n emit(data, format);\n } catch (err) {\n spinner.fail('Failed to fetch orders');\n throw err;\n }\n });\n\n return attachSchemaHelp(cmd, listOrdersSchema);\n}\n","import { Command } from 'commander';\nimport { emit, emitSchema, type OutputFormat, type VerbSchema } from '../core/output.js';\nimport { SERVICE_REGISTRY } from './registry.js';\n\n/** Reserved for `--help --format json`. */\nexport const servicesListSchema: VerbSchema = {\n description: 'List available merchant services from the registry.',\n params: {},\n response: {\n services:\n 'Service[] — each with service_id, name, provider, cli_noun, version, verbs, billing_mode',\n },\n};\n\nfunction resolveFormat(cmd: Command): OutputFormat {\n return cmd.optsWithGlobals().format === 'table' ? 'table' : 'json';\n}\n\nexport function buildServicesListCommand(): Command {\n return new Command('list')\n .description(servicesListSchema.description)\n .helpOption(false)\n .option('-h, --help', 'Show help; with --format json prints the schema')\n .action((opts: { help?: boolean }, cmd: Command) => {\n const format = resolveFormat(cmd);\n if (opts.help) {\n emitSchema(servicesListSchema, format);\n return;\n }\n const services = SERVICE_REGISTRY.map((s) => ({\n service_id: s.service_id,\n name: s.name,\n provider: s.provider,\n cli_noun: s.cli_noun,\n version: s.version,\n verbs: s.verbs.join(', '),\n billing_mode: s.billing.mode,\n }));\n emit(services, format);\n });\n}\n","/**\n * Built-in static capability registry — no backend required.\n *\n * Each entry describes a CLI-exposed service: which `cli_noun` group hosts it,\n * the verbs it offers (with one-line descriptions), the recommended call\n * `workflow`, discovery hints, and its billing mode. `services list` renders a\n * summary of these entries and `services get <service-id>` returns one in full.\n */\n\n/** Billing model for a service. This iteration only ships pay-per-call. */\nexport type BillingMode = 'pay_per_call';\n\nexport interface ServiceBilling {\n mode: BillingMode;\n}\n\nexport interface ServiceDiscovery {\n /** Command an agent can run to discover the verbs in detail. */\n help_command: string;\n}\n\nexport interface ServiceCapability {\n service_id: string;\n name: string;\n description: string;\n version: string;\n /** Upstream capability provider. */\n provider: string;\n /** Top-level CLI noun (command group) that hosts this service's verbs. */\n cli_noun: string;\n /** Verb names exposed under `cli_noun`. */\n verbs: string[];\n /** One-line description per verb, keyed by verb name. */\n verb_descriptions: Record<string, string>;\n /** Ordered call sequence; `[cancel]` is optional. */\n workflow: string[];\n /** ISO date the capability became available. */\n since: string;\n discovery: ServiceDiscovery;\n billing: ServiceBilling;\n}\n\n/** Static registry. This iteration ships a single `ride` capability. */\nexport const SERVICE_REGISTRY: ServiceCapability[] = [\n {\n service_id: 'ride',\n name: 'Ride',\n description: 'On-demand ride ordering: quote a fare, book it, poll status, and cancel.',\n version: '1.0.0',\n provider: 'elife',\n cli_noun: 'ride',\n verbs: ['quote', 'book', 'get', 'cancel', 'list-orders'],\n verb_descriptions: {\n quote: 'Request fare quotes for a ride between two points.',\n book: 'Book a ride using a quote_id returned by quote.',\n get: 'Retrieve a ride order by id (poll for status changes).',\n cancel: 'Cancel a ride order by id.',\n 'list-orders': 'List previously placed ride orders.',\n },\n workflow: ['quote', 'book', 'get (poll for status)', 'cancel (optional)'],\n since: '2026-06-01',\n discovery: { help_command: 'agenzo-merchant-cli ride --help' },\n billing: { mode: 'pay_per_call' },\n },\n];\n\n/** Look up a capability by its service_id. */\nexport function findService(serviceId: string): ServiceCapability | undefined {\n return SERVICE_REGISTRY.find((s) => s.service_id === serviceId);\n}\n","import { Command } from 'commander';\nimport { CliError, ErrorCodes } from '../core/errors.js';\nimport { emit, emitSchema, type OutputFormat, type VerbSchema } from '../core/output.js';\nimport { findService } from './registry.js';\n\n/** Reserved for `--help --format json`. */\nexport const serviceGetSchema: VerbSchema = {\n description: 'Retrieve a single merchant service by id, with verb and workflow detail.',\n params: {\n 'service-id': 'string — service id to retrieve',\n },\n response: {\n service_id: 'string',\n name: 'string',\n description: 'string',\n version: 'string',\n provider: 'string',\n cli_noun: 'string',\n verbs: 'string[]',\n verb_descriptions: 'Record<verb, description>',\n workflow: 'string[] — ordered steps quote→book→get(poll)→[cancel]',\n since: 'string — ISO date',\n discovery: '{ help_command: string }',\n billing: '{ mode: \"pay_per_call\" }',\n },\n};\n\nfunction resolveFormat(cmd: Command): OutputFormat {\n return cmd.optsWithGlobals().format === 'table' ? 'table' : 'json';\n}\n\nexport function buildServiceGetCommand(): Command {\n return new Command('get')\n .description(serviceGetSchema.description)\n .argument('[service-id]', 'Service id to retrieve')\n .helpOption(false)\n .option('-h, --help', 'Show help; with --format json prints the schema')\n .action((serviceId: string | undefined, opts: { help?: boolean }, cmd: Command) => {\n const format = resolveFormat(cmd);\n if (opts.help) {\n emitSchema(serviceGetSchema, format);\n return;\n }\n const service = serviceId ? findService(serviceId) : undefined;\n if (!service) {\n throw new CliError(\n ErrorCodes.SERVICE_NOT_FOUND,\n `Service '${serviceId ?? ''}' not found in the registry (SERVICE_NOT_FOUND).`,\n 'Run \"services list\" to see available services.',\n );\n }\n emit(service, format);\n });\n}\n"],"mappings":";;;AAAA,SAAS,WAAAA,gBAAe;;;ACKjB,IAAM,aAAa;AAAA,EACxB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,0BAA0B;AAAA,EAC1B,mBAAmB;AAAA,EACnB,gCAAgC;AAAA,EAChC,eAAe;AAAA,EACf,SAAS;AAAA,EACT,cAAc;AAAA,EACd,cAAc;AAAA,EACd,iBAAiB;AACnB;AASO,IAAM,WAAN,cAAuB,MAAM;AAAA,EAClC,YACkB,MAChB,SACgB,UACA,WAAmB,GACnC;AACA,UAAM,OAAO;AALG;AAEA;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AAAA,EAPkB;AAAA,EAEA;AAAA,EACA;AAKpB;;;AChCA,SAAS,WAAW,cAAc,qBAAqB;AACvD,SAAS,eAAe;AACxB,SAAS,YAAY;AAGd,IAAM,eAAe;AAE5B,IAAM,aAAa,KAAK,QAAQ,GAAG,sBAAsB;AACzD,IAAM,cAAc,KAAK,YAAY,aAAa;AAMlD,SAAS,OAAe;AACtB,MAAI;AACJ,MAAI;AACF,UAAM,aAAa,aAAa,OAAO;AAAA,EACzC,SAAS,OAAO;AACd,QAAK,MAAgC,SAAS,UAAU;AACtD,aAAO,EAAE,MAAM,aAAa;AAAA,IAC9B;AACA,UAAM;AAAA,EACR;AACA,MAAI;AACF,UAAM,SAAS,KAAK,MAAM,GAAG;AAC7B,WAAO,EAAE,MAAM,OAAO,QAAQ,aAAa;AAAA,EAC7C,QAAQ;AACN,UAAM,IAAI;AAAA,MACR,WAAW;AAAA,MACX,wBAAwB,WAAW;AAAA,MACnC;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,MAAM,QAAsB;AACnC,YAAU,YAAY,EAAE,WAAW,KAAK,CAAC;AACzC,gBAAc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EAAE,MAAM,CAAC,UAAmB;AAC/B,MAAI,iBAAiB,UAAU;AAC7B,YAAQ,MAAM,UAAU,OAAO,SAAS,MAAM,OAAO,CAAC;AACtD,QAAI,MAAM,SAAU,SAAQ,MAAM,UAAU,OAAO,QAAQ,MAAM,QAAQ,CAAC;AAC1E,YAAQ,KAAK,MAAM,QAAQ;AAAA,EAC7B;AACA,UAAQ;AAAA,IACN,UAAU,OAAO,SAAS,iBAAiB,QAAQ,MAAM,UAAU,8BAA8B;AAAA,EACnG;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["Command","readFileSync","join","join","readFileSync","Command","input","input","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","resolveFormat","Command","resolveFormat","Command"]}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@agenzo/merchant-cli",
3
+ "version": "0.1.1",
4
+ "description": "CLI tool for AI Agents to order rides and query merchant services",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "agenzo-merchant-cli": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "SKILL.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsup",
17
+ "dev": "tsup --watch",
18
+ "lint": "eslint src",
19
+ "test:drift": "node scripts/schema-drift-check.mjs",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/CardInfoLink/agenzo-token-cli.git",
25
+ "directory": "merchant-cli"
26
+ },
27
+ "homepage": "https://github.com/CardInfoLink/agenzo-token-cli/tree/main/merchant-cli#readme",
28
+ "bugs": {
29
+ "url": "https://github.com/CardInfoLink/agenzo-token-cli/issues"
30
+ },
31
+ "author": "CardInfoLink",
32
+ "keywords": [
33
+ "cli",
34
+ "ai-agent",
35
+ "ride-hailing",
36
+ "merchant",
37
+ "fintech",
38
+ "developer-tools"
39
+ ],
40
+ "engines": {
41
+ "node": ">=18.0.0"
42
+ },
43
+ "license": "MIT",
44
+ "dependencies": {
45
+ "@inquirer/prompts": "^8.4.2",
46
+ "commander": "^14.0.3"
47
+ },
48
+ "devDependencies": {
49
+ "@eslint/js": "^9.0.0",
50
+ "@types/node": "^25.6.0",
51
+ "eslint": "^9.0.0",
52
+ "tsup": "^8.5.1",
53
+ "typescript": "^6.0.3",
54
+ "typescript-eslint": "^8.0.0"
55
+ }
56
+ }