@clinebot/shared 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ export declare const AGENT_CONFIG_DIRECTORY_NAME = "agents";
2
+ export declare const HOOKS_CONFIG_DIRECTORY_NAME = "hooks";
3
+ export declare const SKILLS_CONFIG_DIRECTORY_NAME = "skills";
4
+ export declare const RULES_CONFIG_DIRECTORY_NAME = "rules";
5
+ export declare const WORKFLOWS_CONFIG_DIRECTORY_NAME = "workflows";
6
+ export declare const PLUGINS_DIRECTORY_NAME = "plugins";
7
+ export declare const CLINE_MCP_SETTINGS_FILE_NAME = "cline_mcp_settings.json";
8
+ export declare function setHomeDir(dir: string): void;
9
+ export declare function setHomeDirIfUnset(dir: string): void;
10
+ export declare function resolveDocumentsClineDirectoryPath(): string;
11
+ export declare function resolveDocumentsAgentConfigDirectoryPath(): string;
12
+ export declare function resolveDocumentsHooksDirectoryPath(): string;
13
+ export declare function resolveDocumentsRulesDirectoryPath(): string;
14
+ export declare function resolveDocumentsWorkflowsDirectoryPath(): string;
15
+ export declare function resolveClineDataDir(): string;
16
+ export declare function resolveSessionDataDir(): string;
17
+ export declare function resolveTeamDataDir(): string;
18
+ export declare function resolveProviderSettingsPath(): string;
19
+ export declare function resolveMcpSettingsPath(): string;
20
+ export declare function resolveAgentsConfigDirPath(): string;
21
+ export declare function resolveAgentConfigSearchPaths(): string[];
22
+ export declare function resolveHooksConfigSearchPaths(workspacePath?: string): string[];
23
+ export declare function resolveSkillsConfigSearchPaths(workspacePath?: string): string[];
24
+ export declare function resolveRulesConfigSearchPaths(workspacePath?: string): string[];
25
+ export declare function resolveWorkflowsConfigSearchPaths(workspacePath?: string): string[];
26
+ export declare function resolvePluginConfigSearchPaths(workspacePath?: string): string[];
27
+ export declare function ensureParentDir(filePath: string): void;
28
+ export declare function ensureHookLogDir(filePath?: string): string;
package/dist/vcr.d.ts ADDED
@@ -0,0 +1,51 @@
1
+ /**
2
+ * VCR (Video Cassette Recorder) for HTTP requests.
3
+ *
4
+ * Patches `globalThis.fetch` to record and replay HTTP interactions,
5
+ * enabling deterministic testing without making real API calls.
6
+ *
7
+ * Unlike nock (which patches Node's `http` module), this works by wrapping
8
+ * `globalThis.fetch` directly — catching all HTTP traffic in this codebase
9
+ * including calls made through the OpenAI, Anthropic, Gemini, and Vercel AI
10
+ * SDKs (all of which delegate to the global fetch).
11
+ *
12
+ * Environment variables:
13
+ * CLINE_VCR - "record" to record HTTP requests, "playback" to replay them
14
+ * CLINE_VCR_CASSETTE - Path to the cassette file (default: ./vcr-cassette.json)
15
+ * CLINE_VCR_FILTER - Substring to filter recorded/replayed request paths.
16
+ * When set to a non-empty string, only requests whose path
17
+ * contains this substring are recorded/replayed; all other
18
+ * requests pass through to the real network.
19
+ * When empty or unset, ALL requests are intercepted (no filter).
20
+ * CLINE_VCR_SSE_DELAY - Milliseconds between SSE chunks during playback (default: 100).
21
+ * Set to 0 for instant delivery.
22
+ *
23
+ * Usage:
24
+ * # Record only inference requests
25
+ * CLINE_VCR=record CLINE_VCR_CASSETTE=./fixtures/my-test.json clite task "hello"
26
+ *
27
+ * # Replay — auth/S3/etc. requests go through normally, only inference is mocked
28
+ * CLINE_VCR=playback CLINE_VCR_CASSETTE=./fixtures/my-test.json clite task "hello"
29
+ *
30
+ * # Record everything (no filter)
31
+ * CLINE_VCR=record CLINE_VCR_FILTER="" CLINE_VCR_CASSETTE=./fixtures/all.json clite task "hello"
32
+ */
33
+ /** A single recorded HTTP interaction (nock-compatible shape). */
34
+ export interface VcrRecording {
35
+ scope: string;
36
+ method: string;
37
+ path: string;
38
+ body?: string;
39
+ status: number;
40
+ response: unknown;
41
+ responseIsBinary: boolean;
42
+ /** Content-Type header from the original response (captured at record time). */
43
+ contentType?: string;
44
+ }
45
+ /**
46
+ * Initialize VCR mode based on environment variables.
47
+ * Must be called early in startup, before HTTP requests are made.
48
+ *
49
+ * Does nothing if `CLINE_VCR` is not set.
50
+ */
51
+ export declare function initVcr(vcrMode: string | undefined): void;
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@clinebot/shared",
3
+ "version": "0.0.8",
4
+ "description": "[INTERNAL] Shared utilities, types, and schemas for Cline packages",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "development": "./src/index.ts",
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./storage": {
15
+ "development": "./src/storage/index.ts",
16
+ "types": "./dist/storage/index.d.ts",
17
+ "import": "./dist/storage/index.js"
18
+ },
19
+ "./db": {
20
+ "development": "./src/db/index.ts",
21
+ "types": "./dist/db/index.d.ts",
22
+ "import": "./dist/db/index.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "scripts": {
29
+ "build": "BUILD_MODE=package bun bun.mts",
30
+ "clean": "rm -rf dist node_modules",
31
+ "typecheck": "bun tsc --noEmit"
32
+ },
33
+ "dependencies": {
34
+ "better-sqlite3": "^11.10.0",
35
+ "jsonrepair": "^3.13.2",
36
+ "zod": "^4.3.6",
37
+ "zod-to-json-schema": "^3.25.1"
38
+ }
39
+ }