Skip to content

[Prototype] ZL - agent isolated commands#7717

Draft
zzooeeyy wants to merge 2 commits into
mainfrom
zl/agent_isolated_commands
Draft

[Prototype] ZL - agent isolated commands#7717
zzooeeyy wants to merge 2 commits into
mainfrom
zl/agent_isolated_commands

Conversation

@zzooeeyy
Copy link
Copy Markdown
Contributor

@zzooeeyy zzooeeyy commented Jun 4, 2026

WHY are these changes introduced?

Fixes #0000

WHAT is this pull request doing?

How to test your changes?

Post-release steps

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@zzooeeyy zzooeeyy changed the title Zl/agent isolated commands [Prototype] ZL - agent isolated commands Jun 4, 2026
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

packages/cli-kit/dist/public/node/context/agent.d.ts
/**
 * Identifies which AI coding agent (if any) is invoking the current process.
 *
 * Mirrors the detection order from `~/Downloads/agent-env_vars` captures:
 * most-specific signals first, because some agents inherit other agents'
 * environment variables (Cursor inherits VSCODE_*; Claude Code, Codex, and
 * Gemini each have a parent signal shared by their flavors).
 *
 * This is a best-effort signal for telemetry and UX. Agents can spoof any of
 * these vars; do not gate security decisions on the result.
 */
export type CallingAgent = 'PI' | 'CODEX' | 'CODEX_VSCODE' | 'CURSOR' | 'OPENCODE' | 'GEMINI' | 'GEMINI_VSCODE' | 'GITHUB_COPILOT_CLI' | 'CLAUDE_CODE' | 'CLAUDE_CODE_VSCODE' | 'OPENCLAW' | 'VSCODE_TERMINAL' | 'ZED_TERMINAL' | 'UNKNOWN';
/**
 * Returns the calling agent based on environment variables.
 *
 * @param env - Environment variables to inspect (defaults to `process.env`).
 * @returns The detected agent, or `'UNKNOWN'` when no signal matches.
 */
export declare function callingAgent(env?: NodeJS.ProcessEnv): CallingAgent;
/**
 * The bucket key under which a session is stored. UNKNOWN agents share a
 * single `'default'` bucket; anything else is keyed by its enum value so
 * different agents on the same machine each get their own token.
 */
export declare function agentKeyFor(agent: CallingAgent): string;
/**
 * Convenience: resolves the calling agent and returns its bucket key.
 */
export declare function currentAgentKey(env?: NodeJS.ProcessEnv): string;

Existing type declarations

We found no diffs with existing type declarations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant