@opencow-ai/opencow-agent-sdk 0.4.16 → 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.
Files changed (38) hide show
  1. package/README.md +6 -0
  2. package/dist/Tool.d.ts +5 -11
  3. package/dist/capabilities/mcp/utils.d.ts +6 -6
  4. package/dist/capabilities/shell/posixShellDetection.d.ts +1 -0
  5. package/dist/capabilities/shell/powershellDetection.d.ts +1 -10
  6. package/dist/capabilities/shell/shellCapabilities.d.ts +33 -0
  7. package/dist/capabilities/shell/shellProvider.d.ts +0 -1
  8. package/dist/capabilities/shell/shellToolUtils.d.ts +0 -10
  9. package/dist/capabilities/tools/BashTool/prompt.d.ts +1 -0
  10. package/dist/capabilities/tools/NotebookEditTool/NotebookEditTool.d.ts +0 -8
  11. package/dist/cli.mjs +174762 -175646
  12. package/dist/client.js +4518 -4772
  13. package/dist/constants/envVars.d.ts +0 -2
  14. package/dist/constants/prompts.d.ts +6 -4
  15. package/dist/entrypoints/sdk/runtimeTypes.d.ts +9 -0
  16. package/dist/lib/frontmatterParser.d.ts +4 -4
  17. package/dist/lib/windowsPaths.d.ts +12 -10
  18. package/dist/providers/shared/model/model.d.ts +0 -9
  19. package/dist/sdk.js +4518 -4772
  20. package/dist/session/collapseReadSearch.d.ts +2 -1
  21. package/dist/session/promptShellExecution.d.ts +3 -5
  22. package/dist/session/sessionStorage.d.ts +0 -4
  23. package/dist/session/settings/types.d.ts +0 -9
  24. package/dist/state/AppStateStore.d.ts +3 -4
  25. package/dist/tasks/LocalAgentTask/LocalAgentTask.d.ts +3 -3
  26. package/dist/tools.d.ts +6 -7
  27. package/dist/types/hooks.d.ts +0 -2
  28. package/dist/types/logs.d.ts +1 -26
  29. package/dist/types/toolRuntime.d.ts +0 -2
  30. package/package.json +1 -1
  31. package/dist/capabilities/generatedFiles.d.ts +0 -14
  32. package/dist/capabilities/tools/shared/teamMemorySync/index.d.ts +0 -121
  33. package/dist/capabilities/tools/shared/teamMemorySync/types.d.ts +0 -132
  34. package/dist/capabilities/tools/shared/teamMemorySync/watcher.d.ts +0 -78
  35. package/dist/lib/sequential.d.ts +0 -12
  36. package/dist/session/attribution.d.ts +0 -40
  37. package/dist/session/commitAttribution.d.ts +0 -193
  38. package/dist/session/sessionFileAccessHooks.d.ts +0 -11
@@ -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;
@@ -234,7 +233,6 @@ export declare const ENV_VARS: {
234
233
  readonly MEMORY_EXTRA_GUIDELINES: EnvVarSpec;
235
234
  readonly MEMORY_PATH_OVERRIDE: EnvVarSpec;
236
235
  readonly DEBUG_INPUT: EnvVarSpec;
237
- readonly DISABLE_CO_AUTHORED_BY: EnvVarSpec;
238
236
  readonly DISABLE_EARLY_INPUT: EnvVarSpec;
239
237
  readonly ENABLE_EXTENDED_KEYS: EnvVarSpec;
240
238
  readonly USE_READABLE_STDIN: EnvVarSpec;
@@ -1,4 +1,4 @@
1
- import type { Tools } from '../Tool.js';
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 getSystemPrompt(tools: Tools, model: string, additionalWorkingDirectories?: string[], mcpClients?: MCPServerConnection[]): Promise<string[]>;
16
- export declare function computeEnvInfo(modelId: string, additionalWorkingDirectories?: string[]): Promise<string>;
17
- export declare function computeSimpleEnvInfo(modelId: string, additionalWorkingDirectories?: string[]): Promise<string>;
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[]>;
@@ -123,6 +123,7 @@ export type SdkMcpToolDefinition<Schema extends AnyZodRawShape = AnyZodRawShape>
123
123
  _meta?: Record<string, unknown>;
124
124
  };
125
125
  export type SettingSource = 'user' | 'project' | 'local';
126
+ export type BuiltInToolPreset = 'default' | 'none';
126
127
  import type { SdkTool } from '../../capabilities/SdkTool.js';
127
128
  import type { LayoutProfile } from '../../session/layout/LayoutProfile.js';
128
129
  import type { SdkRule } from '../../session/rules/SdkRule.js';
@@ -202,6 +203,14 @@ export type Options = {
202
203
  permissionMode?: string;
203
204
  canUseTool?: SdkCanUseTool;
204
205
  mcpServers?: Record<string, McpServerConfig>;
206
+ /**
207
+ * Selects the SDK-owned built-in tool set for this query.
208
+ *
209
+ * Omitted preserves the embedding contract and injects no SDK built-ins.
210
+ * `'default'` resolves the capability-aware SDK defaults, while `'none'`
211
+ * explicitly selects an empty built-in set.
212
+ */
213
+ builtInToolPreset?: BuiltInToolPreset;
205
214
  /**
206
215
  * Phase 1B.5b — host-facing inline tools. Each `SdkTool` is converted to
207
216
  * 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 (caller defaults to bash).
84
- * Logs a warning and returns undefined for unrecognized values — we fall
85
- * back to bash rather than failing the skill load, matching how `effort`
86
- * and other fields degrade.
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
- * If Windows, set the SHELL environment variable to git-bash path.
3
- * This is used by BashTool and Shell.ts for user shell commands.
4
- * COMSPEC is left unchanged for system process execution.
5
- */
6
- export declare function setShellIfWindows(): void;
7
- /**
8
- * Find the path where `bash.exe` included with git-bash exists, exiting the process if not found.
9
- */
10
- export declare const findGitBashPath: any;
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;
@@ -86,15 +86,6 @@ export declare function renderModelSetting(setting: ModelName | ModelAlias): str
86
86
  */
87
87
  export declare function getPublicModelDisplayName(model: ModelName): string | null;
88
88
  export declare function renderModelName(model: ModelName): string;
89
- /**
90
- * Returns a safe author name for public display (e.g., in git commit trailers).
91
- * Returns "Claude {ModelName}" for publicly known models, or "Claude ({model})"
92
- * for unknown/internal models so the exact model name is preserved.
93
- *
94
- * @param model The full model name
95
- * @returns "Claude {ModelName}" for public models, or "Claude ({model})" for non-public models
96
- */
97
- export declare function getPublicModelName(model: ModelName): string;
98
89
  /**
99
90
  * Returns a full model name for use in this session, possibly after resolving
100
91
  * a model alias.