@sctg/cline-shared 3.84.0-beta.20260524130712
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 +47 -0
- package/dist/agent.d.ts +388 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/types.d.ts +967 -0
- package/dist/automation/index.d.ts +3 -0
- package/dist/automation/index.js +65 -0
- package/dist/automation/schemas.d.ts +89 -0
- package/dist/automation/types.d.ts +151 -0
- package/dist/connectors/events.d.ts +93 -0
- package/dist/connectors/options.d.ts +174 -0
- package/dist/cron/cron-spec-types.d.ts +94 -0
- package/dist/cron/index.d.ts +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.js +80 -0
- package/dist/db/sqlite-db.d.ts +24 -0
- package/dist/dispose.d.ts +13 -0
- package/dist/extensions/context.d.ts +76 -0
- package/dist/extensions/contribution-registry.d.ts +195 -0
- package/dist/extensions/plugin.d.ts +1 -0
- package/dist/hooks/contracts.d.ts +9 -0
- package/dist/hooks/events.d.ts +194 -0
- package/dist/hub.d.ts +470 -0
- package/dist/index.browser.d.ts +61 -0
- package/dist/index.browser.js +76 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.js +163 -0
- package/dist/llms/ai-sdk-format.d.ts +55 -0
- package/dist/llms/gateway.d.ts +145 -0
- package/dist/llms/messages.d.ts +149 -0
- package/dist/llms/model-info.d.ts +120 -0
- package/dist/llms/reasoning-effort.d.ts +21 -0
- package/dist/llms/requests.d.ts +2 -0
- package/dist/llms/tokens.d.ts +7 -0
- package/dist/llms/tools.d.ts +86 -0
- package/dist/logging/logger.d.ts +37 -0
- package/dist/parse/error.d.ts +2 -0
- package/dist/parse/headers/utils.d.ts +1 -0
- package/dist/parse/json.d.ts +3 -0
- package/dist/parse/shell.d.ts +2 -0
- package/dist/parse/string.d.ts +4 -0
- package/dist/parse/time.d.ts +9 -0
- package/dist/parse/zod.d.ts +12 -0
- package/dist/prompt/cline.d.ts +24 -0
- package/dist/prompt/format.d.ts +11 -0
- package/dist/prompt/system.d.ts +2 -0
- package/dist/remote-config/artifact-store.d.ts +13 -0
- package/dist/remote-config/blob-storage.d.ts +47 -0
- package/dist/remote-config/bundle.d.ts +136 -0
- package/dist/remote-config/constants.d.ts +5 -0
- package/dist/remote-config/index.d.ts +9 -0
- package/dist/remote-config/index.js +76 -0
- package/dist/remote-config/materializer.d.ts +4 -0
- package/dist/remote-config/paths.d.ts +10 -0
- package/dist/remote-config/runtime.d.ts +20 -0
- package/dist/remote-config/schema.d.ts +408 -0
- package/dist/remote-config/telemetry.d.ts +9 -0
- package/dist/rpc/index.d.ts +5 -0
- package/dist/rpc/runtime.d.ts +322 -0
- package/dist/rpc/team-progress.d.ts +53 -0
- package/dist/runtime/build-env.d.ts +13 -0
- package/dist/runtime/cline-environment.d.ts +17 -0
- package/dist/runtime/hub-daemon-env.d.ts +2 -0
- package/dist/services/telemetry-config.d.ts +6 -0
- package/dist/services/telemetry.d.ts +133 -0
- package/dist/session/hook-context.d.ts +12 -0
- package/dist/session/index.d.ts +1 -0
- package/dist/session/records.d.ts +31 -0
- package/dist/session/runtime-config.d.ts +26 -0
- package/dist/session/runtime-env.d.ts +8 -0
- package/dist/session/workspace.d.ts +28 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.js +1 -0
- package/dist/storage/path-resolution.d.ts +11 -0
- package/dist/storage/paths.d.ts +86 -0
- package/dist/team/index.d.ts +2 -0
- package/dist/team/schema.d.ts +411 -0
- package/dist/team/types.d.ts +196 -0
- package/dist/tools/create.d.ts +22 -0
- package/dist/types/auth.d.ts +20 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/vcr.d.ts +14 -0
- package/dist/vcr.d.ts +41 -0
- package/package.json +63 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AutomationOneOffFrontmatterSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
title: z.ZodOptional<z.ZodString>;
|
|
5
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
6
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
7
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
8
|
+
modelSelection: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
providerId: z.ZodString;
|
|
10
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
13
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
act: "act";
|
|
15
|
+
plan: "plan";
|
|
16
|
+
yolo: "yolo";
|
|
17
|
+
zen: "zen";
|
|
18
|
+
}>>;
|
|
19
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
maxIterations: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export declare const AutomationScheduleFrontmatterSchema: z.ZodObject<{
|
|
26
|
+
schedule: z.ZodString;
|
|
27
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
28
|
+
id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
title: z.ZodOptional<z.ZodString>;
|
|
30
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
31
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
32
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
33
|
+
modelSelection: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
providerId: z.ZodString;
|
|
35
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
38
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
act: "act";
|
|
40
|
+
plan: "plan";
|
|
41
|
+
yolo: "yolo";
|
|
42
|
+
zen: "zen";
|
|
43
|
+
}>>;
|
|
44
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
maxIterations: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
export declare const AutomationEventFrontmatterSchema: z.ZodObject<{
|
|
51
|
+
event: z.ZodString;
|
|
52
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
53
|
+
debounceSeconds: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
dedupeWindowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
cooldownSeconds: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
maxParallel: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
title: z.ZodOptional<z.ZodString>;
|
|
59
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
60
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
61
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
62
|
+
modelSelection: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
providerId: z.ZodString;
|
|
64
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
67
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
68
|
+
act: "act";
|
|
69
|
+
plan: "plan";
|
|
70
|
+
yolo: "yolo";
|
|
71
|
+
zen: "zen";
|
|
72
|
+
}>>;
|
|
73
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
maxIterations: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
/**
|
|
80
|
+
* Field names that are only valid on schedule specs.
|
|
81
|
+
*/
|
|
82
|
+
export declare const SCHEDULE_ONLY_FIELDS: readonly ["schedule", "timezone"];
|
|
83
|
+
/**
|
|
84
|
+
* Field names that are only valid on event specs.
|
|
85
|
+
*/
|
|
86
|
+
export declare const EVENT_ONLY_FIELDS: readonly ["event", "filters", "debounceSeconds", "dedupeWindowSeconds", "cooldownSeconds", "maxParallel"];
|
|
87
|
+
export type AutomationOneOffFrontmatter = z.infer<typeof AutomationOneOffFrontmatterSchema>;
|
|
88
|
+
export type AutomationScheduleFrontmatter = z.infer<typeof AutomationScheduleFrontmatterSchema>;
|
|
89
|
+
export type AutomationEventFrontmatter = z.infer<typeof AutomationEventFrontmatterSchema>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { GatewayModelSelection } from "../llms/gateway";
|
|
2
|
+
import type { AgentMode } from "../session/runtime-config";
|
|
3
|
+
/**
|
|
4
|
+
* Trigger kinds supported by the automation subsystem.
|
|
5
|
+
*
|
|
6
|
+
* - `one_off`: a single run materialized from a `.cline/cron/*.md` spec.
|
|
7
|
+
* - `schedule`: recurring runs materialized from a `.cline/cron/*.cron.md` spec.
|
|
8
|
+
* - `event`: reactive runs materialized from a `.cline/cron/events/*.event.md`
|
|
9
|
+
* spec. Event-driven specs are defined here for contract completeness but
|
|
10
|
+
* runtime matching lives in a later feature.
|
|
11
|
+
*/
|
|
12
|
+
export type AutomationTriggerKind = "one_off" | "schedule" | "event";
|
|
13
|
+
/**
|
|
14
|
+
* Trigger kinds persisted on `cron_runs`. Event-driven, manual, and retry
|
|
15
|
+
* triggers are all first-class run sources in addition to the spec-defined
|
|
16
|
+
* `one_off` and `schedule` kinds.
|
|
17
|
+
*/
|
|
18
|
+
export type AutomationRunTriggerKind = "one_off" | "schedule" | "event" | "manual" | "retry";
|
|
19
|
+
/**
|
|
20
|
+
* Lifecycle status of a queued run row in `cron_runs`.
|
|
21
|
+
*/
|
|
22
|
+
export type AutomationRunStatus = "queued" | "running" | "done" | "failed" | "cancelled";
|
|
23
|
+
/**
|
|
24
|
+
* Parse status persisted on a `cron_specs` row.
|
|
25
|
+
*/
|
|
26
|
+
export type AutomationSpecParseStatus = "valid" | "invalid";
|
|
27
|
+
/**
|
|
28
|
+
* Common fields shared by every automation spec after parsing.
|
|
29
|
+
*
|
|
30
|
+
* `id` is the stable external identity derived from the frontmatter `id` field
|
|
31
|
+
* when present, or from the normalized relative source path as a fallback.
|
|
32
|
+
*/
|
|
33
|
+
export interface AutomationSpecCommon {
|
|
34
|
+
/** Stable external identity: frontmatter id, else normalized relative path. */
|
|
35
|
+
id: string;
|
|
36
|
+
/** Optional explicit frontmatter `id` (undefined when falling back to path). */
|
|
37
|
+
externalId?: string;
|
|
38
|
+
/** Human-readable title used in reports and list APIs. */
|
|
39
|
+
title: string;
|
|
40
|
+
/** Prompt text: frontmatter `prompt` if provided, otherwise the markdown body. */
|
|
41
|
+
prompt: string;
|
|
42
|
+
/** Absolute workspace root the automation run executes against. */
|
|
43
|
+
workspaceRoot: string;
|
|
44
|
+
/** Working directory inside the workspace (defaults to workspaceRoot at runtime). */
|
|
45
|
+
cwd?: string;
|
|
46
|
+
/** Optional model selection; when omitted the runtime default is used. */
|
|
47
|
+
modelSelection?: GatewayModelSelection;
|
|
48
|
+
/** System prompt override. */
|
|
49
|
+
systemPrompt?: string;
|
|
50
|
+
/** Agent mode. Defaults to `act` at runtime if omitted. */
|
|
51
|
+
mode?: AgentMode;
|
|
52
|
+
/** Hard timeout enforced by the runner. */
|
|
53
|
+
timeoutSeconds?: number;
|
|
54
|
+
/** Maximum agent iterations. */
|
|
55
|
+
maxIterations?: number;
|
|
56
|
+
/** Free-form tags. */
|
|
57
|
+
tags?: readonly string[];
|
|
58
|
+
/** Whether the spec is enabled. Defaults to `true`. */
|
|
59
|
+
enabled: boolean;
|
|
60
|
+
/** Arbitrary user metadata; stored verbatim as JSON. */
|
|
61
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
62
|
+
}
|
|
63
|
+
export interface AutomationOneOffSpec extends AutomationSpecCommon {
|
|
64
|
+
triggerKind: "one_off";
|
|
65
|
+
}
|
|
66
|
+
export interface AutomationScheduleSpec extends AutomationSpecCommon {
|
|
67
|
+
triggerKind: "schedule";
|
|
68
|
+
/** Cron expression (5 or 6 fields, parser validated by the scheduler). */
|
|
69
|
+
schedule: string;
|
|
70
|
+
/** IANA timezone name. Optional; falls back to runtime default. */
|
|
71
|
+
timezone?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Event-driven spec. Feature 2 owns the matcher; Feature 1 only needs the
|
|
75
|
+
* contract so `.event.md` specs parsed later surface the expected shape.
|
|
76
|
+
*/
|
|
77
|
+
export interface AutomationEventSpec extends AutomationSpecCommon {
|
|
78
|
+
triggerKind: "event";
|
|
79
|
+
event: string;
|
|
80
|
+
filters?: Readonly<Record<string, unknown>>;
|
|
81
|
+
debounceSeconds?: number;
|
|
82
|
+
dedupeWindowSeconds?: number;
|
|
83
|
+
cooldownSeconds?: number;
|
|
84
|
+
maxParallel?: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Discriminated union of all automation specs.
|
|
88
|
+
*/
|
|
89
|
+
export type AutomationSpec = AutomationOneOffSpec | AutomationScheduleSpec | AutomationEventSpec;
|
|
90
|
+
/**
|
|
91
|
+
* Normalized automation event envelope. Feature 2 will flesh out matching on
|
|
92
|
+
* top of this contract; Feature 1 ships the scaffold so downstream modules can
|
|
93
|
+
* reference it without cyclic dependencies.
|
|
94
|
+
*/
|
|
95
|
+
export interface AutomationEventEnvelope {
|
|
96
|
+
eventId: string;
|
|
97
|
+
eventType: string;
|
|
98
|
+
source: string;
|
|
99
|
+
subject?: string;
|
|
100
|
+
occurredAt: string;
|
|
101
|
+
workspaceRoot?: string;
|
|
102
|
+
payload: unknown;
|
|
103
|
+
attributes?: Readonly<Record<string, unknown>>;
|
|
104
|
+
dedupeKey?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Source-file metadata passed into the parser. Filesystem I/O (reading the
|
|
108
|
+
* file, hashing the bytes, stat-ing mtime) happens in core; the parser stays
|
|
109
|
+
* pure and takes these values as inputs.
|
|
110
|
+
*/
|
|
111
|
+
export interface AutomationSpecSource {
|
|
112
|
+
/**
|
|
113
|
+
* POSIX-normalized path of the source file relative to `.cline/cron/`.
|
|
114
|
+
* Used as the identity fallback and persisted in `cron_specs.source_path`.
|
|
115
|
+
*/
|
|
116
|
+
normalizedRelativePath: string;
|
|
117
|
+
/** Bare filename (e.g. `repo-cleanup.md`). */
|
|
118
|
+
filename: string;
|
|
119
|
+
/** File mtime in milliseconds since the epoch. */
|
|
120
|
+
mtimeMs: number;
|
|
121
|
+
/** Content hash (hex sha256) of the raw file bytes. */
|
|
122
|
+
hash: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ParsedSpecOk {
|
|
125
|
+
ok: true;
|
|
126
|
+
spec: AutomationSpec;
|
|
127
|
+
source: AutomationSpecSource;
|
|
128
|
+
/** Non-fatal parser warnings. */
|
|
129
|
+
warnings: readonly ParseIssueDetail[];
|
|
130
|
+
}
|
|
131
|
+
export interface ParsedSpecError {
|
|
132
|
+
ok: false;
|
|
133
|
+
source: AutomationSpecSource;
|
|
134
|
+
issue: ParseIssue;
|
|
135
|
+
}
|
|
136
|
+
export type ParsedSpec = ParsedSpecOk | ParsedSpecError;
|
|
137
|
+
/**
|
|
138
|
+
* Categorization of parser issues. `unsupported` is reserved for spec shapes
|
|
139
|
+
* that are syntactically valid but intentionally deferred (e.g. `.event.md`
|
|
140
|
+
* before Feature 2 lands). All other kinds are fatal for that file.
|
|
141
|
+
*/
|
|
142
|
+
export type ParseIssueKind = "yaml" | "schema" | "missing_required" | "conflicting_fields" | "empty_prompt" | "unsupported";
|
|
143
|
+
export interface ParseIssueDetail {
|
|
144
|
+
field?: string;
|
|
145
|
+
message: string;
|
|
146
|
+
}
|
|
147
|
+
export interface ParseIssue {
|
|
148
|
+
kind: ParseIssueKind;
|
|
149
|
+
message: string;
|
|
150
|
+
details?: readonly ParseIssueDetail[];
|
|
151
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ConnectorHookEventNameSchema: z.ZodEnum<{
|
|
3
|
+
"connector.started": "connector.started";
|
|
4
|
+
"connector.stopping": "connector.stopping";
|
|
5
|
+
"session.authorize": "session.authorize";
|
|
6
|
+
"message.received": "message.received";
|
|
7
|
+
"message.denied": "message.denied";
|
|
8
|
+
"message.completed": "message.completed";
|
|
9
|
+
"message.failed": "message.failed";
|
|
10
|
+
"session.started": "session.started";
|
|
11
|
+
"session.reused": "session.reused";
|
|
12
|
+
"session.reset": "session.reset";
|
|
13
|
+
"schedule.delivery.started": "schedule.delivery.started";
|
|
14
|
+
"schedule.delivery.sent": "schedule.delivery.sent";
|
|
15
|
+
"schedule.delivery.failed": "schedule.delivery.failed";
|
|
16
|
+
}>;
|
|
17
|
+
export type ConnectorHookEventName = z.infer<typeof ConnectorHookEventNameSchema>;
|
|
18
|
+
export declare const ConnectorEventActorSchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
label: z.ZodOptional<z.ZodString>;
|
|
21
|
+
role: z.ZodOptional<z.ZodString>;
|
|
22
|
+
participantKey: z.ZodOptional<z.ZodString>;
|
|
23
|
+
participantLabel: z.ZodOptional<z.ZodString>;
|
|
24
|
+
platformUserId: z.ZodOptional<z.ZodString>;
|
|
25
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const ConnectorEventContextSchema: z.ZodObject<{
|
|
28
|
+
source: z.ZodString;
|
|
29
|
+
sourceEvent: z.ZodString;
|
|
30
|
+
threadId: z.ZodString;
|
|
31
|
+
channelId: z.ZodString;
|
|
32
|
+
isDM: z.ZodBoolean;
|
|
33
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
35
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const ConnectorAuthorizationRequestSchema: z.ZodObject<{
|
|
38
|
+
actor: z.ZodObject<{
|
|
39
|
+
id: z.ZodOptional<z.ZodString>;
|
|
40
|
+
label: z.ZodOptional<z.ZodString>;
|
|
41
|
+
role: z.ZodOptional<z.ZodString>;
|
|
42
|
+
participantKey: z.ZodOptional<z.ZodString>;
|
|
43
|
+
participantLabel: z.ZodOptional<z.ZodString>;
|
|
44
|
+
platformUserId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
context: z.ZodObject<{
|
|
48
|
+
source: z.ZodString;
|
|
49
|
+
sourceEvent: z.ZodString;
|
|
50
|
+
threadId: z.ZodString;
|
|
51
|
+
channelId: z.ZodString;
|
|
52
|
+
isDM: z.ZodBoolean;
|
|
53
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
55
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export declare const ConnectorAuthorizationDecisionSchema: z.ZodObject<{
|
|
60
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
61
|
+
allow: "allow";
|
|
62
|
+
deny: "deny";
|
|
63
|
+
}>>;
|
|
64
|
+
message: z.ZodOptional<z.ZodString>;
|
|
65
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
66
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export declare const ConnectorHookEventSchema: z.ZodObject<{
|
|
69
|
+
adapter: z.ZodString;
|
|
70
|
+
botUserName: z.ZodOptional<z.ZodString>;
|
|
71
|
+
event: z.ZodEnum<{
|
|
72
|
+
"connector.started": "connector.started";
|
|
73
|
+
"connector.stopping": "connector.stopping";
|
|
74
|
+
"session.authorize": "session.authorize";
|
|
75
|
+
"message.received": "message.received";
|
|
76
|
+
"message.denied": "message.denied";
|
|
77
|
+
"message.completed": "message.completed";
|
|
78
|
+
"message.failed": "message.failed";
|
|
79
|
+
"session.started": "session.started";
|
|
80
|
+
"session.reused": "session.reused";
|
|
81
|
+
"session.reset": "session.reset";
|
|
82
|
+
"schedule.delivery.started": "schedule.delivery.started";
|
|
83
|
+
"schedule.delivery.sent": "schedule.delivery.sent";
|
|
84
|
+
"schedule.delivery.failed": "schedule.delivery.failed";
|
|
85
|
+
}>;
|
|
86
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
87
|
+
ts: z.ZodString;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
export type ConnectorHookEvent = z.infer<typeof ConnectorHookEventSchema>;
|
|
90
|
+
export type ConnectorEventActor = z.infer<typeof ConnectorEventActorSchema>;
|
|
91
|
+
export type ConnectorEventContext = z.infer<typeof ConnectorEventContextSchema>;
|
|
92
|
+
export type ConnectorAuthorizationRequest = z.infer<typeof ConnectorAuthorizationRequestSchema>;
|
|
93
|
+
export type ConnectorAuthorizationDecision = z.infer<typeof ConnectorAuthorizationDecisionSchema>;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
export type ConnectWhatsAppOptions = {
|
|
2
|
+
userName: string;
|
|
3
|
+
phoneNumberId?: string;
|
|
4
|
+
accessToken?: string;
|
|
5
|
+
appSecret?: string;
|
|
6
|
+
verifyToken?: string;
|
|
7
|
+
apiVersion?: string;
|
|
8
|
+
cwd: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
provider?: string;
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
systemPrompt?: string;
|
|
13
|
+
mode: "act" | "plan";
|
|
14
|
+
interactive: boolean;
|
|
15
|
+
maxIterations?: number;
|
|
16
|
+
enableTools: boolean;
|
|
17
|
+
rpcAddress: string;
|
|
18
|
+
hookCommand?: string;
|
|
19
|
+
port: number;
|
|
20
|
+
host: string;
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
};
|
|
23
|
+
export type WhatsAppConnectorState = {
|
|
24
|
+
instanceKey: string;
|
|
25
|
+
userName: string;
|
|
26
|
+
phoneNumberId?: string;
|
|
27
|
+
pid: number;
|
|
28
|
+
rpcAddress: string;
|
|
29
|
+
port: number;
|
|
30
|
+
baseUrl: string;
|
|
31
|
+
startedAt: string;
|
|
32
|
+
};
|
|
33
|
+
export type ConnectTelegramOptions = {
|
|
34
|
+
botToken: string;
|
|
35
|
+
botUsername?: string;
|
|
36
|
+
cwd: string;
|
|
37
|
+
model?: string;
|
|
38
|
+
provider?: string;
|
|
39
|
+
apiKey?: string;
|
|
40
|
+
systemPrompt?: string;
|
|
41
|
+
mode: "act" | "plan";
|
|
42
|
+
interactive: boolean;
|
|
43
|
+
maxIterations?: number;
|
|
44
|
+
enableTools: boolean;
|
|
45
|
+
rpcAddress: string;
|
|
46
|
+
hookCommand?: string;
|
|
47
|
+
};
|
|
48
|
+
export type TelegramConnectorState = {
|
|
49
|
+
botUsername: string;
|
|
50
|
+
botId?: string;
|
|
51
|
+
pid: number;
|
|
52
|
+
rpcAddress: string;
|
|
53
|
+
startedAt: string;
|
|
54
|
+
};
|
|
55
|
+
export type ConnectSlackOptions = {
|
|
56
|
+
userName: string;
|
|
57
|
+
botToken?: string;
|
|
58
|
+
signingSecret?: string;
|
|
59
|
+
clientId?: string;
|
|
60
|
+
clientSecret?: string;
|
|
61
|
+
encryptionKey?: string;
|
|
62
|
+
installationKeyPrefix?: string;
|
|
63
|
+
cwd: string;
|
|
64
|
+
model?: string;
|
|
65
|
+
provider?: string;
|
|
66
|
+
apiKey?: string;
|
|
67
|
+
systemPrompt?: string;
|
|
68
|
+
mode: "act" | "plan";
|
|
69
|
+
interactive: boolean;
|
|
70
|
+
maxIterations?: number;
|
|
71
|
+
enableTools: boolean;
|
|
72
|
+
rpcAddress: string;
|
|
73
|
+
hookCommand?: string;
|
|
74
|
+
port: number;
|
|
75
|
+
host: string;
|
|
76
|
+
baseUrl: string;
|
|
77
|
+
};
|
|
78
|
+
export type SlackConnectorState = {
|
|
79
|
+
userName: string;
|
|
80
|
+
pid: number;
|
|
81
|
+
rpcAddress: string;
|
|
82
|
+
port: number;
|
|
83
|
+
baseUrl: string;
|
|
84
|
+
startedAt: string;
|
|
85
|
+
};
|
|
86
|
+
export type ConnectDiscordOptions = {
|
|
87
|
+
userName: string;
|
|
88
|
+
applicationId: string;
|
|
89
|
+
botToken: string;
|
|
90
|
+
publicKey: string;
|
|
91
|
+
mentionRoleIds?: string[];
|
|
92
|
+
cwd: string;
|
|
93
|
+
model?: string;
|
|
94
|
+
provider?: string;
|
|
95
|
+
apiKey?: string;
|
|
96
|
+
systemPrompt?: string;
|
|
97
|
+
mode: "act" | "plan";
|
|
98
|
+
interactive: boolean;
|
|
99
|
+
maxIterations?: number;
|
|
100
|
+
enableTools: boolean;
|
|
101
|
+
rpcAddress: string;
|
|
102
|
+
hookCommand?: string;
|
|
103
|
+
port: number;
|
|
104
|
+
host: string;
|
|
105
|
+
baseUrl: string;
|
|
106
|
+
};
|
|
107
|
+
export type DiscordConnectorState = {
|
|
108
|
+
userName: string;
|
|
109
|
+
applicationId: string;
|
|
110
|
+
pid: number;
|
|
111
|
+
rpcAddress: string;
|
|
112
|
+
port: number;
|
|
113
|
+
baseUrl: string;
|
|
114
|
+
startedAt: string;
|
|
115
|
+
};
|
|
116
|
+
export type ConnectGoogleChatOptions = {
|
|
117
|
+
userName: string;
|
|
118
|
+
cwd: string;
|
|
119
|
+
model?: string;
|
|
120
|
+
provider?: string;
|
|
121
|
+
apiKey?: string;
|
|
122
|
+
systemPrompt?: string;
|
|
123
|
+
mode: "act" | "plan";
|
|
124
|
+
interactive: boolean;
|
|
125
|
+
maxIterations?: number;
|
|
126
|
+
enableTools: boolean;
|
|
127
|
+
rpcAddress: string;
|
|
128
|
+
hookCommand?: string;
|
|
129
|
+
port: number;
|
|
130
|
+
host: string;
|
|
131
|
+
baseUrl: string;
|
|
132
|
+
pubsubTopic?: string;
|
|
133
|
+
impersonateUser?: string;
|
|
134
|
+
useApplicationDefaultCredentials: boolean;
|
|
135
|
+
credentialsJson?: string;
|
|
136
|
+
};
|
|
137
|
+
export type GoogleChatConnectorState = {
|
|
138
|
+
userName: string;
|
|
139
|
+
pid: number;
|
|
140
|
+
rpcAddress: string;
|
|
141
|
+
port: number;
|
|
142
|
+
baseUrl: string;
|
|
143
|
+
startedAt: string;
|
|
144
|
+
};
|
|
145
|
+
export type ConnectLinearOptions = {
|
|
146
|
+
userName: string;
|
|
147
|
+
apiKey?: string;
|
|
148
|
+
clientId?: string;
|
|
149
|
+
clientSecret?: string;
|
|
150
|
+
accessToken?: string;
|
|
151
|
+
webhookSecret: string;
|
|
152
|
+
cwd: string;
|
|
153
|
+
model?: string;
|
|
154
|
+
provider?: string;
|
|
155
|
+
apiProviderKey?: string;
|
|
156
|
+
systemPrompt?: string;
|
|
157
|
+
mode: "act" | "plan";
|
|
158
|
+
interactive: boolean;
|
|
159
|
+
maxIterations?: number;
|
|
160
|
+
enableTools: boolean;
|
|
161
|
+
rpcAddress: string;
|
|
162
|
+
hookCommand?: string;
|
|
163
|
+
port: number;
|
|
164
|
+
host: string;
|
|
165
|
+
baseUrl: string;
|
|
166
|
+
};
|
|
167
|
+
export type LinearConnectorState = {
|
|
168
|
+
userName: string;
|
|
169
|
+
pid: number;
|
|
170
|
+
rpcAddress: string;
|
|
171
|
+
port: number;
|
|
172
|
+
baseUrl: string;
|
|
173
|
+
startedAt: string;
|
|
174
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types describing automation cron specs parsed from Markdown files.
|
|
3
|
+
* Split out from `@cline/core` so the parser can live in `shared` where
|
|
4
|
+
* multiple consumers (hub daemon, CLI tools, enterprise adapters) can validate
|
|
5
|
+
* the same `.cline/cron/` spec format without pulling in core's stateful
|
|
6
|
+
* orchestration layer.
|
|
7
|
+
*/
|
|
8
|
+
export type CronTriggerKind = "one_off" | "schedule" | "event";
|
|
9
|
+
/**
|
|
10
|
+
* Which trigger kind was inferred from the source file path.
|
|
11
|
+
* - `*.cron.md` -> schedule
|
|
12
|
+
* - `events/*.event.md` -> event
|
|
13
|
+
* - everything else under `.cline/cron/*.md` -> one_off
|
|
14
|
+
*/
|
|
15
|
+
export interface CronSpecModelSelection {
|
|
16
|
+
providerId?: string;
|
|
17
|
+
modelId?: string;
|
|
18
|
+
}
|
|
19
|
+
export type CronSpecMode = "act" | "plan" | "yolo";
|
|
20
|
+
export type CronSpecExtensionKind = "rules" | "skills" | "plugins";
|
|
21
|
+
export interface CronSpecCommonFields {
|
|
22
|
+
/** Optional explicit id from frontmatter; falls back to relative path. */
|
|
23
|
+
id?: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
prompt?: string;
|
|
26
|
+
workspaceRoot?: string;
|
|
27
|
+
mode?: CronSpecMode;
|
|
28
|
+
systemPrompt?: string;
|
|
29
|
+
modelSelection?: CronSpecModelSelection;
|
|
30
|
+
maxIterations?: number;
|
|
31
|
+
timeoutSeconds?: number;
|
|
32
|
+
tools?: string[];
|
|
33
|
+
notesDirectory?: string;
|
|
34
|
+
extensions?: CronSpecExtensionKind[];
|
|
35
|
+
source?: string;
|
|
36
|
+
tags?: string[];
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
metadata?: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export interface CronOneOffSpec extends CronSpecCommonFields {
|
|
41
|
+
triggerKind: "one_off";
|
|
42
|
+
}
|
|
43
|
+
export interface CronScheduleSpec extends CronSpecCommonFields {
|
|
44
|
+
triggerKind: "schedule";
|
|
45
|
+
schedule: string;
|
|
46
|
+
timezone?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface CronEventSpec extends CronSpecCommonFields {
|
|
49
|
+
triggerKind: "event";
|
|
50
|
+
event: string;
|
|
51
|
+
filters?: Record<string, unknown>;
|
|
52
|
+
debounceSeconds?: number;
|
|
53
|
+
dedupeWindowSeconds?: number;
|
|
54
|
+
cooldownSeconds?: number;
|
|
55
|
+
maxParallel?: number;
|
|
56
|
+
}
|
|
57
|
+
export type CronSpec = CronOneOffSpec | CronScheduleSpec | CronEventSpec;
|
|
58
|
+
/**
|
|
59
|
+
* Result of parsing one file. Always produces a record — even invalid specs
|
|
60
|
+
* are surfaced so the store can durably record parse errors rather than
|
|
61
|
+
* silently dropping state.
|
|
62
|
+
*/
|
|
63
|
+
export interface CronSpecParseResult {
|
|
64
|
+
/** Stable external identity: frontmatter `id` or normalized relative path. */
|
|
65
|
+
externalId: string;
|
|
66
|
+
/** Normalized posix-style path relative to `.cline/cron/`. */
|
|
67
|
+
relativePath: string;
|
|
68
|
+
/** Trigger kind inferred from file naming. */
|
|
69
|
+
triggerKind: CronTriggerKind;
|
|
70
|
+
/** Raw file body (without frontmatter). */
|
|
71
|
+
body: string;
|
|
72
|
+
/** sha256 of canonical frontmatter JSON + body. */
|
|
73
|
+
contentHash: string;
|
|
74
|
+
/** When the parse succeeded. */
|
|
75
|
+
spec?: CronSpec;
|
|
76
|
+
/** Parse error message when the spec is invalid. */
|
|
77
|
+
error?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Normalized automation event envelope. Used by the event-driven feature
|
|
81
|
+
* (Feature 2) but defined here so core, adapters, and shared validation
|
|
82
|
+
* agree on the shape from day one.
|
|
83
|
+
*/
|
|
84
|
+
export interface AutomationEventEnvelope {
|
|
85
|
+
eventId: string;
|
|
86
|
+
eventType: string;
|
|
87
|
+
source: string;
|
|
88
|
+
subject?: string;
|
|
89
|
+
occurredAt: string;
|
|
90
|
+
workspaceRoot?: string;
|
|
91
|
+
payload?: Record<string, unknown>;
|
|
92
|
+
attributes?: Record<string, unknown>;
|
|
93
|
+
dedupeKey?: string;
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { AutomationEventEnvelope, CronEventSpec, CronOneOffSpec, CronScheduleSpec, CronSpec, CronSpecCommonFields, CronSpecExtensionKind, CronSpecMode, CronSpecModelSelection, CronSpecParseResult, CronTriggerKind, } from "./cron-spec-types";
|