@capgo/cli 8.28.1 → 8.28.2

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.
@@ -17,6 +17,7 @@ export declare function getActiveAppVersions(supabase: SupabaseClient<Database>,
17
17
  cli_version: string | null;
18
18
  comment: string | null;
19
19
  created_at: string | null;
20
+ created_by_apikey_rbac_id: string | null;
20
21
  deleted: boolean;
21
22
  deleted_at: string | null;
22
23
  external_url: string | null;
@@ -42,6 +43,7 @@ export declare function getVersionData(supabase: SupabaseClient<Database>, appid
42
43
  cli_version: string | null;
43
44
  comment: string | null;
44
45
  created_at: string | null;
46
+ created_by_apikey_rbac_id: string | null;
45
47
  deleted: boolean;
46
48
  deleted_at: string | null;
47
49
  external_url: string | null;
@@ -5,6 +5,7 @@ export declare function listBundle(appId: string, options: OptionsBase, silent?:
5
5
  cli_version: string | null;
6
6
  comment: string | null;
7
7
  created_at: string | null;
8
+ created_by_apikey_rbac_id: string | null;
8
9
  deleted: boolean;
9
10
  deleted_at: string | null;
10
11
  external_url: string | null;
@@ -5,6 +5,7 @@ export interface CapacitorCliConfig {
5
5
  extConfigFilePath: string;
6
6
  };
7
7
  }
8
+ export declare const requireTS: (typescript: unknown, filePath: string) => Record<string, unknown>;
8
9
  export declare const loadConfig: () => Promise<CapacitorCliConfig>;
9
10
  export declare const writeConfig: (extConfig: CapacitorConfig, extConfigFilePath: string) => Promise<void>;
10
11
  export declare const findMonorepoRoot: (currentPath: string) => string;
@@ -1,5 +1,23 @@
1
1
  import type { ExtConfigPairs } from '../schemas/config';
2
2
  export type { CapacitorConfig, ExtConfigPairs } from '../schemas/config';
3
+ /**
4
+ * Overrides the config file Capacitor writes after loading the active root config.
5
+ * This lets dynamic monorepos keep their root loader while Capgo updates the
6
+ * selected app-specific source config.
7
+ */
8
+ export declare function setConfigWriteTarget(filePath?: string): void;
9
+ export declare function getConfigWriteTarget(): string | undefined;
10
+ /**
11
+ * Uses a request-local config target so concurrent MCP tool calls cannot
12
+ * redirect one another's writes while awaiting async work.
13
+ */
14
+ export declare function withConfigWriteTarget<T>(filePath: string | undefined, action: () => T): T;
15
+ export declare function resolveCapacitorConfigTargetPath(value: string | undefined, initialCwd?: string): string | undefined;
3
16
  export declare function loadConfig(): Promise<ExtConfigPairs | undefined>;
17
+ /**
18
+ * Loads the source file that will receive a config update. Normal reads must
19
+ * continue through Capacitor's root loader so dynamic monorepos keep working.
20
+ */
21
+ export declare function loadConfigForWrite(): Promise<ExtConfigPairs | undefined>;
4
22
  export declare function writeConfig(key: string, config: ExtConfigPairs, raw?: boolean): Promise<void>;
5
23
  export declare function writeConfigUpdater(config: ExtConfigPairs, raw?: boolean): Promise<void>;
@@ -3,7 +3,16 @@ import { spawnSync } from 'node:child_process';
3
3
  import { getPMAndCommand } from '../utils';
4
4
  interface SuperOptions extends Options {
5
5
  analytics?: boolean;
6
+ capacitorConfig?: string;
6
7
  local: boolean;
8
+ mainFile?: string;
9
+ packageJson?: string;
10
+ }
11
+ interface InitTargetPaths {
12
+ pathToPackageJson?: string;
13
+ capacitorConfigPath?: string;
14
+ configLoadDir?: string;
15
+ mainFilePath?: string;
7
16
  }
8
17
  export type RunDeviceCancelHandler = () => Promise<never>;
9
18
  type InitAutoTestChangeKind = 'html-banner' | 'vue-banner' | 'css-background';
@@ -20,6 +29,8 @@ interface InitAutoTestChange {
20
29
  displayPath: string;
21
30
  kind: InitAutoTestChangeKind;
22
31
  }
32
+ export declare function resolveInitTargetPath(value: string | undefined, label: string, initialCwd?: string): string | undefined;
33
+ export declare function resolveResumedInitTargets(currentTargets: InitTargetPaths, savedTargets: Partial<InitTargetPaths>, initialCwd?: string): InitTargetPaths | undefined;
23
34
  export declare function getGitRepoStatus(startDir?: string): GitRepoStatus;
24
35
  export declare function getInitUpdaterPluginConfig(appId: string, directInstall: boolean): {
25
36
  autoSplashscreen?: boolean | undefined;
@@ -59,6 +59,7 @@ export interface EngineDeps {
59
59
  }>;
60
60
  getRunDeviceCommand: (platform: Platform) => {
61
61
  command: string;
62
+ cwd?: string;
62
63
  };
63
64
  getGitStatus: (cwd?: string) => GitRepoStatus;
64
65
  }
@@ -1,4 +1,5 @@
1
1
  import type { CapgoSDK } from '../../sdk.js';
2
+ import type { LiveUpdateStartInput } from '../../schemas/live-update-onboarding.js';
2
3
  import type { EngineDeps } from './engine.js';
3
4
  interface McpLike {
4
5
  tool: (name: string, description: string, schema: Record<string, unknown>, handler: (args: any) => Promise<{
@@ -17,6 +18,12 @@ interface McpLike {
17
18
  }>;
18
19
  }) => unknown;
19
20
  }
20
- export declare function buildDeps(sdk: CapgoSDK, cwd?: string): EngineDeps;
21
+ export interface LiveUpdateProjectTarget {
22
+ packageJsonPath?: string;
23
+ mainFilePath?: string;
24
+ }
25
+ type LiveUpdateProjectTargetInput = Pick<LiveUpdateStartInput, 'packageJson' | 'mainFile'>;
26
+ export declare function resolveLiveUpdateProjectTarget(input: LiveUpdateProjectTargetInput, initialCwd?: string): LiveUpdateProjectTarget;
27
+ export declare function buildDeps(sdk: CapgoSDK, cwd?: string, getProjectTarget?: () => LiveUpdateProjectTarget | undefined): EngineDeps;
21
28
  export declare function registerLiveUpdateTools(server: McpLike, sdk: CapgoSDK, depsOverride?: EngineDeps): void;
22
29
  export {};
package/dist/src/key.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { ExtConfigPairs } from './config';
1
2
  interface SaveOptions {
2
3
  key?: string;
3
4
  keyData?: string;
@@ -6,11 +7,12 @@ interface SaveOptions {
6
7
  interface Options {
7
8
  force?: boolean;
8
9
  setupChannel?: boolean;
10
+ keyDir?: string;
9
11
  }
10
12
  export declare function saveKeyInternal(options: SaveOptions, silent?: boolean): Promise<boolean>;
11
13
  export declare function deleteOldPrivateKeyInternal(options: Options, silent?: boolean): Promise<boolean>;
12
14
  export declare function saveKeyCommand(options: SaveOptions): Promise<void>;
13
- export declare function createKeyInternal(options: Options, silent?: boolean): Promise<boolean>;
15
+ export declare function createKeyInternal(options: Options, silent?: boolean, existingConfig?: ExtConfigPairs): Promise<boolean>;
14
16
  export declare function createKey(options: Options): Promise<void>;
15
17
  export declare function deleteOldKey(options: Options): Promise<void>;
16
18
  export {};
@@ -2,4 +2,4 @@
2
2
  * Start the Capgo MCP (Model Context Protocol) server.
3
3
  * This allows AI agents to interact with Capgo Cloud programmatically.
4
4
  */
5
- export declare function startMcpServer(): Promise<void>;
5
+ export declare function startMcpServer(capacitorConfigTarget?: string): Promise<void>;
@@ -21,7 +21,6 @@ export declare function addOrganizationInternal(options: OrganizationAddOptions,
21
21
  stats_refresh_requested_at: string | null;
22
22
  stats_updated_at: string | null;
23
23
  updated_at: string | null;
24
- use_new_rbac: boolean;
25
24
  website: string | null;
26
25
  }>;
27
26
  export declare function addOrganization(options: OrganizationAddOptions): Promise<void>;
@@ -13,6 +13,7 @@ export declare function listOrganizationsInternal(options: OptionsBase, silent?:
13
13
  enforcing_2fa: boolean;
14
14
  gid: string;
15
15
  is_canceled: boolean;
16
+ is_invite: boolean;
16
17
  is_yearly: boolean;
17
18
  logo: string;
18
19
  management_email: string;
@@ -30,7 +31,6 @@ export declare function listOrganizationsInternal(options: OptionsBase, silent?:
30
31
  subscription_end: string;
31
32
  subscription_start: string;
32
33
  trial_left: number;
33
- use_new_rbac: boolean;
34
34
  website: string;
35
35
  }[]>;
36
36
  export declare function listOrganizations(options: OptionsBase): Promise<void>;
@@ -1,4 +1,11 @@
1
1
  import type { OrganizationSetOptions } from '../schemas/organization';
2
+ interface OrganizationApiHostConfig {
3
+ hostApi: string;
4
+ supaHost?: string;
5
+ supaKey?: string;
6
+ }
7
+ export declare function resolveConfiguredOrganizationUpdateApiHost(config: OrganizationApiHostConfig): string;
8
+ export declare function resolveOrganizationUpdateApiHost(options: Pick<OrganizationSetOptions, 'supaHost' | 'supaAnon'>, silent: boolean): Promise<string>;
2
9
  export declare function setOrganizationInternal(orgId: string, options: OrganizationSetOptions, silent?: boolean): Promise<{
3
10
  orgId: string;
4
11
  name: string;
@@ -19,3 +26,4 @@ export declare function setOrganizationInternal(orgId: string, options: Organiza
19
26
  passwordPolicy?: undefined;
20
27
  }>;
21
28
  export declare function setOrganization(orgId: string, options: OrganizationSetOptions): Promise<void>;
29
+ export {};
@@ -1,5 +1,13 @@
1
1
  import { z } from 'zod';
2
+ export declare const liveUpdateStartSchema: z.ZodObject<{
3
+ capacitorConfig: z.ZodOptional<z.ZodString>;
4
+ packageJson: z.ZodOptional<z.ZodString>;
5
+ mainFile: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
2
7
  export declare const liveUpdateNextStepSchema: z.ZodObject<{
8
+ capacitorConfig: z.ZodOptional<z.ZodString>;
9
+ packageJson: z.ZodOptional<z.ZodString>;
10
+ mainFile: z.ZodOptional<z.ZodString>;
3
11
  resumeChoice: z.ZodOptional<z.ZodEnum<{
4
12
  continue: "continue";
5
13
  restart: "restart";
@@ -19,4 +27,5 @@ export declare const liveUpdateNextStepSchema: z.ZodObject<{
19
27
  deviceRunConfirmed: z.ZodOptional<z.ZodBoolean>;
20
28
  otaReceivedConfirmed: z.ZodOptional<z.ZodBoolean>;
21
29
  }, z.core.$strip>;
30
+ export type LiveUpdateStartInput = z.infer<typeof liveUpdateStartSchema>;
22
31
  export type LiveUpdateNextStepInput = z.infer<typeof liveUpdateNextStepSchema>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export declare const capacitorConfigOptionSchema: z.ZodOptional<z.ZodString>;
2
3
  export interface SDKResult<T = void> {
3
4
  success: boolean;
4
5
  data?: T;
@@ -63,11 +64,13 @@ export declare const uploadOptionsSchema: z.ZodObject<{
63
64
  comment: z.ZodOptional<z.ZodString>;
64
65
  minUpdateVersion: z.ZodOptional<z.ZodString>;
65
66
  autoMinUpdateVersion: z.ZodOptional<z.ZodBoolean>;
67
+ autoSetBundle: z.ZodOptional<z.ZodBoolean>;
66
68
  selfAssign: z.ZodOptional<z.ZodBoolean>;
67
69
  packageJsonPaths: z.ZodOptional<z.ZodString>;
68
70
  ignoreCompatibilityCheck: z.ZodOptional<z.ZodBoolean>;
69
71
  disableCodeCheck: z.ZodOptional<z.ZodBoolean>;
70
72
  useZip: z.ZodOptional<z.ZodBoolean>;
73
+ capacitorConfig: z.ZodOptional<z.ZodString>;
71
74
  }, z.core.$strip>;
72
75
  export type UploadOptions = z.infer<typeof uploadOptionsSchema>;
73
76
  export declare const uploadResultSchema: z.ZodObject<{
@@ -112,17 +115,20 @@ export type CleanupOptions = z.infer<typeof cleanupOptionsSchema>;
112
115
  export declare const generateKeyOptionsSchema: z.ZodObject<{
113
116
  force: z.ZodOptional<z.ZodBoolean>;
114
117
  setupChannel: z.ZodOptional<z.ZodBoolean>;
118
+ capacitorConfig: z.ZodOptional<z.ZodString>;
115
119
  }, z.core.$strip>;
116
120
  export type GenerateKeyOptions = z.infer<typeof generateKeyOptionsSchema>;
117
121
  export declare const saveKeyOptionsSchema: z.ZodObject<{
118
122
  keyPath: z.ZodOptional<z.ZodString>;
119
123
  keyData: z.ZodOptional<z.ZodString>;
120
124
  setupChannel: z.ZodOptional<z.ZodBoolean>;
125
+ capacitorConfig: z.ZodOptional<z.ZodString>;
121
126
  }, z.core.$strip>;
122
127
  export type SaveKeyOptions = z.infer<typeof saveKeyOptionsSchema>;
123
128
  export declare const deleteOldKeyOptionsSchema: z.ZodObject<{
124
129
  force: z.ZodOptional<z.ZodBoolean>;
125
130
  setupChannel: z.ZodOptional<z.ZodBoolean>;
131
+ capacitorConfig: z.ZodOptional<z.ZodString>;
126
132
  }, z.core.$strip>;
127
133
  export type DeleteOldKeyOptions = z.infer<typeof deleteOldKeyOptionsSchema>;
128
134
  export declare const addChannelOptionsSchema: z.ZodObject<{
@@ -371,6 +377,7 @@ export declare const setSettingOptionsSchema: z.ZodObject<{
371
377
  apikey: z.ZodOptional<z.ZodString>;
372
378
  bool: z.ZodOptional<z.ZodString>;
373
379
  string: z.ZodOptional<z.ZodString>;
380
+ capacitorConfig: z.ZodOptional<z.ZodString>;
374
381
  }, z.core.$strip>;
375
382
  export type SetSettingOptions = z.infer<typeof setSettingOptionsSchema>;
376
383
  export declare const statsOrderSchema: z.ZodObject<{
package/dist/src/sdk.d.ts CHANGED
@@ -14,6 +14,8 @@ export type { UpdateProbeResult } from './app/updateProbe';
14
14
  /**
15
15
  * Capgo SDK for programmatic access to all CLI functionality.
16
16
  * Use this class to integrate Capgo operations directly into your application.
17
+ * Config-writing methods accept `capacitorConfig` to target an app-specific
18
+ * source config in a dynamic monorepo.
17
19
  *
18
20
  * @example
19
21
  * ```typescript