export declare const GJC_DIR = ".gjc"; export declare const GJC_SESSION_PREFIX = "_session-"; export declare const GJC_SESSION_ACTIVITY_FILE = ".session-activity.json"; /** Source that produced a resolved GJC session id, for audit/diagnostics. */ export type GjcSessionSource = "flag" | "payload" | "env" | "latest"; export interface GjcSessionContext { gjcSessionId: string; sessionRoot: string; source: GjcSessionSource; } /** * Encode a session id into a single safe path segment. Matches the historical * encoding used across the runtimes so ids round-trip identically: * `encodeURIComponent` plus dot-escaping (dots are legal in filenames but we * avoid `.`/`..` traversal ambiguity). */ export declare function encodeSessionSegment(value: string): string; /** Inverse of {@link encodeSessionSegment}. */ export declare function decodeSessionSegment(segment: string): string; /** Throw when a session id is missing or blank; never let blank suppress callers. */ export declare function assertNonEmptyGjcSessionId(value: string | undefined, source: string): asserts value is string; /** * Assert a value is safe to use as a single path segment: non-blank and free of * path separators or `.`/`..` traversal. Use for already-safe identifiers * (skill modes, slugs) where we want identical filenames but fail closed on * traversal rather than silently normalizing out of the intended directory. */ export declare function assertSafePathComponent(value: string, label: string): void; /** The shared `.gjc/` root (holds shared config; never session-scoped). */ export declare function gjcRoot(cwd: string): string; /** The per-session root directory: `/.gjc/_session-{encodedId}`. */ export declare function sessionRoot(cwd: string, gjcSessionId: string): string; /** Directory name (no path) for a session id, e.g. `_session-abc`. */ export declare function sessionDirName(gjcSessionId: string): string; /** Return the decoded session id for a `_session-*` directory name, else undefined. */ export declare function sessionIdFromDirName(name: string): string | undefined; /** Authoritative per-session activity marker path. */ export declare function sessionActivityPath(cwd: string, gjcSessionId: string): string; export declare function sessionStateDir(cwd: string, gjcSessionId: string): string; export declare function sessionSpecsDir(cwd: string, gjcSessionId: string): string; export declare function sessionPlansDir(cwd: string, gjcSessionId: string): string; export declare function sessionUltragoalDir(cwd: string, gjcSessionId: string): string; export declare function sessionAuditDir(cwd: string, gjcSessionId: string): string; export declare function sessionReportsDir(cwd: string, gjcSessionId: string): string; export declare function sessionLogsDir(cwd: string, gjcSessionId: string): string; export declare function sessionRuntimeDir(cwd: string, gjcSessionId: string): string; export declare function sessionIpykernelsDir(cwd: string, gjcSessionId: string): string; export declare function sessionIpykernelsArtifactsDir(cwd: string, gjcSessionId: string): string; export declare function pythonKernelTranscriptPath(cwd: string, gjcSessionId: string, dirName: string): string; export declare function sessionAutoresearchDir(cwd: string, gjcSessionId: string): string; export declare function sessionAutoresearchRunsDir(cwd: string, gjcSessionId: string): string; export declare function activeStateDir(cwd: string, gjcSessionId: string): string; export declare function activeSnapshotPath(cwd: string, gjcSessionId: string): string; export declare function activeEntryPath(cwd: string, gjcSessionId: string, skill: string): string; export declare function modeStatePath(cwd: string, gjcSessionId: string, mode: string): string; export declare function auditPath(cwd: string, gjcSessionId: string): string; export declare function transactionJournalPath(cwd: string, gjcSessionId: string, mutationId: string): string; export declare function workflowGatePath(cwd: string, gjcSessionId: string, gateId: string): string; export declare function harnessStateRoot(cwd: string, gjcSessionId: string): string; export declare function coordinatorMcpStateRoot(cwd: string, gjcSessionId: string): string; export declare function tmuxRuntimeSessionPath(cwd: string, gjcSessionId: string, slug: string): string; export declare function autoresearchRlmArtifactRoot(cwd: string, gjcSessionId: string, rlmSessionId: string): string;