@cline/core 0.0.73 → 0.0.74-nightly.1786676845
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/ClineCore.d.ts +13 -3
- package/dist/cline-core/types.d.ts +2 -2
- package/dist/extensions/tools/runtime.d.ts +1 -0
- package/dist/hub/client/index.d.ts +15 -0
- package/dist/hub/client/managed-hub-build-watcher.d.ts +54 -0
- package/dist/hub/client/session-client.d.ts +2 -2
- package/dist/hub/daemon/entry.js +191 -187
- package/dist/hub/daemon/index.d.ts +19 -0
- package/dist/hub/daemon/shutdown-coordinator.d.ts +31 -0
- package/dist/hub/discovery/index.d.ts +57 -0
- package/dist/hub/discovery/workspace.d.ts +9 -0
- package/dist/hub/index.d.ts +1 -0
- package/dist/hub/index.js +178 -174
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +1 -1
- package/dist/hub/server/hub-server-options.d.ts +14 -4
- package/dist/hub/server/hub-websocket-server.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +172 -168
- package/dist/runtime/host/local-runtime-host.d.ts +2 -2
- package/dist/runtime/host/runtime-host-support.d.ts +1 -1
- package/dist/runtime/host/runtime-host.d.ts +4 -4
- package/dist/runtime/orchestration/runtime-event-adapter.d.ts +1 -1
- package/dist/runtime/orchestration/session-runtime.d.ts +2 -1
- package/dist/services/agent-events.d.ts +25 -0
- package/dist/services/global-settings.d.ts +13 -1
- package/dist/services/telemetry/core-events.d.ts +3 -0
- package/dist/services/telemetry/index.js +1 -1
- package/dist/session/checkpoint-restore.d.ts +4 -4
- package/dist/session/display-messages.d.ts +28 -0
- package/dist/session/persisted-tool-result-content.d.ts +8 -0
- package/dist/session/services/persistence-service.d.ts +2 -2
- package/dist/session/session-snapshot.d.ts +2 -2
- package/dist/session/session-versioning-service.d.ts +4 -4
- package/dist/session/stores/session-manifest-store.d.ts +1 -1
- package/dist/session/team/team-child-session-manager.d.ts +2 -2
- package/dist/types.d.ts +2 -3
- package/package.json +4 -4
- package/dist/hub/daemon/shutdown-watchdog.d.ts +0 -13
package/dist/ClineCore.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ClineCoreAutomationApi, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, CompareCheckpointInput, CompareCheckpointResult, RestoreInput, RestoreResult } from "./cline-core/types";
|
|
2
2
|
import type { PendingPromptsServiceApi, RuntimeHost, RuntimeHostSubscribeOptions, SessionConnectionRuntimeService, SessionModelRuntimeService, SessionUsageRuntimeService, StartSessionInput, StartSessionResult } from "./runtime/host/runtime-host";
|
|
3
3
|
import { FeatureFlagsService } from "./services/feature-flags";
|
|
4
|
+
import { type SessionDisplayMessage } from "./session/display-messages";
|
|
4
5
|
import type { CoreSessionEvent } from "./types/events";
|
|
5
6
|
import type { SessionHistoryRecord } from "./types/sessions";
|
|
6
7
|
export type { ClineAutomationEventIngressResult, ClineAutomationEventLog, ClineAutomationEventSuppression, ClineAutomationListEventsOptions, ClineAutomationListRunsOptions, ClineAutomationListSpecsOptions, ClineAutomationRun, ClineAutomationRunStatus, ClineAutomationSpec, ClineCoreAutomationApi, ClineCoreAutomationOptions, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, CompareCheckpointInput, CompareCheckpointResult, HubOptions, RemoteOptions, RestoreInput, RestoreOptions, RestoreResult, RuntimeHostMode, StartSessionBootstrap, } from "./cline-core/types";
|
|
@@ -229,10 +230,12 @@ export declare class ClineCore {
|
|
|
229
230
|
*/
|
|
230
231
|
readSessionCompactionState: RuntimeHost["readSessionCompactionState"];
|
|
231
232
|
/**
|
|
232
|
-
* Reads message history for a session.
|
|
233
|
+
* Reads the canonical message history for a session.
|
|
233
234
|
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
235
|
+
* This is the model/replay representation used by resume, fork, and
|
|
236
|
+
* compaction. Provider-owned model-tool activity remains observational
|
|
237
|
+
* metadata here. Use {@link readDisplayMessages} for a UI transcript with
|
|
238
|
+
* that activity projected into ordinary tool blocks.
|
|
236
239
|
*
|
|
237
240
|
* @example
|
|
238
241
|
* ```ts
|
|
@@ -243,6 +246,13 @@ export declare class ClineCore {
|
|
|
243
246
|
* ```
|
|
244
247
|
*/
|
|
245
248
|
readMessages: RuntimeHost["readSessionMessages"];
|
|
249
|
+
/**
|
|
250
|
+
* Reads a transcript projected for presentation. Observational model-tool
|
|
251
|
+
* activity is represented with the same tool blocks as ordinary local tools.
|
|
252
|
+
*
|
|
253
|
+
* Use {@link readMessages} for resume, fork, compaction, or model replay.
|
|
254
|
+
*/
|
|
255
|
+
readDisplayMessages(sessionId: string): Promise<SessionDisplayMessage[]>;
|
|
246
256
|
/**
|
|
247
257
|
* Reads message history for a session, preferring the live in-memory
|
|
248
258
|
* conversation when the session is still resident in this host.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MessageWithMetadata } from "@cline/llms";
|
|
2
2
|
import type { AgentConfig, AutomationEventEnvelope, BasicLogger, ITelemetryService } from "@cline/shared";
|
|
3
3
|
import type { CronEventSuppression } from "../cron/events/cron-event-ingress";
|
|
4
4
|
import type { CronEventLogRecord, CronRunRecord, CronSpecRecord } from "../cron/store/sqlite-cron-store";
|
|
@@ -119,7 +119,7 @@ export interface RestoreInput {
|
|
|
119
119
|
export interface RestoreResult {
|
|
120
120
|
sessionId?: string;
|
|
121
121
|
startResult?: StartSessionResult;
|
|
122
|
-
messages?:
|
|
122
|
+
messages?: MessageWithMetadata[];
|
|
123
123
|
checkpoint: CheckpointEntry;
|
|
124
124
|
}
|
|
125
125
|
export interface CompareCheckpointInput {
|
|
@@ -12,6 +12,7 @@ export interface BuiltinToolAvailabilityContext {
|
|
|
12
12
|
enableSpawnAgent?: boolean;
|
|
13
13
|
enableAgentTeams?: boolean;
|
|
14
14
|
disabledToolIds?: ReadonlySet<string>;
|
|
15
|
+
enabledModelToolIds?: ReadonlySet<string>;
|
|
15
16
|
}
|
|
16
17
|
export declare function getCoreBuiltinToolCatalog(context?: BuiltinToolAvailabilityContext): ToolCatalogEntry[];
|
|
17
18
|
export declare function getCoreDefaultEnabledToolIds(context?: BuiltinToolAvailabilityContext): string[];
|
|
@@ -80,6 +80,21 @@ export declare class NodeHubClient {
|
|
|
80
80
|
}
|
|
81
81
|
export declare function normalizeHubWebSocketUrl(url: string): string;
|
|
82
82
|
export declare function verifyHubConnection(url: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd" | "authToken">): Promise<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* Whether any client is attached to a session on the hub - the one signal
|
|
85
|
+
* that cannot go stale, because participants are live socket subscriptions
|
|
86
|
+
* the hub drops the moment a client's connection closes.
|
|
87
|
+
*
|
|
88
|
+
* Deliberately NOT based on session status: a client that dies without
|
|
89
|
+
* stopping its session leaves the hub-side runtime behind in a non-terminal
|
|
90
|
+
* status forever, and counting those "ghost" sessions as busy pins an
|
|
91
|
+
* outdated hub as "serving sessions" until the machine reboots. The cost of
|
|
92
|
+
* ignoring status is that a participant-less background run executing at the
|
|
93
|
+
* exact moment of a hub swap dies with the old hub - rare, and its next
|
|
94
|
+
* scheduled tick runs normally on the replacement.
|
|
95
|
+
*/
|
|
96
|
+
export declare function hasActiveHubSessions(payload: unknown): boolean;
|
|
97
|
+
export declare function localHubHasNoActiveSessions(url: string, authToken?: string, options?: Pick<HubClientOptions, "workspaceRoot" | "cwd">): Promise<boolean>;
|
|
83
98
|
export declare function resolveCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
|
|
84
99
|
export declare function ensureCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
|
|
85
100
|
export declare function requestHubShutdown(url: string, authToken?: string): Promise<boolean>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface ManagedHubBuildMismatchEvent {
|
|
2
|
+
/** WebSocket URL of the live managed Hub that does not match this build. */
|
|
3
|
+
url: string;
|
|
4
|
+
/**
|
|
5
|
+
* Why client and Hub disagree:
|
|
6
|
+
* - `build_mismatch`: the running Hub is a newer build this client stays
|
|
7
|
+
* attached to, and updating this client resolves it.
|
|
8
|
+
* - `unsupported_protocol`: this client cannot speak the Hub's protocol.
|
|
9
|
+
* - `outdated_hub`: this client is the newer build, but the running Hub was
|
|
10
|
+
* left in place because it is still serving sessions. Nothing to install;
|
|
11
|
+
* the Hub is replaced once those sessions end.
|
|
12
|
+
*/
|
|
13
|
+
reason: "unsupported_protocol" | "build_mismatch" | "outdated_hub";
|
|
14
|
+
/** Build identity reported by the running Hub, when it reports one. */
|
|
15
|
+
hubBuildId?: string;
|
|
16
|
+
/** Core package version reported by the running Hub. */
|
|
17
|
+
hubCoreVersion?: string;
|
|
18
|
+
/** Build identity this client expects a managed Hub to match. */
|
|
19
|
+
expectedBuildId: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Probe the managed local Hub once and report whether a live Hub is running
|
|
23
|
+
* a build this client cannot manage. Returns `undefined` when there is no
|
|
24
|
+
* discovery record, the recorded Hub is unreachable, a Hub startup
|
|
25
|
+
* transaction is in flight (another client may be mid-replacement), or the
|
|
26
|
+
* running Hub matches this build.
|
|
27
|
+
*
|
|
28
|
+
* A mismatch means another Cline installation replaced the shared Hub with a
|
|
29
|
+
* different build (for example, the CLI was updated while the desktop app
|
|
30
|
+
* kept running). This client can keep talking to it over the compatible wire
|
|
31
|
+
* protocol, but it should prompt the user to update and restart so client
|
|
32
|
+
* and Hub run the same code again.
|
|
33
|
+
*/
|
|
34
|
+
export declare function checkManagedHubBuildMismatch(): Promise<ManagedHubBuildMismatchEvent | undefined>;
|
|
35
|
+
export interface WatchManagedHubBuildOptions {
|
|
36
|
+
onMismatch: (event: ManagedHubBuildMismatchEvent) => void;
|
|
37
|
+
intervalMs?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Periodically watch the managed local Hub for a build-identity mismatch and
|
|
41
|
+
* invoke `onMismatch` when another Cline installation has replaced the Hub
|
|
42
|
+
* with a different build. Fires once per observed Hub build (it will fire
|
|
43
|
+
* again only if the Hub changes to yet another mismatched build after a
|
|
44
|
+
* compatible one was seen, or a different mismatch reason appears).
|
|
45
|
+
*
|
|
46
|
+
* Start this only for managed Hub usage. Hosts configured with an explicit
|
|
47
|
+
* Hub endpoint keep protocol-only compatibility and must not show update
|
|
48
|
+
* prompts, so the watcher refuses to start when `CLINE_HUB_PORT` is set.
|
|
49
|
+
* The first check runs after one interval so app startup (which may itself
|
|
50
|
+
* be replacing a stale Hub) has settled.
|
|
51
|
+
*
|
|
52
|
+
* Returns a stop function.
|
|
53
|
+
*/
|
|
54
|
+
export declare function watchManagedHubBuildMismatch(options: WatchManagedHubBuildOptions): () => void;
|
|
@@ -44,7 +44,7 @@ export interface HubRestoreResponse {
|
|
|
44
44
|
manifestPath: string;
|
|
45
45
|
messagesPath: string;
|
|
46
46
|
};
|
|
47
|
-
messages?: LlmsProviders.
|
|
47
|
+
messages?: LlmsProviders.MessageWithMetadata[];
|
|
48
48
|
checkpoint: CheckpointEntry;
|
|
49
49
|
}
|
|
50
50
|
export interface HubEventStreamHandlers {
|
|
@@ -83,7 +83,7 @@ export declare class HubSessionClient {
|
|
|
83
83
|
updated: boolean;
|
|
84
84
|
}>;
|
|
85
85
|
getSession(sessionId: string): Promise<HubSessionRow | undefined>;
|
|
86
|
-
readMessages(sessionId: string): Promise<LlmsProviders.
|
|
86
|
+
readMessages(sessionId: string): Promise<LlmsProviders.MessageWithMetadata[]>;
|
|
87
87
|
restore(input: HubRestoreRequest): Promise<HubRestoreResponse>;
|
|
88
88
|
listSessions(input?: {
|
|
89
89
|
limit?: number;
|