agentcrumbs
Version:
Debug mode for any agent.
37 lines • 1.22 kB
TypeScript
import type { AgentCrumbsConfig } from "./types.js";
type ParsedConfig = {
enabled: false;
} | {
enabled: true;
app?: string;
includes: RegExp[];
excludes: RegExp[];
port: number;
format: "pretty" | "json";
};
/**
* Configure agentcrumbs in the browser.
*
* @example
* configure("*") // enable all namespaces
* configure("myapp:*") // enable namespaces matching pattern
* configure({ ns: "*", app: "my-app", format: "pretty" })
*/
export declare function configure(config: AgentCrumbsConfig | string): void;
export declare function parseConfig(): ParsedConfig;
export declare function isNamespaceEnabled(namespace: string): boolean;
export declare function getCollectorUrl(): string;
export declare function getFormat(): "pretty" | "json";
/**
* Resolve the app name. Priority:
* 1. `app` field from configure() config
* 2. `globalThis.__AGENTCRUMBS_APP__`
* 3. Fallback: "browser"
*/
export declare function getApp(): string;
/** Reset cached config — useful for tests */
export declare function resetConfig(): void;
/** Reset cached app — useful for tests */
export declare function resetApp(): void;
export {};
//# sourceMappingURL=env-browser.d.mts.map