fix type errs

This commit is contained in:
Nate 2025-07-20 11:18:12 -07:00
parent 75a4935cb0
commit 1073629b77
3 changed files with 12 additions and 9 deletions

View file

@ -2,7 +2,7 @@ import chalk from "chalk";
import { ChatCompletionMessageParam } from "openai/resources.mjs";
import * as readlineSync from "readline-sync";
import { CONTINUE_ASCII_ART } from "../asciiArt.js";
import { ensureOrganization, loadAuthConfig } from "../auth/workos.js";
import { ensureOrganization, loadAuthConfig, getOrganizationId } from "../auth/workos.js";
import { introMessage } from "../intro.js";
import { configureLogger } from "../logger.js";
import { initializeWithOnboarding } from "../onboarding.js";
@ -46,10 +46,11 @@ async function initializeChat(options: ChatOptions) {
);
// Update telemetry with organization info
if (finalAuthConfig.selectedOrganization?.id) {
telemetryService.updateOrganization(
finalAuthConfig.selectedOrganization.id
);
if (finalAuthConfig) {
const organizationId = getOrganizationId(finalAuthConfig);
if (organizationId) {
telemetryService.updateOrganization(organizationId);
}
}
}
@ -178,4 +179,4 @@ export async function chat(prompt?: string, options: ChatOptions = {}) {
// Stop active time tracking
telemetryService.stopActiveTime();
}
}
}

View file

@ -9,10 +9,11 @@ export async function logout() {
".continue",
".onboarding_complete"
);
workosLogout();
// Remove onboarding completion flag so user will go through onboarding again
if (fs.existsSync(onboardingFlagPath)) {
fs.unlinkSync(onboardingFlagPath);
}
workosLogout();
}

View file

@ -1,5 +1,6 @@
import { metrics } from "@opentelemetry/api";
import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
import { resourceFromAttributes } from "@opentelemetry/resources";
import {
ConsoleMetricExporter,
MeterProvider,
@ -77,7 +78,7 @@ class TelemetryService {
private initialize() {
try {
// Create resource
const resource = new Resource({
const resource = resourceFromAttributes({
[SEMRESATTRS_SERVICE_NAME]: "continue-cli",
[SEMRESATTRS_SERVICE_VERSION]: getVersion(),
[SEMRESATTRS_DEPLOYMENT_ENVIRONMENT]:
@ -556,4 +557,4 @@ class TelemetryService {
// Export the singleton instance directly
export const telemetryService = new TelemetryService();
export default telemetryService;
export default telemetryService;