@cline/shared 0.0.38-nightly.1778113663

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.
Files changed (71) hide show
  1. package/README.md +47 -0
  2. package/dist/agent.d.ts +397 -0
  3. package/dist/agents/index.d.ts +1 -0
  4. package/dist/agents/types.d.ts +959 -0
  5. package/dist/automation/index.d.ts +3 -0
  6. package/dist/automation/index.js +65 -0
  7. package/dist/automation/schemas.d.ts +89 -0
  8. package/dist/automation/types.d.ts +151 -0
  9. package/dist/connectors/events.d.ts +93 -0
  10. package/dist/connectors/options.d.ts +173 -0
  11. package/dist/cron/cron-spec-types.d.ts +94 -0
  12. package/dist/cron/index.d.ts +1 -0
  13. package/dist/db/index.d.ts +2 -0
  14. package/dist/db/index.js +80 -0
  15. package/dist/db/sqlite-db.d.ts +24 -0
  16. package/dist/dispose.d.ts +13 -0
  17. package/dist/extensions/context.d.ts +76 -0
  18. package/dist/extensions/contribution-registry.d.ts +195 -0
  19. package/dist/extensions/plugin.d.ts +1 -0
  20. package/dist/hooks/contracts.d.ts +9 -0
  21. package/dist/hooks/events.d.ts +194 -0
  22. package/dist/hub.d.ts +468 -0
  23. package/dist/index.browser.d.ts +57 -0
  24. package/dist/index.browser.js +76 -0
  25. package/dist/index.d.ts +63 -0
  26. package/dist/index.js +149 -0
  27. package/dist/llms/ai-sdk-format.d.ts +42 -0
  28. package/dist/llms/gateway.d.ts +117 -0
  29. package/dist/llms/messages.d.ts +147 -0
  30. package/dist/llms/model-info.d.ts +112 -0
  31. package/dist/llms/reasoning-effort.d.ts +21 -0
  32. package/dist/llms/requests.d.ts +2 -0
  33. package/dist/llms/tools.d.ts +86 -0
  34. package/dist/logging/logger.d.ts +37 -0
  35. package/dist/parse/error.d.ts +2 -0
  36. package/dist/parse/headers/utils.d.ts +1 -0
  37. package/dist/parse/json.d.ts +3 -0
  38. package/dist/parse/shell.d.ts +2 -0
  39. package/dist/parse/string.d.ts +4 -0
  40. package/dist/parse/time.d.ts +9 -0
  41. package/dist/parse/zod.d.ts +12 -0
  42. package/dist/prompt/cline.d.ts +24 -0
  43. package/dist/prompt/format.d.ts +11 -0
  44. package/dist/prompt/system.d.ts +2 -0
  45. package/dist/remote-config/constants.d.ts +5 -0
  46. package/dist/remote-config/schema.d.ts +408 -0
  47. package/dist/rpc/index.d.ts +5 -0
  48. package/dist/rpc/runtime.d.ts +320 -0
  49. package/dist/rpc/team-progress.d.ts +53 -0
  50. package/dist/runtime/build-env.d.ts +13 -0
  51. package/dist/runtime/hub-daemon-env.d.ts +2 -0
  52. package/dist/services/telemetry-config.d.ts +6 -0
  53. package/dist/services/telemetry.d.ts +117 -0
  54. package/dist/session/hook-context.d.ts +12 -0
  55. package/dist/session/index.d.ts +1 -0
  56. package/dist/session/records.d.ts +31 -0
  57. package/dist/session/runtime-config.d.ts +26 -0
  58. package/dist/session/runtime-env.d.ts +8 -0
  59. package/dist/session/workspace.d.ts +28 -0
  60. package/dist/storage/index.d.ts +1 -0
  61. package/dist/storage/index.js +1 -0
  62. package/dist/storage/paths.d.ts +86 -0
  63. package/dist/team/index.d.ts +2 -0
  64. package/dist/team/schema.d.ts +411 -0
  65. package/dist/team/types.d.ts +196 -0
  66. package/dist/tools/create.d.ts +22 -0
  67. package/dist/types/auth.d.ts +20 -0
  68. package/dist/types/index.d.ts +2 -0
  69. package/dist/types/vcr.d.ts +12 -0
  70. package/dist/vcr.d.ts +39 -0
  71. package/package.json +65 -0
@@ -0,0 +1,320 @@
1
+ import z from "zod";
2
+ import type { HubToolExecutorName } from "../hub";
3
+ import type { RuntimeConfigExtensionKind, SessionExecutionConfig, SessionPromptConfig } from "../session/runtime-config";
4
+ export interface ChatRuntimeConfig extends SessionPromptConfig {
5
+ cwd?: string;
6
+ apiKey?: string;
7
+ logger?: RuntimeLoggerConfig;
8
+ enableTools: boolean;
9
+ enableSpawn?: boolean;
10
+ enableTeams?: boolean;
11
+ disableMcpSettingsTools?: boolean;
12
+ autoApproveTools?: boolean;
13
+ missionStepInterval?: number;
14
+ missionTimeIntervalMs?: number;
15
+ timeoutSeconds?: number;
16
+ toolPolicies?: SessionExecutionConfig["toolPolicies"];
17
+ toolExecutors?: HubToolExecutorName[];
18
+ configExtensions?: RuntimeConfigExtensionKind[];
19
+ }
20
+ export interface RuntimeLoggerConfig {
21
+ enabled?: boolean;
22
+ level?: "trace" | "debug" | "info" | "warn" | "error" | "fatal" | "silent";
23
+ destination?: string;
24
+ name?: string;
25
+ bindings?: Record<string, string | number | boolean>;
26
+ }
27
+ export interface ChatStartSessionRequest extends ChatRuntimeConfig {
28
+ sessionId?: string;
29
+ workspaceRoot: string;
30
+ provider: string;
31
+ model: string;
32
+ source?: string;
33
+ interactive?: boolean;
34
+ }
35
+ export interface ChatStartSessionArtifacts {
36
+ sessionId: string;
37
+ manifestPath: string;
38
+ messagesPath: string;
39
+ }
40
+ export interface ChatStartSessionResponse {
41
+ sessionId: string;
42
+ startResult?: ChatStartSessionArtifacts;
43
+ }
44
+ export interface ChatAttachmentFile {
45
+ name: string;
46
+ content: string;
47
+ }
48
+ export interface ChatAttachments {
49
+ userImages?: string[];
50
+ userFiles?: ChatAttachmentFile[];
51
+ }
52
+ export interface ChatRunTurnRequest {
53
+ config: ChatStartSessionRequest;
54
+ prompt: string;
55
+ attachments?: ChatAttachments;
56
+ delivery?: "queue" | "steer";
57
+ }
58
+ export interface ChatToolCallResult {
59
+ name: string;
60
+ input?: unknown;
61
+ output?: unknown;
62
+ error?: string;
63
+ durationMs?: number;
64
+ }
65
+ export interface ChatTurnResult {
66
+ text: string;
67
+ usage: {
68
+ inputTokens: number;
69
+ outputTokens: number;
70
+ cacheReadTokens?: number;
71
+ cacheWriteTokens?: number;
72
+ totalCost?: number;
73
+ };
74
+ inputTokens: number;
75
+ outputTokens: number;
76
+ iterations: number;
77
+ finishReason: string;
78
+ toolCalls: ChatToolCallResult[];
79
+ }
80
+ export interface EnterpriseContext {
81
+ projectId?: string;
82
+ workspaceId?: string;
83
+ organizationId?: string;
84
+ }
85
+ export interface EnterpriseAuthenticateRequest extends EnterpriseContext {
86
+ providerId: string;
87
+ workspacePath: string;
88
+ rootPath?: string;
89
+ }
90
+ export interface EnterpriseAuthenticateResponse {
91
+ providerId: string;
92
+ authenticated: boolean;
93
+ roles: string[];
94
+ claims?: Record<string, unknown>;
95
+ metadata?: Record<string, unknown>;
96
+ }
97
+ export interface EnterpriseSyncRequest extends EnterpriseContext {
98
+ providerId: string;
99
+ workspacePath: string;
100
+ rootPath?: string;
101
+ useCachedBundle?: boolean;
102
+ }
103
+ export interface EnterpriseSyncResponse {
104
+ providerId: string;
105
+ authenticated: boolean;
106
+ hasCachedBundle: boolean;
107
+ appliedConfigVersion?: string;
108
+ roles: string[];
109
+ hasTelemetryOverrides: boolean;
110
+ rulesCount: number;
111
+ workflowsCount: number;
112
+ skillsCount: number;
113
+ claims?: Record<string, unknown>;
114
+ metadata?: Record<string, unknown>;
115
+ }
116
+ export interface EnterpriseStatusRequest {
117
+ providerId: string;
118
+ workspacePath: string;
119
+ rootPath?: string;
120
+ }
121
+ export type EnterpriseStatusResponse = EnterpriseSyncResponse;
122
+ export interface ProviderModel {
123
+ id: string;
124
+ name: string;
125
+ supportsAttachments?: boolean;
126
+ supportsVision?: boolean;
127
+ supportsReasoning?: boolean;
128
+ }
129
+ export interface ProviderListItem {
130
+ id: string;
131
+ name: string;
132
+ models: number | null;
133
+ color: string;
134
+ letter: string;
135
+ enabled: boolean;
136
+ apiKey?: string;
137
+ oauthAccessTokenPresent?: boolean;
138
+ baseUrl?: string;
139
+ defaultModelId?: string;
140
+ protocol?: ProviderProtocol;
141
+ client?: ProviderClient;
142
+ authDescription: string;
143
+ baseUrlDescription: string;
144
+ modelList?: ProviderModel[];
145
+ family?: string;
146
+ }
147
+ export interface ProviderCatalogResponse {
148
+ providers: ProviderListItem[];
149
+ settingsPath: string;
150
+ }
151
+ export interface ProviderModelsResponse {
152
+ providerId: string;
153
+ models: ProviderModel[];
154
+ }
155
+ import type { OAuthProviderId } from "../types/auth";
156
+ export declare const ProviderCapabilitySchema: z.ZodEnum<{
157
+ tools: "tools";
158
+ streaming: "streaming";
159
+ "prompt-cache": "prompt-cache";
160
+ reasoning: "reasoning";
161
+ "computer-use": "computer-use";
162
+ temperature: "temperature";
163
+ files: "files";
164
+ "provider-tools": "provider-tools";
165
+ oauth: "oauth";
166
+ vision: "vision";
167
+ "local-auth": "local-auth";
168
+ }>;
169
+ export type ProviderCapability = z.infer<typeof ProviderCapabilitySchema>;
170
+ export declare const ProviderProtocolSchema: z.ZodEnum<{
171
+ "openai-responses": "openai-responses";
172
+ anthropic: "anthropic";
173
+ gemini: "gemini";
174
+ "openai-chat": "openai-chat";
175
+ "openai-r1": "openai-r1";
176
+ "ai-sdk": "ai-sdk";
177
+ }>;
178
+ export type ProviderProtocol = z.infer<typeof ProviderProtocolSchema>;
179
+ export declare const ProviderClientSchema: z.ZodEnum<{
180
+ custom: "custom";
181
+ anthropic: "anthropic";
182
+ gemini: "gemini";
183
+ "openai-r1": "openai-r1";
184
+ "ai-sdk": "ai-sdk";
185
+ "ai-sdk-community": "ai-sdk-community";
186
+ openai: "openai";
187
+ "openai-compatible": "openai-compatible";
188
+ bedrock: "bedrock";
189
+ fetch: "fetch";
190
+ vertex: "vertex";
191
+ }>;
192
+ export type ProviderClient = z.infer<typeof ProviderClientSchema>;
193
+ export interface ListProvidersActionRequest {
194
+ action: "listProviders";
195
+ }
196
+ export interface GetProviderModelsActionRequest {
197
+ action: "getProviderModels";
198
+ providerId: string;
199
+ }
200
+ export interface SaveProviderSettingsActionRequest {
201
+ action: "saveProviderSettings";
202
+ providerId: string;
203
+ enabled?: boolean;
204
+ apiKey?: string;
205
+ auth?: {
206
+ apiKey?: string;
207
+ accessToken?: string;
208
+ refreshToken?: string;
209
+ expiresAt?: number;
210
+ accountId?: string;
211
+ };
212
+ model?: string;
213
+ protocol?: ProviderProtocol;
214
+ client?: ProviderClient;
215
+ routingProviderId?: string;
216
+ maxTokens?: number;
217
+ contextWindow?: number;
218
+ baseUrl?: string;
219
+ headers?: Record<string, string>;
220
+ timeout?: number;
221
+ reasoning?: {
222
+ enabled?: boolean;
223
+ effort?: "none" | "low" | "medium" | "high" | "xhigh";
224
+ budgetTokens?: number;
225
+ };
226
+ aws?: {
227
+ accessKey?: string;
228
+ secretKey?: string;
229
+ sessionToken?: string;
230
+ region?: string;
231
+ profile?: string;
232
+ authentication?: "iam" | "api-key" | "profile";
233
+ usePromptCache?: boolean;
234
+ useCrossRegionInference?: boolean;
235
+ useGlobalInference?: boolean;
236
+ endpoint?: string;
237
+ customModelBaseId?: string;
238
+ };
239
+ gcp?: {
240
+ projectId?: string;
241
+ region?: string;
242
+ };
243
+ azure?: {
244
+ apiVersion?: string;
245
+ useIdentity?: boolean;
246
+ };
247
+ sap?: {
248
+ clientId?: string;
249
+ clientSecret?: string;
250
+ tokenUrl?: string;
251
+ resourceGroup?: string;
252
+ deploymentId?: string;
253
+ useOrchestrationMode?: boolean;
254
+ api?: "orchestration" | "foundation-models";
255
+ defaultSettings?: Record<string, unknown>;
256
+ };
257
+ oca?: {
258
+ mode?: "internal" | "external";
259
+ usePromptCache?: boolean;
260
+ };
261
+ region?: string;
262
+ apiLine?: "china" | "international";
263
+ capabilities?: ("reasoning" | "prompt-cache" | "streaming" | "tools" | "vision" | "computer-use" | "oauth")[];
264
+ }
265
+ export interface AddProviderActionRequest {
266
+ action: "addProvider";
267
+ providerId: string;
268
+ name: string;
269
+ baseUrl: string;
270
+ apiKey?: string;
271
+ headers?: Record<string, string>;
272
+ timeoutMs?: number;
273
+ models?: string[];
274
+ defaultModelId?: string;
275
+ modelsSourceUrl?: string;
276
+ protocol?: ProviderProtocol;
277
+ client?: ProviderClient;
278
+ capabilities?: ProviderCapability[];
279
+ }
280
+ export type ProviderSettingsActionRequest = ListProvidersActionRequest | GetProviderModelsActionRequest | SaveProviderSettingsActionRequest | AddProviderActionRequest;
281
+ export type ClineAccountActionRequest = {
282
+ action: "clineAccount";
283
+ operation: "fetchMe";
284
+ } | {
285
+ action: "clineAccount";
286
+ operation: "fetchBalance";
287
+ userId?: string;
288
+ } | {
289
+ action: "clineAccount";
290
+ operation: "fetchUsageTransactions";
291
+ userId?: string;
292
+ } | {
293
+ action: "clineAccount";
294
+ operation: "fetchPaymentTransactions";
295
+ userId?: string;
296
+ } | {
297
+ action: "clineAccount";
298
+ operation: "fetchUserOrganizations";
299
+ } | {
300
+ action: "clineAccount";
301
+ operation: "fetchOrganizationBalance";
302
+ organizationId: string;
303
+ } | {
304
+ action: "clineAccount";
305
+ operation: "fetchOrganizationUsageTransactions";
306
+ organizationId: string;
307
+ memberId?: string;
308
+ } | {
309
+ action: "clineAccount";
310
+ operation: "switchAccount";
311
+ organizationId?: string | null;
312
+ } | {
313
+ action: "clineAccount";
314
+ operation: "fetchFeaturebaseToken";
315
+ };
316
+ export type ProviderActionRequest = ProviderSettingsActionRequest | ClineAccountActionRequest;
317
+ export interface ProviderOAuthLoginResponse {
318
+ provider: OAuthProviderId;
319
+ accessToken: string;
320
+ }
@@ -0,0 +1,53 @@
1
+ export declare const TEAM_PROGRESS_EVENT_TYPE = "runtime.team.progress.v1";
2
+ export declare const TEAM_LIFECYCLE_EVENT_TYPE = "runtime.team.lifecycle.v1";
3
+ export type TeamProgressMemberRole = "lead" | "teammate";
4
+ export type TeamProgressMemberStatus = "idle" | "running" | "stopped";
5
+ export type TeamProgressTaskStatus = "pending" | "in_progress" | "blocked" | "completed";
6
+ export type TeamProgressRunStatus = "queued" | "running" | "completed" | "failed" | "cancelled" | "interrupted";
7
+ export type TeamProgressOutcomeStatus = "draft" | "in_review" | "finalized";
8
+ export type TeamProgressOutcomeFragmentStatus = "draft" | "reviewed" | "rejected";
9
+ export interface TeamProgressCounts<TStatus extends string> {
10
+ total: number;
11
+ byStatus: Record<TStatus, number>;
12
+ }
13
+ export interface TeamProgressSummary {
14
+ teamName: string;
15
+ updatedAt: string;
16
+ members: TeamProgressCounts<TeamProgressMemberStatus> & {
17
+ leadCount: number;
18
+ teammateCount: number;
19
+ };
20
+ tasks: TeamProgressCounts<TeamProgressTaskStatus> & {
21
+ blockedTaskIds: string[];
22
+ readyTaskIds: string[];
23
+ completionPct: number;
24
+ };
25
+ runs: TeamProgressCounts<TeamProgressRunStatus> & {
26
+ activeRunIds: string[];
27
+ latestRunId?: string;
28
+ };
29
+ outcomes: TeamProgressCounts<TeamProgressOutcomeStatus> & {
30
+ finalizedPct: number;
31
+ missingRequiredSections: string[];
32
+ };
33
+ fragments: TeamProgressCounts<TeamProgressOutcomeFragmentStatus>;
34
+ }
35
+ export interface TeamProgressLifecycleEvent {
36
+ teamName: string;
37
+ sessionId: string;
38
+ eventType: string;
39
+ ts: string;
40
+ agentId?: string;
41
+ taskId?: string;
42
+ runId?: string;
43
+ outcomeId?: string;
44
+ fragmentId?: string;
45
+ message?: string;
46
+ }
47
+ export interface TeamProgressProjectionEvent {
48
+ type: "team_progress_projection";
49
+ version: 1;
50
+ sessionId: string;
51
+ summary: TeamProgressSummary;
52
+ lastEvent: TeamProgressLifecycleEvent;
53
+ }
@@ -0,0 +1,13 @@
1
+ export declare const CLINE_BUILD_ENV_ENV = "CLINE_BUILD_ENV";
2
+ export declare const CLINE_DEBUG_HOST_ENV = "CLINE_DEBUG_HOST";
3
+ export declare const CLINE_DEBUG_PORT_BASE_ENV = "CLINE_DEBUG_PORT_BASE";
4
+ export type ClineBuildEnv = "development" | "production";
5
+ export type ClineDebugRole = "rpc" | "hook" | "plugin-sandbox" | "connector" | "sandbox";
6
+ export interface ResolveClineBuildEnvOptions {
7
+ env?: NodeJS.ProcessEnv;
8
+ execArgv?: string[];
9
+ debugRole?: ClineDebugRole;
10
+ }
11
+ export declare function resolveClineBuildEnv(options?: ResolveClineBuildEnvOptions): ClineBuildEnv;
12
+ export declare function withResolvedClineBuildEnv(env?: NodeJS.ProcessEnv, options?: Omit<ResolveClineBuildEnvOptions, "env">): NodeJS.ProcessEnv;
13
+ export declare function augmentNodeCommandForDebug(command: string[], options?: ResolveClineBuildEnvOptions): string[];
@@ -0,0 +1,2 @@
1
+ export declare const CLINE_RUN_AS_HUB_DAEMON_ENV = "CLINE_RUN_AS_HUB_DAEMON";
2
+ export declare function isHubDaemonProcess(env?: Record<string, string | undefined>): boolean;
@@ -0,0 +1,6 @@
1
+ import type { OpenTelemetryClientConfig, TelemetryMetadata } from "./telemetry";
2
+ export interface ClineTelemetryServiceConfig extends OpenTelemetryClientConfig {
3
+ metadata: TelemetryMetadata;
4
+ }
5
+ export declare function createClineTelemetryServiceMetadata(overrides?: Partial<TelemetryMetadata>): TelemetryMetadata;
6
+ export declare function createClineTelemetryServiceConfig(configOverrides?: Partial<ClineTelemetryServiceConfig>): ClineTelemetryServiceConfig;
@@ -0,0 +1,117 @@
1
+ export type TelemetryPrimitive = string | number | boolean | null | undefined;
2
+ export type TelemetryValue = TelemetryPrimitive | TelemetryObject | TelemetryArray;
3
+ export type TelemetryObject = {
4
+ [key: string]: TelemetryValue;
5
+ };
6
+ export type TelemetryArray = Array<TelemetryValue>;
7
+ export type TelemetryProperties = TelemetryObject;
8
+ export interface TelemetryMetadata {
9
+ extension_version: string;
10
+ cline_type: string;
11
+ platform: string;
12
+ platform_version: string;
13
+ os_type: string;
14
+ os_version: string;
15
+ is_dev?: string;
16
+ is_remote_workspace?: boolean;
17
+ }
18
+ export interface ITelemetryService {
19
+ setDistinctId(distinctId?: string): void;
20
+ setMetadata(metadata: Partial<TelemetryMetadata>): void;
21
+ updateMetadata(metadata: Partial<TelemetryMetadata>): void;
22
+ setCommonProperties(properties: TelemetryProperties): void;
23
+ updateCommonProperties(properties: TelemetryProperties): void;
24
+ isEnabled(): boolean;
25
+ capture(input: {
26
+ event: string;
27
+ properties?: TelemetryProperties;
28
+ }): void;
29
+ captureRequired(event: string, properties?: TelemetryProperties): void;
30
+ recordCounter(name: string, value: number, attributes?: TelemetryProperties, description?: string, required?: boolean): void;
31
+ recordHistogram(name: string, value: number, attributes?: TelemetryProperties, description?: string, required?: boolean): void;
32
+ recordGauge(name: string, value: number | null, attributes?: TelemetryProperties, description?: string, required?: boolean): void;
33
+ flush(): Promise<void>;
34
+ dispose(): Promise<void>;
35
+ }
36
+ export interface OpenTelemetryClientConfig {
37
+ /**
38
+ * Whether telemetry is enabled via OTEL_TELEMETRY_ENABLED
39
+ */
40
+ enabled: boolean;
41
+ /**
42
+ * Metrics exporter type(s) - can be comma-separated for multiple exporters
43
+ * Examples: "console", "otlp", "prometheus", "console,otlp"
44
+ */
45
+ metricsExporter?: string;
46
+ /**
47
+ * Logs/events exporter type(s) - can be comma-separated for multiple exporters
48
+ * Examples: "console", "otlp"
49
+ */
50
+ logsExporter?: string;
51
+ /**
52
+ * Distributed tracing exporter type(s) - comma-separated for multiple exporters.
53
+ * Examples: "console", "otlp". When unset, no `TracerProvider` is registered.
54
+ */
55
+ tracesExporter?: string;
56
+ /**
57
+ * Protocol for OTLP exporters. SDK support is currently limited to "http/json".
58
+ */
59
+ otlpProtocol?: string;
60
+ /**
61
+ * General OTLP endpoint (used if specific endpoints not set)
62
+ */
63
+ otlpEndpoint?: string;
64
+ /**
65
+ * General OTLP headers
66
+ */
67
+ otlpHeaders?: Record<string, string>;
68
+ /**
69
+ * Metrics-specific OTLP protocol
70
+ */
71
+ otlpMetricsProtocol?: string;
72
+ /**
73
+ * Metrics-specific OTLP endpoint
74
+ */
75
+ otlpMetricsEndpoint?: string;
76
+ otlpMetricsHeaders?: Record<string, string>;
77
+ /**
78
+ * Logs-specific OTLP protocol
79
+ */
80
+ otlpLogsProtocol?: string;
81
+ /**
82
+ * Logs-specific OTLP endpoint
83
+ */
84
+ otlpLogsEndpoint?: string;
85
+ otlpLogsHeaders?: Record<string, string>;
86
+ /**
87
+ * Traces-specific OTLP protocol (SDK support is currently limited to "http/json")
88
+ */
89
+ otlpTracesProtocol?: string;
90
+ /**
91
+ * Traces-specific OTLP endpoint (defaults to {@link otlpEndpoint} when exporting OTLP traces)
92
+ */
93
+ otlpTracesEndpoint?: string;
94
+ otlpTracesHeaders?: Record<string, string>;
95
+ /**
96
+ * Metric export interval in milliseconds (for console exporter)
97
+ */
98
+ metricExportInterval?: number;
99
+ /**
100
+ * Whether to use insecure (non-TLS) connections for gRPC OTLP exporters
101
+ * Set to "true" for local development without TLS
102
+ * Default: false (uses TLS)
103
+ */
104
+ otlpInsecure?: boolean;
105
+ /**
106
+ * Maximum batch size for log records (default: 512)
107
+ */
108
+ logBatchSize?: number;
109
+ /**
110
+ * Maximum time to wait before exporting logs in milliseconds (default: 5000)
111
+ */
112
+ logBatchTimeout?: number;
113
+ /**
114
+ * Maximum queue size for log records (default: 2048)
115
+ */
116
+ logMaxQueueSize?: number;
117
+ }
@@ -0,0 +1,12 @@
1
+ export interface HookSessionContext {
2
+ rootSessionId?: string;
3
+ }
4
+ export interface HookSessionContextLookup {
5
+ hookName?: string;
6
+ conversationId?: string;
7
+ agentId?: string;
8
+ parentAgentId?: string | null;
9
+ }
10
+ export type HookSessionContextProvider = HookSessionContext | ((input?: HookSessionContextLookup) => HookSessionContext | undefined);
11
+ export declare function resolveHookSessionContext(provider?: HookSessionContextProvider, input?: HookSessionContextLookup): HookSessionContext | undefined;
12
+ export declare function resolveRootSessionId(context: HookSessionContext | undefined): string | undefined;
@@ -0,0 +1 @@
1
+ export declare function createSessionId(prefix?: string, suffix?: string): string;
@@ -0,0 +1,31 @@
1
+ export declare const SESSION_STATUS_VALUES: readonly ["running", "completed", "failed", "cancelled"];
2
+ export type SharedSessionStatus = (typeof SESSION_STATUS_VALUES)[number];
3
+ export interface SessionLineage {
4
+ parentSessionId?: string;
5
+ agentId?: string;
6
+ parentAgentId?: string;
7
+ conversationId?: string;
8
+ isSubagent: boolean;
9
+ }
10
+ export interface SessionRuntimeRecordShape extends SessionLineage {
11
+ source: string;
12
+ pid?: number;
13
+ startedAt: string;
14
+ endedAt?: string | null;
15
+ exitCode?: number | null;
16
+ status: SharedSessionStatus;
17
+ interactive: boolean;
18
+ provider: string;
19
+ model: string;
20
+ cwd: string;
21
+ workspaceRoot: string;
22
+ teamName?: string;
23
+ enableTools: boolean;
24
+ enableSpawn: boolean;
25
+ enableTeams: boolean;
26
+ prompt?: string;
27
+ metadata?: Record<string, unknown>;
28
+ hookPath?: string;
29
+ messagesPath?: string;
30
+ updatedAt: string;
31
+ }
@@ -0,0 +1,26 @@
1
+ import type { ToolPolicy } from "../llms/tools";
2
+ export type AgentMode = "act" | "plan" | "yolo" | "zen";
3
+ export type RuntimeConfigExtensionKind = "rules" | "skills" | "workflows" | "plugins";
4
+ export declare const RUNTIME_CONFIG_EXTENSION_KINDS: readonly ["rules", "skills", "workflows", "plugins"];
5
+ export declare const DEFAULT_RUNTIME_CONFIG_EXTENSIONS: readonly ["rules", "skills", "workflows", "plugins"];
6
+ export declare function isRuntimeConfigExtensionKind(value: unknown): value is RuntimeConfigExtensionKind;
7
+ export declare function parseRuntimeConfigExtensions(value: unknown): RuntimeConfigExtensionKind[] | undefined;
8
+ export declare function hasRuntimeConfigExtension(extensions: ReadonlyArray<RuntimeConfigExtensionKind> | undefined, kind: RuntimeConfigExtensionKind): boolean;
9
+ export interface SessionPromptConfig {
10
+ mode?: AgentMode;
11
+ systemPrompt?: string;
12
+ rules?: string;
13
+ maxIterations?: number;
14
+ }
15
+ export interface SessionWorkspaceConfig {
16
+ cwd: string;
17
+ workspaceRoot?: string;
18
+ }
19
+ export interface SessionExecutionConfig {
20
+ enableTools: boolean;
21
+ teamName?: string;
22
+ missionLogIntervalSteps?: number;
23
+ missionLogIntervalMs?: number;
24
+ maxConsecutiveMistakes?: number;
25
+ toolPolicies?: Record<string, ToolPolicy>;
26
+ }
@@ -0,0 +1,8 @@
1
+ export interface RuntimeEnv {
2
+ name: string;
3
+ version: string;
4
+ platform: string;
5
+ platform_version: string;
6
+ os_type: string;
7
+ os_version: string;
8
+ }
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ export declare const WorkspaceInfoSchema: z.ZodObject<{
3
+ rootPath: z.ZodString;
4
+ hint: z.ZodOptional<z.ZodString>;
5
+ associatedRemoteUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
+ latestGitCommitHash: z.ZodOptional<z.ZodString>;
7
+ latestGitBranchName: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>;
9
+ export declare const WorkspaceManifestSchema: z.ZodObject<{
10
+ currentWorkspacePath: z.ZodOptional<z.ZodString>;
11
+ workspaces: z.ZodRecord<z.ZodString, z.ZodObject<{
12
+ rootPath: z.ZodString;
13
+ hint: z.ZodOptional<z.ZodString>;
14
+ associatedRemoteUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
+ latestGitCommitHash: z.ZodOptional<z.ZodString>;
16
+ latestGitBranchName: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>>;
18
+ }, z.core.$strip>;
19
+ export type WorkspaceManifest = z.infer<typeof WorkspaceManifestSchema>;
20
+ export declare function emptyWorkspaceManifest(): WorkspaceManifest;
21
+ export interface WorkspaceInfo {
22
+ rootPath: string;
23
+ hint?: string;
24
+ associatedRemoteUrls?: string[];
25
+ latestGitCommitHash?: string;
26
+ latestGitBranchName?: string;
27
+ }
28
+ export declare function upsertWorkspaceInfo(manifest: WorkspaceManifest, info: WorkspaceInfo): WorkspaceManifest;
@@ -0,0 +1 @@
1
+ export { AGENT_CONFIG_DIRECTORY_NAME, CLINE_MCP_SETTINGS_FILE_NAME, type CronSpecsScope, discoverPluginModulePaths, ensureFileExists, ensureHookLogDir, ensureParentDir, HOOKS_CONFIG_DIRECTORY_NAME, isPluginModulePath, type ResolveCronSpecsDirOptions, RULES_CONFIG_DIRECTORY_NAME, resolveAgentConfigSearchPaths, resolveAgentsConfigDirPath, resolveClineDataDir, resolveClineDir, resolveConfiguredPluginModulePaths, resolveCronDbPath, resolveCronEventsDir, resolveCronReportsDir, resolveCronSpecsDir, resolveDbDataDir, resolveDocumentsClineDirectoryPath, resolveDocumentsExtensionPath, resolveGlobalCronSpecsDir, resolveGlobalSettingsPath, resolveHooksConfigSearchPaths, resolveMcpSettingsPath, resolvePluginConfigSearchPaths, resolvePluginModuleEntries, resolveProviderSettingsPath, resolveRulesConfigSearchPaths, resolveSessionDataDir, resolveSkillsConfigSearchPaths, resolveTeamDataDir, resolveWorkflowsConfigSearchPaths, resolveWorkspaceCronSpecsDir, SKILLS_CONFIG_DIRECTORY_NAME, setClineDir, setClineDirIfUnset, setHomeDir, setHomeDirIfUnset, WORKFLOWS_CONFIG_DIRECTORY_NAME, } from "./paths";
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var e=(C)=>C;function a(C,S){this[C]=e.bind(null,S)}var $C=(C,S)=>{for(var M in S)i(C,M,{get:S[M],enumerable:!0,configurable:!0,set:a.bind(S,M)})};import{appendFileSync as t,existsSync as F,mkdirSync as Y,readdirSync as CC,readFileSync as SC,statSync as I}from"node:fs";import{homedir as OC}from"node:os";import{dirname as Z,join as O,resolve as R}from"node:path";var $=".clinerules",L=".cline",H=".agents",U="agents",z="hooks",B="skills",Q="rules",J="workflows",f="plugins",x="cline_mcp_settings.json";function MC(){let C=process?.env?.HOME?.trim();if(C&&C!=="~")return C;let S=process?.env?.USERPROFILE?.trim();if(S)return S;let M=process?.env?.HOMEDRIVE?.trim(),D=process?.env?.HOMEPATH?.trim();if(M&&D)return`${M}${D}`;let N=OC().trim();if(N&&N!=="~")return N;return"~"}var j=MC(),u=!1;function NC(C){let S=C.trim();if(!S)return;j=S,u=!0}function GC(C){if(u)return;let S=C.trim();if(!S)return;j=S}var E,y=!1;function DC(C){let S=C.trim();if(!S)return;E=S,y=!0}function FC(C){if(y)return;let S=C.trim();if(!S)return;E=S}function _(){if(E)return E;let C=process.env.CLINE_DIR?.trim();if(C)return C;return O(j,".cline")}function m(){return O(j,"Documents","Cline")}function q(C){return O(m(),C)}function g(){let C=process.env.CLINE_DATA_DIR?.trim();if(C)return C;return O(_(),"data")}function WC(){let C=process.env.CLINE_SESSION_DATA_DIR?.trim();if(C)return C;return O(g(),"sessions")}function _C(){let C=process.env.CLINE_TEAM_DATA_DIR?.trim();if(C)return C;return O(g(),"teams")}function w(){let C=process.env.CLINE_DB_DATA_DIR?.trim();if(C)return C;return O(g(),"db")}function gC(){let C=process.env.CLINE_CRON_DB_PATH?.trim();if(C)return C;return O(w(),"cron.db")}function s(){return O(_(),"cron")}function V(C){return O(C,".cline","cron")}function X(C){if(typeof C==="string")return V(C);if(C?.cronSpecsDir?.trim())return C.cronSpecsDir.trim();if(C?.scope==="workspace"){let S=C.workspaceRoot?.trim();if(!S)throw Error("workspaceRoot is required for workspace cron scope");return V(S)}return s()}function vC(C){return O(X(C),"reports")}function AC(C){return O(X(C),"events")}function KC(){let C=process.env.CLINE_PROVIDER_SETTINGS_PATH?.trim();if(C)return C;return O(g(),"settings","providers.json")}function IC(){let C=process.env.CLINE_GLOBAL_SETTINGS_PATH?.trim();if(C)return C;return O(g(),"settings","global-settings.json")}function RC(){let C=process.env.CLINE_MCP_SETTINGS_PATH?.trim();if(C)return C;return O(g(),"settings",x)}function v(C){let S=new Set,M=[];for(let D of C){if(!D||S.has(D))continue;S.add(D),M.push(D)}return M}function TC(C){if(!C)return[];return[$,L,H].map((S)=>O(C,S,B))}function k(){return O(_(),U)}function jC(C){return v([C?O(C,L,U):"",k()])}function qC(C){let S=[q("Hooks"),O(_(),z)];if(C)S.push(O(C,$,z),O(C,L,z));return v(S)}function zC(C){return v([...TC(C),O(_(),B),O(j,H,B)])}function BC(C){let S=C?[O(C,$),O(C,L,Q)]:[],M=C?[O(C,"AGENTS.md")]:[];return v([...M,...S,O(_(),Q),q("Rules")])}function EC(C){return v([C?O(C,".clinerules",J):"",q("Workflows")])}function LC(C){return v([C?O(C,".cline",f):"",O(_(),f),q("Plugins")])}var o=new Set([".js",".ts"]),d="package.json",QC=["index.ts","index.js"];function T(C){let S=C.lastIndexOf(".");if(S===-1)return!1;return o.has(C.slice(S))}function n(C){try{let S=JSON.parse(SC(C,"utf8"));if(!S.cline||typeof S.cline!=="object")return null;return S.cline}catch{return null}}function c(C){let S=C?.plugins;if(!Array.isArray(S))return[];return S.flatMap((M)=>M.paths??[])}function r(C){let S=R(C);if(!F(S)||!I(S).isDirectory())return null;let M=O(S,d);if(F(M)){let D=n(M),N=c(D).map((G)=>R(S,G)).filter((G)=>F(G)&&I(G).isFile()&&T(G));if(N.length>0)return N}for(let D of QC){let N=O(S,D);if(F(N)&&I(N).isFile())return[N]}return null}function p(C){let S=R(C);if(!F(S))return[];let M=[],D=[S];while(D.length>0){let N=D.pop();if(!N)continue;let G;try{G=CC(N,{withFileTypes:!0})}catch{continue}for(let A of G){let W=O(N,A.name);if(A.isDirectory()){let b=O(W,d);if(F(b)){let h=n(b),l=c(h).map((K)=>R(W,K)).filter((K)=>F(K)&&I(K).isFile()&&T(K));if(l.length>0){M.push(...l);continue}}D.push(W);continue}if(A.name.startsWith("."))continue;if(A.isFile()&&T(W))M.push(W)}}return M.sort((N,G)=>N.localeCompare(G))}function VC(C,S){let M=[];for(let D of C){let N=D.trim();if(!N)continue;let G=R(S,N);if(!F(G))throw Error(`Plugin path does not exist: ${G}`);if(I(G).isDirectory()){let W=r(G);if(W){M.push(...W);continue}M.push(...p(G));continue}if(!T(G))throw Error(`Plugin file must use a supported extension (${[...o].join(", ")}): ${G}`);M.push(G)}return M}function P(C){let S=Z(C);if(!F(S))Y(S,{recursive:!0})}function YC(C){Y(Z(C),{recursive:!0}),t(C,"")}function ZC(C){if(C?.trim())return P(C),Z(C);let S=O(g(),"logs");if(!F(S))Y(S,{recursive:!0});return S}export{GC as setHomeDirIfUnset,NC as setHomeDir,FC as setClineDirIfUnset,DC as setClineDir,V as resolveWorkspaceCronSpecsDir,EC as resolveWorkflowsConfigSearchPaths,_C as resolveTeamDataDir,zC as resolveSkillsConfigSearchPaths,WC as resolveSessionDataDir,BC as resolveRulesConfigSearchPaths,KC as resolveProviderSettingsPath,r as resolvePluginModuleEntries,LC as resolvePluginConfigSearchPaths,RC as resolveMcpSettingsPath,qC as resolveHooksConfigSearchPaths,IC as resolveGlobalSettingsPath,s as resolveGlobalCronSpecsDir,q as resolveDocumentsExtensionPath,m as resolveDocumentsClineDirectoryPath,w as resolveDbDataDir,X as resolveCronSpecsDir,vC as resolveCronReportsDir,AC as resolveCronEventsDir,gC as resolveCronDbPath,VC as resolveConfiguredPluginModulePaths,_ as resolveClineDir,g as resolveClineDataDir,k as resolveAgentsConfigDirPath,jC as resolveAgentConfigSearchPaths,T as isPluginModulePath,P as ensureParentDir,ZC as ensureHookLogDir,YC as ensureFileExists,p as discoverPluginModulePaths,J as WORKFLOWS_CONFIG_DIRECTORY_NAME,B as SKILLS_CONFIG_DIRECTORY_NAME,Q as RULES_CONFIG_DIRECTORY_NAME,z as HOOKS_CONFIG_DIRECTORY_NAME,x as CLINE_MCP_SETTINGS_FILE_NAME,U as AGENT_CONFIG_DIRECTORY_NAME};