@opencow-ai/opencow-agent-sdk 0.4.17 → 0.4.19
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 +6 -0
- package/dist/Tool.d.ts +5 -11
- package/dist/capabilities/mcp/utils.d.ts +6 -6
- package/dist/capabilities/shell/posixShellDetection.d.ts +1 -0
- package/dist/capabilities/shell/powershellDetection.d.ts +1 -10
- package/dist/capabilities/shell/shellCapabilities.d.ts +33 -0
- package/dist/capabilities/shell/shellProvider.d.ts +0 -1
- package/dist/capabilities/shell/shellToolUtils.d.ts +0 -10
- package/dist/capabilities/tools/AgentTool/agentLifecycleFinalizer.d.ts +3 -0
- package/dist/cli.mjs +173450 -173159
- package/dist/client.d.ts +3 -2
- package/dist/client.js +5600 -5155
- package/dist/constants/envVars.d.ts +0 -1
- package/dist/constants/prompts.d.ts +6 -4
- package/dist/entrypoints/sdk/runtimeTypes.d.ts +14 -7
- package/dist/lib/frontmatterParser.d.ts +4 -4
- package/dist/lib/windowsPaths.d.ts +12 -10
- package/dist/sdk.js +5600 -5155
- package/dist/session/backgroundAbortRegistry.d.ts +15 -7
- package/dist/session/backgroundTaskScope.d.ts +29 -0
- package/dist/session/collapseReadSearch.d.ts +2 -1
- package/dist/session/promptShellExecution.d.ts +3 -5
- package/dist/session/settings/types.d.ts +0 -4
- package/dist/state/AppStateStore.d.ts +3 -2
- package/dist/tasks/LocalAgentTask/LocalAgentTask.d.ts +3 -3
- package/dist/tools.d.ts +6 -7
- package/package.json +1 -1
|
@@ -225,7 +225,6 @@ export declare const ENV_VARS: {
|
|
|
225
225
|
readonly USE_GITHUB: EnvVarSpec;
|
|
226
226
|
readonly USE_NATIVE_FILE_SEARCH: EnvVarSpec;
|
|
227
227
|
readonly USE_OPENAI: EnvVarSpec;
|
|
228
|
-
readonly USE_POWERSHELL_TOOL: EnvVarSpec;
|
|
229
228
|
readonly USE_VERTEX: EnvVarSpec;
|
|
230
229
|
readonly VERIFY_PLAN: EnvVarSpec;
|
|
231
230
|
readonly WEBSOCKET_AUTH_FILE_DESCRIPTOR: EnvVarSpec;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolRuntimes } from '../types/toolRuntime.js';
|
|
2
2
|
import type { MCPServerConnection } from '../capabilities/mcp/types.js';
|
|
3
3
|
export declare const CLAUDE_CODE_DOCS_MAP_URL = "https://code.claude.com/docs/en/claude_code_docs_map.md";
|
|
4
4
|
/**
|
|
@@ -12,9 +12,11 @@ export declare const CLAUDE_CODE_DOCS_MAP_URL = "https://code.claude.com/docs/en
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const SYSTEM_PROMPT_DYNAMIC_BOUNDARY = "__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__";
|
|
14
14
|
export declare function prependBullets(items: Array<string | string[]>): string[];
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
15
|
+
export declare function getUsingYourToolsSection(enabledTools: Set<string>): string;
|
|
16
|
+
export declare function getSystemPrompt(tools: ToolRuntimes, model: string, additionalWorkingDirectories?: string[], mcpClients?: MCPServerConnection[]): Promise<string[]>;
|
|
17
|
+
export declare function computeEnvInfo(modelId: string, additionalWorkingDirectories?: string[], enabledToolNames?: ReadonlySet<string>): Promise<string>;
|
|
18
|
+
export declare function computeSimpleEnvInfo(modelId: string, additionalWorkingDirectories?: string[], enabledToolNames?: ReadonlySet<string>): Promise<string>;
|
|
19
|
+
export declare function getShellInfoLine(enabledToolNames?: ReadonlySet<string>): string | null;
|
|
18
20
|
export declare function getUnameSR(): string;
|
|
19
21
|
export declare const DEFAULT_AGENT_PROMPT = "You are an agent for OpenCow, an open-source fork of Claude Code. Given the user's message, you should use the tools available to complete the task. Complete the task fully\u2014don't gold-plate, but don't leave it half-done. When you complete the task, respond with a concise report covering what was done and any key findings \u2014 the caller will relay this to the user, so it only needs the essentials.";
|
|
20
22
|
export declare function enhanceSystemPromptWithEnvDetails(existingSystemPrompt: string[], model: string, additionalWorkingDirectories?: string[], enabledToolNames?: ReadonlySet<string>): Promise<string[]>;
|
|
@@ -20,14 +20,12 @@ export type Query = AsyncIterable<SDKMessage> & {
|
|
|
20
20
|
*/
|
|
21
21
|
interrupt(): Promise<void> | void;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
* touching the main turn or
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* per-agent "stop" affordance (desktop UI) on top of the model-facing
|
|
28
|
-
* TaskStop tool.
|
|
23
|
+
* Stop a single in-flight run_in_background sub-agent by its agentId without
|
|
24
|
+
* touching the main turn or sibling agents. Resolves after the agent's MCP
|
|
25
|
+
* cleanup and finalizers complete. Unknown or already-settled agents resolve
|
|
26
|
+
* immediately.
|
|
29
27
|
*/
|
|
30
|
-
killAgent(agentId: string): void
|
|
28
|
+
killAgent(agentId: string): Promise<void>;
|
|
31
29
|
};
|
|
32
30
|
/** @internal */
|
|
33
31
|
export type InternalQuery = Query;
|
|
@@ -123,6 +121,7 @@ export type SdkMcpToolDefinition<Schema extends AnyZodRawShape = AnyZodRawShape>
|
|
|
123
121
|
_meta?: Record<string, unknown>;
|
|
124
122
|
};
|
|
125
123
|
export type SettingSource = 'user' | 'project' | 'local';
|
|
124
|
+
export type BuiltInToolPreset = 'default' | 'none';
|
|
126
125
|
import type { SdkTool } from '../../capabilities/SdkTool.js';
|
|
127
126
|
import type { LayoutProfile } from '../../session/layout/LayoutProfile.js';
|
|
128
127
|
import type { SdkRule } from '../../session/rules/SdkRule.js';
|
|
@@ -202,6 +201,14 @@ export type Options = {
|
|
|
202
201
|
permissionMode?: string;
|
|
203
202
|
canUseTool?: SdkCanUseTool;
|
|
204
203
|
mcpServers?: Record<string, McpServerConfig>;
|
|
204
|
+
/**
|
|
205
|
+
* Selects the SDK-owned built-in tool set for this query.
|
|
206
|
+
*
|
|
207
|
+
* Omitted preserves the embedding contract and injects no SDK built-ins.
|
|
208
|
+
* `'default'` resolves the capability-aware SDK defaults, while `'none'`
|
|
209
|
+
* explicitly selects an empty built-in set.
|
|
210
|
+
*/
|
|
211
|
+
builtInToolPreset?: BuiltInToolPreset;
|
|
205
212
|
/**
|
|
206
213
|
* Phase 1B.5b — host-facing inline tools. Each `SdkTool` is converted to
|
|
207
214
|
* an internal `Tool` via `src/session/toInternalTool.ts` at query setup time
|
|
@@ -80,9 +80,9 @@ export type FrontmatterShell = 'bash' | 'powershell';
|
|
|
80
80
|
/**
|
|
81
81
|
* Parse and validate the `shell:` frontmatter field.
|
|
82
82
|
*
|
|
83
|
-
* Returns undefined for absent/null/empty
|
|
84
|
-
* Logs a warning and returns undefined for unrecognized values
|
|
85
|
-
*
|
|
86
|
-
*
|
|
83
|
+
* Returns undefined for absent/null/empty so the caller uses the detected
|
|
84
|
+
* default shell. Logs a warning and returns undefined for unrecognized values
|
|
85
|
+
* rather than failing the skill load, matching how `effort` and other fields
|
|
86
|
+
* degrade.
|
|
87
87
|
*/
|
|
88
88
|
export declare function parseShellFrontmatter(value: unknown, source: string): FrontmatterShell | undefined;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export type GitBashSource = 'env' | 'standard-path' | 'path';
|
|
2
|
+
export type GitBashExecutable = {
|
|
3
|
+
path: string;
|
|
4
|
+
source: GitBashSource;
|
|
5
|
+
};
|
|
6
|
+
export declare class InvalidGitBashPathError extends Error {
|
|
7
|
+
readonly configuredPath: string;
|
|
8
|
+
readonly code = "INVALID_GIT_BASH_PATH";
|
|
9
|
+
constructor(configuredPath: string);
|
|
10
|
+
}
|
|
11
|
+
/** Resolve Git Bash without terminating the embedding process. */
|
|
12
|
+
export declare function findGitBash(): GitBashExecutable | null;
|
|
11
13
|
/** Convert a Windows path to a POSIX path using pure JS. */
|
|
12
14
|
export declare const windowsPathToPosixPath: {
|
|
13
15
|
(p: string): string;
|