@devries-cameron20 / composio Mirror · read-only / commits / 5254e9075
Fork 0

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

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 18:30 UTC

feat(cli): stamp telemetry with journey_stage + cli_channel; tag installer origin

Every CLI event now carries journey_stage (install|setup|login|connect| execute|other) via an exhaustive event->stage map in events.ts, and cli_channel (stable|beta) derived from the existing inferSkillReleaseChannel(APP_VERSION). Both are applied by a single buildEvent factory so no builder hand-writes them. install.sh now sets COMPOSIO_CLI_INVOCATION_ORIGIN=installer on its "$exe" install run (matching the setup run), so script installs are distinguishable from a user manually running `composio install`. npm and Homebrew installs never run install.sh, so the install stage only covers install.sh installs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Kshitij Jhunjhunwala committed Jul 23, 2026 at 13:49 UTC 5254e9075192b44c384c27f3838e4bf2c5dc6fe9
4 files changed +228 -83
install.sh
+1 -1
@@ -310,7 +310,7 @@ success "Composio CLI was installed successfully to $Bold_Green$(tildify "$exe")
310 echo
311
312 install_err=$(mktemp)
313 -if COMPOSIO_INSTALL_DIR="$COMPOSIO_INSTALL_DIR" "$exe" install 2>"$install_err"; then
313 +if COMPOSIO_INSTALL_DIR="$COMPOSIO_INSTALL_DIR" COMPOSIO_CLI_INVOCATION_ORIGIN=installer "$exe" install 2>"$install_err"; then
314 cat "$install_err" >&2 # Show CLI's TerminalUI output on success
315 else
316 info "Setting up shell integration..."
ts/packages/cli/CHANGELOG.md
+1
@@ -11,6 +11,7 @@
11 ### Minor Changes
12
13 - Telemetry now delivers directly to PostHog, so pre-login `install`/`setup` events are captured. Opt-outs are unchanged.
14 +- Telemetry events now carry `journey_stage` (install/setup/login/connect/execute/other) and `cli_channel` (stable/beta) properties, and `install.sh` marks its `composio install` run with `invocation_origin: installer` so script installs are distinguishable from manual ones. npm and Homebrew installs do not run `install.sh`, so they emit no install-stage events.
15 - a0bef5d: Bump `@composio/client` to `0.1.0-alpha.74`.
16 - 025a657: Drop CommonJS entrypoints and publish the TypeScript SDK packages as ESM-only packages. This is a breaking change within the existing 0.x release line: consumers must use Node.js 22.22.3 or newer. CommonJS callers can only rely on Node's native `require(esm)` interop, and the SDK no longer ships custom CommonJS compatibility machinery or `.cjs` artifacts.
17
ts/packages/cli/src/analytics/events.ts
+123 -81
@@ -1,4 +1,6 @@
1 import type { CliCommandTelemetryContext, TrackEvent } from './types';
2 +import { APP_VERSION } from 'src/constants';
3 +import { inferSkillReleaseChannel } from 'src/effects/install-skill';
4 import { ToolInputValidationError } from 'src/services/tool-input-validation';
5 import { toolkitFromToolSlug } from 'src/utils/toolkit-from-tool-slug';
6
@@ -44,6 +46,75 @@ export const CLI_ANALYTICS_EVENTS = {
46 CLI_TOOL_INVOCATION_FAILED: 'CLI_TOOL_INVOCATION_FAILED',
47 } as const;
48
49 +type CliAnalyticsEventName = (typeof CLI_ANALYTICS_EVENTS)[keyof typeof CLI_ANALYTICS_EVENTS];
50 +
51 +// Contract with the downstream metrics flow page: stage values group the
52 +// adoption funnel, so renaming or removing one is a breaking change there.
53 +export const CLI_JOURNEY_STAGES = [
54 + 'install',
55 + 'setup',
56 + 'login',
57 + 'connect',
58 + 'execute',
59 + 'other',
60 +] as const;
61 +
62 +export type CliJourneyStage = (typeof CLI_JOURNEY_STAGES)[number];
63 +
64 +export const CLI_EVENT_JOURNEY_STAGES = {
65 + CLI_COMMAND_INVOKED: 'other',
66 + CLI_COMMAND_SUCCEEDED: 'other',
67 + CLI_COMMAND_FAILED: 'other',
68 + CLI_EXECUTE_INVOKED: 'execute',
69 + CLI_EXECUTE_SUCCEEDED: 'execute',
70 + CLI_EXECUTE_FAILED: 'execute',
71 + CLI_SEARCH_INVOKED: 'other',
72 + CLI_SEARCH_SUCCEEDED: 'other',
73 + CLI_SEARCH_FAILED: 'other',
74 + CLI_LINK_INVOKED: 'connect',
75 + CLI_LINK_SUCCEEDED: 'connect',
76 + CLI_LINK_FAILED: 'connect',
77 + CLI_LOGIN_INVOKED: 'login',
78 + CLI_LOGIN_SUCCEEDED: 'login',
79 + CLI_LOGIN_FAILED: 'login',
80 + CLI_LOGOUT_INVOKED: 'other',
81 + CLI_LOGOUT_SUCCEEDED: 'other',
82 + CLI_LOGOUT_FAILED: 'other',
83 + CLI_PROXY_INVOKED: 'other',
84 + CLI_PROXY_SUCCEEDED: 'other',
85 + CLI_PROXY_FAILED: 'other',
86 + CLI_RUN_INVOKED: 'other',
87 + CLI_RUN_SUCCEEDED: 'other',
88 + CLI_RUN_FAILED: 'other',
89 + CLI_INSTALL_INVOKED: 'install',
90 + CLI_INSTALL_SUCCEEDED: 'install',
91 + CLI_INSTALL_FAILED: 'install',
92 + CLI_SETUP_INVOKED: 'setup',
93 + CLI_SETUP_SUCCEEDED: 'setup',
94 + CLI_SETUP_FAILED: 'setup',
95 + CLI_SETUP_HOST_DETECTED: 'setup',
96 + CLI_SETUP_CANCELLED: 'setup',
97 + CLI_SETUP_SKIPPED: 'setup',
98 + CLI_PLUGIN_SETUP_SUCCEEDED: 'setup',
99 + CLI_PLUGIN_SETUP_FAILED: 'setup',
100 + CLI_PLUGIN_UNINSTALL_SUCCEEDED: 'setup',
101 + CLI_TOOL_INVOCATION_VALIDATION_FAILED: 'execute',
102 + CLI_TOOL_INVOCATION_TOOL_NOT_FOUND: 'execute',
103 + CLI_TOOL_INVOCATION_FAILED: 'execute',
104 +} as const satisfies Record<CliAnalyticsEventName, CliJourneyStage>;
105 +
106 +const buildEvent = (
107 + name: CliAnalyticsEventName,
108 + properties: Record<string, unknown>
109 +): TrackEvent => ({
110 + name,
111 + properties: {
112 + ...properties,
113 + journey_stage: CLI_EVENT_JOURNEY_STAGES[name],
114 + cli_channel: inferSkillReleaseChannel(APP_VERSION),
115 + },
116 +});
117 +
118 const KNOWN_COMMAND_TOKENS = new Set([
119 'version',
120 'upgrade',
@@ -400,9 +471,8 @@ export const createCliCommandTelemetryContext = (
471 : undefined,
472 });
473
403 -const getCliCommandInvokedEvent = (context: CliCommandTelemetryContext): TrackEvent => ({
404 - name: CLI_ANALYTICS_EVENTS.CLI_COMMAND_INVOKED,
405 - properties: {
474 +const getCliCommandInvokedEvent = (context: CliCommandTelemetryContext): TrackEvent =>
475 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_COMMAND_INVOKED, {
476 source: 'cli',
477 invocation_origin: getInvocationOrigin(),
478 cli_version: context.cliVersion,
@@ -411,27 +481,23 @@ const getCliCommandInvokedEvent = (context: CliCommandTelemetryContext): TrackEv
481 arg_count: Math.max(0, context.argv.length - 2),
482 stdout_is_tty: context.stdoutIsTTY,
483 stderr_is_tty: context.stderrIsTTY,
414 - },
415 -});
484 + });
485
417 -const getCliCommandSucceededEvent = (context: CliCommandTelemetryContext): TrackEvent => ({
418 - name: CLI_ANALYTICS_EVENTS.CLI_COMMAND_SUCCEEDED,
419 - properties: {
486 +const getCliCommandSucceededEvent = (context: CliCommandTelemetryContext): TrackEvent =>
487 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_COMMAND_SUCCEEDED, {
488 source: 'cli',
489 invocation_origin: getInvocationOrigin(),
490 cli_version: context.cliVersion,
491 command_path: context.commandPath,
492 duration_ms: Date.now() - context.startedAt,
493 flag_names: context.flagNames,
426 - },
427 -});
494 + });
495
496 const getCliCommandFailedEvent = (
497 context: CliCommandTelemetryContext,
498 error: unknown
432 -): TrackEvent => ({
433 - name: CLI_ANALYTICS_EVENTS.CLI_COMMAND_FAILED,
434 - properties: {
499 +): TrackEvent =>
500 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_COMMAND_FAILED, {
501 source: 'cli',
502 invocation_origin: getInvocationOrigin(),
503 cli_version: context.cliVersion,
@@ -440,14 +506,13 @@ const getCliCommandFailedEvent = (
506 flag_names: context.flagNames,
507 error_name: errorNameOf(error),
508 error_message: errorMessageOf(error),
443 - },
444 -});
509 + });
510
511 type SpecialLifecycleFamily = {
512 readonly match: (commandPath: string) => boolean;
448 - readonly invokedEventName: string;
449 - readonly succeededEventName: string;
450 - readonly failedEventName: string;
513 + readonly invokedEventName: CliAnalyticsEventName;
514 + readonly succeededEventName: CliAnalyticsEventName;
515 + readonly failedEventName: CliAnalyticsEventName;
516 readonly getProperties: (context: CliCommandTelemetryContext) => Record<string, unknown>;
517 };
518
@@ -527,10 +592,7 @@ export const getPrimaryLifecycleInvokedEvent = (
592 if (!family || isGenericOnlyCommand(context.commandPath)) {
593 return getCliCommandInvokedEvent(context);
594 }
530 - return {
531 - name: family.invokedEventName,
532 - properties: family.getProperties(context),
533 - };
595 + return buildEvent(family.invokedEventName, family.getProperties(context));
596 };
597
598 export const getPrimaryLifecycleSucceededEvent = (
@@ -540,10 +602,7 @@ export const getPrimaryLifecycleSucceededEvent = (
602 if (!family || isGenericOnlyCommand(context.commandPath)) {
603 return getCliCommandSucceededEvent(context);
604 }
543 - return {
544 - name: family.succeededEventName,
545 - properties: family.getProperties(context),
546 - };
605 + return buildEvent(family.succeededEventName, family.getProperties(context));
606 };
607
608 export const getPrimaryLifecycleFailedEvent = (
@@ -554,14 +613,11 @@ export const getPrimaryLifecycleFailedEvent = (
613 if (!family || isGenericOnlyCommand(context.commandPath)) {
614 return getCliCommandFailedEvent(context, error);
615 }
557 - return {
558 - name: family.failedEventName,
559 - properties: {
560 - ...family.getProperties(context),
561 - error_name: errorNameOf(error),
562 - error_message: errorMessageOf(error),
563 - },
564 - };
616 + return buildEvent(family.failedEventName, {
617 + ...family.getProperties(context),
618 + error_name: errorNameOf(error),
619 + error_message: errorMessageOf(error),
620 + });
621 };
622
623 export const getPluginLifecycleSucceededEvent = (params: {
@@ -569,21 +625,21 @@ export const getPluginLifecycleSucceededEvent = (params: {
625 readonly target: 'claude' | 'codex';
626 readonly action: 'installed' | 'enabled' | 'configured' | 'uninstalled';
627 readonly cliVersion: string;
572 -}): TrackEvent => ({
573 - name:
628 +}): TrackEvent =>
629 + buildEvent(
630 params.operation === 'uninstall'
631 ? CLI_ANALYTICS_EVENTS.CLI_PLUGIN_UNINSTALL_SUCCEEDED
632 : CLI_ANALYTICS_EVENTS.CLI_PLUGIN_SETUP_SUCCEEDED,
577 - properties: {
578 - source: 'cli',
579 - invocation_origin: getInvocationOrigin(),
580 - cli_version: params.cliVersion,
581 - command_path: 'setup',
582 - operation: params.operation,
583 - agent_host: params.target,
584 - action: params.action,
585 - },
586 -});
633 + {
634 + source: 'cli',
635 + invocation_origin: getInvocationOrigin(),
636 + cli_version: params.cliVersion,
637 + command_path: 'setup',
638 + operation: params.operation,
639 + agent_host: params.target,
640 + action: params.action,
641 + }
642 + );
643
644 export const getPluginLifecycleFailedEvent = (params: {
645 readonly operation: 'setup' | 'uninstall';
@@ -591,9 +647,8 @@ export const getPluginLifecycleFailedEvent = (params: {
647 readonly phase: 'install' | 'uninstall';
648 readonly error: unknown;
649 readonly cliVersion: string;
594 -}): TrackEvent => ({
595 - name: CLI_ANALYTICS_EVENTS.CLI_PLUGIN_SETUP_FAILED,
596 - properties: {
650 +}): TrackEvent =>
651 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_PLUGIN_SETUP_FAILED, {
652 source: 'cli',
653 invocation_origin: getInvocationOrigin(),
654 cli_version: params.cliVersion,
@@ -603,8 +658,7 @@ export const getPluginLifecycleFailedEvent = (params: {
658 phase: params.phase,
659 error_name: errorNameOf(params.error),
660 error_message: errorMessageOf(params.error),
606 - },
607 -});
661 + });
662
663 export const getSetupHostDetectedEvent = (params: {
664 readonly operation: 'setup' | 'uninstall';
@@ -616,9 +670,8 @@ export const getSetupHostDetectedEvent = (params: {
670 readonly unsupportedReasonCode?:
671 'codex_too_old' | 'no_json_inspection' | 'host_command_failed' | 'unknown';
672 readonly cliVersion: string;
619 -}): TrackEvent => ({
620 - name: CLI_ANALYTICS_EVENTS.CLI_SETUP_HOST_DETECTED,
621 - properties: {
673 +}): TrackEvent =>
674 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_SETUP_HOST_DETECTED, {
675 source: 'cli',
676 invocation_origin: getInvocationOrigin(),
677 cli_version: params.cliVersion,
@@ -630,16 +683,14 @@ export const getSetupHostDetectedEvent = (params: {
683 supported: params.supported,
684 host_version: params.hostVersion,
685 unsupported_reason_code: params.unsupportedReasonCode,
633 - },
634 -});
686 + });
687
688 export const getSetupCancelledEvent = (params: {
689 readonly operation: 'setup' | 'uninstall';
690 readonly requestedTarget: 'auto' | 'claude' | 'codex' | 'all';
691 readonly cliVersion: string;
640 -}): TrackEvent => ({
641 - name: CLI_ANALYTICS_EVENTS.CLI_SETUP_CANCELLED,
642 - properties: {
692 +}): TrackEvent =>
693 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_SETUP_CANCELLED, {
694 source: 'cli',
695 invocation_origin: getInvocationOrigin(),
696 cli_version: params.cliVersion,
@@ -647,16 +698,14 @@ export const getSetupCancelledEvent = (params: {
698 operation: params.operation,
699 requested_target: params.requestedTarget,
700 reason: 'user_declined',
650 - },
651 -});
701 + });
702
703 export const getSetupSkippedEvent = (params: {
704 readonly operation: 'setup' | 'uninstall';
705 readonly requestedTarget: 'auto' | 'claude' | 'codex' | 'all';
706 readonly cliVersion: string;
657 -}): TrackEvent => ({
658 - name: CLI_ANALYTICS_EVENTS.CLI_SETUP_SKIPPED,
659 - properties: {
707 +}): TrackEvent =>
708 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_SETUP_SKIPPED, {
709 source: 'cli',
710 invocation_origin: getInvocationOrigin(),
711 cli_version: params.cliVersion,
@@ -664,8 +713,7 @@ export const getSetupSkippedEvent = (params: {
713 operation: params.operation,
714 requested_target: params.requestedTarget,
715 reason: 'no_host_detected',
667 - },
668 -});
716 + });
717
718 export const getToolExecuteValidationFailedEvent = (params: {
719 readonly toolSlug: string;
@@ -676,9 +724,8 @@ export const getToolExecuteValidationFailedEvent = (params: {
724 readonly stage: 'dry_run' | 'validation' | 'execution';
725 readonly failureOrigin: 'fast_fail' | 'main_endpoint';
726 readonly logId?: string;
679 -}): TrackEvent => ({
680 - name: CLI_ANALYTICS_EVENTS.CLI_TOOL_INVOCATION_VALIDATION_FAILED,
681 - properties: {
727 +}): TrackEvent =>
728 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_TOOL_INVOCATION_VALIDATION_FAILED, {
729 source: 'cli',
730 invocation_origin: getInvocationOrigin(),
731 tool_slug: params.toolSlug,
@@ -693,8 +740,7 @@ export const getToolExecuteValidationFailedEvent = (params: {
740 unknown_keys: extractUnknownKeys(params.error.issues),
741 schema_path: params.error.schemaPath,
742 ...argumentShape(params.args),
696 - },
697 -});
743 + });
744
745 export const isMaybeToolNotFoundError = (params: {
746 readonly message?: string;
@@ -731,9 +777,8 @@ export const getToolExecuteToolNotFoundEvent = (params: {
777 readonly status?: number;
778 readonly apiCode?: number;
779 readonly message?: string;
734 -}): TrackEvent => ({
735 - name: CLI_ANALYTICS_EVENTS.CLI_TOOL_INVOCATION_TOOL_NOT_FOUND,
736 - properties: {
780 +}): TrackEvent =>
781 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_TOOL_INVOCATION_TOOL_NOT_FOUND, {
782 source: 'cli',
783 invocation_origin: getInvocationOrigin(),
784 tool_slug: params.toolSlug,
@@ -748,8 +793,7 @@ export const getToolExecuteToolNotFoundEvent = (params: {
793 api_error_code: params.apiCode,
794 error_message: params.message?.slice(0, 500),
795 ...argumentShape(params.args),
751 - },
752 -});
796 + });
797
798 export const getToolExecuteFailedEvent = (params: {
799 readonly toolSlug: string;
@@ -765,9 +809,8 @@ export const getToolExecuteFailedEvent = (params: {
809 readonly message?: string;
810 readonly errorName?: string;
811 readonly isNoConnectionError?: boolean;
768 -}): TrackEvent => ({
769 - name: CLI_ANALYTICS_EVENTS.CLI_TOOL_INVOCATION_FAILED,
770 - properties: {
812 +}): TrackEvent =>
813 + buildEvent(CLI_ANALYTICS_EVENTS.CLI_TOOL_INVOCATION_FAILED, {
814 source: 'cli',
815 invocation_origin: getInvocationOrigin(),
816 tool_slug: params.toolSlug,
@@ -784,5 +827,4 @@ export const getToolExecuteFailedEvent = (params: {
827 error_message: params.message?.slice(0, 500),
828 is_no_connection_error: Boolean(params.isNoConnectionError),
829 ...argumentShape(params.args),
787 - },
788 -});
830 + });
ts/packages/cli/test/src/analytics.events.test.ts
+103 -1
@@ -1,7 +1,10 @@
1 -import { describe, expect, it } from 'vitest';
1 +import { readFileSync } from 'node:fs';
2 +import { afterEach, describe, expect, it, vi } from 'vitest';
3 import { createCliCodactFailureBody } from 'src/analytics/dispatch';
4 import {
5 CLI_ANALYTICS_EVENTS,
6 + CLI_EVENT_JOURNEY_STAGES,
7 + CLI_JOURNEY_STAGES,
8 createCliCommandTelemetryContext,
9 getPluginLifecycleFailedEvent,
10 getPluginLifecycleSucceededEvent,
@@ -18,6 +21,8 @@ import {
21 isMaybeToolValidationError,
22 } from 'src/analytics/events';
23 import { APP_VERSION } from 'src/constants';
24 +import { inferSkillReleaseChannel } from 'src/effects/install-skill';
25 +import { CLI_RELEASE_CHANNELS } from 'src/experimental-features';
26 import { ToolInputValidationError } from 'src/services/tool-input-validation';
27
28 describe('CLI analytics execute failure events', () => {
@@ -326,3 +331,100 @@ describe('CLI analytics setup runtime-context events', () => {
331 });
332 });
333 });
334 +
335 +describe('CLI analytics journey taxonomy', () => {
336 + afterEach(() => {
337 + vi.unstubAllEnvs();
338 + });
339 +
340 + const contextFor = (argv: ReadonlyArray<string>) =>
341 + createCliCommandTelemetryContext(['bun', 'composio', ...argv], APP_VERSION, {
342 + stdoutIsTTY: false,
343 + stderrIsTTY: false,
344 + });
345 +
346 + const lifecycleCases: ReadonlyArray<[ReadonlyArray<string>, string]> = [
347 + [['execute', 'GMAIL_SEND_EMAIL'], 'execute'],
348 + [['search', 'send email'], 'other'],
349 + [['link', 'github'], 'connect'],
350 + [['login'], 'login'],
351 + [['logout'], 'other'],
352 + [['proxy', '/api/v3/toolkits'], 'other'],
353 + [['run', 'echo hi'], 'other'],
354 + [['install'], 'install'],
355 + [['setup'], 'setup'],
356 + [['version'], 'other'],
357 + ];
358 +
359 + it.each(lifecycleCases)('stamps %j lifecycle events with journey_stage %s', (argv, stage) => {
360 + const context = contextFor(argv);
361 +
362 + expect(getPrimaryLifecycleInvokedEvent(context)?.properties?.journey_stage).toBe(stage);
363 + expect(getPrimaryLifecycleSucceededEvent(context)?.properties?.journey_stage).toBe(stage);
364 + expect(
365 + getPrimaryLifecycleFailedEvent(context, new Error('boom'))?.properties?.journey_stage
366 + ).toBe(stage);
367 + });
368 +
369 + it('maps every analytics event name to a declared journey stage', () => {
370 + for (const name of Object.values(CLI_ANALYTICS_EVENTS)) {
371 + expect(CLI_JOURNEY_STAGES).toContain(CLI_EVENT_JOURNEY_STAGES[name]);
372 + }
373 + });
374 +
375 + it('stamps standalone setup and tool-invocation events with their stages', () => {
376 + expect(
377 + getPluginLifecycleSucceededEvent({
378 + operation: 'setup',
379 + target: 'claude',
380 + action: 'installed',
381 + cliVersion: APP_VERSION,
382 + })?.properties?.journey_stage
383 + ).toBe('setup');
384 +
385 + expect(
386 + getSetupSkippedEvent({
387 + operation: 'setup',
388 + requestedTarget: 'auto',
389 + cliVersion: APP_VERSION,
390 + })?.properties?.journey_stage
391 + ).toBe('setup');
392 +
393 + expect(
394 + getToolExecuteFailedEvent({
395 + toolSlug: 'GMAIL_SEND_EMAIL',
396 + args: {},
397 + surface: 'root',
398 + projectMode: 'consumer',
399 + stage: 'execution',
400 + failureOrigin: 'main_endpoint',
401 + })?.properties?.journey_stage
402 + ).toBe('execute');
403 + });
404 +
405 + it('stamps events with the release channel of the running build', () => {
406 + const properties = getPrimaryLifecycleInvokedEvent(contextFor(['login']))?.properties;
407 +
408 + expect(properties?.cli_channel).toBe(inferSkillReleaseChannel(APP_VERSION));
409 + expect(CLI_RELEASE_CHANNELS).toContain(properties?.cli_channel);
410 + });
411 +
412 + it('propagates the installer invocation origin from the environment', () => {
413 + vi.stubEnv('COMPOSIO_CLI_INVOCATION_ORIGIN', 'installer');
414 +
415 + expect(getPrimaryLifecycleInvokedEvent(contextFor(['install']))?.properties).toMatchObject({
416 + invocation_origin: 'installer',
417 + journey_stage: 'install',
418 + });
419 + });
420 +
421 + it('marks the install.sh shell-integration run as installer-origin', () => {
422 + const installScript = readFileSync(
423 + new URL('../../../../../install.sh', import.meta.url),
424 + 'utf8'
425 + );
426 + const installLine = installScript.split('\n').find(line => line.includes('"$exe" install '));
427 +
428 + expect(installLine).toContain('COMPOSIO_CLI_INVOCATION_ORIGIN=installer');
429 + });
430 +});