MCPcopy Create free account

hub / github.com/Louisym/MiniCC / functions

Functions1,659 in github.com/Louisym/MiniCC

↓ 3 callersMethodparse_value
(&mut self)
rust/crates/runtime/src/json.rs:161
↓ 3 callersFunctionpreview_text
(input: &str, max_chars: usize)
rust/crates/tools/src/lib.rs:1062
↓ 3 callersMethodpush_history
(&mut self, entry: impl Into<String>)
rust/crates/rusty-claude-cli/src/input.rs:120
↓ 3 callersFunctionpush_output_block
( block: OutputContentBlock, events: &mut Vec<AssistantEvent>, pending_tool: &mut Option<(String,
rust/crates/tools/src/lib.rs:1840
↓ 3 callersFunctionread_credentials_root
(path: &PathBuf)
rust/crates/runtime/src/oauth.rs:335
↓ 3 callersMethodread_line
(&mut self)
rust/crates/runtime/src/mcp_stdio.rs:621
↓ 3 callersMethodregister
( mut self, tool_name: impl Into<String>, handler: impl FnMut(&str) -> Result<String,
rust/crates/runtime/src/conversation.rs:440
↓ 3 callersMethodregister
(self, name: str, handler: Callable)
mini_claude_code/tools.py:9
↓ 3 callersMethodrender
(&self)
rust/crates/rusty-claude-cli/src/init.rs:46
↓ 3 callersFunctionrender_config_report
(section: Option<&str>)
rust/crates/rusty-claude-cli/src/main.rs:1852
↓ 3 callersFunctionrender_init_claude_md
(cwd: &Path)
rust/crates/rusty-claude-cli/src/init.rs:162
↓ 3 callersFunctionrender_repl_help
()
rust/crates/rusty-claude-cli/src/main.rs:1756
↓ 3 callersFunctionresolve_sandbox_status_for_request
(request: &SandboxRequest, cwd: &Path)
rust/crates/runtime/src/sandbox.rs:162
↓ 3 callersFunctionresolve_startup_auth_source
(load_oauth_config: F)
rust/crates/api/src/client.rs:385
↓ 3 callersFunctionresponse_to_events
( response: MessageResponse, out: &mut (impl Write + ?Sized), )
rust/crates/rusty-claude-cli/src/main.rs:3003
↓ 3 callersMethodrun_internal_prompt_text
( &self, prompt: &str, enable_tools: bool, )
rust/crates/rusty-claude-cli/src/main.rs:1501
↓ 3 callersFunctionrun_setup
(cwd: Path | None = None, trusted: bool = True)
src/setup.py:64
↓ 3 callersFunctionrun_streaming_demo
模拟流式接收和解析的完整过程。 这就是 Claude Code 内部做的事情: 1. 收到 HTTP 数据块 2. SSE 解析器提取事件 3. 转换为 StreamEvent 4. 组装为 AssistantEvent 5. 构建完整消息
tutorials/10_sse_streaming.py:744
↓ 3 callersFunctionsend_with_retry
带重试的请求发送函数。 这是整个重试引擎的核心实现。 对应源码: api/client.rs:273-307 async fn send_with_retry(&self, request) -> Result<Response, ApiError> {
tutorials/11_error_recovery_and_retry.py:258
↓ 3 callersFunctionsessions_dir
()
rust/crates/rusty-claude-cli/src/main.rs:1656
↓ 3 callersFunctionslash_command_specs
()
rust/crates/commands/src/lib.rs:301
↓ 3 callersMethodspawn
(handler: Arc<dyn Fn(&str) -> HttpResponse + Send + Sync + 'static>)
rust/crates/tools/src/lib.rs:4148
↓ 3 callersMethodspawn
(transport: &McpStdioTransport)
rust/crates/runtime/src/mcp_stdio.rs:581
↓ 3 callersFunctionspawn_mcp_stdio_process
(bootstrap: &McpClientBootstrap)
rust/crates/runtime/src/mcp_stdio.rs:768
↓ 3 callersMethodstream_markdown
(&self, markdown: &str, out: &mut impl Write)
rust/crates/rusty-claude-cli/src/render.rs:589
↓ 3 callersMethodsummary_lines_for_model
(self, label: &str, model: Option<&str>)
rust/crates/runtime/src/usage.rs:115
↓ 3 callersFunctionsync_task
(name, seconds)
tutorials/17_async_await_for_sse.py:44
↓ 3 callersMethodtake_request_id
(&mut self)
rust/crates/runtime/src/mcp_stdio.rs:501
↓ 3 callersFunctiontask
(name, delay)
tutorials/17_async_await_for_sse.py:157
↓ 3 callersFunctiontemp_path
(name: &str)
rust/crates/runtime/src/file_ops.rs:486
↓ 3 callersMethodterminate
(&mut self)
rust/crates/runtime/src/mcp_stdio.rs:751
↓ 3 callersMethodtext
(status: u16, reason: &'static str, body: &str)
rust/crates/tools/src/lib.rs:4219
↓ 3 callersMethodto_dict
序列化为字典(用于 JSON)
tutorials/12_session_persistence.py:93
↓ 3 callersMethodto_markdown
(self)
src/port_manifest.py:18
↓ 3 callersMethodtool_result
(cls, id, name, output, is_error)
mini_claude_code/models.py:44
↓ 3 callersFunctiontruncate_for_summary
(value: &str, limit: usize)
rust/crates/rusty-claude-cli/src/main.rs:2958
↓ 3 callersFunctiontruncate_instruction_content
(content: &str, remaining_chars: usize)
rust/crates/runtime/src/prompt.rs:366
↓ 3 callersMethodusage
(&self)
rust/crates/runtime/src/conversation.rs:296
↓ 3 callersMethodwith_hooks
(mut self, hooks: RuntimeHookConfig)
rust/crates/runtime/src/config.rs:317
↓ 3 callersMethodwith_os
(mut self, os_name: impl Into<String>, os_version: impl Into<String>)
rust/crates/runtime/src/prompt.rs:109
↓ 3 callersMethodwith_project_context
(mut self, project_context: ProjectContext)
rust/crates/runtime/src/prompt.rs:116
↓ 3 callersMethodwith_retry_policy
( mut self, max_retries: u32, initial_backoff: Duration, max_backoff: Duration
rust/crates/api/src/client.rs:180
↓ 3 callersMethodwith_tool_requirement
( self, tool_name: str, required: PermissionMode )
tutorials/18_design_patterns_for_agents.py:544
↓ 3 callersFunctionwrite_temp_text_file
( filename: &str, contents: &str, )
rust/crates/rusty-claude-cli/src/main.rs:2145
↓ 2 callersFunction_collapse_blank_lines
合并连续空行 — 源码 prompt.rs:389-401
tutorials/16_prompt_building_and_compaction.py:152
↓ 2 callersMethod_collect_matches
(self, tokens: set[str], modules: tuple[PortingModule, ...], kind: str)
src/runtime.py:176
↓ 2 callersFunction_iso8601_now
()
mini_claude_code/multi_agent.py:185
↓ 2 callersMethod_process_line
处理一行 SSE 文本。 SSE 协议的核心规则在这里: - 空行 → 当前事件结束,提取它 - : 开头 → 注释,忽略 - event: → 设置事件名 - data: → 添加数据行
tutorials/10_sse_streaming.py:192
↓ 2 callersMethod_read_entries
逐行解析 JSONL。 崩溃安全: 跳过空行和解析失败的行。 CC 的保证: 最多丢失最后一行(写入被中断的行)。
mini_claude_code/storage.py:159
↓ 2 callersFunction_read_git_output
源码: prompt.rs:265-275
mini_claude_code/prompt.py:212
↓ 2 callersMethod_rebuild_chain
从 UUID 链重建时间序对话。 算法: 1. 构建 uuid → entry 映射 2. 找到所有 uuid 的集合 3. 找到被引用的 parent_uuid 集合 4. 叶节点 = uuid集合 - 被引用集合(
mini_claude_code/storage.py:181
↓ 2 callersFunction_resolve_model_alias
源码: main.rs:291-298
mini_claude_code/main.py:594
↓ 2 callersMethod_run_commands
核心: 顺序执行命令,deny 时熔断。源码: hooks.rs:95-150 CC 的设计: 遍历命令列表,每个命令执行后检查结果。 - Allow: 收集 message,继续下一个 - Deny: 收集 message,立刻返回 denied=
mini_claude_code/hooks.py:134
↓ 2 callersMethod_run_commands
执行所有 Hook 命令 — 源码 hooks.rs:96-150 关键逻辑: 1. 逐个执行命令 2. 如果任何一个返回 deny → 立即停止,返回 denied 3. 允许的命令的 stdout 作为 message 收集
tutorials/15_permission_and_hook_pipeline.py:299
↓ 2 callersMethod_run_commands
逐个运行 hook 命令。 重要:如果任何一个 hook 返回"拒绝"(exit code 2), 后续的 hook 不再运行,直接返回拒绝结果。 对应源码: hooks.rs:95-150
tutorials/08_hook_system.py:160
↓ 2 callersFunction_snapshot_count
(path: Path)
src/parity_audit.py:117
↓ 2 callersMethod_take_event
提取当前积累的事件数据,组装成 SseEvent。 提取后重置内部状态,准备解析下一个事件。 对应源码: runtime/sse.rs:82-96 (take_event)
tutorials/10_sse_streaming.py:241
↓ 2 callersMethod_write_manifest
写 manifest JSON 到文件。源码: lib.rs:1591-1597
mini_claude_code/multi_agent.py:368
↓ 2 callersMethodadd_message
添加消息,自动设置 parent_uuid 形成链表。
tutorials/12_session_persistence.py:219
↓ 2 callersFunctionagent_permission_policy
()
rust/crates/tools/src/lib.rs:1584
↓ 2 callersMethodallow
(messages: List[str] = None)
tutorials/15_permission_and_hook_pipeline.py:243
↓ 2 callersMethodallow
(messages: list[str] | None = None)
tutorials/08_hook_system.py:71
↓ 2 callersMethodappend_metadata
追加元数据条目(标题、标签等)。 对应 Reference: EP09 §1 条目类型 custom-title, ai-title, last-prompt, tag 等
tutorials/12_session_persistence.py:325
↓ 2 callersMethodapply
(&self, mut request_builder: reqwest::RequestBuilder)
rust/crates/api/src/client.rs:77
↓ 2 callersFunctionapply_code_block_background
(line: &str)
rust/crates/rusty-claude-cli/src/render.rs:626
↓ 2 callersFunctionapply_limit
( items: Vec<T>, limit: Option<usize>, offset: Option<usize>, )
rust/crates/runtime/src/file_ops.rs:409
↓ 2 callersMethodas_bool
(&self)
rust/crates/runtime/src/json.rs:99
↓ 2 callersMethodas_str
(self)
rust/crates/runtime/src/hooks.rs:15
↓ 2 callersFunctionbase64url_encode
(bytes: &[u8])
rust/crates/runtime/src/oauth.rs:368
↓ 2 callersMethodbuild
构建系统提示词分段列表。源码: prompt.rs:134-156 结构: [0-4] 静态部分 (可缓存) [---] DYNAMIC_BOUNDARY [5+] 动态部分 (每次可能变)
mini_claude_code/prompt.py:263
↓ 2 callersMethodbuild
组装所有部分,生成最终的 system prompt。 返回一个字符串列表,每个元素是一个"段落"。 对应源码: prompt.rs:134-156
tutorials/06_system_prompt_builder.py:328
↓ 2 callersMethodbuild
(self)
tutorials/18_design_patterns_for_agents.py:921
↓ 2 callersFunctionbuild_default_registry
注册所有默认工具。
mini_claude_code/main.py:237
↓ 2 callersFunctionbuild_execution_registry
()
src/execution_registry.py:47
↓ 2 callersFunctionbuild_http_client
()
rust/crates/tools/src/lib.rs:924
↓ 2 callersFunctionbuild_runtime
源码: main.rs:2318-2336
mini_claude_code/main.py:180
↓ 2 callersFunctionbuild_system_prompt
源码: main.rs:2300-2307
mini_claude_code/main.py:218
↓ 2 callersMethodbuild_url
(&self)
rust/crates/runtime/src/oauth.rs:140
↓ 2 callersMethodcli_path
(&self)
rust/crates/compat-harness/src/lib.rs:45
↓ 2 callersFunctioncollect_key_files
(messages: &[ConversationMessage])
rust/crates/runtime/src/compact.rs:256
↓ 2 callersMethodcollect_results
收集 Worker 的结果
tutorials/13_multi_agent_coordination.py:387
↓ 2 callersFunctioncommand_exists
(name: &str)
rust/crates/rusty-claude-cli/src/main.rs:2137
↓ 2 callersFunctioncompact_session
源码: compact.rs:75-111 流程: 1. 检查是否需要压缩 (should_compact) 2. 分割: messages[:-N] 压缩, messages[-N:] 保留 3. 旧消息 → 结构化摘要 4. 新 session = [s
mini_claude_code/compact.py:328
↓ 2 callersFunctioncompact_session
执行会话压缩 — 源码 compact.rs:75-111 核心逻辑: 1. 判断是否需要压缩 2. 分割: 旧消息(要压缩的)+ 新消息(要保留的) 3. 对旧消息生成摘要 4. 创建延续消息(System 角色) 5. 返回: [延续消息] +
tutorials/16_prompt_building_and_compaction.py:716
↓ 2 callersFunctioncompact_session
执行压缩。 算法很简单: 1. 判断是否需要压缩 → 不需要就直接返回 2. 把消息分成两组:旧的(要压缩的)和新的(要保留的) 3. 旧消息 → 生成摘要 4. 新 Session = [摘要消息] + [保留的消息] 对应源码: co
tutorials/07_auto_compaction.py:294
↓ 2 callersMethodcomplete
( &self, line: &str, pos: usize, _ctx: &Context<'_>, )
rust/crates/rusty-claude-cli/src/input.rs:53
↓ 2 callersFunctionconvert_messages
(messages: &[ConversationMessage])
rust/crates/rusty-claude-cli/src/main.rs:3091
↓ 2 callersFunctioncreate_managed_session_handle
()
rust/crates/rusty-claude-cli/src/main.rs:1663
↓ 2 callersMethodcurrent_turn_usage
(&self)
rust/crates/runtime/src/usage.rs:196
↓ 2 callersMethoddecide
(self, request: PermissionRequest)
tutorials/04_permission_system.py:97
↓ 2 callersFunctiondecode_duckduckgo_redirect
(url: &str)
rust/crates/tools/src/lib.rs:1159
↓ 2 callersFunctiondecode_hex
(byte: u8)
rust/crates/runtime/src/oauth.rs:440
↓ 2 callersFunctiondeep_merge
深度合并两个字典。override 中的值覆盖 base 中的值。 如果两边都是字典,递归合并。 对应源码: config.rs 中的 deep_merge_objects 函数
tutorials/09_config_system.py:209
↓ 2 callersFunctiondefault_permission_mode
()
rust/crates/rusty-claude-cli/src/main.rs:367
↓ 2 callersMethoddeny
(reason: str)
mini_claude_code/permissions.py:84
↓ 2 callersFunctiondetect_container_environment
检测当前是否在容器中运行 — 源码 sandbox.rs:108-153 为什么要检测容器?因为: 1. 如果已经在 Docker 里,再用 unshare 做命名空间隔离可能不支持 2. 容器里的权限模型不同,某些操作需要特殊处理 3. 需要告知用户当前的安全环境
tutorials/14_bash_engine_deep_dive.py:153
↓ 2 callersFunctiondetect_container_environment_from
( inputs: SandboxDetectionInputs<'_>, )
rust/crates/runtime/src/sandbox.rs:120
↓ 2 callersMethoddiscover
发现所有候选配置文件路径。 源码: config.rs:185-212 固定返回 5 个路径(不管文件存不存在)。 顺序决定优先级:后面的覆盖前面的。
mini_claude_code/config.py:236
↓ 2 callersMethoddiscover
发现所有可能的配置文件路径。 注意:返回的是所有"可能"的路径,不管文件是否存在。 实际加载时会跳过不存在的文件。 对应源码: config.rs:185-212
tutorials/09_config_system.py:99
↓ 2 callersFunctionedit_file
( path: &str, old_string: &str, new_string: &str, replace_all: bool, )
rust/crates/runtime/src/file_ops.rs:180
← previousnext →201–300 of 1,659, ranked by callers