@gravity-rail/cli 0.5.0 → 0.6.0

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 { ApiClient } from '@gravity-rail/client';
2
- import { E as EnvironmentConfig, C as CredentialsManager } from './auth-DBspA1Dh.js';
3
- import { GravityRailClient } from '@gravity-rail/sdk';
2
+ import { E as EnvironmentConfig, C as CredentialsManager } from './cli-client-context-9KRUt6O-.js';
3
+ export { a as ConciergeAppContextPayload, b as buildCliConciergeAppContext } from './cli-client-context-9KRUt6O-.js';
4
4
 
5
5
  /** Metadata extracted from a paginated API response */
6
6
  interface PaginationMeta {
@@ -136,6 +136,7 @@ interface GlobalOptions {
136
136
  allowWrite?: boolean;
137
137
  }
138
138
  interface PublicGlobalOptions {
139
+ env?: string;
139
140
  apiUrl?: string;
140
141
  frontendUrl?: string;
141
142
  outputFormat?: string;
@@ -171,7 +172,7 @@ declare function createAuthenticatedContext(opts: GlobalOptions): Promise<Authen
171
172
  * Throws if called from a handler that did not declare `requiresAuth`.
172
173
  */
173
174
  declare function requireAuth(ctx: AuthenticatedContext | CommandContext): AuthenticatedContext;
174
- /** Create a base command context for the public CLI (no --env flag, defaults to prod) */
175
+ /** Create a base command context for the public CLI (defaults to prod) */
175
176
  declare function createPublicContext(opts: PublicGlobalOptions): CommandContext;
176
177
  /** Create an authenticated context for the public CLI. Tries env var, then cached token. */
177
178
  declare function createPublicAuthenticatedContext(opts: PublicGlobalOptions): Promise<AuthenticatedContext>;
@@ -299,7 +300,7 @@ declare function crudCommands<T>(config: CrudConfig<T>): CommandDef[];
299
300
  * Typed CRUD config for simple, top-level resources.
300
301
  *
301
302
  * Unlike the stringly-typed `CrudConfig`, operations are typed functions that
302
- * receive the real `GravityRailClient`. TypeScript validates the call at the definition
303
+ * receive the real `ApiClient`. TypeScript validates the call at the definition
303
304
  * site, eliminating the string-dispatch + positional-argument blind spot.
304
305
  *
305
306
  * Use this for resources that fit the simple CRUD contract:
@@ -331,16 +332,16 @@ interface SimpleCrudConfig<T = unknown> {
331
332
  extra?: CommandDef[];
332
333
  createExamples?: string[];
333
334
  paginationSupport?: 'full' | 'client-only' | false;
334
- list?: (client: GravityRailClient, workspace: string, opts?: Record<string, unknown>) => Promise<unknown>;
335
- get?: (client: GravityRailClient, workspace: string, id: string) => Promise<unknown>;
336
- create?: (client: GravityRailClient, workspace: string, data: unknown) => Promise<unknown>;
337
- update?: (client: GravityRailClient, workspace: string, id: string, data: unknown) => Promise<unknown>;
338
- delete?: (client: GravityRailClient, workspace: string, id: string) => Promise<unknown>;
339
- archive?: (client: GravityRailClient, workspace: string, id: string) => Promise<unknown>;
340
- unarchive?: (client: GravityRailClient, workspace: string, id: string) => Promise<unknown>;
335
+ list?: (client: ApiClient, workspace: string, opts?: Record<string, unknown>) => Promise<unknown>;
336
+ get?: (client: ApiClient, workspace: string, id: string) => Promise<unknown>;
337
+ create?: (client: ApiClient, workspace: string, data: unknown) => Promise<unknown>;
338
+ update?: (client: ApiClient, workspace: string, id: string, data: unknown) => Promise<unknown>;
339
+ delete?: (client: ApiClient, workspace: string, id: string) => Promise<unknown>;
340
+ archive?: (client: ApiClient, workspace: string, id: string) => Promise<unknown>;
341
+ unarchive?: (client: ApiClient, workspace: string, id: string) => Promise<unknown>;
341
342
  /** When true, adds a --cascade flag to the delete command. */
342
343
  supportsCascade?: boolean;
343
- deleteFn?: (client: GravityRailClient, workspace: string, id: string, cascade: boolean) => Promise<unknown>;
344
+ deleteFn?: (client: ApiClient, workspace: string, id: string, cascade: boolean) => Promise<unknown>;
344
345
  }
345
346
  /**
346
347
  * Generate CRUD commands from typed callable functions.
@@ -425,6 +426,26 @@ declare function authBrowserCommand(ctx: AuthenticatedContext, args: Record<stri
425
426
 
426
427
  declare function conciergeCommand(hctx: CommandHandlerContext): Promise<void>;
427
428
 
429
+ /**
430
+ * `gr get-started` / `gr setup` — bootstrap instructions for humans and LLM agents.
431
+ */
432
+
433
+ declare function getStartedCommand(hctx: CommandHandlerContext): Promise<void>;
434
+
435
+ declare function isDirectoryTrusted(dirPath: string, opts?: {
436
+ trustCwdFlag?: boolean;
437
+ }): boolean;
438
+ interface DirectoryTrustOptions {
439
+ cwd?: string;
440
+ /** Explicit grant for CI/headless — trust files in this absolute path. */
441
+ trustDir?: string;
442
+ /** Explicit grant — trust process.cwd(). */
443
+ trustCwd?: boolean;
444
+ nonInteractive?: boolean;
445
+ }
446
+ /** @deprecated Use resolveDirectoryTrust — kept for tests migrating off session-start gates. */
447
+ declare function requireDirectoryTrust(opts: DirectoryTrustOptions): Promise<void>;
448
+
428
449
  declare function devImportLocalCommand(ctx: AuthenticatedContext, workspace: string): Promise<void>;
429
450
 
430
451
  declare function loginCommand(ctx: CommandContext): Promise<void>;
@@ -437,4 +458,4 @@ declare function organizationsListCommand(ctx: AuthenticatedContext): Promise<vo
437
458
 
438
459
  declare function whoamiCommand(ctx: AuthenticatedContext): Promise<void>;
439
460
 
440
- export { type ArgDef, AuthRequiredError, type AuthenticatedContext, CLIError, COL, type CommandContext, type CommandDef, type CommandHandlerContext, CommandRegistry, type ConciergeChat, type ConciergeMessage, type DomainDef, type GlobalOptions, LIST_PAGINATION_ARGS, type OutputFormat, type OutputOptions, PAGINATION_ARGS, type PaginationMeta, type ParsedArgs, type PublicGlobalOptions, type TableColumn, authBrowserCommand, chatCommand, conciergeCommand, createAuthenticatedContext, createConciergeChat, createContext, createPublicAuthenticatedContext, createPublicContext, crudCommands, detectOutputFormat, devImportLocalCommand, extractPaginationMeta, fetchAllCursorPages, fetchAllPages, formatPaginationWarning, getConciergeChat, getConciergeChatMessages, handleError, isCursorPaginatedResponse, isListResult, isPagePaginatedResponse, isPaginatedResponse, listConciergeChats, listResult, loginCommand, logoutCommand, manageCommand, organizationsListCommand, outputData, outputSingle, parseArgs, parsePaginationArgs, readJsonInput, registerPublicDomains, requireAuth, requireNumber, requireString, simpleCrudCommands, stderr, unwrapItems, whoamiCommand };
461
+ export { type ArgDef, AuthRequiredError, type AuthenticatedContext, CLIError, COL, type CommandContext, type CommandDef, type CommandHandlerContext, CommandRegistry, type ConciergeChat, type ConciergeMessage, type DomainDef, type GlobalOptions, LIST_PAGINATION_ARGS, type OutputFormat, type OutputOptions, PAGINATION_ARGS, type PaginationMeta, type ParsedArgs, type PublicGlobalOptions, type TableColumn, authBrowserCommand, chatCommand, conciergeCommand, createAuthenticatedContext, createConciergeChat, createContext, createPublicAuthenticatedContext, createPublicContext, crudCommands, detectOutputFormat, devImportLocalCommand, extractPaginationMeta, fetchAllCursorPages, fetchAllPages, formatPaginationWarning, getConciergeChat, getConciergeChatMessages, getStartedCommand, handleError, isCursorPaginatedResponse, isDirectoryTrusted, isListResult, isPagePaginatedResponse, isPaginatedResponse, listConciergeChats, listResult, loginCommand, logoutCommand, manageCommand, organizationsListCommand, outputData, outputSingle, parseArgs, parsePaginationArgs, readJsonInput, registerPublicDomains, requireAuth, requireDirectoryTrust, requireNumber, requireString, simpleCrudCommands, stderr, unwrapItems, whoamiCommand };