@gravity-rail/cli 0.56.0 → 0.57.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/dist/lib.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { GravityRailClient, PhoneCall } from '@gravity-rail/sdk';
2
- import { E as EnvironmentConfig, C as CredentialsManager, a as CLICredentials } from './cli-client-context-cd5f2JKX.js';
3
- export { b as ConciergeAppContextPayload, c as buildCliConciergeAppContext } from './cli-client-context-cd5f2JKX.js';
2
+ import { EnvironmentConfig, CredentialsManager, CLICredentials } from './cli-utils.js';
3
+ export { b as ConciergeAppContextPayload, j as buildCliConciergeAppContext } from './cli-client-context-NJgZhyfd.js';
4
4
 
5
5
  /** Metadata extracted from a paginated API response */
6
6
  interface PaginationMeta {
@@ -293,6 +293,13 @@ interface CommandDef<T = unknown> {
293
293
  * does not mutate. false: the command reads a dedicated binary/CSV file argument.
294
294
  */
295
295
  acceptsJsonInput?: boolean;
296
+ /**
297
+ * The JSON body is usually another command's output (`gr x list -o json | gr x import`):
298
+ * wait for piped stdin (see `commandAwaitsPipedInput`) instead of treating a pipe whose
299
+ * producer has not written yet as no input. A function decides per invocation, for a
300
+ * command whose body is optional with some flags. Implies `acceptsJsonInput`.
301
+ */
302
+ pipesJsonInput?: boolean | ((args: ParsedArgs) => boolean);
296
303
  columns?: TableColumn<T>[];
297
304
  handler: (hctx: CommandHandlerContext) => Promise<void>;
298
305
  }
@@ -393,8 +400,30 @@ declare function isWorkspaceExportZip(data: unknown): data is WorkspaceExportZip
393
400
  * skips the body.
394
401
  */
395
402
  declare function commandNeedsJsonBody(cmd: CommandDef, parsedArgs: ParsedArgs): boolean;
396
- /** Read JSON input from --data string, --file path, or stdin (if piped) */
397
- declare function readJsonInput(args: ParsedArgs): Promise<unknown | undefined>;
403
+ /**
404
+ * How long a command whose input is another command's output waits for the
405
+ * first byte on piped stdin. The producer (`gr hubspot search -o json | …`)
406
+ * may spend seconds on a vendor API before it writes anything.
407
+ */
408
+ declare const PIPED_INPUT_FIRST_BYTE_WAIT_MS = 60000;
409
+ /**
410
+ * Whether this invocation should wait for piped stdin rather than treat a
411
+ * silent pipe as "no input": the command declares `pipesJsonInput` and no
412
+ * --data / --file was given.
413
+ */
414
+ declare function commandAwaitsPipedInput(cmd: CommandDef, parsedArgs: ParsedArgs): boolean;
415
+ /** The JSON body a dispatcher hands this command's handler, or undefined. */
416
+ declare function readCommandJsonInput(cmd: CommandDef, parsedArgs: ParsedArgs): Promise<unknown | undefined>;
417
+ /**
418
+ * Read JSON input from --data string, --file path, or stdin (if piped).
419
+ *
420
+ * `pipedInputWaitMs` > 0 waits up to that long for the first byte on a
421
+ * non-TTY stdin, then reads to EOF. 0 (the default) returns undefined at once
422
+ * when nothing is buffered, so an inherited idle stdin never hangs a command.
423
+ */
424
+ declare function readJsonInput(args: ParsedArgs, options?: {
425
+ pipedInputWaitMs?: number;
426
+ }): Promise<unknown | undefined>;
398
427
 
399
428
  /** True when the number is a provisioned test placeholder, not a real handset. */
400
429
  declare function isLikelySeedPhoneNumber(phone: string): boolean;
@@ -720,4 +749,5 @@ declare function organizationsListCommand(ctx: AuthenticatedContext, options?: {
720
749
 
721
750
  declare function whoamiCommand(ctx: AuthenticatedContext): Promise<void>;
722
751
 
723
- export { type ArgDef, AuthRequiredError, type AuthenticatedContext, CLIError, COL, type CommandContext, type CommandDef, type CommandHandlerContext, CommandRegistry, type ConciergeChat, type ConciergeMessage, type DomainDef, type GlobalOptions, type GlobalOptionsResult, type GlobalOptionsSpec, LIST_PAGINATION_ARGS, type OutputFormat, type OutputOptions, PAGINATION_ARGS, type PaginationMeta, type ParsedArgs, type ParsedGlobalOptions, type PublicGlobalOptions, type TableColumn, WORKSPACE_EXPORT_ZIP, type WorkspaceExportZipInput, authBrowserCommand, authImportDevCommand, authListCommand, authSwitchCommand, chatCommand, commandNeedsJsonBody, conciergeCommand, conciergeOutboundCommand, confirmAccountPhoneVerify, createAuthenticatedContext, createConciergeChat, createContext, createPublicAuthenticatedContext, createPublicContext, crudCommands, detectOutputFormat, devImportLocalCommand, extractPaginationMeta, fetchAllCursorPages, fetchAllPages, flushStdout, formatPaginationWarning, getConciergeChat, getConciergeChatMessages, getStartedCommand, handleError, hint, importDevProfiles, isCursorPaginatedResponse, isDirectoryTrusted, isLikelySeedPhoneNumber, isListResult, isPagePaginatedResponse, isPaginatedResponse, isWorkspaceExportZip, listConciergeChats, listResult, loginCommand, logoutCommand, manageCommand, organizationsListCommand, originateConciergeCall, originateConciergeSms, outputData, outputSingle, parseArgs, parseGlobalOptions, parsePaginationArgs, profilesFromDevRealms, readJsonInput, registerPublicDomains, requireAuth, requireDirectoryTrust, requireNumber, requireString, resolveVoicePhoneNumberId, simpleCrudCommands, startAccountPhoneVerify, stderr, topLevelCommands, unwrapItems, waitForOutboundPhoneCallOutcome, whoamiCommand };
752
+ export { AuthRequiredError, CLIError, COL, CommandRegistry, LIST_PAGINATION_ARGS, PAGINATION_ARGS, PIPED_INPUT_FIRST_BYTE_WAIT_MS, WORKSPACE_EXPORT_ZIP, authBrowserCommand, authImportDevCommand, authListCommand, authSwitchCommand, chatCommand, commandAwaitsPipedInput, commandNeedsJsonBody, conciergeCommand, conciergeOutboundCommand, confirmAccountPhoneVerify, createAuthenticatedContext, createConciergeChat, createContext, createPublicAuthenticatedContext, createPublicContext, crudCommands, detectOutputFormat, devImportLocalCommand, extractPaginationMeta, fetchAllCursorPages, fetchAllPages, flushStdout, formatPaginationWarning, getConciergeChat, getConciergeChatMessages, getStartedCommand, handleError, hint, importDevProfiles, isCursorPaginatedResponse, isDirectoryTrusted, isLikelySeedPhoneNumber, isListResult, isPagePaginatedResponse, isPaginatedResponse, isWorkspaceExportZip, listConciergeChats, listResult, loginCommand, logoutCommand, manageCommand, organizationsListCommand, originateConciergeCall, originateConciergeSms, outputData, outputSingle, parseArgs, parseGlobalOptions, parsePaginationArgs, profilesFromDevRealms, readCommandJsonInput, readJsonInput, registerPublicDomains, requireAuth, requireDirectoryTrust, requireNumber, requireString, resolveVoicePhoneNumberId, simpleCrudCommands, startAccountPhoneVerify, stderr, topLevelCommands, unwrapItems, waitForOutboundPhoneCallOutcome, whoamiCommand };
753
+ export type { ArgDef, AuthenticatedContext, CommandContext, CommandDef, CommandHandlerContext, ConciergeChat, ConciergeMessage, DomainDef, GlobalOptions, GlobalOptionsResult, GlobalOptionsSpec, OutputFormat, OutputOptions, PaginationMeta, ParsedArgs, ParsedGlobalOptions, PublicGlobalOptions, TableColumn, WorkspaceExportZipInput };