@cline/shared 0.0.41 → 0.0.42
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/dist/agents/types.d.ts +6 -0
- package/dist/connectors/options.d.ts +2 -1
- package/dist/hub.d.ts +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.js +23 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.js +65 -65
- package/dist/llms/gateway.d.ts +1 -1
- package/dist/llms/messages.d.ts +2 -0
- package/dist/llms/model-info.d.ts +7 -0
- package/dist/prompt/system.d.ts +1 -1
- package/dist/rpc/runtime.d.ts +1 -1
- package/dist/session/records.d.ts +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +1 -1
- package/dist/storage/path-resolution.d.ts +11 -0
- package/package.json +1 -1
package/dist/llms/gateway.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type GatewayModelCapability = "text" | "tools" | "reasoning" | "prompt-ca
|
|
|
9
9
|
export type GatewayPromptCacheStrategy = "anthropic-automatic";
|
|
10
10
|
export type GatewayUsageCostDisplay = "show" | "hide";
|
|
11
11
|
export type GatewayPromptCacheFormat = "anthropic-cache-control";
|
|
12
|
-
export type GatewayReasoningFormat = "anthropic-thinking";
|
|
12
|
+
export type GatewayReasoningFormat = "anthropic-thinking" | "glm-thinking";
|
|
13
13
|
export type GatewayModelRoute = {
|
|
14
14
|
matcher: "anthropic-compatible";
|
|
15
15
|
} | {
|
package/dist/llms/messages.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export interface ToolResultContent {
|
|
|
61
61
|
type: "tool_result";
|
|
62
62
|
/** ID of the tool call this is responding to */
|
|
63
63
|
tool_use_id: string;
|
|
64
|
+
/** Name of the tool that generated this result */
|
|
65
|
+
name: string;
|
|
64
66
|
/** Result content (can be text or error) */
|
|
65
67
|
content: string | Array<TextContent | ImageContent | FileContent>;
|
|
66
68
|
/** Whether this result represents an error */
|
|
@@ -54,6 +54,10 @@ export declare const ThinkingConfigSchema: z.ZodObject<{
|
|
|
54
54
|
}>>;
|
|
55
55
|
}, z.core.$strip>;
|
|
56
56
|
export type ThinkingConfig = z.infer<typeof ThinkingConfigSchema>;
|
|
57
|
+
export declare const ModelMetadataSchema: z.ZodObject<{
|
|
58
|
+
reasoningDefaultOn: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
60
|
+
export type ModelMetadata = z.infer<typeof ModelMetadataSchema>;
|
|
57
61
|
export declare const ModelInfoSchema: z.ZodObject<{
|
|
58
62
|
id: z.ZodString;
|
|
59
63
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -109,5 +113,8 @@ export declare const ModelInfoSchema: z.ZodObject<{
|
|
|
109
113
|
releaseDate: z.ZodOptional<z.ZodString>;
|
|
110
114
|
deprecationDate: z.ZodOptional<z.ZodString>;
|
|
111
115
|
family: z.ZodOptional<z.ZodString>;
|
|
116
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
117
|
+
reasoningDefaultOn: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
112
119
|
}, z.core.$strip>;
|
|
113
120
|
export type ModelInfo = z.infer<typeof ModelInfoSchema>;
|
package/dist/prompt/system.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const DEFAULT_CLINE_SYSTEM_PROMPT = "You are Cline, an AI coding agent. Your primary goal is to assist users with various coding tasks by leveraging your knowledge and the tools at your disposal. Given the user's prompt, you should use the tools available to you to answer user's question.\n\nAlways gather all the necessary context before starting to work on a task. For example, if you are generating a unit test or new code, make sure you understand the requirement, the naming conventions, frameworks and libraries used and aligned in the current codebase, and the environment and commands used to run and test the code etc. Always validate the new unit test at the end including running the code if possible for live feedback.\nReview each question carefully and answer it with detailed, accurate information.\nIf you need more information, use one of the available tools or ask for clarification instead of making assumptions or lies.\n\nEnvironment you are running in:\n<env>\n1. Platform: {{PLATFORM_NAME}}\n2. Date: {{CURRENT_DATE}}\n3. IDE: {{IDE_NAME}}\n4. Working Directory: {{CWD}}\n</env>\n\nRemember:\n- Always adhere to existing code conventions and patterns.\n- Use only libraries and frameworks that are confirmed to be in use in the current codebase.\n- Provide complete and functional code without omissions or placeholders.\n- Be explicit about any assumptions or limitations in your solution.\n- Always show your planning process before executing any task. This will help ensure that you have a clear understanding of the requirements and that your approach aligns with the user's needs.\n- Always use absolute paths when referring to files.\n- Always verify the files you have edited or created at the end of the task to ensure they are completed and working as expected.\n\nBegin by analyzing the user's input and gathering any necessary additional context. Then, present your plan at the start of your response along with tool calls before proceeding with the task. It's OK for this section to be quite long.\n\nREMEMBER, be helpful and proactive! Don't ask for permission to do something when you can do it! Do not indicates you will be using a tool unless you are actually going to use it.\n\nIMPORTANT: Always includes tool calls in your response until the task is completed. Response without tool calls will considered as completed with final answer.\n\nWhen you have completed the task, please provide a summary of what you did and any relevant information that the user should know. This will help ensure that the user understands the changes made and can easily follow up if they have any questions or need further assistance. Do not indicate that you will perform an action without actually doing it. Always provide the final result in your response. Always validate your answer with checking the code and running it if possible. \n\nIf user asked a simple question without any coding context, answer it directly without using any tools.\n{{CLINE_RULES}}\n{{CLINE_METADATA}}";
|
|
2
|
-
export declare const YOLO_CLINE_SYSTEM_PROMPT = "You are Cline, a careful and helpful coding agent that works in the background.\nYou are tasked to solve an issue reported by the user who you cannot communicate with directly.\nYour goal is to utilize the tools at your disposal to investigate and answer the question according to user's instructions with the aim to verify that the issue is resolved.\n\nRULES:\n- Always
|
|
2
|
+
export declare const YOLO_CLINE_SYSTEM_PROMPT = "You are Cline, a careful and helpful coding agent that works in the background.\nYou are tasked to solve an issue reported by the user who you cannot communicate with directly.\nYour goal is to utilize the tools at your disposal to investigate and answer the question according to user's instructions with the aim to verify that the issue is resolved.\n\nRULES:\n- Always match output format exactly as shown in examples or existing files.\n- Use only libraries and frameworks that are confirmed and compatible to be in use in the current codebase.\n- Provide complete and functional code without omissions or placeholders.\n- Always show your planning process without repeating yourself before executing any task. This will help ensure that you have a clear understanding of the requirements and that your approach aligns with the user's request.\n- Always use absolute paths when referring to files.\n- Always verify the files you have edited or created at the end of the task to ensure they are completed and working as expected.\n\nEnvironment you are running in:\n<env>\n1. Platform: {{PLATFORM_NAME}}\n2. Date: {{CURRENT_DATE}}\n3. IDE: {{IDE_NAME}}\n4. Working Directory: {{CWD}}\n</env>\n\nIMPORTANT: \n- When the user describes a bug, unexpected behavior, or provides a bug report, your primary goal is to produce a correct fix in the source code that resolves the issue. \n- A correct fix means the underlying behavior is fixed \u2014 not just the symptoms addressed superficially. \n- After applying your fix, you must run the relevant test suite to confirm your changes actually resolve the problem. If tests fail, analyze the failures, revise your fix, and re-run until tests pass. \n- Do not consider the task complete until the test suite related to the files you have touched passes.\n- Always includes tool calls in your response until the task is completed. You should only end the task when all the requirements are met by calling the 'submit_and_exit' tool.\n- Response without the submit_and_exit tool call will considered not completed and the task will continue.\n{{CLINE_RULES}}\n{{CLINE_METADATA}}";
|
package/dist/rpc/runtime.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ export interface SaveProviderSettingsActionRequest {
|
|
|
231
231
|
sessionToken?: string;
|
|
232
232
|
region?: string;
|
|
233
233
|
profile?: string;
|
|
234
|
-
authentication?: "iam" | "api-key" | "profile";
|
|
234
|
+
authentication?: "iam" | "api-key" | "apikey" | "profile";
|
|
235
235
|
usePromptCache?: boolean;
|
|
236
236
|
useCrossRegionInference?: boolean;
|
|
237
237
|
useGlobalInference?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SESSION_STATUS_VALUES: readonly ["running", "completed", "failed", "cancelled"];
|
|
1
|
+
export declare const SESSION_STATUS_VALUES: readonly ["idle", "running", "pending", "completed", "failed", "cancelled"];
|
|
2
2
|
export type SharedSessionStatus = (typeof SESSION_STATUS_VALUES)[number];
|
|
3
3
|
export interface SessionLineage {
|
|
4
4
|
parentSessionId?: string;
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
+
export { resolveExistingFilePath } from "./path-resolution";
|
|
1
2
|
export { AGENT_CONFIG_DIRECTORY_NAME, CLINE_MCP_SETTINGS_FILE_NAME, type CronSpecsScope, discoverPluginModulePaths, ensureFileExists, ensureHookLogDir, ensureParentDir, HOOKS_CONFIG_DIRECTORY_NAME, isPluginModulePath, type ResolveCronSpecsDirOptions, RULES_CONFIG_DIRECTORY_NAME, resolveAgentConfigSearchPaths, resolveAgentsConfigDirPath, resolveClineDataDir, resolveClineDir, resolveConfiguredPluginModulePaths, resolveCronDbPath, resolveCronEventsDir, resolveCronReportsDir, resolveCronSpecsDir, resolveDbDataDir, resolveDocumentsClineDirectoryPath, resolveDocumentsExtensionPath, resolveGlobalCronSpecsDir, resolveGlobalSettingsPath, resolveHooksConfigSearchPaths, resolveMcpSettingsPath, resolvePluginConfigSearchPaths, resolvePluginModuleEntries, resolveProviderSettingsPath, resolveRulesConfigSearchPaths, resolveSessionDataDir, resolveSkillsConfigSearchPaths, resolveTeamDataDir, resolveWorkflowsConfigSearchPaths, resolveWorkspaceCronSpecsDir, SKILLS_CONFIG_DIRECTORY_NAME, setClineDir, setClineDirIfUnset, setHomeDir, setHomeDirIfUnset, WORKFLOWS_CONFIG_DIRECTORY_NAME, } from "./paths";
|
package/dist/storage/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var GC=Object.defineProperty;var MC=(C)=>C;function OC(C,S){this[C]=MC.bind(null,S)}var lC=(C,S)=>{for(var M in S)GC(C,M,{get:S[M],enumerable:!0,configurable:!0,set:OC.bind(S,M)})};import{existsSync as L,readdirSync as FC}from"node:fs";import{basename as y,dirname as k,join as m}from"node:path";var KC=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g,IC=" ";function u(C){return C.normalize("NFC").replace(KC," ")}function TC(C){let S=y(C),M=S.replace(/ (AM|PM)\./gi,`${IC}$1.`);return M===S?C:m(k(C),M)}function WC(C){return C.normalize("NFD")}function w(C){return C.replace(/'/g,"’")}function gC(C){let S=k(C),M=u(y(C));try{for(let O of FC(S))if(u(O)===M)return m(S,O)}catch{}return}function qC(C){if(L(C))return C;let S=TC(C);if(S!==C&&L(S))return S;let M=WC(C);if(M!==C&&L(M))return M;let O=w(C);if(O!==C&&L(O))return O;let F=w(M);if(F!==M&&F!==O&&L(F))return F;return gC(C)}import{appendFileSync as vC,existsSync as I,mkdirSync as R,readdirSync as DC,readFileSync as LC,statSync as Q}from"node:fs";import{homedir as QC}from"node:os";import{dirname as U,join as G,resolve as Y}from"node:path";var H=".clinerules",X=".cline",l=".agents",J="agents",B="hooks",j="skills",E="rules",_="workflows",f="plugins",s="cline_mcp_settings.json";function YC(){let C=process?.env?.HOME?.trim();if(C&&C!=="~")return C;let S=process?.env?.USERPROFILE?.trim();if(S)return S;let M=process?.env?.HOMEDRIVE?.trim(),O=process?.env?.HOMEPATH?.trim();if(M&&O)return`${M}${O}`;let F=QC().trim();if(F&&F!=="~")return F;return"~"}var $=YC(),d=!1;function ZC(C){let S=C.trim();if(!S)return;$=S,d=!0}function $C(C){if(d)return;let S=C.trim();if(!S)return;$=S}var N,o=!1;function zC(C){let S=C.trim();if(!S)return;N=S,o=!0}function BC(C){if(o)return;let S=C.trim();if(!S)return;N=S}function T(){if(N)return N;let C=process.env.CLINE_DIR?.trim();if(C)return C;return G($,".cline")}function p(){return G($,"Documents","Cline")}function z(C){return G(p(),C)}function g(){let C=process.env.CLINE_DATA_DIR?.trim();if(C)return C;return G(T(),"data")}function _C(){let C=process.env.CLINE_SESSION_DATA_DIR?.trim();if(C)return C;return G(g(),"sessions")}function jC(){let C=process.env.CLINE_TEAM_DATA_DIR?.trim();if(C)return C;return G(g(),"teams")}function c(){let C=process.env.CLINE_DB_DATA_DIR?.trim();if(C)return C;return G(g(),"db")}function NC(){let C=process.env.CLINE_CRON_DB_PATH?.trim();if(C)return C;return G(c(),"cron.db")}function P(){return G(T(),"cron")}function A(C){return G(C,".cline","cron")}function b(C){if(typeof C==="string")return A(C);if(C?.cronSpecsDir?.trim())return C.cronSpecsDir.trim();if(C?.scope==="workspace"){let S=C.workspaceRoot?.trim();if(!S)throw Error("workspaceRoot is required for workspace cron scope");return A(S)}return P()}function XC(C){return G(b(C),"reports")}function EC(C){return G(b(C),"events")}function AC(){let C=process.env.CLINE_PROVIDER_SETTINGS_PATH?.trim();if(C)return C;return G(g(),"settings","providers.json")}function RC(){let C=process.env.CLINE_GLOBAL_SETTINGS_PATH?.trim();if(C)return C;return G(g(),"settings","global-settings.json")}function UC(){let C=process.env.CLINE_MCP_SETTINGS_PATH?.trim();if(C)return C;return G(g(),"settings",s)}function q(C){let S=new Set,M=[];for(let O of C){if(!O||S.has(O))continue;S.add(O),M.push(O)}return M}function HC(C){if(!C)return[];return[H,X,l].map((S)=>G(C,S,j))}function h(){return G(T(),J)}function JC(C){return q([C?G(C,X,J):"",h()])}function bC(C){let S=[z("Hooks"),G(T(),B)];if(C)S.push(G(C,H,B),G(C,X,B));return q(S)}function VC(C){return q([...HC(C),G(T(),j),G($,l,j)])}function xC(C){let S=C?[G(C,H),G(C,X,E)]:[],M=C?[G(C,"AGENTS.md")]:[];return q([...M,...S,G(T(),E),z("Rules")])}function uC(C){return q([C?G(C,".clinerules",_):"",z("Workflows"),G(T(),_),C?G(C,".cline",_):""])}function wC(C){return q([C?G(C,".cline",f):"",G(T(),f),z("Plugins")])}var n=new Set([".js",".ts"]),r="package.json",yC=["index.ts","index.js"];function Z(C){let S=C.lastIndexOf(".");if(S===-1)return!1;return n.has(C.slice(S))}function i(C){try{let S=JSON.parse(LC(C,"utf8"));if(!S.cline||typeof S.cline!=="object")return null;return S.cline}catch{return null}}function e(C){let S=C?.plugins;if(!Array.isArray(S))return[];return S.flatMap((M)=>M.paths??[])}function t(C){let S=Y(C);if(!I(S)||!Q(S).isDirectory())return null;let M=G(S,r);if(I(M)){let O=i(M),F=e(O).map((K)=>Y(S,K)).filter((K)=>I(K)&&Q(K).isFile()&&Z(K));if(F.length>0)return F}for(let O of yC){let F=G(S,O);if(I(F)&&Q(F).isFile())return[F]}return null}function a(C){let S=Y(C);if(!I(S))return[];let M=[],O=[S];while(O.length>0){let F=O.pop();if(!F)continue;let K;try{K=DC(F,{withFileTypes:!0})}catch{continue}for(let v of K){let W=G(F,v.name);if(v.isDirectory()){let V=G(W,r);if(I(V)){let SC=i(V),x=e(SC).map((D)=>Y(W,D)).filter((D)=>I(D)&&Q(D).isFile()&&Z(D));if(x.length>0){M.push(...x);continue}}O.push(W);continue}if(v.name.startsWith("."))continue;if(v.isFile()&&Z(W))M.push(W)}}return M.sort((F,K)=>F.localeCompare(K))}function kC(C,S){let M=[];for(let O of C){let F=O.trim();if(!F)continue;let K=Y(S,F);if(!I(K))throw Error(`Plugin path does not exist: ${K}`);if(Q(K).isDirectory()){let W=t(K);if(W){M.push(...W);continue}M.push(...a(K));continue}if(!Z(K))throw Error(`Plugin file must use a supported extension (${[...n].join(", ")}): ${K}`);M.push(K)}return M}function CC(C){let S=U(C);if(!I(S))R(S,{recursive:!0})}function mC(C){R(U(C),{recursive:!0}),vC(C,"")}function fC(C){if(C?.trim())return CC(C),U(C);let S=G(g(),"logs");if(!I(S))R(S,{recursive:!0});return S}export{$C as setHomeDirIfUnset,ZC as setHomeDir,BC as setClineDirIfUnset,zC as setClineDir,A as resolveWorkspaceCronSpecsDir,uC as resolveWorkflowsConfigSearchPaths,jC as resolveTeamDataDir,VC as resolveSkillsConfigSearchPaths,_C as resolveSessionDataDir,xC as resolveRulesConfigSearchPaths,AC as resolveProviderSettingsPath,t as resolvePluginModuleEntries,wC as resolvePluginConfigSearchPaths,UC as resolveMcpSettingsPath,bC as resolveHooksConfigSearchPaths,RC as resolveGlobalSettingsPath,P as resolveGlobalCronSpecsDir,qC as resolveExistingFilePath,z as resolveDocumentsExtensionPath,p as resolveDocumentsClineDirectoryPath,c as resolveDbDataDir,b as resolveCronSpecsDir,XC as resolveCronReportsDir,EC as resolveCronEventsDir,NC as resolveCronDbPath,kC as resolveConfiguredPluginModulePaths,T as resolveClineDir,g as resolveClineDataDir,h as resolveAgentsConfigDirPath,JC as resolveAgentConfigSearchPaths,Z as isPluginModulePath,CC as ensureParentDir,fC as ensureHookLogDir,mC as ensureFileExists,a as discoverPluginModulePaths,_ as WORKFLOWS_CONFIG_DIRECTORY_NAME,j as SKILLS_CONFIG_DIRECTORY_NAME,E as RULES_CONFIG_DIRECTORY_NAME,B as HOOKS_CONFIG_DIRECTORY_NAME,s as CLINE_MCP_SETTINGS_FILE_NAME,J as AGENT_CONFIG_DIRECTORY_NAME};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a possibly-mangled file path to an actual on-disk entry.
|
|
3
|
+
*
|
|
4
|
+
* Returns the literal path when it already exists; otherwise tries a small
|
|
5
|
+
* set of macOS-specific variants (narrow no-break space before AM/PM, NFD
|
|
6
|
+
* normalization, curly apostrophe) before falling back to a parent-directory
|
|
7
|
+
* scan that compares filenames after collapsing exotic Unicode whitespace.
|
|
8
|
+
*
|
|
9
|
+
* Returns `undefined` when no matching file can be located.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveExistingFilePath(filePath: string): string | undefined;
|