@cline/core 0.0.46 → 0.0.47-nightly.1781320576

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.
Files changed (30) hide show
  1. package/dist/ClineCore.d.ts +2 -0
  2. package/dist/cline-core/types.d.ts +6 -0
  3. package/dist/extensions/tools/executors/bash.d.ts +10 -2
  4. package/dist/extensions/tools/executors/output-limits.d.ts +22 -0
  5. package/dist/extensions/tools/helpers.d.ts +13 -0
  6. package/dist/hub/client/index.d.ts +2 -1
  7. package/dist/hub/daemon/entry.js +198 -192
  8. package/dist/hub/daemon/index.d.ts +6 -2
  9. package/dist/hub/daemon/start-shared-server.d.ts +4 -4
  10. package/dist/hub/discovery/index.d.ts +23 -1
  11. package/dist/hub/discovery/workspace.d.ts +1 -0
  12. package/dist/hub/index.js +197 -191
  13. package/dist/hub/server/hub-websocket-server.d.ts +1 -0
  14. package/dist/index.d.ts +5 -3
  15. package/dist/index.js +197 -191
  16. package/dist/runtime/host/local-runtime-host.d.ts +1 -0
  17. package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +0 -1
  18. package/dist/services/feature-flags/FeatureFlagsService.d.ts +49 -0
  19. package/dist/services/feature-flags/index.d.ts +2 -0
  20. package/dist/services/feature-flags/posthog.d.ts +24 -0
  21. package/dist/services/feature-flags/posthog.js +1 -0
  22. package/dist/services/feature-flags/providers.d.ts +7 -0
  23. package/dist/services/providers/local-provider-service.d.ts +4 -1
  24. package/dist/services/storage/provider-settings-manager.d.ts +7 -2
  25. package/dist/services/telemetry/core-events.d.ts +3 -0
  26. package/dist/services/telemetry/index.d.ts +1 -0
  27. package/dist/services/telemetry/index.js +1 -1
  28. package/dist/session/services/message-builder.d.ts +7 -0
  29. package/dist/types.d.ts +3 -1
  30. package/package.json +18 -5
@@ -1,5 +1,6 @@
1
1
  import type { ClineCoreAutomationApi, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, RestoreInput, RestoreResult } from "./cline-core/types";
2
2
  import type { PendingPromptsServiceApi, RuntimeHost, RuntimeHostSubscribeOptions, SessionModelRuntimeService, SessionUsageRuntimeService, StartSessionInput, StartSessionResult } from "./runtime/host/runtime-host";
3
+ import { FeatureFlagsService } from "./services/feature-flags";
3
4
  import type { CoreSessionEvent } from "./types/events";
4
5
  import type { SessionHistoryRecord } from "./types/sessions";
5
6
  export type { ClineAutomationEventIngressResult, ClineAutomationEventLog, ClineAutomationEventSuppression, ClineAutomationListEventsOptions, ClineAutomationListRunsOptions, ClineAutomationListSpecsOptions, ClineAutomationRun, ClineAutomationRunStatus, ClineAutomationSpec, ClineCoreAutomationApi, ClineCoreAutomationOptions, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, HubOptions, RemoteOptions, RestoreInput, RestoreOptions, RestoreResult, RuntimeHostMode, StartSessionBootstrap, } from "./cline-core/types";
@@ -19,6 +20,7 @@ export declare class ClineCore {
19
20
  readonly runtimeAddress: string | undefined;
20
21
  readonly automation: ClineCoreAutomationApi;
21
22
  readonly settings: ClineCoreSettingsApi;
23
+ readonly featureFlags: FeatureFlagsService;
22
24
  readonly pendingPrompts: PendingPromptsServiceApi;
23
25
  private readonly host;
24
26
  private readonly prepare;
@@ -7,6 +7,7 @@ import type { RuntimeCapabilities } from "../runtime/capabilities";
7
7
  import type { SessionHistoryListOptions } from "../runtime/host/history";
8
8
  import type { SessionBackend } from "../runtime/host/host";
9
9
  import type { LocalRuntimeStartOptions, RuntimeHostMode, StartSessionInput, StartSessionResult } from "../runtime/host/runtime-host";
10
+ import type { FeatureFlagsService } from "../services/feature-flags";
10
11
  import type { CoreSessionConfig } from "../types/config";
11
12
  import type { SessionMessagesArtifactUploader } from "../types/session";
12
13
  export type { RuntimeHostMode } from "../runtime/host/runtime-host";
@@ -160,6 +161,11 @@ export interface ClineCoreOptions {
160
161
  * If omitted, telemetry is a no-op.
161
162
  */
162
163
  telemetry?: ITelemetryService;
164
+ /**
165
+ * Feature flags service for this ClineCore instance.
166
+ * If omitted, Core uses a no-op provider with default flag values.
167
+ */
168
+ featureFlags?: FeatureFlagsService;
163
169
  /**
164
170
  * Optional structured logger for core-side operational diagnostics such as
165
171
  * runtime-host selection and fallback decisions.
@@ -4,6 +4,11 @@
4
4
  * Built-in implementation for running shell commands using Node.js spawn.
5
5
  */
6
6
  import type { BashExecutor } from "../types";
7
+ export declare class CommandExitError extends Error {
8
+ readonly exitCode: number;
9
+ readonly output: string;
10
+ constructor(exitCode: number, output: string);
11
+ }
7
12
  /**
8
13
  * Options for the bash executor
9
14
  */
@@ -19,8 +24,11 @@ export interface BashExecutorOptions {
19
24
  */
20
25
  timeoutMs?: number;
21
26
  /**
22
- * Maximum output size in bytes
23
- * @default 1_000_000 (1MB)
27
+ * Maximum output size, measured in characters (approximately bytes for
28
+ * ASCII-dominant output). Output beyond this is middle-truncated: the
29
+ * head and tail are preserved and the middle is elided, since build and
30
+ * test failures usually live at the end of the output.
31
+ * @default 51_200 (~50KB)
24
32
  */
25
33
  maxOutputBytes?: number;
26
34
  /**
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Shared caps for how much tool output may enter the conversation. Every
3
+ * character returned by an executor is re-sent to the model on each
4
+ * subsequent request, so oversized outputs cost quadratically over the
5
+ * remaining run. Limits are measured in characters (UTF-16 code units),
6
+ * which tracks token cost more closely than bytes and is what JS strings
7
+ * measure exactly. Executors enforce these caps; tool descriptions
8
+ * reference them so the model pages or narrows instead of retrying.
9
+ *
10
+ * The character caps sit below MessageBuilder's 50_000 per-string backstop
11
+ * (session/services/message-builder.ts) so capped content plus the
12
+ * truncation notice passes through provider requests intact instead of
13
+ * being re-truncated into a generic marker.
14
+ */
15
+ /** Max characters of command output kept; beyond this the middle is elided. */
16
+ export declare const MAX_COMMAND_OUTPUT_CHARS = 48000;
17
+ /** Max lines returned per file read when the range is larger or absent. */
18
+ export declare const MAX_READ_LINES = 2000;
19
+ /** Max characters kept per line in file reads (defangs minified files). */
20
+ export declare const MAX_LINE_CHARS = 2000;
21
+ /** Max characters returned per file read window. */
22
+ export declare const MAX_READ_OUTPUT_CHARS = 48000;
@@ -16,3 +16,16 @@ export declare function formatReadFileQuery(request: ReadFileRequest): string;
16
16
  export declare function getReadFileRangeError(request: ReadFileRequest): string | null;
17
17
  export declare function normalizeRunCommandsInput(input: unknown): Array<string | StructuredCommandInput>;
18
18
  export declare function formatRunCommandQuery(command: string | StructuredCommandInput): string;
19
+ /**
20
+ * Max characters of the executed command echoed back in the tool result's
21
+ * `query` field. The full command already exists in the assistant tool-call
22
+ * input, so repeating it in the result only duplicates tokens in the
23
+ * provider request (expensive for large heredoc/file-generation commands).
24
+ */
25
+ export declare const RUN_COMMAND_QUERY_PREVIEW_LIMIT = 200;
26
+ /**
27
+ * Bound the command echo placed in a provider-facing tool result.
28
+ * Short commands pass through unchanged; long commands keep a short
29
+ * prefix plus a truncation note so the result is still identifiable.
30
+ */
31
+ export declare function formatRunCommandQueryPreview(command: string | StructuredCommandInput): string;
@@ -1,4 +1,5 @@
1
1
  import { type HubCommandEnvelope, type HubEventEnvelope, type HubReplyEnvelope } from "@cline/shared";
2
+ import { type HubOwnerContext } from "../discovery";
2
3
  export interface HubClientOptions {
3
4
  url: string;
4
5
  clientId?: string;
@@ -80,7 +81,7 @@ export declare function verifyHubConnection(url: string, options?: Pick<HubClien
80
81
  export declare function resolveCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
81
82
  export declare function ensureCompatibleLocalHubUrl(options?: LocalHubResolutionOptions): Promise<string | undefined>;
82
83
  export declare function requestHubShutdown(url: string, authToken?: string): Promise<boolean>;
83
- export declare function stopLocalHubServerGracefully(): Promise<boolean>;
84
+ export declare function stopLocalHubServerGracefully(owner?: HubOwnerContext): Promise<boolean>;
84
85
  export declare function restartLocalHubIfIdleAfterStartupTimeout(options: {
85
86
  url: string;
86
87
  workspaceRoot?: string;