@cline/core 0.0.45 → 0.0.46

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.
@@ -1,5 +1,6 @@
1
1
  import type { AgentEvent, AgentTool } from "@cline/shared";
2
2
  import { type ToolExecutors } from "../../../extensions/tools";
3
+ import type { SubAgentEndContext, SubAgentStartContext } from "../../../extensions/tools/team";
3
4
  import type { CoreSessionConfig } from "../../../types/config";
4
5
  import type { ActiveSession } from "../../../types/session";
5
6
  export type SubAgentStartTracker = Map<string, {
@@ -12,4 +13,10 @@ export interface SpawnToolDeps {
12
13
  onAgentEvent(rootSessionId: string, config: CoreSessionConfig, event: AgentEvent): void;
13
14
  invokeBackendOptional(method: string, ...args: unknown[]): Promise<void>;
14
15
  }
16
+ export interface SessionSubAgentLifecycleCallbacks {
17
+ onSubAgentEvent: (event: AgentEvent) => void;
18
+ onSubAgentStart: (context: SubAgentStartContext) => void;
19
+ onSubAgentEnd: (context: SubAgentEndContext) => void;
20
+ }
21
+ export declare function createSessionSubAgentLifecycleCallbacks(deps: SpawnToolDeps, config: CoreSessionConfig, rootSessionId: string): SessionSubAgentLifecycleCallbacks;
15
22
  export declare function createSessionSpawnTool(deps: SpawnToolDeps, config: CoreSessionConfig, rootSessionId: string, toolExecutors?: Partial<ToolExecutors>): AgentTool;
@@ -1,6 +1,6 @@
1
- import { type ITelemetryService, type OAuthProviderId } from "@cline/shared";
1
+ import type { ITelemetryService } from "@cline/shared";
2
2
  import { ProviderSettingsManager } from "../../services/storage/provider-settings-manager";
3
- type ManagedOAuthProviderId = OAuthProviderId;
3
+ type ManagedOAuthProviderId = string;
4
4
  export declare class OAuthReauthRequiredError extends Error {
5
5
  readonly providerId: ManagedOAuthProviderId;
6
6
  constructor(providerId: ManagedOAuthProviderId);
@@ -25,6 +25,5 @@ export declare class RuntimeOAuthTokenManager {
25
25
  }): Promise<RuntimeOAuthResolution | null>;
26
26
  private resolveWithSingleFlight;
27
27
  private resolveProviderApiKeyInternal;
28
- private resolveCredentials;
29
28
  }
30
29
  export {};
@@ -1,7 +1,7 @@
1
- import type { AgentConfig, AgentHooks, AgentResult, AgentTool, BasicLogger, ITelemetryService, RuntimeConfigExtensionKind } from "@cline/shared";
1
+ import type { AgentConfig, AgentEvent, AgentHooks, AgentResult, AgentTool, BasicLogger, ITelemetryService, RuntimeConfigExtensionKind, ToolApprovalRequest, ToolApprovalResult } from "@cline/shared";
2
2
  import type { UserInstructionConfigService } from "../../extensions/config";
3
3
  import type { ToolExecutors } from "../../extensions/tools";
4
- import type { AgentTeamsRuntime, DelegatedAgentConfigProvider, TeamEvent } from "../../extensions/tools/team";
4
+ import type { AgentTeamsRuntime, DelegatedAgentConfigProvider, SubAgentEndContext, SubAgentStartContext, TeamEvent } from "../../extensions/tools/team";
5
5
  import type { WorkspaceManager } from "../../services/workspace/workspace-manager";
6
6
  import type { CoreSessionConfig } from "../../types/config";
7
7
  /**
@@ -34,15 +34,20 @@ export interface RuntimeBuilderInput {
34
34
  hooks?: AgentHooks;
35
35
  extensions?: AgentConfig["extensions"];
36
36
  onTeamEvent?: (event: TeamEvent) => void;
37
+ onSubAgentEvent?: (event: AgentEvent) => void;
38
+ onSubAgentStart?: (context: SubAgentStartContext) => void | Promise<void>;
39
+ onSubAgentEnd?: (context: SubAgentEndContext) => void | Promise<void>;
37
40
  createSpawnTool?: () => AgentTool;
38
41
  onTeamRestored?: () => void;
39
42
  userInstructionService?: UserInstructionConfigService;
40
43
  pluginSkillDirectories?: ReadonlyArray<string>;
41
44
  configExtensions?: RuntimeConfigExtensionKind[];
42
45
  toolExecutors?: Partial<ToolExecutors>;
46
+ toolPolicies?: CoreSessionConfig["toolPolicies"];
43
47
  workspaceManager?: WorkspaceManager;
44
48
  logger?: BasicLogger;
45
49
  telemetry?: ITelemetryService;
50
+ requestToolApproval?: (request: ToolApprovalRequest) => Promise<ToolApprovalResult> | ToolApprovalResult;
46
51
  }
47
52
  export interface RuntimeBuilder {
48
53
  build(input: RuntimeBuilderInput): Promise<BuiltRuntime> | BuiltRuntime;
@@ -47,8 +47,8 @@ export declare const ReasoningSettingsSchema: z.ZodObject<{
47
47
  enabled: z.ZodOptional<z.ZodBoolean>;
48
48
  effort: z.ZodOptional<z.ZodEnum<{
49
49
  low: "low";
50
- medium: "medium";
51
50
  high: "high";
51
+ medium: "medium";
52
52
  xhigh: "xhigh";
53
53
  none: "none";
54
54
  }>>;
@@ -157,8 +157,8 @@ export declare const ProviderSettingsSchema: z.ZodObject<{
157
157
  enabled: z.ZodOptional<z.ZodBoolean>;
158
158
  effort: z.ZodOptional<z.ZodEnum<{
159
159
  low: "low";
160
- medium: "medium";
161
160
  high: "high";
161
+ medium: "medium";
162
162
  xhigh: "xhigh";
163
163
  none: "none";
164
164
  }>>;
@@ -217,9 +217,9 @@ export declare const ProviderSettingsSchema: z.ZodObject<{
217
217
  }>>;
218
218
  capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
219
219
  tools: "tools";
220
- reasoning: "reasoning";
221
220
  streaming: "streaming";
222
221
  "prompt-cache": "prompt-cache";
222
+ reasoning: "reasoning";
223
223
  "computer-use": "computer-use";
224
224
  oauth: "oauth";
225
225
  vision: "vision";
@@ -1,5 +1,5 @@
1
- import type { AgentConfig, AgentHooks, AgentTool, ITelemetryService, ToolApprovalRequest, ToolApprovalResult, WorkspaceInfo } from "@cline/shared";
2
- import type { TeamEvent } from "../extensions/tools/team";
1
+ import type { AgentConfig, AgentEvent, AgentHooks, AgentTool, ITelemetryService, ToolApprovalRequest, ToolApprovalResult, WorkspaceInfo } from "@cline/shared";
2
+ import type { SubAgentEndContext, SubAgentStartContext, TeamEvent } from "../extensions/tools/team";
3
3
  import type { RuntimeCapabilities } from "../runtime/capabilities";
4
4
  import type { LocalRuntimeStartOptions, StartSessionInput } from "../runtime/host/runtime-host";
5
5
  import type { RuntimeBuilderInput } from "../runtime/orchestration/session-runtime";
@@ -24,6 +24,11 @@ export interface PrepareLocalRuntimeBootstrapOptions {
24
24
  payload?: unknown;
25
25
  }) => void;
26
26
  onTeamEvent: (event: TeamEvent) => void;
27
+ createSubAgentLifecycleCallbacks?: (config: CoreSessionConfig) => {
28
+ onSubAgentEvent?: (event: AgentEvent) => void;
29
+ onSubAgentStart?: (context: SubAgentStartContext) => void | Promise<void>;
30
+ onSubAgentEnd?: (context: SubAgentEndContext) => void | Promise<void>;
31
+ };
27
32
  createSpawnTool: () => AgentTool;
28
33
  readSessionMetadata: () => Promise<Record<string, unknown> | undefined>;
29
34
  writeSessionMetadata: (metadata: Record<string, unknown>) => Promise<void> | void;
@@ -1,4 +1,5 @@
1
- import { type AddProviderActionRequest, type ITelemetryService, type OAuthProviderId, type ProviderCapability, type ProviderListItem, type ProviderModel, type SaveProviderSettingsActionRequest } from "@cline/shared";
1
+ import type { AddProviderActionRequest, ITelemetryService, ProviderCapability, ProviderListItem, ProviderModel, SaveProviderSettingsActionRequest } from "@cline/shared";
2
+ import { type ProviderOAuthCredentials } from "../../auth/provider-auth-registry";
2
3
  import type { ProviderClient, ProviderConfig, ProviderProtocol, ProviderSettings } from "../../services/llms/provider-settings";
3
4
  import type { ProviderSettingsManager } from "../storage/provider-settings-manager";
4
5
  export { ensureCustomProvidersLoaded } from "./local-provider-registry";
@@ -54,17 +55,10 @@ export declare function refreshProviderModelsFromSource(manager: ProviderSetting
54
55
  refreshed: boolean;
55
56
  modelsCount?: number;
56
57
  }>;
57
- export declare function normalizeOAuthProvider(provider: string): OAuthProviderId;
58
- export declare function loginLocalProvider(providerId: OAuthProviderId, existing: ProviderSettings | undefined, openUrl: (url: string) => void, telemetry?: ITelemetryService): Promise<{
59
- access: string;
60
- refresh: string;
61
- expires: number;
62
- accountId?: string;
63
- }>;
64
- export declare function saveLocalProviderOAuthCredentials(manager: ProviderSettingsManager, providerId: OAuthProviderId, existing: ProviderSettings | undefined, credentials: {
65
- access: string;
66
- refresh: string;
67
- expires: number;
68
- accountId?: string;
58
+ export declare function normalizeOAuthProvider(provider: string): string;
59
+ export declare function loginLocalProvider(providerId: string, existing: ProviderSettings | undefined, openUrl: (url: string) => void, telemetry?: ITelemetryService): Promise<ProviderOAuthCredentials>;
60
+ export declare function saveLocalProviderOAuthCredentials(manager: ProviderSettingsManager, providerId: string, existing: ProviderSettings | undefined, credentials: ProviderOAuthCredentials, options?: {
61
+ setLastUsed?: boolean;
69
62
  }): ProviderSettings;
63
+ export declare function loginAndSaveLocalProviderOAuthCredentials(manager: ProviderSettingsManager, providerId: string, openUrl: (url: string) => void, telemetry?: ITelemetryService): Promise<ProviderSettings>;
70
64
  export declare function resolveLocalClineAuthToken(settings: ProviderSettings | undefined): string | undefined;
@@ -1,4 +1,4 @@
1
- export type ProviderConfigFieldKey = "apiKey" | "baseUrl" | "awsRegion" | "awsProfile" | "sapClientId" | "sapClientSecret" | "sapTokenUrl" | "sapResourceGroup" | "sapDeploymentId";
1
+ export type ProviderConfigFieldKey = "apiKey" | "baseUrl" | "azureApiVersion" | "awsRegion" | "awsProfile" | "gcpProjectId" | "gcpRegion" | "sapClientId" | "sapClientSecret" | "sapTokenUrl" | "sapResourceGroup" | "sapDeploymentId";
2
2
  export interface ProviderConfigFieldRequirement {
3
3
  defaultValue?: string;
4
4
  label?: string;
@@ -5,8 +5,8 @@ export declare const ChatSessionConfigSchema: z.ZodObject<{
5
5
  provider: z.ZodString;
6
6
  model: z.ZodString;
7
7
  mode: z.ZodDefault<z.ZodEnum<{
8
- act: "act";
9
8
  plan: "plan";
9
+ act: "act";
10
10
  }>>;
11
11
  apiKey: z.ZodString;
12
12
  systemPrompt: z.ZodOptional<z.ZodString>;
@@ -98,8 +98,8 @@ export declare const ChatViewStateSchema: z.ZodObject<{
98
98
  provider: z.ZodString;
99
99
  model: z.ZodString;
100
100
  mode: z.ZodDefault<z.ZodEnum<{
101
- act: "act";
102
101
  plan: "plan";
102
+ act: "act";
103
103
  }>>;
104
104
  apiKey: z.ZodString;
105
105
  systemPrompt: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cline/core",
3
3
  "description": "Cline Core SDK for Node Runtime",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/cline/cline",
@@ -44,9 +44,9 @@
44
44
  "test:watch": "vitest --config vitest.config.ts"
45
45
  },
46
46
  "dependencies": {
47
- "@cline/agents": "0.0.45",
48
- "@cline/shared": "0.0.45",
49
- "@cline/llms": "0.0.45",
47
+ "@cline/agents": "0.0.46",
48
+ "@cline/shared": "0.0.46",
49
+ "@cline/llms": "0.0.46",
50
50
  "@modelcontextprotocol/sdk": "^1.29.0",
51
51
  "@opentelemetry/api": "^1.9.0",
52
52
  "@opentelemetry/api-logs": "^0.214.0",