M0: compilable skeleton — Kigi 0.1.0 fork surgery

Hard fork of xai-org/grok-build (Apache-2.0) re-targeted as Kigi, an
unofficial Kimi Code CLI community build.

Rename & identity
- 72 xai-*/xai-grok-* crates -> kigi-* (explicit: xai-grok-pager-bin ->
  kigi-bin [binary `kigi`], xai-grok-pager -> kigi-tui; rest mechanical);
  ptyctl, ptyctl-cli, third_party/ unchanged; proto package
  xai.grok.tools.v1 -> kigi.tools.v1
- Config home ~/.kigi (KIGI_SHARE_DIR override), env prefix GROK_* ->
  KIGI_*, `kigi --version` carries the unofficial-community-build notice
- clap identity, help text, startup banner, prompt templates rebranded
  (templates re-encrypted)

Deletions (PRD removal list #5/#6/#7/#9/#10)
- voice input (xai-grok-voice) and all TUI wiring
- telemetry: Mixpanel client, external OTel stream, Sentry, OTLP layers,
  trace/GCS/S3 upload queues (kigi-file-utils halved), workspace upload
  module & dc_log, heap-profile uploader, auth-diagnostics uploader,
  session-analytics halves of feedback; local zero-egress observability
  preserved in new kigi-log crate (unified log, --debug firehose,
  subsystem file logs, opt-in instrumentation)
- announcements (crate, remote-settings fields, TUI surfaces)
- plugin marketplace (crate, sources/browse/CTA/extensions-modal tab);
  direct plugin install/uninstall/update via kigi-agent git_install kept
- relay/gateway/assets endpoints and features (agent relay, headless
  relay transport, gateway bridge, LeaderEnvUrls); leader IPC socket now
  ~/.kigi/leader.sock + KIGI_LEADER_SOCKET, no ws-url derivation
- functional types rehomed instead of deleted: PermissionMode ->
  kigi-config-types, McpInitStrategy -> kigi-mcp, PrCreationSource ->
  session signals, TerminalDiagnostics -> kigi-pager-render, agent_id ->
  shell util

Endpoints
- kigi-env rewritten: single production KigiEndpoints {coding_api_base_url
  https://api.kimi.com/coding/v1 (KIGI_CODE_BASE_URL), oauth_host
  https://auth.kimi.com (KIGI_OAUTH_HOST), update_base_url (GitHub
  Releases API), upgrade_page_url}; GrokBuildEnvironment enum deleted

Toolchain & workspace hygiene
- Rust 1.97.0 pinned; edition 2024; full cargo update; git2 hoisted to
  workspace at 0.21 (Option->Result API migration), quick-xml 0.41
- Root Cargo.toml hand-maintained (PRD §8.1): version 0.1.0 inherited by
  all members, members sorted, unused deps pruned
- cargo-deny advisories gate (deny.toml with documented transitive
  exceptions); CI workflow (check/clippy/fmt/deny/test, macOS+Linux)
- cross-crate test seams re-gated behind `test-support` cargo feature;
  insta snapshot baselines renamed to the kigi_tui prefix
- clippy --workspace --all-targets: zero warnings; fmt clean

Fixes surfaced by the port
- updater probe/installer divergence (bin/kigi vs bin/grok symlink set)
- idle model-metadata refresh dead under KIGI_CODE_BASE_URL override
  (new is_effective_coding_endpoint_url, loopback+override aware)
- macOS symlinked-TMPDIR fixture canonicalization (foreign_sessions,
  fast-worktree); RSS measurement tests serialized via serial_test

Docs & legal (Apache §4)
- NOTICE added (upstream attribution + change statement); THIRD-PARTY
  notices sustained; kigi-tools ported-code notices extended; README,
  CONTRIBUTING, SECURITY, AGENTS.md rewritten

Out of scope for M0 (tracked): Kimi auth/inference (M1), search/fetch,
command parity, config import (M2), Computer Hub excision & final
brand-token sweep (M2), distribution & self-update rewrite (M3).
This commit is contained in:
ZacharyZhang-NY committed 2026-07-17 05:31:01 -04:00
commit d6c20fc13f
2612 files changed
+1353757

No files matched your search

@@ -0,0 +1,91 @@
Your task is to create a detailed summary of the Grok Chat conversation so far, paying close attention to the user's explicit requests and all previous actions as Grok (built by xAI).
This summary should be thorough in capturing technical details, code patterns, architectural decisions, tool chains, and verification steps that would be essential for continuing development, research, or complex tasks without losing context.
Important Clarification on Terminology (Broad File Definition):
Throughout this prompt, the term "file", "files", "file IDs", "file names", and "Files and Code Sections / Artifacts" are defined broadly. They explicitly include:
- Regular files and code files
- Attachments
- Images (uploaded images, generated images, viewed images, etc.)
- rendered image or content outputs
- Any other file-like content, media objects, visual artifacts, or structured content blocks that have appeared in the conversation history (including but not limited to uploads, generations, render components, or persistent references).
Only include information that is visible in the direct user-Grok conversation history (user messages + Grok's responses, reasoning, tool calls, and tool outputs). Do not include any internal team communication, chatroom messages, or multi-agent interactions.
Use your internal thinking channel to chronologically analyze each message and section of the conversation before producing the final summary, and ensure you've covered all necessary points.
During that analysis, thoroughly identify:
- The user's explicit requests and evolving intents
- Grok's approach to addressing them: reasoning steps, specific tool calls (including parallel calls), parameters, results, and how they were interpreted/synthesized (truth-seeking emphasis)
- Key decisions, technical concepts, code patterns, and architectural choices
- Specific details like:
- file IDs, attachment IDs, image references/URLs, render_result IDs (if any)
- file names, attachment names, image captions/descriptions, render component details (if any)
- full code snippets (especially recent ones or those executed in REPL)
- function signatures
- file edits / diffs
- tool call details (e.g., code_execution snippets, web_search queries, browse_page instructions, X search operators)
- render components used (if any)
- Errors encountered (tool failures, code exec errors, search limitations, reasoning issues) and how they were diagnosed/fixed
- Pay special attention to specific user feedback, especially if the user told you to do something differently, corrected facts, or changed direction.
Double-check for technical accuracy and completeness, addressing each required element thoroughly.
Your final summary must contain the following sections, in order:
1. Primary Request and Intent: Capture all of the user's explicit requests and intents in detail, including any evolution over the conversation.
2. Key Technical Concepts: List all important technical concepts, technologies, frameworks, and Grok-specific tool patterns discussed.
3. Tool Usage & Verification: Summarize significant tool calls (code_execution REPL state, web_search, browse_page, X tools, etc.), key information retrieved/verified, cross-referencing steps, and how they influenced decisions or responses.
4. Files, Attachments, Images, Render Results & Code Artifacts: Enumerate all specific file-like artifacts (broadly defined as above: files, attachments, images, render_results, etc.), code sections, or REPL executions examined, modified, or created. Pay special attention to the most recent messages and include full code snippets, image descriptions/references, render outputs, or attachment details where applicable, plus a summary of why this artifact is important for continuation.
5. Errors and Fixes: List all errors encountered (tool-related or otherwise), how you fixed them, and specific user feedback (especially "do something differently").
6. Problem Solving: Document problems solved, tool-assisted solutions, and any ongoing troubleshooting efforts.
7. All User Messages: List ALL user messages that are not tool results (verbatim or high-fidelity summary). These are critical for understanding feedback and intent changes.
Here's an example of how your output should be structured:
<example>
1. Primary Request and Intent:
[Detailed description]
2. Key Technical Concepts:
- [Concept 1]
- [Concept 2]
- [...]
3. Tool Usage & Verification:
- [Key tool calls and verification steps]
4. Files, Attachments, Images, Render Results & Code Artifacts:
- [Artifact 1 (broadly defined file/attachment/image/render etc.)]
- [file/attachment/image/render name and ID]
- [Summary of importance]
- [Changes or execution results]
- [Important Code Snippet / Image reference / Render details]
5. Errors and Fixes:
- [Error 1]: [How fixed] [User feedback]
6. Problem Solving:
[Description]
7. All User Messages:
- [Detailed non tool use user message]
- [...]
</example>
Output the summary directly using the section headings above. Do not wrap the output in any XML tags or other markup — emit the seven sections as plain text.
There may be additional summarization instructions provided in the included context. If so, follow these instructions when creating the above summary. Examples of instructions include:
<example>
## Compact Instructions
When summarizing focus on tool outputs, REPL state, code changes, test results, and recent user feedback/corrections. Include critical code snippets and tool calls verbatim.
</example>
<example>
# Summary instructions
When using compact mode — prioritize most recent tool results, executed code diffs, and exact user instructions on direction changes.
</example>
@@ -0,0 +1,91 @@
Your task is to create a detailed summary of the Grok Chat conversation so far, paying close attention to the user's explicit requests and all previous actions as Grok (built by xAI).
This summary should be thorough in capturing technical details, code patterns, architectural decisions, tool chains, and verification steps that would be essential for continuing development, research, or complex tasks without losing context.
Important Clarification on Terminology (Broad File Definition):
Throughout this prompt, the term "file", "files", "file IDs", "file names", and "Files and Code Sections / Artifacts" are defined broadly. They explicitly include:
- Regular files and code files
- Attachments
- Images (uploaded images, generated images, viewed images, etc.)
- rendered image or content outputs
- Any other file-like content, media objects, visual artifacts, or structured content blocks that have appeared in the conversation history (including but not limited to uploads, generations, render components, or persistent references).
Only include information that is visible in the direct user-Grok conversation history (user messages + Grok's responses, reasoning, tool calls, and tool outputs). Do not include any internal team communication, chatroom messages, or multi-agent interactions.
Use your internal thinking channel to chronologically analyze each message and section of the conversation before producing the final summary, and ensure you've covered all necessary points.
During that analysis, thoroughly identify:
- The user's explicit requests and evolving intents
- Grok's approach to addressing them: reasoning steps, specific tool calls (including parallel calls), parameters, results, and how they were interpreted/synthesized (truth-seeking emphasis)
- Key decisions, technical concepts, code patterns, and architectural choices
- Specific details like:
- file IDs, attachment IDs, image references/URLs, render_result IDs (if any)
- file names, attachment names, image captions/descriptions, render component details (if any)
- full code snippets (especially recent ones or those executed in REPL)
- function signatures
- file edits / diffs
- tool call details (e.g., code_execution snippets, web_search queries, browse_page instructions, X search operators)
- render components used (if any)
- Errors encountered (tool failures, code exec errors, search limitations, reasoning issues) and how they were diagnosed/fixed
- Pay special attention to specific user feedback, especially if the user told you to do something differently, corrected facts, or changed direction.
Double-check for technical accuracy and completeness, addressing each required element thoroughly.
Your final summary must contain the following sections, in order:
1. Primary Request and Intent: Capture all of the user's explicit requests and intents in detail, including any evolution over the conversation.
2. Key Technical Concepts: List all important technical concepts, technologies, frameworks, and Grok-specific tool patterns discussed.
3. Tool Usage & Verification: Summarize significant tool calls (code_execution REPL state, web_search, browse_page, X tools, etc.), key information retrieved/verified, cross-referencing steps, and how they influenced decisions or responses.
4. Files, Attachments, Images, Render Results & Code Artifacts: Enumerate all specific file-like artifacts (broadly defined as above: files, attachments, images, render_results, etc.), code sections, or REPL executions examined, modified, or created. Pay special attention to the most recent messages and include full code snippets, image descriptions/references, render outputs, or attachment details where applicable, plus a summary of why this artifact is important for continuation.
5. Errors and Fixes: List all errors encountered (tool-related or otherwise), how you fixed them, and specific user feedback (especially "do something differently").
6. Problem Solving: Document problems solved, tool-assisted solutions, and any ongoing troubleshooting efforts.
7. All User Messages: List ALL user messages that are not tool results (verbatim or high-fidelity summary). These are critical for understanding feedback and intent changes.
Here's an example of how your output should be structured:
<example>
1. Primary Request and Intent:
[Detailed description]
2. Key Technical Concepts:
- [Concept 1]
- [Concept 2]
- [...]
3. Tool Usage & Verification:
- [Key tool calls and verification steps]
4. Files, Attachments, Images, Render Results & Code Artifacts:
- [Artifact 1 (broadly defined file/attachment/image/render etc.)]
- [file/attachment/image/render name and ID]
- [Summary of importance]
- [Changes or execution results]
- [Important Code Snippet / Image reference / Render details]
5. Errors and Fixes:
- [Error 1]: [How fixed] [User feedback]
6. Problem Solving:
[Description]
7. All User Messages:
- [Detailed non tool use user message]
- [...]
</example>
Output the summary directly using the section headings above. Do not wrap the output in any XML tags or other markup — emit the seven sections as plain text.
There may be additional summarization instructions provided in the included context. If so, follow these instructions when creating the above summary. Examples of instructions include:
<example>
## Compact Instructions
When summarizing focus on tool outputs, REPL state, code changes, test results, and recent user feedback/corrections. Include critical code snippets and tool calls verbatim.
</example>
<example>
# Summary instructions
When using compact mode — prioritize most recent tool results, executed code diffs, and exact user instructions on direction changes.
</example>
@@ -0,0 +1,3 @@
You are summarizing the tool-call history of an AI assistant that is partway through answering a user's question.
The assistant has made several tool calls (web searches, file reads, code execution, etc.) and accumulated tool results that are now taking up too much context window space. Your summary will replace those tool calls + results, so the assistant can continue its work with the same effective knowledge but less context overhead.
@@ -0,0 +1,67 @@
Your task is to create a detailed summary of the tool-call history above, paying close attention to preserving all information the assistant needs to continue its current task without losing context.
This summary should be thorough in capturing technical details, code patterns, data points, and intermediate results that would be essential for continuing the current work.
CRITICAL: If the tool-call history contains a previous compaction summary (marked with "ConversationCompaction" or similar markers), you MUST incorporate ALL information from that previous summary into your new summary. Previous summaries contain essential context from earlier steps that would otherwise be lost.
Use your internal thinking channel to chronologically review each tool call and its result before producing the final summary, and ensure you've covered all necessary points.
During that analysis, thoroughly identify:
- What was searched, read, or executed and why
- Key findings, data points, and outcomes
- Specific details like:
- file paths, URLs, IDs, error messages
- full code snippets (especially recent ones)
- function signatures and configuration details
- tool call parameters and results
- Errors encountered and how they were resolved
- Double-check for completeness — every piece of data the assistant gathered must be preserved.
Your final summary must contain the following sections, in order:
1. Task and Intent: What the assistant is trying to accomplish for the user, including the current sub-goal.
2. Key Findings: Facts, data points (numbers, dates, IDs, URLs), schema details, and any other information gathered from tool calls. Preserve specific data verbatim.
3. Files and Code: Enumerate specific file paths examined, modified, or created. Include key code snippets, function signatures, and configuration details verbatim, plus a summary of why each file is important.
4. Errors and Fixes: All errors encountered, how each was resolved, including specific error messages verbatim.
5. Actions Taken: Successful modifications, commands run, and their outcomes.
6. Current Progress: What has been completed and what remains to be done.
Here's an example of how your output should be structured:
<example>
1. Task and Intent:
[Detailed description of what the assistant is working on]
2. Key Findings:
- [Finding 1 with specific data verbatim]
- [Finding 2]
- [...]
3. Files and Code:
- [file path 1]
- [Summary of importance]
- [Key code snippet or changes]
- [file path 2]
- [...]
4. Errors and Fixes:
- [Error message verbatim]: [How fixed]
5. Actions Taken:
- [Action 1]: [Outcome]
- [...]
6. Current Progress:
[What is done, what remains]
</example>
Output the summary directly using the section headings above. Do not wrap the output in any XML tags or other markup — emit the six sections as plain text.
IMPORTANT:
- Do NOT call any tools. Output the summary text only.
- Preserve specific data verbatim — URLs, file paths, code snippets, error messages, ID strings.
- Write in the same language as the conversation. If the conversation is primarily in Chinese, write the summary in Chinese (keep technical terms, file paths, and code in English).
- Do not invent information that is not in the tool-call history.