@cline/core 0.0.38-nightly.1778113663
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/README.md +108 -0
- package/dist/ClineCore.d.ts +282 -0
- package/dist/account/cline-account-service.d.ts +37 -0
- package/dist/account/index.d.ts +3 -0
- package/dist/account/rpc.d.ts +40 -0
- package/dist/account/types.d.ts +98 -0
- package/dist/auth/bounded-ttl-cache.d.ts +13 -0
- package/dist/auth/client.d.ts +30 -0
- package/dist/auth/cline.d.ts +64 -0
- package/dist/auth/codex.d.ts +43 -0
- package/dist/auth/oca.d.ts +28 -0
- package/dist/auth/server.d.ts +54 -0
- package/dist/auth/types.d.ts +103 -0
- package/dist/auth/utils.d.ts +32 -0
- package/dist/cline-core/automation.d.ts +34 -0
- package/dist/cline-core/runtime-services.d.ts +5 -0
- package/dist/cline-core/start-input.d.ts +10 -0
- package/dist/cline-core/telemetry.d.ts +10 -0
- package/dist/cline-core/types.d.ts +221 -0
- package/dist/cron/events/cron-event-ingress.d.ts +37 -0
- package/dist/cron/reports/cron-report-writer.d.ts +40 -0
- package/dist/cron/runner/cron-materializer.d.ts +35 -0
- package/dist/cron/runner/cron-runner.d.ts +45 -0
- package/dist/cron/runner/resource-limiter.d.ts +8 -0
- package/dist/cron/schedule/scheduler.d.ts +12 -0
- package/dist/cron/service/cron-service.d.ts +56 -0
- package/dist/cron/service/schedule-command-service.d.ts +9 -0
- package/dist/cron/service/schedule-service.d.ts +98 -0
- package/dist/cron/specs/cron-reconciler.d.ts +61 -0
- package/dist/cron/specs/cron-spec-parser.d.ts +26 -0
- package/dist/cron/specs/cron-watcher.d.ts +22 -0
- package/dist/cron/store/cron-schema.d.ts +2 -0
- package/dist/cron/store/sqlite-cron-store.d.ts +240 -0
- package/dist/extensions/config/index.d.ts +7 -0
- package/dist/extensions/config/runtime-commands.d.ts +11 -0
- package/dist/extensions/config/skill-frontmatter-toggle.d.ts +11 -0
- package/dist/extensions/config/unified-config-file-watcher.d.ts +77 -0
- package/dist/extensions/config/user-instruction-config-loader.d.ts +64 -0
- package/dist/extensions/config/user-instruction-plugin.d.ts +25 -0
- package/dist/extensions/config/user-instruction-service.d.ts +23 -0
- package/dist/extensions/context/agentic-compaction.d.ts +12 -0
- package/dist/extensions/context/basic-compaction.d.ts +8 -0
- package/dist/extensions/context/compaction-shared.d.ts +60 -0
- package/dist/extensions/context/compaction.d.ts +24 -0
- package/dist/extensions/index.d.ts +5 -0
- package/dist/extensions/mcp/client.d.ts +2 -0
- package/dist/extensions/mcp/config-loader.d.ts +15 -0
- package/dist/extensions/mcp/index.d.ts +8 -0
- package/dist/extensions/mcp/manager.d.ts +23 -0
- package/dist/extensions/mcp/name-transform.d.ts +2 -0
- package/dist/extensions/mcp/policies.d.ts +14 -0
- package/dist/extensions/mcp/tools.d.ts +3 -0
- package/dist/extensions/mcp/types.d.ts +94 -0
- package/dist/extensions/plugin/plugin-config-loader.d.ts +40 -0
- package/dist/extensions/plugin/plugin-load-report.d.ts +18 -0
- package/dist/extensions/plugin/plugin-loader.d.ts +22 -0
- package/dist/extensions/plugin/plugin-module-import.d.ts +4 -0
- package/dist/extensions/plugin/plugin-sandbox.d.ts +36 -0
- package/dist/extensions/plugin/plugin-targeting.d.ts +6 -0
- package/dist/extensions/plugin-sandbox-bootstrap.js +1 -0
- package/dist/extensions/tools/constants.d.ts +24 -0
- package/dist/extensions/tools/definitions.d.ts +102 -0
- package/dist/extensions/tools/executors/apply-patch-parser.d.ts +68 -0
- package/dist/extensions/tools/executors/apply-patch.d.ts +28 -0
- package/dist/extensions/tools/executors/bash.d.ts +49 -0
- package/dist/extensions/tools/executors/editor.d.ts +31 -0
- package/dist/extensions/tools/executors/file-read.d.ts +40 -0
- package/dist/extensions/tools/executors/index.d.ts +50 -0
- package/dist/extensions/tools/executors/search.d.ts +50 -0
- package/dist/extensions/tools/executors/web-fetch.d.ts +58 -0
- package/dist/extensions/tools/helpers.d.ts +15 -0
- package/dist/extensions/tools/index.d.ts +59 -0
- package/dist/extensions/tools/model-tool-routing.d.ts +33 -0
- package/dist/extensions/tools/presets.d.ts +132 -0
- package/dist/extensions/tools/runtime.d.ts +24 -0
- package/dist/extensions/tools/schemas.d.ts +241 -0
- package/dist/extensions/tools/team/delegated-agent.d.ts +43 -0
- package/dist/extensions/tools/team/index.d.ts +2 -0
- package/dist/extensions/tools/team/multi-agent.d.ts +230 -0
- package/dist/extensions/tools/team/projections.d.ts +8 -0
- package/dist/extensions/tools/team/runtime.d.ts +4 -0
- package/dist/extensions/tools/team/spawn-agent-tool.d.ts +83 -0
- package/dist/extensions/tools/team/subagent-prompts.d.ts +3 -0
- package/dist/extensions/tools/team/team-tools.d.ts +35 -0
- package/dist/extensions/tools/types.d.ts +254 -0
- package/dist/hooks/checkpoint-hooks.d.ts +45 -0
- package/dist/hooks/hook-extension.d.ts +2 -0
- package/dist/hooks/hook-file-config.d.ts +24 -0
- package/dist/hooks/hook-file-hooks.d.ts +21 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/subprocess-runner.d.ts +21 -0
- package/dist/hooks/subprocess.d.ts +68 -0
- package/dist/hub/client/connect.d.ts +14 -0
- package/dist/hub/client/index.d.ts +88 -0
- package/dist/hub/client/session-client.d.ts +118 -0
- package/dist/hub/client/ui-client.d.ts +45 -0
- package/dist/hub/daemon/entry.d.ts +1 -0
- package/dist/hub/daemon/entry.js +720 -0
- package/dist/hub/daemon/index.d.ts +8 -0
- package/dist/hub/daemon/runtime-handlers.d.ts +12 -0
- package/dist/hub/daemon/start-shared-server.d.ts +18 -0
- package/dist/hub/discovery/defaults.d.ts +16 -0
- package/dist/hub/discovery/index.d.ts +30 -0
- package/dist/hub/discovery/workspace.d.ts +3 -0
- package/dist/hub/index.d.ts +32 -0
- package/dist/hub/index.js +717 -0
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +73 -0
- package/dist/hub/runtime-host/remote-runtime-host.d.ts +9 -0
- package/dist/hub/server/browser-websocket.d.ts +17 -0
- package/dist/hub/server/command-transport.d.ts +7 -0
- package/dist/hub/server/handlers/approval-handlers.d.ts +17 -0
- package/dist/hub/server/handlers/capability-handlers.d.ts +12 -0
- package/dist/hub/server/handlers/client-handlers.d.ts +6 -0
- package/dist/hub/server/handlers/context.d.ts +56 -0
- package/dist/hub/server/handlers/run-handlers.d.ts +5 -0
- package/dist/hub/server/handlers/session-event-projector.d.ts +7 -0
- package/dist/hub/server/handlers/session-handlers.d.ts +20 -0
- package/dist/hub/server/hub-client-contributions.d.ts +19 -0
- package/dist/hub/server/hub-notifications.d.ts +7 -0
- package/dist/hub/server/hub-schedule-events.d.ts +2 -0
- package/dist/hub/server/hub-server-logging.d.ts +2 -0
- package/dist/hub/server/hub-server-options.d.ts +55 -0
- package/dist/hub/server/hub-server-transport.d.ts +34 -0
- package/dist/hub/server/hub-session-records.d.ts +8 -0
- package/dist/hub/server/hub-websocket-server.d.ts +6 -0
- package/dist/hub/server/index.d.ts +4 -0
- package/dist/hub/server/native-transport.d.ts +16 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +715 -0
- package/dist/runtime/capabilities/index.d.ts +2 -0
- package/dist/runtime/capabilities/normalize-runtime-capabilities.d.ts +2 -0
- package/dist/runtime/capabilities/runtime-capabilities.d.ts +6 -0
- package/dist/runtime/config/agent-message-codec.d.ts +6 -0
- package/dist/runtime/config/agent-runtime-config-builder.d.ts +87 -0
- package/dist/runtime/host/history.d.ts +18 -0
- package/dist/runtime/host/host.d.ts +7 -0
- package/dist/runtime/host/local/agent-event-bridge.d.ts +29 -0
- package/dist/runtime/host/local/session-record.d.ts +6 -0
- package/dist/runtime/host/local/session-service-invoker.d.ts +4 -0
- package/dist/runtime/host/local/spawn-tool.d.ts +15 -0
- package/dist/runtime/host/local/user-files.d.ts +1 -0
- package/dist/runtime/host/local-runtime-host.d.ts +119 -0
- package/dist/runtime/host/runtime-host-support.d.ts +20 -0
- package/dist/runtime/host/runtime-host.d.ts +163 -0
- package/dist/runtime/orchestration/runtime-builder.d.ts +6 -0
- package/dist/runtime/orchestration/runtime-event-adapter.d.ts +101 -0
- package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +30 -0
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +218 -0
- package/dist/runtime/orchestration/session-runtime.d.ts +58 -0
- package/dist/runtime/orchestration/user-input-builder.d.ts +15 -0
- package/dist/runtime/safety/loop-detection.d.ts +58 -0
- package/dist/runtime/safety/mistake-tracker.d.ts +68 -0
- package/dist/runtime/safety/rules.d.ts +6 -0
- package/dist/runtime/tools/subprocess-sandbox.d.ts +43 -0
- package/dist/runtime/tools/tool-approval.d.ts +9 -0
- package/dist/runtime/turn-queue/pending-prompt-service.d.ts +64 -0
- package/dist/services/agent-events.d.ts +33 -0
- package/dist/services/config.d.ts +2 -0
- package/dist/services/global-settings.d.ts +34 -0
- package/dist/services/llms/cline-recommended-models.d.ts +19 -0
- package/dist/services/llms/configured-provider-registry.d.ts +27 -0
- package/dist/services/llms/handler-factory.d.ts +3 -0
- package/dist/services/llms/provider-defaults.d.ts +28 -0
- package/dist/services/llms/provider-settings.d.ts +247 -0
- package/dist/services/llms/runtime-config.d.ts +3 -0
- package/dist/services/llms/runtime-registry.d.ts +19 -0
- package/dist/services/llms/runtime-types.d.ts +84 -0
- package/dist/services/local-runtime-bootstrap.d.ts +45 -0
- package/dist/services/plugin-tools.d.ts +15 -0
- package/dist/services/providers/local-provider-registry.d.ts +218 -0
- package/dist/services/providers/local-provider-service.d.ts +99 -0
- package/dist/services/providers/model-source.d.ts +3 -0
- package/dist/services/session-artifacts.d.ts +17 -0
- package/dist/services/session-data.d.ts +51 -0
- package/dist/services/session-telemetry.d.ts +15 -0
- package/dist/services/storage/file-team-store.d.ts +28 -0
- package/dist/services/storage/provider-settings-legacy-migration.d.ts +38 -0
- package/dist/services/storage/provider-settings-manager.d.ts +23 -0
- package/dist/services/storage/sqlite-session-store.d.ts +30 -0
- package/dist/services/storage/sqlite-team-store.d.ts +34 -0
- package/dist/services/storage/team-store.d.ts +15 -0
- package/dist/services/telemetry/ITelemetryAdapter.d.ts +54 -0
- package/dist/services/telemetry/OpenTelemetryAdapter.d.ts +43 -0
- package/dist/services/telemetry/OpenTelemetryProvider.d.ts +83 -0
- package/dist/services/telemetry/TelemetryLoggerSink.d.ts +27 -0
- package/dist/services/telemetry/TelemetryService.d.ts +34 -0
- package/dist/services/telemetry/core-events.d.ts +198 -0
- package/dist/services/telemetry/distinct-id.d.ts +1 -0
- package/dist/services/telemetry/index.d.ts +3 -0
- package/dist/services/telemetry/index.js +1 -0
- package/dist/services/usage.d.ts +18 -0
- package/dist/services/workspace/file-indexer.d.ts +5 -0
- package/dist/services/workspace/index.d.ts +4 -0
- package/dist/services/workspace/mention-enricher.d.ts +13 -0
- package/dist/services/workspace/workspace-manager.d.ts +27 -0
- package/dist/services/workspace/workspace-manifest.d.ts +31 -0
- package/dist/services/workspace/workspace-telemetry.d.ts +18 -0
- package/dist/session/checkpoint-restore.d.ts +20 -0
- package/dist/session/models/session-graph.d.ts +15 -0
- package/dist/session/models/session-manifest.d.ts +29 -0
- package/dist/session/models/session-row.d.ts +92 -0
- package/dist/session/services/file-session-service.d.ts +8 -0
- package/dist/session/services/message-builder.d.ts +66 -0
- package/dist/session/services/persistence-service.d.ts +58 -0
- package/dist/session/services/session-service.d.ts +13 -0
- package/dist/session/session-snapshot.d.ts +57 -0
- package/dist/session/session-versioning-service.d.ts +48 -0
- package/dist/session/stores/conversation-store.d.ts +29 -0
- package/dist/session/stores/session-manifest-store.d.ts +21 -0
- package/dist/session/stores/team-persistence-store.d.ts +23 -0
- package/dist/session/team/index.d.ts +2 -0
- package/dist/session/team/team-child-session-manager.d.ts +35 -0
- package/dist/session/team/team-session-coordinator.d.ts +13 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/settings-service.d.ts +6 -0
- package/dist/settings/types.d.ts +42 -0
- package/dist/types/chat-schema.d.ts +161 -0
- package/dist/types/common.d.ts +19 -0
- package/dist/types/config.d.ts +167 -0
- package/dist/types/events.d.ts +89 -0
- package/dist/types/provider-settings.d.ts +19 -0
- package/dist/types/session.d.ts +116 -0
- package/dist/types/sessions.d.ts +28 -0
- package/dist/types/storage.d.ts +36 -0
- package/dist/types.d.ts +32 -0
- package/dist/version.d.ts +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BasicLogger } from "@cline/shared";
|
|
2
|
+
import type { ResolveCronSpecsDirOptions } from "@cline/shared/storage";
|
|
3
|
+
import type { HubScheduleRuntimeHandlers } from "../service/schedule-service";
|
|
4
|
+
import type { CronRunRecord, SqliteCronStore } from "../store/sqlite-cron-store";
|
|
5
|
+
import type { CronMaterializer } from "./cron-materializer";
|
|
6
|
+
export interface CronRunnerOptions {
|
|
7
|
+
store: SqliteCronStore;
|
|
8
|
+
materializer: CronMaterializer;
|
|
9
|
+
runtimeHandlers: HubScheduleRuntimeHandlers;
|
|
10
|
+
/** Default runtime workspace for the hub/daemon process. */
|
|
11
|
+
workspaceRoot: string;
|
|
12
|
+
/** Cron spec source/report location. Defaults to global `~/.cline/cron`. */
|
|
13
|
+
specs?: ResolveCronSpecsDirOptions;
|
|
14
|
+
logger?: BasicLogger;
|
|
15
|
+
pollIntervalMs?: number;
|
|
16
|
+
claimLeaseSeconds?: number;
|
|
17
|
+
globalMaxConcurrency?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class CronRunner {
|
|
20
|
+
private readonly store;
|
|
21
|
+
private readonly materializer;
|
|
22
|
+
private readonly options;
|
|
23
|
+
private readonly limiter;
|
|
24
|
+
private readonly claimLeaseMs;
|
|
25
|
+
private timer;
|
|
26
|
+
private started;
|
|
27
|
+
private ticking;
|
|
28
|
+
private disposed;
|
|
29
|
+
private stopping;
|
|
30
|
+
private readonly activeRuns;
|
|
31
|
+
constructor(options: CronRunnerOptions);
|
|
32
|
+
start(): Promise<void>;
|
|
33
|
+
stop(): Promise<void>;
|
|
34
|
+
dispose(): Promise<void>;
|
|
35
|
+
tick(): Promise<void>;
|
|
36
|
+
getActiveRuns(): Array<CronRunRecord & {
|
|
37
|
+
claimToken: string;
|
|
38
|
+
sessionId?: string;
|
|
39
|
+
}>;
|
|
40
|
+
private executeClaim;
|
|
41
|
+
private buildPrompt;
|
|
42
|
+
private startClaimLeaseHeartbeat;
|
|
43
|
+
private buildSystemPrompt;
|
|
44
|
+
private buildStartRequest;
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class ResourceLimiter {
|
|
2
|
+
private readonly globalMaxConcurrency;
|
|
3
|
+
private readonly activeExecutions;
|
|
4
|
+
constructor(globalMaxConcurrency: number);
|
|
5
|
+
acquire(scheduleId: string, executionId: string, maxParallel: number): boolean;
|
|
6
|
+
release(scheduleId: string, executionId: string): void;
|
|
7
|
+
getGlobalActiveCount(): number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ParsedCron {
|
|
2
|
+
minutes: number[];
|
|
3
|
+
hours: number[];
|
|
4
|
+
daysOfMonth: number[];
|
|
5
|
+
months: number[];
|
|
6
|
+
daysOfWeek: number[];
|
|
7
|
+
}
|
|
8
|
+
export declare function parseCron(pattern: string): ParsedCron;
|
|
9
|
+
export declare function validateCronPattern(pattern: string): void;
|
|
10
|
+
export declare function validateCronSchedule(pattern: string, timezone?: string, after?: number): void;
|
|
11
|
+
export declare function validateTimezone(timezone: string | undefined): void;
|
|
12
|
+
export declare function getNextCronTime(pattern: string, after: number, timezone?: string): number;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AutomationEventEnvelope, BasicLogger } from "@cline/shared";
|
|
2
|
+
import type { ResolveCronSpecsDirOptions } from "@cline/shared/storage";
|
|
3
|
+
import { type CronEventIngressResult } from "../events/cron-event-ingress";
|
|
4
|
+
import type { CronRunRecord, CronSpecRecord, ListEventLogsOptions, ListRunsOptions, ListSpecsOptions } from "../store/sqlite-cron-store";
|
|
5
|
+
import type { HubScheduleRuntimeHandlers } from "./schedule-service";
|
|
6
|
+
/**
|
|
7
|
+
* Top-level orchestrator for file-based cron automation.
|
|
8
|
+
*
|
|
9
|
+
* Wires together:
|
|
10
|
+
* - `SqliteCronStore` (cron.db)
|
|
11
|
+
* - `CronReconciler` (disk -> DB)
|
|
12
|
+
* - `CronWatcher` (cron specs directory filesystem events)
|
|
13
|
+
* - `CronMaterializer` (queue materialization)
|
|
14
|
+
* - `CronRunner` (claim + execute + report)
|
|
15
|
+
*
|
|
16
|
+
* This service is the forward path: the legacy `HubScheduleService`
|
|
17
|
+
* continues to serve programmatic schedules, while `CronService` handles
|
|
18
|
+
* everything sourced from the configured file-based cron directory.
|
|
19
|
+
*/
|
|
20
|
+
export interface CronServiceOptions {
|
|
21
|
+
/** Default runtime workspace for the hub/daemon process. */
|
|
22
|
+
workspaceRoot: string;
|
|
23
|
+
/** Cron spec source/report location. Defaults to global `~/.cline/cron`. */
|
|
24
|
+
specs?: ResolveCronSpecsDirOptions;
|
|
25
|
+
runtimeHandlers: HubScheduleRuntimeHandlers;
|
|
26
|
+
dbPath?: string;
|
|
27
|
+
logger?: BasicLogger;
|
|
28
|
+
pollIntervalMs?: number;
|
|
29
|
+
claimLeaseSeconds?: number;
|
|
30
|
+
globalMaxConcurrency?: number;
|
|
31
|
+
watcherDebounceMs?: number;
|
|
32
|
+
}
|
|
33
|
+
export declare class CronService {
|
|
34
|
+
private readonly store;
|
|
35
|
+
private readonly reconciler;
|
|
36
|
+
private readonly watcher;
|
|
37
|
+
private readonly eventIngress;
|
|
38
|
+
private readonly materializer;
|
|
39
|
+
private readonly runner;
|
|
40
|
+
private started;
|
|
41
|
+
private disposed;
|
|
42
|
+
constructor(options: CronServiceOptions);
|
|
43
|
+
start(): Promise<void>;
|
|
44
|
+
stop(): Promise<void>;
|
|
45
|
+
dispose(): Promise<void>;
|
|
46
|
+
listSpecs(options?: ListSpecsOptions): CronSpecRecord[];
|
|
47
|
+
getSpec(specId: string): CronSpecRecord | undefined;
|
|
48
|
+
listRuns(options?: ListRunsOptions): CronRunRecord[];
|
|
49
|
+
getRun(runId: string): CronRunRecord | undefined;
|
|
50
|
+
listActiveRuns(): CronRunRecord[];
|
|
51
|
+
listUpcomingRuns(limit?: number): CronRunRecord[];
|
|
52
|
+
reconcileNow(): Promise<void>;
|
|
53
|
+
ingestEvent(event: AutomationEventEnvelope): CronEventIngressResult;
|
|
54
|
+
listEventLogs(options?: ListEventLogsOptions): import("../store/sqlite-cron-store").CronEventLogRecord[];
|
|
55
|
+
getEventLog(eventId: string): import("../store/sqlite-cron-store").CronEventLogRecord | undefined;
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HubCommandEnvelope, HubReplyEnvelope } from "@cline/shared";
|
|
2
|
+
import type { HubScheduleService } from "./schedule-service";
|
|
3
|
+
export declare class HubScheduleCommandService {
|
|
4
|
+
private readonly schedules;
|
|
5
|
+
constructor(schedules: HubScheduleService);
|
|
6
|
+
handleCommand(envelope: HubCommandEnvelope): Promise<HubReplyEnvelope>;
|
|
7
|
+
private toCreateInput;
|
|
8
|
+
private toUpdateInput;
|
|
9
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { BasicLogger, ChatRunTurnRequest, ChatStartSessionArtifacts, ChatStartSessionRequest, HubScheduleCreateInput, HubScheduleUpdateInput, ScheduleExecutionRecord, ScheduleExecutionStatus, ScheduleRecord } from "@cline/shared";
|
|
2
|
+
type HubScheduleTurnResult = {
|
|
3
|
+
text: string;
|
|
4
|
+
usage?: {
|
|
5
|
+
inputTokens?: number;
|
|
6
|
+
outputTokens?: number;
|
|
7
|
+
cacheReadTokens?: number;
|
|
8
|
+
cacheWriteTokens?: number;
|
|
9
|
+
totalCost?: number;
|
|
10
|
+
};
|
|
11
|
+
inputTokens?: number;
|
|
12
|
+
outputTokens?: number;
|
|
13
|
+
iterations?: number;
|
|
14
|
+
finishReason?: string;
|
|
15
|
+
messages?: unknown[];
|
|
16
|
+
toolCalls?: Array<{
|
|
17
|
+
name: string;
|
|
18
|
+
input?: unknown;
|
|
19
|
+
output?: unknown;
|
|
20
|
+
error?: string;
|
|
21
|
+
durationMs?: number;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
export interface HubScheduleRuntimeHandlers {
|
|
25
|
+
startSession(request: ChatStartSessionRequest): Promise<{
|
|
26
|
+
sessionId: string;
|
|
27
|
+
startResult?: ChatStartSessionArtifacts;
|
|
28
|
+
}>;
|
|
29
|
+
sendSession(sessionId: string, request: ChatRunTurnRequest): Promise<{
|
|
30
|
+
result: HubScheduleTurnResult;
|
|
31
|
+
}>;
|
|
32
|
+
abortSession(sessionId: string): Promise<{
|
|
33
|
+
applied: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
stopSession(sessionId: string): Promise<{
|
|
36
|
+
applied: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export interface ActiveScheduledExecution {
|
|
40
|
+
executionId: string;
|
|
41
|
+
scheduleId: string;
|
|
42
|
+
sessionId: string;
|
|
43
|
+
startedAt: string;
|
|
44
|
+
timeoutAt?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface HubScheduleServiceOptions {
|
|
47
|
+
runtimeHandlers: HubScheduleRuntimeHandlers;
|
|
48
|
+
eventPublisher?: (eventType: string, payload: unknown) => void;
|
|
49
|
+
logger?: BasicLogger;
|
|
50
|
+
dbPath?: string;
|
|
51
|
+
pollIntervalMs?: number;
|
|
52
|
+
globalMaxConcurrency?: number;
|
|
53
|
+
claimLeaseSeconds?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface ListSchedulesOptions {
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
limit?: number;
|
|
58
|
+
tags?: string[];
|
|
59
|
+
}
|
|
60
|
+
export interface ListScheduleExecutionsOptions {
|
|
61
|
+
scheduleId?: string;
|
|
62
|
+
status?: ScheduleExecutionStatus;
|
|
63
|
+
limit?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface ScheduleExecutionStats {
|
|
66
|
+
totalRuns: number;
|
|
67
|
+
successRate: number;
|
|
68
|
+
avgDurationSeconds: number;
|
|
69
|
+
lastFailure?: ScheduleExecutionRecord;
|
|
70
|
+
}
|
|
71
|
+
export declare class HubScheduleService {
|
|
72
|
+
private readonly store;
|
|
73
|
+
private readonly materializer;
|
|
74
|
+
private readonly runner;
|
|
75
|
+
private started;
|
|
76
|
+
private disposed;
|
|
77
|
+
constructor(options: HubScheduleServiceOptions);
|
|
78
|
+
start(): Promise<void>;
|
|
79
|
+
stop(): Promise<void>;
|
|
80
|
+
dispose(): Promise<void>;
|
|
81
|
+
createSchedule(input: HubScheduleCreateInput): ScheduleRecord;
|
|
82
|
+
getSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
83
|
+
listSchedules(options?: ListSchedulesOptions): ScheduleRecord[];
|
|
84
|
+
updateSchedule(scheduleId: string, updates: HubScheduleUpdateInput): ScheduleRecord | undefined;
|
|
85
|
+
deleteSchedule(scheduleId: string): boolean;
|
|
86
|
+
pauseSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
87
|
+
resumeSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
88
|
+
triggerScheduleNow(scheduleId: string): Promise<ScheduleExecutionRecord | undefined>;
|
|
89
|
+
listScheduleExecutions(options: ListScheduleExecutionsOptions): ScheduleExecutionRecord[];
|
|
90
|
+
getScheduleStats(scheduleId: string): ScheduleExecutionStats;
|
|
91
|
+
getActiveExecutions(): ActiveScheduledExecution[];
|
|
92
|
+
getUpcomingRuns(limit?: number): Array<{
|
|
93
|
+
scheduleId: string;
|
|
94
|
+
name: string;
|
|
95
|
+
nextRunAt: string;
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CronSpecParseResult } from "@cline/shared";
|
|
2
|
+
import { type ResolveCronSpecsDirOptions } from "@cline/shared/storage";
|
|
3
|
+
import type { CronSpecRecord, SqliteCronStore, UpsertSpecResult } from "../store/sqlite-cron-store";
|
|
4
|
+
/**
|
|
5
|
+
* Scan the configured cron specs directory on disk, parse every file, and
|
|
6
|
+
* upsert spec state into the cron DB. This is the startup source of truth:
|
|
7
|
+
* watcher events are triggers to re-run reconciliation for one file, not a
|
|
8
|
+
* replacement.
|
|
9
|
+
*/
|
|
10
|
+
export interface CronReconcilerOptions {
|
|
11
|
+
store: SqliteCronStore;
|
|
12
|
+
/**
|
|
13
|
+
* Cron spec source location. Defaults to global `~/.cline/cron`.
|
|
14
|
+
* Pass `{ scope: "workspace", workspaceRoot }` later to enable
|
|
15
|
+
* workspace-level cron sources without changing reconciler internals.
|
|
16
|
+
*/
|
|
17
|
+
specs?: ResolveCronSpecsDirOptions;
|
|
18
|
+
/** @deprecated Use `specs: { scope: "workspace", workspaceRoot }`. */
|
|
19
|
+
workspaceRoot?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ReconcileChange {
|
|
22
|
+
relativePath: string;
|
|
23
|
+
result: UpsertSpecResult;
|
|
24
|
+
parse: CronSpecParseResult;
|
|
25
|
+
}
|
|
26
|
+
export interface ReconcileSummary {
|
|
27
|
+
scanned: number;
|
|
28
|
+
upserted: number;
|
|
29
|
+
invalidParses: number;
|
|
30
|
+
removed: number;
|
|
31
|
+
changes: ReconcileChange[];
|
|
32
|
+
}
|
|
33
|
+
export declare class CronReconciler {
|
|
34
|
+
private readonly store;
|
|
35
|
+
private readonly cronDir;
|
|
36
|
+
constructor(options: CronReconcilerOptions);
|
|
37
|
+
getCronDir(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Reconcile every file under the cron specs directory into the DB and mark specs
|
|
40
|
+
* whose source files no longer exist as `removed=1`.
|
|
41
|
+
*/
|
|
42
|
+
reconcileAll(): Promise<ReconcileSummary>;
|
|
43
|
+
/**
|
|
44
|
+
* Reconcile a single file (absolute path). `relativePath` is expected to
|
|
45
|
+
* be POSIX-relative to the cron specs directory. Returns the reconciliation change
|
|
46
|
+
* or undefined if the file could not be read.
|
|
47
|
+
*/
|
|
48
|
+
reconcileFile(relativePath: string, absolutePath: string): Promise<ReconcileChange | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Handle a file that disappeared from disk between reconciliations.
|
|
51
|
+
* Marks the spec as removed and cancels any queued runs for it.
|
|
52
|
+
*/
|
|
53
|
+
handleFileDeleted(spec: CronSpecRecord): void;
|
|
54
|
+
/**
|
|
55
|
+
* Refresh next_run_at for every enabled schedule spec.
|
|
56
|
+
* Used at startup to handle the "one overdue catch-up on startup then
|
|
57
|
+
* advance to next slot" policy.
|
|
58
|
+
*/
|
|
59
|
+
refreshScheduleNextRunAt(): void;
|
|
60
|
+
private applyScheduleNextRunAt;
|
|
61
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CronSpecParseResult, CronTriggerKind } from "@cline/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Markdown frontmatter parser for `.cline/cron/*.md` automation specs.
|
|
4
|
+
*
|
|
5
|
+
* Lives in @cline/core because it depends on `yaml`. The spec types
|
|
6
|
+
* themselves live in @cline/shared so other packages can consume them
|
|
7
|
+
* without pulling in a YAML parser.
|
|
8
|
+
*
|
|
9
|
+
* The parser never throws for a single bad file — it produces a
|
|
10
|
+
* `CronSpecParseResult` with an `error` message so the reconciler can record
|
|
11
|
+
* `parse_status='invalid'` durably instead of dropping state.
|
|
12
|
+
*/
|
|
13
|
+
export declare function inferTriggerKindFromPath(relativePath: string): CronTriggerKind;
|
|
14
|
+
export declare function splitFrontmatter(raw: string): {
|
|
15
|
+
frontmatter: string | undefined;
|
|
16
|
+
body: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function computeContentHash(frontmatterJson: unknown, body: string): string;
|
|
19
|
+
export interface ParseCronSpecInput {
|
|
20
|
+
relativePath: string;
|
|
21
|
+
raw: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parse a single cron spec file. Never throws; always returns a result.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseCronSpecFile(input: ParseCronSpecInput): CronSpecParseResult;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CronReconciler } from "./cron-reconciler";
|
|
2
|
+
export interface CronWatcherOptions {
|
|
3
|
+
reconciler: CronReconciler;
|
|
4
|
+
debounceMs?: number;
|
|
5
|
+
onError?: (error: unknown) => void;
|
|
6
|
+
onReconciled?: () => void | Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare class CronWatcher {
|
|
9
|
+
private readonly reconciler;
|
|
10
|
+
private readonly debounceMs;
|
|
11
|
+
private readonly onError;
|
|
12
|
+
private readonly onReconciled;
|
|
13
|
+
private watcher?;
|
|
14
|
+
private readonly pending;
|
|
15
|
+
private disposed;
|
|
16
|
+
constructor(options: CronWatcherOptions);
|
|
17
|
+
start(): void;
|
|
18
|
+
stop(): void;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
private scheduleReconcile;
|
|
21
|
+
private reconcileNow;
|
|
22
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import type { AutomationEventEnvelope, CronSpec, CronSpecExtensionKind, CronTriggerKind, HubScheduleCreateInput, HubScheduleUpdateInput } from "@cline/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Generalized cron/automation store backed by `cron.db`. Sessions stay in
|
|
4
|
+
* their own database (see @cline/shared `ensureSessionSchema`). cron_runs
|
|
5
|
+
* here absorb one-off, recurring, and event-driven work under one queue.
|
|
6
|
+
*/
|
|
7
|
+
export type CronRunStatus = "queued" | "running" | "done" | "failed" | "cancelled";
|
|
8
|
+
export type CronRunTriggerKind = "one_off" | "schedule" | "event" | "manual" | "retry";
|
|
9
|
+
export type CronParseStatus = "valid" | "invalid";
|
|
10
|
+
export type CronEventProcessingStatus = "received" | "unmatched" | "queued" | "suppressed" | "failed";
|
|
11
|
+
export interface CronSpecRecord {
|
|
12
|
+
specId: string;
|
|
13
|
+
externalId: string;
|
|
14
|
+
sourcePath: string;
|
|
15
|
+
triggerKind: CronTriggerKind;
|
|
16
|
+
sourceMtimeMs?: number;
|
|
17
|
+
sourceHash?: string;
|
|
18
|
+
parseStatus: CronParseStatus;
|
|
19
|
+
parseError?: string;
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
removed: boolean;
|
|
22
|
+
title: string;
|
|
23
|
+
prompt?: string;
|
|
24
|
+
workspaceRoot?: string;
|
|
25
|
+
scheduleExpr?: string;
|
|
26
|
+
timezone?: string;
|
|
27
|
+
eventType?: string;
|
|
28
|
+
filters?: Record<string, unknown>;
|
|
29
|
+
debounceSeconds?: number;
|
|
30
|
+
dedupeWindowSeconds?: number;
|
|
31
|
+
cooldownSeconds?: number;
|
|
32
|
+
mode?: string;
|
|
33
|
+
systemPrompt?: string;
|
|
34
|
+
providerId?: string;
|
|
35
|
+
modelId?: string;
|
|
36
|
+
maxIterations?: number;
|
|
37
|
+
timeoutSeconds?: number;
|
|
38
|
+
maxParallel?: number;
|
|
39
|
+
tools?: string[];
|
|
40
|
+
notesDirectory?: string;
|
|
41
|
+
extensions?: CronSpecExtensionKind[];
|
|
42
|
+
source?: string;
|
|
43
|
+
tags?: string[];
|
|
44
|
+
metadata?: Record<string, unknown>;
|
|
45
|
+
revision: number;
|
|
46
|
+
lastMaterializedRunId?: string;
|
|
47
|
+
lastRunAt?: string;
|
|
48
|
+
nextRunAt?: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
}
|
|
52
|
+
export interface CronRunRecord {
|
|
53
|
+
runId: string;
|
|
54
|
+
specId: string;
|
|
55
|
+
specRevision: number;
|
|
56
|
+
triggerKind: CronRunTriggerKind;
|
|
57
|
+
status: CronRunStatus;
|
|
58
|
+
claimToken?: string;
|
|
59
|
+
claimStartedAt?: string;
|
|
60
|
+
claimUntilAt?: string;
|
|
61
|
+
scheduledFor?: string;
|
|
62
|
+
triggerEventId?: string;
|
|
63
|
+
startedAt?: string;
|
|
64
|
+
completedAt?: string;
|
|
65
|
+
sessionId?: string;
|
|
66
|
+
reportPath?: string;
|
|
67
|
+
error?: string;
|
|
68
|
+
attemptCount: number;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
updatedAt: string;
|
|
71
|
+
}
|
|
72
|
+
export interface CronEventLogRecord {
|
|
73
|
+
eventId: string;
|
|
74
|
+
eventType: string;
|
|
75
|
+
source: string;
|
|
76
|
+
subject?: string;
|
|
77
|
+
occurredAt: string;
|
|
78
|
+
receivedAt: string;
|
|
79
|
+
workspaceRoot?: string;
|
|
80
|
+
dedupeKey?: string;
|
|
81
|
+
payload?: Record<string, unknown>;
|
|
82
|
+
attributes?: Record<string, unknown>;
|
|
83
|
+
processingStatus: CronEventProcessingStatus;
|
|
84
|
+
matchedSpecCount: number;
|
|
85
|
+
queuedRunCount: number;
|
|
86
|
+
suppressedCount: number;
|
|
87
|
+
error?: string;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
updatedAt: string;
|
|
90
|
+
}
|
|
91
|
+
export interface UpsertSpecInput {
|
|
92
|
+
externalId: string;
|
|
93
|
+
sourcePath: string;
|
|
94
|
+
triggerKind: CronTriggerKind;
|
|
95
|
+
sourceMtimeMs?: number;
|
|
96
|
+
sourceHash: string;
|
|
97
|
+
parseStatus: CronParseStatus;
|
|
98
|
+
parseError?: string;
|
|
99
|
+
spec?: CronSpec;
|
|
100
|
+
}
|
|
101
|
+
export interface UpsertSpecResult {
|
|
102
|
+
record: CronSpecRecord;
|
|
103
|
+
created: boolean;
|
|
104
|
+
revisionChanged: boolean;
|
|
105
|
+
}
|
|
106
|
+
export interface SqliteCronStoreOptions {
|
|
107
|
+
dbPath?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ListSpecsOptions {
|
|
110
|
+
triggerKind?: CronTriggerKind;
|
|
111
|
+
enabled?: boolean;
|
|
112
|
+
parseStatus?: CronParseStatus;
|
|
113
|
+
includeRemoved?: boolean;
|
|
114
|
+
limit?: number;
|
|
115
|
+
}
|
|
116
|
+
export interface ListRunsOptions {
|
|
117
|
+
specId?: string;
|
|
118
|
+
status?: CronRunStatus | CronRunStatus[];
|
|
119
|
+
limit?: number;
|
|
120
|
+
}
|
|
121
|
+
export interface ClaimRunOptions {
|
|
122
|
+
nowIso: string;
|
|
123
|
+
leaseMs: number;
|
|
124
|
+
limit?: number;
|
|
125
|
+
}
|
|
126
|
+
export interface ClaimedCronRun {
|
|
127
|
+
run: CronRunRecord;
|
|
128
|
+
claimToken: string;
|
|
129
|
+
claimUntilAt: string;
|
|
130
|
+
}
|
|
131
|
+
interface ClaimBoundUpdate {
|
|
132
|
+
runId: string;
|
|
133
|
+
claimToken: string;
|
|
134
|
+
}
|
|
135
|
+
export interface MaterializeScheduleRunResult {
|
|
136
|
+
queued: boolean;
|
|
137
|
+
run?: CronRunRecord;
|
|
138
|
+
nextRunAt?: string;
|
|
139
|
+
}
|
|
140
|
+
export interface EnqueueRunInput {
|
|
141
|
+
specId: string;
|
|
142
|
+
specRevision: number;
|
|
143
|
+
triggerKind: CronRunTriggerKind;
|
|
144
|
+
scheduledFor?: string;
|
|
145
|
+
triggerEventId?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface InsertEventLogResult {
|
|
148
|
+
record: CronEventLogRecord;
|
|
149
|
+
created: boolean;
|
|
150
|
+
}
|
|
151
|
+
export interface ListEventLogsOptions {
|
|
152
|
+
eventType?: string;
|
|
153
|
+
source?: string;
|
|
154
|
+
processingStatus?: CronEventProcessingStatus;
|
|
155
|
+
limit?: number;
|
|
156
|
+
}
|
|
157
|
+
export declare class SqliteCronStore {
|
|
158
|
+
private readonly db;
|
|
159
|
+
constructor(options?: SqliteCronStoreOptions);
|
|
160
|
+
close(): void;
|
|
161
|
+
getSpecBySourcePath(sourcePath: string): CronSpecRecord | undefined;
|
|
162
|
+
getSpec(specId: string): CronSpecRecord | undefined;
|
|
163
|
+
getSpecByExternalId(externalId: string): CronSpecRecord | undefined;
|
|
164
|
+
listSpecs(options?: ListSpecsOptions): CronSpecRecord[];
|
|
165
|
+
createHubSchedule(input: HubScheduleCreateInput): CronSpecRecord;
|
|
166
|
+
getHubSchedule(scheduleId: string): CronSpecRecord | undefined;
|
|
167
|
+
listHubSchedules(options?: {
|
|
168
|
+
enabled?: boolean;
|
|
169
|
+
limit?: number;
|
|
170
|
+
tags?: string[];
|
|
171
|
+
}): CronSpecRecord[];
|
|
172
|
+
updateHubSchedule(scheduleId: string, updates: HubScheduleUpdateInput): CronSpecRecord | undefined;
|
|
173
|
+
deleteHubSchedule(scheduleId: string): boolean;
|
|
174
|
+
enqueueHubScheduleRun(scheduleId: string, triggerKind?: "manual" | "retry"): CronRunRecord | undefined;
|
|
175
|
+
listEventSpecsForType(eventType: string): CronSpecRecord[];
|
|
176
|
+
upsertSpec(input: UpsertSpecInput): UpsertSpecResult;
|
|
177
|
+
private insertSpecRow;
|
|
178
|
+
private updateSpecRow;
|
|
179
|
+
markSpecRemoved(specId: string): void;
|
|
180
|
+
updateSpecNextRunAt(specId: string, nextRunAt: string | undefined): void;
|
|
181
|
+
updateSpecLastRunAt(specId: string, lastRunAt: string): void;
|
|
182
|
+
updateLastMaterializedRunId(specId: string, runId: string): void;
|
|
183
|
+
private initializeScheduleNextRun;
|
|
184
|
+
materializeDueScheduleRun(options: {
|
|
185
|
+
specId: string;
|
|
186
|
+
nowMs: number;
|
|
187
|
+
}): MaterializeScheduleRunResult;
|
|
188
|
+
getRun(runId: string): CronRunRecord | undefined;
|
|
189
|
+
insertEventLog(event: AutomationEventEnvelope, options?: {
|
|
190
|
+
receivedAtIso?: string;
|
|
191
|
+
}): InsertEventLogResult;
|
|
192
|
+
getEventLog(eventId: string): CronEventLogRecord | undefined;
|
|
193
|
+
listEventLogs(options?: ListEventLogsOptions): CronEventLogRecord[];
|
|
194
|
+
updateEventLogProcessing(eventId: string, update: {
|
|
195
|
+
status: CronEventProcessingStatus;
|
|
196
|
+
matchedSpecCount?: number;
|
|
197
|
+
queuedRunCount?: number;
|
|
198
|
+
suppressedCount?: number;
|
|
199
|
+
error?: string;
|
|
200
|
+
}): boolean;
|
|
201
|
+
listRuns(options?: ListRunsOptions): CronRunRecord[];
|
|
202
|
+
hasRecentEventRunForDedupe(options: {
|
|
203
|
+
specId: string;
|
|
204
|
+
dedupeKey: string;
|
|
205
|
+
sinceIso: string;
|
|
206
|
+
}): boolean;
|
|
207
|
+
hasRecentEventRunForSpec(options: {
|
|
208
|
+
specId: string;
|
|
209
|
+
sinceIso: string;
|
|
210
|
+
}): boolean;
|
|
211
|
+
findQueuedEventRunForDedupe(options: {
|
|
212
|
+
specId: string;
|
|
213
|
+
dedupeKey: string;
|
|
214
|
+
}): CronRunRecord | undefined;
|
|
215
|
+
updateQueuedEventRunForDebounce(options: {
|
|
216
|
+
runId: string;
|
|
217
|
+
triggerEventId: string;
|
|
218
|
+
scheduledFor: string;
|
|
219
|
+
}): CronRunRecord | undefined;
|
|
220
|
+
hasOneOffRunForRevision(specId: string, revision: number): boolean;
|
|
221
|
+
enqueueRun(input: EnqueueRunInput): CronRunRecord;
|
|
222
|
+
cancelQueuedRunsForSpec(specId: string): number;
|
|
223
|
+
claimDueRuns(options: ClaimRunOptions): ClaimedCronRun[];
|
|
224
|
+
renewClaim(runId: string, claimToken: string, leaseUntilAt: string): boolean;
|
|
225
|
+
completeRun(runId: string, update: {
|
|
226
|
+
status: "done" | "failed" | "cancelled";
|
|
227
|
+
sessionId?: string;
|
|
228
|
+
reportPath?: string;
|
|
229
|
+
error?: string;
|
|
230
|
+
completedAtIso?: string;
|
|
231
|
+
claimToken?: string;
|
|
232
|
+
}): boolean;
|
|
233
|
+
requeueRun(update: ClaimBoundUpdate & {
|
|
234
|
+
error?: string;
|
|
235
|
+
scheduledFor?: string;
|
|
236
|
+
}): boolean;
|
|
237
|
+
attachSessionIdToRun(runId: string, sessionId: string): void;
|
|
238
|
+
attachReportPathToRun(runId: string, reportPath: string): void;
|
|
239
|
+
}
|
|
240
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { AvailableRuntimeCommand, RuntimeCommandKind, } from "./runtime-commands";
|
|
2
|
+
export type { UnifiedConfigDefinition, UnifiedConfigFileCandidate, UnifiedConfigFileContext, UnifiedConfigRecord, UnifiedConfigWatcherEvent, UnifiedConfigWatcherOptions, } from "./unified-config-file-watcher";
|
|
3
|
+
export { UnifiedConfigFileWatcher } from "./unified-config-file-watcher";
|
|
4
|
+
export type { CreateInstructionWatcherOptions, CreateRulesConfigDefinitionOptions, CreateSkillsConfigDefinitionOptions, CreateWorkflowsConfigDefinitionOptions, ParseMarkdownFrontmatterResult, RuleConfig, SkillConfig, UserInstructionConfig, UserInstructionConfigType, WorkflowConfig, } from "./user-instruction-config-loader";
|
|
5
|
+
export { createRulesConfigDefinition, createSkillsConfigDefinition, createWorkflowsConfigDefinition, parseRuleConfigFromMarkdown, parseSkillConfigFromMarkdown, parseWorkflowConfigFromMarkdown, RULES_CONFIG_DIRECTORY_NAME, resolveRulesConfigSearchPaths, resolveSkillsConfigSearchPaths, resolveWorkflowsConfigSearchPaths, SKILLS_CONFIG_DIRECTORY_NAME, WORKFLOWS_CONFIG_DIRECTORY_NAME, } from "./user-instruction-config-loader";
|
|
6
|
+
export type { CreateUserInstructionConfigServiceOptions, UserInstructionConfigRecord, UserInstructionConfigService, } from "./user-instruction-service";
|
|
7
|
+
export { createUserInstructionConfigService } from "./user-instruction-service";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UserInstructionConfigWatcher } from "./user-instruction-config-loader";
|
|
2
|
+
export type RuntimeCommandKind = "skill" | "workflow";
|
|
3
|
+
export type AvailableRuntimeCommand = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
instructions: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
kind: RuntimeCommandKind;
|
|
9
|
+
};
|
|
10
|
+
export declare function listAvailableRuntimeCommandsFromWatcher(watcher: UserInstructionConfigWatcher): AvailableRuntimeCommand[];
|
|
11
|
+
export declare function resolveRuntimeSlashCommandFromWatcher(input: string, watcher: UserInstructionConfigWatcher): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ToggleSkillFrontmatterOptions {
|
|
2
|
+
filePath: string;
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface ToggleSkillFrontmatterResult {
|
|
6
|
+
filePath: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function updateSkillMarkdownEnabledState(content: string, enabled: boolean): string;
|
|
11
|
+
export declare function toggleSkillFrontmatter({ filePath, enabled, }: ToggleSkillFrontmatterOptions): Promise<ToggleSkillFrontmatterResult>;
|