@cline/core 0.0.75-nightly.1787107092 → 0.0.76

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 (47) hide show
  1. package/dist/cron/service/schedule-command-service.d.ts +6 -1
  2. package/dist/cron/service/schedule-service.d.ts +1 -0
  3. package/dist/cron/service/schedule-tool.d.ts +81 -0
  4. package/dist/cron/store/sqlite-cron-store.d.ts +1 -0
  5. package/dist/extensions/config/index.d.ts +1 -1
  6. package/dist/extensions/config/runtime-commands.d.ts +12 -1
  7. package/dist/extensions/config/user-instruction-service.d.ts +2 -2
  8. package/dist/extensions/tools/executors/bash.d.ts +32 -0
  9. package/dist/extensions/tools/executors/index.d.ts +1 -0
  10. package/dist/extensions/tools/executors/run-command-execution-controller.d.ts +16 -0
  11. package/dist/extensions/tools/index.d.ts +2 -2
  12. package/dist/extensions/tools/runtime.d.ts +9 -0
  13. package/dist/hooks/subprocess.d.ts +6 -0
  14. package/dist/hub/client/index.d.ts +4 -1
  15. package/dist/hub/client/session-client.d.ts +14 -1
  16. package/dist/hub/daemon/entry.js +369 -203
  17. package/dist/hub/index.d.ts +2 -0
  18. package/dist/hub/index.js +363 -197
  19. package/dist/hub/runtime-host/hub-runtime-host.d.ts +1 -0
  20. package/dist/hub/server/browser-websocket.d.ts +5 -2
  21. package/dist/hub/server/command-transport.d.ts +9 -2
  22. package/dist/hub/server/handlers/context.d.ts +7 -3
  23. package/dist/hub/server/handlers/run-handlers.d.ts +1 -0
  24. package/dist/hub/server/handlers/session-handlers.d.ts +4 -0
  25. package/dist/hub/server/hub-server-options.d.ts +7 -2
  26. package/dist/hub/server/hub-server-transport.d.ts +8 -1
  27. package/dist/hub/server/native-transport.d.ts +3 -3
  28. package/dist/hub/server/task-command-service.d.ts +11 -0
  29. package/dist/index.d.ts +6 -4
  30. package/dist/index.js +361 -195
  31. package/dist/runtime/host/local-runtime-host.d.ts +2 -0
  32. package/dist/runtime/host/runtime-host.d.ts +3 -0
  33. package/dist/runtime/orchestration/session-runtime.d.ts +2 -1
  34. package/dist/runtime/process-start-token.d.ts +23 -0
  35. package/dist/services/llms/cline-recommended-models.d.ts +33 -0
  36. package/dist/services/providers/local-provider-registry.d.ts +1 -1
  37. package/dist/tasks/agenda-task-api.d.ts +20 -0
  38. package/dist/tasks/agenda-task-manager.d.ts +102 -0
  39. package/dist/tasks/agenda-task-tool.d.ts +94 -0
  40. package/dist/tasks/index.d.ts +9 -0
  41. package/dist/tasks/specs/task-spec-file-store.d.ts +38 -0
  42. package/dist/tasks/specs/task-spec-parser.d.ts +65 -0
  43. package/dist/tasks/store/sqlite-task-store.d.ts +73 -0
  44. package/dist/tasks/store/task-schema.d.ts +2 -0
  45. package/dist/tasks/task-location.d.ts +14 -0
  46. package/dist/tasks/task-tool.d.ts +134 -0
  47. package/package.json +4 -4
@@ -53,6 +53,7 @@ export declare class LocalRuntimeHost implements RuntimeHost {
53
53
  private readonly pendingPromptsController;
54
54
  private readonly eventBridge;
55
55
  private readonly sessionVersioning;
56
+ private readonly runCommandExecutionController;
56
57
  constructor(options: LocalRuntimeHostOptions);
57
58
  private applyInitialOAuthCredentials;
58
59
  startSession(input: StartSessionInput): Promise<StartSessionResult>;
@@ -61,6 +62,7 @@ export declare class LocalRuntimeHost implements RuntimeHost {
61
62
  runTurn(input: SendSessionInput): Promise<AgentResult | undefined>;
62
63
  getAccumulatedUsage(sessionId: string): Promise<SessionUsageSummary | undefined>;
63
64
  abort(sessionId: string, reason?: unknown): Promise<void>;
65
+ proceedWhileRunning(sessionId: string, toolCallId?: string): Promise<number>;
64
66
  stopSession(sessionId: string): Promise<void>;
65
67
  dispose(reason?: string): Promise<void>;
66
68
  getSession(sessionId: string): Promise<SessionRecord | undefined>;
@@ -157,6 +157,9 @@ export interface SessionModelRuntimeService {
157
157
  export interface SessionConnectionRuntimeService {
158
158
  updateSessionConnection(sessionId: string, updates: SessionConnectionUpdate): Promise<void>;
159
159
  }
160
+ export interface CommandExecutionRuntimeService {
161
+ proceedWhileRunning(sessionId: string, toolCallId?: string): Promise<number>;
162
+ }
160
163
  export interface RuntimeHostSubscribeOptions {
161
164
  sessionId?: string;
162
165
  }
@@ -1,6 +1,6 @@
1
1
  import type { AgentConfig, AgentEvent, AgentHooks, AgentResult, AgentTool, BasicLogger, ITelemetryService, ModelTool, RuntimeConfigExtensionKind, ToolApprovalRequest, ToolApprovalResult } from "@cline/shared";
2
2
  import type { UserInstructionConfigService } from "../../extensions/config";
3
- import type { ToolExecutors } from "../../extensions/tools";
3
+ import type { RunCommandExecutionController, ToolExecutors } from "../../extensions/tools";
4
4
  import type { AgentTeamsRuntime, DelegatedAgentConfigProvider, SubAgentEndContext, SubAgentStartContext, TeamEvent } from "../../extensions/tools/team";
5
5
  import type { WorkspaceManager } from "../../services/workspace/workspace-manager";
6
6
  import type { CoreSessionConfig } from "../../types/config";
@@ -44,6 +44,7 @@ export interface RuntimeBuilderInput {
44
44
  pluginSkillDirectories?: ReadonlyArray<string>;
45
45
  configExtensions?: RuntimeConfigExtensionKind[];
46
46
  toolExecutors?: Partial<ToolExecutors>;
47
+ runCommandExecutionController?: RunCommandExecutionController;
47
48
  toolPolicies?: CoreSessionConfig["toolPolicies"];
48
49
  workspaceManager?: WorkspaceManager;
49
50
  logger?: BasicLogger;
@@ -0,0 +1,23 @@
1
+ export type ProcessStartTokenProbeResult = {
2
+ status: "found";
3
+ token: string;
4
+ } | {
5
+ status: "missing";
6
+ } | {
7
+ status: "unavailable";
8
+ };
9
+ export declare function parseLinuxProcessStartToken(stat: string, bootId: string): string | undefined;
10
+ /** Distinguishes an absent process from an unavailable identity probe. */
11
+ export declare function probeProcessStartToken(pid: number): ProcessStartTokenProbeResult;
12
+ /**
13
+ * Returns a token for one generation of a process ID.
14
+ *
15
+ * A PID alone is not an identity because the operating system can reuse it
16
+ * after a process exits. The token is derived from the kernel-reported process
17
+ * start time so callers can distinguish a live process from a later process
18
+ * that inherited the same PID.
19
+ */
20
+ export declare function getProcessStartToken(pid: number): string | undefined;
21
+ /** Non-blocking probe for latency-sensitive runtime paths. */
22
+ export declare function probeProcessStartTokenAsync(pid: number): Promise<ProcessStartTokenProbeResult>;
23
+ export declare function getProcessStartTokenAsync(pid: number): Promise<string | undefined>;
@@ -1,3 +1,4 @@
1
+ import { type ProviderModel } from "@cline/shared";
1
2
  import { ProviderSettingsManager } from "../storage/provider-settings-manager";
2
3
  import type { ModelInfo } from "./provider-settings";
3
4
  export interface ClineRecommendedModel {
@@ -26,4 +27,36 @@ export interface FetchClineRecommendedModelsOptions {
26
27
  }
27
28
  export declare const FALLBACK_CLINE_RECOMMENDED_MODELS: ClineRecommendedModelsData;
28
29
  export declare function fetchClineRecommendedModels(options?: FetchClineRecommendedModelsOptions): Promise<ClineRecommendedModelsData>;
30
+ /**
31
+ * `fetchClineRecommendedModels` with a shared in-memory cache, for callers on
32
+ * the model-list path (every picker open) where a per-call network round-trip
33
+ * — or its 5s offline timeout — is unacceptable. The bundled offline fallback
34
+ * is cached too: paying the timeout once per TTL beats paying it on every
35
+ * model list while offline, and a recovered network is picked up within the
36
+ * TTL.
37
+ */
38
+ export declare function getCachedClineRecommendedModels(options?: FetchClineRecommendedModelsOptions): Promise<ClineRecommendedModelsData>;
39
+ /**
40
+ * Synchronous, never-blocking view of the feed: the cached live data when
41
+ * fresh, otherwise the bundled fallback. For callers that build model lists
42
+ * eagerly and must not wait on the network (the provider catalog at startup),
43
+ * so even a cold boot renders tiered sections instead of a flat list. The
44
+ * async `getCachedClineRecommendedModels` path refreshes the cache, after
45
+ * which peeks serve live data for the TTL.
46
+ */
47
+ export declare function peekClineRecommendedModels(): ClineRecommendedModelsData;
48
+ export declare function resetClineRecommendedModelsCacheForTests(): void;
49
+ /**
50
+ * Stamps recommended-feed tiers onto a provider's model list so clients can
51
+ * render Recommended/Free/Subscribed sections straight off `ProviderModel`
52
+ * instead of fetching and joining the feed themselves. Feed ids are matched
53
+ * through the Vercel/OpenRouter alias rules (the feed can spell a model
54
+ * differently from the catalog), with a fallback on the id's slug after "/"
55
+ * when that slug is unambiguous — the feed and the catalog can carry
56
+ * different vendor prefixes for the same model (`kwaipilot/kat-coder-pro`
57
+ * vs `cline-free/kat-coder-pro`), most visibly when the bundled fallback
58
+ * feed is stamped against a live-fetched catalog. Models the feed does not
59
+ * mention are returned unchanged; unknown providers pass through untouched.
60
+ */
61
+ export declare function applyClineFeaturedModels(providerId: string, models: ProviderModel[], data: ClineRecommendedModelsData): ProviderModel[];
29
62
  export {};
@@ -325,7 +325,7 @@ export declare function readModelsFileSync(filePath: string): StoredModelsFile;
325
325
  export declare function readModelsFile(filePath: string): Promise<StoredModelsFile>;
326
326
  export declare function writeModelsFileSync(filePath: string, state: StoredModelsFile): void;
327
327
  export declare function writeModelsFile(filePath: string, state: StoredModelsFile): Promise<void>;
328
- export declare function toProviderModel(modelId: string, info: Pick<ModelInfo, "name" | "contextWindow" | "capabilities" | "thinkingConfig" | "operation" | "operationModes" | "modalities">): ProviderModel;
328
+ export declare function toProviderModel(modelId: string, info: Pick<ModelInfo, "name" | "description" | "contextWindow" | "capabilities" | "thinkingConfig" | "operation" | "operationModes" | "modalities">): ProviderModel;
329
329
  export declare function registerProviderSettingsProvider(settings: ProviderSettings): void;
330
330
  export declare function registerConfiguredProvidersFromSettings(state: StoredProviderSettings): void;
331
331
  /**
@@ -0,0 +1,20 @@
1
+ import type { AgendaAutomationPolicy, AgendaTaskActor, AgendaTaskCreateInput, AgendaTaskListInput, AgendaTaskRecord, AgendaTaskRunRecord, AgendaTaskUpdateInput } from "@cline/shared";
2
+ /**
3
+ * The single mutation boundary for agenda tasks. File reconciliation, Hub
4
+ * commands, and agent tools all route through this interface so lifecycle
5
+ * invariants are enforced in one place.
6
+ */
7
+ export interface AgendaTaskManagerApi {
8
+ createTask(input: AgendaTaskCreateInput): Promise<AgendaTaskRecord>;
9
+ listTasks(input?: AgendaTaskListInput): Promise<AgendaTaskRecord[]>;
10
+ getTask(taskId: string): Promise<AgendaTaskRecord | undefined>;
11
+ updateTask(input: AgendaTaskUpdateInput): Promise<AgendaTaskRecord>;
12
+ approveTask(taskId: string, actor: AgendaTaskActor, expectedRevision: number): Promise<AgendaTaskRecord>;
13
+ cancelTask(taskId: string, actor: AgendaTaskActor, expectedRevision: number, reason?: string): Promise<AgendaTaskRecord>;
14
+ runTask(taskId: string, actor: AgendaTaskActor, expectedRevision: number, requestedByClientId?: string): Promise<{
15
+ task: AgendaTaskRecord;
16
+ run?: AgendaTaskRunRecord;
17
+ }>;
18
+ getAutomationPolicy(scopeKey?: string): Promise<AgendaAutomationPolicy>;
19
+ setAutomationPolicy(policy: Omit<AgendaAutomationPolicy, "updatedAt">, actor: AgendaTaskActor): Promise<AgendaAutomationPolicy>;
20
+ }
@@ -0,0 +1,102 @@
1
+ import type { AgendaAutomationPolicy, AgendaTaskActor, AgendaTaskCreateInput, AgendaTaskListInput, AgendaTaskRecord, AgendaTaskRunRecord, AgendaTaskUpdateInput, BasicLogger } from "@cline/shared";
2
+ import type { AgendaTaskManagerApi } from "./agenda-task-api";
3
+ import { SqliteAgendaTaskStore } from "./store/sqlite-task-store";
4
+ export type AgendaTaskManagerEventName = "task.created" | "task.updated" | "task.deleted" | "task.run.started" | "task.run.completed" | "task.run.failed" | "task.automation.updated";
5
+ export interface AgendaTaskRuntimeResult {
6
+ status: "completed" | "failed" | "cancelled";
7
+ summary?: string;
8
+ error?: string;
9
+ }
10
+ export interface AgendaTaskRuntime {
11
+ isInteractiveClientAvailable?(): boolean;
12
+ startSession(task: AgendaTaskRecord, run: AgendaTaskRunRecord, requestedByClientId?: string, options?: {
13
+ unattended: boolean;
14
+ }): Promise<{
15
+ sessionId: string;
16
+ }>;
17
+ runSession(sessionId: string, task: AgendaTaskRecord, run: AgendaTaskRunRecord): Promise<AgendaTaskRuntimeResult>;
18
+ abortSession(sessionId: string, reason: string): Promise<void>;
19
+ }
20
+ export interface AgendaTaskManagerOptions {
21
+ runtime: AgendaTaskRuntime;
22
+ store?: SqliteAgendaTaskStore;
23
+ dbPath?: string;
24
+ globalSpecsDir?: string;
25
+ watcherDebounceMs?: number;
26
+ watchFiles?: boolean;
27
+ logger?: BasicLogger;
28
+ publish?: (event: AgendaTaskManagerEventName, payload: Record<string, unknown>, sessionId?: string) => void;
29
+ }
30
+ /** Hub-owned lifecycle coordinator and the only operational task writer. */
31
+ export declare class AgendaTaskManager implements AgendaTaskManagerApi {
32
+ private readonly runtime;
33
+ private readonly store;
34
+ private readonly ownsStore;
35
+ private readonly globalSpecsDir?;
36
+ private readonly watcherDebounceMs;
37
+ private readonly watchFiles;
38
+ private readonly logger;
39
+ private readonly publishEvent;
40
+ private readonly scopes;
41
+ private readonly activeRuns;
42
+ private readonly backgroundRuns;
43
+ private maintenanceTimer?;
44
+ private readonly queuedAutomationScopes;
45
+ private automationPumping;
46
+ private automationPolicyGeneration;
47
+ private started;
48
+ private disposed;
49
+ constructor(options: AgendaTaskManagerOptions);
50
+ start(): Promise<void>;
51
+ dispose(): Promise<void>;
52
+ createTask(input: AgendaTaskCreateInput): Promise<AgendaTaskRecord>;
53
+ listTasks(input?: AgendaTaskListInput): Promise<AgendaTaskRecord[]>;
54
+ getTask(taskId: string): Promise<AgendaTaskRecord | undefined>;
55
+ updateTask(input: AgendaTaskUpdateInput): Promise<AgendaTaskRecord>;
56
+ approveTask(taskId: string, actor: AgendaTaskActor, expectedRevision: number): Promise<AgendaTaskRecord>;
57
+ cancelTask(taskId: string, actor: AgendaTaskActor, expectedRevision: number, reason?: string): Promise<AgendaTaskRecord>;
58
+ runTask(taskId: string, actor: AgendaTaskActor, expectedRevision: number, requestedByClientId?: string): Promise<{
59
+ task: AgendaTaskRecord;
60
+ run?: AgendaTaskRunRecord;
61
+ }>;
62
+ getAutomationPolicy(scopeKey?: string): Promise<AgendaAutomationPolicy>;
63
+ setAutomationPolicy(policy: Omit<AgendaAutomationPolicy, "updatedAt">, actor: AgendaTaskActor): Promise<AgendaAutomationPolicy>;
64
+ /** Re-evaluate auto-start work after Hub client readiness changes. */
65
+ notifyAutomationReadinessChanged(): void;
66
+ private finishRun;
67
+ private finishRunFailure;
68
+ private ensureScope;
69
+ private reconcileScope;
70
+ private reconcileSourceForProjection;
71
+ private reconcileFileStore;
72
+ private expireTasks;
73
+ private expireTask;
74
+ private isExpired;
75
+ private recoverInterruptedRuns;
76
+ private queueAutomation;
77
+ private pumpAutomation;
78
+ private canAutomaticallyApprove;
79
+ private taskChainDepth;
80
+ private fileStoreForTask;
81
+ /**
82
+ * Approval is bound to the current user-editable Markdown intent, not just
83
+ * the last SQLite projection. Reconcile synchronously to close the watcher
84
+ * debounce window, then fail closed if the source is missing, malformed, or
85
+ * still differs from the projection that will be approved/executed.
86
+ */
87
+ private refreshAndVerifyTaskIntent;
88
+ private requireTask;
89
+ private assertRevision;
90
+ private publish;
91
+ /**
92
+ * fs.watch must be handed the fully resolved form of a path: on Windows,
93
+ * libuv aborts the entire process (fs-event.c assertion) when the watched
94
+ * path contains 8.3 short components such as C:\Users\RUNNER~1, because
95
+ * event filenames come back in long form and fail its prefix check. When
96
+ * the path cannot be resolved, going without the watcher is safer than
97
+ * handing libuv the unresolved path.
98
+ */
99
+ private resolveWatchRoot;
100
+ private logError;
101
+ private assertUsable;
102
+ }
@@ -0,0 +1,94 @@
1
+ import type { AgentTool, GatewayModelSelection, ITelemetryService } from "@cline/shared";
2
+ import { z } from "zod";
3
+ import type { AgendaTaskManagerApi } from "./agenda-task-api";
4
+ export declare const TodoTaskInputSchema: z.ZodObject<{
5
+ operation: z.ZodEnum<{
6
+ update: "update";
7
+ create: "create";
8
+ list: "list";
9
+ get: "get";
10
+ }>;
11
+ task_id: z.ZodOptional<z.ZodString>;
12
+ expected_revision: z.ZodOptional<z.ZodNumber>;
13
+ type: z.ZodOptional<z.ZodEnum<{
14
+ handoff: "handoff";
15
+ suggestion: "suggestion";
16
+ "follow-up": "follow-up";
17
+ todo: "todo";
18
+ idea: "idea";
19
+ reminder: "reminder";
20
+ }>>;
21
+ title: z.ZodOptional<z.ZodString>;
22
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ instructions: z.ZodOptional<z.ZodString>;
24
+ scope: z.ZodOptional<z.ZodEnum<{
25
+ workspace: "workspace";
26
+ global: "global";
27
+ }>>;
28
+ workspace_root: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ cwd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
+ resource_paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
31
+ priority: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>;
32
+ assignee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
+ model_selection: z.ZodOptional<z.ZodNullable<z.ZodObject<{
34
+ provider_id: z.ZodString;
35
+ model_id: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>>>;
37
+ mode: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
38
+ plan: "plan";
39
+ act: "act";
40
+ yolo: "yolo";
41
+ }>>>;
42
+ system_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
+ max_iterations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
44
+ timeout_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
45
+ available_at: z.ZodOptional<z.ZodString>;
46
+ expires_at: z.ZodOptional<z.ZodString>;
47
+ automation_eligible: z.ZodOptional<z.ZodBoolean>;
48
+ statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
49
+ failed: "failed";
50
+ completed: "completed";
51
+ in_progress: "in_progress";
52
+ cancelled: "cancelled";
53
+ approved: "approved";
54
+ pending_approval: "pending_approval";
55
+ expired: "expired";
56
+ }>>>;
57
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
58
+ handoff: "handoff";
59
+ suggestion: "suggestion";
60
+ "follow-up": "follow-up";
61
+ todo: "todo";
62
+ idea: "idea";
63
+ reminder: "reminder";
64
+ }>>>;
65
+ priorities: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>>;
66
+ limit: z.ZodOptional<z.ZodNumber>;
67
+ }, z.core.$strip>;
68
+ export type TodoTaskInput = z.infer<typeof TodoTaskInputSchema>;
69
+ export interface AgendaTaskSessionDefaults {
70
+ workspaceRoot?: string;
71
+ cwd?: string;
72
+ modelSelection?: GatewayModelSelection;
73
+ originTaskId?: string;
74
+ }
75
+ export interface TodoTaskOperationOptions {
76
+ manager: AgendaTaskManagerApi;
77
+ telemetry?: ITelemetryService;
78
+ resolveSessionDefaults: (sessionId: string) => Promise<AgendaTaskSessionDefaults | undefined>;
79
+ }
80
+ export type TodoTaskResult = {
81
+ ok: true;
82
+ operation: TodoTaskInput["operation"];
83
+ task?: Awaited<ReturnType<AgendaTaskManagerApi["getTask"]>>;
84
+ tasks?: Awaited<ReturnType<AgendaTaskManagerApi["listTasks"]>>;
85
+ } | {
86
+ ok: false;
87
+ operation?: TodoTaskInput["operation"];
88
+ error: {
89
+ code: string;
90
+ message: string;
91
+ };
92
+ };
93
+ /** Execute a Todo operation while preserving Agenda scope and authority rules. */
94
+ export declare function executeTodoTaskOperation(options: TodoTaskOperationOptions, rawInput: unknown, context: Parameters<AgentTool<TodoTaskInput, TodoTaskResult>["execute"]>[1]): Promise<TodoTaskResult>;
@@ -0,0 +1,9 @@
1
+ export * from "./agenda-task-api";
2
+ export * from "./agenda-task-manager";
3
+ export * from "./agenda-task-tool";
4
+ export * from "./specs/task-spec-file-store";
5
+ export * from "./specs/task-spec-parser";
6
+ export * from "./store/sqlite-task-store";
7
+ export * from "./store/task-schema";
8
+ export * from "./task-location";
9
+ export * from "./task-tool";
@@ -0,0 +1,38 @@
1
+ import type { AgendaTaskScope } from "@cline/shared";
2
+ import { type AgendaTaskSpec, type AgendaTaskSpecParseResult, type AgendaTaskSpecWriteInput } from "./task-spec-parser";
3
+ export interface AgendaTaskSpecFileStoreOptions {
4
+ scope: AgendaTaskScope;
5
+ workspaceRoot?: string;
6
+ taskSpecsDir?: string;
7
+ }
8
+ export interface WriteAgendaTaskSpecOptions {
9
+ /** Existing path or a filename under this store's directory. */
10
+ specPath?: string;
11
+ /** Refuse to replace a file whose parsed content changed since it was read. */
12
+ expectedContentHash?: string;
13
+ /** Atomically fail instead of replacing an existing target. */
14
+ createOnly?: boolean;
15
+ }
16
+ export type WrittenAgendaTaskSpec = AgendaTaskSpec & {
17
+ taskId: string;
18
+ };
19
+ export declare class AgendaTaskSpecFileStore {
20
+ readonly specsDir: string;
21
+ readonly scope: AgendaTaskScope;
22
+ readonly workspaceRoot?: string;
23
+ constructor(options: AgendaTaskSpecFileStoreOptions);
24
+ listSpecPaths(): string[];
25
+ listSpecs(): AgendaTaskSpecParseResult[];
26
+ readSpec(specPath: string): AgendaTaskSpecParseResult;
27
+ writeSpec(input: AgendaTaskSpecWriteInput, options?: WriteAgendaTaskSpecOptions): WrittenAgendaTaskSpec;
28
+ /** Resolve the canonical target before a manager reserves it in SQLite. */
29
+ resolveWritePath(taskId: string, specPath?: string): string;
30
+ /** Validate the root both before and after creating missing directories. */
31
+ ensureSpecsDir(): void;
32
+ deleteSpec(specPath: string, options?: {
33
+ expectedContentHash?: string;
34
+ }): boolean;
35
+ private assertExpectedContent;
36
+ private assertSpecsDirSafe;
37
+ private resolveSpecPath;
38
+ }
@@ -0,0 +1,65 @@
1
+ import type { AgendaTaskActor, AgendaTaskCreateInput, AgendaTaskPriority, AgendaTaskScope, AgendaTaskType, GatewayModelSelection } from "@cline/shared";
2
+ export interface AgendaTaskSpec {
3
+ taskId?: string;
4
+ type: AgendaTaskType;
5
+ title: string;
6
+ description?: string;
7
+ instructions: string;
8
+ scope: AgendaTaskScope;
9
+ workspaceRoot?: string;
10
+ cwd?: string;
11
+ resourcePaths: string[];
12
+ priority: AgendaTaskPriority;
13
+ assignee?: string;
14
+ modelSelection?: GatewayModelSelection;
15
+ mode?: "act" | "plan" | "yolo";
16
+ systemPrompt?: string;
17
+ maxIterations?: number;
18
+ timeoutSeconds?: number;
19
+ availableAt?: string;
20
+ expiresAt: string;
21
+ automationEligible: boolean;
22
+ specPath: string;
23
+ contentHash: string;
24
+ }
25
+ export interface ParseAgendaTaskSpecInput {
26
+ specPath: string;
27
+ raw: string;
28
+ scope: AgendaTaskScope;
29
+ workspaceRoot?: string;
30
+ }
31
+ export type AgendaTaskSpecParseResult = {
32
+ ok: true;
33
+ specPath: string;
34
+ contentHash: string;
35
+ spec: AgendaTaskSpec;
36
+ } | {
37
+ ok: false;
38
+ specPath: string;
39
+ contentHash: string;
40
+ error: string;
41
+ };
42
+ export interface AgendaTaskSpecWriteInput {
43
+ taskId: string;
44
+ type: AgendaTaskType;
45
+ title: string;
46
+ description?: string;
47
+ instructions: string;
48
+ cwd?: string;
49
+ resourcePaths?: string[];
50
+ priority?: AgendaTaskPriority;
51
+ assignee?: string;
52
+ modelSelection?: GatewayModelSelection;
53
+ mode?: "act" | "plan" | "yolo";
54
+ systemPrompt?: string;
55
+ maxIterations?: number;
56
+ timeoutSeconds?: number;
57
+ availableAt?: string;
58
+ expiresAt: string;
59
+ automationEligible?: boolean;
60
+ }
61
+ /** Parse one task Markdown file without throwing for invalid user content. */
62
+ export declare function parseAgendaTaskSpec(input: ParseAgendaTaskSpecInput): AgendaTaskSpecParseResult;
63
+ /** Render the canonical, user-editable task spec representation. */
64
+ export declare function serializeAgendaTaskSpec(input: AgendaTaskSpecWriteInput): string;
65
+ export declare function agendaTaskSpecToCreateInput(spec: AgendaTaskSpec, createdBy: AgendaTaskActor): AgendaTaskCreateInput;
@@ -0,0 +1,73 @@
1
+ import type { AgendaAutomationPolicy, AgendaTaskActor, AgendaTaskCreateInput, AgendaTaskListInput, AgendaTaskRecord, AgendaTaskRunRecord, AgendaTaskRunStatus, AgendaTaskStatus, AgendaTaskUpdateInput } from "@cline/shared";
2
+ export interface SqliteAgendaTaskStoreOptions {
3
+ dbPath?: string;
4
+ }
5
+ export declare class AgendaTaskRevisionConflictError extends Error {
6
+ readonly current: AgendaTaskRecord;
7
+ constructor(current: AgendaTaskRecord);
8
+ }
9
+ export interface AgendaTaskStatePatch {
10
+ status?: AgendaTaskStatus;
11
+ approvedRevision?: number | null;
12
+ currentRunId?: string | null;
13
+ lastRunId?: string | null;
14
+ lastSessionId?: string | null;
15
+ specPath?: string | null;
16
+ error?: string | null;
17
+ completedAt?: string | null;
18
+ archivedAt?: string | null;
19
+ updatedBy?: AgendaTaskActor;
20
+ }
21
+ export interface CreateAgendaTaskRunInput {
22
+ taskId: string;
23
+ taskRevision: number;
24
+ status?: AgendaTaskRunStatus;
25
+ claimToken?: string;
26
+ claimUntilAt?: string;
27
+ requestedByClientId?: string;
28
+ sessionId?: string;
29
+ claimedAt?: string;
30
+ }
31
+ export interface UpdateAgendaTaskRunInput {
32
+ status?: AgendaTaskRunStatus;
33
+ claimToken?: string | null;
34
+ claimUntilAt?: string | null;
35
+ requestedByClientId?: string | null;
36
+ sessionId?: string | null;
37
+ startedAt?: string | null;
38
+ completedAt?: string | null;
39
+ resultSummary?: string | null;
40
+ error?: string | null;
41
+ }
42
+ export interface ListAgendaTaskRunsInput {
43
+ taskId?: string;
44
+ status?: AgendaTaskRunStatus | AgendaTaskRunStatus[];
45
+ sessionId?: string;
46
+ limit?: number;
47
+ }
48
+ export declare class SqliteAgendaTaskStore {
49
+ private readonly db;
50
+ constructor(options?: SqliteAgendaTaskStoreOptions);
51
+ close(): void;
52
+ createTask(input: AgendaTaskCreateInput): AgendaTaskRecord;
53
+ getTask(taskId: string): AgendaTaskRecord | undefined;
54
+ getTaskBySpecPath(specPath: string): AgendaTaskRecord | undefined;
55
+ /**
56
+ * Return every workspace that has ever owned a task. Archived rows are
57
+ * intentionally included so the Hub can restore file watchers after a restart.
58
+ */
59
+ listWorkspaceRoots(): string[];
60
+ listTasks(input?: AgendaTaskListInput): AgendaTaskRecord[];
61
+ /** Apply user-editable fields, increment revision, and revoke old approval. */
62
+ updateTask(input: AgendaTaskUpdateInput): AgendaTaskRecord | undefined;
63
+ /** Mutate manager-owned lifecycle fields without changing the task revision. */
64
+ updateTaskState(taskId: string, patch: AgendaTaskStatePatch, expectedRevision?: number): AgendaTaskRecord | undefined;
65
+ deleteTask(taskId: string): boolean;
66
+ createRun(input: CreateAgendaTaskRunInput): AgendaTaskRunRecord;
67
+ getRun(runId: string): AgendaTaskRunRecord | undefined;
68
+ updateRun(runId: string, input: UpdateAgendaTaskRunInput): AgendaTaskRunRecord | undefined;
69
+ listRuns(input?: ListAgendaTaskRunsInput): AgendaTaskRunRecord[];
70
+ getAutomationPolicy(scopeKey?: string): AgendaAutomationPolicy;
71
+ listAutomationPolicies(): AgendaAutomationPolicy[];
72
+ setAutomationPolicy(input: Omit<AgendaAutomationPolicy, "updatedAt">): AgendaAutomationPolicy;
73
+ }
@@ -0,0 +1,2 @@
1
+ import type { SqliteDb } from "@cline/shared/db";
2
+ export declare function ensureAgendaTaskSchema(db: SqliteDb): void;
@@ -0,0 +1,14 @@
1
+ import type { AgendaTaskScope } from "@cline/shared";
2
+ export interface AgendaTaskLocationInput {
3
+ scope: AgendaTaskScope;
4
+ workspaceRoot?: string;
5
+ cwd?: string;
6
+ resourcePaths?: readonly string[];
7
+ }
8
+ export interface NormalizedAgendaTaskLocation {
9
+ workspaceRoot?: string;
10
+ cwd?: string;
11
+ resourcePaths: string[];
12
+ }
13
+ /** Enforce the queue's global/chat and workspace filesystem boundaries. */
14
+ export declare function normalizeAgendaTaskLocation(input: AgendaTaskLocationInput): NormalizedAgendaTaskLocation;