@opencow-ai/opencow-agent-sdk 0.4.17 → 0.4.18

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.
@@ -1,4 +1,5 @@
1
1
  import { type Tools } from '../Tool.js';
2
+ import { type ToolRuntimes } from '../types/toolRuntime.js';
2
3
  import type { CollapsedReadSearchGroup, CollapsibleMessage, RenderableMessage } from '../types/message.js';
3
4
  /**
4
5
  * Result of checking if a tool use is a search or read operation.
@@ -27,7 +28,7 @@ export type SearchOrReadResult = {
27
28
  * Also treats Write/Edit of memory files as collapsible.
28
29
  * Returns detailed information about whether it's a search or read operation.
29
30
  */
30
- export declare function getToolSearchOrReadInfo(toolName: string, toolInput: unknown, tools: Tools): SearchOrReadResult;
31
+ export declare function getToolSearchOrReadInfo(toolName: string, toolInput: unknown, tools: ToolRuntimes): SearchOrReadResult;
31
32
  /**
32
33
  * Check if a tool_use content block is a search/read operation.
33
34
  * Returns { isSearch, isRead, isREPL } if it's a collapsible search/read, null otherwise.
@@ -1,4 +1,4 @@
1
- import type { ToolRuntimeContext } from '../Tool.js';
1
+ import type { ToolRuntimeContext } from '../types/toolRuntime.js';
2
2
  import type { FrontmatterShell } from '../lib/frontmatterParser.js';
3
3
  /**
4
4
  * Parses prompt text and executes any embedded shell commands.
@@ -6,9 +6,7 @@ import type { FrontmatterShell } from '../lib/frontmatterParser.js';
6
6
  * - Code blocks: ```! command ```
7
7
  * - Inline: !`command`
8
8
  *
9
- * @param shell - Shell to route commands through. Defaults to bash.
10
- * This is *never* read from settings.defaultShell it comes from .md
11
- * frontmatter (author's choice) or is undefined for built-in commands.
12
- * See docs/design/ps-shell-selection.md §5.3.
9
+ * @param shell - Explicit frontmatter shell. When omitted, uses the detected
10
+ * process default. Explicit requests never fall back to another language.
13
11
  */
14
12
  export declare function executeShellCommandsInPrompt(text: string, context: ToolRuntimeContext, slashCommandName: string, shell?: FrontmatterShell): Promise<string>;
@@ -333,10 +333,6 @@ export declare const SettingsSchema: () => z.ZodObject<{
333
333
  sparsePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
334
334
  }, z.core.$strip>>;
335
335
  disableAllHooks: z.ZodOptional<z.ZodBoolean>;
336
- defaultShell: z.ZodOptional<z.ZodEnum<{
337
- bash: "bash";
338
- powershell: "powershell";
339
- }>>;
340
336
  allowManagedHooksOnly: z.ZodOptional<z.ZodBoolean>;
341
337
  allowedHttpHookUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
342
338
  httpHookAllowedEnvVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -5,7 +5,8 @@ import type { Command } from '../types/command.js';
5
5
  import type { ChannelPermissionCallbacks } from '../capabilities/mcp/channelPermissions.js';
6
6
  import type { ElicitationRequestEvent } from '../capabilities/mcp/elicitationHandler.js';
7
7
  import type { MCPServerConnection, ServerResource } from '../capabilities/mcp/types.js';
8
- import { type Tool, type ToolPermissionContext } from '../Tool.js';
8
+ import { type ToolPermissionContext } from '../Tool.js';
9
+ import type { ToolRuntime } from '../types/toolRuntime.js';
9
10
  import type { TaskState } from '../tasks/types.js';
10
11
  import type { AgentColorName } from '../capabilities/tools/AgentTool/agentColorManager.js';
11
12
  import type { AgentDefinitionsResult } from '../capabilities/tools/AgentTool/loadAgentsDir.js';
@@ -119,7 +120,7 @@ export type AppState = DeepImmutable<{
119
120
  companionPetAt?: number;
120
121
  mcp: {
121
122
  clients: MCPServerConnection[];
122
- tools: Tool[];
123
+ tools: ToolRuntime[];
123
124
  commands: Command[];
124
125
  resources: Record<string, ServerResource[]>;
125
126
  /**
@@ -1,6 +1,6 @@
1
1
  import type { AppState } from '../../state/AppStateStore.js';
2
2
  import type { SetAppState, Task, TaskStateBase } from '../Task.js';
3
- import type { Tools } from '../../Tool.js';
3
+ import { type ToolRuntimes } from '../../types/toolRuntime.js';
4
4
  import type { AgentToolResult } from '../../capabilities/tools/AgentTool/agentToolUtils.js';
5
5
  import type { AgentDefinition } from '../../capabilities/tools/AgentTool/loadAgentsDir.js';
6
6
  import type { Message } from '../../types/message.js';
@@ -36,13 +36,13 @@ export declare function getTokenCountFromTracker(tracker: ProgressTracker): numb
36
36
  * from Tool.getActivityDescription() at recording time.
37
37
  */
38
38
  export type ActivityDescriptionResolver = (toolName: string, input: Record<string, unknown>) => string | undefined;
39
- export declare function updateProgressFromMessage(tracker: ProgressTracker, message: Message, resolveActivityDescription?: ActivityDescriptionResolver, tools?: Tools): void;
39
+ export declare function updateProgressFromMessage(tracker: ProgressTracker, message: Message, resolveActivityDescription?: ActivityDescriptionResolver, tools?: ToolRuntimes): void;
40
40
  export declare function getProgressUpdate(tracker: ProgressTracker): AgentProgress;
41
41
  /**
42
42
  * Creates an ActivityDescriptionResolver from a tools list.
43
43
  * Looks up the tool by name and calls getActivityDescription if available.
44
44
  */
45
- export declare function createActivityDescriptionResolver(tools: Tools): ActivityDescriptionResolver;
45
+ export declare function createActivityDescriptionResolver(tools: ToolRuntimes): ActivityDescriptionResolver;
46
46
  export type LocalAgentTaskState = TaskStateBase & {
47
47
  type: 'local_agent';
48
48
  agentId: string;
package/dist/tools.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import { type Tools } from './Tool.js';
1
+ import { type ToolPermissionContext, type ToolRuntimes } from './types/toolRuntime.js';
2
2
  /**
3
3
  * Register the built-in tools provider. Called by CLI at startup with a
4
4
  * function that returns getAllBaseTools(). SDK mode leaves this null.
5
5
  */
6
- export declare function registerBuiltInToolsProvider(provider: () => Tools): void;
6
+ export declare function registerBuiltInToolsProvider(provider: () => ToolRuntimes): void;
7
7
  export { ALL_AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, ASYNC_AGENT_ALLOWED_TOOLS, COORDINATOR_MODE_ALLOWED_TOOLS, } from './constants/tools.js';
8
- import type { ToolPermissionContext } from './Tool.js';
9
8
  import { REPL_ONLY_TOOLS } from './capabilities/tools/REPLTool/constants.js';
10
9
  export { REPL_ONLY_TOOLS };
11
10
  /**
@@ -28,7 +27,7 @@ export declare function getToolsForDefaultPreset(): string[];
28
27
  *
29
28
  * NOTE: This MUST stay in sync with https://console.statsig.com/4aF3Ewatb6xPVpCwxb5nA3/dynamic_configs/claude_code_global_system_caching, in order to cache the system prompt across users.
30
29
  */
31
- export declare function getAllBaseTools(): Tools;
30
+ export declare function getAllBaseTools(): ToolRuntimes;
32
31
  /**
33
32
  * Filters out tools that are blanket-denied by the permission context.
34
33
  * A tool is filtered out if there's a deny rule matching its name with no
@@ -45,7 +44,7 @@ export declare function filterToolsByDenyRules<T extends {
45
44
  toolName: string;
46
45
  };
47
46
  }>(tools: readonly T[], permissionContext: ToolPermissionContext): T[];
48
- export declare const getTools: (permissionContext: ToolPermissionContext) => Tools;
47
+ export declare const getTools: (permissionContext: ToolPermissionContext, explicitBuiltIns?: ToolRuntimes) => ToolRuntimes;
49
48
  /**
50
49
  * Assemble the full tool pool for a given permission context and MCP tools.
51
50
  *
@@ -62,7 +61,7 @@ export declare const getTools: (permissionContext: ToolPermissionContext) => Too
62
61
  * @param mcpTools - MCP tools from appState.mcp.tools
63
62
  * @returns Combined, deduplicated array of built-in and MCP tools
64
63
  */
65
- export declare function assembleToolPool(permissionContext: ToolPermissionContext, mcpTools: Tools): Tools;
64
+ export declare function assembleToolPool(permissionContext: ToolPermissionContext, mcpTools: ToolRuntimes, explicitBuiltIns?: ToolRuntimes): ToolRuntimes;
66
65
  /**
67
66
  * Get all tools including both built-in tools and MCP tools.
68
67
  *
@@ -77,4 +76,4 @@ export declare function assembleToolPool(permissionContext: ToolPermissionContex
77
76
  * @param mcpTools - MCP tools from appState.mcp.tools
78
77
  * @returns Combined array of built-in and MCP tools
79
78
  */
80
- export declare function getMergedTools(permissionContext: ToolPermissionContext, mcpTools: Tools): Tools;
79
+ export declare function getMergedTools(permissionContext: ToolPermissionContext, mcpTools: ToolRuntimes): ToolRuntimes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencow-ai/opencow-agent-sdk",
3
- "version": "0.4.17",
3
+ "version": "0.4.18",
4
4
  "description": "Claude Code opened to any LLM — OpenAI, Gemini, DeepSeek, Ollama, and 200+ models",
5
5
  "type": "module",
6
6
  "main": "./dist/sdk.js",