saving in place
This commit is contained in:
1
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/LICENSE.md
generated
vendored
Normal file
1
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
© Anthropic PBC. All rights reserved. Use is subject to Anthropic's [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms).
|
||||
41
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/README.md
generated
vendored
Normal file
41
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/README.md
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# Claude Code
|
||||
|
||||
 [![npm]](https://www.npmjs.com/package/@anthropic-ai/claude-code)
|
||||
|
||||
[npm]: https://img.shields.io/npm/v/@anthropic-ai/claude-code.svg?style=flat-square
|
||||
|
||||
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows -- all through natural language commands. Use it in your terminal, IDE, or tag @claude on Github.
|
||||
|
||||
**Learn more in the [official documentation](https://docs.claude.com/en/docs/claude-code/overview)**.
|
||||
|
||||
<img src="https://github.com/anthropics/claude-code/blob/main/demo.gif?raw=1" />
|
||||
|
||||
## Get started
|
||||
|
||||
1. Install Claude Code:
|
||||
|
||||
```sh
|
||||
npm install -g @anthropic-ai/claude-code
|
||||
```
|
||||
|
||||
2. Navigate to your project directory and run `claude`.
|
||||
|
||||
## Reporting Bugs
|
||||
|
||||
We welcome feedback during this beta period. Use the `/bug` command to report issues directly within Claude Code, or file a [GitHub issue](https://github.com/anthropics/claude-code/issues).
|
||||
|
||||
## Data collection, usage, and retention
|
||||
|
||||
When you use Claude Code, we collect feedback, which includes usage data (such as code acceptance or rejections), associated conversation data, and user feedback submitted via the `/bug` command.
|
||||
|
||||
### How we use your data
|
||||
|
||||
We may use feedback to improve our products and services, but we will not train generative models using your feedback from Claude Code. Given their potentially sensitive nature, we store user feedback transcripts for only 30 days.
|
||||
|
||||
If you choose to send us feedback about Claude Code, such as transcripts of your usage, Anthropic may use that feedback to debug related issues and improve Claude Code's functionality (e.g., to reduce the risk of similar bugs occurring in the future).
|
||||
|
||||
### Privacy safeguards
|
||||
|
||||
We have implemented several safeguards to protect your data, including limited retention periods for sensitive information, restricted access to user session data, and clear policies against using feedback for model training.
|
||||
|
||||
For full details, please review our [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms) and [Privacy Policy](https://www.anthropic.com/legal/privacy).
|
||||
3741
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/cli.js
generated
vendored
Executable file
3741
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/cli.js
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
21
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/node_modules/.bin/claude
generated
vendored
Executable file
21
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/node_modules/.bin/claude
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="/home/administrator/projects/mev-beta/node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/node_modules:/home/administrator/projects/mev-beta/node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/node_modules:/home/administrator/projects/mev-beta/node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules:/home/administrator/projects/mev-beta/node_modules/.pnpm/node_modules"
|
||||
else
|
||||
export NODE_PATH="/home/administrator/projects/mev-beta/node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/node_modules:/home/administrator/projects/mev-beta/node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/node_modules:/home/administrator/projects/mev-beta/node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules:/home/administrator/projects/mev-beta/node_modules/.pnpm/node_modules:$NODE_PATH"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../../cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../../cli.js" "$@"
|
||||
fi
|
||||
32
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/package.json
generated
vendored
Normal file
32
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/package.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "@anthropic-ai/claude-code",
|
||||
"version": "1.0.120",
|
||||
"main": "sdk.mjs",
|
||||
"types": "sdk.d.ts",
|
||||
"bin": {
|
||||
"claude": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"type": "module",
|
||||
"author": "Anthropic <support@anthropic.com>",
|
||||
"license": "SEE LICENSE IN README.md",
|
||||
"description": "Use Claude, Anthropic's AI assistant, right from your terminal. Claude can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.",
|
||||
"homepage": "https://github.com/anthropics/claude-code",
|
||||
"bugs": {
|
||||
"url": "https://github.com/anthropics/claude-code/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "node -e \"if (!process.env.AUTHORIZED) { console.error('ERROR: Direct publishing is not allowed.\\nPlease use the publish-external.sh script to publish this package.'); process.exit(1); }\""
|
||||
},
|
||||
"dependencies": {},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-darwin-arm64": "^0.33.5",
|
||||
"@img/sharp-darwin-x64": "^0.33.5",
|
||||
"@img/sharp-linux-arm": "^0.33.5",
|
||||
"@img/sharp-linux-arm64": "^0.33.5",
|
||||
"@img/sharp-linux-x64": "^0.33.5",
|
||||
"@img/sharp-win32-x64": "^0.33.5"
|
||||
}
|
||||
}
|
||||
313
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/sdk-tools.d.ts
generated
vendored
Normal file
313
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/sdk-tools.d.ts
generated
vendored
Normal file
@@ -0,0 +1,313 @@
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* This file was automatically generated by json-schema-to-typescript.
|
||||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
||||
* and run json-schema-to-typescript to regenerate this file.
|
||||
*/
|
||||
|
||||
/**
|
||||
* JSON Schema definitions for Claude CLI tool inputs
|
||||
*/
|
||||
export type ToolInputSchemas =
|
||||
| AgentInput
|
||||
| BashInput
|
||||
| BashOutputInput
|
||||
| ExitPlanModeInput
|
||||
| FileEditInput
|
||||
| FileMultiEditInput
|
||||
| FileReadInput
|
||||
| FileWriteInput
|
||||
| GlobInput
|
||||
| GrepInput
|
||||
| KillShellInput
|
||||
| ListMcpResourcesInput
|
||||
| McpInput
|
||||
| NotebookEditInput
|
||||
| ReadMcpResourceInput
|
||||
| TodoWriteInput
|
||||
| WebFetchInput
|
||||
| WebSearchInput;
|
||||
|
||||
export interface AgentInput {
|
||||
/**
|
||||
* A short (3-5 word) description of the task
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* The task for the agent to perform
|
||||
*/
|
||||
prompt: string;
|
||||
/**
|
||||
* The type of specialized agent to use for this task
|
||||
*/
|
||||
subagent_type: string;
|
||||
}
|
||||
export interface BashInput {
|
||||
/**
|
||||
* The command to execute
|
||||
*/
|
||||
command: string;
|
||||
/**
|
||||
* Optional timeout in milliseconds (max 600000)
|
||||
*/
|
||||
timeout?: number;
|
||||
/**
|
||||
* Clear, concise description of what this command does in 5-10 words, in active voice. Examples:
|
||||
* Input: ls
|
||||
* Output: List files in current directory
|
||||
*
|
||||
* Input: git status
|
||||
* Output: Show working tree status
|
||||
*
|
||||
* Input: npm install
|
||||
* Output: Install package dependencies
|
||||
*
|
||||
* Input: mkdir foo
|
||||
* Output: Create directory 'foo'
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* Set to true to run this command in the background. Use BashOutput to read the output later.
|
||||
*/
|
||||
run_in_background?: boolean;
|
||||
}
|
||||
export interface BashOutputInput {
|
||||
/**
|
||||
* The ID of the background shell to retrieve output from
|
||||
*/
|
||||
bash_id: string;
|
||||
/**
|
||||
* Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.
|
||||
*/
|
||||
filter?: string;
|
||||
}
|
||||
export interface ExitPlanModeInput {
|
||||
/**
|
||||
* The plan you came up with, that you want to run by the user for approval. Supports markdown. The plan should be pretty concise.
|
||||
*/
|
||||
plan: string;
|
||||
}
|
||||
export interface FileEditInput {
|
||||
/**
|
||||
* The absolute path to the file to modify
|
||||
*/
|
||||
file_path: string;
|
||||
/**
|
||||
* The text to replace
|
||||
*/
|
||||
old_string: string;
|
||||
/**
|
||||
* The text to replace it with (must be different from old_string)
|
||||
*/
|
||||
new_string: string;
|
||||
/**
|
||||
* Replace all occurences of old_string (default false)
|
||||
*/
|
||||
replace_all?: boolean;
|
||||
}
|
||||
export interface FileMultiEditInput {
|
||||
/**
|
||||
* The absolute path to the file to modify
|
||||
*/
|
||||
file_path: string;
|
||||
/**
|
||||
* Array of edit operations to perform sequentially on the file
|
||||
*
|
||||
* @minItems 1
|
||||
*/
|
||||
edits: [
|
||||
{
|
||||
/**
|
||||
* The text to replace
|
||||
*/
|
||||
old_string: string;
|
||||
/**
|
||||
* The text to replace it with
|
||||
*/
|
||||
new_string: string;
|
||||
/**
|
||||
* Replace all occurences of old_string (default false).
|
||||
*/
|
||||
replace_all?: boolean;
|
||||
},
|
||||
...{
|
||||
/**
|
||||
* The text to replace
|
||||
*/
|
||||
old_string: string;
|
||||
/**
|
||||
* The text to replace it with
|
||||
*/
|
||||
new_string: string;
|
||||
/**
|
||||
* Replace all occurences of old_string (default false).
|
||||
*/
|
||||
replace_all?: boolean;
|
||||
}[]
|
||||
];
|
||||
}
|
||||
export interface FileReadInput {
|
||||
/**
|
||||
* The absolute path to the file to read
|
||||
*/
|
||||
file_path: string;
|
||||
/**
|
||||
* The line number to start reading from. Only provide if the file is too large to read at once
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
* The number of lines to read. Only provide if the file is too large to read at once.
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
export interface FileWriteInput {
|
||||
/**
|
||||
* The absolute path to the file to write (must be absolute, not relative)
|
||||
*/
|
||||
file_path: string;
|
||||
/**
|
||||
* The content to write to the file
|
||||
*/
|
||||
content: string;
|
||||
}
|
||||
export interface GlobInput {
|
||||
/**
|
||||
* The glob pattern to match files against
|
||||
*/
|
||||
pattern: string;
|
||||
/**
|
||||
* The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.
|
||||
*/
|
||||
path?: string;
|
||||
}
|
||||
export interface GrepInput {
|
||||
/**
|
||||
* The regular expression pattern to search for in file contents
|
||||
*/
|
||||
pattern: string;
|
||||
/**
|
||||
* File or directory to search in (rg PATH). Defaults to current working directory.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* Glob pattern to filter files (e.g. "*.js", "*.{ts,tsx}") - maps to rg --glob
|
||||
*/
|
||||
glob?: string;
|
||||
/**
|
||||
* Output mode: "content" shows matching lines (supports -A/-B/-C context, -n line numbers, head_limit), "files_with_matches" shows file paths (supports head_limit), "count" shows match counts (supports head_limit). Defaults to "files_with_matches".
|
||||
*/
|
||||
output_mode?: "content" | "files_with_matches" | "count";
|
||||
/**
|
||||
* Number of lines to show before each match (rg -B). Requires output_mode: "content", ignored otherwise.
|
||||
*/
|
||||
"-B"?: number;
|
||||
/**
|
||||
* Number of lines to show after each match (rg -A). Requires output_mode: "content", ignored otherwise.
|
||||
*/
|
||||
"-A"?: number;
|
||||
/**
|
||||
* Number of lines to show before and after each match (rg -C). Requires output_mode: "content", ignored otherwise.
|
||||
*/
|
||||
"-C"?: number;
|
||||
/**
|
||||
* Show line numbers in output (rg -n). Requires output_mode: "content", ignored otherwise.
|
||||
*/
|
||||
"-n"?: boolean;
|
||||
/**
|
||||
* Case insensitive search (rg -i)
|
||||
*/
|
||||
"-i"?: boolean;
|
||||
/**
|
||||
* File type to search (rg --type). Common types: js, py, rust, go, java, etc. More efficient than include for standard file types.
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* Limit output to first N lines/entries, equivalent to "| head -N". Works across all output modes: content (limits output lines), files_with_matches (limits file paths), count (limits count entries). When unspecified, shows all results from ripgrep.
|
||||
*/
|
||||
head_limit?: number;
|
||||
/**
|
||||
* Enable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false.
|
||||
*/
|
||||
multiline?: boolean;
|
||||
}
|
||||
export interface KillShellInput {
|
||||
/**
|
||||
* The ID of the background shell to kill
|
||||
*/
|
||||
shell_id: string;
|
||||
}
|
||||
export interface ListMcpResourcesInput {
|
||||
/**
|
||||
* Optional server name to filter resources by
|
||||
*/
|
||||
server?: string;
|
||||
}
|
||||
export interface McpInput {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface NotebookEditInput {
|
||||
/**
|
||||
* The absolute path to the Jupyter notebook file to edit (must be absolute, not relative)
|
||||
*/
|
||||
notebook_path: string;
|
||||
/**
|
||||
* The ID of the cell to edit. When inserting a new cell, the new cell will be inserted after the cell with this ID, or at the beginning if not specified.
|
||||
*/
|
||||
cell_id?: string;
|
||||
/**
|
||||
* The new source for the cell
|
||||
*/
|
||||
new_source: string;
|
||||
/**
|
||||
* The type of the cell (code or markdown). If not specified, it defaults to the current cell type. If using edit_mode=insert, this is required.
|
||||
*/
|
||||
cell_type?: "code" | "markdown";
|
||||
/**
|
||||
* The type of edit to make (replace, insert, delete). Defaults to replace.
|
||||
*/
|
||||
edit_mode?: "replace" | "insert" | "delete";
|
||||
}
|
||||
export interface ReadMcpResourceInput {
|
||||
/**
|
||||
* The MCP server name
|
||||
*/
|
||||
server: string;
|
||||
/**
|
||||
* The resource URI to read
|
||||
*/
|
||||
uri: string;
|
||||
}
|
||||
export interface TodoWriteInput {
|
||||
/**
|
||||
* The updated todo list
|
||||
*/
|
||||
todos: {
|
||||
content: string;
|
||||
status: "pending" | "in_progress" | "completed";
|
||||
activeForm: string;
|
||||
}[];
|
||||
}
|
||||
export interface WebFetchInput {
|
||||
/**
|
||||
* The URL to fetch content from
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The prompt to run on the fetched content
|
||||
*/
|
||||
prompt: string;
|
||||
}
|
||||
export interface WebSearchInput {
|
||||
/**
|
||||
* The search query to use
|
||||
*/
|
||||
query: string;
|
||||
/**
|
||||
* Only include search results from these domains
|
||||
*/
|
||||
allowed_domains?: string[];
|
||||
/**
|
||||
* Never include search results from these domains
|
||||
*/
|
||||
blocked_domains?: string[];
|
||||
}
|
||||
388
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/sdk.d.ts
generated
vendored
Normal file
388
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/sdk.d.ts
generated
vendored
Normal file
@@ -0,0 +1,388 @@
|
||||
import type { MessageParam as APIUserMessage } from '@anthropic-ai/sdk/resources';
|
||||
import type { BetaMessage as APIAssistantMessage, BetaUsage as Usage, BetaRawMessageStreamEvent as RawMessageStreamEvent } from '@anthropic-ai/sdk/resources/beta/messages/messages.mjs';
|
||||
import type { UUID } from 'crypto';
|
||||
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
||||
import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { type z, type ZodRawShape, type ZodObject } from 'zod';
|
||||
export type NonNullableUsage = {
|
||||
[K in keyof Usage]: NonNullable<Usage[K]>;
|
||||
};
|
||||
export type ModelUsage = {
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
cacheReadInputTokens: number;
|
||||
cacheCreationInputTokens: number;
|
||||
webSearchRequests: number;
|
||||
costUSD: number;
|
||||
};
|
||||
export type ApiKeySource = 'user' | 'project' | 'org' | 'temporary';
|
||||
export type ConfigScope = 'local' | 'user' | 'project';
|
||||
export type McpStdioServerConfig = {
|
||||
type?: 'stdio';
|
||||
command: string;
|
||||
args?: string[];
|
||||
env?: Record<string, string>;
|
||||
};
|
||||
export type McpSSEServerConfig = {
|
||||
type: 'sse';
|
||||
url: string;
|
||||
headers?: Record<string, string>;
|
||||
};
|
||||
export type McpHttpServerConfig = {
|
||||
type: 'http';
|
||||
url: string;
|
||||
headers?: Record<string, string>;
|
||||
};
|
||||
export type McpSdkServerConfig = {
|
||||
type: 'sdk';
|
||||
name: string;
|
||||
};
|
||||
export type McpSdkServerConfigWithInstance = McpSdkServerConfig & {
|
||||
instance: McpServer;
|
||||
};
|
||||
export type McpServerConfig = McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig | McpSdkServerConfigWithInstance;
|
||||
export type McpServerConfigForProcessTransport = McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig | McpSdkServerConfig;
|
||||
type PermissionUpdateDestination = 'userSettings' | 'projectSettings' | 'localSettings' | 'session';
|
||||
export type PermissionBehavior = 'allow' | 'deny' | 'ask';
|
||||
export type PermissionUpdate = {
|
||||
type: 'addRules';
|
||||
rules: PermissionRuleValue[];
|
||||
behavior: PermissionBehavior;
|
||||
destination: PermissionUpdateDestination;
|
||||
} | {
|
||||
type: 'replaceRules';
|
||||
rules: PermissionRuleValue[];
|
||||
behavior: PermissionBehavior;
|
||||
destination: PermissionUpdateDestination;
|
||||
} | {
|
||||
type: 'removeRules';
|
||||
rules: PermissionRuleValue[];
|
||||
behavior: PermissionBehavior;
|
||||
destination: PermissionUpdateDestination;
|
||||
} | {
|
||||
type: 'setMode';
|
||||
mode: PermissionMode;
|
||||
destination: PermissionUpdateDestination;
|
||||
} | {
|
||||
type: 'addDirectories';
|
||||
directories: string[];
|
||||
destination: PermissionUpdateDestination;
|
||||
} | {
|
||||
type: 'removeDirectories';
|
||||
directories: string[];
|
||||
destination: PermissionUpdateDestination;
|
||||
};
|
||||
export type PermissionResult = {
|
||||
behavior: 'allow';
|
||||
/**
|
||||
* Updated tool input to use, if any changes are needed.
|
||||
*
|
||||
* For example if the user was given the option to update the tool use
|
||||
* input before approving, then this would be the updated input which
|
||||
* would be executed by the tool.
|
||||
*/
|
||||
updatedInput: Record<string, unknown>;
|
||||
/**
|
||||
* Permissions updates to be applied as part of accepting this tool use.
|
||||
*
|
||||
* Typically this is used as part of the 'always allow' flow and these
|
||||
* permission updates are from the `suggestions` field from the
|
||||
* CanUseTool callback.
|
||||
*
|
||||
* It is recommended that you use these suggestions rather than
|
||||
* attempting to re-derive them from the tool use input, as the
|
||||
* suggestions may include other permission changes such as adding
|
||||
* directories or incorporate complex tool-use logic such as bash
|
||||
* commands.
|
||||
*/
|
||||
updatedPermissions?: PermissionUpdate[];
|
||||
} | {
|
||||
behavior: 'deny';
|
||||
/**
|
||||
* Message indicating the reason for denial, or guidance of what the
|
||||
* model should do instead.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* If true, interrupt execution and do not continue.
|
||||
*
|
||||
* Typically this should be set to true when the user says 'no' with no
|
||||
* further guidance. Leave unset or false if the user provides guidance
|
||||
* which the model should incorporate and continue.
|
||||
*/
|
||||
interrupt?: boolean;
|
||||
};
|
||||
export type PermissionRuleValue = {
|
||||
toolName: string;
|
||||
ruleContent?: string;
|
||||
};
|
||||
export type CanUseTool = (toolName: string, input: Record<string, unknown>, options: {
|
||||
/** Signaled if the operation should be aborted. */
|
||||
signal: AbortSignal;
|
||||
/**
|
||||
* Suggestions for updating permissions so that the user will not be
|
||||
* prompted again for this tool during this session.
|
||||
*
|
||||
* Typically if presenting the user an option 'always allow' or similar,
|
||||
* then this full set of suggestions should be returned as the
|
||||
* `updatedPermissions` in the PermissionResult.
|
||||
*/
|
||||
suggestions?: PermissionUpdate[];
|
||||
}) => Promise<PermissionResult>;
|
||||
export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "Notification", "UserPromptSubmit", "SessionStart", "SessionEnd", "Stop", "SubagentStop", "PreCompact"];
|
||||
export type HookEvent = (typeof HOOK_EVENTS)[number];
|
||||
export type HookCallback = (input: HookInput, toolUseID: string | undefined, options: {
|
||||
signal: AbortSignal;
|
||||
}) => Promise<HookJSONOutput>;
|
||||
export interface HookCallbackMatcher {
|
||||
matcher?: string;
|
||||
hooks: HookCallback[];
|
||||
}
|
||||
export type BaseHookInput = {
|
||||
session_id: string;
|
||||
transcript_path: string;
|
||||
cwd: string;
|
||||
permission_mode?: string;
|
||||
};
|
||||
export type PreToolUseHookInput = BaseHookInput & {
|
||||
hook_event_name: 'PreToolUse';
|
||||
tool_name: string;
|
||||
tool_input: unknown;
|
||||
};
|
||||
export type PostToolUseHookInput = BaseHookInput & {
|
||||
hook_event_name: 'PostToolUse';
|
||||
tool_name: string;
|
||||
tool_input: unknown;
|
||||
tool_response: unknown;
|
||||
};
|
||||
export type NotificationHookInput = BaseHookInput & {
|
||||
hook_event_name: 'Notification';
|
||||
message: string;
|
||||
title?: string;
|
||||
};
|
||||
export type UserPromptSubmitHookInput = BaseHookInput & {
|
||||
hook_event_name: 'UserPromptSubmit';
|
||||
prompt: string;
|
||||
};
|
||||
export type SessionStartHookInput = BaseHookInput & {
|
||||
hook_event_name: 'SessionStart';
|
||||
source: 'startup' | 'resume' | 'clear' | 'compact';
|
||||
};
|
||||
export type StopHookInput = BaseHookInput & {
|
||||
hook_event_name: 'Stop';
|
||||
stop_hook_active: boolean;
|
||||
};
|
||||
export type SubagentStopHookInput = BaseHookInput & {
|
||||
hook_event_name: 'SubagentStop';
|
||||
stop_hook_active: boolean;
|
||||
};
|
||||
export type PreCompactHookInput = BaseHookInput & {
|
||||
hook_event_name: 'PreCompact';
|
||||
trigger: 'manual' | 'auto';
|
||||
custom_instructions: string | null;
|
||||
};
|
||||
export declare const EXIT_REASONS: string[];
|
||||
export type ExitReason = (typeof EXIT_REASONS)[number];
|
||||
export type SessionEndHookInput = BaseHookInput & {
|
||||
hook_event_name: 'SessionEnd';
|
||||
reason: ExitReason;
|
||||
};
|
||||
export type HookInput = PreToolUseHookInput | PostToolUseHookInput | NotificationHookInput | UserPromptSubmitHookInput | SessionStartHookInput | SessionEndHookInput | StopHookInput | SubagentStopHookInput | PreCompactHookInput;
|
||||
export type AsyncHookJSONOutput = {
|
||||
async: true;
|
||||
asyncTimeout?: number;
|
||||
};
|
||||
export type SyncHookJSONOutput = {
|
||||
continue?: boolean;
|
||||
suppressOutput?: boolean;
|
||||
stopReason?: string;
|
||||
decision?: 'approve' | 'block';
|
||||
systemMessage?: string;
|
||||
reason?: string;
|
||||
hookSpecificOutput?: {
|
||||
hookEventName: 'PreToolUse';
|
||||
permissionDecision?: 'allow' | 'deny' | 'ask';
|
||||
permissionDecisionReason?: string;
|
||||
} | {
|
||||
hookEventName: 'UserPromptSubmit';
|
||||
additionalContext?: string;
|
||||
} | {
|
||||
hookEventName: 'SessionStart';
|
||||
additionalContext?: string;
|
||||
} | {
|
||||
hookEventName: 'PostToolUse';
|
||||
additionalContext?: string;
|
||||
};
|
||||
};
|
||||
export type HookJSONOutput = AsyncHookJSONOutput | SyncHookJSONOutput;
|
||||
export type Options = {
|
||||
abortController?: AbortController;
|
||||
additionalDirectories?: string[];
|
||||
allowedTools?: string[];
|
||||
appendSystemPrompt?: string;
|
||||
canUseTool?: CanUseTool;
|
||||
continue?: boolean;
|
||||
customSystemPrompt?: string;
|
||||
cwd?: string;
|
||||
disallowedTools?: string[];
|
||||
env?: Dict<string>;
|
||||
executable?: 'bun' | 'deno' | 'node';
|
||||
executableArgs?: string[];
|
||||
extraArgs?: Record<string, string | null>;
|
||||
fallbackModel?: string;
|
||||
hooks?: Partial<Record<HookEvent, HookCallbackMatcher[]>>;
|
||||
includePartialMessages?: boolean;
|
||||
maxThinkingTokens?: number;
|
||||
maxTurns?: number;
|
||||
mcpServers?: Record<string, McpServerConfig>;
|
||||
model?: string;
|
||||
pathToClaudeCodeExecutable?: string;
|
||||
permissionMode?: PermissionMode;
|
||||
permissionPromptToolName?: string;
|
||||
resume?: string;
|
||||
stderr?: (data: string) => void;
|
||||
strictMcpConfig?: boolean;
|
||||
};
|
||||
export type PermissionMode = 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan';
|
||||
export type SlashCommand = {
|
||||
name: string;
|
||||
desciption: string;
|
||||
argumentHint: string;
|
||||
};
|
||||
export type ModelInfo = {
|
||||
value: string;
|
||||
displayName: string;
|
||||
description: string;
|
||||
};
|
||||
export type SDKMessageBase = {
|
||||
uuid: UUID;
|
||||
session_id: string;
|
||||
};
|
||||
type SDKUserMessageContent = {
|
||||
type: 'user';
|
||||
message: APIUserMessage;
|
||||
parent_tool_use_id: string | null;
|
||||
};
|
||||
export type SDKUserMessage = SDKUserMessageContent & {
|
||||
uuid?: UUID;
|
||||
session_id: string;
|
||||
};
|
||||
export type SDKUserMessageReplay = SDKMessageBase & SDKUserMessageContent;
|
||||
export type SDKAssistantMessage = SDKMessageBase & {
|
||||
type: 'assistant';
|
||||
message: APIAssistantMessage;
|
||||
parent_tool_use_id: string | null;
|
||||
};
|
||||
export type SDKPermissionDenial = {
|
||||
tool_name: string;
|
||||
tool_use_id: string;
|
||||
tool_input: Record<string, unknown>;
|
||||
};
|
||||
export type SDKResultMessage = (SDKMessageBase & {
|
||||
type: 'result';
|
||||
subtype: 'success';
|
||||
duration_ms: number;
|
||||
duration_api_ms: number;
|
||||
is_error: boolean;
|
||||
num_turns: number;
|
||||
result: string;
|
||||
total_cost_usd: number;
|
||||
usage: NonNullableUsage;
|
||||
modelUsage: {
|
||||
[modelName: string]: ModelUsage;
|
||||
};
|
||||
permission_denials: SDKPermissionDenial[];
|
||||
}) | (SDKMessageBase & {
|
||||
type: 'result';
|
||||
subtype: 'error_max_turns' | 'error_during_execution';
|
||||
duration_ms: number;
|
||||
duration_api_ms: number;
|
||||
is_error: boolean;
|
||||
num_turns: number;
|
||||
total_cost_usd: number;
|
||||
usage: NonNullableUsage;
|
||||
modelUsage: {
|
||||
[modelName: string]: ModelUsage;
|
||||
};
|
||||
permission_denials: SDKPermissionDenial[];
|
||||
});
|
||||
export type SDKSystemMessage = SDKMessageBase & {
|
||||
type: 'system';
|
||||
subtype: 'init';
|
||||
apiKeySource: ApiKeySource;
|
||||
cwd: string;
|
||||
tools: string[];
|
||||
mcp_servers: {
|
||||
name: string;
|
||||
status: string;
|
||||
}[];
|
||||
model: string;
|
||||
permissionMode: PermissionMode;
|
||||
slash_commands: string[];
|
||||
output_style: string;
|
||||
};
|
||||
export type SDKPartialAssistantMessage = SDKMessageBase & {
|
||||
type: 'stream_event';
|
||||
event: RawMessageStreamEvent;
|
||||
parent_tool_use_id: string | null;
|
||||
};
|
||||
export type SDKCompactBoundaryMessage = SDKMessageBase & {
|
||||
type: 'system';
|
||||
subtype: 'compact_boundary';
|
||||
compact_metadata: {
|
||||
trigger: 'manual' | 'auto';
|
||||
pre_tokens: number;
|
||||
};
|
||||
};
|
||||
export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage | SDKPartialAssistantMessage | SDKCompactBoundaryMessage;
|
||||
export interface Query extends AsyncGenerator<SDKMessage, void> {
|
||||
/**
|
||||
* Control Requests
|
||||
* The following methods are control requests, and are only supported when
|
||||
* streaming input/output is used.
|
||||
*/
|
||||
interrupt(): Promise<void>;
|
||||
setPermissionMode(mode: PermissionMode): Promise<void>;
|
||||
setModel(model?: string): Promise<void>;
|
||||
supportedCommands(): Promise<SlashCommand[]>;
|
||||
supportedModels(): Promise<ModelInfo[]>;
|
||||
}
|
||||
/**
|
||||
* Query Claude Code
|
||||
*
|
||||
* Behavior:
|
||||
* - Yields a message at a time
|
||||
* - Uses the tools and commands you give it
|
||||
*
|
||||
* Usage:
|
||||
* ```ts
|
||||
* const response = query({ prompt: "Help me write a function", options: {} })
|
||||
* for await (const message of response) {
|
||||
* console.log(message)
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export declare function query({ prompt, options, }: {
|
||||
prompt: string | AsyncIterable<SDKUserMessage>;
|
||||
options?: Options;
|
||||
}): Query;
|
||||
type SdkMcpToolDefinition<Schema extends ZodRawShape = ZodRawShape> = {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: Schema;
|
||||
handler: (args: z.infer<ZodObject<Schema>>, extra: unknown) => Promise<CallToolResult>;
|
||||
};
|
||||
export declare function tool<Schema extends ZodRawShape>(name: string, description: string, inputSchema: Schema, handler: (args: z.infer<ZodObject<Schema>>, extra: unknown) => Promise<CallToolResult>): SdkMcpToolDefinition<Schema>;
|
||||
type CreateSdkMcpServerOptions = {
|
||||
name: string;
|
||||
version?: string;
|
||||
tools?: Array<SdkMcpToolDefinition<any>>;
|
||||
};
|
||||
/**
|
||||
* Creates an MCP server instance that can be used with the SDK transport.
|
||||
* This allows SDK users to define custom tools that run in the same process.
|
||||
*/
|
||||
export declare function createSdkMcpServer(options: CreateSdkMcpServerOptions): McpSdkServerConfigWithInstance;
|
||||
export declare class AbortError extends Error {
|
||||
}
|
||||
export {};
|
||||
14087
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/sdk.mjs
generated
vendored
Normal file
14087
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/sdk.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/yoga.wasm
generated
vendored
Normal file
BIN
node_modules/.pnpm/@anthropic-ai+claude-code@1.0.120/node_modules/@anthropic-ai/claude-code/yoga.wasm
generated
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user