//#region src/plugins/session-entry-slot-keys.ts
const SESSION_ENTRY_RESERVED_SLOT_KEYS = /* @__PURE__ */ new Set([
	"__proto__",
	"constructor",
	"prototype",
	"lastHeartbeatText",
	"lastHeartbeatSentAt",
	"heartbeatIsolatedBaseSessionKey",
	"heartbeatTaskState",
	"pluginExtensions",
	"initializationPending",
	"pluginExtensionSlotKeys",
	"pluginNextTurnInjections",
	"sessionId",
	"lifecycleRevision",
	"updatedAt",
	"incognito",
	"archivedAt",
	"archivedBy",
	"pinnedAt",
	"lastReadAt",
	"agentStatus",
	"observerDigest",
	"markedUnreadAt",
	"lastActivityAt",
	"sessionFile",
	"transcriptPath",
	"spawnedBy",
	"completionOwnerSessionKey",
	"spawnedWorkspaceDir",
	"spawnedCwd",
	"permissionMode",
	"sessionRoot",
	"sessionDiffBaseline",
	"sessionDiffBaselineCapture",
	"worktree",
	"projectId",
	"pendingProjectGitUrl",
	"pendingWorktree",
	"parentSessionKey",
	"parentSessionId",
	"createdVia",
	"createdActor",
	"sandbox",
	"owner",
	"participants",
	"participantCount",
	"createdAt",
	"forkSource",
	"previousSessionId",
	"forkedFromParent",
	"spawnDepth",
	"swarmGroupId",
	"swarmCollector",
	"swarmOutputSchema",
	"subagentRole",
	"subagentControlScope",
	"inheritedToolPolicyVersion",
	"inheritedToolDeny",
	"inheritedToolAllow",
	"lifecycleRunId",
	"lastRunId",
	"activeWriterRunId",
	"mainRestartRecovery",
	"subagentRecovery",
	"pluginOwnerId",
	"systemSent",
	"abortedLastRun",
	"restartRecoveryRuns",
	"restartRecoveryForceSafeTools",
	"goal",
	"sessionStartedAt",
	"ambientTranscriptWatermarks",
	"lastInteractionAt",
	"startedAt",
	"endedAt",
	"runtimeMs",
	"status",
	"lastRunError",
	"abortCutoffMessageSid",
	"abortCutoffTimestamp",
	"chatType",
	"contextWindow",
	"thinkingLevel",
	"cronRunContinuation",
	"fastMode",
	"toolOverrides",
	"verboseLevel",
	"traceLevel",
	"reasoningLevel",
	"elevatedLevel",
	"ttsAuto",
	"lastTtsReadLatestHash",
	"lastTtsReadLatestAt",
	"execHost",
	"execNode",
	"execCwd",
	"responseUsage",
	"usageFamilyKey",
	"usageFamilySessionIds",
	"providerOverride",
	"modelOverride",
	"agentRuntimeOverride",
	"modelOverrideSource",
	"modelOverrideRouteResolution",
	"modelOverrideFallbackOriginProvider",
	"modelOverrideFallbackOriginModel",
	"modelFallback",
	"authProfileOverride",
	"authProfileOverrideSource",
	"authProfileOverrideCompactionCount",
	"liveModelSwitchPending",
	"groupActivation",
	"groupActivationNeedsSystemIntro",
	"sendPolicy",
	"queueMode",
	"queueDebounceMs",
	"queueCap",
	"queueDrop",
	"inputTokens",
	"outputTokens",
	"totalTokens",
	"pendingFinalDelivery",
	"pendingDeliveryNotice",
	"restartRecoveryDeliveryContext",
	"restartRecoveryDeliveryMediaUrls",
	"restartRecoveryDisableMessageTool",
	"restartRecoverySuppressTextDelivery",
	"restartRecoveryDeliveryRequestFingerprint",
	"restartRecoveryDeliveryRunId",
	"restartRecoveryDeliverySourceRunId",
	"restartRecoveryBeforeAgentReplyState",
	"restartRecoveryDeliveryReceiptState",
	"restartRecoveryDeliveryToolCallId",
	"restartRecoveryRequesterAccountId",
	"restartRecoveryRequesterSenderId",
	"restartRecoverySameChannelThreadRequired",
	"restartRecoverySourceIngress",
	"restartRecoverySourceReplyDeliveryMode",
	"restartRecoveryTerminalDeliveryEvidence",
	"restartRecoveryTerminalRunIds",
	"totalTokensFresh",
	"totalTokensVersion",
	"estimatedCostUsd",
	"cacheRead",
	"cacheWrite",
	"modelProvider",
	"model",
	"modelSelectionLocked",
	"agentHarnessId",
	"fallbackNotice",
	"contextTokens",
	"contextTokensSource",
	"contextBudgetStatus",
	"compactionCount",
	"compactionCheckpoints",
	"memoryFlush",
	"cliSessionIds",
	"cliSessionBindings",
	"acpSessionBinding",
	"claudeCliSessionId",
	"label",
	"icon",
	"color",
	"category",
	"boardFace",
	"displayName",
	"delivery",
	"groupId",
	"subject",
	"groupChannel",
	"space",
	"skillsSnapshot",
	"systemPromptReport",
	"pluginDebugEntries",
	"hookExternalContentSource",
	"acp",
	"quotaSuspension",
	"pendingTranscriptRepair",
	"visibility"
]);
const RETIRED_SESSION_SLOT_KEYS = /* @__PURE__ */ new Set([
	"execSecurity",
	"execAsk",
	"channel",
	"origin",
	"route",
	"deliveryContext",
	"lastChannel",
	"lastTo",
	"lastAccountId",
	"lastThreadId",
	"pendingFinalDeliveryCreatedAt",
	"pendingFinalDeliveryLastAttemptAt",
	"pendingFinalDeliveryAttemptCount",
	"pendingFinalDeliveryLastError",
	"pendingFinalDeliveryText",
	"pendingFinalDeliveryContext",
	"pendingFinalDeliveryIntentId",
	"fallbackNoticeSelectedModel",
	"fallbackNoticeActiveModel",
	"fallbackNoticeReason",
	"memoryFlushAt",
	"memoryFlushCompactionCount",
	"memoryFlushContextHash",
	"memoryFlushFailureCount",
	"memoryFlushLastFailedAt",
	"memoryFlushLastFailureError"
]);
const OBJECT_PROTOTYPE_RESERVED_SLOT_KEYS = /* @__PURE__ */ new Set(["prototype", ...Object.getOwnPropertyNames(Object.prototype)]);
const SESSION_ENTRY_SLOT_KEY_RE = /^[A-Za-z][A-Za-z0-9_]*$/u;
function normalizeSessionEntrySlotKey(value) {
	if (typeof value !== "string") return {
		ok: false,
		error: "sessionEntrySlotKey must be a string"
	};
	const key = value.trim();
	if (!key) return {
		ok: false,
		error: "sessionEntrySlotKey cannot be empty"
	};
	if (!SESSION_ENTRY_SLOT_KEY_RE.test(key)) return {
		ok: false,
		error: "sessionEntrySlotKey must be an identifier-style field name"
	};
	if (SESSION_ENTRY_RESERVED_SLOT_KEYS.has(key) || RETIRED_SESSION_SLOT_KEYS.has(key)) return {
		ok: false,
		error: `sessionEntrySlotKey is reserved by SessionEntry: ${key}`
	};
	if (OBJECT_PROTOTYPE_RESERVED_SLOT_KEYS.has(key)) return {
		ok: false,
		error: `sessionEntrySlotKey is reserved by Object: ${key}`
	};
	return {
		ok: true,
		key
	};
}
//#endregion
export { normalizeSessionEntrySlotKey as t };
