MCPcopy Create free account

hub / github.com/dhanji/g3 / functions

Functions3,053 in github.com/dhanji/g3

↓ 10 callersMethodsave
Save pipeline state to disk
crates/studio/src/sdlc.rs:191
↓ 10 callersFunctionwrite_git_commit
Write a "GIT COMMIT" entry
crates/g3-planner/src/history.rs:137
↓ 9 callersFunctionchunk
Helper to create a chunk
crates/g3-core/tests/duplicate_detection_test.rs:10
↓ 9 callersFunctioncreate_test_agent
Helper to create a test agent with mock provider
crates/g3-core/tests/project_context_test.rs:14
↓ 9 callersFunctiondeduplicate_tool_calls
Deduplicate tool calls, detecting sequential duplicates within a chunk and duplicates against the previous message. Returns each tool call paired wit
crates/g3-core/src/streaming.rs:585
↓ 9 callersFunctiongenerate_skills_prompt
Generate the XML section for available skills. Returns an empty string if no skills are available. The XML format follows the Agent Skills specificat
crates/g3-core/src/skills/prompt.rs:12
↓ 9 callersFunctionget_session_file
Get the path to the session.json file for a session. Returns .g3/sessions/<session_id>/session.json
crates/g3-core/src/paths.rs:103
↓ 9 callersFunctionget_tool_timeout
Get the timeout duration for a tool (extracted for testing)
crates/g3-core/src/lib.rs:3126
↓ 9 callersFunctionmake_test_rulespec
()
crates/g3-core/src/tools/datalog.rs:827
↓ 9 callersFunctionprepare_plan_mode_input
Prepare user input for plan mode, prepending "Create a plan: " if this is the first message. Returns the (possibly modified) input and whether the fla
crates/g3-cli/src/interactive.rs:55
↓ 9 callersFunctionprint_prompt
Print a message and flush stdout (for prompts)
crates/g3-planner/src/planner.rs:121
↓ 8 callersFunctionappend_entry
Append an entry to planner_history.txt. This function opens the file in append mode, writes a single line, and explicitly flushes the buffer to ensur
crates/g3-planner/src/history.rs:48
↓ 8 callersFunctioncombine_project_content
Combine AGENTS.md and memory content into a single string for project context. Returns None if all inputs are None, otherwise joins non-None parts wi
crates/g3-cli/src/project_files.rs:87
↓ 8 callersMethodcomplete
(&self, request: CompletionRequest)
crates/g3-providers/src/mock.rs:432
↓ 8 callersFunctionconvert_messages_to_gemini_format
Test helper: Convert messages using the same logic as GeminiProvider This mirrors the convert_messages function behavior
crates/g3-providers/tests/gemini_serialization_test.rs:23
↓ 8 callersFunctioncreate_agent_with_mock
Helper to create an agent with a mock provider
crates/g3-core/tests/compaction_test.rs:13
↓ 8 callersFunctionextract_shell_commands
Extract shell commands from the LLM response. Looks for {{CODE EXPLORATION COMMANDS}} section and extracts commands from code blocks.
crates/g3-planner/src/lib.rs:143
↓ 8 callersMethodflush
(&self)
crates/g3-planner/src/llm.rs:319
↓ 8 callersFunctionformat_timestamp
Format a timestamp for planner_history.txt entries Format: YYYY-MM-DD HH:MM:SS (ISO 8601 for readability)
crates/g3-planner/src/history.rs:16
↓ 8 callersFunctionformat_timing_footer
Format the timing footer with optional token usage info
crates/g3-core/src/streaming.rs:250
↓ 8 callersFunctionmake_test_item
(id: &str)
crates/g3-core/src/tools/plan.rs:1121
↓ 8 callersMethodreset_with_summary
Reset the context window with a summary. Preserves the original system prompt as the first message.
crates/g3-core/src/context_window.rs:304
↓ 7 callersFunctioncheck_plan_approval_gate
Check if file changes occurred without an approved plan. This function should be called after each tool execution when in plan mode. It checks `git s
crates/g3-core/src/tools/plan.rs:1021
↓ 7 callersFunctioncommit
Make a git commit with the given summary and description
crates/g3-planner/src/git.rs:341
↓ 7 callersMethodconvert_messages
( &self, messages: &[Message], )
crates/g3-providers/src/anthropic.rs:385
↓ 7 callersMethodcreate
Create a new worktree for a session
crates/studio/src/git.rs:34
↓ 7 callersFunctioncreate_agent_with_mock
Helper to create an agent with a mock provider
crates/g3-core/tests/json_parsing_stress_test.rs:27
↓ 7 callersFunctionensure_session_dir
Ensure the session directory exists for a specific session ID. Creates .g3/sessions/<session_id>/ and subdirectories.
crates/g3-core/src/paths.rs:79
↓ 7 callersFunctionevaluate_rulespec
Evaluate a rulespec against an action envelope.
crates/g3-core/src/tools/invariants.rs:825
↓ 7 callersFunctionextract_topics_from_messages
Helper to create a fragment and extract its topics via stub generation
crates/g3-core/tests/utf8_truncation_test.rs:29
↓ 7 callersFunctionfind_json_object_end
Find the end byte-index of a complete JSON object starting at the beginning of `text`. Tracks brace nesting and string escaping to find the matching
crates/g3-core/src/utils.rs:559
↓ 7 callersMethodget_stats
Get detailed context statistics
crates/g3-core/src/lib.rs:1547
↓ 7 callersFunctionget_toolset
Get a toolset by name. Returns `Ok(Toolset)` if found, or `Err` with a helpful message listing available toolsets if not found.
crates/g3-core/src/toolsets.rs:51
↓ 7 callersMethodhandle_hint
Handle a tool parsing hint - this is the core logic extracted for use in callbacks
crates/g3-cli/src/ui_writer_impl.rs:74
↓ 7 callersMethodis_approved
Check if the plan has been approved.
crates/g3-core/src/tools/plan.rs:233
↓ 7 callersFunctionload_and_validate_project
Load and validate a project from a path string. This is the shared logic used by both `--project` CLI flag and `/project` command. It handles: - Tild
crates/g3-cli/src/project.rs:110
↓ 7 callersFunctionmake_formatter
()
crates/g3-cli/src/streaming_markdown.rs:916
↓ 7 callersMethodparse
Parse a SKILL.md file from its content and path. The file must have YAML frontmatter delimited by `---` lines, with at least `name` and `description`
crates/g3-core/src/skills/parser.rs:49
↓ 7 callersFunctionparse_evidence
Parse an evidence string into an EvidenceType.
crates/g3-core/src/tools/plan.rs:405
↓ 7 callersMethodprint_g3_status
(&self, _message: &str, _status: &str)
crates/g3-core/src/ui_writer.rs:176
↓ 7 callersFunctionread_line
Read a line of user input
crates/g3-planner/src/planner.rs:109
↓ 7 callersMethodsave
Save this fragment to disk.
crates/g3-core/src/acd.rs:148
↓ 7 callersFunctionshorten_path
Shorten a path string for display by: 1. Replacing project directory prefix with `<project_name>/` (if project is active) 2. Replacing workspace direc
crates/g3-cli/src/display.rs:27
↓ 7 callersFunctionshould_auto_continue
Simulates the should_auto_continue logic from lib.rs After removing final_output, the logic is simpler: - Continue if there's an incomplete tool call
crates/g3-core/tests/auto_continue_test.rs:123
↓ 7 callersMethodshould_compact
Check if we should trigger compaction (at 80% capacity or 150k tokens).
crates/g3-core/src/context_window.rs:268
↓ 7 callersMethodstart
Start a new background process # Arguments `name` - A unique name for this process (used to reference it later) `command` - The shell command to exec
crates/g3-core/src/background_process.rs:75
↓ 7 callersFunctionstream_in_chunks
Feed content in chunks of specified size
crates/g3-cli/tests/streaming_markdown_test.rs:17
↓ 7 callersFunctionstrip_ansi
(s: &str)
crates/g3-cli/tests/streaming_markdown_test.rs:1996
↓ 7 callersMethodupdate_usage_from_response
Update token usage from provider response. NOTE: This only updates cumulative_tokens (total API usage tracking). Calibrates `used_tokens` from the pr
crates/g3-core/src/context_window.rs:168
↓ 6 callersMethodadd_message_to_context
Add a message directly to the context window. Used for injecting discovery messages before the first LLM turn.
crates/g3-core/src/lib.rs:1174
↓ 6 callersMethodbranch_name
Get the git branch name for this session
crates/studio/src/session.rs:81
↓ 6 callersFunctioncalculate_read_limit
Calculate the maximum bytes we should read based on context window state.
crates/g3-core/tests/read_file_token_limit_test.rs:30
↓ 6 callersFunctionclean_llm_tokens
Clean LLM-specific tokens from content
crates/g3-core/src/streaming.rs:226
↓ 6 callersFunctioncreate_agent_with_mock
Helper to create an agent with a mock provider
crates/g3-core/tests/cache_stats_integration_test.rs:24
↓ 6 callersMethodexecute_task_with_timing
( &mut self, description: &str, language: Option<&str>, _auto_execute: bool,
crates/g3-core/src/lib.rs:906
↓ 6 callersFunctionextract_balanced_json
Extract a balanced JSON object/array from a string
crates/g3-core/src/feedback_extraction.rs:470
↓ 6 callersFunctionextract_report
Extract the research report from scout output. Looks for content between SCOUT_REPORT_START and SCOUT_REPORT_END markers. Preserves ANSI escape codes
crates/g3-core/src/tools/research.rs:287
↓ 6 callersFunctionfilter_accept_flag
Filter --accept from g3_args and return (filtered_args, was_accept_present) This handles the case where --accept is passed after positional args, whic
crates/studio/src/main.rs:264
↓ 6 callersFunctionfind_code_fence_ranges
Find all code fence ranges in text. Returns (start, end) byte positions. Each range represents content INSIDE a fence (between ``` markers).
crates/g3-core/src/streaming_parser.rs:77
↓ 6 callersFunctionget_system_prompt_for_native
System prompt for providers with native tool calling (Anthropic, OpenAI, etc.) Uses include_str! to embed the prompt at compile time.
crates/g3-core/src/prompts.rs:122
↓ 6 callersFunctionget_system_prompt_for_non_native
System prompt for providers without native tool calling (embedded models)
crates/g3-core/src/prompts.rs:147
↓ 6 callersFunctionget_thinking_budget_tokens
Get the thinking budget tokens for Anthropic provider, if configured.
crates/g3-core/src/provider_config.rs:52
↓ 6 callersFunctionis_json_invalidated
Check if a partial JSON tool call has been invalidated. Invalidation cases: 1. Unescaped newline inside a JSON string (invalid JSON) 2. Newline follo
crates/g3-core/src/streaming_parser.rs:127
↓ 6 callersMethodis_ok
(&self)
crates/g3-core/src/tools/plan.rs:331
↓ 6 callersFunctionload_continuation
Load the latest session continuation artifact if it exists
crates/g3-core/src/session_continuation.rs:184
↓ 6 callersFunctionmake_final_chunk
Create a final completion chunk with tool calls and usage.
crates/g3-providers/src/streaming.rs:54
↓ 6 callersFunctionmake_test_key
()
crates/g3-core/src/tools/envelope.rs:488
↓ 6 callersFunctionmake_test_rulespec
()
crates/g3-core/src/tools/envelope.rs:505
↓ 6 callersMethodmark_complete
Mark the current stage as complete and advance
crates/studio/src/sdlc.rs:245
↓ 6 callersMethodmark_failed
Mark the current stage as failed
crates/studio/src/sdlc.rs:268
↓ 6 callersMethodmark_running
Mark the current stage as running
crates/studio/src/sdlc.rs:237
↓ 6 callersMethodprint_thin_result
(&self, _result: &crate::ThinResult)
crates/g3-core/src/ui_writer.rs:177
↓ 6 callersFunctionread_include_prompt
Read include prompt content from a specified file path. Returns formatted content with emoji prefix, or None if path is None or file doesn't exist.
crates/g3-cli/src/project_files.rs:61
↓ 6 callersFunctionsetup_test_git_repo
Helper to create a test git repository
crates/g3-planner/tests/commit_history_ordering_test.rs:13
↓ 6 callersFunctionshould_register
Checks if a provider reference should be registered. A provider should be registered if: - Its full reference (e.g., "openai.default") is in the list
crates/g3-core/src/provider_registration.rs:40
↓ 6 callersMethodtake_screenshot
( &self, _path: &str, _region: Option<Rect>, _window_id: Option<&str>, )
crates/g3-computer-control/src/platform/linux.rs:16
↓ 6 callersFunctiontruncate_for_logging
Helper function to truncate strings for logging
crates/g3-core/src/error_handling.rs:380
↓ 6 callersFunctiontruncate_large_output
Truncate output if it exceeds the threshold, saving full content to a file. If the output is larger than OUTPUT_TRUNCATE_THRESHOLD: 1. Saves the full
crates/g3-core/src/tools/shell.rs:28
↓ 6 callersFunctiontry_read_embedded_skill
Try to read an embedded skill by path. Recognizes paths like: - `<embedded:research>/SKILL.md` - `<embedded:skill-name>/SKILL.md` - `&lt;embedded:res
crates/g3-core/src/tools/file_ops.rs:80
↓ 6 callersMethodwith_max_retries
Set custom max retries
crates/g3-core/src/retry.rs:65
↓ 6 callersMethodwith_response
Add a response to the queue
crates/g3-providers/src/mock.rs:379
↓ 6 callersMethodwith_responses
Add multiple responses to the queue
crates/g3-providers/src/mock.rs:385
↓ 5 callersMethodclear_tool_state
Clear all stored tool state after output is complete.
crates/g3-cli/src/ui_writer_impl.rs:186
↓ 5 callersFunctioncompress_path
Compress a file path to fit within the given width. Preserves the filename and as much of the path as possible. Truncates parent directories from the
crates/g3-cli/src/terminal_width.rs:56
↓ 5 callersFunctioncreate_agent_mode_agent
Helper to create a test agent in agent mode
crates/g3-core/tests/test_agent_session_id.rs:24
↓ 5 callersFunctioncreate_controller
Platform-specific constructor
crates/g3-computer-control/src/lib.rs:30
↓ 5 callersFunctioncreate_test_project
(name: &str)
crates/g3-cli/src/interactive.rs:365
↓ 5 callersFunctiondetect_languages
Detect languages present in the workspace by scanning for file extensions. Returns a list of detected language names.
crates/g3-cli/src/language_prompts.rs:36
↓ 5 callersMethodenter_workspace
Change to the workspace directory
crates/g3-core/src/project.rs:126
↓ 5 callersMethodexecute
(&self)
crates/g3-providers/src/oauth.rs:273
↓ 5 callersFunctionextract_yaml_from_markdown
Extract YAML content from a markdown file with ```yaml code block.
crates/g3-core/src/tools/plan.rs:612
↓ 5 callersFunctionfind_incomplete_agent_session
Find an incomplete agent session for the given agent name. Returns the most recent session that: 1. Was running in agent mode with the matching agent
crates/g3-core/src/session_continuation.rs:408
↓ 5 callersMethodfor_coach
Create a copy of the config for coach mode in autonomous execution
crates/g3-config/src/lib.rs:666
↓ 5 callersFunctionformat_envelope_markdown
Format an action envelope as human-readable markdown. This produces a rich, readable format suitable for tool output, showing the facts recorded abou
crates/g3-core/src/tools/invariants.rs:968
↓ 5 callersFunctiongenerate_session_id
Generate a session ID based on description and optional agent name. For agent mode, uses agent name as prefix. For regular mode, uses first 5 words o
crates/g3-core/src/session.rs:56
↓ 5 callersFunctionget_fragments_dir
Get the fragments directory for a session (for ACD dehydrated context). Returns .g3/sessions/<session_id>/fragments/
crates/g3-core/src/paths.rs:97
↓ 5 callersFunctionget_g3_dir
Get the base .g3 directory path. This is the root for all g3 session data in the current workspace.
crates/g3-core/src/paths.rs:63
↓ 5 callersFunctionget_system_prompt_for_native_with_skills
System prompt for providers with native tool calling, with skills support.
crates/g3-core/src/prompts.rs:127
↓ 5 callersMethodhas_native_tool_calling
(&self)
crates/g3-core/tests/streaming_completion_test.rs:229
↓ 5 callersMethodlog_error
Log the error context with ERROR level
crates/g3-core/src/error_handling.rs:100
← previousnext →101–200 of 3,053, ranked by callers