@capgo/cli 8.0.0-alpha.4 → 8.0.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/README.md +755 -75
- package/dist/index.js +1135 -311
- package/dist/keychain-export.swift +351 -0
- package/dist/package.json +120 -29
- package/dist/src/ai/analyze.d.ts +48 -0
- package/dist/src/ai/log-capture.d.ts +14 -0
- package/dist/src/ai/prompt.d.ts +1 -0
- package/dist/src/ai/render-markdown.d.ts +12 -0
- package/dist/src/ai/sse.d.ts +5 -0
- package/dist/src/ai/stream-markdown.d.ts +22 -0
- package/dist/src/ai/telemetry.d.ts +39 -0
- package/dist/src/analytics/error-category.d.ts +11 -0
- package/dist/src/analytics/org-resolver.d.ts +11 -0
- package/dist/src/analytics/supabase-perf.d.ts +48 -0
- package/dist/src/analytics/track.d.ts +70 -0
- package/dist/src/api/app.d.ts +17 -8
- package/dist/src/api/channels.d.ts +2442 -2729
- package/dist/src/api/crypto.d.ts +26 -0
- package/dist/src/api/update.d.ts +7 -1
- package/dist/src/api/versions.d.ts +9 -2
- package/dist/src/app/add.d.ts +6 -4
- package/dist/src/app/debug.d.ts +3 -7
- package/dist/src/app/delete.d.ts +1 -2
- package/dist/src/app/info.d.ts +5 -1
- package/dist/src/app/list.d.ts +23 -2
- package/dist/src/app/set.d.ts +0 -1
- package/dist/src/app/setting.d.ts +3 -9
- package/dist/src/app/updateProbe.d.ts +43 -0
- package/dist/src/build/credentials-command.d.ts +89 -0
- package/dist/src/build/credentials-manage.d.ts +7 -0
- package/dist/src/build/credentials.d.ts +78 -0
- package/dist/src/build/env-render.d.ts +8 -0
- package/dist/src/build/last-output-command.d.ts +6 -0
- package/dist/src/build/mobileprovision-parser.d.ts +35 -0
- package/dist/src/build/needed.d.ts +28 -0
- package/dist/src/build/onboarding/ai-fit.d.ts +110 -0
- package/dist/src/build/onboarding/analytics.d.ts +23 -0
- package/dist/src/build/onboarding/android/gcp-api.d.ts +128 -0
- package/dist/src/build/onboarding/android/gradle-parser.d.ts +19 -0
- package/dist/src/build/onboarding/android/keystore.d.ts +77 -0
- package/dist/src/build/onboarding/android/oauth-config.d.ts +24 -0
- package/dist/src/build/onboarding/android/oauth-google.d.ts +134 -0
- package/dist/src/build/onboarding/android/play-api.d.ts +91 -0
- package/dist/src/build/onboarding/android/progress.d.ts +22 -0
- package/dist/src/build/onboarding/android/service-account-validation.d.ts +58 -0
- package/dist/src/build/onboarding/android/types.d.ts +72 -0
- package/dist/src/build/onboarding/android/ui/app.d.ts +17 -0
- package/dist/src/build/onboarding/app-verification.d.ts +86 -0
- package/dist/src/build/onboarding/apple-api.d.ts +234 -0
- package/dist/src/build/onboarding/build-log.d.ts +10 -0
- package/dist/src/build/onboarding/bundle-id-detector.d.ts +117 -0
- package/dist/src/build/onboarding/ci-secrets.d.ts +87 -0
- package/dist/src/build/onboarding/command.d.ts +6 -0
- package/dist/src/build/onboarding/csr.d.ts +33 -0
- package/dist/src/build/onboarding/diff-utils.d.ts +24 -0
- package/dist/src/build/onboarding/env-export.d.ts +46 -0
- package/dist/src/build/onboarding/error-categories.d.ts +13 -0
- package/dist/src/build/onboarding/file-picker.d.ts +47 -0
- package/dist/src/build/onboarding/macos-signing.d.ts +190 -0
- package/dist/src/build/onboarding/min-terminal-size.d.ts +16 -0
- package/dist/src/build/onboarding/progress.d.ts +51 -0
- package/dist/src/build/onboarding/recovery.d.ts +7 -0
- package/dist/src/build/onboarding/telemetry.d.ts +28 -0
- package/dist/src/build/onboarding/types.d.ts +140 -0
- package/dist/src/build/onboarding/ui/app.d.ts +36 -0
- package/dist/src/build/onboarding/ui/completed-steps-log.d.ts +9 -0
- package/dist/src/build/onboarding/ui/components.d.ts +178 -0
- package/dist/src/build/onboarding/ui/frame-fit.d.ts +10 -0
- package/dist/src/build/onboarding/ui/min-size-gate.d.ts +20 -0
- package/dist/src/build/onboarding/ui/platform-picker.d.ts +19 -0
- package/dist/src/build/onboarding/ui/shell.d.ts +33 -0
- package/dist/src/build/onboarding/ui/steps/android-ci.d.ts +45 -0
- package/dist/src/build/onboarding/ui/steps/android-keystore.d.ts +75 -0
- package/dist/src/build/onboarding/ui/steps/android-sa-gcp.d.ts +85 -0
- package/dist/src/build/onboarding/ui/steps/android-shared.d.ts +67 -0
- package/dist/src/build/onboarding/ui/steps/ios-ci.d.ts +44 -0
- package/dist/src/build/onboarding/ui/steps/ios-credentials.d.ts +66 -0
- package/dist/src/build/onboarding/ui/steps/ios-import.d.ts +79 -0
- package/dist/src/build/onboarding/ui/steps/ios-shared.d.ts +93 -0
- package/dist/src/build/onboarding/workflow-generator.d.ts +48 -0
- package/dist/src/build/onboarding/workflow-ui-helpers.d.ts +18 -0
- package/dist/src/build/onboarding/workflow-writer.d.ts +36 -0
- package/dist/src/build/output-record.d.ts +30 -0
- package/dist/src/build/pbxproj-parser.d.ts +48 -0
- package/dist/src/build/platform-paths.d.ts +20 -0
- package/dist/src/build/qr.d.ts +5 -0
- package/dist/src/build/request.d.ts +107 -0
- package/dist/src/build/telemetry.d.ts +17 -0
- package/dist/src/bundle/builder-cta.d.ts +67 -0
- package/dist/src/bundle/check.d.ts +0 -1
- package/dist/src/bundle/cleanup.d.ts +3 -12
- package/dist/src/bundle/compatibility.d.ts +23 -12
- package/dist/src/bundle/decrypt.d.ts +4 -0
- package/dist/src/bundle/delete.d.ts +3 -8
- package/dist/src/bundle/encrypt.d.ts +4 -0
- package/dist/src/bundle/list.d.ts +5 -2
- package/dist/src/bundle/partial.d.ts +5 -3
- package/dist/src/bundle/releaseType.d.ts +15 -0
- package/dist/src/bundle/unlink.d.ts +6 -5
- package/dist/src/bundle/upload-command.d.ts +8 -0
- package/dist/src/bundle/upload.d.ts +21 -14
- package/dist/src/bundle/upload_interface.d.ts +2 -50
- package/dist/src/bundle/zip.d.ts +4 -19
- package/dist/src/capacitor-cli.d.ts +13 -0
- package/dist/src/channel/add.d.ts +8 -10
- package/dist/src/channel/currentBundle.d.ts +3 -9
- package/dist/src/channel/delete.d.ts +3 -9
- package/dist/src/channel/list.d.ts +31 -4
- package/dist/src/channel/set.d.ts +2 -17
- package/dist/src/checksum.d.ts +1 -2
- package/dist/src/config/index.d.ts +2 -13
- package/dist/src/docs.d.ts +0 -1
- package/dist/src/github-command.d.ts +9 -0
- package/dist/src/github.d.ts +40 -0
- package/dist/src/index.d.ts +0 -1
- package/dist/src/init/app-conflict.d.ts +2 -0
- package/dist/src/init/command.d.ts +57 -0
- package/dist/src/init/index.d.ts +1 -0
- package/dist/src/init/prompts.d.ts +41 -0
- package/dist/src/init/runtime.d.ts +111 -0
- package/dist/src/init/ui/app.d.ts +9 -0
- package/dist/src/init/ui/components.d.ts +31 -0
- package/dist/src/init/ui.d.ts +12 -0
- package/dist/src/init/updater.d.ts +13 -0
- package/dist/src/key.d.ts +16 -0
- package/dist/src/login.d.ts +0 -1
- package/dist/src/mcp/server.d.ts +5 -0
- package/dist/src/onboarding-support.d.ts +18 -0
- package/dist/src/organization/add.d.ts +26 -0
- package/dist/src/organization/delete.d.ts +3 -0
- package/dist/src/{organisation → organization}/index.d.ts +1 -1
- package/dist/src/{organisation → organization}/list.d.ts +14 -2
- package/dist/src/organization/members.d.ts +12 -0
- package/dist/src/organization/set.d.ts +21 -0
- package/dist/src/posthog.d.ts +13 -0
- package/dist/src/probe.d.ts +20 -0
- package/dist/src/promptPreferences.d.ts +13 -0
- package/dist/src/replicationProgress.d.ts +8 -0
- package/dist/src/run/device.d.ts +5 -0
- package/dist/src/runner-command.d.ts +5 -0
- package/dist/src/schemas/app.d.ts +26 -0
- package/dist/src/schemas/base.d.ts +7 -0
- package/dist/src/schemas/build.d.ts +196 -0
- package/dist/src/schemas/bundle.d.ts +157 -0
- package/dist/src/schemas/channel.d.ts +62 -0
- package/dist/src/schemas/common.d.ts +46 -0
- package/dist/src/schemas/config.d.ts +20 -0
- package/dist/src/schemas/index.d.ts +19 -0
- package/dist/src/schemas/organization.d.ts +41 -0
- package/dist/src/schemas/sdk.d.ts +335 -0
- package/dist/src/schemas/validate.d.ts +12 -0
- package/dist/src/sdk.d.ts +138 -317
- package/dist/src/sdk.js +542 -299
- package/dist/src/terminal-table.d.ts +7 -0
- package/dist/src/types/supabase.types.d.ts +2770 -296
- package/dist/src/updaterConfig.d.ts +8 -0
- package/dist/src/user/account.d.ts +0 -1
- package/dist/src/utils/latest-version.d.ts +0 -1
- package/dist/src/utils/safeWrites.d.ts +21 -0
- package/dist/src/utils/security_policy_errors.d.ts +47 -0
- package/dist/src/utils.d.ts +2869 -341
- package/dist/src/versionHelpers.d.ts +19 -0
- package/package.json +120 -29
- package/skills/native-builds/SKILL.md +255 -0
- package/skills/organization-management/SKILL.md +93 -0
- package/skills/release-management/SKILL.md +225 -0
- package/skills/usage/SKILL.md +92 -0
- package/dist/src/api/app.d.ts.map +0 -1
- package/dist/src/api/channels.d.ts.map +0 -1
- package/dist/src/api/cryptoV2.d.ts +0 -16
- package/dist/src/api/cryptoV2.d.ts.map +0 -1
- package/dist/src/api/update.d.ts.map +0 -1
- package/dist/src/api/versions.d.ts.map +0 -1
- package/dist/src/app/add.d.ts.map +0 -1
- package/dist/src/app/debug.d.ts.map +0 -1
- package/dist/src/app/delete.d.ts.map +0 -1
- package/dist/src/app/info.d.ts.map +0 -1
- package/dist/src/app/list.d.ts.map +0 -1
- package/dist/src/app/set.d.ts.map +0 -1
- package/dist/src/app/setting.d.ts.map +0 -1
- package/dist/src/bundle/check.d.ts.map +0 -1
- package/dist/src/bundle/cleanup.d.ts.map +0 -1
- package/dist/src/bundle/compatibility.d.ts.map +0 -1
- package/dist/src/bundle/decryptV2.d.ts +0 -13
- package/dist/src/bundle/decryptV2.d.ts.map +0 -1
- package/dist/src/bundle/delete.d.ts.map +0 -1
- package/dist/src/bundle/encryptV2.d.ts +0 -14
- package/dist/src/bundle/encryptV2.d.ts.map +0 -1
- package/dist/src/bundle/list.d.ts.map +0 -1
- package/dist/src/bundle/partial.d.ts.map +0 -1
- package/dist/src/bundle/unlink.d.ts.map +0 -1
- package/dist/src/bundle/upload.d.ts.map +0 -1
- package/dist/src/bundle/upload_interface.d.ts.map +0 -1
- package/dist/src/bundle/zip.d.ts.map +0 -1
- package/dist/src/channel/add.d.ts.map +0 -1
- package/dist/src/channel/currentBundle.d.ts.map +0 -1
- package/dist/src/channel/delete.d.ts.map +0 -1
- package/dist/src/channel/list.d.ts.map +0 -1
- package/dist/src/channel/set.d.ts.map +0 -1
- package/dist/src/checksum.d.ts.map +0 -1
- package/dist/src/config/index.d.ts.map +0 -1
- package/dist/src/docs.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/init.d.ts +0 -7
- package/dist/src/init.d.ts.map +0 -1
- package/dist/src/keyV2.d.ts +0 -19
- package/dist/src/keyV2.d.ts.map +0 -1
- package/dist/src/login.d.ts.map +0 -1
- package/dist/src/organisation/add.d.ts +0 -19
- package/dist/src/organisation/add.d.ts.map +0 -1
- package/dist/src/organisation/delete.d.ts +0 -8
- package/dist/src/organisation/delete.d.ts.map +0 -1
- package/dist/src/organisation/index.d.ts.map +0 -1
- package/dist/src/organisation/list.d.ts.map +0 -1
- package/dist/src/organisation/set.d.ts +0 -13
- package/dist/src/organisation/set.d.ts.map +0 -1
- package/dist/src/sdk.d.ts.map +0 -1
- package/dist/src/types/supabase.types.d.ts.map +0 -1
- package/dist/src/user/account.d.ts.map +0 -1
- package/dist/src/utils/latest-version.d.ts.map +0 -1
- package/dist/src/utils.d.ts.map +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
export declare function generateSessionKey(key: string): {
|
|
3
|
+
sessionKey: Buffer;
|
|
4
|
+
ivSessionKey: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function encryptSource(source: Buffer, sessionKey: Buffer, ivSessionKey: string): Buffer;
|
|
7
|
+
export declare function decryptSource(source: Buffer, ivSessionKey: string, key: string): Buffer;
|
|
8
|
+
export declare function encryptChecksum(checksum: string, key: string): string;
|
|
9
|
+
export declare function encryptChecksumV3(checksum: string, key: string): string;
|
|
10
|
+
export declare function decryptChecksum(checksum: string, key: string): string;
|
|
11
|
+
export declare function decryptChecksumV3(checksum: string, key: string): string;
|
|
12
|
+
interface RSAKeys {
|
|
13
|
+
publicKey: string;
|
|
14
|
+
privateKey: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function createRSA(): RSAKeys;
|
|
17
|
+
/**
|
|
18
|
+
* Calculate the key ID from a public key
|
|
19
|
+
* Shows the first 20 characters of base64-encoded key body for easy visual verification
|
|
20
|
+
* Note: First 12 characters (MIIBCgKCAQEA) are always the same for 2048-bit RSA PKCS#1 keys,
|
|
21
|
+
* but we show all of them so users can easily match with their key file
|
|
22
|
+
* @param publicKey - RSA public key in PEM format
|
|
23
|
+
* @returns 20-character key ID or empty string if key is invalid
|
|
24
|
+
*/
|
|
25
|
+
export declare function calcKeyId(publicKey: string): string;
|
|
26
|
+
export {};
|
package/dist/src/api/update.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
export interface VersionCheckResult {
|
|
2
|
+
currentVersion: string;
|
|
3
|
+
latestVersion: string;
|
|
4
|
+
isOutdated: boolean;
|
|
5
|
+
majorVersion: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function checkVersionStatus(): Promise<VersionCheckResult>;
|
|
1
8
|
export declare function checkAlerts(): Promise<void>;
|
|
2
|
-
//# sourceMappingURL=update.d.ts.map
|
|
@@ -14,13 +14,17 @@ export declare function displayBundles(data: (Database['public']['Tables']['app_
|
|
|
14
14
|
export declare function getActiveAppVersions(supabase: SupabaseClient<Database>, appid: string, options?: VersionOptions): Promise<{
|
|
15
15
|
app_id: string;
|
|
16
16
|
checksum: string | null;
|
|
17
|
+
cli_version: string | null;
|
|
17
18
|
comment: string | null;
|
|
18
19
|
created_at: string | null;
|
|
19
20
|
deleted: boolean;
|
|
21
|
+
deleted_at: string | null;
|
|
20
22
|
external_url: string | null;
|
|
21
23
|
id: number;
|
|
24
|
+
key_id: string | null;
|
|
22
25
|
link: string | null;
|
|
23
26
|
manifest: Database["public"]["CompositeTypes"]["manifest_entry"][] | null;
|
|
27
|
+
manifest_count: number;
|
|
24
28
|
min_update_version: string | null;
|
|
25
29
|
name: string;
|
|
26
30
|
native_packages: import("../types/supabase.types").Json[] | null;
|
|
@@ -31,17 +35,21 @@ export declare function getActiveAppVersions(supabase: SupabaseClient<Database>,
|
|
|
31
35
|
updated_at: string | null;
|
|
32
36
|
user_id: string | null;
|
|
33
37
|
}[]>;
|
|
34
|
-
export declare function getChannelsVersion(supabase: SupabaseClient<Database>, appid: string, options?: VersionOptions): Promise<number[]>;
|
|
38
|
+
export declare function getChannelsVersion(supabase: SupabaseClient<Database>, appid: string, options?: VersionOptions): Promise<(number | null)[]>;
|
|
35
39
|
export declare function getVersionData(supabase: SupabaseClient<Database>, appid: string, bundle: string, options?: VersionOptions): Promise<{
|
|
36
40
|
app_id: string;
|
|
37
41
|
checksum: string | null;
|
|
42
|
+
cli_version: string | null;
|
|
38
43
|
comment: string | null;
|
|
39
44
|
created_at: string | null;
|
|
40
45
|
deleted: boolean;
|
|
46
|
+
deleted_at: string | null;
|
|
41
47
|
external_url: string | null;
|
|
42
48
|
id: number;
|
|
49
|
+
key_id: string | null;
|
|
43
50
|
link: string | null;
|
|
44
51
|
manifest: Database["public"]["CompositeTypes"]["manifest_entry"][] | null;
|
|
52
|
+
manifest_count: number;
|
|
45
53
|
min_update_version: string | null;
|
|
46
54
|
name: string;
|
|
47
55
|
native_packages: import("../types/supabase.types").Json[] | null;
|
|
@@ -53,4 +61,3 @@ export declare function getVersionData(supabase: SupabaseClient<Database>, appid
|
|
|
53
61
|
user_id: string | null;
|
|
54
62
|
}>;
|
|
55
63
|
export {};
|
|
56
|
-
//# sourceMappingURL=versions.d.ts.map
|
package/dist/src/app/add.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppOptions } from '../schemas/app';
|
|
2
2
|
import type { Organization } from '../utils';
|
|
3
3
|
export declare const reverseDomainRegex: RegExp;
|
|
4
|
-
export
|
|
4
|
+
export type AppCreateSource = 'cli-direct' | 'onboarding' | 'mcp';
|
|
5
|
+
export declare function resolveAppCreateSource(explicit?: AppCreateSource): AppCreateSource;
|
|
6
|
+
export declare function addAppInternal(initialAppId: string, options: AppOptions, organization?: Organization, silent?: boolean, source?: AppCreateSource): Promise<{
|
|
5
7
|
appId: any;
|
|
6
8
|
organizationUid: string;
|
|
7
9
|
userId: string;
|
|
8
10
|
name: string;
|
|
11
|
+
iconUrl: string;
|
|
9
12
|
signedURL: string;
|
|
10
13
|
}>;
|
|
11
|
-
export declare function addApp(appId: string, options:
|
|
12
|
-
//# sourceMappingURL=add.d.ts.map
|
|
14
|
+
export declare function addApp(appId: string, options: AppOptions): Promise<void>;
|
package/dist/src/app/debug.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import type { AppDebugOptions } from '../schemas/app';
|
|
1
2
|
import type { Database } from '../types/supabase.types';
|
|
2
|
-
|
|
3
|
-
export interface OptionsBaseDebug extends OptionsBase {
|
|
4
|
-
device?: string;
|
|
5
|
-
}
|
|
3
|
+
export type { AppDebugOptions as OptionsBaseDebug } from '../schemas/app';
|
|
6
4
|
export declare function markSnag(channel: string, orgId: string, apikey: string, event: string, appId?: string, icon?: string): Promise<void>;
|
|
7
5
|
export declare function cancelCommand(channel: string, command: boolean | symbol, orgId: string, apikey: string): Promise<void>;
|
|
8
6
|
interface Order {
|
|
@@ -28,6 +26,4 @@ interface LogData {
|
|
|
28
26
|
}
|
|
29
27
|
export declare function getStats(apikey: string, query: QueryStats, after: string | null): Promise<LogData[]>;
|
|
30
28
|
export declare function waitLog(channel: string, apikey: string, appId: string, orgId: string, deviceId?: string): Promise<void>;
|
|
31
|
-
export declare function debugApp(appId: string, options:
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=debug.d.ts.map
|
|
29
|
+
export declare function debugApp(appId: string, options: AppDebugOptions): Promise<void>;
|
package/dist/src/app/delete.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { OptionsBase } from '../
|
|
1
|
+
import type { OptionsBase } from '../schemas/base';
|
|
2
2
|
export declare function deleteAppInternal(initialAppId: string, options: OptionsBase, silent?: boolean, skipConfirmation?: boolean): Promise<boolean>;
|
|
3
3
|
export declare function deleteApp(initialAppId: string, options: OptionsBase): Promise<boolean>;
|
|
4
|
-
//# sourceMappingURL=delete.d.ts.map
|
package/dist/src/app/info.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
interface DoctorInfoOptions {
|
|
2
2
|
packageJson?: string;
|
|
3
3
|
}
|
|
4
|
+
export declare function computeDoctorAnalyticsTags(installed: Record<string, string>, latest: Record<string, string>): {
|
|
5
|
+
is_outdated: boolean;
|
|
6
|
+
dependency_count: number;
|
|
7
|
+
outdated_count: number;
|
|
8
|
+
};
|
|
4
9
|
export declare function getInfoInternal(options: DoctorInfoOptions, silent?: boolean): Promise<{
|
|
5
10
|
appName: string;
|
|
6
11
|
appId: any;
|
|
@@ -18,4 +23,3 @@ export declare function getInfo(options: DoctorInfoOptions): Promise<{
|
|
|
18
23
|
latestDependencies: Record<string, string>;
|
|
19
24
|
}>;
|
|
20
25
|
export {};
|
|
21
|
-
//# sourceMappingURL=info.d.ts.map
|
package/dist/src/app/list.d.ts
CHANGED
|
@@ -1,34 +1,55 @@
|
|
|
1
|
-
import type { OptionsBase } from '../
|
|
1
|
+
import type { OptionsBase } from '../schemas/base';
|
|
2
2
|
export declare function listAppInternal(options: OptionsBase, silent?: boolean): Promise<{
|
|
3
|
+
allow_device_custom_id: boolean;
|
|
4
|
+
allow_preview: boolean;
|
|
5
|
+
android_store_url: string | null;
|
|
3
6
|
app_id: string;
|
|
7
|
+
build_timeout_seconds: number;
|
|
8
|
+
build_timeout_updated_at: string;
|
|
4
9
|
channel_device_count: number;
|
|
5
10
|
created_at: string | null;
|
|
6
11
|
default_upload_channel: string;
|
|
12
|
+
existing_app: boolean;
|
|
13
|
+
expose_metadata: boolean;
|
|
7
14
|
icon_url: string;
|
|
8
15
|
id: string | null;
|
|
16
|
+
ios_store_url: string | null;
|
|
9
17
|
last_version: string | null;
|
|
10
18
|
manifest_bundle_count: number;
|
|
11
19
|
name: string | null;
|
|
20
|
+
need_onboarding: boolean;
|
|
12
21
|
owner_org: string;
|
|
13
22
|
retention: number;
|
|
23
|
+
stats_refresh_requested_at: string | null;
|
|
24
|
+
stats_updated_at: string | null;
|
|
14
25
|
transfer_history: import("../types/supabase.types").Json[] | null;
|
|
15
26
|
updated_at: string | null;
|
|
16
27
|
user_id: string | null;
|
|
17
28
|
}[]>;
|
|
18
29
|
export declare function listApp(options: OptionsBase): Promise<{
|
|
30
|
+
allow_device_custom_id: boolean;
|
|
31
|
+
allow_preview: boolean;
|
|
32
|
+
android_store_url: string | null;
|
|
19
33
|
app_id: string;
|
|
34
|
+
build_timeout_seconds: number;
|
|
35
|
+
build_timeout_updated_at: string;
|
|
20
36
|
channel_device_count: number;
|
|
21
37
|
created_at: string | null;
|
|
22
38
|
default_upload_channel: string;
|
|
39
|
+
existing_app: boolean;
|
|
40
|
+
expose_metadata: boolean;
|
|
23
41
|
icon_url: string;
|
|
24
42
|
id: string | null;
|
|
43
|
+
ios_store_url: string | null;
|
|
25
44
|
last_version: string | null;
|
|
26
45
|
manifest_bundle_count: number;
|
|
27
46
|
name: string | null;
|
|
47
|
+
need_onboarding: boolean;
|
|
28
48
|
owner_org: string;
|
|
29
49
|
retention: number;
|
|
50
|
+
stats_refresh_requested_at: string | null;
|
|
51
|
+
stats_updated_at: string | null;
|
|
30
52
|
transfer_history: import("../types/supabase.types").Json[] | null;
|
|
31
53
|
updated_at: string | null;
|
|
32
54
|
user_id: string | null;
|
|
33
55
|
}[]>;
|
|
34
|
-
//# sourceMappingURL=list.d.ts.map
|
package/dist/src/app/set.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Options } from '../api/app';
|
|
2
2
|
export declare function setAppInternal(appId: string, options: Options, silent?: boolean): Promise<boolean>;
|
|
3
3
|
export declare function setApp(appId: string, options: Options): Promise<boolean>;
|
|
4
|
-
//# sourceMappingURL=set.d.ts.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
string?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function setSettingInternal(setting: string, options: Options, silent?: boolean): Promise<void>;
|
|
7
|
-
export declare function setSetting(setting: string, options: Options): Promise<void>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=setting.d.ts.map
|
|
1
|
+
import type { AppSettingOptions } from '../schemas/app';
|
|
2
|
+
export declare function setSettingInternal(setting: string, options: AppSettingOptions, silent?: boolean): Promise<void>;
|
|
3
|
+
export declare function setSetting(setting: string, options: AppSettingOptions): Promise<void>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const updateProbeDeviceId = "00000000-0000-0000-0000-000000000000";
|
|
2
|
+
interface UpdateProbePayload {
|
|
3
|
+
app_id: string;
|
|
4
|
+
device_id: string;
|
|
5
|
+
version_name: string;
|
|
6
|
+
version_build: string;
|
|
7
|
+
is_emulator: boolean;
|
|
8
|
+
is_prod: boolean;
|
|
9
|
+
platform: 'ios' | 'android';
|
|
10
|
+
plugin_version: string;
|
|
11
|
+
defaultChannel: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PreparedUpdateProbe {
|
|
14
|
+
endpoint: string;
|
|
15
|
+
payload: UpdateProbePayload;
|
|
16
|
+
nativeSource: string;
|
|
17
|
+
versionBuildSource: string;
|
|
18
|
+
appIdSource: string;
|
|
19
|
+
}
|
|
20
|
+
export type PrepareUpdateProbeResult = {
|
|
21
|
+
ok: true;
|
|
22
|
+
context: PreparedUpdateProbe;
|
|
23
|
+
} | {
|
|
24
|
+
ok: false;
|
|
25
|
+
error: string;
|
|
26
|
+
};
|
|
27
|
+
export type UpdateProbeResult = {
|
|
28
|
+
success: true;
|
|
29
|
+
availableVersion: string;
|
|
30
|
+
} | {
|
|
31
|
+
success: false;
|
|
32
|
+
reason: string;
|
|
33
|
+
backendRefusal: boolean;
|
|
34
|
+
errorCode?: string;
|
|
35
|
+
backendMessage?: string;
|
|
36
|
+
extra?: Record<string, unknown>;
|
|
37
|
+
};
|
|
38
|
+
export declare function prepareUpdateProbe(platform: 'ios' | 'android', capConfig: any): Promise<PrepareUpdateProbeResult>;
|
|
39
|
+
export declare function singleProbeRequest(endpoint: string, payload: UpdateProbePayload): Promise<UpdateProbeResult>;
|
|
40
|
+
export declare function explainCommonUpdateError(result: Extract<UpdateProbeResult, {
|
|
41
|
+
success: false;
|
|
42
|
+
}>): string[];
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
interface SaveCredentialsOptions {
|
|
2
|
+
platform?: 'ios' | 'android';
|
|
3
|
+
appId?: string;
|
|
4
|
+
local?: boolean;
|
|
5
|
+
outputUpload?: boolean;
|
|
6
|
+
outputRetention?: string;
|
|
7
|
+
skipBuildNumberBump?: boolean;
|
|
8
|
+
certificate?: string;
|
|
9
|
+
iosProvisioningProfile?: string[];
|
|
10
|
+
overwriteIosProvisioningMap?: boolean;
|
|
11
|
+
p12Password?: string;
|
|
12
|
+
appleKey?: string;
|
|
13
|
+
appleKeyId?: string;
|
|
14
|
+
appleIssuerId?: string;
|
|
15
|
+
appleTeamId?: string;
|
|
16
|
+
iosDistribution?: 'app_store' | 'ad_hoc';
|
|
17
|
+
keystore?: string;
|
|
18
|
+
keystoreAlias?: string;
|
|
19
|
+
keystoreKeyPassword?: string;
|
|
20
|
+
keystoreStorePassword?: string;
|
|
21
|
+
playConfig?: string;
|
|
22
|
+
androidFlavor?: string;
|
|
23
|
+
inAppUpdatePriority?: number | string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Provisioning map entry: stores the base64-encoded profile and its extracted name
|
|
27
|
+
*/
|
|
28
|
+
interface ProvisioningMapEntry {
|
|
29
|
+
profile: string;
|
|
30
|
+
name: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Build a provisioning map from --ios-provisioning-profile entries.
|
|
34
|
+
*
|
|
35
|
+
* Each entry is either:
|
|
36
|
+
* - "bundleId=path" (explicit bundle ID assignment)
|
|
37
|
+
* - "path" (auto-infer bundle ID by matching mobileprovision against pbxproj targets)
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildProvisioningMap(entries: string[], projectDir?: string): Record<string, ProvisioningMapEntry>;
|
|
40
|
+
/**
|
|
41
|
+
* Save build credentials locally
|
|
42
|
+
*
|
|
43
|
+
* SECURITY NOTE:
|
|
44
|
+
* - Credentials are saved to ~/.capgo-credentials/credentials.json on YOUR local machine only
|
|
45
|
+
* - When you run a build, credentials are sent to Capgo's build servers
|
|
46
|
+
* - Credentials are NEVER stored permanently on Capgo servers
|
|
47
|
+
* - They are automatically deleted after build completion
|
|
48
|
+
*/
|
|
49
|
+
export declare function saveCredentialsCommand(options: SaveCredentialsOptions): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* List saved credentials (masked for security)
|
|
52
|
+
*/
|
|
53
|
+
export declare function listCredentialsCommand(options?: {
|
|
54
|
+
appId?: string;
|
|
55
|
+
local?: boolean;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Clear saved credentials
|
|
59
|
+
*/
|
|
60
|
+
export declare function clearCredentialsCommand(options: {
|
|
61
|
+
appId?: string;
|
|
62
|
+
platform?: 'ios' | 'android';
|
|
63
|
+
local?: boolean;
|
|
64
|
+
}): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Update existing credentials (partial update, no full validation)
|
|
67
|
+
* Use this to update specific credentials without providing all of them again
|
|
68
|
+
*/
|
|
69
|
+
export declare function updateCredentialsCommand(options: SaveCredentialsOptions): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Build a migration map from a single legacy base64 provisioning profile.
|
|
72
|
+
*
|
|
73
|
+
* Takes the legacy BUILD_PROVISION_PROFILE_BASE64 value and a bundle ID,
|
|
74
|
+
* extracts the profile name, and returns a JSON-serialized provisioning map.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildMigrationMap(profileBase64: string, bundleId: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Migrate legacy provisioning profile credentials to the new map format.
|
|
79
|
+
*
|
|
80
|
+
* Reads saved credentials, finds the legacy BUILD_PROVISION_PROFILE_BASE64,
|
|
81
|
+
* discovers the main bundle ID from the local pbxproj, synthesizes the map,
|
|
82
|
+
* saves it, and removes old keys.
|
|
83
|
+
*/
|
|
84
|
+
export declare function migrateCredentialsCommand(options: {
|
|
85
|
+
appId?: string;
|
|
86
|
+
platform?: string;
|
|
87
|
+
local?: boolean;
|
|
88
|
+
}): Promise<void>;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build Credentials Management
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for managing build credentials locally on your machine.
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT SECURITY NOTICE:
|
|
7
|
+
* - Credentials are stored LOCALLY in ~/.capgo-credentials/credentials.json on YOUR machine only
|
|
8
|
+
* - When you request a build, credentials are sent to Capgo's build servers
|
|
9
|
+
* - Credentials are NEVER stored permanently on Capgo servers
|
|
10
|
+
* - Credentials are used only during the build process and are automatically deleted
|
|
11
|
+
* from Capgo servers after the build completes (maximum 24 hours)
|
|
12
|
+
* - Builds are sent DIRECTLY to app stores (Apple App Store / Google Play Store)
|
|
13
|
+
* - Build outputs may optionally be uploaded for time-limited download links
|
|
14
|
+
*
|
|
15
|
+
* Security best practices:
|
|
16
|
+
* - Ensure ~/.capgo-credentials/ directory has restricted file permissions
|
|
17
|
+
* - Never commit credentials.json to version control
|
|
18
|
+
* - Use separate credentials for CI/CD vs local development
|
|
19
|
+
* - Rotate credentials regularly
|
|
20
|
+
*/
|
|
21
|
+
import type { CredentialFile, SavedCredentials } from '../schemas/build';
|
|
22
|
+
import type { BuildCredentials } from './request';
|
|
23
|
+
export declare const MIN_OUTPUT_RETENTION_SECONDS: number;
|
|
24
|
+
export declare const MAX_OUTPUT_RETENTION_SECONDS: number;
|
|
25
|
+
export type { AllCredentials, CredentialFile, SavedCredentials } from '../schemas/build';
|
|
26
|
+
export declare function parseOutputRetentionSeconds(raw: string): number;
|
|
27
|
+
export declare function parseOptionalBoolean(value: boolean | string | undefined): boolean;
|
|
28
|
+
export declare function parseInAppUpdatePriority(value: number | string): number;
|
|
29
|
+
/**
|
|
30
|
+
* Load saved credentials for a specific app
|
|
31
|
+
* Checks local file first, then global file
|
|
32
|
+
*/
|
|
33
|
+
export declare function loadSavedCredentials(appId?: string, local?: boolean): Promise<SavedCredentials | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Load credentials from environment variables
|
|
36
|
+
* Only returns credentials that are actually set in env
|
|
37
|
+
*/
|
|
38
|
+
export declare function loadCredentialsFromEnv(): Partial<BuildCredentials>;
|
|
39
|
+
/**
|
|
40
|
+
* Merge credentials from all three sources with proper precedence:
|
|
41
|
+
* 1. CLI arguments (highest priority)
|
|
42
|
+
* 2. Environment variables (middle priority)
|
|
43
|
+
* 3. Saved credentials file (lowest priority)
|
|
44
|
+
*/
|
|
45
|
+
export declare function mergeCredentials(appId: string, platform: 'ios' | 'android', cliArgs?: Partial<BuildCredentials>): Promise<BuildCredentials | undefined>;
|
|
46
|
+
/**
|
|
47
|
+
* Convert file paths to base64 credentials
|
|
48
|
+
*/
|
|
49
|
+
export declare function convertFilesToCredentials(platform: 'ios' | 'android', files: CredentialFile, passwords?: Partial<BuildCredentials>): Promise<BuildCredentials>;
|
|
50
|
+
/**
|
|
51
|
+
* Update saved credentials for a specific app and platform
|
|
52
|
+
*/
|
|
53
|
+
export declare function updateSavedCredentials(appId: string, platform: 'ios' | 'android', credentials: Partial<BuildCredentials>, local?: boolean): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Remove specific credential keys for an app/platform.
|
|
56
|
+
* Used during migration to clean up legacy keys.
|
|
57
|
+
*/
|
|
58
|
+
export declare function removeSavedCredentialKeys(appId: string, platform: 'ios' | 'android', keys: string[], local?: boolean): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Clear saved credentials for a specific app and/or platform
|
|
61
|
+
*/
|
|
62
|
+
export declare function clearSavedCredentials(appId?: string, platform?: 'ios' | 'android', local?: boolean): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Get saved credentials for a specific app and platform
|
|
65
|
+
*/
|
|
66
|
+
export declare function getSavedCredentials(appId: string, platform: 'ios' | 'android', local?: boolean): Promise<Partial<BuildCredentials> | null>;
|
|
67
|
+
/**
|
|
68
|
+
* List all apps that have saved credentials
|
|
69
|
+
*/
|
|
70
|
+
export declare function listAllApps(local?: boolean): Promise<string[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Get the local credentials file path (for display purposes)
|
|
73
|
+
*/
|
|
74
|
+
export declare function getLocalCredentialsPath(): string;
|
|
75
|
+
/**
|
|
76
|
+
* Get the global credentials file path (for display purposes)
|
|
77
|
+
*/
|
|
78
|
+
export declare function getGlobalCredentialsPath(): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BuildCredentials } from '../schemas/build';
|
|
2
|
+
export declare function renderEnvFile(args: {
|
|
3
|
+
appId: string;
|
|
4
|
+
local: boolean;
|
|
5
|
+
platform: 'ios' | 'android';
|
|
6
|
+
creds: Partial<BuildCredentials>;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function escapeDotenvValue(value: string): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface MobileprovisionInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
uuid: string;
|
|
4
|
+
applicationIdentifier: string;
|
|
5
|
+
bundleId: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Detail returned by {@link parseMobileprovisionDetailed} — extends
|
|
9
|
+
* {@link MobileprovisionInfo} with team/expiry/profile-type metadata and the
|
|
10
|
+
* SHA1 of each developer certificate embedded in the profile.
|
|
11
|
+
*
|
|
12
|
+
* The SHA1 list enables matching a profile against a Keychain identity
|
|
13
|
+
* returned by `security find-identity` (which reports identities by the same
|
|
14
|
+
* SHA1 hash).
|
|
15
|
+
*/
|
|
16
|
+
export interface MobileprovisionDetail extends MobileprovisionInfo {
|
|
17
|
+
/** Apple Team ID (10-char alphanumeric) — empty string if not present */
|
|
18
|
+
teamId: string;
|
|
19
|
+
/** ISO timestamp string from the profile's ExpirationDate, or empty string */
|
|
20
|
+
expirationDate: string;
|
|
21
|
+
/** High-level profile type derived from the profile's flags */
|
|
22
|
+
profileType: 'app_store' | 'ad_hoc' | 'development' | 'enterprise' | 'unknown';
|
|
23
|
+
/** SHA1 (40-char lowercase hex) of each DeveloperCertificate embedded in the profile */
|
|
24
|
+
certificateSha1s: string[];
|
|
25
|
+
}
|
|
26
|
+
export declare function parseMobileprovision(filePath: string): MobileprovisionInfo;
|
|
27
|
+
export declare function parseMobileprovisionFromBase64(base64Content: string): MobileprovisionInfo;
|
|
28
|
+
/**
|
|
29
|
+
* Parse a mobileprovision file and return enriched metadata including:
|
|
30
|
+
* - team ID
|
|
31
|
+
* - expiration date
|
|
32
|
+
* - profile type (app_store / ad_hoc / development / enterprise)
|
|
33
|
+
* - SHA1 of each embedded developer certificate (used for cert↔profile matching)
|
|
34
|
+
*/
|
|
35
|
+
export declare function parseMobileprovisionDetailed(filePath: string): MobileprovisionDetail;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BuildNeededOptions } from '../schemas/build';
|
|
2
|
+
import type { Compatibility } from '../schemas/common';
|
|
3
|
+
type VersionChangeType = 'major' | 'minor' | 'patch' | 'prerelease' | 'changed' | 'same' | 'new' | 'removed';
|
|
4
|
+
interface PublicChannelRow {
|
|
5
|
+
name: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface BuildNeededResult {
|
|
8
|
+
required: boolean;
|
|
9
|
+
resolvedAppId: string;
|
|
10
|
+
channel: string;
|
|
11
|
+
finalCompatibility: Compatibility[];
|
|
12
|
+
}
|
|
13
|
+
export declare const BUILD_NEEDED_ERROR_EXIT_CODE = 2;
|
|
14
|
+
interface FormatOptions {
|
|
15
|
+
color?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function getConfiguredDefaultChannel(config: unknown): string | undefined;
|
|
18
|
+
export declare function selectDefaultChannelName(rows: PublicChannelRow[]): string;
|
|
19
|
+
export declare function getVersionChangeType(entry: Compatibility): VersionChangeType;
|
|
20
|
+
export declare function getNativeDiffLabel(entry: Compatibility): string;
|
|
21
|
+
export declare function isBuildNeeded(finalCompatibility: Compatibility[]): boolean;
|
|
22
|
+
export declare function getBuildNeededExitCode(required: boolean): number;
|
|
23
|
+
export declare function formatShortBuildNeeded(required: boolean): string;
|
|
24
|
+
export declare function formatBuildNeededTable(finalCompatibility: Compatibility[], options?: FormatOptions): string;
|
|
25
|
+
export declare function formatVerboseBuildNeeded(result: BuildNeededResult, options?: FormatOptions): string;
|
|
26
|
+
export declare function getBuildNeeded(appId: string | undefined, options: BuildNeededOptions): Promise<BuildNeededResult>;
|
|
27
|
+
export declare function checkBuildNeeded(appId: string | undefined, options: BuildNeededOptions): Promise<void>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fit estimation for the AI analysis result step in the onboarding TUI.
|
|
3
|
+
*
|
|
4
|
+
* The on-failure AI flow can return a multi-screen markdown diagnosis. If
|
|
5
|
+
* that text doesn't fit in the user's current terminal viewport we MUST
|
|
6
|
+
* route it through the scrollable `FullscreenAiViewer` — otherwise the
|
|
7
|
+
* earlier lines scroll out of view and the onboarding wizard ends up in
|
|
8
|
+
* an unreadable state.
|
|
9
|
+
*
|
|
10
|
+
* The estimator deliberately errs on the side of "doesn't fit": a
|
|
11
|
+
* false-positive scroll is fine (just one more keystroke for the user),
|
|
12
|
+
* but a false-negative inline render is bad UX (text disappears off the
|
|
13
|
+
* top of the screen).
|
|
14
|
+
*/
|
|
15
|
+
export declare const AI_RESULT_CHROME_ROWS = 10;
|
|
16
|
+
export declare const AI_RUNNING_CHROME_ROWS = 10;
|
|
17
|
+
export interface AiPreviewTail {
|
|
18
|
+
/** Lines to render (blank-padded to a constant rendered height). */
|
|
19
|
+
rows: string[];
|
|
20
|
+
/** Logical lines scrolled off the top (0 ⇒ the marker row renders blank). */
|
|
21
|
+
hidden: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Pick the visible tail of the live streaming analysis preview for the
|
|
25
|
+
* CURRENT terminal size.
|
|
26
|
+
*
|
|
27
|
+
* Wrap-aware: each logical line is budgeted as the rows it will actually
|
|
28
|
+
* occupy at `terminalCols` (via `estimateRenderedRows`), so the running frame
|
|
29
|
+
* can never grow past the viewport. No artificial padding: streamed text only
|
|
30
|
+
* appends, so the rendered height grows monotonically on its own — the frame
|
|
31
|
+
* starts compact (matching the other wizard steps) and grows downward, and is
|
|
32
|
+
* capped at the budget so it never overflows the full-height shell frame.
|
|
33
|
+
*/
|
|
34
|
+
export declare function pickAiPreviewTail(text: string, terminalRows: number, terminalCols: number): AiPreviewTail;
|
|
35
|
+
/** Strip ANSI SGR escape codes so length matches what the user actually sees. */
|
|
36
|
+
export declare function stripAnsi(text: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Estimate how many terminal rows a multi-line, possibly ANSI-styled string
|
|
39
|
+
* will occupy when rendered by Ink at the given column width.
|
|
40
|
+
*
|
|
41
|
+
* Each logical line (split on '\n') becomes `ceil(visibleLen / cols)` rows,
|
|
42
|
+
* with a floor of 1 to account for empty lines that still consume a row.
|
|
43
|
+
*/
|
|
44
|
+
export declare function estimateRenderedRows(text: string, terminalCols: number): number;
|
|
45
|
+
/**
|
|
46
|
+
* Decide whether the AI analysis text should be routed through the
|
|
47
|
+
* scrollable fullscreen viewer. Conservative — prefers true (scroll) when
|
|
48
|
+
* the estimate is close to the available row budget.
|
|
49
|
+
*
|
|
50
|
+
* @param text The AI analysis markdown (already rendered to ANSI).
|
|
51
|
+
* @param terminalRows Total terminal rows from `useStdout().stdout?.rows`.
|
|
52
|
+
* @param terminalCols Total terminal cols from `useStdout().stdout?.columns`.
|
|
53
|
+
* @param chromeRows Reserved rows for the surrounding wizard chrome.
|
|
54
|
+
* Defaults to `AI_RESULT_CHROME_ROWS`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function isAiAnalysisTooTall(text: string, terminalRows: number, terminalCols: number, chromeRows?: number): boolean;
|
|
57
|
+
export type AiResultStep = 'ai-analysis-result' | 'ai-analysis-result-scroll';
|
|
58
|
+
/**
|
|
59
|
+
* Decide which AI-result step should be active for the CURRENT terminal size.
|
|
60
|
+
*
|
|
61
|
+
* Routing is BIDIRECTIONAL and driven by the single `isAiAnalysisTooTall`
|
|
62
|
+
* predicate, so it settles deterministically at any size — at a given size
|
|
63
|
+
* exactly one outcome is stable, so it can't oscillate:
|
|
64
|
+
* - inline + now too tall (terminal shrank) → scroll
|
|
65
|
+
* - scroll + now fits (terminal grew) → inline ← the missing case
|
|
66
|
+
*
|
|
67
|
+
* Before, only the inline→scroll direction existed: once the viewer opened
|
|
68
|
+
* (e.g. after shrinking), growing the terminal never returned to the inline
|
|
69
|
+
* render — the user was stuck in the scroll viewer showing "all N lines" with
|
|
70
|
+
* empty space.
|
|
71
|
+
*
|
|
72
|
+
* `viewedFull` (the user manually dismissed the viewer with Esc/Enter) pins the
|
|
73
|
+
* inline step so a later resize can't shove a dismissed analysis back into the
|
|
74
|
+
* viewer. It only gates the inline→scroll direction; leaving the viewer when it
|
|
75
|
+
* fits is always allowed.
|
|
76
|
+
*
|
|
77
|
+
* @returns the step to switch to, or `null` when the current step is already
|
|
78
|
+
* correct (so the caller can skip a no-op `setStep`).
|
|
79
|
+
*/
|
|
80
|
+
export declare function resolveAiResultRoute(params: {
|
|
81
|
+
current: AiResultStep;
|
|
82
|
+
text: string | null;
|
|
83
|
+
viewedFull: boolean;
|
|
84
|
+
terminalRows: number;
|
|
85
|
+
terminalCols: number;
|
|
86
|
+
}): AiResultStep | null;
|
|
87
|
+
/**
|
|
88
|
+
* Pick the slice of `lines` starting at `scrollOffset` that PACKS the
|
|
89
|
+
* `viewportRows` rendered rows of a terminal `terminalCols` wide.
|
|
90
|
+
*
|
|
91
|
+
* Packs lines until the cumulative wrapped row count reaches or exceeds
|
|
92
|
+
* `viewportRows`, INCLUDING the line that crosses the boundary. That last line
|
|
93
|
+
* may render past the viewport; the viewer clips it with `overflow: hidden` so
|
|
94
|
+
* the visible area is always FULL of text when more lines remain. (Stopping
|
|
95
|
+
* before the boundary line — the old behaviour — left the unused rows as an
|
|
96
|
+
* empty gap when a long line couldn't fully fit.)
|
|
97
|
+
*
|
|
98
|
+
* Always returns at least one line if the input is non-empty and the
|
|
99
|
+
* `scrollOffset` is in-range — even if that line wraps to more rows than the
|
|
100
|
+
* viewport.
|
|
101
|
+
*/
|
|
102
|
+
export declare function pickVisibleLines(lines: string[], scrollOffset: number, viewportRows: number, terminalCols: number): string[];
|
|
103
|
+
/**
|
|
104
|
+
* Compute the largest `scrollOffset` that still keeps content visible at the
|
|
105
|
+
* bottom of the viewport — i.e. the offset where the LAST line is rendered
|
|
106
|
+
* within the viewport. Walks backwards from the end, packing as many tail
|
|
107
|
+
* lines as fit (accounting for wrap), and returns the offset of the first
|
|
108
|
+
* fully-visible tail line.
|
|
109
|
+
*/
|
|
110
|
+
export declare function computeMaxScrollOffset(lines: string[], viewportRows: number, terminalCols: number): number;
|