Changesets · Branches · Tags · Compare
| Changeset | 278480280cd64466a2a384746bbe2ed7d4f9b84c666797729f83c2bcdf9dff74 |
|---|---|
| Author | Nate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-09-26 17:31 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-26 17:31 -07:00 |
| Parents | 54132eb5aa27 |
3 files changed
modified extensions/cli/src/commands/serve.ts +4 −0
| @@ -2,6 +2,8 @@ | ||
| 2 | 2 | import type { ChatHistoryItem } from "core/index.js"; |
| 3 | 3 | import express, { Request, Response } from "express"; |
| 4 | 4 | |
| 5 | +import { posthogService } from "src/telemetry/posthogService.js"; | |
| 6 | + | |
| 5 | 7 | import { getAccessToken, getAssistantSlug } from "../auth/workos.js"; |
| 6 | 8 | import { runEnvironmentInstallSafe } from "../environment/environmentHandler.js"; |
| 7 | 9 | import { processCommandFlags } from "../flags/flagProcessor.js"; |
| @@ -42,6 +44,8 @@ | ||
| 42 | 44 | |
| 43 | 45 | // eslint-disable-next-line max-statements |
| 44 | 46 | export async function serve(prompt?: string, options: ServeOptions = {}) { |
| 47 | + await posthogService.capture("sessionStart", {}); | |
| 48 | + | |
| 45 | 49 | // Check if prompt should come from stdin instead of parameter |
| 46 | 50 | let actualPrompt = prompt; |
| 47 | 51 | if (!prompt) { |
modified extensions/cli/src/telemetry/posthogService.ts +2 −1
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | import type { PostHog as PostHogType } from "posthog-node"; |
| 6 | 6 | |
| 7 | 7 | import { isAuthenticatedConfig, loadAuthConfig } from "../auth/workos.js"; |
| 8 | -import { isHeadlessMode } from "../util/cli.js"; | |
| 8 | +import { isHeadlessMode, isServe } from "../util/cli.js"; | |
| 9 | 9 | import { isGitHubActions } from "../util/git.js"; |
| 10 | 10 | import { logger } from "../util/logger.js"; |
| 11 | 11 | import { getVersion } from "../version.js"; |
| @@ -95,6 +95,7 @@ | ||
| 95 | 95 | ideType: "cli", |
| 96 | 96 | isHeadless: isHeadlessMode(), |
| 97 | 97 | isGitHubCI: isGitHubActions(), |
| 98 | + isServe: isServe(), | |
| 98 | 99 | }; |
| 99 | 100 | const payload = { |
| 100 | 101 | distinctId: this.uniqueId, |
modified extensions/cli/src/util/cli.ts +4 −0
| @@ -9,3 +9,7 @@ | ||
| 9 | 9 | const args = process.argv.slice(2); |
| 10 | 10 | return args.includes("-p") || args.includes("--print"); |
| 11 | 11 | } |
| 12 | + | |
| 13 | +export function isServe(): boolean { | |
| 14 | + return process.argv?.includes("serve") ?? false; | |
| 15 | +} |