@sctg/cline-shared 3.84.0-beta.20260524130712

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 (83) hide show
  1. package/README.md +47 -0
  2. package/dist/agent.d.ts +388 -0
  3. package/dist/agents/index.d.ts +1 -0
  4. package/dist/agents/types.d.ts +967 -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 +174 -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 +470 -0
  23. package/dist/index.browser.d.ts +61 -0
  24. package/dist/index.browser.js +76 -0
  25. package/dist/index.d.ts +69 -0
  26. package/dist/index.js +163 -0
  27. package/dist/llms/ai-sdk-format.d.ts +55 -0
  28. package/dist/llms/gateway.d.ts +145 -0
  29. package/dist/llms/messages.d.ts +149 -0
  30. package/dist/llms/model-info.d.ts +120 -0
  31. package/dist/llms/reasoning-effort.d.ts +21 -0
  32. package/dist/llms/requests.d.ts +2 -0
  33. package/dist/llms/tokens.d.ts +7 -0
  34. package/dist/llms/tools.d.ts +86 -0
  35. package/dist/logging/logger.d.ts +37 -0
  36. package/dist/parse/error.d.ts +2 -0
  37. package/dist/parse/headers/utils.d.ts +1 -0
  38. package/dist/parse/json.d.ts +3 -0
  39. package/dist/parse/shell.d.ts +2 -0
  40. package/dist/parse/string.d.ts +4 -0
  41. package/dist/parse/time.d.ts +9 -0
  42. package/dist/parse/zod.d.ts +12 -0
  43. package/dist/prompt/cline.d.ts +24 -0
  44. package/dist/prompt/format.d.ts +11 -0
  45. package/dist/prompt/system.d.ts +2 -0
  46. package/dist/remote-config/artifact-store.d.ts +13 -0
  47. package/dist/remote-config/blob-storage.d.ts +47 -0
  48. package/dist/remote-config/bundle.d.ts +136 -0
  49. package/dist/remote-config/constants.d.ts +5 -0
  50. package/dist/remote-config/index.d.ts +9 -0
  51. package/dist/remote-config/index.js +76 -0
  52. package/dist/remote-config/materializer.d.ts +4 -0
  53. package/dist/remote-config/paths.d.ts +10 -0
  54. package/dist/remote-config/runtime.d.ts +20 -0
  55. package/dist/remote-config/schema.d.ts +408 -0
  56. package/dist/remote-config/telemetry.d.ts +9 -0
  57. package/dist/rpc/index.d.ts +5 -0
  58. package/dist/rpc/runtime.d.ts +322 -0
  59. package/dist/rpc/team-progress.d.ts +53 -0
  60. package/dist/runtime/build-env.d.ts +13 -0
  61. package/dist/runtime/cline-environment.d.ts +17 -0
  62. package/dist/runtime/hub-daemon-env.d.ts +2 -0
  63. package/dist/services/telemetry-config.d.ts +6 -0
  64. package/dist/services/telemetry.d.ts +133 -0
  65. package/dist/session/hook-context.d.ts +12 -0
  66. package/dist/session/index.d.ts +1 -0
  67. package/dist/session/records.d.ts +31 -0
  68. package/dist/session/runtime-config.d.ts +26 -0
  69. package/dist/session/runtime-env.d.ts +8 -0
  70. package/dist/session/workspace.d.ts +28 -0
  71. package/dist/storage/index.d.ts +2 -0
  72. package/dist/storage/index.js +1 -0
  73. package/dist/storage/path-resolution.d.ts +11 -0
  74. package/dist/storage/paths.d.ts +86 -0
  75. package/dist/team/index.d.ts +2 -0
  76. package/dist/team/schema.d.ts +411 -0
  77. package/dist/team/types.d.ts +196 -0
  78. package/dist/tools/create.d.ts +22 -0
  79. package/dist/types/auth.d.ts +20 -0
  80. package/dist/types/index.d.ts +2 -0
  81. package/dist/types/vcr.d.ts +14 -0
  82. package/dist/vcr.d.ts +41 -0
  83. package/package.json +63 -0
@@ -0,0 +1,322 @@
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
+ capabilities?: ProviderCapability[];
143
+ authDescription: string;
144
+ baseUrlDescription: string;
145
+ modelList?: ProviderModel[];
146
+ family?: string;
147
+ }
148
+ export interface ProviderCatalogResponse {
149
+ providers: ProviderListItem[];
150
+ settingsPath: string;
151
+ }
152
+ export interface ProviderModelsResponse {
153
+ providerId: string;
154
+ models: ProviderModel[];
155
+ }
156
+ import type { OAuthProviderId } from "../types/auth";
157
+ export declare const ProviderCapabilitySchema: z.ZodEnum<{
158
+ tools: "tools";
159
+ streaming: "streaming";
160
+ "prompt-cache": "prompt-cache";
161
+ reasoning: "reasoning";
162
+ "computer-use": "computer-use";
163
+ temperature: "temperature";
164
+ files: "files";
165
+ "provider-tools": "provider-tools";
166
+ oauth: "oauth";
167
+ vision: "vision";
168
+ "local-auth": "local-auth";
169
+ popular: "popular";
170
+ }>;
171
+ export type ProviderCapability = z.infer<typeof ProviderCapabilitySchema>;
172
+ export declare const ProviderProtocolSchema: z.ZodEnum<{
173
+ "openai-responses": "openai-responses";
174
+ anthropic: "anthropic";
175
+ gemini: "gemini";
176
+ "openai-chat": "openai-chat";
177
+ "openai-r1": "openai-r1";
178
+ "ai-sdk": "ai-sdk";
179
+ }>;
180
+ export type ProviderProtocol = z.infer<typeof ProviderProtocolSchema>;
181
+ export declare const ProviderClientSchema: z.ZodEnum<{
182
+ custom: "custom";
183
+ anthropic: "anthropic";
184
+ gemini: "gemini";
185
+ "openai-r1": "openai-r1";
186
+ "ai-sdk": "ai-sdk";
187
+ "ai-sdk-community": "ai-sdk-community";
188
+ openai: "openai";
189
+ "openai-compatible": "openai-compatible";
190
+ bedrock: "bedrock";
191
+ fetch: "fetch";
192
+ vertex: "vertex";
193
+ }>;
194
+ export type ProviderClient = z.infer<typeof ProviderClientSchema>;
195
+ export interface ListProvidersActionRequest {
196
+ action: "listProviders";
197
+ }
198
+ export interface GetProviderModelsActionRequest {
199
+ action: "getProviderModels";
200
+ providerId: string;
201
+ }
202
+ export interface SaveProviderSettingsActionRequest {
203
+ action: "saveProviderSettings";
204
+ providerId: string;
205
+ enabled?: boolean;
206
+ apiKey?: string;
207
+ auth?: {
208
+ apiKey?: string;
209
+ accessToken?: string;
210
+ refreshToken?: string;
211
+ expiresAt?: number;
212
+ accountId?: string;
213
+ };
214
+ model?: string;
215
+ protocol?: ProviderProtocol;
216
+ client?: ProviderClient;
217
+ routingProviderId?: string;
218
+ maxTokens?: number;
219
+ contextWindow?: number;
220
+ baseUrl?: string;
221
+ headers?: Record<string, string>;
222
+ timeout?: number;
223
+ reasoning?: {
224
+ enabled?: boolean;
225
+ effort?: "none" | "low" | "medium" | "high" | "xhigh";
226
+ budgetTokens?: number;
227
+ };
228
+ aws?: {
229
+ accessKey?: string;
230
+ secretKey?: string;
231
+ sessionToken?: string;
232
+ region?: string;
233
+ profile?: string;
234
+ authentication?: "iam" | "api-key" | "apikey" | "profile";
235
+ usePromptCache?: boolean;
236
+ useCrossRegionInference?: boolean;
237
+ useGlobalInference?: boolean;
238
+ endpoint?: string;
239
+ customModelBaseId?: string;
240
+ };
241
+ gcp?: {
242
+ projectId?: string;
243
+ region?: string;
244
+ };
245
+ azure?: {
246
+ apiVersion?: string;
247
+ useIdentity?: boolean;
248
+ };
249
+ sap?: {
250
+ clientId?: string;
251
+ clientSecret?: string;
252
+ tokenUrl?: string;
253
+ resourceGroup?: string;
254
+ deploymentId?: string;
255
+ useOrchestrationMode?: boolean;
256
+ api?: "orchestration" | "foundation-models";
257
+ defaultSettings?: Record<string, unknown>;
258
+ };
259
+ oca?: {
260
+ mode?: "internal" | "external";
261
+ usePromptCache?: boolean;
262
+ };
263
+ region?: string;
264
+ apiLine?: "china" | "international";
265
+ capabilities?: ("reasoning" | "prompt-cache" | "streaming" | "tools" | "vision" | "computer-use" | "oauth")[];
266
+ }
267
+ export interface AddProviderActionRequest {
268
+ action: "addProvider";
269
+ providerId: string;
270
+ name: string;
271
+ baseUrl: string;
272
+ apiKey?: string;
273
+ headers?: Record<string, string>;
274
+ timeoutMs?: number;
275
+ models?: string[];
276
+ defaultModelId?: string;
277
+ modelsSourceUrl?: string;
278
+ protocol?: ProviderProtocol;
279
+ client?: ProviderClient;
280
+ capabilities?: ProviderCapability[];
281
+ }
282
+ export type ProviderSettingsActionRequest = ListProvidersActionRequest | GetProviderModelsActionRequest | SaveProviderSettingsActionRequest | AddProviderActionRequest;
283
+ export type ClineAccountActionRequest = {
284
+ action: "clineAccount";
285
+ operation: "fetchMe";
286
+ } | {
287
+ action: "clineAccount";
288
+ operation: "fetchBalance";
289
+ userId?: string;
290
+ } | {
291
+ action: "clineAccount";
292
+ operation: "fetchUsageTransactions";
293
+ userId?: string;
294
+ } | {
295
+ action: "clineAccount";
296
+ operation: "fetchPaymentTransactions";
297
+ userId?: string;
298
+ } | {
299
+ action: "clineAccount";
300
+ operation: "fetchUserOrganizations";
301
+ } | {
302
+ action: "clineAccount";
303
+ operation: "fetchOrganizationBalance";
304
+ organizationId: string;
305
+ } | {
306
+ action: "clineAccount";
307
+ operation: "fetchOrganizationUsageTransactions";
308
+ organizationId: string;
309
+ memberId?: string;
310
+ } | {
311
+ action: "clineAccount";
312
+ operation: "switchAccount";
313
+ organizationId?: string | null;
314
+ } | {
315
+ action: "clineAccount";
316
+ operation: "fetchFeaturebaseToken";
317
+ };
318
+ export type ProviderActionRequest = ProviderSettingsActionRequest | ClineAccountActionRequest;
319
+ export interface ProviderOAuthLoginResponse {
320
+ provider: OAuthProviderId;
321
+ accessToken: string;
322
+ }
@@ -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,17 @@
1
+ export declare const CLINE_ENVIRONMENT_ENV = "CLINE_ENVIRONMENT";
2
+ export declare const CLINE_ENVIRONMENT_OVERRIDE_ENV = "CLINE_ENVIRONMENT_OVERRIDE";
3
+ export type ClineEnvironment = "production" | "staging" | "local";
4
+ export interface ClineEnvironmentConfig {
5
+ readonly environment: ClineEnvironment;
6
+ readonly appBaseUrl: string;
7
+ readonly apiBaseUrl: string;
8
+ readonly mcpBaseUrl: string;
9
+ readonly workOsClientId: string;
10
+ }
11
+ export declare const CLINE_ENVIRONMENTS: Readonly<Record<ClineEnvironment, ClineEnvironmentConfig>>;
12
+ export declare const DEFAULT_CLINE_ENVIRONMENT: ClineEnvironment;
13
+ export interface ResolveClineEnvironmentOptions {
14
+ env?: Partial<NodeJS.ProcessEnv>;
15
+ }
16
+ export declare function resolveClineEnvironment(options?: ResolveClineEnvironmentOptions): ClineEnvironment;
17
+ export declare function getClineEnvironmentConfig(environmentOrOptions?: ClineEnvironment | ResolveClineEnvironmentOptions): ClineEnvironmentConfig;
@@ -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,133 @@
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 type SdkTelemetryErrorComponent = "shared" | "llms" | "agents" | "core" | "cli" | "vscode" | "desktop" | (string & {});
9
+ export type SdkTelemetryErrorSeverity = "debug" | "info" | "warn" | "error" | "fatal";
10
+ export interface CaptureSdkErrorInput {
11
+ component: SdkTelemetryErrorComponent;
12
+ operation: string;
13
+ error: unknown;
14
+ severity?: SdkTelemetryErrorSeverity;
15
+ handled?: boolean;
16
+ context?: TelemetryProperties;
17
+ event?: string;
18
+ messageLimit?: number;
19
+ }
20
+ export interface TelemetryMetadata {
21
+ extension_version: string;
22
+ cline_type: string;
23
+ platform: string;
24
+ platform_version: string;
25
+ os_type: string;
26
+ os_version: string;
27
+ is_dev?: string;
28
+ is_remote_workspace?: boolean;
29
+ }
30
+ export interface ITelemetryService {
31
+ setDistinctId(distinctId?: string): void;
32
+ setMetadata(metadata: Partial<TelemetryMetadata>): void;
33
+ updateMetadata(metadata: Partial<TelemetryMetadata>): void;
34
+ setCommonProperties(properties: TelemetryProperties): void;
35
+ updateCommonProperties(properties: TelemetryProperties): void;
36
+ isEnabled(): boolean;
37
+ capture(input: {
38
+ event: string;
39
+ properties?: TelemetryProperties;
40
+ }): void;
41
+ captureRequired(event: string, properties?: TelemetryProperties): void;
42
+ recordCounter(name: string, value: number, attributes?: TelemetryProperties, description?: string, required?: boolean): void;
43
+ recordHistogram(name: string, value: number, attributes?: TelemetryProperties, description?: string, required?: boolean): void;
44
+ recordGauge(name: string, value: number | null, attributes?: TelemetryProperties, description?: string, required?: boolean): void;
45
+ flush(): Promise<void>;
46
+ dispose(): Promise<void>;
47
+ }
48
+ export declare const SDK_ERROR_TELEMETRY_EVENT = "sdk.error";
49
+ export declare function captureSdkError(telemetry: ITelemetryService | undefined, input: CaptureSdkErrorInput): void;
50
+ export declare function buildSdkErrorProperties(input: CaptureSdkErrorInput): TelemetryProperties;
51
+ export declare function normalizeSdkError(error: unknown, messageLimit?: number): TelemetryProperties;
52
+ export interface OpenTelemetryClientConfig {
53
+ /**
54
+ * Whether telemetry is enabled via OTEL_TELEMETRY_ENABLED
55
+ */
56
+ enabled: boolean;
57
+ /**
58
+ * Metrics exporter type(s) - can be comma-separated for multiple exporters
59
+ * Examples: "console", "otlp", "prometheus", "console,otlp"
60
+ */
61
+ metricsExporter?: string;
62
+ /**
63
+ * Logs/events exporter type(s) - can be comma-separated for multiple exporters
64
+ * Examples: "console", "otlp"
65
+ */
66
+ logsExporter?: string;
67
+ /**
68
+ * Distributed tracing exporter type(s) - comma-separated for multiple exporters.
69
+ * Examples: "console", "otlp". When unset, no `TracerProvider` is registered.
70
+ */
71
+ tracesExporter?: string;
72
+ /**
73
+ * Protocol for OTLP exporters. SDK support is currently limited to "http/json".
74
+ */
75
+ otlpProtocol?: string;
76
+ /**
77
+ * General OTLP endpoint (used if specific endpoints not set)
78
+ */
79
+ otlpEndpoint?: string;
80
+ /**
81
+ * General OTLP headers
82
+ */
83
+ otlpHeaders?: Record<string, string>;
84
+ /**
85
+ * Metrics-specific OTLP protocol
86
+ */
87
+ otlpMetricsProtocol?: string;
88
+ /**
89
+ * Metrics-specific OTLP endpoint
90
+ */
91
+ otlpMetricsEndpoint?: string;
92
+ otlpMetricsHeaders?: Record<string, string>;
93
+ /**
94
+ * Logs-specific OTLP protocol
95
+ */
96
+ otlpLogsProtocol?: string;
97
+ /**
98
+ * Logs-specific OTLP endpoint
99
+ */
100
+ otlpLogsEndpoint?: string;
101
+ otlpLogsHeaders?: Record<string, string>;
102
+ /**
103
+ * Traces-specific OTLP protocol (SDK support is currently limited to "http/json")
104
+ */
105
+ otlpTracesProtocol?: string;
106
+ /**
107
+ * Traces-specific OTLP endpoint (defaults to {@link otlpEndpoint} when exporting OTLP traces)
108
+ */
109
+ otlpTracesEndpoint?: string;
110
+ otlpTracesHeaders?: Record<string, string>;
111
+ /**
112
+ * Metric export interval in milliseconds (for console exporter)
113
+ */
114
+ metricExportInterval?: number;
115
+ /**
116
+ * Whether to use insecure (non-TLS) connections for gRPC OTLP exporters
117
+ * Set to "true" for local development without TLS
118
+ * Default: false (uses TLS)
119
+ */
120
+ otlpInsecure?: boolean;
121
+ /**
122
+ * Maximum batch size for log records (default: 512)
123
+ */
124
+ logBatchSize?: number;
125
+ /**
126
+ * Maximum time to wait before exporting logs in milliseconds (default: 5000)
127
+ */
128
+ logBatchTimeout?: number;
129
+ /**
130
+ * Maximum queue size for log records (default: 2048)
131
+ */
132
+ logMaxQueueSize?: number;
133
+ }
@@ -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 ["idle", "running", "pending", "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,2 @@
1
+ export { resolveExistingFilePath } from "./path-resolution";
2
+ 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";