@cline/shared 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 +47 -0
- package/dist/agent.d.ts +397 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/types.d.ts +959 -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 +173 -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 +468 -0
- package/dist/index.browser.d.ts +57 -0
- package/dist/index.browser.js +76 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +149 -0
- package/dist/llms/ai-sdk-format.d.ts +42 -0
- package/dist/llms/gateway.d.ts +117 -0
- package/dist/llms/messages.d.ts +147 -0
- package/dist/llms/model-info.d.ts +112 -0
- package/dist/llms/reasoning-effort.d.ts +21 -0
- package/dist/llms/requests.d.ts +2 -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/constants.d.ts +5 -0
- package/dist/remote-config/schema.d.ts +408 -0
- package/dist/rpc/index.d.ts +5 -0
- package/dist/rpc/runtime.d.ts +320 -0
- package/dist/rpc/team-progress.d.ts +53 -0
- package/dist/runtime/build-env.d.ts +13 -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 +117 -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 +1 -0
- package/dist/storage/index.js +1 -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 +12 -0
- package/dist/vcr.d.ts +39 -0
- package/package.json +65 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare const AGENT_CONFIG_DIRECTORY_NAME = "agents";
|
|
2
|
+
export declare const HOOKS_CONFIG_DIRECTORY_NAME = "hooks";
|
|
3
|
+
export declare const SKILLS_CONFIG_DIRECTORY_NAME = "skills";
|
|
4
|
+
export declare const RULES_CONFIG_DIRECTORY_NAME = "rules";
|
|
5
|
+
export declare const WORKFLOWS_CONFIG_DIRECTORY_NAME = "workflows";
|
|
6
|
+
export declare const PLUGINS_DIRECTORY_NAME = "plugins";
|
|
7
|
+
export declare const CLINE_MCP_SETTINGS_FILE_NAME = "cline_mcp_settings.json";
|
|
8
|
+
export declare function setHomeDir(dir: string): void;
|
|
9
|
+
export declare function setHomeDirIfUnset(dir: string): void;
|
|
10
|
+
export declare function setClineDir(dir: string): void;
|
|
11
|
+
export declare function setClineDirIfUnset(dir: string): void;
|
|
12
|
+
export declare function resolveClineDir(): string;
|
|
13
|
+
export declare function resolveDocumentsClineDirectoryPath(): string;
|
|
14
|
+
type DocumentsExtensionName = "Agents" | "Hooks" | "Rules" | "Workflows" | "Plugins";
|
|
15
|
+
export declare function resolveDocumentsExtensionPath(name: DocumentsExtensionName): string;
|
|
16
|
+
export declare function resolveClineDataDir(): string;
|
|
17
|
+
export declare function resolveSessionDataDir(): string;
|
|
18
|
+
export declare function resolveTeamDataDir(): string;
|
|
19
|
+
export declare function resolveDbDataDir(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Path to the dedicated cron/automation database.
|
|
22
|
+
* Lives alongside `sessions.db` but is a separate file so cron lifecycle,
|
|
23
|
+
* retention, and query patterns stay decoupled from session storage.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveCronDbPath(): string;
|
|
26
|
+
export type CronSpecsScope = "global" | "workspace";
|
|
27
|
+
export interface ResolveCronSpecsDirOptions {
|
|
28
|
+
/**
|
|
29
|
+
* Explicit specs directory. Useful for tests and for future hosts that want
|
|
30
|
+
* to provide their own merged/global/workspace cron source root.
|
|
31
|
+
*/
|
|
32
|
+
cronSpecsDir?: string;
|
|
33
|
+
/** Defaults to `global`, i.e. `~/.cline/cron`. */
|
|
34
|
+
scope?: CronSpecsScope;
|
|
35
|
+
/** Required when `scope` is `workspace`. */
|
|
36
|
+
workspaceRoot?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Global file-based cron spec authoring directory:
|
|
40
|
+
* `~/.cline/cron/`
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveGlobalCronSpecsDir(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Workspace file-based cron spec authoring directory reserved for future
|
|
45
|
+
* workspace-scoped automation support:
|
|
46
|
+
* `${workspaceRoot}/.cline/cron/`
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveWorkspaceCronSpecsDir(workspaceRoot: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Directory containing file-based cron spec authoring.
|
|
51
|
+
*
|
|
52
|
+
* Default: global `~/.cline/cron/`.
|
|
53
|
+
* One-off: `*.md`
|
|
54
|
+
* Recurring: `*.cron.md`
|
|
55
|
+
* Event-driven: `events/*.event.md`
|
|
56
|
+
*
|
|
57
|
+
* A string argument is retained as a deprecated compatibility shorthand for
|
|
58
|
+
* workspace scope. New code should pass `{ scope: "workspace", workspaceRoot }`
|
|
59
|
+
* or use `resolveWorkspaceCronSpecsDir(workspaceRoot)` directly.
|
|
60
|
+
*/
|
|
61
|
+
export declare function resolveCronSpecsDir(workspaceRoot: string): string;
|
|
62
|
+
export declare function resolveCronSpecsDir(options?: ResolveCronSpecsDirOptions): string;
|
|
63
|
+
/** Directory where per-run markdown reports are written. */
|
|
64
|
+
export declare function resolveCronReportsDir(workspaceRoot: string): string;
|
|
65
|
+
export declare function resolveCronReportsDir(options?: ResolveCronSpecsDirOptions): string;
|
|
66
|
+
/** Directory where event-spec files live inside the cron specs dir. */
|
|
67
|
+
export declare function resolveCronEventsDir(workspaceRoot: string): string;
|
|
68
|
+
export declare function resolveCronEventsDir(options?: ResolveCronSpecsDirOptions): string;
|
|
69
|
+
export declare function resolveProviderSettingsPath(): string;
|
|
70
|
+
export declare function resolveGlobalSettingsPath(): string;
|
|
71
|
+
export declare function resolveMcpSettingsPath(): string;
|
|
72
|
+
export declare function resolveAgentsConfigDirPath(): string;
|
|
73
|
+
export declare function resolveAgentConfigSearchPaths(workspacePath?: string): string[];
|
|
74
|
+
export declare function resolveHooksConfigSearchPaths(workspacePath?: string): string[];
|
|
75
|
+
export declare function resolveSkillsConfigSearchPaths(workspacePath?: string): string[];
|
|
76
|
+
export declare function resolveRulesConfigSearchPaths(workspacePath?: string): string[];
|
|
77
|
+
export declare function resolveWorkflowsConfigSearchPaths(workspacePath?: string): string[];
|
|
78
|
+
export declare function resolvePluginConfigSearchPaths(workspacePath?: string): string[];
|
|
79
|
+
export declare function isPluginModulePath(path: string): boolean;
|
|
80
|
+
export declare function resolvePluginModuleEntries(directoryPath: string): string[] | null;
|
|
81
|
+
export declare function discoverPluginModulePaths(directoryPath: string): string[];
|
|
82
|
+
export declare function resolveConfiguredPluginModulePaths(pluginPaths: ReadonlyArray<string>, cwd: string): string[];
|
|
83
|
+
export declare function ensureParentDir(filePath: string): void;
|
|
84
|
+
export declare function ensureFileExists(filePath: string): void;
|
|
85
|
+
export declare function ensureHookLogDir(filePath?: string): string;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team tool schemas.
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas, constants, and schema-derived types for the team tool surface.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
export declare const DEFAULT_OUTCOME_REQUIRED_SECTIONS: string[];
|
|
8
|
+
export declare const TEAM_AWAIT_TIMEOUT_MS: number;
|
|
9
|
+
export declare const TEAM_RUN_MESSAGE_PREVIEW_LIMIT = 240;
|
|
10
|
+
export declare const TEAM_RUN_TEXT_PREVIEW_LIMIT = 400;
|
|
11
|
+
export declare const TeamTeammateSpecSchema: z.ZodObject<{
|
|
12
|
+
agentId: z.ZodString;
|
|
13
|
+
rolePrompt: z.ZodString;
|
|
14
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
15
|
+
maxIterations: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const TeamSpawnTeammateInputSchema: z.ZodObject<{
|
|
18
|
+
agentId: z.ZodString;
|
|
19
|
+
rolePrompt: z.ZodString;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export declare const TeamShutdownTeammateInputSchema: z.ZodObject<{
|
|
22
|
+
agentId: z.ZodString;
|
|
23
|
+
reason: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export declare const TeamStatusInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
26
|
+
type TeamTaskAction = "create" | "list" | "claim" | "complete" | "block";
|
|
27
|
+
export declare const TEAM_TASK_IGNORED_FIELDS_BY_ACTION: Partial<Record<TeamTaskAction, readonly string[]>>;
|
|
28
|
+
export declare const TeamTaskInputSchema: z.ZodObject<{
|
|
29
|
+
action: z.ZodEnum<{
|
|
30
|
+
create: "create";
|
|
31
|
+
list: "list";
|
|
32
|
+
claim: "claim";
|
|
33
|
+
complete: "complete";
|
|
34
|
+
block: "block";
|
|
35
|
+
}>;
|
|
36
|
+
title: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
37
|
+
description: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
38
|
+
dependsOn: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
39
|
+
assignee: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
40
|
+
status: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
completed: "completed";
|
|
42
|
+
pending: "pending";
|
|
43
|
+
in_progress: "in_progress";
|
|
44
|
+
blocked: "blocked";
|
|
45
|
+
}>>>;
|
|
46
|
+
taskId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
47
|
+
summary: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
48
|
+
reason: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const TeamRunTaskInputSchema: z.ZodObject<{
|
|
51
|
+
agentId: z.ZodString;
|
|
52
|
+
task: z.ZodString;
|
|
53
|
+
taskId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
54
|
+
runMode: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
55
|
+
sync: "sync";
|
|
56
|
+
async: "async";
|
|
57
|
+
}>>>;
|
|
58
|
+
continueConversation: z.ZodPreprocess<z.ZodOptional<z.ZodBoolean>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export declare const TeamListRunsInputSchema: z.ZodObject<{
|
|
61
|
+
status: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
running: "running";
|
|
63
|
+
completed: "completed";
|
|
64
|
+
failed: "failed";
|
|
65
|
+
cancelled: "cancelled";
|
|
66
|
+
queued: "queued";
|
|
67
|
+
interrupted: "interrupted";
|
|
68
|
+
}>>>;
|
|
69
|
+
agentId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
70
|
+
includeCompleted: z.ZodPreprocess<z.ZodOptional<z.ZodBoolean>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export declare const TeamCancelRunInputSchema: z.ZodObject<{
|
|
73
|
+
runId: z.ZodString;
|
|
74
|
+
reason: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const TeamAwaitRunsInputSchema: z.ZodObject<{
|
|
77
|
+
runId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export declare const TeamSendMessageInputSchema: z.ZodObject<{
|
|
80
|
+
toAgentId: z.ZodString;
|
|
81
|
+
subject: z.ZodString;
|
|
82
|
+
body: z.ZodString;
|
|
83
|
+
taskId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export declare const TeamBroadcastInputSchema: z.ZodObject<{
|
|
86
|
+
subject: z.ZodString;
|
|
87
|
+
body: z.ZodString;
|
|
88
|
+
taskId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export declare const TeamReadMailboxInputSchema: z.ZodObject<{
|
|
91
|
+
unreadOnly: z.ZodPreprocess<z.ZodOptional<z.ZodBoolean>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export declare const TeamMissionLogInputSchema: z.ZodObject<{
|
|
94
|
+
kind: z.ZodEnum<{
|
|
95
|
+
error: "error";
|
|
96
|
+
done: "done";
|
|
97
|
+
blocked: "blocked";
|
|
98
|
+
progress: "progress";
|
|
99
|
+
handoff: "handoff";
|
|
100
|
+
decision: "decision";
|
|
101
|
+
}>;
|
|
102
|
+
summary: z.ZodString;
|
|
103
|
+
taskId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
104
|
+
evidence: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
105
|
+
nextAction: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export declare const TeamCleanupInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
108
|
+
export declare const TeamCreateOutcomeInputSchema: z.ZodObject<{
|
|
109
|
+
title: z.ZodString;
|
|
110
|
+
requiredSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
export declare const TeamAttachOutcomeFragmentInputSchema: z.ZodObject<{
|
|
113
|
+
outcomeId: z.ZodString;
|
|
114
|
+
section: z.ZodString;
|
|
115
|
+
sourceRunId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
116
|
+
content: z.ZodString;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export declare const TeamReviewOutcomeFragmentInputSchema: z.ZodObject<{
|
|
119
|
+
fragmentId: z.ZodString;
|
|
120
|
+
approved: z.ZodBoolean;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
export declare const TeamFinalizeOutcomeInputSchema: z.ZodObject<{
|
|
123
|
+
outcomeId: z.ZodString;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export declare const TeamListOutcomesInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
126
|
+
export type TeamSpawnTeammateInput = z.infer<typeof TeamSpawnTeammateInputSchema>;
|
|
127
|
+
export type TeamShutdownTeammateInput = z.infer<typeof TeamShutdownTeammateInputSchema>;
|
|
128
|
+
export type TeamStatusInput = z.infer<typeof TeamStatusInputSchema>;
|
|
129
|
+
export type TeamTaskInput = z.infer<typeof TeamTaskInputSchema>;
|
|
130
|
+
export type TeamRunTaskInput = z.infer<typeof TeamRunTaskInputSchema>;
|
|
131
|
+
export type TeamListRunsInput = z.infer<typeof TeamListRunsInputSchema>;
|
|
132
|
+
export type TeamCancelRunInput = z.infer<typeof TeamCancelRunInputSchema>;
|
|
133
|
+
export type TeamAwaitRunsInput = z.infer<typeof TeamAwaitRunsInputSchema>;
|
|
134
|
+
export type TeamSendMessageInput = z.infer<typeof TeamSendMessageInputSchema>;
|
|
135
|
+
export type TeamBroadcastInput = z.infer<typeof TeamBroadcastInputSchema>;
|
|
136
|
+
export type TeamReadMailboxInput = z.infer<typeof TeamReadMailboxInputSchema>;
|
|
137
|
+
export type TeamMissionLogInput = z.infer<typeof TeamMissionLogInputSchema>;
|
|
138
|
+
export type TeamCleanupInput = z.infer<typeof TeamCleanupInputSchema>;
|
|
139
|
+
export type TeamCreateOutcomeInput = z.infer<typeof TeamCreateOutcomeInputSchema>;
|
|
140
|
+
export type TeamAttachOutcomeFragmentInput = z.infer<typeof TeamAttachOutcomeFragmentInputSchema>;
|
|
141
|
+
export type TeamReviewOutcomeFragmentInput = z.infer<typeof TeamReviewOutcomeFragmentInputSchema>;
|
|
142
|
+
export type TeamFinalizeOutcomeInput = z.infer<typeof TeamFinalizeOutcomeInputSchema>;
|
|
143
|
+
export type TeamListOutcomesInput = z.infer<typeof TeamListOutcomesInputSchema>;
|
|
144
|
+
export type TeamTeammateSpec = z.infer<typeof TeamTeammateSpecSchema>;
|
|
145
|
+
export declare const TeamStatusToolResultSchema: z.ZodObject<{
|
|
146
|
+
teamId: z.ZodString;
|
|
147
|
+
teamName: z.ZodString;
|
|
148
|
+
members: z.ZodArray<z.ZodObject<{
|
|
149
|
+
agentId: z.ZodString;
|
|
150
|
+
role: z.ZodEnum<{
|
|
151
|
+
lead: "lead";
|
|
152
|
+
teammate: "teammate";
|
|
153
|
+
}>;
|
|
154
|
+
description: z.ZodOptional<z.ZodString>;
|
|
155
|
+
status: z.ZodEnum<{
|
|
156
|
+
idle: "idle";
|
|
157
|
+
running: "running";
|
|
158
|
+
stopped: "stopped";
|
|
159
|
+
}>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
taskCounts: z.ZodRecord<z.ZodEnum<{
|
|
162
|
+
completed: "completed";
|
|
163
|
+
pending: "pending";
|
|
164
|
+
in_progress: "in_progress";
|
|
165
|
+
blocked: "blocked";
|
|
166
|
+
}>, z.ZodNumber>;
|
|
167
|
+
unreadMessages: z.ZodNumber;
|
|
168
|
+
missionLogEntries: z.ZodNumber;
|
|
169
|
+
activeRuns: z.ZodNumber;
|
|
170
|
+
queuedRuns: z.ZodNumber;
|
|
171
|
+
outcomeCounts: z.ZodRecord<z.ZodEnum<{
|
|
172
|
+
draft: "draft";
|
|
173
|
+
in_review: "in_review";
|
|
174
|
+
finalized: "finalized";
|
|
175
|
+
}>, z.ZodNumber>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export declare const TeamTaskListItemToolResultSchema: z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
title: z.ZodString;
|
|
180
|
+
description: z.ZodString;
|
|
181
|
+
status: z.ZodEnum<{
|
|
182
|
+
completed: "completed";
|
|
183
|
+
pending: "pending";
|
|
184
|
+
in_progress: "in_progress";
|
|
185
|
+
blocked: "blocked";
|
|
186
|
+
}>;
|
|
187
|
+
createdAt: z.ZodPreprocess<z.ZodString>;
|
|
188
|
+
updatedAt: z.ZodPreprocess<z.ZodString>;
|
|
189
|
+
createdBy: z.ZodString;
|
|
190
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
191
|
+
dependsOn: z.ZodArray<z.ZodString>;
|
|
192
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
193
|
+
isReady: z.ZodBoolean;
|
|
194
|
+
blockedBy: z.ZodArray<z.ZodString>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
export declare const TeamTaskToolResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
197
|
+
action: z.ZodLiteral<"create">;
|
|
198
|
+
taskId: z.ZodString;
|
|
199
|
+
status: z.ZodEnum<{
|
|
200
|
+
completed: "completed";
|
|
201
|
+
pending: "pending";
|
|
202
|
+
in_progress: "in_progress";
|
|
203
|
+
blocked: "blocked";
|
|
204
|
+
}>;
|
|
205
|
+
ignoredFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
206
|
+
note: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
208
|
+
action: z.ZodLiteral<"list">;
|
|
209
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
title: z.ZodString;
|
|
212
|
+
description: z.ZodString;
|
|
213
|
+
status: z.ZodEnum<{
|
|
214
|
+
completed: "completed";
|
|
215
|
+
pending: "pending";
|
|
216
|
+
in_progress: "in_progress";
|
|
217
|
+
blocked: "blocked";
|
|
218
|
+
}>;
|
|
219
|
+
createdAt: z.ZodPreprocess<z.ZodString>;
|
|
220
|
+
updatedAt: z.ZodPreprocess<z.ZodString>;
|
|
221
|
+
createdBy: z.ZodString;
|
|
222
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
223
|
+
dependsOn: z.ZodArray<z.ZodString>;
|
|
224
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
225
|
+
isReady: z.ZodBoolean;
|
|
226
|
+
blockedBy: z.ZodArray<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>>;
|
|
228
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
229
|
+
action: z.ZodLiteral<"claim">;
|
|
230
|
+
taskId: z.ZodString;
|
|
231
|
+
status: z.ZodEnum<{
|
|
232
|
+
completed: "completed";
|
|
233
|
+
pending: "pending";
|
|
234
|
+
in_progress: "in_progress";
|
|
235
|
+
blocked: "blocked";
|
|
236
|
+
}>;
|
|
237
|
+
nextStep: z.ZodString;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
action: z.ZodLiteral<"complete">;
|
|
240
|
+
taskId: z.ZodString;
|
|
241
|
+
status: z.ZodEnum<{
|
|
242
|
+
completed: "completed";
|
|
243
|
+
pending: "pending";
|
|
244
|
+
in_progress: "in_progress";
|
|
245
|
+
blocked: "blocked";
|
|
246
|
+
}>;
|
|
247
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
248
|
+
action: z.ZodLiteral<"block">;
|
|
249
|
+
taskId: z.ZodString;
|
|
250
|
+
status: z.ZodEnum<{
|
|
251
|
+
completed: "completed";
|
|
252
|
+
pending: "pending";
|
|
253
|
+
in_progress: "in_progress";
|
|
254
|
+
blocked: "blocked";
|
|
255
|
+
}>;
|
|
256
|
+
}, z.core.$strip>], "action">;
|
|
257
|
+
export declare const TeamRunTaskToolResultSchema: z.ZodObject<{
|
|
258
|
+
agentId: z.ZodString;
|
|
259
|
+
mode: z.ZodEnum<{
|
|
260
|
+
sync: "sync";
|
|
261
|
+
async: "async";
|
|
262
|
+
}>;
|
|
263
|
+
status: z.ZodEnum<{
|
|
264
|
+
running: "running";
|
|
265
|
+
queued: "queued";
|
|
266
|
+
dispatched: "dispatched";
|
|
267
|
+
joined: "joined";
|
|
268
|
+
}>;
|
|
269
|
+
dispatched: z.ZodBoolean;
|
|
270
|
+
message: z.ZodString;
|
|
271
|
+
deduped: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
273
|
+
text: z.ZodOptional<z.ZodString>;
|
|
274
|
+
iterations: z.ZodOptional<z.ZodNumber>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
export declare const TeamRunResultSummarySchema: z.ZodObject<{
|
|
277
|
+
textPreview: z.ZodString;
|
|
278
|
+
iterations: z.ZodNumber;
|
|
279
|
+
finishReason: z.ZodString;
|
|
280
|
+
durationMs: z.ZodNumber;
|
|
281
|
+
usage: z.ZodObject<{
|
|
282
|
+
inputTokens: z.ZodNumber;
|
|
283
|
+
outputTokens: z.ZodNumber;
|
|
284
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
totalCost: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
}, z.core.$strip>;
|
|
288
|
+
}, z.core.$strip>;
|
|
289
|
+
export declare const TeamRunToolSummarySchema: z.ZodObject<{
|
|
290
|
+
id: z.ZodString;
|
|
291
|
+
agentId: z.ZodString;
|
|
292
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
293
|
+
status: z.ZodEnum<{
|
|
294
|
+
running: "running";
|
|
295
|
+
completed: "completed";
|
|
296
|
+
failed: "failed";
|
|
297
|
+
cancelled: "cancelled";
|
|
298
|
+
queued: "queued";
|
|
299
|
+
interrupted: "interrupted";
|
|
300
|
+
}>;
|
|
301
|
+
messagePreview: z.ZodString;
|
|
302
|
+
priority: z.ZodNumber;
|
|
303
|
+
retryCount: z.ZodNumber;
|
|
304
|
+
maxRetries: z.ZodNumber;
|
|
305
|
+
nextAttemptAt: z.ZodOptional<z.ZodPreprocess<z.ZodString>>;
|
|
306
|
+
continueConversation: z.ZodOptional<z.ZodBoolean>;
|
|
307
|
+
startedAt: z.ZodPreprocess<z.ZodString>;
|
|
308
|
+
endedAt: z.ZodOptional<z.ZodPreprocess<z.ZodString>>;
|
|
309
|
+
leaseOwner: z.ZodOptional<z.ZodString>;
|
|
310
|
+
heartbeatAt: z.ZodOptional<z.ZodPreprocess<z.ZodString>>;
|
|
311
|
+
lastProgressAt: z.ZodOptional<z.ZodPreprocess<z.ZodString>>;
|
|
312
|
+
lastProgressMessage: z.ZodOptional<z.ZodString>;
|
|
313
|
+
currentActivity: z.ZodOptional<z.ZodString>;
|
|
314
|
+
error: z.ZodOptional<z.ZodString>;
|
|
315
|
+
resultSummary: z.ZodOptional<z.ZodObject<{
|
|
316
|
+
textPreview: z.ZodString;
|
|
317
|
+
iterations: z.ZodNumber;
|
|
318
|
+
finishReason: z.ZodString;
|
|
319
|
+
durationMs: z.ZodNumber;
|
|
320
|
+
usage: z.ZodObject<{
|
|
321
|
+
inputTokens: z.ZodNumber;
|
|
322
|
+
outputTokens: z.ZodNumber;
|
|
323
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
324
|
+
cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
|
|
325
|
+
totalCost: z.ZodOptional<z.ZodNumber>;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
}, z.core.$strip>;
|
|
329
|
+
export declare const TeamMailboxMessageToolResultSchema: z.ZodObject<{
|
|
330
|
+
id: z.ZodString;
|
|
331
|
+
teamId: z.ZodString;
|
|
332
|
+
fromAgentId: z.ZodString;
|
|
333
|
+
toAgentId: z.ZodString;
|
|
334
|
+
subject: z.ZodString;
|
|
335
|
+
body: z.ZodString;
|
|
336
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
337
|
+
sentAt: z.ZodPreprocess<z.ZodString>;
|
|
338
|
+
readAt: z.ZodOptional<z.ZodPreprocess<z.ZodString>>;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
export declare const TeamOutcomeToolResultSchema: z.ZodObject<{
|
|
341
|
+
id: z.ZodString;
|
|
342
|
+
teamId: z.ZodString;
|
|
343
|
+
title: z.ZodString;
|
|
344
|
+
status: z.ZodEnum<{
|
|
345
|
+
draft: "draft";
|
|
346
|
+
in_review: "in_review";
|
|
347
|
+
finalized: "finalized";
|
|
348
|
+
}>;
|
|
349
|
+
requiredSections: z.ZodArray<z.ZodString>;
|
|
350
|
+
createdBy: z.ZodString;
|
|
351
|
+
createdAt: z.ZodPreprocess<z.ZodString>;
|
|
352
|
+
finalizedAt: z.ZodOptional<z.ZodPreprocess<z.ZodString>>;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
export declare const TeamCreateOutcomeToolResultSchema: z.ZodObject<{
|
|
355
|
+
outcomeId: z.ZodString;
|
|
356
|
+
status: z.ZodEnum<{
|
|
357
|
+
draft: "draft";
|
|
358
|
+
in_review: "in_review";
|
|
359
|
+
finalized: "finalized";
|
|
360
|
+
}>;
|
|
361
|
+
requiredSections: z.ZodArray<z.ZodString>;
|
|
362
|
+
}, z.core.$strip>;
|
|
363
|
+
export declare const TeamSimpleAgentStatusToolResultSchema: z.ZodObject<{
|
|
364
|
+
agentId: z.ZodString;
|
|
365
|
+
status: z.ZodString;
|
|
366
|
+
}, z.core.$strip>;
|
|
367
|
+
export declare const TeamCancelRunToolResultSchema: z.ZodObject<{
|
|
368
|
+
runId: z.ZodString;
|
|
369
|
+
status: z.ZodEnum<{
|
|
370
|
+
running: "running";
|
|
371
|
+
completed: "completed";
|
|
372
|
+
failed: "failed";
|
|
373
|
+
cancelled: "cancelled";
|
|
374
|
+
queued: "queued";
|
|
375
|
+
interrupted: "interrupted";
|
|
376
|
+
}>;
|
|
377
|
+
}, z.core.$strip>;
|
|
378
|
+
export declare const TeamSendMessageToolResultSchema: z.ZodObject<{
|
|
379
|
+
id: z.ZodString;
|
|
380
|
+
toAgentId: z.ZodString;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
export declare const TeamBroadcastToolResultSchema: z.ZodObject<{
|
|
383
|
+
delivered: z.ZodNumber;
|
|
384
|
+
}, z.core.$strip>;
|
|
385
|
+
export declare const TeamMissionLogToolResultSchema: z.ZodObject<{
|
|
386
|
+
id: z.ZodString;
|
|
387
|
+
}, z.core.$strip>;
|
|
388
|
+
export declare const TeamCleanupToolResultSchema: z.ZodObject<{
|
|
389
|
+
status: z.ZodString;
|
|
390
|
+
}, z.core.$strip>;
|
|
391
|
+
export declare const TeamOutcomeFragmentToolResultSchema: z.ZodObject<{
|
|
392
|
+
fragmentId: z.ZodString;
|
|
393
|
+
status: z.ZodString;
|
|
394
|
+
}, z.core.$strip>;
|
|
395
|
+
export declare const TeamFinalizeOutcomeToolResultSchema: z.ZodObject<{
|
|
396
|
+
outcomeId: z.ZodString;
|
|
397
|
+
status: z.ZodEnum<{
|
|
398
|
+
draft: "draft";
|
|
399
|
+
in_review: "in_review";
|
|
400
|
+
finalized: "finalized";
|
|
401
|
+
}>;
|
|
402
|
+
}, z.core.$strip>;
|
|
403
|
+
export type TeamRunResultSummary = z.infer<typeof TeamRunResultSummarySchema>;
|
|
404
|
+
export type TeamRunToolSummary = z.infer<typeof TeamRunToolSummarySchema>;
|
|
405
|
+
export type TeamTaskToolResult = z.infer<typeof TeamTaskToolResultSchema>;
|
|
406
|
+
export type TeamRunTaskToolResult = z.infer<typeof TeamRunTaskToolResultSchema>;
|
|
407
|
+
export type TeamStatusToolResult = z.infer<typeof TeamStatusToolResultSchema>;
|
|
408
|
+
export type TeamMailboxMessageToolResult = z.infer<typeof TeamMailboxMessageToolResultSchema>;
|
|
409
|
+
export type TeamOutcomeToolResult = z.infer<typeof TeamOutcomeToolResultSchema>;
|
|
410
|
+
export type TeamCreateOutcomeToolResult = z.infer<typeof TeamCreateOutcomeToolResultSchema>;
|
|
411
|
+
export {};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team data types and interfaces.
|
|
3
|
+
*
|
|
4
|
+
* These are the pure data-shape contracts for the multi-agent team system.
|
|
5
|
+
* They intentionally avoid referencing @cline/agents types so that shared
|
|
6
|
+
* can remain dependency-free of the agents package.
|
|
7
|
+
*/
|
|
8
|
+
export type TeamTaskStatus = "pending" | "in_progress" | "blocked" | "completed";
|
|
9
|
+
export interface TeamTask {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
status: TeamTaskStatus;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
createdBy: string;
|
|
17
|
+
assignee?: string;
|
|
18
|
+
dependsOn: string[];
|
|
19
|
+
summary?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface TeamTaskListItem extends TeamTask {
|
|
22
|
+
isReady: boolean;
|
|
23
|
+
blockedBy: string[];
|
|
24
|
+
}
|
|
25
|
+
export type MissionLogKind = "progress" | "handoff" | "blocked" | "decision" | "done" | "error";
|
|
26
|
+
export interface MissionLogEntry {
|
|
27
|
+
id: string;
|
|
28
|
+
ts: Date;
|
|
29
|
+
teamId: string;
|
|
30
|
+
agentId: string;
|
|
31
|
+
taskId?: string;
|
|
32
|
+
kind: MissionLogKind;
|
|
33
|
+
summary: string;
|
|
34
|
+
evidence?: string[];
|
|
35
|
+
nextAction?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface TeamMailboxMessage {
|
|
38
|
+
id: string;
|
|
39
|
+
teamId: string;
|
|
40
|
+
fromAgentId: string;
|
|
41
|
+
toAgentId: string;
|
|
42
|
+
subject: string;
|
|
43
|
+
body: string;
|
|
44
|
+
taskId?: string;
|
|
45
|
+
sentAt: Date;
|
|
46
|
+
readAt?: Date;
|
|
47
|
+
}
|
|
48
|
+
export interface TeamMemberSnapshot {
|
|
49
|
+
agentId: string;
|
|
50
|
+
role: "lead" | "teammate";
|
|
51
|
+
description?: string;
|
|
52
|
+
status: "idle" | "running" | "stopped";
|
|
53
|
+
}
|
|
54
|
+
export interface TeammateLifecycleSpec {
|
|
55
|
+
rolePrompt: string;
|
|
56
|
+
modelId?: string;
|
|
57
|
+
maxIterations?: number;
|
|
58
|
+
runtimeAgentId?: string;
|
|
59
|
+
conversationId?: string;
|
|
60
|
+
parentAgentId?: string | null;
|
|
61
|
+
}
|
|
62
|
+
export type TeamRunStatus = "queued" | "running" | "completed" | "failed" | "cancelled" | "interrupted";
|
|
63
|
+
/**
|
|
64
|
+
* Shared representation of a teammate run record.
|
|
65
|
+
*
|
|
66
|
+
* The `result` field is typed as `unknown` at the shared contract level
|
|
67
|
+
* because the concrete type (`AgentResult`) lives in `@cline/agents`.
|
|
68
|
+
* Consuming packages narrow this via their own type assertions.
|
|
69
|
+
*/
|
|
70
|
+
export interface TeamRunRecord {
|
|
71
|
+
id: string;
|
|
72
|
+
agentId: string;
|
|
73
|
+
taskId?: string;
|
|
74
|
+
status: TeamRunStatus;
|
|
75
|
+
message: string;
|
|
76
|
+
priority: number;
|
|
77
|
+
retryCount: number;
|
|
78
|
+
maxRetries: number;
|
|
79
|
+
nextAttemptAt?: Date;
|
|
80
|
+
continueConversation?: boolean;
|
|
81
|
+
startedAt: Date;
|
|
82
|
+
endedAt?: Date;
|
|
83
|
+
leaseOwner?: string;
|
|
84
|
+
heartbeatAt?: Date;
|
|
85
|
+
lastProgressAt?: Date;
|
|
86
|
+
lastProgressMessage?: string;
|
|
87
|
+
currentActivity?: string;
|
|
88
|
+
result?: unknown;
|
|
89
|
+
error?: string;
|
|
90
|
+
}
|
|
91
|
+
export type TeamOutcomeStatus = "draft" | "in_review" | "finalized";
|
|
92
|
+
export interface TeamOutcome {
|
|
93
|
+
id: string;
|
|
94
|
+
teamId: string;
|
|
95
|
+
title: string;
|
|
96
|
+
status: TeamOutcomeStatus;
|
|
97
|
+
requiredSections: string[];
|
|
98
|
+
createdBy: string;
|
|
99
|
+
createdAt: Date;
|
|
100
|
+
finalizedAt?: Date;
|
|
101
|
+
}
|
|
102
|
+
export type TeamOutcomeFragmentStatus = "draft" | "reviewed" | "rejected";
|
|
103
|
+
export interface TeamOutcomeFragment {
|
|
104
|
+
id: string;
|
|
105
|
+
teamId: string;
|
|
106
|
+
outcomeId: string;
|
|
107
|
+
section: string;
|
|
108
|
+
sourceAgentId: string;
|
|
109
|
+
sourceRunId?: string;
|
|
110
|
+
content: string;
|
|
111
|
+
status: TeamOutcomeFragmentStatus;
|
|
112
|
+
reviewedBy?: string;
|
|
113
|
+
reviewedAt?: Date;
|
|
114
|
+
createdAt: Date;
|
|
115
|
+
}
|
|
116
|
+
export interface TeamRuntimeSnapshot {
|
|
117
|
+
teamId: string;
|
|
118
|
+
teamName: string;
|
|
119
|
+
members: TeamMemberSnapshot[];
|
|
120
|
+
taskCounts: Record<TeamTaskStatus, number>;
|
|
121
|
+
unreadMessages: number;
|
|
122
|
+
missionLogEntries: number;
|
|
123
|
+
activeRuns: number;
|
|
124
|
+
queuedRuns: number;
|
|
125
|
+
outcomeCounts: Record<TeamOutcomeStatus, number>;
|
|
126
|
+
}
|
|
127
|
+
export interface TeamRuntimeState {
|
|
128
|
+
teamId: string;
|
|
129
|
+
teamName: string;
|
|
130
|
+
members: TeamMemberSnapshot[];
|
|
131
|
+
tasks: TeamTask[];
|
|
132
|
+
mailbox: TeamMailboxMessage[];
|
|
133
|
+
missionLog: MissionLogEntry[];
|
|
134
|
+
runs: TeamRunRecord[];
|
|
135
|
+
outcomes: TeamOutcome[];
|
|
136
|
+
outcomeFragments: TeamOutcomeFragment[];
|
|
137
|
+
}
|
|
138
|
+
export interface AppendMissionLogInput {
|
|
139
|
+
agentId: string;
|
|
140
|
+
taskId?: string;
|
|
141
|
+
kind: MissionLogKind;
|
|
142
|
+
summary: string;
|
|
143
|
+
evidence?: string[];
|
|
144
|
+
nextAction?: string;
|
|
145
|
+
}
|
|
146
|
+
export interface CreateTeamTaskInput {
|
|
147
|
+
title: string;
|
|
148
|
+
description: string;
|
|
149
|
+
createdBy: string;
|
|
150
|
+
dependsOn?: string[];
|
|
151
|
+
assignee?: string;
|
|
152
|
+
}
|
|
153
|
+
export interface CreateTeamOutcomeInput {
|
|
154
|
+
title: string;
|
|
155
|
+
requiredSections: string[];
|
|
156
|
+
createdBy: string;
|
|
157
|
+
}
|
|
158
|
+
export interface AttachTeamOutcomeFragmentInput {
|
|
159
|
+
outcomeId: string;
|
|
160
|
+
section: string;
|
|
161
|
+
sourceAgentId: string;
|
|
162
|
+
sourceRunId?: string;
|
|
163
|
+
content: string;
|
|
164
|
+
}
|
|
165
|
+
export interface ReviewTeamOutcomeFragmentInput {
|
|
166
|
+
fragmentId: string;
|
|
167
|
+
reviewedBy: string;
|
|
168
|
+
approved: boolean;
|
|
169
|
+
}
|
|
170
|
+
export interface RouteToTeammateOptions {
|
|
171
|
+
taskId?: string;
|
|
172
|
+
fromAgentId?: string;
|
|
173
|
+
continueConversation?: boolean;
|
|
174
|
+
}
|
|
175
|
+
export declare enum TeamMessageType {
|
|
176
|
+
TaskStart = "task_start",
|
|
177
|
+
TaskEnd = "task_end",
|
|
178
|
+
AgentEvent = "agent_event",
|
|
179
|
+
TeammateSpawned = "teammate_spawned",
|
|
180
|
+
TeammateShutdown = "teammate_shutdown",
|
|
181
|
+
TeamTaskUpdated = "team_task_updated",
|
|
182
|
+
TeamMessage = "team_message",
|
|
183
|
+
TeamMissionLog = "team_mission_log",
|
|
184
|
+
TeamTaskCompleted = "team_task_completed",
|
|
185
|
+
RunStarted = "run_started",
|
|
186
|
+
RunQueued = "run_queued",
|
|
187
|
+
RunProgress = "run_progress",
|
|
188
|
+
RunCompleted = "run_completed",
|
|
189
|
+
RunFailed = "run_failed",
|
|
190
|
+
RunCancelled = "run_cancelled",
|
|
191
|
+
RunInterrupted = "run_interrupted",
|
|
192
|
+
OutcomeCreated = "outcome_created",
|
|
193
|
+
OutcomeFragmentAttached = "outcome_fragment_attached",
|
|
194
|
+
OutcomeFragmentReviewed = "outcome_fragment_reviewed",
|
|
195
|
+
OutcomeFinalized = "outcome_finalized"
|
|
196
|
+
}
|