@cline/core 0.0.86 → 0.0.87
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/cloud/api.d.ts +32 -5
- package/dist/cloud/controller.d.ts +32 -4
- package/dist/cloud/index.d.ts +3 -1
- package/dist/cloud/index.js +21 -11
- package/dist/cloud/models.d.ts +9 -0
- package/dist/cloud/types.d.ts +11 -1
- package/dist/extensions/plugin-sandbox-bootstrap.js +1 -1
- package/dist/extensions/tools/executors/bash.d.ts +26 -0
- package/dist/extensions/tools/executors/index.d.ts +1 -1
- package/dist/extensions/tools/index.d.ts +1 -1
- package/dist/hub/daemon/bind-diagnostics.d.ts +16 -0
- package/dist/hub/daemon/entry.js +304 -304
- package/dist/hub/daemon/index.d.ts +8 -0
- package/dist/hub/discovery/index.d.ts +1 -0
- package/dist/hub/index.js +293 -294
- package/dist/index.d.ts +5 -3
- package/dist/index.js +339 -334
- package/dist/remote/remote-helper-entry.js +4 -4
- package/dist/remote/remote-helper.js +4 -4
- package/dist/runtime/host/local-runtime-host.d.ts +2 -0
- package/dist/runtime/host/runtime-host.d.ts +5 -0
- package/dist/services/agent-events.d.ts +1 -0
- package/dist/services/cloud-handoff/git-preflight.d.ts +24 -0
- package/dist/services/cloud-handoff/index.d.ts +4 -0
- package/dist/services/cloud-handoff/metadata.d.ts +7 -0
- package/dist/services/cloud-handoff/transcript.d.ts +5 -0
- package/dist/services/cloud-handoff/types.d.ts +35 -0
- package/dist/services/feature-flags/posthog.js +1 -1
- package/dist/services/telemetry/core-events.d.ts +3 -0
- package/dist/services/telemetry/index.js +1 -1
- package/dist/services/workspace/workspace-manifest.d.ts +34 -0
- package/dist/session/fork-metadata.d.ts +7 -0
- package/dist/session/services/persistence-service.d.ts +1 -0
- package/dist/types/chat-schema.d.ts +2 -2
- package/dist/types/provider-settings.d.ts +11 -0
- package/package.json +4 -4
package/dist/cloud/api.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { type AgentMode, type MessageWithMetadata } from "@cline/shared";
|
|
1
2
|
import type { CloudBranchListOptions, CloudBranchListResult, CloudRepositoryListResult } from "./repositories";
|
|
2
3
|
type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
3
4
|
export type CloudSessionRecord = {
|
|
4
5
|
id: string;
|
|
5
6
|
status: string;
|
|
7
|
+
sandboxType?: "standard" | "resumable";
|
|
6
8
|
title?: string;
|
|
7
9
|
sandboxUrl: string;
|
|
8
10
|
repoContext: {
|
|
@@ -10,11 +12,13 @@ export type CloudSessionRecord = {
|
|
|
10
12
|
branch?: string;
|
|
11
13
|
};
|
|
12
14
|
metadata: {
|
|
15
|
+
sandboxType?: "standard" | "resumable";
|
|
13
16
|
modelId?: string;
|
|
14
17
|
taskId?: string;
|
|
15
18
|
statusReason?: string;
|
|
16
19
|
provisioningPhase?: CloudProvisioningPhase;
|
|
17
20
|
createRequestTitle?: string;
|
|
21
|
+
cwd?: string;
|
|
18
22
|
};
|
|
19
23
|
expiredAt?: string | null;
|
|
20
24
|
lastActivityAt?: string;
|
|
@@ -24,6 +28,7 @@ export type CloudSessionRecord = {
|
|
|
24
28
|
export type CloudProvisioningPhase = "provisioning" | "cloning_repo" | "agent_starting" | "ready" | "failed";
|
|
25
29
|
export declare function deriveCloudSessionTitle(prompt: string): string;
|
|
26
30
|
export type CreateCloudSessionInput = {
|
|
31
|
+
sandboxType?: "standard" | "resumable";
|
|
27
32
|
/** Stable client-planned id for single-flighting one chat's start request. */
|
|
28
33
|
requestId?: string;
|
|
29
34
|
modelId: string;
|
|
@@ -33,18 +38,32 @@ export type CreateCloudSessionInput = {
|
|
|
33
38
|
autoApproveTools?: boolean;
|
|
34
39
|
thinking?: boolean;
|
|
35
40
|
reasoningEffort?: "low" | "medium" | "high" | "xhigh";
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
mode?: AgentMode;
|
|
42
|
+
workspaceRelativePath?: string;
|
|
43
|
+
/** Null explicitly selects Personal; controllers resolve an omitted scope. */
|
|
44
|
+
organizationId?: string | null;
|
|
45
|
+
/** Host persistence hooks; never serialized into the provisioning request. */
|
|
46
|
+
handoff?: {
|
|
47
|
+
sourceSessionId: string;
|
|
48
|
+
resolveMessages: () => Promise<MessageWithMetadata[]>;
|
|
49
|
+
/** Persist dispatch intent after successful recovery lookup, before POST. */
|
|
50
|
+
onCreating: () => void | Promise<void>;
|
|
51
|
+
onOuterSessionCreated: (sessionId: string, context?: {
|
|
52
|
+
created: boolean;
|
|
53
|
+
}) => Promise<void>;
|
|
54
|
+
onOuterSessionRemoved?: (sessionId: string) => Promise<void>;
|
|
55
|
+
onSeeding?: () => void | Promise<void>;
|
|
56
|
+
};
|
|
38
57
|
};
|
|
39
58
|
export type { CloudBranchListOptions, CloudBranchListResult, CloudRepositoryListResult, CloudRepositoryOption, } from "./repositories";
|
|
40
|
-
type CloudSessionApiOptions = {
|
|
59
|
+
export type CloudSessionApiOptions = {
|
|
41
60
|
apiBaseUrl: string;
|
|
42
61
|
appBaseUrl: string;
|
|
43
62
|
getAuthToken: () => Promise<string | undefined>;
|
|
44
63
|
fetch?: FetchLike;
|
|
45
64
|
createTimeoutMs?: number;
|
|
46
65
|
};
|
|
47
|
-
type CloudErrorCode = "authentication_required" | "github_not_connected" | "session_not_found" | "session_expired" | "session_failed" | "request_failed";
|
|
66
|
+
export type CloudErrorCode = "authentication_required" | "github_not_connected" | "session_not_found" | "session_expired" | "session_failed" | "request_failed";
|
|
48
67
|
export declare class CloudSessionError extends Error {
|
|
49
68
|
readonly code: CloudErrorCode;
|
|
50
69
|
readonly detail: string;
|
|
@@ -55,6 +74,11 @@ export declare class CloudSessionError extends Error {
|
|
|
55
74
|
/** HTTP status of the failed request, when one was received. */
|
|
56
75
|
status?: number | undefined);
|
|
57
76
|
}
|
|
77
|
+
/** The fresh handoff POST definitely did not create a workspace. Marker/list
|
|
78
|
+
* failures and ambiguous transport outcomes deliberately never use this type. */
|
|
79
|
+
export declare class CloudHandoffCreationRejectedError extends Error {
|
|
80
|
+
constructor(cause: unknown);
|
|
81
|
+
}
|
|
58
82
|
export declare function parseCloudProvisioningPhase(value: unknown): CloudProvisioningPhase | undefined;
|
|
59
83
|
export declare class CloudSessionApi {
|
|
60
84
|
private readonly options;
|
|
@@ -62,9 +86,10 @@ export declare class CloudSessionApi {
|
|
|
62
86
|
private readonly appBaseUrl;
|
|
63
87
|
private readonly fetchImpl;
|
|
64
88
|
private readonly createTimeoutMs;
|
|
89
|
+
private readonly unconfirmedHandoffCreates;
|
|
90
|
+
private readonly completedHandoffCreates;
|
|
65
91
|
constructor(options: CloudSessionApiOptions);
|
|
66
92
|
private request;
|
|
67
|
-
private refreshCreationAuth;
|
|
68
93
|
list(organizationId?: string): Promise<CloudSessionRecord[]>;
|
|
69
94
|
private listWithToken;
|
|
70
95
|
listRepositories(organizationId?: string): Promise<CloudRepositoryListResult>;
|
|
@@ -84,9 +109,11 @@ export declare class CloudSessionApi {
|
|
|
84
109
|
sandboxUrl: string;
|
|
85
110
|
cleanupAuthToken: string;
|
|
86
111
|
}>;
|
|
112
|
+
private persistHandoffOuterSession;
|
|
87
113
|
waitUntilReady(sessionId: string, signal: AbortSignal, onStatus?: (status: {
|
|
88
114
|
phase?: CloudProvisioningPhase;
|
|
89
115
|
}) => void): Promise<void>;
|
|
116
|
+
resume(sessionId: string, signal?: AbortSignal): Promise<CloudSessionRecord>;
|
|
90
117
|
delete(sessionId: string, authToken?: string): Promise<void>;
|
|
91
118
|
private deleteWithAuth;
|
|
92
119
|
updateTitle(sessionId: string, title: string): Promise<CloudSessionRecord>;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import type { BasicLogger, ToolApprovalResult } from "@cline/shared";
|
|
1
|
+
import type { BasicLogger, MessageWithMetadata, ToolApprovalResult } from "@cline/shared";
|
|
2
2
|
import { NodeHubClient } from "../hub/client/index";
|
|
3
3
|
import { type CloudSessionApi, CloudSessionError, type CloudSessionRecord, type CreateCloudSessionInput } from "./api";
|
|
4
|
+
import { type CloudModel } from "./models";
|
|
4
5
|
import type { CloudBranchListOptions, CloudBranchListResult, CloudRepositoryListResult } from "./repositories";
|
|
5
|
-
import type { CloudCreationOptions, CloudSessionAttachment, CloudSessionEvent, CloudSessionSnapshot, CloudSessionState, JsonRecord } from "./types";
|
|
6
|
+
import type { CloudCreationOptions, CloudHandoffSeed, CloudSessionAttachment, CloudSessionEvent, CloudSessionSnapshot, CloudSessionState, JsonRecord } from "./types";
|
|
7
|
+
/** The seed command was not dispatched; the host may clear its seed marker. */
|
|
8
|
+
export declare class CloudHandoffSeedRejectedError extends Error {
|
|
9
|
+
constructor(cause: unknown);
|
|
10
|
+
}
|
|
11
|
+
/** A queued prompt may have been accepted even when recovery also fails. */
|
|
6
12
|
export declare class CloudQueueUnconfirmedError extends CloudSessionError {
|
|
7
13
|
constructor();
|
|
8
14
|
}
|
|
15
|
+
export declare class CloudHandoffSeedUnsupportedError extends Error {
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
9
18
|
type CloudHubClient = Pick<NodeHubClient, "command" | "connect" | "dispose" | "getClientId" | "subscribe">;
|
|
10
19
|
export type CloudSessionControllerOptions = {
|
|
11
20
|
logger?: BasicLogger;
|
|
@@ -19,7 +28,7 @@ export type CloudSessionControllerOptions = {
|
|
|
19
28
|
lateCreateDisposition?: "preserve" | "delete";
|
|
20
29
|
/** Host-owned first-task policy survives controller replacement; established tasks never qualify. */
|
|
21
30
|
pendingInitialTasks?: Map<string, CloudCreationOptions>;
|
|
22
|
-
api: Pick<CloudSessionApi, "create" | "delete" | "list" | "status" | "waitUntilReady" | "history" | "updateTitle" | "listRepositories" | "listBranches">;
|
|
31
|
+
api: Pick<CloudSessionApi, "create" | "resume" | "delete" | "list" | "status" | "waitUntilReady" | "history" | "updateTitle" | "listRepositories" | "listBranches">;
|
|
23
32
|
getAuthToken: () => Promise<string | undefined>;
|
|
24
33
|
apiBaseUrl: string;
|
|
25
34
|
getActiveOrganizationId?: (options?: {
|
|
@@ -47,6 +56,7 @@ export declare class CloudSessionController {
|
|
|
47
56
|
private readonly pendingInitialTasks;
|
|
48
57
|
private lastListedSessions;
|
|
49
58
|
private discoveryRefresh?;
|
|
59
|
+
private readonly unconfirmedInnerCreates;
|
|
50
60
|
private readonly createRequests;
|
|
51
61
|
private readonly provisioningControllers;
|
|
52
62
|
private readonly sendAbortTokens;
|
|
@@ -77,9 +87,15 @@ export declare class CloudSessionController {
|
|
|
77
87
|
/** Revalidates a cached row by id when the active-scope list does not include it. */
|
|
78
88
|
getCrossScopeDiscoveryRecord(sessionId: string): Promise<JsonRecord | undefined>;
|
|
79
89
|
list(): Promise<CloudSessionRecord[]>;
|
|
90
|
+
handoffTargetExists(sessionId: string): Promise<boolean>;
|
|
80
91
|
private preserveConnectedRuntimeModel;
|
|
81
92
|
private resolveActiveOrganizationId;
|
|
82
93
|
listRepositories(): Promise<CloudRepositoryListResult>;
|
|
94
|
+
listModels(): Promise<CloudModel[]>;
|
|
95
|
+
/** Validates account auth and GitHub access before provisioning a handoff. */
|
|
96
|
+
prepareHandoffRepository(repoUrl: string): Promise<{
|
|
97
|
+
organizationId?: string;
|
|
98
|
+
}>;
|
|
83
99
|
listBranches(repositoryId: number, options?: CloudBranchListOptions): Promise<CloudBranchListResult>;
|
|
84
100
|
listForDiscovery(options?: {
|
|
85
101
|
timeoutMs?: number;
|
|
@@ -87,6 +103,15 @@ export declare class CloudSessionController {
|
|
|
87
103
|
create(input: CreateCloudSessionInput): Promise<CloudSessionAttachment>;
|
|
88
104
|
private trackProvisioningController;
|
|
89
105
|
private abortProvisioningControllers;
|
|
106
|
+
/** Waits for an adopted pending handoff target before opening its Hub proxy. */
|
|
107
|
+
waitUntilReady(outerSessionId: string): Promise<void>;
|
|
108
|
+
/** Seeds an already-provisioned outer session when retrying a pending handoff. */
|
|
109
|
+
seedHandoff(outerSessionId: string, seed: CloudHandoffSeed): Promise<{
|
|
110
|
+
innerSessionId: string;
|
|
111
|
+
}>;
|
|
112
|
+
verifyHandoffTranscript(outerSessionId: string, expected: readonly MessageWithMetadata[], options?: {
|
|
113
|
+
allowAppendedMessages?: boolean;
|
|
114
|
+
}): Promise<void>;
|
|
90
115
|
private createOnce;
|
|
91
116
|
private deleteProvisionedSessionAfterDispose;
|
|
92
117
|
attach(outerSessionId: string, creationOptions?: CloudCreationOptions): Promise<CloudSessionAttachment>;
|
|
@@ -125,7 +150,10 @@ export declare class CloudSessionController {
|
|
|
125
150
|
private assertSessionActive;
|
|
126
151
|
private ensureConnection;
|
|
127
152
|
private resolveInnerSession;
|
|
153
|
+
private restoreSavedInnerSession;
|
|
154
|
+
private assertHandoffConnectionReusable;
|
|
128
155
|
private createInnerSession;
|
|
156
|
+
private adoptExistingHandoffSession;
|
|
129
157
|
private createInnerSessionOnce;
|
|
130
158
|
private handleEvent;
|
|
131
159
|
private forwardEvent;
|
|
@@ -138,7 +166,7 @@ export declare class CloudSessionController {
|
|
|
138
166
|
private subscribeToInnerSession;
|
|
139
167
|
private applySessionModel;
|
|
140
168
|
private disposeConnection;
|
|
141
|
-
/** Stop reconnecting
|
|
169
|
+
/** Stop reconnecting when the sandbox is unavailable, not when lookup fails. */
|
|
142
170
|
private disposeConnectionIfSessionGone;
|
|
143
171
|
}
|
|
144
172
|
export {};
|
package/dist/cloud/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
/** Experimental
|
|
1
|
+
/** Experimental cloud execution client. No local runtime or tool execution is initialized. */
|
|
2
|
+
export * from "../services/cloud-handoff";
|
|
2
3
|
export * from "./api";
|
|
3
4
|
export * from "./controller";
|
|
5
|
+
export * from "./models";
|
|
4
6
|
export * from "./repositories";
|
|
5
7
|
export * from "./snapshots";
|
|
6
8
|
export { normalizeSessionTitle, resolveSessionListTitle, stringifyMessageContent, } from "./state";
|