@cline/core 0.0.83 → 0.0.84-nightly.1790044161

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 (34) hide show
  1. package/dist/cron/service/schedule-tool.d.ts +3 -3
  2. package/dist/extensions/composio/composio-tools-extension.d.ts +13 -0
  3. package/dist/extensions/context/compaction-shared.d.ts +9 -1
  4. package/dist/extensions/context/compaction.d.ts +6 -0
  5. package/dist/extensions/tools/team/configured-agent-tool.d.ts +1 -3
  6. package/dist/hooks/hook-file-hooks.d.ts +27 -0
  7. package/dist/hooks/subprocess-runner.d.ts +23 -0
  8. package/dist/hooks/subprocess.d.ts +10 -0
  9. package/dist/hub/client/index.d.ts +7 -3
  10. package/dist/hub/daemon/entry.js +218 -215
  11. package/dist/hub/index.js +209 -206
  12. package/dist/hub/runtime-host/hub-runtime-host.d.ts +1 -0
  13. package/dist/hub/server/handlers/session-handlers.d.ts +1 -0
  14. package/dist/index.d.ts +8 -5
  15. package/dist/index.js +236 -234
  16. package/dist/remote/remote-helper-entry.js +2 -2
  17. package/dist/remote/remote-helper.js +2 -2
  18. package/dist/runtime/host/runtime-host.d.ts +2 -0
  19. package/dist/runtime/orchestration/oauth-refresh-lock.d.ts +6 -0
  20. package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +1 -0
  21. package/dist/runtime/turn-queue/pending-prompt-service.d.ts +1 -0
  22. package/dist/services/feature-flags/FeatureFlagsService.d.ts +2 -0
  23. package/dist/services/feature-flags/cline-account-feature-flags.d.ts +5 -0
  24. package/dist/services/global-settings.d.ts +3 -3
  25. package/dist/services/llms/cline-recommended-models.d.ts +1 -0
  26. package/dist/services/llms/provider-settings.d.ts +18 -18
  27. package/dist/services/telemetry/core-events.d.ts +56 -0
  28. package/dist/services/telemetry/index.js +1 -1
  29. package/dist/session/models/session-manifest.d.ts +1 -1
  30. package/dist/session/stores/session-manifest-store.d.ts +2 -4
  31. package/dist/tasks/agenda-task-tool.d.ts +2 -2
  32. package/dist/tasks/task-tool.d.ts +5 -5
  33. package/dist/types/chat-schema.d.ts +7 -7
  34. package/package.json +4 -4
@@ -6,10 +6,10 @@ export declare const ScheduledTaskInputSchema: z.ZodObject<{
6
6
  update: "update";
7
7
  create: "create";
8
8
  list: "list";
9
- pause: "pause";
10
- resume: "resume";
11
9
  get: "get";
12
10
  delete: "delete";
11
+ pause: "pause";
12
+ resume: "resume";
13
13
  run_now: "run_now";
14
14
  }>;
15
15
  schedule_id: z.ZodOptional<z.ZodString>;
@@ -24,8 +24,8 @@ export declare const ScheduledTaskInputSchema: z.ZodObject<{
24
24
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
25
  enabled: z.ZodOptional<z.ZodBoolean>;
26
26
  mode: z.ZodOptional<z.ZodEnum<{
27
- plan: "plan";
28
27
  act: "act";
28
+ plan: "plan";
29
29
  yolo: "yolo";
30
30
  }>>;
31
31
  system_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -0,0 +1,13 @@
1
+ import type { AgentExtension, BasicLogger } from "@cline/shared";
2
+ export declare function resolveComposioToolsStatePath(accountId: string): string;
3
+ /**
4
+ * Builds the extension for the current connector state, or undefined when
5
+ * there is nothing to register (no state file, or no connected toolkit with
6
+ * tools) — sessions without connectors pay one file read.
7
+ *
8
+ * The state is read once here, at session-bootstrap time, so a session's
9
+ * tool set is frozen at start exactly like the previous plugin's was.
10
+ */
11
+ export declare function createComposioToolsExtension(options?: {
12
+ logger?: BasicLogger;
13
+ }): Promise<AgentExtension | undefined>;
@@ -8,9 +8,17 @@ export declare const DEFAULT_MAX_INPUT_TOKENS = 128000;
8
8
  export declare const CONTEXT_WINDOW_INPUT_RATIO = 0.9;
9
9
  /** Compact once the transcript consumes this share of the usable input budget. */
10
10
  export declare const COMPACTION_TRIGGER_RATIO = 0.9;
11
+ /**
12
+ * Upper bound on how far the provider's actual input count may scale the
13
+ * compaction budget down relative to the character-based estimate. Dense
14
+ * content realistically tokenizes ~2-3x denser than the 3-chars-per-token
15
+ * assumption; the cap stops a pathologically small estimate from collapsing
16
+ * the budget and compacting every turn.
17
+ */
18
+ export declare const MAX_INPUT_UNDERESTIMATE_FACTOR = 4;
11
19
  export declare const DEFAULT_TARGET_RATIO = 0.7;
12
20
  export declare const DEFAULT_PRESERVE_RECENT_TOKENS = 20000;
13
- export declare const DEFAULT_SUMMARY_MAX_OUTPUT_TOKENS = 4096;
21
+ export declare const DEFAULT_SUMMARY_MAX_OUTPUT_TOKENS = 8192;
14
22
  export declare const TOOL_RESULT_CHAR_LIMIT = 2000;
15
23
  export declare const FILE_CONTENT_CHAR_LIMIT = 2000;
16
24
  export declare const MIN_TRUNCATED_MESSAGE_TOKENS = 8;
@@ -19,6 +19,12 @@ export interface ContextPipelinePrepareTurnInput {
19
19
  * successful LLM request.
20
20
  */
21
21
  overflowRecovery?: boolean;
22
+ /**
23
+ * Actual provider-reported input tokens for the previous request this run,
24
+ * used as a floor on the char-based estimate so dense content still triggers
25
+ * compaction. See AgentPrepareTurnContext.previousRequestInputTokens.
26
+ */
27
+ previousRequestInputTokens?: number;
22
28
  emitStatusNotice?: (message: string, metadata?: Record<string, unknown>) => void;
23
29
  }
24
30
  export interface ContextPipelinePrepareTurnResult {
@@ -1,4 +1,4 @@
1
- import { type AgentEvent, type AgentTool, type AgentToolContext, type HookErrorMode, type ToolApprovalRequest, type ToolApprovalResult, type ToolPolicy } from "@cline/shared";
1
+ import { type AgentEvent, type AgentTool, type AgentToolContext, type HookErrorMode } from "@cline/shared";
2
2
  import { z } from "zod";
3
3
  import type { ConfiguredAgentConfig } from "./configured-agent-config";
4
4
  import { type DelegatedAgentConfigProvider } from "./delegated-agent";
@@ -17,8 +17,6 @@ export interface ConfiguredAgentToolConfig {
17
17
  createSubAgentTools?: (agent: ConfiguredAgentConfig, input: ConfiguredAgentInput, context: AgentToolContext) => AgentTool[] | Promise<AgentTool[]>;
18
18
  onSubAgentEvent?: (event: AgentEvent) => void;
19
19
  hookErrorMode?: HookErrorMode;
20
- toolPolicies?: Record<string, ToolPolicy>;
21
- requestToolApproval?: (request: ToolApprovalRequest) => Promise<ToolApprovalResult> | ToolApprovalResult;
22
20
  onSubAgentStart?: (context: SubAgentStartContext) => void | Promise<void>;
23
21
  onSubAgentEnd?: (context: SubAgentEndContext) => void | Promise<void>;
24
22
  }
@@ -1,4 +1,19 @@
1
1
  import type { AgentExtension, AgentHooks, BasicLogger, WorkspaceInfo } from "@cline/shared";
2
+ import { type HookEventName } from "./subprocess";
3
+ /**
4
+ * Reports how long a fire-and-forget hook actually ran, once per hook. Hosts
5
+ * use it to learn the real runtime distribution of detached hooks —
6
+ * unmeasurable while nothing awaits them — before deciding to run any of them
7
+ * blocking. `exited: false` is a censored observation (the hook was still
8
+ * running after the observation window, so it ran at least `durationMs`),
9
+ * which is what keeps the sample from covering only hooks that finish.
10
+ */
11
+ export type HookRuntimeObserver = (event: {
12
+ hookName: HookEventName;
13
+ durationMs: number;
14
+ exitCode: number | null;
15
+ exited: boolean;
16
+ }) => void;
2
17
  type HookRuntimeOptions = {
3
18
  cwd: string;
4
19
  workspacePath: string;
@@ -7,6 +22,18 @@ type HookRuntimeOptions = {
7
22
  toolCallTimeoutMs?: number;
8
23
  /** Keep asynchronous hooks attached until exit. Intended for deterministic tests. */
9
24
  detachAsyncHooks?: boolean;
25
+ /**
26
+ * Run agent_start/agent_resume hooks blocking, honoring their control
27
+ * output (cancel, contextModification). Off by default: these hooks have
28
+ * always been fire-and-forget with stdio ignored, so an existing
29
+ * long-running script would otherwise stall every run start until the
30
+ * timeout. A host that flips this on must tell hook authors that
31
+ * long-running run-start hooks need to background themselves (spawn a
32
+ * detached child and exit).
33
+ */
34
+ blockingRunStartHooks?: boolean;
35
+ /** Observes how long detached hooks run. See {@link HookRuntimeObserver}. */
36
+ onHookRuntime?: HookRuntimeObserver;
10
37
  /** Structured git + path metadata forwarded into every hook payload. */
11
38
  workspaceInfo?: WorkspaceInfo;
12
39
  };
@@ -9,6 +9,29 @@ export interface RunSubprocessEventOptions {
9
9
  pid?: number;
10
10
  detached: boolean;
11
11
  }) => void;
12
+ /**
13
+ * Reports a detached hook's runtime exactly once. The run never waits on
14
+ * this: detached hooks are fire-and-forget by contract, and this only
15
+ * observes them so hosts can measure how long they actually take.
16
+ *
17
+ * `exited: true` means the hook finished and `durationMs` is its runtime.
18
+ * `exited: false` is a censored observation: the hook was still running
19
+ * after the observation window, and `durationMs` is that window, so read
20
+ * it as "ran at least this long" and count these separately — the
21
+ * case that matters most, since those are the hooks that would stall a
22
+ * blocking run. Without it the sample would only contain hooks that
23
+ * finished.
24
+ *
25
+ * Nothing is reported if the parent exits before either happens.
26
+ */
27
+ onDetachedSettled?: (event: {
28
+ command: string[];
29
+ durationMs: number;
30
+ exitCode: number | null;
31
+ exited: boolean;
32
+ }) => void;
33
+ /** Overrides the censoring window for `onDetachedSettled`. */
34
+ detachedObservationMs?: number;
12
35
  }
13
36
  export interface RunSubprocessEventResult {
14
37
  exitCode: number | null;
@@ -49,6 +49,16 @@ export interface SubprocessHooksOptions {
49
49
  workspaceInfo?: WorkspaceInfo;
50
50
  env?: NodeJS.ProcessEnv;
51
51
  timeoutMs?: number;
52
+ /**
53
+ * Run agent_start/agent_resume hooks blocking, honoring their control
54
+ * output (cancel, contextModification). Off by default: these hooks have
55
+ * always been fire-and-forget with stdio ignored, so an existing
56
+ * long-running script would otherwise stall every run start until the
57
+ * timeout. A host that flips this on must tell hook authors that
58
+ * long-running run-start hooks need to background themselves (spawn a
59
+ * detached child and exit).
60
+ */
61
+ blockingRunStartHooks?: boolean;
52
62
  onDispatchError?: (error: Error, payload: HookEventPayload) => void;
53
63
  onDispatch?: (event: {
54
64
  payload: HookEventPayload;
@@ -1,5 +1,10 @@
1
1
  import { type HubClientRegistration, type HubCommandEnvelope, type HubEventEnvelope, type HubReplyEnvelope } from "@cline/shared";
2
2
  import { type HubOwnerContext } from "../discovery";
3
+ type HubCommandOptions = {
4
+ timeoutMs?: number | null;
5
+ /** Synchronous local guard, checked after connection before each dispatch. */
6
+ beforeDispatch?: () => void;
7
+ };
3
8
  export interface HubClientOptions {
4
9
  url: string;
5
10
  clientId?: string;
@@ -81,9 +86,7 @@ export declare class NodeHubClient {
81
86
  subscribe(listener: (event: HubEventEnvelope) => void, options?: {
82
87
  sessionId?: string;
83
88
  }): () => void;
84
- command(command: HubCommandEnvelope["command"], payload?: Record<string, unknown>, sessionId?: string, options?: {
85
- timeoutMs?: number | null;
86
- }): Promise<HubReplyEnvelope>;
89
+ command(command: HubCommandEnvelope["command"], payload?: Record<string, unknown>, sessionId?: string, options?: HubCommandOptions): Promise<HubReplyEnvelope>;
87
90
  private commandOnce;
88
91
  private recoverLocalHubTransport;
89
92
  private hasActiveSubscriptions;
@@ -154,3 +157,4 @@ export declare function restartLocalHubIfIdleAfterStartupTimeout(options: {
154
157
  workspaceRoot?: string;
155
158
  cwd?: string;
156
159
  }): Promise<string | undefined>;
160
+ export {};