Skip to content

feat(export): record install source and shell environment in manifest#105

Merged
liruifengv merged 3 commits into
mainfrom
export-install-source
May 27, 2026
Merged

feat(export): record install source and shell environment in manifest#105
liruifengv merged 3 commits into
mainfrom
export-install-source

Conversation

@liruifengv
Copy link
Copy Markdown
Collaborator

@liruifengv liruifengv commented May 27, 2026

Problem

The exported session archive (kimi export) lacks information about how the CLI was installed and what terminal environment the user is running in. This diagnostic context is valuable for triaging issues from exported sessions.

What changed

Added two new optional fields to the export manifest:

  • installSource — records how the CLI was installed (npm-global, pnpm-global, yarn-global, bun-global, native, or unsupported), reusing the existing detectInstallSource() logic from the update module.
  • shellEnv — captures the user's terminal environment via standard environment variables:
    • TERM — terminal type (e.g. xterm-256color)
    • TERM_PROGRAM — terminal emulator (e.g. iTerm.app, Apple_Terminal, vscode)
    • TERM_PROGRAM_VERSION — terminal version
    • multiplexer — detected terminal multiplexer (tmux, screen, or zellij)
    • SHELL — user's login shell

Both fields flow through the full chain: CLI → SDK (ExportSessionInput) → agent-core (ExportSessionPayload) → buildExportManifest()manifest.json in the ZIP.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Capture how the CLI was installed (npm-global, native, etc.) and the
user's terminal environment (TERM, TERM_PROGRAM, multiplexer, SHELL)
so exported session archives carry richer diagnostic context.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: fcc119b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@moonshot-ai/agent-core Patch
@moonshot-ai/kimi-code-sdk Patch
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@liruifengv liruifengv merged commit d599183 into main May 27, 2026
4 checks passed
@liruifengv liruifengv deleted the export-install-source branch May 27, 2026 06:39
@github-actions github-actions Bot mentioned this pull request May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant