MCPcopy Create free account

hub / github.com/Louisym/MiniCC / functions

Functions1,659 in github.com/Louisym/MiniCC

↓ 2 callersMethodrender_summary
(self)
src/query_engine.py:171
↓ 2 callersMethodrender_table_row
(&self, row: &[String], widths: &[usize], is_header: bool)
rust/crates/rusty-claude-cli/src/render.rs:546
↓ 2 callersFunctionrequest_id_from_headers
(headers: &reqwest::header::HeaderMap)
rust/crates/api/src/client.rs:515
↓ 2 callersMethodrequired_mode_for
查询工具需要的权限 — 源码 permissions.rs:81-86 默认值: DangerFullAccess 这意味着: 如果你没注册过这个工具的权限需求, 系统会假设它需要最高权限。安全优先的默认值。
tutorials/15_permission_and_hook_pipeline.py:137
↓ 2 callersMethodreset_current_line
(&self)
rust/crates/rusty-claude-cli/src/input.rs:35
↓ 2 callersFunctionresolve_cell_index
( cells: &[serde_json::Value], cell_id: Option<&str>, edit_mode: NotebookEditMode, )
rust/crates/tools/src/lib.rs:2837
↓ 2 callersFunctionresolve_export_path
( requested_path: Option<&str>, session: &Session, )
rust/crates/rusty-claude-cli/src/main.rs:2282
↓ 2 callersFunctionresolve_request
合并配置和请求参数 — 源码 sandbox.rs:86-106 优先级: 模型请求参数 > 用户配置 > 默认值 这个设计让模型可以在需要时请求不同的沙箱级别。 比如模型需要安装一个 npm 包,它可以请求 network_isolation=False, 但这
tutorials/14_bash_engine_deep_dive.py:121
↓ 2 callersFunctionresolve_sandbox_status
决定最终的沙箱状态 — 源码 sandbox.rs:162-208 这是整个沙箱系统的核心决策函数。它综合考虑: - 请求的隔离级别 - 系统是否支持(Linux + unshare) - 是否在容器中 - 降级原因 关键设计: 即使命名空间不可用
tutorials/14_bash_engine_deep_dive.py:221
↓ 2 callersFunctionresolve_saved_oauth_token
(config: &OAuthConfig)
rust/crates/api/src/client.rs:378
↓ 2 callersFunctionresolve_saved_oauth_token_set
( config: &OAuthConfig, token_set: OAuthTokenSet, )
rust/crates/api/src/client.rs:422
↓ 2 callersFunctionresolve_session_reference
(reference: &str)
rust/crates/rusty-claude-cli/src/main.rs:1677
↓ 2 callersFunctionresume_supported_slash_commands
()
rust/crates/commands/src/lib.rs:306
↓ 2 callersMethodrun_commands
( &self, event: HookEvent, commands: &[String], tool_name: &str, tool_
rust/crates/runtime/src/hooks.rs:95
↓ 2 callersFunctionrun_hooks
对应 hooks.rs:95-150 的 run_commands() 运行所有 hook, 遇到 Deny 立即停止
tutorials/19_process_and_pipe_communication.py:665
↓ 2 callersFunctionrun_init
()
rust/crates/rusty-claude-cli/src/main.rs:1972
↓ 2 callersFunctionrun_parity_audit
()
src/parity_audit.py:121
↓ 2 callersMethodrun_pre_tool_use
运行 PreToolUse 钩子 — 源码 hooks.rs:66-75
tutorials/15_permission_and_hook_pipeline.py:276
↓ 2 callersMethodrun_turn
源码: conversation.rs:170-283
mini_claude_code/runtime.py:328
↓ 2 callersMethodrun_turn
执行一个完整的对话轮次。 这就是 Tutorial 01 里的 run_turn,但现在是完整版! 对应源码: conversation.rs:170-283
tutorials/05_agentic_loop_complete.py:261
↓ 2 callersMethodrun_turn
对应 conversation.rs:170-283 的 run_turn
tutorials/18_design_patterns_for_agents.py:262
↓ 2 callersFunctionsample_oauth_config
(token_url: String)
rust/crates/api/src/client.rs:639
↓ 2 callersMethodsend_request
( &mut self, request: &JsonRpcRequest<T>, )
rust/crates/runtime/src/mcp_stdio.rs:689
↓ 2 callersMethodsend_with_retry
( &self, request: &MessageRequest, )
rust/crates/api/src/client.rs:273
↓ 2 callersMethodset_current_line
(&self, line: &str)
rust/crates/rusty-claude-cli/src/input.rs:43
↓ 2 callersFunctionshould_compact
判断是否需要压缩。 两个条件都满足时才压缩: 1. 消息数量 > 保留数量(否则没东西可压缩) 2. 预估 token 数 >= 阈值(还没到限制就不压缩) 对应源码: compact.rs:32-35
tutorials/07_auto_compaction.py:146
↓ 2 callersFunctionspawn_token_server
(response_body: &'static str)
rust/crates/api/src/client.rs:650
↓ 2 callersMethodstartup_steps
(self)
src/setup.py:19
↓ 2 callersFunctionstatus_context
( session_path: Option<&Path>, )
rust/crates/rusty-claude-cli/src/main.rs:1774
↓ 2 callersMethodstream
(self, system_prompt: list[str], messages: list[Message])
mini_claude_code/api_client.py:55
↓ 2 callersMethodsummary_lines
(self)
src/models.py:45
↓ 2 callersMethodtake_event
(&mut self)
rust/crates/runtime/src/sse.rs:82
↓ 2 callersFunctiontemp_dir
()
rust/crates/runtime/src/remote.rs:264
↓ 2 callersFunctiontest_env_lock
()
rust/crates/runtime/src/lib.rs:85
↓ 2 callersMethodtool
(self, name: str)
src/execution_registry.py:39
↓ 2 callersMethodtransport
(&self)
rust/crates/runtime/src/config.rs:387
↓ 2 callersMethodusage
源码: conversation.rs:296-298
mini_claude_code/runtime.py:499
↓ 2 callersMethoduser_text
(cls, input:str)
mini_claude_code/models.py:41
↓ 2 callersMethoduser_text
(text: str)
tutorials/16_prompt_building_and_compaction.py:422
↓ 2 callersFunctionvisible_width
(input: &str)
rust/crates/rusty-claude-cli/src/render.rs:667
↓ 2 callersMethodwith_auth_token
(mut self, auth_token: Option<String>)
rust/crates/api/src/client.rs:149
↓ 2 callersMethodwith_auto_compaction_input_tokens_threshold
(mut self, threshold: u32)
rust/crates/runtime/src/conversation.rs:165
↓ 2 callersMethodwith_os
(self, os_name: str, os_version: str)
tutorials/16_prompt_building_and_compaction.py:241
↓ 2 callersMethodwith_project_context
(self, ctx: ProjectContext)
tutorials/16_prompt_building_and_compaction.py:246
↓ 2 callersMethodwith_runtime_config
(mut self, config: RuntimeConfig)
rust/crates/runtime/src/prompt.rs:122
↓ 2 callersMethodwith_tool_requirement
(self, tool_name: str, required: PermissionMode)
tutorials/05_agentic_loop_complete.py:109
↓ 2 callersFunctionwrite_agent_manifest
(manifest: &AgentOutput)
rust/crates/tools/src/lib.rs:1591
↓ 2 callersFunctionwrite_credentials_root
(path: &PathBuf, root: &Map<String, Value>)
rust/crates/runtime/src/oauth.rs:357
↓ 2 callersFunctionwrite_echo_script
()
rust/crates/runtime/src/mcp_stdio.rs:839
↓ 2 callersFunctionwrite_file_if_missing
(path: &Path, content: &str)
rust/crates/rusty-claude-cli/src/init.rs:122
↓ 2 callersFunctionwrite_jsonrpc_script
()
rust/crates/runtime/src/mcp_stdio.rs:854
↓ 2 callersFunctionwrite_mcp_server_script
()
rust/crates/runtime/src/mcp_stdio.rs:897
↓ 1 callersMethod_actions_section
源码: prompt.rs:484-490
mini_claude_code/prompt.py:338
↓ 1 callersMethod_actions_section
(self)
tutorials/16_prompt_building_and_compaction.py:338
↓ 1 callersMethod_actions_section
(self)
tutorials/06_system_prompt_builder.py:394
↓ 1 callersMethod_append_entry
追加一行 JSONL。 JSONL 核心: 每行一个 JSON + 换行符。 用 'a' 模式 (append),不修改已有内容。 懒物化: 目录不存在时自动创建。
mini_claude_code/storage.py:147
↓ 1 callersMethod_apply_env_overrides
环境变量覆盖。 注意: 这里直接修改 merged dict (mutation)。 这是故意的 — 在 load() 内部的构建阶段允许 mutation, 对外暴露的 RuntimeConfig 是 frozen 的。 CC 源码
mini_claude_code/config.py:330
↓ 1 callersMethod_build_assistant_message
把事件流解析成一条完整的助手消息。 事件流: [TextDelta("让我"), TextDelta("算一下"), ToolUse(...), Usage(...), Stop] → 消息: assistant([TextBlock("让我算一下
tutorials/05_agentic_loop_complete.py:346
↓ 1 callersFunction_canonical_token
转小写 + 只保留字母数字。源码: lib.rs 的 canonical_tool_token
mini_claude_code/multi_agent.py:125
↓ 1 callersFunction_check_cgroup
()
tutorials/14a_os_isolation_primer.py:464
↓ 1 callersFunction_collapse_blank_lines
源码: compact.rs:362-375
mini_claude_code/compact.py:149
↓ 1 callersFunction_collect_key_files
源码: compact.rs:256-270
mini_claude_code/compact.py:278
↓ 1 callersFunction_collect_key_files
收集关键文件路径 — 源码 compact.rs:256-270
tutorials/16_prompt_building_and_compaction.py:639
↓ 1 callersFunction_collect_recent_role_summaries
源码: compact.rs:217-233 反向遍历 → 取最近 N 条 → 再反转回时间序。
mini_claude_code/compact.py:244
↓ 1 callersFunction_collect_recent_role_summaries
收集某角色的最近消息 — 源码 compact.rs:217-233
tutorials/16_prompt_building_and_compaction.py:583
↓ 1 callersFunction_content_hash
稳定的内容 hash。源码: prompt.rs:347-351
mini_claude_code/prompt.py:140
↓ 1 callersFunction_convert_messages
源码: main.rs:3091-3130 将内部消息格式转为 Anthropic API 接受的格式。
mini_claude_code/api_client.py:76
↓ 1 callersFunction_create_api_client
尝试创建 API 客户端,注入工具定义。
mini_claude_code/main.py:693
↓ 1 callersFunction_dedupe_instruction_files
内容去重 — 源码 prompt.rs:326-341 为什么要去重? 因为有些项目会在根目录和子目录放相同的 CLAUDE.md, 或者 CLAUDE.md 和 .claude/CLAUDE.md 内容一样。 去重防止提示词中出现重复内容浪费 token。
tutorials/16_prompt_building_and_compaction.py:124
↓ 1 callersFunction_dedupe_instruction_files
去重:内容相同的文件只保留第一个。 为什么需要去重? 有时候项目根目录和子目录都有 CLAUDE.md,但内容完全一样。 重复加载浪费 token(花更多钱),所以要去重。 对应源码: prompt.rs:326-341
tutorials/06_system_prompt_builder.py:138
↓ 1 callersMethod_dict_to_message
(data: dict)
tutorials/02_session_and_messages.py:284
↓ 1 callersMethod_doing_tasks_section
源码: prompt.rs:468-482
mini_claude_code/prompt.py:326
↓ 1 callersMethod_doing_tasks_section
(self)
tutorials/16_prompt_building_and_compaction.py:328
↓ 1 callersMethod_doing_tasks_section
(self)
tutorials/06_system_prompt_builder.py:385
↓ 1 callersMethod_environment_section
源码: prompt.rs:163-184
mini_claude_code/prompt.py:349
↓ 1 callersMethod_environment_section
(self)
tutorials/16_prompt_building_and_compaction.py:344
↓ 1 callersMethod_environment_section
(self)
tutorials/06_system_prompt_builder.py:402
↓ 1 callersFunction_estimate_block_tokens
源码: compact.rs:330-337
mini_claude_code/compact.py:52
↓ 1 callersFunction_execute_bash_sync
同步执行命令,支持超时 — 源码 bash.rs:102-165 超时控制的关键: - Rust 用 tokio::time::timeout 包装 command.output() - Python 用 subprocess.run(timeout=...) -
tutorials/14_bash_engine_deep_dive.py:504
↓ 1 callersFunction_extract_file_candidates
从文本中提取文件路径 — 源码 compact.rs:301-315 方法: 按空格分词,找包含 "/" 且有已知扩展名的 token。 已知扩展名: rs, ts, tsx, js, json, md
tutorials/16_prompt_building_and_compaction.py:621
↓ 1 callersFunction_format_hook_message
源码: conversation.rs:400-406
mini_claude_code/runtime.py:508
↓ 1 callersMethod_format_output
(self, summary_lines: list[str])
src/query_engine.py:152
↓ 1 callersFunction_format_terminal_output
源码: lib.rs:1627-1636
mini_claude_code/multi_agent.py:463
↓ 1 callersFunction_infer_current_work
源码: compact.rs:272-279
mini_claude_code/compact.py:292
↓ 1 callersFunction_infer_current_work
推断当前工作 — 源码 compact.rs:272-279
tutorials/16_prompt_building_and_compaction.py:650
↓ 1 callersFunction_infer_pending_work
源码: compact.rs:235-254
mini_claude_code/compact.py:264
↓ 1 callersFunction_infer_pending_work
推断待办事项 — 源码 compact.rs:235-254 搜索关键词: todo, next, pending, follow up, remaining 只看最后 3 条匹配的消息。
tutorials/16_prompt_building_and_compaction.py:601
↓ 1 callersMethod_infer_permission_denials
(self, matches: list[RoutedMatch])
src/runtime.py:169
↓ 1 callersMethod_instruction_files_section
(self)
tutorials/06_system_prompt_builder.py:434
↓ 1 callersMethod_intro_section
源码: prompt.rs:441-449
mini_claude_code/prompt.py:304
↓ 1 callersMethod_intro_section
(self)
tutorials/16_prompt_building_and_compaction.py:306
↓ 1 callersMethod_maybe_auto_compact
源码: conversation.rs:310-333
mini_claude_code/runtime.py:472
↓ 1 callersMethod_message_to_dict
(msg: ConversationMessage)
tutorials/02_session_and_messages.py:260
↓ 1 callersFunction_normalize
标准化内容:连续空行压成一行,去掉首尾空白
tutorials/06_system_prompt_builder.py:163
↓ 1 callersFunction_normalize_content
标准化内容(合并空行)— 源码 prompt.rs:343-344
tutorials/16_prompt_building_and_compaction.py:147
↓ 1 callersMethod_parse_hooks
从配置中解析 hooks
tutorials/09_config_system.py:169
↓ 1 callersFunction_parse_permission_mode
源码: main.rs:300+ (parse_permission_mode_arg)
mini_claude_code/main.py:604
↓ 1 callersFunction_parse_tool_input
解析工具输入 — 源码 hooks.rs:214-216
tutorials/15_permission_and_hook_pipeline.py:423
↓ 1 callersMethod_phase1_classify
阶段 1: 快速分类 (max_tokens=64)
tutorials/15_permission_and_hook_pipeline.py:672
↓ 1 callersMethod_phase2_classify
阶段 2: 深度分类 (思维链)
tutorials/15_permission_and_hook_pipeline.py:678
← previousnext →401–500 of 1,659, ranked by callers