@cline/core 0.0.81 → 0.0.82-nightly.1788488915
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.
- package/dist/cron/runner/cron-runner.d.ts +14 -1
- package/dist/cron/service/schedule-service.d.ts +9 -1
- package/dist/cron/specs/cron-reconciler.d.ts +1 -1
- package/dist/cron/store/sqlite-cron-store.d.ts +17 -0
- package/dist/extensions/agent-plugin/agent-skill.d.ts +21 -0
- package/dist/extensions/agent-plugin/index.d.ts +4 -0
- package/dist/extensions/agent-plugin/loader.d.ts +10 -0
- package/dist/extensions/agent-plugin/types.d.ts +67 -0
- package/dist/extensions/config/index.d.ts +1 -1
- package/dist/extensions/config/user-instruction-config-loader.d.ts +9 -0
- package/dist/extensions/config/user-instruction-plugin.d.ts +1 -0
- package/dist/extensions/config/user-instruction-service.d.ts +7 -1
- package/dist/extensions/index.d.ts +2 -0
- package/dist/extensions/mcp/client.d.ts +3 -0
- package/dist/extensions/mcp/oauth.d.ts +6 -0
- package/dist/extensions/tools/executors/line-endings.d.ts +14 -2
- package/dist/extensions/tools/team/multi-agent.d.ts +7 -0
- package/dist/hub/client/index.d.ts +20 -3
- package/dist/hub/client/managed-hub-build-watcher.d.ts +8 -0
- package/dist/hub/client/session-client.d.ts +6 -1
- package/dist/hub/client/ui-client.d.ts +6 -1
- package/dist/hub/daemon/entry.js +308 -234
- package/dist/hub/daemon/index.d.ts +72 -0
- package/dist/hub/index.js +297 -223
- package/dist/hub/server/command-transport.d.ts +6 -0
- package/dist/hub/server/handlers/context.d.ts +2 -0
- package/dist/hub/server/handlers/session-handlers.d.ts +1 -0
- package/dist/hub/server/hub-server-options.d.ts +3 -0
- package/dist/hub/server/hub-server-transport.d.ts +1 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +300 -226
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +1 -0
- package/dist/runtime/orchestration/session-runtime.d.ts +3 -0
- package/dist/services/global-settings.d.ts +8 -2
- package/dist/services/providers/local-provider-service.d.ts +1 -1
- package/dist/services/providers/provider-readiness.d.ts +10 -0
- package/dist/services/session-import/claude-code.d.ts +16 -0
- package/dist/services/session-import/codex.d.ts +34 -0
- package/dist/services/session-import/index.d.ts +6 -0
- package/dist/services/session-import/opencode.d.ts +25 -0
- package/dist/services/session-import/sanitize.d.ts +16 -0
- package/dist/services/session-import/service.d.ts +31 -0
- package/dist/services/session-import/types.d.ts +87 -0
- package/dist/services/telemetry/index.js +1 -1
- package/dist/services/workspace/agent-schedules-workspace.d.ts +8 -0
- package/dist/services/workspace/index.d.ts +1 -0
- package/dist/session/models/session-manifest.d.ts +1 -1
- package/dist/session/models/session-row.d.ts +10 -0
- package/dist/session/search/index.d.ts +1 -0
- package/dist/session/search/session-history-search.d.ts +51 -0
- package/dist/session/services/persistence-service.d.ts +10 -0
- package/dist/settings/types.d.ts +8 -0
- package/dist/tasks/agenda-task-tool.d.ts +1 -1
- package/dist/tasks/task-tool.d.ts +3 -3
- package/dist/types/chat-schema.d.ts +2 -2
- package/dist/types/config.d.ts +5 -0
- package/dist/types.d.ts +4 -4
- package/package.json +4 -4
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import type { BasicLogger } from "@cline/shared";
|
|
2
2
|
import type { ResolveCronSpecsDirOptions } from "@cline/shared/storage";
|
|
3
3
|
import type { HubScheduleRuntimeHandlers } from "../service/schedule-service";
|
|
4
|
-
import type { CronRunRecord, SqliteCronStore } from "../store/sqlite-cron-store";
|
|
4
|
+
import type { CronRunRecord, CronSpecRecord, SqliteCronStore } from "../store/sqlite-cron-store";
|
|
5
5
|
import type { CronMaterializer } from "./cron-materializer";
|
|
6
|
+
/**
|
|
7
|
+
* Session metadata keys that identify the automation run a session belongs
|
|
8
|
+
* to. Clients (e.g. the desktop sidebar) read these to group a schedule's
|
|
9
|
+
* runs together and label each one, so they are part of the session
|
|
10
|
+
* metadata contract; keep them in sync with the readers.
|
|
11
|
+
*/
|
|
12
|
+
export declare const RUN_SESSION_METADATA_KEYS: {
|
|
13
|
+
readonly scheduleId: "scheduleId";
|
|
14
|
+
readonly scheduleName: "scheduleName";
|
|
15
|
+
readonly scheduleExecutionId: "scheduleExecutionId";
|
|
16
|
+
readonly scheduleRunNumber: "scheduleRunNumber";
|
|
17
|
+
};
|
|
18
|
+
export declare function buildRunSessionMetadata(spec: Pick<CronSpecRecord, "externalId" | "title">, run: Pick<CronRunRecord, "runId">, runNumber: number | undefined): Record<string, unknown>;
|
|
6
19
|
export interface CronRunnerOptions {
|
|
7
20
|
store: SqliteCronStore;
|
|
8
21
|
materializer: CronMaterializer;
|
|
@@ -22,8 +22,16 @@ type HubScheduleTurnResult = {
|
|
|
22
22
|
durationMs?: number;
|
|
23
23
|
}>;
|
|
24
24
|
};
|
|
25
|
+
export interface HubScheduleStartSessionOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Provenance the runner knows about the automation run that is starting
|
|
28
|
+
* this session (schedule id/name, run id, run number). Handlers merge it
|
|
29
|
+
* into the session metadata so clients can group runs by schedule.
|
|
30
|
+
*/
|
|
31
|
+
sessionMetadata?: Record<string, unknown>;
|
|
32
|
+
}
|
|
25
33
|
export interface HubScheduleRuntimeHandlers {
|
|
26
|
-
startSession(request: ChatStartSessionRequest): Promise<{
|
|
34
|
+
startSession(request: ChatStartSessionRequest, options?: HubScheduleStartSessionOptions): Promise<{
|
|
27
35
|
sessionId: string;
|
|
28
36
|
startResult?: ChatStartSessionArtifacts;
|
|
29
37
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CronSpecParseResult } from "@cline/shared";
|
|
2
2
|
import { type ResolveCronSpecsDirOptions } from "@cline/shared/storage";
|
|
3
|
-
import type
|
|
3
|
+
import { type CronSpecRecord, type SqliteCronStore, type UpsertSpecResult } from "../store/sqlite-cron-store";
|
|
4
4
|
/**
|
|
5
5
|
* Scan the configured cron specs directory on disk, parse every file, and
|
|
6
6
|
* upsert spec state into the cron DB. This is the startup source of truth:
|
|
@@ -106,6 +106,15 @@ export interface UpsertSpecResult {
|
|
|
106
106
|
export interface SqliteCronStoreOptions {
|
|
107
107
|
dbPath?: string;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* DB-native hub schedules (created via the schedule tools/UI) live only in
|
|
111
|
+
* cron.db under a virtual sourcePath that never exists on disk. File-backed
|
|
112
|
+
* specs can spoof `source: hub-schedule` in frontmatter — even inside a
|
|
113
|
+
* physical `hub/schedules/` directory — but reconciliation always records
|
|
114
|
+
* their source file's mtime, which DB-native rows never have. All three
|
|
115
|
+
* markers are required to identify a DB-native hub schedule.
|
|
116
|
+
*/
|
|
117
|
+
export declare function isHubManagedSpec(spec: Pick<CronSpecRecord, "source" | "sourcePath" | "sourceMtimeMs">): boolean;
|
|
109
118
|
export interface ListSpecsOptions {
|
|
110
119
|
triggerKind?: CronTriggerKind;
|
|
111
120
|
enabled?: boolean;
|
|
@@ -189,6 +198,14 @@ export declare class SqliteCronStore {
|
|
|
189
198
|
nowMs: number;
|
|
190
199
|
}): MaterializeScheduleRunResult;
|
|
191
200
|
getRun(runId: string): CronRunRecord | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* 1-based position of a run among every run ever created for its spec,
|
|
203
|
+
* in creation order. Counts runs of every status (including cancelled and
|
|
204
|
+
* failed ones) so the number is stable: a later cancellation never shifts
|
|
205
|
+
* the numbers already stamped onto earlier sessions. Returns undefined
|
|
206
|
+
* for an unknown run.
|
|
207
|
+
*/
|
|
208
|
+
getRunOrdinal(runId: string): number | undefined;
|
|
192
209
|
insertEventLog(event: AutomationEventEnvelope, options?: {
|
|
193
210
|
receivedAtIso?: string;
|
|
194
211
|
}): InsertEventLogResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface AgentSkillMetadata {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
license?: string;
|
|
5
|
+
compatibility?: string;
|
|
6
|
+
metadata?: Record<string, string>;
|
|
7
|
+
"allowed-tools"?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ParsedAgentSkill {
|
|
10
|
+
metadata: AgentSkillMetadata;
|
|
11
|
+
instructions: string;
|
|
12
|
+
frontmatter: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse and validate one Agent Skills specification `SKILL.md` document.
|
|
16
|
+
*
|
|
17
|
+
* Cline's own skill files intentionally remain backwards-compatible and more
|
|
18
|
+
* permissive. Agent Plugin skills go through this strict path because the
|
|
19
|
+
* Agent Plugins contract requires an invalid skill to be skipped in isolation.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseAgentSkillMarkdown(content: string, directoryName: string): ParsedAgentSkill;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { AgentSkillMetadata, ParsedAgentSkill } from "./agent-skill";
|
|
2
|
+
export { parseAgentSkillMarkdown } from "./agent-skill";
|
|
3
|
+
export { AGENT_PLUGINS_V1_MANIFEST_SCHEMA, AGENT_PLUGINS_V1_MCP_SCHEMA, getAgentPluginPackageDisplayName, loadAgentPluginPackages, } from "./loader";
|
|
4
|
+
export type { AgentPluginPackageDiagnostic, AgentPluginPackageDiagnosticScope, AgentPluginPackageLoadReport, AgentPluginPackageManifest, AgentPluginPackageMcpServer, AgentPluginPackageSkill, LoadAgentPluginPackagesOptions, LoadedAgentPluginPackage, } from "./types";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AgentPluginPackageLoadReport, LoadAgentPluginPackagesOptions } from "./types";
|
|
2
|
+
export declare const AGENT_PLUGINS_V1_MANIFEST_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
3
|
+
export declare const AGENT_PLUGINS_V1_MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
4
|
+
/**
|
|
5
|
+
* Discover and load Agent Plugins v1 from runtime-host-local filesystem paths.
|
|
6
|
+
* No schema is fetched over the network: canonical identifiers select the
|
|
7
|
+
* validation code bundled with this SDK build.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadAgentPluginPackages(options?: LoadAgentPluginPackagesOptions): Promise<AgentPluginPackageLoadReport>;
|
|
10
|
+
export declare function getAgentPluginPackageDisplayName(path: string): string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { McpServerRegistration } from "../mcp";
|
|
2
|
+
import type { AgentSkillMetadata } from "./agent-skill";
|
|
3
|
+
export interface AgentPluginPackageManifest {
|
|
4
|
+
$schema: string;
|
|
5
|
+
name: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
author?: {
|
|
9
|
+
name?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
url?: string;
|
|
12
|
+
};
|
|
13
|
+
homepage?: string;
|
|
14
|
+
repository?: string;
|
|
15
|
+
license?: string;
|
|
16
|
+
keywords?: string[];
|
|
17
|
+
extensions?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface AgentPluginPackageSkill {
|
|
20
|
+
pluginName: string;
|
|
21
|
+
pluginRoot: string;
|
|
22
|
+
directoryPath: string;
|
|
23
|
+
filePath: string;
|
|
24
|
+
metadata: AgentSkillMetadata;
|
|
25
|
+
}
|
|
26
|
+
export interface AgentPluginPackageMcpServer {
|
|
27
|
+
pluginName: string;
|
|
28
|
+
pluginRoot: string;
|
|
29
|
+
pluginDataPath?: string;
|
|
30
|
+
serverName: string;
|
|
31
|
+
registration: McpServerRegistration;
|
|
32
|
+
}
|
|
33
|
+
export type AgentPluginPackageDiagnosticScope = "plugin" | "manifest" | "skills" | "skill" | "mcp" | "mcp-server";
|
|
34
|
+
export interface AgentPluginPackageDiagnostic {
|
|
35
|
+
level: "warning" | "error";
|
|
36
|
+
scope: AgentPluginPackageDiagnosticScope;
|
|
37
|
+
pluginPath: string;
|
|
38
|
+
pluginName?: string;
|
|
39
|
+
componentPath?: string;
|
|
40
|
+
componentName?: string;
|
|
41
|
+
message: string;
|
|
42
|
+
}
|
|
43
|
+
export interface LoadedAgentPluginPackage {
|
|
44
|
+
rootPath: string;
|
|
45
|
+
manifestPath: string;
|
|
46
|
+
manifest: AgentPluginPackageManifest;
|
|
47
|
+
skills: AgentPluginPackageSkill[];
|
|
48
|
+
mcpServers: AgentPluginPackageMcpServer[];
|
|
49
|
+
}
|
|
50
|
+
export interface AgentPluginPackageLoadReport {
|
|
51
|
+
plugins: LoadedAgentPluginPackage[];
|
|
52
|
+
skills: AgentPluginPackageSkill[];
|
|
53
|
+
mcpServers: AgentPluginPackageMcpServer[];
|
|
54
|
+
diagnostics: AgentPluginPackageDiagnostic[];
|
|
55
|
+
}
|
|
56
|
+
export interface LoadAgentPluginPackagesOptions {
|
|
57
|
+
/** Explicit plugin roots, resolved on the runtime host relative to `cwd`. */
|
|
58
|
+
pluginPaths?: ReadonlyArray<string>;
|
|
59
|
+
/** Base directory for resolving relative explicit plugin paths. */
|
|
60
|
+
cwd?: string;
|
|
61
|
+
/** Override automatic search roots. Primarily useful to embedded hosts/tests. */
|
|
62
|
+
searchPaths?: ReadonlyArray<string>;
|
|
63
|
+
/** Override the client-managed persistent Agent Plugin data root. */
|
|
64
|
+
pluginDataRoot?: string;
|
|
65
|
+
/** Manifest names disabled by the runtime host. Disabled names still reserve precedence. */
|
|
66
|
+
disabledPluginNames?: ReadonlyArray<string>;
|
|
67
|
+
}
|
|
@@ -4,4 +4,4 @@ export { UnifiedConfigFileWatcher } from "./unified-config-file-watcher";
|
|
|
4
4
|
export type { CreateInstructionWatcherOptions, CreateRulesConfigDefinitionOptions, CreateSkillsConfigDefinitionOptions, CreateWorkflowsConfigDefinitionOptions, ParseMarkdownFrontmatterResult, RuleConfig, SkillConfig, UserInstructionConfig, UserInstructionConfigType, WorkflowConfig, } from "./user-instruction-config-loader";
|
|
5
5
|
export { createRulesConfigDefinition, createSkillsConfigDefinition, createWorkflowsConfigDefinition, parseRuleConfigFromMarkdown, parseSkillConfigFromMarkdown, parseWorkflowConfigFromMarkdown, RULES_CONFIG_DIRECTORY_NAME, resolveRulesConfigSearchPaths, resolveSkillsConfigSearchPaths, resolveWorkflowsConfigSearchPaths, SKILLS_CONFIG_DIRECTORY_NAME, WORKFLOWS_CONFIG_DIRECTORY_NAME, } from "./user-instruction-config-loader";
|
|
6
6
|
export type { CreateUserInstructionConfigServiceOptions, UserInstructionConfigRecord, UserInstructionConfigService, } from "./user-instruction-service";
|
|
7
|
-
export { createUserInstructionConfigService } from "./user-instruction-service";
|
|
7
|
+
export { combineUserInstructionConfigServices, createUserInstructionConfigService, } from "./user-instruction-service";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RULES_CONFIG_DIRECTORY_NAME, SKILLS_CONFIG_DIRECTORY_NAME, WORKFLOWS_CONFIG_DIRECTORY_NAME } from "@cline/shared/storage";
|
|
2
|
+
import { type AgentPluginPackageSkill } from "../agent-plugin";
|
|
2
3
|
import { type UnifiedConfigDefinition, UnifiedConfigFileWatcher, type UnifiedConfigWatcherEvent } from "./unified-config-file-watcher";
|
|
3
4
|
export { RULES_CONFIG_DIRECTORY_NAME, SKILLS_CONFIG_DIRECTORY_NAME, WORKFLOWS_CONFIG_DIRECTORY_NAME, };
|
|
4
5
|
export interface ParseMarkdownFrontmatterResult {
|
|
@@ -13,6 +14,13 @@ export interface SkillConfig {
|
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
instructions: string;
|
|
15
16
|
frontmatter: Record<string, unknown>;
|
|
17
|
+
source?: {
|
|
18
|
+
type: "agent-plugin";
|
|
19
|
+
pluginName: string;
|
|
20
|
+
pluginRoot: string;
|
|
21
|
+
skillRoot: string;
|
|
22
|
+
filePath: string;
|
|
23
|
+
};
|
|
16
24
|
}
|
|
17
25
|
export interface RuleConfig {
|
|
18
26
|
name: string;
|
|
@@ -40,6 +48,7 @@ export interface CreateSkillsConfigDefinitionOptions {
|
|
|
40
48
|
workspacePath?: string;
|
|
41
49
|
includePluginSkills?: boolean;
|
|
42
50
|
pluginSkillDirectories?: ReadonlyArray<string>;
|
|
51
|
+
agentPluginSkills?: ReadonlyArray<AgentPluginPackageSkill>;
|
|
43
52
|
pluginPaths?: ReadonlyArray<string>;
|
|
44
53
|
cwd?: string;
|
|
45
54
|
}
|
|
@@ -10,6 +10,7 @@ type SkillsExecutorMetadataItem = {
|
|
|
10
10
|
type ConfiguredSkill = SkillsExecutorMetadataItem & {
|
|
11
11
|
skill: SkillConfig;
|
|
12
12
|
};
|
|
13
|
+
export declare function formatSkillInvocation(skill: Pick<SkillConfig, "name" | "description" | "instructions" | "source">, args?: string): string;
|
|
13
14
|
export interface CreateUserInstructionPluginOptions {
|
|
14
15
|
watcher: UserInstructionConfigWatcher;
|
|
15
16
|
watcherReady?: Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentExtension } from "@cline/shared";
|
|
2
|
-
import type
|
|
2
|
+
import { type SkillsExecutorWithMetadata } from "../tools";
|
|
3
3
|
import { type AvailableRuntimeCommand, type ResolveRuntimeSlashCommandOptions } from "./runtime-commands";
|
|
4
4
|
import { type CreateUserInstructionConfigWatcherOptions, type UserInstructionConfig, type UserInstructionConfigType } from "./user-instruction-config-loader";
|
|
5
5
|
import { type CreateUserInstructionPluginOptions } from "./user-instruction-plugin";
|
|
@@ -22,4 +22,10 @@ export interface UserInstructionConfigService {
|
|
|
22
22
|
createSkillsExecutor?(allowedSkillNames?: ReadonlyArray<string>): SkillsExecutorWithMetadata;
|
|
23
23
|
createExtension(options: Omit<CreateUserInstructionPluginOptions, "watcher" | "watcherReady">): AgentExtension;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Present multiple instruction sources as one extension/tool surface. This is
|
|
27
|
+
* used by the hub to overlay host-local Agent Plugin skills on a client-owned
|
|
28
|
+
* instruction snapshot without moving package discovery into each client.
|
|
29
|
+
*/
|
|
30
|
+
export declare function combineUserInstructionConfigServices(services: ReadonlyArray<UserInstructionConfigService>): UserInstructionConfigService;
|
|
25
31
|
export declare function createUserInstructionConfigService(options?: CreateUserInstructionConfigServiceOptions): UserInstructionConfigService;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export type { AgentPluginPackageDiagnostic, AgentPluginPackageDiagnosticScope, AgentPluginPackageLoadReport, AgentPluginPackageManifest, AgentPluginPackageMcpServer, AgentPluginPackageSkill, AgentSkillMetadata, LoadAgentPluginPackagesOptions, LoadedAgentPluginPackage, ParsedAgentSkill, } from "./agent-plugin";
|
|
2
|
+
export { AGENT_PLUGINS_V1_MANIFEST_SCHEMA, AGENT_PLUGINS_V1_MCP_SCHEMA, loadAgentPluginPackages, parseAgentSkillMarkdown, } from "./agent-plugin";
|
|
1
3
|
export type { ResolveAgentPluginPathsOptions } from "./plugin/plugin-config-loader";
|
|
2
4
|
export { discoverPluginModulePaths, getPluginDisplayName, resolveAgentPluginPaths, resolveAndLoadAgentPlugins, resolvePluginConfigSearchPaths, resolvePluginSkillDirectoriesFromPaths, } from "./plugin/plugin-config-loader";
|
|
3
5
|
export type { PluginInitializationFailure, PluginInitializationWarning, PluginLoadDiagnostics, } from "./plugin/plugin-load-report";
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { FetchLike } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
2
2
|
import type { McpServerClientFactory } from "./types";
|
|
3
3
|
export declare const DEFAULT_MCP_CONNECT_TIMEOUT_MS = 3000;
|
|
4
|
+
export declare const DEFAULT_HTTP_MCP_CONNECT_TIMEOUT_MS = 10000;
|
|
4
5
|
export interface DefaultMcpServerClientFactoryOptions {
|
|
5
6
|
settingsPath?: string;
|
|
6
7
|
clientName?: string;
|
|
7
8
|
clientVersion?: string;
|
|
8
9
|
fetch?: FetchLike;
|
|
10
|
+
/** Keep literal configured headers on the declared MCP origin only. */
|
|
11
|
+
restrictConfiguredHeadersToOrigin?: boolean;
|
|
9
12
|
}
|
|
10
13
|
export interface ProbeMcpServerConnectionOptions extends Omit<DefaultMcpServerClientFactoryOptions, "settingsPath"> {
|
|
11
14
|
serverName: string;
|
|
@@ -6,6 +6,11 @@ import type { FetchLike } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
|
6
6
|
import { type OAuthServerCloseInfo, type OAuthServerListeningInfo } from "../../auth/server";
|
|
7
7
|
import type { McpServerOAuthClientConfig, McpServerRegistration } from "./types";
|
|
8
8
|
export type McpSdkAuthCapableTransport = SSEClientTransport | StreamableHTTPClientTransport;
|
|
9
|
+
export declare function createOriginBoundMcpHeadersFetch(input: {
|
|
10
|
+
endpointUrl: string;
|
|
11
|
+
configuredHeaders: Record<string, string>;
|
|
12
|
+
baseFetch?: FetchLike;
|
|
13
|
+
}): FetchLike;
|
|
9
14
|
export interface CreateMcpOAuthProviderContextOptions {
|
|
10
15
|
settingsPath?: string;
|
|
11
16
|
serverName: string;
|
|
@@ -50,6 +55,7 @@ export declare function createMcpSdkTransport(input: {
|
|
|
50
55
|
registration: McpServerRegistration;
|
|
51
56
|
oauthProvider?: OAuthClientProvider;
|
|
52
57
|
fetch?: FetchLike;
|
|
58
|
+
restrictConfiguredHeadersToOrigin?: boolean;
|
|
53
59
|
}): McpSdkAuthCapableTransport;
|
|
54
60
|
/**
|
|
55
61
|
* Recognizes a 401 from a remote MCP server across transports. The streamable
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Line-ending
|
|
3
|
-
*
|
|
2
|
+
* Line-ending helpers shared by the file-writing executors (editor,
|
|
3
|
+
* apply_patch). Internal to the executors.
|
|
4
4
|
*
|
|
5
5
|
* Models emit LF-only text (reads strip "\r", so they never see a file's
|
|
6
6
|
* CRLF endings). Existing files keep their own detected EOL, but a new file
|
|
@@ -9,3 +9,15 @@
|
|
|
9
9
|
* (github.com/cline/cline/issues/13504). No-op on LF platforms.
|
|
10
10
|
*/
|
|
11
11
|
export declare function normalizeNewFileLineEndings(content: string): string;
|
|
12
|
+
export type LineEnding = "\r\n" | "\n";
|
|
13
|
+
/**
|
|
14
|
+
* Returns "\r\n" if "\r\n" appears anywhere in the content, otherwise "\n" —
|
|
15
|
+
* including for content with no line breaks at all. Files are uniformly CRLF
|
|
16
|
+
* or uniformly LF in practice; the mixed case that matters is a CRLF file
|
|
17
|
+
* with LF-only lines inserted by earlier releases of these tools, and any
|
|
18
|
+
* surviving "\r\n" — wherever it sits — should pull such a file back to
|
|
19
|
+
* CRLF, which is why this checks for "\r\n" anywhere rather than looking at
|
|
20
|
+
* the first line break.
|
|
21
|
+
*/
|
|
22
|
+
export declare function detectLineEnding(content: string): LineEnding;
|
|
23
|
+
export declare function normalizeLineEndings(text: string, eol: LineEnding): string;
|
|
@@ -20,6 +20,7 @@ export interface TaskResult {
|
|
|
20
20
|
error?: Error;
|
|
21
21
|
metadata?: Record<string, unknown>;
|
|
22
22
|
}
|
|
23
|
+
type TeamTaskEndStatus = "completed" | "failed" | "cancelled";
|
|
23
24
|
export type TeamEvent = {
|
|
24
25
|
type: TeamMessageType.TaskStart;
|
|
25
26
|
agentId: string;
|
|
@@ -27,6 +28,7 @@ export type TeamEvent = {
|
|
|
27
28
|
} | {
|
|
28
29
|
type: TeamMessageType.TaskEnd;
|
|
29
30
|
agentId: string;
|
|
31
|
+
status?: TeamTaskEndStatus;
|
|
30
32
|
result?: AgentResult;
|
|
31
33
|
error?: Error;
|
|
32
34
|
messages?: AgentResult["messages"];
|
|
@@ -202,6 +204,11 @@ export declare class AgentTeamsRuntime {
|
|
|
202
204
|
getRun(runId: string): TeamRunRecord | undefined;
|
|
203
205
|
awaitRun(runId: string, pollIntervalMs?: number): Promise<TeamRunRecord>;
|
|
204
206
|
awaitAllRuns(pollIntervalMs?: number): Promise<TeamRunRecord[]>;
|
|
207
|
+
/**
|
|
208
|
+
* Cancel work owned by this team runtime without removing teammate or
|
|
209
|
+
* conversation state. Used when the owning lead session is aborted.
|
|
210
|
+
*/
|
|
211
|
+
cancelOutstandingWork(reason?: unknown): void;
|
|
205
212
|
cancelRun(runId: string, reason?: string): TeamRunRecord;
|
|
206
213
|
recoverActiveRuns(reason?: string): TeamRunRecord[];
|
|
207
214
|
markStaleRunsInterrupted(reason?: string): TeamRunRecord[];
|
|
@@ -91,10 +91,17 @@ export declare class NodeHubClient {
|
|
|
91
91
|
}
|
|
92
92
|
export declare function normalizeHubWebSocketUrl(url: string): string;
|
|
93
93
|
export declare function verifyHubConnection(url: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd" | "authToken">): Promise<boolean>;
|
|
94
|
+
export interface HubSessionActivity {
|
|
95
|
+
/** Sessions with at least one live participant attached. */
|
|
96
|
+
activeSessionCount: number;
|
|
97
|
+
/** Distinct client ids attached to those sessions. */
|
|
98
|
+
participantClientCount: number;
|
|
99
|
+
}
|
|
94
100
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
101
|
+
* Summarize live activity from a `session.list` payload. A session counts as
|
|
102
|
+
* active only while a client is attached to it - the one signal that cannot
|
|
103
|
+
* go stale, because participants are live socket subscriptions the hub drops
|
|
104
|
+
* the moment a client's connection closes.
|
|
98
105
|
*
|
|
99
106
|
* Deliberately NOT based on session status: a client that dies without
|
|
100
107
|
* stopping its session leaves the hub-side runtime behind in a non-terminal
|
|
@@ -104,7 +111,17 @@ export declare function verifyHubConnection(url: string, options?: Pick<HubClien
|
|
|
104
111
|
* exact moment of a hub swap dies with the old hub - rare, and its next
|
|
105
112
|
* scheduled tick runs normally on the replacement.
|
|
106
113
|
*/
|
|
114
|
+
export declare function summarizeHubSessionActivity(payload: unknown): HubSessionActivity;
|
|
107
115
|
export declare function hasActiveHubSessions(payload: unknown): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Ask a hub how much live work it is serving. Throws when the hub cannot
|
|
118
|
+
* answer (unreachable, auth rejected, or too old to serve `session.list`),
|
|
119
|
+
* because the safe default points in opposite directions per caller: a
|
|
120
|
+
* replacement path treats an unanswerable hub as idle and retires it, while
|
|
121
|
+
* a recovery path treats it as busy and leaves it alone. Callers pick their
|
|
122
|
+
* own fallback instead of inheriting a hidden one.
|
|
123
|
+
*/
|
|
124
|
+
export declare function queryHubSessionActivity(url: string, authToken?: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd">): Promise<HubSessionActivity>;
|
|
108
125
|
export declare function localHubHasNoActiveSessions(url: string, authToken?: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd">): Promise<boolean>;
|
|
109
126
|
export declare function resolveCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
|
|
110
127
|
export declare function ensureCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
|
|
@@ -17,6 +17,14 @@ export interface ManagedHubBuildMismatchEvent {
|
|
|
17
17
|
hubCoreVersion?: string;
|
|
18
18
|
/** Build identity this client expects a managed Hub to match. */
|
|
19
19
|
expectedBuildId: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sessions with live participants on the Hub (best-effort, `outdated_hub`
|
|
22
|
+
* only): the work that replacing the Hub would interrupt. Unset when the
|
|
23
|
+
* Hub cannot answer the query.
|
|
24
|
+
*/
|
|
25
|
+
activeSessionCount?: number;
|
|
26
|
+
/** Distinct clients attached to those sessions (best-effort, `outdated_hub` only). */
|
|
27
|
+
participantClientCount?: number;
|
|
20
28
|
}
|
|
21
29
|
/**
|
|
22
30
|
* Probe the managed local Hub once and report whether a live Hub is running
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as LlmsProviders from "@cline/llms";
|
|
2
|
-
import type { AgendaAutomationPolicy, AgendaTaskListInput, AgendaTaskRecord, AgendaTaskRunRecord, ChatRunTurnRequest, ChatStartSessionRequest, ChatStartSessionResponse, ChatTurnResult, HubTaskCreateInput, HubTaskUpdateInput, TeamProgressProjectionEvent } from "@cline/shared";
|
|
2
|
+
import type { AgendaAutomationPolicy, AgendaTaskListInput, AgendaTaskRecord, AgendaTaskRunRecord, ChatRunTurnRequest, ChatStartSessionRequest, ChatStartSessionResponse, ChatTurnResult, HubSessionSearchHit, HubTaskCreateInput, HubTaskUpdateInput, TeamProgressProjectionEvent } from "@cline/shared";
|
|
3
3
|
import type { CheckpointEntry } from "../../hooks/checkpoint-hooks";
|
|
4
4
|
type ScheduleClientRecord = Record<string, unknown> & {
|
|
5
5
|
metadata?: Record<string, unknown>;
|
|
@@ -89,6 +89,11 @@ export declare class HubSessionClient {
|
|
|
89
89
|
listSessions(input?: {
|
|
90
90
|
limit?: number;
|
|
91
91
|
}): Promise<HubSessionRow[]>;
|
|
92
|
+
searchSessions(input: {
|
|
93
|
+
query: string;
|
|
94
|
+
limit?: number;
|
|
95
|
+
workspaceRoot?: string;
|
|
96
|
+
}): Promise<HubSessionSearchHit[]>;
|
|
92
97
|
deleteSession(sessionId: string, deleteCheckpointRefs?: boolean): Promise<boolean>;
|
|
93
98
|
respondToolApproval(input: {
|
|
94
99
|
approvalId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HubClientRecord, HubUINotifyPayload, HubUIShowWindowPayload, SessionRecord } from "@cline/shared";
|
|
1
|
+
import type { HubClientRecord, HubSessionSearchHit, HubUINotifyPayload, HubUIShowWindowPayload, SessionRecord } from "@cline/shared";
|
|
2
2
|
import type { CoreSettingsMutationResult, CoreSettingsToggleInput } from "../../settings";
|
|
3
3
|
export interface HubUIClientOptions {
|
|
4
4
|
address: string;
|
|
@@ -30,6 +30,11 @@ export declare class HubUIClient {
|
|
|
30
30
|
sendShowWindow(payload?: HubUIShowWindowPayload): Promise<void>;
|
|
31
31
|
listClients(): Promise<HubClientRecord[]>;
|
|
32
32
|
listSessions(limit?: number): Promise<SessionRecord[]>;
|
|
33
|
+
searchSessions(input: {
|
|
34
|
+
query: string;
|
|
35
|
+
limit?: number;
|
|
36
|
+
workspaceRoot?: string;
|
|
37
|
+
}): Promise<HubSessionSearchHit[]>;
|
|
33
38
|
toggleSetting(input: CoreSettingsToggleInput): Promise<CoreSettingsMutationResult>;
|
|
34
39
|
/**
|
|
35
40
|
* Subscribe to UI-relevant hub events.
|