import * as Cause from "effect/Cause"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Option from "effect/Option"; import * as Ref from "effect/Ref"; import type * as Scope from "effect/Scope"; import * as ServiceMap from "effect/Context"; import { type OperationLifecycleService } from "@agentxm/workspace/transitions/planning"; import type { ExpectedCliError } from "./runtime-envelope.js"; import { TelemetryClient } from "../telemetry/index.js"; import type { TelemetryProperties } from "../telemetry/client.js"; export interface CliCommandTelemetryOptions { readonly command: string; readonly event?: string; readonly properties?: TelemetryProperties; } export declare const trackCliCommand: ({ command, event, properties, }: CliCommandTelemetryOptions) => Effect.Effect; export type ProductActivityKind = "configure" | "install" | "publish" | "restore" | "update"; export interface ProductActivityIntent { readonly activity: ProductActivityKind; /** Whether a successful usable completion can activate a consumer cohort. */ readonly activationEligible: boolean; } interface ProductActivityAttempt extends ProductActivityIntent { readonly activityId: string; } declare const ProductActivity_base: ServiceMap.ServiceClass>; }>; export declare class ProductActivity extends ProductActivity_base { } export declare const ProductActivityLive: Layer.Layer; /** * Register and publish the first eligible product activity in this invocation. * Nested command adapters are intentionally idempotent and retain the outer * activity identity. */ export declare const startProductActivity: (intent: ProductActivityIntent) => Effect.Effect; export interface CliCommandCompletedOptions { readonly command: string; readonly result: "success" | "error" | "cancelled" | "defect"; readonly durationMs: number; readonly errorCode?: string; readonly errorCategory?: string; readonly semanticProperties?: TelemetryProperties; } export declare const trackCliCommandCompleted: (options: CliCommandCompletedOptions) => Effect.Effect; export declare const readGlobalFlagProperties: Effect.Effect<{ "cli.global.non_interactive": string; "cli.global.json": string; "cli.global.verbose": string; "cli.global.debug": string; "cli.global.quiet": string; }, never, "effect/unstable/cli/GlobalFlag/axm-non-interactive" | "effect/unstable/cli/GlobalFlag/axm-json" | "effect/unstable/cli/GlobalFlag/axm-quiet" | "effect/unstable/cli/GlobalFlag/axm-verbose" | "effect/unstable/cli/GlobalFlag/axm-debug">; export declare const reportCliError: (error: ExpectedCliError, command: string) => Effect.Effect; declare const CommandSemanticProperties_base: ServiceMap.ServiceClass; }>; export declare class CommandSemanticProperties extends CommandSemanticProperties_base { } /** * Set semantic telemetry properties from within a command handler. * These properties are read by the runtime envelope and merged into * the `command_completed` event. Safe to call when the service is * absent (e.g., in tests that bypass the runtime envelope). */ export declare const setCommandSemanticProperties: (properties: TelemetryProperties) => Effect.Effect; export declare const getCommandSemanticProperties: Effect.Effect; /** * Create a Layer that provides CommandSemanticProperties backed by a fresh Ref. */ export declare const CommandSemanticPropertiesLive: Layer.Layer; /** * Fold an operation's lifecycle into `cli.lifecycle.*` semantic properties at * settlement. Telemetry is an independent, lossy observer: it buffers with a * sliding window so it can never hold the frame or the machine writer back, * and it does not register as lossless. */ export declare const observeLifecycleForTelemetry: (lifecycle: OperationLifecycleService) => Effect.Effect; export declare const reportCliDefect: (cause: Cause.Cause, command: string) => Effect.Effect; export {}; //# sourceMappingURL=telemetry.d.ts.map