Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 119 lines 3.59 KB
Raw
1 import pkg from '../package.json' with { type: 'json' };
2
3 declare const __COMPOSIO_CLI_RELEASE_VERSION__: string | undefined;
4
5 // These four values mirror `@composio/core`'s `constants` module. They are
6 // spelled out here rather than imported because importing anything from the
7 // core package's root entry at module scope evaluates the whole SDK at startup
8 // (its zod schemas alone cost ~25ms), for two strings and two URLs. The root
9 // entry is still bundled, behind the file-upload path's dynamic import.
10 // `test/src/constants.test.ts` pins these to core's values.
11
12 /** Default base URL for the Composio API server (backend). */
13 export const DEFAULT_BASE_URL = 'https://backend.composio.dev';
14
15 /** Default base URL for the Composio web app (frontend). */
16 export const DEFAULT_WEB_URL = 'https://dashboard.composio.dev/';
17
18 /**
19 * Staging base URL for the Composio API server (backend).
20 * Used when `COMPOSIO_ENVIRONMENT=staging`.
21 */
22 export const STAGING_BASE_URL = 'https://staging-backend.composio.dev';
23
24 /**
25 * Staging base URL for the Composio web app (frontend).
26 * Used when `COMPOSIO_ENVIRONMENT=staging`.
27 */
28 export const STAGING_WEB_URL = 'https://staging-dashboard.composio.dev/';
29
30 /**
31 * Name of the user config file used by the Composio CLI.
32 */
33 export const USER_CONFIG_FILE_NAME = 'user_data.json';
34
35 /**
36 * Name of the general CLI config file used by the Composio CLI.
37 */
38 export const CLI_CONFIG_FILE_NAME = 'config.json';
39
40 /**
41 * Name of the directory used to store the Composio CLI config.
42 */
43 export const USER_COMPOSIO_DIR = '.composio';
44
45 /**
46 * A map of cache filenames used by the Composio CLI.
47 */
48 export const CACHE_FILENAMES = {
49 SESSION: 'session.json',
50 TOOLKITS: 'toolkits.json',
51 TOOLS: 'tools.json',
52 TRIGGER_TYPES: 'trigger-types.json',
53 };
54
55 /** Whether the CLI has an exact release version compiled into it. */
56 export const IS_RELEASE_BUILD = typeof __COMPOSIO_CLI_RELEASE_VERSION__ !== 'undefined';
57
58 /**
59 * Version of the running Composio CLI.
60 *
61 * Release builds replace `__COMPOSIO_CLI_RELEASE_VERSION__` with the exact
62 * GitHub release version. The private package version is only a source/dev
63 * fallback and must never drive binary release selection.
64 */
65 export const APP_VERSION =
66 typeof __COMPOSIO_CLI_RELEASE_VERSION__ === 'undefined'
67 ? pkg.version
68 : __COMPOSIO_CLI_RELEASE_VERSION__;
69
70 /**
71 * Name of the Composio CLI application, read from `package.json` at build time.
72 */
73 export const APP_NAME = pkg.name;
74
75 /**
76 * Name of the per-directory project config file.
77 */
78 export const PROJECT_CONFIG_FILE_NAME = 'project.json';
79
80 /**
81 * Name of the per-directory .env file for CLI-only config overrides.
82 */
83 export const PROJECT_ENV_FILE_NAME = '.env';
84
85 /**
86 * Name of the per-directory Composio config directory.
87 */
88 export const PROJECT_COMPOSIO_DIR = '.composio';
89
90 /**
91 * PostHog capture endpoint for CLI telemetry.
92 */
93 export const COMPOSIO_POSTHOG_INGEST_URL = 'https://us.i.posthog.com/i/v0/e/';
94
95 declare const COMPOSIO_POSTHOG_PROJECT_API_KEY_BAKED: string | undefined;
96
97 /**
98 * Public write-only PostHog *project API key* (`phc_...`), baked at build from
99 * `COMPOSIO_POSTHOG_PROJECT_API_KEY`. Never a private/personal PostHog key.
100 */
101 export const COMPOSIO_POSTHOG_PROJECT_API_KEY =
102 typeof COMPOSIO_POSTHOG_PROJECT_API_KEY_BAKED === 'string'
103 ? COMPOSIO_POSTHOG_PROJECT_API_KEY_BAKED
104 : '';
105
106 /**
107 * GitHub repository information for release fetching
108 */
109 export const GITHUB_REPO = {
110 OWNER: 'ComposioHQ',
111 REPO: 'composio',
112 API_BASE_URL: 'https://api.github.com',
113 } as const;
114
115 export {
116 CLI_EXPERIMENTAL_FEATURES,
117 CLI_RELEASE_CHANNELS,
118 type CliReleaseChannel,
119 } from './experimental-features';