core-agent-ide/codex-cli/src/utils/session.ts
Fouad Matin 2cb8355968
bump(version): 0.1.2504220136 (#518)
## `0.1.2504220136`

### 🚀 Features

- Add support for ZDR orgs (#481)
- Include fractional portion of chunk that exceeds stdout/stderr limit
(#497)
2025-04-22 01:45:30 -07:00

53 lines
1.4 KiB
TypeScript

export const CLI_VERSION = "0.1.2504220136"; // Must be in sync with package.json.
export const ORIGIN = "codex_cli_ts";
export type TerminalChatSession = {
/** Globally unique session identifier */
id: string;
/** The OpenAI username associated with this session */
user: string;
/** Version identifier of the Codex CLI that produced the session */
version: string;
/** The model used for the conversation */
model: string;
/** ISO timestamp noting when the session was persisted */
timestamp: string;
/** Optional custom instructions that were active for the run */
instructions: string;
};
let sessionId = "";
/**
* Update the globally tracked session identifier.
* Passing an empty string clears the current session.
*/
export function setSessionId(id: string): void {
sessionId = id;
}
/**
* Retrieve the currently active session identifier, or an empty string when
* no session is active.
*/
export function getSessionId(): string {
return sessionId;
}
let currentModel = "";
/**
* Record the model that is currently being used for the conversation.
* Setting an empty string clears the record so the next agent run can update it.
*/
export function setCurrentModel(model: string): void {
currentModel = model;
}
/**
* Return the model that was last supplied to {@link setCurrentModel}.
* If no model has been recorded yet, an empty string is returned.
*/
export function getCurrentModel(): string {
return currentModel;
}