@sctg/cline-core 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.
- package/README.md +110 -0
- package/dist/ClineCore.d.ts +283 -0
- package/dist/account/cline-account-service.d.ts +37 -0
- package/dist/account/index.d.ts +3 -0
- package/dist/account/rpc.d.ts +40 -0
- package/dist/account/types.d.ts +98 -0
- package/dist/auth/bounded-ttl-cache.d.ts +13 -0
- package/dist/auth/client.d.ts +30 -0
- package/dist/auth/cline.d.ts +64 -0
- package/dist/auth/codex.d.ts +43 -0
- package/dist/auth/oca.d.ts +28 -0
- package/dist/auth/server.d.ts +54 -0
- package/dist/auth/types.d.ts +103 -0
- package/dist/auth/utils.d.ts +32 -0
- package/dist/cline-core/automation.d.ts +34 -0
- package/dist/cline-core/runtime-services.d.ts +5 -0
- package/dist/cline-core/start-input.d.ts +10 -0
- package/dist/cline-core/telemetry.d.ts +10 -0
- package/dist/cline-core/types.d.ts +221 -0
- package/dist/cron/events/cron-event-ingress.d.ts +37 -0
- package/dist/cron/reports/cron-report-writer.d.ts +40 -0
- package/dist/cron/runner/cron-materializer.d.ts +35 -0
- package/dist/cron/runner/cron-runner.d.ts +47 -0
- package/dist/cron/runner/resource-limiter.d.ts +8 -0
- package/dist/cron/schedule/scheduler.d.ts +12 -0
- package/dist/cron/service/cron-service.d.ts +56 -0
- package/dist/cron/service/schedule-command-service.d.ts +9 -0
- package/dist/cron/service/schedule-service.d.ts +98 -0
- package/dist/cron/specs/cron-reconciler.d.ts +61 -0
- package/dist/cron/specs/cron-spec-parser.d.ts +26 -0
- package/dist/cron/specs/cron-watcher.d.ts +22 -0
- package/dist/cron/store/cron-schema.d.ts +2 -0
- package/dist/cron/store/sqlite-cron-store.d.ts +240 -0
- package/dist/extensions/config/index.d.ts +7 -0
- package/dist/extensions/config/runtime-commands.d.ts +11 -0
- package/dist/extensions/config/skill-frontmatter-toggle.d.ts +11 -0
- package/dist/extensions/config/unified-config-file-watcher.d.ts +77 -0
- package/dist/extensions/config/user-instruction-config-loader.d.ts +64 -0
- package/dist/extensions/config/user-instruction-plugin.d.ts +25 -0
- package/dist/extensions/config/user-instruction-service.d.ts +23 -0
- package/dist/extensions/context/agentic-compaction.d.ts +12 -0
- package/dist/extensions/context/basic-compaction.d.ts +8 -0
- package/dist/extensions/context/compaction-shared.d.ts +61 -0
- package/dist/extensions/context/compaction.d.ts +38 -0
- package/dist/extensions/index.d.ts +5 -0
- package/dist/extensions/mcp/client.d.ts +9 -0
- package/dist/extensions/mcp/config-loader.d.ts +25 -0
- package/dist/extensions/mcp/index.d.ts +11 -0
- package/dist/extensions/mcp/manager.d.ts +23 -0
- package/dist/extensions/mcp/name-transform.d.ts +2 -0
- package/dist/extensions/mcp/oauth.d.ts +48 -0
- package/dist/extensions/mcp/policies.d.ts +14 -0
- package/dist/extensions/mcp/tools.d.ts +3 -0
- package/dist/extensions/mcp/types.d.ts +111 -0
- package/dist/extensions/plugin/plugin-config-loader.d.ts +40 -0
- package/dist/extensions/plugin/plugin-load-report.d.ts +18 -0
- package/dist/extensions/plugin/plugin-loader.d.ts +22 -0
- package/dist/extensions/plugin/plugin-module-import.d.ts +4 -0
- package/dist/extensions/plugin/plugin-sandbox.d.ts +36 -0
- package/dist/extensions/plugin/plugin-targeting.d.ts +6 -0
- package/dist/extensions/plugin-sandbox-bootstrap.js +1 -0
- package/dist/extensions/tools/constants.d.ts +24 -0
- package/dist/extensions/tools/definitions.d.ts +102 -0
- package/dist/extensions/tools/executors/apply-patch-parser.d.ts +68 -0
- package/dist/extensions/tools/executors/apply-patch.d.ts +28 -0
- package/dist/extensions/tools/executors/bash.d.ts +49 -0
- package/dist/extensions/tools/executors/editor.d.ts +31 -0
- package/dist/extensions/tools/executors/file-read.d.ts +40 -0
- package/dist/extensions/tools/executors/index.d.ts +50 -0
- package/dist/extensions/tools/executors/search.d.ts +50 -0
- package/dist/extensions/tools/executors/web-fetch.d.ts +58 -0
- package/dist/extensions/tools/helpers.d.ts +15 -0
- package/dist/extensions/tools/index.d.ts +59 -0
- package/dist/extensions/tools/model-tool-routing.d.ts +33 -0
- package/dist/extensions/tools/presets.d.ts +132 -0
- package/dist/extensions/tools/runtime.d.ts +24 -0
- package/dist/extensions/tools/schemas.d.ts +241 -0
- package/dist/extensions/tools/team/delegated-agent.d.ts +43 -0
- package/dist/extensions/tools/team/index.d.ts +2 -0
- package/dist/extensions/tools/team/multi-agent.d.ts +230 -0
- package/dist/extensions/tools/team/projections.d.ts +8 -0
- package/dist/extensions/tools/team/runtime.d.ts +4 -0
- package/dist/extensions/tools/team/spawn-agent-tool.d.ts +84 -0
- package/dist/extensions/tools/team/subagent-prompts.d.ts +3 -0
- package/dist/extensions/tools/team/team-tools.d.ts +35 -0
- package/dist/extensions/tools/types.d.ts +254 -0
- package/dist/hooks/checkpoint-hooks.d.ts +45 -0
- package/dist/hooks/hook-extension.d.ts +2 -0
- package/dist/hooks/hook-file-config.d.ts +24 -0
- package/dist/hooks/hook-file-hooks.d.ts +21 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/subprocess-runner.d.ts +21 -0
- package/dist/hooks/subprocess.d.ts +68 -0
- package/dist/hub/client/connect.d.ts +14 -0
- package/dist/hub/client/index.d.ts +88 -0
- package/dist/hub/client/session-client.d.ts +118 -0
- package/dist/hub/client/ui-client.d.ts +45 -0
- package/dist/hub/daemon/entry.d.ts +1 -0
- package/dist/hub/daemon/entry.js +722 -0
- package/dist/hub/daemon/index.d.ts +9 -0
- package/dist/hub/daemon/runtime-handlers.d.ts +12 -0
- package/dist/hub/daemon/start-shared-server.d.ts +18 -0
- package/dist/hub/discovery/defaults.d.ts +16 -0
- package/dist/hub/discovery/index.d.ts +30 -0
- package/dist/hub/discovery/workspace.d.ts +3 -0
- package/dist/hub/index.d.ts +32 -0
- package/dist/hub/index.js +719 -0
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +76 -0
- package/dist/hub/runtime-host/remote-runtime-host.d.ts +9 -0
- package/dist/hub/server/browser-websocket.d.ts +19 -0
- package/dist/hub/server/command-transport.d.ts +7 -0
- package/dist/hub/server/handlers/approval-handlers.d.ts +17 -0
- package/dist/hub/server/handlers/capability-handlers.d.ts +12 -0
- package/dist/hub/server/handlers/client-handlers.d.ts +6 -0
- package/dist/hub/server/handlers/context.d.ts +57 -0
- package/dist/hub/server/handlers/run-handlers.d.ts +5 -0
- package/dist/hub/server/handlers/session-event-projector.d.ts +7 -0
- package/dist/hub/server/handlers/session-handlers.d.ts +20 -0
- package/dist/hub/server/hub-client-contributions.d.ts +19 -0
- package/dist/hub/server/hub-notifications.d.ts +7 -0
- package/dist/hub/server/hub-schedule-events.d.ts +2 -0
- package/dist/hub/server/hub-server-logging.d.ts +2 -0
- package/dist/hub/server/hub-server-options.d.ts +55 -0
- package/dist/hub/server/hub-server-transport.d.ts +37 -0
- package/dist/hub/server/hub-session-records.d.ts +9 -0
- package/dist/hub/server/hub-websocket-server.d.ts +6 -0
- package/dist/hub/server/index.d.ts +4 -0
- package/dist/hub/server/native-transport.d.ts +16 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.js +717 -0
- package/dist/remote-config/integration.d.ts +17 -0
- package/dist/runtime/capabilities/index.d.ts +2 -0
- package/dist/runtime/capabilities/normalize-runtime-capabilities.d.ts +2 -0
- package/dist/runtime/capabilities/runtime-capabilities.d.ts +6 -0
- package/dist/runtime/config/agent-message-codec.d.ts +6 -0
- package/dist/runtime/config/agent-runtime-config-builder.d.ts +80 -0
- package/dist/runtime/host/history.d.ts +19 -0
- package/dist/runtime/host/host.d.ts +7 -0
- package/dist/runtime/host/local/agent-event-bridge.d.ts +30 -0
- package/dist/runtime/host/local/session-record.d.ts +6 -0
- package/dist/runtime/host/local/session-service-invoker.d.ts +4 -0
- package/dist/runtime/host/local/spawn-tool.d.ts +15 -0
- package/dist/runtime/host/local/user-files.d.ts +1 -0
- package/dist/runtime/host/local-runtime-host.d.ts +127 -0
- package/dist/runtime/host/runtime-host-support.d.ts +20 -0
- package/dist/runtime/host/runtime-host.d.ts +169 -0
- package/dist/runtime/orchestration/runtime-builder.d.ts +6 -0
- package/dist/runtime/orchestration/runtime-event-adapter.d.ts +101 -0
- package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +30 -0
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +218 -0
- package/dist/runtime/orchestration/session-runtime.d.ts +58 -0
- package/dist/runtime/orchestration/user-input-builder.d.ts +15 -0
- package/dist/runtime/safety/loop-detection.d.ts +58 -0
- package/dist/runtime/safety/mistake-tracker.d.ts +68 -0
- package/dist/runtime/safety/rules.d.ts +6 -0
- package/dist/runtime/tools/subprocess-sandbox.d.ts +43 -0
- package/dist/runtime/tools/tool-approval.d.ts +9 -0
- package/dist/runtime/turn-queue/pending-prompt-service.d.ts +69 -0
- package/dist/services/agent-events.d.ts +34 -0
- package/dist/services/config.d.ts +2 -0
- package/dist/services/global-settings.d.ts +34 -0
- package/dist/services/llms/cline-recommended-models.d.ts +19 -0
- package/dist/services/llms/configured-provider-registry.d.ts +27 -0
- package/dist/services/llms/handler-factory.d.ts +3 -0
- package/dist/services/llms/provider-defaults.d.ts +28 -0
- package/dist/services/llms/provider-settings.d.ts +250 -0
- package/dist/services/llms/runtime-config.d.ts +3 -0
- package/dist/services/llms/runtime-registry.d.ts +19 -0
- package/dist/services/llms/runtime-types.d.ts +84 -0
- package/dist/services/local-runtime-bootstrap.d.ts +45 -0
- package/dist/services/plugin-tools.d.ts +28 -0
- package/dist/services/providers/local-provider-registry.d.ts +230 -0
- package/dist/services/providers/local-provider-service.d.ts +70 -0
- package/dist/services/providers/model-source.d.ts +3 -0
- package/dist/services/providers/provider-config-fields.d.ts +37 -0
- package/dist/services/session-artifacts.d.ts +17 -0
- package/dist/services/session-data.d.ts +51 -0
- package/dist/services/session-telemetry.d.ts +15 -0
- package/dist/services/storage/file-team-store.d.ts +28 -0
- package/dist/services/storage/provider-settings-legacy-migration.d.ts +38 -0
- package/dist/services/storage/provider-settings-manager.d.ts +23 -0
- package/dist/services/storage/sqlite-session-store.d.ts +30 -0
- package/dist/services/storage/sqlite-team-store.d.ts +34 -0
- package/dist/services/storage/team-store.d.ts +15 -0
- package/dist/services/telemetry/ITelemetryAdapter.d.ts +54 -0
- package/dist/services/telemetry/OpenTelemetryAdapter.d.ts +43 -0
- package/dist/services/telemetry/OpenTelemetryProvider.d.ts +83 -0
- package/dist/services/telemetry/TelemetryLoggerSink.d.ts +27 -0
- package/dist/services/telemetry/TelemetryService.d.ts +34 -0
- package/dist/services/telemetry/core-events.d.ts +276 -0
- package/dist/services/telemetry/distinct-id.d.ts +1 -0
- package/dist/services/telemetry/index.d.ts +3 -0
- package/dist/services/telemetry/index.js +1 -0
- package/dist/services/usage.d.ts +19 -0
- package/dist/services/workspace/file-indexer.d.ts +5 -0
- package/dist/services/workspace/index.d.ts +4 -0
- package/dist/services/workspace/mention-enricher.d.ts +13 -0
- package/dist/services/workspace/workspace-manager.d.ts +27 -0
- package/dist/services/workspace/workspace-manifest.d.ts +31 -0
- package/dist/services/workspace/workspace-telemetry.d.ts +18 -0
- package/dist/session/checkpoint-restore.d.ts +20 -0
- package/dist/session/models/session-graph.d.ts +15 -0
- package/dist/session/models/session-manifest.d.ts +31 -0
- package/dist/session/models/session-row.d.ts +92 -0
- package/dist/session/services/file-session-service.d.ts +10 -0
- package/dist/session/services/message-builder.d.ts +66 -0
- package/dist/session/services/persistence-service.d.ts +59 -0
- package/dist/session/services/session-service.d.ts +15 -0
- package/dist/session/session-snapshot.d.ts +59 -0
- package/dist/session/session-versioning-service.d.ts +48 -0
- package/dist/session/stores/conversation-store.d.ts +29 -0
- package/dist/session/stores/session-manifest-store.d.ts +23 -0
- package/dist/session/stores/team-persistence-store.d.ts +23 -0
- package/dist/session/team/index.d.ts +2 -0
- package/dist/session/team/team-child-session-manager.d.ts +35 -0
- package/dist/session/team/team-session-coordinator.d.ts +13 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/settings-service.d.ts +6 -0
- package/dist/settings/types.d.ts +43 -0
- package/dist/types/chat-schema.d.ts +163 -0
- package/dist/types/common.d.ts +24 -0
- package/dist/types/config.d.ts +167 -0
- package/dist/types/events.d.ts +89 -0
- package/dist/types/provider-settings.d.ts +19 -0
- package/dist/types/session.d.ts +122 -0
- package/dist/types/sessions.d.ts +38 -0
- package/dist/types/storage.d.ts +36 -0
- package/dist/types.d.ts +32 -0
- package/dist/version.d.ts +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HOOKS_CONFIG_DIRECTORY_NAME } from "@cline/shared/storage";
|
|
2
|
+
import type { HookEventName } from "./subprocess";
|
|
3
|
+
export { HOOKS_CONFIG_DIRECTORY_NAME };
|
|
4
|
+
export declare function resolveHooksConfigSearchPaths(workspacePath?: string): string[];
|
|
5
|
+
export declare enum HookConfigFileName {
|
|
6
|
+
TaskStart = "TaskStart",
|
|
7
|
+
TaskResume = "TaskResume",
|
|
8
|
+
TaskCancel = "TaskCancel",
|
|
9
|
+
TaskComplete = "TaskComplete",
|
|
10
|
+
TaskError = "TaskError",
|
|
11
|
+
PreToolUse = "PreToolUse",
|
|
12
|
+
PostToolUse = "PostToolUse",
|
|
13
|
+
UserPromptSubmit = "UserPromptSubmit",
|
|
14
|
+
PreCompact = "PreCompact",
|
|
15
|
+
SessionShutdown = "SessionShutdown"
|
|
16
|
+
}
|
|
17
|
+
export declare const HOOK_CONFIG_FILE_EVENT_MAP: Readonly<Record<HookConfigFileName, HookEventName | undefined>>;
|
|
18
|
+
export declare function toHookConfigFileName(fileName: string): HookConfigFileName | undefined;
|
|
19
|
+
export interface HookConfigFileEntry {
|
|
20
|
+
fileName: HookConfigFileName;
|
|
21
|
+
hookEventName?: HookEventName;
|
|
22
|
+
path: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function listHookConfigFiles(workspacePath?: string): HookConfigFileEntry[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AgentExtension, AgentHooks } from "@cline/shared";
|
|
2
|
+
import { type BasicLogger, type WorkspaceInfo } from "@cline/shared";
|
|
3
|
+
type HookRuntimeOptions = {
|
|
4
|
+
cwd: string;
|
|
5
|
+
workspacePath: string;
|
|
6
|
+
rootSessionId?: string;
|
|
7
|
+
logger?: BasicLogger;
|
|
8
|
+
toolCallTimeoutMs?: number;
|
|
9
|
+
/** Structured git + path metadata forwarded into every hook payload. */
|
|
10
|
+
workspaceInfo?: WorkspaceInfo;
|
|
11
|
+
};
|
|
12
|
+
export declare function getWindowsPythonFallbackCommand(command: string[], platform?: NodeJS.Platform, error?: unknown): string[] | undefined;
|
|
13
|
+
export declare function createHookAuditHooks(options: {
|
|
14
|
+
rootSessionId?: string;
|
|
15
|
+
workspacePath: string;
|
|
16
|
+
workspaceInfo?: WorkspaceInfo;
|
|
17
|
+
}): AgentHooks;
|
|
18
|
+
export declare function createHookConfigFileHooks(options: HookRuntimeOptions): AgentHooks | undefined;
|
|
19
|
+
export declare function createHookConfigFileExtension(options: HookRuntimeOptions): AgentExtension | undefined;
|
|
20
|
+
export declare function mergeAgentHooks(layers: Array<AgentHooks | undefined>): AgentHooks | undefined;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createAgentHooksExtension } from "./hook-extension";
|
|
2
|
+
export { HOOK_CONFIG_FILE_EVENT_MAP, HOOKS_CONFIG_DIRECTORY_NAME, type HookConfigFileEntry, HookConfigFileName, listHookConfigFiles, resolveHooksConfigSearchPaths, toHookConfigFileName, } from "./hook-file-config";
|
|
3
|
+
export { createHookAuditHooks, createHookConfigFileExtension, createHookConfigFileHooks, mergeAgentHooks, } from "./hook-file-hooks";
|
|
4
|
+
export { createSubprocessHooks, type HookEventName, HookEventNameSchema, type HookEventPayload, HookEventPayloadSchema, parseHookEventPayload, type RunHookOptions, type RunHookResult, runHook, type SubprocessHookControl, type SubprocessHooksOptions, } from "./subprocess";
|
|
5
|
+
export { type RunSubprocessEventOptions, type RunSubprocessEventResult, runSubprocessEvent, } from "./subprocess-runner";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface RunSubprocessEventOptions {
|
|
2
|
+
command: string[];
|
|
3
|
+
cwd?: string;
|
|
4
|
+
env?: NodeJS.ProcessEnv;
|
|
5
|
+
detached?: boolean;
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
onSpawn?: (event: {
|
|
8
|
+
command: string[];
|
|
9
|
+
pid?: number;
|
|
10
|
+
detached: boolean;
|
|
11
|
+
}) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface RunSubprocessEventResult {
|
|
14
|
+
exitCode: number | null;
|
|
15
|
+
stdout: string;
|
|
16
|
+
stderr: string;
|
|
17
|
+
parsedJson?: unknown;
|
|
18
|
+
parseError?: string;
|
|
19
|
+
timedOut?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function runSubprocessEvent(payload: unknown, options: RunSubprocessEventOptions): Promise<RunSubprocessEventResult | undefined>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type AgentAbortHookPayload, type AgentEndHookPayload, type AgentErrorHookPayload, type AgentHooks, type AgentResumeHookPayload, type AgentStartHookPayload, type HookEventName, HookEventNameSchema, type HookEventPayload, type HookEventPayloadBase, HookEventPayloadSchema, type HookSessionContextProvider, type PostToolUseData, type PreCompactData, type PreCompactHookPayload, type PreToolUseData, type PromptSubmitHookPayload, parseHookEventPayload, type SessionShutdownHookPayload, type TaskCancelData, type TaskCompleteData, type TaskResumeData, type TaskStartData, type ToolCallHookPayload, type ToolResultHookPayload, type UserPromptSubmitData, type WorkspaceInfo } from "@cline/shared";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type RunSubprocessEventResult } from "./subprocess-runner";
|
|
4
|
+
export interface HookOutput {
|
|
5
|
+
contextModification: string;
|
|
6
|
+
cancel: boolean;
|
|
7
|
+
review?: boolean;
|
|
8
|
+
errorMessage: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const HookOutputSchema: z.ZodObject<{
|
|
11
|
+
contextModification: z.ZodOptional<z.ZodString>;
|
|
12
|
+
cancel: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
review: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
15
|
+
context: z.ZodOptional<z.ZodString>;
|
|
16
|
+
overrideInput: z.ZodOptional<z.ZodUnknown>;
|
|
17
|
+
}, z.core.$loose>;
|
|
18
|
+
export { HookEventNameSchema, HookEventPayloadSchema, parseHookEventPayload };
|
|
19
|
+
export type { AgentAbortHookPayload, AgentEndHookPayload, AgentErrorHookPayload, AgentResumeHookPayload, AgentStartHookPayload, HookEventName, HookEventPayload, HookEventPayloadBase, PostToolUseData, PreCompactData, PreCompactHookPayload, PreToolUseData, PromptSubmitHookPayload, SessionShutdownHookPayload, TaskCancelData, TaskCompleteData, TaskResumeData, TaskStartData, ToolCallHookPayload, ToolResultHookPayload, UserPromptSubmitData, };
|
|
20
|
+
export interface RunHookOptions {
|
|
21
|
+
command?: string[];
|
|
22
|
+
cwd?: string;
|
|
23
|
+
env?: NodeJS.ProcessEnv;
|
|
24
|
+
detached?: boolean;
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
onSpawn?: (event: {
|
|
27
|
+
command: string[];
|
|
28
|
+
pid?: number;
|
|
29
|
+
detached: boolean;
|
|
30
|
+
}) => void;
|
|
31
|
+
}
|
|
32
|
+
export type RunHookResult = RunSubprocessEventResult;
|
|
33
|
+
export declare function runHook(payload: HookEventPayload, options?: RunHookOptions): Promise<RunHookResult | undefined>;
|
|
34
|
+
export interface SubprocessHooksOptions {
|
|
35
|
+
command?: string[];
|
|
36
|
+
cwd?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Structured workspace and git metadata forwarded into every hook payload
|
|
39
|
+
* as `workspaceInfo`. Obtained from `generateWorkspaceInfo` at session
|
|
40
|
+
* startup and passed here so hook scripts can inspect branch, commit, and
|
|
41
|
+
* remote without running their own `git` commands.
|
|
42
|
+
*/
|
|
43
|
+
workspaceInfo?: WorkspaceInfo;
|
|
44
|
+
env?: NodeJS.ProcessEnv;
|
|
45
|
+
timeoutMs?: number;
|
|
46
|
+
onDispatchError?: (error: Error, payload: HookEventPayload) => void;
|
|
47
|
+
onDispatch?: (event: {
|
|
48
|
+
payload: HookEventPayload;
|
|
49
|
+
result?: RunHookResult;
|
|
50
|
+
detached: boolean;
|
|
51
|
+
}) => void;
|
|
52
|
+
onSpawn?: (event: {
|
|
53
|
+
command: string[];
|
|
54
|
+
pid?: number;
|
|
55
|
+
detached: boolean;
|
|
56
|
+
}) => void;
|
|
57
|
+
sessionContext?: HookSessionContextProvider;
|
|
58
|
+
}
|
|
59
|
+
export interface SubprocessHookControl {
|
|
60
|
+
hooks: AgentHooks;
|
|
61
|
+
shutdown: (ctx: {
|
|
62
|
+
agentId: string;
|
|
63
|
+
conversationId: string;
|
|
64
|
+
parentAgentId: string | null;
|
|
65
|
+
reason?: string;
|
|
66
|
+
}) => Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
export declare function createSubprocessHooks(options?: SubprocessHooksOptions): SubprocessHookControl;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubReplyEnvelope } from "@cline/shared";
|
|
2
|
+
import { type HubEndpointOverrides } from "../discovery/defaults";
|
|
3
|
+
export interface HubConnection {
|
|
4
|
+
send(envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
5
|
+
close(): void;
|
|
6
|
+
}
|
|
7
|
+
export interface HubCommandRequest extends Omit<HubCommandEnvelope, "version" | "clientId"> {
|
|
8
|
+
version?: HubCommandEnvelope["version"];
|
|
9
|
+
clientId?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveHubUrl(overrides?: HubEndpointOverrides): Promise<string>;
|
|
12
|
+
export declare function connectToHub(url: string): Promise<HubConnection>;
|
|
13
|
+
export declare function probeHubConnection(url: string): Promise<boolean>;
|
|
14
|
+
export declare function sendHubCommand(overrides: HubEndpointOverrides, envelope: HubCommandRequest): Promise<HubReplyEnvelope>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type HubCommandEnvelope, type HubEventEnvelope, type HubReplyEnvelope } from "@cline/shared";
|
|
2
|
+
export interface HubClientOptions {
|
|
3
|
+
url: string;
|
|
4
|
+
clientId?: string;
|
|
5
|
+
clientType?: string;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
workspaceRoot?: string;
|
|
8
|
+
cwd?: string;
|
|
9
|
+
authToken?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LocalHubResolutionOptions {
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
strategy?: "prefer-hub" | "require-hub";
|
|
14
|
+
workspaceRoot?: string;
|
|
15
|
+
cwd?: string;
|
|
16
|
+
}
|
|
17
|
+
export type HubTransportErrorCode = "hub_connect_timeout" | "hub_connect_failed" | "hub_connection_closed" | "hub_connection_not_open";
|
|
18
|
+
export declare class HubTransportError extends Error {
|
|
19
|
+
readonly code: HubTransportErrorCode;
|
|
20
|
+
readonly details?: {
|
|
21
|
+
closeCode?: number;
|
|
22
|
+
closeReason?: string;
|
|
23
|
+
} | undefined;
|
|
24
|
+
constructor(code: HubTransportErrorCode, message: string, details?: {
|
|
25
|
+
closeCode?: number;
|
|
26
|
+
closeReason?: string;
|
|
27
|
+
} | undefined);
|
|
28
|
+
}
|
|
29
|
+
export declare function isHubReconnectableTransportError(error: unknown): error is HubTransportError;
|
|
30
|
+
export declare class HubCommandError extends Error {
|
|
31
|
+
readonly command: HubCommandEnvelope["command"];
|
|
32
|
+
readonly code: string | undefined;
|
|
33
|
+
constructor(command: HubCommandEnvelope["command"], code: string | undefined, message: string);
|
|
34
|
+
}
|
|
35
|
+
export declare function isHubCommandTimeoutError(error: unknown, command?: HubCommandEnvelope["command"]): boolean;
|
|
36
|
+
export declare function rememberRecoverableLocalHubUrl(url: string, authToken?: string): string;
|
|
37
|
+
export declare class NodeHubClient {
|
|
38
|
+
private readonly options;
|
|
39
|
+
private socket;
|
|
40
|
+
private connectPromise;
|
|
41
|
+
private readonly clientId;
|
|
42
|
+
private currentUrl;
|
|
43
|
+
private recoveryPromise;
|
|
44
|
+
private readonly pendingReplies;
|
|
45
|
+
private readonly listeners;
|
|
46
|
+
private readonly subscriptionCounts;
|
|
47
|
+
private reconnectTimer;
|
|
48
|
+
private reconnectAttempt;
|
|
49
|
+
private closedByClient;
|
|
50
|
+
private lastCloseError;
|
|
51
|
+
private sawSocketClose;
|
|
52
|
+
private registered;
|
|
53
|
+
constructor(options: HubClientOptions);
|
|
54
|
+
getClientId(): string;
|
|
55
|
+
getUrl(): string;
|
|
56
|
+
connect(): Promise<void>;
|
|
57
|
+
subscribe(listener: (event: HubEventEnvelope) => void, options?: {
|
|
58
|
+
sessionId?: string;
|
|
59
|
+
}): () => void;
|
|
60
|
+
command(command: HubCommandEnvelope["command"], payload?: Record<string, unknown>, sessionId?: string, options?: {
|
|
61
|
+
timeoutMs?: number | null;
|
|
62
|
+
}): Promise<HubReplyEnvelope>;
|
|
63
|
+
private commandOnce;
|
|
64
|
+
private recoverLocalHubTransport;
|
|
65
|
+
private hasActiveSubscriptions;
|
|
66
|
+
private clearReconnectTimer;
|
|
67
|
+
private scheduleReconnect;
|
|
68
|
+
private reconnectSubscribedTransport;
|
|
69
|
+
close(): void;
|
|
70
|
+
dispose(): Promise<void>;
|
|
71
|
+
private sendFrame;
|
|
72
|
+
private sendSubscriptionFrame;
|
|
73
|
+
private adjustSubscriptionCount;
|
|
74
|
+
private subscriptionKeyForSessionId;
|
|
75
|
+
private subscriptionSessionIdFromKey;
|
|
76
|
+
private handleFrame;
|
|
77
|
+
}
|
|
78
|
+
export declare function normalizeHubWebSocketUrl(url: string): string;
|
|
79
|
+
export declare function verifyHubConnection(url: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd" | "authToken">): Promise<boolean>;
|
|
80
|
+
export declare function resolveCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
|
|
81
|
+
export declare function ensureCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
|
|
82
|
+
export declare function requestHubShutdown(url: string, authToken?: string): Promise<boolean>;
|
|
83
|
+
export declare function stopLocalHubServerGracefully(): Promise<boolean>;
|
|
84
|
+
export declare function restartLocalHubIfIdleAfterStartupTimeout(options: {
|
|
85
|
+
url: string;
|
|
86
|
+
workspaceRoot?: string;
|
|
87
|
+
cwd?: string;
|
|
88
|
+
}): Promise<string | undefined>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type * as LlmsProviders from "@cline/llms";
|
|
2
|
+
import type { ChatRunTurnRequest, ChatStartSessionRequest, ChatStartSessionResponse, ChatTurnResult, TeamProgressProjectionEvent } from "@cline/shared";
|
|
3
|
+
import type { CheckpointEntry } from "../../hooks/checkpoint-hooks";
|
|
4
|
+
type ScheduleClientRecord = Record<string, unknown> & {
|
|
5
|
+
metadata?: Record<string, unknown>;
|
|
6
|
+
};
|
|
7
|
+
export interface HubSessionClientOptions {
|
|
8
|
+
address: string;
|
|
9
|
+
authToken?: string;
|
|
10
|
+
clientId?: string;
|
|
11
|
+
clientType?: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
workspaceRoot?: string;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface HubSessionRow {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
parentSessionId?: string;
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
messagesPath?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface HubStreamEvent {
|
|
24
|
+
sessionId: string;
|
|
25
|
+
eventType: string;
|
|
26
|
+
payload: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface HubRestoreRequest {
|
|
29
|
+
sessionId: string;
|
|
30
|
+
checkpointRunCount: number;
|
|
31
|
+
config?: ChatStartSessionRequest;
|
|
32
|
+
restore?: {
|
|
33
|
+
messages?: boolean;
|
|
34
|
+
workspace?: boolean;
|
|
35
|
+
omitCheckpointMessageFromSession?: boolean;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface HubRestoreResponse {
|
|
39
|
+
sessionId?: string;
|
|
40
|
+
startResult?: {
|
|
41
|
+
sessionId: string;
|
|
42
|
+
manifestPath: string;
|
|
43
|
+
messagesPath: string;
|
|
44
|
+
};
|
|
45
|
+
messages?: LlmsProviders.Message[];
|
|
46
|
+
checkpoint: CheckpointEntry;
|
|
47
|
+
}
|
|
48
|
+
export interface HubEventStreamHandlers {
|
|
49
|
+
onEvent?: (event: HubStreamEvent) => void;
|
|
50
|
+
onError?: (error: Error) => void;
|
|
51
|
+
}
|
|
52
|
+
export interface HubTeamProgressHandlers {
|
|
53
|
+
onProjection?: (event: TeamProgressProjectionEvent) => void;
|
|
54
|
+
onError?: (error: Error) => void;
|
|
55
|
+
}
|
|
56
|
+
export declare class HubSessionClient {
|
|
57
|
+
private readonly options;
|
|
58
|
+
private readonly client;
|
|
59
|
+
private metadataApplied;
|
|
60
|
+
constructor(options: HubSessionClientOptions);
|
|
61
|
+
private ensureMetadataApplied;
|
|
62
|
+
connect(): Promise<void>;
|
|
63
|
+
close(): void;
|
|
64
|
+
dispose(): Promise<void>;
|
|
65
|
+
startRuntimeSession(request: ChatStartSessionRequest): Promise<ChatStartSessionResponse>;
|
|
66
|
+
sendRuntimeSession(sessionId: string, request: ChatRunTurnRequest, options?: {
|
|
67
|
+
timeoutMs?: number | null;
|
|
68
|
+
}): Promise<{
|
|
69
|
+
result?: ChatTurnResult;
|
|
70
|
+
}>;
|
|
71
|
+
stopRuntimeSession(sessionId: string): Promise<{
|
|
72
|
+
applied: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
abortRuntimeSession(sessionId: string): Promise<{
|
|
75
|
+
applied: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
updateSession(input: {
|
|
78
|
+
sessionId: string;
|
|
79
|
+
metadata?: Record<string, unknown>;
|
|
80
|
+
}): Promise<{
|
|
81
|
+
updated: boolean;
|
|
82
|
+
}>;
|
|
83
|
+
getSession(sessionId: string): Promise<HubSessionRow | undefined>;
|
|
84
|
+
readMessages(sessionId: string): Promise<LlmsProviders.Message[]>;
|
|
85
|
+
restore(input: HubRestoreRequest): Promise<HubRestoreResponse>;
|
|
86
|
+
listSessions(input?: {
|
|
87
|
+
limit?: number;
|
|
88
|
+
}): Promise<HubSessionRow[]>;
|
|
89
|
+
deleteSession(sessionId: string, deleteCheckpointRefs?: boolean): Promise<boolean>;
|
|
90
|
+
respondToolApproval(input: {
|
|
91
|
+
approvalId: string;
|
|
92
|
+
approved: boolean;
|
|
93
|
+
reason?: string;
|
|
94
|
+
responderClientId?: string;
|
|
95
|
+
}): Promise<void>;
|
|
96
|
+
streamEvents(input: {
|
|
97
|
+
clientId?: string;
|
|
98
|
+
sessionIds?: string[];
|
|
99
|
+
}, handlers: HubEventStreamHandlers): () => void;
|
|
100
|
+
streamTeamProgress(_input: {
|
|
101
|
+
clientId?: string;
|
|
102
|
+
}, handlers: HubTeamProgressHandlers): () => void;
|
|
103
|
+
createSchedule(input: Record<string, unknown>): Promise<ScheduleClientRecord | undefined>;
|
|
104
|
+
listSchedules(_input?: {
|
|
105
|
+
limit?: number;
|
|
106
|
+
}): Promise<ScheduleClientRecord[]>;
|
|
107
|
+
getSchedule(scheduleId: string): Promise<ScheduleClientRecord | undefined>;
|
|
108
|
+
updateSchedule(scheduleId: string, input: Record<string, unknown>): Promise<ScheduleClientRecord | undefined>;
|
|
109
|
+
pauseSchedule(scheduleId: string): Promise<ScheduleClientRecord | undefined>;
|
|
110
|
+
resumeSchedule(scheduleId: string): Promise<ScheduleClientRecord | undefined>;
|
|
111
|
+
deleteSchedule(scheduleId: string): Promise<boolean>;
|
|
112
|
+
triggerScheduleNow(scheduleId: string): Promise<Record<string, unknown> | undefined>;
|
|
113
|
+
listScheduleExecutions(scheduleId: string, limit?: number): Promise<Array<Record<string, unknown>>>;
|
|
114
|
+
getScheduleStats(): Promise<Record<string, unknown> | undefined>;
|
|
115
|
+
getActiveScheduledExecutions(): Promise<Array<Record<string, unknown>>>;
|
|
116
|
+
getUpcomingScheduledRuns(limit?: number): Promise<Array<Record<string, unknown>>>;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { HubClientRecord, HubUINotifyPayload, HubUIShowWindowPayload, SessionRecord } from "@cline/shared";
|
|
2
|
+
export interface HubUIClientOptions {
|
|
3
|
+
address: string;
|
|
4
|
+
authToken?: string;
|
|
5
|
+
clientId?: string;
|
|
6
|
+
clientType?: string;
|
|
7
|
+
displayName?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A lightweight hub client for UI/notification concerns.
|
|
11
|
+
* Used by the menu bar app and other UI clients to send/receive
|
|
12
|
+
* UI events (notifications, show window, client tracking).
|
|
13
|
+
*/
|
|
14
|
+
export declare class HubUIClient {
|
|
15
|
+
private readonly client;
|
|
16
|
+
constructor(options: HubUIClientOptions);
|
|
17
|
+
connect(): Promise<void>;
|
|
18
|
+
close(): void;
|
|
19
|
+
dispose(): Promise<void>;
|
|
20
|
+
getClientId(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Send a notification request to the hub.
|
|
23
|
+
* The hub will broadcast a "ui.notify" event to all subscribers (e.g. the menu bar app).
|
|
24
|
+
*/
|
|
25
|
+
sendNotify(payload: HubUINotifyPayload): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Request the hub to broadcast a "ui.show_window" event to all subscribers.
|
|
28
|
+
*/
|
|
29
|
+
sendShowWindow(payload?: HubUIShowWindowPayload): Promise<void>;
|
|
30
|
+
listClients(): Promise<HubClientRecord[]>;
|
|
31
|
+
listSessions(limit?: number): Promise<SessionRecord[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Subscribe to UI-relevant hub events.
|
|
34
|
+
* Returns an unsubscribe function.
|
|
35
|
+
*/
|
|
36
|
+
subscribeUI(handlers: {
|
|
37
|
+
onNotify?: (payload: HubUINotifyPayload) => void;
|
|
38
|
+
onShowWindow?: (payload: HubUIShowWindowPayload) => void;
|
|
39
|
+
onClientRegistered?: (payload: Record<string, unknown>) => void;
|
|
40
|
+
onClientDisconnected?: (payload: Record<string, unknown>) => void;
|
|
41
|
+
onSessionCreated?: (payload: Record<string, unknown>) => void;
|
|
42
|
+
onSessionUpdated?: (payload: Record<string, unknown>) => void;
|
|
43
|
+
onSessionDetached?: (payload: Record<string, unknown>) => void;
|
|
44
|
+
}): () => void;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|