import type { InstalledSkill } from "@agentxm/workspace-features/lifecycle"; import { type CallerAgent } from "./caller-agent.js"; import * as Effect from "effect/Effect"; import type * as FileSystem from "effect/FileSystem"; import * as Layer from "effect/Layer"; import * as ServiceMap from "effect/Context"; import type * as Path from "effect/Path"; import * as HttpClient from "effect/http/HttpClient"; import type { TelemetryMode } from "./mode.js"; import { type TelemetryClientIdentity, type TelemetryFailureReport, type TelemetryPreviewFormat, type TelemetryProperties } from "./payloads.js"; export interface TelemetryClientService { /** This process invocation's identity, shared by its usage events and its error report. */ readonly invocationId: string; readonly trackEvent: (event: string, properties?: TelemetryProperties) => Effect.Effect; readonly trackSkillInstalls: (skills: ReadonlyArray, activityId?: string) => Effect.Effect; /** Report the invocation's terminal failure; an invocation reports at most one. */ readonly reportError: (failure: TelemetryFailureReport) => Effect.Effect; } export interface TelemetryClientOptions { readonly mode: TelemetryMode; readonly client: TelemetryClientIdentity; /** Write each payload to the diagnostic channel instead of sending it. */ readonly preview?: boolean; /** * How a preview line is framed where no command runtime states its output * format (see `TelemetryPreviewFraming`); machine output keeps stderr * NDJSON. Defaults to text. */ readonly previewFormat?: TelemetryPreviewFormat; /** Where preview lines go. Defaults to one line on stderr; a failed write is dropped. */ readonly diagnostic?: (line: string) => Effect.Effect; /** * Deliver even while the repository's own test run is executing. Delivery * is suppressed under Vitest so no test reaches the telemetry service; a * specification that observes delivery asks for it explicitly here. */ readonly deliverInTest?: boolean; /** Deterministic test seam; production persists a random installation ID. */ readonly installationId?: string; /** Deterministic test seam; production assigns a fresh event ID per event and report. */ readonly eventIdFactory?: () => string; /** Foreign detector seam; called only after effective consent. */ readonly detectCaller?: Effect.Effect; } declare const TelemetryClient_base: ServiceMap.ServiceClass; export declare class TelemetryClient extends TelemetryClient_base { } declare const TelemetryPreviewFraming_base: ServiceMap.ServiceClass; /** * The output format of the stream a preview line joins. A command runtime * provides the format it resolved from the parsed command line, so a line * written while it runs matches its Screen's stderr; elsewhere the reporter's * own `previewFormat` applies. */ export declare class TelemetryPreviewFraming extends TelemetryPreviewFraming_base { } export declare const TelemetryClientTest: Layer.Layer; /** * The most an invocation waits, in total, for its pending telemetry when it * ends. Whatever is still pending then is interrupted. */ export declare const TELEMETRY_SHUTDOWN_BUDGET = "250 millis"; export declare const TelemetryClientLive: (options: TelemetryClientOptions) => Layer.Layer; export {}; //# sourceMappingURL=client.d.ts.map