/** * roblox-ai-os-creator-skills CLI * Multi-agent orchestration for OpenAI Codex CLI */ import { type SetupInstallMode, type SetupScope } from "./setup.js"; import { type CleanupDependencies, type CleanupResult } from "./cleanup.js"; export { readPersistedSetupPreferences, readPersistedSetupScope, resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, resolveProjectLocalCodexHomeForLaunch, } from "./codex-home.js"; export { parseTmuxPaneSnapshot, isHudWatchPane, findHudWatchPaneIds } from "../hud/tmux.js"; import { type NotifyTempContract, type ParseNotifyTempContractResult } from "../notifications/temp-contract.js"; export declare function resolveNotifyFallbackWatcherScript(pkgRoot?: string): string; export declare function resolveHookDerivedWatcherScript(pkgRoot?: string): string; export declare function resolveNotifyHookScript(pkgRoot?: string): string; export declare const HELP = "\nRoblox Creator Skills (rcs) - Creator workflow runtime for Codex CLI\n\nUsage:\n rcs Launch Codex CLI (detached tmux by default on supported interactive terminals)\n rcs exec Run codex exec non-interactively with RCS AGENTS/overlay injection\n rcs exec inject --prompt \n Queue audited follow-up instructions for a running non-interactive exec job\n rcs setup Install skills, prompts, MCP servers, and scope-specific AGENTS.md\n (user scope prompts for legacy vs plugin skill delivery when needed)\n rcs update Check npm now, update the global install immediately, then refresh setup\n rcs latest Alias for \"rcs update\" (pull @jstn-sdk/rcs@latest, then refresh setup)\n rcs @latest Alias for \"rcs update\" (explicit @latest trigger)\n rcs uninstall Remove RCS configuration and clean up installed artifacts\n rcs doctor Check installation health\n rcs list List packaged RCS skills and native agent prompts (--json)\n rcs cleanup Kill orphaned RCS MCP server processes and remove stale RCS /tmp directories\n rcs doctor --team Check team/swarm runtime health diagnostics\n rcs ask Ask local provider CLI (claude|gemini) and write artifact output\n rcs question RCS-owned blocking question UI entrypoint for agent-invoked user questions\n rcs adapt Scaffold RCS-owned adapter foundations for persistent external targets\n rcs resume Resume a previous interactive Codex session\n rcs explore Default read-only exploration entrypoint (may adaptively use sparkshell backend)\n rcs session Search prior local session transcripts and history artifacts\n rcs agents-init [path]\n Bootstrap lightweight AGENTS.md files for a repo/subtree\n rcs agents Manage Codex native agent TOML files\n rcs deepinit [path]\n Alias for agents-init (lightweight AGENTS bootstrap only)\n rcs team Spawn parallel worker panes in tmux and bootstrap inbox/task state\n rcs forge Launch Codex with forge persistence mode active\n rcs autoresearch [DEPRECATED] Use $autoresearch; direct CLI launch removed\n rcs version Show version information\n rcs tmux-hook Manage tmux prompt injection workaround (init|status|validate|test)\n rcs hooks Manage hook plugins (init|status|validate|test)\n rcs hud Show HUD statusline (--watch, --json, --preset=NAME)\n rcs sidecar Show read-only team/multi-agent visualization (--watch, --json, --tmux)\n rcs state Read/write/list RCS mode state via CLI parity surface\n rcs notepad CLI parity for RCS notepad MCP tools\n rcs project-memory\n CLI parity for RCS project-memory MCP tools\n rcs trace CLI parity for RCS trace MCP tools\n rcs code-intel\n CLI parity for RCS code-intel MCP tools\n rcs wiki CLI parity for RCS wiki MCP tools\n rcs mcp-serve Launch an RCS stdio MCP server target (plugin/runtime use)\n rcs sparkshell [args...]\n rcs sparkshell --tmux-pane [--tail-lines <100-1000>]\n Run native sparkshell sidecar for direct command execution or explicit tmux-pane summarization\n (also used as an adaptive backend for qualifying read-only explore tasks)\n rcs help Show this help message\n rcs status Show active modes and state\n rcs cancel Cancel active execution modes\n rcs reasoning Show or set model reasoning effort (low|medium|high|xhigh)\n\nCreator workflow triggers (use inside Codex sessions):\n $brief Capture goals, constraints, genre, audience, and outcome\n $blueprint Generate structured design and planning artifacts\n $forge Generate concrete creator-facing deliverables and specs\n $crew Orchestrate multi-role creator workflows\n $autoforge Run the end-to-end creator workflow with minimal supervision\n\nPsychology-aware creator triggers:\n $brief:audience Target fantasy, habit patterns, pain language, return motive\n $brief:motivation Driver ranking + anti-pattern risk scan\n $blueprint:psych Player psychology blueprint\n $blueprint:loop Session, daily, weekly, and comeback loop map\n $blueprint:retention D1/D7/D30 retention assumptions and cadence\n $blueprint:social Social machine design\n $forge:reward-loop Reward loop specification\n $forge:daily-loop Daily return motivator spec\n $forge:event-loop Event and urgency loop spec\n $forge:progression XP, level, prestige, rebirth, and unlock ladders\n $forge:status Prestige and visible status systems\n $forge:fomo Fair urgency mechanics with guardrails\n $forge:mastery Skill-expression and optimization systems\n $forge:community Social stickiness systems\n\nOptions:\n --yolo Launch Codex in yolo mode (shorthand for: rcs launch --yolo)\n --high Launch Codex with high reasoning effort\n (shorthand for: -c model_reasoning_effort=\"high\")\n --xhigh Launch Codex with xhigh reasoning effort\n (shorthand for: -c model_reasoning_effort=\"xhigh\")\n --madmax DANGEROUS: bypass Codex approvals and sandbox\n (alias for --dangerously-bypass-approvals-and-sandbox)\n --spark Use the Codex spark model (~1.3x faster) for team workers only\n Workers get the configured low-complexity team model; leader model unchanged\n --madmax-spark spark model for workers + bypass approvals for leader and workers\n (shorthand for: --spark --madmax)\n --notify-temp Enable temporary notification routing for this run/session only\n --direct Launch the interactive leader directly without RCS tmux/HUD management\n --tmux Launch the interactive leader session in detached tmux\n --discord Select Discord provider for temporary notification mode\n --slack Select Slack provider for temporary notification mode\n --telegram Select Telegram provider for temporary notification mode\n --custom \n Select custom/OpenClaw gateway name for temporary notification mode\n -w, --worktree[=]\n Launch Codex in a git worktree (detached when no name is given)\n --force Force reinstall (overwrite existing files)\n --merge-agents\n Merge RCS-managed AGENTS.md sections into an existing AGENTS.md\n instead of overwriting user-authored content\n --dry-run Show what would be done without doing it\n --plugin Use Codex plugin delivery for rcs setup and remove legacy RCS-managed user/project components\n --legacy Use legacy setup delivery for rcs setup, overriding persisted plugin mode\n --install-mode \n Explicit setup install mode (canonical form; --legacy/--plugin are aliases)\n --keep-config Skip config.toml cleanup during uninstall\n --purge Remove .rcs/ cache directory during uninstall\n --verbose Show detailed output\n --scope Setup scope for \"rcs setup\" only:\n user | project\n\nLaunch policy:\n RCS_LAUNCH_POLICY=direct|tmux|detached-tmux|auto\n Choose the default leader launch policy when no CLI policy flag is present\n unset RCS_LAUNCH_POLICY\n Return to the auto/default policy (detached tmux on supported interactive terminals)\n rcs --direct --yolo\n Run this launch without RCS tmux/HUD management\n RCS_LAUNCH_POLICY=direct rcs --yolo\n Use direct launch from the environment\n RCS_LAUNCH_POLICY=direct rcs --tmux --yolo\n CLI policy flags override the environment for one launch\n Config files are intentionally not used for launch policy in this release.\n"; type CliCommand = "launch" | "exec" | "setup" | "update" | "list" | "agents" | "agents-init" | "deepinit" | "uninstall" | "doctor" | "cleanup" | "ask" | "question" | "adapt" | "explore" | "sparkshell" | "team" | "session" | "resume" | "version" | "tmux-hook" | "hooks" | "hud" | "sidecar" | "state" | "wiki" | "mcp-serve" | "status" | "cancel" | "help" | "reasoning" | string; export interface ResolvedCliInvocation { command: CliCommand; launchArgs: string[]; } export declare function resolveSetupInstallModeArg(args: string[]): SetupInstallMode | undefined; export declare function resolveSetupScopeArg(args: string[]): SetupScope | undefined; export declare function resolveCliInvocation(args: string[]): ResolvedCliInvocation; export declare function resolveNotifyTempContract(args: string[], env?: NodeJS.ProcessEnv): ParseNotifyTempContractResult; export declare function commandOwnsLocalHelp(command: CliCommand): boolean; export type CodexLaunchPolicy = "inside-tmux" | "detached-tmux" | "direct"; export declare function resolveLeaderLaunchPolicyOverride(args: string[]): CodexLaunchPolicy | undefined; export declare function resolveEnvLaunchPolicyOverride(env?: NodeJS.ProcessEnv): CodexLaunchPolicy | undefined; export declare function resolveEffectiveLeaderLaunchPolicyOverride(args: string[], env?: NodeJS.ProcessEnv): CodexLaunchPolicy | undefined; export declare function resolveCodexLaunchPolicy(env?: NodeJS.ProcessEnv, _platform?: NodeJS.Platform, tmuxAvailable?: boolean, nativeWindows?: boolean, stdinIsTTY?: boolean, stdoutIsTTY?: boolean, explicitPolicy?: CodexLaunchPolicy): CodexLaunchPolicy; export interface PreparedCodexHomeForLaunch { codexHomeOverride?: string; projectLocalCodexHomeForCleanup?: string; runtimeCodexHomeForCleanup?: string; } export declare function runtimeCodexHomePath(cwd: string, sessionId: string): string; /** * Project-scope setup keeps durable Codex config under /.codex, but the * Codex TUI also stores model-availability NUX counters in CODEX_HOME/config.toml. * Launch against a session mirror so those runtime writes never dirty the * durable project config while preserving the project config as the launch input. */ export declare function prepareRuntimeCodexHomeForProjectLaunch(cwd: string, sessionId: string, projectCodexHome: string): Promise; export declare function prepareCodexHomeForLaunch(cwd: string, sessionId: string, env?: NodeJS.ProcessEnv): Promise; export interface TmuxLaunchHealth { usable: boolean; reason?: string; } export declare function checkDetachedTmuxLaunchHealth(): TmuxLaunchHealth; export interface CodexExecFailureClassification { kind: "exit" | "launch-error"; code?: string; message: string; exitCode?: number; signal?: NodeJS.Signals; } export declare function resolveSignalExitCode(signal: NodeJS.Signals | null | undefined): number; export declare function classifyCodexExecFailure(error: unknown): CodexExecFailureClassification; export interface DetachedSessionTmuxStep { name: string; args: string[]; } export declare function buildHudPaneCleanupTargets(existingPaneIds: string[], createdPaneId: string | null, leaderPaneId?: string): string[]; export declare function main(args: string[]): Promise; export declare function launchWithHud(args: string[]): Promise; export declare function execWithOverlay(args: string[]): Promise; export declare function normalizeCodexLaunchArgs(args: string[]): string[]; /** * Returns the spark model string if --spark or --madmax-spark appears in the * raw (pre-normalize) args, or undefined if neither flag is present. * Used to route the spark model to team workers without affecting the leader. */ export declare function resolveWorkerSparkModel(args: string[], codexHomeOverride?: string): string | undefined; export declare function resolveNativeSessionName(cwd: string, sessionId: string, env?: NodeJS.ProcessEnv): string; export declare function injectModelInstructionsBypassArgs(cwd: string, args: string[], env?: NodeJS.ProcessEnv, defaultFilePath?: string): string[]; export declare function collectInheritableTeamWorkerArgs(codexArgs: string[]): string[]; export declare function resolveTeamWorkerLaunchArgsEnv(existingRaw: string | undefined, codexArgs: string[], inheritLeaderFlags?: boolean, defaultModel?: string): string | null; export declare function readTopLevelTomlString(content: string, key: string): string | null; export declare function upsertTopLevelTomlString(content: string, key: string, value: string): string; export declare function buildTmuxSessionName(cwd: string, sessionId: string): string; export declare function buildDetachedTmuxSessionName(cwd: string, sessionId: string): string; export declare function detectDetachedSessionWindowIndex(sessionName: string): string | null; type TmuxExecSync = (file: string, args: readonly string[]) => string; export declare function acquireTmuxExtendedKeysLease(cwd: string, execFileSyncImpl?: TmuxExecSync, ownerPid?: number): string | null; export declare function releaseTmuxExtendedKeysLease(cwd: string, leaseHandle: string, execFileSyncImpl?: TmuxExecSync): void; export declare function withTmuxExtendedKeys(cwd: string, run: () => T, execFileSyncImpl?: TmuxExecSync): T; export declare function buildDetachedSessionBootstrapSteps(sessionName: string, cwd: string, codexCmd: string, hudCmd: string, workerLaunchArgs: string | null, codexHomeOverride?: string, notifyTempContractRaw?: string | null, nativeWindows?: boolean, sessionId?: string, projectLocalCodexHomeForCleanup?: string, runtimeCodexHomeForCleanup?: string): DetachedSessionTmuxStep[]; export declare function buildDetachedSessionFinalizeSteps(sessionName: string, hudPaneId: string | null, hookWindowIndex: string | null, enableMouse: boolean, nativeWindows?: boolean): DetachedSessionTmuxStep[]; export declare function buildDetachedSessionRollbackSteps(sessionName: string, hookTarget: string | null, hookName: string | null, clientAttachedHookName: string | null): DetachedSessionTmuxStep[]; export declare function buildNotifyTempStartupMessages(contract: NotifyTempContract, hasValidProviders: boolean): { infoLines: string[]; warningLines: string[]; }; export declare function buildNotifyFallbackWatcherEnv(env?: NodeJS.ProcessEnv, options?: { codexHomeOverride?: string; enableAuthority?: boolean; sessionId?: string; }): NodeJS.ProcessEnv; export declare function shouldEnableNotifyFallbackWatcher(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): boolean; export declare function cleanupLaunchOrphanedMcpProcesses(dependencies?: CleanupDependencies): Promise; interface PostLaunchCleanupDependencies { cleanup?: () => Promise; writeInfo?: (line: string) => void; writeWarn?: (line: string) => void; writeError?: (line: string) => void; } interface PostLaunchModeCleanupDependencies { readdir?: typeof import("fs/promises").readdir; readFile?: typeof import("fs/promises").readFile; writeFile?: typeof import("fs/promises").writeFile; sleep?: (ms: number) => Promise; writeWarn?: (line: string) => void; now?: () => Date; } export declare function cleanupPostLaunchModeStateFiles(cwd: string, sessionId: string, dependencies?: PostLaunchModeCleanupDependencies): Promise; export declare function reapPostLaunchOrphanedMcpProcesses(dependencies?: PostLaunchCleanupDependencies): Promise; export declare function buildTmuxShellCommand(command: string, args: string[]): string; export declare function buildWindowsPromptCommand(command: string, args: string[]): string; /** * Wrap a command for tmux pane execution while preserving the tmux pane cwd. * tmux already starts the pane at `-c `; using a login shell here can * reset that cwd back to the shell's startup directory on some setups. * Source zsh/bash rc files explicitly when needed, then exec the target. */ export declare function buildTmuxPaneCommand(command: string, args: string[], shellPath?: string | undefined): string; export declare function buildDetachedWindowsBootstrapScript(sessionName: string, commandText: string, delayMs?: number, tmuxCommand?: string): string; export declare function runDetachedSessionPostLaunch(cwd: string, sessionId: string, codexHomeOverride?: string, projectLocalCodexHomeForCleanup?: string, runtimeCodexHomeForCleanup?: string): Promise; export declare function shouldDetachBackgroundHelper(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): boolean; export type BackgroundHelperLaunchMode = "direct-detached" | "windows-msys-bootstrap"; export declare function resolveBackgroundHelperLaunchMode(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): BackgroundHelperLaunchMode; export declare function buildWindowsMsysBackgroundHelperBootstrapScript(helperArgs: readonly string[], cwd: string): string; export declare function reapStaleNotifyFallbackWatcher(pidPath: string, deps?: { exists?: (path: string) => boolean; readFile?: (path: string, encoding: BufferEncoding) => Promise; tryKillPid?: (pid: number, signal?: NodeJS.Signals) => boolean; hasErrnoCode?: (error: unknown, code: string) => boolean; warn?: (message?: unknown, ...optionalParams: unknown[]) => void; isWatcherProcess?: (pid: number) => boolean; }): Promise; //# sourceMappingURL=index.d.ts.map